@riverbankcms/sdk 0.135.1 → 0.137.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 (220) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/README.md +4 -8
  3. package/dist/{PreviewEditorSidebar-D4p_5TdY.mjs → PreviewEditorSidebar-Bn6cONPa.mjs} +8 -8
  4. package/dist/{PreviewEditorUI-D0cRoTX1.mjs → PreviewEditorUI-LAwXZPSx.mjs} +3 -3
  5. package/dist/{PreviewQueryProvider-DcgaESkm.mjs → PreviewQueryProvider-ztQUdsNo.mjs} +1 -1
  6. package/dist/{SdkPreviewModeRuntime-BKLtM3Nz.mjs → SdkPreviewModeRuntime-BbbGsI_v.mjs} +621 -238
  7. package/dist/{SiteChromeCustomizeContext-61X2m7QV.mjs → SiteChromeCustomizeContext-BbkNSt5a.mjs} +5041 -2407
  8. package/dist/_dts/ai/src/contracts/proposals.d.ts +18 -850
  9. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +412 -2316
  10. package/dist/_dts/ai/src/designer/themePatch.d.ts +5 -10
  11. package/dist/_dts/api/src/accessAdmin.d.ts +1 -9
  12. package/dist/_dts/api/src/accountApi.d.ts +49 -2
  13. package/dist/_dts/api/src/contentRuntime.d.ts +7 -4
  14. package/dist/_dts/api/src/domainConnection.d.ts +41 -0
  15. package/dist/_dts/api/src/endpoints.d.ts +201 -181
  16. package/dist/_dts/api/src/index.d.ts +5 -3
  17. package/dist/_dts/api/src/media.d.ts +19 -2
  18. package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +7 -0
  19. package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +26 -0
  20. package/dist/_dts/api/src/sdkBlockContentAdmission.d.ts +5 -0
  21. package/dist/_dts/api/src/sdkContracts.d.ts +2 -15
  22. package/dist/_dts/api/src/sdkMediaContracts.d.ts +40 -0
  23. package/dist/_dts/api/src/sdkMediaEndpointDefinitions.d.ts +61 -0
  24. package/dist/_dts/api/src/sdkThemeWire.d.ts +21 -436
  25. package/dist/_dts/api/src/siteInfrastructure.d.ts +17 -23
  26. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +7 -21
  27. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +27 -3
  28. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +37 -17
  29. package/dist/_dts/api/src/types.d.ts +1 -1
  30. package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +2 -3
  31. package/dist/_dts/block-form/src/utils/slug.d.ts +6 -0
  32. package/dist/_dts/blocks/src/PageRenderer.d.ts +13 -7
  33. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +48 -0
  34. package/dist/_dts/blocks/src/definitions.d.ts +14 -0
  35. package/dist/_dts/blocks/src/index.d.ts +4 -3
  36. package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +49 -0
  37. package/dist/_dts/blocks/src/pageRendererBlockSupport.d.ts +75 -0
  38. package/dist/_dts/blocks/src/pageRendererBoundaries.d.ts +2 -0
  39. package/dist/_dts/blocks/src/server.d.ts +2 -2
  40. package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -1
  41. package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
  42. package/dist/_dts/blocks/src/system/data/publicLoaderCachePolicy.d.ts +78 -0
  43. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +2 -18
  44. package/dist/_dts/blocks/src/system/manifest/validation.d.ts +103 -16
  45. package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
  46. package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +4 -2
  47. package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
  48. package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
  49. package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +19 -0
  50. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +52 -0
  51. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
  52. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +47 -21
  53. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +38 -9
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/ErrorStep.d.ts +3 -5
  55. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +3 -1
  56. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -0
  57. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +1 -1
  58. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +2 -0
  59. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorPresentation.d.ts +5 -0
  60. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +25 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.d.ts +4 -0
  62. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +8 -3
  63. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -0
  64. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +5 -2
  65. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useWaitlistClaimRestoration.d.ts +2 -0
  66. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.client.d.ts +2 -2
  67. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +40 -0
  68. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -0
  69. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +43 -0
  70. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/capacity.d.ts +164 -0
  71. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/cta.d.ts +29 -0
  72. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +47 -0
  73. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/index.d.ts +14 -0
  74. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/people.d.ts +6 -0
  75. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/pricing.d.ts +31 -0
  76. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayCell.d.ts +3 -1
  77. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.d.ts +4 -0
  78. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
  79. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModalContext.d.ts +3 -2
  80. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/OfferingTitle.d.ts +11 -0
  81. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +4 -1
  82. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekBoardView.d.ts +31 -3
  83. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +3 -1
  84. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +9 -1
  85. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/index.d.ts +3 -1
  86. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listingLayout.d.ts +23 -0
  87. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +4 -3
  88. package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -1
  89. package/dist/_dts/calendar/src/grid.d.ts +24 -66
  90. package/dist/_dts/calendar/src/index.d.ts +2 -2
  91. package/dist/_dts/calendar/src/timetable.d.ts +5 -9
  92. package/dist/_dts/commerce/src/purchase/allocation.d.ts +11 -0
  93. package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +57 -0
  94. package/dist/_dts/commerce/src/purchase/index.d.ts +3 -0
  95. package/dist/_dts/commerce/src/purchase/settlement.d.ts +33 -0
  96. package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +8 -0
  97. package/dist/_dts/content-model/src/templates/defaults.d.ts +6 -0
  98. package/dist/_dts/core/src/slug.d.ts +20 -5
  99. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +8 -40
  100. package/dist/_dts/db/src/index.d.ts +1 -0
  101. package/dist/_dts/db/src/utils/postgrestFilter.d.ts +2 -0
  102. package/dist/_dts/media-core/src/bulkDeletePlanning.d.ts +4 -0
  103. package/dist/_dts/media-core/src/fileDomain.d.ts +3 -0
  104. package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +1 -1
  105. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -0
  106. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
  107. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -2
  108. package/dist/_dts/preview-next/src/client/preview/headerInteractionPaletteSurfaceState.d.ts +2 -1
  109. package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +1 -1
  110. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +2 -0
  111. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlSaveRequest.d.ts +51 -0
  112. package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +24 -2
  113. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +23 -1
  114. package/dist/_dts/preview-next/src/client/preview/usePersistedHeaderPreferences.d.ts +8 -0
  115. package/dist/_dts/sdk/src/client/publicLoaderCacheAccess.d.ts +6 -0
  116. package/dist/_dts/sdk/src/public-api/contracts.d.ts +7 -2
  117. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +10 -6
  118. package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +0 -1
  119. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -4
  120. package/dist/_dts/sdk/src/rendering/helpers/footerPageOutline.d.ts +3 -0
  121. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +3 -0
  122. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  123. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +17 -0
  124. package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +9 -3
  125. package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +1 -1
  126. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -2
  127. package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +7 -4
  128. package/dist/_dts/sdk/src/version.d.ts +1 -1
  129. package/dist/_dts/theme-core/src/cards/types.d.ts +8 -8
  130. package/dist/_dts/theme-core/src/data.d.ts +12 -0
  131. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  132. package/dist/_dts/theme-core/src/gradients/types.d.ts +5 -0
  133. package/dist/_dts/theme-core/src/header/interactionPalette.d.ts +25 -2
  134. package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +2 -6
  135. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -810
  136. package/dist/_dts/theme-core/src/schema.d.ts +460 -1285
  137. package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +43 -3
  138. package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +223 -1
  139. package/dist/_dts/theme-core/src/site-styles/headerBrandPresentation.d.ts +63 -0
  140. package/dist/_dts/theme-core/src/site-styles/headerBytesComparison.d.ts +30 -0
  141. package/dist/_dts/theme-core/src/site-styles/headerInteractionPalette.d.ts +50 -1
  142. package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +48 -38
  143. package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +10 -0
  144. package/dist/_dts/theme-core/src/site-styles/headerLayoutTypes.d.ts +8 -5
  145. package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +4 -4
  146. package/dist/_dts/theme-core/src/site-styles/headerPreferences.d.ts +162 -0
  147. package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +73 -0
  148. package/dist/_dts/theme-core/src/site-styles/headerRecompile.d.ts +118 -0
  149. package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +25 -2
  150. package/dist/_dts/theme-core/src/site-styles/headerStyleDefaults.d.ts +465 -0
  151. package/dist/_dts/theme-core/src/site-styles/headerStyleRecipe.d.ts +168 -0
  152. package/dist/_dts/theme-core/src/site-styles/index.d.ts +5 -0
  153. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
  154. package/dist/_dts/theme-core/src/site-styles/siteChromeBackgrounds.d.ts +20 -1
  155. package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +43 -2
  156. package/dist/client/{BookingConsentAgreement-Bz9znbpn.mjs → BookingConsentAgreement--_fUCZe-.mjs} +2 -2
  157. package/dist/client/{DiscountCodeDisclosure-35Ru8yB9.mjs → DiscountCodeDisclosure-BMipSoDJ.mjs} +1 -1
  158. package/dist/client/{EventCombined.client-BKB0ZxRR.mjs → EventCombined.client-CwJOxn7A.mjs} +274 -278
  159. package/dist/client/{EventListing.client-Dx8I21ok.mjs → EventListing.client-eVwiylPW.mjs} +2 -2
  160. package/dist/client/{LeafletStaticMap-CEWx-Bhe.mjs → LeafletStaticMap-IKenna5u.mjs} +1 -1
  161. package/dist/client/{accordion-KIDsKTwS.mjs → accordion-MGAO3PuE.mjs} +1 -1
  162. package/dist/client/{bookingForm-D96Rmp-5.mjs → bookingForm-CudlQPUu.mjs} +5 -5
  163. package/dist/client/bookings.mjs +476 -98
  164. package/dist/client/capacity-BW00PO7s.mjs +271 -0
  165. package/dist/client/{carousel-YwUgyL66.mjs → carousel-BrbGJ2Jl.mjs} +1 -1
  166. package/dist/client/{cart-BbwuNrUT.mjs → cart-Bq5eU0xZ.mjs} +3 -3
  167. package/dist/client/{checkout-hp1ucmEY.mjs → checkout-BAFVRdrK.mjs} +3 -3
  168. package/dist/client/client.mjs +4641 -2721
  169. package/dist/client/{context-DljQn8L5.mjs → context-DCkiHVdD.mjs} +20 -5
  170. package/dist/client/dates-2RPXHQy4.mjs +264 -0
  171. package/dist/client/{eventCalendar-DU4iNLpo.mjs → eventCalendar-B0O-hPF7.mjs} +261 -126
  172. package/dist/client/{eventCombined-CZuupW8m.mjs → eventCombined-DCkDaoDI.mjs} +3 -3
  173. package/dist/client/{eventDetails-DPQWwCIi.mjs → eventDetails-D8GG2dnD.mjs} +7 -4
  174. package/dist/client/{eventListing-C7oMidwS.mjs → eventListing-3ssV_bxz.mjs} +3 -3
  175. package/dist/client/{eventRegistration-zEiunlUs.mjs → eventRegistration-bPQo3kVw.mjs} +610 -313
  176. package/dist/client/{form-D2KIyCVJ.mjs → form-qMv8RDkk.mjs} +2 -2
  177. package/dist/client/{headerSection-CK5uChUK.mjs → headerSection-CH0Sc5hX.mjs} +2 -2
  178. package/dist/client/hooks.mjs +2514 -308
  179. package/dist/client/{locationMap-DLQNH1ln.mjs → locationMap-0_xlBnNI.mjs} +2 -2
  180. package/dist/client/{newsletterForm-ZuhIG7fZ.mjs → newsletterForm-NUW7m9RI.mjs} +2 -2
  181. package/dist/client/{productDetail-7hIcGeae.mjs → productDetail-FBEOM7jW.mjs} +3 -3
  182. package/dist/client/{productList-T4Cii1ot.mjs → productList-R0OSGhnn.mjs} +3 -3
  183. package/dist/client/{propsDecoder-mB0aC_Fi.mjs → propsDecoder-pYvx_Srl.mjs} +179 -401
  184. package/dist/client/rendering/client.mjs +3496 -2223
  185. package/dist/client/rendering/islands.mjs +17 -17
  186. package/dist/client/rendering.mjs +4400 -2510
  187. package/dist/client/{scrollToBlock-Du5mHgvL.mjs → scrollToBlock-ByQv96M2.mjs} +1 -1
  188. package/dist/client/{shop-B5zAcKZn.mjs → shop-RUG9DmRE.mjs} +6 -6
  189. package/dist/client/{shop-commerce-BKBZB6l5.mjs → shop-commerce-B76Jz23B.mjs} +5 -5
  190. package/dist/client/{shop-commerce-store-Cq4qlNtQ.mjs → shop-commerce-store-QuQNdDsD.mjs} +1 -1
  191. package/dist/client/{shopShared-DYGzEs9D.mjs → shopShared-vXU1omwJ.mjs} +3 -3
  192. package/dist/client/{useEventFilters-Bphkda8m.mjs → useEventFilters-ByuU6HLA.mjs} +33 -18
  193. package/dist/preview-next/before-render.mjs +86 -51
  194. package/dist/preview-next/client/runtime.mjs +4 -4
  195. package/dist/preview-next/keepAlive.mjs +86 -51
  196. package/dist/preview-next/middleware.mjs +86 -51
  197. package/dist/{previewAuthStore-C7ksxt5b.mjs → previewAuthStore-L_cKW8Sb.mjs} +86 -51
  198. package/dist/{sdk-runtime-BbIC8G4J.mjs → sdk-runtime-sUMr5d70.mjs} +2 -2
  199. package/dist/{separator-CadhAtI7.mjs → separator-BIHkie5i.mjs} +1 -1
  200. package/dist/server/components.mjs +4397 -2960
  201. package/dist/server/config-validation.mjs +354 -145
  202. package/dist/server/config.mjs +354 -145
  203. package/dist/server/data.mjs +354 -144
  204. package/dist/server/index.mjs +201 -55
  205. package/dist/server/manifest.mjs +0 -1
  206. package/dist/server/next.mjs +4046 -2611
  207. package/dist/server/page-converter.mjs +225 -122
  208. package/dist/server/prebuild.mjs +1 -1
  209. package/dist/server/rendering/server.mjs +4105 -2636
  210. package/dist/server/rendering.mjs +4522 -3087
  211. package/dist/server/routing.mjs +3289 -1637
  212. package/dist/server/server.mjs +23175 -21079
  213. package/dist/server/theme-bridge.mjs +708 -272
  214. package/dist/server/theme.mjs +29 -25
  215. package/dist/styles/index.css +624 -181
  216. package/package.json +1 -1
  217. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCapacity.d.ts +0 -48
  218. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +0 -17
  219. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +0 -100
  220. /package/dist/_dts/blocks/src/system/runtime/nodes/events/{shared → domain}/destination.d.ts +0 -0
