@riverbankcms/sdk 0.135.1 → 0.137.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 +114 -0
- package/README.md +4 -8
- package/dist/{PreviewEditorSidebar-D4p_5TdY.mjs → PreviewEditorSidebar-Bn6cONPa.mjs} +8 -8
- package/dist/{PreviewEditorUI-D0cRoTX1.mjs → PreviewEditorUI-LAwXZPSx.mjs} +3 -3
- package/dist/{PreviewQueryProvider-DcgaESkm.mjs → PreviewQueryProvider-ztQUdsNo.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-BKLtM3Nz.mjs → SdkPreviewModeRuntime-BbbGsI_v.mjs} +621 -238
- package/dist/{SiteChromeCustomizeContext-61X2m7QV.mjs → SiteChromeCustomizeContext-BbkNSt5a.mjs} +5041 -2407
- package/dist/_dts/ai/src/contracts/proposals.d.ts +18 -850
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +412 -2316
- package/dist/_dts/ai/src/designer/themePatch.d.ts +5 -10
- package/dist/_dts/api/src/accessAdmin.d.ts +1 -9
- package/dist/_dts/api/src/accountApi.d.ts +49 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +7 -4
- package/dist/_dts/api/src/domainConnection.d.ts +41 -0
- package/dist/_dts/api/src/endpoints.d.ts +201 -181
- package/dist/_dts/api/src/index.d.ts +5 -3
- package/dist/_dts/api/src/media.d.ts +19 -2
- package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +7 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +26 -0
- package/dist/_dts/api/src/sdkBlockContentAdmission.d.ts +5 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -15
- package/dist/_dts/api/src/sdkMediaContracts.d.ts +40 -0
- package/dist/_dts/api/src/sdkMediaEndpointDefinitions.d.ts +61 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +21 -436
- package/dist/_dts/api/src/siteInfrastructure.d.ts +17 -23
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +7 -21
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +27 -3
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +37 -17
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +2 -3
- package/dist/_dts/block-form/src/utils/slug.d.ts +6 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +13 -7
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +48 -0
- package/dist/_dts/blocks/src/definitions.d.ts +14 -0
- package/dist/_dts/blocks/src/index.d.ts +4 -3
- package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +49 -0
- package/dist/_dts/blocks/src/pageRendererBlockSupport.d.ts +75 -0
- package/dist/_dts/blocks/src/pageRendererBoundaries.d.ts +2 -0
- package/dist/_dts/blocks/src/server.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/data/publicLoaderCachePolicy.d.ts +78 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +2 -18
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +103 -16
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +19 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +52 -0
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +47 -21
- package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +38 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/ErrorStep.d.ts +3 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorPresentation.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +25 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +8 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useWaitlistClaimRestoration.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +40 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +43 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/capacity.d.ts +164 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/cta.d.ts +29 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +47 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/index.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/people.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/pricing.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayCell.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModalContext.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/OfferingTitle.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekBoardView.d.ts +31 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +9 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/index.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/listingLayout.d.ts +23 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +4 -3
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -1
- package/dist/_dts/calendar/src/grid.d.ts +24 -66
- package/dist/_dts/calendar/src/index.d.ts +2 -2
- package/dist/_dts/calendar/src/timetable.d.ts +5 -9
- package/dist/_dts/commerce/src/purchase/allocation.d.ts +11 -0
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +57 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +3 -0
- package/dist/_dts/commerce/src/purchase/settlement.d.ts +33 -0
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +8 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +6 -0
- package/dist/_dts/core/src/slug.d.ts +20 -5
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +8 -40
- package/dist/_dts/db/src/index.d.ts +1 -0
- package/dist/_dts/db/src/utils/postgrestFilter.d.ts +2 -0
- package/dist/_dts/media-core/src/bulkDeletePlanning.d.ts +4 -0
- package/dist/_dts/media-core/src/fileDomain.d.ts +3 -0
- package/dist/_dts/preview-next/src/client/blocks/EditablePageRenderer.d.ts +1 -1
- 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 +3 -2
- package/dist/_dts/preview-next/src/client/preview/headerInteractionPaletteSurfaceState.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlSaveRequest.d.ts +51 -0
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +24 -2
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +23 -1
- package/dist/_dts/preview-next/src/client/preview/usePersistedHeaderPreferences.d.ts +8 -0
- package/dist/_dts/sdk/src/client/publicLoaderCacheAccess.d.ts +6 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +7 -2
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +10 -6
- package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/helpers/footerPageOutline.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +17 -0
- package/dist/_dts/sdk/src/rendering/helpers/templateContent.d.ts +9 -3
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +7 -4
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/cards/types.d.ts +8 -8
- package/dist/_dts/theme-core/src/data.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/gradients/types.d.ts +5 -0
- package/dist/_dts/theme-core/src/header/interactionPalette.d.ts +25 -2
- package/dist/_dts/theme-core/src/header/legacyHeaderVariant.d.ts +2 -6
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -810
- package/dist/_dts/theme-core/src/schema.d.ts +460 -1285
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +43 -3
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +223 -1
- package/dist/_dts/theme-core/src/site-styles/headerBrandPresentation.d.ts +63 -0
- package/dist/_dts/theme-core/src/site-styles/headerBytesComparison.d.ts +30 -0
- package/dist/_dts/theme-core/src/site-styles/headerInteractionPalette.d.ts +50 -1
- package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +48 -38
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +10 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutTypes.d.ts +8 -5
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/headerPreferences.d.ts +162 -0
- package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +73 -0
- package/dist/_dts/theme-core/src/site-styles/headerRecompile.d.ts +118 -0
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +25 -2
- package/dist/_dts/theme-core/src/site-styles/headerStyleDefaults.d.ts +465 -0
- package/dist/_dts/theme-core/src/site-styles/headerStyleRecipe.d.ts +168 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +5 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/siteChromeBackgrounds.d.ts +20 -1
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +43 -2
- package/dist/client/{BookingConsentAgreement-Bz9znbpn.mjs → BookingConsentAgreement--_fUCZe-.mjs} +2 -2
- package/dist/client/{DiscountCodeDisclosure-35Ru8yB9.mjs → DiscountCodeDisclosure-BMipSoDJ.mjs} +1 -1
- package/dist/client/{EventCombined.client-BKB0ZxRR.mjs → EventCombined.client-CwJOxn7A.mjs} +274 -278
- package/dist/client/{EventListing.client-Dx8I21ok.mjs → EventListing.client-eVwiylPW.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CEWx-Bhe.mjs → LeafletStaticMap-IKenna5u.mjs} +1 -1
- package/dist/client/{accordion-KIDsKTwS.mjs → accordion-MGAO3PuE.mjs} +1 -1
- package/dist/client/{bookingForm-D96Rmp-5.mjs → bookingForm-CudlQPUu.mjs} +5 -5
- package/dist/client/bookings.mjs +476 -98
- package/dist/client/capacity-BW00PO7s.mjs +271 -0
- package/dist/client/{carousel-YwUgyL66.mjs → carousel-BrbGJ2Jl.mjs} +1 -1
- package/dist/client/{cart-BbwuNrUT.mjs → cart-Bq5eU0xZ.mjs} +3 -3
- package/dist/client/{checkout-hp1ucmEY.mjs → checkout-BAFVRdrK.mjs} +3 -3
- package/dist/client/client.mjs +4641 -2721
- package/dist/client/{context-DljQn8L5.mjs → context-DCkiHVdD.mjs} +20 -5
- package/dist/client/dates-2RPXHQy4.mjs +264 -0
- package/dist/client/{eventCalendar-DU4iNLpo.mjs → eventCalendar-B0O-hPF7.mjs} +261 -126
- package/dist/client/{eventCombined-CZuupW8m.mjs → eventCombined-DCkDaoDI.mjs} +3 -3
- package/dist/client/{eventDetails-DPQWwCIi.mjs → eventDetails-D8GG2dnD.mjs} +7 -4
- package/dist/client/{eventListing-C7oMidwS.mjs → eventListing-3ssV_bxz.mjs} +3 -3
- package/dist/client/{eventRegistration-zEiunlUs.mjs → eventRegistration-bPQo3kVw.mjs} +610 -313
- package/dist/client/{form-D2KIyCVJ.mjs → form-qMv8RDkk.mjs} +2 -2
- package/dist/client/{headerSection-CK5uChUK.mjs → headerSection-CH0Sc5hX.mjs} +2 -2
- package/dist/client/hooks.mjs +2514 -308
- package/dist/client/{locationMap-DLQNH1ln.mjs → locationMap-0_xlBnNI.mjs} +2 -2
- package/dist/client/{newsletterForm-ZuhIG7fZ.mjs → newsletterForm-NUW7m9RI.mjs} +2 -2
- package/dist/client/{productDetail-7hIcGeae.mjs → productDetail-FBEOM7jW.mjs} +3 -3
- package/dist/client/{productList-T4Cii1ot.mjs → productList-R0OSGhnn.mjs} +3 -3
- package/dist/client/{propsDecoder-mB0aC_Fi.mjs → propsDecoder-pYvx_Srl.mjs} +179 -401
- package/dist/client/rendering/client.mjs +3496 -2223
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +4400 -2510
- package/dist/client/{scrollToBlock-Du5mHgvL.mjs → scrollToBlock-ByQv96M2.mjs} +1 -1
- package/dist/client/{shop-B5zAcKZn.mjs → shop-RUG9DmRE.mjs} +6 -6
- package/dist/client/{shop-commerce-BKBZB6l5.mjs → shop-commerce-B76Jz23B.mjs} +5 -5
- package/dist/client/{shop-commerce-store-Cq4qlNtQ.mjs → shop-commerce-store-QuQNdDsD.mjs} +1 -1
- package/dist/client/{shopShared-DYGzEs9D.mjs → shopShared-vXU1omwJ.mjs} +3 -3
- package/dist/client/{useEventFilters-Bphkda8m.mjs → useEventFilters-ByuU6HLA.mjs} +33 -18
- package/dist/preview-next/before-render.mjs +86 -51
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/keepAlive.mjs +86 -51
- package/dist/preview-next/middleware.mjs +86 -51
- package/dist/{previewAuthStore-C7ksxt5b.mjs → previewAuthStore-L_cKW8Sb.mjs} +86 -51
- package/dist/{sdk-runtime-BbIC8G4J.mjs → sdk-runtime-sUMr5d70.mjs} +2 -2
- package/dist/{separator-CadhAtI7.mjs → separator-BIHkie5i.mjs} +1 -1
- package/dist/server/components.mjs +4397 -2960
- package/dist/server/config-validation.mjs +354 -145
- package/dist/server/config.mjs +354 -145
- package/dist/server/data.mjs +354 -144
- package/dist/server/index.mjs +201 -55
- package/dist/server/manifest.mjs +0 -1
- package/dist/server/next.mjs +4046 -2611
- package/dist/server/page-converter.mjs +225 -122
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4105 -2636
- package/dist/server/rendering.mjs +4522 -3087
- package/dist/server/routing.mjs +3289 -1637
- package/dist/server/server.mjs +23175 -21079
- package/dist/server/theme-bridge.mjs +708 -272
- package/dist/server/theme.mjs +29 -25
- package/dist/styles/index.css +624 -181
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCapacity.d.ts +0 -48
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +0 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +0 -100
- /package/dist/_dts/blocks/src/system/runtime/nodes/events/{shared → domain}/destination.d.ts +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* People presentation for events: teacher lines and name lists.
|
|
3
|
+
*/
|
|
4
|
+
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
5
|
+
export declare function formatTeamMemberNames(names: readonly string[]): string | null;
|
|
6
|
+
export declare function formatEventTeacherLine(event: PublicEvent): string | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type PublicEventPricing } from '../../../../../../../core/src/index';
|
|
2
|
+
import type { PublicEvent, PublicEventTicketType } from '../../../../blocks/events/shared/types';
|
|
3
|
+
type RuntimeEventPricingSource = {
|
|
4
|
+
destination?: unknown;
|
|
5
|
+
eventDestinationMode?: unknown;
|
|
6
|
+
path?: unknown;
|
|
7
|
+
pricing?: unknown;
|
|
8
|
+
requiresRegistration?: boolean | null;
|
|
9
|
+
pricingType?: unknown;
|
|
10
|
+
price?: unknown;
|
|
11
|
+
currency?: unknown;
|
|
12
|
+
priceDisplay?: unknown;
|
|
13
|
+
pricingMode?: unknown;
|
|
14
|
+
ticketTypes?: unknown;
|
|
15
|
+
};
|
|
16
|
+
export declare function resolveRuntimeEventPricing(event: RuntimeEventPricingSource): PublicEventPricing<PublicEventTicketType>;
|
|
17
|
+
/**
|
|
18
|
+
* Format event price for display.
|
|
19
|
+
* @returns "Free", "£25", "£12 - £25", "Free / £12 - £25", "Course (From £40)", etc.
|
|
20
|
+
*
|
|
21
|
+
* Events render compact amounts (no trailing ".00"); the actual ADT→string
|
|
22
|
+
* mapping lives in `formatBookingPriceDisplay` in @riverbankcms/core so all
|
|
23
|
+
* surfaces stay consistent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatEventPrice(event: PublicEvent): string;
|
|
26
|
+
/**
|
|
27
|
+
* Format an event's price directly from its pricing value (without the full
|
|
28
|
+
* event). Same output as {@link formatEventPrice}.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatEventPriceDisplay(pricing: PublicEventPricing<unknown>): string;
|
|
31
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { CalendarDate } from '../../../../../../../calendar/src/index';
|
|
2
3
|
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
3
4
|
export type CalendarDayCellProps = {
|
|
4
5
|
/** The date this cell represents */
|
|
5
|
-
date:
|
|
6
|
+
date: CalendarDate;
|
|
6
7
|
/** Events occurring on this date */
|
|
7
8
|
events: PublicEvent[];
|
|
8
9
|
/** Whether this date is in the currently viewed month */
|
|
9
10
|
isCurrentMonth: boolean;
|
|
11
|
+
today: CalendarDate;
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* CalendarDayCell - Renders a single day in the calendar grid
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CalendarDate } from '../../../../../../../calendar/src/index';
|
|
2
3
|
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
3
4
|
type DayEventsModalProps = {
|
|
4
|
-
date:
|
|
5
|
+
date: CalendarDate;
|
|
5
6
|
events: PublicEvent[];
|
|
6
7
|
showCapacity: boolean;
|
|
7
8
|
onClose: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
3
|
+
import type { CalendarDate } from '../../../../../../../calendar/src/index';
|
|
3
4
|
/**
|
|
4
5
|
* Modal state - either closed, showing a single event, or showing all events for a day
|
|
5
6
|
*/
|
|
@@ -10,13 +11,13 @@ type ModalState = {
|
|
|
10
11
|
event: PublicEvent;
|
|
11
12
|
} | {
|
|
12
13
|
type: 'day';
|
|
13
|
-
date:
|
|
14
|
+
date: CalendarDate;
|
|
14
15
|
events: PublicEvent[];
|
|
15
16
|
};
|
|
16
17
|
interface EventModalContextValue {
|
|
17
18
|
modalState: ModalState;
|
|
18
19
|
openEventModal: (event: PublicEvent) => void;
|
|
19
|
-
openDayModal: (date:
|
|
20
|
+
openDayModal: (date: CalendarDate, events: PublicEvent[]) => void;
|
|
20
21
|
closeModal: () => void;
|
|
21
22
|
}
|
|
22
23
|
type EventModalProviderProps = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Heading for an offering card or row. Links to the offering's page when one
|
|
4
|
+
* exists so a sold-out or closed offering stays reachable (issue 1372); the
|
|
5
|
+
* `.event-title-link` rule lives in theme-core's event-list.css.
|
|
6
|
+
*/
|
|
7
|
+
export declare function OfferingTitle({ className, path, title, }: Readonly<{
|
|
8
|
+
className: string;
|
|
9
|
+
path: string | null;
|
|
10
|
+
title: string;
|
|
11
|
+
}>): React.JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type CalendarDate } from '../../../../../../../calendar/src/index';
|
|
2
3
|
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
3
|
-
import { type WeekCalendarDays } from '
|
|
4
|
+
import { type WeekCalendarDays } from '../domain';
|
|
4
5
|
type WeekAgendaViewProps = {
|
|
5
6
|
days: WeekCalendarDays;
|
|
6
7
|
events: PublicEvent[];
|
|
7
8
|
showCapacity: boolean;
|
|
8
9
|
emptyMessage?: string;
|
|
10
|
+
calendarTimeZone: string;
|
|
11
|
+
today: CalendarDate;
|
|
9
12
|
};
|
|
10
13
|
/**
|
|
11
14
|
* WeekAgendaView Component
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonVariant, PublicEvent } from '../../../../blocks/events/shared/types';
|
|
3
|
-
import { type
|
|
4
|
-
type
|
|
3
|
+
import { type CalendarDate } from '../../../../../../../calendar/src/index';
|
|
4
|
+
import { type WeekCalendarDays, type WeekCalendarViewport } from '../domain';
|
|
5
|
+
export type WeekBoardNavigationState = Readonly<{
|
|
6
|
+
rangeLabel: string;
|
|
7
|
+
isCurrentWeek: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export type WeekBoardLoadState = Readonly<{
|
|
10
|
+
kind: 'idle';
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
kind: 'loading';
|
|
13
|
+
}> | Readonly<{
|
|
14
|
+
kind: 'error';
|
|
15
|
+
onRetry: () => void;
|
|
16
|
+
}>;
|
|
17
|
+
export type WeekBoardNavigation = WeekBoardNavigationState & (Readonly<{
|
|
18
|
+
kind: 'static';
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
kind: 'interactive';
|
|
21
|
+
loadState: WeekBoardLoadState;
|
|
22
|
+
onPrevious: () => void;
|
|
23
|
+
onNext: () => void;
|
|
24
|
+
onToday: () => void;
|
|
25
|
+
}>);
|
|
26
|
+
export declare function buildWeekBoardNavigationState(viewport: Pick<WeekCalendarViewport, 'days' | 'title'>, today: CalendarDate): WeekBoardNavigationState;
|
|
27
|
+
export type WeekBoardViewProps = {
|
|
5
28
|
days: WeekCalendarDays;
|
|
6
29
|
events: PublicEvent[];
|
|
30
|
+
navigation: WeekBoardNavigation;
|
|
7
31
|
showCapacity: boolean;
|
|
8
32
|
emptyMessage?: string;
|
|
9
33
|
/** Optional board title shown in the top bar. Hidden when empty. */
|
|
@@ -19,6 +43,8 @@ type WeekBoardViewProps = {
|
|
|
19
43
|
elevated?: boolean;
|
|
20
44
|
/** Opt-in section band. Generic default is bandless. */
|
|
21
45
|
banded?: boolean;
|
|
46
|
+
calendarTimeZone: string;
|
|
47
|
+
today: CalendarDate;
|
|
22
48
|
};
|
|
23
49
|
type WeekBoardDisplay = Readonly<{
|
|
24
50
|
events: readonly PublicEvent[];
|
|
@@ -32,8 +58,10 @@ type WeekBoardDisplay = Readonly<{
|
|
|
32
58
|
buttonVariant?: ButtonVariant;
|
|
33
59
|
elevated?: boolean;
|
|
34
60
|
banded?: boolean;
|
|
61
|
+
calendarTimeZone: string;
|
|
62
|
+
today: CalendarDate;
|
|
35
63
|
}>;
|
|
36
|
-
export declare function buildWeekBoardViewProps(display: WeekBoardDisplay, days: WeekCalendarDays): WeekBoardViewProps;
|
|
64
|
+
export declare function buildWeekBoardViewProps(display: WeekBoardDisplay, days: WeekCalendarDays, navigation: WeekBoardNavigation, events?: readonly PublicEvent[]): WeekBoardViewProps;
|
|
37
65
|
/**
|
|
38
66
|
* WeekBoardView
|
|
39
67
|
*
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CalendarDate } from '../../../../../../../calendar/src/index';
|
|
2
3
|
import type { PublicEvent, WeekStart } from '../../../../blocks/events/shared/types';
|
|
3
4
|
type WeekTimetableViewProps = {
|
|
4
|
-
viewDate:
|
|
5
|
+
viewDate: CalendarDate;
|
|
6
|
+
today: CalendarDate;
|
|
5
7
|
events: PublicEvent[];
|
|
6
8
|
startOfWeek: WeekStart;
|
|
7
9
|
showCapacity: boolean;
|
package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type CardRole } from "../../../../../../../theme-core/src/cards/index";
|
|
3
|
+
import { type BookingTimeZone } from "../../../../../../../core/src/index";
|
|
4
|
+
import type { CalendarDate } from '../../../../../../../calendar/src/index';
|
|
3
5
|
import type { ButtonVariant, CalendarTabViews, CalendarView, ColumnOption, EventLayout, EventScheduleScope, EventSurfaceScope, FilterAutoShow, PublicEvent, WeekStart } from "../../../../blocks/events/shared/types";
|
|
4
6
|
import { type EventListPaginationAction, type EventListPaginationMode, type EventPageSize } from "./listOptions";
|
|
5
7
|
import type { EventListingDisplay } from "../EventListing.interactive";
|
|
@@ -35,6 +37,7 @@ export type EventCollectionSourceProps = Readonly<{
|
|
|
35
37
|
buttonText?: string;
|
|
36
38
|
emptyMessage?: string;
|
|
37
39
|
className?: string;
|
|
40
|
+
bookingTimeZone?: string;
|
|
38
41
|
}>;
|
|
39
42
|
export type EventCollectionDisplay = Readonly<{
|
|
40
43
|
events: readonly PublicEvent[];
|
|
@@ -70,6 +73,10 @@ export type EventCollectionHydration = Readonly<{
|
|
|
70
73
|
eventSurface: EventSurfaceScope;
|
|
71
74
|
filterEventPresets: string | null;
|
|
72
75
|
scheduleScope: EventScheduleScope;
|
|
76
|
+
calendarContext: Readonly<{
|
|
77
|
+
timeZone: BookingTimeZone;
|
|
78
|
+
initialToday: CalendarDate;
|
|
79
|
+
}>;
|
|
73
80
|
}>;
|
|
74
81
|
export declare const eventCollectionFilterSourceSchemaShape: {
|
|
75
82
|
readonly showFilters: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -116,6 +123,7 @@ export declare const eventCollectionSourceSchemaShape: {
|
|
|
116
123
|
readonly buttonText: z.ZodOptional<z.ZodString>;
|
|
117
124
|
readonly emptyMessage: z.ZodOptional<z.ZodString>;
|
|
118
125
|
readonly className: z.ZodOptional<z.ZodString>;
|
|
126
|
+
readonly bookingTimeZone: z.ZodOptional<z.ZodString>;
|
|
119
127
|
readonly showFilters: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
120
128
|
readonly showCategoryFilter: z.ZodOptional<z.ZodEnum<{
|
|
121
129
|
auto: "auto";
|
|
@@ -1658,5 +1666,5 @@ export declare const eventCollectionDisplaySchemaShape: {
|
|
|
1658
1666
|
};
|
|
1659
1667
|
export declare const eventCollectionHydrationSchema: z.ZodType<EventCollectionHydration>;
|
|
1660
1668
|
export declare function buildEventCollectionDisplay(source: EventCollectionSourceProps): EventCollectionDisplay;
|
|
1661
|
-
export declare function buildEventCollectionHydration(source: EventCollectionSourceProps): EventCollectionHydration;
|
|
1669
|
+
export declare function buildEventCollectionHydration(source: EventCollectionSourceProps, now?: Date): EventCollectionHydration;
|
|
1662
1670
|
export declare function buildEventCollectionListingDisplay(display: EventCollectionDisplay, prefetchedEvents: boolean, className: string | null): EventListingDisplay;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared runtime components and utilities for event blocks
|
|
3
3
|
*/
|
|
4
|
-
export * from '
|
|
4
|
+
export * from '../domain';
|
|
5
|
+
export * from './listingLayout';
|
|
5
6
|
export { EventCard } from './EventCard';
|
|
6
7
|
export { EventCompactRow } from './EventCompactRow';
|
|
7
8
|
export { EmptyState } from './EmptyState';
|
|
8
9
|
export { DateTimeTile } from './DateTimeTile';
|
|
10
|
+
export { OfferingTitle } from './OfferingTitle';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout classes for event listing containers and cards. Presentation
|
|
3
|
+
* plumbing rather than event domain logic, so it lives beside the components.
|
|
4
|
+
*/
|
|
5
|
+
import type { CardOrientation, EventLayout } from '../../../../blocks/events/shared/types';
|
|
6
|
+
/**
|
|
7
|
+
* Column class mappings for grid layouts, derived from the canonical
|
|
8
|
+
* responsive column ladder (see gridUserColumnLadder).
|
|
9
|
+
*/
|
|
10
|
+
export declare const COLUMN_CLASSES: Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* Build container class based on layout mode
|
|
13
|
+
* @param layout - 'grid', 'stack', or 'compact'
|
|
14
|
+
* @param columns - Number of columns for grid layout ('2', '3', '4')
|
|
15
|
+
* @returns `rb-*` class string for the container
|
|
16
|
+
*/
|
|
17
|
+
export declare function getContainerClass(layout: EventLayout, columns: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get card orientation based on layout mode
|
|
20
|
+
* @param layout - 'grid', 'stack', or 'compact'
|
|
21
|
+
* @returns 'horizontal' for stack layout, 'vertical' for grid and compact layouts
|
|
22
|
+
*/
|
|
23
|
+
export declare function getCardOrientation(layout: EventLayout): CardOrientation;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* categoryColor with theme fallback). Renderers (WeekTimetableView,
|
|
7
7
|
* EventCalendar.server) consume this shape.
|
|
8
8
|
*/
|
|
9
|
-
import { type WeekStart } from '../../../../../../../calendar/src/index';
|
|
9
|
+
import { type WeekStart, type CalendarDate } from '../../../../../../../calendar/src/index';
|
|
10
10
|
import type { PublicEvent } from '../../../../blocks/events/shared/types';
|
|
11
11
|
export type TimetableEventCell = {
|
|
12
12
|
event: PublicEvent;
|
|
@@ -24,7 +24,7 @@ export type TimetableEventCell = {
|
|
|
24
24
|
isFull: boolean;
|
|
25
25
|
};
|
|
26
26
|
export type TimetableDay = {
|
|
27
|
-
date:
|
|
27
|
+
date: CalendarDate;
|
|
28
28
|
dateKey: string;
|
|
29
29
|
label: string;
|
|
30
30
|
shortLabel: string;
|
|
@@ -41,7 +41,8 @@ export type TimetableModel = {
|
|
|
41
41
|
};
|
|
42
42
|
type BuildTimetableModelInput = {
|
|
43
43
|
events: readonly PublicEvent[];
|
|
44
|
-
viewDate:
|
|
44
|
+
viewDate: CalendarDate;
|
|
45
|
+
today: CalendarDate;
|
|
45
46
|
startOfWeek: WeekStart;
|
|
46
47
|
};
|
|
47
48
|
export declare function buildTimetableModel(input: BuildTimetableModelInput): TimetableModel;
|
|
@@ -17,7 +17,6 @@ export declare const headerLogoTextVisibleTransform: TransformDefinition;
|
|
|
17
17
|
* Consumed by the site-header block's `$when` gates so the two classic rows are
|
|
18
18
|
* mutually exclusive without introducing a new top-level header variant.
|
|
19
19
|
*/
|
|
20
|
-
export declare const classicNavModeTransform: TransformDefinition;
|
|
21
20
|
declare const maxWidthClassSchema: z.ZodObject<{
|
|
22
21
|
base: z.ZodOptional<z.ZodString>;
|
|
23
22
|
container: z.ZodOptional<z.ZodString>;
|
|
@@ -1,87 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
1
|
+
/** Calendar grid helpers over date-only values. */
|
|
2
|
+
export type CalendarDate = Readonly<{
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
day: number;
|
|
6
|
+
}>;
|
|
8
7
|
export type WeekStart = 'sunday' | 'monday';
|
|
9
8
|
export type CalendarViewportKind = 'month' | 'week';
|
|
10
|
-
export type WeekCalendarDays = readonly [
|
|
9
|
+
export type WeekCalendarDays = readonly [CalendarDate, CalendarDate, CalendarDate, CalendarDate, CalendarDate, CalendarDate, CalendarDate];
|
|
11
10
|
export type MonthCalendarViewport = Readonly<{
|
|
12
11
|
kind: 'month';
|
|
13
|
-
anchorDate:
|
|
14
|
-
days: readonly
|
|
12
|
+
anchorDate: CalendarDate;
|
|
13
|
+
days: readonly CalendarDate[];
|
|
15
14
|
title: string;
|
|
16
15
|
}>;
|
|
17
16
|
export type WeekCalendarViewport = Readonly<{
|
|
18
17
|
kind: 'week';
|
|
19
|
-
anchorDate:
|
|
18
|
+
anchorDate: CalendarDate;
|
|
20
19
|
days: WeekCalendarDays;
|
|
21
20
|
title: string;
|
|
22
21
|
}>;
|
|
23
22
|
export type CalendarViewport = MonthCalendarViewport | WeekCalendarViewport;
|
|
24
23
|
export declare const DAY_NAMES: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
25
24
|
export declare const MONTH_NAMES: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
26
|
-
/**
|
|
27
|
-
* Convention default: maximum events to show per calendar day before a
|
|
28
|
-
* "+N more" overflow indicator. Renderers may override.
|
|
29
|
-
*/
|
|
30
25
|
export declare const MAX_EVENTS_PER_DAY = 3;
|
|
31
|
-
|
|
32
|
-
export declare function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export declare function
|
|
39
|
-
|
|
40
|
-
export declare function
|
|
41
|
-
export declare function
|
|
42
|
-
export declare function
|
|
43
|
-
/**
|
|
44
|
-
* Add (or subtract) months to a date, clamping the day-of-month to the
|
|
45
|
-
* target month's last day. Avoids JS Date overflow (Jan 29 + 1 month → Mar 1
|
|
46
|
-
* in non-leap years).
|
|
47
|
-
*/
|
|
48
|
-
export declare function addMonths(date: Date, months: number): Date;
|
|
49
|
-
/** Add (or subtract) days while preserving local time-of-day fields. */
|
|
50
|
-
export declare function addDays(date: Date, days: number): Date;
|
|
51
|
-
/** Shift a calendar anchor by the natural unit for a viewport kind. */
|
|
52
|
-
export declare function shiftCalendarAnchorDate(date: Date, view: CalendarViewportKind, steps: number): Date;
|
|
53
|
-
/**
|
|
54
|
-
* Get an inclusive 3-month window around `date`, returned as ISO strings
|
|
55
|
-
* with UTC midnight bounds. Suitable for prefetching event windows when
|
|
56
|
-
* the consumer handles timezone conversion downstream.
|
|
57
|
-
*/
|
|
58
|
-
export declare function getThreeMonthRange(date: Date): {
|
|
59
|
-
from: string;
|
|
60
|
-
to: string;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Build the calendar days for a month view. Returns 42 dates (6 rows × 7
|
|
64
|
-
* days) including padding from prior/next months for a stable grid.
|
|
65
|
-
*/
|
|
66
|
-
export declare function getMonthCalendarDays(year: number, month: number, startOfWeek: WeekStart): Date[];
|
|
67
|
-
/** Build the 7 dates of the week containing `baseDate`. */
|
|
68
|
-
export declare function getWeekCalendarDays(baseDate: Date, startOfWeek: WeekStart): Date[];
|
|
69
|
-
/** Build the 7 dates of the week containing `baseDate` as a fixed-width tuple. */
|
|
70
|
-
export declare function getWeekCalendarDayTuple(baseDate: Date, startOfWeek: WeekStart): WeekCalendarDays;
|
|
71
|
-
/**
|
|
72
|
-
* Day-name labels reordered for the chosen week start. Pass a custom
|
|
73
|
-
* `dayNames` array (length 7, Sunday-first) to localize.
|
|
74
|
-
*/
|
|
26
|
+
export declare function formatDateKey(date: CalendarDate): string;
|
|
27
|
+
export declare function isToday(date: CalendarDate, today: CalendarDate): boolean;
|
|
28
|
+
export declare function isSameCalendarDay(left: CalendarDate, right: CalendarDate): boolean;
|
|
29
|
+
export declare function getStartOfMonth(date: CalendarDate): CalendarDate;
|
|
30
|
+
export declare function getEndOfMonth(date: CalendarDate): CalendarDate;
|
|
31
|
+
export declare function addMonths(date: CalendarDate, months: number): CalendarDate;
|
|
32
|
+
export declare function addDays(date: CalendarDate, days: number): CalendarDate;
|
|
33
|
+
export declare function shiftCalendarAnchorDate(date: CalendarDate, view: CalendarViewportKind, steps: number): CalendarDate;
|
|
34
|
+
export declare function getMonthCalendarDays(year: number, month: number, startOfWeek: WeekStart): CalendarDate[];
|
|
35
|
+
export declare function getWeekCalendarDays(baseDate: CalendarDate, startOfWeek: WeekStart): CalendarDate[];
|
|
36
|
+
export declare function getDayOfWeek(date: CalendarDate): number;
|
|
37
|
+
export declare function getWeekCalendarDayTuple(baseDate: CalendarDate, startOfWeek: WeekStart): WeekCalendarDays;
|
|
75
38
|
export declare function getOrderedDayNames(startOfWeek: WeekStart, dayNames?: readonly string[]): string[];
|
|
76
|
-
|
|
77
|
-
* Header title for a calendar view.
|
|
78
|
-
* - month: "January 2025"
|
|
79
|
-
* - week: "January 5 - 11, 2025" or "December 30 - January 5, 2025"
|
|
80
|
-
*/
|
|
81
|
-
export declare function formatCalendarTitle(viewDate: Date, view: 'month' | 'week', days: Date[], monthNames?: readonly string[]): string;
|
|
39
|
+
export declare function formatCalendarTitle(viewDate: CalendarDate, view: CalendarViewportKind, days: readonly CalendarDate[], monthNames?: readonly string[]): string;
|
|
82
40
|
export declare function buildCalendarViewport(input: Readonly<{
|
|
83
41
|
view: CalendarViewportKind;
|
|
84
|
-
anchorDate:
|
|
42
|
+
anchorDate: CalendarDate;
|
|
85
43
|
startOfWeek: WeekStart;
|
|
86
44
|
monthNames?: readonly string[];
|
|
87
45
|
}>): CalendarViewport;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { CalendarViewport, CalendarViewportKind, MonthCalendarViewport, WeekCalendarDays, WeekCalendarViewport, WeekStart, } from './grid';
|
|
2
|
-
export { addDays, buildCalendarViewport, getMonthCalendarDays, getWeekCalendarDays, getWeekCalendarDayTuple, getOrderedDayNames, formatCalendarTitle, formatDateKey, isToday,
|
|
1
|
+
export type { CalendarViewport, CalendarViewportKind, CalendarDate, MonthCalendarViewport, WeekCalendarDays, WeekCalendarViewport, WeekStart, } from './grid';
|
|
2
|
+
export { addDays, buildCalendarViewport, getMonthCalendarDays, getWeekCalendarDays, getWeekCalendarDayTuple, getDayOfWeek, getOrderedDayNames, formatCalendarTitle, formatDateKey, isToday, isSameCalendarDay, addMonths, shiftCalendarAnchorDate, getStartOfMonth, getEndOfMonth, DAY_NAMES, MONTH_NAMES, MAX_EVENTS_PER_DAY, } from './grid';
|
|
3
3
|
export type { TimetableInput, TimetableModel, TimetableDay, TimetableCell, TimetableBounds, TimetableDiagnostic, InvalidItemReason, TimetableView, } from './timetable';
|
|
4
4
|
export { buildTimetableModel } from './timetable';
|
|
5
5
|
export type { GroupItemsByDateAccessors } from './group';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the same output. The model has no opinion on what an item is — pass
|
|
10
10
|
* accessors.
|
|
11
11
|
*/
|
|
12
|
-
import { type WeekStart } from './grid';
|
|
12
|
+
import { type CalendarDate, type WeekStart } from './grid';
|
|
13
13
|
export type TimetableBounds = Readonly<{
|
|
14
14
|
/** Hour ticks below this are clipped. Default 5. */
|
|
15
15
|
minStartHour?: number;
|
|
@@ -24,7 +24,7 @@ export type TimetableBounds = Readonly<{
|
|
|
24
24
|
}>;
|
|
25
25
|
export type TimetableInput<T> = Readonly<{
|
|
26
26
|
items: readonly T[];
|
|
27
|
-
viewDate:
|
|
27
|
+
viewDate: CalendarDate;
|
|
28
28
|
view?: TimetableView;
|
|
29
29
|
startOfWeek: WeekStart;
|
|
30
30
|
getId: (item: T) => string;
|
|
@@ -35,12 +35,8 @@ export type TimetableInput<T> = Readonly<{
|
|
|
35
35
|
/** Sort tiebreak when two items have identical start+end. Defaults to getId. */
|
|
36
36
|
getOrderKey?: (item: T) => string;
|
|
37
37
|
bounds?: TimetableBounds;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
* `new Date()`; pass an explicit value to keep the model fully deterministic
|
|
41
|
-
* for snapshot tests.
|
|
42
|
-
*/
|
|
43
|
-
now?: Date;
|
|
38
|
+
/** The calendar's explicit site-local current date. */
|
|
39
|
+
today: CalendarDate;
|
|
44
40
|
}>;
|
|
45
41
|
export type InvalidItemReason = 'invalid-start' | 'invalid-end' | 'invalid-timezone' | 'non-positive-duration' | 'out-of-visible-hours';
|
|
46
42
|
export type TimetableDiagnostic<T> = Readonly<{
|
|
@@ -68,7 +64,7 @@ export type TimetableCell<T> = Readonly<{
|
|
|
68
64
|
color: string | null;
|
|
69
65
|
}>;
|
|
70
66
|
export type TimetableDay<T> = Readonly<{
|
|
71
|
-
date:
|
|
67
|
+
date: CalendarDate;
|
|
72
68
|
dateKey: string;
|
|
73
69
|
isToday: boolean;
|
|
74
70
|
cells: readonly TimetableCell<T>[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type NonNegativeCents } from '../../../core/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Allocate an integer total proportionally using largest remainders.
|
|
4
|
+
*
|
|
5
|
+
* Negative weights are treated as zero. When every weight is zero, the total
|
|
6
|
+
* is spread evenly instead, with residual units assigned in input order.
|
|
7
|
+
*/
|
|
8
|
+
export declare function allocateTotalByWeight<TLineId extends string>(total: number, lines: readonly Readonly<{
|
|
9
|
+
id: TLineId;
|
|
10
|
+
weight: number;
|
|
11
|
+
}>[]): ReadonlyMap<TLineId, NonNegativeCents>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type EventRegistrationErrorAction = 'none' | 'retry' | 'places' | 'start' | 'details' | 'payment-options' | 'payment-status' | 'portal' | 'event';
|
|
2
|
+
export declare const eventRegistrationErrors: {
|
|
3
|
+
readonly registrationClosed: {
|
|
4
|
+
readonly message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.";
|
|
5
|
+
readonly action: "none";
|
|
6
|
+
};
|
|
7
|
+
readonly paymentUncertain: {
|
|
8
|
+
readonly message: "We’re checking your booking and payment. Please don’t try to book again yet. If you’ve already paid, you don’t need to pay again.";
|
|
9
|
+
readonly action: "payment-status";
|
|
10
|
+
};
|
|
11
|
+
readonly paymentPageUnavailable: {
|
|
12
|
+
readonly message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.";
|
|
13
|
+
readonly action: "retry";
|
|
14
|
+
};
|
|
15
|
+
readonly paymentUnavailable: {
|
|
16
|
+
readonly message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.";
|
|
17
|
+
readonly action: "none";
|
|
18
|
+
};
|
|
19
|
+
readonly capacityChanged: {
|
|
20
|
+
readonly message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.";
|
|
21
|
+
readonly action: "places";
|
|
22
|
+
};
|
|
23
|
+
readonly selectionChanged: {
|
|
24
|
+
readonly message: "The booking options for this event have changed. Please check the latest options and choose your places again.";
|
|
25
|
+
readonly action: "places";
|
|
26
|
+
};
|
|
27
|
+
readonly registrationPreparationChanged: {
|
|
28
|
+
readonly message: "The booking options for this event have changed. Please check the latest options and choose your places again.";
|
|
29
|
+
readonly action: "places";
|
|
30
|
+
};
|
|
31
|
+
readonly registrationAlreadyExists: {
|
|
32
|
+
readonly message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.";
|
|
33
|
+
readonly action: "portal";
|
|
34
|
+
};
|
|
35
|
+
readonly holdExpired: {
|
|
36
|
+
readonly message: "Your reservation has timed out. Please check availability and choose your places again.";
|
|
37
|
+
readonly action: "start";
|
|
38
|
+
};
|
|
39
|
+
readonly waitlistUnavailable: {
|
|
40
|
+
readonly message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.";
|
|
41
|
+
readonly action: "event";
|
|
42
|
+
};
|
|
43
|
+
readonly paymentContextMismatch: {
|
|
44
|
+
readonly message: "The payment options for this event have changed. Please check the latest options before continuing.";
|
|
45
|
+
readonly action: "payment-options";
|
|
46
|
+
};
|
|
47
|
+
readonly idempotencyConflict: {
|
|
48
|
+
readonly message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.";
|
|
49
|
+
readonly action: "portal";
|
|
50
|
+
};
|
|
51
|
+
readonly invalidCommitInput: {
|
|
52
|
+
readonly message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.";
|
|
53
|
+
readonly action: "details";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export type EventRegistrationErrorReason = keyof typeof eventRegistrationErrors;
|
|
57
|
+
export declare function parseEventRegistrationErrorReason(value: unknown): EventRegistrationErrorReason | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
+
export * from './allocation';
|
|
2
3
|
export * from './orderTypes';
|
|
3
4
|
export * from './orderPlanningTypes';
|
|
4
5
|
export * from './bookingInstalmentSchedule';
|
|
@@ -52,4 +53,6 @@ export * from './refundPolicy';
|
|
|
52
53
|
export * from './settlement';
|
|
53
54
|
export * from './shopRefundPlanning';
|
|
54
55
|
export * from './stripeMinimumCharge';
|
|
56
|
+
export * from './stripeCheckoutReturnUrl';
|
|
55
57
|
export * from './stateTransitions';
|
|
58
|
+
export * from './event-registration-errors';
|
|
@@ -89,6 +89,39 @@ export declare function buildRefundableLineSettlement<TLineId extends string>(op
|
|
|
89
89
|
stripeChargeCents: number;
|
|
90
90
|
alreadyRefundedCents: number;
|
|
91
91
|
}>): Result<RefundableLineSettlement, RefundableLineSettlementError<TLineId>>;
|
|
92
|
+
export type OrderItemCashAllocation = Readonly<{
|
|
93
|
+
orderItemId: string;
|
|
94
|
+
amountCents: number;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Cash actually collected against one order line, summed from its payment
|
|
98
|
+
* receipt allocations. Shared so every refundable-remainder caller measures
|
|
99
|
+
* funding the same way.
|
|
100
|
+
*/
|
|
101
|
+
export declare function orderItemCashFundedCents(allocations: ReadonlyArray<OrderItemCashAllocation>, orderItemId: string): number;
|
|
102
|
+
/**
|
|
103
|
+
* Funding facts for a single order line, expressed the way the refund runtime
|
|
104
|
+
* sees them: cash actually collected against the line (payment receipt
|
|
105
|
+
* allocations), plus any store credit applied to it, minus what has already
|
|
106
|
+
* been refunded.
|
|
107
|
+
*/
|
|
108
|
+
export type OrderItemRefundFunding = Readonly<{
|
|
109
|
+
/** Cash collected for this line so far (receipt allocation totals). */
|
|
110
|
+
cashFundedCents: number;
|
|
111
|
+
/** Store credit applied to this line. */
|
|
112
|
+
creditAppliedCents: number;
|
|
113
|
+
/** Refunds already applied to this line. */
|
|
114
|
+
refundedCents: number;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* The single authority on how much of an order line is still refundable.
|
|
118
|
+
*
|
|
119
|
+
* Every surface that shows or enforces a refundable remainder MUST go through
|
|
120
|
+
* this function. Computing it from the line's net total instead of its actual
|
|
121
|
+
* funding overstates the remainder on partially collected orders, which used to
|
|
122
|
+
* let the dashboard offer a refund the runtime then refused.
|
|
123
|
+
*/
|
|
124
|
+
export declare function orderItemRefundableRemainingCents(funding: OrderItemRefundFunding): NonNegativeCents;
|
|
92
125
|
export declare function refundableRemainingCents(settlement: RefundableLineSettlement): NonNegativeCents;
|
|
93
126
|
export declare function ensureSingleCurrency(lines: ReadonlyArray<{
|
|
94
127
|
currency: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const STRIPE_CHECKOUT_SESSION_ID_PLACEHOLDER = "{CHECKOUT_SESSION_ID}";
|
|
2
|
+
/**
|
|
3
|
+
* Completes a Stripe success URL with the session correlation parameter.
|
|
4
|
+
*
|
|
5
|
+
* URL owns the query/fragment boundary so the parameter can never be appended
|
|
6
|
+
* inside a hash fragment. Stripe requires its placeholder to remain literal.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureStripeCheckoutSessionIdInSuccessUrl(successUrl: string): string;
|
|
@@ -124,6 +124,9 @@ export declare const DEFAULT_TEMPLATE_DEFINITIONS: {
|
|
|
124
124
|
}, {
|
|
125
125
|
readonly blockKind: "block.body-text";
|
|
126
126
|
readonly scope: "entry";
|
|
127
|
+
readonly content: {
|
|
128
|
+
readonly body: import("../../../core/src/index").RichTextDoc;
|
|
129
|
+
};
|
|
127
130
|
readonly bindings: import("./types").TemplateBindingRecord;
|
|
128
131
|
}, {
|
|
129
132
|
readonly blockKind: "system.entry-slot";
|
|
@@ -189,6 +192,9 @@ export declare const DEFAULT_TEMPLATE_DEFINITIONS: {
|
|
|
189
192
|
}, {
|
|
190
193
|
readonly blockKind: "block.body-text";
|
|
191
194
|
readonly scope: "entry";
|
|
195
|
+
readonly content: {
|
|
196
|
+
readonly body: import("../../../core/src/index").RichTextDoc;
|
|
197
|
+
};
|
|
192
198
|
readonly bindings: import("./types").TemplateBindingRecord;
|
|
193
199
|
}];
|
|
194
200
|
};
|