@foundrykit/menu-plugin 0.4.2 → 0.5.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.
@@ -0,0 +1,34 @@
1
+ import type { CollectionSlug } from 'payload';
2
+ /**
3
+ * Configuration describing how a mega menu entry can auto-populate its children
4
+ * (and optional featured content) from a related collection.
5
+ */
6
+ export type DynamicSource = {
7
+ /** collection queried for children */
8
+ collection: CollectionSlug;
9
+ /** optional featured resolution from a child (or parent) doc */
10
+ featured?: {
11
+ ctaHrefBuilder?: (doc: Record<string, unknown>) => string;
12
+ ctaLabel?: string;
13
+ descriptionField?: string;
14
+ headingField?: string;
15
+ /** dot-path to an upload/media field */
16
+ imageField?: string;
17
+ };
18
+ /** build a child's href from its doc */
19
+ hrefBuilder: (doc: Record<string, unknown>) => string;
20
+ /** label shown in the admin select */
21
+ label: string;
22
+ /** field on a child doc used as its label */
23
+ labelField: string;
24
+ /** optional limit on children */
25
+ limit?: number;
26
+ /** stable id, stored in the `dynamicSource` field */
27
+ name: string;
28
+ /** collection the editor picks a parent from */
29
+ parentCollection: CollectionSlug;
30
+ /** field on `collection` relating each child to its parent */
31
+ parentField: string;
32
+ /** sort applied to the children query (Payload sort string) */
33
+ sort?: string;
34
+ };
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Configuration describing how a mega menu entry can auto-populate its children
3
+ * (and optional featured content) from a related collection.
4
+ */ export { };
5
+
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\n/**\n * Configuration describing how a mega menu entry can auto-populate its children\n * (and optional featured content) from a related collection.\n */\nexport type DynamicSource = {\n /** collection queried for children */\n collection: CollectionSlug\n /** optional featured resolution from a child (or parent) doc */\n featured?: {\n ctaHrefBuilder?: (doc: Record<string, unknown>) => string\n ctaLabel?: string\n descriptionField?: string\n headingField?: string\n /** dot-path to an upload/media field */\n imageField?: string\n }\n /** build a child's href from its doc */\n hrefBuilder: (doc: Record<string, unknown>) => string\n /** label shown in the admin select */\n label: string\n /** field on a child doc used as its label */\n labelField: string\n /** optional limit on children */\n limit?: number\n /** stable id, stored in the `dynamicSource` field */\n name: string\n /** collection the editor picks a parent from */\n parentCollection: CollectionSlug\n /** field on `collection` relating each child to its parent */\n parentField: string\n /** sort applied to the children query (Payload sort string) */\n sort?: string\n}\n"],"names":[],"mappings":"AAEA;;;CAGC,GACD,WA4BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foundrykit/menu-plugin",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "A plugin for Payload CMS that provides a flexible and customisable menu system.",
5
5
  "license": "MIT",
6
6
  "type": "module",