@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.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
|
] }),
|