From 1.309.4 to 1.339.0
Text Tool Deprecated
The Text tool has been deprecated in favor of the new Paragraph tool. Existing templates with Text blocks can still be loaded for backward compatibility, but the legacy Text tool is no longer actively maintained or receiving new bug fixes.
Key Differences
| Text Tool (deprecated) | Paragraph Tool (new) | |
|---|---|---|
| Tool name | text | paragraph |
| Text property | text (HTML string) | textJson (JSON string) |
Default Value Format Change
The Text tool used an HTML string for its text property:
// Text tool (deprecated)
unlayer.init({
tools: {
text: {
properties: {
text: {
value:
'<p style="line-height: 140%;">This is a new Text block. Change the text.</p>',
},
},
},
},
});
The Paragraph tool uses a JSON string for its textJson property:
// Paragraph tool (new)
unlayer.init({
tools: {
paragraph: {
properties: {
textJson: {
value:
'{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","text":"This is a new Paragraph block. Change the text.","type":"extended-text","version":1}],"format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"format":"","indent":0,"type":"root","version":1}}',
},
},
},
},
});
Migrate Your Configuration
Update your configuration to use tools.paragraph and the textJson property format shown above. This changes the defaults for Paragraph blocks; it does not convert Text blocks in your stored design JSON.
Migrate Existing Templates
Use the Cloud API's Text-to-Paragraph conversion endpoint to convert existing design JSON:
POST /v3/templates/convert/text-to-paragraph
Call this endpoint from your server, using the authentication described in the API reference. Submit the design JSON in the request body's design property.
The response includes:
data.design: The converted design JSON. The API returns a converted copy; it does not create or modify a saved template.data.convertedCount: The number of Text blocks converted.data.warnings: Warnings about structural or lossy conversions, such as block splitting, unsupported table styling or dropped elements. Each warning identifies its source Text block.
A Text block containing a table, image or horizontal rule can become several blocks: Paragraph blocks plus Table, Image or Divider blocks. The first block keeps the original ID; additional blocks receive new IDs.
Before saving the converted design:
- Review
data.warningsfor each template and address any conversion issues. - Load the returned
data.designin the builder and review the content and layout. - Save the converted design only after reviewing it. The conversion request does not overwrite your stored template.
Preserve Legacy Text Behavior
If you need to preserve legacy behavior, lock your builder version to a version where the Text tool is still available. Version locking does not migrate your configuration or stored designs to Paragraph, and backward compatibility does not mean the legacy Text tool receives new fixes.