@riverbankcms/sdk 0.79.0 → 0.81.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 (327) hide show
  1. package/dist/PreviewEditorSidebar-RDCMEXIJ.mjs +3163 -0
  2. package/dist/{PreviewEditorUI-27KJVEET.mjs → PreviewEditorUI-NYGQ6K7B.mjs} +194 -30
  3. package/dist/SdkPreviewModeRuntime-AKCSCZEC.mjs +8 -0
  4. package/dist/_dts/ai/src/contracts/proposals.d.ts +20 -0
  5. package/dist/_dts/api/src/contentRuntime.d.ts +12 -0
  6. package/dist/_dts/api/src/contentTypes.d.ts +6 -0
  7. package/dist/_dts/api/src/endpoints.d.ts +24 -0
  8. package/dist/_dts/api/src/index.d.ts +3 -3
  9. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +53 -0
  10. package/dist/_dts/api/src/siteInfrastructure.d.ts +124 -0
  11. package/dist/_dts/api/src/siteOnboarding.d.ts +13 -0
  12. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +10 -1
  13. package/dist/_dts/block-form/src/backend/store-backend.d.ts +3 -1
  14. package/dist/_dts/block-form/src/backend/types.d.ts +3 -3
  15. package/dist/_dts/block-form/src/client/index.d.ts +2 -0
  16. package/dist/_dts/block-form/src/index.d.ts +2 -0
  17. package/dist/_dts/block-form/src/utils/evaluateVisibility.d.ts +2 -1
  18. package/dist/_dts/blocks/src/PageRenderer.d.ts +3 -0
  19. package/dist/_dts/blocks/src/client/header.d.ts +1 -1
  20. package/dist/_dts/blocks/src/client.d.ts +12 -12
  21. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +20 -28
  22. package/dist/_dts/blocks/src/index.d.ts +7 -5
  23. package/dist/_dts/blocks/src/primitives/content/components/Text.d.ts +1 -1
  24. package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
  25. package/dist/_dts/blocks/src/server.d.ts +1 -1
  26. package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +3 -2
  27. package/dist/_dts/blocks/src/system/blocks/events/event-listing.d.ts +2 -2
  28. package/dist/_dts/blocks/src/system/blocks/events/event-spotlight.d.ts +2 -1
  29. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +135 -0
  30. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +9 -1
  31. package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +2 -0
  32. package/dist/_dts/blocks/src/system/blocks/form.d.ts +20 -1
  33. package/dist/_dts/blocks/src/system/blocks/hero.d.ts +2 -0
  34. package/dist/_dts/blocks/src/system/blocks/offerings-preview/index.d.ts +19 -0
  35. package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +134 -0
  36. package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +7 -1
  37. package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
  38. package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
  39. package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
  40. package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +34 -15
  41. package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
  42. package/dist/_dts/blocks/src/system/data/linkedContentEntries.d.ts +64 -0
  43. package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
  44. package/dist/_dts/blocks/src/system/designCapabilities.d.ts +2 -2
  45. package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +10 -3
  46. package/dist/_dts/blocks/src/system/fragments/library/testimonialsCarousel.d.ts +5 -0
  47. package/dist/_dts/blocks/src/system/media/slotContracts.d.ts +2 -0
  48. package/dist/_dts/blocks/src/system/node/fragments/headingDecoration.d.ts +1 -4
  49. package/dist/_dts/blocks/src/system/node/types.d.ts +8 -1
  50. package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +2 -2
  51. package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
  52. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +51 -57
  53. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -27
  54. package/dist/_dts/blocks/src/system/runtime/header/enhanceHeaderSection.d.ts +10 -2
  55. package/dist/_dts/blocks/src/system/runtime/headingDecoration.d.ts +21 -0
  56. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +45 -14
  57. package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.d.ts +2 -9
  58. package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.d.ts +1 -10
  59. package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +1 -0
  60. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +21 -16
  61. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +3 -2
  62. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +21 -16
  63. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +22 -33
  64. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.server.d.ts +2 -2
  65. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventSpotlight.d.ts +2 -2
  66. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +2 -2
  67. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +2 -2
  68. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +2 -2
  69. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventPaginatedListView.client.d.ts +2 -3
  70. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +3 -3
  71. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listOptions.d.ts +50 -0
  72. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +2 -1
  73. package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +2 -2
  74. package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +29 -14
  75. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview.d.ts +21 -0
  76. package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +7 -0
  77. package/dist/_dts/blocks/src/system/transforms/registry/_utils/sectionForegroundStyles.d.ts +2 -0
  78. package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +7 -2
  79. package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +9 -0
  80. package/dist/_dts/blocks/src/system/transforms/typed.d.ts +14 -1
  81. package/dist/_dts/calendar/src/grid.d.ts +27 -0
  82. package/dist/_dts/calendar/src/index.d.ts +2 -2
  83. package/dist/_dts/content-editor/src/controller/useAutosaveTriggers.d.ts +3 -1
  84. package/dist/_dts/content-editor/src/editorTransactionState.d.ts +1 -0
  85. package/dist/_dts/content-editor/src/hooks/autosaveScopePlanning.d.ts +26 -0
  86. package/dist/_dts/content-editor/src/hooks/publishability.d.ts +1 -0
  87. package/dist/_dts/content-editor/src/hooks/useLinkedEntryAutosave.d.ts +23 -0
  88. package/dist/_dts/content-editor/src/hooks/useReactiveToolbar.d.ts +1 -1
  89. package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +2 -2
  90. package/dist/_dts/content-editor/src/index.d.ts +3 -1
  91. package/dist/_dts/content-editor/src/lib/json.d.ts +2 -0
  92. package/dist/_dts/content-editor/src/linkedEntries/domain.d.ts +8 -0
  93. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +58 -0
  94. package/dist/_dts/content-editor/src/ui/editorTransactionState.d.ts +93 -0
  95. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +60 -3
  96. package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +2 -0
  97. package/dist/_dts/content-editor/src/ui/stores/types.d.ts +1 -1
  98. package/dist/_dts/content-model/src/content-types/builtins.d.ts +43 -0
  99. package/dist/_dts/content-model/src/metadataConfig.d.ts +87 -47
  100. package/dist/_dts/core/src/branded.d.ts +5 -0
  101. package/dist/_dts/core/src/index.d.ts +1 -0
  102. package/dist/_dts/core/src/stable-json.d.ts +1 -0
  103. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +9 -3
  104. package/dist/_dts/editor/src/EditorProvider.d.ts +26 -0
  105. package/dist/_dts/editor/src/chrome/EditorChrome.d.ts +26 -0
  106. package/dist/_dts/editor/src/chrome/EditorStatusBar.d.ts +45 -0
  107. package/dist/_dts/editor/src/chrome/statusBarPresentation.d.ts +25 -0
  108. package/dist/_dts/editor/src/components/EditingToggle.d.ts +9 -0
  109. package/dist/_dts/editor/src/hooks/useEditableElement.d.ts +18 -0
  110. package/dist/_dts/editor/src/index.d.ts +29 -0
  111. package/dist/_dts/editor/src/inline/InlineTextEditor.d.ts +1 -0
  112. package/dist/_dts/editor/src/lib/utils.d.ts +1 -0
  113. package/dist/_dts/editor/src/primitives/EditorPrimitivesProvider.d.ts +20 -0
  114. package/dist/_dts/editor/src/primitives/InlineFieldContext.d.ts +11 -0
  115. package/dist/_dts/editor/src/primitives/SaveContext.d.ts +12 -0
  116. package/dist/_dts/editor/src/primitives/helpers.d.ts +1 -0
  117. package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +26 -0
  118. package/dist/_dts/editor/src/primitives/rich-text/RichTextToolbar.d.ts +16 -0
  119. package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +23 -0
  120. package/dist/_dts/editor/src/primitives/rich-text/extensions/RichTextImage.d.ts +2 -0
  121. package/dist/_dts/editor/src/primitives/rich-text/extensions/RichTextLink.d.ts +1 -0
  122. package/dist/_dts/editor/src/primitives/rich-text/imageActions.d.ts +22 -0
  123. package/dist/_dts/editor/src/primitives/rich-text/sanitize.d.ts +23 -0
  124. package/dist/_dts/editor/src/primitives/rich-text/toolbar/BlockTypeDropdown.d.ts +6 -0
  125. package/dist/_dts/editor/src/primitives/rich-text/toolbar/LinkPopover.d.ts +10 -0
  126. package/dist/_dts/editor/src/primitives/rich-text/toolbar/ToolbarIconButton.d.ts +11 -0
  127. package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +58 -0
  128. package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +19 -0
  129. package/dist/_dts/editor/src/primitives/rich-text/utils.d.ts +20 -0
  130. package/dist/_dts/editor/src/utils/optimisticTokens.d.ts +27 -0
  131. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +2 -2
  132. package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +5 -9
  133. package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +2 -6
  134. package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +6 -10
  135. package/dist/_dts/editor-blocks/src/block-editor/FeatureCardIconsPanel.d.ts +2 -6
  136. package/dist/_dts/editor-blocks/src/block-editor/GeneratedIconSetDialog.d.ts +6 -4
  137. package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +4 -8
  138. package/dist/_dts/editor-blocks/src/block-editor/actionPresentation.d.ts +15 -0
  139. package/dist/_dts/editor-blocks/src/block-editor/blockHeaderActionPlan.d.ts +49 -0
  140. package/dist/_dts/editor-blocks/src/index.d.ts +2 -0
  141. package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
  142. package/dist/_dts/editor-blocks/src/widgets/rich-text/RichTextWidgetProvider.d.ts +1 -1
  143. package/dist/_dts/editor-blocks/src/widgets/rich-text/useImagePicker.d.ts +1 -1
  144. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionPickerField.d.ts +3 -0
  145. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/SiteOptionWidgetProvider.d.ts +14 -0
  146. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/index.d.ts +6 -0
  147. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +51 -0
  148. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/types.d.ts +20 -0
  149. package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +5 -0
  150. package/dist/_dts/media-core/src/index.d.ts +1 -0
  151. package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +18 -0
  152. package/dist/_dts/media-editor/src/MediaEditor.d.ts +4 -1
  153. package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +2 -1
  154. package/dist/_dts/media-editor/src/index.d.ts +1 -1
  155. package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +7 -2
  156. package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +5 -1
  157. package/dist/_dts/preview-next/src/client/blocks/blockCustomizePopoverRows.d.ts +25 -0
  158. package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +2 -1
  159. package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +4 -30
  160. package/dist/_dts/preview-next/src/client/blocks/linkedEntryRenderOverlay.d.ts +11 -0
  161. package/dist/_dts/preview-next/src/client/blocks/previewCustomizeActions.d.ts +3 -9
  162. package/dist/_dts/preview-next/src/client/blocks/previewCustomizeControlPlan.d.ts +24 -0
  163. package/dist/_dts/preview-next/src/client/blocks/useBlockCustomizeControls.d.ts +35 -0
  164. package/dist/_dts/preview-next/src/client/index.d.ts +0 -1
  165. package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +3 -1
  166. package/dist/_dts/preview-next/src/client/preview/LinkedEntryEditEventBridge.d.ts +1 -0
  167. package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +5 -6
  168. package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +4 -1
  169. package/dist/_dts/preview-next/src/client/preview/PreviewBlockCustomizeSelectionContext.d.ts +20 -0
  170. package/dist/_dts/preview-next/src/client/preview/PreviewChromeLayer.d.ts +20 -0
  171. package/dist/_dts/preview-next/src/client/preview/PreviewDesignHistoryOrderContext.d.ts +13 -0
  172. package/dist/_dts/preview-next/src/client/preview/PreviewOpenEditorButton.d.ts +2 -0
  173. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +19 -19
  174. package/dist/_dts/preview-next/src/client/preview/PreviewSidebarSection.d.ts +13 -0
  175. package/dist/_dts/preview-next/src/client/preview/SelectedBlockCustomizePanel.d.ts +13 -0
  176. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +47 -4
  177. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +14 -1
  178. package/dist/_dts/preview-next/src/client/preview/linkedEntryEditEvents.d.ts +5 -0
  179. package/dist/_dts/preview-next/src/client/preview/previewChromePlacement.d.ts +46 -0
  180. package/dist/_dts/preview-next/src/client/preview/previewCustomizeControls.d.ts +68 -0
  181. package/dist/_dts/preview-next/src/client/preview/previewCustomizeEditorDraftPatch.d.ts +13 -0
  182. package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +8 -1
  183. package/dist/_dts/preview-next/src/client/preview/previewCustomizeRuntimePatch.d.ts +2 -0
  184. package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +11 -9
  185. package/dist/_dts/preview-next/src/client/preview/previewDesignHistoryOrder.d.ts +18 -0
  186. package/dist/_dts/preview-next/src/client/preview/previewUndoDomains.d.ts +1 -1
  187. package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +41 -0
  188. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +101 -0
  189. package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +29 -0
  190. package/dist/_dts/preview-next/src/client/preview/siteStyleHistoryState.d.ts +55 -0
  191. package/dist/_dts/preview-next/src/client/preview/storeTypes.d.ts +4 -0
  192. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -0
  193. package/dist/_dts/preview-next/src/client/widgets/widgetAdapters.d.ts +2 -1
  194. package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +6 -3
  195. package/dist/_dts/preview-next/src/constants.d.ts +0 -1
  196. package/dist/_dts/sdk/src/cli/commands/webhooks.d.ts +44 -0
  197. package/dist/_dts/sdk/src/cli/config-loader.d.ts +3 -1
  198. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -3
  199. package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +1 -0
  200. package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +3 -1
  201. package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +1 -0
  202. package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
  203. package/dist/_dts/sdk/src/client/management/types.d.ts +56 -0
  204. package/dist/_dts/sdk/src/client/management/webhooks.d.ts +3 -0
  205. package/dist/_dts/sdk/src/config/types.d.ts +1 -1
  206. package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
  207. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +34 -5
  208. package/dist/_dts/sdk/src/public-api/contracts.d.ts +10 -0
  209. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +42 -0
  210. package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +4 -0
  211. package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
  212. package/dist/_dts/sdk/src/version.d.ts +1 -1
  213. package/dist/_dts/theme-core/src/accordions/siteStyleDefaults.d.ts +220 -0
  214. package/dist/_dts/theme-core/src/accordions/types.d.ts +45 -2
  215. package/dist/_dts/theme-core/src/blockOverrides.d.ts +8 -0
  216. package/dist/_dts/theme-core/src/blocks/types.d.ts +1 -1
  217. package/dist/_dts/theme-core/src/blocks/vars/testimonials.d.ts +4 -1
  218. package/dist/_dts/theme-core/src/buttons/constants.d.ts +26 -1
  219. package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
  220. package/dist/_dts/theme-core/src/buttons/personalities/joy-stamp.d.ts +22 -0
  221. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +2 -1
  222. package/dist/_dts/theme-core/src/buttons/types.d.ts +9 -0
  223. package/dist/_dts/theme-core/src/cards/core.d.ts +20 -0
  224. package/dist/_dts/theme-core/src/cards/generateDefaultCardSystem.d.ts +6 -3
  225. package/dist/_dts/theme-core/src/cards/siteStyleDefaults.d.ts +149 -0
  226. package/dist/_dts/theme-core/src/cards/types.d.ts +177 -0
  227. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  228. package/dist/_dts/theme-core/src/interactive/types.d.ts +10 -0
  229. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +180 -21
  230. package/dist/_dts/theme-core/src/palette/variants/index.d.ts +30 -0
  231. package/dist/_dts/theme-core/src/palette/variants/soft-natural.d.ts +16 -0
  232. package/dist/_dts/theme-core/src/palette/variants/types.d.ts +1 -1
  233. package/dist/_dts/theme-core/src/palette/variants/warm-dark.d.ts +27 -0
  234. package/dist/_dts/theme-core/src/schema.d.ts +486 -55
  235. package/dist/_dts/theme-core/src/site-styles/accessibleSurfaces.d.ts +4 -1
  236. package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +172 -47
  237. package/dist/_dts/theme-core/src/site-styles/appearancePresetResolution.d.ts +6 -2
  238. package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +2 -3
  239. package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +172 -47
  240. package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +140 -2
  241. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +18 -2
  242. package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +20 -1
  243. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +10 -2
  244. package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +291 -6
  245. package/dist/_dts/theme-core/src/site-styles/index.d.ts +3 -0
  246. package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +193 -0
  247. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -23
  248. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +276 -4
  249. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +2 -8
  250. package/dist/_dts/theme-core/src/site-styles/rawStyleFields.d.ts +2 -0
  251. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +43 -10
  252. package/dist/_dts/theme-core/src/site-styles/sectionTransitions.d.ts +508 -0
  253. package/dist/_dts/theme-core/src/site-styles/siteStyleThemeCompiler.d.ts +11 -0
  254. package/dist/_dts/theme-core/src/site-styles/sourceCatalogs.d.ts +10 -10
  255. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
  256. package/dist/_dts/theme-core/src/site-styles/testimonialQuotePresets.d.ts +15 -0
  257. package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
  258. package/dist/_dts/theme-core/src/site-styles/types.d.ts +28 -32
  259. package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +16 -1
  260. package/dist/{chunk-4HCW7FHJ.mjs → chunk-3PTVPAT4.mjs} +1984 -1142
  261. package/dist/{PreviewEditorSidebar-56NMJMIK.mjs → chunk-3QWQ2MUQ.mjs} +1050 -2609
  262. package/dist/{chunk-GP555I66.mjs → chunk-3VT7LZY2.mjs} +413 -157
  263. package/dist/{chunk-A3HHFKVT.mjs → chunk-4T5JIPWY.mjs} +1 -1
  264. package/dist/{chunk-K2IIF34C.mjs → chunk-E3NZYEKF.mjs} +25 -7
  265. package/dist/{chunk-V47ZU33I.mjs → chunk-WUHKQBB6.mjs} +12062 -3211
  266. package/dist/cli/index.mjs +3395 -817
  267. package/dist/cli/init-docs/content/workflow-isr-revalidation.md +16 -4
  268. package/dist/client/{accordion-QLA7KBYO.mjs → accordion-SFIIZWNH.mjs} +2 -2
  269. package/dist/client/{bookingForm-PYZIPA5G.mjs → bookingForm-CFKZVWGA.mjs} +5 -5
  270. package/dist/client/bookings.mjs +1422 -345
  271. package/dist/client/{carousel-5EIULWBI.mjs → carousel-ELXWSBLA.mjs} +3 -3
  272. package/dist/client/{cart-DOP3FNI4.mjs → cart-6SSCPYY5.mjs} +6 -6
  273. package/dist/client/{checkout-BVMF6FBV.mjs → checkout-UFQ34HPV.mjs} +6 -6
  274. package/dist/client/{chunk-44K2U3QI.mjs → chunk-76JUETXQ.mjs} +139 -186
  275. package/dist/client/{chunk-AUJ5DBZJ.mjs → chunk-7BXX7WXH.mjs} +112 -28
  276. package/dist/client/{chunk-UDS3NTWA.mjs → chunk-G56BSZAM.mjs} +2 -2
  277. package/dist/client/{chunk-V6M5FCR5.mjs → chunk-IUEDYLFJ.mjs} +1 -1
  278. package/dist/client/{chunk-YLDYVRZL.mjs → chunk-NP47RHIX.mjs} +5 -5
  279. package/dist/client/{chunk-R5ESWNKX.mjs → chunk-NX6X3GRF.mjs} +419 -85
  280. package/dist/client/{chunk-CCNTDRCF.mjs → chunk-PA2LJH2M.mjs} +2 -2
  281. package/dist/client/{chunk-CE7IBGVW.mjs → chunk-RMWMT3ZD.mjs} +1 -1
  282. package/dist/client/{chunk-TYONZMST.mjs → chunk-TCJS3NY5.mjs} +1 -1
  283. package/dist/client/{chunk-GG4M2NP6.mjs → chunk-V6XI4M2Q.mjs} +1 -1
  284. package/dist/client/client.mjs +9077 -4410
  285. package/dist/client/{courseRegistration-E6EAA6NL.mjs → courseRegistration-HJIISAAG.mjs} +5 -5
  286. package/dist/client/{eventCalendar-HBG3HAK6.mjs → eventCalendar-F6YVUCZR.mjs} +7 -7
  287. package/dist/client/{eventCombined-6K5ZZWAK.mjs → eventCombined-B5DSTIOK.mjs} +7 -7
  288. package/dist/client/{eventDetails-Q75ICXLT.mjs → eventDetails-SEJDDHQC.mjs} +7 -7
  289. package/dist/client/{eventListing-27P5F7DZ.mjs → eventListing-TPMWIIBO.mjs} +7 -7
  290. package/dist/client/{eventRegistration-IQ7AMASR.mjs → eventRegistration-QU6W2PV6.mjs} +7 -7
  291. package/dist/client/{form-JRTD65FN.mjs → form-LVTYNTDE.mjs} +2 -2
  292. package/dist/client/{headerSection-7FPSSZHS.mjs → headerSection-SO3MFC4U.mjs} +110 -28
  293. package/dist/client/hooks.mjs +4695 -2260
  294. package/dist/client/{locationMap-7NGFNYBH.mjs → locationMap-5E5FLAKO.mjs} +2 -2
  295. package/dist/client/{newsletterForm-F3BADCI2.mjs → newsletterForm-GN32JEBQ.mjs} +2 -2
  296. package/dist/client/{productDetail-V3HP7ITJ.mjs → productDetail-Q346KSVR.mjs} +6 -6
  297. package/dist/client/{productList-L3EGJUF2.mjs → productList-DTDMQYGZ.mjs} +6 -6
  298. package/dist/client/rendering/client.mjs +5795 -3582
  299. package/dist/client/rendering/islands.mjs +32 -20
  300. package/dist/client/rendering.mjs +7988 -3317
  301. package/dist/client/{shop-DQUB5E2C.mjs → shop-OFUW7KPN.mjs} +6 -6
  302. package/dist/preview-next/before-render.mjs +24 -0
  303. package/dist/preview-next/client/runtime.mjs +5 -5
  304. package/dist/preview-next/constants.mjs +0 -2
  305. package/dist/preview-next/index.mjs +0 -2
  306. package/dist/preview-next/middleware.mjs +24 -0
  307. package/dist/{sdk-runtime-AF6KXJU4.mjs → sdk-runtime-2GIX6I7X.mjs} +6 -6
  308. package/dist/server/components.mjs +7384 -3089
  309. package/dist/server/config-validation.mjs +4747 -2418
  310. package/dist/server/config.mjs +4747 -2418
  311. package/dist/server/data.mjs +4695 -2260
  312. package/dist/server/index.mjs +26 -1
  313. package/dist/server/next.mjs +7430 -3039
  314. package/dist/server/page-converter.mjs +3985 -2070
  315. package/dist/server/prebuild.mjs +1 -1
  316. package/dist/server/rendering/server.mjs +7489 -3094
  317. package/dist/server/rendering.mjs +7491 -3096
  318. package/dist/server/routing.mjs +4965 -2386
  319. package/dist/server/server.mjs +4713 -2278
  320. package/dist/server/theme-bridge.mjs +2181 -383
  321. package/dist/server/theme.mjs +477 -222
  322. package/dist/styles/index.css +747 -71
  323. package/package.json +1 -1
  324. package/dist/SdkPreviewModeRuntime-H4BSP6E7.mjs +0 -8
  325. package/dist/_dts/editor-blocks/src/block-editor/actionControlMode.d.ts +0 -2
  326. package/dist/_dts/preview-next/src/client/preview/previewSurface.d.ts +0 -3
  327. package/dist/chunk-LCY32PXF.mjs +0 -1175
