@riverbankcms/sdk 0.103.0 → 0.104.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/dist/{PreviewEditorSidebar-DkNpCPja.mjs → PreviewEditorSidebar-CmaPXdKu.mjs} +148 -128
- package/dist/{PreviewEditorUI-DeNKtqk3.mjs → PreviewEditorUI-C5xRTh2b.mjs} +3 -3
- package/dist/{PreviewQueryProvider-ZF6TXq5Q.mjs → PreviewQueryProvider-CStABBUh.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-5bCsXK2y.mjs → SdkPreviewModeRuntime-Eks51NcN.mjs} +1204 -566
- package/dist/{SiteChromeCustomizeContext-CO1sTK_W.mjs → SiteChromeCustomizeContext-Bt8zb3qu.mjs} +5330 -4533
- package/dist/_dts/api/src/bookingVerticals.d.ts +64 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +6 -3
- package/dist/_dts/api/src/endpoints.d.ts +10 -3
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/siteIcons.d.ts +39 -43
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +36 -7
- package/dist/_dts/block-form/src/widgets/SliderField/SliderField.d.ts +3 -3
- package/dist/_dts/block-form/src/widgets/SliderField/sliderValue.d.ts +36 -0
- package/dist/_dts/block-form/src/widgets/utils/readNumericUiConfig.d.ts +3 -0
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/feature-card-icons.d.ts +29 -29
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +135 -0
- package/dist/_dts/blocks/src/system/icons/generatedAssets.d.ts +28 -0
- package/dist/_dts/blocks/src/system/icons/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/icons/value.d.ts +3 -6
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +240 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/feature-card-icon.d.ts +1 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +2 -0
- package/dist/_dts/content-editor/src/ui/stores/generatedIconAssetsStore.d.ts +9 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +208 -0
- package/dist/_dts/editor/src/index.d.ts +3 -1
- package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +14 -6
- package/dist/_dts/editor/src/primitives/rich-text/RichTextToolbar.d.ts +23 -4
- package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +6 -0
- package/dist/_dts/editor/src/primitives/rich-text/extensions/RichTextLink.d.ts +1 -0
- package/dist/_dts/editor/src/primitives/rich-text/paste.d.ts +10 -0
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +7 -0
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardBody.d.ts +2 -3
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/block-editor/FeatureCardIconsPanel.d.ts +4 -4
- package/dist/_dts/editor-blocks/src/block-editor/GeneratedIconSetDialog.d.ts +3 -3
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +2 -3
- package/dist/_dts/editor-blocks/src/block-editor/blockHeaderActionPlan.d.ts +1 -5
- package/dist/_dts/editor-blocks/src/block-editor/featureCardIconActions.d.ts +25 -19
- package/dist/_dts/editor-blocks/src/block-editor/generatedIconApplyCoordination.d.ts +32 -0
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/GeneratedIconLibraryContext.d.ts +28 -0
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/index.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/icon-picker/loaders.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/preview/CustomizeBackgroundControlRows.d.ts +15 -0
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +4 -3
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +4 -3
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +4 -3
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -4
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +5 -4
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +44 -18
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +4 -5
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +22 -1
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +12 -4
- package/dist/_dts/sdk/src/client/management/types.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +0 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -2
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -9
- package/dist/_dts/theme-core/src/navigation/types.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/colors.d.ts +84 -0
- package/dist/_dts/theme-core/src/palette/{variants → curated}/brand-led.d.ts +12 -24
- package/dist/_dts/theme-core/src/palette/{variants → curated}/high-contrast.d.ts +9 -18
- package/dist/_dts/theme-core/src/palette/{variants → curated}/index.d.ts +67 -119
- package/dist/_dts/theme-core/src/palette/{variants → curated}/soft-natural.d.ts +12 -24
- package/dist/_dts/theme-core/src/palette/{variants → curated}/types.d.ts +50 -60
- package/dist/_dts/theme-core/src/palette/{variants → curated}/warm-dark.d.ts +6 -12
- package/dist/_dts/theme-core/src/palette/{variants → curated}/warm-neutral.d.ts +12 -24
- package/dist/_dts/theme-core/src/palette/editorState.d.ts +45 -0
- package/dist/_dts/theme-core/src/palette/index.d.ts +25 -14
- package/dist/_dts/theme-core/src/palette/legacyRuntimeProjection.d.ts +55 -0
- package/dist/_dts/theme-core/src/palette/legacySelection.d.ts +34 -0
- package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +58 -0
- package/dist/_dts/theme-core/src/palette/paletteCompatibilityTransition.d.ts +232 -0
- package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +118 -0
- package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +50 -0
- package/dist/_dts/theme-core/src/palette/selection.d.ts +72 -0
- package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +34 -0
- package/dist/_dts/theme-core/src/palette/themePaletteCompatibility.d.ts +58 -0
- package/dist/_dts/theme-core/src/schema.d.ts +9 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +22 -22
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +31 -9
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +22 -16
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +6 -5
- package/dist/_dts/theme-core/src/site-styles/themeParity.d.ts +21 -0
- package/dist/_dts/ui/src/palette/PaletteTokenEditor.d.ts +2 -1
- package/dist/cli/index.mjs +7805 -7449
- package/dist/client/{DiscountCodeDisclosure-ChVZwVtS.mjs → DiscountCodeDisclosure-Dit2aItR.mjs} +1 -1
- package/dist/client/{EventCombined.client-PZtXbH6R.mjs → EventCombined.client-BnREyCjf.mjs} +3 -3
- package/dist/client/{EventListing.client-C4AMTXec.mjs → EventListing.client-0uHld51x.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-B0w8_i0u.mjs → LeafletStaticMap-DJcvSfmj.mjs} +1 -1
- package/dist/client/{MagicLinkForm-DF0ZGhIu.mjs → MagicLinkForm-EAsIktfw.mjs} +2 -2
- package/dist/client/{StepIndicator-PccQ89Ct.mjs → StepIndicator-CRR17tYI.mjs} +2 -2
- package/dist/client/{accordion-CTNWT1lk.mjs → accordion-B47HIuuH.mjs} +1 -1
- package/dist/client/{bookingForm-DYixwPqP.mjs → bookingForm-I1E-8F9P.mjs} +6 -6
- package/dist/client/{buttons-CySQwlFs.mjs → buttons-BbPn8OKA.mjs} +1 -1
- package/dist/client/{carousel-W75iYR0M.mjs → carousel-OlM7SyBs.mjs} +1 -1
- package/dist/client/{cart-Ca_DGWQq.mjs → cart-BKpG5jz6.mjs} +3 -3
- package/dist/client/{checkout-STgKTsNh.mjs → checkout-Dmmr6qoU.mjs} +3 -3
- package/dist/client/client.mjs +8706 -8320
- package/dist/client/{courseRegistration-DQI1cu1u.mjs → courseRegistration-CflZiqGk.mjs} +7 -7
- package/dist/client/{eventCalendar-BJrHpofg.mjs → eventCalendar-BvoLWcp-.mjs} +5 -5
- package/dist/client/{eventCombined-DPtqBHaH.mjs → eventCombined-DsrO8t_t.mjs} +2 -2
- package/dist/client/{eventDetails-Brt31CDo.mjs → eventDetails-C3hxgcJm.mjs} +3 -3
- package/dist/client/{eventListing-BrClHJOq.mjs → eventListing-C-hb237X.mjs} +2 -2
- package/dist/client/{eventRegistration-DxlNlVUC.mjs → eventRegistration-B0gyzDGi.mjs} +7 -7
- package/dist/client/{form-Vp5cGzDF.mjs → form-C_RUi6oJ.mjs} +2 -2
- package/dist/client/{headerSection-DL2xjRgW.mjs → headerSection-IKQiD2U0.mjs} +3 -3
- package/dist/client/hooks.mjs +4845 -4663
- package/dist/client/{locationMap-B0EjoXQS.mjs → locationMap-8ZBrMzRJ.mjs} +2 -2
- package/dist/client/{newsletterForm-BlV9VRlq.mjs → newsletterForm-CYk3ucwj.mjs} +2 -2
- package/dist/client/{pricing-DmRD7Tjx.mjs → pricing-B5GmvfIH.mjs} +1 -1
- package/dist/client/{productDetail-BLTQsY2f.mjs → productDetail-BjS2Dqzo.mjs} +3 -3
- package/dist/client/{productList-R8lsMpRs.mjs → productList-BOHvC8My.mjs} +3 -3
- package/dist/client/{propsDecoder-DgAshF92.mjs → propsDecoder-WS6UEJwZ.mjs} +7 -0
- package/dist/client/rendering/client.mjs +3606 -3281
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +8569 -8190
- package/dist/client/{shop-DWjyje1s.mjs → shop-CON03-wN.mjs} +6 -6
- package/dist/client/{shop-commerce-CSKCR87d.mjs → shop-commerce-DlqrFgH8.mjs} +5 -5
- package/dist/client/{shop-commerce-store-DxPnE-iN.mjs → shop-commerce-store-l74-Kne6.mjs} +1 -1
- package/dist/client/{shopShared-OOeAkFq7.mjs → shopShared-CQheEXSg.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-Bp6X7XgG.mjs → useDiscountCodeUi-v6OluyWl.mjs} +1 -1
- package/dist/client/{useEventFilters-B489x9TO.mjs → useEventFilters-BqSTcNOf.mjs} +3 -3
- package/dist/client/{usePolling-BKP66stL.mjs → usePolling-DMfADjIF.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +10 -3
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +10 -3
- package/dist/{previewAuthStore-ByPPZqmp.mjs → previewAuthStore-CfquDtTh.mjs} +10 -3
- package/dist/{sdk-runtime-C8whifOy.mjs → sdk-runtime-BUmJ0DaT.mjs} +2 -2
- package/dist/{separator-CM2C5Axs.mjs → separator-Dd-JYok7.mjs} +1 -1
- package/dist/server/components.mjs +9871 -9557
- package/dist/server/config-validation.mjs +4869 -4687
- package/dist/server/config.mjs +4869 -4687
- package/dist/server/data.mjs +4846 -4664
- package/dist/server/index.mjs +11 -4
- package/dist/server/next.mjs +8665 -8344
- package/dist/server/page-converter.mjs +4749 -4575
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +9816 -9586
- package/dist/server/rendering.mjs +9880 -9566
- package/dist/server/routing.mjs +4975 -4704
- package/dist/server/server.mjs +4819 -4630
- package/dist/server/theme-bridge.mjs +207 -114
- package/dist/server/theme.mjs +92 -91
- package/dist/styles/index.css +20 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as
|
|
3
|
-
import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-
|
|
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-
|
|
5
|
-
import { t as Separator } from "./separator-
|
|
2
|
+
import { $i as getFooterLayout, A as openRow, Ai as getCuratedSiteStyle, Al as Input, B as setPaletteColors, Bc as buttonPersonalities, Bt as ManifestForm, C as createStyleConfiguratorState, Cl as SelectTrigger, D as markApplyFailed, Dl as Popover, E as isPreviewingChange, Eu as Button, F as previewHeaderLayout, Fd as Maximize2, Gt as createStoreBackend, H as syncStyleConfiguratorState, Ht as createManifestValidation, I as previewHeaderStyle, Id as LoaderCircle, Ji as evaluateTypographyFontSlot, Jl as CollapsibleContent, L as previewSiteStyle, M as previewButtonPersonality, Ml as TabsContent, Mt as deriveRouteMetadataPresentation, N as previewCuratedPalette, Nd as Monitor, Nl as TabsList, Nt as resolvePageRouteSlug, O as markApplySaved, Oi as curatedSiteStyles, Ol as PopoverContent, P as previewFooterLook, Pl as TabsTrigger, Pt as resolveContentTitle, Pu as unsafeAsEditorBlockId, Q as resolvePreviewSidebarTab, Qi as findFooterLook, R as previewTypographyPreset, S as cancelPreview, Sl as SelectItem, T as dismissWarnings, U as toggleRow, Ut as FormRenderer, V as styleConfiguratorHistoryEntryForPersistedSelection, Vc as findButtonPersonality, W as typographySelectionSnapshotFromFlat, Xi as typographyPresets, Yi as findTypographyPreset, Yl as CollapsibleTrigger, Z as createOptimisticActionRunner, Zi as requireEntriesForCuratedChoices, _ as usePreviewDesignCoordinator, _a as paletteColorsSchema, _t as useEditorUiStore, au as DropdownMenu, b as applyResolvedSelections, bl as Select, c as selectionSnapshotFromApplySiteStyleSelectionResponse, cf as ChevronLeft, cu as DropdownMenuLabel, d as buildSiteChromeLookModels, dt as useUISelector, ea as getHeaderLayout, ed as assertNever$1, en as listEntryPageContentSlots, f as cycleSiteChromeLookId, ga as paletteColorsEqual, h as planSiteChromeLookSelection, ha as paletteColorEntries, hd as X$1, iu as Surface, j as paletteMutationCapability, jl as Tabs, k as markApplySaving, kl as PopoverTrigger, ku as cn, l as planSiteStylePreviewChange, lu as DropdownMenuSeparator, m as planSiteChromeFooterLayoutSelection, ma as findCuratedPalette, mt as useEntryController, n as useSiteChromeCustomizeOptional, ou as DropdownMenuContent, p as cycleableSiteChromeOptions, pa as curatedPalettes, ql as Collapsible, s as buildApplySiteStyleSelectionBody, sf as ChevronRight, su as DropdownMenuItem, ta as getHeaderStyle, u as resolveStyleConfiguratorInitialSnapshot, ut as ContentFieldsForm, uu as DropdownMenuTrigger, vt as useEditorUiStoreInstance, w as deriveStyleConfiguratorCapabilities, wd as Smartphone, wl as SelectValue, x as applyTypographyDraftPatch, xd as Tablet, xl as SelectContent, z as resetTypographyToSaved } from "./SiteChromeCustomizeContext-Bt8zb3qu.mjs";
|
|
3
|
+
import { d as unwrapResponse, f as getDashboardUrl, r as usePreviewAuth } from "./previewAuthStore-CfquDtTh.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-Eks51NcN.mjs";
|
|
5
|
+
import { t as Separator } from "./separator-Dd-JYok7.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";
|
|
@@ -1112,7 +1112,7 @@ function updateBlocksWithSavedContent(blocks, blockId, content) {
|
|
|
1112
1112
|
function getErrorMessage(error) {
|
|
1113
1113
|
return error instanceof Error ? error.message : "Unable to load Page Content.";
|
|
1114
1114
|
}
|
|
1115
|
-
function EntrySlotBlockEditorPanel({ siteId, typeKey, entryId, theme = null, apiClient, bearerToken, supabaseUrl, sdkConfig = null, mediaAssets, widgets }) {
|
|
1115
|
+
function EntrySlotBlockEditorPanel({ siteId, dashboardBaseUrl, typeKey, entryId, theme = null, apiClient, bearerToken, supabaseUrl, sdkConfig = null, mediaAssets, widgets }) {
|
|
1116
1116
|
const router = useRouter();
|
|
1117
1117
|
const queryClient = useQueryClient();
|
|
1118
1118
|
const uiStore = useEditorUiStoreInstance();
|
|
@@ -1218,6 +1218,7 @@ function EntrySlotBlockEditorPanel({ siteId, typeKey, entryId, theme = null, api
|
|
|
1218
1218
|
children: /* @__PURE__ */ jsx(BlockEditor, {
|
|
1219
1219
|
ref: handleBlockEditorRef,
|
|
1220
1220
|
siteId,
|
|
1221
|
+
dashboardBaseUrl,
|
|
1221
1222
|
owner: {
|
|
1222
1223
|
kind: "entry-slot",
|
|
1223
1224
|
type: typeKey,
|
|
@@ -1276,7 +1277,7 @@ function EntrySlotBlockEditorPanel({ siteId, typeKey, entryId, theme = null, api
|
|
|
1276
1277
|
}
|
|
1277
1278
|
//#endregion
|
|
1278
1279
|
//#region ../preview-next/src/client/preview/EntryEditorPanel.tsx
|
|
1279
|
-
function EntryEditorPanel({ siteId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, metadataPanel, linkedEntrySection, mediaAssets, widgets, sdkConfig, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
|
|
1280
|
+
function EntryEditorPanel({ siteId, dashboardBaseUrl, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, metadataPanel, linkedEntrySection, mediaAssets, widgets, sdkConfig, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
|
|
1280
1281
|
const [contentOpen, setContentOpen] = useState(true);
|
|
1281
1282
|
const [pageContentOpen, setPageContentOpen] = useState(false);
|
|
1282
1283
|
const [templateOpen, setTemplateOpen] = useState(false);
|
|
@@ -1378,6 +1379,7 @@ function EntryEditorPanel({ siteId, entryData, contentTypeSchema, referenceConte
|
|
|
1378
1379
|
"data-testid": "entry-page-content-editor",
|
|
1379
1380
|
children: /* @__PURE__ */ jsx(EntrySlotBlockEditorPanel, {
|
|
1380
1381
|
siteId,
|
|
1382
|
+
dashboardBaseUrl,
|
|
1381
1383
|
typeKey: entryData.type,
|
|
1382
1384
|
entryId: entryData.id,
|
|
1383
1385
|
theme,
|
|
@@ -1562,7 +1564,7 @@ function formatBlockKindLabel(blockKind) {
|
|
|
1562
1564
|
}
|
|
1563
1565
|
//#endregion
|
|
1564
1566
|
//#region ../preview-next/src/client/preview/PageBlockEditorPanel.tsx
|
|
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 }) {
|
|
1567
|
+
function PageBlockEditorPanel({ siteId, pageId, dashboardBaseUrl, theme, apiClient, bearerToken, supabaseUrl, blockItems, uiStoreForBlockEditor, blockEditorRef, onBlocksChange, metadataPanel, linkedEntrySection, designPanel, designOpenRequestId = null, sdkConfig, mediaAssets, bookingOfferingPresets, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
|
|
1566
1568
|
const customizeSelection = usePreviewBlockCustomizeSelectionOptional();
|
|
1567
1569
|
const [designOpen, setDesignOpen] = useState(false);
|
|
1568
1570
|
const [customizeOpen, setCustomizeOpen] = useState(false);
|
|
@@ -1698,6 +1700,7 @@ function PageBlockEditorPanel({ siteId, pageId, theme, apiClient, bearerToken, s
|
|
|
1698
1700
|
children: /* @__PURE__ */ jsx(BlockEditor, {
|
|
1699
1701
|
ref: blockEditorRef,
|
|
1700
1702
|
siteId,
|
|
1703
|
+
dashboardBaseUrl,
|
|
1701
1704
|
owner: {
|
|
1702
1705
|
kind: "page",
|
|
1703
1706
|
pageId
|
|
@@ -1877,7 +1880,7 @@ const DEFAULT_SURFACE_ROLES = [
|
|
|
1877
1880
|
* - LiveThemeEditor's palette tab (via a thin context wrapper)
|
|
1878
1881
|
* - Style configurator's brand-colours row
|
|
1879
1882
|
*/
|
|
1880
|
-
function PaletteTokenEditor({ palette, onChange, hasInvalidValues = false, brandRoles = DEFAULT_BRAND_ROLES, feedbackRoles = DEFAULT_FEEDBACK_ROLES, surfaceRoles = DEFAULT_SURFACE_ROLES, showContrastChecks = true, className }) {
|
|
1883
|
+
function PaletteTokenEditor({ palette, onChange, hasInvalidValues = false, brandRoles = DEFAULT_BRAND_ROLES, feedbackRoles = DEFAULT_FEEDBACK_ROLES, surfaceRoles = DEFAULT_SURFACE_ROLES, showContrastChecks = true, disabled = false, className }) {
|
|
1881
1884
|
const paletteValues = useMemo(() => {
|
|
1882
1885
|
const map = /* @__PURE__ */ new Map();
|
|
1883
1886
|
for (const entry of palette) if (entry?.name) map.set(entry.name, normalizeHex(entry.hex));
|
|
@@ -1909,19 +1912,22 @@ function PaletteTokenEditor({ palette, onChange, hasInvalidValues = false, brand
|
|
|
1909
1912
|
title: "Brand & accents",
|
|
1910
1913
|
roles: brandRoles,
|
|
1911
1914
|
getColor,
|
|
1912
|
-
onChange: handleRoleChange
|
|
1915
|
+
onChange: handleRoleChange,
|
|
1916
|
+
disabled
|
|
1913
1917
|
}),
|
|
1914
1918
|
/* @__PURE__ */ jsx(ColorRoleGroup, {
|
|
1915
1919
|
title: "Feedback",
|
|
1916
1920
|
roles: feedbackRoles,
|
|
1917
1921
|
getColor,
|
|
1918
|
-
onChange: handleRoleChange
|
|
1922
|
+
onChange: handleRoleChange,
|
|
1923
|
+
disabled
|
|
1919
1924
|
}),
|
|
1920
1925
|
/* @__PURE__ */ jsx(ColorRoleGroup, {
|
|
1921
1926
|
title: "Surfaces & text",
|
|
1922
1927
|
roles: surfaceRoles,
|
|
1923
1928
|
getColor,
|
|
1924
|
-
onChange: handleRoleChange
|
|
1929
|
+
onChange: handleRoleChange,
|
|
1930
|
+
disabled
|
|
1925
1931
|
}),
|
|
1926
1932
|
showContrastChecks ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs("div", {
|
|
1927
1933
|
className: "grid gap-4 md:grid-cols-2",
|
|
@@ -1951,7 +1957,7 @@ function isPlausibleHexInput(value) {
|
|
|
1951
1957
|
const trimmed = value.trim();
|
|
1952
1958
|
return /^#?[0-9a-fA-F]{3}$/.test(trimmed) || /^#?[0-9a-fA-F]{6}$/.test(trimmed);
|
|
1953
1959
|
}
|
|
1954
|
-
function ColorRoleGroup({ title, roles, getColor, onChange }) {
|
|
1960
|
+
function ColorRoleGroup({ title, roles, getColor, onChange, disabled }) {
|
|
1955
1961
|
if (roles.length === 0) return null;
|
|
1956
1962
|
return /* @__PURE__ */ jsxs("div", {
|
|
1957
1963
|
className: "space-y-3",
|
|
@@ -1966,12 +1972,13 @@ function ColorRoleGroup({ title, roles, getColor, onChange }) {
|
|
|
1966
1972
|
children: roles.map((role) => /* @__PURE__ */ jsx(ColorRoleField, {
|
|
1967
1973
|
role,
|
|
1968
1974
|
value: getColor(role.key),
|
|
1969
|
-
onChange
|
|
1975
|
+
onChange,
|
|
1976
|
+
disabled
|
|
1970
1977
|
}, role.key))
|
|
1971
1978
|
})]
|
|
1972
1979
|
});
|
|
1973
1980
|
}
|
|
1974
|
-
function ColorRoleField({ role, value, onChange }) {
|
|
1981
|
+
function ColorRoleField({ role, value, onChange, disabled }) {
|
|
1975
1982
|
const inputId = useId();
|
|
1976
1983
|
const colorPickerLabel = `${role.label} colour picker`;
|
|
1977
1984
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1984,18 +1991,20 @@ function ColorRoleField({ role, value, onChange }) {
|
|
|
1984
1991
|
}),
|
|
1985
1992
|
/* @__PURE__ */ jsx(ColorPicker, {
|
|
1986
1993
|
value,
|
|
1987
|
-
onChange: (
|
|
1994
|
+
onChange: (next) => {
|
|
1988
1995
|
if (typeof next === "string") onChange(role.key, next);
|
|
1989
|
-
}
|
|
1996
|
+
},
|
|
1990
1997
|
className: "w-full",
|
|
1991
|
-
"aria-label": colorPickerLabel
|
|
1998
|
+
"aria-label": colorPickerLabel,
|
|
1999
|
+
disabled
|
|
1992
2000
|
}),
|
|
1993
2001
|
/* @__PURE__ */ jsx(Input, {
|
|
1994
2002
|
id: inputId,
|
|
1995
2003
|
value,
|
|
1996
2004
|
onChange: (event) => onChange(role.key, event.target.value),
|
|
1997
2005
|
className: "font-mono text-xs uppercase",
|
|
1998
|
-
placeholder: "#000000"
|
|
2006
|
+
placeholder: "#000000",
|
|
2007
|
+
disabled
|
|
1999
2008
|
})
|
|
2000
2009
|
]
|
|
2001
2010
|
});
|
|
@@ -2273,7 +2282,13 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2273
2282
|
});
|
|
2274
2283
|
}, [footerSelectionContext, headerSelectionContext]);
|
|
2275
2284
|
const handlePreviewPalette = useCallback((id) => {
|
|
2276
|
-
|
|
2285
|
+
const curated = findCuratedPalette(id);
|
|
2286
|
+
if (!curated) return;
|
|
2287
|
+
setState((current) => current ? previewCuratedPalette(current, {
|
|
2288
|
+
paletteId: curated.id,
|
|
2289
|
+
colors: curated.colors,
|
|
2290
|
+
mode: curated.mode
|
|
2291
|
+
}) : current);
|
|
2277
2292
|
}, []);
|
|
2278
2293
|
const handlePreviewTypographyPreset = useCallback((id) => {
|
|
2279
2294
|
setState((current) => current ? previewTypographyPreset(current, id) : current);
|
|
@@ -2320,17 +2335,22 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2320
2335
|
const handleTokenOverride = useCallback((role, hex) => {
|
|
2321
2336
|
setState((current) => {
|
|
2322
2337
|
if (!current) return current;
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2338
|
+
const palette = current.previewed.palette;
|
|
2339
|
+
if (palette.kind === "invalid") return current;
|
|
2340
|
+
if (!(role in palette.colors)) return current;
|
|
2341
|
+
const nextColors = paletteColorsSchema.safeParse({
|
|
2342
|
+
...palette.colors,
|
|
2325
2343
|
[role]: hex
|
|
2326
|
-
};
|
|
2327
|
-
|
|
2328
|
-
if (!parsed.success) return current;
|
|
2329
|
-
return setPaletteOverrides(current, parsed.data);
|
|
2344
|
+
});
|
|
2345
|
+
return nextColors.success ? setPaletteColors(current, nextColors.data) : current;
|
|
2330
2346
|
});
|
|
2331
2347
|
}, []);
|
|
2332
2348
|
const handleResetOverrides = useCallback(() => {
|
|
2333
|
-
setState((current) =>
|
|
2349
|
+
setState((current) => {
|
|
2350
|
+
if (!current || current.previewed.palette.kind !== "migrated-curated") return current;
|
|
2351
|
+
const curated = findCuratedPalette(current.previewed.palette.paletteId);
|
|
2352
|
+
return curated ? setPaletteColors(current, curated.colors) : current;
|
|
2353
|
+
});
|
|
2334
2354
|
}, []);
|
|
2335
2355
|
const handleToggleRow = useCallback((row) => {
|
|
2336
2356
|
setState((current) => current ? toggleRow(current, row) : current);
|
|
@@ -2341,9 +2361,6 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2341
2361
|
const handleDismissWarnings = useCallback(() => {
|
|
2342
2362
|
setState((current) => current ? dismissWarnings(current) : current);
|
|
2343
2363
|
}, []);
|
|
2344
|
-
const handleDismissNotices = useCallback(() => {
|
|
2345
|
-
setState((current) => current ? dismissNotices(current) : current);
|
|
2346
|
-
}, []);
|
|
2347
2364
|
const handleApply = useCallback(async () => {
|
|
2348
2365
|
const live = stateRef.current;
|
|
2349
2366
|
if (!live || !isPreviewingChange(live)) return;
|
|
@@ -2358,32 +2375,32 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2358
2375
|
headerSelectionContext,
|
|
2359
2376
|
footerSelectionContext
|
|
2360
2377
|
});
|
|
2361
|
-
const body = buildApplySiteStyleSelectionBody({
|
|
2362
|
-
base: live.base,
|
|
2363
|
-
previewed: {
|
|
2364
|
-
...previewed,
|
|
2365
|
-
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
2366
|
-
paletteVariantId: compiled.resolvedSelections.paletteVariantId,
|
|
2367
|
-
headerLayoutId: compiled.resolvedSelections.headerLayoutId,
|
|
2368
|
-
headerStyleId: compiled.resolvedSelections.headerStyleId,
|
|
2369
|
-
headerLookId: compiled.resolvedSelections.headerLookId,
|
|
2370
|
-
typographySelection: compiled.resolvedSelections.typographySelection.kind === "custom" ? {
|
|
2371
|
-
kind: "custom",
|
|
2372
|
-
typography: compiled.themeOverlay.typography
|
|
2373
|
-
} : typographySelectionSnapshotFromFlat(compiled.resolvedSelections)
|
|
2374
|
-
},
|
|
2375
|
-
selectionId
|
|
2376
|
-
});
|
|
2377
2378
|
await runnerRef.current.run({
|
|
2378
2379
|
optimistic: () => {
|
|
2379
2380
|
applyStarted("style-configurator");
|
|
2380
2381
|
setState((current) => current ? markApplySaving(current) : current);
|
|
2381
2382
|
},
|
|
2382
2383
|
network: async () => {
|
|
2384
|
+
const body = buildApplySiteStyleSelectionBody({
|
|
2385
|
+
base: live.base,
|
|
2386
|
+
previewed: {
|
|
2387
|
+
...previewed,
|
|
2388
|
+
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
2389
|
+
headerLayoutId: compiled.resolvedSelections.headerLayoutId,
|
|
2390
|
+
headerStyleId: compiled.resolvedSelections.headerStyleId,
|
|
2391
|
+
headerLookId: compiled.resolvedSelections.headerLookId,
|
|
2392
|
+
typographySelection: compiled.resolvedSelections.typographySelection.kind === "custom" ? {
|
|
2393
|
+
kind: "custom",
|
|
2394
|
+
typography: compiled.themeOverlay.typography
|
|
2395
|
+
} : typographySelectionSnapshotFromFlat(compiled.resolvedSelections)
|
|
2396
|
+
},
|
|
2397
|
+
selectionId
|
|
2398
|
+
});
|
|
2399
|
+
if (!body.ok) throw new Error(paletteApplyPlanErrorMessage(body.error));
|
|
2383
2400
|
return unwrapResponse(await apiClient({
|
|
2384
2401
|
endpoint: "applySiteStyleSelection",
|
|
2385
2402
|
params: { siteId },
|
|
2386
|
-
body
|
|
2403
|
+
body: body.body
|
|
2387
2404
|
}));
|
|
2388
2405
|
},
|
|
2389
2406
|
onSuccess: (saved) => {
|
|
@@ -2428,13 +2445,17 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2428
2445
|
const stagedCapabilities = deriveStyleConfiguratorCapabilities(state);
|
|
2429
2446
|
const previewingChange = isPreviewingChange(state);
|
|
2430
2447
|
const saving = stagedCapabilities.isApplyingStaged || isRefreshPending;
|
|
2448
|
+
const aggregateMutationControlsDisabled = saving || !stagedCapabilities.canPreviewStaged;
|
|
2431
2449
|
const currentSiteStyle = getCuratedSiteStyle(state.previewed.siteStyleId);
|
|
2432
2450
|
if (!currentSiteStyle) return /* @__PURE__ */ jsx("p", {
|
|
2433
2451
|
className: "text-sm text-muted-foreground",
|
|
2434
2452
|
children: "This site uses a Site Style that cannot be configured here."
|
|
2435
2453
|
});
|
|
2436
2454
|
const currentPersonality = findButtonPersonality(state.previewed.buttonPersonalityId);
|
|
2437
|
-
const
|
|
2455
|
+
const currentPalette = state.previewed.palette;
|
|
2456
|
+
const paletteMutation = paletteMutationCapability(state);
|
|
2457
|
+
const paletteControlsDisabled = saving || paletteMutation.kind !== "editable";
|
|
2458
|
+
const currentCuratedPalette = currentPalette.kind === "migrated-curated" ? findCuratedPalette(currentPalette.paletteId) : null;
|
|
2438
2459
|
const currentTypographyPreset = state.previewed.typographySelection.kind === "preset" && state.previewed.typographySelection.presetId ? findTypographyPreset(state.previewed.typographySelection.presetId) : null;
|
|
2439
2460
|
const currentTypography = planSiteStylePreviewChange({
|
|
2440
2461
|
siteStyle: currentSiteStyle,
|
|
@@ -2461,16 +2482,12 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2461
2482
|
warnings: state.warnings,
|
|
2462
2483
|
onDismiss: handleDismissWarnings
|
|
2463
2484
|
}) : null,
|
|
2464
|
-
state.notices.length > 0 ? /* @__PURE__ */ jsx(NoticeBanner, {
|
|
2465
|
-
notices: state.notices,
|
|
2466
|
-
onDismiss: handleDismissNotices
|
|
2467
|
-
}) : null,
|
|
2468
2485
|
/* @__PURE__ */ jsx(SiteStyleRow, {
|
|
2469
2486
|
expanded: state.expandedRow === "style",
|
|
2470
2487
|
onToggle: () => handleToggleRow("style"),
|
|
2471
2488
|
current: currentSiteStyle,
|
|
2472
2489
|
onPreview: handlePreviewSiteStyle,
|
|
2473
|
-
disabled:
|
|
2490
|
+
disabled: aggregateMutationControlsDisabled
|
|
2474
2491
|
}),
|
|
2475
2492
|
/* @__PURE__ */ jsx(SiteChromeLookRow, {
|
|
2476
2493
|
label: "Header layout",
|
|
@@ -2488,7 +2505,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2488
2505
|
if (next !== void 0) handlePreviewHeaderLayout(next);
|
|
2489
2506
|
},
|
|
2490
2507
|
onPreview: handlePreviewHeaderLayout,
|
|
2491
|
-
disabled:
|
|
2508
|
+
disabled: aggregateMutationControlsDisabled
|
|
2492
2509
|
}),
|
|
2493
2510
|
/* @__PURE__ */ jsx(SiteChromeLookRow, {
|
|
2494
2511
|
label: "Header look",
|
|
@@ -2506,7 +2523,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2506
2523
|
if (next !== void 0) handlePreviewHeaderStyle(next);
|
|
2507
2524
|
},
|
|
2508
2525
|
onPreview: handlePreviewHeaderStyle,
|
|
2509
|
-
disabled:
|
|
2526
|
+
disabled: aggregateMutationControlsDisabled,
|
|
2510
2527
|
extraControls: isHeaderMenuSurfaceState(headerSurfaceState) ? /* @__PURE__ */ jsx(HeaderMenuControls, {
|
|
2511
2528
|
state: headerSurfaceState,
|
|
2512
2529
|
disabled: saving,
|
|
@@ -2530,7 +2547,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2530
2547
|
if (next !== void 0) handlePreviewFooterLayout(next);
|
|
2531
2548
|
},
|
|
2532
2549
|
onPreview: handlePreviewFooterLayout,
|
|
2533
|
-
disabled:
|
|
2550
|
+
disabled: aggregateMutationControlsDisabled
|
|
2534
2551
|
}),
|
|
2535
2552
|
/* @__PURE__ */ jsx(SiteChromeLookRow, {
|
|
2536
2553
|
label: "Footer look",
|
|
@@ -2548,7 +2565,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2548
2565
|
if (next !== void 0) handlePreviewFooterLook(next);
|
|
2549
2566
|
},
|
|
2550
2567
|
onPreview: handlePreviewFooterLook,
|
|
2551
|
-
disabled:
|
|
2568
|
+
disabled: aggregateMutationControlsDisabled
|
|
2552
2569
|
}),
|
|
2553
2570
|
/* @__PURE__ */ jsx(PersonalityRow, {
|
|
2554
2571
|
expanded: state.expandedRow === "buttons",
|
|
@@ -2557,7 +2574,7 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2557
2574
|
currentId: state.previewed.buttonPersonalityId,
|
|
2558
2575
|
currentLabel: currentPersonality?.name ?? state.previewed.buttonPersonalityId,
|
|
2559
2576
|
onPreview: handlePreviewPersonality,
|
|
2560
|
-
disabled:
|
|
2577
|
+
disabled: aggregateMutationControlsDisabled
|
|
2561
2578
|
}),
|
|
2562
2579
|
/* @__PURE__ */ jsx(TypographyRow, {
|
|
2563
2580
|
expanded: state.expandedRow === "typography",
|
|
@@ -2572,26 +2589,28 @@ function StyleConfigurator({ siteId, apiClient, theme, selectionId, selectionVer
|
|
|
2572
2589
|
onBodyChange: handleBodyTypographyChange,
|
|
2573
2590
|
onScaleChange: handleTypographyScaleChange,
|
|
2574
2591
|
onReset: handleResetTypography,
|
|
2575
|
-
disabled:
|
|
2592
|
+
disabled: aggregateMutationControlsDisabled
|
|
2576
2593
|
}),
|
|
2577
2594
|
/* @__PURE__ */ jsx(PaletteRow, {
|
|
2578
2595
|
expanded: state.expandedRow === "palette",
|
|
2579
2596
|
onToggle: () => handleToggleRow("palette"),
|
|
2580
2597
|
siteStyle: currentSiteStyle,
|
|
2581
|
-
currentId:
|
|
2582
|
-
currentLabel:
|
|
2583
|
-
currentSwatch:
|
|
2598
|
+
currentId: currentCuratedPalette?.id ?? null,
|
|
2599
|
+
currentLabel: currentCuratedPalette?.name ?? (currentPalette.kind === "migrated-site" ? "Site palette" : "Custom palette"),
|
|
2600
|
+
currentSwatch: currentCuratedPalette?.colors.primary ?? null,
|
|
2584
2601
|
onPreview: handlePreviewPalette,
|
|
2585
|
-
|
|
2602
|
+
mutationCapability: paletteMutation,
|
|
2603
|
+
disabled: paletteControlsDisabled
|
|
2586
2604
|
}),
|
|
2587
|
-
|
|
2605
|
+
currentPalette.kind !== "invalid" ? /* @__PURE__ */ jsx(ColoursRow, {
|
|
2588
2606
|
expanded: state.expandedRow === "colours",
|
|
2589
2607
|
onToggle: () => handleToggleRow("colours"),
|
|
2590
|
-
|
|
2591
|
-
|
|
2608
|
+
palette: currentPalette.colors,
|
|
2609
|
+
isCustom: !currentCuratedPalette || currentPalette.mode !== currentCuratedPalette.mode || !paletteColorsEqual(currentPalette.colors, currentCuratedPalette.colors),
|
|
2592
2610
|
onTokenChange: handleTokenOverride,
|
|
2593
2611
|
onReset: handleResetOverrides,
|
|
2594
|
-
disabled:
|
|
2612
|
+
disabled: paletteControlsDisabled,
|
|
2613
|
+
mutationCapability: paletteMutation
|
|
2595
2614
|
}) : null,
|
|
2596
2615
|
previewingChange ? /* @__PURE__ */ jsxs("div", {
|
|
2597
2616
|
className: "flex items-center gap-2 pt-2",
|
|
@@ -3398,51 +3417,53 @@ function HeaderMenuControls({ state, disabled, onMenuFontChange, onMenuFontSizeC
|
|
|
3398
3417
|
})]
|
|
3399
3418
|
});
|
|
3400
3419
|
}
|
|
3401
|
-
function PaletteRow({ expanded, onToggle, siteStyle, currentId, currentLabel, currentSwatch, onPreview, disabled }) {
|
|
3420
|
+
function PaletteRow({ expanded, onToggle, siteStyle, currentId, currentLabel, currentSwatch, onPreview, mutationCapability, disabled }) {
|
|
3402
3421
|
const options = useMemo(() => {
|
|
3403
|
-
const recommended = requireEntriesForCuratedChoices(
|
|
3422
|
+
const recommended = requireEntriesForCuratedChoices(curatedPalettes, siteStyle.paletteRecommendations);
|
|
3404
3423
|
if (recommended.some((variant) => variant.id === currentId)) return recommended;
|
|
3405
|
-
const current =
|
|
3424
|
+
const current = currentId ? findCuratedPalette(currentId) : null;
|
|
3406
3425
|
return current ? [current, ...recommended] : recommended;
|
|
3407
|
-
}, [currentId, siteStyle.
|
|
3426
|
+
}, [currentId, siteStyle.paletteRecommendations]);
|
|
3408
3427
|
return /* @__PURE__ */ jsxs(StyleRowFrame, {
|
|
3409
3428
|
label: "Palette",
|
|
3410
3429
|
currentLabel,
|
|
3411
3430
|
swatch: currentSwatch,
|
|
3412
3431
|
expanded,
|
|
3413
3432
|
onToggle,
|
|
3414
|
-
children: [
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
"
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3433
|
+
children: [
|
|
3434
|
+
/* @__PURE__ */ jsx("p", {
|
|
3435
|
+
className: "mb-3 text-xs text-muted-foreground",
|
|
3436
|
+
children: "These palette bases are recommended for the current Site Style. Choose a base here, then edit exact colours in Palette colours."
|
|
3437
|
+
}),
|
|
3438
|
+
mutationCapability.kind === "blocked" && mutationCapability.reason === "invalid-palette" ? /* @__PURE__ */ jsx("div", {
|
|
3439
|
+
role: "status",
|
|
3440
|
+
className: "mb-3 flex items-center justify-between gap-3 rounded-md border border-muted px-3 py-2 text-xs text-muted-foreground",
|
|
3441
|
+
children: /* @__PURE__ */ jsx("span", { children: mutationCapability.message })
|
|
3442
|
+
}) : null,
|
|
3443
|
+
/* @__PURE__ */ jsx("ul", {
|
|
3444
|
+
role: "radiogroup",
|
|
3445
|
+
"aria-label": "Palette",
|
|
3446
|
+
className: "list-none space-y-1 p-0",
|
|
3447
|
+
children: options.map((variant) => {
|
|
3448
|
+
const primaryHex = variant.colors.primary;
|
|
3449
|
+
return /* @__PURE__ */ jsx(PickerOption, {
|
|
3450
|
+
selected: variant.id === currentId,
|
|
3451
|
+
label: variant.name,
|
|
3452
|
+
description: variant.description,
|
|
3453
|
+
swatch: primaryHex,
|
|
3454
|
+
onSelect: () => onPreview(variant.id),
|
|
3455
|
+
disabled
|
|
3456
|
+
}, variant.id);
|
|
3457
|
+
})
|
|
3431
3458
|
})
|
|
3432
|
-
|
|
3459
|
+
]
|
|
3433
3460
|
});
|
|
3434
3461
|
}
|
|
3435
|
-
function ColoursRow({ expanded, onToggle,
|
|
3436
|
-
const mergedPalette = useMemo(() =>
|
|
3437
|
-
return variant.colors.map((color) => ({
|
|
3438
|
-
name: color.name,
|
|
3439
|
-
hex: overrides?.[color.name] ?? color.hex
|
|
3440
|
-
}));
|
|
3441
|
-
}, [variant, overrides]);
|
|
3442
|
-
const overrideCount = overrides ? Object.keys(overrides).length : 0;
|
|
3462
|
+
function ColoursRow({ expanded, onToggle, palette, isCustom, onTokenChange, onReset, mutationCapability, disabled }) {
|
|
3463
|
+
const mergedPalette = useMemo(() => paletteColorEntries(palette), [palette]);
|
|
3443
3464
|
return /* @__PURE__ */ jsx(StyleRowFrame, {
|
|
3444
3465
|
label: "Palette colours",
|
|
3445
|
-
currentLabel:
|
|
3466
|
+
currentLabel: isCustom ? "Custom palette colours" : "Using selected palette",
|
|
3446
3467
|
expanded,
|
|
3447
3468
|
onToggle,
|
|
3448
3469
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -3452,15 +3473,25 @@ function ColoursRow({ expanded, onToggle, variant, overrides, onTokenChange, onR
|
|
|
3452
3473
|
className: "text-xs text-muted-foreground",
|
|
3453
3474
|
children: "Customise the palette tokens used across the site, including backgrounds, surfaces, text and borders."
|
|
3454
3475
|
}),
|
|
3455
|
-
/* @__PURE__ */ jsx(
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3476
|
+
mutationCapability.kind === "blocked" ? /* @__PURE__ */ jsx("div", {
|
|
3477
|
+
role: "status",
|
|
3478
|
+
className: "flex items-center justify-between gap-3 rounded-md border border-muted px-3 py-2 text-xs text-muted-foreground",
|
|
3479
|
+
children: /* @__PURE__ */ jsx("span", { children: mutationCapability.message })
|
|
3480
|
+
}) : null,
|
|
3481
|
+
/* @__PURE__ */ jsx("fieldset", {
|
|
3482
|
+
disabled,
|
|
3483
|
+
className: "min-w-0 border-0 p-0",
|
|
3484
|
+
children: /* @__PURE__ */ jsx(PaletteTokenEditor, {
|
|
3485
|
+
palette: mergedPalette,
|
|
3486
|
+
onChange: onTokenChange,
|
|
3487
|
+
brandRoles: PALETTE_BRAND_ROLES,
|
|
3488
|
+
feedbackRoles: PALETTE_FEEDBACK_ROLES,
|
|
3489
|
+
surfaceRoles: PALETTE_SURFACE_ROLES,
|
|
3490
|
+
showContrastChecks: false,
|
|
3491
|
+
disabled
|
|
3492
|
+
})
|
|
3462
3493
|
}),
|
|
3463
|
-
|
|
3494
|
+
isCustom ? /* @__PURE__ */ jsx("div", {
|
|
3464
3495
|
className: "flex justify-end",
|
|
3465
3496
|
children: /* @__PURE__ */ jsx(Button, {
|
|
3466
3497
|
type: "button",
|
|
@@ -3502,6 +3533,13 @@ function PickerOption({ selected, label, description, swatch, onSelect, disabled
|
|
|
3502
3533
|
})
|
|
3503
3534
|
});
|
|
3504
3535
|
}
|
|
3536
|
+
function paletteApplyPlanErrorMessage(error) {
|
|
3537
|
+
switch (error) {
|
|
3538
|
+
case "invalid-palette-state": return "Palette details are unavailable. Refresh and try again.";
|
|
3539
|
+
case "curated-palette-missing": return "This curated palette is no longer available. Refresh and try again.";
|
|
3540
|
+
default: return assertNever$1(error);
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3505
3543
|
function classifyStyleApplyError(error) {
|
|
3506
3544
|
if (isRecord(error)) {
|
|
3507
3545
|
const status = error.status;
|
|
@@ -3523,7 +3561,7 @@ function expandedRowForPreviewDesignRow(row) {
|
|
|
3523
3561
|
case "header-style":
|
|
3524
3562
|
case "footer-layout":
|
|
3525
3563
|
case "footer": return row;
|
|
3526
|
-
default: return assertNever$
|
|
3564
|
+
default: return assertNever$1(row, "Unhandled preview design row");
|
|
3527
3565
|
}
|
|
3528
3566
|
}
|
|
3529
3567
|
function isRecord(value) {
|
|
@@ -3544,27 +3582,6 @@ function WarningNotice({ warnings, onDismiss }) {
|
|
|
3544
3582
|
})]
|
|
3545
3583
|
});
|
|
3546
3584
|
}
|
|
3547
|
-
function NoticeBanner({ notices, onDismiss }) {
|
|
3548
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
3549
|
-
role: "status",
|
|
3550
|
-
className: "rounded-md border border-muted-foreground/20 bg-muted/40 px-3 py-2 text-xs",
|
|
3551
|
-
children: [/* @__PURE__ */ jsx("ul", {
|
|
3552
|
-
className: "space-y-1",
|
|
3553
|
-
children: notices.map((notice, index) => /* @__PURE__ */ jsx("li", { children: describeNotice(notice) }, `${notice.kind}-${index}`))
|
|
3554
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
3555
|
-
type: "button",
|
|
3556
|
-
onClick: onDismiss,
|
|
3557
|
-
className: "mt-2 underline",
|
|
3558
|
-
children: "Dismiss"
|
|
3559
|
-
})]
|
|
3560
|
-
});
|
|
3561
|
-
}
|
|
3562
|
-
function describeNotice(notice) {
|
|
3563
|
-
switch (notice.kind) {
|
|
3564
|
-
case "palette-overrides-hidden": return "Custom colours are saved for the previous palette.";
|
|
3565
|
-
case "palette-overrides-restored": return "Custom colours restored for this palette.";
|
|
3566
|
-
}
|
|
3567
|
-
}
|
|
3568
3585
|
function describeWarning(warning) {
|
|
3569
3586
|
switch (warning.kind) {
|
|
3570
3587
|
case "rejected-personality": return `Button style changed to ${warning.fellBackTo} because ${warning.requested} is not offered for this site style.`;
|
|
@@ -3575,7 +3592,7 @@ function describeWarning(warning) {
|
|
|
3575
3592
|
}
|
|
3576
3593
|
//#endregion
|
|
3577
3594
|
//#region ../preview-next/src/client/preview/PreviewEditorSidebar.tsx
|
|
3578
|
-
function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonPersonalityId = null, themeSelectionPaletteVariantId = null, themeSelectionPaletteOverrides = null, themeSelectionHeaderLayoutId = null, themeSelectionHeaderStyleId = null, themeSelectionTypographyPresetId = null, themeSelectionTypographyBodyFontOverride = null, themeSelectionTypographyHeadingFontOverride = null, themeSelectionHeaderLookId = null, themeSelectionFooterLookId = null, themeSelectionHeaderContext, themeSelectionFooterContext, designRowRequest = null, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, activeTab, onTabChange, onClose, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
|
|
3595
|
+
function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, pageId, entryData, contentTypeSchema, referenceContentTypeKeys = [], draftContent, currentTemplate, theme, themeId = null, themeSelectionId = null, themeSelectionVersion = null, themeSelectionUpdatedAt = null, themeSelectionButtonPersonalityId = null, runtimePaletteState = null, themeSelectionPaletteVariantId = null, themeSelectionPaletteOverrides = null, themeSelectionHeaderLayoutId = null, themeSelectionHeaderStyleId = null, themeSelectionTypographyPresetId = null, themeSelectionTypographyBodyFontOverride = null, themeSelectionTypographyHeadingFontOverride = null, themeSelectionHeaderLookId = null, themeSelectionFooterLookId = null, themeSelectionHeaderContext, themeSelectionFooterContext, designRowRequest = null, apiClient, bearerToken, supabaseUrl, entrySubrouteContext, assistantPanel, sdkConfig, mediaAssets, bookingOfferingPresets, siteStyleAccess = { kind: "hidden" }, activeTab, onTabChange, onClose, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange }) {
|
|
3579
3596
|
const controller = useEntryController();
|
|
3580
3597
|
const controllerBlocks = controller.blocks;
|
|
3581
3598
|
const uiStore = useEditorUiStoreInstance();
|
|
@@ -3666,6 +3683,7 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
|
|
|
3666
3683
|
});
|
|
3667
3684
|
const editorPanel = entryData ? /* @__PURE__ */ jsx(EntryEditorPanel, {
|
|
3668
3685
|
siteId,
|
|
3686
|
+
dashboardBaseUrl,
|
|
3669
3687
|
entryData,
|
|
3670
3688
|
contentTypeSchema,
|
|
3671
3689
|
referenceContentTypeKeys,
|
|
@@ -3690,6 +3708,7 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
|
|
|
3690
3708
|
}) : pageId ? /* @__PURE__ */ jsx(PageBlockEditorPanel, {
|
|
3691
3709
|
siteId,
|
|
3692
3710
|
pageId,
|
|
3711
|
+
dashboardBaseUrl,
|
|
3693
3712
|
theme,
|
|
3694
3713
|
apiClient,
|
|
3695
3714
|
bearerToken,
|
|
@@ -3712,6 +3731,7 @@ function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl = null, page
|
|
|
3712
3731
|
selectionVersion: themeSelectionVersion,
|
|
3713
3732
|
selectionUpdatedAt: themeSelectionUpdatedAt,
|
|
3714
3733
|
buttonPersonalityId: themeSelectionButtonPersonalityId,
|
|
3734
|
+
runtimePaletteState,
|
|
3715
3735
|
paletteVariantId: themeSelectionPaletteVariantId,
|
|
3716
3736
|
paletteOverrides: themeSelectionPaletteOverrides,
|
|
3717
3737
|
headerLayoutId: themeSelectionHeaderLayoutId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-
|
|
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-
|
|
2
|
+
import { Ad as Pencil, Bl as Dialog, Cd as Sparkles, Du as cva, Eu as Button, Gl as DialogHeader, Hl as DialogContent, Id as LoaderCircle, Jd as Eye, Kl as DialogTitle, Md as Palette, Od as Redo2, Ot as useMultiAutosave, Ul as DialogDescription, Xd as EllipsisVertical, _d as Undo2, _t as useEditorUiStore, a as previewDesignHistoryDomainForCommand, au as DropdownMenu, gl as TooltipContent, gt as classifyHistoryShortcut, hl as Tooltip, ht as useEntryEditorController, i as usePreviewDesignHistoryOrder, jd as PenLine, ku as cn, lf as ChevronDown, lt as useEditor, n as useSiteChromeCustomizeOptional, o as selectPreviewDesignHistoryDomain, ou as DropdownMenuContent, su as DropdownMenuItem, uu as DropdownMenuTrigger, vd as TriangleAlert, vl as TooltipTrigger, vt as useEditorUiStoreInstance } from "./SiteChromeCustomizeContext-Bt8zb3qu.mjs";
|
|
3
|
+
import { d as unwrapResponse, r as usePreviewAuth } from "./previewAuthStore-CfquDtTh.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-Eks51NcN.mjs";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useState, useTransition } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as markPreviewAuthExpired, s as ApiRequestError } from "./previewAuthStore-
|
|
2
|
+
import { n as markPreviewAuthExpired, s as ApiRequestError } from "./previewAuthStore-CfquDtTh.mjs";
|
|
3
3
|
import { createContext, useContext, useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|