@delmaredigital/payload-puck 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/dist/AccordionClient.d.mts +1 -1
- package/dist/AccordionClient.d.ts +1 -1
- package/dist/AccordionClient.js +2 -2
- package/dist/AccordionClient.js.map +1 -1
- package/dist/AccordionClient.mjs +2 -2
- package/dist/AccordionClient.mjs.map +1 -1
- package/dist/AnimatedWrapper.d.mts +1 -1
- package/dist/AnimatedWrapper.d.ts +1 -1
- package/dist/AnimatedWrapper.js.map +1 -1
- package/dist/AnimatedWrapper.mjs.map +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +196 -217
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +200 -221
- package/dist/components/index.mjs.map +1 -1
- package/dist/config/config.editor.d.mts +1 -1
- package/dist/config/config.editor.d.ts +1 -1
- package/dist/config/config.editor.js +199 -220
- package/dist/config/config.editor.js.map +1 -1
- package/dist/config/config.editor.mjs +203 -224
- package/dist/config/config.editor.mjs.map +1 -1
- package/dist/config/index.js +33 -16
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.mjs +33 -16
- package/dist/config/index.mjs.map +1 -1
- package/dist/editor/index.js +56 -39
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/index.mjs +56 -39
- package/dist/editor/index.mjs.map +1 -1
- package/dist/fields/index.d.mts +4 -4
- package/dist/fields/index.d.ts +4 -4
- package/dist/fields/index.js +201 -222
- package/dist/fields/index.js.map +1 -1
- package/dist/fields/index.mjs +205 -226
- package/dist/fields/index.mjs.map +1 -1
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/index.mjs.map +1 -1
- package/dist/render/index.js +33 -16
- package/dist/render/index.js.map +1 -1
- package/dist/render/index.mjs +33 -16
- package/dist/render/index.mjs.map +1 -1
- package/dist/{shared-DMAF1AcH.d.mts → shared-DeNKN95N.d.mts} +7 -6
- package/dist/{shared-DMAF1AcH.d.ts → shared-DeNKN95N.d.ts} +7 -6
- package/examples/README.md +9 -2
- package/examples/app/(manage)/layout.tsx +31 -0
- package/package.json +12 -10
package/dist/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
|
] }),
|