@bison-lab/payload-core 4.37.0 → 4.39.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.
Files changed (45) hide show
  1. package/README.md +40 -3
  2. package/dist/admin.d.mts +19 -1
  3. package/dist/admin.d.mts.map +1 -1
  4. package/dist/admin.mjs +92 -17
  5. package/dist/admin.mjs.map +1 -1
  6. package/dist/block-library.d.mts +1 -1
  7. package/dist/{catalogue-PvKGCih7.d.mts → catalogue-FxH10X3v.d.mts} +1 -1
  8. package/dist/{catalogue-PvKGCih7.d.mts.map → catalogue-FxH10X3v.d.mts.map} +1 -1
  9. package/dist/{facet-field-CZbLDAQz.d.mts → facet-field-DjaZ0C7D.d.mts} +1 -1
  10. package/dist/{facet-field-CZbLDAQz.d.mts.map → facet-field-DjaZ0C7D.d.mts.map} +1 -1
  11. package/dist/index.d.mts +6 -6
  12. package/dist/index.mjs +1 -1
  13. package/dist/{locale-CxFNy8ex.d.mts → locale-CWiIcGuU.d.mts} +1 -1
  14. package/dist/locale-CWiIcGuU.d.mts.map +1 -0
  15. package/dist/messages-Fl1spIwN.mjs +229 -0
  16. package/dist/messages-Fl1spIwN.mjs.map +1 -0
  17. package/dist/metadata.d.mts +1 -1
  18. package/dist/navigation.d.mts +2 -2
  19. package/dist/navigation.mjs +1 -1
  20. package/dist/og.d.mts +2 -2
  21. package/dist/{preview-v-GlYuqa.d.mts → preview-CNBVfmM7.d.mts} +2 -2
  22. package/dist/{preview-v-GlYuqa.d.mts.map → preview-CNBVfmM7.d.mts.map} +1 -1
  23. package/dist/{published-DACERo16.mjs → published-D3yVnbxs.mjs} +6 -4
  24. package/dist/published-D3yVnbxs.mjs.map +1 -0
  25. package/dist/{published-B3IYStMQ.d.mts → published-DXjnElZn.d.mts} +4 -4
  26. package/dist/published-DXjnElZn.d.mts.map +1 -0
  27. package/dist/{published-Cow49CSZ.d.mts → published-_1rrTj_B.d.mts} +3 -3
  28. package/dist/{published-Cow49CSZ.d.mts.map → published-_1rrTj_B.d.mts.map} +1 -1
  29. package/dist/taxonomy.d.mts +1 -1
  30. package/dist/theme.d.mts +4 -4
  31. package/dist/{title-DFKu53nG.d.mts → title-D_jixG36.d.mts} +1 -1
  32. package/dist/{title-DFKu53nG.d.mts.map → title-D_jixG36.d.mts.map} +1 -1
  33. package/dist/translate-messages-cli.d.mts +1 -0
  34. package/dist/translate-messages-cli.mjs +151 -0
  35. package/dist/translate-messages-cli.mjs.map +1 -0
  36. package/dist/translate.d.mts +463 -0
  37. package/dist/translate.d.mts.map +1 -0
  38. package/dist/translate.mjs +1071 -0
  39. package/dist/translate.mjs.map +1 -0
  40. package/dist/{types-B7Hy1Ho-.d.mts → types-Db6Iy3hJ.d.mts} +1 -1
  41. package/dist/{types-B7Hy1Ho-.d.mts.map → types-Db6Iy3hJ.d.mts.map} +1 -1
  42. package/package.json +15 -5
  43. package/dist/locale-CxFNy8ex.d.mts.map +0 -1
  44. package/dist/published-B3IYStMQ.d.mts.map +0 -1
  45. package/dist/published-DACERo16.mjs.map +0 -1
@@ -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-PvKGCih7.mjs";
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-FxH10X3v.mjs";
2
2
 
3
3
  //#region src/block-library/island.d.ts
