@riverbankcms/sdk 0.102.0 → 0.103.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 (101) hide show
  1. package/README.md +10 -2
  2. package/dist/{PreviewEditorSidebar-BKkhhkJk.mjs → PreviewEditorSidebar-DkNpCPja.mjs} +75 -9
  3. package/dist/{PreviewEditorUI-DIvTqcqI.mjs → PreviewEditorUI-DeNKtqk3.mjs} +2 -2
  4. package/dist/{SdkPreviewModeRuntime-CA2k7Z_T.mjs → SdkPreviewModeRuntime-5bCsXK2y.mjs} +572 -285
  5. package/dist/{SiteChromeCustomizeContext-Bh9-DtMQ.mjs → SiteChromeCustomizeContext-CO1sTK_W.mjs} +336 -36
  6. package/dist/_dts/ai/src/contracts/proposals.d.ts +298 -298
  7. package/dist/_dts/api/src/index.d.ts +1 -1
  8. package/dist/_dts/api/src/navigation/contracts.d.ts +6 -6
  9. package/dist/_dts/api/src/siteBanner.d.ts +2 -2
  10. package/dist/_dts/blocks/src/PageRenderer.d.ts +6 -1
  11. package/dist/_dts/blocks/src/bindings/index.d.ts +2 -2
  12. package/dist/_dts/blocks/src/index.d.ts +1 -1
  13. package/dist/_dts/blocks/src/server.d.ts +1 -1
  14. package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +7 -7
  15. package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -1
  16. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +14 -14
  17. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +5 -5
  18. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +227 -227
  19. package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +1 -1
  20. package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
  21. package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
  22. package/dist/_dts/blocks/src/system/inlineText.d.ts +2 -2
  23. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +177 -177
  24. package/dist/_dts/blocks/src/system/node/schema.d.ts +1 -1
  25. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
  26. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +7 -7
  27. package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -1
  28. package/dist/_dts/content-model/src/content-types/schema.d.ts +8 -8
  29. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +154 -18
  30. package/dist/_dts/db/src/schemas/forms.d.ts +15 -15
  31. package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +2 -1
  32. package/dist/_dts/preview-next/src/client/preview/CustomizeColorTokenPicker.d.ts +27 -0
  33. package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +2 -1
  34. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +10 -2
  35. package/dist/_dts/preview-next/src/client/preview/sidebarTabPreference.d.ts +1 -1
  36. package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +16 -1
  37. package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +3 -2
  38. package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
  39. package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/contracts/page.d.ts +2 -0
  41. package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +10 -10
  42. package/dist/_dts/sdk/src/next/revalidate.d.ts +14 -1
  43. package/dist/_dts/sdk/src/public-api/contracts.d.ts +4 -4
  44. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -1
  45. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +3 -2
  46. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +3 -4
  47. package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +1 -0
  48. package/dist/_dts/sdk/src/version.d.ts +1 -1
  49. package/dist/_dts/site-commands/src/commands.d.ts +19 -19
  50. package/dist/_dts/theme-core/src/accordions/types.d.ts +3 -3
  51. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +3 -3
  52. package/dist/_dts/theme-core/src/buttons/types.d.ts +7 -7
  53. package/dist/_dts/theme-core/src/cards/types.d.ts +6 -6
  54. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  55. package/dist/_dts/theme-core/src/inputs/types.d.ts +4 -4
  56. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +150 -144
  57. package/dist/_dts/theme-core/src/navigation/types.d.ts +6 -6
  58. package/dist/_dts/theme-core/src/palette/variants/types.d.ts +5 -5
  59. package/dist/_dts/theme-core/src/schema.d.ts +199 -169
  60. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  61. package/dist/_dts/theme-core/src/site-styles/contentTemplateRuntimeCompiler.d.ts +2 -1
  62. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +24 -24
  63. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
  64. package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
  65. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -2
  66. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +26 -1
  67. package/dist/_dts/theme-core/src/site-styles/sectionTransitions.d.ts +77 -0
  68. package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +44 -0
  69. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
  70. package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
  71. package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +3 -3
  72. package/dist/_dts/ui/src/badge.d.ts +1 -1
  73. package/dist/_dts/ui/src/button.d.ts +1 -1
  74. package/dist/_dts/ui/src/card.d.ts +1 -1
  75. package/dist/_dts/ui/src/toggle.d.ts +2 -2
  76. package/dist/cli/index.mjs +28 -7
  77. package/dist/cli/init-docs/content/workflow-isr-revalidation.md +9 -1
  78. package/dist/client/client.mjs +337 -69
  79. package/dist/client/hooks.mjs +13 -1
  80. package/dist/client/rendering/client.mjs +25 -4
  81. package/dist/client/rendering.mjs +336 -68
  82. package/dist/preview-next/client/runtime.mjs +3 -3
  83. package/dist/{sdk-runtime-K8Oqj97H.mjs → sdk-runtime-C8whifOy.mjs} +1 -1
  84. package/dist/{separator-CRoP34pT.mjs → separator-CM2C5Axs.mjs} +1 -1
  85. package/dist/server/components.mjs +321 -65
  86. package/dist/server/config-validation.mjs +12 -1
  87. package/dist/server/config.mjs +12 -1
  88. package/dist/server/data.mjs +12 -1
  89. package/dist/server/index.mjs +1 -1
  90. package/dist/server/next/revalidate.mjs +31 -1
  91. package/dist/server/next.mjs +325 -66
  92. package/dist/server/page-converter.mjs +12 -1
  93. package/dist/server/prebuild.mjs +1 -1
  94. package/dist/server/rendering/server.mjs +323 -65
  95. package/dist/server/rendering.mjs +323 -65
  96. package/dist/server/routing.mjs +24 -3
  97. package/dist/server/server.mjs +15 -2
  98. package/dist/server/theme-bridge.mjs +153 -32
  99. package/dist/server/theme.mjs +2 -0
  100. package/dist/styles/index.css +123 -30
  101. package/package.json +1 -1
