@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/fields/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React12 from 'react';
|
|
3
3
|
import { memo, createContext, useState, useCallback, useEffect, useRef, useContext } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { X, ChevronDown, ChevronUp, Check, Image, Link, Search, Loader2, AlertCircle, Upload, Bold, Italic, Underline, Strikethrough, Superscript, Subscript, Pilcrow, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, ALargeSmall, List, ListOrdered, Quote, AlignLeft, AlignCenter, AlignRight, AlignJustify, Palette, Highlighter, Minus, CornerDownLeft, RemoveFormatting, Code, Maximize2, Unlink, ArrowUp, ArrowRight, ArrowDown, ArrowLeft, MoveHorizontal, Container, SlidersHorizontal, Square, AlignStartHorizontal, AlignCenterHorizontal, AlignEndHorizontal, AlignHorizontalDistributeCenter, GripHorizontal, AlignStartVertical, AlignCenterVertical, AlignEndVertical, MoveVertical, Trash2, Plus, EyeOff, RotateCw, Box, ChevronRight, Monitor, Laptop, Tablet, Smartphone, Eye, Lock, Unlock } from 'lucide-react';
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
@@ -15,8 +15,8 @@ import TextAlign from '@tiptap/extension-text-align';
|
|
|
15
15
|
import { TextStyle } from '@tiptap/extension-text-style';
|
|
16
16
|
import { Color } from '@tiptap/extension-color';
|
|
17
17
|
import Highlight from '@tiptap/extension-highlight';
|
|
18
|
-
import Superscript from '@tiptap/extension-superscript';
|
|
19
|
-
import Subscript from '@tiptap/extension-subscript';
|
|
18
|
+
import Superscript$1 from '@tiptap/extension-superscript';
|
|
19
|
+
import Subscript$1 from '@tiptap/extension-subscript';
|
|
20
20
|
import { Extension } from '@tiptap/core';
|
|
21
21
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
22
22
|
|
|
@@ -752,7 +752,7 @@ function transformValueToCSS(transform) {
|
|
|
752
752
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
753
753
|
}
|
|
754
754
|
var BREAKPOINTS = [
|
|
755
|
-
{ key: "
|
|
755
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
756
756
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
757
757
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
758
758
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -760,7 +760,7 @@ var BREAKPOINTS = [
|
|
|
760
760
|
];
|
|
761
761
|
function isResponsiveValue(value) {
|
|
762
762
|
if (!value || typeof value !== "object") return false;
|
|
763
|
-
return "
|
|
763
|
+
return "xs" in value;
|
|
764
764
|
}
|
|
765
765
|
function camelToKebab(str) {
|
|
766
766
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -786,7 +786,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
786
786
|
if (bpValue === void 0) return;
|
|
787
787
|
const cssProps = converter(bpValue);
|
|
788
788
|
if (!cssProps) return;
|
|
789
|
-
if (bp.key === "
|
|
789
|
+
if (bp.key === "xs") {
|
|
790
790
|
baseStyles = cssProps;
|
|
791
791
|
} else {
|
|
792
792
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -800,29 +800,50 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
800
800
|
return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
|
|
801
801
|
}
|
|
802
802
|
var DEFAULT_VISIBILITY = {
|
|
803
|
-
|
|
803
|
+
xs: true,
|
|
804
|
+
sm: true,
|
|
805
|
+
md: true,
|
|
806
|
+
lg: true,
|
|
807
|
+
xl: true
|
|
804
808
|
};
|
|
805
809
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
806
810
|
if (!visibility) return "";
|
|
807
811
|
const mediaQueries = [];
|
|
808
|
-
|
|
809
|
-
|
|
812
|
+
const breakpointWidths = {
|
|
813
|
+
xs: null,
|
|
814
|
+
// 0px
|
|
815
|
+
sm: 640,
|
|
816
|
+
md: 768,
|
|
817
|
+
lg: 1024,
|
|
818
|
+
xl: 1280
|
|
819
|
+
};
|
|
820
|
+
const getNextBreakpointWidth = (bp) => {
|
|
821
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
822
|
+
const index = order.indexOf(bp);
|
|
823
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
824
|
+
return breakpointWidths[order[index + 1]];
|
|
825
|
+
};
|
|
826
|
+
if (visibility.xs === false) {
|
|
827
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
828
|
+
if (nextWidth) {
|
|
829
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
830
|
+
} else {
|
|
831
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
832
|
+
}
|
|
810
833
|
}
|
|
811
|
-
let lastVisibility = visibility.base;
|
|
812
834
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
if (
|
|
835
|
+
if (visibility[bp.key] === false) {
|
|
836
|
+
const minWidth = breakpointWidths[bp.key];
|
|
837
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
838
|
+
if (minWidth && maxWidth) {
|
|
817
839
|
mediaQueries.push(
|
|
818
|
-
`@media (min-width: ${
|
|
840
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
819
841
|
);
|
|
820
|
-
} else {
|
|
842
|
+
} else if (minWidth) {
|
|
821
843
|
mediaQueries.push(
|
|
822
|
-
`@media (min-width: ${
|
|
844
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
823
845
|
);
|
|
824
846
|
}
|
|
825
|
-
lastVisibility = bpValue;
|
|
826
847
|
}
|
|
827
848
|
});
|
|
828
849
|
return mediaQueries.join("\n");
|
|
@@ -1277,7 +1298,7 @@ var DialogContent = React12.forwardRef(({ className, children, ...props }, ref)
|
|
|
1277
1298
|
children: [
|
|
1278
1299
|
children,
|
|
1279
1300
|
/* @__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: [
|
|
1280
|
-
/* @__PURE__ */ jsx(
|
|
1301
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1281
1302
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1282
1303
|
] })
|
|
1283
1304
|
]
|
|
@@ -1300,7 +1321,7 @@ var DialogContentFullscreen = React12.forwardRef(({ className, children, hideClo
|
|
|
1300
1321
|
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: accessibleTitle }),
|
|
1301
1322
|
children,
|
|
1302
1323
|
!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: [
|
|
1303
|
-
/* @__PURE__ */ jsx(
|
|
1324
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1304
1325
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1305
1326
|
] })
|
|
1306
1327
|
]
|
|
@@ -1574,10 +1595,10 @@ function MediaFieldInner({
|
|
|
1574
1595
|
onClick: handleRemove,
|
|
1575
1596
|
className: "absolute -top-2 -right-2 p-1 bg-destructive text-destructive-foreground rounded-full opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1576
1597
|
"aria-label": "Remove image",
|
|
1577
|
-
children: /* @__PURE__ */ jsx(
|
|
1598
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
1578
1599
|
}
|
|
1579
1600
|
)
|
|
1580
|
-
] }) : /* @__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(
|
|
1601
|
+
] }) : /* @__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" }) }),
|
|
1581
1602
|
!readOnly && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1582
1603
|
/* @__PURE__ */ jsx(
|
|
1583
1604
|
Button,
|
|
@@ -1601,7 +1622,7 @@ function MediaFieldInner({
|
|
|
1601
1622
|
] })
|
|
1602
1623
|
] }),
|
|
1603
1624
|
value?.url && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
1604
|
-
/* @__PURE__ */ jsx(
|
|
1625
|
+
/* @__PURE__ */ jsx(Link, { className: "h-3 w-3 flex-shrink-0" }),
|
|
1605
1626
|
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[280px]", title: value.url, children: value.url })
|
|
1606
1627
|
] })
|
|
1607
1628
|
] }),
|
|
@@ -1646,7 +1667,7 @@ function MediaFieldInner({
|
|
|
1646
1667
|
)
|
|
1647
1668
|
] }),
|
|
1648
1669
|
activeTab === "browse" && /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
|
|
1649
|
-
/* @__PURE__ */ jsx(
|
|
1670
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
1650
1671
|
/* @__PURE__ */ jsx(
|
|
1651
1672
|
Input,
|
|
1652
1673
|
{
|
|
@@ -1692,7 +1713,7 @@ function MediaFieldInner({
|
|
|
1692
1713
|
onClick: handleLoadMore,
|
|
1693
1714
|
disabled: loading,
|
|
1694
1715
|
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1695
|
-
/* @__PURE__ */ jsx(
|
|
1716
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
1696
1717
|
"Loading..."
|
|
1697
1718
|
] }) : "Load More"
|
|
1698
1719
|
}
|
|
@@ -1722,15 +1743,15 @@ function MediaFieldInner({
|
|
|
1722
1743
|
] })
|
|
1723
1744
|
] }),
|
|
1724
1745
|
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: [
|
|
1725
|
-
/* @__PURE__ */ jsx(
|
|
1746
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
1726
1747
|
/* @__PURE__ */ jsx("span", { children: uploadState.error })
|
|
1727
1748
|
] }),
|
|
1728
1749
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
1729
1750
|
/* @__PURE__ */ jsx(Button, { onClick: handleUpload, disabled: uploadState.uploading, children: uploadState.uploading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1730
|
-
/* @__PURE__ */ jsx(
|
|
1751
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
1731
1752
|
"Uploading..."
|
|
1732
1753
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1733
|
-
/* @__PURE__ */ jsx(
|
|
1754
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-4 w-4 mr-2" }),
|
|
1734
1755
|
"Upload & Select"
|
|
1735
1756
|
] }) }),
|
|
1736
1757
|
/* @__PURE__ */ jsx(
|
|
@@ -1744,7 +1765,7 @@ function MediaFieldInner({
|
|
|
1744
1765
|
)
|
|
1745
1766
|
] })
|
|
1746
1767
|
] }) : /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
1747
|
-
/* @__PURE__ */ jsx(
|
|
1768
|
+
/* @__PURE__ */ jsx(Image, { className: "h-16 w-16 text-muted mx-auto mb-4" }),
|
|
1748
1769
|
/* @__PURE__ */ jsxs("label", { className: "cursor-pointer", children: [
|
|
1749
1770
|
/* @__PURE__ */ jsx(Button, { asChild: true, children: /* @__PURE__ */ jsx("span", { children: "Select Image" }) }),
|
|
1750
1771
|
/* @__PURE__ */ jsx(
|
|
@@ -1764,7 +1785,7 @@ function MediaFieldInner({
|
|
|
1764
1785
|
/* URL Tab */
|
|
1765
1786
|
/* @__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: [
|
|
1766
1787
|
/* @__PURE__ */ jsxs("div", { className: "text-center mb-6", children: [
|
|
1767
|
-
/* @__PURE__ */ jsx(
|
|
1788
|
+
/* @__PURE__ */ jsx(Link, { className: "h-12 w-12 text-muted-foreground mx-auto mb-2" }),
|
|
1768
1789
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Enter an image URL from an external source" })
|
|
1769
1790
|
] }),
|
|
1770
1791
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -1802,10 +1823,10 @@ function MediaFieldInner({
|
|
|
1802
1823
|
onError: handleUrlPreviewError
|
|
1803
1824
|
}
|
|
1804
1825
|
),
|
|
1805
|
-
!urlState.previewLoaded && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx(
|
|
1826
|
+
!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" }) })
|
|
1806
1827
|
] }),
|
|
1807
1828
|
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: [
|
|
1808
|
-
/* @__PURE__ */ jsx(
|
|
1829
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
1809
1830
|
/* @__PURE__ */ jsx("span", { children: urlState.error })
|
|
1810
1831
|
] }),
|
|
1811
1832
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -1815,7 +1836,7 @@ function MediaFieldInner({
|
|
|
1815
1836
|
onClick: handleUrlSubmit,
|
|
1816
1837
|
disabled: !urlState.url || urlState.loading,
|
|
1817
1838
|
children: [
|
|
1818
|
-
/* @__PURE__ */ jsx(
|
|
1839
|
+
/* @__PURE__ */ jsx(Link, { className: "h-4 w-4 mr-2" }),
|
|
1819
1840
|
"Use This URL"
|
|
1820
1841
|
]
|
|
1821
1842
|
}
|
|
@@ -2025,7 +2046,7 @@ function ColorPickerFieldInner({
|
|
|
2025
2046
|
onClick: handleClear,
|
|
2026
2047
|
title: "Clear color",
|
|
2027
2048
|
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",
|
|
2028
|
-
children: /* @__PURE__ */ jsx(
|
|
2049
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
2029
2050
|
}
|
|
2030
2051
|
)
|
|
2031
2052
|
] }),
|
|
@@ -2458,8 +2479,8 @@ function createTiptapExtensions() {
|
|
|
2458
2479
|
multicolor: true
|
|
2459
2480
|
}),
|
|
2460
2481
|
FontSize,
|
|
2461
|
-
Superscript,
|
|
2462
|
-
Subscript
|
|
2482
|
+
Superscript$1,
|
|
2483
|
+
Subscript$1
|
|
2463
2484
|
];
|
|
2464
2485
|
}
|
|
2465
2486
|
function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
@@ -2565,7 +2586,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2565
2586
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
2566
2587
|
isActive: formattingState?.isBold,
|
|
2567
2588
|
title: "Bold",
|
|
2568
|
-
children: /* @__PURE__ */ jsx(
|
|
2589
|
+
children: /* @__PURE__ */ jsx(Bold, { className: ICON_SIZE })
|
|
2569
2590
|
}
|
|
2570
2591
|
),
|
|
2571
2592
|
/* @__PURE__ */ jsx(
|
|
@@ -2574,7 +2595,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2574
2595
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
2575
2596
|
isActive: formattingState?.isItalic,
|
|
2576
2597
|
title: "Italic",
|
|
2577
|
-
children: /* @__PURE__ */ jsx(
|
|
2598
|
+
children: /* @__PURE__ */ jsx(Italic, { className: ICON_SIZE })
|
|
2578
2599
|
}
|
|
2579
2600
|
),
|
|
2580
2601
|
/* @__PURE__ */ jsx(
|
|
@@ -2583,7 +2604,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2583
2604
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
2584
2605
|
isActive: formattingState?.isUnderline,
|
|
2585
2606
|
title: "Underline",
|
|
2586
|
-
children: /* @__PURE__ */ jsx(
|
|
2607
|
+
children: /* @__PURE__ */ jsx(Underline, { className: ICON_SIZE })
|
|
2587
2608
|
}
|
|
2588
2609
|
),
|
|
2589
2610
|
/* @__PURE__ */ jsx(
|
|
@@ -2592,7 +2613,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2592
2613
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
2593
2614
|
isActive: formattingState?.isStrike,
|
|
2594
2615
|
title: "Strikethrough",
|
|
2595
|
-
children: /* @__PURE__ */ jsx(
|
|
2616
|
+
children: /* @__PURE__ */ jsx(Strikethrough, { className: ICON_SIZE })
|
|
2596
2617
|
}
|
|
2597
2618
|
),
|
|
2598
2619
|
/* @__PURE__ */ jsx(
|
|
@@ -2601,7 +2622,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2601
2622
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
2602
2623
|
isActive: formattingState?.isSuperscript,
|
|
2603
2624
|
title: "Superscript",
|
|
2604
|
-
children: /* @__PURE__ */ jsx(
|
|
2625
|
+
children: /* @__PURE__ */ jsx(Superscript, { className: ICON_SIZE })
|
|
2605
2626
|
}
|
|
2606
2627
|
),
|
|
2607
2628
|
/* @__PURE__ */ jsx(
|
|
@@ -2610,7 +2631,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2610
2631
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
2611
2632
|
isActive: formattingState?.isSubscript,
|
|
2612
2633
|
title: "Subscript",
|
|
2613
|
-
children: /* @__PURE__ */ jsx(
|
|
2634
|
+
children: /* @__PURE__ */ jsx(Subscript, { className: ICON_SIZE })
|
|
2614
2635
|
}
|
|
2615
2636
|
),
|
|
2616
2637
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -2618,8 +2639,8 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2618
2639
|
ToolbarDropdown,
|
|
2619
2640
|
{
|
|
2620
2641
|
trigger: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
2621
|
-
formattingState?.isH1 ? /* @__PURE__ */ jsx(
|
|
2622
|
-
/* @__PURE__ */ jsx(
|
|
2642
|
+
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 }),
|
|
2643
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3" })
|
|
2623
2644
|
] }),
|
|
2624
2645
|
title: "Text Type",
|
|
2625
2646
|
isActive: formattingState?.isH1 || formattingState?.isH2 || formattingState?.isH3 || formattingState?.isH4 || formattingState?.isH5 || formattingState?.isH6,
|
|
@@ -2628,7 +2649,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2628
2649
|
editor.chain().focus().setParagraph().run();
|
|
2629
2650
|
close();
|
|
2630
2651
|
}, children: [
|
|
2631
|
-
/* @__PURE__ */ jsx(
|
|
2652
|
+
/* @__PURE__ */ jsx(Pilcrow, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2632
2653
|
"Paragraph"
|
|
2633
2654
|
] }),
|
|
2634
2655
|
/* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
@@ -2636,42 +2657,42 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2636
2657
|
editor.chain().focus().toggleHeading({ level: 1 }).run();
|
|
2637
2658
|
close();
|
|
2638
2659
|
}, children: [
|
|
2639
|
-
/* @__PURE__ */ jsx(
|
|
2660
|
+
/* @__PURE__ */ jsx(Heading1, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2640
2661
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-lg", children: "Heading 1" })
|
|
2641
2662
|
] }),
|
|
2642
2663
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
2643
2664
|
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
|
2644
2665
|
close();
|
|
2645
2666
|
}, children: [
|
|
2646
|
-
/* @__PURE__ */ jsx(
|
|
2667
|
+
/* @__PURE__ */ jsx(Heading2, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2647
2668
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-base", children: "Heading 2" })
|
|
2648
2669
|
] }),
|
|
2649
2670
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
2650
2671
|
editor.chain().focus().toggleHeading({ level: 3 }).run();
|
|
2651
2672
|
close();
|
|
2652
2673
|
}, children: [
|
|
2653
|
-
/* @__PURE__ */ jsx(
|
|
2674
|
+
/* @__PURE__ */ jsx(Heading3, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2654
2675
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Heading 3" })
|
|
2655
2676
|
] }),
|
|
2656
2677
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
2657
2678
|
editor.chain().focus().toggleHeading({ level: 4 }).run();
|
|
2658
2679
|
close();
|
|
2659
2680
|
}, children: [
|
|
2660
|
-
/* @__PURE__ */ jsx(
|
|
2681
|
+
/* @__PURE__ */ jsx(Heading4, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2661
2682
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: "Heading 4" })
|
|
2662
2683
|
] }),
|
|
2663
2684
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
2664
2685
|
editor.chain().focus().toggleHeading({ level: 5 }).run();
|
|
2665
2686
|
close();
|
|
2666
2687
|
}, children: [
|
|
2667
|
-
/* @__PURE__ */ jsx(
|
|
2688
|
+
/* @__PURE__ */ jsx(Heading5, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2668
2689
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs", children: "Heading 5" })
|
|
2669
2690
|
] }),
|
|
2670
2691
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
2671
2692
|
editor.chain().focus().toggleHeading({ level: 6 }).run();
|
|
2672
2693
|
close();
|
|
2673
2694
|
}, children: [
|
|
2674
|
-
/* @__PURE__ */ jsx(
|
|
2695
|
+
/* @__PURE__ */ jsx(Heading6, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
2675
2696
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs text-gray-600", children: "Heading 6" })
|
|
2676
2697
|
] })
|
|
2677
2698
|
] })
|
|
@@ -2681,7 +2702,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2681
2702
|
/* @__PURE__ */ jsx(
|
|
2682
2703
|
ToolbarDropdown,
|
|
2683
2704
|
{
|
|
2684
|
-
trigger: /* @__PURE__ */ jsx(
|
|
2705
|
+
trigger: /* @__PURE__ */ jsx(ALargeSmall, { className: ICON_SIZE }),
|
|
2685
2706
|
title: "Font Size",
|
|
2686
2707
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2687
2708
|
/* @__PURE__ */ jsx(DropdownLabel, { children: "Presets" }),
|
|
@@ -2767,7 +2788,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2767
2788
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2768
2789
|
isActive: formattingState?.isBulletList,
|
|
2769
2790
|
title: "Bullet List",
|
|
2770
|
-
children: /* @__PURE__ */ jsx(
|
|
2791
|
+
children: /* @__PURE__ */ jsx(List, { className: ICON_SIZE })
|
|
2771
2792
|
}
|
|
2772
2793
|
),
|
|
2773
2794
|
/* @__PURE__ */ jsx(
|
|
@@ -2776,7 +2797,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2776
2797
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2777
2798
|
isActive: formattingState?.isOrderedList,
|
|
2778
2799
|
title: "Numbered List",
|
|
2779
|
-
children: /* @__PURE__ */ jsx(
|
|
2800
|
+
children: /* @__PURE__ */ jsx(ListOrdered, { className: ICON_SIZE })
|
|
2780
2801
|
}
|
|
2781
2802
|
),
|
|
2782
2803
|
/* @__PURE__ */ jsx(
|
|
@@ -2785,7 +2806,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2785
2806
|
onClick: () => editor.chain().focus().toggleBlockquote().run(),
|
|
2786
2807
|
isActive: formattingState?.isBlockquote,
|
|
2787
2808
|
title: "Blockquote",
|
|
2788
|
-
children: /* @__PURE__ */ jsx(
|
|
2809
|
+
children: /* @__PURE__ */ jsx(Quote, { className: ICON_SIZE })
|
|
2789
2810
|
}
|
|
2790
2811
|
),
|
|
2791
2812
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -2795,7 +2816,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2795
2816
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
2796
2817
|
isActive: formattingState?.isAlignLeft,
|
|
2797
2818
|
title: "Align Left",
|
|
2798
|
-
children: /* @__PURE__ */ jsx(
|
|
2819
|
+
children: /* @__PURE__ */ jsx(AlignLeft, { className: ICON_SIZE })
|
|
2799
2820
|
}
|
|
2800
2821
|
),
|
|
2801
2822
|
/* @__PURE__ */ jsx(
|
|
@@ -2804,7 +2825,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2804
2825
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
2805
2826
|
isActive: formattingState?.isAlignCenter,
|
|
2806
2827
|
title: "Align Center",
|
|
2807
|
-
children: /* @__PURE__ */ jsx(
|
|
2828
|
+
children: /* @__PURE__ */ jsx(AlignCenter, { className: ICON_SIZE })
|
|
2808
2829
|
}
|
|
2809
2830
|
),
|
|
2810
2831
|
/* @__PURE__ */ jsx(
|
|
@@ -2813,7 +2834,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2813
2834
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
2814
2835
|
isActive: formattingState?.isAlignRight,
|
|
2815
2836
|
title: "Align Right",
|
|
2816
|
-
children: /* @__PURE__ */ jsx(
|
|
2837
|
+
children: /* @__PURE__ */ jsx(AlignRight, { className: ICON_SIZE })
|
|
2817
2838
|
}
|
|
2818
2839
|
),
|
|
2819
2840
|
/* @__PURE__ */ jsx(
|
|
@@ -2822,7 +2843,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2822
2843
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
2823
2844
|
isActive: formattingState?.isAlignJustify,
|
|
2824
2845
|
title: "Justify",
|
|
2825
|
-
children: /* @__PURE__ */ jsx(
|
|
2846
|
+
children: /* @__PURE__ */ jsx(AlignJustify, { className: ICON_SIZE })
|
|
2826
2847
|
}
|
|
2827
2848
|
),
|
|
2828
2849
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -2833,7 +2854,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2833
2854
|
onClick: () => setIsLinkPopoverOpen(!isLinkPopoverOpen),
|
|
2834
2855
|
isActive: formattingState?.isLink,
|
|
2835
2856
|
title: "Add Link",
|
|
2836
|
-
children: /* @__PURE__ */ jsx(
|
|
2857
|
+
children: /* @__PURE__ */ jsx(Link, { className: ICON_SIZE })
|
|
2837
2858
|
}
|
|
2838
2859
|
),
|
|
2839
2860
|
/* @__PURE__ */ jsx(
|
|
@@ -2849,7 +2870,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2849
2870
|
/* @__PURE__ */ jsx(
|
|
2850
2871
|
ToolbarDropdown,
|
|
2851
2872
|
{
|
|
2852
|
-
trigger: /* @__PURE__ */ jsx(
|
|
2873
|
+
trigger: /* @__PURE__ */ jsx(Palette, { className: ICON_SIZE }),
|
|
2853
2874
|
title: "Text Color",
|
|
2854
2875
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2855
2876
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
@@ -2906,7 +2927,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2906
2927
|
/* @__PURE__ */ jsx(
|
|
2907
2928
|
ToolbarDropdown,
|
|
2908
2929
|
{
|
|
2909
|
-
trigger: /* @__PURE__ */ jsx(
|
|
2930
|
+
trigger: /* @__PURE__ */ jsx(Highlighter, { className: ICON_SIZE }),
|
|
2910
2931
|
title: "Highlight",
|
|
2911
2932
|
isActive: formattingState?.isHighlight,
|
|
2912
2933
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2937,7 +2958,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2937
2958
|
{
|
|
2938
2959
|
onClick: () => editor.chain().focus().setHorizontalRule().run(),
|
|
2939
2960
|
title: "Horizontal Rule",
|
|
2940
|
-
children: /* @__PURE__ */ jsx(
|
|
2961
|
+
children: /* @__PURE__ */ jsx(Minus, { className: ICON_SIZE })
|
|
2941
2962
|
}
|
|
2942
2963
|
),
|
|
2943
2964
|
/* @__PURE__ */ jsx(
|
|
@@ -2945,7 +2966,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2945
2966
|
{
|
|
2946
2967
|
onClick: () => editor.chain().focus().setHardBreak().run(),
|
|
2947
2968
|
title: "Hard Break (Shift+Enter)",
|
|
2948
|
-
children: /* @__PURE__ */ jsx(
|
|
2969
|
+
children: /* @__PURE__ */ jsx(CornerDownLeft, { className: ICON_SIZE })
|
|
2949
2970
|
}
|
|
2950
2971
|
),
|
|
2951
2972
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -2954,7 +2975,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2954
2975
|
{
|
|
2955
2976
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
2956
2977
|
title: "Clear Formatting",
|
|
2957
|
-
children: /* @__PURE__ */ jsx(
|
|
2978
|
+
children: /* @__PURE__ */ jsx(RemoveFormatting, { className: ICON_SIZE })
|
|
2958
2979
|
}
|
|
2959
2980
|
),
|
|
2960
2981
|
/* @__PURE__ */ jsxs(
|
|
@@ -2977,7 +2998,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
2977
2998
|
!showSource && "bg-transparent"
|
|
2978
2999
|
),
|
|
2979
3000
|
children: [
|
|
2980
|
-
/* @__PURE__ */ jsx(
|
|
3001
|
+
/* @__PURE__ */ jsx(Code, { className: ICON_SIZE }),
|
|
2981
3002
|
"Source"
|
|
2982
3003
|
]
|
|
2983
3004
|
}
|
|
@@ -3107,7 +3128,7 @@ function TiptapModal({ isOpen, onClose, value, onChange, title }) {
|
|
|
3107
3128
|
justifyContent: "center"
|
|
3108
3129
|
},
|
|
3109
3130
|
title: "Close (Esc)",
|
|
3110
|
-
children: /* @__PURE__ */ jsx(
|
|
3131
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
3111
3132
|
}
|
|
3112
3133
|
)
|
|
3113
3134
|
]
|
|
@@ -3234,7 +3255,7 @@ function TiptapModalFieldInner({ value, onChange, label }) {
|
|
|
3234
3255
|
},
|
|
3235
3256
|
title: "Open full-screen editor",
|
|
3236
3257
|
children: [
|
|
3237
|
-
/* @__PURE__ */ jsx(
|
|
3258
|
+
/* @__PURE__ */ jsx(Maximize2, { size: 14 }),
|
|
3238
3259
|
"Expand"
|
|
3239
3260
|
]
|
|
3240
3261
|
}
|
|
@@ -3350,7 +3371,7 @@ function PaddingFieldInner({
|
|
|
3350
3371
|
isLinked ? "" : "text-muted-foreground"
|
|
3351
3372
|
),
|
|
3352
3373
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
3353
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
3374
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
3354
3375
|
}
|
|
3355
3376
|
)
|
|
3356
3377
|
] }),
|
|
@@ -3490,7 +3511,7 @@ function MarginFieldInner({
|
|
|
3490
3511
|
isLinked ? "" : "text-muted-foreground"
|
|
3491
3512
|
),
|
|
3492
3513
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
3493
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
3514
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
3494
3515
|
}
|
|
3495
3516
|
)
|
|
3496
3517
|
] }),
|
|
@@ -3557,7 +3578,7 @@ var SelectTrigger = React12.forwardRef(({ className, children, ...props }, ref)
|
|
|
3557
3578
|
...props,
|
|
3558
3579
|
children: [
|
|
3559
3580
|
children,
|
|
3560
|
-
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
3581
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
3561
3582
|
]
|
|
3562
3583
|
}
|
|
3563
3584
|
));
|
|
@@ -3571,7 +3592,7 @@ var SelectScrollUpButton = React12.forwardRef(({ className, ...props }, ref) =>
|
|
|
3571
3592
|
className
|
|
3572
3593
|
),
|
|
3573
3594
|
...props,
|
|
3574
|
-
children: /* @__PURE__ */ jsx(
|
|
3595
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
3575
3596
|
}
|
|
3576
3597
|
));
|
|
3577
3598
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -3584,7 +3605,7 @@ var SelectScrollDownButton = React12.forwardRef(({ className, ...props }, ref) =
|
|
|
3584
3605
|
className
|
|
3585
3606
|
),
|
|
3586
3607
|
...props,
|
|
3587
|
-
children: /* @__PURE__ */ jsx(
|
|
3608
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
3588
3609
|
}
|
|
3589
3610
|
));
|
|
3590
3611
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -3635,7 +3656,7 @@ var SelectItem = React12.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
3635
3656
|
),
|
|
3636
3657
|
...props,
|
|
3637
3658
|
children: [
|
|
3638
|
-
/* @__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(
|
|
3659
|
+
/* @__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" }) }) }),
|
|
3639
3660
|
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
3640
3661
|
]
|
|
3641
3662
|
}
|
|
@@ -3727,7 +3748,7 @@ function BorderFieldInner({
|
|
|
3727
3748
|
onClick: handleClear,
|
|
3728
3749
|
className: "text-muted-foreground hover:text-destructive",
|
|
3729
3750
|
title: "Clear border",
|
|
3730
|
-
children: /* @__PURE__ */ jsx(
|
|
3751
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
3731
3752
|
}
|
|
3732
3753
|
)
|
|
3733
3754
|
] }),
|
|
@@ -3830,7 +3851,7 @@ function BorderFieldInner({
|
|
|
3830
3851
|
currentValue.sides.top && "bg-primary hover:bg-primary/90"
|
|
3831
3852
|
),
|
|
3832
3853
|
title: "Top border",
|
|
3833
|
-
children: /* @__PURE__ */ jsx(
|
|
3854
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" })
|
|
3834
3855
|
}
|
|
3835
3856
|
),
|
|
3836
3857
|
/* @__PURE__ */ jsx(
|
|
@@ -3845,7 +3866,7 @@ function BorderFieldInner({
|
|
|
3845
3866
|
currentValue.sides.right && "bg-primary hover:bg-primary/90"
|
|
3846
3867
|
),
|
|
3847
3868
|
title: "Right border",
|
|
3848
|
-
children: /* @__PURE__ */ jsx(
|
|
3869
|
+
children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" })
|
|
3849
3870
|
}
|
|
3850
3871
|
),
|
|
3851
3872
|
/* @__PURE__ */ jsx(
|
|
@@ -3860,7 +3881,7 @@ function BorderFieldInner({
|
|
|
3860
3881
|
currentValue.sides.bottom && "bg-primary hover:bg-primary/90"
|
|
3861
3882
|
),
|
|
3862
3883
|
title: "Bottom border",
|
|
3863
|
-
children: /* @__PURE__ */ jsx(
|
|
3884
|
+
children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" })
|
|
3864
3885
|
}
|
|
3865
3886
|
),
|
|
3866
3887
|
/* @__PURE__ */ jsx(
|
|
@@ -3875,7 +3896,7 @@ function BorderFieldInner({
|
|
|
3875
3896
|
currentValue.sides.left && "bg-primary hover:bg-primary/90"
|
|
3876
3897
|
),
|
|
3877
3898
|
title: "Left border",
|
|
3878
|
-
children: /* @__PURE__ */ jsx(
|
|
3899
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" })
|
|
3879
3900
|
}
|
|
3880
3901
|
)
|
|
3881
3902
|
] }),
|
|
@@ -3979,14 +4000,14 @@ function WidthFieldInner({
|
|
|
3979
4000
|
onClick: handleClear,
|
|
3980
4001
|
className: "text-muted-foreground hover:text-destructive",
|
|
3981
4002
|
title: "Reset to default",
|
|
3982
|
-
children: /* @__PURE__ */ jsx(
|
|
4003
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
3983
4004
|
}
|
|
3984
4005
|
)
|
|
3985
4006
|
] }),
|
|
3986
4007
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: [
|
|
3987
|
-
{ mode: "full", icon:
|
|
3988
|
-
{ mode: "contained", icon:
|
|
3989
|
-
{ mode: "custom", icon:
|
|
4008
|
+
{ mode: "full", icon: MoveHorizontal, title: "Full width (100%)" },
|
|
4009
|
+
{ mode: "contained", icon: Container, title: "Contained (centered with max-width)" },
|
|
4010
|
+
{ mode: "custom", icon: SlidersHorizontal, title: "Custom width settings" }
|
|
3990
4011
|
].map(({ mode, icon: Icon2, title }) => {
|
|
3991
4012
|
const isActive = currentValue.mode === mode;
|
|
3992
4013
|
return /* @__PURE__ */ jsxs(
|
|
@@ -4073,9 +4094,9 @@ function WidthFieldInner({
|
|
|
4073
4094
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4074
4095
|
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground flex-shrink-0", children: "Align:" }),
|
|
4075
4096
|
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: [
|
|
4076
|
-
{ alignment: "left", icon:
|
|
4077
|
-
{ alignment: "center", icon:
|
|
4078
|
-
{ alignment: "right", icon:
|
|
4097
|
+
{ alignment: "left", icon: AlignLeft, title: "Align left" },
|
|
4098
|
+
{ alignment: "center", icon: AlignCenter, title: "Align center" },
|
|
4099
|
+
{ alignment: "right", icon: AlignRight, title: "Align right" }
|
|
4079
4100
|
].map(({ alignment, icon: Icon2, title }) => {
|
|
4080
4101
|
const isActive = currentValue.alignment === alignment;
|
|
4081
4102
|
const isDisabled = readOnly || currentValue.mode === "full";
|
|
@@ -4382,14 +4403,14 @@ function DimensionsFieldInner({
|
|
|
4382
4403
|
});
|
|
4383
4404
|
}, [advancedMode, currentValue, onChange]);
|
|
4384
4405
|
const modeConfig = [
|
|
4385
|
-
{ mode: "full", icon:
|
|
4386
|
-
{ mode: "contained", icon:
|
|
4387
|
-
{ mode: "custom", icon:
|
|
4406
|
+
{ mode: "full", icon: MoveHorizontal, label: "Full", title: "Full width (100%)" },
|
|
4407
|
+
{ mode: "contained", icon: Square, label: "Contain", title: "Contained (centered with max-width)" },
|
|
4408
|
+
{ mode: "custom", icon: SlidersHorizontal, label: "Custom", title: "Custom width settings" }
|
|
4388
4409
|
];
|
|
4389
4410
|
const alignmentConfig = [
|
|
4390
|
-
{ alignment: "left", icon:
|
|
4391
|
-
{ alignment: "center", icon:
|
|
4392
|
-
{ alignment: "right", icon:
|
|
4411
|
+
{ alignment: "left", icon: AlignStartHorizontal, title: "Align left" },
|
|
4412
|
+
{ alignment: "center", icon: AlignCenterHorizontal, title: "Align center" },
|
|
4413
|
+
{ alignment: "right", icon: AlignEndHorizontal, title: "Align right" }
|
|
4393
4414
|
];
|
|
4394
4415
|
const showWidthControls = currentValue.mode !== "full";
|
|
4395
4416
|
showHeightControls && (advancedMode || currentValue.minHeight?.enabled || currentValue.maxHeight?.enabled);
|
|
@@ -4405,7 +4426,7 @@ function DimensionsFieldInner({
|
|
|
4405
4426
|
onClick: handleClear,
|
|
4406
4427
|
className: "text-muted-foreground hover:text-destructive",
|
|
4407
4428
|
title: "Reset to default",
|
|
4408
|
-
children: /* @__PURE__ */ jsx(
|
|
4429
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4409
4430
|
}
|
|
4410
4431
|
)
|
|
4411
4432
|
] }),
|
|
@@ -4608,10 +4629,10 @@ function DimensionsFieldInner({
|
|
|
4608
4629
|
disabled: readOnly,
|
|
4609
4630
|
className: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
4610
4631
|
children: advancedMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4611
|
-
/* @__PURE__ */ jsx(
|
|
4632
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3.5 w-3.5 mr-1" }),
|
|
4612
4633
|
"Hide Advanced"
|
|
4613
4634
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4614
|
-
/* @__PURE__ */ jsx(
|
|
4635
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 mr-1" }),
|
|
4615
4636
|
"Show Advanced"
|
|
4616
4637
|
] })
|
|
4617
4638
|
}
|
|
@@ -4666,7 +4687,7 @@ function LockedTextField({
|
|
|
4666
4687
|
transition: "all 0.15s ease"
|
|
4667
4688
|
},
|
|
4668
4689
|
title: isLocked ? "Click to unlock" : "Click to lock",
|
|
4669
|
-
children: isLocked ? /* @__PURE__ */ jsx(
|
|
4690
|
+
children: isLocked ? /* @__PURE__ */ jsx(Lock, { size: 14 }) : /* @__PURE__ */ jsx(Unlock, { size: 14 })
|
|
4670
4691
|
}
|
|
4671
4692
|
)
|
|
4672
4693
|
] }),
|
|
@@ -4695,7 +4716,7 @@ function LockedTextField({
|
|
|
4695
4716
|
}
|
|
4696
4717
|
),
|
|
4697
4718
|
isLocked && /* @__PURE__ */ jsx(
|
|
4698
|
-
|
|
4719
|
+
Lock,
|
|
4699
4720
|
{
|
|
4700
4721
|
size: 14,
|
|
4701
4722
|
style: {
|
|
@@ -4750,7 +4771,7 @@ function LockedRadioField({
|
|
|
4750
4771
|
transition: "all 0.15s ease"
|
|
4751
4772
|
},
|
|
4752
4773
|
title: isLocked ? "Click to unlock" : "Click to lock",
|
|
4753
|
-
children: isLocked ? /* @__PURE__ */ jsx(
|
|
4774
|
+
children: isLocked ? /* @__PURE__ */ jsx(Lock, { size: 14 }) : /* @__PURE__ */ jsx(Unlock, { size: 14 })
|
|
4754
4775
|
}
|
|
4755
4776
|
)
|
|
4756
4777
|
] }),
|
|
@@ -4862,9 +4883,9 @@ function AlignmentFieldInner({
|
|
|
4862
4883
|
onChange(null);
|
|
4863
4884
|
}, [onChange]);
|
|
4864
4885
|
const alignments = [
|
|
4865
|
-
{ value: "left", icon:
|
|
4866
|
-
{ value: "center", icon:
|
|
4867
|
-
{ value: "right", icon:
|
|
4886
|
+
{ value: "left", icon: AlignLeft, title: "Align left" },
|
|
4887
|
+
{ value: "center", icon: AlignCenter, title: "Align center" },
|
|
4888
|
+
{ value: "right", icon: AlignRight, title: "Align right" }
|
|
4868
4889
|
];
|
|
4869
4890
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
4870
4891
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4878,7 +4899,7 @@ function AlignmentFieldInner({
|
|
|
4878
4899
|
onClick: handleClear,
|
|
4879
4900
|
className: "text-muted-foreground hover:text-destructive",
|
|
4880
4901
|
title: "Reset to default",
|
|
4881
|
-
children: /* @__PURE__ */ jsx(
|
|
4902
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4882
4903
|
}
|
|
4883
4904
|
)
|
|
4884
4905
|
] }),
|
|
@@ -4936,11 +4957,11 @@ function JustifyContentFieldInner({
|
|
|
4936
4957
|
onChange(null);
|
|
4937
4958
|
}, [onChange]);
|
|
4938
4959
|
const options = [
|
|
4939
|
-
{ value: "flex-start", icon:
|
|
4940
|
-
{ value: "center", icon:
|
|
4941
|
-
{ value: "flex-end", icon:
|
|
4942
|
-
{ value: "space-between", icon:
|
|
4943
|
-
{ value: "space-around", icon:
|
|
4960
|
+
{ value: "flex-start", icon: AlignLeft, title: "Start" },
|
|
4961
|
+
{ value: "center", icon: AlignCenter, title: "Center" },
|
|
4962
|
+
{ value: "flex-end", icon: AlignRight, title: "End" },
|
|
4963
|
+
{ value: "space-between", icon: AlignHorizontalDistributeCenter, title: "Space Between" },
|
|
4964
|
+
{ value: "space-around", icon: GripHorizontal, title: "Space Around" }
|
|
4944
4965
|
];
|
|
4945
4966
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
4946
4967
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4954,7 +4975,7 @@ function JustifyContentFieldInner({
|
|
|
4954
4975
|
onClick: handleClear,
|
|
4955
4976
|
className: "text-muted-foreground hover:text-destructive",
|
|
4956
4977
|
title: "Reset to default",
|
|
4957
|
-
children: /* @__PURE__ */ jsx(
|
|
4978
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4958
4979
|
}
|
|
4959
4980
|
)
|
|
4960
4981
|
] }),
|
|
@@ -4996,10 +5017,10 @@ function AlignItemsFieldInner({
|
|
|
4996
5017
|
onChange(null);
|
|
4997
5018
|
}, [onChange]);
|
|
4998
5019
|
const options = [
|
|
4999
|
-
{ value: "flex-start", icon:
|
|
5000
|
-
{ value: "center", icon:
|
|
5001
|
-
{ value: "flex-end", icon:
|
|
5002
|
-
{ value: "stretch", icon:
|
|
5020
|
+
{ value: "flex-start", icon: AlignStartVertical, title: "Start" },
|
|
5021
|
+
{ value: "center", icon: AlignCenterVertical, title: "Center" },
|
|
5022
|
+
{ value: "flex-end", icon: AlignEndVertical, title: "End" },
|
|
5023
|
+
{ value: "stretch", icon: MoveVertical, title: "Stretch" }
|
|
5003
5024
|
];
|
|
5004
5025
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5005
5026
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5013,7 +5034,7 @@ function AlignItemsFieldInner({
|
|
|
5013
5034
|
onClick: handleClear,
|
|
5014
5035
|
className: "text-muted-foreground hover:text-destructive",
|
|
5015
5036
|
title: "Reset to default",
|
|
5016
|
-
children: /* @__PURE__ */ jsx(
|
|
5037
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5017
5038
|
}
|
|
5018
5039
|
)
|
|
5019
5040
|
] }),
|
|
@@ -5087,9 +5108,9 @@ function VerticalAlignmentFieldInner({
|
|
|
5087
5108
|
onChange(null);
|
|
5088
5109
|
}, [onChange]);
|
|
5089
5110
|
const options = [
|
|
5090
|
-
{ value: "flex-start", icon:
|
|
5091
|
-
{ value: "center", icon:
|
|
5092
|
-
{ value: "flex-end", icon:
|
|
5111
|
+
{ value: "flex-start", icon: AlignStartVertical, title: "Top" },
|
|
5112
|
+
{ value: "center", icon: AlignCenterVertical, title: "Center" },
|
|
5113
|
+
{ value: "flex-end", icon: AlignEndVertical, title: "Bottom" }
|
|
5093
5114
|
];
|
|
5094
5115
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5095
5116
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5103,7 +5124,7 @@ function VerticalAlignmentFieldInner({
|
|
|
5103
5124
|
onClick: handleClear,
|
|
5104
5125
|
className: "text-muted-foreground hover:text-destructive",
|
|
5105
5126
|
title: "Reset to default",
|
|
5106
|
-
children: /* @__PURE__ */ jsx(
|
|
5127
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5107
5128
|
}
|
|
5108
5129
|
)
|
|
5109
5130
|
] }),
|
|
@@ -5208,7 +5229,7 @@ function SizeFieldInner({
|
|
|
5208
5229
|
onClick: handleClear,
|
|
5209
5230
|
className: "text-muted-foreground hover:text-destructive",
|
|
5210
5231
|
title: "Reset to default",
|
|
5211
|
-
children: /* @__PURE__ */ jsx(
|
|
5232
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5212
5233
|
}
|
|
5213
5234
|
)
|
|
5214
5235
|
] }),
|
|
@@ -5485,7 +5506,7 @@ function GradientStopEditorInner({
|
|
|
5485
5506
|
onClick: () => onDelete(index),
|
|
5486
5507
|
className: "p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded flex-shrink-0",
|
|
5487
5508
|
title: "Remove stop",
|
|
5488
|
-
children: /* @__PURE__ */ jsx(
|
|
5509
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" })
|
|
5489
5510
|
}
|
|
5490
5511
|
)
|
|
5491
5512
|
] }),
|
|
@@ -5699,7 +5720,7 @@ function GradientEditorInner({ value, onChange, readOnly }) {
|
|
|
5699
5720
|
onClick: handleAddStop,
|
|
5700
5721
|
className: "h-6 text-xs px-2",
|
|
5701
5722
|
children: [
|
|
5702
|
-
/* @__PURE__ */ jsx(
|
|
5723
|
+
/* @__PURE__ */ jsx(Plus, { className: "w-3 h-3 mr-1" }),
|
|
5703
5724
|
"Add Stop"
|
|
5704
5725
|
]
|
|
5705
5726
|
}
|
|
@@ -6188,7 +6209,7 @@ function BackgroundFieldInner({
|
|
|
6188
6209
|
onClick: handleClear,
|
|
6189
6210
|
title: "Clear background",
|
|
6190
6211
|
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",
|
|
6191
|
-
children: /* @__PURE__ */ jsx(
|
|
6212
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
6192
6213
|
}
|
|
6193
6214
|
)
|
|
6194
6215
|
] }),
|
|
@@ -6336,11 +6357,11 @@ function createBackgroundField(config = {}) {
|
|
|
6336
6357
|
};
|
|
6337
6358
|
}
|
|
6338
6359
|
var BREAKPOINT_ICONS = {
|
|
6339
|
-
|
|
6340
|
-
sm:
|
|
6341
|
-
md:
|
|
6342
|
-
lg:
|
|
6343
|
-
xl:
|
|
6360
|
+
xs: Smartphone,
|
|
6361
|
+
sm: Smartphone,
|
|
6362
|
+
md: Tablet,
|
|
6363
|
+
lg: Laptop,
|
|
6364
|
+
xl: Monitor
|
|
6344
6365
|
};
|
|
6345
6366
|
function BreakpointTab({
|
|
6346
6367
|
breakpoint,
|
|
@@ -6380,17 +6401,17 @@ function ResponsiveFieldInner({
|
|
|
6380
6401
|
renderInnerField,
|
|
6381
6402
|
defaultValue
|
|
6382
6403
|
}) {
|
|
6383
|
-
const [activeBreakpoint, setActiveBreakpoint] = useState("
|
|
6404
|
+
const [activeBreakpoint, setActiveBreakpoint] = useState("xs");
|
|
6384
6405
|
const getCurrentValue = useCallback(() => {
|
|
6385
6406
|
if (!value) return defaultValue ?? null;
|
|
6386
|
-
if (activeBreakpoint === "
|
|
6387
|
-
return value.
|
|
6407
|
+
if (activeBreakpoint === "xs") {
|
|
6408
|
+
return value.xs ?? defaultValue ?? null;
|
|
6388
6409
|
}
|
|
6389
6410
|
const override = value[activeBreakpoint];
|
|
6390
6411
|
if (override !== void 0) {
|
|
6391
6412
|
return override;
|
|
6392
6413
|
}
|
|
6393
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "
|
|
6414
|
+
const breakpointOrder = ["xl", "lg", "md", "sm", "xs"];
|
|
6394
6415
|
const activeIndex = breakpointOrder.indexOf(activeBreakpoint);
|
|
6395
6416
|
for (let i = activeIndex + 1; i < breakpointOrder.length; i++) {
|
|
6396
6417
|
const bp = breakpointOrder[i];
|
|
@@ -6404,18 +6425,18 @@ function ResponsiveFieldInner({
|
|
|
6404
6425
|
const hasOverride = useCallback(
|
|
6405
6426
|
(breakpoint) => {
|
|
6406
6427
|
if (!value) return false;
|
|
6407
|
-
if (breakpoint === "
|
|
6428
|
+
if (breakpoint === "xs") return value.xs !== void 0;
|
|
6408
6429
|
return value[breakpoint] !== void 0;
|
|
6409
6430
|
},
|
|
6410
6431
|
[value]
|
|
6411
6432
|
);
|
|
6412
6433
|
const handleInnerChange = useCallback(
|
|
6413
6434
|
(newValue) => {
|
|
6414
|
-
if (activeBreakpoint === "
|
|
6435
|
+
if (activeBreakpoint === "xs") {
|
|
6415
6436
|
if (newValue === null && defaultValue !== void 0) {
|
|
6416
|
-
onChange({ ...value,
|
|
6437
|
+
onChange({ ...value, xs: defaultValue });
|
|
6417
6438
|
} else if (newValue !== null) {
|
|
6418
|
-
onChange({ ...value,
|
|
6439
|
+
onChange({ ...value, xs: newValue });
|
|
6419
6440
|
}
|
|
6420
6441
|
} else {
|
|
6421
6442
|
if (newValue === null) {
|
|
@@ -6423,11 +6444,11 @@ function ResponsiveFieldInner({
|
|
|
6423
6444
|
delete newResponsive[activeBreakpoint];
|
|
6424
6445
|
onChange(newResponsive);
|
|
6425
6446
|
} else {
|
|
6426
|
-
const
|
|
6427
|
-
if (
|
|
6447
|
+
const xs = value?.xs ?? defaultValue;
|
|
6448
|
+
if (xs === void 0) return;
|
|
6428
6449
|
onChange({
|
|
6429
6450
|
...value,
|
|
6430
|
-
|
|
6451
|
+
xs,
|
|
6431
6452
|
[activeBreakpoint]: newValue
|
|
6432
6453
|
});
|
|
6433
6454
|
}
|
|
@@ -6436,7 +6457,7 @@ function ResponsiveFieldInner({
|
|
|
6436
6457
|
[value, onChange, activeBreakpoint, defaultValue]
|
|
6437
6458
|
);
|
|
6438
6459
|
const handleClearOverride = useCallback(() => {
|
|
6439
|
-
if (activeBreakpoint === "
|
|
6460
|
+
if (activeBreakpoint === "xs" || !value) return;
|
|
6440
6461
|
const newResponsive = { ...value };
|
|
6441
6462
|
delete newResponsive[activeBreakpoint];
|
|
6442
6463
|
onChange(newResponsive);
|
|
@@ -6445,7 +6466,7 @@ function ResponsiveFieldInner({
|
|
|
6445
6466
|
onChange(null);
|
|
6446
6467
|
}, [onChange]);
|
|
6447
6468
|
const currentValue = getCurrentValue();
|
|
6448
|
-
const isOverrideBreakpoint = activeBreakpoint !== "
|
|
6469
|
+
const isOverrideBreakpoint = activeBreakpoint !== "xs";
|
|
6449
6470
|
const currentHasOverride = hasOverride(activeBreakpoint);
|
|
6450
6471
|
const overrideCount = value ? ["sm", "md", "lg", "xl"].filter((bp) => value[bp] !== void 0).length : 0;
|
|
6451
6472
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-3", children: [
|
|
@@ -6467,7 +6488,7 @@ function ResponsiveFieldInner({
|
|
|
6467
6488
|
onClick: handleClearAll,
|
|
6468
6489
|
className: "text-muted-foreground hover:text-destructive",
|
|
6469
6490
|
title: "Clear all values",
|
|
6470
|
-
children: /* @__PURE__ */ jsx(
|
|
6491
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6471
6492
|
}
|
|
6472
6493
|
)
|
|
6473
6494
|
] }),
|
|
@@ -6485,10 +6506,10 @@ function ResponsiveFieldInner({
|
|
|
6485
6506
|
bp.key
|
|
6486
6507
|
)) }),
|
|
6487
6508
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
6488
|
-
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "
|
|
6509
|
+
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "xs" ? "Extra small screens (0-639px)" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6489
6510
|
BREAKPOINTS.find((bp) => bp.key === activeBreakpoint)?.minWidth,
|
|
6490
6511
|
"px and up",
|
|
6491
|
-
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from
|
|
6512
|
+
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from xs)" })
|
|
6492
6513
|
] }) }),
|
|
6493
6514
|
isOverrideBreakpoint && currentHasOverride && !readOnly && /* @__PURE__ */ jsx(
|
|
6494
6515
|
Button,
|
|
@@ -6541,18 +6562,17 @@ function createResponsiveField(config) {
|
|
|
6541
6562
|
};
|
|
6542
6563
|
}
|
|
6543
6564
|
var BREAKPOINT_ICONS2 = {
|
|
6544
|
-
|
|
6545
|
-
sm:
|
|
6546
|
-
md:
|
|
6547
|
-
lg:
|
|
6548
|
-
xl:
|
|
6565
|
+
xs: Smartphone,
|
|
6566
|
+
sm: Smartphone,
|
|
6567
|
+
md: Tablet,
|
|
6568
|
+
lg: Laptop,
|
|
6569
|
+
xl: Monitor
|
|
6549
6570
|
};
|
|
6550
6571
|
function VisibilityToggle({
|
|
6551
6572
|
breakpoint,
|
|
6552
6573
|
label,
|
|
6553
6574
|
minWidth,
|
|
6554
6575
|
isVisible,
|
|
6555
|
-
isInherited,
|
|
6556
6576
|
onClick,
|
|
6557
6577
|
disabled
|
|
6558
6578
|
}) {
|
|
@@ -6563,18 +6583,16 @@ function VisibilityToggle({
|
|
|
6563
6583
|
type: "button",
|
|
6564
6584
|
onClick,
|
|
6565
6585
|
disabled,
|
|
6566
|
-
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}
|
|
6586
|
+
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}`,
|
|
6567
6587
|
className: cn2(
|
|
6568
6588
|
"relative flex flex-col items-center justify-center gap-0.5 p-2 rounded-md transition-all flex-1 min-w-[52px]",
|
|
6569
|
-
isVisible ? "bg-emerald-500/
|
|
6570
|
-
isInherited && "opacity-60",
|
|
6589
|
+
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",
|
|
6571
6590
|
disabled && "opacity-50 cursor-not-allowed"
|
|
6572
6591
|
),
|
|
6573
6592
|
children: [
|
|
6574
6593
|
/* @__PURE__ */ jsx(DeviceIcon, { className: "h-4 w-4" }),
|
|
6575
6594
|
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium", children: label }),
|
|
6576
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsx(
|
|
6577
|
-
isInherited && /* @__PURE__ */ jsx("span", { className: "absolute -bottom-0.5 left-1/2 -translate-x-1/2 text-[8px] text-muted-foreground", children: "\u2022" })
|
|
6595
|
+
/* @__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" }) })
|
|
6578
6596
|
]
|
|
6579
6597
|
}
|
|
6580
6598
|
);
|
|
@@ -6585,85 +6603,46 @@ function ResponsiveVisibilityFieldInner({
|
|
|
6585
6603
|
label,
|
|
6586
6604
|
readOnly
|
|
6587
6605
|
}) {
|
|
6588
|
-
const
|
|
6606
|
+
const getVisibility = useCallback(
|
|
6589
6607
|
(breakpoint) => {
|
|
6590
6608
|
const val = value ?? DEFAULT_VISIBILITY;
|
|
6591
|
-
|
|
6592
|
-
return { visible: val.base, inherited: false };
|
|
6593
|
-
}
|
|
6594
|
-
const explicitValue = val[breakpoint];
|
|
6595
|
-
if (explicitValue !== void 0) {
|
|
6596
|
-
return { visible: explicitValue, inherited: false };
|
|
6597
|
-
}
|
|
6598
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "base"];
|
|
6599
|
-
const currentIndex = breakpointOrder.indexOf(breakpoint);
|
|
6600
|
-
for (let i = currentIndex + 1; i < breakpointOrder.length; i++) {
|
|
6601
|
-
const bp = breakpointOrder[i];
|
|
6602
|
-
const bpValue = val[bp];
|
|
6603
|
-
if (bpValue !== void 0) {
|
|
6604
|
-
return { visible: bpValue, inherited: true };
|
|
6605
|
-
}
|
|
6606
|
-
}
|
|
6607
|
-
return { visible: val.base, inherited: true };
|
|
6609
|
+
return val[breakpoint] ?? true;
|
|
6608
6610
|
},
|
|
6609
6611
|
[value]
|
|
6610
6612
|
);
|
|
6611
6613
|
const toggleVisibility = useCallback(
|
|
6612
6614
|
(breakpoint) => {
|
|
6613
|
-
const
|
|
6614
|
-
const
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
});
|
|
6620
|
-
} else {
|
|
6621
|
-
const newValue = {
|
|
6622
|
-
...value ?? DEFAULT_VISIBILITY,
|
|
6623
|
-
[breakpoint]: newVisible
|
|
6624
|
-
};
|
|
6625
|
-
onChange(newValue);
|
|
6626
|
-
}
|
|
6615
|
+
const currentVisible = getVisibility(breakpoint);
|
|
6616
|
+
const newValue = {
|
|
6617
|
+
...value ?? DEFAULT_VISIBILITY,
|
|
6618
|
+
[breakpoint]: !currentVisible
|
|
6619
|
+
};
|
|
6620
|
+
onChange(newValue);
|
|
6627
6621
|
},
|
|
6628
|
-
[value, onChange,
|
|
6622
|
+
[value, onChange, getVisibility]
|
|
6629
6623
|
);
|
|
6630
|
-
const
|
|
6631
|
-
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => {
|
|
6632
|
-
const { visible } = getEffectiveVisibility(bp.key);
|
|
6633
|
-
return !visible;
|
|
6634
|
-
});
|
|
6624
|
+
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => !getVisibility(bp.key));
|
|
6635
6625
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
6636
6626
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6637
|
-
label && /* @__PURE__ */
|
|
6638
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
6639
|
-
overrideCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: [
|
|
6640
|
-
overrideCount,
|
|
6641
|
-
" override",
|
|
6642
|
-
overrideCount !== 1 ? "s" : ""
|
|
6643
|
-
] })
|
|
6644
|
-
] }),
|
|
6627
|
+
label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
6645
6628
|
hasHiddenBreakpoints && /* @__PURE__ */ jsxs("span", { className: "text-xs text-amber-600 flex items-center gap-1", children: [
|
|
6646
|
-
/* @__PURE__ */ jsx(
|
|
6647
|
-
"
|
|
6629
|
+
/* @__PURE__ */ jsx(EyeOff, { className: "h-3 w-3" }),
|
|
6630
|
+
"Partially hidden"
|
|
6648
6631
|
] })
|
|
6649
6632
|
] }),
|
|
6650
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) =>
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
bp.key
|
|
6664
|
-
);
|
|
6665
|
-
}) }),
|
|
6666
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Click to toggle visibility. Changes cascade to larger breakpoints." })
|
|
6633
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) => /* @__PURE__ */ jsx(
|
|
6634
|
+
VisibilityToggle,
|
|
6635
|
+
{
|
|
6636
|
+
breakpoint: bp.key,
|
|
6637
|
+
label: bp.label,
|
|
6638
|
+
minWidth: bp.minWidth,
|
|
6639
|
+
isVisible: getVisibility(bp.key),
|
|
6640
|
+
onClick: () => toggleVisibility(bp.key),
|
|
6641
|
+
disabled: readOnly
|
|
6642
|
+
},
|
|
6643
|
+
bp.key
|
|
6644
|
+
)) }),
|
|
6645
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Toggle visibility per screen size. Each breakpoint is independent." })
|
|
6667
6646
|
] });
|
|
6668
6647
|
}
|
|
6669
6648
|
var ResponsiveVisibilityField = memo(ResponsiveVisibilityFieldInner);
|
|
@@ -6713,7 +6692,7 @@ function CollapsibleSection({ title, defaultOpen = false, children }) {
|
|
|
6713
6692
|
className: "w-full flex items-center justify-between px-3 py-2 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
6714
6693
|
children: [
|
|
6715
6694
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: title }),
|
|
6716
|
-
isOpen ? /* @__PURE__ */ jsx(
|
|
6695
|
+
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" })
|
|
6717
6696
|
]
|
|
6718
6697
|
}
|
|
6719
6698
|
),
|
|
@@ -6847,7 +6826,7 @@ function AnimationFieldInner({
|
|
|
6847
6826
|
onClick: handleClear,
|
|
6848
6827
|
className: "text-muted-foreground hover:text-destructive",
|
|
6849
6828
|
title: "Reset to default",
|
|
6850
|
-
children: /* @__PURE__ */ jsx(
|
|
6829
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6851
6830
|
}
|
|
6852
6831
|
)
|
|
6853
6832
|
] }),
|
|
@@ -7273,7 +7252,7 @@ function TransformFieldInner({
|
|
|
7273
7252
|
onClick: handleClear,
|
|
7274
7253
|
className: "text-muted-foreground hover:text-destructive",
|
|
7275
7254
|
title: "Reset transform",
|
|
7276
|
-
children: /* @__PURE__ */ jsx(
|
|
7255
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
7277
7256
|
}
|
|
7278
7257
|
)
|
|
7279
7258
|
] }),
|
|
@@ -7287,7 +7266,7 @@ function TransformFieldInner({
|
|
|
7287
7266
|
) }),
|
|
7288
7267
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2 p-3 bg-muted/30 rounded-md", children: [
|
|
7289
7268
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
7290
|
-
/* @__PURE__ */ jsx(
|
|
7269
|
+
/* @__PURE__ */ jsx(RotateCw, { className: "h-4 w-4 text-muted-foreground" }),
|
|
7291
7270
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Rotate" })
|
|
7292
7271
|
] }),
|
|
7293
7272
|
/* @__PURE__ */ jsx(
|
|
@@ -7305,7 +7284,7 @@ function TransformFieldInner({
|
|
|
7305
7284
|
/* @__PURE__ */ jsxs("div", { className: "space-y-3 p-3 bg-muted/30 rounded-md", children: [
|
|
7306
7285
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
7307
7286
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7308
|
-
/* @__PURE__ */ jsx(
|
|
7287
|
+
/* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
7309
7288
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Scale" })
|
|
7310
7289
|
] }),
|
|
7311
7290
|
!readOnly && /* @__PURE__ */ jsx(
|
|
@@ -7317,7 +7296,7 @@ function TransformFieldInner({
|
|
|
7317
7296
|
onClick: handleScaleLockToggle,
|
|
7318
7297
|
className: "h-6 w-6",
|
|
7319
7298
|
title: currentValue.scaleLocked ? "Click to unlink X and Y scale" : "Click to link X and Y scale",
|
|
7320
|
-
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(
|
|
7299
|
+
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(Link, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-3 w-3" })
|
|
7321
7300
|
}
|
|
7322
7301
|
)
|
|
7323
7302
|
] }),
|
|
@@ -7449,10 +7428,10 @@ function TransformFieldInner({
|
|
|
7449
7428
|
className: "w-full flex items-center justify-between p-3 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
7450
7429
|
children: [
|
|
7451
7430
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7452
|
-
/* @__PURE__ */ jsx(
|
|
7431
|
+
/* @__PURE__ */ jsx(Box, { className: "h-4 w-4 text-muted-foreground" }),
|
|
7453
7432
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium cursor-pointer", children: "3D Transforms" })
|
|
7454
7433
|
] }),
|
|
7455
|
-
show3D ? /* @__PURE__ */ jsx(
|
|
7434
|
+
show3D ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
7456
7435
|
]
|
|
7457
7436
|
}
|
|
7458
7437
|
),
|