4
4
  /**
@@ -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-PvKGCih7.d.mts.map
214
+ //# sourceMappingURL=catalogue-FxH10X3v.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalogue-PvKGCih7.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
+ {"version":3,"file":"catalogue-FxH10X3v.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;;;;;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A,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"}
@@ -25,4 +25,4 @@ interface FacetEntry {
25
25
  declare function facetField(entry: FacetEntry): RelationshipField;
26
26
  //#endregion
27
27
  export { facetField as n, FacetEntry as t };
28
- //# sourceMappingURL=facet-field-CZbLDAQz.d.mts.map
28
+ //# sourceMappingURL=facet-field-DjaZ0C7D.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"facet-field-CZbLDAQz.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
+ {"version":3,"file":"facet-field-DjaZ0C7D.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"}
package/dist/index.d.mts CHANGED
@@ -1,9 +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-PvKGCih7.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-DFKu53nG.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-B7Hy1Ho-.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-v-GlYuqa.mjs";
5
- import { n as facetField, t as FacetEntry } from "./facet-field-CZbLDAQz.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-B3IYStMQ.mjs";
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-FxH10X3v.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-D_jixG36.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-Db6Iy3hJ.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-CNBVfmM7.mjs";
5
+ import { n as facetField, t as FacetEntry } from "./facet-field-DjaZ0C7D.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-DXjnElZn.mjs";
7
7
  import { ThemeConfig } from "@bison-lab/tokens";
8
8
  import * as payload$1 from "payload";
9
9
  import { Access, Block, CheckboxField, CollectionAfterChangeHook, CollectionBeforeChangeHook, CollectionBeforeValidateHook, CollectionConfig, CollectionSlug, Config, Endpoint, Field, GlobalConfig, ImageSize, Payload, PayloadRequest, Plugin, UploadCollectionSlug } from "payload";
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { t as SHARE_IMAGE_SIZE } from "./share-image-C8ZtIcU8.mjs";
3
3
  import { C as THEME_PAIRING_FIELD, D as headingSelectValue, E as THEME_SECTION_HEADING, S as THEME_LIBRARY_FIELD, T as THEME_SAVE_BUTTON, _ as THEME_CONTRAST_REPORT, a as THEME_IDENTITY_SLUG, b as THEME_GREY_SCALE_FIELD, c as docFromConfig, d as validateSourceIncluded, f as validateThemeHex, g as THEME_COLOR_SCALE_FIELD, h as THEME_COLOR_FIELD, i as THEME_COLORS_SLUG, m as THEME_APPEARANCE_FIELD, n as SYSTEM_COLOR_KEYS, o as THEME_SLUG, p as LOOK_FIELD, r as THEME_APPEARANCE_SLUG, s as THEME_TYPOGRAPHY_SLUG, t as resolveThemeIdentity, u as themeConfigFromDoc, v as THEME_DOCUMENT_CONTROLS, w as THEME_PUBLISH_FIELD, x as THEME_IDENTITY_FALLBACK, y as THEME_FONT_FIELD } from "./identity-CN6EOeDM.mjs";
4
4
  import { a as pageEditorLooks, c as themeLibraryFromDoc, d as deleteLibraryColor, f as rewriteColorToken, i as PAGE_EDITOR_SYSTEM_KEYS, l as findColorTokens, n as colorTokenField, o as pageEditorSwatches, p as themeColorKeys, r as lookField, s as pageEditorTokens, t as THEME_PREVIEW_BREAKPOINTS, u as rewriteColorTokens } from "./preview-Br1SQCKn.mjs";
5
5
  import { _ as sectionControlsOf, a as sectionControlsFromLibrary, c as BLOCK_LIBRARY_CATEGORIES, 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";
6
- import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, b as NAVIGATION_FEATURE, c as footerDesktopTracks, d as validateFooterColumns, f as validateFooterSocialUrl, g as linkField, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as footerFields, m as headerCtaEnabled, n as FOOTER_COLUMNS_FIELD, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-DACERo16.mjs";
6
+ import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, b as NAVIGATION_FEATURE, c as footerDesktopTracks, d as validateFooterColumns, f as validateFooterSocialUrl, g as linkField, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as footerFields, m as headerCtaEnabled, n as FOOTER_COLUMNS_FIELD, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-D3yVnbxs.mjs";
7
7
  import { a as REQUIRED_PAGE_UNPUBLISH_MESSAGE, c as isRequiredPageKey, i as REQUIRED_PAGE_FIELD, l as isRootPageKey, n as REQUIRED_PAGE_CELL, o as ROOT_PAGE_KEY, r as REQUIRED_PAGE_DELETE_MESSAGE, s as ROOT_PAGE_SLUG, t as PAGE_SLUG_CELL, u as requiredPageKeys } from "./root-page-key-B86JwL8Z.mjs";
8
8
  import { t as facetField } from "./facet-field-Uf8S4yL1.mjs";
9
9
  import { l as thumbnailVersion } from "./block-thumbnails-DXOUzGjY.mjs";
@@ -12,4 +12,4 @@ interface LocaleRead {
12
12
  }
13
13
  //#endregion
14
14
  export { LocaleRead as t };
15
- //# sourceMappingURL=locale-CxFNy8ex.d.mts.map
15
+ //# sourceMappingURL=locale-CWiIcGuU.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-CWiIcGuU.d.mts","names":[],"sources":["../src/locale.ts"],"mappings":";;AAOA;;;;;;UAAiB,UAAA;EACf,MAAA;EACA,cAAA;AAAA"}
@@ -0,0 +1,229 @@
1
+ //#region src/translate/strings.ts
2
+ /**
3
+ * Translates `strings` with `translator` in one batch, preserving order.
4
+ * Repeated strings are sent once. Returns `null` when the translator throws,
5
+ * returns `null`, or returns anything but one string per string sent, so a
6
+ * caller can leave the target as it was. Never throws.
7
+ */
8
+ async function translateStrings(strings, options) {
9
+ if (strings.length === 0) return [];
10
+ const { translator, ...request } = options;
11
+ const unique = [...new Set(strings)];
12
+ let result;
13
+ try {
14
+ result = await translator(unique, request);
15
+ } catch {
16
+ return null;
17
+ }
18
+ if (!Array.isArray(result) || result.length !== unique.length) return null;
19
+ if (!result.every((value) => typeof value === "string")) return null;
20
+ const byString = new Map(unique.map((value, index) => [value, result[index]]));
21
+ return strings.map((value) => byString.get(value) ?? value);
22
+ }
23
+ /** True unless the translator says it cannot run (an Anthropic translator with no API key). */
24
+ function isTranslatorConfigured(translator) {
25
+ return translator !== void 0 && translator.configured !== false;
26
+ }
27
+ //#endregion
28
+ //#region src/translate/anthropic.ts
29
+ /**
30
+ * The library's default model. Translating marketing copy does not need the
31
+ * most capable model; a current Sonnet handles it well at a fraction of the
32
+ * price. A site overrides it per environment (`ANTHROPIC_TRANSLATE_MODEL`).
33
+ */
34
+ const DEFAULT_TRANSLATE_MODEL = "claude-sonnet-5-5";
35
+ /**
36
+ * The SDK's defaults are a 10-minute timeout with retries. A translation
37
+ * must stay bounded to seconds, not minutes: the manual endpoint awaits it
38
+ * while an editor waits, and a deferred run must finish inside the host's
39
+ * `waitUntil` window. One retry, 90s cap, then the target stays as it was.
40
+ */
41
+ const TIMEOUT_MS = 9e4;
42
+ const MAX_RETRIES = 1;
43
+ function languageName(code, site) {
44
+ const named = site?.languages?.[code];
45
+ if (named) return named;
46
+ try {
47
+ return new Intl.DisplayNames(["en"], { type: "language" }).of(code) ?? code;
48
+ } catch {
49
+ return code;
50
+ }
51
+ }
52
+ /**
53
+ * The system prompt: the library's generic rules plus the site's own facts.
54
+ * Exported so a site can read exactly what the model is told.
55
+ */
56
+ function translationSystemPrompt(request) {
57
+ const { site } = request;
58
+ const from = languageName(request.from, site);
59
+ const to = languageName(request.to, site);
60
+ const who = site?.name ? `You are a professional translator for ${site.name}${site.about ? `, ${site.about}` : ""}.` : "You are a professional translator for a business website.";
61
+ const voice = site?.voice ? ` Keep the ${site.voice} brand voice.` : " Keep the brand voice.";
62
+ const verbatim = [site?.name, ...site?.keepVerbatim ?? []].filter((value, index, all) => Boolean(value) && all.indexOf(value) === index);
63
+ return `${who} Translate website and UI copy from ${from} into clear, natural ${to}.${voice}
64
+
65
+ Hard rules:
66
+ - You receive a JSON array of strings. Return ONLY a JSON array of the translated strings, in the SAME ORDER and SAME LENGTH. No prose, no markdown, no code fences.
67
+ ${verbatim.length ? `- Keep these EXACTLY as written, untranslated: ${verbatim.join(", ")}. Also keep URLs, email addresses and phone numbers as written.` : "- Keep URLs, email addresses and phone numbers exactly as written."}
68
+ - Preserve any ICU/message placeholders such as {year}, {count}, {name} verbatim, including the braces.
69
+ - Preserve any HTML tags (e.g. <em>...</em>, <strong>...</strong>) and their positions; translate only the text between them.
70
+ - For legal, regulatory or compliance copy, translate faithfully and literally. This output is a first-pass draft for a native speaker to review, not final compliance copy.
71
+ - If a string is empty or is only a placeholder/URL/number, return it unchanged.`;
72
+ }
73
+ /** Tolerant JSON-array parse: strips accidental ``` fences and prose around the array, and checks the shape. */
74
+ function parseJsonArray(text) {
75
+ let candidate = text.trim();
76
+ const fenced = candidate.match(/```(?:json)?\s*([\s\S]*?)```/);
77
+ if (fenced?.[1] !== void 0) candidate = fenced[1].trim();
78
+ const start = candidate.indexOf("[");
79
+ const end = candidate.lastIndexOf("]");
80
+ if (start !== -1 && end > start) candidate = candidate.slice(start, end + 1);
81
+ try {
82
+ const value = JSON.parse(candidate);
83
+ if (Array.isArray(value) && value.every((item) => typeof item === "string")) return value;
84
+ } catch {}
85
+ return null;
86
+ }
87
+ /**
88
+ * The provided `Translator`: one Anthropic Messages call per batch, the
89
+ * strings as a JSON array in and out. `@anthropic-ai/sdk` is an optional
90
+ * peer, loaded on the first call, so a site with translation off installs
91
+ * nothing. Every failure (no key, the SDK missing, a network error, a
92
+ * refusal, a malformed or wrong-length reply) returns `null` and is logged
93
+ * by the caller; it never throws.
94
+ */
95
+ function anthropicTranslator(options) {
96
+ const apiKey = options.apiKey || void 0;
97
+ const model = options.model?.trim() || "claude-sonnet-5-5";
98
+ let client = options.client;
99
+ const getClient = async () => {
100
+ if (client) return client;
101
+ if (!apiKey) return null;
102
+ client = new (await (import("@anthropic-ai/sdk"))).default({ apiKey });
103
+ return client;
104
+ };
105
+ const translate = async (strings, request) => {
106
+ if (strings.length === 0) return [];
107
+ try {
108
+ const anthropic = await getClient();
109
+ if (!anthropic) return null;
110
+ const site = request.site ?? options.site;
111
+ const to = languageName(request.to, site);
112
+ const content = (request.context ? `Context: ${request.context}\n\n` : "") + `Translate this JSON array of ${strings.length} strings to ${to}:\n${JSON.stringify(strings)}`;
113
+ const parsed = parseJsonArray((await anthropic.messages.create({
114
+ model,
115
+ max_tokens: 16e3,
116
+ output_config: { effort: "low" },
117
+ system: translationSystemPrompt({
118
+ from: request.from,
119
+ to: request.to,
120
+ site
121
+ }),
122
+ messages: [{
123
+ role: "user",
124
+ content
125
+ }]
126
+ }, {
127
+ timeout: TIMEOUT_MS,
128
+ maxRetries: MAX_RETRIES
129
+ })).content.filter((block) => block.type === "text" && typeof block.text === "string").map((block) => block.text).join("").trim());
130
+ return parsed && parsed.length === strings.length ? parsed : null;
131
+ } catch {
132
+ return null;
133
+ }
134
+ };
135
+ return Object.assign(translate, { configured: Boolean(apiKey || options.client) });
136
+ }
137
+ //#endregion
138
+ //#region src/translate/messages.ts
139
+ const BATCH_SIZE = 40;
140
+ /** Every string leaf as [path, value]; array indexes are path segments. */
141
+ function stringLeaves(node, path = [], out = []) {
142
+ if (typeof node === "string") out.push([path, node]);
143
+ else if (Array.isArray(node)) node.forEach((item, index) => stringLeaves(item, [...path, String(index)], out));
144
+ else if (node && typeof node === "object") for (const [key, value] of Object.entries(node)) stringLeaves(value, [...path, key], out);
145
+ return out;
146
+ }
147
+ function getAtPath(root, path) {
148
+ let current = root;
149
+ for (const segment of path) {
150
+ if (current == null || typeof current !== "object") return void 0;
151
+ current = Array.isArray(current) ? current[Number(segment)] : current[segment];
152
+ }
153
+ return current;
154
+ }
155
+ function setAtPath(root, path, value) {
156
+ let current = root;
157
+ for (let i = 0; i < path.length - 1; i++) {
158
+ const segment = path[i];
159
+ const wantArray = /^\d+$/.test(path[i + 1]);
160
+ const container = current;
161
+ let child = container[segment];
162
+ if (child == null || typeof child !== "object" || Array.isArray(child) !== wantArray) {
163
+ child = wantArray ? [] : {};
164
+ container[segment] = child;
165
+ }
166
+ current = child;
167
+ }
168
+ current[path[path.length - 1]] = value;
169
+ }
170
+ /**
171
+ * The `{name}` arguments of a message, sorted. Plural and select messages are
172
+ * skipped (their branch bodies are braced text the model rightly translates),
173
+ * so this only checks plain interpolations.
174
+ */
175
+ function placeholderNames(message) {
176
+ if (/,\s*(plural|select|selectordinal)\s*,/.test(message)) return null;
177
+ return [...message.matchAll(/\{\s*([A-Za-z_][\w]*)\s*\}/g)].map((match) => match[1]).sort().join(",");
178
+ }
179
+ /** A translation that dropped or renamed a `{placeholder}` would break at render; keep the source instead. */
180
+ function keepsPlaceholders(source, translated) {
181
+ const before = placeholderNames(source);
182
+ return before === null || before === placeholderNames(translated);
183
+ }
184
+ /**
185
+ * Fills a target next-intl message file from the source file. The source is
186
+ * the truth; only keys that are missing or empty in the target are
187
+ * translated, so reviewed copy is never overwritten, unless `force`
188
+ * re-translates every key. Batches of 40, so one failure costs at most 40
189
+ * keys. `{placeholders}` survive because the translator's prompt keeps them.
190
+ */
191
+ async function fillMessages(options) {
192
+ const base = !options.force && options.target && typeof options.target === "object" && !Array.isArray(options.target) ? structuredClone(options.target) : {};
193
+ const missing = stringLeaves(options.source).filter(([path]) => {
194
+ const existing = getAtPath(base, path);
195
+ return typeof existing !== "string" || existing.trim() === "";
196
+ });
197
+ let translated = 0;
198
+ let fellBack = 0;
199
+ for (let i = 0; i < missing.length; i += BATCH_SIZE) {
200
+ const batch = missing.slice(i, i + BATCH_SIZE);
201
+ const result = await translateStrings(batch.map(([, value]) => value), {
202
+ translator: options.translator,
203
+ from: options.from,
204
+ to: options.to,
205
+ context: options.context ?? "Website UI strings",
206
+ ...options.site ? { site: options.site } : {}
207
+ });
208
+ batch.forEach(([path, source], index) => {
209
+ const value = result?.[index];
210
+ if (value !== void 0 && keepsPlaceholders(source, value)) {
211
+ translated += 1;
212
+ setAtPath(base, path, value);
213
+ } else {
214
+ fellBack += 1;
215
+ setAtPath(base, path, source);
216
+ }
217
+ });
218
+ options.onProgress?.(Math.min(i + BATCH_SIZE, missing.length), missing.length);
219
+ }
220
+ return {
221
+ messages: base,
222
+ translated,
223
+ fellBack
224
+ };
225
+ }
226
+ //#endregion
227
+ export { translationSystemPrompt as a, parseJsonArray as i, DEFAULT_TRANSLATE_MODEL as n, isTranslatorConfigured as o, anthropicTranslator as r, translateStrings as s, fillMessages as t };
228
+
229
+ //# sourceMappingURL=messages-Fl1spIwN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages-Fl1spIwN.mjs","names":[],"sources":["../src/translate/strings.ts","../src/translate/anthropic.ts","../src/translate/messages.ts"],"sourcesContent":["import type { TranslateRequest, Translator } from \"./types\";\n\n/**\n * Translates `strings` with `translator` in one batch, preserving order.\n * Repeated strings are sent once. Returns `null` when the translator throws,\n * returns `null`, or returns anything but one string per string sent, so a\n * caller can leave the target as it was. Never throws.\n */\nexport async function translateStrings(\n strings: readonly string[],\n options: TranslateRequest & { translator: Translator },\n): Promise<string[] | null> {\n if (strings.length === 0) return [];\n const { translator, ...request } = options;\n const unique = [...new Set(strings)];\n let result: unknown;\n try {\n result = await translator(unique, request);\n } catch {\n return null;\n }\n if (!Array.isArray(result) || result.length !== unique.length) return null;\n if (!result.every((value) => typeof value === \"string\")) return null;\n const byString = new Map(unique.map((value, index) => [value, result[index] as string]));\n return strings.map((value) => byString.get(value) ?? value);\n}\n\n/** True unless the translator says it cannot run (an Anthropic translator with no API key). */\nexport function isTranslatorConfigured(translator: Translator | undefined): translator is Translator {\n return translator !== undefined && translator.configured !== false;\n}\n","import type { TranslateRequest, TranslateSite, Translator } from \"./types\";\n\n/**\n * The library's default model. Translating marketing copy does not need the\n * most capable model; a current Sonnet handles it well at a fraction of the\n * price. A site overrides it per environment (`ANTHROPIC_TRANSLATE_MODEL`).\n */\nexport const DEFAULT_TRANSLATE_MODEL = \"claude-sonnet-5-5\";\n\n/**\n * The SDK's defaults are a 10-minute timeout with retries. A translation\n * must stay bounded to seconds, not minutes: the manual endpoint awaits it\n * while an editor waits, and a deferred run must finish inside the host's\n * `waitUntil` window. One retry, 90s cap, then the target stays as it was.\n */\nconst TIMEOUT_MS = 90_000;\nconst MAX_RETRIES = 1;\n\n/** The slice of the Anthropic client this translator calls. */\nexport interface AnthropicMessagesClient {\n messages: {\n create(\n body: Record<string, unknown>,\n options?: { timeout?: number; maxRetries?: number },\n ): Promise<{ content: Array<{ type: string; text?: string }> }>;\n };\n}\n\nexport interface AnthropicTranslatorOptions {\n /**\n * The API key, usually `process.env.ANTHROPIC_API_KEY`. Without one the\n * translator reports `configured: false`: publishes still work, a\n * warning is logged, and \"Translate now\" is hidden.\n */\n apiKey?: string | null;\n /** The model id; omitted or blank uses `DEFAULT_TRANSLATE_MODEL`. */\n model?: string | null;\n /** The site facts the prompt carries. The plugin's own `site`, when given, wins. */\n site?: TranslateSite;\n /** A client to use instead of constructing one (tests, a proxied client). */\n client?: AnthropicMessagesClient;\n}\n\nfunction languageName(code: string, site: TranslateSite | undefined): string {\n const named = site?.languages?.[code];\n if (named) return named;\n try {\n return new Intl.DisplayNames([\"en\"], { type: \"language\" }).of(code) ?? code;\n } catch {\n return code;\n }\n}\n\n/**\n * The system prompt: the library's generic rules plus the site's own facts.\n * Exported so a site can read exactly what the model is told.\n */\nexport function translationSystemPrompt(request: Pick<TranslateRequest, \"from\" | \"to\" | \"site\">): string {\n const { site } = request;\n const from = languageName(request.from, site);\n const to = languageName(request.to, site);\n const who = site?.name\n ? `You are a professional translator for ${site.name}${site.about ? `, ${site.about}` : \"\"}.`\n : \"You are a professional translator for a business website.\";\n const voice = site?.voice ? ` Keep the ${site.voice} brand voice.` : \" Keep the brand voice.\";\n const verbatim = [site?.name, ...(site?.keepVerbatim ?? [])].filter(\n (value, index, all): value is string => Boolean(value) && all.indexOf(value) === index,\n );\n const keep = verbatim.length\n ? `- Keep these EXACTLY as written, untranslated: ${verbatim.join(\n \", \",\n )}. Also keep URLs, email addresses and phone numbers as written.`\n : \"- Keep URLs, email addresses and phone numbers exactly as written.\";\n\n return `${who} Translate website and UI copy from ${from} into clear, natural ${to}.${voice}\n\nHard rules:\n- You receive a JSON array of strings. Return ONLY a JSON array of the translated strings, in the SAME ORDER and SAME LENGTH. No prose, no markdown, no code fences.\n${keep}\n- Preserve any ICU/message placeholders such as {year}, {count}, {name} verbatim, including the braces.\n- Preserve any HTML tags (e.g. <em>...</em>, <strong>...</strong>) and their positions; translate only the text between them.\n- For legal, regulatory or compliance copy, translate faithfully and literally. This output is a first-pass draft for a native speaker to review, not final compliance copy.\n- If a string is empty or is only a placeholder/URL/number, return it unchanged.`;\n}\n\n/** Tolerant JSON-array parse: strips accidental ``` fences and prose around the array, and checks the shape. */\nexport function parseJsonArray(text: string): string[] | null {\n let candidate = text.trim();\n const fenced = candidate.match(/```(?:json)?\\s*([\\s\\S]*?)```/);\n if (fenced?.[1] !== undefined) candidate = fenced[1].trim();\n // If the model wrapped the array in prose, take the outermost [ ... ].\n const start = candidate.indexOf(\"[\");\n const end = candidate.lastIndexOf(\"]\");\n if (start !== -1 && end > start) candidate = candidate.slice(start, end + 1);\n try {\n const value: unknown = JSON.parse(candidate);\n if (Array.isArray(value) && value.every((item) => typeof item === \"string\")) return value as string[];\n } catch {\n // fall through\n }\n return null;\n}\n\n/**\n * The provided `Translator`: one Anthropic Messages call per batch, the\n * strings as a JSON array in and out. `@anthropic-ai/sdk` is an optional\n * peer, loaded on the first call, so a site with translation off installs\n * nothing. Every failure (no key, the SDK missing, a network error, a\n * refusal, a malformed or wrong-length reply) returns `null` and is logged\n * by the caller; it never throws.\n */\nexport function anthropicTranslator(options: AnthropicTranslatorOptions): Translator {\n const apiKey = options.apiKey || undefined;\n const model = options.model?.trim() || DEFAULT_TRANSLATE_MODEL;\n let client: AnthropicMessagesClient | undefined = options.client;\n\n const getClient = async (): Promise<AnthropicMessagesClient | null> => {\n if (client) return client;\n if (!apiKey) return null;\n const sdk = (await import(\"@anthropic-ai/sdk\")) as unknown as {\n default: new (init: { apiKey: string }) => AnthropicMessagesClient;\n };\n client = new sdk.default({ apiKey });\n return client;\n };\n\n const translate = async (strings: string[], request: TranslateRequest): Promise<string[] | null> => {\n if (strings.length === 0) return [];\n try {\n const anthropic = await getClient();\n if (!anthropic) return null;\n const site = request.site ?? options.site;\n const to = languageName(request.to, site);\n const content =\n (request.context ? `Context: ${request.context}\\n\\n` : \"\") +\n `Translate this JSON array of ${strings.length} strings to ${to}:\\n${JSON.stringify(strings)}`;\n const response = await anthropic.messages.create(\n {\n model,\n max_tokens: 16000,\n // A batch of copy is routine work; low effort keeps it fast and\n // inside the timeout without changing the result.\n output_config: { effort: \"low\" },\n system: translationSystemPrompt({ from: request.from, to: request.to, site }),\n messages: [{ role: \"user\", content }],\n },\n { timeout: TIMEOUT_MS, maxRetries: MAX_RETRIES },\n );\n const text = response.content\n .filter((block) => block.type === \"text\" && typeof block.text === \"string\")\n .map((block) => block.text)\n .join(\"\")\n .trim();\n const parsed = parseJsonArray(text);\n return parsed && parsed.length === strings.length ? parsed : null;\n } catch {\n return null;\n }\n };\n\n return Object.assign(translate, { configured: Boolean(apiKey || options.client) });\n}\n","import { translateStrings } from \"./strings\";\nimport type { TranslateSite, Translator } from \"./types\";\n\n/** A next-intl message file: nested objects and arrays with string leaves. */\nexport type MessagesJson = string | number | boolean | null | MessagesJson[] | { [key: string]: MessagesJson };\n\nconst BATCH_SIZE = 40;\n\n/** Every string leaf as [path, value]; array indexes are path segments. */\nfunction stringLeaves(\n node: MessagesJson,\n path: string[] = [],\n out: Array<[string[], string]> = [],\n): Array<[string[], string]> {\n if (typeof node === \"string\") out.push([path, node]);\n else if (Array.isArray(node)) node.forEach((item, index) => stringLeaves(item, [...path, String(index)], out));\n else if (node && typeof node === \"object\") {\n for (const [key, value] of Object.entries(node)) stringLeaves(value, [...path, key], out);\n }\n return out;\n}\n\nfunction getAtPath(root: MessagesJson, path: string[]): MessagesJson | undefined {\n let current: MessagesJson | undefined = root;\n for (const segment of path) {\n if (current == null || typeof current !== \"object\") return undefined;\n current = Array.isArray(current) ? current[Number(segment)] : current[segment];\n }\n return current;\n}\n\nfunction setAtPath(root: { [key: string]: MessagesJson }, path: string[], value: string): void {\n let current: { [key: string]: MessagesJson } | MessagesJson[] = root;\n for (let i = 0; i < path.length - 1; i++) {\n const segment = path[i]!;\n const wantArray = /^\\d+$/.test(path[i + 1]!);\n const container = current as Record<string, MessagesJson>;\n let child = container[segment];\n // Create the container when missing, and REPAIR it when the existing\n // target node has the opposite shape from the source (the source changed\n // an object into a list) so string keys never land in an array or the\n // reverse.\n if (child == null || typeof child !== \"object\" || Array.isArray(child) !== wantArray) {\n child = wantArray ? [] : {};\n container[segment] = child;\n }\n current = child as { [key: string]: MessagesJson } | MessagesJson[];\n }\n (current as Record<string, MessagesJson>)[path[path.length - 1]!] = value;\n}\n\n/**\n * The `{name}` arguments of a message, sorted. Plural and select messages are\n * skipped (their branch bodies are braced text the model rightly translates),\n * so this only checks plain interpolations.\n */\nfunction placeholderNames(message: string): string | null {\n if (/,\\s*(plural|select|selectordinal)\\s*,/.test(message)) return null;\n const names = [...message.matchAll(/\\{\\s*([A-Za-z_][\\w]*)\\s*\\}/g)].map((match) => match[1]!);\n return names.sort().join(\",\");\n}\n\n/** A translation that dropped or renamed a `{placeholder}` would break at render; keep the source instead. */\nexport function keepsPlaceholders(source: string, translated: string): boolean {\n const before = placeholderNames(source);\n return before === null || before === placeholderNames(translated);\n}\n\nexport interface FillMessagesResult {\n /** The target file to write. */\n messages: MessagesJson;\n /** Keys translated. */\n translated: number;\n /**\n * Keys whose batch failed, or whose translation lost a `{placeholder}`.\n * They hold the source text, so the file stays\n * complete (a hole renders as MISSING_MESSAGE); a plain re-run will not\n * retry them, `--force` (or a hand edit) will.\n */\n fellBack: number;\n}\n\n/**\n * Fills a target next-intl message file from the source file. The source is\n * the truth; only keys that are missing or empty in the target are\n * translated, so reviewed copy is never overwritten, unless `force`\n * re-translates every key. Batches of 40, so one failure costs at most 40\n * keys. `{placeholders}` survive because the translator's prompt keeps them.\n */\nexport async function fillMessages(options: {\n source: MessagesJson;\n target?: MessagesJson;\n translator: Translator;\n from: string;\n to: string;\n force?: boolean;\n context?: string;\n site?: TranslateSite;\n onProgress?: (done: number, total: number) => void;\n}): Promise<FillMessagesResult> {\n const base =\n !options.force && options.target && typeof options.target === \"object\" && !Array.isArray(options.target)\n ? (structuredClone(options.target) as { [key: string]: MessagesJson })\n : {};\n const missing = stringLeaves(options.source).filter(([path]) => {\n const existing = getAtPath(base, path);\n return typeof existing !== \"string\" || existing.trim() === \"\";\n });\n\n let translated = 0;\n let fellBack = 0;\n for (let i = 0; i < missing.length; i += BATCH_SIZE) {\n const batch = missing.slice(i, i + BATCH_SIZE);\n const sources = batch.map(([, value]) => value);\n const result = await translateStrings(sources, {\n translator: options.translator,\n from: options.from,\n to: options.to,\n context: options.context ?? \"Website UI strings\",\n ...(options.site ? { site: options.site } : {}),\n });\n batch.forEach(([path, source], index) => {\n const value = result?.[index];\n if (value !== undefined && keepsPlaceholders(source, value)) {\n translated += 1;\n setAtPath(base, path, value);\n } else {\n fellBack += 1;\n setAtPath(base, path, source);\n }\n });\n options.onProgress?.(Math.min(i + BATCH_SIZE, missing.length), missing.length);\n }\n return { messages: base, translated, fellBack };\n}\n"],"mappings":";;;;;;;AAQA,eAAsB,iBACpB,SACA,SAC0B;AAC1B,KAAI,QAAQ,WAAW,EAAG,QAAO,EAAE;CACnC,MAAM,EAAE,YAAY,GAAG,YAAY;CACnC,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC;CACpC,IAAI;AACJ,KAAI;AACF,WAAS,MAAM,WAAW,QAAQ,QAAQ;SACpC;AACN,SAAO;;AAET,KAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,OAAO,WAAW,OAAO,OAAQ,QAAO;AACtE,KAAI,CAAC,OAAO,OAAO,UAAU,OAAO,UAAU,SAAS,CAAE,QAAO;CAChE,MAAM,WAAW,IAAI,IAAI,OAAO,KAAK,OAAO,UAAU,CAAC,OAAO,OAAO,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,kBAAkB,QAAQ,MAAM,EAAE;AAC3D,kBAAc;AACd,cAAU,MAAM,MAAM,MAAM;UACvB;AACL,gBAAY;AACZ,cAAU,MAAM,MAAM,OAAO;;IAE/B;AACF,UAAQ,aAAa,KAAK,IAAI,IAAI,YAAY,QAAQ,OAAO,EAAE,QAAQ,OAAO;;AAEhF,QAAO;EAAE,UAAU;EAAM;EAAY;EAAU"}
@@ -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-DFKu53nG.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-D_jixG36.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. */
@@ -1,3 +1,3 @@
1
- import { t as LocaleRead } from "./locale-CxFNy8ex.mjs";
2
- 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, g as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as FooterSocial, m as EXTERNAL_HREF_MESSAGE, 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 } from "./published-B3IYStMQ.mjs";
1
+ import { t as LocaleRead } from "./locale-CWiIcGuU.mjs";
2
+ 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, g as isValidExternalHref, i as FOOTER_MAX_COLUMNS, l as FooterSocial, m as EXTERNAL_HREF_MESSAGE, 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 } from "./published-DXjnElZn.mjs";
3
3
  export { EXTERNAL_HREF_MESSAGE, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, type FooterColumnWidth, type FooterSocial, type LocaleRead, NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, type NavigationBar, type NavigationDoc, type NavigationFooter, type NavigationHeader, footerDesktopTracks, getNavigation, isValidExternalHref, normalizeFooterDesktop, validateExternalHref, validateFooterSocialUrl, validateHeaderCta };
