@riverbankcms/sdk 0.125.0 → 0.127.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 (177) hide show
  1. package/README.md +3 -1
  2. package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-BXtfF7tp.mjs} +122 -301
  3. package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Dou73Q0K.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-B0HPXr-l.mjs} +141 -63
  6. package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-DZiDBAYu.mjs} +5330 -5841
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +1552 -202
  8. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  9. package/dist/_dts/api/src/contentRuntime.d.ts +1 -7
  10. package/dist/_dts/api/src/endpoints.d.ts +0 -7
  11. package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
  13. package/dist/_dts/api/src/siteOperations.d.ts +18 -1
  14. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
  15. package/dist/_dts/block-form/src/backend/store-backend.d.ts +2 -1
  16. package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +1 -0
  17. package/dist/_dts/blocks/src/index.d.ts +3 -2
  18. package/dist/_dts/blocks/src/lib/media.d.ts +267 -0
  19. package/dist/_dts/blocks/src/system/constants/buttonRoles.d.ts +0 -13
  20. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
  21. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +4 -4
  22. package/dist/_dts/blocks/src/system/runtime/nodes/mergeResolveImageUrlContexts.d.ts +7 -0
  23. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
  24. package/dist/_dts/content-editor/src/ui/blockValidationManifestRegistry.d.ts +17 -0
  25. package/dist/_dts/content-editor/src/ui/blockValidationView.d.ts +1 -1
  26. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +4 -0
  27. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +322 -171
  28. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +4 -0
  29. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockValidationManifests.d.ts +26 -0
  30. package/dist/_dts/editor-blocks/src/widgets/rich-text/imageInsert.d.ts +3 -3
  31. package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -2
  32. package/dist/_dts/media-editor/src/context.d.ts +1 -2
  33. package/dist/_dts/media-editor/src/index.d.ts +3 -1
  34. package/dist/_dts/media-editor/src/mediaSelection.d.ts +32 -0
  35. package/dist/_dts/media-editor/src/types.d.ts +3 -1
  36. package/dist/_dts/media-editor/src/useMediaSelection.d.ts +26 -0
  37. package/dist/_dts/preview-next/src/client/index.d.ts +2 -0
  38. package/dist/_dts/preview-next/src/client/preview/HeaderMenuControls.d.ts +12 -0
  39. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
  40. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +13 -3
  41. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +7 -2
  42. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +6 -60
  43. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
  44. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
  45. package/dist/_dts/preview-next/src/client/preview/headerInteractionPaletteSurfaceState.d.ts +8 -0
  46. package/dist/_dts/preview-next/src/client/preview/previewThemeRoles.d.ts +15 -0
  47. package/dist/_dts/preview-next/src/client/preview/siteChromeCustomizeTypes.d.ts +54 -0
  48. package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +13 -3
  49. package/dist/_dts/preview-next/src/client/preview/siteChromeNavQuickControlHistory.d.ts +3 -0
  50. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +6 -3
  51. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
  52. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
  53. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
  54. package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
  55. package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
  56. package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
  57. package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
  58. package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
  59. package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
  60. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
  61. package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
  62. package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
  63. package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
  64. package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
  65. package/dist/_dts/sdk/src/config/index.d.ts +1 -1
  66. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
  67. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  68. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -2
  69. package/dist/_dts/sdk/src/version.d.ts +1 -1
  70. package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
  71. package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
  72. package/dist/_dts/site-commands/src/commands.d.ts +38 -9
  73. package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
  74. package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
  75. package/dist/_dts/theme-core/src/buttons/effects/presets/background.d.ts +1 -1
  76. package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +0 -18
  77. package/dist/_dts/theme-core/src/buttons/types.d.ts +1 -3
  78. package/dist/_dts/theme-core/src/header/containerSchema.d.ts +20 -0
  79. package/dist/_dts/theme-core/src/header/generateHeaderCss.d.ts +1 -1
  80. package/dist/_dts/theme-core/src/header/interactionPalette.d.ts +14 -0
  81. package/dist/_dts/theme-core/src/header/legacyNavLinkStyle.d.ts +3 -0
  82. package/dist/_dts/theme-core/src/header/paintTargets.d.ts +25 -0
  83. package/dist/_dts/theme-core/src/header/scrollTreatment.d.ts +11 -0
  84. package/dist/_dts/theme-core/src/header/surfaceRules.d.ts +9 -0
  85. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +15 -0
  86. package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
  87. package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
  88. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
  89. package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
  90. package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
  91. package/dist/_dts/theme-core/src/schema.d.ts +105 -45
  92. package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +3 -51
  93. package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +4 -11
  94. package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +3 -51
  95. package/dist/_dts/theme-core/src/site-styles/headerInteractionPalette.d.ts +32 -0
  96. package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +19 -106
  97. package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +22 -0
  98. package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -0
  99. package/dist/_dts/theme-core/src/site-styles/headerStyleParts.d.ts +4 -0
  100. package/dist/_dts/theme-core/src/site-styles/index.d.ts +3 -0
  101. package/dist/_dts/theme-core/src/site-styles/lookOptionGroups.d.ts +24 -0
  102. package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +1 -2
  103. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +4 -22
  104. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorOptions.d.ts +21 -0
  105. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +5 -7
  106. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
  107. package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +4 -1
  108. package/dist/cli/index.mjs +1583 -1601
  109. package/dist/cli/init-docs/content/cli-reference.md +6 -3
  110. package/dist/cli/init-docs/content/content-management.md +24 -13
  111. package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-BDFRp8Y7.mjs} +1 -1
  112. package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DJgF1_lf.mjs} +2 -2
  113. package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-CnWGNjOr.mjs} +2 -2
  114. package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BISs9Bl7.mjs} +1 -1
  115. package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-b5E_HoG9.mjs} +1 -1
  116. package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-D8gVYkK-.mjs} +2 -2
  117. package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-DFDajgDz.mjs} +1 -1
  118. package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-Bdqj9-52.mjs} +5 -6
  119. package/dist/client/bookings.mjs +315 -46
  120. package/dist/client/{carousel--FMqgvob.mjs → carousel-Cvqf-kN8.mjs} +1 -1
  121. package/dist/client/{cart-BKX1bWiU.mjs → cart-CuH2TJXP.mjs} +3 -3
  122. package/dist/client/{checkout-B_jxi4WW.mjs → checkout-CMNPpejZ.mjs} +3 -3
  123. package/dist/client/client.mjs +1381 -1427
  124. package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-DTEYWL6Z.mjs} +6 -7
  125. package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-BW-XoxZ0.mjs} +4 -4
  126. package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-Bpn7s0y9.mjs} +2 -2
  127. package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-D2uUSTMH.mjs} +3 -3
  128. package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-CVr1c094.mjs} +2 -2
  129. package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-Dv4AvkMw.mjs} +30 -22
  130. package/dist/client/{form-DJKuyZgN.mjs → form-DxdKf9fs.mjs} +1 -1
  131. package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-BaXI5Sro.mjs} +2 -2
  132. package/dist/client/hooks.mjs +851 -976
  133. package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-BEtW2fKz.mjs} +2 -2
  134. package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-BKKs0S4R.mjs} +1 -1
  135. package/dist/client/{pricing-C01J3Epx.mjs → pricing-ClkqcElA.mjs} +1 -1
  136. package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-H-ru8dyy.mjs} +3 -3
  137. package/dist/client/{productList-BXbvXWTF.mjs → productList-Buyi5c0C.mjs} +3 -3
  138. package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-BF7i6Ijg.mjs} +293 -65
  139. package/dist/client/rendering/client.mjs +1145 -1190
  140. package/dist/client/rendering/islands.mjs +18 -18
  141. package/dist/client/rendering.mjs +1257 -1298
  142. package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-D_7t8yWb.mjs} +18 -2
  143. package/dist/client/{shop-BbNwPKM-.mjs → shop-CF7SZQNX.mjs} +5 -6
  144. package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-DA7_Rq5p.mjs} +4 -4
  145. package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-BmLqW7Gh.mjs} +1 -1
  146. package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-WL-E1znM.mjs} +2 -2
  147. package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-rc8VLeLV.mjs} +2 -2
  148. package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-1ncrfd4S.mjs} +2 -2
  149. package/dist/preview-next/before-render.mjs +0 -7
  150. package/dist/preview-next/client/runtime.mjs +4 -4
  151. package/dist/preview-next/middleware.mjs +0 -7
  152. package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
  153. package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-BnrCCFJq.mjs} +2 -2
  154. package/dist/{separator-BFs-Kmv5.mjs → separator-CFvBx2yl.mjs} +1 -1
  155. package/dist/server/components.mjs +1389 -1489
  156. package/dist/server/config-validation.mjs +851 -976
  157. package/dist/server/config.mjs +851 -976
  158. package/dist/server/data.mjs +851 -976
  159. package/dist/server/index.mjs +1 -8
  160. package/dist/server/next.mjs +1393 -1500
  161. package/dist/server/page-converter.mjs +851 -976
  162. package/dist/server/prebuild.mjs +1 -1
  163. package/dist/server/rendering/server.mjs +1346 -1446
  164. package/dist/server/rendering.mjs +1390 -1490
  165. package/dist/server/routing.mjs +939 -1041
  166. package/dist/server/server.mjs +852 -984
  167. package/dist/server/theme-bridge.mjs +322 -279
  168. package/dist/server/theme.mjs +277 -33
  169. package/package.json +1 -1
  170. package/dist/_dts/editor-blocks/src/widgets/rich-text/ensureRichTextImageAssetIdentifier.d.ts +0 -8
  171. package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
  172. package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
  173. package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
  174. package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
  175. package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
  176. package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
  177. package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
