@riverbankcms/sdk 0.144.0 → 0.145.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/dist/{PreviewEditorSidebar-CQZNnFiM.mjs → PreviewEditorSidebar-O-V6Pl5a.mjs} +4 -4
- package/dist/{PreviewEditorUI-DCNxnmI0.mjs → PreviewEditorUI-1UlX_9cw.mjs} +3 -3
- package/dist/{PreviewQueryProvider-BCYICImX.mjs → PreviewQueryProvider-BxGwdOCV.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-BJolUbr1.mjs → SdkPreviewModeRuntime-DYbA_4iv.mjs} +419 -348
- package/dist/{SiteChromeCustomizeContext-CKgEpoxi.mjs → SiteChromeCustomizeContext-CNTKQ9nx.mjs} +2081 -1313
- package/dist/_dts/ai/src/contracts/proposals.d.ts +4719 -66
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +429 -6
- package/dist/_dts/api/src/appointmentEndpointDefinitions.d.ts +49 -0
- package/dist/_dts/api/src/appointmentServiceCategoryEndpoints.d.ts +75 -0
- package/dist/_dts/api/src/appointmentServiceContracts.d.ts +80 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +8 -1
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -12
- package/dist/_dts/api/src/communications.d.ts +14 -22
- package/dist/_dts/api/src/contentRuntime.d.ts +2 -0
- package/dist/_dts/api/src/endpoints.d.ts +105 -58
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/launchReadiness.d.ts +2 -0
- package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +0 -23
- package/dist/_dts/api/src/onboarding/confirmationResend.d.ts +3 -0
- package/dist/_dts/api/src/publicBookingService.d.ts +35 -1
- package/dist/_dts/api/src/publicExperience/newsletterEndpoints.d.ts +13 -0
- package/dist/_dts/api/src/publicNewsletterEndpointDefinitions.d.ts +58 -0
- package/dist/_dts/api/src/schemas/admin-observability-logs.d.ts +3 -3
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/types.d.ts +2 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +4 -4
- package/dist/_dts/blocks/src/bindings/index.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +24 -0
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/pageRenderJoins.d.ts +68 -0
- package/dist/_dts/blocks/src/pageRenderPlan.d.ts +8 -27
- package/dist/_dts/blocks/src/pageRenderPreparation.d.ts +7 -4
- package/dist/_dts/blocks/src/pageRendererBoundaries.d.ts +40 -23
- package/dist/_dts/blocks/src/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-services.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/calendarWindow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +47 -47
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +29 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +8 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +22 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +57 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.service-categories.d.ts +29 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.service-choices.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +13 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +20 -1
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +2 -0
- package/dist/_dts/content-model/src/content-types/schema.d.ts +1 -1
- package/dist/_dts/core/src/appointment-service-categories.d.ts +108 -0
- package/dist/_dts/core/src/editor-state.d.ts +6 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/public-profile.d.ts +9 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +663 -241
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +6 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +16 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/types.d.ts +13 -0
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/utils.d.ts +29 -0
- package/dist/_dts/preview-next/src/client/blocks/BoundaryControl.d.ts +7 -2
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/applyPreviewProjections.d.ts +1 -3
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +1 -0
- package/dist/_dts/sdk/src/client/runtimeCacheKeys.d.ts +8 -0
- package/dist/_dts/sdk/src/client/types.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/page.d.ts +7 -2
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +5 -0
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +2 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -8
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/surfaces/src/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/layout/boundaryCss.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/compositionBudget.d.ts +8 -0
- package/dist/_dts/theme-core/src/site-styles/contentTemplateRuntimeCompiler.d.ts +3 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +1 -3
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipeline.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +3 -0
- package/dist/_dts/theme-core/src/site-styles/joinTreatment.d.ts +132 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorBoundaries.d.ts +31 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +33 -29
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/pageFlowPresets.d.ts +36 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -10
- package/dist/_dts/theme-core/src/site-styles/rawStyleFields.d.ts +17 -4
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +20 -74
- package/dist/_dts/theme-core/src/site-styles/sectionBoundaryComposition.d.ts +95 -0
- package/dist/_dts/theme-core/src/site-styles/sectionTransitions.d.ts +80 -518
- package/dist/_dts/theme-core/src/site-styles/siteStyleBlockPolicies.d.ts +9 -4
- package/dist/_dts/theme-core/src/site-styles/transitionCatalogue.d.ts +320 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +3 -18
- package/dist/client/{BookingConsentAgreement-DoAILrkN.mjs → BookingConsentAgreement-DlVOmpW4.mjs} +2 -2
- package/dist/client/{DiscountCodeDisclosure-X528hUTf.mjs → DiscountCodeDisclosure-T9q623PQ.mjs} +1 -1
- package/dist/client/{EventCombined.client-DSBVwq5m.mjs → EventCombined.client-DnsUeONl.mjs} +6 -6
- package/dist/client/{EventListing.client-DmFAX7Vb.mjs → EventListing.client-CNBFqJS4.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-BAqXdfhq.mjs → LeafletStaticMap-C7higg52.mjs} +1 -1
- package/dist/client/{ThemedButton-BwNFVwi4.mjs → ThemedButton-LAJTNrS8.mjs} +1 -1
- package/dist/client/{accordion-DRhMdkbd.mjs → accordion-BcNF9TjX.mjs} +1 -1
- package/dist/client/{bookingForm-iJ_nCsNF.mjs → bookingForm-BUaQ3S03.mjs} +142 -50
- package/dist/client/bookings.mjs +191 -64
- package/dist/client/{carousel-D8zuffZr.mjs → carousel-CTdF6e0V.mjs} +1 -1
- package/dist/client/{cart-DeMGJViN.mjs → cart-pGtyf_XU.mjs} +3 -3
- package/dist/client/{checkout-DXc06Km2.mjs → checkout-Da9WSn7Y.mjs} +3 -3
- package/dist/client/client.mjs +1630 -816
- package/dist/client/{context-CDLCfDep.mjs → context-BFeY_Wbm.mjs} +1 -1
- package/dist/client/{dates-ClFx7Epy.mjs → dates-BhwVSxDg.mjs} +2 -2
- package/dist/client/{eventCalendar-BaGpnOGN.mjs → eventCalendar-BAtdnR4s.mjs} +9 -9
- package/dist/client/{eventCombined-ywONOx2m.mjs → eventCombined-RksA3tRC.mjs} +4 -4
- package/dist/client/{eventDetails-B2LlOTYY.mjs → eventDetails-BB9hB4wR.mjs} +4 -4
- package/dist/client/{eventListing-CMgxWpqP.mjs → eventListing-BpJBkviM.mjs} +4 -4
- package/dist/client/{eventRegistration-BarLDNHR.mjs → eventRegistration-B18jFq_o.mjs} +8 -8
- package/dist/client/{form-BjqKaBJ7.mjs → form-Dodt8Y8t.mjs} +3 -3
- package/dist/client/{headerSection-CP4XDwz1.mjs → headerSection-B0qj9ttg.mjs} +3 -3
- package/dist/client/hooks.mjs +550 -99
- package/dist/client/{locationMap-C5gW-d-w.mjs → locationMap-gn-iMk7a.mjs} +3 -3
- package/dist/client/{newsletterForm-afXlVSA0.mjs → newsletterForm-oByLdFkr.mjs} +26 -5
- package/dist/client/{pricing-Bl1CAl28.mjs → pricing-BOU0_Hai.mjs} +1 -1
- package/dist/client/{productDetail-CvQ3jWQe.mjs → productDetail-D9v1zH2j.mjs} +3 -3
- package/dist/client/{productList-U874PGO7.mjs → productList-D-mItx1n.mjs} +3 -3
- package/dist/client/{propsDecoder-DPXtCZWP.mjs → propsDecoder-C3TP_z4x.mjs} +72 -33
- package/dist/client/rendering/client.mjs +900 -266
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +1637 -788
- package/dist/client/{routeIslandApiConfig-NGYiUWXu.mjs → routeIslandApiConfig-DzN1W0sq.mjs} +1 -1
- package/dist/client/{scrollToBlock-0-C3DVhK.mjs → scrollToBlock-CWs8EIdo.mjs} +1 -1
- package/dist/client/{shop-BXjXhM9P.mjs → shop-Dufw7N7o.mjs} +7 -7
- package/dist/client/{shop-commerce-BZ6UlWJ7.mjs → shop-commerce-gklw_hLF.mjs} +6 -6
- package/dist/client/{shop-commerce-store-DlSBXb3D.mjs → shop-commerce-store-Sf1eyTaZ.mjs} +1 -1
- package/dist/client/{shopShared-kkEOiLPA.mjs → shopShared-B5nyA41S.mjs} +4 -4
- package/dist/client/{useEventFilters-zvnnE1ro.mjs → useEventFilters-CLL829vy.mjs} +6 -6
- package/dist/preview-next/before-render.mjs +147 -77
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +147 -77
- package/dist/preview-next/middleware.mjs +147 -77
- package/dist/{previewAuthStore-JA6-I_sL.mjs → previewAuthStore-BxAFlu-j.mjs} +147 -77
- package/dist/{sdk-runtime-DFJlQt3q.mjs → sdk-runtime-D0uZFev7.mjs} +2 -2
- package/dist/{separator-o8GHb1xh.mjs → separator-EvdCAn4V.mjs} +1 -1
- package/dist/server/components.mjs +1727 -991
- package/dist/server/config-validation.mjs +537 -97
- package/dist/server/config.mjs +537 -97
- package/dist/server/data.mjs +549 -98
- package/dist/server/index.mjs +159 -81
- package/dist/server/next.mjs +1460 -748
- package/dist/server/page-converter.mjs +384 -54
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1712 -973
- package/dist/server/rendering.mjs +1748 -1001
- package/dist/server/routing.mjs +624 -131
- package/dist/server/server.mjs +554 -138
- package/dist/server/theme-bridge.mjs +1192 -27
- package/dist/server/theme.mjs +6 -4
- package/package.json +2 -1
|
@@ -314,7 +314,7 @@ function parseEventPageSurfaceDestinationMode(value) {
|
|
|
314
314
|
return value === "cms-managed" || value === "system-managed" ? value : void 0;
|
|
315
315
|
}
|
|
316
316
|
function parseEventPageSurfaceSubject(value) {
|
|
317
|
-
if (!isRecord$
|
|
317
|
+
if (!isRecord$41(value)) return err$3({ kind: "notObject" });
|
|
318
318
|
switch (value.kind) {
|
|
319
319
|
case "eventSeries": {
|
|
320
320
|
const eventSeriesId = parseEventSeriesId(value.eventSeriesId);
|
|
@@ -369,7 +369,7 @@ function parseEventSeriesIdList(values) {
|
|
|
369
369
|
}
|
|
370
370
|
return ok$3(parsed);
|
|
371
371
|
}
|
|
372
|
-
function isRecord$
|
|
372
|
+
function isRecord$41(value) {
|
|
373
373
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
374
374
|
}
|
|
375
375
|
//#endregion
|
|
@@ -595,6 +595,74 @@ function getLocalScheduleDate(date, timeZone) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
//#endregion
|
|
598
|
+
//#region ../core/src/appointment-service-categories.ts
|
|
599
|
+
/**
|
|
600
|
+
* Groups services under their categories.
|
|
601
|
+
*
|
|
602
|
+
* A service whose `categoryId` names no category in `categories` lands in
|
|
603
|
+
* Other. The composite foreign key keeps that from happening with stored data,
|
|
604
|
+
* so this is only the total, safe answer for a caller holding a stale list.
|
|
605
|
+
*/
|
|
606
|
+
function layoutServicesByCategory(categories, services, options) {
|
|
607
|
+
if (categories.length === 0) return {
|
|
608
|
+
kind: "uncategorized-site",
|
|
609
|
+
services: [...services]
|
|
610
|
+
};
|
|
611
|
+
const buckets = new Map(categories.map((category) => [category.id, []]));
|
|
612
|
+
const other = [];
|
|
613
|
+
for (const service of services) {
|
|
614
|
+
const bucket = service.categoryId === null ? void 0 : buckets.get(service.categoryId);
|
|
615
|
+
if (bucket !== void 0) bucket.push(service);
|
|
616
|
+
else other.push(service);
|
|
617
|
+
}
|
|
618
|
+
const groups = [];
|
|
619
|
+
for (const category of categories) {
|
|
620
|
+
const groupServices = buckets.get(category.id) ?? [];
|
|
621
|
+
if (groupServices.length === 0 && !options.keepEmptyGroups) continue;
|
|
622
|
+
groups.push({
|
|
623
|
+
category,
|
|
624
|
+
services: groupServices
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
if (groups.length === 0 && !options.keepEmptyGroups) return {
|
|
628
|
+
kind: "uncategorized-site",
|
|
629
|
+
services: other
|
|
630
|
+
};
|
|
631
|
+
return {
|
|
632
|
+
kind: "categorized-site",
|
|
633
|
+
groups,
|
|
634
|
+
other
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Selects the public view for an optional category filter.
|
|
639
|
+
*
|
|
640
|
+
* It takes the category and service lists rather than a prebuilt layout
|
|
641
|
+
* because the public layout has already dropped empty categories, and then an
|
|
642
|
+
* empty category (`single` with no services) could not be told apart from a
|
|
643
|
+
* deleted one (`fallback-all`).
|
|
644
|
+
*/
|
|
645
|
+
function selectCategoryView(categories, services, filterCategoryId) {
|
|
646
|
+
const publicLayout = () => layoutServicesByCategory(categories, services, { keepEmptyGroups: false });
|
|
647
|
+
if (filterCategoryId === null || filterCategoryId === void 0) return {
|
|
648
|
+
kind: "all",
|
|
649
|
+
layout: publicLayout()
|
|
650
|
+
};
|
|
651
|
+
const category = categories.find((candidate) => candidate.id === filterCategoryId);
|
|
652
|
+
if (category === void 0) return {
|
|
653
|
+
kind: "fallback-all",
|
|
654
|
+
missingCategoryId: filterCategoryId,
|
|
655
|
+
layout: publicLayout()
|
|
656
|
+
};
|
|
657
|
+
return {
|
|
658
|
+
kind: "single",
|
|
659
|
+
group: {
|
|
660
|
+
category,
|
|
661
|
+
services: services.filter((service) => service.categoryId === filterCategoryId)
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
//#endregion
|
|
598
666
|
//#region ../core/src/location.ts
|
|
599
667
|
function normalizeLocationAddressText(value) {
|
|
600
668
|
if (typeof value !== "string") return null;
|
|
@@ -613,7 +681,7 @@ function toLocationCoordinates(value) {
|
|
|
613
681
|
}
|
|
614
682
|
//#endregion
|
|
615
683
|
//#region ../core/src/rich-text.ts
|
|
616
|
-
function isRecord$
|
|
684
|
+
function isRecord$39(value) {
|
|
617
685
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
618
686
|
}
|
|
619
687
|
function hasOnlyKeys(value, allowed) {
|
|
@@ -632,10 +700,10 @@ function isDenseArrayOf(value, predicate) {
|
|
|
632
700
|
return true;
|
|
633
701
|
}
|
|
634
702
|
function isTipTapMark(value) {
|
|
635
|
-
return isRecord$
|
|
703
|
+
return isRecord$39(value) && hasOnlyKeys(value, markKeys) && typeof value.type === "string" && value.type.length > 0 && (value.attrs === void 0 || isRecord$39(value.attrs));
|
|
636
704
|
}
|
|
637
705
|
function isTipTapNode(value) {
|
|
638
|
-
if (!isRecord$
|
|
706
|
+
if (!isRecord$39(value) || !hasOnlyKeys(value, nodeKeys) || typeof value.type !== "string" || value.type.length === 0 || value.type === "doc" || value.attrs !== void 0 && !isRecord$39(value.attrs) || value.marks !== void 0 && (!Array.isArray(value.marks) || !isDenseArrayOf(value.marks, isTipTapMark)) || value.content !== void 0 && (!Array.isArray(value.content) || !isDenseArrayOf(value.content, isTipTapNode))) return false;
|
|
639
707
|
if (value.type === "text") return typeof value.text === "string" && value.text.length > 0 && value.content === void 0;
|
|
640
708
|
return value.text === void 0;
|
|
641
709
|
}
|
|
@@ -672,10 +740,10 @@ function parseBrevoListId(value) {
|
|
|
672
740
|
//#endregion
|
|
673
741
|
//#region ../core/src/mailing-list-targeting-parser.ts
|
|
674
742
|
function parseMailingListPlacementTargeting(value) {
|
|
675
|
-
if (!isRecord$
|
|
743
|
+
if (!isRecord$38(value)) return targetingError("shape");
|
|
676
744
|
if (value.mode === "default") return ok$3({ mode: "default" });
|
|
677
745
|
if (value.mode !== "custom") return targetingError("mode");
|
|
678
|
-
if (!isRecord$
|
|
746
|
+
if (!isRecord$38(value.selection)) return targetingError("selection");
|
|
679
747
|
switch (value.provider) {
|
|
680
748
|
case "native": return parseNativeTargeting(value.selection);
|
|
681
749
|
case "brevo": return parseBrevoTargeting(value.selection);
|
|
@@ -779,7 +847,7 @@ function parseUniqueIds(value, parseId) {
|
|
|
779
847
|
}
|
|
780
848
|
return ok$3(parsed);
|
|
781
849
|
}
|
|
782
|
-
function isRecord$
|
|
850
|
+
function isRecord$38(value) {
|
|
783
851
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
784
852
|
}
|
|
785
853
|
function targetingError(field) {
|
|
@@ -802,12 +870,12 @@ new Map([
|
|
|
802
870
|
].map((kind, index) => [kind, index]));
|
|
803
871
|
//#endregion
|
|
804
872
|
//#region ../core/src/mailing-list-setup.ts
|
|
805
|
-
function isRecord$
|
|
873
|
+
function isRecord$35(value) {
|
|
806
874
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
807
875
|
}
|
|
808
876
|
const DEFAULT_MAILING_LIST_SUCCESS_MESSAGE = "Thanks — you're on the list.";
|
|
809
877
|
function parseMailingListProviderScope(value) {
|
|
810
|
-
if (!isRecord$
|
|
878
|
+
if (!isRecord$35(value)) return err$3("invalid_mailing_list_provider_scope");
|
|
811
879
|
if (value.provider === "native") return ok$3({ provider: "native" });
|
|
812
880
|
if (value.provider === "brevo") {
|
|
813
881
|
const accountId = parseBrevoAccountId(value.accountId);
|
|
@@ -828,7 +896,7 @@ function parseMailingListProviderScope(value) {
|
|
|
828
896
|
//#endregion
|
|
829
897
|
//#region ../core/src/mailing-list-setup-parser.ts
|
|
830
898
|
function parseMailingListGlobalForm(value) {
|
|
831
|
-
if (!isRecord$
|
|
899
|
+
if (!isRecord$34(value)) return formError("shape");
|
|
832
900
|
const fields = parseGlobalFields(value.fields);
|
|
833
901
|
if (fields === null) return formError("fields");
|
|
834
902
|
if (typeof value.includeOptionalPhone !== "boolean") return formError("includeOptionalPhone");
|
|
@@ -847,7 +915,7 @@ function parseMailingListGlobalForm(value) {
|
|
|
847
915
|
});
|
|
848
916
|
}
|
|
849
917
|
function parseGlobalFields(value) {
|
|
850
|
-
if (!isRecord$
|
|
918
|
+
if (!isRecord$34(value) || typeof value.preset !== "string") return null;
|
|
851
919
|
switch (value.preset) {
|
|
852
920
|
case "emailOnly": return { preset: "emailOnly" };
|
|
853
921
|
case "emailName": return isRequirement(value.name) ? {
|
|
@@ -884,7 +952,7 @@ function parseOptionalString(value) {
|
|
|
884
952
|
function isRequirement(value) {
|
|
885
953
|
return value === "required" || value === "optional";
|
|
886
954
|
}
|
|
887
|
-
function isRecord$
|
|
955
|
+
function isRecord$34(value) {
|
|
888
956
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
889
957
|
}
|
|
890
958
|
function formError(field) {
|
|
@@ -934,7 +1002,7 @@ function planMailingListChoicePresentation(targeting) {
|
|
|
934
1002
|
//#endregion
|
|
935
1003
|
//#region ../core/src/mailing-list-runtime.ts
|
|
936
1004
|
function parseMailingListRuntimeContext(value) {
|
|
937
|
-
if (!isRecord$
|
|
1005
|
+
if (!isRecord$33(value)) return invalidRuntimeContext();
|
|
938
1006
|
if (value.tag === "not_configured") return ok$3({ tag: "not_configured" });
|
|
939
1007
|
if (value.tag !== "configured") return invalidRuntimeContext();
|
|
940
1008
|
const revision = parseMailingListSetupRevision(value.revision);
|
|
@@ -949,7 +1017,7 @@ function parseMailingListRuntimeContext(value) {
|
|
|
949
1017
|
});
|
|
950
1018
|
}
|
|
951
1019
|
function parseRuntimeProvider(value) {
|
|
952
|
-
if (!isRecord$
|
|
1020
|
+
if (!isRecord$33(value)) return null;
|
|
953
1021
|
switch (value.provider) {
|
|
954
1022
|
case "native": return parseNativeRuntimeProvider(value);
|
|
955
1023
|
case "brevo": return parseBrevoRuntimeProvider(value);
|
|
@@ -981,7 +1049,7 @@ function parseMailchimpRuntimeProvider(value) {
|
|
|
981
1049
|
if (defaultAudienceId === null) return null;
|
|
982
1050
|
const audiences = [];
|
|
983
1051
|
for (const audience of value.audiences) {
|
|
984
|
-
if (!isRecord$
|
|
1052
|
+
if (!isRecord$33(audience)) return null;
|
|
985
1053
|
const id = parseMailchimpAudienceId$1(audience.id);
|
|
986
1054
|
const name = parseName(audience.name);
|
|
987
1055
|
if (id === null || name === null || !Array.isArray(audience.interests)) return null;
|
|
@@ -1002,7 +1070,7 @@ function parseMailchimpRuntimeProvider(value) {
|
|
|
1002
1070
|
function parseMailchimpInterests(value) {
|
|
1003
1071
|
const interests = [];
|
|
1004
1072
|
for (const interest of value) {
|
|
1005
|
-
if (!isRecord$
|
|
1073
|
+
if (!isRecord$33(interest)) return null;
|
|
1006
1074
|
const id = parseMailchimpInterestId(interest.id);
|
|
1007
1075
|
const name = parseName(interest.name);
|
|
1008
1076
|
const categoryName = parseName(interest.categoryName);
|
|
@@ -1019,7 +1087,7 @@ function parseNamedItems(value, parseId) {
|
|
|
1019
1087
|
if (!Array.isArray(value)) return null;
|
|
1020
1088
|
const items = [];
|
|
1021
1089
|
for (const item of value) {
|
|
1022
|
-
if (!isRecord$
|
|
1090
|
+
if (!isRecord$33(item)) return null;
|
|
1023
1091
|
const id = parseId(item.id);
|
|
1024
1092
|
const name = parseName(item.name);
|
|
1025
1093
|
if (id === null || name === null) return null;
|
|
@@ -1035,7 +1103,7 @@ function parseName(value) {
|
|
|
1035
1103
|
const name = value.trim();
|
|
1036
1104
|
return name.length > 0 ? name : null;
|
|
1037
1105
|
}
|
|
1038
|
-
function isRecord$
|
|
1106
|
+
function isRecord$33(value) {
|
|
1039
1107
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1040
1108
|
}
|
|
1041
1109
|
function invalidRuntimeContext() {
|
|
@@ -1595,11 +1663,11 @@ function parseRelativeStoragePath(value) {
|
|
|
1595
1663
|
}
|
|
1596
1664
|
//#endregion
|
|
1597
1665
|
//#region ../media-core/src/typeGuards.ts
|
|
1598
|
-
function isRecord$
|
|
1666
|
+
function isRecord$31(value) {
|
|
1599
1667
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1600
1668
|
}
|
|
1601
1669
|
function asRecord$3(value) {
|
|
1602
|
-
return isRecord$
|
|
1670
|
+
return isRecord$31(value) ? value : void 0;
|
|
1603
1671
|
}
|
|
1604
1672
|
function isFileJsonObject(value) {
|
|
1605
1673
|
return Object.values(value).every(isFileJsonValue);
|
|
@@ -1608,7 +1676,7 @@ function isFileJsonValue(value) {
|
|
|
1608
1676
|
if (value === null || typeof value === "string" || typeof value === "boolean") return true;
|
|
1609
1677
|
if (typeof value === "number") return Number.isFinite(value);
|
|
1610
1678
|
if (Array.isArray(value)) return value.every(isFileJsonValue);
|
|
1611
|
-
return isRecord$
|
|
1679
|
+
return isRecord$31(value) && isFileJsonObject(value);
|
|
1612
1680
|
}
|
|
1613
1681
|
new TextDecoder("latin1");
|
|
1614
1682
|
//#endregion
|
|
@@ -1867,7 +1935,7 @@ function isCmsMediaObjectType(value) {
|
|
|
1867
1935
|
return typeof value === "string" && CMS_MEDIA_OBJECT_TYPES.includes(value);
|
|
1868
1936
|
}
|
|
1869
1937
|
function isCmsMediaObject(value) {
|
|
1870
|
-
if (!isRecord$
|
|
1938
|
+
if (!isRecord$31(value)) return false;
|
|
1871
1939
|
const type = value.type;
|
|
1872
1940
|
if (!isCmsMediaObjectType(type)) return false;
|
|
1873
1941
|
if ("attrs" in value) return false;
|
|
@@ -1878,7 +1946,7 @@ function collectMediaObjects(value, out, location = "") {
|
|
|
1878
1946
|
value.forEach((item, index) => collectMediaObjects(item, out, `${location}[${index}]`));
|
|
1879
1947
|
return;
|
|
1880
1948
|
}
|
|
1881
|
-
if (!isRecord$
|
|
1949
|
+
if (!isRecord$31(value)) return;
|
|
1882
1950
|
if (isCmsMediaObject(value)) out.push({
|
|
1883
1951
|
obj: value,
|
|
1884
1952
|
location
|
|
@@ -1904,8 +1972,8 @@ function walkAndCollectImageAttrs(value, out, location = "") {
|
|
|
1904
1972
|
value.forEach((item, index) => walkAndCollectImageAttrs(item, out, `${location}[${index}]`));
|
|
1905
1973
|
return;
|
|
1906
1974
|
}
|
|
1907
|
-
if (!isRecord$
|
|
1908
|
-
if (value.type === "image" && isRecord$
|
|
1975
|
+
if (!isRecord$31(value)) return;
|
|
1976
|
+
if (value.type === "image" && isRecord$31(value.attrs)) out.push({
|
|
1909
1977
|
attrs: value.attrs,
|
|
1910
1978
|
location: location ? `${location}.attrs` : "attrs"
|
|
1911
1979
|
});
|
|
@@ -1952,7 +2020,7 @@ function mediaIdentifierOrFallback(current, fallback) {
|
|
|
1952
2020
|
}
|
|
1953
2021
|
//#endregion
|
|
1954
2022
|
//#region ../media-core/src/contentMediaAudit.ts
|
|
1955
|
-
function isRecord$
|
|
2023
|
+
function isRecord$30(value) {
|
|
1956
2024
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1957
2025
|
}
|
|
1958
2026
|
function summarizeContentMediaValue(value) {
|
|
@@ -1963,7 +2031,7 @@ function summarizeContentMediaValue(value) {
|
|
|
1963
2031
|
}
|
|
1964
2032
|
if (value === null) return "null";
|
|
1965
2033
|
if (Array.isArray(value)) return `array(${value.length})`;
|
|
1966
|
-
if (isRecord$
|
|
2034
|
+
if (isRecord$30(value)) return `object(${Object.keys(value).sort().join(",")})`;
|
|
1967
2035
|
return typeof value;
|
|
1968
2036
|
}
|
|
1969
2037
|
function auditMediaValue(context, path, allowedMediaTypes, value) {
|
|
@@ -1987,9 +2055,9 @@ function auditMediaValue(context, path, allowedMediaTypes, value) {
|
|
|
1987
2055
|
allowedMediaTypes
|
|
1988
2056
|
}];
|
|
1989
2057
|
}
|
|
1990
|
-
const hasValidIdentifier = isRecord$
|
|
1991
|
-
const hasValidExplicitType = isRecord$
|
|
1992
|
-
const hasRetiredEnvironmentField = isRecord$
|
|
2058
|
+
const hasValidIdentifier = isRecord$30(value) && typeof value.identifier === "string" && value.identifier.trim().length > 0;
|
|
2059
|
+
const hasValidExplicitType = isRecord$30(value) && (!("type" in value) || typeof value.type === "string" && allowedMediaTypes.includes(value.type));
|
|
2060
|
+
const hasRetiredEnvironmentField = isRecord$30(value) && ("assetId" in value || "storagePath" in value || "storageBucket" in value || "src" in value || "mimeType" in value || looksLikeUuid(value.id));
|
|
1993
2061
|
if (hasValidIdentifier && hasValidExplicitType && !hasRetiredEnvironmentField) return [];
|
|
1994
2062
|
return [{
|
|
1995
2063
|
tag: "malformed-object",
|
|
@@ -2000,7 +2068,7 @@ function auditMediaValue(context, path, allowedMediaTypes, value) {
|
|
|
2000
2068
|
}];
|
|
2001
2069
|
}
|
|
2002
2070
|
function auditFields(context, fields, value, parentPath) {
|
|
2003
|
-
if (!isRecord$
|
|
2071
|
+
if (!isRecord$30(value)) return [];
|
|
2004
2072
|
const findings = [];
|
|
2005
2073
|
for (const field of fields) {
|
|
2006
2074
|
if (!(field.id in value)) continue;
|
|
@@ -2017,7 +2085,7 @@ function auditFields(context, fields, value, parentPath) {
|
|
|
2017
2085
|
if (!Array.isArray(fieldValue)) break;
|
|
2018
2086
|
for (const [index, item] of fieldValue.entries()) {
|
|
2019
2087
|
const itemPath = [...fieldPath, index];
|
|
2020
|
-
if (!isRecord$
|
|
2088
|
+
if (!isRecord$30(item)) {
|
|
2021
2089
|
findings.push({
|
|
2022
2090
|
tag: "missing-schema",
|
|
2023
2091
|
context,
|
|
@@ -2056,7 +2124,7 @@ const contentMediaTypes = /* @__PURE__ */ new Set([
|
|
|
2056
2124
|
"spreadsheet",
|
|
2057
2125
|
"archive"
|
|
2058
2126
|
]);
|
|
2059
|
-
function isRecord$
|
|
2127
|
+
function isRecord$29(value) {
|
|
2060
2128
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2061
2129
|
}
|
|
2062
2130
|
function unknownArray(value) {
|
|
@@ -2065,7 +2133,7 @@ function unknownArray(value) {
|
|
|
2065
2133
|
function fieldsArray(value) {
|
|
2066
2134
|
const directFields = unknownArray(value);
|
|
2067
2135
|
if (directFields) return directFields;
|
|
2068
|
-
if (!isRecord$
|
|
2136
|
+
if (!isRecord$29(value)) return null;
|
|
2069
2137
|
return unknownArray(value.fields);
|
|
2070
2138
|
}
|
|
2071
2139
|
function nestedFields$1(field) {
|
|
@@ -2130,7 +2198,7 @@ function mergeFields(fields) {
|
|
|
2130
2198
|
}
|
|
2131
2199
|
function adaptFields(rawFields, flattenRepeaterGroups = false, defaultFileKinds = ["document"]) {
|
|
2132
2200
|
return mergeFields(rawFields.flatMap((rawField) => {
|
|
2133
|
-
if (!isRecord$
|
|
2201
|
+
if (!isRecord$29(rawField)) return [];
|
|
2134
2202
|
const { id, type } = rawField;
|
|
2135
2203
|
if (typeof id !== "string" || !id || typeof type !== "string") return [];
|
|
2136
2204
|
if (type === "media" || type === "file") return [{
|
|
@@ -2138,7 +2206,7 @@ function adaptFields(rawFields, flattenRepeaterGroups = false, defaultFileKinds
|
|
|
2138
2206
|
id,
|
|
2139
2207
|
allowedMediaTypes: allowedMediaTypes(rawField, type, defaultFileKinds)
|
|
2140
2208
|
}];
|
|
2141
|
-
if (flattenRepeaterGroups && type === "group" && isRecord$
|
|
2209
|
+
if (flattenRepeaterGroups && type === "group" && isRecord$29(rawField.ui) && rawField.ui.flattenInRepeater === true) return adaptFields(nestedFields$1(rawField), false, defaultFileKinds);
|
|
2142
2210
|
if (type === "group" || type === "modal") return [{
|
|
2143
2211
|
kind: "object",
|
|
2144
2212
|
id,
|
|
@@ -2147,14 +2215,14 @@ function adaptFields(rawFields, flattenRepeaterGroups = false, defaultFileKinds
|
|
|
2147
2215
|
if (type === "tabGroup") return [{
|
|
2148
2216
|
kind: "object",
|
|
2149
2217
|
id,
|
|
2150
|
-
fields: adaptFields((unknownArray(rawField.tabs) ?? []).flatMap((tab) => isRecord$
|
|
2218
|
+
fields: adaptFields((unknownArray(rawField.tabs) ?? []).flatMap((tab) => isRecord$29(tab) ? unknownArray(tab.fields) ?? [] : []), false, defaultFileKinds)
|
|
2151
2219
|
}];
|
|
2152
2220
|
if (type !== "repeater") return [];
|
|
2153
|
-
if (isRecord$
|
|
2221
|
+
if (isRecord$29(rawField.itemTypes)) return [{
|
|
2154
2222
|
kind: "repeater",
|
|
2155
2223
|
id,
|
|
2156
2224
|
mode: "variants",
|
|
2157
|
-
variants: Object.entries(rawField.itemTypes).flatMap(([typeId, itemType]) => isRecord$
|
|
2225
|
+
variants: Object.entries(rawField.itemTypes).flatMap(([typeId, itemType]) => isRecord$29(itemType) && Array.isArray(itemType.fields) ? [{
|
|
2158
2226
|
typeId,
|
|
2159
2227
|
fields: adaptFields(itemType.fields, true, defaultFileKinds)
|
|
2160
2228
|
}] : []),
|
|
@@ -2463,7 +2531,8 @@ const siteOptionSources = [
|
|
|
2463
2531
|
"eventCategories",
|
|
2464
2532
|
"eventSeries",
|
|
2465
2533
|
"venues",
|
|
2466
|
-
"staffMembers"
|
|
2534
|
+
"staffMembers",
|
|
2535
|
+
"appointmentServiceCategories"
|
|
2467
2536
|
];
|
|
2468
2537
|
const mediaDeliverySchema = z$1.object({
|
|
2469
2538
|
sizes: z$1.string().optional(),
|
|
@@ -5629,6 +5698,15 @@ function asSiteStyleId(value) {
|
|
|
5629
5698
|
function asDesignSystemTemplateId(value) {
|
|
5630
5699
|
return brandNonEmptyString(value, "DesignSystemTemplateId");
|
|
5631
5700
|
}
|
|
5701
|
+
function toNonEmptyReadonlyArray(values) {
|
|
5702
|
+
const [first, ...rest] = values;
|
|
5703
|
+
return first === void 0 ? null : [first, ...rest];
|
|
5704
|
+
}
|
|
5705
|
+
function requireNonEmptyReadonlyArray(values, message = "Expected a non-empty array.") {
|
|
5706
|
+
const result = toNonEmptyReadonlyArray(values);
|
|
5707
|
+
if (!result) throw new Error(message);
|
|
5708
|
+
return result;
|
|
5709
|
+
}
|
|
5632
5710
|
function makeBoundaryId(previousBlockId, nextBlockId) {
|
|
5633
5711
|
return asDesignBoundaryId(`boundary:${encodeURIComponent(previousBlockId)}:${encodeURIComponent(nextBlockId)}`);
|
|
5634
5712
|
}
|
|
@@ -7293,12 +7371,577 @@ function cardRoleFromLegacyVocabulary(value) {
|
|
|
7293
7371
|
* the role they meant, everything else fails the parse.
|
|
7294
7372
|
*/
|
|
7295
7373
|
const cardRoleWithLegacyAliasSchema = z$1.preprocess((value) => cardRoleFromLegacyVocabulary(value) ?? value, cardRoleSchema);
|
|
7374
|
+
const hotspotSchema = z$1.object({
|
|
7375
|
+
x: z$1.number().min(0).max(1),
|
|
7376
|
+
y: z$1.number().min(0).max(1),
|
|
7377
|
+
radius: z$1.number().optional()
|
|
7378
|
+
});
|
|
7379
|
+
const rotationSchema = z$1.union([
|
|
7380
|
+
z$1.literal(0),
|
|
7381
|
+
z$1.literal(90),
|
|
7382
|
+
z$1.literal(180),
|
|
7383
|
+
z$1.literal(270)
|
|
7384
|
+
]);
|
|
7385
|
+
const rectSchema = z$1.tuple([
|
|
7386
|
+
z$1.number(),
|
|
7387
|
+
z$1.number(),
|
|
7388
|
+
z$1.number(),
|
|
7389
|
+
z$1.number()
|
|
7390
|
+
]);
|
|
7391
|
+
const aspectCropSchema = z$1.object({
|
|
7392
|
+
aspect: z$1.preprocess((value) => value == null ? void 0 : value, z$1.string().optional()),
|
|
7393
|
+
rect: z$1.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
7394
|
+
hotspot: z$1.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
7395
|
+
rotation: z$1.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
7396
|
+
});
|
|
7397
|
+
const transformSchema = z$1.object({
|
|
7398
|
+
aspectCrops: z$1.preprocess((value) => {
|
|
7399
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
7400
|
+
return value;
|
|
7401
|
+
}, z$1.record(z$1.string(), aspectCropSchema.catch({}))).optional(),
|
|
7402
|
+
rect: rectSchema.optional(),
|
|
7403
|
+
hotspot: hotspotSchema.optional(),
|
|
7404
|
+
rotation: rotationSchema.optional()
|
|
7405
|
+
});
|
|
7406
|
+
const mediaPosterSchema = z$1.discriminatedUnion("tag", [z$1.object({
|
|
7407
|
+
tag: z$1.literal("storage"),
|
|
7408
|
+
assetId: z$1.string().optional(),
|
|
7409
|
+
storageBucket: z$1.string().min(1),
|
|
7410
|
+
storagePath: z$1.string().min(1)
|
|
7411
|
+
}), z$1.object({
|
|
7412
|
+
tag: z$1.literal("external-src"),
|
|
7413
|
+
assetId: z$1.string().optional(),
|
|
7414
|
+
src: z$1.string().url()
|
|
7415
|
+
})]);
|
|
7416
|
+
const mediaBaseSchema = z$1.object({
|
|
7417
|
+
purpose: z$1.string().optional(),
|
|
7418
|
+
placeholder: z$1.boolean().default(true).optional(),
|
|
7419
|
+
assetId: z$1.string().optional(),
|
|
7420
|
+
identifier: z$1.string().optional(),
|
|
7421
|
+
src: z$1.string().optional(),
|
|
7422
|
+
alt: z$1.string().optional(),
|
|
7423
|
+
filename: z$1.string().optional(),
|
|
7424
|
+
mimeType: z$1.string().optional(),
|
|
7425
|
+
width: z$1.number().optional(),
|
|
7426
|
+
height: z$1.number().optional(),
|
|
7427
|
+
storageBucket: z$1.string().optional(),
|
|
7428
|
+
storagePath: z$1.string().optional(),
|
|
7429
|
+
poster: mediaPosterSchema.optional(),
|
|
7430
|
+
transform: transformSchema.optional()
|
|
7431
|
+
});
|
|
7432
|
+
const mediaIdentifierSchema = z$1.string().trim().min(1).brand();
|
|
7433
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("image") });
|
|
7434
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("video") });
|
|
7435
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("audio") });
|
|
7436
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("document") });
|
|
7437
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("spreadsheet") });
|
|
7438
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("archive") });
|
|
7439
|
+
const mediaSchema = z$1.discriminatedUnion("type", [
|
|
7440
|
+
imageMediaSchema,
|
|
7441
|
+
videoMediaSchema,
|
|
7442
|
+
audioMediaSchema,
|
|
7443
|
+
documentMediaSchema,
|
|
7444
|
+
spreadsheetMediaSchema,
|
|
7445
|
+
archiveMediaSchema
|
|
7446
|
+
]);
|
|
7447
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
7448
|
+
z$1.discriminatedUnion("type", [
|
|
7449
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("image") }),
|
|
7450
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("video") }),
|
|
7451
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("audio") }),
|
|
7452
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("document") }),
|
|
7453
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("spreadsheet") }),
|
|
7454
|
+
persistableMediaBaseSchema.extend({ type: z$1.literal("archive") })
|
|
7455
|
+
]);
|
|
7296
7456
|
//#endregion
|
|
7297
|
-
//#region ../theme-core/src/site-styles/
|
|
7298
|
-
const
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7457
|
+
//#region ../theme-core/src/site-styles/rawStyleFields.ts
|
|
7458
|
+
const themeV2RuntimeStyleFieldNames = [
|
|
7459
|
+
"_frameStyles",
|
|
7460
|
+
"_sectionStyles",
|
|
7461
|
+
"_containerStyles",
|
|
7462
|
+
"_cardStyles"
|
|
7463
|
+
];
|
|
7464
|
+
const themeV2BlockSpecificRawStyleFieldNames = [
|
|
7465
|
+
"_contentCardStyles",
|
|
7466
|
+
"_heroLayoutStyles",
|
|
7467
|
+
"_textCardStyles"
|
|
7468
|
+
];
|
|
7469
|
+
const themeV2NormalEditorRawStyleFieldNames = [
|
|
7470
|
+
...themeV2RuntimeStyleFieldNames,
|
|
7471
|
+
...themeV2BlockSpecificRawStyleFieldNames,
|
|
7472
|
+
"styleGroup"
|
|
7473
|
+
];
|
|
7474
|
+
new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
7475
|
+
[...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
7476
|
+
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
7477
|
+
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
7478
|
+
const staleTransitionStyleGroupPrefix = "site-style-transition-";
|
|
7479
|
+
/**
|
|
7480
|
+
* A `styleGroup` in the retired `site-style-transition-*` namespace is residue
|
|
7481
|
+
* from the old per-block transition path (issue 1422). Any other value is
|
|
7482
|
+
* authored and must survive.
|
|
7483
|
+
*/
|
|
7484
|
+
function isStaleTransitionStyleGroup(value) {
|
|
7485
|
+
return typeof value === "string" && value.startsWith(staleTransitionStyleGroupPrefix);
|
|
7486
|
+
}
|
|
7487
|
+
/** Drops a stale transition `styleGroup`, leaving authored values untouched. */
|
|
7488
|
+
function stripStaleTransitionStyleGroup(content) {
|
|
7489
|
+
if (!isStaleTransitionStyleGroup(content.styleGroup)) return { ...content };
|
|
7490
|
+
const { styleGroup: _stale, ...rest } = content;
|
|
7491
|
+
return rest;
|
|
7492
|
+
}
|
|
7493
|
+
//#endregion
|
|
7494
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
7495
|
+
/**
|
|
7496
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
7497
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
7498
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
7499
|
+
*/
|
|
7500
|
+
const tokenOrCssColorValueSchema = z$1.string();
|
|
7501
|
+
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
7502
|
+
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
7503
|
+
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
7504
|
+
"transparent",
|
|
7505
|
+
"currentcolor",
|
|
7506
|
+
"inherit",
|
|
7507
|
+
"initial",
|
|
7508
|
+
"revert",
|
|
7509
|
+
"revert-layer",
|
|
7510
|
+
"unset"
|
|
7511
|
+
]);
|
|
7512
|
+
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
7513
|
+
"black",
|
|
7514
|
+
"blue",
|
|
7515
|
+
"gray",
|
|
7516
|
+
"green",
|
|
7517
|
+
"grey",
|
|
7518
|
+
"orange",
|
|
7519
|
+
"pink",
|
|
7520
|
+
"purple",
|
|
7521
|
+
"red",
|
|
7522
|
+
"white",
|
|
7523
|
+
"yellow"
|
|
7524
|
+
]);
|
|
7525
|
+
function isCssColorLiteral(value) {
|
|
7526
|
+
const trimmed = value.trim();
|
|
7527
|
+
if (!trimmed) return false;
|
|
7528
|
+
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
7529
|
+
}
|
|
7530
|
+
function parseThemeToken(token) {
|
|
7531
|
+
const trimmed = token.trim();
|
|
7532
|
+
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
7533
|
+
if (!match) return {
|
|
7534
|
+
role: trimmed,
|
|
7535
|
+
shade: null
|
|
7536
|
+
};
|
|
7537
|
+
const role = match[1] ?? trimmed;
|
|
7538
|
+
const shade = match[2] ? Number(match[2]) : null;
|
|
7539
|
+
return {
|
|
7540
|
+
role,
|
|
7541
|
+
shade: Number.isFinite(shade) ? shade : null
|
|
7542
|
+
};
|
|
7543
|
+
}
|
|
7544
|
+
function parseContextThemeColorToken(value, context) {
|
|
7545
|
+
const parts = parseColorTokenParts(value);
|
|
7546
|
+
if (parts.kind !== "token") return null;
|
|
7547
|
+
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
7548
|
+
return value.trim();
|
|
7549
|
+
}
|
|
7550
|
+
function isTokenShapedTypo(value) {
|
|
7551
|
+
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
7552
|
+
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
7553
|
+
return !isCssColorLiteral(value);
|
|
7554
|
+
}
|
|
7555
|
+
function warnUnknownThemeColorReference(value) {
|
|
7556
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") return;
|
|
7557
|
+
if (!isTokenShapedTypo(value)) return;
|
|
7558
|
+
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
7559
|
+
}
|
|
7560
|
+
function parseThemeColorReference(input, context) {
|
|
7561
|
+
const trimmed = input.trim();
|
|
7562
|
+
if (trimmed.startsWith("raw:")) return {
|
|
7563
|
+
kind: "literal-css",
|
|
7564
|
+
value: trimmed.slice(4)
|
|
7565
|
+
};
|
|
7566
|
+
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
7567
|
+
if (contextToken) return {
|
|
7568
|
+
kind: "palette-context-token",
|
|
7569
|
+
token: contextToken
|
|
7570
|
+
};
|
|
7571
|
+
const knownToken = parseThemeColorToken(trimmed);
|
|
7572
|
+
if (knownToken) return {
|
|
7573
|
+
kind: "theme-token",
|
|
7574
|
+
token: knownToken
|
|
7575
|
+
};
|
|
7576
|
+
warnUnknownThemeColorReference(trimmed);
|
|
7577
|
+
return {
|
|
7578
|
+
kind: "literal-css",
|
|
7579
|
+
value: trimmed
|
|
7580
|
+
};
|
|
7581
|
+
}
|
|
7582
|
+
function resolveThemeColorReferenceValue(input, context) {
|
|
7583
|
+
const reference = parseThemeColorReference(input, context);
|
|
7584
|
+
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
7585
|
+
}
|
|
7586
|
+
function resolveTokenOrCssColorValue(input, context) {
|
|
7587
|
+
return resolveThemeColorReferenceValue(input, context);
|
|
7588
|
+
}
|
|
7589
|
+
function resolveOnColorForThemeToken(token) {
|
|
7590
|
+
if (!parseThemeColorToken(token)) return null;
|
|
7591
|
+
const parts = parseColorTokenParts(token);
|
|
7592
|
+
if (parts.kind !== "token") return null;
|
|
7593
|
+
const { role, shade } = parseThemeToken(parts.token);
|
|
7594
|
+
const normalizedRole = role.trim();
|
|
7595
|
+
if (!normalizedRole) return null;
|
|
7596
|
+
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
7597
|
+
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
7598
|
+
}
|
|
7599
|
+
//#endregion
|
|
7600
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
7601
|
+
const boxBackgroundOverlaySchema = z$1.preprocess(normalizeAuthoringOpacity, z$1.discriminatedUnion("type", [
|
|
7602
|
+
z$1.object({ type: z$1.literal("none") }),
|
|
7603
|
+
z$1.object({
|
|
7604
|
+
type: z$1.literal("color"),
|
|
7605
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
7606
|
+
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
7607
|
+
}),
|
|
7608
|
+
z$1.object({
|
|
7609
|
+
type: z$1.literal("gradient"),
|
|
7610
|
+
gradient: z$1.string().nullable().optional(),
|
|
7611
|
+
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
7612
|
+
})
|
|
7613
|
+
]));
|
|
7614
|
+
const commonSchema = z$1.object({
|
|
7615
|
+
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
7616
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
7617
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
7618
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
7619
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
7620
|
+
});
|
|
7621
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
7622
|
+
opacity: z$1.preprocess(normalizeOpacity, z$1.number().min(0).max(1).nullable()).optional(),
|
|
7623
|
+
objectFit: z$1.enum([
|
|
7624
|
+
"fill",
|
|
7625
|
+
"fit",
|
|
7626
|
+
"original",
|
|
7627
|
+
"custom"
|
|
7628
|
+
]).nullable().optional(),
|
|
7629
|
+
scale: z$1.string().nullable().optional(),
|
|
7630
|
+
position: z$1.string().nullable().optional(),
|
|
7631
|
+
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
7632
|
+
overflow: z$1.boolean().nullable().optional(),
|
|
7633
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
7634
|
+
});
|
|
7635
|
+
const boxBackgroundSchema = z$1.discriminatedUnion("type", [
|
|
7636
|
+
commonSchema.extend({
|
|
7637
|
+
type: z$1.literal("color"),
|
|
7638
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
7639
|
+
}),
|
|
7640
|
+
commonSchema.extend({
|
|
7641
|
+
type: z$1.literal("gradient"),
|
|
7642
|
+
gradient: z$1.string().nullable().optional(),
|
|
7643
|
+
gradientPresetId: z$1.string().min(1).nullable().optional()
|
|
7644
|
+
}),
|
|
7645
|
+
mediaPresentationSchema.extend({
|
|
7646
|
+
type: z$1.literal("image"),
|
|
7647
|
+
image: imageMediaSchema.nullable().optional()
|
|
7648
|
+
}),
|
|
7649
|
+
mediaPresentationSchema.extend({
|
|
7650
|
+
type: z$1.literal("video"),
|
|
7651
|
+
image: videoMediaSchema.nullable().optional(),
|
|
7652
|
+
showVideoOnMobile: z$1.boolean().nullable().optional()
|
|
7653
|
+
})
|
|
7654
|
+
]);
|
|
7655
|
+
function normalizeAuthoringOpacity(value) {
|
|
7656
|
+
if (!isRecord$28(value)) return value;
|
|
7657
|
+
return {
|
|
7658
|
+
...value,
|
|
7659
|
+
opacity: normalizeOpacity(value.opacity)
|
|
7660
|
+
};
|
|
7661
|
+
}
|
|
7662
|
+
function normalizeOpacity(value) {
|
|
7663
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
7664
|
+
}
|
|
7665
|
+
function isRecord$28(value) {
|
|
7666
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7667
|
+
}
|
|
7668
|
+
//#endregion
|
|
7669
|
+
//#region ../theme-core/src/site-styles/runtimeBackgroundResolution.ts
|
|
7670
|
+
function parseCanonicalRuntimeBackground(content) {
|
|
7671
|
+
const background = readRecord(readRecord(content._sectionStyles)?.background);
|
|
7672
|
+
if (!background) return { kind: "none" };
|
|
7673
|
+
const parsed = boxBackgroundSchema.safeParse(background);
|
|
7674
|
+
if (!parsed.success) return { kind: "none" };
|
|
7675
|
+
return parsed.data.contentOwner === "page-design-editor" ? {
|
|
7676
|
+
kind: "page-design-override",
|
|
7677
|
+
background: parsed.data
|
|
7678
|
+
} : {
|
|
7679
|
+
kind: "block-authored",
|
|
7680
|
+
background: parsed.data
|
|
7681
|
+
};
|
|
7682
|
+
}
|
|
7683
|
+
function readRecord(value) {
|
|
7684
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
7685
|
+
}
|
|
7686
|
+
//#endregion
|
|
7687
|
+
//#region ../theme-core/src/site-styles/transitionCatalogue.ts
|
|
7688
|
+
/**
|
|
7689
|
+
* Family order for pickers. Entries below are listed family by family in this
|
|
7690
|
+
* same order, so the flat option list and the grouped families agree.
|
|
7691
|
+
*/
|
|
7692
|
+
const transitionCatalogueFamilies = [
|
|
7693
|
+
{
|
|
7694
|
+
id: "gradient",
|
|
7695
|
+
label: "Gradient"
|
|
7696
|
+
},
|
|
7697
|
+
{
|
|
7698
|
+
id: "wave",
|
|
7699
|
+
label: "Wave"
|
|
7700
|
+
},
|
|
7701
|
+
{
|
|
7702
|
+
id: "angle",
|
|
7703
|
+
label: "Angle"
|
|
7704
|
+
}
|
|
7705
|
+
];
|
|
7706
|
+
const mediumHeight = "6rem + 2px";
|
|
7707
|
+
const compactHeight = "4.5rem + 2px";
|
|
7708
|
+
const largeHeight = "7rem + 2px";
|
|
7709
|
+
/**
|
|
7710
|
+
* The single source of transition vocabulary. Order is significant: it is the
|
|
7711
|
+
* order of `boundaryOptions` (after `none`) and of each family's variants,
|
|
7712
|
+
* which persisted pins, page-flow presets and the editor picker all rely on.
|
|
7713
|
+
*
|
|
7714
|
+
* Shapes match what `generateLayoutCss` draws today. Structured
|
|
7715
|
+
* amplitude/frequency treatments (issue 826) extend this list later.
|
|
7716
|
+
*/
|
|
7717
|
+
const transitionCatalogueEntries = defineExactCatalog()([
|
|
7718
|
+
{
|
|
7719
|
+
intent: "soft-fade-short",
|
|
7720
|
+
optionId: asBoundaryOptionId("break:soft"),
|
|
7721
|
+
family: "gradient",
|
|
7722
|
+
variantId: "soft",
|
|
7723
|
+
label: "Soft",
|
|
7724
|
+
variantLabel: "Soft",
|
|
7725
|
+
treatment: {
|
|
7726
|
+
kind: "soft-fade",
|
|
7727
|
+
height: "medium",
|
|
7728
|
+
curve: "soft"
|
|
7729
|
+
},
|
|
7730
|
+
size: "medium",
|
|
7731
|
+
heightExpression: mediumHeight,
|
|
7732
|
+
shape: { kind: "fade" }
|
|
7733
|
+
},
|
|
7734
|
+
{
|
|
7735
|
+
intent: "soft-fade-long",
|
|
7736
|
+
optionId: asBoundaryOptionId("break:spacious"),
|
|
7737
|
+
family: "gradient",
|
|
7738
|
+
variantId: "spacious",
|
|
7739
|
+
label: "Spacious",
|
|
7740
|
+
variantLabel: "Spacious",
|
|
7741
|
+
treatment: {
|
|
7742
|
+
kind: "soft-fade",
|
|
7743
|
+
height: "large",
|
|
7744
|
+
curve: "spacious"
|
|
7745
|
+
},
|
|
7746
|
+
size: "spacious",
|
|
7747
|
+
heightExpression: "10rem",
|
|
7748
|
+
shape: { kind: "fade" }
|
|
7749
|
+
},
|
|
7750
|
+
{
|
|
7751
|
+
intent: "soft-fade-expansive",
|
|
7752
|
+
optionId: asBoundaryOptionId("break:expansive"),
|
|
7753
|
+
family: "gradient",
|
|
7754
|
+
variantId: "expansive",
|
|
7755
|
+
label: "Expansive",
|
|
7756
|
+
variantLabel: "Expansive",
|
|
7757
|
+
treatment: {
|
|
7758
|
+
kind: "soft-fade",
|
|
7759
|
+
height: "expansive",
|
|
7760
|
+
curve: "expansive"
|
|
7761
|
+
},
|
|
7762
|
+
size: "expansive",
|
|
7763
|
+
heightExpression: "14rem",
|
|
7764
|
+
shape: { kind: "fade" }
|
|
7765
|
+
},
|
|
7766
|
+
{
|
|
7767
|
+
intent: "wave-edge-balanced",
|
|
7768
|
+
optionId: asBoundaryOptionId("break:wave-balanced"),
|
|
7769
|
+
family: "wave",
|
|
7770
|
+
variantId: "balanced",
|
|
7771
|
+
label: "Balanced wave",
|
|
7772
|
+
variantLabel: "Balanced",
|
|
7773
|
+
treatment: {
|
|
7774
|
+
kind: "wave-edge",
|
|
7775
|
+
height: "medium",
|
|
7776
|
+
amplitude: "balanced",
|
|
7777
|
+
rhythm: "double",
|
|
7778
|
+
symmetry: "symmetrical"
|
|
7779
|
+
},
|
|
7780
|
+
size: "medium",
|
|
7781
|
+
heightExpression: mediumHeight,
|
|
7782
|
+
shape: {
|
|
7783
|
+
kind: "wave",
|
|
7784
|
+
mask: "balanced"
|
|
7785
|
+
}
|
|
7786
|
+
},
|
|
7787
|
+
{
|
|
7788
|
+
intent: "wave-edge",
|
|
7789
|
+
optionId: asBoundaryOptionId("break:wave"),
|
|
7790
|
+
family: "wave",
|
|
7791
|
+
variantId: "classic",
|
|
7792
|
+
label: "Classic wave",
|
|
7793
|
+
variantLabel: "Classic",
|
|
7794
|
+
treatment: {
|
|
7795
|
+
kind: "wave-edge",
|
|
7796
|
+
height: "medium",
|
|
7797
|
+
amplitude: "balanced",
|
|
7798
|
+
rhythm: "double",
|
|
7799
|
+
symmetry: "asymmetrical"
|
|
7800
|
+
},
|
|
7801
|
+
size: "medium",
|
|
7802
|
+
heightExpression: mediumHeight,
|
|
7803
|
+
shape: {
|
|
7804
|
+
kind: "wave",
|
|
7805
|
+
mask: "classic"
|
|
7806
|
+
}
|
|
7807
|
+
},
|
|
7808
|
+
{
|
|
7809
|
+
intent: "wave-edge-gentle",
|
|
7810
|
+
optionId: asBoundaryOptionId("break:wave-gentle"),
|
|
7811
|
+
family: "wave",
|
|
7812
|
+
variantId: "gentle",
|
|
7813
|
+
label: "Gentle wave",
|
|
7814
|
+
variantLabel: "Gentle",
|
|
7815
|
+
treatment: {
|
|
7816
|
+
kind: "wave-edge",
|
|
7817
|
+
height: "compact",
|
|
7818
|
+
amplitude: "subtle",
|
|
7819
|
+
rhythm: "single",
|
|
7820
|
+
symmetry: "symmetrical"
|
|
7821
|
+
},
|
|
7822
|
+
size: "compact",
|
|
7823
|
+
heightExpression: compactHeight,
|
|
7824
|
+
shape: {
|
|
7825
|
+
kind: "wave",
|
|
7826
|
+
mask: "gentle"
|
|
7827
|
+
}
|
|
7828
|
+
},
|
|
7829
|
+
{
|
|
7830
|
+
intent: "wave-edge-bold",
|
|
7831
|
+
optionId: asBoundaryOptionId("break:wave-bold"),
|
|
7832
|
+
family: "wave",
|
|
7833
|
+
variantId: "bold",
|
|
7834
|
+
label: "Bold wave",
|
|
7835
|
+
variantLabel: "Bold",
|
|
7836
|
+
treatment: {
|
|
7837
|
+
kind: "wave-edge",
|
|
7838
|
+
height: "large",
|
|
7839
|
+
amplitude: "bold",
|
|
7840
|
+
rhythm: "double",
|
|
7841
|
+
symmetry: "symmetrical"
|
|
7842
|
+
},
|
|
7843
|
+
size: "large",
|
|
7844
|
+
heightExpression: largeHeight,
|
|
7845
|
+
shape: {
|
|
7846
|
+
kind: "wave",
|
|
7847
|
+
mask: "bold"
|
|
7848
|
+
}
|
|
7849
|
+
},
|
|
7850
|
+
{
|
|
7851
|
+
intent: "wave-edge-drift",
|
|
7852
|
+
optionId: asBoundaryOptionId("break:wave-drift"),
|
|
7853
|
+
family: "wave",
|
|
7854
|
+
variantId: "drift",
|
|
7855
|
+
label: "Drift wave",
|
|
7856
|
+
variantLabel: "Drift",
|
|
7857
|
+
treatment: {
|
|
7858
|
+
kind: "wave-edge",
|
|
7859
|
+
height: "medium",
|
|
7860
|
+
amplitude: "balanced",
|
|
7861
|
+
rhythm: "double",
|
|
7862
|
+
symmetry: "drift"
|
|
7863
|
+
},
|
|
7864
|
+
size: "medium",
|
|
7865
|
+
heightExpression: mediumHeight,
|
|
7866
|
+
shape: {
|
|
7867
|
+
kind: "wave",
|
|
7868
|
+
mask: "drift"
|
|
7869
|
+
}
|
|
7870
|
+
},
|
|
7871
|
+
{
|
|
7872
|
+
intent: "angle-edge-subtle",
|
|
7873
|
+
optionId: asBoundaryOptionId("break:angle-subtle"),
|
|
7874
|
+
family: "angle",
|
|
7875
|
+
variantId: "subtle",
|
|
7876
|
+
label: "Subtle angle",
|
|
7877
|
+
variantLabel: "Subtle",
|
|
7878
|
+
treatment: {
|
|
7879
|
+
kind: "angle-edge",
|
|
7880
|
+
height: "compact",
|
|
7881
|
+
slope: "subtle",
|
|
7882
|
+
direction: "forward"
|
|
7883
|
+
},
|
|
7884
|
+
size: "compact",
|
|
7885
|
+
heightExpression: compactHeight,
|
|
7886
|
+
shape: {
|
|
7887
|
+
kind: "angle",
|
|
7888
|
+
polygon: {
|
|
7889
|
+
startTopPercent: 34,
|
|
7890
|
+
endTopPercent: 18
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
},
|
|
7894
|
+
{
|
|
7895
|
+
intent: "angle-edge",
|
|
7896
|
+
optionId: asBoundaryOptionId("break:angle-balanced"),
|
|
7897
|
+
family: "angle",
|
|
7898
|
+
variantId: "balanced",
|
|
7899
|
+
label: "Balanced angle",
|
|
7900
|
+
variantLabel: "Balanced",
|
|
7901
|
+
treatment: {
|
|
7902
|
+
kind: "angle-edge",
|
|
7903
|
+
height: "medium",
|
|
7904
|
+
slope: "balanced",
|
|
7905
|
+
direction: "forward"
|
|
7906
|
+
},
|
|
7907
|
+
size: "medium",
|
|
7908
|
+
heightExpression: mediumHeight,
|
|
7909
|
+
shape: {
|
|
7910
|
+
kind: "angle",
|
|
7911
|
+
polygon: {
|
|
7912
|
+
startTopPercent: 42,
|
|
7913
|
+
endTopPercent: 8
|
|
7914
|
+
}
|
|
7915
|
+
}
|
|
7916
|
+
},
|
|
7917
|
+
{
|
|
7918
|
+
intent: "angle-edge-steep",
|
|
7919
|
+
optionId: asBoundaryOptionId("break:angle-steep"),
|
|
7920
|
+
family: "angle",
|
|
7921
|
+
variantId: "steep",
|
|
7922
|
+
label: "Steep angle",
|
|
7923
|
+
variantLabel: "Steep",
|
|
7924
|
+
treatment: {
|
|
7925
|
+
kind: "angle-edge",
|
|
7926
|
+
height: "large",
|
|
7927
|
+
slope: "steep",
|
|
7928
|
+
direction: "forward"
|
|
7929
|
+
},
|
|
7930
|
+
size: "large",
|
|
7931
|
+
heightExpression: largeHeight,
|
|
7932
|
+
shape: {
|
|
7933
|
+
kind: "angle",
|
|
7934
|
+
polygon: {
|
|
7935
|
+
startTopPercent: 54,
|
|
7936
|
+
endTopPercent: 0
|
|
7937
|
+
}
|
|
7938
|
+
}
|
|
7939
|
+
}
|
|
7940
|
+
]);
|
|
7941
|
+
/** CSS `clip-path` value for an angle shape, as `generateLayoutCss` draws it. */
|
|
7942
|
+
function anglePolygonCss(polygon) {
|
|
7943
|
+
return `polygon(0 ${polygon.startTopPercent}%, 100% ${polygon.endTopPercent}%, 100% 100%, 0 100%)`;
|
|
7944
|
+
}
|
|
7302
7945
|
//#endregion
|
|
7303
7946
|
//#region ../theme-core/src/site-styles/sectionTransitions.ts
|
|
7304
7947
|
function boundaryRuntimeMetrics(family, size, heightExpression) {
|
|
@@ -7309,22 +7952,19 @@ function boundaryRuntimeMetrics(family, size, heightExpression) {
|
|
|
7309
7952
|
reserveCss: `calc((${heightExpression}) / 2)`
|
|
7310
7953
|
};
|
|
7311
7954
|
}
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
};
|
|
7326
|
-
function boundaryRuntimeMetricsForTransition(transition) {
|
|
7327
|
-
return sectionBoundaryRuntimeMetricsByTransition[transition];
|
|
7955
|
+
new Map(transitionCatalogueEntries.map((entry) => [entry.intent, entry]));
|
|
7956
|
+
const metricsByIntent = new Map(transitionCatalogueEntries.map((entry) => [entry.intent, boundaryRuntimeMetrics(entry.family, entry.size, entry.heightExpression)]));
|
|
7957
|
+
/**
|
|
7958
|
+
* The catalogue's compile-time coverage check guarantees an entry per
|
|
7959
|
+
* decorative intent, so a miss here is a broken invariant, not bad input.
|
|
7960
|
+
*/
|
|
7961
|
+
function requireCatalogueValue(values, intent) {
|
|
7962
|
+
const value = values.get(intent);
|
|
7963
|
+
if (value === void 0) throw new Error(`Transition catalogue has no entry for ${intent}`);
|
|
7964
|
+
return value;
|
|
7965
|
+
}
|
|
7966
|
+
function boundaryRuntimeMetricsForDecorativeTransition(transition) {
|
|
7967
|
+
return requireCatalogueValue(metricsByIntent, transition);
|
|
7328
7968
|
}
|
|
7329
7969
|
const noneBoundaryOption = {
|
|
7330
7970
|
id: asBoundaryOptionId("break:none"),
|
|
@@ -7332,29 +7972,233 @@ const noneBoundaryOption = {
|
|
|
7332
7972
|
transitionAfter: "none",
|
|
7333
7973
|
treatment: { kind: "none" }
|
|
7334
7974
|
};
|
|
7335
|
-
const
|
|
7336
|
-
id:
|
|
7337
|
-
label:
|
|
7338
|
-
transitionAfter:
|
|
7339
|
-
treatment:
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7975
|
+
const boundaryOptionByIntent = new Map(transitionCatalogueEntries.map((entry) => [entry.intent, {
|
|
7976
|
+
id: entry.optionId,
|
|
7977
|
+
label: entry.label,
|
|
7978
|
+
transitionAfter: entry.intent,
|
|
7979
|
+
treatment: entry.treatment
|
|
7980
|
+
}]));
|
|
7981
|
+
function boundaryOptionForTransitionIntent(intent) {
|
|
7982
|
+
return requireCatalogueValue(boundaryOptionByIntent, intent);
|
|
7983
|
+
}
|
|
7984
|
+
const softBoundaryOption = boundaryOptionForTransitionIntent("soft-fade-short");
|
|
7985
|
+
const spaciousBoundaryOption = boundaryOptionForTransitionIntent("soft-fade-long");
|
|
7986
|
+
boundaryOptionForTransitionIntent("soft-fade-expansive");
|
|
7987
|
+
boundaryOptionForTransitionIntent("wave-edge");
|
|
7988
|
+
boundaryOptionForTransitionIntent("wave-edge-balanced");
|
|
7989
|
+
boundaryOptionForTransitionIntent("wave-edge-gentle");
|
|
7990
|
+
boundaryOptionForTransitionIntent("wave-edge-bold");
|
|
7991
|
+
boundaryOptionForTransitionIntent("wave-edge-drift");
|
|
7992
|
+
boundaryOptionForTransitionIntent("angle-edge-subtle");
|
|
7993
|
+
boundaryOptionForTransitionIntent("angle-edge");
|
|
7994
|
+
boundaryOptionForTransitionIntent("angle-edge-steep");
|
|
7995
|
+
/**
|
|
7996
|
+
* Must remain non-empty; downstream code indexes `[0]` as the documented default.
|
|
7997
|
+
*/
|
|
7998
|
+
const boundaryOptions = [noneBoundaryOption, ...transitionCatalogueEntries.map((entry) => boundaryOptionForTransitionIntent(entry.intent))];
|
|
7999
|
+
const noneTransitionVariant = {
|
|
8000
|
+
familyId: "none",
|
|
8001
|
+
variantId: "none",
|
|
8002
|
+
label: "None",
|
|
8003
|
+
boundaryOption: noneBoundaryOption
|
|
7344
8004
|
};
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
8005
|
+
function transitionVariantForEntry(entry) {
|
|
8006
|
+
return {
|
|
8007
|
+
familyId: entry.family,
|
|
8008
|
+
variantId: entry.variantId,
|
|
8009
|
+
label: entry.variantLabel,
|
|
8010
|
+
boundaryOption: boundaryOptionForTransitionIntent(entry.intent)
|
|
8011
|
+
};
|
|
8012
|
+
}
|
|
8013
|
+
const sectionTransitionFamilies = [{
|
|
8014
|
+
id: "none",
|
|
8015
|
+
label: "None",
|
|
8016
|
+
variants: [noneTransitionVariant]
|
|
8017
|
+
}, ...transitionCatalogueFamilies.map((family) => ({
|
|
8018
|
+
id: family.id,
|
|
8019
|
+
label: family.label,
|
|
8020
|
+
variants: requireNonEmptyReadonlyArray(transitionCatalogueEntries.filter((entry) => entry.family === family.id).map(transitionVariantForEntry), `Transition family ${family.id} has no catalogue entries.`)
|
|
8021
|
+
}))];
|
|
8022
|
+
new Map(boundaryOptions.map((option) => [option.id, option]));
|
|
8023
|
+
new Map(boundaryOptions.map((option) => [stableTreatmentKey(option.treatment), option]));
|
|
8024
|
+
new Map(sectionTransitionFamilies.flatMap((family) => family.variants.map((variant) => [variant.boundaryOption.id, variant])));
|
|
8025
|
+
new Map(sectionTransitionFamilies.map((family) => [family.id, family]));
|
|
8026
|
+
function stableTreatmentKey(treatment) {
|
|
8027
|
+
switch (treatment.kind) {
|
|
8028
|
+
case "none": return "none";
|
|
8029
|
+
case "soft-fade": return `${treatment.kind}:${treatment.height}:${treatment.curve}`;
|
|
8030
|
+
case "wave-edge": return [
|
|
8031
|
+
treatment.kind,
|
|
8032
|
+
treatment.height,
|
|
8033
|
+
treatment.amplitude,
|
|
8034
|
+
treatment.rhythm,
|
|
8035
|
+
treatment.symmetry
|
|
8036
|
+
].join(":");
|
|
8037
|
+
case "angle-edge": return [
|
|
8038
|
+
treatment.kind,
|
|
8039
|
+
treatment.height,
|
|
8040
|
+
treatment.slope,
|
|
8041
|
+
treatment.direction
|
|
8042
|
+
].join(":");
|
|
8043
|
+
case "legacy-unsupported": return `${treatment.kind}:${treatment.boundaryOptionId}`;
|
|
8044
|
+
}
|
|
8045
|
+
}
|
|
8046
|
+
//#endregion
|
|
8047
|
+
//#region ../theme-core/src/site-styles/sectionBoundaryComposition.ts
|
|
8048
|
+
const backgroundToken = requireThemeColorToken$1("background");
|
|
8049
|
+
/**
|
|
8050
|
+
* Classifies a section from its final render content. `_sectionStyles`
|
|
8051
|
+
* already holds the effective background (Look default, page-design override
|
|
8052
|
+
* and block-authored media merged by `resolveSectionBackground`), so this only
|
|
8053
|
+
* reads it and never re-decides precedence. A missing or unparseable
|
|
8054
|
+
* background is the page background, as it is for the renderer.
|
|
8055
|
+
*/
|
|
8056
|
+
function boundaryEndpointForSectionContent(content) {
|
|
8057
|
+
const background = parseCanonicalRuntimeBackground(content);
|
|
8058
|
+
if (background.kind === "none") return {
|
|
8059
|
+
kind: "paint",
|
|
8060
|
+
token: backgroundToken
|
|
8061
|
+
};
|
|
8062
|
+
const effective = background.background;
|
|
8063
|
+
switch (effective.type) {
|
|
8064
|
+
case "color": {
|
|
8065
|
+
if (effective.color === null || effective.color === void 0) return {
|
|
8066
|
+
kind: "paint",
|
|
8067
|
+
token: backgroundToken
|
|
8068
|
+
};
|
|
8069
|
+
const token = parseThemeColorToken(effective.color);
|
|
8070
|
+
return token ? {
|
|
8071
|
+
kind: "paint",
|
|
8072
|
+
token
|
|
8073
|
+
} : {
|
|
8074
|
+
kind: "unpainted",
|
|
8075
|
+
reason: "literal-color"
|
|
8076
|
+
};
|
|
8077
|
+
}
|
|
8078
|
+
case "gradient": return {
|
|
8079
|
+
kind: "unpainted",
|
|
8080
|
+
reason: "gradient"
|
|
8081
|
+
};
|
|
8082
|
+
case "image":
|
|
8083
|
+
case "video": return {
|
|
8084
|
+
kind: "unpainted",
|
|
8085
|
+
reason: "media"
|
|
8086
|
+
};
|
|
8087
|
+
default: return assertNever$13(effective, "Unhandled section background type");
|
|
8088
|
+
}
|
|
8089
|
+
}
|
|
8090
|
+
/**
|
|
8091
|
+
* Reads both facts from final render content in one place. `_frameStyles` is
|
|
8092
|
+
* the compiled frame; content without one (no page design, an SDK block)
|
|
8093
|
+
* draws a plain frame.
|
|
8094
|
+
*/
|
|
8095
|
+
function sectionFactsForContent(content) {
|
|
8096
|
+
return {
|
|
8097
|
+
endpoint: boundaryEndpointForSectionContent(content),
|
|
8098
|
+
frame: frameKindForContent(content)
|
|
8099
|
+
};
|
|
8100
|
+
}
|
|
8101
|
+
function frameKindForContent(content) {
|
|
8102
|
+
const frameStyles = content._frameStyles;
|
|
8103
|
+
const kind = typeof frameStyles === "object" && frameStyles !== null && "kind" in frameStyles ? frameStyles.kind : null;
|
|
8104
|
+
return kind === "panel" || kind === "flush-panel" ? kind : "plain";
|
|
8105
|
+
}
|
|
8106
|
+
/**
|
|
8107
|
+
* The frame rule: a flush panel owns the edge it runs to, so no break is
|
|
8108
|
+
* drawn next to one. The single home for this rule; the generated
|
|
8109
|
+
* pipeline's budget and the site-style lab ask it with their plan frames.
|
|
8110
|
+
*/
|
|
8111
|
+
function frameNotShownReason(previous, next) {
|
|
8112
|
+
return previous === "flush-panel" || next === "flush-panel" ? "flush-panel" : null;
|
|
8113
|
+
}
|
|
8114
|
+
/**
|
|
8115
|
+
* Decides whether and how a join draws. The frame rule wins before paint is
|
|
8116
|
+
* considered; two unpainted sides show nothing.
|
|
8117
|
+
*/
|
|
8118
|
+
function composeBoundary(previous, next) {
|
|
8119
|
+
const frameReason = frameNotShownReason(previous.frame, next.frame);
|
|
8120
|
+
if (frameReason) return {
|
|
8121
|
+
kind: "not-shown",
|
|
8122
|
+
reason: frameReason
|
|
8123
|
+
};
|
|
8124
|
+
const from = previous.endpoint;
|
|
8125
|
+
const to = next.endpoint;
|
|
8126
|
+
if (from.kind === "paint") return {
|
|
8127
|
+
kind: "shown",
|
|
8128
|
+
composition: to.kind === "paint" ? {
|
|
8129
|
+
kind: "paint-to-paint",
|
|
8130
|
+
from: from.token,
|
|
8131
|
+
to: to.token
|
|
8132
|
+
} : {
|
|
8133
|
+
kind: "paint-to-unpainted",
|
|
8134
|
+
from: from.token
|
|
8135
|
+
}
|
|
8136
|
+
};
|
|
8137
|
+
return to.kind === "paint" ? {
|
|
8138
|
+
kind: "shown",
|
|
8139
|
+
composition: {
|
|
8140
|
+
kind: "unpainted-to-paint",
|
|
8141
|
+
to: to.token
|
|
8142
|
+
}
|
|
8143
|
+
} : {
|
|
8144
|
+
kind: "not-shown",
|
|
8145
|
+
reason: "both-unpainted"
|
|
8146
|
+
};
|
|
8147
|
+
}
|
|
8148
|
+
/**
|
|
8149
|
+
* Placement, reserves and paint for a shown boundary, derived from the
|
|
8150
|
+
* composition and the catalogue's metrics for the treatment.
|
|
8151
|
+
*/
|
|
8152
|
+
function boundaryLayout(intent, composition) {
|
|
8153
|
+
const metrics = boundaryRuntimeMetricsForDecorativeTransition(intent);
|
|
8154
|
+
switch (composition.kind) {
|
|
8155
|
+
case "paint-to-paint": return {
|
|
8156
|
+
placement: "centred",
|
|
8157
|
+
reserves: {
|
|
8158
|
+
before: metrics.reserveCss,
|
|
8159
|
+
after: metrics.reserveCss
|
|
8160
|
+
},
|
|
8161
|
+
paint: {
|
|
8162
|
+
band: composition.from,
|
|
8163
|
+
shape: composition.to
|
|
8164
|
+
}
|
|
8165
|
+
};
|
|
8166
|
+
case "unpainted-to-paint": return {
|
|
8167
|
+
placement: "previous",
|
|
8168
|
+
reserves: {
|
|
8169
|
+
before: metrics.heightCss,
|
|
8170
|
+
after: null
|
|
8171
|
+
},
|
|
8172
|
+
paint: {
|
|
8173
|
+
band: null,
|
|
8174
|
+
shape: composition.to
|
|
8175
|
+
}
|
|
8176
|
+
};
|
|
8177
|
+
case "paint-to-unpainted": return {
|
|
8178
|
+
placement: "next",
|
|
8179
|
+
reserves: {
|
|
8180
|
+
before: null,
|
|
8181
|
+
after: metrics.heightCss
|
|
8182
|
+
},
|
|
8183
|
+
paint: {
|
|
8184
|
+
band: null,
|
|
8185
|
+
shape: composition.from
|
|
8186
|
+
}
|
|
8187
|
+
};
|
|
8188
|
+
default: return assertNever$13(composition, "Unhandled boundary composition");
|
|
7353
8189
|
}
|
|
8190
|
+
}
|
|
8191
|
+
function requireThemeColorToken$1(value) {
|
|
8192
|
+
const token = parseThemeColorToken(value);
|
|
8193
|
+
if (!token) throw new Error(`Expected a theme color token. Received: ${value}`);
|
|
8194
|
+
return token;
|
|
8195
|
+
}
|
|
8196
|
+
//#endregion
|
|
8197
|
+
//#region ../theme-core/src/site-styles/compilationPlan.ts
|
|
8198
|
+
const defaultHeaderBrandPreferences = {
|
|
8199
|
+
brandDisplay: "auto",
|
|
8200
|
+
logoSize: "auto"
|
|
7354
8201
|
};
|
|
7355
|
-
asBoundaryOptionId("break:expansive");
|
|
7356
|
-
asBoundaryOptionId("break:wave");
|
|
7357
|
-
asBoundaryOptionId("break:wave-balanced"), asBoundaryOptionId("break:wave-gentle"), asBoundaryOptionId("break:wave-bold"), asBoundaryOptionId("break:wave-drift"), asBoundaryOptionId("break:angle-subtle"), asBoundaryOptionId("break:angle-balanced"), asBoundaryOptionId("break:angle-steep");
|
|
7358
8202
|
asBoundaryOptionId("break:unknown");
|
|
7359
8203
|
const pageDesignUserPinnedAppearanceChoiceSchema = z$1.object({
|
|
7360
8204
|
kind: z$1.literal("user-pinned"),
|
|
@@ -7481,14 +8325,11 @@ function validateUniquePageDesignPins(intent, ctx) {
|
|
|
7481
8325
|
label: "block Look pin"
|
|
7482
8326
|
});
|
|
7483
8327
|
addDuplicateStringIssues(ctx, {
|
|
7484
|
-
values: intent.boundaryPins.map((pin) =>
|
|
8328
|
+
values: intent.boundaryPins.map((pin) => makeBoundaryId(pin.previousBlockId, pin.nextBlockId)),
|
|
7485
8329
|
path: ["boundaryPins"],
|
|
7486
8330
|
label: "boundary pin"
|
|
7487
8331
|
});
|
|
7488
8332
|
}
|
|
7489
|
-
function boundaryKey$1(previousBlockId, nextBlockId) {
|
|
7490
|
-
return makeBoundaryId(previousBlockId, nextBlockId);
|
|
7491
|
-
}
|
|
7492
8333
|
//#endregion
|
|
7493
8334
|
//#region ../theme-core/src/buttons/types.ts
|
|
7494
8335
|
/**
|
|
@@ -12748,88 +13589,6 @@ function resolveFooterRenderPlan(params) {
|
|
|
12748
13589
|
};
|
|
12749
13590
|
}
|
|
12750
13591
|
}
|
|
12751
|
-
const hotspotSchema = z$1.object({
|
|
12752
|
-
x: z$1.number().min(0).max(1),
|
|
12753
|
-
y: z$1.number().min(0).max(1),
|
|
12754
|
-
radius: z$1.number().optional()
|
|
12755
|
-
});
|
|
12756
|
-
const rotationSchema = z$1.union([
|
|
12757
|
-
z$1.literal(0),
|
|
12758
|
-
z$1.literal(90),
|
|
12759
|
-
z$1.literal(180),
|
|
12760
|
-
z$1.literal(270)
|
|
12761
|
-
]);
|
|
12762
|
-
const rectSchema = z$1.tuple([
|
|
12763
|
-
z$1.number(),
|
|
12764
|
-
z$1.number(),
|
|
12765
|
-
z$1.number(),
|
|
12766
|
-
z$1.number()
|
|
12767
|
-
]);
|
|
12768
|
-
const aspectCropSchema = z$1.object({
|
|
12769
|
-
aspect: z$1.preprocess((value) => value == null ? void 0 : value, z$1.string().optional()),
|
|
12770
|
-
rect: z$1.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
12771
|
-
hotspot: z$1.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
12772
|
-
rotation: z$1.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
12773
|
-
});
|
|
12774
|
-
const transformSchema = z$1.object({
|
|
12775
|
-
aspectCrops: z$1.preprocess((value) => {
|
|
12776
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
12777
|
-
return value;
|
|
12778
|
-
}, z$1.record(z$1.string(), aspectCropSchema.catch({}))).optional(),
|
|
12779
|
-
rect: rectSchema.optional(),
|
|
12780
|
-
hotspot: hotspotSchema.optional(),
|
|
12781
|
-
rotation: rotationSchema.optional()
|
|
12782
|
-
});
|
|
12783
|
-
const mediaPosterSchema = z$1.discriminatedUnion("tag", [z$1.object({
|
|
12784
|
-
tag: z$1.literal("storage"),
|
|
12785
|
-
assetId: z$1.string().optional(),
|
|
12786
|
-
storageBucket: z$1.string().min(1),
|
|
12787
|
-
storagePath: z$1.string().min(1)
|
|
12788
|
-
}), z$1.object({
|
|
12789
|
-
tag: z$1.literal("external-src"),
|
|
12790
|
-
assetId: z$1.string().optional(),
|
|
12791
|
-
src: z$1.string().url()
|
|
12792
|
-
})]);
|
|
12793
|
-
const mediaBaseSchema = z$1.object({
|
|
12794
|
-
purpose: z$1.string().optional(),
|
|
12795
|
-
placeholder: z$1.boolean().default(true).optional(),
|
|
12796
|
-
assetId: z$1.string().optional(),
|
|
12797
|
-
identifier: z$1.string().optional(),
|
|
12798
|
-
src: z$1.string().optional(),
|
|
12799
|
-
alt: z$1.string().optional(),
|
|
12800
|
-
filename: z$1.string().optional(),
|
|
12801
|
-
mimeType: z$1.string().optional(),
|
|
12802
|
-
width: z$1.number().optional(),
|
|
12803
|
-
height: z$1.number().optional(),
|
|
12804
|
-
storageBucket: z$1.string().optional(),
|
|
12805
|
-
storagePath: z$1.string().optional(),
|
|
12806
|
-
poster: mediaPosterSchema.optional(),
|
|
12807
|
-
transform: transformSchema.optional()
|
|
12808
|
-
});
|
|
12809
|
-
const mediaIdentifierSchema = z$1.string().trim().min(1).brand();
|
|
12810
|
-
const imageMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("image") });
|
|
12811
|
-
const videoMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("video") });
|
|
12812
|
-
const audioMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("audio") });
|
|
12813
|
-
const documentMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("document") });
|
|
12814
|
-
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("spreadsheet") });
|
|
12815
|
-
const archiveMediaSchema = mediaBaseSchema.extend({ type: z$1.literal("archive") });
|
|
12816
|
-
const mediaSchema = z$1.discriminatedUnion("type", [
|
|
12817
|
-
imageMediaSchema,
|
|
12818
|
-
videoMediaSchema,
|
|
12819
|
-
audioMediaSchema,
|
|
12820
|
-
documentMediaSchema,
|
|
12821
|
-
spreadsheetMediaSchema,
|
|
12822
|
-
archiveMediaSchema
|
|
12823
|
-
]);
|
|
12824
|
-
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
12825
|
-
z$1.discriminatedUnion("type", [
|
|
12826
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("image") }),
|
|
12827
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("video") }),
|
|
12828
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("audio") }),
|
|
12829
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("document") }),
|
|
12830
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("spreadsheet") }),
|
|
12831
|
-
persistableMediaBaseSchema.extend({ type: z$1.literal("archive") })
|
|
12832
|
-
]);
|
|
12833
13592
|
//#endregion
|
|
12834
13593
|
//#region ../theme-core/src/palette/schema.ts
|
|
12835
13594
|
const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
@@ -15385,112 +16144,6 @@ function affordanceIconMaskUrl(iconId) {
|
|
|
15385
16144
|
return `data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>${paths.map((d) => `<path d='${d}'/>`).join("")}</svg>`.replace(/"/g, "'").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ")}`;
|
|
15386
16145
|
}
|
|
15387
16146
|
//#endregion
|
|
15388
|
-
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
15389
|
-
/**
|
|
15390
|
-
* Runtime color-reference fields intentionally accept any string, including
|
|
15391
|
-
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
15392
|
-
* palette context and happens in `parseThemeColorReference`.
|
|
15393
|
-
*/
|
|
15394
|
-
const tokenOrCssColorValueSchema = z$1.string();
|
|
15395
|
-
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
15396
|
-
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
15397
|
-
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
15398
|
-
"transparent",
|
|
15399
|
-
"currentcolor",
|
|
15400
|
-
"inherit",
|
|
15401
|
-
"initial",
|
|
15402
|
-
"revert",
|
|
15403
|
-
"revert-layer",
|
|
15404
|
-
"unset"
|
|
15405
|
-
]);
|
|
15406
|
-
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
15407
|
-
"black",
|
|
15408
|
-
"blue",
|
|
15409
|
-
"gray",
|
|
15410
|
-
"green",
|
|
15411
|
-
"grey",
|
|
15412
|
-
"orange",
|
|
15413
|
-
"pink",
|
|
15414
|
-
"purple",
|
|
15415
|
-
"red",
|
|
15416
|
-
"white",
|
|
15417
|
-
"yellow"
|
|
15418
|
-
]);
|
|
15419
|
-
function isCssColorLiteral(value) {
|
|
15420
|
-
const trimmed = value.trim();
|
|
15421
|
-
if (!trimmed) return false;
|
|
15422
|
-
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
15423
|
-
}
|
|
15424
|
-
function parseThemeToken(token) {
|
|
15425
|
-
const trimmed = token.trim();
|
|
15426
|
-
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
15427
|
-
if (!match) return {
|
|
15428
|
-
role: trimmed,
|
|
15429
|
-
shade: null
|
|
15430
|
-
};
|
|
15431
|
-
const role = match[1] ?? trimmed;
|
|
15432
|
-
const shade = match[2] ? Number(match[2]) : null;
|
|
15433
|
-
return {
|
|
15434
|
-
role,
|
|
15435
|
-
shade: Number.isFinite(shade) ? shade : null
|
|
15436
|
-
};
|
|
15437
|
-
}
|
|
15438
|
-
function parseContextThemeColorToken(value, context) {
|
|
15439
|
-
const parts = parseColorTokenParts(value);
|
|
15440
|
-
if (parts.kind !== "token") return null;
|
|
15441
|
-
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
15442
|
-
return value.trim();
|
|
15443
|
-
}
|
|
15444
|
-
function isTokenShapedTypo(value) {
|
|
15445
|
-
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
15446
|
-
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
15447
|
-
return !isCssColorLiteral(value);
|
|
15448
|
-
}
|
|
15449
|
-
function warnUnknownThemeColorReference(value) {
|
|
15450
|
-
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") return;
|
|
15451
|
-
if (!isTokenShapedTypo(value)) return;
|
|
15452
|
-
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
15453
|
-
}
|
|
15454
|
-
function parseThemeColorReference(input, context) {
|
|
15455
|
-
const trimmed = input.trim();
|
|
15456
|
-
if (trimmed.startsWith("raw:")) return {
|
|
15457
|
-
kind: "literal-css",
|
|
15458
|
-
value: trimmed.slice(4)
|
|
15459
|
-
};
|
|
15460
|
-
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
15461
|
-
if (contextToken) return {
|
|
15462
|
-
kind: "palette-context-token",
|
|
15463
|
-
token: contextToken
|
|
15464
|
-
};
|
|
15465
|
-
const knownToken = parseThemeColorToken(trimmed);
|
|
15466
|
-
if (knownToken) return {
|
|
15467
|
-
kind: "theme-token",
|
|
15468
|
-
token: knownToken
|
|
15469
|
-
};
|
|
15470
|
-
warnUnknownThemeColorReference(trimmed);
|
|
15471
|
-
return {
|
|
15472
|
-
kind: "literal-css",
|
|
15473
|
-
value: trimmed
|
|
15474
|
-
};
|
|
15475
|
-
}
|
|
15476
|
-
function resolveThemeColorReferenceValue(input, context) {
|
|
15477
|
-
const reference = parseThemeColorReference(input, context);
|
|
15478
|
-
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
15479
|
-
}
|
|
15480
|
-
function resolveTokenOrCssColorValue(input, context) {
|
|
15481
|
-
return resolveThemeColorReferenceValue(input, context);
|
|
15482
|
-
}
|
|
15483
|
-
function resolveOnColorForThemeToken(token) {
|
|
15484
|
-
if (!parseThemeColorToken(token)) return null;
|
|
15485
|
-
const parts = parseColorTokenParts(token);
|
|
15486
|
-
if (parts.kind !== "token") return null;
|
|
15487
|
-
const { role, shade } = parseThemeToken(parts.token);
|
|
15488
|
-
const normalizedRole = role.trim();
|
|
15489
|
-
if (!normalizedRole) return null;
|
|
15490
|
-
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
15491
|
-
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
15492
|
-
}
|
|
15493
|
-
//#endregion
|
|
15494
16147
|
//#region ../theme-core/src/buttons/buttonSurfaceContext.ts
|
|
15495
16148
|
/**
|
|
15496
16149
|
* Derive only what the rendered section can honestly prove about its backing.
|
|
@@ -15892,7 +16545,7 @@ const LETTER_SPACING_MAP = {
|
|
|
15892
16545
|
normal: "0",
|
|
15893
16546
|
loose: "0.05em"
|
|
15894
16547
|
};
|
|
15895
|
-
function rule$
|
|
16548
|
+
function rule$2(selector, declarations) {
|
|
15896
16549
|
return {
|
|
15897
16550
|
selectors: typeof selector === "string" ? [selector] : selector,
|
|
15898
16551
|
declarations
|
|
@@ -16075,7 +16728,7 @@ function variantAffordanceRule(variant, selector) {
|
|
|
16075
16728
|
const maskUrl = affordanceIconMaskUrl(affordance.iconId);
|
|
16076
16729
|
if (!maskUrl) return null;
|
|
16077
16730
|
const mask = `url("${maskUrl}") no-repeat center / contain`;
|
|
16078
|
-
return rule$
|
|
16731
|
+
return rule$2(`${selector}:not(.${AFFORDANCE_SUPPRESS_CLASS})::after`, [
|
|
16079
16732
|
["content", "\"\""],
|
|
16080
16733
|
["display", "inline-block"],
|
|
16081
16734
|
["width", "1em"],
|
|
@@ -16114,7 +16767,7 @@ function variantBaseRule(variant, selector, global, tokens, theme, colour) {
|
|
|
16114
16767
|
const borderWidth = BORDER_WIDTH_MAP$2[variant.border.widthClass] || "1px";
|
|
16115
16768
|
decls.push(["border", `${borderWidth} solid currentColor`]);
|
|
16116
16769
|
}
|
|
16117
|
-
return rule$
|
|
16770
|
+
return rule$2(selector, decls);
|
|
16118
16771
|
}
|
|
16119
16772
|
/**
|
|
16120
16773
|
* Resolve a colour for a button that does not own its own background.
|
|
@@ -16125,13 +16778,13 @@ function variantBaseRule(variant, selector, global, tokens, theme, colour) {
|
|
|
16125
16778
|
*/
|
|
16126
16779
|
function variantStateColourRule(variantId, themeId, state, colour) {
|
|
16127
16780
|
const baseSelector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}`;
|
|
16128
|
-
return rule$
|
|
16781
|
+
return rule$2(state === "hover" ? [`${baseSelector}:hover`, `${baseSelector}[data-force-hover="true"]`] : `${baseSelector}:${state}`, resolvedButtonColourDeclarations(colour, {
|
|
16129
16782
|
role: variantId,
|
|
16130
16783
|
state
|
|
16131
16784
|
}));
|
|
16132
16785
|
}
|
|
16133
16786
|
function variantFocusVisibleRule(variantId, themeId, focusIndicator) {
|
|
16134
|
-
return rule$
|
|
16787
|
+
return rule$2(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:focus-visible`, resolvedButtonFocusDeclarations(focusIndicator, variantId));
|
|
16135
16788
|
}
|
|
16136
16789
|
function variantEffectsCss(variant, effects, themeId, tokens, theme) {
|
|
16137
16790
|
if (!effects) return "";
|
|
@@ -16157,10 +16810,10 @@ function variantDisabledRules(variantId, themeId, colour) {
|
|
|
16157
16810
|
`${base}:focus`
|
|
16158
16811
|
];
|
|
16159
16812
|
const pseudoSelectors = [`${base}::before`, `${base}::after`];
|
|
16160
|
-
return [rule$
|
|
16813
|
+
return [rule$2(disabledSelectors, [...resolvedButtonColourDeclarations(colour, {
|
|
16161
16814
|
role: variantId,
|
|
16162
16815
|
state: "disabled"
|
|
16163
|
-
}), ...RESOLVED_BUTTON_DISABLED_DECLARATIONS]), rule$
|
|
16816
|
+
}), ...RESOLVED_BUTTON_DISABLED_DECLARATIONS]), rule$2(pseudoSelectors, [
|
|
16164
16817
|
["opacity", "0"],
|
|
16165
16818
|
["animation", "none"],
|
|
16166
16819
|
["pointer-events", "none"]
|
|
@@ -16175,7 +16828,7 @@ function variantSizeRules(variant, variantId, themeSizes, themeId) {
|
|
|
16175
16828
|
const decls = [];
|
|
16176
16829
|
for (const decl of paddingDeclarations(config.padding, borderWidth)) decls.push(decl);
|
|
16177
16830
|
if (config.fontSize) decls.push(["font-size", FONT_SIZE_MAP[config.fontSize] || "1rem"]);
|
|
16178
|
-
rules.push(rule$
|
|
16831
|
+
rules.push(rule$2(selector, decls));
|
|
16179
16832
|
}
|
|
16180
16833
|
return rules;
|
|
16181
16834
|
}
|
|
@@ -17076,26 +17729,6 @@ function getComponentShadowVar(elevation) {
|
|
|
17076
17729
|
return `var(--shadow-${elevation})`;
|
|
17077
17730
|
}
|
|
17078
17731
|
//#endregion
|
|
17079
|
-
//#region ../theme-core/src/site-styles/rawStyleFields.ts
|
|
17080
|
-
const themeV2RuntimeStyleFieldNames = [
|
|
17081
|
-
"_frameStyles",
|
|
17082
|
-
"_sectionStyles",
|
|
17083
|
-
"_containerStyles",
|
|
17084
|
-
"_cardStyles",
|
|
17085
|
-
"_transitionStyles",
|
|
17086
|
-
"styleGroup"
|
|
17087
|
-
];
|
|
17088
|
-
const themeV2BlockSpecificRawStyleFieldNames = [
|
|
17089
|
-
"_contentCardStyles",
|
|
17090
|
-
"_heroLayoutStyles",
|
|
17091
|
-
"_textCardStyles"
|
|
17092
|
-
];
|
|
17093
|
-
const themeV2NormalEditorRawStyleFieldNames = [...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
17094
|
-
new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
17095
|
-
[...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
17096
|
-
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
17097
|
-
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
17098
|
-
//#endregion
|
|
17099
17732
|
//#region ../theme-core/src/header/legacyHeaderVariant.ts
|
|
17100
17733
|
/**
|
|
17101
17734
|
* The header variants the system actually renders.
|
|
@@ -17304,75 +17937,6 @@ const headerContainerSchema = z$1.object({
|
|
|
17304
17937
|
opacity: z$1.number().min(0).max(1).default(.12)
|
|
17305
17938
|
}).optional();
|
|
17306
17939
|
//#endregion
|
|
17307
|
-
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
17308
|
-
const boxBackgroundOverlaySchema = z$1.preprocess(normalizeAuthoringOpacity, z$1.discriminatedUnion("type", [
|
|
17309
|
-
z$1.object({ type: z$1.literal("none") }),
|
|
17310
|
-
z$1.object({
|
|
17311
|
-
type: z$1.literal("color"),
|
|
17312
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
17313
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
17314
|
-
}),
|
|
17315
|
-
z$1.object({
|
|
17316
|
-
type: z$1.literal("gradient"),
|
|
17317
|
-
gradient: z$1.string().nullable().optional(),
|
|
17318
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
17319
|
-
})
|
|
17320
|
-
]));
|
|
17321
|
-
const commonSchema = z$1.object({
|
|
17322
|
-
contentOwner: z$1.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
17323
|
-
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
17324
|
-
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
17325
|
-
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
17326
|
-
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
17327
|
-
});
|
|
17328
|
-
const mediaPresentationSchema = commonSchema.extend({
|
|
17329
|
-
opacity: z$1.preprocess(normalizeOpacity, z$1.number().min(0).max(1).nullable()).optional(),
|
|
17330
|
-
objectFit: z$1.enum([
|
|
17331
|
-
"fill",
|
|
17332
|
-
"fit",
|
|
17333
|
-
"original",
|
|
17334
|
-
"custom"
|
|
17335
|
-
]).nullable().optional(),
|
|
17336
|
-
scale: z$1.string().nullable().optional(),
|
|
17337
|
-
position: z$1.string().nullable().optional(),
|
|
17338
|
-
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
17339
|
-
overflow: z$1.boolean().nullable().optional(),
|
|
17340
|
-
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
17341
|
-
});
|
|
17342
|
-
const boxBackgroundSchema = z$1.discriminatedUnion("type", [
|
|
17343
|
-
commonSchema.extend({
|
|
17344
|
-
type: z$1.literal("color"),
|
|
17345
|
-
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
17346
|
-
}),
|
|
17347
|
-
commonSchema.extend({
|
|
17348
|
-
type: z$1.literal("gradient"),
|
|
17349
|
-
gradient: z$1.string().nullable().optional(),
|
|
17350
|
-
gradientPresetId: z$1.string().min(1).nullable().optional()
|
|
17351
|
-
}),
|
|
17352
|
-
mediaPresentationSchema.extend({
|
|
17353
|
-
type: z$1.literal("image"),
|
|
17354
|
-
image: imageMediaSchema.nullable().optional()
|
|
17355
|
-
}),
|
|
17356
|
-
mediaPresentationSchema.extend({
|
|
17357
|
-
type: z$1.literal("video"),
|
|
17358
|
-
image: videoMediaSchema.nullable().optional(),
|
|
17359
|
-
showVideoOnMobile: z$1.boolean().nullable().optional()
|
|
17360
|
-
})
|
|
17361
|
-
]);
|
|
17362
|
-
function normalizeAuthoringOpacity(value) {
|
|
17363
|
-
if (!isRecord$27(value)) return value;
|
|
17364
|
-
return {
|
|
17365
|
-
...value,
|
|
17366
|
-
opacity: normalizeOpacity(value.opacity)
|
|
17367
|
-
};
|
|
17368
|
-
}
|
|
17369
|
-
function normalizeOpacity(value) {
|
|
17370
|
-
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
17371
|
-
}
|
|
17372
|
-
function isRecord$27(value) {
|
|
17373
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17374
|
-
}
|
|
17375
|
-
//#endregion
|
|
17376
17940
|
//#region ../theme-core/src/schema.ts
|
|
17377
17941
|
const axesSchema = z$1.object({
|
|
17378
17942
|
tone: z$1.enum([
|
|
@@ -18133,6 +18697,13 @@ z$1.object({
|
|
|
18133
18697
|
fields: nonEmptyRuntimeStyleFieldNamesSchema,
|
|
18134
18698
|
authority: styleAuthoritySchema
|
|
18135
18699
|
}).strict();
|
|
18700
|
+
asPageFlowPresetId("flow:quiet"), noneBoundaryOption.id, asPageFlowPresetId("flow:balanced"), softBoundaryOption.id, asPageFlowPresetId("flow:expressive"), spaciousBoundaryOption.id;
|
|
18701
|
+
asPageFlowPresetId("generated-default");
|
|
18702
|
+
asSiteStyleId("site-style:south-west-twerk-school");
|
|
18703
|
+
asAppearancePresetId("hero-brand-scrim-fixed-frame");
|
|
18704
|
+
asLayoutVariantKey("classic");
|
|
18705
|
+
asLayoutVariantKey("micro");
|
|
18706
|
+
asBoundaryOptionId("break:wave");
|
|
18136
18707
|
//#endregion
|
|
18137
18708
|
//#region ../theme-core/src/site-styles/runtimeCompiler.ts
|
|
18138
18709
|
function defineSectionForegroundRuntimeTokens(input) {
|
|
@@ -18156,7 +18727,7 @@ function defineComponentRuntimeRules(rules) {
|
|
|
18156
18727
|
}
|
|
18157
18728
|
/**
|
|
18158
18729
|
* Default design rules translate semantic page-level choices into the current
|
|
18159
|
-
* runtime's section background
|
|
18730
|
+
* runtime's section background vocabulary.
|
|
18160
18731
|
*/
|
|
18161
18732
|
const defaultDesignRuntimeRules = defineDesignRuntimeRules({
|
|
18162
18733
|
sectionSurfaces: {
|
|
@@ -18191,8 +18762,7 @@ const defaultDesignRuntimeRules = defineDesignRuntimeRules({
|
|
|
18191
18762
|
color: "surface",
|
|
18192
18763
|
opacity: .88
|
|
18193
18764
|
}
|
|
18194
|
-
}
|
|
18195
|
-
transitionClassName: (transition, fromSurface, toSurface) => transition === "none" ? null : `site-style-transition-${transition}-from-${fromSurface}-to-${toSurface}`
|
|
18765
|
+
}
|
|
18196
18766
|
});
|
|
18197
18767
|
/**
|
|
18198
18768
|
* Default component rules translate frame and item-surface semantics into the
|
|
@@ -18246,37 +18816,6 @@ function uniformSectionForeground(token) {
|
|
|
18246
18816
|
supportingColor: token
|
|
18247
18817
|
};
|
|
18248
18818
|
}
|
|
18249
|
-
function compileTransitionRuntime(input) {
|
|
18250
|
-
return {
|
|
18251
|
-
treatment: input.treatment,
|
|
18252
|
-
from: input.from,
|
|
18253
|
-
to: input.to,
|
|
18254
|
-
cssVars: {
|
|
18255
|
-
from: input.from.kind === "surface" && input.from.surface === "hero-image" ? "transparent" : transitionEndpointCssValue(input.from),
|
|
18256
|
-
to: transitionEndpointCssValue(input.to)
|
|
18257
|
-
}
|
|
18258
|
-
};
|
|
18259
|
-
}
|
|
18260
|
-
function transitionEndpointCssValue(endpoint) {
|
|
18261
|
-
switch (endpoint.kind) {
|
|
18262
|
-
case "color-token": return themeColorTokenCssValue(endpoint.token);
|
|
18263
|
-
case "surface": return themeColorTokenCssValue(tokenForTransitionSurface(endpoint.surface));
|
|
18264
|
-
default: return assertNever$13(endpoint);
|
|
18265
|
-
}
|
|
18266
|
-
}
|
|
18267
|
-
function tokenForTransitionSurface(surface) {
|
|
18268
|
-
switch (surface) {
|
|
18269
|
-
case "base":
|
|
18270
|
-
case "hero-image": return "background";
|
|
18271
|
-
case "muted-band": return "muted";
|
|
18272
|
-
case "accent-band": return "accent";
|
|
18273
|
-
case "brand-depth-band": return "primary-800";
|
|
18274
|
-
default: return assertNever$13(surface);
|
|
18275
|
-
}
|
|
18276
|
-
}
|
|
18277
|
-
function themeColorTokenCssValue(token) {
|
|
18278
|
-
return `rgb(var(--tb-${token}))`;
|
|
18279
|
-
}
|
|
18280
18819
|
//#endregion
|
|
18281
18820
|
//#region ../theme-core/src/site-styles/curatedSiteStyles.ts
|
|
18282
18821
|
const SOFT_EARTH_SITE_STYLE_ID_VALUE = "site-style:soft-earth";
|
|
@@ -19961,17 +20500,9 @@ const curatedSiteStylesById = new Map(curatedSiteStyles.map((style) => [style.id
|
|
|
19961
20500
|
function getCuratedSiteStyle(id) {
|
|
19962
20501
|
return curatedSiteStylesById.get(id) ?? null;
|
|
19963
20502
|
}
|
|
19964
|
-
asPageFlowPresetId("generated-default");
|
|
19965
|
-
asSiteStyleId("site-style:south-west-twerk-school");
|
|
19966
|
-
asAppearancePresetId("hero-brand-scrim-fixed-frame");
|
|
19967
|
-
asLayoutVariantKey("classic");
|
|
19968
|
-
asLayoutVariantKey("micro");
|
|
19969
|
-
asBoundaryOptionId("break:wave");
|
|
19970
|
-
asPageFlowPresetId("flow:quiet"), noneBoundaryOption.id, asPageFlowPresetId("flow:balanced"), softBoundaryOption.id, asPageFlowPresetId("flow:expressive"), spaciousBoundaryOption.id;
|
|
19971
20503
|
const blockDesignFallback = {
|
|
19972
20504
|
sectionSurface: "base",
|
|
19973
20505
|
contentFrame: plainFrame,
|
|
19974
|
-
transitionAfter: "none",
|
|
19975
20506
|
sectionHeight: "default",
|
|
19976
20507
|
heroLegibility: "none",
|
|
19977
20508
|
imageSurfaceTreatment: { kind: "none" },
|
|
@@ -19982,7 +20513,7 @@ const blockDesignFallback = {
|
|
|
19982
20513
|
accordionIconTreatment: null,
|
|
19983
20514
|
composition: null
|
|
19984
20515
|
};
|
|
19985
|
-
blockDesignFallback.sectionSurface, blockDesignFallback.contentFrame, blockDesignFallback.
|
|
20516
|
+
blockDesignFallback.sectionSurface, blockDesignFallback.contentFrame, blockDesignFallback.sectionHeight, blockDesignFallback.heroLegibility, blockDesignFallback.imageSurfaceTreatment, blockDesignFallback.imageSurfaceMotion, blockDesignFallback.tileTreatment, blockDesignFallback.eventListTreatment, blockDesignFallback.eyebrowTreatment, blockDesignFallback.accordionIconTreatment, blockDesignFallback.composition;
|
|
19986
20517
|
//#endregion
|
|
19987
20518
|
//#region ../theme-core/src/site-styles/siteChromeBackgrounds.ts
|
|
19988
20519
|
const siteChromeBackgroundColorTokens = toSiteChromeBackgroundColorTokens(backgroundAppearanceColorTokenNames);
|
|
@@ -20090,35 +20621,6 @@ function jsonEquals(left, right) {
|
|
|
20090
20621
|
return true;
|
|
20091
20622
|
}
|
|
20092
20623
|
defaultHeaderBrandPreferences.brandDisplay, defaultHeaderBrandPreferences.logoSize, defaultHeaderNavPreferences.typography, defaultHeaderNavPreferences.fontSize, defaultHeaderNavPreferences.interactionPalette;
|
|
20093
|
-
function retargetCompiledBoundaryRuntimeForContentAdjacency(boundary, adjacency) {
|
|
20094
|
-
const fromSurface = contentOwnedBackgroundEndpoint(adjacency.currentContent) ?? boundary.from;
|
|
20095
|
-
const toSurface = contentOwnedBackgroundEndpoint(adjacency.nextContent) ?? boundary.to;
|
|
20096
|
-
if (fromSurface === boundary.from && toSurface === boundary.to) return boundary;
|
|
20097
|
-
const transition = compileTransitionRuntime({
|
|
20098
|
-
treatment: boundary.treatment,
|
|
20099
|
-
from: fromSurface,
|
|
20100
|
-
to: toSurface
|
|
20101
|
-
});
|
|
20102
|
-
return {
|
|
20103
|
-
...boundary,
|
|
20104
|
-
from: transition.from,
|
|
20105
|
-
to: transition.to,
|
|
20106
|
-
cssVars: transition.cssVars
|
|
20107
|
-
};
|
|
20108
|
-
}
|
|
20109
|
-
function contentOwnedBackgroundEndpoint(content) {
|
|
20110
|
-
const background = readRecord(readRecord(content?._sectionStyles)?.background);
|
|
20111
|
-
if (background?.contentOwner !== "page-design-editor" || background.type !== "color") return null;
|
|
20112
|
-
const token = parseThemeColorToken(background.color);
|
|
20113
|
-
if (!token) return null;
|
|
20114
|
-
return {
|
|
20115
|
-
kind: "color-token",
|
|
20116
|
-
token
|
|
20117
|
-
};
|
|
20118
|
-
}
|
|
20119
|
-
function readRecord(value) {
|
|
20120
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
20121
|
-
}
|
|
20122
20624
|
//#endregion
|
|
20123
20625
|
//#region ../theme-core/src/site-styles/generatedSchemas.ts
|
|
20124
20626
|
function uniqueNonEmpty(values) {
|
|
@@ -23838,7 +24340,7 @@ const teamMemberFragment = defineFragment({
|
|
|
23838
24340
|
//#region ../blocks/src/system/data/linkedContentEntries.ts
|
|
23839
24341
|
const LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
23840
24342
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
23841
|
-
if (!isRecord$
|
|
24343
|
+
if (!isRecord$26(payload)) return payload;
|
|
23842
24344
|
const response = payload;
|
|
23843
24345
|
if (!Array.isArray(response.entries)) return payload;
|
|
23844
24346
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -23846,16 +24348,16 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
23846
24348
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
23847
24349
|
}
|
|
23848
24350
|
function getLinkedContentEntryMeta(value) {
|
|
23849
|
-
if (!isRecord$
|
|
24351
|
+
if (!isRecord$26(value)) return null;
|
|
23850
24352
|
const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
|
|
23851
24353
|
return isLinkedContentEntryMeta(candidate) ? candidate : null;
|
|
23852
24354
|
}
|
|
23853
24355
|
function buildLinkedContentEditTarget(input) {
|
|
23854
24356
|
const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
|
|
23855
|
-
if (!isRecord$
|
|
24357
|
+
if (!isRecord$26(entry)) return null;
|
|
23856
24358
|
const meta = getLinkedContentEntryMeta(entry);
|
|
23857
24359
|
if (!meta || meta.support.kind !== "supported") return null;
|
|
23858
|
-
const content = isRecord$
|
|
24360
|
+
const content = isRecord$26(entry.content) ? entry.content : {};
|
|
23859
24361
|
return {
|
|
23860
24362
|
kind: "linked-content-entry",
|
|
23861
24363
|
entryId: meta.entryId,
|
|
@@ -23919,12 +24421,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
|
|
|
23919
24421
|
};
|
|
23920
24422
|
}
|
|
23921
24423
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
23922
|
-
if (!isRecord$
|
|
24424
|
+
if (!isRecord$26(entry)) return entry;
|
|
23923
24425
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
23924
24426
|
if (!entryId) return entry;
|
|
23925
24427
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
23926
24428
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
23927
|
-
const content = isRecord$
|
|
24429
|
+
const content = isRecord$26(entry.content) ? entry.content : {};
|
|
23928
24430
|
const meta = {
|
|
23929
24431
|
kind: "linked-content-entry",
|
|
23930
24432
|
entryId,
|
|
@@ -24020,7 +24522,7 @@ function capitalize(value) {
|
|
|
24020
24522
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
24021
24523
|
}
|
|
24022
24524
|
function parsePublicContentTypeMeta(value) {
|
|
24023
|
-
if (!isRecord$
|
|
24525
|
+
if (!isRecord$26(value)) return null;
|
|
24024
24526
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
24025
24527
|
return {
|
|
24026
24528
|
key: value.key,
|
|
@@ -24030,7 +24532,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
24030
24532
|
};
|
|
24031
24533
|
}
|
|
24032
24534
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
24033
|
-
if (!isRecord$
|
|
24535
|
+
if (!isRecord$26(value) || typeof value.kind !== "string") return null;
|
|
24034
24536
|
switch (value.kind) {
|
|
24035
24537
|
case "generic": return { kind: "generic" };
|
|
24036
24538
|
case "unsupported-domain-backed": return {
|
|
@@ -24041,7 +24543,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
24041
24543
|
}
|
|
24042
24544
|
}
|
|
24043
24545
|
function parsePublicContentTypeFieldMeta(value) {
|
|
24044
|
-
if (!isRecord$
|
|
24546
|
+
if (!isRecord$26(value)) return [];
|
|
24045
24547
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
24046
24548
|
return [{
|
|
24047
24549
|
id: value.id,
|
|
@@ -24056,14 +24558,14 @@ function parseStringArray(value) {
|
|
|
24056
24558
|
return value.filter((item) => typeof item === "string");
|
|
24057
24559
|
}
|
|
24058
24560
|
function isLinkedContentEntryMeta(value) {
|
|
24059
|
-
if (!isRecord$
|
|
24561
|
+
if (!isRecord$26(value)) return false;
|
|
24060
24562
|
if (value.kind !== "linked-content-entry") return false;
|
|
24061
24563
|
if (typeof value.entryId !== "string") return false;
|
|
24062
24564
|
if (typeof value.contentTypeKey !== "string") return false;
|
|
24063
24565
|
if (typeof value.contentTypeLabel !== "string") return false;
|
|
24064
24566
|
if (typeof value.title !== "string") return false;
|
|
24065
24567
|
if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
|
|
24066
|
-
if (!isRecord$
|
|
24568
|
+
if (!isRecord$26(value.contentType)) return false;
|
|
24067
24569
|
if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
|
|
24068
24570
|
return isLinkedContentEditSupport(value.support);
|
|
24069
24571
|
}
|
|
@@ -24071,7 +24573,7 @@ function isLinkedEntryFieldSourceArray(value) {
|
|
|
24071
24573
|
return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
|
|
24072
24574
|
}
|
|
24073
24575
|
function isLinkedEntryFieldSource(value) {
|
|
24074
|
-
if (!isRecord$
|
|
24576
|
+
if (!isRecord$26(value)) return false;
|
|
24075
24577
|
if (typeof value.displayPath !== "string") return false;
|
|
24076
24578
|
switch (value.kind) {
|
|
24077
24579
|
case "content-field": return typeof value.fieldPath === "string" && (value.fieldType === "text" || value.fieldType === "richText");
|
|
@@ -24092,7 +24594,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
|
|
|
24092
24594
|
}
|
|
24093
24595
|
}
|
|
24094
24596
|
function isLinkedContentEditSupport(value) {
|
|
24095
|
-
if (!isRecord$
|
|
24597
|
+
if (!isRecord$26(value) || typeof value.kind !== "string") return false;
|
|
24096
24598
|
switch (value.kind) {
|
|
24097
24599
|
case "supported": return true;
|
|
24098
24600
|
case "unsupported-domain-backed":
|
|
@@ -24101,7 +24603,7 @@ function isLinkedContentEditSupport(value) {
|
|
|
24101
24603
|
default: return false;
|
|
24102
24604
|
}
|
|
24103
24605
|
}
|
|
24104
|
-
function isRecord$
|
|
24606
|
+
function isRecord$26(value) {
|
|
24105
24607
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24106
24608
|
}
|
|
24107
24609
|
const inlineTextMarkSchema = z$1.discriminatedUnion("kind", [
|
|
@@ -27034,7 +27536,7 @@ function resolveRouteHrefForStage(routeIdValue, routes, stageInput) {
|
|
|
27034
27536
|
/**
|
|
27035
27537
|
* Strict record guard: excludes null, primitives, and arrays.
|
|
27036
27538
|
*/
|
|
27037
|
-
function isRecord$
|
|
27539
|
+
function isRecord$25(value) {
|
|
27038
27540
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27039
27541
|
}
|
|
27040
27542
|
/**
|
|
@@ -27158,16 +27660,16 @@ const interpolateRichTextTokensOptionsSchema = z$1.object({ tokens: z$1.array(su
|
|
|
27158
27660
|
const richTextTokenPattern = /\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g;
|
|
27159
27661
|
function getSiteName(context) {
|
|
27160
27662
|
const viewModel = context.viewModel;
|
|
27161
|
-
if (!isRecord$
|
|
27663
|
+
if (!isRecord$25(viewModel)) return null;
|
|
27162
27664
|
const site = viewModel.site;
|
|
27163
|
-
if (isRecord$
|
|
27665
|
+
if (isRecord$25(site) && typeof site.title === "string") {
|
|
27164
27666
|
const title = site.title.trim();
|
|
27165
27667
|
return title.length > 0 ? title : null;
|
|
27166
27668
|
}
|
|
27167
27669
|
const root = viewModel.$root;
|
|
27168
|
-
if (isRecord$
|
|
27670
|
+
if (isRecord$25(root)) {
|
|
27169
27671
|
const rootSite = root.site;
|
|
27170
|
-
if (isRecord$
|
|
27672
|
+
if (isRecord$25(rootSite) && typeof rootSite.title === "string") {
|
|
27171
27673
|
const title = rootSite.title.trim();
|
|
27172
27674
|
if (title.length > 0) return title;
|
|
27173
27675
|
}
|
|
@@ -27189,7 +27691,7 @@ function replaceTokenText(input, allowedTokens, tokenValues) {
|
|
|
27189
27691
|
});
|
|
27190
27692
|
}
|
|
27191
27693
|
function visitRichTextNode(node, allowedTokens, tokenValues) {
|
|
27192
|
-
if (!isRecord$
|
|
27694
|
+
if (!isRecord$25(node)) return node;
|
|
27193
27695
|
let changed = false;
|
|
27194
27696
|
const nextNode = { ...node };
|
|
27195
27697
|
if (nextNode.type === "text" && typeof nextNode.text === "string") {
|
|
@@ -27210,7 +27712,7 @@ function visitRichTextNode(node, allowedTokens, tokenValues) {
|
|
|
27210
27712
|
return changed ? nextNode : node;
|
|
27211
27713
|
}
|
|
27212
27714
|
function interpolateRichTextTokens(value, options, context) {
|
|
27213
|
-
if (!isRecord$
|
|
27715
|
+
if (!isRecord$25(value)) return value;
|
|
27214
27716
|
return visitRichTextNode(value, new Set(options.tokens), {
|
|
27215
27717
|
year: String((/* @__PURE__ */ new Date()).getFullYear()),
|
|
27216
27718
|
site_name: getSiteName(context)
|
|
@@ -28694,11 +29196,11 @@ var UnsafePathSegmentError = class extends Error {
|
|
|
28694
29196
|
function assertSafePathSegments(segments) {
|
|
28695
29197
|
for (const segment of segments) if (typeof segment === "string" && UNSAFE_PATH_SEGMENTS.has(segment)) throw new UnsafePathSegmentError(segment);
|
|
28696
29198
|
}
|
|
28697
|
-
function isRecord$
|
|
29199
|
+
function isRecord$24(value) {
|
|
28698
29200
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28699
29201
|
}
|
|
28700
29202
|
function isPathContainer(value) {
|
|
28701
|
-
return Array.isArray(value) || isRecord$
|
|
29203
|
+
return Array.isArray(value) || isRecord$24(value);
|
|
28702
29204
|
}
|
|
28703
29205
|
function getContainerValue(container, segment) {
|
|
28704
29206
|
if (typeof segment === "number") return Array.isArray(container) ? container[segment] : void 0;
|
|
@@ -30451,7 +30953,7 @@ function parseSiteIconStyleGuideVersionId(value) {
|
|
|
30451
30953
|
//#endregion
|
|
30452
30954
|
//#region ../blocks/src/system/icons/value.ts
|
|
30453
30955
|
const NO_BLOCK_ICON_VALUE = { kind: "none" };
|
|
30454
|
-
function isRecord$
|
|
30956
|
+
function isRecord$23(value) {
|
|
30455
30957
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30456
30958
|
}
|
|
30457
30959
|
function parseBlockIconValue(value) {
|
|
@@ -30459,7 +30961,7 @@ function parseBlockIconValue(value) {
|
|
|
30459
30961
|
kind: "semantic",
|
|
30460
30962
|
iconId: value
|
|
30461
30963
|
};
|
|
30462
|
-
if (!isRecord$
|
|
30964
|
+
if (!isRecord$23(value)) return NO_BLOCK_ICON_VALUE;
|
|
30463
30965
|
switch (value.kind) {
|
|
30464
30966
|
case "none": return NO_BLOCK_ICON_VALUE;
|
|
30465
30967
|
case "semantic": return isSemanticIconId(value.iconId) ? {
|
|
@@ -30532,7 +31034,7 @@ function buildGeneratedBlockIconRenderAssetLookupFromUnknown(value) {
|
|
|
30532
31034
|
if (!Array.isArray(value)) return { kind: "invalid_asset_list" };
|
|
30533
31035
|
const inputs = [];
|
|
30534
31036
|
for (const [index, item] of value.entries()) {
|
|
30535
|
-
if (!isRecord$
|
|
31037
|
+
if (!isRecord$23(item)) return {
|
|
30536
31038
|
kind: "invalid_asset_entry",
|
|
30537
31039
|
index,
|
|
30538
31040
|
reason: "not_object"
|
|
@@ -30649,11 +31151,11 @@ function resolveFeatureCardGeneratedIconSizePx(value) {
|
|
|
30649
31151
|
const parsed = parseFeatureCardGeneratedIconSizePx(value);
|
|
30650
31152
|
return parsed.ok ? parsed.value : unsafeAsFeatureCardGeneratedIconSizePx(FEATURE_CARD_GENERATED_ICON_SIZE_PX.default);
|
|
30651
31153
|
}
|
|
30652
|
-
function isRecord$
|
|
31154
|
+
function isRecord$22(value) {
|
|
30653
31155
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30654
31156
|
}
|
|
30655
31157
|
function toPlainTextFromTipTap(value) {
|
|
30656
|
-
if (!isRecord$
|
|
31158
|
+
if (!isRecord$22(value)) return "";
|
|
30657
31159
|
if (typeof value.text === "string") return value.text;
|
|
30658
31160
|
const content = value.content;
|
|
30659
31161
|
if (!Array.isArray(content)) return "";
|
|
@@ -31618,18 +32120,43 @@ const publicAppointmentServiceSchema = z$1.object({
|
|
|
31618
32120
|
pricing: publicPricingSchema.optional(),
|
|
31619
32121
|
priceAmount: z$1.number().nullable(),
|
|
31620
32122
|
priceCurrency: z$1.string().nullable(),
|
|
31621
|
-
location: publicLocationSchema
|
|
32123
|
+
location: publicLocationSchema,
|
|
32124
|
+
categoryId: z$1.string().nullable().optional().transform((value) => value ?? null)
|
|
32125
|
+
});
|
|
32126
|
+
const publicServiceCategorySchema = z$1.object({
|
|
32127
|
+
id: z$1.string().min(1),
|
|
32128
|
+
name: z$1.string(),
|
|
32129
|
+
description: z$1.string().nullable().optional().transform((value) => value ?? null)
|
|
31622
32130
|
});
|
|
31623
|
-
|
|
32131
|
+
/**
|
|
32132
|
+
* The loader hands over the catalogue `{ services, categories }` (issue 1403).
|
|
32133
|
+
* A bare services array is still accepted and read as a site with no
|
|
32134
|
+
* categories, so callers from before categories keep the flat list.
|
|
32135
|
+
*/
|
|
32136
|
+
const publicAppointmentServicesSchema = z$1.union([z$1.array(publicAppointmentServiceSchema).transform((services) => ({
|
|
32137
|
+
services,
|
|
32138
|
+
categories: []
|
|
32139
|
+
})), z$1.object({
|
|
32140
|
+
services: z$1.array(publicAppointmentServiceSchema),
|
|
32141
|
+
categories: z$1.array(publicServiceCategorySchema)
|
|
32142
|
+
})]);
|
|
31624
32143
|
const EMPTY_MESSAGE = "No appointments are available right now.";
|
|
31625
32144
|
const ERROR_MESSAGE = "Appointments are temporarily unavailable. Please try again shortly.";
|
|
32145
|
+
const OTHER_GROUP_KEY = "other";
|
|
32146
|
+
const OTHER_GROUP_HEADING = "Other";
|
|
31626
32147
|
function parseServices(value) {
|
|
31627
32148
|
const result = publicAppointmentServicesSchema.safeParse(value);
|
|
31628
32149
|
return result.success ? {
|
|
31629
32150
|
kind: "valid",
|
|
31630
|
-
services: result.data
|
|
32151
|
+
services: result.data.services,
|
|
32152
|
+
categories: result.data.categories
|
|
31631
32153
|
} : { kind: "invalid" };
|
|
31632
32154
|
}
|
|
32155
|
+
function readCategoryFilter(value) {
|
|
32156
|
+
if (typeof value !== "string") return null;
|
|
32157
|
+
const trimmed = value.trim();
|
|
32158
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
32159
|
+
}
|
|
31633
32160
|
function formatAppointmentDuration(durationMinutes) {
|
|
31634
32161
|
return `${durationMinutes} min`;
|
|
31635
32162
|
}
|
|
@@ -31703,8 +32230,44 @@ function buildRows(services, pathname, servicePathPrefix) {
|
|
|
31703
32230
|
detailsHref: servicePathPrefix && service.slug ? `${servicePathPrefix.replace(/\/$/, "")}/${encodeURIComponent(service.slug)}` : null
|
|
31704
32231
|
}));
|
|
31705
32232
|
}
|
|
32233
|
+
const EMPTY_VIEW = {
|
|
32234
|
+
kind: "empty",
|
|
32235
|
+
message: EMPTY_MESSAGE
|
|
32236
|
+
};
|
|
32237
|
+
function categoryGroup(category, services, toRows) {
|
|
32238
|
+
return {
|
|
32239
|
+
key: category.id,
|
|
32240
|
+
heading: category.name,
|
|
32241
|
+
intro: category.description,
|
|
32242
|
+
rows: toRows(services)
|
|
32243
|
+
};
|
|
32244
|
+
}
|
|
32245
|
+
function viewFromLayout(layout, toRows) {
|
|
32246
|
+
switch (layout.kind) {
|
|
32247
|
+
case "uncategorized-site": return layout.services.length === 0 ? EMPTY_VIEW : {
|
|
32248
|
+
kind: "items",
|
|
32249
|
+
rows: toRows(layout.services)
|
|
32250
|
+
};
|
|
32251
|
+
case "categorized-site": {
|
|
32252
|
+
const groups = layout.groups.map((group) => categoryGroup(group.category, group.services, toRows));
|
|
32253
|
+
const other = layout.other.length === 0 ? [] : [{
|
|
32254
|
+
key: OTHER_GROUP_KEY,
|
|
32255
|
+
heading: OTHER_GROUP_HEADING,
|
|
32256
|
+
intro: null,
|
|
32257
|
+
rows: toRows(layout.other)
|
|
32258
|
+
}];
|
|
32259
|
+
const allGroups = [...groups, ...other];
|
|
32260
|
+
return allGroups.length === 0 ? EMPTY_VIEW : {
|
|
32261
|
+
kind: "groups",
|
|
32262
|
+
groups: allGroups
|
|
32263
|
+
};
|
|
32264
|
+
}
|
|
32265
|
+
default: return assertNever$21(layout);
|
|
32266
|
+
}
|
|
32267
|
+
}
|
|
31706
32268
|
function buildAppointmentServicesView(input) {
|
|
31707
|
-
|
|
32269
|
+
const pathname = input.pathname;
|
|
32270
|
+
if (!pathname) return {
|
|
31708
32271
|
kind: "error",
|
|
31709
32272
|
message: ERROR_MESSAGE
|
|
31710
32273
|
};
|
|
@@ -31713,76 +32276,128 @@ function buildAppointmentServicesView(input) {
|
|
|
31713
32276
|
kind: "error",
|
|
31714
32277
|
message: ERROR_MESSAGE
|
|
31715
32278
|
};
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31723
|
-
|
|
32279
|
+
const toRows = (services) => buildRows(services, pathname, input.servicePathPrefix ?? null);
|
|
32280
|
+
const view = selectCategoryView(parsed.categories, parsed.services, readCategoryFilter(input.categoryId));
|
|
32281
|
+
switch (view.kind) {
|
|
32282
|
+
case "single": return view.group.services.length === 0 ? EMPTY_VIEW : {
|
|
32283
|
+
kind: "groups",
|
|
32284
|
+
groups: [categoryGroup(view.group.category, view.group.services, toRows)]
|
|
32285
|
+
};
|
|
32286
|
+
case "all":
|
|
32287
|
+
case "fallback-all": return viewFromLayout(view.layout, toRows);
|
|
32288
|
+
default: return assertNever$21(view);
|
|
32289
|
+
}
|
|
31724
32290
|
}
|
|
31725
|
-
function
|
|
32291
|
+
function AppointmentServiceRows({ rows, RowTitle }) {
|
|
32292
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32293
|
+
className: "appointment-services-rows rb-flex rb-flex-col",
|
|
32294
|
+
children: rows.map((row) => /* @__PURE__ */ jsxs("article", {
|
|
32295
|
+
className: "appointment-services-row rb-border-b rb-border-border rb-py-4",
|
|
32296
|
+
children: [
|
|
32297
|
+
/* @__PURE__ */ jsxs("div", {
|
|
32298
|
+
className: "appointment-services-row-main rb-min-w-0",
|
|
32299
|
+
children: [
|
|
32300
|
+
/* @__PURE__ */ jsx(RowTitle, {
|
|
32301
|
+
className: "appointment-services-row-title rb-text-lg rb-font-medium rb-leading-tight",
|
|
32302
|
+
children: row.detailsHref ? /* @__PURE__ */ jsx("a", {
|
|
32303
|
+
href: row.detailsHref,
|
|
32304
|
+
children: row.title
|
|
32305
|
+
}) : row.title
|
|
32306
|
+
}),
|
|
32307
|
+
row.description ? /* @__PURE__ */ jsx("p", {
|
|
32308
|
+
className: "appointment-services-row-description rb-text-sm rb-leading-6 status-muted",
|
|
32309
|
+
children: row.description
|
|
32310
|
+
}) : null,
|
|
32311
|
+
/* @__PURE__ */ jsxs("p", {
|
|
32312
|
+
className: "appointment-services-row-meta rb-caption status-muted",
|
|
32313
|
+
children: [row.durationLabel, row.locationLabel ? ` · ${row.locationLabel}` : ""]
|
|
32314
|
+
})
|
|
32315
|
+
]
|
|
32316
|
+
}),
|
|
32317
|
+
row.priceLabel ? /* @__PURE__ */ jsx("span", {
|
|
32318
|
+
className: "appointment-services-row-price rb-text-lg",
|
|
32319
|
+
children: row.priceLabel
|
|
32320
|
+
}) : null,
|
|
32321
|
+
/* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
32322
|
+
variant: "secondary",
|
|
32323
|
+
size: "sm",
|
|
32324
|
+
extraClassName: "appointment-services-row-action",
|
|
32325
|
+
href: row.href,
|
|
32326
|
+
label: "Check times",
|
|
32327
|
+
screenReaderSuffix: ` for ${row.title}`
|
|
32328
|
+
})
|
|
32329
|
+
]
|
|
32330
|
+
}, row.id))
|
|
32331
|
+
});
|
|
32332
|
+
}
|
|
32333
|
+
function AppointmentServiceGroups({ groups, hasSectionHeading, idPrefix }) {
|
|
32334
|
+
const GroupHeading = hasSectionHeading ? "h3" : "h2";
|
|
32335
|
+
const RowTitle = hasSectionHeading ? "h4" : "h3";
|
|
32336
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32337
|
+
className: "appointment-services-groups rb-flex rb-flex-col rb-gap-10",
|
|
32338
|
+
children: groups.map((group) => {
|
|
32339
|
+
const headingId = `${idPrefix}-group-${group.key}`;
|
|
32340
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
32341
|
+
className: "appointment-services-group rb-flex rb-flex-col rb-gap-2",
|
|
32342
|
+
"aria-labelledby": headingId,
|
|
32343
|
+
"data-appointment-services-group": group.key,
|
|
32344
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
32345
|
+
className: "appointment-services-group-heading",
|
|
32346
|
+
children: [/* @__PURE__ */ jsx(GroupHeading, {
|
|
32347
|
+
id: headingId,
|
|
32348
|
+
className: "appointment-services-group-title rb-text-sm rb-font-semibold rb-uppercase rb-tracking-wide",
|
|
32349
|
+
children: group.heading
|
|
32350
|
+
}), group.intro ? /* @__PURE__ */ jsx("p", {
|
|
32351
|
+
className: "appointment-services-group-intro rb-text-sm rb-leading-6 rb-max-w-prose status-muted",
|
|
32352
|
+
children: group.intro
|
|
32353
|
+
}) : null]
|
|
32354
|
+
}), /* @__PURE__ */ jsx(AppointmentServiceRows, {
|
|
32355
|
+
rows: group.rows,
|
|
32356
|
+
RowTitle
|
|
32357
|
+
})]
|
|
32358
|
+
}, group.key);
|
|
32359
|
+
})
|
|
32360
|
+
});
|
|
32361
|
+
}
|
|
32362
|
+
function AppointmentServicesNode({ sectionHeading, categoryId, services, pathname, servicePathPrefix, blockId, className }) {
|
|
31726
32363
|
const view = buildAppointmentServicesView({
|
|
31727
32364
|
services,
|
|
32365
|
+
categoryId,
|
|
31728
32366
|
pathname: typeof pathname === "string" ? pathname : void 0,
|
|
31729
32367
|
servicePathPrefix: typeof servicePathPrefix === "string" ? servicePathPrefix : null
|
|
31730
32368
|
});
|
|
31731
32369
|
const rootClassName = `appointment-services ${className ?? ""}`.trim();
|
|
31732
|
-
const
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
"
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
"
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
children:
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
}) : null,
|
|
31764
|
-
/* @__PURE__ */ jsxs("p", {
|
|
31765
|
-
className: "appointment-services-row-meta rb-caption status-muted",
|
|
31766
|
-
children: [row.durationLabel, row.locationLabel ? ` · ${row.locationLabel}` : ""]
|
|
31767
|
-
})
|
|
31768
|
-
]
|
|
31769
|
-
}),
|
|
31770
|
-
row.priceLabel ? /* @__PURE__ */ jsx("span", {
|
|
31771
|
-
className: "appointment-services-row-price rb-text-lg",
|
|
31772
|
-
children: row.priceLabel
|
|
31773
|
-
}) : null,
|
|
31774
|
-
/* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
31775
|
-
variant: "secondary",
|
|
31776
|
-
size: "sm",
|
|
31777
|
-
extraClassName: "appointment-services-row-action",
|
|
31778
|
-
href: row.href,
|
|
31779
|
-
label: "Check times",
|
|
31780
|
-
screenReaderSuffix: ` for ${row.title}`
|
|
31781
|
-
})
|
|
31782
|
-
]
|
|
31783
|
-
}, row.id))
|
|
31784
|
-
})
|
|
31785
|
-
});
|
|
32370
|
+
const hasSectionHeading = Boolean(sectionHeading);
|
|
32371
|
+
switch (view.kind) {
|
|
32372
|
+
case "error":
|
|
32373
|
+
case "empty": return /* @__PURE__ */ jsx("div", {
|
|
32374
|
+
className: rootClassName,
|
|
32375
|
+
"data-appointment-services-state": view.kind,
|
|
32376
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
32377
|
+
className: "rb-caption status-muted",
|
|
32378
|
+
role: "status",
|
|
32379
|
+
children: view.message
|
|
32380
|
+
})
|
|
32381
|
+
});
|
|
32382
|
+
case "items": return /* @__PURE__ */ jsx("div", {
|
|
32383
|
+
className: `${rootClassName} rb-flex rb-flex-col`,
|
|
32384
|
+
"data-appointment-services-state": "populated",
|
|
32385
|
+
children: /* @__PURE__ */ jsx(AppointmentServiceRows, {
|
|
32386
|
+
rows: view.rows,
|
|
32387
|
+
RowTitle: hasSectionHeading ? "h3" : "h2"
|
|
32388
|
+
})
|
|
32389
|
+
});
|
|
32390
|
+
case "groups": return /* @__PURE__ */ jsx("div", {
|
|
32391
|
+
className: `${rootClassName} rb-flex rb-flex-col`,
|
|
32392
|
+
"data-appointment-services-state": "populated",
|
|
32393
|
+
children: /* @__PURE__ */ jsx(AppointmentServiceGroups, {
|
|
32394
|
+
groups: view.groups,
|
|
32395
|
+
hasSectionHeading,
|
|
32396
|
+
idPrefix: `appointment-services-${blockId ?? "block"}`
|
|
32397
|
+
})
|
|
32398
|
+
});
|
|
32399
|
+
default: return assertNever$21(view);
|
|
32400
|
+
}
|
|
31786
32401
|
}
|
|
31787
32402
|
//#endregion
|
|
31788
32403
|
//#region ../blocks/src/contracts/runtime.ts
|
|
@@ -31837,7 +32452,7 @@ function buildInteractiveIslandProps(options) {
|
|
|
31837
32452
|
render
|
|
31838
32453
|
};
|
|
31839
32454
|
}
|
|
31840
|
-
function isRecord$
|
|
32455
|
+
function isRecord$20(value) {
|
|
31841
32456
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31842
32457
|
}
|
|
31843
32458
|
function deepEqualJsonValue(left, right) {
|
|
@@ -31847,8 +32462,8 @@ function deepEqualJsonValue(left, right) {
|
|
|
31847
32462
|
if (left.length !== right.length) return false;
|
|
31848
32463
|
return left.every((item, index) => deepEqualJsonValue(item, right[index]));
|
|
31849
32464
|
}
|
|
31850
|
-
if (isRecord$
|
|
31851
|
-
if (!isRecord$
|
|
32465
|
+
if (isRecord$20(left) || isRecord$20(right)) {
|
|
32466
|
+
if (!isRecord$20(left) || !isRecord$20(right)) return false;
|
|
31852
32467
|
const leftKeys = Object.keys(left).sort();
|
|
31853
32468
|
if (!deepEqualJsonValue(leftKeys, Object.keys(right).sort())) return false;
|
|
31854
32469
|
return leftKeys.every((key) => deepEqualJsonValue(left[key], right[key]));
|
|
@@ -31862,12 +32477,12 @@ function toTrimmedString(value) {
|
|
|
31862
32477
|
return trimmed ? trimmed : void 0;
|
|
31863
32478
|
}
|
|
31864
32479
|
function normalizeBookingFormConfig(form) {
|
|
31865
|
-
if (!isRecord$
|
|
32480
|
+
if (!isRecord$19(form)) return null;
|
|
31866
32481
|
const id = readNonEmptyString(form.id);
|
|
31867
32482
|
const name = readNonEmptyString(form.name);
|
|
31868
32483
|
if (!id || !name) return null;
|
|
31869
|
-
const schemaSource = isRecord$
|
|
31870
|
-
const settingsSource = isRecord$
|
|
32484
|
+
const schemaSource = isRecord$19(form.schema) ? form.schema : isRecord$19(form.schemaJson) ? form.schemaJson : null;
|
|
32485
|
+
const settingsSource = isRecord$19(form.settings) ? form.settings : isRecord$19(form.settingsJson) ? form.settingsJson : null;
|
|
31871
32486
|
return {
|
|
31872
32487
|
id,
|
|
31873
32488
|
name,
|
|
@@ -31887,8 +32502,8 @@ function normalizeBookingServices(services) {
|
|
|
31887
32502
|
};
|
|
31888
32503
|
if (!services) return [];
|
|
31889
32504
|
if (Array.isArray(services)) return services.filter(isBookingFormService).map(normalizeService);
|
|
31890
|
-
if (isRecord$
|
|
31891
|
-
return isRecord$
|
|
32505
|
+
if (isRecord$19(services) && "services" in services) return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
32506
|
+
return isRecord$19(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
31892
32507
|
}
|
|
31893
32508
|
function normalizeBookingSchema(value) {
|
|
31894
32509
|
if (!value) return void 0;
|
|
@@ -31899,7 +32514,7 @@ function normalizeBookingSchema(value) {
|
|
|
31899
32514
|
};
|
|
31900
32515
|
}
|
|
31901
32516
|
function readBookingFormField(value) {
|
|
31902
|
-
if (!isRecord$
|
|
32517
|
+
if (!isRecord$19(value)) return null;
|
|
31903
32518
|
const id = readNonEmptyString(value.id);
|
|
31904
32519
|
const label = readNonEmptyString(value.label);
|
|
31905
32520
|
const type = readBookingFieldType(value.type);
|
|
@@ -31942,7 +32557,7 @@ function readBookingFieldOptions(value) {
|
|
|
31942
32557
|
return options.length > 0 ? options : void 0;
|
|
31943
32558
|
}
|
|
31944
32559
|
function readBookingFieldOption(value) {
|
|
31945
|
-
if (!isRecord$
|
|
32560
|
+
if (!isRecord$19(value)) return null;
|
|
31946
32561
|
const optionValue = readNonEmptyString(value.value);
|
|
31947
32562
|
const label = readNonEmptyString(value.label);
|
|
31948
32563
|
return optionValue && label ? {
|
|
@@ -31962,7 +32577,7 @@ function normalizeBookingSettings(value) {
|
|
|
31962
32577
|
};
|
|
31963
32578
|
}
|
|
31964
32579
|
function isBookingFormService(value) {
|
|
31965
|
-
return isRecord$
|
|
32580
|
+
return isRecord$19(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string" && (value.consent === void 0 || blockBookingConsentSchema.safeParse(value.consent).success);
|
|
31966
32581
|
}
|
|
31967
32582
|
function readNonEmptyString(value) {
|
|
31968
32583
|
if (typeof value !== "string") return null;
|
|
@@ -31980,9 +32595,34 @@ function readStringArray(value) {
|
|
|
31980
32595
|
const strings = value.filter((item) => typeof item === "string");
|
|
31981
32596
|
return strings.length > 0 ? strings : void 0;
|
|
31982
32597
|
}
|
|
31983
|
-
function isRecord$
|
|
32598
|
+
function isRecord$19(value) {
|
|
31984
32599
|
return typeof value === "object" && value !== null;
|
|
31985
32600
|
}
|
|
32601
|
+
//#endregion
|
|
32602
|
+
//#region ../blocks/src/system/runtime/nodes/booking-form.service-categories.ts
|
|
32603
|
+
function isRecord$18(value) {
|
|
32604
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32605
|
+
}
|
|
32606
|
+
function readCategory(value) {
|
|
32607
|
+
if (!isRecord$18(value)) return [];
|
|
32608
|
+
const { id, name, description } = value;
|
|
32609
|
+
if (typeof id !== "string" || id.trim() === "" || typeof name !== "string") return [];
|
|
32610
|
+
return [{
|
|
32611
|
+
id,
|
|
32612
|
+
name,
|
|
32613
|
+
description: typeof description === "string" ? description : null
|
|
32614
|
+
}];
|
|
32615
|
+
}
|
|
32616
|
+
/**
|
|
32617
|
+
* The ordered service categories carried by a catalogue-shaped services
|
|
32618
|
+
* source (`{ services, categories }`). Every other shape has none, which
|
|
32619
|
+
* reads as a site without categories. Order is preserved: the database owns
|
|
32620
|
+
* it.
|
|
32621
|
+
*/
|
|
32622
|
+
function normalizeBookingServiceCategories(services) {
|
|
32623
|
+
if (!isRecord$18(services) || !Array.isArray(services.categories)) return [];
|
|
32624
|
+
return services.categories.flatMap(readCategory);
|
|
32625
|
+
}
|
|
31986
32626
|
const bookingFieldOptionSchema = z$1.object({
|
|
31987
32627
|
value: z$1.string(),
|
|
31988
32628
|
label: z$1.string()
|
|
@@ -32059,11 +32699,20 @@ const bookingServiceSchema = z$1.object({
|
|
|
32059
32699
|
priceCurrency: z$1.string().nullable().optional(),
|
|
32060
32700
|
paymentTerms: blockBookingPaymentTermsSchema.optional(),
|
|
32061
32701
|
paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional(),
|
|
32062
|
-
consent: blockBookingConsentSchema.optional()
|
|
32702
|
+
consent: blockBookingConsentSchema.optional(),
|
|
32703
|
+
categoryId: z$1.string().nullable().optional()
|
|
32704
|
+
});
|
|
32705
|
+
const bookingServiceCategorySchema = z$1.object({
|
|
32706
|
+
id: z$1.string(),
|
|
32707
|
+
name: z$1.string(),
|
|
32708
|
+
description: z$1.string().nullable()
|
|
32063
32709
|
});
|
|
32064
32710
|
const bookingServicesSourceSchema = z$1.union([
|
|
32065
32711
|
z$1.array(bookingServiceSchema),
|
|
32066
|
-
z$1.object({
|
|
32712
|
+
z$1.object({
|
|
32713
|
+
services: z$1.array(bookingServiceSchema).optional(),
|
|
32714
|
+
categories: z$1.array(bookingServiceCategorySchema).optional()
|
|
32715
|
+
}),
|
|
32067
32716
|
z$1.record(z$1.string(), bookingServiceSchema)
|
|
32068
32717
|
]);
|
|
32069
32718
|
const bookingConfigSchema = z$1.object({
|
|
@@ -32116,6 +32765,7 @@ const bookingHydrationSchema = z$1.object({
|
|
|
32116
32765
|
rebookContext: z$1.object({ kind: z$1.literal("portal_rebook") }).nullable().optional(),
|
|
32117
32766
|
form: bookingConfigSchema.nullable(),
|
|
32118
32767
|
services: z$1.array(bookingServiceSchema),
|
|
32768
|
+
serviceCategories: z$1.array(bookingServiceCategorySchema).optional(),
|
|
32119
32769
|
spamProtectionEnabled: z$1.boolean().optional()
|
|
32120
32770
|
});
|
|
32121
32771
|
const bookingRenderSchema = z$1.object({
|
|
@@ -32160,6 +32810,7 @@ const bookingFormBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
32160
32810
|
rebookContext: source.rebookContext ?? null,
|
|
32161
32811
|
form,
|
|
32162
32812
|
services,
|
|
32813
|
+
serviceCategories: normalizeBookingServiceCategories(source.services),
|
|
32163
32814
|
spamProtectionEnabled: source.spamProtectionEnabled
|
|
32164
32815
|
}
|
|
32165
32816
|
};
|
|
@@ -46532,6 +47183,123 @@ function generateFooterBottomTextLinkStyles(footer, themeId, tokens) {
|
|
|
46532
47183
|
return cssChunks.join("\n");
|
|
46533
47184
|
}
|
|
46534
47185
|
//#endregion
|
|
47186
|
+
//#region ../theme-core/src/layout/boundaryCss.ts
|
|
47187
|
+
/**
|
|
47188
|
+
* Section-break CSS, generated from the transition catalogue (issue 1422).
|
|
47189
|
+
*
|
|
47190
|
+
* The renderer emits one element per shown join:
|
|
47191
|
+
*
|
|
47192
|
+
* <div data-block-boundary data-boundary-treatment="wave-edge-gentle"
|
|
47193
|
+
* data-boundary-placement="previous"
|
|
47194
|
+
* style="--boundary-shape-paint: …; --boundary-band-paint: …">
|
|
47195
|
+
*
|
|
47196
|
+
* Every selector matches an exact attribute value, so there is no reliance on
|
|
47197
|
+
* prefix ordering in the cascade and nothing reads colours out of a string.
|
|
47198
|
+
* The shape layer is `::after`; the band layer (paint → paint only) is
|
|
47199
|
+
* `::before`.
|
|
47200
|
+
*/
|
|
47201
|
+
const waveMaskSvgPaths = {
|
|
47202
|
+
classic: "M0 72V46C130 55 260 24 420 30C590 36 690 62 860 42C1035 21 1160 47 1305 36C1365 31 1415 33 1440 38V72H0Z",
|
|
47203
|
+
balanced: "M0 72V42C120 24 240 24 360 42C480 60 600 60 720 42C840 24 960 24 1080 42C1200 60 1320 60 1440 42V72H0Z",
|
|
47204
|
+
gentle: "M0 72V43C180 32 300 32 480 43C660 54 780 54 960 43C1140 32 1260 32 1440 43V72H0Z",
|
|
47205
|
+
bold: "M0 72V44C90 14 270 14 360 44C450 74 630 74 720 44C810 14 990 14 1080 44C1170 74 1350 74 1440 44V72H0Z",
|
|
47206
|
+
drift: "M0 72V39C115 31 205 54 340 48C505 41 610 16 760 33C920 51 1015 64 1160 44C1280 27 1375 35 1440 50V72H0Z"
|
|
47207
|
+
};
|
|
47208
|
+
function waveMaskDataUrl(mask) {
|
|
47209
|
+
return svgDataUrl(`<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='${waveMaskSvgPaths[mask]}' fill='white'/></svg>`);
|
|
47210
|
+
}
|
|
47211
|
+
/**
|
|
47212
|
+
* How each placement anchors the layers against the zero-height boundary
|
|
47213
|
+
* element that sits exactly on the join.
|
|
47214
|
+
*
|
|
47215
|
+
* - `centred` straddles the join, band under shape.
|
|
47216
|
+
* - `previous` sits above the join, inside the previous section.
|
|
47217
|
+
* - `next` sits below the join, inside the next section, with the shape
|
|
47218
|
+
* flipped so it reads as the mirror of `previous`.
|
|
47219
|
+
*/
|
|
47220
|
+
const placementRules = {
|
|
47221
|
+
centred: {
|
|
47222
|
+
shape: ["top: 0;", "transform: translateY(-50%);"],
|
|
47223
|
+
band: ["top: 0;", "transform: translateY(-50%);"]
|
|
47224
|
+
},
|
|
47225
|
+
previous: {
|
|
47226
|
+
shape: ["bottom: 0;"],
|
|
47227
|
+
band: null
|
|
47228
|
+
},
|
|
47229
|
+
next: {
|
|
47230
|
+
shape: ["top: 0;", "transform: scaleY(-1);"],
|
|
47231
|
+
band: null
|
|
47232
|
+
}
|
|
47233
|
+
};
|
|
47234
|
+
function generateBoundaryCss(selector) {
|
|
47235
|
+
const boundary = `${selector} [data-block-boundary]`;
|
|
47236
|
+
return [
|
|
47237
|
+
rule$1(boundary, [
|
|
47238
|
+
"position: relative;",
|
|
47239
|
+
"z-index: 3;",
|
|
47240
|
+
"height: 0;",
|
|
47241
|
+
"pointer-events: none;"
|
|
47242
|
+
]),
|
|
47243
|
+
rule$1(`${selector} [data-block][data-site-style-boundary-before] > :where([data-slot='section'])`, ["padding-top: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-before-reserve, 0rem));"]),
|
|
47244
|
+
rule$1(`${selector} [data-block][data-site-style-boundary-after] > :where([data-slot='section'])`, ["padding-bottom: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-after-reserve, 0rem));"]),
|
|
47245
|
+
rule$1(`${boundary}::before,\n${boundary}::after`, [
|
|
47246
|
+
"content: '';",
|
|
47247
|
+
"position: absolute;",
|
|
47248
|
+
"left: 0;",
|
|
47249
|
+
"right: 0;",
|
|
47250
|
+
"height: var(--boundary-height);",
|
|
47251
|
+
"pointer-events: none;"
|
|
47252
|
+
]),
|
|
47253
|
+
rule$1(`${boundary}::before`, ["z-index: 0;", "background: var(--boundary-band-paint, transparent);"]),
|
|
47254
|
+
rule$1(`${boundary}::after`, ["z-index: 1;"]),
|
|
47255
|
+
...placementCss(boundary),
|
|
47256
|
+
...transitionCatalogueEntries.flatMap((entry) => treatmentCss(boundary, entry))
|
|
47257
|
+
].join("\n\n");
|
|
47258
|
+
}
|
|
47259
|
+
function placementCss(boundary) {
|
|
47260
|
+
return Object.keys(placementRules).flatMap((placement) => {
|
|
47261
|
+
const placed = `${boundary}[data-boundary-placement='${placement}']`;
|
|
47262
|
+
const rules = placementRules[placement];
|
|
47263
|
+
return [rule$1(`${placed}::after`, rules.shape), rules.band ? rule$1(`${placed}::before`, rules.band) : rule$1(`${placed}::before`, ["content: none;"])];
|
|
47264
|
+
});
|
|
47265
|
+
}
|
|
47266
|
+
function treatmentCss(boundary, entry) {
|
|
47267
|
+
const selected = `${boundary}[data-boundary-treatment='${entry.intent}']`;
|
|
47268
|
+
return [rule$1(selected, [`--boundary-height: ${boundaryRuntimeMetricsForDecorativeTransition(entry.intent).heightCss};`]), rule$1(`${selected}::after`, shapeDeclarations(entry))];
|
|
47269
|
+
}
|
|
47270
|
+
function shapeDeclarations(entry) {
|
|
47271
|
+
switch (entry.shape.kind) {
|
|
47272
|
+
case "fade": return [
|
|
47273
|
+
"/* Fallback for browsers without color-mix(). */",
|
|
47274
|
+
"background: linear-gradient(to bottom, transparent 0%, var(--boundary-shape-paint) 100%);",
|
|
47275
|
+
"background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--boundary-shape-paint) 16%, transparent) 34%, color-mix(in srgb, var(--boundary-shape-paint) 68%, transparent) 78%, var(--boundary-shape-paint) 100%);"
|
|
47276
|
+
];
|
|
47277
|
+
case "wave": {
|
|
47278
|
+
const mask = waveMaskDataUrl(entry.shape.mask);
|
|
47279
|
+
return [
|
|
47280
|
+
"background: var(--boundary-shape-paint);",
|
|
47281
|
+
`mask-image: url("${mask}");`,
|
|
47282
|
+
"mask-repeat: no-repeat;",
|
|
47283
|
+
"mask-size: 100% 100%;",
|
|
47284
|
+
`-webkit-mask-image: url("${mask}");`,
|
|
47285
|
+
"-webkit-mask-repeat: no-repeat;",
|
|
47286
|
+
"-webkit-mask-size: 100% 100%;"
|
|
47287
|
+
];
|
|
47288
|
+
}
|
|
47289
|
+
case "angle": return [
|
|
47290
|
+
"height: calc(var(--boundary-height) + 2px);",
|
|
47291
|
+
"background: var(--boundary-shape-paint);",
|
|
47292
|
+
`clip-path: ${anglePolygonCss(entry.shape.polygon)};`
|
|
47293
|
+
];
|
|
47294
|
+
}
|
|
47295
|
+
}
|
|
47296
|
+
function rule$1(selector, declarations) {
|
|
47297
|
+
return `${selector} {\n ${declarations.join("\n ")}\n}`;
|
|
47298
|
+
}
|
|
47299
|
+
function svgDataUrl(svg) {
|
|
47300
|
+
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
47301
|
+
}
|
|
47302
|
+
//#endregion
|
|
46535
47303
|
//#region ../theme-core/src/layout/generateLayoutCss.ts
|
|
46536
47304
|
/**
|
|
46537
47305
|
* Generate layout CSS for theme scope (background, text color)
|
|
@@ -46556,7 +47324,7 @@ function generateLayoutCss(options) {
|
|
|
46556
47324
|
if (heroTypographyCss) cssChunks.push(heroTypographyCss);
|
|
46557
47325
|
const bodyTextTypographyCss = generateBodyTextTypographyCss(themeId, theme);
|
|
46558
47326
|
if (bodyTextTypographyCss) cssChunks.push(bodyTextTypographyCss);
|
|
46559
|
-
cssChunks.push(
|
|
47327
|
+
cssChunks.push(generateBoundaryCss(selector));
|
|
46560
47328
|
return cssChunks.join("\n\n");
|
|
46561
47329
|
}
|
|
46562
47330
|
function toPaddingValue(preset) {
|
|
@@ -46567,193 +47335,6 @@ function toPaddingValue(preset) {
|
|
|
46567
47335
|
relaxed: "1.5rem"
|
|
46568
47336
|
}[preset];
|
|
46569
47337
|
}
|
|
46570
|
-
const classicWaveTransitionMask = svgDataUrl("<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='M0 72V46C130 55 260 24 420 30C590 36 690 62 860 42C1035 21 1160 47 1305 36C1365 31 1415 33 1440 38V72H0Z' fill='white'/></svg>");
|
|
46571
|
-
const balancedWaveTransitionMask = svgDataUrl("<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='M0 72V42C120 24 240 24 360 42C480 60 600 60 720 42C840 24 960 24 1080 42C1200 60 1320 60 1440 42V72H0Z' fill='white'/></svg>");
|
|
46572
|
-
const gentleWaveTransitionMask = svgDataUrl("<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='M0 72V43C180 32 300 32 480 43C660 54 780 54 960 43C1140 32 1260 32 1440 43V72H0Z' fill='white'/></svg>");
|
|
46573
|
-
const boldWaveTransitionMask = svgDataUrl("<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='M0 72V44C90 14 270 14 360 44C450 74 630 74 720 44C810 14 990 14 1080 44C1170 74 1350 74 1440 44V72H0Z' fill='white'/></svg>");
|
|
46574
|
-
const driftWaveTransitionMask = svgDataUrl("<svg viewBox='0 0 1440 72' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='M0 72V39C115 31 205 54 340 48C505 41 610 16 760 33C920 51 1015 64 1160 44C1280 27 1375 35 1440 50V72H0Z' fill='white'/></svg>");
|
|
46575
|
-
function generateSiteStyleTransitionCss(themeId) {
|
|
46576
|
-
const selector = `:where([data-theme-scope="${themeId}"])`;
|
|
46577
|
-
const compactBoundaryHeight = requiredBoundaryHeightCss("wave-edge-gentle");
|
|
46578
|
-
const mediumBoundaryHeight = requiredBoundaryHeightCss("wave-edge");
|
|
46579
|
-
const largeBoundaryHeight = requiredBoundaryHeightCss("wave-edge-bold");
|
|
46580
|
-
return `${selector} [data-style-group^='site-style-transition-'] {
|
|
46581
|
-
position: relative;
|
|
46582
|
-
z-index: 2;
|
|
46583
|
-
--site-style-transition-from: transparent;
|
|
46584
|
-
--site-style-transition-to: rgb(var(--tb-background));
|
|
46585
|
-
}
|
|
46586
|
-
|
|
46587
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-'] {
|
|
46588
|
-
position: relative;
|
|
46589
|
-
z-index: 3;
|
|
46590
|
-
height: 0;
|
|
46591
|
-
pointer-events: none;
|
|
46592
|
-
--site-style-boundary-height: ${mediumBoundaryHeight};
|
|
46593
|
-
}
|
|
46594
|
-
|
|
46595
|
-
${selector} [data-block][data-site-style-boundary-before] > :where([data-slot='section']) {
|
|
46596
|
-
padding-top: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-before-reserve, 0rem));
|
|
46597
|
-
}
|
|
46598
|
-
|
|
46599
|
-
${selector} [data-block][data-site-style-boundary-after] > :where([data-slot='section']) {
|
|
46600
|
-
padding-bottom: calc(var(--rb-section-pad-y, 0rem) + var(--site-style-boundary-after-reserve, 0rem));
|
|
46601
|
-
}
|
|
46602
|
-
|
|
46603
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-']::before,
|
|
46604
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-']::before,
|
|
46605
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-soft-fade']::before {
|
|
46606
|
-
content: '';
|
|
46607
|
-
position: absolute;
|
|
46608
|
-
left: 0;
|
|
46609
|
-
right: 0;
|
|
46610
|
-
top: 0;
|
|
46611
|
-
transform: translateY(-50%);
|
|
46612
|
-
z-index: 0;
|
|
46613
|
-
height: var(--site-style-boundary-height);
|
|
46614
|
-
background: var(--site-style-transition-from);
|
|
46615
|
-
pointer-events: none;
|
|
46616
|
-
}
|
|
46617
|
-
|
|
46618
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-']::after,
|
|
46619
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-']::after,
|
|
46620
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-soft-fade']::after {
|
|
46621
|
-
content: '';
|
|
46622
|
-
position: absolute;
|
|
46623
|
-
left: 0;
|
|
46624
|
-
right: 0;
|
|
46625
|
-
top: 0;
|
|
46626
|
-
transform: translateY(-50%);
|
|
46627
|
-
z-index: 1;
|
|
46628
|
-
height: var(--site-style-boundary-height);
|
|
46629
|
-
pointer-events: none;
|
|
46630
|
-
}
|
|
46631
|
-
|
|
46632
|
-
${selector} [data-style-group*='-from-base-'] {
|
|
46633
|
-
--site-style-transition-from: rgb(var(--tb-background));
|
|
46634
|
-
}
|
|
46635
|
-
|
|
46636
|
-
${selector} [data-style-group*='-from-muted-band-'] {
|
|
46637
|
-
--site-style-transition-from: rgb(var(--tb-muted));
|
|
46638
|
-
}
|
|
46639
|
-
|
|
46640
|
-
${selector} [data-style-group*='-from-accent-band-'] {
|
|
46641
|
-
--site-style-transition-from: rgb(var(--tb-accent));
|
|
46642
|
-
}
|
|
46643
|
-
|
|
46644
|
-
${selector} [data-style-group*='-from-brand-depth-band-'] {
|
|
46645
|
-
--site-style-transition-from: rgb(var(--tb-primary-800));
|
|
46646
|
-
}
|
|
46647
|
-
|
|
46648
|
-
${selector} [data-style-group$='-to-base'],
|
|
46649
|
-
${selector} [data-style-group$='-to-hero-image'] {
|
|
46650
|
-
--site-style-transition-to: rgb(var(--tb-background));
|
|
46651
|
-
}
|
|
46652
|
-
|
|
46653
|
-
${selector} [data-style-group$='-to-muted-band'] {
|
|
46654
|
-
--site-style-transition-to: rgb(var(--tb-muted));
|
|
46655
|
-
}
|
|
46656
|
-
|
|
46657
|
-
${selector} [data-style-group$='-to-accent-band'] {
|
|
46658
|
-
--site-style-transition-to: rgb(var(--tb-accent));
|
|
46659
|
-
}
|
|
46660
|
-
|
|
46661
|
-
${selector} [data-style-group$='-to-brand-depth-band'] {
|
|
46662
|
-
--site-style-transition-to: rgb(var(--tb-primary-800));
|
|
46663
|
-
}
|
|
46664
|
-
|
|
46665
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-soft-fade']::after {
|
|
46666
|
-
/* Fallback for browsers without color-mix(). */
|
|
46667
|
-
background: linear-gradient(
|
|
46668
|
-
to bottom,
|
|
46669
|
-
transparent 0%,
|
|
46670
|
-
var(--site-style-transition-to) 100%
|
|
46671
|
-
);
|
|
46672
|
-
background: linear-gradient(
|
|
46673
|
-
to bottom,
|
|
46674
|
-
transparent 0%,
|
|
46675
|
-
color-mix(in srgb, var(--site-style-transition-to) 16%, transparent) 34%,
|
|
46676
|
-
color-mix(in srgb, var(--site-style-transition-to) 68%, transparent) 78%,
|
|
46677
|
-
var(--site-style-transition-to) 100%
|
|
46678
|
-
);
|
|
46679
|
-
}
|
|
46680
|
-
|
|
46681
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-soft-fade-long-'] {
|
|
46682
|
-
--site-style-boundary-height: ${requiredBoundaryHeightCss("soft-fade-long")};
|
|
46683
|
-
}
|
|
46684
|
-
|
|
46685
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-soft-fade-expansive-'] {
|
|
46686
|
-
--site-style-boundary-height: ${requiredBoundaryHeightCss("soft-fade-expansive")};
|
|
46687
|
-
}
|
|
46688
|
-
|
|
46689
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-']::after {
|
|
46690
|
-
height: calc(var(--site-style-boundary-height) + 2px);
|
|
46691
|
-
background: var(--site-style-transition-to);
|
|
46692
|
-
clip-path: polygon(0 42%, 100% 8%, 100% 100%, 0 100%);
|
|
46693
|
-
}
|
|
46694
|
-
|
|
46695
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-subtle-'] {
|
|
46696
|
-
--site-style-boundary-height: ${compactBoundaryHeight};
|
|
46697
|
-
}
|
|
46698
|
-
|
|
46699
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-subtle-']::after {
|
|
46700
|
-
clip-path: polygon(0 34%, 100% 18%, 100% 100%, 0 100%);
|
|
46701
|
-
}
|
|
46702
|
-
|
|
46703
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-steep-'] {
|
|
46704
|
-
--site-style-boundary-height: ${largeBoundaryHeight};
|
|
46705
|
-
}
|
|
46706
|
-
|
|
46707
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-angle-edge-steep-']::after {
|
|
46708
|
-
clip-path: polygon(0 54%, 100% 0%, 100% 100%, 0 100%);
|
|
46709
|
-
}
|
|
46710
|
-
|
|
46711
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-']::after {
|
|
46712
|
-
background: var(--site-style-transition-to);
|
|
46713
|
-
mask-image: url("${classicWaveTransitionMask}");
|
|
46714
|
-
mask-repeat: no-repeat;
|
|
46715
|
-
mask-size: 100% 100%;
|
|
46716
|
-
-webkit-mask-image: url("${classicWaveTransitionMask}");
|
|
46717
|
-
-webkit-mask-repeat: no-repeat;
|
|
46718
|
-
-webkit-mask-size: 100% 100%;
|
|
46719
|
-
}
|
|
46720
|
-
|
|
46721
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-balanced-']::after {
|
|
46722
|
-
mask-image: url("${balancedWaveTransitionMask}");
|
|
46723
|
-
-webkit-mask-image: url("${balancedWaveTransitionMask}");
|
|
46724
|
-
}
|
|
46725
|
-
|
|
46726
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-gentle-'] {
|
|
46727
|
-
--site-style-boundary-height: ${compactBoundaryHeight};
|
|
46728
|
-
}
|
|
46729
|
-
|
|
46730
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-gentle-']::after {
|
|
46731
|
-
mask-image: url("${gentleWaveTransitionMask}");
|
|
46732
|
-
-webkit-mask-image: url("${gentleWaveTransitionMask}");
|
|
46733
|
-
}
|
|
46734
|
-
|
|
46735
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-bold-'] {
|
|
46736
|
-
--site-style-boundary-height: ${largeBoundaryHeight};
|
|
46737
|
-
}
|
|
46738
|
-
|
|
46739
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-bold-']::after {
|
|
46740
|
-
mask-image: url("${boldWaveTransitionMask}");
|
|
46741
|
-
-webkit-mask-image: url("${boldWaveTransitionMask}");
|
|
46742
|
-
}
|
|
46743
|
-
|
|
46744
|
-
${selector} [data-block-boundary][data-style-group^='site-style-transition-wave-edge-drift-']::after {
|
|
46745
|
-
mask-image: url("${driftWaveTransitionMask}");
|
|
46746
|
-
-webkit-mask-image: url("${driftWaveTransitionMask}");
|
|
46747
|
-
}`;
|
|
46748
|
-
}
|
|
46749
|
-
function requiredBoundaryHeightCss(transition) {
|
|
46750
|
-
const metrics = boundaryRuntimeMetricsForTransition(transition);
|
|
46751
|
-
if (!metrics) throw new Error(`Missing boundary runtime metrics for ${transition}`);
|
|
46752
|
-
return metrics.heightCss;
|
|
46753
|
-
}
|
|
46754
|
-
function svgDataUrl(svg) {
|
|
46755
|
-
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
46756
|
-
}
|
|
46757
47338
|
function generateHeroTypographyCss(themeId, theme) {
|
|
46758
47339
|
const typography = theme.hero?.typography;
|
|
46759
47340
|
if (!typography) return "";
|
|
@@ -46772,24 +47353,23 @@ function generateHeroTypographyCss(themeId, theme) {
|
|
|
46772
47353
|
if (microHeadlineRules.length > 0) chunks.push(`${microHeadlineSelector} {\n ${microHeadlineRules.join("\n ")}\n}`);
|
|
46773
47354
|
const microSubheadlineRules = buildTypographyRules("subheadline", typography.microSubheadlineSize, typography.microSubheadlineLineHeight);
|
|
46774
47355
|
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
46775
|
-
|
|
46776
|
-
|
|
46777
|
-
|
|
46778
|
-
|
|
46779
|
-
|
|
46780
|
-
|
|
46781
|
-
if (tabletChunks.length > 0) chunks.push(`@media ${MQ_TABLET_ONLY} {\n ${tabletChunks.join("\n\n ")}\n}`);
|
|
46782
|
-
}
|
|
46783
|
-
if (typography.responsive?.mobile) {
|
|
46784
|
-
const mobileHeadlineRules = buildTypographyRules("headline", typography.responsive.mobile.headlineSize, typography.responsive.mobile.headlineLineHeight);
|
|
46785
|
-
const mobileSubheadlineRules = buildTypographyRules("subheadline", typography.responsive.mobile.subheadlineSize, typography.responsive.mobile.subheadlineLineHeight);
|
|
46786
|
-
const mobileChunks = [];
|
|
46787
|
-
if (mobileHeadlineRules.length > 0) mobileChunks.push(`${headlineSelector} {\n ${mobileHeadlineRules.join("\n ")}\n }`);
|
|
46788
|
-
if (mobileSubheadlineRules.length > 0) mobileChunks.push(`${subheadlineSelector} {\n ${mobileSubheadlineRules.join("\n ")}\n }`);
|
|
46789
|
-
if (mobileChunks.length > 0) chunks.push(`@media ${MQ_SM_DOWN} {\n ${mobileChunks.join("\n\n ")}\n}`);
|
|
46790
|
-
}
|
|
47356
|
+
const selectors = {
|
|
47357
|
+
headline: headlineSelector,
|
|
47358
|
+
subheadline: subheadlineSelector
|
|
47359
|
+
};
|
|
47360
|
+
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile)];
|
|
47361
|
+
for (const chunk of responsiveChunks) if (chunk) chunks.push(chunk);
|
|
46791
47362
|
return chunks.join("\n\n");
|
|
46792
47363
|
}
|
|
47364
|
+
function responsiveHeroTypographyCss(media, selectors, overrides) {
|
|
47365
|
+
if (!overrides) return null;
|
|
47366
|
+
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
47367
|
+
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
47368
|
+
const mediaChunks = [];
|
|
47369
|
+
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
47370
|
+
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
47371
|
+
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
47372
|
+
}
|
|
46793
47373
|
function buildTypographyRules(role, size, lineHeight) {
|
|
46794
47374
|
const rules = [];
|
|
46795
47375
|
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
@@ -48768,70 +49348,171 @@ function requireThemeResources(resources, blockKind) {
|
|
|
48768
49348
|
return resources;
|
|
48769
49349
|
}
|
|
48770
49350
|
//#endregion
|
|
48771
|
-
//#region ../blocks/src/
|
|
48772
|
-
|
|
48773
|
-
|
|
48774
|
-
|
|
49351
|
+
//#region ../blocks/src/pageRenderJoins.ts
|
|
49352
|
+
/**
|
|
49353
|
+
* Re-points joins across omitted blocks. Pure over joins.
|
|
49354
|
+
*
|
|
49355
|
+
* Joins are keyed by adjacent block-id pairs, so dropping B from [A, B, C]
|
|
49356
|
+
* removes the A→C join as well as B's own, because no A→C join was ever
|
|
49357
|
+
* resolved. For each surviving pair the original join is kept when the pair
|
|
49358
|
+
* was already adjacent. Across a gap, the treatment comes from the join
|
|
49359
|
+
* entering the omitted run (A→first omitted), falling back to the one leaving
|
|
49360
|
+
* it (last omitted→C). Nothing visual is carried: the survivors are composed
|
|
49361
|
+
* from their own content afterwards.
|
|
49362
|
+
*
|
|
49363
|
+
* `survivors` are compared by identity against `originalBlocks`.
|
|
49364
|
+
*/
|
|
49365
|
+
function retargetJoinsAcrossOmissions(input) {
|
|
49366
|
+
const { joins, originalBlocks, survivingBlocks } = input;
|
|
49367
|
+
if (joins.length === 0) return joins;
|
|
49368
|
+
if (originalBlocks.every((block) => survivingBlocks.has(block))) return joins;
|
|
49369
|
+
const byPair = joinsByPair(joins);
|
|
49370
|
+
const retargeted = [];
|
|
49371
|
+
let previousSurvivor = null;
|
|
49372
|
+
let run = [];
|
|
49373
|
+
for (const block of originalBlocks) {
|
|
49374
|
+
if (!survivingBlocks.has(block)) {
|
|
49375
|
+
run.push(block);
|
|
49376
|
+
continue;
|
|
49377
|
+
}
|
|
49378
|
+
if (previousSurvivor?.id && block.id) {
|
|
49379
|
+
const join = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : joinAcrossRun(byPair, previousSurvivor.id, block.id, run);
|
|
49380
|
+
if (join) retargeted.push(join);
|
|
49381
|
+
}
|
|
49382
|
+
previousSurvivor = block;
|
|
49383
|
+
run = [];
|
|
49384
|
+
}
|
|
49385
|
+
return retargeted;
|
|
49386
|
+
}
|
|
49387
|
+
function joinAcrossRun(byPair, previousBlockId, nextBlockId, run) {
|
|
49388
|
+
const firstOmittedId = run[0]?.id;
|
|
49389
|
+
const lastOmittedId = run[run.length - 1]?.id;
|
|
49390
|
+
const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
|
|
49391
|
+
const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
|
|
49392
|
+
const donor = entering ?? exiting;
|
|
49393
|
+
return donor ? {
|
|
49394
|
+
previousBlockId,
|
|
49395
|
+
nextBlockId,
|
|
49396
|
+
treatment: donor.treatment
|
|
49397
|
+
} : void 0;
|
|
48775
49398
|
}
|
|
48776
|
-
|
|
48777
|
-
|
|
49399
|
+
/**
|
|
49400
|
+
* The single composition site. For every adjacent pair of survivors with ids,
|
|
49401
|
+
* finds its join and composes it from both survivors' final content: what
|
|
49402
|
+
* each paints with and the frame each draws.
|
|
49403
|
+
*/
|
|
49404
|
+
function composePageJoins(input) {
|
|
49405
|
+
const byPair = joinsByPair(input.joins);
|
|
49406
|
+
return input.survivors.flatMap((previous, index) => {
|
|
49407
|
+
const next = input.survivors[index + 1];
|
|
49408
|
+
if (!next || !previous.id || !next.id) return [];
|
|
49409
|
+
const join = byPair.get(pairKey(previous.id, next.id));
|
|
49410
|
+
return [{
|
|
49411
|
+
previousBlockId: previous.id,
|
|
49412
|
+
nextBlockId: next.id,
|
|
49413
|
+
join: join ? composeJoin(join, previous, next) : null
|
|
49414
|
+
}];
|
|
49415
|
+
});
|
|
48778
49416
|
}
|
|
48779
|
-
function
|
|
48780
|
-
|
|
48781
|
-
|
|
48782
|
-
|
|
48783
|
-
|
|
49417
|
+
function composeJoin(join, previous, next) {
|
|
49418
|
+
return {
|
|
49419
|
+
boundaryId: pairKey(join.previousBlockId, join.nextBlockId),
|
|
49420
|
+
previousBlockId: join.previousBlockId,
|
|
49421
|
+
nextBlockId: join.nextBlockId,
|
|
49422
|
+
treatment: join.treatment,
|
|
49423
|
+
outcome: composeBoundary(sectionFactsForContent(previous.content), sectionFactsForContent(next.content))
|
|
49424
|
+
};
|
|
49425
|
+
}
|
|
49426
|
+
/** Placement, reserves and paint for a join that draws; null otherwise. */
|
|
49427
|
+
function renderedJoinLayout(join) {
|
|
49428
|
+
if (!join || join.outcome.kind !== "shown") return null;
|
|
49429
|
+
return boundaryLayout(join.treatment, join.outcome.composition);
|
|
48784
49430
|
}
|
|
48785
|
-
|
|
48786
|
-
|
|
48787
|
-
|
|
49431
|
+
/** Joins with a missing id on either side cannot sit between two blocks. */
|
|
49432
|
+
function joinsByPair(joins) {
|
|
49433
|
+
return new Map(joins.flatMap((join) => join.previousBlockId && join.nextBlockId ? [[pairKey(join.previousBlockId, join.nextBlockId), join]] : []));
|
|
49434
|
+
}
|
|
49435
|
+
/** Slot lookup key for an adjacent pair, in the one boundary-id scheme. */
|
|
49436
|
+
function joinSlotKey(previousBlockId, nextBlockId) {
|
|
49437
|
+
return pairKey(previousBlockId, nextBlockId);
|
|
49438
|
+
}
|
|
49439
|
+
function pairKey(previousBlockId, nextBlockId) {
|
|
49440
|
+
return makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId));
|
|
49441
|
+
}
|
|
49442
|
+
//#endregion
|
|
49443
|
+
//#region ../blocks/src/pageRendererBoundaries.tsx
|
|
49444
|
+
function joinSlotsByPair(slots) {
|
|
49445
|
+
return new Map(slots.map((slot) => [joinSlotKey(slot.previousBlockId, slot.nextBlockId), slot]));
|
|
49446
|
+
}
|
|
49447
|
+
function joinSlotBetween(previousBlockId, nextBlockId, slots) {
|
|
48788
49448
|
if (!previousBlockId || !nextBlockId) return null;
|
|
48789
|
-
|
|
48790
|
-
|
|
48791
|
-
|
|
49449
|
+
return slots.get(joinSlotKey(previousBlockId, nextBlockId)) ?? null;
|
|
49450
|
+
}
|
|
49451
|
+
/**
|
|
49452
|
+
* The markup at one join: the painted boundary element when the join draws,
|
|
49453
|
+
* then whatever `renderJoin` adds. Null when there is nothing to render.
|
|
49454
|
+
*/
|
|
49455
|
+
function renderJoinSlot(input) {
|
|
49456
|
+
const { slot } = input;
|
|
49457
|
+
if (!slot) return null;
|
|
49458
|
+
const layout = renderedJoinLayout(slot.join);
|
|
49459
|
+
const painted = slot.join && layout ? /* @__PURE__ */ jsx("div", {
|
|
48792
49460
|
"aria-hidden": "true",
|
|
48793
49461
|
"data-block-boundary": "",
|
|
48794
|
-
"data-boundary-id":
|
|
48795
|
-
"data-boundary-previous-block-id":
|
|
48796
|
-
"data-boundary-next-block-id":
|
|
48797
|
-
"data-
|
|
48798
|
-
|
|
48799
|
-
|
|
48800
|
-
|
|
48801
|
-
|
|
48802
|
-
|
|
48803
|
-
|
|
48804
|
-
|
|
48805
|
-
|
|
48806
|
-
|
|
49462
|
+
"data-boundary-id": slot.join.boundaryId,
|
|
49463
|
+
"data-boundary-previous-block-id": slot.previousBlockId,
|
|
49464
|
+
"data-boundary-next-block-id": slot.nextBlockId,
|
|
49465
|
+
"data-boundary-treatment": slot.join.treatment,
|
|
49466
|
+
"data-boundary-placement": layout.placement,
|
|
49467
|
+
style: boundaryPaintStyle(layout.paint)
|
|
49468
|
+
}, `${input.blockKey}:boundary`) : null;
|
|
49469
|
+
const extra = input.renderJoin?.({
|
|
49470
|
+
previousBlockId: slot.previousBlockId,
|
|
49471
|
+
nextBlockId: slot.nextBlockId,
|
|
49472
|
+
join: slot.join
|
|
49473
|
+
});
|
|
49474
|
+
if (!painted && (extra === null || extra === void 0)) return null;
|
|
49475
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [painted, extra] }, `${input.blockKey}:join`);
|
|
48807
49476
|
}
|
|
48808
|
-
|
|
48809
|
-
|
|
48810
|
-
|
|
48811
|
-
|
|
48812
|
-
return {
|
|
48813
|
-
...before ? { "--site-style-boundary-before-reserve": before } : {},
|
|
48814
|
-
...after ? { "--site-style-boundary-after-reserve": after } : {}
|
|
48815
|
-
};
|
|
49477
|
+
/**
|
|
49478
|
+
* The one render-edge place a theme token becomes CSS.
|
|
49479
|
+
*/
|
|
49480
|
+
function themeTokenCss(token) {
|
|
49481
|
+
return `rgb(var(--tb-${token}))`;
|
|
48816
49482
|
}
|
|
48817
|
-
function
|
|
48818
|
-
const transitionStyles = isObjectRecord$1(content._transitionStyles) ? content._transitionStyles : null;
|
|
48819
|
-
const cssVars = isObjectRecord$1(transitionStyles?.cssVars) ? transitionStyles.cssVars : null;
|
|
48820
|
-
const from = typeof cssVars?.from === "string" ? cssVars.from : null;
|
|
48821
|
-
const to = typeof cssVars?.to === "string" ? cssVars.to : null;
|
|
48822
|
-
if (!from && !to) return void 0;
|
|
49483
|
+
function boundaryPaintStyle(paint) {
|
|
48823
49484
|
return {
|
|
48824
|
-
|
|
48825
|
-
...
|
|
49485
|
+
"--boundary-shape-paint": themeTokenCss(paint.shape),
|
|
49486
|
+
...paint.band ? { "--boundary-band-paint": themeTokenCss(paint.band) } : {}
|
|
48826
49487
|
};
|
|
48827
49488
|
}
|
|
48828
|
-
|
|
48829
|
-
|
|
48830
|
-
|
|
48831
|
-
|
|
48832
|
-
|
|
48833
|
-
|
|
49489
|
+
/**
|
|
49490
|
+
* Reserve attributes and variables for a block wrapper, from the joins on
|
|
49491
|
+
* either side. A join's `before` reserve sits inside its previous section, so
|
|
49492
|
+
* it pads the bottom of the block above the join; its `after` reserve pads the
|
|
49493
|
+
* top of the block below. Joins that do not draw reserve nothing.
|
|
49494
|
+
*/
|
|
49495
|
+
function blockBoundaryReserves(input) {
|
|
49496
|
+
const top = reserveOnSide(input.before, "after");
|
|
49497
|
+
const bottom = reserveOnSide(input.after, "before");
|
|
49498
|
+
const style = {
|
|
49499
|
+
...top ? { "--site-style-boundary-before-reserve": top.length } : {},
|
|
49500
|
+
...bottom ? { "--site-style-boundary-after-reserve": bottom.length } : {}
|
|
48834
49501
|
};
|
|
49502
|
+
return {
|
|
49503
|
+
topPlacement: top?.placement,
|
|
49504
|
+
bottomPlacement: bottom?.placement,
|
|
49505
|
+
style: top || bottom ? style : void 0
|
|
49506
|
+
};
|
|
49507
|
+
}
|
|
49508
|
+
/** The reserve one join needs on one side of itself, if it draws at all. */
|
|
49509
|
+
function reserveOnSide(slot, side) {
|
|
49510
|
+
const layout = renderedJoinLayout(slot?.join ?? null);
|
|
49511
|
+
const length = layout?.reserves[side] ?? null;
|
|
49512
|
+
return layout && length ? {
|
|
49513
|
+
length,
|
|
49514
|
+
placement: layout.placement
|
|
49515
|
+
} : null;
|
|
48835
49516
|
}
|
|
48836
49517
|
function pageBlockPosition(index, blockCount) {
|
|
48837
49518
|
if (blockCount <= 1) return "only";
|
|
@@ -53556,6 +54237,15 @@ const appointmentServicesBlockDefinition = {
|
|
|
53556
54237
|
required: false,
|
|
53557
54238
|
ui: { intent: "content" }
|
|
53558
54239
|
},
|
|
54240
|
+
createSiteOptionSelectField({
|
|
54241
|
+
id: "categoryId",
|
|
54242
|
+
label: "Category",
|
|
54243
|
+
description: "Show one category (with its heading and intro), or leave it on All categories to show everything grouped.",
|
|
54244
|
+
required: false,
|
|
54245
|
+
multiple: false,
|
|
54246
|
+
optionSource: "appointmentServiceCategories",
|
|
54247
|
+
ui: { intent: "content" }
|
|
54248
|
+
}),
|
|
53559
54249
|
sectionStylesField({
|
|
53560
54250
|
id: "_sectionStyles",
|
|
53561
54251
|
label: "Section styles",
|
|
@@ -53590,6 +54280,7 @@ const appointmentServicesBlockDefinition = {
|
|
|
53590
54280
|
richText({ className: "rb-prose rb-max-w-none" }, bind("content.description"), when("content.description")),
|
|
53591
54281
|
el("appointment-services", {
|
|
53592
54282
|
sectionHeading: { $bind: { from: "content.heading" } },
|
|
54283
|
+
categoryId: { $bind: { from: "content.categoryId" } },
|
|
53593
54284
|
services: { $bind: { from: "data.services" } },
|
|
53594
54285
|
pathname: { $bind: { from: "$root.pathname" } },
|
|
53595
54286
|
servicePathPrefix: { $bind: { from: "$root.appointmentServicePathPrefix" } }
|
|
@@ -58521,11 +59212,10 @@ function buildPageRenderPlan(input) {
|
|
|
58521
59212
|
return {
|
|
58522
59213
|
entries,
|
|
58523
59214
|
omitted,
|
|
58524
|
-
|
|
58525
|
-
|
|
59215
|
+
runtimeJoins: retargetJoinsAcrossOmissions({
|
|
59216
|
+
joins: input.runtimeJoins ?? [],
|
|
58526
59217
|
originalBlocks: input.page.blocks,
|
|
58527
|
-
survivingBlocks: new Set(entries.map((entry) => entry.block))
|
|
58528
|
-
previewStage: input.previewStage
|
|
59218
|
+
survivingBlocks: new Set(entries.map((entry) => entry.block))
|
|
58529
59219
|
})
|
|
58530
59220
|
};
|
|
58531
59221
|
}
|
|
@@ -58627,86 +59317,15 @@ function getBlockOverride(blockKind, overrides) {
|
|
|
58627
59317
|
* For draft/preview: draftContent takes priority over content.
|
|
58628
59318
|
* For published: content is the source of truth.
|
|
58629
59319
|
*/
|
|
59320
|
+
/**
|
|
59321
|
+
* The content a block renders with. Every render path (public, preview,
|
|
59322
|
+
* templates, SDK) chooses content here, so this is also where a stale
|
|
59323
|
+
* `site-style-transition-*` styleGroup is dropped; authored values survive.
|
|
59324
|
+
*/
|
|
58630
59325
|
function getRenderableContent(block, previewStage = "published") {
|
|
58631
59326
|
const source = previewStage === "preview" && block.draftContent ? block.draftContent : block.content ?? {};
|
|
58632
|
-
return isObjectRecord$1(source) ? source : {};
|
|
58633
|
-
}
|
|
58634
|
-
/**
|
|
58635
|
-
* Re-points section boundaries across omitted blocks.
|
|
58636
|
-
*
|
|
58637
|
-
* Boundaries are keyed by adjacent block-id *pairs*, so dropping B from
|
|
58638
|
-
* [A, B, C] does not merely remove B's boundaries — it removes the boundary
|
|
58639
|
-
* between the survivors, because no `A→C` key was ever compiled.
|
|
58640
|
-
*
|
|
58641
|
-
* Per decision D2 the treatment for a merged gap comes from the boundary
|
|
58642
|
-
* entering the omitted run (`A→firstOmitted`), falling back to the one leaving
|
|
58643
|
-
* it (`lastOmitted→C`). The destination surface is a separate question: only
|
|
58644
|
-
* the exiting boundary knows what C looks like, so the merged boundary ends on
|
|
58645
|
-
* that endpoint rather than on the omitted block's. In the exiting-only
|
|
58646
|
-
* fallback the origin remains an approximation: `from` is the omitted block's
|
|
58647
|
-
* surface, because no compiled boundary carries A's. The hosted path no longer
|
|
58648
|
-
* needs this at all (site-renderer admits blocks before compiling boundaries);
|
|
58649
|
-
* it remains the safety net for an SDK whose compiled boundaries predate an
|
|
58650
|
-
* omission.
|
|
58651
|
-
*/
|
|
58652
|
-
function retargetBoundariesAcrossOmissions(input) {
|
|
58653
|
-
const { boundaries, originalBlocks, survivingBlocks, previewStage } = input;
|
|
58654
|
-
if (boundaries === void 0) return void 0;
|
|
58655
|
-
if (boundaries.length === 0) return boundaries;
|
|
58656
|
-
if (!originalBlocks.some((block) => !survivingBlocks.has(block))) return boundaries;
|
|
58657
|
-
const byPair = new Map(boundaries.map((boundary) => [pairKey(boundary.previousBlockId, boundary.nextBlockId), boundary]));
|
|
58658
|
-
const retargeted = [];
|
|
58659
|
-
let previousSurvivor = null;
|
|
58660
|
-
let run = [];
|
|
58661
|
-
for (const block of originalBlocks) {
|
|
58662
|
-
if (!survivingBlocks.has(block)) {
|
|
58663
|
-
run.push(block);
|
|
58664
|
-
continue;
|
|
58665
|
-
}
|
|
58666
|
-
if (previousSurvivor?.id && block.id) {
|
|
58667
|
-
const boundary = run.length === 0 ? byPair.get(pairKey(previousSurvivor.id, block.id)) : mergedBoundary({
|
|
58668
|
-
byPair,
|
|
58669
|
-
previousBlock: previousSurvivor,
|
|
58670
|
-
previousBlockId: previousSurvivor.id,
|
|
58671
|
-
nextBlock: block,
|
|
58672
|
-
nextBlockId: block.id,
|
|
58673
|
-
run,
|
|
58674
|
-
previewStage
|
|
58675
|
-
});
|
|
58676
|
-
if (boundary) retargeted.push(boundary);
|
|
58677
|
-
}
|
|
58678
|
-
previousSurvivor = block;
|
|
58679
|
-
run = [];
|
|
58680
|
-
}
|
|
58681
|
-
return retargeted;
|
|
58682
|
-
}
|
|
58683
|
-
function mergedBoundary(input) {
|
|
58684
|
-
const { byPair, previousBlock, previousBlockId, nextBlock, nextBlockId, run, previewStage } = input;
|
|
58685
|
-
const firstOmittedId = run[0]?.id;
|
|
58686
|
-
const lastOmittedId = run[run.length - 1]?.id;
|
|
58687
|
-
const entering = firstOmittedId ? byPair.get(pairKey(previousBlockId, firstOmittedId)) : void 0;
|
|
58688
|
-
const exiting = lastOmittedId ? byPair.get(pairKey(lastOmittedId, nextBlockId)) : void 0;
|
|
58689
|
-
const donor = entering ?? exiting;
|
|
58690
|
-
if (!donor) return void 0;
|
|
58691
|
-
const transition = compileTransitionRuntime({
|
|
58692
|
-
treatment: donor.treatment,
|
|
58693
|
-
from: donor.from,
|
|
58694
|
-
to: exiting?.to ?? donor.to
|
|
58695
|
-
});
|
|
58696
|
-
return retargetCompiledBoundaryRuntimeForContentAdjacency({
|
|
58697
|
-
...donor,
|
|
58698
|
-
boundaryId: makeBoundaryId(asDesignBlockId(previousBlockId), asDesignBlockId(nextBlockId)),
|
|
58699
|
-
previousBlockId,
|
|
58700
|
-
nextBlockId,
|
|
58701
|
-
from: transition.from,
|
|
58702
|
-
to: transition.to,
|
|
58703
|
-
cssVars: transition.cssVars
|
|
58704
|
-
}, {
|
|
58705
|
-
currentContent: getRenderableContent(previousBlock, previewStage),
|
|
58706
|
-
nextContent: getRenderableContent(nextBlock, previewStage)
|
|
58707
|
-
});
|
|
59327
|
+
return isObjectRecord$1(source) ? stripStaleTransitionStyleGroup(source) : {};
|
|
58708
59328
|
}
|
|
58709
|
-
const pairKey = boundaryKey;
|
|
58710
59329
|
//#endregion
|
|
58711
59330
|
//#region ../blocks/src/system/manifest/hydrateLinks.ts
|
|
58712
59331
|
/**
|
|
@@ -58741,7 +59360,7 @@ function hydrateResolvedBookingConsentValue(value, context) {
|
|
|
58741
59360
|
const hydratedItems = value.map((item) => hydrateResolvedBookingConsentValue(item, context));
|
|
58742
59361
|
return hydratedItems.every((item, index) => item === value[index]) ? value : hydratedItems;
|
|
58743
59362
|
}
|
|
58744
|
-
if (!isRecord$
|
|
59363
|
+
if (!isRecord$25(value)) return value;
|
|
58745
59364
|
if (isBookingConsentCarrier(value)) {
|
|
58746
59365
|
const agreement = hydrateValue(value.agreement, context);
|
|
58747
59366
|
return agreement === value.agreement ? value : {
|
|
@@ -58761,7 +59380,7 @@ function hydrateValue(value, context) {
|
|
|
58761
59380
|
const resolvedItems = value.map((item) => hydrateValue(item, context));
|
|
58762
59381
|
return resolvedItems.every((item, index) => item === value[index]) ? value : resolvedItems;
|
|
58763
59382
|
}
|
|
58764
|
-
if (isRecord$
|
|
59383
|
+
if (isRecord$25(value)) {
|
|
58765
59384
|
if (isInternalLink$1(value)) return hydrateInternalLink(value, context.routes);
|
|
58766
59385
|
if (isPageLink$1(value)) return hydratePageLink(value, context);
|
|
58767
59386
|
if (isEntryLink$1(value)) return hydrateEntryLink(value, context);
|
|
@@ -58826,7 +59445,7 @@ function hydrateEntryLink(link, context) {
|
|
|
58826
59445
|
//#region ../blocks/src/system/manifest/resolveBlockData.ts
|
|
58827
59446
|
function resolveBlockData$1(blockId, dataLoaders, dataContext, routes) {
|
|
58828
59447
|
const raw = blockId ? dataContext?.resolvedData?.[blockId] : void 0;
|
|
58829
|
-
if (isRecord$
|
|
59448
|
+
if (isRecord$25(raw)) return routes ? hydrateResolvedBookingConsentLinks(raw, routes, dataContext?.pagesByIdentifier, dataContext?.entriesByIdentifier) : raw;
|
|
58830
59449
|
return dataLoaders && typeof dataLoaders === "object" && Object.keys(dataLoaders).length > 0 ? {} : void 0;
|
|
58831
59450
|
}
|
|
58832
59451
|
//#endregion
|
|
@@ -58861,23 +59480,44 @@ function preparePageRender(input) {
|
|
|
58861
59480
|
prepared
|
|
58862
59481
|
});
|
|
58863
59482
|
}
|
|
58864
|
-
|
|
58865
|
-
entries,
|
|
58866
|
-
constructionFailures,
|
|
58867
|
-
runtimeBoundaries: input.plan.runtimeBoundaries
|
|
58868
|
-
};
|
|
58869
|
-
const survivors = entries.filter((candidate) => candidate.prepared.kind !== "render-threw");
|
|
59483
|
+
const survivors = input.audience === "authoring" ? entries : entries.filter((candidate) => candidate.prepared.kind !== "render-threw");
|
|
58870
59484
|
return {
|
|
58871
59485
|
entries: survivors,
|
|
58872
59486
|
constructionFailures,
|
|
58873
|
-
|
|
58874
|
-
boundaries: input.plan.runtimeBoundaries,
|
|
58875
|
-
originalBlocks: input.plan.entries.map((planned) => planned.block),
|
|
58876
|
-
survivingBlocks: new Set(survivors.map((survivor) => survivor.entry.block)),
|
|
58877
|
-
previewStage: input.previewStage
|
|
58878
|
-
})
|
|
59487
|
+
joins: composeSurvivorJoins(input.plan, survivors, input.themeResources)
|
|
58879
59488
|
};
|
|
58880
59489
|
}
|
|
59490
|
+
/**
|
|
59491
|
+
* The only place joins are composed. Plan-time omissions were already
|
|
59492
|
+
* re-pointed by the plan; construction failures are re-pointed here by the
|
|
59493
|
+
* same primitive, so `[A, B, C]` losing B still gets an A→C join. Each
|
|
59494
|
+
* survivor is then classified from its final content.
|
|
59495
|
+
*/
|
|
59496
|
+
function composeSurvivorJoins(plan, survivors, themeResources) {
|
|
59497
|
+
return composePageJoins({
|
|
59498
|
+
joins: retargetJoinsAcrossOmissions({
|
|
59499
|
+
joins: plan.runtimeJoins,
|
|
59500
|
+
originalBlocks: plan.entries.map((planned) => planned.block),
|
|
59501
|
+
survivingBlocks: new Set(survivors.map((survivor) => survivor.entry.block))
|
|
59502
|
+
}),
|
|
59503
|
+
survivors: survivors.map(({ entry }) => ({
|
|
59504
|
+
id: entry.block.id,
|
|
59505
|
+
kind: entry.block.kind,
|
|
59506
|
+
content: boundaryClassificationContent(entry, themeResources)
|
|
59507
|
+
}))
|
|
59508
|
+
});
|
|
59509
|
+
}
|
|
59510
|
+
/**
|
|
59511
|
+
* The content a join is classified from must be the content that paints the
|
|
59512
|
+
* section. The default block renderer layers the theme's per-block style
|
|
59513
|
+
* defaults (`theme.blockOverrides[kind].styles`, background included) under
|
|
59514
|
+
* the block's own `_sectionStyles`, so classify that same projection. An
|
|
59515
|
+
* override component renders its own markup from the unmerged content.
|
|
59516
|
+
*/
|
|
59517
|
+
function boundaryClassificationContent(entry, themeResources) {
|
|
59518
|
+
if (entry.kind !== "renderable" || entry.override) return entry.renderableContent;
|
|
59519
|
+
return mergeContentWithBlockStyleOverrides(entry.renderableContent, themeResources.kind === "available" ? themeResources.config : void 0, entry.block.kind);
|
|
59520
|
+
}
|
|
58881
59521
|
function prepareEntry(entry, input) {
|
|
58882
59522
|
if (entry.kind !== "renderable") return { kind: "plan-decided" };
|
|
58883
59523
|
const draftContent = previewableEditorContent(entry);
|
|
@@ -59084,7 +59724,7 @@ function EditorPageRenderer$1(props) {
|
|
|
59084
59724
|
});
|
|
59085
59725
|
}
|
|
59086
59726
|
function PageRendererCore(props) {
|
|
59087
|
-
const { page, audience,
|
|
59727
|
+
const { page, audience, runtimeJoins, dataContext, routeMap, registry, sdkConfig, customBlocks, blockOverrides } = props;
|
|
59088
59728
|
const imageResolveContext = React$1.useMemo(() => resolvePageRendererImageResolveContext(dataContext), [
|
|
59089
59729
|
dataContext?.imageResolveContext,
|
|
59090
59730
|
dataContext?.mediaAssets,
|
|
@@ -59100,7 +59740,7 @@ function PageRendererCore(props) {
|
|
|
59100
59740
|
blocks: []
|
|
59101
59741
|
},
|
|
59102
59742
|
audience,
|
|
59103
|
-
|
|
59743
|
+
runtimeJoins,
|
|
59104
59744
|
previewStage,
|
|
59105
59745
|
sdkConfig,
|
|
59106
59746
|
customBlocks,
|
|
@@ -59108,7 +59748,7 @@ function PageRendererCore(props) {
|
|
|
59108
59748
|
}), [
|
|
59109
59749
|
page,
|
|
59110
59750
|
audience,
|
|
59111
|
-
|
|
59751
|
+
runtimeJoins,
|
|
59112
59752
|
previewStage,
|
|
59113
59753
|
sdkConfig,
|
|
59114
59754
|
customBlocks,
|
|
@@ -59125,19 +59765,16 @@ function PageRendererCore(props) {
|
|
|
59125
59765
|
dataContext,
|
|
59126
59766
|
routeMap,
|
|
59127
59767
|
themeResources,
|
|
59128
|
-
imageResolveContext
|
|
59129
|
-
previewStage
|
|
59768
|
+
imageResolveContext
|
|
59130
59769
|
}), [
|
|
59131
59770
|
plan,
|
|
59132
59771
|
audience,
|
|
59133
59772
|
dataContext,
|
|
59134
59773
|
routeMap,
|
|
59135
59774
|
themeResources,
|
|
59136
|
-
imageResolveContext
|
|
59137
|
-
previewStage
|
|
59775
|
+
imageResolveContext
|
|
59138
59776
|
]);
|
|
59139
|
-
const
|
|
59140
|
-
const usesRuntimeBoundaries = preparation.runtimeBoundaries !== void 0;
|
|
59777
|
+
const joinSlots = React$1.useMemo(() => joinSlotsByPair(preparation.joins), [preparation.joins]);
|
|
59141
59778
|
reportAndReplayOmissions({
|
|
59142
59779
|
plan,
|
|
59143
59780
|
preparation,
|
|
@@ -59155,10 +59792,9 @@ function PageRendererCore(props) {
|
|
|
59155
59792
|
themeResources,
|
|
59156
59793
|
imageResolveContext,
|
|
59157
59794
|
resolvedRegistry,
|
|
59158
|
-
|
|
59159
|
-
usesRuntimeBoundaries,
|
|
59795
|
+
joinSlots,
|
|
59160
59796
|
wrapBlock: props.wrapBlock,
|
|
59161
|
-
|
|
59797
|
+
renderJoin: props.renderJoin
|
|
59162
59798
|
})) });
|
|
59163
59799
|
}
|
|
59164
59800
|
/**
|
|
@@ -59247,27 +59883,25 @@ function requireEntryBlockOverride(entry, themeResources) {
|
|
|
59247
59883
|
}
|
|
59248
59884
|
/**
|
|
59249
59885
|
* Renders one planned block: its wrapper, style-group data attributes,
|
|
59250
|
-
* boundary reserve space and
|
|
59886
|
+
* boundary reserve space and the join markup that follows it.
|
|
59251
59887
|
*
|
|
59252
59888
|
* Extracted from PageRendererCore so the component stays about wiring the plan
|
|
59253
59889
|
* rather than also owning per-block markup.
|
|
59254
59890
|
*/
|
|
59255
59891
|
function renderPlanEntry(input) {
|
|
59256
|
-
const { index, entries, props, themeResources, imageResolveContext, resolvedRegistry,
|
|
59892
|
+
const { index, entries, props, themeResources, imageResolveContext, resolvedRegistry, joinSlots, wrapBlock, renderJoin } = input;
|
|
59257
59893
|
const entry = input.entry.entry;
|
|
59258
59894
|
const block = entry.block;
|
|
59259
59895
|
const blockPosition = pageBlockPosition(index, entries.length);
|
|
59260
59896
|
const blockKey = blockKeyFor(block, index);
|
|
59261
59897
|
const previousBlock = entries[index - 1]?.entry.block ?? null;
|
|
59262
59898
|
const nextBlock = entries[index + 1]?.entry.block ?? null;
|
|
59263
|
-
const
|
|
59264
|
-
const
|
|
59265
|
-
const boundaryElement =
|
|
59266
|
-
|
|
59267
|
-
nextBlock,
|
|
59899
|
+
const joinBefore = joinSlotBetween(previousBlock?.id, block.id, joinSlots);
|
|
59900
|
+
const joinAfter = joinSlotBetween(block.id, nextBlock?.id, joinSlots);
|
|
59901
|
+
const boundaryElement = renderJoinSlot({
|
|
59902
|
+
slot: joinAfter,
|
|
59268
59903
|
blockKey,
|
|
59269
|
-
|
|
59270
|
-
wrapBoundary
|
|
59904
|
+
renderJoin
|
|
59271
59905
|
});
|
|
59272
59906
|
const cleanKind = block.kind.replace(/^block\./, "");
|
|
59273
59907
|
const managesOwnWrapper = entry.kind === "renderable" && entry.managesOwnWrapper;
|
|
@@ -59290,11 +59924,10 @@ function renderPlanEntry(input) {
|
|
|
59290
59924
|
const styleGroup = typeof renderableContent.styleGroup === "string" ? renderableContent.styleGroup : void 0;
|
|
59291
59925
|
const blockLook = typeof renderableContent.blockLook === "string" ? renderableContent.blockLook : void 0;
|
|
59292
59926
|
const blockComposition = readBlockComposition(renderableContent.blockComposition);
|
|
59293
|
-
const
|
|
59294
|
-
|
|
59295
|
-
|
|
59296
|
-
|
|
59297
|
-
}));
|
|
59927
|
+
const reserves = blockBoundaryReserves({
|
|
59928
|
+
before: joinBefore,
|
|
59929
|
+
after: joinAfter
|
|
59930
|
+
});
|
|
59298
59931
|
const blockElement = /* @__PURE__ */ jsx("div", {
|
|
59299
59932
|
className: wrapperClassName,
|
|
59300
59933
|
"data-block": cleanKind,
|
|
@@ -59306,21 +59939,14 @@ function renderPlanEntry(input) {
|
|
|
59306
59939
|
"data-block-composition": blockComposition?.treatment,
|
|
59307
59940
|
"data-block-composition-kind": blockComposition?.kind,
|
|
59308
59941
|
"data-page-block-position": blockPosition,
|
|
59309
|
-
"data-site-style-boundary-before":
|
|
59310
|
-
"data-site-style-boundary-after":
|
|
59942
|
+
"data-site-style-boundary-before": reserves.topPlacement,
|
|
59943
|
+
"data-site-style-boundary-after": reserves.bottomPlacement,
|
|
59311
59944
|
"data-style-group": styleGroup,
|
|
59312
|
-
style:
|
|
59945
|
+
style: reserves.style,
|
|
59313
59946
|
children: /* @__PURE__ */ jsx(MemoBlockSection, { ...blockSectionProps })
|
|
59314
59947
|
}, blockKey);
|
|
59315
59948
|
if (boundaryElement) return /* @__PURE__ */ jsxs(React$1.Fragment, { children: [blockElement, boundaryElement] }, blockKey);
|
|
59316
|
-
|
|
59317
|
-
return /* @__PURE__ */ jsxs(React$1.Fragment, { children: [blockElement, /* @__PURE__ */ jsx("div", {
|
|
59318
|
-
"aria-hidden": "true",
|
|
59319
|
-
"data-block-transition": "",
|
|
59320
|
-
"data-block-transition-for": block.id ?? blockKey,
|
|
59321
|
-
"data-style-group": styleGroup,
|
|
59322
|
-
style: transitionStyle
|
|
59323
|
-
})] }, blockKey);
|
|
59949
|
+
return blockElement;
|
|
59324
59950
|
}
|
|
59325
59951
|
function resolvePageRendererImageResolveContext(dataContext) {
|
|
59326
59952
|
const input = dataContext?.imageResolveContext;
|
|
@@ -73087,7 +73713,7 @@ function toBlocksPageRendererDataContext(dataContext) {
|
|
|
73087
73713
|
function toBlocksCommonProps(props) {
|
|
73088
73714
|
return {
|
|
73089
73715
|
page: props.page,
|
|
73090
|
-
|
|
73716
|
+
runtimeJoins: props.runtimeJoins,
|
|
73091
73717
|
dataContext: props.dataContext ? toBlocksPageRendererDataContext(props.dataContext) : void 0,
|
|
73092
73718
|
routeMap: props.routeMap,
|
|
73093
73719
|
wrapBlock: props.wrapBlock,
|
|
@@ -73210,10 +73836,10 @@ function buildPageRouteRenderContext(dataContext) {
|
|
|
73210
73836
|
};
|
|
73211
73837
|
}
|
|
73212
73838
|
function PageContent(props) {
|
|
73213
|
-
const { page,
|
|
73839
|
+
const { page, runtimeJoins, siteId, resolvedData, bookingOfferingPresets, mailingList, bookingTimeZone, routeMap, pagesByIdentifier, entriesByIdentifier, wrapBlock, registry, blockOverrides, sdkConfig, customBlocks, supabaseUrl, mediaAssets, apiBaseUrl, portalToken, previewToken, readAuthority, dataContext } = props;
|
|
73214
73840
|
const rendererCommonProps = {
|
|
73215
73841
|
page,
|
|
73216
|
-
|
|
73842
|
+
runtimeJoins,
|
|
73217
73843
|
dataContext: {
|
|
73218
73844
|
siteId,
|
|
73219
73845
|
...buildPageRouteRenderContext(dataContext),
|
|
@@ -75041,6 +75667,17 @@ function coerceToString(value) {
|
|
|
75041
75667
|
return "";
|
|
75042
75668
|
}
|
|
75043
75669
|
/**
|
|
75670
|
+
* The appointment-services catalogue (issue 1403) pairs the services with the
|
|
75671
|
+
* site's ordered categories. Both are needed to group them, so that response
|
|
75672
|
+
* is passed through whole; any other `{ services }` wrapper is unwrapped.
|
|
75673
|
+
*/
|
|
75674
|
+
function coerceServicesPayload(record) {
|
|
75675
|
+
return Array.isArray(record.services) && Array.isArray(record.categories) ? {
|
|
75676
|
+
services: record.services,
|
|
75677
|
+
categories: record.categories
|
|
75678
|
+
} : record.services;
|
|
75679
|
+
}
|
|
75680
|
+
/**
|
|
75044
75681
|
* Extract data from API response.
|
|
75045
75682
|
* Unwraps common response wrappers: { data }, { form }, { entries }, { services }, { teamMembers }
|
|
75046
75683
|
*
|
|
@@ -75055,7 +75692,7 @@ function coercePayload(payload) {
|
|
|
75055
75692
|
if ("data" in record && typeof record.data !== "function") return record.data;
|
|
75056
75693
|
if ("form" in record && typeof record.form !== "function") return record.form;
|
|
75057
75694
|
if ("entries" in record && typeof record.entries !== "function") return record.entries;
|
|
75058
|
-
if ("services" in record && typeof record.services !== "function") return record
|
|
75695
|
+
if ("services" in record && typeof record.services !== "function") return coerceServicesPayload(record);
|
|
75059
75696
|
if ("teamMembers" in record && typeof record.teamMembers !== "function") return record.teamMembers;
|
|
75060
75697
|
}
|
|
75061
75698
|
return payload;
|
|
@@ -75776,6 +76413,75 @@ z$1.object({
|
|
|
75776
76413
|
className: z$1.string().nullable().optional()
|
|
75777
76414
|
});
|
|
75778
76415
|
//#endregion
|
|
76416
|
+
//#region ../api/src/defineEndpointDefinitions.ts
|
|
76417
|
+
/**
|
|
76418
|
+
* Validates extracted endpoint descriptors while preserving each literal path,
|
|
76419
|
+
* method, and parameter contract for the typed URL builders.
|
|
76420
|
+
*/
|
|
76421
|
+
function defineEndpointDefinitions(definitions) {
|
|
76422
|
+
return definitions;
|
|
76423
|
+
}
|
|
76424
|
+
//#endregion
|
|
76425
|
+
//#region ../api/src/publicNewsletterEndpointDefinitions.ts
|
|
76426
|
+
const PUBLIC_NEWSLETTER_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
76427
|
+
subscribeNewsletter: {
|
|
76428
|
+
path: "/public/sites/{siteId}/newsletter/subscribe",
|
|
76429
|
+
method: "POST",
|
|
76430
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76431
|
+
auth: "public",
|
|
76432
|
+
responseKind: "json"
|
|
76433
|
+
},
|
|
76434
|
+
confirmNewsletter: {
|
|
76435
|
+
path: "/public/sites/{siteId}/newsletter/confirm/{token}",
|
|
76436
|
+
method: "GET",
|
|
76437
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76438
|
+
auth: "public",
|
|
76439
|
+
responseKind: "text"
|
|
76440
|
+
},
|
|
76441
|
+
unsubscribeNewsletter: {
|
|
76442
|
+
path: "/public/sites/{siteId}/newsletter/unsubscribe/{token}",
|
|
76443
|
+
method: "GET",
|
|
76444
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76445
|
+
auth: "public",
|
|
76446
|
+
responseKind: "text"
|
|
76447
|
+
},
|
|
76448
|
+
unsubscribeNewsletterPost: {
|
|
76449
|
+
path: "/public/sites/{siteId}/newsletter/unsubscribe/{token}",
|
|
76450
|
+
method: "POST",
|
|
76451
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76452
|
+
auth: "public",
|
|
76453
|
+
responseKind: "text"
|
|
76454
|
+
},
|
|
76455
|
+
confirmNewsletterPost: {
|
|
76456
|
+
path: "/public/sites/{siteId}/newsletter/confirm/{token}",
|
|
76457
|
+
method: "POST",
|
|
76458
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76459
|
+
auth: "public",
|
|
76460
|
+
responseKind: "text"
|
|
76461
|
+
},
|
|
76462
|
+
getNewsletterPreferences: {
|
|
76463
|
+
path: "/public/sites/{siteId}/newsletter/preferences/{token}",
|
|
76464
|
+
method: "GET",
|
|
76465
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76466
|
+
auth: "public",
|
|
76467
|
+
responseKind: "text"
|
|
76468
|
+
},
|
|
76469
|
+
saveNewsletterPreferences: {
|
|
76470
|
+
path: "/public/sites/{siteId}/newsletter/preferences/{token}",
|
|
76471
|
+
method: "POST",
|
|
76472
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76473
|
+
auth: "public",
|
|
76474
|
+
responseKind: "text"
|
|
76475
|
+
},
|
|
76476
|
+
getNewsletterArchive: {
|
|
76477
|
+
path: "/public/sites/{siteId}/newsletter/archive/{token}",
|
|
76478
|
+
method: "GET",
|
|
76479
|
+
tags: ["public-newsletter-{siteId}"],
|
|
76480
|
+
auth: "public",
|
|
76481
|
+
responseKind: "text"
|
|
76482
|
+
}
|
|
76483
|
+
});
|
|
76484
|
+
//#endregion
|
|
75779
76485
|
//#region ../api/src/apiEndpointTypes.ts
|
|
75780
76486
|
function allowedDemoMutationPolicy() {
|
|
75781
76487
|
return {
|
|
@@ -75865,17 +76571,85 @@ const SDK_ENTRY_READ_ENDPOINTS = {
|
|
|
75865
76571
|
}
|
|
75866
76572
|
};
|
|
75867
76573
|
//#endregion
|
|
75868
|
-
//#region ../api/src/defineEndpointDefinitions.ts
|
|
75869
|
-
/**
|
|
75870
|
-
* Validates extracted endpoint descriptors while preserving each literal path,
|
|
75871
|
-
* method, and parameter contract for the typed URL builders.
|
|
75872
|
-
*/
|
|
75873
|
-
function defineEndpointDefinitions(definitions) {
|
|
75874
|
-
return definitions;
|
|
75875
|
-
}
|
|
75876
|
-
//#endregion
|
|
75877
76574
|
//#region ../api/src/appointmentEndpointDefinitions.ts
|
|
75878
76575
|
const APPOINTMENT_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
76576
|
+
...defineEndpointDefinitions({
|
|
76577
|
+
listGroupedAppointmentServices: {
|
|
76578
|
+
path: "/sites/{siteId}/bookings/services/grouped",
|
|
76579
|
+
method: "GET",
|
|
76580
|
+
auth: "user",
|
|
76581
|
+
responseKind: "json",
|
|
76582
|
+
errors: ["server:internal_error"]
|
|
76583
|
+
},
|
|
76584
|
+
reorderAppointmentServices: {
|
|
76585
|
+
path: "/sites/{siteId}/bookings/services/order",
|
|
76586
|
+
method: "PUT",
|
|
76587
|
+
auth: "user",
|
|
76588
|
+
responseKind: "json",
|
|
76589
|
+
errors: [
|
|
76590
|
+
"validation:invalid_input",
|
|
76591
|
+
"auth:forbidden",
|
|
76592
|
+
"resource:not_found",
|
|
76593
|
+
"resource:conflict",
|
|
76594
|
+
"server:internal_error"
|
|
76595
|
+
]
|
|
76596
|
+
},
|
|
76597
|
+
listAppointmentServiceCategories: {
|
|
76598
|
+
path: "/sites/{siteId}/bookings/service-categories",
|
|
76599
|
+
method: "GET",
|
|
76600
|
+
auth: "user",
|
|
76601
|
+
responseKind: "json",
|
|
76602
|
+
errors: ["server:internal_error"]
|
|
76603
|
+
},
|
|
76604
|
+
createAppointmentServiceCategory: {
|
|
76605
|
+
path: "/sites/{siteId}/bookings/service-categories",
|
|
76606
|
+
method: "POST",
|
|
76607
|
+
auth: "user",
|
|
76608
|
+
responseKind: "json",
|
|
76609
|
+
errors: [
|
|
76610
|
+
"validation:invalid_input",
|
|
76611
|
+
"auth:forbidden",
|
|
76612
|
+
"resource:conflict",
|
|
76613
|
+
"server:internal_error"
|
|
76614
|
+
]
|
|
76615
|
+
},
|
|
76616
|
+
updateAppointmentServiceCategory: {
|
|
76617
|
+
path: "/sites/{siteId}/bookings/service-categories/{categoryId}",
|
|
76618
|
+
method: "PUT",
|
|
76619
|
+
auth: "user",
|
|
76620
|
+
responseKind: "json",
|
|
76621
|
+
errors: [
|
|
76622
|
+
"validation:invalid_input",
|
|
76623
|
+
"auth:forbidden",
|
|
76624
|
+
"resource:not_found",
|
|
76625
|
+
"resource:conflict",
|
|
76626
|
+
"server:internal_error"
|
|
76627
|
+
]
|
|
76628
|
+
},
|
|
76629
|
+
deleteAppointmentServiceCategory: {
|
|
76630
|
+
path: "/sites/{siteId}/bookings/service-categories/{categoryId}",
|
|
76631
|
+
method: "DELETE",
|
|
76632
|
+
auth: "user",
|
|
76633
|
+
responseKind: "json",
|
|
76634
|
+
errors: [
|
|
76635
|
+
"auth:forbidden",
|
|
76636
|
+
"resource:not_found",
|
|
76637
|
+
"server:internal_error"
|
|
76638
|
+
]
|
|
76639
|
+
},
|
|
76640
|
+
reorderAppointmentServiceCategories: {
|
|
76641
|
+
path: "/sites/{siteId}/bookings/service-categories/order",
|
|
76642
|
+
method: "PUT",
|
|
76643
|
+
auth: "user",
|
|
76644
|
+
responseKind: "json",
|
|
76645
|
+
errors: [
|
|
76646
|
+
"validation:invalid_input",
|
|
76647
|
+
"auth:forbidden",
|
|
76648
|
+
"resource:conflict",
|
|
76649
|
+
"server:internal_error"
|
|
76650
|
+
]
|
|
76651
|
+
}
|
|
76652
|
+
}),
|
|
75879
76653
|
listAppointmentResources: {
|
|
75880
76654
|
path: "/sites/{siteId}/bookings/resources",
|
|
75881
76655
|
method: "GET",
|
|
@@ -77023,39 +77797,6 @@ const NEWSLETTER_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
77023
77797
|
auth: "user",
|
|
77024
77798
|
responseKind: "json",
|
|
77025
77799
|
demoMutation: DEMO_MUTATION_BLOCKED_HIDDEN
|
|
77026
|
-
},
|
|
77027
|
-
listNewsletterSendJobs: {
|
|
77028
|
-
path: "/sites/{siteId}/newsletter/jobs",
|
|
77029
|
-
method: "GET",
|
|
77030
|
-
tags: [TAG_TEMPLATES.site, TAG_TEMPLATES.siteNewsletter],
|
|
77031
|
-
auth: "user",
|
|
77032
|
-
responseKind: "json"
|
|
77033
|
-
},
|
|
77034
|
-
retryNewsletterSendJob: {
|
|
77035
|
-
path: "/sites/{siteId}/newsletter/jobs/{jobId}/retry",
|
|
77036
|
-
method: "POST",
|
|
77037
|
-
errors: [
|
|
77038
|
-
"validation:invalid_input",
|
|
77039
|
-
"resource:not_found",
|
|
77040
|
-
"auth:forbidden",
|
|
77041
|
-
"server:internal_error"
|
|
77042
|
-
],
|
|
77043
|
-
tags: [TAG_TEMPLATES.site, TAG_TEMPLATES.siteNewsletter],
|
|
77044
|
-
auth: "user",
|
|
77045
|
-
responseKind: "json"
|
|
77046
|
-
},
|
|
77047
|
-
cancelNewsletterSendJob: {
|
|
77048
|
-
path: "/sites/{siteId}/newsletter/jobs/{jobId}/cancel",
|
|
77049
|
-
method: "POST",
|
|
77050
|
-
errors: [
|
|
77051
|
-
"validation:invalid_input",
|
|
77052
|
-
"resource:not_found",
|
|
77053
|
-
"auth:forbidden",
|
|
77054
|
-
"server:internal_error"
|
|
77055
|
-
],
|
|
77056
|
-
tags: [TAG_TEMPLATES.site, TAG_TEMPLATES.siteNewsletter],
|
|
77057
|
-
auth: "user",
|
|
77058
|
-
responseKind: "json"
|
|
77059
77800
|
}
|
|
77060
77801
|
});
|
|
77061
77802
|
//#endregion
|
|
@@ -77821,6 +78562,7 @@ const BILLING_ENDPOINT_DEFINITIONS = defineEndpointDefinitions({
|
|
|
77821
78562
|
}
|
|
77822
78563
|
});
|
|
77823
78564
|
({
|
|
78565
|
+
...PUBLIC_NEWSLETTER_ENDPOINT_DEFINITIONS,
|
|
77824
78566
|
...ACCOUNT_ENDPOINT_DEFINITIONS,
|
|
77825
78567
|
...PUBLIC_ONBOARDING_ATTEMPT_ENDPOINT_DEFINITIONS,
|
|
77826
78568
|
...PUBLIC_EVENT_ENDPOINT_DEFINITIONS,
|
|
@@ -78819,7 +79561,12 @@ const appointmentSetupServiceDraftSchema = z$1.object({
|
|
|
78819
79561
|
venue: appointmentSetupVenueChoiceSchema,
|
|
78820
79562
|
timezone: z$1.string().trim().min(1).nullable(),
|
|
78821
79563
|
payment: appointmentSetupPaymentDraftSchema,
|
|
78822
|
-
assignment: appointmentSetupServiceAssignmentDraftSchema
|
|
79564
|
+
assignment: appointmentSetupServiceAssignmentDraftSchema,
|
|
79565
|
+
/**
|
|
79566
|
+
* The service's category, or null for "Other" (issue 1403). Omitted leaves
|
|
79567
|
+
* an existing service's category alone and puts a new one in "Other".
|
|
79568
|
+
*/
|
|
79569
|
+
categoryId: z$1.string().uuid().nullable().optional()
|
|
78823
79570
|
}).superRefine((service, ctx) => {
|
|
78824
79571
|
if (service.payment.kind !== "free" && (service.priceAmount === null || service.priceAmount <= 0)) ctx.addIssue({
|
|
78825
79572
|
code: "custom",
|
|
@@ -80396,7 +81143,7 @@ async function loadPageWithDeps(deps, params) {
|
|
|
80396
81143
|
});
|
|
80397
81144
|
return {
|
|
80398
81145
|
page: pageOutline,
|
|
80399
|
-
|
|
81146
|
+
runtimeJoins: pageData.runtimeJoins,
|
|
80400
81147
|
theme: requireSdkTheme(support.theme, siteId),
|
|
80401
81148
|
sdkConfig: support.sdkConfig,
|
|
80402
81149
|
siteId,
|
|
@@ -82669,7 +83416,7 @@ function applyBindings$1(bindings, context) {
|
|
|
82669
83416
|
if (value !== void 0 && value !== null) setBindingValue(result, key, value);
|
|
82670
83417
|
continue;
|
|
82671
83418
|
}
|
|
82672
|
-
if (isRecord$
|
|
83419
|
+
if (isRecord$25(bindingSpec)) {
|
|
82673
83420
|
const nested = applyBindings$1(bindingSpec, context);
|
|
82674
83421
|
if (Object.keys(nested).length > 0) setBindingValue(result, key, nested);
|
|
82675
83422
|
}
|
|
@@ -82710,7 +83457,7 @@ function mergeResolvedBindings(base, resolved) {
|
|
|
82710
83457
|
const merged = { ...base };
|
|
82711
83458
|
for (const [key, resolvedValue] of Object.entries(resolved)) {
|
|
82712
83459
|
const baseValue = merged[key];
|
|
82713
|
-
merged[key] = isRecord$
|
|
83460
|
+
merged[key] = isRecord$25(baseValue) && isRecord$25(resolvedValue) ? mergeResolvedBindings(baseValue, resolvedValue) : resolvedValue;
|
|
82714
83461
|
}
|
|
82715
83462
|
return merged;
|
|
82716
83463
|
}
|
|
@@ -82735,7 +83482,7 @@ function setBindingValue(target, path, value) {
|
|
|
82735
83482
|
current[Number(segment)] = value;
|
|
82736
83483
|
return;
|
|
82737
83484
|
}
|
|
82738
|
-
if (isRecord$
|
|
83485
|
+
if (isRecord$25(current)) current[segment] = value;
|
|
82739
83486
|
return;
|
|
82740
83487
|
}
|
|
82741
83488
|
const nextWantsArray = typeof nextSegment === "string" && isIndex(nextSegment);
|
|
@@ -82744,15 +83491,15 @@ function setBindingValue(target, path, value) {
|
|
|
82744
83491
|
const existing = current[index];
|
|
82745
83492
|
if (nextWantsArray) {
|
|
82746
83493
|
if (!Array.isArray(existing)) current[index] = [];
|
|
82747
|
-
} else if (!isRecord$
|
|
83494
|
+
} else if (!isRecord$25(existing)) current[index] = {};
|
|
82748
83495
|
current = current[index];
|
|
82749
83496
|
continue;
|
|
82750
83497
|
}
|
|
82751
|
-
if (isRecord$
|
|
83498
|
+
if (isRecord$25(current)) {
|
|
82752
83499
|
const existing = current[segment];
|
|
82753
83500
|
if (nextWantsArray) {
|
|
82754
83501
|
if (!Array.isArray(existing)) current[segment] = [];
|
|
82755
|
-
} else if (!isRecord$
|
|
83502
|
+
} else if (!isRecord$25(existing)) current[segment] = {};
|
|
82756
83503
|
current = current[segment];
|
|
82757
83504
|
continue;
|
|
82758
83505
|
}
|
|
@@ -82790,7 +83537,7 @@ function getPath$1(source, path) {
|
|
|
82790
83537
|
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
82791
83538
|
let current = source;
|
|
82792
83539
|
for (const segment of segments) {
|
|
82793
|
-
if (!isRecord$
|
|
83540
|
+
if (!isRecord$25(current)) return void 0;
|
|
82794
83541
|
current = current[segment];
|
|
82795
83542
|
}
|
|
82796
83543
|
return current;
|
|
@@ -82823,7 +83570,7 @@ function textToInlineText(value) {
|
|
|
82823
83570
|
function extractFirstParagraph$1(value) {
|
|
82824
83571
|
if (!isRichTextDoc(value)) return null;
|
|
82825
83572
|
for (const node of value.content) {
|
|
82826
|
-
if (!isRecord$
|
|
83573
|
+
if (!isRecord$25(node)) continue;
|
|
82827
83574
|
if (node.type !== "paragraph" || !Array.isArray(node.content)) continue;
|
|
82828
83575
|
const text = node.content.filter((item) => item.type === "text").map((item) => typeof item.text === "string" ? item.text : "").join("").trim();
|
|
82829
83576
|
if (text.length > 0) return text;
|
|
@@ -82843,7 +83590,7 @@ function formatDate$1(value, options) {
|
|
|
82843
83590
|
* Type guard to check if a value is a valid binding descriptor.
|
|
82844
83591
|
*/
|
|
82845
83592
|
function isBindingDescriptor$1(value) {
|
|
82846
|
-
if (!isRecord$
|
|
83593
|
+
if (!isRecord$25(value) || typeof value.source !== "string") return false;
|
|
82847
83594
|
if (!BINDING_SOURCES$1.includes(value.source)) return false;
|
|
82848
83595
|
switch (value.source) {
|
|
82849
83596
|
case "field":
|
|
@@ -82858,7 +83605,7 @@ function isBindingDescriptor$1(value) {
|
|
|
82858
83605
|
* Type guard to check if a value is binding-descriptor-like (can be normalized).
|
|
82859
83606
|
*/
|
|
82860
83607
|
function isBindingDescriptorLike$1(value) {
|
|
82861
|
-
return isBindingDescriptor$1(value) || typeof value === "string" || isRecord$
|
|
83608
|
+
return isBindingDescriptor$1(value) || typeof value === "string" || isRecord$25(value) && typeof value.source === "string" && typeof value.path === "string";
|
|
82862
83609
|
}
|
|
82863
83610
|
/**
|
|
82864
83611
|
* Normalizes a binding input to a binding descriptor.
|
|
@@ -82899,7 +83646,7 @@ const ImagePresets = {
|
|
|
82899
83646
|
resize: "contain"
|
|
82900
83647
|
}
|
|
82901
83648
|
};
|
|
82902
|
-
const isRecord = isRecord$
|
|
83649
|
+
const isRecord = isRecord$25;
|
|
82903
83650
|
const applyBindingsToContent = applyBindingsToContent$1;
|
|
82904
83651
|
//#endregion
|
|
82905
83652
|
//#region src/rendering/helpers/templateContent.ts
|
|
@@ -83348,7 +84095,7 @@ async function loadContentFromContentResponseWithDeps(deps, params) {
|
|
|
83348
84095
|
ogImageId: pageRecord.ogImageId ?? null
|
|
83349
84096
|
},
|
|
83350
84097
|
page: pageOutline,
|
|
83351
|
-
|
|
84098
|
+
runtimeJoins: pageData.runtimeJoins,
|
|
83352
84099
|
theme: support.theme,
|
|
83353
84100
|
siteId,
|
|
83354
84101
|
...support.customBlocks ? { customBlocks: support.customBlocks } : {},
|