@@ -1,2 +1,2 @@
1
- import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, c as footerDesktopTracks, f as validateFooterSocialUrl, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-DACERo16.mjs";
1
+ import { C as NAVIGATION_SLUG, S as NAVIGATION_FOOTER_SLUG, _ as validateExternalHref, a as FOOTER_MAX_LINK_COLUMNS, c as footerDesktopTracks, f as validateFooterSocialUrl, h as isValidExternalHref, i as FOOTER_MAX_COLUMNS, o as FOOTER_SOCIALS, p as EXTERNAL_HREF_MESSAGE, r as FOOTER_COLUMN_WIDTHS, s as FOOTER_TWELFTHS, t as getNavigation, u as normalizeFooterDesktop, v as validateHeaderCta, x as NAVIGATION_FOOTER_DB_NAME, y as NAVIGATION_DB_NAME } from "./published-D3yVnbxs.mjs";
2
2
  export { EXTERNAL_HREF_MESSAGE, FOOTER_COLUMN_WIDTHS, FOOTER_MAX_COLUMNS, FOOTER_MAX_LINK_COLUMNS, FOOTER_SOCIALS, FOOTER_TWELFTHS, NAVIGATION_DB_NAME, NAVIGATION_FOOTER_DB_NAME, NAVIGATION_FOOTER_SLUG, NAVIGATION_SLUG, footerDesktopTracks, getNavigation, isValidExternalHref, normalizeFooterDesktop, validateExternalHref, validateFooterSocialUrl, validateHeaderCta };
