easy-email-extensions 3.1.2 → 3.1.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.
@@ -5,7 +5,8 @@ interface TreeNode<T> {
|
|
5
5
|
}
|
6
6
|
export interface BlockTreeProps<T extends TreeNode<T>> {
|
7
7
|
treeData: T[];
|
8
|
-
|
8
|
+
selectedKeys?: string[];
|
9
|
+
expandedKeys?: string[];
|
9
10
|
onSelect: (selectedId: string) => void;
|
10
11
|
onContextMenu?: (nodeData: T, ev: React.MouseEvent) => void;
|
11
12
|
onDragStart?: () => void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SliderProps, InputNumberProps, SwitchProps, DatePickerProps, TextAreaProps, CheckboxGroupProps } from '@arco-design/web-react';
|
1
|
+
import { SliderProps, InputNumberProps, SwitchProps, DatePickerProps, TextAreaProps, CheckboxGroupProps, TreeSelectProps } from '@arco-design/web-react';
|
2
2
|
import { ImageUploaderProps } from './ImageUploader';
|
3
3
|
import { UploadFieldProps } from './UploadField';
|
4
4
|
import { ColorPickerProps } from './ColorPicker';
|
@@ -19,6 +19,7 @@ export declare const ColorPickerField: (props: import("./enhancer").EnhancerProp
|
|
19
19
|
export declare const UploadField: (props: import("./enhancer").EnhancerProps<UploadFieldProps> & Omit<UploadFieldProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
20
20
|
export declare const ImageUploaderField: (props: import("./enhancer").EnhancerProps<ImageUploaderProps> & Omit<ImageUploaderProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
21
21
|
export declare const SelectField: (props: import("./enhancer").EnhancerProps<SelectProps> & Omit<SelectProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
22
|
+
export declare const TreeSelectField: (props: import("./enhancer").EnhancerProps<TreeSelectProps> & Omit<TreeSelectProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
22
23
|
export declare const AutoCompleteField: (props: import("./enhancer").EnhancerProps<AutoCompleteProps> & Omit<AutoCompleteProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
23
24
|
export declare const RadioGroupField: (props: import("./enhancer").EnhancerProps<RadioGroupProps> & Omit<RadioGroupProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
24
25
|
export declare const SwitchField: (props: import("./enhancer").EnhancerProps<SwitchProps> & Omit<SwitchProps, "value" | "onChange" | "mutators">) => JSX.Element;
|
package/lib/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { b as Align, A as AttributePanel, d as AttributesPanelWrapper,
|
1
|
+
export { b as Align, A as AttributePanel, d as AttributesPanelWrapper, X as AutoCompleteField, g as Background, j as BackgroundColor, a as BlockAttributeConfigurationManager, B as BlockLayer, u as BlockMarketManager, v as BlockMaskWrapper, m as Border, n as BorderColor, q as BorderStyle, s as BorderWidth, $ as CheckboxField, C as Color, K as ColorPickerField, e as ContainerBackgroundColor, _ as DatePickerField, D as Decoration, k as Direction, a0 as EditTabField, F as FontFamily, o as FontSize, r as FontStyle, t as FontWeight, H as Height, O as ImageUploaderField, a1 as InlineTextField, I as InteractivePrompt, L as LetterSpacing, h as LineHeight, l as Link, M as Margin, p as MergeTags, N as NavbarLinkPadding, G as NumberField, P as Padding, Y as RadioGroupField, a3 as RichTextField, z as SearchField, Q as SelectField, S as ShortcutToolbar, x as SimpleLayout, J as SliderField, w as SourceCodePanel, Z as SwitchField, T as TextAlign, E as TextAreaField, f as TextDecoration, y as TextField, i as TextTransform, R as TreeSelectField, U as UploadField, V as VerticalAlign, W as Width, a2 as enhancer } from "./index2.js";
|
2
2
|
import "react";
|
3
3
|
import "easy-email-editor";
|
4
4
|
import "easy-email-core";
|
package/lib/index2.js
CHANGED
@@ -56,7 +56,7 @@ var __async = (__this, __arguments, generator) => {
|
|
56
56
|
import * as React from "react";
|
57
57
|
import React__default, { Children, isValidElement, cloneElement, createContext, useContext, Component, useMemo, memo, forwardRef, useEffect, useRef, useLayoutEffect, useState, createRef, useImperativeHandle, PureComponent, useCallback, useReducer, createElement, Suspense } from "react";
|
58
58
|
import { IconFont, Stack as Stack$6, TextStyle, getBlockNodeByIdx, useBlock, getEditNode, getEditContent, useEditorProps, useFocusIdx, useEditorContext, getShadowRoot, FIXED_CONTAINER_ID, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_ID, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, getEditorRoot, useActiveTab, ActiveTabKeys } from "easy-email-editor";
|
59
|
-
import { BasicType, ImageManager, BlockManager, createBlockDataByType, getParentByIdx, getValueByIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getParentIdx, getNodeIdxClassName, getPageIdx, getChildIdx, MjmlToJson, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
|
59
|
+
import { BasicType, ImageManager, getContextMergeTags, BlockManager, createBlockDataByType, getParentByIdx, getValueByIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getParentIdx, getNodeIdxClassName, getPageIdx, getChildIdx, MjmlToJson, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
|
60
60
|
import ReactDOM, { findDOMNode, createPortal } from "react-dom";
|
61
61
|
import { useField, Field, useForm as useForm$1, Form as Form$3, version as version$2, useFormState } from "react-final-form";
|
62
62
|
var index$2 = "";
|
@@ -30639,14 +30639,33 @@ const img = new Image();
|
|
30639
30639
|
img.width = 0;
|
30640
30640
|
img.height = 0;
|
30641
30641
|
img.src = transparentImage;
|
30642
|
+
const fileNames = {
|
30643
|
+
key: "id"
|
30644
|
+
};
|
30642
30645
|
function BlockTree(props) {
|
30643
30646
|
const [blockTreeRef, setBlockTreeRef] = useState(null);
|
30644
|
-
const [selectedId, setSelectedId] = useState(props.selectedId);
|
30645
30647
|
const dragNode = useRef(null);
|
30646
|
-
const { treeData, allowDrop, onContextMenu } = props;
|
30648
|
+
const { treeData, allowDrop, onContextMenu, selectedKeys } = props;
|
30649
|
+
const treeDataRef = useRef(treeData);
|
30650
|
+
const [expandedKeys, setExpandedKeys] = useState([]);
|
30651
|
+
const onExpand = useCallback((keys2) => {
|
30652
|
+
setExpandedKeys(keys2);
|
30653
|
+
}, [setExpandedKeys]);
|
30654
|
+
useEffect(() => {
|
30655
|
+
if (props.defaultExpandAll) {
|
30656
|
+
const keys2 = [];
|
30657
|
+
const loop2 = (data) => {
|
30658
|
+
var _a;
|
30659
|
+
keys2.push(data.id);
|
30660
|
+
(_a = data.children) == null ? void 0 : _a.forEach(loop2);
|
30661
|
+
};
|
30662
|
+
treeDataRef.current.forEach(loop2);
|
30663
|
+
setExpandedKeys(keys2);
|
30664
|
+
}
|
30665
|
+
}, [props.defaultExpandAll]);
|
30647
30666
|
useEffect(() => {
|
30648
|
-
|
30649
|
-
}, [props.
|
30667
|
+
setExpandedKeys((keys2) => props.expandedKeys ? [...keys2, ...props.expandedKeys] : keys2);
|
30668
|
+
}, [props.expandedKeys]);
|
30650
30669
|
const onDragStart = useCallback((e, node) => {
|
30651
30670
|
var _a;
|
30652
30671
|
e.dataTransfer.dropEffect = "none";
|
@@ -30720,37 +30739,51 @@ function BlockTree(props) {
|
|
30720
30739
|
});
|
30721
30740
|
}
|
30722
30741
|
}, [blockTreeRef]);
|
30723
|
-
|
30724
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
30742
|
+
return useMemo(() => /* @__PURE__ */ React__default.createElement("div", {
|
30725
30743
|
ref: setBlockTreeRef,
|
30726
30744
|
onMouseLeave: props.onMouseLeave
|
30727
30745
|
}, /* @__PURE__ */ React__default.createElement(CacheTree, {
|
30728
30746
|
selectedKeys,
|
30747
|
+
expandedKeys,
|
30748
|
+
onExpand,
|
30729
30749
|
draggable: true,
|
30730
30750
|
size: "small",
|
30731
30751
|
treeData,
|
30732
30752
|
blockNode: true,
|
30733
|
-
fieldNames:
|
30734
|
-
key: "id"
|
30735
|
-
},
|
30753
|
+
fieldNames: fileNames,
|
30736
30754
|
onDragEnd,
|
30737
30755
|
onDragStart,
|
30738
30756
|
onDrop,
|
30739
30757
|
allowDrop: onDragMove,
|
30740
30758
|
onSelect,
|
30741
30759
|
renderTitle
|
30742
|
-
}))
|
30760
|
+
})), [
|
30761
|
+
treeData,
|
30762
|
+
props.onMouseLeave,
|
30763
|
+
expandedKeys,
|
30764
|
+
selectedKeys,
|
30765
|
+
onExpand,
|
30766
|
+
onDragEnd,
|
30767
|
+
onDragStart,
|
30768
|
+
onDrop,
|
30769
|
+
onDragMove,
|
30770
|
+
onSelect,
|
30771
|
+
renderTitle
|
30772
|
+
]);
|
30743
30773
|
}
|
30774
|
+
const cacheTreeDebounceCallback = lodash.exports.debounce((data, setCacheProps) => {
|
30775
|
+
setCacheProps(data);
|
30776
|
+
}, 300);
|
30744
30777
|
function CacheTree(props) {
|
30745
30778
|
const [cacheProps, setCacheProps] = useState(props);
|
30746
30779
|
const lastProps = useRef(props);
|
30747
|
-
const debounceCallback = useCallback(lodash.exports.debounce((data) => {
|
30748
|
-
setCacheProps(data);
|
30749
|
-
}, 300), []);
|
30750
30780
|
useEffect(() => {
|
30751
30781
|
if (lastProps.current.treeData !== props.treeData) {
|
30752
30782
|
lastProps.current = props;
|
30753
|
-
|
30783
|
+
cacheTreeDebounceCallback(props, setCacheProps);
|
30784
|
+
return () => {
|
30785
|
+
cacheTreeDebounceCallback.cancel();
|
30786
|
+
};
|
30754
30787
|
} else {
|
30755
30788
|
lastProps.current = props;
|
30756
30789
|
setCacheProps(props);
|
@@ -38923,7 +38956,10 @@ function AddFont() {
|
|
38923
38956
|
});
|
38924
38957
|
}
|
38925
38958
|
const MergeTags = React__default.memo((props) => {
|
38926
|
-
const {
|
38959
|
+
const { focusIdx: focusIdx2 } = useFocusIdx();
|
38960
|
+
const { mergeTags: mergeTags2 = {}, mergeTagGenerate } = useEditorProps();
|
38961
|
+
const { values: values2 } = useBlock();
|
38962
|
+
const contextMergeTags = useMemo(() => getContextMergeTags(mergeTags2, values2, focusIdx2), [mergeTags2, values2, focusIdx2]);
|
38927
38963
|
const treeOptions = useMemo(() => {
|
38928
38964
|
const treeData = [];
|
38929
38965
|
const deep = (key, title2, parent2, mapData = []) => {
|
@@ -38931,17 +38967,18 @@ const MergeTags = React__default.memo((props) => {
|
|
38931
38967
|
key: mergeTagGenerate(key),
|
38932
38968
|
value: mergeTagGenerate(key),
|
38933
38969
|
title: title2,
|
38970
|
+
disabled: lodash.exports.isObject(parent2[key]) || !parent2[title2],
|
38934
38971
|
children: []
|
38935
38972
|
};
|
38936
38973
|
mapData.push(currentMapData);
|
38937
|
-
const current = parent2[
|
38938
|
-
if (
|
38974
|
+
const current = parent2[title2];
|
38975
|
+
if (current && typeof current === "object") {
|
38939
38976
|
Object.keys(current).map((childKey) => deep(key + "." + childKey, childKey, current, currentMapData.children));
|
38940
38977
|
}
|
38941
38978
|
};
|
38942
|
-
Object.keys(
|
38979
|
+
Object.keys(contextMergeTags).map((key) => deep(key, key, contextMergeTags, treeData));
|
38943
38980
|
return treeData;
|
38944
|
-
}, [
|
38981
|
+
}, [contextMergeTags]);
|
38945
38982
|
const onSelect = useCallback((value) => {
|
38946
38983
|
return props.onChange(value);
|
38947
38984
|
}, [props]);
|
@@ -38950,13 +38987,12 @@ const MergeTags = React__default.memo((props) => {
|
|
38950
38987
|
}, props.isSelect ? /* @__PURE__ */ React__default.createElement(TreeSelect$1, {
|
38951
38988
|
value: props.value,
|
38952
38989
|
size: "small",
|
38953
|
-
style: { width: 120 },
|
38954
38990
|
dropdownMenuStyle: { maxHeight: 400, overflow: "auto" },
|
38955
38991
|
placeholder: "Please select",
|
38956
38992
|
treeData: treeOptions,
|
38957
38993
|
onChange: (val) => onSelect(val)
|
38958
38994
|
}) : /* @__PURE__ */ React__default.createElement(Tree$1, {
|
38959
|
-
|
38995
|
+
defaultExpandedKeys: [],
|
38960
38996
|
selectedKeys: [],
|
38961
38997
|
treeData: treeOptions,
|
38962
38998
|
onSelect: (vals) => onSelect(vals[0])
|
@@ -38964,7 +39000,7 @@ const MergeTags = React__default.memo((props) => {
|
|
38964
39000
|
});
|
38965
39001
|
const AttributesPanelWrapper = (props) => {
|
38966
39002
|
const { focusBlock: focusBlock2, setFocusBlock } = useBlock();
|
38967
|
-
const { mergeTags } = useEditorProps();
|
39003
|
+
const { mergeTags: mergeTags2 } = useEditorProps();
|
38968
39004
|
const block2 = focusBlock2 && BlockManager.getBlockByType(focusBlock2.type);
|
38969
39005
|
const onChangeHidden = useCallback((val) => {
|
38970
39006
|
if (!focusBlock2)
|
@@ -38994,7 +39030,7 @@ const AttributesPanelWrapper = (props) => {
|
|
38994
39030
|
}, /* @__PURE__ */ React__default.createElement(EyeIcon, null), /* @__PURE__ */ React__default.createElement(TextStyle, {
|
38995
39031
|
variation: "strong",
|
38996
39032
|
size: "large"
|
38997
|
-
}, `${block2.name} attributes`)), /* @__PURE__ */ React__default.createElement(Stack$6.Item, null, props.extra))), Boolean(focusBlock2.data.hidden) &&
|
39033
|
+
}, `${block2.name} attributes`)), /* @__PURE__ */ React__default.createElement(Stack$6.Item, null, props.extra))), Boolean(focusBlock2.data.hidden) && mergeTags2 && /* @__PURE__ */ React__default.createElement(Stack$6, {
|
38998
39034
|
spacing: "extraTight"
|
38999
39035
|
}, /* @__PURE__ */ React__default.createElement(TextStyle, null, "Hide if"), /* @__PURE__ */ React__default.createElement(MergeTags, {
|
39000
39036
|
isSelect: true,
|
@@ -40966,7 +41002,7 @@ function Margin() {
|
|
40966
41002
|
}
|
40967
41003
|
function Tools(props) {
|
40968
41004
|
const { container: container2 } = props;
|
40969
|
-
const { mergeTags } = useEditorProps();
|
41005
|
+
const { mergeTags: mergeTags2 } = useEditorProps();
|
40970
41006
|
const [selectionRange, setSelectionRange] = useState(null);
|
40971
41007
|
useEffect(() => {
|
40972
41008
|
const onSelectionChange = () => {
|
@@ -41116,7 +41152,7 @@ function Tools(props) {
|
|
41116
41152
|
getPopupContainer: getPopoverMountNode
|
41117
41153
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
41118
41154
|
className: "easy-email-extensions-divider"
|
41119
|
-
}),
|
41155
|
+
}), mergeTags2 && /* @__PURE__ */ React__default.createElement(Popover$1, {
|
41120
41156
|
trigger: "click",
|
41121
41157
|
color: "#fff",
|
41122
41158
|
position: "bottom",
|
@@ -41241,6 +41277,8 @@ function RichTextToolBar() {
|
|
41241
41277
|
} else {
|
41242
41278
|
setDirection("bottom");
|
41243
41279
|
}
|
41280
|
+
} else {
|
41281
|
+
setDirection("bottom");
|
41244
41282
|
}
|
41245
41283
|
}
|
41246
41284
|
};
|
@@ -41313,6 +41351,7 @@ const ColorPickerField = enhancer(ColorPicker, (e) => e);
|
|
41313
41351
|
const UploadField = enhancer(UploadField$1, (val) => val);
|
41314
41352
|
const ImageUploaderField = enhancer(ImageUploader, (url) => url);
|
41315
41353
|
const SelectField = enhancer(Select, (e) => e);
|
41354
|
+
const TreeSelectField = enhancer(TreeSelect$1, (e) => e);
|
41316
41355
|
const AutoCompleteField = enhancer(AutoComplete, (e) => e);
|
41317
41356
|
const RadioGroupField = enhancer(RadioGroup, (value) => value);
|
41318
41357
|
const SwitchField = enhancer(Switch$1, (e) => e);
|
@@ -41645,29 +41684,29 @@ function getDirectionFormDropPosition(position) {
|
|
41645
41684
|
return "";
|
41646
41685
|
}
|
41647
41686
|
function BlockLayer() {
|
41648
|
-
const {
|
41649
|
-
pageData: pageData2,
|
41650
|
-
formState: { values: values2 }
|
41651
|
-
} = useEditorContext();
|
41652
|
-
const { onUploadImage, onAddCollection } = useEditorProps();
|
41687
|
+
const { pageData: pageData2 } = useEditorContext();
|
41653
41688
|
const { focusIdx: focusIdx2, setFocusIdx } = useFocusIdx();
|
41654
41689
|
const { setHoverIdx, setIsDragging, setDirection } = useHoverIdx();
|
41655
|
-
const { moveBlock, setValueByIdx: setValueByIdx2, copyBlock, removeBlock } = useBlock();
|
41690
|
+
const { moveBlock, setValueByIdx: setValueByIdx2, copyBlock, removeBlock, values: values2 } = useBlock();
|
41656
41691
|
const {
|
41657
41692
|
setBlockLayerRef,
|
41658
41693
|
allowDrop,
|
41659
41694
|
blockLayerRef,
|
41660
41695
|
removeHightLightClassName
|
41661
41696
|
} = useAvatarWrapperDrop();
|
41697
|
+
const valueRef = useRef(values2);
|
41698
|
+
useEffect(() => {
|
41699
|
+
valueRef.current = values2;
|
41700
|
+
}, [values2]);
|
41662
41701
|
const [contextMenuData, setContextMenuData] = useState(null);
|
41663
41702
|
const onToggleVisible = useCallback(({ id }, e) => {
|
41664
41703
|
e.stopPropagation();
|
41665
|
-
const blockData = lodash.exports.get(
|
41704
|
+
const blockData = lodash.exports.get(valueRef.current, id);
|
41666
41705
|
if (blockData) {
|
41667
41706
|
blockData.data.hidden = !Boolean(blockData.data.hidden);
|
41668
41707
|
setValueByIdx2(id, blockData);
|
41669
41708
|
}
|
41670
|
-
}, [setValueByIdx2
|
41709
|
+
}, [setValueByIdx2]);
|
41671
41710
|
const renderTitle = useCallback((data) => {
|
41672
41711
|
const block2 = BlockManager.getBlockByType(data.type);
|
41673
41712
|
const isPage = data.type === BasicType.PAGE;
|
@@ -41761,56 +41800,51 @@ function BlockLayer() {
|
|
41761
41800
|
}
|
41762
41801
|
return dropResult;
|
41763
41802
|
}, [allowDrop]);
|
41803
|
+
const selectedKeys = useMemo(() => {
|
41804
|
+
if (!focusIdx2)
|
41805
|
+
return [];
|
41806
|
+
return [focusIdx2];
|
41807
|
+
}, [focusIdx2]);
|
41808
|
+
const expandedKeys = useMemo(() => {
|
41809
|
+
if (!focusIdx2)
|
41810
|
+
return [];
|
41811
|
+
let currentIdx = getParentIdx(focusIdx2);
|
41812
|
+
const keys2 = [];
|
41813
|
+
while (currentIdx) {
|
41814
|
+
keys2.push(currentIdx);
|
41815
|
+
currentIdx = getParentIdx(currentIdx);
|
41816
|
+
}
|
41817
|
+
return keys2;
|
41818
|
+
}, [focusIdx2]);
|
41764
41819
|
const hasFocus = Boolean(focusIdx2);
|
41765
|
-
|
41766
|
-
|
41767
|
-
|
41768
|
-
|
41769
|
-
|
41770
|
-
|
41771
|
-
|
41772
|
-
|
41773
|
-
|
41774
|
-
|
41775
|
-
|
41776
|
-
treeData,
|
41777
|
-
renderTitle,
|
41778
|
-
allowDrop: blockTreeAllowDrop,
|
41779
|
-
onContextMenu,
|
41780
|
-
onDrop,
|
41781
|
-
onDragStart,
|
41782
|
-
onDragEnd,
|
41783
|
-
onSelect,
|
41784
|
-
onMouseEnter,
|
41785
|
-
onMouseLeave
|
41786
|
-
}), contextMenuData && /* @__PURE__ */ React__default.createElement(ContextMenu, {
|
41787
|
-
onClose: onCloseContextMenu,
|
41788
|
-
moveBlock,
|
41789
|
-
copyBlock,
|
41790
|
-
removeBlock,
|
41791
|
-
contextMenuData
|
41792
|
-
}));
|
41793
|
-
}, [
|
41794
|
-
hasFocus,
|
41795
|
-
focusIdx2,
|
41820
|
+
if (!hasFocus)
|
41821
|
+
return null;
|
41822
|
+
return /* @__PURE__ */ React__default.createElement("div", __spreadValues({
|
41823
|
+
ref: setBlockLayerRef,
|
41824
|
+
id: "BlockLayerManager"
|
41825
|
+
}, {
|
41826
|
+
[DATA_ATTRIBUTE_DROP_CONTAINER]: "true"
|
41827
|
+
}), /* @__PURE__ */ React__default.createElement(BlockTree, {
|
41828
|
+
selectedKeys,
|
41829
|
+
expandedKeys,
|
41830
|
+
defaultExpandAll: true,
|
41796
41831
|
treeData,
|
41797
41832
|
renderTitle,
|
41798
|
-
allowDrop,
|
41833
|
+
allowDrop: blockTreeAllowDrop,
|
41799
41834
|
onContextMenu,
|
41800
41835
|
onDrop,
|
41836
|
+
onDragStart,
|
41837
|
+
onDragEnd,
|
41801
41838
|
onSelect,
|
41802
41839
|
onMouseEnter,
|
41803
|
-
onMouseLeave
|
41804
|
-
|
41805
|
-
onCloseContextMenu,
|
41806
|
-
onUploadImage,
|
41807
|
-
onAddCollection,
|
41840
|
+
onMouseLeave
|
41841
|
+
}), contextMenuData && /* @__PURE__ */ React__default.createElement(ContextMenu, {
|
41842
|
+
onClose: onCloseContextMenu,
|
41808
41843
|
moveBlock,
|
41809
41844
|
copyBlock,
|
41810
41845
|
removeBlock,
|
41811
|
-
|
41812
|
-
|
41813
|
-
]);
|
41846
|
+
contextMenuData
|
41847
|
+
}));
|
41814
41848
|
}
|
41815
41849
|
const BlocksPanel$1 = "_BlocksPanel_15fho_1";
|
41816
41850
|
const blockItem = "_blockItem_15fho_5";
|
@@ -44111,6 +44145,7 @@ function SourceCodePanel() {
|
|
44111
44145
|
const { focusIdx } = useFocusIdx();
|
44112
44146
|
const [mjmlText, setMjmlText] = useState("");
|
44113
44147
|
const { pageData } = useEditorContext();
|
44148
|
+
const { mergeTags } = useEditorProps();
|
44114
44149
|
const code = useMemo(() => {
|
44115
44150
|
if (!focusBlock)
|
44116
44151
|
return "";
|
@@ -44156,9 +44191,10 @@ function SourceCodePanel() {
|
|
44156
44191
|
idx: focusIdx,
|
44157
44192
|
data: focusBlock,
|
44158
44193
|
context: pageData,
|
44159
|
-
mode: "production"
|
44194
|
+
mode: "production",
|
44195
|
+
dataSource: mergeTags
|
44160
44196
|
}));
|
44161
|
-
}, [focusBlock, focusIdx, pageData]);
|
44197
|
+
}, [focusBlock, focusIdx, pageData, mergeTags]);
|
44162
44198
|
if (!focusBlock)
|
44163
44199
|
return null;
|
44164
44200
|
return /* @__PURE__ */ React__default.createElement(Collapse$1, null, /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
|
@@ -44197,25 +44233,29 @@ function Toolbar({
|
|
44197
44233
|
copyBlock(focusIdx2);
|
44198
44234
|
};
|
44199
44235
|
const handleDelete = () => {
|
44236
|
+
if (document.activeElement instanceof HTMLElement) {
|
44237
|
+
document.activeElement.blur();
|
44238
|
+
}
|
44200
44239
|
removeBlock(focusIdx2);
|
44201
44240
|
};
|
44202
44241
|
const handleSelectParent = () => {
|
44203
44242
|
setFocusIdx(getParentIdx(focusIdx2));
|
44204
44243
|
};
|
44205
44244
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
44245
|
+
id: "easy-email-extensions-InteractivePrompt-Toolbar",
|
44206
44246
|
style: {
|
44207
44247
|
position: "absolute",
|
44208
44248
|
left: 0,
|
44249
|
+
height: 0,
|
44209
44250
|
top: direction === "top" || isPage ? 0 : "100%",
|
44210
|
-
fontSize: 14,
|
44211
44251
|
zIndex: 3,
|
44212
|
-
|
44213
|
-
width: "100%",
|
44214
|
-
pointerEvents: "none",
|
44215
|
-
lineHeight: "22px"
|
44252
|
+
width: "100%"
|
44216
44253
|
}
|
44217
44254
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
44218
44255
|
style: {
|
44256
|
+
fontSize: 14,
|
44257
|
+
lineHeight: "22px",
|
44258
|
+
pointerEvents: "auto",
|
44219
44259
|
color: "#ffffff",
|
44220
44260
|
transform: direction !== "top" || isPage ? void 0 : "translateY(-100%)",
|
44221
44261
|
display: "flex"
|
@@ -44332,6 +44372,7 @@ function FocusTooltip() {
|
|
44332
44372
|
if (!block2 || !blockNode)
|
44333
44373
|
return null;
|
44334
44374
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(/* @__PURE__ */ React__default.createElement("div", {
|
44375
|
+
id: "easy-email-extensions-InteractivePrompt-FocusTooltip",
|
44335
44376
|
style: {
|
44336
44377
|
position: "absolute",
|
44337
44378
|
width: "100%",
|
@@ -44434,6 +44475,7 @@ function HoverTooltip() {
|
|
44434
44475
|
if (!block2 || !blockNode)
|
44435
44476
|
return null;
|
44436
44477
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(/* @__PURE__ */ React__default.createElement("div", {
|
44478
|
+
id: "easy-email-extensions-InteractivePrompt-HoverTooltip",
|
44437
44479
|
style: {
|
44438
44480
|
position: "absolute",
|
44439
44481
|
height: "100%",
|
@@ -44447,14 +44489,14 @@ function HoverTooltip() {
|
|
44447
44489
|
type: isDragging ? "drag" : "hover",
|
44448
44490
|
lineWidth: 1,
|
44449
44491
|
title: block2.name,
|
44450
|
-
direction: isTop ? "noEnoughTop" : direction,
|
44492
|
+
direction: isTop && direction === "top" ? "noEnoughTop" : direction,
|
44451
44493
|
isDragging
|
44452
44494
|
})), blockNode));
|
44453
44495
|
}
|
44454
44496
|
function TipNode(props) {
|
44455
44497
|
const { direction, title: title2, lineWidth, type } = props;
|
44456
44498
|
const dragTitle = useMemo(() => {
|
44457
|
-
if (direction === "top") {
|
44499
|
+
if (direction === "top" || direction === "noEnoughTop") {
|
44458
44500
|
return `Insert before ${title2}`;
|
44459
44501
|
} else if (direction === "bottom") {
|
44460
44502
|
return `Insert after ${title2}`;
|
@@ -44672,5 +44714,5 @@ const SimpleLayout = (props) => {
|
|
44672
44714
|
title: "Source code"
|
44673
44715
|
}, /* @__PURE__ */ React__default.createElement(SourceCodePanel, null))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null));
|
44674
44716
|
};
|
44675
|
-
export {
|
44717
|
+
export { CheckboxField as $, AttributePanel as A, BlockLayer as B, Color as C, Decoration as D, TextAreaField as E, FontFamily as F, NumberField as G, Height as H, InteractivePrompt as I, SliderField as J, ColorPickerField as K, LetterSpacing as L, Margin as M, NavbarLinkPadding as N, ImageUploaderField as O, Padding as P, SelectField as Q, TreeSelectField as R, ShortcutToolbar as S, TextAlign as T, UploadField as U, VerticalAlign as V, Width as W, AutoCompleteField as X, RadioGroupField as Y, SwitchField as Z, DatePickerField as _, BlockAttributeConfigurationManager as a, EditTabField as a0, InlineTextField as a1, enhancer as a2, RichTextField as a3, Align as b, commonjsGlobal as c, AttributesPanelWrapper as d, ContainerBackgroundColor as e, TextDecoration as f, Background as g, LineHeight as h, TextTransform as i, BackgroundColor as j, Direction as k, Link as l, Border as m, BorderColor as n, FontSize as o, MergeTags as p, BorderStyle as q, FontStyle as r, BorderWidth as s, FontWeight as t, BlockMarketManager as u, BlockMaskWrapper as v, SourceCodePanel as w, SimpleLayout as x, TextField as y, SearchField as z };
|
44676
44718
|
//# sourceMappingURL=index2.js.map
|