@delmaredigital/payload-puck 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/dist/AccordionClient.d.mts +1 -1
- package/dist/AccordionClient.d.ts +1 -1
- package/dist/AccordionClient.js +2 -2
- package/dist/AccordionClient.js.map +1 -1
- package/dist/AccordionClient.mjs +2 -2
- package/dist/AccordionClient.mjs.map +1 -1
- package/dist/AnimatedWrapper.d.mts +1 -1
- package/dist/AnimatedWrapper.d.ts +1 -1
- package/dist/AnimatedWrapper.js.map +1 -1
- package/dist/AnimatedWrapper.mjs.map +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +196 -217
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +200 -221
- package/dist/components/index.mjs.map +1 -1
- package/dist/config/config.editor.d.mts +1 -1
- package/dist/config/config.editor.d.ts +1 -1
- package/dist/config/config.editor.js +199 -220
- package/dist/config/config.editor.js.map +1 -1
- package/dist/config/config.editor.mjs +203 -224
- package/dist/config/config.editor.mjs.map +1 -1
- package/dist/config/index.js +33 -16
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.mjs +33 -16
- package/dist/config/index.mjs.map +1 -1
- package/dist/editor/index.js +56 -39
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/index.mjs +56 -39
- package/dist/editor/index.mjs.map +1 -1
- package/dist/fields/index.d.mts +4 -4
- package/dist/fields/index.d.ts +4 -4
- package/dist/fields/index.js +201 -222
- package/dist/fields/index.js.map +1 -1
- package/dist/fields/index.mjs +205 -226
- package/dist/fields/index.mjs.map +1 -1
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/index.mjs.map +1 -1
- package/dist/render/index.js +33 -16
- package/dist/render/index.js.map +1 -1
- package/dist/render/index.mjs +33 -16
- package/dist/render/index.mjs.map +1 -1
- package/dist/{shared-DMAF1AcH.d.mts → shared-DeNKN95N.d.mts} +7 -6
- package/dist/{shared-DMAF1AcH.d.ts → shared-DeNKN95N.d.ts} +7 -6
- package/examples/README.md +9 -2
- package/examples/app/(manage)/layout.tsx +31 -0
- package/package.json +12 -10
package/dist/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var React6 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
7
|
var reactSlot = require('@radix-ui/react-slot');
|
|
8
8
|
var classVarianceAuthority = require('class-variance-authority');
|
|
9
9
|
var clsx = require('clsx');
|
|
@@ -548,7 +548,7 @@ function transformValueToCSS(transform) {
|
|
|
548
548
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
549
549
|
}
|
|
550
550
|
var BREAKPOINTS = [
|
|
551
|
-
{ key: "
|
|
551
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
552
552
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
553
553
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
554
554
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -556,7 +556,7 @@ var BREAKPOINTS = [
|
|
|
556
556
|
];
|
|
557
557
|
function isResponsiveValue(value) {
|
|
558
558
|
if (!value || typeof value !== "object") return false;
|
|
559
|
-
return "
|
|
559
|
+
return "xs" in value;
|
|
560
560
|
}
|
|
561
561
|
function camelToKebab(str) {
|
|
562
562
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -582,7 +582,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
582
582
|
if (bpValue === void 0) return;
|
|
583
583
|
const cssProps = converter(bpValue);
|
|
584
584
|
if (!cssProps) return;
|
|
585
|
-
if (bp.key === "
|
|
585
|
+
if (bp.key === "xs") {
|
|
586
586
|
baseStyles = cssProps;
|
|
587
587
|
} else {
|
|
588
588
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -596,29 +596,50 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
596
596
|
return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
|
|
597
597
|
}
|
|
598
598
|
var DEFAULT_VISIBILITY = {
|
|
599
|
-
|
|
599
|
+
xs: true,
|
|
600
|
+
sm: true,
|
|
601
|
+
md: true,
|
|
602
|
+
lg: true,
|
|
603
|
+
xl: true
|
|
600
604
|
};
|
|
601
605
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
602
606
|
if (!visibility) return "";
|
|
603
607
|
const mediaQueries = [];
|
|
604
|
-
|
|
605
|
-
|
|
608
|
+
const breakpointWidths = {
|
|
609
|
+
xs: null,
|
|
610
|
+
// 0px
|
|
611
|
+
sm: 640,
|
|
612
|
+
md: 768,
|
|
613
|
+
lg: 1024,
|
|
614
|
+
xl: 1280
|
|
615
|
+
};
|
|
616
|
+
const getNextBreakpointWidth = (bp) => {
|
|
617
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
618
|
+
const index = order.indexOf(bp);
|
|
619
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
620
|
+
return breakpointWidths[order[index + 1]];
|
|
621
|
+
};
|
|
622
|
+
if (visibility.xs === false) {
|
|
623
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
624
|
+
if (nextWidth) {
|
|
625
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
626
|
+
} else {
|
|
627
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
628
|
+
}
|
|
606
629
|
}
|
|
607
|
-
let lastVisibility = visibility.base;
|
|
608
630
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
if (
|
|
631
|
+
if (visibility[bp.key] === false) {
|
|
632
|
+
const minWidth = breakpointWidths[bp.key];
|
|
633
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
634
|
+
if (minWidth && maxWidth) {
|
|
613
635
|
mediaQueries.push(
|
|
614
|
-
`@media (min-width: ${
|
|
636
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
615
637
|
);
|
|
616
|
-
} else {
|
|
638
|
+
} else if (minWidth) {
|
|
617
639
|
mediaQueries.push(
|
|
618
|
-
`@media (min-width: ${
|
|
640
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
619
641
|
);
|
|
620
642
|
}
|
|
621
|
-
lastVisibility = bpValue;
|
|
622
643
|
}
|
|
623
644
|
});
|
|
624
645
|
return mediaQueries.join("\n");
|
|
@@ -1228,7 +1249,7 @@ function PaddingFieldInner({
|
|
|
1228
1249
|
isLinked ? "" : "text-muted-foreground"
|
|
1229
1250
|
),
|
|
1230
1251
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
1231
|
-
children: isLinked ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1252
|
+
children: isLinked ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Unlink, { className: "h-4 w-4" })
|
|
1232
1253
|
}
|
|
1233
1254
|
)
|
|
1234
1255
|
] }),
|
|
@@ -1472,7 +1493,7 @@ function ColorPickerFieldInner({
|
|
|
1472
1493
|
onClick: handleClear,
|
|
1473
1494
|
title: "Clear color",
|
|
1474
1495
|
className: "flex items-center justify-center w-8 h-8 rounded border-none bg-transparent cursor-pointer text-muted-foreground flex-shrink-0 hover:bg-accent hover:text-destructive",
|
|
1475
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1496
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
|
|
1476
1497
|
}
|
|
1477
1498
|
)
|
|
1478
1499
|
] }),
|
|
@@ -1584,7 +1605,7 @@ var SelectTrigger = React6__namespace.forwardRef(({ className, children, ...prop
|
|
|
1584
1605
|
...props,
|
|
1585
1606
|
children: [
|
|
1586
1607
|
children,
|
|
1587
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1608
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
1588
1609
|
]
|
|
1589
1610
|
}
|
|
1590
1611
|
));
|
|
@@ -1598,7 +1619,7 @@ var SelectScrollUpButton = React6__namespace.forwardRef(({ className, ...props }
|
|
|
1598
1619
|
className
|
|
1599
1620
|
),
|
|
1600
1621
|
...props,
|
|
1601
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1622
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
|
|
1602
1623
|
}
|
|
1603
1624
|
));
|
|
1604
1625
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
@@ -1611,7 +1632,7 @@ var SelectScrollDownButton = React6__namespace.forwardRef(({ className, ...props
|
|
|
1611
1632
|
className
|
|
1612
1633
|
),
|
|
1613
1634
|
...props,
|
|
1614
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1635
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
|
|
1615
1636
|
}
|
|
1616
1637
|
));
|
|
1617
1638
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
@@ -1662,7 +1683,7 @@ var SelectItem = React6__namespace.forwardRef(({ className, children, ...props }
|
|
|
1662
1683
|
),
|
|
1663
1684
|
...props,
|
|
1664
1685
|
children: [
|
|
1665
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1686
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
1666
1687
|
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
1667
1688
|
]
|
|
1668
1689
|
}
|
|
@@ -1754,7 +1775,7 @@ function BorderFieldInner({
|
|
|
1754
1775
|
onClick: handleClear,
|
|
1755
1776
|
className: "text-muted-foreground hover:text-destructive",
|
|
1756
1777
|
title: "Clear border",
|
|
1757
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1778
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
1758
1779
|
}
|
|
1759
1780
|
)
|
|
1760
1781
|
] }),
|
|
@@ -1857,7 +1878,7 @@ function BorderFieldInner({
|
|
|
1857
1878
|
currentValue.sides.top && "bg-primary hover:bg-primary/90"
|
|
1858
1879
|
),
|
|
1859
1880
|
title: "Top border",
|
|
1860
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1881
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-4 w-4" })
|
|
1861
1882
|
}
|
|
1862
1883
|
),
|
|
1863
1884
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1872,7 +1893,7 @@ function BorderFieldInner({
|
|
|
1872
1893
|
currentValue.sides.right && "bg-primary hover:bg-primary/90"
|
|
1873
1894
|
),
|
|
1874
1895
|
title: "Right border",
|
|
1875
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1896
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "h-4 w-4" })
|
|
1876
1897
|
}
|
|
1877
1898
|
),
|
|
1878
1899
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1887,7 +1908,7 @@ function BorderFieldInner({
|
|
|
1887
1908
|
currentValue.sides.bottom && "bg-primary hover:bg-primary/90"
|
|
1888
1909
|
),
|
|
1889
1910
|
title: "Bottom border",
|
|
1890
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1911
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-4 w-4" })
|
|
1891
1912
|
}
|
|
1892
1913
|
),
|
|
1893
1914
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1902,7 +1923,7 @@ function BorderFieldInner({
|
|
|
1902
1923
|
currentValue.sides.left && "bg-primary hover:bg-primary/90"
|
|
1903
1924
|
),
|
|
1904
1925
|
title: "Left border",
|
|
1905
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1926
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "h-4 w-4" })
|
|
1906
1927
|
}
|
|
1907
1928
|
)
|
|
1908
1929
|
] }),
|
|
@@ -2190,14 +2211,14 @@ function DimensionsFieldInner({
|
|
|
2190
2211
|
});
|
|
2191
2212
|
}, [advancedMode, currentValue, onChange]);
|
|
2192
2213
|
const modeConfig = [
|
|
2193
|
-
{ mode: "full", icon:
|
|
2194
|
-
{ mode: "contained", icon:
|
|
2195
|
-
{ mode: "custom", icon:
|
|
2214
|
+
{ mode: "full", icon: lucideReact.MoveHorizontal, label: "Full", title: "Full width (100%)" },
|
|
2215
|
+
{ mode: "contained", icon: lucideReact.Square, label: "Contain", title: "Contained (centered with max-width)" },
|
|
2216
|
+
{ mode: "custom", icon: lucideReact.SlidersHorizontal, label: "Custom", title: "Custom width settings" }
|
|
2196
2217
|
];
|
|
2197
2218
|
const alignmentConfig = [
|
|
2198
|
-
{ alignment: "left", icon:
|
|
2199
|
-
{ alignment: "center", icon:
|
|
2200
|
-
{ alignment: "right", icon:
|
|
2219
|
+
{ alignment: "left", icon: lucideReact.AlignStartHorizontal, title: "Align left" },
|
|
2220
|
+
{ alignment: "center", icon: lucideReact.AlignCenterHorizontal, title: "Align center" },
|
|
2221
|
+
{ alignment: "right", icon: lucideReact.AlignEndHorizontal, title: "Align right" }
|
|
2201
2222
|
];
|
|
2202
2223
|
const showWidthControls = currentValue.mode !== "full";
|
|
2203
2224
|
showHeightControls && (advancedMode || currentValue.minHeight?.enabled || currentValue.maxHeight?.enabled);
|
|
@@ -2213,7 +2234,7 @@ function DimensionsFieldInner({
|
|
|
2213
2234
|
onClick: handleClear,
|
|
2214
2235
|
className: "text-muted-foreground hover:text-destructive",
|
|
2215
2236
|
title: "Reset to default",
|
|
2216
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2237
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
2217
2238
|
}
|
|
2218
2239
|
)
|
|
2219
2240
|
] }),
|
|
@@ -2416,10 +2437,10 @@ function DimensionsFieldInner({
|
|
|
2416
2437
|
disabled: readOnly,
|
|
2417
2438
|
className: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
2418
2439
|
children: advancedMode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2419
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2440
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-3.5 w-3.5 mr-1" }),
|
|
2420
2441
|
"Hide Advanced"
|
|
2421
2442
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2422
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2443
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3.5 w-3.5 mr-1" }),
|
|
2423
2444
|
"Show Advanced"
|
|
2424
2445
|
] })
|
|
2425
2446
|
}
|
|
@@ -2532,7 +2553,7 @@ function MarginFieldInner({
|
|
|
2532
2553
|
isLinked ? "" : "text-muted-foreground"
|
|
2533
2554
|
),
|
|
2534
2555
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
2535
|
-
children: isLinked ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2556
|
+
children: isLinked ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Unlink, { className: "h-4 w-4" })
|
|
2536
2557
|
}
|
|
2537
2558
|
)
|
|
2538
2559
|
] }),
|
|
@@ -2601,7 +2622,7 @@ function ResetFieldInner({
|
|
|
2601
2622
|
disabled,
|
|
2602
2623
|
className: "w-full text-muted-foreground hover:text-destructive hover:bg-destructive/10 gap-1.5",
|
|
2603
2624
|
children: [
|
|
2604
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2625
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-3.5 w-3.5" }),
|
|
2605
2626
|
label
|
|
2606
2627
|
]
|
|
2607
2628
|
}
|
|
@@ -2698,7 +2719,7 @@ var DialogContent = React6__namespace.forwardRef(({ className, children, ...prop
|
|
|
2698
2719
|
children: [
|
|
2699
2720
|
children,
|
|
2700
2721
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
2701
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2722
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
2702
2723
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
2703
2724
|
] })
|
|
2704
2725
|
]
|
|
@@ -2721,7 +2742,7 @@ var DialogContentFullscreen = React6__namespace.forwardRef(({ className, childre
|
|
|
2721
2742
|
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: accessibleTitle }),
|
|
2722
2743
|
children,
|
|
2723
2744
|
!hideCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
2724
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2745
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
2725
2746
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
2726
2747
|
] })
|
|
2727
2748
|
]
|
|
@@ -2995,10 +3016,10 @@ function MediaFieldInner({
|
|
|
2995
3016
|
onClick: handleRemove,
|
|
2996
3017
|
className: "absolute -top-2 -right-2 p-1 bg-destructive text-destructive-foreground rounded-full opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2997
3018
|
"aria-label": "Remove image",
|
|
2998
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3019
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
|
|
2999
3020
|
}
|
|
3000
3021
|
)
|
|
3001
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 bg-muted rounded-md border border-dashed border-input flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3022
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 bg-muted rounded-md border border-dashed border-input flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
3002
3023
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3003
3024
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3004
3025
|
Button,
|
|
@@ -3022,7 +3043,7 @@ function MediaFieldInner({
|
|
|
3022
3043
|
] })
|
|
3023
3044
|
] }),
|
|
3024
3045
|
value?.url && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
3025
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3046
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-3 w-3 flex-shrink-0" }),
|
|
3026
3047
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate max-w-[280px]", title: value.url, children: value.url })
|
|
3027
3048
|
] })
|
|
3028
3049
|
] }),
|
|
@@ -3067,7 +3088,7 @@ function MediaFieldInner({
|
|
|
3067
3088
|
)
|
|
3068
3089
|
] }),
|
|
3069
3090
|
activeTab === "browse" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
|
|
3070
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3091
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
3071
3092
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3072
3093
|
Input,
|
|
3073
3094
|
{
|
|
@@ -3113,7 +3134,7 @@ function MediaFieldInner({
|
|
|
3113
3134
|
onClick: handleLoadMore,
|
|
3114
3135
|
disabled: loading,
|
|
3115
3136
|
children: loading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3116
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3137
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
3117
3138
|
"Loading..."
|
|
3118
3139
|
] }) : "Load More"
|
|
3119
3140
|
}
|
|
@@ -3143,15 +3164,15 @@ function MediaFieldInner({
|
|
|
3143
3164
|
] })
|
|
3144
3165
|
] }),
|
|
3145
3166
|
uploadState.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
3146
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3167
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
3147
3168
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: uploadState.error })
|
|
3148
3169
|
] }),
|
|
3149
3170
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3150
3171
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleUpload, disabled: uploadState.uploading, children: uploadState.uploading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3151
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
3152
3173
|
"Uploading..."
|
|
3153
3174
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3175
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4 mr-2" }),
|
|
3155
3176
|
"Upload & Select"
|
|
3156
3177
|
] }) }),
|
|
3157
3178
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3165,7 +3186,7 @@ function MediaFieldInner({
|
|
|
3165
3186
|
)
|
|
3166
3187
|
] })
|
|
3167
3188
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
3168
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3189
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "h-16 w-16 text-muted mx-auto mb-4" }),
|
|
3169
3190
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "cursor-pointer", children: [
|
|
3170
3191
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Select Image" }) }),
|
|
3171
3192
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3185,7 +3206,7 @@ function MediaFieldInner({
|
|
|
3185
3206
|
/* URL Tab */
|
|
3186
3207
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center h-full min-h-[300px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-md space-y-4", children: [
|
|
3187
3208
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-6", children: [
|
|
3188
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3209
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-12 w-12 text-muted-foreground mx-auto mb-2" }),
|
|
3189
3210
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Enter an image URL from an external source" })
|
|
3190
3211
|
] }),
|
|
3191
3212
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -3223,10 +3244,10 @@ function MediaFieldInner({
|
|
|
3223
3244
|
onError: handleUrlPreviewError
|
|
3224
3245
|
}
|
|
3225
3246
|
),
|
|
3226
|
-
!urlState.previewLoaded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3247
|
+
!urlState.previewLoaded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) })
|
|
3227
3248
|
] }),
|
|
3228
3249
|
urlState.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
3229
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3250
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
3230
3251
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: urlState.error })
|
|
3231
3252
|
] }),
|
|
3232
3253
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -3236,7 +3257,7 @@ function MediaFieldInner({
|
|
|
3236
3257
|
onClick: handleUrlSubmit,
|
|
3237
3258
|
disabled: !urlState.url || urlState.loading,
|
|
3238
3259
|
children: [
|
|
3239
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3260
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-4 w-4 mr-2" }),
|
|
3240
3261
|
"Use This URL"
|
|
3241
3262
|
]
|
|
3242
3263
|
}
|
|
@@ -3389,7 +3410,7 @@ function GradientStopEditorInner({
|
|
|
3389
3410
|
onClick: () => onDelete(index),
|
|
3390
3411
|
className: "p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded flex-shrink-0",
|
|
3391
3412
|
title: "Remove stop",
|
|
3392
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3413
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4" })
|
|
3393
3414
|
}
|
|
3394
3415
|
)
|
|
3395
3416
|
] }),
|
|
@@ -3603,7 +3624,7 @@ function GradientEditorInner({ value, onChange, readOnly }) {
|
|
|
3603
3624
|
onClick: handleAddStop,
|
|
3604
3625
|
className: "h-6 text-xs px-2",
|
|
3605
3626
|
children: [
|
|
3606
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3627
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "w-3 h-3 mr-1" }),
|
|
3607
3628
|
"Add Stop"
|
|
3608
3629
|
]
|
|
3609
3630
|
}
|
|
@@ -4092,7 +4113,7 @@ function BackgroundFieldInner({
|
|
|
4092
4113
|
onClick: handleClear,
|
|
4093
4114
|
title: "Clear background",
|
|
4094
4115
|
className: "flex items-center justify-center w-6 h-6 rounded border-none bg-transparent cursor-pointer text-muted-foreground hover:bg-accent hover:text-destructive",
|
|
4095
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4116
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
|
|
4096
4117
|
}
|
|
4097
4118
|
)
|
|
4098
4119
|
] }),
|
|
@@ -4270,7 +4291,7 @@ function CollapsibleSection({ title, defaultOpen = false, children }) {
|
|
|
4270
4291
|
className: "w-full flex items-center justify-between px-3 py-2 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
4271
4292
|
children: [
|
|
4272
4293
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-muted-foreground", children: title }),
|
|
4273
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4294
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
4274
4295
|
]
|
|
4275
4296
|
}
|
|
4276
4297
|
),
|
|
@@ -4404,7 +4425,7 @@ function AnimationFieldInner({
|
|
|
4404
4425
|
onClick: handleClear,
|
|
4405
4426
|
className: "text-muted-foreground hover:text-destructive",
|
|
4406
4427
|
title: "Reset to default",
|
|
4407
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4428
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
4408
4429
|
}
|
|
4409
4430
|
)
|
|
4410
4431
|
] }),
|
|
@@ -4680,11 +4701,11 @@ function createAnimationField(config = {}) {
|
|
|
4680
4701
|
};
|
|
4681
4702
|
}
|
|
4682
4703
|
var BREAKPOINT_ICONS = {
|
|
4683
|
-
|
|
4684
|
-
sm:
|
|
4685
|
-
md:
|
|
4686
|
-
lg:
|
|
4687
|
-
xl:
|
|
4704
|
+
xs: lucideReact.Smartphone,
|
|
4705
|
+
sm: lucideReact.Smartphone,
|
|
4706
|
+
md: lucideReact.Tablet,
|
|
4707
|
+
lg: lucideReact.Laptop,
|
|
4708
|
+
xl: lucideReact.Monitor
|
|
4688
4709
|
};
|
|
4689
4710
|
function BreakpointTab({
|
|
4690
4711
|
breakpoint,
|
|
@@ -4724,17 +4745,17 @@ function ResponsiveFieldInner({
|
|
|
4724
4745
|
renderInnerField,
|
|
4725
4746
|
defaultValue
|
|
4726
4747
|
}) {
|
|
4727
|
-
const [activeBreakpoint, setActiveBreakpoint] = React6.useState("
|
|
4748
|
+
const [activeBreakpoint, setActiveBreakpoint] = React6.useState("xs");
|
|
4728
4749
|
const getCurrentValue = React6.useCallback(() => {
|
|
4729
4750
|
if (!value) return defaultValue ?? null;
|
|
4730
|
-
if (activeBreakpoint === "
|
|
4731
|
-
return value.
|
|
4751
|
+
if (activeBreakpoint === "xs") {
|
|
4752
|
+
return value.xs ?? defaultValue ?? null;
|
|
4732
4753
|
}
|
|
4733
4754
|
const override = value[activeBreakpoint];
|
|
4734
4755
|
if (override !== void 0) {
|
|
4735
4756
|
return override;
|
|
4736
4757
|
}
|
|
4737
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "
|
|
4758
|
+
const breakpointOrder = ["xl", "lg", "md", "sm", "xs"];
|
|
4738
4759
|
const activeIndex = breakpointOrder.indexOf(activeBreakpoint);
|
|
4739
4760
|
for (let i = activeIndex + 1; i < breakpointOrder.length; i++) {
|
|
4740
4761
|
const bp = breakpointOrder[i];
|
|
@@ -4748,18 +4769,18 @@ function ResponsiveFieldInner({
|
|
|
4748
4769
|
const hasOverride = React6.useCallback(
|
|
4749
4770
|
(breakpoint) => {
|
|
4750
4771
|
if (!value) return false;
|
|
4751
|
-
if (breakpoint === "
|
|
4772
|
+
if (breakpoint === "xs") return value.xs !== void 0;
|
|
4752
4773
|
return value[breakpoint] !== void 0;
|
|
4753
4774
|
},
|
|
4754
4775
|
[value]
|
|
4755
4776
|
);
|
|
4756
4777
|
const handleInnerChange = React6.useCallback(
|
|
4757
4778
|
(newValue) => {
|
|
4758
|
-
if (activeBreakpoint === "
|
|
4779
|
+
if (activeBreakpoint === "xs") {
|
|
4759
4780
|
if (newValue === null && defaultValue !== void 0) {
|
|
4760
|
-
onChange({ ...value,
|
|
4781
|
+
onChange({ ...value, xs: defaultValue });
|
|
4761
4782
|
} else if (newValue !== null) {
|
|
4762
|
-
onChange({ ...value,
|
|
4783
|
+
onChange({ ...value, xs: newValue });
|
|
4763
4784
|
}
|
|
4764
4785
|
} else {
|
|
4765
4786
|
if (newValue === null) {
|
|
@@ -4767,11 +4788,11 @@ function ResponsiveFieldInner({
|
|
|
4767
4788
|
delete newResponsive[activeBreakpoint];
|
|
4768
4789
|
onChange(newResponsive);
|
|
4769
4790
|
} else {
|
|
4770
|
-
const
|
|
4771
|
-
if (
|
|
4791
|
+
const xs = value?.xs ?? defaultValue;
|
|
4792
|
+
if (xs === void 0) return;
|
|
4772
4793
|
onChange({
|
|
4773
4794
|
...value,
|
|
4774
|
-
|
|
4795
|
+
xs,
|
|
4775
4796
|
[activeBreakpoint]: newValue
|
|
4776
4797
|
});
|
|
4777
4798
|
}
|
|
@@ -4780,7 +4801,7 @@ function ResponsiveFieldInner({
|
|
|
4780
4801
|
[value, onChange, activeBreakpoint, defaultValue]
|
|
4781
4802
|
);
|
|
4782
4803
|
const handleClearOverride = React6.useCallback(() => {
|
|
4783
|
-
if (activeBreakpoint === "
|
|
4804
|
+
if (activeBreakpoint === "xs" || !value) return;
|
|
4784
4805
|
const newResponsive = { ...value };
|
|
4785
4806
|
delete newResponsive[activeBreakpoint];
|
|
4786
4807
|
onChange(newResponsive);
|
|
@@ -4789,7 +4810,7 @@ function ResponsiveFieldInner({
|
|
|
4789
4810
|
onChange(null);
|
|
4790
4811
|
}, [onChange]);
|
|
4791
4812
|
const currentValue = getCurrentValue();
|
|
4792
|
-
const isOverrideBreakpoint = activeBreakpoint !== "
|
|
4813
|
+
const isOverrideBreakpoint = activeBreakpoint !== "xs";
|
|
4793
4814
|
const currentHasOverride = hasOverride(activeBreakpoint);
|
|
4794
4815
|
const overrideCount = value ? ["sm", "md", "lg", "xl"].filter((bp) => value[bp] !== void 0).length : 0;
|
|
4795
4816
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "puck-field space-y-3", children: [
|
|
@@ -4811,7 +4832,7 @@ function ResponsiveFieldInner({
|
|
|
4811
4832
|
onClick: handleClearAll,
|
|
4812
4833
|
className: "text-muted-foreground hover:text-destructive",
|
|
4813
4834
|
title: "Clear all values",
|
|
4814
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4835
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
4815
4836
|
}
|
|
4816
4837
|
)
|
|
4817
4838
|
] }),
|
|
@@ -4829,10 +4850,10 @@ function ResponsiveFieldInner({
|
|
|
4829
4850
|
bp.key
|
|
4830
4851
|
)) }),
|
|
4831
4852
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
4832
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: activeBreakpoint === "
|
|
4853
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: activeBreakpoint === "xs" ? "Extra small screens (0-639px)" : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4833
4854
|
BREAKPOINTS.find((bp) => bp.key === activeBreakpoint)?.minWidth,
|
|
4834
4855
|
"px and up",
|
|
4835
|
-
!currentHasOverride && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from
|
|
4856
|
+
!currentHasOverride && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from xs)" })
|
|
4836
4857
|
] }) }),
|
|
4837
4858
|
isOverrideBreakpoint && currentHasOverride && !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4838
4859
|
Button,
|
|
@@ -4885,18 +4906,17 @@ function createResponsiveField(config) {
|
|
|
4885
4906
|
};
|
|
4886
4907
|
}
|
|
4887
4908
|
var BREAKPOINT_ICONS2 = {
|
|
4888
|
-
|
|
4889
|
-
sm:
|
|
4890
|
-
md:
|
|
4891
|
-
lg:
|
|
4892
|
-
xl:
|
|
4909
|
+
xs: lucideReact.Smartphone,
|
|
4910
|
+
sm: lucideReact.Smartphone,
|
|
4911
|
+
md: lucideReact.Tablet,
|
|
4912
|
+
lg: lucideReact.Laptop,
|
|
4913
|
+
xl: lucideReact.Monitor
|
|
4893
4914
|
};
|
|
4894
4915
|
function VisibilityToggle({
|
|
4895
4916
|
breakpoint,
|
|
4896
4917
|
label,
|
|
4897
4918
|
minWidth,
|
|
4898
4919
|
isVisible,
|
|
4899
|
-
isInherited,
|
|
4900
4920
|
onClick,
|
|
4901
4921
|
disabled
|
|
4902
4922
|
}) {
|
|
@@ -4907,18 +4927,16 @@ function VisibilityToggle({
|
|
|
4907
4927
|
type: "button",
|
|
4908
4928
|
onClick,
|
|
4909
4929
|
disabled,
|
|
4910
|
-
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}
|
|
4930
|
+
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}`,
|
|
4911
4931
|
className: cn2(
|
|
4912
4932
|
"relative flex flex-col items-center justify-center gap-0.5 p-2 rounded-md transition-all flex-1 min-w-[52px]",
|
|
4913
|
-
isVisible ? "bg-emerald-500/
|
|
4914
|
-
isInherited && "opacity-60",
|
|
4933
|
+
isVisible ? "bg-emerald-500/15 text-emerald-600 hover:bg-emerald-500/25 border border-emerald-500/40" : "bg-red-500/15 text-red-500 hover:bg-red-500/25 border border-red-500/40",
|
|
4915
4934
|
disabled && "opacity-50 cursor-not-allowed"
|
|
4916
4935
|
),
|
|
4917
4936
|
children: [
|
|
4918
4937
|
/* @__PURE__ */ jsxRuntime.jsx(DeviceIcon, { className: "h-4 w-4" }),
|
|
4919
4938
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium", children: label }),
|
|
4920
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4921
|
-
isInherited && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -bottom-0.5 left-1/2 -translate-x-1/2 text-[8px] text-muted-foreground", children: "\u2022" })
|
|
4939
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { className: "h-3 w-3" }) })
|
|
4922
4940
|
]
|
|
4923
4941
|
}
|
|
4924
4942
|
);
|
|
@@ -4929,85 +4947,46 @@ function ResponsiveVisibilityFieldInner({
|
|
|
4929
4947
|
label,
|
|
4930
4948
|
readOnly
|
|
4931
4949
|
}) {
|
|
4932
|
-
const
|
|
4950
|
+
const getVisibility = React6.useCallback(
|
|
4933
4951
|
(breakpoint) => {
|
|
4934
4952
|
const val = value ?? DEFAULT_VISIBILITY;
|
|
4935
|
-
|
|
4936
|
-
return { visible: val.base, inherited: false };
|
|
4937
|
-
}
|
|
4938
|
-
const explicitValue = val[breakpoint];
|
|
4939
|
-
if (explicitValue !== void 0) {
|
|
4940
|
-
return { visible: explicitValue, inherited: false };
|
|
4941
|
-
}
|
|
4942
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "base"];
|
|
4943
|
-
const currentIndex = breakpointOrder.indexOf(breakpoint);
|
|
4944
|
-
for (let i = currentIndex + 1; i < breakpointOrder.length; i++) {
|
|
4945
|
-
const bp = breakpointOrder[i];
|
|
4946
|
-
const bpValue = val[bp];
|
|
4947
|
-
if (bpValue !== void 0) {
|
|
4948
|
-
return { visible: bpValue, inherited: true };
|
|
4949
|
-
}
|
|
4950
|
-
}
|
|
4951
|
-
return { visible: val.base, inherited: true };
|
|
4953
|
+
return val[breakpoint] ?? true;
|
|
4952
4954
|
},
|
|
4953
4955
|
[value]
|
|
4954
4956
|
);
|
|
4955
4957
|
const toggleVisibility = React6.useCallback(
|
|
4956
4958
|
(breakpoint) => {
|
|
4957
|
-
const
|
|
4958
|
-
const
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
});
|
|
4964
|
-
} else {
|
|
4965
|
-
const newValue = {
|
|
4966
|
-
...value ?? DEFAULT_VISIBILITY,
|
|
4967
|
-
[breakpoint]: newVisible
|
|
4968
|
-
};
|
|
4969
|
-
onChange(newValue);
|
|
4970
|
-
}
|
|
4959
|
+
const currentVisible = getVisibility(breakpoint);
|
|
4960
|
+
const newValue = {
|
|
4961
|
+
...value ?? DEFAULT_VISIBILITY,
|
|
4962
|
+
[breakpoint]: !currentVisible
|
|
4963
|
+
};
|
|
4964
|
+
onChange(newValue);
|
|
4971
4965
|
},
|
|
4972
|
-
[value, onChange,
|
|
4966
|
+
[value, onChange, getVisibility]
|
|
4973
4967
|
);
|
|
4974
|
-
const
|
|
4975
|
-
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => {
|
|
4976
|
-
const { visible } = getEffectiveVisibility(bp.key);
|
|
4977
|
-
return !visible;
|
|
4978
|
-
});
|
|
4968
|
+
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => !getVisibility(bp.key));
|
|
4979
4969
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "puck-field space-y-2", children: [
|
|
4980
4970
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4981
|
-
label && /* @__PURE__ */ jsxRuntime.
|
|
4982
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
4983
|
-
overrideCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: [
|
|
4984
|
-
overrideCount,
|
|
4985
|
-
" override",
|
|
4986
|
-
overrideCount !== 1 ? "s" : ""
|
|
4987
|
-
] })
|
|
4988
|
-
] }),
|
|
4971
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
4989
4972
|
hasHiddenBreakpoints && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-amber-600 flex items-center gap-1", children: [
|
|
4990
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4991
|
-
"
|
|
4973
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { className: "h-3 w-3" }),
|
|
4974
|
+
"Partially hidden"
|
|
4992
4975
|
] })
|
|
4993
4976
|
] }),
|
|
4994
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) =>
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
bp.key
|
|
5008
|
-
);
|
|
5009
|
-
}) }),
|
|
5010
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Click to toggle visibility. Changes cascade to larger breakpoints." })
|
|
4977
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4978
|
+
VisibilityToggle,
|
|
4979
|
+
{
|
|
4980
|
+
breakpoint: bp.key,
|
|
4981
|
+
label: bp.label,
|
|
4982
|
+
minWidth: bp.minWidth,
|
|
4983
|
+
isVisible: getVisibility(bp.key),
|
|
4984
|
+
onClick: () => toggleVisibility(bp.key),
|
|
4985
|
+
disabled: readOnly
|
|
4986
|
+
},
|
|
4987
|
+
bp.key
|
|
4988
|
+
)) }),
|
|
4989
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Toggle visibility per screen size. Each breakpoint is independent." })
|
|
5011
4990
|
] });
|
|
5012
4991
|
}
|
|
5013
4992
|
var ResponsiveVisibilityField = React6.memo(ResponsiveVisibilityFieldInner);
|
|
@@ -5190,11 +5169,11 @@ function JustifyContentFieldInner({
|
|
|
5190
5169
|
onChange(null);
|
|
5191
5170
|
}, [onChange]);
|
|
5192
5171
|
const options = [
|
|
5193
|
-
{ value: "flex-start", icon:
|
|
5194
|
-
{ value: "center", icon:
|
|
5195
|
-
{ value: "flex-end", icon:
|
|
5196
|
-
{ value: "space-between", icon:
|
|
5197
|
-
{ value: "space-around", icon:
|
|
5172
|
+
{ value: "flex-start", icon: lucideReact.AlignLeft, title: "Start" },
|
|
5173
|
+
{ value: "center", icon: lucideReact.AlignCenter, title: "Center" },
|
|
5174
|
+
{ value: "flex-end", icon: lucideReact.AlignRight, title: "End" },
|
|
5175
|
+
{ value: "space-between", icon: lucideReact.AlignHorizontalDistributeCenter, title: "Space Between" },
|
|
5176
|
+
{ value: "space-around", icon: lucideReact.GripHorizontal, title: "Space Around" }
|
|
5198
5177
|
];
|
|
5199
5178
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5200
5179
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5208,7 +5187,7 @@ function JustifyContentFieldInner({
|
|
|
5208
5187
|
onClick: handleClear,
|
|
5209
5188
|
className: "text-muted-foreground hover:text-destructive",
|
|
5210
5189
|
title: "Reset to default",
|
|
5211
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5190
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
5212
5191
|
}
|
|
5213
5192
|
)
|
|
5214
5193
|
] }),
|
|
@@ -5250,10 +5229,10 @@ function AlignItemsFieldInner({
|
|
|
5250
5229
|
onChange(null);
|
|
5251
5230
|
}, [onChange]);
|
|
5252
5231
|
const options = [
|
|
5253
|
-
{ value: "flex-start", icon:
|
|
5254
|
-
{ value: "center", icon:
|
|
5255
|
-
{ value: "flex-end", icon:
|
|
5256
|
-
{ value: "stretch", icon:
|
|
5232
|
+
{ value: "flex-start", icon: lucideReact.AlignStartVertical, title: "Start" },
|
|
5233
|
+
{ value: "center", icon: lucideReact.AlignCenterVertical, title: "Center" },
|
|
5234
|
+
{ value: "flex-end", icon: lucideReact.AlignEndVertical, title: "End" },
|
|
5235
|
+
{ value: "stretch", icon: lucideReact.MoveVertical, title: "Stretch" }
|
|
5257
5236
|
];
|
|
5258
5237
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5259
5238
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5267,7 +5246,7 @@ function AlignItemsFieldInner({
|
|
|
5267
5246
|
onClick: handleClear,
|
|
5268
5247
|
className: "text-muted-foreground hover:text-destructive",
|
|
5269
5248
|
title: "Reset to default",
|
|
5270
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5249
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
5271
5250
|
}
|
|
5272
5251
|
)
|
|
5273
5252
|
] }),
|
|
@@ -6163,7 +6142,7 @@ function TemplateFieldInner({
|
|
|
6163
6142
|
onClick: handleClearTemplate,
|
|
6164
6143
|
title: "Clear selection",
|
|
6165
6144
|
className: "text-muted-foreground hover:text-foreground",
|
|
6166
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6145
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
6167
6146
|
}
|
|
6168
6147
|
)
|
|
6169
6148
|
] }),
|
|
@@ -6177,7 +6156,7 @@ function TemplateFieldInner({
|
|
|
6177
6156
|
className: "flex-1 gap-1.5",
|
|
6178
6157
|
disabled: loading || saveForm.saving,
|
|
6179
6158
|
children: [
|
|
6180
|
-
saveForm.expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6159
|
+
saveForm.expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Save, { className: "h-4 w-4" }),
|
|
6181
6160
|
saveForm.expanded ? "Cancel" : "Save as Template"
|
|
6182
6161
|
]
|
|
6183
6162
|
}
|
|
@@ -6191,7 +6170,7 @@ function TemplateFieldInner({
|
|
|
6191
6170
|
className: "gap-1.5",
|
|
6192
6171
|
disabled: loadingTemplate,
|
|
6193
6172
|
children: [
|
|
6194
|
-
loadingTemplate ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6173
|
+
loadingTemplate ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" }),
|
|
6195
6174
|
"Reload"
|
|
6196
6175
|
]
|
|
6197
6176
|
}
|
|
@@ -6241,7 +6220,7 @@ function TemplateFieldInner({
|
|
|
6241
6220
|
)
|
|
6242
6221
|
] }),
|
|
6243
6222
|
saveForm.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-xs flex items-start gap-2", children: [
|
|
6244
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6223
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-3.5 w-3.5 flex-shrink-0 mt-0.5" }),
|
|
6245
6224
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: saveForm.error })
|
|
6246
6225
|
] }),
|
|
6247
6226
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6252,17 +6231,17 @@ function TemplateFieldInner({
|
|
|
6252
6231
|
size: "sm",
|
|
6253
6232
|
className: "w-full gap-1.5",
|
|
6254
6233
|
children: saveForm.saving ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6255
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6234
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
6256
6235
|
"Saving..."
|
|
6257
6236
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6258
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6237
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Save, { className: "h-4 w-4" }),
|
|
6259
6238
|
"Save Template"
|
|
6260
6239
|
] })
|
|
6261
6240
|
}
|
|
6262
6241
|
)
|
|
6263
6242
|
] }),
|
|
6264
6243
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
6265
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6244
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
6266
6245
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
|
|
6267
6246
|
] })
|
|
6268
6247
|
] });
|
|
@@ -6475,9 +6454,9 @@ function AlignmentFieldInner({
|
|
|
6475
6454
|
onChange(null);
|
|
6476
6455
|
}, [onChange]);
|
|
6477
6456
|
const alignments = [
|
|
6478
|
-
{ value: "left", icon:
|
|
6479
|
-
{ value: "center", icon:
|
|
6480
|
-
{ value: "right", icon:
|
|
6457
|
+
{ value: "left", icon: lucideReact.AlignLeft, title: "Align left" },
|
|
6458
|
+
{ value: "center", icon: lucideReact.AlignCenter, title: "Align center" },
|
|
6459
|
+
{ value: "right", icon: lucideReact.AlignRight, title: "Align right" }
|
|
6481
6460
|
];
|
|
6482
6461
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "puck-field space-y-2", children: [
|
|
6483
6462
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -6491,7 +6470,7 @@ function AlignmentFieldInner({
|
|
|
6491
6470
|
onClick: handleClear,
|
|
6492
6471
|
className: "text-muted-foreground hover:text-destructive",
|
|
6493
6472
|
title: "Reset to default",
|
|
6494
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6473
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
6495
6474
|
}
|
|
6496
6475
|
)
|
|
6497
6476
|
] }),
|
|
@@ -7147,7 +7126,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7147
7126
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
7148
7127
|
isActive: formattingState?.isBold,
|
|
7149
7128
|
title: "Bold",
|
|
7150
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7129
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: ICON_SIZE })
|
|
7151
7130
|
}
|
|
7152
7131
|
),
|
|
7153
7132
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7156,7 +7135,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7156
7135
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
7157
7136
|
isActive: formattingState?.isItalic,
|
|
7158
7137
|
title: "Italic",
|
|
7159
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7138
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: ICON_SIZE })
|
|
7160
7139
|
}
|
|
7161
7140
|
),
|
|
7162
7141
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7165,7 +7144,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7165
7144
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
7166
7145
|
isActive: formattingState?.isUnderline,
|
|
7167
7146
|
title: "Underline",
|
|
7168
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7147
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: ICON_SIZE })
|
|
7169
7148
|
}
|
|
7170
7149
|
),
|
|
7171
7150
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7174,7 +7153,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7174
7153
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
7175
7154
|
isActive: formattingState?.isStrike,
|
|
7176
7155
|
title: "Strikethrough",
|
|
7177
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7156
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Strikethrough, { className: ICON_SIZE })
|
|
7178
7157
|
}
|
|
7179
7158
|
),
|
|
7180
7159
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7183,7 +7162,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7183
7162
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
7184
7163
|
isActive: formattingState?.isSuperscript,
|
|
7185
7164
|
title: "Superscript",
|
|
7186
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7165
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Superscript, { className: ICON_SIZE })
|
|
7187
7166
|
}
|
|
7188
7167
|
),
|
|
7189
7168
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7192,7 +7171,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7192
7171
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
7193
7172
|
isActive: formattingState?.isSubscript,
|
|
7194
7173
|
title: "Subscript",
|
|
7195
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7174
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Subscript, { className: ICON_SIZE })
|
|
7196
7175
|
}
|
|
7197
7176
|
),
|
|
7198
7177
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7200,8 +7179,8 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7200
7179
|
ToolbarDropdown,
|
|
7201
7180
|
{
|
|
7202
7181
|
trigger: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
7203
|
-
formattingState?.isH1 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7204
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7182
|
+
formattingState?.isH1 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: ICON_SIZE }) : formattingState?.isH2 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: ICON_SIZE }) : formattingState?.isH3 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: ICON_SIZE }) : formattingState?.isH4 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading4, { className: ICON_SIZE }) : formattingState?.isH5 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading5, { className: ICON_SIZE }) : formattingState?.isH6 ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading6, { className: ICON_SIZE }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pilcrow, { className: ICON_SIZE }),
|
|
7183
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3" })
|
|
7205
7184
|
] }),
|
|
7206
7185
|
title: "Text Type",
|
|
7207
7186
|
isActive: formattingState?.isH1 || formattingState?.isH2 || formattingState?.isH3 || formattingState?.isH4 || formattingState?.isH5 || formattingState?.isH6,
|
|
@@ -7210,7 +7189,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7210
7189
|
editor.chain().focus().setParagraph().run();
|
|
7211
7190
|
close();
|
|
7212
7191
|
}, children: [
|
|
7213
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7192
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pilcrow, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7214
7193
|
"Paragraph"
|
|
7215
7194
|
] }),
|
|
7216
7195
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
@@ -7218,42 +7197,42 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7218
7197
|
editor.chain().focus().toggleHeading({ level: 1 }).run();
|
|
7219
7198
|
close();
|
|
7220
7199
|
}, children: [
|
|
7221
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7200
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7222
7201
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-lg", children: "Heading 1" })
|
|
7223
7202
|
] }),
|
|
7224
7203
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
7225
7204
|
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
|
7226
7205
|
close();
|
|
7227
7206
|
}, children: [
|
|
7228
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7207
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7229
7208
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-base", children: "Heading 2" })
|
|
7230
7209
|
] }),
|
|
7231
7210
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
7232
7211
|
editor.chain().focus().toggleHeading({ level: 3 }).run();
|
|
7233
7212
|
close();
|
|
7234
7213
|
}, children: [
|
|
7235
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7214
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7236
7215
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Heading 3" })
|
|
7237
7216
|
] }),
|
|
7238
7217
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
7239
7218
|
editor.chain().focus().toggleHeading({ level: 4 }).run();
|
|
7240
7219
|
close();
|
|
7241
7220
|
}, children: [
|
|
7242
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7221
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading4, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7243
7222
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm", children: "Heading 4" })
|
|
7244
7223
|
] }),
|
|
7245
7224
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
7246
7225
|
editor.chain().focus().toggleHeading({ level: 5 }).run();
|
|
7247
7226
|
close();
|
|
7248
7227
|
}, children: [
|
|
7249
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7228
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading5, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7250
7229
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-xs", children: "Heading 5" })
|
|
7251
7230
|
] }),
|
|
7252
7231
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
7253
7232
|
editor.chain().focus().toggleHeading({ level: 6 }).run();
|
|
7254
7233
|
close();
|
|
7255
7234
|
}, children: [
|
|
7256
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7235
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading6, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7257
7236
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-xs text-gray-600", children: "Heading 6" })
|
|
7258
7237
|
] })
|
|
7259
7238
|
] })
|
|
@@ -7263,7 +7242,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7263
7242
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7264
7243
|
ToolbarDropdown,
|
|
7265
7244
|
{
|
|
7266
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7245
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ALargeSmall, { className: ICON_SIZE }),
|
|
7267
7246
|
title: "Font Size",
|
|
7268
7247
|
children: (close) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7269
7248
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownLabel, { children: "Presets" }),
|
|
@@ -7349,7 +7328,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7349
7328
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
7350
7329
|
isActive: formattingState?.isBulletList,
|
|
7351
7330
|
title: "Bullet List",
|
|
7352
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7331
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: ICON_SIZE })
|
|
7353
7332
|
}
|
|
7354
7333
|
),
|
|
7355
7334
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7358,7 +7337,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7358
7337
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
7359
7338
|
isActive: formattingState?.isOrderedList,
|
|
7360
7339
|
title: "Numbered List",
|
|
7361
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7340
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: ICON_SIZE })
|
|
7362
7341
|
}
|
|
7363
7342
|
),
|
|
7364
7343
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7367,7 +7346,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7367
7346
|
onClick: () => editor.chain().focus().toggleBlockquote().run(),
|
|
7368
7347
|
isActive: formattingState?.isBlockquote,
|
|
7369
7348
|
title: "Blockquote",
|
|
7370
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7349
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Quote, { className: ICON_SIZE })
|
|
7371
7350
|
}
|
|
7372
7351
|
),
|
|
7373
7352
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7377,7 +7356,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7377
7356
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
7378
7357
|
isActive: formattingState?.isAlignLeft,
|
|
7379
7358
|
title: "Align Left",
|
|
7380
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7359
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeft, { className: ICON_SIZE })
|
|
7381
7360
|
}
|
|
7382
7361
|
),
|
|
7383
7362
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7386,7 +7365,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7386
7365
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
7387
7366
|
isActive: formattingState?.isAlignCenter,
|
|
7388
7367
|
title: "Align Center",
|
|
7389
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7368
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignCenter, { className: ICON_SIZE })
|
|
7390
7369
|
}
|
|
7391
7370
|
),
|
|
7392
7371
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7395,7 +7374,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7395
7374
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
7396
7375
|
isActive: formattingState?.isAlignRight,
|
|
7397
7376
|
title: "Align Right",
|
|
7398
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7377
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignRight, { className: ICON_SIZE })
|
|
7399
7378
|
}
|
|
7400
7379
|
),
|
|
7401
7380
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7404,7 +7383,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7404
7383
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
7405
7384
|
isActive: formattingState?.isAlignJustify,
|
|
7406
7385
|
title: "Justify",
|
|
7407
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7386
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignJustify, { className: ICON_SIZE })
|
|
7408
7387
|
}
|
|
7409
7388
|
),
|
|
7410
7389
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7415,7 +7394,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7415
7394
|
onClick: () => setIsLinkPopoverOpen(!isLinkPopoverOpen),
|
|
7416
7395
|
isActive: formattingState?.isLink,
|
|
7417
7396
|
title: "Add Link",
|
|
7418
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7397
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: ICON_SIZE })
|
|
7419
7398
|
}
|
|
7420
7399
|
),
|
|
7421
7400
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7431,7 +7410,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7431
7410
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7432
7411
|
ToolbarDropdown,
|
|
7433
7412
|
{
|
|
7434
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7413
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, { className: ICON_SIZE }),
|
|
7435
7414
|
title: "Text Color",
|
|
7436
7415
|
children: (close) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7437
7416
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownItem, { onClick: () => {
|
|
@@ -7488,7 +7467,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7488
7467
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7489
7468
|
ToolbarDropdown,
|
|
7490
7469
|
{
|
|
7491
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7470
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Highlighter, { className: ICON_SIZE }),
|
|
7492
7471
|
title: "Highlight",
|
|
7493
7472
|
isActive: formattingState?.isHighlight,
|
|
7494
7473
|
children: (close) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -7519,7 +7498,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7519
7498
|
{
|
|
7520
7499
|
onClick: () => editor.chain().focus().setHorizontalRule().run(),
|
|
7521
7500
|
title: "Horizontal Rule",
|
|
7522
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7501
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: ICON_SIZE })
|
|
7523
7502
|
}
|
|
7524
7503
|
),
|
|
7525
7504
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7527,7 +7506,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7527
7506
|
{
|
|
7528
7507
|
onClick: () => editor.chain().focus().setHardBreak().run(),
|
|
7529
7508
|
title: "Hard Break (Shift+Enter)",
|
|
7530
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7509
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerDownLeft, { className: ICON_SIZE })
|
|
7531
7510
|
}
|
|
7532
7511
|
),
|
|
7533
7512
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7536,7 +7515,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7536
7515
|
{
|
|
7537
7516
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
7538
7517
|
title: "Clear Formatting",
|
|
7539
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7518
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RemoveFormatting, { className: ICON_SIZE })
|
|
7540
7519
|
}
|
|
7541
7520
|
),
|
|
7542
7521
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7559,7 +7538,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7559
7538
|
!showSource && "bg-transparent"
|
|
7560
7539
|
),
|
|
7561
7540
|
children: [
|
|
7562
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7541
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Code, { className: ICON_SIZE }),
|
|
7563
7542
|
"Source"
|
|
7564
7543
|
]
|
|
7565
7544
|
}
|
|
@@ -7673,7 +7652,7 @@ function TiptapModal({ isOpen, onClose, value, onChange, title }) {
|
|
|
7673
7652
|
justifyContent: "center"
|
|
7674
7653
|
},
|
|
7675
7654
|
title: "Close (Esc)",
|
|
7676
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7655
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 20 })
|
|
7677
7656
|
}
|
|
7678
7657
|
)
|
|
7679
7658
|
]
|
|
@@ -7800,7 +7779,7 @@ function TiptapModalFieldInner({ value, onChange, label }) {
|
|
|
7800
7779
|
},
|
|
7801
7780
|
title: "Open full-screen editor",
|
|
7802
7781
|
children: [
|
|
7803
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7782
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { size: 14 }),
|
|
7804
7783
|
"Expand"
|
|
7805
7784
|
]
|
|
7806
7785
|
}
|
|
@@ -8031,7 +8010,7 @@ function TransformFieldInner({
|
|
|
8031
8010
|
onClick: handleClear,
|
|
8032
8011
|
className: "text-muted-foreground hover:text-destructive",
|
|
8033
8012
|
title: "Reset transform",
|
|
8034
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8013
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
8035
8014
|
}
|
|
8036
8015
|
)
|
|
8037
8016
|
] }),
|
|
@@ -8045,7 +8024,7 @@ function TransformFieldInner({
|
|
|
8045
8024
|
) }),
|
|
8046
8025
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 p-3 bg-muted/30 rounded-md", children: [
|
|
8047
8026
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
8048
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8027
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8049
8028
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-xs font-medium", children: "Rotate" })
|
|
8050
8029
|
] }),
|
|
8051
8030
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8063,7 +8042,7 @@ function TransformFieldInner({
|
|
|
8063
8042
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 p-3 bg-muted/30 rounded-md", children: [
|
|
8064
8043
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8065
8044
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8066
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8045
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8067
8046
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-xs font-medium", children: "Scale" })
|
|
8068
8047
|
] }),
|
|
8069
8048
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8075,7 +8054,7 @@ function TransformFieldInner({
|
|
|
8075
8054
|
onClick: handleScaleLockToggle,
|
|
8076
8055
|
className: "h-6 w-6",
|
|
8077
8056
|
title: currentValue.scaleLocked ? "Click to unlink X and Y scale" : "Click to link X and Y scale",
|
|
8078
|
-
children: currentValue.scaleLocked ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8057
|
+
children: currentValue.scaleLocked ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Unlink, { className: "h-3 w-3" })
|
|
8079
8058
|
}
|
|
8080
8059
|
)
|
|
8081
8060
|
] }),
|
|
@@ -8207,10 +8186,10 @@ function TransformFieldInner({
|
|
|
8207
8186
|
className: "w-full flex items-center justify-between p-3 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
8208
8187
|
children: [
|
|
8209
8188
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8210
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8189
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Box, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8211
8190
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-xs font-medium cursor-pointer", children: "3D Transforms" })
|
|
8212
8191
|
] }),
|
|
8213
|
-
show3D ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8192
|
+
show3D ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
8214
8193
|
]
|
|
8215
8194
|
}
|
|
8216
8195
|
),
|
|
@@ -8485,7 +8464,7 @@ function SizeFieldInner({
|
|
|
8485
8464
|
onClick: handleClear,
|
|
8486
8465
|
className: "text-muted-foreground hover:text-destructive",
|
|
8487
8466
|
title: "Reset to default",
|
|
8488
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8467
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
8489
8468
|
}
|
|
8490
8469
|
)
|
|
8491
8470
|
] }),
|
|
@@ -8970,7 +8949,7 @@ function AccordionItem({
|
|
|
8970
8949
|
children: [
|
|
8971
8950
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title }),
|
|
8972
8951
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8973
|
-
|
|
8952
|
+
lucideReact.ChevronDown,
|
|
8974
8953
|
{
|
|
8975
8954
|
className: cn(
|
|
8976
8955
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|