package/dist/og.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as ThemeIdentityFallback } from "./types-B7Hy1Ho-.mjs";
2
- import { t as ThemePayload } from "./published-Cow49CSZ.mjs";
1
+ import { _ as ThemeIdentityFallback } from "./types-Db6Iy3hJ.mjs";
2
+ import { t as ThemePayload } from "./published-_1rrTj_B.mjs";
3
3
  import { FontId } from "@bison-lab/fonts";
4
4
  import { ThemeConfig } from "@bison-lab/tokens";
5
5
  import { Payload } from "payload";
@@ -1,4 +1,4 @@
1
- import { d as ThemeDoc, m as ThemeLibraryColorDoc } from "./types-B7Hy1Ho-.mjs";
1
+ import { d as ThemeDoc, m as ThemeLibraryColorDoc } from "./types-Db6Iy3hJ.mjs";
2
2
  import { ShadeStep } from "@bison-lab/tokens";
3
3
  import { StaticLabel, TextField, TextFieldSingleValidation } from "payload";
4
4
 
@@ -110,4 +110,4 @@ declare const THEME_PREVIEW_BREAKPOINTS: readonly [{
110
110
  }];
111
111
  //#endregion
112
112
  export { deleteLibraryColor as _, PageEditorSystemKey as a, pageEditorTokens as c, LookFieldOptions as d, colorTokenField as f, rewriteColorTokens as g, findColorTokens as h, PAGE_EDITOR_SYSTEM_KEYS as i, themeLibraryFromDoc as l, ColorTokenHit as m, ColorSwatch as n, pageEditorLooks as o, lookField as p, LookOption as r, pageEditorSwatches as s, THEME_PREVIEW_BREAKPOINTS as t, LookFieldMode as u, rewriteColorToken as v, themeColorKeys as y };
