@trafica/editor 1.0.57 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1725,19 +1725,15 @@ function serializeBlock(node, idCounts = /* @__PURE__ */ new Map(), inCell = fal
|
|
|
1725
1725
|
const src = escapeAttr((_j = (_i = node.attrs) == null ? void 0 : _i.src) != null ? _j : "");
|
|
1726
1726
|
const alt = escapeAttr((_l = (_k = node.attrs) == null ? void 0 : _k.alt) != null ? _l : "");
|
|
1727
1727
|
const width = ((_m = node.attrs) == null ? void 0 : _m.width) ? ` width="${node.attrs.width}"` : "";
|
|
1728
|
-
const
|
|
1729
|
-
const alignAttr = alignVal ? ` data-align="${alignVal}"` : "";
|
|
1728
|
+
const align = ((_n = node.attrs) == null ? void 0 : _n.align) ? ` data-align="${node.attrs.align}"` : "";
|
|
1730
1729
|
const caption = ((_o = node.attrs) == null ? void 0 : _o.caption) ? escapeHTML(node.attrs.caption) : "";
|
|
1731
1730
|
const x = (_p = node.attrs) == null ? void 0 : _p.x;
|
|
1732
1731
|
const y = (_q = node.attrs) == null ? void 0 : _q.y;
|
|
1733
|
-
const
|
|
1734
|
-
const posStyle = x !== void 0 ? `position:absolute;left:${Math.round(x)}px;top:${Math.round(y != null ? y : 0)}px;` : "";
|
|
1735
|
-
const posAttrs = x !== void 0 ? ` data-x="${Math.round(x)}" data-y="${Math.round(y != null ? y : 0)}"` : "";
|
|
1736
|
-
const figStyle = alignStyle || posStyle ? ` style="${alignStyle}${posStyle}"` : "";
|
|
1732
|
+
const posAttrs = x !== void 0 ? ` data-x="${Math.round(x)}" data-y="${Math.round(y != null ? y : 0)}" style="position:absolute;left:${Math.round(x)}px;top:${Math.round(y != null ? y : 0)}px;"` : "";
|
|
1737
1733
|
if (caption) {
|
|
1738
|
-
return `<figure${
|
|
1734
|
+
return `<figure${align}${posAttrs}><img src="${src}" alt="${alt}"${width} /><figcaption>${caption}</figcaption></figure>`;
|
|
1739
1735
|
}
|
|
1740
|
-
return `<figure${
|
|
1736
|
+
return `<figure${align}${posAttrs}><img src="${src}" alt="${alt}"${width} /></figure>`;
|
|
1741
1737
|
}
|
|
1742
1738
|
case "horizontal_rule":
|
|
1743
1739
|
return "<hr />";
|