@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
|
@@ -340,13 +340,13 @@ declare const DEFAULT_TRANSFORM: TransformValue;
|
|
|
340
340
|
* Convert TransformValue to CSS properties object
|
|
341
341
|
*/
|
|
342
342
|
declare function transformValueToCSS(transform: TransformValue | null | undefined): React__default.CSSProperties | undefined;
|
|
343
|
-
type Breakpoint = '
|
|
343
|
+
type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
344
344
|
/**
|
|
345
345
|
* Responsive value that can have different values at different breakpoints.
|
|
346
|
-
*
|
|
346
|
+
* XS (extra small) is required, other breakpoints are optional overrides.
|
|
347
347
|
*/
|
|
348
348
|
interface ResponsiveValue<T> {
|
|
349
|
-
|
|
349
|
+
xs: T;
|
|
350
350
|
sm?: T;
|
|
351
351
|
md?: T;
|
|
352
352
|
lg?: T;
|
|
@@ -407,9 +407,9 @@ declare function responsiveValueToCSS<T>(value: ResponsiveValue<T> | T | null |
|
|
|
407
407
|
* Visibility value for show/hide per breakpoint
|
|
408
408
|
*/
|
|
409
409
|
interface VisibilityValue {
|
|
410
|
-
/**
|
|
411
|
-
|
|
412
|
-
/**
|
|
410
|
+
/** XS (extra small) visibility - true = visible, false = hidden (default: true) */
|
|
411
|
+
xs: boolean;
|
|
412
|
+
/** Small screens (640px+) */
|
|
413
413
|
sm?: boolean;
|
|
414
414
|
/** Override for medium screens (768px+) */
|
|
415
415
|
md?: boolean;
|
|
@@ -424,6 +424,7 @@ interface VisibilityValue {
|
|
|
424
424
|
declare const DEFAULT_VISIBILITY: VisibilityValue;
|
|
425
425
|
/**
|
|
426
426
|
* Converts a VisibilityValue to CSS with display: none media queries.
|
|
427
|
+
* Each breakpoint is independent - generates targeted media queries for hidden breakpoints.
|
|
427
428
|
*
|
|
428
429
|
* @param visibility - The visibility settings per breakpoint
|
|
429
430
|
* @param uniqueId - Unique class name for targeting in media queries
|
|
@@ -340,13 +340,13 @@ declare const DEFAULT_TRANSFORM: TransformValue;
|
|
|
340
340
|
* Convert TransformValue to CSS properties object
|
|
341
341
|
*/
|
|
342
342
|
declare function transformValueToCSS(transform: TransformValue | null | undefined): React__default.CSSProperties | undefined;
|
|
343
|
-
type Breakpoint = '
|
|
343
|
+
type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
344
344
|
/**
|
|
345
345
|
* Responsive value that can have different values at different breakpoints.
|
|
346
|
-
*
|
|
346
|
+
* XS (extra small) is required, other breakpoints are optional overrides.
|
|
347
347
|
*/
|
|
348
348
|
interface ResponsiveValue<T> {
|
|
349
|
-
|
|
349
|
+
xs: T;
|
|
350
350
|
sm?: T;
|
|
351
351
|
md?: T;
|
|
352
352
|
lg?: T;
|
|
@@ -407,9 +407,9 @@ declare function responsiveValueToCSS<T>(value: ResponsiveValue<T> | T | null |
|
|
|
407
407
|
* Visibility value for show/hide per breakpoint
|
|
408
408
|
*/
|
|
409
409
|
interface VisibilityValue {
|
|
410
|
-
/**
|
|
411
|
-
|
|
412
|
-
/**
|
|
410
|
+
/** XS (extra small) visibility - true = visible, false = hidden (default: true) */
|
|
411
|
+
xs: boolean;
|
|
412
|
+
/** Small screens (640px+) */
|
|
413
413
|
sm?: boolean;
|
|
414
414
|
/** Override for medium screens (768px+) */
|
|
415
415
|
md?: boolean;
|
|
@@ -424,6 +424,7 @@ interface VisibilityValue {
|
|
|
424
424
|
declare const DEFAULT_VISIBILITY: VisibilityValue;
|
|
425
425
|
/**
|
|
426
426
|
* Converts a VisibilityValue to CSS with display: none media queries.
|
|
427
|
+
* Each breakpoint is independent - generates targeted media queries for hidden breakpoints.
|
|
427
428
|
*
|
|
428
429
|
* @param visibility - The visibility settings per breakpoint
|
|
429
430
|
* @param uniqueId - Unique class name for targeting in media queries
|
package/examples/README.md
CHANGED
|
@@ -17,6 +17,8 @@ examples/
|
|
|
17
17
|
├── app/
|
|
18
18
|
│ ├── (frontend)/
|
|
19
19
|
│ │ └── page.tsx # Homepage route (root "/")
|
|
20
|
+
│ ├── (manage)/
|
|
21
|
+
│ │ └── layout.tsx # Editor layout (imports Tailwind CSS)
|
|
20
22
|
│ ├── pages/
|
|
21
23
|
│ │ └── [id]/
|
|
22
24
|
│ │ └── edit/
|
|
@@ -65,14 +67,19 @@ export default buildConfig({
|
|
|
65
67
|
cp -r node_modules/@delmaredigital/payload-puck/examples/api/puck src/app/api/
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
### 3. Copy Editor Page
|
|
70
|
+
### 3. Copy Editor Page & Layout
|
|
69
71
|
|
|
70
72
|
```bash
|
|
71
|
-
#
|
|
73
|
+
# Create route group and copy layout (REQUIRED for Tailwind styles)
|
|
72
74
|
mkdir -p src/app/\(manage\)/pages/\[id\]/edit
|
|
75
|
+
cp node_modules/@delmaredigital/payload-puck/examples/app/\(manage\)/layout.tsx src/app/\(manage\)/
|
|
76
|
+
|
|
77
|
+
# Copy editor page
|
|
73
78
|
cp node_modules/@delmaredigital/payload-puck/examples/app/pages/\[id\]/edit/page.tsx src/app/\(manage\)/pages/\[id\]/edit/
|
|
74
79
|
```
|
|
75
80
|
|
|
81
|
+
> **Important:** The layout file imports Tailwind CSS. Without it, the editor will be completely unstyled. Update the CSS import path in `layout.tsx` to match your project's globals.css location.
|
|
82
|
+
|
|
76
83
|
### 4. Copy Frontend Routes
|
|
77
84
|
|
|
78
85
|
```bash
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout for Puck Editor routes
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: This layout must import your Tailwind CSS for the editor to be styled.
|
|
5
|
+
* Update the import path to match your project's globals.css location.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Import your Tailwind CSS - adjust path as needed
|
|
9
|
+
import '@/app/(frontend)/globals.css'
|
|
10
|
+
// Or if your globals.css is elsewhere:
|
|
11
|
+
// import '@/styles/globals.css'
|
|
12
|
+
// import '../globals.css'
|
|
13
|
+
|
|
14
|
+
export const metadata = {
|
|
15
|
+
title: 'Puck Editor',
|
|
16
|
+
description: 'Visual page editor',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function ManageLayout({
|
|
20
|
+
children,
|
|
21
|
+
}: {
|
|
22
|
+
children: React.ReactNode
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
// NOTE: data-theme="light" is required if your CSS uses opacity:0 until theme is set
|
|
26
|
+
// (common FOUC prevention pattern). Adjust to match your theme system.
|
|
27
|
+
<html lang="en" data-theme="light">
|
|
28
|
+
<body>{children}</body>
|
|
29
|
+
</html>
|
|
30
|
+
)
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delmaredigital/payload-puck",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Puck visual page builder plugin for Payload CMS",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -82,10 +82,16 @@
|
|
|
82
82
|
"examples",
|
|
83
83
|
"README.md"
|
|
84
84
|
],
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "tsup",
|
|
87
|
+
"dev": "tsup --watch",
|
|
88
|
+
"typecheck": "tsc --noEmit",
|
|
89
|
+
"prepublishOnly": "pnpm build"
|
|
90
|
+
},
|
|
85
91
|
"peerDependencies": {
|
|
86
92
|
"@measured/puck": ">=0.20.0",
|
|
87
93
|
"@payloadcms/ui": ">=3.0.0",
|
|
88
|
-
"next": ">=15.4.
|
|
94
|
+
"next": ">=15.4.8",
|
|
89
95
|
"payload": ">=3.0.0",
|
|
90
96
|
"react": ">=18.0.0"
|
|
91
97
|
},
|
|
@@ -96,11 +102,12 @@
|
|
|
96
102
|
},
|
|
97
103
|
"dependencies": {
|
|
98
104
|
"@measured/puck-plugin-heading-analyzer": "^0.20.2",
|
|
105
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
99
106
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
100
107
|
"@radix-ui/react-label": "^2.1.8",
|
|
101
108
|
"@radix-ui/react-select": "^2.2.6",
|
|
102
109
|
"@radix-ui/react-slot": "^1.2.4",
|
|
103
|
-
"
|
|
110
|
+
"lucide-react": "^0.469.0",
|
|
104
111
|
"@tiptap/core": "^3.14.0",
|
|
105
112
|
"@tiptap/extension-color": "^3.14.0",
|
|
106
113
|
"@tiptap/extension-highlight": "^3.14.0",
|
|
@@ -148,10 +155,5 @@
|
|
|
148
155
|
"bugs": {
|
|
149
156
|
"url": "https://github.com/delmaredigital/payload-puck/issues"
|
|
150
157
|
},
|
|
151
|
-
"homepage": "https://delmaredigital.com/developers"
|
|
152
|
-
|
|
153
|
-
"build": "tsup",
|
|
154
|
-
"dev": "tsup --watch",
|
|
155
|
-
"typecheck": "tsc --noEmit"
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
+
"homepage": "https://delmaredigital.com/developers"
|
|
159
|
+
}
|