easy-email-pro-theme 1.47.0 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -54,17 +54,17 @@ var __async = (__this, __arguments, generator) => {
54
54
  step((generator = generator.apply(__this, __arguments)).next());
55
55
  });
56
56
  };
57
- import { classnames, useEditorState, useEditorProps, useRefState, isDOMElement, useMergeTagsData, useEventCallback, useSelectedNode, ActiveTabKeys, toggleFormat, TextFormat, isFormatActive, validation, CustomEvent, getDynamicImagePlaceholder, EmailEditorProvider, EmailEditor, useForceUpdate, IframeComponent, HtmlStringToReactNodes } from "easy-email-pro-editor";
57
+ import { classnames, useEditorState, useEditorProps, useRefState, isDOMElement, useMergeTagsData, useEventCallback, useSelectedNode, ActiveTabKeys, toggleFormat, TextFormat, isFormatActive, validation, CustomEvent, getDynamicImagePlaceholder, EmailEditorProvider, EmailEditor, useForceUpdate, IframeComponent, HtmlStringToReactNodes, useEqualState } from "easy-email-pro-editor";
58
58
  import { useSlate, ReactEditor, useSlateStatic, useSelected } from "slate-react";
59
59
  import * as React$2 from "react";
60
60
  import React__default, { useRef, useState, useEffect, useCallback, useMemo, createContext, useContext, useLayoutEffect, memo, useReducer, cloneElement, forwardRef, Suspense, Component, createElement } from "react";
61
61
  import { NodeUtils, BlockManager, ElementType, EditorCore, t, ElementCategory, classnames as classnames$1, StandardType, PluginManager, EditorAuth, HtmlNodeAdapter, ConditionOperator, ConditionOperatorSymbol, EmailRenderProvider, components, I18nManager } from "easy-email-pro-core";
62
+ import { cloneDeep, get, isEqual, set, omit as omit$2, merge as merge$1, debounce as debounce$2, isUndefined as isUndefined$1, uniqueId, isString as isString$1, isFunction as isFunction$4, isNumber as isNumber$1, upperFirst, sum, flatMap } from "lodash";
62
63
  import { Editor, Range, Node, Transforms, Path, Text as Text$2, createEditor } from "slate";
63
64
  import { createPortal, unstable_batchedUpdates } from "react-dom";
64
- import { cloneDeep, get, isEqual, set, omit as omit$2, merge as merge$1, debounce as debounce$2, isUndefined as isUndefined$1, uniqueId, isString as isString$1, isFunction as isFunction$4, isNumber as isNumber$1, upperFirst, sum, flatMap } from "lodash";
65
- import { Form, Input, Modal, Collapse, Space, Empty, Card, Grid, Button as Button$2, Drawer, Switch, Typography as Typography$1, Tabs, Radio, Divider as Divider$2, Alert, Popconfirm, Tooltip, Message, PageHeader, Spin, Layout as Layout$2, Popover, Select as Select$1, Slider, InputNumber, Tag, Link as Link$3, List as List$1, Skeleton } from "@arco-design/web-react";
66
65
  import { nanoid } from "nanoid";
67
- import { IconDelete, IconEdit, IconLeft, IconCopy, IconUndo, IconRedo, IconPlus, IconMinus, IconEye, IconSubscribeAdd, IconClose, IconCheckCircleFill, IconDragArrow, IconLock, IconUnlock, IconQuestionCircle, IconLink, IconCloud, IconSend, IconDown } from "@arco-design/web-react/icon";
66
+ import { Form, Input, Modal, Collapse, Space, Empty, Card, Grid, Button as Button$2, Drawer, Switch, Typography as Typography$1, Tabs, Radio, Divider as Divider$2, Alert, Popconfirm, Tooltip, Message, PageHeader, Spin, Layout as Layout$2, Popover, Select as Select$1, Slider, InputNumber, Tag, Link as Link$3, List as List$1, Skeleton, Trigger } from "@arco-design/web-react";
67
+ import { IconPlus, IconDelete, IconEdit, IconLeft, IconCopy, IconUndo, IconRedo, IconMinus, IconEye, IconSubscribeAdd, IconClose, IconCheckCircleFill, IconDragArrow, IconLock, IconUnlock, IconQuestionCircle, IconLink, IconCloud, IconSend, IconDown } from "@arco-design/web-react/icon";
68
68
  import mjml from "mjml-browser";
69
69
  import { renderToStaticMarkup } from "react-dom/server";
70
70
  import { HistoryEditor } from "slate-history";
@@ -512,7 +512,7 @@ const styleText$g = `@font-face {
512
512
  }
513
513
 
514
514
  `;