@@ -1,18 +1,57 @@
1
- import type { Theme } from '../schema';
2
- import { type HeaderBrandPresentationPlan, type HeaderBrandPresentationSelection, type LogoAccommodationOption } from './logoBranding';
3
- import { type HeaderLayoutId, type HeaderLogoContext, type HeaderStyleId } from './headerLayoutTypes';
1
+ import { type HeaderBrandPresentationPlan, type HeaderBrandPresentationSelection, type BrandDisplayMode, type LogoAccommodationOption, type LogoAccommodationPattern, type LogoSizePolicy } from './logoBranding';
2
+ import { type HeaderLayoutId, type HeaderLogoContext, type HeaderLogoDimensions, type HeaderLogoShape, type HeaderStyleId } from './headerLayoutTypes';
3
+ export declare function logoAccommodationProvidesBacking(pattern: LogoAccommodationPattern): boolean;
4
+ export type HeaderLogoAsset = Readonly<{
5
+ /** The site's stored logo, or `null` when it has none. */
6
+ asset: HeaderLogoDimensions | null;
7
+ /** The accommodation the row currently persists, if any. */
8
+ accommodation: LogoAccommodationPattern | undefined;
9
+ }>;
10
+ /**
11
+ * The single answer to "what shape is this site's logo" (#1318 Phase 4b).
12
+ *
13
+ * The server and the public frontend each had their own copy of this, and they
14
+ * disagreed on the one case that matters: a logo whose dimensions are unknown.
15
+ * The server assumed `horizontal`; the frontend asked whether the persisted
16
+ * accommodation brings its own backing and answered `square` if it does. The
17
+ * richer rule is the correct one — a badge or masthead accommodation is
18
+ * evidence about the asset that raw dimensions would otherwise supply — and it
19
+ * reduces to `horizontal` whenever there is no backing, so it subsumes the
20
+ * server's rule rather than contradicting it. The backing question goes through
21
+ * `logoAccommodationProvidesBacking`, so the pattern list has one home.
22
+ */
23
+ export declare function deriveHeaderLogoShape({ asset, accommodation, }: HeaderLogoAsset): HeaderLogoShape;
24
+ /**
25
+ * The site's logo as the header pipeline sees it, from the two database values
26
+ * that describe it: the asset (or its absence) and the accommodation the row
27
+ * currently persists, which is evidence about the asset when its dimensions are
28
+ * missing.
29
+ *
30
+ * One definition, shared by every shell that has to answer it — the dashboard's
31
+ * `loadHeaderLogoContextForSite`, the public frontend, and the Phase 4c repair
32
+ * generator — because a second copy is a second answer to "what shape is this
33
+ * site's logo", and the two former copies disagreed on exactly the case this
34
+ * one is careful about (#1318 Phase 4b/4c).
35
+ */
36
+ export declare function headerLogoShapeContext(input: HeaderLogoAsset & Readonly<{
37
+ /**
38
+ * The brand half of the preference record, when the caller holds one.
39
+ * Both members are optional because the public frontend reads them off
40
+ * the persisted header, where either can be absent; an absent one is left
41
+ * off the context rather than written as `undefined`, so the resolver's
42
+ * own `?? 'auto'` still decides.
43
+ */
44
+ brand?: Readonly<{
45
+ brandDisplay?: BrandDisplayMode;
46
+ logoSize?: LogoSizePolicy;
47
+ }>;
48
+ }>): HeaderLogoContext;
4
49
  export declare function resolveHeaderBrandPresentation(input: Readonly<{
5
50
  logo: HeaderLogoContext;
6
51
  accommodations: readonly LogoAccommodationOption[];
7
52
  allowDisplayFallback?: boolean;
8
53
  }>): HeaderBrandPresentationPlan;