113
- //# sourceMappingURL=preview-v-GlYuqa.d.mts.map
113
+ //# sourceMappingURL=preview-CNBVfmM7.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview-v-GlYuqa.d.mts","names":[],"sources":["../src/theme/library.ts","../src/theme/color-tokens.ts","../src/theme/look-field.ts","../src/theme/looks.ts","../src/theme/preview.ts"],"mappings":";;;;;;;;;;iBAoBgB,iBAAA,CAAkB,KAAA,UAAe,OAAA,UAAiB,KAAA;AAAA,iBAUlD,cAAA,CAAe,GAAA,EAAK,QAAA;AAApC;;;;;AAaA;AAbA,iBAagB,kBAAA,CAAmB,GAAA,EAAK,QAAA,EAAU,GAAA,UAAa,WAAA,YAAuB,QAAA;;;UCzCrE,aAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,iBAWc,eAAA,CAAgB,KAAA,WAAgB,GAAA,WAAc,aAAA;AAAA,iBAQ9C,kBAAA,GAAA,CAAsB,KAAA,EAAO,CAAA,EAAG,OAAA,UAAiB,KAAA,WAAgB,CAAA;;;UClBhE,gBAAA;EACf,IAAA;EACA,KAAA,GAAQ,WAAA;EACR,QAAA;EACA,KAAA,GAAQ,SAAA;EACR,QAAA,GAAW,yBAAA;AAAA;AAAA,KAGD,aAAA;;;;AFiBZ;;;iBE0BgB,SAAA,CAAU,SAAA,GAAW,gBAAA,GAAwB,SAAA;;AFb7D;;iBEoBgB,eAAA,CAAgB,SAAA,GAAW,gBAAA,GAAwB,SAAA;;;;;;AF3CnE;cGXa,uBAAA;AAAA,KAED,mBAAA,WAA8B,uBAAA;AAAA,UAEzB,UAAA;EACf,KAAA;EACA,KAAA;AAAA;AAAA,iBAiBc,mBAAA,CAAoB,GAAA,EAAK,QAAA,sBAA8B,oBAAA;;AHFvE;;;;iBGuBgB,eAAA,CAAgB,GAAA,EAAK,QAAA,sBAA8B,UAAA;AHVnE;;;;AAAA,iBG6BgB,gBAAA,CAAiB,GAAA,EAAK,QAAA,sBAA8B,UAAA;;UAoBnD,WAAA,SAAoB,UAAA;EHjD0B;EGmD7D,MAAA;EHnD4F;EGqD5F,WAAA;EACA,IAAA,EAAM,SAAA;;EAEN,GAAA;AAAA;;;;;AFpFF;iBE4FgB,kBAAA,CAAmB,GAAA,EAAK,QAAA,sBAA8B,WAAA;;;;;;;cCvGzD,yBAAA;EAAA"}
1
+ {"version":3,"file":"preview-CNBVfmM7.d.mts","names":[],"sources":["../src/theme/library.ts","../src/theme/color-tokens.ts","../src/theme/look-field.ts","../src/theme/looks.ts","../src/theme/preview.ts"],"mappings":";;;;;;;;;;iBAoBgB,iBAAA,CAAkB,KAAA,UAAe,OAAA,UAAiB,KAAA;AAAA,iBAUlD,cAAA,CAAe,GAAA,EAAK,QAAA;AAApC;;;;;AAaA;AAbA,iBAagB,kBAAA,CAAmB,GAAA,EAAK,QAAA,EAAU,GAAA,UAAa,WAAA,YAAuB,QAAA;;;UCzCrE,aAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,iBAWc,eAAA,CAAgB,KAAA,WAAgB,GAAA,WAAc,aAAA;AAAA,iBAQ9C,kBAAA,GAAA,CAAsB,KAAA,EAAO,CAAA,EAAG,OAAA,UAAiB,KAAA,WAAgB,CAAA;;;UClBhE,gBAAA;EACf,IAAA;EACA,KAAA,GAAQ,WAAA;EACR,QAAA;EACA,KAAA,GAAQ,SAAA;EACR,QAAA,GAAW,yBAAA;AAAA;AAAA,KAGD,aAAA;;;;AFiBZ;;;iBE0BgB,SAAA,CAAU,SAAA,GAAW,gBAAA,GAAwB,SAAA;;AFb7D;;iBEoBgB,eAAA,CAAgB,SAAA,GAAW,gBAAA,GAAwB,SAAA;;;;;;AF3CnE;cGXa,uBAAA;AAAA,KAED,mBAAA,WAA8B,uBAAA;AAAA,UAEzB,UAAA;EACf,KAAA;EACA,KAAA;AAAA;AAAA,iBAiBc,mBAAA,CAAoB,GAAA,EAAK,QAAA,sBAA8B,oBAAA;;AHFvE;;;;iBGuBgB,eAAA,CAAgB,GAAA,EAAK,QAAA,sBAA8B,UAAA;AHVnE;;;;AAAA,iBG6BgB,gBAAA,CAAiB,GAAA,EAAK,QAAA,sBAA8B,UAAA;;UAoBnD,WAAA,SAAoB,UAAA;EHjD0B;EGmD7D,MAAA;EHnD4F;EGqD5F,WAAA;EACA,IAAA,EAAM,SAAA;;EAEN,GAAA;AAAA;;;;;AFpFF;iBE4FgB,kBAAA,CAAmB,GAAA,EAAK,QAAA,sBAA8B,WAAA;;;;;;;cCvGzD,yBAAA;EAAA"}
@@ -19,10 +19,11 @@ function linkTypeOf(link) {
19
19
  if (link?.type === "page") return "page";
20
20
  return link?.href ? "external" : "page";
21
21
  }
22
- const EXTERNAL_HREF_MESSAGE = "Enter a valid URL (https://…), a mailto: or tel: link, or a site path starting with /.";
22
+ const EXTERNAL_HREF_MESSAGE = "Enter a valid URL (https://…), a mailto: or tel: link, a site path starting with /, or a #anchor on the same page.";
23
+ const SAME_PAGE_ANCHOR = /^#[A-Za-z][\w:.-]*$/;
23
24
  /**
24
25
  * What the picker will store as an external destination: http(s) with a
25
- * host, mailto:/tel: with a value, or an in-site path. Rejects a bare
26
+ * host, mailto:/tel: with a value, an in-site path, or a same-page #anchor. Rejects a bare
26
27
  * host, protocol-relative URLs, and anything that is not a link.
27
28
  */
