easy-email-extensions 3.1.41 → 3.1.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,4 +7,7 @@ export interface IBlockDataWithId extends IBlockData {
7
7
  children: IBlockDataWithId[];
8
8
  className?: string;
9
9
  }
10
- export declare function BlockLayer(): JSX.Element | null;
10
+ export interface BlockLayerProps {
11
+ renderTitle?: (block: IBlockDataWithId) => React.ReactNode;
12
+ }
13
+ export declare function BlockLayer(props: BlockLayerProps): JSX.Element | null;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { BlockLayerProps } from '../BlockLayer';
2
3
  export declare const SimpleLayout: React.FC<{
3
4
  showSourceCode?: boolean;
4
- }>;
5
+ } & BlockLayerProps>;
package/lib/index2.js CHANGED
@@ -42031,11 +42031,12 @@ function getBlockTitle(blockData, isFromContent = true) {
42031
42031
  tempEle.innerHTML = blockData.data.value.content;
42032
42032
  return tempEle.innerText;
42033
42033
  }
42034
- const blockName = (_a = BlockManager.getBlockByType(blockData.type)) == null ? void 0 : _a.name;
42034
+ const blockName = ((_a = BlockManager.getBlockByType(blockData.type)) == null ? void 0 : _a.name) || "";
42035
42035
  return blockName;
42036
42036
  }
42037
- function BlockLayer() {
42037
+ function BlockLayer(props) {
42038
42038
  const { pageData: pageData2 } = useEditorContext();
42039
+ const { renderTitle: propsRenderTitle } = props;
42039
42040
  const { focusIdx: focusIdx2, setFocusIdx } = useFocusIdx();
42040
42041
  const { setHoverIdx, setIsDragging, setDirection } = useHoverIdx();
42041
42042
  const { moveBlock, setValueByIdx: setValueByIdx2, copyBlock, removeBlock, values: values2 } = useBlock();
@@ -42052,7 +42053,7 @@ function BlockLayer() {
42052
42053
  }, [setValueByIdx2, valueRef]);
42053
42054
  const renderTitle = useCallback((data) => {
42054
42055
  const isPage = data.type === BasicType.PAGE;
42055
- const title2 = getBlockTitle(data);
42056
+ const title2 = propsRenderTitle ? propsRenderTitle(data) : getBlockTitle(data);
42056
42057
  return /* @__PURE__ */ React__default.createElement("div", {
42057
42058
  "data-tree-idx": data.id,
42058
42059
  className: classnames(styles$6.title, !isPage && getNodeIdxClassName(data.id), !isPage && "email-block")
@@ -42063,7 +42064,7 @@ function BlockLayer() {
42063
42064
  iconName: getIconNameByBlockType(data.type),
42064
42065
  style: { fontSize: 12, color: "#999" }
42065
42066
  }), /* @__PURE__ */ React__default.createElement("div", {
42066
- title: title2,
42067
+ title: lodash.exports.isString(title2) ? title2 : "",
42067
42068
  style: { overflow: "hidden", whiteSpace: "nowrap", width: "5em" }
42068
42069
  }, /* @__PURE__ */ React__default.createElement(TextStyle, {
42069
42070
  size: "smallest"
@@ -42073,7 +42074,7 @@ function BlockLayer() {
42073
42074
  blockData: data,
42074
42075
  onToggleVisible
42075
42076
  })));
42076
- }, [onToggleVisible]);
42077
+ }, [onToggleVisible, propsRenderTitle]);
42077
42078
  const treeData = useMemo(() => {
42078
42079
  const copyData = lodash.exports.cloneDeep(pageData2);
42079
42080
  const loop2 = (item2, id, parent2) => {
@@ -45207,7 +45208,9 @@ const SimpleLayout = (props) => {
45207
45208
  }, /* @__PURE__ */ React__default.createElement(Card$1, {
45208
45209
  title: "Layout",
45209
45210
  style: { border: "none" }
45210
- }, /* @__PURE__ */ React__default.createElement(BlockLayer, null))))), /* @__PURE__ */ React__default.createElement(Layout$1, {
45211
+ }, /* @__PURE__ */ React__default.createElement(BlockLayer, {
45212
+ renderTitle: props.renderTitle
45213
+ }))))), /* @__PURE__ */ React__default.createElement(Layout$1, {
45211
45214
  style: { height: containerHeight }
45212
45215
  }, props.children), /* @__PURE__ */ React__default.createElement(Layout$1.Sider, {
45213
45216
  style: {