@delmaredigital/payload-puck 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/dist/AccordionClient.d.mts +1 -1
- package/dist/AccordionClient.d.ts +1 -1
- package/dist/AccordionClient.js +2 -2
- package/dist/AccordionClient.mjs +2 -2
- package/dist/AnimatedWrapper.d.mts +1 -1
- package/dist/AnimatedWrapper.d.ts +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +196 -217
- package/dist/components/index.mjs +200 -221
- package/dist/config/config.editor.d.mts +1 -1
- package/dist/config/config.editor.d.ts +1 -1
- package/dist/config/config.editor.js +199 -220
- package/dist/config/config.editor.mjs +203 -224
- package/dist/config/index.js +33 -16
- package/dist/config/index.mjs +33 -16
- package/dist/editor/index.js +56 -39
- package/dist/editor/index.mjs +56 -39
- package/dist/fields/index.d.mts +4 -4
- package/dist/fields/index.d.ts +4 -4
- package/dist/fields/index.js +201 -222
- package/dist/fields/index.mjs +205 -226
- package/dist/render/index.js +33 -16
- package/dist/render/index.mjs +33 -16
- package/dist/{shared-DMAF1AcH.d.mts → shared-DeNKN95N.d.mts} +7 -6
- package/dist/{shared-DMAF1AcH.d.ts → shared-DeNKN95N.d.ts} +7 -6
- package/examples/README.md +9 -2
- package/examples/app/(manage)/layout.tsx +31 -0
- package/package.json +13 -10
- package/dist/AccordionClient.js.map +0 -1
- package/dist/AccordionClient.mjs.map +0 -1
- package/dist/AnimatedWrapper.js.map +0 -1
- package/dist/AnimatedWrapper.mjs.map +0 -1
- package/dist/admin/client.js.map +0 -1
- package/dist/admin/client.mjs.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/index.mjs.map +0 -1
- package/dist/components/index.css.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs.map +0 -1
- package/dist/config/config.editor.css.map +0 -1
- package/dist/config/config.editor.js.map +0 -1
- package/dist/config/config.editor.mjs.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/index.mjs.map +0 -1
- package/dist/editor/index.js.map +0 -1
- package/dist/editor/index.mjs.map +0 -1
- package/dist/fields/index.css.map +0 -1
- package/dist/fields/index.js.map +0 -1
- package/dist/fields/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/layouts/index.js.map +0 -1
- package/dist/layouts/index.mjs.map +0 -1
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/index.mjs.map +0 -1
- package/dist/render/index.js.map +0 -1
- package/dist/render/index.mjs.map +0 -1
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
package/dist/config/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var AnimatedWrapper = require('../AnimatedWrapper');
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
7
|
var reactSlot = require('@radix-ui/react-slot');
|
|
8
8
|
var classVarianceAuthority = require('class-variance-authority');
|
|
9
9
|
var clsx = require('clsx');
|
|
@@ -474,7 +474,7 @@ function transformValueToCSS(transform) {
|
|
|
474
474
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
475
475
|
}
|
|
476
476
|
var BREAKPOINTS = [
|
|
477
|
-
{ key: "
|
|
477
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
478
478
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
479
479
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
480
480
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -482,7 +482,7 @@ var BREAKPOINTS = [
|
|
|
482
482
|
];
|
|
483
483
|
function isResponsiveValue(value) {
|
|
484
484
|
if (!value || typeof value !== "object") return false;
|
|
485
|
-
return "
|
|
485
|
+
return "xs" in value;
|
|
486
486
|
}
|
|
487
487
|
function camelToKebab(str) {
|
|
488
488
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -508,7 +508,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
508
508
|
if (bpValue === void 0) return;
|
|
509
509
|
const cssProps = converter(bpValue);
|
|
510
510
|
if (!cssProps) return;
|
|
511
|
-
if (bp.key === "
|
|
511
|
+
if (bp.key === "xs") {
|
|
512
512
|
baseStyles = cssProps;
|
|
513
513
|
} else {
|
|
514
514
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -524,24 +524,41 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
524
524
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
525
525
|
if (!visibility) return "";
|
|
526
526
|
const mediaQueries = [];
|
|
527
|
-
|
|
528
|
-
|
|
527
|
+
const breakpointWidths = {
|
|
528
|
+
xs: null,
|
|
529
|
+
// 0px
|
|
530
|
+
sm: 640,
|
|
531
|
+
md: 768,
|
|
532
|
+
lg: 1024,
|
|
533
|
+
xl: 1280
|
|
534
|
+
};
|
|
535
|
+
const getNextBreakpointWidth = (bp) => {
|
|
536
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
537
|
+
const index = order.indexOf(bp);
|
|
538
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
539
|
+
return breakpointWidths[order[index + 1]];
|
|
540
|
+
};
|
|
541
|
+
if (visibility.xs === false) {
|
|
542
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
543
|
+
if (nextWidth) {
|
|
544
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
545
|
+
} else {
|
|
546
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
547
|
+
}
|
|
529
548
|
}
|
|
530
|
-
let lastVisibility = visibility.base;
|
|
531
549
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if (
|
|
550
|
+
if (visibility[bp.key] === false) {
|
|
551
|
+
const minWidth = breakpointWidths[bp.key];
|
|
552
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
553
|
+
if (minWidth && maxWidth) {
|
|
536
554
|
mediaQueries.push(
|
|
537
|
-
`@media (min-width: ${
|
|
555
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
538
556
|
);
|
|
539
|
-
} else {
|
|
557
|
+
} else if (minWidth) {
|
|
540
558
|
mediaQueries.push(
|
|
541
|
-
`@media (min-width: ${
|
|
559
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
542
560
|
);
|
|
543
561
|
}
|
|
544
|
-
lastVisibility = bpValue;
|
|
545
562
|
}
|
|
546
563
|
});
|
|
547
564
|
return mediaQueries.join("\n");
|
|
@@ -1462,7 +1479,7 @@ function SizeFieldInner({
|
|
|
1462
1479
|
onClick: handleClear,
|
|
1463
1480
|
className: "text-muted-foreground hover:text-destructive",
|
|
1464
1481
|
title: "Reset to default",
|
|
1465
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1482
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
1466
1483
|
}
|
|
1467
1484
|
)
|
|
1468
1485
|
] }),
|
package/dist/config/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { AnimatedWrapper } from '../AnimatedWrapper';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { memo, useCallback, createElement } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { X } from 'lucide-react';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
@@ -452,7 +452,7 @@ function transformValueToCSS(transform) {
|
|
|
452
452
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
453
453
|
}
|
|
454
454
|
var BREAKPOINTS = [
|
|
455
|
-
{ key: "
|
|
455
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
456
456
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
457
457
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
458
458
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -460,7 +460,7 @@ var BREAKPOINTS = [
|
|
|
460
460
|
];
|
|
461
461
|
function isResponsiveValue(value) {
|
|
462
462
|
if (!value || typeof value !== "object") return false;
|
|
463
|
-
return "
|
|
463
|
+
return "xs" in value;
|
|
464
464
|
}
|
|
465
465
|
function camelToKebab(str) {
|
|
466
466
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -486,7 +486,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
486
486
|
if (bpValue === void 0) return;
|
|
487
487
|
const cssProps = converter(bpValue);
|
|
488
488
|
if (!cssProps) return;
|
|
489
|
-
if (bp.key === "
|
|
489
|
+
if (bp.key === "xs") {
|
|
490
490
|
baseStyles = cssProps;
|
|
491
491
|
} else {
|
|
492
492
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -502,24 +502,41 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
502
502
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
503
503
|
if (!visibility) return "";
|
|
504
504
|
const mediaQueries = [];
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
const breakpointWidths = {
|
|
506
|
+
xs: null,
|
|
507
|
+
// 0px
|
|
508
|
+
sm: 640,
|
|
509
|
+
md: 768,
|
|
510
|
+
lg: 1024,
|
|
511
|
+
xl: 1280
|
|
512
|
+
};
|
|
513
|
+
const getNextBreakpointWidth = (bp) => {
|
|
514
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
515
|
+
const index = order.indexOf(bp);
|
|
516
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
517
|
+
return breakpointWidths[order[index + 1]];
|
|
518
|
+
};
|
|
519
|
+
if (visibility.xs === false) {
|
|
520
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
521
|
+
if (nextWidth) {
|
|
522
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
523
|
+
} else {
|
|
524
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
525
|
+
}
|
|
507
526
|
}
|
|
508
|
-
let lastVisibility = visibility.base;
|
|
509
527
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
if (
|
|
528
|
+
if (visibility[bp.key] === false) {
|
|
529
|
+
const minWidth = breakpointWidths[bp.key];
|
|
530
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
531
|
+
if (minWidth && maxWidth) {
|
|
514
532
|
mediaQueries.push(
|
|
515
|
-
`@media (min-width: ${
|
|
533
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
516
534
|
);
|
|
517
|
-
} else {
|
|
535
|
+
} else if (minWidth) {
|
|
518
536
|
mediaQueries.push(
|
|
519
|
-
`@media (min-width: ${
|
|
537
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
520
538
|
);
|
|
521
539
|
}
|
|
522
|
-
lastVisibility = bpValue;
|
|
523
540
|
}
|
|
524
541
|
});
|
|
525
542
|
return mediaQueries.join("\n");
|
|
@@ -1440,7 +1457,7 @@ function SizeFieldInner({
|
|
|
1440
1457
|
onClick: handleClear,
|
|
1441
1458
|
className: "text-muted-foreground hover:text-destructive",
|
|
1442
1459
|
title: "Reset to default",
|
|
1443
|
-
children: /* @__PURE__ */ jsx(
|
|
1460
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
1444
1461
|
}
|
|
1445
1462
|
)
|
|
1446
1463
|
] }),
|
package/dist/editor/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var clsx = require('clsx');
|
|
@@ -54,7 +54,7 @@ var __export = (target, all) => {
|
|
|
54
54
|
};
|
|
55
55
|
function LoadingState({ message = "Loading editor..." }) {
|
|
56
56
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-screen flex items-center justify-center bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
57
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-8 w-8 animate-spin text-gray-600 mx-auto mb-4" }),
|
|
58
58
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: message })
|
|
59
59
|
] }) });
|
|
60
60
|
}
|
|
@@ -182,9 +182,9 @@ var init_VersionHistory = __esm({
|
|
|
182
182
|
disabled,
|
|
183
183
|
className: `${secondaryBtn} disabled:opacity-50 disabled:cursor-not-allowed`,
|
|
184
184
|
children: [
|
|
185
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
186
186
|
"History",
|
|
187
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3 w-3 ml-1 flex-shrink-0" })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
),
|
|
@@ -205,7 +205,7 @@ var init_VersionHistory = __esm({
|
|
|
205
205
|
type: "button",
|
|
206
206
|
onClick: () => setIsOpen(false),
|
|
207
207
|
className: "text-gray-400 hover:text-gray-600 transition-colors p-1",
|
|
208
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
]
|
|
@@ -215,7 +215,7 @@ var init_VersionHistory = __esm({
|
|
|
215
215
|
"div",
|
|
216
216
|
{
|
|
217
217
|
className: "flex items-center justify-center p-8",
|
|
218
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
218
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-5 w-5 animate-spin text-gray-400" })
|
|
219
219
|
}
|
|
220
220
|
) : error ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
221
221
|
"div",
|
|
@@ -282,12 +282,12 @@ var init_VersionHistory = __esm({
|
|
|
282
282
|
disabled: isRestoring,
|
|
283
283
|
className: "text-xs font-medium text-blue-600 hover:text-blue-800 transition-colors disabled:opacity-50 flex items-center gap-1 px-2 py-1 flex-shrink-0",
|
|
284
284
|
children: [
|
|
285
|
-
isRestoring ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
285
|
+
isRestoring ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-3 w-3" }),
|
|
286
286
|
"Restore"
|
|
287
287
|
]
|
|
288
288
|
}
|
|
289
289
|
),
|
|
290
|
-
index === 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
+
index === 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) })
|
|
291
291
|
]
|
|
292
292
|
},
|
|
293
293
|
version.id
|
|
@@ -366,7 +366,7 @@ var init_HeaderActions = __esm({
|
|
|
366
366
|
onClick: onBack,
|
|
367
367
|
className: cn(btnBase, "px-3 py-1.5 bg-white text-gray-700 border border-gray-300 rounded hover:bg-gray-50"),
|
|
368
368
|
children: [
|
|
369
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
369
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
370
370
|
"Back"
|
|
371
371
|
]
|
|
372
372
|
}
|
|
@@ -406,7 +406,7 @@ var init_HeaderActions = __esm({
|
|
|
406
406
|
!isInteractive ? "bg-blue-500 text-white border-blue-500" : "bg-gray-100 text-gray-500 border-gray-200"
|
|
407
407
|
),
|
|
408
408
|
children: [
|
|
409
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
409
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MousePointer, { className: "h-3.5 w-3.5" }),
|
|
410
410
|
"Edit"
|
|
411
411
|
]
|
|
412
412
|
}
|
|
@@ -421,14 +421,14 @@ var init_HeaderActions = __esm({
|
|
|
421
421
|
isInteractive ? "bg-blue-500 text-white border-blue-500" : "bg-gray-100 text-gray-500 border-gray-200"
|
|
422
422
|
),
|
|
423
423
|
children: [
|
|
424
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MousePointerClick, { className: "h-3.5 w-3.5" }),
|
|
425
425
|
"Interactive"
|
|
426
426
|
]
|
|
427
427
|
}
|
|
428
428
|
)
|
|
429
429
|
] }),
|
|
430
430
|
lastSaved && !saveError && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-gray-500 flex items-center gap-1 whitespace-nowrap", children: [
|
|
431
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
431
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-3 w-3 flex-shrink-0" }),
|
|
432
432
|
"Saved ",
|
|
433
433
|
lastSaved.toLocaleTimeString()
|
|
434
434
|
] }),
|
|
@@ -441,7 +441,7 @@ var init_HeaderActions = __esm({
|
|
|
441
441
|
},
|
|
442
442
|
className: "flex items-center gap-1.5 px-2.5 py-1.5 bg-red-50 border border-red-200 rounded-md text-red-700 text-xs font-medium",
|
|
443
443
|
children: [
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
444
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "h-4 w-4 text-red-500 flex-shrink-0" }),
|
|
445
445
|
"Error"
|
|
446
446
|
]
|
|
447
447
|
}
|
|
@@ -458,7 +458,7 @@ var init_HeaderActions = __esm({
|
|
|
458
458
|
onClick: (e) => e.stopPropagation(),
|
|
459
459
|
children: [
|
|
460
460
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 px-5 py-4 border-b border-gray-200 bg-red-50", children: [
|
|
461
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
461
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "h-5 w-5 text-red-600" }) }),
|
|
462
462
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
463
463
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-gray-900", children: "Save Failed" }),
|
|
464
464
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: "Unable to save your changes" })
|
|
@@ -490,7 +490,7 @@ var init_HeaderActions = __esm({
|
|
|
490
490
|
"px-3 py-1.5 bg-blue-600 text-white border border-blue-600 rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
491
491
|
),
|
|
492
492
|
children: [
|
|
493
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
493
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
494
494
|
"Preview"
|
|
495
495
|
]
|
|
496
496
|
}
|
|
@@ -502,7 +502,7 @@ var init_HeaderActions = __esm({
|
|
|
502
502
|
onClick: onPreview,
|
|
503
503
|
className: cn(btnBase, "px-3 py-1.5 bg-white text-gray-700 border border-gray-300 rounded hover:bg-gray-50"),
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
505
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
506
506
|
"View"
|
|
507
507
|
]
|
|
508
508
|
}
|
|
@@ -526,7 +526,7 @@ var init_HeaderActions = __esm({
|
|
|
526
526
|
"px-3 py-1.5 bg-white text-gray-700 border border-gray-300 rounded hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
527
527
|
),
|
|
528
528
|
children: [
|
|
529
|
-
isSaving ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
529
|
+
isSaving ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-1 flex-shrink-0 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Save, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
530
530
|
"Save"
|
|
531
531
|
]
|
|
532
532
|
}
|
|
@@ -542,7 +542,7 @@ var init_HeaderActions = __esm({
|
|
|
542
542
|
"px-3 py-1.5 bg-blue-600 text-white border border-blue-600 rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
543
543
|
),
|
|
544
544
|
children: [
|
|
545
|
-
isSaving ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
545
|
+
isSaving ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-1 flex-shrink-0 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4 mr-1 flex-shrink-0" }),
|
|
546
546
|
"Publish"
|
|
547
547
|
]
|
|
548
548
|
}
|
|
@@ -877,7 +877,7 @@ function transformValueToCSS(transform) {
|
|
|
877
877
|
}
|
|
878
878
|
function isResponsiveValue(value) {
|
|
879
879
|
if (!value || typeof value !== "object") return false;
|
|
880
|
-
return "
|
|
880
|
+
return "xs" in value;
|
|
881
881
|
}
|
|
882
882
|
function camelToKebab(str) {
|
|
883
883
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -903,7 +903,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
903
903
|
if (bpValue === void 0) return;
|
|
904
904
|
const cssProps = converter(bpValue);
|
|
905
905
|
if (!cssProps) return;
|
|
906
|
-
if (bp.key === "
|
|
906
|
+
if (bp.key === "xs") {
|
|
907
907
|
baseStyles = cssProps;
|
|
908
908
|
} else {
|
|
909
909
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -919,24 +919,41 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
919
919
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
920
920
|
if (!visibility) return "";
|
|
921
921
|
const mediaQueries = [];
|
|
922
|
-
|
|
923
|
-
|
|
922
|
+
const breakpointWidths = {
|
|
923
|
+
xs: null,
|
|
924
|
+
// 0px
|
|
925
|
+
sm: 640,
|
|
926
|
+
md: 768,
|
|
927
|
+
lg: 1024,
|
|
928
|
+
xl: 1280
|
|
929
|
+
};
|
|
930
|
+
const getNextBreakpointWidth = (bp) => {
|
|
931
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
932
|
+
const index = order.indexOf(bp);
|
|
933
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
934
|
+
return breakpointWidths[order[index + 1]];
|
|
935
|
+
};
|
|
936
|
+
if (visibility.xs === false) {
|
|
937
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
938
|
+
if (nextWidth) {
|
|
939
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
940
|
+
} else {
|
|
941
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
942
|
+
}
|
|
924
943
|
}
|
|
925
|
-
let lastVisibility = visibility.base;
|
|
926
944
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
if (
|
|
945
|
+
if (visibility[bp.key] === false) {
|
|
946
|
+
const minWidth = breakpointWidths[bp.key];
|
|
947
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
948
|
+
if (minWidth && maxWidth) {
|
|
931
949
|
mediaQueries.push(
|
|
932
|
-
`@media (min-width: ${
|
|
950
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
933
951
|
);
|
|
934
|
-
} else {
|
|
952
|
+
} else if (minWidth) {
|
|
935
953
|
mediaQueries.push(
|
|
936
|
-
`@media (min-width: ${
|
|
954
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
937
955
|
);
|
|
938
956
|
}
|
|
939
|
-
lastVisibility = bpValue;
|
|
940
957
|
}
|
|
941
958
|
});
|
|
942
959
|
return mediaQueries.join("\n");
|
|
@@ -1204,7 +1221,7 @@ var init_shared = __esm({
|
|
|
1204
1221
|
baseline: "items-baseline"
|
|
1205
1222
|
};
|
|
1206
1223
|
BREAKPOINTS = [
|
|
1207
|
-
{ key: "
|
|
1224
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
1208
1225
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
1209
1226
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
1210
1227
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -1468,7 +1485,7 @@ var init_dialog = __esm({
|
|
|
1468
1485
|
children: [
|
|
1469
1486
|
children,
|
|
1470
1487
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1471
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
1472
1489
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
1473
1490
|
] })
|
|
1474
1491
|
]
|
|
@@ -1491,7 +1508,7 @@ var init_dialog = __esm({
|
|
|
1491
1508
|
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "sr-only", children: accessibleTitle }),
|
|
1492
1509
|
children,
|
|
1493
1510
|
!hideCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1494
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1511
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
1495
1512
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
1496
1513
|
] })
|
|
1497
1514
|
]
|
|
@@ -2909,7 +2926,7 @@ function SizeFieldInner({
|
|
|
2909
2926
|
onClick: handleClear,
|
|
2910
2927
|
className: "text-muted-foreground hover:text-destructive",
|
|
2911
2928
|
title: "Reset to default",
|
|
2912
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2929
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
2913
2930
|
}
|
|
2914
2931
|
)
|
|
2915
2932
|
] }),
|
|
@@ -3437,7 +3454,7 @@ function AccordionItem({
|
|
|
3437
3454
|
children: [
|
|
3438
3455
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.title }),
|
|
3439
3456
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3440
|
-
|
|
3457
|
+
lucideReact.ChevronDown,
|
|
3441
3458
|
{
|
|
3442
3459
|
className: cn2(
|
|
3443
3460
|
"h-4 w-4 shrink-0 transition-transform duration-200",
|
|
@@ -3787,7 +3804,7 @@ var init_PreviewModal = __esm({
|
|
|
3787
3804
|
className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 rounded-md transition-colors",
|
|
3788
3805
|
title: "Close preview (Esc)",
|
|
3789
3806
|
children: [
|
|
3790
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3807
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
3791
3808
|
"Close Preview"
|
|
3792
3809
|
]
|
|
3793
3810
|
}
|
|
@@ -3800,7 +3817,7 @@ var init_PreviewModal = __esm({
|
|
|
3800
3817
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-md transition-colors",
|
|
3801
3818
|
title: "Open published page in new tab",
|
|
3802
3819
|
children: [
|
|
3803
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3820
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-4 w-4" }),
|
|
3804
3821
|
"View Page"
|
|
3805
3822
|
]
|
|
3806
3823
|
}
|
|
@@ -3823,7 +3840,7 @@ var init_PreviewModal = __esm({
|
|
|
3823
3840
|
onClick: (e) => e.stopPropagation(),
|
|
3824
3841
|
children: [
|
|
3825
3842
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 px-5 py-4 border-b border-gray-200 bg-amber-50", children: [
|
|
3826
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-amber-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3843
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-amber-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "h-5 w-5 text-amber-600" }) }),
|
|
3827
3844
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3828
3845
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-gray-900", children: "Navigate away?" }),
|
|
3829
3846
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: "This will close the preview" })
|