easy-email-pro-theme 1.3.1 → 1.4.1

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/index.js CHANGED
@@ -422,7 +422,7 @@ const styleText$c = `@font-face {
422
422
  }
423
423
 
424
424
  `;
425
- const RetroStyleText = '[data-slate-block="page"] {\r\n min-height: 300px;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-focus="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-selected="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] .element-tools-container {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-void-child="true"]:hover {\r\n outline: 2px solid var(--hover-color);\r\n}\r\n\r\n\r\n.text-mergetag {\r\n outline: 1px solid rgb(78, 89, 105);\r\n outline-offset: 1px;\r\n padding: 0 2px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n transition: all 0.1s linear;\r\n border: none;\r\n font-weight: inherit;\r\n outline-color: #00a0ac;\r\n color: inherit;\r\n background-color: #ebf9fc;\r\n max-width: 10em;\r\n font-style: inherit;\r\n text-decoration-line: inherit;\r\n position: relative;\r\n}\r\n\r\n\r\nbody .element-tools-container {\n outline: 2px solid var(--hover-color);\n z-index: 1;\n}\r\n\r\n\r\nbody .element-tools-container .element-tools {\n color: #fff;\n background-color: var(--hover-color);\n}\r\n\r\n\r\nbody .element-tools-container .element-drag-button {\n background-color: var(--hover-color);\n}\r\n\r\n\r\n[data-slate-dragover=true] {\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 10;\n left: 0;\n height: 4px;\n opacity: 1;\n}\r\n\r\n\r\n[data-slate-dragging=true] .element-tools-container {\n opacity: 0;\n}\r\n\r\n\r\n[data-slate-dragover-direction=top][data-slate-dragover=true]::after {\n top: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=bottom][data-slate-dragover=true]::after {\n top: auto;\n bottom: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true] {\n outline: 2px dashed var(--drag-color);\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 1;\n left: 0;\n height: 100%;\n width: 100%;\n filter: opacity(10%);\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true] [data-slate-type=placeholder] {\n outline: none;\n}\r\n\r\n\r\n[data-slate-type=placeholder] {\n min-height: 64px;\n position: relative;\n background-color: rgba(242, 244, 245, 0.64);\n outline: rgb(43, 152, 211) dashed 1px;\n outline-offset: -1px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: rgb(48, 59, 67);\n margin: 0 20px;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete {\n border-radius: 2px;\n padding: 0px;\n cursor: pointer;\n height: 28px;\n width: 28px;\n background-color: rgb(223, 227, 230);\n color: rgb(96, 106, 114);\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n left: 10px;\n top: 10px;\n opacity: 0.8;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete:hover {\n background-color: rgb(180, 187, 195);\n opacity: 1;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete svg {\n width: 20px;\n height: 20px;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] {\n z-index: 2;\n}\r\n\r\n\r\n.universal-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-mask {\n display: none;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask {\n z-index: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n inset: 0px;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask::before {\n content: " ";\n width: 10000px;\n height: 10000px;\n position: fixed;\n left: 0;\n top: 0;\n transform: translate(-50%, -50%);\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask::after {\n position: absolute;\n content: " ";\n width: 100%;\n height: 100%;\n inset: 0px;\n pointer-events: none;\n outline: 9999px solid rgba(255, 255, 255, 0.6);\n}';
425
+ const RetroStyleText = '[data-slate-block="page"] {\r\n min-height: 300px;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-focus="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-selected="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] .element-tools-container {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-void="true"] [data-slate-node="element"][data-slate-block="button"]:hover,\r\n[data-slate-void="true"] [data-slate-node="element"][data-slate-block="text"]:hover {\r\n outline: 2px solid var(--hover-color);\r\n}\r\n\r\n\r\n.text-mergetag {\r\n outline: 1px solid rgb(78, 89, 105);\r\n outline-offset: 1px;\r\n padding: 0 2px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n transition: all 0.1s linear;\r\n border: none;\r\n font-weight: inherit;\r\n outline-color: #00a0ac;\r\n color: inherit;\r\n background-color: #ebf9fc;\r\n max-width: 10em;\r\n font-style: inherit;\r\n text-decoration-line: inherit;\r\n position: relative;\r\n}\r\n\r\n\r\nbody .element-tools-container {\n outline: 2px solid var(--hover-color);\n z-index: 1;\n}\r\n\r\n\r\nbody .element-tools-container .element-tools {\n color: #fff;\n background-color: var(--hover-color);\n}\r\n\r\n\r\nbody .element-tools-container .element-drag-button {\n background-color: var(--hover-color);\n}\r\n\r\n\r\n[data-slate-dragover=true] {\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 10;\n left: 0;\n height: 4px;\n opacity: 1;\n}\r\n\r\n\r\n[data-slate-dragging=true] .element-tools-container {\n opacity: 0;\n}\r\n\r\n\r\n[data-slate-dragover-direction=top][data-slate-dragover=true]::after {\n top: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=bottom][data-slate-dragover=true]::after {\n top: auto;\n bottom: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true] {\n outline: 2px dashed var(--drag-color);\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 1;\n left: 0;\n height: 100%;\n width: 100%;\n filter: opacity(10%);\n}\r\n\r\n\r\n[data-slate-dragover-direction=middle][data-slate-dragover=true] [data-slate-type=placeholder] {\n outline: none;\n}\r\n\r\n\r\n[data-slate-type=placeholder] {\n min-height: 64px;\n position: relative;\n background-color: rgba(242, 244, 245, 0.64);\n outline: rgb(43, 152, 211) dashed 1px;\n outline-offset: -1px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: rgb(48, 59, 67);\n margin: 0 20px;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete {\n border-radius: 2px;\n padding: 0px;\n cursor: pointer;\n height: 28px;\n width: 28px;\n background-color: rgb(223, 227, 230);\n color: rgb(96, 106, 114);\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n left: 10px;\n top: 10px;\n opacity: 0.8;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete:hover {\n background-color: rgb(180, 187, 195);\n opacity: 1;\n}\r\n\r\n\r\n[data-slate-type=placeholder] .element-delete svg {\n width: 20px;\n height: 20px;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] {\n z-index: 2;\n}\r\n\r\n\r\n.universal-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-mask {\n display: none;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask {\n z-index: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n inset: 0px;\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask::before {\n content: " ";\n width: 10000px;\n height: 10000px;\n position: fixed;\n left: 0;\n top: 0;\n transform: translate(-50%, -50%);\n}\r\n\r\n\r\n[data-slate-universal-editing=true] .universal-element-editing-mask::after {\n position: absolute;\n content: " ";\n width: 100%;\n height: 100%;\n inset: 0px;\n pointer-events: none;\n outline: 9999px solid rgba(255, 255, 255, 0.6);\n}';
426
426
  const withTheme$1 = (editor) => {
427
427
  const { insertBreak, normalizeNode, deleteBackward } = editor;
428
428
  editor.insertBreak = (...args) => {
@@ -576,12 +576,6 @@ const DraggingProvider = ({
576
576
  return false;
577
577
  if (NodeUtils.isPageElement(node2))
578
578
  return false;
579
- if (NodeUtils.isParentCategoryType(
580
- propsData.element.type,
581
- node2.type
582
- ) && !NodeUtils.isVoidBlockElement(node2)) {
583
- return true;
584
- }
585
579
  const parentPath = Path.parent(path2);
586
580
  const parentElement = Node$1.get(editor, parentPath);
587
581
  if (Editor.isEditor(node2))
@@ -599,6 +593,12 @@ const DraggingProvider = ({
599
593
  if (voidElementParent) {
600
594
  return false;
601
595
  }
596
+ if (NodeUtils.isParentCategoryType(
597
+ propsData.element.type,
598
+ node2.type
599
+ ) && !NodeUtils.isVoidBlockElement(node2)) {
600
+ return true;
601
+ }
602
602
  if (NodeUtils.isParentCategoryType(
603
603
  propsData.element.type,
604
604
  parentElement.type
@@ -2096,7 +2096,7 @@ const DefaultBlockList = () => {
2096
2096
  return /* @__PURE__ */ React__default.createElement(
2097
2097
  "div",
2098
2098
  {
2099
- "data-compact": Boolean(editorProps.compact),
2099
+ "data-compact": Boolean(editorProps.compact || editorProps.widgetMode),
2100
2100
  className: "BlockSideBar-BlockList",
2101
2101
  id: "BlockSideBar-BlockList"
2102
2102
  },
@@ -2262,6 +2262,7 @@ const SlateField$2 = (props) => {
2262
2262
  const editor = useSlate();
2263
2263
  const { form } = Form.useFormContext();
2264
2264
  const formItemFieldValue = form.getFieldValue(fieldName);
2265
+ const initedRef = useRef(false);
2265
2266
  let source = null;
2266
2267
  try {
2267
2268
  source = Node$1.get(editor, props.path);
@@ -2288,9 +2289,12 @@ const SlateField$2 = (props) => {
2288
2289
  [onChangeHandle]
2289
2290
  );
2290
2291
  useEffect(() => {
2292
+ if (initedRef.current)
2293
+ return;
2291
2294
  if (!isEqual$3(fallbackValue, formItemFieldValue)) {
2292
2295
  form.setFieldValue(fieldName, fallbackValue);
2293
2296
  }
2297
+ initedRef.current = true;
2294
2298
  }, [fallbackValue, fieldName, form, formItemFieldValue]);
2295
2299
  return /* @__PURE__ */ React__default.createElement(
2296
2300
  Form.Item,
@@ -4046,7 +4050,7 @@ const pixelNumberAdapter = {
4046
4050
  normalize(val2) {
4047
4051
  if (!isNumber$1(val2))
4048
4052
  return void 0;
4049
- if (/^\d+$/.test(val2))
4053
+ if (/^\d+$/.test(String(val2)))
4050
4054
  return val2 + "px";
4051
4055
  if (!val2)
4052
4056
  return void 0;
@@ -14070,7 +14074,7 @@ const cardItemLeft = "_cardItemLeft_8uw8m_71";
14070
14074
  const cardItemRight = "_cardItemRight_8uw8m_85";
14071
14075
  const selectImage = "_selectImage_8uw8m_93";
14072
14076
  const exportFreeImage = "_exportFreeImage_8uw8m_110";
14073
- const styles$2 = {
14077
+ const styles$3 = {
14074
14078
  container,
14075
14079
  error,
14076
14080
  item: item$1,
@@ -16418,7 +16422,7 @@ function ImageUploader(props) {
16418
16422
  );
16419
16423
  const content = useMemo$1(() => {
16420
16424
  if (isUploading) {
16421
- return /* @__PURE__ */ React__default.createElement("div", { className: styles$2["item"] }, /* @__PURE__ */ React__default.createElement("div", { className: classnames$1(styles$2["info"]) }, /* @__PURE__ */ React__default.createElement(Spin, { size: 60 }), /* @__PURE__ */ React__default.createElement("div", { className: styles$2["btn-wrap"] })));
16425
+ return /* @__PURE__ */ React__default.createElement("div", { className: styles$3["item"] }, /* @__PURE__ */ React__default.createElement("div", { className: classnames$1(styles$3["info"]) }, /* @__PURE__ */ React__default.createElement(Spin, { size: 60 }), /* @__PURE__ */ React__default.createElement("div", { className: styles$3["btn-wrap"] })));
16422
16426
  }
16423
16427
  if (!props.value) {
16424
16428
  return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(
@@ -16439,10 +16443,10 @@ function ImageUploader(props) {
16439
16443
  lineHeight: "22px"
16440
16444
  }
16441
16445
  },
16442
- unsplashClientId ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: styles$2.selectImage, onClick: onUpload }, t("Select image")), /* @__PURE__ */ React__default.createElement(
16446
+ unsplashClientId ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: styles$3.selectImage, onClick: onUpload }, t("Select image")), /* @__PURE__ */ React__default.createElement(
16443
16447
  "div",
16444
16448
  {
16445
- className: styles$2.exportFreeImage,
16449
+ className: styles$3.exportFreeImage,
16446
16450
  onClick: () => setUnsplashVisible(true)
16447
16451
  },
16448
16452
  t("Export free images")
@@ -16476,7 +16480,7 @@ function ImageUploader(props) {
16476
16480
  triggerProps: {
16477
16481
  popupStyle: { display: "inline-flex" }
16478
16482
  },
16479
- triggerElement: /* @__PURE__ */ React__default.createElement("span", { className: styles$2.actionItem }, t("Replace"))
16483
+ triggerElement: /* @__PURE__ */ React__default.createElement("span", { className: styles$3.actionItem }, t("Replace"))
16480
16484
  },
16481
16485
  /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "1", onClick: onUpload }, t("Select image")),
16482
16486
  /* @__PURE__ */ React__default.createElement(
@@ -16487,10 +16491,10 @@ function ImageUploader(props) {
16487
16491
  },
16488
16492
  t("Export free images")
16489
16493
  )
16490
- ) : /* @__PURE__ */ React__default.createElement("span", { className: styles$2.actionItem, onClick: onUpload }, t("Replace")), /* @__PURE__ */ React__default.createElement("span", null, " ∙ "), /* @__PURE__ */ React__default.createElement(
16494
+ ) : /* @__PURE__ */ React__default.createElement("span", { className: styles$3.actionItem, onClick: onUpload }, t("Replace")), /* @__PURE__ */ React__default.createElement("span", null, " ∙ "), /* @__PURE__ */ React__default.createElement(
16491
16495
  "span",
16492
16496
  {
16493
- className: styles$2.actionItem,
16497
+ className: styles$3.actionItem,
16494
16498
  onClick: () => setPreview(true)
16495
16499
  },
16496
16500
  t("Preview")
@@ -16610,7 +16614,7 @@ const SwitchField = (props) => {
16610
16614
  DefaultSwitchField,
16611
16615
  __spreadProps(__spreadValues({}, props), {
16612
16616
  formItem,
16613
- style: { position: "relative", top: -6 }
16617
+ style: __spreadValues({ position: "relative", top: -6 }, props.style)
16614
16618
  })
16615
16619
  );
16616
16620
  };
@@ -16779,6 +16783,40 @@ const RichtextBar = (props) => {
16779
16783
  const editor = useMemo$1(() => createEditor(), []);
16780
16784
  const lastTemplateRef = useRef(null);
16781
16785
  const calculateData = useMemo$1(() => {
16786
+ if (!props.pageElement) {
16787
+ const path22 = [0, 0, 0, 0];
16788
+ const content = BlockManager.getBlockByType(ElementType.PAGE).create({
16789
+ attributes: {
16790
+ "background-color": "#ffffff"
16791
+ },
16792
+ children: [
16793
+ BlockManager.getBlockByType(ElementType.STANDARD_SECTION).create({
16794
+ children: [
16795
+ BlockManager.getBlockByType(ElementType.STANDARD_COLUMN).create({
16796
+ children: [
16797
+ BlockManager.getBlockByType(
16798
+ ElementType.STANDARD_PARAGRAPH
16799
+ ).create({
16800
+ attributes: {
16801
+ height: "200px",
16802
+ align: "left"
16803
+ },
16804
+ children: [{ text: "" }]
16805
+ })
16806
+ ]
16807
+ })
16808
+ ],
16809
+ attributes: {
16810
+ "padding-bottom": "0px",
16811
+ "padding-left": "0px",
16812
+ "padding-right": "0px",
16813
+ "padding-top": "0px"
16814
+ }
16815
+ })
16816
+ ]
16817
+ });
16818
+ return [{ subject: "", content }, path22];
16819
+ }
16782
16820
  const pageElement = cloneDeep(omit$2(props.pageElement, "children"));
16783
16821
  const template2 = {
16784
16822
  subject: "Blank",
@@ -16813,10 +16851,14 @@ const RichtextBar = (props) => {
16813
16851
  children: [
16814
16852
  BlockManager.getBlockByType(ElementType.STANDARD_SECTION).create({
16815
16853
  children: [
16816
- BlockManager.getBlockByType(
16817
- ElementType.STANDARD_PARAGRAPH
16818
- ).create({
16819
- children: [props.value]
16854
+ BlockManager.getBlockByType(ElementType.STANDARD_COLUMN).create({
16855
+ children: [
16856
+ BlockManager.getBlockByType(
16857
+ ElementType.STANDARD_PARAGRAPH
16858
+ ).create({
16859
+ children: [props.value]
16860
+ })
16861
+ ]
16820
16862
  })
16821
16863
  ],
16822
16864
  attributes: {
@@ -16889,6 +16931,16 @@ const DefaultSlider = (props) => {
16889
16931
  return /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", flex: "1", alignItems: "center" } }, showLimit && rest.min && /* @__PURE__ */ React__default.createElement(Typography$1.Text, null, rest.min), /* @__PURE__ */ React__default.createElement("div", { style: { flex: "1", marginLeft: 10, marginRight: 10 } }, /* @__PURE__ */ React__default.createElement(Slider, __spreadValues({}, rest))), showLimit && rest.max && /* @__PURE__ */ React__default.createElement(Typography$1.Text, null, rest.max));
16890
16932
  };
16891
16933
  const SliderField = enhancer(DefaultSlider);
16934
+ function PixelField(props) {
16935
+ return /* @__PURE__ */ React__default.createElement(
16936
+ NumberField,
16937
+ __spreadProps(__spreadValues({
16938
+ suffix: "px"
16939
+ }, props), {
16940
+ formItem: __spreadValues(__spreadValues({}, props.formItem), pixelNumberAdapter)
16941
+ })
16942
+ );
16943
+ }
16892
16944
  const TextField = enhancer(Input);
16893
16945
  enhancer(Input.Search);
16894
16946
  const TextAreaField = enhancer(Input.TextArea);
@@ -17128,11 +17180,6 @@ function FontWeight(props) {
17128
17180
  [props]
17129
17181
  );
17130
17182
  }
17131
- function PixelField(props) {
17132
- return useMemo$1(() => {
17133
- return /* @__PURE__ */ React__default.createElement(AttributeField.NumberField, __spreadValues({ formItem: pixelNumberAdapter }, props));
17134
- }, [props]);
17135
- }
17136
17183
  const getFallbackValue = (params) => {
17137
17184
  const { mode, name: name2, defaultElement } = params;
17138
17185
  if (!defaultElement)
@@ -18672,7 +18719,7 @@ function PixelAndPercentField(props) {
18672
18719
  const _a2 = props, { label, defaultPixelValue, defaultPercentValue, pxFirst } = _a2, rest = __objRest(_a2, ["label", "defaultPixelValue", "defaultPercentValue", "pxFirst"]);
18673
18720
  const editor = useSlate();
18674
18721
  const { getFieldValue, setFieldValue } = useEditorContext();
18675
- const source = Node$1.get(editor, props.path);
18722
+ const source = props.path ? Node$1.get(editor, props.path) : getFieldValue(null, props.name);
18676
18723
  const defaultElement = useElementDefault({
18677
18724
  path: props.path,
18678
18725
  type: get(source, "type", null)
@@ -18851,6 +18898,38 @@ function Direction$1(props) {
18851
18898
  )));
18852
18899
  }, [name2, path2, rest]);
18853
18900
  }
18901
+ var FieldType = /* @__PURE__ */ ((FieldType2) => {
18902
+ FieldType2["PIXEL"] = "pixel";
18903
+ FieldType2["PIXEL_AND_PERCENT"] = "pixel_and_percent";
18904
+ FieldType2["STRING"] = "string";
18905
+ FieldType2["NUMBER"] = "number";
18906
+ FieldType2["ENUM"] = "enum";
18907
+ FieldType2["COLOR"] = "color";
18908
+ FieldType2["IMAGE"] = "image";
18909
+ FieldType2["SLIDER"] = "slider";
18910
+ FieldType2["RICHTEXT"] = "richtext";
18911
+ return FieldType2;
18912
+ })(FieldType || {});
18913
+ const getFieldByType = (type) => {
18914
+ return {
18915
+ [FieldType.PIXEL_AND_PERCENT]: AttributeField.PixelAndPercentField,
18916
+ [FieldType.STRING]: AttributeField.TextField,
18917
+ [FieldType.ENUM]: AttributeField.SelectField,
18918
+ [FieldType.COLOR]: AttributeField.ColorPickerField,
18919
+ [FieldType.IMAGE]: AttributeField.ImageUrl,
18920
+ [FieldType.PIXEL]: AttributeField.PixelField,
18921
+ [FieldType.SLIDER]: AttributeField.SliderField
18922
+ }[type];
18923
+ };
18924
+ function FieldItem(props) {
18925
+ const Com = getFieldByType(props.type);
18926
+ if (!Com) {
18927
+ return null;
18928
+ }
18929
+ if (!props.name)
18930
+ return null;
18931
+ return /* @__PURE__ */ React__default.createElement(Com, __spreadProps(__spreadValues({ options: [] }, props), { name: props.name }));
18932
+ }
18854
18933
  const defaultAttributeFields = {
18855
18934
  // Basic Form Field
18856
18935
  WatchField,
@@ -18900,12 +18979,13 @@ const defaultAttributeFields = {
18900
18979
  Buttons,
18901
18980
  ButtonCategory,
18902
18981
  WebFonts,
18903
- RichTextField
18982
+ RichTextField,
18983
+ FieldItem
18904
18984
  };
18905
18985
  const AttributeField = __spreadValues({}, defaultAttributeFields);
18906
18986
  const index$6 = "";
18907
18987
  const AttributesPanelWrapper = (props) => {
18908
- return /* @__PURE__ */ React__default.createElement("div", { id: "AttributesPanelWrapper", className: "AttributesPanelWrapper" }, /* @__PURE__ */ React__default.createElement("div", { style: __spreadValues({ padding: "20px 0px" }, props.style) }, props.children));
18988
+ return /* @__PURE__ */ React__default.createElement("div", { id: "AttributesPanelWrapper", className: "AttributesPanelWrapper" }, /* @__PURE__ */ React__default.createElement("div", { style: __spreadValues({ padding: "1px 0px" }, props.style) }, props.children));
18909
18989
  };
18910
18990
  const CollapseWrapper = (props) => {
18911
18991
  const [activeKeys, setActiveKeys] = useState(
@@ -19095,14 +19175,14 @@ const Text$1 = ({ nodePath }) => {
19095
19175
  ResponsiveTabs,
19096
19176
  {
19097
19177
  desktop: /* @__PURE__ */ React__default.createElement(
19098
- AttributesContainer$a,
19178
+ AttributesContainer$b,
19099
19179
  {
19100
19180
  mode: ActiveTabKeys.DESKTOP,
19101
19181
  nodePath
19102
19182
  }
19103
19183
  ),
19104
19184
  mobile: /* @__PURE__ */ React__default.createElement(
19105
- AttributesContainer$a,
19185
+ AttributesContainer$b,
19106
19186
  {
19107
19187
  mode: ActiveTabKeys.MOBILE,
19108
19188
  nodePath
@@ -19111,7 +19191,7 @@ const Text$1 = ({ nodePath }) => {
19111
19191
  }
19112
19192
  ));
19113
19193
  };
19114
- function AttributesContainer$a({
19194
+ function AttributesContainer$b({
19115
19195
  nodePath,
19116
19196
  mode
19117
19197
  }) {
@@ -19171,14 +19251,14 @@ const Section = ({ nodePath }) => {
19171
19251
  ResponsiveTabs,
19172
19252
  {
19173
19253
  desktop: /* @__PURE__ */ React__default.createElement(
19174
- AttributesContainer$9,
19254
+ AttributesContainer$a,
19175
19255
  {
19176
19256
  mode: ActiveTabKeys.DESKTOP,
19177
19257
  nodePath
19178
19258
  }
19179
19259
  ),
19180
19260
  mobile: /* @__PURE__ */ React__default.createElement(
19181
- AttributesContainer$9,
19261
+ AttributesContainer$a,
19182
19262
  {
19183
19263
  mode: ActiveTabKeys.MOBILE,
19184
19264
  nodePath
@@ -19187,7 +19267,7 @@ const Section = ({ nodePath }) => {
19187
19267
  }
19188
19268
  ));
19189
19269
  };
19190
- function AttributesContainer$9({
19270
+ function AttributesContainer$a({
19191
19271
  nodePath,
19192
19272
  mode
19193
19273
  }) {
@@ -19334,14 +19414,14 @@ const Button = ({ nodePath }) => {
19334
19414
  ResponsiveTabs,
19335
19415
  {
19336
19416
  desktop: /* @__PURE__ */ React__default.createElement(
19337
- AttributesContainer$8,
19417
+ AttributesContainer$9,
19338
19418
  {
19339
19419
  mode: ActiveTabKeys.DESKTOP,
19340
19420
  nodePath
19341
19421
  }
19342
19422
  ),
19343
19423
  mobile: /* @__PURE__ */ React__default.createElement(
19344
- AttributesContainer$8,
19424
+ AttributesContainer$9,
19345
19425
  {
19346
19426
  mode: ActiveTabKeys.MOBILE,
19347
19427
  nodePath
@@ -19350,7 +19430,7 @@ const Button = ({ nodePath }) => {
19350
19430
  }
19351
19431
  ));
19352
19432
  };
19353
- function AttributesContainer$8({
19433
+ function AttributesContainer$9({
19354
19434
  nodePath,
19355
19435
  mode
19356
19436
  }) {
@@ -19463,14 +19543,14 @@ const Image$1 = ({ nodePath }) => {
19463
19543
  ResponsiveTabs,
19464
19544
  {
19465
19545
  desktop: /* @__PURE__ */ React__default.createElement(
19466
- AttributesContainer$7,
19546
+ AttributesContainer$8,
19467
19547
  {
19468
19548
  mode: ActiveTabKeys.DESKTOP,
19469
19549
  nodePath
19470
19550
  }
19471
19551
  ),
19472
19552
  mobile: /* @__PURE__ */ React__default.createElement(
19473
- AttributesContainer$7,
19553
+ AttributesContainer$8,
19474
19554
  {
19475
19555
  mode: ActiveTabKeys.MOBILE,
19476
19556
  nodePath
@@ -19479,7 +19559,7 @@ const Image$1 = ({ nodePath }) => {
19479
19559
  }
19480
19560
  ));
19481
19561
  };
19482
- function AttributesContainer$7({
19562
+ function AttributesContainer$8({
19483
19563
  nodePath,
19484
19564
  mode
19485
19565
  }) {
@@ -19559,6 +19639,13 @@ function AttributesContainer$7({
19559
19639
  path: nodePath,
19560
19640
  name: ""
19561
19641
  }
19642
+ ), /* @__PURE__ */ React__default.createElement(
19643
+ ResponsiveField,
19644
+ {
19645
+ component: AttributeField.BorderRadius,
19646
+ path: nodePath,
19647
+ name: "border-radius"
19648
+ }
19562
19649
  )), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, { name: "4", header: t("Block") }, /* @__PURE__ */ React__default.createElement(
19563
19650
  ResponsiveField,
19564
19651
  {
@@ -19581,14 +19668,14 @@ const Divider = ({ nodePath }) => {
19581
19668
  ResponsiveTabs,
19582
19669
  {
19583
19670
  desktop: /* @__PURE__ */ React__default.createElement(
19584
- AttributesContainer$6,
19671
+ AttributesContainer$7,
19585
19672
  {
19586
19673
  mode: ActiveTabKeys.DESKTOP,
19587
19674
  nodePath
19588
19675
  }
19589
19676
  ),
19590
19677
  mobile: /* @__PURE__ */ React__default.createElement(
19591
- AttributesContainer$6,
19678
+ AttributesContainer$7,
19592
19679
  {
19593
19680
  mode: ActiveTabKeys.MOBILE,
19594
19681
  nodePath
@@ -19597,7 +19684,7 @@ const Divider = ({ nodePath }) => {
19597
19684
  }
19598
19685
  ));
19599
19686
  };
19600
- function AttributesContainer$6({
19687
+ function AttributesContainer$7({
19601
19688
  nodePath,
19602
19689
  mode
19603
19690
  }) {
@@ -19663,14 +19750,14 @@ const Spacer = ({ nodePath }) => {
19663
19750
  ResponsiveTabs,
19664
19751
  {
19665
19752
  desktop: /* @__PURE__ */ React__default.createElement(
19666
- AttributesContainer$5,
19753
+ AttributesContainer$6,
19667
19754
  {
19668
19755
  mode: ActiveTabKeys.DESKTOP,
19669
19756
  nodePath
19670
19757
  }
19671
19758
  ),
19672
19759
  mobile: /* @__PURE__ */ React__default.createElement(
19673
- AttributesContainer$5,
19760
+ AttributesContainer$6,
19674
19761
  {
19675
19762
  mode: ActiveTabKeys.MOBILE,
19676
19763
  nodePath
@@ -19679,7 +19766,7 @@ const Spacer = ({ nodePath }) => {
19679
19766
  }
19680
19767
  ));
19681
19768
  };
19682
- function AttributesContainer$5({
19769
+ function AttributesContainer$6({
19683
19770
  nodePath,
19684
19771
  mode
19685
19772
  }) {
@@ -19704,14 +19791,14 @@ const Navbar = ({ nodePath }) => {
19704
19791
  ResponsiveTabs,
19705
19792
  {
19706
19793
  desktop: /* @__PURE__ */ React__default.createElement(
19707
- AttributesContainer$4,
19794
+ AttributesContainer$5,
19708
19795
  {
19709
19796
  mode: ActiveTabKeys.DESKTOP,
19710
19797
  nodePath
19711
19798
  }
19712
19799
  ),
19713
19800
  mobile: /* @__PURE__ */ React__default.createElement(
19714
- AttributesContainer$4,
19801
+ AttributesContainer$5,
19715
19802
  {
19716
19803
  mode: ActiveTabKeys.MOBILE,
19717
19804
  nodePath
@@ -19720,7 +19807,7 @@ const Navbar = ({ nodePath }) => {
19720
19807
  }
19721
19808
  ));
19722
19809
  };
19723
- function AttributesContainer$4({
19810
+ function AttributesContainer$5({
19724
19811
  nodePath,
19725
19812
  mode
19726
19813
  }) {
@@ -19913,14 +20000,14 @@ const Social = ({ nodePath }) => {
19913
20000
  ResponsiveTabs,
19914
20001
  {
19915
20002
  desktop: /* @__PURE__ */ React__default.createElement(
19916
- AttributesContainer$3,
20003
+ AttributesContainer$4,
19917
20004
  {
19918
20005
  mode: ActiveTabKeys.DESKTOP,
19919
20006
  nodePath
19920
20007
  }
19921
20008
  ),
19922
20009
  mobile: /* @__PURE__ */ React__default.createElement(
19923
- AttributesContainer$3,
20010
+ AttributesContainer$4,
19924
20011
  {
19925
20012
  mode: ActiveTabKeys.MOBILE,
19926
20013
  nodePath
@@ -19929,7 +20016,7 @@ const Social = ({ nodePath }) => {
19929
20016
  }
19930
20017
  ));
19931
20018
  };
19932
- function AttributesContainer$3({
20019
+ function AttributesContainer$4({
19933
20020
  nodePath,
19934
20021
  mode
19935
20022
  }) {
@@ -20161,14 +20248,14 @@ const Hero = ({ nodePath }) => {
20161
20248
  ResponsiveTabs,
20162
20249
  {
20163
20250
  desktop: /* @__PURE__ */ React__default.createElement(
20164
- AttributesContainer$2,
20251
+ AttributesContainer$3,
20165
20252
  {
20166
20253
  mode: ActiveTabKeys.DESKTOP,
20167
20254
  nodePath
20168
20255
  }
20169
20256
  ),
20170
20257
  mobile: /* @__PURE__ */ React__default.createElement(
20171
- AttributesContainer$2,
20258
+ AttributesContainer$3,
20172
20259
  {
20173
20260
  mode: ActiveTabKeys.MOBILE,
20174
20261
  nodePath
@@ -20177,7 +20264,7 @@ const Hero = ({ nodePath }) => {
20177
20264
  }
20178
20265
  ));
20179
20266
  };
20180
- function AttributesContainer$2({
20267
+ function AttributesContainer$3({
20181
20268
  nodePath,
20182
20269
  mode
20183
20270
  }) {
@@ -20294,14 +20381,14 @@ const Column = ({ nodePath }) => {
20294
20381
  ResponsiveTabs,
20295
20382
  {
20296
20383
  desktop: /* @__PURE__ */ React__default.createElement(
20297
- AttributesContainer$1,
20384
+ AttributesContainer$2,
20298
20385
  {
20299
20386
  mode: ActiveTabKeys.DESKTOP,
20300
20387
  nodePath
20301
20388
  }
20302
20389
  ),
20303
20390
  mobile: /* @__PURE__ */ React__default.createElement(
20304
- AttributesContainer$1,
20391
+ AttributesContainer$2,
20305
20392
  {
20306
20393
  mode: ActiveTabKeys.MOBILE,
20307
20394
  nodePath
@@ -20310,7 +20397,7 @@ const Column = ({ nodePath }) => {
20310
20397
  }
20311
20398
  ));
20312
20399
  };
20313
- function AttributesContainer$1({
20400
+ function AttributesContainer$2({
20314
20401
  nodePath,
20315
20402
  mode
20316
20403
  }) {
@@ -20352,14 +20439,14 @@ const Wrapper$1 = ({ nodePath }) => {
20352
20439
  ResponsiveTabs,
20353
20440
  {
20354
20441
  desktop: /* @__PURE__ */ React__default.createElement(
20355
- AttributesContainer,
20442
+ AttributesContainer$1,
20356
20443
  {
20357
20444
  mode: ActiveTabKeys.DESKTOP,
20358
20445
  nodePath
20359
20446
  }
20360
20447
  ),
20361
20448
  mobile: /* @__PURE__ */ React__default.createElement(
20362
- AttributesContainer,
20449
+ AttributesContainer$1,
20363
20450
  {
20364
20451
  mode: ActiveTabKeys.MOBILE,
20365
20452
  nodePath
@@ -20368,7 +20455,7 @@ const Wrapper$1 = ({ nodePath }) => {
20368
20455
  }
20369
20456
  ));
20370
20457
  };
20371
- function AttributesContainer({
20458
+ function AttributesContainer$1({
20372
20459
  nodePath,
20373
20460
  mode
20374
20461
  }) {
@@ -20439,6 +20526,48 @@ function AttributesContainer({
20439
20526
  }
20440
20527
  ))));
20441
20528
  }
20529
+ const Widget = ({ nodePath }) => {
20530
+ return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(
20531
+ ResponsiveTabs,
20532
+ {
20533
+ desktop: /* @__PURE__ */ React__default.createElement(
20534
+ AttributesContainer,
20535
+ {
20536
+ mode: ActiveTabKeys.DESKTOP,
20537
+ nodePath
20538
+ }
20539
+ ),
20540
+ mobile: /* @__PURE__ */ React__default.createElement(
20541
+ AttributesContainer,
20542
+ {
20543
+ mode: ActiveTabKeys.MOBILE,
20544
+ nodePath
20545
+ }
20546
+ )
20547
+ }
20548
+ ));
20549
+ };
20550
+ function AttributesContainer({
20551
+ nodePath,
20552
+ mode
20553
+ }) {
20554
+ const { selectedNode, selectedNodePath } = useSelectedNode();
20555
+ const configFields = useMemo$1(() => {
20556
+ return (selectedNode == null ? void 0 : selectedNode.data.config) || [];
20557
+ }, [selectedNode]);
20558
+ if (!selectedNode || !selectedNodePath)
20559
+ return null;
20560
+ const { description } = selectedNode.data;
20561
+ return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(CollapseWrapper, { defaultActiveKey: ["0", "1", "2"] }, /* @__PURE__ */ React__default.createElement(Collapse$1.Item, { name: "0", header: t("Setting") }, description && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 22, offset: 1 }, description && /* @__PURE__ */ React__default.createElement("p", { dangerouslySetInnerHTML: { __html: description } }))), /* @__PURE__ */ React__default.createElement(Divider$1, null)), /* @__PURE__ */ React__default.createElement(Space, { style: { width: "100%" }, direction: "vertical" }, configFields.map((item2, index2) => /* @__PURE__ */ React__default.createElement(
20562
+ AttributeField.FieldItem,
20563
+ __spreadProps(__spreadValues({
20564
+ key: index2
20565
+ }, item2), {
20566
+ path: selectedNodePath,
20567
+ name: `data.input.${item2.name}`
20568
+ })
20569
+ ))))));
20570
+ }
20442
20571
  const ConfigPanelsMap = {
20443
20572
  [ElementType.PAGE]: Page,
20444
20573
  [ElementType.STANDARD_NAVBAR]: Navbar,
@@ -20451,6 +20580,9 @@ const ConfigPanelsMap = {
20451
20580
  [ElementType.STANDARD_SECTION]: Section,
20452
20581
  [ElementType.STANDARD_COLUMN]: Column,
20453
20582
  [ElementType.STANDARD_HERO]: Hero,
20583
+ [ElementType.CONTENT_WIDGET]: Widget,
20584
+ [ElementType.SECTION_WIDGET]: Widget,
20585
+ [ElementType.WRAPPER_WIDGET]: Widget,
20454
20586
  //text
20455
20587
  [ElementType.STANDARD_TEXT]: Text$1,
20456
20588
  [ElementType.STANDARD_PARAGRAPH]: Text$1,
@@ -24858,7 +24990,7 @@ const disableInteraction = "_disableInteraction_ng4f3_110";
24858
24990
  const disableSelection = "_disableSelection_ng4f3_114";
24859
24991
  const Collapse = "_Collapse_ng4f3_122";
24860
24992
  const collapsed = "_collapsed_ng4f3_125";
24861
- const styles$1 = {
24993
+ const styles$2 = {
24862
24994
  Wrapper,
24863
24995
  clone,
24864
24996
  TreeItem: TreeItem$1,
@@ -24874,7 +25006,7 @@ const styles$1 = {
24874
25006
  collapsed
24875
25007
  };
24876
25008
  const Action$1 = "_Action_armtj_1";
24877
- const styles = {
25009
+ const styles$1 = {
24878
25010
  Action: Action$1
24879
25011
  };
24880
25012
  const Action = forwardRef(
@@ -24885,7 +25017,7 @@ const Action = forwardRef(
24885
25017
  __spreadProps(__spreadValues({
24886
25018
  ref: ref2
24887
25019
  }, props), {
24888
- className: classnames$1(styles.Action, className),
25020
+ className: classnames$1(styles$1.Action, className),
24889
25021
  tabIndex: 0,
24890
25022
  style: __spreadProps(__spreadValues({}, style2), {
24891
25023
  cursor,
@@ -24972,13 +25104,13 @@ const TreeItem = forwardRef(
24972
25104
  "li",
24973
25105
  __spreadValues({
24974
25106
  className: classnames$1(
24975
- styles$1.Wrapper,
24976
- clone2 && styles$1.clone,
24977
- ghost2 && styles$1.ghost,
24978
- selected2 && styles$1.selected,
24979
- indicator2 && styles$1.indicator,
24980
- disableSelection2 && styles$1.disableSelection,
24981
- disableInteraction2 && styles$1.disableInteraction
25107
+ styles$2.Wrapper,
25108
+ clone2 && styles$2.clone,
25109
+ ghost2 && styles$2.ghost,
25110
+ selected2 && styles$2.selected,
25111
+ indicator2 && styles$2.indicator,
25112
+ disableSelection2 && styles$2.disableSelection,
25113
+ disableInteraction2 && styles$2.disableInteraction
24982
25114
  ),
24983
25115
  ref: wrapperRef,
24984
25116
  style: {
@@ -24988,7 +25120,7 @@ const TreeItem = forwardRef(
24988
25120
  /* @__PURE__ */ React__default.createElement(
24989
25121
  "div",
24990
25122
  {
24991
- className: styles$1.TreeItem,
25123
+ className: styles$2.TreeItem,
24992
25124
  ref: ref2,
24993
25125
  style: style2,
24994
25126
  onClick: onSelect,
@@ -25002,17 +25134,17 @@ const TreeItem = forwardRef(
25002
25134
  onCollapse();
25003
25135
  },
25004
25136
  className: classnames$1(
25005
- styles$1.Collapse,
25006
- collapsed2 && styles$1.collapsed
25137
+ styles$2.Collapse,
25138
+ collapsed2 && styles$2.collapsed
25007
25139
  )
25008
25140
  },
25009
25141
  collapseIcon
25010
25142
  ),
25011
- /* @__PURE__ */ React__default.createElement("span", { className: styles$1.Text }, renderTitle(item2)),
25143
+ /* @__PURE__ */ React__default.createElement("span", { className: styles$2.Text }, renderTitle(item2)),
25012
25144
  !clone2 && onRemove && /* @__PURE__ */ React__default.createElement(
25013
25145
  "div",
25014
25146
  {
25015
- className: styles$1.hoverHandle,
25147
+ className: styles$2.hoverHandle,
25016
25148
  style: { visibility: removable ? void 0 : "hidden" }
25017
25149
  },
25018
25150
  /* @__PURE__ */ React__default.createElement(
@@ -25025,11 +25157,11 @@ const TreeItem = forwardRef(
25025
25157
  }
25026
25158
  )
25027
25159
  ),
25028
- clone2 && childCount && childCount > 1 ? /* @__PURE__ */ React__default.createElement("span", { className: styles$1.Count }, childCount) : null,
25160
+ clone2 && childCount && childCount > 1 ? /* @__PURE__ */ React__default.createElement("span", { className: styles$2.Count }, childCount) : null,
25029
25161
  /* @__PURE__ */ React__default.createElement(
25030
25162
  "div",
25031
25163
  {
25032
- className: styles$1.hoverHandle,
25164
+ className: styles$2.hoverHandle,
25033
25165
  style: { visibility: moveable ? void 0 : "hidden" }
25034
25166
  },
25035
25167
  /* @__PURE__ */ React__default.createElement(Handle, __spreadValues({}, handleProps))
@@ -25494,7 +25626,7 @@ const BlockLayer = () => {
25494
25626
  };
25495
25627
  const BlockSideBar = ({ height }) => {
25496
25628
  const { setSelectedNodePath, selectedNodePath, universalElementEditing } = useEditorState();
25497
- const { showLayer, compact } = useEditorProps();
25629
+ const { showLayer, compact, widgetMode } = useEditorProps();
25498
25630
  const { selectedNode } = useSelectedNode();
25499
25631
  const [activeTab, setActiveTab] = useState("Content");
25500
25632
  const lastActiveTab = useRef(activeTab);
@@ -25503,13 +25635,10 @@ const BlockSideBar = ({ height }) => {
25503
25635
  setSelectedNodePath([0]);
25504
25636
  }
25505
25637
  }, [activeTab, setSelectedNodePath, selectedNodePath]);
25506
- const onChange = useCallback$1(
25507
- (key2) => {
25508
- lastActiveTab.current = key2;
25509
- setActiveTab(key2);
25510
- },
25511
- [setSelectedNodePath]
25512
- );
25638
+ const onChange = useCallback$1((key2) => {
25639
+ lastActiveTab.current = key2;
25640
+ setActiveTab(key2);
25641
+ }, []);
25513
25642
  const onClose = useCallback$1(() => {
25514
25643
  setActiveTab(lastActiveTab.current);
25515
25644
  }, []);
@@ -25548,7 +25677,7 @@ const BlockSideBar = ({ height }) => {
25548
25677
  },
25549
25678
  /* @__PURE__ */ React__default.createElement(BlocksPanel, null)
25550
25679
  )),
25551
- !compact && /* @__PURE__ */ React__default.createElement(
25680
+ !compact && !widgetMode && /* @__PURE__ */ React__default.createElement(
25552
25681
  Tabs.TabPane,
25553
25682
  {
25554
25683
  destroyOnHide: true,
@@ -38795,6 +38924,309 @@ const ConfigurationSideBar = ({ height }) => {
38795
38924
  }
38796
38925
  ));
38797
38926
  };
38927
+ const largeTabsHeader = "_largeTabsHeader_d2sio_1";
38928
+ const styles = {
38929
+ largeTabsHeader
38930
+ };
38931
+ function AddItems(props) {
38932
+ const { getFieldValue, setFieldValue } = useEditorContext();
38933
+ const { path: path2 } = props;
38934
+ const fields = getFieldValue(props.path, props.name);
38935
+ const onAdd = () => {
38936
+ setFieldValue(props.path, props.name, [
38937
+ ...fields || [],
38938
+ { label: "", value: "" }
38939
+ ]);
38940
+ };
38941
+ const onRemove = (index2) => {
38942
+ setFieldValue(props.path, props.name, [
38943
+ ...fields.filter((item2, i) => i !== index2)
38944
+ ]);
38945
+ };
38946
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Grid.Row, { justify: "space-between" }, /* @__PURE__ */ React__default.createElement(Typography$1.Text, null, "Options"), /* @__PURE__ */ React__default.createElement(Button$1, { size: "small", icon: /* @__PURE__ */ React__default.createElement(IconPlus, null), onClick: onAdd })), fields == null ? void 0 : fields.map((_14, index2) => {
38947
+ return /* @__PURE__ */ React__default.createElement("div", { key: index2 }, /* @__PURE__ */ React__default.createElement(Space, { align: "center" }, /* @__PURE__ */ React__default.createElement(
38948
+ AttributeField.TextField,
38949
+ {
38950
+ name: `${props.name}.${index2}.label`,
38951
+ label: "Label",
38952
+ path: path2,
38953
+ formItem: {
38954
+ layout: "vertical"
38955
+ }
38956
+ }
38957
+ ), /* @__PURE__ */ React__default.createElement(
38958
+ AttributeField.TextField,
38959
+ {
38960
+ name: `${props.name}.${index2}.value`,
38961
+ label: "Value",
38962
+ path: path2,
38963
+ formItem: {
38964
+ layout: "vertical"
38965
+ }
38966
+ }
38967
+ ), /* @__PURE__ */ React__default.createElement(
38968
+ Form.Item,
38969
+ {
38970
+ label: "",
38971
+ style: {
38972
+ margin: "0px"
38973
+ }
38974
+ },
38975
+ /* @__PURE__ */ React__default.createElement(
38976
+ Button$1,
38977
+ {
38978
+ icon: /* @__PURE__ */ React__default.createElement(IconDelete, null),
38979
+ onClick: () => onRemove(index2)
38980
+ }
38981
+ )
38982
+ )));
38983
+ }), /* @__PURE__ */ React__default.createElement(Divider$1, null)));
38984
+ }
38985
+ const formItemStyle = {
38986
+ labelCol: {
38987
+ span: 7,
38988
+ style: {
38989
+ textAlign: "right"
38990
+ }
38991
+ },
38992
+ wrapperCol: {
38993
+ span: 17,
38994
+ style: {
38995
+ textAlign: "left"
38996
+ }
38997
+ }
38998
+ };
38999
+ const typeOptions = [
39000
+ { value: FieldType.PIXEL, label: "Pixel" },
39001
+ { value: FieldType.STRING, label: "String" },
39002
+ { value: FieldType.NUMBER, label: "Number" },
39003
+ { value: FieldType.ENUM, label: "Enum" },
39004
+ { value: FieldType.COLOR, label: "Color" },
39005
+ { value: FieldType.IMAGE, label: "Image" }
39006
+ // { value: FieldType.SLIDER, label: "Slider" },
39007
+ // { value: FieldType.PIXEL_AND_PERCENT, label: "Pixel and percent" },
39008
+ ];
39009
+ function FieldConfigItem(props) {
39010
+ const { getFieldValue } = useEditorContext();
39011
+ const keyField = getFieldValue(null, props.name);
39012
+ return /* @__PURE__ */ React__default.createElement(
39013
+ Collapse$1.Item,
39014
+ {
39015
+ style: { backgroundColor: "#fff" },
39016
+ name: props.name,
39017
+ header: props.label,
39018
+ extra: /* @__PURE__ */ React__default.createElement(Button$1, { icon: /* @__PURE__ */ React__default.createElement(IconDelete, null), onClick: props.onRemove }),
39019
+ contentStyle: { width: "100%", padding: "20px 16px" }
39020
+ },
39021
+ /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 22, offset: 0 }, /* @__PURE__ */ React__default.createElement(Space, { direction: "vertical", style: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(
39022
+ AttributeField.TextField,
39023
+ {
39024
+ label: "Label",
39025
+ required: true,
39026
+ name: props.name + ".label",
39027
+ formItem: formItemStyle,
39028
+ path: props.path
39029
+ }
39030
+ ), /* @__PURE__ */ React__default.createElement(
39031
+ AttributeField.TextField,
39032
+ {
39033
+ label: "Key",
39034
+ required: true,
39035
+ name: props.name + ".name",
39036
+ formItem: formItemStyle,
39037
+ path: props.path
39038
+ }
39039
+ ), /* @__PURE__ */ React__default.createElement(
39040
+ AttributeField.SelectField,
39041
+ {
39042
+ label: "Type",
39043
+ name: props.name + ".type",
39044
+ formItem: formItemStyle,
39045
+ options: typeOptions,
39046
+ path: props.path
39047
+ }
39048
+ ), keyField.type === FieldType.ENUM && /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 17, offset: 7 }, /* @__PURE__ */ React__default.createElement(AddItems, { name: props.name + ".options", path: props.path }))), /* @__PURE__ */ React__default.createElement(
39049
+ AttributeField.TextAreaField,
39050
+ {
39051
+ label: "Desc",
39052
+ name: props.name + ".description",
39053
+ formItem: formItemStyle,
39054
+ path: props.path
39055
+ }
39056
+ ), keyField && /* @__PURE__ */ React__default.createElement(
39057
+ FieldItem,
39058
+ {
39059
+ label: "Default",
39060
+ name: `widgetElement.data.input.${keyField.name}`,
39061
+ formItem: formItemStyle,
39062
+ path: null,
39063
+ type: props.type,
39064
+ options: keyField.options
39065
+ }
39066
+ ))))
39067
+ );
39068
+ }
39069
+ function WidgetConfigPanel({
39070
+ containerHeight
39071
+ }) {
39072
+ const { values: values2, setFieldValue } = useEditorContext();
39073
+ const widgetElement = values2.widgetElement;
39074
+ if (!widgetElement) {
39075
+ throw new Error(`Invalid widgetElement`);
39076
+ }
39077
+ const [activeTab, setActiveTab] = useState(
39078
+ (widgetElement.data.config || []).slice(0, 1).map((_14, index2) => `widgetElement.data.config.${index2}`)
39079
+ );
39080
+ const onAdd = useCallback$1(() => {
39081
+ const cloneWidgetElement = cloneDeep(widgetElement);
39082
+ cloneWidgetElement.data.config.push({
39083
+ label: "Label",
39084
+ name: "",
39085
+ required: false,
39086
+ helpText: "",
39087
+ type: FieldType.PIXEL
39088
+ });
39089
+ setFieldValue(null, `widgetElement`, cloneDeep(cloneWidgetElement));
39090
+ setActiveTab([
39091
+ `widgetElement.data.config.${cloneWidgetElement.data.config.length - 1}`
39092
+ ]);
39093
+ }, [setFieldValue, widgetElement]);
39094
+ const onRemove = useCallback$1(
39095
+ (index2) => {
39096
+ const cloneWidgetElement = cloneDeep(widgetElement);
39097
+ cloneWidgetElement.data.config = cloneWidgetElement.data.config.filter(
39098
+ (_14, i) => index2 !== i
39099
+ );
39100
+ const max = cloneWidgetElement.data.config.length - 1;
39101
+ setFieldValue(null, `widgetElement`, cloneDeep(cloneWidgetElement));
39102
+ setActiveTab([`widgetElement.data.config.${Math.min(index2, max)}`]);
39103
+ },
39104
+ [setFieldValue, widgetElement]
39105
+ );
39106
+ return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(
39107
+ Tabs,
39108
+ {
39109
+ defaultActiveTab: "Setting",
39110
+ renderTabHeader: (_14, DefaultHeader) => /* @__PURE__ */ React__default.createElement(
39111
+ "div",
39112
+ {
39113
+ className: styles.largeTabsHeader,
39114
+ style: { display: "flex", alignItems: "center" }
39115
+ },
39116
+ /* @__PURE__ */ React__default.createElement(DefaultHeader, { style: { flex: 1 } })
39117
+ )
39118
+ },
39119
+ /* @__PURE__ */ React__default.createElement(
39120
+ Tabs.TabPane,
39121
+ {
39122
+ key: "Setting",
39123
+ style: { padding: 10 },
39124
+ title: /* @__PURE__ */ React__default.createElement("div", { style: { height: 40, lineHeight: "40px" } }, "Setting")
39125
+ },
39126
+ /* @__PURE__ */ React__default.createElement(Grid.Row, { style: { paddingTop: 20 } }, /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 22, offset: 1 }, /* @__PURE__ */ React__default.createElement(
39127
+ AttributeField.TextField,
39128
+ {
39129
+ name: "widgetElement.title",
39130
+ label: "Title",
39131
+ path: null,
39132
+ formItem: {
39133
+ layout: "vertical",
39134
+ labelCol: {},
39135
+ wrapperCol: {}
39136
+ }
39137
+ }
39138
+ ), /* @__PURE__ */ React__default.createElement(
39139
+ AttributeField.TextAreaField,
39140
+ {
39141
+ rows: 3,
39142
+ name: "widgetElement.data.description",
39143
+ label: "Description",
39144
+ path: null,
39145
+ formItem: {
39146
+ layout: "vertical",
39147
+ labelCol: {},
39148
+ wrapperCol: {}
39149
+ }
39150
+ }
39151
+ ))),
39152
+ /* @__PURE__ */ React__default.createElement(Divider$1, null),
39153
+ /* @__PURE__ */ React__default.createElement(Grid.Row, null, /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 22, offset: 1 }, /* @__PURE__ */ React__default.createElement(
39154
+ AttributeField.SwitchField,
39155
+ {
39156
+ name: "widgetElement.data.contentEditable",
39157
+ label: "Content editable",
39158
+ path: null,
39159
+ style: { position: "relative", top: 0 },
39160
+ formItem: {
39161
+ layout: "horizontal",
39162
+ labelCol: {
39163
+ span: 10,
39164
+ style: {
39165
+ textAlign: "left"
39166
+ }
39167
+ },
39168
+ wrapperCol: {
39169
+ span: 12,
39170
+ style: {
39171
+ textAlign: "left"
39172
+ }
39173
+ }
39174
+ }
39175
+ }
39176
+ )))
39177
+ ),
39178
+ /* @__PURE__ */ React__default.createElement(
39179
+ Tabs.TabPane,
39180
+ {
39181
+ key: "Input",
39182
+ title: /* @__PURE__ */ React__default.createElement(
39183
+ "div",
39184
+ {
39185
+ style: {
39186
+ height: 40,
39187
+ lineHeight: "40px",
39188
+ paddingLeft: 10,
39189
+ paddingRight: 10
39190
+ }
39191
+ },
39192
+ /* @__PURE__ */ React__default.createElement(Grid.Row, { justify: "space-between", align: "center" }, /* @__PURE__ */ React__default.createElement("span", null), /* @__PURE__ */ React__default.createElement("span", null, "Input"), /* @__PURE__ */ React__default.createElement(Button$1, { icon: /* @__PURE__ */ React__default.createElement(IconPlus, null), onClick: onAdd }))
39193
+ )
39194
+ },
39195
+ /* @__PURE__ */ React__default.createElement(
39196
+ Collapse$1,
39197
+ {
39198
+ bordered: false,
39199
+ activeKey: activeTab,
39200
+ onChange: (key2, keys2) => setActiveTab(keys2)
39201
+ },
39202
+ /* @__PURE__ */ React__default.createElement(Card, { title: "Attributes", bodyStyle: { padding: 0 } }, /* @__PURE__ */ React__default.createElement(
39203
+ FullHeightOverlayScrollbars,
39204
+ {
39205
+ height: `calc(${containerHeight} - 110px)`
39206
+ },
39207
+ (widgetElement.data.config || []).map((item2, index2) => /* @__PURE__ */ React__default.createElement(
39208
+ FieldConfigItem,
39209
+ __spreadProps(__spreadValues({
39210
+ path: null,
39211
+ key: index2
39212
+ }, item2), {
39213
+ name: `widgetElement.data.config.${index2}`,
39214
+ onRemove: () => onRemove(index2)
39215
+ })
39216
+ )),
39217
+ /* @__PURE__ */ React__default.createElement(
39218
+ Collapse$1.Item,
39219
+ {
39220
+ header: "",
39221
+ name: "hidden",
39222
+ style: { display: "none" }
39223
+ }
39224
+ )
39225
+ ))
39226
+ )
39227
+ )
39228
+ ));
39229
+ }
38798
39230
  const SharedComponents = {
38799
39231
  PreviewEmailDrawer,
38800
39232
  PreviewEmail,
@@ -38811,6 +39243,7 @@ const SharedComponents = {
38811
39243
  Hotkeys,
38812
39244
  Controller,
38813
39245
  UnsplashImages,
39246
+ WidgetConfigPanel,
38814
39247
  FullHeightOverlayScrollbars
38815
39248
  };
38816
39249
  const FullScreenLoading = ({
@@ -38863,7 +39296,19 @@ const useCreateConfig$1 = (_m) => {
38863
39296
  "hoveringToolbar"
38864
39297
  ]);
38865
39298
  const editor = useMemo$1(() => createEditor(), []);
38866
- return __spreadValues({
39299
+ let initialValues = rest.initialValues;
39300
+ if (rest.widgetMode) {
39301
+ const widgetElement = initialValues.content.children[0];
39302
+ if (!widgetElement || !NodeUtils.isWidgetElement(widgetElement)) {
39303
+ throw new Error(
39304
+ `The first child element of the Page element must be a Widget element`
39305
+ );
39306
+ }
39307
+ initialValues = cloneDeep(initialValues);
39308
+ initialValues.content.children = widgetElement.children;
39309
+ initialValues.widgetElement = widgetElement;
39310
+ }
39311
+ return __spreadProps(__spreadValues({
38867
39312
  editor,
38868
39313
  withEnhanceEditor: withTheme$1,
38869
39314
  ElementPlaceholder: ElementPlaceholder$1,
@@ -38875,13 +39320,16 @@ const useCreateConfig$1 = (_m) => {
38875
39320
  newLineWithBr: true,
38876
39321
  EnhanceProvider: PluginsProvider,
38877
39322
  loading: /* @__PURE__ */ React__default.createElement(FullScreenLoading, { isFullScreen: true })
38878
- }, rest);
39323
+ }, rest), {
39324
+ initialValues
39325
+ });
38879
39326
  };
38880
39327
  const Layout$1 = ({ children }) => {
38881
39328
  const { inited } = useEditorContext();
38882
39329
  const {
38883
39330
  controller = true,
38884
39331
  showSidebar = true,
39332
+ widgetMode,
38885
39333
  height,
38886
39334
  compact
38887
39335
  } = useEditorProps();
@@ -38894,7 +39342,7 @@ const Layout$1 = ({ children }) => {
38894
39342
  }
38895
39343
  };
38896
39344
  const root2 = getRoot();
38897
- const sidebarWidth = getIsLargeScreen() || !compact ? 400 : 350;
39345
+ const sidebarWidth = getIsLargeScreen() || !compact && !widgetMode ? 400 : 350;
38898
39346
  const layoutContent = /* @__PURE__ */ React__default.createElement(SharedComponents.UniversalElementEditorDrawer, null, /* @__PURE__ */ React__default.createElement(
38899
39347
  Card,
38900
39348
  {
@@ -38911,6 +39359,17 @@ const Layout$1 = ({ children }) => {
38911
39359
  height
38912
39360
  }
38913
39361
  },
39362
+ widgetMode && /* @__PURE__ */ React__default.createElement(
39363
+ Layout$2.Sider,
39364
+ {
39365
+ style: {
39366
+ width: sidebarWidth,
39367
+ position: "relative",
39368
+ zIndex: 1
39369
+ }
39370
+ },
39371
+ /* @__PURE__ */ React__default.createElement(SharedComponents.WidgetConfigPanel, { containerHeight: height })
39372
+ ),
38914
39373
  showSidebar && /* @__PURE__ */ React__default.createElement(
38915
39374
  Layout$2.Sider,
38916
39375
  {
@@ -39247,7 +39706,7 @@ const ElementHover = (props) => {
39247
39706
  }
39248
39707
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(renderContent, nodeElement));
39249
39708
  };
39250
- const minimaliststyleText = '[data-slate-block="page"] {\r\n min-height: 300px;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-focus="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-selected="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] .element-tools-container {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-void-child="true"]:hover {\r\n outline: 2px solid var(--hover-color);\r\n}\r\n\r\n\r\n.text-mergetag {\r\n outline: 1px solid rgb(78, 89, 105);\r\n outline-offset: 1px;\r\n padding: 0 2px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n transition: all 0.1s linear;\r\n border: none;\r\n font-weight: inherit;\r\n outline-color: #00a0ac;\r\n color: inherit;\r\n background-color: #ebf9fc;\r\n max-width: 10em;\r\n font-style: inherit;\r\n text-decoration-line: inherit;\r\n position: relative;\r\n}\r\n\r\n\r\n[data-slate-dragover=true] {\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 10;\n left: 0;\n height: 4px;\n opacity: 1;\n}\r\n\r\n\r\n.element-dragover-placeholder-container {\n position: absolute;\n top: 0;\n left: 0px;\n width: 100%;\n pointer-events: none;\n user-select: none;\n}\r\n\r\n\r\n.element-dragover-placeholder-container * {\n pointer-events: none !important;\n user-select: none !important;\n}\r\n\r\n\r\n.element-dragover-placeholder {\n position: fixed;\n pointer-events: none;\n}\r\n\r\n\r\n[data-slate-dragover-direction=top][data-slate-dragover=true]::after {\n top: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=bottom][data-slate-dragover=true]::after {\n top: auto;\n bottom: 0px;\n}\r\n\r\n\r\n.text-empty::before {\n content: attr(placeholder);\n position: absolute;\n font-size: inherit;\n white-space: nowrap;\n pointer-events: none;\n caret-color: rgb(55, 53, 47);\n color: rgb(55, 53, 47);\n -webkit-text-fill-color: rgba(55, 53, 47, 0.5);\n width: 100%;\n left: 0;\n text-align: center;\n font-style: normal;\n font-weight: normal;\n}\r\n\r\n\r\n[data-empty-src=true] td > img {\n display: none !important;\n}';
39709
+ const minimaliststyleText = '[data-slate-block="page"] {\r\n min-height: 300px;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-focus="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-selected="true"] {\r\n z-index: 3;\r\n}\r\n\r\n\r\n[data-slate-hover="true"] .element-tools-container {\r\n z-index: 4;\r\n}\r\n\r\n\r\n[data-slate-void="true"] [data-slate-node="element"][data-slate-block="button"]:hover,\r\n[data-slate-void="true"] [data-slate-node="element"][data-slate-block="text"]:hover {\r\n outline: 2px solid var(--hover-color);\r\n}\r\n\r\n\r\n.text-mergetag {\r\n outline: 1px solid rgb(78, 89, 105);\r\n outline-offset: 1px;\r\n padding: 0 2px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n transition: all 0.1s linear;\r\n border: none;\r\n font-weight: inherit;\r\n outline-color: #00a0ac;\r\n color: inherit;\r\n background-color: #ebf9fc;\r\n max-width: 10em;\r\n font-style: inherit;\r\n text-decoration-line: inherit;\r\n position: relative;\r\n}\r\n\r\n\r\n[data-slate-dragover=true] {\n z-index: 2;\n}\r\n\r\n\r\n[data-slate-dragover=true]::after {\n content: "";\n position: absolute;\n pointer-events: none;\n inset: 0px;\n border-radius: 3px;\n background: var(--drag-color);\n z-index: 10;\n left: 0;\n height: 4px;\n opacity: 1;\n}\r\n\r\n\r\n.element-dragover-placeholder-container {\n position: absolute;\n top: 0;\n left: 0px;\n width: 100%;\n pointer-events: none;\n user-select: none;\n}\r\n\r\n\r\n.element-dragover-placeholder-container * {\n pointer-events: none !important;\n user-select: none !important;\n}\r\n\r\n\r\n.element-dragover-placeholder {\n position: fixed;\n pointer-events: none;\n}\r\n\r\n\r\n[data-slate-dragover-direction=top][data-slate-dragover=true]::after {\n top: 0px;\n}\r\n\r\n\r\n[data-slate-dragover-direction=bottom][data-slate-dragover=true]::after {\n top: auto;\n bottom: 0px;\n}\r\n\r\n\r\n.text-empty::before {\n content: attr(placeholder);\n position: absolute;\n font-size: inherit;\n white-space: nowrap;\n pointer-events: none;\n caret-color: rgb(55, 53, 47);\n color: rgb(55, 53, 47);\n -webkit-text-fill-color: rgba(55, 53, 47, 0.5);\n width: 100%;\n left: 0;\n text-align: center;\n font-style: normal;\n font-weight: normal;\n}\r\n\r\n\r\n[data-empty-src=true] td > img {\n display: none !important;\n}';
39251
39710
  const hideCursor = (editor) => {
39252
39711
  const root2 = ReactEditor.getWindow(editor);
39253
39712
  root2.document.body.setAttribute("data-slate-hide-cursor", "true");
@@ -45123,7 +45582,6 @@ const ColumnLayoutOverlay = ({
45123
45582
  Transforms.insertNodes(editor, row, {
45124
45583
  at: nextPath
45125
45584
  });
45126
- console.log(nextPath);
45127
45585
  if (rowEleEntry[0].children.length === 1) {
45128
45586
  const textEleEntry = Editor.above(editor, {
45129
45587
  match: (n) => {
@@ -45616,8 +46074,7 @@ const useOverlayMenuCapture = ({
45616
46074
  }) => {
45617
46075
  const [target, setTarget] = useState();
45618
46076
  const [search, setSearch] = useState("");
45619
- const context = useMinimalistContext();
45620
- console.log(context);
46077
+ useMinimalistContext();
45621
46078
  const onPageChangeCapture = (...rest) => {
45622
46079
  try {
45623
46080
  onPageChange == null ? void 0 : onPageChange(...rest);