package/README.md CHANGED
@@ -3464,16 +3464,24 @@ Add a signed revalidation route so CMS publish events can refresh affected ISR p
3464
3464
  ```ts
3465
3465
  // src/app/api/revalidate/route.ts
3466
3466
  import { createRevalidateHandler } from '@riverbankcms/sdk/next/revalidate';
3467
+ import { getRiverbankClient } from '@/lib/riverbank-client';
3467
3468
 
3468
- export const POST = createRevalidateHandler();
3469
+ export const POST = createRevalidateHandler({
3470
+ getClient: getRiverbankClient,
3471
+ });
3469
3472
  ```
3470
3473
 
3471
- Set `RIVERBANK_WEBHOOK_SECRET` in the deployed site and configure the matching Riverbank webhook endpoint to post to `/api/revalidate`. Revalidation requests are signed with `X-Riverbank-Signature: sha256=<hex HMAC-SHA256 digest>` over the raw JSON body. The SDK handler rejects missing prefixes, malformed digests, bad signatures, and invalid payloads; valid payloads can revalidate one or more top-level `paths` and `tags`, with malformed path entries skipped and reported in the response metadata.
3474
+ Set `RIVERBANK_WEBHOOK_SECRET` in the deployed SDK site and configure the matching Riverbank webhook endpoint to post to `/api/revalidate`. Revalidation requests are signed with `X-Riverbank-Signature: sha256=<hex HMAC-SHA256 digest>` over the raw JSON body. The SDK handler rejects missing prefixes, malformed digests, bad signatures, and invalid payloads; valid payloads can revalidate one or more top-level `paths` and `tags`, clear the current process's SDK client response cache when `getClient` is provided, and skip malformed path entries while reporting them in the response metadata.
3475
+
3476
+ The SDK client cache clear is process-local and best-effort. It helps single-process deployments, `next dev`, `next start`, and any runtime where the revalidation route and render path share the same module instance. Serverless platforms such as Vercel can compile `/api/revalidate` and page rendering into separate functions and can run many warm containers; in those deployments, the webhook may clear only the webhook function's local client instance while other render instances keep their SDK response cache until TTL expiry. Use Next tag/path revalidation as the authoritative cross-instance invalidation layer, and disable or shorten SDK response caching for force-dynamic deployments that require immediate freshness across serverless instances.
3477
+
3478
+ Existing SDK sites should update their revalidation route to pass `getClient: getRiverbankClient`, then redeploy after adding or changing the deployed site's `RIVERBANK_WEBHOOK_SECRET`. The dashboard/CMS environment separately needs `WEBHOOK_SIGNING_SECRET_KEYRING_JSON` configured so Riverbank can create and store endpoint signing secrets; do not put that dashboard keyring in the SDK site.
3472
3479
 
