@bison-lab/payload-core 3.20.0 → 3.22.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.
@@ -1,2 +1,2 @@
1
- import { a as NAVIGATION_FOOTER_DB_NAME, c as NavigationDoc, l as NavigationFooter, o as NAVIGATION_FOOTER_SLUG, r as NAVIGATION_DB_NAME, s as NAVIGATION_SLUG, t as getNavigation, u as NavigationHeader } from "./published-C49gmzAL.mjs";
2
- export { NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, type NavigationDoc, type NavigationFooter, type NavigationHeader, getNavigation };
1
+ import { a as NAVIGATION_FOOTER_DB_NAME, c as NavigationBar, d as NavigationHeader, l as NavigationDoc, o as NAVIGATION_FOOTER_SLUG, r as NAVIGATION_DB_NAME, s as NAVIGATION_SLUG, t as getNavigation, u as NavigationFooter } from "./published-BtEiv0lH.mjs";
2
+ export { NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, type NavigationBar, type NavigationDoc, type NavigationFooter, type NavigationHeader, getNavigation };
@@ -1,2 +1,2 @@
1
- import { a as NAVIGATION_FOOTER_SLUG, i as NAVIGATION_FOOTER_DB_NAME, n as NAVIGATION_DB_NAME, o as NAVIGATION_SLUG, t as getNavigation } from "./published-ByS86dhW.mjs";
1
+ import { a as NAVIGATION_FOOTER_SLUG, i as NAVIGATION_FOOTER_DB_NAME, n as NAVIGATION_DB_NAME, o as NAVIGATION_SLUG, t as getNavigation } from "./published-Chd5PFhw.mjs";
2
2
  export { NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, getNavigation };
@@ -34,12 +34,18 @@ interface NavigationHeader {
34
34
  items?: unknown;
35
35
  cta?: unknown;
36
36
  }
37
+ interface NavigationBar {
38
+ hideOnScroll?: boolean | null;
39
+ viewport?: boolean | null;
40
+ defaultMaxWidth?: ("narrow" | "standard" | "wide") | null;
41
+ }
37
42
  interface NavigationFooter {
38
43
  columns?: unknown;
39
44
  }
40
45
  interface NavigationDoc {
41
46
  header: NavigationHeader;
42
47
  footer: NavigationFooter;
48
+ bar: NavigationBar;
43
49
  }