515
- const RetroStyleText = '[data-slate-block=page] {\n min-height: 300px;\n}\n\n[data-slate-category=navbar]::after,\n[data-slate-category=social]::after {\n content: "";\n left: 0;\n top: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n cursor: default;\n}\n\n[data-slate-hover=true] {\n z-index: 4;\n}\n\n[data-slate-focus=true] {\n z-index: 3;\n}\n\n[data-slate-selected=true] {\n z-index: 3;\n}\n\n[data-slate-hover=true] .element-tools-container {\n z-index: 4;\n}\n\n[data-slate-selected=true] .element-tools-container {\n z-index: 4;\n}\n\n[data-slate-void=true] [data-slate-node=element][data-slate-block=button]:hover,\n[data-slate-void=true] [data-slate-node=element][data-slate-block=text]:hover {\n outline: 2px solid var(--hover-color);\n}\n\n.text-mergetag {\n outline: 1px solid rgb(78, 89, 105);\n outline-offset: 1px;\n padding: 0 2px;\n border-radius: 2px;\n cursor: pointer;\n transition: all 0.1s linear;\n border: none;\n font-weight: inherit;\n outline-color: #00a0ac;\n color: inherit;\n background-color: #ebf9fc;\n max-width: 10em;\n font-style: inherit;\n text-decoration-line: inherit;\n position: relative;\n}\n\n.text-mergetag [data-slate-string=true] {\n font-size: 0px;\n}\n\nbody .element-tools-container {\n outline: 2px solid var(--hover-color);\n z-index: 1;\n}\n\nbody .element-tools-container .element-tools {\n color: #fff;\n background-color: var(--hover-color);\n}\n\nbody .element-tools-container .element-drag-button {\n background-color: var(--hover-color);\n}\n\n[data-layer-dragging=true] .element-tools-container {\n opacity: 0;\n}\n\n[data-is-dragging=true] .element-tools-container {\n opacity: 0;\n}\n\n#dragging-placeholder .element-tools-container {\n opacity: 1 !important;\n}\n\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}\n\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}\n\n[data-slate-type=placeholder] .element-delete:hover {\n background-color: rgb(180, 187, 195);\n opacity: 1;\n}\n\n[data-slate-type=placeholder] .element-delete svg {\n width: 20px;\n height: 20px;\n}\n\n[data-slate-universal-editing=true] {\n z-index: 2;\n}\n\n.universal-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n}\n\n.unset-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n[data-slate-universal-editing=true] .universal-element-mask {\n display: none;\n}\n\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}\n\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}\n\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}';
515
+ const RetroStyleText = '[data-slate-block=page] {\n min-height: 300px;\n}\n\n[data-slate-category=navbar]::after,\n[data-slate-category=social]::after {\n content: "";\n left: 0;\n top: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n cursor: default;\n}\n\n[data-slate-hover=true] {\n z-index: 4;\n}\n\n[data-slate-focus=true] {\n z-index: 3;\n}\n\n[data-slate-selected=true] {\n z-index: 3;\n}\n\n[data-slate-hover=true] .element-tools-container {\n z-index: 4;\n}\n\n[data-slate-selected=true] .element-tools-container {\n z-index: 4;\n}\n\n[data-slate-void=true] [data-slate-node=element][data-slate-block=button]:hover,\n[data-slate-void=true] [data-slate-node=element][data-slate-block=text]:hover {\n outline: 2px solid var(--hover-color);\n}\n\n.text-mergetag {\n outline: 1px solid rgb(78, 89, 105);\n outline-offset: 1px;\n padding: 0 2px;\n border-radius: 2px;\n cursor: pointer;\n transition: all 0.1s linear;\n border: none;\n font-weight: inherit;\n outline-color: #00a0ac;\n color: inherit;\n background-color: #ebf9fc;\n max-width: 10em;\n font-style: inherit;\n text-decoration-line: inherit;\n position: relative;\n}\n\n.text-mergetag [data-slate-string=true] {\n font-size: 0px;\n}\n\nbody .element-tools-container {\n outline: 2px solid var(--hover-color);\n z-index: 1;\n}\n\nbody .element-tools-container .element-tools {\n color: #fff;\n background-color: var(--hover-color);\n}\n\nbody .element-tools-container .element-drag-button {\n background-color: var(--hover-color);\n}\n\n[data-layer-dragging=true] .element-tools-container {\n opacity: 0;\n}\n\n[data-is-dragging=true] .element-tools-container {\n opacity: 0;\n}\n\n#dragging-placeholder .element-tools-container {\n opacity: 1 !important;\n}\n\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}\n\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}\n\n[data-slate-type=placeholder] .element-delete:hover {\n background-color: rgb(180, 187, 195);\n opacity: 1;\n}\n\n[data-slate-type=placeholder] .element-delete svg {\n width: 20px;\n height: 20px;\n}\n\n[data-slate-universal-editing=true] {\n z-index: 2;\n}\n\n.standalone-element-mask,\n.universal-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n}\n\n.unset-element-mask {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n[data-slate-universal-editing=true] .universal-element-mask,\n[data-slate-standalone-editing=true] .standalone-element-mask {\n display: none;\n}\n\n[data-slate-universal-editing=true] .universal-element-editing-mask,\n[data-slate-standalone-editing=true] .standalone-element-editing-mask {\n z-index: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n inset: 0px;\n}\n\n[data-slate-universal-editing=true] .universal-element-editing-mask::before,\n[data-slate-standalone-editing=true] .standalone-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}\n\n[data-slate-universal-editing=true] .universal-element-editing-mask::after,\n[data-slate-standalone-editing=true] .standalone-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}';
516
516
  const withTheme$1 = (editor) => {
517
517
  const { insertBreak, normalizeNode, deleteBackward, apply: apply2, insertSoftBreak } = editor;
518
518
  editor.insertBreak = (...args) => {
@@ -588,6 +588,25 @@ const withTheme$1 = (editor) => {
588
588
  if (touchElements.length === 1 && parentEle.children.length === 1) {
589
589
  return;
590
590
  }
591
+ } else if (NodeUtils.isStandaloneElement(parentEle)) {
592
+ if (parentEle.children.length === 1) {
593
+ const clonedNode = cloneDeep(currentNode);
594
+ const loopChildren = (node) => {
595
+ if (NodeUtils.isTextNode(node)) {
596
+ node.text = "";
597
+ return;
598
+ }
599
+ if (node.children) {
600
+ node.children.forEach(loopChildren);
601
+ }
602
+ };
603
+ loopChildren(clonedNode);
604
+ editor.replaceNode({
605
+ node: clonedNode,
606
+ path: removePath
607
+ });
608
+ return;
609
+ }
591
610
  }
592
611
  apply2({
593
612
  type: "remove_node",
@@ -677,6 +696,23 @@ function IconFont(props) {
677
696
  }
678
697
  );
679
698
  }
699
+ const assignIdsToElementTree = (element, overwrite = false) => {
700
+ const newElement = cloneDeep(element);
701
+ const loop2 = (node) => {
702
+ if (NodeUtils.isElement(node)) {
703
+ if (overwrite) {
704
+ node.id = nanoid();
705
+ } else {
706
+ node.id = node.id || nanoid();
707
+ }
708
+ if (node.children) {
709
+ node.children.forEach(loop2);
710
+ }
711
+ }
712
+ };
713
+ loop2(newElement);
714
+ return newElement;
715
+ };
680
716
  const DraggingProviderContext = React__default.createContext({});
681
717
  const DraggingProvider = ({
682
718
  children
@@ -687,12 +723,14 @@ const DraggingProvider = ({
687
723
  setDragoverNodePath,
688
724
  setHoverNodePath,
689
725
  dragNodePath,
690
- setSelectedNodePath
726
+ setSelectedNodePath,
727
+ standaloneElementEditing
691
728
  } = useEditorState();
692
729
  const editorProps = useEditorProps();
693
730
  const quantityLimitCheck = useRefState(editorProps.quantityLimitCheck);
694
731
  const editor = useSlate();
695
732
  const [inited, setInited] = useState(false);
733
+ const [isDragging, setIsDragging] = useState(false);
696
734
  let root2 = null;
697
735
  try {
698
736
  root2 = ReactEditor.getWindow(editor).document;
@@ -720,7 +758,7 @@ const DraggingProvider = ({
720
758
  clearInterval(timer);
721
759
  };
722
760
  }, [editor]);
723
- const isDragging = useRefState(dragNodePath);
761
+ const isElementDragging = useRefState(dragNodePath);
724
762
  const removePlaceholder = useCallback(() => {
725
763
  var _a;
726
764
  const rootDoc = ReactEditor.getWindow(editor).document;
@@ -772,6 +810,17 @@ const DraggingProvider = ({
772
810
  removeSelectedStyle();
773
811
  return;
774
812
  }
813
+ if (!standaloneElementEditing) {
814
+ const [standaloneElementEntry] = Editor.nodes(editor, {
815
+ at: dropPath,
816
+ match: (node2) => {
817
+ return NodeUtils.isStandaloneElement(node2);
818
+ }
819
+ });
820
+ if (standaloneElementEntry) {
821
+ return;
822
+ }
823
+ }
775
824
  const [dropNodeEntry] = Editor.nodes(editor, {
776
825
  at: dropPath,
777
826
  match: (node2, path2) => {
@@ -862,6 +911,7 @@ const DraggingProvider = ({
862
911
  };
863
912
  const onDrop = (ev) => {
864
913
  removePlaceholder();
914
+ setIsDragging(false);
865
915
  const propsData = propsDataRef.current;
866
916
  if (!propsData)
867
917
  return;
@@ -993,7 +1043,10 @@ const DraggingProvider = ({
993
1043
  }, 0);
994
1044
  }
995
1045
  } else {
996
- const cloneElement2 = cloneDeep(propsData.element);
1046
+ const cloneElement2 = assignIdsToElementTree(
1047
+ cloneDeep(propsData.element),
1048
+ true
1049
+ );
997
1050
  if (isInsert) {
998
1051
  targetPath = [...targetPath, 0];
999
1052
  Transforms.insertNodes(editor, cloneElement2, {
@@ -1015,7 +1068,7 @@ const DraggingProvider = ({
1015
1068
  setHoverNodePath(null);
1016
1069
  };
1017
1070
  const onMousemove = (event) => {
1018
- if (isDragging.current) {
1071
+ if (isElementDragging.current) {
1019
1072
  removeDraggingStyle();
1020
1073
  setHoverNodePath(null);
1021
1074
  removePlaceholder();
@@ -1033,14 +1086,15 @@ const DraggingProvider = ({
1033
1086
  editor,
1034
1087
  editorProps.readOnly,
1035
1088
  inited,
1036
- isDragging,
1089
+ isElementDragging,
1037
1090
  quantityLimitCheck,
1038
1091
  removeDraggingStyle,
1039
1092
  removePlaceholder,
1040
1093
  root2,
1041
1094
  setDragoverNodePath,
1042
1095
  setHoverNodePath,
1043
- setSelectedNodePath
1096
+ setSelectedNodePath,
1097
+ standaloneElementEditing
1044
1098
  ]);
1045
1099
  const dragHandle = useMemo(() => {
1046
1100
  return {
@@ -1075,11 +1129,13 @@ const DraggingProvider = ({
1075
1129
  if ((propsData == null ? void 0 : propsData.action) === "move") {
1076
1130
  setDragNodePath(ReactEditor.findPath(editor, propsData.element));
1077
1131
  }
1132
+ setIsDragging(true);
1078
1133
  },
1079
1134
  onDragEnd() {
1080
1135
  removeDraggingStyle();
1081
1136
  setHoverNodePath(null);
1082
1137
  removePlaceholder();
1138
+ setIsDragging(false);
1083
1139
  },
1084
1140
  draggable: true
1085
1141
  };
@@ -1094,9 +1150,10 @@ const DraggingProvider = ({
1094
1150
  const value = useMemo(() => {
1095
1151
  return {
1096
1152
  propsDataRef,
1097
- dragHandle
1153
+ dragHandle,
1154
+ isDragging
1098
1155
  };
1099
- }, [dragHandle]);
1156
+ }, [dragHandle, isDragging]);
1100
1157
  return /* @__PURE__ */ React__default.createElement(DraggingProviderContext.Provider, { value }, children);
1101
1158
  };
1102
1159
  const loop$1 = () => {
@@ -1581,23 +1638,6 @@ const useElementDefault = ({
1581
1638
  mobileAttributes
1582
1639
  };
1583
1640
  };
1584
- const assignIdsToElementTree = (element, overwrite = false) => {
1585
- const newElement = cloneDeep(element);
1586
- const loop2 = (node) => {
1587
- if (NodeUtils.isElement(node)) {
1588
- if (overwrite) {
1589
- node.id = nanoid();
1590
- } else {
1591
- node.id = node.id || nanoid();
1592
- }
1593
- if (node.children) {
1594
- node.children.forEach(loop2);
1595
- }
1596
- }
1597
- };
1598
- loop2(newElement);
1599
- return newElement;
1600
- };
1601
1641
  const useElementInteract = () => {
1602
1642
  const editor = useSlate();
1603
1643
  const { setSelectedNodePath, setHoverNodePath, selectedNodePath, lock } = useEditorState();
@@ -1770,7 +1810,7 @@ const defaultFontList = [
1770
1810
  ].map((item2) => ({ value: item2, label: item2 }));
1771
1811
  function useFontFamily() {
1772
1812
  const { fontList: propsFontList } = useEditorProps();
1773
- const { values } = useEditorContext();
1813
+ const { values, setFieldValue } = useEditorContext();
1774
1814
  const addFonts = values.content.data.fonts;
1775
1815
  const fontList = useMemo(() => {
1776
1816
  const fonts = [];
@@ -1793,8 +1833,35 @@ function useFontFamily() {
1793
1833
  href: item2.href
1794
1834
  }));
1795
1835
  }, [addFonts, propsFontList]);
1836
+ const addFont = (val) => {
1837
+ const webFontList = val.split(",").map((item2) => {
1838
+ const match = fontList.find(
1839
+ (font) => font.value === item2 && !!font.href
1840
+ );
1841
+ if (!match)
1842
+ return null;
1843
+ return {
1844
+ name: match.value,
1845
+ label: match.label,
1846
+ href: match.href
1847
+ };
1848
+ }).filter(Boolean);
1849
+ if (webFontList.length > 0) {
1850
+ const fonts = cloneDeep(values.content.data.fonts || []);
1851
+ webFontList.forEach((item2) => {
1852
+ if (!fonts.find((font) => font.name === item2.name)) {
1853
+ fonts.push({
1854
+ name: item2.name,
1855
+ href: item2.href
1856
+ });
1857
+ }
1858
+ });
1859
+ setFieldValue([0], "data.fonts", fonts);
1860
+ }
1861
+ };
1796
1862
  return {
1797
- fontList
1863
+ fontList,
1864
+ addFont
1798
1865
  };
1799
1866
  }
1800
1867
  const useEditorThemeState = () => {
@@ -1932,6 +1999,12 @@ const MinimalistProvider = ({ children }) => {
1932
1999
  columnsOverlay,
1933
2000
  imageUploaderOverlay,
1934
2001
  moreActionsMenusOverlay,
2002
+ serColumnsOverlayVisible,
2003
+ serImageUploaderOverlayPosition,
2004
+ serImageUploaderOverlayVisible,
2005
+ setBlockMenusOverlayVisible,
2006
+ setMoreActionsMenusOverlayPosition,
2007
+ setMoreActionsMenusOverlayVisible,
1935
2008
  setSearch
1936
2009
  ]);
1937
2010
  return /* @__PURE__ */ React__default.createElement(MinimalistContext.Provider, { value: data }, children);
@@ -1951,7 +2024,14 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
1951
2024
  showPreviousLevelIcon
1952
2025
  } = useEditorProps();
1953
2026
  const { open } = useUniversalContent();
1954
- const { setSelectedNodePath, universalElementEditing, universalElementPath } = useEditorState();
2027
+ const {
2028
+ setSelectedNodePath,
2029
+ selectedNodePath,
2030
+ universalElementEditing,
2031
+ universalElementPath,
2032
+ standaloneElementEditing,
2033
+ standaloneElementPath
2034
+ } = useEditorState();
1955
2035
  const isPage = NodeUtils.isPageElement(element);
1956
2036
  const { dragHandle } = useDragging({
1957
2037
  element,
@@ -2006,8 +2086,19 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
2006
2086
  ).category.includes(ElementCategory.WRAPPER);
2007
2087
  const isFullWidth = get(element, "attributes.full-width") === "full-width";
2008
2088
  const isTopEnough = nodeElement.getBoundingClientRect().top >= 60;
2009
- const isUniversalElement = NodeUtils.isUniversalElement(element);
2089
+ NodeUtils.isUniversalElement(element);
2010
2090
  const isEditingUniversalElement = universalElementPath && Path.equals(universalElementPath, path2) && universalElementEditing;
2091
+ const isEditingStandaloneElement = standaloneElementPath && Path.equals(standaloneElementPath, path2) && standaloneElementEditing;
2092
+ const isChildOfUniversalElement = universalElementPath && selectedNodePath && Path.isAncestor(universalElementPath, selectedNodePath);
2093
+ const isChildOfStandaloneElement = standaloneElementPath && selectedNodePath && Path.isAncestor(standaloneElementPath, selectedNodePath);
2094
+ let isHideBackIcon = false;
2095
+ if (universalElementPath && !isChildOfUniversalElement) {
2096
+ isHideBackIcon = true;
2097
+ }
2098
+ if (standaloneElementPath && !isChildOfStandaloneElement) {
2099
+ isHideBackIcon = true;
2100
+ }
2101
+ const hideAddToCollection = universalElementEditing || standaloneElementEditing;
2011
2102
  const renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
2012
2103
  "div",
2013
2104
  {
@@ -2035,13 +2126,13 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
2035
2126
  },
2036
2127
  /* @__PURE__ */ React__default.createElement(
2037
2128
  "div",
2038
- __spreadProps(__spreadValues({}, isEditingUniversalElement ? {} : dragHandle), {
2129
+ __spreadProps(__spreadValues({}, isEditingUniversalElement || isEditingStandaloneElement ? {} : dragHandle), {
2039
2130
  style: {
2040
- cursor: isEditingUniversalElement ? "default" : "grab",
2131
+ cursor: isEditingUniversalElement || isEditingStandaloneElement ? "default" : "grab",
2041
2132
  display: "flex"
2042
2133
  }
2043
2134
  }),
2044
- isUniversalElement && /* @__PURE__ */ React__default.createElement(
2135
+ !universalElementEditing && !standaloneElementEditing && /* @__PURE__ */ React__default.createElement(
2045
2136
  IconFont,
2046
2137
  {
2047
2138
  iconName: "icon-start",
@@ -2057,23 +2148,16 @@ const ElementTools$1 = ({ element, nodeElement, path: path2 }) => {
2057
2148
  nodeElement,
2058
2149
  path: path2
2059
2150
  }
2060
- ) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, showPreviousLevelIcon && !isPage && /* @__PURE__ */ React__default.createElement(
2151
+ ) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, showPreviousLevelIcon && !isPage && !isHideBackIcon && /* @__PURE__ */ React__default.createElement(
2061
2152
  "div",
2062
2153
  {
2063
2154
  className: "element-tools-item",
2064
2155
  onPointerDown: onSelectParent
2065
2156
  },
2066
2157
  /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-back-parent" })
2067
- ), !isEditingUniversalElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onCopy }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-copy" })), universalElementSetting && !universalElementEditing && !isUniversalElement && /* @__PURE__ */ React__default.createElement(
2068
- "div",
2069
- {
2070
- className: "element-tools-item",
2071
- onPointerDown: openModal
2072
- },
2073
- /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-collection" })
2074
- ), !isEditingUniversalElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onDelete }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-delete" })))
2158
+ ), !isEditingUniversalElement && !isEditingStandaloneElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onCopy }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-copy" })), !hideAddToCollection && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: openModal }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-collection" })), !isEditingUniversalElement && !isEditingStandaloneElement && /* @__PURE__ */ React__default.createElement("div", { className: "element-tools-item", onPointerDown: onDelete }, /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-delete" })))
2075
2159
  ),
2076
- showDragMoveIcon && !isEditingUniversalElement && /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: "element-tools-move-handle" }, dragHandleV2), /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-move" }))
2160
+ showDragMoveIcon && !isEditingUniversalElement && !isEditingStandaloneElement && /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: "element-tools-move-handle" }, dragHandleV2), /* @__PURE__ */ React__default.createElement(IconFont, { iconName: "icon-move" }))
2077
2161
  ), /* @__PURE__ */ React__default.createElement("div", { className: "element-dragover" }), /* @__PURE__ */ React__default.createElement("style", null, styleText$f));
2078
2162
  const isContentElement = NodeUtils.isContentElement(element);
2079
2163
  if (isContentElement) {
@@ -2182,13 +2266,15 @@ const UniversalListItem = ({
2182
2266
  )
2183
2267
  );
2184
2268
  };
2185
- const index$c = "";
2269
+ const index$e = "";
2186
2270
  function BlockItem({
2187
2271
  type,
2188
2272
  payload,
2189
2273
  title,
2190
2274
  icon,
2191
- universalElementEditing
2275
+ universalElementEditing,
2276
+ standaloneElementEditing,
2277
+ initialStandaloneElement
2192
2278
  }) {
2193
2279
  const block = BlockManager.getBlockByType(type);
2194
2280
  if (!block) {
@@ -2203,9 +2289,30 @@ function BlockItem({
2203
2289
  });
2204
2290
  if (universalElementEditing && !NodeUtils.isContentElement(element))
2205
2291
  return null;
2206
- return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: "block-list-grid-item" }, dragHandle), /* @__PURE__ */ React__default.createElement("div", { className: "blockItemContainer" }, /* @__PURE__ */ React__default.createElement("div", null, icon), /* @__PURE__ */ React__default.createElement("div", { style: { width: "100%" } }, !isUndefined$1(title) ? title : block == null ? void 0 : block.name)));
2292
+ if (standaloneElementEditing && initialStandaloneElement && !NodeUtils.isParentCategoryType(element.type, initialStandaloneElement.type))
2293
+ return null;
2294
+ const displayTitle = !isUndefined$1(title) ? title : block == null ? void 0 : block.name;
2295
+ return /* @__PURE__ */ React__default.createElement("div", { className: "block-list-grid-item" }, /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: "blockItemContainer" }, dragHandle), /* @__PURE__ */ React__default.createElement("div", null, icon), /* @__PURE__ */ React__default.createElement("div", { style: { width: "100%" } }, displayTitle)), /* @__PURE__ */ React__default.createElement(
2296
+ SharedComponents.ElementStyleGallery,
2297
+ {
2298
+ type,
2299
+ payload,
2300
+ title: displayTitle
2301
+ },
2302
+ /* @__PURE__ */ React__default.createElement(
2303
+ "div",
2304
+ {
2305
+ className: "block-list-grid-item-more",
2306
+ onPointerDown: (e) => {
2307
+ e.stopPropagation();
2308
+ e.preventDefault();
2309
+ }
2310
+ },
2311
+ /* @__PURE__ */ React__default.createElement(IconPlus, null)
2312
+ )
2313
+ ));
2207
2314
  }
2208
- const index$b = "";
2315
+ const index$d = "";
2209
2316
  const LayoutItem = ({
2210
2317
  columns,
2211
2318
  title
@@ -2262,7 +2369,7 @@ const ColumnElement = ({ column: column2 }) => {
2262
2369
  );
2263
2370
  }))));
2264
2371
  };
2265
- const index$a = "";
2372
+ const index$c = "";
2266
2373
  const defaultCategories = [
2267
2374
  {
2268
2375
  get label() {
@@ -2439,7 +2546,11 @@ const BlockList = ({ tab }) => {
2439
2546
  };
2440
2547
  const DefaultBlockList = () => {
2441
2548
  const editorProps = useEditorProps();
2442
- const { universalElementEditing } = useEditorState();
2549
+ const {
2550
+ universalElementEditing,
2551
+ standaloneElementEditing,
2552
+ initialStandaloneElement
2553
+ } = useEditorState();
2443
2554
  const categories = editorProps.categories || defaultCategories;
2444
2555
  const defaultActiveKey = useMemo(
2445
2556
  () => [
@@ -2471,6 +2582,8 @@ const DefaultBlockList = () => {
2471
2582
  BlockItem,
2472
2583
  __spreadValues({
2473
2584
  universalElementEditing,
2585
+ standaloneElementEditing,
2586
+ initialStandaloneElement,
2474
2587
  key: index22
2475
2588
  }, item2)
2476
2589
  );
@@ -2478,6 +2591,12 @@ const DefaultBlockList = () => {
2478
2591
  );
2479
2592
  }
2480
2593
  if (category2.displayType === "column" && !universalElementEditing) {
2594
+ if (standaloneElementEditing && initialStandaloneElement && !NodeUtils.isParentCategoryType(
2595
+ ElementType.SECTION,
2596
+ initialStandaloneElement.type
2597
+ )) {
2598
+ return null;
2599
+ }
2481
2600
  return /* @__PURE__ */ React__default.createElement(
2482
2601
  Collapse.Item,
2483
2602
  {
@@ -2504,7 +2623,7 @@ const DefaultBlockList = () => {
2504
2623
  /* @__PURE__ */ React__default.createElement(Space, { direction: "vertical" }, /* @__PURE__ */ React__default.createElement("div", null))
2505
2624
  );
2506
2625
  }
2507
- if (category2.displayType === "custom" && !universalElementEditing) {
2626
+ if (category2.displayType === "custom" && !universalElementEditing && !standaloneElementEditing) {
2508
2627
  return /* @__PURE__ */ React__default.createElement(
2509
2628
  Collapse.Item,
2510
2629
  {
@@ -2526,6 +2645,8 @@ const DefaultBlockList = () => {
2526
2645
  defaultActiveKey,
2527
2646
  editorProps.compact,
2528
2647
  editorProps.widgetMode,
2648
+ initialStandaloneElement,
2649
+ standaloneElementEditing,
2529
2650
  universalElementEditing
2530
2651
  ]);
2531
2652
  };
@@ -6934,7 +7055,7 @@ function ComponentItem({
6934
7055
  text = childrenText;
6935
7056
  }
6936
7057
  return text;
6937
- }, [label]);
7058
+ }, [component.block, label]);
6938
7059
  return /* @__PURE__ */ React__default.createElement("div", { className: styles$3.item, onClick }, /* @__PURE__ */ React__default.createElement("div", { className: styles$3.itemContent }, /* @__PURE__ */ React__default.createElement("div", { className: styles$3.itemTitle }, /* @__PURE__ */ React__default.createElement(
6939
7060
  "div",
6940
7061
  {
@@ -7061,7 +7182,12 @@ const BlockLayer = () => {
7061
7182
  ));
7062
7183
  };
7063
7184
  const BlockSideBar = ({ height }) => {
7064
- const { setSelectedNodePath, selectedNodePath, universalElementEditing } = useEditorState();
7185
+ const {
7186
+ setSelectedNodePath,
7187
+ selectedNodePath,
7188
+ universalElementEditing,
7189
+ standaloneElementEditing
7190
+ } = useEditorState();
7065
7191
  const { showLayer, compact, widgetMode } = useEditorProps();
7066
7192
  const { selectedNode } = useSelectedNode();
7067
7193
  const [activeTab, setActiveTab] = useState("Content");
@@ -7102,6 +7228,20 @@ const BlockSideBar = ({ height }) => {
7102
7228
  onClose
7103
7229
  }
7104
7230
  ), /* @__PURE__ */ React__default.createElement("style", null, stylesText$1));
7231
+ } else if (standaloneElementEditing) {
7232
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
7233
+ SharedComponents.FullHeightOverlayScrollbars,
7234
+ {
7235
+ height: `calc(${height} - 60px)`
7236
+ },
7237
+ /* @__PURE__ */ React__default.createElement(BlocksPanel, null)
7238
+ ), !compact && /* @__PURE__ */ React__default.createElement(
7239
+ SharedComponents.ConfigurationDrawer,
7240
+ {
7241
+ height: `calc(${height} - 60px)`,
7242
+ onClose
7243
+ }
7244
+ ), /* @__PURE__ */ React__default.createElement("style", null, stylesText$1));
7105
7245
  }
7106
7246
  const isCustomizeUI = EditorAuth.getFeatureEnabled("CUSTOM_UI");
7107
7247
  const isWidgetModeEnabled = EditorAuth.getFeatureEnabled("STUDIO");
@@ -7176,11 +7316,12 @@ const BlockSideBar = ({ height }) => {
7176
7316
  onChange,
7177
7317
  onClose,
7178
7318
  showLayer,
7319
+ standaloneElementEditing,
7179
7320
  universalElementEditing,
7180
7321
  widgetMode
7181
7322
  ]);
7182
7323
  };
7183
- const index$9 = "";
7324
+ const index$b = "";
7184
7325
  const LayoutItemList = ({
7185
7326
  columns,
7186
7327
  onSelect,
@@ -7297,7 +7438,7 @@ const ColumnLayout = ({
7297
7438
  }
7298
7439
  ));
7299
7440
  };
7300
- const index$8 = "";
7441
+ const index$a = "";
7301
7442
  const UniversalElementPanel = () => {
7302
7443
  const { selectedNodePath } = useSelectedNode();
7303
7444
  const { setUniversalElementPath } = useEditorState();
@@ -7356,7 +7497,9 @@ const ConfigurationPanel = ({
7356
7497
  const {
7357
7498
  selectedNodePath,
7358
7499
  universalElementEditing,
7500
+ standaloneElementEditing,
7359
7501
  universalElementPath,
7502
+ standaloneElementPath,
7360
7503
  lock
7361
7504
  } = useEditorState();
7362
7505
  const { quantityLimitCheck, compact } = useEditorProps();
@@ -7385,7 +7528,8 @@ const ConfigurationPanel = ({
7385
7528
  if (!element || !selectedNodePath)
7386
7529
  return null;
7387
7530
  const isSelectedUniversalElement = universalElementPath && Path.equals(selectedNodePath, universalElementPath);
7388
- const isHideBackIcon = universalElementEditing && compact;
7531
+ const isSelectedStandaloneElement = standaloneElementPath && Path.equals(selectedNodePath, standaloneElementPath);
7532
+ const isHideBackIcon = (universalElementEditing || standaloneElementEditing) && compact;
7389
7533
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
7390
7534
  "div",
7391
7535
  {
@@ -7417,8 +7561,19 @@ const ConfigurationPanel = ({
7417
7561
  )
7418
7562
  }
7419
7563
  ),
7420
- /* @__PURE__ */ React__default.createElement("div", { style: { flex: 1 } }, " ", BlockManager.getBlockTitle(element)),
7421
- !isSelectedUniversalElement && /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(
7564
+ /* @__PURE__ */ React__default.createElement(
7565
+ "div",
7566
+ {
7567
+ style: {
7568
+ flex: 1,
7569
+ textOverflow: "ellipsis",
7570
+ overflow: "hidden",
7571
+ whiteSpace: "nowrap"
7572
+ }
7573
+ },
7574
+ BlockManager.getBlockTitle(element)
7575
+ ),
7576
+ !isSelectedUniversalElement && !isSelectedStandaloneElement && /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(
7422
7577
  Button$2,
7423
7578
  {
7424
7579
  onClick: () => onCopy(selectedNodePath),
@@ -7486,10 +7641,12 @@ const ConfigurationPanel = ({
7486
7641
  isChanged,
7487
7642
  resetSelectedNode,
7488
7643
  onCopy,
7489
- deleteBlock
7644
+ deleteBlock,
7645
+ standaloneElementEditing,
7646
+ standaloneElementPath
7490
7647
  ]);
7491
7648
  };
7492
- const index$7 = "";
7649
+ const index$9 = "";
7493
7650
  const Controller = () => {
7494
7651
  const editor = useSlate();
7495
7652
  const getRoot = () => {
@@ -7624,7 +7781,10 @@ const hoverUnderline = "_hoverUnderline_8d8dl_1";
7624
7781
  const styles$2 = {
7625
7782
  hoverUnderline
7626
7783
  };
7627
- function BlockPaths() {
7784
+ function BlockPaths({
7785
+ standaloneElementPath,
7786
+ universalElementPath
7787
+ }) {
7628
7788
  const { selectedNodePath, setSelectedNodePath } = useSelectedNode();
7629
7789
  const editor = useSlate();
7630
7790
  const paths = useMemo(() => {
@@ -7638,11 +7798,16 @@ function BlockPaths() {
7638
7798
  if (NodeUtils.isPageElement(current)) {
7639
7799
  prev = null;
7640
7800
  } else {
7801
+ if (standaloneElementPath && Path.equals(prev, standaloneElementPath)) {
7802
+ break;
7803
+ } else if (universalElementPath && Path.equals(prev, universalElementPath)) {
7804
+ break;
7805
+ }
7641
7806
  prev = Path.parent(prev);
7642
7807
  }
7643
7808
  }
7644
7809
  return paths2.reverse();
7645
- }, [editor, selectedNodePath]);
7810
+ }, [editor, selectedNodePath, standaloneElementPath, universalElementPath]);
7646
7811
  return useMemo(() => {
7647
7812
  return /* @__PURE__ */ React__default.createElement(
7648
7813
  "div",
@@ -7696,7 +7861,13 @@ const EditorTabs = (props) => {
7696
7861
  ev.preventDefault();
7697
7862
  clearCanvas();
7698
7863
  };
7699
- const { universalElementEditing, lock } = useEditorState();
7864
+ const {
7865
+ universalElementEditing,
7866
+ standaloneElementEditing,
7867
+ standaloneElementPath,
7868
+ universalElementPath,
7869
+ lock
7870
+ } = useEditorState();
7700
7871
  const canPreview = useMemo(() => {
7701
7872
  if (!isUndefined$1(showPreview)) {
7702
7873
  return showPreview;
@@ -7734,7 +7905,7 @@ const EditorTabs = (props) => {
7734
7905
  TabHeader,
7735
7906
  {
7736
7907
  className: "easy-email-pro-editor-tabs",
7737
- right: /* @__PURE__ */ React__default.createElement(Space, null, !universalElementEditing && !readOnly && /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("clear the entire canvas") }, /* @__PURE__ */ React__default.createElement(
7908
+ right: /* @__PURE__ */ React__default.createElement(Space, null, !universalElementEditing && !standaloneElementEditing && !readOnly && /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("clear the entire canvas") }, /* @__PURE__ */ React__default.createElement(
7738
7909
  Button$2,
7739
7910
  {
7740
7911
  className: "easy-email-pro-editor-tabs-clear-btn",
@@ -7756,7 +7927,13 @@ const EditorTabs = (props) => {
7756
7927
  },
7757
7928
  /* @__PURE__ */ React__default.createElement(IconEye, null)
7758
7929
  )))), /* @__PURE__ */ React__default.createElement("div", null)),
7759
- left: /* @__PURE__ */ React__default.createElement("div", null, showBlockPaths && /* @__PURE__ */ React__default.createElement(BlockPaths, null))
7930
+ left: /* @__PURE__ */ React__default.createElement("div", null, showBlockPaths && /* @__PURE__ */ React__default.createElement(
7931
+ BlockPaths,
7932
+ {
7933
+ standaloneElementPath,
7934
+ universalElementPath
7935
+ }
7936
+ ))
7760
7937
  }
7761
7938
  ), /* @__PURE__ */ React__default.createElement(
7762
7939
  "div",
@@ -8155,9 +8332,10 @@ const Hotkeys = () => {
8155
8332
  ]);
8156
8333
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
8157
8334
  };
8158
- const index$6 = "";
8335
+ const index$8 = "";
8159
8336
  const UniversalElementEditorDrawer = ({ children }) => {
8160
8337
  const [loading, setLoading] = React__default.useState(false);
8338
+ const [isEditing, setIsEditing] = React__default.useState(false);
8161
8339
  const editor = useSlate();
8162
8340
  const {
8163
8341
  universalElementEditing,
@@ -8279,25 +8457,24 @@ const UniversalElementEditorDrawer = ({ children }) => {
8279
8457
  {
8280
8458
  style: {
8281
8459
  height: 40,
8282
- position: "absolute",
8283
- width: 300,
8284
- top: 18,
8285
8460
  display: "flex"
8286
8461
  }
8287
8462
  },
8288
- /* @__PURE__ */ React__default.createElement(
8289
- Typography$1.Title,
8463
+ /* @__PURE__ */ React__default.createElement(Space, { style: { width: "100%" }, align: "center" }, isEditing ? /* @__PURE__ */ React__default.createElement(
8464
+ Input,
8290
8465
  {
8291
- heading: 5,
8292
- style: {
8293
- margin: 0
8294
- },
8295
- editable: {
8296
- onChange: onChangeTitle
8297
- }
8466
+ value: universalElement ? BlockManager.getBlockTitle(universalElement) : "",
8467
+ onChange: onChangeTitle,
8468
+ onBlur: () => setIsEditing(false)
8469
+ }
8470
+ ) : /* @__PURE__ */ React__default.createElement("div", null, universalElement ? BlockManager.getBlockTitle(universalElement) : ""), /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("Edit") }, /* @__PURE__ */ React__default.createElement(
8471
+ "div",
8472
+ {
8473
+ style: { cursor: "pointer" },
8474
+ onClick: () => setIsEditing((d) => !d)
8298
8475
  },
8299
- universalElement && BlockManager.getBlockTitle(universalElement)
8300
- )
8476
+ /* @__PURE__ */ React__default.createElement(IconEdit, null)
8477
+ )))
8301
8478
  ),
8302
8479
  extra: /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Space, null, hasChanged ? /* @__PURE__ */ React__default.createElement(
8303
8480
  Popconfirm,
@@ -8343,7 +8520,8 @@ const UniversalElementEditorDrawer = ({ children }) => {
8343
8520
  onChangeTitle,
8344
8521
  onPublishElement,
8345
8522
  universalElement,
8346
- visible
8523
+ visible,
8524
+ isEditing
8347
8525
  ]);
8348
8526
  };
8349
8527
  const PreviewEmail = ({
@@ -14080,7 +14258,7 @@ const HoveringToolbar = () => {
14080
14258
  return /* @__PURE__ */ React__default.createElement("div", null, content);
14081
14259
  }
14082
14260
  return createPortal(
14083
- /* @__PURE__ */ React__default.createElement("div", { style: { position: "fixed", top: 0, left: 0, zIndex: 1 } }, /* @__PURE__ */ React__default.createElement(
14261
+ /* @__PURE__ */ React__default.createElement("div", { style: { position: "fixed", top: 0, left: 0, zIndex: 9999 } }, /* @__PURE__ */ React__default.createElement(
14084
14262
  "div",
14085
14263
  {
14086
14264
  ref,
@@ -15317,6 +15495,7 @@ const TurnInto = () => {
15317
15495
  const RichTextBar$1 = "";
15318
15496
  const MergeTag = React__default.memo(() => {
15319
15497
  const [popupVisible, setPopupVisible] = useState(false);
15498
+ const [mergeTagRef, setMergeTagRef] = useState(null);
15320
15499
  const editor = useSlate();
15321
15500
  const { mergetags } = useEditorProps();
15322
15501
  const formatMergetags = useMemo(() => {
@@ -15334,7 +15513,7 @@ const MergeTag = React__default.memo(() => {
15334
15513
  const onClose = useCallback(() => {
15335
15514
  setPopupVisible(false);
15336
15515
  }, []);
15337
- return /* @__PURE__ */ React__default.createElement(
15516
+ return /* @__PURE__ */ React__default.createElement("div", { ref: setMergeTagRef }, /* @__PURE__ */ React__default.createElement(
15338
15517
  SharedComponents.MergeTagComponent,
15339
15518
  {
15340
15519
  mergetags: formatMergetags,
@@ -15343,6 +15522,7 @@ const MergeTag = React__default.memo(() => {
15343
15522
  onChange,
15344
15523
  onClose,
15345
15524
  value: "",
15525
+ getPopupContainer: mergeTagRef ? () => mergeTagRef : void 0,
15346
15526
  triggerElement: /* @__PURE__ */ React__default.createElement(
15347
15527
  FormatButton,
15348
15528
  {
@@ -15352,7 +15532,7 @@ const MergeTag = React__default.memo(() => {
15352
15532
  }
15353
15533
  )
15354
15534
  }
15355
- );
15535
+ ));
15356
15536
  });
15357
15537
  const TextAlign$1 = () => {
15358
15538
  const editor = useSlate();
@@ -15393,6 +15573,7 @@ const TextAlign$1 = () => {
15393
15573
  };
15394
15574
  const options$7 = ["12px", "14px", "16px", "18px", "24px", "32px", "48px"];
15395
15575
  const FontSize$2 = () => {
15576
+ const [selectRef, setSelectRef] = useState(null);
15396
15577
  const { fontSizeList } = useEditorProps();
15397
15578
  const [fontSizeValue, setFontSizeValue] = useState();
15398
15579
  const { setFieldValue } = useEditorContext();
@@ -15458,7 +15639,7 @@ const FontSize$2 = () => {
15458
15639
  setFieldValue(contentNodePath, "attributes.font-size", val);
15459
15640
  }
15460
15641
  };
15461
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
15642
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { ref: setSelectRef }, /* @__PURE__ */ React__default.createElement(
15462
15643
  Select$1,
15463
15644
  {
15464
15645
  className: "easy-email-pro-font-size",
@@ -15468,18 +15649,20 @@ const FontSize$2 = () => {
15468
15649
  triggerProps: {
15469
15650
  autoAlignPopupWidth: false,
15470
15651
  autoAlignPopupMinWidth: true
15471
- }
15652
+ },
15653
+ getPopupContainer: selectRef ? () => selectRef : void 0
15472
15654
  },
15473
15655
  optionsList.map((option, index2) => {
15474
15656
  return /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: index2, value: option.value }, option.label);
15475
15657
  })
15476
- ), /* @__PURE__ */ React__default.createElement("style", null, `
15658
+ )), /* @__PURE__ */ React__default.createElement("style", null, `
15477
15659
  .easy-email-pro-font-size .arco-select-view { border-width: 0px !important; }
15478
15660
  .easy-email-pro-font-size .arco-select-view-value { font-size: calc(var(--hovering-bar-icon-size) + 1px) !important; }
15479
15661
  `));
15480
15662
  };
15481
15663
  const FontFamily$2 = () => {
15482
- const { fontList } = useFontFamily();
15664
+ const { fontList, addFont } = useFontFamily();
15665
+ const [selectRef, setSelectRef] = useState(null);
15483
15666
  const editor = useSlate();
15484
15667
  const { setFieldValue } = useEditorContext();
15485
15668
  const [fontFamilyValue, setFontFamilyValue] = useState();
@@ -15544,8 +15727,9 @@ const FontFamily$2 = () => {
15544
15727
  } else {
15545
15728
  setFieldValue(contentNodePath, "attributes.font-family", val);
15546
15729
  }
15730
+ addFont(val);
15547
15731
  };
15548
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
15732
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { ref: setSelectRef }, /* @__PURE__ */ React__default.createElement(
15549
15733
  Select$1,
15550
15734
  {
15551
15735
  className: "easy-email-pro-font-family",
@@ -15555,12 +15739,13 @@ const FontFamily$2 = () => {
15555
15739
  triggerProps: {
15556
15740
  autoAlignPopupWidth: false,
15557
15741
  autoAlignPopupMinWidth: true
15558
- }
15742
+ },
15743
+ getPopupContainer: selectRef ? () => selectRef : void 0
15559
15744
  },
15560
15745
  optionsList.map((option, index2) => {
15561
15746
  return /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: index2, value: option.value }, option.label);
15562
15747
  })
15563
- ), /* @__PURE__ */ React__default.createElement("style", null, `
15748
+ )), /* @__PURE__ */ React__default.createElement("style", null, `
15564
15749
  .easy-email-pro-font-family .arco-select-view { border-width: 0px !important; }
15565
15750
  .easy-email-pro-font-family .arco-select-view-value { font-size: calc(var(--hovering-bar-icon-size) + 1px) !important; }
15566
15751
  `));
@@ -24080,7 +24265,7 @@ lib.exports = MasonryComponent;
24080
24265
  lib.exports.default = MasonryComponent;
24081
24266
  var libExports = lib.exports;
24082
24267
  const Masonry$1 = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
24083
- const index$5 = "";
24268
+ const index$7 = "";
24084
24269
  const defaultQueryList = [
24085
24270
  {
24086
24271
  query: "Staff Favorites",
@@ -26389,11 +26574,8 @@ function EditPanelList(props) {
26389
26574
  },
26390
26575
  [list, itemIds]
26391
26576
  );
26392
- const onDragOver = useCallback(
26393
- (event) => {
26394
- },
26395
- [list, props, prevActiveKey, itemIds]
26396
- );
26577
+ const onDragOver = useCallback(() => {
26578
+ }, []);
26397
26579
  const onDragEnd = useCallback(
26398
26580
  (event) => {
26399
26581
  const { active, over } = event;
@@ -27491,35 +27673,11 @@ function Border(props) {
27491
27673
  }, [isEnabledBorder, label, name, path2]);
27492
27674
  }
27493
27675
  function FontFamily$1(props) {
27494
- const { values, setFieldValue, getFieldValue } = useEditorContext();
27495
- const { fontList } = useFontFamily();
27676
+ const { fontList, addFont } = useFontFamily();
27496
27677
  const node = useElementDefault({ path: props.path, type: null });
27497
27678
  const value = get(node, props.name);
27498
27679
  const onChange = useEventCallback((val) => {
27499
- const webFontList = val.split(",").map((item2) => {
27500
- const match = fontList.find(
27501
- (font) => font.value === item2 && !!font.href
27502
- );
27503
- if (!match)
27504
- return null;
27505
- return {
27506
- name: match.value,
27507
- label: match.label,
27508
- href: match.href
27509
- };
27510
- }).filter(Boolean);
27511
- if (webFontList.length > 0) {
27512
- const fonts = cloneDeep(values.content.data.fonts || []);
27513
- webFontList.forEach((item2) => {
27514
- if (!fonts.find((font) => font.name === item2.name)) {
27515
- fonts.push({
27516
- name: item2.name,
27517
- href: item2.href
27518
- });
27519
- }
27520
- });
27521
- setFieldValue([0], "data.fonts", fonts);
27522
- }
27680
+ addFont(val);
27523
27681
  });
27524
27682
  return useMemo(
27525
27683
  () => value ? /* @__PURE__ */ React__default.createElement(Tooltip, { content: Array.isArray(value) ? value.join(",") : value }, /* @__PURE__ */ React__default.createElement(
@@ -28757,7 +28915,7 @@ const ConditionModal = ({
28757
28915
  onOk: form.submit,
28758
28916
  onCancel: onClose,
28759
28917
  style: {
28760
- width: 550
28918
+ width: 750
28761
28919
  }
28762
28920
  },
28763
28921
  /* @__PURE__ */ React__default.createElement(
@@ -28965,20 +29123,18 @@ function ConditionItem({
28965
29123
  placeholder: "customer.country",
28966
29124
  keepName: true
28967
29125
  }
28968
- )), /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 5, style: { paddingLeft: 5 } }, /* @__PURE__ */ React__default.createElement(
29126
+ )), /* @__PURE__ */ React__default.createElement(Grid.Col, { span: hideRight ? 13 : 5, style: { paddingLeft: 5 } }, /* @__PURE__ */ React__default.createElement(
28969
29127
  Form.Item,
28970
29128
  {
28971
29129
  label: t("Operator"),
28972
29130
  field: `${name}.operator`,
28973
29131
  layout: "vertical",
28974
- style: {
28975
- minWidth: 150
28976
- }
29132
+ style: {}
28977
29133
  },
28978
29134
  /* @__PURE__ */ React__default.createElement(Select$1, { options: options$4 }, options$4.map((item2) => {
28979
29135
  return /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: item2.value, value: item2.value }, /* @__PURE__ */ React__default.createElement("div", null, item2.label));
28980
29136
  }))
28981
- )), /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 8, style: { paddingLeft: 5 } }, !hideRight && /* @__PURE__ */ React__default.createElement(
29137
+ )), !hideRight && /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 8, style: { paddingLeft: 5 } }, /* @__PURE__ */ React__default.createElement(
28982
29138
  Form.Item,
28983
29139
  {
28984
29140
  label: t("Value"),
@@ -29084,7 +29240,7 @@ function Iteration({
29084
29240
  )))))
29085
29241
  ));
29086
29242
  }
29087
- const index$4 = "";
29243
+ const index$6 = "";
29088
29244
  const DisplayOptions = ({
29089
29245
  enabledResponsive
29090
29246
  }) => {
@@ -29820,7 +29976,7 @@ const defaultAttributeFields = {
29820
29976
  FieldItem
29821
29977
  };
29822
29978
  const AttributeField = __spreadValues({}, defaultAttributeFields);
29823
- const index$3 = "";
29979
+ const index$5 = "";
29824
29980
  const AttributesPanelWrapper = (props) => {
29825
29981
  return /* @__PURE__ */ React__default.createElement("div", { id: "AttributesPanelWrapper", className: "AttributesPanelWrapper" }, /* @__PURE__ */ React__default.createElement("div", { style: __spreadValues({ padding: "1px 0px" }, props.style) }, props.children));
29826
29982
  };
@@ -30917,6 +31073,20 @@ function SocialItem$1({ index: index2, path: path2 }) {
30917
31073
  name: `attributes.src`
30918
31074
  }
30919
31075
  ), /* @__PURE__ */ React__default.createElement(Divider$2, null), /* @__PURE__ */ React__default.createElement(
31076
+ AttributeField.ColorPickerField,
31077
+ {
31078
+ path: path2,
31079
+ label: t("Background color"),
31080
+ name: `attributes.background-color`
31081
+ }
31082
+ ), /* @__PURE__ */ React__default.createElement(
31083
+ AttributeField.BorderRadius,
31084
+ {
31085
+ path: path2,
31086
+ label: t("Border radius"),
31087
+ name: `attributes.border-radius`
31088
+ }
31089
+ ), /* @__PURE__ */ React__default.createElement(
30920
31090
  AttributeField.TextField,
30921
31091
  {
30922
31092
  path: [...path2, 0],
@@ -31856,6 +32026,7 @@ const ConfigPanelsMap = {
31856
32026
  [ElementType.WRAPPER_WIDGET]: Widget,
31857
32027
  [ElementType.DANGEROUS_CODE]: Code,
31858
32028
  //text
32029
+ [ElementType.TEXT]: Text$1,
31859
32030
  [ElementType.STANDARD_TEXT]: Text$1,
31860
32031
  [ElementType.STANDARD_PARAGRAPH]: Text$1,
31861
32032
  [ElementType.STANDARD_TEXT_LIST]: Text$1,
@@ -31904,7 +32075,12 @@ const AttributePanel = () => {
31904
32075
  }, [Com, nodePath, selectedNode]);
31905
32076
  };
31906
32077
  const ConfigurationSideBar = ({ height }) => {
31907
- const { setSelectedNodePath, selectedNodePath, universalElementEditing } = useEditorState();
32078
+ const {
32079
+ setSelectedNodePath,
32080
+ selectedNodePath,
32081
+ universalElementEditing,
32082
+ standaloneElementEditing
32083
+ } = useEditorState();
31908
32084
  const { compact } = useEditorProps();
31909
32085
  const [activeTab, setActiveTab] = useState("Style");
31910
32086
  const lastActiveTab = useRef(activeTab);
@@ -31920,7 +32096,7 @@ const ConfigurationSideBar = ({ height }) => {
31920
32096
  const onClose = useCallback(() => {
31921
32097
  setActiveTab(lastActiveTab.current);
31922
32098
  }, []);
31923
- if (universalElementEditing) {
32099
+ if (universalElementEditing || standaloneElementEditing) {
31924
32100
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
31925
32101
  SharedComponents.FullHeightOverlayScrollbars,
31926
32102
  {
@@ -32460,7 +32636,7 @@ const MergeTagComponent = React__default.memo((props) => {
32460
32636
  )
32461
32637
  );
32462
32638
  });
32463
- const index$2 = "";
32639
+ const index$4 = "";
32464
32640
  const SvgMoreIcon = (props) => /* @__PURE__ */ React$2.createElement("svg", __spreadValues({ viewBox: "0 0 13 3", style: {
32465
32641
  display: "block",
32466
32642
  fill: "currentColor"
@@ -33248,7 +33424,7 @@ const EditorTopBar = () => {
33248
33424
  )), /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(Button$2.Group, null, /* @__PURE__ */ React__default.createElement(Button$2, { disabled: !undoable }, /* @__PURE__ */ React__default.createElement(Tooltip, { position: "top", content: t("Undo") }, /* @__PURE__ */ React__default.createElement(IconUndo, { width: 40, onClick: editor.undo }))), /* @__PURE__ */ React__default.createElement(Button$2, { disabled: !redoable }, /* @__PURE__ */ React__default.createElement(Tooltip, { position: "top", content: t("Redo") }, /* @__PURE__ */ React__default.createElement(IconRedo, { onClick: editor.redo })))), canPreview && (lock ? /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("Email preview") }, /* @__PURE__ */ React__default.createElement(Button$2, { disabled: lock }, /* @__PURE__ */ React__default.createElement(IconEye, null))) : /* @__PURE__ */ React__default.createElement(SharedComponents.PreviewEmailDrawer, null, /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("Email preview") }, /* @__PURE__ */ React__default.createElement(Button$2, { disabled: lock }, /* @__PURE__ */ React__default.createElement(IconEye, null)))))), /* @__PURE__ */ React__default.createElement("div", null)))
33249
33425
  ), /* @__PURE__ */ React__default.createElement("style", null, styleText$6));
33250
33426
  };
33251
- const index$1 = "";
33427
+ const index$3 = "";
33252
33428
  const PopupCard = (props) => {
33253
33429
  return /* @__PURE__ */ React__default.createElement(
33254
33430
  Popover,
@@ -33627,7 +33803,7 @@ const Link$1 = ({ path: path2, name }) => {
33627
33803
  ))
33628
33804
  );
33629
33805
  };
33630
- const index = "";
33806
+ const index$2 = "";
33631
33807
  const ConfigurationToolbarAttributeField = {
33632
33808
  Image: Image$3,
33633
33809
  Link: Link$1,
@@ -35933,6 +36109,232 @@ const ElementIcon = (_i) => {
35933
36109
  const Icon2 = getElementIcon(type);
35934
36110
  return /* @__PURE__ */ React__default.createElement(Icon2, __spreadValues({}, props));
35935
36111
  };
36112
+ const index$1 = "";
36113
+ const ElementStyles = {};
36114
+ function ElementStyleGallery({
36115
+ type,
36116
+ payload,
36117
+ title,
36118
+ children
36119
+ }) {
36120
+ const { selectedNodePath } = useSelectedNode();
36121
+ const [popupVisible, setPopupVisible] = useState(false);
36122
+ const { isDragging } = useContext(DraggingProviderContext);
36123
+ useEffect(() => {
36124
+ if (isDragging || selectedNodePath) {
36125
+ setPopupVisible(false);
36126
+ }
36127
+ }, [isDragging, selectedNodePath]);
36128
+ const MatchedElement = get(ElementStyles, type);
36129
+ if (!MatchedElement) {
36130
+ console.warn(`ElementStyles: ${type} not found`);
36131
+ return null;
36132
+ }
36133
+ const renderMenu = () => {
36134
+ return /* @__PURE__ */ React__default.createElement(
36135
+ Card,
36136
+ {
36137
+ title: title ? /* @__PURE__ */ React__default.createElement("p", { style: { textAlign: "left" } }, title) : void 0,
36138
+ bodyStyle: { padding: 0 },
36139
+ style: { borderRadius: 4, padding: 0 }
36140
+ },
36141
+ /* @__PURE__ */ React__default.createElement("div", { className: "block-list-menu-item-card-wrapper" }, /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, { maxHeight: "60vh" }, /* @__PURE__ */ React__default.createElement("div", { className: "block-list-menu-item-card" }, /* @__PURE__ */ React__default.createElement(MatchedElement, null))))
36142
+ );
36143
+ };
36144
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
36145
+ Trigger,
36146
+ {
36147
+ popupVisible,
36148
+ popupStyle: {
36149
+ transform: "translate(10px)"
36150
+ },
36151
+ popup: renderMenu,
36152
+ trigger: ["click"],
36153
+ clickToClose: true,
36154
+ position: "rt",
36155
+ autoFitPosition: true,
36156
+ onVisibleChange: setPopupVisible
36157
+ },
36158
+ children
36159
+ ));
36160
+ }
36161
+ const DragItem = ({
36162
+ element,
36163
+ children,
36164
+ style
36165
+ }) => {
36166
+ const { dragHandle } = useDragging({
36167
+ element,
36168
+ nodeElement: null,
36169
+ action: "copy",
36170
+ cloneGhost: false
36171
+ });
36172
+ return /* @__PURE__ */ React__default.createElement("div", __spreadProps(__spreadValues({}, dragHandle), { style }), children);
36173
+ };
36174
+ const index = "";
36175
+ const StandaloneElementEditorDrawer = ({ children }) => {
36176
+ const [isEditing, setIsEditing] = React__default.useState(false);
36177
+ const editor = useSlate();
36178
+ const {
36179
+ standaloneElementEditing,
36180
+ setStandaloneElementPath,
36181
+ setSelectedNodePath,
36182
+ standaloneElementPath,
36183
+ initialStandaloneElement,
36184
+ standaloneElementSaveButton,
36185
+ setStandaloneElementSaveButton
36186
+ } = useEditorState();
36187
+ const standaloneElement = standaloneElementPath && Node.get(editor, standaloneElementPath);
36188
+ const hasChanged = useMemo(() => {
36189
+ if (!standaloneElementPath || !initialStandaloneElement)
36190
+ return false;
36191
+ return !isEqual(standaloneElement, initialStandaloneElement);
36192
+ }, [initialStandaloneElement, standaloneElement, standaloneElementPath]);
36193
+ const { setFieldValue } = useEditorContext();
36194
+ const onChangeTitle = useEventCallback((value) => {
36195
+ if (!standaloneElementPath)
36196
+ return;
36197
+ setFieldValue(standaloneElementPath, "title", value);
36198
+ });
36199
+ const onCancelStandaloneElementEditing = useCallback(() => {
36200
+ if (!hasChanged) {
36201
+ setStandaloneElementPath(null);
36202
+ setSelectedNodePath(null);
36203
+ setStandaloneElementSaveButton(null);
36204
+ return;
36205
+ }
36206
+ editor.replaceNode({
36207
+ path: standaloneElementPath,
36208
+ node: initialStandaloneElement
36209
+ });
36210
+ setTimeout(() => {
36211
+ setStandaloneElementPath(null);
36212
+ setSelectedNodePath(null);
36213
+ setStandaloneElementSaveButton(null);
36214
+ }, 0);
36215
+ }, [
36216
+ editor,
36217
+ hasChanged,
36218
+ initialStandaloneElement,
36219
+ setSelectedNodePath,
36220
+ setStandaloneElementPath,
36221
+ setStandaloneElementSaveButton,
36222
+ standaloneElementPath
36223
+ ]);
36224
+ const visible = standaloneElementEditing;
36225
+ return useMemo(() => {
36226
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !visible && children, /* @__PURE__ */ React__default.createElement(
36227
+ Drawer,
36228
+ {
36229
+ className: "StandaloneElementEditorDrawer",
36230
+ width: "100%",
36231
+ title: null,
36232
+ closable: false,
36233
+ focusLock: false,
36234
+ placement: "left",
36235
+ bodyStyle: { padding: 0, transition: "none" },
36236
+ visible,
36237
+ footer: null
36238
+ },
36239
+ /* @__PURE__ */ React__default.createElement(
36240
+ PageHeader,
36241
+ {
36242
+ backIcon: hasChanged ? /* @__PURE__ */ React__default.createElement(
36243
+ Popconfirm,
36244
+ {
36245
+ focusLock: true,
36246
+ title: t("Do you want to discard?"),
36247
+ okText: t("Discard"),
36248
+ cancelText: t("Cancel"),
36249
+ okButtonProps: {
36250
+ status: "danger"
36251
+ },
36252
+ onOk: () => {
36253
+ onCancelStandaloneElementEditing();
36254
+ }
36255
+ },
36256
+ /* @__PURE__ */ React__default.createElement(IconLeft, { style: { fontSize: 24 } })
36257
+ ) : /* @__PURE__ */ React__default.createElement(
36258
+ IconLeft,
36259
+ {
36260
+ onClick: () => {
36261
+ onCancelStandaloneElementEditing();
36262
+ },
36263
+ style: { fontSize: 24 }
36264
+ }
36265
+ ),
36266
+ className: "StandaloneElementEditorDrawer-header",
36267
+ title: /* @__PURE__ */ React__default.createElement(
36268
+ "div",
36269
+ {
36270
+ style: {
36271
+ height: 40,
36272
+ width: 500,
36273
+ display: "flex"
36274
+ }
36275
+ },
36276
+ /* @__PURE__ */ React__default.createElement(Space, { style: { width: "100%" }, align: "center" }, isEditing ? /* @__PURE__ */ React__default.createElement(
36277
+ Input,
36278
+ {
36279
+ value: standaloneElement ? BlockManager.getBlockTitle(standaloneElement) : "",
36280
+ onChange: onChangeTitle,
36281
+ onBlur: () => setIsEditing(false)
36282
+ }
36283
+ ) : /* @__PURE__ */ React__default.createElement("div", null, standaloneElement ? BlockManager.getBlockTitle(standaloneElement) : ""), /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("Edit") }, /* @__PURE__ */ React__default.createElement(
36284
+ "div",
36285
+ {
36286
+ style: { cursor: "pointer" },
36287
+ onClick: () => setIsEditing((d) => !d)
36288
+ },
36289
+ /* @__PURE__ */ React__default.createElement(IconEdit, null)
36290
+ )))
36291
+ ),
36292
+ extra: /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Space, null, hasChanged ? /* @__PURE__ */ React__default.createElement(
36293
+ Popconfirm,
36294
+ {
36295
+ title: t("Do you want to discard?"),
36296
+ okText: t("Discard"),
36297
+ cancelText: t("Cancel"),
36298
+ okButtonProps: {
36299
+ status: "danger"
36300
+ },
36301
+ onOk: () => {
36302
+ onCancelStandaloneElementEditing();
36303
+ }
36304
+ },
36305
+ /* @__PURE__ */ React__default.createElement(Button$2, null, t(`Cancel`))
36306
+ ) : /* @__PURE__ */ React__default.createElement(
36307
+ Button$2,
36308
+ {
36309
+ onClick: () => {
36310
+ onCancelStandaloneElementEditing();
36311
+ }
36312
+ },
36313
+ t(`Cancel`)
36314
+ ), standaloneElementSaveButton && /* @__PURE__ */ React__default.createElement(Button$2, __spreadValues({}, standaloneElementSaveButton))))
36315
+ }
36316
+ ),
36317
+ visible && children
36318
+ ));
36319
+ }, [
36320
+ visible,
36321
+ children,
36322
+ hasChanged,
36323
+ isEditing,
36324
+ standaloneElement,
36325
+ onChangeTitle,
36326
+ standaloneElementSaveButton,
36327
+ onCancelStandaloneElementEditing
36328
+ ]);
36329
+ };
36330
+ const StandaloneElementSaveButtonPortal = (props) => {
36331
+ const { setStandaloneElementSaveButton } = useEditorState();
36332
+ const cacheProps = useEqualState(props);
36333
+ useEffect(() => {
36334
+ setStandaloneElementSaveButton(cacheProps);
36335
+ }, [cacheProps, setStandaloneElementSaveButton]);
36336
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
36337
+ };
35936
36338
  const SharedComponents = {
35937
36339
  PreviewEmailDrawer,
35938
36340
  PreviewEmail,
@@ -35946,6 +36348,7 @@ const SharedComponents = {
35946
36348
  CollapseWrapper,
35947
36349
  EditorTabs,
35948
36350
  UniversalElementEditorDrawer,
36351
+ StandaloneElementEditorDrawer,
35949
36352
  RichTextBar,
35950
36353
  HoveringToolbar,
35951
36354
  TextHTMLEditor,
@@ -35966,7 +36369,10 @@ const SharedComponents = {
35966
36369
  ConfigurationToolbar,
35967
36370
  AIAssistant,
35968
36371
  AIPromptModal,
35969
- SourceCodePanel
36372
+ SourceCodePanel,
36373
+ DragItem,
36374
+ ElementStyleGallery,
36375
+ StandaloneElementSaveButtonPortal
35970
36376
  };
35971
36377
  const table2SelectedDataType = "data-standard-table2-selected";
35972
36378
  const table2TdSelectedDataType = "data-standard-table2-td-selected";
@@ -36650,6 +37056,7 @@ const ElementPlaceholder$1 = (props) => {
36650
37056
  }
36651
37057
  let isContentElement = NodeUtils.isContentElement(element);
36652
37058
  const isUniversalElement = NodeUtils.isUniversalElement(element);
37059
+ const isStandaloneElement = NodeUtils.isStandaloneElement(element);
36653
37060
  const isUnsetElement = NodeUtils.isUnsetElement(element);
36654
37061
  if (isUnsetElement) {
36655
37062
  renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
@@ -36663,17 +37070,21 @@ const ElementPlaceholder$1 = (props) => {
36663
37070
  },
36664
37071
  renderContent
36665
37072
  ));
36666
- } else if (isUniversalElement) {
36667
- renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "universal-element-mask" }), /* @__PURE__ */ React__default.createElement(
36668
- "div",
36669
- {
36670
- className: "universal-element-editing-mask",
36671
- onMouseMove: (e) => e.stopPropagation(),
36672
- onMouseDown: (e) => e.stopPropagation(),
36673
- onPointerDown: (e) => e.stopPropagation(),
36674
- onClick: (e) => e.stopPropagation()
36675
- }
36676
- ));
37073
+ } else if (isUniversalElement || isStandaloneElement) {
37074
+ if (isUniversalElement) {
37075
+ renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "universal-element-mask" }), /* @__PURE__ */ React__default.createElement(
37076
+ "div",
37077
+ {
37078
+ className: "universal-element-editing-mask",
37079
+ onMouseMove: (e) => e.stopPropagation(),
37080
+ onMouseDown: (e) => e.stopPropagation(),
37081
+ onPointerDown: (e) => e.stopPropagation(),
37082
+ onClick: (e) => e.stopPropagation()
37083
+ }
37084
+ ));
37085
+ } else if (isStandaloneElement) {
37086
+ renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "standalone-element-mask" }), /* @__PURE__ */ React__default.createElement("div", { className: "standalone-element-editing-mask" }));
37087
+ }
36677
37088
  if (isSectionCategory) {
36678
37089
  renderContent = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderContent, /* @__PURE__ */ React__default.createElement("div", { className: "section-category-hover" }));
36679
37090
  }
@@ -36920,9 +37331,9 @@ const Layout$1 = ({ children, footer, header }) => {
36920
37331
  } else {
36921
37332
  setZoom(100);
36922
37333
  }
36923
- }, [isLayerItemDragging, root2]);
37334
+ }, [isLayerItemDragging, root2, setZoom]);
36924
37335
  const layoutContent = useMemo(() => {
36925
- return /* @__PURE__ */ React__default.createElement(SharedComponents.UniversalElementEditorDrawer, null, /* @__PURE__ */ React__default.createElement(
37336
+ return /* @__PURE__ */ React__default.createElement(SharedComponents.StandaloneElementEditorDrawer, null, /* @__PURE__ */ React__default.createElement(SharedComponents.UniversalElementEditorDrawer, null, /* @__PURE__ */ React__default.createElement(
36926
37337
  Card,
36927
37338
  {
36928
37339
  style: { padding: 0, border: "none" },
@@ -36947,7 +37358,12 @@ const Layout$1 = ({ children, footer, header }) => {
36947
37358
  zIndex: 1
36948
37359
  }
36949
37360
  },
36950
- /* @__PURE__ */ React__default.createElement(SharedComponents.WidgetConfigPanel, { containerHeight: height })
37361
+ /* @__PURE__ */ React__default.createElement(
37362
+ SharedComponents.WidgetConfigPanel,
37363
+ {
37364
+ containerHeight: height
37365
+ }
37366
+ )
36951
37367
  ),
36952
37368
  showSidebar && /* @__PURE__ */ React__default.createElement(
36953
37369
  Layout$2.Sider,
@@ -36984,7 +37400,7 @@ const Layout$1 = ({ children, footer, header }) => {
36984
37400
  /* @__PURE__ */ React__default.createElement(SharedComponents.ConfigurationSideBar, { height })
36985
37401
  )
36986
37402
  )
36987
- ));
37403
+ )));
36988
37404
  }, [
36989
37405
  children,
36990
37406
  compact,
@@ -38681,6 +39097,7 @@ export {
38681
39097
  ControllerProvider,
38682
39098
  DraggingProvider,
38683
39099
  DraggingProviderContext,
39100
+ ElementStyles,
38684
39101
  IconFont,
38685
39102
  Minimalist,
38686
39103
  PluginsProvider,
@@ -38689,6 +39106,7 @@ export {
38689
39106
  Retro,
38690
39107
  SharedComponents,
38691
39108
  WidgetTypeOptions,
39109
+ assignIdsToElementTree,
38692
39110
  enhancer,
38693
39111
  getMergeTagsByType,
38694
39112
  mjmlToJson,