@bison-lab/payload-core 3.14.0 → 3.16.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 +1 @@
1
- {"version":3,"file":"looks-BbL309kO.mjs","names":[],"sources":["../src/theme/map.ts","../src/theme/types.ts","../src/theme/looks.ts"],"sourcesContent":["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 { 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 * Required, no default. Pass `canManageBrand` as `update` (and typically\n * `isAuthenticated` as `read`). Theme does not read the Roles 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` (`#ef4444`).\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 * Slugs that store `lookField` / `colorTokenField` values. Colors\n * Delete scans these (drafts included) before dropping a custom row.\n * Omit or pass empty: every additional color is unused and deletes\n * immediately. A new look surface is added here, not copied into a\n * site helper — site adopt names the slugs (SPI-93).\n */\n colorUsages?: {\n collections?: string[];\n globals?: string[];\n };\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 { includedShadeSteps, type ShadeStep } from \"@bison-lab/tokens\";\n\nimport { stateFromColorDoc } from \"./map\";\nimport { THEME_SLUG, type ThemeColorDoc, type ThemeDoc, type ThemeLibraryColorDoc } from \"./types\";\n\n/**\n * System colors Color Settings offers as page-editor fills. Success and\n * Destructive stay off this list — they are theme chrome only.\n */\nexport const PAGE_EDITOR_SYSTEM_KEYS = [\"primary\", \"secondary\", \"accent\", \"highlight\"] as const;\n\nexport type PageEditorSystemKey = (typeof PAGE_EDITOR_SYSTEM_KEYS)[number];\n\nexport interface LookOption {\n label: string;\n value: string;\n}\n\nconst SYSTEM_LABELS: Record<PageEditorSystemKey, string> = {\n primary: \"Primary\",\n secondary: \"Secondary\",\n accent: \"Accent\",\n highlight: \"Highlight\",\n};\n\nfunction brandColor(doc: ThemeDoc | null | undefined, key: PageEditorSystemKey): ThemeColorDoc | null {\n const brand = doc?.colors?.brand ?? doc?.brand;\n const value = brand?.[key];\n if (typeof value === \"string\" || value == null) return value == null ? null : { hex: value };\n return value;\n}\n\nexport function themeLibraryFromDoc(doc: ThemeDoc | null | undefined): ThemeLibraryColorDoc[] {\n return Array.isArray(doc?.colors?.library) ? doc.colors.library : [];\n}\n\nfunction libraryRows(doc: ThemeDoc | null | undefined): ThemeLibraryColorDoc[] {\n return themeLibraryFromDoc(doc);\n}\n\nfunction titleCase(key: string): string {\n return key.charAt(0).toUpperCase() + key.slice(1);\n}\n\nfunction stepsFor(color: ThemeColorDoc | null | undefined, fallbackHex: string): ShadeStep[] {\n return includedShadeSteps(stateFromColorDoc(color, fallbackHex));\n}\n\n/**\n * Family keys a `lookField()` may offer: the page-editor system scales\n * plus every custom color on Colors. Adding Coral on Theme makes `coral`\n * appear here with no `@bison-lab/*` release.\n */\nexport function pageEditorLooks(doc: ThemeDoc | null | undefined): LookOption[] {\n const system = PAGE_EDITOR_SYSTEM_KEYS.map((value) => ({\n label: SYSTEM_LABELS[value],\n value,\n }));\n const custom = libraryRows(doc)\n .map((row) => {\n const value = row.key?.trim();\n if (!value) return null;\n return { label: row.label?.trim() || titleCase(value), value };\n })\n .filter((option): option is LookOption => option !== null);\n return [...system, ...custom];\n}\n\n/**\n * Included steps as `coral-400`. Excluded steps do not appear. System\n * scales with no stored include list offer the full 50–950 ramp.\n */\nexport function pageEditorTokens(doc: ThemeDoc | null | undefined): LookOption[] {\n const tokens: LookOption[] = [];\n for (const key of PAGE_EDITOR_SYSTEM_KEYS) {\n const label = SYSTEM_LABELS[key];\n for (const step of stepsFor(brandColor(doc, key), \"#000000\")) {\n tokens.push({ label: `${label} ${step}`, value: `${key}-${step}` });\n }\n }\n for (const row of libraryRows(doc)) {\n const key = row.key?.trim();\n if (!key) continue;\n const label = row.label?.trim() || titleCase(key);\n for (const step of stepsFor(row, row.hex ?? \"#000000\")) {\n tokens.push({ label: `${label} ${step}`, value: `${key}-${step}` });\n }\n }\n return tokens;\n}\n\nexport async function themeDocFromRequest(req: {\n payload?: {\n findGlobal?: (args: {\n slug: string;\n depth?: number;\n overrideAccess?: boolean;\n }) => Promise<ThemeDoc | null | undefined>;\n };\n}): Promise<ThemeDoc | null> {\n try {\n const doc = await req.payload?.findGlobal?.({\n slug: THEME_SLUG,\n depth: 0,\n overrideAccess: true,\n });\n return doc ?? null;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;AAgBA,SAAS,KAAQ,OAA6B,UAAgB;AAC5D,QAAO,SAAS,OAAO,WAAW;;AAGpC,SAAS,eACP,SACA,MACe;AACf,KAAI,YAAY,KAAA,EAAW,QAAO;AAClC,KAAI,YAAY,QAAQ,YAAA,GAA0B,QAAO;AACzD,QAAO;;AAGT,SAAS,aAAa,OAAkD,UAA0B;AAChG,KAAI,OAAO,UAAU,SAAU,QAAO,SAAS;AAC/C,QAAO,KAAK,OAAO,KAAK,SAAS;;AAGnC,SAAgB,gBAAgB,KAAa,aAAwB,KAAoB;AACvF,QAAO,kBAAkB,iBAAiB,KAAK,WAAW,CAAC;;AAG7D,SAAgB,kBAAkB,OAAuC;AACvE,QAAO;EACL,KAAK,MAAM;EACX,YAAY,MAAM;EAClB,OAAO,MAAM;EACb,OAAO,MAAM;EACb,SAAS,MAAM,QAAQ,MAAM,QAAQ,GAAG,WAAW,MAAM;EACzD,eAAe,MAAM,QAAQ,MAAM,QAAQ,GAAG,CAAC,GAAG,MAAM,QAAQ,GAAG,KAAA;EACpE;;AAGH,SAAgB,kBACd,KACA,cAAc,WACG;CACjB,MAAM,MAAM,WAAW,KAAK,IAAI,GAAG,IAAI,MAAM;CAC7C,MAAM,aAAc,OAAO,KAAK,WAAW,IAAI;CAC/C,MAAM,UAAU,eAAe,KAAK,WAAW;AAG/C,QAAO;EAAE;EAAK;EAAY,OADxB,KAAK,SAAS,OAAO,IAAI,UAAU,WAAY,IAAI,QAAuB,mBAAmB,KAAK,WAAW;EAC9E,OAAO,QAAQ,KAAK,MAAM;EAAE;EAAS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QlE,SAAgB,gBAAgB,KAAgD;CAC9E,MAAM,SAAS,wBAAwB,KAAK,WAAW;EACrD,OAAO,cAAc;EACrB;EACD,EAAE;CACH,MAAM,SAAS,YAAY,IAAI,CAC5B,KAAK,QAAQ;EACZ,MAAM,QAAQ,IAAI,KAAK,MAAM;AAC7B,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO;GAAE,OAAO,IAAI,OAAO,MAAM,IAAI,UAAU,MAAM;GAAE;GAAO;GAC9D,CACD,QAAQ,WAAiC,WAAW,KAAK;AAC5D,QAAO,CAAC,GAAG,QAAQ,GAAG,OAAO;;;;;;AAO/B,SAAgB,iBAAiB,KAAgD;CAC/E,MAAM,SAAuB,EAAE;AAC/B,MAAK,MAAM,OAAO,yBAAyB;EACzC,MAAM,QAAQ,cAAc;AAC5B,OAAK,MAAM,QAAQ,SAAS,WAAW,KAAK,IAAI,EAAE,UAAU,CAC1D,QAAO,KAAK;GAAE,OAAO,GAAG,MAAM,GAAG;GAAQ,OAAO,GAAG,IAAI,GAAG;GAAQ,CAAC;;AAGvE,MAAK,MAAM,OAAO,YAAY,IAAI,EAAE;EAClC,MAAM,MAAM,IAAI,KAAK,MAAM;AAC3B,MAAI,CAAC,IAAK;EACV,MAAM,QAAQ,IAAI,OAAO,MAAM,IAAI,UAAU,IAAI;AACjD,OAAK,MAAM,QAAQ,SAAS,KAAK,IAAI,OAAO,UAAU,CACpD,QAAO,KAAK;GAAE,OAAO,GAAG,MAAM,GAAG;GAAQ,OAAO,GAAG,IAAI,GAAG;GAAQ,CAAC;;AAGvE,QAAO"}
1
+ {"version":3,"file":"looks-BbL309kO.mjs","names":[],"sources":["../src/theme/map.ts","../src/theme/types.ts","../src/theme/looks.ts"],"sourcesContent":["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 * Required, no default. Pass `canManageBrand` as `update` (and typically\n * `isAuthenticated` as `read`). Theme does not read the Roles 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` (`#ef4444`).\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 { includedShadeSteps, type ShadeStep } from \"@bison-lab/tokens\";\n\nimport { stateFromColorDoc } from \"./map\";\nimport { THEME_SLUG, type ThemeColorDoc, type ThemeDoc, type ThemeLibraryColorDoc } from \"./types\";\n\n/**\n * System colors Color Settings offers as page-editor fills. Success and\n * Destructive stay off this list — they are theme chrome only.\n */\nexport const PAGE_EDITOR_SYSTEM_KEYS = [\"primary\", \"secondary\", \"accent\", \"highlight\"] as const;\n\nexport type PageEditorSystemKey = (typeof PAGE_EDITOR_SYSTEM_KEYS)[number];\n\nexport interface LookOption {\n label: string;\n value: string;\n}\n\nconst SYSTEM_LABELS: Record<PageEditorSystemKey, string> = {\n primary: \"Primary\",\n secondary: \"Secondary\",\n accent: \"Accent\",\n highlight: \"Highlight\",\n};\n\nfunction brandColor(doc: ThemeDoc | null | undefined, key: PageEditorSystemKey): ThemeColorDoc | null {\n const brand = doc?.colors?.brand ?? doc?.brand;\n const value = brand?.[key];\n if (typeof value === \"string\" || value == null) return value == null ? null : { hex: value };\n return value;\n}\n\nexport function themeLibraryFromDoc(doc: ThemeDoc | null | undefined): ThemeLibraryColorDoc[] {\n return Array.isArray(doc?.colors?.library) ? doc.colors.library : [];\n}\n\nfunction libraryRows(doc: ThemeDoc | null | undefined): ThemeLibraryColorDoc[] {\n return themeLibraryFromDoc(doc);\n}\n\nfunction titleCase(key: string): string {\n return key.charAt(0).toUpperCase() + key.slice(1);\n}\n\nfunction stepsFor(color: ThemeColorDoc | null | undefined, fallbackHex: string): ShadeStep[] {\n return includedShadeSteps(stateFromColorDoc(color, fallbackHex));\n}\n\n/**\n * Family keys a `lookField()` may offer: the page-editor system scales\n * plus every custom color on Colors. Adding Coral on Theme makes `coral`\n * appear here with no `@bison-lab/*` release.\n */\nexport function pageEditorLooks(doc: ThemeDoc | null | undefined): LookOption[] {\n const system = PAGE_EDITOR_SYSTEM_KEYS.map((value) => ({\n label: SYSTEM_LABELS[value],\n value,\n }));\n const custom = libraryRows(doc)\n .map((row) => {\n const value = row.key?.trim();\n if (!value) return null;\n return { label: row.label?.trim() || titleCase(value), value };\n })\n .filter((option): option is LookOption => option !== null);\n return [...system, ...custom];\n}\n\n/**\n * Included steps as `coral-400`. Excluded steps do not appear. System\n * scales with no stored include list offer the full 50–950 ramp.\n */\nexport function pageEditorTokens(doc: ThemeDoc | null | undefined): LookOption[] {\n const tokens: LookOption[] = [];\n for (const key of PAGE_EDITOR_SYSTEM_KEYS) {\n const label = SYSTEM_LABELS[key];\n for (const step of stepsFor(brandColor(doc, key), \"#000000\")) {\n tokens.push({ label: `${label} ${step}`, value: `${key}-${step}` });\n }\n }\n for (const row of libraryRows(doc)) {\n const key = row.key?.trim();\n if (!key) continue;\n const label = row.label?.trim() || titleCase(key);\n for (const step of stepsFor(row, row.hex ?? \"#000000\")) {\n tokens.push({ label: `${label} ${step}`, value: `${key}-${step}` });\n }\n }\n return tokens;\n}\n\nexport async function themeDocFromRequest(req: {\n payload?: {\n findGlobal?: (args: {\n slug: string;\n depth?: number;\n overrideAccess?: boolean;\n }) => Promise<ThemeDoc | null | undefined>;\n };\n}): Promise<ThemeDoc | null> {\n try {\n const doc = await req.payload?.findGlobal?.({\n slug: THEME_SLUG,\n depth: 0,\n overrideAccess: true,\n });\n return doc ?? null;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;AAgBA,SAAS,KAAQ,OAA6B,UAAgB;AAC5D,QAAO,SAAS,OAAO,WAAW;;AAGpC,SAAS,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AC,GAAG,QAAQ,GAAG,OAAO;;;;;;AAO/B,SAAgB,iBAAiB,KAAgD;CAC/E,MAAM,SAAuB,EAAE;AAC/B,MAAK,MAAM,OAAO,yBAAyB;EACzC,MAAM,QAAQ,cAAc;AAC5B,OAAK,MAAM,QAAQ,SAAS,WAAW,KAAK,IAAI,EAAE,UAAU,CAC1D,QAAO,KAAK;GAAE,OAAO,GAAG,MAAM,GAAG;GAAQ,OAAO,GAAG,IAAI,GAAG;GAAQ,CAAC;;AAGvE,MAAK,MAAM,OAAO,YAAY,IAAI,EAAE;EAClC,MAAM,MAAM,IAAI,KAAK,MAAM;AAC3B,MAAI,CAAC,IAAK;EACV,MAAM,QAAQ,IAAI,OAAO,MAAM,IAAI,UAAU,IAAI;AACjD,OAAK,MAAM,QAAQ,SAAS,KAAK,IAAI,OAAO,UAAU,CACpD,QAAO,KAAK;GAAE,OAAO,GAAG,MAAM,GAAG;GAAQ,OAAO,GAAG,IAAI,GAAG;GAAQ,CAAC;;AAGvE,QAAO"}
@@ -2,6 +2,76 @@ import { FontEntry } from "@bison-lab/fonts";
2
2
  import { ColorScale, ColorScaleInclude, ShadeStep, ThemeConfig } from "@bison-lab/tokens";
3
3
  import { Access, StaticLabel, TextField, TextFieldSingleValidation } from "payload";
4
4
 
5
+ //#region src/theme/color-usages.d.ts
6
+ interface ColorUsagesList {
7
+ collections?: string[];
8
+ globals?: string[];
9
+ }
10
+ /**
11
+ * `true` scans every registered collection and global at request time
12
+ * (Payload internals and Theme itself are skipped). A list still names
13
+ * slugs. Omit or pass empty: every additional color is unused.
14
+ */
15
+ type ColorUsagesOption = true | ColorUsagesList;
16
+ interface ColorUsage {
17
+ collection?: string;
18
+ global?: string;
19
+ id?: string | number;
20
+ path: string;
21
+ token: string;
22
+ }
23
+ type FindResult = {
24
+ docs: Record<string, unknown>[];
25
+ totalPages?: number;
26
+ page?: number;
27
+ };
28
+ type Slugged = {
29
+ slug?: string;
30
+ };
31
+ interface ColorUsagePayload {
32
+ find: (args: {
33
+ collection: string;
34
+ draft?: boolean;
35
+ depth?: number;
36
+ limit?: number;
37
+ page?: number;
38
+ overrideAccess?: boolean;
39
+ }) => Promise<FindResult>;
40
+ findGlobal: (args: {
41
+ slug: string;
42
+ draft?: boolean;
43
+ depth?: number;
44
+ overrideAccess?: boolean;
45
+ }) => Promise<Record<string, unknown> | ThemeDoc | null | undefined>;
46
+ update: (args: {
47
+ collection: string;
48
+ id: string | number;
49
+ data: Record<string, unknown>;
50
+ draft?: boolean;
51
+ overrideAccess?: boolean;
52
+ }) => Promise<unknown>;
53
+ updateGlobal: (args: {
54
+ slug: string;
55
+ data: Record<string, unknown>;
56
+ draft?: boolean;
57
+ overrideAccess?: boolean;
58
+ }) => Promise<unknown>;
59
+ collections?: Record<string, unknown>;
60
+ globals?: {
61
+ config?: Slugged[];
62
+ };
63
+ config?: {
64
+ collections?: Slugged[];
65
+ globals?: Slugged[];
66
+ };
67
+ }
68
+ /**
69
+ * Walk every current document in the resolved collections and globals
70
+ * (drafts included). A color only on an unpublished page is still in use.
71
+ */
72
+ declare function findColorUsages(payload: ColorUsagePayload, scopes: ColorUsagesOption | undefined, key: string): Promise<ColorUsage[]>;
73
+ declare function rewriteColorUsages(payload: ColorUsagePayload, scopes: ColorUsagesOption | undefined, fromKey: string, toKey: string): Promise<void>;
74
+ //#endregion
5
75
  //#region src/theme/identity.d.ts
6
76
  interface ThemeIdentityAsset {
7
77
  url: string;
@@ -151,16 +221,14 @@ interface CreateThemeOptions {
151
221
  /** Fires from `afterChange` on every save — Theme has no draft mode. */
152
222
  onPublish?: (theme: ThemeConfig, doc: ThemeDoc) => void | Promise<void>;
153
223
  /**
154
- * Slugs that store `lookField` / `colorTokenField` values. Colors
155
- * Delete scans these (drafts included) before dropping a custom row.
156
- * Omit or pass empty: every additional color is unused and deletes
157
- * immediately. A new look surface is added here, not copied into a
158
- * site helper site adopt names the slugs (SPI-93).
224
+ * Where Colors Delete looks for `lookField` / `colorTokenField` tokens
225
+ * (drafts included). `true` scans every registered collection and
226
+ * global at request time Payload internals and Theme itself are
227
+ * skipped, so a later Navigation or Territories global joins without
228
+ * a site change. A list still names slugs. Omit or pass empty: every
229
+ * additional color is unused and deletes immediately.
159
230
  */
160
- colorUsages?: {
161
- collections?: string[];
162
- globals?: string[];
163
- };
231
+ colorUsages?: ColorUsagesOption;
164
232
  }
165
233
  interface ThemeHeadOptions {
166
234
  fontsBaseUrl?: string;
@@ -257,5 +325,5 @@ declare function pageEditorLooks(doc: ThemeDoc | null | undefined): LookOption[]
257
325
  */
258
326
  declare function pageEditorTokens(doc: ThemeDoc | null | undefined): LookOption[];
259
327
  //#endregion
260
- export { ThemeLibraryColorDoc as A, THEME_IDENTITY_SLUG as C, ThemeDoc as D, ThemeColorDoc as E, ResolvedThemeIdentity as M, ThemeIdentityFallback as N, ThemeHead as O, resolveThemeIdentity as P, THEME_COLORS_SLUG as S, THEME_TYPOGRAPHY_SLUG as T, CreateThemeOptions as _, pageEditorTokens as a, SystemColorKey as b, LookFieldOptions as c, ColorTokenHit as d, findColorTokens as f, themeColorKeys as g, rewriteColorToken as h, pageEditorLooks as i, ThemeUploadDoc as j, ThemeHeadOptions as k, colorTokenField as l, deleteLibraryColor as m, PAGE_EDITOR_SYSTEM_KEYS as n, themeLibraryFromDoc as o, rewriteColorTokens as p, PageEditorSystemKey as r, LookFieldMode as s, LookOption as t, lookField as u, EditableTheme as v, THEME_SLUG as w, THEME_APPEARANCE_SLUG as x, SYSTEM_COLOR_KEYS as y };
261
- //# sourceMappingURL=looks-Xs6v5vYU.d.mts.map
328
+ export { ThemeLibraryColorDoc as A, THEME_IDENTITY_SLUG as C, ThemeDoc as D, ThemeColorDoc as E, ColorUsage as F, ColorUsagesList as I, ColorUsagesOption as L, ResolvedThemeIdentity as M, ThemeIdentityFallback as N, ThemeHead as O, resolveThemeIdentity as P, findColorUsages as R, THEME_COLORS_SLUG as S, THEME_TYPOGRAPHY_SLUG as T, CreateThemeOptions as _, pageEditorTokens as a, SystemColorKey as b, LookFieldOptions as c, ColorTokenHit as d, findColorTokens as f, themeColorKeys as g, rewriteColorToken as h, pageEditorLooks as i, ThemeUploadDoc as j, ThemeHeadOptions as k, colorTokenField as l, deleteLibraryColor as m, PAGE_EDITOR_SYSTEM_KEYS as n, themeLibraryFromDoc as o, rewriteColorTokens as p, PageEditorSystemKey as r, LookFieldMode as s, LookOption as t, lookField as u, EditableTheme as v, THEME_SLUG as w, THEME_APPEARANCE_SLUG as x, SYSTEM_COLOR_KEYS as y, rewriteColorUsages as z };
329
+ //# sourceMappingURL=looks-Dk0l0mif.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"looks-Dk0l0mif.d.mts","names":[],"sources":["../src/theme/color-usages.ts","../src/theme/identity.ts","../src/theme/types.ts","../src/theme/library.ts","../src/theme/color-tokens.ts","../src/theme/look-field.ts","../src/theme/looks.ts"],"mappings":";;;;;UAOiB,eAAA;EACf,WAAA;EACA,OAAA;AAAA;;;;AAQF;;KAAY,iBAAA,UAA2B,eAAA;AAAA,UAEtB,UAAA;EACf,UAAA;EACA,MAAA;EACA,EAAA;EACA,IAAA;EACA,KAAA;AAAA;AAAA,KAGG,UAAA;EAAe,IAAA,EAAM,MAAA;EAA2B,UAAA;EAAqB,IAAA;AAAA;AAAA,KAErE,OAAA;EAAY,IAAA;AAAA;AAAA,UAEA,iBAAA;EACf,IAAA,GAAO,IAAA;IACL,UAAA;IACA,KAAA;IACA,KAAA;IACA,KAAA;IACA,IAAA;IACA,cAAA;EAAA,MACI,OAAA,CAAQ,UAAA;EACd,UAAA,GAAa,IAAA;IACX,IAAA;IACA,KAAA;IACA,KAAA;IACA,cAAA;EAAA,MACI,OAAA,CAAQ,MAAA,oBAA0B,QAAA;EACxC,MAAA,GAAS,IAAA;IACP,UAAA;IACA,EAAA;IACA,IAAA,EAAM,MAAA;IACN,KAAA;IACA,cAAA;EAAA,MACI,OAAA;EACN,YAAA,GAAe,IAAA;IACb,IAAA;IACA,IAAA,EAA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K,QAAA,sBAA8B,UAAA"}
@@ -1,4 +1,4 @@
1
- import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-sWwcCqHT.mjs";
1
+ import { a as SeoImageSize, i as SeoImageDoc, n as titleTemplate, o as SeoImageValue, r as MediaId, s as SeoMeta, t as documentTitle } from "./title-B2-gWQZd.mjs";
2
2
 
3
3
  //#region src/seo/metadata.d.ts
4
4
  /** A page as the reader needs it; a site's generated `Page` is assignable. */
package/dist/metadata.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as documentTitle, r as titleTemplate, t as SHARE_IMAGE_SIZE } from "./share-image-BlFAJLnd.mjs";
1
+ import { n as documentTitle, r as titleTemplate, t as SHARE_IMAGE_SIZE } from "./share-image-C4ILz4p2.mjs";
2
2
  //#region src/seo/metadata.ts
3
3
  /**
4
4
  * The share image as a crawler wants it, or `undefined` when the page has
@@ -34,4 +34,4 @@ const SHARE_IMAGE_SIZE = {
34
34
  //#endregion
35
35
  export { documentTitle as n, titleTemplate as r, SHARE_IMAGE_SIZE as t };
36
36
 
37
- //# sourceMappingURL=share-image-BlFAJLnd.mjs.map
37
+ //# sourceMappingURL=share-image-C4ILz4p2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"share-image-BlFAJLnd.mjs","names":[],"sources":["../src/seo/title.ts","../src/seo/share-image.ts"],"sourcesContent":["/**\n * A document title from a page title: the one place the `| Site Name` suffix\n * is spelled. The frontend layout's title template, the admin's Generate\n * button and a CMS page's Open Graph title are all built from it, since Next\n * applies a title template to `<title>` alone.\n */\nexport function documentTitle(siteName: string, pageTitle: string): string {\n return `${pageTitle} | ${siteName}`;\n}\n\n/**\n * The same format as Next's `title.template` wants it, for the root layout:\n * `%s` is Next's placeholder for the page's own title.\n */\nexport function titleTemplate(siteName: string): string {\n return documentTitle(siteName, \"%s\");\n}\n","import type { ImageSize } from \"payload\";\n\n/**\n * The rendition a media collection cuts for social share cards: 1.91:1 at the\n * size Open Graph consumers ask for, cropped to shape rather than letterboxed\n * so a portrait upload still fills the card. Add it to the upload\n * collection's `imageSizes`; `pageMetadata` reads `sizes.share` off a page's\n * meta image and falls back to the original for a file uploaded before the\n * size existed, or one too small to cut (Payload does not upscale).\n */\nexport const SHARE_IMAGE_SIZE = {\n name: \"share\",\n width: 1200,\n height: 630,\n position: \"centre\",\n} satisfies ImageSize;\n"],"mappings":";;;;;;;AAMA,SAAgB,cAAc,UAAkB,WAA2B;AACzE,QAAO,GAAG,UAAU,KAAK;;;;;;AAO3B,SAAgB,cAAc,UAA0B;AACtD,QAAO,cAAc,UAAU,KAAK;;;;;;;;;;;;ACLtC,MAAa,mBAAmB;CAC9B,MAAM;CACN,OAAO;CACP,QAAQ;CACR,UAAU;CACX"}
1
+ {"version":3,"file":"share-image-C4ILz4p2.mjs","names":[],"sources":["../src/seo/title.ts","../src/seo/share-image.ts"],"sourcesContent":["/**\n * A document title from a page title: the one place the `| Site Name` suffix\n * is spelled. The frontend layout's title template, the admin's Generate\n * button and a CMS page's Open Graph title are all built from it, since Next\n * applies a title template to `<title>` alone.\n */\nexport function documentTitle(siteName: string, pageTitle: string): string {\n return `${pageTitle} | ${siteName}`;\n}\n\n/**\n * The same format as Next's `title.template` wants it, for the root layout:\n * `%s` is Next's placeholder for the page's own title.\n */\nexport function titleTemplate(siteName: string): string {\n return documentTitle(siteName, \"%s\");\n}\n","import type { ImageSize } from \"payload\";\n\n/**\n * The rendition a media collection cuts for social share cards: 1.91:1 at the\n * size Open Graph consumers ask for, cropped to shape rather than letterboxed\n * so a portrait upload still fills the card. Add it to the upload\n * collection's `imageSizes`; `pageMetadata` reads `sizes.share` off a page's\n * meta image and falls back to the original for a file uploaded before the\n * size existed, or one too small to cut (Payload does not upscale).\n */\nexport const SHARE_IMAGE_SIZE = {\n name: \"share\",\n width: 1200,\n height: 630,\n position: \"centre\",\n} satisfies ImageSize;\n"],"mappings":";;;;;;;AAMA,SAAgB,cAAc,UAAkB,WAA2B;AACzE,QAAO,GAAG,UAAU,KAAK;;;;;;AAO3B,SAAgB,cAAc,UAA0B;AACtD,QAAO,cAAc,UAAU,KAAK;;;;;;;;;;;;ACLtC,MAAa,mBAAmB;CAC9B,MAAM;CACN,OAAO;CACP,QAAQ;CACR,UAAU;CACX"}
package/dist/theme.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as ThemeLibraryColorDoc, D as ThemeDoc, E as ThemeColorDoc, M as ResolvedThemeIdentity, N as ThemeIdentityFallback, O as ThemeHead, P as resolveThemeIdentity, _ as CreateThemeOptions, a as pageEditorTokens, b as SystemColorKey, d as ColorTokenHit, f as findColorTokens, g as themeColorKeys, h as rewriteColorToken, i as pageEditorLooks, j as ThemeUploadDoc, k as ThemeHeadOptions, l as colorTokenField, m as deleteLibraryColor, n as PAGE_EDITOR_SYSTEM_KEYS, o as themeLibraryFromDoc, p as rewriteColorTokens, r as PageEditorSystemKey, t as LookOption, u as lookField, v as EditableTheme, w as THEME_SLUG, y as SYSTEM_COLOR_KEYS } from "./looks-Xs6v5vYU.mjs";
1
+ import { A as ThemeLibraryColorDoc, D as ThemeDoc, E as ThemeColorDoc, M as ResolvedThemeIdentity, N as ThemeIdentityFallback, O as ThemeHead, P as resolveThemeIdentity, _ as CreateThemeOptions, a as pageEditorTokens, b as SystemColorKey, d as ColorTokenHit, f as findColorTokens, g as themeColorKeys, h as rewriteColorToken, i as pageEditorLooks, j as ThemeUploadDoc, k as ThemeHeadOptions, l as colorTokenField, m as deleteLibraryColor, n as PAGE_EDITOR_SYSTEM_KEYS, o as themeLibraryFromDoc, p as rewriteColorTokens, r as PageEditorSystemKey, t as LookOption, u as lookField, v as EditableTheme, w as THEME_SLUG, y as SYSTEM_COLOR_KEYS } from "./looks-Dk0l0mif.mjs";
2
2
  import { ShadeStep, ThemeConfig } from "@bison-lab/tokens";
3
3
 
4
4
  //#region src/theme/published.d.ts
package/dist/theme.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as THEME_SLUG, a as pageEditorLooks, b as stateFromColorDoc, c as findColorTokens, d as rewriteColorToken, f as themeColorKeys, i as PAGE_EDITOR_SYSTEM_KEYS, l as rewriteColorTokens, n as colorTokenField, o as pageEditorTokens, p as SYSTEM_COLOR_KEYS, r as lookField, s as themeLibraryFromDoc, t as resolveThemeIdentity, u as deleteLibraryColor, x as themeConfigFromDoc } from "./identity-Dwyq8519.mjs";
1
+ import { _ as THEME_SLUG, a as pageEditorLooks, b as stateFromColorDoc, c as findColorTokens, d as rewriteColorToken, f as themeColorKeys, i as PAGE_EDITOR_SYSTEM_KEYS, l as rewriteColorTokens, n as colorTokenField, o as pageEditorTokens, p as SYSTEM_COLOR_KEYS, r as lookField, s as themeLibraryFromDoc, t as resolveThemeIdentity, u as deleteLibraryColor, x as themeConfigFromDoc } from "./identity-LAzSeorC.mjs";
2
2
  import { fontFaceCss, fontPreloads } from "@bison-lab/fonts";
3
3
  import { buildThemeCss, generateNamedScaleCSS, lookBindingCss, themeFontIds } from "@bison-lab/tokens";
4
4
  //#region src/theme/published.ts
@@ -52,4 +52,4 @@ declare function documentTitle(siteName: string, pageTitle: string): string;
52
52
  declare function titleTemplate(siteName: string): string;
53
53
  //#endregion
54
54
  export { SeoImageSize as a, SeoImageDoc as i, titleTemplate as n, SeoImageValue as o, MediaId as r, SeoMeta as s, documentTitle as t };
55
- //# sourceMappingURL=title-sWwcCqHT.d.mts.map
55
+ //# sourceMappingURL=title-B2-gWQZd.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"title-sWwcCqHT.d.mts","names":[],"sources":["../src/seo/types.ts","../src/seo/title.ts"],"mappings":";;KACY,OAAA;;UAGK,YAAA;EACf,GAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;;;AAWF;UAAiB,WAAA;EACf,GAAA;EACA,GAAA;EACA,KAAA;EACA,MAAA;EACA,KAAA;IAAA,CAAW,IAAA,WAAe,YAAA;EAAA;AAAA;;KAIhB,aAAA,GAAgB,OAAA,GAAU,WAAA;;AAAtC;;;UAMiB,OAAA;EACf,KAAA;EACA,WAAA;EACA,KAAA,GAAQ,aAAA;EACR,OAAA;AAAA;;;;AApCF;;;;;iBCKgB,aAAA,CAAc,QAAA,UAAkB,SAAA;;;;;iBAQhC,aAAA,CAAc,QAAA"}
1
+ {"version":3,"file":"title-B2-gWQZd.d.mts","names":[],"sources":["../src/seo/types.ts","../src/seo/title.ts"],"mappings":";;KACY,OAAA;;UAGK,YAAA;EACf,GAAA;EACA,KAAA;EACA,MAAA;AAAA;;;;;;;;AAWF;UAAiB,WAAA;EACf,GAAA;EACA,GAAA;EACA,KAAA;EACA,MAAA;EACA,KAAA;IAAA,CAAW,IAAA,WAAe,YAAA;EAAA;AAAA;;KAIhB,aAAA,GAAgB,OAAA,GAAU,WAAA;;AAAtC;;;UAMiB,OAAA;EACf,KAAA;EACA,WAAA;EACA,KAAA,GAAQ,aAAA;EACR,OAAA;AAAA;;;;AApCF;;;;;iBCKgB,aAAA,CAAc,QAAA,UAAkB,SAAA;;;;;iBAQhC,aAAA,CAAc,QAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bison-lab/payload-core",
3
- "version": "3.14.0",
3
+ "version": "3.16.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": {
@@ -85,8 +85,8 @@
85
85
  "typescript": "^5.9.3",
86
86
  "vitest": "^4.1.2",
87
87
  "@bison-lab/fonts": "3.6.0",
88
- "@bison-lab/ui": "3.11.0",
89
- "@bison-lab/tokens": "3.11.0"
88
+ "@bison-lab/tokens": "3.11.0",
89
+ "@bison-lab/ui": "3.11.0"
90
90
  },
91
91
  "publishConfig": {
92
92
  "access": "public"