easy-email-pro-theme 1.51.5 → 1.51.7

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 -10
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -704,7 +704,7 @@ const assignIdsToElementTree = (element, overwrite = false) => {
704
704
  if (overwrite) {
705
705
  node.id = nanoid();
706
706
  } else {
707
- if (map.has(node.id)) {
707
+ if (!map.has(node.id)) {
708
708
  const newId = nanoid();
709
709
  node.id = newId;
710
710
  } else {
@@ -14776,12 +14776,22 @@ function ColorPickerContent(props) {
14776
14776
  }
14777
14777
  const BgColor = () => {
14778
14778
  const editor = useSlate();
14779
- const [nodeEntry] = Editor.nodes(editor, {
14779
+ let [nodeEntry] = Editor.nodes(editor, {
14780
14780
  match: (node) => {
14781
14781
  return Text$2.isText(node);
14782
14782
  },
14783
- mode: "lowest"
14783
+ mode: "lowest",
14784
+ voids: true
14784
14785
  });
14786
+ if (!nodeEntry) {
14787
+ const [mergetagNodeEntry] = Editor.nodes(editor, {
14788
+ match: (node) => {
14789
+ return NodeUtils.isMergetagElement(node);
14790
+ },
14791
+ mode: "lowest"
14792
+ });
14793
+ nodeEntry = mergetagNodeEntry;
14794
+ }
14785
14795
  const { setFieldValue } = useEditorContext();
14786
14796
  const activeTab = useActiveTab();
14787
14797
  const selectedNodePath = useSelectedNodePath();
@@ -14890,12 +14900,22 @@ const BgColor = () => {
14890
14900
  };
14891
14901
  const FontColor = () => {
14892
14902
  const editor = useSlate();
14893
- const [nodeEntry] = Editor.nodes(editor, {
14903
+ let [nodeEntry] = Editor.nodes(editor, {
14894
14904
  match: (node) => {
14895
14905
  return Text$2.isText(node);
14896
14906
  },
14897
- mode: "lowest"
14907
+ mode: "lowest",
14908
+ voids: true
14898
14909
  });
14910
+ if (!nodeEntry) {
14911
+ const [mergetagNodeEntry] = Editor.nodes(editor, {
14912
+ match: (node) => {
14913
+ return NodeUtils.isMergetagElement(node);
14914
+ },
14915
+ mode: "lowest"
14916
+ });
14917
+ nodeEntry = mergetagNodeEntry;
14918
+ }
14899
14919
  const { setFieldValue } = useEditorContext();
14900
14920
  const activeTab = useActiveTab();
14901
14921
  const selectedNodePath = useSelectedNodePath();
@@ -15109,7 +15129,8 @@ const getLinkNode = (editor) => {
15109
15129
  match: (n) => {
15110
15130
  return Text$2.isText(n) && Boolean(n[TextFormat.LINK]);
15111
15131
  },
15112
- mode: "lowest"
15132
+ mode: "lowest",
15133
+ voids: true
15113
15134
  });
15114
15135
  return match;
15115
15136
  };
@@ -15567,6 +15588,7 @@ function isValidHttpUrl(str) {
15567
15588
  const TextLink = () => {
15568
15589
  const editor = useSlate();
15569
15590
  const linkNodeEntry = getLinkNode(editor);
15591
+ console.log(linkNodeEntry);
15570
15592
  const ref = useRef(null);
15571
15593
  const linkNode = linkNodeEntry == null ? void 0 : linkNodeEntry[0];
15572
15594
  const selectedNodePath = useSelectedNodePath();
@@ -15651,7 +15673,8 @@ const TextLink = () => {
15651
15673
  {
15652
15674
  match: Text$2.isText,
15653
15675
  split: true,
15654
- at: mergeNodeEntry ? mergeNodeEntry[1] : void 0
15676
+ at: mergeNodeEntry ? mergeNodeEntry[1] : void 0,
15677
+ voids: true
15655
15678
  }
15656
15679
  );
15657
15680
  (_b = ref.current) == null ? void 0 : _b.click();
@@ -16499,7 +16522,7 @@ const RichTextBar = ({
16499
16522
  const content = useMemo(() => {
16500
16523
  const toolsMapping = {
16501
16524
  [TextFormat.TURN_INTO]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(TurnInto, null)),
16502
- [TextFormat.AI_ASSISTANT]: AIAssistant2 ? /* @__PURE__ */ React__default.createElement(SharedComponents.AIAssistant, null) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null),
16525
+ [TextFormat.AI_ASSISTANT]: AIAssistant2 && !mergetagNode ? /* @__PURE__ */ React__default.createElement(SharedComponents.AIAssistant, null) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null),
16503
16526
  [TextFormat.FONT_SIZE]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(FontSize$2, null)),
16504
16527
  [TextFormat.FONT_FAMILY]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(FontFamily$2, null)),
16505
16528
  [TextFormat.LINK]: /* @__PURE__ */ React__default.createElement(TextLink, null),
@@ -16540,7 +16563,7 @@ const RichTextBar = ({
16540
16563
  [TextFormat.MERGETAG]: mergetags && !mergetagNode && /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(MergeTag, null)),
16541
16564
  [TextFormat.ALIGN]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(TextAlign$1, null)),
16542
16565
  [TextFormat.LIST]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(List, null)),
16543
- [TextFormat.IMAGE]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(Image$5, null)),
16566
+ [TextFormat.IMAGE]: !mergetagNode && /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(Image$5, null)),
16544
16567
  [TextFormat.REMOVE_FORMAT]: /* @__PURE__ */ React__default.createElement(PreventFocusWrapper, null, /* @__PURE__ */ React__default.createElement(
16545
16568
  FormatButton,
16546
16569
  {
@@ -30067,7 +30090,9 @@ function Condition(props) {
30067
30090
  };
30068
30091
  const onSubmit = (values) => {
30069
30092
  setFieldValue(nodePath, "logic", __spreadProps(__spreadValues({}, selectedBlock.logic), {
30070
- condition: values.condition
30093
+ condition: __spreadProps(__spreadValues({}, values.condition), {
30094
+ enabled: true
30095
+ })
30071
30096
  }));
30072
30097
  setConditionModalVisible(false);
30073
30098
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.51.5",
3
+ "version": "1.51.7",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"