package/README.md CHANGED
@@ -3195,7 +3195,9 @@ npx riverbankcms push-config --dashboard <url>
3195
3195
 
3196
3196
  Pages, content entries, navigation menus, and canonical events are content documents. Sync them with `riverbankcms push pages`, `riverbankcms push entries`, `riverbankcms push navigation`, or `riverbankcms push events`.
3197
3197
 
3198
- Canonical event files in `content/events/*.json` may include `path` and `blocks`. `path` updates the linked event content entry route. `blocks` writes per-event entry-slot content, such as `blocks.main` for the built-in event template. Use stable block identifiers so repeat pushes update existing slot blocks; `push events` rejects duplicate event identifiers before writing. Default entry slots accept enabled SDK `custom.*` blocks, while explicit template `allowedBlocks` lists remain authoritative.
3198
+ Canonical event files in `content/events/*.json` include `preset`, `bookingScope`, and an explicit `occurrences` list. Each occurrence carries UTC `startsAt`/`endsAt` instants and its IANA `timeZone`; this supports one-off events and whole-series schedules without reconstructing dates from a recurrence summary. Files may also include `path` and `blocks`. `path` updates the linked event content entry route. `blocks` writes per-event entry-slot content, such as `blocks.main` for the built-in event template. Use stable block identifiers so repeat pushes update existing slot blocks; `push events` rejects duplicate event identifiers before writing. Default entry slots accept enabled SDK `custom.*` blocks, while explicit template `allowedBlocks` lists remain authoritative.
3199
+
3200
+ The retired `schedule` object is not accepted. When upgrading a site with local event edits: preserve those edits, deploy the matching CMS API first, upgrade the SDK, run `riverbankcms pull events`, then reapply the edits to the canonical files. Existing occurrence schedules may be replayed exactly; changing an already-created schedule remains an explicit CMS capability gap.
3199
3201
 
3200
3202
  **Options:**