@@ -1,1175 +0,0 @@
1
- "use client";
2
- import { assertNever2, deriveNearestCompatibleHeaderStyle, findLegacyHeaderLookIdForSelection, compileSiteThemeFromSelections, footerLookCatalog, getOrderedHeaderStyleIdsForLayout, getOrderedHeaderLayoutIdsForCuration, footerLookRejectionReasonLabel, getHeaderStyle, getHeaderLayout, writePlanForLookCustomizationCommand, siteStyleIdFromTheme, getCuratedSiteStyle } from './chunk-V47ZU33I.mjs';
3
- import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- // ../preview-next/src/client/preview/previewChromeSurfacePolicy.ts
7
- var PREVIEW_CHROME_SURFACE_POLICIES = {
8
- core: {
9
- banner: {
10
- tone: "default",
11
- bannerClassName: "border border-emerald-200/70 bg-white/95 shadow-xl backdrop-blur supports-[backdrop-filter]:bg-white/92",
12
- summaryClassName: "rounded-md border border-slate-200 bg-slate-50 px-3 py-2 text-xs text-slate-600",
13
- dialogItemClassName: "rounded-md border border-slate-200 bg-slate-50 px-3 py-2",
14
- titleClassName: "text-sm font-semibold tracking-tight text-foreground [font-family:var(--font-heading)]",
15
- descriptionClassName: "text-sm text-muted-foreground [font-family:var(--font-body)]",
16
- detailClassName: "text-xs text-muted-foreground [font-family:var(--font-body)]",
17
- summaryTitleClassName: "font-medium text-foreground [font-family:var(--font-body)]",
18
- summaryBodyClassName: "mt-1 text-muted-foreground [font-family:var(--font-body)]",
19
- secondaryButtonClassName: "",
20
- primaryButtonClassName: "",
21
- dialogBodyClassName: "space-y-3 text-sm text-muted-foreground [font-family:var(--font-body)]",
22
- dialogItemTitleClassName: "font-medium text-foreground [font-family:var(--font-heading)]",
23
- dialogItemMetaClassName: "ml-2 text-xs font-normal uppercase tracking-wide text-muted-foreground [font-family:var(--font-body)]",
24
- dialogItemDescriptionClassName: "mt-1 text-sm text-muted-foreground [font-family:var(--font-body)]",
25
- ctaLabel: "Complete setup in dashboard",
26
- copyByState: {
27
- awaiting_confirmation: {
28
- title: "Your draft preview is ready",
29
- description: "Explore your site here, then confirm your email to unlock the dashboard and finish launch setup.",
30
- detail: "Once your email is confirmed, Complete setup in dashboard will take you straight to the remaining checklist.",
31
- checklistNote: "Email confirmation is the only blocker before dashboard access. The rest of the launch checklist lives in the dashboard."
32
- },
33
- dashboard_ready: {
34
- title: "Your dashboard is unlocked",
35
- description: "Keep exploring here, then use Complete setup in dashboard to review your pages, add offerings, connect payments, and finish launch setup.",
36
- detail: "The dashboard is the place to complete the remaining checklist and get your site ready to launch.",
37
- checklistNote: "The remaining launch steps are tracked in the same checklist you will see in the dashboard."
38
- },
39
- dashboard_resume: {
40
- title: "Your draft site is ready",
41
- description: "Keep exploring here, then use Complete setup in dashboard to review your pages, add offerings, connect payments, and finish launch setup.",
42
- detail: "The dashboard is the normal place to finish setup for this site.",
43
- checklistNote: "The remaining launch steps are tracked in the same checklist you will see in the dashboard."
44
- }
45
- },
46
- dialog: {
47
- title: "What still happens in the dashboard",
48
- description: "Your preview is ready, but launch steps still happen in the dashboard so you can finish setup safely.",
49
- pendingIntro: "Your preview is live now, but the launch checklist stays in the dashboard so the final setup steps happen in the right place.",
50
- unlockedIntro: "Your preview is live now, and the same checklist will follow you into the dashboard when you are ready to finish setup.",
51
- outro: "You can keep exploring this preview now, then jump back into the dashboard when you're ready to finish setup."
52
- }
53
- },
54
- sidebar: {
55
- tone: "default",
56
- rootClassName: "bg-background",
57
- headerClassName: "border-b",
58
- guidance: {
59
- title: "Make quick edits in preview",
60
- description: "Use preview for copy and layout tweaks. Complete setup in dashboard to add offerings, connect payments, and finish the rest of your launch checklist.",
61
- ctaLabel: "Complete setup in dashboard",
62
- cardClassName: "rounded-lg border border-emerald-200/70 bg-emerald-50/70 px-3 py-3"
63
- }
64
- }
65
- },
66
- macadamia: {
67
- banner: {
68
- tone: "studio",
69
- bannerClassName: "border border-border bg-background shadow-xl",
70
- summaryClassName: "rounded-xl border border-border bg-surface px-3 py-2 text-xs text-foreground",
71
- dialogItemClassName: "rounded-xl border border-border bg-surface px-3 py-2",
72
- titleClassName: "text-sm font-semibold tracking-tight text-foreground [font-family:var(--font-heading)]",
73
- descriptionClassName: "text-sm text-muted-foreground [font-family:var(--font-body)]",
74
- detailClassName: "text-xs text-muted-foreground [font-family:var(--font-body)]",
75
- summaryTitleClassName: "font-medium text-foreground [font-family:var(--font-body)]",
76
- summaryBodyClassName: "mt-1 text-muted-foreground [font-family:var(--font-body)]",
77
- secondaryButtonClassName: "border border-border bg-surface text-foreground hover:bg-button-outline-hover",
78
- primaryButtonClassName: "border border-primary bg-primary text-primary-foreground hover:bg-primary-hover",
79
- dialogBodyClassName: "space-y-3 text-sm text-muted-foreground [font-family:var(--font-body)]",
80
- dialogItemTitleClassName: "font-medium text-foreground [font-family:var(--font-heading)]",
81
- dialogItemMetaClassName: "ml-2 text-xs font-normal uppercase tracking-wide text-muted-foreground [font-family:var(--font-body)]",
82
- dialogItemDescriptionClassName: "mt-1 text-sm text-muted-foreground [font-family:var(--font-body)]",
83
- ctaLabel: "Complete setup in Macadamia",
84
- copyByState: {
85
- awaiting_confirmation: {
86
- title: "Confirm your email to carry on",
87
- description: "We've created the bones of your site. To carry on finishing setup, and to edit your site, you need to confirm your email to activate your account.",
88
- detail: "",
89
- checklistNote: ""
90
- },
91
- dashboard_ready: {
92
- title: "Here's your site preview",
93
- description: "We've created the bones of your site. Have a look around. If you like, you can add your site content here, or you can go straight to your dashboard to complete your setup. You'll be able to edit your site at any time, so don't worry if it's not perfect right now.",
94
- detail: "",
95
- checklistNote: ""
96
- },
97
- dashboard_resume: {
98
- title: "Your studio site is ready",
99
- description: "Keep exploring here, then use Complete setup in Macadamia to review your pages, add offerings, connect payments, and finish launch setup.",
100
- detail: "Macadamia is the normal place to finish setup for this studio site.",
101
- checklistNote: "The remaining launch steps are tracked in the same checklist you will see in Macadamia."
102
- }
103
- },
104
- dialog: {
105
- title: "What still happens in Macadamia",
106
- description: "Your preview is ready, but launch steps still happen in Macadamia so you can finish setup safely.",
107
- pendingIntro: "Your studio preview is live now, but the launch checklist stays in Macadamia so the final setup steps happen in the right place.",
108
- unlockedIntro: "Your studio preview is live now, and the same checklist will follow you into Macadamia when you are ready to finish setup.",
109
- outro: "You can keep exploring this preview now, then jump back into Macadamia when you're ready to finish setup."
110
- }
111
- },
112
- sidebar: {
113
- tone: "studio",
114
- rootClassName: "bg-stone-50/80",
115
- headerClassName: "border-b border-amber-200/70 bg-amber-50/70",
116
- guidance: {
117
- title: "Polish your studio preview",
118
- description: "Use preview for copy and layout tweaks. Complete setup in Macadamia to add offerings, connect payments, and finish the rest of your launch checklist.",
119
- ctaLabel: "Complete setup in Macadamia",
120
- cardClassName: "rounded-2xl border border-amber-200/80 bg-gradient-to-br from-amber-50 via-white to-orange-50 px-4 py-4 shadow-sm"
121
- }
122
- }
123
- }
124
- };
125
- function getPreviewChromeSurfacePolicy(surfaceId) {
126
- return PREVIEW_CHROME_SURFACE_POLICIES[surfaceId];
127
- }
128
- function resolvePreviewSetupBannerModel(input) {
129
- if (!input.bannerState) {
130
- return null;
131
- }
132
- const policy = getPreviewChromeSurfacePolicy(input.surfaceId).banner;
133
- return {
134
- tone: policy.tone,
135
- bannerClassName: policy.bannerClassName,
136
- summaryClassName: policy.summaryClassName,
137
- dialogItemClassName: policy.dialogItemClassName,
138
- titleClassName: policy.titleClassName,
139
- descriptionClassName: policy.descriptionClassName,
140
- detailClassName: policy.detailClassName,
141
- summaryTitleClassName: policy.summaryTitleClassName,
142
- summaryBodyClassName: policy.summaryBodyClassName,
143
- secondaryButtonClassName: policy.secondaryButtonClassName,
144
- primaryButtonClassName: policy.primaryButtonClassName,
145
- dialogBodyClassName: policy.dialogBodyClassName,
146
- dialogItemTitleClassName: policy.dialogItemTitleClassName,
147
- dialogItemMetaClassName: policy.dialogItemMetaClassName,
148
- dialogItemDescriptionClassName: policy.dialogItemDescriptionClassName,
149
- ctaLabel: policy.ctaLabel,
150
- copy: policy.copyByState[input.bannerState],
151
- dialogTitle: policy.dialog.title,
152
- dialogDescription: policy.dialog.description,
153
- dialogIntro: input.dashboardUnlocked ? policy.dialog.unlockedIntro : policy.dialog.pendingIntro,
154
- dialogOutro: policy.dialog.outro
155
- };
156
- }
157
- function resolvePreviewSidebarChromeModel(surfaceId) {
158
- const policy = getPreviewChromeSurfacePolicy(surfaceId).sidebar;
159
- return {
160
- tone: policy.tone,
161
- rootClassName: policy.rootClassName,
162
- headerClassName: policy.headerClassName
163
- };
164
- }
165
- function resolvePreviewEditorGuidanceModel(input) {
166
- if (!input.canEdit || !input.hasDashboardSetupHandoff) {
167
- return null;
168
- }
169
- const policy = getPreviewChromeSurfacePolicy(input.surfaceId).sidebar;
170
- return {
171
- tone: policy.tone,
172
- title: policy.guidance.title,
173
- description: policy.guidance.description,
174
- ctaLabel: policy.guidance.ctaLabel,
175
- cardClassName: policy.guidance.cardClassName
176
- };
177
- }
178
-
179
- // ../preview-next/src/client/preview/sanitizeDashboardPath.ts
180
- function sanitizeDashboardPath(value) {
181
- if (!value) return null;
182
- const trimmed = value.trim();
183
- if (!trimmed || /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(trimmed)) {
184
- return null;
185
- }
186
- const normalized = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
187
- try {
188
- const parsed = new URL(normalized, "https://preview.local");
189
- return `${parsed.pathname}${parsed.search}${parsed.hash}`;
190
- } catch {
191
- return null;
192
- }
193
- }
194
-
195
- // ../preview-next/src/client/preview/previewDashboardHandoff.ts
196
- function resolvePreviewDashboardSetupHandoffFromSearch(search) {
197
- const params = new URLSearchParams(search);
198
- if (params.get("preview_handoff") !== "dashboard_setup") {
199
- return null;
200
- }
201
- const dashboardPath = sanitizeDashboardPath(params.get("preview_dashboard"));
202
- if (!dashboardPath) {
203
- return null;
204
- }
205
- return {
206
- kind: "dashboard_setup",
207
- dashboardPath
208
- };
209
- }
210
- function resolvePreviewDashboardSetupHandoff() {
211
- if (typeof window === "undefined") {
212
- return null;
213
- }
214
- return resolvePreviewDashboardSetupHandoffFromSearch(window.location.search);
215
- }
216
- function buildPreviewDashboardSetupUrl(dashboardBaseUrl, handoff) {
217
- if (!dashboardBaseUrl || !handoff) {
218
- return null;
219
- }
220
- return new URL(handoff.dashboardPath, dashboardBaseUrl).toString();
221
- }
222
-
223
- // ../preview-next/src/client/preview/siteStyleAccess.ts
224
- function resolveSiteStyleAccess(session) {
225
- if (session?.kind === "userSession" && session.canManage) {
226
- return { kind: "apply-allowed" };
227
- }
228
- if (session?.kind === "userSession" && session.canEdit) {
229
- return { kind: "preview-only" };
230
- }
231
- return { kind: "hidden" };
232
- }
233
- function canInspectSiteStyle(access) {
234
- return access.kind !== "hidden";
235
- }
236
- function canApplySiteStyle(access) {
237
- return access.kind === "apply-allowed";
238
- }
239
-
240
- // ../preview-next/src/client/utils/rfc6902.ts
241
- function cloneJson(value) {
242
- if (typeof structuredClone === "function") {
243
- return structuredClone(value);
244
- }
245
- return JSON.parse(JSON.stringify(value));
246
- }
247
- function decodePointerSegment(segment) {
248
- return segment.replace(/~1/g, "/").replace(/~0/g, "~");
249
- }
250
- function splitPointer(pointer) {
251
- if (pointer === "") return [];
252
- if (!pointer.startsWith("/")) {
253
- throw new Error(`Invalid JSON pointer (must start with "/"): ${pointer}`);
254
- }
255
- return pointer.split("/").slice(1).map((seg) => decodePointerSegment(seg));
256
- }
257
- function isJsonObject(value) {
258
- return typeof value === "object" && value !== null && !Array.isArray(value);
259
- }
260
- function getContainerAndKey(root, pointer) {
261
- const segments = splitPointer(pointer);
262
- if (segments.length === 0) {
263
- throw new Error("Patching the root value is not supported");
264
- }
265
- const key = segments[segments.length - 1];
266
- if (key === void 0) {
267
- throw new Error("Invalid path (missing key)");
268
- }
269
- let container = root;
270
- for (const segment of segments.slice(0, -1)) {
271
- if (container == null) {
272
- throw new Error(`Invalid path: ${pointer}`);
273
- }
274
- if (Array.isArray(container)) {
275
- const index = Number.parseInt(segment, 10);
276
- if (!Number.isFinite(index) || String(index) !== segment) {
277
- throw new Error(`Invalid array index "${segment}" in path: ${pointer}`);
278
- }
279
- container = container[index];
280
- continue;
281
- }
282
- if (isJsonObject(container)) {
283
- container = container[segment];
284
- continue;
285
- }
286
- throw new Error(`Invalid container for path: ${pointer}`);
287
- }
288
- return { container, key };
289
- }
290
- function applyAdd(container, key, value, pointer) {
291
- if (Array.isArray(container)) {
292
- if (key === "-") {
293
- container.push(value);
294
- return;
295
- }
296
- const index = Number.parseInt(key, 10);
297
- if (!Number.isFinite(index) || String(index) !== key) {
298
- throw new Error(`Invalid array index "${key}" in path: ${pointer}`);
299
- }
300
- if (index < 0 || index > container.length) {
301
- throw new Error(`Array index out of bounds "${key}" in path: ${pointer}`);
302
- }
303
- container.splice(index, 0, value);
304
- return;
305
- }
306
- if (isJsonObject(container)) {
307
- container[key] = value;
308
- return;
309
- }
310
- throw new Error(`Invalid container for path: ${pointer}`);
311
- }
312
- function applyReplace(container, key, value, pointer) {
313
- if (Array.isArray(container)) {
314
- const index = Number.parseInt(key, 10);
315
- if (!Number.isFinite(index) || String(index) !== key) {
316
- throw new Error(`Invalid array index "${key}" in path: ${pointer}`);
317
- }
318
- if (index < 0 || index >= container.length) {
319
- throw new Error(`Array index out of bounds "${key}" in path: ${pointer}`);
320
- }
321
- container[index] = value;
322
- return;
323
- }
324
- if (isJsonObject(container)) {
325
- if (!(key in container)) {
326
- throw new Error(`Cannot replace missing key "${key}" in path: ${pointer}`);
327
- }
328
- container[key] = value;
329
- return;
330
- }
331
- throw new Error(`Invalid container for path: ${pointer}`);
332
- }
333
- function applyRemove(container, key, pointer) {
334
- if (Array.isArray(container)) {
335
- const index = Number.parseInt(key, 10);
336
- if (!Number.isFinite(index) || String(index) !== key) {
337
- throw new Error(`Invalid array index "${key}" in path: ${pointer}`);
338
- }
339
- if (index < 0 || index >= container.length) {
340
- throw new Error(`Array index out of bounds "${key}" in path: ${pointer}`);
341
- }
342
- container.splice(index, 1);
343
- return;
344
- }
345
- if (isJsonObject(container)) {
346
- if (!(key in container)) {
347
- throw new Error(`Cannot remove missing key "${key}" in path: ${pointer}`);
348
- }
349
- delete container[key];
350
- return;
351
- }
352
- throw new Error(`Invalid container for path: ${pointer}`);
353
- }
354
- function applyRfc6902Patch(base, ops) {
355
- const next = cloneJson(base);
356
- for (const op of ops) {
357
- const { container, key } = getContainerAndKey(next, op.path);
358
- if (op.op === "add") {
359
- applyAdd(container, key, op.value, op.path);
360
- continue;
361
- }
362
- if (op.op === "replace") {
363
- applyReplace(container, key, op.value, op.path);
364
- continue;
365
- }
366
- applyRemove(container, key, op.path);
367
- }
368
- return next;
369
- }
370
- var PreviewThemeOverlayContext = createContext(null);
371
- var NO_THEME_OVERLAY = { kind: "none" };
372
- function isDebugEnabled() {
373
- return process.env.NEXT_PUBLIC_AI_ASSISTANT_DEBUG === "1";
374
- }
375
- function PreviewThemeOverlayProvider({ baseTheme, children }) {
376
- const [overlay, setOverlay] = useState(NO_THEME_OVERLAY);
377
- const overlayOps = overlay.kind === "patch" ? [...overlay.ops] : null;
378
- const overlayOpsSource = overlay.kind === "patch" ? overlay.source : null;
379
- const overrideTheme = overlay.kind === "theme" ? overlay.theme : null;
380
- const overrideThemeSource = overlay.kind === "theme" ? overlay.source : null;
381
- const setOverlayOps = useCallback(
382
- (ops, options) => {
383
- setOverlay((current) => {
384
- if (ops === null) {
385
- if (current.kind !== "patch") return current;
386
- if (options?.source && current.source !== options.source) return current;
387
- return NO_THEME_OVERLAY;
388
- }
389
- return {
390
- kind: "patch",
391
- source: options?.source ?? "unknown",
392
- ops
393
- };
394
- });
395
- },
396
- []
397
- );
398
- const setOverrideTheme = useCallback(
399
- (theme, options) => {
400
- setOverlay((current) => {
401
- if (theme === null) {
402
- if (current.kind !== "theme") return current;
403
- if (options?.source && current.source !== options.source) return current;
404
- return NO_THEME_OVERLAY;
405
- }
406
- return {
407
- kind: "theme",
408
- source: options?.source ?? "unknown",
409
- theme
410
- };
411
- });
412
- },
413
- []
414
- );
415
- const clearOverlay = useCallback((options) => {
416
- setOverlay((current) => {
417
- const source = options?.source;
418
- if (current.kind === "none") return current;
419
- if (source && current.source !== source) return current;
420
- return NO_THEME_OVERLAY;
421
- });
422
- }, []);
423
- const effectiveTheme = useMemo(() => {
424
- if (overlay.kind === "theme") return overlay.theme;
425
- if (overlay.kind !== "patch" || overlay.ops.length === 0) return baseTheme;
426
- try {
427
- return applyRfc6902Patch(baseTheme, [...overlay.ops]);
428
- } catch (error) {
429
- if (isDebugEnabled()) {
430
- console.warn("[preview-theme-overlay] failed to apply theme overlay patch", {
431
- error: error instanceof Error ? error.message : String(error),
432
- overlayOps: overlay.ops
433
- });
434
- }
435
- return baseTheme;
436
- }
437
- }, [baseTheme, overlay]);
438
- const value = useMemo(
439
- () => ({
440
- baseTheme,
441
- overlay,
442
- overlayOps,
443
- overlayOpsSource,
444
- setOverlayOps,
445
- overrideTheme,
446
- overrideThemeSource,
447
- setOverrideTheme,
448
- effectiveTheme,
449
- clearOverlay
450
- }),
451
- [
452
- baseTheme,
453
- clearOverlay,
454
- effectiveTheme,
455
- overlay,
456
- overlayOps,
457
- overlayOpsSource,
458
- overrideTheme,
459
- overrideThemeSource,
460
- setOverlayOps,
461
- setOverrideTheme
462
- ]
463
- );
464
- return /* @__PURE__ */ jsx(PreviewThemeOverlayContext.Provider, { value, children });
465
- }
466
- function usePreviewThemeOverlay() {
467
- const ctx = useContext(PreviewThemeOverlayContext);
468
- if (!ctx) {
469
- throw new Error("usePreviewThemeOverlay must be used within PreviewThemeOverlayProvider");
470
- }
471
- return ctx;
472
- }
473
-
474
- // ../preview-next/src/client/preview/previewDesignCoordinator.ts
475
- var NO_PREVIEW_DESIGN_STATE = { kind: "idle" };
476
- function transitionPreviewDesignState(state, command) {
477
- switch (command.kind) {
478
- case "preview-theme-patch":
479
- return acceptPreview(state, {
480
- kind: "active",
481
- owner: command.producer,
482
- surface: "theme-json-patch",
483
- apply: "idle"
484
- }, {
485
- kind: "set-patch",
486
- source: command.producer,
487
- ops: command.ops
488
- });
489
- case "preview-theme":
490
- return acceptPreview(state, {
491
- kind: "active",
492
- owner: command.producer,
493
- surface: command.sourcePlan,
494
- apply: "idle"
495
- }, {
496
- kind: "set-theme",
497
- source: command.producer,
498
- theme: command.theme
499
- });
500
- case "clear-preview":
501
- if (state.kind === "idle") {
502
- return ignored(state, "no-active-preview");
503
- }
504
- if (state.owner !== command.producer) {
505
- return ignored(state, "producer-does-not-own-preview");
506
- }
507
- return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
508
- case "base-theme-changed":
509
- if (state.kind === "idle") {
510
- return accepted(state, { kind: "none" });
511
- }
512
- return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
513
- case "apply-started":
514
- if (state.kind === "idle") {
515
- return ignored(state, "no-active-preview");
516
- }
517
- if (state.owner !== command.producer) {
518
- return ignored(state, "producer-does-not-own-preview");
519
- }
520
- return accepted({ ...state, apply: "pending" }, { kind: "none" });
521
- case "apply-succeeded":
522
- if (state.kind === "idle") {
523
- return ignored(state, "apply-event-for-displaced-preview");
524
- }
525
- if (state.owner !== command.producer) {
526
- return ignored(state, "apply-event-for-displaced-preview");
527
- }
528
- return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
529
- case "apply-failed":
530
- if (state.kind === "idle") {
531
- return ignored(state, "apply-event-for-displaced-preview");
532
- }
533
- if (state.owner !== command.producer) {
534
- return ignored(state, "apply-event-for-displaced-preview");
535
- }
536
- return accepted({ ...state, apply: "idle" }, { kind: "none" });
537
- default:
538
- return assertNever2(command, "Unhandled preview design command");
539
- }
540
- }
541
- function acceptPreview(current, next, effect) {
542
- return accepted(next, effect);
543
- }
544
- function accepted(state, effect) {
545
- return {
546
- kind: "accepted",
547
- state,
548
- effect
549
- };
550
- }
551
- function ignored(state, reason) {
552
- return {
553
- kind: "ignored",
554
- state,
555
- reason
556
- };
557
- }
558
- var PreviewDesignCoordinatorContext = createContext(null);
559
- function PreviewDesignCoordinatorProvider({ children }) {
560
- const themeOverlay = usePreviewThemeOverlay();
561
- const {
562
- baseTheme,
563
- clearOverlay,
564
- overlay,
565
- setOverlayOps,
566
- setOverrideTheme
567
- } = themeOverlay;
568
- const [state, setState] = useState(NO_PREVIEW_DESIGN_STATE);
569
- const stateRef = useRef(state);
570
- const previousBaseThemeRef = useRef(null);
571
- useEffect(() => {
572
- stateRef.current = state;
573
- }, [state]);
574
- const dispatch = useCallback(
575
- (command) => {
576
- const transition = transitionPreviewDesignState(stateRef.current, command);
577
- if (transition.kind === "accepted") {
578
- stateRef.current = transition.state;
579
- setState(transition.state);
580
- switch (transition.effect.kind) {
581
- case "none":
582
- break;
583
- case "clear":
584
- clearOverlay();
585
- break;
586
- case "set-patch":
587
- setOverlayOps([...transition.effect.ops], {
588
- source: transition.effect.source
589
- });
590
- break;
591
- case "set-theme":
592
- setOverrideTheme(transition.effect.theme, {
593
- source: transition.effect.source
594
- });
595
- break;
596
- default:
597
- assertNever2(transition.effect, "Unhandled preview design overlay effect");
598
- }
599
- }
600
- return transition;
601
- },
602
- [clearOverlay, setOverlayOps, setOverrideTheme]
603
- );
604
- useEffect(() => {
605
- if (previousBaseThemeRef.current && previousBaseThemeRef.current !== baseTheme) {
606
- dispatch({ kind: "base-theme-changed" });
607
- }
608
- previousBaseThemeRef.current = baseTheme;
609
- }, [baseTheme, dispatch]);
610
- const previewTheme = useCallback(
611
- (producer, theme, sourcePlan) => dispatch({ kind: "preview-theme", producer, theme, sourcePlan }),
612
- [dispatch]
613
- );
614
- const previewThemePatch = useCallback(
615
- (producer, ops) => dispatch({ kind: "preview-theme-patch", producer, ops }),
616
- [dispatch]
617
- );
618
- const clearPreview = useCallback(
619
- (producer) => dispatch({ kind: "clear-preview", producer }),
620
- [dispatch]
621
- );
622
- const applyStarted = useCallback(
623
- (producer) => dispatch({ kind: "apply-started", producer }),
624
- [dispatch]
625
- );
626
- const applySucceeded = useCallback(
627
- (producer) => dispatch({ kind: "apply-succeeded", producer }),
628
- [dispatch]
629
- );
630
- const applyFailed = useCallback(
631
- (producer) => dispatch({ kind: "apply-failed", producer }),
632
- [dispatch]
633
- );
634
- const value = useMemo(
635
- () => ({
636
- state,
637
- overlay,
638
- dispatch,
639
- previewTheme,
640
- previewThemePatch,
641
- clearPreview,
642
- applyStarted,
643
- applySucceeded,
644
- applyFailed
645
- }),
646
- [
647
- applyFailed,
648
- applyStarted,
649
- applySucceeded,
650
- clearPreview,
651
- dispatch,
652
- previewTheme,
653
- previewThemePatch,
654
- state,
655
- overlay
656
- ]
657
- );
658
- return /* @__PURE__ */ jsx(PreviewDesignCoordinatorContext.Provider, { value, children });
659
- }
660
- function usePreviewDesignCoordinator() {
661
- const ctx = useContext(PreviewDesignCoordinatorContext);
662
- if (!ctx) {
663
- throw new Error("usePreviewDesignCoordinator must be used within PreviewDesignCoordinatorProvider");
664
- }
665
- return ctx;
666
- }
667
-
668
- // ../preview-next/src/client/blocks/runOptimisticCustomizeAction.ts
669
- function createOptimisticActionRunner() {
670
- let latest = 0;
671
- return {
672
- async run(action) {
673
- latest += 1;
674
- const seq = latest;
675
- action.optimistic?.();
676
- try {
677
- const success = await action.network();
678
- if (seq !== latest) return seq;
679
- action.onSuccess(success);
680
- } catch (error) {
681
- if (seq !== latest) return seq;
682
- action.onError(error);
683
- }
684
- return seq;
685
- },
686
- invalidate() {
687
- latest += 1;
688
- },
689
- current() {
690
- return latest;
691
- }
692
- };
693
- }
694
-
695
- // ../preview-next/src/client/preview/StyleConfigurator.state.ts
696
- function createStyleConfiguratorState(base) {
697
- return {
698
- base,
699
- previewed: base,
700
- saveStatus: { kind: "idle" },
701
- warnings: [],
702
- notices: [],
703
- paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base),
704
- expandedRow: null
705
- };
706
- }
707
- function openRow(state, row) {
708
- return state.expandedRow === row ? state : { ...state, expandedRow: row };
709
- }
710
- function isPreviewingChange(state) {
711
- return !selectionSnapshotsEqual(state.base, state.previewed);
712
- }
713
- function previewSiteStyle(state, siteStyleId) {
714
- return {
715
- ...state,
716
- previewed: { ...state.previewed, siteStyleId },
717
- saveStatus: { kind: "idle" }
718
- };
719
- }
720
- function previewButtonPersonality(state, buttonPersonalityId) {
721
- return {
722
- ...state,
723
- previewed: { ...state.previewed, buttonPersonalityId },
724
- saveStatus: { kind: "idle" }
725
- };
726
- }
727
- function previewHeaderLayout(state, headerLayoutId) {
728
- const headerStyleId = deriveNearestCompatibleHeaderStyle(
729
- state.previewed.headerStyleId,
730
- headerLayoutId
731
- );
732
- return previewHeaderSelection(state, { headerLayoutId, headerStyleId });
733
- }
734
- function previewHeaderStyle(state, headerStyleId) {
735
- return previewHeaderSelection(state, {
736
- headerLayoutId: state.previewed.headerLayoutId,
737
- headerStyleId
738
- });
739
- }
740
- function previewFooterLook(state, footerLookId) {
741
- return {
742
- ...state,
743
- previewed: { ...state.previewed, footerLookId },
744
- saveStatus: { kind: "idle" }
745
- };
746
- }
747
- function previewTypographyPreset(state, typographyPresetId) {
748
- return {
749
- ...state,
750
- previewed: { ...state.previewed, typographyPresetId },
751
- saveStatus: { kind: "idle" }
752
- };
753
- }
754
- function setTypographyBodyFontOverride(state, typographyBodyFontOverride) {
755
- return {
756
- ...state,
757
- previewed: { ...state.previewed, typographyBodyFontOverride },
758
- saveStatus: { kind: "idle" }
759
- };
760
- }
761
- function setTypographyHeadingFontOverride(state, typographyHeadingFontOverride) {
762
- return {
763
- ...state,
764
- previewed: { ...state.previewed, typographyHeadingFontOverride },
765
- saveStatus: { kind: "idle" }
766
- };
767
- }
768
- function clearTypographyFontOverrides(state) {
769
- return {
770
- ...state,
771
- previewed: {
772
- ...state.previewed,
773
- typographyBodyFontOverride: null,
774
- typographyHeadingFontOverride: null
775
- },
776
- saveStatus: { kind: "idle" }
777
- };
778
- }
779
- function previewPaletteVariant(state, paletteVariantId) {
780
- return movePreviewToPaletteVariant(state, paletteVariantId);
781
- }
782
- function setPaletteOverrides(state, paletteOverrides) {
783
- const paletteOverrideDrafts = withPaletteOverrideDraft(
784
- state.paletteOverrideDrafts,
785
- state.previewed.paletteVariantId,
786
- paletteOverrides
787
- );
788
- return {
789
- ...state,
790
- previewed: { ...state.previewed, paletteOverrides },
791
- paletteOverrideDrafts,
792
- saveStatus: { kind: "idle" }
793
- };
794
- }
795
- function applyResolvedSelections(state, input) {
796
- const paletteScoped = movePreviewToPaletteVariant(state, input.resolved.paletteVariantId);
797
- return {
798
- ...paletteScoped,
799
- previewed: {
800
- ...paletteScoped.previewed,
801
- buttonPersonalityId: input.resolved.buttonPersonalityId,
802
- headerLayoutId: input.resolved.headerLayoutId,
803
- headerStyleId: input.resolved.headerStyleId,
804
- headerLookId: input.resolved.headerLookId,
805
- typographyPresetId: input.resolved.typographyPresetId,
806
- typographyBodyFontOverride: input.resolved.typographyBodyFontOverride,
807
- typographyHeadingFontOverride: input.resolved.typographyHeadingFontOverride
808
- },
809
- warnings: input.warnings
810
- };
811
- }
812
- function cancelPreview(state) {
813
- return {
814
- ...state,
815
- previewed: state.base,
816
- saveStatus: { kind: "idle" },
817
- warnings: [],
818
- notices: [],
819
- paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(state.base)
820
- };
821
- }
822
- function markApplySaving(state) {
823
- return { ...state, saveStatus: { kind: "saving" } };
824
- }
825
- function markApplySaved(state, persisted) {
826
- return {
827
- ...state,
828
- base: persisted,
829
- previewed: persisted,
830
- saveStatus: { kind: "saved" },
831
- warnings: [],
832
- notices: [],
833
- paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(persisted)
834
- };
835
- }
836
- function markApplyFailed(state, message) {
837
- return {
838
- ...state,
839
- saveStatus: { kind: "failed", message }
840
- };
841
- }
842
- function toggleRow(state, row) {
843
- return {
844
- ...state,
845
- expandedRow: state.expandedRow === row ? null : row
846
- };
847
- }
848
- function dismissWarnings(state) {
849
- if (state.warnings.length === 0) return state;
850
- return { ...state, warnings: [] };
851
- }
852
- function dismissNotices(state) {
853
- if (state.notices.length === 0) return state;
854
- return { ...state, notices: [] };
855
- }
856
- function syncStyleConfiguratorState(state, base) {
857
- if (selectionSnapshotsEqual(state.base, base)) return state;
858
- if (selectionSnapshotsEqual(state.previewed, base)) {
859
- return {
860
- ...state,
861
- base,
862
- saveStatus: state.saveStatus.kind === "saving" ? { kind: "saved" } : state.saveStatus,
863
- warnings: [],
864
- notices: [],
865
- paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base)
866
- };
867
- }
868
- return {
869
- ...state,
870
- base,
871
- previewed: base,
872
- saveStatus: { kind: "idle" },
873
- warnings: [],
874
- notices: [],
875
- paletteOverrideDrafts: paletteOverrideDraftsFromSnapshot(base)
876
- };
877
- }
878
- function movePreviewToPaletteVariant(state, paletteVariantId) {
879
- if (state.previewed.paletteVariantId === paletteVariantId) {
880
- return {
881
- ...state,
882
- saveStatus: { kind: "idle" }
883
- };
884
- }
885
- const paletteOverrideDrafts = withPaletteOverrideDraft(
886
- state.paletteOverrideDrafts,
887
- state.previewed.paletteVariantId,
888
- state.previewed.paletteOverrides
889
- );
890
- const restoredOverrides = paletteOverrideDrafts[paletteVariantId] ?? null;
891
- return {
892
- ...state,
893
- previewed: {
894
- ...state.previewed,
895
- paletteVariantId,
896
- paletteOverrides: restoredOverrides
897
- },
898
- paletteOverrideDrafts,
899
- notices: appendPaletteOverrideScopeNotice(state.notices, {
900
- previousOverrides: state.previewed.paletteOverrides,
901
- restoredOverrides
902
- }),
903
- saveStatus: { kind: "idle" }
904
- };
905
- }
906
- function previewHeaderSelection(state, selection) {
907
- const headerStyleId = deriveNearestCompatibleHeaderStyle(
908
- selection.headerStyleId,
909
- selection.headerLayoutId
910
- );
911
- const headerLookId = findLegacyHeaderLookIdForSelection({
912
- layoutId: selection.headerLayoutId,
913
- styleId: headerStyleId
914
- });
915
- return {
916
- ...state,
917
- previewed: {
918
- ...state.previewed,
919
- headerLayoutId: selection.headerLayoutId,
920
- headerStyleId,
921
- headerLookId
922
- },
923
- saveStatus: { kind: "idle" }
924
- };
925
- }
926
- function withPaletteOverrideDraft(drafts, paletteVariantId, paletteOverrides) {
927
- const next = { ...drafts };
928
- if (paletteOverrides === null) {
929
- delete next[paletteVariantId];
930
- } else {
931
- next[paletteVariantId] = paletteOverrides;
932
- }
933
- return next;
934
- }
935
- function paletteOverrideDraftsFromSnapshot(snapshot) {
936
- return snapshot.paletteOverrides ? { [snapshot.paletteVariantId]: snapshot.paletteOverrides } : {};
937
- }
938
- function appendPaletteOverrideScopeNotice(notices, input) {
939
- const kind = input.restoredOverrides !== null ? "palette-overrides-restored" : input.previousOverrides !== null ? "palette-overrides-hidden" : null;
940
- if (!kind || notices.some((notice) => notice.kind === kind)) {
941
- return notices;
942
- }
943
- return [...notices, { kind }];
944
- }
945
- function selectionSnapshotsEqual(a, b) {
946
- return a.siteStyleId === b.siteStyleId && a.selectionVersion === b.selectionVersion && a.selectionUpdatedAt === b.selectionUpdatedAt && a.headerLayoutId === b.headerLayoutId && a.headerStyleId === b.headerStyleId && a.headerLookId === b.headerLookId && a.footerLookId === b.footerLookId && a.buttonPersonalityId === b.buttonPersonalityId && a.paletteVariantId === b.paletteVariantId && a.typographyPresetId === b.typographyPresetId && a.typographyBodyFontOverride === b.typographyBodyFontOverride && a.typographyHeadingFontOverride === b.typographyHeadingFontOverride && paletteOverridesEqual(a.paletteOverrides, b.paletteOverrides);
947
- }
948
- function paletteOverridesEqual(a, b) {
949
- if (a === b) return true;
950
- if (!a || !b) return false;
951
- const keysA = Object.keys(a);
952
- const keysB = Object.keys(b);
953
- if (keysA.length !== keysB.length) return false;
954
- return keysA.every((key) => a[key] === b[key]);
955
- }
956
-
957
- // ../preview-next/src/client/preview/siteChromeLookRows.ts
958
- function buildSiteChromeLookModels(input) {
959
- const selection = input.state.previewed;
960
- const common = {
961
- siteStyle: input.siteStyle,
962
- buttonPersonalityId: selection.buttonPersonalityId,
963
- paletteVariantId: selection.paletteVariantId,
964
- paletteOverrides: selection.paletteOverrides,
965
- headerLayoutId: selection.headerLayoutId,
966
- headerStyleId: selection.headerStyleId,
967
- headerLookId: selection.headerLookId,
968
- footerLookId: selection.footerLookId,
969
- headerSelectionContext: input.headerSelectionContext,
970
- footerSelectionContext: input.footerSelectionContext
971
- };
972
- const current = compileSiteThemeFromSelections(common);
973
- const renderedHeaderLayoutId = current.resolvedSelections.headerLayoutId;
974
- const renderedHeaderStyleId = current.resolvedSelections.headerStyleId;
975
- return {
976
- headerLayout: {
977
- renderedLayoutId: renderedHeaderLayoutId,
978
- options: getOrderedHeaderLayoutIdsForCuration(input.siteStyle).map(
979
- (layoutId) => {
980
- const layout = getHeaderLayout(layoutId);
981
- return {
982
- id: layoutId,
983
- label: layout?.label ?? layoutId,
984
- description: layout?.description,
985
- available: true
986
- };
987
- }
988
- )
989
- },
990
- headerStyle: {
991
- renderedStyleId: renderedHeaderStyleId,
992
- options: getOrderedHeaderStyleIdsForLayout(
993
- input.siteStyle,
994
- selection.headerLayoutId
995
- ).map((styleId) => {
996
- const style = getHeaderStyle(styleId);
997
- return {
998
- id: styleId,
999
- label: style?.label ?? styleId,
1000
- description: style?.description,
1001
- available: true
1002
- };
1003
- })
1004
- },
1005
- footer: {
1006
- renderedLookId: current.resolvedSelections.footerLookId,
1007
- options: [
1008
- {
1009
- id: null,
1010
- label: "Site style default",
1011
- description: "Use the footer chosen for this site style.",
1012
- available: true
1013
- },
1014
- ...footerLookCatalog.map((look) => {
1015
- const result = compileSiteThemeFromSelections({
1016
- ...common,
1017
- footerLookId: look.id
1018
- });
1019
- const rejected = result.footerSelection.rejected.find(
1020
- (item) => item.lookId === look.id
1021
- );
1022
- return {
1023
- id: look.id,
1024
- label: look.label,
1025
- description: rejected ? rejected.reasons.map(footerLookRejectionReasonLabel).join(" ") : void 0,
1026
- available: !rejected
1027
- };
1028
- })
1029
- ],
1030
- diagnostics: diagnosticsForRequestedFooterSelection(
1031
- selection.footerLookId,
1032
- current.resolvedSelections.footerLookId,
1033
- current.footerSelection.rejected
1034
- )
1035
- }
1036
- };
1037
- }
1038
- function cycleSiteChromeLookId(options, currentId, direction) {
1039
- const cycleable = cycleableSiteChromeOptions(options);
1040
- if (cycleable.length <= 1) return void 0;
1041
- const currentIndex = cycleable.findIndex((option) => option.id === currentId);
1042
- const safeIndex = currentIndex === -1 ? 0 : currentIndex;
1043
- const nextIndex = direction === "next" ? (safeIndex + 1) % cycleable.length : safeIndex === 0 ? cycleable.length - 1 : safeIndex - 1;
1044
- return cycleable[nextIndex]?.id;
1045
- }
1046
- function cycleableSiteChromeOptions(options) {
1047
- return options.filter((option) => option.available);
1048
- }
1049
- function planSiteChromeLookSelection(command) {
1050
- if (command.surface === "header") {
1051
- const headerLookId = findLegacyHeaderLookIdForSelection({
1052
- layoutId: command.layoutId,
1053
- styleId: command.styleId
1054
- });
1055
- const lookCommand2 = headerLookId ? {
1056
- kind: "select",
1057
- surface: { kind: "site-header" },
1058
- lookId: headerLookId
1059
- } : {
1060
- kind: "clear",
1061
- surface: { kind: "site-header" }
1062
- };
1063
- return {
1064
- kind: "header",
1065
- writePlan: writePlanForLookCustomizationCommand(lookCommand2),
1066
- next: {
1067
- headerLayoutId: command.layoutId,
1068
- headerStyleId: command.styleId,
1069
- headerLookId
1070
- }
1071
- };
1072
- }
1073
- const lookCommand = command.lookId ? {
1074
- kind: "select",
1075
- surface: { kind: "site-footer" },
1076
- lookId: command.lookId
1077
- } : {
1078
- kind: "clear",
1079
- surface: { kind: "site-footer" }
1080
- };
1081
- return {
1082
- kind: "footer",
1083
- writePlan: writePlanForLookCustomizationCommand(lookCommand),
1084
- next: { footerLookId: command.lookId }
1085
- };
1086
- }
1087
- function diagnosticsForRequestedFooterSelection(requestedLookId, renderedLookId, rejected) {
1088
- if (!requestedLookId || requestedLookId === renderedLookId) return [];
1089
- const rejectedRequest = rejected.find(
1090
- (item) => item.lookId === requestedLookId
1091
- );
1092
- return rejectedRequest?.reasons.map(footerLookRejectionReasonLabel) ?? [];
1093
- }
1094
-
1095
- // ../preview-next/src/client/preview/typographySelectionInput.ts
1096
- function typographySelectionInputForSnapshot(snapshot, theme) {
1097
- if (snapshot.typographyPresetId === null && theme?.typography) {
1098
- return {
1099
- typographySelection: {
1100
- kind: "custom",
1101
- typography: theme.typography
1102
- }
1103
- };
1104
- }
1105
- return {
1106
- typographyPresetId: snapshot.typographyPresetId,
1107
- typographyBodyFontOverride: snapshot.typographyBodyFontOverride,
1108
- typographyHeadingFontOverride: snapshot.typographyHeadingFontOverride
1109
- };
1110
- }
1111
-
1112
- // ../preview-next/src/client/preview/styleConfiguratorSnapshot.ts
1113
- function resolveStyleConfiguratorInitialSnapshot(input) {
1114
- const themeSiteStyleId = siteStyleIdFromTheme(input.theme);
1115
- if (!themeSiteStyleId) return null;
1116
- const siteStyle = getCuratedSiteStyle(themeSiteStyleId);
1117
- if (!siteStyle) return null;
1118
- const compiled = compileSiteThemeFromSelections({
1119
- siteStyle,
1120
- buttonPersonalityId: input.initialSelections.buttonPersonalityId,
1121
- paletteVariantId: input.initialSelections.paletteVariantId,
1122
- paletteOverrides: input.initialSelections.paletteOverrides,
1123
- headerLayoutId: input.initialSelections.headerLayoutId ?? null,
1124
- headerStyleId: input.initialSelections.headerStyleId ?? null,
1125
- ...typographySelectionInputForSnapshot(input.initialSelections, input.theme),
1126
- headerLookId: input.initialSelections.headerLookId ?? null,
1127
- footerLookId: input.initialSelections.footerLookId ?? null,
1128
- headerSelectionContext: input.headerSelectionContext,
1129
- footerSelectionContext: input.footerSelectionContext
1130
- });
1131
- const paletteChanged = input.initialSelections.paletteVariantId !== null && compiled.resolvedSelections.paletteVariantId !== input.initialSelections.paletteVariantId;
1132
- return {
1133
- siteStyleId: siteStyle.id,
1134
- selectionVersion: input.initialSelections.selectionVersion ?? 0,
1135
- selectionUpdatedAt: input.initialSelections.selectionUpdatedAt ?? null,
1136
- headerLayoutId: compiled.resolvedSelections.headerLayoutId,
1137
- headerStyleId: compiled.resolvedSelections.headerStyleId,
1138
- headerLookId: compiled.requestedSelections.headerLookId,
1139
- footerLookId: compiled.requestedSelections.footerLookId,
1140
- buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
1141
- paletteVariantId: compiled.resolvedSelections.paletteVariantId,
1142
- paletteOverrides: paletteChanged ? null : input.initialSelections.paletteOverrides,
1143
- typographyPresetId: compiled.resolvedSelections.typographyPresetId,
1144
- typographyBodyFontOverride: compiled.resolvedSelections.typographyBodyFontOverride,
1145
- typographyHeadingFontOverride: compiled.resolvedSelections.typographyHeadingFontOverride
1146
- };
1147
- }
1148
-
1149
- // ../preview-next/src/client/preview/siteStylePreviewPlanner.ts
1150
- function planSiteStylePreviewChange(input) {
1151
- const compiled = compileSiteThemeFromSelections({
1152
- siteStyle: input.siteStyle,
1153
- buttonPersonalityId: input.selection.buttonPersonalityId,
1154
- paletteVariantId: input.selection.paletteVariantId,
1155
- paletteOverrides: input.selection.paletteOverrides,
1156
- ...typographySelectionInputForSnapshot(input.selection, input.baseTheme),
1157
- headerLayoutId: input.selection.headerLayoutId,
1158
- headerStyleId: input.selection.headerStyleId,
1159
- headerLookId: input.selection.headerLookId,
1160
- footerLookId: input.selection.footerLookId,
1161
- headerSelectionContext: input.headerSelectionContext,
1162
- footerSelectionContext: input.footerSelectionContext
1163
- });
1164
- return {
1165
- themeOverlay: compiled.theme,
1166
- resolvedSelections: compiled.resolvedSelections,
1167
- chromeSelection: {
1168
- headerLookId: input.selection.headerLookId,
1169
- footerLookId: input.selection.footerLookId
1170
- },
1171
- warnings: compiled.warnings
1172
- };
1173
- }
1174
-
1175
- export { PreviewDesignCoordinatorProvider, PreviewThemeOverlayProvider, applyResolvedSelections, buildPreviewDashboardSetupUrl, buildSiteChromeLookModels, canApplySiteStyle, canInspectSiteStyle, cancelPreview, clearTypographyFontOverrides, createOptimisticActionRunner, createStyleConfiguratorState, cycleSiteChromeLookId, cycleableSiteChromeOptions, dismissNotices, dismissWarnings, isPreviewingChange, markApplyFailed, markApplySaved, markApplySaving, openRow, planSiteChromeLookSelection, planSiteStylePreviewChange, previewButtonPersonality, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, resolvePreviewDashboardSetupHandoff, resolvePreviewEditorGuidanceModel, resolvePreviewSetupBannerModel, resolvePreviewSidebarChromeModel, resolveSiteStyleAccess, resolveStyleConfiguratorInitialSnapshot, sanitizeDashboardPath, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, syncStyleConfiguratorState, toggleRow, usePreviewDesignCoordinator, usePreviewThemeOverlay };