@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/render/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { AnimatedWrapper } from '../AnimatedWrapper';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { memo, useCallback, createElement } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { X } from 'lucide-react';
|
|
7
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import { clsx } from 'clsx';
|
|
@@ -458,7 +458,7 @@ function transformValueToCSS(transform) {
|
|
|
458
458
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
459
459
|
}
|
|
460
460
|
var BREAKPOINTS = [
|
|
461
|
-
{ key: "
|
|
461
|
+
{ key: "xs", label: "XS", minWidth: null },
|
|
462
462
|
{ key: "sm", label: "SM", minWidth: 640 },
|
|
463
463
|
{ key: "md", label: "MD", minWidth: 768 },
|
|
464
464
|
{ key: "lg", label: "LG", minWidth: 1024 },
|
|
@@ -466,7 +466,7 @@ var BREAKPOINTS = [
|
|
|
466
466
|
];
|
|
467
467
|
function isResponsiveValue(value) {
|
|
468
468
|
if (!value || typeof value !== "object") return false;
|
|
469
|
-
return "
|
|
469
|
+
return "xs" in value;
|
|
470
470
|
}
|
|
471
471
|
function camelToKebab(str) {
|
|
472
472
|
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
@@ -492,7 +492,7 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
492
492
|
if (bpValue === void 0) return;
|
|
493
493
|
const cssProps = converter(bpValue);
|
|
494
494
|
if (!cssProps) return;
|
|
495
|
-
if (bp.key === "
|
|
495
|
+
if (bp.key === "xs") {
|
|
496
496
|
baseStyles = cssProps;
|
|
497
497
|
} else {
|
|
498
498
|
const styleString = cssPropertiesToString(cssProps);
|
|
@@ -508,24 +508,41 @@ function responsiveValueToCSS(value, converter, uniqueId) {
|
|
|
508
508
|
function visibilityValueToCSS(visibility, uniqueId) {
|
|
509
509
|
if (!visibility) return "";
|
|
510
510
|
const mediaQueries = [];
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
const breakpointWidths = {
|
|
512
|
+
xs: null,
|
|
513
|
+
// 0px
|
|
514
|
+
sm: 640,
|
|
515
|
+
md: 768,
|
|
516
|
+
lg: 1024,
|
|
517
|
+
xl: 1280
|
|
518
|
+
};
|
|
519
|
+
const getNextBreakpointWidth = (bp) => {
|
|
520
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
521
|
+
const index = order.indexOf(bp);
|
|
522
|
+
if (index === -1 || index === order.length - 1) return null;
|
|
523
|
+
return breakpointWidths[order[index + 1]];
|
|
524
|
+
};
|
|
525
|
+
if (visibility.xs === false) {
|
|
526
|
+
const nextWidth = getNextBreakpointWidth("xs");
|
|
527
|
+
if (nextWidth) {
|
|
528
|
+
mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
|
|
529
|
+
} else {
|
|
530
|
+
mediaQueries.push(`.${uniqueId} { display: none; }`);
|
|
531
|
+
}
|
|
513
532
|
}
|
|
514
|
-
let lastVisibility = visibility.base;
|
|
515
533
|
BREAKPOINTS.slice(1).forEach((bp) => {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
if (
|
|
534
|
+
if (visibility[bp.key] === false) {
|
|
535
|
+
const minWidth = breakpointWidths[bp.key];
|
|
536
|
+
const maxWidth = getNextBreakpointWidth(bp.key);
|
|
537
|
+
if (minWidth && maxWidth) {
|
|
520
538
|
mediaQueries.push(
|
|
521
|
-
`@media (min-width: ${
|
|
539
|
+
`@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
|
|
522
540
|
);
|
|
523
|
-
} else {
|
|
541
|
+
} else if (minWidth) {
|
|
524
542
|
mediaQueries.push(
|
|
525
|
-
`@media (min-width: ${
|
|
543
|
+
`@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
|
|
526
544
|
);
|
|
527
545
|
}
|
|
528
|
-
lastVisibility = bpValue;
|
|
529
546
|
}
|
|
530
547
|
});
|
|
531
548
|
return mediaQueries.join("\n");
|
|
@@ -1563,7 +1580,7 @@ function SizeFieldInner({
|
|
|
1563
1580
|
onClick: handleClear,
|
|
1564
1581
|
className: "text-muted-foreground hover:text-destructive",
|
|
1565
1582
|
title: "Reset to default",
|
|
1566
|
-
children: /* @__PURE__ */ jsx(
|
|
1583
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
1567
1584
|
}
|
|
1568
1585
|
)
|
|
1569
1586
|
] }),
|