Repository navigation
v0.43.0
Features
Dividers can be a percentage of their column
@templatical/editor · @templatical/renderer · @templatical/template-tools · @templatical/types
DividerBlock.width takes "full", a pixel number, or a percentage from "0%" to "100%" (the new DividerPercentWidth type). The renderer writes a percentage straight into mj-divider, which MJML renders as a share of the column, so the line shrinks with the column on a phone where a pixel width would overflow. The canvas draws it the same way, and templatical validate accepts it. A custom blockRenderers.divider must handle the percentage string.
Fixes and improvements
BeeFree imports keep divider widths, fonts and link colour
@templatical/import-beefree
- A divider keeps its width.
100%imported as a 100px line. A missing width or100%now imports as"full", any other percentage stays a percentage such as"50%"(clamped to 0–100%, kept to two decimals), and a px width stays px unless it reaches its column's content width, the column less the divider's own padding, where it becomes"full". Templatical centres every divider, so a partial-width divider that BeeFree aligns left or right is reportedapproximated, and so is a clamped or unreadable width. - A CSS-wide keyword is no longer a font. BeeFree's paragraph modules write
font-family: inherit, which became a font of its own on the block, and the sent email fell back to the client's default face.inherit,initial,unsetandrevertnow leave a title, button or menu font unset, so it followssettings.fontFamily, and a paragraph gains nofont-familyspan. In a colour, the same keywords andnoneread as unset. - The link colour carries over.
page.body.content.computedStyle.linkColormaps tosettings.linkColor. Links are underlined: BeeFree sets underlines per link, and every import turned the document-wide underline off before. - The body width and text colour carry over. BeeFree exports keep the body width in
page.body.content.computedStyle.messageWidth, which now maps tosettings.width, withstyle.widthas the fallback; every real export imported at 600px before, and dividers are now measured against the real width.page.body.content.style.colormaps tosettings.textColor,#1a1a1awhen unset. A heading, menu or table with no colour of its own now follows it instead of carrying#1a1a1a, and a paragraph keeps a colour span only where its colour differs from the body's.
Easy Email Pro imports keep text, merge tags, tables, raw HTML, headers and footers
@templatical/import-easy-email-pro
standard-textimports as a paragraph. It is Easy Email Pro's default text block, and it imported as an HTML block holding the node's JSON, so recipients saw JSON. It now maps the same way asstandard-paragraph, withblockAttributes["standard-text"]and theTEXTcategory in its attribute cascade.- Inline
html-nodeelements keep their text. A<span>,<em>,<strong>or<br>inside rich text was dropped along with its words. It now serialises as its tag with its string attributes, escaped; void tags such asbrandimgself-close. Anhtml-nodesitting directly in a column is still anhtml-fallback. - Merge tags survive. "Hello {mergetag}, here is your order" imported as "Hello , here is your order". A
mergetagnow becomes the token Easy Email Pro renders, such as{{ customer.name }}, with the marks of its text, and the editor turns it into a merge tag. standard-table2tables import. Their rows arestandard-table2-trand their cellsstandard-table2-td; only atr/tdshape was read, so a real table produced no block and no report entry. Both shapes are read now.rawimports as an HTML block of itsdata.content, reportedconverted. It was an HTML block holding the node's JSON.page-headerandpage-footerconvert their content. Theirdata.contentwalks the way page children do, in order, and the band's background and padding land on the resulting sections assection.wrapper, as astandard-wrapper's do. The whole band was one HTML block holding its JSON. An empty band is reportedskipped.- A divider keeps its width. A missing width or
100%imports as"full", any other percentage stays a percentage such as"50%"(clamped to 0–100%), and a px width stays px unless it fills its column's content width less the divider's own padding, where it becomes"full". Every divider imported full-width before.
HTML import keeps divider widths, section backgrounds, cell padding, paragraph alignment and link underlines
@templatical/import-html
- Dividers keep their width. Every
<hr>imported as a 100px line. An<hr>with no width,autoor100%now spans the column, any other percentage stays a share of the column (rounded to two decimals, clamped to 0–100%), and a px width stays px unless it reaches the room the line has in its column, measured fromsettings.width, the column's share and the padding around the line. A clamped or unreadable width, and a partial-width divider aligned left or right, are reported asapproximated. - Sections keep their background colour. Only a
<tr>style was read, so abgcolorattribute and the fill of a cell or a table were dropped, including the section colours of HTML compiled from Templatical's own MJML. A section now takes the nearest fill: the<tr>, then the row's cells when they share one, then the tables around it, including those of the wrapper rows the importer descends through. A row whose cells render on different fills is reported asapproximated, and a button cell'sbgcolorcolours its button rather than the section. - Cell padding reaches every block in the cell. Only bare text took a cell's padding, so a padded cell holding a heading, an image, a divider or a button imported them flush against its edges. The padding is now added to the blocks the cell holds: the sides to every block, the top to the first and the bottom to the last. A table's
cellpaddingis honoured, nested cells and wrappers add up, and a spacer at a cell's edge takes that side's padding as height. - A paragraph keeps its own alignment. A wrapper's
text-alignoverrode thetext-alignof a<p>inside it. The paragraph's own alignment now wins. - Links are underlined unless the source says otherwise.
settings.linkUnderlinewas alwaysfalse. It is nowtrue, the browser default, unless a<style>rule for every link,a { text-decoration: … }, sets it.
Imported Topol buttons no longer paint their row in their fill colour
@templatical/import-topol
On a Topol mj-button, background-color is the button face. The importer also copied it into the block background, which renders as the row behind the button, so a button with a fill painted its whole row in that colour. A block's background now comes from container-background-color, the attribute MJML paints behind every leaf element, and the button face still comes from background-color. Text, image, spacer, divider and social nodes follow the same rule: a background-color on them, which MJML never paints, no longer becomes a block background, and a container-background-color they set now does. A section still takes its fill from its own background-color.
MJML imports keep paragraph alignment, colour and size, and divider widths
@templatical/import-mjml
- A paragraph keeps its
mj-textalignment, colour and size.<mj-text align="center" color="#4b5563" font-size="15px">imported left-aligned in the document's colour and size, and the same values set throughmj-classwere lost too.alignnow lands astext-alignon each<p>, andcolorandfont-sizeon one span inside it, the shape the paragraph editor keeps through an edit. Bare list-item text gets a<p>first. The<p>'s own values win, alignment to the start edge and a 14px size add nothing, and markup with nothing to apply is left exactly as it was.<mjml dir>setssettings.directionwhen it differs from the directionlangimplies, so the start edge is the imported template's own. - A divider keeps its width. Every
mj-dividerimported as"full", so50%and200pxwere both lost while reportedconverted. A missing width or100%still imports as"full", any other percentage stays a percentage to two decimals such as"50%", and a px width stays px unless it reaches the width the line can span, where it becomes"full". That width is the column less the column's and the divider's own side padding, which is howmj-dividerdraws100%. A width clamped into 0–100% or up to 0px, an unreadable width, and a partial-width divider aligned left or right, which Templatical centres, are reportedapproximated.
Stripo import keeps one section per row, divider widths, page and band colours, structure padding and plugin CSS
@templatical/import-stripo
- Each structure row is its own section. Compiled HTML made one section per stripe, so a heading and a two-column row in the same cell landed in one section and copy between the columns was dropped or appended. Each direct row is now a section, in document order. Content before the columns stays before them, content after stays after them, and content that sat between them becomes a one-column section after the columns. An empty row is skipped. A padded cell split across those sections keeps the top padding on the first, the bottom on the last and the sides on each, and that split is
approximated. Four or more floated columns in one row still fold into three. - A line-drawing spacer is a divider.
es-spacerandesd-block-spacerimported as a spacer whenever they carried a height, so aborder-bottomline became empty space. A visibleborder-bottomorborder-topis now a divider: style, colour, thickness and width. No width,autoor100%spans the column; another percentage stays a percentage, rounded to two decimals and clamped to 0–100; a px width stays px until it fills the column's room.double,groove,ridge,insetandoutsetimport assolid. A partial-width line aligned left or right is centred. Both areapproximated. A spacer with no border stays a spacer. - Page, band and body colours land on the surface that paints them.
settings.backgroundColorstayed#ffffff, so a Launchpad page of#F3F4F6imported white. The first paintedes-wrapperores-wrapper-coloris now the page colour. Anes-*-bodyfill is the section background. A transparent body leaves the stripe colour on the section. A stripe colour that differs from both the page and the body becomessection.wrapper.backgroundColor, and that section isapproximated. A background image is reported and dropped; the colour still applies. - Structure padding is the section's padding. Sections kept the factory padding of 20 on every side. The structure cell's padding is now the section's, and the default is 0. Plugin HTML reads
es-p*(es-p20, thenes-p10t/r/b/l), and an inline padding overrides the sides it states. - Plugin CSS reaches the blocks.
options.csswas injected for detection and never reached the HTML walk, so ap { color }rule left the paragraph uncoloured. The same CSS is now applied inside each cell, with a</stylebreakout still neutralized. The report lists the blocks that remain in the content: a<tr>section the HTML walk invents is omitted, and Stripo's own section entries stay.
Unlayer imports keep divider widths, section colours and document settings
@templatical/import-unlayer
- A divider keeps its width.
100%imported as a 100px line. A missing width or100%now imports as"full", any other percentage stays a percentage such as"50%"(clamped to 0–100%), and a px width stays px until it spans its column less the divider's side padding, where it becomes"full". Templatical centres every divider, so a partial-width divider that Unlayer aligns left or right is reportedapproximated. - A section takes the row's content colour. Sections read
columnsBackgroundColor, the colour Unlayer fills the content width with, and fall back to the row'sbackgroundColor. They read onlybackgroundColorbefore, which is the band outside the content width. When a row sets both to different colours,report.warningsnames the dropped one. - The preheader, text colour and link style carry over.
preheaderText,textColor,linkStyle.linkColorandlinkStyle.linkUnderlinemap to theirsettingsfields. Headings and menus with no colour of their own follow the imported text colour instead of a fixed#1a1a1a, and a paragraph keeps a colour span that differs from it. Links are underlined whenlinkStyledoes not say, as in Unlayer; every import turned the underline off before.UnlayerTemplatetypes thelinkStyleflags as booleans.
All 15 @templatical/* packages are published at 0.43.0 — they share one version number.
Full changelog: https://docs.templatical.com/changelog