@riverbankcms/sdk 0.152.0 → 0.154.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/CHANGELOG.md +15 -0
- package/dist/{EventEmbeddedCheckoutStep-DVQXWFm6.mjs → EventEmbeddedCheckoutStep-ba9npQtb.mjs} +1 -1
- package/dist/{PreviewEditorSidebar-Dr4NJi3Q.mjs → PreviewEditorSidebar-C7FiaxlF.mjs} +194 -22
- package/dist/{PreviewEditorUI-DSZXQbyh.mjs → PreviewEditorUI-DFst50q1.mjs} +20 -44
- package/dist/{SdkPreviewModeRuntime-Dl4GyMc3.mjs → SdkPreviewModeRuntime-BUNV_YHZ.mjs} +266 -143
- package/dist/{SiteChromeCustomizeContext-DgBe-FlM.mjs → SiteChromeCustomizeContext-DEj7qppF.mjs} +5340 -4329
- package/dist/{ThemedButton-B8ViBnLK.mjs → ThemedButton-C8kzu0hY.mjs} +610 -116
- package/dist/_dts/ai/src/contracts/proposals.d.ts +416 -182
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +3270 -8214
- package/dist/_dts/api/src/billing.d.ts +2 -0
- package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +78 -0
- package/dist/_dts/api/src/bookingAdjustments.d.ts +3 -2
- package/dist/_dts/api/src/bookingOperations.d.ts +7 -2
- package/dist/_dts/api/src/bookingPeople.d.ts +19 -0
- package/dist/_dts/api/src/bookingPeopleEndpointDefinitions.d.ts +8 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +4 -106
- package/dist/_dts/api/src/bookings.d.ts +2 -3
- package/dist/_dts/api/src/communications.d.ts +19 -5
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/endpoints.d.ts +88 -43
- package/dist/_dts/api/src/index.d.ts +4 -2
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/moneyPayments.d.ts +116 -0
- package/dist/_dts/api/src/onboarding/surfaceData.d.ts +2 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -2
- package/dist/_dts/api/src/sdkThemeWire.d.ts +348 -1537
- package/dist/_dts/api/src/shared-contracts.d.ts +10 -0
- package/dist/_dts/api/src/siteInfrastructure.d.ts +2 -1
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +18 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +17 -16
- package/dist/_dts/api/src/siteSettings.d.ts +1 -0
- package/dist/_dts/api/src/stripeConnectSetup.d.ts +90 -0
- package/dist/_dts/api/src/teamMembers.d.ts +2 -27
- package/dist/_dts/api/src/types.d.ts +11 -31
- package/dist/_dts/api/src/wholeSeriesRuns.d.ts +2 -4
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/layoutGridDomain.d.ts +3 -13
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +8 -96
- package/dist/_dts/blocks/src/index.d.ts +1 -0
- package/dist/_dts/blocks/src/lib/media.d.ts +1 -0
- package/dist/_dts/blocks/src/lib/picsum.d.ts +2 -2
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -1
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -1
- package/dist/_dts/blocks/src/primitives/layout/Section.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/fields.d.ts +0 -4
- package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +276 -884
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +10 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery/fields.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +6 -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 +92 -90
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +12 -0
- package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +4 -7
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-layout.d.ts +23 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-profile.d.ts +20 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +17 -16
- package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +6 -6
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +75 -9
- package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +377 -1
- package/dist/_dts/blocks/src/system/helpers/backgroundMedia.d.ts +6 -2
- package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +3 -3
- package/dist/_dts/blocks/src/system/layout/repeaterGrid.d.ts +12 -5
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +3 -3
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +48 -48
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/fragments/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +1 -1
- package/dist/_dts/blocks/src/system/node/fragments/responsiveTwoColumn.d.ts +3 -1
- package/dist/_dts/blocks/src/system/node/fragments/sectionHead.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +18 -198
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +9 -99
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFlowController.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +18 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/ImageResolveContext.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +50 -202
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +28 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +12 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CardListItem.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +289 -885
- package/dist/_dts/blocks/src/system/runtime/nodes/file-download.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/form.interactive.d.ts +11 -79
- package/dist/_dts/blocks/src/system/runtime/nodes/form.parts.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/form.server.d.ts +2 -13
- package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +22 -90
- package/dist/_dts/blocks/src/system/runtime/nodes/mediaContext.d.ts +69 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +8 -72
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +3 -0
- package/dist/_dts/blocks/src/system/transforms/registry/footerArrangement.d.ts +6 -0
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -11
- package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +3 -3
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -10
- package/dist/_dts/commerce/src/purchase/orderConfirmationPlanning.d.ts +1 -0
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +5 -2
- package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +1 -1
- package/dist/_dts/content-editor/src/FooterNavigationLayoutControl.d.ts +6 -3
- package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +1 -1
- package/dist/_dts/content-editor/src/footerComposer.d.ts +2 -1
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +3 -1
- package/dist/_dts/content-editor/src/footerNavigationLayoutState.d.ts +56 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +2 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +3 -4
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +11 -8
- package/dist/_dts/content-model/src/content-types/schema.d.ts +3 -3
- package/dist/_dts/core/src/booking-refunds.d.ts +2 -0
- package/dist/_dts/core/src/date-display.d.ts +85 -0
- package/dist/_dts/core/src/date-time-formatter.d.ts +2 -0
- package/dist/_dts/core/src/footer-arrangement.d.ts +8 -1
- package/dist/_dts/core/src/footer-composition-types.d.ts +6 -1
- package/dist/_dts/core/src/footer-composition.d.ts +1 -1
- package/dist/_dts/core/src/footer-navigation-layout.d.ts +3 -0
- package/dist/_dts/core/src/index.d.ts +2 -0
- package/dist/_dts/core/src/mailing-list-runtime.d.ts +2 -2
- package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +9 -1
- package/dist/_dts/core/src/mailing-list-setup.d.ts +12 -1
- package/dist/_dts/core/src/mailing-list-submission.d.ts +7 -2
- package/dist/_dts/core/src/mailing-list-targeting.d.ts +9 -1
- package/dist/_dts/core/src/public-profile.d.ts +3 -1
- package/dist/_dts/core/src/scheduled-date-time.d.ts +69 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +105 -13
- package/dist/_dts/db/src/schemas/forms.d.ts +16 -16
- package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
- package/dist/_dts/editor-blocks/src/media/admitEditorMediaField.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +2 -2
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +6 -0
- package/dist/_dts/media-core/src/contentMediaAudit.d.ts +3 -2
- package/dist/_dts/media-core/src/index.d.ts +4 -0
- package/dist/_dts/media-core/src/media.d.ts +406 -0
- package/dist/_dts/media-core/src/mediaIdentifierSchema.d.ts +3 -0
- package/dist/_dts/media-core/src/mediaKinds.d.ts +2 -0
- package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +13 -1
- package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
- package/dist/_dts/media-core/src/portableMediaReferences.d.ts +8 -21
- package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +28 -14
- package/dist/_dts/media-core/src/renderableMediaAssetAdmission.d.ts +15 -0
- package/dist/_dts/media-editor/src/CropDialog.d.ts +6 -3
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -3
- package/dist/_dts/media-editor/src/cropEditorSource.d.ts +5 -7
- package/dist/_dts/media-editor/src/editorMediaState.d.ts +29 -0
- package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -2
- package/dist/_dts/media-editor/src/runtimeMediaAssetState.d.ts +4 -5
- package/dist/_dts/media-editor/src/types.d.ts +1 -1
- package/dist/_dts/media-editor/src/utils.d.ts +0 -1
- package/dist/_dts/media-react/src/components/cropChangePolicy.d.ts +4 -1
- package/dist/_dts/media-react/src/components/cropGeometry.d.ts +1 -0
- package/dist/_dts/media-react/src/components/useImageCropperController.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/blocks/ArrangementBlockToolbar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/BlockBackgroundChooser.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/previewCustomizeSelectedMedia.d.ts +11 -12
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +27 -5
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/useConfirmedPreferenceRecord.d.ts +12 -0
- package/dist/_dts/preview-next/src/client/preview/usePersistedFooterPreferences.d.ts +26 -0
- package/dist/_dts/preview-next/src/client/preview/usePersistedHeaderPreferences.d.ts +40 -2
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
- package/dist/_dts/sdk/src/contracts/content.d.ts +2 -45
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +3 -3
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +4 -46
- package/dist/_dts/sdk/src/date-time/index.d.ts +2 -68
- package/dist/_dts/sdk/src/index.d.ts +1 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/image.d.ts +5 -5
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/link.d.ts +3 -7
- package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +2 -4
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +397 -26
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +2 -0
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +2 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/lanternRecipes.d.ts +60 -0
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +57 -0
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +10 -1
- package/dist/_dts/theme-core/src/buttons/types.d.ts +378 -66
- package/dist/_dts/theme-core/src/buttons/typography.d.ts +24 -0
- package/dist/_dts/theme-core/src/cards/types.d.ts +42 -42
- package/dist/_dts/theme-core/src/footer/effectiveNavLinkStyle.d.ts +1 -1
- package/dist/_dts/theme-core/src/footer/generateFooterCss.d.ts +4 -1
- package/dist/_dts/theme-core/src/footer/mode.d.ts +2 -11
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/lib/media.d.ts +2 -616
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +495 -2766
- package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/schema.d.ts +838 -3369
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +23 -7
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +4 -6
- package/dist/_dts/theme-core/src/site-styles/compileFooterAgainstRow.d.ts +121 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +25 -0
- package/dist/_dts/theme-core/src/site-styles/footerLookDefaults.d.ts +45 -0
- package/dist/_dts/theme-core/src/site-styles/footerLookRecipe.d.ts +50 -0
- package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +9 -35
- package/dist/_dts/theme-core/src/site-styles/footerPreferences.d.ts +29 -0
- package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +2 -3
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +4 -0
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -9
- package/dist/_dts/theme-core/src/site-styles/siteChromeBackgrounds.d.ts +8 -0
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/themeParity.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +2 -2
- package/dist/_dts/theme-core/src/styles/skinTokens.d.ts +2 -2
- package/dist/_dts/theme-core/src/typography/schema.d.ts +2 -2
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/client/{BookingMailingListNote-CBuMKN0w.mjs → BookingMailingListNote-CNoSqFtf.mjs} +2 -2
- package/dist/client/{CardListItem-Dc9XTXhB.mjs → CardListItem-BkTkqBkh.mjs} +5 -4
- package/dist/client/{CheckboxChoice-CIqx_o0E.mjs → CheckboxChoice-CHJpsty4.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-D3VQ_kLj.mjs → DemoBookingPortalAccess-C7KQKFNt.mjs} +2 -2
- package/dist/client/{EventCombined.client-BHGEKise.mjs → EventCombined.client-BgeYMjHJ.mjs} +5 -6
- package/dist/client/{EventEmbeddedCheckoutStep-Bo1Cm23R.mjs → EventEmbeddedCheckoutStep-BTc_lTkM.mjs} +2 -2
- package/dist/client/{EventListing.client-D5OQgVPr.mjs → EventListing.client-ChRs9Hl2.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CLL5cWrr.mjs → LeafletStaticMap-C_dNQgd0.mjs} +1 -1
- package/dist/client/{RichText-BoDmnopf.mjs → RichText-BI9bzbjo.mjs} +106 -60
- package/dist/client/{ThemedButton-Ciltp0IK.mjs → ThemedButton-wl3Z3wkH.mjs} +1 -2
- package/dist/client/{accordion-DOkRS64-.mjs → accordion-6Yz8Wd83.mjs} +1 -1
- package/dist/client/{bookingForm-wlMVwo9h.mjs → bookingForm-i_pKIGiY.mjs} +42 -15
- package/dist/client/bookings.mjs +118357 -22833
- package/dist/client/{carousel-CGWk-Z0u.mjs → carousel-DNqd_PjC.mjs} +2 -2
- package/dist/client/{carousel.client-kX5mN1Eg.mjs → carousel.client-BUgjPbb6.mjs} +1 -1
- package/dist/client/{cart-OBBPlaH4.mjs → cart-D8OBHuF4.mjs} +3 -3
- package/dist/client/{checkout-Bmw2WjQX.mjs → checkout-F3-9IGLU.mjs} +3 -3
- package/dist/client/client.mjs +20785 -19238
- package/dist/client/{context-BI77UFAn.mjs → context-Dg4ZrxDD.mjs} +1 -1
- package/dist/client/{eventCalendar-qkej2Edn.mjs → eventCalendar-BUc7YIBM.mjs} +8 -9
- package/dist/client/{eventCombined-DApKHvat.mjs → eventCombined-BwfShk2a.mjs} +4 -4
- package/dist/client/{eventDetails-BQyUDPH0.mjs → eventDetails-BMOVC3go.mjs} +3 -3
- package/dist/client/{eventListing-CeAnshlZ.mjs → eventListing-BwE9PM-t.mjs} +4 -4
- package/dist/client/{eventRegistration-C3A3NyBO.mjs → eventRegistration-CCWPYDc7.mjs} +10 -10
- package/dist/client/{form-DW8rU7jO.mjs → form-CXFr0Gd5.mjs} +115 -52
- package/dist/client/{headerSection-CkIhsoNm.mjs → headerSection-BX8qw8kH.mjs} +3 -3
- package/dist/client/hooks.mjs +17908 -16797
- package/dist/client/{locationMap-D4O8wbli.mjs → locationMap-B3La71m0.mjs} +3 -4
- package/dist/client/{media-C5K_0xPd.mjs → media-B1Cbv721.mjs} +183 -362
- package/dist/client/mediaContext-CwbbimYB.mjs +135 -0
- package/dist/client/{newsletterForm-B7IxSPuz.mjs → newsletterForm-DnGyR0x7.mjs} +51 -15
- package/dist/client/{productDetail-Bqxpwy5N.mjs → productDetail-BVgTqvkb.mjs} +3 -3
- package/dist/client/{productList-u9Lz8V15.mjs → productList-CcO7kUQw.mjs} +3 -3
- package/dist/client/{propsDecoder-Bf1jucUp.mjs → propsDecoder-B1OeWavE.mjs} +2193 -374
- package/dist/client/renderableMediaAssetAdmission-CHkXYDC_.mjs +143 -0
- package/dist/client/rendering/client.mjs +22424 -21488
- package/dist/client/rendering/islands.mjs +20 -23
- package/dist/client/rendering.mjs +21025 -19413
- package/dist/client/{routeIslandApiConfig-BgP-aPMl.mjs → routeIslandApiConfig-Dl4vglJm.mjs} +1 -1
- package/dist/client/{shop-B_eykR-_.mjs → shop-P72nX5Fs.mjs} +7 -7
- package/dist/client/{shop-commerce-CT0APkFV.mjs → shop-commerce-Bt7uraDx.mjs} +8 -8
- package/dist/client/{shop-commerce-store-DcvZxdEK.mjs → shop-commerce-store-C1-mxSye.mjs} +1 -1
- package/dist/client/{shopShared-BVJOiUiJ.mjs → shopShared-Db-cRGu3.mjs} +5 -5
- package/dist/client/{useDiscountCodeUi-DPmYDunz.mjs → useDiscountCodeUi-jvAiUoUX.mjs} +1 -1
- package/dist/client/{useEventPagination-8-U55vH5.mjs → useEventPagination-BdWpCniq.mjs} +6 -7
- package/dist/preview-next/before-render.mjs +222 -55
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/editor-chrome.css +5 -2
- package/dist/preview-next/keepAlive.mjs +133 -51
- package/dist/preview-next/middleware.mjs +133 -51
- package/dist/{sdk-runtime-C5jPdSrk.mjs → sdk-runtime-DLhjF2Nw.mjs} +1 -1
- package/dist/server/components.mjs +21541 -20118
- package/dist/server/config-validation.mjs +2466 -1403
- package/dist/server/config.mjs +2466 -1403
- package/dist/server/data.mjs +17842 -16759
- package/dist/server/date-time.mjs +258 -116
- package/dist/server/index.mjs +360 -53
- package/dist/server/next.mjs +21913 -20539
- package/dist/server/page-converter.mjs +8121 -7322
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +21196 -19760
- package/dist/server/rendering.mjs +21554 -20123
- package/dist/server/routing.mjs +19806 -18607
- package/dist/server/server.mjs +2907 -1845
- package/dist/server/theme-bridge.mjs +991 -160
- package/dist/server/theme.mjs +501 -100
- package/dist/{spinner-B-ab2rJp.mjs → spinner-MTooKfck.mjs} +1 -1
- package/dist/styles/index.css +254 -1
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +0 -12
- package/dist/client/aspectTransforms-D-TnDdq4.mjs +0 -93
- package/dist/client/colorStyles-ECDNPE_P.mjs +0 -1253
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
//#region ../core/src/date-time-formatter.ts
|
|
2
|
+
/** Shared Intl engine, internal to core's date presentation owners. */
|
|
3
|
+
const FORMATTER_CACHE_LIMIT$1 = 100;
|
|
4
|
+
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
5
|
+
function getDateTimeFormatter(locale, timeZone, format) {
|
|
6
|
+
const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
|
|
7
|
+
const cached = dateTimeFormatterCache.get(key);
|
|
8
|
+
if (cached !== void 0) return cached;
|
|
9
|
+
if (typeof locale !== "string" || Intl.DateTimeFormat.supportedLocalesOf([locale]).length === 0) throw new RangeError("An explicit supported locale is required");
|
|
10
|
+
if (typeof timeZone !== "string" || timeZone.length === 0) throw new RangeError("An explicit time zone is required");
|
|
11
|
+
const formatter = new Intl.DateTimeFormat(locale, {
|
|
12
|
+
...format,
|
|
13
|
+
timeZone
|
|
14
|
+
});
|
|
15
|
+
if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT$1) dateTimeFormatterCache.clear();
|
|
16
|
+
dateTimeFormatterCache.set(key, formatter);
|
|
17
|
+
return formatter;
|
|
18
|
+
}
|
|
19
|
+
function formatIntlRange(formatter, start, end) {
|
|
20
|
+
const nativeFormatRange = Reflect.get(formatter, "formatRange");
|
|
21
|
+
if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
|
|
22
|
+
const output = Reflect.apply(nativeFormatRange, formatter, [start, end]);
|
|
23
|
+
if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
|
|
24
|
+
return output;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
1
27
|
//#region ../core/src/result.ts
|
|
2
28
|
function ok(value) {
|
|
3
29
|
return {
|
|
@@ -40,26 +66,37 @@ function parseBookingTimeZone(timeZone) {
|
|
|
40
66
|
}
|
|
41
67
|
//#endregion
|
|
42
68
|
//#region ../core/src/booking-date-time.ts
|
|
43
|
-
const
|
|
44
|
-
|
|
69
|
+
const FALLBACK_TIMEZONE = "UTC";
|
|
70
|
+
function getSafeTimeZone(timeZone) {
|
|
71
|
+
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
72
|
+
return normalized.length > 0 && isValidBookingTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
73
|
+
}
|
|
45
74
|
function parseStrictBookingTimeZone(timeZone) {
|
|
46
75
|
const parsed = parseBookingTimeZone(timeZone);
|
|
47
76
|
return parsed.ok ? parsed.value : null;
|
|
48
77
|
}
|
|
49
78
|
function formatToPartsLookup(date, locale, timeZone, format) {
|
|
50
|
-
return new Map(
|
|
79
|
+
return new Map(getDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
|
|
51
80
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
function getZonedDateTimeParts(date, timeZone) {
|
|
82
|
+
const parts = formatToPartsLookup(date, "en-GB", timeZone, {
|
|
83
|
+
year: "numeric",
|
|
84
|
+
month: "2-digit",
|
|
85
|
+
day: "2-digit",
|
|
86
|
+
hour: "2-digit",
|
|
87
|
+
minute: "2-digit",
|
|
88
|
+
second: "2-digit",
|
|
89
|
+
hour12: false
|
|
59
90
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
const read = (type) => Number(parts.get(type) ?? "");
|
|
92
|
+
return {
|
|
93
|
+
year: read("year"),
|
|
94
|
+
month: read("month"),
|
|
95
|
+
day: read("day"),
|
|
96
|
+
hour: read("hour"),
|
|
97
|
+
minute: read("minute"),
|
|
98
|
+
second: read("second")
|
|
99
|
+
};
|
|
63
100
|
}
|
|
64
101
|
function parseUtcIsoDateTimeString(value) {
|
|
65
102
|
const normalized = value.trim();
|
|
@@ -151,10 +188,172 @@ function formatBookingCompactEnglishTime(input) {
|
|
|
151
188
|
if (hour === void 0 || minute === void 0 || dayPeriod === void 0) return input.startsAt;
|
|
152
189
|
return `${minute === "00" ? hour : `${hour}:${minute}`}${dayPeriod.toLowerCase()}`;
|
|
153
190
|
}
|
|
191
|
+
function compareLocalScheduleDates(left, right) {
|
|
192
|
+
return Date.UTC(left.year, left.month - 1, left.day) - Date.UTC(right.year, right.month - 1, right.day);
|
|
193
|
+
}
|
|
194
|
+
function getLocalScheduleDate(date, timeZone) {
|
|
195
|
+
const parts = getZonedDateTimeParts(date, getSafeTimeZone(timeZone));
|
|
196
|
+
return {
|
|
197
|
+
year: parts.year,
|
|
198
|
+
month: parts.month,
|
|
199
|
+
day: parts.day
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region ../core/src/date-display.ts
|
|
204
|
+
const SDK_STANDARD_TIME_FORMAT = {
|
|
205
|
+
hour: "numeric",
|
|
206
|
+
minute: "2-digit"
|
|
207
|
+
};
|
|
208
|
+
/** Public SDK option policy lives beside the display profile, never in its adapter. */
|
|
209
|
+
function sdkPresentationProfile(context, dateFormat, time = {}) {
|
|
210
|
+
const compact = time.timePresentation !== "standard" && new Intl.Locale(context.locale).language === "en";
|
|
211
|
+
const standard = time.timePresentation === "standard" ? time.format ?? SDK_STANDARD_TIME_FORMAT : SDK_STANDARD_TIME_FORMAT;
|
|
212
|
+
return {
|
|
213
|
+
kind: "sdk",
|
|
214
|
+
dateFormat,
|
|
215
|
+
clock: compact ? {
|
|
216
|
+
kind: "compact",
|
|
217
|
+
localeSource: "context"
|
|
218
|
+
} : {
|
|
219
|
+
kind: "intl",
|
|
220
|
+
format: standard
|
|
221
|
+
},
|
|
222
|
+
zone: "omit"
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** Sole date projection/typography owner, used by display and scheduled adapters. */
|
|
226
|
+
function presentDate(value, context, profile) {
|
|
227
|
+
const date = dateCarrier(value);
|
|
228
|
+
const zone = value.kind === "civil" ? "UTC" : context.timeZone;
|
|
229
|
+
const output = getDateTimeFormatter(context.locale, zone, profile.dateFormat).format(date);
|
|
230
|
+
if (profile.kind === "sdk") return output;
|
|
231
|
+
const normalized = normalizeDisplay(output);
|
|
232
|
+
return profile.dateFormat.weekday && new Intl.Locale(context.locale).language === "en" ? normalized.replace(/^([^,]+), /u, "$1 ") : normalized;
|
|
233
|
+
}
|
|
234
|
+
function presentDateRange(start, end, context, profile) {
|
|
235
|
+
if (dateCarrier(end).getTime() < dateCarrier(start).getTime()) throw new RangeError("Date range end must be on or after its start");
|
|
236
|
+
if (profile.kind === "display" && compareLocalScheduleDates(projectDate(start, context), projectDate(end, context)) === 0) return presentDate(start, context, profile);
|
|
237
|
+
const output = formatIntlRange(getDateTimeFormatter(context.locale, start.kind === "civil" ? "UTC" : context.timeZone, profile.dateFormat), dateCarrier(start), dateCarrier(end));
|
|
238
|
+
if (profile.kind === "sdk") return output;
|
|
239
|
+
const startDate = projectDate(start, context);
|
|
240
|
+
const endDate = projectDate(end, context);
|
|
241
|
+
const separator = startDate.month === endDate.month && startDate.year === endDate.year ? "–" : " – ";
|
|
242
|
+
return normalizeDisplay(output).replace(/\s*–\s*/gu, separator);
|
|
243
|
+
}
|
|
244
|
+
function presentTime(value, context, profile) {
|
|
245
|
+
const clock = presentClock(value, context, profile.clock);
|
|
246
|
+
return profile.zone === "always" ? `${clock} ${zoneLabel(value, context)}` : clock;
|
|
247
|
+
}
|
|
248
|
+
function presentDateTime(value, context, profile) {
|
|
249
|
+
if (profile.clock.kind === "intl") return getDateTimeFormatter(context.locale, context.timeZone, combinedFormat(profile.dateFormat, profile.clock)).format(new Date(value));
|
|
250
|
+
return `${presentDate({
|
|
251
|
+
kind: "instant",
|
|
252
|
+
value
|
|
253
|
+
}, context, profile)}, ${presentTime(value, context, profile)}`;
|
|
254
|
+
}
|
|
255
|
+
function presentTimeRange(span, context, profile) {
|
|
256
|
+
assertOrdered(span.start, span.end);
|
|
257
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, profile.clock.format);
|
|
258
|
+
const startClock = presentClock(span.start, context, profile.clock);
|
|
259
|
+
const endClock = presentClock(span.end, context, profile.clock);
|
|
260
|
+
const clocks = (profile.kind === "sdk" ? startClock === endClock : span.start === span.end) ? startClock : `${startClock}–${endClock}`;
|
|
261
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
262
|
+
switch (labels.kind) {
|
|
263
|
+
case "omit": return clocks;
|
|
264
|
+
case "shared": return `${clocks} ${labels.label}`;
|
|
265
|
+
case "endpoints": return `${startClock} ${labels.start} – ${endClock} ${labels.end}`;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function presentDateTimeRange(span, context, profile) {
|
|
269
|
+
assertOrdered(span.start, span.end);
|
|
270
|
+
if (profile.clock.kind === "intl") return presentNativeRange(span, context, combinedFormat(profile.dateFormat, profile.clock));
|
|
271
|
+
const startDate = getLocalScheduleDate(new Date(span.start), context.timeZone);
|
|
272
|
+
const endDate = getLocalScheduleDate(new Date(span.end), context.timeZone);
|
|
273
|
+
if (compareLocalScheduleDates(startDate, endDate) === 0) return `${presentDate({
|
|
274
|
+
kind: "instant",
|
|
275
|
+
value: span.start
|
|
276
|
+
}, context, profile)}, ${presentTimeRange(span, context, profile)}`;
|
|
277
|
+
const labels = decideRangeLabels(span, context, profile);
|
|
278
|
+
const startProfile = profile.kind === "display" && startDate.year === endDate.year ? {
|
|
279
|
+
...profile,
|
|
280
|
+
dateFormat: {
|
|
281
|
+
...profile.dateFormat,
|
|
282
|
+
year: void 0
|
|
283
|
+
}
|
|
284
|
+
} : profile;
|
|
285
|
+
const start = presentRangeEndpoint(span.start, context, startProfile, labels.kind === "endpoints" ? labels.start : void 0);
|
|
286
|
+
const end = presentRangeEndpoint(span.end, context, profile, labels.kind === "endpoints" ? labels.end : void 0);
|
|
287
|
+
const separator = profile.kind === "sdk" ? "–" : " – ";
|
|
288
|
+
return profile.kind === "sdk" && start === end ? start : `${start}${separator}${end}`;
|
|
289
|
+
}
|
|
290
|
+
/** Offset changes override ordinary venue omission for the approved display profile. */
|
|
291
|
+
function decideRangeLabels(span, context, profile) {
|
|
292
|
+
if (profile.kind === "sdk") return { kind: "omit" };
|
|
293
|
+
const offsetsDiffer = offsetToken(span.start, context) !== offsetToken(span.end, context);
|
|
294
|
+
if (!offsetsDiffer && profile.zone === "omit") return { kind: "omit" };
|
|
295
|
+
const start = zoneLabel(span.start, context);
|
|
296
|
+
const end = zoneLabel(span.end, context);
|
|
297
|
+
return offsetsDiffer || start !== end ? {
|
|
298
|
+
kind: "endpoints",
|
|
299
|
+
start,
|
|
300
|
+
end
|
|
301
|
+
} : {
|
|
302
|
+
kind: "shared",
|
|
303
|
+
label: start
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function presentRangeEndpoint(value, context, profile, label) {
|
|
307
|
+
return `${presentDate({
|
|
308
|
+
kind: "instant",
|
|
309
|
+
value
|
|
310
|
+
}, context, profile)}, ${label === void 0 ? presentTime(value, context, profile) : `${presentClock(value, context, profile.clock)} ${label}`}`;
|
|
311
|
+
}
|
|
312
|
+
function presentNativeRange(span, context, format) {
|
|
313
|
+
return formatIntlRange(getDateTimeFormatter(context.locale, context.timeZone, format), new Date(span.start), new Date(span.end));
|
|
314
|
+
}
|
|
315
|
+
function combinedFormat(date, clock) {
|
|
316
|
+
return {
|
|
317
|
+
...date,
|
|
318
|
+
...clock.format
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function dateCarrier(value) {
|
|
322
|
+
return value.kind === "civil" ? civilCarrier(value.value) : new Date(value.value);
|
|
323
|
+
}
|
|
324
|
+
function presentClock(value, context, clock) {
|
|
325
|
+
return clock.kind === "compact" ? formatBookingCompactEnglishTime({
|
|
326
|
+
startsAt: value,
|
|
327
|
+
timeZone: context.timeZone,
|
|
328
|
+
locale: clock.localeSource === "product" ? "en-GB" : context.locale
|
|
329
|
+
}) : getDateTimeFormatter(context.locale, context.timeZone, clock.format).format(new Date(value));
|
|
330
|
+
}
|
|
331
|
+
function offsetToken(value, context) {
|
|
332
|
+
return getDateTimeFormatter("en-GB", context.timeZone, { timeZoneName: "longOffset" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
333
|
+
}
|
|
334
|
+
function civilCarrier(value) {
|
|
335
|
+
return new Date(Date.UTC(value.year, value.month - 1, value.day, 12));
|
|
336
|
+
}
|
|
337
|
+
function projectDate(value, context) {
|
|
338
|
+
return value.kind === "civil" ? value.value : getLocalScheduleDate(new Date(value.value), context.timeZone);
|
|
339
|
+
}
|
|
340
|
+
function normalizeDisplay(value) {
|
|
341
|
+
return value.replace(/[\u00a0\u202f]/gu, " ");
|
|
342
|
+
}
|
|
343
|
+
function zoneToken(value, context, locale) {
|
|
344
|
+
return getDateTimeFormatter(locale, context.timeZone, { timeZoneName: "short" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
345
|
+
}
|
|
346
|
+
function zoneLabel(value, context) {
|
|
347
|
+
const abbreviation = [zoneToken(value, context, "en-GB"), zoneToken(value, context, "en-US")].find((token) => /^[A-Z]{2,6}$/u.test(token));
|
|
348
|
+
const fallback = context.timeZone.startsWith("Etc/") ? "local time" : `${context.timeZone.split("/").slice(-1)[0]?.replace(/_/gu, " ") ?? context.timeZone} time`;
|
|
349
|
+
return abbreviation ?? fallback;
|
|
350
|
+
}
|
|
351
|
+
function assertOrdered(start, end) {
|
|
352
|
+
if (new Date(end).getTime() < new Date(start).getTime()) throw new RangeError("Date/time range end must be on or after its start");
|
|
353
|
+
}
|
|
154
354
|
//#endregion
|
|
155
|
-
//#region src/date-time
|
|
355
|
+
//#region ../core/src/scheduled-date-time.ts
|
|
156
356
|
const DEFAULT_LOCALE = "en-GB";
|
|
157
|
-
const COMPACT_ENGLISH_RANGE_SEPARATOR = "–";
|
|
158
357
|
const FORMATTER_CACHE_LIMIT = 100;
|
|
159
358
|
const DEFAULT_DATE_FORMAT = {
|
|
160
359
|
weekday: "long",
|
|
@@ -168,11 +367,6 @@ const DEFAULT_RANGE_DATE_FORMAT = {
|
|
|
168
367
|
month: "short",
|
|
169
368
|
day: "numeric"
|
|
170
369
|
};
|
|
171
|
-
const DEFAULT_STANDARD_TIME_FORMAT = {
|
|
172
|
-
hour: "numeric",
|
|
173
|
-
minute: "2-digit"
|
|
174
|
-
};
|
|
175
|
-
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
176
370
|
const parsedLocaleCache = /* @__PURE__ */ new Map();
|
|
177
371
|
var RiverbankDateTimeFormatError = class extends Error {
|
|
178
372
|
constructor(details) {
|
|
@@ -183,40 +377,51 @@ var RiverbankDateTimeFormatError = class extends Error {
|
|
|
183
377
|
this.value = details.value;
|
|
184
378
|
}
|
|
185
379
|
};
|
|
380
|
+
/** Public contract adapters: admission/options here, all presentation in date-display. */
|
|
186
381
|
function formatScheduledDate(input, options = {}) {
|
|
187
|
-
|
|
382
|
+
const parsed = parseDateTime(input);
|
|
383
|
+
return presentDate({
|
|
384
|
+
kind: "instant",
|
|
385
|
+
value: parsed.startsAt
|
|
386
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_DATE_FORMAT));
|
|
188
387
|
}
|
|
189
388
|
function formatScheduledTime(input, options = {}) {
|
|
190
|
-
|
|
389
|
+
const parsed = parseDateTime(input);
|
|
390
|
+
return presentTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
|
|
191
391
|
}
|
|
192
392
|
function formatScheduledDateTime(input, options = {}) {
|
|
193
|
-
|
|
393
|
+
const parsed = parseDateTime(input);
|
|
394
|
+
return presentDateTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_DATE_FORMAT, options.time));
|
|
194
395
|
}
|
|
195
396
|
function formatScheduledDateRange(input, options = {}) {
|
|
196
|
-
const
|
|
197
|
-
return
|
|
397
|
+
const parsed = parseDateRange(input);
|
|
398
|
+
return presentDateRange({
|
|
399
|
+
kind: "instant",
|
|
400
|
+
value: parsed.startsAt
|
|
401
|
+
}, {
|
|
402
|
+
kind: "instant",
|
|
403
|
+
value: parsed.endsAt
|
|
404
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_RANGE_DATE_FORMAT));
|
|
198
405
|
}
|
|
199
406
|
function formatScheduledTimeRange(input, options = {}) {
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const endTime = formatTime(end, options);
|
|
206
|
-
return startTime === endTime ? startTime : `${startTime}${COMPACT_ENGLISH_RANGE_SEPARATOR}${endTime}`;
|
|
407
|
+
const parsed = parseDateRange(input);
|
|
408
|
+
return presentTimeRange({
|
|
409
|
+
start: parsed.startsAt,
|
|
410
|
+
end: parsed.endsAt
|
|
411
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
|
|
207
412
|
}
|
|
208
413
|
function formatScheduledDateTimeRange(input, options = {}) {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
414
|
+
const parsed = parseDateRange(input);
|
|
415
|
+
return presentDateTimeRange({
|
|
416
|
+
start: parsed.startsAt,
|
|
417
|
+
end: parsed.endsAt
|
|
418
|
+
}, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_RANGE_DATE_FORMAT, options.time));
|
|
419
|
+
}
|
|
420
|
+
function scheduledContext(input) {
|
|
421
|
+
return {
|
|
422
|
+
locale: input.locale,
|
|
423
|
+
timeZone: input.timeZone
|
|
424
|
+
};
|
|
220
425
|
}
|
|
221
426
|
function parseDateTime(input) {
|
|
222
427
|
const locale = parseLocale(input.locale);
|
|
@@ -234,11 +439,7 @@ function parseDateTime(input) {
|
|
|
234
439
|
function parseDateRange(input) {
|
|
235
440
|
const locale = parseLocale(input.locale);
|
|
236
441
|
assertStringTimeZone(input.timeZone);
|
|
237
|
-
|
|
238
|
-
code: "missing_ends_at",
|
|
239
|
-
field: "endsAt",
|
|
240
|
-
value: ""
|
|
241
|
-
});
|
|
442
|
+
assertRequiredEnd(input.endsAt);
|
|
242
443
|
const result = parseScheduledBookingDateRange({
|
|
243
444
|
...input,
|
|
244
445
|
locale: locale.locale
|
|
@@ -260,6 +461,13 @@ function parseDateRange(input) {
|
|
|
260
461
|
locale: locale.locale
|
|
261
462
|
};
|
|
262
463
|
}
|
|
464
|
+
function assertRequiredEnd(value) {
|
|
465
|
+
if (value === null || value === void 0) throw new RiverbankDateTimeFormatError({
|
|
466
|
+
code: "missing_ends_at",
|
|
467
|
+
field: "endsAt",
|
|
468
|
+
value: ""
|
|
469
|
+
});
|
|
470
|
+
}
|
|
263
471
|
function parseLocale(value) {
|
|
264
472
|
const locale = value === void 0 ? DEFAULT_LOCALE : value;
|
|
265
473
|
if (typeof locale !== "string") throw new RiverbankDateTimeFormatError({
|
|
@@ -270,13 +478,9 @@ function parseLocale(value) {
|
|
|
270
478
|
const cached = parsedLocaleCache.get(locale);
|
|
271
479
|
if (cached !== void 0) return cached;
|
|
272
480
|
try {
|
|
273
|
-
const
|
|
274
|
-
const canonical = parsed.toString();
|
|
481
|
+
const canonical = new Intl.Locale(locale).toString();
|
|
275
482
|
if (Intl.DateTimeFormat.supportedLocalesOf([canonical]).length === 0) throw new RangeError("Unsupported locale");
|
|
276
|
-
const result = {
|
|
277
|
-
locale: canonical,
|
|
278
|
-
language: parsed.language
|
|
279
|
-
};
|
|
483
|
+
const result = { locale: canonical };
|
|
280
484
|
if (parsedLocaleCache.size >= FORMATTER_CACHE_LIMIT) parsedLocaleCache.clear();
|
|
281
485
|
parsedLocaleCache.set(locale, result);
|
|
282
486
|
return result;
|
|
@@ -326,68 +530,6 @@ function formatErrorMessage(details) {
|
|
|
326
530
|
default: return assertNever(details);
|
|
327
531
|
}
|
|
328
532
|
}
|
|
329
|
-
function formatDateTime(input, options, defaultDateFormat) {
|
|
330
|
-
if (!usesCompactEnglishTime(input, options.time ?? {})) return formatInstant(input, resolveCombinedFormat(options, defaultDateFormat));
|
|
331
|
-
return `${formatInstant(input, options.dateFormat ?? defaultDateFormat)}, ${formatTime(input, options.time ?? {})}`;
|
|
332
|
-
}
|
|
333
|
-
function formatTime(input, options) {
|
|
334
|
-
if (usesCompactEnglishTime(input, options)) return formatBookingCompactEnglishTime(input);
|
|
335
|
-
return formatInstant(input, resolveStandardTimeFormat(options));
|
|
336
|
-
}
|
|
337
|
-
function usesCompactEnglishTime(input, options) {
|
|
338
|
-
return options.timePresentation !== "standard" && parseLocale(input.locale).language === "en";
|
|
339
|
-
}
|
|
340
|
-
function resolveStandardTimeFormat(options) {
|
|
341
|
-
return options.timePresentation === "standard" ? options.format ?? DEFAULT_STANDARD_TIME_FORMAT : DEFAULT_STANDARD_TIME_FORMAT;
|
|
342
|
-
}
|
|
343
|
-
function resolveCombinedFormat(options, defaultDateFormat) {
|
|
344
|
-
return {
|
|
345
|
-
...options.dateFormat ?? defaultDateFormat,
|
|
346
|
-
...resolveStandardTimeFormat(options.time ?? {})
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function formatInstant(input, format) {
|
|
350
|
-
return getFormatter(input, format).format(new Date(input.startsAt));
|
|
351
|
-
}
|
|
352
|
-
function formatRange(start, end, format) {
|
|
353
|
-
const formatter = getFormatter(start, format);
|
|
354
|
-
const nativeFormatRange = Reflect.get(formatter, "formatRange");
|
|
355
|
-
if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
|
|
356
|
-
const output = Reflect.apply(nativeFormatRange, formatter, [new Date(start.startsAt), new Date(end.startsAt)]);
|
|
357
|
-
if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
|
|
358
|
-
return output;
|
|
359
|
-
}
|
|
360
|
-
function getFormatter(input, format) {
|
|
361
|
-
const formatKey = JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)));
|
|
362
|
-
const key = `${input.locale}\u0000${input.timeZone}\u0000${formatKey}`;
|
|
363
|
-
const cached = dateTimeFormatterCache.get(key);
|
|
364
|
-
if (cached !== void 0) return cached;
|
|
365
|
-
const formatter = new Intl.DateTimeFormat(input.locale, {
|
|
366
|
-
...format,
|
|
367
|
-
timeZone: input.timeZone
|
|
368
|
-
});
|
|
369
|
-
if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT) dateTimeFormatterCache.clear();
|
|
370
|
-
dateTimeFormatterCache.set(key, formatter);
|
|
371
|
-
return formatter;
|
|
372
|
-
}
|
|
373
|
-
function rangeStart(range) {
|
|
374
|
-
return range;
|
|
375
|
-
}
|
|
376
|
-
function rangeEnd(range) {
|
|
377
|
-
return {
|
|
378
|
-
startsAt: range.endsAt,
|
|
379
|
-
timeZone: range.timeZone,
|
|
380
|
-
locale: range.locale
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
function sameLocalDate(start, end) {
|
|
384
|
-
const format = {
|
|
385
|
-
year: "numeric",
|
|
386
|
-
month: "2-digit",
|
|
387
|
-
day: "2-digit"
|
|
388
|
-
};
|
|
389
|
-
return formatInstant(start, format) === formatInstant(end, format);
|
|
390
|
-
}
|
|
391
533
|
function assertNever(value) {
|
|
392
534
|
throw new Error(`Unhandled date-time variant: ${String(value)}`);
|
|
393
535
|
}
|