easy-email-extensions 4.17.0 → 4.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index2.js CHANGED
@@ -56,9 +56,9 @@ var __async = (__this, __arguments, generator) => {
56
56
  };
57
57
  import * as React from "react";
58
58
  import React__default, { Children, isValidElement, cloneElement, createContext, useContext, Component, useMemo, memo, forwardRef, useEffect, useRef, useLayoutEffect, useState, useImperativeHandle, PureComponent, useCallback, useReducer, createRef, Fragment, createElement, Suspense } from "react";
59
- import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, DATA_CONTENT_EDITABLE_IDX, useFocusBlockLayout, MergeTagBadge, FIXED_CONTAINER_ID, getPluginElement, RICH_TEXT_BAR_ID, CONTENT_EDITABLE_CLASS_NAME, getEditorRoot, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, isTextBlock, getBlockNodeByIdx, useLazyState, useActiveTab, ActiveTabKeys } from "easy-email-editor";
60
- import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getPageIdx, getChildIdx, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
61
- import ReactDOM, { findDOMNode, createPortal } from "react-dom";
59
+ import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, DATA_CONTENT_EDITABLE_IDX, useFocusBlockLayout, MergeTagBadge, AvailableTools, FIXED_CONTAINER_ID, getPluginElement, RICH_TEXT_BAR_ID, CONTENT_EDITABLE_CLASS_NAME, getEditorRoot, scrollBlockEleIntoView, useHoverIdx, useDataTransfer, getBlockNodeByChildEle, getDirectionPosition, DATA_ATTRIBUTE_DROP_CONTAINER, BlockAvatarWrapper, isTextBlock, getBlockNodeByIdx, useLazyState, useActiveTab, ActiveTabKeys } from "easy-email-editor";
60
+ import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, getNodeIdxClassName, getChildIdx, getPageIdx, JsonToMjml, getNodeTypeFromClassName } from "easy-email-core";
61
+ import ReactDOM, { findDOMNode, render, createPortal } from "react-dom";
62
62
  import { Field, useForm as useForm$1, useField, Form as Form$3, version as version$2, useFormState } from "react-final-form";
63
63
  import { v4 } from "uuid";
64
64
  import mjml from "mjml-browser";
@@ -5814,7 +5814,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
5814
5814
  setTimeout(this.nextCallback, timeout);
5815
5815
  }
5816
5816
  };
5817
- _proto.render = function render() {
5817
+ _proto.render = function render2() {
5818
5818
  var status = this.state.status;
5819
5819
  if (status === UNMOUNTED) {
5820
5820
  return null;
@@ -5984,7 +5984,7 @@ var CSSTransition = /* @__PURE__ */ function(_React$Component) {
5984
5984
  removeClass(node, doneClassName);
5985
5985
  }
5986
5986
  };
5987
- _proto.render = function render() {
5987
+ _proto.render = function render2() {
5988
5988
  var _this$props = this.props;
5989
5989
  _this$props.classNames;
5990
5990
  var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
@@ -6166,7 +6166,7 @@ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
6166
6166
  });
6167
6167
  }
6168
6168
  };
6169
- _proto.render = function render() {
6169
+ _proto.render = function render2() {
6170
6170
  var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
6171
6171
  var contextValue = this.state.contextValue;
6172
6172
  var children = values(this.state.children).map(childFactory2);
@@ -6297,7 +6297,7 @@ var SwitchTransition = /* @__PURE__ */ function(_React$Component) {
6297
6297
  })
6298
6298
  };
6299
6299
  };
