@riverbankcms/sdk 0.75.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{PreviewEditorSidebar-U2IHCBYN.mjs → PreviewEditorSidebar-XSX7QKHQ.mjs} +1179 -519
- package/dist/{PreviewEditorUI-ZGH2RQNP.mjs → PreviewEditorUI-YZNEZ3QD.mjs} +2 -2
- package/dist/SdkPreviewModeRuntime-5FS5E6BI.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +528 -20
- package/dist/_dts/api/src/bookingOperations.d.ts +12 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +11 -3
- package/dist/_dts/api/src/siteAssets.d.ts +1 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +26 -2
- package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +28 -1
- package/dist/_dts/block-form/src/client/index.d.ts +2 -2
- package/dist/_dts/block-form/src/index.d.ts +2 -1
- package/dist/_dts/block-form/src/manifest/utils.d.ts +24 -0
- package/dist/_dts/block-form/src/widgets/DateField/dateFieldSchema.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/DateTimeField/dateTimeFieldSchema.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/TimeField/timeFieldSchema.d.ts +1 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +10 -10
- package/dist/_dts/blocks/src/client/events.d.ts +3 -1
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +22 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
- package/dist/_dts/blocks/src/customBlockRegistry.d.ts +38 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +20 -2
- package/dist/_dts/blocks/src/system/blocks/feature-cards.d.ts +25 -0
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/intro.d.ts +24 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +3 -34
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/fields/aspectRatio.d.ts +30 -0
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +4 -1
- package/dist/_dts/blocks/src/system/fields/ctas.d.ts +7 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +11 -2
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/accordion.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/accordion.server.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/accordionIconTreatment.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +3 -27
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +163 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +5 -5
- package/dist/_dts/blocks/src/system/runtime/shared/components/BookingOptionCompactRow.d.ts +29 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/BookingOptionList.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +4 -3
- package/dist/_dts/blocks/src/system/runtime/shared/utils/bookingRoute.d.ts +20 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +2 -1
- package/dist/_dts/blocks/src/system/types/link.d.ts +12 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +2 -0
- package/dist/_dts/content-editor/src/hooks/blockDraftLifecycle.d.ts +48 -0
- package/dist/_dts/content-editor/src/hooks/invalidBlockSelectors.d.ts +4 -0
- package/dist/_dts/content-editor/src/hooks/publishability.d.ts +47 -0
- package/dist/_dts/content-editor/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +20 -0
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +4 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +3 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +3 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockSettingsModal.d.ts +5 -1
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +4 -1
- package/dist/_dts/editor-blocks/src/block-editor/actionControlMode.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/block-editor/customBlockRegistry.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/block-editor/sdkBlockMerger.d.ts +9 -37
- package/dist/_dts/editor-blocks/src/index.d.ts +3 -3
- package/dist/_dts/preview-next/src/client/index.d.ts +3 -0
- package/dist/_dts/preview-next/src/client/layout/PreviewLayoutContext.d.ts +5 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewDesignCoordinatorContext.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +7 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +7 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +7 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +18 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +20 -3
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +6 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +14 -4
- package/dist/_dts/preview-next/src/client/preview/previewDesignCoordinator.d.ts +73 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +12 -4
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +46 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +6 -1
- package/dist/_dts/preview-next/src/client/preview/themeOverlay.d.ts +21 -3
- package/dist/_dts/preview-next/src/client/preview/typographySelectionInput.d.ts +14 -0
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewModeRuntime.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +8 -0
- package/dist/_dts/sdk/src/client/management/types.d.ts +6 -1
- package/dist/_dts/sdk/src/client/types.d.ts +9 -0
- package/dist/_dts/sdk/src/client.d.ts +1 -1
- package/dist/_dts/sdk/src/components.d.ts +2 -2
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +35 -0
- package/dist/_dts/sdk/src/index.d.ts +2 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +6 -0
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +21 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +4 -3
- 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/buttons/personalities/earth-pill.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
- package/dist/_dts/theme-core/src/fonts/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +45 -0
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +15 -0
- package/dist/_dts/theme-core/src/palette/variants/warm-neutral.d.ts +16 -0
- package/dist/_dts/theme-core/src/schema.d.ts +280 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +81 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +6 -4
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +81 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +118 -2
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +13 -0
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -2
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +364 -5
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/site-styles/persistedIdParseResult.d.ts +9 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +20 -4
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +74 -2
- package/dist/_dts/theme-core/src/site-styles/typographyPresets.d.ts +189 -0
- package/dist/{chunk-Z7JLNTJR.mjs → chunk-6SMUFTXD.mjs} +2 -1
- package/dist/{chunk-ZSHFGFUG.mjs → chunk-ANKDYZ2E.mjs} +1 -1
- package/dist/{chunk-BGMNDF6T.mjs → chunk-EAWHBECW.mjs} +476 -153
- package/dist/{chunk-RWXQBRQZ.mjs → chunk-GSQX43EZ.mjs} +450 -63
- package/dist/{chunk-GFE74WRD.mjs → chunk-WLQBJN2Z.mjs} +3275 -435
- package/dist/cli/index.mjs +2023 -181
- package/dist/client/{accordion-T2UD2ZTH.mjs → accordion-RZMQSYLR.mjs} +1 -1
- package/dist/client/{bookingForm-GUP75FKN.mjs → bookingForm-NF4ASVNV.mjs} +3 -13
- package/dist/client/bookings.mjs +103 -11
- package/dist/client/{carousel-2NQA6V57.mjs → carousel-LDX47ZIK.mjs} +1 -1
- package/dist/client/{cart-5TFIAFDS.mjs → cart-RGXDS5F4.mjs} +4 -4
- package/dist/client/{checkout-TP4WAHZE.mjs → checkout-P7WWSNNY.mjs} +4 -4
- package/dist/client/{chunk-ZLMS67RR.mjs → chunk-E2TDNXCL.mjs} +1 -1
- package/dist/client/{chunk-NWOUL6JY.mjs → chunk-GMVTOKYG.mjs} +3 -3
- package/dist/client/{chunk-CY2ZTSE5.mjs → chunk-JNC7CGHX.mjs} +1 -1
- package/dist/client/{chunk-VUAOE3AG.mjs → chunk-L3DNHIJX.mjs} +4 -4
- package/dist/client/{chunk-FU2QRZMX.mjs → chunk-R56FQ3RR.mjs} +163 -24
- package/dist/client/{chunk-WJXXNDSE.mjs → chunk-UFSWADAO.mjs} +1 -1
- package/dist/client/client.mjs +4392 -2504
- package/dist/client/{courseRegistration-5DPU6PDY.mjs → courseRegistration-7F65K5ZR.mjs} +3 -3
- package/dist/client/{eventCalendar-F3GZGTEF.mjs → eventCalendar-GLSC5KTL.mjs} +5 -5
- package/dist/client/{eventCombined-BQOB6QMY.mjs → eventCombined-ZHK4WKUR.mjs} +5 -5
- package/dist/client/{eventDetails-PEM2EJWE.mjs → eventDetails-E3PJYBIN.mjs} +5 -5
- package/dist/client/{eventListing-YMIQPVME.mjs → eventListing-EMS3WC3E.mjs} +5 -5
- package/dist/client/{eventRegistration-4I6ZNDUF.mjs → eventRegistration-NZOTVNPI.mjs} +5 -5
- package/dist/client/{form-ZJVAYZ6G.mjs → form-ETFZFATW.mjs} +1 -1
- package/dist/client/{headerSection-TOT5MGTF.mjs → headerSection-4LBP7ULT.mjs} +2 -2
- package/dist/client/hooks.mjs +1918 -293
- package/dist/client/{locationMap-J66NZREU.mjs → locationMap-5M655YSJ.mjs} +1 -1
- package/dist/client/{newsletterForm-ET2XUMRO.mjs → newsletterForm-QOUYW44O.mjs} +1 -1
- package/dist/client/{productDetail-C2XIH7C5.mjs → productDetail-O4DOCWQG.mjs} +4 -4
- package/dist/client/{productList-T2AZLFTP.mjs → productList-A5RO5WIS.mjs} +4 -4
- package/dist/client/rendering/client.mjs +3328 -3177
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +5461 -3584
- package/dist/client/{shop-UZ6IUZXD.mjs → shop-L4MZH4I2.mjs} +4 -4
- package/dist/preview-next/chrome.css +1 -1
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/editor-base.css +2 -148
- package/dist/preview-next/editor-chrome.css +179 -0
- package/dist/{sdk-runtime-JCUQM63Y.mjs → sdk-runtime-Q6MTR4KL.mjs} +5 -5
- package/dist/server/components.mjs +2983 -1093
- package/dist/server/config-validation.mjs +1921 -293
- package/dist/server/config.mjs +1921 -293
- package/dist/server/data.mjs +1918 -293
- package/dist/server/index.mjs +31 -2
- package/dist/server/next.mjs +2951 -1043
- package/dist/server/page-converter.mjs +1894 -281
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2995 -1096
- package/dist/server/rendering.mjs +2988 -1098
- package/dist/server/routing.mjs +1963 -275
- package/dist/server/server.mjs +1932 -288
- package/dist/server/theme-bridge.mjs +158 -1
- package/dist/server/theme.mjs +158 -1
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-MTUGBTLQ.mjs +0 -8
- /package/dist/client/{chunk-2PHQZ666.mjs → chunk-JEZECJ3W.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { compileSiteThemeFromSelections, footerLookCatalog,
|
|
3
|
-
import { createContext, useState,
|
|
2
|
+
import { assertNever2, deriveNearestCompatibleHeaderStyle, findLegacyHeaderLookIdForSelection, compileSiteThemeFromSelections, footerLookCatalog, footerLookRejectionReasonLabel, getHeaderStyle, getHeaderLayout, writePlanForLookCustomizationCommand, headerLayoutCatalog, headerStyleCatalog, getCompatibleHeaderStyleIds, siteStyleIdFromTheme, getCuratedSiteStyle } from './chunk-WLQBJN2Z.mjs';
|
|
3
|
+
import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
// ../preview-next/src/client/preview/previewChromeSurfacePolicy.ts
|
|
@@ -368,50 +368,98 @@ function applyRfc6902Patch(base, ops) {
|
|
|
368
368
|
return next;
|
|
369
369
|
}
|
|
370
370
|
var PreviewThemeOverlayContext = createContext(null);
|
|
371
|
+
var NO_THEME_OVERLAY = { kind: "none" };
|
|
371
372
|
function isDebugEnabled() {
|
|
372
373
|
return process.env.NEXT_PUBLIC_AI_ASSISTANT_DEBUG === "1";
|
|
373
374
|
}
|
|
374
375
|
function PreviewThemeOverlayProvider({ baseTheme, children }) {
|
|
375
|
-
const [
|
|
376
|
-
const [
|
|
377
|
-
const
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
|
|
376
|
+
const [overlay, setOverlay] = useState(NO_THEME_OVERLAY);
|
|
377
|
+
const overlayOps = overlay.kind === "patch" ? [...overlay.ops] : null;
|
|
378
|
+
const overlayOpsSource = overlay.kind === "patch" ? overlay.source : null;
|
|
379
|
+
const overrideTheme = overlay.kind === "theme" ? overlay.theme : null;
|
|
380
|
+
const overrideThemeSource = overlay.kind === "theme" ? overlay.source : null;
|
|
381
|
+
const setOverlayOps = useCallback(
|
|
382
|
+
(ops, options) => {
|
|
383
|
+
setOverlay((current) => {
|
|
384
|
+
if (ops === null) {
|
|
385
|
+
if (current.kind !== "patch") return current;
|
|
386
|
+
if (options?.source && current.source !== options.source) return current;
|
|
387
|
+
return NO_THEME_OVERLAY;
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
kind: "patch",
|
|
391
|
+
source: options?.source ?? "unknown",
|
|
392
|
+
ops
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
[]
|
|
397
|
+
);
|
|
398
|
+
const setOverrideTheme = useCallback(
|
|
399
|
+
(theme, options) => {
|
|
400
|
+
setOverlay((current) => {
|
|
401
|
+
if (theme === null) {
|
|
402
|
+
if (current.kind !== "theme") return current;
|
|
403
|
+
if (options?.source && current.source !== options.source) return current;
|
|
404
|
+
return NO_THEME_OVERLAY;
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
kind: "theme",
|
|
408
|
+
source: options?.source ?? "unknown",
|
|
409
|
+
theme
|
|
410
|
+
};
|
|
411
|
+
});
|
|
412
|
+
},
|
|
413
|
+
[]
|
|
414
|
+
);
|
|
415
|
+
const clearOverlay = useCallback((options) => {
|
|
416
|
+
setOverlay((current) => {
|
|
417
|
+
const source = options?.source;
|
|
418
|
+
if (current.kind === "none") return current;
|
|
419
|
+
if (source && current.source !== source) return current;
|
|
420
|
+
return NO_THEME_OVERLAY;
|
|
421
|
+
});
|
|
381
422
|
}, []);
|
|
382
|
-
useEffect(() => {
|
|
383
|
-
if (previousBaseThemeRef.current && previousBaseThemeRef.current !== baseTheme) {
|
|
384
|
-
setOverlayOps(null);
|
|
385
|
-
setOverrideTheme(null);
|
|
386
|
-
}
|
|
387
|
-
previousBaseThemeRef.current = baseTheme;
|
|
388
|
-
}, [baseTheme]);
|
|
389
423
|
const effectiveTheme = useMemo(() => {
|
|
390
|
-
if (
|
|
391
|
-
if (
|
|
424
|
+
if (overlay.kind === "theme") return overlay.theme;
|
|
425
|
+
if (overlay.kind !== "patch" || overlay.ops.length === 0) return baseTheme;
|
|
392
426
|
try {
|
|
393
|
-
return applyRfc6902Patch(baseTheme,
|
|
427
|
+
return applyRfc6902Patch(baseTheme, [...overlay.ops]);
|
|
394
428
|
} catch (error) {
|
|
395
429
|
if (isDebugEnabled()) {
|
|
396
430
|
console.warn("[preview-theme-overlay] failed to apply theme overlay patch", {
|
|
397
431
|
error: error instanceof Error ? error.message : String(error),
|
|
398
|
-
overlayOps
|
|
432
|
+
overlayOps: overlay.ops
|
|
399
433
|
});
|
|
400
434
|
}
|
|
401
435
|
return baseTheme;
|
|
402
436
|
}
|
|
403
|
-
}, [baseTheme,
|
|
437
|
+
}, [baseTheme, overlay]);
|
|
404
438
|
const value = useMemo(
|
|
405
439
|
() => ({
|
|
406
440
|
baseTheme,
|
|
441
|
+
overlay,
|
|
407
442
|
overlayOps,
|
|
443
|
+
overlayOpsSource,
|
|
408
444
|
setOverlayOps,
|
|
409
445
|
overrideTheme,
|
|
446
|
+
overrideThemeSource,
|
|
410
447
|
setOverrideTheme,
|
|
411
448
|
effectiveTheme,
|
|
412
449
|
clearOverlay
|
|
413
450
|
}),
|
|
414
|
-
[
|
|
451
|
+
[
|
|
452
|
+
baseTheme,
|
|
453
|
+
clearOverlay,
|
|
454
|
+
effectiveTheme,
|
|
455
|
+
overlay,
|
|
456
|
+
overlayOps,
|
|
457
|
+
overlayOpsSource,
|
|
458
|
+
overrideTheme,
|
|
459
|
+
overrideThemeSource,
|
|
460
|
+
setOverlayOps,
|
|
461
|
+
setOverrideTheme
|
|
462
|
+
]
|
|
415
463
|
);
|
|
416
464
|
return /* @__PURE__ */ jsx(PreviewThemeOverlayContext.Provider, { value, children });
|
|
417
465
|
}
|
|
@@ -423,6 +471,200 @@ function usePreviewThemeOverlay() {
|
|
|
423
471
|
return ctx;
|
|
424
472
|
}
|
|
425
473
|
|
|
474
|
+
// ../preview-next/src/client/preview/previewDesignCoordinator.ts
|
|
475
|
+
var NO_PREVIEW_DESIGN_STATE = { kind: "idle" };
|
|
476
|
+
function transitionPreviewDesignState(state, command) {
|
|
477
|
+
switch (command.kind) {
|
|
478
|
+
case "preview-theme-patch":
|
|
479
|
+
return acceptPreview(state, {
|
|
480
|
+
kind: "active",
|
|
481
|
+
owner: command.producer,
|
|
482
|
+
surface: "theme-json-patch",
|
|
483
|
+
apply: "idle"
|
|
484
|
+
}, {
|
|
485
|
+
kind: "set-patch",
|
|
486
|
+
source: command.producer,
|
|
487
|
+
ops: command.ops
|
|
488
|
+
});
|
|
489
|
+
case "preview-theme":
|
|
490
|
+
return acceptPreview(state, {
|
|
491
|
+
kind: "active",
|
|
492
|
+
owner: command.producer,
|
|
493
|
+
surface: command.sourcePlan,
|
|
494
|
+
apply: "idle"
|
|
495
|
+
}, {
|
|
496
|
+
kind: "set-theme",
|
|
497
|
+
source: command.producer,
|
|
498
|
+
theme: command.theme
|
|
499
|
+
});
|
|
500
|
+
case "clear-preview":
|
|
501
|
+
if (state.kind === "idle") {
|
|
502
|
+
return ignored(state, "no-active-preview");
|
|
503
|
+
}
|
|
504
|
+
if (state.owner !== command.producer) {
|
|
505
|
+
return ignored(state, "producer-does-not-own-preview");
|
|
506
|
+
}
|
|
507
|
+
return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
|
|
508
|
+
case "base-theme-changed":
|
|
509
|
+
if (state.kind === "idle") {
|
|
510
|
+
return accepted(state, { kind: "none" });
|
|
511
|
+
}
|
|
512
|
+
return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
|
|
513
|
+
case "apply-started":
|
|
514
|
+
if (state.kind === "idle") {
|
|
515
|
+
return ignored(state, "no-active-preview");
|
|
516
|
+
}
|
|
517
|
+
if (state.owner !== command.producer) {
|
|
518
|
+
return ignored(state, "producer-does-not-own-preview");
|
|
519
|
+
}
|
|
520
|
+
return accepted({ ...state, apply: "pending" }, { kind: "none" });
|
|
521
|
+
case "apply-succeeded":
|
|
522
|
+
if (state.kind === "idle") {
|
|
523
|
+
return ignored(state, "apply-event-for-displaced-preview");
|
|
524
|
+
}
|
|
525
|
+
if (state.owner !== command.producer) {
|
|
526
|
+
return ignored(state, "apply-event-for-displaced-preview");
|
|
527
|
+
}
|
|
528
|
+
return accepted(NO_PREVIEW_DESIGN_STATE, { kind: "clear" });
|
|
529
|
+
case "apply-failed":
|
|
530
|
+
if (state.kind === "idle") {
|
|
531
|
+
return ignored(state, "apply-event-for-displaced-preview");
|
|
532
|
+
}
|
|
533
|
+
if (state.owner !== command.producer) {
|
|
534
|
+
return ignored(state, "apply-event-for-displaced-preview");
|
|
535
|
+
}
|
|
536
|
+
return accepted({ ...state, apply: "idle" }, { kind: "none" });
|
|
537
|
+
default:
|
|
538
|
+
return assertNever2(command, "Unhandled preview design command");
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function acceptPreview(current, next, effect) {
|
|
542
|
+
return accepted(next, effect);
|
|
543
|
+
}
|
|
544
|
+
function accepted(state, effect) {
|
|
545
|
+
return {
|
|
546
|
+
kind: "accepted",
|
|
547
|
+
state,
|
|
548
|
+
effect
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function ignored(state, reason) {
|
|
552
|
+
return {
|
|
553
|
+
kind: "ignored",
|
|
554
|
+
state,
|
|
555
|
+
reason
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
var PreviewDesignCoordinatorContext = createContext(null);
|
|
559
|
+
function PreviewDesignCoordinatorProvider({ children }) {
|
|
560
|
+
const themeOverlay = usePreviewThemeOverlay();
|
|
561
|
+
const {
|
|
562
|
+
baseTheme,
|
|
563
|
+
clearOverlay,
|
|
564
|
+
overlay,
|
|
565
|
+
setOverlayOps,
|
|
566
|
+
setOverrideTheme
|
|
567
|
+
} = themeOverlay;
|
|
568
|
+
const [state, setState] = useState(NO_PREVIEW_DESIGN_STATE);
|
|
569
|
+
const stateRef = useRef(state);
|
|
570
|
+
const previousBaseThemeRef = useRef(null);
|
|
571
|
+
useEffect(() => {
|
|
572
|
+
stateRef.current = state;
|
|
573
|
+
}, [state]);
|
|
574
|
+
const dispatch = useCallback(
|
|
575
|
+
(command) => {
|
|
576
|
+
const transition = transitionPreviewDesignState(stateRef.current, command);
|
|
577
|
+
if (transition.kind === "accepted") {
|
|
578
|
+
stateRef.current = transition.state;
|
|
579
|
+
setState(transition.state);
|
|
580
|
+
switch (transition.effect.kind) {
|
|
581
|
+
case "none":
|
|
582
|
+
break;
|
|
583
|
+
case "clear":
|
|
584
|
+
clearOverlay();
|
|
585
|
+
break;
|
|
586
|
+
case "set-patch":
|
|
587
|
+
setOverlayOps([...transition.effect.ops], {
|
|
588
|
+
source: transition.effect.source
|
|
589
|
+
});
|
|
590
|
+
break;
|
|
591
|
+
case "set-theme":
|
|
592
|
+
setOverrideTheme(transition.effect.theme, {
|
|
593
|
+
source: transition.effect.source
|
|
594
|
+
});
|
|
595
|
+
break;
|
|
596
|
+
default:
|
|
597
|
+
assertNever2(transition.effect, "Unhandled preview design overlay effect");
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
return transition;
|
|
601
|
+
},
|
|
602
|
+
[clearOverlay, setOverlayOps, setOverrideTheme]
|
|
603
|
+
);
|
|
604
|
+
useEffect(() => {
|
|
605
|
+
if (previousBaseThemeRef.current && previousBaseThemeRef.current !== baseTheme) {
|
|
606
|
+
dispatch({ kind: "base-theme-changed" });
|
|
607
|
+
}
|
|
608
|
+
previousBaseThemeRef.current = baseTheme;
|
|
609
|
+
}, [baseTheme, dispatch]);
|
|
610
|
+
const previewTheme = useCallback(
|
|
611
|
+
(producer, theme, sourcePlan) => dispatch({ kind: "preview-theme", producer, theme, sourcePlan }),
|
|
612
|
+
[dispatch]
|
|
613
|
+
);
|
|
614
|
+
const previewThemePatch = useCallback(
|
|
615
|
+
(producer, ops) => dispatch({ kind: "preview-theme-patch", producer, ops }),
|
|
616
|
+
[dispatch]
|
|
617
|
+
);
|
|
618
|
+
const clearPreview = useCallback(
|
|
619
|
+
(producer) => dispatch({ kind: "clear-preview", producer }),
|
|
620
|
+
[dispatch]
|
|
621
|
+
);
|
|
622
|
+
const applyStarted = useCallback(
|
|
623
|
+
(producer) => dispatch({ kind: "apply-started", producer }),
|
|
624
|
+
[dispatch]
|
|
625
|
+
);
|
|
626
|
+
const applySucceeded = useCallback(
|
|
627
|
+
(producer) => dispatch({ kind: "apply-succeeded", producer }),
|
|
628
|
+
[dispatch]
|
|
629
|
+
);
|
|
630
|
+
const applyFailed = useCallback(
|
|
631
|
+
(producer) => dispatch({ kind: "apply-failed", producer }),
|
|
632
|
+
[dispatch]
|
|
633
|
+
);
|
|
634
|
+
const value = useMemo(
|
|
635
|
+
() => ({
|
|
636
|
+
state,
|
|
637
|
+
overlay,
|
|
638
|
+
dispatch,
|
|
639
|
+
previewTheme,
|
|
640
|
+
previewThemePatch,
|
|
641
|
+
clearPreview,
|
|
642
|
+
applyStarted,
|
|
643
|
+
applySucceeded,
|
|
644
|
+
applyFailed
|
|
645
|
+
}),
|
|
646
|
+
[
|
|
647
|
+
applyFailed,
|
|
648
|
+
applyStarted,
|
|
649
|
+
applySucceeded,
|
|
650
|
+
clearPreview,
|
|
651
|
+
dispatch,
|
|
652
|
+
previewTheme,
|
|
653
|
+
previewThemePatch,
|
|
654
|
+
state,
|
|
655
|
+
overlay
|
|
656
|
+
]
|
|
657
|
+
);
|
|
658
|
+
return /* @__PURE__ */ jsx(PreviewDesignCoordinatorContext.Provider, { value, children });
|
|
659
|
+
}
|
|
660
|
+
function usePreviewDesignCoordinator() {
|
|
661
|
+
const ctx = useContext(PreviewDesignCoordinatorContext);
|
|
662
|
+
if (!ctx) {
|
|
663
|
+
throw new Error("usePreviewDesignCoordinator must be used within PreviewDesignCoordinatorProvider");
|
|
664
|
+
}
|
|
665
|
+
return ctx;
|
|
666
|
+
}
|
|
667
|
+
|
|
426
668
|
// ../preview-next/src/client/blocks/runOptimisticCustomizeAction.ts
|
|
427
669
|
function createOptimisticActionRunner() {
|
|
428
670
|
let latest = 0;
|
|
@@ -482,17 +724,55 @@ function previewButtonPersonality(state, buttonPersonalityId) {
|
|
|
482
724
|
saveStatus: { kind: "idle" }
|
|
483
725
|
};
|
|
484
726
|
}
|
|
485
|
-
function
|
|
727
|
+
function previewHeaderLayout(state, headerLayoutId) {
|
|
728
|
+
const headerStyleId = deriveNearestCompatibleHeaderStyle(
|
|
729
|
+
state.previewed.headerStyleId,
|
|
730
|
+
headerLayoutId
|
|
731
|
+
);
|
|
732
|
+
return previewHeaderSelection(state, { headerLayoutId, headerStyleId });
|
|
733
|
+
}
|
|
734
|
+
function previewHeaderStyle(state, headerStyleId) {
|
|
735
|
+
return previewHeaderSelection(state, {
|
|
736
|
+
headerLayoutId: state.previewed.headerLayoutId,
|
|
737
|
+
headerStyleId
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
function previewFooterLook(state, footerLookId) {
|
|
486
741
|
return {
|
|
487
742
|
...state,
|
|
488
|
-
previewed: { ...state.previewed,
|
|
743
|
+
previewed: { ...state.previewed, footerLookId },
|
|
489
744
|
saveStatus: { kind: "idle" }
|
|
490
745
|
};
|
|
491
746
|
}
|
|
492
|
-
function
|
|
747
|
+
function previewTypographyPreset(state, typographyPresetId) {
|
|
493
748
|
return {
|
|
494
749
|
...state,
|
|
495
|
-
previewed: { ...state.previewed,
|
|
750
|
+
previewed: { ...state.previewed, typographyPresetId },
|
|
751
|
+
saveStatus: { kind: "idle" }
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function setTypographyBodyFontOverride(state, typographyBodyFontOverride) {
|
|
755
|
+
return {
|
|
756
|
+
...state,
|
|
757
|
+
previewed: { ...state.previewed, typographyBodyFontOverride },
|
|
758
|
+
saveStatus: { kind: "idle" }
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function setTypographyHeadingFontOverride(state, typographyHeadingFontOverride) {
|
|
762
|
+
return {
|
|
763
|
+
...state,
|
|
764
|
+
previewed: { ...state.previewed, typographyHeadingFontOverride },
|
|
765
|
+
saveStatus: { kind: "idle" }
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
function clearTypographyFontOverrides(state) {
|
|
769
|
+
return {
|
|
770
|
+
...state,
|
|
771
|
+
previewed: {
|
|
772
|
+
...state.previewed,
|
|
773
|
+
typographyBodyFontOverride: null,
|
|
774
|
+
typographyHeadingFontOverride: null
|
|
775
|
+
},
|
|
496
776
|
saveStatus: { kind: "idle" }
|
|
497
777
|
};
|
|
498
778
|
}
|
|
@@ -518,7 +798,13 @@ function applyResolvedSelections(state, input) {
|
|
|
518
798
|
...paletteScoped,
|
|
519
799
|
previewed: {
|
|
520
800
|
...paletteScoped.previewed,
|
|
521
|
-
buttonPersonalityId: input.resolved.buttonPersonalityId
|
|
801
|
+
buttonPersonalityId: input.resolved.buttonPersonalityId,
|
|
802
|
+
headerLayoutId: input.resolved.headerLayoutId,
|
|
803
|
+
headerStyleId: input.resolved.headerStyleId,
|
|
804
|
+
headerLookId: input.resolved.headerLookId,
|
|
805
|
+
typographyPresetId: input.resolved.typographyPresetId,
|
|
806
|
+
typographyBodyFontOverride: input.resolved.typographyBodyFontOverride,
|
|
807
|
+
typographyHeadingFontOverride: input.resolved.typographyHeadingFontOverride
|
|
522
808
|
},
|
|
523
809
|
warnings: input.warnings
|
|
524
810
|
};
|
|
@@ -617,6 +903,26 @@ function movePreviewToPaletteVariant(state, paletteVariantId) {
|
|
|
617
903
|
saveStatus: { kind: "idle" }
|
|
618
904
|
};
|
|
619
905
|
}
|
|
906
|
+
function previewHeaderSelection(state, selection) {
|
|
907
|
+
const headerStyleId = deriveNearestCompatibleHeaderStyle(
|
|
908
|
+
selection.headerStyleId,
|
|
909
|
+
selection.headerLayoutId
|
|
910
|
+
);
|
|
911
|
+
const headerLookId = findLegacyHeaderLookIdForSelection({
|
|
912
|
+
layoutId: selection.headerLayoutId,
|
|
913
|
+
styleId: headerStyleId
|
|
914
|
+
});
|
|
915
|
+
return {
|
|
916
|
+
...state,
|
|
917
|
+
previewed: {
|
|
918
|
+
...state.previewed,
|
|
919
|
+
headerLayoutId: selection.headerLayoutId,
|
|
920
|
+
headerStyleId,
|
|
921
|
+
headerLookId
|
|
922
|
+
},
|
|
923
|
+
saveStatus: { kind: "idle" }
|
|
924
|
+
};
|
|
925
|
+
}
|
|
620
926
|
function withPaletteOverrideDraft(drafts, paletteVariantId, paletteOverrides) {
|
|
621
927
|
const next = { ...drafts };
|
|
622
928
|
if (paletteOverrides === null) {
|
|
@@ -637,7 +943,7 @@ function appendPaletteOverrideScopeNotice(notices, input) {
|
|
|
637
943
|
return [...notices, { kind }];
|
|
638
944
|
}
|
|
639
945
|
function selectionSnapshotsEqual(a, b) {
|
|
640
|
-
return a.siteStyleId === b.siteStyleId && a.selectionVersion === b.selectionVersion && a.selectionUpdatedAt === b.selectionUpdatedAt && a.headerLookId === b.headerLookId && a.footerLookId === b.footerLookId && a.buttonPersonalityId === b.buttonPersonalityId && a.paletteVariantId === b.paletteVariantId && paletteOverridesEqual(a.paletteOverrides, b.paletteOverrides);
|
|
946
|
+
return a.siteStyleId === b.siteStyleId && a.selectionVersion === b.selectionVersion && a.selectionUpdatedAt === b.selectionUpdatedAt && a.headerLayoutId === b.headerLayoutId && a.headerStyleId === b.headerStyleId && a.headerLookId === b.headerLookId && a.footerLookId === b.footerLookId && a.buttonPersonalityId === b.buttonPersonalityId && a.paletteVariantId === b.paletteVariantId && a.typographyPresetId === b.typographyPresetId && a.typographyBodyFontOverride === b.typographyBodyFontOverride && a.typographyHeadingFontOverride === b.typographyHeadingFontOverride && paletteOverridesEqual(a.paletteOverrides, b.paletteOverrides);
|
|
641
947
|
}
|
|
642
948
|
function paletteOverridesEqual(a, b) {
|
|
643
949
|
if (a === b) return true;
|
|
@@ -656,41 +962,40 @@ function buildSiteChromeLookModels(input) {
|
|
|
656
962
|
buttonPersonalityId: selection.buttonPersonalityId,
|
|
657
963
|
paletteVariantId: selection.paletteVariantId,
|
|
658
964
|
paletteOverrides: selection.paletteOverrides,
|
|
965
|
+
headerLayoutId: selection.headerLayoutId,
|
|
966
|
+
headerStyleId: selection.headerStyleId,
|
|
659
967
|
headerLookId: selection.headerLookId,
|
|
660
968
|
footerLookId: selection.footerLookId,
|
|
661
969
|
headerSelectionContext: input.headerSelectionContext,
|
|
662
970
|
footerSelectionContext: input.footerSelectionContext
|
|
663
971
|
};
|
|
664
972
|
const current = compileSiteThemeFromSelections(common);
|
|
973
|
+
const renderedHeaderLayoutId = current.resolvedSelections.headerLayoutId;
|
|
974
|
+
const renderedHeaderStyleId = current.resolvedSelections.headerStyleId;
|
|
665
975
|
return {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
options:
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
976
|
+
headerLayout: {
|
|
977
|
+
renderedLayoutId: renderedHeaderLayoutId,
|
|
978
|
+
options: orderedHeaderLayoutIds(input.siteStyle).map((layoutId) => {
|
|
979
|
+
const layout = getHeaderLayout(layoutId);
|
|
980
|
+
return {
|
|
981
|
+
id: layoutId,
|
|
982
|
+
label: layout?.label ?? layoutId,
|
|
983
|
+
description: layout?.description,
|
|
673
984
|
available: true
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
],
|
|
689
|
-
diagnostics: diagnosticsForRequestedHeaderSelection(
|
|
690
|
-
selection.headerLookId,
|
|
691
|
-
current.resolvedSelections.headerLookId,
|
|
692
|
-
current.headerSelection.rejected
|
|
693
|
-
)
|
|
985
|
+
};
|
|
986
|
+
})
|
|
987
|
+
},
|
|
988
|
+
headerStyle: {
|
|
989
|
+
renderedStyleId: renderedHeaderStyleId,
|
|
990
|
+
options: orderedHeaderStyleIds(input.siteStyle, selection.headerLayoutId).map((styleId) => {
|
|
991
|
+
const style = getHeaderStyle(styleId);
|
|
992
|
+
return {
|
|
993
|
+
id: styleId,
|
|
994
|
+
label: style?.label ?? styleId,
|
|
995
|
+
description: style?.description,
|
|
996
|
+
available: true
|
|
997
|
+
};
|
|
998
|
+
})
|
|
694
999
|
},
|
|
695
1000
|
footer: {
|
|
696
1001
|
renderedLookId: current.resolvedSelections.footerLookId,
|
|
@@ -736,10 +1041,14 @@ function cycleableSiteChromeOptions(options) {
|
|
|
736
1041
|
}
|
|
737
1042
|
function planSiteChromeLookSelection(command) {
|
|
738
1043
|
if (command.surface === "header") {
|
|
739
|
-
const
|
|
1044
|
+
const headerLookId = findLegacyHeaderLookIdForSelection({
|
|
1045
|
+
layoutId: command.layoutId,
|
|
1046
|
+
styleId: command.styleId
|
|
1047
|
+
});
|
|
1048
|
+
const lookCommand2 = headerLookId ? {
|
|
740
1049
|
kind: "select",
|
|
741
1050
|
surface: { kind: "site-header" },
|
|
742
|
-
lookId:
|
|
1051
|
+
lookId: headerLookId
|
|
743
1052
|
} : {
|
|
744
1053
|
kind: "clear",
|
|
745
1054
|
surface: { kind: "site-header" }
|
|
@@ -747,7 +1056,11 @@ function planSiteChromeLookSelection(command) {
|
|
|
747
1056
|
return {
|
|
748
1057
|
kind: "header",
|
|
749
1058
|
writePlan: writePlanForLookCustomizationCommand(lookCommand2),
|
|
750
|
-
next: {
|
|
1059
|
+
next: {
|
|
1060
|
+
headerLayoutId: command.layoutId,
|
|
1061
|
+
headerStyleId: command.styleId,
|
|
1062
|
+
headerLookId
|
|
1063
|
+
}
|
|
751
1064
|
};
|
|
752
1065
|
}
|
|
753
1066
|
const lookCommand = command.lookId ? {
|
|
@@ -764,10 +1077,33 @@ function planSiteChromeLookSelection(command) {
|
|
|
764
1077
|
next: { footerLookId: command.lookId }
|
|
765
1078
|
};
|
|
766
1079
|
}
|
|
767
|
-
function
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1080
|
+
function orderedHeaderLayoutIds(siteStyle) {
|
|
1081
|
+
return orderUnique(
|
|
1082
|
+
siteStyle.recommendedHeaderLayoutChoices.map((choice) => choice.id),
|
|
1083
|
+
headerLayoutCatalog.map((layout) => layout.id)
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
function orderedHeaderStyleIds(siteStyle, layoutId) {
|
|
1087
|
+
const curated = headerStyleChoicesForLayout(
|
|
1088
|
+
siteStyle.recommendedHeaderStyleChoicesByLayout,
|
|
1089
|
+
layoutId
|
|
1090
|
+
).map((choice) => choice.id);
|
|
1091
|
+
return orderUnique(curated, getCompatibleHeaderStyleIds(layoutId), headerStyleCatalog.map((style) => style.id));
|
|
1092
|
+
}
|
|
1093
|
+
function headerStyleChoicesForLayout(choicesByLayout, layoutId) {
|
|
1094
|
+
return choicesByLayout[layoutId] ?? [];
|
|
1095
|
+
}
|
|
1096
|
+
function orderUnique(...groups) {
|
|
1097
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1098
|
+
const ordered = [];
|
|
1099
|
+
for (const group of groups) {
|
|
1100
|
+
for (const id of group) {
|
|
1101
|
+
if (seen.has(id)) continue;
|
|
1102
|
+
seen.add(id);
|
|
1103
|
+
ordered.push(id);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return ordered;
|
|
771
1107
|
}
|
|
772
1108
|
function diagnosticsForRequestedFooterSelection(requestedLookId, renderedLookId, rejected) {
|
|
773
1109
|
if (!requestedLookId || requestedLookId === renderedLookId) return [];
|
|
@@ -775,6 +1111,23 @@ function diagnosticsForRequestedFooterSelection(requestedLookId, renderedLookId,
|
|
|
775
1111
|
return rejectedRequest?.reasons.map(footerLookRejectionReasonLabel) ?? [];
|
|
776
1112
|
}
|
|
777
1113
|
|
|
1114
|
+
// ../preview-next/src/client/preview/typographySelectionInput.ts
|
|
1115
|
+
function typographySelectionInputForSnapshot(snapshot, theme) {
|
|
1116
|
+
if (snapshot.typographyPresetId === null && theme?.typography) {
|
|
1117
|
+
return {
|
|
1118
|
+
typographySelection: {
|
|
1119
|
+
kind: "custom",
|
|
1120
|
+
typography: theme.typography
|
|
1121
|
+
}
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
return {
|
|
1125
|
+
typographyPresetId: snapshot.typographyPresetId,
|
|
1126
|
+
typographyBodyFontOverride: snapshot.typographyBodyFontOverride,
|
|
1127
|
+
typographyHeadingFontOverride: snapshot.typographyHeadingFontOverride
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
|
|
778
1131
|
// ../preview-next/src/client/preview/styleConfiguratorSnapshot.ts
|
|
779
1132
|
function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
780
1133
|
const themeSiteStyleId = siteStyleIdFromTheme(input.theme);
|
|
@@ -786,6 +1139,9 @@ function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
|
786
1139
|
buttonPersonalityId: input.initialSelections.buttonPersonalityId,
|
|
787
1140
|
paletteVariantId: input.initialSelections.paletteVariantId,
|
|
788
1141
|
paletteOverrides: input.initialSelections.paletteOverrides,
|
|
1142
|
+
headerLayoutId: input.initialSelections.headerLayoutId ?? null,
|
|
1143
|
+
headerStyleId: input.initialSelections.headerStyleId ?? null,
|
|
1144
|
+
...typographySelectionInputForSnapshot(input.initialSelections, input.theme),
|
|
789
1145
|
headerLookId: input.initialSelections.headerLookId ?? null,
|
|
790
1146
|
footerLookId: input.initialSelections.footerLookId ?? null,
|
|
791
1147
|
headerSelectionContext: input.headerSelectionContext,
|
|
@@ -796,12 +1152,43 @@ function resolveStyleConfiguratorInitialSnapshot(input) {
|
|
|
796
1152
|
siteStyleId: siteStyle.id,
|
|
797
1153
|
selectionVersion: input.initialSelections.selectionVersion ?? 0,
|
|
798
1154
|
selectionUpdatedAt: input.initialSelections.selectionUpdatedAt ?? null,
|
|
1155
|
+
headerLayoutId: compiled.resolvedSelections.headerLayoutId,
|
|
1156
|
+
headerStyleId: compiled.resolvedSelections.headerStyleId,
|
|
799
1157
|
headerLookId: compiled.requestedSelections.headerLookId,
|
|
800
1158
|
footerLookId: compiled.requestedSelections.footerLookId,
|
|
801
1159
|
buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
|
|
802
1160
|
paletteVariantId: compiled.resolvedSelections.paletteVariantId,
|
|
803
|
-
paletteOverrides: paletteChanged ? null : input.initialSelections.paletteOverrides
|
|
1161
|
+
paletteOverrides: paletteChanged ? null : input.initialSelections.paletteOverrides,
|
|
1162
|
+
typographyPresetId: compiled.resolvedSelections.typographyPresetId,
|
|
1163
|
+
typographyBodyFontOverride: compiled.resolvedSelections.typographyBodyFontOverride,
|
|
1164
|
+
typographyHeadingFontOverride: compiled.resolvedSelections.typographyHeadingFontOverride
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// ../preview-next/src/client/preview/siteStylePreviewPlanner.ts
|
|
1169
|
+
function planSiteStylePreviewChange(input) {
|
|
1170
|
+
const compiled = compileSiteThemeFromSelections({
|
|
1171
|
+
siteStyle: input.siteStyle,
|
|
1172
|
+
buttonPersonalityId: input.selection.buttonPersonalityId,
|
|
1173
|
+
paletteVariantId: input.selection.paletteVariantId,
|
|
1174
|
+
paletteOverrides: input.selection.paletteOverrides,
|
|
1175
|
+
...typographySelectionInputForSnapshot(input.selection, input.baseTheme),
|
|
1176
|
+
headerLayoutId: input.selection.headerLayoutId,
|
|
1177
|
+
headerStyleId: input.selection.headerStyleId,
|
|
1178
|
+
headerLookId: input.selection.headerLookId,
|
|
1179
|
+
footerLookId: input.selection.footerLookId,
|
|
1180
|
+
headerSelectionContext: input.headerSelectionContext,
|
|
1181
|
+
footerSelectionContext: input.footerSelectionContext
|
|
1182
|
+
});
|
|
1183
|
+
return {
|
|
1184
|
+
themeOverlay: compiled.theme,
|
|
1185
|
+
resolvedSelections: compiled.resolvedSelections,
|
|
1186
|
+
chromeSelection: {
|
|
1187
|
+
headerLookId: input.selection.headerLookId,
|
|
1188
|
+
footerLookId: input.selection.footerLookId
|
|
1189
|
+
},
|
|
1190
|
+
warnings: compiled.warnings
|
|
804
1191
|
};
|
|
805
1192
|
}
|
|
806
1193
|
|
|
807
|
-
export { PreviewThemeOverlayProvider, applyResolvedSelections, buildPreviewDashboardSetupUrl, buildSiteChromeLookModels, canApplySiteStyle, canInspectSiteStyle, cancelPreview, createOptimisticActionRunner, createStyleConfiguratorState, cycleSiteChromeLookId, cycleableSiteChromeOptions, dismissNotices, dismissWarnings, isPreviewingChange, markApplyFailed, markApplySaved, markApplySaving, openRow, planSiteChromeLookSelection, previewButtonPersonality, previewFooterLook,
|
|
1194
|
+
export { PreviewDesignCoordinatorProvider, PreviewThemeOverlayProvider, applyResolvedSelections, buildPreviewDashboardSetupUrl, buildSiteChromeLookModels, canApplySiteStyle, canInspectSiteStyle, cancelPreview, clearTypographyFontOverrides, createOptimisticActionRunner, createStyleConfiguratorState, cycleSiteChromeLookId, cycleableSiteChromeOptions, dismissNotices, dismissWarnings, isPreviewingChange, markApplyFailed, markApplySaved, markApplySaving, openRow, planSiteChromeLookSelection, planSiteStylePreviewChange, previewButtonPersonality, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, resolvePreviewDashboardSetupHandoff, resolvePreviewEditorGuidanceModel, resolvePreviewSetupBannerModel, resolvePreviewSidebarChromeModel, resolveSiteStyleAccess, resolveStyleConfiguratorInitialSnapshot, sanitizeDashboardPath, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, syncStyleConfiguratorState, toggleRow, usePreviewDesignCoordinator, usePreviewThemeOverlay };
|