easy-email-pro-theme 1.52.0 → 1.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +651 -113
- package/lib/style.css +30 -14
- package/lib/typings/components/ConfigurationPanel/Schemas/Blockquote.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Button.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Column.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Divider.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Group.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Hero.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Image.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Navbar.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Page.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Section.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Social.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Spacer.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Table.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Table2.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Text.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/Wrapper.d.ts +2 -0
- package/lib/typings/components/ConfigurationPanel/Schemas/index.d.ts +7 -0
- package/lib/typings/components/ConfigurationPanel/components/SchemaPanelRenderer.d.ts +9 -0
- package/lib/typings/components/EditorContainer/index.d.ts +5 -0
- package/lib/typings/components/Form/ImageUploaderField/index.d.ts +1 -0
- package/lib/typings/components/index.d.ts +1 -0
- package/lib/typings/constants/index.d.ts +1 -0
- package/lib/typings/typings/custom-types.d.ts +1 -0
- package/lib/typings/typings/index.d.ts +1 -0
- package/lib/typings/typings/schema.d.ts +46 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
54
54
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
import { classnames, useEditorActions, useDragNodePath, useStandaloneElementEditing, useEditorProps, useRefState, isDOMElement, useMergeTagsData, useLockState, useEventCallback, useSelectedNodePath, useSelectedNode, useSetSelectedNodePath, useSetHoverNodePath, useUniversalElementEditing, useUniversalElementPath, useStandaloneElementPath, useStandaloneElement, useActiveTab, ActiveTabKeys, toggleFormat, TextFormat, useUniversalElement, isFormatActive, validation, CustomEvent, getDynamicImagePlaceholder, EmailEditorProvider, EmailEditor,
|
|
57
|
+
import { classnames, useEditorActions, useDragNodePath, useStandaloneElementEditing, useEditorProps, useRefState, isDOMElement, useMergeTagsData, useLockState, useEventCallback, useSelectedNodePath, useSelectedNode, useSetSelectedNodePath, useSetHoverNodePath, useUniversalElementEditing, useUniversalElementPath, useStandaloneElementPath, useStandaloneElement, useEditorState, useActiveTab, ActiveTabKeys, toggleFormat, TextFormat, useUniversalElement, isFormatActive, validation, CustomEvent, getDynamicImagePlaceholder, EmailEditorProvider, EmailEditor, useForceUpdate, useEqualState, IframeComponent, HtmlStringToReactNodes, useStandaloneElementSaveButton, ExternalComponents, useDragoverDirection } from "easy-email-pro-editor";
|
|
58
58
|
import { useSlate, ReactEditor, useSlateStatic, useSelected } from "slate-react";
|
|
59
59
|
import * as React$2 from "react";
|
|
60
60
|
import React__default, { useRef, useState, useEffect, useCallback, useMemo, createContext, useContext, useLayoutEffect, memo, useReducer, cloneElement, forwardRef, Suspense, Component, createElement } from "react";
|
|
@@ -63,7 +63,7 @@ import { cloneDeep, get, isEqual, set, omit as omit$2, merge as merge$1, debounc
|
|
|
63
63
|
import { Editor, Range, Node, Transforms, Path, Text as Text$2, createEditor } from "slate";
|
|
64
64
|
import { nanoid } from "nanoid";
|
|
65
65
|
import { Form, Input, Modal, Collapse, Space, Empty, Card, Grid, Button as Button$2, Drawer, Switch, Typography as Typography$1, Tabs, Radio, Tooltip, Divider as Divider$2, Alert, Popconfirm, Message, PageHeader, Spin, Layout as Layout$2, Popover, Select as Select$1, Slider, InputNumber, Tag, Link as Link$3, List as List$1, Skeleton, Trigger } from "@arco-design/web-react";
|
|
66
|
-
import { IconPlus, IconDelete, IconEdit, IconLeft, IconDownload,
|
|
66
|
+
import { IconPlus, IconCopy, IconDelete, IconEdit, IconLeft, IconDownload, IconUndo, IconRedo, IconMinus, IconEye, IconSubscribeAdd, IconClose, IconCheckCircleFill, IconDragArrow, IconPalette, IconLock, IconUnlock, IconImage, IconQuestionCircle, IconLink, IconCloud, IconDragDotVertical, IconSend, IconDown } from "@arco-design/web-react/icon";
|
|
67
67
|
import { unstable_batchedUpdates, createPortal } from "react-dom";
|
|
68
68
|
import mjml from "mjml-browser";
|
|
69
69
|
import { HistoryEditor } from "slate-history";
|
|
@@ -7095,19 +7095,23 @@ function normalizeLocalDisabled(localDisabled, globalDisabled) {
|
|
|
7095
7095
|
};
|
|
7096
7096
|
}
|
|
7097
7097
|
[KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
|
|
7098
|
-
const item$2 = "
|
|
7099
|
-
const itemContent = "
|
|
7100
|
-
const itemActions = "
|
|
7101
|
-
const
|
|
7102
|
-
const
|
|
7103
|
-
const
|
|
7104
|
-
const
|
|
7105
|
-
const
|
|
7106
|
-
const
|
|
7098
|
+
const item$2 = "_item_7uv5l_1";
|
|
7099
|
+
const itemContent = "_itemContent_7uv5l_8";
|
|
7100
|
+
const itemActions = "_itemActions_7uv5l_26";
|
|
7101
|
+
const itemHovered = "_itemHovered_7uv5l_30";
|
|
7102
|
+
const itemSelected = "_itemSelected_7uv5l_34";
|
|
7103
|
+
const itemLabelWrapper = "_itemLabelWrapper_7uv5l_43";
|
|
7104
|
+
const itemLabel = "_itemLabel_7uv5l_43";
|
|
7105
|
+
const action = "_action_7uv5l_56";
|
|
7106
|
+
const itemTitle = "_itemTitle_7uv5l_73";
|
|
7107
|
+
const itemCollapse = "_itemCollapse_7uv5l_79";
|
|
7108
|
+
const itemChildren = "_itemChildren_7uv5l_100";
|
|
7107
7109
|
const styles$4 = {
|
|
7108
7110
|
item: item$2,
|
|
7109
7111
|
itemContent,
|
|
7110
7112
|
itemActions,
|
|
7113
|
+
itemHovered,
|
|
7114
|
+
itemSelected,
|
|
7111
7115
|
itemLabelWrapper,
|
|
7112
7116
|
itemLabel,
|
|
7113
7117
|
action,
|
|
@@ -7320,21 +7324,41 @@ function ComponentItem({
|
|
|
7320
7324
|
onToggleCollapse,
|
|
7321
7325
|
dragHandleProps = {}
|
|
7322
7326
|
}) {
|
|
7323
|
-
const { setSelectedNodePath } = useEditorActions();
|
|
7324
|
-
const {
|
|
7327
|
+
const { setSelectedNodePath, setHoverNodePath } = useEditorActions();
|
|
7328
|
+
const { hoverNodePath, selectedNodePath } = useEditorState();
|
|
7329
|
+
const { deleteBlock, copyBlock } = useElementInteract();
|
|
7325
7330
|
const editor = useSlateStatic();
|
|
7331
|
+
const path2 = useMemo(() => {
|
|
7332
|
+
try {
|
|
7333
|
+
return ReactEditor.findPath(editor, component.block);
|
|
7334
|
+
} catch (error2) {
|
|
7335
|
+
return null;
|
|
7336
|
+
}
|
|
7337
|
+
}, [component.block, editor]);
|
|
7326
7338
|
const onClick = () => {
|
|
7327
|
-
|
|
7339
|
+
if (!path2)
|
|
7340
|
+
return;
|
|
7341
|
+
let newPath = path2;
|
|
7328
7342
|
if (NodeUtils.isUnsetElement(component.block)) {
|
|
7329
|
-
|
|
7343
|
+
newPath = Path.parent(newPath);
|
|
7330
7344
|
}
|
|
7331
|
-
setSelectedNodePath(
|
|
7345
|
+
setSelectedNodePath(newPath);
|
|
7332
7346
|
};
|
|
7333
7347
|
const onRemove = (e) => {
|
|
7348
|
+
try {
|
|
7349
|
+
e.stopPropagation();
|
|
7350
|
+
const path22 = ReactEditor.findPath(editor, component.block);
|
|
7351
|
+
deleteBlock(path22);
|
|
7352
|
+
setSelectedNodePath(null);
|
|
7353
|
+
} catch (error2) {
|
|
7354
|
+
console.error(error2);
|
|
7355
|
+
}
|
|
7356
|
+
};
|
|
7357
|
+
const onCopy = (e) => {
|
|
7334
7358
|
e.stopPropagation();
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7359
|
+
if (!path2)
|
|
7360
|
+
return;
|
|
7361
|
+
copyBlock(path2);
|
|
7338
7362
|
};
|
|
7339
7363
|
const hasBlockChildren = component.block.children.every(
|
|
7340
7364
|
(child) => NodeUtils.isBlockElement(child)
|
|
@@ -7369,56 +7393,99 @@ function ComponentItem({
|
|
|
7369
7393
|
}
|
|
7370
7394
|
return text;
|
|
7371
7395
|
}, [component.block, label]);
|
|
7372
|
-
|
|
7396
|
+
const isHovered = useMemo(() => {
|
|
7397
|
+
if (!path2 || !hoverNodePath)
|
|
7398
|
+
return false;
|
|
7399
|
+
return Path.equals(path2, hoverNodePath);
|
|
7400
|
+
}, [path2, hoverNodePath]);
|
|
7401
|
+
const isSelected = useMemo(() => {
|
|
7402
|
+
if (!path2 || !selectedNodePath)
|
|
7403
|
+
return false;
|
|
7404
|
+
return Path.equals(path2, selectedNodePath);
|
|
7405
|
+
}, [path2, selectedNodePath]);
|
|
7406
|
+
const handleMouseEnter = () => {
|
|
7407
|
+
if (path2) {
|
|
7408
|
+
setHoverNodePath(path2);
|
|
7409
|
+
}
|
|
7410
|
+
};
|
|
7411
|
+
const handleMouseLeave = () => {
|
|
7412
|
+
setHoverNodePath(null);
|
|
7413
|
+
};
|
|
7414
|
+
const itemClassName = useMemo(() => {
|
|
7415
|
+
const classes = [styles$4.item];
|
|
7416
|
+
if (isHovered)
|
|
7417
|
+
classes.push(styles$4.itemHovered);
|
|
7418
|
+
if (isSelected)
|
|
7419
|
+
classes.push(styles$4.itemSelected);
|
|
7420
|
+
return classes.join(" ");
|
|
7421
|
+
}, [isHovered, isSelected]);
|
|
7422
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
7373
7423
|
"div",
|
|
7374
7424
|
{
|
|
7375
|
-
className:
|
|
7376
|
-
|
|
7377
|
-
|
|
7425
|
+
className: itemClassName,
|
|
7426
|
+
onClick,
|
|
7427
|
+
onMouseEnter: handleMouseEnter,
|
|
7428
|
+
onMouseLeave: handleMouseLeave
|
|
7378
7429
|
},
|
|
7379
|
-
/* @__PURE__ */ React__default.createElement(
|
|
7430
|
+
/* @__PURE__ */ React__default.createElement("div", { className: styles$4.itemContent }, /* @__PURE__ */ React__default.createElement("div", { className: styles$4.itemTitle }, /* @__PURE__ */ React__default.createElement(
|
|
7380
7431
|
"div",
|
|
7381
7432
|
{
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
}
|
|
7433
|
+
className: styles$4.itemCollapse,
|
|
7434
|
+
style: { opacity: hasBlockChildren ? 1 : 0 },
|
|
7435
|
+
onClick: handleCollapseClick
|
|
7386
7436
|
},
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
height: 16
|
|
7395
|
-
}
|
|
7396
|
-
), /* @__PURE__ */ React__default.createElement("div", { className: styles$4.itemLabel }, displayLabel))), /* @__PURE__ */ React__default.createElement(
|
|
7397
|
-
"div",
|
|
7398
|
-
{
|
|
7399
|
-
className: styles$4.itemActions,
|
|
7400
|
-
onClick: (e) => e.stopPropagation()
|
|
7401
|
-
},
|
|
7402
|
-
/* @__PURE__ */ React__default.createElement("div", { className: styles$4.action, onClick: onRemove }, /* @__PURE__ */ React__default.createElement(IconDelete, null)),
|
|
7403
|
-
/* @__PURE__ */ React__default.createElement(
|
|
7404
|
-
"div",
|
|
7405
|
-
__spreadValues({
|
|
7406
|
-
style: {
|
|
7407
|
-
cursor: "grab"
|
|
7437
|
+
/* @__PURE__ */ React__default.createElement(
|
|
7438
|
+
"div",
|
|
7439
|
+
{
|
|
7440
|
+
style: {
|
|
7441
|
+
transform: isCollapsed ? "rotate(-90deg)" : "rotate(0)",
|
|
7442
|
+
transition: "transform 0.2s"
|
|
7443
|
+
}
|
|
7408
7444
|
},
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7445
|
+
collapseIcon
|
|
7446
|
+
)
|
|
7447
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: styles$4.itemLabelWrapper }, /* @__PURE__ */ React__default.createElement(
|
|
7448
|
+
SharedComponents.ElementIcon,
|
|
7449
|
+
{
|
|
7450
|
+
type: component.block.type,
|
|
7451
|
+
width: 16,
|
|
7452
|
+
height: 16
|
|
7453
|
+
}
|
|
7454
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: styles$4.itemLabel }, displayLabel))), /* @__PURE__ */ React__default.createElement(
|
|
7455
|
+
"div",
|
|
7456
|
+
{
|
|
7457
|
+
className: styles$4.itemActions,
|
|
7458
|
+
onClick: (e) => e.stopPropagation()
|
|
7459
|
+
},
|
|
7460
|
+
/* @__PURE__ */ React__default.createElement("div", { className: styles$4.action, onClick: onCopy }, /* @__PURE__ */ React__default.createElement(IconCopy, null)),
|
|
7461
|
+
/* @__PURE__ */ React__default.createElement("div", { className: styles$4.action, onClick: onRemove }, /* @__PURE__ */ React__default.createElement(IconDelete, null)),
|
|
7462
|
+
/* @__PURE__ */ React__default.createElement(
|
|
7463
|
+
"div",
|
|
7464
|
+
__spreadValues({
|
|
7465
|
+
style: {
|
|
7466
|
+
cursor: "grab"
|
|
7467
|
+
},
|
|
7468
|
+
className: styles$4.action
|
|
7469
|
+
}, dragHandleProps),
|
|
7470
|
+
/* @__PURE__ */ React__default.createElement("svg", { viewBox: "0 0 20 20", width: "12" }, /* @__PURE__ */ React__default.createElement("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }))
|
|
7471
|
+
)
|
|
7472
|
+
))
|
|
7473
|
+
);
|
|
7414
7474
|
}
|
|
7415
7475
|
const collapseIcon = /* @__PURE__ */ React__default.createElement("svg", { width: "10", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 70 41" }, /* @__PURE__ */ React__default.createElement("path", { d: "M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z" }));
|
|
7416
7476
|
const BlockLayer = () => {
|
|
7417
7477
|
const { values, inited } = useEditorContext();
|
|
7418
7478
|
const pageElement = values.content;
|
|
7419
|
-
const
|
|
7479
|
+
const { layerDefaultCollapsed, enabledAutoComplete } = useEditorProps();
|
|
7480
|
+
const defaultCollapsedAll = useMemo(() => {
|
|
7481
|
+
if (enabledAutoComplete && isUndefined$1(layerDefaultCollapsed)) {
|
|
7482
|
+
return true;
|
|
7483
|
+
}
|
|
7484
|
+
return Boolean(layerDefaultCollapsed);
|
|
7485
|
+
}, [enabledAutoComplete, layerDefaultCollapsed]);
|
|
7486
|
+
const [allCollapsed, setAllCollapsed] = useState(defaultCollapsedAll);
|
|
7420
7487
|
const [collapsedItems, setCollapsedItems] = useState(/* @__PURE__ */ new Set());
|
|
7421
|
-
const handleCollapseToggle = (checked) => {
|
|
7488
|
+
const handleCollapseToggle = useEventCallback((checked) => {
|
|
7422
7489
|
setAllCollapsed(checked);
|
|
7423
7490
|
if (checked) {
|
|
7424
7491
|
const newCollapsedItems = /* @__PURE__ */ new Set();
|
|
@@ -7440,7 +7507,7 @@ const BlockLayer = () => {
|
|
|
7440
7507
|
} else {
|
|
7441
7508
|
setCollapsedItems(/* @__PURE__ */ new Set());
|
|
7442
7509
|
}
|
|
7443
|
-
};
|
|
7510
|
+
});
|
|
7444
7511
|
const toggleItemCollapse = (itemId, block) => {
|
|
7445
7512
|
setCollapsedItems((prev) => {
|
|
7446
7513
|
const newCollapsed = new Set(prev);
|
|
@@ -7464,6 +7531,11 @@ const BlockLayer = () => {
|
|
|
7464
7531
|
});
|
|
7465
7532
|
setAllCollapsed(false);
|
|
7466
7533
|
};
|
|
7534
|
+
useEffect(() => {
|
|
7535
|
+
if (defaultCollapsedAll) {
|
|
7536
|
+
handleCollapseToggle(defaultCollapsedAll);
|
|
7537
|
+
}
|
|
7538
|
+
}, [defaultCollapsedAll, handleCollapseToggle]);
|
|
7467
7539
|
if (!inited)
|
|
7468
7540
|
return null;
|
|
7469
7541
|
return /* @__PURE__ */ React__default.createElement("div", { onMouseOut: (e) => e.stopPropagation() }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -8055,7 +8127,7 @@ const Controller = () => {
|
|
|
8055
8127
|
position: "fixed",
|
|
8056
8128
|
bottom: offset.bottom,
|
|
8057
8129
|
left: offset.left,
|
|
8058
|
-
zIndex:
|
|
8130
|
+
zIndex: 1,
|
|
8059
8131
|
cursor: "grab"
|
|
8060
8132
|
}
|
|
8061
8133
|
},
|
|
@@ -14409,12 +14481,14 @@ const getElementPageLayout = (params) => {
|
|
|
14409
14481
|
relativedElementVisible
|
|
14410
14482
|
};
|
|
14411
14483
|
};
|
|
14484
|
+
const EDITOR_CONTAINER = "EditorContainer";
|
|
14412
14485
|
const HoveringToolbar = () => {
|
|
14413
14486
|
const ref = useRef(null);
|
|
14414
14487
|
const editor = useSlate();
|
|
14415
14488
|
const { hoveringToolbar } = useEditorProps();
|
|
14416
14489
|
const { selectedNode } = useSelectedNode();
|
|
14417
14490
|
const [isFocus, setIsFocus] = useState(false);
|
|
14491
|
+
const { lock } = useEditorState();
|
|
14418
14492
|
const { selection } = editor;
|
|
14419
14493
|
const nodePath = selectedNode && (selection == null ? void 0 : selection.anchor.path) ? selection.anchor.path : null;
|
|
14420
14494
|
const isTable2 = selectedNode && NodeUtils.isTable2Element(selectedNode);
|
|
@@ -14670,23 +14744,46 @@ const HoveringToolbar = () => {
|
|
|
14670
14744
|
if (hoveringToolbar == null ? void 0 : hoveringToolbar.fixed) {
|
|
14671
14745
|
return /* @__PURE__ */ React__default.createElement("div", null, content);
|
|
14672
14746
|
}
|
|
14747
|
+
const editorContainer = document.getElementById(EDITOR_CONTAINER);
|
|
14673
14748
|
return createPortal(
|
|
14674
|
-
/* @__PURE__ */ React__default.createElement(
|
|
14749
|
+
/* @__PURE__ */ React__default.createElement(
|
|
14675
14750
|
"div",
|
|
14676
14751
|
{
|
|
14677
|
-
|
|
14678
|
-
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14752
|
+
style: {
|
|
14753
|
+
position: "fixed",
|
|
14754
|
+
top: 0,
|
|
14755
|
+
left: 0,
|
|
14756
|
+
zIndex: 9999
|
|
14757
|
+
},
|
|
14758
|
+
onPointerDownCapture: (e) => {
|
|
14759
|
+
e.preventDefault();
|
|
14760
|
+
e.stopPropagation();
|
|
14761
|
+
}
|
|
14682
14762
|
},
|
|
14683
|
-
|
|
14684
|
-
|
|
14763
|
+
/* @__PURE__ */ React__default.createElement(
|
|
14764
|
+
"div",
|
|
14765
|
+
{
|
|
14766
|
+
key: String(isNotSelect),
|
|
14767
|
+
id: "HoveringToolbar",
|
|
14768
|
+
ref,
|
|
14769
|
+
"data-follow": (hoveringToolbar == null ? void 0 : hoveringToolbar.follow) || "selection",
|
|
14770
|
+
className: "HoveringToolbar"
|
|
14771
|
+
},
|
|
14772
|
+
/* @__PURE__ */ React__default.createElement(
|
|
14773
|
+
"div",
|
|
14774
|
+
{
|
|
14775
|
+
className: "HoveringToolbar-list",
|
|
14776
|
+
style: { visibility: lock ? "hidden" : "visible" }
|
|
14777
|
+
},
|
|
14778
|
+
content
|
|
14779
|
+
),
|
|
14780
|
+
/* @__PURE__ */ React__default.createElement("style", null, `#HoveringToolbar {
|
|
14685
14781
|
--hovering-bar-icon-size: ${(hoveringToolbar == null ? void 0 : hoveringToolbar.iconSize) || 12}px;
|
|
14686
14782
|
|
|
14687
14783
|
}`)
|
|
14688
|
-
|
|
14689
|
-
|
|
14784
|
+
)
|
|
14785
|
+
),
|
|
14786
|
+
editorContainer || document.body
|
|
14690
14787
|
);
|
|
14691
14788
|
};
|
|
14692
14789
|
function ColorPickerContent(props) {
|
|
@@ -16382,9 +16479,12 @@ const Image$5 = () => {
|
|
|
16382
16479
|
const editor = useSlate();
|
|
16383
16480
|
const ref = useRef(null);
|
|
16384
16481
|
const { onUpload } = useEditorProps();
|
|
16482
|
+
const { lock } = useEditorState();
|
|
16385
16483
|
const [from] = Form.useForm();
|
|
16386
16484
|
const onSubmit = (values) => {
|
|
16387
16485
|
var _a;
|
|
16486
|
+
if (lock)
|
|
16487
|
+
return;
|
|
16388
16488
|
let style = `max-width:100%;display:inline-block;`;
|
|
16389
16489
|
if (values.width) {
|
|
16390
16490
|
style += `width:${values.width};`;
|
|
@@ -16422,7 +16522,7 @@ const Image$5 = () => {
|
|
|
16422
16522
|
popupStyle: { padding: "0px" }
|
|
16423
16523
|
},
|
|
16424
16524
|
getPopupContainer: (node) => {
|
|
16425
|
-
return Array.from(document.querySelectorAll("
|
|
16525
|
+
return Array.from(document.querySelectorAll("#HoveringToolbar")).find(
|
|
16426
16526
|
(item2) => item2.contains(node)
|
|
16427
16527
|
);
|
|
16428
16528
|
},
|
|
@@ -16433,13 +16533,38 @@ const Image$5 = () => {
|
|
|
16433
16533
|
bodyStyle: { padding: "0px" },
|
|
16434
16534
|
title: /* @__PURE__ */ React__default.createElement("div", { style: { textAlign: "left" } }, t(`Insert image`))
|
|
16435
16535
|
},
|
|
16436
|
-
|
|
16536
|
+
lock && /* @__PURE__ */ React__default.createElement(
|
|
16537
|
+
Alert,
|
|
16538
|
+
{
|
|
16539
|
+
type: "warning",
|
|
16540
|
+
content: t(
|
|
16541
|
+
`This component is locked by the image drawer. Please complete your actions there first.`
|
|
16542
|
+
)
|
|
16543
|
+
}
|
|
16544
|
+
),
|
|
16545
|
+
/* @__PURE__ */ React__default.createElement("div", { style: { position: "relative" } }, lock && /* @__PURE__ */ React__default.createElement(
|
|
16546
|
+
"div",
|
|
16547
|
+
{
|
|
16548
|
+
style: {
|
|
16549
|
+
position: "absolute",
|
|
16550
|
+
top: 0,
|
|
16551
|
+
left: 0,
|
|
16552
|
+
right: 0,
|
|
16553
|
+
bottom: 0,
|
|
16554
|
+
backgroundColor: "rgba(255, 255, 255, 0.3)",
|
|
16555
|
+
zIndex: 10,
|
|
16556
|
+
cursor: "not-allowed"
|
|
16557
|
+
}
|
|
16558
|
+
}
|
|
16559
|
+
), /* @__PURE__ */ React__default.createElement(Form, { onSubmit, form: from }, /* @__PURE__ */ React__default.createElement("div", { style: { padding: "16px" } }, /* @__PURE__ */ React__default.createElement(
|
|
16437
16560
|
AttributeField.ImageUploaderField,
|
|
16438
16561
|
{
|
|
16439
16562
|
path: null,
|
|
16440
16563
|
name: "src",
|
|
16441
16564
|
label: null,
|
|
16565
|
+
enablePreview: false,
|
|
16442
16566
|
uploadHandler: onUpload,
|
|
16567
|
+
pinToParent: true,
|
|
16443
16568
|
formItem: {
|
|
16444
16569
|
wrapperCol: {
|
|
16445
16570
|
span: 24
|
|
@@ -16483,10 +16608,10 @@ const Image$5 = () => {
|
|
|
16483
16608
|
}
|
|
16484
16609
|
}
|
|
16485
16610
|
}
|
|
16486
|
-
)))), /* @__PURE__ */ React__default.createElement(Divider$2, { style: { margin: "0px" } }), /* @__PURE__ */ React__default.createElement(Grid.Row, { justify: "end", style: { padding: "16px" } }, /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(Button$2, { type: "primary", htmlType: "submit" }, t(`Apply`)), /* @__PURE__ */ React__default.createElement(Button$2, { onClick: () => {
|
|
16611
|
+
)))), /* @__PURE__ */ React__default.createElement(Divider$2, { style: { margin: "0px" } }), /* @__PURE__ */ React__default.createElement(Grid.Row, { justify: "end", style: { padding: "16px" } }, /* @__PURE__ */ React__default.createElement(Space, null, /* @__PURE__ */ React__default.createElement(Button$2, { type: "primary", htmlType: "submit", disabled: lock }, t(`Apply`)), /* @__PURE__ */ React__default.createElement(Button$2, { onClick: () => {
|
|
16487
16612
|
var _a;
|
|
16488
16613
|
return (_a = ref.current) == null ? void 0 : _a.click();
|
|
16489
|
-
} }, t(`Cancel`)))))
|
|
16614
|
+
} }, t(`Cancel`))))))
|
|
16490
16615
|
)
|
|
16491
16616
|
},
|
|
16492
16617
|
/* @__PURE__ */ React__default.createElement("span", { ref, className: classnames$1("formatButton") }, /* @__PURE__ */ React__default.createElement("span", { className: classnames$1(" iconfont icon-img") }))
|
|
@@ -27417,7 +27542,9 @@ function ImageUploader(props) {
|
|
|
27417
27542
|
const [isUploading, setIsUploading] = useState(false);
|
|
27418
27543
|
const [preview, setPreview] = useState(false);
|
|
27419
27544
|
const [unsplashVisible, setUnsplashVisible] = useState(false);
|
|
27545
|
+
const popupContainerRef = useRef(null);
|
|
27420
27546
|
const [popupVisible, setPopupVisible] = useState(false);
|
|
27547
|
+
const pinToParent = props.pinToParent;
|
|
27421
27548
|
const onChangeMergeTag = useCallback(
|
|
27422
27549
|
(mergetag) => {
|
|
27423
27550
|
props.onChange(PluginManager.generateVariable(mergetag));
|
|
@@ -27587,17 +27714,11 @@ function ImageUploader(props) {
|
|
|
27587
27714
|
});
|
|
27588
27715
|
const onCloseUnsplash = useEventCallback(() => __async(this, null, function* () {
|
|
27589
27716
|
if (dirty) {
|
|
27590
|
-
|
|
27717
|
+
props.onChange(initialVal.current);
|
|
27591
27718
|
}
|
|
27592
27719
|
setUnsplashVisible(false);
|
|
27593
27720
|
setLock(false);
|
|
27594
27721
|
}));
|
|
27595
|
-
useEffect(() => {
|
|
27596
|
-
if (!unsplashVisible)
|
|
27597
|
-
return;
|
|
27598
|
-
const isLock = dirty;
|
|
27599
|
-
setLock(isLock);
|
|
27600
|
-
}, [dirty, setLock, unsplashVisible]);
|
|
27601
27722
|
const formatMergetags = useMemo(() => {
|
|
27602
27723
|
return getMergeTagsByType(mergetags || [], "image");
|
|
27603
27724
|
}, [mergetags]);
|
|
@@ -27635,20 +27756,24 @@ function ImageUploader(props) {
|
|
|
27635
27756
|
"div",
|
|
27636
27757
|
{
|
|
27637
27758
|
className: styles$2.exportFreeImage,
|
|
27638
|
-
onClick: () =>
|
|
27759
|
+
onClick: () => {
|
|
27760
|
+
setUnsplashVisible(true);
|
|
27761
|
+
setLock(true);
|
|
27762
|
+
}
|
|
27639
27763
|
},
|
|
27640
27764
|
t("Export free images")
|
|
27641
27765
|
)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { style: { fontSize: 16 } }, t("Attach your image here.")), /* @__PURE__ */ React__default.createElement("div", { style: { color: "#606A72", fontSize: 14 } }, t("Accepts .jpg, .jpeg, .png, and .gif file types.")))
|
|
27642
27766
|
));
|
|
27643
27767
|
}
|
|
27644
27768
|
return /* @__PURE__ */ React__default.createElement("img", { src: image2, style: { maxWidth: "100%", maxHeight: "100%" } });
|
|
27645
|
-
}, [image2, isUploading, onUpload, props.value, unsplashClientId]);
|
|
27769
|
+
}, [image2, isUploading, onUpload, props.value, setLock, unsplashClientId]);
|
|
27646
27770
|
if (!props.uploadHandler) {
|
|
27647
27771
|
return /* @__PURE__ */ React__default.createElement(Input, { value: props.value, onChange });
|
|
27648
27772
|
}
|
|
27649
27773
|
return /* @__PURE__ */ React__default.createElement(
|
|
27650
27774
|
"div",
|
|
27651
27775
|
{
|
|
27776
|
+
ref: popupContainerRef,
|
|
27652
27777
|
onClick: (e) => {
|
|
27653
27778
|
e.stopPropagation();
|
|
27654
27779
|
e.preventDefault();
|
|
@@ -27691,7 +27816,10 @@ function ImageUploader(props) {
|
|
|
27691
27816
|
Select$1.Option,
|
|
27692
27817
|
{
|
|
27693
27818
|
value: "2",
|
|
27694
|
-
onClick: () =>
|
|
27819
|
+
onClick: () => {
|
|
27820
|
+
setUnsplashVisible(true);
|
|
27821
|
+
setLock(true);
|
|
27822
|
+
}
|
|
27695
27823
|
},
|
|
27696
27824
|
t("Export free images")
|
|
27697
27825
|
)
|
|
@@ -27717,6 +27845,7 @@ function ImageUploader(props) {
|
|
|
27717
27845
|
popupVisible,
|
|
27718
27846
|
onVisibleChange: setPopupVisible,
|
|
27719
27847
|
onChange: onChangeMergeTag,
|
|
27848
|
+
getPopupContainer: pinToParent ? () => popupContainerRef.current || document.body : void 0,
|
|
27720
27849
|
onClose,
|
|
27721
27850
|
value: "",
|
|
27722
27851
|
triggerElement: /* @__PURE__ */ React__default.createElement(
|
|
@@ -27738,14 +27867,6 @@ function ImageUploader(props) {
|
|
|
27738
27867
|
allowClear: true
|
|
27739
27868
|
}
|
|
27740
27869
|
))
|
|
27741
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
27742
|
-
Modal,
|
|
27743
|
-
{
|
|
27744
|
-
visible: preview,
|
|
27745
|
-
footer: null,
|
|
27746
|
-
onCancel: () => setPreview(false)
|
|
27747
|
-
},
|
|
27748
|
-
/* @__PURE__ */ React__default.createElement("img", { alt: "Preview", style: { width: "100%" }, src: image2 })
|
|
27749
27870
|
)),
|
|
27750
27871
|
/* @__PURE__ */ React__default.createElement(
|
|
27751
27872
|
Drawer,
|
|
@@ -27811,6 +27932,20 @@ function ImageUploader(props) {
|
|
|
27811
27932
|
presetList: unsplash == null ? void 0 : unsplash.presetList
|
|
27812
27933
|
}
|
|
27813
27934
|
)
|
|
27935
|
+
),
|
|
27936
|
+
/* @__PURE__ */ React__default.createElement(
|
|
27937
|
+
Modal,
|
|
27938
|
+
{
|
|
27939
|
+
wrapClassName: "ImageUploaderField-preview",
|
|
27940
|
+
visible: preview,
|
|
27941
|
+
footer: null,
|
|
27942
|
+
onCancel: () => setPreview(false),
|
|
27943
|
+
getPopupContainer: () => {
|
|
27944
|
+
return document.body;
|
|
27945
|
+
},
|
|
27946
|
+
style: { zIndex: 9999 }
|
|
27947
|
+
},
|
|
27948
|
+
/* @__PURE__ */ React__default.createElement("img", { alt: "Preview", style: { width: "100%" }, src: image2 })
|
|
27814
27949
|
)
|
|
27815
27950
|
);
|
|
27816
27951
|
}
|
|
@@ -32277,7 +32412,7 @@ function AttributesContainer$9({
|
|
|
32277
32412
|
tabPosition: "top",
|
|
32278
32413
|
name: `children`,
|
|
32279
32414
|
label: "",
|
|
32280
|
-
renderItem: (item2, index2) => /* @__PURE__ */ React__default.createElement(NavbarLink, { index: index2, path: [...nodePath, index2] }),
|
|
32415
|
+
renderItem: (item2, index2) => /* @__PURE__ */ React__default.createElement(NavbarLink$1, { index: index2, path: [...nodePath, index2] }),
|
|
32281
32416
|
renderHeader: (item2, index2) => {
|
|
32282
32417
|
return get(item2, "children.0.text") || "Custom";
|
|
32283
32418
|
}
|
|
@@ -32323,7 +32458,7 @@ function AttributesContainer$9({
|
|
|
32323
32458
|
}
|
|
32324
32459
|
)));
|
|
32325
32460
|
}
|
|
32326
|
-
function NavbarLink({ index: index2, path: path2 }) {
|
|
32461
|
+
function NavbarLink$1({ index: index2, path: path2 }) {
|
|
32327
32462
|
return /* @__PURE__ */ React__default.createElement("div", { className: "NavbarLink" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement(
|
|
32328
32463
|
AttributeField.TextField,
|
|
32329
32464
|
{
|
|
@@ -32519,7 +32654,7 @@ function AttributesContainer$8({
|
|
|
32519
32654
|
tabPosition: "top",
|
|
32520
32655
|
name: `children`,
|
|
32521
32656
|
label: "",
|
|
32522
|
-
renderItem: (item2, index2) => /* @__PURE__ */ React__default.createElement(SocialItem$
|
|
32657
|
+
renderItem: (item2, index2) => /* @__PURE__ */ React__default.createElement(SocialItem$2, { index: index2, path: [...nodePath, index2] }),
|
|
32523
32658
|
renderHeader: (item2, index2) => item2.content || "Custom"
|
|
32524
32659
|
}
|
|
32525
32660
|
), /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "0", header: t("Dimension") }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -32590,7 +32725,7 @@ function AttributesContainer$8({
|
|
|
32590
32725
|
}
|
|
32591
32726
|
)));
|
|
32592
32727
|
}
|
|
32593
|
-
function SocialItem$
|
|
32728
|
+
function SocialItem$2({ index: index2, path: path2 }) {
|
|
32594
32729
|
return /* @__PURE__ */ React__default.createElement("div", { className: "SocialItem" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement(
|
|
32595
32730
|
AttributeField.ImageUrl,
|
|
32596
32731
|
{
|
|
@@ -33550,17 +33685,346 @@ const ConfigPanelsMap = {
|
|
|
33550
33685
|
[ElementType.STANDARD_TABLE2]: Table2,
|
|
33551
33686
|
[ElementType.STANDARD_BLOCK_QUOTE]: Blockquote
|
|
33552
33687
|
};
|
|
33688
|
+
const BlockSchemasMap = {
|
|
33689
|
+
// // Text elements
|
|
33690
|
+
// [ElementType.TEXT]: TextSchema,
|
|
33691
|
+
// [ElementType.STANDARD_TEXT]: TextSchema,
|
|
33692
|
+
// [ElementType.STANDARD_PARAGRAPH]: TextSchema,
|
|
33693
|
+
// [ElementType.STANDARD_TEXT_LIST]: TextSchema,
|
|
33694
|
+
// [ElementType.STANDARD_H1]: TextSchema,
|
|
33695
|
+
// [ElementType.STANDARD_H2]: TextSchema,
|
|
33696
|
+
// [ElementType.STANDARD_H3]: TextSchema,
|
|
33697
|
+
// [ElementType.STANDARD_H4]: TextSchema,
|
|
33698
|
+
// // Button
|
|
33699
|
+
// [ElementType.STANDARD_BUTTON]: ButtonSchema,
|
|
33700
|
+
// // Section
|
|
33701
|
+
// [ElementType.STANDARD_SECTION]: SectionSchema,
|
|
33702
|
+
// // Image
|
|
33703
|
+
// [ElementType.STANDARD_IMAGE]: ImageSchema,
|
|
33704
|
+
// // Page
|
|
33705
|
+
// [ElementType.PAGE]: PageSchema,
|
|
33706
|
+
// // Column
|
|
33707
|
+
// [ElementType.STANDARD_COLUMN]: ColumnSchema,
|
|
33708
|
+
// // Wrapper
|
|
33709
|
+
// [ElementType.STANDARD_WRAPPER]: WrapperSchema,
|
|
33710
|
+
// // Divider
|
|
33711
|
+
// [ElementType.STANDARD_DIVIDER]: DividerSchema,
|
|
33712
|
+
// // Spacer
|
|
33713
|
+
// [ElementType.STANDARD_SPACER]: SpacerSchema,
|
|
33714
|
+
// // Group
|
|
33715
|
+
// [ElementType.STANDARD_GROUP]: GroupSchema,
|
|
33716
|
+
// // Blockquote
|
|
33717
|
+
// [ElementType.STANDARD_BLOCK_QUOTE]: BlockquoteSchema,
|
|
33718
|
+
// // Table
|
|
33719
|
+
// [ElementType.STANDARD_TABLE]: TableSchema,
|
|
33720
|
+
// [ElementType.STANDARD_TABLE2]: Table2Schema,
|
|
33721
|
+
// // Hero
|
|
33722
|
+
// [ElementType.STANDARD_HERO]: HeroSchema,
|
|
33723
|
+
// // Navbar
|
|
33724
|
+
// [ElementType.STANDARD_NAVBAR]: NavbarSchema,
|
|
33725
|
+
// // Social
|
|
33726
|
+
// [ElementType.STANDARD_SOCIAL]: SocialSchema,
|
|
33727
|
+
// Note: Code and Widget components are too complex for schema-based approach
|
|
33728
|
+
// They will continue to use component-based configuration
|
|
33729
|
+
};
|
|
33730
|
+
const SchemaPanelRenderer = ({
|
|
33731
|
+
schema,
|
|
33732
|
+
nodePath
|
|
33733
|
+
}) => {
|
|
33734
|
+
const isResponsive = isResponsiveTabsSchema(schema);
|
|
33735
|
+
const desktop = useMemo(() => {
|
|
33736
|
+
if (isResponsive) {
|
|
33737
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33738
|
+
SchemaFieldsRenderer,
|
|
33739
|
+
{
|
|
33740
|
+
fields: schema.desktop,
|
|
33741
|
+
nodePath,
|
|
33742
|
+
mode: ActiveTabKeys.DESKTOP
|
|
33743
|
+
}
|
|
33744
|
+
);
|
|
33745
|
+
}
|
|
33746
|
+
return null;
|
|
33747
|
+
}, [isResponsive, schema, nodePath]);
|
|
33748
|
+
const mobile = useMemo(() => {
|
|
33749
|
+
if (isResponsive) {
|
|
33750
|
+
const responsiveSchema = schema;
|
|
33751
|
+
const mobileFields = responsiveSchema.mobile || responsiveSchema.desktop;
|
|
33752
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33753
|
+
SchemaFieldsRenderer,
|
|
33754
|
+
{
|
|
33755
|
+
fields: mobileFields,
|
|
33756
|
+
nodePath,
|
|
33757
|
+
mode: ActiveTabKeys.MOBILE
|
|
33758
|
+
}
|
|
33759
|
+
);
|
|
33760
|
+
}
|
|
33761
|
+
return null;
|
|
33762
|
+
}, [isResponsive, schema, nodePath]);
|
|
33763
|
+
const regularFields = useMemo(() => {
|
|
33764
|
+
if (!isResponsive) {
|
|
33765
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33766
|
+
SchemaFieldsRenderer,
|
|
33767
|
+
{
|
|
33768
|
+
fields: schema,
|
|
33769
|
+
nodePath
|
|
33770
|
+
}
|
|
33771
|
+
);
|
|
33772
|
+
}
|
|
33773
|
+
return null;
|
|
33774
|
+
}, [isResponsive, schema, nodePath]);
|
|
33775
|
+
if (isResponsive) {
|
|
33776
|
+
return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(ResponsiveTabs, { desktop, mobile }));
|
|
33777
|
+
}
|
|
33778
|
+
return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, regularFields);
|
|
33779
|
+
};
|
|
33780
|
+
const SchemaFieldsRenderer = ({
|
|
33781
|
+
fields,
|
|
33782
|
+
nodePath,
|
|
33783
|
+
mode
|
|
33784
|
+
}) => {
|
|
33785
|
+
const { selectedNode } = useSelectedNode();
|
|
33786
|
+
const editorProps = useEditorProps();
|
|
33787
|
+
const defaultActiveKeys = useMemo(() => {
|
|
33788
|
+
const keys2 = [];
|
|
33789
|
+
fields.filter((field) => field.type === "CollapseGroup").filter((field) => field.defaultActive !== false).forEach((field) => {
|
|
33790
|
+
keys2.push(field.name);
|
|
33791
|
+
});
|
|
33792
|
+
fields.filter((field) => field.type === "EditPanelListField").forEach((field) => {
|
|
33793
|
+
const headerKey = field.headerKey;
|
|
33794
|
+
if (headerKey) {
|
|
33795
|
+
keys2.push(headerKey);
|
|
33796
|
+
}
|
|
33797
|
+
});
|
|
33798
|
+
return keys2;
|
|
33799
|
+
}, [fields]);
|
|
33800
|
+
return /* @__PURE__ */ React__default.createElement(CollapseWrapper$1, { defaultActiveKey: defaultActiveKeys }, fields.map((field, index2) => {
|
|
33801
|
+
if (field.type === "CollapseGroup") {
|
|
33802
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33803
|
+
Collapse.Item,
|
|
33804
|
+
{
|
|
33805
|
+
key: field.name || index2,
|
|
33806
|
+
name: field.name,
|
|
33807
|
+
header: field.header,
|
|
33808
|
+
extra: field.extra
|
|
33809
|
+
},
|
|
33810
|
+
/* @__PURE__ */ React__default.createElement(
|
|
33811
|
+
SchemaFieldsRenderer,
|
|
33812
|
+
{
|
|
33813
|
+
fields: field.children,
|
|
33814
|
+
nodePath,
|
|
33815
|
+
mode
|
|
33816
|
+
}
|
|
33817
|
+
)
|
|
33818
|
+
);
|
|
33819
|
+
}
|
|
33820
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33821
|
+
SchemaFieldRenderer,
|
|
33822
|
+
{
|
|
33823
|
+
key: index2,
|
|
33824
|
+
field,
|
|
33825
|
+
nodePath,
|
|
33826
|
+
mode,
|
|
33827
|
+
selectedNode,
|
|
33828
|
+
editorProps
|
|
33829
|
+
}
|
|
33830
|
+
);
|
|
33831
|
+
}));
|
|
33832
|
+
};
|
|
33833
|
+
const SchemaFieldRenderer = ({
|
|
33834
|
+
field,
|
|
33835
|
+
nodePath,
|
|
33836
|
+
mode,
|
|
33837
|
+
selectedNode,
|
|
33838
|
+
editorProps
|
|
33839
|
+
}) => {
|
|
33840
|
+
const actualPath = useMemo(() => {
|
|
33841
|
+
if (field.path === "textPath") {
|
|
33842
|
+
return [...nodePath, 0];
|
|
33843
|
+
}
|
|
33844
|
+
if (field.path === "nodePath") {
|
|
33845
|
+
return nodePath;
|
|
33846
|
+
}
|
|
33847
|
+
return nodePath;
|
|
33848
|
+
}, [field.path, nodePath]);
|
|
33849
|
+
const FieldComponent = getFieldComponent(field.type);
|
|
33850
|
+
if (!FieldComponent) {
|
|
33851
|
+
console.warn(`Unknown field type: ${field.type}`);
|
|
33852
|
+
return null;
|
|
33853
|
+
}
|
|
33854
|
+
const componentProps = __spreadValues({
|
|
33855
|
+
path: actualPath,
|
|
33856
|
+
name: field.name || ""
|
|
33857
|
+
}, field);
|
|
33858
|
+
if (field.type === "Typography" || field.type === "Buttons") {
|
|
33859
|
+
const fieldMode = field.mode === "desktop" ? ActiveTabKeys.DESKTOP : field.mode === "mobile" ? ActiveTabKeys.MOBILE : mode;
|
|
33860
|
+
componentProps.mode = fieldMode;
|
|
33861
|
+
componentProps.type = field.elementType || (selectedNode == null ? void 0 : selectedNode.type);
|
|
33862
|
+
if (field.hidePadding !== void 0) {
|
|
33863
|
+
componentProps.hidePadding = field.hidePadding;
|
|
33864
|
+
}
|
|
33865
|
+
}
|
|
33866
|
+
if (field.type === "Heading") {
|
|
33867
|
+
const currentMode = mode || ActiveTabKeys.DESKTOP;
|
|
33868
|
+
if (currentMode === ActiveTabKeys.MOBILE) {
|
|
33869
|
+
return null;
|
|
33870
|
+
}
|
|
33871
|
+
if (selectedNode && NodeUtils.isTextListElement(selectedNode)) {
|
|
33872
|
+
return null;
|
|
33873
|
+
}
|
|
33874
|
+
}
|
|
33875
|
+
if (field.type === "ButtonIcon") {
|
|
33876
|
+
if (!(editorProps == null ? void 0 : editorProps.enabledButtonIcon)) {
|
|
33877
|
+
return null;
|
|
33878
|
+
}
|
|
33879
|
+
}
|
|
33880
|
+
if (field.type === "EditPanelListField") {
|
|
33881
|
+
if ((selectedNode == null ? void 0 : selectedNode.type) === ElementType.STANDARD_SOCIAL) {
|
|
33882
|
+
componentProps.renderItem = (item2, index2) => /* @__PURE__ */ React__default.createElement(SocialItem$1, { index: index2, path: [...nodePath, index2] });
|
|
33883
|
+
componentProps.renderHeader = (item2) => item2.content || "Custom";
|
|
33884
|
+
} else if ((selectedNode == null ? void 0 : selectedNode.type) === ElementType.STANDARD_NAVBAR) {
|
|
33885
|
+
componentProps.renderItem = (item2, index2) => /* @__PURE__ */ React__default.createElement(NavbarLink, { index: index2, path: [...nodePath, index2] });
|
|
33886
|
+
componentProps.renderHeader = (item2) => get(item2, "children.0.text") || "Custom";
|
|
33887
|
+
}
|
|
33888
|
+
}
|
|
33889
|
+
if (field.type === "EditPanelListField" && mode === ActiveTabKeys.MOBILE) {
|
|
33890
|
+
return null;
|
|
33891
|
+
}
|
|
33892
|
+
if (field.type === "SyncChildrenField" && mode) {
|
|
33893
|
+
componentProps.mode = mode;
|
|
33894
|
+
}
|
|
33895
|
+
if (field.responsive) {
|
|
33896
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
33897
|
+
ResponsiveField,
|
|
33898
|
+
__spreadProps(__spreadValues({
|
|
33899
|
+
component: FieldComponent
|
|
33900
|
+
}, componentProps), {
|
|
33901
|
+
mode
|
|
33902
|
+
})
|
|
33903
|
+
);
|
|
33904
|
+
}
|
|
33905
|
+
return /* @__PURE__ */ React__default.createElement(FieldComponent, __spreadValues({}, componentProps));
|
|
33906
|
+
};
|
|
33907
|
+
const SocialItem$1 = ({ path: path2 }) => {
|
|
33908
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "SocialItem" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement(
|
|
33909
|
+
AttributeField.ImageUrl,
|
|
33910
|
+
{
|
|
33911
|
+
path: path2,
|
|
33912
|
+
label: t("Icon"),
|
|
33913
|
+
name: `attributes.src`
|
|
33914
|
+
}
|
|
33915
|
+
), /* @__PURE__ */ React__default.createElement(Divider$2, null), /* @__PURE__ */ React__default.createElement(
|
|
33916
|
+
AttributeField.ColorPickerField,
|
|
33917
|
+
{
|
|
33918
|
+
path: path2,
|
|
33919
|
+
label: t("Background color"),
|
|
33920
|
+
name: `attributes.background-color`
|
|
33921
|
+
}
|
|
33922
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
33923
|
+
AttributeField.BorderRadius,
|
|
33924
|
+
{
|
|
33925
|
+
path: path2,
|
|
33926
|
+
label: t("Border radius"),
|
|
33927
|
+
name: `attributes.border-radius`
|
|
33928
|
+
}
|
|
33929
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
33930
|
+
AttributeField.TextField,
|
|
33931
|
+
{
|
|
33932
|
+
path: [...path2, 0],
|
|
33933
|
+
label: t("Text"),
|
|
33934
|
+
name: `text`,
|
|
33935
|
+
fallbackValue: ""
|
|
33936
|
+
}
|
|
33937
|
+
), /* @__PURE__ */ React__default.createElement(AttributeField.Link, { required: true, path: path2, name: `attributes.href` }));
|
|
33938
|
+
};
|
|
33939
|
+
const NavbarLink = ({ path: path2 }) => {
|
|
33940
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "NavbarLink" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement(
|
|
33941
|
+
AttributeField.TextField,
|
|
33942
|
+
{
|
|
33943
|
+
path: [...path2, 0],
|
|
33944
|
+
label: t("Text"),
|
|
33945
|
+
name: `text`
|
|
33946
|
+
}
|
|
33947
|
+
), /* @__PURE__ */ React__default.createElement(AttributeField.Link, { required: true, path: path2, name: `attributes.href` }));
|
|
33948
|
+
};
|
|
33949
|
+
function isResponsiveTabsSchema(schema) {
|
|
33950
|
+
return typeof schema === "object" && "type" in schema && schema.type === "ResponsiveTabs";
|
|
33951
|
+
}
|
|
33952
|
+
function getFieldComponent(fieldType) {
|
|
33953
|
+
const fieldMap = {
|
|
33954
|
+
// Basic fields
|
|
33955
|
+
TextField: AttributeField.TextField,
|
|
33956
|
+
NumberField: AttributeField.NumberField,
|
|
33957
|
+
ColorPickerField: AttributeField.ColorPickerField,
|
|
33958
|
+
SelectField: AttributeField.SelectField,
|
|
33959
|
+
SwitchField: AttributeField.SwitchField,
|
|
33960
|
+
SliderField: AttributeField.SliderField,
|
|
33961
|
+
PixelField: AttributeField.PixelField,
|
|
33962
|
+
ImageUploaderField: AttributeField.ImageUploaderField,
|
|
33963
|
+
RichTextField: AttributeField.RichTextField,
|
|
33964
|
+
TextAreaField: AttributeField.TextAreaField,
|
|
33965
|
+
ButtonGroupField: AttributeField.ButtonGroupField,
|
|
33966
|
+
GradientGeneratorField: AttributeField.GradientGeneratorField,
|
|
33967
|
+
MergeTagSelectInputField: AttributeField.MergeTagSelectInputField,
|
|
33968
|
+
EditPanelListField: AttributeField.EditPanelListField,
|
|
33969
|
+
EditPanelTabsField: AttributeField.EditPanelTabsField,
|
|
33970
|
+
SyncChildrenField: AttributeField.SyncChildrenField,
|
|
33971
|
+
FieldItem: AttributeField.FieldItem,
|
|
33972
|
+
// Composite fields
|
|
33973
|
+
Typography: AttributeField.Typography,
|
|
33974
|
+
Padding: AttributeField.Padding,
|
|
33975
|
+
Border: AttributeField.Border,
|
|
33976
|
+
BackgroundColor: AttributeField.BackgroundColor,
|
|
33977
|
+
TextAlign: AttributeField.TextAlign,
|
|
33978
|
+
Height: AttributeField.Height,
|
|
33979
|
+
Width: AttributeField.Width,
|
|
33980
|
+
Link: AttributeField.Link,
|
|
33981
|
+
ButtonContent: AttributeField.ButtonContent,
|
|
33982
|
+
BorderRadius: AttributeField.BorderRadius,
|
|
33983
|
+
BackgroundImage: AttributeField.BackgroundImage,
|
|
33984
|
+
FontFamily: AttributeField.FontFamily,
|
|
33985
|
+
FontSize: AttributeField.FontSize,
|
|
33986
|
+
Heading: AttributeField.Heading,
|
|
33987
|
+
ButtonIcon: AttributeField.ButtonIcon,
|
|
33988
|
+
Buttons: AttributeField.Buttons,
|
|
33989
|
+
ImageUrl: AttributeField.ImageUrl,
|
|
33990
|
+
VerticalAlign: AttributeField.VerticalAlign,
|
|
33991
|
+
Direction: AttributeField.Direction,
|
|
33992
|
+
DisplayOptions: AttributeField.DisplayOptions,
|
|
33993
|
+
Columns: AttributeField.Columns,
|
|
33994
|
+
BackgroundGradient: AttributeField.BackgroundGradient,
|
|
33995
|
+
LetterSpacing: AttributeField.LetterSpacing,
|
|
33996
|
+
LineHeight: AttributeField.LineHeight,
|
|
33997
|
+
FontWeight: AttributeField.FontWeight,
|
|
33998
|
+
TextAndHeadingStyle: AttributeField.TextAndHeadingStyle,
|
|
33999
|
+
GlobalLink: AttributeField.GlobalLink,
|
|
34000
|
+
ButtonCategory: AttributeField.ButtonCategory,
|
|
34001
|
+
BackgroundPosition: AttributeField.BackgroundPosition,
|
|
34002
|
+
StackOnMobile: AttributeField.StackOnMobile,
|
|
34003
|
+
DividerLine: AttributeField.DividerLine,
|
|
34004
|
+
RTLDirection: AttributeField.RTLDirection,
|
|
34005
|
+
TableLayout: AttributeField.TableLayout,
|
|
34006
|
+
Preheader: AttributeField.Preheader,
|
|
34007
|
+
ImageWidth: AttributeField.ImageWidth,
|
|
34008
|
+
TextAndHeadingList: AttributeField.TextAndHeadingList,
|
|
34009
|
+
WebFonts: AttributeField.WebFonts,
|
|
34010
|
+
PixelAndPercentField: AttributeField.PixelAndPercentField
|
|
34011
|
+
};
|
|
34012
|
+
return fieldMap[fieldType] || null;
|
|
34013
|
+
}
|
|
33553
34014
|
const AttributePanel = () => {
|
|
33554
34015
|
const { selectedNode } = useSelectedNode();
|
|
33555
34016
|
const selectedNodePath = useSelectedNodePath();
|
|
33556
34017
|
const { setSelectedNodePath } = useEditorActions();
|
|
33557
34018
|
const editor = useSlateStatic();
|
|
33558
34019
|
const nodePath = useMemo(() => selectedNodePath, [selectedNodePath]);
|
|
34020
|
+
const schema = selectedNode && BlockSchemasMap[selectedNode.type];
|
|
33559
34021
|
const Com = selectedNode && ConfigPanelsMap[selectedNode.type];
|
|
34022
|
+
const hasSchema = !!schema;
|
|
34023
|
+
const hasComponent = !!Com;
|
|
33560
34024
|
useEffect(() => {
|
|
33561
34025
|
if (!nodePath)
|
|
33562
34026
|
return;
|
|
33563
|
-
if (!
|
|
34027
|
+
if (!hasSchema && !hasComponent) {
|
|
33564
34028
|
console.log(
|
|
33565
34029
|
`The current component was not found and has been switched to the previous level.`
|
|
33566
34030
|
);
|
|
@@ -33568,7 +34032,7 @@ const AttributePanel = () => {
|
|
|
33568
34032
|
let path2 = Path.parent(nodePath);
|
|
33569
34033
|
let parent2 = Node.get(editor, path2);
|
|
33570
34034
|
while (parent2) {
|
|
33571
|
-
if (ConfigPanelsMap[parent2.type]) {
|
|
34035
|
+
if (BlockSchemasMap[parent2.type] || ConfigPanelsMap[parent2.type]) {
|
|
33572
34036
|
setSelectedNodePath(path2);
|
|
33573
34037
|
return;
|
|
33574
34038
|
} else {
|
|
@@ -33579,14 +34043,31 @@ const AttributePanel = () => {
|
|
|
33579
34043
|
} catch (error2) {
|
|
33580
34044
|
}
|
|
33581
34045
|
}
|
|
33582
|
-
}, [
|
|
34046
|
+
}, [hasSchema, hasComponent, editor, nodePath, setSelectedNodePath]);
|
|
33583
34047
|
return useMemo(() => {
|
|
33584
34048
|
if (!selectedNode || !nodePath)
|
|
33585
34049
|
return null;
|
|
33586
|
-
if (
|
|
33587
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
33588
|
-
|
|
33589
|
-
|
|
34050
|
+
if (hasSchema) {
|
|
34051
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
34052
|
+
SchemaPanelRenderer,
|
|
34053
|
+
{
|
|
34054
|
+
schema,
|
|
34055
|
+
nodePath,
|
|
34056
|
+
key: selectedNode.type + nodePath.toString()
|
|
34057
|
+
}
|
|
34058
|
+
);
|
|
34059
|
+
}
|
|
34060
|
+
if (hasComponent) {
|
|
34061
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
34062
|
+
Com,
|
|
34063
|
+
{
|
|
34064
|
+
nodePath,
|
|
34065
|
+
key: selectedNode.type + nodePath.toString()
|
|
34066
|
+
}
|
|
34067
|
+
);
|
|
34068
|
+
}
|
|
34069
|
+
return /* @__PURE__ */ React__default.createElement("div", null, "No match component ", selectedNode.type);
|
|
34070
|
+
}, [hasSchema, hasComponent, schema, Com, nodePath, selectedNode]);
|
|
33590
34071
|
};
|
|
33591
34072
|
const ConfigurationSideBar = ({ height }) => {
|
|
33592
34073
|
const standaloneElementEditing = useStandaloneElementEditing();
|
|
@@ -38390,6 +38871,7 @@ const ContextMenu = ({
|
|
|
38390
38871
|
deleteSelectedColumn,
|
|
38391
38872
|
mergeCeils
|
|
38392
38873
|
} = useTableInteract();
|
|
38874
|
+
const ele = document.getElementById("HoveringToolbar");
|
|
38393
38875
|
return createPortal(
|
|
38394
38876
|
/* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(
|
|
38395
38877
|
"div",
|
|
@@ -38465,7 +38947,7 @@ const ContextMenu = ({
|
|
|
38465
38947
|
/* @__PURE__ */ React__default.createElement("div", { className: "easy-email-pro-table-operation-menu-text" }, "Delete selected rows")
|
|
38466
38948
|
)
|
|
38467
38949
|
), /* @__PURE__ */ React__default.createElement("style", null, styleText$b)),
|
|
38468
|
-
document.body
|
|
38950
|
+
ele || document.body
|
|
38469
38951
|
);
|
|
38470
38952
|
};
|
|
38471
38953
|
const ERROR_LIMIT = 2;
|
|
@@ -38489,12 +38971,32 @@ const TableTools = (props) => {
|
|
|
38489
38971
|
return;
|
|
38490
38972
|
const handleContextmenu = (ev) => {
|
|
38491
38973
|
ev.preventDefault();
|
|
38492
|
-
setShowContextMenu(true);
|
|
38493
38974
|
const iframeRect = iframe.getBoundingClientRect();
|
|
38975
|
+
const initialLeft = ev.clientX + iframeRect.left;
|
|
38976
|
+
const initialTop = ev.clientY + iframeRect.top;
|
|
38977
|
+
const MENU_HEIGHT = 280;
|
|
38978
|
+
const MENU_WIDTH = 220;
|
|
38979
|
+
const viewportHeight = window.innerHeight;
|
|
38980
|
+
const viewportWidth = window.innerWidth;
|
|
38981
|
+
let adjustedLeft = initialLeft;
|
|
38982
|
+
let adjustedTop = initialTop;
|
|
38983
|
+
if (initialTop + MENU_HEIGHT > viewportHeight) {
|
|
38984
|
+
adjustedTop = initialTop - MENU_HEIGHT;
|
|
38985
|
+
if (adjustedTop < 0) {
|
|
38986
|
+
adjustedTop = 8;
|
|
38987
|
+
}
|
|
38988
|
+
}
|
|
38989
|
+
if (initialLeft + MENU_WIDTH > viewportWidth) {
|
|
38990
|
+
adjustedLeft = viewportWidth - MENU_WIDTH - 8;
|
|
38991
|
+
}
|
|
38992
|
+
if (adjustedLeft < 0) {
|
|
38993
|
+
adjustedLeft = 8;
|
|
38994
|
+
}
|
|
38494
38995
|
setPosition({
|
|
38495
|
-
left:
|
|
38496
|
-
top:
|
|
38996
|
+
left: adjustedLeft + 20,
|
|
38997
|
+
top: adjustedTop
|
|
38497
38998
|
});
|
|
38999
|
+
setShowContextMenu(true);
|
|
38498
39000
|
};
|
|
38499
39001
|
props.nodeElement.addEventListener("contextmenu", handleContextmenu);
|
|
38500
39002
|
return () => {
|
|
@@ -38965,6 +39467,35 @@ const getIsLargeScreen = () => {
|
|
|
38965
39467
|
const isLargeScreen = windowSize >= 1600;
|
|
38966
39468
|
return isLargeScreen;
|
|
38967
39469
|
};
|
|
39470
|
+
const EditorContainer = ({
|
|
39471
|
+
children,
|
|
39472
|
+
style
|
|
39473
|
+
}) => {
|
|
39474
|
+
const { lock } = useEditorState();
|
|
39475
|
+
return /* @__PURE__ */ React__default.createElement("div", { style: __spreadProps(__spreadValues({}, style), { position: "relative" }), id: EDITOR_CONTAINER }, lock && /* @__PURE__ */ React__default.createElement(
|
|
39476
|
+
"div",
|
|
39477
|
+
{
|
|
39478
|
+
style: {
|
|
39479
|
+
position: "absolute",
|
|
39480
|
+
top: 0,
|
|
39481
|
+
left: 0,
|
|
39482
|
+
right: 0,
|
|
39483
|
+
bottom: 0,
|
|
39484
|
+
backgroundColor: "rgba(255, 255, 255, 0.3)",
|
|
39485
|
+
zIndex: 10,
|
|
39486
|
+
cursor: "not-allowed"
|
|
39487
|
+
},
|
|
39488
|
+
onPointerDown: (e) => {
|
|
39489
|
+
e.preventDefault();
|
|
39490
|
+
e.stopPropagation();
|
|
39491
|
+
},
|
|
39492
|
+
onClick: (e) => {
|
|
39493
|
+
e.preventDefault();
|
|
39494
|
+
e.stopPropagation();
|
|
39495
|
+
}
|
|
39496
|
+
}
|
|
39497
|
+
), children);
|
|
39498
|
+
};
|
|
38968
39499
|
const useCreateConfig$1 = (_k) => {
|
|
38969
39500
|
var _l = _k, {
|
|
38970
39501
|
interactiveStyle,
|
|
@@ -39095,15 +39626,20 @@ const Layout$1 = ({ children, footer, header, tabLeft, tabRight }) => {
|
|
|
39095
39626
|
},
|
|
39096
39627
|
/* @__PURE__ */ React__default.createElement(SharedComponents.BlockSideBar, { height })
|
|
39097
39628
|
),
|
|
39098
|
-
/* @__PURE__ */ React__default.createElement(
|
|
39099
|
-
|
|
39629
|
+
/* @__PURE__ */ React__default.createElement(
|
|
39630
|
+
EditorContainer,
|
|
39100
39631
|
{
|
|
39101
|
-
|
|
39102
|
-
footer,
|
|
39103
|
-
left: tabLeft,
|
|
39104
|
-
right: tabRight
|
|
39632
|
+
style: { height, minWidth: 800, flex: 1 }
|
|
39105
39633
|
},
|
|
39106
|
-
/* @__PURE__ */ React__default.createElement(
|
|
39634
|
+
/* @__PURE__ */ React__default.createElement(
|
|
39635
|
+
SharedComponents.EditorTabs,
|
|
39636
|
+
{
|
|
39637
|
+
header,
|
|
39638
|
+
footer,
|
|
39639
|
+
left: tabLeft,
|
|
39640
|
+
right: tabRight
|
|
39641
|
+
},
|
|
39642
|
+
/* @__PURE__ */ React__default.createElement(EmailEditor, null, /* @__PURE__ */ React__default.createElement("style", { id: "Retro-CSS" }, styleText$h, RetroStyleText, `
|
|
39107
39643
|
body {
|
|
39108
39644
|
--page-width: ${pageDataWidth}px;
|
|
39109
39645
|
}
|
|
@@ -39115,7 +39651,8 @@ const Layout$1 = ({ children, footer, header, tabLeft, tabRight }) => {
|
|
|
39115
39651
|
}
|
|
39116
39652
|
|
|
39117
39653
|
`), children)
|
|
39118
|
-
|
|
39654
|
+
)
|
|
39655
|
+
),
|
|
39119
39656
|
showSidebar && compact && /* @__PURE__ */ React__default.createElement(
|
|
39120
39657
|
Layout$2.Sider,
|
|
39121
39658
|
{
|
|
@@ -40822,6 +41359,7 @@ const Minimalist = { useCreateConfig, Layout };
|
|
|
40822
41359
|
export {
|
|
40823
41360
|
AttributeField,
|
|
40824
41361
|
AttributesPanelWrapper,
|
|
41362
|
+
BlockSchemasMap,
|
|
40825
41363
|
CollapseWrapper$1 as CollapseWrapper,
|
|
40826
41364
|
ConfigPanelsMap,
|
|
40827
41365
|
ControllerProvider,
|