9
54
  export declare function requireHeaderBrandPresentationSelection(plan: HeaderBrandPresentationPlan): HeaderBrandPresentationSelection;
10
- /**
11
- * Starts each compilation from the generated theme's header branch, then
12
- * clears optional nested styling fields that would otherwise leak from a
13
- * different header selection.
14
- */
15
- export declare function baseHeader(theme: Theme): Theme['header'];
16
55
  export declare const headerLayoutCatalog: readonly [{
17
56
  readonly id: HeaderLayoutId;
18
57
  readonly label: "Classic";
@@ -141,101 +180,76 @@ export declare const headerStyleCatalog: readonly [{
141
180
  readonly label: "Minimal";
142
181
  readonly description: "Quiet surface with simple color-change navigation.";
143
182
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
144
- readonly navTypography: "plain";
145
183
  }, {
146
184
  readonly id: HeaderStyleId;
147
185
  readonly label: "Seamless";
148
186
  readonly description: "Borderless surface with underline hover for a quieter page transition.";
149
187
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
150
- readonly navTypography: "plain";
151
188
  }, {
152
189
  readonly id: HeaderStyleId;
153
190
  readonly label: "Soft Bar";
154
191
  readonly description: "Soft tinted surface with gentle pill hover states.";
155
192
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
156
- readonly navTypography: "plain";
157
193
  }, {
158
194
  readonly id: HeaderStyleId;
159
195
  readonly label: "Pill Nav";
160
196
  readonly description: "A calm pill navigation rail over a neutral header.";
161
197
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
162
- readonly navTypography: "plain";
163
198
  }, {
164
199
  readonly id: HeaderStyleId;
165
200
  readonly label: "Brand Bar";
166
201
  readonly description: "Solid brand surface with high-contrast navigation.";
167
202
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
168
- readonly navTypography: "brand-caps";
169
203
  }, {
170
204
  readonly id: HeaderStyleId;
171
205
  readonly label: "Brand Underline";
172
206
  readonly description: "Brand surface with underline-grow navigation.";
173
207
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
174
- readonly navTypography: "brand-caps";
175
208
  }, {
176
209
  readonly id: HeaderStyleId;
177
210
  readonly label: "Brand Pill";
178
211
  readonly description: "Solid brand surface with rounded active and hover states.";
179
212
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
180
- readonly navTypography: "brand-caps";
181
213
  }, {
182
214
  readonly id: HeaderStyleId;
183
215
  readonly label: "Brand Capsule";
184
216
  readonly description: "Solid brand chrome designed as a floating capsule, with quiet-caps nav, a soft pill active state, and an inverted CTA pill.";
185
217
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
186
- readonly navTypography: "quiet-caps";
187
218
  }, {
188
219
  readonly id: HeaderStyleId;
189
220
  readonly label: "Serif Line";
190
221
  readonly description: "Typographic logo treatment with understated underline navigation.";
191
222
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
192
- readonly navTypography: "heading";
193
223
  }, {
194
224
  readonly id: HeaderStyleId;
195
225
  readonly label: "Flat Tabs";
196
226
  readonly description: "Flat block hover and active states with a Swiss utility feel.";
197
227
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
198
- readonly navTypography: "quiet-caps";
199
228
  }, {
200
229
  readonly id: HeaderStyleId;
201
230
  readonly label: "Glass";
202
231
  readonly description: "Translucent chrome with frosted navigation backing.";
203
232
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
204
- readonly navTypography: "plain";
205
233
  }, {
206
234
  readonly id: HeaderStyleId;
207
235
  readonly label: "Clear Split";
208
236
  readonly description: "Floating logo with transparent navigation and no shared shell.";
209
237
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
210
- readonly navTypography: "plain";
211
- readonly openingForegroundTarget: "all";
212
- readonly scrollTreatment: "contrast-glass";
213
- readonly interactionPalette: Readonly<{
214
- id: "interaction-palette";
215
- label: string;
216
- options: readonly [import("../../../blocks/src/index").HeaderInteractionPaletteOption, ...import("../../../blocks/src/index").HeaderInteractionPaletteOption[]];
217
- defaultOptionId: "accent" | "primary" | "secondary";
218
- }>;
219
238
  }, {
220
239
  readonly id: HeaderStyleId;
221
240
  readonly label: "Soft Shell";
222
241
  readonly description: "Floating rounded shell with soft pill navigation states.";
223
242
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
224
- readonly navTypography: "plain";
225
243
  }, {
226
244
  readonly id: HeaderStyleId;
227
245
  readonly label: "Split Glass";
228
246
  readonly description: "Logo floats independently while the navigation sits in a glass rail.";
229
247
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
230
- readonly navTypography: "quiet-caps";
231
- readonly openingForegroundTarget: "brand-only";
232
248
  }, {
233
249
  readonly id: HeaderStyleId;
234
250
  readonly label: "Split Pill";
235
251
  readonly description: "Logo floats independently with a soft pill-backed navigation rail.";
236
252
  readonly supportedLayoutIds: readonly HeaderLayoutId[];
237
- readonly navTypography: "heading";
238
- readonly openingForegroundTarget: "brand-only";
239
253
  }];
240
254
  export declare const headerLayoutsById: Map<HeaderLayoutId, Readonly<{
241
255
  id: HeaderLayoutId;
@@ -252,10 +266,6 @@ export declare const headerStylesById: Map<HeaderStyleId, Readonly<{
252
266
  label: string;
253
267
  description: string;
254
268
  supportedLayoutIds: readonly HeaderLayoutId[];
255
- navTypography: import("../../../blocks/src/index").HeaderStyleNavTypography;
256
- openingForegroundTarget?: "brand-only" | "all";
257
- scrollTreatment?: "contrast-glass";
258
- interactionPalette?: import("../../../blocks/src/index").HeaderInteractionPaletteOptionGroup;
259
269
  }>>;
260
270
  export declare const headerStyleCompatibilityOrder: {
261
271
  readonly classic: readonly ["minimal", "fine-line", "soft-bar", "pill-nav", "brand-bar", "brand-underline", "brand-pill", "brand-capsule", "serif-line", "flat-tabs"];
@@ -2,5 +2,15 @@ export * from './headerLayoutTypes';
2
2
  export * from './headerLayoutCatalog';
3
3
  export * from './headerLayoutResolution';
4
4
  export * from './headerStyleCompiler';
5
+ /**
6
+ * The recipe modules are re-exported by name rather than with `export *`.
7
+ * `compileHeaderRecipe` and `headerForLayout` are deliberately absent: the only
8
+ * supported way to compile a header is `compileHeaderLayoutStyleSelection`,
9
+ * which resolves the recipe and applies the interaction palette. A consumer
10
+ * reaching the interpreter directly would be a second compilation authority,
11
+ * which is the thing #1318 removes.
12
+ */
13
+ export { type HeaderStyleRecipe, type HeaderStyleRecipeCore, type HeaderToneRecipe, type HeaderBackgroundRecipe, type HeaderNavRecipe, type HeaderShadowRecipe, type HeaderFrameRecipe, } from './headerStyleRecipe';
14
+ export { defaultHeaderStyleRecipes, resolveHeaderStyleRecipe, type HeaderStyleRecipeOverrides, type HeaderStyleRecipeOwner, } from './headerStyleDefaults';
5
15
  export declare const guaranteedFallbackHeaderLayoutId: import("../../../blocks/src/index").HeaderLayoutId;
6
16
  export declare const guaranteedFallbackHeaderStyleId: import("../../../blocks/src/index").HeaderStyleId;
@@ -1,5 +1,4 @@
1
1
  import type { ThemeHeader } from '../schema';
2
- import type { HeaderInteractionPaletteOptionGroup } from './headerInteractionPalette';
3
2
  import type { ResolvedSurfaceForeground } from '../surfaces';
4
3
  import { type BrandDisplayMode, type LogoAccommodationOption, type LogoFacts, type LogoSizePolicy } from './logoBranding';
5
4
  import { type Brand } from './types';
@@ -47,15 +46,19 @@ export type HeaderLayoutDefinition = Readonly<{
47
46
  logoAccommodations: readonly LogoAccommodationOption[];
48
47
  openingRequirement: HeaderOpeningRequirement;
49
48
  }>;
49
+ /**
50
+ * Metadata only: what a style is called and where it may be used. Never what it
51
+ * looks like — every appearance field moved to `HeaderStyleRecipe` in #1318
52
+ * (`navTypography` under ledger D7, then `openingForegroundTarget`,
53
+ * `scrollTreatment` and `interactionPalette` under D19), so a site style can own
54
+ * all of it. If a field here ever answers "what does this look like", it is in
55
+ * the wrong file.
56
+ */
50
57
  export type HeaderStyleDefinition = Readonly<{
51
58
  id: HeaderStyleId;
52
59
  label: string;
53
60
  description: string;
54
61
  supportedLayoutIds: readonly HeaderLayoutId[];
55
- navTypography: HeaderStyleNavTypography;
56
- openingForegroundTarget?: 'brand-only' | 'all';
57
- scrollTreatment?: 'contrast-glass';
58
- interactionPalette?: HeaderInteractionPaletteOptionGroup;
59
62
  }>;
60
63
  export type HeaderLayoutStyleSelection = Readonly<{
61
64
  layoutId: HeaderLayoutId;
@@ -1,6 +1,6 @@
1
1
  import type { Theme } from '../schema';
2
2
  import type { ResolvedSurfaceForeground } from '../surfaces';
3
- import type { HeaderStyleDefinition } from './headerLayoutTypes';
3
+ import type { HeaderStyleRecipe } from './headerStyleRecipe';
4
4
  export type HeaderOpeningForegroundContext = Readonly<{
5
5
  openingForeground: ResolvedSurfaceForeground;
6
6
  }>;
@@ -10,9 +10,9 @@ export type HeaderStyleAvailability = Readonly<{
10
10
  kind: 'unavailable';
11
11
  reason: 'requires-known-opening-foreground';
12
12
  }>;
13
- export declare function headerStyleAvailability(style: HeaderStyleDefinition, context: Partial<HeaderOpeningForegroundContext> | undefined): HeaderStyleAvailability;
13
+ export declare function headerStyleAvailability(recipe: HeaderStyleRecipe, context: Partial<HeaderOpeningForegroundContext> | undefined): HeaderStyleAvailability;
14
14
  export declare function headerStyleAvailabilityReasonLabel(reason: Extract<HeaderStyleAvailability, {
15
15
  kind: 'unavailable';
16
16
  }>['reason']): string;
17
- export declare function applyOpeningForeground(theme: Theme, header: Theme['header'], style: HeaderStyleDefinition, context: Partial<HeaderOpeningForegroundContext> | undefined): Theme['header'];
18
- export declare function applyPageOpeningForegroundToTheme(theme: Theme, style: HeaderStyleDefinition | null | undefined, context: Partial<HeaderOpeningForegroundContext> | undefined): Theme;
17
+ export declare function applyOpeningForeground(theme: Theme, header: Theme['header'], recipe: HeaderStyleRecipe, context: Partial<HeaderOpeningForegroundContext> | undefined): Theme['header'];
18
+ export declare function applyPageOpeningForegroundToTheme(theme: Theme, recipe: HeaderStyleRecipe | null | undefined, context: Partial<HeaderOpeningForegroundContext> | undefined): Theme;
@@ -0,0 +1,162 @@
1
+ import type { Theme, ThemeHeader } from '../schema';
2
+ import { type SiteChromeBackgroundOverride } from './siteChromeBackgrounds';
3
+ import { type HeaderNavFontSizePreference, type HeaderNavTypographyPreference } from './siteChromeNavPreferences';
4
+ import type { HeaderInteractionPalettePreference } from '../header/interactionPalette';
5
+ import { type HeaderInteractionPaletteOptionGroup } from './headerInteractionPalette';
6
+ import { type HeaderBrandPresentationPreference } from './headerBrandPresentation';
7
+ import type { BrandDisplayMode, HeaderBrandPresentationSelection, LogoSizePolicy } from './logoBranding';
8
+ export type HeaderLogoTextIntent = NonNullable<ThemeHeader['logoText']>;
9
+ /**
10
+ * Site-agnostic overrides of the layout's structural defaults (#1318 D15).
11
+ *
12
+ * `'inherit'` means "take whatever the row's own (layout, recipe) compiles". It
13
+ * is a sentinel rather than an absent field so that "the user has not chosen"
14
+ * stays distinguishable from "the user chose the value that happens to equal
15
+ * the layout default" — the distinction an optional field cannot carry.
16
+ *
17
+ * `logoText` has a third state because the classic layout compiles a value and
18
+ * a row can legitimately carry none: `'none'` is an explicit "no logo text
19
+ * accommodation", which `'inherit'` would silently turn back into the layout's.
20
+ */
21
+ export type HeaderStructurePreferences = Readonly<{
22
+ positioning: 'inherit' | ThemeHeader['positioning'];
23
+ shrinkOnScroll: 'inherit' | boolean;
24
+ logoText: 'inherit' | 'none' | HeaderLogoTextIntent;
25
+ }>;
26
+ /**
27
+ * Everything a user can express about a header, as intent rather than as
28
+ * compiled bytes. The first six fields already persist inside `theme.header`
29
+ * today and have readers; `structure` is new (D15).
30
+ */
31
+ export type HeaderPreferences = Readonly<{
32
+ /**
33
+ * Whether the header wears a brand presentation at all. `'plain'` is the
34
+ * state several live rows persist — no `logo` block — which the record could
35
+ * not express before (#1318 Phase 4c decision 5b, D24).
36
+ */
37
+ brandPresentation: HeaderBrandPresentationPreference;
38
+ brandDisplay: BrandDisplayMode;
39
+ logoSize: LogoSizePolicy;
40
+ navFontRole: HeaderNavTypographyPreference;
41
+ navTextSize: HeaderNavFontSizePreference;
42
+ interactionPalette: HeaderInteractionPalettePreference;
43
+ background: SiteChromeBackgroundOverride;
44
+ structure: HeaderStructurePreferences;
45
+ }>;
46
+ export declare const defaultHeaderStructurePreferences: HeaderStructurePreferences;
47
+ export declare const defaultHeaderPreferences: HeaderPreferences;
48
+ /**
49
+ * The written-down backfill rule (#1318 Phase 4a): compare the persisted value
50
+ * against the value the row's own (layout, recipe) compiles, and emit
51
+ * `'inherit'` when they are equal, the explicit value when they are not.
52
+ *
53
+ * Equal-to-default therefore collapses to `'inherit'`. Nothing in the data
54
+ * distinguishes a deliberate "sticky, same as the default" from an untouched
55
+ * row, so the backfill does not pretend to recover it; going forward the editor
56
+ * records what the user picks and the distinction is real for new intent.
57
+ *
58
+ * Two qualifications on "the value it compiles", both of which keep the rule
59
+ * from inventing intent:
60
+ *
61
+ * 1. A value that no vocabulary accepts expresses nothing, so it derives to
62
+ * `'inherit'` rather than to whatever a fallback would have picked.
63
+ * 2. A field a later pipeline step overwrites unconditionally cannot carry
64
+ * intent at all. That is `shrinkOnScroll` on a display-logo row — see
65
+ * `headerBrandPresentationForcesShrink`.
66
+ */
67
+ export declare function readHeaderStructurePreferences(persisted: ThemeHeader, compiled: ThemeHeader): HeaderStructurePreferences;
68
+ /**
69
+ * Total over any persisted theme, including a malformed one: every field goes
70
+ * through a reader that closes over the vocabulary rather than trusting the
71
+ * stored value.
72
+ *
73
+ * `compiledHeader` is the structure baseline — the header this row's own
74
+ * (layout, recipe) compiles. It is a required parameter rather than something
75
+ * derived inside, because a `Theme` alone does not carry the selection ids the
76
+ * baseline needs; asking the caller for it keeps the rule single-valued.
77
+ *
78
+ * `navTextSize` is derived against that same baseline rather than read off
79
+ * `header.navTextSize` (#1318 Phase 4c decision 1). It is the one nav field a
80
+ * pre-preferences row could express only through the compiled bytes, so
81
+ * reading the marker alone loses it — see
82
+ * `readHeaderNavFontSizeAgainstBaseline`. `navFontRole` stays a marker read:
83
+ * unlike size, `navLinkStyle.typography` is written by the recipe's own
84
+ * treatment on every row, so a baseline comparison there would report the
85
+ * treatment's default role as user intent.
86
+ *
87
+ * `interactionPaletteGroup` is the palette the row's resolved recipe offers,
88
+ * and the same reasoning applies to it (#1318 Phase 4c decision 2): a row that
89
+ * predates the palette carries its hover treatment in the compiled bytes and
90
+ * nothing in `header.interactionPalette`. `undefined` means the caller does not
91
+ * know which palette applies — it is not "the style has none" — and the marker
92
+ * read stands.
93
+ *
94
+ * `brandPresentationCandidates` are the two headers the two presentation modes
95
+ * produce for this row. The mode is derived by comparing the persisted `logo`
96
+ * against both, so a row that carries no presentation block keeps having none
97
+ * instead of being given one it has never rendered (#1318 Phase 4c decision
98
+ * 5b). They are supplied rather than rebuilt here because they are the
99
+ * compilation's own output, and a second construction of them would be a second
100
+ * authority on what the modes mean — `headerBrandPresentationCandidates` builds
101
+ * them with the real appliers.
102
+ */
103
+ export declare function readHeaderPreferences(theme: Theme, compiledHeader: ThemeHeader, interactionPaletteGroup: HeaderInteractionPaletteOptionGroup | undefined, brandPresentationCandidates: HeaderBrandPresentationCandidates): HeaderPreferences;
104
+ /** The header each brand-presentation mode compiles to, for one row. */
105
+ export type HeaderBrandPresentationCandidates = Readonly<{
106
+ recommended: ThemeHeader;
107
+ plain: ThemeHeader;
108
+ }>;
109
+ /**
110
+ * Both candidates, built with the same two appliers the pipeline uses.
111
+ *
112
+ * There is no circularity to resolve: the only record fields that reach
113
+ * `header.logo` are `brandDisplay` and `logoSize`, and those are read straight
114
+ * off the persisted theme rather than derived. The structure preferences run
115
+ * before the presentation in the named order but touch `positioning`,
116
+ * `shrinkOnScroll` and `logoText` — never `logo` — so leaving them out here
117
+ * cannot change either answer.
118
+ *
119
+ * One known over-specification, recorded rather than fixed because it changes
120
+ * no bytes. `applyHeaderBrandPresentation` reads `positioning` when it decides
121
+ * whether to force `shrinkOnScroll` for a display logo, and it sees the
122
+ * *structure-adjusted* value at apply time while it sees the layout default
123
+ * here. On a `'recommended'` row that overrides positioning to `'static'` the
124
+ * candidate can therefore carry a forced `shrinkOnScroll` the applied header
125
+ * will not, which makes `readHeaderStructurePreferences` emit an explicit
126
+ * `shrinkOnScroll` where `'inherit'` would have done. The record is more
127
+ * specific than it needs to be; the compiled bytes are identical either way,
128
+ * because the explicit value it writes is the one the row already has. Fixing
129
+ * it means deriving `positioning` before the candidates, which is a second
130
+ * derivation pass for no byte change (#1318 Phase 4c review round 2, item 10).
131
+ */
132
+ export declare function headerBrandPresentationCandidates(theme: Theme, compiledBaseline: ThemeHeader, presentation: HeaderBrandPresentationSelection | null): HeaderBrandPresentationCandidates;
133
+ export declare function applyHeaderStructurePreferences(header: ThemeHeader, preferences: HeaderStructurePreferences): ThemeHeader;
134
+ /**
135
+ * The brand presentation step, which sits between the structure preferences and
136
+ * the nav/logo/background ones because it reads `positioning` and can force
137
+ * `shrinkOnScroll` for a display logo (`previewCompiler.ts`).
138
+ */
139
+ /**
140
+ * Writes a resolved brand presentation onto the header. Lives here rather than
141
+ * in `previewCompiler` so the pipeline step has one definition: it sits between
142
+ * the structure preferences and the nav/logo/background ones, and it is the
143
+ * reason that position is load-bearing — it reads `positioning` and can force
144
+ * `shrinkOnScroll` for a display logo that brings its own backing.
145
+ */
146
+ export declare function applyHeaderBrandPresentation(header: ThemeHeader, presentation: HeaderBrandPresentationSelection): ThemeHeader;
147
+ /**
148
+ * The preference half of the header pipeline, composed once so that no caller
149
+ * assembles its own order. Named order, tail of the recompile:
150
+ *
151
+ * structure preferences → brand presentation → brand display/logo size
152
+ * → nav preferences → header background override
153
+ *
154
+ * `brandPresentation` is data rather than a callback so the step is inspectable
155
+ * and cannot vary by caller; `null` is "this caller has no logo context".
156
+ *
157
+ * The background applier is the header-only one on purpose: the header+footer
158
+ * pair function would clobber footer intent (#1318 Correction 20).
159
+ */
160
+ export declare function applyHeaderPreferences(theme: Theme, preferences: HeaderPreferences, brandPresentation: HeaderBrandPresentationSelection | null): Theme;
161
+ /** The fields authored by header quick controls; structure and presentation belong to the row. */
162
+ export type HeaderQuickControlPreferences = Pick<HeaderPreferences, 'brandDisplay' | 'logoSize' | 'navFontRole' | 'navTextSize' | 'interactionPalette' | 'background'>;
@@ -0,0 +1,73 @@
1
+ import { z } from 'zod';
2
+ import { type SiteChromeBackgroundColorToken } from './siteChromeBackgrounds';
3
+ import type { HeaderPreferences } from './headerPreferences';
4
+ /**
5
+ * The persisted shape of `HeaderPreferences`, closed at every field.
6
+ *
7
+ * `.strict()` throughout is deliberate: an unknown key in the stored blob means
8
+ * the writer knew about a field this reader does not, and silently dropping it
9
+ * would let a save round-trip away someone else's intent. Every field is
10
+ * required for the same reason a default would be a hidden authority: a stored
11
+ * record that omits one is not a record this reader may complete.
12
+ */
13
+ export declare const headerPreferencesSchema: z.ZodType<HeaderPreferences>;
14
+ /** Only controls the client can edit may cross the write boundary. */
15
+ export declare const headerPreferencesWireSchema: z.ZodObject<{
16
+ background: z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ kind: z.ZodLiteral<"default">;
18
+ }, z.core.$strict>, z.ZodObject<{
19
+ kind: z.ZodLiteral<"color">;
20
+ token: z.ZodType<SiteChromeBackgroundColorToken, unknown, z.core.$ZodTypeInternals<SiteChromeBackgroundColorToken, unknown>>;
21
+ }, z.core.$strict>], "kind">;
22
+ navTextSize: z.ZodEnum<{
23
+ base: "base";
24
+ sm: "sm";
25
+ lg: "lg";
26
+ xl: "xl";
27
+ inherit: "inherit";
28
+ }>;
29
+ navFontRole: z.ZodEnum<{
30
+ heading: "heading";
31
+ body: "body";
32
+ inherit: "inherit";
33
+ }>;
34
+ interactionPalette: z.ZodUnion<readonly [z.ZodLiteral<"recommended">, z.ZodEnum<{
35
+ accent: "accent";
36
+ primary: "primary";
37
+ secondary: "secondary";
38
+ quiet: "quiet";
39
+ }>]>;
40
+ brandDisplay: z.ZodEnum<{
41
+ auto: "auto";
42
+ "logo-only": "logo-only";
43
+ "logo-plus-title": "logo-plus-title";
44
+ "title-only": "title-only";
45
+ }>;
46
+ logoSize: z.ZodEnum<{
47
+ auto: "auto";
48
+ display: "display";
49
+ standard: "standard";
50
+ compact: "compact";
51
+ generous: "generous";
52
+ }>;
53
+ }, z.core.$strict>;
54
+ /**
55
+ * The read boundary for `site_theme_selections.header_preferences`.
56
+ *
57
+ * Three outcomes, never a throw and never a silent default: the column is
58
+ * nullable while the Phase 4c backfill is outstanding, so "absent" is a real
59
+ * and expected state that a caller must handle by deriving from the legacy
60
+ * theme with `readHeaderPreferences`. "Invalid" is separate from "absent"
61
+ * because the two want different responses — one is a backlog item, the other
62
+ * is a bug or a hand-edited row.
63
+ */
64
+ export type PersistedHeaderPreferences = Readonly<{
65
+ kind: 'present';
66
+ preferences: HeaderPreferences;
67
+ }> | Readonly<{
68
+ kind: 'absent';
69
+ }> | Readonly<{
70
+ kind: 'invalid';
71
+ issues: readonly string[];
72
+ }>;
73
+ export declare function parsePersistedHeaderPreferences(value: unknown): PersistedHeaderPreferences;
@@ -0,0 +1,118 @@
1
+ import type { Theme, ThemeHeader } from '../schema';
2
+ import { type CuratedSiteStyle } from './curatedSiteStyles';
3
+ import { type HeaderLayoutStyleResolution, type HeaderLayoutStyleSelection } from './headerLayoutStyles';
4
+ import { type HeaderPreferences } from './headerPreferences';
5
+ import { type HeaderInteractionPaletteBytesClassification, type HeaderInteractionPaletteOptionGroup } from './headerInteractionPalette';
6
+ import { type HeaderBrandPresentationBytesClassification } from './headerBrandPresentation';
7
+ import type { HeaderInteractionPalettePreference } from '../header/interactionPalette';
8
+ import type { HeaderBrandPresentationSelection } from './logoBranding';
9
+ import type { ReplacementBrandPresentation } from './compilationPlan';
10
+ export type CuratedHeaderSelectionRepair = Readonly<{
11
+ kind: 'exact';
12
+ }> | Readonly<{
13
+ kind: 'repaired';
14
+ reason: 'style-not-curated-for-layout' | 'layout-not-curated-for-site-style';
15
+ }>;
16
+ export type CuratedHeaderSelectionResolution = Readonly<{
17
+ resolution: HeaderLayoutStyleResolution;
18
+ repair: CuratedHeaderSelectionRepair;
19
+ }>;
20
+ /**
21
+ * Curated repair followed by catalogue repair — the first two steps of the
22
+ * header compilation pipeline, in one place so no caller re-derives them.
23
+ */
24
+ export declare function resolveCuratedHeaderSelection(siteStyle: CuratedSiteStyle, requested: HeaderLayoutStyleSelection): CuratedHeaderSelectionResolution;
25
+ /**
26
+ * Which interaction palette a compilation should use.
27
+ *
28
+ * `derive-from-persisted-bytes` is the backfill's answer, and it is a request
29
+ * rather than a value because the derivation needs the option list the resolved
30
+ * recipe offers, which only the compilation knows. It mirrors
31
+ * `ReplacementBrandPresentation`: the caller states what it wants, the
32
+ * composition resolves it.
33
+ */
34
+ export type HeaderInteractionPaletteRequest = Readonly<{
35
+ kind: 'preference';
36
+ preference: HeaderInteractionPalettePreference;
37
+ }> | Readonly<{
38
+ kind: 'derive-from-persisted-bytes';
39
+ }>;
40
+ export type CompiledCuratedHeader = Readonly<{
41
+ /** Recipe and interaction palette only — the structure-derivation baseline. */
42
+ baseline: ThemeHeader;
43
+ /** `baseline` with the brand presentation applied, when there is one. */
44
+ header: ThemeHeader;
45
+ /** The presentation the request resolved to against the chosen layout. */
46
+ brandPresentation: HeaderBrandPresentationSelection | null;
47
+ /**
48
+ * The palette the resolved recipe offers, so a caller deriving intent from
49
+ * persisted bytes has the option list without re-resolving the recipe or
50
+ * guessing at it (#1318 Phase 4c decision 2).
51
+ */
52
+ interactionPalette: HeaderInteractionPaletteOptionGroup | undefined;
53
+ resolution: HeaderLayoutStyleResolution;
54
+ repair: CuratedHeaderSelectionRepair;
55
+ }>;
56
+ /**
57
+ * Curated repair → catalogue repair → recipe → interaction palette → brand
58
+ * presentation. Everything that runs before the preference record, in one
59
+ * place: `previewCompiler.compileHeaderDirective` and the recompile below are
60
+ * both callers, so the middle of the pipeline has a single composition.
61
+ *
62
+ * `baseline` and `header` are both returned because they answer different
63
+ * questions. `header` is what a preview wants to render. `baseline` is what
64
+ * `readHeaderPreferences` compares the persisted bytes against for every field
65
+ * the presentation does not touch.
66
+ *
67
+ * The interaction-palette preference is threaded in through `theme.header`
68
+ * because that is where `compileHeaderLayoutStyleSelection` reads it from
69
+ * today; 4b can pass it explicitly once the preferences column exists.
70
+ */
71
+ export declare function compileHeaderForCuratedSelection(theme: Theme, siteStyle: CuratedSiteStyle, requested: HeaderLayoutStyleSelection, requestedBrandPresentation: ReplacementBrandPresentation, requestedInteractionPalette: HeaderInteractionPaletteRequest): CompiledCuratedHeader;
72
+ export type RecompileSiteChromeHeaderInput = Readonly<{
73
+ theme: Theme;
74
+ siteStyle: CuratedSiteStyle;
75
+ requested: HeaderLayoutStyleSelection;
76
+ preferences: HeaderPreferences;
77
+ brandPresentation: ReplacementBrandPresentation;
78
+ }>;
79
+ export type RecompiledSiteChromeHeader = Readonly<{
80
+ header: ThemeHeader;
81
+ resolution: HeaderLayoutStyleResolution;
82
+ repair: CuratedHeaderSelectionRepair;
83
+ }>;
84
+ /**
85
+ * The whole header pipeline, in one named function so 4b, 4c and 4d cannot
86
+ * drift into three orders (#1318 Phase 4):
87
+ *
88
+ * curated repair → catalogue repair → recipe → layout defaults
89
+ * → interaction palette → structure preferences → brand presentation
90
+ * → nav/logo/background preferences
91
+ */
92
+ export declare function recompileSiteChromeHeader(input: RecompileSiteChromeHeaderInput): RecompiledSiteChromeHeader;
93
+ /**
94
+ * The read-then-recompile round trip: derive the row's intent from its own
95
+ * persisted bytes, then rebuild the header from that intent. On a row whose
96
+ * bytes are compiler output this returns the persisted header unchanged, which
97
+ * is what the Phase 4c divergence report measures.
98
+ */
99
+ export declare function recompileSiteChromeHeaderFromPersistedIntent(theme: Theme, siteStyle: CuratedSiteStyle, requested: HeaderLayoutStyleSelection, brandPresentation: ReplacementBrandPresentation): Readonly<{
100
+ recompiled: RecompiledSiteChromeHeader;
101
+ preferences: HeaderPreferences;
102
+ /**
103
+ * How the row's own bytes answered the interaction-palette question. Reported
104
+ * rather than folded into `preferences`, because `'unrecognised'` has no
105
+ * representation there: the record falls back to the marker field, and a
106
+ * caller that cares — the Phase 4c divergence report — needs to say so rather
107
+ * than let a pill nobody recognises be dropped on the next recompile.
108
+ */
109
+ interactionPaletteBytes: HeaderInteractionPaletteBytesClassification;
110
+ /**
111
+ * How the row's own bytes answered the brand-presentation question, reported
112
+ * for the same reason as the palette: `'unrecognised'` has no representation
113
+ * in the record, and a caller that cares — the Phase 4c divergence report and
114
+ * the repair generator — must be able to say so rather than let a logo
115
+ * treatment nobody recognises be written or dropped.
116
+ */
117
+ brandPresentationBytes: HeaderBrandPresentationBytesClassification;
118
+ }>;
@@ -1,3 +1,26 @@
1
1
  import type { Theme } from '../schema';
2
- import { type HeaderLayoutStyleResolution } from './headerLayoutTypes';
3
- export declare function compileHeaderLayoutStyleSelection(theme: Theme, resolution: HeaderLayoutStyleResolution): Theme['header'];
2
+ import type { HeaderInteractionPalettePreference } from '../header/interactionPalette';
3
+ import type { HeaderLayoutStyleResolution } from './headerLayoutTypes';
4
+ import { type HeaderStyleRecipeOwner } from './headerStyleDefaults';
5
+ /**
6
+ * The header compilation pipeline: pick the recipe, interpret it, then apply
7
+ * the user's interaction-palette preference.
8
+ *
9
+ * Appearance decisions live in `headerStyleDefaults.ts` (data), optionally
10
+ * taken over per site style, and `headerStyleRecipe.ts` (one pure interpreter).
11
+ * Nothing here switches on a header style id.
12
+ *
13
+ * `siteStyle` is required rather than optional: a caller that has no resolved
14
+ * site style has to say so, because silently falling back to the catalogue
15
+ * default is exactly the ownership leak this slice closes. Pass `null` when
16
+ * there genuinely is no site style (initial site provisioning).
17
+ *
18
+ * `interactionPalette` is a parameter rather than a read off
19
+ * `theme.header.interactionPalette` (#1318 Phase 4c). The marker field on the
20
+ * header is where the preference is *persisted*, but taking it from there made
21
+ * the palette the one preference the compiler could not be told about — which
22
+ * is invisible while the marker always equals what was compiled and wrong the
23
+ * moment a backfill supplies a different one. The caller that owns the
24
+ * preference record now says which palette to compile.
25
+ */
26
+ export declare function compileHeaderLayoutStyleSelection(theme: Theme, resolution: HeaderLayoutStyleResolution, siteStyle: HeaderStyleRecipeOwner | null, interactionPalette: HeaderInteractionPalettePreference): Theme['header'];