3201
3203
 
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { $i as buildPaletteLibraryReadModel, $s as SearchInput, A as deriveStyleConfiguratorCapabilities, B as previewButtonStyle, Bt as BlockEditor, Cc as DropdownMenuContent, D as committedPaletteForSnapshot, Dc as DropdownMenuTrigger, Dl as Smartphone, E as cancelPreview, Ec as DropdownMenuSeparator, F as markApplySaving, Fc as Button, Fl as Monitor, G as previewSitePalette, H as previewFooterLook, I as openRow, J as resetTypographyToSaved, Js as SelectItem, K as previewSiteStyle, Kl as ChevronRight, Ks as Select, Kt as useEditorUiStore, L as paletteMutationCapability, Ll as Maximize2, M as isPreviewingChange, N as markApplyFailed, Ni as findFooterLook, O as createPalette, Ol as SlidersHorizontal, On as listEntryPageContentSlots, P as markApplySaved, Pn as ThemeScope, Q as toggleRow, Qi as findCuratedPalette, Qs as CalloutDescription, R as palettePreviewProjection, Rc as cn, Rl as LoaderCircle, Sc as DropdownMenu, T as applyTypographyDraftPatch, Tc as DropdownMenuLabel, U as previewHeaderLayout, Ui as getHeaderLayout, V as previewCuratedPalette, Vc as unsafeAsEditorBlockId, W as previewHeaderStyle, Wi as getHeaderStyle, X as styleConfiguratorHistoryEntryForPersistedSelection, Xs as SelectValue, Y as setPaletteColors, Yl as Check, Ys as SelectTrigger, Z as syncStyleConfiguratorState, Zi as curatedPalettes, Zs as Callout, _ as planSiteChromeLookSelection, ac as TabsContent, at as createOptimisticActionRunner, c as selectionSnapshotFromApplySiteStyleSelectionResponse, cl as assertNever$1, cn as isAdapterReferenceKind, d as PREVIEW_DESIGN_REFRESH_ERROR_MESSAGE, dn as resolvePageRouteSlug, ds as resolveButtonStyleSelection, dt as ContentFieldsForm, ea as paletteColorEntries, ec as Popover, f as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, fn as resolveContentTitle, fs as updateButtonStyleSelectionChoice, ft as useUISelector, g as cycleableSiteChromeOptions, gc as CollapsibleTrigger, gn as ManifestForm, gs as themeButtonClassName, h as cycleSiteChromeLookId, hc as CollapsibleContent, ht as useEntryController, ic as Tabs, j as dismissWarnings, ji as getCuratedSiteStyle, jl as Plus, k as createStyleConfiguratorState, ki as curatedSiteStyles, l as resolveStyleConfiguratorInitialSnapshot, ls as buttonStyleSelectionParameterValue, m as buildSiteChromeLookModels, mc as Collapsible, n as useSiteChromeCustomizeOptional, na as paletteColorsSchema, nc as PopoverTrigger, oc as TabsList, ot as resolvePreviewSidebarTab, p as reportPreviewDesignError, ps as buttonStyleSelectionKey, q as reconcilePaletteLibraryActive, ql as ChevronLeft, qs as SelectContent, qt as useEditorUiStoreInstance, rc as Input, s as buildApplySiteStyleSelectionBody, sc as TabsTrigger, st as FooterComposerPanel, ta as paletteColorsEqual, tc as PopoverContent, u as PREVIEW_DESIGN_LOAD_ERROR_MESSAGE, un as deriveRouteMetadataPresentation, us as findButtonStyleRecipe, v as deriveSiteStylePreviewUpdate, vn as createManifestValidation, w as applyResolvedSelections, wc as DropdownMenuItem, wl as Tablet, x as usePreviewDesignCoordinator, xc as Surface, xn as createStoreBackend, y as planSiteStylePreviewChange, yl as X$1, yn as FormRenderer, z as prepareStalePaletteRetry } from "./SiteChromeCustomizeContext-BHF-KANn.mjs";
3
- import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-CJX21dGi.mjs";
4
- import { S as getSiteFontsStorageUrl, _ as useBlockCustomizeControls, b as buildFontPreviewUrl, d as resolvePreviewDashboardSetupHandoff, f as resolvePreviewEditorGuidanceModel, g as usePreviewBlockCustomizeSelectionOptional, h as canInspectSiteStyle, m as canApplySiteStyle, p as resolvePreviewSidebarChromeModel, u as buildPreviewDashboardSetupUrl, v as PreviewFormProvider, x as generateFontFaceCss, y as previewWidgetOverrides } from "./SdkPreviewModeRuntime-Co3AHfj0.mjs";
5
- import { t as Separator } from "./separator-BFs-Kmv5.mjs";
2
+ import { $ as createOptimisticActionRunner, $o as resolveButtonStyleSelection, A as isPreviewingChange, B as previewHeaderStyle, Bs as SelectValue, Bt as useEditorUiStore, D as createStyleConfiguratorState, Dl as Maximize2, Dn as ThemeScope, E as cancelPreview, Ei as findFooterLook, F as palettePreviewProjection, G as syncStyleConfiguratorState, Gs as PopoverContent, H as resetTypographyToSaved, Hs as CalloutDescription, I as previewButtonStyle, Ii as getHeaderLayout, Il as ChevronRight, Is as Select, Js as Tabs, K as toggleRow, Ks as PopoverTrigger, L as previewCuratedPalette, Li as getHeaderStyle, Ll as ChevronLeft, Ls as SelectContent, M as markApplySaved, N as markApplySaving, O as deriveStyleConfiguratorCapabilities, Oc as cn, Ol as LoaderCircle, P as openRow, Pt as BlockEditor, Qc as assertNever$1, Qo as findButtonStyleRecipe, R as previewFooterLook, Rs as SelectItem, Si as curatedSiteStyles, T as applyTypographyDraftPatch, Tc as Button, Tl as Monitor, U as setPaletteColors, Us as SearchInput, V as previewSiteStyle, Vs as Callout, Vt as useEditorUiStoreInstance, W as styleConfiguratorHistoryEntryForPersistedSelection, Wi as curatedPalettes, Ws as Popover, Xs as TabsList, Ys as TabsContent, Zo as buttonStyleSelectionParameterValue, Zs as TabsTrigger, _ as cycleableSiteChromeOptions, _c as DropdownMenuTrigger, _l as Smartphone, _s as paletteColorEntries, ac as CollapsibleContent, an as resolvePageRouteSlug, at as ContentFieldsForm, c as selectionSnapshotFromApplySiteStyleSelectionResponse, d as resolveStyleConfiguratorInitialSnapshot, dc as Surface, dn as createManifestValidation, es as updateButtonStyleSelectionChoice, et as resolvePreviewSidebarTab, fc as DropdownMenu, fn as FormRenderer, g as cycleSiteChromeLookId, gc as DropdownMenuSeparator, h as buildSiteChromeLookModels, hc as DropdownMenuLabel, ic as Collapsible, in as deriveRouteMetadataPresentation, is as themeButtonClassName, j as markApplyFailed, jc as unsafeAsEditorBlockId, k as dismissWarnings, l as deriveSiteStylePreviewUpdate, ll as X$1, ln as ManifestForm, lt as useEntryController, m as reportPreviewDesignError, mc as DropdownMenuItem, ml as Tablet, mn as createStoreBackend, n as useSiteChromeCustomizeOptional, nn as isAdapterReferenceKind, oc as CollapsibleTrigger, on as resolveContentTitle, ot as useUISelector, p as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, pc as DropdownMenuContent, qs as Input, s as buildApplySiteStyleSelectionBody, ts as buttonStyleSelectionKey, tt as FooterComposerPanel, u as planSiteStylePreviewChange, v as planSiteChromeLookSelection, vl as SlidersHorizontal, vn as listEntryPageContentSlots, vs as paletteColorsSchema, w as applyResolvedSelections, wi as getCuratedSiteStyle, x as usePreviewDesignCoordinator, y as siteChromeLookUnavailableReasonLabel, z as previewHeaderLayout, zl as Check, zs as SelectTrigger } from "./SiteChromeCustomizeContext-DZiDBAYu.mjs";
3
+ import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-Dev9CdG9.mjs";
4
+ import { S as getSiteFontsStorageUrl, _ as useBlockCustomizeControls, b as buildFontPreviewUrl, d as resolvePreviewDashboardSetupHandoff, f as resolvePreviewEditorGuidanceModel, g as usePreviewBlockCustomizeSelectionOptional, h as canInspectSiteStyle, m as canApplySiteStyle, p as resolvePreviewSidebarChromeModel, u as buildPreviewDashboardSetupUrl, v as PreviewFormProvider, x as generateFontFaceCss, y as previewWidgetOverrides } from "./SdkPreviewModeRuntime-B0HPXr-l.mjs";
5
+ import { t as Separator } from "./separator-CFvBx2yl.mjs";
6
6
  import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { useQuery, useQueryClient } from "@tanstack/react-query";
