easy-email-pro-theme 1.59.2 → 1.59.4

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
@@ -751,6 +751,15 @@ const assignIdsToElementTree = (element, overwrite = false) => {
751
751
  loop2(newElement);
752
752
  return newElement;
753
753
  };
754
+ function shouldInsertAfterHeroSibling({
755
+ canInsertIntoParent,
756
+ canInsertIntoTarget,
757
+ isAutoCompleteEnabled,
758
+ isBottomHalf,
759
+ isHeroTarget
760
+ }) {
761
+ return isAutoCompleteEnabled && isHeroTarget && isBottomHalf && canInsertIntoTarget && canInsertIntoParent;
762
+ }
754
763
  const DraggingProviderContext = React__default.createContext({});
755
764
  const DraggingProvider = ({
756
765
  children
@@ -1037,14 +1046,30 @@ const DraggingProvider = ({
1037
1046
  const node = ReactEditor.toDOMNode(editor, dropElement);
1038
1047
  const rect = node.getBoundingClientRect();
1039
1048
  const isTop = ev.clientY < rect.y + rect.height / 2;
1049
+ const canInsertIntoDropElement = NodeUtils.isParentCategoryType(
1050
+ propsData.element.type,
1051
+ dropElement.type
1052
+ ) && !NodeUtils.isVoidBlockElement(dropElement);
1053
+ const dropParentElement = Node.get(
1054
+ editor,
1055
+ Path.parent(dropPath)
1056
+ );
1057
+ const canInsertIntoDropParent = NodeUtils.isElement(dropParentElement) && NodeUtils.isParentCategoryType(
1058
+ propsData.element.type,
1059
+ dropParentElement.type
1060
+ );
1061
+ const shouldInsertAfterHero = shouldInsertAfterHeroSibling({
1062
+ canInsertIntoParent: canInsertIntoDropParent,
1063
+ canInsertIntoTarget: canInsertIntoDropElement,
1064
+ isAutoCompleteEnabled: Boolean(editorProps.enabledAutoComplete),
1065
+ isBottomHalf: !isTop,
1066
+ isHeroTarget: NodeUtils.isHeroElement(dropElement)
1067
+ });
1040
1068
  let direction = "bottom";
1041
1069
  if (isTop) {
1042
1070
  direction = "top";
1043
1071
  }
1044
- if (NodeUtils.isParentCategoryType(
1045
- propsData.element.type,
1046
- dropElement.type
1047
- ) && !NodeUtils.isVoidBlockElement(dropElement)) {
1072
+ if (canInsertIntoDropElement && !shouldInsertAfterHero) {
1048
1073
  direction = "middle";
1049
1074
  }
1050
1075
  root2.querySelectorAll("[data-slate-dragover='true']").forEach((item2) => {
@@ -1151,10 +1176,25 @@ const DraggingProvider = ({
1151
1176
  const node = ReactEditor.toDOMNode(editor, dropElement);
1152
1177
  const rect = node.getBoundingClientRect();
1153
1178
  const isTop = ev.clientY < rect.y + rect.height / 2;
1154
- const isInsert = NodeUtils.isParentCategoryType(
1179
+ const canInsertIntoDropElement = NodeUtils.isParentCategoryType(
1155
1180
  propsData.element.type,
1156
1181
  dropElement.type
1157
1182
  ) && !NodeUtils.isVoidBlockElement(dropElement);
1183
+ const dropParentElement = Node.get(
1184
+ editor,
1185
+ Path.parent(dropPath)
1186
+ );
1187
+ const canInsertIntoDropParent = NodeUtils.isElement(dropParentElement) && NodeUtils.isParentCategoryType(
1188
+ propsData.element.type,
1189
+ dropParentElement.type
1190
+ );
1191
+ const isInsert = canInsertIntoDropElement && !shouldInsertAfterHeroSibling({
1192
+ canInsertIntoParent: canInsertIntoDropParent,
1193
+ canInsertIntoTarget: canInsertIntoDropElement,
1194
+ isAutoCompleteEnabled: Boolean(editorProps.enabledAutoComplete),
1195
+ isBottomHalf: !isTop,
1196
+ isHeroTarget: NodeUtils.isHeroElement(dropElement)
1197
+ });
1158
1198
  let targetPath = [...dropPath];
1159
1199
  if (propsData.action === "move") {
1160
1200
  if (!source)
@@ -1261,24 +1301,7 @@ const DraggingProvider = ({
1261
1301
  root2 == null ? void 0 : root2.removeEventListener("drop", onDrop);
1262
1302
  root2 == null ? void 0 : root2.removeEventListener("mousemove", onMousemove);
1263
1303
  };
1264
- }, [
1265
- autoScrollConfig,
1266
- dragoverType,
1267
- editor,
1268
- editorProps.readOnly,
1269
- inited,
1270
- isElementDragging,
1271
- quantityLimitCheck,
1272
- removeDraggingStyle,
1273
- removePlaceholder,
1274
- root2,
1275
- rootWindow,
1276
- setDragoverDirection,
1277
- setDragoverNodePath,
1278
- setHoverNodePath,
1279
- setSelectedNodePath,
1280
- standaloneElementEditing
1281
- ]);
1304
+ }, [autoScrollConfig, dragoverType, editor, editorProps.enabledAutoComplete, editorProps.readOnly, inited, isElementDragging, quantityLimitCheck, removeDraggingStyle, removePlaceholder, root2, rootWindow, setDragoverDirection, setDragoverNodePath, setHoverNodePath, setSelectedNodePath, standaloneElementEditing]);
1282
1305
  const dragHandle = useMemo(() => {
1283
1306
  return {
1284
1307
  onPointerDown(event) {
@@ -2129,6 +2152,17 @@ function useFontFamily() {
2129
2152
  const useEditorThemeState = () => {
2130
2153
  return useContext(EditorThemeStateContext);
2131
2154
  };
2155
+ const MAX_COLOR_PICKER_RECORD_SIZE = 10;
2156
+ function getColorPickerList({
2157
+ cacheColors = [],
2158
+ defaultColors = []
2159
+ }) {
2160
+ const cachedColors = cacheColors.filter(Boolean);
2161
+ if (cachedColors.length) {
2162
+ return cachedColors.slice(-MAX_COLOR_PICKER_RECORD_SIZE);
2163
+ }
2164
+ return defaultColors.filter(Boolean).slice(-MAX_COLOR_PICKER_RECORD_SIZE);
2165
+ }
2132
2166
  const CURRENT_COLORS_KEY = "CURRENT_COLORS_KEY";
2133
2167
  const MAX_RECORD_SIZE = 10;
2134
2168
  const colorDivRef = document.createElement("div");
@@ -2154,9 +2188,10 @@ const ColorContext = React__default.createContext(
2154
2188
  );
2155
2189
  const ColorProvider = ({ children }) => {
2156
2190
  const [list, setList] = useState(
2157
- [...defaultPresetColor, ...getCacheColors()].slice(
2158
- -MAX_RECORD_SIZE
2159
- )
2191
+ getColorPickerList({
2192
+ cacheColors: getCacheColors(),
2193
+ defaultColors: defaultPresetColor
2194
+ })
2160
2195
  );
2161
2196
  const addCurrentColor = useCallback(
2162
2197
  debounce$2((newColor) => {
@@ -2174,9 +2209,10 @@ const ColorProvider = ({ children }) => {
2174
2209
  );
2175
2210
  useEffect(() => {
2176
2211
  const timer = setInterval(() => {
2177
- const newColors = [...defaultPresetColor, ...getCacheColors()].slice(
2178
- -MAX_RECORD_SIZE
2179
- );
2212
+ const newColors = getColorPickerList({
2213
+ cacheColors: getCacheColors(),
2214
+ defaultColors: defaultPresetColor
2215
+ });
2180
2216
  setList(newColors);
2181
2217
  }, 1e3);
2182
2218
  return () => {
@@ -8407,7 +8443,7 @@ const BlockSideBar = ({ height }) => {
8407
8443
  destroyOnHide: true,
8408
8444
  key: "AI-Agent",
8409
8445
  className: "easy-email-pro-block-sidebar-ai-agent",
8410
- title: /* @__PURE__ */ React__default.createElement("div", { className: "easy-email-pro-block-sidebar-ai-agent-title" }, t("AI"))
8446
+ title: /* @__PURE__ */ React__default.createElement("div", { className: "easy-email-pro-block-sidebar-ai-agent-title" }, t("Agent"))
8411
8447
  },
8412
8448
  /* @__PURE__ */ React__default.createElement(
8413
8449
  SharedComponents.FullHeightOverlayScrollbars,
@@ -10034,55 +10070,55 @@ const createLucideIcon = (iconName, iconNode) => {
10034
10070
  * This source code is licensed under the ISC license.
10035
10071
  * See the LICENSE file in the root directory of this source tree.
10036
10072
  */
10037
- const __iconNode$q = [
10073
+ const __iconNode$r = [
10038
10074
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
10039
10075
  ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
10040
10076
  ];
10041
- const Clock = createLucideIcon("Clock", __iconNode$q);
10077
+ const Clock = createLucideIcon("Clock", __iconNode$r);
10042
10078
  /**
10043
10079
  * @license lucide-react v0.483.0 - ISC
10044
10080
  *
10045
10081
  * This source code is licensed under the ISC license.
10046
10082
  * See the LICENSE file in the root directory of this source tree.
10047
10083
  */
10048
- const __iconNode$p = [
10084
+ const __iconNode$q = [
10049
10085
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
10050
10086
  ["path", { d: "M12 3v18", key: "108xh3" }]
10051
10087
  ];
10052
- const Columns2 = createLucideIcon("Columns2", __iconNode$p);
10088
+ const Columns2 = createLucideIcon("Columns2", __iconNode$q);
10053
10089
  /**
10054
10090
  * @license lucide-react v0.483.0 - ISC
10055
10091
  *
10056
10092
  * This source code is licensed under the ISC license.
10057
10093
  * See the LICENSE file in the root directory of this source tree.
10058
10094
  */
10059
- const __iconNode$o = [
10095
+ const __iconNode$p = [
10060
10096
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
10061
10097
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
10062
10098
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
10063
10099
  ];
10064
- const Ellipsis = createLucideIcon("Ellipsis", __iconNode$o);
10100
+ const Ellipsis = createLucideIcon("Ellipsis", __iconNode$p);
10065
10101
  /**
10066
10102
  * @license lucide-react v0.483.0 - ISC
10067
10103
  *
10068
10104
  * This source code is licensed under the ISC license.
10069
10105
  * See the LICENSE file in the root directory of this source tree.
10070
10106
  */
10071
- const __iconNode$n = [
10107
+ const __iconNode$o = [
10072
10108
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
10073
10109
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
10074
10110
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
10075
10111
  ["path", { d: "M16 13H8", key: "t4e002" }],
10076
10112
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
10077
10113
  ];
10078
- const FileText = createLucideIcon("FileText", __iconNode$n);
10114
+ const FileText = createLucideIcon("FileText", __iconNode$o);
10079
10115
  /**
10080
10116
  * @license lucide-react v0.483.0 - ISC
10081
10117
  *
10082
10118
  * This source code is licensed under the ISC license.
10083
10119
  * See the LICENSE file in the root directory of this source tree.
10084
10120
  */
10085
- const __iconNode$m = [
10121
+ const __iconNode$n = [
10086
10122
  ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
10087
10123
  ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
10088
10124
  ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
@@ -10090,151 +10126,151 @@ const __iconNode$m = [
10090
10126
  ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
10091
10127
  ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
10092
10128
  ];
10093
- const GripVertical = createLucideIcon("GripVertical", __iconNode$m);
10129
+ const GripVertical = createLucideIcon("GripVertical", __iconNode$n);
10094
10130
  /**
10095
10131
  * @license lucide-react v0.483.0 - ISC
10096
10132
  *
10097
10133
  * This source code is licensed under the ISC license.
10098
10134
  * See the LICENSE file in the root directory of this source tree.
10099
10135
  */
10100
- const __iconNode$l = [
10136
+ const __iconNode$m = [
10101
10137
  ["path", { d: "M4 12h8", key: "17cfdx" }],
10102
10138
  ["path", { d: "M4 18V6", key: "1rz3zl" }],
10103
10139
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
10104
10140
  ["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
10105
10141
  ];
10106
- const Heading1 = createLucideIcon("Heading1", __iconNode$l);
10142
+ const Heading1 = createLucideIcon("Heading1", __iconNode$m);
10107
10143
  /**
10108
10144
  * @license lucide-react v0.483.0 - ISC
10109
10145
  *
10110
10146
  * This source code is licensed under the ISC license.
10111
10147
  * See the LICENSE file in the root directory of this source tree.
10112
10148
  */
10113
- const __iconNode$k = [
10149
+ const __iconNode$l = [
10114
10150
  ["path", { d: "M4 12h8", key: "17cfdx" }],
10115
10151
  ["path", { d: "M4 18V6", key: "1rz3zl" }],
10116
10152
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
10117
10153
  ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
10118
10154
  ];
10119
- const Heading2 = createLucideIcon("Heading2", __iconNode$k);
10155
+ const Heading2 = createLucideIcon("Heading2", __iconNode$l);
10120
10156
  /**
10121
10157
  * @license lucide-react v0.483.0 - ISC
10122
10158
  *
10123
10159
  * This source code is licensed under the ISC license.
10124
10160
  * See the LICENSE file in the root directory of this source tree.
10125
10161
  */
10126
- const __iconNode$j = [
10162
+ const __iconNode$k = [
10127
10163
  ["path", { d: "M4 12h8", key: "17cfdx" }],
10128
10164
  ["path", { d: "M4 18V6", key: "1rz3zl" }],
10129
10165
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
10130
10166
  ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
10131
10167
  ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
10132
10168
  ];
10133
- const Heading3 = createLucideIcon("Heading3", __iconNode$j);
10169
+ const Heading3 = createLucideIcon("Heading3", __iconNode$k);
10134
10170
  /**
10135
10171
  * @license lucide-react v0.483.0 - ISC
10136
10172
  *
10137
10173
  * This source code is licensed under the ISC license.
10138
10174
  * See the LICENSE file in the root directory of this source tree.
10139
10175
  */
10140
- const __iconNode$i = [
10176
+ const __iconNode$j = [
10141
10177
  ["path", { d: "M12 18V6", key: "zqpxq5" }],
10142
10178
  ["path", { d: "M17 10v3a1 1 0 0 0 1 1h3", key: "tj5zdr" }],
10143
10179
  ["path", { d: "M21 10v8", key: "1kdml4" }],
10144
10180
  ["path", { d: "M4 12h8", key: "17cfdx" }],
10145
10181
  ["path", { d: "M4 18V6", key: "1rz3zl" }]
10146
10182
  ];
10147
- const Heading4 = createLucideIcon("Heading4", __iconNode$i);
10183
+ const Heading4 = createLucideIcon("Heading4", __iconNode$j);
10148
10184
  /**
10149
10185
  * @license lucide-react v0.483.0 - ISC
10150
10186
  *
10151
10187
  * This source code is licensed under the ISC license.
10152
10188
  * See the LICENSE file in the root directory of this source tree.
10153
10189
  */
10154
- const __iconNode$h = [
10190
+ const __iconNode$i = [
10155
10191
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
10156
10192
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
10157
10193
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
10158
10194
  ];
10159
- const Image$5 = createLucideIcon("Image", __iconNode$h);
10195
+ const Image$5 = createLucideIcon("Image", __iconNode$i);
10160
10196
  /**
10161
10197
  * @license lucide-react v0.483.0 - ISC
10162
10198
  *
10163
10199
  * This source code is licensed under the ISC license.
10164
10200
  * See the LICENSE file in the root directory of this source tree.
10165
10201
  */
10166
- const __iconNode$g = [
10202
+ const __iconNode$h = [
10167
10203
  ["rect", { width: "20", height: "20", x: "2", y: "2", rx: "5", ry: "5", key: "2e1cvw" }],
10168
10204
  ["path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z", key: "9exkf1" }],
10169
10205
  ["line", { x1: "17.5", x2: "17.51", y1: "6.5", y2: "6.5", key: "r4j83e" }]
10170
10206
  ];
10171
- const Instagram = createLucideIcon("Instagram", __iconNode$g);
10207
+ const Instagram = createLucideIcon("Instagram", __iconNode$h);
10172
10208
  /**
10173
10209
  * @license lucide-react v0.483.0 - ISC
10174
10210
  *
10175
10211
  * This source code is licensed under the ISC license.
10176
10212
  * See the LICENSE file in the root directory of this source tree.
10177
10213
  */
10178
- const __iconNode$f = [
10214
+ const __iconNode$g = [
10179
10215
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
10180
10216
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
10181
10217
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
10182
10218
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
10183
10219
  ];
10184
- const LayoutGrid = createLucideIcon("LayoutGrid", __iconNode$f);
10220
+ const LayoutGrid = createLucideIcon("LayoutGrid", __iconNode$g);
10185
10221
  /**
10186
10222
  * @license lucide-react v0.483.0 - ISC
10187
10223
  *
10188
10224
  * This source code is licensed under the ISC license.
10189
10225
  * See the LICENSE file in the root directory of this source tree.
10190
10226
  */
10191
- const __iconNode$e = [
10227
+ const __iconNode$f = [
10192
10228
  ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
10193
10229
  ["rect", { width: "9", height: "7", x: "3", y: "14", rx: "1", key: "jqznyg" }],
10194
10230
  ["rect", { width: "5", height: "7", x: "16", y: "14", rx: "1", key: "q5h2i8" }]
10195
10231
  ];
10196
- const LayoutTemplate = createLucideIcon("LayoutTemplate", __iconNode$e);
10232
+ const LayoutTemplate = createLucideIcon("LayoutTemplate", __iconNode$f);
10197
10233
  /**
10198
10234
  * @license lucide-react v0.483.0 - ISC
10199
10235
  *
10200
10236
  * This source code is licensed under the ISC license.
10201
10237
  * See the LICENSE file in the root directory of this source tree.
10202
10238
  */
10203
- const __iconNode$d = [
10239
+ const __iconNode$e = [
10204
10240
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
10205
10241
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
10206
10242
  ];
10207
- const Link$2 = createLucideIcon("Link", __iconNode$d);
10243
+ const Link$2 = createLucideIcon("Link", __iconNode$e);
10208
10244
  /**
10209
10245
  * @license lucide-react v0.483.0 - ISC
10210
10246
  *
10211
10247
  * This source code is licensed under the ISC license.
10212
10248
  * See the LICENSE file in the root directory of this source tree.
10213
10249
  */
10214
- const __iconNode$c = [
10250
+ const __iconNode$d = [
10215
10251
  ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
10216
10252
  ["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
10217
10253
  ];
10218
- const Mail = createLucideIcon("Mail", __iconNode$c);
10254
+ const Mail = createLucideIcon("Mail", __iconNode$d);
10219
10255
  /**
10220
10256
  * @license lucide-react v0.483.0 - ISC
10221
10257
  *
10222
10258
  * This source code is licensed under the ISC license.
10223
10259
  * See the LICENSE file in the root directory of this source tree.
10224
10260
  */
10225
- const __iconNode$b = [
10261
+ const __iconNode$c = [
10226
10262
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
10227
10263
  ["path", { d: "M3 9h18", key: "1pudct" }],
10228
10264
  ["path", { d: "M9 21V9", key: "1oto5p" }]
10229
10265
  ];
10230
- const PanelsTopLeft = createLucideIcon("PanelsTopLeft", __iconNode$b);
10266
+ const PanelsTopLeft = createLucideIcon("PanelsTopLeft", __iconNode$c);
10231
10267
  /**
10232
10268
  * @license lucide-react v0.483.0 - ISC
10233
10269
  *
10234
10270
  * This source code is licensed under the ISC license.
10235
10271
  * See the LICENSE file in the root directory of this source tree.
10236
10272
  */
10237
- const __iconNode$a = [
10273
+ const __iconNode$b = [
10238
10274
  ["rect", { width: "5", height: "5", x: "3", y: "3", rx: "1", key: "1tu5fj" }],
10239
10275
  ["rect", { width: "5", height: "5", x: "16", y: "3", rx: "1", key: "1v8r4q" }],
10240
10276
  ["rect", { width: "5", height: "5", x: "3", y: "16", rx: "1", key: "1x03jg" }],
@@ -10248,51 +10284,51 @@ const __iconNode$a = [
10248
10284
  ["path", { d: "M21 12v.01", key: "1lwtk9" }],
10249
10285
  ["path", { d: "M12 21v-1", key: "1880an" }]
10250
10286
  ];
10251
- const QrCode = createLucideIcon("QrCode", __iconNode$a);
10287
+ const QrCode = createLucideIcon("QrCode", __iconNode$b);
10252
10288
  /**
10253
10289
  * @license lucide-react v0.483.0 - ISC
10254
10290
  *
10255
10291
  * This source code is licensed under the ISC license.
10256
10292
  * See the LICENSE file in the root directory of this source tree.
10257
10293
  */
10258
- const __iconNode$9 = [
10294
+ const __iconNode$a = [
10259
10295
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
10260
10296
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
10261
10297
  ];
10262
- const RotateCcw = createLucideIcon("RotateCcw", __iconNode$9);
10298
+ const RotateCcw = createLucideIcon("RotateCcw", __iconNode$a);
10263
10299
  /**
10264
10300
  * @license lucide-react v0.483.0 - ISC
10265
10301
  *
10266
10302
  * This source code is licensed under the ISC license.
10267
10303
  * See the LICENSE file in the root directory of this source tree.
10268
10304
  */
10269
- const __iconNode$8 = [
10305
+ const __iconNode$9 = [
10270
10306
  ["line", { x1: "3", x2: "21", y1: "12", y2: "12", key: "10d38w" }],
10271
10307
  ["polyline", { points: "8 8 12 4 16 8", key: "zo8t4w" }],
10272
10308
  ["polyline", { points: "16 16 12 20 8 16", key: "1oyrid" }]
10273
10309
  ];
10274
- const SeparatorHorizontal = createLucideIcon("SeparatorHorizontal", __iconNode$8);
10310
+ const SeparatorHorizontal = createLucideIcon("SeparatorHorizontal", __iconNode$9);
10275
10311
  /**
10276
10312
  * @license lucide-react v0.483.0 - ISC
10277
10313
  *
10278
10314
  * This source code is licensed under the ISC license.
10279
10315
  * See the LICENSE file in the root directory of this source tree.
10280
10316
  */
10281
- const __iconNode$7 = [
10317
+ const __iconNode$8 = [
10282
10318
  ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
10283
10319
  ["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
10284
10320
  ["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
10285
10321
  ["line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }],
10286
10322
  ["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
10287
10323
  ];
10288
- const Share2 = createLucideIcon("Share2", __iconNode$7);
10324
+ const Share2 = createLucideIcon("Share2", __iconNode$8);
10289
10325
  /**
10290
10326
  * @license lucide-react v0.483.0 - ISC
10291
10327
  *
10292
10328
  * This source code is licensed under the ISC license.
10293
10329
  * See the LICENSE file in the root directory of this source tree.
10294
10330
  */
10295
- const __iconNode$6 = [
10331
+ const __iconNode$7 = [
10296
10332
  [
10297
10333
  "path",
10298
10334
  {
@@ -10310,42 +10346,56 @@ const __iconNode$6 = [
10310
10346
  ["path", { d: "M21 9v2", key: "p14lih" }],
10311
10347
  ["path", { d: "M3 14v1", key: "vnatye" }]
10312
10348
  ];
10313
- const SquareDashedMousePointer = createLucideIcon("SquareDashedMousePointer", __iconNode$6);
10349
+ const SquareDashedMousePointer = createLucideIcon("SquareDashedMousePointer", __iconNode$7);
10314
10350
  /**
10315
10351
  * @license lucide-react v0.483.0 - ISC
10316
10352
  *
10317
10353
  * This source code is licensed under the ISC license.
10318
10354
  * See the LICENSE file in the root directory of this source tree.
10319
10355
  */
10320
- const __iconNode$5 = [
10356
+ const __iconNode$6 = [
10321
10357
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
10322
10358
  ["path", { d: "M7 8h10", key: "1jw688" }],
10323
10359
  ["path", { d: "M7 12h10", key: "b7w52i" }],
10324
10360
  ["path", { d: "M7 16h10", key: "wp8him" }]
10325
10361
  ];
10326
- const SquareMenu = createLucideIcon("SquareMenu", __iconNode$5);
10362
+ const SquareMenu = createLucideIcon("SquareMenu", __iconNode$6);
10327
10363
  /**
10328
10364
  * @license lucide-react v0.483.0 - ISC
10329
10365
  *
10330
10366
  * This source code is licensed under the ISC license.
10331
10367
  * See the LICENSE file in the root directory of this source tree.
10332
10368
  */
10333
- const __iconNode$4 = [
10369
+ const __iconNode$5 = [
10334
10370
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
10335
10371
  ["path", { d: "M8 12h8", key: "1wcyev" }],
10336
10372
  ["path", { d: "M12 8v8", key: "napkw2" }]
10337
10373
  ];
10338
- const SquarePlus = createLucideIcon("SquarePlus", __iconNode$4);
10374
+ const SquarePlus = createLucideIcon("SquarePlus", __iconNode$5);
10339
10375
  /**
10340
10376
  * @license lucide-react v0.483.0 - ISC
10341
10377
  *
10342
10378
  * This source code is licensed under the ISC license.
10343
10379
  * See the LICENSE file in the root directory of this source tree.
10344
10380
  */
10345
- const __iconNode$3 = [
10381
+ const __iconNode$4 = [
10346
10382
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
10347
10383
  ];
10348
- const Square = createLucideIcon("Square", __iconNode$3);
10384
+ const Square = createLucideIcon("Square", __iconNode$4);
10385
+ /**
10386
+ * @license lucide-react v0.483.0 - ISC
10387
+ *
10388
+ * This source code is licensed under the ISC license.
10389
+ * See the LICENSE file in the root directory of this source tree.
10390
+ */
10391
+ const __iconNode$3 = [
10392
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
10393
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
10394
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
10395
+ ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
10396
+ ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
10397
+ ];
10398
+ const Trash2 = createLucideIcon("Trash2", __iconNode$3);
10349
10399
  /**
10350
10400
  * @license lucide-react v0.483.0 - ISC
10351
10401
  *
@@ -29246,6 +29296,20 @@ const LegacyColorPicker$1 = (props) => {
29246
29296
  }
29247
29297
  ));
29248
29298
  };
29299
+ const NATIVE_COLOR_INPUT_FALLBACK = "#000000";
29300
+ function getNativeColorInputValue(value) {
29301
+ if (!value)
29302
+ return NATIVE_COLOR_INPUT_FALLBACK;
29303
+ try {
29304
+ return Color$1(value).hex().toUpperCase();
29305
+ } catch (error2) {
29306
+ }
29307
+ try {
29308
+ return Color$1(`#${value}`).hex().toUpperCase();
29309
+ } catch (error2) {
29310
+ }
29311
+ return NATIVE_COLOR_INPUT_FALLBACK;
29312
+ }
29249
29313
  const getPickerValue$1 = (value) => {
29250
29314
  if (!value)
29251
29315
  return "";
@@ -29331,6 +29395,14 @@ const NewColorPicker$1 = (props) => {
29331
29395
  setPickerValue(value2);
29332
29396
  debouncedApplyPickerChange(value2);
29333
29397
  });
29398
+ const onNativeInputChange = useEventCallback(
29399
+ (event) => {
29400
+ const value2 = event.target.value.toUpperCase();
29401
+ debouncedApplyPickerChange.cancel();
29402
+ setPickerValue(value2);
29403
+ applyPickerChange(value2);
29404
+ }
29405
+ );
29334
29406
  const onClear = useEventCallback((event) => {
29335
29407
  event.stopPropagation();
29336
29408
  debouncedApplyPickerChange.cancel();
@@ -29355,38 +29427,82 @@ const NewColorPicker$1 = (props) => {
29355
29427
  };
29356
29428
  }, [onVisibleChange]);
29357
29429
  const showClearButton = allowClear && !arcoColorPickerProps.disabled && Boolean(value || pickerValue);
29358
- return /* @__PURE__ */ React__default.createElement(ArcoColorPickerConfigProvider, null, /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", alignItems: "center", width: "100%" } }, /* @__PURE__ */ React__default.createElement(
29359
- ColorPicker$2,
29360
- __spreadProps(__spreadValues({}, arcoColorPickerProps), {
29361
- value: pickerValue,
29362
- format: "hex",
29363
- style: __spreadValues({ width: "100%", flex: 1 }, arcoColorPickerProps.style),
29364
- popupVisible,
29365
- onVisibleChange,
29366
- onChange: onPickerChange,
29367
- historyColors: colors,
29368
- disabledAlpha: true,
29369
- showHistory: true,
29370
- showText: true,
29371
- triggerProps: __spreadProps(__spreadValues({}, arcoColorPickerProps.triggerProps), {
29372
- getPopupContainer: ((_b = arcoColorPickerProps.triggerProps) == null ? void 0 : _b.getPopupContainer) || getPopupContainer,
29373
- className: [
29374
- (_c = arcoColorPickerProps.triggerProps) == null ? void 0 : _c.className,
29375
- "easy-email-pro-theme-color-picker-popup"
29376
- ].filter(Boolean).join(" ")
29377
- })
29378
- })
29379
- ), showClearButton ? /* @__PURE__ */ React__default.createElement(
29380
- Button$2,
29430
+ return /* @__PURE__ */ React__default.createElement(ArcoColorPickerConfigProvider, null, /* @__PURE__ */ React__default.createElement(
29431
+ "div",
29381
29432
  {
29382
- "aria-label": "Clear color",
29383
- icon: /* @__PURE__ */ React__default.createElement(IconClose, null),
29384
- onClick: onClear,
29385
- size: "mini",
29386
- type: "text",
29387
- style: { marginLeft: 4, flex: "none" }
29388
- }
29389
- ) : null));
29433
+ style: {
29434
+ display: "flex",
29435
+ alignItems: "center",
29436
+ position: "relative",
29437
+ width: "100%"
29438
+ }
29439
+ },
29440
+ /* @__PURE__ */ React__default.createElement(
29441
+ ColorPicker$2,
29442
+ __spreadProps(__spreadValues({}, arcoColorPickerProps), {
29443
+ value: pickerValue,
29444
+ format: "hex",
29445
+ style: __spreadValues({ width: "100%", flex: 1 }, arcoColorPickerProps.style),
29446
+ popupVisible,
29447
+ onVisibleChange,
29448
+ onChange: onPickerChange,
29449
+ historyColors: colors,
29450
+ disabledAlpha: true,
29451
+ showHistory: true,
29452
+ showText: true,
29453
+ triggerProps: __spreadProps(__spreadValues({}, arcoColorPickerProps.triggerProps), {
29454
+ getPopupContainer: ((_b = arcoColorPickerProps.triggerProps) == null ? void 0 : _b.getPopupContainer) || getPopupContainer,
29455
+ className: [
29456
+ (_c = arcoColorPickerProps.triggerProps) == null ? void 0 : _c.className,
29457
+ "easy-email-pro-theme-color-picker-popup"
29458
+ ].filter(Boolean).join(" ")
29459
+ })
29460
+ })
29461
+ ),
29462
+ !arcoColorPickerProps.disabled ? /* @__PURE__ */ React__default.createElement(Tooltip, { content: t("Pick a color"), position: "top" }, /* @__PURE__ */ React__default.createElement(
29463
+ "div",
29464
+ {
29465
+ style: {
29466
+ position: "absolute",
29467
+ left: 0,
29468
+ top: 0,
29469
+ width: 32,
29470
+ height: "100%"
29471
+ }
29472
+ },
29473
+ /* @__PURE__ */ React__default.createElement(
29474
+ "input",
29475
+ {
29476
+ "aria-label": "Native color picker",
29477
+ type: "color",
29478
+ value: getNativeColorInputValue(pickerValue || mergeTagColor),
29479
+ onChange: onNativeInputChange,
29480
+ onClick: (event) => event.stopPropagation(),
29481
+ style: {
29482
+ position: "absolute",
29483
+ inset: 0,
29484
+ width: "100%",
29485
+ height: "100%",
29486
+ opacity: 0,
29487
+ cursor: "pointer",
29488
+ border: 0,
29489
+ padding: 0
29490
+ }
29491
+ }
29492
+ )
29493
+ )) : null,
29494
+ showClearButton ? /* @__PURE__ */ React__default.createElement(
29495
+ Button$2,
29496
+ {
29497
+ "aria-label": "Clear color",
29498
+ icon: /* @__PURE__ */ React__default.createElement(IconClose, null),
29499
+ onClick: onClear,
29500
+ size: "mini",
29501
+ type: "text",
29502
+ style: { marginLeft: 4, flex: "none" }
29503
+ }
29504
+ ) : null
29505
+ ));
29390
29506
  };
29391
29507
  const ColorPickerContainer = (props) => {
29392
29508
  var _b;
@@ -41090,7 +41206,8 @@ function EasyEmailProAiAgent({
41090
41206
  onChooseDecision,
41091
41207
  onCancelDecision,
41092
41208
  onRestoreSnapshot,
41093
- onQuickAction
41209
+ onQuickAction,
41210
+ onClearHistory
41094
41211
  }) {
41095
41212
  var _a;
41096
41213
  assertAiAgentFeatureEnabled();
@@ -41517,7 +41634,7 @@ function EasyEmailProAiAgent({
41517
41634
  }
41518
41635
  }
41519
41636
  }
41520
- ), /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__composer-hint" }, t("Enter to send / Shift + Enter for new line"))), /* @__PURE__ */ React__default.createElement(
41637
+ )), /* @__PURE__ */ React__default.createElement(
41521
41638
  "input",
41522
41639
  {
41523
41640
  ref: inputRef,
@@ -41527,7 +41644,7 @@ function EasyEmailProAiAgent({
41527
41644
  multiple: true,
41528
41645
  onChange: (event) => uploadFiles(event.currentTarget.files)
41529
41646
  }
41530
- ), /* @__PURE__ */ React__default.createElement(
41647
+ ), /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__composer-actions" }, /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__composer-actions-left" }, /* @__PURE__ */ React__default.createElement(
41531
41648
  "button",
41532
41649
  {
41533
41650
  className: "eep-ai-agent__attach",
@@ -41541,6 +41658,35 @@ function EasyEmailProAiAgent({
41541
41658
  },
41542
41659
  /* @__PURE__ */ React__default.createElement(Icon, { name: "attach" })
41543
41660
  ), /* @__PURE__ */ React__default.createElement(
41661
+ Popconfirm,
41662
+ {
41663
+ focusLock: true,
41664
+ title: t("Clear this conversation?"),
41665
+ okText: t("Clear"),
41666
+ cancelText: t("Cancel"),
41667
+ okButtonProps: {
41668
+ status: "danger"
41669
+ },
41670
+ onOk: () => {
41671
+ void (onClearHistory == null ? void 0 : onClearHistory());
41672
+ setDraft("");
41673
+ setAttachments([]);
41674
+ setUploadError("");
41675
+ setQuickActionsExpanded(false);
41676
+ }
41677
+ },
41678
+ /* @__PURE__ */ React__default.createElement(
41679
+ "button",
41680
+ {
41681
+ className: "eep-ai-agent__clear-history",
41682
+ type: "button",
41683
+ disabled,
41684
+ "aria-label": t("Clear conversation"),
41685
+ title: t("Clear conversation")
41686
+ },
41687
+ /* @__PURE__ */ React__default.createElement(Trash2, { size: 15, strokeWidth: 2, "aria-hidden": "true" })
41688
+ )
41689
+ ), /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__composer-hint" }, t("Enter to send / Shift + Enter for new line"))), /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__composer-actions-right" }, /* @__PURE__ */ React__default.createElement(
41544
41690
  "button",
41545
41691
  {
41546
41692
  className: "eep-ai-agent__send",
@@ -41550,7 +41696,7 @@ function EasyEmailProAiAgent({
41550
41696
  "aria-label": t("Send")
41551
41697
  },
41552
41698
  /* @__PURE__ */ React__default.createElement(Icon, { name: "send" })
41553
- ))), previewAttachment ? /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__lightbox", role: "dialog", "aria-modal": "true", onClick: () => setPreviewAttachment(null) }, /* @__PURE__ */ React__default.createElement(
41699
+ ))))), previewAttachment ? /* @__PURE__ */ React__default.createElement("div", { className: "eep-ai-agent__lightbox", role: "dialog", "aria-modal": "true", onClick: () => setPreviewAttachment(null) }, /* @__PURE__ */ React__default.createElement(
41554
41700
  "button",
41555
41701
  {
41556
41702
  className: "eep-ai-agent__lightbox-close",
@@ -42301,6 +42447,19 @@ ${errors.join("\n")}` : toolCallsText(__spreadProps(__spreadValues({}, payload),
42301
42447
  const clearPendingDecision = useCallback(() => {
42302
42448
  setPendingDecision(null);
42303
42449
  }, []);
42450
+ const clearHistory = useCallback(() => {
42451
+ abortStream();
42452
+ activeRunRef.current = null;
42453
+ setPendingDecision(null);
42454
+ setPendingChange(null);
42455
+ setApplyingPendingChange(false);
42456
+ setActivity("");
42457
+ setStatus("ready");
42458
+ commitHistory(
42459
+ () => normalizeHistory(void 0, optionsRef.current.initialMessages),
42460
+ { type: "history.cleared" }
42461
+ );
42462
+ }, [abortStream, commitHistory]);
42304
42463
  const stop = useCallback(() => __async(this, null, function* () {
42305
42464
  abortStream();
42306
42465
  activeRunRef.current = null;
@@ -42323,6 +42482,7 @@ ${errors.join("\n")}` : toolCallsText(__spreadProps(__spreadValues({}, payload),
42323
42482
  applyPendingChange,
42324
42483
  chooseDecision,
42325
42484
  clearPendingDecision,
42485
+ clearHistory,
42326
42486
  restoreSnapshot,
42327
42487
  send,
42328
42488
  stop
@@ -42631,6 +42791,7 @@ function AiAgentPanel({
42631
42791
  onUpload: uploadOverride || editorUpload ? uploadAttachment : void 0,
42632
42792
  onChooseDecision: session.chooseDecision,
42633
42793
  onCancelDecision: session.clearPendingDecision,
42794
+ onClearHistory: session.clearHistory,
42634
42795
  onRestoreSnapshot: (snapshotOptions == null ? void 0 : snapshotOptions.onRestore) ? session.restoreSnapshot : void 0
42635
42796
  }
42636
42797
  );
@@ -44865,11 +45026,92 @@ const normalizeElements = (element) => {
44865
45026
  children: sortedChildren
44866
45027
  }));
44867
45028
  };
45029
+ const HEX_COLOR_REGEXP = /#[0-9a-fA-F]{3,8}\b/g;
45030
+ const RGB_COLOR_REGEXP = /rgba?\([^)]*\)/gi;
45031
+ const COLOR_KEY_REGEXP = /color/i;
45032
+ const VARIABLE_COLOR_REGEXP = /(\{\{.*\}\}|\$\(|^var\()/i;
45033
+ function getInitialColorPickerHistoryColors(initialColors = []) {
45034
+ return [...new Set(initialColors)].filter(Boolean).slice(-10);
45035
+ }
45036
+ function isValidColor(value) {
45037
+ if (VARIABLE_COLOR_REGEXP.test(value))
45038
+ return false;
45039
+ try {
45040
+ Color$1(value);
45041
+ return true;
45042
+ } catch (error2) {
45043
+ return false;
45044
+ }
45045
+ }
45046
+ function getColorMatchesInOrder(value) {
45047
+ return [
45048
+ ...[...value.matchAll(HEX_COLOR_REGEXP)].map((match) => ({
45049
+ color: match[0],
45050
+ index: match.index || 0
45051
+ })),
45052
+ ...[...value.matchAll(RGB_COLOR_REGEXP)].map((match) => ({
45053
+ color: match[0],
45054
+ index: match.index || 0
45055
+ }))
45056
+ ].sort((a, b) => a.index - b.index).map((match) => match.color).filter(isValidColor);
45057
+ }
45058
+ function collectColorsFromJson(value, key2, result) {
45059
+ if (typeof value === "string") {
45060
+ const colorMatches = getColorMatchesInOrder(value);
45061
+ if (colorMatches.length) {
45062
+ result.push(...colorMatches);
45063
+ return;
45064
+ }
45065
+ const trimmedValue = value.trim();
45066
+ if (key2 && COLOR_KEY_REGEXP.test(key2) && isValidColor(trimmedValue)) {
45067
+ result.push(trimmedValue);
45068
+ }
45069
+ return;
45070
+ }
45071
+ if (Array.isArray(value)) {
45072
+ value.forEach((item2) => collectColorsFromJson(item2, key2, result));
45073
+ return;
45074
+ }
45075
+ if (!value || typeof value !== "object")
45076
+ return;
45077
+ Object.entries(value).forEach(
45078
+ ([childKey, childValue]) => collectColorsFromJson(childValue, childKey, result)
45079
+ );
45080
+ }
45081
+ function extractColorPickerColorsFromJson(value) {
45082
+ const result = [];
45083
+ collectColorsFromJson(value, void 0, result);
45084
+ return [...new Set(result)];
45085
+ }
45086
+ function getInitialColorPickerColors({
45087
+ colorPicker,
45088
+ content: content2
45089
+ }) {
45090
+ const initialColors = (colorPicker == null ? void 0 : colorPicker.initialColors) || [];
45091
+ const extractedColors = (colorPicker == null ? void 0 : colorPicker.autoExtractColors) ? extractColorPickerColorsFromJson(content2) : [];
45092
+ return [.../* @__PURE__ */ new Set([...initialColors, ...extractedColors])].filter(Boolean);
45093
+ }
45094
+ function syncInitialColorPickerColors({
45095
+ colorPicker,
45096
+ content: content2
45097
+ }) {
45098
+ const initialColors = getInitialColorPickerColors({ colorPicker, content: content2 });
45099
+ if (!initialColors.length)
45100
+ return;
45101
+ if (typeof localStorage === "undefined")
45102
+ return;
45103
+ localStorage.setItem(
45104
+ "CURRENT_COLORS_KEY",
45105
+ JSON.stringify(getInitialColorPickerHistoryColors(initialColors))
45106
+ );
45107
+ }
44868
45108
  const useCreateConfig$1 = (_m) => {
44869
45109
  var _n = _m, {
45110
+ colorPicker,
44870
45111
  interactiveStyle,
44871
45112
  hoveringToolbar
44872
45113
  } = _n, rest = __objRest(_n, [
45114
+ "colorPicker",
44873
45115
  "interactiveStyle",
44874
45116
  "hoveringToolbar"
44875
45117
  ]);
@@ -44889,6 +45131,10 @@ const useCreateConfig$1 = (_m) => {
44889
45131
  initialValues.content.children = widgetElement.children;
44890
45132
  initialValues.widgetElement = widgetElement;
44891
45133
  }
45134
+ syncInitialColorPickerColors({
45135
+ colorPicker,
45136
+ content: initialValues.content
45137
+ });
44892
45138
  return __spreadProps(__spreadValues({
44893
45139
  editor,
44894
45140
  withEnhanceEditor: withTheme$1,
package/lib/style.css CHANGED
@@ -2600,13 +2600,12 @@ THEMES:
2600
2600
  }
2601
2601
 
2602
2602
  .eep-ai-agent__composer {
2603
- display: grid;
2604
- grid-template-columns: minmax(0, 1fr) 38px 38px;
2603
+ display: flex;
2604
+ flex-direction: column;
2605
2605
  gap: 8px;
2606
- align-items: end;
2607
2606
  border: 1px solid var(--eep-ai-line-strong);
2608
2607
  border-radius: 8px;
2609
- padding: 9px;
2608
+ padding: 10px;
2610
2609
  background: var(--eep-ai-surface);
2611
2610
  box-shadow: var(--eep-ai-shadow);
2612
2611
  }
@@ -2628,7 +2627,7 @@ THEMES:
2628
2627
  resize: none;
2629
2628
  border: 0;
2630
2629
  outline: 0;
2631
- padding: 6px 4px 2px;
2630
+ padding: 4px 4px 0;
2632
2631
  color: var(--eep-ai-text);
2633
2632
  background: transparent;
2634
2633
  font-size: 13px;
@@ -2640,36 +2639,80 @@ THEMES:
2640
2639
  }
2641
2640
 
2642
2641
  .eep-ai-agent__composer-hint {
2643
- padding: 1px 4px 0;
2642
+ min-width: 0;
2644
2643
  color: var(--eep-ai-subtle);
2645
2644
  font-size: 11px;
2646
2645
  line-height: 1.35;
2646
+ overflow: hidden;
2647
+ text-overflow: ellipsis;
2647
2648
  }
2648
2649
 
2649
2650
  .eep-ai-agent__file-input {
2650
2651
  display: none;
2651
2652
  }
2652
2653
 
2654
+ .eep-ai-agent__composer-actions {
2655
+ display: flex;
2656
+ align-items: center;
2657
+ justify-content: space-between;
2658
+ gap: 10px;
2659
+ min-height: 34px;
2660
+ }
2661
+
2662
+ .eep-ai-agent__composer-actions-left,
2663
+ .eep-ai-agent__composer-actions-right {
2664
+ display: flex;
2665
+ align-items: center;
2666
+ min-width: 0;
2667
+ }
2668
+
2669
+ .eep-ai-agent__composer-actions-left {
2670
+ flex: 1 1 auto;
2671
+ gap: 8px;
2672
+ }
2673
+
2674
+ .eep-ai-agent__composer-actions-right {
2675
+ flex: 0 0 auto;
2676
+ justify-content: flex-end;
2677
+ }
2678
+
2653
2679
  .eep-ai-agent__attach,
2680
+ .eep-ai-agent__clear-history,
2654
2681
  .eep-ai-agent__send {
2655
- width: 38px;
2656
- height: 38px;
2682
+ flex: 0 0 auto;
2683
+ width: 34px;
2684
+ height: 34px;
2657
2685
  border-radius: 8px;
2658
2686
  display: grid;
2659
2687
  place-items: center;
2660
2688
  cursor: pointer;
2661
2689
  }
2662
2690
 
2663
- .eep-ai-agent__attach {
2691
+ .eep-ai-agent__attach,
2692
+ .eep-ai-agent__clear-history {
2664
2693
  border: 1px solid var(--eep-ai-line);
2665
2694
  background: var(--eep-ai-surface);
2666
2695
  color: var(--eep-ai-text);
2667
2696
  }
2668
2697
 
2669
- .eep-ai-agent__attach:hover {
2698
+ .eep-ai-agent__attach:hover,
2699
+ .eep-ai-agent__clear-history:hover {
2670
2700
  background: #f4f4f5;
2671
2701
  }
2672
2702
 
2703
+ .eep-ai-agent__clear-history {
2704
+ color: var(--eep-ai-muted);
2705
+ }
2706
+
2707
+ .eep-ai-agent__clear-history:hover {
2708
+ color: var(--eep-ai-text);
2709
+ }
2710
+
2711
+ .eep-ai-agent__clear-history:disabled {
2712
+ cursor: not-allowed;
2713
+ opacity: 0.55;
2714
+ }
2715
+
2673
2716
  .eep-ai-agent__send {
2674
2717
  border: 0;
2675
2718
  background: var(--eep-ai-primary);
@@ -59,6 +59,7 @@ export type EasyEmailProAiAgentProps = {
59
59
  onRestoreVersion?: (version: AiChangeVersion) => void;
60
60
  onStepVersion?: (version: AiChangeVersion, direction: "previous" | "next") => void;
61
61
  onQuickAction?: (action: string) => void | Promise<void>;
62
+ onClearHistory?: () => void | Promise<void>;
62
63
  onClose?: () => void;
63
64
  };
64
- export declare function EasyEmailProAiAgent({ className, messages, activity, disabled, sendDisabled, quickActions, pendingAction, pendingDecision, placeholder, onSend, onUpload, onChooseDecision, onCancelDecision, onRestoreSnapshot, onQuickAction, }: EasyEmailProAiAgentProps): React.JSX.Element;
65
+ export declare function EasyEmailProAiAgent({ className, messages, activity, disabled, sendDisabled, quickActions, pendingAction, pendingDecision, placeholder, onSend, onUpload, onChooseDecision, onCancelDecision, onRestoreSnapshot, onQuickAction, onClearHistory, }: EasyEmailProAiAgentProps): React.JSX.Element;
@@ -25,6 +25,8 @@ export type AiAgentHistoryChange = {
25
25
  type: "message.updated";
26
26
  messageId: string;
27
27
  patch: Partial<AiAgentMessage>;
28
+ } | {
29
+ type: "history.cleared";
28
30
  } | {
29
31
  type: "snapshot.created";
30
32
  snapshot: AiAgentSnapshotMeta;
@@ -71,6 +73,7 @@ export declare function useAiAgentSession(options: UseAiAgentSessionOptions): {
71
73
  applyPendingChange: () => Promise<void>;
72
74
  chooseDecision: (choice: AiDecisionChoice, response: AiDecisionResponsePayload) => Promise<void>;
73
75
  clearPendingDecision: () => void;
76
+ clearHistory: () => void;
74
77
  restoreSnapshot: (snapshotId: string) => Promise<void>;
75
78
  send: (message: string, attachments?: AiAgentAttachment[], decisionResponse?: AiDecisionResponsePayload) => Promise<void>;
76
79
  stop: () => Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const NATIVE_COLOR_INPUT_FALLBACK = "#000000";
2
+ export declare function getNativeColorInputValue(value?: string): string;
@@ -0,0 +1,5 @@
1
+ export declare const MAX_COLOR_PICKER_RECORD_SIZE = 10;
2
+ export declare function getColorPickerList({ cacheColors, defaultColors, }: {
3
+ cacheColors?: string[];
4
+ defaultColors?: string[];
5
+ }): string[];
@@ -0,0 +1,7 @@
1
+ export declare function shouldInsertAfterHeroSibling({ canInsertIntoParent, canInsertIntoTarget, isAutoCompleteEnabled, isBottomHalf, isHeroTarget, }: {
2
+ canInsertIntoParent: boolean;
3
+ canInsertIntoTarget: boolean;
4
+ isAutoCompleteEnabled: boolean;
5
+ isBottomHalf: boolean;
6
+ isHeroTarget: boolean;
7
+ }): boolean;
@@ -2,7 +2,7 @@ import { EmailEditorProps } from "easy-email-pro-editor";
2
2
  import React from "react";
3
3
  import { ThemeConfigProps } from "../../typings";
4
4
  export declare const Retro: {
5
- useCreateConfig: ({ interactiveStyle, hoveringToolbar, ...rest }: Omit<ThemeConfigProps, "editor" | "widgetElement">) => Omit<EmailEditorProps, "children"> & Omit<EmailEditorProps, "children">;
5
+ useCreateConfig: ({ colorPicker, interactiveStyle, hoveringToolbar, ...rest }: Omit<ThemeConfigProps, "editor" | "widgetElement">) => Omit<EmailEditorProps, "children"> & Omit<EmailEditorProps, "children">;
6
6
  Layout: React.FC<{
7
7
  children?: React.ReactNode;
8
8
  header?: React.ReactNode;
@@ -0,0 +1,16 @@
1
+ import { getColorPickerList } from "../../components/Providers/colorPickerColorList";
2
+ export interface RetroColorPickerConfig {
3
+ initialColors?: string[];
4
+ autoExtractColors?: boolean;
5
+ }
6
+ export { getColorPickerList };
7
+ export declare function getInitialColorPickerHistoryColors(initialColors?: string[]): string[];
8
+ export declare function extractColorPickerColorsFromJson(value: unknown): string[];
9
+ export declare function getInitialColorPickerColors({ colorPicker, content, }: {
10
+ colorPicker?: RetroColorPickerConfig;
11
+ content?: unknown;
12
+ }): string[];
13
+ export declare function syncInitialColorPickerColors({ colorPicker, content, }: {
14
+ colorPicker?: RetroColorPickerConfig;
15
+ content?: unknown;
16
+ }): void;
@@ -206,6 +206,10 @@ export interface PluginsCustomEditorTypes {
206
206
  topTriggerArea?: number;
207
207
  scrollDelay?: number;
208
208
  } | true;
209
+ colorPicker?: {
210
+ initialColors?: string[];
211
+ autoExtractColors?: boolean;
212
+ };
209
213
  };
210
214
  EmailTemplate: BasicEmailTemplate;
211
215
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.59.2",
3
+ "version": "1.59.4",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"