easy-email-extensions 3.1.29 → 3.1.34
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/AttributePanel/components/attributes/Width.d.ts +1 -1
- package/lib/BlockLayer/components/ContextMenu/index.d.ts +1 -1
- package/lib/BlockLayer/index.d.ts +1 -1
- package/lib/ShortcutToolbar/components/BlockMaskWrapper/index.d.ts +1 -1
- package/lib/ShortcutToolbar/components/BlocksPanel/presetTemplate/index.d.ts +1 -1
- package/lib/ShortcutToolbar/utils/BlockMarketManager.d.ts +1 -1
- package/lib/components/Form/ImageUploader/index.d.ts +1 -1
- package/lib/components/Form/enhancer.d.ts +1 -1
- package/lib/index2.js +56 -48
- package/lib/index2.js.map +1 -1
- package/lib/style.css +1 -1
- package/lib/utils/getBlockTitle.d.ts +1 -1
- package/package.json +4 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
import { InputWithUnitProps } from '
|
1
|
+
import { InputWithUnitProps } from '../../../components/Form/InputWithUnit';
|
2
2
|
export declare function Width({ inline, unitOptions, }: {
|
3
3
|
inline?: boolean;
|
4
4
|
unitOptions?: InputWithUnitProps['unitOptions'];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { useBlock } from 'easy-email-editor';
|
2
|
+
import { useBlock } from '../../../../easy-email-editor';
|
3
3
|
import { IBlockDataWithId } from '../../../BlockLayer';
|
4
4
|
export declare function ContextMenu({ moveBlock, copyBlock, removeBlock, contextMenuData, onClose, }: {
|
5
5
|
onClose: (ev?: React.MouseEvent) => void;
|
package/lib/index2.js
CHANGED
@@ -30737,6 +30737,13 @@ function BlockTree(props) {
|
|
30737
30737
|
const dragNode = useRef(null);
|
30738
30738
|
const { treeData, allowDrop, onContextMenu, selectedKeys } = props;
|
30739
30739
|
const treeDataRef = useRef(treeData);
|
30740
|
+
const {
|
30741
|
+
onDragStart: propsDragStart,
|
30742
|
+
onDrop: propsDrop,
|
30743
|
+
renderTitle: propsRenderTitle,
|
30744
|
+
onDragEnd: propsDragEnd,
|
30745
|
+
onSelect: propsSelect
|
30746
|
+
} = props;
|
30740
30747
|
const [expandedKeys, setExpandedKeys] = useState([]);
|
30741
30748
|
const onExpand = useCallback((keys2) => {
|
30742
30749
|
setExpandedKeys(keys2);
|
@@ -30757,7 +30764,6 @@ function BlockTree(props) {
|
|
30757
30764
|
setExpandedKeys((keys2) => props.expandedKeys ? [...keys2, ...props.expandedKeys] : keys2);
|
30758
30765
|
}, [props.expandedKeys]);
|
30759
30766
|
const onDragStart = useCallback((e, node) => {
|
30760
|
-
var _a;
|
30761
30767
|
e.dataTransfer.dropEffect = "none";
|
30762
30768
|
const dragNodeData = node.props.dataRef;
|
30763
30769
|
dragNode.current = {
|
@@ -30766,8 +30772,8 @@ function BlockTree(props) {
|
|
30766
30772
|
key: node.props._key,
|
30767
30773
|
parentKey: node.props.parentKey
|
30768
30774
|
};
|
30769
|
-
|
30770
|
-
}, [
|
30775
|
+
propsDragStart == null ? void 0 : propsDragStart();
|
30776
|
+
}, [propsDragStart]);
|
30771
30777
|
const onDragMove = useCallback((option) => {
|
30772
30778
|
if (!dragNode.current)
|
30773
30779
|
return false;
|
@@ -30787,7 +30793,7 @@ function BlockTree(props) {
|
|
30787
30793
|
return true;
|
30788
30794
|
}
|
30789
30795
|
return false;
|
30790
|
-
}, [
|
30796
|
+
}, [allowDrop]);
|
30791
30797
|
const onDrop = useCallback((info2) => {
|
30792
30798
|
const { dropNode, dropPosition, e } = info2;
|
30793
30799
|
e.dataTransfer.dropEffect = "move";
|
@@ -30804,22 +30810,21 @@ function BlockTree(props) {
|
|
30804
30810
|
},
|
30805
30811
|
dropPosition
|
30806
30812
|
};
|
30807
|
-
|
30808
|
-
}, []);
|
30813
|
+
propsDrop(currentDropData);
|
30814
|
+
}, [propsDrop]);
|
30809
30815
|
const renderTitle = useCallback((nodeData) => {
|
30810
30816
|
return /* @__PURE__ */ React__default.createElement("div", {
|
30811
30817
|
style: { display: "inline-flex", width: "100%" },
|
30812
30818
|
onContextMenu: (ev) => onContextMenu && onContextMenu(nodeData, ev)
|
30813
|
-
},
|
30814
|
-
}, [onContextMenu]);
|
30819
|
+
}, propsRenderTitle(nodeData));
|
30820
|
+
}, [onContextMenu, propsRenderTitle]);
|
30815
30821
|
const onDragEnd = useCallback(() => {
|
30816
|
-
var _a;
|
30817
30822
|
dragNode.current = null;
|
30818
|
-
|
30819
|
-
}, [
|
30823
|
+
propsDragEnd == null ? void 0 : propsDragEnd();
|
30824
|
+
}, [propsDragEnd]);
|
30820
30825
|
const onSelect = useCallback((selectedKeys2) => {
|
30821
|
-
|
30822
|
-
}, [
|
30826
|
+
propsSelect(selectedKeys2[0]);
|
30827
|
+
}, [propsSelect]);
|
30823
30828
|
useEffect(() => {
|
30824
30829
|
if (blockTreeRef) {
|
30825
30830
|
blockTreeRef.addEventListener("dragover", (e) => {
|
@@ -38477,7 +38482,7 @@ function enhancer(Component2, changeAdapter) {
|
|
38477
38482
|
setCurrentValue(newVal);
|
38478
38483
|
debounceCallbackChange(newVal);
|
38479
38484
|
onBlur3();
|
38480
|
-
}, [onBlur3
|
38485
|
+
}, [onBlur3]);
|
38481
38486
|
if (!wrapper2)
|
38482
38487
|
return /* @__PURE__ */ React__default.createElement(Component2, __spreadProps(__spreadValues({}, rest), {
|
38483
38488
|
id,
|
@@ -38549,10 +38554,15 @@ function enhancer(Component2, changeAdapter) {
|
|
38549
38554
|
};
|
38550
38555
|
}
|
38551
38556
|
function Input(props) {
|
38552
|
-
const {
|
38557
|
+
const {
|
38558
|
+
quickchange,
|
38559
|
+
value = "",
|
38560
|
+
onKeyDown: onPropsKeyDown,
|
38561
|
+
onChange: propsOnChange
|
38562
|
+
} = props;
|
38553
38563
|
const onChange = useCallback((val) => {
|
38554
|
-
|
38555
|
-
}, [
|
38564
|
+
propsOnChange(val);
|
38565
|
+
}, [propsOnChange]);
|
38556
38566
|
const onKeyDown = useCallback((ev) => {
|
38557
38567
|
if (onPropsKeyDown) {
|
38558
38568
|
onPropsKeyDown == null ? void 0 : onPropsKeyDown(ev);
|
@@ -38632,9 +38642,6 @@ function InputWithUnit(props) {
|
|
38632
38642
|
unit: arr[3] || unitOptions[0].value
|
38633
38643
|
};
|
38634
38644
|
}, [value, unitOptions]);
|
38635
|
-
useCallback((val) => {
|
38636
|
-
props.onChange(val);
|
38637
|
-
}, [props.onChange]);
|
38638
38645
|
return /* @__PURE__ */ React__default.createElement(Input, __spreadProps(__spreadValues({
|
38639
38646
|
value
|
38640
38647
|
}, restProps), {
|
@@ -39216,17 +39223,17 @@ const MergeTags = React__default.memo((props) => {
|
|
39216
39223
|
};
|
39217
39224
|
Object.keys(contextMergeTags).map((key) => deep(key, key, contextMergeTags, treeData));
|
39218
39225
|
return treeData;
|
39219
|
-
}, [contextMergeTags]);
|
39226
|
+
}, [contextMergeTags, mergeTagGenerate]);
|
39220
39227
|
const onSelect = useCallback((value) => {
|
39221
39228
|
return props.onChange(value);
|
39222
39229
|
}, [props]);
|
39223
39230
|
const mergeTagContent = useMemo(() => renderMergeTagContent ? renderMergeTagContent({
|
39224
39231
|
onChange: props.onChange,
|
39225
|
-
isSelect: props.isSelect,
|
39232
|
+
isSelect: Boolean(props.isSelect),
|
39226
39233
|
value: props.value
|
39227
39234
|
}) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null), [renderMergeTagContent, props.onChange, props.isSelect, props.value]);
|
39228
39235
|
if (renderMergeTagContent) {
|
39229
|
-
return mergeTagContent;
|
39236
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, mergeTagContent);
|
39230
39237
|
}
|
39231
39238
|
return /* @__PURE__ */ React__default.createElement("div", {
|
39232
39239
|
style: { color: "#333" }
|
@@ -39408,22 +39415,20 @@ function Padding(props = {}) {
|
|
39408
39415
|
const defaultConfig = useMemo(() => type ? createBlockDataByType(type) : void 0, [type]);
|
39409
39416
|
const paddingValue = focusBlock2 == null ? void 0 : focusBlock2.attributes[attributeName];
|
39410
39417
|
const defaultPaddingValue = defaultConfig == null ? void 0 : defaultConfig.attributes[attributeName];
|
39411
|
-
const paddingList = paddingValue == null ? void 0 : paddingValue.split(" ");
|
39412
|
-
const defaultPaddingList = defaultPaddingValue == null ? void 0 : defaultPaddingValue.split(" ");
|
39413
39418
|
const paddingFormValues = useMemo(() => {
|
39414
|
-
const
|
39415
|
-
const
|
39416
|
-
const top =
|
39417
|
-
const right =
|
39418
|
-
const bottom =
|
39419
|
-
const left =
|
39419
|
+
const paddingList = paddingValue == null ? void 0 : paddingValue.split(" ");
|
39420
|
+
const defaultPaddingList = defaultPaddingValue == null ? void 0 : defaultPaddingValue.split(" ");
|
39421
|
+
const top = paddingList ? paddingList[0] : (defaultPaddingList == null ? void 0 : defaultPaddingList[0]) || "";
|
39422
|
+
const right = paddingList ? paddingList[1] : (defaultPaddingList == null ? void 0 : defaultPaddingList[1]) || "";
|
39423
|
+
const bottom = paddingList ? paddingList[2] : (defaultPaddingList == null ? void 0 : defaultPaddingList[2]) || "";
|
39424
|
+
const left = paddingList ? paddingList[3] : (defaultPaddingList == null ? void 0 : defaultPaddingList[3]) || "";
|
39420
39425
|
return {
|
39421
39426
|
top,
|
39422
39427
|
left,
|
39423
39428
|
bottom,
|
39424
39429
|
right
|
39425
39430
|
};
|
39426
|
-
}, [
|
39431
|
+
}, [defaultPaddingValue, paddingValue]);
|
39427
39432
|
const onChancePadding = useCallback((val) => {
|
39428
39433
|
change(focusIdx2 + `.attributes[${attributeName}]`, val);
|
39429
39434
|
}, [focusIdx2, attributeName, change]);
|
@@ -39470,9 +39475,10 @@ const PaddingChangeWrapper = (props) => {
|
|
39470
39475
|
const {
|
39471
39476
|
values: { top, right, bottom, left }
|
39472
39477
|
} = useFormState();
|
39478
|
+
const { onChange } = props;
|
39473
39479
|
useEffect(() => {
|
39474
|
-
|
39475
|
-
}, [top, right, bottom, left]);
|
39480
|
+
onChange([top, right, bottom, left].join(" "));
|
39481
|
+
}, [top, right, bottom, left, onChange]);
|
39476
39482
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
|
39477
39483
|
};
|
39478
39484
|
function BackgroundColor({
|
@@ -41780,13 +41786,7 @@ function ContextMenu({
|
|
41780
41786
|
}, /* @__PURE__ */ React__default.createElement(IconFont, {
|
41781
41787
|
iconName: "icon-delete",
|
41782
41788
|
style: { marginRight: 10 }
|
41783
|
-
}), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, "Delete")), /* @__PURE__ */ React__default.createElement("div", {
|
41784
|
-
className: styles$5.listItem,
|
41785
|
-
onClick: handleAddToCollection
|
41786
|
-
}, /* @__PURE__ */ React__default.createElement(IconFont, {
|
41787
|
-
iconName: "icon-start",
|
41788
|
-
style: { marginRight: 10 }
|
41789
|
-
}), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, "Add to collection"))), /* @__PURE__ */ React__default.createElement("div", {
|
41789
|
+
}), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, "Delete"))), /* @__PURE__ */ React__default.createElement("div", {
|
41790
41790
|
className: styles$5.contextmenuMark,
|
41791
41791
|
onClick: onClose,
|
41792
41792
|
onContextMenu: (e) => {
|
@@ -41851,7 +41851,7 @@ function useAvatarWrapperDrop() {
|
|
41851
41851
|
setDirection("");
|
41852
41852
|
setHoverIdx("");
|
41853
41853
|
return false;
|
41854
|
-
}, [setDirection, setHoverIdx,
|
41854
|
+
}, [setDirection, setHoverIdx, valuesRef]);
|
41855
41855
|
useEffect(() => {
|
41856
41856
|
if (blockLayerRef) {
|
41857
41857
|
const onDragOver = lodash.exports.debounce((ev) => {
|
@@ -41941,7 +41941,16 @@ function useAvatarWrapperDrop() {
|
|
41941
41941
|
blockLayerRef.removeEventListener("dragleave", onDragend);
|
41942
41942
|
};
|
41943
41943
|
}
|
41944
|
-
}, [
|
41944
|
+
}, [
|
41945
|
+
blockLayerRef,
|
41946
|
+
dataTransferRef,
|
41947
|
+
valuesRef,
|
41948
|
+
removeHightLightClassName,
|
41949
|
+
allowDrop,
|
41950
|
+
setDirection,
|
41951
|
+
setHoverIdx,
|
41952
|
+
setDataTransfer
|
41953
|
+
]);
|
41945
41954
|
return {
|
41946
41955
|
setBlockLayerRef,
|
41947
41956
|
blockLayerRef,
|
@@ -42003,7 +42012,7 @@ function BlockLayer() {
|
|
42003
42012
|
blockData.data.hidden = !Boolean(blockData.data.hidden);
|
42004
42013
|
setValueByIdx2(id, blockData);
|
42005
42014
|
}
|
42006
|
-
}, [setValueByIdx2]);
|
42015
|
+
}, [setValueByIdx2, valueRef]);
|
42007
42016
|
const renderTitle = useCallback((data) => {
|
42008
42017
|
const isPage = data.type === BasicType.PAGE;
|
42009
42018
|
const title2 = getBlockTitle(data);
|
@@ -42092,7 +42101,7 @@ function BlockLayer() {
|
|
42092
42101
|
setHoverIdx(dropResult.key);
|
42093
42102
|
}
|
42094
42103
|
return dropResult;
|
42095
|
-
}, [allowDrop]);
|
42104
|
+
}, [allowDrop, removeHightLightClassName, setDirection, setHoverIdx]);
|
42096
42105
|
const selectedKeys = useMemo(() => {
|
42097
42106
|
if (!focusIdx2)
|
42098
42107
|
return [];
|
@@ -44957,8 +44966,8 @@ function InteractivePrompt() {
|
|
44957
44966
|
return null;
|
44958
44967
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(HoverTooltip, null), /* @__PURE__ */ React__default.createElement(FocusTooltip, null));
|
44959
44968
|
}
|
44960
|
-
const SimpleLayout$1 = "
|
44961
|
-
const customScrollBar = "
|
44969
|
+
const SimpleLayout$1 = "_SimpleLayout_1fd8j_1";
|
44970
|
+
const customScrollBar = "_customScrollBar_1fd8j_8";
|
44962
44971
|
var styles = {
|
44963
44972
|
SimpleLayout: SimpleLayout$1,
|
44964
44973
|
customScrollBar
|
@@ -45173,7 +45182,6 @@ const SimpleLayout = (props) => {
|
|
45173
45182
|
bodyStyle: { padding: 0 },
|
45174
45183
|
className: styles.customScrollBar
|
45175
45184
|
}, /* @__PURE__ */ React__default.createElement(Tabs$1, null, /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
|
45176
|
-
style: { marginTop: 0 },
|
45177
45185
|
key: "Configuration",
|
45178
45186
|
title: "Configuration"
|
45179
45187
|
}, /* @__PURE__ */ React__default.createElement(AttributePanel, null)), showSourceCode && /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
|