easy-email-extensions 4.12.1 → 4.12.2
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/attributes/AttributesPanelWrapper/index.d.ts +1 -0
- package/lib/AttributePanel/components/attributes/CollapseWrapper/index.d.ts +1 -0
- package/lib/AttributePanel/components/provider/PresetColorsProvider/index.d.ts +3 -1
- package/lib/AttributePanel/components/provider/SelectionRangeProvider/index.d.ts +3 -1
- package/lib/ConfigurationPanel/index.d.ts +2 -1
- package/lib/EditPanel/ConfigurationDrawer/index.d.ts +2 -1
- package/lib/EditPanel/index.d.ts +2 -1
- package/lib/ShortcutToolbar/components/BlockMaskWrapper/index.d.ts +1 -0
- package/lib/ShortcutToolbar/components/BlocksPanel/index.d.ts +3 -1
- package/lib/SimpleLayout/SimpleLayout.d.ts +2 -0
- package/lib/SourceCodePanel/index.d.ts +3 -1
- package/lib/components/FullHeightOverlayScrollbars/index.d.ts +1 -0
- package/lib/components/Providers/ExtensionProvider.d.ts +2 -0
- package/lib/index2.js +40 -20
- package/lib/index2.js.map +1 -1
- package/package.json +8 -8
- package/readme.md +3 -1
@@ -3,4 +3,6 @@ export declare const PresetColorsContext: React.Context<{
|
|
3
3
|
colors: string[];
|
4
4
|
addCurrentColor: (color: string) => void;
|
5
5
|
}>;
|
6
|
-
export declare const PresetColorsProvider: React.FC<{
|
6
|
+
export declare const PresetColorsProvider: React.FC<{
|
7
|
+
children: React.ReactNode | React.ReactElement;
|
8
|
+
}>;
|
@@ -3,4 +3,6 @@ export declare const SelectionRangeContext: React.Context<{
|
|
3
3
|
selectionRange: Range | null;
|
4
4
|
setSelectionRange: React.Dispatch<React.SetStateAction<Range | null>>;
|
5
5
|
}>;
|
6
|
-
export declare const SelectionRangeProvider: React.FC<{
|
6
|
+
export declare const SelectionRangeProvider: React.FC<{
|
7
|
+
children: React.ReactNode | React.ReactElement;
|
8
|
+
}>;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
export interface ConfigurationPanelProps {
|
2
2
|
showSourceCode: boolean;
|
3
|
+
mjmlReadOnly: boolean;
|
3
4
|
height: string;
|
4
5
|
onBack?: () => void;
|
5
6
|
compact?: boolean;
|
6
7
|
}
|
7
|
-
export declare function ConfigurationPanel({ showSourceCode, height, onBack, compact, }: ConfigurationPanelProps): JSX.Element | null;
|
8
|
+
export declare function ConfigurationPanel({ showSourceCode, height, onBack, compact, mjmlReadOnly, }: ConfigurationPanelProps): JSX.Element | null;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
export declare function ConfigurationDrawer({ height, compact, showSourceCode, }: {
|
1
|
+
export declare function ConfigurationDrawer({ height, compact, showSourceCode, mjmlReadOnly, }: {
|
2
2
|
height: string;
|
3
3
|
compact: boolean;
|
4
4
|
showSourceCode: boolean;
|
5
|
+
mjmlReadOnly: boolean;
|
5
6
|
}): JSX.Element;
|
package/lib/EditPanel/index.d.ts
CHANGED
@@ -2,5 +2,7 @@ import React from 'react';
|
|
2
2
|
import { BlockLayerProps } from '../BlockLayer';
|
3
3
|
export declare const SimpleLayout: React.FC<{
|
4
4
|
showSourceCode?: boolean;
|
5
|
+
mjmlReadOnly?: boolean;
|
5
6
|
defaultShowLayer?: boolean;
|
7
|
+
children: React.ReactNode | React.ReactElement;
|
6
8
|
} & BlockLayerProps>;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { BlockLayerProps } from '../../BlockLayer';
|
2
2
|
import React from 'react';
|
3
3
|
export interface ExtensionProps extends BlockLayerProps {
|
4
|
+
children?: React.ReactNode | React.ReactElement;
|
4
5
|
categories: Array<{
|
5
6
|
label: string;
|
6
7
|
active?: boolean;
|
@@ -32,6 +33,7 @@ export interface ExtensionProps extends BlockLayerProps {
|
|
32
33
|
displayType: 'custom';
|
33
34
|
}>;
|
34
35
|
showSourceCode?: boolean;
|
36
|
+
mjmlReadOnly?: boolean;
|
35
37
|
compact?: boolean;
|
36
38
|
}
|
37
39
|
export declare const ExtensionContext: React.Context<ExtensionProps>;
|
package/lib/index2.js
CHANGED
@@ -36304,13 +36304,13 @@ function AttributePanel() {
|
|
36304
36304
|
style: { position: "absolute" }
|
36305
36305
|
}, /* @__PURE__ */ React__default.createElement(RichTextField, {
|
36306
36306
|
idx: focusIdx2
|
36307
|
-
})), shadowRoot && ReactDOM.createPortal(/* @__PURE__ */ React__default.createElement("style", null, `
|
36307
|
+
})), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, shadowRoot && ReactDOM.createPortal(/* @__PURE__ */ React__default.createElement("style", null, `
|
36308
36308
|
.email-block [contentEditable="true"],
|
36309
36309
|
.email-block [contentEditable="true"] * {
|
36310
36310
|
outline: none;
|
36311
36311
|
cursor: text;
|
36312
36312
|
}
|
36313
|
-
`), shadowRoot)));
|
36313
|
+
`), shadowRoot))));
|
36314
36314
|
}
|
36315
36315
|
function MergeTags(props) {
|
36316
36316
|
const { execCommand } = props;
|
@@ -39795,7 +39795,7 @@ const BlocksPanel = (props) => {
|
|
39795
39795
|
style: { position: "relative" }
|
39796
39796
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
39797
39797
|
onClick: toggleVisible
|
39798
|
-
}, props.children), ele && visible && createPortal(/* @__PURE__ */ React__default.createElement("div", {
|
39798
|
+
}, props.children), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ele && visible && createPortal(/* @__PURE__ */ React__default.createElement("div", {
|
39799
39799
|
className: styles$6.BlocksPanel,
|
39800
39800
|
style: {
|
39801
39801
|
pointerEvents: isDragging ? "none" : void 0,
|
@@ -39835,7 +39835,7 @@ const BlocksPanel = (props) => {
|
|
39835
39835
|
}, category.title)
|
39836
39836
|
}, /* @__PURE__ */ React__default.createElement(BlockPanelItem, {
|
39837
39837
|
category
|
39838
|
-
})))))), ele)), [filterCategories, ele, isDragging, props.children, toggleVisible, visible]);
|
39838
|
+
})))))), ele))), [filterCategories, ele, isDragging, props.children, toggleVisible, visible]);
|
39839
39839
|
};
|
39840
39840
|
const BlockPanelItem = React__default.memo((props) => {
|
39841
39841
|
return /* @__PURE__ */ React__default.createElement(Tabs$1, {
|
@@ -40045,7 +40045,7 @@ function MjmlToJson(data) {
|
|
40045
40045
|
headAttributes,
|
40046
40046
|
headStyles,
|
40047
40047
|
fonts,
|
40048
|
-
breakpoint: breakpoint == null ? void 0 : breakpoint.attributes.
|
40048
|
+
breakpoint: breakpoint == null ? void 0 : breakpoint.attributes.width
|
40049
40049
|
}, metaData)
|
40050
40050
|
}
|
40051
40051
|
});
|
@@ -40141,7 +40141,7 @@ function formatPadding(attributes, attributeName) {
|
|
40141
40141
|
attributes[attributeName] = newPadding;
|
40142
40142
|
}
|
40143
40143
|
}
|
40144
|
-
function SourceCodePanel() {
|
40144
|
+
function SourceCodePanel({ mjmlReadOnly }) {
|
40145
40145
|
const { setValueByIdx, focusBlock, values } = useBlock();
|
40146
40146
|
const { focusIdx } = useFocusIdx();
|
40147
40147
|
const [mjmlText, setMjmlText] = useState("");
|
@@ -40216,7 +40216,8 @@ function SourceCodePanel() {
|
|
40216
40216
|
value: mjmlText,
|
40217
40217
|
autoSize: { maxRows: 25 },
|
40218
40218
|
onChange: onChangeMjmlText,
|
40219
|
-
onBlur: onMjmlChange
|
40219
|
+
onBlur: onMjmlChange,
|
40220
|
+
readOnly: mjmlReadOnly
|
40220
40221
|
})));
|
40221
40222
|
}
|
40222
40223
|
function Toolbar() {
|
@@ -40956,7 +40957,7 @@ function MergeTagBadgePrompt() {
|
|
40956
40957
|
}
|
40957
40958
|
const SimpleLayout = (props) => {
|
40958
40959
|
const { height: containerHeight } = useEditorProps();
|
40959
|
-
const { showSourceCode = true, defaultShowLayer = true } = props;
|
40960
|
+
const { showSourceCode = true, defaultShowLayer = true, mjmlReadOnly: mjmlReadOnly2 = true } = props;
|
40960
40961
|
const [collapsed, setCollapsed] = useState(!defaultShowLayer);
|
40961
40962
|
return /* @__PURE__ */ React__default.createElement(ConfigProvider, {
|
40962
40963
|
locale: enUS
|
@@ -41038,7 +41039,9 @@ const SimpleLayout = (props) => {
|
|
41038
41039
|
title: /* @__PURE__ */ React__default.createElement("div", {
|
41039
41040
|
style: { height: 31, lineHeight: "31px" }
|
41040
41041
|
}, t("Source code"))
|
41041
|
-
}, /* @__PURE__ */ React__default.createElement(SourceCodePanel,
|
41042
|
+
}, /* @__PURE__ */ React__default.createElement(SourceCodePanel, {
|
41043
|
+
mjmlReadOnly: mjmlReadOnly2
|
41044
|
+
}))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
|
41042
41045
|
};
|
41043
41046
|
const StandardLayout$1 = "_StandardLayout_xv0bc_1";
|
41044
41047
|
var styles$3 = {
|
@@ -46095,7 +46098,8 @@ function ConfigurationPanel({
|
|
46095
46098
|
showSourceCode,
|
46096
46099
|
height,
|
46097
46100
|
onBack,
|
46098
|
-
compact
|
46101
|
+
compact,
|
46102
|
+
mjmlReadOnly: mjmlReadOnly2
|
46099
46103
|
}) {
|
46100
46104
|
const [inited, setInited] = useState(false);
|
46101
46105
|
useEffect(() => {
|
@@ -46140,12 +46144,15 @@ function ConfigurationPanel({
|
|
46140
46144
|
}, t("Source code"))
|
46141
46145
|
}, /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, {
|
46142
46146
|
height: `calc(${height} - 60px)`
|
46143
|
-
}, /* @__PURE__ */ React__default.createElement(SourceCodePanel,
|
46147
|
+
}, /* @__PURE__ */ React__default.createElement(SourceCodePanel, {
|
46148
|
+
mjmlReadOnly: mjmlReadOnly2
|
46149
|
+
})))) : /* @__PURE__ */ React__default.createElement(AttributePanel, null));
|
46144
46150
|
}
|
46145
46151
|
function ConfigurationDrawer({
|
46146
46152
|
height,
|
46147
46153
|
compact,
|
46148
|
-
showSourceCode
|
46154
|
+
showSourceCode,
|
46155
|
+
mjmlReadOnly: mjmlReadOnly2
|
46149
46156
|
}) {
|
46150
46157
|
const refWrapper = useRef(null);
|
46151
46158
|
const { focusIdx: focusIdx2, setFocusIdx } = useFocusIdx();
|
@@ -46180,12 +46187,16 @@ function ConfigurationDrawer({
|
|
46180
46187
|
compact,
|
46181
46188
|
showSourceCode,
|
46182
46189
|
height,
|
46183
|
-
onBack: onClose
|
46190
|
+
onBack: onClose,
|
46191
|
+
mjmlReadOnly: mjmlReadOnly2
|
46184
46192
|
})));
|
46185
46193
|
}, [visible, onClose, compact, showSourceCode, height]);
|
46186
46194
|
}
|
46187
46195
|
const TabPane = Tabs$1.TabPane;
|
46188
|
-
function EditPanel({
|
46196
|
+
function EditPanel({
|
46197
|
+
showSourceCode,
|
46198
|
+
mjmlReadOnly: mjmlReadOnly2
|
46199
|
+
}) {
|
46189
46200
|
const { height } = useEditorProps();
|
46190
46201
|
const { compact = true } = useExtensionProps();
|
46191
46202
|
return /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
|
@@ -46217,7 +46228,8 @@ function EditPanel({ showSourceCode }) {
|
|
46217
46228
|
}, /* @__PURE__ */ React__default.createElement(BlockLayer, null))))), !compact && /* @__PURE__ */ React__default.createElement(ConfigurationDrawer, {
|
46218
46229
|
height,
|
46219
46230
|
showSourceCode,
|
46220
|
-
compact: Boolean(compact)
|
46231
|
+
compact: Boolean(compact),
|
46232
|
+
mjmlReadOnly: mjmlReadOnly2
|
46221
46233
|
}));
|
46222
46234
|
}
|
46223
46235
|
const defaultCategories = [
|
@@ -46287,14 +46299,19 @@ const defaultCategories = [
|
|
46287
46299
|
get title() {
|
46288
46300
|
return t("4 columns");
|
46289
46301
|
},
|
46290
|
-
payload: [[
|
46302
|
+
payload: [["25%", "25%", "25%", "25%"]]
|
46291
46303
|
}
|
46292
46304
|
]
|
46293
46305
|
}
|
46294
46306
|
];
|
46295
46307
|
const StandardLayout = (props) => {
|
46296
46308
|
const { height: containerHeight } = useEditorProps();
|
46297
|
-
const {
|
46309
|
+
const {
|
46310
|
+
showSourceCode = true,
|
46311
|
+
compact = true,
|
46312
|
+
categories = defaultCategories,
|
46313
|
+
mjmlReadOnly: mjmlReadOnly2 = true
|
46314
|
+
} = props;
|
46298
46315
|
const { setFocusIdx } = useFocusIdx();
|
46299
46316
|
useEffect(() => {
|
46300
46317
|
if (!compact) {
|
@@ -46320,11 +46337,13 @@ const StandardLayout = (props) => {
|
|
46320
46337
|
overflow: "hidden"
|
46321
46338
|
}
|
46322
46339
|
}, compact && /* @__PURE__ */ React__default.createElement(EditPanel, {
|
46323
|
-
showSourceCode
|
46340
|
+
showSourceCode,
|
46341
|
+
mjmlReadOnly: mjmlReadOnly2
|
46324
46342
|
}), /* @__PURE__ */ React__default.createElement(Layout$1, {
|
46325
46343
|
style: { height: containerHeight, flex: 1 }
|
46326
46344
|
}, props.children), !compact && /* @__PURE__ */ React__default.createElement(EditPanel, {
|
46327
|
-
showSourceCode
|
46345
|
+
showSourceCode,
|
46346
|
+
mjmlReadOnly: mjmlReadOnly2
|
46328
46347
|
}), compact ? /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
|
46329
46348
|
style: {
|
46330
46349
|
height: containerHeight,
|
@@ -46335,7 +46354,8 @@ const StandardLayout = (props) => {
|
|
46335
46354
|
}, /* @__PURE__ */ React__default.createElement(ConfigurationPanel, {
|
46336
46355
|
compact,
|
46337
46356
|
height: containerHeight,
|
46338
|
-
showSourceCode
|
46357
|
+
showSourceCode,
|
46358
|
+
mjmlReadOnly: mjmlReadOnly2
|
46339
46359
|
})) : /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
|
46340
46360
|
style: { width: 0, overflow: "hidden" }
|
46341
46361
|
}))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
|