easy-email-pro-theme 1.57.9 → 1.57.11

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 +40 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -15754,6 +15754,15 @@ const BgColor = () => {
15754
15754
  } catch (error2) {
15755
15755
  }
15756
15756
  }
15757
+ if (!nodeEntry) {
15758
+ [nodeEntry] = Editor.nodes(editor, {
15759
+ match: (node) => {
15760
+ return Text$4.isText(node);
15761
+ },
15762
+ mode: "lowest",
15763
+ voids: true
15764
+ });
15765
+ }
15757
15766
  const { setFieldValue } = useEditorContext();
15758
15767
  const activeTab = useActiveTab();
15759
15768
  const selectedNodePath = useSelectedNodePath();
@@ -15894,6 +15903,15 @@ const FontColor = () => {
15894
15903
  } catch (error2) {
15895
15904
  }
15896
15905
  }
15906
+ if (!nodeEntry) {
15907
+ [nodeEntry] = Editor.nodes(editor, {
15908
+ match: (node) => {
15909
+ return Text$4.isText(node);
15910
+ },
15911
+ mode: "lowest",
15912
+ voids: true
15913
+ });
15914
+ }
15897
15915
  const { setFieldValue } = useEditorContext();
15898
15916
  const activeTab = useActiveTab();
15899
15917
  const selectedNodePath = useSelectedNodePath();
@@ -16940,7 +16958,7 @@ const FontSize$2 = () => {
16940
16958
  const [fontSizeValue, setFontSizeValue] = useState();
16941
16959
  const { setFieldValue } = useEditorContext();
16942
16960
  const { selectedNode } = useSelectedNode();
16943
- const elementDefault = useElementDefault({
16961
+ useElementDefault({
16944
16962
  path: null,
16945
16963
  type: (selectedNode == null ? void 0 : selectedNode.type) || null
16946
16964
  });
@@ -16975,9 +16993,19 @@ const FontSize$2 = () => {
16975
16993
  } catch (error2) {
16976
16994
  }
16977
16995
  }
16996
+ if (!nodeEntry) {
16997
+ [nodeEntry] = Editor.nodes(editor, {
16998
+ match: (node) => {
16999
+ return Text$4.isText(node);
17000
+ },
17001
+ mode: "lowest",
17002
+ voids: true
17003
+ });
17004
+ }
16978
17005
  const textNode = nodeEntry == null ? void 0 : nodeEntry[0];
16979
17006
  useEffect(() => {
16980
17007
  let fontSizeValue2 = textNode == null ? void 0 : textNode.fontSize;
17008
+ console.log(textNode, "textNode?");
16981
17009
  if (!fontSizeValue2 && textNode) {
16982
17010
  try {
16983
17011
  const textDomNode = ReactEditor.toDOMNode(editor, textNode);
@@ -16985,9 +17013,6 @@ const FontSize$2 = () => {
16985
17013
  } catch (error2) {
16986
17014
  }
16987
17015
  }
16988
- if (!fontSizeValue2) {
16989
- fontSizeValue2 = get(elementDefault.attributes, "font-size");
16990
- }
16991
17016
  setFontSizeValue(fontSizeValue2);
16992
17017
  }, [editor, textNode, textNode == null ? void 0 : textNode.fontSize]);
16993
17018
  const optionsList = useMemo(() => {
@@ -17032,6 +17057,7 @@ const FontSize$2 = () => {
17032
17057
  );
17033
17058
  } else {
17034
17059
  setFieldValue(contentNodePath, "attributes.font-size", val);
17060
+ setFontSizeValue(val);
17035
17061
  }
17036
17062
  };
17037
17063
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { ref: setSelectRef }, /* @__PURE__ */ React__default.createElement(
@@ -17082,6 +17108,15 @@ const FontFamily$2 = () => {
17082
17108
  } catch (error2) {
17083
17109
  console.warn("FontFamily: failed to get nodes safely", error2);
17084
17110
  }
17111
+ if (!nodeEntry) {
17112
+ [nodeEntry] = Editor.nodes(editor, {
17113
+ match: (node) => {
17114
+ return Text$4.isText(node);
17115
+ },
17116
+ mode: "lowest",
17117
+ voids: true
17118
+ });
17119
+ }
17085
17120
  const textNode = nodeEntry == null ? void 0 : nodeEntry[0];
17086
17121
  useEffect(() => {
17087
17122
  var _a;
@@ -17140,6 +17175,7 @@ const FontFamily$2 = () => {
17140
17175
  );
17141
17176
  } else {
17142
17177
  setFieldValue(contentNodePath, "attributes.font-family", val);
17178
+ setFontFamilyValue(val);
17143
17179
  }
17144
17180
  addFont(val);
17145
17181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.57.9",
3
+ "version": "1.57.11",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"