@riverbankcms/sdk 0.82.0 → 0.84.1
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.
- package/README.md +16 -0
- package/dist/{PreviewEditorSidebar-LHGK6RIO.mjs → PreviewEditorSidebar-X7RLMEI6.mjs} +330 -11
- package/dist/{PreviewEditorUI-AXZG2SDC.mjs → PreviewEditorUI-CT67N4O3.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-EIMQ3S2V.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +200 -0
- package/dist/_dts/api/src/blocks.d.ts +36 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +46 -0
- package/dist/_dts/api/src/endpoints.d.ts +40 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/sdk-event-pricing.d.ts +61 -0
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +52 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +50 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +67 -33
- package/dist/_dts/api/src/shared-contracts.d.ts +13 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +22 -36
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +46 -1
- package/dist/_dts/block-form/src/backend/useBackendWatch.d.ts +6 -1
- package/dist/_dts/block-form/src/utils/evaluateVisibility.d.ts +3 -2
- package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +7 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +11 -0
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -1
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +4 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +16 -4
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +171 -0
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -7
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +2534 -151
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -2016
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +36 -3
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fields/aspectRatio.d.ts +4 -1
- package/dist/_dts/blocks/src/system/fields/imageShape.d.ts +30 -0
- package/dist/_dts/blocks/src/system/fragments/library/heroLayoutControls.d.ts +25 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +35 -161
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +33 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +0 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/constants.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +275 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.override.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +22 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.state.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +20 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +13 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +28 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +14 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/buildBlockPublishedBaselines.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/useBlocksList.d.ts +1 -1
- package/dist/_dts/content-editor/src/controller/useInvalidBlockRecovery.d.ts +1 -1
- package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +2 -1
- package/dist/_dts/content-editor/src/primitives/PreviewTextEditor.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +356 -0
- package/dist/_dts/content-model/src/index.d.ts +1 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +7 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +100 -5
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +6 -1
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +7 -5
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +3 -2
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +3 -2
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockReorder.d.ts +3 -2
- package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +27 -0
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +8 -0
- package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +37 -3
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +4 -2
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +19 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +8 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/linkedEntryEditEvents.d.ts +9 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeControls.d.ts +9 -8
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +10 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +5 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +5 -4
- package/dist/_dts/sdk/src/bookings/types.d.ts +2 -2
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +9 -8
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +6 -1
- package/dist/_dts/sdk/src/cli/helpers.d.ts +10 -5
- package/dist/_dts/sdk/src/cli/merge-remote/entryLocal.d.ts +2 -2
- package/dist/_dts/sdk/src/cli/merge-remote/entryMerge.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -2
- package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +40 -10
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +13 -7
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +26 -3
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +13 -0
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +6 -1
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +6 -1
- package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +15 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/ornate-ritual.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/cards/types.d.ts +15 -15
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +33 -33
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +15 -0
- package/dist/_dts/theme-core/src/palette/variants/warm-dark.d.ts +16 -0
- package/dist/_dts/theme-core/src/schema.d.ts +30 -25
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +141 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -0
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +110 -5
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -2
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +16 -1
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +1 -0
- package/dist/_dts/theme-core/src/utils/colorStyles.d.ts +6 -6
- package/dist/{chunk-2BUMISSH.mjs → chunk-3LXFQS7T.mjs} +1 -1
- package/dist/{chunk-FIREV57T.mjs → chunk-LBBPD2IW.mjs} +40 -0
- package/dist/{chunk-XQR6THQJ.mjs → chunk-O62NDCTI.mjs} +3390 -1331
- package/dist/{chunk-6FWNF3DJ.mjs → chunk-QRKJDWT7.mjs} +158 -20
- package/dist/{chunk-HKB6XVIP.mjs → chunk-RCTJAZSK.mjs} +2 -2
- package/dist/{chunk-G35HOQEN.mjs → chunk-X5ZCSU6F.mjs} +132 -46
- package/dist/cli/index.mjs +2925 -577
- package/dist/cli/init-docs/content/agents-section.md +5 -0
- package/dist/cli/init-docs/content/cli-reference.md +13 -0
- package/dist/cli/init-docs/content/content-management.md +31 -0
- package/dist/cli/init-docs/content/getting-started.md +14 -0
- package/dist/cli/init-docs/content/workflow-add-block.md +3 -1
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +81 -0
- package/dist/cli/init-docs/content/workflow-create-page.md +13 -3
- package/dist/cli/init-docs/content/workflow-custom-block.md +9 -0
- package/dist/cli/init-docs/content/workflow-templates.md +107 -2
- package/dist/client/{accordion-G34C45TW.mjs → accordion-2UZPBMYM.mjs} +2 -2
- package/dist/client/{bookingForm-BLBVKSAQ.mjs → bookingForm-DYXT6YB6.mjs} +5 -5
- package/dist/client/bookings.mjs +3477 -186
- package/dist/client/{carousel-7ZVTBRMD.mjs → carousel-QH77HR6X.mjs} +3 -3
- package/dist/client/{cart-Q6S6LZUO.mjs → cart-X4YK4FTW.mjs} +6 -6
- package/dist/client/{checkout-5QJLDE4I.mjs → checkout-OM2BEPWD.mjs} +6 -6
- package/dist/client/{chunk-ZF4XEWDM.mjs → chunk-3DTWLTXM.mjs} +1 -1
- package/dist/client/{chunk-5PQH4Y75.mjs → chunk-4OXKTA3D.mjs} +2 -2
- package/dist/client/{chunk-WJFHDTYF.mjs → chunk-52CGCQ7B.mjs} +5 -5
- package/dist/client/{chunk-CHAB5ACD.mjs → chunk-7UCLJ5SP.mjs} +2 -2
- package/dist/client/{chunk-U2EW7RSR.mjs → chunk-F5VRX5Y6.mjs} +1 -1
- package/dist/client/{chunk-SBBSMFFG.mjs → chunk-SYIJ5JO2.mjs} +1 -1
- package/dist/client/{chunk-EQKYMX4N.mjs → chunk-UHDWIXVR.mjs} +180 -157
- package/dist/client/{chunk-RJHTCTCZ.mjs → chunk-VGDBVNOO.mjs} +429 -15
- package/dist/client/{chunk-S3MKFGOG.mjs → chunk-ZE5G642V.mjs} +1 -1
- package/dist/client/{chunk-CSZGLBYR.mjs → chunk-ZKUO52W3.mjs} +1 -1
- package/dist/client/client.mjs +2685 -847
- package/dist/client/{courseRegistration-VUG2JJDB.mjs → courseRegistration-YBOGURTA.mjs} +5 -5
- package/dist/client/{eventCalendar-E7D2LD4N.mjs → eventCalendar-K4QJVCMD.mjs} +7 -7
- package/dist/client/{eventCombined-FUZ2Z3CS.mjs → eventCombined-MTXGMTCZ.mjs} +7 -7
- package/dist/client/{eventDetails-QRITJAOW.mjs → eventDetails-3PC4NL3U.mjs} +7 -7
- package/dist/client/{eventListing-INMQMJZ5.mjs → eventListing-TFJET6DN.mjs} +7 -7
- package/dist/client/{eventRegistration-TOOJD4WU.mjs → eventRegistration-QGPBGJTW.mjs} +7 -7
- package/dist/client/{form-BOWN7ZNQ.mjs → form-MDKR4FNB.mjs} +2 -2
- package/dist/client/{headerSection-HFQNZOUU.mjs → headerSection-Y5TMR3TW.mjs} +3 -3
- package/dist/client/hooks.mjs +2077 -546
- package/dist/client/{locationMap-VUZGC7Y5.mjs → locationMap-RH2LG7FZ.mjs} +2 -2
- package/dist/client/{newsletterForm-X2XQTPCB.mjs → newsletterForm-ZR5UDGBT.mjs} +2 -2
- package/dist/client/{productDetail-TA7D2G2B.mjs → productDetail-OIGDR4YE.mjs} +6 -6
- package/dist/client/{productList-AZOLOZKM.mjs → productList-4MA5S2CX.mjs} +6 -6
- package/dist/client/rendering/client.mjs +2560 -1205
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +2932 -1021
- package/dist/client/{shop-ZDLO7IIG.mjs → shop-WXSYV5QO.mjs} +6 -6
- package/dist/preview-next/before-render.mjs +40 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +40 -0
- package/dist/{sdk-runtime-CTWKNBDQ.mjs → sdk-runtime-7HJYPRWQ.mjs} +6 -6
- package/dist/server/components.mjs +2232 -534
- package/dist/server/config-validation.mjs +2068 -536
- package/dist/server/config.mjs +2068 -536
- package/dist/server/data.mjs +2077 -546
- package/dist/server/index.mjs +42 -1
- package/dist/server/next.mjs +2345 -574
- package/dist/server/page-converter.mjs +2684 -1220
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2244 -546
- package/dist/server/rendering.mjs +2323 -552
- package/dist/server/routing.mjs +2012 -420
- package/dist/server/server.mjs +2153 -549
- package/dist/server/theme-bridge.mjs +1180 -101
- package/dist/server/theme.mjs +92 -1
- package/dist/styles/index.css +292 -36
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-RNVRHFFR.mjs +0 -8
package/README.md
CHANGED
|
@@ -183,6 +183,10 @@ For detailed testing and verification steps, see [`docs/resilience-verification.
|
|
|
183
183
|
|
|
184
184
|
SDK sites that need bespoke appointment booking UI can use the headless booking runtime from `@riverbankcms/sdk/bookings`. See [`docs/headless-booking.md`](./docs/headless-booking.md) for the real `blockOverrides` pattern with an `'appointment-booking'` override, `HeadlessBookingProvider`, `getAppointmentBookingOverrideInput`, and `useHeadlessBookingFlow`.
|
|
185
185
|
|
|
186
|
+
### Headless Event Registration
|
|
187
|
+
|
|
188
|
+
SDK sites that need bespoke event registration UI can use the headless event registration runtime from `@riverbankcms/sdk/bookings`. See [`docs/headless-event-registration.md`](./docs/headless-event-registration.md) for the real `blockOverrides` pattern with an `'event-registration'` override, `HeadlessEventRegistrationProvider`, `getEventRegistrationOverrideInput`, and `useHeadlessEventRegistrationFlow`.
|
|
189
|
+
|
|
186
190
|
### Server-Side API
|
|
187
191
|
|
|
188
192
|
```tsx
|
|
@@ -1507,6 +1511,8 @@ export function MyComponent() {
|
|
|
1507
1511
|
|
|
1508
1512
|
Style Builder blocks to match your brand using the Theme Bridge. This provides CSS variables and optional component styles without requiring the full CMS theme system.
|
|
1509
1513
|
|
|
1514
|
+
For event registration specifically, see [`docs/event-registration-theming.md`](./docs/event-registration-theming.md). Generated SDK sites using `Layout` get a full `ThemeScope` by default; standalone `Page` or `Block` rendering should use `ThemeBridgeProvider` or manual `generateThemeBridgeCss` with a `data-theme-scope="sdk"` wrapper.
|
|
1515
|
+
|
|
1510
1516
|
### Quick Start
|
|
1511
1517
|
|
|
1512
1518
|
Import the SDK base stylesheet, then wrap your app with `ThemeBridgeProvider` and define your color tokens:
|
|
@@ -2898,6 +2904,16 @@ entries: [
|
|
|
2898
2904
|
bio: '<p>Our founder...</p>',
|
|
2899
2905
|
role: 'CEO',
|
|
2900
2906
|
},
|
|
2907
|
+
// Optional Page Content blocks for template-declared system.entry-slot areas.
|
|
2908
|
+
blocks: {
|
|
2909
|
+
main: [
|
|
2910
|
+
{
|
|
2911
|
+
identifier: 'intro',
|
|
2912
|
+
kind: 'block.body-text',
|
|
2913
|
+
content: { body: 'A richer editable introduction.' },
|
|
2914
|
+
},
|
|
2915
|
+
],
|
|
2916
|
+
},
|
|
2901
2917
|
metaTitle: 'John Smith | Team',
|
|
2902
2918
|
metaDescription: 'Meet John Smith, our CEO',
|
|
2903
2919
|
},
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolvePreviewDashboardSetupHandoff, buildPreviewDashboardSetupUrl, resolvePreviewSidebarChromeModel, resolvePreviewEditorGuidanceModel, previewWidgetOverrides, canInspectSiteStyle, mapContentSchemaToFormFields, PreviewFormProvider, usePreviewBlockCustomizeSelectionOptional, BlockEditor, canApplySiteStyle, useBlockCustomizeControls, MAX_QUICK_MANIFEST_FIELDS } from './chunk-
|
|
3
|
-
import { useEntryController, useEditorUiStoreInstance, useUISelector, resolvePreviewSidebarTab, unsafeAsEditorBlockId, Tabs, TabsList, TabsTrigger, Button, X, TabsContent, useEditorUiStore, deriveRouteMetadataPresentation, resolvePageRouteSlug, createManifestValidation, createStoreBackend, ManifestForm, previewAssistantEnabled, Collapsible, CollapsibleTrigger, ChevronRight, CollapsibleContent, ContentFieldsForm, usePreviewDesignCoordinator, useSiteChromeCustomizeOptional, resolveStyleConfiguratorInitialSnapshot, createStyleConfiguratorState, isPreviewingChange, createOptimisticActionRunner, syncStyleConfiguratorState, getCuratedSiteStyle, planSiteStylePreviewChange, openRow, previewSiteStyle, applyResolvedSelections, previewButtonPersonality, previewHeaderLayout, previewHeaderStyle, planSiteChromeLookSelection, previewFooterLook, previewPaletteVariant, previewTypographyPreset, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, clearTypographyFontOverrides, paletteOverridesSchema, setPaletteOverrides, toggleRow, cancelPreview, dismissWarnings, dismissNotices, deriveStyleConfiguratorCapabilities, buildApplySiteStyleSelectionBody, markApplyFailed, selectionSnapshotFromApplySiteStyleSelectionResponse, styleConfiguratorHistoryEntryForPersistedSelection, markApplySaved, unwrapResponse, markApplySaving, findButtonPersonality, findPaletteVariant, findTypographyPreset,
|
|
4
|
-
import { usePreviewAuth, getDashboardUrl } from './chunk-
|
|
2
|
+
import { resolvePreviewDashboardSetupHandoff, buildPreviewDashboardSetupUrl, resolvePreviewSidebarChromeModel, resolvePreviewEditorGuidanceModel, previewWidgetOverrides, canInspectSiteStyle, mapContentSchemaToFormFields, PreviewFormProvider, usePreviewBlockCustomizeSelectionOptional, BlockEditor, canApplySiteStyle, useBlockCustomizeControls, MAX_QUICK_MANIFEST_FIELDS } from './chunk-X5ZCSU6F.mjs';
|
|
3
|
+
import { useEntryController, useEditorUiStoreInstance, useUISelector, resolvePreviewSidebarTab, unsafeAsEditorBlockId, Tabs, TabsList, TabsTrigger, Button, X, TabsContent, useEditorUiStore, deriveRouteMetadataPresentation, resolvePageRouteSlug, createManifestValidation, createStoreBackend, ManifestForm, previewAssistantEnabled, Collapsible, CollapsibleTrigger, ChevronRight, CollapsibleContent, ContentFieldsForm, usePreviewDesignCoordinator, useSiteChromeCustomizeOptional, resolveStyleConfiguratorInitialSnapshot, createStyleConfiguratorState, isPreviewingChange, createOptimisticActionRunner, syncStyleConfiguratorState, getCuratedSiteStyle, planSiteStylePreviewChange, openRow, previewSiteStyle, applyResolvedSelections, previewButtonPersonality, previewHeaderLayout, previewHeaderStyle, planSiteChromeLookSelection, previewFooterLook, buildSiteChromeLookModels, planSiteChromeFooterLayoutSelection, previewPaletteVariant, previewTypographyPreset, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, clearTypographyFontOverrides, paletteOverridesSchema, setPaletteOverrides, toggleRow, cancelPreview, dismissWarnings, dismissNotices, deriveStyleConfiguratorCapabilities, buildApplySiteStyleSelectionBody, markApplyFailed, selectionSnapshotFromApplySiteStyleSelectionResponse, styleConfiguratorHistoryEntryForPersistedSelection, markApplySaved, unwrapResponse, markApplySaving, findButtonPersonality, findPaletteVariant, findTypographyPreset, getHeaderLayout, getHeaderStyle, getFooterLayout, findFooterLook, cycleSiteChromeLookId, resolveContentTitle, foldSubroute, SUBROUTE_KINDS, Smartphone, Tablet, Monitor, Maximize2, cn, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, listEntryPageContentSlots, ContentSpinner, Callout, CalloutDescription, curatedSiteStyles, ChevronLeft, cycleableSiteChromeOptions, requireEntriesForCuratedChoices, buttonPersonalities, typographyPresets, paletteVariants, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, FormRenderer, evaluateTypographyFontSlot, Separator, Surface, ColorPicker, Input } from './chunk-O62NDCTI.mjs';
|
|
4
|
+
import { usePreviewAuth, getDashboardUrl } from './chunk-LBBPD2IW.mjs';
|
|
5
5
|
import './chunk-R7POPVJR.mjs';
|
|
6
|
-
import { useMemo, useRef, useCallback, useEffect, useState, useTransition, useSyncExternalStore, useId } from 'react';
|
|
6
|
+
import { useMemo, useRef, useCallback, useEffect, useState, useTransition, useLayoutEffect, useSyncExternalStore, useId } from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { useRouter } from 'next/navigation';
|
|
9
|
+
import { useQueryClient, useQuery } from '@tanstack/react-query';
|
|
9
10
|
|
|
10
11
|
function PreviewZoomControls({ zoom, onZoomChange, disabled }) {
|
|
11
12
|
return /* @__PURE__ */ jsxs(
|
|
@@ -154,6 +155,239 @@ function resolveSubrouteNotice(ctx, args) {
|
|
|
154
155
|
"course-run": (run) => buildNoticeFromMeta(SUBROUTE_KINDS["course-run"], run, args.siteId)
|
|
155
156
|
});
|
|
156
157
|
}
|
|
158
|
+
var EMPTY_BLOCKS = [];
|
|
159
|
+
var EMPTY_SLOTS = [];
|
|
160
|
+
var EMPTY_SELECTION = { kind: "none" };
|
|
161
|
+
function entryPageContentSlotsKey(siteId, typeKey, entryId) {
|
|
162
|
+
return ["preview-entry-page-content-slots", siteId, typeKey, entryId];
|
|
163
|
+
}
|
|
164
|
+
function getAllowedBlockKinds(slot) {
|
|
165
|
+
return slot.allowedBlocks.blockKinds;
|
|
166
|
+
}
|
|
167
|
+
function resolveSlotSelection(current, slots) {
|
|
168
|
+
const firstSlotKey = slots[0]?.slotKey;
|
|
169
|
+
if (!firstSlotKey) return EMPTY_SELECTION;
|
|
170
|
+
if (current.kind === "selected" && slots.some((slot) => slot.slotKey === current.slotKey)) {
|
|
171
|
+
return current;
|
|
172
|
+
}
|
|
173
|
+
return { kind: "selected", slotKey: firstSlotKey };
|
|
174
|
+
}
|
|
175
|
+
function findSelectedSlot(selection, slots) {
|
|
176
|
+
if (selection.kind === "none") return null;
|
|
177
|
+
return slots.find((slot) => slot.slotKey === selection.slotKey) ?? null;
|
|
178
|
+
}
|
|
179
|
+
function selectionsEqual(left, right) {
|
|
180
|
+
if (left.kind !== right.kind) return false;
|
|
181
|
+
switch (left.kind) {
|
|
182
|
+
case "none":
|
|
183
|
+
return true;
|
|
184
|
+
case "selected":
|
|
185
|
+
return right.kind === "selected" && left.slotKey === right.slotKey;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function findSlotKeyForBlock(slots, blockId) {
|
|
189
|
+
if (!blockId) return null;
|
|
190
|
+
return slots.find((slot) => slot.blocks.some((block) => block.id === blockId))?.slotKey ?? null;
|
|
191
|
+
}
|
|
192
|
+
function updateBlocksWithSavedContent(blocks, blockId, content) {
|
|
193
|
+
let changed = false;
|
|
194
|
+
const nextBlocks = blocks.map((block) => {
|
|
195
|
+
if (block.id !== blockId) return block;
|
|
196
|
+
changed = true;
|
|
197
|
+
return {
|
|
198
|
+
...block,
|
|
199
|
+
content,
|
|
200
|
+
draftContent: content
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
return changed ? nextBlocks : blocks;
|
|
204
|
+
}
|
|
205
|
+
function getErrorMessage(error) {
|
|
206
|
+
return error instanceof Error ? error.message : "Unable to load Page Content.";
|
|
207
|
+
}
|
|
208
|
+
function EntrySlotBlockEditorPanel({
|
|
209
|
+
siteId,
|
|
210
|
+
typeKey,
|
|
211
|
+
entryId,
|
|
212
|
+
theme = null,
|
|
213
|
+
apiClient,
|
|
214
|
+
bearerToken,
|
|
215
|
+
supabaseUrl,
|
|
216
|
+
sdkConfig = null,
|
|
217
|
+
mediaAssets,
|
|
218
|
+
widgets
|
|
219
|
+
}) {
|
|
220
|
+
const router = useRouter();
|
|
221
|
+
const queryClient = useQueryClient();
|
|
222
|
+
const uiStore = useEditorUiStoreInstance();
|
|
223
|
+
const blockEditorRef = useRef(null);
|
|
224
|
+
const focusRequest = useEditorUiStore((state) => state.focusRequest);
|
|
225
|
+
const blockAutosaveStatus = useEditorUiStore(
|
|
226
|
+
(state) => state.autosave.blocks.status
|
|
227
|
+
);
|
|
228
|
+
const [slotSelection, setSlotSelection] = useState(EMPTY_SELECTION);
|
|
229
|
+
const queryKey = useMemo(
|
|
230
|
+
() => entryPageContentSlotsKey(siteId, typeKey, entryId),
|
|
231
|
+
[entryId, siteId, typeKey]
|
|
232
|
+
);
|
|
233
|
+
const slotsQuery = useQuery({
|
|
234
|
+
queryKey,
|
|
235
|
+
queryFn: () => listEntryPageContentSlots(apiClient, {
|
|
236
|
+
siteId,
|
|
237
|
+
type: typeKey,
|
|
238
|
+
entryId
|
|
239
|
+
}),
|
|
240
|
+
staleTime: 3e4
|
|
241
|
+
});
|
|
242
|
+
const handleBlockSave = useCallback(
|
|
243
|
+
(blockId, content) => {
|
|
244
|
+
const structure = uiStore.getState().structure;
|
|
245
|
+
const currentBlocks = structure.getList();
|
|
246
|
+
const nextBlocks = updateBlocksWithSavedContent(currentBlocks, blockId, content);
|
|
247
|
+
if (nextBlocks !== currentBlocks) {
|
|
248
|
+
structure.replaceList(nextBlocks);
|
|
249
|
+
}
|
|
250
|
+
queryClient.setQueryData(
|
|
251
|
+
queryKey,
|
|
252
|
+
(current) => {
|
|
253
|
+
if (!current) return current;
|
|
254
|
+
return {
|
|
255
|
+
...current,
|
|
256
|
+
slots: current.slots.map((slot) => ({
|
|
257
|
+
...slot,
|
|
258
|
+
blocks: updateBlocksWithSavedContent(slot.blocks, blockId, content)
|
|
259
|
+
}))
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
void queryClient.invalidateQueries({ queryKey });
|
|
264
|
+
router.refresh();
|
|
265
|
+
},
|
|
266
|
+
[queryClient, queryKey, router, uiStore]
|
|
267
|
+
);
|
|
268
|
+
const slots = slotsQuery.data?.slots ?? EMPTY_SLOTS;
|
|
269
|
+
const warnings = slotsQuery.data?.warnings ?? [];
|
|
270
|
+
const selection = useMemo(
|
|
271
|
+
() => resolveSlotSelection(slotSelection, slots),
|
|
272
|
+
[slotSelection, slots]
|
|
273
|
+
);
|
|
274
|
+
const selectedSlot = useMemo(
|
|
275
|
+
() => findSelectedSlot(selection, slots),
|
|
276
|
+
[selection, slots]
|
|
277
|
+
);
|
|
278
|
+
const selectedBlocks = selectedSlot?.blocks ?? EMPTY_BLOCKS;
|
|
279
|
+
const focusRequestedBlockField = useCallback(
|
|
280
|
+
(editor) => {
|
|
281
|
+
if (!editor) return false;
|
|
282
|
+
if (!focusRequest?.blockId) return false;
|
|
283
|
+
if (!selectedBlocks.some((block) => block.id === focusRequest.blockId)) return false;
|
|
284
|
+
editor.focusField({
|
|
285
|
+
blockId: focusRequest.blockId,
|
|
286
|
+
fieldPath: focusRequest.fieldPath ?? void 0,
|
|
287
|
+
itemIndex: focusRequest.itemIndex ?? void 0
|
|
288
|
+
});
|
|
289
|
+
uiStore.getState().clearFocus();
|
|
290
|
+
return true;
|
|
291
|
+
},
|
|
292
|
+
[focusRequest, selectedBlocks, uiStore]
|
|
293
|
+
);
|
|
294
|
+
const handleBlockEditorRef = useCallback(
|
|
295
|
+
(editor) => {
|
|
296
|
+
blockEditorRef.current = editor;
|
|
297
|
+
focusRequestedBlockField(editor);
|
|
298
|
+
},
|
|
299
|
+
[focusRequestedBlockField]
|
|
300
|
+
);
|
|
301
|
+
useEffect(() => {
|
|
302
|
+
setSlotSelection(
|
|
303
|
+
(current) => selectionsEqual(current, selection) ? current : selection
|
|
304
|
+
);
|
|
305
|
+
}, [selection]);
|
|
306
|
+
useEffect(() => {
|
|
307
|
+
const focusedSlotKey = findSlotKeyForBlock(slots, focusRequest?.blockId);
|
|
308
|
+
if (!focusedSlotKey) return;
|
|
309
|
+
setSlotSelection({ kind: "selected", slotKey: focusedSlotKey });
|
|
310
|
+
}, [focusRequest?.blockId, slots]);
|
|
311
|
+
useLayoutEffect(() => {
|
|
312
|
+
focusRequestedBlockField(blockEditorRef.current);
|
|
313
|
+
}, [focusRequestedBlockField]);
|
|
314
|
+
if (slotsQuery.isLoading) {
|
|
315
|
+
return /* @__PURE__ */ jsx(ContentSpinner, { className: "py-8" });
|
|
316
|
+
}
|
|
317
|
+
if (slotsQuery.isError) {
|
|
318
|
+
return /* @__PURE__ */ jsx(Callout, { tone: "danger", role: "alert", className: "px-4 py-3", children: /* @__PURE__ */ jsx(CalloutDescription, { className: "mt-0", children: getErrorMessage(slotsQuery.error) }) });
|
|
319
|
+
}
|
|
320
|
+
if (!selectedSlot) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
const slotEditor = /* @__PURE__ */ jsx(
|
|
324
|
+
PreviewFormProvider,
|
|
325
|
+
{
|
|
326
|
+
siteId,
|
|
327
|
+
theme,
|
|
328
|
+
previewClient: apiClient,
|
|
329
|
+
bearerToken,
|
|
330
|
+
supabaseUrl,
|
|
331
|
+
mediaAssets,
|
|
332
|
+
sdkConfig,
|
|
333
|
+
children: /* @__PURE__ */ jsx(
|
|
334
|
+
BlockEditor,
|
|
335
|
+
{
|
|
336
|
+
ref: handleBlockEditorRef,
|
|
337
|
+
siteId,
|
|
338
|
+
owner: {
|
|
339
|
+
kind: "entry-slot",
|
|
340
|
+
type: typeKey,
|
|
341
|
+
entryId,
|
|
342
|
+
slotKey: selectedSlot.slotKey
|
|
343
|
+
},
|
|
344
|
+
blocks: [...selectedBlocks],
|
|
345
|
+
apiClient,
|
|
346
|
+
uiStore,
|
|
347
|
+
theme,
|
|
348
|
+
widgetOverrides: widgets,
|
|
349
|
+
allowedBlockKinds: getAllowedBlockKinds(selectedSlot),
|
|
350
|
+
emptyUnavailableMessage: "No blocks are available for this slot.",
|
|
351
|
+
sdkConfig,
|
|
352
|
+
initialCollapsed: false,
|
|
353
|
+
enableCreation: false,
|
|
354
|
+
enableDeletion: false,
|
|
355
|
+
enableReordering: false,
|
|
356
|
+
reorderControlMode: "drag-handle-only",
|
|
357
|
+
onBlockSave: handleBlockSave
|
|
358
|
+
},
|
|
359
|
+
selectedSlot.slotKey
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
364
|
+
warnings.map((warning) => /* @__PURE__ */ jsx(
|
|
365
|
+
Callout,
|
|
366
|
+
{
|
|
367
|
+
tone: "warning",
|
|
368
|
+
role: "status",
|
|
369
|
+
className: "px-4 py-3",
|
|
370
|
+
children: /* @__PURE__ */ jsx(CalloutDescription, { className: "mt-0", children: warning.message })
|
|
371
|
+
},
|
|
372
|
+
`${warning.kind}:${warning.slotKey}`
|
|
373
|
+
)),
|
|
374
|
+
slots.length > 1 ? /* @__PURE__ */ jsxs(
|
|
375
|
+
Tabs,
|
|
376
|
+
{
|
|
377
|
+
value: selectedSlot.slotKey,
|
|
378
|
+
onValueChange: (nextSlotKey) => {
|
|
379
|
+
if (blockAutosaveStatus === "saving") return;
|
|
380
|
+
uiStore.getState().autosave.saveNow(["blocks"]);
|
|
381
|
+
setSlotSelection({ kind: "selected", slotKey: nextSlotKey });
|
|
382
|
+
},
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ jsx(TabsList, { className: "h-auto flex-wrap justify-start gap-1 bg-transparent p-0", children: slots.map((slot) => /* @__PURE__ */ jsx(TabsTrigger, { value: slot.slotKey, children: slot.label }, slot.slotKey)) }),
|
|
385
|
+
slots.map((slot) => /* @__PURE__ */ jsx(TabsContent, { value: slot.slotKey, className: "mt-4", children: slot.slotKey === selectedSlot.slotKey ? slotEditor : null }, slot.slotKey))
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
) : slotEditor
|
|
389
|
+
] });
|
|
390
|
+
}
|
|
157
391
|
function EntryEditorPanel({
|
|
158
392
|
siteId,
|
|
159
393
|
entryData,
|
|
@@ -170,6 +404,7 @@ function EntryEditorPanel({
|
|
|
170
404
|
linkedEntrySection,
|
|
171
405
|
mediaAssets,
|
|
172
406
|
widgets,
|
|
407
|
+
sdkConfig,
|
|
173
408
|
viewportMode,
|
|
174
409
|
viewportWidth,
|
|
175
410
|
zoom,
|
|
@@ -178,8 +413,15 @@ function EntryEditorPanel({
|
|
|
178
413
|
onZoomChange
|
|
179
414
|
}) {
|
|
180
415
|
const [contentOpen, setContentOpen] = useState(true);
|
|
416
|
+
const [pageContentOpen, setPageContentOpen] = useState(false);
|
|
181
417
|
const [templateOpen, setTemplateOpen] = useState(false);
|
|
182
418
|
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
419
|
+
const focusRequest = useEditorUiStore((state) => state.focusRequest);
|
|
420
|
+
useEffect(() => {
|
|
421
|
+
if (focusRequest?.blockId) {
|
|
422
|
+
setPageContentOpen(true);
|
|
423
|
+
}
|
|
424
|
+
}, [focusRequest?.blockId]);
|
|
183
425
|
const contentFormFields = useMemo(
|
|
184
426
|
// content-model keeps a source-local structural field type so it can typecheck natively
|
|
185
427
|
// without importing @riverbankcms/blocks source. Preview is the integration boundary where
|
|
@@ -254,6 +496,27 @@ function EntryEditorPanel({
|
|
|
254
496
|
}
|
|
255
497
|
) }) })
|
|
256
498
|
] }) }) : /* @__PURE__ */ jsx("div", { className: "border-b px-4 py-3", children: /* @__PURE__ */ jsx("div", { className: "rounded-md border border-dashed px-4 py-6 text-sm text-muted-foreground", children: "Content schema not available for this entry type." }) }),
|
|
499
|
+
entryData.type ? /* @__PURE__ */ jsx(Collapsible, { open: pageContentOpen, onOpenChange: setPageContentOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
500
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
501
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${pageContentOpen ? "rotate-90" : ""}` }),
|
|
502
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Page Content" })
|
|
503
|
+
] }) }),
|
|
504
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "px-4 pb-4", "data-testid": "entry-page-content-editor", children: /* @__PURE__ */ jsx(
|
|
505
|
+
EntrySlotBlockEditorPanel,
|
|
506
|
+
{
|
|
507
|
+
siteId,
|
|
508
|
+
typeKey: entryData.type,
|
|
509
|
+
entryId: entryData.id,
|
|
510
|
+
theme,
|
|
511
|
+
apiClient,
|
|
512
|
+
bearerToken,
|
|
513
|
+
supabaseUrl,
|
|
514
|
+
sdkConfig: sdkConfig ?? null,
|
|
515
|
+
mediaAssets,
|
|
516
|
+
widgets
|
|
517
|
+
}
|
|
518
|
+
) }) })
|
|
519
|
+
] }) }) : null,
|
|
257
520
|
currentTemplate && entryData.type ? /* @__PURE__ */ jsx(Collapsible, { open: templateOpen, onOpenChange: setTemplateOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
258
521
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
259
522
|
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${templateOpen ? "rotate-90" : ""}` }),
|
|
@@ -439,6 +702,7 @@ function PageBlockEditorPanel({
|
|
|
439
702
|
const [customizeOpen, setCustomizeOpen] = useState(false);
|
|
440
703
|
const [contentOpen, setContentOpen] = useState(true);
|
|
441
704
|
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
705
|
+
const customizeSectionRef = useRef(null);
|
|
442
706
|
const selectionKind = customizeSelection?.selection.kind;
|
|
443
707
|
const selectionRequestId = customizeSelection?.selection.kind === "selected" ? customizeSelection.selection.requestId : 0;
|
|
444
708
|
const handleCustomizeBlock = useCallback(
|
|
@@ -455,6 +719,10 @@ function PageBlockEditorPanel({
|
|
|
455
719
|
useEffect(() => {
|
|
456
720
|
if (selectionKind === "selected") {
|
|
457
721
|
setCustomizeOpen(true);
|
|
722
|
+
customizeSectionRef.current?.scrollIntoView({
|
|
723
|
+
block: "start",
|
|
724
|
+
behavior: "smooth"
|
|
725
|
+
});
|
|
458
726
|
}
|
|
459
727
|
}, [selectionKind, selectionRequestId]);
|
|
460
728
|
return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-0 flex-col overflow-hidden", children: [
|
|
@@ -496,7 +764,7 @@ function PageBlockEditorPanel({
|
|
|
496
764
|
] }) }),
|
|
497
765
|
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "px-4 pb-4", children: designPanel }) })
|
|
498
766
|
] }) }) : null,
|
|
499
|
-
/* @__PURE__ */ jsx(Collapsible, { open: customizeOpen, onOpenChange: setCustomizeOpen, children: /* @__PURE__ */ jsxs("div", { className: "border-b", children: [
|
|
767
|
+
/* @__PURE__ */ jsx(Collapsible, { open: customizeOpen, onOpenChange: setCustomizeOpen, children: /* @__PURE__ */ jsxs("div", { ref: customizeSectionRef, className: "border-b", children: [
|
|
500
768
|
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "flex cursor-pointer items-center gap-2 px-4 py-3 hover:bg-accent/40", children: [
|
|
501
769
|
/* @__PURE__ */ jsx(ChevronRight, { className: `h-4 w-4 transition ${customizeOpen ? "rotate-90" : ""}` }),
|
|
502
770
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Customize" })
|
|
@@ -521,7 +789,7 @@ function PageBlockEditorPanel({
|
|
|
521
789
|
{
|
|
522
790
|
ref: blockEditorRef,
|
|
523
791
|
siteId,
|
|
524
|
-
pageId,
|
|
792
|
+
owner: { kind: "page", pageId },
|
|
525
793
|
blocks: blockItems,
|
|
526
794
|
uiStore: uiStoreForBlockEditor,
|
|
527
795
|
apiClient,
|
|
@@ -963,6 +1231,28 @@ function StyleConfigurator({
|
|
|
963
1231
|
(current) => current ? previewFooterLook(current, plan.next.footerLookId) : current
|
|
964
1232
|
);
|
|
965
1233
|
}, []);
|
|
1234
|
+
const handlePreviewFooterLayout = useCallback(
|
|
1235
|
+
(id) => {
|
|
1236
|
+
if (!id) return;
|
|
1237
|
+
setState((current) => {
|
|
1238
|
+
if (!current) return current;
|
|
1239
|
+
const siteStyle = getCuratedSiteStyle(current.previewed.siteStyleId);
|
|
1240
|
+
if (!siteStyle) return current;
|
|
1241
|
+
const models = buildSiteChromeLookModels({
|
|
1242
|
+
state: current,
|
|
1243
|
+
siteStyle,
|
|
1244
|
+
headerSelectionContext,
|
|
1245
|
+
footerSelectionContext
|
|
1246
|
+
});
|
|
1247
|
+
const nextLookId = planSiteChromeFooterLayoutSelection({
|
|
1248
|
+
layoutId: id,
|
|
1249
|
+
currentLookId: current.previewed.footerLookId ?? models.footer.renderedLookId
|
|
1250
|
+
});
|
|
1251
|
+
return nextLookId ? previewFooterLook(current, nextLookId) : current;
|
|
1252
|
+
});
|
|
1253
|
+
},
|
|
1254
|
+
[footerSelectionContext, headerSelectionContext]
|
|
1255
|
+
);
|
|
966
1256
|
const handlePreviewPalette = useCallback((id) => {
|
|
967
1257
|
setState(
|
|
968
1258
|
(current) => current ? previewPaletteVariant(current, id) : current
|
|
@@ -1142,6 +1432,9 @@ function StyleConfigurator({
|
|
|
1142
1432
|
});
|
|
1143
1433
|
const currentHeaderLayout = getHeaderLayout(state.previewed.headerLayoutId);
|
|
1144
1434
|
const currentHeaderStyle = getHeaderStyle(state.previewed.headerStyleId);
|
|
1435
|
+
const currentFooterLayout = getFooterLayout(
|
|
1436
|
+
chromeLookModels.footerLayout.renderedLayoutId
|
|
1437
|
+
);
|
|
1145
1438
|
const currentFooterLook = state.previewed.footerLookId ? findFooterLook(state.previewed.footerLookId) : findFooterLook(chromeLookModels.footer.renderedLookId);
|
|
1146
1439
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
1147
1440
|
state.warnings.length > 0 ? /* @__PURE__ */ jsx(
|
|
@@ -1221,10 +1514,34 @@ function StyleConfigurator({
|
|
|
1221
1514
|
/* @__PURE__ */ jsx(
|
|
1222
1515
|
SiteChromeLookRow,
|
|
1223
1516
|
{
|
|
1224
|
-
label: "Footer",
|
|
1225
|
-
ariaLabel: "Footer",
|
|
1226
|
-
defaultDescription: "
|
|
1227
|
-
|
|
1517
|
+
label: "Footer layout",
|
|
1518
|
+
ariaLabel: "Footer layout",
|
|
1519
|
+
defaultDescription: "Choose the footer structure.",
|
|
1520
|
+
expanded: state.expandedRow === "footer-layout",
|
|
1521
|
+
onToggle: () => handleToggleRow("footer-layout"),
|
|
1522
|
+
currentId: chromeLookModels.footerLayout.renderedLayoutId,
|
|
1523
|
+
currentLabel: currentFooterLayout?.label ?? chromeLookModels.footerLayout.renderedLayoutId,
|
|
1524
|
+
scopeDescription: "Changes the footer structure on every page.",
|
|
1525
|
+
options: chromeLookModels.footerLayout.options,
|
|
1526
|
+
diagnostics: [],
|
|
1527
|
+
onCycle: (direction) => {
|
|
1528
|
+
const next = cycleSiteChromeLookId(
|
|
1529
|
+
chromeLookModels.footerLayout.options,
|
|
1530
|
+
chromeLookModels.footerLayout.renderedLayoutId,
|
|
1531
|
+
direction
|
|
1532
|
+
);
|
|
1533
|
+
if (next !== void 0) handlePreviewFooterLayout(next);
|
|
1534
|
+
},
|
|
1535
|
+
onPreview: handlePreviewFooterLayout,
|
|
1536
|
+
disabled: saving
|
|
1537
|
+
}
|
|
1538
|
+
),
|
|
1539
|
+
/* @__PURE__ */ jsx(
|
|
1540
|
+
SiteChromeLookRow,
|
|
1541
|
+
{
|
|
1542
|
+
label: "Footer look",
|
|
1543
|
+
ariaLabel: "Footer look",
|
|
1544
|
+
defaultDescription: "Use the footer look chosen for this site style.",
|
|
1228
1545
|
expanded: state.expandedRow === "footer",
|
|
1229
1546
|
onToggle: () => handleToggleRow("footer"),
|
|
1230
1547
|
currentId: state.previewed.footerLookId,
|
|
@@ -2304,6 +2621,7 @@ function PreviewEditorSidebar({
|
|
|
2304
2621
|
[controllerBlocks.actions, uiStore]
|
|
2305
2622
|
);
|
|
2306
2623
|
useEffect(() => {
|
|
2624
|
+
if (entryData) return;
|
|
2307
2625
|
const req = focusRequest;
|
|
2308
2626
|
if (!req?.blockId) return;
|
|
2309
2627
|
blockEditorRef.current?.focusField({
|
|
@@ -2312,7 +2630,7 @@ function PreviewEditorSidebar({
|
|
|
2312
2630
|
itemIndex: req.itemIndex ?? void 0
|
|
2313
2631
|
});
|
|
2314
2632
|
uiStore.getState().clearFocus();
|
|
2315
|
-
}, [focusRequest, uiStore]);
|
|
2633
|
+
}, [entryData, focusRequest, uiStore]);
|
|
2316
2634
|
const metadataSectionContent = useMemo(() => {
|
|
2317
2635
|
if (!pageId && !entryData) return null;
|
|
2318
2636
|
return /* @__PURE__ */ jsx(
|
|
@@ -2360,6 +2678,7 @@ function PreviewEditorSidebar({
|
|
|
2360
2678
|
linkedEntrySection,
|
|
2361
2679
|
mediaAssets,
|
|
2362
2680
|
widgets: contentFormWidgets,
|
|
2681
|
+
sdkConfig: sdkConfig ?? null,
|
|
2363
2682
|
viewportMode,
|
|
2364
2683
|
viewportWidth,
|
|
2365
2684
|
zoom,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolvePreviewChromeSurface, usePreviewPageDesignEditorState, PREVIEW_CHROME_PORTAL_CLASS_NAME, PREVIEW_CHROME_THEME_CLASS_NAME, applyPreviewChromeSurfaceToElement, setPreviewSidebarTab } from './chunk-
|
|
3
|
-
import { useEntryEditorController, useEditorUiStore, useMultiAutosave, usePreviewDesignHistoryOrder, useSiteChromeCustomizeOptional, selectPreviewDesignHistoryDomain, EditorChrome, previewDesignHistoryDomainForCommand, classifyHistoryShortcut, previewAssistantEnabled, unwrapResponse, cn, Dialog, Button, Palette, DialogContent, DialogHeader, DialogTitle, DialogDescription, TriangleAlert, Pencil, Sparkles, useEditorUiStoreInstance } from './chunk-
|
|
4
|
-
import { usePreviewAuth, getDashboardBaseUrl } from './chunk-
|
|
2
|
+
import { resolvePreviewChromeSurface, usePreviewPageDesignEditorState, PREVIEW_CHROME_PORTAL_CLASS_NAME, PREVIEW_CHROME_THEME_CLASS_NAME, applyPreviewChromeSurfaceToElement, setPreviewSidebarTab } from './chunk-RCTJAZSK.mjs';
|
|
3
|
+
import { useEntryEditorController, useEditorUiStore, useMultiAutosave, usePreviewDesignHistoryOrder, useSiteChromeCustomizeOptional, selectPreviewDesignHistoryDomain, EditorChrome, previewDesignHistoryDomainForCommand, classifyHistoryShortcut, previewAssistantEnabled, unwrapResponse, cn, Dialog, Button, Palette, DialogContent, DialogHeader, DialogTitle, DialogDescription, TriangleAlert, Pencil, Sparkles, useEditorUiStoreInstance } from './chunk-O62NDCTI.mjs';
|
|
4
|
+
import { usePreviewAuth, getDashboardBaseUrl } from './chunk-LBBPD2IW.mjs';
|
|
5
5
|
import './chunk-R7POPVJR.mjs';
|
|
6
6
|
import { useState, useMemo, useCallback, useEffect, useTransition } from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { SdkPreviewModeRuntime } from './chunk-QRKJDWT7.mjs';
|
|
3
|
+
import './chunk-3LXFQS7T.mjs';
|
|
4
|
+
import './chunk-X5ZCSU6F.mjs';
|
|
5
|
+
import './chunk-RCTJAZSK.mjs';
|
|
6
|
+
import './chunk-O62NDCTI.mjs';
|
|
7
|
+
import './chunk-LBBPD2IW.mjs';
|
|
8
|
+
import './chunk-R7POPVJR.mjs';
|