44
50
  interface GetNavigationArgs {
45
51
  payload: {
@@ -55,14 +61,16 @@ interface GetNavigationArgs {
55
61
  //#endregion
56
62
  //#region src/navigation/published.d.ts
57
63
  /**
58
- * Reads Header and Footer and returns one `{ header, footer }`. A site
59
- * header does not learn two slugs. `draft: true` reads the newest
60
- * version; omit it (or pass false) for the published documents.
64
+ * Reads Header and Footer and returns one `{ header, footer, bar }`. A
65
+ * site header does not learn two slugs. `bar` is the hidden Header group
66
+ * (hide on scroll, viewport, default panel width). `draft: true`
67
+ * reads the newest version; omit it (or pass false) for the published
68
+ * documents.
61
69
  */
62
70
  declare function getNavigation({
63
71
  payload,
64
72
  draft
65
73
  }: GetNavigationArgs): Promise<NavigationDoc>;
66
74
  //#endregion
67
- export { NAVIGATION_FOOTER_DB_NAME as a, NavigationDoc as c, NAVIGATION_FEATURE as i, NavigationFooter as l, CreateNavigationOptions as n, NAVIGATION_FOOTER_SLUG as o, NAVIGATION_DB_NAME as r, NAVIGATION_SLUG as s, getNavigation as t, NavigationHeader as u };
68
- //# sourceMappingURL=published-C49gmzAL.d.mts.map
75
+ export { NAVIGATION_FOOTER_DB_NAME as a, NavigationBar as c, NavigationHeader as d, NAVIGATION_FEATURE as i, NavigationDoc as l, CreateNavigationOptions as n, NAVIGATION_FOOTER_SLUG as o, NAVIGATION_DB_NAME as r, NAVIGATION_SLUG as s, getNavigation as t, NavigationFooter as u };
76
+ //# sourceMappingURL=published-BtEiv0lH.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-BtEiv0lH.d.mts","names":[],"sources":["../src/navigation/types.ts","../src/navigation/published.ts"],"mappings":";;;cAWa,eAAA;AAAA,cACA,kBAAA;AAAA,cACA,sBAAA;AAAA,cACA,yBAAA;AAAA,cAEA,kBAAA;AAAA,UAEI,uBAAA;;;;AAJjB;EASE,MAAA,EAAQ,KAAA;;EAER,oBAAA;EAXoC;EAapC,kBAAA;EAX6B;;;;EAgB7B,OAAA,GAAU,WAAA,CAAY,WAAA,CAAY,YAAA;EAClC,WAAA,GAAc,WAAA,CAAY,WAAA,CAAY,YAAA;;;;;EAKtC,aAAA;EALsC;EAOtC,eAAA;AAAA;AAAA,UAGe,gBAAA;EACf,KAAA;EACA,GAAA;AAAA;AAAA,UAGe,aAAA;EACf,YAAA;EACA,QAAA;EACA,eAAA;AAAA;AAAA,UAGe,gBAAA;EACf,OAAA;AAAA;AAAA,UAGe,aAAA;EACf,MAAA,EAAQ,gBAAA;EACR,MAAA,EAAQ,gBAAA;EACR,GAAA,EAAK,aAAA;AAAA;AAAA,UAGU,iBAAA;EACf,OAAA;IACE,UAAA,GAAa,IAAA;MACX,IAAA;MACA,KAAA;MACA,cAAA;MACA,KAAA;IAAA,MACI,OAAA;EAAA;EAER,KAAA;AAAA;;;;;AA9DF;;;;;iBC4BsB,aAAA,CAAA;EAAgB,OAAA;EAAS;AAAA,GAAiB,iBAAA,GAAoB,OAAA,CAAQ,aAAA"}
@@ -17,10 +17,16 @@ function footerOf(doc) {
17
17
  const record = asRecord(doc);
18
18
  return (record && "footer" in record ? asRecord(record.footer) : null) ?? {};
19
19
  }
20
+ function barOf(doc) {
21
+ const record = asRecord(doc);
22
+ return (record && "bar" in record ? asRecord(record.bar) : null) ?? {};
23
+ }
20
24
  /**
21
- * Reads Header and Footer and returns one `{ header, footer }`. A site
22
- * header does not learn two slugs. `draft: true` reads the newest
23
- * version; omit it (or pass false) for the published documents.
25
+ * Reads Header and Footer and returns one `{ header, footer, bar }`. A
26
+ * site header does not learn two slugs. `bar` is the hidden Header group
27
+ * (hide on scroll, viewport, default panel width). `draft: true`
28
+ * reads the newest version; omit it (or pass false) for the published
29
+ * documents.
24
30
  */
25
31
  async function getNavigation({ payload, draft = false }) {
26
32
  const [headerDoc, footerDoc] = await Promise.all([payload.findGlobal({
@@ -34,10 +40,11 @@ async function getNavigation({ payload, draft = false }) {
34
40
  })]);
35
41
  return {
36
42
  header: headerOf(headerDoc),
37
- footer: footerOf(footerDoc)
43
+ footer: footerOf(footerDoc),
44
+ bar: barOf(headerDoc)
38
45
  };
39
46
  }
40
47
  //#endregion
41
48
  export { NAVIGATION_FOOTER_SLUG as a, NAVIGATION_FOOTER_DB_NAME as i, NAVIGATION_DB_NAME as n, NAVIGATION_SLUG as o, NAVIGATION_FEATURE as r, getNavigation as t };
42
49
 
43
- //# sourceMappingURL=published-ByS86dhW.mjs.map
50
+ //# sourceMappingURL=published-Chd5PFhw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-Chd5PFhw.mjs","names":[],"sources":["../src/navigation/types.ts","../src/navigation/published.ts"],"sourcesContent":["/**\n * Public Header and Footer as two Globals so each has its own Save /\n * Publish / drafts. Bar behaviour (`bar` on Header) stays in the schema\n * with `admin.hidden`; it is not a Settings tab. Featured looks stay on\n * chrome roles (BIS-85 / SPI-89), not a Header array. The items kit\n * editor is the workspace field (BIS-119 / BIS-121). Payload's left nav\n * stays until BIS-90. The Spinal bump is SPI-99.\n */\n\nimport type { Block, GlobalConfig } from \"payload\";\n\nexport const NAVIGATION_SLUG = \"navigation\";\nexport const NAVIGATION_DB_NAME = \"nav\";\nexport const NAVIGATION_FOOTER_SLUG = \"navigation-footer\";\nexport const NAVIGATION_FOOTER_DB_NAME = \"navf\";\n\nexport const NAVIGATION_FEATURE = \"navigation\";\n\nexport interface CreateNavigationOptions {\n /**\n * Header bar blocks this site offers. The field stays a blocks array —\n * a later nav block is appended here, not a mega-menu-only shape.\n */\n blocks: Block[];\n /** Accordion title for each footer column. */\n footerColumnRowLabel?: string;\n /** Accordion title for each footer link row. */\n footerLinkRowLabel?: string;\n /**\n * Preview URL for both documents. The site owns the path — this factory\n * does not invent a route.\n */\n preview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"preview\"]>;\n livePreview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"livePreview\"]>;\n /**\n * Component path for Payload's Preview button, as a key into the site's\n * committed `importMap.js`.\n */\n previewButton?: string;\n /** The collection a page link points into. Defaults to `pages`. */\n pagesCollection?: string;\n}\n\nexport interface NavigationHeader {\n items?: unknown;\n cta?: unknown;\n}\n\nexport interface NavigationBar {\n hideOnScroll?: boolean | null;\n viewport?: boolean | null;\n defaultMaxWidth?: (\"narrow\" | \"standard\" | \"wide\") | null;\n}\n\nexport interface NavigationFooter {\n columns?: unknown;\n}\n\nexport interface NavigationDoc {\n header: NavigationHeader;\n footer: NavigationFooter;\n bar: NavigationBar;\n}\n\nexport interface GetNavigationArgs {\n payload: {\n findGlobal: (args: {\n slug: string;\n draft?: boolean;\n overrideAccess?: boolean;\n depth?: number;\n }) => Promise<unknown>;\n };\n draft?: boolean;\n}\n","import {\n NAVIGATION_FOOTER_SLUG,\n NAVIGATION_SLUG,\n type GetNavigationArgs,\n type NavigationBar,\n type NavigationDoc,\n type NavigationFooter,\n type NavigationHeader,\n} from \"./types\";\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" ? (value as Record<string, unknown>) : null;\n}\n\nfunction headerOf(doc: unknown): NavigationHeader {\n const record = asRecord(doc);\n const header = record && \"header\" in record ? asRecord(record.header) : null;\n return header ?? {};\n}\n\nfunction footerOf(doc: unknown): NavigationFooter {\n const record = asRecord(doc);\n const footer = record && \"footer\" in record ? asRecord(record.footer) : null;\n return footer ?? {};\n}\n\nfunction barOf(doc: unknown): NavigationBar {\n const record = asRecord(doc);\n const bar = record && \"bar\" in record ? asRecord(record.bar) : null;\n return bar ?? {};\n}\n\n/**\n * Reads Header and Footer and returns one `{ header, footer, bar }`. A\n * site header does not learn two slugs. `bar` is the hidden Header group\n * (hide on scroll, viewport, default panel width). `draft: true`\n * reads the newest version; omit it (or pass false) for the published\n * documents.\n */\nexport async function getNavigation({ payload, draft = false }: GetNavigationArgs): Promise<NavigationDoc> {\n const [headerDoc, footerDoc] = await Promise.all([\n payload.findGlobal({ slug: NAVIGATION_SLUG, draft, depth: 1 }),\n payload.findGlobal({ slug: NAVIGATION_FOOTER_SLUG, draft, depth: 1 }),\n ]);\n return { header: headerOf(headerDoc), footer: footerOf(footerDoc), bar: barOf(headerDoc) };\n}\n"],"mappings":";AAWA,MAAa,kBAAkB;AAC/B,MAAa,qBAAqB;AAClC,MAAa,yBAAyB;AACtC,MAAa,4BAA4B;AAEzC,MAAa,qBAAqB;;;ACNlC,SAAS,SAAS,OAAgD;AAChE,QAAO,SAAS,OAAO,UAAU,WAAY,QAAoC;;AAGnF,SAAS,SAAS,KAAgC;CAChD,MAAM,SAAS,SAAS,IAAI;AAE5B,SADe,UAAU,YAAY,SAAS,SAAS,OAAO,OAAO,GAAG,SACvD,EAAE;;AAGrB,SAAS,SAAS,KAAgC;CAChD,MAAM,SAAS,SAAS,IAAI;AAE5B,SADe,UAAU,YAAY,SAAS,SAAS,OAAO,OAAO,GAAG,SACvD,EAAE;;AAGrB,SAAS,MAAM,KAA6B;CAC1C,MAAM,SAAS,SAAS,IAAI;AAE5B,SADY,UAAU,SAAS,SAAS,SAAS,OAAO,IAAI,GAAG,SACjD,EAAE;;;;;;;;;AAUlB,eAAsB,cAAc,EAAE,SAAS,QAAQ,SAAoD;CACzG,MAAM,CAAC,WAAW,aAAa,MAAM,QAAQ,IAAI,CAC/C,QAAQ,WAAW;EAAE,MAAM;EAAiB;EAAO,OAAO;EAAG,CAAC,EAC9D,QAAQ,WAAW;EAAE,MAAM;EAAwB;EAAO,OAAO;EAAG,CAAC,CACtE,CAAC;AACF,QAAO;EAAE,QAAQ,SAAS,UAAU;EAAE,QAAQ,SAAS,UAAU;EAAE,KAAK,MAAM,UAAU;EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bison-lab/payload-core",
3
- "version": "3.20.0",
3
+ "version": "3.22.0",
4
4
  "description": "Site-agnostic Payload CMS configuration for Bison Lab sites: the SEO tab, the Theme global, the Roles Global, the brand-assets cupboard, and the metadata and theme readers for the pages they describe",
5
5
  "homepage": "https://components.bisonlab.ai",
6
6
  "repository": {
@@ -90,7 +90,7 @@
90
90
  "vitest": "^4.1.2",
91
91
  "@bison-lab/fonts": "3.6.0",
92
92
  "@bison-lab/tokens": "3.11.0",
93
- "@bison-lab/ui": "3.11.0"
93
+ "@bison-lab/ui": "3.22.0"
94
94
  },
95
95
  "publishConfig": {
96
96
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"file":"published-ByS86dhW.mjs","names":[],"sources":["../src/navigation/types.ts","../src/navigation/published.ts"],"sourcesContent":["/**\n * Public Header and Footer as two Globals so each has its own Save /\n * Publish / drafts. Bar behaviour stays on BIS-64. A consuming site waits\n * for SPI-97 after this and BIS-109 publish.\n */\n\nimport type { Block, GlobalConfig } from \"payload\";\n\nexport const NAVIGATION_SLUG = \"navigation\";\nexport const NAVIGATION_DB_NAME = \"nav\";\nexport const NAVIGATION_FOOTER_SLUG = \"navigation-footer\";\nexport const NAVIGATION_FOOTER_DB_NAME = \"navf\";\n\nexport const NAVIGATION_FEATURE = \"navigation\";\n\nexport interface CreateNavigationOptions {\n /**\n * Header bar blocks this site offers. The field stays a blocks array —\n * a later nav block is appended here, not a mega-menu-only shape.\n */\n blocks: Block[];\n /** Accordion title for each footer column. */\n footerColumnRowLabel?: string;\n /** Accordion title for each footer link row. */\n footerLinkRowLabel?: string;\n /**\n * Preview URL for both documents. The site owns the path — this factory\n * does not invent a route.\n */\n preview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"preview\"]>;\n livePreview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"livePreview\"]>;\n /**\n * Component path for Payload's Preview button, as a key into the site's\n * committed `importMap.js`.\n */\n previewButton?: string;\n /** The collection a page link points into. Defaults to `pages`. */\n pagesCollection?: string;\n}\n\nexport interface NavigationHeader {\n items?: unknown;\n cta?: unknown;\n}\n\nexport interface NavigationFooter {\n columns?: unknown;\n}\n\nexport interface NavigationDoc {\n header: NavigationHeader;\n footer: NavigationFooter;\n}\n\nexport interface GetNavigationArgs {\n payload: {\n findGlobal: (args: {\n slug: string;\n draft?: boolean;\n overrideAccess?: boolean;\n depth?: number;\n }) => Promise<unknown>;\n };\n draft?: boolean;\n}\n","import {\n NAVIGATION_FOOTER_SLUG,\n NAVIGATION_SLUG,\n type GetNavigationArgs,\n type NavigationDoc,\n type NavigationFooter,\n type NavigationHeader,\n} from \"./types\";\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" ? (value as Record<string, unknown>) : null;\n}\n\nfunction headerOf(doc: unknown): NavigationHeader {\n const record = asRecord(doc);\n const header = record && \"header\" in record ? asRecord(record.header) : null;\n return header ?? {};\n}\n\nfunction footerOf(doc: unknown): NavigationFooter {\n const record = asRecord(doc);\n const footer = record && \"footer\" in record ? asRecord(record.footer) : null;\n return footer ?? {};\n}\n\n/**\n * Reads Header and Footer and returns one `{ header, footer }`. A site\n * header does not learn two slugs. `draft: true` reads the newest\n * version; omit it (or pass false) for the published documents.\n */\nexport async function getNavigation({ payload, draft = false }: GetNavigationArgs): Promise<NavigationDoc> {\n const [headerDoc, footerDoc] = await Promise.all([\n payload.findGlobal({ slug: NAVIGATION_SLUG, draft, depth: 1 }),\n payload.findGlobal({ slug: NAVIGATION_FOOTER_SLUG, draft, depth: 1 }),\n ]);\n return { header: headerOf(headerDoc), footer: footerOf(footerDoc) };\n}\n"],"mappings":";AAQA,MAAa,kBAAkB;AAC/B,MAAa,qBAAqB;AAClC,MAAa,yBAAyB;AACtC,MAAa,4BAA4B;AAEzC,MAAa,qBAAqB;;;ACJlC,SAAS,SAAS,OAAgD;AAChE,QAAO,SAAS,OAAO,UAAU,WAAY,QAAoC;;AAGnF,SAAS,SAAS,KAAgC;CAChD,MAAM,SAAS,SA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