@kgalexander/mcreate 0.0.13 → 0.0.15
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/dist/{chunk-LAW7VVEQ.mjs → chunk-XSQHR5MC.mjs} +269 -350
- package/dist/{core-GBVVYXAB.mjs → core-66YYN7ME.mjs} +1 -1
- package/dist/index.d.mts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +988 -788
- package/dist/index.mjs +749 -476
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
FONTS,
|
|
22
22
|
FONT_SIZE_STEP,
|
|
23
23
|
History,
|
|
24
|
-
IMAGE_SELECTION_VALID_TYPES,
|
|
25
24
|
Input,
|
|
26
25
|
LETTER_SPACING_STEP,
|
|
27
26
|
LINE_HEIGHT_STEP,
|
|
@@ -29,7 +28,6 @@ import {
|
|
|
29
28
|
MAX_FONT_SIZE,
|
|
30
29
|
MAX_LETTER_SPACING,
|
|
31
30
|
MAX_LINE_HEIGHT,
|
|
32
|
-
MAX_PAID_LEVEL,
|
|
33
31
|
MAX_TEMPLATE_SIZE,
|
|
34
32
|
MIN_FONT_SIZE,
|
|
35
33
|
MIN_LETTER_SPACING,
|
|
@@ -61,10 +59,10 @@ import {
|
|
|
61
59
|
setupDragImage,
|
|
62
60
|
useEditorStore,
|
|
63
61
|
useSidebarContext
|
|
64
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-XSQHR5MC.mjs";
|
|
65
63
|
|
|
66
64
|
// src/core/editor/components/email-template-v2/header.tsx
|
|
67
|
-
import { ArrowLeftIcon, CopyIcon, MegaphoneIcon, MoreHorizontalIcon, PencilIcon, TrashIcon } from "lucide-react";
|
|
65
|
+
import { ArrowLeftIcon, CopyIcon, MegaphoneIcon, MoreHorizontalIcon, PencilIcon, SendIcon, TrashIcon } from "lucide-react";
|
|
68
66
|
|
|
69
67
|
// src/core/editor/components/email-template-v2/components/template-json-view.tsx
|
|
70
68
|
import { CodeIcon } from "lucide-react";
|
|
@@ -93,7 +91,7 @@ function TemplateSizeIndicator() {
|
|
|
93
91
|
"span",
|
|
94
92
|
{
|
|
95
93
|
className: cn(
|
|
96
|
-
"text-xs text-muted-foreground ml-2",
|
|
94
|
+
"text-xs text-muted-foreground ml-2 hidden md:block",
|
|
97
95
|
percentage > 90 && "text-yellow-600",
|
|
98
96
|
isAtSizeLimit && "text-red-600"
|
|
99
97
|
),
|
|
@@ -196,15 +194,23 @@ function TemplateNameDialog() {
|
|
|
196
194
|
|
|
197
195
|
// src/core/editor/components/email-template-v2/header.tsx
|
|
198
196
|
import { jsx as jsx4, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
199
|
-
function TemplateHeader(
|
|
200
|
-
const
|
|
197
|
+
function TemplateHeader() {
|
|
198
|
+
const templateId = useEditorStore((s) => s.templateId);
|
|
199
|
+
const onSave = useEditorStore((s) => s.onSave);
|
|
200
|
+
const markAsSaved = useEditorStore((s) => s.markAsSaved);
|
|
201
|
+
const isSaving = useEditorStore((s) => s.isSaving);
|
|
202
|
+
const setIsSaving = useEditorStore((s) => s.setIsSaving);
|
|
203
|
+
const onExit = useEditorStore((s) => s.onExit);
|
|
204
|
+
const templateName = useEditorStore((s) => s.template?.name);
|
|
201
205
|
const handleExit = async () => {
|
|
202
206
|
console.log("handleExit - templateId:", templateId);
|
|
203
207
|
if (isSaving || !templateId || !onSave) return;
|
|
204
208
|
setIsSaving(true);
|
|
205
209
|
try {
|
|
206
|
-
await onSave(templateId, template);
|
|
210
|
+
await onSave(templateId, useEditorStore.getState().template);
|
|
207
211
|
markAsSaved();
|
|
212
|
+
onExit?.();
|
|
213
|
+
console.log("handleExit - onExit called");
|
|
208
214
|
} catch (error) {
|
|
209
215
|
console.error("Failed to save:", error);
|
|
210
216
|
} finally {
|
|
@@ -221,16 +227,21 @@ function TemplateHeader({ template }) {
|
|
|
221
227
|
/* @__PURE__ */ jsx4(TemplateSizeIndicator, {})
|
|
222
228
|
] }),
|
|
223
229
|
/* @__PURE__ */ jsxs5("div", { className: "flex flex-row gap-2 items-center", children: [
|
|
224
|
-
|
|
230
|
+
/* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground w-[100px] truncate text-ellipsis overflow-hidden", children: templateName || "Loading..." }),
|
|
225
231
|
/* @__PURE__ */ jsx4(TemplateNameDialog, {})
|
|
226
232
|
] }),
|
|
227
233
|
/* @__PURE__ */ jsxs5("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
228
|
-
/* @__PURE__ */ jsx4(TemplateJsonView, {}),
|
|
229
|
-
/* @__PURE__ */ jsx4(HistoryDebugView, {}),
|
|
234
|
+
process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsx4(TemplateJsonView, {}),
|
|
235
|
+
process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsx4(HistoryDebugView, {}),
|
|
230
236
|
/* @__PURE__ */ jsx4(Preview, {}),
|
|
231
237
|
/* @__PURE__ */ jsxs5(DropdownMenu, { children: [
|
|
232
238
|
/* @__PURE__ */ jsx4(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "icon", className: "cursor-pointer shadow-none transition-none rounded-[12px]", children: /* @__PURE__ */ jsx4(MoreHorizontalIcon, { className: "w-4 h-4" }) }) }),
|
|
233
|
-
/* @__PURE__ */ jsxs5(DropdownMenuContent, { align: "
|
|
239
|
+
/* @__PURE__ */ jsxs5(DropdownMenuContent, { align: "end", className: "z-51", children: [
|
|
240
|
+
/* @__PURE__ */ jsxs5(DropdownMenuItem, { variant: "default", className: "cursor-pointer md:hidden", children: [
|
|
241
|
+
/* @__PURE__ */ jsx4(SendIcon, { className: "w-4 h-4" }),
|
|
242
|
+
"Send Test"
|
|
243
|
+
] }),
|
|
244
|
+
/* @__PURE__ */ jsx4(DropdownMenuSeparator, { className: " md:hidden" }),
|
|
234
245
|
/* @__PURE__ */ jsxs5(DropdownMenuItem, { className: "cursor-pointer", children: [
|
|
235
246
|
/* @__PURE__ */ jsx4(PencilIcon, { className: "w-4 h-4" }),
|
|
236
247
|
"Change Template"
|
|
@@ -250,14 +261,17 @@ function TemplateHeader({ template }) {
|
|
|
250
261
|
] })
|
|
251
262
|
] })
|
|
252
263
|
] }),
|
|
253
|
-
/* @__PURE__ */ jsx4(Button, { variant: "default", className: "cursor-pointer shadow-none transition-none rounded-[12px]", children: "
|
|
264
|
+
/* @__PURE__ */ jsx4(Button, { variant: "default", className: "w-fit cursor-pointer shadow-none transition-none rounded-[12px] hidden md:block", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-row gap-2 items-center", children: [
|
|
265
|
+
/* @__PURE__ */ jsx4(SendIcon, {}),
|
|
266
|
+
/* @__PURE__ */ jsx4("p", { children: "Send Test" })
|
|
267
|
+
] }) })
|
|
254
268
|
] })
|
|
255
269
|
] });
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
// src/core/editor/components/email-template-v2/sidebar/sidebar.tsx
|
|
259
273
|
import { useCallback as useCallback8, useEffect as useEffect2, useRef as useRef3, useMemo as useMemo6, useState as useState6 } from "react";
|
|
260
|
-
import { BlocksIcon,
|
|
274
|
+
import { BlocksIcon, Paintbrush, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
261
275
|
|
|
262
276
|
// src/core/editor/components/email-template-v2/sidebar/view/elements/main.tsx
|
|
263
277
|
import { useState as useState2 } from "react";
|
|
@@ -1357,7 +1371,7 @@ var rgbaArrayToHex = (rgba) => {
|
|
|
1357
1371
|
const [r, g, b] = rgba.map((v) => Math.round(v));
|
|
1358
1372
|
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase()}`;
|
|
1359
1373
|
};
|
|
1360
|
-
var ColorButton = ({ color, onColorSelect, currentColor }) => /* @__PURE__ */ jsxs19(Tooltip, { children: [
|
|
1374
|
+
var ColorButton = ({ colorName, color, onColorSelect, currentColor }) => /* @__PURE__ */ jsxs19(Tooltip, { children: [
|
|
1361
1375
|
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
1362
1376
|
"button",
|
|
1363
1377
|
{
|
|
@@ -1366,11 +1380,13 @@ var ColorButton = ({ color, onColorSelect, currentColor }) => /* @__PURE__ */ js
|
|
|
1366
1380
|
className: `aspect-square rounded-full cursor-pointer border hover:border-gray-500 ${isColorSelected(color, currentColor) ? "border-2 border-blue-500" : "border-accent"}`
|
|
1367
1381
|
}
|
|
1368
1382
|
) }),
|
|
1369
|
-
/* @__PURE__ */ jsx21(TooltipContent, { children: color })
|
|
1383
|
+
/* @__PURE__ */ jsx21(TooltipContent, { children: colorName || color })
|
|
1370
1384
|
] });
|
|
1371
1385
|
function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "Color", colorTarget, focusIdx, currentColor }) {
|
|
1372
1386
|
const templateColors = useTemplateColors();
|
|
1373
1387
|
const lastPickedColorRef = useRef2(null);
|
|
1388
|
+
const userData = useEditorStore((s) => s.userData);
|
|
1389
|
+
const colorPalettes = userData?.brand_kits?.[0]?.color_palettes ?? [];
|
|
1374
1390
|
const [colorWheelOpen, setColorWheelOpen] = useState4(false);
|
|
1375
1391
|
const handleColorPickerChange = useCallback6((rgba) => {
|
|
1376
1392
|
const hex = rgbaArrayToHex(rgba);
|
|
@@ -1424,7 +1440,7 @@ function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "C
|
|
|
1424
1440
|
templateColors.map((color) => /* @__PURE__ */ jsx21(ColorButton, { color, onColorSelect, currentColor }, color))
|
|
1425
1441
|
] }) })
|
|
1426
1442
|
] }),
|
|
1427
|
-
/* @__PURE__ */ jsxs19("div", { className: "w-full mb-4", children: [
|
|
1443
|
+
colorPalettes.length > 0 && /* @__PURE__ */ jsxs19("div", { className: "w-full mb-4", children: [
|
|
1428
1444
|
/* @__PURE__ */ jsxs19("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: [
|
|
1429
1445
|
/* @__PURE__ */ jsxs19("div", { className: "flex flex-row items-center gap-2 h-[44px]", children: [
|
|
1430
1446
|
/* @__PURE__ */ jsx21(Hexagon, { className: "w-4 h-4 text-muted-foreground" }),
|
|
@@ -1432,16 +1448,10 @@ function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "C
|
|
|
1432
1448
|
] }),
|
|
1433
1449
|
/* @__PURE__ */ jsx21(Button, { variant: "link", className: "text-sm pr-0 cursor-pointer", children: "Edit" })
|
|
1434
1450
|
] }),
|
|
1435
|
-
/* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
] }),
|
|
1440
|
-
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-2", children: [
|
|
1441
|
-
/* @__PURE__ */ jsx21(Label, { className: "text-xs font-medium text-muted-foreground", children: "Color palette 2" }),
|
|
1442
|
-
/* @__PURE__ */ jsx21("div", { className: "w-full grid grid-cols-7 gap-2", children: /* @__PURE__ */ jsx21(ColorButton, { color: "#E97575", onColorSelect, currentColor }) })
|
|
1443
|
-
] })
|
|
1444
|
-
] })
|
|
1451
|
+
/* @__PURE__ */ jsx21("div", { className: "w-full flex flex-col gap-4", children: colorPalettes.map((palette) => /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-2", children: [
|
|
1452
|
+
/* @__PURE__ */ jsx21(Label, { className: "text-xs font-medium text-muted-foreground", children: palette.name }),
|
|
1453
|
+
/* @__PURE__ */ jsx21("div", { className: "w-full grid grid-cols-7 gap-2", children: palette.colors.map((c) => /* @__PURE__ */ jsx21(ColorButton, { colorName: c.name, color: c.hex, onColorSelect, currentColor }, c.color_id)) })
|
|
1454
|
+
] }, palette.palette_id)) })
|
|
1445
1455
|
] }),
|
|
1446
1456
|
/* @__PURE__ */ jsxs19("div", { className: "w-full", children: [
|
|
1447
1457
|
/* @__PURE__ */ jsxs19("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: [
|
|
@@ -1527,6 +1537,7 @@ var IMAGES_MOCK_DATA = [
|
|
|
1527
1537
|
];
|
|
1528
1538
|
var ImageSelection = ({ setActiveView, lastView, onImageSelect, focusIdx }) => {
|
|
1529
1539
|
const template = useEditorStore((state) => state.template);
|
|
1540
|
+
const images = useEditorStore((state) => state.images);
|
|
1530
1541
|
const currentImageUrl = useMemo4(() => {
|
|
1531
1542
|
if (!focusIdx || !template) return null;
|
|
1532
1543
|
const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
|
|
@@ -1541,16 +1552,28 @@ var ImageSelection = ({ setActiveView, lastView, onImageSelect, focusIdx }) => {
|
|
|
1541
1552
|
] }) }),
|
|
1542
1553
|
/* @__PURE__ */ jsxs20("div", { className: "w-full", children: [
|
|
1543
1554
|
/* @__PURE__ */ jsx22("div", { className: "flex flex-row items-center justify-between w-full mb-4", children: /* @__PURE__ */ jsx22("p", { className: "text-sm font-medium", children: "Images" }) }),
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1555
|
+
/* @__PURE__ */ jsxs20("div", { className: "w-full grid grid-cols-3 gap-3", children: [
|
|
1556
|
+
IMAGES_MOCK_DATA.map((image, index) => /* @__PURE__ */ jsx22(
|
|
1557
|
+
Button,
|
|
1558
|
+
{
|
|
1559
|
+
variant: "outline",
|
|
1560
|
+
className: `aspect-square h-full w-full cursor-pointer shadow-none transition-none rounded-[12px] p-0 ${currentImageUrl === image.src ? "ring-2 ring-blue-500 ring-offset-2" : ""}`,
|
|
1561
|
+
onClick: () => onImageSelect?.(image.src),
|
|
1562
|
+
children: /* @__PURE__ */ jsx22("img", { src: image.src, alt: image.alt, className: "w-full h-full object-cover rounded-[12px]" })
|
|
1563
|
+
},
|
|
1564
|
+
index
|
|
1565
|
+
)),
|
|
1566
|
+
images.map((image, index) => /* @__PURE__ */ jsx22(
|
|
1567
|
+
Button,
|
|
1568
|
+
{
|
|
1569
|
+
variant: "outline",
|
|
1570
|
+
className: `aspect-square h-full w-full cursor-pointer shadow-none transition-none rounded-[12px] p-0 ${currentImageUrl === image.public_url ? "ring-2 ring-blue-500 ring-offset-2" : ""}`,
|
|
1571
|
+
onClick: () => onImageSelect?.(image.public_url),
|
|
1572
|
+
children: /* @__PURE__ */ jsx22("img", { src: image.public_url, alt: image.original_name, className: "w-full h-full object-cover rounded-[12px]" })
|
|
1573
|
+
},
|
|
1574
|
+
index
|
|
1575
|
+
))
|
|
1576
|
+
] })
|
|
1554
1577
|
] })
|
|
1555
1578
|
] });
|
|
1556
1579
|
};
|
|
@@ -1804,11 +1827,24 @@ var toTemplatePath = (focusIdx) => {
|
|
|
1804
1827
|
return focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
|
|
1805
1828
|
};
|
|
1806
1829
|
function TemplateSidebar({ editorLoading }) {
|
|
1807
|
-
const { activeView, setActiveView, lastView, colorType, colorTarget, imageTarget } = useSidebarContext();
|
|
1830
|
+
const { activeView, setActiveView, lastView, colorType, colorTarget, imageTarget, setImageTarget } = useSidebarContext();
|
|
1808
1831
|
const focusIdx = useEditorStore((state) => state.focusIdx);
|
|
1809
|
-
const template = useEditorStore((state) => state.template);
|
|
1810
1832
|
const tiptapEditor = useEditorStore((state) => state.tiptapEditor);
|
|
1833
|
+
const focusedElementAttrs = useEditorStore(
|
|
1834
|
+
(s) => s.focusIdx ? lodashGet2(s.template, toTemplatePath(s.focusIdx))?.attributes : null
|
|
1835
|
+
);
|
|
1836
|
+
const focusedElementType = useEditorStore(
|
|
1837
|
+
(s) => s.focusIdx ? lodashGet2(s.template, toTemplatePath(s.focusIdx))?.type : null
|
|
1838
|
+
);
|
|
1839
|
+
const parentElementAttrs = useEditorStore((s) => {
|
|
1840
|
+
if (!s.focusIdx) return null;
|
|
1841
|
+
const parentIdx = getParentIdx(s.focusIdx);
|
|
1842
|
+
return parentIdx ? lodashGet2(s.template, toTemplatePath(parentIdx))?.attributes : null;
|
|
1843
|
+
});
|
|
1844
|
+
const pageBgColor = useEditorStore((s) => s.template?.content?.[0]?.attributes?.["background-color"]);
|
|
1845
|
+
const linkColor = useEditorStore((s) => s.template?.content?.[0]?.data?.value?.linkColor);
|
|
1811
1846
|
const previousElementTypeRef = useRef3(void 0);
|
|
1847
|
+
const previousFocusIdxRef = useRef3(null);
|
|
1812
1848
|
const [openSidebar, setOpenSidebar] = useState6(true);
|
|
1813
1849
|
const [updateCounter, forceUpdate] = useState6(0);
|
|
1814
1850
|
useEffect2(() => {
|
|
@@ -1829,97 +1865,71 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1829
1865
|
if (colorTarget === "highlightColor" && tiptapEditor) {
|
|
1830
1866
|
return tiptapEditor.getAttributes("textStyle").backgroundColor || null;
|
|
1831
1867
|
}
|
|
1832
|
-
if (!focusIdx || !
|
|
1833
|
-
const path = toTemplatePath(focusIdx);
|
|
1834
|
-
const element = lodashGet2(template, path);
|
|
1835
|
-
if (!element) return null;
|
|
1868
|
+
if (!focusIdx || !focusedElementAttrs) return null;
|
|
1836
1869
|
switch (colorTarget) {
|
|
1837
1870
|
case "sectionBgColor":
|
|
1838
1871
|
case "buttonBgColor":
|
|
1839
|
-
return
|
|
1872
|
+
return focusedElementAttrs["background-color"] || null;
|
|
1840
1873
|
case "buttonTextColor":
|
|
1841
1874
|
case "socialTextColor":
|
|
1842
1875
|
case "socialItemTextColor":
|
|
1843
|
-
return
|
|
1876
|
+
return focusedElementAttrs["color"] || null;
|
|
1844
1877
|
case "strokeColor":
|
|
1845
1878
|
case "buttonStrokeColor": {
|
|
1846
|
-
const parsed = parseBorder(
|
|
1879
|
+
const parsed = parseBorder(focusedElementAttrs.border);
|
|
1847
1880
|
return parsed.color || null;
|
|
1848
1881
|
}
|
|
1849
1882
|
case "spacerBgColor":
|
|
1850
1883
|
case "dividerBgColor":
|
|
1851
1884
|
case "imageBgColor":
|
|
1852
1885
|
case "socialBgColor":
|
|
1853
|
-
return
|
|
1886
|
+
return focusedElementAttrs["container-background-color"] || null;
|
|
1854
1887
|
case "dividerBorderColor":
|
|
1855
|
-
return
|
|
1856
|
-
case "columnBgColor":
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
return column?.attributes?.["background-color"] || null;
|
|
1861
|
-
}
|
|
1862
|
-
case "columnStrokeColor": {
|
|
1863
|
-
const columnIdx = getParentIdx(focusIdx);
|
|
1864
|
-
if (!columnIdx) return null;
|
|
1865
|
-
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
1866
|
-
const parsed = parseBorder(column?.attributes?.border);
|
|
1867
|
-
return parsed.color || null;
|
|
1868
|
-
}
|
|
1869
|
-
case "propertyBgColor": {
|
|
1870
|
-
const columnIdx = getParentIdx(focusIdx);
|
|
1871
|
-
if (!columnIdx) return null;
|
|
1872
|
-
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
1873
|
-
return column?.attributes?.["background-color"] || null;
|
|
1874
|
-
}
|
|
1888
|
+
return focusedElementAttrs["border-color"] || null;
|
|
1889
|
+
case "columnBgColor":
|
|
1890
|
+
case "propertyBgColor":
|
|
1891
|
+
return parentElementAttrs?.["background-color"] || null;
|
|
1892
|
+
case "columnStrokeColor":
|
|
1875
1893
|
case "propertyStrokeColor": {
|
|
1876
|
-
const
|
|
1877
|
-
if (!columnIdx) return null;
|
|
1878
|
-
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
1879
|
-
const parsed = parseBorder(column?.attributes?.border);
|
|
1894
|
+
const parsed = parseBorder(parentElementAttrs?.border);
|
|
1880
1895
|
return parsed.color || null;
|
|
1881
1896
|
}
|
|
1882
1897
|
case "propertyTextColor": {
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
const parentIdx = getParentIdx(focusIdx);
|
|
1886
|
-
if (!parentIdx) return "#111116";
|
|
1887
|
-
const parent = lodashGet2(template, toTemplatePath(parentIdx));
|
|
1888
|
-
return parent?.attributes?.["text-color"] || "#111116";
|
|
1898
|
+
if (focusedElementType === "property-card-triple-item") {
|
|
1899
|
+
return parentElementAttrs?.["text-color"] || "#111116";
|
|
1889
1900
|
}
|
|
1890
|
-
return
|
|
1891
|
-
}
|
|
1892
|
-
case "statusColor": {
|
|
1893
|
-
const property = lodashGet2(template, toTemplatePath(focusIdx));
|
|
1894
|
-
return property?.attributes?.["status-color"] || "#B8B8B8";
|
|
1901
|
+
return focusedElementAttrs["text-color"] || "#111116";
|
|
1895
1902
|
}
|
|
1903
|
+
case "statusColor":
|
|
1904
|
+
return focusedElementAttrs["status-color"] || "#B8B8B8";
|
|
1896
1905
|
case "pageBgColor":
|
|
1897
|
-
return
|
|
1906
|
+
return pageBgColor || null;
|
|
1898
1907
|
case "linkColor":
|
|
1899
|
-
return
|
|
1908
|
+
return linkColor || "#0000ff";
|
|
1900
1909
|
default:
|
|
1901
1910
|
return null;
|
|
1902
1911
|
}
|
|
1903
|
-
}, [colorTarget, focusIdx,
|
|
1912
|
+
}, [colorTarget, focusIdx, focusedElementAttrs, parentElementAttrs, focusedElementType, pageBgColor, linkColor, tiptapEditor, updateCounter]);
|
|
1904
1913
|
useEffect2(() => {
|
|
1905
|
-
if (!focusIdx || !
|
|
1914
|
+
if (!focusIdx || !focusedElementType) {
|
|
1906
1915
|
previousElementTypeRef.current = void 0;
|
|
1907
1916
|
return;
|
|
1908
1917
|
}
|
|
1909
|
-
const
|
|
1910
|
-
const currentType = normalizeElementType(element?.type);
|
|
1918
|
+
const currentType = normalizeElementType(focusedElementType);
|
|
1911
1919
|
const previousType = previousElementTypeRef.current;
|
|
1912
1920
|
if (previousType && currentType !== previousType && activeView === "color") {
|
|
1913
1921
|
setActiveView(lastView);
|
|
1914
1922
|
}
|
|
1915
|
-
if (activeView === "images" &&
|
|
1923
|
+
if (activeView === "images" && previousFocusIdxRef.current !== null && previousFocusIdxRef.current !== focusIdx) {
|
|
1916
1924
|
setActiveView(lastView);
|
|
1925
|
+
setImageTarget(null);
|
|
1917
1926
|
}
|
|
1918
1927
|
if (activeView === "add-social" && currentType && !ADD_SOCIAL_VALID_TYPES.includes(currentType)) {
|
|
1919
1928
|
setActiveView(lastView);
|
|
1920
1929
|
}
|
|
1921
1930
|
previousElementTypeRef.current = currentType;
|
|
1922
|
-
|
|
1931
|
+
previousFocusIdxRef.current = focusIdx ?? null;
|
|
1932
|
+
}, [focusIdx, focusedElementType, activeView, lastView, setActiveView, setImageTarget]);
|
|
1923
1933
|
const handleColorSelect = useCallback8((color) => {
|
|
1924
1934
|
const tiptapEditor2 = useEditorStore.getState().tiptapEditor;
|
|
1925
1935
|
if (colorTarget === "textColor" && tiptapEditor2) {
|
|
@@ -1933,9 +1943,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1933
1943
|
}
|
|
1934
1944
|
window.dispatchEvent(new CustomEvent("toolbar-refresh"));
|
|
1935
1945
|
} else if (colorTarget === "sectionBgColor") {
|
|
1936
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
1937
|
-
if (focusIdx2 &&
|
|
1938
|
-
const element = lodashGet2(
|
|
1946
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
1947
|
+
if (focusIdx2 && template) {
|
|
1948
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
1939
1949
|
if (element) {
|
|
1940
1950
|
updateElement(focusIdx2, {
|
|
1941
1951
|
attributes: { ...element.attributes, "background-color": color }
|
|
@@ -1943,9 +1953,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1943
1953
|
}
|
|
1944
1954
|
}
|
|
1945
1955
|
} else if (colorTarget === "buttonBgColor") {
|
|
1946
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
1947
|
-
if (focusIdx2 &&
|
|
1948
|
-
const element = lodashGet2(
|
|
1956
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
1957
|
+
if (focusIdx2 && template) {
|
|
1958
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
1949
1959
|
if (element) {
|
|
1950
1960
|
updateElement(focusIdx2, {
|
|
1951
1961
|
attributes: { ...element.attributes, "background-color": color }
|
|
@@ -1953,9 +1963,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1953
1963
|
}
|
|
1954
1964
|
}
|
|
1955
1965
|
} else if (colorTarget === "buttonStrokeColor") {
|
|
1956
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
1957
|
-
if (focusIdx2 &&
|
|
1958
|
-
const element = lodashGet2(
|
|
1966
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
1967
|
+
if (focusIdx2 && template) {
|
|
1968
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
1959
1969
|
if (element) {
|
|
1960
1970
|
const parsed = parseBorder(element.attributes?.border);
|
|
1961
1971
|
const newBorder = formatBorder({
|
|
@@ -1969,9 +1979,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1969
1979
|
}
|
|
1970
1980
|
}
|
|
1971
1981
|
} else if (colorTarget === "buttonTextColor") {
|
|
1972
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
1973
|
-
if (focusIdx2 &&
|
|
1974
|
-
const element = lodashGet2(
|
|
1982
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
1983
|
+
if (focusIdx2 && template) {
|
|
1984
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
1975
1985
|
if (element) {
|
|
1976
1986
|
updateElement(focusIdx2, {
|
|
1977
1987
|
attributes: { ...element.attributes, "color": color }
|
|
@@ -1979,10 +1989,10 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1979
1989
|
}
|
|
1980
1990
|
}
|
|
1981
1991
|
} else if (colorTarget === "strokeColor") {
|
|
1982
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
1992
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
1983
1993
|
if (focusIdx2 === "content") return;
|
|
1984
|
-
if (focusIdx2 &&
|
|
1985
|
-
const element = lodashGet2(
|
|
1994
|
+
if (focusIdx2 && template) {
|
|
1995
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
1986
1996
|
if (element) {
|
|
1987
1997
|
const parsed = parseBorder(element.attributes?.border);
|
|
1988
1998
|
const newBorder = formatBorder({
|
|
@@ -1996,11 +2006,11 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
1996
2006
|
}
|
|
1997
2007
|
}
|
|
1998
2008
|
} else if (colorTarget === "columnBgColor") {
|
|
1999
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2000
|
-
if (focusIdx2 &&
|
|
2009
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2010
|
+
if (focusIdx2 && template) {
|
|
2001
2011
|
const columnIdx = getParentIdx(focusIdx2);
|
|
2002
2012
|
if (columnIdx) {
|
|
2003
|
-
const column = lodashGet2(
|
|
2013
|
+
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
2004
2014
|
if (column) {
|
|
2005
2015
|
updateElement(columnIdx, {
|
|
2006
2016
|
attributes: { ...column.attributes, "background-color": color }
|
|
@@ -2009,11 +2019,11 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2009
2019
|
}
|
|
2010
2020
|
}
|
|
2011
2021
|
} else if (colorTarget === "columnStrokeColor") {
|
|
2012
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2013
|
-
if (focusIdx2 &&
|
|
2022
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2023
|
+
if (focusIdx2 && template) {
|
|
2014
2024
|
const columnIdx = getParentIdx(focusIdx2);
|
|
2015
2025
|
if (columnIdx) {
|
|
2016
|
-
const column = lodashGet2(
|
|
2026
|
+
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
2017
2027
|
if (column) {
|
|
2018
2028
|
const parsed = parseBorder(column.attributes?.border);
|
|
2019
2029
|
const newBorder = formatBorder({
|
|
@@ -2028,9 +2038,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2028
2038
|
}
|
|
2029
2039
|
}
|
|
2030
2040
|
} else if (colorTarget === "spacerBgColor") {
|
|
2031
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2032
|
-
if (focusIdx2 &&
|
|
2033
|
-
const element = lodashGet2(
|
|
2041
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2042
|
+
if (focusIdx2 && template) {
|
|
2043
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2034
2044
|
if (element) {
|
|
2035
2045
|
updateElement(focusIdx2, {
|
|
2036
2046
|
attributes: { ...element.attributes, "container-background-color": color }
|
|
@@ -2038,9 +2048,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2038
2048
|
}
|
|
2039
2049
|
}
|
|
2040
2050
|
} else if (colorTarget === "dividerBorderColor") {
|
|
2041
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2042
|
-
if (focusIdx2 &&
|
|
2043
|
-
const element = lodashGet2(
|
|
2051
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2052
|
+
if (focusIdx2 && template) {
|
|
2053
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2044
2054
|
if (element) {
|
|
2045
2055
|
updateElement(focusIdx2, {
|
|
2046
2056
|
attributes: { ...element.attributes, "border-color": color }
|
|
@@ -2048,9 +2058,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2048
2058
|
}
|
|
2049
2059
|
}
|
|
2050
2060
|
} else if (colorTarget === "dividerBgColor") {
|
|
2051
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2052
|
-
if (focusIdx2 &&
|
|
2053
|
-
const element = lodashGet2(
|
|
2061
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2062
|
+
if (focusIdx2 && template) {
|
|
2063
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2054
2064
|
if (element) {
|
|
2055
2065
|
updateElement(focusIdx2, {
|
|
2056
2066
|
attributes: { ...element.attributes, "container-background-color": color }
|
|
@@ -2058,9 +2068,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2058
2068
|
}
|
|
2059
2069
|
}
|
|
2060
2070
|
} else if (colorTarget === "imageBgColor") {
|
|
2061
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2062
|
-
if (focusIdx2 &&
|
|
2063
|
-
const element = lodashGet2(
|
|
2071
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2072
|
+
if (focusIdx2 && template) {
|
|
2073
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2064
2074
|
if (element) {
|
|
2065
2075
|
updateElement(focusIdx2, {
|
|
2066
2076
|
attributes: { ...element.attributes, "container-background-color": color }
|
|
@@ -2068,9 +2078,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2068
2078
|
}
|
|
2069
2079
|
}
|
|
2070
2080
|
} else if (colorTarget === "socialBgColor") {
|
|
2071
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2072
|
-
if (focusIdx2 &&
|
|
2073
|
-
const element = lodashGet2(
|
|
2081
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2082
|
+
if (focusIdx2 && template) {
|
|
2083
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2074
2084
|
if (element) {
|
|
2075
2085
|
updateElement(focusIdx2, {
|
|
2076
2086
|
attributes: { ...element.attributes, "container-background-color": color }
|
|
@@ -2078,9 +2088,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2078
2088
|
}
|
|
2079
2089
|
}
|
|
2080
2090
|
} else if (colorTarget === "socialTextColor") {
|
|
2081
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2082
|
-
if (focusIdx2 &&
|
|
2083
|
-
const element = lodashGet2(
|
|
2091
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2092
|
+
if (focusIdx2 && template) {
|
|
2093
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2084
2094
|
if (element) {
|
|
2085
2095
|
updateElement(focusIdx2, {
|
|
2086
2096
|
attributes: { ...element.attributes, "color": color }
|
|
@@ -2088,9 +2098,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2088
2098
|
}
|
|
2089
2099
|
}
|
|
2090
2100
|
} else if (colorTarget === "socialItemTextColor") {
|
|
2091
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2092
|
-
if (focusIdx2 &&
|
|
2093
|
-
const element = lodashGet2(
|
|
2101
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2102
|
+
if (focusIdx2 && template) {
|
|
2103
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2094
2104
|
if (element) {
|
|
2095
2105
|
updateElement(focusIdx2, {
|
|
2096
2106
|
attributes: { ...element.attributes, "color": color }
|
|
@@ -2098,9 +2108,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2098
2108
|
}
|
|
2099
2109
|
}
|
|
2100
2110
|
} else if (colorTarget === "pageBgColor") {
|
|
2101
|
-
const { updateElement, template
|
|
2102
|
-
if (
|
|
2103
|
-
const pageElement =
|
|
2111
|
+
const { updateElement, template } = useEditorStore.getState();
|
|
2112
|
+
if (template) {
|
|
2113
|
+
const pageElement = template.content?.[0];
|
|
2104
2114
|
if (pageElement) {
|
|
2105
2115
|
updateElement("content", {
|
|
2106
2116
|
attributes: { ...pageElement.attributes, "background-color": color }
|
|
@@ -2108,9 +2118,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2108
2118
|
}
|
|
2109
2119
|
}
|
|
2110
2120
|
} else if (colorTarget === "linkColor") {
|
|
2111
|
-
const { updateElement, template
|
|
2112
|
-
if (
|
|
2113
|
-
const pageElement =
|
|
2121
|
+
const { updateElement, template } = useEditorStore.getState();
|
|
2122
|
+
if (template) {
|
|
2123
|
+
const pageElement = template.content?.[0];
|
|
2114
2124
|
if (pageElement) {
|
|
2115
2125
|
updateElement("content", {
|
|
2116
2126
|
data: { value: { ...pageElement.data?.value, linkColor: color } }
|
|
@@ -2118,11 +2128,11 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2118
2128
|
}
|
|
2119
2129
|
}
|
|
2120
2130
|
} else if (colorTarget === "propertyBgColor") {
|
|
2121
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2122
|
-
if (focusIdx2 &&
|
|
2131
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2132
|
+
if (focusIdx2 && template) {
|
|
2123
2133
|
const columnIdx = getParentIdx(focusIdx2);
|
|
2124
2134
|
if (columnIdx) {
|
|
2125
|
-
const column = lodashGet2(
|
|
2135
|
+
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
2126
2136
|
if (column) {
|
|
2127
2137
|
updateElement(columnIdx, {
|
|
2128
2138
|
attributes: { ...column.attributes, "background-color": color }
|
|
@@ -2131,12 +2141,12 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2131
2141
|
}
|
|
2132
2142
|
}
|
|
2133
2143
|
} else if (colorTarget === "propertyStrokeColor") {
|
|
2134
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2135
|
-
if (focusIdx2 &&
|
|
2144
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2145
|
+
if (focusIdx2 && template) {
|
|
2136
2146
|
const columnIdx = getParentIdx(focusIdx2);
|
|
2137
2147
|
if (columnIdx) {
|
|
2138
|
-
const column = lodashGet2(
|
|
2139
|
-
const property = lodashGet2(
|
|
2148
|
+
const column = lodashGet2(template, toTemplatePath(columnIdx));
|
|
2149
|
+
const property = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2140
2150
|
if (column) {
|
|
2141
2151
|
const parsed = parseBorder(column.attributes?.border);
|
|
2142
2152
|
const newBorder = formatBorder({
|
|
@@ -2156,13 +2166,13 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2156
2166
|
}
|
|
2157
2167
|
}
|
|
2158
2168
|
} else if (colorTarget === "propertyTextColor") {
|
|
2159
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2160
|
-
if (focusIdx2 &&
|
|
2161
|
-
const element = lodashGet2(
|
|
2169
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2170
|
+
if (focusIdx2 && template) {
|
|
2171
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2162
2172
|
if (element?.type === "property-card-triple-item") {
|
|
2163
2173
|
const parentIdx = getParentIdx(focusIdx2);
|
|
2164
2174
|
if (parentIdx) {
|
|
2165
|
-
const parent = lodashGet2(
|
|
2175
|
+
const parent = lodashGet2(template, toTemplatePath(parentIdx));
|
|
2166
2176
|
if (parent) {
|
|
2167
2177
|
updateElement(parentIdx, {
|
|
2168
2178
|
attributes: { ...parent.attributes, "text-color": color }
|
|
@@ -2176,9 +2186,9 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2176
2186
|
}
|
|
2177
2187
|
}
|
|
2178
2188
|
} else if (colorTarget === "statusColor") {
|
|
2179
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2180
|
-
if (focusIdx2 &&
|
|
2181
|
-
const property = lodashGet2(
|
|
2189
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2190
|
+
if (focusIdx2 && template) {
|
|
2191
|
+
const property = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2182
2192
|
if (property) {
|
|
2183
2193
|
updateElement(focusIdx2, {
|
|
2184
2194
|
attributes: { ...property.attributes, "status-color": color }
|
|
@@ -2188,10 +2198,17 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2188
2198
|
}
|
|
2189
2199
|
}, [colorTarget]);
|
|
2190
2200
|
const handleImageSelect = useCallback8((imageSrc) => {
|
|
2191
|
-
const { focusIdx: focusIdx2, updateElement, template
|
|
2192
|
-
if (!focusIdx2 || !
|
|
2193
|
-
const element = lodashGet2(
|
|
2201
|
+
const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
|
|
2202
|
+
if (!focusIdx2 || !template) return;
|
|
2203
|
+
const element = lodashGet2(template, toTemplatePath(focusIdx2));
|
|
2194
2204
|
if (!element) return;
|
|
2205
|
+
const validTypesForTarget = {
|
|
2206
|
+
sectionBgImage: ["section", "section-column", "section-property-km", "section-property-single-two", "section-property-triple"],
|
|
2207
|
+
imageElement: ["image"],
|
|
2208
|
+
propertyImage: ["property-card", "property-card-single-two", "property-card-triple-item"]
|
|
2209
|
+
};
|
|
2210
|
+
const validTypes = validTypesForTarget[imageTarget ?? ""];
|
|
2211
|
+
if (validTypes && !validTypes.includes(element.type)) return;
|
|
2195
2212
|
const attributeName = imageTarget === "imageElement" ? "src" : imageTarget === "propertyImage" ? "image-src" : "background-url";
|
|
2196
2213
|
updateElement(focusIdx2, {
|
|
2197
2214
|
attributes: { ...element.attributes, [attributeName]: imageSrc }
|
|
@@ -2235,19 +2252,6 @@ function TemplateSidebar({ editorLoading }) {
|
|
|
2235
2252
|
}
|
|
2236
2253
|
),
|
|
2237
2254
|
/* @__PURE__ */ jsx24("span", { className: "text-xs text-muted-foreground", children: "Styles" })
|
|
2238
|
-
] }),
|
|
2239
|
-
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2240
|
-
/* @__PURE__ */ jsx24(
|
|
2241
|
-
Button,
|
|
2242
|
-
{
|
|
2243
|
-
onClick: () => handleViewClick("brand"),
|
|
2244
|
-
variant: "ghost",
|
|
2245
|
-
size: "icon",
|
|
2246
|
-
className: `shadow-none transition-none w-[44px] h-[44px] p-0 flex flex-col items-center cursor-pointer ${activeView === "brand" ? "bg-sidebar-accent" : ""}`,
|
|
2247
|
-
children: /* @__PURE__ */ jsx24(Hexagon2, {})
|
|
2248
|
-
}
|
|
2249
|
-
),
|
|
2250
|
-
/* @__PURE__ */ jsx24("span", { className: "text-xs text-muted-foreground", children: "Brand" })
|
|
2251
2255
|
] })
|
|
2252
2256
|
] }),
|
|
2253
2257
|
/* @__PURE__ */ jsx24(
|
|
@@ -2436,7 +2440,7 @@ var ToolbarContainer = ({ children }) => {
|
|
|
2436
2440
|
{
|
|
2437
2441
|
"data-toolbar-container": "true",
|
|
2438
2442
|
"data-editor-toolbar": "true",
|
|
2439
|
-
className: "absolute top-0 left-0 right-0 mx-auto flex flex-row items-center w-fit justify-center h-[44px] py-2 shrink-0 px-1 border
|
|
2443
|
+
className: "absolute top-0 left-0 right-0 mx-auto m-2 flex flex-row items-center w-fit justify-center h-[44px] py-2 shrink-0 px-1 border bg-white dark:bg-black rounded-[12px] [@media(max-width:950px)]:static [@media(max-width:950px)]:mx-0 [@media(max-width:950px)]:m-0 [@media(max-width:950px)]:max-w-full [@media(max-width:950px)]:w-full [@media(max-width:950px)]:items-center [@media(max-width:950px)]:rounded-none [@media(max-width:950px)]:justify-start [@media(max-width:950px)]:shadow-none [@media(max-width:950px)]:border-0 [@media(max-width:950px)]:border-b",
|
|
2440
2444
|
style: { zIndex: 51 },
|
|
2441
2445
|
children
|
|
2442
2446
|
}
|
|
@@ -2451,14 +2455,20 @@ var ToolbarContent = ({ children }) => {
|
|
|
2451
2455
|
|
|
2452
2456
|
// src/core/editor/components/toolbar-ui/separator.tsx
|
|
2453
2457
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2454
|
-
var ToolbarSeparator = () => {
|
|
2455
|
-
return /* @__PURE__ */ jsx30("div", { className: "border-r h-[14px] pr-2 mr-2" });
|
|
2458
|
+
var ToolbarSeparator = ({ className }) => {
|
|
2459
|
+
return /* @__PURE__ */ jsx30("div", { className: cn("border-r h-[14px] pr-2 mr-2", className) });
|
|
2456
2460
|
};
|
|
2457
2461
|
|
|
2458
|
-
// src/core/editor/components/
|
|
2462
|
+
// src/core/editor/components/toolbar-ui/item.tsx
|
|
2459
2463
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2464
|
+
var ToolbarItem = ({ children, className }) => {
|
|
2465
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("", className), children });
|
|
2466
|
+
};
|
|
2467
|
+
|
|
2468
|
+
// src/core/editor/components/element-gear/plain-toolbar.tsx
|
|
2469
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2460
2470
|
var PlainToolbar = () => {
|
|
2461
|
-
return /* @__PURE__ */
|
|
2471
|
+
return /* @__PURE__ */ jsx32(ToolbarContainer, { children: /* @__PURE__ */ jsx32(ToolbarContent, { children: /* @__PURE__ */ jsx32(BasicOption, {}) }) });
|
|
2462
2472
|
};
|
|
2463
2473
|
|
|
2464
2474
|
// src/core/editor/components/element-gear/text/toolbar.tsx
|
|
@@ -2471,7 +2481,7 @@ import { TypeIcon } from "lucide-react";
|
|
|
2471
2481
|
// src/components/ui/slider.tsx
|
|
2472
2482
|
import * as React from "react";
|
|
2473
2483
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
2474
|
-
import { jsx as
|
|
2484
|
+
import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2475
2485
|
function Slider2({
|
|
2476
2486
|
className,
|
|
2477
2487
|
defaultValue,
|
|
@@ -2498,14 +2508,14 @@ function Slider2({
|
|
|
2498
2508
|
),
|
|
2499
2509
|
...props,
|
|
2500
2510
|
children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx33(
|
|
2502
2512
|
SliderPrimitive.Track,
|
|
2503
2513
|
{
|
|
2504
2514
|
"data-slot": "slider-track",
|
|
2505
2515
|
className: cn(
|
|
2506
2516
|
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
2507
2517
|
),
|
|
2508
|
-
children: /* @__PURE__ */
|
|
2518
|
+
children: /* @__PURE__ */ jsx33(
|
|
2509
2519
|
SliderPrimitive.Range,
|
|
2510
2520
|
{
|
|
2511
2521
|
"data-slot": "slider-range",
|
|
@@ -2516,7 +2526,7 @@ function Slider2({
|
|
|
2516
2526
|
)
|
|
2517
2527
|
}
|
|
2518
2528
|
),
|
|
2519
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
2529
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx33(
|
|
2520
2530
|
SliderPrimitive.Thumb,
|
|
2521
2531
|
{
|
|
2522
2532
|
"data-slot": "slider-thumb",
|
|
@@ -2531,7 +2541,7 @@ function Slider2({
|
|
|
2531
2541
|
|
|
2532
2542
|
// src/core/editor/components/paragraph-text-settings.tsx
|
|
2533
2543
|
import { useState as useState7, useEffect as useEffect3, useMemo as useMemo10, useCallback as useCallback11, memo as memo2 } from "react";
|
|
2534
|
-
import { jsx as
|
|
2544
|
+
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2535
2545
|
var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
2536
2546
|
const [isOpen, setIsOpen] = useState7(false);
|
|
2537
2547
|
const tiptapEditor = useEditorStore((s) => s.tiptapEditor);
|
|
@@ -2650,26 +2660,26 @@ var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
|
2650
2660
|
}, [applyLineHeight]);
|
|
2651
2661
|
return /* @__PURE__ */ jsxs26(Tooltip, { children: [
|
|
2652
2662
|
/* @__PURE__ */ jsxs26(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2653
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ jsx34(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
2654
2664
|
Button,
|
|
2655
2665
|
{
|
|
2656
2666
|
variant: "ghost",
|
|
2657
2667
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
|
|
2658
2668
|
size: "icon",
|
|
2659
2669
|
disabled: !tiptapEditor,
|
|
2660
|
-
children: /* @__PURE__ */
|
|
2670
|
+
children: /* @__PURE__ */ jsx34(TypeIcon, { className: "w-4 h-4" })
|
|
2661
2671
|
}
|
|
2662
2672
|
) }) }),
|
|
2663
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ jsx34(
|
|
2664
2674
|
PopoverContent,
|
|
2665
2675
|
{
|
|
2666
2676
|
className: "w-64 z-51 mt-1 rounded-[12px]",
|
|
2667
2677
|
"data-editor-toolbar": "true",
|
|
2668
2678
|
children: /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-4", children: [
|
|
2669
2679
|
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-3", children: [
|
|
2670
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsx34(Label, { children: "Letter spacing" }),
|
|
2671
2681
|
/* @__PURE__ */ jsxs26("div", { className: "flex flex-row items-center gap-2", children: [
|
|
2672
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsx34(
|
|
2673
2683
|
Slider2,
|
|
2674
2684
|
{
|
|
2675
2685
|
value: [currentLetterSpacing],
|
|
@@ -2680,7 +2690,7 @@ var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
|
2680
2690
|
disabled: !tiptapEditor
|
|
2681
2691
|
}
|
|
2682
2692
|
),
|
|
2683
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ jsx34(
|
|
2684
2694
|
Input,
|
|
2685
2695
|
{
|
|
2686
2696
|
type: "number",
|
|
@@ -2698,9 +2708,9 @@ var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
|
2698
2708
|
] })
|
|
2699
2709
|
] }),
|
|
2700
2710
|
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-3", children: [
|
|
2701
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ jsx34(Label, { children: "Line spacing" }),
|
|
2702
2712
|
/* @__PURE__ */ jsxs26("div", { className: "flex flex-row items-center gap-2", children: [
|
|
2703
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ jsx34(
|
|
2704
2714
|
Slider2,
|
|
2705
2715
|
{
|
|
2706
2716
|
value: [currentLineHeight],
|
|
@@ -2711,7 +2721,7 @@ var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
|
2711
2721
|
disabled: !tiptapEditor
|
|
2712
2722
|
}
|
|
2713
2723
|
),
|
|
2714
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsx34(
|
|
2715
2725
|
Input,
|
|
2716
2726
|
{
|
|
2717
2727
|
type: "number",
|
|
@@ -2733,13 +2743,13 @@ var ParagraphTextSettings = memo2(function ParagraphTextSettings2() {
|
|
|
2733
2743
|
}
|
|
2734
2744
|
)
|
|
2735
2745
|
] }),
|
|
2736
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ jsx34(TooltipContent, { side: "bottom", className: "z-51", children: "Text Settings" })
|
|
2737
2747
|
] });
|
|
2738
2748
|
});
|
|
2739
2749
|
|
|
2740
2750
|
// src/core/editor/components/font-family-dropdown.tsx
|
|
2741
2751
|
import { CheckIcon as CheckIcon3 } from "lucide-react";
|
|
2742
|
-
import { jsx as
|
|
2752
|
+
import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2743
2753
|
var FontFamilyDropdown = ({
|
|
2744
2754
|
currentFont,
|
|
2745
2755
|
onFontChange,
|
|
@@ -2747,7 +2757,7 @@ var FontFamilyDropdown = ({
|
|
|
2747
2757
|
}) => {
|
|
2748
2758
|
return /* @__PURE__ */ jsxs27(DropdownMenu, { modal: false, children: [
|
|
2749
2759
|
/* @__PURE__ */ jsxs27(Tooltip, { children: [
|
|
2750
|
-
/* @__PURE__ */
|
|
2760
|
+
/* @__PURE__ */ jsx35(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx35(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx35(
|
|
2751
2761
|
Button,
|
|
2752
2762
|
{
|
|
2753
2763
|
variant: "outline",
|
|
@@ -2756,9 +2766,9 @@ var FontFamilyDropdown = ({
|
|
|
2756
2766
|
children: currentFont
|
|
2757
2767
|
}
|
|
2758
2768
|
) }) }),
|
|
2759
|
-
/* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ jsx35(TooltipContent, { side: "bottom", children: "Font" })
|
|
2760
2770
|
] }),
|
|
2761
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx35(
|
|
2762
2772
|
DropdownMenuContent,
|
|
2763
2773
|
{
|
|
2764
2774
|
align: "start",
|
|
@@ -2772,7 +2782,7 @@ var FontFamilyDropdown = ({
|
|
|
2772
2782
|
style: { fontFamily: font },
|
|
2773
2783
|
children: [
|
|
2774
2784
|
font,
|
|
2775
|
-
currentFont === font && /* @__PURE__ */
|
|
2785
|
+
currentFont === font && /* @__PURE__ */ jsx35(CheckIcon3, { className: "w-4 h-4 ml-auto" })
|
|
2776
2786
|
]
|
|
2777
2787
|
},
|
|
2778
2788
|
font
|
|
@@ -2788,7 +2798,7 @@ import { useState as useState8, useEffect as useEffect4, useCallback as useCallb
|
|
|
2788
2798
|
// src/components/ui/button-group.tsx
|
|
2789
2799
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
2790
2800
|
import { cva } from "class-variance-authority";
|
|
2791
|
-
import { jsx as
|
|
2801
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2792
2802
|
var buttonGroupVariants = cva(
|
|
2793
2803
|
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
2794
2804
|
{
|
|
@@ -2808,7 +2818,7 @@ function ButtonGroup({
|
|
|
2808
2818
|
orientation,
|
|
2809
2819
|
...props
|
|
2810
2820
|
}) {
|
|
2811
|
-
return /* @__PURE__ */
|
|
2821
|
+
return /* @__PURE__ */ jsx36(
|
|
2812
2822
|
"div",
|
|
2813
2823
|
{
|
|
2814
2824
|
role: "group",
|
|
@@ -2825,7 +2835,7 @@ function ButtonGroupText({
|
|
|
2825
2835
|
...props
|
|
2826
2836
|
}) {
|
|
2827
2837
|
const Comp = asChild ? Slot2 : "div";
|
|
2828
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ jsx36(
|
|
2829
2839
|
Comp,
|
|
2830
2840
|
{
|
|
2831
2841
|
className: cn(
|
|
@@ -2839,9 +2849,9 @@ function ButtonGroupText({
|
|
|
2839
2849
|
|
|
2840
2850
|
// src/components/ui/input-group.tsx
|
|
2841
2851
|
import { cva as cva2 } from "class-variance-authority";
|
|
2842
|
-
import { jsx as
|
|
2852
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2843
2853
|
function InputGroup({ className, ...props }) {
|
|
2844
|
-
return /* @__PURE__ */
|
|
2854
|
+
return /* @__PURE__ */ jsx37(
|
|
2845
2855
|
"div",
|
|
2846
2856
|
{
|
|
2847
2857
|
"data-slot": "input-group",
|
|
@@ -2900,7 +2910,7 @@ function InputGroupInput({
|
|
|
2900
2910
|
className,
|
|
2901
2911
|
...props
|
|
2902
2912
|
}) {
|
|
2903
|
-
return /* @__PURE__ */
|
|
2913
|
+
return /* @__PURE__ */ jsx37(
|
|
2904
2914
|
Input,
|
|
2905
2915
|
{
|
|
2906
2916
|
"data-slot": "input-group-control",
|
|
@@ -2915,7 +2925,7 @@ function InputGroupInput({
|
|
|
2915
2925
|
|
|
2916
2926
|
// src/core/editor/components/font-size-control.tsx
|
|
2917
2927
|
import { CheckIcon as CheckIcon4, MinusIcon, PlusIcon } from "lucide-react";
|
|
2918
|
-
import { jsx as
|
|
2928
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2919
2929
|
var PRESET_FONT_SIZES = [6, 8, 10, 12, 14, 16, 18, 21, 24, 28, 32, 36, 48, 64, 72];
|
|
2920
2930
|
var FontSizeControl = memo3(function FontSizeControl2({
|
|
2921
2931
|
value,
|
|
@@ -2980,9 +2990,9 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
2980
2990
|
setInputValue(String(size));
|
|
2981
2991
|
setIsPopoverOpen(false);
|
|
2982
2992
|
}, [onChange]);
|
|
2983
|
-
return /* @__PURE__ */
|
|
2993
|
+
return /* @__PURE__ */ jsx38("div", { className: "grid w-full max-w-sm gap-6", children: /* @__PURE__ */ jsxs28(ButtonGroup, { children: [
|
|
2984
2994
|
/* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
2985
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
2986
2996
|
Button,
|
|
2987
2997
|
{
|
|
2988
2998
|
variant: "ghost",
|
|
@@ -2991,14 +3001,14 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
2991
3001
|
"aria-label": "Decrease Font Size",
|
|
2992
3002
|
onClick: handleDecrease,
|
|
2993
3003
|
disabled: disabled || value <= min,
|
|
2994
|
-
children: /* @__PURE__ */
|
|
3004
|
+
children: /* @__PURE__ */ jsx38(MinusIcon, {})
|
|
2995
3005
|
}
|
|
2996
3006
|
) }) }),
|
|
2997
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ jsx38(TooltipContent, { side: "bottom", children: "Decrease" })
|
|
2998
3008
|
] }),
|
|
2999
3009
|
/* @__PURE__ */ jsxs28(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
|
|
3000
3010
|
/* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
3001
|
-
/* @__PURE__ */
|
|
3011
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(InputGroup, { className: "shadow-none border-x-0", children: /* @__PURE__ */ jsx38(
|
|
3002
3012
|
InputGroupInput,
|
|
3003
3013
|
{
|
|
3004
3014
|
type: "number",
|
|
@@ -3014,16 +3024,16 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
3014
3024
|
disabled
|
|
3015
3025
|
}
|
|
3016
3026
|
) }) }) }),
|
|
3017
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx38(TooltipContent, { side: "bottom", children: "Font size" })
|
|
3018
3028
|
] }),
|
|
3019
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ jsx38(
|
|
3020
3030
|
PopoverContent,
|
|
3021
3031
|
{
|
|
3022
3032
|
className: "w-auto p-0 overflow-hidden z-50001 ",
|
|
3023
3033
|
align: "center",
|
|
3024
3034
|
side: "bottom",
|
|
3025
3035
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3026
|
-
children: /* @__PURE__ */
|
|
3036
|
+
children: /* @__PURE__ */ jsx38("div", { className: "flex flex-col min-w-[100px] text-start max-h-[400px] overflow-y-auto", children: PRESET_FONT_SIZES.map((size) => /* @__PURE__ */ jsxs28(
|
|
3027
3037
|
"button",
|
|
3028
3038
|
{
|
|
3029
3039
|
className: `flex items-center justify-between px-3 py-1 text-sm h-[38px] hover:bg-accent cursor-pointer text-start ${value === size ? "bg-accent font-medium" : ""}`,
|
|
@@ -3032,8 +3042,8 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
3032
3042
|
handlePresetSelect(size);
|
|
3033
3043
|
},
|
|
3034
3044
|
children: [
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
value === size && /* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx38("span", { className: "text-sm", children: size }),
|
|
3046
|
+
value === size && /* @__PURE__ */ jsx38(CheckIcon4, { className: "w-4 h-4" })
|
|
3037
3047
|
]
|
|
3038
3048
|
},
|
|
3039
3049
|
size
|
|
@@ -3042,7 +3052,7 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
3042
3052
|
)
|
|
3043
3053
|
] }),
|
|
3044
3054
|
/* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
3045
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
3046
3056
|
Button,
|
|
3047
3057
|
{
|
|
3048
3058
|
variant: "ghost",
|
|
@@ -3051,10 +3061,10 @@ var FontSizeControl = memo3(function FontSizeControl2({
|
|
|
3051
3061
|
"aria-label": "Increase Font Size",
|
|
3052
3062
|
onClick: handleIncrease,
|
|
3053
3063
|
disabled: disabled || value >= max,
|
|
3054
|
-
children: /* @__PURE__ */
|
|
3064
|
+
children: /* @__PURE__ */ jsx38(PlusIcon, {})
|
|
3055
3065
|
}
|
|
3056
3066
|
) }) }),
|
|
3057
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ jsx38(TooltipContent, { side: "bottom", children: "Increase" })
|
|
3058
3068
|
] })
|
|
3059
3069
|
] }) });
|
|
3060
3070
|
});
|
|
@@ -3065,7 +3075,7 @@ import { useCallback as useCallback15, useMemo as useMemo12 } from "react";
|
|
|
3065
3075
|
// src/core/editor/components/border-radius.tsx
|
|
3066
3076
|
import { useState as useState9, useEffect as useEffect5 } from "react";
|
|
3067
3077
|
import { SquareRoundCorner } from "lucide-react";
|
|
3068
|
-
import { jsx as
|
|
3078
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3069
3079
|
var BorderRadius = ({
|
|
3070
3080
|
value,
|
|
3071
3081
|
onChange,
|
|
@@ -3101,19 +3111,19 @@ var BorderRadius = ({
|
|
|
3101
3111
|
};
|
|
3102
3112
|
return /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
3103
3113
|
/* @__PURE__ */ jsxs29(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
3104
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx39(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx39(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx39(
|
|
3105
3115
|
Button,
|
|
3106
3116
|
{
|
|
3107
3117
|
variant: "ghost",
|
|
3108
3118
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
|
|
3109
3119
|
size: "icon",
|
|
3110
|
-
children: /* @__PURE__ */
|
|
3120
|
+
children: /* @__PURE__ */ jsx39(SquareRoundCorner, { className: "w-4 h-4" })
|
|
3111
3121
|
}
|
|
3112
3122
|
) }) }),
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ jsx39(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-3", children: [
|
|
3124
|
+
/* @__PURE__ */ jsx39(Label, { children: "Corner rounding" }),
|
|
3115
3125
|
/* @__PURE__ */ jsxs29("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3116
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsx39(
|
|
3117
3127
|
Slider2,
|
|
3118
3128
|
{
|
|
3119
3129
|
value: [value],
|
|
@@ -3123,7 +3133,7 @@ var BorderRadius = ({
|
|
|
3123
3133
|
step: 1
|
|
3124
3134
|
}
|
|
3125
3135
|
),
|
|
3126
|
-
/* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsx39(
|
|
3127
3137
|
Input,
|
|
3128
3138
|
{
|
|
3129
3139
|
type: "number",
|
|
@@ -3139,14 +3149,14 @@ var BorderRadius = ({
|
|
|
3139
3149
|
] })
|
|
3140
3150
|
] }) })
|
|
3141
3151
|
] }),
|
|
3142
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsx39(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
|
|
3143
3153
|
] });
|
|
3144
3154
|
};
|
|
3145
3155
|
|
|
3146
3156
|
// src/core/editor/components/stroke-weight.tsx
|
|
3147
3157
|
import { BanIcon, MinusIcon as MinusIcon2 } from "lucide-react";
|
|
3148
3158
|
import { useState as useState10, useEffect as useEffect6 } from "react";
|
|
3149
|
-
import { jsx as
|
|
3159
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3150
3160
|
var StrokeWeight = ({
|
|
3151
3161
|
width,
|
|
3152
3162
|
isEnabled,
|
|
@@ -3184,40 +3194,40 @@ var StrokeWeight = ({
|
|
|
3184
3194
|
};
|
|
3185
3195
|
return /* @__PURE__ */ jsxs30(Tooltip, { children: [
|
|
3186
3196
|
/* @__PURE__ */ jsxs30(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
3187
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsx40(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(
|
|
3188
3198
|
Button,
|
|
3189
3199
|
{
|
|
3190
3200
|
variant: "ghost",
|
|
3191
3201
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
|
|
3192
3202
|
size: "icon",
|
|
3193
|
-
children: /* @__PURE__ */
|
|
3203
|
+
children: /* @__PURE__ */ jsx40(MinusIcon2, { className: "w-4 h-4" })
|
|
3194
3204
|
}
|
|
3195
3205
|
) }) }),
|
|
3196
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ jsx40(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-3", children: [
|
|
3197
3207
|
/* @__PURE__ */ jsxs30("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3198
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx40(
|
|
3199
3209
|
Button,
|
|
3200
3210
|
{
|
|
3201
3211
|
variant: !isEnabled ? "default" : "outline",
|
|
3202
3212
|
className: "flex-1 cursor-pointer shadow-none rounded-[12px]",
|
|
3203
3213
|
onClick: () => onEnabledChange(false),
|
|
3204
|
-
children: /* @__PURE__ */
|
|
3214
|
+
children: /* @__PURE__ */ jsx40(BanIcon, { className: "w-4 h-4" })
|
|
3205
3215
|
}
|
|
3206
3216
|
),
|
|
3207
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx40(
|
|
3208
3218
|
Button,
|
|
3209
3219
|
{
|
|
3210
3220
|
variant: isEnabled ? "default" : "outline",
|
|
3211
3221
|
className: "flex-1 cursor-pointer shadow-none rounded-[12px]",
|
|
3212
3222
|
onClick: () => onEnabledChange(true),
|
|
3213
|
-
children: /* @__PURE__ */
|
|
3223
|
+
children: /* @__PURE__ */ jsx40(MinusIcon2, { className: "w-4 h-4" })
|
|
3214
3224
|
}
|
|
3215
3225
|
)
|
|
3216
3226
|
] }),
|
|
3217
3227
|
/* @__PURE__ */ jsxs30("div", { children: [
|
|
3218
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ jsx40(Label, { children: "Stroke weight" }),
|
|
3219
3229
|
/* @__PURE__ */ jsxs30("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3220
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ jsx40(
|
|
3221
3231
|
Slider2,
|
|
3222
3232
|
{
|
|
3223
3233
|
value: [width],
|
|
@@ -3227,7 +3237,7 @@ var StrokeWeight = ({
|
|
|
3227
3237
|
step: 1
|
|
3228
3238
|
}
|
|
3229
3239
|
),
|
|
3230
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx40(
|
|
3231
3241
|
Input,
|
|
3232
3242
|
{
|
|
3233
3243
|
type: "number",
|
|
@@ -3244,22 +3254,22 @@ var StrokeWeight = ({
|
|
|
3244
3254
|
] })
|
|
3245
3255
|
] }) })
|
|
3246
3256
|
] }),
|
|
3247
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ jsx40(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
|
|
3248
3258
|
] });
|
|
3249
3259
|
};
|
|
3250
3260
|
|
|
3251
3261
|
// src/components/ui/collapsible.tsx
|
|
3252
3262
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3253
|
-
import { jsx as
|
|
3263
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3254
3264
|
function Collapsible({
|
|
3255
3265
|
...props
|
|
3256
3266
|
}) {
|
|
3257
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ jsx41(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
3258
3268
|
}
|
|
3259
3269
|
function CollapsibleTrigger2({
|
|
3260
3270
|
...props
|
|
3261
3271
|
}) {
|
|
3262
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ jsx41(
|
|
3263
3273
|
CollapsiblePrimitive.CollapsibleTrigger,
|
|
3264
3274
|
{
|
|
3265
3275
|
"data-slot": "collapsible-trigger",
|
|
@@ -3270,7 +3280,7 @@ function CollapsibleTrigger2({
|
|
|
3270
3280
|
function CollapsibleContent2({
|
|
3271
3281
|
...props
|
|
3272
3282
|
}) {
|
|
3273
|
-
return /* @__PURE__ */
|
|
3283
|
+
return /* @__PURE__ */ jsx41(
|
|
3274
3284
|
CollapsiblePrimitive.CollapsibleContent,
|
|
3275
3285
|
{
|
|
3276
3286
|
"data-slot": "collapsible-content",
|
|
@@ -3398,7 +3408,7 @@ var usePadding = (options = {}) => {
|
|
|
3398
3408
|
};
|
|
3399
3409
|
|
|
3400
3410
|
// src/core/editor/components/better-padding.tsx
|
|
3401
|
-
import { jsx as
|
|
3411
|
+
import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3402
3412
|
var PADDING_MAX = 34;
|
|
3403
3413
|
var BetterPadding = ({
|
|
3404
3414
|
showPadding = true,
|
|
@@ -3423,17 +3433,17 @@ var BetterPadding = ({
|
|
|
3423
3433
|
const handleToggleText = useCallback14(() => handleToggle("text"), [handleToggle]);
|
|
3424
3434
|
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
3425
3435
|
/* @__PURE__ */ jsxs31(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
3426
|
-
/* @__PURE__ */
|
|
3436
|
+
/* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx42(
|
|
3427
3437
|
Button,
|
|
3428
3438
|
{
|
|
3429
3439
|
variant: "ghost",
|
|
3430
3440
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
|
|
3431
3441
|
size: "icon",
|
|
3432
|
-
children: /* @__PURE__ */
|
|
3442
|
+
children: /* @__PURE__ */ jsx42(SquareSquare, { className: "w-4 h-4" })
|
|
3433
3443
|
}
|
|
3434
3444
|
) }) }),
|
|
3435
3445
|
/* @__PURE__ */ jsxs31(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px] p-2 gap-2 flex flex-col z-50001", children: [
|
|
3436
|
-
showPadding && /* @__PURE__ */
|
|
3446
|
+
showPadding && /* @__PURE__ */ jsx42(
|
|
3437
3447
|
PaddingSectionUI,
|
|
3438
3448
|
{
|
|
3439
3449
|
label: "Padding",
|
|
@@ -3442,7 +3452,7 @@ var BetterPadding = ({
|
|
|
3442
3452
|
data: padding
|
|
3443
3453
|
}
|
|
3444
3454
|
),
|
|
3445
|
-
showInnerPadding && /* @__PURE__ */
|
|
3455
|
+
showInnerPadding && /* @__PURE__ */ jsx42(
|
|
3446
3456
|
PaddingSectionUI,
|
|
3447
3457
|
{
|
|
3448
3458
|
label: "Inner Padding",
|
|
@@ -3451,7 +3461,7 @@ var BetterPadding = ({
|
|
|
3451
3461
|
data: innerPadding
|
|
3452
3462
|
}
|
|
3453
3463
|
),
|
|
3454
|
-
showIconPadding && /* @__PURE__ */
|
|
3464
|
+
showIconPadding && /* @__PURE__ */ jsx42(
|
|
3455
3465
|
PaddingSectionUI,
|
|
3456
3466
|
{
|
|
3457
3467
|
label: "Icon Padding",
|
|
@@ -3460,7 +3470,7 @@ var BetterPadding = ({
|
|
|
3460
3470
|
data: iconPadding
|
|
3461
3471
|
}
|
|
3462
3472
|
),
|
|
3463
|
-
showTextPadding && /* @__PURE__ */
|
|
3473
|
+
showTextPadding && /* @__PURE__ */ jsx42(
|
|
3464
3474
|
PaddingSectionUI,
|
|
3465
3475
|
{
|
|
3466
3476
|
label: "Text Padding",
|
|
@@ -3471,7 +3481,7 @@ var BetterPadding = ({
|
|
|
3471
3481
|
)
|
|
3472
3482
|
] })
|
|
3473
3483
|
] }),
|
|
3474
|
-
/* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ jsx42(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
|
|
3475
3485
|
] });
|
|
3476
3486
|
};
|
|
3477
3487
|
var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
@@ -3575,13 +3585,13 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3575
3585
|
}
|
|
3576
3586
|
}, [leftInput, data]);
|
|
3577
3587
|
return /* @__PURE__ */ jsxs31(Collapsible, { open: isOpen, onOpenChange: onToggle, children: [
|
|
3578
|
-
/* @__PURE__ */
|
|
3579
|
-
/* @__PURE__ */
|
|
3580
|
-
/* @__PURE__ */
|
|
3588
|
+
/* @__PURE__ */ jsx42(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsx42(Button, { variant: "outline", className: "w-full shadow-none rounded-[12px]", children: /* @__PURE__ */ jsxs31("div", { className: "w-full flex flex-row items-center justify-between gap-2", children: [
|
|
3589
|
+
/* @__PURE__ */ jsx42("p", { children: label }),
|
|
3590
|
+
/* @__PURE__ */ jsx42(ChevronDownIcon3, { className: `w-4 h-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}` })
|
|
3581
3591
|
] }) }) }),
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
/* @__PURE__ */
|
|
3584
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ jsx42(CollapsibleContent2, { className: "w-full", children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col", children: [
|
|
3593
|
+
/* @__PURE__ */ jsx42("div", { className: "p-2", children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3594
|
+
/* @__PURE__ */ jsx42(
|
|
3585
3595
|
Slider2,
|
|
3586
3596
|
{
|
|
3587
3597
|
value: [sliderValue],
|
|
@@ -3591,7 +3601,7 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3591
3601
|
step: 1
|
|
3592
3602
|
}
|
|
3593
3603
|
),
|
|
3594
|
-
/* @__PURE__ */
|
|
3604
|
+
/* @__PURE__ */ jsx42(
|
|
3595
3605
|
Input,
|
|
3596
3606
|
{
|
|
3597
3607
|
type: "number",
|
|
@@ -3608,8 +3618,8 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3608
3618
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-4 p-2", children: [
|
|
3609
3619
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3610
3620
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3611
|
-
/* @__PURE__ */
|
|
3612
|
-
/* @__PURE__ */
|
|
3621
|
+
/* @__PURE__ */ jsx42(PanelTopDashedIcon, { size: 18, className: "text-muted-foreground" }),
|
|
3622
|
+
/* @__PURE__ */ jsx42(
|
|
3613
3623
|
Input,
|
|
3614
3624
|
{
|
|
3615
3625
|
type: "number",
|
|
@@ -3624,8 +3634,8 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3624
3634
|
)
|
|
3625
3635
|
] }),
|
|
3626
3636
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3627
|
-
/* @__PURE__ */
|
|
3628
|
-
/* @__PURE__ */
|
|
3637
|
+
/* @__PURE__ */ jsx42(PanelBottomDashedIcon, { size: 18, className: "text-muted-foreground" }),
|
|
3638
|
+
/* @__PURE__ */ jsx42(
|
|
3629
3639
|
Input,
|
|
3630
3640
|
{
|
|
3631
3641
|
type: "number",
|
|
@@ -3642,8 +3652,8 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3642
3652
|
] }),
|
|
3643
3653
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3644
3654
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3645
|
-
/* @__PURE__ */
|
|
3646
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx42(PanelLeftDashedIcon, { size: 18, className: "text-muted-foreground" }),
|
|
3656
|
+
/* @__PURE__ */ jsx42(
|
|
3647
3657
|
Input,
|
|
3648
3658
|
{
|
|
3649
3659
|
type: "number",
|
|
@@ -3658,8 +3668,8 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
|
|
|
3658
3668
|
)
|
|
3659
3669
|
] }),
|
|
3660
3670
|
/* @__PURE__ */ jsxs31("div", { className: "flex flex-row items-center gap-2", children: [
|
|
3661
|
-
/* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3671
|
+
/* @__PURE__ */ jsx42(PanelRightDashedIcon, { size: 18, className: "text-muted-foreground" }),
|
|
3672
|
+
/* @__PURE__ */ jsx42(
|
|
3663
3673
|
Input,
|
|
3664
3674
|
{
|
|
3665
3675
|
type: "number",
|
|
@@ -3691,22 +3701,22 @@ var formatBorderRadius = (value) => {
|
|
|
3691
3701
|
};
|
|
3692
3702
|
|
|
3693
3703
|
// src/core/editor/components/background-color-btn.tsx
|
|
3694
|
-
import { jsx as
|
|
3704
|
+
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3695
3705
|
var BackgroundColorBtn = ({ activeView, colorTarget, handleOpenBgColorPicker, currentBgColor }) => {
|
|
3696
3706
|
return /* @__PURE__ */ jsxs32(Tooltip, { children: [
|
|
3697
|
-
/* @__PURE__ */
|
|
3707
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(
|
|
3698
3708
|
Button,
|
|
3699
3709
|
{
|
|
3700
3710
|
variant: "ghost",
|
|
3701
3711
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${activeView === "color" && (colorTarget === "sectionBgColor" || colorTarget === "propertyBgColor") ? "bg-muted" : ""}`,
|
|
3702
3712
|
size: "icon",
|
|
3703
3713
|
onClick: handleOpenBgColorPicker,
|
|
3704
|
-
children: /* @__PURE__ */
|
|
3714
|
+
children: /* @__PURE__ */ jsx43(
|
|
3705
3715
|
"div",
|
|
3706
3716
|
{
|
|
3707
3717
|
className: "w-6 h-6 rounded-full border flex items-center justify-center overflow-hidden",
|
|
3708
3718
|
style: { backgroundColor: currentBgColor || "transparent" },
|
|
3709
|
-
children: currentBgColor === "transparent" ? /* @__PURE__ */
|
|
3719
|
+
children: currentBgColor === "transparent" ? /* @__PURE__ */ jsx43(
|
|
3710
3720
|
"img",
|
|
3711
3721
|
{
|
|
3712
3722
|
src: "https://mzyngaqmbvhpgmmipndy.supabase.co/storage/v1/object/public/Maillow/icons/transparent-visual.svg",
|
|
@@ -3720,12 +3730,12 @@ var BackgroundColorBtn = ({ activeView, colorTarget, handleOpenBgColorPicker, cu
|
|
|
3720
3730
|
)
|
|
3721
3731
|
}
|
|
3722
3732
|
) }),
|
|
3723
|
-
/* @__PURE__ */
|
|
3733
|
+
/* @__PURE__ */ jsx43(TooltipContent, { side: "bottom", className: "z-51", children: "Background Color" })
|
|
3724
3734
|
] });
|
|
3725
3735
|
};
|
|
3726
3736
|
|
|
3727
3737
|
// src/core/editor/components/element-gear/column-styles.tsx
|
|
3728
|
-
import { Fragment as Fragment3, jsx as
|
|
3738
|
+
import { Fragment as Fragment3, jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3729
3739
|
var ColumnStyles = () => {
|
|
3730
3740
|
const { focusIdx, template, updateElement } = useEditorStore();
|
|
3731
3741
|
const { activeView, colorTarget, setActiveView, setColorType, setColorTarget } = useSidebarContext();
|
|
@@ -3806,7 +3816,7 @@ var ColumnStyles = () => {
|
|
|
3806
3816
|
updatePadding({ top: value, right: value, bottom: value, left: value });
|
|
3807
3817
|
}, [updatePadding]);
|
|
3808
3818
|
return /* @__PURE__ */ jsxs33(Fragment3, { children: [
|
|
3809
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ jsx44(ToolbarContent, { children: /* @__PURE__ */ jsx44(
|
|
3810
3820
|
BackgroundColorBtn,
|
|
3811
3821
|
{
|
|
3812
3822
|
activeView,
|
|
@@ -3815,29 +3825,29 @@ var ColumnStyles = () => {
|
|
|
3815
3825
|
currentBgColor: currentBgColor || "transparent"
|
|
3816
3826
|
}
|
|
3817
3827
|
) }),
|
|
3818
|
-
/* @__PURE__ */
|
|
3828
|
+
/* @__PURE__ */ jsx44(ToolbarSeparator, {}),
|
|
3819
3829
|
/* @__PURE__ */ jsxs33(ToolbarContent, { children: [
|
|
3820
3830
|
border.width > 0 && /* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
3821
|
-
/* @__PURE__ */
|
|
3831
|
+
/* @__PURE__ */ jsx44(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx44(
|
|
3822
3832
|
Button,
|
|
3823
3833
|
{
|
|
3824
3834
|
variant: "ghost",
|
|
3825
3835
|
className: `shadow-none transition-none cursor-pointer rounded-[12px] ${activeView === "color" && colorTarget === "columnStrokeColor" ? "bg-muted" : ""}`,
|
|
3826
3836
|
size: "icon",
|
|
3827
3837
|
onClick: handleOpenStrokeColorPicker,
|
|
3828
|
-
children: /* @__PURE__ */
|
|
3838
|
+
children: /* @__PURE__ */ jsx44(
|
|
3829
3839
|
"div",
|
|
3830
3840
|
{
|
|
3831
3841
|
className: "w-5 h-5 rounded-full border justify-center items-center flex",
|
|
3832
3842
|
style: { backgroundColor: border.color },
|
|
3833
|
-
children: /* @__PURE__ */
|
|
3843
|
+
children: /* @__PURE__ */ jsx44("div", { className: "w-[50%] h-[50%] bg-secondary rounded-full" })
|
|
3834
3844
|
}
|
|
3835
3845
|
)
|
|
3836
3846
|
}
|
|
3837
3847
|
) }),
|
|
3838
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ jsx44(TooltipContent, { side: "bottom", className: "z-51", children: "Column Stroke Color" })
|
|
3839
3849
|
] }),
|
|
3840
|
-
/* @__PURE__ */
|
|
3850
|
+
/* @__PURE__ */ jsx44(
|
|
3841
3851
|
StrokeWeight,
|
|
3842
3852
|
{
|
|
3843
3853
|
width: border.width,
|
|
@@ -3847,7 +3857,7 @@ var ColumnStyles = () => {
|
|
|
3847
3857
|
tooltipText: "Column Stroke Width"
|
|
3848
3858
|
}
|
|
3849
3859
|
),
|
|
3850
|
-
/* @__PURE__ */
|
|
3860
|
+
/* @__PURE__ */ jsx44(
|
|
3851
3861
|
BorderRadius,
|
|
3852
3862
|
{
|
|
3853
3863
|
value: borderRadiusValue,
|
|
@@ -3855,7 +3865,7 @@ var ColumnStyles = () => {
|
|
|
3855
3865
|
tooltipText: "Column Border Radius"
|
|
3856
3866
|
}
|
|
3857
3867
|
),
|
|
3858
|
-
/* @__PURE__ */
|
|
3868
|
+
/* @__PURE__ */ jsx44(BetterPadding, { targetIdx: columnIdx, tooltipText: "Column Padding" })
|
|
3859
3869
|
] })
|
|
3860
3870
|
] });
|
|
3861
3871
|
};
|
|
@@ -3867,12 +3877,6 @@ var parseFontSize = (value) => {
|
|
|
3867
3877
|
return isNaN(parsed) ? DEFAULT_FONT_SIZE : parsed;
|
|
3868
3878
|
};
|
|
3869
3879
|
|
|
3870
|
-
// src/core/editor/components/toolbar-ui/overflow-container.tsx
|
|
3871
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
3872
|
-
var ToolbarOverflowContainer = ({ children }) => {
|
|
3873
|
-
return /* @__PURE__ */ jsx44("div", { className: "absolute right-0 -bottom-13 bg-white p-1 rounded-[12px] shadow-lg border ", children });
|
|
3874
|
-
};
|
|
3875
|
-
|
|
3876
3880
|
// src/core/editor/components/element-gear/text/toolbar.tsx
|
|
3877
3881
|
import { Fragment as Fragment4, jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3878
3882
|
var ALIGNMENTS = ["left", "center", "right", "justify"];
|
|
@@ -3895,8 +3899,8 @@ var TextToolbar = () => {
|
|
|
3895
3899
|
const textEditingStyles = useEditorStore((s) => s.textEditing?.styles);
|
|
3896
3900
|
const template = useEditorStore((s) => s.template);
|
|
3897
3901
|
const { activeView, colorTarget, setActiveView, setColorType, setColorTarget } = useSidebarContext();
|
|
3898
|
-
const [isOverflowOpen, setIsOverflowOpen] = useState12(false);
|
|
3899
3902
|
const [updateCounter, forceUpdate] = useState12(0);
|
|
3903
|
+
const [overflowOpen, setOverflowOpen] = useState12(false);
|
|
3900
3904
|
const isInSectionColumn = useMemo13(() => {
|
|
3901
3905
|
if (!focusIdx || !template) return false;
|
|
3902
3906
|
const columnIdx = getParentIdx(focusIdx);
|
|
@@ -4068,204 +4072,479 @@ var TextToolbar = () => {
|
|
|
4068
4072
|
const CurrentIcon = currentTypeConfig.Icon;
|
|
4069
4073
|
return /* @__PURE__ */ jsxs34(ToolbarContainer, { children: [
|
|
4070
4074
|
/* @__PURE__ */ jsx45(ToolbarContent, { children: /* @__PURE__ */ jsx45(BasicOption, {}) }),
|
|
4071
|
-
/* @__PURE__ */ jsx45(ToolbarSeparator, {}),
|
|
4072
|
-
|
|
4073
|
-
/* @__PURE__ */ jsx45(
|
|
4074
|
-
|
|
4075
|
+
/* @__PURE__ */ jsx45(ToolbarSeparator, { className: "hidden [@media(min-width:650px)]:block" }),
|
|
4076
|
+
/* @__PURE__ */ jsxs34(ToolbarContent, { children: [
|
|
4077
|
+
/* @__PURE__ */ jsx45(
|
|
4078
|
+
TextTypeItem,
|
|
4079
|
+
{
|
|
4080
|
+
isResponsive: true,
|
|
4081
|
+
isInSectionColumn,
|
|
4082
|
+
tiptapEditor,
|
|
4083
|
+
handleSetType,
|
|
4084
|
+
activeType,
|
|
4085
|
+
CurrentIcon
|
|
4086
|
+
}
|
|
4087
|
+
),
|
|
4088
|
+
/* @__PURE__ */ jsx45(
|
|
4089
|
+
FontFamilyDropdownItem,
|
|
4090
|
+
{
|
|
4091
|
+
isResponsive: true,
|
|
4092
|
+
isInSectionColumn,
|
|
4093
|
+
tiptapEditor,
|
|
4094
|
+
handleSetFontFamily,
|
|
4095
|
+
currentFontFamily
|
|
4096
|
+
}
|
|
4097
|
+
),
|
|
4098
|
+
/* @__PURE__ */ jsx45(
|
|
4099
|
+
FontSizeControlItem,
|
|
4100
|
+
{
|
|
4101
|
+
isResponsive: true,
|
|
4102
|
+
isInSectionColumn,
|
|
4103
|
+
tiptapEditor,
|
|
4104
|
+
handleFontSizeChange,
|
|
4105
|
+
currentFontSize
|
|
4106
|
+
}
|
|
4107
|
+
)
|
|
4075
4108
|
] }),
|
|
4109
|
+
/* @__PURE__ */ jsx45(ToolbarSeparator, { className: "hidden [@media(min-width:880px)]:block" }),
|
|
4076
4110
|
/* @__PURE__ */ jsxs34(ToolbarContent, { children: [
|
|
4077
|
-
/* @__PURE__ */ jsxs34(DropdownMenu, { modal: false, children: [
|
|
4078
|
-
/* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4079
|
-
Button,
|
|
4080
|
-
{
|
|
4081
|
-
variant: "outline",
|
|
4082
|
-
size: "icon",
|
|
4083
|
-
className: "shadow-none transition-none cursor-pointer rounded-[12px] gap-1",
|
|
4084
|
-
disabled: !tiptapEditor,
|
|
4085
|
-
children: /* @__PURE__ */ jsx45(CurrentIcon, { className: "w-4 h-4" })
|
|
4086
|
-
}
|
|
4087
|
-
) }),
|
|
4088
|
-
/* @__PURE__ */ jsx45(
|
|
4089
|
-
DropdownMenuContent,
|
|
4090
|
-
{
|
|
4091
|
-
align: "start",
|
|
4092
|
-
className: "z-51",
|
|
4093
|
-
"data-editor-toolbar": "true",
|
|
4094
|
-
children: TEXT_TYPE_OPTIONS.map(({ type, label, Icon: Icon2, disabled }) => /* @__PURE__ */ jsxs34(
|
|
4095
|
-
DropdownMenuItem,
|
|
4096
|
-
{
|
|
4097
|
-
onClick: () => handleSetType(type),
|
|
4098
|
-
className: "gap-2",
|
|
4099
|
-
disabled,
|
|
4100
|
-
children: [
|
|
4101
|
-
/* @__PURE__ */ jsx45(Icon2, { className: "w-4 h-4" }),
|
|
4102
|
-
label,
|
|
4103
|
-
activeType === type && /* @__PURE__ */ jsx45(CheckIcon5, { className: "w-4 h-4 ml-auto" })
|
|
4104
|
-
]
|
|
4105
|
-
},
|
|
4106
|
-
type
|
|
4107
|
-
))
|
|
4108
|
-
}
|
|
4109
|
-
)
|
|
4110
|
-
] }),
|
|
4111
4111
|
/* @__PURE__ */ jsx45(
|
|
4112
|
-
|
|
4112
|
+
TextColorItem,
|
|
4113
4113
|
{
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4114
|
+
isResponsive: true,
|
|
4115
|
+
isInSectionColumn,
|
|
4116
|
+
tiptapEditor,
|
|
4117
|
+
handleOpenTextColorPicker,
|
|
4118
|
+
currentTextColor,
|
|
4119
|
+
activeView,
|
|
4120
|
+
colorTarget: colorTarget || "textColor"
|
|
4117
4121
|
}
|
|
4118
4122
|
),
|
|
4119
4123
|
/* @__PURE__ */ jsx45(
|
|
4120
|
-
|
|
4124
|
+
HighlightColorItem,
|
|
4121
4125
|
{
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4126
|
+
isResponsive: true,
|
|
4127
|
+
isInSectionColumn,
|
|
4128
|
+
tiptapEditor,
|
|
4129
|
+
handleOpenHighlightColorPicker,
|
|
4130
|
+
currentHighlightColor,
|
|
4131
|
+
activeView,
|
|
4132
|
+
colorTarget: colorTarget || "highlightColor"
|
|
4125
4133
|
}
|
|
4126
4134
|
),
|
|
4127
|
-
/* @__PURE__ */ jsx45(
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4135
|
+
/* @__PURE__ */ jsx45(
|
|
4136
|
+
BoldItem,
|
|
4137
|
+
{
|
|
4138
|
+
isResponsive: true,
|
|
4139
|
+
isInSectionColumn,
|
|
4140
|
+
tiptapEditor,
|
|
4141
|
+
handleToggleBold,
|
|
4142
|
+
isBoldActive
|
|
4143
|
+
}
|
|
4144
|
+
),
|
|
4145
|
+
/* @__PURE__ */ jsx45(
|
|
4146
|
+
ItalicItem,
|
|
4147
|
+
{
|
|
4148
|
+
isResponsive: true,
|
|
4149
|
+
isInSectionColumn,
|
|
4150
|
+
tiptapEditor,
|
|
4151
|
+
handleToggleItalic,
|
|
4152
|
+
isItalicActive
|
|
4153
|
+
}
|
|
4154
|
+
),
|
|
4155
|
+
/* @__PURE__ */ jsx45(
|
|
4156
|
+
UnderlineItem,
|
|
4157
|
+
{
|
|
4158
|
+
isResponsive: true,
|
|
4159
|
+
isInSectionColumn,
|
|
4160
|
+
tiptapEditor,
|
|
4161
|
+
handleToggleUnderline,
|
|
4162
|
+
isUnderlineActive
|
|
4163
|
+
}
|
|
4164
|
+
),
|
|
4165
|
+
/* @__PURE__ */ jsx45(
|
|
4166
|
+
StrikethroughItem,
|
|
4167
|
+
{
|
|
4168
|
+
isResponsive: true,
|
|
4169
|
+
isInSectionColumn,
|
|
4170
|
+
tiptapEditor,
|
|
4171
|
+
handleToggleStrike,
|
|
4172
|
+
isStrikeActive
|
|
4173
|
+
}
|
|
4174
|
+
),
|
|
4175
|
+
/* @__PURE__ */ jsx45(
|
|
4176
|
+
TextAlignmentItem,
|
|
4177
|
+
{
|
|
4178
|
+
isResponsive: true,
|
|
4179
|
+
isInSectionColumn,
|
|
4180
|
+
handleCycleAlignment,
|
|
4181
|
+
currentAlignment,
|
|
4182
|
+
tiptapEditor
|
|
4183
|
+
}
|
|
4184
|
+
),
|
|
4185
|
+
/* @__PURE__ */ jsx45(
|
|
4186
|
+
ParagraphTextSettingsItem,
|
|
4187
|
+
{
|
|
4188
|
+
isResponsive: true,
|
|
4189
|
+
isInSectionColumn
|
|
4190
|
+
}
|
|
4191
|
+
)
|
|
4192
|
+
] }),
|
|
4193
|
+
/* @__PURE__ */ jsx45(ToolbarSeparator, { className: isInSectionColumn ? "" : "[@media(min-width:1400px)]:hidden" }),
|
|
4194
|
+
/* @__PURE__ */ jsx45(ToolbarContent, { children: /* @__PURE__ */ jsx45(ToolbarItem, { className: isInSectionColumn ? "" : "[@media(min-width:1400px)]:hidden", children: /* @__PURE__ */ jsxs34(Popover, { open: overflowOpen, onOpenChange: (open) => {
|
|
4195
|
+
if (open) setOverflowOpen(true);
|
|
4196
|
+
}, children: [
|
|
4197
|
+
/* @__PURE__ */ jsx45(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4198
|
+
Button,
|
|
4199
|
+
{
|
|
4200
|
+
variant: "ghost",
|
|
4201
|
+
className: `shadow-none transition-none cursor-pointer ${overflowOpen ? "bg-accent" : ""}`,
|
|
4202
|
+
size: "icon",
|
|
4203
|
+
onClick: () => setOverflowOpen((prev) => !prev),
|
|
4204
|
+
children: /* @__PURE__ */ jsx45(EllipsisIcon, {})
|
|
4205
|
+
}
|
|
4206
|
+
) }),
|
|
4207
|
+
/* @__PURE__ */ jsxs34(
|
|
4208
|
+
PopoverContent,
|
|
4209
|
+
{
|
|
4210
|
+
align: "center",
|
|
4211
|
+
side: "bottom",
|
|
4212
|
+
className: "z-51 p-1 shadow-sm mt-1 rounded-[12px] w-auto min-w-0 flex flex-row items-center justify-center gap-1",
|
|
4213
|
+
"data-editor-toolbar": "true",
|
|
4214
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
4215
|
+
onFocusOutside: (e) => e.preventDefault(),
|
|
4216
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
4217
|
+
children: [
|
|
4218
|
+
/* @__PURE__ */ jsxs34(ToolbarContent, { children: [
|
|
4139
4219
|
/* @__PURE__ */ jsx45(
|
|
4140
|
-
|
|
4220
|
+
TextTypeItem,
|
|
4141
4221
|
{
|
|
4142
|
-
|
|
4143
|
-
|
|
4222
|
+
isResponsive: false,
|
|
4223
|
+
isInSectionColumn,
|
|
4224
|
+
tiptapEditor,
|
|
4225
|
+
handleSetType,
|
|
4226
|
+
activeType,
|
|
4227
|
+
CurrentIcon
|
|
4228
|
+
}
|
|
4229
|
+
),
|
|
4230
|
+
/* @__PURE__ */ jsx45(
|
|
4231
|
+
FontFamilyDropdownItem,
|
|
4232
|
+
{
|
|
4233
|
+
isResponsive: false,
|
|
4234
|
+
isInSectionColumn,
|
|
4235
|
+
tiptapEditor,
|
|
4236
|
+
handleSetFontFamily,
|
|
4237
|
+
currentFontFamily
|
|
4238
|
+
}
|
|
4239
|
+
),
|
|
4240
|
+
/* @__PURE__ */ jsx45(
|
|
4241
|
+
FontSizeControlItem,
|
|
4242
|
+
{
|
|
4243
|
+
isResponsive: false,
|
|
4244
|
+
isInSectionColumn,
|
|
4245
|
+
tiptapEditor,
|
|
4246
|
+
handleFontSizeChange,
|
|
4247
|
+
currentFontSize
|
|
4144
4248
|
}
|
|
4145
4249
|
)
|
|
4146
|
-
]
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
Button,
|
|
4154
|
-
{
|
|
4155
|
-
variant: "ghost",
|
|
4156
|
-
className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "highlightColor" ? "bg-muted" : ""}`,
|
|
4157
|
-
size: "icon",
|
|
4158
|
-
disabled: !tiptapEditor,
|
|
4159
|
-
onClick: handleOpenHighlightColorPicker,
|
|
4160
|
-
children: [
|
|
4161
|
-
/* @__PURE__ */ jsx45(HighlighterIcon, {}),
|
|
4250
|
+
] }),
|
|
4251
|
+
/* @__PURE__ */ jsx45(ToolbarSeparator, { className: " [@media(min-width:830px)]:hidden" }),
|
|
4252
|
+
/* @__PURE__ */ jsxs34(ToolbarContent, { children: [
|
|
4253
|
+
isInSectionColumn && /* @__PURE__ */ jsxs34(Fragment4, { children: [
|
|
4254
|
+
/* @__PURE__ */ jsx45(ColumnStyles, {}),
|
|
4255
|
+
/* @__PURE__ */ jsx45(ToolbarSeparator, { className: "[@media(min-width:1400px)]:hidden" })
|
|
4256
|
+
] }),
|
|
4162
4257
|
/* @__PURE__ */ jsx45(
|
|
4163
|
-
|
|
4258
|
+
TextColorItem,
|
|
4164
4259
|
{
|
|
4165
|
-
|
|
4166
|
-
|
|
4260
|
+
isResponsive: false,
|
|
4261
|
+
isInSectionColumn,
|
|
4262
|
+
tiptapEditor,
|
|
4263
|
+
handleOpenTextColorPicker,
|
|
4264
|
+
currentTextColor,
|
|
4265
|
+
activeView,
|
|
4266
|
+
colorTarget: colorTarget || "textColor"
|
|
4267
|
+
}
|
|
4268
|
+
),
|
|
4269
|
+
/* @__PURE__ */ jsx45(
|
|
4270
|
+
HighlightColorItem,
|
|
4271
|
+
{
|
|
4272
|
+
isResponsive: false,
|
|
4273
|
+
isInSectionColumn,
|
|
4274
|
+
tiptapEditor,
|
|
4275
|
+
handleOpenHighlightColorPicker,
|
|
4276
|
+
currentHighlightColor,
|
|
4277
|
+
activeView,
|
|
4278
|
+
colorTarget: colorTarget || "highlightColor"
|
|
4279
|
+
}
|
|
4280
|
+
),
|
|
4281
|
+
/* @__PURE__ */ jsx45(
|
|
4282
|
+
BoldItem,
|
|
4283
|
+
{
|
|
4284
|
+
isResponsive: false,
|
|
4285
|
+
isInSectionColumn,
|
|
4286
|
+
tiptapEditor,
|
|
4287
|
+
handleToggleBold,
|
|
4288
|
+
isBoldActive
|
|
4289
|
+
}
|
|
4290
|
+
),
|
|
4291
|
+
/* @__PURE__ */ jsx45(
|
|
4292
|
+
ItalicItem,
|
|
4293
|
+
{
|
|
4294
|
+
isResponsive: false,
|
|
4295
|
+
isInSectionColumn,
|
|
4296
|
+
tiptapEditor,
|
|
4297
|
+
handleToggleItalic,
|
|
4298
|
+
isItalicActive
|
|
4299
|
+
}
|
|
4300
|
+
),
|
|
4301
|
+
/* @__PURE__ */ jsx45(
|
|
4302
|
+
UnderlineItem,
|
|
4303
|
+
{
|
|
4304
|
+
isResponsive: false,
|
|
4305
|
+
isInSectionColumn,
|
|
4306
|
+
tiptapEditor,
|
|
4307
|
+
handleToggleUnderline,
|
|
4308
|
+
isUnderlineActive
|
|
4309
|
+
}
|
|
4310
|
+
),
|
|
4311
|
+
/* @__PURE__ */ jsx45(
|
|
4312
|
+
StrikethroughItem,
|
|
4313
|
+
{
|
|
4314
|
+
isResponsive: false,
|
|
4315
|
+
isInSectionColumn,
|
|
4316
|
+
tiptapEditor,
|
|
4317
|
+
handleToggleStrike,
|
|
4318
|
+
isStrikeActive
|
|
4319
|
+
}
|
|
4320
|
+
),
|
|
4321
|
+
/* @__PURE__ */ jsx45(
|
|
4322
|
+
TextAlignmentItem,
|
|
4323
|
+
{
|
|
4324
|
+
isResponsive: false,
|
|
4325
|
+
isInSectionColumn,
|
|
4326
|
+
handleCycleAlignment,
|
|
4327
|
+
currentAlignment,
|
|
4328
|
+
tiptapEditor
|
|
4329
|
+
}
|
|
4330
|
+
),
|
|
4331
|
+
/* @__PURE__ */ jsx45(
|
|
4332
|
+
ParagraphTextSettingsItem,
|
|
4333
|
+
{
|
|
4334
|
+
isResponsive: false,
|
|
4335
|
+
isInSectionColumn
|
|
4167
4336
|
}
|
|
4168
4337
|
)
|
|
4169
|
-
]
|
|
4170
|
-
|
|
4171
|
-
) }),
|
|
4172
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Highlight Color" })
|
|
4173
|
-
] }),
|
|
4174
|
-
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4175
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4176
|
-
Button,
|
|
4177
|
-
{
|
|
4178
|
-
variant: "ghost",
|
|
4179
|
-
className: `shadow-none transition-none cursor-pointer ${isBoldActive ? "bg-accent" : ""}`,
|
|
4180
|
-
size: "icon",
|
|
4181
|
-
onClick: handleToggleBold,
|
|
4182
|
-
disabled: !tiptapEditor,
|
|
4183
|
-
children: /* @__PURE__ */ jsx45(BoldIcon, {})
|
|
4184
|
-
}
|
|
4185
|
-
) }),
|
|
4186
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Bold" })
|
|
4187
|
-
] }),
|
|
4188
|
-
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4189
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4190
|
-
Button,
|
|
4191
|
-
{
|
|
4192
|
-
variant: "ghost",
|
|
4193
|
-
className: `shadow-none transition-none cursor-pointer ${isItalicActive ? "bg-accent" : ""}`,
|
|
4194
|
-
size: "icon",
|
|
4195
|
-
onClick: handleToggleItalic,
|
|
4196
|
-
disabled: !tiptapEditor,
|
|
4197
|
-
children: /* @__PURE__ */ jsx45(ItalicIcon, {})
|
|
4198
|
-
}
|
|
4199
|
-
) }),
|
|
4200
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Italic" })
|
|
4201
|
-
] }),
|
|
4202
|
-
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4203
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4204
|
-
Button,
|
|
4205
|
-
{
|
|
4206
|
-
variant: "ghost",
|
|
4207
|
-
className: `shadow-none transition-none cursor-pointer ${isUnderlineActive ? "bg-accent" : ""}`,
|
|
4208
|
-
size: "icon",
|
|
4209
|
-
onClick: handleToggleUnderline,
|
|
4210
|
-
disabled: !tiptapEditor,
|
|
4211
|
-
children: /* @__PURE__ */ jsx45(Underline, {})
|
|
4212
|
-
}
|
|
4213
|
-
) }),
|
|
4214
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Underline" })
|
|
4215
|
-
] }),
|
|
4216
|
-
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4217
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4218
|
-
Button,
|
|
4219
|
-
{
|
|
4220
|
-
variant: "ghost",
|
|
4221
|
-
className: `shadow-none transition-none cursor-pointer ${isStrikeActive ? "bg-accent" : ""}`,
|
|
4222
|
-
size: "icon",
|
|
4223
|
-
onClick: handleToggleStrike,
|
|
4224
|
-
disabled: !tiptapEditor,
|
|
4225
|
-
children: /* @__PURE__ */ jsx45(Strikethrough, {})
|
|
4226
|
-
}
|
|
4227
|
-
) }),
|
|
4228
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Strikethrough" })
|
|
4229
|
-
] }),
|
|
4230
|
-
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4231
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4232
|
-
Button,
|
|
4233
|
-
{
|
|
4234
|
-
variant: "ghost",
|
|
4235
|
-
className: "shadow-none transition-none cursor-pointer",
|
|
4236
|
-
size: "icon",
|
|
4237
|
-
onClick: handleCycleAlignment,
|
|
4238
|
-
disabled: !tiptapEditor,
|
|
4239
|
-
children: (() => {
|
|
4240
|
-
const AlignIcon = TEXT_ALIGNMENT_ICONS[currentAlignment];
|
|
4241
|
-
return /* @__PURE__ */ jsx45(AlignIcon, {});
|
|
4242
|
-
})()
|
|
4243
|
-
}
|
|
4244
|
-
) }),
|
|
4245
|
-
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Alignment" })
|
|
4246
|
-
] }),
|
|
4247
|
-
/* @__PURE__ */ jsx45(ParagraphTextSettings, {})
|
|
4248
|
-
] }),
|
|
4249
|
-
/* @__PURE__ */ jsx45(ToolbarSeparator, {}),
|
|
4250
|
-
/* @__PURE__ */ jsx45(ToolbarContent, { children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4251
|
-
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4252
|
-
Button,
|
|
4253
|
-
{
|
|
4254
|
-
variant: "ghost",
|
|
4255
|
-
className: "shadow-none transition-none cursor-pointer",
|
|
4256
|
-
size: "icon",
|
|
4257
|
-
onClick: () => setIsOverflowOpen(!isOverflowOpen),
|
|
4258
|
-
children: /* @__PURE__ */ jsx45(EllipsisIcon, {})
|
|
4338
|
+
] })
|
|
4339
|
+
]
|
|
4259
4340
|
}
|
|
4260
|
-
)
|
|
4261
|
-
|
|
4262
|
-
] }) }),
|
|
4263
|
-
isOverflowOpen && /* @__PURE__ */ jsx45(ToolbarOverflowContainer, { children: /* @__PURE__ */ jsxs34(ToolbarContent, { children: [
|
|
4264
|
-
/* @__PURE__ */ jsx45(Button, { variant: "ghost", size: "icon", className: "shadow-none transition-none cursor-pointer", children: /* @__PURE__ */ jsx45(BoldIcon, {}) }),
|
|
4265
|
-
/* @__PURE__ */ jsx45(Button, { variant: "ghost", size: "icon", className: "shadow-none transition-none cursor-pointer", children: /* @__PURE__ */ jsx45(BoldIcon, {}) })
|
|
4266
|
-
] }) })
|
|
4341
|
+
)
|
|
4342
|
+
] }) }) })
|
|
4267
4343
|
] });
|
|
4268
4344
|
};
|
|
4345
|
+
var ParagraphTextSettingsItem = ({ isResponsive, isInSectionColumn }) => {
|
|
4346
|
+
const className = isResponsive ? isInSectionColumn ? "hidden [@media(min-width:1400px)]:block" : "hidden [@media(min-width:1400px)]:block" : isInSectionColumn ? "[@media(min-width:1400px)]:hidden" : "[@media(min-width:1400px)]:hidden";
|
|
4347
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsx45(ParagraphTextSettings, {}) });
|
|
4348
|
+
};
|
|
4349
|
+
var TextAlignmentItem = ({ isResponsive, isInSectionColumn, handleCycleAlignment, currentAlignment, tiptapEditor }) => {
|
|
4350
|
+
const className = isResponsive ? "hidden [@media(min-width:1350px)]:block" : "[@media(min-width:1350px)]:hidden";
|
|
4351
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4352
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4353
|
+
Button,
|
|
4354
|
+
{
|
|
4355
|
+
variant: "ghost",
|
|
4356
|
+
className: "shadow-none transition-none cursor-pointer",
|
|
4357
|
+
size: "icon",
|
|
4358
|
+
onClick: handleCycleAlignment,
|
|
4359
|
+
disabled: !tiptapEditor,
|
|
4360
|
+
children: (() => {
|
|
4361
|
+
const AlignIcon = TEXT_ALIGNMENT_ICONS[currentAlignment];
|
|
4362
|
+
return /* @__PURE__ */ jsx45(AlignIcon, {});
|
|
4363
|
+
})()
|
|
4364
|
+
}
|
|
4365
|
+
) }),
|
|
4366
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Alignment" })
|
|
4367
|
+
] }) });
|
|
4368
|
+
};
|
|
4369
|
+
var StrikethroughItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleStrike, isStrikeActive }) => {
|
|
4370
|
+
const className = isResponsive ? "hidden [@media(min-width:1250px)]:block" : "[@media(min-width:1250px)]:hidden";
|
|
4371
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4372
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4373
|
+
Button,
|
|
4374
|
+
{
|
|
4375
|
+
variant: "ghost",
|
|
4376
|
+
className: `shadow-none transition-none cursor-pointer ${isStrikeActive ? "bg-accent" : ""}`,
|
|
4377
|
+
size: "icon",
|
|
4378
|
+
onClick: handleToggleStrike,
|
|
4379
|
+
disabled: !tiptapEditor,
|
|
4380
|
+
children: /* @__PURE__ */ jsx45(Strikethrough, {})
|
|
4381
|
+
}
|
|
4382
|
+
) }),
|
|
4383
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Strikethrough" })
|
|
4384
|
+
] }) });
|
|
4385
|
+
};
|
|
4386
|
+
var UnderlineItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleUnderline, isUnderlineActive }) => {
|
|
4387
|
+
const className = isResponsive ? "hidden [@media(min-width:1150px)]:block" : "[@media(min-width:1150px)]:hidden";
|
|
4388
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4389
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4390
|
+
Button,
|
|
4391
|
+
{
|
|
4392
|
+
variant: "ghost",
|
|
4393
|
+
className: `shadow-none transition-none cursor-pointer ${isUnderlineActive ? "bg-accent" : ""}`,
|
|
4394
|
+
size: "icon",
|
|
4395
|
+
onClick: handleToggleUnderline,
|
|
4396
|
+
disabled: !tiptapEditor,
|
|
4397
|
+
children: /* @__PURE__ */ jsx45(Underline, {})
|
|
4398
|
+
}
|
|
4399
|
+
) }),
|
|
4400
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Underline" })
|
|
4401
|
+
] }) });
|
|
4402
|
+
};
|
|
4403
|
+
var ItalicItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleItalic, isItalicActive }) => {
|
|
4404
|
+
const className = isResponsive ? "hidden [@media(min-width:1050px)]:block" : "[@media(min-width:1050px)]:hidden";
|
|
4405
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4406
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4407
|
+
Button,
|
|
4408
|
+
{
|
|
4409
|
+
variant: "ghost",
|
|
4410
|
+
className: `shadow-none transition-none cursor-pointer ${isItalicActive ? "bg-accent" : ""}`,
|
|
4411
|
+
size: "icon",
|
|
4412
|
+
onClick: handleToggleItalic,
|
|
4413
|
+
disabled: !tiptapEditor,
|
|
4414
|
+
children: /* @__PURE__ */ jsx45(ItalicIcon, {})
|
|
4415
|
+
}
|
|
4416
|
+
) }),
|
|
4417
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Italic" })
|
|
4418
|
+
] }) });
|
|
4419
|
+
};
|
|
4420
|
+
var BoldItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleBold, isBoldActive }) => {
|
|
4421
|
+
const className = isResponsive ? "hidden [@media(min-width:975px)]:block" : "[@media(min-width:975px)]:hidden";
|
|
4422
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4423
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4424
|
+
Button,
|
|
4425
|
+
{
|
|
4426
|
+
variant: "ghost",
|
|
4427
|
+
className: `shadow-none transition-none cursor-pointer ${isBoldActive ? "bg-accent" : ""}`,
|
|
4428
|
+
size: "icon",
|
|
4429
|
+
onClick: handleToggleBold,
|
|
4430
|
+
disabled: !tiptapEditor,
|
|
4431
|
+
children: /* @__PURE__ */ jsx45(BoldIcon, {})
|
|
4432
|
+
}
|
|
4433
|
+
) }),
|
|
4434
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Bold" })
|
|
4435
|
+
] }) });
|
|
4436
|
+
};
|
|
4437
|
+
var HighlightColorItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleOpenHighlightColorPicker, currentHighlightColor, activeView, colorTarget }) => {
|
|
4438
|
+
const className = isResponsive ? "hidden [@media(min-width:930px)]:block" : "[@media(min-width:930px)]:hidden";
|
|
4439
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4440
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34(
|
|
4441
|
+
Button,
|
|
4442
|
+
{
|
|
4443
|
+
variant: "ghost",
|
|
4444
|
+
className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "highlightColor" ? "bg-muted" : ""}`,
|
|
4445
|
+
size: "icon",
|
|
4446
|
+
disabled: !tiptapEditor,
|
|
4447
|
+
onClick: handleOpenHighlightColorPicker,
|
|
4448
|
+
children: [
|
|
4449
|
+
/* @__PURE__ */ jsx45(HighlighterIcon, {}),
|
|
4450
|
+
/* @__PURE__ */ jsx45(
|
|
4451
|
+
"span",
|
|
4452
|
+
{
|
|
4453
|
+
className: "w-[14px] h-[3px] rounded-full",
|
|
4454
|
+
style: { backgroundColor: currentHighlightColor === "transparent" ? "#FFFFFF" : currentHighlightColor }
|
|
4455
|
+
}
|
|
4456
|
+
)
|
|
4457
|
+
]
|
|
4458
|
+
}
|
|
4459
|
+
) }),
|
|
4460
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Highlight Color" })
|
|
4461
|
+
] }) });
|
|
4462
|
+
};
|
|
4463
|
+
var TextColorItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleOpenTextColorPicker, currentTextColor, activeView, colorTarget }) => {
|
|
4464
|
+
const className = isResponsive ? "hidden [@media(min-width:880px)]:block" : "[@media(min-width:880px)]:hidden";
|
|
4465
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
4466
|
+
/* @__PURE__ */ jsx45(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34(
|
|
4467
|
+
Button,
|
|
4468
|
+
{
|
|
4469
|
+
variant: "ghost",
|
|
4470
|
+
className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "textColor" ? "bg-muted" : ""}`,
|
|
4471
|
+
size: "icon",
|
|
4472
|
+
disabled: !tiptapEditor,
|
|
4473
|
+
onClick: handleOpenTextColorPicker,
|
|
4474
|
+
children: [
|
|
4475
|
+
/* @__PURE__ */ jsx45(CaseUpperIcon, {}),
|
|
4476
|
+
/* @__PURE__ */ jsx45(
|
|
4477
|
+
"span",
|
|
4478
|
+
{
|
|
4479
|
+
className: "w-[14px] h-[3px] rounded-full",
|
|
4480
|
+
style: { backgroundColor: currentTextColor }
|
|
4481
|
+
}
|
|
4482
|
+
)
|
|
4483
|
+
]
|
|
4484
|
+
}
|
|
4485
|
+
) }),
|
|
4486
|
+
/* @__PURE__ */ jsx45(TooltipContent, { side: "bottom", className: "z-51", children: "Text Color" })
|
|
4487
|
+
] }) });
|
|
4488
|
+
};
|
|
4489
|
+
var FontSizeControlItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleFontSizeChange, currentFontSize }) => {
|
|
4490
|
+
const className = isResponsive ? "hidden [@media(min-width:830px)]:block" : "[@media(min-width:830px)]:hidden";
|
|
4491
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsx45(
|
|
4492
|
+
FontSizeControl,
|
|
4493
|
+
{
|
|
4494
|
+
value: currentFontSize,
|
|
4495
|
+
onChange: handleFontSizeChange,
|
|
4496
|
+
disabled: !tiptapEditor
|
|
4497
|
+
}
|
|
4498
|
+
) });
|
|
4499
|
+
};
|
|
4500
|
+
var FontFamilyDropdownItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleSetFontFamily, currentFontFamily }) => {
|
|
4501
|
+
const className = isResponsive ? "hidden [@media(min-width:710px)]:block" : "[@media(min-width:710px)]:hidden";
|
|
4502
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsx45(
|
|
4503
|
+
FontFamilyDropdown,
|
|
4504
|
+
{
|
|
4505
|
+
currentFont: currentFontFamily,
|
|
4506
|
+
onFontChange: handleSetFontFamily,
|
|
4507
|
+
disabled: !tiptapEditor
|
|
4508
|
+
}
|
|
4509
|
+
) });
|
|
4510
|
+
};
|
|
4511
|
+
var TextTypeItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleSetType, activeType, CurrentIcon }) => {
|
|
4512
|
+
const className = isResponsive ? "hidden [@media(min-width:650px)]:block" : "[@media(min-width:650px)]:hidden";
|
|
4513
|
+
return /* @__PURE__ */ jsx45(ToolbarItem, { className, children: /* @__PURE__ */ jsxs34(DropdownMenu, { modal: false, children: [
|
|
4514
|
+
/* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4515
|
+
Button,
|
|
4516
|
+
{
|
|
4517
|
+
variant: "outline",
|
|
4518
|
+
size: "icon",
|
|
4519
|
+
className: "shadow-none transition-none cursor-pointer rounded-[12px] gap-1",
|
|
4520
|
+
disabled: !tiptapEditor,
|
|
4521
|
+
children: /* @__PURE__ */ jsx45(CurrentIcon, { className: "w-4 h-4" })
|
|
4522
|
+
}
|
|
4523
|
+
) }),
|
|
4524
|
+
/* @__PURE__ */ jsx45(
|
|
4525
|
+
DropdownMenuContent,
|
|
4526
|
+
{
|
|
4527
|
+
align: "start",
|
|
4528
|
+
className: "z-51",
|
|
4529
|
+
"data-editor-toolbar": "true",
|
|
4530
|
+
children: TEXT_TYPE_OPTIONS.map(({ type, label, Icon: Icon2, disabled }) => /* @__PURE__ */ jsxs34(
|
|
4531
|
+
DropdownMenuItem,
|
|
4532
|
+
{
|
|
4533
|
+
onClick: () => handleSetType(type),
|
|
4534
|
+
className: "gap-2",
|
|
4535
|
+
disabled,
|
|
4536
|
+
children: [
|
|
4537
|
+
/* @__PURE__ */ jsx45(Icon2, { className: "w-4 h-4" }),
|
|
4538
|
+
label,
|
|
4539
|
+
activeType === type && /* @__PURE__ */ jsx45(CheckIcon5, { className: "w-4 h-4 ml-auto" })
|
|
4540
|
+
]
|
|
4541
|
+
},
|
|
4542
|
+
type
|
|
4543
|
+
))
|
|
4544
|
+
}
|
|
4545
|
+
)
|
|
4546
|
+
] }) });
|
|
4547
|
+
};
|
|
4269
4548
|
|
|
4270
4549
|
// src/core/editor/components/element-gear/button/toolbar.tsx
|
|
4271
4550
|
import { useCallback as useCallback21, useMemo as useMemo18 } from "react";
|
|
@@ -8192,10 +8471,10 @@ var PropertyTripleItemToolbar = () => {
|
|
|
8192
8471
|
// src/core/editor/components/email-template-v2/toolbar/toolbar.tsx
|
|
8193
8472
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
8194
8473
|
function Toolbar() {
|
|
8195
|
-
const
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
if (
|
|
8474
|
+
const elementType = useEditorStore(
|
|
8475
|
+
(s) => s.focusIdx ? getValueByIdx(s.template, s.focusIdx)?.type : null
|
|
8476
|
+
);
|
|
8477
|
+
if (!elementType) {
|
|
8199
8478
|
return;
|
|
8200
8479
|
}
|
|
8201
8480
|
if (elementType === "text") {
|
|
@@ -8298,7 +8577,7 @@ function useAutoSave() {
|
|
|
8298
8577
|
// src/core/editor/components/email-template-v2/template-page.tsx
|
|
8299
8578
|
import "react-json-view-lite/dist/index.css";
|
|
8300
8579
|
import { jsx as jsx69, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
8301
|
-
var Editor2 = lazy(() => import("./core-
|
|
8580
|
+
var Editor2 = lazy(() => import("./core-66YYN7ME.mjs").then((module) => ({
|
|
8302
8581
|
default: module.Editor
|
|
8303
8582
|
})));
|
|
8304
8583
|
function TemplatePage({
|
|
@@ -8306,25 +8585,19 @@ function TemplatePage({
|
|
|
8306
8585
|
initialTemplate,
|
|
8307
8586
|
onSave,
|
|
8308
8587
|
onToast,
|
|
8309
|
-
|
|
8588
|
+
onExit,
|
|
8589
|
+
data
|
|
8310
8590
|
}) {
|
|
8311
|
-
console.log("Template page rendered!");
|
|
8312
|
-
if (isPaidLevel > MAX_PAID_LEVEL) {
|
|
8313
|
-
console.warn("This paid level is invalid:", isPaidLevel);
|
|
8314
|
-
} else {
|
|
8315
|
-
console.log("This paid level is valid:", isPaidLevel);
|
|
8316
|
-
}
|
|
8317
8591
|
useState20(() => {
|
|
8318
|
-
useEditorStore.getState().initializeWithTemplate(templateId, initialTemplate, onSave, onToast,
|
|
8592
|
+
useEditorStore.getState().initializeWithTemplate(templateId, initialTemplate, onSave, onToast, data, onExit);
|
|
8319
8593
|
});
|
|
8320
8594
|
useAutoSave();
|
|
8321
8595
|
const [editorLoading, setEditorLoading] = useState20(false);
|
|
8322
8596
|
const [isPageHovered, setIsPageHovered] = useState20(false);
|
|
8323
|
-
const template = useEditorStore((state) => state.template);
|
|
8324
8597
|
const previewMode = useEditorStore((state) => state.previewMode);
|
|
8325
8598
|
const focusIdx = useEditorStore((state) => state.focusIdx);
|
|
8326
8599
|
const setFocusIdx = useEditorStore((state) => state.setFocusIdx);
|
|
8327
|
-
const canvasBackgroundColor = template?.content?.[0]?.attributes?.["background-color"] || "#ffffff";
|
|
8600
|
+
const canvasBackgroundColor = useEditorStore((s) => s.template?.content?.[0]?.attributes?.["background-color"]) || "#ffffff";
|
|
8328
8601
|
const handlePageClick = (e) => {
|
|
8329
8602
|
if (!previewMode && e.target === e.currentTarget) {
|
|
8330
8603
|
setFocusIdx("content");
|
|
@@ -8345,7 +8618,7 @@ function TemplatePage({
|
|
|
8345
8618
|
{
|
|
8346
8619
|
className: "flex flex-col bg-background overflow-hidden",
|
|
8347
8620
|
children: [
|
|
8348
|
-
/* @__PURE__ */ jsx69(TemplateHeader, {
|
|
8621
|
+
/* @__PURE__ */ jsx69(TemplateHeader, {}),
|
|
8349
8622
|
/* @__PURE__ */ jsxs54("div", { className: "flex flex-row h-full bg-background", children: [
|
|
8350
8623
|
/* @__PURE__ */ jsx69(TemplateSidebar, { editorLoading }),
|
|
8351
8624
|
/* @__PURE__ */ jsxs54("div", { className: "flex flex-col w-full overflow-hidden h-[calc(100vh-60px)] bg-background relative", children: [
|
|
@@ -8356,7 +8629,7 @@ function TemplatePage({
|
|
|
8356
8629
|
"div",
|
|
8357
8630
|
{
|
|
8358
8631
|
className: cn(
|
|
8359
|
-
"min-h-[calc(70vh)] h-fit rounded-[12px] max-w-[626px] w-[626px] pb-0 pt-5 mt-24 mb-4 email-page-preview cursor-pointer",
|
|
8632
|
+
"min-h-[calc(70vh)] h-fit rounded-[12px] max-w-[626px] w-[626px] pb-0 pt-5 mt-24 mb-4 email-page-preview cursor-pointer [@media(max-width:950px)]:w-full [@media(max-width:950px)]:max-w-full [@media(max-width:950px)]:min-h-screen [@media(max-width:950px)]:rounded-none [@media(max-width:950px)]:mt-0 [@media(max-width:950px)]:mb-0",
|
|
8360
8633
|
focusIdx === "content" && "outline outline-2 outline-blue-500",
|
|
8361
8634
|
isPageHovered && focusIdx !== "content" && "outline outline-2 outline-blue-300"
|
|
8362
8635
|
),
|