easy-email-pro-theme 1.60.0 → 1.60.1
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
CHANGED
|
@@ -16874,6 +16874,54 @@ const HoveringToolbar = () => {
|
|
|
16874
16874
|
editorContainer || document.body
|
|
16875
16875
|
);
|
|
16876
16876
|
};
|
|
16877
|
+
const RichTextBarContext = React__default.createContext({
|
|
16878
|
+
activePopup: null,
|
|
16879
|
+
setPopupVisible: () => void 0,
|
|
16880
|
+
closePopup: () => void 0
|
|
16881
|
+
});
|
|
16882
|
+
const getNextActivePopup = (activePopup, popupId, visible) => {
|
|
16883
|
+
if (visible)
|
|
16884
|
+
return popupId;
|
|
16885
|
+
return activePopup === popupId ? null : activePopup;
|
|
16886
|
+
};
|
|
16887
|
+
const useRichTextBarPopup = (popupId) => {
|
|
16888
|
+
const { activePopup, setPopupVisible } = useContext(RichTextBarContext);
|
|
16889
|
+
return {
|
|
16890
|
+
popupVisible: activePopup === popupId,
|
|
16891
|
+
onVisibleChange: useCallback(
|
|
16892
|
+
(visible) => setPopupVisible(popupId, visible),
|
|
16893
|
+
[popupId, setPopupVisible]
|
|
16894
|
+
)
|
|
16895
|
+
};
|
|
16896
|
+
};
|
|
16897
|
+
const useRichTextBarPopupCoordinator = () => {
|
|
16898
|
+
const [activePopup, setActivePopup] = useState(
|
|
16899
|
+
null
|
|
16900
|
+
);
|
|
16901
|
+
const setPopupVisible = useCallback(
|
|
16902
|
+
(popupId, visible) => {
|
|
16903
|
+
setActivePopup(
|
|
16904
|
+
(current) => getNextActivePopup(current, popupId, visible)
|
|
16905
|
+
);
|
|
16906
|
+
},
|
|
16907
|
+
[]
|
|
16908
|
+
);
|
|
16909
|
+
const closePopup = useCallback(() => setActivePopup(null), []);
|
|
16910
|
+
return useMemo(
|
|
16911
|
+
() => ({ activePopup, setPopupVisible, closePopup }),
|
|
16912
|
+
[activePopup, closePopup, setPopupVisible]
|
|
16913
|
+
);
|
|
16914
|
+
};
|
|
16915
|
+
const useRichTextBarActionBoundary = (closePopup) => useCallback(
|
|
16916
|
+
(event) => {
|
|
16917
|
+
var _a;
|
|
16918
|
+
const target = event.target;
|
|
16919
|
+
if ((_a = target == null ? void 0 : target.closest) == null ? void 0 : _a.call(target, ".arco-trigger"))
|
|
16920
|
+
return;
|
|
16921
|
+
closePopup();
|
|
16922
|
+
},
|
|
16923
|
+
[closePopup]
|
|
16924
|
+
);
|
|
16877
16925
|
var colorString$1 = { exports: {} };
|
|
16878
16926
|
var colorName = {
|
|
16879
16927
|
"aliceblue": [240, 248, 255],
|
|
@@ -18868,7 +18916,7 @@ const BgColorInner = () => {
|
|
|
18868
18916
|
const { getPopupContainer } = useContext(RichTextBarContext);
|
|
18869
18917
|
const { list: colors, addCurrentColor } = useColorContext();
|
|
18870
18918
|
const { useNewColorPicker = true } = useEditorProps();
|
|
18871
|
-
const
|
|
18919
|
+
const { popupVisible, onVisibleChange: setToolbarPopupVisible } = useRichTextBarPopup("background-color");
|
|
18872
18920
|
let isSelectionCollapsed = true;
|
|
18873
18921
|
if (editor.selection) {
|
|
18874
18922
|
try {
|
|
@@ -18993,7 +19041,7 @@ const BgColorInner = () => {
|
|
|
18993
19041
|
if (!visible) {
|
|
18994
19042
|
debouncedApplyChange.flush();
|
|
18995
19043
|
}
|
|
18996
|
-
|
|
19044
|
+
setToolbarPopupVisible(visible);
|
|
18997
19045
|
});
|
|
18998
19046
|
useEffect(() => {
|
|
18999
19047
|
if (isSelectionCollapsed) {
|
|
@@ -19085,6 +19133,8 @@ const BgColorInner = () => {
|
|
|
19085
19133
|
Popover,
|
|
19086
19134
|
{
|
|
19087
19135
|
trigger: "click",
|
|
19136
|
+
popupVisible,
|
|
19137
|
+
onVisibleChange,
|
|
19088
19138
|
triggerProps: {
|
|
19089
19139
|
popupStyle: { padding: "10px" }
|
|
19090
19140
|
},
|
|
@@ -19138,7 +19188,18 @@ const BgColorInner = () => {
|
|
|
19138
19188
|
triggerElement
|
|
19139
19189
|
}
|
|
19140
19190
|
));
|
|
19141
|
-
}, [
|
|
19191
|
+
}, [
|
|
19192
|
+
colors,
|
|
19193
|
+
getPopupContainer,
|
|
19194
|
+
normalizedColor,
|
|
19195
|
+
onChange,
|
|
19196
|
+
onClose,
|
|
19197
|
+
onLegacyChange,
|
|
19198
|
+
onVisibleChange,
|
|
19199
|
+
pickerValue,
|
|
19200
|
+
popupVisible,
|
|
19201
|
+
useNewColorPicker
|
|
19202
|
+
]);
|
|
19142
19203
|
};
|
|
19143
19204
|
const BgColor = () => {
|
|
19144
19205
|
return /* @__PURE__ */ React__default.createElement(ColorProvider, null, /* @__PURE__ */ React__default.createElement(BgColorInner, null));
|
|
@@ -19161,7 +19222,7 @@ const FontColorInner = () => {
|
|
|
19161
19222
|
const { addCurrentColor, list: colors } = useColorContext();
|
|
19162
19223
|
const { useNewColorPicker = true } = useEditorProps();
|
|
19163
19224
|
const editor = useSlate();
|
|
19164
|
-
const
|
|
19225
|
+
const { popupVisible, onVisibleChange: setToolbarPopupVisible } = useRichTextBarPopup("font-color");
|
|
19165
19226
|
let isSelectionCollapsed = true;
|
|
19166
19227
|
if (editor.selection) {
|
|
19167
19228
|
try {
|
|
@@ -19282,7 +19343,7 @@ const FontColorInner = () => {
|
|
|
19282
19343
|
if (!visible) {
|
|
19283
19344
|
debouncedApplyChange.flush();
|
|
19284
19345
|
}
|
|
19285
|
-
|
|
19346
|
+
setToolbarPopupVisible(visible);
|
|
19286
19347
|
});
|
|
19287
19348
|
useEffect(() => {
|
|
19288
19349
|
if (isSelectionCollapsed) {
|
|
@@ -19332,35 +19393,45 @@ const FontColorInner = () => {
|
|
|
19332
19393
|
}
|
|
19333
19394
|
});
|
|
19334
19395
|
return useMemo(() => {
|
|
19335
|
-
const triggerElement = /* @__PURE__ */ React__default.createElement(
|
|
19396
|
+
const triggerElement = /* @__PURE__ */ React__default.createElement(
|
|
19336
19397
|
"span",
|
|
19337
19398
|
{
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
alignItems: "center",
|
|
19342
|
-
justifyContent: "center",
|
|
19343
|
-
height: "calc(var(--hovering-bar-icon-size) + 4px)",
|
|
19344
|
-
textAlign: "center",
|
|
19345
|
-
fontSize: "calc(var(--hovering-bar-icon-size) + 2px)",
|
|
19346
|
-
borderRadius: "2px",
|
|
19347
|
-
width: "calc(var(--hovering-bar-icon-size) + 4px)",
|
|
19348
|
-
boxSizing: "border-box",
|
|
19349
|
-
fontWeight: "500",
|
|
19350
|
-
color: pickerValue.toLocaleLowerCase() === "#ffffff" ? void 0 : pickerValue,
|
|
19351
|
-
borderColor: pickerValue.toLocaleLowerCase() === "#ffffff" ? void 0 : pickerValue,
|
|
19352
|
-
borderWidth: "1px",
|
|
19353
|
-
borderStyle: "solid",
|
|
19354
|
-
overflow: "hidden"
|
|
19355
|
-
}
|
|
19399
|
+
ref,
|
|
19400
|
+
className: classnames$1("formatButton"),
|
|
19401
|
+
title: t("Font color")
|
|
19356
19402
|
},
|
|
19357
|
-
|
|
19358
|
-
|
|
19403
|
+
/* @__PURE__ */ React__default.createElement(
|
|
19404
|
+
"span",
|
|
19405
|
+
{
|
|
19406
|
+
className: classnames$1("iconfont"),
|
|
19407
|
+
style: {
|
|
19408
|
+
display: "flex",
|
|
19409
|
+
alignItems: "center",
|
|
19410
|
+
justifyContent: "center",
|
|
19411
|
+
height: "calc(var(--hovering-bar-icon-size) + 4px)",
|
|
19412
|
+
textAlign: "center",
|
|
19413
|
+
fontSize: "calc(var(--hovering-bar-icon-size) + 2px)",
|
|
19414
|
+
borderRadius: "2px",
|
|
19415
|
+
width: "calc(var(--hovering-bar-icon-size) + 4px)",
|
|
19416
|
+
boxSizing: "border-box",
|
|
19417
|
+
fontWeight: "500",
|
|
19418
|
+
color: pickerValue.toLocaleLowerCase() === "#ffffff" ? void 0 : pickerValue,
|
|
19419
|
+
borderColor: pickerValue.toLocaleLowerCase() === "#ffffff" ? void 0 : pickerValue,
|
|
19420
|
+
borderWidth: "1px",
|
|
19421
|
+
borderStyle: "solid",
|
|
19422
|
+
overflow: "hidden"
|
|
19423
|
+
}
|
|
19424
|
+
},
|
|
19425
|
+
"A"
|
|
19426
|
+
)
|
|
19427
|
+
);
|
|
19359
19428
|
if (!useNewColorPicker) {
|
|
19360
19429
|
return /* @__PURE__ */ React__default.createElement(
|
|
19361
19430
|
Popover,
|
|
19362
19431
|
{
|
|
19363
19432
|
trigger: "click",
|
|
19433
|
+
popupVisible,
|
|
19434
|
+
onVisibleChange,
|
|
19364
19435
|
triggerProps: {
|
|
19365
19436
|
popupStyle: { padding: "10px" }
|
|
19366
19437
|
},
|
|
@@ -19414,7 +19485,18 @@ const FontColorInner = () => {
|
|
|
19414
19485
|
triggerElement
|
|
19415
19486
|
}
|
|
19416
19487
|
));
|
|
19417
|
-
}, [
|
|
19488
|
+
}, [
|
|
19489
|
+
colors,
|
|
19490
|
+
getPopupContainer,
|
|
19491
|
+
normalizedColor,
|
|
19492
|
+
onChange,
|
|
19493
|
+
onClose,
|
|
19494
|
+
onLegacyChange,
|
|
19495
|
+
onVisibleChange,
|
|
19496
|
+
pickerValue,
|
|
19497
|
+
popupVisible,
|
|
19498
|
+
useNewColorPicker
|
|
19499
|
+
]);
|
|
19418
19500
|
};
|
|
19419
19501
|
const FontColor = () => {
|
|
19420
19502
|
return /* @__PURE__ */ React__default.createElement(ColorProvider, null, /* @__PURE__ */ React__default.createElement(FontColorInner, null));
|
|
@@ -19816,8 +19898,9 @@ const TextLink = () => {
|
|
|
19816
19898
|
const { getPopupContainer } = useContext(RichTextBarContext);
|
|
19817
19899
|
const ref = useRef(null);
|
|
19818
19900
|
const linkNode = linkNodeEntry == null ? void 0 : linkNodeEntry[0];
|
|
19901
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("link");
|
|
19819
19902
|
const selectedNodePath = useSelectedNodePath();
|
|
19820
|
-
const [
|
|
19903
|
+
const [mergeTagPopupVisible, setMergeTagPopupVisible] = useState(false);
|
|
19821
19904
|
const { handleUploadClick, showSelectFileButton, onUpload, mergetags } = useEditorProps();
|
|
19822
19905
|
const [isUploading, setIsUploading] = useState(false);
|
|
19823
19906
|
const uploadHandlerRef = useRef(onUpload);
|
|
@@ -19830,7 +19913,7 @@ const TextLink = () => {
|
|
|
19830
19913
|
const newHref = PluginManager.generateVariable(mergetag);
|
|
19831
19914
|
from.setFieldValue("href", newHref);
|
|
19832
19915
|
setFormState((old) => __spreadProps(__spreadValues({}, old), { href: newHref }));
|
|
19833
|
-
|
|
19916
|
+
setMergeTagPopupVisible(false);
|
|
19834
19917
|
},
|
|
19835
19918
|
[from]
|
|
19836
19919
|
);
|
|
@@ -19925,6 +20008,8 @@ const TextLink = () => {
|
|
|
19925
20008
|
Popover,
|
|
19926
20009
|
{
|
|
19927
20010
|
trigger: "click",
|
|
20011
|
+
popupVisible,
|
|
20012
|
+
onVisibleChange,
|
|
19928
20013
|
triggerProps: {
|
|
19929
20014
|
position: "tr",
|
|
19930
20015
|
popupStyle: { padding: "10px 0px 0px 0px", width: 400 }
|
|
@@ -19971,10 +20056,10 @@ const TextLink = () => {
|
|
|
19971
20056
|
SharedComponents.MergeTagComponent,
|
|
19972
20057
|
{
|
|
19973
20058
|
mergetags: formatMergetags,
|
|
19974
|
-
popupVisible,
|
|
19975
|
-
onVisibleChange:
|
|
20059
|
+
popupVisible: mergeTagPopupVisible,
|
|
20060
|
+
onVisibleChange: setMergeTagPopupVisible,
|
|
19976
20061
|
onChange: onChangeMergeTag,
|
|
19977
|
-
onClose: () =>
|
|
20062
|
+
onClose: () => setMergeTagPopupVisible(false),
|
|
19978
20063
|
value: "",
|
|
19979
20064
|
triggerElement: /* @__PURE__ */ React__default.createElement(
|
|
19980
20065
|
Button$2,
|
|
@@ -20112,6 +20197,7 @@ const options$9 = [
|
|
|
20112
20197
|
];
|
|
20113
20198
|
const TurnInto = () => {
|
|
20114
20199
|
const editor = useSlate();
|
|
20200
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("turn-into");
|
|
20115
20201
|
let nodeEntry = null;
|
|
20116
20202
|
try {
|
|
20117
20203
|
if (editor.selection && Node.has(editor, editor.selection.anchor.path)) {
|
|
@@ -20148,6 +20234,8 @@ const TurnInto = () => {
|
|
|
20148
20234
|
Select$1,
|
|
20149
20235
|
{
|
|
20150
20236
|
value: node.type,
|
|
20237
|
+
popupVisible,
|
|
20238
|
+
onVisibleChange,
|
|
20151
20239
|
className: "easy-email-pro-turnInto",
|
|
20152
20240
|
style: { minWidth: 95 },
|
|
20153
20241
|
onChange,
|
|
@@ -20167,7 +20255,7 @@ const TurnInto = () => {
|
|
|
20167
20255
|
};
|
|
20168
20256
|
const RichTextBar$1 = "";
|
|
20169
20257
|
const MergeTag = React__default.memo(() => {
|
|
20170
|
-
const
|
|
20258
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("merge-tag");
|
|
20171
20259
|
const [mergeTagRef, setMergeTagRef] = useState(null);
|
|
20172
20260
|
const editor = useSlate();
|
|
20173
20261
|
const { mergetags } = useEditorProps();
|
|
@@ -20179,19 +20267,19 @@ const MergeTag = React__default.memo(() => {
|
|
|
20179
20267
|
editor.insertMergetag({
|
|
20180
20268
|
mergetag
|
|
20181
20269
|
});
|
|
20182
|
-
|
|
20270
|
+
onVisibleChange(false);
|
|
20183
20271
|
},
|
|
20184
|
-
[editor]
|
|
20272
|
+
[editor, onVisibleChange]
|
|
20185
20273
|
);
|
|
20186
20274
|
const onClose = useCallback(() => {
|
|
20187
|
-
|
|
20188
|
-
}, []);
|
|
20275
|
+
onVisibleChange(false);
|
|
20276
|
+
}, [onVisibleChange]);
|
|
20189
20277
|
return /* @__PURE__ */ React__default.createElement("div", { ref: setMergeTagRef }, /* @__PURE__ */ React__default.createElement(
|
|
20190
20278
|
SharedComponents.MergeTagComponent,
|
|
20191
20279
|
{
|
|
20192
20280
|
mergetags: formatMergetags,
|
|
20193
20281
|
popupVisible,
|
|
20194
|
-
onVisibleChange
|
|
20282
|
+
onVisibleChange,
|
|
20195
20283
|
onChange,
|
|
20196
20284
|
onClose,
|
|
20197
20285
|
value: "",
|
|
@@ -20201,7 +20289,7 @@ const MergeTag = React__default.memo(() => {
|
|
|
20201
20289
|
{
|
|
20202
20290
|
title: t("Merge Tag"),
|
|
20203
20291
|
icon: "icon-merge-tags",
|
|
20204
|
-
onClick: () =>
|
|
20292
|
+
onClick: () => onVisibleChange(false)
|
|
20205
20293
|
}
|
|
20206
20294
|
)
|
|
20207
20295
|
}
|
|
@@ -20358,6 +20446,7 @@ const TextAlign$1 = () => {
|
|
|
20358
20446
|
};
|
|
20359
20447
|
const options$8 = ["12px", "14px", "16px", "18px", "24px", "32px", "48px"];
|
|
20360
20448
|
const FontSize$2 = () => {
|
|
20449
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("font-size");
|
|
20361
20450
|
const [selectRef, setSelectRef] = useState(null);
|
|
20362
20451
|
const { fontSizeList } = useEditorProps();
|
|
20363
20452
|
const [fontSizeValue, setFontSizeValue] = useState();
|
|
@@ -20470,6 +20559,8 @@ const FontSize$2 = () => {
|
|
|
20470
20559
|
{
|
|
20471
20560
|
className: "easy-email-pro-font-size",
|
|
20472
20561
|
value: fontSizeValue,
|
|
20562
|
+
popupVisible,
|
|
20563
|
+
onVisibleChange,
|
|
20473
20564
|
style: { width: 80 },
|
|
20474
20565
|
onChange,
|
|
20475
20566
|
triggerProps: {
|
|
@@ -20487,6 +20578,7 @@ const FontSize$2 = () => {
|
|
|
20487
20578
|
`));
|
|
20488
20579
|
};
|
|
20489
20580
|
const FontFamily$2 = () => {
|
|
20581
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("font-family");
|
|
20490
20582
|
const { fontList, addFont } = useFontFamily();
|
|
20491
20583
|
const [selectRef, setSelectRef] = useState(null);
|
|
20492
20584
|
const editor = useSlate();
|
|
@@ -20589,6 +20681,8 @@ const FontFamily$2 = () => {
|
|
|
20589
20681
|
{
|
|
20590
20682
|
className: "easy-email-pro-font-family",
|
|
20591
20683
|
value: fontFamilyValue,
|
|
20684
|
+
popupVisible,
|
|
20685
|
+
onVisibleChange,
|
|
20592
20686
|
style: { minWidth: 80 },
|
|
20593
20687
|
onChange,
|
|
20594
20688
|
triggerProps: {
|
|
@@ -20701,6 +20795,7 @@ const Image$4 = () => {
|
|
|
20701
20795
|
const editor = useSlate();
|
|
20702
20796
|
const ref = useRef(null);
|
|
20703
20797
|
const { onUpload } = useEditorProps();
|
|
20798
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("image");
|
|
20704
20799
|
const { lock } = useEditorState();
|
|
20705
20800
|
const [from] = Form.useForm();
|
|
20706
20801
|
const onSubmit = (values) => {
|
|
@@ -20739,6 +20834,8 @@ const Image$4 = () => {
|
|
|
20739
20834
|
Popover,
|
|
20740
20835
|
{
|
|
20741
20836
|
trigger: "click",
|
|
20837
|
+
popupVisible,
|
|
20838
|
+
onVisibleChange,
|
|
20742
20839
|
triggerProps: {
|
|
20743
20840
|
position: "bl",
|
|
20744
20841
|
popupStyle: { padding: "0px" }
|
|
@@ -20839,15 +20936,16 @@ const Image$4 = () => {
|
|
|
20839
20936
|
/* @__PURE__ */ React__default.createElement("span", { ref, className: classnames$1("formatButton") }, /* @__PURE__ */ React__default.createElement("span", { className: classnames$1(" iconfont icon-img") }))
|
|
20840
20937
|
);
|
|
20841
20938
|
};
|
|
20842
|
-
const RichTextBarContext = React__default.createContext({});
|
|
20843
20939
|
const RichTextBar = ({
|
|
20844
20940
|
list,
|
|
20845
20941
|
wrap: wrap2,
|
|
20846
20942
|
getPopupContainer
|
|
20847
20943
|
}) => {
|
|
20944
|
+
const { activePopup, setPopupVisible, closePopup } = useRichTextBarPopupCoordinator();
|
|
20945
|
+
const onClickCapture = useRichTextBarActionBoundary(closePopup);
|
|
20848
20946
|
const contextValue = useMemo(
|
|
20849
|
-
() => ({ getPopupContainer }),
|
|
20850
|
-
[getPopupContainer]
|
|
20947
|
+
() => ({ getPopupContainer, activePopup, setPopupVisible, closePopup }),
|
|
20948
|
+
[activePopup, closePopup, getPopupContainer, setPopupVisible]
|
|
20851
20949
|
);
|
|
20852
20950
|
const { MergetagPopover: MergetagPopover2, mergetags, AIAssistant: AIAssistant2 } = useEditorProps();
|
|
20853
20951
|
const { selectedNode } = useSelectedNode();
|
|
@@ -20953,6 +21051,7 @@ const RichTextBar = ({
|
|
|
20953
21051
|
{
|
|
20954
21052
|
id: "RichTextBar",
|
|
20955
21053
|
className: "RichTextBar",
|
|
21054
|
+
onClickCapture,
|
|
20956
21055
|
style: {
|
|
20957
21056
|
display: "inline-flex",
|
|
20958
21057
|
alignItems: "center",
|
|
@@ -40918,6 +41017,7 @@ const AIPromptModal = (props) => {
|
|
|
40918
41017
|
};
|
|
40919
41018
|
const SvgMagic = (props) => /* @__PURE__ */ React$2.createElement("svg", __spreadValues({ className: "bi bi-magic", fill: "currentColor", height: 16, viewBox: "0 0 16 16", width: 16, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React$2.createElement("path", { d: "M9.5 2.672a.5.5 0 1 0 1 0V.843a.5.5 0 0 0-1 0v1.829Zm4.5.035A.5.5 0 0 0 13.293 2L12 3.293a.5.5 0 1 0 .707.707L14 2.707ZM7.293 4A.5.5 0 1 0 8 3.293L6.707 2A.5.5 0 0 0 6 2.707L7.293 4Zm-.621 2.5a.5.5 0 1 0 0-1H4.843a.5.5 0 1 0 0 1h1.829Zm8.485 0a.5.5 0 1 0 0-1h-1.829a.5.5 0 0 0 0 1h1.829ZM13.293 10A.5.5 0 1 0 14 9.293L12.707 8a.5.5 0 1 0-.707.707L13.293 10ZM9.5 11.157a.5.5 0 0 0 1 0V9.328a.5.5 0 0 0-1 0v1.829Zm1.854-5.097a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L8.646 5.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0l1.293-1.293Zm-3 3a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L.646 13.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0L8.354 9.06Z" }));
|
|
40920
41019
|
function AIAssistant({ isCollapsed }) {
|
|
41020
|
+
const { popupVisible, onVisibleChange } = useRichTextBarPopup("ai-assistant");
|
|
40921
41021
|
const isEnabled = EditorAuth.getFeatureEnabled("AI_ASSISTANT");
|
|
40922
41022
|
if (!isEnabled) {
|
|
40923
41023
|
throw new Error(`Current plan do not support AIAssistant`);
|
|
@@ -41177,6 +41277,8 @@ function AIAssistant({ isCollapsed }) {
|
|
|
41177
41277
|
return /* @__PURE__ */ React__default.createElement("div", { ref: setRefElement, style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React__default.createElement(
|
|
41178
41278
|
Select$1,
|
|
41179
41279
|
{
|
|
41280
|
+
popupVisible,
|
|
41281
|
+
onVisibleChange,
|
|
41180
41282
|
getPopupContainer: (node) => {
|
|
41181
41283
|
return Array.from(document.querySelectorAll(".RichTextBar")).find(
|
|
41182
41284
|
(item2) => item2.contains(node)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { TextFormat } from "easy-email-pro-editor";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import "./RichTextBar.scss";
|
|
4
|
-
export
|
|
5
|
-
getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
6
|
-
}>;
|
|
4
|
+
export { RichTextBarContext } from "./popupCoordinator";
|
|
7
5
|
export declare const RichTextBar: ({ list, wrap, getPopupContainer, }: {
|
|
8
6
|
list: Array<TextFormat | React.FC>;
|
|
9
7
|
wrap?: boolean | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type RichTextBarPopupId = string;
|
|
3
|
+
export declare const RichTextBarContext: React.Context<{
|
|
4
|
+
getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
5
|
+
activePopup: RichTextBarPopupId | null;
|
|
6
|
+
setPopupVisible: (popupId: RichTextBarPopupId, visible: boolean) => void;
|
|
7
|
+
closePopup: () => void;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getNextActivePopup: (activePopup: RichTextBarPopupId | null, popupId: RichTextBarPopupId, visible: boolean) => RichTextBarPopupId | null;
|
|
10
|
+
export declare const useRichTextBarPopup: (popupId: RichTextBarPopupId) => {
|
|
11
|
+
popupVisible: boolean;
|
|
12
|
+
onVisibleChange: (visible: boolean) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const useRichTextBarPopupCoordinator: () => {
|
|
15
|
+
activePopup: string | null;
|
|
16
|
+
setPopupVisible: (popupId: RichTextBarPopupId, visible: boolean) => void;
|
|
17
|
+
closePopup: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const useRichTextBarActionBoundary: (closePopup: () => void) => (event: React.MouseEvent<HTMLElement>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-email-pro-theme",
|
|
3
|
-
"version": "1.60.
|
|
3
|
+
"version": "1.60.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "vite build && npm run typings",
|
|
50
|
+
"test": "npm run test:hovering-toolbar && npm run test:ai-agent",
|
|
51
|
+
"test:hovering-toolbar": "cd ../.. && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/hoveringToolbarPopupCoordinator.test.ts && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/hoveringToolbarPopupCoordinator.render.test.tsx",
|
|
50
52
|
"test:ai-agent": "cd ../.. && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/aiBatchUpdate.test.ts && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/aiEditorTransaction.test.ts && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/aiAgentBatchSummary.test.ts && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/aiTransactionalMutation.test.ts && packages/easy-email-pro-core/node_modules/.bin/tsx packages/easy-email-pro-theme/test/aiSubjectUpdate.test.ts",
|
|
51
53
|
"typings": "tsc --declaration --emitDeclarationOnly --project tsconfig.alias.json && tsc-alias -p tsconfig.alias.json",
|
|
52
54
|
"lint": "eslint --fix --ext .tsx,.ts src/"
|