28
29
  function isValidExternalHref(value) {
@@ -31,6 +32,7 @@ function isValidExternalHref(value) {
31
32
  if (raw.startsWith("/") && !raw.startsWith("//")) return true;
32
33
  if (/^mailto:/i.test(raw)) return raw.length > 7;
33
34
  if (/^tel:/i.test(raw)) return raw.length > 4;
35
+ if (raw.startsWith("#")) return SAME_PAGE_ANCHOR.test(raw);
34
36
  try {
35
37
  const url = new URL(raw);
36
38
  return (url.protocol === "http:" || url.protocol === "https:") && Boolean(url.hostname);
@@ -86,7 +88,7 @@ function linkDestinationFields({ required = false, pagesCollection = "pages" } =
86
88
  validate: hrefValidate(required),
87
89
  admin: {
88
90
  condition: whenExternal,
89
- description: "A full URL (\"https://example.com\"), \"mailto:\" or \"tel:\", or a site path (\"/contact\")."
91
+ description: "A full URL (\"https://example.com\"), \"mailto:\" or \"tel:\", a site path (\"/contact\"), or a same-page \"#anchor\"."
90
92
  }
91
93
  }
92
94
  ]
@@ -425,4 +427,4 @@ async function getNavigation({ payload, draft = false, ...read }) {
425
427
  //#endregion
426
428
  export { NAVIGATION_SLUG as C, NAVIGATION_FOOTER_SLUG as S, validateExternalHref as _, FOOTER_MAX_LINK_COLUMNS as a, NAVIGATION_FEATURE as b, footerDesktopTracks as c, validateFooterColumns as d, validateFooterSocialUrl as f, linkField as g, isValidExternalHref as h, FOOTER_MAX_COLUMNS as i, footerFields as l, headerCtaEnabled as m, FOOTER_COLUMNS_FIELD as n, FOOTER_SOCIALS as o, EXTERNAL_HREF_MESSAGE as p, FOOTER_COLUMN_WIDTHS as r, FOOTER_TWELFTHS as s, getNavigation as t, normalizeFooterDesktop as u, validateHeaderCta as v, NAVIGATION_FOOTER_DB_NAME as x, NAVIGATION_DB_NAME as y };
427
429
 
428
- //# sourceMappingURL=published-DACERo16.mjs.map
430
+ //# sourceMappingURL=published-D3yVnbxs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-D3yVnbxs.mjs","names":[],"sources":["../src/navigation/types.ts","../src/navigation/link.ts","../src/navigation/footer.ts","../src/navigation/published.ts"],"sourcesContent":["/**\n * Public Header and Footer as two Globals so each has its own Save /\n * Publish / drafts. Bar behaviour (`bar` on Header) stays in the schema\n * with `admin.hidden`; it is not a Settings tab. Featured looks stay on\n * chrome roles (BIS-85 / SPI-89), not a Header array. The items kit\n * editor is the workspace field (BIS-119 / BIS-121). Payload's left nav\n * stays until BIS-90. The Spinal bump is SPI-99.\n */\n\nimport type { Block, GlobalConfig } from \"payload\";\n\nimport type { LocaleRead } from \"../locale\";\n\nexport const NAVIGATION_SLUG = \"navigation\";\nexport const NAVIGATION_DB_NAME = \"nav\";\nexport const NAVIGATION_FOOTER_SLUG = \"navigation-footer\";\nexport const NAVIGATION_FOOTER_DB_NAME = \"navf\";\n\nexport const NAVIGATION_FEATURE = \"navigation\";\n\nexport interface CreateNavigationOptions {\n /**\n * Header bar blocks this site offers. The field stays a blocks array —\n * a later nav block is appended here, not a mega-menu-only shape.\n */\n blocks: Block[];\n /**\n * Preview URL for both documents. The site owns the path — this factory\n * does not invent a route.\n */\n preview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"preview\"]>;\n livePreview?: NonNullable<NonNullable<GlobalConfig[\"admin\"]>[\"livePreview\"]>;\n /**\n * Component path for Payload's Preview button, as a key into the site's\n * committed `importMap.js`.\n */\n previewButton?: string;\n /** The collection a page link points into. Defaults to `pages`. */\n pagesCollection?: string;\n /** Locked footer copyright uses this name. The year stays the current year. */\n footerCopyrightName?: string;\n}\n\nexport interface NavigationHeader {\n items?: unknown;\n cta?: unknown;\n}\n\nexport interface NavigationBar {\n hideOnScroll?: boolean | null;\n viewport?: boolean | null;\n defaultMaxWidth?: (\"narrow\" | \"standard\" | \"wide\") | null;\n}\n\nexport interface NavigationFooter {\n columns?: unknown;\n brand?: unknown;\n}\n\nexport interface NavigationDoc {\n header: NavigationHeader;\n footer: NavigationFooter;\n bar: NavigationBar;\n}\n\nexport interface GetNavigationArgs extends LocaleRead {\n payload: {\n findGlobal: (args: {\n slug: string;\n draft?: boolean;\n overrideAccess?: boolean;\n depth?: number;\n }) => Promise<unknown>;\n };\n draft?: boolean;\n}\n","import type { Condition, Field, GroupField, RowField, TextFieldSingleValidation } from \"payload\";\n\n/**\n * Same import-map string as `@bison-lab/payload-blocks`. A site that\n * already generates the blocks admin map gets the picker; a missing\n * entry renders the row as nothing, so `payload generate:importmap` is\n * part of adopting this factory.\n */\nconst LINK_FIELD = \"@bison-lab/payload-blocks/admin#LinkField\";\n\ntype LinkType = \"page\" | \"external\";\n\ninterface LinkDestination {\n type?: LinkType | null;\n href?: string | null;\n}\n\nfunction linkTypeOf(link: LinkDestination | null | undefined): LinkType {\n if (link?.type === \"external\") return \"external\";\n if (link?.type === \"page\") return \"page\";\n return link?.href ? \"external\" : \"page\";\n}\n\nexport const EXTERNAL_HREF_MESSAGE =\n \"Enter a valid URL (https://…), a mailto: or tel: link, a site path starting with /, or a #anchor on the same page.\";\n\nconst SAME_PAGE_ANCHOR = /^#[A-Za-z][\\w:.-]*$/;\n\n/**\n * What the picker will store as an external destination: http(s) with a\n * host, mailto:/tel: with a value, an in-site path, or a same-page #anchor. Rejects a bare\n * host, protocol-relative URLs, and anything that is not a link.\n */\nexport function isValidExternalHref(value: unknown): boolean {\n const raw = String(value ?? \"\").trim();\n if (!raw || /\\s/.test(raw)) return false;\n if (raw.startsWith(\"/\") && !raw.startsWith(\"//\")) return true;\n if (/^mailto:/i.test(raw)) return raw.length > \"mailto:\".length;\n if (/^tel:/i.test(raw)) return raw.length > \"tel:\".length;\n // A same-page fragment: a site's link adapter can open a modal or scroll to it.\n if (raw.startsWith(\"#\")) return SAME_PAGE_ANCHOR.test(raw);\n try {\n const url = new URL(raw);\n return (url.protocol === \"http:\" || url.protocol === \"https:\") && Boolean(url.hostname);\n } catch {\n return false;\n }\n}\n\nexport function validateExternalHref(value: unknown, required = false): true | string {\n const raw = String(value ?? \"\").trim();\n if (!raw) return required ? \"This field is required.\" : true;\n return isValidExternalHref(raw) ? true : EXTERNAL_HREF_MESSAGE;\n}\n\nconst whenPage: Condition = (_data, siblingData) => linkTypeOf(siblingData as LinkDestination) === \"page\";\nconst whenExternal: Condition = (_data, siblingData) =>\n linkTypeOf(siblingData as LinkDestination) === \"external\";\n\nfunction hrefValidate(required: boolean): TextFieldSingleValidation {\n return (value, { siblingData }) => {\n if (linkTypeOf(siblingData as LinkDestination) !== \"external\") return true;\n return validateExternalHref(value, required);\n };\n}\n\nfunction linkDestinationFields({\n required = false,\n pagesCollection = \"pages\",\n}: {\n required?: boolean;\n pagesCollection?: string;\n} = {}): RowField[] {\n return [\n {\n type: \"row\",\n admin: { components: { Field: LINK_FIELD } },\n fields: [\n {\n name: \"type\",\n type: \"radio\",\n label: \"Link\",\n defaultValue: \"page\",\n options: [\n { label: \"Page\", value: \"page\" },\n { label: \"URL\", value: \"external\" },\n ],\n admin: { layout: \"horizontal\" },\n },\n {\n name: \"page\",\n type: \"relationship\",\n relationTo: pagesCollection,\n required,\n filterOptions: { _status: { equals: \"published\" } },\n admin: { condition: whenPage },\n },\n {\n name: \"href\",\n type: \"text\",\n label: \"URL\",\n required,\n validate: hrefValidate(required),\n admin: {\n condition: whenExternal,\n description:\n 'A full URL (\"https://example.com\"), \"mailto:\" or \"tel:\", a site path (\"/contact\"), or a same-page \"#anchor\".',\n },\n },\n ],\n },\n ];\n}\n\nfunction linkFields({\n required = false,\n pagesCollection,\n}: {\n required?: boolean;\n pagesCollection?: string;\n} = {}): Field[] {\n return [\n ...linkDestinationFields({ required, pagesCollection }),\n { name: \"label\", type: \"text\", localized: true, label: \"Label\", required },\n {\n name: \"newTab\",\n type: \"checkbox\",\n label: \"Open in a new tab\",\n defaultValue: false,\n admin: {\n // Drawn by LinkField next to the destination so Header, Footer, and\n // page blocks cannot drift apart.\n hidden: true,\n },\n },\n ];\n}\n\nexport interface HeaderCtaValue {\n enabled?: boolean | null;\n type?: LinkType | null;\n page?: unknown;\n href?: string | null;\n label?: string | null;\n}\n\n/** A stored button, or a legacy row that already has a label or destination. */\nexport function headerCtaEnabled(cta: HeaderCtaValue | null | undefined): boolean {\n if (!cta) return false;\n if (cta.enabled === false) return false;\n if (cta.enabled === true) return true;\n return Boolean(cta.label || cta.page || cta.href);\n}\n\n/**\n * When the Header button is on, label and destination are required.\n * Off (or a cleared row) can save empty.\n */\nexport function validateHeaderCta(value: unknown): true | string {\n const cta = (value && typeof value === \"object\" ? value : {}) as HeaderCtaValue;\n if (!headerCtaEnabled(cta)) return true;\n if (!String(cta.label ?? \"\").trim()) return \"The Header button needs a label.\";\n const dest = linkTypeOf(cta);\n if (dest === \"external\") {\n const href = validateExternalHref(cta.href, true);\n if (href !== true) {\n return href === \"This field is required.\"\n ? \"The Header button needs a published page or a URL.\"\n : href;\n }\n }\n if (dest === \"page\" && (cta.page == null || cta.page === \"\")) {\n return \"The Header button needs a published page or a URL.\";\n }\n return true;\n}\n\nexport function linkField({\n name = \"link\",\n label,\n admin,\n required,\n pagesCollection,\n toggle,\n}: {\n name?: string;\n label?: GroupField[\"label\"];\n admin?: GroupField[\"admin\"];\n required?: boolean;\n pagesCollection?: string;\n /** Header button: an enable checkbox; children are not required unless it is on. */\n toggle?: boolean;\n} = {}): GroupField {\n return {\n name,\n type: \"group\",\n fields: toggle\n ? [\n {\n name: \"enabled\",\n type: \"checkbox\",\n label: \"Show Header button\",\n defaultValue: false,\n },\n ...linkFields({ required: false, pagesCollection }),\n ]\n : linkFields({ required, pagesCollection }),\n ...(toggle ? { validate: validateHeaderCta as NonNullable<GroupField[\"validate\"]> } : {}),\n ...(label === undefined ? {} : { label }),\n ...(admin === undefined ? {} : { admin }),\n };\n}\n\nexport function footerLinkFields({\n required = false,\n pagesCollection,\n}: {\n required?: boolean;\n pagesCollection?: string;\n} = {}): Field[] {\n return linkFields({ required, pagesCollection });\n}\n","import type { ArrayField, ArrayFieldValidation, Field, GroupField, TextField } from \"payload\";\n\nimport { footerLinkFields, isValidExternalHref, validateExternalHref } from \"./link\";\n\n/**\n * Same presets as the header mega-menu. Desktop only. Tablet is a fixed\n * 2×2 on the public footer; mobile stacks.\n */\nexport const FOOTER_COLUMN_WIDTHS = [\"25\", \"33\", \"50\", \"66\", \"75\", \"100\"] as const;\nexport type FooterColumnWidth = (typeof FOOTER_COLUMN_WIDTHS)[number];\n\n/** Logo column plus link columns. */\nexport const FOOTER_MAX_COLUMNS = 4;\n/** Link columns. The logo column is always first and is not in this count. */\nexport const FOOTER_MAX_LINK_COLUMNS = FOOTER_MAX_COLUMNS - 1;\n\nexport const FOOTER_SOCIALS = [\"facebook\", \"instagram\", \"linkedin\", \"x\", \"youtube\"] as const;\nexport type FooterSocial = (typeof FOOTER_SOCIALS)[number];\n\nconst FOOTER_SOCIAL_LABELS: Record<FooterSocial, string> = {\n facebook: \"Facebook\",\n instagram: \"Instagram\",\n linkedin: \"LinkedIn\",\n x: \"X\",\n youtube: \"YouTube\",\n};\n\n/** Twelfths of a row. Link-column widths share this 12; the logo column does not. */\nexport const FOOTER_TWELFTHS: Record<FooterColumnWidth, number> = {\n \"25\": 3,\n \"33\": 4,\n \"50\": 6,\n \"66\": 8,\n \"75\": 9,\n \"100\": 12,\n};\n\nexport const FOOTER_COLUMNS_FIELD = \"@bison-lab/payload-blocks/admin#FooterColumnsField\";\n\ninterface FooterLinkRow {\n label?: string | null;\n type?: \"page\" | \"external\" | null;\n page?: unknown;\n href?: string | null;\n}\n\ninterface FooterSectionRow {\n heading?: string | null;\n links?: FooterLinkRow[] | null;\n}\n\ninterface FooterColumnRow {\n desktop?: FooterColumnWidth | null;\n sections?: FooterSectionRow[] | null;\n}\n\nfunction evenDesktop(count: number): FooterColumnWidth[] {\n return (\n {\n 1: [\"100\"],\n 2: [\"50\", \"50\"],\n 3: [\"33\", \"33\", \"33\"],\n 4: [\"25\", \"25\", \"25\", \"25\"],\n } as Record<number, FooterColumnWidth[]>\n )[count] ?? [];\n}\n\n/** Even split for the current link-column count. Used by the kit editor. */\nexport function normalizeFooterDesktop(count: number): FooterColumnWidth[] {\n return evenDesktop(count);\n}\n\n/**\n * Desktop tracks: the logo keeps its own percent; link columns share the\n * remaining `1fr` and are themselves percent of that leftover, not of the\n * full footer.\n */\nexport function footerDesktopTracks(\n brand: FooterColumnWidth | null | undefined,\n columns: Array<FooterColumnWidth | null | undefined>,\n): {\n brandPercent: string;\n brandTemplate: string;\n linksTemplate: string;\n} {\n const width = brand && brand in FOOTER_TWELFTHS ? brand : \"25\";\n const brandPercent = `${width}%`;\n const links = columns.map((column) => `${column && column in FOOTER_TWELFTHS ? column : \"25\"}%`);\n return {\n brandPercent,\n brandTemplate: `${brandPercent} minmax(0,1fr)`,\n linksTemplate: links.join(\" \") || \"1fr\",\n };\n}\n\nfunction linkHasDestination(link: FooterLinkRow): boolean {\n if (link.type === \"external\") return isValidExternalHref(link.href);\n if (link.type === \"page\") return link.page != null && link.page !== \"\";\n if (String(link.href ?? \"\").trim()) return isValidExternalHref(link.href);\n return link.page != null && link.page !== \"\";\n}\n\n/**\n * Link-column widths must add to 100% of the space beside the logo. The\n * logo width is independent. Each section needs a labeled destination\n * before publish. Draft saves skip field validation. A footer with only\n * the logo column is valid.\n */\nexport const validateFooterColumns: ArrayFieldValidation = (value) => {\n const columns = (Array.isArray(value) ? value : []) as FooterColumnRow[];\n if (columns.length > FOOTER_MAX_LINK_COLUMNS) {\n return \"No more than three link columns. The logo column is always first.\";\n }\n\n if (columns.length === 0) return true;\n\n const twelfths = columns.reduce((sum, row) => sum + FOOTER_TWELFTHS[row?.desktop ?? \"100\"], 0);\n if (twelfths !== 12) {\n const percent = Math.round((twelfths / 12) * 100);\n return `Desktop column widths add up to ${percent}%. They need to add up to 100% of the space beside the logo.`;\n }\n\n for (const [columnIndex, column] of columns.entries()) {\n const sections = column.sections ?? [];\n if (sections.length === 0) {\n return `Column ${columnIndex + 1} needs at least one section.`;\n }\n for (const [sectionIndex, section] of sections.entries()) {\n if (!String(section.heading ?? \"\").trim()) {\n return `Column ${columnIndex + 1}, section ${sectionIndex + 1} needs a section label.`;\n }\n const links = section.links ?? [];\n if (links.length === 0) {\n return `Column ${columnIndex + 1}, section ${sectionIndex + 1} needs at least one link.`;\n }\n for (const [linkIndex, link] of links.entries()) {\n if (!String(link.label ?? \"\").trim()) {\n return `Column ${columnIndex + 1}, section ${sectionIndex + 1}, link ${linkIndex + 1} needs a label.`;\n }\n if (!linkHasDestination(link)) {\n const href = String(link.href ?? \"\").trim();\n if (href && validateExternalHref(href) !== true) {\n return `Column ${columnIndex + 1}, section ${sectionIndex + 1}, link ${linkIndex + 1} needs a valid URL.`;\n }\n return `Column ${columnIndex + 1}, section ${sectionIndex + 1}, link ${linkIndex + 1} needs a destination.`;\n }\n }\n }\n }\n\n return true;\n};\n\nexport function validateFooterSocialUrl(value: unknown): true | string {\n const raw = String(value ?? \"\").trim();\n if (!raw) return true;\n try {\n const url = new URL(raw);\n if (url.protocol === \"http:\" || url.protocol === \"https:\") return true;\n } catch {\n // not a URL\n }\n return \"Must be a valid http(s) URL.\";\n}\n\nfunction socialFields(): TextField[] {\n return FOOTER_SOCIALS.map((name) => ({\n name,\n type: \"text\",\n label: FOOTER_SOCIAL_LABELS[name],\n validate: validateFooterSocialUrl,\n }));\n}\n\nexport function footerColumnsField({\n pagesCollection,\n}: {\n pagesCollection?: string;\n} = {}): ArrayField {\n return {\n name: \"columns\",\n type: \"array\",\n dbName: \"c\",\n labels: { singular: \"Column\", plural: \"Columns\" },\n maxRows: FOOTER_MAX_LINK_COLUMNS,\n validate: validateFooterColumns,\n admin: {\n description:\n \"Logo column plus up to three link columns. Link-column widths add up to 100% of the space beside the logo.\",\n },\n fields: [\n {\n name: \"desktop\",\n type: \"select\",\n label: \"Desktop width\",\n defaultValue: \"25\",\n required: true,\n options: FOOTER_COLUMN_WIDTHS.map((value) => ({ label: `${value}%`, value })),\n },\n {\n name: \"sections\",\n type: \"array\",\n dbName: \"s\",\n labels: { singular: \"Section\", plural: \"Sections\" },\n minRows: 1,\n fields: [\n {\n name: \"heading\",\n type: \"text\",\n localized: true,\n label: \"Section Label\",\n required: true,\n },\n {\n name: \"links\",\n type: \"array\",\n labels: { singular: \"Link\", plural: \"Links\" },\n minRows: 1,\n fields: footerLinkFields({ required: true, pagesCollection }),\n },\n ],\n },\n ],\n };\n}\n\nexport function footerBrandField(): GroupField {\n return {\n name: \"brand\",\n type: \"group\",\n label: \"Brand & social\",\n fields: [\n {\n name: \"desktop\",\n type: \"select\",\n label: \"Desktop width\",\n defaultValue: \"25\",\n required: true,\n options: FOOTER_COLUMN_WIDTHS.map((value) => ({ label: `${value}%`, value })),\n },\n {\n name: \"tagline\",\n type: \"textarea\",\n localized: true,\n label: \"Text below the logo\",\n },\n ...socialFields(),\n ],\n };\n}\n\nexport function footerFields(options: { pagesCollection?: string } = {}): Field[] {\n return [footerColumnsField(options), footerBrandField()];\n}\n","import { localeArgs } from \"../locale\";\nimport {\n NAVIGATION_FOOTER_SLUG,\n NAVIGATION_SLUG,\n type GetNavigationArgs,\n type NavigationBar,\n type NavigationDoc,\n type NavigationFooter,\n type NavigationHeader,\n} from \"./types\";\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" ? (value as Record<string, unknown>) : null;\n}\n\nfunction headerOf(doc: unknown): NavigationHeader {\n const record = asRecord(doc);\n const header = record && \"header\" in record ? asRecord(record.header) : null;\n return header ?? {};\n}\n\nfunction footerOf(doc: unknown): NavigationFooter {\n const record = asRecord(doc);\n const footer = record && \"footer\" in record ? asRecord(record.footer) : null;\n return footer ?? {};\n}\n\nfunction barOf(doc: unknown): NavigationBar {\n const record = asRecord(doc);\n const bar = record && \"bar\" in record ? asRecord(record.bar) : null;\n return bar ?? {};\n}\n\n/**\n * Reads Header and Footer and returns one `{ header, footer, bar }`. A\n * site header does not learn two slugs. `bar` is the hidden Header group\n * (hide on scroll, viewport, default panel width). `draft: true`\n * reads the newest version; omit it (or pass false) for the published\n * documents. A multi-locale site passes the request's `locale` (and\n * `fallbackLocale`), so the labels and footer copy read in that locale.\n */\nexport async function getNavigation({\n payload,\n draft = false,\n ...read\n}: GetNavigationArgs): Promise<NavigationDoc> {\n const locale = localeArgs(read);\n const [headerDoc, footerDoc] = await Promise.all([\n payload.findGlobal({ slug: NAVIGATION_SLUG, draft, depth: 1, ...locale }),\n payload.findGlobal({ slug: NAVIGATION_FOOTER_SLUG, draft, depth: 1, ...locale }),\n ]);\n return { header: headerOf(headerDoc), footer: footerOf(footerDoc), bar: barOf(headerDoc) };\n}\n"],"mappings":";;AAaA,MAAa,kBAAkB;AAC/B,MAAa,qBAAqB;AAClC,MAAa,yBAAyB;A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,SACjD,EAAE;;;;;;;;;;AAWlB,eAAsB,cAAc,EAClC,SACA,QAAQ,OACR,GAAG,QACyC;CAC5C,MAAM,SAAS,WAAW,KAAK;CAC/B,MAAM,CAAC,WAAW,aAAa,MAAM,QAAQ,IAAI,CAC/C,QAAQ,WAAW;EAAE,MAAM;EAAiB;EAAO,OAAO;EAAG,GAAG;EAAQ,CAAC,EACzE,QAAQ,WAAW;EAAE,MAAM;EAAwB;EAAO,OAAO;EAAG,GAAG;EAAQ,CAAC,CACjF,CAAC;AACF,QAAO;EAAE,QAAQ,SAAS,UAAU;EAAE,QAAQ,SAAS,UAAU;EAAE,KAAK,MAAM,UAAU;EAAE"}
@@ -1,4 +1,4 @@
1
- import { t as LocaleRead } from "./locale-CxFNy8ex.mjs";
1
+ import { t as LocaleRead } from "./locale-CWiIcGuU.mjs";
2
2
  import { ArrayFieldValidation, Block, Field, GlobalConfig } from "payload";
3
3
 
4
4
  //#region src/navigation/types.d.ts
@@ -61,10 +61,10 @@ interface GetNavigationArgs extends LocaleRead {
61
61
  //#endregion
62
62
  //#region src/navigation/link.d.ts
63
63
  type LinkType = "page" | "external";
64
- declare const EXTERNAL_HREF_MESSAGE = "Enter a valid URL (https://\u2026), a mailto: or tel: link, or a site path starting with /.";
64
+ declare const EXTERNAL_HREF_MESSAGE = "Enter a valid URL (https://\u2026), a mailto: or tel: link, a site path starting with /, or a #anchor on the same page.";
65
65
  /**
66
66
  * What the picker will store as an external destination: http(s) with a
67
- * host, mailto:/tel: with a value, or an in-site path. Rejects a bare
67
+ * host, mailto:/tel: with a value, an in-site path, or a same-page #anchor. Rejects a bare
68
68
  * host, protocol-relative URLs, and anything that is not a link.
69
69
  */
70
70
  declare function isValidExternalHref(value: unknown): boolean;
@@ -137,4 +137,4 @@ declare function getNavigation({
137
137
  }: GetNavigationArgs): Promise<NavigationDoc>;
138
138
  //#endregion
139
139
  export { NAVIGATION_FOOTER_SLUG as C, NavigationFooter as D, NavigationDoc as E, NavigationHeader as O, NAVIGATION_FOOTER_DB_NAME as S, NavigationBar as T, validateExternalHref as _, FOOTER_MAX_LINK_COLUMNS as a, NAVIGATION_DB_NAME as b, FooterColumnWidth as c, normalizeFooterDesktop as d, validateFooterColumns as f, isValidExternalHref as g, headerCtaEnabled as h, FOOTER_MAX_COLUMNS as i, FooterSocial as l, EXTERNAL_HREF_MESSAGE as m, FOOTER_COLUMNS_FIELD as n, FOOTER_SOCIALS as o, validateFooterSocialUrl as p, FOOTER_COLUMN_WIDTHS as r, FOOTER_TWELFTHS as s, getNavigation as t, footerDesktopTracks as u, validateHeaderCta as v, NAVIGATION_SLUG as w, NAVIGATION_FEATURE as x, CreateNavigationOptions as y };
140
- //# sourceMappingURL=published-B3IYStMQ.d.mts.map
140
+ //# sourceMappingURL=published-DXjnElZn.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-DXjnElZn.d.mts","names":[],"sources":["../src/navigation/types.ts","../src/navigation/link.ts","../src/navigation/footer.ts","../src/navigation/published.ts"],"mappings":";;;;cAaa,eAAA;AAAA,cACA,kBAAA;AAAA,cACA,sBAAA;AAAA,cACA,yBAAA;AAAA,cAEA,kBAAA;AAAA,UAEI,uBAAA;;;;AAJjB;EASE,MAAA,EAAQ,KAAA;;;;AAPV;EAYE,OAAA,GAAU,WAAA,CAAY,WAAA,CAAY,YAAA;EAClC,WAAA,GAAc,WAAA,CAAY,WAAA,CAAY,YAAA;EAbT;;AAE/B;;EAgBE,aAAA;EAXQ;EAaR,eAAA;EARsB;EAUtB,mBAAA;AAAA;AAAA,UAGe,gBAAA;EACf,KAAA;EACA,GAAA;AAAA;AAAA,UAGe,aAAA;EACf,YAAA;EACA,QAAA;EACA,eAAA;AAAA;AAAA,UAGe,gBAAA;EACf,OAAA;EACA,KAAA;AAAA;AAAA,UAGe,aAAA;EACf,MAAA,EAAQ,gBAAA;EACR,MAAA,EAAQ,gBAAA;EACR,GAAA,EAAK,aAAA;AAAA;AAAA,UAGU,iBAAA,SAA0B,UAAA;EACzC,OAAA;IACE,UAAA,GAAa,IAAA;MACX,IAAA;MACA,KAAA;MACA,cAAA;MACA,KAAA;IAAA,MACI,OAAA;EAAA;EAER,KAAA;AAAA;;;KChEG,QAAA;AAAA,cAaQ,qBAAA;;ADVb;;;;iBCoBgB,mBAAA,CAAoB,KAAA;AAAA,iBAgBpB,oBAAA,CAAqB,KAAA,WAAgB,QAAA;AAAA,UAyFpC,cAAA;EACf,OAAA;EACA,IAAA,GAAO,QAAA;EACP,IAAA;EACA,IAAA;EACA,KAAA;AAAA;;iBAIc,gBAAA,CAAiB,GAAA,EAAK,cAAA;ADnItC;;;;AAAA,iBC8IgB,iBAAA,CAAkB,KAAA;;;;;;ADjJlC;cELa,oBAAA;AAAA,KACD,iBAAA,WAA4B,oBAAA;;cAG3B,kBAAA;AFEb;AAAA,cEAa,uBAAA;AAAA,cAEA,cAAA;AAAA,KACD,YAAA,WAAuB,cAAA;;cAWtB,eAAA,EAAiB,MAAA,CAAO,iBAAA;AAAA,cASxB,oBAAA;;iBA+BG,sBAAA,CAAuB,KAAA,WAAgB,iBAAA;;AFpDvD;;;;iBE6DgB,mBAAA,CACd,KAAA,EAAO,iBAAA,qBACP,OAAA,EAAS,KAAA,CAAM,iBAAA;EAEf,YAAA;EACA,aAAA;EACA,aAAA;AAAA;;AF/DF;;;;;cEwFa,qBAAA,EAAuB,oBAAA;AAAA,iBA6CpB,uBAAA,CAAwB,KAAA;;;;;;AF5IxC;;;;;iBG4BsB,aAAA,CAAA;EACpB,OAAA;EACA,KAAA;EAAA,GACG;AAAA,GACF,iBAAA,GAAoB,OAAA,CAAQ,aAAA"}
@@ -1,5 +1,5 @@
1
- import { _ as ThemeIdentityFallback, d as ThemeDoc, g as ResolvedThemeIdentity } from "./types-B7Hy1Ho-.mjs";
2
- import { t as LocaleRead } from "./locale-CxFNy8ex.mjs";
1
+ import { _ as ThemeIdentityFallback, d as ThemeDoc, g as ResolvedThemeIdentity } from "./types-Db6Iy3hJ.mjs";
2
+ import { t as LocaleRead } from "./locale-CWiIcGuU.mjs";
3
3
  import { ThemeConfig } from "@bison-lab/tokens";
4
4
 
5
5
  //#region src/theme/published.d.ts
@@ -27,4 +27,4 @@ declare function getPublishedTheme(payload: ThemePayload, seed: ThemeConfig): Pr
27
27
  declare function getPublishedIdentity(payload: ThemePayload, fallback?: ThemeIdentityFallback, read?: LocaleRead): Promise<ResolvedThemeIdentity>;
28
28
  //#endregion
29
29
  export { getPublishedIdentity as n, getPublishedTheme as r, ThemePayload as t };
30
- //# sourceMappingURL=published-Cow49CSZ.d.mts.map
30
+ //# sourceMappingURL=published-_1rrTj_B.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"published-Cow49CSZ.d.mts","names":[],"sources":["../src/theme/published.ts"],"mappings":";;;;;UAQiB,YAAA;EAIf,UAAA,GAAa,IAAA;IACX,IAAA;IACA,KAAA;IACA,KAAA;IACA,cAAA;EAAA,MACI,OAAA,CAAQ,QAAA;AAAA;;;;;;iBAQM,iBAAA,CAAkB,OAAA,EAAS,YAAA,EAAc,IAAA,EAAM,WAAA,GAAc,OAAA,CAAQ,WAAA;;AAA3F;;;;;;iBAiBsB,oBAAA,CACpB,OAAA,EAAS,YAAA,EACT,QAAA,GAAW,qBAAA,EACX,IAAA,GAAM,UAAA,GACL,OAAA,CAAQ,qBAAA"}
1
+ {"version":3,"file":"published-_1rrTj_B.d.mts","names":[],"sources":["../src/theme/published.ts"],"mappings":";;;;;UAQiB,YAAA;EAIf,UAAA,GAAa,IAAA;IACX,IAAA;IACA,KAAA;IACA,KAAA;IACA,cAAA;EAAA,MACI,OAAA,CAAQ,QAAA;AAAA;;;;;;iBAQM,iBAAA,CAAkB,OAAA,EAAS,YAAA,EAAc,IAAA,EAAM,WAAA,GAAc,OAAA,CAAQ,WAAA;;AAA3F;;;;;;iBAiBsB,oBAAA,CACpB,OAAA,EAAS,YAAA,EACT,QAAA,GAAW,qBAAA,EACX,IAAA,GAAM,UAAA,GACL,OAAA,CAAQ,qBAAA"}
@@ -1,2 +1,2 @@
1
- import { n as facetField, t as FacetEntry } from "./facet-field-CZbLDAQz.mjs";
1
+ import { n as facetField, t as FacetEntry } from "./facet-field-DjaZ0C7D.mjs";
2
2
  export { type FacetEntry, facetField };
package/dist/theme.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as ThemeIdentityFallback, c as THEME_SLUG, d as ThemeDoc, f as ThemeHead, g as ResolvedThemeIdentity, h as ThemeUploadDoc, i as SystemColorKey, m as ThemeLibraryColorDoc, n as EditableTheme, p as ThemeHeadOptions, r as SYSTEM_COLOR_KEYS, t as CreateThemeOptions, u as ThemeColorDoc, v as resolveThemeIdentity } from "./types-B7Hy1Ho-.mjs";
2
- import { _ as deleteLibraryColor, a as PageEditorSystemKey, c as pageEditorTokens, 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, v as rewriteColorToken, y as themeColorKeys } from "./preview-v-GlYuqa.mjs";
3
- import { t as LocaleRead } from "./locale-CxFNy8ex.mjs";
4
- import { n as getPublishedIdentity, r as getPublishedTheme } from "./published-Cow49CSZ.mjs";
1
+ import { _ as ThemeIdentityFallback, c as THEME_SLUG, d as ThemeDoc, f as ThemeHead, g as ResolvedThemeIdentity, h as ThemeUploadDoc, i as SystemColorKey, m as ThemeLibraryColorDoc, n as EditableTheme, p as ThemeHeadOptions, r as SYSTEM_COLOR_KEYS, t as CreateThemeOptions, u as ThemeColorDoc, v as resolveThemeIdentity } from "./types-Db6Iy3hJ.mjs";
2
+ import { _ as deleteLibraryColor, a as PageEditorSystemKey, c as pageEditorTokens, 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, v as rewriteColorToken, y as themeColorKeys } from "./preview-CNBVfmM7.mjs";
3
+ import { t as LocaleRead } from "./locale-CWiIcGuU.mjs";
4
+ import { n as getPublishedIdentity, r as getPublishedTheme } from "./published-_1rrTj_B.mjs";
5
5
  import { ShadeStep, ThemeConfig } from "@bison-lab/tokens";
6
6
 
7
7
  //#region src/theme/map.d.ts