@kgalexander/mcreate 1.0.7 → 1.0.8
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.
|
@@ -1707,7 +1707,7 @@ var empty_default = {
|
|
|
1707
1707
|
version: "1.0.0",
|
|
1708
1708
|
published: true,
|
|
1709
1709
|
creator: "Kevin Guerrero",
|
|
1710
|
-
image: "
|
|
1710
|
+
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==",
|
|
1711
1711
|
content: [
|
|
1712
1712
|
{
|
|
1713
1713
|
id: "main-body",
|
|
@@ -3418,7 +3418,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
|
|
|
3418
3418
|
/* Merge field tags - dashed underline for {{variable}} patterns */
|
|
3419
3419
|
.merge-field-tag {
|
|
3420
3420
|
|
|
3421
|
-
background-color:
|
|
3421
|
+
background-color: white;
|
|
3422
3422
|
border-radius: 4px;
|
|
3423
3423
|
padding: 0px;
|
|
3424
3424
|
border: 1px solid var(--border);
|
|
@@ -4286,7 +4286,7 @@ var DragButton = ({ getReferenceRect, focusIdx, elementType, isDragging }) => {
|
|
|
4286
4286
|
zIndex: 49,
|
|
4287
4287
|
opacity: isDragging ? 0.3 : 1
|
|
4288
4288
|
},
|
|
4289
|
-
className: "flex items-center justify-center bg-
|
|
4289
|
+
className: "flex items-center justify-center bg-white border shadow-sm rounded-full cursor-grab hover:bg-blue-400 hover:border-blue-300 active:cursor-grabbing transition-colors",
|
|
4290
4290
|
children: /* @__PURE__ */ jsx2(Move, { className: "w-4 h-4pointer-events-none", color: isDragButtonHovered ? "white" : "gray" })
|
|
4291
4291
|
}
|
|
4292
4292
|
);
|
|
@@ -11303,7 +11303,7 @@ function Separator({
|
|
|
11303
11303
|
}
|
|
11304
11304
|
|
|
11305
11305
|
// src/core/editor/components/float-ui/helper.ts
|
|
11306
|
-
var floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0";
|
|
11306
|
+
var floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0 text-black";
|
|
11307
11307
|
|
|
11308
11308
|
// src/components/ui/popover.tsx
|
|
11309
11309
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -11407,7 +11407,7 @@ var TextLinkMenu = ({ editor }) => {
|
|
|
11407
11407
|
Button,
|
|
11408
11408
|
{
|
|
11409
11409
|
variant: "ghost",
|
|
11410
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
11410
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
11411
11411
|
onMouseDown: (e) => e.preventDefault(),
|
|
11412
11412
|
children: [
|
|
11413
11413
|
/* @__PURE__ */ jsx20(LinkIcon2, { className: "size-4" }),
|
|
@@ -12289,7 +12289,7 @@ var TiptapOverlayContent = ({ idx, getReferenceRect, getShadowElement, initialWi
|
|
|
12289
12289
|
text-align: inherit;
|
|
12290
12290
|
}
|
|
12291
12291
|
.tiptap-overlay .ProseMirror .merge-field-tag {
|
|
12292
|
-
background-color:
|
|
12292
|
+
background-color: white;
|
|
12293
12293
|
border-radius: 4px;
|
|
12294
12294
|
padding: 0px;
|
|
12295
12295
|
border: 1px solid var(--border);
|
|
@@ -12366,7 +12366,7 @@ var DeleteButton = () => {
|
|
|
12366
12366
|
variant: "ghost",
|
|
12367
12367
|
className: floatButtonVariants,
|
|
12368
12368
|
onClick: handleDelete,
|
|
12369
|
-
children: /* @__PURE__ */ jsx23(TrashIcon2, { className: "size-4" })
|
|
12369
|
+
children: /* @__PURE__ */ jsx23(TrashIcon2, { className: "size-4 " })
|
|
12370
12370
|
}
|
|
12371
12371
|
) }),
|
|
12372
12372
|
/* @__PURE__ */ jsx23(TooltipContent, { side: "bottom", children: "Delete" })
|
|
@@ -12663,7 +12663,7 @@ var HrefMenu = () => {
|
|
|
12663
12663
|
Button,
|
|
12664
12664
|
{
|
|
12665
12665
|
variant: "ghost",
|
|
12666
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
12666
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
12667
12667
|
children: [
|
|
12668
12668
|
/* @__PURE__ */ jsx26(LinkIcon3, { className: "size-4" }),
|
|
12669
12669
|
/* @__PURE__ */ jsx26("p", { children: "Add link" })
|
|
@@ -13472,7 +13472,7 @@ var MlsNumberMenu = () => {
|
|
|
13472
13472
|
Button,
|
|
13473
13473
|
{
|
|
13474
13474
|
variant: "ghost",
|
|
13475
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
13475
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
13476
13476
|
children: [
|
|
13477
13477
|
/* @__PURE__ */ jsx38(HousePlusIcon, { className: "size-4" }),
|
|
13478
13478
|
/* @__PURE__ */ jsx38("p", { children: "MLS" })
|
|
@@ -13821,14 +13821,14 @@ var DividerScale = ({ getReferenceRect }) => {
|
|
|
13821
13821
|
"div",
|
|
13822
13822
|
{
|
|
13823
13823
|
onPointerDown: (e) => handlePointerDown(e, "left"),
|
|
13824
|
-
className: `w-[18px] h-[18px] cursor-ew-resize bg-
|
|
13824
|
+
className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -left-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "left" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
|
|
13825
13825
|
}
|
|
13826
13826
|
),
|
|
13827
13827
|
showRightHandle && (activeSide === null || activeSide === "right") && /* @__PURE__ */ jsx43(
|
|
13828
13828
|
"div",
|
|
13829
13829
|
{
|
|
13830
13830
|
onPointerDown: (e) => handlePointerDown(e, "right"),
|
|
13831
|
-
className: `w-[18px] h-[18px] cursor-ew-resize bg-
|
|
13831
|
+
className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -right-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "right" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
|
|
13832
13832
|
}
|
|
13833
13833
|
)
|
|
13834
13834
|
]
|
|
@@ -13973,7 +13973,7 @@ var ButtonScale = ({ getReferenceRect }) => {
|
|
|
13973
13973
|
}, [getReferenceRect, refs, update, virtualReference]);
|
|
13974
13974
|
const showLeftHandle = currentAlign !== "left";
|
|
13975
13975
|
const showRightHandle = currentAlign !== "right";
|
|
13976
|
-
const handleBaseClass = "bg-
|
|
13976
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
13977
13977
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
13978
13978
|
return /* @__PURE__ */ jsxs27(
|
|
13979
13979
|
"div",
|
|
@@ -14186,7 +14186,7 @@ var ImageScale = ({ getReferenceRect }) => {
|
|
|
14186
14186
|
const showTopRight = currentAlign !== "right";
|
|
14187
14187
|
const showBottomLeft = currentAlign !== "left";
|
|
14188
14188
|
const showBottomRight = currentAlign !== "right";
|
|
14189
|
-
const handleBaseClass = "bg-
|
|
14189
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
14190
14190
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
14191
14191
|
return /* @__PURE__ */ jsxs28(
|
|
14192
14192
|
"div",
|
|
@@ -14364,7 +14364,7 @@ var SpacerScale = ({ getReferenceRect }) => {
|
|
|
14364
14364
|
);
|
|
14365
14365
|
return cleanup;
|
|
14366
14366
|
}, [getReferenceRect, refs, update, virtualReference]);
|
|
14367
|
-
const handleBaseClass = "bg-
|
|
14367
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
14368
14368
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
14369
14369
|
return /* @__PURE__ */ jsxs29(
|
|
14370
14370
|
"div",
|
|
@@ -14531,7 +14531,7 @@ var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
|
|
|
14531
14531
|
if (columnRects.length < 2 || columnWidths.length < 2) {
|
|
14532
14532
|
return null;
|
|
14533
14533
|
}
|
|
14534
|
-
const handleBaseClass = "bg-
|
|
14534
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full touch-none select-none pointer-events-auto";
|
|
14535
14535
|
const getHandleActiveClass = (index) => activeDivider === index ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
14536
14536
|
return /* @__PURE__ */ jsx47(Fragment17, { children: columnRects.slice(0, -1).map((rect, index) => {
|
|
14537
14537
|
const nextRect = columnRects[index + 1];
|
package/dist/index.js
CHANGED
|
@@ -1817,7 +1817,7 @@ var init_empty = __esm({
|
|
|
1817
1817
|
version: "1.0.0",
|
|
1818
1818
|
published: true,
|
|
1819
1819
|
creator: "Kevin Guerrero",
|
|
1820
|
-
image: "
|
|
1820
|
+
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==",
|
|
1821
1821
|
content: [
|
|
1822
1822
|
{
|
|
1823
1823
|
id: "main-body",
|
|
@@ -3544,7 +3544,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
|
|
|
3544
3544
|
/* Merge field tags - dashed underline for {{variable}} patterns */
|
|
3545
3545
|
.merge-field-tag {
|
|
3546
3546
|
|
|
3547
|
-
background-color:
|
|
3547
|
+
background-color: white;
|
|
3548
3548
|
border-radius: 4px;
|
|
3549
3549
|
padding: 0px;
|
|
3550
3550
|
border: 1px solid var(--border);
|
|
@@ -4443,7 +4443,7 @@ var init_drag_button = __esm({
|
|
|
4443
4443
|
zIndex: 49,
|
|
4444
4444
|
opacity: isDragging ? 0.3 : 1
|
|
4445
4445
|
},
|
|
4446
|
-
className: "flex items-center justify-center bg-
|
|
4446
|
+
className: "flex items-center justify-center bg-white border shadow-sm rounded-full cursor-grab hover:bg-blue-400 hover:border-blue-300 active:cursor-grabbing transition-colors",
|
|
4447
4447
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Move, { className: "w-4 h-4pointer-events-none", color: isDragButtonHovered ? "white" : "gray" })
|
|
4448
4448
|
}
|
|
4449
4449
|
);
|
|
@@ -11625,7 +11625,7 @@ var floatButtonVariants;
|
|
|
11625
11625
|
var init_helper = __esm({
|
|
11626
11626
|
"src/core/editor/components/float-ui/helper.ts"() {
|
|
11627
11627
|
"use strict";
|
|
11628
|
-
floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0";
|
|
11628
|
+
floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0 text-black";
|
|
11629
11629
|
}
|
|
11630
11630
|
});
|
|
11631
11631
|
|
|
@@ -11752,7 +11752,7 @@ var init_text_link_menu = __esm({
|
|
|
11752
11752
|
Button,
|
|
11753
11753
|
{
|
|
11754
11754
|
variant: "ghost",
|
|
11755
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
11755
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
11756
11756
|
onMouseDown: (e) => e.preventDefault(),
|
|
11757
11757
|
children: [
|
|
11758
11758
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.LinkIcon, { className: "size-4" }),
|
|
@@ -12673,7 +12673,7 @@ var init_tiptap_overlay = __esm({
|
|
|
12673
12673
|
text-align: inherit;
|
|
12674
12674
|
}
|
|
12675
12675
|
.tiptap-overlay .ProseMirror .merge-field-tag {
|
|
12676
|
-
background-color:
|
|
12676
|
+
background-color: white;
|
|
12677
12677
|
border-radius: 4px;
|
|
12678
12678
|
padding: 0px;
|
|
12679
12679
|
border: 1px solid var(--border);
|
|
@@ -12756,7 +12756,7 @@ var init_delete_button = __esm({
|
|
|
12756
12756
|
variant: "ghost",
|
|
12757
12757
|
className: floatButtonVariants,
|
|
12758
12758
|
onClick: handleDelete,
|
|
12759
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react16.TrashIcon, { className: "size-4" })
|
|
12759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react16.TrashIcon, { className: "size-4 " })
|
|
12760
12760
|
}
|
|
12761
12761
|
) }),
|
|
12762
12762
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipContent, { side: "bottom", children: "Delete" })
|
|
@@ -13090,7 +13090,7 @@ var init_href_menu = __esm({
|
|
|
13090
13090
|
Button,
|
|
13091
13091
|
{
|
|
13092
13092
|
variant: "ghost",
|
|
13093
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
13093
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
13094
13094
|
children: [
|
|
13095
13095
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react19.LinkIcon, { className: "size-4" }),
|
|
13096
13096
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: "Add link" })
|
|
@@ -14067,7 +14067,7 @@ var init_mlsNumber_menu = __esm({
|
|
|
14067
14067
|
Button,
|
|
14068
14068
|
{
|
|
14069
14069
|
variant: "ghost",
|
|
14070
|
-
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
|
|
14070
|
+
className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
|
|
14071
14071
|
children: [
|
|
14072
14072
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.HousePlusIcon, { className: "size-4" }),
|
|
14073
14073
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "MLS" })
|
|
@@ -14471,14 +14471,14 @@ var init_divider_scale = __esm({
|
|
|
14471
14471
|
"div",
|
|
14472
14472
|
{
|
|
14473
14473
|
onPointerDown: (e) => handlePointerDown(e, "left"),
|
|
14474
|
-
className: `w-[18px] h-[18px] cursor-ew-resize bg-
|
|
14474
|
+
className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -left-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "left" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
|
|
14475
14475
|
}
|
|
14476
14476
|
),
|
|
14477
14477
|
showRightHandle && (activeSide === null || activeSide === "right") && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
14478
14478
|
"div",
|
|
14479
14479
|
{
|
|
14480
14480
|
onPointerDown: (e) => handlePointerDown(e, "right"),
|
|
14481
|
-
className: `w-[18px] h-[18px] cursor-ew-resize bg-
|
|
14481
|
+
className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -right-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "right" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
|
|
14482
14482
|
}
|
|
14483
14483
|
)
|
|
14484
14484
|
]
|
|
@@ -14632,7 +14632,7 @@ var init_button_scale = __esm({
|
|
|
14632
14632
|
}, [getReferenceRect, refs, update, virtualReference]);
|
|
14633
14633
|
const showLeftHandle = currentAlign !== "left";
|
|
14634
14634
|
const showRightHandle = currentAlign !== "right";
|
|
14635
|
-
const handleBaseClass = "bg-
|
|
14635
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
14636
14636
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
14637
14637
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
14638
14638
|
"div",
|
|
@@ -14854,7 +14854,7 @@ var init_image_scale = __esm({
|
|
|
14854
14854
|
const showTopRight = currentAlign !== "right";
|
|
14855
14855
|
const showBottomLeft = currentAlign !== "left";
|
|
14856
14856
|
const showBottomRight = currentAlign !== "right";
|
|
14857
|
-
const handleBaseClass = "bg-
|
|
14857
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
14858
14858
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
14859
14859
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
14860
14860
|
"div",
|
|
@@ -15041,7 +15041,7 @@ var init_spacer_scale = __esm({
|
|
|
15041
15041
|
);
|
|
15042
15042
|
return cleanup;
|
|
15043
15043
|
}, [getReferenceRect, refs, update, virtualReference]);
|
|
15044
|
-
const handleBaseClass = "bg-
|
|
15044
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
|
|
15045
15045
|
const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
15046
15046
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
15047
15047
|
"div",
|
|
@@ -15217,7 +15217,7 @@ var init_column_scale = __esm({
|
|
|
15217
15217
|
if (columnRects.length < 2 || columnWidths.length < 2) {
|
|
15218
15218
|
return null;
|
|
15219
15219
|
}
|
|
15220
|
-
const handleBaseClass = "bg-
|
|
15220
|
+
const handleBaseClass = "bg-white shadow-md border rounded-full touch-none select-none pointer-events-auto";
|
|
15221
15221
|
const getHandleActiveClass = (index) => activeDivider === index ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
|
|
15222
15222
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: columnRects.slice(0, -1).map((rect, index) => {
|
|
15223
15223
|
const nextRect = columnRects[index + 1];
|
|
@@ -17024,19 +17024,23 @@ function TemplateHeader() {
|
|
|
17024
17024
|
if (isSaving || !templateId || !onSave) return;
|
|
17025
17025
|
setIsSaving(true);
|
|
17026
17026
|
try {
|
|
17027
|
+
const PLACEHOLDER_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==";
|
|
17027
17028
|
const template = useEditorStore.getState().template;
|
|
17029
|
+
const needsCapture = useEditorStore.getState().hasUnsavedChanges() || !template.image || template.image === PLACEHOLDER_IMAGE;
|
|
17028
17030
|
let capturedImage;
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17031
|
+
if (needsCapture) {
|
|
17032
|
+
try {
|
|
17033
|
+
const { default: mjml2html } = await import("mjml-browser");
|
|
17034
|
+
const mjmlString = json2mjml(template, "editing");
|
|
17035
|
+
const result = mjml2html(mjmlString);
|
|
17036
|
+
capturedImage = await captureTemplateImage(result.html);
|
|
17037
|
+
} catch (err) {
|
|
17038
|
+
console.error("[TemplateCapture] Failed:", err?.message || JSON.stringify(err) || err, err?.stack || "");
|
|
17039
|
+
}
|
|
17036
17040
|
}
|
|
17037
17041
|
await onSave(templateId, template, capturedImage);
|
|
17038
|
-
markAsSaved();
|
|
17039
17042
|
onExit?.();
|
|
17043
|
+
markAsSaved();
|
|
17040
17044
|
} catch (error) {
|
|
17041
17045
|
console.error("Failed to save:", error);
|
|
17042
17046
|
} finally {
|
|
@@ -21539,7 +21543,8 @@ var TRANSPARENT_ALLOWED_ELEMENTS = [
|
|
|
21539
21543
|
"socialBgColor",
|
|
21540
21544
|
"buttonBgColor",
|
|
21541
21545
|
"highlightColor",
|
|
21542
|
-
"propertyBgColor"
|
|
21546
|
+
"propertyBgColor",
|
|
21547
|
+
"dividerBgColor"
|
|
21543
21548
|
];
|
|
21544
21549
|
var rgbToHex2 = (rgb) => {
|
|
21545
21550
|
const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/i);
|
|
@@ -22720,7 +22725,7 @@ function ParentBreadcrumb() {
|
|
|
22720
22725
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(BreadcrumbItem, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Tooltip, { children: [
|
|
22721
22726
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "relative", children: [
|
|
22722
22727
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { variant: "ghost", disabled: true, className: "p-0 px-1.5 shadow-none transition-none cursor-pointer", children: currentName }),
|
|
22723
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-
|
|
22728
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-background pointer-events-none" })
|
|
22724
22729
|
] }) }),
|
|
22725
22730
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: currentName })
|
|
22726
22731
|
] }) })
|
|
@@ -23341,7 +23346,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
|
|
|
23341
23346
|
Button,
|
|
23342
23347
|
{
|
|
23343
23348
|
variant: "ghost",
|
|
23344
|
-
className: "shadow-none transition-none cursor-pointer bg-transparent border border-r-0 rounded-[12px]",
|
|
23349
|
+
className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-r-0 rounded-[12px]",
|
|
23345
23350
|
size: "icon",
|
|
23346
23351
|
"aria-label": "Decrease Font Size",
|
|
23347
23352
|
onClick: handleDecrease,
|
|
@@ -23357,7 +23362,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
|
|
|
23357
23362
|
InputGroupInput,
|
|
23358
23363
|
{
|
|
23359
23364
|
type: "number",
|
|
23360
|
-
className: "text-center w-12 border-0 shadow-none px-0",
|
|
23365
|
+
className: "text-center w-12 border-0 shadow-none px-0 bg-background",
|
|
23361
23366
|
placeholder: "--",
|
|
23362
23367
|
value: input.displayValue,
|
|
23363
23368
|
onChange: (e) => input.setLocalValue(e.target.value),
|
|
@@ -23401,7 +23406,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
|
|
|
23401
23406
|
Button,
|
|
23402
23407
|
{
|
|
23403
23408
|
variant: "ghost",
|
|
23404
|
-
className: "shadow-none transition-none cursor-pointer bg-transparent border border-l-0 rounded-[12px]",
|
|
23409
|
+
className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-l-0 rounded-[12px]",
|
|
23405
23410
|
size: "icon",
|
|
23406
23411
|
"aria-label": "Increase Font Size",
|
|
23407
23412
|
onClick: handleIncrease,
|
|
@@ -25458,7 +25463,7 @@ var ButtonToolbar = () => {
|
|
|
25458
25463
|
className: "shadow-none transition-none cursor-pointer",
|
|
25459
25464
|
size: "icon",
|
|
25460
25465
|
onClick: handleCycleButtonAlign,
|
|
25461
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4" })
|
|
25466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
25462
25467
|
}
|
|
25463
25468
|
) }),
|
|
25464
25469
|
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TooltipContent, { side: "bottom", children: "Align" })
|
|
@@ -26698,14 +26703,10 @@ var SocialToolbar = () => {
|
|
|
26698
26703
|
className: "shadow-none transition-none cursor-pointer",
|
|
26699
26704
|
size: "icon",
|
|
26700
26705
|
onClick: handleCycleAlign,
|
|
26701
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
26706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
26702
26707
|
}
|
|
26703
26708
|
) }),
|
|
26704
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.
|
|
26705
|
-
"Align (",
|
|
26706
|
-
currentAlign,
|
|
26707
|
-
")"
|
|
26708
|
-
] })
|
|
26709
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
|
|
26709
26710
|
] })
|
|
26710
26711
|
] })
|
|
26711
26712
|
] });
|
|
@@ -27297,7 +27298,7 @@ var DividerToolbar = () => {
|
|
|
27297
27298
|
className: "shadow-none transition-none cursor-pointer",
|
|
27298
27299
|
size: "icon",
|
|
27299
27300
|
onClick: handleCycleAlign,
|
|
27300
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
27301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
27301
27302
|
}
|
|
27302
27303
|
) }),
|
|
27303
27304
|
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
|
|
@@ -27415,7 +27416,7 @@ var ImageToolbar = () => {
|
|
|
27415
27416
|
className: "shadow-none transition-none cursor-pointer",
|
|
27416
27417
|
size: "icon",
|
|
27417
27418
|
onClick: handleCycleAlign,
|
|
27418
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
27419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
27419
27420
|
}
|
|
27420
27421
|
) }),
|
|
27421
27422
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TooltipContent, { side: "bottom", children: "Align" })
|
package/dist/index.mjs
CHANGED
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
setupDragImage,
|
|
61
61
|
useEditorStore,
|
|
62
62
|
useSidebarContext
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-FJ4KXNNM.mjs";
|
|
64
64
|
|
|
65
65
|
// src/core/editor/components/email-template-v2/header.tsx
|
|
66
66
|
import { ArrowLeftIcon, CopyIcon, MegaphoneIcon, MoreHorizontalIcon, PencilIcon, SendIcon, TrashIcon } from "lucide-react";
|
|
@@ -256,19 +256,23 @@ function TemplateHeader() {
|
|
|
256
256
|
if (isSaving || !templateId || !onSave) return;
|
|
257
257
|
setIsSaving(true);
|
|
258
258
|
try {
|
|
259
|
+
const PLACEHOLDER_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==";
|
|
259
260
|
const template = useEditorStore.getState().template;
|
|
261
|
+
const needsCapture = useEditorStore.getState().hasUnsavedChanges() || !template.image || template.image === PLACEHOLDER_IMAGE;
|
|
260
262
|
let capturedImage;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
if (needsCapture) {
|
|
264
|
+
try {
|
|
265
|
+
const { default: mjml2html } = await import("mjml-browser");
|
|
266
|
+
const mjmlString = json2mjml(template, "editing");
|
|
267
|
+
const result = mjml2html(mjmlString);
|
|
268
|
+
capturedImage = await captureTemplateImage(result.html);
|
|
269
|
+
} catch (err) {
|
|
270
|
+
console.error("[TemplateCapture] Failed:", err?.message || JSON.stringify(err) || err, err?.stack || "");
|
|
271
|
+
}
|
|
268
272
|
}
|
|
269
273
|
await onSave(templateId, template, capturedImage);
|
|
270
|
-
markAsSaved();
|
|
271
274
|
onExit?.();
|
|
275
|
+
markAsSaved();
|
|
272
276
|
} catch (error) {
|
|
273
277
|
console.error("Failed to save:", error);
|
|
274
278
|
} finally {
|
|
@@ -4723,7 +4727,8 @@ var TRANSPARENT_ALLOWED_ELEMENTS = [
|
|
|
4723
4727
|
"socialBgColor",
|
|
4724
4728
|
"buttonBgColor",
|
|
4725
4729
|
"highlightColor",
|
|
4726
|
-
"propertyBgColor"
|
|
4730
|
+
"propertyBgColor",
|
|
4731
|
+
"dividerBgColor"
|
|
4727
4732
|
];
|
|
4728
4733
|
var rgbToHex2 = (rgb) => {
|
|
4729
4734
|
const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/i);
|
|
@@ -5884,7 +5889,7 @@ function ParentBreadcrumb() {
|
|
|
5884
5889
|
/* @__PURE__ */ jsx31(BreadcrumbItem, { children: /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
5885
5890
|
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs29("div", { className: "relative", children: [
|
|
5886
5891
|
/* @__PURE__ */ jsx31(Button, { variant: "ghost", disabled: true, className: "p-0 px-1.5 shadow-none transition-none cursor-pointer", children: currentName }),
|
|
5887
|
-
/* @__PURE__ */ jsx31("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-
|
|
5892
|
+
/* @__PURE__ */ jsx31("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-background pointer-events-none" })
|
|
5888
5893
|
] }) }),
|
|
5889
5894
|
/* @__PURE__ */ jsx31(TooltipContent, { side: "bottom", className: "z-51", children: currentName })
|
|
5890
5895
|
] }) })
|
|
@@ -6475,7 +6480,7 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
6475
6480
|
Button,
|
|
6476
6481
|
{
|
|
6477
6482
|
variant: "ghost",
|
|
6478
|
-
className: "shadow-none transition-none cursor-pointer bg-transparent border border-r-0 rounded-[12px]",
|
|
6483
|
+
className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-r-0 rounded-[12px]",
|
|
6479
6484
|
size: "icon",
|
|
6480
6485
|
"aria-label": "Decrease Font Size",
|
|
6481
6486
|
onClick: handleDecrease,
|
|
@@ -6491,7 +6496,7 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
6491
6496
|
InputGroupInput,
|
|
6492
6497
|
{
|
|
6493
6498
|
type: "number",
|
|
6494
|
-
className: "text-center w-12 border-0 shadow-none px-0",
|
|
6499
|
+
className: "text-center w-12 border-0 shadow-none px-0 bg-background",
|
|
6495
6500
|
placeholder: "--",
|
|
6496
6501
|
value: input.displayValue,
|
|
6497
6502
|
onChange: (e) => input.setLocalValue(e.target.value),
|
|
@@ -6535,7 +6540,7 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
6535
6540
|
Button,
|
|
6536
6541
|
{
|
|
6537
6542
|
variant: "ghost",
|
|
6538
|
-
className: "shadow-none transition-none cursor-pointer bg-transparent border border-l-0 rounded-[12px]",
|
|
6543
|
+
className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-l-0 rounded-[12px]",
|
|
6539
6544
|
size: "icon",
|
|
6540
6545
|
"aria-label": "Increase Font Size",
|
|
6541
6546
|
onClick: handleIncrease,
|
|
@@ -8543,7 +8548,7 @@ var ButtonToolbar = () => {
|
|
|
8543
8548
|
className: "shadow-none transition-none cursor-pointer",
|
|
8544
8549
|
size: "icon",
|
|
8545
8550
|
onClick: handleCycleButtonAlign,
|
|
8546
|
-
children: /* @__PURE__ */ jsx52("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4" })
|
|
8551
|
+
children: /* @__PURE__ */ jsx52("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
8547
8552
|
}
|
|
8548
8553
|
) }),
|
|
8549
8554
|
/* @__PURE__ */ jsx52(TooltipContent, { side: "bottom", children: "Align" })
|
|
@@ -9741,14 +9746,10 @@ var SocialToolbar = () => {
|
|
|
9741
9746
|
className: "shadow-none transition-none cursor-pointer",
|
|
9742
9747
|
size: "icon",
|
|
9743
9748
|
onClick: handleCycleAlign,
|
|
9744
|
-
children: /* @__PURE__ */ jsx61("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
9749
|
+
children: /* @__PURE__ */ jsx61("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
9745
9750
|
}
|
|
9746
9751
|
) }),
|
|
9747
|
-
/* @__PURE__ */
|
|
9748
|
-
"Align (",
|
|
9749
|
-
currentAlign,
|
|
9750
|
-
")"
|
|
9751
|
-
] })
|
|
9752
|
+
/* @__PURE__ */ jsx61(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
|
|
9752
9753
|
] })
|
|
9753
9754
|
] })
|
|
9754
9755
|
] });
|
|
@@ -10318,7 +10319,7 @@ var DividerToolbar = () => {
|
|
|
10318
10319
|
className: "shadow-none transition-none cursor-pointer",
|
|
10319
10320
|
size: "icon",
|
|
10320
10321
|
onClick: handleCycleAlign,
|
|
10321
|
-
children: /* @__PURE__ */ jsx64("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
10322
|
+
children: /* @__PURE__ */ jsx64("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
10322
10323
|
}
|
|
10323
10324
|
) }),
|
|
10324
10325
|
/* @__PURE__ */ jsx64(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
|
|
@@ -10431,7 +10432,7 @@ var ImageToolbar = () => {
|
|
|
10431
10432
|
className: "shadow-none transition-none cursor-pointer",
|
|
10432
10433
|
size: "icon",
|
|
10433
10434
|
onClick: handleCycleAlign,
|
|
10434
|
-
children: /* @__PURE__ */ jsx65("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
|
|
10435
|
+
children: /* @__PURE__ */ jsx65("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
|
|
10435
10436
|
}
|
|
10436
10437
|
) }),
|
|
10437
10438
|
/* @__PURE__ */ jsx65(TooltipContent, { side: "bottom", children: "Align" })
|
|
@@ -11708,7 +11709,7 @@ function useAutoSave() {
|
|
|
11708
11709
|
// src/core/editor/components/email-template-v2/template-page.tsx
|
|
11709
11710
|
import "react-json-view-lite/dist/index.css";
|
|
11710
11711
|
import { jsx as jsx74, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
11711
|
-
var Editor2 = lazy(() => import("./core-
|
|
11712
|
+
var Editor2 = lazy(() => import("./core-OW5KVXX7.mjs").then((module) => ({
|
|
11712
11713
|
default: module.Editor
|
|
11713
11714
|
})));
|
|
11714
11715
|
function TemplatePage({
|