@@ -2176,6 +2176,60 @@ function ButtonStylePreviewPair({ selection, previewTheme, compact = false }) {
2176
2176
  });
2177
2177
  }
2178
2178
  //#endregion
2179
+ //#region ../preview-next/src/client/preview/HeaderMenuControls.tsx
2180
+ function isHeaderMenuSurfaceState(state) {
2181
+ return state.kind === "available" && state.surface === "header";
2182
+ }
2183
+ function HeaderMenuControls({ state, disabled, onMenuFontChange, onMenuFontSizeChange }) {
2184
+ const customize = useSiteChromeCustomizeOptional();
2185
+ const controlDisabled = disabled || !state.applyAllowed;
2186
+ return /* @__PURE__ */ jsxs("div", {
2187
+ className: "grid grid-cols-2 gap-2 rounded-md border bg-muted/20 p-2",
2188
+ children: [
2189
+ /* @__PURE__ */ jsxs("label", {
2190
+ className: "block text-xs font-medium text-muted-foreground",
2191
+ children: [/* @__PURE__ */ jsx("span", { children: "Menu font" }), /* @__PURE__ */ jsx("select", {
2192
+ className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
2193
+ value: state.menuFont,
2194
+ onChange: (event) => onMenuFontChange?.(event.currentTarget.value),
2195
+ disabled: controlDisabled,
2196
+ children: state.menuFontOptions.map((option) => /* @__PURE__ */ jsx("option", {
2197
+ value: option.value,
2198
+ children: option.label
2199
+ }, option.value))
2200
+ })]
2201
+ }),
2202
+ /* @__PURE__ */ jsxs("label", {
2203
+ className: "block text-xs font-medium text-muted-foreground",
2204
+ children: [/* @__PURE__ */ jsx("span", { children: "Menu font size" }), /* @__PURE__ */ jsx("select", {
2205
+ className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
2206
+ value: state.menuFontSize,
2207
+ onChange: (event) => onMenuFontSizeChange?.(event.currentTarget.value),
2208
+ disabled: controlDisabled,
2209
+ children: state.menuFontSizeOptions.map((option) => /* @__PURE__ */ jsx("option", {
2210
+ value: option.value,
2211
+ children: option.label
2212
+ }, option.value))
2213
+ })]
2214
+ }),
2215
+ state.interactionPalette.kind === "available" ? /* @__PURE__ */ jsxs("label", {
2216
+ className: "block text-xs font-medium text-muted-foreground",
2217
+ children: [/* @__PURE__ */ jsx("span", { children: "Hover pill colour" }), /* @__PURE__ */ jsx("select", {
2218
+ "aria-label": "Hover pill colour",
2219
+ className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
2220
+ value: state.interactionPalette.preference,
2221
+ onChange: (event) => customize?.setHeaderInteractionPalette(event.currentTarget.value),
2222
+ disabled: controlDisabled,
2223
+ children: state.interactionPalette.options.map((option) => /* @__PURE__ */ jsx("option", {
2224
+ value: option.value,
2225
+ children: option.label
2226
+ }, option.value))
2227
+ })]
2228
+ }) : null
2229
+ ]
2230
+ });
2231
+ }
2232
+ //#endregion
2179
2233
  //#region ../preview-next/src/client/preview/typographyFontCatalog.ts
2180
2234
  const typographyFontCategories = [
2181
2235
  {
@@ -3333,23 +3387,8 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3333
3387
  if (plan.kind !== "footer") return;
3334
3388
  setState((current) => current ? previewFooterLook(current, plan.next.footerLookId) : current);
3335
3389
  }, []);
