easy-email-extensions 3.2.1-alpha.0 → 3.2.1-alpha.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,3 @@
1
- export declare function FontFamily(): JSX.Element;
1
+ export declare function FontFamily({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function FontStyle(): JSX.Element;
1
+ export declare function FontStyle({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function FontWeight(): JSX.Element;
1
+ export declare function FontWeight({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function LetterSpacing(): JSX.Element;
1
+ export declare function LetterSpacing({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function LineHeight(): JSX.Element;
1
+ export declare function LineHeight({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1,5 +1,6 @@
1
1
  export interface PaddingProps {
2
2
  title?: string;
3
3
  attributeName?: 'padding' | 'inner-padding' | 'text-padding';
4
+ name?: string;
4
5
  }
5
6
  export declare function Padding(props?: PaddingProps): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function TextAlign(): JSX.Element;
1
+ export declare function TextAlign({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function TextDecoration(): JSX.Element;
1
+ export declare function TextDecoration({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -1 +1,3 @@
1
- export declare function TextTransform(): JSX.Element;
1
+ export declare function TextTransform({ name }: {
2
+ name?: string;
3
+ }): JSX.Element;
@@ -2,4 +2,5 @@ import React from 'react';
2
2
  import { BlockLayerProps } from '../BlockLayer';
3
3
  export declare const SimpleLayout: React.FC<{
4
4
  showSourceCode?: boolean;
5
+ defaultShowLayer?: boolean;
5
6
  } & BlockLayerProps>;
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, Fragment, createElement, Suspense } from "react";
58
58
  import { IconFont, useEditorProps, Stack as Stack$6, getShadowRoot, TextStyle, useEditorContext, useBlock, useFocusIdx, useFocusBlockLayout, getEditNode, MergeTagBadge as MergeTagBadge$1, FIXED_CONTAINER_ID, getPluginElement, isTextBlock, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, useRefState, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, getBlockNodeByIdx, useLazyState, getEditorRoot, useActiveTab, ActiveTabKeys } from "easy-email-editor";
59
- import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getValueByIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, MjmlToJson, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
59
+ import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, 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 = "";
@@ -39048,6 +39048,7 @@ function ColorPicker(props) {
39048
39048
  }
39049
39049
  function Select(props) {
39050
39050
  return /* @__PURE__ */ React__default.createElement(Select$2, __spreadProps(__spreadValues({}, props), {
39051
+ dropdownMenuClassName: "easy-email-overlay",
39051
39052
  style: lodash.exports.merge({ width: "100%" }, props.style),
39052
39053
  value: props.value,
39053
39054
  onChange: props.onChange
@@ -39346,6 +39347,7 @@ function EditTab(props) {
39346
39347
  props.onChange(value.filter((_, vIndex) => Number(index2) !== vIndex));
39347
39348
  };
39348
39349
  return /* @__PURE__ */ React__default.createElement(Tabs$1, {
39350
+ destroyOnHide: true,
39349
39351
  className: classnames(styles$3.editTab),
39350
39352
  style: { border: "none" },
39351
39353
  type: "card",
@@ -39832,7 +39834,7 @@ function EyeIcon() {
39832
39834
  onClick: onToggleVisible
39833
39835
  });
39834
39836
  }
39835
- function FontFamily() {
39837
+ function FontFamily({ name }) {
39836
39838
  const { focusIdx: focusIdx2 } = useFocusIdx();
39837
39839
  const { fontList: fontList2 } = useFontFamily();
39838
39840
  return useMemo(() => {
@@ -39840,10 +39842,10 @@ function FontFamily() {
39840
39842
  style: { minWidth: 100, flex: 1 },
39841
39843
  showSearch: true,
39842
39844
  label: "Font family",
39843
- name: `${focusIdx2}.attributes.font-family`,
39845
+ name: name || `${focusIdx2}.attributes.font-family`,
39844
39846
  options: fontList2
39845
39847
  });
39846
- }, [focusIdx2, fontList2]);
39848
+ }, [focusIdx2, fontList2, name]);
39847
39849
  }
39848
39850
  function Page() {
39849
39851
  const { focusIdx: focusIdx2 } = useFocusIdx();
@@ -39885,7 +39887,9 @@ function Page() {
39885
39887
  spacing: "tight"
39886
39888
  }, /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
39887
39889
  span: 11
39888
- }, /* @__PURE__ */ React__default.createElement(FontFamily, null)), /* @__PURE__ */ React__default.createElement(Grid.Col, {
39890
+ }, /* @__PURE__ */ React__default.createElement(FontFamily, {
39891
+ name: `${focusIdx2}.data.value.font-family`
39892
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
39889
39893
  offset: 1,
39890
39894
  span: 11
39891
39895
  }, /* @__PURE__ */ React__default.createElement(InputWithUnitField, {
@@ -39920,13 +39924,23 @@ function Page() {
39920
39924
  }), /* @__PURE__ */ React__default.createElement(AddFont, null))))));
39921
39925
  }
39922
39926
  function Padding(props = {}) {
39923
- const { title: title2 = "Padding", attributeName = "padding" } = props;
39924
- const { focusBlock: focusBlock2, change } = useBlock();
39927
+ const { title: title2 = "Padding", attributeName = "padding", name } = props;
39928
+ const { focusBlock: focusBlock2, change, values: values2 } = useBlock();
39925
39929
  const { focusIdx: focusIdx2 } = useFocusIdx();
39926
39930
  const type = focusBlock2 && focusBlock2.type;
39927
39931
  const defaultConfig = useMemo(() => type ? createBlockDataByType(type) : void 0, [type]);
39928
- const paddingValue = focusBlock2 == null ? void 0 : focusBlock2.attributes[attributeName];
39929
- const defaultPaddingValue = defaultConfig == null ? void 0 : defaultConfig.attributes[attributeName];
39932
+ const paddingValue = useMemo(() => {
39933
+ if (name) {
39934
+ return lodash.exports.get(values2, name);
39935
+ }
39936
+ return focusBlock2 == null ? void 0 : focusBlock2.attributes[attributeName];
39937
+ }, [attributeName, focusBlock2 == null ? void 0 : focusBlock2.attributes, name, values2]);
39938
+ const defaultPaddingValue = useMemo(() => {
39939
+ if (name) {
39940
+ return null;
39941
+ }
39942
+ return defaultConfig == null ? void 0 : defaultConfig.attributes[attributeName];
39943
+ }, [attributeName, defaultConfig == null ? void 0 : defaultConfig.attributes, name]);
39930
39944
  const paddingFormValues = useMemo(() => {
39931
39945
  const paddingList = paddingValue == null ? void 0 : paddingValue.split(" ");
39932
39946
  const defaultPaddingList = defaultPaddingValue == null ? void 0 : defaultPaddingValue.split(" ");
@@ -39942,8 +39956,12 @@ function Padding(props = {}) {
39942
39956
  };
39943
39957
  }, [defaultPaddingValue, paddingValue]);
39944
39958
  const onChancePadding = useCallback((val) => {
39945
- change(focusIdx2 + `.attributes[${attributeName}]`, val);
39946
- }, [focusIdx2, attributeName, change]);
39959
+ if (name) {
39960
+ change(name, val);
39961
+ } else {
39962
+ change(focusIdx2 + `.attributes[${attributeName}]`, val);
39963
+ }
39964
+ }, [name, change, focusIdx2, attributeName]);
39947
39965
  return /* @__PURE__ */ React__default.createElement(Form$3, {
39948
39966
  initialValues: paddingFormValues,
39949
39967
  subscription: { submitting: true, pristine: true },
@@ -40162,7 +40180,7 @@ function Condition() {
40162
40180
  groups: [
40163
40181
  {
40164
40182
  left: "",
40165
- operator: Operator.EQUAL,
40183
+ operator: Operator.TRUTHY,
40166
40184
  right: ""
40167
40185
  }
40168
40186
  ]
@@ -40180,7 +40198,7 @@ function Condition() {
40180
40198
  groups: [
40181
40199
  {
40182
40200
  left: "",
40183
- operator: Operator.EQUAL,
40201
+ operator: Operator.TRUTHY,
40184
40202
  right: ""
40185
40203
  }
40186
40204
  ]
@@ -40191,7 +40209,7 @@ function Condition() {
40191
40209
  const groups = lodash.exports.get(values2, path);
40192
40210
  groups.push({
40193
40211
  left: "",
40194
- operator: Operator.EQUAL,
40212
+ operator: Operator.TRUTHY,
40195
40213
  right: ""
40196
40214
  });
40197
40215
  change(path, [...groups]);
@@ -40298,12 +40316,14 @@ function Condition() {
40298
40316
  const options$b = Object.values(Operator).map((item2) => ({ label: lodash.exports.upperFirst(item2), value: item2 }));
40299
40317
  function ConditionItem({ path, onDelete, gIndex, ggIndex }) {
40300
40318
  const name = `${path}.${gIndex}.groups.${ggIndex}`;
40319
+ const { input: { value } } = useField(name);
40320
+ const hideRight = value.operator === Operator.TRUTHY || value.operator === Operator.FALSY;
40301
40321
  return /* @__PURE__ */ React__default.createElement(Grid.Row, {
40302
40322
  align: "end"
40303
40323
  }, /* @__PURE__ */ React__default.createElement(Grid.Col, {
40304
40324
  span: 7
40305
40325
  }, " ", /* @__PURE__ */ React__default.createElement(TextField, {
40306
- label: "Left",
40326
+ label: "Variable path",
40307
40327
  name: `${name}.left`
40308
40328
  })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
40309
40329
  span: 7
@@ -40313,7 +40333,7 @@ function ConditionItem({ path, onDelete, gIndex, ggIndex }) {
40313
40333
  options: options$b
40314
40334
  })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
40315
40335
  span: 7
40316
- }, " ", /* @__PURE__ */ React__default.createElement(TextField, {
40336
+ }, " ", !hideRight && /* @__PURE__ */ React__default.createElement(TextField, {
40317
40337
  label: "Right",
40318
40338
  name: `${name}.right`
40319
40339
  })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
@@ -40355,7 +40375,8 @@ const CollapseWrapper = (props) => {
40355
40375
  }, [conditionEnabled, isAdvancedBlockType]);
40356
40376
  return /* @__PURE__ */ React__default.createElement(Space$1, {
40357
40377
  size: "large",
40358
- direction: "vertical"
40378
+ direction: "vertical",
40379
+ style: { width: "100%" }
40359
40380
  }, /* @__PURE__ */ React__default.createElement(Collapse$1, {
40360
40381
  onChange,
40361
40382
  activeKey: activeKeys
@@ -40531,15 +40552,15 @@ const options$9 = [
40531
40552
  label: "Inherit"
40532
40553
  }
40533
40554
  ];
40534
- function TextDecoration() {
40555
+ function TextDecoration({ name }) {
40535
40556
  const { focusIdx: focusIdx2 } = useFocusIdx();
40536
40557
  return useMemo(() => {
40537
40558
  return /* @__PURE__ */ React__default.createElement(SelectField, {
40538
40559
  label: "Text decoration",
40539
- name: `${focusIdx2}.attributes.text-decoration`,
40560
+ name: name || `${focusIdx2}.attributes.text-decoration`,
40540
40561
  options: options$9
40541
40562
  });
40542
- }, [focusIdx2]);
40563
+ }, [focusIdx2, name]);
40543
40564
  }
40544
40565
  const options$8 = [
40545
40566
  {
@@ -40587,15 +40608,15 @@ const options$8 = [
40587
40608
  label: "900"
40588
40609
  }
40589
40610
  ];
40590
- function FontWeight() {
40611
+ function FontWeight({ name }) {
40591
40612
  const { focusIdx: focusIdx2 } = useFocusIdx();
40592
40613
  return useMemo(() => {
40593
40614
  return /* @__PURE__ */ React__default.createElement(SelectField, {
40594
40615
  label: "Font weight",
40595
- name: `${focusIdx2}.attributes.font-weight`,
40616
+ name: name || `${focusIdx2}.attributes.font-weight`,
40596
40617
  options: options$8
40597
40618
  });
40598
- }, [focusIdx2]);
40619
+ }, [focusIdx2, name]);
40599
40620
  }
40600
40621
  const options$7 = [
40601
40622
  {
@@ -40607,11 +40628,11 @@ const options$7 = [
40607
40628
  label: "Italic"
40608
40629
  }
40609
40630
  ];
40610
- function FontStyle() {
40631
+ function FontStyle({ name }) {
40611
40632
  const { focusIdx: focusIdx2 } = useFocusIdx();
40612
40633
  return /* @__PURE__ */ React__default.createElement(RadioGroupField, {
40613
40634
  label: "Font style",
40614
- name: `${focusIdx2}.attributes.font-style`,
40635
+ name: name || `${focusIdx2}.attributes.font-style`,
40615
40636
  options: options$7
40616
40637
  });
40617
40638
  }
@@ -40681,19 +40702,19 @@ function Align({ inline }) {
40681
40702
  options: options$6
40682
40703
  });
40683
40704
  }
40684
- function LineHeight() {
40705
+ function LineHeight({ name }) {
40685
40706
  const { focusIdx: focusIdx2 } = useFocusIdx();
40686
40707
  return /* @__PURE__ */ React__default.createElement(InputWithUnitField, {
40687
40708
  label: "Line height",
40688
40709
  unitOptions: "percent",
40689
- name: `${focusIdx2}.attributes.line-height`
40710
+ name: name || `${focusIdx2}.attributes.line-height`
40690
40711
  });
40691
40712
  }
40692
- function LetterSpacing() {
40713
+ function LetterSpacing({ name }) {
40693
40714
  const { focusIdx: focusIdx2 } = useFocusIdx();
40694
40715
  return /* @__PURE__ */ React__default.createElement(InputWithUnitField, {
40695
40716
  label: "Letter spacing",
40696
- name: `${focusIdx2}.attributes.letter-spacing`
40717
+ name: name || `${focusIdx2}.attributes.letter-spacing`
40697
40718
  });
40698
40719
  }
40699
40720
  const ShadowDom = (props) => {
@@ -40992,15 +41013,15 @@ const options$5 = [
40992
41013
  label: "Right"
40993
41014
  }
40994
41015
  ];
40995
- function TextAlign() {
41016
+ function TextAlign({ name }) {
40996
41017
  const { focusIdx: focusIdx2 } = useFocusIdx();
40997
41018
  return useMemo(() => {
40998
41019
  return /* @__PURE__ */ React__default.createElement(Stack$6, null, /* @__PURE__ */ React__default.createElement(RadioGroupField, {
40999
41020
  label: "Text align",
41000
- name: `${focusIdx2}.attributes.text-align`,
41021
+ name: name || `${focusIdx2}.attributes.text-align`,
41001
41022
  options: options$5
41002
41023
  }));
41003
- }, [focusIdx2]);
41024
+ }, [focusIdx2, name]);
41004
41025
  }
41005
41026
  function Decoration() {
41006
41027
  const { focusIdx: focusIdx2 } = useFocusIdx();
@@ -41034,7 +41055,7 @@ function Decoration() {
41034
41055
  }
41035
41056
  const options$4 = [
41036
41057
  {
41037
- value: "",
41058
+ value: "initial",
41038
41059
  label: "none"
41039
41060
  },
41040
41061
  {
@@ -41050,15 +41071,15 @@ const options$4 = [
41050
41071
  label: "capitalize"
41051
41072
  }
41052
41073
  ];
41053
- function TextTransform() {
41074
+ function TextTransform({ name }) {
41054
41075
  const { focusIdx: focusIdx2 } = useFocusIdx();
41055
41076
  return useMemo(() => {
41056
41077
  return /* @__PURE__ */ React__default.createElement(SelectField, {
41057
41078
  label: "Text transform",
41058
- name: `${focusIdx2}.attributes.text-transform`,
41079
+ name: name || `${focusIdx2}.attributes.text-transform`,
41059
41080
  options: options$4
41060
41081
  });
41061
- }, [focusIdx2]);
41082
+ }, [focusIdx2, name]);
41062
41083
  }
41063
41084
  const options$3 = [
41064
41085
  {
@@ -41288,72 +41309,14 @@ function BorderStyle() {
41288
41309
  }, [focusIdx2]);
41289
41310
  }
41290
41311
  function NavbarLinkPadding({ name }) {
41291
- const { values: values2 } = useBlock();
41292
- const getVal = useCallback((index2) => {
41293
- return () => {
41294
- var _a;
41295
- return ((_a = lodash.exports.get(values2, name)) == null ? void 0 : _a.split(" ")[index2]) || "";
41296
- };
41297
- }, [name, values2]);
41298
- const setVal = useCallback((index2) => {
41299
- return (newVal) => {
41300
- if (newVal === "") {
41301
- newVal = "0px";
41302
- }
41303
- const vals = [
41304
- getVal(0)(),
41305
- getVal(1)(),
41306
- getVal(2)(),
41307
- getVal(3)()
41308
- ];
41309
- vals[index2] = newVal;
41310
- return vals.join(" ");
41311
- };
41312
- }, [getVal]);
41313
41312
  return useMemo(() => {
41314
41313
  return /* @__PURE__ */ React__default.createElement(Stack$6, {
41315
41314
  vertical: true,
41316
41315
  spacing: "extraTight"
41317
- }, /* @__PURE__ */ React__default.createElement(TextStyle, {
41318
- variation: "strong"
41319
- }, "Padding"), /* @__PURE__ */ React__default.createElement(Stack$6, {
41320
- wrap: false
41321
- }, /* @__PURE__ */ React__default.createElement(Stack$6.Item, {
41322
- fill: true
41323
- }, /* @__PURE__ */ React__default.createElement(TextField, {
41324
- label: /* @__PURE__ */ React__default.createElement("span", null, "Top"),
41325
- quickchange: true,
41326
- name,
41327
- valueAdapter: getVal(0),
41328
- onChangeAdapter: setVal(0)
41329
- })), /* @__PURE__ */ React__default.createElement(Stack$6.Item, {
41330
- fill: true
41331
- }, /* @__PURE__ */ React__default.createElement(TextField, {
41332
- label: "Bottom",
41333
- quickchange: true,
41334
- name,
41335
- valueAdapter: getVal(2),
41336
- onChangeAdapter: setVal(2)
41337
- }))), /* @__PURE__ */ React__default.createElement(Stack$6, {
41338
- wrap: false
41339
- }, /* @__PURE__ */ React__default.createElement(Stack$6.Item, {
41340
- fill: true
41341
- }, /* @__PURE__ */ React__default.createElement(TextField, {
41342
- label: /* @__PURE__ */ React__default.createElement("span", null, "Left"),
41343
- quickchange: true,
41344
- name,
41345
- valueAdapter: getVal(3),
41346
- onChangeAdapter: setVal(3)
41347
- })), /* @__PURE__ */ React__default.createElement(Stack$6.Item, {
41348
- fill: true
41349
- }, /* @__PURE__ */ React__default.createElement(TextField, {
41350
- label: /* @__PURE__ */ React__default.createElement("span", null, "Right\xA0"),
41351
- quickchange: true,
41352
- name,
41353
- valueAdapter: getVal(1),
41354
- onChangeAdapter: setVal(1)
41355
- }))));
41356
- }, [getVal, name, setVal]);
41316
+ }, /* @__PURE__ */ React__default.createElement(Padding, {
41317
+ name
41318
+ }));
41319
+ }, [name]);
41357
41320
  }
41358
41321
  function BorderWidth() {
41359
41322
  const { focusIdx: focusIdx2 } = useFocusIdx();
@@ -42010,6 +41973,9 @@ function Navbar() {
42010
41973
  contentStyle: { padding: 0 },
42011
41974
  name: "1",
42012
41975
  header: "Navbar links"
41976
+ }, /* @__PURE__ */ React__default.createElement(Space$1, {
41977
+ direction: "vertical",
41978
+ style: { width: "100%" }
42013
41979
  }, /* @__PURE__ */ React__default.createElement(EditTabField, {
42014
41980
  tabPosition: "top",
42015
41981
  name: `${focusIdx2}.data.value.links`,
@@ -42026,7 +41992,7 @@ function Navbar() {
42026
41992
  color: "#1890ff",
42027
41993
  "font-size": "13px"
42028
41994
  }
42029
- })), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
41995
+ }), /* @__PURE__ */ React__default.createElement("div", null))), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
42030
41996
  name: "4",
42031
41997
  header: "Extra"
42032
41998
  }, /* @__PURE__ */ React__default.createElement(Grid.Col, {
@@ -42038,16 +42004,16 @@ function NavbarLink({
42038
42004
  index: index2
42039
42005
  }) {
42040
42006
  const { focusIdx: focusIdx2 } = useFocusIdx();
42041
- return /* @__PURE__ */ React__default.createElement(Space$1, {
42042
- direction: "vertical"
42007
+ return /* @__PURE__ */ React__default.createElement("div", {
42008
+ className: "NavbarLink"
42009
+ }, /* @__PURE__ */ React__default.createElement(Space$1, {
42010
+ direction: "vertical",
42011
+ style: { width: "100%" }
42012
+ }, /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42013
+ span: 11
42043
42014
  }, /* @__PURE__ */ React__default.createElement(TextField, {
42044
42015
  label: "Content",
42045
42016
  name: `${focusIdx2}.data.value.links.[${index2}].content`
42046
- }), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42047
- span: 11
42048
- }, /* @__PURE__ */ React__default.createElement(TextField, {
42049
- label: "Font size",
42050
- name: `${focusIdx2}.data.value.links.[${index2}].font-size`
42051
42017
  })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
42052
42018
  offset: 1,
42053
42019
  span: 11
@@ -42057,6 +42023,44 @@ function NavbarLink({
42057
42023
  alignment: "center"
42058
42024
  }))), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42059
42025
  span: 11
42026
+ }, /* @__PURE__ */ React__default.createElement(FontFamily, {
42027
+ name: `${focusIdx2}.data.value.links.[${index2}].font-family`
42028
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
42029
+ offset: 1,
42030
+ span: 11
42031
+ }, /* @__PURE__ */ React__default.createElement(TextField, {
42032
+ label: "Font size",
42033
+ quickchange: true,
42034
+ name: `${focusIdx2}.data.value.links.[${index2}].font-size`
42035
+ }))), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42036
+ span: 11
42037
+ }, /* @__PURE__ */ React__default.createElement(LineHeight, {
42038
+ name: `${focusIdx2}.data.value.links.[${index2}].line-height`
42039
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
42040
+ offset: 1,
42041
+ span: 11
42042
+ }, /* @__PURE__ */ React__default.createElement(LetterSpacing, {
42043
+ name: `${focusIdx2}.data.value.links.[${index2}].letter-spacing`
42044
+ }))), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42045
+ span: 11
42046
+ }, /* @__PURE__ */ React__default.createElement(TextDecoration, {
42047
+ name: `${focusIdx2}.data.value.links.[${index2}].text-decoration`
42048
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
42049
+ offset: 1,
42050
+ span: 11
42051
+ }, /* @__PURE__ */ React__default.createElement(FontWeight, {
42052
+ name: `${focusIdx2}.data.value.links.[${index2}].font-weight`
42053
+ }))), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42054
+ span: 11
42055
+ }, /* @__PURE__ */ React__default.createElement(TextTransform, {
42056
+ name: `${focusIdx2}.data.value.links.[${index2}].text-transform`
42057
+ })), /* @__PURE__ */ React__default.createElement(Grid.Col, {
42058
+ offset: 1,
42059
+ span: 11
42060
+ })), /* @__PURE__ */ React__default.createElement(FontStyle, {
42061
+ name: `${focusIdx2}.data.value.links.[${index2}].font-style`
42062
+ }), /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, {
42063
+ span: 11
42060
42064
  }, /* @__PURE__ */ React__default.createElement(TextField, {
42061
42065
  prefix: /* @__PURE__ */ React__default.createElement(IconLink$1, null),
42062
42066
  label: /* @__PURE__ */ React__default.createElement("span", null, "Url"),
@@ -42081,7 +42085,7 @@ function NavbarLink({
42081
42085
  }))), /* @__PURE__ */ React__default.createElement(NavbarLinkPadding, {
42082
42086
  key: index2,
42083
42087
  name: `${focusIdx2}.data.value.links.[${index2}].padding`
42084
- }));
42088
+ }), /* @__PURE__ */ React__default.createElement("div", null)));
42085
42089
  }
