@delmaredigital/payload-puck 0.1.3 → 0.2.0

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 CHANGED
@@ -17,6 +17,7 @@ A PayloadCMS plugin for integrating [Puck](https://puckeditor.com) visual page b
17
17
  - [Theming](#theming)
18
18
  - [Layouts](#layouts)
19
19
  - [API Routes](#api-routes)
20
+ - [SEO Fields](#seo-fields)
20
21
  - [Plugin Options](#plugin-options)
21
22
  - [Hybrid Integration](#hybrid-integration)
22
23
  - [License](#license)
@@ -1363,6 +1364,82 @@ createPuckApiRoutesWithId({
1363
1364
 
1364
1365
  ---
1365
1366
 
1367
+ <details>
1368
+ <summary><strong>SEO Fields</strong> — Robots meta, sitemap integration</summary>
1369
+
1370
+ The plugin adds SEO-related fields to each page in the `meta` group:
1371
+
1372
+ | Field | Type | Description |
1373
+ |-------|------|-------------|
1374
+ | `meta.title` | text | Page title for search engines |
1375
+ | `meta.description` | textarea | Meta description |
1376
+ | `meta.image` | upload | Social sharing image |
1377
+ | `meta.noindex` | checkbox | Prevent search engine indexing |
1378
+ | `meta.nofollow` | checkbox | Prevent search engines from following links |
1379
+ | `meta.excludeFromSitemap` | checkbox | Exclude page from XML sitemap |
1380
+
1381
+ **These fields are not automatically wired to your frontend.** You need to implement them based on your setup.
1382
+
1383
+ ### Robots Meta (Next.js App Router)
1384
+
1385
+ In your page's `generateMetadata` function:
1386
+
1387
+ ```typescript
1388
+ // app/(frontend)/[...slug]/page.tsx
1389
+ export async function generateMetadata({ params }): Promise<Metadata> {
1390
+ const page = await getPage(params.slug)
1391
+
1392
+ return {
1393
+ title: page.meta?.title || page.title,
1394
+ description: page.meta?.description,
1395
+ robots: {
1396
+ index: !page.meta?.noindex,
1397
+ follow: !page.meta?.nofollow,
1398
+ },
1399
+ }
1400
+ }
1401
+ ```
1402
+
1403
+ ### Dynamic Sitemap
1404
+
1405
+ Filter out pages marked as excluded in your `sitemap.ts`:
1406
+
1407
+ ```typescript
1408
+ // app/sitemap.ts
1409
+ import type { MetadataRoute } from 'next'
1410
+ import { getPayload } from 'payload'
1411
+ import config from '@payload-config'
1412
+
1413
+ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
1414
+ const baseUrl = 'https://yoursite.com'
1415
+ const payload = await getPayload({ config })
1416
+
1417
+ const { docs: pages } = await payload.find({
1418
+ collection: 'pages',
1419
+ limit: 1000,
1420
+ where: {
1421
+ or: [
1422
+ { 'meta.excludeFromSitemap': { equals: false } },
1423
+ { 'meta.excludeFromSitemap': { exists: false } },
1424
+ ],
1425
+ },
1426
+ select: {
1427
+ slug: true,
1428
+ updatedAt: true,
1429
+ },
1430
+ })
1431
+
1432
+ return pages.map((page) => ({
1433
+ url: `${baseUrl}/${page.slug}`,
1434
+ lastModified: new Date(page.updatedAt),
1435
+ }))
1436
+ }
1437
+ ```
1438
+
1439
+ </details>
1440
+
1441
+ ---
1442
+
1366
1443
  <details>
1367
1444
  <summary><strong>Plugin Options</strong> — Collection config, access control</summary>
1368
1445
 
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ColorValue, P as PaddingValue, B as BackgroundValue, D as DimensionsValue, T as TransformValue, A as AnimationValue } from './shared-DeNKN95N.mjs';
2
+ import { C as ColorValue, P as PaddingValue, B as BackgroundValue, D as DimensionsValue, T as TransformValue, A as AnimationValue } from './shared-X9UpCJKW.mjs';
3
3
  import 'react';
4
4
  import '@measured/puck';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ColorValue, P as PaddingValue, B as BackgroundValue, D as DimensionsValue, T as TransformValue, A as AnimationValue } from './shared-DeNKN95N.js';
2
+ import { C as ColorValue, P as PaddingValue, B as BackgroundValue, D as DimensionsValue, T as TransformValue, A as AnimationValue } from './shared-X9UpCJKW.js';
3
3
  import 'react';
4
4
  import '@measured/puck';
5
5
 
@@ -767,9 +767,9 @@ function AccordionClient({
767
767
  Object.assign(style, transformStyles);
768
768
  }
769
769
  if (!items || items.length === 0) {
770
- return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
770
+ return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
771
771
  }
772
- return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
772
+ return /* @__PURE__ */ jsxRuntime.jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
773
773
  AccordionItem,
774
774
  {
775
775
  item,
@@ -765,9 +765,9 @@ function AccordionClient({
765
765
  Object.assign(style, transformStyles);
766
766
  }
767
767
  if (!items || items.length === 0) {
768
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
768
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-muted-foreground", children: "No accordion items. Add items in the editor." }) }) }) });
769
769
  }
770
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsx(
770
+ return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: accordionClasses, style: accordionStyle, children: items.map((item, index) => /* @__PURE__ */ jsx(
771
771
  AccordionItem,
772
772
  {
773
773
  item,
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties, ElementType } from 'react';
3
- import { A as AnimationValue } from './shared-DeNKN95N.mjs';
3
+ import { A as AnimationValue } from './shared-X9UpCJKW.mjs';
4
4
  import '@measured/puck';
5
5
 
6
6
  interface AnimatedWrapperProps {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties, ElementType } from 'react';
3
- import { A as AnimationValue } from './shared-DeNKN95N.js';
3
+ import { A as AnimationValue } from './shared-X9UpCJKW.js';
4
4
  import '@measured/puck';
5
5
 
6
6
  interface AnimatedWrapperProps {
@@ -1,5 +1,5 @@
1
1
  import { ComponentConfig } from '@measured/puck';
2
- import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-DeNKN95N.mjs';
2
+ import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-X9UpCJKW.mjs';
3
3
  export { AnimatedWrapper, AnimatedWrapperProps } from '../AnimatedWrapper.mjs';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
@@ -7,18 +7,15 @@ import 'react';
7
7
  /**
8
8
  * Container Component - Puck Configuration
9
9
  *
10
- * Content wrapper with max-width and background options.
10
+ * Simple organizational wrapper for grouping content.
11
11
  * Uses Puck's slot system for nesting other components.
12
- * Uses Tailwind classes for layout, inline styles for dynamic user values.
13
12
  *
14
- * Supports both preset options and advanced custom styling:
15
- * - Outer (Section): background, customPadding, border (applies to full-width wrapper)
16
- * - Inner (Content): innerBackground, innerPadding, innerBorder (applies to max-width container)
13
+ * For two-layer layouts (full-bleed background with constrained content),
14
+ * use the Section component instead.
17
15
  *
18
16
  * Responsive Controls:
19
- * - dimensions: Different max-width at different breakpoints
20
- * - customPadding: Different outer padding at different breakpoints
21
- * - innerPadding: Different inner padding at different breakpoints
17
+ * - dimensions: Different max-width/min-height at different breakpoints
18
+ * - padding: Different padding at different breakpoints
22
19
  * - margin: Different margins at different breakpoints
23
20
  * - visibility: Show/hide at different breakpoints
24
21
  */
@@ -65,18 +62,18 @@ declare const GridConfig: ComponentConfig;
65
62
  /**
66
63
  * Section Component - Puck Configuration
67
64
  *
68
- * Full-width section with background options and content slot.
69
- * Used as a top-level page section wrapper.
70
- * Uses Tailwind classes for layout, inline styles for dynamic user values.
65
+ * Full-width section with two-layer architecture:
66
+ * - Section layer (outer): Full-bleed background, border, padding, margin
67
+ * - Content layer (inner): Constrained content area with max-width, background, border, padding
71
68
  *
72
- * Supports both preset options and advanced custom styling:
73
- * - Background: unified BackgroundField (solid, gradient, or image)
74
- * - Advanced: customPadding, customWidth, border
69
+ * This design enables common patterns like hero sections with full-bleed backgrounds
70
+ * but centered content.
75
71
  *
76
72
  * Responsive Controls:
77
- * - dimensions: Different dimensions at different breakpoints
78
- * - customPadding: Different padding at different breakpoints
79
- * - margin: Different margins at different breakpoints
73
+ * - contentDimensions: Different max-width/min-height at different breakpoints
74
+ * - sectionPadding: Different section padding at different breakpoints
75
+ * - contentPadding: Different content padding at different breakpoints
76
+ * - sectionMargin: Different margins at different breakpoints
80
77
  * - visibility: Show/hide at different breakpoints
81
78
  */
82
79
 
@@ -1,5 +1,5 @@
1
1
  import { ComponentConfig } from '@measured/puck';
2
- import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-DeNKN95N.js';
2
+ import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-X9UpCJKW.js';
3
3
  export { AnimatedWrapper, AnimatedWrapperProps } from '../AnimatedWrapper.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
@@ -7,18 +7,15 @@ import 'react';
7
7
  /**
8
8
  * Container Component - Puck Configuration
9
9
  *
10
- * Content wrapper with max-width and background options.
10
+ * Simple organizational wrapper for grouping content.
11
11
  * Uses Puck's slot system for nesting other components.
12
- * Uses Tailwind classes for layout, inline styles for dynamic user values.
13
12
  *
14
- * Supports both preset options and advanced custom styling:
15
- * - Outer (Section): background, customPadding, border (applies to full-width wrapper)
16
- * - Inner (Content): innerBackground, innerPadding, innerBorder (applies to max-width container)
13
+ * For two-layer layouts (full-bleed background with constrained content),
14
+ * use the Section component instead.
17
15
  *
18
16
  * Responsive Controls:
19
- * - dimensions: Different max-width at different breakpoints
20
- * - customPadding: Different outer padding at different breakpoints
21
- * - innerPadding: Different inner padding at different breakpoints
17
+ * - dimensions: Different max-width/min-height at different breakpoints
18
+ * - padding: Different padding at different breakpoints
22
19
  * - margin: Different margins at different breakpoints
23
20
  * - visibility: Show/hide at different breakpoints
24
21
  */
@@ -65,18 +62,18 @@ declare const GridConfig: ComponentConfig;
65
62
  /**
66
63
  * Section Component - Puck Configuration
67
64
  *
68
- * Full-width section with background options and content slot.
69
- * Used as a top-level page section wrapper.
70
- * Uses Tailwind classes for layout, inline styles for dynamic user values.
65
+ * Full-width section with two-layer architecture:
66
+ * - Section layer (outer): Full-bleed background, border, padding, margin
67
+ * - Content layer (inner): Constrained content area with max-width, background, border, padding
71
68
  *
72
- * Supports both preset options and advanced custom styling:
73
- * - Background: unified BackgroundField (solid, gradient, or image)
74
- * - Advanced: customPadding, customWidth, border
69
+ * This design enables common patterns like hero sections with full-bleed backgrounds
70
+ * but centered content.
75
71
  *
76
72
  * Responsive Controls:
77
- * - dimensions: Different dimensions at different breakpoints
78
- * - customPadding: Different padding at different breakpoints
79
- * - margin: Different margins at different breakpoints
73
+ * - contentDimensions: Different max-width/min-height at different breakpoints
74
+ * - sectionPadding: Different section padding at different breakpoints
75
+ * - contentPadding: Different content padding at different breakpoints
76
+ * - sectionMargin: Different margins at different breakpoints
80
77
  * - visibility: Show/hide at different breakpoints
81
78
  */
82
79