@delmaredigital/payload-puck 0.1.0 → 0.1.2
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.mjs +2 -2
- package/dist/AnimatedWrapper.d.mts +1 -1
- package/dist/AnimatedWrapper.d.ts +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.mjs +200 -221
- 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.mjs +203 -224
- package/dist/config/index.js +33 -16
- package/dist/config/index.mjs +33 -16
- package/dist/editor/index.js +56 -39
- package/dist/editor/index.mjs +56 -39
- 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.mjs +205 -226
- package/dist/render/index.js +33 -16
- package/dist/render/index.mjs +33 -16
- 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 +13 -10
- package/dist/AccordionClient.js.map +0 -1
- package/dist/AccordionClient.mjs.map +0 -1
- package/dist/AnimatedWrapper.js.map +0 -1
- package/dist/AnimatedWrapper.mjs.map +0 -1
- package/dist/admin/client.js.map +0 -1
- package/dist/admin/client.mjs.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/index.mjs.map +0 -1
- package/dist/components/index.css.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs.map +0 -1
- package/dist/config/config.editor.css.map +0 -1
- package/dist/config/config.editor.js.map +0 -1
- package/dist/config/config.editor.mjs.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/index.mjs.map +0 -1
- package/dist/editor/index.js.map +0 -1
- package/dist/editor/index.mjs.map +0 -1
- package/dist/fields/index.css.map +0 -1
- package/dist/fields/index.js.map +0 -1
- package/dist/fields/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/layouts/index.js.map +0 -1
- package/dist/layouts/index.mjs.map +0 -1
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/index.mjs.map +0 -1
- package/dist/render/index.js.map +0 -1
- package/dist/render/index.mjs.map +0 -1
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React6 from 'react';
|
|
3
3
|
import { memo, createContext, useCallback, useState, useEffect, useRef, useContext, useId, createElement, useMemo } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { ChevronDown, ChevronUp, Check, X, Link, Unlink, ArrowUp, ArrowRight, ArrowDown, ArrowLeft, MoveHorizontal, Square, SlidersHorizontal, AlignStartHorizontal, AlignCenterHorizontal, AlignEndHorizontal, RefreshCw, Image, Search, Loader2, AlertCircle, Upload, Trash2, Plus, EyeOff, AlignLeft, AlignCenter, AlignRight, AlignHorizontalDistributeCenter, GripHorizontal, AlignStartVertical, AlignCenterVertical, AlignEndVertical, MoveVertical, Save, Download, Bold, Italic, Underline, Strikethrough, Superscript, Subscript, Pilcrow, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, ALargeSmall, List, ListOrdered, Quote, AlignJustify, Palette, Highlighter, Minus, CornerDownLeft, RemoveFormatting, Code, Maximize2, RotateCw, Box, ChevronRight, Monitor, Laptop, Tablet, Smartphone, Eye } from 'lucide-react';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
@@ -17,8 +17,8 @@ import TextAlign from '@tiptap/extension-text-align';
|
|
|
17
17
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
18
18
|
import { Color } from '@tiptap/extension-color';
|
|
19
19
|
import Highlight from '@tiptap/extension-highlight';
|
|
20
|
-
import Superscript from '@tiptap/extension-superscript';
|
|
21
|
-
import Subscript from '@tiptap/extension-subscript';
|
|
20
|
+
import Superscript$1 from '@tiptap/extension-superscript';
|
|
21
|
+
import Subscript$1 from '@tiptap/extension-subscript';
|
|
22
22
|
import { Extension } from '@tiptap/core';
|
|
23
23
|
|
|
24
24
|
// src/components/layout/Container.tsx
|
|
@@ -517,7 +517,7 @@ function transformValueToCSS(transform) {
|
|
|
517
517
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
518
518
|
}
|
|
519
519
|
var BREAKPOINTS = [
|
|
520
|
-
{ key: "
|
|
520
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
521
521
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
522
522
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
523
523
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -525,7 +525,7 @@ var BREAKPOINTS = [
|
|
|
525
525
|
];
|
|
526
526
|
function isResponsiveValue(value) {
|
|
527
527
|
if (!value || typeof value !== "object") return false;
|
|
528
|
-
return "
|
|
528
|
+
return "xs" in value;
|
|
529
529
|
}
|
|
530
530
|
function camelToKebab(str) {
|
|
531
531
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -551,7 +551,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
551
551
|
if (bpValue === void 0) return;
|
|
552
552
|
const cssProps = converter(bpValue);
|
|
553
553
|
if (!cssProps) return;
|
|
554
|
-
if (bp.key === "
|
|
554
|
+
if (bp.key === "xs") {
|
|
555
555
|
baseStyles = cssProps;
|
|
556
556
|
} else {
|
|
557
557
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -565,29 +565,50 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
565
565
|
return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
|
|
566
566
|
}
|
|
567
567
|
var DEFAULT_VISIBILITY = {
|
|
568
|
-
|
|
568
|
+
xs: true,
|
|
569
|
+
sm: true,
|
|
570
|
+
md: true,
|
|
571
|
+
lg: true,
|
|
572
|
+
xl: true
|
|
569
573
|
};
|
|
570
574
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
571
575
|
if (!visibility) return "";
|
|
572
576
|
const mediaQueries = [];
|
|
573
|
-
|
|
574
|
-
|
|
577
|
+
const breakpointWidths = {
|
|
578
|
+
xs: null,
|
|
579
|
+
// 0px
|
|
580
|
+
sm: 640,
|
|
581
|
+
md: 768,
|
|
582
|
+
lg: 1024,
|
|
583
|
+
xl: 1280
|
|
584
|
+
};
|
|
585
|
+
const getNextBreakpointWidth = (bp) => {
|
|
586
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
587
|
+
const index = order.indexOf(bp);
|
|
588
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
589
|
+
return breakpointWidths[order[index + 1]];
|
|
590
|
+
};
|
|
591
|
+
if (visibility.xs === false) {
|
|
592
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
593
|
+
if (nextWidth) {
|
|
594
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
595
|
+
} else {
|
|
596
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
597
|
+
}
|
|
575
598
|
}
|
|
576
|
-
let lastVisibility = visibility.base;
|
|
577
599
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
if (
|
|
600
|
+
if (visibility[bp.key] === false) {
|
|
601
|
+
const minWidth = breakpointWidths[bp.key];
|
|
602
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
603
|
+
if (minWidth && maxWidth) {
|
|
582
604
|
mediaQueries.push(
|
|
583
|
-
`@media (min-width: ${
|
|
605
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
584
606
|
);
|
|
585
|
-
} else {
|
|
607
|
+
} else if (minWidth) {
|
|
586
608
|
mediaQueries.push(
|
|
587
|
-
`@media (min-width: ${
|
|
609
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
588
610
|
);
|
|
589
611
|
}
|
|
590
|
-
lastVisibility = bpValue;
|
|
591
612
|
}
|
|
592
613
|
});
|
|
593
614
|
return mediaQueries.join("\n");
|
|
@@ -1197,7 +1218,7 @@ function PaddingFieldInner({
|
|
|
1197
1218
|
isLinked ? "" : "text-muted-foreground"
|
|
1198
1219
|
),
|
|
1199
1220
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
1200
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
1221
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
1201
1222
|
}
|
|
1202
1223
|
)
|
|
1203
1224
|
] }),
|
|
@@ -1441,7 +1462,7 @@ function ColorPickerFieldInner({
|
|
|
1441
1462
|
onClick: handleClear,
|
|
1442
1463
|
title: "Clear color",
|
|
1443
1464
|
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",
|
|
1444
|
-
children: /* @__PURE__ */ jsx(
|
|
1465
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
1445
1466
|
}
|
|
1446
1467
|
)
|
|
1447
1468
|
] }),
|
|
@@ -1553,7 +1574,7 @@ var SelectTrigger = React6.forwardRef(({ className, children, ...props }, ref) =
|
|
|
1553
1574
|
...props,
|
|
1554
1575
|
children: [
|
|
1555
1576
|
children,
|
|
1556
|
-
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1577
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
1557
1578
|
]
|
|
1558
1579
|
}
|
|
1559
1580
|
));
|
|
@@ -1567,7 +1588,7 @@ var SelectScrollUpButton = React6.forwardRef(({ className, ...props }, ref) => /
|
|
|
1567
1588
|
className
|
|
1568
1589
|
),
|
|
1569
1590
|
...props,
|
|
1570
|
-
children: /* @__PURE__ */ jsx(
|
|
1591
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
1571
1592
|
}
|
|
1572
1593
|
));
|
|
1573
1594
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -1580,7 +1601,7 @@ var SelectScrollDownButton = React6.forwardRef(({ className, ...props }, ref) =>
|
|
|
1580
1601
|
className
|
|
1581
1602
|
),
|
|
1582
1603
|
...props,
|
|
1583
|
-
children: /* @__PURE__ */ jsx(
|
|
1604
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
1584
1605
|
}
|
|
1585
1606
|
));
|
|
1586
1607
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -1631,7 +1652,7 @@ var SelectItem = React6.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1631
1652
|
),
|
|
1632
1653
|
...props,
|
|
1633
1654
|
children: [
|
|
1634
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
|
|
1655
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
1635
1656
|
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
1636
1657
|
]
|
|
1637
1658
|
}
|
|
@@ -1723,7 +1744,7 @@ function BorderFieldInner({
|
|
|
1723
1744
|
onClick: handleClear,
|
|
1724
1745
|
className: "text-muted-foreground hover:text-destructive",
|
|
1725
1746
|
title: "Clear border",
|
|
1726
|
-
children: /* @__PURE__ */ jsx(
|
|
1747
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
1727
1748
|
}
|
|
1728
1749
|
)
|
|
1729
1750
|
] }),
|
|
@@ -1826,7 +1847,7 @@ function BorderFieldInner({
|
|
|
1826
1847
|
currentValue.sides.top && "bg-primary hover:bg-primary/90"
|
|
1827
1848
|
),
|
|
1828
1849
|
title: "Top border",
|
|
1829
|
-
children: /* @__PURE__ */ jsx(
|
|
1850
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" })
|
|
1830
1851
|
}
|
|
1831
1852
|
),
|
|
1832
1853
|
/* @__PURE__ */ jsx(
|
|
@@ -1841,7 +1862,7 @@ function BorderFieldInner({
|
|
|
1841
1862
|
currentValue.sides.right && "bg-primary hover:bg-primary/90"
|
|
1842
1863
|
),
|
|
1843
1864
|
title: "Right border",
|
|
1844
|
-
children: /* @__PURE__ */ jsx(
|
|
1865
|
+
children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" })
|
|
1845
1866
|
}
|
|
1846
1867
|
),
|
|
1847
1868
|
/* @__PURE__ */ jsx(
|
|
@@ -1856,7 +1877,7 @@ function BorderFieldInner({
|
|
|
1856
1877
|
currentValue.sides.bottom && "bg-primary hover:bg-primary/90"
|
|
1857
1878
|
),
|
|
1858
1879
|
title: "Bottom border",
|
|
1859
|
-
children: /* @__PURE__ */ jsx(
|
|
1880
|
+
children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" })
|
|
1860
1881
|
}
|
|
1861
1882
|
),
|
|
1862
1883
|
/* @__PURE__ */ jsx(
|
|
@@ -1871,7 +1892,7 @@ function BorderFieldInner({
|
|
|
1871
1892
|
currentValue.sides.left && "bg-primary hover:bg-primary/90"
|
|
1872
1893
|
),
|
|
1873
1894
|
title: "Left border",
|
|
1874
|
-
children: /* @__PURE__ */ jsx(
|
|
1895
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" })
|
|
1875
1896
|
}
|
|
1876
1897
|
)
|
|
1877
1898
|
] }),
|
|
@@ -2159,14 +2180,14 @@ function DimensionsFieldInner({
|
|
|
2159
2180
|
});
|
|
2160
2181
|
}, [advancedMode, currentValue, onChange]);
|
|
2161
2182
|
const modeConfig = [
|
|
2162
|
-
{ mode: "full", icon:
|
|
2163
|
-
{ mode: "contained", icon:
|
|
2164
|
-
{ mode: "custom", icon:
|
|
2183
|
+
{ mode: "full", icon: MoveHorizontal, label: "Full", title: "Full width (100%)" },
|
|
2184
|
+
{ mode: "contained", icon: Square, label: "Contain", title: "Contained (centered with max-width)" },
|
|
2185
|
+
{ mode: "custom", icon: SlidersHorizontal, label: "Custom", title: "Custom width settings" }
|
|
2165
2186
|
];
|
|
2166
2187
|
const alignmentConfig = [
|
|
2167
|
-
{ alignment: "left", icon:
|
|
2168
|
-
{ alignment: "center", icon:
|
|
2169
|
-
{ alignment: "right", icon:
|
|
2188
|
+
{ alignment: "left", icon: AlignStartHorizontal, title: "Align left" },
|
|
2189
|
+
{ alignment: "center", icon: AlignCenterHorizontal, title: "Align center" },
|
|
2190
|
+
{ alignment: "right", icon: AlignEndHorizontal, title: "Align right" }
|
|
2170
2191
|
];
|
|
2171
2192
|
const showWidthControls = currentValue.mode !== "full";
|
|
2172
2193
|
showHeightControls && (advancedMode || currentValue.minHeight?.enabled || currentValue.maxHeight?.enabled);
|
|
@@ -2182,7 +2203,7 @@ function DimensionsFieldInner({
|
|
|
2182
2203
|
onClick: handleClear,
|
|
2183
2204
|
className: "text-muted-foreground hover:text-destructive",
|
|
2184
2205
|
title: "Reset to default",
|
|
2185
|
-
children: /* @__PURE__ */ jsx(
|
|
2206
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
2186
2207
|
}
|
|
2187
2208
|
)
|
|
2188
2209
|
] }),
|
|
@@ -2385,10 +2406,10 @@ function DimensionsFieldInner({
|
|
|
2385
2406
|
disabled: readOnly,
|
|
2386
2407
|
className: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
2387
2408
|
children: advancedMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2388
|
-
/* @__PURE__ */ jsx(
|
|
2409
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3.5 w-3.5 mr-1" }),
|
|
2389
2410
|
"Hide Advanced"
|
|
2390
2411
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2391
|
-
/* @__PURE__ */ jsx(
|
|
2412
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 mr-1" }),
|
|
2392
2413
|
"Show Advanced"
|
|
2393
2414
|
] })
|
|
2394
2415
|
}
|
|
@@ -2501,7 +2522,7 @@ function MarginFieldInner({
|
|
|
2501
2522
|
isLinked ? "" : "text-muted-foreground"
|
|
2502
2523
|
),
|
|
2503
2524
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
2504
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
2525
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
2505
2526
|
}
|
|
2506
2527
|
)
|
|
2507
2528
|
] }),
|
|
@@ -2570,7 +2591,7 @@ function ResetFieldInner({
|
|
|
2570
2591
|
disabled,
|
|
2571
2592
|
className: "w-full text-muted-foreground hover:text-destructive hover:bg-destructive/10 gap-1.5",
|
|
2572
2593
|
children: [
|
|
2573
|
-
/* @__PURE__ */ jsx(
|
|
2594
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "h-3.5 w-3.5" }),
|
|
2574
2595
|
label
|
|
2575
2596
|
]
|
|
2576
2597
|
}
|
|
@@ -2667,7 +2688,7 @@ var DialogContent = React6.forwardRef(({ className, children, ...props }, ref) =
|
|
|
2667
2688
|
children: [
|
|
2668
2689
|
children,
|
|
2669
2690
|
/* @__PURE__ */ jsxs(DialogPrimitive.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: [
|
|
2670
|
-
/* @__PURE__ */ jsx(
|
|
2691
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
2671
2692
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
2672
2693
|
] })
|
|
2673
2694
|
]
|
|
@@ -2690,7 +2711,7 @@ var DialogContentFullscreen = React6.forwardRef(({ className, children, hideClos
|
|
|
2690
2711
|
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: accessibleTitle }),
|
|
2691
2712
|
children,
|
|
2692
2713
|
!hideCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.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: [
|
|
2693
|
-
/* @__PURE__ */ jsx(
|
|
2714
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
2694
2715
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
2695
2716
|
] })
|
|
2696
2717
|
]
|
|
@@ -2964,10 +2985,10 @@ function MediaFieldInner({
|
|
|
2964
2985
|
onClick: handleRemove,
|
|
2965
2986
|
className: "absolute -top-2 -right-2 p-1 bg-destructive text-destructive-foreground rounded-full opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2966
2987
|
"aria-label": "Remove image",
|
|
2967
|
-
children: /* @__PURE__ */ jsx(
|
|
2988
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
2968
2989
|
}
|
|
2969
2990
|
)
|
|
2970
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "w-24 h-24 bg-muted rounded-md border border-dashed border-input flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
2991
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "w-24 h-24 bg-muted rounded-md border border-dashed border-input flex items-center justify-center", children: /* @__PURE__ */ jsx(Image, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
2971
2992
|
!readOnly && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2972
2993
|
/* @__PURE__ */ jsx(
|
|
2973
2994
|
Button,
|
|
@@ -2991,7 +3012,7 @@ function MediaFieldInner({
|
|
|
2991
3012
|
] })
|
|
2992
3013
|
] }),
|
|
2993
3014
|
value?.url && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
2994
|
-
/* @__PURE__ */ jsx(
|
|
3015
|
+
/* @__PURE__ */ jsx(Link, { className: "h-3 w-3 flex-shrink-0" }),
|
|
2995
3016
|
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[280px]", title: value.url, children: value.url })
|
|
2996
3017
|
] })
|
|
2997
3018
|
] }),
|
|
@@ -3036,7 +3057,7 @@ function MediaFieldInner({
|
|
|
3036
3057
|
)
|
|
3037
3058
|
] }),
|
|
3038
3059
|
activeTab === "browse" && /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
|
|
3039
|
-
/* @__PURE__ */ jsx(
|
|
3060
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
3040
3061
|
/* @__PURE__ */ jsx(
|
|
3041
3062
|
Input,
|
|
3042
3063
|
{
|
|
@@ -3082,7 +3103,7 @@ function MediaFieldInner({
|
|
|
3082
3103
|
onClick: handleLoadMore,
|
|
3083
3104
|
disabled: loading,
|
|
3084
3105
|
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3085
|
-
/* @__PURE__ */ jsx(
|
|
3106
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
3086
3107
|
"Loading..."
|
|
3087
3108
|
] }) : "Load More"
|
|
3088
3109
|
}
|
|
@@ -3112,15 +3133,15 @@ function MediaFieldInner({
|
|
|
3112
3133
|
] })
|
|
3113
3134
|
] }),
|
|
3114
3135
|
uploadState.error && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
3115
|
-
/* @__PURE__ */ jsx(
|
|
3136
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
3116
3137
|
/* @__PURE__ */ jsx("span", { children: uploadState.error })
|
|
3117
3138
|
] }),
|
|
3118
3139
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
3119
3140
|
/* @__PURE__ */ jsx(Button, { onClick: handleUpload, disabled: uploadState.uploading, children: uploadState.uploading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3120
|
-
/* @__PURE__ */ jsx(
|
|
3141
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
3121
3142
|
"Uploading..."
|
|
3122
3143
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3123
|
-
/* @__PURE__ */ jsx(
|
|
3144
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-4 w-4 mr-2" }),
|
|
3124
3145
|
"Upload & Select"
|
|
3125
3146
|
] }) }),
|
|
3126
3147
|
/* @__PURE__ */ jsx(
|
|
@@ -3134,7 +3155,7 @@ function MediaFieldInner({
|
|
|
3134
3155
|
)
|
|
3135
3156
|
] })
|
|
3136
3157
|
] }) : /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
3137
|
-
/* @__PURE__ */ jsx(
|
|
3158
|
+
/* @__PURE__ */ jsx(Image, { className: "h-16 w-16 text-muted mx-auto mb-4" }),
|
|
3138
3159
|
/* @__PURE__ */ jsxs("label", { className: "cursor-pointer", children: [
|
|
3139
3160
|
/* @__PURE__ */ jsx(Button, { asChild: true, children: /* @__PURE__ */ jsx("span", { children: "Select Image" }) }),
|
|
3140
3161
|
/* @__PURE__ */ jsx(
|
|
@@ -3154,7 +3175,7 @@ function MediaFieldInner({
|
|
|
3154
3175
|
/* URL Tab */
|
|
3155
3176
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center h-full min-h-[300px]", children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-md space-y-4", children: [
|
|
3156
3177
|
/* @__PURE__ */ jsxs("div", { className: "text-center mb-6", children: [
|
|
3157
|
-
/* @__PURE__ */ jsx(
|
|
3178
|
+
/* @__PURE__ */ jsx(Link, { className: "h-12 w-12 text-muted-foreground mx-auto mb-2" }),
|
|
3158
3179
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Enter an image URL from an external source" })
|
|
3159
3180
|
] }),
|
|
3160
3181
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -3192,10 +3213,10 @@ function MediaFieldInner({
|
|
|
3192
3213
|
onError: handleUrlPreviewError
|
|
3193
3214
|
}
|
|
3194
3215
|
),
|
|
3195
|
-
!urlState.previewLoaded && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx(
|
|
3216
|
+
!urlState.previewLoaded && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx(Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) })
|
|
3196
3217
|
] }),
|
|
3197
3218
|
urlState.error && /* @__PURE__ */ jsxs("div", { className: "p-3 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
3198
|
-
/* @__PURE__ */ jsx(
|
|
3219
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
3199
3220
|
/* @__PURE__ */ jsx("span", { children: urlState.error })
|
|
3200
3221
|
] }),
|
|
3201
3222
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -3205,7 +3226,7 @@ function MediaFieldInner({
|
|
|
3205
3226
|
onClick: handleUrlSubmit,
|
|
3206
3227
|
disabled: !urlState.url || urlState.loading,
|
|
3207
3228
|
children: [
|
|
3208
|
-
/* @__PURE__ */ jsx(
|
|
3229
|
+
/* @__PURE__ */ jsx(Link, { className: "h-4 w-4 mr-2" }),
|
|
3209
3230
|
"Use This URL"
|
|
3210
3231
|
]
|
|
3211
3232
|
}
|
|
@@ -3358,7 +3379,7 @@ function GradientStopEditorInner({
|
|
|
3358
3379
|
onClick: () => onDelete(index),
|
|
3359
3380
|
className: "p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded flex-shrink-0",
|
|
3360
3381
|
title: "Remove stop",
|
|
3361
|
-
children: /* @__PURE__ */ jsx(
|
|
3382
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" })
|
|
3362
3383
|
}
|
|
3363
3384
|
)
|
|
3364
3385
|
] }),
|
|
@@ -3572,7 +3593,7 @@ function GradientEditorInner({ value, onChange, readOnly }) {
|
|
|
3572
3593
|
onClick: handleAddStop,
|
|
3573
3594
|
className: "h-6 text-xs px-2",
|
|
3574
3595
|
children: [
|
|
3575
|
-
/* @__PURE__ */ jsx(
|
|
3596
|
+
/* @__PURE__ */ jsx(Plus, { className: "w-3 h-3 mr-1" }),
|
|
3576
3597
|
"Add Stop"
|
|
3577
3598
|
]
|
|
3578
3599
|
}
|
|
@@ -4061,7 +4082,7 @@ function BackgroundFieldInner({
|
|
|
4061
4082
|
onClick: handleClear,
|
|
4062
4083
|
title: "Clear background",
|
|
4063
4084
|
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",
|
|
4064
|
-
children: /* @__PURE__ */ jsx(
|
|
4085
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
4065
4086
|
}
|
|
4066
4087
|
)
|
|
4067
4088
|
] }),
|
|
@@ -4239,7 +4260,7 @@ function CollapsibleSection({ title, defaultOpen = false, children }) {
|
|
|
4239
4260
|
className: "w-full flex items-center justify-between px-3 py-2 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
4240
4261
|
children: [
|
|
4241
4262
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: title }),
|
|
4242
|
-
isOpen ? /* @__PURE__ */ jsx(
|
|
4263
|
+
isOpen ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
4243
4264
|
]
|
|
4244
4265
|
}
|
|
4245
4266
|
),
|
|
@@ -4373,7 +4394,7 @@ function AnimationFieldInner({
|
|
|
4373
4394
|
onClick: handleClear,
|
|
4374
4395
|
className: "text-muted-foreground hover:text-destructive",
|
|
4375
4396
|
title: "Reset to default",
|
|
4376
|
-
children: /* @__PURE__ */ jsx(
|
|
4397
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4377
4398
|
}
|
|
4378
4399
|
)
|
|
4379
4400
|
] }),
|
|
@@ -4649,11 +4670,11 @@ function createAnimationField(config = {}) {
|
|
|
4649
4670
|
};
|
|
4650
4671
|
}
|
|
4651
4672
|
var BREAKPOINT_ICONS = {
|
|
4652
|
-
|
|
4653
|
-
sm:
|
|
4654
|
-
md:
|
|
4655
|
-
lg:
|
|
4656
|
-
xl:
|
|
4673
|
+
xs: Smartphone,
|
|
4674
|
+
sm: Smartphone,
|
|
4675
|
+
md: Tablet,
|
|
4676
|
+
lg: Laptop,
|
|
4677
|
+
xl: Monitor
|
|
4657
4678
|
};
|
|
4658
4679
|
function BreakpointTab({
|
|
4659
4680
|
breakpoint,
|
|
@@ -4693,17 +4714,17 @@ function ResponsiveFieldInner({
|
|
|
4693
4714
|
renderInnerField,
|
|
4694
4715
|
defaultValue
|
|
4695
4716
|
}) {
|
|
4696
|
-
const [activeBreakpoint, setActiveBreakpoint] = useState("
|
|
4717
|
+
const [activeBreakpoint, setActiveBreakpoint] = useState("xs");
|
|
4697
4718
|
const getCurrentValue = useCallback(() => {
|
|
4698
4719
|
if (!value) return defaultValue ?? null;
|
|
4699
|
-
if (activeBreakpoint === "
|
|
4700
|
-
return value.
|
|
4720
|
+
if (activeBreakpoint === "xs") {
|
|
4721
|
+
return value.xs ?? defaultValue ?? null;
|
|
4701
4722
|
}
|
|
4702
4723
|
const override = value[activeBreakpoint];
|
|
4703
4724
|
if (override !== void 0) {
|
|
4704
4725
|
return override;
|
|
4705
4726
|
}
|
|
4706
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "
|
|
4727
|
+
const breakpointOrder = ["xl", "lg", "md", "sm", "xs"];
|
|
4707
4728
|
const activeIndex = breakpointOrder.indexOf(activeBreakpoint);
|
|
4708
4729
|
for (let i = activeIndex + 1; i < breakpointOrder.length; i++) {
|
|
4709
4730
|
const bp = breakpointOrder[i];
|
|
@@ -4717,18 +4738,18 @@ function ResponsiveFieldInner({
|
|
|
4717
4738
|
const hasOverride = useCallback(
|
|
4718
4739
|
(breakpoint) => {
|
|
4719
4740
|
if (!value) return false;
|
|
4720
|
-
if (breakpoint === "
|
|
4741
|
+
if (breakpoint === "xs") return value.xs !== void 0;
|
|
4721
4742
|
return value[breakpoint] !== void 0;
|
|
4722
4743
|
},
|
|
4723
4744
|
[value]
|
|
4724
4745
|
);
|
|
4725
4746
|
const handleInnerChange = useCallback(
|
|
4726
4747
|
(newValue) => {
|
|
4727
|
-
if (activeBreakpoint === "
|
|
4748
|
+
if (activeBreakpoint === "xs") {
|
|
4728
4749
|
if (newValue === null && defaultValue !== void 0) {
|
|
4729
|
-
onChange({ ...value,
|
|
4750
|
+
onChange({ ...value, xs: defaultValue });
|
|
4730
4751
|
} else if (newValue !== null) {
|
|
4731
|
-
onChange({ ...value,
|
|
4752
|
+
onChange({ ...value, xs: newValue });
|
|
4732
4753
|
}
|
|
4733
4754
|
} else {
|
|
4734
4755
|
if (newValue === null) {
|
|
@@ -4736,11 +4757,11 @@ function ResponsiveFieldInner({
|
|
|
4736
4757
|
delete newResponsive[activeBreakpoint];
|
|
4737
4758
|
onChange(newResponsive);
|
|
4738
4759
|
} else {
|
|
4739
|
-
const
|
|
4740
|
-
if (
|
|
4760
|
+
const xs = value?.xs ?? defaultValue;
|
|
4761
|
+
if (xs === void 0) return;
|
|
4741
4762
|
onChange({
|
|
4742
4763
|
...value,
|
|
4743
|
-
|
|
4764
|
+
xs,
|
|
4744
4765
|
[activeBreakpoint]: newValue
|
|
4745
4766
|
});
|
|
4746
4767
|
}
|
|
@@ -4749,7 +4770,7 @@ function ResponsiveFieldInner({
|
|
|
4749
4770
|
[value, onChange, activeBreakpoint, defaultValue]
|
|
4750
4771
|
);
|
|
4751
4772
|
const handleClearOverride = useCallback(() => {
|
|
4752
|
-
if (activeBreakpoint === "
|
|
4773
|
+
if (activeBreakpoint === "xs" || !value) return;
|
|
4753
4774
|
const newResponsive = { ...value };
|
|
4754
4775
|
delete newResponsive[activeBreakpoint];
|
|
4755
4776
|
onChange(newResponsive);
|
|
@@ -4758,7 +4779,7 @@ function ResponsiveFieldInner({
|
|
|
4758
4779
|
onChange(null);
|
|
4759
4780
|
}, [onChange]);
|
|
4760
4781
|
const currentValue = getCurrentValue();
|
|
4761
|
-
const isOverrideBreakpoint = activeBreakpoint !== "
|
|
4782
|
+
const isOverrideBreakpoint = activeBreakpoint !== "xs";
|
|
4762
4783
|
const currentHasOverride = hasOverride(activeBreakpoint);
|
|
4763
4784
|
const overrideCount = value ? ["sm", "md", "lg", "xl"].filter((bp) => value[bp] !== void 0).length : 0;
|
|
4764
4785
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-3", children: [
|
|
@@ -4780,7 +4801,7 @@ function ResponsiveFieldInner({
|
|
|
4780
4801
|
onClick: handleClearAll,
|
|
4781
4802
|
className: "text-muted-foreground hover:text-destructive",
|
|
4782
4803
|
title: "Clear all values",
|
|
4783
|
-
children: /* @__PURE__ */ jsx(
|
|
4804
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4784
4805
|
}
|
|
4785
4806
|
)
|
|
4786
4807
|
] }),
|
|
@@ -4798,10 +4819,10 @@ function ResponsiveFieldInner({
|
|
|
4798
4819
|
bp.key
|
|
4799
4820
|
)) }),
|
|
4800
4821
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
4801
|
-
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "
|
|
4822
|
+
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "xs" ? "Extra small screens (0-639px)" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4802
4823
|
BREAKPOINTS.find((bp) => bp.key === activeBreakpoint)?.minWidth,
|
|
4803
4824
|
"px and up",
|
|
4804
|
-
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from
|
|
4825
|
+
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from xs)" })
|
|
4805
4826
|
] }) }),
|
|
4806
4827
|
isOverrideBreakpoint && currentHasOverride && !readOnly && /* @__PURE__ */ jsx(
|
|
4807
4828
|
Button,
|
|
@@ -4854,18 +4875,17 @@ function createResponsiveField(config) {
|
|
|
4854
4875
|
};
|
|
4855
4876
|
}
|
|
4856
4877
|
var BREAKPOINT_ICONS2 = {
|
|
4857
|
-
|
|
4858
|
-
sm:
|
|
4859
|
-
md:
|
|
4860
|
-
lg:
|
|
4861
|
-
xl:
|
|
4878
|
+
xs: Smartphone,
|
|
4879
|
+
sm: Smartphone,
|
|
4880
|
+
md: Tablet,
|
|
4881
|
+
lg: Laptop,
|
|
4882
|
+
xl: Monitor
|
|
4862
4883
|
};
|
|
4863
4884
|
function VisibilityToggle({
|
|
4864
4885
|
breakpoint,
|
|
4865
4886
|
label,
|
|
4866
4887
|
minWidth,
|
|
4867
4888
|
isVisible,
|
|
4868
|
-
isInherited,
|
|
4869
4889
|
onClick,
|
|
4870
4890
|
disabled
|
|
4871
4891
|
}) {
|
|
@@ -4876,18 +4896,16 @@ function VisibilityToggle({
|
|
|
4876
4896
|
type: "button",
|
|
4877
4897
|
onClick,
|
|
4878
4898
|
disabled,
|
|
4879
|
-
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}
|
|
4899
|
+
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}`,
|
|
4880
4900
|
className: cn2(
|
|
4881
4901
|
"relative flex flex-col items-center justify-center gap-0.5 p-2 rounded-md transition-all flex-1 min-w-[52px]",
|
|
4882
|
-
isVisible ? "bg-emerald-500/
|
|
4883
|
-
isInherited && "opacity-60",
|
|
4902
|
+
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",
|
|
4884
4903
|
disabled && "opacity-50 cursor-not-allowed"
|
|
4885
4904
|
),
|
|
4886
4905
|
children: [
|
|
4887
4906
|
/* @__PURE__ */ jsx(DeviceIcon, { className: "h-4 w-4" }),
|
|
4888
4907
|
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium", children: label }),
|
|
4889
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsx(
|
|
4890
|
-
isInherited && /* @__PURE__ */ jsx("span", { className: "absolute -bottom-0.5 left-1/2 -translate-x-1/2 text-[8px] text-muted-foreground", children: "\u2022" })
|
|
4908
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsx(Eye, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(EyeOff, { className: "h-3 w-3" }) })
|
|
4891
4909
|
]
|
|
4892
4910
|
}
|
|
4893
4911
|
);
|
|
@@ -4898,85 +4916,46 @@ function ResponsiveVisibilityFieldInner({
|
|
|
4898
4916
|
label,
|
|
4899
4917
|
readOnly
|
|
4900
4918
|
}) {
|
|
4901
|
-
const
|
|
4919
|
+
const getVisibility = useCallback(
|
|
4902
4920
|
(breakpoint) => {
|
|
4903
4921
|
const val = value ?? DEFAULT_VISIBILITY;
|
|
4904
|
-
|
|
4905
|
-
return { visible: val.base, inherited: false };
|
|
4906
|
-
}
|
|
4907
|
-
const explicitValue = val[breakpoint];
|
|
4908
|
-
if (explicitValue !== void 0) {
|
|
4909
|
-
return { visible: explicitValue, inherited: false };
|
|
4910
|
-
}
|
|
4911
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "base"];
|
|
4912
|
-
const currentIndex = breakpointOrder.indexOf(breakpoint);
|
|
4913
|
-
for (let i = currentIndex + 1; i < breakpointOrder.length; i++) {
|
|
4914
|
-
const bp = breakpointOrder[i];
|
|
4915
|
-
const bpValue = val[bp];
|
|
4916
|
-
if (bpValue !== void 0) {
|
|
4917
|
-
return { visible: bpValue, inherited: true };
|
|
4918
|
-
}
|
|
4919
|
-
}
|
|
4920
|
-
return { visible: val.base, inherited: true };
|
|
4922
|
+
return val[breakpoint] ?? true;
|
|
4921
4923
|
},
|
|
4922
4924
|
[value]
|
|
4923
4925
|
);
|
|
4924
4926
|
const toggleVisibility = useCallback(
|
|
4925
4927
|
(breakpoint) => {
|
|
4926
|
-
const
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
});
|
|
4933
|
-
} else {
|
|
4934
|
-
const newValue = {
|
|
4935
|
-
...value ?? DEFAULT_VISIBILITY,
|
|
4936
|
-
[breakpoint]: newVisible
|
|
4937
|
-
};
|
|
4938
|
-
onChange(newValue);
|
|
4939
|
-
}
|
|
4928
|
+
const currentVisible = getVisibility(breakpoint);
|
|
4929
|
+
const newValue = {
|
|
4930
|
+
...value ?? DEFAULT_VISIBILITY,
|
|
4931
|
+
[breakpoint]: !currentVisible
|
|
4932
|
+
};
|
|
4933
|
+
onChange(newValue);
|
|
4940
4934
|
},
|
|
4941
|
-
[value, onChange,
|
|
4935
|
+
[value, onChange, getVisibility]
|
|
4942
4936
|
);
|
|
4943
|
-
const
|
|
4944
|
-
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => {
|
|
4945
|
-
const { visible } = getEffectiveVisibility(bp.key);
|
|
4946
|
-
return !visible;
|
|
4947
|
-
});
|
|
4937
|
+
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => !getVisibility(bp.key));
|
|
4948
4938
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
4949
4939
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4950
|
-
label && /* @__PURE__ */
|
|
4951
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
4952
|
-
overrideCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: [
|
|
4953
|
-
overrideCount,
|
|
4954
|
-
" override",
|
|
4955
|
-
overrideCount !== 1 ? "s" : ""
|
|
4956
|
-
] })
|
|
4957
|
-
] }),
|
|
4940
|
+
label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
4958
4941
|
hasHiddenBreakpoints && /* @__PURE__ */ jsxs("span", { className: "text-xs text-amber-600 flex items-center gap-1", children: [
|
|
4959
|
-
/* @__PURE__ */ jsx(
|
|
4960
|
-
"
|
|
4942
|
+
/* @__PURE__ */ jsx(EyeOff, { className: "h-3 w-3" }),
|
|
4943
|
+
"Partially hidden"
|
|
4961
4944
|
] })
|
|
4962
4945
|
] }),
|
|
4963
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) =>
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
bp.key
|
|
4977
|
-
);
|
|
4978
|
-
}) }),
|
|
4979
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Click to toggle visibility. Changes cascade to larger breakpoints." })
|
|
4946
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) => /* @__PURE__ */ jsx(
|
|
4947
|
+
VisibilityToggle,
|
|
4948
|
+
{
|
|
4949
|
+
breakpoint: bp.key,
|
|
4950
|
+
label: bp.label,
|
|
4951
|
+
minWidth: bp.minWidth,
|
|
4952
|
+
isVisible: getVisibility(bp.key),
|
|
4953
|
+
onClick: () => toggleVisibility(bp.key),
|
|
4954
|
+
disabled: readOnly
|
|
4955
|
+
},
|
|
4956
|
+
bp.key
|
|
4957
|
+
)) }),
|
|
4958
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Toggle visibility per screen size. Each breakpoint is independent." })
|
|
4980
4959
|
] });
|
|
4981
4960
|
}
|
|
4982
4961
|
var ResponsiveVisibilityField = memo(ResponsiveVisibilityFieldInner);
|
|
@@ -5159,11 +5138,11 @@ function JustifyContentFieldInner({
|
|
|
5159
5138
|
onChange(null);
|
|
5160
5139
|
}, [onChange]);
|
|
5161
5140
|
const options = [
|
|
5162
|
-
{ value: "flex-start", icon:
|
|
5163
|
-
{ value: "center", icon:
|
|
5164
|
-
{ value: "flex-end", icon:
|
|
5165
|
-
{ value: "space-between", icon:
|
|
5166
|
-
{ value: "space-around", icon:
|
|
5141
|
+
{ value: "flex-start", icon: AlignLeft, title: "Start" },
|
|
5142
|
+
{ value: "center", icon: AlignCenter, title: "Center" },
|
|
5143
|
+
{ value: "flex-end", icon: AlignRight, title: "End" },
|
|
5144
|
+
{ value: "space-between", icon: AlignHorizontalDistributeCenter, title: "Space Between" },
|
|
5145
|
+
{ value: "space-around", icon: GripHorizontal, title: "Space Around" }
|
|
5167
5146
|
];
|
|
5168
5147
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5169
5148
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5177,7 +5156,7 @@ function JustifyContentFieldInner({
|
|
|
5177
5156
|
onClick: handleClear,
|
|
5178
5157
|
className: "text-muted-foreground hover:text-destructive",
|
|
5179
5158
|
title: "Reset to default",
|
|
5180
|
-
children: /* @__PURE__ */ jsx(
|
|
5159
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5181
5160
|
}
|
|
5182
5161
|
)
|
|
5183
5162
|
] }),
|
|
@@ -5219,10 +5198,10 @@ function AlignItemsFieldInner({
|
|
|
5219
5198
|
onChange(null);
|
|
5220
5199
|
}, [onChange]);
|
|
5221
5200
|
const options = [
|
|
5222
|
-
{ value: "flex-start", icon:
|
|
5223
|
-
{ value: "center", icon:
|
|
5224
|
-
{ value: "flex-end", icon:
|
|
5225
|
-
{ value: "stretch", icon:
|
|
5201
|
+
{ value: "flex-start", icon: AlignStartVertical, title: "Start" },
|
|
5202
|
+
{ value: "center", icon: AlignCenterVertical, title: "Center" },
|
|
5203
|
+
{ value: "flex-end", icon: AlignEndVertical, title: "End" },
|
|
5204
|
+
{ value: "stretch", icon: MoveVertical, title: "Stretch" }
|
|
5226
5205
|
];
|
|
5227
5206
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5228
5207
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5236,7 +5215,7 @@ function AlignItemsFieldInner({
|
|
|
5236
5215
|
onClick: handleClear,
|
|
5237
5216
|
className: "text-muted-foreground hover:text-destructive",
|
|
5238
5217
|
title: "Reset to default",
|
|
5239
|
-
children: /* @__PURE__ */ jsx(
|
|
5218
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5240
5219
|
}
|
|
5241
5220
|
)
|
|
5242
5221
|
] }),
|
|
@@ -6132,7 +6111,7 @@ function TemplateFieldInner({
|
|
|
6132
6111
|
onClick: handleClearTemplate,
|
|
6133
6112
|
title: "Clear selection",
|
|
6134
6113
|
className: "text-muted-foreground hover:text-foreground",
|
|
6135
|
-
children: /* @__PURE__ */ jsx(
|
|
6114
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6136
6115
|
}
|
|
6137
6116
|
)
|
|
6138
6117
|
] }),
|
|
@@ -6146,7 +6125,7 @@ function TemplateFieldInner({
|
|
|
6146
6125
|
className: "flex-1 gap-1.5",
|
|
6147
6126
|
disabled: loading || saveForm.saving,
|
|
6148
6127
|
children: [
|
|
6149
|
-
saveForm.expanded ? /* @__PURE__ */ jsx(
|
|
6128
|
+
saveForm.expanded ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }),
|
|
6150
6129
|
saveForm.expanded ? "Cancel" : "Save as Template"
|
|
6151
6130
|
]
|
|
6152
6131
|
}
|
|
@@ -6160,7 +6139,7 @@ function TemplateFieldInner({
|
|
|
6160
6139
|
className: "gap-1.5",
|
|
6161
6140
|
disabled: loadingTemplate,
|
|
6162
6141
|
children: [
|
|
6163
|
-
loadingTemplate ? /* @__PURE__ */ jsx(
|
|
6142
|
+
loadingTemplate ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }),
|
|
6164
6143
|
"Reload"
|
|
6165
6144
|
]
|
|
6166
6145
|
}
|
|
@@ -6210,7 +6189,7 @@ function TemplateFieldInner({
|
|
|
6210
6189
|
)
|
|
6211
6190
|
] }),
|
|
6212
6191
|
saveForm.error && /* @__PURE__ */ jsxs("div", { className: "p-2 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-xs flex items-start gap-2", children: [
|
|
6213
|
-
/* @__PURE__ */ jsx(
|
|
6192
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-3.5 w-3.5 flex-shrink-0 mt-0.5" }),
|
|
6214
6193
|
/* @__PURE__ */ jsx("span", { children: saveForm.error })
|
|
6215
6194
|
] }),
|
|
6216
6195
|
/* @__PURE__ */ jsx(
|
|
@@ -6221,17 +6200,17 @@ function TemplateFieldInner({
|
|
|
6221
6200
|
size: "sm",
|
|
6222
6201
|
className: "w-full gap-1.5",
|
|
6223
6202
|
children: saveForm.saving ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6224
|
-
/* @__PURE__ */ jsx(
|
|
6203
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
6225
6204
|
"Saving..."
|
|
6226
6205
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6227
|
-
/* @__PURE__ */ jsx(
|
|
6206
|
+
/* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }),
|
|
6228
6207
|
"Save Template"
|
|
6229
6208
|
] })
|
|
6230
6209
|
}
|
|
6231
6210
|
)
|
|
6232
6211
|
] }),
|
|
6233
6212
|
error && /* @__PURE__ */ jsxs("div", { className: "p-2 bg-destructive/10 border border-destructive/30 rounded-md text-destructive text-sm flex items-start gap-2", children: [
|
|
6234
|
-
/* @__PURE__ */ jsx(
|
|
6213
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
6235
6214
|
/* @__PURE__ */ jsx("span", { children: error })
|
|
6236
6215
|
] })
|
|
6237
6216
|
] });
|
|
@@ -6444,9 +6423,9 @@ function AlignmentFieldInner({
|
|
|
6444
6423
|
onChange(null);
|
|
6445
6424
|
}, [onChange]);
|
|
6446
6425
|
const alignments = [
|
|
6447
|
-
{ value: "left", icon:
|
|
6448
|
-
{ value: "center", icon:
|
|
6449
|
-
{ value: "right", icon:
|
|
6426
|
+
{ value: "left", icon: AlignLeft, title: "Align left" },
|
|
6427
|
+
{ value: "center", icon: AlignCenter, title: "Align center" },
|
|
6428
|
+
{ value: "right", icon: AlignRight, title: "Align right" }
|
|
6450
6429
|
];
|
|
6451
6430
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
6452
6431
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -6460,7 +6439,7 @@ function AlignmentFieldInner({
|
|
|
6460
6439
|
onClick: handleClear,
|
|
6461
6440
|
className: "text-muted-foreground hover:text-destructive",
|
|
6462
6441
|
title: "Reset to default",
|
|
6463
|
-
children: /* @__PURE__ */ jsx(
|
|
6442
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6464
6443
|
}
|
|
6465
6444
|
)
|
|
6466
6445
|
] }),
|
|
@@ -7009,8 +6988,8 @@ function createTiptapExtensions() {
|
|
|
7009
6988
|
multicolor: true
|
|
7010
6989
|
}),
|
|
7011
6990
|
FontSize,
|
|
7012
|
-
Superscript,
|
|
7013
|
-
Subscript
|
|
6991
|
+
Superscript$1,
|
|
6992
|
+
Subscript$1
|
|
7014
6993
|
];
|
|
7015
6994
|
}
|
|
7016
6995
|
function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
@@ -7116,7 +7095,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7116
7095
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
7117
7096
|
isActive: formattingState?.isBold,
|
|
7118
7097
|
title: "Bold",
|
|
7119
|
-
children: /* @__PURE__ */ jsx(
|
|
7098
|
+
children: /* @__PURE__ */ jsx(Bold, { className: ICON_SIZE })
|
|
7120
7099
|
}
|
|
7121
7100
|
),
|
|
7122
7101
|
/* @__PURE__ */ jsx(
|
|
@@ -7125,7 +7104,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7125
7104
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
7126
7105
|
isActive: formattingState?.isItalic,
|
|
7127
7106
|
title: "Italic",
|
|
7128
|
-
children: /* @__PURE__ */ jsx(
|
|
7107
|
+
children: /* @__PURE__ */ jsx(Italic, { className: ICON_SIZE })
|
|
7129
7108
|
}
|
|
7130
7109
|
),
|
|
7131
7110
|
/* @__PURE__ */ jsx(
|
|
@@ -7134,7 +7113,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7134
7113
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
7135
7114
|
isActive: formattingState?.isUnderline,
|
|
7136
7115
|
title: "Underline",
|
|
7137
|
-
children: /* @__PURE__ */ jsx(
|
|
7116
|
+
children: /* @__PURE__ */ jsx(Underline, { className: ICON_SIZE })
|
|
7138
7117
|
}
|
|
7139
7118
|
),
|
|
7140
7119
|
/* @__PURE__ */ jsx(
|
|
@@ -7143,7 +7122,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7143
7122
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
7144
7123
|
isActive: formattingState?.isStrike,
|
|
7145
7124
|
title: "Strikethrough",
|
|
7146
|
-
children: /* @__PURE__ */ jsx(
|
|
7125
|
+
children: /* @__PURE__ */ jsx(Strikethrough, { className: ICON_SIZE })
|
|
7147
7126
|
}
|
|
7148
7127
|
),
|
|
7149
7128
|
/* @__PURE__ */ jsx(
|
|
@@ -7152,7 +7131,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7152
7131
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
7153
7132
|
isActive: formattingState?.isSuperscript,
|
|
7154
7133
|
title: "Superscript",
|
|
7155
|
-
children: /* @__PURE__ */ jsx(
|
|
7134
|
+
children: /* @__PURE__ */ jsx(Superscript, { className: ICON_SIZE })
|
|
7156
7135
|
}
|
|
7157
7136
|
),
|
|
7158
7137
|
/* @__PURE__ */ jsx(
|
|
@@ -7161,7 +7140,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7161
7140
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
7162
7141
|
isActive: formattingState?.isSubscript,
|
|
7163
7142
|
title: "Subscript",
|
|
7164
|
-
children: /* @__PURE__ */ jsx(
|
|
7143
|
+
children: /* @__PURE__ */ jsx(Subscript, { className: ICON_SIZE })
|
|
7165
7144
|
}
|
|
7166
7145
|
),
|
|
7167
7146
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7169,8 +7148,8 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7169
7148
|
ToolbarDropdown,
|
|
7170
7149
|
{
|
|
7171
7150
|
trigger: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
7172
|
-
formattingState?.isH1 ? /* @__PURE__ */ jsx(
|
|
7173
|
-
/* @__PURE__ */ jsx(
|
|
7151
|
+
formattingState?.isH1 ? /* @__PURE__ */ jsx(Heading1, { className: ICON_SIZE }) : formattingState?.isH2 ? /* @__PURE__ */ jsx(Heading2, { className: ICON_SIZE }) : formattingState?.isH3 ? /* @__PURE__ */ jsx(Heading3, { className: ICON_SIZE }) : formattingState?.isH4 ? /* @__PURE__ */ jsx(Heading4, { className: ICON_SIZE }) : formattingState?.isH5 ? /* @__PURE__ */ jsx(Heading5, { className: ICON_SIZE }) : formattingState?.isH6 ? /* @__PURE__ */ jsx(Heading6, { className: ICON_SIZE }) : /* @__PURE__ */ jsx(Pilcrow, { className: ICON_SIZE }),
|
|
7152
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3" })
|
|
7174
7153
|
] }),
|
|
7175
7154
|
title: "Text Type",
|
|
7176
7155
|
isActive: formattingState?.isH1 || formattingState?.isH2 || formattingState?.isH3 || formattingState?.isH4 || formattingState?.isH5 || formattingState?.isH6,
|
|
@@ -7179,7 +7158,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7179
7158
|
editor.chain().focus().setParagraph().run();
|
|
7180
7159
|
close();
|
|
7181
7160
|
}, children: [
|
|
7182
|
-
/* @__PURE__ */ jsx(
|
|
7161
|
+
/* @__PURE__ */ jsx(Pilcrow, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7183
7162
|
"Paragraph"
|
|
7184
7163
|
] }),
|
|
7185
7164
|
/* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
@@ -7187,42 +7166,42 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7187
7166
|
editor.chain().focus().toggleHeading({ level: 1 }).run();
|
|
7188
7167
|
close();
|
|
7189
7168
|
}, children: [
|
|
7190
|
-
/* @__PURE__ */ jsx(
|
|
7169
|
+
/* @__PURE__ */ jsx(Heading1, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7191
7170
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-lg", children: "Heading 1" })
|
|
7192
7171
|
] }),
|
|
7193
7172
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7194
7173
|
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
|
7195
7174
|
close();
|
|
7196
7175
|
}, children: [
|
|
7197
|
-
/* @__PURE__ */ jsx(
|
|
7176
|
+
/* @__PURE__ */ jsx(Heading2, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7198
7177
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-base", children: "Heading 2" })
|
|
7199
7178
|
] }),
|
|
7200
7179
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7201
7180
|
editor.chain().focus().toggleHeading({ level: 3 }).run();
|
|
7202
7181
|
close();
|
|
7203
7182
|
}, children: [
|
|
7204
|
-
/* @__PURE__ */ jsx(
|
|
7183
|
+
/* @__PURE__ */ jsx(Heading3, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7205
7184
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Heading 3" })
|
|
7206
7185
|
] }),
|
|
7207
7186
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7208
7187
|
editor.chain().focus().toggleHeading({ level: 4 }).run();
|
|
7209
7188
|
close();
|
|
7210
7189
|
}, children: [
|
|
7211
|
-
/* @__PURE__ */ jsx(
|
|
7190
|
+
/* @__PURE__ */ jsx(Heading4, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7212
7191
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: "Heading 4" })
|
|
7213
7192
|
] }),
|
|
7214
7193
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7215
7194
|
editor.chain().focus().toggleHeading({ level: 5 }).run();
|
|
7216
7195
|
close();
|
|
7217
7196
|
}, children: [
|
|
7218
|
-
/* @__PURE__ */ jsx(
|
|
7197
|
+
/* @__PURE__ */ jsx(Heading5, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7219
7198
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs", children: "Heading 5" })
|
|
7220
7199
|
] }),
|
|
7221
7200
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7222
7201
|
editor.chain().focus().toggleHeading({ level: 6 }).run();
|
|
7223
7202
|
close();
|
|
7224
7203
|
}, children: [
|
|
7225
|
-
/* @__PURE__ */ jsx(
|
|
7204
|
+
/* @__PURE__ */ jsx(Heading6, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7226
7205
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs text-gray-600", children: "Heading 6" })
|
|
7227
7206
|
] })
|
|
7228
7207
|
] })
|
|
@@ -7232,7 +7211,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7232
7211
|
/* @__PURE__ */ jsx(
|
|
7233
7212
|
ToolbarDropdown,
|
|
7234
7213
|
{
|
|
7235
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7214
|
+
trigger: /* @__PURE__ */ jsx(ALargeSmall, { className: ICON_SIZE }),
|
|
7236
7215
|
title: "Font Size",
|
|
7237
7216
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7238
7217
|
/* @__PURE__ */ jsx(DropdownLabel, { children: "Presets" }),
|
|
@@ -7318,7 +7297,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7318
7297
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
7319
7298
|
isActive: formattingState?.isBulletList,
|
|
7320
7299
|
title: "Bullet List",
|
|
7321
|
-
children: /* @__PURE__ */ jsx(
|
|
7300
|
+
children: /* @__PURE__ */ jsx(List, { className: ICON_SIZE })
|
|
7322
7301
|
}
|
|
7323
7302
|
),
|
|
7324
7303
|
/* @__PURE__ */ jsx(
|
|
@@ -7327,7 +7306,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7327
7306
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
7328
7307
|
isActive: formattingState?.isOrderedList,
|
|
7329
7308
|
title: "Numbered List",
|
|
7330
|
-
children: /* @__PURE__ */ jsx(
|
|
7309
|
+
children: /* @__PURE__ */ jsx(ListOrdered, { className: ICON_SIZE })
|
|
7331
7310
|
}
|
|
7332
7311
|
),
|
|
7333
7312
|
/* @__PURE__ */ jsx(
|
|
@@ -7336,7 +7315,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7336
7315
|
onClick: () => editor.chain().focus().toggleBlockquote().run(),
|
|
7337
7316
|
isActive: formattingState?.isBlockquote,
|
|
7338
7317
|
title: "Blockquote",
|
|
7339
|
-
children: /* @__PURE__ */ jsx(
|
|
7318
|
+
children: /* @__PURE__ */ jsx(Quote, { className: ICON_SIZE })
|
|
7340
7319
|
}
|
|
7341
7320
|
),
|
|
7342
7321
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7346,7 +7325,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7346
7325
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
7347
7326
|
isActive: formattingState?.isAlignLeft,
|
|
7348
7327
|
title: "Align Left",
|
|
7349
|
-
children: /* @__PURE__ */ jsx(
|
|
7328
|
+
children: /* @__PURE__ */ jsx(AlignLeft, { className: ICON_SIZE })
|
|
7350
7329
|
}
|
|
7351
7330
|
),
|
|
7352
7331
|
/* @__PURE__ */ jsx(
|
|
@@ -7355,7 +7334,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7355
7334
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
7356
7335
|
isActive: formattingState?.isAlignCenter,
|
|
7357
7336
|
title: "Align Center",
|
|
7358
|
-
children: /* @__PURE__ */ jsx(
|
|
7337
|
+
children: /* @__PURE__ */ jsx(AlignCenter, { className: ICON_SIZE })
|
|
7359
7338
|
}
|
|
7360
7339
|
),
|
|
7361
7340
|
/* @__PURE__ */ jsx(
|
|
@@ -7364,7 +7343,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7364
7343
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
7365
7344
|
isActive: formattingState?.isAlignRight,
|
|
7366
7345
|
title: "Align Right",
|
|
7367
|
-
children: /* @__PURE__ */ jsx(
|
|
7346
|
+
children: /* @__PURE__ */ jsx(AlignRight, { className: ICON_SIZE })
|
|
7368
7347
|
}
|
|
7369
7348
|
),
|
|
7370
7349
|
/* @__PURE__ */ jsx(
|
|
@@ -7373,7 +7352,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7373
7352
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
7374
7353
|
isActive: formattingState?.isAlignJustify,
|
|
7375
7354
|
title: "Justify",
|
|
7376
|
-
children: /* @__PURE__ */ jsx(
|
|
7355
|
+
children: /* @__PURE__ */ jsx(AlignJustify, { className: ICON_SIZE })
|
|
7377
7356
|
}
|
|
7378
7357
|
),
|
|
7379
7358
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7384,7 +7363,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7384
7363
|
onClick: () => setIsLinkPopoverOpen(!isLinkPopoverOpen),
|
|
7385
7364
|
isActive: formattingState?.isLink,
|
|
7386
7365
|
title: "Add Link",
|
|
7387
|
-
children: /* @__PURE__ */ jsx(
|
|
7366
|
+
children: /* @__PURE__ */ jsx(Link, { className: ICON_SIZE })
|
|
7388
7367
|
}
|
|
7389
7368
|
),
|
|
7390
7369
|
/* @__PURE__ */ jsx(
|
|
@@ -7400,7 +7379,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7400
7379
|
/* @__PURE__ */ jsx(
|
|
7401
7380
|
ToolbarDropdown,
|
|
7402
7381
|
{
|
|
7403
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7382
|
+
trigger: /* @__PURE__ */ jsx(Palette, { className: ICON_SIZE }),
|
|
7404
7383
|
title: "Text Color",
|
|
7405
7384
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7406
7385
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
@@ -7457,7 +7436,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7457
7436
|
/* @__PURE__ */ jsx(
|
|
7458
7437
|
ToolbarDropdown,
|
|
7459
7438
|
{
|
|
7460
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7439
|
+
trigger: /* @__PURE__ */ jsx(Highlighter, { className: ICON_SIZE }),
|
|
7461
7440
|
title: "Highlight",
|
|
7462
7441
|
isActive: formattingState?.isHighlight,
|
|
7463
7442
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7488,7 +7467,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7488
7467
|
{
|
|
7489
7468
|
onClick: () => editor.chain().focus().setHorizontalRule().run(),
|
|
7490
7469
|
title: "Horizontal Rule",
|
|
7491
|
-
children: /* @__PURE__ */ jsx(
|
|
7470
|
+
children: /* @__PURE__ */ jsx(Minus, { className: ICON_SIZE })
|
|
7492
7471
|
}
|
|
7493
7472
|
),
|
|
7494
7473
|
/* @__PURE__ */ jsx(
|
|
@@ -7496,7 +7475,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7496
7475
|
{
|
|
7497
7476
|
onClick: () => editor.chain().focus().setHardBreak().run(),
|
|
7498
7477
|
title: "Hard Break (Shift+Enter)",
|
|
7499
|
-
children: /* @__PURE__ */ jsx(
|
|
7478
|
+
children: /* @__PURE__ */ jsx(CornerDownLeft, { className: ICON_SIZE })
|
|
7500
7479
|
}
|
|
7501
7480
|
),
|
|
7502
7481
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7505,7 +7484,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7505
7484
|
{
|
|
7506
7485
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
7507
7486
|
title: "Clear Formatting",
|
|
7508
|
-
children: /* @__PURE__ */ jsx(
|
|
7487
|
+
children: /* @__PURE__ */ jsx(RemoveFormatting, { className: ICON_SIZE })
|
|
7509
7488
|
}
|
|
7510
7489
|
),
|
|
7511
7490
|
/* @__PURE__ */ jsxs(
|
|
@@ -7528,7 +7507,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7528
7507
|
!showSource && "bg-transparent"
|
|
7529
7508
|
),
|
|
7530
7509
|
children: [
|
|
7531
|
-
/* @__PURE__ */ jsx(
|
|
7510
|
+
/* @__PURE__ */ jsx(Code, { className: ICON_SIZE }),
|
|
7532
7511
|
"Source"
|
|
7533
7512
|
]
|
|
7534
7513
|
}
|
|
@@ -7642,7 +7621,7 @@ function TiptapModal({ isOpen, onClose, value, onChange, title }) {
|
|
|
7642
7621
|
justifyContent: "center"
|
|
7643
7622
|
},
|
|
7644
7623
|
title: "Close (Esc)",
|
|
7645
|
-
children: /* @__PURE__ */ jsx(
|
|
7624
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
7646
7625
|
}
|
|
7647
7626
|
)
|
|
7648
7627
|
]
|
|
@@ -7769,7 +7748,7 @@ function TiptapModalFieldInner({ value, onChange, label }) {
|
|
|
7769
7748
|
},
|
|
7770
7749
|
title: "Open full-screen editor",
|
|
7771
7750
|
children: [
|
|
7772
|
-
/* @__PURE__ */ jsx(
|
|
7751
|
+
/* @__PURE__ */ jsx(Maximize2, { size: 14 }),
|
|
7773
7752
|
"Expand"
|
|
7774
7753
|
]
|
|
7775
7754
|
}
|
|
@@ -8000,7 +7979,7 @@ function TransformFieldInner({
|
|
|
8000
7979
|
onClick: handleClear,
|
|
8001
7980
|
className: "text-muted-foreground hover:text-destructive",
|
|
8002
7981
|
title: "Reset transform",
|
|
8003
|
-
children: /* @__PURE__ */ jsx(
|
|
7982
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
8004
7983
|
}
|
|
8005
7984
|
)
|
|
8006
7985
|
] }),
|
|
@@ -8014,7 +7993,7 @@ function TransformFieldInner({
|
|
|
8014
7993
|
) }),
|
|
8015
7994
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2 p-3 bg-muted/30 rounded-md", children: [
|
|
8016
7995
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
8017
|
-
/* @__PURE__ */ jsx(
|
|
7996
|
+
/* @__PURE__ */ jsx(RotateCw, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8018
7997
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Rotate" })
|
|
8019
7998
|
] }),
|
|
8020
7999
|
/* @__PURE__ */ jsx(
|
|
@@ -8032,7 +8011,7 @@ function TransformFieldInner({
|
|
|
8032
8011
|
/* @__PURE__ */ jsxs("div", { className: "space-y-3 p-3 bg-muted/30 rounded-md", children: [
|
|
8033
8012
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8034
8013
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8035
|
-
/* @__PURE__ */ jsx(
|
|
8014
|
+
/* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8036
8015
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Scale" })
|
|
8037
8016
|
] }),
|
|
8038
8017
|
!readOnly && /* @__PURE__ */ jsx(
|
|
@@ -8044,7 +8023,7 @@ function TransformFieldInner({
|
|
|
8044
8023
|
onClick: handleScaleLockToggle,
|
|
8045
8024
|
className: "h-6 w-6",
|
|
8046
8025
|
title: currentValue.scaleLocked ? "Click to unlink X and Y scale" : "Click to link X and Y scale",
|
|
8047
|
-
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(
|
|
8026
|
+
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(Link, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-3 w-3" })
|
|
8048
8027
|
}
|
|
8049
8028
|
)
|
|
8050
8029
|
] }),
|
|
@@ -8176,10 +8155,10 @@ function TransformFieldInner({
|
|
|
8176
8155
|
className: "w-full flex items-center justify-between p-3 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
8177
8156
|
children: [
|
|
8178
8157
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8179
|
-
/* @__PURE__ */ jsx(
|
|
8158
|
+
/* @__PURE__ */ jsx(Box, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8180
8159
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium cursor-pointer", children: "3D Transforms" })
|
|
8181
8160
|
] }),
|
|
8182
|
-
show3D ? /* @__PURE__ */ jsx(
|
|
8161
|
+
show3D ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
8183
8162
|
]
|
|
8184
8163
|
}
|
|
8185
8164
|
),
|
|
@@ -8454,7 +8433,7 @@ function SizeFieldInner({
|
|
|
8454
8433
|
onClick: handleClear,
|
|
8455
8434
|
className: "text-muted-foreground hover:text-destructive",
|
|
8456
8435
|
title: "Reset to default",
|
|
8457
|
-
children: /* @__PURE__ */ jsx(
|
|
8436
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
8458
8437
|
}
|
|
8459
8438
|
)
|
|
8460
8439
|
] }),
|
|
@@ -8939,7 +8918,7 @@ function AccordionItem({
|
|
|
8939
8918
|
children: [
|
|
8940
8919
|
/* @__PURE__ */ jsx("span", { children: item.title }),
|
|
8941
8920
|
/* @__PURE__ */ jsx(
|
|
8942
|
-
|
|
8921
|
+
ChevronDown,
|
|
8943
8922
|
{
|
|
8944
8923
|
className: cn(
|
|
8945
8924
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|