@bison-lab/payload-core 4.32.2 → 4.35.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 +65 -3
- package/dist/block-library.d.mts +1 -1
- package/dist/block-library.mjs +1 -1
- package/dist/{block-thumbnails--AJzSdzJ.mjs → block-thumbnails-VRxpSXw1.mjs} +1 -1
- package/dist/{block-thumbnails--AJzSdzJ.mjs.map → block-thumbnails-VRxpSXw1.mjs.map} +1 -1
- package/dist/block-thumbnails-cli.mjs +1 -1
- package/dist/block-thumbnails.mjs +1 -1
- package/dist/{catalogue-BC_A9eLc.d.mts → catalogue-CEfYwTSK.d.mts} +1 -1
- package/dist/{catalogue-BC_A9eLc.d.mts.map → catalogue-CEfYwTSK.d.mts.map} +1 -1
- package/dist/{facet-field-DKzRCYrh.d.mts → facet-field-BvQp8Hzh.d.mts} +1 -1
- package/dist/{facet-field-DKzRCYrh.d.mts.map → facet-field-BvQp8Hzh.d.mts.map} +1 -1
- package/dist/{facet-field-Di1kNyzH.mjs → facet-field-Uf8S4yL1.mjs} +1 -1
- package/dist/{facet-field-Di1kNyzH.mjs.map → facet-field-Uf8S4yL1.mjs.map} +1 -1
- package/dist/identity-CN6EOeDM.mjs +180 -0
- package/dist/identity-CN6EOeDM.mjs.map +1 -0
- package/dist/index.d.mts +41 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +145 -36
- package/dist/index.mjs.map +1 -1
- package/dist/metadata.d.mts +14 -2
- package/dist/metadata.d.mts.map +1 -1
- package/dist/metadata.mjs +29 -3
- package/dist/metadata.mjs.map +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/navigation.mjs +1 -1
- package/dist/og.d.mts +155 -0
- package/dist/og.d.mts.map +1 -0
- package/dist/og.mjs +282 -0
- package/dist/og.mjs.map +1 -0
- package/dist/{identity-8doWYeRn.mjs → preview-Br1SQCKn.mjs} +4 -179
- package/dist/preview-Br1SQCKn.mjs.map +1 -0
- package/dist/preview-Cgbh9eAq.d.mts +113 -0
- package/dist/preview-Cgbh9eAq.d.mts.map +1 -0
- package/dist/published-BLXCep6Z.d.mts +26 -0
- package/dist/published-BLXCep6Z.d.mts.map +1 -0
- package/dist/{published-CcW9bqLJ.mjs → published-CEuK5ym6.mjs} +1 -1
- package/dist/{published-CcW9bqLJ.mjs.map → published-CEuK5ym6.mjs.map} +1 -1
- package/dist/published-DgAzpDSG.mjs +31 -0
- package/dist/published-DgAzpDSG.mjs.map +1 -0
- package/dist/{published-IX1-6JEa.d.mts → published-Dsg-HX-v.d.mts} +1 -1
- package/dist/{published-IX1-6JEa.d.mts.map → published-Dsg-HX-v.d.mts.map} +1 -1
- package/dist/{published-niJkPGjE.mjs → published-QyTcDznE.mjs} +1 -1
- package/dist/{published-niJkPGjE.mjs.map → published-QyTcDznE.mjs.map} +1 -1
- package/dist/root-page-key-B86JwL8Z.mjs +32 -0
- package/dist/root-page-key-B86JwL8Z.mjs.map +1 -0
- package/dist/seo.d.mts +216 -0
- package/dist/seo.d.mts.map +1 -0
- package/dist/seo.mjs +155 -0
- package/dist/seo.mjs.map +1 -0
- package/dist/share-image-C8ZtIcU8.mjs +19 -0
- package/dist/share-image-C8ZtIcU8.mjs.map +1 -0
- package/dist/taxonomy.d.mts +1 -1
- package/dist/taxonomy.mjs +1 -1
- package/dist/theme.d.mts +3 -22
- package/dist/theme.d.mts.map +1 -1
- package/dist/theme.mjs +3 -28
- package/dist/theme.mjs.map +1 -1
- package/dist/{title-BvjHeRo5.d.mts → title-C8ppEDlc.d.mts} +1 -1
- package/dist/{title-BvjHeRo5.d.mts.map → title-C8ppEDlc.d.mts.map} +1 -1
- package/dist/title-DJ7C48gq.mjs +21 -0
- package/dist/title-DJ7C48gq.mjs.map +1 -0
- package/dist/{preview-D-G8PEEB.d.mts → types-D6jQql5Z.d.mts} +3 -110
- package/dist/types-D6jQql5Z.d.mts.map +1 -0
- package/dist/wireframe-cli.mjs +1 -1
- package/dist/{wireframe-ApjwNWAN.mjs → wireframe-sJW8Q4NS.mjs} +1 -1
- package/dist/{wireframe-ApjwNWAN.mjs.map → wireframe-sJW8Q4NS.mjs.map} +1 -1
- package/dist/wireframe.mjs +1 -1
- package/package.json +23 -5
- package/dist/identity-8doWYeRn.mjs.map +0 -1
- package/dist/preview-D-G8PEEB.d.mts.map +0 -1
- package/dist/share-image-C4ILz4p2.mjs +0 -37
- package/dist/share-image-C4ILz4p2.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -19,13 +19,15 @@ Media list with `next/navigation`, which Payload's admin already loads); `@bison
|
|
|
19
19
|
Pin the plugin to the same version as `payload`; Payload releases them in
|
|
20
20
|
lockstep.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Twelve entry points, and why
|
|
23
23
|
|
|
24
24
|
| Import | Contents | Runs where |
|
|
25
25
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
26
|
-
| `@bison-lab/payload-core` | `seoPlugin`, `createTheme`, `createBrandAssets`, `createRoles`, `createFeatures`, `createBlockLibrary`, `createPages`, `createUsers`, `createMedia`, `createRedirects`, `createQuestions`, `createTaxonomy`, `facetField`, `createAdminNav`, `adminNav`, `createNavigation`, `adminOnlyApiTab`, `documentTitleActions`, `listAlign`, `blockDrawer`, `richTextEditorFonts`, `seedTheme`, `seedRoles`, `seedFeatures`, predicates, `lookField`, `colorTokenField`, import-map strings, title and text helpers, types | Node. What `payload.config.ts` imports; it loads the plugin. |
|
|
26
|
+
| `@bison-lab/payload-core` | `seoPlugin`, `createTheme`, `createBrandAssets`, `createRoles`, `createFeatures`, `createBlockLibrary`, `createPages`, `createUsers`, `createMedia`, `createRedirects`, `createQuestions`, `createTaxonomy`, `createFormSubmissions`, `facetField`, `createAdminNav`, `adminNav`, `createNavigation`, `adminOnlyApiTab`, `documentTitleActions`, `listAlign`, `blockDrawer`, `richTextEditorFonts`, `seedTheme`, `seedRoles`, `seedFeatures`, predicates, `lookField`, `colorTokenField`, import-map strings, title and text helpers, types | Node. What `payload.config.ts` imports; it loads the plugin. |
|
|
27
27
|
| `@bison-lab/payload-core/metadata` | `pageMetadata`, the title helpers, the same types | Server. What a page route imports; it does not load the plugin. |
|
|
28
28
|
| `@bison-lab/payload-core/theme` | `getPublishedTheme`, `getPublishedIdentity`, `themeConfigFromDoc`, `themeHead`, `themeHeadFromDoc` | Server. What a root layout imports; it does not load the plugin or React. |
|
|
29
|
+
| `@bison-lab/payload-core/seo` | `pageSitemap`, `getSitemapPages`, `organizationJsonLd`, `websiteJsonLd`, `breadcrumbListJsonLd`, `jsonLdGraph`, `jsonLdHtml`, `JsonLd` | Server. What `app/sitemap.ts` and a page route import; no plugin, no banner. `JsonLd` is a Server Component, so it loads React. |
|
|
30
|
+
| `@bison-lab/payload-core/og` | `ogImageHandler`, `renderOgImage`, `ogCardColors`, `ogCardElement`, `OG_IMAGE_SIZE` | Server. The Open Graph card route (BIS-183); no plugin, no `@payloadcms/ui`, no `next`, no banner. Needs the optional peers `satori` and `@resvg/resvg-js`. |
|
|
29
31
|
| `@bison-lab/payload-core/navigation` | `getNavigation`, the Header and Footer slugs | Server. What a site header imports; it does not load the plugin or React. |
|
|
30
32
|
| `@bison-lab/payload-core/block-library` | `getSectionControls`, `sectionControlsFromLibrary`, `SectionControls`, the catalogue readers, the island height message | Server. What a page route and the Block Settings fold import; it does not load the plugin or React. |
|
|
31
33
|
| `@bison-lab/payload-core/taxonomy` | `facetField`, `FacetEntry` | Anywhere. What a block config imports to tag content from a taxonomy; no plugin, no React, so a browser bundle can take it (`@bison-lab/payload-blocks` main entry reaches the docs island and Storybook). |
|
|
@@ -128,7 +130,41 @@ the site name twice. Fields the editor left empty are omitted rather than
|
|
|
128
130
|
set to `undefined`, so the layout's own description and default share image
|
|
129
131
|
carry through Next's metadata merge.
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
**5. List the pages in the sitemap, and describe the site in JSON-LD.**
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
// app/sitemap.ts
|
|
137
|
+
import { getSitemapPages, pageSitemap } from "@bison-lab/payload-core/seo";
|
|
138
|
+
|
|
139
|
+
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
140
|
+
const pages = await getSitemapPages({ payload: await getPayload({ config }) });
|
|
141
|
+
return pageSitemap(pages, {
|
|
142
|
+
path: publicPagePath,
|
|
143
|
+
absoluteUrl,
|
|
144
|
+
routes: CODE_ROUTES.map((path) => ({ url: absoluteUrl(path) })),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`getSitemapPages` reads the published pages (slug, page key, last edit,
|
|
150
|
+
`meta.noIndex`). `pageSitemap` lists each page that has an address, skips one
|
|
151
|
+
hidden from search, and merges the routes the site still serves from code
|
|
152
|
+
after them: one entry per URL, the page's fields winning, and a code route at
|
|
153
|
+
the URL of a hidden page dropped with it.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { JsonLd, breadcrumbListJsonLd, organizationJsonLd, websiteJsonLd } from "@bison-lab/payload-core/seo";
|
|
157
|
+
import { faqPageJsonLd } from "@bison-lab/payload-blocks";
|
|
158
|
+
|
|
159
|
+
<JsonLd data={[organizationJsonLd({ name, url, logo, sameAs }), websiteJsonLd({ name, url })]} />
|
|
160
|
+
<JsonLd data={[breadcrumbListJsonLd(trail), faqPageJsonLd(page.layout, sectionControls)]} />
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
`JsonLd` renders one `<script type="application/ld+json">` with `<` escaped;
|
|
164
|
+
a list becomes one `@graph`, and nothing to say renders nothing. Any other
|
|
165
|
+
type the site owns (a `Product`, say) is a plain object passed to the same
|
|
166
|
+
component. FAQPage comes from the FAQ bands, so it is payload-blocks'
|
|
167
|
+
`faqPageJsonLd`.
|
|
132
168
|
|
|
133
169
|
## Theme
|
|
134
170
|
|
|
@@ -698,6 +734,32 @@ A site that already stored footer columns on the `nav` document copies
|
|
|
698
734
|
`footer.columns` onto the new global, then drops the footer fields from
|
|
699
735
|
`nav`.
|
|
700
736
|
|
|
737
|
+
## Form submissions
|
|
738
|
+
|
|
739
|
+
`createFormSubmissions({ access?, group? })` is the `form-submissions`
|
|
740
|
+
collection `storedDestination()` (`@bison-lab/payload-blocks/forms`) writes
|
|
741
|
+
to (BIS-179): `subject`, `form` (`blockId`, `blockType`, `title`), `page`
|
|
742
|
+
(`pageId` as text, `title`, `path`), `fields` (key, label, type, value) and `submittedAt`.
|
|
743
|
+
Read defaults to any signed-in user. Create and update refuse everyone,
|
|
744
|
+
REST and Local API with `overrideAccess: false` alike; the destination
|
|
745
|
+
writes with `overrideAccess: true` after the endpoint has checked the
|
|
746
|
+
answers and the Turnstile token. Delete is refused unless the site passes
|
|
747
|
+
`access.delete`. A new collection is a schema change: `payload
|
|
748
|
+
migrate:create`.
|
|
749
|
+
|
|
750
|
+
## Open Graph images
|
|
751
|
+
|
|
752
|
+
`@bison-lab/payload-core/og` draws a 1200×630 card for a page with no share
|
|
753
|
+
image (BIS-183): the published Theme's background, a primary band, the
|
|
754
|
+
title in the heading face and the Theme logo (else `identity.lockup`). The
|
|
755
|
+
title is primary only where `auditTheme`'s primary-on-background check
|
|
756
|
+
passes in the mode the Theme opens in, else the derived foreground. The
|
|
757
|
+
font is the static bold `.woff` from `@bison-lab/fonts` (`readImageFont`),
|
|
758
|
+
read off disk. A site mounts `ogImageHandler` in a route and passes its
|
|
759
|
+
pattern to `pageMetadata({ ogImageRoute: "/og/{slug}" })`; an uploaded share
|
|
760
|
+
image always wins. Text inside an SVG logo does not draw (no font), so a
|
|
761
|
+
logo needs outlined text or a raster file.
|
|
762
|
+
|
|
701
763
|
## FAQ Library
|
|
702
764
|
|
|
703
765
|
`createQuestions` is one document per FAQ (question, richText answer, drafts)
|
package/dist/block-library.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, O as BlockLibraryRow, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, j as PackageBlockSlug, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as BlockLibraryCheck, u as getSectionControls, v as defaultSectionControls, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-
|
|
1
|
+
import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, O as BlockLibraryRow, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, j as PackageBlockSlug, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as BlockLibraryCheck, u as getSectionControls, v as defaultSectionControls, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-CEfYwTSK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/block-library/island.d.ts
|
|
4
4
|
/**
|
package/dist/block-library.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as sectionControlsOf, a as sectionControlsFromLibrary, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as defaultSectionControls, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, l as BLOCK_LIBRARY_SLUG, m as SECTION_CONTROL_KEYS, n as getSectionControls, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as blockLibraryEntriesFromConfig, u as PACKAGE_BLOCK_SLUGS } from "./published-
|
|
1
|
+
import { _ as sectionControlsOf, a as sectionControlsFromLibrary, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as defaultSectionControls, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, l as BLOCK_LIBRARY_SLUG, m as SECTION_CONTROL_KEYS, n as getSectionControls, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, t as blockLibraryEntriesFromConfig, u as PACKAGE_BLOCK_SLUGS } from "./published-QyTcDznE.mjs";
|
|
2
2
|
//#region src/block-library/island.ts
|
|
3
3
|
/**
|
|
4
4
|
* How a Block library island tells its card how tall it is (BIS-147).
|
|
@@ -127,4 +127,4 @@ function thumbnailVersion(data) {
|
|
|
127
127
|
//#endregion
|
|
128
128
|
export { THUMBNAIL_VIEWPORT as a, thumbnailCss as c, THUMBNAIL_SCALE as i, thumbnailVersion as l, THUMBNAIL_HEIGHT as n, THUMBNAIL_WIDTH as o, THUMBNAIL_ROOT as r, captureThumbnails as s, NEUTRAL_THEME as t };
|
|
129
129
|
|
|
130
|
-
//# sourceMappingURL=block-thumbnails
|
|
130
|
+
//# sourceMappingURL=block-thumbnails-VRxpSXw1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-thumbnails
|
|
1
|
+
{"version":3,"file":"block-thumbnails-VRxpSXw1.mjs","names":[],"sources":["../src/block-thumbnails.ts"],"sourcesContent":["/**\n * Screenshots of Block library samples for Payload's Add Block drawer\n * (`admin.images.thumbnail`). React-free and Payload-free: a script drives\n * a browser to each block's preview (`previewPath(slug)`), lays a neutral\n * theme over the site's, and captures the block as a 3:2 JPEG. The samples\n * carry generic copy and photos (`@bison-lab/payload-blocks`), so the card\n * reads as no particular site or industry. Rerun it when a block's layout\n * or sample changes.\n */\nimport { buildThemeCss, type ThemeConfig } from \"@bison-lab/tokens\";\n\n/** Payload's drawer card is 3:2. */\nexport const THUMBNAIL_WIDTH = 960;\nexport const THUMBNAIL_HEIGHT = 640;\n\n/** Desktop width, so the picture is the layout most visitors see; scaled down to 960. */\nexport const THUMBNAIL_VIEWPORT = { width: 1280, height: 900 } as const;\nexport const THUMBNAIL_SCALE = THUMBNAIL_WIDTH / THUMBNAIL_VIEWPORT.width;\n\n/** The element the Block library preview wraps each sample in (`BlockLibraryIsland`). */\nexport const THUMBNAIL_ROOT = \"[data-block-library-island]\";\n\n/**\n * Slate greys with a slate primary: no site's brand, and a contrast every\n * block was designed to read in. Fonts are the system stack (below), so no\n * font file has to be served for the capture.\n */\nexport const NEUTRAL_THEME: ThemeConfig = {\n brandPrimary: \"#334155\",\n brandSecondary: \"#64748b\",\n brandAccent: \"#475569\",\n brandHighlight: \"#94a3b8\",\n brandSuccess: \"#3f6212\",\n greyScale: \"slate\",\n defaultTheme: \"light\",\n radius: \"subtle\",\n shadow: \"subtle\",\n motion: \"minimal\",\n density: \"default\",\n fontBody: \"Inter\",\n fontHeading: null,\n fontWeights: { normal: 400, medium: 500, semibold: 600, bold: 700 },\n};\n\nconst SYSTEM_FONTS = 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif';\n\n/**\n * The stylesheet a capture adds to the preview: the neutral theme's tokens\n * (light, whatever the viewer's setting), the system font stack, no motion,\n * and the island as a column that centers its block, so a short band sits in\n * the middle of the card (`islandClip` sets the 3:2 height).\n */\nexport function thumbnailCss(selector = THUMBNAIL_ROOT): string {\n return [\n buildThemeCss(NEUTRAL_THEME, { attribute: \"data-theme\" }),\n `:root,[data-theme]{--font-body:${SYSTEM_FONTS};--font-heading:${SYSTEM_FONTS};color-scheme:light}`,\n `*,*::before,*::after{transition:none!important;animation:none!important;caret-color:transparent!important}`,\n // Dev-server chrome (Next's dev tools badge) is not part of the block.\n `nextjs-portal,[data-nextjs-toast],[data-next-badge-root]{display:none!important}`,\n `${selector}{box-sizing:border-box;display:flex!important;flex-direction:column;justify-content:center}`,\n ].join(\"\\n\");\n}\n\n/** The slice of Playwright's `Page` this needs; a site passes its own. */\nexport interface ThumbnailPage {\n goto(\n url: string,\n options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" },\n ): Promise<{ status(): number } | null | void>;\n evaluate<R, A>(fn: (arg: A) => R | Promise<R>, arg: A): Promise<R>;\n addStyleTag(options: { content: string }): Promise<unknown>;\n waitForTimeout(ms: number): Promise<void>;\n screenshot(options: {\n clip: { x: number; y: number; width: number; height: number };\n type: \"jpeg\";\n quality: number;\n scale: \"device\";\n }): Promise<Buffer | Uint8Array>;\n}\n\n/**\n * The box a capture takes: the island's top, its full width, 3:2. The\n * island is held at least that tall first, so a short block is centered in\n * the card and a tall one keeps its top. Runs in the page, so it closes over\n * nothing.\n */\nfunction islandClip(selector: string): { x: number; y: number; width: number; height: number } | null {\n const island = document.querySelector<HTMLElement>(selector);\n if (!island) return null;\n const width = Math.round(island.getBoundingClientRect().width);\n const height = Math.round((width * 2) / 3);\n island.style.minHeight = `${height}px`;\n const rect = island.getBoundingClientRect();\n return { x: Math.round(rect.left + window.scrollX), y: Math.round(rect.top + window.scrollY), width, height };\n}\n\n/**\n * Opens each preview, forces the light neutral theme, waits for its fonts\n * and images, and returns one JPEG per slug. The page's context should use\n * `THUMBNAIL_VIEWPORT` and `deviceScaleFactor: THUMBNAIL_SCALE`, so the\n * file comes out at 960 × 640. A preview that answers 400 or more, or\n * renders nothing `selector` matches, throws: nothing is written for a page\n * that did not draw its sample.\n */\nexport async function captureThumbnails(\n page: ThumbnailPage,\n previews: readonly { slug: string; url: string }[],\n { selector = THUMBNAIL_ROOT, quality = 68 }: { selector?: string; quality?: number } = {},\n): Promise<Record<string, Uint8Array>> {\n const out: Record<string, Uint8Array> = {};\n for (const { slug, url } of previews) {\n const response = await page.goto(url, { waitUntil: \"networkidle\" });\n const status = response ? response.status() : 200;\n if (status >= 400) throw new Error(`${slug}: ${url} answered ${status}; is the server up, the slug right, and the login one the route accepts?`);\n await page.evaluate(() => {\n document.documentElement.setAttribute(\"data-theme\", \"light\");\n document.documentElement.classList.remove(\"dark\");\n }, undefined);\n await page.addStyleTag({ content: thumbnailCss(selector) });\n await page.evaluate(\n () =>\n Promise.all([\n document.fonts.ready,\n ...Array.from(document.images).map((image) => (image.complete ? null : image.decode().catch(() => null))),\n ]).then(() => undefined),\n undefined,\n );\n await page.waitForTimeout(400);\n const clip = await page.evaluate(islandClip, selector);\n if (!clip) throw new Error(`${slug}: ${url} has no ${selector}; it did not render the sample`);\n out[slug] = new Uint8Array(await page.screenshot({ clip, type: \"jpeg\", quality, scale: \"device\" }));\n }\n return out;\n}\n\n/** A short, stable hash for a thumbnail's cache-busting `?v=`. */\nexport function thumbnailVersion(data: string | Uint8Array): string {\n let hash = 0x811c9dc5;\n const bytes = typeof data === \"string\" ? new TextEncoder().encode(data) : data;\n for (const byte of bytes) {\n hash ^= byte;\n hash = Math.imul(hash, 0x01000193) >>> 0;\n }\n return hash.toString(36);\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;;AAGhC,MAAa,qBAAqB;CAAE,OAAO;CAAM,QAAQ;CAAK;AAC9D,MAAa,kBAAA,MAAoC,mBAAmB;;AAGpE,MAAa,iBAAiB;;;;;;AAO9B,MAAa,gBAA6B;CACxC,cAAc;CACd,gBAAgB;CAChB,aAAa;CACb,gBAAgB;CAChB,cAAc;CACd,WAAW;CACX,cAAc;CACd,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,aAAa;EAAE,QAAQ;EAAK,QAAQ;EAAK,UAAU;EAAK,MAAM;EAAK;CACpE;AAED,MAAM,eAAe;;;;;;;AAQrB,SAAgB,aAAa,WAAW,gBAAwB;AAC9D,QAAO;EACL,cAAc,eAAe,EAAE,WAAW,cAAc,CAAC;EACzD,kCAAkC,aAAa,kBAAkB,aAAa;EAC9E;EAEA;EACA,GAAG,SAAS;EACb,CAAC,KAAK,KAAK;;;;;;;;AA0Bd,SAAS,WAAW,UAAkF;CACpG,MAAM,SAAS,SAAS,cAA2B,SAAS;AAC5D,KAAI,CAAC,OAAQ,QAAO;CACpB,MAAM,QAAQ,KAAK,MAAM,OAAO,uBAAuB,CAAC,MAAM;CAC9D,MAAM,SAAS,KAAK,MAAO,QAAQ,IAAK,EAAE;AAC1C,QAAO,MAAM,YAAY,GAAG,OAAO;CACnC,MAAM,OAAO,OAAO,uBAAuB;AAC3C,QAAO;EAAE,GAAG,KAAK,MAAM,KAAK,OAAO,OAAO,QAAQ;EAAE,GAAG,KAAK,MAAM,KAAK,MAAM,OAAO,QAAQ;EAAE;EAAO;EAAQ;;;;;;;;;;AAW/G,eAAsB,kBACpB,MACA,UACA,EAAE,WAAW,gBAAgB,UAAU,OAAgD,EAAE,EACpD;CACrC,MAAM,MAAkC,EAAE;AAC1C,MAAK,MAAM,EAAE,MAAM,SAAS,UAAU;EACpC,MAAM,WAAW,MAAM,KAAK,KAAK,KAAK,EAAE,WAAW,eAAe,CAAC;EACnE,MAAM,SAAS,WAAW,SAAS,QAAQ,GAAG;AAC9C,MAAI,UAAU,IAAK,OAAM,IAAI,MAAM,GAAG,KAAK,IAAI,IAAI,YAAY,OAAO,0EAA0E;AAChJ,QAAM,KAAK,eAAe;AACxB,YAAS,gBAAgB,aAAa,cAAc,QAAQ;AAC5D,YAAS,gBAAgB,UAAU,OAAO,OAAO;KAChD,KAAA,EAAU;AACb,QAAM,KAAK,YAAY,EAAE,SAAS,aAAa,SAAS,EAAE,CAAC;AAC3D,QAAM,KAAK,eAEP,QAAQ,IAAI,CACV,SAAS,MAAM,OACf,GAAG,MAAM,KAAK,SAAS,OAAO,CAAC,KAAK,UAAW,MAAM,WAAW,OAAO,MAAM,QAAQ,CAAC,YAAY,KAAK,CAAE,CAC1G,CAAC,CAAC,WAAW,KAAA,EAAU,EAC1B,KAAA,EACD;AACD,QAAM,KAAK,eAAe,IAAI;EAC9B,MAAM,OAAO,MAAM,KAAK,SAAS,YAAY,SAAS;AACtD,MAAI,CAAC,KAAM,OAAM,IAAI,MAAM,GAAG,KAAK,IAAI,IAAI,UAAU,SAAS,gCAAgC;AAC9F,MAAI,QAAQ,IAAI,WAAW,MAAM,KAAK,WAAW;GAAE;GAAM,MAAM;GAAQ;GAAS,OAAO;GAAU,CAAC,CAAC;;AAErG,QAAO;;;AAIT,SAAgB,iBAAiB,MAAmC;CAClE,IAAI,OAAO;CACX,MAAM,QAAQ,OAAO,SAAS,WAAW,IAAI,aAAa,CAAC,OAAO,KAAK,GAAG;AAC1E,MAAK,MAAM,QAAQ,OAAO;AACxB,UAAQ;AACR,SAAO,KAAK,KAAK,MAAM,SAAW,KAAK;;AAEzC,QAAO,KAAK,SAAS,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as THUMBNAIL_VIEWPORT, i as THUMBNAIL_SCALE, s as captureThumbnails } from "./block-thumbnails
|
|
2
|
+
import { a as THUMBNAIL_VIEWPORT, i as THUMBNAIL_SCALE, s as captureThumbnails } from "./block-thumbnails-VRxpSXw1.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as THUMBNAIL_VIEWPORT, c as thumbnailCss, i as THUMBNAIL_SCALE, l as thumbnailVersion, n as THUMBNAIL_HEIGHT, o as THUMBNAIL_WIDTH, r as THUMBNAIL_ROOT, s as captureThumbnails, t as NEUTRAL_THEME } from "./block-thumbnails
|
|
1
|
+
import { a as THUMBNAIL_VIEWPORT, c as thumbnailCss, i as THUMBNAIL_SCALE, l as thumbnailVersion, n as THUMBNAIL_HEIGHT, o as THUMBNAIL_WIDTH, r as THUMBNAIL_ROOT, s as captureThumbnails, t as NEUTRAL_THEME } from "./block-thumbnails-VRxpSXw1.mjs";
|
|
2
2
|
export { NEUTRAL_THEME, THUMBNAIL_HEIGHT, THUMBNAIL_ROOT, THUMBNAIL_SCALE, THUMBNAIL_VIEWPORT, THUMBNAIL_WIDTH, captureThumbnails, thumbnailCss, thumbnailVersion };
|
|
@@ -211,4 +211,4 @@ declare function sectionControlsFromLibrary(doc: BlockLibraryDoc | null | undefi
|
|
|
211
211
|
declare function validateBlockLibrary(value: unknown, options: BlockLibraryOptions, check?: BlockLibraryCheck): Promise<true | string>;
|
|
212
212
|
//#endregion
|
|
213
213
|
export { PACKAGE_BLOCK_SLUGS as A, BlockLibraryDoc as C, BlockLibraryKind as D, BlockLibraryHolder as E, BlockLibraryRow as O, BlockLibraryCategoryId as S, BlockLibraryEntry as T, SectionControls as _, sectionControlsFromLibrary as a, BLOCK_LIBRARY_CATEGORIES as b, BlockLibraryReader as c, DEFAULT_SECTION_CONTROLS as d, HERO_SECTION_CONTROLS as f, SectionControlKey as g, SECTION_CONTROL_LABELS as h, defaultBlockLibraryValue as i, PackageBlockSlug as j, BlockLibraryUsage as k, blockLibraryEntriesFromConfig as l, SECTION_CONTROL_KEYS as m, BlockLibraryOptions as n, stampBlockLibrary as o, NO_SECTION_CONTROLS as p, blockLibraryCatalogue as r, validateBlockLibrary as s, BlockLibraryCheck as t, getSectionControls as u, defaultSectionControls as v, BlockLibraryDraftHolder as w, BLOCK_LIBRARY_SLUG as x, sectionControlsOf as y };
|
|
214
|
-
//# sourceMappingURL=catalogue-
|
|
214
|
+
//# sourceMappingURL=catalogue-CEfYwTSK.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogue-
|
|
1
|
+
{"version":3,"file":"catalogue-CEfYwTSK.d.mts","names":[],"sources":["../src/block-library/types.ts","../src/block-library/controls.ts","../src/block-library/published.ts","../src/block-library/catalogue.ts"],"mappings":";;;cAEa,kBAAA;AAAA,cAEA,wBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAaD,sBAAA,WAAiC,wBAAA;AAAA,KAEjC,gBAAA;;;;;cAMC,mBAAA;AAAA,KAuBD,gBAAA,WAA2B,mBAAA;AAAA,UAEtB,iBAAA;EACf,IAAA;EACA,KAAA;EACA,QAAA;EAPQ;EASR,IAAA,GAAO,gBAAA;EACP,YAAA;EACA,MAAA;EATU;;;;;AAEZ;EAcE,eAAA,GAAkB,OAAA,CAAQ,eAAA;;;;;;;;EAQ1B,SAAA;AAAA;AAAA,UAGe,eAAA;EACf,EAAA;EACA,IAAA;EACA,KAAA;EACA,QAAA;EACA,OAAA;EACA,IAAA,EAAM,gBAAA;EATN;EAWA,eAAA,EAAiB,eAAA;AAAA;AARnB;AAAA,UAYiB,eAAA;EACf,MAAA;AAAA;AAAA,UAGe,kBAAA;EACf,KAAA;EACA,IAAA;AAAA;;UAIe,uBAAA,SAAgC,kBAAA;EAC/C,UAAA;EACA,EAAA;EACA,MAAA;AAAA;;UAIe,iBAAA;EACf,SAAA,EAAW,kBAAA;EACX,MAAA,EAAQ,uBAAA;AAAA;;;;;AAxGV;;;;;AAEA;cCMa,oBAAA;AAAA,KAED,iBAAA,WAA4B,oBAAA;AAAA,KAE5B,eAAA,GAAkB,MAAA,CAAO,iBAAA;;cAGxB,sBAAA,EAAwB,MAAA,CAAO,iBAAA;;cAQ/B,wBAAA,EAA0B,eAAA;;;;;;cAY1B,qBAAA,EAAuB,eAAA;;cAQvB,mBAAA,EAAqB,eAAA;AAAA,iBAOlB,sBAAA,CAAuB,IAAA,EAAM,gBAAA,GAAmB,eAAA;;;;;;iBAgBhD,iBAAA,CAAkB,KAAA,WAAgB,QAAA,EAAU,eAAA,GAAkB,eAAA;;;ADlE9E;AAAA,UEKiB,kBAAA;EACf,UAAA,GAAa,IAAA;IAAQ,IAAA;IAAc,KAAA;IAAe,cAAA;EAAA,MAA8B,OAAA;EAChF,MAAA;IAAW,OAAA;EAAA;AAAA;;;;;;;;;iBAaG,6BAAA,CAA8B,OAAA,EAAS,IAAA,CAAK,kBAAA,cAAgC,iBAAA;;;;;;;;;iBAwCtE,kBAAA,CACpB,OAAA,EAAS,kBAAA,GAAqB,OAAA,EAC9B,MAAA,YAAiB,iBAAA,KAChB,OAAA,CAAQ,MAAA,SAAe,eAAA;;;UCjBT,mBAAA;EACf,MAAA,YAAkB,iBAAA;EAClB,WAAA,GAAc,IAAA;AAAA;AAAA,UAGC,iBAAA;EACf,SAAA,YAAqB,eAAA;EHlDV;EGoDX,OAAA,YAAmB,kBAAA;;EAEnB,MAAA,YAAkB,kBAAA;EAClB,KAAA;AAAA;;;;;;;;;;iBAcc,qBAAA,CAAsB,MAAA,YAAiB,iBAAA,KAA2B,iBAAA;AAAA,iBASlE,wBAAA,CAAyB,OAAA,EAAS,mBAAA,GAAsB,eAAA;;;;;;;;iBAuBxD,iBAAA,CAAkB,KAAA,WAAgB,OAAA,EAAS,mBAAA,GAAsB,eAAA;;AHxFjF;;;;;AAEA;;;;;iBG+HgB,0BAAA,CACd,GAAA,EAAK,eAAA,qBACL,MAAA,YAAiB,iBAAA,KAChB,MAAA,SAAe,eAAA;;;;;AHrGlB;;iBGqIsB,oBAAA,CACpB,KAAA,WACA,OAAA,EAAS,mBAAA,EACT,KAAA,GAAO,iBAAA,GACN,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet-field-
|
|
1
|
+
{"version":3,"file":"facet-field-BvQp8Hzh.d.mts","names":[],"sources":["../src/taxonomy/facet-field.ts"],"mappings":";;;;;AAOA;;;UAAiB,UAAA;EAEf;EAAA,IAAA;EAIA;EAFA,KAAA;EAEU;EAAV,UAAA;AAAA;;;;;;;;;iBAWc,UAAA,CAAW,KAAA,EAAO,UAAA,GAAa,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet-field-
|
|
1
|
+
{"version":3,"file":"facet-field-Uf8S4yL1.mjs","names":[],"sources":["../src/taxonomy/facet-field.ts"],"sourcesContent":["import type { RelationshipField } from \"payload\";\n\n/**\n * One taxonomy axis a document is tagged on: the field it writes and the\n * terms collection it picks from. A FAQ Library `organizeBy` entry is one,\n * and so is a Resources block facet.\n */\nexport interface FacetEntry {\n /** Relationship field name. Must be a valid Payload field name. */\n name: string;\n /** Field label in the admin. */\n label: string;\n /** Terms collection slug. */\n collection: string;\n}\n\n/**\n * The field a facet writes: a stock `relationship, hasMany` onto its terms\n * collection. `allowCreate` is left at Payload's default, so the inline\n * \"Add new\" drawer shows only to a user with create access on that\n * collection; everyone else can only pick. Only `name`, `label` and\n * `collection` are read — an `organizeBy` entry's `manage` and `look` stay\n * on the FAQ list.\n */\nexport function facetField(entry: FacetEntry): RelationshipField {\n return {\n name: entry.name,\n type: \"relationship\",\n relationTo: entry.collection,\n hasMany: true,\n label: entry.label,\n };\n}\n"],"mappings":";;;;;;;;;AAwBA,SAAgB,WAAW,OAAsC;AAC/D,QAAO;EACL,MAAM,MAAM;EACZ,MAAM;EACN,YAAY,MAAM;EAClB,SAAS;EACT,OAAO,MAAM;EACd"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { DESTRUCTIVE_SCALE_HEX, SHADE_STEPS, createColorScale, generateColorScale, isThemeHex } from "@bison-lab/tokens";
|
|
2
|
+
//#region src/theme/fields.ts
|
|
3
|
+
const THEME_COLOR_FIELD = "@bison-lab/payload-core/admin#ColorField";
|
|
4
|
+
const THEME_COLOR_SCALE_FIELD = "@bison-lab/payload-core/admin#ColorScaleField";
|
|
5
|
+
const THEME_LIBRARY_FIELD = "@bison-lab/payload-core/admin#LibraryField";
|
|
6
|
+
const THEME_FONT_FIELD = "@bison-lab/payload-core/admin#FontField";
|
|
7
|
+
const THEME_PAIRING_FIELD = "@bison-lab/payload-core/admin#PairingField";
|
|
8
|
+
const THEME_APPEARANCE_FIELD = "@bison-lab/payload-core/admin#AppearanceField";
|
|
9
|
+
const THEME_GREY_SCALE_FIELD = "@bison-lab/payload-core/admin#GreyScaleField";
|
|
10
|
+
const THEME_CONTRAST_REPORT = "@bison-lab/payload-core/admin#ContrastReport";
|
|
11
|
+
const THEME_SECTION_HEADING = "@bison-lab/payload-core/admin#SectionHeading";
|
|
12
|
+
const THEME_PUBLISH_FIELD = "@bison-lab/payload-core/admin#PublishChild";
|
|
13
|
+
const THEME_SAVE_BUTTON = "@bison-lab/payload-core/admin#HiddenSaveButton";
|
|
14
|
+
const THEME_DOCUMENT_CONTROLS = "@bison-lab/payload-core/admin#ThemeDocumentControls";
|
|
15
|
+
const THEME_IDENTITY_FALLBACK = "@bison-lab/payload-core/admin#IdentityFallback";
|
|
16
|
+
const LOOK_FIELD = "@bison-lab/payload-core/admin#LookField";
|
|
17
|
+
function headingSelectValue(heading) {
|
|
18
|
+
return heading ?? "";
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/theme/map.ts
|
|
22
|
+
function pick(value, fallback) {
|
|
23
|
+
return value == null ? fallback : value;
|
|
24
|
+
}
|
|
25
|
+
function headingFromDoc(heading, seed) {
|
|
26
|
+
if (heading === void 0) return seed;
|
|
27
|
+
if (heading === null || heading === "") return null;
|
|
28
|
+
return heading;
|
|
29
|
+
}
|
|
30
|
+
function hexFromColor(value, fallback) {
|
|
31
|
+
if (typeof value === "string") return value || fallback;
|
|
32
|
+
return pick(value?.hex, fallback);
|
|
33
|
+
}
|
|
34
|
+
function colorDocFromHex(hex, sourceStep = 500) {
|
|
35
|
+
return colorDocFromState(createColorScale(hex, sourceStep));
|
|
36
|
+
}
|
|
37
|
+
function colorDocFromState(state) {
|
|
38
|
+
return {
|
|
39
|
+
hex: state.hex,
|
|
40
|
+
sourceStep: state.sourceStep,
|
|
41
|
+
scale: state.scale,
|
|
42
|
+
stale: state.stale,
|
|
43
|
+
include: Array.isArray(state.include) ? "custom" : state.include,
|
|
44
|
+
includedSteps: Array.isArray(state.include) ? [...state.include] : void 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function stateFromColorDoc(doc, fallbackHex = "#000000") {
|
|
48
|
+
const hex = isThemeHex(doc?.hex) ? doc.hex : fallbackHex;
|
|
49
|
+
const sourceStep = Number(doc?.sourceStep) || 500;
|
|
50
|
+
const include = includeFromDoc(doc, sourceStep);
|
|
51
|
+
return {
|
|
52
|
+
hex,
|
|
53
|
+
sourceStep,
|
|
54
|
+
scale: doc?.scale && typeof doc.scale === "object" ? doc.scale : generateColorScale(hex, sourceStep),
|
|
55
|
+
stale: Boolean(doc?.stale),
|
|
56
|
+
include
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function includeFromDoc(doc, sourceStep) {
|
|
60
|
+
if (doc?.include === "source") return "source";
|
|
61
|
+
if (doc?.include === "custom" && Array.isArray(doc.includedSteps)) {
|
|
62
|
+
const steps = doc.includedSteps.map(Number).filter((step) => SHADE_STEPS.includes(step));
|
|
63
|
+
if (!steps.includes(sourceStep)) steps.push(sourceStep);
|
|
64
|
+
return steps;
|
|
65
|
+
}
|
|
66
|
+
return "all";
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Nested Theme document → flat `ThemeConfig`. Null or missing editor
|
|
70
|
+
* fields take the seed; `darkSelector` and `fontWeights` always come from
|
|
71
|
+
* the seed. Reads the BIS-87 groups and the pre-BIS-87 flat fields.
|
|
72
|
+
*/
|
|
73
|
+
function themeConfigFromDoc(doc, seed) {
|
|
74
|
+
const brand = doc?.colors?.brand ?? doc?.brand;
|
|
75
|
+
const typography = doc?.typography ?? doc?.fonts;
|
|
76
|
+
const appearance = doc?.appearance;
|
|
77
|
+
return {
|
|
78
|
+
brandPrimary: hexFromColor(brand?.primary, seed.brandPrimary),
|
|
79
|
+
brandSecondary: hexFromColor(brand?.secondary, seed.brandSecondary),
|
|
80
|
+
brandAccent: hexFromColor(brand?.accent, seed.brandAccent),
|
|
81
|
+
brandHighlight: hexFromColor(brand?.highlight, seed.brandHighlight),
|
|
82
|
+
brandSuccess: hexFromColor(brand?.success, seed.brandSuccess),
|
|
83
|
+
brandDestructive: hexFromColor(brand?.destructive, seed.brandDestructive ?? DESTRUCTIVE_SCALE_HEX) || seed.brandDestructive || DESTRUCTIVE_SCALE_HEX,
|
|
84
|
+
greyScale: pick(doc?.colors?.greyScale ?? doc?.greyScale, seed.greyScale),
|
|
85
|
+
radius: pick(appearance?.radius ?? doc?.radius, seed.radius),
|
|
86
|
+
shadow: pick(appearance?.shadow ?? doc?.shadow, seed.shadow),
|
|
87
|
+
motion: pick(appearance?.motion ?? doc?.motion, seed.motion),
|
|
88
|
+
density: pick(appearance?.density ?? doc?.density, seed.density),
|
|
89
|
+
defaultTheme: pick(appearance?.defaultTheme ?? doc?.defaultTheme, seed.defaultTheme),
|
|
90
|
+
fontBody: pick(typography?.body, seed.fontBody),
|
|
91
|
+
fontHeading: headingFromDoc(typography?.heading, seed.fontHeading),
|
|
92
|
+
darkSelector: seed.darkSelector,
|
|
93
|
+
fontWeights: seed.fontWeights
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** The document `seedTheme` writes so a fresh Global matches the seed config. */
|
|
97
|
+
function docFromConfig(config, destructive) {
|
|
98
|
+
const destructiveHex = destructive ?? config.brandDestructive ?? DESTRUCTIVE_SCALE_HEX;
|
|
99
|
+
return {
|
|
100
|
+
colors: {
|
|
101
|
+
brand: {
|
|
102
|
+
primary: colorDocFromHex(config.brandPrimary),
|
|
103
|
+
secondary: colorDocFromHex(config.brandSecondary),
|
|
104
|
+
accent: colorDocFromHex(config.brandAccent),
|
|
105
|
+
highlight: colorDocFromHex(config.brandHighlight),
|
|
106
|
+
success: colorDocFromHex(config.brandSuccess),
|
|
107
|
+
destructive: colorDocFromHex(destructiveHex)
|
|
108
|
+
},
|
|
109
|
+
library: [],
|
|
110
|
+
greyScale: config.greyScale
|
|
111
|
+
},
|
|
112
|
+
typography: {
|
|
113
|
+
body: config.fontBody,
|
|
114
|
+
heading: config.fontHeading
|
|
115
|
+
},
|
|
116
|
+
appearance: {
|
|
117
|
+
defaultTheme: config.defaultTheme,
|
|
118
|
+
radius: config.radius,
|
|
119
|
+
shadow: config.shadow,
|
|
120
|
+
motion: config.motion,
|
|
121
|
+
density: config.density
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function validateThemeHex(value) {
|
|
126
|
+
if (!isThemeHex(value)) return "Enter a six-digit hex colour like #1e3a5f";
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
function validateSourceIncluded(value, { siblingData }) {
|
|
130
|
+
const include = siblingData?.include;
|
|
131
|
+
if (include === "all" || include === "source") return true;
|
|
132
|
+
const source = Number(siblingData?.sourceStep);
|
|
133
|
+
const steps = Array.isArray(value) ? value.map(Number) : [];
|
|
134
|
+
if (!SHADE_STEPS.includes(source)) return true;
|
|
135
|
+
if (!steps.includes(source)) return "The source step cannot be excluded";
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/theme/types.ts
|
|
140
|
+
const THEME_SLUG = "theme";
|
|
141
|
+
const THEME_COLORS_SLUG = "theme-colors";
|
|
142
|
+
const THEME_TYPOGRAPHY_SLUG = "theme-typography";
|
|
143
|
+
const THEME_APPEARANCE_SLUG = "theme-appearance";
|
|
144
|
+
const THEME_IDENTITY_SLUG = "theme-identity";
|
|
145
|
+
const SYSTEM_COLOR_KEYS = [
|
|
146
|
+
"primary",
|
|
147
|
+
"secondary",
|
|
148
|
+
"accent",
|
|
149
|
+
"highlight",
|
|
150
|
+
"success",
|
|
151
|
+
"destructive"
|
|
152
|
+
];
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/theme/identity.ts
|
|
155
|
+
function fromUpload(value, fallback) {
|
|
156
|
+
if (value && typeof value === "object") {
|
|
157
|
+
const upload = value;
|
|
158
|
+
if (upload.url) return {
|
|
159
|
+
url: upload.url,
|
|
160
|
+
alt: upload.alt ?? fallback?.alt ?? ""
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return fallback ?? null;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Uploaded logo, favicon, and mobile-menu mark, or the fallback the site
|
|
167
|
+
* passed into `createTheme`. Empty fields keep the fallback;
|
|
168
|
+
* `--color-primary-mark` is not a Theme field.
|
|
169
|
+
*/
|
|
170
|
+
function resolveThemeIdentity(doc, fallback) {
|
|
171
|
+
return {
|
|
172
|
+
lockup: fromUpload(doc?.logo, fallback?.lockup),
|
|
173
|
+
mark: fromUpload(doc?.logoMark, fallback?.mark),
|
|
174
|
+
favicon: fromUpload(doc?.favicon, fallback?.favicon)
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
export { THEME_PAIRING_FIELD as C, headingSelectValue as D, THEME_SECTION_HEADING as E, THEME_LIBRARY_FIELD as S, THEME_SAVE_BUTTON as T, THEME_CONTRAST_REPORT as _, THEME_IDENTITY_SLUG as a, THEME_GREY_SCALE_FIELD as b, docFromConfig as c, validateSourceIncluded as d, validateThemeHex as f, THEME_COLOR_SCALE_FIELD as g, THEME_COLOR_FIELD as h, THEME_COLORS_SLUG as i, stateFromColorDoc as l, THEME_APPEARANCE_FIELD as m, SYSTEM_COLOR_KEYS as n, THEME_SLUG as o, LOOK_FIELD as p, THEME_APPEARANCE_SLUG as r, THEME_TYPOGRAPHY_SLUG as s, resolveThemeIdentity as t, themeConfigFromDoc as u, THEME_DOCUMENT_CONTROLS as v, THEME_PUBLISH_FIELD as w, THEME_IDENTITY_FALLBACK as x, THEME_FONT_FIELD as y };
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=identity-CN6EOeDM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-CN6EOeDM.mjs","names":[],"sources":["../src/theme/fields.ts","../src/theme/map.ts","../src/theme/types.ts","../src/theme/identity.ts"],"sourcesContent":["import type { ThemeConfig } from \"@bison-lab/tokens\";\n\nimport type { EditableTheme } from \"./types\";\n\nexport const THEME_COLOR_FIELD = \"@bison-lab/payload-core/admin#ColorField\";\nexport const THEME_COLOR_SCALE_FIELD = \"@bison-lab/payload-core/admin#ColorScaleField\";\nexport const THEME_LIBRARY_FIELD = \"@bison-lab/payload-core/admin#LibraryField\";\nexport const THEME_FONT_FIELD = \"@bison-lab/payload-core/admin#FontField\";\nexport const THEME_PAIRING_FIELD = \"@bison-lab/payload-core/admin#PairingField\";\nexport const THEME_APPEARANCE_FIELD = \"@bison-lab/payload-core/admin#AppearanceField\";\nexport const THEME_GREY_SCALE_FIELD = \"@bison-lab/payload-core/admin#GreyScaleField\";\nexport const THEME_CONTRAST_REPORT = \"@bison-lab/payload-core/admin#ContrastReport\";\nexport const THEME_SECTION_HEADING = \"@bison-lab/payload-core/admin#SectionHeading\";\nexport const THEME_PUBLISH_FIELD = \"@bison-lab/payload-core/admin#PublishChild\";\nexport const THEME_SAVE_BUTTON = \"@bison-lab/payload-core/admin#HiddenSaveButton\";\nexport const THEME_DOCUMENT_CONTROLS = \"@bison-lab/payload-core/admin#ThemeDocumentControls\";\nexport const THEME_IDENTITY_FALLBACK = \"@bison-lab/payload-core/admin#IdentityFallback\";\nexport const LOOK_FIELD = \"@bison-lab/payload-core/admin#LookField\";\n\n/**\n * Document path for each editable `ThemeConfig` key. Locked with `satisfies`\n * so a new config field without a Theme field (or the reverse) fails at\n * compile time. `darkSelector` and `fontWeights` are seed-only.\n */\nexport const THEME_FIELD_PATHS = {\n brandPrimary: \"colors.brand.primary.hex\",\n brandSecondary: \"colors.brand.secondary.hex\",\n brandAccent: \"colors.brand.accent.hex\",\n brandHighlight: \"colors.brand.highlight.hex\",\n brandSuccess: \"colors.brand.success.hex\",\n brandDestructive: \"colors.brand.destructive.hex\",\n greyScale: \"colors.greyScale\",\n defaultTheme: \"appearance.defaultTheme\",\n radius: \"appearance.radius\",\n shadow: \"appearance.shadow\",\n motion: \"appearance.motion\",\n density: \"appearance.density\",\n fontBody: \"typography.body\",\n fontHeading: \"typography.heading\",\n} as const satisfies Record<keyof EditableTheme, string>;\n\nexport type ThemeFieldPath = (typeof THEME_FIELD_PATHS)[keyof typeof THEME_FIELD_PATHS];\n\n/** Empty select value for heading: same family as body. */\nexport const SAME_AS_BODY = \"\";\n\nexport function headingSelectValue(heading: ThemeConfig[\"fontHeading\"]): string {\n return heading ?? SAME_AS_BODY;\n}\n","import {\n createColorScale,\n DESTRUCTIVE_SCALE_HEX,\n generateColorScale,\n isThemeHex,\n SHADE_STEPS,\n type ColorScale,\n type ColorScaleInclude,\n type ColorScaleState,\n type ShadeStep,\n type ThemeConfig,\n} from \"@bison-lab/tokens\";\n\nimport { SAME_AS_BODY } from \"./fields\";\nimport type { ThemeColorDoc, ThemeDoc } from \"./types\";\n\nfunction pick<T>(value: T | null | undefined, fallback: T): T {\n return value == null ? fallback : value;\n}\n\nfunction headingFromDoc(\n heading: string | null | undefined,\n seed: ThemeConfig[\"fontHeading\"],\n): string | null {\n if (heading === undefined) return seed;\n if (heading === null || heading === SAME_AS_BODY) return null;\n return heading;\n}\n\nfunction hexFromColor(value: ThemeColorDoc | string | null | undefined, fallback: string): string {\n if (typeof value === \"string\") return value || fallback;\n return pick(value?.hex, fallback);\n}\n\nexport function colorDocFromHex(hex: string, sourceStep: ShadeStep = 500): ThemeColorDoc {\n return colorDocFromState(createColorScale(hex, sourceStep));\n}\n\nexport function colorDocFromState(state: ColorScaleState): ThemeColorDoc {\n return {\n hex: state.hex,\n sourceStep: state.sourceStep,\n scale: state.scale,\n stale: state.stale,\n include: Array.isArray(state.include) ? \"custom\" : state.include,\n includedSteps: Array.isArray(state.include) ? [...state.include] : undefined,\n };\n}\n\nexport function stateFromColorDoc(\n doc: ThemeColorDoc | null | undefined,\n fallbackHex = \"#000000\",\n): ColorScaleState {\n const hex = isThemeHex(doc?.hex) ? doc.hex : fallbackHex;\n const sourceStep = (Number(doc?.sourceStep) || 500) as ShadeStep;\n const include = includeFromDoc(doc, sourceStep);\n const scale =\n doc?.scale && typeof doc.scale === \"object\" ? (doc.scale as ColorScale) : generateColorScale(hex, sourceStep);\n return { hex, sourceStep, scale, stale: Boolean(doc?.stale), include };\n}\n\nfunction includeFromDoc(doc: ThemeColorDoc | null | undefined, sourceStep: ShadeStep): ColorScaleInclude {\n if (doc?.include === \"source\") return \"source\";\n if (doc?.include === \"custom\" && Array.isArray(doc.includedSteps)) {\n const steps = doc.includedSteps.map(Number).filter((step): step is ShadeStep => SHADE_STEPS.includes(step as ShadeStep));\n if (!steps.includes(sourceStep)) steps.push(sourceStep);\n return steps;\n }\n return \"all\";\n}\n\n/**\n * Nested Theme document → flat `ThemeConfig`. Null or missing editor\n * fields take the seed; `darkSelector` and `fontWeights` always come from\n * the seed. Reads the BIS-87 groups and the pre-BIS-87 flat fields.\n */\nexport function themeConfigFromDoc(doc: ThemeDoc | null | undefined, seed: ThemeConfig): ThemeConfig {\n const brand = doc?.colors?.brand ?? doc?.brand;\n const typography = doc?.typography ?? doc?.fonts;\n const appearance = doc?.appearance;\n return {\n brandPrimary: hexFromColor(brand?.primary, seed.brandPrimary),\n brandSecondary: hexFromColor(brand?.secondary, seed.brandSecondary),\n brandAccent: hexFromColor(brand?.accent, seed.brandAccent),\n brandHighlight: hexFromColor(brand?.highlight, seed.brandHighlight),\n brandSuccess: hexFromColor(brand?.success, seed.brandSuccess),\n brandDestructive:\n hexFromColor(brand?.destructive, seed.brandDestructive ?? DESTRUCTIVE_SCALE_HEX) ||\n seed.brandDestructive ||\n DESTRUCTIVE_SCALE_HEX,\n greyScale: pick(doc?.colors?.greyScale ?? doc?.greyScale, seed.greyScale),\n radius: pick(appearance?.radius ?? doc?.radius, seed.radius),\n shadow: pick(appearance?.shadow ?? doc?.shadow, seed.shadow),\n motion: pick(appearance?.motion ?? doc?.motion, seed.motion),\n density: pick(appearance?.density ?? doc?.density, seed.density),\n defaultTheme: pick(appearance?.defaultTheme ?? doc?.defaultTheme, seed.defaultTheme),\n fontBody: pick(typography?.body, seed.fontBody),\n fontHeading: headingFromDoc(typography?.heading, seed.fontHeading),\n darkSelector: seed.darkSelector,\n fontWeights: seed.fontWeights,\n };\n}\n\n/** The document `seedTheme` writes so a fresh Global matches the seed config. */\nexport function docFromConfig(config: ThemeConfig, destructive?: string): ThemeDoc {\n const destructiveHex = destructive ?? config.brandDestructive ?? DESTRUCTIVE_SCALE_HEX;\n return {\n colors: {\n brand: {\n primary: colorDocFromHex(config.brandPrimary),\n secondary: colorDocFromHex(config.brandSecondary),\n accent: colorDocFromHex(config.brandAccent),\n highlight: colorDocFromHex(config.brandHighlight),\n success: colorDocFromHex(config.brandSuccess),\n destructive: colorDocFromHex(destructiveHex),\n },\n library: [],\n greyScale: config.greyScale,\n },\n typography: {\n body: config.fontBody,\n heading: config.fontHeading,\n },\n appearance: {\n defaultTheme: config.defaultTheme,\n radius: config.radius,\n shadow: config.shadow,\n motion: config.motion,\n density: config.density,\n },\n };\n}\n\nexport function validateThemeHex(value: unknown): true | string {\n if (!isThemeHex(value)) return \"Enter a six-digit hex colour like #1e3a5f\";\n return true;\n}\n\nexport function validateSourceIncluded(\n value: unknown,\n { siblingData }: { siblingData?: { sourceStep?: unknown; include?: unknown } },\n): true | string {\n const include = siblingData?.include;\n if (include === \"all\" || include === \"source\") return true;\n const source = Number(siblingData?.sourceStep);\n const steps = Array.isArray(value) ? value.map(Number) : [];\n if (!SHADE_STEPS.includes(source as ShadeStep)) return true;\n if (!steps.includes(source)) return \"The source step cannot be excluded\";\n return true;\n}\n","import type { Access } from \"payload\";\nimport type { FontEntry } from \"@bison-lab/fonts\";\nimport type { ColorScale, ColorScaleInclude, ShadeStep, ThemeConfig } from \"@bison-lab/tokens\";\n\nimport type { ColorUsagesOption } from \"./color-usages\";\nimport type { ResolvedThemeIdentity, ThemeIdentityFallback } from \"./identity\";\n\n/**\n * The Theme document a site's generated types will describe. Optional and\n * nullable, no index signature: a generated Global is assignable to this,\n * never the reverse.\n *\n * Legacy flat `brand.*` hexes, `fonts`, and preset fields at the root stay\n * readable so `getPublishedTheme` still maps a pre-BIS-87 row.\n */\nexport interface ThemeColorDoc {\n hex?: string | null;\n sourceStep?: ShadeStep | string | null;\n scale?: ColorScale | null;\n stale?: boolean | null;\n include?: ColorScaleInclude | \"custom\" | null;\n includedSteps?: ShadeStep[] | string[] | null;\n}\n\nexport interface ThemeLibraryColorDoc extends ThemeColorDoc {\n key?: string | null;\n label?: string | null;\n}\n\nexport interface ThemeDoc {\n colors?: {\n brand?: {\n primary?: ThemeColorDoc | string | null;\n secondary?: ThemeColorDoc | string | null;\n accent?: ThemeColorDoc | string | null;\n highlight?: ThemeColorDoc | string | null;\n success?: ThemeColorDoc | string | null;\n destructive?: ThemeColorDoc | string | null;\n } | null;\n library?: ThemeLibraryColorDoc[] | null;\n greyScale?: ThemeConfig[\"greyScale\"] | null;\n } | null;\n typography?: {\n body?: string | null;\n heading?: string | null;\n } | null;\n appearance?: {\n defaultTheme?: ThemeConfig[\"defaultTheme\"] | null;\n radius?: ThemeConfig[\"radius\"] | null;\n shadow?: ThemeConfig[\"shadow\"] | null;\n motion?: ThemeConfig[\"motion\"] | null;\n density?: ThemeConfig[\"density\"] | null;\n } | null;\n /** @deprecated Pre-BIS-87 flat brand hexes. */\n brand?: {\n primary?: ThemeColorDoc | string | null;\n secondary?: ThemeColorDoc | string | null;\n accent?: ThemeColorDoc | string | null;\n highlight?: ThemeColorDoc | string | null;\n success?: ThemeColorDoc | string | null;\n destructive?: ThemeColorDoc | string | null;\n } | null;\n /** @deprecated Pre-BIS-87; now `colors.greyScale`. */\n greyScale?: ThemeConfig[\"greyScale\"] | null;\n /** @deprecated Pre-BIS-87; now `appearance.*`. */\n radius?: ThemeConfig[\"radius\"] | null;\n shadow?: ThemeConfig[\"shadow\"] | null;\n motion?: ThemeConfig[\"motion\"] | null;\n density?: ThemeConfig[\"density\"] | null;\n defaultTheme?: ThemeConfig[\"defaultTheme\"] | null;\n /** @deprecated Pre-BIS-87; now `typography`. */\n fonts?: {\n body?: string | null;\n heading?: string | null;\n } | null;\n logo?: number | string | ThemeUploadDoc | null;\n favicon?: number | string | ThemeUploadDoc | null;\n logoMark?: number | string | ThemeUploadDoc | null;\n}\n\nexport interface ThemeUploadDoc {\n id?: number | string | null;\n url?: string | null;\n alt?: string | null;\n}\n\n/**\n * What an editor can change. `darkSelector` and `fontWeights` stay on the\n * seed — they mean nothing in the admin — and `themeConfigFromDoc` puts\n * them back.\n */\nexport type EditableTheme = Omit<ThemeConfig, \"darkSelector\" | \"fontWeights\">;\n\nexport interface CreateThemeOptions {\n /**\n * `update` defaults to `canUseFeature(\"theme\")` (Designer in the seed).\n * `read` defaults to public; pass a stricter function to tighten it.\n * Omitting `access` still registers the Global.\n */\n access?: { read?: Access; update?: Access };\n /** The site's `bison.config.json`. Every field's `defaultValue`, and the fallback `getPublishedTheme` returns. */\n seed: ThemeConfig;\n /**\n * Destructive seed hex. Falls back to `seed.brandDestructive`, then\n * the library's `DESTRUCTIVE_SCALE_HEX` (`#FF7C6B`).\n */\n destructive?: string;\n /** Default: the whole catalogue. */\n fonts?: readonly FontEntry[];\n /** Where the site's `serveFont` route answers, for the picker's specimens. Default `\"/fonts\"`. */\n fontsBaseUrl?: string;\n /** Fill + automatic label target. Default `7`. Warnings never block save. */\n contrastTarget?: number;\n /**\n * @deprecated Theme has no preview pane (SPI-56 canceled). Kept so a\n * site that still passes it does not fail to boot.\n */\n previewPath?: string;\n /**\n * Adds the Identity page (logo, favicon, mobile-menu mark) when given.\n * Pass `BRAND_ASSETS_SLUG` (or the slug you gave `createBrandAssets`).\n * Save on that page writes only those uploads onto the stored Theme row.\n */\n logo?: { collection: string };\n /**\n * Fallback art when logo, favicon, or mobile-menu mark is empty. The\n * site passes today's files; `--color-primary-mark` is not a Theme field.\n */\n identity?: { fallback?: ThemeIdentityFallback };\n /** Fires from `afterChange` on every save — Theme has no draft mode. */\n onPublish?: (theme: ThemeConfig, doc: ThemeDoc) => void | Promise<void>;\n /**\n * Where Colors Delete looks for `lookField` / `colorTokenField` tokens\n * (drafts included). `true` scans every registered collection and\n * global at request time — Payload internals and Theme itself are\n * skipped, so a later Navigation or Territories global joins without\n * a site change. A list still names slugs. Omit or pass empty: every\n * additional color is unused and deletes immediately.\n */\n colorUsages?: ColorUsagesOption;\n}\n\nexport interface ThemeHeadOptions {\n fontsBaseUrl?: string;\n attribute?: \"class\" | \"data-theme\";\n identity?: ResolvedThemeIdentity;\n /**\n * Custom Colors rows. `themeHead` emits their 50–950 variables and\n * `[data-look]` bindings so a picker key paints without a package bump.\n */\n library?: ThemeLibraryColorDoc[] | null;\n}\n\nexport interface ThemeHead {\n css: string;\n preloads: { href: string; type: \"font/woff2\" }[];\n identity?: ResolvedThemeIdentity;\n}\n\nexport const THEME_SLUG = \"theme\";\nexport const THEME_COLORS_SLUG = \"theme-colors\";\nexport const THEME_TYPOGRAPHY_SLUG = \"theme-typography\";\nexport const THEME_APPEARANCE_SLUG = \"theme-appearance\";\nexport const THEME_IDENTITY_SLUG = \"theme-identity\";\n\nexport const SYSTEM_COLOR_KEYS = [\n \"primary\",\n \"secondary\",\n \"accent\",\n \"highlight\",\n \"success\",\n \"destructive\",\n] as const;\n\nexport type SystemColorKey = (typeof SYSTEM_COLOR_KEYS)[number];\n","import type { ThemeDoc, ThemeUploadDoc } from \"./types\";\n\nexport interface ThemeIdentityAsset {\n url: string;\n alt: string;\n}\n\nexport interface ThemeIdentityFallback {\n lockup?: ThemeIdentityAsset;\n mark?: ThemeIdentityAsset;\n favicon?: ThemeIdentityAsset;\n}\n\nexport interface ResolvedThemeIdentity {\n lockup: ThemeIdentityAsset | null;\n mark: ThemeIdentityAsset | null;\n favicon: ThemeIdentityAsset | null;\n}\n\nfunction fromUpload(value: ThemeDoc[\"logo\"], fallback?: ThemeIdentityAsset): ThemeIdentityAsset | null {\n if (value && typeof value === \"object\") {\n const upload = value as ThemeUploadDoc;\n if (upload.url) {\n return { url: upload.url, alt: upload.alt ?? fallback?.alt ?? \"\" };\n }\n }\n return fallback ?? null;\n}\n\n/**\n * Uploaded logo, favicon, and mobile-menu mark, or the fallback the site\n * passed into `createTheme`. Empty fields keep the fallback;\n * `--color-primary-mark` is not a Theme field.\n */\nexport function resolveThemeIdentity(\n doc: ThemeDoc | null | undefined,\n fallback?: ThemeIdentityFallback,\n): ResolvedThemeIdentity {\n return {\n lockup: fromUpload(doc?.logo, fallback?.lockup),\n mark: fromUpload(doc?.logoMark, fallback?.mark),\n favicon: fromUpload(doc?.favicon, fallback?.favicon),\n };\n}\n"],"mappings":"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"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, E as BlockLibraryHolder, O as BlockLibraryRow, S as BlockLibraryCategoryId, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, b as BLOCK_LIBRARY_CATEGORIES, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, k as BlockLibraryUsage, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, u as getSectionControls, v as defaultSectionControls, w as BlockLibraryDraftHolder, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-
|
|
2
|
-
import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
1
|
+
import { A as PACKAGE_BLOCK_SLUGS, C as BlockLibraryDoc, D as BlockLibraryKind, E as BlockLibraryHolder, O as BlockLibraryRow, S as BlockLibraryCategoryId, T as BlockLibraryEntry, _ as SectionControls, a as sectionControlsFromLibrary, b as BLOCK_LIBRARY_CATEGORIES, c as BlockLibraryReader, d as DEFAULT_SECTION_CONTROLS, f as HERO_SECTION_CONTROLS, g as SectionControlKey, h as SECTION_CONTROL_LABELS, i as defaultBlockLibraryValue, k as BlockLibraryUsage, l as blockLibraryEntriesFromConfig, m as SECTION_CONTROL_KEYS, n as BlockLibraryOptions, o as stampBlockLibrary, p as NO_SECTION_CONTROLS, r as blockLibraryCatalogue, s as validateBlockLibrary, u as getSectionControls, v as defaultSectionControls, w as BlockLibraryDraftHolder, x as BLOCK_LIBRARY_SLUG, y as sectionControlsOf } from "./catalogue-CEfYwTSK.mjs";
|
|
2
|
+
import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-C8ppEDlc.mjs";
|
|
3
|
+
import { C as rewriteColorUsages, S as findColorUsages, _ as ThemeIdentityFallback, a as THEME_APPEARANCE_SLUG, b as ColorUsagesList, c as THEME_SLUG, d as ThemeDoc, g as ResolvedThemeIdentity, h as ThemeUploadDoc, i as SystemColorKey, l as THEME_TYPOGRAPHY_SLUG, m as ThemeLibraryColorDoc, n as EditableTheme, o as THEME_COLORS_SLUG, r as SYSTEM_COLOR_KEYS, s as THEME_IDENTITY_SLUG, t as CreateThemeOptions, u as ThemeColorDoc, v as resolveThemeIdentity, x as ColorUsagesOption, y as ColorUsage } from "./types-D6jQql5Z.mjs";
|
|
4
|
+
import { _ as deleteLibraryColor, a as PageEditorSystemKey, c as pageEditorTokens, d as LookFieldOptions, f as colorTokenField, g as rewriteColorTokens, h as findColorTokens, i as PAGE_EDITOR_SYSTEM_KEYS, l as themeLibraryFromDoc, m as ColorTokenHit, n as ColorSwatch, o as pageEditorLooks, p as lookField, r as LookOption, s as pageEditorSwatches, t as THEME_PREVIEW_BREAKPOINTS, u as LookFieldMode, v as rewriteColorToken, y as themeColorKeys } from "./preview-Cgbh9eAq.mjs";
|
|
5
|
+
import { n as facetField, t as FacetEntry } from "./facet-field-BvQp8Hzh.mjs";
|
|
6
|
+
import { C as NAVIGATION_FOOTER_SLUG, D as NavigationFooter, E as NavigationDoc, O as NavigationHeader, S as NAVIGATION_FOOTER_DB_NAME, T as NavigationBar, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, b as NAVIGATION_DB_NAME, c as FooterColumnWidth, d as normalizeFooterDesktop, f as validateFooterColumns, g as isValidExternalHref, h as headerCtaEnabled, i as FOOTER_MAX_COLUMNS, l as FooterSocial, m as EXTERNAL_HREF_MESSAGE, n as FOOTER_COLUMNS_FIELD, o as FOOTER_SOCIALS, p as validateFooterSocialUrl, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as footerDesktopTracks, v as validateHeaderCta, w as NAVIGATION_SLUG, x as NAVIGATION_FEATURE, y as CreateNavigationOptions } from "./published-Dsg-HX-v.mjs";
|
|
6
7
|
import { ThemeConfig } from "@bison-lab/tokens";
|
|
7
8
|
import * as payload$1 from "payload";
|
|
8
9
|
import { Access, Block, CheckboxField, CollectionAfterChangeHook, CollectionBeforeChangeHook, CollectionBeforeValidateHook, CollectionConfig, CollectionSlug, Config, Endpoint, Field, GlobalConfig, ImageSize, Payload, PayloadRequest, Plugin, UploadCollectionSlug } from "payload";
|
|
@@ -840,6 +841,40 @@ interface CreateTaxonomyOptions {
|
|
|
840
841
|
*/
|
|
841
842
|
declare function createTaxonomy(options: CreateTaxonomyOptions): CollectionConfig;
|
|
842
843
|
//#endregion
|
|
844
|
+
//#region src/forms/collection.d.ts
|
|
845
|
+
/** The collection `storedDestination()` (`@bison-lab/payload-blocks/forms`) writes to. */
|
|
846
|
+
declare const FORM_SUBMISSIONS_SLUG = "form-submissions";
|
|
847
|
+
interface CreateFormSubmissionsOptions {
|
|
848
|
+
/**
|
|
849
|
+
* Who may read and delete submissions. Read defaults to any signed-in
|
|
850
|
+
* user (an editor answers inquiries); delete defaults to nobody, so the
|
|
851
|
+
* record is kept until a site says otherwise (`delete: isAdmin`).
|
|
852
|
+
* Create and update are never open: a row is written only by the submit
|
|
853
|
+
* endpoint, through the Local API with access overridden.
|
|
854
|
+
*/
|
|
855
|
+
access?: {
|
|
856
|
+
read?: Access;
|
|
857
|
+
delete?: Access;
|
|
858
|
+
};
|
|
859
|
+
/** @default "Content" */
|
|
860
|
+
group?: string;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Form submissions stored in the CMS (BIS-179): one row per inquiry, with
|
|
864
|
+
* the form it came from, the page it sat on, every answer and the time.
|
|
865
|
+
*
|
|
866
|
+
* Read-only in the admin. `create` and `update` refuse every request, REST
|
|
867
|
+
* and Local API with `overrideAccess: false` alike, so a visitor cannot post
|
|
868
|
+
* a row past the endpoint's checks and an editor cannot rewrite what a
|
|
869
|
+
* visitor sent. `storedDestination()` writes with `overrideAccess: true`
|
|
870
|
+
* after the endpoint has checked the answers and the spam token.
|
|
871
|
+
*
|
|
872
|
+
* ```ts
|
|
873
|
+
* collections: [createFormSubmissions({ access: { delete: isAdmin } })],
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
876
|
+
declare function createFormSubmissions(options?: CreateFormSubmissionsOptions): CollectionConfig;
|
|
877
|
+
//#endregion
|
|
843
878
|
//#region src/questions/types.d.ts
|
|
844
879
|
declare const QUESTIONS_SLUG = "questions";
|
|
845
880
|
declare const QUESTIONS_FEATURE = "questions";
|
|
@@ -1313,5 +1348,5 @@ declare function roleDescription(role: string, matrix?: readonly RoleRow[]): str
|
|
|
1313
1348
|
*/
|
|
1314
1349
|
declare function resetRolesMatrix(current: unknown): RoleRow[];
|
|
1315
1350
|
//#endregion
|
|
1316
|
-
export { ADMIN_NAV, ADMIN_NAV_ENTITY_FIELD, ADMIN_NAV_ITEM_ROW_LABEL, ADMIN_NAV_ROW_LABEL, ADMIN_NAV_SLUG, type AdminNavConfig, type AdminNavDoc, type AdminNavGroup, type AdminNavItem, type AdminNavVisibleEntities, BLOCK_DRAWER_CSS, BLOCK_DRAWER_STYLES, BLOCK_LIBRARY_CATEGORIES, BLOCK_LIBRARY_FIELD, BLOCK_LIBRARY_SLUG, BLOCK_THUMBNAIL_PATH, BRAND_ASSETS_MIME_TYPES, BRAND_ASSETS_SLUG, type BlockDrawerEntry, type BlockLibraryCategoryId, type BlockLibraryDoc, type BlockLibraryDraftHolder, type BlockLibraryEntry, type BlockLibraryHolder, type BlockLibraryKind, type BlockLibraryPayload, type BlockLibraryReader, type BlockLibraryRow, type BlockLibraryUsage, type BlockUsageOptions, CAPABILITIES, CAPABILITY_FEATURES, type Capability, type ColorSwatch, type ColorTokenHit, type ColorUsage, type ColorUsagesList, type ColorUsagesOption, type CreateBlockLibraryOptions, type CreateBrandAssetsOptions, type CreateFeaturesOptions, type CreateNavigationOptions, type CreateQuestionsOptions, type CreateRolesOptions, type CreateTaxonomyOptions, type CreateThemeOptions, DEFAULT_ROLE_GRANTS, DEFAULT_ROLE_MATRIX, DEFAULT_SECTION_CONTROLS, DESCRIPTION_LENGTH, DEVELOPER_DESCRIPTION, DOCUMENT_CREATE_NEW, DOCUMENT_TITLE_ACTIONS, DUPLICATE_ROLE_NAME_MESSAGE, DUPLICATE_ROLE_SLUG_MESSAGE, EXISTING_PARENT_MESSAGE, EXTERNAL_HREF_MESSAGE, type EditableTheme, FEATURES_MATRIX_FIELD, FEATURES_SLUG, FEATURE_GROUPS, FEATURE_GROUP_LABELS, FOOTER_COLUMNS_FIELD, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, type FacetEntry, type FeatureExtra, type FeatureGroupId, type FeatureRow, type FeaturesDoc, type FooterColumnWidth, type FooterSocial, HERO_SECTION_CONTROLS, INVALID_ROLE_NAME_MESSAGE, LAST_ADMIN_DELETE_MESSAGE, LAST_ADMIN_DEMOTE_MESSAGE, LAST_USERS_TICK_MESSAGE, LAYOUT_DESCRIPTION, LAYOUT_REQUIRED_LABEL, LAYOUT_REQUIRED_MESSAGE, LIST_ALIGN, LOOK_FIELD, type ListAlign, type ListAlignColumn, type LookFieldMode, type LookFieldOptions, type LookOption, MEDIA_ALT_AUTOFILL, MEDIA_IN_USE_PATH, MEDIA_LIST, MISSING_PACKAGE_FEATURES_MESSAGE, MISSING_SEED_ROLES_MESSAGE, type MaybeUser, type MediaId, type MediaInUseOption, type MediaOptions, NAVIGATION_DB_NAME, NAVIGATION_FEATURE, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, NEW_FOLDER_PARENT, NO_SECTION_CONTROLS, type NavigationBar, type NavigationDoc, type NavigationFooter, type NavigationHeader, type OrganizeByEntry, type OrganizeByLook, PACKAGE_BLOCK_SLUGS, PACKAGE_FEATURES, PACKAGE_FEATURE_SLUGS, PAGE_EDITOR_SYSTEM_KEYS, PAGE_SLUG_CELL, PAGE_TITLE_CELL, type PackageFeature, type PackageFeatureSlug, type PageEditorSystemKey, type PagesOptions, QUESTIONS_FEATURE, QUESTIONS_LIST, QUESTIONS_SLUG, REDIRECTS_SLUG, REQUIRED_PAGE_CELL, REQUIRED_PAGE_DELETE_MESSAGE, REQUIRED_PAGE_FIELD, REQUIRED_PAGE_UNPUBLISH_MESSAGE, RICH_TEXT_EDITOR_FONTS, RICH_TEXT_EDITOR_FONTS_CSS, ROLES, ROLES_CELL, ROLES_FIELD, ROLES_FIELD_DESCRIPTION, ROLES_GLOBAL_DESCRIPTION, ROLES_GRANTS_FIELD, ROLES_LOCKOUT_MESSAGE, ROLES_MATRIX_FIELD, ROLES_ROW_LABEL, ROLES_SLUG, ROLE_LABELS, ROLE_NAME_FIELD, ROLE_SLUG_FIELD, ROOT_PAGE_KEY, ROOT_PAGE_SLUG, type ResolveAdminNavArgs, type ResolvedThemeIdentity, type Role, type RoleExtra, type RoleRow, type RolesDoc, SECTION_CONTROL_KEYS, SECTION_CONTROL_LABELS, SHARE_IMAGE_SIZE, SLUG_FIELD, SLUG_UNLOCK_WARNING, SYSTEM_COLOR_KEYS, type SectionControlKey, type SectionControls, type SeoDoc, type SeoImageDoc, type SeoImageSize, type SeoImageValue, type SeoMeta, type SeoPluginOptions, type SlugFieldOptions, type SystemColorKey, THEME_APPEARANCE_FIELD, THEME_APPEARANCE_SLUG, THEME_COLORS_SLUG, THEME_COLOR_FIELD, THEME_COLOR_SCALE_FIELD, THEME_CONTRAST_REPORT, THEME_DOCUMENT_CONTROLS, THEME_FEATURE_SLUGS, THEME_FONT_FIELD, THEME_GREY_SCALE_FIELD, THEME_IDENTITY_FALLBACK, THEME_IDENTITY_SLUG, THEME_LIBRARY_FIELD, THEME_PAIRING_FIELD, THEME_PREVIEW_BREAKPOINTS, THEME_PUBLISH_FIELD, THEME_SAVE_BUTTON, THEME_SECTION_HEADING, THEME_SLUG, THEME_TYPOGRAPHY_SLUG, type ThemeChild, type ThemeColorDoc, type ThemeDoc, type ThemeIdentityFallback, type ThemeLibraryColorDoc, type ThemeUploadDoc, type UsersOptions, adminNav, adminOnlyApiTab, allowedFeaturesForUser, altFromFilename, applyRoleSlugsFromNames, authenticatedOrPublished, blockDrawer, blockLibraryCatalogue, blockLibraryEntriesFromConfig, blockThumbnailEndpoint, blockUsage, canManageBrand, canManageContent, canPublish, canUseFeature, colorTokenField, composeSlug, createAdminNav, createBlockLibrary, createBrandAssets, createFeatures, createMedia, createNavigation, createPages, createQuestions, createRedirects, createRoles, createTaxonomy, createTheme, createUsers, defaultBlockLibraryValue, defaultFeaturesFieldValue, defaultRolesFieldValue, defaultSectionControls, deleteLibraryColor, developerOnlyAccess, documentCreateNew, documentTitle, documentTitleActions, ensureRootPage, facetField, featureCatalogue, featureGroupLabel, fillBlankAltFromFilename, findColorTokens, findColorUsages, firstImageIn, footerDesktopTracks, getFeaturesMatrix, getNavigation, getRolesMatrix, getSectionControls, groupBlocksByCategory, hasCapability, hasFeature, hasGrant, hasRole, headerCtaEnabled, hideUnlessDeveloper, hideUnlessFeature, inferredFolders, isAdmin, isAdminOrSelf, isAuthenticated, isDeveloper, isDeveloperTab, isFeatureGroupId, isFeatureSlug, isLockedFeature, isPackageFeatureSlug, isPrivilegedRole, isRole, isRoleName, isRoleSlug, isRootPageKey, isValidExternalHref, lexicalPlainText, listAlign, listAlignColumns, listAlignCss, lockSlugOnPublish, lookField, noIndexField, normalizeFooterDesktop, normalizeSlug, normalizeStoredRoles, packageThumbnailURL, pageEditorLooks, pageEditorSwatches, pageEditorTokens, parentPrefix, parseFeaturesMatrix, parseRolesMatrix, persistThemeChild, pruneUserRoles, publishThemeChild, recordPublishedSlugRedirect, redirectPath, replaceClientOriginalWithResizedFile, requireLayoutOnPublish, resetRolesMatrix, resolveAdminNav, resolveThemeIdentity, rewriteColorToken, rewriteColorTokens, rewriteColorUsages, richTextEditorFonts, roleDescription, roleLabel, roleSelectOptions, sanitizeRoleNameInput, sanitizeSvg, sectionControlsFromLibrary, sectionControlsOf, seedFeatures, seedRoleRows, seedRoles, seedTheme, seoPlugin, slugDepth, slugField, slugLeaf, slugifyRoleName, stampBlockLibrary, stampFeatureCatalogue, storedRoles, stripDrafts, syncAnswerText, themeColorKeys, themeLibraryFromDoc, titleTemplate, truncateAtWord, validateBlockLibrary, validateExternalHref, validateFeaturesMatrix, validateFooterColumns, validateFooterSocialUrl, validateHeaderCta, validateRolesMatrix, withThumbnail, writePublishedSlugRedirect };
|
|
1351
|
+
export { ADMIN_NAV, ADMIN_NAV_ENTITY_FIELD, ADMIN_NAV_ITEM_ROW_LABEL, ADMIN_NAV_ROW_LABEL, ADMIN_NAV_SLUG, type AdminNavConfig, type AdminNavDoc, type AdminNavGroup, type AdminNavItem, type AdminNavVisibleEntities, BLOCK_DRAWER_CSS, BLOCK_DRAWER_STYLES, BLOCK_LIBRARY_CATEGORIES, BLOCK_LIBRARY_FIELD, BLOCK_LIBRARY_SLUG, BLOCK_THUMBNAIL_PATH, BRAND_ASSETS_MIME_TYPES, BRAND_ASSETS_SLUG, type BlockDrawerEntry, type BlockLibraryCategoryId, type BlockLibraryDoc, type BlockLibraryDraftHolder, type BlockLibraryEntry, type BlockLibraryHolder, type BlockLibraryKind, type BlockLibraryPayload, type BlockLibraryReader, type BlockLibraryRow, type BlockLibraryUsage, type BlockUsageOptions, CAPABILITIES, CAPABILITY_FEATURES, type Capability, type ColorSwatch, type ColorTokenHit, type ColorUsage, type ColorUsagesList, type ColorUsagesOption, type CreateBlockLibraryOptions, type CreateBrandAssetsOptions, type CreateFeaturesOptions, type CreateFormSubmissionsOptions, type CreateNavigationOptions, type CreateQuestionsOptions, type CreateRolesOptions, type CreateTaxonomyOptions, type CreateThemeOptions, DEFAULT_ROLE_GRANTS, DEFAULT_ROLE_MATRIX, DEFAULT_SECTION_CONTROLS, DESCRIPTION_LENGTH, DEVELOPER_DESCRIPTION, DOCUMENT_CREATE_NEW, DOCUMENT_TITLE_ACTIONS, DUPLICATE_ROLE_NAME_MESSAGE, DUPLICATE_ROLE_SLUG_MESSAGE, EXISTING_PARENT_MESSAGE, EXTERNAL_HREF_MESSAGE, type EditableTheme, FEATURES_MATRIX_FIELD, FEATURES_SLUG, FEATURE_GROUPS, FEATURE_GROUP_LABELS, FOOTER_COLUMNS_FIELD, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, FORM_SUBMISSIONS_SLUG, type FacetEntry, type FeatureExtra, type FeatureGroupId, type FeatureRow, type FeaturesDoc, type FooterColumnWidth, type FooterSocial, HERO_SECTION_CONTROLS, INVALID_ROLE_NAME_MESSAGE, LAST_ADMIN_DELETE_MESSAGE, LAST_ADMIN_DEMOTE_MESSAGE, LAST_USERS_TICK_MESSAGE, LAYOUT_DESCRIPTION, LAYOUT_REQUIRED_LABEL, LAYOUT_REQUIRED_MESSAGE, LIST_ALIGN, LOOK_FIELD, type ListAlign, type ListAlignColumn, type LookFieldMode, type LookFieldOptions, type LookOption, MEDIA_ALT_AUTOFILL, MEDIA_IN_USE_PATH, MEDIA_LIST, MISSING_PACKAGE_FEATURES_MESSAGE, MISSING_SEED_ROLES_MESSAGE, type MaybeUser, type MediaId, type MediaInUseOption, type MediaOptions, NAVIGATION_DB_NAME, NAVIGATION_FEATURE, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, NEW_FOLDER_PARENT, NO_SECTION_CONTROLS, type NavigationBar, type NavigationDoc, type NavigationFooter, type NavigationHeader, type OrganizeByEntry, type OrganizeByLook, PACKAGE_BLOCK_SLUGS, PACKAGE_FEATURES, PACKAGE_FEATURE_SLUGS, PAGE_EDITOR_SYSTEM_KEYS, PAGE_SLUG_CELL, PAGE_TITLE_CELL, type PackageFeature, type PackageFeatureSlug, type PageEditorSystemKey, type PagesOptions, QUESTIONS_FEATURE, QUESTIONS_LIST, QUESTIONS_SLUG, REDIRECTS_SLUG, REQUIRED_PAGE_CELL, REQUIRED_PAGE_DELETE_MESSAGE, REQUIRED_PAGE_FIELD, REQUIRED_PAGE_UNPUBLISH_MESSAGE, RICH_TEXT_EDITOR_FONTS, RICH_TEXT_EDITOR_FONTS_CSS, ROLES, ROLES_CELL, ROLES_FIELD, ROLES_FIELD_DESCRIPTION, ROLES_GLOBAL_DESCRIPTION, ROLES_GRANTS_FIELD, ROLES_LOCKOUT_MESSAGE, ROLES_MATRIX_FIELD, ROLES_ROW_LABEL, ROLES_SLUG, ROLE_LABELS, ROLE_NAME_FIELD, ROLE_SLUG_FIELD, ROOT_PAGE_KEY, ROOT_PAGE_SLUG, type ResolveAdminNavArgs, type ResolvedThemeIdentity, type Role, type RoleExtra, type RoleRow, type RolesDoc, SECTION_CONTROL_KEYS, SECTION_CONTROL_LABELS, SHARE_IMAGE_SIZE, SLUG_FIELD, SLUG_UNLOCK_WARNING, SYSTEM_COLOR_KEYS, type SectionControlKey, type SectionControls, type SeoDoc, type SeoImageDoc, type SeoImageSize, type SeoImageValue, type SeoMeta, type SeoPluginOptions, type SlugFieldOptions, type SystemColorKey, THEME_APPEARANCE_FIELD, THEME_APPEARANCE_SLUG, THEME_COLORS_SLUG, THEME_COLOR_FIELD, THEME_COLOR_SCALE_FIELD, THEME_CONTRAST_REPORT, THEME_DOCUMENT_CONTROLS, THEME_FEATURE_SLUGS, THEME_FONT_FIELD, THEME_GREY_SCALE_FIELD, THEME_IDENTITY_FALLBACK, THEME_IDENTITY_SLUG, THEME_LIBRARY_FIELD, THEME_PAIRING_FIELD, THEME_PREVIEW_BREAKPOINTS, THEME_PUBLISH_FIELD, THEME_SAVE_BUTTON, THEME_SECTION_HEADING, THEME_SLUG, THEME_TYPOGRAPHY_SLUG, type ThemeChild, type ThemeColorDoc, type ThemeDoc, type ThemeIdentityFallback, type ThemeLibraryColorDoc, type ThemeUploadDoc, type UsersOptions, adminNav, adminOnlyApiTab, allowedFeaturesForUser, altFromFilename, applyRoleSlugsFromNames, authenticatedOrPublished, blockDrawer, blockLibraryCatalogue, blockLibraryEntriesFromConfig, blockThumbnailEndpoint, blockUsage, canManageBrand, canManageContent, canPublish, canUseFeature, colorTokenField, composeSlug, createAdminNav, createBlockLibrary, createBrandAssets, createFeatures, createFormSubmissions, createMedia, createNavigation, createPages, createQuestions, createRedirects, createRoles, createTaxonomy, createTheme, createUsers, defaultBlockLibraryValue, defaultFeaturesFieldValue, defaultRolesFieldValue, defaultSectionControls, deleteLibraryColor, developerOnlyAccess, documentCreateNew, documentTitle, documentTitleActions, ensureRootPage, facetField, featureCatalogue, featureGroupLabel, fillBlankAltFromFilename, findColorTokens, findColorUsages, firstImageIn, footerDesktopTracks, getFeaturesMatrix, getNavigation, getRolesMatrix, getSectionControls, groupBlocksByCategory, hasCapability, hasFeature, hasGrant, hasRole, headerCtaEnabled, hideUnlessDeveloper, hideUnlessFeature, inferredFolders, isAdmin, isAdminOrSelf, isAuthenticated, isDeveloper, isDeveloperTab, isFeatureGroupId, isFeatureSlug, isLockedFeature, isPackageFeatureSlug, isPrivilegedRole, isRole, isRoleName, isRoleSlug, isRootPageKey, isValidExternalHref, lexicalPlainText, listAlign, listAlignColumns, listAlignCss, lockSlugOnPublish, lookField, noIndexField, normalizeFooterDesktop, normalizeSlug, normalizeStoredRoles, packageThumbnailURL, pageEditorLooks, pageEditorSwatches, pageEditorTokens, parentPrefix, parseFeaturesMatrix, parseRolesMatrix, persistThemeChild, pruneUserRoles, publishThemeChild, recordPublishedSlugRedirect, redirectPath, replaceClientOriginalWithResizedFile, requireLayoutOnPublish, resetRolesMatrix, resolveAdminNav, resolveThemeIdentity, rewriteColorToken, rewriteColorTokens, rewriteColorUsages, richTextEditorFonts, roleDescription, roleLabel, roleSelectOptions, sanitizeRoleNameInput, sanitizeSvg, sectionControlsFromLibrary, sectionControlsOf, seedFeatures, seedRoleRows, seedRoles, seedTheme, seoPlugin, slugDepth, slugField, slugLeaf, slugifyRoleName, stampBlockLibrary, stampFeatureCatalogue, storedRoles, stripDrafts, syncAnswerText, themeColorKeys, themeLibraryFromDoc, titleTemplate, truncateAtWord, validateBlockLibrary, validateExternalHref, validateFeaturesMatrix, validateFooterColumns, validateFooterSocialUrl, validateHeaderCta, validateRolesMatrix, withThumbnail, writePublishedSlugRedirect };
|
|
1317
1352
|
//# sourceMappingURL=index.d.mts.map
|