42086
42090
  const options = [
42087
42091
  {
@@ -42349,10 +42353,9 @@ function AttributePanel() {
42349
42353
  const { values: values2, focusBlock: focusBlock2 } = useBlock();
42350
42354
  const { initialized } = useEditorContext();
42351
42355
  const { focusIdx: focusIdx2 } = useFocusIdx();
42352
- const value = getValueByIdx(values2, focusIdx2);
42353
42356
  const Com = focusBlock2 && BlockAttributeConfigurationManager.get(focusBlock2.type);
42354
42357
  const shadowRoot = getShadowRoot();
42355
- if (!value || !initialized)
42358
+ if (!initialized)
42356
42359
  return null;
42357
42360
  return /* @__PURE__ */ React__default.createElement(SelectionRangeProvider, null, /* @__PURE__ */ React__default.createElement(PresetColorsProvider, null, Com ? /* @__PURE__ */ React__default.createElement(Com, {
42358
42361
  key: focusIdx2
@@ -42798,7 +42801,7 @@ function FontSize(props) {
42798
42801
  }));
42799
42802
  }
42800
42803
  function Tools(props) {
42801
- const { mergeTags: mergeTags2 } = useEditorProps();
42804
+ const { mergeTags: mergeTags2, enabledMergeTagsBadge } = useEditorProps();
42802
42805
  const { focusBlockNode } = useFocusBlockLayout();
42803
42806
  const { selectionRange, restoreRange, setRangeByElement } = useSelectionRange();
42804
42807
  const execCommand = (cmd, val) => {
@@ -42834,7 +42837,10 @@ function Tools(props) {
42834
42837
  link.style.textDecoration = linkData.underline ? "underline" : "none";
42835
42838
  link.setAttribute("href", linkData.link);
42836
42839
  } else if (cmd === "insertHTML") {
42837
- const newContent = MergeTagBadge$1.transform(val, uuid2);
42840
+ let newContent = val;
42841
+ if (enabledMergeTagsBadge) {
42842
+ newContent = MergeTagBadge$1.transform(val, uuid2);
42843
+ }
42838
42844
  document.execCommand(cmd, false, newContent);
42839
42845
  const insertMergeTagEle = getShadowRoot().getElementById(uuid2);
42840
42846
  if (insertMergeTagEle) {
@@ -46305,7 +46311,7 @@ function TipNode(props) {
46305
46311
  style: {
46306
46312
  position: "absolute",
46307
46313
  left: 0,
46308
- bottom: 0
46314
+ top: 0
46309
46315
  }
46310
46316
  }, /* @__PURE__ */ React__default.createElement("div", {
46311
46317
  style: {
@@ -46318,7 +46324,7 @@ function TipNode(props) {
46318
46324
  boxSizing: "border-box",
46319
46325
  whiteSpace: "nowrap",
46320
46326
  fontFamily: "sans-serif",
46321
- transform: "translateY(100%)"
46327
+ transform: "translateY(-100%)"
46322
46328
  }
46323
46329
  }, title2))), props.isDragging && /* @__PURE__ */ React__default.createElement("div", {
46324
46330
  style: __spreadValues({
@@ -46419,13 +46425,13 @@ function InteractivePrompt() {
46419
46425
  return null;
46420
46426
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(HoverTooltip, null), /* @__PURE__ */ React__default.createElement(FocusTooltip, null));
46421
46427
  }
46422
- const SimpleLayout$1 = "_SimpleLayout_2xr2p_1";
46423
- const rightSide = "_rightSide_2xr2p_5";
46424
- const customScrollBar = "_customScrollBar_2xr2p_9";
46428
+ const SimpleLayout$1 = "_SimpleLayout_1olgv_1";
46429
+ const customScrollBar = "_customScrollBar_1olgv_8";
46430
+ const customScrollBarV2 = "_customScrollBarV2_1olgv_24";
46425
46431
  var styles = {
46426
46432
  SimpleLayout: SimpleLayout$1,
46427
- rightSide,
46428
- customScrollBar
46433
+ customScrollBar,
46434
+ customScrollBarV2
46429
46435
  };
46430
46436
  var Calendar = {
46431
46437
  formatYear: "YYYY",
@@ -46617,6 +46623,15 @@ function MergeTagBadge() {
46617
46623
  window.removeEventListener("click", onBlur3);
46618
46624
  };
46619
46625
  }, [targetRef, popoverRef]);
46626
+ const onClose = useCallback(() => {
46627
+ let ele = targetRef.current;
46628
+ setTimeout(() => {
46629
+ if (!ele)
46630
+ return;
46631
+ focusMergeTag(ele);
46632
+ }, 100);
46633
+ setTarget(null);
46634
+ }, [focusMergeTag, targetRef]);
46620
46635
  useEffect(() => {
46621
46636
  if (!root2)
46622
46637
  return;
@@ -46627,6 +46642,10 @@ function MergeTagBadge() {
46627
46642
  if (target22 instanceof HTMLInputElement && target22.classList.contains("easy-email-merge-tag")) {
46628
46643
  target22.classList.add("easy-email-merge-tag-focus");
46629
46644
  const namePath = target22.value;
46645
+ if (!onChangeMergeTag) {
46646
+ focusMergeTag(target22);
46647
+ return;
46648
+ }
46630
46649
  setText(lodash.exports.get(mergeTags2, namePath, ""));
46631
46650
  setTarget(target22);
46632
46651
  } else {
@@ -46639,16 +46658,7 @@ function MergeTagBadge() {
46639
46658
  return () => {
46640
46659
  root2.removeEventListener("click", onClick2);
46641
46660
  };
46642
- }, [focusMergeTag, mergeTags2, root2]);
46643
- const onClose = useCallback(() => {
46644
- let ele = targetRef.current;
46645
- setTimeout(() => {
46646
- if (!ele)
46647
- return;
46648
- focusMergeTag(ele);
46649
- }, 100);
46650
- setTarget(null);
46651
- }, [focusMergeTag, targetRef]);
46661
+ }, [focusMergeTag, mergeTags2, onChangeMergeTag, root2]);
46652
46662
  const onChange = useCallback((ev) => {
46653
46663
  setText(ev.target.value);
46654
46664
  }, []);
@@ -46704,8 +46714,8 @@ function MergeTagBadge() {
46704
46714
  }
46705
46715
  const SimpleLayout = (props) => {
46706
46716
  const { height: containerHeight } = useEditorProps();
46707
- const { showSourceCode = true } = props;
46708
- const [collapsed, setCollapsed] = useState(false);
46717
+ const { showSourceCode = true, defaultShowLayer = true } = props;
46718
+ const [collapsed, setCollapsed] = useState(!defaultShowLayer);
46709
46719
  return /* @__PURE__ */ React__default.createElement(ConfigProvider, {
46710
46720
  locale: enUS
46711
46721
  }, /* @__PURE__ */ React__default.createElement(Layout$1, {
@@ -46772,13 +46782,19 @@ const SimpleLayout = (props) => {
46772
46782
  borderLeft: "none"
46773
46783
  },
46774
46784
  bodyStyle: { padding: 0 },
46775
- className: styles.customScrollBar
46776
- }, /* @__PURE__ */ React__default.createElement(Tabs$1, null, /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
46777
- key: "Configuration",
46778
- title: "Configuration"
46785
+ className: styles.customScrollBarV2
46786
+ }, /* @__PURE__ */ React__default.createElement(Tabs$1, {
46787
+ className: styles.layoutTabs
46788
+ }, /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
46789
+ title: /* @__PURE__ */ React__default.createElement("div", {
46790
+ style: { height: 31, lineHeight: "31px" }
46791
+ }, "Configuration")
46779
46792
  }, /* @__PURE__ */ React__default.createElement(AttributePanel, null)), showSourceCode && /* @__PURE__ */ React__default.createElement(Tabs$1.TabPane, {
46793
+ destroyOnHide: true,
46780
46794
  key: "Source code",
46781
- title: "Source code"
46795
+ title: /* @__PURE__ */ React__default.createElement("div", {
46796
+ style: { height: 31, lineHeight: "31px" }
46797
+ }, "Source code")
46782
46798
  }, /* @__PURE__ */ React__default.createElement(SourceCodePanel, null))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadge, null)));
46783
46799
  };
46784
46800
  export { AutoCompleteField as $, AttributePanel as A, BlockLayer as B, Color as C, Decoration as D, SimpleLayout as E, FontFamily as F, TextField as G, Height as H, InteractivePrompt as I, InputWithUnitField as J, SearchField as K, LetterSpacing as L, Margin as M, NavbarLinkPadding as N, TextAreaField as O, Padding as P, NumberField as Q, SliderField as R, ShortcutToolbar as S, TextAlign as T, ColorPickerField as U, VerticalAlign as V, Width as W, UploadField as X, ImageUploaderField as Y, SelectField as Z, TreeSelectField as _, getIconNameByBlockType as a, RadioGroupField as a0, SwitchField as a1, DatePickerField as a2, CheckboxField as a3, EditTabField as a4, InlineTextField as a5, enhancer as a6, RichTextField as a7, getBlockTitle as b, commonjsGlobal as c, BlockAttributeConfigurationManager as d, Align as e, AttributesPanelWrapper as f, getContextMergeTags as g, ContainerBackgroundColor as h, TextDecoration as i, Background as j, LineHeight as k, TextTransform as l, BackgroundColor as m, Direction as n, Link as o, Border as p, BorderColor as q, FontSize$1 as r, MergeTags$1 as s, BorderStyle as t, FontStyle as u, BorderWidth as v, FontWeight as w, BlockMarketManager as x, BlockMaskWrapper as y, SourceCodePanel as z };