easy-email-pro-theme 1.15.2 → 1.15.3
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/lib/index.js +10 -13
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -17134,18 +17134,10 @@ const RichtextBar = (props) => {
|
|
|
17134
17134
|
/* @__PURE__ */ React__default.createElement(SharedComponents.HoveringToolbar, null),
|
|
17135
17135
|
/* @__PURE__ */ React__default.createElement(EmailEditor, null),
|
|
17136
17136
|
/* @__PURE__ */ React__default.createElement(SharedComponents.Hotkeys, null),
|
|
17137
|
-
/* @__PURE__ */ React__default.createElement(FormProvider, null, /* @__PURE__ */ React__default.createElement(ResetContent, { initialValue })),
|
|
17138
17137
|
/* @__PURE__ */ React__default.createElement("style", null, styleText$d)
|
|
17139
17138
|
);
|
|
17140
17139
|
}, [props.height, clientId, initialValue, editor, onPageChange]);
|
|
17141
17140
|
};
|
|
17142
|
-
const ResetContent = ({ initialValue }) => {
|
|
17143
|
-
const { reset } = useEditorContext();
|
|
17144
|
-
useEffect(() => {
|
|
17145
|
-
reset(initialValue);
|
|
17146
|
-
}, [initialValue, reset]);
|
|
17147
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
|
|
17148
|
-
};
|
|
17149
17141
|
const DefaultRichTextField = enhancer(RichtextBar);
|
|
17150
17142
|
const RichTextField = (props) => {
|
|
17151
17143
|
return /* @__PURE__ */ React__default.createElement(DefaultRichTextField, __spreadProps(__spreadValues({}, props), { formItem: { noStyle: true } }));
|
|
@@ -33628,13 +33620,19 @@ const HoveringToolbar = () => {
|
|
|
33628
33620
|
}
|
|
33629
33621
|
}
|
|
33630
33622
|
}
|
|
33623
|
+
let contentWindow = null;
|
|
33624
|
+
try {
|
|
33625
|
+
contentWindow = ReactEditor.getWindow(editor);
|
|
33626
|
+
} catch (error2) {
|
|
33627
|
+
}
|
|
33631
33628
|
const selectedContentBlockNode = selectedContentBlockNodeEntry == null ? void 0 : selectedContentBlockNodeEntry[0];
|
|
33632
33629
|
const isNotSelect = !selection;
|
|
33633
33630
|
const isCollapsed = Boolean(
|
|
33634
33631
|
selection && (Range.isCollapsed(selection) || Editor.string(editor, selection) === "")
|
|
33635
33632
|
);
|
|
33636
33633
|
useEffect(() => {
|
|
33637
|
-
|
|
33634
|
+
if (!contentWindow)
|
|
33635
|
+
return;
|
|
33638
33636
|
const onClick = (ev) => {
|
|
33639
33637
|
const hoveringToolbarElement = document.getElementById("HoveringToolbar");
|
|
33640
33638
|
if (ev.target && !(hoveringToolbarElement == null ? void 0 : hoveringToolbarElement.contains(ev.target))) {
|
|
@@ -33648,17 +33646,16 @@ const HoveringToolbar = () => {
|
|
|
33648
33646
|
contentWindow.addEventListener("pointerdown", onEditorClick);
|
|
33649
33647
|
document.addEventListener("click", onClick);
|
|
33650
33648
|
return () => {
|
|
33651
|
-
contentWindow.removeEventListener("pointerdown", onEditorClick);
|
|
33649
|
+
contentWindow == null ? void 0 : contentWindow.removeEventListener("pointerdown", onEditorClick);
|
|
33652
33650
|
document.removeEventListener("click", onClick);
|
|
33653
33651
|
};
|
|
33654
|
-
}, [editor]);
|
|
33652
|
+
}, [contentWindow, editor]);
|
|
33655
33653
|
useEffect(() => {
|
|
33656
33654
|
var _a2, _b;
|
|
33657
33655
|
try {
|
|
33658
33656
|
const el = ref2.current;
|
|
33659
33657
|
const doc = ReactEditor.findDocumentOrShadowRoot(editor);
|
|
33660
|
-
|
|
33661
|
-
if (!el || el.contains(doc.activeElement) || !selectedContentBlockNode) {
|
|
33658
|
+
if (!contentWindow || !el || el.contains(doc.activeElement) || !selectedContentBlockNode) {
|
|
33662
33659
|
return;
|
|
33663
33660
|
}
|
|
33664
33661
|
if (isNotSelect) {
|