6300
- _proto.render = function render() {
6300
+ _proto.render = function render2() {
6301
6301
  var _this$props = this.props, children = _this$props.children, mode = _this$props.mode, _this$state = this.state, status = _this$state.status, current = _this$state.current;
6302
6302
  var data = {
6303
6303
  children,
@@ -9152,7 +9152,7 @@ var ResizeObserverSPI = function() {
9152
9152
  return ResizeObserverSPI2;
9153
9153
  }();
9154
9154
  var observers = typeof WeakMap !== "undefined" ? new WeakMap() : new MapShim();
9155
- var ResizeObserver$1 = function() {
9155
+ var ResizeObserver$2 = function() {
9156
9156
  function ResizeObserver2(callback) {
9157
9157
  if (!(this instanceof ResizeObserver2)) {
9158
9158
  throw new TypeError("Cannot call a class as a function.");
@@ -9171,7 +9171,7 @@ var ResizeObserver$1 = function() {
9171
9171
  "unobserve",
9172
9172
  "disconnect"
9173
9173
  ].forEach(function(method) {
9174
- ResizeObserver$1.prototype[method] = function() {
9174
+ ResizeObserver$2.prototype[method] = function() {
9175
9175
  var _a;
9176
9176
  return (_a = observers.get(this))[method].apply(_a, arguments);
9177
9177
  };
@@ -9180,7 +9180,7 @@ var index$1 = function() {
9180
9180
  if (typeof global$1.ResizeObserver !== "undefined") {
9181
9181
  return global$1.ResizeObserver;
9182
9182
  }
9183
- return ResizeObserver$1;
9183
+ return ResizeObserver$2;
9184
9184
  }();
9185
9185
  var __extends$6 = globalThis && globalThis.__extends || function() {
9186
9186
  var extendStatics = function(d, b) {
@@ -9242,7 +9242,7 @@ var ResizeObserverComponent = function(_super) {
9242
9242
  };
9243
9243
  return ResizeObserverComponent2;
9244
9244
  }(React__default.Component);
9245
- var ResizeObserver = ResizeObserverComponent;
9245
+ var ResizeObserver$1 = ResizeObserverComponent;
9246
9246
  var useIsomorphicLayoutEffect = isServerRendering ? useEffect : useLayoutEffect;
9247
9247
  var useIsomorphicLayoutEffect$1 = useIsomorphicLayoutEffect;
9248
9248
  var __read$1d = globalThis && globalThis.__read || function(o, n) {
@@ -10190,7 +10190,7 @@ var InputComponent = React__default.forwardRef(function(props, ref) {
10190
10190
  onMouseDown: function(e) {
10191
10191
  e.preventDefault();
10192
10192
  }
10193
- })) : null) : React__default.createElement("input", __assign$1n({ ref: refInput }, inputProps, { style: hasParent ? {} : __assign$1n(__assign$1n({}, style), "height" in props ? { height } : {}) })), autoFitWidth && React__default.createElement(ResizeObserver, { onResize: function() {
10193
+ })) : null) : React__default.createElement("input", __assign$1n({ ref: refInput }, inputProps, { style: hasParent ? {} : __assign$1n(__assign$1n({}, style), "height" in props ? { height } : {}) })), autoFitWidth && React__default.createElement(ResizeObserver$1, { onResize: function() {
10194
10194
  var inputWidth = refInputMirror.current.offsetWidth;
10195
10195
  if (typeof autoFitWidth === "object") {
10196
10196
  var delay = typeof autoFitWidth.delay === "function" ? autoFitWidth.delay(inputWidth, refPrevInputWidth.current) : autoFitWidth.delay;
@@ -11389,7 +11389,7 @@ var Trigger = function(_super) {
11389
11389
  }
11390
11390
  var prefixCls2 = getPrefixCls("trigger");
11391
11391
  var popupClassName = cs$1(prefixCls2, childrenPrefix, prefixCls2 + "-position-" + position, className);
11392
- var childrenComponent = isExistChildren && React__default.createElement(ResizeObserver, { onResize: this.onResize }, React__default.cloneElement(child, __assign$1i({}, mergeProps2)));
11392
+ var childrenComponent = isExistChildren && React__default.createElement(ResizeObserver$1, { onResize: this.onResize }, React__default.cloneElement(child, __assign$1i({}, mergeProps2)));
11393
11393
  var portalContent = React__default.createElement(CSSTransition$1, { in: !!popupVisible, timeout: duration2, classNames, unmountOnExit, appear: true, mountOnEnter: true, onEnter: function(e) {
11394
11394
  e.style.display = "initial";
11395
11395
  e.style.pointerEvents = "none";
@@ -11411,7 +11411,7 @@ var Trigger = function(_super) {
11411
11411
  _this.triggerRef = null;
11412
11412
  }
11413
11413
  _this.setState({ popupStyle: {} });
11414
- } }, React__default.createElement(ResizeObserver, { onResize: this.onResize }, React__default.createElement("span", __assign$1i({ ref: function(node) {
11414
+ } }, React__default.createElement(ResizeObserver$1, { onResize: this.onResize }, React__default.createElement("span", __assign$1i({ ref: function(node) {
11415
11415
  return _this.triggerRef = node;
11416
11416
  }, "trigger-placement": this.realPosition, style: __assign$1i(__assign$1i(__assign$1i({ width: autoAlignPopupWidth && (style === null || style === void 0 ? void 0 : style.width) === void 0 ? (_c = this.childrenDomSize) === null || _c === void 0 ? void 0 : _c.width : "" }, popupStyle), { position: "absolute", zIndex: zIndex || "" }), style) }, popupEventProps, { className: popupClassName }), React__default.createElement(popupChildren.type, __assign$1i({ ref: popupChildren.ref }, popupChildren.props, { style: __assign$1i(__assign$1i({}, popupChildren.props.style), dropdownPopupStyle) })), (showArrow || arrowProps) && React__default.createElement("div", { className: cs$1(prefixCls2 + "-arrow-container", (_a = {}, _a[childrenPrefix + "-arrow-container"] = childrenPrefix, _a)) }, React__default.createElement("div", __assign$1i({}, arrowProps, { className: cs$1(prefixCls2 + "-arrow", (_b = {}, _b[childrenPrefix + "-arrow"] = childrenPrefix, _b), arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.className), style: __assign$1i(__assign$1i({}, this.arrowStyle), arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.style) }))))));
11417
11417
  var portal = popupVisible || this.triggerRef ? React__default.createElement(Portal$4, { getContainer: this.getContainer }, portalContent) : null;
@@ -13472,7 +13472,7 @@ var VirtualList = React__default.forwardRef(function(props, ref) {
13472
13472
  }
13473
13473
  return null;
13474
13474
  };
13475
- return React__default.createElement(ResizeObserver, { onResize: function() {
13475
+ return React__default.createElement(ResizeObserver$1, { onResize: function() {
13476
13476
  if (refList.current && !isNumber$2(styleListMaxHeight)) {
13477
13477
  var clientHeight = refList.current.clientHeight;
13478
13478
  setStateHeight(clientHeight);
@@ -14540,7 +14540,7 @@ function Select$1(baseProps, ref) {
14540
14540
  }
14541
14541
  };
14542
14542
  }, [hotkeyHandler, optionInfoMap, valueActive]);
14543
- return React__default.createElement(ResizeObserver, { onResize: function() {
14543
+ return React__default.createElement(ResizeObserver$1, { onResize: function() {
14544
14544
  return refTrigger.current.updatePopupPosition();
14545
14545
  } }, React__default.createElement(Trigger$1, __assign$18({ ref: function(ref2) {
14546
14546
  return refTrigger.current = ref2;
@@ -16442,7 +16442,7 @@ function ResizeTrigger(props) {
16442
16442
  if (!resizable) {
16443
16443
  return React__default.createElement("div", { className: classNames }, isFunction$5(renderChildren) ? renderChildren(prev, trigger, next) : children || renderIcon());
16444
16444
  }
16445
- return React__default.createElement(ResizeObserver, { onResize }, React__default.createElement("div", { className: classNames, onMouseDown }, isFunction$5(renderChildren) ? renderChildren(prev, trigger, next) : children || renderIcon()));
16445
+ return React__default.createElement(ResizeObserver$1, { onResize }, React__default.createElement("div", { className: classNames, onMouseDown }, isFunction$5(renderChildren) ? renderChildren(prev, trigger, next) : children || renderIcon()));
16446
16446
  }
16447
16447
  var __read$O = globalThis && globalThis.__read || function(o, n) {
16448
16448
  var m = typeof Symbol === "function" && o[Symbol.iterator];
@@ -19687,7 +19687,7 @@ function withSideEffect(reducePropsToState2, handleStateChangeOnClient2) {
19687
19687
  mountedInstances.splice(index2, 1);
19688
19688
  emitChange();
19689
19689
  };
19690
- _proto.render = function render() {
19690
+ _proto.render = function render2() {
19691
19691
  return /* @__PURE__ */ React__default.createElement(WrappedComponent, this.props);
19692
19692
  };
19693
19693
  return SideEffect2;
@@ -24419,7 +24419,7 @@ var defaultProps$7 = {
24419
24419
  function List(baseProps, ref) {
24420
24420
  var _a = useContext(ConfigContext), getPrefixCls = _a.getPrefixCls, loadingElement = _a.loadingElement, ctxSize = _a.size, renderEmpty2 = _a.renderEmpty, componentConfig2 = _a.componentConfig;
24421
24421
  var props = useMergeProps(baseProps, defaultProps$7, componentConfig2 === null || componentConfig2 === void 0 ? void 0 : componentConfig2.List);
24422
- var style = props.style, wrapperStyle = props.wrapperStyle, className = props.className, wrapperClassName = props.wrapperClassName, _b = props.children, children = _b === void 0 ? [] : _b, _c = props.dataSource, dataSource = _c === void 0 ? [] : _c, propSize = props.size, footer = props.footer, header = props.header, pagination = props.pagination, bordered = props.bordered, split = props.split, render = props.render, grid = props.grid, loading = props.loading, hoverable = props.hoverable, scrollLoading = props.scrollLoading, paginationInFooter = props.paginationInFooter, offsetBottom = props.offsetBottom, throttleDelay = props.throttleDelay, defaultCurrent = props.defaultCurrent, noDataElement = props.noDataElement, listRef = props.listRef, onReachBottom = props.onReachBottom, onListScroll = props.onListScroll;
24422
+ var style = props.style, wrapperStyle = props.wrapperStyle, className = props.className, wrapperClassName = props.wrapperClassName, _b = props.children, children = _b === void 0 ? [] : _b, _c = props.dataSource, dataSource = _c === void 0 ? [] : _c, propSize = props.size, footer = props.footer, header = props.header, pagination = props.pagination, bordered = props.bordered, split = props.split, render2 = props.render, grid = props.grid, loading = props.loading, hoverable = props.hoverable, scrollLoading = props.scrollLoading, paginationInFooter = props.paginationInFooter, offsetBottom = props.offsetBottom, throttleDelay = props.throttleDelay, defaultCurrent = props.defaultCurrent, noDataElement = props.noDataElement, listRef = props.listRef, onReachBottom = props.onReachBottom, onListScroll = props.onListScroll;
24423
24423
  var size = propSize || (SizeList.indexOf(ctxSize) > -1 ? ctxSize : "default");
24424
24424
  var prefixCls2 = getPrefixCls("list");
24425
24425
  var refDom = useRef(null);
@@ -24477,11 +24477,11 @@ function List(baseProps, ref) {
24477
24477
  var startIndex = (current - 1) * pageSize2;
24478
24478
  return pagination && items.length > startIndex ? items.slice(startIndex, startIndex + pageSize2) : items;
24479
24479
  };
24480
- var getItems = function(originItems, render2) {
24480
+ var getItems = function(originItems, render3) {
24481
24481
  var currentPageItems = getCurrentPageItems(originItems);
24482
- return render2 ? currentPageItems.map(render2) : currentPageItems;
24482
+ return render3 ? currentPageItems.map(render3) : currentPageItems;
24483
24483
  };
24484
- var getGrid = function(originItems, render2) {
24484
+ var getGrid = function(originItems, render3) {
24485
24485
  var currentPageItems = getCurrentPageItems(originItems);
24486
24486
  if (grid.column || grid.span) {
24487
24487
  var items = [];
@@ -24493,7 +24493,7 @@ function List(baseProps, ref) {
24493
24493
  var nextStartNum = startNum_1 + rowSize;
24494
24494
  var currentRow = ~~(startNum_1 / rowSize);
24495
24495
  items.push(React__default.createElement(Row$2, { key: currentRow, className: prefixCls2 + "-row", gutter, justify, align }, currentPageItems.slice(startNum_1, nextStartNum).map(function(item2, index2) {
24496
- return React__default.createElement(Col$2, __assign$r({ key: currentRow + "_" + index2, className: prefixCls2 + "-row-col" }, colProps_1, { span: span_1 }), render2 ? render2(item2, startNum_1 + index2) : item2);
24496
+ return React__default.createElement(Col$2, __assign$r({ key: currentRow + "_" + index2, className: prefixCls2 + "-row-col" }, colProps_1, { span: span_1 }), render3 ? render3(item2, startNum_1 + index2) : item2);
24497
24497
  })));
24498
24498
  startNum_1 = nextStartNum;
24499
24499
  };
@@ -24503,11 +24503,11 @@ function List(baseProps, ref) {
24503
24503
  return items;
24504
24504
  }
24505
24505
  return React__default.createElement(Row$2, { className: prefixCls2 + "-row", gutter: grid.gutter }, currentPageItems.map(function(item2, index2) {
24506
- return React__default.createElement(Col$2, __assign$r({ className: prefixCls2 + "-row-col" }, omit$1(grid, ["gutter"]), { key: index2 }), render2 ? render2(item2, index2) : item2);
24506
+ return React__default.createElement(Col$2, __assign$r({ className: prefixCls2 + "-row-col" }, omit$1(grid, ["gutter"]), { key: index2 }), render3 ? render3(item2, index2) : item2);
24507
24507
  }));
24508
24508
  };
24509
- if (dataSource.length > 0 && render) {
24510
- return grid ? getGrid(dataSource, render) : getItems(dataSource, render);
24509
+ if (dataSource.length > 0 && render2) {
24510
+ return grid ? getGrid(dataSource, render2) : getItems(dataSource, render2);
24511
24511
  }
24512
24512
  if (childrenCount > 0) {
24513
24513
  return grid ? getGrid(children) : getItems(children);
@@ -24593,10 +24593,10 @@ function confirm(config2, renderFunc) {
24593
24593
  var div = document.createElement("div");
24594
24594
  document.body.appendChild(div);
24595
24595
  var configProviderProps = getConfigProviderProps();
24596
- function render(props) {
24596
+ function render2(props) {
24597
24597
  ReactDOM.render(React__default.createElement(ConfigProvider, __assign$q({}, configProviderProps), React__default.createElement(ConfirmModal, __assign$q({}, props, { onCancel }))), div);
24598
24598
  }
24599
- var renderFunction = renderFunc || render;
24599
+ var renderFunction = renderFunc || render2;
24600
24600
  var modalConfig2 = __assign$q(__assign$q({}, config2), { visible: false });
24601
24601
  var onOk = function() {
24602
24602
  var ret;
@@ -26287,7 +26287,7 @@ var __assign$g = globalThis && globalThis.__assign || function() {
26287
26287
  var TabHeaderTitle = function(_a, ref) {
26288
26288
  var _b;
26289
26289
  var prefixCls2 = _a.prefixCls, onDeleteTab = _a.onDeleteTab, tabKey = _a.tabKey, isActive = _a.isActive, onClickTab = _a.onClickTab, _c = _a.disabled, disabled = _c === void 0 ? false : _c, title2 = _a.title, editable = _a.editable, renderTitle = _a.renderTitle, deleteIcon = _a.deleteIcon, deleteButton = _a.deleteButton, getIdPrefix = _a.getIdPrefix, index2 = _a.index;
26290
- var render = isFunction$5(renderTitle) ? renderTitle : function(node) {
26290
+ var render2 = isFunction$5(renderTitle) ? renderTitle : function(node) {
26291
26291
  return node;
26292
26292
  };
26293
26293
  var handleDeleteTab = function(e) {
@@ -26301,7 +26301,7 @@ var TabHeaderTitle = function(_a, ref) {
26301
26301
  return;
26302
26302
  onClickTab(e);
26303
26303
  };
26304
- return render(React__default.createElement("div", { ref, key: tabKey, className: cs$1(prefixCls2 + "-header-title", (_b = {}, _b[prefixCls2 + "-header-title-active"] = isActive, _b[prefixCls2 + "-header-title-editable"] = editable, _b[prefixCls2 + "-header-title-disabled"] = disabled, _b)), role: "tab", "aria-selected": isActive, tabIndex: disabled ? -1 : 0, "aria-disabled": disabled || void 0, id: getIdPrefix(index2).tab, "aria-controls": getIdPrefix(index2).tabpane, onClick: handleTabClick, onKeyDown: function(event2) {
26304
+ return render2(React__default.createElement("div", { ref, key: tabKey, className: cs$1(prefixCls2 + "-header-title", (_b = {}, _b[prefixCls2 + "-header-title-active"] = isActive, _b[prefixCls2 + "-header-title-editable"] = editable, _b[prefixCls2 + "-header-title-disabled"] = disabled, _b)), role: "tab", "aria-selected": isActive, tabIndex: disabled ? -1 : 0, "aria-disabled": disabled || void 0, id: getIdPrefix(index2).tab, "aria-controls": getIdPrefix(index2).tabpane, onClick: handleTabClick, onKeyDown: function(event2) {
26305
26305
  var keyCode = event2.keyCode || event2.which;
26306
26306
  if (keyCode === Enter.code) {
26307
26307
  handleTabClick(event2);
@@ -26716,7 +26716,7 @@ var TabHeader = React__default.forwardRef(function(props, ref) {
26716
26716
  direction,
26717
26717
  align,
26718
26718
  onChange: updateHeaderOffset
26719
- }), React__default.createElement(ResizeObserver, { onResize: onWrapperResize }, React__default.createElement("div", { className: prefixCls2 + "-header-wrapper", ref: headerWrapperRef }, React__default.createElement(ResizeObserver, { onResize: onHeaderResize }, React__default.createElement("div", { className: cs$1(prefixCls2 + "-header", (_b = {}, _b[prefixCls2 + "-header-no-padding"] = !props.headerPadding && direction === "horizontal" && ["line", "text"].indexOf(type) > -1, _b)), ref: headerRef, style: headerStyle }, paneChildren.map(function(child, index2) {
26719
+ }), React__default.createElement(ResizeObserver$1, { onResize: onWrapperResize }, React__default.createElement("div", { className: prefixCls2 + "-header-wrapper", ref: headerWrapperRef }, React__default.createElement(ResizeObserver$1, { onResize: onHeaderResize }, React__default.createElement("div", { className: cs$1(prefixCls2 + "-header", (_b = {}, _b[prefixCls2 + "-header-no-padding"] = !props.headerPadding && direction === "horizontal" && ["line", "text"].indexOf(type) > -1, _b)), ref: headerRef, style: headerStyle }, paneChildren.map(function(child, index2) {
26720
26720
  return React__default.createElement(TabHeaderTitle$1, __assign$f({ key: index2, ref: function(node) {
26721
26721
  titleRef.current[child.key] = node;
26722
26722
  }, tabKey: child.key }, child.props, { prefixCls: prefixCls2, onDeleteTab: function() {
@@ -30056,7 +30056,7 @@ function Base(props) {
30056
30056
  } else if (componentType === "Text") {
30057
30057
  TextComponent = ellipsis ? "div" : "span";
30058
30058
  }
30059
- var node = React__default.createElement(ResizeObserver, { onResize: handleResize }, React__default.createElement(TextComponent, __assign$3({ className: cs$1(prefixCls2, componentClassName, className) }, baseProps, omit$1(rest, [
30059
+ var node = React__default.createElement(ResizeObserver$1, { onResize: handleResize }, React__default.createElement(TextComponent, __assign$3({ className: cs$1(prefixCls2, componentClassName, className) }, baseProps, omit$1(rest, [
30060
30060
  "spacing",
30061
30061
  "type",
30062
30062
  "close",
@@ -33131,7 +33131,6 @@ const ToolItem$1 = (props) => {
33131
33131
  }, /* @__PURE__ */ React__default.createElement("button", {
33132
33132
  tabIndex: -1,
33133
33133
  className: classnames("easy-email-extensions-emailToolItem", props.isActive && "easy-email-extensions-emailToolItem-active"),
33134
- title: props.title,
33135
33134
  onClick: props.onClick,
33136
33135
  style: props.style
33137
33136
  }, props.icon));
@@ -33304,15 +33303,15 @@ var ARRAY_ERROR = "FINAL_FORM/array-error";
33304
33303
  var fieldSubscriptionItems = ["active", "data", "dirty", "dirtySinceLastSubmit", "error", "initial", "invalid", "length", "modified", "modifiedSinceLastSubmit", "pristine", "submitError", "submitFailed", "submitSucceeded", "submitting", "touched", "valid", "value", "visited", "validating"];
33305
33304
  var version$1 = "4.20.4";
33306
33305
  function renderComponent(props, name2) {
33307
- var render = props.render, children = props.children, component = props.component, rest = _objectWithoutPropertiesLoose(props, ["render", "children", "component"]);
33306
+ var render2 = props.render, children = props.children, component = props.component, rest = _objectWithoutPropertiesLoose(props, ["render", "children", "component"]);
33308
33307
  if (component) {
33309
33308
  return /* @__PURE__ */ createElement(component, _extends({}, rest, {
33310
33309
  children,
33311
- render
33310
+ render: render2
33312
33311
  }));
33313
33312
  }
33314
- if (render) {
33315
- return render(children === void 0 ? rest : _extends({}, rest, {
33313
+ if (render2) {
33314
+ return render2(children === void 0 ? rest : _extends({}, rest, {
33316
33315
  children
33317
33316
  }));
33318
33317
  }
@@ -36408,11 +36407,56 @@ const getMaxTdCount = (tableData) => {
36408
36407
  });
36409
36408
  return tdCount;
36410
36409
  };
36411
- var styleText$1 = ".easy-email-table-operation-menu{background-color:#fff;box-shadow:0 2px 8px #00000026;font-size:14px;z-index:100;overflow:hidden;border-radius:4px;padding:4px 0}.easy-email-table-operation-menu .easy-email-table-operation-menu-dividing{height:1px;background-color:#efefef}.easy-email-table-operation-menu .easy-email-table-operation-color-picker{display:flex;align-items:center;flex-wrap:wrap;padding:0 16px 10px;background-color:#fff;overflow:hidden}.easy-email-table-operation-menu .easy-email-table-operation-color-picker .easy-email-table-operation-color-picker-item{width:20px;height:20px;border:1px solid #595959;margin-right:5px;margin-bottom:5px;cursor:pointer}.easy-email-table-operation-menu .easy-email-table-operation-menu-item{display:flex;align-items:center;padding:10px 16px;line-height:18px;background-color:#fff;cursor:pointer;color:#595959;overflow:hidden;text-overflow:ellipsis}.easy-email-table-operation-menu .easy-email-table-operation-menu-item:hover{background-color:#efefef}.easy-email-table-operation-menu .easy-email-table-operation-menu-item .easy-email-table-operation-menu-icon{margin-right:8px;height:20px;width:20px;font-size:0}\n";
36410
+ var styleText$1 = ".easy-email-table-operation-menu{background-color:#fff;box-shadow:0 2px 8px #00000026;font-size:14px;z-index:100;overflow:hidden;border-radius:4px;padding:4px 0}.easy-email-table-operation-menu .easy-email-table-operation-menu-dividing{height:1px;background-color:#efefef}.easy-email-table-operation-menu .easy-email-table-operation-color-picker{display:flex;align-items:center;flex-wrap:wrap;padding:0 16px 10px;background-color:#fff;overflow:hidden}.easy-email-table-operation-menu .easy-email-table-operation-color-picker .easy-email-table-operation-color-picker-item{width:20px;height:20px;border:1px solid #595959;margin-right:5px;margin-bottom:5px;cursor:pointer}.easy-email-table-operation-menu .easy-email-table-operation-menu-item{display:flex;align-items:center;padding:10px 16px;line-height:18px;background-color:#fff;cursor:pointer;color:#595959;overflow:hidden;text-overflow:ellipsis}.easy-email-table-operation-menu .easy-email-table-operation-menu-item:hover{background-color:#efefef}.easy-email-table-operation-menu .easy-email-table-operation-menu-item .easy-email-table-operation-menu-icon{margin-right:8px;height:20px;width:20px;font-size:0}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item{padding:10px 16px;background-color:#fff;color:#595959}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2){margin-top:4px;display:flex;align-items:center;flex-shrink:0}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2) .arco-input-inner-wrapper{box-shadow:none}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2) .arco-btn-size-default{padding:0 12px}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2) .arco-input-group{display:flex}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2) .arco-input-group .arco-input-inner-wrapper{flex:1}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item>div:nth-child(2) .arco-input-group .arco-input-group-addafter{height:100%;width:auto}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item-color{height:28px;width:28px;flex-shrink:0;border:1px solid var(--color-neutral-3, #e5e6eb);border-right:none;padding:4px;cursor:pointer;position:relative}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item-color>div{height:100%;width:100%;border:1px solid var(--color-neutral-3, #e5e6eb);border-radius:2px}.easy-email-table-operation-menu .easy-email-table-operation-menu-bg-item-color input{cursor:pointer;position:absolute;width:100%;height:100%;z-index:1;left:0;top:0;opacity:0}\n";
36411
+ const CellBackgroundSelector = ({
36412
+ bgColorHandler,
36413
+ rootDom
36414
+ }) => {
36415
+ const [color2, setColor] = useState("#ffffff");
36416
+ useEffect(() => {
36417
+ if (!rootDom) {
36418
+ return;
36419
+ }
36420
+ const observer = new ResizeObserver((e) => {
36421
+ setColor("#ffffff");
36422
+ });
36423
+ observer.observe(rootDom);
36424
+ return () => {
36425
+ observer.disconnect();
36426
+ };
36427
+ }, []);
36428
+ return /* @__PURE__ */ React__default.createElement("div", {
36429
+ onClick: (e) => e.stopPropagation(),
36430
+ className: "easy-email-table-operation-menu-bg-item"
36431
+ }, /* @__PURE__ */ React__default.createElement("div", null, "Set Background Color"), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
36432
+ className: "easy-email-table-operation-menu-bg-item-color"
36433
+ }, /* @__PURE__ */ React__default.createElement("div", {
36434
+ style: { backgroundColor: color2 }
36435
+ }), /* @__PURE__ */ React__default.createElement("input", {
36436
+ type: "color",
36437
+ value: color2,
36438
+ onChange: (e) => setColor(e.target.value)
36439
+ })), /* @__PURE__ */ React__default.createElement(Input$4.Search, {
36440
+ height: 28,
36441
+ searchButton: "Set",
36442
+ onSearch: () => bgColorHandler(color2),
36443
+ value: color2,
36444
+ onKeyDown: (e) => e.stopPropagation(),
36445
+ onChange: (e) => setColor(e)
36446
+ })));
36447
+ };
36448
+ const getCellBackgroundSelectorRoot = (bgColorHandler, rootDom) => {
36449
+ const node = document.createElement("div");
36450
+ render(/* @__PURE__ */ React__default.createElement(CellBackgroundSelector, {
36451
+ bgColorHandler,
36452
+ rootDom
36453
+ }), node);
36454
+ return node;
36455
+ };
36412
36456
  const MENU_CONFIG = {
36413
36457
  insertColumnRight: {
36414
36458
  text: "Insert column right",
36415
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M73.142857 336.64h526.628572v43.885714H73.142857zM73.142857 643.657143h526.628572v43.885714H73.142857zM336.457143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857h-219.428571v877.714286h219.428571a131.657143 131.657143 0 0 0 131.657143-131.657143V204.8A131.84 131.84 0 0 0 819.2 73.142857z m44.068571 460.982857h-65.828571v65.828572H753.371429v-65.828572h-65.828572V490.057143h65.828572v-65.828572h44.068571v65.828572h65.828571z" /></svg>',
36459
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M73.142857 336.64h526.628572v43.885714H73.142857zM73.142857 643.657143h526.628572v43.885714H73.142857zM336.457143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857h-219.428571v877.714286h219.428571a131.657143 131.657143 0 0 0 131.657143-131.657143V204.8A131.84 131.84 0 0 0 819.2 73.142857z m44.068571 460.982857h-65.828571v65.828572H753.371429v-65.828572h-65.828572V490.057143h65.828572v-65.828572h44.068571v65.828572h65.828571z" /></svg>`,
36416
36460
  handler() {
36417
36461
  var _a;
36418
36462
  const _this = this;
@@ -36450,7 +36494,7 @@ const MENU_CONFIG = {
36450
36494
  },
36451
36495
  insertColumnLeft: {
36452
36496
  text: "Insert column left",
36453
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M380.342857 336.457143h526.811429v43.885714H380.342857z m0 307.2h526.811429v43.885714H380.342857zM643.657143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.582857A131.474286 131.474286 0 0 1 950.857143 204.8v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.588571 87.771429v614.4a87.588571 87.588571 0 0 0 87.588571 87.771429h614.582857a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM204.8 73.142857A131.657143 131.657143 0 0 0 73.142857 204.8v614.4a131.657143 131.657143 0 0 0 131.657143 131.657143h219.428571V73.142857z m131.84 460.8h-65.828571v65.828572h-43.885715v-65.828572h-65.828571v-43.885714h65.828571v-65.828572h43.885715v65.828572h65.828571z" /></svg>',
36497
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M380.342857 336.457143h526.811429v43.885714H380.342857z m0 307.2h526.811429v43.885714H380.342857zM643.657143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.582857A131.474286 131.474286 0 0 1 950.857143 204.8v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.588571 87.771429v614.4a87.588571 87.588571 0 0 0 87.588571 87.771429h614.582857a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM204.8 73.142857A131.657143 131.657143 0 0 0 73.142857 204.8v614.4a131.657143 131.657143 0 0 0 131.657143 131.657143h219.428571V73.142857z m131.84 460.8h-65.828571v65.828572h-43.885715v-65.828572h-65.828571v-43.885714h65.828571v-65.828572h43.885715v65.828572h65.828571z" /></svg>`,
36454
36498
  handler() {
36455
36499
  var _a;
36456
36500
  const _this = this;
@@ -36474,7 +36518,7 @@ const MENU_CONFIG = {
36474
36518
  tr[index2].colSpan = (tr[index2].colSpan || 1) + 1;
36475
36519
  break;
36476
36520
  }
36477
- if (tdLeft > left && (!tr[index2 - 1] || (tr[index2 - 1].right || 0) + 1 === left)) {
36521
+ if (tdLeft > left && tr[index2 - 1] && (tr[index2 - 1].right || 0) + 1 === left) {
36478
36522
  tr.splice(index2, 0, { content: "-" });
36479
36523
  break;
36480
36524
  }
@@ -36488,7 +36532,7 @@ const MENU_CONFIG = {
36488
36532
  },
36489
36533
  insertRowUp: {
36490
36534
  text: "Insert row up",
36491
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M73.142857 599.771429h877.714286v43.885714H73.142857zM336.457143 380.342857h43.885714v526.628572h-43.885714z m307.2 0h43.885714v526.628572h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.588571 87.588571 0 0 0 87.771429 87.771429h614.4a87.588571 87.588571 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857H204.8A131.657143 131.657143 0 0 0 73.142857 204.8v219.428571h877.714286v-219.428571A131.657143 131.657143 0 0 0 819.2 73.142857z m-219.428571 197.485714h-65.828572v65.828572h-43.885714v-65.828572h-65.828572v-43.885714h65.828572V160.914286h43.885714v65.828571h65.828572z" /></svg>',
36535
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M73.142857 599.771429h877.714286v43.885714H73.142857zM336.457143 380.342857h43.885714v526.628572h-43.885714z m307.2 0h43.885714v526.628572h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.588571 87.588571 0 0 0 87.771429 87.771429h614.4a87.588571 87.588571 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857H204.8A131.657143 131.657143 0 0 0 73.142857 204.8v219.428571h877.714286v-219.428571A131.657143 131.657143 0 0 0 819.2 73.142857z m-219.428571 197.485714h-65.828572v65.828572h-43.885714v-65.828572h-65.828572v-43.885714h65.828572V160.914286h43.885714v65.828571h65.828572z" /></svg>`,
36492
36536
  handler() {
36493
36537
  const _this = this;
36494
36538
  const top = _this.tableIndexBoundary.top;
@@ -36512,7 +36556,7 @@ const MENU_CONFIG = {
36512
36556
  },
36513
36557
  insertRowDown: {
36514
36558
  text: "Insert row down",
36515
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v44.068571H73.142857zM336.64 117.028571h43.885714v526.628572h-43.885714z m307.017143 0h44.068571v526.628572H643.657143zM73.142857 599.771429v219.428571a131.657143 131.657143 0 0 0 131.657143 131.657143h614.4a131.657143 131.657143 0 0 0 131.657143-131.657143v-219.428571z m526.628572 197.485714h-65.645715v65.828571H490.057143v-65.828571h-65.828572v-43.885714h65.828572v-65.828572h44.068571v65.828572h65.645715z" /></svg>',
36559
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v44.068571H73.142857zM336.64 117.028571h43.885714v526.628572h-43.885714z m307.017143 0h44.068571v526.628572H643.657143zM73.142857 599.771429v219.428571a131.657143 131.657143 0 0 0 131.657143 131.657143h614.4a131.657143 131.657143 0 0 0 131.657143-131.657143v-219.428571z m526.628572 197.485714h-65.645715v65.828571H490.057143v-65.828571h-65.828572v-43.885714h65.828572v-65.828572h44.068571v65.828572h65.645715z" /></svg>`,
36516
36560
  handler() {
36517
36561
  const _this = this;
36518
36562
  let addCount = _this.maxTdCount;
@@ -36542,7 +36586,7 @@ const MENU_CONFIG = {
36542
36586
  },
36543
36587
  mergeCells: {
36544
36588
  text: "Merge selected cells",
36545
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-277.850505 5.559596v226.909091H375.725253V104.59798h272.420202zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v226.909091H103.434343V195.361616z m90.763637 726.367677c-24.048485 0-47.191919-9.567677-64.129293-26.634344-17.066667-17.066667-26.634343-40.080808-26.634344-64.129292V649.309091h226.909091v272.420202H194.19798z m181.527273 0V649.309091h272.290909v272.420202H375.725253z m544.711111-90.892929c0 24.048485-9.567677 47.191919-26.634344 64.129293-17.066667 17.066667-40.080808 26.634343-64.129293 26.634343H693.527273V649.309091h226.909091v181.527273zM693.527273 331.507071V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.145455H693.527273z" /></svg>',
36589
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-277.850505 5.559596v226.909091H375.725253V104.59798h272.420202zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v226.909091H103.434343V195.361616z m90.763637 726.367677c-24.048485 0-47.191919-9.567677-64.129293-26.634344-17.066667-17.066667-26.634343-40.080808-26.634344-64.129292V649.309091h226.909091v272.420202H194.19798z m181.527273 0V649.309091h272.290909v272.420202H375.725253z m544.711111-90.892929c0 24.048485-9.567677 47.191919-26.634344 64.129293-17.066667 17.066667-40.080808 26.634343-64.129293 26.634343H693.527273V649.309091h226.909091v181.527273zM693.527273 331.507071V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.145455H693.527273z" /></svg>`,
36546
36590
  handler() {
36547
36591
  var _a;
36548
36592
  const _this = this;
@@ -36575,7 +36619,7 @@ const MENU_CONFIG = {
36575
36619
  },
36576
36620
  deleteColumn: {
36577
36621
  text: "Delete selected columns",
36578
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.996 99.038c-25.47-25.6-60.121-39.822-96.323-39.822H194.198c-75.12 0.13-136.016 61.026-136.145 136.146v635.345c0 36.073 14.351 70.723 39.822 96.323 25.6 25.73 60.25 40.081 96.323 40.081h635.475c36.072 0 70.723-14.351 96.323-39.951 25.6-25.6 39.951-60.122 39.951-96.324V195.362c0-36.073-14.351-70.724-39.951-96.324z m-365.77 494.287L512 545.228l-48.226 48.097-32.194-31.935 48.355-48.226-48.226-48.097 32.194-32.194L512 480.97l48.097-48.097 32.194 32.194-48.097 48.097 48.226 48.226-32.194 31.935zM103.434 195.362c0-24.049 9.568-47.192 26.635-64.13 17.066-17.066 40.08-26.634 64.129-26.634h136.145v226.91H103.434V195.361z m0 181.656h226.91V649.31h-226.91V377.02z m90.764 544.84c-24.049 0-47.192-9.567-64.13-26.634-17.066-17.066-26.634-40.08-26.634-64.258V694.69h226.91v227.168H194.197z m726.238-90.763c0 24.048-9.438 47.192-26.505 64.259-17.066 17.066-40.21 26.634-64.258 26.505H693.527V694.69h226.91v136.404z m0-181.786H693.527V377.02h226.91v272.29zM693.527 331.507V104.598h136.146c24.048 0 47.192 9.438 64.258 26.505 17.067 17.067 26.635 40.21 26.505 64.259v136.145H693.527z" /></svg>',
36622
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.996 99.038c-25.47-25.6-60.121-39.822-96.323-39.822H194.198c-75.12 0.13-136.016 61.026-136.145 136.146v635.345c0 36.073 14.351 70.723 39.822 96.323 25.6 25.73 60.25 40.081 96.323 40.081h635.475c36.072 0 70.723-14.351 96.323-39.951 25.6-25.6 39.951-60.122 39.951-96.324V195.362c0-36.073-14.351-70.724-39.951-96.324z m-365.77 494.287L512 545.228l-48.226 48.097-32.194-31.935 48.355-48.226-48.226-48.097 32.194-32.194L512 480.97l48.097-48.097 32.194 32.194-48.097 48.097 48.226 48.226-32.194 31.935zM103.434 195.362c0-24.049 9.568-47.192 26.635-64.13 17.066-17.066 40.08-26.634 64.129-26.634h136.145v226.91H103.434V195.361z m0 181.656h226.91V649.31h-226.91V377.02z m90.764 544.84c-24.049 0-47.192-9.567-64.13-26.634-17.066-17.066-26.634-40.08-26.634-64.258V694.69h226.91v227.168H194.197z m726.238-90.763c0 24.048-9.438 47.192-26.505 64.259-17.066 17.066-40.21 26.634-64.258 26.505H693.527V694.69h226.91v136.404z m0-181.786H693.527V377.02h226.91v272.29zM693.527 331.507V104.598h136.146c24.048 0 47.192 9.438 64.258 26.505 17.067 17.067 26.635 40.21 26.505 64.259v136.145H693.527z" /></svg>`,
36579
36623
  handler() {
36580
36624
  var _a;
36581
36625
  const _this = this;
@@ -36616,7 +36660,7 @@ const MENU_CONFIG = {
36616
36660
  },
36617
36661
  deleteRow: {
36618
36662
  text: "Delete selected rows",
36619
- icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-550.270707 5.559596h272.290909v227.167677H375.725253V104.59798z m56.242424 360.468687l31.935353-32.19394 48.09697 48.226263 48.09697-48.226263 32.193939 32.19394-48.09697 48.096969 48.226263 48.226263-32.193939 31.935354-48.226263-48.09697-48.226263 48.09697-31.935353-31.935354 48.226262-48.226263-48.096969-48.096969zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v227.167677H103.434343V195.361616z m817.002021 635.733333c0 24.048485-9.567677 47.191919-26.634344 64.258586-17.066667 17.066667-40.080808 26.634343-64.129293 26.634344H194.19798c-24.048485 0-47.191919-9.567677-64.258586-26.634344C112.872727 878.157576 103.434343 855.014141 103.434343 830.836364V694.690909h226.909091v226.909091h45.381819V694.690909h272.290909v226.909091h45.381818V694.690909h226.909091v136.40404z m0-499.329292H693.527273V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.404041z" /></svg>',
36663
+ icon: `<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#595959" d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-550.270707 5.559596h272.290909v227.167677H375.725253V104.59798z m56.242424 360.468687l31.935353-32.19394 48.09697 48.226263 48.09697-48.226263 32.193939 32.19394-48.09697 48.096969 48.226263 48.226263-32.193939 31.935354-48.226263-48.09697-48.226263 48.09697-31.935353-31.935354 48.226262-48.226263-48.096969-48.096969zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v227.167677H103.434343V195.361616z m817.002021 635.733333c0 24.048485-9.567677 47.191919-26.634344 64.258586-17.066667 17.066667-40.080808 26.634343-64.129293 26.634344H194.19798c-24.048485 0-47.191919-9.567677-64.258586-26.634344C112.872727 878.157576 103.434343 855.014141 103.434343 830.836364V694.690909h226.909091v226.909091h45.381819V694.690909h272.290909v226.909091h45.381818V694.690909h226.909091v136.40404z m0-499.329292H693.527273V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.404041z" /></svg>`,
36620
36664
  handler() {
36621
36665
  var _a;
36622
36666
  const _this = this;
@@ -36650,6 +36694,36 @@ const MENU_CONFIG = {
36650
36694
  _this.tableData.splice(_this.tableIndexBoundary.top, deleteCount);
36651
36695
  (_a = _this.changeTableData) == null ? void 0 : _a.call(_this, _this.tableData);
36652
36696
  }
36697
+ },
36698
+ setCellBg: {
36699
+ text: "Set Background",
36700
+ render(tableOperationMenu) {
36701
+ const bgColorHandler = this.handler.bind(tableOperationMenu);
36702
+ const root2 = getCellBackgroundSelectorRoot(bgColorHandler, tableOperationMenu.domNode);
36703
+ return root2;
36704
+ },
36705
+ handler(color2) {
36706
+ var _a;
36707
+ const _this = this;
36708
+ const { top, bottom, left, right } = _this.tableIndexBoundary;
36709
+ _this.tableData.forEach((tr) => {
36710
+ for (let index2 = 0; index2 < tr.length; index2++) {
36711
+ const td = tr[index2];
36712
+ const tdTop = tr[index2].top || 0;
36713
+ const tdBottom = tr[index2].bottom || 0;
36714
+ const tdLeft = tr[index2].left || 0;
36715
+ const tdRight = tr[index2].right || 0;
36716
+ if (tdLeft > right) {
36717
+ break;
36718
+ }
36719
+ if (top <= tdTop && bottom >= tdBottom && left <= tdLeft && right >= tdRight) {
36720
+ td.backgroundColor = color2;
36721
+ }
36722
+ }
36723
+ });
36724
+ (_a = _this.changeTableData) == null ? void 0 : _a.call(_this, _this.tableData);
36725
+ _this.hide();
36726
+ }
36653
36727
  }
36654
36728
  };
36655
36729
  const MENU_HEIGHT = 305;
@@ -36733,8 +36807,8 @@ class TableOperationMenu {
36733
36807
  for (let name2 in this.menuItems) {
36734
36808
  const itemOption = this.menuItems[name2];
36735
36809
  if (itemOption) {
36736
- this.domNode.appendChild(this.menuItemCreator(Object.assign({}, itemOption)));
36737
- if (["insertRowDown"].indexOf(name2) > -1) {
36810
+ this.domNode.appendChild(itemOption.render ? itemOption.render(this) : this.menuItemCreator(Object.assign({}, itemOption)));
36811
+ if (["insertRowDown", "deleteRow"].indexOf(name2) > -1) {
36738
36812
  this.domNode.appendChild(dividingCreator());
36739
36813
  }
36740
36814
  }
@@ -36839,7 +36913,7 @@ class TableColumnTool {
36839
36913
  "background-color": "rgb(65, 68, 77)",
36840
36914
  left: `${left}px`,
36841
36915
  top: `${top}px`,
36842
- width: "2px",
36916
+ width: `2px`,
36843
36917
  height: `${Math.abs(height)}px`,
36844
36918
  position: "absolute",
36845
36919
  "z-index": 10
@@ -36848,7 +36922,7 @@ class TableColumnTool {
36848
36922
  "background-color": "rgb(65, 68, 77)",
36849
36923
  left: `${left + width}px`,
36850
36924
  top: `${top}px`,
36851
- width: "2px",
36925
+ width: `2px`,
36852
36926
  height: `${Math.abs(height)}px`,
36853
36927
  position: "absolute",
36854
36928
  "z-index": 10
@@ -36907,12 +36981,13 @@ class TableColumnTool {
36907
36981
  document.addEventListener("keydown", this.hideBorderByKeyDown);
36908
36982
  }
36909
36983
  destroy() {
36910
- var _a, _b;
36984
+ var _a, _b, _c;
36911
36985
  (_a = this.root) == null ? void 0 : _a.removeEventListener("mousedown", this.handleMousedown.bind(this));
36912
36986
  (_b = this.root) == null ? void 0 : _b.removeEventListener("contextmenu", this.handleContextmenu);
36913
36987
  document.body.removeEventListener("click", this.hideBorder, false);
36914
36988
  document.body.removeEventListener("contextmenu", this.hideTableMenu, false);
36915
36989
  document.removeEventListener("keydown", this.hideBorderByKeyDown);
36990
+ (_c = this.tableMenu) == null ? void 0 : _c.destroy();
36916
36991
  }
36917
36992
  handleMousedown(event2) {
36918
36993
  var _a, _b;
@@ -37453,11 +37528,12 @@ function FontSize(props) {
37453
37528
  }));
37454
37529
  }
37455
37530
  function Tools(props) {
37456
- const { mergeTags: mergeTags2, enabledMergeTagsBadge } = useEditorProps();
37531
+ var _a, _b;
37532
+ const { mergeTags: mergeTags2, enabledMergeTagsBadge, toolbar } = useEditorProps();
37457
37533
  const { focusBlockNode } = useFocusBlockLayout();
37458
37534
  const { selectionRange, restoreRange, setRangeByElement } = useSelectionRange();
37459
37535
  const execCommand = useCallback((cmd, val) => {
37460
- var _a;
37536
+ var _a2;
37461
37537
  if (!selectionRange) {
37462
37538
  console.error(t("No selectionRange"));
37463
37539
  return;
@@ -37495,12 +37571,18 @@ function Tools(props) {
37495
37571
  insertMergeTagEle.focus();
37496
37572
  setRangeByElement(insertMergeTagEle);
37497
37573
  }
37574
+ } else if (cmd === "foreColor") {
37575
+ document.execCommand(cmd, false, val);
37576
+ let linkNode = getLinkNode$1(selectionRange);
37577
+ if (linkNode) {
37578
+ linkNode.style.color = "inherit";
37579
+ }
37498
37580
  } else {
37499
37581
  document.execCommand(cmd, false, val);
37500
37582
  }
37501
37583
  const contenteditableElement = getShadowRoot().activeElement;
37502
37584
  if ((contenteditableElement == null ? void 0 : contenteditableElement.getAttribute("contenteditable")) === "true") {
37503
- const html = ((_a = getShadowRoot().activeElement) == null ? void 0 : _a.innerHTML) || "";
37585
+ const html = ((_a2 = getShadowRoot().activeElement) == null ? void 0 : _a2.innerHTML) || "";
37504
37586
  props.onChange(html);
37505
37587
  }
37506
37588
  }, [
@@ -37512,15 +37594,194 @@ function Tools(props) {
37512
37594
  setRangeByElement
37513
37595
  ]);
37514
37596
  const execCommandWithRange = useCallback((cmd, val) => {
37515
- var _a;
37597
+ var _a2;
37516
37598
  document.execCommand(cmd, false, val);
37517
37599
  const contenteditableElement = getShadowRoot().activeElement;
37518
37600
  if ((contenteditableElement == null ? void 0 : contenteditableElement.getAttribute("contenteditable")) === "true") {
37519
- const html = ((_a = getShadowRoot().activeElement) == null ? void 0 : _a.innerHTML) || "";
37601
+ const html = ((_a2 = getShadowRoot().activeElement) == null ? void 0 : _a2.innerHTML) || "";
37520
37602
  props.onChange(html);
37521
37603
  }
37522
37604
  }, [props.onChange]);
37523
37605
  const getPopoverMountNode = () => document.getElementById(FIXED_CONTAINER_ID);
37606
+ const enabledTools = (_a = toolbar == null ? void 0 : toolbar.tools) != null ? _a : [
37607
+ AvailableTools.MergeTags,
37608
+ AvailableTools.FontFamily,
37609
+ AvailableTools.FontSize,
37610
+ AvailableTools.Bold,
37611
+ AvailableTools.Italic,
37612
+ AvailableTools.StrikeThrough,
37613
+ AvailableTools.Underline,
37614
+ AvailableTools.IconFontColor,
37615
+ AvailableTools.IconBgColor,
37616
+ AvailableTools.Link,
37617
+ AvailableTools.Justify,
37618
+ AvailableTools.Lists,
37619
+ AvailableTools.HorizontalRule,
37620
+ AvailableTools.RemoveFormat
37621
+ ];
37622
+ const tools = enabledTools.flatMap((tool) => {
37623
+ switch (tool) {
37624
+ case AvailableTools.MergeTags:
37625
+ if (!mergeTags2)
37626
+ return [];
37627
+ return [
37628
+ /* @__PURE__ */ React__default.createElement(MergeTags, {
37629
+ key: tool,
37630
+ execCommand,
37631
+ getPopupContainer: getPopoverMountNode
37632
+ })
37633
+ ];
37634
+ case AvailableTools.FontFamily:
37635
+ return [
37636
+ /* @__PURE__ */ React__default.createElement(FontFamily$1, {
37637
+ key: tool,
37638
+ execCommand,
37639
+ getPopupContainer: getPopoverMountNode
37640
+ })
37641
+ ];
37642
+ case AvailableTools.FontSize:
37643
+ return [
37644
+ /* @__PURE__ */ React__default.createElement(FontSize, {
37645
+ key: tool,
37646
+ execCommand,
37647
+ getPopupContainer: getPopoverMountNode
37648
+ })
37649
+ ];
37650
+ case AvailableTools.Bold:
37651
+ return [
37652
+ /* @__PURE__ */ React__default.createElement(Bold, {
37653
+ key: tool,
37654
+ currentRange: selectionRange,
37655
+ onChange: () => execCommandWithRange("bold")
37656
+ })
37657
+ ];
37658
+ case AvailableTools.Italic:
37659
+ return [
37660
+ /* @__PURE__ */ React__default.createElement(Italic, {
37661
+ key: tool,
37662
+ currentRange: selectionRange,
37663
+ onChange: () => execCommandWithRange("italic")
37664
+ })
37665
+ ];
37666
+ case AvailableTools.StrikeThrough:
37667
+ return [
37668
+ /* @__PURE__ */ React__default.createElement(StrikeThrough, {
37669
+ key: tool,
37670
+ currentRange: selectionRange,
37671
+ onChange: () => execCommandWithRange("strikeThrough")
37672
+ })
37673
+ ];
37674
+ case AvailableTools.Underline:
37675
+ return [
37676
+ /* @__PURE__ */ React__default.createElement(Underline, {
37677
+ key: tool,
37678
+ currentRange: selectionRange,
37679
+ onChange: () => execCommandWithRange("underline")
37680
+ })
37681
+ ];
37682
+ case AvailableTools.IconFontColor:
37683
+ return [
37684
+ /* @__PURE__ */ React__default.createElement(IconFontColor, {
37685
+ selectionRange,
37686
+ execCommand,
37687
+ getPopoverMountNode
37688
+ })
37689
+ ];
37690
+ case AvailableTools.IconBgColor:
37691
+ return [
37692
+ /* @__PURE__ */ React__default.createElement(IconBgColor, {
37693
+ selectionRange,
37694
+ execCommand,
37695
+ getPopoverMountNode
37696
+ })
37697
+ ];
37698
+ case AvailableTools.Link:
37699
+ return [
37700
+ /* @__PURE__ */ React__default.createElement(Link$1, {
37701
+ key: `${tool}-link`,
37702
+ currentRange: selectionRange,
37703
+ onChange: (values2) => execCommand("createLink", values2),
37704
+ getPopupContainer: getPopoverMountNode
37705
+ }),
37706
+ /* @__PURE__ */ React__default.createElement(Unlink, {
37707
+ key: `${tool}-unlink`,
37708
+ currentRange: selectionRange,
37709
+ onChange: () => execCommand("")
37710
+ })
37711
+ ];
37712
+ case "justify":
37713
+ return [
37714
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37715
+ key: `${tool}-justify-left`,
37716
+ onClick: () => execCommand("justifyLeft"),
37717
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37718
+ iconName: "icon-align-left"
37719
+ }),
37720
+ title: t("Align left")
37721
+ }),
37722
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37723
+ key: `${tool}-justify-center`,
37724
+ onClick: () => execCommand("justifyCenter"),
37725
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37726
+ iconName: "icon-align-center"
37727
+ }),
37728
+ title: t("Align center")
37729
+ }),
37730
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37731
+ key: `${tool}-justify-right`,
37732
+ onClick: () => execCommand("justifyRight"),
37733
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37734
+ iconName: "icon-align-right"
37735
+ }),
37736
+ title: t("Align right")
37737
+ })
37738
+ ];
37739
+ case AvailableTools.Lists:
37740
+ return [
37741
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37742
+ key: `${tool}-ordered-list`,
37743
+ onClick: () => execCommand("insertOrderedList"),
37744
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37745
+ iconName: "icon-list-ol"
37746
+ }),
37747
+ title: t("Orderlist")
37748
+ }),
37749
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37750
+ key: `${tool}-unordered-list`,
37751
+ onClick: () => execCommand("insertUnorderedList"),
37752
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37753
+ iconName: "icon-list-ul"
37754
+ }),
37755
+ title: t("Unorderlist")
37756
+ })
37757
+ ];
37758
+ case AvailableTools.HorizontalRule:
37759
+ return [
37760
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37761
+ key: tool,
37762
+ onClick: () => execCommand("insertHorizontalRule"),
37763
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37764
+ iconName: "icon-line"
37765
+ }),
37766
+ title: t("Line")
37767
+ })
37768
+ ];
37769
+ case AvailableTools.RemoveFormat:
37770
+ return [
37771
+ /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37772
+ key: tool,
37773
+ onClick: () => execCommand("removeFormat"),
37774
+ icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37775
+ iconName: "icon-close"
37776
+ }),
37777
+ title: t("Remove format")
37778
+ })
37779
+ ];
37780
+ default:
37781
+ console.error("Not existing tool", tool);
37782
+ throw new Error(`Not existing tool ${tool}`);
37783
+ }
37784
+ });
37524
37785
  return /* @__PURE__ */ React__default.createElement("div", {
37525
37786
  id: RICH_TEXT_TOOL_BAR,
37526
37787
  style: { display: "flex", flexWrap: "nowrap" }
@@ -37529,117 +37790,13 @@ function Tools(props) {
37529
37790
  display: "flex",
37530
37791
  alignItems: "center"
37531
37792
  }
37532
- }, /* @__PURE__ */ React__default.createElement(BasicTools, null), mergeTags2 && /* @__PURE__ */ React__default.createElement(MergeTags, {
37533
- execCommand,
37534
- getPopupContainer: getPopoverMountNode
37535
- }), /* @__PURE__ */ React__default.createElement("div", {
37536
- className: "easy-email-extensions-divider"
37537
- }), /* @__PURE__ */ React__default.createElement("div", {
37538
- className: "easy-email-extensions-divider"
37539
- }), /* @__PURE__ */ React__default.createElement(FontFamily$1, {
37540
- execCommand,
37541
- getPopupContainer: getPopoverMountNode
37542
- }), /* @__PURE__ */ React__default.createElement("div", {
37543
- className: "easy-email-extensions-divider"
37544
- }), /* @__PURE__ */ React__default.createElement(FontSize, {
37545
- execCommand,
37546
- getPopupContainer: getPopoverMountNode
37547
- }), /* @__PURE__ */ React__default.createElement("div", {
37548
- className: "easy-email-extensions-divider"
37549
- }), /* @__PURE__ */ React__default.createElement(Bold, {
37550
- currentRange: selectionRange,
37551
- onChange: () => execCommandWithRange("bold")
37552
- }), /* @__PURE__ */ React__default.createElement("div", {
37553
- className: "easy-email-extensions-divider"
37554
- }), /* @__PURE__ */ React__default.createElement(Italic, {
37555
- currentRange: selectionRange,
37556
- onChange: () => execCommandWithRange("italic")
37557
- }), /* @__PURE__ */ React__default.createElement("div", {
37558
- className: "easy-email-extensions-divider"
37559
- }), /* @__PURE__ */ React__default.createElement(StrikeThrough, {
37560
- currentRange: selectionRange,
37561
- onChange: () => execCommandWithRange("strikeThrough")
37562
- }), /* @__PURE__ */ React__default.createElement("div", {
37563
- className: "easy-email-extensions-divider"
37564
- }), /* @__PURE__ */ React__default.createElement(Underline, {
37565
- currentRange: selectionRange,
37566
- onChange: () => execCommandWithRange("underline")
37567
- }), /* @__PURE__ */ React__default.createElement("div", {
37568
- className: "easy-email-extensions-divider"
37569
- }), /* @__PURE__ */ React__default.createElement(IconFontColor, {
37570
- selectionRange,
37571
- execCommand,
37572
- getPopoverMountNode
37573
- }), /* @__PURE__ */ React__default.createElement("div", {
37574
- className: "easy-email-extensions-divider"
37575
- }), /* @__PURE__ */ React__default.createElement(IconBgColor, {
37576
- selectionRange,
37577
- execCommand,
37578
- getPopoverMountNode
37579
- }), /* @__PURE__ */ React__default.createElement("div", {
37580
- className: "easy-email-extensions-divider"
37581
- }), /* @__PURE__ */ React__default.createElement(Link$1, {
37582
- currentRange: selectionRange,
37583
- onChange: (values2) => execCommand("createLink", values2),
37584
- getPopupContainer: getPopoverMountNode
37585
- }), /* @__PURE__ */ React__default.createElement("div", {
37586
- className: "easy-email-extensions-divider"
37587
- }), /* @__PURE__ */ React__default.createElement(Unlink, {
37588
- currentRange: selectionRange,
37589
- onChange: () => execCommand("")
37590
- }), /* @__PURE__ */ React__default.createElement("div", {
37591
- className: "easy-email-extensions-divider"
37592
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37593
- onClick: () => execCommand("justifyLeft"),
37594
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37595
- iconName: "icon-align-left"
37596
- }),
37597
- title: t("Align left")
37598
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37599
- onClick: () => execCommand("justifyCenter"),
37600
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37601
- iconName: "icon-align-center"
37602
- }),
37603
- title: t("Align center")
37604
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37605
- onClick: () => execCommand("justifyRight"),
37606
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37607
- iconName: "icon-align-right"
37608
- }),
37609
- title: t("Align right")
37610
- }), /* @__PURE__ */ React__default.createElement("div", {
37611
- className: "easy-email-extensions-divider"
37612
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37613
- onClick: () => execCommand("insertOrderedList"),
37614
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37615
- iconName: "icon-list-ol"
37616
- }),
37617
- title: t("Orderlist")
37618
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37619
- onClick: () => execCommand("insertUnorderedList"),
37620
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37621
- iconName: "icon-list-ul"
37622
- }),
37623
- title: t("Unorderlist")
37624
- }), /* @__PURE__ */ React__default.createElement("div", {
37625
- className: "easy-email-extensions-divider"
37626
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37627
- onClick: () => execCommand("insertHorizontalRule"),
37628
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37629
- iconName: "icon-line"
37630
- }),
37631
- title: t("Line")
37632
- }), /* @__PURE__ */ React__default.createElement("div", {
37633
- className: "easy-email-extensions-divider"
37634
- }), /* @__PURE__ */ React__default.createElement(ToolItem$1, {
37635
- onClick: () => execCommand("removeFormat"),
37636
- icon: /* @__PURE__ */ React__default.createElement(IconFont, {
37637
- iconName: "icon-close"
37638
- }),
37639
- title: t("Remove format")
37640
- }), /* @__PURE__ */ React__default.createElement("div", {
37641
- className: "easy-email-extensions-divider"
37642
- })));
37793
+ }, /* @__PURE__ */ React__default.createElement(BasicTools, null), tools.flatMap((tool, index2) => [
37794
+ tool,
37795
+ /* @__PURE__ */ React__default.createElement("div", {
37796
+ className: "easy-email-extensions-divider",
37797
+ key: `divider-${index2}`
37798
+ })
37799
+ ])), (_b = toolbar == null ? void 0 : toolbar.suffix) == null ? void 0 : _b.call(toolbar, execCommand));
37643
37800
  }
37644
37801
  var styleText = ".easy-email-extensions-emailToolItem{display:inline-flex;align-items:center;justify-content:center;position:relative;outline:none;font-weight:400;appearance:none;cursor:pointer!important;white-space:nowrap;transition:all .1s linear;box-sizing:border-box;border-radius:2px;border:none;background-color:transparent;color:#fff;width:28px;height:27px}.easy-email-extensions-emailToolItem:hover,.easy-email-extensions-emailToolItem-active{background-color:#f2f3f5;color:#4e5969}.easy-email-extensions-divider{position:relative;display:inline-flex;width:1px;height:16px;background-color:#808080e6}\n";
37645
37802
  function RichTextToolBar(props) {
@@ -38090,7 +38247,7 @@ function getDirectionFormDropPosition(position) {
38090
38247
  return "bottom";
38091
38248
  return "";
38092
38249
  }
38093
- const iconsMap = {
38250
+ let iconsMap = {
38094
38251
  [BasicType.TEXT]: "icon-text",
38095
38252
  [BasicType.SECTION]: "icon-section",
38096
38253
  [BasicType.COLUMN]: "icon-column",
@@ -38124,6 +38281,9 @@ const iconsMap = {
38124
38281
  function getIconNameByBlockType(type) {
38125
38282
  return lodash.exports.get(iconsMap, type) || "icon-number";
38126
38283
  }
38284
+ function setIconsMap(map) {
38285
+ iconsMap = __spreadValues(__spreadValues({}, iconsMap), map);
38286
+ }
38127
38287
  const tempEle = document.createElement("div");
38128
38288
  function getBlockTitle(blockData, isFromContent = true) {
38129
38289
  var _a;
@@ -38181,8 +38341,8 @@ function BlockLayer(props) {
38181
38341
  blockData: data,
38182
38342
  onToggleVisible
38183
38343
  })));
38184
- }, [onToggleVisible, propsRenderTitle]);
38185
- const treeData = useMemo(() => {
38344
+ }, [onToggleVisible, propsRenderTitle, values2]);
38345
+ const getTreeData = () => {
38186
38346
  const copyData = lodash.exports.cloneDeep(pageData2);
38187
38347
  const loop = (item2, id, parent2) => {
38188
38348
  item2.id = id;
@@ -38191,7 +38351,8 @@ function BlockLayer(props) {
38191
38351
  };
38192
38352
  loop(copyData, getPageIdx(), null);
38193
38353
  return [copyData];
38194
- }, [pageData2]);
38354
+ };
38355
+ const treeData = getTreeData();
38195
38356
  const onSelect = useCallback((selectedId) => {
38196
38357
  setFocusIdx(selectedId);
38197
38358
  setTimeout(() => {
@@ -46923,7 +47084,7 @@ function EditPanel({
46923
47084
  mjmlReadOnly: mjmlReadOnly2
46924
47085
  }) {
46925
47086
  const { height } = useEditorProps();
46926
- const { compact = true } = useExtensionProps();
47087
+ const { compact = true, showBlockLayer = true } = useExtensionProps();
46927
47088
  return /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
46928
47089
  className: styles$1.blocksPanel,
46929
47090
  style: { paddingRight: 0, minWidth: 360 },
@@ -46943,7 +47104,7 @@ function EditPanel({
46943
47104
  title: t("Block")
46944
47105
  }, /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, {
46945
47106
  height: `calc(${height} - 60px)`
46946
- }, /* @__PURE__ */ React__default.createElement(Blocks, null))), /* @__PURE__ */ React__default.createElement(TabPane, {
47107
+ }, /* @__PURE__ */ React__default.createElement(Blocks, null))), showBlockLayer && /* @__PURE__ */ React__default.createElement(TabPane, {
46947
47108
  key: "1",
46948
47109
  title: t("Layer")
46949
47110
  }, /* @__PURE__ */ React__default.createElement(FullHeightOverlayScrollbars, {
@@ -47090,5 +47251,5 @@ const StandardLayout = (props) => {
47090
47251
  style: { width: 0, overflow: "hidden" }
47091
47252
  }))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
47092
47253
  };
47093
- export { useExtensionProps as $, AttributePanel as A, BlockLayer as B, Color as C, Decoration as D, Padding as E, FontFamily as F, ClassName as G, Height as H, PresetColorsProvider as I, ShortcutToolbar as J, BlockMarketManager as K, LetterSpacing as L, MjmlToJson as M, NavbarLinkPadding as N, BlockMaskWrapper as O, Page as P, SourceCodePanel as Q, InteractivePrompt as R, SelectionRangeProvider as S, TextAlign as T, SimpleLayout as U, VerticalAlign as V, Width as W, StandardLayout as X, MergeTagBadgePrompt as Y, ExtensionContext as Z, ExtensionProvider as _, getIconNameByBlockType as a, RICH_TEXT_TOOL_BAR as a0, TextField as a1, InputWithUnitField as a2, SearchField as a3, TextAreaField as a4, NumberField as a5, SliderField as a6, UploadField as a7, ImageUploaderField as a8, SelectField as a9, TreeSelectField as aa, AutoCompleteField as ab, RadioGroupField as ac, SwitchField as ad, CheckboxField as ae, EditTabField as af, EditGridTabField as ag, InlineTextField as ah, ColorPickerField as ai, enhancer as aj, RichTextField as ak, ShadowDom as al, getBlockTitle as b, commonjsGlobal as c, BlockAttributeConfigurationManager as d, Align as e, AttributesPanelWrapper as f, getContextMergeTags as g, CollapseWrapper as h, Condition as i, ContainerBackgroundColor as j, TextDecoration as k, Background as l, LineHeight as m, TextTransform as n, BackgroundColor as o, Direction as p, Link as q, Border as r, Margin as s, BorderColor as t, FontSize$1 as u, MergeTags$1 as v, BorderStyle as w, FontStyle as x, BorderWidth as y, FontWeight as z };
47254
+ export { ExtensionProvider as $, AttributePanel as A, BlockLayer as B, Color as C, Decoration as D, FontWeight as E, FontFamily as F, Padding as G, Height as H, ClassName as I, PresetColorsProvider as J, ShortcutToolbar as K, LetterSpacing as L, MjmlToJson as M, NavbarLinkPadding as N, BlockMarketManager as O, Page as P, BlockMaskWrapper as Q, SourceCodePanel as R, SelectionRangeProvider as S, TextAlign as T, InteractivePrompt as U, VerticalAlign as V, Width as W, SimpleLayout as X, StandardLayout as Y, MergeTagBadgePrompt as Z, ExtensionContext as _, getIconNameByBlockType as a, useExtensionProps as a0, RICH_TEXT_TOOL_BAR as a1, TextField as a2, InputWithUnitField as a3, SearchField as a4, TextAreaField as a5, NumberField as a6, SliderField as a7, UploadField as a8, ImageUploaderField as a9, SelectField as aa, TreeSelectField as ab, AutoCompleteField as ac, RadioGroupField as ad, SwitchField as ae, CheckboxField as af, EditTabField as ag, EditGridTabField as ah, InlineTextField as ai, ColorPickerField as aj, enhancer as ak, RichTextField as al, ShadowDom as am, getBlockTitle as b, commonjsGlobal as c, BlockAttributeConfigurationManager as d, Align as e, AttributesPanelWrapper as f, getContextMergeTags as g, CollapseWrapper as h, Condition as i, ContainerBackgroundColor as j, TextDecoration as k, Background as l, LineHeight as m, TextTransform as n, BackgroundColor as o, Direction as p, Link as q, Border as r, setIconsMap as s, Margin as t, BorderColor as u, FontSize$1 as v, MergeTags$1 as w, BorderStyle as x, FontStyle as y, BorderWidth as z };
47094
47255
  //# sourceMappingURL=index2.js.map