@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React7 from 'react';
|
|
3
3
|
import { createContext, memo, useState, useCallback, useEffect, useRef, useContext, useId, createElement, useMemo } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { X, ChevronDown, ChevronUp, Check, Image, Link, Search, Loader2, AlertCircle, Upload, Trash2, Plus, Unlink, ArrowUp, ArrowRight, ArrowDown, ArrowLeft, MoveHorizontal, Square, SlidersHorizontal, AlignStartHorizontal, AlignCenterHorizontal, AlignEndHorizontal, RefreshCw, 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, Lock, Unlock } from 'lucide-react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -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/fields/shared.ts
|
|
@@ -515,7 +515,7 @@ function transformValueToCSS(transform) {
|
|
|
515
515
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
516
516
|
}
|
|
517
517
|
var BREAKPOINTS = [
|
|
518
|
-
{ key: "
|
|
518
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
519
519
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
520
520
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
521
521
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -523,7 +523,7 @@ var BREAKPOINTS = [
|
|
|
523
523
|
];
|
|
524
524
|
function isResponsiveValue(value) {
|
|
525
525
|
if (!value || typeof value !== "object") return false;
|
|
526
|
-
return "
|
|
526
|
+
return "xs" in value;
|
|
527
527
|
}
|
|
528
528
|
function camelToKebab(str) {
|
|
529
529
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -549,7 +549,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
549
549
|
if (bpValue === void 0) return;
|
|
550
550
|
const cssProps = converter(bpValue);
|
|
551
551
|
if (!cssProps) return;
|
|
552
|
-
if (bp.key === "
|
|
552
|
+
if (bp.key === "xs") {
|
|
553
553
|
baseStyles = cssProps;
|
|
554
554
|
} else {
|
|
555
555
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -563,29 +563,50 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
563
563
|
return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
|
|
564
564
|
}
|
|
565
565
|
var DEFAULT_VISIBILITY = {
|
|
566
|
-
|
|
566
|
+
xs: true,
|
|
567
|
+
sm: true,
|
|
568
|
+
md: true,
|
|
569
|
+
lg: true,
|
|
570
|
+
xl: true
|
|
567
571
|
};
|
|
568
572
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
569
573
|
if (!visibility) return "";
|
|
570
574
|
const mediaQueries = [];
|
|
571
|
-
|
|
572
|
-
|
|
575
|
+
const breakpointWidths = {
|
|
576
|
+
xs: null,
|
|
577
|
+
// 0px
|
|
578
|
+
sm: 640,
|
|
579
|
+
md: 768,
|
|
580
|
+
lg: 1024,
|
|
581
|
+
xl: 1280
|
|
582
|
+
};
|
|
583
|
+
const getNextBreakpointWidth = (bp) => {
|
|
584
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
585
|
+
const index = order.indexOf(bp);
|
|
586
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
587
|
+
return breakpointWidths[order[index + 1]];
|
|
588
|
+
};
|
|
589
|
+
if (visibility.xs === false) {
|
|
590
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
591
|
+
if (nextWidth) {
|
|
592
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
593
|
+
} else {
|
|
594
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
595
|
+
}
|
|
573
596
|
}
|
|
574
|
-
let lastVisibility = visibility.base;
|
|
575
597
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
if (
|
|
598
|
+
if (visibility[bp.key] === false) {
|
|
599
|
+
const minWidth = breakpointWidths[bp.key];
|
|
600
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
601
|
+
if (minWidth && maxWidth) {
|
|
580
602
|
mediaQueries.push(
|
|
581
|
-
`@media (min-width: ${
|
|
603
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
582
604
|
);
|
|
583
|
-
} else {
|
|
605
|
+
} else if (minWidth) {
|
|
584
606
|
mediaQueries.push(
|
|
585
|
-
`@media (min-width: ${
|
|
607
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
586
608
|
);
|
|
587
609
|
}
|
|
588
|
-
lastVisibility = bpValue;
|
|
589
610
|
}
|
|
590
611
|
});
|
|
591
612
|
return mediaQueries.join("\n");
|
|
@@ -1103,7 +1124,7 @@ function ColorPickerFieldInner({
|
|
|
1103
1124
|
onClick: handleClear,
|
|
1104
1125
|
title: "Clear color",
|
|
1105
1126
|
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",
|
|
1106
|
-
children: /* @__PURE__ */ jsx(
|
|
1127
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
1107
1128
|
}
|
|
1108
1129
|
)
|
|
1109
1130
|
] }),
|
|
@@ -1269,7 +1290,7 @@ var DialogContent = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
1269
1290
|
children: [
|
|
1270
1291
|
children,
|
|
1271
1292
|
/* @__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: [
|
|
1272
|
-
/* @__PURE__ */ jsx(
|
|
1293
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1273
1294
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1274
1295
|
] })
|
|
1275
1296
|
]
|
|
@@ -1292,7 +1313,7 @@ var DialogContentFullscreen = React7.forwardRef(({ className, children, hideClos
|
|
|
1292
1313
|
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: accessibleTitle }),
|
|
1293
1314
|
children,
|
|
1294
1315
|
!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: [
|
|
1295
|
-
/* @__PURE__ */ jsx(
|
|
1316
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1296
1317
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1297
1318
|
] })
|
|
1298
1319
|
]
|
|
@@ -1566,10 +1587,10 @@ function MediaFieldInner({
|
|
|
1566
1587
|
onClick: handleRemove,
|
|
1567
1588
|
className: "absolute -top-2 -right-2 p-1 bg-destructive text-destructive-foreground rounded-full opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1568
1589
|
"aria-label": "Remove image",
|
|
1569
|
-
children: /* @__PURE__ */ jsx(
|
|
1590
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
1570
1591
|
}
|
|
1571
1592
|
)
|
|
1572
|
-
] }) : /* @__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(
|
|
1593
|
+
] }) : /* @__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" }) }),
|
|
1573
1594
|
!readOnly && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1574
1595
|
/* @__PURE__ */ jsx(
|
|
1575
1596
|
Button,
|
|
@@ -1593,7 +1614,7 @@ function MediaFieldInner({
|
|
|
1593
1614
|
] })
|
|
1594
1615
|
] }),
|
|
1595
1616
|
value?.url && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
1596
|
-
/* @__PURE__ */ jsx(
|
|
1617
|
+
/* @__PURE__ */ jsx(Link, { className: "h-3 w-3 flex-shrink-0" }),
|
|
1597
1618
|
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[280px]", title: value.url, children: value.url })
|
|
1598
1619
|
] })
|
|
1599
1620
|
] }),
|
|
@@ -1638,7 +1659,7 @@ function MediaFieldInner({
|
|
|
1638
1659
|
)
|
|
1639
1660
|
] }),
|
|
1640
1661
|
activeTab === "browse" && /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
|
|
1641
|
-
/* @__PURE__ */ jsx(
|
|
1662
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
1642
1663
|
/* @__PURE__ */ jsx(
|
|
1643
1664
|
Input,
|
|
1644
1665
|
{
|
|
@@ -1684,7 +1705,7 @@ function MediaFieldInner({
|
|
|
1684
1705
|
onClick: handleLoadMore,
|
|
1685
1706
|
disabled: loading,
|
|
1686
1707
|
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1687
|
-
/* @__PURE__ */ jsx(
|
|
1708
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
1688
1709
|
"Loading..."
|
|
1689
1710
|
] }) : "Load More"
|
|
1690
1711
|
}
|
|
@@ -1714,15 +1735,15 @@ function MediaFieldInner({
|
|
|
1714
1735
|
] })
|
|
1715
1736
|
] }),
|
|
1716
1737
|
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: [
|
|
1717
|
-
/* @__PURE__ */ jsx(
|
|
1738
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
1718
1739
|
/* @__PURE__ */ jsx("span", { children: uploadState.error })
|
|
1719
1740
|
] }),
|
|
1720
1741
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
1721
1742
|
/* @__PURE__ */ jsx(Button, { onClick: handleUpload, disabled: uploadState.uploading, children: uploadState.uploading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1722
|
-
/* @__PURE__ */ jsx(
|
|
1743
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
1723
1744
|
"Uploading..."
|
|
1724
1745
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1725
|
-
/* @__PURE__ */ jsx(
|
|
1746
|
+
/* @__PURE__ */ jsx(Upload, { className: "h-4 w-4 mr-2" }),
|
|
1726
1747
|
"Upload & Select"
|
|
1727
1748
|
] }) }),
|
|
1728
1749
|
/* @__PURE__ */ jsx(
|
|
@@ -1736,7 +1757,7 @@ function MediaFieldInner({
|
|
|
1736
1757
|
)
|
|
1737
1758
|
] })
|
|
1738
1759
|
] }) : /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
1739
|
-
/* @__PURE__ */ jsx(
|
|
1760
|
+
/* @__PURE__ */ jsx(Image, { className: "h-16 w-16 text-muted mx-auto mb-4" }),
|
|
1740
1761
|
/* @__PURE__ */ jsxs("label", { className: "cursor-pointer", children: [
|
|
1741
1762
|
/* @__PURE__ */ jsx(Button, { asChild: true, children: /* @__PURE__ */ jsx("span", { children: "Select Image" }) }),
|
|
1742
1763
|
/* @__PURE__ */ jsx(
|
|
@@ -1756,7 +1777,7 @@ function MediaFieldInner({
|
|
|
1756
1777
|
/* URL Tab */
|
|
1757
1778
|
/* @__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: [
|
|
1758
1779
|
/* @__PURE__ */ jsxs("div", { className: "text-center mb-6", children: [
|
|
1759
|
-
/* @__PURE__ */ jsx(
|
|
1780
|
+
/* @__PURE__ */ jsx(Link, { className: "h-12 w-12 text-muted-foreground mx-auto mb-2" }),
|
|
1760
1781
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Enter an image URL from an external source" })
|
|
1761
1782
|
] }),
|
|
1762
1783
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -1794,10 +1815,10 @@ function MediaFieldInner({
|
|
|
1794
1815
|
onError: handleUrlPreviewError
|
|
1795
1816
|
}
|
|
1796
1817
|
),
|
|
1797
|
-
!urlState.previewLoaded && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx(
|
|
1818
|
+
!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" }) })
|
|
1798
1819
|
] }),
|
|
1799
1820
|
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: [
|
|
1800
|
-
/* @__PURE__ */ jsx(
|
|
1821
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
1801
1822
|
/* @__PURE__ */ jsx("span", { children: urlState.error })
|
|
1802
1823
|
] }),
|
|
1803
1824
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
@@ -1807,7 +1828,7 @@ function MediaFieldInner({
|
|
|
1807
1828
|
onClick: handleUrlSubmit,
|
|
1808
1829
|
disabled: !urlState.url || urlState.loading,
|
|
1809
1830
|
children: [
|
|
1810
|
-
/* @__PURE__ */ jsx(
|
|
1831
|
+
/* @__PURE__ */ jsx(Link, { className: "h-4 w-4 mr-2" }),
|
|
1811
1832
|
"Use This URL"
|
|
1812
1833
|
]
|
|
1813
1834
|
}
|
|
@@ -1850,7 +1871,7 @@ var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
1850
1871
|
...props,
|
|
1851
1872
|
children: [
|
|
1852
1873
|
children,
|
|
1853
|
-
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1874
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
1854
1875
|
]
|
|
1855
1876
|
}
|
|
1856
1877
|
));
|
|
@@ -1864,7 +1885,7 @@ var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /
|
|
|
1864
1885
|
className
|
|
1865
1886
|
),
|
|
1866
1887
|
...props,
|
|
1867
|
-
children: /* @__PURE__ */ jsx(
|
|
1888
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
1868
1889
|
}
|
|
1869
1890
|
));
|
|
1870
1891
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -1877,7 +1898,7 @@ var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
1877
1898
|
className
|
|
1878
1899
|
),
|
|
1879
1900
|
...props,
|
|
1880
|
-
children: /* @__PURE__ */ jsx(
|
|
1901
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
1881
1902
|
}
|
|
1882
1903
|
));
|
|
1883
1904
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -1928,7 +1949,7 @@ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1928
1949
|
),
|
|
1929
1950
|
...props,
|
|
1930
1951
|
children: [
|
|
1931
|
-
/* @__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(
|
|
1952
|
+
/* @__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" }) }) }),
|
|
1932
1953
|
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
1933
1954
|
]
|
|
1934
1955
|
}
|
|
@@ -2067,7 +2088,7 @@ function GradientStopEditorInner({
|
|
|
2067
2088
|
onClick: () => onDelete(index),
|
|
2068
2089
|
className: "p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded flex-shrink-0",
|
|
2069
2090
|
title: "Remove stop",
|
|
2070
|
-
children: /* @__PURE__ */ jsx(
|
|
2091
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" })
|
|
2071
2092
|
}
|
|
2072
2093
|
)
|
|
2073
2094
|
] }),
|
|
@@ -2281,7 +2302,7 @@ function GradientEditorInner({ value, onChange, readOnly }) {
|
|
|
2281
2302
|
onClick: handleAddStop,
|
|
2282
2303
|
className: "h-6 text-xs px-2",
|
|
2283
2304
|
children: [
|
|
2284
|
-
/* @__PURE__ */ jsx(
|
|
2305
|
+
/* @__PURE__ */ jsx(Plus, { className: "w-3 h-3 mr-1" }),
|
|
2285
2306
|
"Add Stop"
|
|
2286
2307
|
]
|
|
2287
2308
|
}
|
|
@@ -2795,7 +2816,7 @@ function BackgroundFieldInner({
|
|
|
2795
2816
|
onClick: handleClear,
|
|
2796
2817
|
title: "Clear background",
|
|
2797
2818
|
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",
|
|
2798
|
-
children: /* @__PURE__ */ jsx(
|
|
2819
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
2799
2820
|
}
|
|
2800
2821
|
)
|
|
2801
2822
|
] }),
|
|
@@ -2971,7 +2992,7 @@ function LockedTextField({
|
|
|
2971
2992
|
transition: "all 0.15s ease"
|
|
2972
2993
|
},
|
|
2973
2994
|
title: isLocked ? "Click to unlock" : "Click to lock",
|
|
2974
|
-
children: isLocked ? /* @__PURE__ */ jsx(
|
|
2995
|
+
children: isLocked ? /* @__PURE__ */ jsx(Lock, { size: 14 }) : /* @__PURE__ */ jsx(Unlock, { size: 14 })
|
|
2975
2996
|
}
|
|
2976
2997
|
)
|
|
2977
2998
|
] }),
|
|
@@ -3000,7 +3021,7 @@ function LockedTextField({
|
|
|
3000
3021
|
}
|
|
3001
3022
|
),
|
|
3002
3023
|
isLocked && /* @__PURE__ */ jsx(
|
|
3003
|
-
|
|
3024
|
+
Lock,
|
|
3004
3025
|
{
|
|
3005
3026
|
size: 14,
|
|
3006
3027
|
style: {
|
|
@@ -3055,7 +3076,7 @@ function LockedRadioField({
|
|
|
3055
3076
|
transition: "all 0.15s ease"
|
|
3056
3077
|
},
|
|
3057
3078
|
title: isLocked ? "Click to unlock" : "Click to lock",
|
|
3058
|
-
children: isLocked ? /* @__PURE__ */ jsx(
|
|
3079
|
+
children: isLocked ? /* @__PURE__ */ jsx(Lock, { size: 14 }) : /* @__PURE__ */ jsx(Unlock, { size: 14 })
|
|
3059
3080
|
}
|
|
3060
3081
|
)
|
|
3061
3082
|
] }),
|
|
@@ -3395,7 +3416,7 @@ function PaddingFieldInner({
|
|
|
3395
3416
|
isLinked ? "" : "text-muted-foreground"
|
|
3396
3417
|
),
|
|
3397
3418
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
3398
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
3419
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
3399
3420
|
}
|
|
3400
3421
|
)
|
|
3401
3422
|
] }),
|
|
@@ -3525,7 +3546,7 @@ function BorderFieldInner({
|
|
|
3525
3546
|
onClick: handleClear,
|
|
3526
3547
|
className: "text-muted-foreground hover:text-destructive",
|
|
3527
3548
|
title: "Clear border",
|
|
3528
|
-
children: /* @__PURE__ */ jsx(
|
|
3549
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
3529
3550
|
}
|
|
3530
3551
|
)
|
|
3531
3552
|
] }),
|
|
@@ -3628,7 +3649,7 @@ function BorderFieldInner({
|
|
|
3628
3649
|
currentValue.sides.top && "bg-primary hover:bg-primary/90"
|
|
3629
3650
|
),
|
|
3630
3651
|
title: "Top border",
|
|
3631
|
-
children: /* @__PURE__ */ jsx(
|
|
3652
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4" })
|
|
3632
3653
|
}
|
|
3633
3654
|
),
|
|
3634
3655
|
/* @__PURE__ */ jsx(
|
|
@@ -3643,7 +3664,7 @@ function BorderFieldInner({
|
|
|
3643
3664
|
currentValue.sides.right && "bg-primary hover:bg-primary/90"
|
|
3644
3665
|
),
|
|
3645
3666
|
title: "Right border",
|
|
3646
|
-
children: /* @__PURE__ */ jsx(
|
|
3667
|
+
children: /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" })
|
|
3647
3668
|
}
|
|
3648
3669
|
),
|
|
3649
3670
|
/* @__PURE__ */ jsx(
|
|
@@ -3658,7 +3679,7 @@ function BorderFieldInner({
|
|
|
3658
3679
|
currentValue.sides.bottom && "bg-primary hover:bg-primary/90"
|
|
3659
3680
|
),
|
|
3660
3681
|
title: "Bottom border",
|
|
3661
|
-
children: /* @__PURE__ */ jsx(
|
|
3682
|
+
children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4" })
|
|
3662
3683
|
}
|
|
3663
3684
|
),
|
|
3664
3685
|
/* @__PURE__ */ jsx(
|
|
@@ -3673,7 +3694,7 @@ function BorderFieldInner({
|
|
|
3673
3694
|
currentValue.sides.left && "bg-primary hover:bg-primary/90"
|
|
3674
3695
|
),
|
|
3675
3696
|
title: "Left border",
|
|
3676
|
-
children: /* @__PURE__ */ jsx(
|
|
3697
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" })
|
|
3677
3698
|
}
|
|
3678
3699
|
)
|
|
3679
3700
|
] }),
|
|
@@ -3936,14 +3957,14 @@ function DimensionsFieldInner({
|
|
|
3936
3957
|
});
|
|
3937
3958
|
}, [advancedMode, currentValue, onChange]);
|
|
3938
3959
|
const modeConfig = [
|
|
3939
|
-
{ mode: "full", icon:
|
|
3940
|
-
{ mode: "contained", icon:
|
|
3941
|
-
{ mode: "custom", icon:
|
|
3960
|
+
{ mode: "full", icon: MoveHorizontal, label: "Full", title: "Full width (100%)" },
|
|
3961
|
+
{ mode: "contained", icon: Square, label: "Contain", title: "Contained (centered with max-width)" },
|
|
3962
|
+
{ mode: "custom", icon: SlidersHorizontal, label: "Custom", title: "Custom width settings" }
|
|
3942
3963
|
];
|
|
3943
3964
|
const alignmentConfig = [
|
|
3944
|
-
{ alignment: "left", icon:
|
|
3945
|
-
{ alignment: "center", icon:
|
|
3946
|
-
{ alignment: "right", icon:
|
|
3965
|
+
{ alignment: "left", icon: AlignStartHorizontal, title: "Align left" },
|
|
3966
|
+
{ alignment: "center", icon: AlignCenterHorizontal, title: "Align center" },
|
|
3967
|
+
{ alignment: "right", icon: AlignEndHorizontal, title: "Align right" }
|
|
3947
3968
|
];
|
|
3948
3969
|
const showWidthControls = currentValue.mode !== "full";
|
|
3949
3970
|
showHeightControls && (advancedMode || currentValue.minHeight?.enabled || currentValue.maxHeight?.enabled);
|
|
@@ -3959,7 +3980,7 @@ function DimensionsFieldInner({
|
|
|
3959
3980
|
onClick: handleClear,
|
|
3960
3981
|
className: "text-muted-foreground hover:text-destructive",
|
|
3961
3982
|
title: "Reset to default",
|
|
3962
|
-
children: /* @__PURE__ */ jsx(
|
|
3983
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
3963
3984
|
}
|
|
3964
3985
|
)
|
|
3965
3986
|
] }),
|
|
@@ -4162,10 +4183,10 @@ function DimensionsFieldInner({
|
|
|
4162
4183
|
disabled: readOnly,
|
|
4163
4184
|
className: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
4164
4185
|
children: advancedMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4165
|
-
/* @__PURE__ */ jsx(
|
|
4186
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3.5 w-3.5 mr-1" }),
|
|
4166
4187
|
"Hide Advanced"
|
|
4167
4188
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4168
|
-
/* @__PURE__ */ jsx(
|
|
4189
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 mr-1" }),
|
|
4169
4190
|
"Show Advanced"
|
|
4170
4191
|
] })
|
|
4171
4192
|
}
|
|
@@ -4278,7 +4299,7 @@ function MarginFieldInner({
|
|
|
4278
4299
|
isLinked ? "" : "text-muted-foreground"
|
|
4279
4300
|
),
|
|
4280
4301
|
title: isLinked ? "Click to unlink (set sides individually)" : "Click to link (all sides same value)",
|
|
4281
|
-
children: isLinked ? /* @__PURE__ */ jsx(
|
|
4302
|
+
children: isLinked ? /* @__PURE__ */ jsx(Link, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-4 w-4" })
|
|
4282
4303
|
}
|
|
4283
4304
|
)
|
|
4284
4305
|
] }),
|
|
@@ -4347,7 +4368,7 @@ function ResetFieldInner({
|
|
|
4347
4368
|
disabled,
|
|
4348
4369
|
className: "w-full text-muted-foreground hover:text-destructive hover:bg-destructive/10 gap-1.5",
|
|
4349
4370
|
children: [
|
|
4350
|
-
/* @__PURE__ */ jsx(
|
|
4371
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "h-3.5 w-3.5" }),
|
|
4351
4372
|
label
|
|
4352
4373
|
]
|
|
4353
4374
|
}
|
|
@@ -4447,7 +4468,7 @@ function CollapsibleSection({ title, defaultOpen = false, children }) {
|
|
|
4447
4468
|
className: "w-full flex items-center justify-between px-3 py-2 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
4448
4469
|
children: [
|
|
4449
4470
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: title }),
|
|
4450
|
-
isOpen ? /* @__PURE__ */ jsx(
|
|
4471
|
+
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" })
|
|
4451
4472
|
]
|
|
4452
4473
|
}
|
|
4453
4474
|
),
|
|
@@ -4581,7 +4602,7 @@ function AnimationFieldInner({
|
|
|
4581
4602
|
onClick: handleClear,
|
|
4582
4603
|
className: "text-muted-foreground hover:text-destructive",
|
|
4583
4604
|
title: "Reset to default",
|
|
4584
|
-
children: /* @__PURE__ */ jsx(
|
|
4605
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4585
4606
|
}
|
|
4586
4607
|
)
|
|
4587
4608
|
] }),
|
|
@@ -4857,11 +4878,11 @@ function createAnimationField(config = {}) {
|
|
|
4857
4878
|
};
|
|
4858
4879
|
}
|
|
4859
4880
|
var BREAKPOINT_ICONS = {
|
|
4860
|
-
|
|
4861
|
-
sm:
|
|
4862
|
-
md:
|
|
4863
|
-
lg:
|
|
4864
|
-
xl:
|
|
4881
|
+
xs: Smartphone,
|
|
4882
|
+
sm: Smartphone,
|
|
4883
|
+
md: Tablet,
|
|
4884
|
+
lg: Laptop,
|
|
4885
|
+
xl: Monitor
|
|
4865
4886
|
};
|
|
4866
4887
|
function BreakpointTab({
|
|
4867
4888
|
breakpoint,
|
|
@@ -4901,17 +4922,17 @@ function ResponsiveFieldInner({
|
|
|
4901
4922
|
renderInnerField,
|
|
4902
4923
|
defaultValue
|
|
4903
4924
|
}) {
|
|
4904
|
-
const [activeBreakpoint, setActiveBreakpoint] = useState("
|
|
4925
|
+
const [activeBreakpoint, setActiveBreakpoint] = useState("xs");
|
|
4905
4926
|
const getCurrentValue = useCallback(() => {
|
|
4906
4927
|
if (!value) return defaultValue ?? null;
|
|
4907
|
-
if (activeBreakpoint === "
|
|
4908
|
-
return value.
|
|
4928
|
+
if (activeBreakpoint === "xs") {
|
|
4929
|
+
return value.xs ?? defaultValue ?? null;
|
|
4909
4930
|
}
|
|
4910
4931
|
const override = value[activeBreakpoint];
|
|
4911
4932
|
if (override !== void 0) {
|
|
4912
4933
|
return override;
|
|
4913
4934
|
}
|
|
4914
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "
|
|
4935
|
+
const breakpointOrder = ["xl", "lg", "md", "sm", "xs"];
|
|
4915
4936
|
const activeIndex = breakpointOrder.indexOf(activeBreakpoint);
|
|
4916
4937
|
for (let i = activeIndex + 1; i < breakpointOrder.length; i++) {
|
|
4917
4938
|
const bp = breakpointOrder[i];
|
|
@@ -4925,18 +4946,18 @@ function ResponsiveFieldInner({
|
|
|
4925
4946
|
const hasOverride = useCallback(
|
|
4926
4947
|
(breakpoint) => {
|
|
4927
4948
|
if (!value) return false;
|
|
4928
|
-
if (breakpoint === "
|
|
4949
|
+
if (breakpoint === "xs") return value.xs !== void 0;
|
|
4929
4950
|
return value[breakpoint] !== void 0;
|
|
4930
4951
|
},
|
|
4931
4952
|
[value]
|
|
4932
4953
|
);
|
|
4933
4954
|
const handleInnerChange = useCallback(
|
|
4934
4955
|
(newValue) => {
|
|
4935
|
-
if (activeBreakpoint === "
|
|
4956
|
+
if (activeBreakpoint === "xs") {
|
|
4936
4957
|
if (newValue === null && defaultValue !== void 0) {
|
|
4937
|
-
onChange({ ...value,
|
|
4958
|
+
onChange({ ...value, xs: defaultValue });
|
|
4938
4959
|
} else if (newValue !== null) {
|
|
4939
|
-
onChange({ ...value,
|
|
4960
|
+
onChange({ ...value, xs: newValue });
|
|
4940
4961
|
}
|
|
4941
4962
|
} else {
|
|
4942
4963
|
if (newValue === null) {
|
|
@@ -4944,11 +4965,11 @@ function ResponsiveFieldInner({
|
|
|
4944
4965
|
delete newResponsive[activeBreakpoint];
|
|
4945
4966
|
onChange(newResponsive);
|
|
4946
4967
|
} else {
|
|
4947
|
-
const
|
|
4948
|
-
if (
|
|
4968
|
+
const xs = value?.xs ?? defaultValue;
|
|
4969
|
+
if (xs === void 0) return;
|
|
4949
4970
|
onChange({
|
|
4950
4971
|
...value,
|
|
4951
|
-
|
|
4972
|
+
xs,
|
|
4952
4973
|
[activeBreakpoint]: newValue
|
|
4953
4974
|
});
|
|
4954
4975
|
}
|
|
@@ -4957,7 +4978,7 @@ function ResponsiveFieldInner({
|
|
|
4957
4978
|
[value, onChange, activeBreakpoint, defaultValue]
|
|
4958
4979
|
);
|
|
4959
4980
|
const handleClearOverride = useCallback(() => {
|
|
4960
|
-
if (activeBreakpoint === "
|
|
4981
|
+
if (activeBreakpoint === "xs" || !value) return;
|
|
4961
4982
|
const newResponsive = { ...value };
|
|
4962
4983
|
delete newResponsive[activeBreakpoint];
|
|
4963
4984
|
onChange(newResponsive);
|
|
@@ -4966,7 +4987,7 @@ function ResponsiveFieldInner({
|
|
|
4966
4987
|
onChange(null);
|
|
4967
4988
|
}, [onChange]);
|
|
4968
4989
|
const currentValue = getCurrentValue();
|
|
4969
|
-
const isOverrideBreakpoint = activeBreakpoint !== "
|
|
4990
|
+
const isOverrideBreakpoint = activeBreakpoint !== "xs";
|
|
4970
4991
|
const currentHasOverride = hasOverride(activeBreakpoint);
|
|
4971
4992
|
const overrideCount = value ? ["sm", "md", "lg", "xl"].filter((bp) => value[bp] !== void 0).length : 0;
|
|
4972
4993
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-3", children: [
|
|
@@ -4988,7 +5009,7 @@ function ResponsiveFieldInner({
|
|
|
4988
5009
|
onClick: handleClearAll,
|
|
4989
5010
|
className: "text-muted-foreground hover:text-destructive",
|
|
4990
5011
|
title: "Clear all values",
|
|
4991
|
-
children: /* @__PURE__ */ jsx(
|
|
5012
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
4992
5013
|
}
|
|
4993
5014
|
)
|
|
4994
5015
|
] }),
|
|
@@ -5006,10 +5027,10 @@ function ResponsiveFieldInner({
|
|
|
5006
5027
|
bp.key
|
|
5007
5028
|
)) }),
|
|
5008
5029
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
5009
|
-
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "
|
|
5030
|
+
/* @__PURE__ */ jsx("span", { children: activeBreakpoint === "xs" ? "Extra small screens (0-639px)" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5010
5031
|
BREAKPOINTS.find((bp) => bp.key === activeBreakpoint)?.minWidth,
|
|
5011
5032
|
"px and up",
|
|
5012
|
-
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from
|
|
5033
|
+
!currentHasOverride && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: " (inheriting from xs)" })
|
|
5013
5034
|
] }) }),
|
|
5014
5035
|
isOverrideBreakpoint && currentHasOverride && !readOnly && /* @__PURE__ */ jsx(
|
|
5015
5036
|
Button,
|
|
@@ -5062,18 +5083,17 @@ function createResponsiveField(config) {
|
|
|
5062
5083
|
};
|
|
5063
5084
|
}
|
|
5064
5085
|
var BREAKPOINT_ICONS2 = {
|
|
5065
|
-
|
|
5066
|
-
sm:
|
|
5067
|
-
md:
|
|
5068
|
-
lg:
|
|
5069
|
-
xl:
|
|
5086
|
+
xs: Smartphone,
|
|
5087
|
+
sm: Smartphone,
|
|
5088
|
+
md: Tablet,
|
|
5089
|
+
lg: Laptop,
|
|
5090
|
+
xl: Monitor
|
|
5070
5091
|
};
|
|
5071
5092
|
function VisibilityToggle({
|
|
5072
5093
|
breakpoint,
|
|
5073
5094
|
label,
|
|
5074
5095
|
minWidth,
|
|
5075
5096
|
isVisible,
|
|
5076
|
-
isInherited,
|
|
5077
5097
|
onClick,
|
|
5078
5098
|
disabled
|
|
5079
5099
|
}) {
|
|
@@ -5084,18 +5104,16 @@ function VisibilityToggle({
|
|
|
5084
5104
|
type: "button",
|
|
5085
5105
|
onClick,
|
|
5086
5106
|
disabled,
|
|
5087
|
-
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}
|
|
5107
|
+
title: `${label}${minWidth ? ` (${minWidth}px+)` : ""}: ${isVisible ? "Visible" : "Hidden"}`,
|
|
5088
5108
|
className: cn2(
|
|
5089
5109
|
"relative flex flex-col items-center justify-center gap-0.5 p-2 rounded-md transition-all flex-1 min-w-[52px]",
|
|
5090
|
-
isVisible ? "bg-emerald-500/
|
|
5091
|
-
isInherited && "opacity-60",
|
|
5110
|
+
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",
|
|
5092
5111
|
disabled && "opacity-50 cursor-not-allowed"
|
|
5093
5112
|
),
|
|
5094
5113
|
children: [
|
|
5095
5114
|
/* @__PURE__ */ jsx(DeviceIcon, { className: "h-4 w-4" }),
|
|
5096
5115
|
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium", children: label }),
|
|
5097
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1", children: isVisible ? /* @__PURE__ */ jsx(
|
|
5098
|
-
isInherited && /* @__PURE__ */ jsx("span", { className: "absolute -bottom-0.5 left-1/2 -translate-x-1/2 text-[8px] text-muted-foreground", children: "\u2022" })
|
|
5116
|
+
/* @__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" }) })
|
|
5099
5117
|
]
|
|
5100
5118
|
}
|
|
5101
5119
|
);
|
|
@@ -5106,85 +5124,46 @@ function ResponsiveVisibilityFieldInner({
|
|
|
5106
5124
|
label,
|
|
5107
5125
|
readOnly
|
|
5108
5126
|
}) {
|
|
5109
|
-
const
|
|
5127
|
+
const getVisibility = useCallback(
|
|
5110
5128
|
(breakpoint) => {
|
|
5111
5129
|
const val = value ?? DEFAULT_VISIBILITY;
|
|
5112
|
-
|
|
5113
|
-
return { visible: val.base, inherited: false };
|
|
5114
|
-
}
|
|
5115
|
-
const explicitValue = val[breakpoint];
|
|
5116
|
-
if (explicitValue !== void 0) {
|
|
5117
|
-
return { visible: explicitValue, inherited: false };
|
|
5118
|
-
}
|
|
5119
|
-
const breakpointOrder = ["xl", "lg", "md", "sm", "base"];
|
|
5120
|
-
const currentIndex = breakpointOrder.indexOf(breakpoint);
|
|
5121
|
-
for (let i = currentIndex + 1; i < breakpointOrder.length; i++) {
|
|
5122
|
-
const bp = breakpointOrder[i];
|
|
5123
|
-
const bpValue = val[bp];
|
|
5124
|
-
if (bpValue !== void 0) {
|
|
5125
|
-
return { visible: bpValue, inherited: true };
|
|
5126
|
-
}
|
|
5127
|
-
}
|
|
5128
|
-
return { visible: val.base, inherited: true };
|
|
5130
|
+
return val[breakpoint] ?? true;
|
|
5129
5131
|
},
|
|
5130
5132
|
[value]
|
|
5131
5133
|
);
|
|
5132
5134
|
const toggleVisibility = useCallback(
|
|
5133
5135
|
(breakpoint) => {
|
|
5134
|
-
const
|
|
5135
|
-
const
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
});
|
|
5141
|
-
} else {
|
|
5142
|
-
const newValue = {
|
|
5143
|
-
...value ?? DEFAULT_VISIBILITY,
|
|
5144
|
-
[breakpoint]: newVisible
|
|
5145
|
-
};
|
|
5146
|
-
onChange(newValue);
|
|
5147
|
-
}
|
|
5136
|
+
const currentVisible = getVisibility(breakpoint);
|
|
5137
|
+
const newValue = {
|
|
5138
|
+
...value ?? DEFAULT_VISIBILITY,
|
|
5139
|
+
[breakpoint]: !currentVisible
|
|
5140
|
+
};
|
|
5141
|
+
onChange(newValue);
|
|
5148
5142
|
},
|
|
5149
|
-
[value, onChange,
|
|
5143
|
+
[value, onChange, getVisibility]
|
|
5150
5144
|
);
|
|
5151
|
-
const
|
|
5152
|
-
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => {
|
|
5153
|
-
const { visible } = getEffectiveVisibility(bp.key);
|
|
5154
|
-
return !visible;
|
|
5155
|
-
});
|
|
5145
|
+
const hasHiddenBreakpoints = BREAKPOINTS.some((bp) => !getVisibility(bp.key));
|
|
5156
5146
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5157
5147
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
5158
|
-
label && /* @__PURE__ */
|
|
5159
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
5160
|
-
overrideCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: [
|
|
5161
|
-
overrideCount,
|
|
5162
|
-
" override",
|
|
5163
|
-
overrideCount !== 1 ? "s" : ""
|
|
5164
|
-
] })
|
|
5165
|
-
] }),
|
|
5148
|
+
label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
|
|
5166
5149
|
hasHiddenBreakpoints && /* @__PURE__ */ jsxs("span", { className: "text-xs text-amber-600 flex items-center gap-1", children: [
|
|
5167
|
-
/* @__PURE__ */ jsx(
|
|
5168
|
-
"
|
|
5150
|
+
/* @__PURE__ */ jsx(EyeOff, { className: "h-3 w-3" }),
|
|
5151
|
+
"Partially hidden"
|
|
5169
5152
|
] })
|
|
5170
5153
|
] }),
|
|
5171
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) =>
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
bp.key
|
|
5185
|
-
);
|
|
5186
|
-
}) }),
|
|
5187
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Click to toggle visibility. Changes cascade to larger breakpoints." })
|
|
5154
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: BREAKPOINTS.map((bp) => /* @__PURE__ */ jsx(
|
|
5155
|
+
VisibilityToggle,
|
|
5156
|
+
{
|
|
5157
|
+
breakpoint: bp.key,
|
|
5158
|
+
label: bp.label,
|
|
5159
|
+
minWidth: bp.minWidth,
|
|
5160
|
+
isVisible: getVisibility(bp.key),
|
|
5161
|
+
onClick: () => toggleVisibility(bp.key),
|
|
5162
|
+
disabled: readOnly
|
|
5163
|
+
},
|
|
5164
|
+
bp.key
|
|
5165
|
+
)) }),
|
|
5166
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Toggle visibility per screen size. Each breakpoint is independent." })
|
|
5188
5167
|
] });
|
|
5189
5168
|
}
|
|
5190
5169
|
var ResponsiveVisibilityField = memo(ResponsiveVisibilityFieldInner);
|
|
@@ -5367,11 +5346,11 @@ function JustifyContentFieldInner({
|
|
|
5367
5346
|
onChange(null);
|
|
5368
5347
|
}, [onChange]);
|
|
5369
5348
|
const options = [
|
|
5370
|
-
{ value: "flex-start", icon:
|
|
5371
|
-
{ value: "center", icon:
|
|
5372
|
-
{ value: "flex-end", icon:
|
|
5373
|
-
{ value: "space-between", icon:
|
|
5374
|
-
{ value: "space-around", icon:
|
|
5349
|
+
{ value: "flex-start", icon: AlignLeft, title: "Start" },
|
|
5350
|
+
{ value: "center", icon: AlignCenter, title: "Center" },
|
|
5351
|
+
{ value: "flex-end", icon: AlignRight, title: "End" },
|
|
5352
|
+
{ value: "space-between", icon: AlignHorizontalDistributeCenter, title: "Space Between" },
|
|
5353
|
+
{ value: "space-around", icon: GripHorizontal, title: "Space Around" }
|
|
5375
5354
|
];
|
|
5376
5355
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5377
5356
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5385,7 +5364,7 @@ function JustifyContentFieldInner({
|
|
|
5385
5364
|
onClick: handleClear,
|
|
5386
5365
|
className: "text-muted-foreground hover:text-destructive",
|
|
5387
5366
|
title: "Reset to default",
|
|
5388
|
-
children: /* @__PURE__ */ jsx(
|
|
5367
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5389
5368
|
}
|
|
5390
5369
|
)
|
|
5391
5370
|
] }),
|
|
@@ -5427,10 +5406,10 @@ function AlignItemsFieldInner({
|
|
|
5427
5406
|
onChange(null);
|
|
5428
5407
|
}, [onChange]);
|
|
5429
5408
|
const options = [
|
|
5430
|
-
{ value: "flex-start", icon:
|
|
5431
|
-
{ value: "center", icon:
|
|
5432
|
-
{ value: "flex-end", icon:
|
|
5433
|
-
{ value: "stretch", icon:
|
|
5409
|
+
{ value: "flex-start", icon: AlignStartVertical, title: "Start" },
|
|
5410
|
+
{ value: "center", icon: AlignCenterVertical, title: "Center" },
|
|
5411
|
+
{ value: "flex-end", icon: AlignEndVertical, title: "End" },
|
|
5412
|
+
{ value: "stretch", icon: MoveVertical, title: "Stretch" }
|
|
5434
5413
|
];
|
|
5435
5414
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
5436
5415
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -5444,7 +5423,7 @@ function AlignItemsFieldInner({
|
|
|
5444
5423
|
onClick: handleClear,
|
|
5445
5424
|
className: "text-muted-foreground hover:text-destructive",
|
|
5446
5425
|
title: "Reset to default",
|
|
5447
|
-
children: /* @__PURE__ */ jsx(
|
|
5426
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
5448
5427
|
}
|
|
5449
5428
|
)
|
|
5450
5429
|
] }),
|
|
@@ -6340,7 +6319,7 @@ function TemplateFieldInner({
|
|
|
6340
6319
|
onClick: handleClearTemplate,
|
|
6341
6320
|
title: "Clear selection",
|
|
6342
6321
|
className: "text-muted-foreground hover:text-foreground",
|
|
6343
|
-
children: /* @__PURE__ */ jsx(
|
|
6322
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6344
6323
|
}
|
|
6345
6324
|
)
|
|
6346
6325
|
] }),
|
|
@@ -6354,7 +6333,7 @@ function TemplateFieldInner({
|
|
|
6354
6333
|
className: "flex-1 gap-1.5",
|
|
6355
6334
|
disabled: loading || saveForm.saving,
|
|
6356
6335
|
children: [
|
|
6357
|
-
saveForm.expanded ? /* @__PURE__ */ jsx(
|
|
6336
|
+
saveForm.expanded ? /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }),
|
|
6358
6337
|
saveForm.expanded ? "Cancel" : "Save as Template"
|
|
6359
6338
|
]
|
|
6360
6339
|
}
|
|
@@ -6368,7 +6347,7 @@ function TemplateFieldInner({
|
|
|
6368
6347
|
className: "gap-1.5",
|
|
6369
6348
|
disabled: loadingTemplate,
|
|
6370
6349
|
children: [
|
|
6371
|
-
loadingTemplate ? /* @__PURE__ */ jsx(
|
|
6350
|
+
loadingTemplate ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }),
|
|
6372
6351
|
"Reload"
|
|
6373
6352
|
]
|
|
6374
6353
|
}
|
|
@@ -6418,7 +6397,7 @@ function TemplateFieldInner({
|
|
|
6418
6397
|
)
|
|
6419
6398
|
] }),
|
|
6420
6399
|
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: [
|
|
6421
|
-
/* @__PURE__ */ jsx(
|
|
6400
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-3.5 w-3.5 flex-shrink-0 mt-0.5" }),
|
|
6422
6401
|
/* @__PURE__ */ jsx("span", { children: saveForm.error })
|
|
6423
6402
|
] }),
|
|
6424
6403
|
/* @__PURE__ */ jsx(
|
|
@@ -6429,17 +6408,17 @@ function TemplateFieldInner({
|
|
|
6429
6408
|
size: "sm",
|
|
6430
6409
|
className: "w-full gap-1.5",
|
|
6431
6410
|
children: saveForm.saving ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6432
|
-
/* @__PURE__ */ jsx(
|
|
6411
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
6433
6412
|
"Saving..."
|
|
6434
6413
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6435
|
-
/* @__PURE__ */ jsx(
|
|
6414
|
+
/* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }),
|
|
6436
6415
|
"Save Template"
|
|
6437
6416
|
] })
|
|
6438
6417
|
}
|
|
6439
6418
|
)
|
|
6440
6419
|
] }),
|
|
6441
6420
|
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: [
|
|
6442
|
-
/* @__PURE__ */ jsx(
|
|
6421
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 flex-shrink-0 mt-0.5" }),
|
|
6443
6422
|
/* @__PURE__ */ jsx("span", { children: error })
|
|
6444
6423
|
] })
|
|
6445
6424
|
] });
|
|
@@ -6576,9 +6555,9 @@ function AlignmentFieldInner({
|
|
|
6576
6555
|
onChange(null);
|
|
6577
6556
|
}, [onChange]);
|
|
6578
6557
|
const alignments = [
|
|
6579
|
-
{ value: "left", icon:
|
|
6580
|
-
{ value: "center", icon:
|
|
6581
|
-
{ value: "right", icon:
|
|
6558
|
+
{ value: "left", icon: AlignLeft, title: "Align left" },
|
|
6559
|
+
{ value: "center", icon: AlignCenter, title: "Align center" },
|
|
6560
|
+
{ value: "right", icon: AlignRight, title: "Align right" }
|
|
6582
6561
|
];
|
|
6583
6562
|
return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-2", children: [
|
|
6584
6563
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -6592,7 +6571,7 @@ function AlignmentFieldInner({
|
|
|
6592
6571
|
onClick: handleClear,
|
|
6593
6572
|
className: "text-muted-foreground hover:text-destructive",
|
|
6594
6573
|
title: "Reset to default",
|
|
6595
|
-
children: /* @__PURE__ */ jsx(
|
|
6574
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
6596
6575
|
}
|
|
6597
6576
|
)
|
|
6598
6577
|
] }),
|
|
@@ -7084,8 +7063,8 @@ function createTiptapExtensions() {
|
|
|
7084
7063
|
multicolor: true
|
|
7085
7064
|
}),
|
|
7086
7065
|
FontSize,
|
|
7087
|
-
Superscript,
|
|
7088
|
-
Subscript
|
|
7066
|
+
Superscript$1,
|
|
7067
|
+
Subscript$1
|
|
7089
7068
|
];
|
|
7090
7069
|
}
|
|
7091
7070
|
function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
@@ -7191,7 +7170,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7191
7170
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
7192
7171
|
isActive: formattingState?.isBold,
|
|
7193
7172
|
title: "Bold",
|
|
7194
|
-
children: /* @__PURE__ */ jsx(
|
|
7173
|
+
children: /* @__PURE__ */ jsx(Bold, { className: ICON_SIZE })
|
|
7195
7174
|
}
|
|
7196
7175
|
),
|
|
7197
7176
|
/* @__PURE__ */ jsx(
|
|
@@ -7200,7 +7179,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7200
7179
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
7201
7180
|
isActive: formattingState?.isItalic,
|
|
7202
7181
|
title: "Italic",
|
|
7203
|
-
children: /* @__PURE__ */ jsx(
|
|
7182
|
+
children: /* @__PURE__ */ jsx(Italic, { className: ICON_SIZE })
|
|
7204
7183
|
}
|
|
7205
7184
|
),
|
|
7206
7185
|
/* @__PURE__ */ jsx(
|
|
@@ -7209,7 +7188,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7209
7188
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
7210
7189
|
isActive: formattingState?.isUnderline,
|
|
7211
7190
|
title: "Underline",
|
|
7212
|
-
children: /* @__PURE__ */ jsx(
|
|
7191
|
+
children: /* @__PURE__ */ jsx(Underline, { className: ICON_SIZE })
|
|
7213
7192
|
}
|
|
7214
7193
|
),
|
|
7215
7194
|
/* @__PURE__ */ jsx(
|
|
@@ -7218,7 +7197,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7218
7197
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
7219
7198
|
isActive: formattingState?.isStrike,
|
|
7220
7199
|
title: "Strikethrough",
|
|
7221
|
-
children: /* @__PURE__ */ jsx(
|
|
7200
|
+
children: /* @__PURE__ */ jsx(Strikethrough, { className: ICON_SIZE })
|
|
7222
7201
|
}
|
|
7223
7202
|
),
|
|
7224
7203
|
/* @__PURE__ */ jsx(
|
|
@@ -7227,7 +7206,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7227
7206
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
7228
7207
|
isActive: formattingState?.isSuperscript,
|
|
7229
7208
|
title: "Superscript",
|
|
7230
|
-
children: /* @__PURE__ */ jsx(
|
|
7209
|
+
children: /* @__PURE__ */ jsx(Superscript, { className: ICON_SIZE })
|
|
7231
7210
|
}
|
|
7232
7211
|
),
|
|
7233
7212
|
/* @__PURE__ */ jsx(
|
|
@@ -7236,7 +7215,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7236
7215
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
7237
7216
|
isActive: formattingState?.isSubscript,
|
|
7238
7217
|
title: "Subscript",
|
|
7239
|
-
children: /* @__PURE__ */ jsx(
|
|
7218
|
+
children: /* @__PURE__ */ jsx(Subscript, { className: ICON_SIZE })
|
|
7240
7219
|
}
|
|
7241
7220
|
),
|
|
7242
7221
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7244,8 +7223,8 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7244
7223
|
ToolbarDropdown,
|
|
7245
7224
|
{
|
|
7246
7225
|
trigger: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
7247
|
-
formattingState?.isH1 ? /* @__PURE__ */ jsx(
|
|
7248
|
-
/* @__PURE__ */ jsx(
|
|
7226
|
+
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 }),
|
|
7227
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3" })
|
|
7249
7228
|
] }),
|
|
7250
7229
|
title: "Text Type",
|
|
7251
7230
|
isActive: formattingState?.isH1 || formattingState?.isH2 || formattingState?.isH3 || formattingState?.isH4 || formattingState?.isH5 || formattingState?.isH6,
|
|
@@ -7254,7 +7233,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7254
7233
|
editor.chain().focus().setParagraph().run();
|
|
7255
7234
|
close();
|
|
7256
7235
|
}, children: [
|
|
7257
|
-
/* @__PURE__ */ jsx(
|
|
7236
|
+
/* @__PURE__ */ jsx(Pilcrow, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7258
7237
|
"Paragraph"
|
|
7259
7238
|
] }),
|
|
7260
7239
|
/* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
@@ -7262,42 +7241,42 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7262
7241
|
editor.chain().focus().toggleHeading({ level: 1 }).run();
|
|
7263
7242
|
close();
|
|
7264
7243
|
}, children: [
|
|
7265
|
-
/* @__PURE__ */ jsx(
|
|
7244
|
+
/* @__PURE__ */ jsx(Heading1, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7266
7245
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-lg", children: "Heading 1" })
|
|
7267
7246
|
] }),
|
|
7268
7247
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7269
7248
|
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
|
7270
7249
|
close();
|
|
7271
7250
|
}, children: [
|
|
7272
|
-
/* @__PURE__ */ jsx(
|
|
7251
|
+
/* @__PURE__ */ jsx(Heading2, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7273
7252
|
/* @__PURE__ */ jsx("span", { className: "font-bold text-base", children: "Heading 2" })
|
|
7274
7253
|
] }),
|
|
7275
7254
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7276
7255
|
editor.chain().focus().toggleHeading({ level: 3 }).run();
|
|
7277
7256
|
close();
|
|
7278
7257
|
}, children: [
|
|
7279
|
-
/* @__PURE__ */ jsx(
|
|
7258
|
+
/* @__PURE__ */ jsx(Heading3, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7280
7259
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Heading 3" })
|
|
7281
7260
|
] }),
|
|
7282
7261
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7283
7262
|
editor.chain().focus().toggleHeading({ level: 4 }).run();
|
|
7284
7263
|
close();
|
|
7285
7264
|
}, children: [
|
|
7286
|
-
/* @__PURE__ */ jsx(
|
|
7265
|
+
/* @__PURE__ */ jsx(Heading4, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7287
7266
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: "Heading 4" })
|
|
7288
7267
|
] }),
|
|
7289
7268
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7290
7269
|
editor.chain().focus().toggleHeading({ level: 5 }).run();
|
|
7291
7270
|
close();
|
|
7292
7271
|
}, children: [
|
|
7293
|
-
/* @__PURE__ */ jsx(
|
|
7272
|
+
/* @__PURE__ */ jsx(Heading5, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7294
7273
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs", children: "Heading 5" })
|
|
7295
7274
|
] }),
|
|
7296
7275
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
7297
7276
|
editor.chain().focus().toggleHeading({ level: 6 }).run();
|
|
7298
7277
|
close();
|
|
7299
7278
|
}, children: [
|
|
7300
|
-
/* @__PURE__ */ jsx(
|
|
7279
|
+
/* @__PURE__ */ jsx(Heading6, { className: cn2(ICON_SIZE, "mr-2") }),
|
|
7301
7280
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs text-gray-600", children: "Heading 6" })
|
|
7302
7281
|
] })
|
|
7303
7282
|
] })
|
|
@@ -7307,7 +7286,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7307
7286
|
/* @__PURE__ */ jsx(
|
|
7308
7287
|
ToolbarDropdown,
|
|
7309
7288
|
{
|
|
7310
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7289
|
+
trigger: /* @__PURE__ */ jsx(ALargeSmall, { className: ICON_SIZE }),
|
|
7311
7290
|
title: "Font Size",
|
|
7312
7291
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7313
7292
|
/* @__PURE__ */ jsx(DropdownLabel, { children: "Presets" }),
|
|
@@ -7393,7 +7372,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7393
7372
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
7394
7373
|
isActive: formattingState?.isBulletList,
|
|
7395
7374
|
title: "Bullet List",
|
|
7396
|
-
children: /* @__PURE__ */ jsx(
|
|
7375
|
+
children: /* @__PURE__ */ jsx(List, { className: ICON_SIZE })
|
|
7397
7376
|
}
|
|
7398
7377
|
),
|
|
7399
7378
|
/* @__PURE__ */ jsx(
|
|
@@ -7402,7 +7381,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7402
7381
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
7403
7382
|
isActive: formattingState?.isOrderedList,
|
|
7404
7383
|
title: "Numbered List",
|
|
7405
|
-
children: /* @__PURE__ */ jsx(
|
|
7384
|
+
children: /* @__PURE__ */ jsx(ListOrdered, { className: ICON_SIZE })
|
|
7406
7385
|
}
|
|
7407
7386
|
),
|
|
7408
7387
|
/* @__PURE__ */ jsx(
|
|
@@ -7411,7 +7390,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7411
7390
|
onClick: () => editor.chain().focus().toggleBlockquote().run(),
|
|
7412
7391
|
isActive: formattingState?.isBlockquote,
|
|
7413
7392
|
title: "Blockquote",
|
|
7414
|
-
children: /* @__PURE__ */ jsx(
|
|
7393
|
+
children: /* @__PURE__ */ jsx(Quote, { className: ICON_SIZE })
|
|
7415
7394
|
}
|
|
7416
7395
|
),
|
|
7417
7396
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7421,7 +7400,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7421
7400
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
7422
7401
|
isActive: formattingState?.isAlignLeft,
|
|
7423
7402
|
title: "Align Left",
|
|
7424
|
-
children: /* @__PURE__ */ jsx(
|
|
7403
|
+
children: /* @__PURE__ */ jsx(AlignLeft, { className: ICON_SIZE })
|
|
7425
7404
|
}
|
|
7426
7405
|
),
|
|
7427
7406
|
/* @__PURE__ */ jsx(
|
|
@@ -7430,7 +7409,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7430
7409
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
7431
7410
|
isActive: formattingState?.isAlignCenter,
|
|
7432
7411
|
title: "Align Center",
|
|
7433
|
-
children: /* @__PURE__ */ jsx(
|
|
7412
|
+
children: /* @__PURE__ */ jsx(AlignCenter, { className: ICON_SIZE })
|
|
7434
7413
|
}
|
|
7435
7414
|
),
|
|
7436
7415
|
/* @__PURE__ */ jsx(
|
|
@@ -7439,7 +7418,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7439
7418
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
7440
7419
|
isActive: formattingState?.isAlignRight,
|
|
7441
7420
|
title: "Align Right",
|
|
7442
|
-
children: /* @__PURE__ */ jsx(
|
|
7421
|
+
children: /* @__PURE__ */ jsx(AlignRight, { className: ICON_SIZE })
|
|
7443
7422
|
}
|
|
7444
7423
|
),
|
|
7445
7424
|
/* @__PURE__ */ jsx(
|
|
@@ -7448,7 +7427,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7448
7427
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
7449
7428
|
isActive: formattingState?.isAlignJustify,
|
|
7450
7429
|
title: "Justify",
|
|
7451
|
-
children: /* @__PURE__ */ jsx(
|
|
7430
|
+
children: /* @__PURE__ */ jsx(AlignJustify, { className: ICON_SIZE })
|
|
7452
7431
|
}
|
|
7453
7432
|
),
|
|
7454
7433
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7459,7 +7438,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7459
7438
|
onClick: () => setIsLinkPopoverOpen(!isLinkPopoverOpen),
|
|
7460
7439
|
isActive: formattingState?.isLink,
|
|
7461
7440
|
title: "Add Link",
|
|
7462
|
-
children: /* @__PURE__ */ jsx(
|
|
7441
|
+
children: /* @__PURE__ */ jsx(Link, { className: ICON_SIZE })
|
|
7463
7442
|
}
|
|
7464
7443
|
),
|
|
7465
7444
|
/* @__PURE__ */ jsx(
|
|
@@ -7475,7 +7454,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7475
7454
|
/* @__PURE__ */ jsx(
|
|
7476
7455
|
ToolbarDropdown,
|
|
7477
7456
|
{
|
|
7478
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7457
|
+
trigger: /* @__PURE__ */ jsx(Palette, { className: ICON_SIZE }),
|
|
7479
7458
|
title: "Text Color",
|
|
7480
7459
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7481
7460
|
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => {
|
|
@@ -7532,7 +7511,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7532
7511
|
/* @__PURE__ */ jsx(
|
|
7533
7512
|
ToolbarDropdown,
|
|
7534
7513
|
{
|
|
7535
|
-
trigger: /* @__PURE__ */ jsx(
|
|
7514
|
+
trigger: /* @__PURE__ */ jsx(Highlighter, { className: ICON_SIZE }),
|
|
7536
7515
|
title: "Highlight",
|
|
7537
7516
|
isActive: formattingState?.isHighlight,
|
|
7538
7517
|
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7563,7 +7542,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7563
7542
|
{
|
|
7564
7543
|
onClick: () => editor.chain().focus().setHorizontalRule().run(),
|
|
7565
7544
|
title: "Horizontal Rule",
|
|
7566
|
-
children: /* @__PURE__ */ jsx(
|
|
7545
|
+
children: /* @__PURE__ */ jsx(Minus, { className: ICON_SIZE })
|
|
7567
7546
|
}
|
|
7568
7547
|
),
|
|
7569
7548
|
/* @__PURE__ */ jsx(
|
|
@@ -7571,7 +7550,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7571
7550
|
{
|
|
7572
7551
|
onClick: () => editor.chain().focus().setHardBreak().run(),
|
|
7573
7552
|
title: "Hard Break (Shift+Enter)",
|
|
7574
|
-
children: /* @__PURE__ */ jsx(
|
|
7553
|
+
children: /* @__PURE__ */ jsx(CornerDownLeft, { className: ICON_SIZE })
|
|
7575
7554
|
}
|
|
7576
7555
|
),
|
|
7577
7556
|
/* @__PURE__ */ jsx("div", { className: TOOLBAR_DIVIDER }),
|
|
@@ -7580,7 +7559,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7580
7559
|
{
|
|
7581
7560
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
7582
7561
|
title: "Clear Formatting",
|
|
7583
|
-
children: /* @__PURE__ */ jsx(
|
|
7562
|
+
children: /* @__PURE__ */ jsx(RemoveFormatting, { className: ICON_SIZE })
|
|
7584
7563
|
}
|
|
7585
7564
|
),
|
|
7586
7565
|
/* @__PURE__ */ jsxs(
|
|
@@ -7603,7 +7582,7 @@ function TiptapFieldInner({ value, onChange, label, readOnly }) {
|
|
|
7603
7582
|
!showSource && "bg-transparent"
|
|
7604
7583
|
),
|
|
7605
7584
|
children: [
|
|
7606
|
-
/* @__PURE__ */ jsx(
|
|
7585
|
+
/* @__PURE__ */ jsx(Code, { className: ICON_SIZE }),
|
|
7607
7586
|
"Source"
|
|
7608
7587
|
]
|
|
7609
7588
|
}
|
|
@@ -7717,7 +7696,7 @@ function TiptapModal({ isOpen, onClose, value, onChange, title }) {
|
|
|
7717
7696
|
justifyContent: "center"
|
|
7718
7697
|
},
|
|
7719
7698
|
title: "Close (Esc)",
|
|
7720
|
-
children: /* @__PURE__ */ jsx(
|
|
7699
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
7721
7700
|
}
|
|
7722
7701
|
)
|
|
7723
7702
|
]
|
|
@@ -7844,7 +7823,7 @@ function TiptapModalFieldInner({ value, onChange, label }) {
|
|
|
7844
7823
|
},
|
|
7845
7824
|
title: "Open full-screen editor",
|
|
7846
7825
|
children: [
|
|
7847
|
-
/* @__PURE__ */ jsx(
|
|
7826
|
+
/* @__PURE__ */ jsx(Maximize2, { size: 14 }),
|
|
7848
7827
|
"Expand"
|
|
7849
7828
|
]
|
|
7850
7829
|
}
|
|
@@ -8075,7 +8054,7 @@ function TransformFieldInner({
|
|
|
8075
8054
|
onClick: handleClear,
|
|
8076
8055
|
className: "text-muted-foreground hover:text-destructive",
|
|
8077
8056
|
title: "Reset transform",
|
|
8078
|
-
children: /* @__PURE__ */ jsx(
|
|
8057
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
8079
8058
|
}
|
|
8080
8059
|
)
|
|
8081
8060
|
] }),
|
|
@@ -8089,7 +8068,7 @@ function TransformFieldInner({
|
|
|
8089
8068
|
) }),
|
|
8090
8069
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2 p-3 bg-muted/30 rounded-md", children: [
|
|
8091
8070
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
8092
|
-
/* @__PURE__ */ jsx(
|
|
8071
|
+
/* @__PURE__ */ jsx(RotateCw, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8093
8072
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Rotate" })
|
|
8094
8073
|
] }),
|
|
8095
8074
|
/* @__PURE__ */ jsx(
|
|
@@ -8107,7 +8086,7 @@ function TransformFieldInner({
|
|
|
8107
8086
|
/* @__PURE__ */ jsxs("div", { className: "space-y-3 p-3 bg-muted/30 rounded-md", children: [
|
|
8108
8087
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
8109
8088
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8110
|
-
/* @__PURE__ */ jsx(
|
|
8089
|
+
/* @__PURE__ */ jsx(Maximize2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8111
8090
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium", children: "Scale" })
|
|
8112
8091
|
] }),
|
|
8113
8092
|
!readOnly && /* @__PURE__ */ jsx(
|
|
@@ -8119,7 +8098,7 @@ function TransformFieldInner({
|
|
|
8119
8098
|
onClick: handleScaleLockToggle,
|
|
8120
8099
|
className: "h-6 w-6",
|
|
8121
8100
|
title: currentValue.scaleLocked ? "Click to unlink X and Y scale" : "Click to link X and Y scale",
|
|
8122
|
-
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(
|
|
8101
|
+
children: currentValue.scaleLocked ? /* @__PURE__ */ jsx(Link, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Unlink, { className: "h-3 w-3" })
|
|
8123
8102
|
}
|
|
8124
8103
|
)
|
|
8125
8104
|
] }),
|
|
@@ -8251,10 +8230,10 @@ function TransformFieldInner({
|
|
|
8251
8230
|
className: "w-full flex items-center justify-between p-3 bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
8252
8231
|
children: [
|
|
8253
8232
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8254
|
-
/* @__PURE__ */ jsx(
|
|
8233
|
+
/* @__PURE__ */ jsx(Box, { className: "h-4 w-4 text-muted-foreground" }),
|
|
8255
8234
|
/* @__PURE__ */ jsx(Label, { className: "text-xs font-medium cursor-pointer", children: "3D Transforms" })
|
|
8256
8235
|
] }),
|
|
8257
|
-
show3D ? /* @__PURE__ */ jsx(
|
|
8236
|
+
show3D ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
|
|
8258
8237
|
]
|
|
8259
8238
|
}
|
|
8260
8239
|
),
|
|
@@ -8529,7 +8508,7 @@ function SizeFieldInner({
|
|
|
8529
8508
|
onClick: handleClear,
|
|
8530
8509
|
className: "text-muted-foreground hover:text-destructive",
|
|
8531
8510
|
title: "Reset to default",
|
|
8532
|
-
children: /* @__PURE__ */ jsx(
|
|
8511
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
8533
8512
|
}
|
|
8534
8513
|
)
|
|
8535
8514
|
] }),
|
|
@@ -9014,7 +8993,7 @@ function AccordionItem({
|
|
|
9014
8993
|
children: [
|
|
9015
8994
|
/* @__PURE__ */ jsx("span", { children: item.title }),
|
|
9016
8995
|
/* @__PURE__ */ jsx(
|
|
9017
|
-
|
|
8996
|
+
ChevronDown,
|
|
9018
8997
|
{
|
|
9019
8998
|
className: cn(
|
|
9020
8999
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|