easy-email-pro-theme 1.50.8 → 1.50.9

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.
Files changed (2) hide show
  1. package/lib/index.js +35 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -15720,13 +15720,47 @@ const TextAlign$1 = () => {
15720
15720
  match: (n) => NodeUtils.isContentElement(n),
15721
15721
  mode: "all"
15722
15722
  });
15723
+ const { enabledHtmlBlockNodeAlign } = useEditorProps();
15723
15724
  const node = match == null ? void 0 : match[0];
15724
15725
  const { setFieldValue } = useEditorContext();
15725
15726
  const matchAlign = match && get(node.attributes, "align");
15726
15727
  const onAlignHandle = (align) => {
15727
15728
  if (!match)
15728
15729
  return;
15729
- setFieldValue(match[1], "attributes.align", align);
15730
+ if (!enabledHtmlBlockNodeAlign) {
15731
+ setFieldValue(match[1], "attributes.align", align);
15732
+ return;
15733
+ }
15734
+ const htmlBlockNodeElementEntry = Editor.above(editor, {
15735
+ match(node2, path2) {
15736
+ return NodeUtils.isHTMLBlockNodeElement(node2);
15737
+ },
15738
+ mode: "highest"
15739
+ });
15740
+ if (!htmlBlockNodeElementEntry) {
15741
+ Transforms.wrapNodes(
15742
+ editor,
15743
+ {
15744
+ type: ElementType.HTML_BLOCK_NODE,
15745
+ children: [],
15746
+ data: {
15747
+ tagName: "div"
15748
+ },
15749
+ attributes: {
15750
+ style: `text-align:${align};`
15751
+ }
15752
+ },
15753
+ {
15754
+ match: (node2) => !NodeUtils.isBlockElement(node2) && !NodeUtils.isHTMLBlockNodeElement(node2)
15755
+ }
15756
+ );
15757
+ } else {
15758
+ Transforms.setNodes(editor, {
15759
+ attributes: __spreadProps(__spreadValues({}, htmlBlockNodeElementEntry[0].attributes), {
15760
+ style: `text-align:${align};`
15761
+ })
15762
+ });
15763
+ }
15730
15764
  };
15731
15765
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
15732
15766
  FormatButton,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.50.8",
3
+ "version": "1.50.9",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"