3336
- const handlePreviewPaletteItem = useCallback((item) => {
3337
- setState((current) => {
3338
- if (!current) return current;
3339
- if (item.kind === "curated") return previewCuratedPalette(current, item.valueKey);
3340
- return previewSitePalette(current, {
3341
- paletteId: item.paletteId,
3342
- colors: item.colors,
3343
- mode: item.mode,
3344
- version: item.version
3345
- });
3346
- });
3347
- }, []);
3348
- const handleCreatePalette = useCallback(() => {
3349
- setState((current) => current ? createPalette(current) : current);
3350
- }, []);
3351
- const handlePaletteLibraryLoaded = useCallback((response) => {
3352
- setState((current) => current ? reconcilePaletteLibraryActive(current, response.active, response.palettes) : current);
3390
+ const handlePreviewPalette = useCallback((valueKey) => {
3391
+ setState((current) => current ? previewCuratedPalette(current, valueKey) : current);
3353
3392
  }, []);
3354
3393
  const patchTypography = useCallback((patch) => {
3355
3394
  setState((current) => {
@@ -3389,7 +3428,6 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3389
3428
  setState((current) => {
3390
3429
  if (!current) return current;
3391
3430
  const palette = palettePreviewProjection(current.previewed.palette);
3392
- if (palette.kind === "invalid") return current;
3393
3431
  if (!(role in palette.colors)) return current;
3394
3432
  const nextColors = paletteColorsSchema.safeParse({
3395
3433
  ...palette.colors,
@@ -3398,16 +3436,6 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3398
3436
  return nextColors.success ? setPaletteColors(current, nextColors.data) : current;
3399
3437
  });
3400
3438
  }, []);
3401
- const handleResetOverrides = useCallback(() => {
3402
- setState((current) => {
3403
- if (!current) return current;
3404
- const palette = palettePreviewProjection(current.previewed.palette);
3405
- const sourceValueKey = palette.kind === "curated" ? palette.valueKey : palette.kind === "curated-fork" ? palette.sourceValueKey : null;
3406
- if (!sourceValueKey) return current;
3407
- const curated = findCuratedPalette(sourceValueKey);
3408
- return curated ? setPaletteColors(current, curated.colors) : current;
3409
- });
3410
- }, []);
3411
3439
  const handleToggleRow = useCallback((row) => {
3412
3440
  if (row === "typography") setTypographySurface(typographyOverviewSurface);
3413
3441
  setState((current) => current ? toggleRow(current, row) : current);
@@ -3419,27 +3447,10 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3419
3447
  const handleDismissWarnings = useCallback(() => {
3420
3448
  setState((current) => current ? dismissWarnings(current) : current);
3421
3449
  }, []);
3422
- const handleApply = useCallback(async (retry = false) => {
3423
- const current = stateRef.current;
3424
- let live = current;
3425
- if (current && retry) try {
3426
- const paletteAuthority = await apiClient({
3427
- endpoint: "listSiteThemePalettes",
3428
- params: { siteId }
3429
- }).then(unwrapResponse);
3430
- live = prepareStalePaletteRetry(reconcilePaletteLibraryActive(current, paletteAuthority.active, paletteAuthority.palettes), { sitePalettes: paletteAuthority.palettes });
3431
- } catch (error) {
3432
- reportPreviewDesignError("Failed to refresh palette authority", error);
3433
- const message = PREVIEW_DESIGN_REFRESH_ERROR_MESSAGE;
3434
- setState((latest) => latest ? markApplyFailed(latest, message, "stale") : latest);
3435
- return;
3436
- }
3450
+ const handleApply = useCallback(async () => {
3451
+ const live = stateRef.current;
3437
3452
  if (!live || !isPreviewingChange(live)) return;
3438
3453
  if (!deriveStyleConfiguratorCapabilities(live).canApplyStaged) return;
3439
- if (live !== current) {
3440
- stateRef.current = live;
3441
- setState(live);
3442
- }
3443
3454
  const previewed = live.previewed;
3444
3455
  if (!getCuratedSiteStyle(previewed.siteStyleId)) return;
3445
3456
  await runnerRef.current.run({
@@ -3508,11 +3519,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3508
3519
  children: "This site uses a Site Style that cannot be configured here."
3509
3520
  });
3510
3521
  const currentPalette = palettePreviewProjection(state.previewed.palette);
3511
- const paletteMutation = paletteMutationCapability(state);
3512
- const paletteControlsDisabled = saving || !stagedCapabilities.canPreviewStaged || paletteMutation.kind !== "editable";
3513
- const currentCuratedValueKey = currentPalette.kind === "curated" ? currentPalette.valueKey : currentPalette.kind === "curated-fork" ? currentPalette.sourceValueKey : null;
3514
- const currentCuratedPalette = currentCuratedValueKey ? findCuratedPalette(currentCuratedValueKey) : null;
3515
- const paletteIsCustom = currentPalette.kind !== "invalid" && (!currentCuratedPalette || currentPalette.mode !== currentCuratedPalette.mode || !paletteColorsEqual(currentPalette.colors, currentCuratedPalette.colors));
3522
+ const paletteControlsDisabled = saving || !stagedCapabilities.canPreviewStaged;
3516
3523
  const currentPreviewPlan = planSiteStylePreviewChange({
3517
3524
  siteStyle: currentSiteStyle,
3518
3525
  selection: state.previewed,
@@ -3558,7 +3565,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3558
3565
  saveStatus: state.saveStatus,
3559
3566
  onCancel: handleCancel,
3560
3567
  onApply: () => void handleApply(),
3561
- onRetry: () => void handleApply(true)
3568
+ onRetry: () => void handleApply()
3562
3569
  })
3563
3570
  })]
3564
3571
  });
@@ -3662,18 +3669,10 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3662
3669
  /* @__PURE__ */ jsx(PaletteRow, {
3663
3670
  expanded: state.expandedRow === "palette",
3664
3671
  onToggle: () => handleToggleRow("palette"),
3665
- apiClient,
3666
- siteId,
3667
3672
  siteStyle: currentSiteStyle,
3668
3673
  palette: currentPalette,
3669
- committedSelection: committedPaletteForSnapshot(state.base.palette)?.selection ?? null,
3670
- onPreview: handlePreviewPaletteItem,
3671
- onCreate: handleCreatePalette,
3672
- onLibraryLoaded: handlePaletteLibraryLoaded,
3673
- isCustom: paletteIsCustom,
3674
+ onPreview: handlePreviewPalette,
3674
3675
  onTokenChange: handleTokenOverride,
3675
- onReset: handleResetOverrides,
3676
- mutationCapability: paletteMutation,
3677
3676
  disabled: saving || !applyAllowed,
3678
3677
  mutationDisabled: paletteControlsDisabled || !applyAllowed
3679
3678
  }),
@@ -3686,7 +3685,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
3686
3685
  saveStatus: state.saveStatus,
3687
3686
  onCancel: handleCancel,
3688
3687
  onApply: () => void handleApply(),
3689
- onRetry: () => void handleApply(true)
3688
+ onRetry: () => void handleApply()
3690
3689
  })
3691
3690
  ]
3692
3691
  });
@@ -3882,7 +3881,7 @@ function SiteChromeLookRow({ label, ariaLabel, defaultDescription, catalog, opti
3882
3881
  children: options.map((look) => /* @__PURE__ */ jsx(PickerOption, {
3883
3882
  selected: look.id === currentId,
3884
3883
  label: look.label,
3885
- description: look.description,
3884
+ description: look.available ? look.description : [look.description, siteChromeLookUnavailableReasonLabel(look.unavailableReason)].filter(Boolean).join(" "),
3886
3885
  onSelect: () => onPreview(look.id),
3887
3886
  disabled: disabled || !look.available
3888
3887
  }, look.id ?? "site-style-default"))
@@ -3890,104 +3889,13 @@ function SiteChromeLookRow({ label, ariaLabel, defaultDescription, catalog, opti
3890
3889
  ]
3891
3890
  });
3892
3891
  }
3893
- function isHeaderMenuSurfaceState(state) {
3894
- return state.kind === "available" && state.surface === "header" && Array.isArray(state.menuFontOptions) && Array.isArray(state.menuFontSizeOptions);
3895
- }
3896
- function HeaderMenuControls({ state, disabled, onMenuFontChange, onMenuFontSizeChange }) {
3897
- const controlDisabled = disabled || !state.applyAllowed;
3898
- return /* @__PURE__ */ jsxs("div", {
3899
- className: "grid grid-cols-2 gap-2 rounded-md border bg-muted/20 p-2",
3900
- children: [/* @__PURE__ */ jsxs("label", {
3901
- className: "block text-xs font-medium text-muted-foreground",
3902
- children: [/* @__PURE__ */ jsx("span", { children: "Menu font" }), /* @__PURE__ */ jsx("select", {
3903
- className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
3904
- value: state.menuFont,
3905
- onChange: (event) => onMenuFontChange?.(event.currentTarget.value),
3906
- disabled: controlDisabled,
3907
- children: state.menuFontOptions.map((option) => /* @__PURE__ */ jsx("option", {
3908
- value: option.value,
3909
- children: option.label
3910
- }, option.value))
3911
- })]
3912
- }), /* @__PURE__ */ jsxs("label", {
3913
- className: "block text-xs font-medium text-muted-foreground",
3914
- children: [/* @__PURE__ */ jsx("span", { children: "Menu font size" }), /* @__PURE__ */ jsx("select", {
3915
- className: "mt-1 h-8 w-full rounded-md border bg-background px-2 text-sm text-foreground disabled:cursor-not-allowed disabled:opacity-50",
3916
- value: state.menuFontSize,
3917
- onChange: (event) => onMenuFontSizeChange?.(event.currentTarget.value),
3918
- disabled: controlDisabled,
3919
- children: state.menuFontSizeOptions.map((option) => /* @__PURE__ */ jsx("option", {
3920
- value: option.value,
3921
- children: option.label
3922
- }, option.value))
3923
- })]
3924
- })]
3925
- });
3926
- }
3927
- function PaletteRow({ expanded, onToggle, apiClient, siteId, siteStyle, palette, committedSelection, onPreview, onCreate, onLibraryLoaded, isCustom, onTokenChange, onReset, mutationCapability, disabled, mutationDisabled }) {
3928
- const [library, setLibrary] = useState({
3929
- kind: "idle",
3930
- palettes: []
3931
- });
3892
+ function PaletteRow({ expanded, onToggle, siteStyle, palette, onPreview, onTokenChange, disabled, mutationDisabled }) {
3932
3893
  const optionRefs = useRef([]);
3933
- const activeSelection = selectionForPaletteSnapshot(palette) ?? committedSelection;
3934
- const libraryModel = useMemo(() => buildPaletteLibraryReadModel({
3935
- active: activeSelection ? {
3936
- kind: "available",
3937
- selection: activeSelection
3938
- } : { kind: "invalid" },
3939
- sitePalettes: library.palettes,
3940
- curatedPalettes,
3941
- recommendations: siteStyle.paletteRecommendations.map((recommendation) => recommendation.id)
3942
- }), [
3943
- activeSelection,
3944
- library.palettes,
3945
- siteStyle.paletteRecommendations
3946
- ]);
3947
- useEffect(() => {
3948
- if (!expanded || library.kind !== "idle") return;
3949
- setLibrary((current) => ({
3950
- kind: "loading",
3951
- palettes: current.palettes
3952
- }));
3953
- }, [expanded, library.kind]);
3954
- useEffect(() => {
3955
- if (library.kind !== "loading") return;
3956
- let cancelled = false;
3957
- apiClient({
3958
- endpoint: "listSiteThemePalettes",
3959
- params: { siteId }
3960
- }).then(unwrapResponse).then((response) => {
3961
- if (cancelled) return;
3962
- setLibrary({
3963
- kind: "loaded",
3964
- palettes: response.palettes
3965
- });
3966
- onLibraryLoaded(response);
3967
- }).catch((error) => {
3968
- if (cancelled) return;
3969
- reportPreviewDesignError("Failed to load site palettes", error);
3970
- setLibrary((current) => ({
3971
- kind: "failed",
3972
- palettes: current.palettes,
3973
- message: PREVIEW_DESIGN_LOAD_ERROR_MESSAGE
3974
- }));
3975
- });
3976
- return () => {
3977
- cancelled = true;
3978
- };
3979
- }, [
3980
- apiClient,
3981
- library.kind,
3982
- onLibraryLoaded,
3983
- siteId
3984
- ]);
3985
- const items = libraryModel?.ok ? [
3986
- ...libraryModel.model.yours,
3987
- ...libraryModel.model.suggested,
3988
- ...libraryModel.model.more
3989
- ] : [];
3990
- const currentLabel = palette.kind === "new-site" ? "New palette" : "Selected palette";
3894
+ const suggestedKeys = new Set(siteStyle.paletteRecommendations.map((recommendation) => recommendation.id));
3895
+ const suggested = curatedPalettes.filter((candidate) => suggestedKeys.has(candidate.valueKey));
3896
+ const more = curatedPalettes.filter((candidate) => !suggestedKeys.has(candidate.valueKey));
3897
+ const items = [...suggested, ...more];
3898
+ const currentLabel = (palette.curatedValueKey ? curatedPalettes.find((candidate) => candidate.valueKey === palette.curatedValueKey) : null)?.name ?? "Custom palette";
3991
3899
  const onOptionKeyDown = (event, index) => {
3992
3900
  if (items.length === 0) return;
3993
3901
  const direction = event.key === "ArrowDown" || event.key === "ArrowRight" ? 1 : event.key === "ArrowUp" || event.key === "ArrowLeft" ? -1 : 0;
@@ -3996,100 +3904,46 @@ function PaletteRow({ expanded, onToggle, apiClient, siteId, siteStyle, palette,
3996
3904
  const nextIndex = (index + direction + items.length) % items.length;
3997
3905
  const next = items[nextIndex];
3998
3906
  if (!next) return;
3999
- onPreview(next);
3907
+ onPreview(next.valueKey);
4000
3908
  optionRefs.current[nextIndex]?.focus();
4001
3909
  };
4002
3910
  return /* @__PURE__ */ jsxs(StyleRowFrame, {
4003
3911
  label: "Palette",
4004
3912
  currentLabel,
4005
- swatch: palette.kind === "invalid" ? null : palette.colors.primary,
3913
+ swatch: palette.colors.primary,
4006
3914
  expanded,
4007
3915
  onToggle,
4008
- children: [
4009
- mutationCapability.kind === "blocked" && mutationCapability.reason === "invalid-palette" ? /* @__PURE__ */ jsx("div", {
4010
- role: "status",
4011
- className: "mb-3 flex items-center justify-between gap-3 rounded-md border border-muted px-3 py-2 text-xs text-muted-foreground",
4012
- children: /* @__PURE__ */ jsx("span", { children: mutationCapability.message })
4013
- }) : null,
4014
- library.kind === "loading" ? /* @__PURE__ */ jsx("p", {
4015
- className: "text-xs text-muted-foreground",
4016
- children: "Loading palettes..."
4017
- }) : null,
4018
- library.kind === "failed" ? /* @__PURE__ */ jsxs("div", {
4019
- role: "status",
4020
- className: "space-y-2 text-xs text-muted-foreground",
4021
- children: [/* @__PURE__ */ jsx("p", { children: library.message }), /* @__PURE__ */ jsx(Button, {
4022
- type: "button",
4023
- size: "sm",
4024
- variant: "outline",
4025
- onClick: () => setLibrary({
4026
- kind: "idle",
4027
- palettes: library.palettes
4028
- }),
4029
- children: "Retry loading palettes"
4030
- })]
4031
- }) : null,
4032
- libraryModel.ok ? /* @__PURE__ */ jsxs("div", {
4033
- role: "radiogroup",
4034
- "aria-label": "Palette library",
4035
- className: "space-y-3",
4036
- children: [
4037
- /* @__PURE__ */ jsx(PaletteLibraryGroup, {
4038
- label: "Your palettes",
4039
- items: libraryModel.model.yours,
4040
- offset: 0,
4041
- optionRefs,
4042
- onPreview,
4043
- onOptionKeyDown,
4044
- disabled
4045
- }),
4046
- /* @__PURE__ */ jsx(PaletteLibraryGroup, {
4047
- label: "Suggested for this style",
4048
- items: libraryModel.model.suggested,
4049
- offset: libraryModel.model.yours.length,
4050
- optionRefs,
4051
- onPreview,
4052
- onOptionKeyDown,
4053
- disabled
4054
- }),
4055
- /* @__PURE__ */ jsx(PaletteLibraryGroup, {
4056
- label: "More palettes",
4057
- items: libraryModel.model.more,
4058
- offset: libraryModel.model.yours.length + libraryModel.model.suggested.length,
4059
- optionRefs,
4060
- onPreview,
4061
- onOptionKeyDown,
4062
- disabled
4063
- })
4064
- ]
4065
- }) : /* @__PURE__ */ jsx("p", {
4066
- role: "status",
4067
- className: "text-xs text-muted-foreground",
4068
- children: "Palette details are unavailable."
4069
- }),
4070
- /* @__PURE__ */ jsxs(Button, {
4071
- type: "button",
4072
- size: "sm",
4073
- variant: "outline",
4074
- className: "mt-3",
4075
- onClick: onCreate,
4076
- disabled: mutationDisabled,
4077
- children: [/* @__PURE__ */ jsx(Plus, {
4078
- "aria-hidden": "true",
4079
- className: "size-3.5"
4080
- }), "Create palette"]
4081
- }),
4082
- palette.kind !== "invalid" ? /* @__PURE__ */ jsx(PaletteTokenControls, {
4083
- palette: palette.colors,
4084
- isCustom,
4085
- onTokenChange,
4086
- onReset,
4087
- disabled: mutationDisabled
4088
- }) : null
4089
- ]
3916
+ children: [/* @__PURE__ */ jsxs("div", {
3917
+ role: "radiogroup",
3918
+ "aria-label": "Palette library",
3919
+ className: "space-y-3",
3920
+ children: [/* @__PURE__ */ jsx(CuratedPaletteGroup, {
3921
+ label: "Suggested for this style",
3922
+ items: suggested,
3923
+ selectedValueKey: palette.curatedValueKey,
3924
+ offset: 0,
3925
+ optionRefs,
3926
+ onPreview,
3927
+ onOptionKeyDown,
3928
+ disabled
3929
+ }), /* @__PURE__ */ jsx(CuratedPaletteGroup, {
3930
+ label: "More palettes",
3931
+ items: more,
3932
+ selectedValueKey: palette.curatedValueKey,
3933
+ offset: suggested.length,
3934
+ optionRefs,
3935
+ onPreview,
3936
+ onOptionKeyDown,
3937
+ disabled
3938
+ })]
3939
+ }), /* @__PURE__ */ jsx(PaletteTokenControls, {
3940
+ palette: palette.colors,
3941
+ onTokenChange,
3942
+ disabled: mutationDisabled
3943
+ })]
4090
3944
  });
4091
3945
  }
4092
- function PaletteLibraryGroup({ label, items, offset, optionRefs, onPreview, onOptionKeyDown, disabled }) {
3946
+ function CuratedPaletteGroup({ label, items, selectedValueKey, offset, optionRefs, onPreview, onOptionKeyDown, disabled }) {
4093
3947
  if (items.length === 0) return null;
4094
3948
  return /* @__PURE__ */ jsxs("section", {
4095
3949
  "aria-label": label,
@@ -4104,53 +3958,37 @@ function PaletteLibraryGroup({ label, items, offset, optionRefs, onPreview, onOp
4104
3958
  },
4105
3959
  type: "button",
4106
3960
  role: "radio",
4107
- "aria-label": item.accessibleLabel,
4108
- "aria-checked": item.selected,
3961
+ "aria-label": `${item.name}. ${item.description}`,
3962
+ "aria-checked": item.valueKey === selectedValueKey,
4109
3963
  disabled,
4110
- onClick: () => onPreview(item),
3964
+ onClick: () => onPreview(item.valueKey),
4111
3965
  onKeyDown: (event) => onOptionKeyDown(event, offset + index),
4112
- className: cn("relative h-10 overflow-hidden rounded-md border p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", item.selected ? "border-foreground ring-1 ring-foreground" : "border-border hover:border-foreground/60"),
3966
+ className: cn("relative h-10 overflow-hidden rounded-md border p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", item.valueKey === selectedValueKey ? "border-foreground ring-1 ring-foreground" : "border-border hover:border-foreground/60"),
4113
3967
  children: [/* @__PURE__ */ jsx("span", {
4114
3968
  className: "grid h-full grid-cols-5 overflow-hidden rounded-[3px]",
4115
3969
  "aria-hidden": "true",
4116
- children: item.swatch.map((color, swatchIndex) => /* @__PURE__ */ jsx("span", { style: { backgroundColor: color } }, `${paletteLibraryItemKey(item)}:${swatchIndex}`))
4117
- }), item.selected ? /* @__PURE__ */ jsx("span", {
3970
+ children: [
3971
+ item.colors.primary,
3972
+ item.colors.secondary,
3973
+ item.colors.accent,
3974
+ item.colors.background,
3975
+ item.colors.text
3976
+ ].map((color, swatchIndex) => /* @__PURE__ */ jsx("span", { style: { backgroundColor: color } }, `${item.valueKey}:${swatchIndex}`))
3977
+ }), item.valueKey === selectedValueKey ? /* @__PURE__ */ jsx("span", {
4118
3978
  className: "absolute right-1 top-1 grid size-4 place-items-center rounded-full bg-foreground text-background",
4119
3979
  children: /* @__PURE__ */ jsx(Check, {
4120
3980
  "aria-hidden": "true",
4121
3981
  className: "size-3"
4122
3982
  })
4123
3983
  }) : null]
4124
- }, paletteLibraryItemKey(item)))
3984
+ }, item.valueKey))
4125
3985
  })]
4126
3986
  });
