@go-mailer/easy-email-extensions 5.0.4 → 5.0.6
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/hooks/useAIContext.d.ts +48 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/lib/index2.js +359 -143
- package/lib/index2.js.map +1 -1
- package/lib/style.css +2 -2
- package/package.json +2 -2
package/lib/index2.js
CHANGED
|
@@ -52,7 +52,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
};
|
|
53
53
|
import * as React from "react";
|
|
54
54
|
import React__default, { createContext, useContext, isValidElement, Children, cloneElement, Component, useRef, useMemo, memo, forwardRef, createRef, useState, useImperativeHandle, useEffect, useLayoutEffect, useCallback, PureComponent, useReducer, Fragment, Suspense } from "react";
|
|
55
|
-
import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, useFocusBlockLayout, DATA_CONTENT_EDITABLE_IDX, 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 "@go-mailer/easy-email-editor";
|
|
55
|
+
import { IconFont, useEditorProps, Stack as Stack$4, useRefState, getShadowRoot, DATA_CONTENT_EDITABLE_TYPE, ContentEditableType, TextStyle, useEditorContext, useBlock, useFocusIdx, useFocusBlockLayout, DATA_CONTENT_EDITABLE_IDX, 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, useEditorContent } from "@go-mailer/easy-email-editor";
|
|
56
56
|
import { BasicType, ImageManager, EMAIL_BLOCK_CLASS_NAME, BlockManager, createBlockDataByType, AdvancedType, Operator, OperatorSymbol, isAdvancedBlock, getParentByIdx, getParentIdx, getIndexByIdx, getSiblingIdx, getNodeIdxFromClassName, createCustomBlock, mergeBlock, getPreviewClassName, components, getNodeIdxClassName, getPageIdx, getChildIdx, JsonToMjml, getNodeTypeFromClassName } from "@go-mailer/easy-email-core";
|
|
57
57
|
import ReactDOM, { createPortal, render as render$1 } from "react-dom";
|
|
58
58
|
import { Field, useForm as useForm$1, useField, Form as Form$3, version as version$2, useFormState as useFormState$2 } from "react-final-form";
|
|
@@ -43843,7 +43843,8 @@ const list$5 = [
|
|
|
43843
43843
|
},
|
|
43844
43844
|
attributes: {
|
|
43845
43845
|
align: "center",
|
|
43846
|
-
"base-url": "https://mjml.io"
|
|
43846
|
+
"base-url": "https://mjml.io",
|
|
43847
|
+
"background-color": "#ffffff"
|
|
43847
43848
|
},
|
|
43848
43849
|
children: []
|
|
43849
43850
|
}
|
|
@@ -45496,76 +45497,117 @@ function Toolbar() {
|
|
|
45496
45497
|
return null;
|
|
45497
45498
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
45498
45499
|
id: "easy-email-extensions-InteractivePrompt-Toolbar",
|
|
45500
|
+
style: { height: 0, zIndex: 100 }
|
|
45501
|
+
}, !isPage && /* @__PURE__ */ React__default.createElement("div", {
|
|
45502
|
+
onClick: (e2) => e2.stopPropagation(),
|
|
45503
|
+
onMouseDown: (ev) => ev.preventDefault(),
|
|
45499
45504
|
style: {
|
|
45500
|
-
|
|
45501
|
-
|
|
45502
|
-
|
|
45503
|
-
|
|
45504
|
-
|
|
45505
|
-
|
|
45506
|
-
|
|
45505
|
+
position: "absolute",
|
|
45506
|
+
bottom: "100%",
|
|
45507
|
+
right: 0,
|
|
45508
|
+
marginBottom: "5px",
|
|
45509
|
+
display: "inline-flex",
|
|
45510
|
+
alignItems: "center",
|
|
45511
|
+
gap: "1px",
|
|
45507
45512
|
pointerEvents: "auto",
|
|
45508
|
-
|
|
45509
|
-
|
|
45510
|
-
|
|
45513
|
+
background: "rgba(22, 20, 17, 0.82)",
|
|
45514
|
+
backdropFilter: "blur(6px)",
|
|
45515
|
+
borderRadius: "6px",
|
|
45516
|
+
padding: "2px",
|
|
45517
|
+
boxShadow: "0 2px 10px rgba(0,0,0,0.22)"
|
|
45511
45518
|
}
|
|
45512
45519
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
45513
45520
|
style: {
|
|
45514
|
-
color: "
|
|
45515
|
-
|
|
45516
|
-
|
|
45517
|
-
|
|
45518
|
-
|
|
45519
|
-
|
|
45521
|
+
color: "rgba(255,255,255,0.55)",
|
|
45522
|
+
fontSize: "10px",
|
|
45523
|
+
fontFamily: "Inter, sans-serif",
|
|
45524
|
+
fontWeight: 600,
|
|
45525
|
+
letterSpacing: "0.06em",
|
|
45526
|
+
textTransform: "uppercase",
|
|
45520
45527
|
whiteSpace: "nowrap",
|
|
45521
|
-
|
|
45522
|
-
|
|
45528
|
+
padding: "0 6px",
|
|
45529
|
+
pointerEvents: "none"
|
|
45523
45530
|
}
|
|
45524
45531
|
}, focusBlock2 && getBlockTitle(focusBlock2, false)), /* @__PURE__ */ React__default.createElement("div", {
|
|
45525
|
-
onClick: (e2) => {
|
|
45526
|
-
e2.stopPropagation();
|
|
45527
|
-
},
|
|
45528
|
-
onMouseDown: (ev) => {
|
|
45529
|
-
ev.preventDefault();
|
|
45530
|
-
},
|
|
45531
45532
|
style: {
|
|
45532
|
-
|
|
45533
|
-
|
|
45534
|
-
|
|
45535
|
-
|
|
45533
|
+
width: "1px",
|
|
45534
|
+
height: "14px",
|
|
45535
|
+
background: "rgba(255,255,255,0.12)",
|
|
45536
|
+
flexShrink: 0
|
|
45536
45537
|
}
|
|
45537
|
-
}, /* @__PURE__ */ React__default.createElement(ToolItem, {
|
|
45538
|
-
|
|
45539
|
-
|
|
45538
|
+
}), /* @__PURE__ */ React__default.createElement(ToolItem, {
|
|
45539
|
+
iconName: "icon-layer",
|
|
45540
|
+
title: "Select parent",
|
|
45540
45541
|
onClick: handleSelectParent
|
|
45541
45542
|
}), /* @__PURE__ */ React__default.createElement(ToolItem, {
|
|
45542
45543
|
iconName: "icon-copy",
|
|
45544
|
+
title: "Duplicate",
|
|
45543
45545
|
onClick: handleCopy
|
|
45544
45546
|
}), props.onAddCollection && /* @__PURE__ */ React__default.createElement(ToolItem, {
|
|
45545
45547
|
iconName: "icon-collection",
|
|
45548
|
+
title: "Save to collection",
|
|
45546
45549
|
onClick: handleAddToCollection
|
|
45547
45550
|
}), /* @__PURE__ */ React__default.createElement(ToolItem, {
|
|
45548
45551
|
iconName: "icon-delete",
|
|
45549
|
-
|
|
45550
|
-
|
|
45552
|
+
title: "Delete",
|
|
45553
|
+
onClick: handleDelete,
|
|
45554
|
+
isDanger: true
|
|
45555
|
+
}))), modal);
|
|
45551
45556
|
}
|
|
45552
45557
|
function ToolItem(props) {
|
|
45553
45558
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
45559
|
+
style: { position: "relative", display: "inline-flex" },
|
|
45560
|
+
className: `easy-email-tool-item-wrap${props.isDanger ? " easy-email-tool-danger" : ""}`
|
|
45561
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, `
|
|
45562
|
+
.easy-email-tool-item-wrap .easy-email-tool-btn {
|
|
45563
|
+
color: rgba(255,255,255,0.65);
|
|
45564
|
+
background: transparent;
|
|
45565
|
+
height: 24px;
|
|
45566
|
+
width: 24px;
|
|
45567
|
+
display: flex;
|
|
45568
|
+
align-items: center;
|
|
45569
|
+
justify-content: center;
|
|
45570
|
+
cursor: pointer;
|
|
45571
|
+
pointer-events: auto;
|
|
45572
|
+
font-size: 13px;
|
|
45573
|
+
border-radius: 4px;
|
|
45574
|
+
transition: color 0.15s, background 0.15s;
|
|
45575
|
+
}
|
|
45576
|
+
.easy-email-tool-item-wrap .easy-email-tool-btn:hover {
|
|
45577
|
+
color: #fff;
|
|
45578
|
+
background: rgba(255,255,255,0.12);
|
|
45579
|
+
}
|
|
45580
|
+
.easy-email-tool-item-wrap.easy-email-tool-danger .easy-email-tool-btn:hover {
|
|
45581
|
+
color: #ff6b6b;
|
|
45582
|
+
background: rgba(255,80,80,0.15);
|
|
45583
|
+
}
|
|
45584
|
+
.easy-email-tool-item-wrap .easy-email-tooltip {
|
|
45585
|
+
display: none;
|
|
45586
|
+
position: absolute;
|
|
45587
|
+
top: calc(100% + 5px);
|
|
45588
|
+
left: 50%;
|
|
45589
|
+
transform: translateX(-50%);
|
|
45590
|
+
background: rgba(22,20,17,0.92);
|
|
45591
|
+
color: #fff;
|
|
45592
|
+
font-size: 10px;
|
|
45593
|
+
line-height: 1.4;
|
|
45594
|
+
padding: 2px 7px;
|
|
45595
|
+
border-radius: 4px;
|
|
45596
|
+
white-space: nowrap;
|
|
45597
|
+
pointer-events: none;
|
|
45598
|
+
z-index: 9999;
|
|
45599
|
+
font-family: Inter, sans-serif;
|
|
45600
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
|
45601
|
+
}
|
|
45602
|
+
.easy-email-tool-item-wrap:hover .easy-email-tooltip {
|
|
45603
|
+
display: block;
|
|
45604
|
+
}
|
|
45605
|
+
`), /* @__PURE__ */ React__default.createElement("div", {
|
|
45554
45606
|
onClick: props.onClick,
|
|
45555
|
-
|
|
45556
|
-
|
|
45557
|
-
|
|
45558
|
-
|
|
45559
|
-
fontSize: props.width || 14,
|
|
45560
|
-
lineHeight: "22px",
|
|
45561
|
-
width: 22,
|
|
45562
|
-
display: "flex",
|
|
45563
|
-
pointerEvents: "auto",
|
|
45564
|
-
cursor: "pointer",
|
|
45565
|
-
justifyContent: "center"
|
|
45566
|
-
},
|
|
45567
|
-
className: classnames("iconfont", props.iconName)
|
|
45568
|
-
});
|
|
45607
|
+
className: classnames("iconfont", props.iconName, "easy-email-tool-btn")
|
|
45608
|
+
}), props.title && /* @__PURE__ */ React__default.createElement("span", {
|
|
45609
|
+
className: "easy-email-tooltip"
|
|
45610
|
+
}, props.title));
|
|
45569
45611
|
}
|
|
45570
45612
|
function FocusTooltip() {
|
|
45571
45613
|
const { focusBlock: focusBlock2 } = useBlock();
|
|
@@ -45606,8 +45648,7 @@ function FocusTooltip() {
|
|
|
45606
45648
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
45607
45649
|
style: {
|
|
45608
45650
|
position: "absolute",
|
|
45609
|
-
|
|
45610
|
-
color: "#ffffff",
|
|
45651
|
+
color: "var(--selected-color)",
|
|
45611
45652
|
height: "28px",
|
|
45612
45653
|
width: "28px",
|
|
45613
45654
|
display: "flex",
|
|
@@ -45617,12 +45658,41 @@ function FocusTooltip() {
|
|
|
45617
45658
|
borderRadius: "50%",
|
|
45618
45659
|
cursor: "grab",
|
|
45619
45660
|
pointerEvents: "auto",
|
|
45661
|
+
opacity: 0.7,
|
|
45620
45662
|
WebkitUserDrag: "element"
|
|
45621
|
-
}
|
|
45622
|
-
|
|
45663
|
+
},
|
|
45664
|
+
className: "easy-email-tool-item-wrap"
|
|
45665
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, `
|
|
45666
|
+
.easy-email-tool-item-wrap:hover {
|
|
45667
|
+
opacity: 1 !important;
|
|
45668
|
+
}
|
|
45669
|
+
.easy-email-tool-item-wrap .easy-email-tooltip {
|
|
45670
|
+
display: none;
|
|
45671
|
+
position: absolute;
|
|
45672
|
+
top: calc(100% + 6px);
|
|
45673
|
+
left: 50%;
|
|
45674
|
+
transform: translateX(-50%);
|
|
45675
|
+
background: rgba(22,20,17,0.92);
|
|
45676
|
+
color: #fff;
|
|
45677
|
+
font-size: 10px;
|
|
45678
|
+
line-height: 1.4;
|
|
45679
|
+
padding: 2px 7px;
|
|
45680
|
+
border-radius: 4px;
|
|
45681
|
+
white-space: nowrap;
|
|
45682
|
+
pointer-events: none;
|
|
45683
|
+
z-index: 9999;
|
|
45684
|
+
font-family: Inter, sans-serif;
|
|
45685
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
|
45686
|
+
}
|
|
45687
|
+
.easy-email-tool-item-wrap:hover .easy-email-tooltip {
|
|
45688
|
+
display: block;
|
|
45689
|
+
}
|
|
45690
|
+
`), /* @__PURE__ */ React__default.createElement(IconFont, {
|
|
45623
45691
|
iconName: "icon-move",
|
|
45624
45692
|
style: { color: "#fff", cursor: "grab" }
|
|
45625
|
-
})
|
|
45693
|
+
}), /* @__PURE__ */ React__default.createElement("span", {
|
|
45694
|
+
className: "easy-email-tooltip"
|
|
45695
|
+
}, "Drag to move")))), /* @__PURE__ */ React__default.createElement("div", {
|
|
45626
45696
|
style: {
|
|
45627
45697
|
position: "absolute",
|
|
45628
45698
|
fontSize: 14,
|
|
@@ -45631,8 +45701,8 @@ function FocusTooltip() {
|
|
|
45631
45701
|
top: 0,
|
|
45632
45702
|
width: "100%",
|
|
45633
45703
|
height: "100%",
|
|
45634
|
-
outlineOffset: "-
|
|
45635
|
-
outline: isPage ? "none" : "
|
|
45704
|
+
outlineOffset: "-3px",
|
|
45705
|
+
outline: isPage ? "none" : "3px dashed var(--selected-color)"
|
|
45636
45706
|
}
|
|
45637
45707
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
45638
45708
|
style: {
|
|
@@ -45641,8 +45711,9 @@ function FocusTooltip() {
|
|
|
45641
45711
|
zIndex: 3,
|
|
45642
45712
|
left: 0,
|
|
45643
45713
|
top: 0,
|
|
45644
|
-
width: "
|
|
45645
|
-
height: "100%"
|
|
45714
|
+
width: "100%",
|
|
45715
|
+
height: "100%",
|
|
45716
|
+
pointerEvents: "none"
|
|
45646
45717
|
}
|
|
45647
45718
|
}, /* @__PURE__ */ React__default.createElement(Toolbar, null))),
|
|
45648
45719
|
focusBlockNode
|
|
@@ -45713,6 +45784,8 @@ function HoverTooltip() {
|
|
|
45713
45784
|
return null;
|
|
45714
45785
|
if (!block2 || !blockNode)
|
|
45715
45786
|
return null;
|
|
45787
|
+
if (block2.type === BasicType.PAGE)
|
|
45788
|
+
return null;
|
|
45716
45789
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, createPortal(
|
|
45717
45790
|
/* @__PURE__ */ React__default.createElement("div", {
|
|
45718
45791
|
id: "easy-email-extensions-InteractivePrompt-HoverTooltip",
|
|
@@ -45727,7 +45800,7 @@ function HoverTooltip() {
|
|
|
45727
45800
|
}
|
|
45728
45801
|
}, /* @__PURE__ */ React__default.createElement(TipNode, {
|
|
45729
45802
|
type: isDragging ? "drag" : "hover",
|
|
45730
|
-
lineWidth:
|
|
45803
|
+
lineWidth: 3,
|
|
45731
45804
|
title: block2.name,
|
|
45732
45805
|
direction: isTop && direction === "top" ? "noEnoughTop" : direction,
|
|
45733
45806
|
isDragging
|
|
@@ -45736,7 +45809,7 @@ function HoverTooltip() {
|
|
|
45736
45809
|
));
|
|
45737
45810
|
}
|
|
45738
45811
|
function TipNode(props) {
|
|
45739
|
-
const { direction, title: title2, lineWidth, type } = props;
|
|
45812
|
+
const { direction, title: title2, lineWidth = 3, type } = props;
|
|
45740
45813
|
const dragTitle = useMemo(() => {
|
|
45741
45814
|
if (direction === "top" || direction === "noEnoughTop") {
|
|
45742
45815
|
return `${t("Insert before")} ${title2}`;
|
|
@@ -45780,26 +45853,33 @@ function TipNode(props) {
|
|
|
45780
45853
|
width: "100%",
|
|
45781
45854
|
height: "100%",
|
|
45782
45855
|
outlineOffset: `-${lineWidth}px`,
|
|
45783
|
-
outline: `${lineWidth}px
|
|
45856
|
+
outline: `${lineWidth}px dashed ${color2}`
|
|
45784
45857
|
}
|
|
45785
45858
|
}, type === "hover" && /* @__PURE__ */ React__default.createElement("div", {
|
|
45786
45859
|
style: {
|
|
45787
45860
|
position: "absolute",
|
|
45788
|
-
|
|
45789
|
-
top: 0
|
|
45861
|
+
right: 0,
|
|
45862
|
+
top: 0,
|
|
45863
|
+
transform: "translateY(-100%)",
|
|
45864
|
+
paddingBottom: "5px"
|
|
45790
45865
|
}
|
|
45791
45866
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
45792
45867
|
style: {
|
|
45793
|
-
backgroundColor: color2,
|
|
45794
|
-
color: "#ffffff",
|
|
45795
|
-
height: "22px",
|
|
45796
|
-
lineHeight: "22px",
|
|
45797
45868
|
display: "inline-flex",
|
|
45798
|
-
|
|
45799
|
-
|
|
45800
|
-
|
|
45801
|
-
|
|
45802
|
-
|
|
45869
|
+
alignItems: "center",
|
|
45870
|
+
background: "rgba(22, 20, 17, 0.82)",
|
|
45871
|
+
backdropFilter: "blur(6px)",
|
|
45872
|
+
borderRadius: "6px",
|
|
45873
|
+
padding: "0 8px",
|
|
45874
|
+
height: "22px",
|
|
45875
|
+
boxShadow: "0 2px 10px rgba(0,0,0,0.22)",
|
|
45876
|
+
color: "rgba(255,255,255,0.6)",
|
|
45877
|
+
fontSize: "10px",
|
|
45878
|
+
fontFamily: "Inter, sans-serif",
|
|
45879
|
+
fontWeight: 600,
|
|
45880
|
+
letterSpacing: "0.06em",
|
|
45881
|
+
textTransform: "uppercase",
|
|
45882
|
+
whiteSpace: "nowrap"
|
|
45803
45883
|
}
|
|
45804
45884
|
}, title2))), props.isDragging && /* @__PURE__ */ React__default.createElement("div", {
|
|
45805
45885
|
style: __spreadValues({
|
|
@@ -45812,14 +45892,23 @@ function TipNode(props) {
|
|
|
45812
45892
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
45813
45893
|
style: __spreadValues({
|
|
45814
45894
|
position: "absolute",
|
|
45815
|
-
color: "#ffffff",
|
|
45816
|
-
backgroundColor: color2,
|
|
45817
|
-
lineHeight: "22px",
|
|
45818
45895
|
display: "inline-flex",
|
|
45819
|
-
|
|
45820
|
-
|
|
45896
|
+
alignItems: "center",
|
|
45897
|
+
background: "rgba(22, 20, 17, 0.82)",
|
|
45898
|
+
backdropFilter: "blur(6px)",
|
|
45899
|
+
WebkitBackdropFilter: "blur(6px)",
|
|
45900
|
+
borderRadius: "6px",
|
|
45901
|
+
padding: "0 8px",
|
|
45902
|
+
height: "22px",
|
|
45903
|
+
boxShadow: "0 2px 10px rgba(0,0,0,0.22)",
|
|
45904
|
+
color: "rgba(255,255,255,0.6)",
|
|
45905
|
+
fontSize: "10px",
|
|
45906
|
+
fontFamily: "Inter, sans-serif",
|
|
45907
|
+
fontWeight: 600,
|
|
45908
|
+
letterSpacing: "0.06em",
|
|
45909
|
+
textTransform: "uppercase",
|
|
45821
45910
|
whiteSpace: "nowrap",
|
|
45822
|
-
|
|
45911
|
+
maxWidth: "100%"
|
|
45823
45912
|
}, positionStyleMap[props.direction || "none"])
|
|
45824
45913
|
}, dragTitle)));
|
|
45825
45914
|
}
|
|
@@ -45862,32 +45951,33 @@ const positionStyleMap = {
|
|
|
45862
45951
|
transform: "translate(-50%, -50%)"
|
|
45863
45952
|
}
|
|
45864
45953
|
};
|
|
45954
|
+
const DRAG_LINE_COLOR = "rgba(22, 20, 17, 0.55)";
|
|
45865
45955
|
const directionImage = {
|
|
45866
45956
|
top: {
|
|
45867
45957
|
backgroundImage: `linear-gradient(
|
|
45868
45958
|
to bottom,
|
|
45869
|
-
|
|
45959
|
+
${DRAG_LINE_COLOR} 3px ,
|
|
45870
45960
|
transparent 3px
|
|
45871
45961
|
)`
|
|
45872
45962
|
},
|
|
45873
45963
|
bottom: {
|
|
45874
45964
|
backgroundImage: `linear-gradient(
|
|
45875
45965
|
to top,
|
|
45876
|
-
|
|
45966
|
+
${DRAG_LINE_COLOR} 3px ,
|
|
45877
45967
|
transparent 3px
|
|
45878
45968
|
)`
|
|
45879
45969
|
},
|
|
45880
45970
|
left: {
|
|
45881
45971
|
backgroundImage: `linear-gradient(
|
|
45882
45972
|
to right,
|
|
45883
|
-
|
|
45973
|
+
${DRAG_LINE_COLOR} 3px ,
|
|
45884
45974
|
transparent 3px
|
|
45885
45975
|
)`
|
|
45886
45976
|
},
|
|
45887
45977
|
right: {
|
|
45888
45978
|
backgroundImage: `linear-gradient(
|
|
45889
45979
|
to left,
|
|
45890
|
-
|
|
45980
|
+
${DRAG_LINE_COLOR} 3px ,
|
|
45891
45981
|
transparent 3px
|
|
45892
45982
|
)`
|
|
45893
45983
|
},
|
|
@@ -46322,13 +46412,21 @@ const StandardLayout$1 = "_StandardLayout_457hp_1";
|
|
|
46322
46412
|
var styles$5 = {
|
|
46323
46413
|
StandardLayout: StandardLayout$1
|
|
46324
46414
|
};
|
|
46325
|
-
const
|
|
46326
|
-
const
|
|
46327
|
-
const
|
|
46328
|
-
const
|
|
46329
|
-
const
|
|
46415
|
+
const layoutGroup = "_layoutGroup_mf2ie_3";
|
|
46416
|
+
const layoutGroupTitle = "_layoutGroupTitle_mf2ie_7";
|
|
46417
|
+
const layoutItem = "_layoutItem_mf2ie_26";
|
|
46418
|
+
const layoutColumns = "_layoutColumns_mf2ie_44";
|
|
46419
|
+
const layoutColumn = "_layoutColumn_mf2ie_44";
|
|
46420
|
+
const blockGrid = "_blockGrid_mf2ie_61";
|
|
46421
|
+
const blockItem = "_blockItem_mf2ie_68";
|
|
46422
|
+
const blockItemContainer = "_blockItemContainer_mf2ie_81";
|
|
46423
|
+
const blockItemLabel = "_blockItemLabel_mf2ie_93";
|
|
46330
46424
|
var styles$4 = {
|
|
46425
|
+
layoutGroup,
|
|
46426
|
+
layoutGroupTitle,
|
|
46331
46427
|
layoutItem,
|
|
46428
|
+
layoutColumns,
|
|
46429
|
+
layoutColumn,
|
|
46332
46430
|
blockGrid,
|
|
46333
46431
|
blockItem,
|
|
46334
46432
|
blockItemContainer,
|
|
@@ -46730,13 +46828,11 @@ function BlockItem({
|
|
|
46730
46828
|
}
|
|
46731
46829
|
function LayoutItem({ columns, title: title2 }) {
|
|
46732
46830
|
const [visible, setVisible] = useState(false);
|
|
46733
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
46734
|
-
|
|
46735
|
-
|
|
46736
|
-
|
|
46737
|
-
|
|
46738
|
-
cursor: "pointer"
|
|
46739
|
-
}
|
|
46831
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
46832
|
+
className: styles$4.layoutGroup
|
|
46833
|
+
}, /* @__PURE__ */ React__default.createElement("p", {
|
|
46834
|
+
className: styles$4.layoutGroupTitle,
|
|
46835
|
+
onClick: () => setVisible((v2) => !v2)
|
|
46740
46836
|
}, /* @__PURE__ */ React__default.createElement("span", null, title2), columns.length > 1 && /* @__PURE__ */ React__default.createElement("span", null, !visible ? /* @__PURE__ */ React__default.createElement(IconCaretRight$1, null) : /* @__PURE__ */ React__default.createElement(IconCaretUp$1, null))), columns.map((item2, index2) => {
|
|
46741
46837
|
const hide = !visible && index2 !== 0;
|
|
46742
46838
|
const payload = {
|
|
@@ -46758,34 +46854,20 @@ function LayoutItem({ columns, title: title2 }) {
|
|
|
46758
46854
|
style: {
|
|
46759
46855
|
height: hide ? 0 : void 0,
|
|
46760
46856
|
overflow: "hidden",
|
|
46761
|
-
marginBottom: hide ? 0 :
|
|
46857
|
+
marginBottom: hide ? 0 : void 0
|
|
46762
46858
|
}
|
|
46763
46859
|
}, /* @__PURE__ */ React__default.createElement(BlockAvatarWrapper, {
|
|
46764
46860
|
type: AdvancedType.SECTION,
|
|
46765
46861
|
payload
|
|
46766
46862
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
46767
|
-
|
|
46768
|
-
border: "1px solid rgb(229, 229, 229)",
|
|
46769
|
-
width: "100%",
|
|
46770
|
-
padding: 10
|
|
46771
|
-
}
|
|
46863
|
+
className: styles$4.layoutItem
|
|
46772
46864
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
46773
|
-
|
|
46774
|
-
|
|
46775
|
-
|
|
46776
|
-
|
|
46777
|
-
|
|
46778
|
-
|
|
46779
|
-
}, item2.map((column, index22) => {
|
|
46780
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
46781
|
-
key: index22,
|
|
46782
|
-
style: {
|
|
46783
|
-
borderRight: index22 === item2.length - 1 ? void 0 : "1px solid rgb(85, 85, 85)",
|
|
46784
|
-
height: "100%",
|
|
46785
|
-
width: column
|
|
46786
|
-
}
|
|
46787
|
-
});
|
|
46788
|
-
})))));
|
|
46865
|
+
className: styles$4.layoutColumns
|
|
46866
|
+
}, item2.map((column, index22) => /* @__PURE__ */ React__default.createElement("div", {
|
|
46867
|
+
key: index22,
|
|
46868
|
+
className: styles$4.layoutColumn,
|
|
46869
|
+
style: { width: column }
|
|
46870
|
+
}))))));
|
|
46789
46871
|
}));
|
|
46790
46872
|
}
|
|
46791
46873
|
var OverlayScrollbars$2 = "";
|
|
@@ -52219,25 +52301,25 @@ const TwoColumnLayout = (props) => {
|
|
|
52219
52301
|
style: { height: containerHeight, flex: 1, overflow: "hidden" }
|
|
52220
52302
|
}, props.children))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
|
|
52221
52303
|
};
|
|
52222
|
-
const stage = "
|
|
52223
|
-
const blocksPanel = "
|
|
52224
|
-
const blocksPanelHead = "
|
|
52225
|
-
const blocksPanelBody = "
|
|
52226
|
-
const canvasWrap = "
|
|
52227
|
-
const canvasToolbar = "
|
|
52228
|
-
const canvasToolbarSegment = "
|
|
52229
|
-
const canvasToolbarSep = "
|
|
52230
|
-
const configPanel = "
|
|
52231
|
-
const open = "
|
|
52232
|
-
const configPanelInner = "
|
|
52233
|
-
const cpHeader = "
|
|
52234
|
-
const cpTitle = "
|
|
52235
|
-
const cpClose = "
|
|
52236
|
-
const cpBody = "
|
|
52237
|
-
const presetItem = "
|
|
52238
|
-
const presetCard = "
|
|
52239
|
-
const presetThumb = "
|
|
52240
|
-
const presetLabel = "
|
|
52304
|
+
const stage = "_stage_11xsz_3";
|
|
52305
|
+
const blocksPanel = "_blocksPanel_11xsz_17";
|
|
52306
|
+
const blocksPanelHead = "_blocksPanelHead_11xsz_32";
|
|
52307
|
+
const blocksPanelBody = "_blocksPanelBody_11xsz_43";
|
|
52308
|
+
const canvasWrap = "_canvasWrap_11xsz_102";
|
|
52309
|
+
const canvasToolbar = "_canvasToolbar_11xsz_139";
|
|
52310
|
+
const canvasToolbarSegment = "_canvasToolbarSegment_11xsz_148";
|
|
52311
|
+
const canvasToolbarSep = "_canvasToolbarSep_11xsz_161";
|
|
52312
|
+
const configPanel = "_configPanel_11xsz_170";
|
|
52313
|
+
const open = "_open_11xsz_182";
|
|
52314
|
+
const configPanelInner = "_configPanelInner_11xsz_188";
|
|
52315
|
+
const cpHeader = "_cpHeader_11xsz_203";
|
|
52316
|
+
const cpTitle = "_cpTitle_11xsz_213";
|
|
52317
|
+
const cpClose = "_cpClose_11xsz_222";
|
|
52318
|
+
const cpBody = "_cpBody_11xsz_244";
|
|
52319
|
+
const presetItem = "_presetItem_11xsz_388";
|
|
52320
|
+
const presetCard = "_presetCard_11xsz_394";
|
|
52321
|
+
const presetThumb = "_presetThumb_11xsz_415";
|
|
52322
|
+
const presetLabel = "_presetLabel_11xsz_422";
|
|
52241
52323
|
var styles = {
|
|
52242
52324
|
stage,
|
|
52243
52325
|
blocksPanel,
|
|
@@ -52371,15 +52453,37 @@ const headerHeroPayload = section(
|
|
|
52371
52453
|
],
|
|
52372
52454
|
{ "background-color": "#1a1814", padding: "48px 0px 40px" }
|
|
52373
52455
|
);
|
|
52456
|
+
const singleProductCardPayload = section(
|
|
52457
|
+
[
|
|
52458
|
+
col(
|
|
52459
|
+
[
|
|
52460
|
+
imgBlock({ width: "100%", padding: "0px" }),
|
|
52461
|
+
textBlock(
|
|
52462
|
+
'<p style="text-align:center;font-weight:600;margin:0;">Product Name</p>',
|
|
52463
|
+
{ padding: "12px 16px 4px", "font-size": "14px" }
|
|
52464
|
+
),
|
|
52465
|
+
textBlock('<p style="text-align:center;color:#6b6660;margin:0;">$29.99</p>', {
|
|
52466
|
+
padding: "0px 16px 12px",
|
|
52467
|
+
"font-size": "13px"
|
|
52468
|
+
}),
|
|
52469
|
+
btnBlock("Buy Now")
|
|
52470
|
+
],
|
|
52471
|
+
{
|
|
52472
|
+
padding: "0px",
|
|
52473
|
+
border: "1px solid rgba(26,24,20,0.08)",
|
|
52474
|
+
"background-color": "#ffffff",
|
|
52475
|
+
"border-radius": "8px"
|
|
52476
|
+
}
|
|
52477
|
+
)
|
|
52478
|
+
],
|
|
52479
|
+
{ padding: "16px 24px", "background-color": "#f7f5f2" }
|
|
52480
|
+
);
|
|
52374
52481
|
const makeProductCol = () => col(
|
|
52375
52482
|
[
|
|
52376
52483
|
imgBlock({ width: "160px", padding: "0px" }),
|
|
52377
52484
|
textBlock(
|
|
52378
52485
|
'<p style="text-align:center;font-weight:600;margin:0;">Product Name</p>',
|
|
52379
|
-
{
|
|
52380
|
-
padding: "5px 4px 1px",
|
|
52381
|
-
"font-size": "13px"
|
|
52382
|
-
}
|
|
52486
|
+
{ padding: "5px 4px 1px", "font-size": "13px" }
|
|
52383
52487
|
),
|
|
52384
52488
|
textBlock('<p style="text-align:center;color:#6b6660;margin:0;">$29.99</p>', {
|
|
52385
52489
|
padding: "0px 4px 4px",
|
|
@@ -52387,11 +52491,15 @@ const makeProductCol = () => col(
|
|
|
52387
52491
|
}),
|
|
52388
52492
|
btnBlock("Buy Now")
|
|
52389
52493
|
],
|
|
52390
|
-
{
|
|
52494
|
+
{
|
|
52495
|
+
padding: "8px",
|
|
52496
|
+
border: "1px solid rgba(26,24,20,0.08)",
|
|
52497
|
+
"background-color": "#ffffff"
|
|
52498
|
+
}
|
|
52391
52499
|
);
|
|
52392
52500
|
const productCardPayload = section(
|
|
52393
52501
|
[makeProductCol(), makeProductCol(), makeProductCol()],
|
|
52394
|
-
{ padding: "20px
|
|
52502
|
+
{ padding: "20px 8px", "background-color": "#f7f5f2" }
|
|
52395
52503
|
);
|
|
52396
52504
|
const quotePayload = section(
|
|
52397
52505
|
[
|
|
@@ -52609,6 +52717,52 @@ const ThumbHeaderHero = () => /* @__PURE__ */ React__default.createElement("svg"
|
|
|
52609
52717
|
rx: "3",
|
|
52610
52718
|
fill: "#6366f1"
|
|
52611
52719
|
}));
|
|
52720
|
+
const ThumbSingleProduct = () => /* @__PURE__ */ React__default.createElement("svg", {
|
|
52721
|
+
width: "56",
|
|
52722
|
+
height: "44",
|
|
52723
|
+
viewBox: "0 0 56 44",
|
|
52724
|
+
fill: "none"
|
|
52725
|
+
}, /* @__PURE__ */ React__default.createElement("rect", {
|
|
52726
|
+
x: "4",
|
|
52727
|
+
y: "2",
|
|
52728
|
+
width: "48",
|
|
52729
|
+
height: "40",
|
|
52730
|
+
rx: "3",
|
|
52731
|
+
fill: "#f4f2ef"
|
|
52732
|
+
}), /* @__PURE__ */ React__default.createElement("rect", {
|
|
52733
|
+
x: "4",
|
|
52734
|
+
y: "2",
|
|
52735
|
+
width: "48",
|
|
52736
|
+
height: "20",
|
|
52737
|
+
rx: "3",
|
|
52738
|
+
fill: "#e8e4e0"
|
|
52739
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
52740
|
+
d: "M22 18 l6-8 l4 5 l2-3 l6 6 Z",
|
|
52741
|
+
fill: "#c8c4c0",
|
|
52742
|
+
opacity: "0.7"
|
|
52743
|
+
}), /* @__PURE__ */ React__default.createElement("rect", {
|
|
52744
|
+
x: "10",
|
|
52745
|
+
y: "26",
|
|
52746
|
+
width: "28",
|
|
52747
|
+
height: "2.5",
|
|
52748
|
+
rx: "1",
|
|
52749
|
+
fill: "#c8c4c0"
|
|
52750
|
+
}), /* @__PURE__ */ React__default.createElement("rect", {
|
|
52751
|
+
x: "18",
|
|
52752
|
+
y: "30.5",
|
|
52753
|
+
width: "14",
|
|
52754
|
+
height: "2",
|
|
52755
|
+
rx: "1",
|
|
52756
|
+
fill: "#d0ccc8"
|
|
52757
|
+
}), /* @__PURE__ */ React__default.createElement("rect", {
|
|
52758
|
+
x: "12",
|
|
52759
|
+
y: "35",
|
|
52760
|
+
width: "28",
|
|
52761
|
+
height: "5",
|
|
52762
|
+
rx: "2.5",
|
|
52763
|
+
fill: "#1a1814",
|
|
52764
|
+
opacity: "0.75"
|
|
52765
|
+
}));
|
|
52612
52766
|
const ThumbProductCard = () => /* @__PURE__ */ React__default.createElement("svg", {
|
|
52613
52767
|
width: "56",
|
|
52614
52768
|
height: "44",
|
|
@@ -52750,9 +52904,16 @@ const presetBlocks = [
|
|
|
52750
52904
|
payload: headerHeroPayload,
|
|
52751
52905
|
thumbnail: /* @__PURE__ */ React__default.createElement(ThumbHeaderHero, null)
|
|
52752
52906
|
}),
|
|
52907
|
+
/* @__PURE__ */ React__default.createElement(PresetCard, {
|
|
52908
|
+
key: "product-card-single",
|
|
52909
|
+
label: "Single Product",
|
|
52910
|
+
type: AdvancedType.SECTION,
|
|
52911
|
+
payload: singleProductCardPayload,
|
|
52912
|
+
thumbnail: /* @__PURE__ */ React__default.createElement(ThumbSingleProduct, null)
|
|
52913
|
+
}),
|
|
52753
52914
|
/* @__PURE__ */ React__default.createElement(PresetCard, {
|
|
52754
52915
|
key: "product-card",
|
|
52755
|
-
label: "
|
|
52916
|
+
label: "Products (3-up)",
|
|
52756
52917
|
type: AdvancedType.SECTION,
|
|
52757
52918
|
payload: productCardPayload,
|
|
52758
52919
|
thumbnail: /* @__PURE__ */ React__default.createElement(ThumbProductCard, null)
|
|
@@ -53116,5 +53277,60 @@ const GoMailerLayout = (props) => {
|
|
|
53116
53277
|
className: styles.cpBody
|
|
53117
53278
|
}, panelInited && /* @__PURE__ */ React__default.createElement(AttributePanel, null))))), /* @__PURE__ */ React__default.createElement(InteractivePrompt, null), /* @__PURE__ */ React__default.createElement(MergeTagBadgePrompt, null)));
|
|
53118
53279
|
};
|
|
53119
|
-
|
|
53280
|
+
function htmlToPlainText(html) {
|
|
53281
|
+
if (!html)
|
|
53282
|
+
return "";
|
|
53283
|
+
return html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<[^>]+>/g, "").replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/\n{3,}/g, "\n\n").trim();
|
|
53284
|
+
}
|
|
53285
|
+
function summariseBlock(block2, idx) {
|
|
53286
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
53287
|
+
const v2 = (_b2 = (_a2 = block2.data) == null ? void 0 : _a2.value) != null ? _b2 : {};
|
|
53288
|
+
const attr = (_c = block2.attributes) != null ? _c : {};
|
|
53289
|
+
const rawHtml = (_f = (_e = (_d = v2.content) != null ? _d : v2.text) != null ? _e : v2.innerText) != null ? _f : "";
|
|
53290
|
+
const plainText = htmlToPlainText(rawHtml);
|
|
53291
|
+
const alt = (_h = (_g = attr.alt) != null ? _g : v2.alt) != null ? _h : "";
|
|
53292
|
+
const href = (_k = (_j = (_i = attr.href) != null ? _i : v2.href) != null ? _j : v2.url) != null ? _k : "";
|
|
53293
|
+
return {
|
|
53294
|
+
idx,
|
|
53295
|
+
type: block2.type,
|
|
53296
|
+
title: block2.title,
|
|
53297
|
+
plainText,
|
|
53298
|
+
alt,
|
|
53299
|
+
href
|
|
53300
|
+
};
|
|
53301
|
+
}
|
|
53302
|
+
function collectBlocks(block2, idx, out) {
|
|
53303
|
+
var _a2;
|
|
53304
|
+
out.push(summariseBlock(block2, idx));
|
|
53305
|
+
((_a2 = block2.children) != null ? _a2 : []).forEach((child, i2) => {
|
|
53306
|
+
collectBlocks(child, `${idx}.children.[${i2}]`, out);
|
|
53307
|
+
});
|
|
53308
|
+
}
|
|
53309
|
+
function useAIContext() {
|
|
53310
|
+
const editorContent = useEditorContent();
|
|
53311
|
+
const { emailTemplate, focusBlock: focusBlock2, focusIdx: focusIdx2, selection } = editorContent;
|
|
53312
|
+
const blockSummaries = useMemo(() => {
|
|
53313
|
+
const out = [];
|
|
53314
|
+
if (emailTemplate == null ? void 0 : emailTemplate.content) {
|
|
53315
|
+
collectBlocks(emailTemplate.content, "content", out);
|
|
53316
|
+
}
|
|
53317
|
+
return out;
|
|
53318
|
+
}, [emailTemplate]);
|
|
53319
|
+
const emailPlainText = useMemo(
|
|
53320
|
+
() => blockSummaries.filter((b2) => b2.plainText).map((b2) => b2.plainText).join("\n\n"),
|
|
53321
|
+
[blockSummaries]
|
|
53322
|
+
);
|
|
53323
|
+
const focusBlockPlainText = useMemo(() => {
|
|
53324
|
+
if (!focusBlock2)
|
|
53325
|
+
return "";
|
|
53326
|
+
return summariseBlock(focusBlock2, focusIdx2).plainText;
|
|
53327
|
+
}, [focusBlock2, focusIdx2]);
|
|
53328
|
+
return __spreadProps(__spreadValues({}, editorContent), {
|
|
53329
|
+
blockSummaries,
|
|
53330
|
+
emailPlainText,
|
|
53331
|
+
focusBlockPlainText,
|
|
53332
|
+
selectedText: selection.text
|
|
53333
|
+
});
|
|
53334
|
+
}
|
|
53335
|
+
export { GoMailerLayout as $, AttributePanel as A, BlockLayer as B, Color as C, Decoration as D, BorderWidth as E, FontFamily as F, FontWeight as G, Height as H, Padding as I, ClassName as J, PresetColorsProvider as K, LetterSpacing as L, MjmlToJson as M, NavbarLinkPadding as N, ShortcutToolbar as O, Page as P, BlockMarketManager as Q, BlockMaskWrapper as R, SelectionRangeProvider as S, TextAlign as T, SourceCodePanel as U, VerticalAlign as V, Width as W, InteractivePrompt as X, SimpleLayout as Y, StandardLayout as Z, TwoColumnLayout as _, getIconNameByBlockType as a, MergeTagBadgePrompt as a0, ExtensionContext as a1, ExtensionProvider as a2, useExtensionProps as a3, RICH_TEXT_TOOL_BAR as a4, TextField as a5, InputWithUnitField as a6, SearchField as a7, TextAreaField as a8, NumberField as a9, SliderField as aa, UploadField as ab, ImageUploaderField as ac, SelectField as ad, TreeSelectField as ae, AutoCompleteField as af, RadioGroupField as ag, SwitchField as ah, CheckboxField as ai, EditTabField as aj, EditGridTabField as ak, InlineTextField as al, ColorPickerField as am, enhancer as an, RichTextField as ao, ShadowDom as ap, 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, useAIContext as u, BorderColor as v, FontSize$1 as w, MergeTags$1 as x, BorderStyle as y, FontStyle as z };
|
|
53120
53336
|
//# sourceMappingURL=index2.js.map
|