easy-email-extensions 4.12.2 → 4.12.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.
@@ -1,8 +1,9 @@
1
1
  export interface ConfigurationPanelProps {
2
2
  showSourceCode: boolean;
3
+ jsonReadOnly: boolean;
3
4
  mjmlReadOnly: boolean;
4
5
  height: string;
5
6
  onBack?: () => void;
6
7
  compact?: boolean;
7
8
  }
8
- export declare function ConfigurationPanel({ showSourceCode, height, onBack, compact, mjmlReadOnly, }: ConfigurationPanelProps): JSX.Element | null;
9
+ export declare function ConfigurationPanel({ showSourceCode, height, onBack, compact, jsonReadOnly, mjmlReadOnly, }: ConfigurationPanelProps): JSX.Element | null;
@@ -1,6 +1,7 @@
1
- export declare function ConfigurationDrawer({ height, compact, showSourceCode, mjmlReadOnly, }: {
1
+ export declare function ConfigurationDrawer({ height, compact, showSourceCode, jsonReadOnly, mjmlReadOnly, }: {
2
2
  height: string;
3
3
  compact: boolean;
4
4
  showSourceCode: boolean;
5
+ jsonReadOnly: boolean;
5
6
  mjmlReadOnly: boolean;
6
7
  }): JSX.Element;
@@ -1,4 +1,5 @@
1
- export declare function EditPanel({ showSourceCode, mjmlReadOnly, }: {
1
+ export declare function EditPanel({ showSourceCode, jsonReadOnly, mjmlReadOnly, }: {
2
2
  showSourceCode: boolean;
3
+ jsonReadOnly: boolean;
3
4
  mjmlReadOnly: boolean;
4
5
  }): JSX.Element;
@@ -2,6 +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
+ jsonReadOnly?: boolean;
5
6
  mjmlReadOnly?: boolean;
6
7
  defaultShowLayer?: boolean;
7
8
  children: React.ReactNode | React.ReactElement;
@@ -1,3 +1,4 @@
1
- export declare function SourceCodePanel({ mjmlReadOnly }: {
1
+ export declare function SourceCodePanel({ jsonReadOnly, mjmlReadOnly }: {
2
+ jsonReadOnly: boolean;
2
3
  mjmlReadOnly: boolean;
3
4
  }): JSX.Element | null;
@@ -33,6 +33,7 @@ export interface ExtensionProps extends BlockLayerProps {
33
33
  displayType: 'custom';
34
34
  }>;
35
35
  showSourceCode?: boolean;
36
+ jsonReadOnly?: boolean;
36
37
  mjmlReadOnly?: boolean;
37
38
  compact?: boolean;
38
39
  }
package/lib/index2.js CHANGED
@@ -63,7 +63,7 @@ import { Field, useForm as useForm$1, useField, Form as Form$3, version as versi
63
63
  import mjml from "mjml-browser";
64
64
  var index$2 = "";
65
65
  const title = "_title_1f523_1";
66
- var styles$a = {
66
+ var styles$b = {
67
67
  title
68
68
  };
69
69
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -30349,7 +30349,7 @@ function CacheTree(props) {
30349
30349
  const wrap$1 = "_wrap_aul3a_1";
30350
30350
  const listItem = "_listItem_aul3a_13";
30351
30351
  const contextmenuMark = "_contextmenuMark_aul3a_23";
30352
- var styles$9 = {
30352
+ var styles$a = {
30353
30353
  wrap: wrap$1,
30354
30354
  listItem,
30355
30355
  contextmenuMark
@@ -30622,7 +30622,7 @@ const btnWrap = "_btn-wrap_jzksr_43";
30622
30622
  const upload = "_upload_jzksr_68";
30623
30623
  const wrap = "_wrap_jzksr_80";
30624
30624
  const urlInput = "_urlInput_jzksr_80";
30625
- var styles$8 = {
30625
+ var styles$9 = {
30626
30626
  container,
30627
30627
  error,
30628
30628
  item,
@@ -30855,27 +30855,27 @@ function ImageUploader(props) {
30855
30855
  const content = useMemo(() => {
30856
30856
  if (isUploading) {
30857
30857
  return /* @__PURE__ */ React__default.createElement("div", {
30858
- className: styles$8["item"]
30858
+ className: styles$9["item"]
30859
30859
  }, /* @__PURE__ */ React__default.createElement("div", {
30860
- className: classnames$1(styles$8["info"])
30860
+ className: classnames$1(styles$9["info"])
30861
30861
  }, /* @__PURE__ */ React__default.createElement(Spin$1, null), /* @__PURE__ */ React__default.createElement("div", {
30862
- className: styles$8["btn-wrap"]
30862
+ className: styles$9["btn-wrap"]
30863
30863
  })));
30864
30864
  }
30865
30865
  if (!props.value) {
30866
30866
  return /* @__PURE__ */ React__default.createElement("div", {
30867
- className: styles$8["upload"],
30867
+ className: styles$9["upload"],
30868
30868
  onClick: onUpload
30869
30869
  }, /* @__PURE__ */ React__default.createElement(IconPlus$1, null), /* @__PURE__ */ React__default.createElement("div", null, "Upload"));
30870
30870
  }
30871
30871
  return /* @__PURE__ */ React__default.createElement("div", {
30872
- className: styles$8["item"]
30872
+ className: styles$9["item"]
30873
30873
  }, /* @__PURE__ */ React__default.createElement("div", {
30874
- className: classnames$1(styles$8["info"])
30874
+ className: classnames$1(styles$9["info"])
30875
30875
  }, /* @__PURE__ */ React__default.createElement("img", {
30876
30876
  src: props.value
30877
30877
  }), /* @__PURE__ */ React__default.createElement("div", {
30878
- className: styles$8["btn-wrap"]
30878
+ className: styles$9["btn-wrap"]
30879
30879
  }, /* @__PURE__ */ React__default.createElement("a", {
30880
30880
  title: t("Preview"),
30881
30881
  onClick: () => setPreview(true)
@@ -30891,9 +30891,9 @@ function ImageUploader(props) {
30891
30891
  });
30892
30892
  }
30893
30893
  return /* @__PURE__ */ React__default.createElement("div", {
30894
- className: styles$8.wrap
30894
+ className: styles$9.wrap
30895
30895
  }, /* @__PURE__ */ React__default.createElement("div", {
30896
- className: styles$8["container"]
30896
+ className: styles$9["container"]
30897
30897
  }, content, /* @__PURE__ */ React__default.createElement(Grid.Row, {
30898
30898
  style: { width: "100%" }
30899
30899
  }, mergeTags2 && /* @__PURE__ */ React__default.createElement(Popover$1, {
@@ -31226,7 +31226,7 @@ const editTab = "_editTab_1m9nq_20";
31226
31226
  const inputWithUnit = "_inputWithUnit_1m9nq_27";
31227
31227
  const inputWithUnitSelectOption = "_inputWithUnitSelectOption_1m9nq_35";
31228
31228
  const colorPicker = "_colorPicker_1m9nq_40";
31229
- var styles$7 = {
31229
+ var styles$8 = {
31230
31230
  helperText,
31231
31231
  "label-hidden": "_label-hidden_1m9nq_9",
31232
31232
  labelHidden,
@@ -31254,7 +31254,7 @@ function EditTab(props) {
31254
31254
  };
31255
31255
  return /* @__PURE__ */ React__default.createElement(Tabs$1, {
31256
31256
  destroyOnHide: true,
31257
- className: classnames(styles$7.editTab),
31257
+ className: classnames(styles$8.editTab),
31258
31258
  style: { border: "none" },
31259
31259
  type: "card",
31260
31260
  activeTab,
@@ -33069,7 +33069,7 @@ function ColorPickerContent(props) {
33069
33069
  } catch (error2) {
33070
33070
  }
33071
33071
  return /* @__PURE__ */ React__default.createElement("div", {
33072
- className: styles$7.colorPicker,
33072
+ className: styles$8.colorPicker,
33073
33073
  style: { width: 202, paddingTop: 12, paddingBottom: 12 }
33074
33074
  }, /* @__PURE__ */ React__default.createElement("div", {
33075
33075
  style: { padding: "0px 16px" }
@@ -37171,40 +37171,40 @@ function ContextMenu({
37171
37171
  left,
37172
37172
  top
37173
37173
  },
37174
- className: styles$9.wrap,
37174
+ className: styles$a.wrap,
37175
37175
  onClick: (e) => e.stopPropagation()
37176
37176
  }, !isFirst && /* @__PURE__ */ React__default.createElement("div", {
37177
- className: styles$9.listItem,
37177
+ className: styles$a.listItem,
37178
37178
  onClick: handleMoveUp
37179
37179
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
37180
37180
  iconName: "icon-top",
37181
37181
  style: { marginRight: 10 }
37182
37182
  }), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, t("Move up"))), /* @__PURE__ */ React__default.createElement("div", {
37183
- className: styles$9.listItem,
37183
+ className: styles$a.listItem,
37184
37184
  onClick: handleMoveDown
37185
37185
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
37186
37186
  iconName: "icon-bottom",
37187
37187
  style: { marginRight: 10 }
37188
37188
  }), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, t("Move down"))), /* @__PURE__ */ React__default.createElement("div", {
37189
- className: styles$9.listItem,
37189
+ className: styles$a.listItem,
37190
37190
  onClick: handleCopy
37191
37191
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
37192
37192
  iconName: "icon-copy",
37193
37193
  style: { marginRight: 10 }
37194
37194
  }), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, t("Copy"))), props.onAddCollection && /* @__PURE__ */ React__default.createElement("div", {
37195
- className: styles$9.listItem,
37195
+ className: styles$a.listItem,
37196
37196
  onClick: handleAddToCollection
37197
37197
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
37198
37198
  iconName: "icon-start",
37199
37199
  style: { marginRight: 10 }
37200
37200
  }), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, "Add to collection")), /* @__PURE__ */ React__default.createElement("div", {
37201
- className: styles$9.listItem,
37201
+ className: styles$a.listItem,
37202
37202
  onClick: handleDelete
37203
37203
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
37204
37204
  iconName: "icon-delete",
37205
37205
  style: { marginRight: 10 }
37206
37206
  }), " ", /* @__PURE__ */ React__default.createElement(TextStyle, null, t("Delete")))), /* @__PURE__ */ React__default.createElement("div", {
37207
- className: styles$9.contextmenuMark,
37207
+ className: styles$a.contextmenuMark,
37208
37208
  onClick: onClose,
37209
37209
  onContextMenu: (e) => {
37210
37210
  e.preventDefault();
@@ -37450,7 +37450,7 @@ function BlockLayer(props) {
37450
37450
  const title2 = propsRenderTitle ? propsRenderTitle(data) : getBlockTitle(data);
37451
37451
  return /* @__PURE__ */ React__default.createElement("div", {
37452
37452
  "data-tree-idx": data.id,
37453
- className: classnames(styles$a.title, !isPage && getNodeIdxClassName(data.id), !isPage && "email-block")
37453
+ className: classnames(styles$b.title, !isPage && getNodeIdxClassName(data.id), !isPage && "email-block")
37454
37454
  }, /* @__PURE__ */ React__default.createElement(Space$1, {
37455
37455
  align: "center",
37456
37456
  size: "mini"
@@ -37468,7 +37468,7 @@ function BlockLayer(props) {
37468
37468
  }, /* @__PURE__ */ React__default.createElement(TextStyle, {
37469
37469
  size: "smallest"
37470
37470
  }, title2))), /* @__PURE__ */ React__default.createElement("div", {
37471
- className: styles$a.eyeIcon
37471
+ className: styles$b.eyeIcon
37472
37472
  }, /* @__PURE__ */ React__default.createElement(EyeIcon$1, {
37473
37473
  blockData: data,
37474
37474
  onToggleVisible
@@ -37592,7 +37592,7 @@ function BlockLayer(props) {
37592
37592
  const BlocksPanel$1 = "_BlocksPanel_15fho_1";
37593
37593
  const blockItem$1 = "_blockItem_15fho_5";
37594
37594
  const closeBtn = "_closeBtn_15fho_12";
37595
- var styles$6 = {
37595
+ var styles$7 = {
37596
37596
  BlocksPanel: BlocksPanel$1,
37597
37597
  blockItem: blockItem$1,
37598
37598
  closeBtn
@@ -37650,7 +37650,7 @@ __publicField(BlockMarketManager, "category", []);
37650
37650
  __publicField(BlockMarketManager, "subscriptHandles", []);
37651
37651
  const mask = "_mask_1a0xw_1";
37652
37652
  const drag = "_drag_1a0xw_12";
37653
- var styles$5 = {
37653
+ var styles$6 = {
37654
37654
  mask,
37655
37655
  drag
37656
37656
  };
@@ -37660,7 +37660,7 @@ const BlockMaskWrapper = (props) => {
37660
37660
  const { type, payload } = props;
37661
37661
  const onMouseDown = useCallback(() => {
37662
37662
  if (ref.current) {
37663
- ref.current.classList.add(styles$5.drag);
37663
+ ref.current.classList.add(styles$6.drag);
37664
37664
  }
37665
37665
  }, []);
37666
37666
  const onMaskMouseDown = useCallback((ev) => {
@@ -37672,7 +37672,7 @@ const BlockMaskWrapper = (props) => {
37672
37672
  useEffect(() => {
37673
37673
  const mouseup = () => {
37674
37674
  if (ref.current) {
37675
- ref.current.classList.remove(styles$5.drag);
37675
+ ref.current.classList.remove(styles$6.drag);
37676
37676
  }
37677
37677
  };
37678
37678
  document.addEventListener("mouseup", mouseup);
@@ -37683,7 +37683,7 @@ const BlockMaskWrapper = (props) => {
37683
37683
  return /* @__PURE__ */ React__default.createElement("div", {
37684
37684
  style: { position: "relative" }
37685
37685
  }, props.children, /* @__PURE__ */ React__default.createElement("div", {
37686
- className: styles$5.wrapper,
37686
+ className: styles$6.wrapper,
37687
37687
  style: {
37688
37688
  position: "absolute",
37689
37689
  height: "100%",
@@ -37698,7 +37698,7 @@ const BlockMaskWrapper = (props) => {
37698
37698
  payload
37699
37699
  }, /* @__PURE__ */ React__default.createElement("div", {
37700
37700
  ref,
37701
- className: styles$5.mask,
37701
+ className: styles$6.mask,
37702
37702
  onMouseDown: onMaskMouseDown
37703
37703
  }, /* @__PURE__ */ React__default.createElement("div", {
37704
37704
  ref: dragRef,
@@ -39796,7 +39796,7 @@ const BlocksPanel = (props) => {
39796
39796
  }, /* @__PURE__ */ React__default.createElement("div", {
39797
39797
  onClick: toggleVisible
39798
39798
  }, props.children), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ele && visible && createPortal(/* @__PURE__ */ React__default.createElement("div", {
39799
- className: styles$6.BlocksPanel,
39799
+ className: styles$7.BlocksPanel,
39800
39800
  style: {
39801
39801
  pointerEvents: isDragging ? "none" : void 0,
39802
39802
  position: "fixed",
@@ -39812,7 +39812,7 @@ const BlocksPanel = (props) => {
39812
39812
  bodyStyle: { padding: 0 },
39813
39813
  title: "Drag block",
39814
39814
  extra: /* @__PURE__ */ React__default.createElement("div", {
39815
- className: styles$6.closeBtn
39815
+ className: styles$7.closeBtn
39816
39816
  }, /* @__PURE__ */ React__default.createElement(IconFont, {
39817
39817
  iconName: "icon-close",
39818
39818
  onClick: toggleVisible
@@ -39848,7 +39848,7 @@ const BlockPanelItem = React__default.memo((props) => {
39848
39848
  alignment: "center",
39849
39849
  spacing: "extraTight"
39850
39850
  }, /* @__PURE__ */ React__default.createElement("div", {
39851
- className: styles$6.blockItem
39851
+ className: styles$7.blockItem
39852
39852
  }, block2.title), block2.description && /* @__PURE__ */ React__default.createElement(Help, {
39853
39853
  title: block2.description
39854
39854
  }))
@@ -40141,7 +40141,11 @@ function formatPadding(attributes, attributeName) {
40141
40141
  attributes[attributeName] = newPadding;
40142
40142
  }
40143
40143
  }
40144
- function SourceCodePanel({ mjmlReadOnly }) {
40144
+ const customTextArea = "_customTextArea_xcz5w_1";
40145
+ var styles$5 = {
40146
+ customTextArea
40147
+ };
40148
+ function SourceCodePanel({ jsonReadOnly, mjmlReadOnly }) {
40145
40149
  const { setValueByIdx, focusBlock, values } = useBlock();
40146
40150
  const { focusIdx } = useFocusIdx();
40147
40151
  const [mjmlText, setMjmlText] = useState("");
@@ -40206,7 +40210,9 @@ function SourceCodePanel({ mjmlReadOnly }) {
40206
40210
  key: code,
40207
40211
  defaultValue: code,
40208
40212
  autoSize: { maxRows: 25 },
40209
- onBlur: onChangeCode
40213
+ onBlur: onChangeCode,
40214
+ readOnly: jsonReadOnly,
40215
+ className: styles$5.customTextArea
40210
40216
  })), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
40211
40217
  name: "mjml",
40212
40218
  header: t("MJML source"),
@@ -40217,7 +40223,8 @@ function SourceCodePanel({ mjmlReadOnly }) {
40217
40223
  autoSize: { maxRows: 25 },
40218
40224
  onChange: onChangeMjmlText,
40219
40225
  onBlur: onMjmlChange,
40220
- readOnly: mjmlReadOnly
40226
+ readOnly: mjmlReadOnly,
40227
+ className: styles$5.customTextArea
40221
40228
  })));
40222
40229
  }
40223
40230
  function Toolbar() {
@@ -40957,7 +40964,7 @@ function MergeTagBadgePrompt() {
40957
40964
  }
40958
40965
  const SimpleLayout = (props) => {
40959
40966
  const { height: containerHeight } = useEditorProps();
40960
- const { showSourceCode = true, defaultShowLayer = true, mjmlReadOnly: mjmlReadOnly2 = true } = props;
40967
+ const { showSourceCode = true, defaultShowLayer = true, jsonReadOnly: jsonReadOnly2 = false, mjmlReadOnly: mjmlReadOnly2 = true } = props;
40961
40968
  const [collapsed, setCollapsed] = useState(!defaultShowLayer);
40962
40969
  return /* @__PURE__ */ React__default.createElement(ConfigProvider, {
40963
40970
  locale: enUS
@@ -41040,6 +41047,7 @@ const SimpleLayout = (props) => {
41040
41047
  style: { height: 31, lineHeight: "31px" }
41041
41048
  }, t("Source code"))
41042
41049
  }, /* @__PURE__ */ React__default.createElement(SourceCodePanel, {
41050
+ jsonReadOnly: jsonReadOnly2,
41043
41051
  mjmlReadOnly: mjmlReadOnly2
41044
41052
  }))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
41045
41053
  };
@@ -46099,6 +46107,7 @@ function ConfigurationPanel({
46099
46107
  height,
46100
46108
  onBack,
46101
46109
  compact,
46110
+ jsonReadOnly: jsonReadOnly2,
46102
46111
  mjmlReadOnly: mjmlReadOnly2
46103
46112
  }) {
46104
46113
  const [inited, setInited] = useState(false);
@@ -46145,6 +46154,7 @@ function ConfigurationPanel({
46145
46154
  }, /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, {
46146
46155
  height: `calc(${height} - 60px)`
46147
46156
  }, /* @__PURE__ */ React__default.createElement(SourceCodePanel, {
46157
+ jsonReadOnly: jsonReadOnly2,
46148
46158
  mjmlReadOnly: mjmlReadOnly2
46149
46159
  })))) : /* @__PURE__ */ React__default.createElement(AttributePanel, null));
46150
46160
  }
@@ -46152,6 +46162,7 @@ function ConfigurationDrawer({
46152
46162
  height,
46153
46163
  compact,
46154
46164
  showSourceCode,
46165
+ jsonReadOnly: jsonReadOnly2,
46155
46166
  mjmlReadOnly: mjmlReadOnly2
46156
46167
  }) {
46157
46168
  const refWrapper = useRef(null);
@@ -46188,6 +46199,7 @@ function ConfigurationDrawer({
46188
46199
  showSourceCode,
46189
46200
  height,
46190
46201
  onBack: onClose,
46202
+ jsonReadOnly: jsonReadOnly2,
46191
46203
  mjmlReadOnly: mjmlReadOnly2
46192
46204
  })));
46193
46205
  }, [visible, onClose, compact, showSourceCode, height]);
@@ -46195,6 +46207,7 @@ function ConfigurationDrawer({
46195
46207
  const TabPane = Tabs$1.TabPane;
46196
46208
  function EditPanel({
46197
46209
  showSourceCode,
46210
+ jsonReadOnly: jsonReadOnly2,
46198
46211
  mjmlReadOnly: mjmlReadOnly2
46199
46212
  }) {
46200
46213
  const { height } = useEditorProps();
@@ -46229,6 +46242,7 @@ function EditPanel({
46229
46242
  height,
46230
46243
  showSourceCode,
46231
46244
  compact: Boolean(compact),
46245
+ jsonReadOnly: jsonReadOnly2,
46232
46246
  mjmlReadOnly: mjmlReadOnly2
46233
46247
  }));
46234
46248
  }
@@ -46310,6 +46324,7 @@ const StandardLayout = (props) => {
46310
46324
  showSourceCode = true,
46311
46325
  compact = true,
46312
46326
  categories = defaultCategories,
46327
+ jsonReadOnly: jsonReadOnly2 = false,
46313
46328
  mjmlReadOnly: mjmlReadOnly2 = true
46314
46329
  } = props;
46315
46330
  const { setFocusIdx } = useFocusIdx();
@@ -46338,11 +46353,13 @@ const StandardLayout = (props) => {
46338
46353
  }
46339
46354
  }, compact && /* @__PURE__ */ React__default.createElement(EditPanel, {
46340
46355
  showSourceCode,
46356
+ jsonReadOnly: jsonReadOnly2,
46341
46357
  mjmlReadOnly: mjmlReadOnly2
46342
46358
  }), /* @__PURE__ */ React__default.createElement(Layout$1, {
46343
46359
  style: { height: containerHeight, flex: 1 }
46344
46360
  }, props.children), !compact && /* @__PURE__ */ React__default.createElement(EditPanel, {
46345
46361
  showSourceCode,
46362
+ jsonReadOnly: jsonReadOnly2,
46346
46363
  mjmlReadOnly: mjmlReadOnly2
46347
46364
  }), compact ? /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
46348
46365
  style: {
@@ -46355,6 +46372,7 @@ const StandardLayout = (props) => {
46355
46372
  compact,
46356
46373
  height: containerHeight,
46357
46374
  showSourceCode,
46375
+ jsonReadOnly: jsonReadOnly2,
46358
46376
  mjmlReadOnly: mjmlReadOnly2
46359
46377
  })) : /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
46360
46378
  style: { width: 0, overflow: "hidden" }