4127
3987
  }
4128
- function paletteLibraryItemKey(item) {
4129
- return item.kind === "curated" ? `curated:${item.valueKey}` : `site:${item.paletteId}`;
4130
- }
4131
- function selectionForPaletteSnapshot(palette) {
4132
- switch (palette.kind) {
4133
- case "curated": return {
4134
- kind: "curated",
4135
- valueKey: palette.valueKey
4136
- };
4137
- case "curated-fork": return {
4138
- kind: "curated",
4139
- valueKey: palette.sourceValueKey
4140
- };
4141
- case "site": return {
4142
- kind: "site",
4143
- paletteId: palette.paletteId
4144
- };
4145
- case "new-site":
4146
- case "invalid": return null;
4147
- default: return assertNever$1(palette);
4148
- }
4149
- }
4150
- function PaletteTokenControls({ palette, isCustom, onTokenChange, onReset, disabled }) {
4151
- return /* @__PURE__ */ jsxs("div", {
3988
+ function PaletteTokenControls({ palette, onTokenChange, disabled }) {
3989
+ return /* @__PURE__ */ jsx("div", {
4152
3990
  className: "mt-4 space-y-3 border-t pt-4",
4153
- children: [/* @__PURE__ */ jsx("fieldset", {
3991
+ children: /* @__PURE__ */ jsx("fieldset", {
4154
3992
  disabled,
4155
3993
  className: "min-w-0 border-0 p-0",
4156
3994
  children: /* @__PURE__ */ jsx(PaletteTokenEditor, {
@@ -4162,17 +4000,7 @@ function PaletteTokenControls({ palette, isCustom, onTokenChange, onReset, disab
4162
4000
  showContrastChecks: false,
4163
4001
  disabled
4164
4002
  })
4165
- }), isCustom ? /* @__PURE__ */ jsx("div", {
4166
- className: "flex justify-end",
4167
- children: /* @__PURE__ */ jsx(Button, {
4168
- type: "button",
4169
- variant: "outline",
4170
- size: "sm",
4171
- onClick: onReset,
4172
- disabled,
4173
- children: "Reset to variant"
4174
- })
4175
- }) : null]
4003
+ })
4176
4004
  });
4177
4005
  }
4178
4006
  function PickerOption({ selected, label, description, swatch, onSelect, disabled }) {
@@ -4204,8 +4032,6 @@ function PickerOption({ selected, label, description, swatch, onSelect, disabled
4204
4032
  }
4205
4033
  function paletteApplyPlanErrorMessage(error) {
4206
4034
  switch (error) {
4207
- case "invalid-palette-state": return "Palette details are unavailable. Refresh and try again.";
4208
- case "curated-palette-missing": return "This curated palette is no longer available. Refresh and try again.";
4209
4035
  case "no-selection-changes": return "There are no design changes to apply.";
4210
4036
  default: return assertNever$1(error);
4211
4037
  }
@@ -4218,10 +4044,6 @@ function classifyStyleApplyError(error) {
4218
4044
  if (isRecord(error)) {
4219
4045
  const status = error.status;
4220
4046
  const code = error.code ?? error.errorCode;
4221
- if (code === "PALETTE_CAP_REACHED") return {
4222
- kind: "palette-cap",
4223
- message: "This site has reached its palette limit. Your palette draft is still here."
4224
- };
4225
4047
  if (status === 409 || code === "resource:conflict") return {
4226
4048
  kind: "stale",
4227
4049
  message: "This design changed elsewhere. Refreshing the latest version now."
@@ -4271,7 +4093,7 @@ function describeWarning(warning) {
4271
4093
  }
4272
4094
  //#endregion
4273
4095
  //#region ../preview-next/src/client/preview/PreviewEditorSidebar.tsx
4274
- function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, runtimePaletteState, themeSelectionHeaderLayoutId = null, themeSelectionHeaderStyleId = null, themeSelectionHeaderLookId = null, themeSelectionFooterLookId = null, themeSelectionHeaderContext, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, activeTab, onTabChange, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
4096
+ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonStyleSelection = null, themeSelectionHeaderLayoutId = null, themeSelectionHeaderStyleId = null, themeSelectionHeaderLookId = null, themeSelectionFooterLookId = null, themeSelectionHeaderContext, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, activeTab, onTabChange, onClose, onFooterSaved, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
4275
4097
  const controller = useEntryController();
4276
4098
  const controllerBlocks = controller.blocks;
4277
4099
  const uiStore = useEditorUiStoreInstance();
@@ -4411,7 +4233,6 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
4411
4233
  selectionVersion: themeSelectionVersion,
4412
4234
  selectionUpdatedAt: themeSelectionUpdatedAt,
4413
4235
  buttonStyleSelection: themeSelectionButtonStyleSelection,
4414
- runtimePaletteState,
4415
4236
  headerLayoutId: themeSelectionHeaderLayoutId,
4416
4237
  headerStyleId: themeSelectionHeaderStyleId,
4417
4238
  headerLookId: themeSelectionHeaderLookId,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { Al as Redo2, Cc as DropdownMenuContent, Dc as DropdownMenuTrigger, El as Sparkles, Fc as Button, Gs as TooltipTrigger, Gt as classifyHistoryShortcut, Hl as EllipsisVertical, Ic as cva, Jl as ChevronDown, Kt as useEditorUiStore, Lt as useEditor, Ml as Pencil, Nl as PenLine, Pl as Palette, Rc as cn, Rl as LoaderCircle, Sc as DropdownMenu, Sl as TriangleAlert, Us as Tooltip, Vl as Eye, Ws as TooltipContent, a as previewDesignHistoryDomainForCommand, cc as Dialog, fc as DialogHeader, gt as useEntryEditorController, i as usePreviewDesignHistoryOrder, lc as DialogContent, n as useSiteChromeCustomizeOptional, o as selectPreviewDesignHistoryDomain, pc as DialogTitle, qt as useEditorUiStoreInstance, rn as useMultiAutosave, uc as DialogDescription, wc as DropdownMenuItem, xl as Undo2 } from "./SiteChromeCustomizeContext-BHF-KANn.mjs";
3
- import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-CJX21dGi.mjs";
4
- import { C as FixedBottomSurface, a as usePreviewPageDesignEditorState, c as applyPreviewChromeSurfaceToElement, l as resolvePreviewChromeSurface, o as PREVIEW_CHROME_PORTAL_CLASS_NAME, s as PREVIEW_CHROME_THEME_CLASS_NAME } from "./SdkPreviewModeRuntime-Co3AHfj0.mjs";
2
+ import { $s as DialogContent, Bt as useEditorUiStore, Cl as PenLine, Ec as cva, Fs as TooltipTrigger, Ml as EllipsisVertical, Ns as Tooltip, Oc as cn, Ol as LoaderCircle, Ps as TooltipContent, Qs as Dialog, Rl as ChevronDown, Sl as Pencil, Tc as Button, Vt as useEditorUiStoreInstance, Zt as useMultiAutosave, _c as DropdownMenuTrigger, a as previewDesignHistoryDomainForCommand, bl as Redo2, dl as Undo2, ec as DialogDescription, fc as DropdownMenu, fl as TriangleAlert, gl as Sparkles, i as usePreviewDesignHistoryOrder, jl as Eye, jt as useEditor, mc as DropdownMenuItem, n as useSiteChromeCustomizeOptional, nc as DialogHeader, o as selectPreviewDesignHistoryDomain, pc as DropdownMenuContent, rc as DialogTitle, ut as useEntryEditorController, wl as Palette, zt as classifyHistoryShortcut } from "./SiteChromeCustomizeContext-DZiDBAYu.mjs";
3
+ import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-Dev9CdG9.mjs";
4
+ import { C as FixedBottomSurface, a as usePreviewPageDesignEditorState, c as applyPreviewChromeSurfaceToElement, l as resolvePreviewChromeSurface, o as PREVIEW_CHROME_PORTAL_CLASS_NAME, s as PREVIEW_CHROME_THEME_CLASS_NAME } from "./SdkPreviewModeRuntime-B0HPXr-l.mjs";
5
5
  import * as React$1 from "react";
6
6
  import { useCallback, useEffect, useMemo, useState, useTransition } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { n as markPreviewAuthExpired, s as ApiRequestError } from "./previewAuthStore-CJX21dGi.mjs";
2
+ import { n as markPreviewAuthExpired, s as ApiRequestError } from "./previewAuthStore-Dev9CdG9.mjs";
3
3
  import { createContext, useContext, useRef } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";