@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
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { D as clsx } from "./colorStyles-CrxJrPjJ.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { o as EventFilters, t as useEventFilters } from "./useEventFilters-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { E as buildEventCalendarListingRender, M as buildEventRuntimeFilters, N as getEventRuntimeFiltersKey, X as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-pYvx_Srl.mjs";
|
|
4
|
+
import { o as EventFilters, s as formatEventTeacherLine, t as useEventFilters } from "./useEventFilters-ByuU6HLA.mjs";
|
|
5
|
+
import { c as getEventAvailabilityStatus, r as formatEventRemainingPlaces, u as isEventFull } from "./capacity-BW00PO7s.mjs";
|
|
6
|
+
import { a as groupEventsByDate, i as formatTime, l as resolveEventLinkProps, o as getLocalDateKey, s as getLocalMinuteOfDay } from "./dates-2RPXHQy4.mjs";
|
|
7
|
+
import { a as CalendarDayCell, c as useCalendarEvents, d as formatDateKey, f as getDayOfWeek, g as isToday, h as isSameCalendarDay, i as WeekAgendaView, l as MONTH_NAMES, m as getWeekCalendarDays, o as EventModalProvider, p as getOrderedDayNames, r as EventModals, s as useEventModal, t as EventCombinedClient, u as addDays } from "./EventCombined.client-CwJOxn7A.mjs";
|
|
8
|
+
import { t as BlockApiProvider } from "./context-DCkiHVdD.mjs";
|
|
7
9
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
8
10
|
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
|
|
9
|
-
import { n as EventListingController } from "./EventListing.client-
|
|
11
|
+
import { n as EventListingController } from "./EventListing.client-eVwiylPW.mjs";
|
|
10
12
|
import { useEffect, useId, useMemo, useState } from "react";
|
|
11
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
14
|
//#region ../calendar/src/lane-packing.ts
|
|
@@ -80,13 +82,12 @@ function buildTimetableModel$1(input) {
|
|
|
80
82
|
const bounds = resolveBounds(input.bounds);
|
|
81
83
|
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
82
84
|
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
83
|
-
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
84
85
|
const parsed = parseAllItems(input.items, input);
|
|
85
86
|
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
86
87
|
const hourRange = resolveHourRange(inViewport, bounds);
|
|
87
88
|
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
88
89
|
return {
|
|
89
|
-
days: assembleDays(viewportDays, laid.cellsByDate,
|
|
90
|
+
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
90
91
|
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
91
92
|
startHour: hourRange.startHour,
|
|
92
93
|
endHour: hourRange.endHour,
|
|
@@ -143,13 +144,13 @@ function layoutCellsByDate(segments, hourRange, bounds) {
|
|
|
143
144
|
diagnostics
|
|
144
145
|
};
|
|
145
146
|
}
|
|
146
|
-
function assembleDays(viewportDays, cellsByDate,
|
|
147
|
+
function assembleDays(viewportDays, cellsByDate, today) {
|
|
147
148
|
return viewportDays.map((date) => {
|
|
148
149
|
const dateKey = formatDateKey(date);
|
|
149
150
|
return {
|
|
150
151
|
date,
|
|
151
152
|
dateKey,
|
|
152
|
-
isToday:
|
|
153
|
+
isToday: isSameCalendarDay(date, today),
|
|
153
154
|
cells: cellsByDate.get(dateKey) ?? []
|
|
154
155
|
};
|
|
155
156
|
});
|
|
@@ -301,13 +302,12 @@ function getTimetableDays(viewDate, view, startOfWeek) {
|
|
|
301
302
|
function enumerateDateKeys(startDateKey, endDateKey) {
|
|
302
303
|
if (startDateKey > endDateKey) throw new Error(`Invalid timetable date range: ${startDateKey} is after ${endDateKey}`);
|
|
303
304
|
const start = parseDateKey(startDateKey);
|
|
304
|
-
|
|
305
|
+
parseDateKey(endDateKey);
|
|
305
306
|
const keys = [];
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
while (cursor.getTime() <= endDate.getTime()) {
|
|
307
|
+
let cursor = start;
|
|
308
|
+
while (formatDateKey(cursor) <= endDateKey) {
|
|
309
309
|
keys.push(formatDateKey(cursor));
|
|
310
|
-
cursor
|
|
310
|
+
cursor = addDays(cursor, 1);
|
|
311
311
|
}
|
|
312
312
|
return keys;
|
|
313
313
|
}
|
|
@@ -322,11 +322,36 @@ function parseDateKey(dateKey) {
|
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
//#endregion
|
|
325
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
|
|
326
|
+
function CalendarNavigationChevron({ direction }) {
|
|
327
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
328
|
+
width: "20",
|
|
329
|
+
height: "20",
|
|
330
|
+
fill: "none",
|
|
331
|
+
stroke: "currentColor",
|
|
332
|
+
strokeWidth: 2,
|
|
333
|
+
viewBox: "0 0 24 24",
|
|
334
|
+
"aria-hidden": "true",
|
|
335
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
336
|
+
strokeLinecap: "round",
|
|
337
|
+
strokeLinejoin: "round",
|
|
338
|
+
d: direction === "previous" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
|
|
339
|
+
})
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
325
343
|
//#region ../blocks/src/system/runtime/nodes/events/shared/WeekBoardView.tsx
|
|
326
|
-
function
|
|
344
|
+
function buildWeekBoardNavigationState(viewport, today) {
|
|
345
|
+
return {
|
|
346
|
+
rangeLabel: viewport.title,
|
|
347
|
+
isCurrentWeek: viewport.days.some((day) => isToday(day, today))
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function buildWeekBoardViewProps(display, days, navigation, events = display.events) {
|
|
327
351
|
return {
|
|
328
352
|
days,
|
|
329
|
-
events: [...
|
|
353
|
+
events: [...events],
|
|
354
|
+
navigation,
|
|
330
355
|
showCapacity: display.showCapacity,
|
|
331
356
|
emptyMessage: display.emptyMessage,
|
|
332
357
|
title: display.boardTitle,
|
|
@@ -335,7 +360,9 @@ function buildWeekBoardViewProps(display, days) {
|
|
|
335
360
|
ctaHref: display.seeAllUrl,
|
|
336
361
|
buttonVariant: display.buttonVariant,
|
|
337
362
|
elevated: display.elevated,
|
|
338
|
-
banded: display.banded
|
|
363
|
+
banded: display.banded,
|
|
364
|
+
calendarTimeZone: display.calendarTimeZone,
|
|
365
|
+
today: display.today
|
|
339
366
|
};
|
|
340
367
|
}
|
|
341
368
|
const SHORT_DAY_NAMES = [
|
|
@@ -399,6 +426,114 @@ const WeekBoardCard = ({ event, showCapacity }) => {
|
|
|
399
426
|
]
|
|
400
427
|
});
|
|
401
428
|
};
|
|
429
|
+
const WeekBoardNavigationControls = ({ navigation, todayClassName }) => {
|
|
430
|
+
const handlers = navigation.kind === "interactive" ? navigation : {
|
|
431
|
+
onPrevious: void 0,
|
|
432
|
+
onNext: void 0,
|
|
433
|
+
onToday: void 0
|
|
434
|
+
};
|
|
435
|
+
const isLoading = navigation.kind === "interactive" && navigation.loadState.kind === "loading";
|
|
436
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
437
|
+
className: "event-week-board-navigation",
|
|
438
|
+
"aria-label": "Choose week",
|
|
439
|
+
children: [
|
|
440
|
+
/* @__PURE__ */ jsx("button", {
|
|
441
|
+
type: "button",
|
|
442
|
+
className: "event-week-board-nav-button",
|
|
443
|
+
"aria-label": "Previous week",
|
|
444
|
+
onClick: handlers.onPrevious,
|
|
445
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
|
|
446
|
+
}),
|
|
447
|
+
/* @__PURE__ */ jsxs("h3", {
|
|
448
|
+
className: "event-week-board-range",
|
|
449
|
+
"aria-live": "polite",
|
|
450
|
+
children: [navigation.rangeLabel, isLoading ? /* @__PURE__ */ jsx("span", {
|
|
451
|
+
className: "event-week-board-loading",
|
|
452
|
+
children: " Loading…"
|
|
453
|
+
}) : null]
|
|
454
|
+
}),
|
|
455
|
+
/* @__PURE__ */ jsx("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
className: "event-week-board-nav-button",
|
|
458
|
+
"aria-label": "Next week",
|
|
459
|
+
onClick: handlers.onNext,
|
|
460
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ jsx("button", {
|
|
463
|
+
type: "button",
|
|
464
|
+
className: todayClassName,
|
|
465
|
+
disabled: navigation.isCurrentWeek,
|
|
466
|
+
onClick: handlers.onToday,
|
|
467
|
+
children: "Today"
|
|
468
|
+
})
|
|
469
|
+
]
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
const WeekBoardLegend = () => /* @__PURE__ */ jsx("div", {
|
|
473
|
+
className: "event-week-board-legend",
|
|
474
|
+
"aria-hidden": "true",
|
|
475
|
+
children: LEGEND_ITEMS.map((item) => /* @__PURE__ */ jsxs("span", {
|
|
476
|
+
className: "event-week-board-legend-item",
|
|
477
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
478
|
+
className: "event-week-board-legend-dot",
|
|
479
|
+
"data-status": item.status
|
|
480
|
+
}), item.label]
|
|
481
|
+
}, item.status))
|
|
482
|
+
});
|
|
483
|
+
const WeekBoardLoadError = ({ navigation, buttonClassName }) => {
|
|
484
|
+
if (navigation.kind !== "interactive" || navigation.loadState.kind !== "error") return null;
|
|
485
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
486
|
+
className: "event-week-board-error",
|
|
487
|
+
role: "status",
|
|
488
|
+
children: [/* @__PURE__ */ jsx("p", { children: "Failed to load events" }), /* @__PURE__ */ jsx("button", {
|
|
489
|
+
type: "button",
|
|
490
|
+
className: buttonClassName,
|
|
491
|
+
onClick: navigation.loadState.onRetry,
|
|
492
|
+
children: "Try again"
|
|
493
|
+
})]
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
const WeekBoardGrid = ({ days, eventsByDate, showCapacity, today: currentDate }) => /* @__PURE__ */ jsx("div", {
|
|
497
|
+
className: "event-week-board-grid",
|
|
498
|
+
children: days.map((date) => {
|
|
499
|
+
const dateKey = formatDateKey(date);
|
|
500
|
+
const dayEvents = eventsByDate.get(dateKey) ?? [];
|
|
501
|
+
const today = isToday(date, currentDate);
|
|
502
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
503
|
+
className: clsx("event-week-board-day", dayEvents.length === 0 && "event-week-board-day--empty", today && "event-week-board-day--today"),
|
|
504
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
505
|
+
className: "event-week-board-day-head",
|
|
506
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
507
|
+
className: "event-week-board-day-abbr",
|
|
508
|
+
children: SHORT_DAY_NAMES[getDayOfWeek(date)]
|
|
509
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
510
|
+
className: "event-week-board-day-num",
|
|
511
|
+
children: date.day
|
|
512
|
+
})]
|
|
513
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
514
|
+
className: "event-week-board-day-body",
|
|
515
|
+
children: dayEvents.map((event) => /* @__PURE__ */ jsx(WeekBoardCard, {
|
|
516
|
+
event,
|
|
517
|
+
showCapacity
|
|
518
|
+
}, event.occurrenceId || event.id))
|
|
519
|
+
})]
|
|
520
|
+
}, dateKey);
|
|
521
|
+
})
|
|
522
|
+
});
|
|
523
|
+
const WeekBoardFooter = ({ note, ctaHref, ctaLabel, ctaClassName }) => {
|
|
524
|
+
if (note === null && ctaHref === null) return null;
|
|
525
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
526
|
+
className: "event-week-board-foot",
|
|
527
|
+
children: [note === null ? null : /* @__PURE__ */ jsx("p", {
|
|
528
|
+
className: "event-week-board-foot-note",
|
|
529
|
+
children: note
|
|
530
|
+
}), ctaHref === null ? null : /* @__PURE__ */ jsx("a", {
|
|
531
|
+
className: ctaClassName,
|
|
532
|
+
href: ctaHref,
|
|
533
|
+
children: ctaLabel
|
|
534
|
+
})]
|
|
535
|
+
});
|
|
536
|
+
};
|
|
402
537
|
/**
|
|
403
538
|
* WeekBoardView
|
|
404
539
|
*
|
|
@@ -407,18 +542,21 @@ const WeekBoardCard = ({ event, showCapacity }) => {
|
|
|
407
542
|
* to a stacked list on mobile. Repurposes the week-grouped agenda data as a
|
|
408
543
|
* board rather than an hour-positioned timetable grid.
|
|
409
544
|
*/
|
|
410
|
-
const WeekBoardView = ({ days, events, showCapacity, emptyMessage = "No classes scheduled this week", title, footerNote, ctaLabel = "Reserve a place", ctaHref = null, buttonVariant = "outline", elevated = false, banded = false }) => {
|
|
411
|
-
const eventsByDate = groupEventsByDate(events);
|
|
545
|
+
const WeekBoardView = ({ days, events, navigation, showCapacity, emptyMessage = "No classes scheduled this week", title, footerNote, ctaLabel = "Reserve a place", ctaHref = null, buttonVariant = "outline", elevated = false, banded = false, calendarTimeZone, today }) => {
|
|
546
|
+
const eventsByDate = groupEventsByDate(events, calendarTimeZone);
|
|
412
547
|
const hasAnyEvents = days.some((date) => (eventsByDate.get(formatDateKey(date)) ?? []).length > 0);
|
|
413
548
|
const ctaClassName = themeButtonClassName({
|
|
414
549
|
variant: buttonVariant,
|
|
415
550
|
size: "sm"
|
|
416
551
|
});
|
|
552
|
+
const todayClassName = themeButtonClassName({
|
|
553
|
+
variant: buttonVariant,
|
|
554
|
+
size: "sm"
|
|
555
|
+
});
|
|
417
556
|
const hasTitle = typeof title === "string" && title.length > 0;
|
|
418
557
|
const hasFooterNote = typeof footerNote === "string" && footerNote.length > 0;
|
|
419
|
-
const hasCta = typeof ctaHref === "string" && ctaHref.length > 0;
|
|
420
558
|
const footerNoteText = hasAnyEvents ? hasFooterNote ? footerNote : null : emptyMessage;
|
|
421
|
-
const
|
|
559
|
+
const resolvedCtaHref = typeof ctaHref === "string" && ctaHref.length > 0 ? ctaHref : null;
|
|
422
560
|
return /* @__PURE__ */ jsx("div", {
|
|
423
561
|
className: "event-calendar event-calendar--week-board",
|
|
424
562
|
"data-block": "event-calendar",
|
|
@@ -430,59 +568,34 @@ const WeekBoardView = ({ days, events, showCapacity, emptyMessage = "No classes
|
|
|
430
568
|
children: [
|
|
431
569
|
/* @__PURE__ */ jsxs("div", {
|
|
432
570
|
className: "event-week-board-top",
|
|
433
|
-
children: [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}), item.label]
|
|
445
|
-
}, item.status))
|
|
446
|
-
})]
|
|
571
|
+
children: [
|
|
572
|
+
hasTitle ? /* @__PURE__ */ jsx("span", {
|
|
573
|
+
className: "event-week-board-title",
|
|
574
|
+
children: title
|
|
575
|
+
}) : null,
|
|
576
|
+
/* @__PURE__ */ jsx(WeekBoardNavigationControls, {
|
|
577
|
+
navigation,
|
|
578
|
+
todayClassName
|
|
579
|
+
}),
|
|
580
|
+
/* @__PURE__ */ jsx(WeekBoardLegend, {})
|
|
581
|
+
]
|
|
447
582
|
}),
|
|
448
|
-
/* @__PURE__ */ jsx(
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
const dateKey = formatDateKey(date);
|
|
452
|
-
const dayEvents = eventsByDate.get(dateKey) ?? [];
|
|
453
|
-
const today = isToday(date);
|
|
454
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
455
|
-
className: clsx("event-week-board-day", dayEvents.length === 0 && "event-week-board-day--empty", today && "event-week-board-day--today"),
|
|
456
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
457
|
-
className: "event-week-board-day-head",
|
|
458
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
459
|
-
className: "event-week-board-day-abbr",
|
|
460
|
-
children: SHORT_DAY_NAMES[date.getDay()]
|
|
461
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
462
|
-
className: "event-week-board-day-num",
|
|
463
|
-
children: date.getDate()
|
|
464
|
-
})]
|
|
465
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
466
|
-
className: "event-week-board-day-body",
|
|
467
|
-
children: dayEvents.map((event) => /* @__PURE__ */ jsx(WeekBoardCard, {
|
|
468
|
-
event,
|
|
469
|
-
showCapacity
|
|
470
|
-
}, event.occurrenceId || event.id))
|
|
471
|
-
})]
|
|
472
|
-
}, dateKey);
|
|
473
|
-
})
|
|
583
|
+
/* @__PURE__ */ jsx(WeekBoardLoadError, {
|
|
584
|
+
navigation,
|
|
585
|
+
buttonClassName: todayClassName
|
|
474
586
|
}),
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
587
|
+
/* @__PURE__ */ jsx(WeekBoardGrid, {
|
|
588
|
+
days,
|
|
589
|
+
eventsByDate,
|
|
590
|
+
showCapacity,
|
|
591
|
+
today
|
|
592
|
+
}),
|
|
593
|
+
/* @__PURE__ */ jsx(WeekBoardFooter, {
|
|
594
|
+
note: footerNoteText,
|
|
595
|
+
ctaHref: resolvedCtaHref,
|
|
596
|
+
ctaLabel,
|
|
597
|
+
ctaClassName
|
|
598
|
+
})
|
|
486
599
|
]
|
|
487
600
|
})
|
|
488
601
|
});
|
|
@@ -513,12 +626,13 @@ function buildTimetableModel(input) {
|
|
|
513
626
|
items: input.events,
|
|
514
627
|
viewDate: input.viewDate,
|
|
515
628
|
startOfWeek: input.startOfWeek,
|
|
629
|
+
today: input.today,
|
|
516
630
|
getId: (event) => event.id,
|
|
517
631
|
getStartsAt: (event) => event.startsAt,
|
|
518
632
|
getEndsAt: (event) => event.endsAt,
|
|
519
633
|
getTimeZone: (event) => event.timeZone ?? "UTC",
|
|
520
634
|
getColor: (event) => event.eventCategory?.color ?? null,
|
|
521
|
-
getOrderKey: (event) => `${event.title}
|
|
635
|
+
getOrderKey: (event) => `${event.title}\u0000${event.id}`
|
|
522
636
|
});
|
|
523
637
|
return {
|
|
524
638
|
hourTicks: [...generic.hourTicks],
|
|
@@ -555,18 +669,9 @@ function toEventCell(cell) {
|
|
|
555
669
|
};
|
|
556
670
|
}
|
|
557
671
|
function formatTimetableCapacity(event) {
|
|
558
|
-
const { available, isFull } = getEventAvailability(event);
|
|
559
|
-
if (available == null) return {
|
|
560
|
-
label: null,
|
|
561
|
-
isFull: false
|
|
562
|
-
};
|
|
563
|
-
if (isFull) return {
|
|
564
|
-
label: "Full",
|
|
565
|
-
isFull: true
|
|
566
|
-
};
|
|
567
672
|
return {
|
|
568
|
-
label:
|
|
569
|
-
isFull:
|
|
673
|
+
label: formatEventRemainingPlaces(event, { compact: true }),
|
|
674
|
+
isFull: isEventFull(event)
|
|
570
675
|
};
|
|
571
676
|
}
|
|
572
677
|
function formatEventTimeRange(event) {
|
|
@@ -574,22 +679,24 @@ function formatEventTimeRange(event) {
|
|
|
574
679
|
return `${formatTime(event.startsAt, { timeZone })} - ${formatTime(event.endsAt, { timeZone })}`;
|
|
575
680
|
}
|
|
576
681
|
function formatDayLabel(date) {
|
|
577
|
-
return `${FULL_DAY_NAMES[date
|
|
682
|
+
return `${FULL_DAY_NAMES[getDayOfWeek(date)] ?? ""}, ${MONTH_NAMES[date.month - 1] ?? ""} ${date.day}`;
|
|
578
683
|
}
|
|
579
684
|
function formatShortDayLabel(date) {
|
|
580
|
-
return `${(FULL_DAY_NAMES[date
|
|
685
|
+
return `${(FULL_DAY_NAMES[getDayOfWeek(date)] ?? "").slice(0, 3)} ${date.day}`;
|
|
581
686
|
}
|
|
582
687
|
//#endregion
|
|
583
688
|
//#region ../blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.tsx
|
|
584
|
-
const WeekTimetableView = ({ viewDate, events, startOfWeek, showCapacity, emptyMessage = "No classes scheduled" }) => {
|
|
689
|
+
const WeekTimetableView = ({ viewDate, events, startOfWeek, today, showCapacity, emptyMessage = "No classes scheduled" }) => {
|
|
585
690
|
const { openEventModal } = useEventModal();
|
|
586
691
|
const model = useMemo(() => buildTimetableModel({
|
|
587
692
|
events,
|
|
588
693
|
viewDate,
|
|
589
|
-
startOfWeek
|
|
694
|
+
startOfWeek,
|
|
695
|
+
today
|
|
590
696
|
}), [
|
|
591
697
|
events,
|
|
592
698
|
startOfWeek,
|
|
699
|
+
today,
|
|
593
700
|
viewDate
|
|
594
701
|
]);
|
|
595
702
|
const [selectedDayKey, setSelectedDayKey] = useState(() => model.days.find((day) => day.isToday)?.dateKey ?? model.days[0]?.dateKey ?? "");
|
|
@@ -748,37 +855,75 @@ const EventCalendarClient = ({ render }) => {
|
|
|
748
855
|
buttonVariant: display.buttonVariant,
|
|
749
856
|
buttonText: display.buttonText,
|
|
750
857
|
emptyMessage: display.emptyMessage,
|
|
751
|
-
className: display.className ?? void 0
|
|
858
|
+
className: display.className ?? void 0,
|
|
859
|
+
calendarContext: hydration.calendarContext
|
|
752
860
|
});
|
|
753
861
|
if (display.displayMode === "list") return /* @__PURE__ */ jsx(EventListingController, { render: buildEventCalendarListingRender(render) });
|
|
754
862
|
if (display.displayMode === "timetable") return /* @__PURE__ */ jsx(EventCalendarTimetableClient, { render });
|
|
755
|
-
if (display.displayMode === "week-board") return /* @__PURE__ */ jsx(EventCalendarWeekBoardClient, {
|
|
863
|
+
if (display.displayMode === "week-board") return /* @__PURE__ */ jsx(EventCalendarWeekBoardClient, { render });
|
|
756
864
|
return /* @__PURE__ */ jsx(EventCalendarGridClient, { render });
|
|
757
865
|
};
|
|
758
|
-
const EventCalendarWeekBoardClient = ({
|
|
759
|
-
|
|
866
|
+
const EventCalendarWeekBoardClient = ({ render }) => {
|
|
867
|
+
const { display, hydration } = render;
|
|
868
|
+
const filters = useMemo(() => buildDisplayFilterParams(display), [
|
|
869
|
+
display.eventSurface,
|
|
870
|
+
display.filterCategoryIds,
|
|
871
|
+
display.filterEventPresets,
|
|
872
|
+
display.filterStaffMemberId,
|
|
873
|
+
display.filterVenueId,
|
|
874
|
+
display.scheduleScope
|
|
875
|
+
]);
|
|
876
|
+
const initialEvents = usePrefetchedCalendarEvents(display, filters);
|
|
877
|
+
const { events, viewport, loadState, goToPrevious, goToNext, goToToday, retryCurrentView } = useCalendarEvents({
|
|
878
|
+
siteId: hydration.siteId,
|
|
879
|
+
initialEvents,
|
|
880
|
+
view: "week",
|
|
881
|
+
startOfWeek: display.startOfWeek,
|
|
882
|
+
preloadMonths: 1,
|
|
883
|
+
filters,
|
|
884
|
+
stage: hydration.stage,
|
|
885
|
+
calendarContext: hydration.calendarContext
|
|
886
|
+
});
|
|
887
|
+
const weekBoardLoadState = loadState.kind === "error" ? {
|
|
888
|
+
kind: "error",
|
|
889
|
+
onRetry: retryCurrentView
|
|
890
|
+
} : loadState;
|
|
891
|
+
const navigation = {
|
|
892
|
+
kind: "interactive",
|
|
893
|
+
...buildWeekBoardNavigationState(viewport, hydration.calendarContext.initialToday),
|
|
894
|
+
loadState: weekBoardLoadState,
|
|
895
|
+
onPrevious: goToPrevious,
|
|
896
|
+
onNext: goToNext,
|
|
897
|
+
onToday: goToToday
|
|
898
|
+
};
|
|
899
|
+
return /* @__PURE__ */ jsx(WeekBoardView, { ...buildWeekBoardViewProps({
|
|
900
|
+
...display,
|
|
901
|
+
calendarTimeZone: hydration.calendarContext.timeZone,
|
|
902
|
+
today: hydration.calendarContext.initialToday
|
|
903
|
+
}, viewport.days, navigation, events) });
|
|
760
904
|
};
|
|
761
905
|
const EventCalendarTimetableClient = ({ render }) => {
|
|
762
906
|
const { display, hydration } = render;
|
|
763
907
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
764
908
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
765
|
-
const { events, viewDate, viewport,
|
|
909
|
+
const { events, viewDate, viewport, loadState, retryCurrentView, goToPrevious, goToNext, goToToday } = useCalendarEvents({
|
|
766
910
|
siteId: hydration.siteId,
|
|
767
911
|
initialEvents: calendarInitialEvents,
|
|
768
912
|
view: "week",
|
|
769
913
|
startOfWeek: display.startOfWeek,
|
|
770
914
|
preloadMonths: 1,
|
|
771
915
|
filters: listFilters,
|
|
772
|
-
stage: hydration.stage
|
|
916
|
+
stage: hydration.stage,
|
|
917
|
+
calendarContext: hydration.calendarContext
|
|
773
918
|
});
|
|
774
919
|
return /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsx(EventCalendarChrome, {
|
|
775
920
|
display,
|
|
776
921
|
calendarView: "week",
|
|
777
922
|
className: "event-calendar--timetable",
|
|
778
|
-
|
|
923
|
+
loadState,
|
|
779
924
|
filters: filtersNode,
|
|
780
925
|
headerTitle: viewport.title,
|
|
781
|
-
|
|
926
|
+
onRetry: retryCurrentView,
|
|
782
927
|
onNext: goToNext,
|
|
783
928
|
onPrevious: goToPrevious,
|
|
784
929
|
onToday: goToToday,
|
|
@@ -787,7 +932,8 @@ const EventCalendarTimetableClient = ({ render }) => {
|
|
|
787
932
|
events,
|
|
788
933
|
startOfWeek: display.startOfWeek,
|
|
789
934
|
emptyMessage: display.emptyMessage,
|
|
790
|
-
showCapacity: display.showCapacity
|
|
935
|
+
showCapacity: display.showCapacity,
|
|
936
|
+
today: hydration.calendarContext.initialToday
|
|
791
937
|
})
|
|
792
938
|
}), /* @__PURE__ */ jsx(EventModals, {
|
|
793
939
|
cardRole: display.cardRole,
|
|
@@ -801,24 +947,25 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
801
947
|
const calendarView = display.defaultCalendarView;
|
|
802
948
|
const { filtersNode, listFilters } = useEventCalendarFilterState(display);
|
|
803
949
|
const calendarInitialEvents = usePrefetchedCalendarEvents(display, listFilters);
|
|
804
|
-
const { events, viewDate, viewport,
|
|
950
|
+
const { events, viewDate, viewport, loadState, retryCurrentView, goToPrevious, goToNext, goToToday } = useCalendarEvents({
|
|
805
951
|
siteId: hydration.siteId,
|
|
806
952
|
initialEvents: calendarInitialEvents,
|
|
807
953
|
view: calendarView,
|
|
808
954
|
startOfWeek: display.startOfWeek,
|
|
809
955
|
preloadMonths: 1,
|
|
810
956
|
filters: listFilters,
|
|
811
|
-
stage: hydration.stage
|
|
957
|
+
stage: hydration.stage,
|
|
958
|
+
calendarContext: hydration.calendarContext
|
|
812
959
|
});
|
|
813
|
-
const eventsByDate = useMemo(() => groupEventsByDate(events), [events]);
|
|
960
|
+
const eventsByDate = useMemo(() => groupEventsByDate(events, hydration.calendarContext.timeZone), [events, hydration.calendarContext.timeZone]);
|
|
814
961
|
const dayNames = useMemo(() => getOrderedDayNames(display.startOfWeek), [display.startOfWeek]);
|
|
815
962
|
return /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsxs(EventCalendarChrome, {
|
|
816
963
|
display,
|
|
817
964
|
calendarView,
|
|
818
|
-
|
|
965
|
+
loadState,
|
|
819
966
|
filters: filtersNode,
|
|
820
967
|
headerTitle: viewport.title,
|
|
821
|
-
|
|
968
|
+
onRetry: retryCurrentView,
|
|
822
969
|
onNext: goToNext,
|
|
823
970
|
onPrevious: goToPrevious,
|
|
824
971
|
onToday: goToToday,
|
|
@@ -826,7 +973,9 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
826
973
|
days: viewport.days,
|
|
827
974
|
events,
|
|
828
975
|
emptyMessage: display.emptyMessage,
|
|
829
|
-
showCapacity: display.showCapacity
|
|
976
|
+
showCapacity: display.showCapacity,
|
|
977
|
+
calendarTimeZone: hydration.calendarContext.timeZone,
|
|
978
|
+
today: hydration.calendarContext.initialToday
|
|
830
979
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
831
980
|
className: "event-calendar-container",
|
|
832
981
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -842,11 +991,12 @@ const EventCalendarGridClient = ({ render }) => {
|
|
|
842
991
|
return /* @__PURE__ */ jsx(CalendarDayCell, {
|
|
843
992
|
date,
|
|
844
993
|
events: eventsByDate.get(dateKey) || [],
|
|
845
|
-
isCurrentMonth: date.
|
|
994
|
+
isCurrentMonth: date.month === viewDate.month,
|
|
995
|
+
today: hydration.calendarContext.initialToday
|
|
846
996
|
}, dateKey);
|
|
847
997
|
})
|
|
848
998
|
})]
|
|
849
|
-
}), viewport.kind === "month" && events.length === 0 &&
|
|
999
|
+
}), viewport.kind === "month" && events.length === 0 && loadState.kind === "idle" ? /* @__PURE__ */ jsx("p", {
|
|
850
1000
|
className: "event-calendar-empty",
|
|
851
1001
|
children: display.emptyMessage
|
|
852
1002
|
}) : null]
|
|
@@ -918,7 +1068,7 @@ function buildDisplayFilterParams(display) {
|
|
|
918
1068
|
filterVenueId: display.filterVenueId
|
|
919
1069
|
});
|
|
920
1070
|
}
|
|
921
|
-
const EventCalendarChrome = ({ children, display, calendarView, className,
|
|
1071
|
+
const EventCalendarChrome = ({ children, display, calendarView, className, loadState, filters, headerTitle, onRetry, onNext, onPrevious, onToday }) => /* @__PURE__ */ jsxs("div", {
|
|
922
1072
|
className: [
|
|
923
1073
|
"event-calendar",
|
|
924
1074
|
className,
|
|
@@ -937,11 +1087,11 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
937
1087
|
onClick: onPrevious,
|
|
938
1088
|
className: "event-calendar-nav-btn",
|
|
939
1089
|
"aria-label": calendarView === "week" ? "Previous week" : "Previous month",
|
|
940
|
-
children: /* @__PURE__ */ jsx(
|
|
1090
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
|
|
941
1091
|
}),
|
|
942
1092
|
/* @__PURE__ */ jsxs("h3", {
|
|
943
1093
|
className: "event-calendar-title",
|
|
944
|
-
children: [headerTitle, loading ? /* @__PURE__ */ jsx("span", {
|
|
1094
|
+
children: [headerTitle, loadState.kind === "loading" ? /* @__PURE__ */ jsx("span", {
|
|
945
1095
|
className: "rb-ml-2 rb-caption status-muted",
|
|
946
1096
|
children: "(loading...)"
|
|
947
1097
|
}) : null]
|
|
@@ -951,7 +1101,7 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
951
1101
|
onClick: onNext,
|
|
952
1102
|
className: "event-calendar-nav-btn",
|
|
953
1103
|
"aria-label": calendarView === "week" ? "Next week" : "Next month",
|
|
954
|
-
children: /* @__PURE__ */ jsx(
|
|
1104
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
|
|
955
1105
|
})
|
|
956
1106
|
]
|
|
957
1107
|
}), /* @__PURE__ */ jsx("button", {
|
|
@@ -965,14 +1115,14 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
965
1115
|
})]
|
|
966
1116
|
}),
|
|
967
1117
|
children,
|
|
968
|
-
error ? /* @__PURE__ */ jsxs("div", {
|
|
1118
|
+
loadState.kind === "error" ? /* @__PURE__ */ jsxs("div", {
|
|
969
1119
|
className: "rb-mt-4 rb-text-center",
|
|
970
1120
|
children: [/* @__PURE__ */ jsx("p", {
|
|
971
1121
|
className: "status-error rb-caption rb-mb-2",
|
|
972
1122
|
children: "Failed to load events"
|
|
973
1123
|
}), /* @__PURE__ */ jsx("button", {
|
|
974
1124
|
type: "button",
|
|
975
|
-
onClick:
|
|
1125
|
+
onClick: onRetry,
|
|
976
1126
|
className: themeButtonClassName({
|
|
977
1127
|
variant: display.buttonVariant,
|
|
978
1128
|
size: "sm"
|
|
@@ -982,21 +1132,6 @@ const EventCalendarChrome = ({ children, display, calendarView, className, error
|
|
|
982
1132
|
}) : null
|
|
983
1133
|
]
|
|
984
1134
|
});
|
|
985
|
-
function CalendarChevron({ direction }) {
|
|
986
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
987
|
-
width: "20",
|
|
988
|
-
height: "20",
|
|
989
|
-
fill: "none",
|
|
990
|
-
stroke: "currentColor",
|
|
991
|
-
strokeWidth: 2,
|
|
992
|
-
viewBox: "0 0 24 24",
|
|
993
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
994
|
-
strokeLinecap: "round",
|
|
995
|
-
strokeLinejoin: "round",
|
|
996
|
-
d: direction === "previous" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
|
|
997
|
-
})
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
1135
|
//#endregion
|
|
1001
1136
|
//#region src/rendering/islands/enhancers/eventCalendar.tsx
|
|
1002
1137
|
const decode = defineIslandPropsDecoder("event-calendar");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { n as EventCombinedIslandClient } from "./EventCombined.client-
|
|
3
|
-
import { t as BlockApiProvider } from "./context-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-pYvx_Srl.mjs";
|
|
2
|
+
import { n as EventCombinedIslandClient } from "./EventCombined.client-CwJOxn7A.mjs";
|
|
3
|
+
import { t as BlockApiProvider } from "./context-DCkiHVdD.mjs";
|
|
4
4
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
5
5
|
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
|
|
6
6
|
import "react";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as toScheduledBookingDateTime, G as resolveWholeSeriesPricingState, Kt as formatCurrencyAmount, O as resolveEventRegistrationScopedEvents, Pt as getBookingLocalDateKey, Rt as toBookingTimeZone, U as formatWholeSeriesPriceAmount, Ut as publicEventPricingType, V as resolveRuntimeEventPricing, Vt as publicEventPricingCurrency, W as formatWholeSeriesPriceDisplay, t as defineIslandPropsDecoder, z as formatEventPrice } from "./propsDecoder-pYvx_Srl.mjs";
|
|
2
|
+
import { o as formatTotalCapacity } from "./capacity-BW00PO7s.mjs";
|
|
3
|
+
import { l as resolveEventLinkProps, r as formatEventDateParts } from "./dates-2RPXHQy4.mjs";
|
|
2
4
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
3
|
-
import { t as LeafletStaticMap } from "./LeafletStaticMap-
|
|
5
|
+
import { t as LeafletStaticMap } from "./LeafletStaticMap-IKenna5u.mjs";
|
|
4
6
|
import "react";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
//#region ../blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.ts
|
|
@@ -130,7 +132,8 @@ function isOrdinaryEvent(event) {
|
|
|
130
132
|
function deriveWholeSeriesPhase(sessions, nowIso) {
|
|
131
133
|
const now = Date.parse(nowIso);
|
|
132
134
|
if (now < Date.parse(sessions[0].startsAt)) return "upcoming";
|
|
133
|
-
|
|
135
|
+
const finalSession = sessions[sessions.length - 1] ?? sessions[0];
|
|
136
|
+
return now <= Date.parse(finalSession.endsAt) ? "inProgress" : "completed";
|
|
134
137
|
}
|
|
135
138
|
function selectRelatedDates(input) {
|
|
136
139
|
if (!input.seriesId) return [];
|
|
@@ -405,7 +408,7 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
405
408
|
children: [/* @__PURE__ */ jsx("div", {
|
|
406
409
|
className: "rb-label rb-mb-2",
|
|
407
410
|
children: "Places"
|
|
408
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ jsx("p", { children: formatTotalCapacity(selected.capacity) })]
|
|
409
412
|
}) : null,
|
|
410
413
|
pricing,
|
|
411
414
|
selected.bookingScope === "whole_series" ? /* @__PURE__ */ jsxs("div", {
|