3473
3480
  The CMS includes a `dispatchId` in signed payloads and sends matching `X-Riverbank-Dispatch-Id` / `X-Riverbank-Correlation-Id` headers. Use the optional callback metadata to join CMS delivery logs with consumer deployment logs without logging secrets:
3474
3481
 
3475
3482
  ```ts
3476
3483
  export const POST = createRevalidateHandler({
3484
+ getClient: getRiverbankClient,
3477
3485
  onRevalidate: (_payload, _items, metadata) => {
3478
3486
  console.info('Riverbank ISR revalidated', metadata);
3479
3487
  },
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { $d as ChevronLeft, $l as DropdownMenuContent, A as markApplySaving, Ai as findTypographyPreset, B as setPaletteOverrides, Bl as Collapsible, Bt as ManifestForm, C as createStyleConfiguratorState, Cl as Input, D as isPreviewingChange, Di as getCuratedSiteStyle, Dl as TabsTrigger, Du as unsafeAsEditorBlockId, E as dismissWarnings, Ed as Monitor, El as TabsList, F as previewHeaderStyle, Fi as getHeaderLayout, Gt as createStoreBackend, H as syncStyleConfiguratorState, Hl as CollapsibleTrigger, Ht as createManifestValidation, I as previewPaletteVariant, Ii as getHeaderStyle, Ji as paletteVariants, L as previewSiteStyle, M as previewButtonPersonality, Mi as requireEntriesForCuratedChoices, Mt as deriveRouteMetadataPresentation, N as previewFooterLook, Nc as buttonPersonalities, Ni as findFooterLook, Nt as resolvePageRouteSlug, O as markApplyFailed, Od as Maximize2, P as previewHeaderLayout, Pc as findButtonPersonality, Pi as getFooterLayout, Pt as resolveContentTitle, Q as resolvePreviewSidebarTab, Qd as ChevronRight, Ql as DropdownMenu, R as previewTypographyPreset, S as cancelPreview, Sl as PopoverTrigger, Su as cn, T as dismissNotices, Ti as curatedSiteStyles, Tl as TabsContent, U as toggleRow, Ut as FormRenderer, V as styleConfiguratorHistoryEntryForPersistedSelection, Vl as CollapsibleContent, W as typographySelectionSnapshotFromFlat, Yi as paletteOverridesSchema, Z as createOptimisticActionRunner, Zl as Surface, _ as usePreviewDesignCoordinator, _d as Smartphone, _l as SelectValue, _t as useEditorUiStore, b as applyResolvedSelections, bl as Popover, c as selectionSnapshotFromApplySiteStyleSelectionResponse, cd as X$1, d as buildSiteChromeLookModels, dt as useUISelector, en as listEntryPageContentSlots, eu as DropdownMenuItem, f as cycleSiteChromeLookId, gl as SelectTrigger, h as planSiteChromeLookSelection, hl as SelectItem, j as openRow, ji as typographyPresets, k as markApplySaved, kd as LoaderCircle, ki as evaluateTypographyFontSlot, l as planSiteStylePreviewChange, m as planSiteChromeFooterLayoutSelection, md as Tablet, ml as SelectContent, mt as useEntryController, n as useSiteChromeCustomizeOptional, nu as DropdownMenuSeparator, p as cycleableSiteChromeOptions, pl as Select, qi as findPaletteVariant, qu as assertNever$1, ru as DropdownMenuTrigger, s as buildApplySiteStyleSelectionBody, tu as DropdownMenuLabel, u as resolveStyleConfiguratorInitialSnapshot, ut as ContentFieldsForm, vt as useEditorUiStoreInstance, w as deriveStyleConfiguratorCapabilities, wl as Tabs, x as applyTypographyDraftPatch, xl as PopoverContent, yu as Button, z as resetTypographyToSaved } from "./SiteChromeCustomizeContext-Bh9-DtMQ.mjs";
2
+ import { A as markApplySaving, Al as TabsTrigger, Au as unsafeAsEditorBlockId, B as setPaletteOverrides, Bt as ManifestForm, C as createStyleConfiguratorState, Cl as Popover, D as isPreviewingChange, Di as curatedSiteStyles, Dl as Tabs, E as dismissWarnings, El as Input, F as previewHeaderStyle, Fi as findFooterLook, Gl as CollapsibleTrigger, Gt as createStoreBackend, H as syncStyleConfiguratorState, Ht as createManifestValidation, I as previewPaletteVariant, Ic as buttonPersonalities, Ii as getFooterLayout, L as previewSiteStyle, Lc as findButtonPersonality, Li as getHeaderLayout, M as previewButtonPersonality, Md as LoaderCircle, Mi as findTypographyPreset, Mt as deriveRouteMetadataPresentation, N as previewFooterLook, Ni as typographyPresets, Nt as resolvePageRouteSlug, O as markApplyFailed, Ol as TabsContent, P as previewHeaderLayout, Pi as requireEntriesForCuratedChoices, Pt as resolveContentTitle, Q as resolvePreviewSidebarTab, Qi as paletteOverridesSchema, R as previewTypographyPreset, Ri as getHeaderStyle, S as cancelPreview, Su as Button, T as dismissNotices, Tl as PopoverTrigger, Tu as cn, U as toggleRow, Ul as Collapsible, Ut as FormRenderer, V as styleConfiguratorHistoryEntryForPersistedSelection, W as typographySelectionSnapshotFromFlat, Wl as CollapsibleContent, Xi as findPaletteVariant, Xu as assertNever$1, Z as createOptimisticActionRunner, Zi as paletteVariants, _ as usePreviewDesignCoordinator, _d as Tablet, _l as SelectContent, _t as useEditorUiStore, au as DropdownMenuSeparator, b as applyResolvedSelections, bd as Smartphone, bl as SelectValue, c as selectionSnapshotFromApplySiteStyleSelectionResponse, d as buildSiteChromeLookModels, dd as X$1, dt as useUISelector, en as listEntryPageContentSlots, eu as Surface, f as cycleSiteChromeLookId, gl as Select, h as planSiteChromeLookSelection, iu as DropdownMenuLabel, j as openRow, jd as Maximize2, ji as evaluateTypographyFontSlot, k as markApplySaved, kd as Monitor, ki as getCuratedSiteStyle, kl as TabsList, l as planSiteStylePreviewChange, m as planSiteChromeFooterLayoutSelection, mt as useEntryController, n as useSiteChromeCustomizeOptional, nf as ChevronLeft, ns as assertNever$2, nu as DropdownMenuContent, ou as DropdownMenuTrigger, p as cycleableSiteChromeOptions, ru as DropdownMenuItem, s as buildApplySiteStyleSelectionBody, tf as ChevronRight, tu as DropdownMenu, u as resolveStyleConfiguratorInitialSnapshot, ut as ContentFieldsForm, vl as SelectItem, vt as useEditorUiStoreInstance, w as deriveStyleConfiguratorCapabilities, wl as PopoverContent, x as applyTypographyDraftPatch, yl as SelectTrigger, z as resetTypographyToSaved } from "./SiteChromeCustomizeContext-CO1sTK_W.mjs";
3
3
  import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-ByPPZqmp.mjs";
4
- import { S as isAdapterReferenceKind, T as CalloutDescription, _ as usePreviewBlockCustomizeSelectionOptional, b as previewWidgetOverrides, d as buildPreviewDashboardSetupUrl, f as resolvePreviewDashboardSetupHandoff, g as canInspectSiteStyle, h as canApplySiteStyle, m as resolvePreviewSidebarChromeModel, p as resolvePreviewEditorGuidanceModel, v as useBlockCustomizeControls, w as Callout, x as BlockEditor, y as PreviewFormProvider } from "./SdkPreviewModeRuntime-CA2k7Z_T.mjs";
5
- import { t as Separator } from "./separator-CRoP34pT.mjs";
4
+ import { S as isAdapterReferenceKind, T as CalloutDescription, _ as usePreviewBlockCustomizeSelectionOptional, b as previewWidgetOverrides, d as buildPreviewDashboardSetupUrl, f as resolvePreviewDashboardSetupHandoff, g as canInspectSiteStyle, h as canApplySiteStyle, m as resolvePreviewSidebarChromeModel, p as resolvePreviewEditorGuidanceModel, v as useBlockCustomizeControls, w as Callout, x as BlockEditor, y as PreviewFormProvider } from "./SdkPreviewModeRuntime-5bCsXK2y.mjs";
5
+ import { t as Separator } from "./separator-CM2C5Axs.mjs";
6
6
  import React, { forwardRef, useCallback, 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";
@@ -1562,12 +1562,13 @@ function formatBlockKindLabel(blockKind) {
1562
1562
  }
1563
1563
  //#endregion
1564
1564
  //#region ../preview-next/src/client/preview/PageBlockEditorPanel.tsx
1565
- function PageBlockEditorPanel({ siteId, pageId, theme, apiClient, bearerToken, supabaseUrl, blockItems, uiStoreForBlockEditor, blockEditorRef, onBlocksChange, metadataPanel, linkedEntrySection, designPanel, sdkConfig, mediaAssets, bookingOfferingPresets, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
1565
+ function PageBlockEditorPanel({ siteId, pageId, theme, apiClient, bearerToken, supabaseUrl, blockItems, uiStoreForBlockEditor, blockEditorRef, onBlocksChange, metadataPanel, linkedEntrySection, designPanel, designOpenRequestId = null, sdkConfig, mediaAssets, bookingOfferingPresets, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
1566
1566
  const customizeSelection = usePreviewBlockCustomizeSelectionOptional();
1567
1567
  const [designOpen, setDesignOpen] = useState(false);
1568
1568
  const [customizeOpen, setCustomizeOpen] = useState(false);
1569
1569
  const [contentOpen, setContentOpen] = useState(true);
1570
1570
  const [detailsOpen, setDetailsOpen] = useState(false);
1571
+ const designSectionRef = useRef(null);
1571
1572
  const customizeSectionRef = useRef(null);
1572
1573
  const selectionKind = customizeSelection?.selection.kind;
1573
1574
  const selectionRequestId = customizeSelection?.selection.kind === "selected" ? customizeSelection.selection.requestId : 0;
@@ -1594,6 +1595,14 @@ function PageBlockEditorPanel({ siteId, pageId, theme, apiClient, bearerToken, s
1594
1595
  });
1595
1596
  }
1596
1597
  }, [selectionKind, selectionRequestId]);
1598
+ useEffect(() => {
1599
+ if (designOpenRequestId === null) return;
1600
+ setDesignOpen(true);
1601
+ designSectionRef.current?.scrollIntoView({
1602
+ block: "start",
1603
+ behavior: "smooth"
1604
+ });
1605
+ }, [designOpenRequestId]);
1597
1606
  return /* @__PURE__ */ jsxs("div", {
1598
1607
  className: "flex h-full min-h-0 flex-col overflow-hidden",
1599
1608
  children: [/* @__PURE__ */ jsx("div", {
@@ -1627,6 +1636,7 @@ function PageBlockEditorPanel({ siteId, pageId, theme, apiClient, bearerToken, s
1627
1636
  open: designOpen,
1628
1637
  onOpenChange: setDesignOpen,
1629
1638
  children: /* @__PURE__ */ jsxs("div", {
1639
+ ref: designSectionRef,
1630
1640
  className: "border-b",
1631
1641
  children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
1632
1642
  asChild: true,
@@ -2107,7 +2117,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
2107
2117
  const router = useRouter();
2108
2118
  const previewDesign = usePreviewDesignCoordinator();
2109
2119
  const siteChromeCustomize = useSiteChromeCustomizeOptional();
2110
- const setSiteStyleStagedPreviewActive = siteChromeCustomize?.siteStyleHistory.setStagedPreviewActive;
2120
+ const setSiteStyleStagedPreviewActive = siteChromeCustomize?.siteStyleHistory?.setStagedPreviewActive;
2111
2121
  const { applyFailed, applyStarted, applySucceeded, clearPreview, previewTheme } = previewDesign;
2112
2122
  const [isRefreshPending, startRefreshTransition] = useTransition();
2113
2123
  const baseSnapshot = useMemo(() => resolveStyleConfiguratorInitialSnapshot({
@@ -2194,7 +2204,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
2194
2204
  setState((current) => {
2195
2205
  if (!current) return current;
2196
2206
  appliedExpandedRowRequestIdRef.current = expandedRowRequest.id;
2197
- return openRow(current, expandedRowRequest.row === "header" ? "header-layout" : expandedRowRequest.row);
2207
+ return openRow(current, expandedRowForPreviewDesignRow(expandedRowRequest.row));
2198
2208
  });
2199
2209
  }, [expandedRowRequest, hasLoadedState]);
2200
2210
  const handlePreviewSiteStyle = useCallback((siteStyleId) => {
@@ -2380,7 +2390,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
2380
2390
  const persisted = selectionSnapshotFromApplySiteStyleSelectionResponse(saved, previewed);
2381
2391
  const historyEntry = styleConfiguratorHistoryEntryForPersistedSelection(live, persisted);
2382
2392
  setState((current) => current ? markApplySaved(current, persisted) : current);
2383
- if (historyEntry) siteChromeCustomize?.siteStyleHistory.recordAppliedSelection(historyEntry);
2393
+ if (historyEntry) siteChromeCustomize?.siteStyleHistory?.recordAppliedSelection(historyEntry);
2384
2394
  applySucceeded("style-configurator");
2385
2395
  startRefreshTransition(() => {
2386
2396
  router.refresh();
@@ -2443,6 +2453,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
2443
2453
  const currentHeaderStyle = getHeaderStyle(state.previewed.headerStyleId);
2444
2454
  const currentFooterLayout = getFooterLayout(chromeLookModels.footerLayout.renderedLayoutId);
2445
2455
  const currentFooterLook = state.previewed.footerLookId ? findFooterLook(state.previewed.footerLookId) : findFooterLook(chromeLookModels.footer.renderedLookId);
2456
+ const headerSurfaceState = siteChromeCustomize?.getSurfaceState("header") ?? { kind: "unavailable" };
2446
2457
  return /* @__PURE__ */ jsxs("div", {
2447
2458
  className: "space-y-3",
2448
2459
  children: [
@@ -2495,7 +2506,13 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
2495
2506
  if (next !== void 0) handlePreviewHeaderStyle(next);
2496
2507
  },
2497
2508
  onPreview: handlePreviewHeaderStyle,
2498
- disabled: saving
2509
+ disabled: saving,
2510
+ extraControls: isHeaderMenuSurfaceState(headerSurfaceState) ? /* @__PURE__ */ jsx(HeaderMenuControls, {
2511
+ state: headerSurfaceState,
2512
+ disabled: saving,
2513
+ onMenuFontChange: siteChromeCustomize?.setHeaderMenuFont,
2514
+ onMenuFontSizeChange: siteChromeCustomize?.setHeaderMenuFontSize
2515
+ }) : null
2499
2516
  }),
2500
2517
  /* @__PURE__ */ jsx(SiteChromeLookRow, {
2501
2518
  label: "Footer layout",
@@ -3293,7 +3310,7 @@ function SiteChromeLookRow({ label, ariaLabel, defaultDescription, catalog, opti
3293
3310
  }, ...(catalog ?? []).map((look) => ({
3294
3311
  ...look,
3295
3312
  available: true
3296
- }))], diagnostics, scopeDescription, expanded, onToggle, currentId, currentLabel, onCycle, onPreview, disabled }) {
3313
+ }))], diagnostics, scopeDescription, expanded, onToggle, currentId, currentLabel, onCycle, onPreview, disabled, extraControls }) {
3297
3314
  return /* @__PURE__ */ jsxs(StyleRowFrame, {
3298
3315
  label,
3299
3316
  currentLabel,
@@ -3328,6 +3345,10 @@ function SiteChromeLookRow({ label, ariaLabel, defaultDescription, catalog, opti
3328
3345
  className: "mb-3 list-none space-y-1 p-0 text-xs text-amber-700",
3329
3346
  children: diagnostics.map((diagnostic) => /* @__PURE__ */ jsx("li", { children: diagnostic }, diagnostic))
3330
3347
  }) : null,
3348
+ extraControls ? /* @__PURE__ */ jsx("div", {
3349
+ className: "mb-3",
3350
+ children: extraControls
3351
+ }) : null,
3331
3352
  /* @__PURE__ */ jsx("ul", {
3332
3353
  role: "radiogroup",
3333
3354
  "aria-label": ariaLabel,
@@ -3343,6 +3364,40 @@ function SiteChromeLookRow({ label, ariaLabel, defaultDescription, catalog, opti
3343
3364
  ]
3344
3365
  });
3345
3366
  }
3367
+ function isHeaderMenuSurfaceState(state) {
3368
+ return state.kind === "available" && state.surface === "header" && Array.isArray(state.menuFontOptions) && Array.isArray(state.menuFontSizeOptions);
3369
+ }
3370
+ function HeaderMenuControls({ state, disabled, onMenuFontChange, onMenuFontSizeChange }) {
3371
+ const controlDisabled = disabled || !state.applyAllowed;
3372
+ return /* @__PURE__ */ jsxs("div", {
3373
+ className: "grid grid-cols-2 gap-2 rounded-md border bg-muted/20 p-2",
3374
+ children: [/* @__PURE__ */ jsxs("label", {
3375
+ className: "block text-xs font-medium text-muted-foreground",
3376
+ children: [/* @__PURE__ */ jsx("span", { children: "Menu font" }), /* @__PURE__ */ jsx("select", {
3377
+ 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",
3378
+ value: state.menuFont,
3379
+ onChange: (event) => onMenuFontChange?.(event.currentTarget.value),
3380
+ disabled: controlDisabled,
3381
+ children: state.menuFontOptions.map((option) => /* @__PURE__ */ jsx("option", {
3382
+ value: option.value,
3383
+ children: option.label
3384
+ }, option.value))
3385
+ })]
3386
+ }), /* @__PURE__ */ jsxs("label", {
3387
+ className: "block text-xs font-medium text-muted-foreground",
3388
+ children: [/* @__PURE__ */ jsx("span", { children: "Menu font size" }), /* @__PURE__ */ jsx("select", {
3389
+ 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",
3390
+ value: state.menuFontSize,
3391
+ onChange: (event) => onMenuFontSizeChange?.(event.currentTarget.value),
3392
+ disabled: controlDisabled,
3393
+ children: state.menuFontSizeOptions.map((option) => /* @__PURE__ */ jsx("option", {
3394
+ value: option.value,
3395
+ children: option.label
3396
+ }, option.value))
3397
+ })]
3398
+ })]
3399
+ });
3400
+ }
3346
3401
  function PaletteRow({ expanded, onToggle, siteStyle, currentId, currentLabel, currentSwatch, onPreview, disabled }) {
3347
3402
  const options = useMemo(() => {
3348
3403
  const recommended = requireEntriesForCuratedChoices(paletteVariants, siteStyle.paletteVariantChoices);
@@ -3461,6 +3516,16 @@ function classifyStyleApplyError(error) {
3461
3516
  message: error instanceof Error ? error.message : "Unable to apply your selection."
3462
3517
  };
3463
3518
  }
3519
+ function expandedRowForPreviewDesignRow(row) {
3520
+ switch (row) {
3521
+ case "header": return "header-layout";
3522
+ case "header-layout":
3523
+ case "header-style":
3524
+ case "footer-layout":
3525
+ case "footer": return row;
3526
+ default: return assertNever$2(row, "Unhandled preview design row");
3527
+ }
3528
+ }
3464
3529
  function isRecord(value) {
3465
3530
  return typeof value === "object" && value !== null;
3466
3531
  }
@@ -3634,6 +3699,7 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
3634
3699
  blockEditorRef,
3635
3700
  onBlocksChange: handleBlocksChange,
3636
3701
  metadataPanel: metadataSectionContent,
3702
+ designOpenRequestId: designRowRequest?.id ?? null,
3637
3703
  designPanel: canInspectSiteStyle(siteStyleAccess) ? /* @__PURE__ */ jsx(StyleConfigurator, {
3638
3704
  siteId,
3639
3705
  apiClient,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { $l as DropdownMenuContent, Bd as Eye, Cd as Pencil, Fl as DialogContent, Hd as EllipsisVertical, Il as DialogDescription, Nl as Dialog, Ot as useMultiAutosave, Ql as DropdownMenu, Rl as DialogHeader, Su as cn, Td as Palette, _t as useEditorUiStore, a as previewDesignHistoryDomainForCommand, bu as cva, cl as Tooltip, dd as TriangleAlert, dl as TooltipTrigger, ef as ChevronDown, eu as DropdownMenuItem, gd as Sparkles, gt as classifyHistoryShortcut, ht as useEntryEditorController, i as usePreviewDesignHistoryOrder, kd as LoaderCircle, ll as TooltipContent, lt as useEditor, n as useSiteChromeCustomizeOptional, o as selectPreviewDesignHistoryDomain, ru as DropdownMenuTrigger, ud as Undo2, vt as useEditorUiStoreInstance, wd as PenLine, xd as Redo2, yu as Button, zl as DialogTitle } from "./SiteChromeCustomizeContext-Bh9-DtMQ.mjs";
2
+ import { Cu as cva, Dd as PenLine, Ed as Pencil, Gd as EllipsisVertical, Hl as DialogTitle, Il as Dialog, Md as LoaderCircle, Od as Palette, Ot as useMultiAutosave, Rl as DialogContent, Su as Button, Tu as cn, Ud as Eye, Vl as DialogHeader, _t as useEditorUiStore, a as previewDesignHistoryDomainForCommand, dl as Tooltip, fl as TooltipContent, gt as classifyHistoryShortcut, ht as useEntryEditorController, i as usePreviewDesignHistoryOrder, lt as useEditor, md as TriangleAlert, ml as TooltipTrigger, n as useSiteChromeCustomizeOptional, nu as DropdownMenuContent, o as selectPreviewDesignHistoryDomain, ou as DropdownMenuTrigger, pd as Undo2, rf as ChevronDown, ru as DropdownMenuItem, tu as DropdownMenu, vt as useEditorUiStoreInstance, wd as Redo2, yd as Sparkles, zl as DialogDescription } from "./SiteChromeCustomizeContext-CO1sTK_W.mjs";
3
3
  import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-ByPPZqmp.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, u as setPreviewSidebarTab } from "./SdkPreviewModeRuntime-CA2k7Z_T.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, u as setPreviewSidebarTab } from "./SdkPreviewModeRuntime-5bCsXK2y.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";