@go-mailer/easy-email-extensions 4.16.6 → 5.0.0
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/AttributePanel/components/blocks/AdvancedTable/Operation/tableTool.d.ts +1 -1
- package/lib/AttributePanel/components/blocks/AdvancedTable/Operation/type.d.ts +1 -1
- package/lib/AttributePanel/components/blocks/AdvancedTable/Operation/util.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/components/DragIcon/index.d.ts +1 -1
- package/lib/ShortcutToolbar/utils/BlockMarketManager.d.ts +1 -1
- package/lib/SourceCodePanel/index.d.ts +1 -1
- package/lib/components/Form/RichTextToolBar/components/Tools/IconBgColor/index.d.ts +1 -1
- package/lib/components/Form/RichTextToolBar/components/Tools/IconFontColor/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/index2.js +130 -83
- package/lib/index2.js.map +1 -1
- package/lib/index3.js +2 -2
- package/lib/utils/MjmlToJson.d.ts +1 -1
- package/lib/utils/getBlockTitle.d.ts +1 -1
- package/lib/utils/parseXMLtoBlock.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IBoundaryRect, IBoundingPosition, IOperationData } from './type';
|
|
2
|
-
import { AdvancedTableBlock } from 'easy-email-core';
|
|
2
|
+
import { AdvancedTableBlock } from '@go-mailer/easy-email-core';
|
|
3
3
|
export declare const getBoundaryRectAndElement: (el1: Element, el2: Element) => {
|
|
4
4
|
leftTopCell: Element;
|
|
5
5
|
bottomRightCell: Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useBlock } from 'easy-email-editor';
|
|
2
|
+
import { useBlock } from '@go-mailer/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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AdvancedType } from 'easy-email-core';
|
|
2
|
+
import { AdvancedType } from '@go-mailer/easy-email-core';
|
|
3
3
|
import { TextBlockItem } from './TextBlockItem';
|
|
4
4
|
import { ImageBlockItem } from './ImageBlockItem';
|
|
5
5
|
export declare const defaultCategories: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IBlockData, RecursivePartial } from 'easy-email-core';
|
|
2
|
+
import { IBlockData, RecursivePartial } from '@go-mailer/easy-email-core';
|
|
3
3
|
export interface DragIconProps<T extends IBlockData> {
|
|
4
4
|
type: string;
|
|
5
5
|
payload?: RecursivePartial<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function IconBgColor({ selectionRange, execCommand, getPopoverMountNode }: {
|
|
2
|
+
export declare function IconBgColor({ selectionRange, execCommand, getPopoverMountNode, }: {
|
|
3
3
|
selectionRange: Range | null;
|
|
4
4
|
execCommand: (cmd: string, val?: any) => void;
|
|
5
5
|
getPopoverMountNode: () => HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function IconFontColor({ selectionRange, execCommand, getPopoverMountNode }: {
|
|
2
|
+
export declare function IconFontColor({ selectionRange, execCommand, getPopoverMountNode, }: {
|
|
3
3
|
selectionRange: Range | null;
|
|
4
4
|
execCommand: (cmd: string, val?: any) => void;
|
|
5
5
|
getPopoverMountNode: () => HTMLElement;
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { e as Align, A as AttributePanel, f as AttributesPanelWrapper, ac as AutoCompleteField, l as Background, o as BackgroundColor, d as BlockAttributeConfigurationManager, B as BlockLayer, O as BlockMarketManager, Q as BlockMaskWrapper, r as Border, u as BorderColor, x as BorderStyle, z as BorderWidth, af as CheckboxField, I as ClassName, h as CollapseWrapper, C as Color, aj as ColorPickerField, i as Condition, j as ContainerBackgroundColor, D as Decoration, P as DefaultPageConfigPanel, p as Direction, ah as EditGridTabField, ag as EditTabField, _ as ExtensionContext, $ as ExtensionProvider, F as FontFamily, v as FontSize, y as FontStyle, E as FontWeight, H as Height, a9 as ImageUploaderField, ai as InlineTextField, a3 as InputWithUnitField, U as InteractivePrompt, L as LetterSpacing, m as LineHeight, q as Link, t as Margin, Z as MergeTagBadgePrompt, w as MergeTags, M as MjmlToJson, N as NavbarLinkPadding, a6 as NumberField, G as Padding, J as PresetColorsProvider, a1 as RICH_TEXT_TOOL_BAR, ad as RadioGroupField, al as RichTextField, a4 as SearchField, aa as SelectField, S as SelectionRangeProvider, am as ShadowDom, K as ShortcutToolbar, X as SimpleLayout, a7 as SliderField, R as SourceCodePanel, Y as StandardLayout, ae as SwitchField, T as TextAlign, a5 as TextAreaField, k as TextDecoration, a2 as TextField, n as TextTransform, ab as TreeSelectField, a8 as UploadField, V as VerticalAlign, W as Width, ak as enhancer, b as getBlockTitle, g as getContextMergeTags, a as getIconNameByBlockType, s as setIconsMap, a0 as useExtensionProps } from "./index2.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import "easy-email-editor";
|
|
4
|
-
import "easy-email-core";
|
|
3
|
+
import "@go-mailer/easy-email-editor";
|
|
4
|
+
import "@go-mailer/easy-email-core";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import "react-final-form";
|
|
7
7
|
import "uuid";
|
package/lib/index2.js
CHANGED
|
@@ -52,8 +52,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
};
|
|
53
53
|
import * as React from "react";
|
|
54
54
|
import React__default, { createContext, useContext, isValidElement, Children, cloneElement, Component, useRef, useMemo, memo, forwardRef, createRef, useState, useImperativeHandle, useEffect, useLayoutEffect, useCallback, PureComponent, useReducer, Fragment, Suspense } from "react";
|
|
55
|
-
import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, DATA_CONTENT_EDITABLE_IDX, useFocusBlockLayout, MergeTagBadge, AvailableTools, FIXED_CONTAINER_ID, getPluginElement, RICH_TEXT_BAR_ID, CONTENT_EDITABLE_CLASS_NAME, getEditorRoot, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, isTextBlock, getBlockNodeByIdx, useLazyState, useActiveTab, ActiveTabKeys } from "easy-email-editor";
|
|
56
|
-
import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
|
|
55
|
+
import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, DATA_CONTENT_EDITABLE_IDX, useFocusBlockLayout, MergeTagBadge, AvailableTools, FIXED_CONTAINER_ID, getPluginElement, RICH_TEXT_BAR_ID, CONTENT_EDITABLE_CLASS_NAME, getEditorRoot, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, isTextBlock, getBlockNodeByIdx, useLazyState, useActiveTab, ActiveTabKeys } from "@go-mailer/easy-email-editor";
|
|
56
|
+
import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, JsonToMjml, getNodeTypeFromClassName } from "@go-mailer/easy-email-core";
|
|
57
57
|
import ReactDOM, { createPortal, render as render$1 } from "react-dom";
|
|
58
58
|
import { Field, useForm as useForm$1, useField, Form as Form$3, version as version$2, useFormState as useFormState$2 } from "react-final-form";
|
|
59
59
|
import { v4 } from "uuid";
|
|
@@ -35450,9 +35450,7 @@ function ImageUploader(props) {
|
|
|
35450
35450
|
const { mergeTags: mergeTags2 } = useEditorProps();
|
|
35451
35451
|
const [isUploading, setIsUploading] = useState(false);
|
|
35452
35452
|
const [preview, setPreview] = useState(false);
|
|
35453
|
-
const uploadHandlerRef = useRef(
|
|
35454
|
-
props.uploadHandler
|
|
35455
|
-
);
|
|
35453
|
+
const uploadHandlerRef = useRef(props.uploadHandler);
|
|
35456
35454
|
const onChange = props.onChange;
|
|
35457
35455
|
const onUpload = useCallback(() => {
|
|
35458
35456
|
if (isUploading) {
|
|
@@ -38081,9 +38079,12 @@ function useFontFamily() {
|
|
|
38081
38079
|
const options2 = addFonts.map((item2) => ({ value: item2.name, label: item2.name }));
|
|
38082
38080
|
fonts.unshift(...options2);
|
|
38083
38081
|
}
|
|
38084
|
-
return fonts.map((item2) => ({
|
|
38085
|
-
|
|
38086
|
-
|
|
38082
|
+
return fonts.map((item2) => ({
|
|
38083
|
+
value: item2.value,
|
|
38084
|
+
label: /* @__PURE__ */ React__default.createElement("span", {
|
|
38085
|
+
style: { fontFamily: item2.value }
|
|
38086
|
+
}, item2.label)
|
|
38087
|
+
}));
|
|
38087
38088
|
}, [addFonts, defaultFontList]);
|
|
38088
38089
|
return {
|
|
38089
38090
|
fontList: fontList2
|
|
@@ -38847,47 +38848,56 @@ function Condition() {
|
|
|
38847
38848
|
},
|
|
38848
38849
|
[change, condition, focusIdx2]
|
|
38849
38850
|
);
|
|
38850
|
-
const onAddCondition = useCallback(
|
|
38851
|
-
|
|
38852
|
-
|
|
38853
|
-
|
|
38854
|
-
|
|
38855
|
-
|
|
38856
|
-
|
|
38857
|
-
|
|
38858
|
-
|
|
38859
|
-
|
|
38860
|
-
|
|
38861
|
-
|
|
38862
|
-
|
|
38863
|
-
|
|
38864
|
-
|
|
38865
|
-
|
|
38866
|
-
|
|
38867
|
-
|
|
38868
|
-
|
|
38869
|
-
|
|
38870
|
-
|
|
38871
|
-
|
|
38872
|
-
|
|
38873
|
-
|
|
38874
|
-
|
|
38875
|
-
|
|
38876
|
-
|
|
38877
|
-
|
|
38878
|
-
|
|
38879
|
-
|
|
38880
|
-
|
|
38881
|
-
if (
|
|
38882
|
-
Message$1.warning(t("At least one condition"));
|
|
38851
|
+
const onAddCondition = useCallback(
|
|
38852
|
+
(path) => {
|
|
38853
|
+
const groups = lodash.exports.get(values2, path);
|
|
38854
|
+
groups.push({
|
|
38855
|
+
symbol: OperatorSymbol.AND,
|
|
38856
|
+
groups: [
|
|
38857
|
+
{
|
|
38858
|
+
left: "",
|
|
38859
|
+
operator: Operator.TRUTHY,
|
|
38860
|
+
right: ""
|
|
38861
|
+
}
|
|
38862
|
+
]
|
|
38863
|
+
});
|
|
38864
|
+
change(path, [...groups]);
|
|
38865
|
+
},
|
|
38866
|
+
[change, values2]
|
|
38867
|
+
);
|
|
38868
|
+
const onAddSubCondition = useCallback(
|
|
38869
|
+
(path) => {
|
|
38870
|
+
const groups = lodash.exports.get(values2, path);
|
|
38871
|
+
groups.push({
|
|
38872
|
+
left: "",
|
|
38873
|
+
operator: Operator.TRUTHY,
|
|
38874
|
+
right: ""
|
|
38875
|
+
});
|
|
38876
|
+
change(path, [...groups]);
|
|
38877
|
+
},
|
|
38878
|
+
[change, values2]
|
|
38879
|
+
);
|
|
38880
|
+
const onDelete = useCallback(
|
|
38881
|
+
(path, gIndex, ggIndex) => {
|
|
38882
|
+
if (!condition)
|
|
38883
38883
|
return;
|
|
38884
|
+
const subPath = `${path}.${gIndex}.groups`;
|
|
38885
|
+
const groups = lodash.exports.cloneDeep(lodash.exports.get(values2, path));
|
|
38886
|
+
const subGroups = lodash.exports.cloneDeep(lodash.exports.get(values2, subPath));
|
|
38887
|
+
subGroups.splice(ggIndex, 1);
|
|
38888
|
+
if (subGroups.length === 0) {
|
|
38889
|
+
if (groups.length === 1) {
|
|
38890
|
+
Message$1.warning(t("At least one condition"));
|
|
38891
|
+
return;
|
|
38892
|
+
}
|
|
38893
|
+
groups.splice(gIndex, 1);
|
|
38894
|
+
change(path, [...groups]);
|
|
38895
|
+
} else {
|
|
38896
|
+
change(subPath, [...subGroups]);
|
|
38884
38897
|
}
|
|
38885
|
-
|
|
38886
|
-
|
|
38887
|
-
|
|
38888
|
-
change(subPath, [...subGroups]);
|
|
38889
|
-
}
|
|
38890
|
-
}, [change, condition, values2]);
|
|
38898
|
+
},
|
|
38899
|
+
[change, condition, values2]
|
|
38900
|
+
);
|
|
38891
38901
|
if (!(focusBlock2 == null ? void 0 : focusBlock2.type) || !Object.values(AdvancedType).includes(focusBlock2 == null ? void 0 : focusBlock2.type)) {
|
|
38892
38902
|
return null;
|
|
38893
38903
|
}
|
|
@@ -38958,7 +38968,9 @@ function Condition() {
|
|
|
38958
38968
|
})), /* @__PURE__ */ React__default.createElement(Button$4, {
|
|
38959
38969
|
size: "small",
|
|
38960
38970
|
icon: /* @__PURE__ */ React__default.createElement(IconPlus$1, null),
|
|
38961
|
-
onClick: () => onAddSubCondition(
|
|
38971
|
+
onClick: () => onAddSubCondition(
|
|
38972
|
+
`${focusIdx2}.data.value.condition.groups.${gIndex}.groups`
|
|
38973
|
+
)
|
|
38962
38974
|
})), group.groups.map((item2, ggIndex) => /* @__PURE__ */ React__default.createElement(ConditionItem, {
|
|
38963
38975
|
onDelete,
|
|
38964
38976
|
path: `${focusIdx2}.data.value.condition.groups`,
|
|
@@ -38969,10 +38981,20 @@ function Condition() {
|
|
|
38969
38981
|
}
|
|
38970
38982
|
})));
|
|
38971
38983
|
}
|
|
38972
|
-
const options$b = Object.values(Operator).map((item2) => ({
|
|
38973
|
-
|
|
38984
|
+
const options$b = Object.values(Operator).map((item2) => ({
|
|
38985
|
+
label: lodash.exports.upperFirst(item2),
|
|
38986
|
+
value: item2
|
|
38987
|
+
}));
|
|
38988
|
+
function ConditionItem({
|
|
38989
|
+
path,
|
|
38990
|
+
onDelete,
|
|
38991
|
+
gIndex,
|
|
38992
|
+
ggIndex
|
|
38993
|
+
}) {
|
|
38974
38994
|
const name2 = `${path}.${gIndex}.groups.${ggIndex}`;
|
|
38975
|
-
const {
|
|
38995
|
+
const {
|
|
38996
|
+
input: { value }
|
|
38997
|
+
} = useField(name2);
|
|
38976
38998
|
const hideRight = value.operator === Operator.TRUTHY || value.operator === Operator.FALSY;
|
|
38977
38999
|
return /* @__PURE__ */ React__default.createElement(Grid$1.Row, {
|
|
38978
39000
|
align: "end"
|
|
@@ -39472,11 +39494,7 @@ function getContextMergeTags(mergeTags2, context, idx) {
|
|
|
39472
39494
|
const MergeTags$1 = React__default.memo((props) => {
|
|
39473
39495
|
const [expandedKeys, setExpandedKeys] = useState([]);
|
|
39474
39496
|
const { focusIdx: focusIdx2 } = useFocusIdx();
|
|
39475
|
-
const {
|
|
39476
|
-
mergeTags: mergeTags2 = {},
|
|
39477
|
-
mergeTagGenerate,
|
|
39478
|
-
renderMergeTagContent
|
|
39479
|
-
} = useEditorProps();
|
|
39497
|
+
const { mergeTags: mergeTags2 = {}, mergeTagGenerate, renderMergeTagContent } = useEditorProps();
|
|
39480
39498
|
const { values: values2 } = useBlock();
|
|
39481
39499
|
const contextMergeTags = useMemo(
|
|
39482
39500
|
() => getContextMergeTags(mergeTags2, values2, focusIdx2),
|
|
@@ -39499,9 +39517,7 @@ const MergeTags$1 = React__default.memo((props) => {
|
|
|
39499
39517
|
);
|
|
39500
39518
|
}
|
|
39501
39519
|
};
|
|
39502
|
-
Object.keys(contextMergeTags).map(
|
|
39503
|
-
(key) => deep(key, key, contextMergeTags, treeData)
|
|
39504
|
-
);
|
|
39520
|
+
Object.keys(contextMergeTags).map((key) => deep(key, key, contextMergeTags, treeData));
|
|
39505
39521
|
return treeData;
|
|
39506
39522
|
}, [contextMergeTags]);
|
|
39507
39523
|
const onSelect = useCallback(
|
|
@@ -42163,7 +42179,11 @@ function useSelectionRange() {
|
|
|
42163
42179
|
setRangeByElement
|
|
42164
42180
|
};
|
|
42165
42181
|
}
|
|
42166
|
-
function IconBgColor({
|
|
42182
|
+
function IconBgColor({
|
|
42183
|
+
selectionRange,
|
|
42184
|
+
execCommand,
|
|
42185
|
+
getPopoverMountNode
|
|
42186
|
+
}) {
|
|
42167
42187
|
const color2 = useMemo(() => {
|
|
42168
42188
|
if (!selectionRange)
|
|
42169
42189
|
return void 0;
|
|
@@ -42190,12 +42210,22 @@ function IconBgColor({ selectionRange, execCommand, getPopoverMountNode }) {
|
|
|
42190
42210
|
iconName: "icon-bg-color",
|
|
42191
42211
|
style: { position: "relative", top: "-1px" }
|
|
42192
42212
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
42193
|
-
style: {
|
|
42213
|
+
style: {
|
|
42214
|
+
borderBottom: `2px solid ${color2}`,
|
|
42215
|
+
position: "absolute",
|
|
42216
|
+
width: "130%",
|
|
42217
|
+
left: "-15%",
|
|
42218
|
+
top: 16
|
|
42219
|
+
}
|
|
42194
42220
|
})),
|
|
42195
42221
|
title: t("Background color")
|
|
42196
42222
|
}));
|
|
42197
42223
|
}
|
|
42198
|
-
function IconFontColor({
|
|
42224
|
+
function IconFontColor({
|
|
42225
|
+
selectionRange,
|
|
42226
|
+
execCommand,
|
|
42227
|
+
getPopoverMountNode
|
|
42228
|
+
}) {
|
|
42199
42229
|
const color2 = useMemo(() => {
|
|
42200
42230
|
if (!selectionRange)
|
|
42201
42231
|
return void 0;
|
|
@@ -42222,7 +42252,13 @@ function IconFontColor({ selectionRange, execCommand, getPopoverMountNode }) {
|
|
|
42222
42252
|
iconName: "icon-font-color",
|
|
42223
42253
|
style: { position: "relative", top: "-1px" }
|
|
42224
42254
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
42225
|
-
style: {
|
|
42255
|
+
style: {
|
|
42256
|
+
borderBottom: `2px solid ${color2}`,
|
|
42257
|
+
position: "absolute",
|
|
42258
|
+
width: "130%",
|
|
42259
|
+
left: "-15%",
|
|
42260
|
+
top: 16
|
|
42261
|
+
}
|
|
42226
42262
|
})),
|
|
42227
42263
|
title: t("Text color")
|
|
42228
42264
|
}));
|
|
@@ -42259,7 +42295,12 @@ function BasicTools() {
|
|
|
42259
42295
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
42260
42296
|
style: { marginRight: 40 }
|
|
42261
42297
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
42262
|
-
style: {
|
|
42298
|
+
style: {
|
|
42299
|
+
position: "relative",
|
|
42300
|
+
marginRight: 10,
|
|
42301
|
+
color: "#fff",
|
|
42302
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, San Francisco, Segoe UI"
|
|
42303
|
+
}
|
|
42263
42304
|
}, "Text"), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
|
|
42264
42305
|
onClick: handleSelectParent,
|
|
42265
42306
|
title: t("Select parent block"),
|
|
@@ -45857,7 +45898,7 @@ function ShortcutToolbar() {
|
|
|
45857
45898
|
})), /* @__PURE__ */ React__default.createElement(DragIcon, {
|
|
45858
45899
|
type: AdvancedType.TEXT,
|
|
45859
45900
|
color: "rgb(110, 215, 135)",
|
|
45860
|
-
payload: { attributes: { padding: "0px 25px 0px 25px",
|
|
45901
|
+
payload: { attributes: { padding: "0px 25px 0px 25px", align: "center" } }
|
|
45861
45902
|
}), /* @__PURE__ */ React__default.createElement(DragIcon, {
|
|
45862
45903
|
payload: { attributes: { padding: "0px 0px 0px 0px" } },
|
|
45863
45904
|
type: AdvancedType.IMAGE,
|
|
@@ -46119,7 +46160,10 @@ const customTextArea = "_customTextArea_xcz5w_1";
|
|
|
46119
46160
|
var styles$5 = {
|
|
46120
46161
|
customTextArea
|
|
46121
46162
|
};
|
|
46122
|
-
function SourceCodePanel({
|
|
46163
|
+
function SourceCodePanel({
|
|
46164
|
+
jsonReadOnly,
|
|
46165
|
+
mjmlReadOnly
|
|
46166
|
+
}) {
|
|
46123
46167
|
const { setValueByIdx, focusBlock, values } = useBlock();
|
|
46124
46168
|
const { focusIdx } = useFocusIdx();
|
|
46125
46169
|
const [mjmlText, setMjmlText] = useState("");
|
|
@@ -46852,9 +46896,7 @@ const removeAllActiveBadge = () => {
|
|
|
46852
46896
|
getShadowRoot().querySelectorAll(".easy-email-merge-tag").forEach((item2) => {
|
|
46853
46897
|
item2.classList.remove("easy-email-merge-tag-focus");
|
|
46854
46898
|
});
|
|
46855
|
-
getShadowRoot().querySelectorAll(
|
|
46856
|
-
".easy-email-merge-tag-popover"
|
|
46857
|
-
);
|
|
46899
|
+
getShadowRoot().querySelectorAll(".easy-email-merge-tag-popover");
|
|
46858
46900
|
};
|
|
46859
46901
|
function MergeTagBadgePrompt() {
|
|
46860
46902
|
const { initialized } = useEditorContext();
|
|
@@ -46866,11 +46908,14 @@ function MergeTagBadgePrompt() {
|
|
|
46866
46908
|
const [target2, setTarget] = React__default.useState(null);
|
|
46867
46909
|
const targetRef = useRefState(target2);
|
|
46868
46910
|
const textContainer = getBlockNodeByChildEle(target2);
|
|
46869
|
-
const focusMergeTag = useCallback(
|
|
46870
|
-
|
|
46871
|
-
|
|
46872
|
-
|
|
46873
|
-
|
|
46911
|
+
const focusMergeTag = useCallback(
|
|
46912
|
+
(ele) => {
|
|
46913
|
+
if (!ele)
|
|
46914
|
+
return;
|
|
46915
|
+
setRangeByElement(ele);
|
|
46916
|
+
},
|
|
46917
|
+
[setRangeByElement]
|
|
46918
|
+
);
|
|
46874
46919
|
useEffect(() => {
|
|
46875
46920
|
const onBlur3 = (ev) => {
|
|
46876
46921
|
if (ev.target === getEditorRoot()) {
|
|
@@ -46956,7 +47001,9 @@ function MergeTagBadgePrompt() {
|
|
|
46956
47001
|
onClick: onClose
|
|
46957
47002
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
46958
47003
|
className: "easy-email-merge-tag-popover-desc"
|
|
46959
|
-
}, /* @__PURE__ */ React__default.createElement("p", null, t(
|
|
47004
|
+
}, /* @__PURE__ */ React__default.createElement("p", null, t(
|
|
47005
|
+
'If a personalized text value isn"t available, then a default value is shown.'
|
|
47006
|
+
)), /* @__PURE__ */ React__default.createElement("div", {
|
|
46960
47007
|
className: "easy-email-merge-tag-popover-desc-label"
|
|
46961
47008
|
}, /* @__PURE__ */ React__default.createElement("input", {
|
|
46962
47009
|
autoFocus: true,
|
|
@@ -46977,7 +47024,12 @@ function MergeTagBadgePrompt() {
|
|
|
46977
47024
|
}
|
|
46978
47025
|
const SimpleLayout = (props) => {
|
|
46979
47026
|
const { height: containerHeight } = useEditorProps();
|
|
46980
|
-
const {
|
|
47027
|
+
const {
|
|
47028
|
+
showSourceCode = true,
|
|
47029
|
+
defaultShowLayer = true,
|
|
47030
|
+
jsonReadOnly: jsonReadOnly2 = false,
|
|
47031
|
+
mjmlReadOnly: mjmlReadOnly2 = true
|
|
47032
|
+
} = props;
|
|
46981
47033
|
const [collapsed, setCollapsed] = useState(!defaultShowLayer);
|
|
46982
47034
|
return /* @__PURE__ */ React__default.createElement(ConfigProvider, {
|
|
46983
47035
|
locale: enUS
|
|
@@ -47098,9 +47150,7 @@ function useExtensionProps() {
|
|
|
47098
47150
|
function Blocks() {
|
|
47099
47151
|
const { categories } = useExtensionProps();
|
|
47100
47152
|
const defaultActiveKey = useMemo(
|
|
47101
|
-
() => [
|
|
47102
|
-
...categories.filter((item2) => item2.active).map((item2) => item2.label)
|
|
47103
|
-
],
|
|
47153
|
+
() => [...categories.filter((item2) => item2.active).map((item2) => item2.label)],
|
|
47104
47154
|
[categories]
|
|
47105
47155
|
);
|
|
47106
47156
|
return /* @__PURE__ */ React__default.createElement(Collapse$1, {
|
|
@@ -47168,10 +47218,7 @@ function BlockItem({
|
|
|
47168
47218
|
style: { marginTop: 10 }
|
|
47169
47219
|
}, title2 || (block2 == null ? void 0 : block2.name)))));
|
|
47170
47220
|
}
|
|
47171
|
-
function LayoutItem({
|
|
47172
|
-
columns,
|
|
47173
|
-
title: title2
|
|
47174
|
-
}) {
|
|
47221
|
+
function LayoutItem({ columns, title: title2 }) {
|
|
47175
47222
|
const [visible, setVisible] = useState(false);
|
|
47176
47223
|
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("p", {
|
|
47177
47224
|
onClick: () => setVisible((v2) => !v2),
|