easy-email-pro-theme 1.57.9 → 1.57.10

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 +38 -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(() => {
@@ -17082,6 +17107,15 @@ const FontFamily$2 = () => {
17082
17107
  } catch (error2) {
17083
17108
  console.warn("FontFamily: failed to get nodes safely", error2);
17084
17109
  }
17110
+ if (!nodeEntry) {
17111
+ [nodeEntry] = Editor.nodes(editor, {
17112
+ match: (node) => {
17113
+ return Text$4.isText(node);
17114
+ },
17115
+ mode: "lowest",
17116
+ voids: true
17117
+ });
17118
+ }
17085
17119
  const textNode = nodeEntry == null ? void 0 : nodeEntry[0];
17086
17120
  useEffect(() => {
17087
17121
  var _a;
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.10",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"