@riverbankcms/sdk 0.174.0 → 0.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-GqVX3I8E.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
- package/dist/_dts/{Page-BhUH31M-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DBn2x0UL.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
- package/dist/_dts/{client-Cr-sOeSl.d.ts → client-B6tCvmG4.d.ts} +487 -11
- package/dist/_dts/{content-types-DKw1yJdN.d.ts → content-types-B9qryk4R.d.ts} +2 -2
- package/dist/_dts/{contracts-CJ2O03nB.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DoGHHKr_.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-CJGu4hoa.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
- package/dist/_dts/{index--39uLjrr.d.ts → index-Bl5_pjmq.d.ts} +1 -1
- package/dist/_dts/{index-DQZ5L0Gb.d.ts → index-Btp5nIoz.d.ts} +2 -2
- package/dist/_dts/{index-Bq-488M7.d.ts → index-CQUzwOxO.d.ts} +1 -1
- package/dist/_dts/{index-DYlfdT1O.d.ts → index-DmhFb6R1.d.ts} +1 -1
- package/dist/_dts/{index-3GzargmS.d.ts → index-OtazQE3U.d.ts} +2 -2
- package/dist/_dts/{index-DYsP4k6S.d.ts → index-YRQulWB4.d.ts} +3 -3
- package/dist/_dts/{index-DdEi2iXd.d.ts → index-_pXaCO12.d.ts} +4 -4
- package/dist/_dts/{loadContent-BVPagYmy.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
- package/dist/_dts/{request-Be1E-H-V.d.ts → request-BT8i_vH-.d.ts} +2070 -503
- package/dist/_dts/{resolveBlockData-D1pL25bD.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-B4sbTf96.d.ts → resolvePageContent-CVLYWcoI.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +2 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +13 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +3 -2
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +2 -1
- package/dist/_dts/{types-Bm5_3VEd.d.ts → types-C0XZnjXz.d.ts} +3 -3
- package/dist/_dts/{types-5MeDI1w8.d.ts → types-CXL1QJSY.d.ts} +7 -7
- package/dist/_dts/{types-CVoCc_Ia.d.ts → types-OKzbqRBx.d.ts} +2 -2
- package/dist/_dts/{validation-lEtYD-Rh.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DkflFLGQ.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CAyoiAGD.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C7yiJrxm.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-BPQU5Snc.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
- package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
- package/dist/client/{EventCalendar.client-BiWQc28-.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
- package/dist/client/{EventCombined.client-B_ytWQtn.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
- package/dist/client/{EventItem-C-mxXpX_.mjs → EventItem-BybMSKNL.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-Bm3Ap1Rd.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
- package/dist/client/{EventListing.client-Bs_8im5_.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
- package/dist/client/{EventListing.view-CN7BjGgC.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
- package/dist/client/{EventRegistrationPayment-DPkRcSdw.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +664 -362
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-BecH-qhI.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BJzmFdcn.mjs} +18 -3
- package/dist/client/{Page--xJ23nA5.mjs → Page-CWN_8cLZ.mjs} +736 -1667
- package/dist/client/{DemoBookingPortalAccess-BnEgvJas.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
- package/dist/client/{StepIndicator-D391QRNc.mjs → StepIndicator-C7RJBOW3.mjs} +37 -249
- package/dist/client/{accordion-BQtTkDN8.mjs → accordion-uUi_N6mZ.mjs} +1 -1
- package/dist/client/{booking-form.client-D9M7TKGV.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
- package/dist/client/{bookingForm-BsOS0sl9.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CNDLpT06.mjs → boxStyleClassNames-C-gFwhnO.mjs} +3 -29
- package/dist/client/{carousel-CPsW-FPh.mjs → carousel-C0_BqMA0.mjs} +1 -1
- package/dist/client/{cart-CwElmocm.mjs → cart-BOHuppVu.mjs} +3 -3
- package/dist/client/{cart.client-RpqI56w8.mjs → cart.client-IfJE1zAp.mjs} +1 -1
- package/dist/client/{checkout-CfMgqY8H.mjs → checkout-C3Aj-aNa.mjs} +3 -3
- package/dist/client/{checkout.client-BpuPyOuJ.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
- package/dist/client/{checkoutUrls-VeHY6WYj.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
- package/dist/client/client.mjs +113 -21
- package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
- package/dist/client/{course-q1sA4Cj-.mjs → course-DHmeQAvq.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-ABCZWkpT.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-BdcuW_pa.mjs} +1 -1
- package/dist/client/display-DMqotaGU.mjs +11797 -0
- package/dist/client/{enhanceHeaderSection-BzjY6AiY.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
- package/dist/client/{event-details.client-CseTWUFC.mjs → event-details.client-CJapNbTv.mjs} +1 -1
- package/dist/client/{event-registration.client-b5TLxntR.mjs → event-registration.client-CAdcpnLc.mjs} +295 -188
- package/dist/client/{eventCalendar-C-kJNIc9.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
- package/dist/client/{eventCombined-BgHJGhwE.mjs → eventCombined-B9Ly3024.mjs} +4 -4
- package/dist/client/{eventDetails-CAwbreD0.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
- package/dist/client/{eventListing-_14atrj8.mjs → eventListing-ZSmvhWII.mjs} +4 -4
- package/dist/client/{eventRegistration-BOqSdstJ.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
- package/dist/client/{form-DfAB-llc.mjs → form-DG_YZSNn.mjs} +3 -3
- package/dist/client/{form.client-DN-I9_qC.mjs → form.client-BU6dM0-C.mjs} +4 -4
- package/dist/client/{form.parts-t2Q1neM6.mjs → form.parts-Db0Iq7nx.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-DFfWHpQB.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-DMrsN4B4.mjs +28 -0
- package/dist/client/gifting.client-BVa2XYJB.mjs +404 -0
- package/dist/client/gifting.parts-C2u4Y-pf.mjs +86 -0
- package/dist/client/{headerSection-Dces54pb.mjs → headerSection-D91EzlOR.mjs} +2 -2
- package/dist/client/{display-D8MW2b0e.mjs → lookSurfaces-BDZLALxj.mjs} +3084 -12938
- package/dist/client/{newsletter-form.client-D_YFUlR2.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-URO5Mn_I.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
- package/dist/client/{newsletterForm-_c9fKIzS.mjs → newsletterForm-B_67sNwa.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-DF8_EiFt.mjs} +93 -28
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CVW1UIxJ.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
- package/dist/client/{product-list.client-CF9hO23G.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
- package/dist/client/{productDetail-C_qbmUuP.mjs → productDetail-W0_0lDGe.mjs} +3 -3
- package/dist/client/{productList-Df5qDD0z.mjs → productList-ayAtPJdb.mjs} +3 -3
- package/dist/client/{propsDecoder-BiEyK2ii.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
- package/dist/client/{registry.server-ClcfWpvM.mjs → registry.server-B1EEZkcr.mjs} +311 -262
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +7 -7
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DAypPzSo.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
- package/dist/client/{shop-gteEpeO5.mjs → shop-DbUUoHFJ.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-DidgH7ow.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-Bw4_BXQg.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
- package/dist/client/{shop-commerce-store-Da6Ah-_4.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
- package/dist/client/{shop.client-CbbdjWWd.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
- package/dist/client/{shop.interactive-CKFORzux.mjs → shop.interactive-CJAINJr3.mjs} +118 -39
- package/dist/client/{shopShared-C7QjoywZ.mjs → shopShared-DwVAuGsx.mjs} +2 -2
- package/dist/client/{timetableModel-CtZiIj9q.mjs → timetableModel-DBTIFWTb.mjs} +11 -148
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-BuLgof7O.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
- package/dist/client/{useEventPagination-B4VPtSEF.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
- package/dist/client/{view-CvlTplao.mjs → view-BTk470k0.mjs} +3 -2
- package/dist/client/{view-CxUpgcM6.mjs → view-Cw4EmEPv.mjs} +100 -32
- package/dist/preview-next/client/{PageSectionToolbar-BFbSrDbi.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-BtpzqQ-i.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +32 -29
- package/dist/preview-next/client/{PreviewEditorUI-z22h-CCY.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-BW3Qpoa_.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BvVeK1hR.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
- package/dist/preview-next/client/{previewAssistantSlot-BUqAh1FL.mjs → previewAssistantSlot-B61mZd81.mjs} +4981 -3275
- package/dist/preview-next/client/{previewChromeRoot-NCy5zHO8.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CxmKDVGZ.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-B_UaDyJO.mjs → siteStyleAccess-BZDIC-fA.mjs} +529 -238
- package/dist/preview-next/client/{useAutosaveStatus-BqmWvPLY.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LAllV0rU.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +25 -5
- package/dist/preview-next/container-responsive.css +51 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DV6SeCNv.mjs → route-contract-0gSlK9S0.mjs} +87 -12
- package/dist/server/{Block.shared-Ch2FKAvU.mjs → Block.shared-DeXXycg8.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFvjDVzi.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-CQg2lzZn.mjs → bindings-7L3pC5Os.mjs} +13 -34
- package/dist/server/{client-aYRTVneD.mjs → client-CgghATBm.mjs} +112 -20
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-Cgpfr44e.mjs → loadContent-D7M5Vcug.mjs} +5 -5
- package/dist/server/{loadPage-RDk10NMP.mjs → loadPage-CiTId05y.mjs} +2 -2
- package/dist/server/{lookMediaFrame-CQtkvlDn.mjs → lookMediaFrame-CaH018pK.mjs} +129 -12
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-VhhN94d8.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-CkFTsxkd.mjs → pageRenderPlan-Cuos4Xcd.mjs} +105 -357
- package/dist/server/{pageRuntimeSupport-CpAtzNxD.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
- package/dist/server/{pageShared-B8yLPjs0.mjs → pageShared-JxlV8_Bo.mjs} +1707 -1811
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-DOu6QceG.mjs → prebuild-BDhlJbAx.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CfOXFKYG.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
- package/dist/server/{registry-34rkAfaU.mjs → registry-cQ9N5W-n.mjs} +21091 -20209
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +3 -3
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-D7VeoWgr.mjs → resolveBlockData-CN4UmmTK.mjs} +1 -1
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-CLVKoJrX.mjs → validation-3puM5SM8.mjs} +3 -3
- package/dist/server/{version-HVfdvBJ0.mjs → version-B8g-Wx57.mjs} +1 -1
- package/dist/styles/index.css +361 -57
- package/package.json +1 -1
- package/dist/client/bookability-CE637yDE.mjs +0 -17
- package/dist/client/useDiscountApply-BZU5DWZQ.mjs +0 -199
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Dt as parseThemeColorToken, Et as parseColorTokenParts, G as hexToRgb, R as contrastRatio, a as formatButtonColourContractError, at as surfaceForegroundValue, c as DEFAULT_BUTTON_SIZES, ct as surfaceInkStyle, d as generateShadowValue$1, et as SURFACE_INK_CSS_VARS, f as DEFAULT_VARIANT_ALIAS_ID, ft as cssVarValue, g as createStandardButtonSurfacePolicy, gt as textColorValue, h as buttonSizeNameSchema, ht as textColorStyle, i as BUTTON_CONTRAST_POLICY, j as expandPalette, mt as rgbColorValue, n as compileButtonColourStates, nt as surfaceForegroundDeclarations, pt as mergeStyles, r as resolveSolidButtonColour, rt as surfaceForegroundInputFromResolved, s as BORDER_WIDTH_MAP, st as surfaceInkDeclarations, u as FONT_SIZE_MAP, ut as backgroundColorStyle, v as unsafeAsOpaqueButtonColourToken } from "./resolveButtonColourStates--6yJp9Tq.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { $ as RichText, $
|
|
2
|
+
import { $ as formatEventDuration, A as deriveEventScheduleSummary, B as MapPinIcon, C as EventHeader, D as OfferingCourseCards, E as EventListingFrameView, F as CardListCollection, G as buildMonthDay, H as eventDisplayTitleText, I as CardListItems, J as selectQuickDateEvents, K as resolveMonthSelectedDay, L as EventItem, M as createEditorPresentationPageReader, N as createPresentationPageReader, O as eventCardListContent, P as EmptyState, Q as formatEventLocation, R as eventCategoryBadge, S as lookPartShown, T as MonthLookView, U as formatCourseDatesAfter, V as eventDisplayTitle, W as formatCourseSessions, X as eventOnlinePlace, Y as formatEventTeacherLine, Z as eventVenuePlace, _ as publicAppointmentPricingSchema, a as joinSlotKey, b as resolvePageRouteTarget, c as buildLinkedContentEditTarget, ct as defaultThemeTokens, et as resolveEventCardBooking, f as defaultTransforms, g as publicAppointmentLocationSchema, h as formatAppointmentPrice, i as composePageJoins, j as derivePreviewRunSchedule, k as offeringDatesBySeries, m as formatAppointmentLocation, n as createPageRenderPlanReader, nt as resolveEventLinkProps, o as renderedJoinLayout, p as formatAppointmentDuration, q as formatEventQuickDate, rt as parseStoredVariant, s as retargetJoinsAcrossOmissions, st as buildThemeTokens, tt as resolveEventCta, u as resolveLinkedEntryInlineFieldEligibility, w as EVENT_REGISTRATION_ANCHOR_ID, x as resolveRouteTarget, y as resolveEntryRouteTarget, z as CalendarIcon } from "./pageRenderPlan-Cuos4Xcd.mjs";
|
|
3
|
+
import { $ as RichText, $a as generateEffectsCSS, $o as publicEventsArraySchema, $r as boxStyleClassNames, $t as formatEventCompactDateRail, A as publicRouteCandidatesSchema, Aa as arrangementManifestFromVariants, Ai as FileAudioIcon, Ao as bindingSchema, Ar as formatEventPrice, At as offeringsListingFor, B as buildEventCollectionHydration, Br as faqHeadingFragment, Bt as SpinnerNode, C as buildProductListInteractiveIslandProps, Ci as resolveBlockIconRenderValue, Cn as planOrdinarySeriesSelection, Cs as sameMailingListPlacementTargeting, D as membershipClassesLabel, Di as CirclePlusIcon, Dn as resolveSelectionBookingClosedDetail, Ds as normalizeLocationAddressText, Dt as groupOfferingRunsByCourse, E as membershipCardListContent, Ei as CircleMinusIcon, En as planWholeSeriesRunSelection, Et as buildOfferingsPreviewListing, F as buildEventCalendarListingDisplay, Fi as inlineTextToPlainText, Fn as isEventFull, Ft as ThemedAuthoredButton, G as catalogueEventCardProps, Gi as isRecord$4, Go as formatDateKey, Gr as testimonialsCarouselFragment, Gs as toUtcIsoDateTimeString, H as eventCollectionDisplaySchemaShape, Ha as requireCuratedSiteStyle, Hi as PUBLIC_DOWNLOAD_MEDIA_TYPES, Hn as composeHeaderSectionWrapperClassName, Ho as getLocalDateKey, Hr as singleButtonFragment, Hs as parseLocalScheduleTime, Ht as eventListWeekDays, Ii as isInlineTextEmpty, In as groupPublicEventsByRun, Ir as richTextFragment, Is as formatBookingCompactEnglishTime, It as ThemedButton, Ja as resolveCardRole, Ji as eventReadinessLoaderKey, Jn as teamMemberCardBiography, Jo as getWeekCalendarDayTuple, Jr as heroCtaRowFragment, Js as isPublicEventPricingOptionDisplayable, Jt as eventDateOptions, K as listingEventCardProps, Ki as chosenString, Kn as parseTeamMemberSpecialties, Ko as getDayOfWeek, Kr as testimonialsHeadingFragment, Kt as buildCalendarViewport, L as eventListingBlockDefinition, Li as parseInlineTextFromUnknown, Ln as FEATURE_CARD_ICON_TREATMENTS, Lr as headingFragment, Ls as toScheduledBookingDateTime, Lt as ThemedButtonLink, M as offeringsCatalogueShape, Ma as resolveEffectiveArrangement, Mi as FileTextIcon, Mn as formatTotalCapacity, Ms as formatDate$1, Mt as resolveOfferingsPreviewGroupCta, N as eventCalendarBlockDefinition, Ni as MinusIcon, Nt as resolveOfferingsPreviewGroups, O as passCardListContent, Oi as ClockIcon, On as selectionRepresentativeEvent, Or as formatCoursePrice, Ot as normalizeOfferingsPreviewItemLimit, P as buildEventCalendarInteractiveIslandProps, Pi as PlusIcon, Pn as getEventAvailabilityStatus, Pt as resolveOfferingsRenderInput, Q as MediaNodeServer, Qa as generateNavLinkCSS, Qs as resolveExactOrFreePriceDisplay, Qt as formatEventClockLabel, R as buildEventListingInteractiveIslandProps, Rn as resolveFeatureCardGeneratedIconSizePx, Rr as cardFragment, Rt as ThemedDownloadLink, S as buildProductDetailInteractiveIslandProps, Sa as arrangementLookHooks, Si as parseBlockIconValue, Sn as planDropInPanel, Ss as parseMailingListPlacementTargeting, T as shopProductPresentation, Ti as ChevronDownIcon, Tn as planWholeSeriesParentSelection, Ts as decideLocationSourcePermission, Tt as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, U as eventCollectionHydrationSchema, Un as markEditableSurfaceForwarding, Uo as getLocalMinuteOfDay, Ur as formEmbedFragment, Us as resolveBookingBusinessTimeZone, Ut as eventWeekGroupingContext, V as buildEventCollectionListingDisplay, Vi as parseFieldDefinitions, Vr as blogFeaturedPostFragment, Vt as buildEventListWeek, W as eventCollectionSourceSchemaShape, Wi as isObjectRecord, Wn as splitPositioningClasses, Wo as addDays, Wr as formCopyFragment, Ws as toBookingTimeZone, Xa as generateFooterCss, Xn as resolveDateRuntimeContext, Xo as isSameCalendarDay, Xr as isBlockButtonRole, Xs as publicEventPricingDisplay, Xt as formatCalendarTitle, Y as cardListPresentationSchemaShape, Ya as generateDefaultCardSystem, Yn as readRuntimeNow, Yo as getWeekCalendarDays, Yr as ctaRowFragment, Ys as publicEventPricingCurrency, Za as buildTextContrastShadow, Zi as eventReadinessResultSchema, Zo as isToday, Zr as heroCopyFragment, Zs as publicEventPricingType, Zt as formatDate, _ as productDetailBlockDefinition, _n as cancelledDateCopy, _r as resolvedItemSurfaceProps, _s as orderedLiveRunSessions, _t as resolveEventRegistrationEventSource, a as normalizeLocationMapProps, ar as formBlockDefinition, b as buildCartInteractiveIslandProps, ba as headerRootPaint, bi as when, bn as getPublicEventCanonicalPath, br as clsx, bs as parseMailingListRuntimeContext, bt as normalizeEventRegistrationPageSurfaceSubject, c as newsletterSignupBlockDefinition, ca as AFFORDANCE_SUPPRESS_CLASS, ci as ctaButton, cn as resolveEventTimeZone, cr as createInteractiveIslandCodec, cs as admitReadinessFacts, d as buildNewsletterFormInteractiveIslandProps, di as defineFragment, dn as bookingPresentation, do as boundaryRuntimeMetricsForDecorativeTransition, dr as defineClientOwnedBlockRuntime, ds as pageTemplateFromEntry, dt as setContextResolveImageUrlContext, ec as formatCurrencyAmount, ei as normalizeBoxStylesBorder, en as formatEventDateParts, eo as resolveEffectApplications, es as blockBookingPaymentTermsSchema, et as ImagePresets, f as newsletterBlockSubmissionMessage, fa as selectItemSurfacePresentation, fn as browserReadAuthoritySchema, fr as defineProgressiveBlockRuntime, fs as unavailableReadinessFact, ft as EventQuickFacts, g as cartBlockDefinition, ga as readOpeningToneProjection, gn as bookingPageKindSchema, gr as lookListPresentationSchemaShape, gt as buildEventRegistrationInteractiveIslandProps, h as checkoutBlockDefinition, ha as effectiveHeaderNavLinkStyle, hn as closedRunCopy, hr as listLookSlot, hs as CANCELLED_SESSION_STATUS, ht as eventRegistrationBlockDefinition, in as formatEventTimeRange, is as sanitizeHref, j as buildOfferingsCatalogueListing, ji as FileSpreadsheetIcon, jn as formatEventRemainingPlaces, jr as formatEventPriceAmount, js as mapDrawingSchema, jt as readOfferingsGrouping, k as offeringsPreviewBlockDefinition, ki as FileArchiveIcon, kn as isBookableEvent, kr as formatEventDepositNote, kt as offeringRunLifecycle, la as resolveHeaderRootForeground, ln as resolveRuntimeEventDestination, lr as defineInteractiveIslandMetaKeys, ls as hiddenFromVisitors, lt as buildResolveImageUrlContext, m as buildGiftingInteractiveIslandProps, ma as authoredHeaderLinkForeground, mn as pageNavigationSchema, mr as listLookControl, mt as getContainerClass, nn as formatEventNextDateFact, no as generateInteractiveChildInheritanceCSS, ns as bookingConsentCarrierSchema, o as normalizeLocationMapSource, oa as parseThemeButtonVariantId, oc as TokenResolver, on as formatTime, or as buildFormInteractiveIslandProps, ot as resolvePublicMediaUrl, p as giftingBlockDefinition, pn as blockSiteTermsSchema, pr as listItemPresentation, pt as getCardOrientation, q as CardListContentPart, qn as teamMemberBiography, qo as getOrderedDayNames, qr as ctaCopyFragment, qs as formatBookingPriceDisplay, r as normalizeBlockContent, rs as beforeBookingQuestionsPresentationSchema, s as resolveLocationMapLocation, sa as themeButtonSelector, si as resolveBackgroundColorValue, sn as groupEventsByDate, sr as buildInteractiveIslandProps, t as getBlockDefinition, ti as resolveCardRoleForBoxStyles, tn as formatEventHourLabel, to as resolveEffectPaint, tr as staticHeaderChromeRuntime, ts as blockBookingConsentSchema, tt as MediaPlaceholder, u as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, ui as bodyCopyFragment, ur as createZodCodec, us as loadedReadinessFact, ut as getCurrentResolveImageUrlContext, v as productListBlockDefinition, va as headerNeedsPhotoShade, vi as runTransforms, vn as hasCancelledRegistrationDate, vo as anglePolygonCss, vr as itemRole, vs as resolveWholeSeriesBookingPhase, vt as bookingNowSchema, w as buildShopInteractiveIslandProps, wi as ArrowDownIcon, wn as planWholeSeriesParentBooking, x as buildCheckoutInteractiveIslandProps, xi as buildGeneratedBlockIconRenderAssetLookupFromUnknown, xn as isOrdinaryPublicEvent, xt as resolveEventRegistrationScopedEvents, y as shopBlockDefinition, ya as headerRootIsTransparent, yi as el, yn as eventOccurrenceContext, yo as transitionCatalogueEntries, yr as Grid, ys as buildMailingListSignupBlockSourceRef, yt as previewStageSchema, z as buildEventCollectionDisplay, zn as shouldReserveFeatureCardIconZone, zr as faqAccordionFragment, zs as getBookingLocalDateKey, zt as getIconComponent } from "./registry-cQ9N5W-n.mjs";
|
|
4
4
|
import { B as HOVER_TEXT_THRESHOLD, C as materializeRuntimeButtonAppearance, F as resolveSurfaceForeground, G as resolveConcreteColorHex, H as contrastThresholdByPolicy, K as resolveOpaqueSurfaceHex, L as surfaceInkPublication, N as freezeOwnedThemeValue, O as mapButtonVisualAppearances, P as ownedThemeSnapshot, S as buttonTypographyDeclarations, U as inkReference, V as certifyPaint, b as buttonShadow, f as compositeHex, g as actionVariableFallback, n as parseSurfaceTree, o as resolveSurface, s as serializeSurfaceTree, v as buttonBorder, w as paddingDeclarations, x as buttonStateAppearanceDeclarations, y as buttonRadius } from "./accessibleSurfaces-CM3QANtw.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { b as siteChromeBackgroundOverrideOwner, m as surfaceCardRoleValues, s as boxBackgroundSchema } from "./schema-BpsqaSSU.mjs";
|
|
6
6
|
import { l as renderableMediaAssetSchema, o as runtimeMediaSchema } from "./media-luf7RF22.mjs";
|
|
7
7
|
import { t as assertNever$1 } from "./assert-never-ku-PUn9U.mjs";
|
|
8
|
-
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-
|
|
8
|
+
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-CuVj3bkd.mjs";
|
|
9
9
|
import { n as RichTextDocSchema } from "./richTextSchema-QLaQrbII.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { c as
|
|
13
|
-
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-
|
|
10
|
+
import { M as opaqueSurfaceDeclarations, T as testimonialsCompositionTreatmentValues, j as opaqueSurfaceContextFromTheme, v as featureCardCompositionTreatmentValues, x as offeringsPreviewCompositionTreatmentValues, y as introCompositionTreatmentValues } from "./lookMediaFrame-CaH018pK.mjs";
|
|
11
|
+
import { c as mergeHeaderNavTypographyPreference, l as readHeaderNavFontSizePreference } from "./bindings-7L3pC5Os.mjs";
|
|
12
|
+
import { A as generateShadowCssVars, C as INPUT_ERROR_BORDER_COLOR_VAR, D as RESOLVED_BUTTON_DISABLED_DECLARATIONS, E as generateOpaquePanelCss, M as cardBorderDeclarations, N as cardDecorationPseudoRules, O as resolvedButtonColourDeclarations, S as INPUT_EDGE_COLOR_VAR, T as generateCheckableCss, _ as getResponsiveScopeSpec, a as prefixSelector, b as INPUT_GROUP_SELECTOR, c as parseCustomCssRules, d as THEME_RADIUS_CSS_VARS, f as generateTypographyCss, g as THEME_RESPONSIVE_CONTAINER_NAME, h as DEFAULT_THEME_RESPONSIVE_MODE, i as escapeStyleContent, j as renderCssDeclarations, k as resolvedButtonFocusDeclarations, l as generateAllBlockVarsCss, m as generateStatusCss, n as compileBlockCustomCssRules, o as toKebabCase, p as generateProgressCss, r as compileCustomCssRules, s as parseBlockCustomCssRules, t as ThemeScopeCore, u as generateBlockCustomVarsCss, v as INPUT_GROUP_ERROR_SELECTOR, w as inputEdgeColorValue, x as generateInputGroupCss, y as INPUT_GROUP_FOCUS_SELECTOR } from "./ThemeScopeCore-DFEM1a85.mjs";
|
|
13
|
+
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-DOsfofCy.mjs";
|
|
14
14
|
import { n as mapOutlineBlocks } from "./pageRegions-BaeEF2MU.mjs";
|
|
15
15
|
import { t as getAtPath } from "./src-DHK4JUlp.mjs";
|
|
16
16
|
import * as React$1 from "react";
|
|
@@ -159,225 +159,320 @@ function formatOpeningHoursRows(hours, options = {}) {
|
|
|
159
159
|
}, []);
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region ../
|
|
163
|
-
/**
|
|
164
|
-
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
165
|
-
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
166
|
-
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
167
|
-
*/
|
|
168
|
-
const CORNER_RADIUS_MAP = {
|
|
169
|
-
square: "0px",
|
|
170
|
-
soft: "8px",
|
|
171
|
-
rounded: "16px",
|
|
172
|
-
pill: "24px"
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* Gradient direction to CSS direction map
|
|
176
|
-
*/
|
|
177
|
-
const GRADIENT_DIRECTION_MAP = {
|
|
178
|
-
"to-r": "to right",
|
|
179
|
-
"to-l": "to left",
|
|
180
|
-
"to-t": "to top",
|
|
181
|
-
"to-b": "to bottom",
|
|
182
|
-
"to-tr": "to top right",
|
|
183
|
-
"to-tl": "to top left",
|
|
184
|
-
"to-br": "to bottom right",
|
|
185
|
-
"to-bl": "to bottom left"
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Generate CSS box-shadow value from Shadow object
|
|
189
|
-
*/
|
|
190
|
-
function generateShadowValue(shadow) {
|
|
191
|
-
if (shadow.elevation === "none") return "none";
|
|
192
|
-
const offset = {
|
|
193
|
-
low: 2,
|
|
194
|
-
medium: 4,
|
|
195
|
-
high: 6
|
|
196
|
-
}[shadow.elevation];
|
|
197
|
-
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
198
|
-
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
199
|
-
const soft = shadow.softness !== "crisp";
|
|
200
|
-
switch (shadow.elevation) {
|
|
201
|
-
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
202
|
-
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
203
|
-
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
208
|
-
const PER_CORNER_RADIUS_MAP = {
|
|
209
|
-
square: "0",
|
|
210
|
-
soft: "0.5rem",
|
|
211
|
-
rounded: "1rem",
|
|
212
|
-
pill: "1.5rem",
|
|
213
|
-
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
214
|
-
};
|
|
215
|
-
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
216
|
-
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
217
|
-
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
218
|
-
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
219
|
-
}
|
|
220
|
-
function generateCardCss(options) {
|
|
221
|
-
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
222
|
-
const theme = {
|
|
223
|
-
...options.theme,
|
|
224
|
-
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
225
|
-
};
|
|
226
|
-
const tokens = new TokenResolver(theme);
|
|
227
|
-
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
228
|
-
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
229
|
-
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
230
|
-
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
231
|
-
const cssChunks = [];
|
|
232
|
-
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
233
|
-
for (const variant of cardSystem.variants) {
|
|
234
|
-
if (!variant.enabled) continue;
|
|
235
|
-
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
236
|
-
emittedGroupKeys.add(groupKey);
|
|
237
|
-
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
238
|
-
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
239
|
-
}
|
|
240
|
-
for (const [groupKey, group] of aliasGroups) {
|
|
241
|
-
if (emittedGroupKeys.has(groupKey)) continue;
|
|
242
|
-
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
243
|
-
}
|
|
244
|
-
return cssChunks.filter(Boolean).join("\n\n");
|
|
245
|
-
}
|
|
246
|
-
function roleAliasGroupKey(source, variantId) {
|
|
247
|
-
return `${source}:${variantId}`;
|
|
248
|
-
}
|
|
162
|
+
//#region ../calendar/src/lane-packing.ts
|
|
249
163
|
/**
|
|
250
|
-
*
|
|
251
|
-
* through the fallback chain so compiled content can address a role without
|
|
252
|
-
* knowing which variant id a site style used — or whether it defined one.
|
|
164
|
+
* Assign lanes to a list of intervals.
|
|
253
165
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
166
|
+
* Returns one result per input in the same order as the input. Internally
|
|
167
|
+
* sorts a copy by `(start, end, orderKey)` to ensure determinism, then
|
|
168
|
+
* permutes results back to input order.
|
|
256
169
|
*/
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
170
|
+
function assignLanes(intervals) {
|
|
171
|
+
if (intervals.length === 0) return [];
|
|
172
|
+
const indexed = intervals.map((interval, index) => ({
|
|
173
|
+
interval,
|
|
174
|
+
index
|
|
175
|
+
}));
|
|
176
|
+
indexed.sort((left, right) => left.interval.start - right.interval.start || left.interval.end - right.interval.end || left.interval.orderKey.localeCompare(right.interval.orderKey));
|
|
177
|
+
const results = new Array(intervals.length);
|
|
178
|
+
let cluster = [];
|
|
179
|
+
let activeLaneEnds = [];
|
|
180
|
+
let clusterMaxEnd = -Infinity;
|
|
181
|
+
const closeCluster = () => {
|
|
182
|
+
if (cluster.length === 0) return;
|
|
183
|
+
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
184
|
+
for (const entry of cluster) results[entry.index] = {
|
|
185
|
+
laneIndex: entry.laneIndex,
|
|
186
|
+
laneCount
|
|
187
|
+
};
|
|
188
|
+
cluster = [];
|
|
189
|
+
activeLaneEnds = [];
|
|
190
|
+
clusterMaxEnd = -Infinity;
|
|
191
|
+
};
|
|
192
|
+
for (const { interval, index } of indexed) {
|
|
193
|
+
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
194
|
+
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
195
|
+
activeLaneEnds[laneIndex] = interval.end;
|
|
196
|
+
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
197
|
+
cluster.push({
|
|
198
|
+
index,
|
|
199
|
+
laneIndex
|
|
269
200
|
});
|
|
270
201
|
}
|
|
271
|
-
|
|
202
|
+
closeCluster();
|
|
203
|
+
return results;
|
|
272
204
|
}
|
|
205
|
+
function firstAvailableLane(activeLaneEnds, start) {
|
|
206
|
+
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
207
|
+
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region ../calendar/src/timetable.ts
|
|
273
211
|
/**
|
|
274
|
-
*
|
|
275
|
-
*/
|
|
276
|
-
const CONTENT_PADDING_MAP = {
|
|
277
|
-
none: "0",
|
|
278
|
-
compact: "0.75rem",
|
|
279
|
-
cozy: "1rem",
|
|
280
|
-
medium: "1.25rem",
|
|
281
|
-
comfortable: "1.5rem",
|
|
282
|
-
spacious: "2rem"
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Corner radius map for card media (top corners only). Match card surface
|
|
286
|
-
* radii rather than button pills so media does not become capsule-clipped.
|
|
287
|
-
*/
|
|
288
|
-
const MEDIA_CORNER_MAP = {
|
|
289
|
-
square: "0",
|
|
290
|
-
soft: "0.5rem",
|
|
291
|
-
rounded: "1rem",
|
|
292
|
-
pill: "1.5rem"
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Generate CSS for a single card variant
|
|
212
|
+
* Timetable model — the package's core surface.
|
|
296
213
|
*
|
|
297
|
-
*
|
|
298
|
-
* -
|
|
299
|
-
*
|
|
300
|
-
* - .card-content: padding based on spacing
|
|
214
|
+
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
215
|
+
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
216
|
+
* plus a diagnostics list for items dropped during processing.
|
|
301
217
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
218
|
+
* The function is pure: given identical input (including `now`), it returns
|
|
219
|
+
* the same output. The model has no opinion on what an item is — pass
|
|
220
|
+
* accessors.
|
|
304
221
|
*/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
222
|
+
const DEFAULT_BOUNDS = {
|
|
223
|
+
minStartHour: 5,
|
|
224
|
+
maxEndHour: 23,
|
|
225
|
+
defaultStartHour: 6,
|
|
226
|
+
defaultEndHour: 21,
|
|
227
|
+
minHeightPercent: 2.5,
|
|
228
|
+
marginMinutes: 0
|
|
229
|
+
};
|
|
230
|
+
function buildTimetableModel$1(input) {
|
|
231
|
+
const bounds = resolveBounds(input.bounds);
|
|
232
|
+
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
233
|
+
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
234
|
+
const parsed = parseAllItems(input.items, input);
|
|
235
|
+
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
236
|
+
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
237
|
+
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
238
|
+
return {
|
|
239
|
+
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
240
|
+
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
241
|
+
startHour: hourRange.startHour,
|
|
242
|
+
endHour: hourRange.endHour,
|
|
243
|
+
rangeMinutes: (hourRange.endHour - hourRange.startHour) * 60,
|
|
244
|
+
hasItems: inViewport.length > 0,
|
|
245
|
+
diagnostics: [...parsed.diagnostics, ...laid.diagnostics]
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function parseAllItems(items, accessors) {
|
|
249
|
+
const drafts = [];
|
|
250
|
+
const diagnostics = [];
|
|
251
|
+
for (const item of items) {
|
|
252
|
+
const result = parseDraft(item, accessors);
|
|
253
|
+
if (result.ok) drafts.push(result.draft);
|
|
254
|
+
else diagnostics.push({
|
|
255
|
+
item,
|
|
256
|
+
reason: result.reason
|
|
257
|
+
});
|
|
323
258
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return [
|
|
329
|
-
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
330
|
-
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
331
|
-
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
332
|
-
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
333
|
-
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
334
|
-
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
335
|
-
].join("\n\n");
|
|
259
|
+
return {
|
|
260
|
+
drafts,
|
|
261
|
+
diagnostics
|
|
262
|
+
};
|
|
336
263
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
264
|
+
function layoutCellsByDate(segments, hourRange, bounds) {
|
|
265
|
+
const rangeMinutes = (hourRange.endHour - hourRange.startHour) * 60;
|
|
266
|
+
const rangeStartMinutes = hourRange.startHour * 60;
|
|
267
|
+
const rangeEndMinutes = hourRange.endHour * 60;
|
|
268
|
+
const segmentsByDate = groupSegmentsByDate(segments);
|
|
269
|
+
const cellsByDate = /* @__PURE__ */ new Map();
|
|
270
|
+
const diagnostics = [];
|
|
271
|
+
for (const [dateKey, daySegments] of segmentsByDate) {
|
|
272
|
+
const clipped = [];
|
|
273
|
+
for (const segment of daySegments) {
|
|
274
|
+
const result = clipDraft(segment, rangeStartMinutes, rangeEndMinutes);
|
|
275
|
+
if (result.ok) clipped.push(result.clipped);
|
|
276
|
+
else diagnostics.push({
|
|
277
|
+
item: segment.draft.item,
|
|
278
|
+
reason: result.reason
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
282
|
+
start: entry.visibleStart,
|
|
283
|
+
end: entry.visibleEnd,
|
|
284
|
+
orderKey: entry.segment.draft.orderKey
|
|
285
|
+
})));
|
|
286
|
+
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
287
|
+
laneIndex: 0,
|
|
288
|
+
laneCount: 1
|
|
289
|
+
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
cellsByDate,
|
|
293
|
+
diagnostics
|
|
294
|
+
};
|
|
349
295
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
case "gradient": return {
|
|
359
|
-
kind: "gradient",
|
|
360
|
-
foregroundToken: variant.foregroundToken
|
|
296
|
+
function assembleDays(viewportDays, cellsByDate, today) {
|
|
297
|
+
return viewportDays.map((date) => {
|
|
298
|
+
const dateKey = formatDateKey(date);
|
|
299
|
+
return {
|
|
300
|
+
date,
|
|
301
|
+
dateKey,
|
|
302
|
+
isToday: isSameCalendarDay(date, today),
|
|
303
|
+
cells: cellsByDate.get(dateKey) ?? []
|
|
361
304
|
};
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function parseDraft(item, accessors) {
|
|
308
|
+
const startsAtIso = accessors.getStartsAt(item);
|
|
309
|
+
const endsAtIso = accessors.getEndsAt(item);
|
|
310
|
+
const timeZone = accessors.getTimeZone(item);
|
|
311
|
+
const startsAtMinutes = getLocalMinuteOfDay(startsAtIso, timeZone);
|
|
312
|
+
if (Number.isNaN(startsAtMinutes)) return {
|
|
313
|
+
ok: false,
|
|
314
|
+
reason: "invalid-start"
|
|
315
|
+
};
|
|
316
|
+
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
317
|
+
if (startDateKey == null) return {
|
|
318
|
+
ok: false,
|
|
319
|
+
reason: "invalid-timezone"
|
|
320
|
+
};
|
|
321
|
+
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
322
|
+
if (endDateKey == null) return {
|
|
323
|
+
ok: false,
|
|
324
|
+
reason: "invalid-end"
|
|
325
|
+
};
|
|
326
|
+
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
327
|
+
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
328
|
+
ok: false,
|
|
329
|
+
reason: "invalid-end"
|
|
330
|
+
};
|
|
331
|
+
const spansMultipleDays = startDateKey < endDateKey;
|
|
332
|
+
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
333
|
+
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
334
|
+
ok: false,
|
|
335
|
+
reason: "non-positive-duration"
|
|
336
|
+
};
|
|
337
|
+
return {
|
|
338
|
+
ok: true,
|
|
339
|
+
draft: {
|
|
340
|
+
item,
|
|
341
|
+
startDateKey,
|
|
342
|
+
endDateKey,
|
|
343
|
+
startsAtMinutes,
|
|
344
|
+
endsAtMinutes,
|
|
345
|
+
color: accessors.getColor?.(item) ?? null,
|
|
346
|
+
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function deriveVisibleSegments(drafts, viewportKeys) {
|
|
351
|
+
const segments = [];
|
|
352
|
+
for (const draft of drafts) for (const dateKey of enumerateDateKeys(draft.startDateKey, draft.endDateKey)) {
|
|
353
|
+
if (!viewportKeys.has(dateKey)) continue;
|
|
354
|
+
const isStartDay = dateKey === draft.startDateKey;
|
|
355
|
+
const isEndDay = dateKey === draft.endDateKey;
|
|
356
|
+
const startsAtMinutes = isStartDay ? draft.startsAtMinutes : 0;
|
|
357
|
+
const endsAtMinutes = isEndDay ? draft.endsAtMinutes : 1440;
|
|
358
|
+
if (endsAtMinutes <= startsAtMinutes) continue;
|
|
359
|
+
segments.push({
|
|
360
|
+
draft,
|
|
361
|
+
dateKey,
|
|
362
|
+
startsAtMinutes,
|
|
363
|
+
endsAtMinutes,
|
|
364
|
+
continuesBefore: !isStartDay,
|
|
365
|
+
continuesAfter: !isEndDay
|
|
366
|
+
});
|
|
362
367
|
}
|
|
368
|
+
return segments;
|
|
363
369
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
370
|
+
function clipDraft(segment, rangeStartMinutes, rangeEndMinutes) {
|
|
371
|
+
const visibleStart = Math.max(rangeStartMinutes, segment.startsAtMinutes);
|
|
372
|
+
const visibleEnd = Math.min(rangeEndMinutes, segment.endsAtMinutes);
|
|
373
|
+
if (visibleEnd <= visibleStart) return {
|
|
374
|
+
ok: false,
|
|
375
|
+
reason: "out-of-visible-hours"
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
ok: true,
|
|
379
|
+
clipped: {
|
|
380
|
+
segment,
|
|
381
|
+
visibleStart,
|
|
382
|
+
visibleEnd
|
|
383
|
+
}
|
|
384
|
+
};
|
|
369
385
|
}
|
|
370
|
-
function
|
|
371
|
-
const
|
|
372
|
-
|
|
386
|
+
function buildCell(entry, lane, rangeStartMinutes, rangeMinutes, minHeightPercent) {
|
|
387
|
+
const heightPercent = Math.max(minHeightPercent, toRangePercent(entry.visibleEnd - entry.visibleStart, rangeMinutes));
|
|
388
|
+
const rawTopPercent = toRangePercent(entry.visibleStart - rangeStartMinutes, rangeMinutes);
|
|
389
|
+
const topPercent = Math.min(rawTopPercent, 100 - heightPercent);
|
|
390
|
+
return {
|
|
391
|
+
item: entry.segment.draft.item,
|
|
392
|
+
dateKey: entry.segment.dateKey,
|
|
393
|
+
startsAtMinutes: entry.segment.startsAtMinutes,
|
|
394
|
+
endsAtMinutes: entry.segment.endsAtMinutes,
|
|
395
|
+
visibleStartsAtMinutes: entry.visibleStart,
|
|
396
|
+
visibleEndsAtMinutes: entry.visibleEnd,
|
|
397
|
+
topPercent,
|
|
398
|
+
heightPercent,
|
|
399
|
+
isClippedStart: entry.segment.continuesBefore || entry.segment.startsAtMinutes < entry.visibleStart,
|
|
400
|
+
isClippedEnd: entry.segment.continuesAfter || entry.segment.endsAtMinutes > entry.visibleEnd,
|
|
401
|
+
laneIndex: lane.laneIndex,
|
|
402
|
+
laneCount: lane.laneCount,
|
|
403
|
+
color: entry.segment.draft.color
|
|
404
|
+
};
|
|
373
405
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
406
|
+
function resolveBounds(bounds) {
|
|
407
|
+
return {
|
|
408
|
+
...DEFAULT_BOUNDS,
|
|
409
|
+
...bounds
|
|
410
|
+
};
|
|
376
411
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
412
|
+
function resolveHourRange(segments, bounds) {
|
|
413
|
+
if (segments.length === 0) return {
|
|
414
|
+
startHour: bounds.defaultStartHour,
|
|
415
|
+
endHour: bounds.defaultEndHour
|
|
416
|
+
};
|
|
417
|
+
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
418
|
+
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
419
|
+
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
420
|
+
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
421
|
+
return {
|
|
422
|
+
startHour,
|
|
423
|
+
endHour: Math.max(startHour + 1, endHour)
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function fixedHourRange(hours) {
|
|
427
|
+
const startHour = Math.min(23, Math.max(0, Math.floor(hours.startHour)));
|
|
428
|
+
return {
|
|
429
|
+
startHour,
|
|
430
|
+
endHour: Math.min(24, Math.max(startHour + 1, Math.ceil(hours.endHour)))
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function buildHourTicks(startHour, endHour) {
|
|
434
|
+
const ticks = [];
|
|
435
|
+
for (let hour = startHour; hour <= endHour; hour += 1) ticks.push(hour);
|
|
436
|
+
return ticks;
|
|
437
|
+
}
|
|
438
|
+
function groupSegmentsByDate(segments) {
|
|
439
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
440
|
+
for (const segment of segments) {
|
|
441
|
+
const existing = grouped.get(segment.dateKey) ?? [];
|
|
442
|
+
existing.push(segment);
|
|
443
|
+
grouped.set(segment.dateKey, existing);
|
|
444
|
+
}
|
|
445
|
+
return grouped;
|
|
446
|
+
}
|
|
447
|
+
function toRangePercent(minutes, rangeMinutes) {
|
|
448
|
+
if (rangeMinutes <= 0) return 0;
|
|
449
|
+
return minutes / rangeMinutes * 100;
|
|
450
|
+
}
|
|
451
|
+
function getTimetableDays(viewDate, view, startOfWeek) {
|
|
452
|
+
if (view === "day") return [viewDate];
|
|
453
|
+
return getWeekCalendarDays(viewDate, startOfWeek);
|
|
454
|
+
}
|
|
455
|
+
function enumerateDateKeys(startDateKey, endDateKey) {
|
|
456
|
+
if (startDateKey > endDateKey) throw new Error(`Invalid timetable date range: ${startDateKey} is after ${endDateKey}`);
|
|
457
|
+
const start = parseDateKey(startDateKey);
|
|
458
|
+
parseDateKey(endDateKey);
|
|
459
|
+
const keys = [];
|
|
460
|
+
let cursor = start;
|
|
461
|
+
while (formatDateKey(cursor) <= endDateKey) {
|
|
462
|
+
keys.push(formatDateKey(cursor));
|
|
463
|
+
cursor = addDays(cursor, 1);
|
|
464
|
+
}
|
|
465
|
+
return keys;
|
|
466
|
+
}
|
|
467
|
+
function parseDateKey(dateKey) {
|
|
468
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
469
|
+
if (match === null) throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
470
|
+
const [, year, month, day] = match;
|
|
471
|
+
return {
|
|
472
|
+
year: Number(year),
|
|
473
|
+
month: Number(month),
|
|
474
|
+
day: Number(day)
|
|
475
|
+
};
|
|
381
476
|
}
|
|
382
477
|
//#endregion
|
|
383
478
|
//#region ../theme-core/src/styles/skinTokens.ts
|
|
@@ -385,21 +480,242 @@ function skinTokenCssVars(tokens) {
|
|
|
385
480
|
return Object.fromEntries(Object.entries(tokens ?? {}).map(([name, value]) => [`--rb-skin-${name}`, value]));
|
|
386
481
|
}
|
|
387
482
|
//#endregion
|
|
388
|
-
//#region ../theme-core/src/
|
|
483
|
+
//#region ../theme-core/src/cards/constants.ts
|
|
389
484
|
/**
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* visual language (spacing, borders, shadows, colors).
|
|
485
|
+
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
486
|
+
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
487
|
+
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
394
488
|
*/
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
489
|
+
const CORNER_RADIUS_MAP = {
|
|
490
|
+
square: "0px",
|
|
491
|
+
soft: "8px",
|
|
492
|
+
rounded: "16px",
|
|
493
|
+
pill: "24px"
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Gradient direction to CSS direction map
|
|
497
|
+
*/
|
|
498
|
+
const GRADIENT_DIRECTION_MAP = {
|
|
499
|
+
"to-r": "to right",
|
|
500
|
+
"to-l": "to left",
|
|
501
|
+
"to-t": "to top",
|
|
502
|
+
"to-b": "to bottom",
|
|
503
|
+
"to-tr": "to top right",
|
|
504
|
+
"to-tl": "to top left",
|
|
505
|
+
"to-br": "to bottom right",
|
|
506
|
+
"to-bl": "to bottom left"
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Generate CSS box-shadow value from Shadow object
|
|
510
|
+
*/
|
|
511
|
+
function generateShadowValue(shadow) {
|
|
512
|
+
if (shadow.elevation === "none") return "none";
|
|
513
|
+
const offset = {
|
|
514
|
+
low: 2,
|
|
515
|
+
medium: 4,
|
|
516
|
+
high: 6
|
|
517
|
+
}[shadow.elevation];
|
|
518
|
+
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
519
|
+
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
520
|
+
const soft = shadow.softness !== "crisp";
|
|
521
|
+
switch (shadow.elevation) {
|
|
522
|
+
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
523
|
+
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
524
|
+
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
529
|
+
const PER_CORNER_RADIUS_MAP = {
|
|
530
|
+
square: "0",
|
|
531
|
+
soft: "0.5rem",
|
|
532
|
+
rounded: "1rem",
|
|
533
|
+
pill: "1.5rem",
|
|
534
|
+
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
535
|
+
};
|
|
536
|
+
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
537
|
+
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
538
|
+
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
539
|
+
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
540
|
+
}
|
|
541
|
+
function generateCardCss(options) {
|
|
542
|
+
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
543
|
+
const theme = {
|
|
544
|
+
...options.theme,
|
|
545
|
+
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
546
|
+
};
|
|
547
|
+
const tokens = new TokenResolver(theme);
|
|
548
|
+
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
549
|
+
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
550
|
+
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
551
|
+
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
552
|
+
const cssChunks = [];
|
|
553
|
+
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
554
|
+
for (const variant of cardSystem.variants) {
|
|
555
|
+
if (!variant.enabled) continue;
|
|
556
|
+
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
557
|
+
emittedGroupKeys.add(groupKey);
|
|
558
|
+
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
559
|
+
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
560
|
+
}
|
|
561
|
+
for (const [groupKey, group] of aliasGroups) {
|
|
562
|
+
if (emittedGroupKeys.has(groupKey)) continue;
|
|
563
|
+
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
564
|
+
}
|
|
565
|
+
return cssChunks.filter(Boolean).join("\n\n");
|
|
566
|
+
}
|
|
567
|
+
function roleAliasGroupKey(source, variantId) {
|
|
568
|
+
return `${source}:${variantId}`;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Stable per-theme role aliases (`.card-role-default` and friends), resolved
|
|
572
|
+
* through the fallback chain so compiled content can address a role without
|
|
573
|
+
* knowing which variant id a site style used — or whether it defined one.
|
|
574
|
+
*
|
|
575
|
+
* Aliases are grouped by the variant they resolve to, so an alias shares one
|
|
576
|
+
* rule with that variant rather than duplicating its declarations.
|
|
577
|
+
*/
|
|
578
|
+
function resolveRoleAliasGroups(theme, cardSystem) {
|
|
579
|
+
const groups = /* @__PURE__ */ new Map();
|
|
580
|
+
for (const role of surfaceCardRoleValues) {
|
|
581
|
+
const resolved = resolveCardRole(theme, cardSystem, role);
|
|
582
|
+
if (resolved.kind === "none") continue;
|
|
583
|
+
const groupKey = roleAliasGroupKey(resolved.source, resolved.variant.id);
|
|
584
|
+
const aliasClass = `card-role-${role}`;
|
|
585
|
+
const group = groups.get(groupKey);
|
|
586
|
+
if (group) group.classes.push(aliasClass);
|
|
587
|
+
else groups.set(groupKey, {
|
|
588
|
+
variant: resolved.variant,
|
|
589
|
+
classes: [aliasClass]
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
return groups;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Padding map for card content based on spacing semantic values
|
|
596
|
+
*/
|
|
597
|
+
const CONTENT_PADDING_MAP = {
|
|
598
|
+
none: "0",
|
|
599
|
+
compact: "0.75rem",
|
|
600
|
+
cozy: "1rem",
|
|
601
|
+
medium: "1.25rem",
|
|
602
|
+
comfortable: "1.5rem",
|
|
603
|
+
spacious: "2rem"
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* Corner radius map for card media (top corners only). Match card surface
|
|
607
|
+
* radii rather than button pills so media does not become capsule-clipped.
|
|
608
|
+
*/
|
|
609
|
+
const MEDIA_CORNER_MAP = {
|
|
610
|
+
square: "0",
|
|
611
|
+
soft: "0.5rem",
|
|
612
|
+
rounded: "1rem",
|
|
613
|
+
pill: "1.5rem"
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Generate CSS for a single card variant
|
|
617
|
+
*
|
|
618
|
+
* Generates complete CSS for card containers and their children:
|
|
619
|
+
* - Container: background, shadow, corners, border
|
|
620
|
+
* - .card-media: top corners matching container
|
|
621
|
+
* - .card-content: padding based on spacing
|
|
622
|
+
*
|
|
623
|
+
* This CSS-first approach eliminates runtime transforms for styling,
|
|
624
|
+
* keeping transforms only for data normalization and dynamic layout.
|
|
625
|
+
*/
|
|
626
|
+
function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palette, solvedInks) {
|
|
627
|
+
const selectorsFor = (suffix) => cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}${suffix}`).join(",\n");
|
|
628
|
+
const containerSelectors = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}`);
|
|
629
|
+
const containerSelector = containerSelectors.join(",\n");
|
|
630
|
+
const mediaSelector = selectorsFor(" .card-media");
|
|
631
|
+
const contentSelector = selectorsFor(" .card-content");
|
|
632
|
+
const fallbackBackgroundSelector = selectorsFor(" > .rb-bg-surface");
|
|
633
|
+
const rules = [];
|
|
634
|
+
rules.push(...cardSurfaceRules(variant, tokens, theme, palette, solvedInks));
|
|
635
|
+
const resolveColor = (token) => tokens.getColor(token);
|
|
636
|
+
rules.push(...cardBorderDeclarations(variant.border ? borderDeclaration(variant.border, tokens) : null, variant.decorations, resolveColor));
|
|
637
|
+
const corners = variant.corners ?? theme.corners;
|
|
638
|
+
const radius = variant.cornerRadii ? resolveCornerRadiiCss(variant.cornerRadii, corners) : CORNER_RADIUS_MAP[corners];
|
|
639
|
+
rules.push(`border-radius: ${radius}`);
|
|
640
|
+
const shadow = variant.shadow ?? theme.shadow;
|
|
641
|
+
if (shadow.elevation !== "none") {
|
|
642
|
+
const shadowValue = generateShadowValue(shadow);
|
|
643
|
+
rules.push(`box-shadow: ${shadowValue}`);
|
|
644
|
+
}
|
|
645
|
+
const structureSelector = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) :where(.${cardClass})`).join(",\n");
|
|
646
|
+
const mediaRadius = MEDIA_CORNER_MAP[corners];
|
|
647
|
+
const mediaRules = [`border-top-left-radius: ${mediaRadius}`, `border-top-right-radius: ${mediaRadius}`];
|
|
648
|
+
const contentRules = [`padding: ${resolveContentPadding(variant)}`];
|
|
649
|
+
return [
|
|
650
|
+
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
651
|
+
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
652
|
+
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
653
|
+
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
654
|
+
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
655
|
+
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
656
|
+
].join("\n\n");
|
|
657
|
+
}
|
|
658
|
+
function cardSurfaceRules(variant, tokens, theme, palette, solvedInks) {
|
|
659
|
+
if (variant.background.type === "transparent") return ["background: transparent"];
|
|
660
|
+
const surface = resolveSurface({
|
|
661
|
+
kind: "paint",
|
|
662
|
+
paint: cardSurfacePaint(variant)
|
|
663
|
+
}, {
|
|
664
|
+
palette,
|
|
665
|
+
buttonSystem: theme.buttons,
|
|
666
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken,
|
|
667
|
+
solvedInks
|
|
668
|
+
});
|
|
669
|
+
return [cardBackgroundRule(variant.background, tokens), ...opaqueSurfaceDeclarations(surface)];
|
|
670
|
+
}
|
|
671
|
+
function cardSurfacePaint(variant) {
|
|
672
|
+
switch (variant.background.type) {
|
|
673
|
+
case "transparent": return { kind: "transparent" };
|
|
674
|
+
case "solid": return {
|
|
675
|
+
kind: "solid",
|
|
676
|
+
token: variant.background.colorToken,
|
|
677
|
+
foregroundToken: variant.foregroundToken
|
|
678
|
+
};
|
|
679
|
+
case "gradient": return {
|
|
680
|
+
kind: "gradient",
|
|
681
|
+
foregroundToken: variant.foregroundToken
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function cardBackgroundRule(background, tokens) {
|
|
686
|
+
if (background.type === "solid") return `background: ${tokens.getColor(background.colorToken)}`;
|
|
687
|
+
const from = tokens.getColor(background.fromToken);
|
|
688
|
+
const to = tokens.getColor(background.toToken);
|
|
689
|
+
return `background: linear-gradient(${GRADIENT_DIRECTION_MAP[background.direction] || "to right"}, ${from}, ${to})`;
|
|
690
|
+
}
|
|
691
|
+
function borderDeclaration(border, tokens) {
|
|
692
|
+
const borderColor = tokens.getColor(border.colorToken);
|
|
693
|
+
return `border: ${border.widthClass === "border-4" ? "4px" : border.widthClass === "border-2" ? "2px" : border.widthClass === "border" ? "1px" : "1px"} solid ${borderColor}`;
|
|
694
|
+
}
|
|
695
|
+
function paddingFor(spacing) {
|
|
696
|
+
return CONTENT_PADDING_MAP[spacing] || CONTENT_PADDING_MAP.comfortable;
|
|
697
|
+
}
|
|
698
|
+
/** A card's padding: one value for both axes, or one per axis. */
|
|
699
|
+
function resolveContentPadding(variant) {
|
|
700
|
+
const spacing = variant.spacing;
|
|
701
|
+
return typeof spacing === "string" ? paddingFor(spacing) : `${paddingFor(spacing.block)} ${paddingFor(spacing.inline)}`;
|
|
702
|
+
}
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region ../theme-core/src/accordions/defaults.ts
|
|
705
|
+
/**
|
|
706
|
+
* Generate default accordion system based on theme configuration
|
|
707
|
+
*
|
|
708
|
+
* Creates a single accordion style that harmonizes with the theme's
|
|
709
|
+
* visual language (spacing, borders, shadows, colors).
|
|
710
|
+
*/
|
|
711
|
+
function generateDefaultAccordionSystem(theme) {
|
|
712
|
+
const overrides = theme.siteStyleId ? requireCuratedSiteStyle(theme.siteStyleId).themeOverrides?.accordions : void 0;
|
|
713
|
+
if (overrides) return overrides;
|
|
714
|
+
const { axes, space } = theme;
|
|
715
|
+
return {
|
|
716
|
+
background: {
|
|
717
|
+
type: "solid",
|
|
718
|
+
colorToken: "surface"
|
|
403
719
|
},
|
|
404
720
|
spacing: space === "comfortable" ? "comfortable" : space === "dense" ? "compact" : "medium",
|
|
405
721
|
corners: null,
|
|
@@ -2194,77 +2510,26 @@ const NAV_RENDERED_STATES = [
|
|
|
2194
2510
|
function isNavHover(state) {
|
|
2195
2511
|
return state === "hover" || state === "current-hover";
|
|
2196
2512
|
}
|
|
2197
|
-
|
|
2198
|
-
return state === "current" || state === "current-hover";
|
|
2199
|
-
}
|
|
2200
|
-
/** Mirrors the historical emitters: every group writes a base gradient and hover opacity;
|
|
2201
|
-
* active groups additionally write the more specific current-page selector. */
|
|
2513
|
+
/** Project the emitted declarations into the four disjoint nav states. */
|
|
2202
2514
|
function resolveRenderedNavEffects(effects, state) {
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
"
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
})));
|
|
2212
|
-
const opacity = winner(
|
|
2515
|
+
const current = state === "current" || state === "current-hover";
|
|
2516
|
+
const declarations = resolveEffectApplications(effects).flatMap((application) => {
|
|
2517
|
+
if (application.currentPage && !current) return [];
|
|
2518
|
+
return resolveEffectPaint(application.effect, { background: { type: "transparent" } }).filter((paint) => paint.when === "always" || isNavHover(state)).map((paint) => ({
|
|
2519
|
+
paint,
|
|
2520
|
+
specificity: 1 + Number(application.currentPage) + Number(paint.when === "hover")
|
|
2521
|
+
}));
|
|
2522
|
+
});
|
|
2523
|
+
const text = winner(declarations.filter(({ paint }) => paint.property === "text"));
|
|
2524
|
+
const opacity = winner(declarations.filter(({ paint }) => paint.property === "opacity"));
|
|
2213
2525
|
return {
|
|
2214
|
-
text:
|
|
2215
|
-
opacity: opacity
|
|
2216
|
-
};
|
|
2217
|
-
}
|
|
2218
|
-
function authoredOpacity(effect) {
|
|
2219
|
-
const options = effect.options ?? {};
|
|
2220
|
-
const opacity = effect.effectId === "fade-background" ? Number(options.opacity || 80) / 100 : 1 - Number(options.reduction || 15) / 100;
|
|
2221
|
-
return Number.isFinite(opacity) && opacity >= 0 && opacity <= 1 ? opacity : null;
|
|
2222
|
-
}
|
|
2223
|
-
function textCandidates(app, state) {
|
|
2224
|
-
const gradient = {
|
|
2225
|
-
effect: app.effect,
|
|
2226
|
-
fill: "gradient"
|
|
2227
|
-
};
|
|
2228
|
-
const solid = {
|
|
2229
|
-
effect: app.effect,
|
|
2230
|
-
fill: "solid"
|
|
2231
|
-
};
|
|
2232
|
-
const solidOnHover = app.effect.options?.solidOnHover === true || app.effect.options?.solidOnHover === "true";
|
|
2233
|
-
const hover = isNavHover(state) && solidOnHover ? [{
|
|
2234
|
-
value: solid,
|
|
2235
|
-
specificity: 2
|
|
2236
|
-
}] : [];
|
|
2237
|
-
const currentHover = isNavHover(state) && solidOnHover ? [{
|
|
2238
|
-
value: solid,
|
|
2239
|
-
specificity: 3
|
|
2240
|
-
}] : [];
|
|
2241
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2242
|
-
value: gradient,
|
|
2243
|
-
specificity: 2
|
|
2244
|
-
}, ...currentHover] : [];
|
|
2245
|
-
return [
|
|
2246
|
-
{
|
|
2247
|
-
value: gradient,
|
|
2248
|
-
specificity: 1
|
|
2249
|
-
},
|
|
2250
|
-
...hover,
|
|
2251
|
-
...current
|
|
2252
|
-
];
|
|
2253
|
-
}
|
|
2254
|
-
function opacityCandidates(app, state) {
|
|
2255
|
-
if (!isNavHover(state)) return [];
|
|
2256
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2257
|
-
value: app.effect,
|
|
2258
|
-
specificity: 3
|
|
2259
|
-
}] : [];
|
|
2260
|
-
return [{
|
|
2261
|
-
value: app.effect,
|
|
2262
|
-
specificity: 2
|
|
2263
|
-
}, ...current];
|
|
2526
|
+
text: text?.property === "text" ? text : null,
|
|
2527
|
+
opacity: opacity?.property === "opacity" && Number.isFinite(opacity.opacity) && opacity.opacity >= 0 && opacity.opacity <= 1 ? opacity.opacity : null
|
|
2528
|
+
};
|
|
2264
2529
|
}
|
|
2265
2530
|
/** Later declarations win equal specificity, just as they do in the emitted CSS. */
|
|
2266
2531
|
function winner(candidates) {
|
|
2267
|
-
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.
|
|
2532
|
+
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.paint ?? null;
|
|
2268
2533
|
}
|
|
2269
2534
|
//#endregion
|
|
2270
2535
|
//#region ../theme-core/src/header/navEffectPaint.ts
|
|
@@ -2328,7 +2593,7 @@ function planText(text, plainInk, state, context) {
|
|
|
2328
2593
|
rules: [],
|
|
2329
2594
|
inks: [plainInk]
|
|
2330
2595
|
};
|
|
2331
|
-
const stops =
|
|
2596
|
+
const stops = text.tokens.map((token) => resolveConcreteColorHex(token, context.palette));
|
|
2332
2597
|
if (decideNavEffectContrast(context.paint, plainInk, {
|
|
2333
2598
|
effect: "gradient-text",
|
|
2334
2599
|
option: stops,
|
|
@@ -2350,15 +2615,6 @@ function planText(text, plainInk, state, context) {
|
|
|
2350
2615
|
} : null)
|
|
2351
2616
|
};
|
|
2352
2617
|
}
|
|
2353
|
-
function renderedTextStops(text, palette) {
|
|
2354
|
-
if (text.fill === "solid") return [resolveConcreteColorHex("neutral-50", palette)];
|
|
2355
|
-
const colors = text.effect.options?.gradientColors;
|
|
2356
|
-
return (typeof colors === "string" && colors ? colors.split(",").map((token) => token.trim()) : [
|
|
2357
|
-
"primary-400",
|
|
2358
|
-
"secondary-400",
|
|
2359
|
-
"accent-400"
|
|
2360
|
-
]).map((token) => resolveConcreteColorHex(token, palette));
|
|
2361
|
-
}
|
|
2362
2618
|
function opacityRules(authored, inks, paint) {
|
|
2363
2619
|
if (authored === null || inks.length === 0 || inks.some((ink) => ink === null)) return [];
|
|
2364
2620
|
const decisions = inks.map((ink) => decideNavEffectContrast(paint, ink, {
|
|
@@ -2389,25 +2645,30 @@ function resolveInk(reference, palette) {
|
|
|
2389
2645
|
//#endregion
|
|
2390
2646
|
//#region ../theme-core/src/header/generateHeaderNavLinkStyles.ts
|
|
2391
2647
|
function generateHeaderNavLinkStyles(header, themeId, tokens, theme, contrastTreatment, navTextSize) {
|
|
2392
|
-
const style =
|
|
2648
|
+
const style = resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2393
2649
|
if (!style) {
|
|
2394
2650
|
console.warn(`[generateHeaderCss] Nav link preset not found: ${header.navStyle}`);
|
|
2395
2651
|
return "";
|
|
2396
2652
|
}
|
|
2397
|
-
const renderedStyle = mergeHeaderNavTypographyPreference(style, {
|
|
2398
|
-
typography: header.navFontRole ?? "inherit",
|
|
2399
|
-
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2400
|
-
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2401
|
-
});
|
|
2402
2653
|
return generateNavLinkCSS({
|
|
2403
2654
|
themeId,
|
|
2404
2655
|
tokens,
|
|
2405
2656
|
theme,
|
|
2406
|
-
style
|
|
2657
|
+
style,
|
|
2407
2658
|
className: "header-nav-link",
|
|
2408
2659
|
surfaceDependent: true,
|
|
2409
2660
|
surfaceRestingColor: header.background?.contentOwner === siteChromeBackgroundOverrideOwner
|
|
2410
|
-
}) + generateHeaderNavEffectContrastCss(header,
|
|
2661
|
+
}) + generateHeaderNavEffectContrastCss(header, style, theme, themeId);
|
|
2662
|
+
}
|
|
2663
|
+
/** The top-level nav link style as it renders, with the owner's font role and size preferences applied. */
|
|
2664
|
+
function resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize) {
|
|
2665
|
+
const style = effectiveHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2666
|
+
if (!style) return null;
|
|
2667
|
+
return mergeHeaderNavTypographyPreference(style, {
|
|
2668
|
+
typography: header.navFontRole ?? "inherit",
|
|
2669
|
+
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2670
|
+
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2671
|
+
});
|
|
2411
2672
|
}
|
|
2412
2673
|
//#endregion
|
|
2413
2674
|
//#region ../theme-core/src/header/generateHeaderLogoStyles.ts
|
|
@@ -2479,7 +2740,8 @@ function generateHeaderCss(options) {
|
|
|
2479
2740
|
cssChunks.push(generateHeaderNavLinkStyles(header, themeId, tokens, theme, headerContrastTreatment, headerNavTextSize));
|
|
2480
2741
|
const dropdown = resolveDropdownSurface(header, theme, tokens, solvedInks);
|
|
2481
2742
|
cssChunks.push(generateDropdownContainerStyles(themeId, tokens, dropdown));
|
|
2482
|
-
|
|
2743
|
+
const navLinkStyle = resolvedHeaderNavLinkStyle(header, headerContrastTreatment, headerNavTextSize);
|
|
2744
|
+
cssChunks.push(generateDropdownLinkStyles(header, themeId, tokens, theme, dropdown, navLinkStyle));
|
|
2483
2745
|
cssChunks.push(generateDropdownCaretStyles(themeId));
|
|
2484
2746
|
cssChunks.push(generateDropdownTriggerOverrides(header, themeId));
|
|
2485
2747
|
cssChunks.push(generateMobilePanelStyles(themeId, dropdown));
|
|
@@ -2608,16 +2870,37 @@ function dropdownLinkEffects({ linkFill, linkText }, state) {
|
|
|
2608
2870
|
options: { hoverColorToken: text }
|
|
2609
2871
|
}] : []];
|
|
2610
2872
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2873
|
+
/**
|
|
2874
|
+
* The type the menu takes from the nav links above it: font, case and letter spacing follow the nav,
|
|
2875
|
+
* unless the header Look gives the menu its own case or spacing.
|
|
2876
|
+
*/
|
|
2877
|
+
function dropdownTypeFromNav(style, navLinkStyle) {
|
|
2878
|
+
const nav = navLinkStyle ?? {
|
|
2616
2879
|
typography: "body",
|
|
2617
|
-
|
|
2618
|
-
|
|
2880
|
+
textTransform: "none",
|
|
2881
|
+
letterSpacing: void 0
|
|
2882
|
+
};
|
|
2883
|
+
const ownCase = dropdownOwnCase(style);
|
|
2884
|
+
const followsNavSpacing = (style?.letterSpacing ?? "normal") === "normal";
|
|
2885
|
+
return {
|
|
2886
|
+
typography: nav.typography,
|
|
2887
|
+
textTransform: ownCase ?? nav.textTransform ?? "none",
|
|
2888
|
+
...followsNavSpacing && nav.letterSpacing ? { letterSpacing: nav.letterSpacing } : {}
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2891
|
+
/** The case a header Look gives the menu itself, or null when the menu follows the nav. */
|
|
2892
|
+
function dropdownOwnCase(style) {
|
|
2893
|
+
const textTransform = style?.textTransform ?? "none";
|
|
2894
|
+
return textTransform === "none" ? null : textTransform;
|
|
2895
|
+
}
|
|
2896
|
+
/** The menu's links set in the nav links' type; size and weight stay the menu's. */
|
|
2897
|
+
function dropdownNavLinkStyle(header, surface, navLinkStyle) {
|
|
2898
|
+
return {
|
|
2899
|
+
name: "Dropdown",
|
|
2900
|
+
...dropdownTypeFromNav(surface.style, navLinkStyle),
|
|
2901
|
+
fontWeight: surface.style?.fontWeight ?? header.navWeight ?? "medium",
|
|
2619
2902
|
italic: false,
|
|
2620
|
-
colorToken: textToken,
|
|
2903
|
+
colorToken: surface.textToken,
|
|
2621
2904
|
padding: "compact",
|
|
2622
2905
|
borderRadius: "sm",
|
|
2623
2906
|
effects: {
|
|
@@ -2641,12 +2924,12 @@ function dropdownTypographyRules(style) {
|
|
|
2641
2924
|
};
|
|
2642
2925
|
return [...letterSpacing === "normal" ? [] : [`letter-spacing: ${spacing[letterSpacing]};`], `font-size: ${sizes[style?.textSize ?? "sm"]};`];
|
|
2643
2926
|
}
|
|
2644
|
-
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface) {
|
|
2927
|
+
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface, navLinkStyle) {
|
|
2645
2928
|
return generateNavLinkCSS({
|
|
2646
2929
|
themeId,
|
|
2647
2930
|
tokens,
|
|
2648
2931
|
theme,
|
|
2649
|
-
style: dropdownNavLinkStyle(header, surface),
|
|
2932
|
+
style: dropdownNavLinkStyle(header, surface, navLinkStyle),
|
|
2650
2933
|
className: "nav-dropdown-link"
|
|
2651
2934
|
}) + `\n${`:where([data-theme-scope="${themeId}"]) .nav-dropdown-link`} {\n ${dropdownTypographyRules(surface.style).join("\n ")}\n}\n`;
|
|
2652
2935
|
}
|
|
@@ -2944,6 +3227,11 @@ const waveMaskSvgPaths = {
|
|
|
2944
3227
|
*/
|
|
2945
3228
|
const arcShapePath = "M0 110V60Q720 -30 1440 60V110Z";
|
|
2946
3229
|
const arcEchoLinePaths = ["M0 84Q720 -6 1440 84", "M0 102Q720 12 1440 102"];
|
|
3230
|
+
/** The arc turned over: the next section's colour sits lowest in the middle, under the swell of the section above. */
|
|
3231
|
+
const arcBulgeShapePath = "M0 110V50Q720 140 1440 50V110Z";
|
|
3232
|
+
function arcBulgeMaskDataUrl() {
|
|
3233
|
+
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='${arcBulgeShapePath}' fill='white'/></svg>`);
|
|
3234
|
+
}
|
|
2947
3235
|
function arcMaskDataUrl(echo) {
|
|
2948
3236
|
const lines = arcEchoLinePaths.map((d) => `<path d='${d}' fill='none' stroke='url(#fade)' stroke-width='1.5' vector-effect='non-scaling-stroke'/>`).join("");
|
|
2949
3237
|
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'>${echo ? `<defs><linearGradient id='fade' gradientUnits='userSpaceOnUse' x1='0' y1='0' x2='1440' y2='0'><stop offset='0' stop-color='black' stop-opacity='0.42'/><stop offset='0.5' stop-color='black' stop-opacity='0'/><stop offset='1' stop-color='black' stop-opacity='0.42'/></linearGradient><mask id='lines'><rect width='1440' height='110' fill='white'/>${lines}</mask></defs><path d='${arcShapePath}' fill='white' mask='url(#lines)'/>` : `<path d='${arcShapePath}' fill='white'/>`}</svg>`);
|
|
@@ -3052,7 +3340,7 @@ function shapeDeclarations(entry) {
|
|
|
3052
3340
|
"background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--boundary-shape-paint) 16%, transparent) 34%, color-mix(in srgb, var(--boundary-shape-paint) 68%, transparent) 78%, var(--boundary-shape-paint) 100%);"
|
|
3053
3341
|
];
|
|
3054
3342
|
case "wave": return maskDeclarations(waveMaskDataUrl(entry.shape.mask));
|
|
3055
|
-
case "arc": return [...maskDeclarations(arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3343
|
+
case "arc": return [...maskDeclarations(entry.shape.bulge ? arcBulgeMaskDataUrl() : arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3056
3344
|
case "angle": return [
|
|
3057
3345
|
"height: calc(var(--boundary-height) + 2px);",
|
|
3058
3346
|
"background: var(--boundary-shape-paint);",
|
|
@@ -3130,1197 +3418,917 @@ function generateHeroTypographyCss(themeId, theme) {
|
|
|
3130
3418
|
const microHeadlineRules = buildTypographyRules("headline", typography.microHeadlineSize, typography.microHeadlineLineHeight);
|
|
3131
3419
|
if (microHeadlineRules.length > 0) chunks.push(`${microHeadlineSelector} {\n ${microHeadlineRules.join("\n ")}\n}`);
|
|
3132
3420
|
const microSubheadlineRules = buildTypographyRules("subheadline", typography.microSubheadlineSize, typography.microSubheadlineLineHeight);
|
|
3133
|
-
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
3134
|
-
const selectors = {
|
|
3135
|
-
headline: headlineSelector,
|
|
3136
|
-
subheadline: subheadlineSelector
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
if (!overrides) return null;
|
|
3144
|
-
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
3145
|
-
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
3146
|
-
const mediaChunks = [];
|
|
3147
|
-
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
3148
|
-
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
3149
|
-
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
3150
|
-
}
|
|
3151
|
-
function buildTypographyRules(role, size, lineHeight) {
|
|
3152
|
-
const rules = [];
|
|
3153
|
-
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
3154
|
-
if (lineHeight) rules.push(`line-height: ${toHeroLineHeight(lineHeight)};`);
|
|
3155
|
-
return rules;
|
|
3156
|
-
}
|
|
3157
|
-
function generateBodyTextTypographyCss(themeId, theme) {
|
|
3158
|
-
const intro = theme.bodyText?.intro;
|
|
3159
|
-
if (!intro) return "";
|
|
3160
|
-
const rootSelector = `:where([data-theme-scope="${themeId}"]) :where([data-block="body-text"][data-block-variant="intro"])`;
|
|
3161
|
-
const chunks = [];
|
|
3162
|
-
if (intro.headingSize === "editorial") chunks.push(`${rootSelector} .body-copy-heading {
|
|
3163
|
-
font-size: clamp(1.75rem, 1.15rem + 2.2vw, 3rem);
|
|
3164
|
-
line-height: 1.08;
|
|
3165
|
-
}`);
|
|
3166
|
-
if (intro.paragraphSize === "editorial") chunks.push(`${rootSelector} .body-copy-body {
|
|
3167
|
-
--rb-prose-lg-font-size: clamp(1.35rem, 1.05rem + 1.3vw, 2rem);
|
|
3168
|
-
--rb-prose-lg-line-height: 1.55;
|
|
3169
|
-
--rb-prose-xl-sm-font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
|
|
3170
|
-
--rb-prose-xl-sm-line-height: 1.55;
|
|
3171
|
-
}`);
|
|
3172
|
-
return chunks.join("\n\n");
|
|
3173
|
-
}
|
|
3174
|
-
function toHeroSize(role, size) {
|
|
3175
|
-
const baseMap = {
|
|
3176
|
-
sm: "0.875rem",
|
|
3177
|
-
base: "1rem",
|
|
3178
|
-
lg: "1.125rem",
|
|
3179
|
-
xl: "1.25rem",
|
|
3180
|
-
"2xl": "1.5rem",
|
|
3181
|
-
"3xl": "1.875rem",
|
|
3182
|
-
"4xl": "2.25rem",
|
|
3183
|
-
"5xl": "3rem",
|
|
3184
|
-
"6xl": "3.75rem"
|
|
3185
|
-
};
|
|
3186
|
-
if (size !== "editorial") return baseMap[size];
|
|
3187
|
-
return role === "subheadline" ? "clamp(1.0625rem, 1.4vw, 1.375rem)" : "clamp(1.25rem, 3vw, 2.25rem)";
|
|
3188
|
-
}
|
|
3189
|
-
function toHeroLineHeight(lineHeight) {
|
|
3190
|
-
return {
|
|
3191
|
-
tight: "1.1",
|
|
3192
|
-
snug: "1.25",
|
|
3193
|
-
normal: "1.4",
|
|
3194
|
-
relaxed: "1.6"
|
|
3195
|
-
}[lineHeight];
|
|
3196
|
-
}
|
|
3197
|
-
//#endregion
|
|
3198
|
-
//#region ../theme-core/src/event-calendar/generateEventCalendarCss.ts
|
|
3199
|
-
/**
|
|
3200
|
-
* @deprecated Use blocks-static/index.css with CSS variables instead.
|
|
3201
|
-
*
|
|
3202
|
-
* CSS for event calendar classes is now in:
|
|
3203
|
-
* - packages/blocks/src/theme/blocks-static/index.css (static rule bodies)
|
|
3204
|
-
* - packages/blocks/src/theme/blocks/vars/event-calendar.ts (Tier 3 vars)
|
|
3205
|
-
*
|
|
3206
|
-
* Returns an empty string for backwards compatibility.
|
|
3207
|
-
*/
|
|
3208
|
-
function generateEventCalendarCss(_params) {
|
|
3209
|
-
return "";
|
|
3210
|
-
}
|
|
3211
|
-
//#endregion
|
|
3212
|
-
//#region ../theme-core/src/blockOverrides.ts
|
|
3213
|
-
const BLOCK_PREFIX = "block.";
|
|
3214
|
-
function isPlainObject$1(value) {
|
|
3215
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3216
|
-
}
|
|
3217
|
-
function isUnknownArray(value) {
|
|
3218
|
-
return Array.isArray(value);
|
|
3219
|
-
}
|
|
3220
|
-
function cloneValue(value) {
|
|
3221
|
-
if (isUnknownArray(value)) return value.map((item) => cloneValue(item));
|
|
3222
|
-
if (isPlainObject$1(value)) {
|
|
3223
|
-
const cloned = {};
|
|
3224
|
-
for (const [key, child] of Object.entries(value)) cloned[key] = cloneValue(child);
|
|
3225
|
-
return cloned;
|
|
3226
|
-
}
|
|
3227
|
-
return value;
|
|
3228
|
-
}
|
|
3229
|
-
function mergeDeep(defaultValue, overrideValue) {
|
|
3230
|
-
if (overrideValue === void 0) return cloneValue(defaultValue);
|
|
3231
|
-
if (overrideValue === null) return null;
|
|
3232
|
-
if (isPlainObject$1(defaultValue) && isPlainObject$1(overrideValue)) {
|
|
3233
|
-
const merged = {};
|
|
3234
|
-
const keys = /* @__PURE__ */ new Set([...Object.keys(defaultValue), ...Object.keys(overrideValue)]);
|
|
3235
|
-
for (const key of keys) merged[key] = mergeDeep(defaultValue[key], overrideValue[key]);
|
|
3236
|
-
return merged;
|
|
3237
|
-
}
|
|
3238
|
-
return cloneValue(overrideValue);
|
|
3239
|
-
}
|
|
3240
|
-
function normalizeBlockKind(blockKind) {
|
|
3241
|
-
return blockKind.replace(/^block\./, "");
|
|
3242
|
-
}
|
|
3243
|
-
function buildBlockKindCandidates(blockKind) {
|
|
3244
|
-
const normalized = normalizeBlockKind(blockKind);
|
|
3245
|
-
const prefixed = `${BLOCK_PREFIX}${normalized}`;
|
|
3246
|
-
return Array.from(/* @__PURE__ */ new Set([
|
|
3247
|
-
blockKind,
|
|
3248
|
-
normalized,
|
|
3249
|
-
prefixed
|
|
3250
|
-
]));
|
|
3251
|
-
}
|
|
3252
|
-
function resolveEffectiveHeadingDecoration(themeDecoration, override) {
|
|
3253
|
-
if (override === "off" || !themeDecoration || themeDecoration.family === "none") return { kind: "none" };
|
|
3254
|
-
return {
|
|
3255
|
-
kind: "visible",
|
|
3256
|
-
decoration: themeDecoration
|
|
3257
|
-
};
|
|
3258
|
-
}
|
|
3259
|
-
function resolveBlockThemeOverride(theme, blockKind) {
|
|
3260
|
-
if (!theme?.blockOverrides || !blockKind) return void 0;
|
|
3261
|
-
for (const candidate of buildBlockKindCandidates(blockKind)) {
|
|
3262
|
-
const override = theme.blockOverrides[candidate];
|
|
3263
|
-
if (override) return override;
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
function mergeContentWithBlockStyleOverrides(content, theme, blockKind) {
|
|
3267
|
-
const styleOverrides = resolveBlockThemeOverride(theme, blockKind)?.styles;
|
|
3268
|
-
const mergedContent = { ...content };
|
|
3269
|
-
if (styleOverrides) {
|
|
3270
|
-
applyStyleOverride(mergedContent, "_sectionStyles", styleOverrides.sectionStyles);
|
|
3271
|
-
applyStyleOverride(mergedContent, "_containerStyles", styleOverrides.containerStyles);
|
|
3272
|
-
applyStyleOverride(mergedContent, "_cardStyles", styleOverrides.cardStyles);
|
|
3273
|
-
}
|
|
3274
|
-
applyHeadingDecorationSignature(mergedContent, theme?.headingDecoration);
|
|
3275
|
-
return mergedContent;
|
|
3276
|
-
}
|
|
3277
|
-
/**
|
|
3278
|
-
* Projects the site-wide heading decoration signature onto a transient
|
|
3279
|
-
* `_sectionStyles.headingDecoration`, honouring the per-section override:
|
|
3280
|
-
* - `off` strips the decoration (the section opts out).
|
|
3281
|
-
* - `site-default` / absent use the theme signature.
|
|
3282
|
-
*
|
|
3283
|
-
* Clone-on-write so the caller's content is never mutated in place. Any value
|
|
3284
|
-
* previously baked into content is intentionally overwritten — the theme is the
|
|
3285
|
-
* single runtime source.
|
|
3286
|
-
*/
|
|
3287
|
-
function applyHeadingDecorationSignature(target, themeDecoration) {
|
|
3288
|
-
const existing = target["_sectionStyles"];
|
|
3289
|
-
const existingObj = isPlainObject$1(existing) ? existing : void 0;
|
|
3290
|
-
const rawOverride = existingObj?.["headingDecorationOverride"];
|
|
3291
|
-
const effective = resolveEffectiveHeadingDecoration(themeDecoration, rawOverride === "site-default" || rawOverride === "off" ? rawOverride : void 0);
|
|
3292
|
-
if (effective.kind === "none") {
|
|
3293
|
-
if (existingObj && "headingDecoration" in existingObj) {
|
|
3294
|
-
const next = { ...existingObj };
|
|
3295
|
-
delete next["headingDecoration"];
|
|
3296
|
-
target["_sectionStyles"] = next;
|
|
3297
|
-
}
|
|
3298
|
-
return;
|
|
3299
|
-
}
|
|
3300
|
-
const next = existingObj ? { ...existingObj } : {};
|
|
3301
|
-
next["headingDecoration"] = { ...effective.decoration };
|
|
3302
|
-
target["_sectionStyles"] = next;
|
|
3303
|
-
}
|
|
3304
|
-
function applyStyleOverride(target, key, defaults) {
|
|
3305
|
-
if (defaults === void 0) return;
|
|
3306
|
-
target[key] = mergeStyleOverride(defaults, target[key]);
|
|
3307
|
-
}
|
|
3308
|
-
function mergeStyleOverride(defaultValue, contentValue) {
|
|
3309
|
-
if (!isPlainObject$1(defaultValue) || !isPlainObject$1(contentValue)) return mergeDeep(defaultValue, contentValue);
|
|
3310
|
-
const merged = mergeDeep(defaultValue, contentValue);
|
|
3311
|
-
if (!isPlainObject$1(merged)) return merged;
|
|
3312
|
-
return {
|
|
3313
|
-
...merged,
|
|
3314
|
-
background: mergeBoxBackground(defaultValue.background, contentValue.background)
|
|
3315
|
-
};
|
|
3316
|
-
}
|
|
3317
|
-
function mergeBoxBackground(defaultValue, contentValue) {
|
|
3318
|
-
if (contentValue === void 0) return cloneValue(defaultValue);
|
|
3319
|
-
if (contentValue === null) return null;
|
|
3320
|
-
const defaults = boxBackgroundSchema.safeParse(defaultValue);
|
|
3321
|
-
const content = boxBackgroundSchema.safeParse(contentValue);
|
|
3322
|
-
if (!content.success) return cloneValue(contentValue);
|
|
3323
|
-
if (!defaults.success || defaults.data.type !== content.data.type) return content.data;
|
|
3324
|
-
const merged = boxBackgroundSchema.safeParse(mergeDeep(defaults.data, content.data));
|
|
3325
|
-
return merged.success ? merged.data : content.data;
|
|
3326
|
-
}
|
|
3327
|
-
//#endregion
|
|
3328
|
-
//#region ../theme-core/src/customCss/compileAtRules.ts
|
|
3329
|
-
/**
|
|
3330
|
-
* Compile an array of CSS at-rules to a CSS string.
|
|
3331
|
-
*
|
|
3332
|
-
* @param atRules - Array of at-rules
|
|
3333
|
-
* @param themeId - Theme scope ID for selector prefixing in @media/@supports
|
|
3334
|
-
* @returns Compiled CSS string
|
|
3335
|
-
*/
|
|
3336
|
-
function compileCustomCssAtRules(atRules, themeId, options) {
|
|
3337
|
-
if (!atRules || atRules.length === 0) return "";
|
|
3338
|
-
const scopePrefix = `:where([data-theme-scope="${themeId}"])`;
|
|
3339
|
-
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
3340
|
-
const containerName = options?.containerName ?? "rb-site";
|
|
3341
|
-
return atRules.map((atRule) => compileAtRule(atRule, scopePrefix, {
|
|
3342
|
-
responsiveMode,
|
|
3343
|
-
containerName
|
|
3344
|
-
})).filter(Boolean).join("\n\n");
|
|
3345
|
-
}
|
|
3346
|
-
/**
|
|
3347
|
-
* Compile a single at-rule based on its type.
|
|
3348
|
-
*/
|
|
3349
|
-
function compileAtRule(atRule, scopePrefix, options) {
|
|
3350
|
-
switch (atRule.type) {
|
|
3351
|
-
case "keyframes": return compileKeyframes(atRule);
|
|
3352
|
-
case "font-face": return compileFontFace(atRule);
|
|
3353
|
-
case "media": return compileMedia(atRule, scopePrefix, options);
|
|
3354
|
-
case "supports": return compileSupports(atRule, scopePrefix);
|
|
3355
|
-
case "raw": return compileRaw(atRule);
|
|
3356
|
-
}
|
|
3357
|
-
}
|
|
3358
|
-
/**
|
|
3359
|
-
* Compile @keyframes rule.
|
|
3360
|
-
* Output is global (no scoping needed).
|
|
3361
|
-
*
|
|
3362
|
-
* @example
|
|
3363
|
-
* @keyframes fadeIn {
|
|
3364
|
-
* 0% { opacity: 0; }
|
|
3365
|
-
* 100% { opacity: 1; }
|
|
3366
|
-
* }
|
|
3367
|
-
*/
|
|
3368
|
-
function compileKeyframes(atRule) {
|
|
3369
|
-
const framesCss = atRule.frames.map((frame) => {
|
|
3370
|
-
const declarations = compileDeclarations(frame.declarations);
|
|
3371
|
-
return ` ${frame.offset} {\n${indent(declarations, 4)}\n }`;
|
|
3372
|
-
}).join("\n");
|
|
3373
|
-
return `@keyframes ${atRule.name} {\n${framesCss}\n}`;
|
|
3374
|
-
}
|
|
3375
|
-
/**
|
|
3376
|
-
* Compile @font-face rule.
|
|
3377
|
-
* Output is global (no scoping needed).
|
|
3378
|
-
*
|
|
3379
|
-
* @example
|
|
3380
|
-
* @font-face {
|
|
3381
|
-
* font-family: MyFont;
|
|
3382
|
-
* src: url(/fonts/myfont.woff2) format("woff2");
|
|
3383
|
-
* }
|
|
3384
|
-
*/
|
|
3385
|
-
function compileFontFace(atRule) {
|
|
3386
|
-
return `@font-face {\n${indent(compileDeclarations(atRule.declarations), 2)}\n}`;
|
|
3387
|
-
}
|
|
3388
|
-
/**
|
|
3389
|
-
* Compile @media rule with scoped selectors.
|
|
3390
|
-
* Returns empty string if all nested rules filter out.
|
|
3391
|
-
*
|
|
3392
|
-
* @example
|
|
3393
|
-
* @media (max-width: 768px) {
|
|
3394
|
-
* :where([data-theme-scope="..."]) .hero { font-size: 24px; }
|
|
3395
|
-
* }
|
|
3396
|
-
*/
|
|
3397
|
-
function compileMedia(atRule, scopePrefix, options) {
|
|
3398
|
-
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
3399
|
-
if (!rules) return "";
|
|
3400
|
-
const containerQuery = options.responsiveMode === "container" ? convertMediaQueryToContainerQuery(atRule.query) : null;
|
|
3401
|
-
if (containerQuery) return `@container ${options.containerName} ${containerQuery} {\n${indent(rules, 2)}\n}`;
|
|
3402
|
-
return `@media ${atRule.query} {\n${indent(rules, 2)}\n}`;
|
|
3403
|
-
}
|
|
3404
|
-
/**
|
|
3405
|
-
* Compile @supports rule with scoped selectors.
|
|
3406
|
-
* Returns empty string if all nested rules filter out.
|
|
3407
|
-
*
|
|
3408
|
-
* @example
|
|
3409
|
-
* @supports (display: grid) {
|
|
3410
|
-
* :where([data-theme-scope="..."]) .container { display: grid; }
|
|
3411
|
-
* }
|
|
3412
|
-
*/
|
|
3413
|
-
function compileSupports(atRule, scopePrefix) {
|
|
3414
|
-
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
3415
|
-
if (!rules) return "";
|
|
3416
|
-
return `@supports ${atRule.condition} {\n${indent(rules, 2)}\n}`;
|
|
3417
|
-
}
|
|
3418
|
-
/**
|
|
3419
|
-
* Compile raw at-rule (output as-is with XSS protection).
|
|
3420
|
-
*/
|
|
3421
|
-
function compileRaw(atRule) {
|
|
3422
|
-
return escapeStyleContent(atRule.css.trim());
|
|
3423
|
-
}
|
|
3424
|
-
/**
|
|
3425
|
-
* Compile a nested rule (for @media/@supports) with scoped selector.
|
|
3426
|
-
*/
|
|
3427
|
-
function compileNestedRule(selector, declarations, scopePrefix) {
|
|
3428
|
-
const declarationsStr = compileDeclarations(declarations);
|
|
3429
|
-
if (!declarationsStr) return "";
|
|
3430
|
-
return `${prefixSelector(selector, scopePrefix)} {\n${indent(declarationsStr, 2)}\n}`;
|
|
3431
|
-
}
|
|
3432
|
-
/**
|
|
3433
|
-
* Compile declarations object to CSS string.
|
|
3434
|
-
* Converts camelCase properties to kebab-case.
|
|
3435
|
-
*/
|
|
3436
|
-
function compileDeclarations(declarations) {
|
|
3437
|
-
return Object.entries(declarations).map(([prop, value]) => `${toKebabCase(prop)}: ${value};`).join("\n");
|
|
3438
|
-
}
|
|
3439
|
-
/**
|
|
3440
|
-
* Indent a string by a number of spaces.
|
|
3441
|
-
*/
|
|
3442
|
-
function indent(str, spaces) {
|
|
3443
|
-
const pad = " ".repeat(spaces);
|
|
3444
|
-
return str.split("\n").map((line) => line ? pad + line : line).join("\n");
|
|
3445
|
-
}
|
|
3446
|
-
//#endregion
|
|
3447
|
-
//#region ../theme-core/src/runtime/buildThemeRuntime.ts
|
|
3448
|
-
function buildThemeRuntime$1(theme, options) {
|
|
3449
|
-
const hydrated = hydrateTheme(theme);
|
|
3450
|
-
const cssVars = buildThemeCssVars(hydrated);
|
|
3451
|
-
const themeId = options?.themeId ?? "theme-default";
|
|
3452
|
-
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
3453
|
-
const solvedInks = "publish";
|
|
3454
|
-
const buttonOptions = {
|
|
3455
|
-
themeId,
|
|
3456
|
-
theme,
|
|
3457
|
-
buttonSystem: theme.buttons
|
|
3458
|
-
};
|
|
3459
|
-
const buttonCss = `${generateButtonCss(buttonOptions)}\n${generateButtonActionLayoutCss(buttonOptions)}`;
|
|
3460
|
-
const headerCss = generateHeaderCss({
|
|
3461
|
-
themeId,
|
|
3462
|
-
theme,
|
|
3463
|
-
responsiveMode,
|
|
3464
|
-
solvedInks
|
|
3465
|
-
});
|
|
3466
|
-
const footerCss = generateFooterCss({
|
|
3467
|
-
themeId,
|
|
3468
|
-
theme
|
|
3469
|
-
});
|
|
3470
|
-
const cardCss = [generateCardCss({
|
|
3471
|
-
themeId,
|
|
3472
|
-
theme,
|
|
3473
|
-
cardSystem: theme.cards,
|
|
3474
|
-
solvedInks
|
|
3475
|
-
}), generateOpaquePanelCss({
|
|
3476
|
-
themeId,
|
|
3477
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
3478
|
-
bookingBar: theme.skinBookingBar
|
|
3479
|
-
})].join("\n\n");
|
|
3480
|
-
const accordionCss = generateAccordionCss({
|
|
3481
|
-
themeId,
|
|
3482
|
-
theme,
|
|
3483
|
-
accordionSystem: theme.accordions ?? generateDefaultAccordionSystem(theme),
|
|
3484
|
-
solvedInks
|
|
3485
|
-
});
|
|
3486
|
-
const inputCss = generateInputCss({
|
|
3487
|
-
themeId,
|
|
3488
|
-
theme,
|
|
3489
|
-
inputSystem: resolveThemeInputSystem(theme)
|
|
3490
|
-
});
|
|
3491
|
-
const layoutCss = generateLayoutCss({
|
|
3492
|
-
themeId,
|
|
3493
|
-
theme
|
|
3494
|
-
});
|
|
3495
|
-
const statusCss = generateStatusCss({
|
|
3496
|
-
themeId,
|
|
3497
|
-
theme,
|
|
3498
|
-
palette: hydrated.palette
|
|
3499
|
-
});
|
|
3500
|
-
const progressCss = generateProgressCss({
|
|
3501
|
-
themeId,
|
|
3502
|
-
theme
|
|
3503
|
-
});
|
|
3504
|
-
const typographyCss = generateTypographyCss({
|
|
3505
|
-
themeId,
|
|
3506
|
-
theme
|
|
3507
|
-
});
|
|
3508
|
-
const eventCalendarCss = generateEventCalendarCss({
|
|
3509
|
-
themeId,
|
|
3510
|
-
theme
|
|
3511
|
-
});
|
|
3512
|
-
const blockVarsCss = [generateThemeBlockVarsCss(theme, themeId), generateBlockOverrideCss(themeId, theme)].filter(Boolean).join("\n");
|
|
3513
|
-
const blockCustomVarsCss = generateBlockCustomVarsCss(themeId, theme.blockCustomVars);
|
|
3514
|
-
const atRulesCss = theme.customCssAtRules ? compileCustomCssAtRules(theme.customCssAtRules, themeId, { responsiveMode }) : void 0;
|
|
3515
|
-
const customCss = theme.customCssRules ? compileCustomCssRules(parseCustomCssRules(theme.customCssRules), themeId) : void 0;
|
|
3516
|
-
const blockCustomCss = theme.blockCustomCssRules ? compileBlockCustomCssRules(parseBlockCustomCssRules(theme.blockCustomCssRules), themeId) : void 0;
|
|
3517
|
-
return {
|
|
3518
|
-
hydrated,
|
|
3519
|
-
cssVars,
|
|
3520
|
-
tokens: {
|
|
3521
|
-
...buildThemeTokens(hydrated.palette),
|
|
3522
|
-
solvedInks
|
|
3523
|
-
},
|
|
3524
|
-
paletteTokens: hydrated.palette,
|
|
3525
|
-
buttonCss,
|
|
3526
|
-
headerCss,
|
|
3527
|
-
footerCss,
|
|
3528
|
-
cardCss,
|
|
3529
|
-
accordionCss,
|
|
3530
|
-
inputCss,
|
|
3531
|
-
layoutCss,
|
|
3532
|
-
statusCss,
|
|
3533
|
-
progressCss,
|
|
3534
|
-
typographyCss,
|
|
3535
|
-
eventCalendarCss,
|
|
3536
|
-
blockVarsCss,
|
|
3537
|
-
blockCustomVarsCss,
|
|
3538
|
-
blockCustomCss,
|
|
3539
|
-
customCss,
|
|
3540
|
-
atRulesCss
|
|
3541
|
-
};
|
|
3542
|
-
}
|
|
3543
|
-
function hydrateTheme(theme) {
|
|
3544
|
-
return {
|
|
3545
|
-
...theme,
|
|
3546
|
-
palette: expandPalette(theme.palette, {
|
|
3547
|
-
arrangement: theme.skin !== void 0,
|
|
3548
|
-
marksFrom: theme.skinMarks
|
|
3549
|
-
})
|
|
3550
|
-
};
|
|
3551
|
-
}
|
|
3552
|
-
function pageSurfaceInks(palette) {
|
|
3553
|
-
return surfaceInkStyle(surfaceInkPublication(resolveSurfaceForeground({
|
|
3554
|
-
type: "color",
|
|
3555
|
-
color: "background",
|
|
3556
|
-
textColor: "text"
|
|
3557
|
-
}, palette), "publish"));
|
|
3558
|
-
}
|
|
3559
|
-
function resolveThemeInputSystem(theme) {
|
|
3560
|
-
return theme.inputs ?? generateDefaultInputSystem(theme);
|
|
3561
|
-
}
|
|
3562
|
-
function buildThemeCssVars(theme) {
|
|
3563
|
-
const { typography, space, shadow, motion, border } = theme;
|
|
3564
|
-
const sized = applyHeadingSizeOverrides(computeTypeScale(typography.scale, typography.body.size), typography);
|
|
3565
|
-
const inputSystem = resolveThemeInputSystem(theme);
|
|
3566
|
-
const blockRadius = mapBlockRadius(theme.corners);
|
|
3567
|
-
const buttonRadius = mapButtonRadius(theme.corners);
|
|
3568
|
-
const panelRadius = mapPanelRadius(theme.corners);
|
|
3569
|
-
const inputRadius = mapInputRadius(inputSystem.base.corners, theme.corners);
|
|
3570
|
-
return {
|
|
3571
|
-
...generateCssVars(theme.palette),
|
|
3572
|
-
...skinTokenCssVars(theme.skinTokens),
|
|
3573
|
-
["--tb-secondaryForeground"]: "var(--tb-onSecondary)",
|
|
3574
|
-
["--tb-accentForeground"]: "var(--tb-onAccent)",
|
|
3575
|
-
["--tb-scrim"]: "0 0 0",
|
|
3576
|
-
["--tb-shadow"]: "0 0 0",
|
|
3577
|
-
...generateShadowCssVars(theme),
|
|
3578
|
-
...pageSurfaceInks(theme.palette),
|
|
3579
|
-
...typographyFontRoleCssVars(typography),
|
|
3580
|
-
["--font-eyebrow"]: typography.eyebrow?.family ? formatFontFamily(typography.eyebrow.family) : "var(--font-body)",
|
|
3581
|
-
...typography.eyebrow?.size ? { ["--fs-eyebrow"]: mapEyebrowSize(typography.eyebrow.size) } : {},
|
|
3582
|
-
...typography.eyebrow?.weight ? { ["--fw-eyebrow"]: mapWeight(typography.eyebrow.weight) } : {},
|
|
3583
|
-
...typography.eyebrow?.letterSpacing ? { ["--ls-eyebrow"]: mapEyebrowLetterSpacing(typography.eyebrow.letterSpacing) } : {},
|
|
3584
|
-
...typography.eyebrow?.case ? { ["--tt-eyebrow"]: mapEyebrowCase(typography.eyebrow.case) } : {},
|
|
3585
|
-
["--font-weight-heading"]: mapWeight(typography.headings.default.weight),
|
|
3586
|
-
["--font-weight-body"]: mapWeight(typography.body.weight),
|
|
3587
|
-
...typography.headings.h1.weight ? { ["--fw-h1"]: mapWeight(typography.headings.h1.weight) } : {},
|
|
3588
|
-
...typography.headings.h2.weight ? { ["--fw-h2"]: mapWeight(typography.headings.h2.weight) } : {},
|
|
3589
|
-
...typography.headings.h3.weight ? { ["--fw-h3"]: mapWeight(typography.headings.h3.weight) } : {},
|
|
3590
|
-
...typography.headings.h4?.weight ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
|
|
3591
|
-
...typography.headings.h5?.weight ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
|
|
3592
|
-
...typography.headings.h6?.weight ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
|
|
3593
|
-
["--ls-heading"]: mapLetterSpacing(typography.headings.default.letterSpacing),
|
|
3594
|
-
["--ls-body"]: mapLetterSpacing(typography.body.letterSpacing),
|
|
3595
|
-
...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
|
|
3596
|
-
...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
|
|
3597
|
-
...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
|
|
3598
|
-
...typography.headings.h4?.letterSpacing ? { ["--ls-h4"]: mapLetterSpacing(typography.headings.h4.letterSpacing) } : {},
|
|
3599
|
-
...typography.headings.h5?.letterSpacing ? { ["--ls-h5"]: mapLetterSpacing(typography.headings.h5.letterSpacing) } : {},
|
|
3600
|
-
...typography.headings.h6?.letterSpacing ? { ["--ls-h6"]: mapLetterSpacing(typography.headings.h6.letterSpacing) } : {},
|
|
3601
|
-
["--lh-heading"]: mapHeadingLineHeight(typography.headings.default.lineHeight),
|
|
3602
|
-
["--lh-body"]: mapLineHeight(typography.body.lineHeight),
|
|
3603
|
-
...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapHeadingLineHeight(typography.headings.h1.lineHeight) } : {},
|
|
3604
|
-
...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapHeadingLineHeight(typography.headings.h2.lineHeight) } : {},
|
|
3605
|
-
...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapHeadingLineHeight(typography.headings.h3.lineHeight) } : {},
|
|
3606
|
-
...typography.headings.h4?.lineHeight ? { ["--lh-h4"]: mapHeadingLineHeight(typography.headings.h4.lineHeight) } : {},
|
|
3607
|
-
...typography.headings.h5?.lineHeight ? { ["--lh-h5"]: mapHeadingLineHeight(typography.headings.h5.lineHeight) } : {},
|
|
3608
|
-
...typography.headings.h6?.lineHeight ? { ["--lh-h6"]: mapHeadingLineHeight(typography.headings.h6.lineHeight) } : {},
|
|
3609
|
-
["--tt-heading"]: mapTextTransform(typography.headings.default.case),
|
|
3610
|
-
["--fv-heading"]: mapFontVariant(typography.headings.default.case),
|
|
3611
|
-
["--fi-heading"]: mapFontStyle(typography.headings.default.italic),
|
|
3612
|
-
...typography.headings.h1.italic != null ? { ["--fi-h1"]: mapFontStyle(typography.headings.h1.italic) } : {},
|
|
3613
|
-
...typography.headings.h2.italic != null ? { ["--fi-h2"]: mapFontStyle(typography.headings.h2.italic) } : {},
|
|
3614
|
-
...typography.headings.h3.italic != null ? { ["--fi-h3"]: mapFontStyle(typography.headings.h3.italic) } : {},
|
|
3615
|
-
...typography.headings.h4?.italic != null ? { ["--fi-h4"]: mapFontStyle(typography.headings.h4.italic) } : {},
|
|
3616
|
-
...typography.headings.h5?.italic != null ? { ["--fi-h5"]: mapFontStyle(typography.headings.h5.italic) } : {},
|
|
3617
|
-
...typography.headings.h6?.italic != null ? { ["--fi-h6"]: mapFontStyle(typography.headings.h6.italic) } : {},
|
|
3618
|
-
...typography.headings.default.colorToken ? { ["--hc-heading"]: rgbColorValue(typography.headings.default.colorToken) } : {},
|
|
3619
|
-
...typography.headings.h1.colorToken ? { ["--hc-h1"]: rgbColorValue(typography.headings.h1.colorToken) } : {},
|
|
3620
|
-
...typography.headings.h2.colorToken ? { ["--hc-h2"]: rgbColorValue(typography.headings.h2.colorToken) } : {},
|
|
3621
|
-
...typography.headings.h3.colorToken ? { ["--hc-h3"]: rgbColorValue(typography.headings.h3.colorToken) } : {},
|
|
3622
|
-
...typography.headings.h4?.colorToken ? { ["--hc-h4"]: rgbColorValue(typography.headings.h4.colorToken) } : {},
|
|
3623
|
-
...typography.headings.h5?.colorToken ? { ["--hc-h5"]: rgbColorValue(typography.headings.h5.colorToken) } : {},
|
|
3624
|
-
...typography.headings.h6?.colorToken ? { ["--hc-h6"]: rgbColorValue(typography.headings.h6.colorToken) } : {},
|
|
3625
|
-
...proseLinkStyleToCssVars(typography.proseLinkStyle),
|
|
3626
|
-
["--fs-body"]: sized.body,
|
|
3627
|
-
["--fs-h3"]: sized.h3,
|
|
3628
|
-
["--fs-h2"]: sized.h2,
|
|
3629
|
-
["--fs-h1"]: sized.h1,
|
|
3630
|
-
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
3631
|
-
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
3632
|
-
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
3633
|
-
["--fs-h1-display"]: sized.h1Display,
|
|
3634
|
-
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
3635
|
-
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom", shadow.colorToken),
|
|
3636
|
-
["--space-mult"]: mapSpaceMult(space),
|
|
3637
|
-
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
3638
|
-
["--motion-ease"]: mapMotionEasing(motion.easing ?? "standard"),
|
|
3639
|
-
["--rt-space-y"]: mapRhythm(space),
|
|
3640
|
-
[THEME_RADIUS_CSS_VARS.block]: blockRadius,
|
|
3641
|
-
[THEME_RADIUS_CSS_VARS.panel]: panelRadius,
|
|
3642
|
-
["--rb-block-transition"]: mapBlockTransition(motion.level),
|
|
3643
|
-
[THEME_RADIUS_CSS_VARS.button]: buttonRadius,
|
|
3644
|
-
["--rb-border-width"]: mapBorderWidth(border.width),
|
|
3645
|
-
["--rb-border-style"]: mapBorderStyle(border.style),
|
|
3646
|
-
[THEME_RADIUS_CSS_VARS.input]: inputRadius,
|
|
3647
|
-
["--rb-input-focus-width"]: `${inputSystem.focus.ringWidth}px`,
|
|
3648
|
-
["--rb-input-focus-color"]: rgbColorValue(inputSystem.focus.ringColorToken),
|
|
3649
|
-
[THEME_RADIUS_CSS_VARS.legacyCard]: blockRadius,
|
|
3650
|
-
[THEME_RADIUS_CSS_VARS.legacyControl]: inputRadius
|
|
3421
|
+
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
3422
|
+
const selectors = {
|
|
3423
|
+
headline: headlineSelector,
|
|
3424
|
+
subheadline: subheadlineSelector,
|
|
3425
|
+
microHeadline: microHeadlineSelector,
|
|
3426
|
+
microSubheadline: microSubheadlineSelector
|
|
3427
|
+
};
|
|
3428
|
+
const microSizes = {
|
|
3429
|
+
headlineSize: typography.microHeadlineSize,
|
|
3430
|
+
subheadlineSize: typography.microSubheadlineSize
|
|
3651
3431
|
};
|
|
3432
|
+
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet, microSizes), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile, microSizes)];
|
|
3433
|
+
for (const chunk of responsiveChunks) if (chunk) chunks.push(chunk);
|
|
3434
|
+
return chunks.join("\n\n");
|
|
3652
3435
|
}
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3436
|
+
function responsiveHeroTypographyCss(media, selectors, overrides, microSizes) {
|
|
3437
|
+
if (!overrides) return null;
|
|
3438
|
+
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
3439
|
+
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
3440
|
+
const mediaChunks = [];
|
|
3441
|
+
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
3442
|
+
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
3443
|
+
const microHeadlineSize = microSizeAtBreakpoint(microSizes.headlineSize, overrides.headlineSize);
|
|
3444
|
+
if (microHeadlineSize) {
|
|
3445
|
+
const rules = buildTypographyRules("headline", microHeadlineSize, overrides.headlineLineHeight);
|
|
3446
|
+
mediaChunks.push(`${selectors.microHeadline} {\n ${rules.join("\n ")}\n }`);
|
|
3447
|
+
}
|
|
3448
|
+
const microSubheadlineSize = microSizeAtBreakpoint(microSizes.subheadlineSize, overrides.subheadlineSize);
|
|
3449
|
+
if (microSubheadlineSize) {
|
|
3450
|
+
const rules = buildTypographyRules("subheadline", microSubheadlineSize, overrides.subheadlineLineHeight);
|
|
3451
|
+
mediaChunks.push(`${selectors.microSubheadline} {\n ${rules.join("\n ")}\n }`);
|
|
3452
|
+
}
|
|
3453
|
+
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
3454
|
+
}
|
|
3455
|
+
/**
|
|
3456
|
+
* A micro hero steps down to the breakpoint's size, but a micro size that's
|
|
3457
|
+
* already smaller stays as it is. The editorial size is fluid, so it needs no step.
|
|
3458
|
+
*/
|
|
3459
|
+
function microSizeAtBreakpoint(microSize, breakpointSize) {
|
|
3460
|
+
if (!microSize || !breakpointSize || microSize === "editorial") return void 0;
|
|
3461
|
+
if (breakpointSize === "editorial") return breakpointSize;
|
|
3462
|
+
return HERO_SIZE_ORDER.indexOf(breakpointSize) < HERO_SIZE_ORDER.indexOf(microSize) ? breakpointSize : void 0;
|
|
3463
|
+
}
|
|
3464
|
+
function buildTypographyRules(role, size, lineHeight) {
|
|
3465
|
+
const rules = [];
|
|
3466
|
+
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
3467
|
+
if (lineHeight) rules.push(`line-height: ${toHeroLineHeight(lineHeight)};`);
|
|
3468
|
+
return rules;
|
|
3469
|
+
}
|
|
3470
|
+
function generateBodyTextTypographyCss(themeId, theme) {
|
|
3471
|
+
const intro = theme.bodyText?.intro;
|
|
3472
|
+
if (!intro) return "";
|
|
3473
|
+
const rootSelector = `:where([data-theme-scope="${themeId}"]) :where([data-block="body-text"][data-block-variant="intro"])`;
|
|
3474
|
+
const chunks = [];
|
|
3475
|
+
if (intro.headingSize === "editorial") chunks.push(`${rootSelector} .body-copy-heading {
|
|
3476
|
+
font-size: clamp(1.75rem, 1.15rem + 2.2vw, 3rem);
|
|
3477
|
+
line-height: 1.08;
|
|
3478
|
+
}`);
|
|
3479
|
+
if (intro.paragraphSize === "editorial") chunks.push(`${rootSelector} .body-copy-body {
|
|
3480
|
+
--rb-prose-lg-font-size: clamp(1.35rem, 1.05rem + 1.3vw, 2rem);
|
|
3481
|
+
--rb-prose-lg-line-height: 1.55;
|
|
3482
|
+
--rb-prose-xl-sm-font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem);
|
|
3483
|
+
--rb-prose-xl-sm-line-height: 1.55;
|
|
3484
|
+
}`);
|
|
3485
|
+
return chunks.join("\n\n");
|
|
3486
|
+
}
|
|
3487
|
+
const HERO_SIZE_ORDER = [
|
|
3488
|
+
"sm",
|
|
3489
|
+
"base",
|
|
3490
|
+
"lg",
|
|
3491
|
+
"xl",
|
|
3492
|
+
"2xl",
|
|
3493
|
+
"3xl",
|
|
3494
|
+
"4xl",
|
|
3495
|
+
"5xl",
|
|
3496
|
+
"6xl"
|
|
3497
|
+
];
|
|
3498
|
+
function toHeroSize(role, size) {
|
|
3499
|
+
const baseMap = {
|
|
3500
|
+
sm: "0.875rem",
|
|
3501
|
+
base: "1rem",
|
|
3502
|
+
lg: "1.125rem",
|
|
3503
|
+
xl: "1.25rem",
|
|
3504
|
+
"2xl": "1.5rem",
|
|
3505
|
+
"3xl": "1.875rem",
|
|
3506
|
+
"4xl": "2.25rem",
|
|
3507
|
+
"5xl": "3rem",
|
|
3508
|
+
"6xl": "3.75rem"
|
|
3662
3509
|
};
|
|
3510
|
+
if (size !== "editorial") return baseMap[size];
|
|
3511
|
+
return role === "subheadline" ? "clamp(1.0625rem, 1.4vw, 1.375rem)" : "clamp(1.25rem, 3vw, 2.25rem)";
|
|
3663
3512
|
}
|
|
3664
|
-
function
|
|
3513
|
+
function toHeroLineHeight(lineHeight) {
|
|
3665
3514
|
return {
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
}[w];
|
|
3515
|
+
tight: "1.1",
|
|
3516
|
+
snug: "1.25",
|
|
3517
|
+
normal: "1.4",
|
|
3518
|
+
relaxed: "1.6"
|
|
3519
|
+
}[lineHeight];
|
|
3672
3520
|
}
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3521
|
+
//#endregion
|
|
3522
|
+
//#region ../theme-core/src/event-calendar/generateEventCalendarCss.ts
|
|
3523
|
+
/**
|
|
3524
|
+
* @deprecated Use blocks-static/index.css with CSS variables instead.
|
|
3525
|
+
*
|
|
3526
|
+
* CSS for event calendar classes is now in:
|
|
3527
|
+
* - packages/blocks/src/theme/blocks-static/index.css (static rule bodies)
|
|
3528
|
+
* - packages/blocks/src/theme/blocks/vars/event-calendar.ts (Tier 3 vars)
|
|
3529
|
+
*
|
|
3530
|
+
* Returns an empty string for backwards compatibility.
|
|
3531
|
+
*/
|
|
3532
|
+
function generateEventCalendarCss(_params) {
|
|
3533
|
+
return "";
|
|
3534
|
+
}
|
|
3535
|
+
//#endregion
|
|
3536
|
+
//#region ../theme-core/src/blockOverrides.ts
|
|
3537
|
+
const BLOCK_PREFIX = "block.";
|
|
3538
|
+
function isPlainObject$1(value) {
|
|
3539
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3540
|
+
}
|
|
3541
|
+
function isUnknownArray(value) {
|
|
3542
|
+
return Array.isArray(value);
|
|
3543
|
+
}
|
|
3544
|
+
function cloneValue(value) {
|
|
3545
|
+
if (isUnknownArray(value)) return value.map((item) => cloneValue(item));
|
|
3546
|
+
if (isPlainObject$1(value)) {
|
|
3547
|
+
const cloned = {};
|
|
3548
|
+
for (const [key, child] of Object.entries(value)) cloned[key] = cloneValue(child);
|
|
3549
|
+
return cloned;
|
|
3689
3550
|
}
|
|
3551
|
+
return value;
|
|
3690
3552
|
}
|
|
3691
|
-
function
|
|
3553
|
+
function mergeDeep(defaultValue, overrideValue) {
|
|
3554
|
+
if (overrideValue === void 0) return cloneValue(defaultValue);
|
|
3555
|
+
if (overrideValue === null) return null;
|
|
3556
|
+
if (isPlainObject$1(defaultValue) && isPlainObject$1(overrideValue)) {
|
|
3557
|
+
const merged = {};
|
|
3558
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(defaultValue), ...Object.keys(overrideValue)]);
|
|
3559
|
+
for (const key of keys) merged[key] = mergeDeep(defaultValue[key], overrideValue[key]);
|
|
3560
|
+
return merged;
|
|
3561
|
+
}
|
|
3562
|
+
return cloneValue(overrideValue);
|
|
3563
|
+
}
|
|
3564
|
+
function normalizeBlockKind(blockKind) {
|
|
3565
|
+
return blockKind.replace(/^block\./, "");
|
|
3566
|
+
}
|
|
3567
|
+
function buildBlockKindCandidates(blockKind) {
|
|
3568
|
+
const normalized = normalizeBlockKind(blockKind);
|
|
3569
|
+
const prefixed = `${BLOCK_PREFIX}${normalized}`;
|
|
3570
|
+
return Array.from(/* @__PURE__ */ new Set([
|
|
3571
|
+
blockKind,
|
|
3572
|
+
normalized,
|
|
3573
|
+
prefixed
|
|
3574
|
+
]));
|
|
3575
|
+
}
|
|
3576
|
+
function resolveEffectiveHeadingDecoration(themeDecoration, override) {
|
|
3577
|
+
if (override === "off" || !themeDecoration || themeDecoration.family === "none") return { kind: "none" };
|
|
3692
3578
|
return {
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
}[space];
|
|
3579
|
+
kind: "visible",
|
|
3580
|
+
decoration: themeDecoration
|
|
3581
|
+
};
|
|
3697
3582
|
}
|
|
3698
|
-
function
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3583
|
+
function resolveBlockThemeOverride(theme, blockKind) {
|
|
3584
|
+
if (!theme?.blockOverrides || !blockKind) return void 0;
|
|
3585
|
+
for (const candidate of buildBlockKindCandidates(blockKind)) {
|
|
3586
|
+
const override = theme.blockOverrides[candidate];
|
|
3587
|
+
if (override) return override;
|
|
3703
3588
|
}
|
|
3704
3589
|
}
|
|
3705
|
-
function
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3590
|
+
function mergeContentWithBlockStyleOverrides(content, theme, blockKind) {
|
|
3591
|
+
const styleOverrides = resolveBlockThemeOverride(theme, blockKind)?.styles;
|
|
3592
|
+
const mergedContent = { ...content };
|
|
3593
|
+
if (styleOverrides) {
|
|
3594
|
+
applyStyleOverride(mergedContent, "_sectionStyles", styleOverrides.sectionStyles);
|
|
3595
|
+
applyStyleOverride(mergedContent, "_containerStyles", styleOverrides.containerStyles);
|
|
3596
|
+
applyStyleOverride(mergedContent, "_cardStyles", styleOverrides.cardStyles);
|
|
3597
|
+
}
|
|
3598
|
+
applyHeadingDecorationSignature(mergedContent, theme?.headingDecoration);
|
|
3599
|
+
return mergedContent;
|
|
3712
3600
|
}
|
|
3713
|
-
|
|
3601
|
+
/**
|
|
3602
|
+
* Projects the site-wide heading decoration signature onto a transient
|
|
3603
|
+
* `_sectionStyles.headingDecoration`, honouring the per-section override:
|
|
3604
|
+
* - `off` strips the decoration (the section opts out).
|
|
3605
|
+
* - `site-default` / absent use the theme signature.
|
|
3606
|
+
*
|
|
3607
|
+
* Clone-on-write so the caller's content is never mutated in place. Any value
|
|
3608
|
+
* previously baked into content is intentionally overwritten — the theme is the
|
|
3609
|
+
* single runtime source.
|
|
3610
|
+
*/
|
|
3611
|
+
function applyHeadingDecorationSignature(target, themeDecoration) {
|
|
3612
|
+
const existing = target["_sectionStyles"];
|
|
3613
|
+
const existingObj = isPlainObject$1(existing) ? existing : void 0;
|
|
3614
|
+
const rawOverride = existingObj?.["headingDecorationOverride"];
|
|
3615
|
+
const effective = resolveEffectiveHeadingDecoration(themeDecoration, rawOverride === "site-default" || rawOverride === "off" ? rawOverride : void 0);
|
|
3616
|
+
if (effective.kind === "none") {
|
|
3617
|
+
if (existingObj && "headingDecoration" in existingObj) {
|
|
3618
|
+
const next = { ...existingObj };
|
|
3619
|
+
delete next["headingDecoration"];
|
|
3620
|
+
target["_sectionStyles"] = next;
|
|
3621
|
+
}
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3624
|
+
const next = existingObj ? { ...existingObj } : {};
|
|
3625
|
+
next["headingDecoration"] = { ...effective.decoration };
|
|
3626
|
+
target["_sectionStyles"] = next;
|
|
3627
|
+
}
|
|
3628
|
+
function applyStyleOverride(target, key, defaults) {
|
|
3629
|
+
if (defaults === void 0) return;
|
|
3630
|
+
target[key] = mergeStyleOverride(defaults, target[key]);
|
|
3631
|
+
}
|
|
3632
|
+
function mergeStyleOverride(defaultValue, contentValue) {
|
|
3633
|
+
if (!isPlainObject$1(defaultValue) || !isPlainObject$1(contentValue)) return mergeDeep(defaultValue, contentValue);
|
|
3634
|
+
const merged = mergeDeep(defaultValue, contentValue);
|
|
3635
|
+
if (!isPlainObject$1(merged)) return merged;
|
|
3714
3636
|
return {
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3637
|
+
...merged,
|
|
3638
|
+
background: mergeBoxBackground(defaultValue.background, contentValue.background)
|
|
3639
|
+
};
|
|
3640
|
+
}
|
|
3641
|
+
function mergeBoxBackground(defaultValue, contentValue) {
|
|
3642
|
+
if (contentValue === void 0) return cloneValue(defaultValue);
|
|
3643
|
+
if (contentValue === null) return null;
|
|
3644
|
+
const defaults = boxBackgroundSchema.safeParse(defaultValue);
|
|
3645
|
+
const content = boxBackgroundSchema.safeParse(contentValue);
|
|
3646
|
+
if (!content.success) return cloneValue(contentValue);
|
|
3647
|
+
if (!defaults.success || defaults.data.type !== content.data.type) return content.data;
|
|
3648
|
+
const merged = boxBackgroundSchema.safeParse(mergeDeep(defaults.data, content.data));
|
|
3649
|
+
return merged.success ? merged.data : content.data;
|
|
3650
|
+
}
|
|
3651
|
+
//#endregion
|
|
3652
|
+
//#region ../theme-core/src/customCss/compileAtRules.ts
|
|
3653
|
+
/**
|
|
3654
|
+
* Compile an array of CSS at-rules to a CSS string.
|
|
3655
|
+
*
|
|
3656
|
+
* @param atRules - Array of at-rules
|
|
3657
|
+
* @param themeId - Theme scope ID for selector prefixing in @media/@supports
|
|
3658
|
+
* @returns Compiled CSS string
|
|
3659
|
+
*/
|
|
3660
|
+
function compileCustomCssAtRules(atRules, themeId, options) {
|
|
3661
|
+
if (!atRules || atRules.length === 0) return "";
|
|
3662
|
+
const scopePrefix = `:where([data-theme-scope="${themeId}"])`;
|
|
3663
|
+
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
3664
|
+
const containerName = options?.containerName ?? "rb-site";
|
|
3665
|
+
return atRules.map((atRule) => compileAtRule(atRule, scopePrefix, {
|
|
3666
|
+
responsiveMode,
|
|
3667
|
+
containerName
|
|
3668
|
+
})).filter(Boolean).join("\n\n");
|
|
3719
3669
|
}
|
|
3720
3670
|
/**
|
|
3721
|
-
*
|
|
3722
|
-
* These are Tier 2 vars used consistently across blocks. The pill token is
|
|
3723
|
-
* intentionally capped for block surfaces: buttons can be fully pill-shaped,
|
|
3724
|
-
* but cards/panels with real content should not become capsules.
|
|
3671
|
+
* Compile a single at-rule based on its type.
|
|
3725
3672
|
*/
|
|
3726
|
-
function
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3673
|
+
function compileAtRule(atRule, scopePrefix, options) {
|
|
3674
|
+
switch (atRule.type) {
|
|
3675
|
+
case "keyframes": return compileKeyframes(atRule);
|
|
3676
|
+
case "font-face": return compileFontFace(atRule);
|
|
3677
|
+
case "media": return compileMedia(atRule, scopePrefix, options);
|
|
3678
|
+
case "supports": return compileSupports(atRule, scopePrefix);
|
|
3679
|
+
case "raw": return compileRaw(atRule);
|
|
3680
|
+
}
|
|
3733
3681
|
}
|
|
3734
3682
|
/**
|
|
3735
|
-
*
|
|
3736
|
-
*
|
|
3737
|
-
*
|
|
3738
|
-
*
|
|
3739
|
-
*
|
|
3683
|
+
* Compile @keyframes rule.
|
|
3684
|
+
* Output is global (no scoping needed).
|
|
3685
|
+
*
|
|
3686
|
+
* @example
|
|
3687
|
+
* @keyframes fadeIn {
|
|
3688
|
+
* 0% { opacity: 0; }
|
|
3689
|
+
* 100% { opacity: 1; }
|
|
3690
|
+
* }
|
|
3740
3691
|
*/
|
|
3741
|
-
function
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
}[corners];
|
|
3692
|
+
function compileKeyframes(atRule) {
|
|
3693
|
+
const framesCss = atRule.frames.map((frame) => {
|
|
3694
|
+
const declarations = compileDeclarations(frame.declarations);
|
|
3695
|
+
return ` ${frame.offset} {\n${indent(declarations, 4)}\n }`;
|
|
3696
|
+
}).join("\n");
|
|
3697
|
+
return `@keyframes ${atRule.name} {\n${framesCss}\n}`;
|
|
3748
3698
|
}
|
|
3749
3699
|
/**
|
|
3750
|
-
*
|
|
3751
|
-
*
|
|
3700
|
+
* Compile @font-face rule.
|
|
3701
|
+
* Output is global (no scoping needed).
|
|
3702
|
+
*
|
|
3703
|
+
* @example
|
|
3704
|
+
* @font-face {
|
|
3705
|
+
* font-family: MyFont;
|
|
3706
|
+
* src: url(/fonts/myfont.woff2) format("woff2");
|
|
3707
|
+
* }
|
|
3752
3708
|
*/
|
|
3753
|
-
function
|
|
3754
|
-
return {
|
|
3755
|
-
off: "0ms",
|
|
3756
|
-
low: "120ms",
|
|
3757
|
-
medium: "150ms",
|
|
3758
|
-
high: "200ms"
|
|
3759
|
-
}[level];
|
|
3709
|
+
function compileFontFace(atRule) {
|
|
3710
|
+
return `@font-face {\n${indent(compileDeclarations(atRule.declarations), 2)}\n}`;
|
|
3760
3711
|
}
|
|
3761
3712
|
/**
|
|
3762
|
-
*
|
|
3763
|
-
*
|
|
3764
|
-
*
|
|
3765
|
-
*
|
|
3766
|
-
*
|
|
3713
|
+
* Compile @media rule with scoped selectors.
|
|
3714
|
+
* Returns empty string if all nested rules filter out.
|
|
3715
|
+
*
|
|
3716
|
+
* @example
|
|
3717
|
+
* @media (max-width: 768px) {
|
|
3718
|
+
* :where([data-theme-scope="..."]) .hero { font-size: 24px; }
|
|
3719
|
+
* }
|
|
3767
3720
|
*/
|
|
3768
|
-
function
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
}[corners];
|
|
3721
|
+
function compileMedia(atRule, scopePrefix, options) {
|
|
3722
|
+
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
3723
|
+
if (!rules) return "";
|
|
3724
|
+
const containerQuery = options.responsiveMode === "container" ? convertMediaQueryToContainerQuery(atRule.query) : null;
|
|
3725
|
+
if (containerQuery) return `@container ${options.containerName} ${containerQuery} {\n${indent(rules, 2)}\n}`;
|
|
3726
|
+
return `@media ${atRule.query} {\n${indent(rules, 2)}\n}`;
|
|
3775
3727
|
}
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3728
|
+
/**
|
|
3729
|
+
* Compile @supports rule with scoped selectors.
|
|
3730
|
+
* Returns empty string if all nested rules filter out.
|
|
3731
|
+
*
|
|
3732
|
+
* @example
|
|
3733
|
+
* @supports (display: grid) {
|
|
3734
|
+
* :where([data-theme-scope="..."]) .container { display: grid; }
|
|
3735
|
+
* }
|
|
3736
|
+
*/
|
|
3737
|
+
function compileSupports(atRule, scopePrefix) {
|
|
3738
|
+
const rules = atRule.rules.map((rule) => compileNestedRule(rule.selector, rule.declarations, scopePrefix)).filter(Boolean).join("\n");
|
|
3739
|
+
if (!rules) return "";
|
|
3740
|
+
return `@supports ${atRule.condition} {\n${indent(rules, 2)}\n}`;
|
|
3782
3741
|
}
|
|
3783
|
-
|
|
3784
|
-
|
|
3742
|
+
/**
|
|
3743
|
+
* Compile raw at-rule (output as-is with XSS protection).
|
|
3744
|
+
*/
|
|
3745
|
+
function compileRaw(atRule) {
|
|
3746
|
+
return escapeStyleContent(atRule.css.trim());
|
|
3785
3747
|
}
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
...style.underline != null ? { ["--rb-prose-link-decoration-line"]: style.underline ? "underline" : "none" } : {},
|
|
3794
|
-
...style.underlineStyle ? { ["--rb-prose-link-underline-style"]: style.underlineStyle } : {},
|
|
3795
|
-
...style.underlineThickness ? { ["--rb-prose-link-underline-thickness"]: mapProseLinkUnderlineThickness(style.underlineThickness) } : {},
|
|
3796
|
-
...style.underlineOffset ? { ["--rb-prose-link-underline-offset"]: mapProseLinkUnderlineOffset(style.underlineOffset) } : {}
|
|
3797
|
-
};
|
|
3748
|
+
/**
|
|
3749
|
+
* Compile a nested rule (for @media/@supports) with scoped selector.
|
|
3750
|
+
*/
|
|
3751
|
+
function compileNestedRule(selector, declarations, scopePrefix) {
|
|
3752
|
+
const declarationsStr = compileDeclarations(declarations);
|
|
3753
|
+
if (!declarationsStr) return "";
|
|
3754
|
+
return `${prefixSelector(selector, scopePrefix)} {\n${indent(declarationsStr, 2)}\n}`;
|
|
3798
3755
|
}
|
|
3799
3756
|
/**
|
|
3800
|
-
*
|
|
3801
|
-
*
|
|
3757
|
+
* Compile declarations object to CSS string.
|
|
3758
|
+
* Converts camelCase properties to kebab-case.
|
|
3802
3759
|
*/
|
|
3803
|
-
function
|
|
3804
|
-
|
|
3805
|
-
if (!overrides) return "";
|
|
3806
|
-
const cssBlocks = [];
|
|
3807
|
-
for (const [blockKind, blockOverride] of Object.entries(overrides)) {
|
|
3808
|
-
const blockSelectorKind = normalizeBlockKind(blockKind);
|
|
3809
|
-
const proseVars = proseLinkStyleToCssVars(blockOverride.typography?.proseLinkStyle);
|
|
3810
|
-
const declarations = Object.entries(proseVars).map(([key, value]) => ` ${key}: ${String(value)};`).join("\n");
|
|
3811
|
-
if (!declarations) continue;
|
|
3812
|
-
cssBlocks.push(`:where([data-theme-scope="${escapeAttrValue(themeId)}"]) :where([data-block="${escapeAttrValue(blockSelectorKind)}"]) {\n${declarations}\n}`);
|
|
3813
|
-
}
|
|
3814
|
-
return cssBlocks.join("\n");
|
|
3760
|
+
function compileDeclarations(declarations) {
|
|
3761
|
+
return Object.entries(declarations).map(([prop, value]) => `${toKebabCase(prop)}: ${value};`).join("\n");
|
|
3815
3762
|
}
|
|
3816
|
-
|
|
3817
|
-
|
|
3763
|
+
/**
|
|
3764
|
+
* Indent a string by a number of spaces.
|
|
3765
|
+
*/
|
|
3766
|
+
function indent(str, spaces) {
|
|
3767
|
+
const pad = " ".repeat(spaces);
|
|
3768
|
+
return str.split("\n").map((line) => line ? pad + line : line).join("\n");
|
|
3818
3769
|
}
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3770
|
+
//#endregion
|
|
3771
|
+
//#region ../theme-core/src/runtime/buildThemeRuntime.ts
|
|
3772
|
+
function buildThemeRuntime$1(theme, options) {
|
|
3773
|
+
const hydrated = hydrateTheme(theme);
|
|
3774
|
+
const cssVars = buildThemeCssVars(hydrated);
|
|
3775
|
+
const themeId = options?.themeId ?? "theme-default";
|
|
3776
|
+
const responsiveMode = options?.responsiveMode ?? "viewport";
|
|
3777
|
+
const solvedInks = "publish";
|
|
3778
|
+
const buttonOptions = {
|
|
3779
|
+
themeId,
|
|
3780
|
+
theme,
|
|
3781
|
+
buttonSystem: theme.buttons
|
|
3782
|
+
};
|
|
3783
|
+
const buttonCss = `${generateButtonCss(buttonOptions)}\n${generateButtonActionLayoutCss(buttonOptions)}`;
|
|
3784
|
+
const headerCss = generateHeaderCss({
|
|
3785
|
+
themeId,
|
|
3786
|
+
theme,
|
|
3787
|
+
responsiveMode,
|
|
3788
|
+
solvedInks
|
|
3789
|
+
});
|
|
3790
|
+
const footerCss = generateFooterCss({
|
|
3791
|
+
themeId,
|
|
3792
|
+
theme
|
|
3793
|
+
});
|
|
3794
|
+
const cardCss = [generateCardCss({
|
|
3795
|
+
themeId,
|
|
3796
|
+
theme,
|
|
3797
|
+
cardSystem: theme.cards,
|
|
3798
|
+
solvedInks
|
|
3799
|
+
}), generateOpaquePanelCss({
|
|
3800
|
+
themeId,
|
|
3801
|
+
surface: opaqueSurfaceContextFromTheme(theme),
|
|
3802
|
+
bookingBar: theme.skinBookingBar
|
|
3803
|
+
})].join("\n\n");
|
|
3804
|
+
const accordionCss = generateAccordionCss({
|
|
3805
|
+
themeId,
|
|
3806
|
+
theme,
|
|
3807
|
+
accordionSystem: theme.accordions ?? generateDefaultAccordionSystem(theme),
|
|
3808
|
+
solvedInks
|
|
3809
|
+
});
|
|
3810
|
+
const inputCss = generateInputCss({
|
|
3811
|
+
themeId,
|
|
3812
|
+
theme,
|
|
3813
|
+
inputSystem: resolveThemeInputSystem(theme)
|
|
3814
|
+
});
|
|
3815
|
+
const layoutCss = generateLayoutCss({
|
|
3816
|
+
themeId,
|
|
3817
|
+
theme
|
|
3818
|
+
});
|
|
3819
|
+
const statusCss = generateStatusCss({
|
|
3820
|
+
themeId,
|
|
3821
|
+
theme,
|
|
3822
|
+
palette: hydrated.palette
|
|
3823
|
+
});
|
|
3824
|
+
const progressCss = generateProgressCss({
|
|
3825
|
+
themeId,
|
|
3826
|
+
theme
|
|
3827
|
+
});
|
|
3828
|
+
const typographyCss = generateTypographyCss({
|
|
3829
|
+
themeId,
|
|
3830
|
+
theme
|
|
3831
|
+
});
|
|
3832
|
+
const eventCalendarCss = generateEventCalendarCss({
|
|
3833
|
+
themeId,
|
|
3834
|
+
theme
|
|
3835
|
+
});
|
|
3836
|
+
const blockVarsCss = [generateThemeBlockVarsCss(theme, themeId), generateBlockOverrideCss(themeId, theme)].filter(Boolean).join("\n");
|
|
3837
|
+
const blockCustomVarsCss = generateBlockCustomVarsCss(themeId, theme.blockCustomVars);
|
|
3838
|
+
const atRulesCss = theme.customCssAtRules ? compileCustomCssAtRules(theme.customCssAtRules, themeId, { responsiveMode }) : void 0;
|
|
3839
|
+
const customCss = theme.customCssRules ? compileCustomCssRules(parseCustomCssRules(theme.customCssRules), themeId) : void 0;
|
|
3840
|
+
const blockCustomCss = theme.blockCustomCssRules ? compileBlockCustomCssRules(parseBlockCustomCssRules(theme.blockCustomCssRules), themeId) : void 0;
|
|
3841
|
+
return {
|
|
3842
|
+
hydrated,
|
|
3843
|
+
cssVars,
|
|
3844
|
+
tokens: {
|
|
3845
|
+
...buildThemeTokens(hydrated.palette),
|
|
3846
|
+
solvedInks
|
|
3847
|
+
},
|
|
3848
|
+
paletteTokens: hydrated.palette,
|
|
3849
|
+
buttonCss,
|
|
3850
|
+
headerCss,
|
|
3851
|
+
footerCss,
|
|
3852
|
+
cardCss,
|
|
3853
|
+
accordionCss,
|
|
3854
|
+
inputCss,
|
|
3855
|
+
layoutCss,
|
|
3856
|
+
statusCss,
|
|
3857
|
+
progressCss,
|
|
3858
|
+
typographyCss,
|
|
3859
|
+
eventCalendarCss,
|
|
3860
|
+
blockVarsCss,
|
|
3861
|
+
blockCustomVarsCss,
|
|
3862
|
+
blockCustomCss,
|
|
3863
|
+
customCss,
|
|
3864
|
+
atRulesCss
|
|
3865
|
+
};
|
|
3827
3866
|
}
|
|
3828
|
-
function
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3867
|
+
function hydrateTheme(theme) {
|
|
3868
|
+
return {
|
|
3869
|
+
...theme,
|
|
3870
|
+
palette: expandPalette(theme.palette, {
|
|
3871
|
+
arrangement: theme.skin !== void 0,
|
|
3872
|
+
marksFrom: theme.skinMarks
|
|
3873
|
+
})
|
|
3874
|
+
};
|
|
3835
3875
|
}
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
case "square": return "0";
|
|
3843
|
-
case "soft": return "0.25rem";
|
|
3844
|
-
case "rounded": return "0.5rem";
|
|
3845
|
-
case "pill": return "9999px";
|
|
3846
|
-
default: return "0.375rem";
|
|
3847
|
-
}
|
|
3876
|
+
function pageSurfaceInks(palette) {
|
|
3877
|
+
return surfaceInkStyle(surfaceInkPublication(resolveSurfaceForeground({
|
|
3878
|
+
type: "color",
|
|
3879
|
+
color: "background",
|
|
3880
|
+
textColor: "text"
|
|
3881
|
+
}, palette), "publish"));
|
|
3848
3882
|
}
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
* Old names (minorThird, majorThird, perfectFourth) map to new names (compact, balanced, spacious).
|
|
3852
|
-
*/
|
|
3853
|
-
function normalizeScaleName(scale) {
|
|
3854
|
-
return {
|
|
3855
|
-
minorThird: "compact",
|
|
3856
|
-
majorThird: "balanced",
|
|
3857
|
-
perfectFourth: "spacious",
|
|
3858
|
-
compact: "compact",
|
|
3859
|
-
balanced: "balanced",
|
|
3860
|
-
spacious: "spacious"
|
|
3861
|
-
}[scale] ?? "balanced";
|
|
3883
|
+
function resolveThemeInputSystem(theme) {
|
|
3884
|
+
return theme.inputs ?? generateDefaultInputSystem(theme);
|
|
3862
3885
|
}
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
const
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
xl: 18
|
|
3872
|
-
}[bodySize];
|
|
3873
|
-
const ratio = {
|
|
3874
|
-
compact: 1.2,
|
|
3875
|
-
balanced: 1.25,
|
|
3876
|
-
spacious: 1.333
|
|
3877
|
-
}[normalizeScaleName(scale)];
|
|
3878
|
-
const h3 = Math.round(base * ratio);
|
|
3879
|
-
const h2 = Math.round(h3 * ratio);
|
|
3880
|
-
const h1 = Math.round(h2 * ratio);
|
|
3881
|
-
const fluidMin = .7;
|
|
3882
|
-
const h2FluidMin = .9;
|
|
3883
|
-
const fluidMax = 1.3;
|
|
3886
|
+
function buildThemeCssVars(theme) {
|
|
3887
|
+
const { typography, space, shadow, motion, border } = theme;
|
|
3888
|
+
const sized = applyHeadingSizeOverrides(computeTypeScale(typography.scale, typography.body.size), typography);
|
|
3889
|
+
const inputSystem = resolveThemeInputSystem(theme);
|
|
3890
|
+
const blockRadius = mapBlockRadius(theme.corners);
|
|
3891
|
+
const buttonRadius = mapButtonRadius(theme.corners);
|
|
3892
|
+
const panelRadius = mapPanelRadius(theme.corners);
|
|
3893
|
+
const inputRadius = mapInputRadius(inputSystem.base.corners, theme.corners);
|
|
3884
3894
|
return {
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
["--
|
|
3888
|
-
["--
|
|
3889
|
-
["--
|
|
3890
|
-
["--
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
["--
|
|
3895
|
-
["--fs-
|
|
3896
|
-
["--
|
|
3897
|
-
["--
|
|
3898
|
-
["--
|
|
3899
|
-
["--
|
|
3895
|
+
...generateCssVars(theme.palette),
|
|
3896
|
+
...skinTokenCssVars(theme.skinTokens),
|
|
3897
|
+
["--tb-secondaryForeground"]: "var(--tb-onSecondary)",
|
|
3898
|
+
["--tb-accentForeground"]: "var(--tb-onAccent)",
|
|
3899
|
+
["--tb-scrim"]: "0 0 0",
|
|
3900
|
+
["--tb-shadow"]: "0 0 0",
|
|
3901
|
+
...generateShadowCssVars(theme),
|
|
3902
|
+
...pageSurfaceInks(theme.palette),
|
|
3903
|
+
...typographyFontRoleCssVars(typography),
|
|
3904
|
+
["--font-eyebrow"]: typography.eyebrow?.family ? formatFontFamily(typography.eyebrow.family) : "var(--font-body)",
|
|
3905
|
+
...typography.eyebrow?.size ? { ["--fs-eyebrow"]: mapEyebrowSize(typography.eyebrow.size) } : {},
|
|
3906
|
+
...typography.eyebrow?.weight ? { ["--fw-eyebrow"]: mapWeight(typography.eyebrow.weight) } : {},
|
|
3907
|
+
...typography.eyebrow?.letterSpacing ? { ["--ls-eyebrow"]: mapEyebrowLetterSpacing(typography.eyebrow.letterSpacing) } : {},
|
|
3908
|
+
...typography.eyebrow?.case ? { ["--tt-eyebrow"]: mapEyebrowCase(typography.eyebrow.case) } : {},
|
|
3909
|
+
["--font-weight-heading"]: mapWeight(typography.headings.default.weight),
|
|
3910
|
+
["--font-weight-body"]: mapWeight(typography.body.weight),
|
|
3911
|
+
...typography.headings.h1.weight ? { ["--fw-h1"]: mapWeight(typography.headings.h1.weight) } : {},
|
|
3912
|
+
...typography.headings.h2.weight ? { ["--fw-h2"]: mapWeight(typography.headings.h2.weight) } : {},
|
|
3913
|
+
...typography.headings.h3.weight ? { ["--fw-h3"]: mapWeight(typography.headings.h3.weight) } : {},
|
|
3914
|
+
...typography.headings.h4?.weight ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
|
|
3915
|
+
...typography.headings.h5?.weight ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
|
|
3916
|
+
...typography.headings.h6?.weight ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
|
|
3917
|
+
["--ls-heading"]: mapLetterSpacing(typography.headings.default.letterSpacing),
|
|
3918
|
+
["--ls-body"]: mapLetterSpacing(typography.body.letterSpacing),
|
|
3919
|
+
...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
|
|
3920
|
+
...typography.headings.h2.letterSpacing ? { ["--ls-h2"]: mapLetterSpacing(typography.headings.h2.letterSpacing) } : {},
|
|
3921
|
+
...typography.headings.h3.letterSpacing ? { ["--ls-h3"]: mapLetterSpacing(typography.headings.h3.letterSpacing) } : {},
|
|
3922
|
+
...typography.headings.h4?.letterSpacing ? { ["--ls-h4"]: mapLetterSpacing(typography.headings.h4.letterSpacing) } : {},
|
|
3923
|
+
...typography.headings.h5?.letterSpacing ? { ["--ls-h5"]: mapLetterSpacing(typography.headings.h5.letterSpacing) } : {},
|
|
3924
|
+
...typography.headings.h6?.letterSpacing ? { ["--ls-h6"]: mapLetterSpacing(typography.headings.h6.letterSpacing) } : {},
|
|
3925
|
+
["--lh-heading"]: mapHeadingLineHeight(typography.headings.default.lineHeight),
|
|
3926
|
+
["--lh-body"]: mapLineHeight(typography.body.lineHeight),
|
|
3927
|
+
...typography.headings.h1.lineHeight ? { ["--lh-h1"]: mapHeadingLineHeight(typography.headings.h1.lineHeight) } : {},
|
|
3928
|
+
...typography.headings.h2.lineHeight ? { ["--lh-h2"]: mapHeadingLineHeight(typography.headings.h2.lineHeight) } : {},
|
|
3929
|
+
...typography.headings.h3.lineHeight ? { ["--lh-h3"]: mapHeadingLineHeight(typography.headings.h3.lineHeight) } : {},
|
|
3930
|
+
...typography.headings.h4?.lineHeight ? { ["--lh-h4"]: mapHeadingLineHeight(typography.headings.h4.lineHeight) } : {},
|
|
3931
|
+
...typography.headings.h5?.lineHeight ? { ["--lh-h5"]: mapHeadingLineHeight(typography.headings.h5.lineHeight) } : {},
|
|
3932
|
+
...typography.headings.h6?.lineHeight ? { ["--lh-h6"]: mapHeadingLineHeight(typography.headings.h6.lineHeight) } : {},
|
|
3933
|
+
["--tt-heading"]: mapTextTransform(typography.headings.default.case),
|
|
3934
|
+
["--fv-heading"]: mapFontVariant(typography.headings.default.case),
|
|
3935
|
+
["--fi-heading"]: mapFontStyle(typography.headings.default.italic),
|
|
3936
|
+
...typography.headings.h1.italic != null ? { ["--fi-h1"]: mapFontStyle(typography.headings.h1.italic) } : {},
|
|
3937
|
+
...typography.headings.h2.italic != null ? { ["--fi-h2"]: mapFontStyle(typography.headings.h2.italic) } : {},
|
|
3938
|
+
...typography.headings.h3.italic != null ? { ["--fi-h3"]: mapFontStyle(typography.headings.h3.italic) } : {},
|
|
3939
|
+
...typography.headings.h4?.italic != null ? { ["--fi-h4"]: mapFontStyle(typography.headings.h4.italic) } : {},
|
|
3940
|
+
...typography.headings.h5?.italic != null ? { ["--fi-h5"]: mapFontStyle(typography.headings.h5.italic) } : {},
|
|
3941
|
+
...typography.headings.h6?.italic != null ? { ["--fi-h6"]: mapFontStyle(typography.headings.h6.italic) } : {},
|
|
3942
|
+
...typography.headings.default.colorToken ? { ["--hc-heading"]: rgbColorValue(typography.headings.default.colorToken) } : {},
|
|
3943
|
+
...typography.headings.h1.colorToken ? { ["--hc-h1"]: rgbColorValue(typography.headings.h1.colorToken) } : {},
|
|
3944
|
+
...typography.headings.h2.colorToken ? { ["--hc-h2"]: rgbColorValue(typography.headings.h2.colorToken) } : {},
|
|
3945
|
+
...typography.headings.h3.colorToken ? { ["--hc-h3"]: rgbColorValue(typography.headings.h3.colorToken) } : {},
|
|
3946
|
+
...typography.headings.h4?.colorToken ? { ["--hc-h4"]: rgbColorValue(typography.headings.h4.colorToken) } : {},
|
|
3947
|
+
...typography.headings.h5?.colorToken ? { ["--hc-h5"]: rgbColorValue(typography.headings.h5.colorToken) } : {},
|
|
3948
|
+
...typography.headings.h6?.colorToken ? { ["--hc-h6"]: rgbColorValue(typography.headings.h6.colorToken) } : {},
|
|
3949
|
+
...proseLinkStyleToCssVars(typography.proseLinkStyle),
|
|
3950
|
+
["--fs-body"]: sized.body,
|
|
3951
|
+
["--fs-h3"]: sized.h3,
|
|
3952
|
+
["--fs-h2"]: sized.h2,
|
|
3953
|
+
["--fs-h1"]: sized.h1,
|
|
3954
|
+
["--fs-h1-fluid"]: sized.h1Fluid,
|
|
3955
|
+
["--fs-h2-fluid"]: sized.h2Fluid,
|
|
3956
|
+
["--fs-h3-fluid"]: sized.h3Fluid,
|
|
3957
|
+
["--fs-h1-display"]: sized.h1Display,
|
|
3958
|
+
["--fs-h1-display-fluid"]: sized.h1DisplayFluid,
|
|
3959
|
+
["--shadow-elev"]: mapShadow(shadow.elevation, shadow.softness, shadow.position || "bottom", shadow.colorToken),
|
|
3960
|
+
["--space-mult"]: mapSpaceMult(space),
|
|
3961
|
+
["--motion-duration"]: mapMotionDuration(motion.level),
|
|
3962
|
+
["--motion-ease"]: mapMotionEasing(motion.easing ?? "standard"),
|
|
3963
|
+
["--rt-space-y"]: mapRhythm(space),
|
|
3964
|
+
[THEME_RADIUS_CSS_VARS.block]: blockRadius,
|
|
3965
|
+
[THEME_RADIUS_CSS_VARS.panel]: panelRadius,
|
|
3966
|
+
["--rb-block-transition"]: mapBlockTransition(motion.level),
|
|
3967
|
+
[THEME_RADIUS_CSS_VARS.button]: buttonRadius,
|
|
3968
|
+
["--rb-border-width"]: mapBorderWidth(border.width),
|
|
3969
|
+
["--rb-border-style"]: mapBorderStyle(border.style),
|
|
3970
|
+
[THEME_RADIUS_CSS_VARS.input]: inputRadius,
|
|
3971
|
+
["--rb-input-focus-width"]: `${inputSystem.focus.ringWidth}px`,
|
|
3972
|
+
["--rb-input-focus-color"]: rgbColorValue(inputSystem.focus.ringColorToken),
|
|
3973
|
+
[THEME_RADIUS_CSS_VARS.legacyCard]: blockRadius,
|
|
3974
|
+
[THEME_RADIUS_CSS_VARS.legacyControl]: inputRadius
|
|
3900
3975
|
};
|
|
3901
3976
|
}
|
|
3902
|
-
/**
|
|
3903
|
-
|
|
3904
|
-
* Expanded from md/lg/xl to xs through 2xl for finer control.
|
|
3905
|
-
*/
|
|
3906
|
-
const SIZE_SCALE_MAP = {
|
|
3907
|
-
xs: .85,
|
|
3908
|
-
sm: .925,
|
|
3909
|
-
md: 1,
|
|
3910
|
-
lg: 1.1,
|
|
3911
|
-
xl: 1.2,
|
|
3912
|
-
"2xl": 1.35
|
|
3913
|
-
};
|
|
3914
|
-
function applyHeadingSizeOverrides(base, typography) {
|
|
3915
|
-
const body = base["--fs-body"];
|
|
3916
|
-
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
3917
|
-
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
3918
|
-
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
3919
|
-
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
3920
|
-
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
3921
|
-
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
3922
|
-
const h1 = Math.round(h1Base * h1Scale);
|
|
3923
|
-
const h2 = Math.round(h2Base * h2Scale);
|
|
3924
|
-
const h3 = Math.round(h3Base * h3Scale);
|
|
3925
|
-
const fluidMin = .7;
|
|
3926
|
-
const h2FluidMin = .9;
|
|
3927
|
-
const fluidMax = 1.3;
|
|
3977
|
+
/** Font roles use one formatter and weight mapping; absent small headings add no variables. */
|
|
3978
|
+
function typographyFontRoleCssVars(typography) {
|
|
3928
3979
|
return {
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3936
|
-
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
3937
|
-
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
3980
|
+
"--font-heading": formatFontFamily(typography.headings.default.family),
|
|
3981
|
+
"--font-body": formatFontFamily(typography.body.family),
|
|
3982
|
+
...typography.smallHeading ? {
|
|
3983
|
+
"--font-small-heading": formatFontFamily(typography.smallHeading.family),
|
|
3984
|
+
"--fw-small-heading": mapWeight(typography.smallHeading.weight)
|
|
3985
|
+
} : {}
|
|
3938
3986
|
};
|
|
3939
3987
|
}
|
|
3940
|
-
function
|
|
3988
|
+
function mapWeight(w) {
|
|
3941
3989
|
return {
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3990
|
+
light: 300,
|
|
3991
|
+
regular: 400,
|
|
3992
|
+
medium: 500,
|
|
3993
|
+
semibold: 600,
|
|
3994
|
+
bold: 700
|
|
3995
|
+
}[w];
|
|
3946
3996
|
}
|
|
3947
|
-
function
|
|
3948
|
-
return
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3997
|
+
function mapShadow(level, softness, position = "bottom", colorToken) {
|
|
3998
|
+
if (level === "none") return "none";
|
|
3999
|
+
const tintVar = colorToken ? cssVarValue(colorToken) : null;
|
|
4000
|
+
const shadowColor = (a) => tintVar ? `rgb(${tintVar} / ${a})` : `rgba(0,0,0,${a})`;
|
|
4001
|
+
const offset = {
|
|
4002
|
+
low: 2,
|
|
4003
|
+
medium: 4,
|
|
4004
|
+
high: 6
|
|
4005
|
+
}[level];
|
|
4006
|
+
const xOffset = position === "bottom-right" ? offset : 0;
|
|
4007
|
+
if (softness === "hard") return `${xOffset}px ${offset}px 0 0 ${shadowColor("1")}`;
|
|
4008
|
+
const soft = softness !== "crisp";
|
|
4009
|
+
switch (level) {
|
|
4010
|
+
case "low": return soft ? `${xOffset}px 1px 2px ${shadowColor(".06")}` : `${xOffset}px 1px 1px ${shadowColor(".12")}`;
|
|
4011
|
+
case "medium": return soft ? `${xOffset}px 10px 20px ${shadowColor(".08")}` : `${xOffset}px 6px 12px ${shadowColor(".16")}`;
|
|
4012
|
+
case "high": return soft ? `${xOffset}px 25px 50px ${shadowColor(".18")}` : `${xOffset}px 20px 30px ${shadowColor(".28")}`;
|
|
4013
|
+
}
|
|
3953
4014
|
}
|
|
3954
|
-
function
|
|
4015
|
+
function mapSpaceMult(space) {
|
|
3955
4016
|
return {
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
}[s];
|
|
4017
|
+
comfortable: 1.15,
|
|
4018
|
+
standard: 1,
|
|
4019
|
+
dense: .88
|
|
4020
|
+
}[space];
|
|
3961
4021
|
}
|
|
3962
|
-
function
|
|
3963
|
-
|
|
4022
|
+
function mapRhythm(space) {
|
|
4023
|
+
switch (space) {
|
|
4024
|
+
case "comfortable": return "1.2rem";
|
|
4025
|
+
case "dense": return "0.75rem";
|
|
4026
|
+
default: return "1rem";
|
|
4027
|
+
}
|
|
3964
4028
|
}
|
|
3965
|
-
function
|
|
4029
|
+
function mapMotionDuration(level) {
|
|
3966
4030
|
return {
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4031
|
+
off: "0ms",
|
|
4032
|
+
low: "120ms",
|
|
4033
|
+
medium: "180ms",
|
|
4034
|
+
high: "250ms"
|
|
4035
|
+
}[level];
|
|
4036
|
+
}
|
|
4037
|
+
function mapMotionEasing(e) {
|
|
4038
|
+
return {
|
|
4039
|
+
standard: "cubic-bezier(.2,.8,.2,1)",
|
|
4040
|
+
snappy: "cubic-bezier(.2,1,.2,1)",
|
|
4041
|
+
gentle: "cubic-bezier(.15,.85,.15,1)"
|
|
4042
|
+
}[e];
|
|
3971
4043
|
}
|
|
3972
4044
|
/**
|
|
3973
|
-
*
|
|
3974
|
-
*
|
|
3975
|
-
*
|
|
3976
|
-
*
|
|
3977
|
-
* display headings; body keeps `mapLineHeight`.
|
|
4045
|
+
* Map corner style to block radius CSS value.
|
|
4046
|
+
* These are Tier 2 vars used consistently across blocks. The pill token is
|
|
4047
|
+
* intentionally capped for block surfaces: buttons can be fully pill-shaped,
|
|
4048
|
+
* but cards/panels with real content should not become capsules.
|
|
3978
4049
|
*/
|
|
3979
|
-
function
|
|
4050
|
+
function mapBlockRadius(corners) {
|
|
3980
4051
|
return {
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
}[s];
|
|
3987
|
-
}
|
|
3988
|
-
function mapTextTransform(c) {
|
|
3989
|
-
if (c === "uppercase") return "uppercase";
|
|
3990
|
-
return "none";
|
|
3991
|
-
}
|
|
3992
|
-
function mapFontVariant(c) {
|
|
3993
|
-
if (c === "smallCaps") return "small-caps";
|
|
3994
|
-
return "normal";
|
|
3995
|
-
}
|
|
3996
|
-
function mapFontStyle(italic) {
|
|
3997
|
-
return italic ? "italic" : "normal";
|
|
3998
|
-
}
|
|
3999
|
-
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4000
|
-
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4001
|
-
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4002
|
-
return generateAllBlockVarsCss({
|
|
4003
|
-
theme,
|
|
4004
|
-
themeId,
|
|
4005
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4006
|
-
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4007
|
-
});
|
|
4052
|
+
square: "0",
|
|
4053
|
+
soft: "0.5rem",
|
|
4054
|
+
rounded: "0.75rem",
|
|
4055
|
+
pill: "1rem"
|
|
4056
|
+
}[corners];
|
|
4008
4057
|
}
|
|
4009
|
-
//#endregion
|
|
4010
|
-
//#region ../calendar/src/lane-packing.ts
|
|
4011
4058
|
/**
|
|
4012
|
-
*
|
|
4013
|
-
*
|
|
4014
|
-
*
|
|
4015
|
-
*
|
|
4016
|
-
*
|
|
4059
|
+
* Map corner style to large-panel radius CSS value (Tier 2 `--rb-panel-radius`).
|
|
4060
|
+
* Derived from the same `corners` enum, one step more generous than the
|
|
4061
|
+
* block/card radius so large surfaces can carry a softer corner without a new
|
|
4062
|
+
* schema field. `rounded` lands on 20px (1.25rem), matching the physio mockup's
|
|
4063
|
+
* large-panel radius.
|
|
4017
4064
|
*/
|
|
4018
|
-
function
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
const results = new Array(intervals.length);
|
|
4026
|
-
let cluster = [];
|
|
4027
|
-
let activeLaneEnds = [];
|
|
4028
|
-
let clusterMaxEnd = -Infinity;
|
|
4029
|
-
const closeCluster = () => {
|
|
4030
|
-
if (cluster.length === 0) return;
|
|
4031
|
-
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
4032
|
-
for (const entry of cluster) results[entry.index] = {
|
|
4033
|
-
laneIndex: entry.laneIndex,
|
|
4034
|
-
laneCount
|
|
4035
|
-
};
|
|
4036
|
-
cluster = [];
|
|
4037
|
-
activeLaneEnds = [];
|
|
4038
|
-
clusterMaxEnd = -Infinity;
|
|
4039
|
-
};
|
|
4040
|
-
for (const { interval, index } of indexed) {
|
|
4041
|
-
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
4042
|
-
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
4043
|
-
activeLaneEnds[laneIndex] = interval.end;
|
|
4044
|
-
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
4045
|
-
cluster.push({
|
|
4046
|
-
index,
|
|
4047
|
-
laneIndex
|
|
4048
|
-
});
|
|
4049
|
-
}
|
|
4050
|
-
closeCluster();
|
|
4051
|
-
return results;
|
|
4052
|
-
}
|
|
4053
|
-
function firstAvailableLane(activeLaneEnds, start) {
|
|
4054
|
-
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
4055
|
-
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
4065
|
+
function mapPanelRadius(corners) {
|
|
4066
|
+
return {
|
|
4067
|
+
square: "0",
|
|
4068
|
+
soft: "0.75rem",
|
|
4069
|
+
rounded: "1.25rem",
|
|
4070
|
+
pill: "2rem"
|
|
4071
|
+
}[corners];
|
|
4056
4072
|
}
|
|
4057
|
-
//#endregion
|
|
4058
|
-
//#region ../calendar/src/timetable.ts
|
|
4059
4073
|
/**
|
|
4060
|
-
*
|
|
4061
|
-
*
|
|
4062
|
-
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
4063
|
-
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
4064
|
-
* plus a diagnostics list for items dropped during processing.
|
|
4065
|
-
*
|
|
4066
|
-
* The function is pure: given identical input (including `now`), it returns
|
|
4067
|
-
* the same output. The model has no opinion on what an item is — pass
|
|
4068
|
-
* accessors.
|
|
4074
|
+
* Map motion level to block transition duration.
|
|
4075
|
+
* These are Tier 2 vars used consistently across blocks.
|
|
4069
4076
|
*/
|
|
4070
|
-
|
|
4071
|
-
minStartHour: 5,
|
|
4072
|
-
maxEndHour: 23,
|
|
4073
|
-
defaultStartHour: 6,
|
|
4074
|
-
defaultEndHour: 21,
|
|
4075
|
-
minHeightPercent: 2.5,
|
|
4076
|
-
marginMinutes: 0
|
|
4077
|
-
};
|
|
4078
|
-
function buildTimetableModel$1(input) {
|
|
4079
|
-
const bounds = resolveBounds(input.bounds);
|
|
4080
|
-
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
4081
|
-
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
4082
|
-
const parsed = parseAllItems(input.items, input);
|
|
4083
|
-
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
4084
|
-
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
4085
|
-
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
4077
|
+
function mapBlockTransition(level) {
|
|
4086
4078
|
return {
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
hasItems: inViewport.length > 0,
|
|
4093
|
-
diagnostics: [...parsed.diagnostics, ...laid.diagnostics]
|
|
4094
|
-
};
|
|
4079
|
+
off: "0ms",
|
|
4080
|
+
low: "120ms",
|
|
4081
|
+
medium: "150ms",
|
|
4082
|
+
high: "200ms"
|
|
4083
|
+
}[level];
|
|
4095
4084
|
}
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
reason: result.reason
|
|
4105
|
-
});
|
|
4106
|
-
}
|
|
4085
|
+
/**
|
|
4086
|
+
* Map corner style to button radius CSS value.
|
|
4087
|
+
* Uses Tailwind-style button radius values that match the button system.
|
|
4088
|
+
* - square/soft → rounded-md (0.375rem) for subtle rounding
|
|
4089
|
+
* - rounded → rounded-lg (0.5rem) for moderate rounding
|
|
4090
|
+
* - pill → rounded-full (9999px) for pill shape
|
|
4091
|
+
*/
|
|
4092
|
+
function mapButtonRadius(corners) {
|
|
4107
4093
|
return {
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4094
|
+
square: "0.375rem",
|
|
4095
|
+
soft: "0.375rem",
|
|
4096
|
+
rounded: "0.5rem",
|
|
4097
|
+
pill: "9999px"
|
|
4098
|
+
}[corners];
|
|
4111
4099
|
}
|
|
4112
|
-
function
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
const cellsByDate = /* @__PURE__ */ new Map();
|
|
4118
|
-
const diagnostics = [];
|
|
4119
|
-
for (const [dateKey, daySegments] of segmentsByDate) {
|
|
4120
|
-
const clipped = [];
|
|
4121
|
-
for (const segment of daySegments) {
|
|
4122
|
-
const result = clipDraft(segment, rangeStartMinutes, rangeEndMinutes);
|
|
4123
|
-
if (result.ok) clipped.push(result.clipped);
|
|
4124
|
-
else diagnostics.push({
|
|
4125
|
-
item: segment.draft.item,
|
|
4126
|
-
reason: result.reason
|
|
4127
|
-
});
|
|
4128
|
-
}
|
|
4129
|
-
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
4130
|
-
start: entry.visibleStart,
|
|
4131
|
-
end: entry.visibleEnd,
|
|
4132
|
-
orderKey: entry.segment.draft.orderKey
|
|
4133
|
-
})));
|
|
4134
|
-
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
4135
|
-
laneIndex: 0,
|
|
4136
|
-
laneCount: 1
|
|
4137
|
-
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
4100
|
+
function mapBorderWidth(width) {
|
|
4101
|
+
switch (width) {
|
|
4102
|
+
case "none": return "0px";
|
|
4103
|
+
case "thick": return "2px";
|
|
4104
|
+
default: return "1px";
|
|
4138
4105
|
}
|
|
4139
|
-
return {
|
|
4140
|
-
cellsByDate,
|
|
4141
|
-
diagnostics
|
|
4142
|
-
};
|
|
4143
4106
|
}
|
|
4144
|
-
function
|
|
4145
|
-
return
|
|
4146
|
-
const dateKey = formatDateKey(date);
|
|
4147
|
-
return {
|
|
4148
|
-
date,
|
|
4149
|
-
dateKey,
|
|
4150
|
-
isToday: isSameCalendarDay(date, today),
|
|
4151
|
-
cells: cellsByDate.get(dateKey) ?? []
|
|
4152
|
-
};
|
|
4153
|
-
});
|
|
4107
|
+
function mapBorderStyle(style) {
|
|
4108
|
+
return style;
|
|
4154
4109
|
}
|
|
4155
|
-
function
|
|
4156
|
-
|
|
4157
|
-
const endsAtIso = accessors.getEndsAt(item);
|
|
4158
|
-
const timeZone = accessors.getTimeZone(item);
|
|
4159
|
-
const startsAtMinutes = getLocalMinuteOfDay(startsAtIso, timeZone);
|
|
4160
|
-
if (Number.isNaN(startsAtMinutes)) return {
|
|
4161
|
-
ok: false,
|
|
4162
|
-
reason: "invalid-start"
|
|
4163
|
-
};
|
|
4164
|
-
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
4165
|
-
if (startDateKey == null) return {
|
|
4166
|
-
ok: false,
|
|
4167
|
-
reason: "invalid-timezone"
|
|
4168
|
-
};
|
|
4169
|
-
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
4170
|
-
if (endDateKey == null) return {
|
|
4171
|
-
ok: false,
|
|
4172
|
-
reason: "invalid-end"
|
|
4173
|
-
};
|
|
4174
|
-
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
4175
|
-
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
4176
|
-
ok: false,
|
|
4177
|
-
reason: "invalid-end"
|
|
4178
|
-
};
|
|
4179
|
-
const spansMultipleDays = startDateKey < endDateKey;
|
|
4180
|
-
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
4181
|
-
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
4182
|
-
ok: false,
|
|
4183
|
-
reason: "non-positive-duration"
|
|
4184
|
-
};
|
|
4110
|
+
function proseLinkStyleToCssVars(style) {
|
|
4111
|
+
if (!style) return {};
|
|
4185
4112
|
return {
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
4195
|
-
}
|
|
4113
|
+
...style.colorToken ? { ["--rb-prose-link-color"]: rgbColorValue(style.colorToken) } : {},
|
|
4114
|
+
...style.hoverColorToken ? { ["--rb-prose-link-hover-color"]: rgbColorValue(style.hoverColorToken) } : {},
|
|
4115
|
+
...style.decorationColorToken ? { ["--rb-prose-link-decoration-color"]: rgbColorValue(style.decorationColorToken) } : {},
|
|
4116
|
+
...style.hoverDecorationColorToken ? { ["--rb-prose-link-hover-decoration-color"]: rgbColorValue(style.hoverDecorationColorToken) } : {},
|
|
4117
|
+
...style.underline != null ? { ["--rb-prose-link-decoration-line"]: style.underline ? "underline" : "none" } : {},
|
|
4118
|
+
...style.underlineStyle ? { ["--rb-prose-link-underline-style"]: style.underlineStyle } : {},
|
|
4119
|
+
...style.underlineThickness ? { ["--rb-prose-link-underline-thickness"]: mapProseLinkUnderlineThickness(style.underlineThickness) } : {},
|
|
4120
|
+
...style.underlineOffset ? { ["--rb-prose-link-underline-offset"]: mapProseLinkUnderlineOffset(style.underlineOffset) } : {}
|
|
4196
4121
|
};
|
|
4197
4122
|
}
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
continuesBefore: !isStartDay,
|
|
4213
|
-
continuesAfter: !isEndDay
|
|
4214
|
-
});
|
|
4123
|
+
/**
|
|
4124
|
+
* Generate structured block override CSS (separate from blockCustomVars).
|
|
4125
|
+
* This handles typed theme overrides, while blockCustomVars remains raw var passthrough.
|
|
4126
|
+
*/
|
|
4127
|
+
function generateBlockOverrideCss(themeId, theme) {
|
|
4128
|
+
const overrides = theme.blockOverrides;
|
|
4129
|
+
if (!overrides) return "";
|
|
4130
|
+
const cssBlocks = [];
|
|
4131
|
+
for (const [blockKind, blockOverride] of Object.entries(overrides)) {
|
|
4132
|
+
const blockSelectorKind = normalizeBlockKind(blockKind);
|
|
4133
|
+
const proseVars = proseLinkStyleToCssVars(blockOverride.typography?.proseLinkStyle);
|
|
4134
|
+
const declarations = Object.entries(proseVars).map(([key, value]) => ` ${key}: ${String(value)};`).join("\n");
|
|
4135
|
+
if (!declarations) continue;
|
|
4136
|
+
cssBlocks.push(`:where([data-theme-scope="${escapeAttrValue(themeId)}"]) :where([data-block="${escapeAttrValue(blockSelectorKind)}"]) {\n${declarations}\n}`);
|
|
4215
4137
|
}
|
|
4216
|
-
return
|
|
4138
|
+
return cssBlocks.join("\n");
|
|
4217
4139
|
}
|
|
4218
|
-
function
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4140
|
+
function escapeAttrValue(value) {
|
|
4141
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
4142
|
+
}
|
|
4143
|
+
function mapProseLinkUnderlineThickness(value) {
|
|
4144
|
+
switch (value) {
|
|
4145
|
+
case "fromFont": return "from-font";
|
|
4146
|
+
case "thin": return "1px";
|
|
4147
|
+
case "medium": return "2px";
|
|
4148
|
+
case "thick": return "3px";
|
|
4149
|
+
default: return "auto";
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
function mapProseLinkUnderlineOffset(value) {
|
|
4153
|
+
switch (value) {
|
|
4154
|
+
case "tight": return "0.08em";
|
|
4155
|
+
case "loose": return "0.2em";
|
|
4156
|
+
case "normal": return "0.14em";
|
|
4157
|
+
default: return "auto";
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
/**
|
|
4161
|
+
* Map input corners to CSS radius value for tier-2 input variables.
|
|
4162
|
+
* Falls back to theme corners if inputCorners is null.
|
|
4163
|
+
*/
|
|
4164
|
+
function mapInputRadius(inputCorners, themeFallback) {
|
|
4165
|
+
switch (inputCorners ?? themeFallback) {
|
|
4166
|
+
case "square": return "0";
|
|
4167
|
+
case "soft": return "0.25rem";
|
|
4168
|
+
case "rounded": return "0.5rem";
|
|
4169
|
+
case "pill": return "9999px";
|
|
4170
|
+
default: return "0.375rem";
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
/**
|
|
4174
|
+
* Normalize scale name to handle both old and new naming conventions.
|
|
4175
|
+
* Old names (minorThird, majorThird, perfectFourth) map to new names (compact, balanced, spacious).
|
|
4176
|
+
*/
|
|
4177
|
+
function normalizeScaleName(scale) {
|
|
4225
4178
|
return {
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
};
|
|
4179
|
+
minorThird: "compact",
|
|
4180
|
+
majorThird: "balanced",
|
|
4181
|
+
perfectFourth: "spacious",
|
|
4182
|
+
compact: "compact",
|
|
4183
|
+
balanced: "balanced",
|
|
4184
|
+
spacious: "spacious"
|
|
4185
|
+
}[scale] ?? "balanced";
|
|
4233
4186
|
}
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4187
|
+
/**
|
|
4188
|
+
* Compute base type scale sizes for headings.
|
|
4189
|
+
* Returns both static sizes and min/max for fluid typography.
|
|
4190
|
+
*/
|
|
4191
|
+
function computeTypeScale(scale, bodySize) {
|
|
4192
|
+
const base = {
|
|
4193
|
+
md: 16,
|
|
4194
|
+
lg: 17,
|
|
4195
|
+
xl: 18
|
|
4196
|
+
}[bodySize];
|
|
4197
|
+
const ratio = {
|
|
4198
|
+
compact: 1.2,
|
|
4199
|
+
balanced: 1.25,
|
|
4200
|
+
spacious: 1.333
|
|
4201
|
+
}[normalizeScaleName(scale)];
|
|
4202
|
+
const h3 = Math.round(base * ratio);
|
|
4203
|
+
const h2 = Math.round(h3 * ratio);
|
|
4204
|
+
const h1 = Math.round(h2 * ratio);
|
|
4205
|
+
const fluidMin = .7;
|
|
4206
|
+
const h2FluidMin = .9;
|
|
4207
|
+
const fluidMax = 1.3;
|
|
4238
4208
|
return {
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4209
|
+
["--fs-body"]: `${base}px`,
|
|
4210
|
+
["--fs-h3"]: `${h3}px`,
|
|
4211
|
+
["--fs-h2"]: `${h2}px`,
|
|
4212
|
+
["--fs-h1"]: `${h1}px`,
|
|
4213
|
+
["--fs-h1-min"]: `${Math.round(h1 * fluidMin)}px`,
|
|
4214
|
+
["--fs-h1-max"]: `${Math.round(h1 * fluidMax)}px`,
|
|
4215
|
+
["--fs-h2-min"]: `${Math.round(h2 * h2FluidMin)}px`,
|
|
4216
|
+
["--fs-h2-max"]: `${Math.round(h2 * fluidMax)}px`,
|
|
4217
|
+
["--fs-h3-min"]: `${Math.round(h3 * fluidMin)}px`,
|
|
4218
|
+
["--fs-h3-max"]: `${Math.round(h3 * fluidMax)}px`,
|
|
4219
|
+
["--fs-h1-fluid"]: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
4220
|
+
["--fs-h2-fluid"]: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
4221
|
+
["--fs-h3-fluid"]: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
4222
|
+
["--fs-h1-display"]: `${Math.round(h1 * 1.5)}px`,
|
|
4223
|
+
["--fs-h1-display-fluid"]: `clamp(${Math.round(h1 * fluidMin * 1.5)}px, calc(${Math.round(h1 * fluidMin * 1.5)}px + ${Math.round(h1 * (fluidMax - fluidMin) * 1.5)} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax * 1.5)}px)`
|
|
4252
4224
|
};
|
|
4253
4225
|
}
|
|
4254
|
-
|
|
4226
|
+
/**
|
|
4227
|
+
* Size scale multipliers for heading size overrides.
|
|
4228
|
+
* Expanded from md/lg/xl to xs through 2xl for finer control.
|
|
4229
|
+
*/
|
|
4230
|
+
const SIZE_SCALE_MAP = {
|
|
4231
|
+
xs: .85,
|
|
4232
|
+
sm: .925,
|
|
4233
|
+
md: 1,
|
|
4234
|
+
lg: 1.1,
|
|
4235
|
+
xl: 1.2,
|
|
4236
|
+
"2xl": 1.35
|
|
4237
|
+
};
|
|
4238
|
+
function applyHeadingSizeOverrides(base, typography) {
|
|
4239
|
+
const body = base["--fs-body"];
|
|
4240
|
+
const h1Base = parseFloat(base["--fs-h1"].replace("px", ""));
|
|
4241
|
+
const h2Base = parseFloat(base["--fs-h2"].replace("px", ""));
|
|
4242
|
+
const h3Base = parseFloat(base["--fs-h3"].replace("px", ""));
|
|
4243
|
+
const h1Scale = typography.headings.h1.size ? SIZE_SCALE_MAP[typography.headings.h1.size] : 1;
|
|
4244
|
+
const h2Scale = typography.headings.h2.size ? SIZE_SCALE_MAP[typography.headings.h2.size] : 1;
|
|
4245
|
+
const h3Scale = typography.headings.h3.size ? SIZE_SCALE_MAP[typography.headings.h3.size] : 1;
|
|
4246
|
+
const h1 = Math.round(h1Base * h1Scale);
|
|
4247
|
+
const h2 = Math.round(h2Base * h2Scale);
|
|
4248
|
+
const h3 = Math.round(h3Base * h3Scale);
|
|
4249
|
+
const fluidMin = .7;
|
|
4250
|
+
const h2FluidMin = .9;
|
|
4251
|
+
const fluidMax = 1.3;
|
|
4255
4252
|
return {
|
|
4256
|
-
|
|
4257
|
-
|
|
4253
|
+
body,
|
|
4254
|
+
h1: `${h1}px`,
|
|
4255
|
+
h2: `${h2}px`,
|
|
4256
|
+
h3: `${h3}px`,
|
|
4257
|
+
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
4258
|
+
h2Fluid: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
4259
|
+
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
4260
|
+
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
4261
|
+
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
4258
4262
|
};
|
|
4259
4263
|
}
|
|
4260
|
-
function
|
|
4261
|
-
if (segments.length === 0) return {
|
|
4262
|
-
startHour: bounds.defaultStartHour,
|
|
4263
|
-
endHour: bounds.defaultEndHour
|
|
4264
|
-
};
|
|
4265
|
-
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
4266
|
-
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
4267
|
-
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
4268
|
-
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
4264
|
+
function mapLetterSpacing(s) {
|
|
4269
4265
|
return {
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4266
|
+
tight: "-0.01em",
|
|
4267
|
+
normal: "0em",
|
|
4268
|
+
loose: "0.02em"
|
|
4269
|
+
}[s];
|
|
4270
|
+
}
|
|
4271
|
+
function mapEyebrowSize(s) {
|
|
4272
|
+
return {
|
|
4273
|
+
sm: "0.75rem",
|
|
4274
|
+
md: "0.875rem",
|
|
4275
|
+
lg: "1rem"
|
|
4276
|
+
}[s];
|
|
4273
4277
|
}
|
|
4274
|
-
function
|
|
4275
|
-
const startHour = Math.min(23, Math.max(0, Math.floor(hours.startHour)));
|
|
4278
|
+
function mapEyebrowLetterSpacing(s) {
|
|
4276
4279
|
return {
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
+
tight: "0em",
|
|
4281
|
+
normal: "0.025em",
|
|
4282
|
+
loose: "0.06em",
|
|
4283
|
+
wide: "0.12em"
|
|
4284
|
+
}[s];
|
|
4280
4285
|
}
|
|
4281
|
-
function
|
|
4282
|
-
|
|
4283
|
-
for (let hour = startHour; hour <= endHour; hour += 1) ticks.push(hour);
|
|
4284
|
-
return ticks;
|
|
4286
|
+
function mapEyebrowCase(c) {
|
|
4287
|
+
return c === "uppercase" ? "uppercase" : "none";
|
|
4285
4288
|
}
|
|
4286
|
-
function
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
}
|
|
4293
|
-
return grouped;
|
|
4289
|
+
function mapLineHeight(s) {
|
|
4290
|
+
return {
|
|
4291
|
+
normal: "1.5",
|
|
4292
|
+
relaxed: "1.65",
|
|
4293
|
+
loose: "1.8"
|
|
4294
|
+
}[s];
|
|
4294
4295
|
}
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4296
|
+
/**
|
|
4297
|
+
* Headings get their own line-height scale, decoupled from body. `mapLineHeight`
|
|
4298
|
+
* is floored at 1.5 (a body leading) which reads as too airy on headings — the
|
|
4299
|
+
* more so as size drops. These values sit well under 1.5 and let presets taper
|
|
4300
|
+
* per level (larger headings tighter). `tight`/`snug` extend the token set for
|
|
4301
|
+
* display headings; body keeps `mapLineHeight`.
|
|
4302
|
+
*/
|
|
4303
|
+
function mapHeadingLineHeight(s) {
|
|
4304
|
+
return {
|
|
4305
|
+
tight: "1.1",
|
|
4306
|
+
snug: "1.15",
|
|
4307
|
+
normal: "1.2",
|
|
4308
|
+
relaxed: "1.3",
|
|
4309
|
+
loose: "1.4"
|
|
4310
|
+
}[s];
|
|
4298
4311
|
}
|
|
4299
|
-
function
|
|
4300
|
-
if (
|
|
4301
|
-
return
|
|
4312
|
+
function mapTextTransform(c) {
|
|
4313
|
+
if (c === "uppercase") return "uppercase";
|
|
4314
|
+
return "none";
|
|
4302
4315
|
}
|
|
4303
|
-
function
|
|
4304
|
-
if (
|
|
4305
|
-
|
|
4306
|
-
parseDateKey(endDateKey);
|
|
4307
|
-
const keys = [];
|
|
4308
|
-
let cursor = start;
|
|
4309
|
-
while (formatDateKey(cursor) <= endDateKey) {
|
|
4310
|
-
keys.push(formatDateKey(cursor));
|
|
4311
|
-
cursor = addDays(cursor, 1);
|
|
4312
|
-
}
|
|
4313
|
-
return keys;
|
|
4316
|
+
function mapFontVariant(c) {
|
|
4317
|
+
if (c === "smallCaps") return "small-caps";
|
|
4318
|
+
return "normal";
|
|
4314
4319
|
}
|
|
4315
|
-
function
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4320
|
+
function mapFontStyle(italic) {
|
|
4321
|
+
return italic ? "italic" : "normal";
|
|
4322
|
+
}
|
|
4323
|
+
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4324
|
+
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4325
|
+
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4326
|
+
return generateAllBlockVarsCss({
|
|
4327
|
+
theme,
|
|
4328
|
+
themeId,
|
|
4329
|
+
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4330
|
+
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4331
|
+
});
|
|
4324
4332
|
}
|
|
4325
4333
|
//#endregion
|
|
4326
4334
|
//#region ../blocks/src/system/node/fragments/headingDecoration.ts
|
|
@@ -4490,262 +4498,6 @@ function selectEventDetailsCandidate(events, requested, nowIso) {
|
|
|
4490
4498
|
} : null;
|
|
4491
4499
|
}
|
|
4492
4500
|
//#endregion
|
|
4493
|
-
//#region ../blocks/src/system/blocks/events/shared/pageSelection.ts
|
|
4494
|
-
/**
|
|
4495
|
-
* What a system-managed Event URL actually selected.
|
|
4496
|
-
*
|
|
4497
|
-
* The resolver used to assume that one returned `PublicEvent` meant one
|
|
4498
|
-
* occurrence. A whole-series Event breaks that assumption in two directions: a
|
|
4499
|
-
* parent Event path selects nothing concrete until a run is chosen, and a run
|
|
4500
|
-
* path selects a run whose identity spans every one of its sessions. This
|
|
4501
|
-
* module parses those cases once, so the renderer switches over a closed set of
|
|
4502
|
-
* page states instead of probing booking scopes at render time.
|
|
4503
|
-
*
|
|
4504
|
-
* Everything here is pure. Loading events and resolving run slugs is the
|
|
4505
|
-
* resolver's job; deciding what the page is and which runs the chooser
|
|
4506
|
-
* advertises happens here. When a run is open to join, and where it sits in its
|
|
4507
|
-
* own life, come from `@riverbankcms/core`: the same authority the
|
|
4508
|
-
* public read projection and the write-side run-facts loader use, so a run
|
|
4509
|
-
* cannot report itself open on the storefront and closed at the point of
|
|
4510
|
-
* booking.
|
|
4511
|
-
*/
|
|
4512
|
-
function planWholeSeriesParentBooking(eligibleRuns) {
|
|
4513
|
-
const [first, second, ...rest] = eligibleRuns;
|
|
4514
|
-
if (!second) return {
|
|
4515
|
-
kind: "single",
|
|
4516
|
-
run: first
|
|
4517
|
-
};
|
|
4518
|
-
return eligibleRuns.every((group) => group.representative.allowsMultipleBooking) ? {
|
|
4519
|
-
kind: "bookTogether",
|
|
4520
|
-
runs: [
|
|
4521
|
-
first,
|
|
4522
|
-
second,
|
|
4523
|
-
...rest
|
|
4524
|
-
]
|
|
4525
|
-
} : {
|
|
4526
|
-
kind: "choice",
|
|
4527
|
-
runs: eligibleRuns
|
|
4528
|
-
};
|
|
4529
|
-
}
|
|
4530
|
-
function isOrdinaryPublicEvent(event) {
|
|
4531
|
-
return event.bookingScope === "single_occurrence";
|
|
4532
|
-
}
|
|
4533
|
-
/**
|
|
4534
|
-
* What a series' own page shows when its URL names no date.
|
|
4535
|
-
*
|
|
4536
|
-
* Two or more dates a visitor can book make a choice: the page lists every
|
|
4537
|
-
* date whose booking is open and lets the visitor pick, so a full date still
|
|
4538
|
-
* shows as full rather than vanishing. One bookable date isn't a choice, so the
|
|
4539
|
-
* page books that date. With none, the first date speaks for the page and shows
|
|
4540
|
-
* its own full or closed state.
|
|
4541
|
-
*
|
|
4542
|
-
* The caller passes every date it read for the series, not the cards a listing
|
|
4543
|
-
* happened to show, so the one-date shortcut is decided on the complete set.
|
|
4544
|
-
* "Has places" isn't enough on its own: only a date whose booking is open
|
|
4545
|
-
* counts, and a drop-in date never does.
|
|
4546
|
-
*/
|
|
4547
|
-
function planOrdinarySeriesSelection(events) {
|
|
4548
|
-
const ordinary = events.filter(isOrdinaryPublicEvent);
|
|
4549
|
-
const firstSeriesId = ordinary[0]?.seriesId;
|
|
4550
|
-
if (!firstSeriesId || ordinary.some((event) => event.seriesId !== firstSeriesId)) return null;
|
|
4551
|
-
const [first, second] = ordinary.filter(isBookableEvent);
|
|
4552
|
-
if (first && second) {
|
|
4553
|
-
const [a, b, ...rest] = [...ordinary].filter(isOpenForBooking).sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
|
|
4554
|
-
if (a && b) return {
|
|
4555
|
-
kind: "dateChoice",
|
|
4556
|
-
dates: [
|
|
4557
|
-
a,
|
|
4558
|
-
b,
|
|
4559
|
-
...rest
|
|
4560
|
-
]
|
|
4561
|
-
};
|
|
4562
|
-
}
|
|
4563
|
-
const event = first ?? ordinary[0];
|
|
4564
|
-
return event ? {
|
|
4565
|
-
kind: "occurrence",
|
|
4566
|
-
event
|
|
4567
|
-
} : null;
|
|
4568
|
-
}
|
|
4569
|
-
function isOpenForBooking(event) {
|
|
4570
|
-
return event.requiresRegistration && event.bookingAvailability.kind === "open";
|
|
4571
|
-
}
|
|
4572
|
-
/**
|
|
4573
|
-
* Whether a parent Event page advertises this run.
|
|
4574
|
-
*
|
|
4575
|
-
* Visibility admission belongs to the scoped public read. Active, still-open
|
|
4576
|
-
* admitted runs are advertised, and a run that has started,
|
|
4577
|
-
* finished or been cancelled is informational wherever it appears.
|
|
4578
|
-
*
|
|
4579
|
-
* Capacity is deliberately not consulted (decision A24/A30): a full date is
|
|
4580
|
-
* still one of the dates on offer, and its own page shows the full or waitlist
|
|
4581
|
-
* state that the registration engine decides. Hiding it here would leave a
|
|
4582
|
-
* visitor unable to see that the date exists at all.
|
|
4583
|
-
*/
|
|
4584
|
-
function resolveWholeSeriesChooserEligibility(group, now) {
|
|
4585
|
-
const status = group.representative.status;
|
|
4586
|
-
if (status !== void 0 && status !== "active") return {
|
|
4587
|
-
kind: "excluded",
|
|
4588
|
-
reason: "series-not-active"
|
|
4589
|
-
};
|
|
4590
|
-
const phase = resolveWholeSeriesBookingPhase(group.run, now);
|
|
4591
|
-
return phase.kind === "open" ? { kind: "eligible" } : {
|
|
4592
|
-
kind: "excluded",
|
|
4593
|
-
reason: phase.reason
|
|
4594
|
-
};
|
|
4595
|
-
}
|
|
4596
|
-
/**
|
|
4597
|
-
* Runs in the order a visitor reads them: soonest first session first.
|
|
4598
|
-
*
|
|
4599
|
-
* A run with no session left to attend has no place in the sequence, so it
|
|
4600
|
-
* sorts last rather than being given an arbitrary date.
|
|
4601
|
-
*/
|
|
4602
|
-
function orderRunsBySchedule(groups) {
|
|
4603
|
-
return [...groups].sort((left, right) => {
|
|
4604
|
-
const leftStart = firstLiveRunSessionStartMs(left.run.sessions);
|
|
4605
|
-
const rightStart = firstLiveRunSessionStartMs(right.run.sessions);
|
|
4606
|
-
if (leftStart === null) return rightStart === null ? 0 : 1;
|
|
4607
|
-
if (rightStart === null) return -1;
|
|
4608
|
-
return leftStart - rightStart;
|
|
4609
|
-
});
|
|
4610
|
-
}
|
|
4611
|
-
function asNonEmpty(groups) {
|
|
4612
|
-
const [first, ...rest] = groups;
|
|
4613
|
-
return first ? [first, ...rest] : null;
|
|
4614
|
-
}
|
|
4615
|
-
/**
|
|
4616
|
-
* What a parent Event path selects.
|
|
4617
|
-
*
|
|
4618
|
-
* The scoped read admits public and unlisted runs for the offering's own page.
|
|
4619
|
-
* The chooser lists the ones still open; when none is, the most recent
|
|
4620
|
-
* admitted run supplies the page's name and copy. Runs from another offering
|
|
4621
|
-
* cannot speak for this page.
|
|
4622
|
-
*/
|
|
4623
|
-
function planWholeSeriesParentSelection(input) {
|
|
4624
|
-
const offeringRuns = orderRunsBySchedule(groupPublicEventsByRun(input.events).filter((group) => group.run.eventOfferingId === input.offeringId));
|
|
4625
|
-
const eligibleRuns = asNonEmpty(offeringRuns.filter((group) => resolveWholeSeriesChooserEligibility(group, input.now).kind === "eligible"));
|
|
4626
|
-
if (eligibleRuns) return {
|
|
4627
|
-
kind: "wholeSeriesParent",
|
|
4628
|
-
admittedRuns: offeringRuns,
|
|
4629
|
-
offeringId: input.offeringId,
|
|
4630
|
-
eligibleRuns
|
|
4631
|
-
};
|
|
4632
|
-
const informationalRun = offeringRuns.at(-1);
|
|
4633
|
-
return informationalRun ? {
|
|
4634
|
-
kind: "wholeSeriesParentUnavailable",
|
|
4635
|
-
admittedRuns: offeringRuns,
|
|
4636
|
-
offeringId: input.offeringId,
|
|
4637
|
-
informationalRun,
|
|
4638
|
-
bookingClosedDetail: resolveParentBookingClosedDetail(offeringRuns, input.now)
|
|
4639
|
-
} : null;
|
|
4640
|
-
}
|
|
4641
|
-
/**
|
|
4642
|
-
* What a course page says when none of its runs is bookable.
|
|
4643
|
-
*
|
|
4644
|
-
* A run whose page is up without bookings carries its own reason, so the course
|
|
4645
|
-
* speaks for the runs it has: if any of them was live and has been taken
|
|
4646
|
-
* offline the course is closed for now, and otherwise it is waiting to open. A
|
|
4647
|
-
* course whose runs are simply cancelled, under way or finished carries no
|
|
4648
|
-
* reason at all, and the page keeps the words it already has for that.
|
|
4649
|
-
*
|
|
4650
|
-
* Only a run with a session still to come counts. A run that was paused a year
|
|
4651
|
-
* ago and whose dates have all passed says nothing about the course now, and
|
|
4652
|
-
* letting it speak would tell a visitor that a newly announced run is closed.
|
|
4653
|
-
*/
|
|
4654
|
-
function resolveParentBookingClosedDetail(runs, now) {
|
|
4655
|
-
const details = runs.flatMap((group) => {
|
|
4656
|
-
const detail = group.representative.bookingClosedDetail;
|
|
4657
|
-
return detail && hasSessionAhead(group, now) ? [detail] : [];
|
|
4658
|
-
});
|
|
4659
|
-
if (details.length === 0) return null;
|
|
4660
|
-
return details.some((detail) => detail.kind === "paused") ? { kind: "paused" } : { kind: "opensSoon" };
|
|
4661
|
-
}
|
|
4662
|
-
/** Whether the run still has a session a visitor could attend. */
|
|
4663
|
-
function hasSessionAhead(group, now) {
|
|
4664
|
-
return orderedLiveRunSessions(group.run.sessions).some((session) => Date.parse(session.startsAt) > now.getTime());
|
|
4665
|
-
}
|
|
4666
|
-
/** What a targeted run path selects, when the named run projected any data. */
|
|
4667
|
-
function planWholeSeriesRunSelection(input) {
|
|
4668
|
-
const group = groupPublicEventsByRun(input.events).find((candidate) => candidate.eventSeriesId === input.eventSeriesId);
|
|
4669
|
-
if (!group) return null;
|
|
4670
|
-
return {
|
|
4671
|
-
kind: "wholeSeriesRun",
|
|
4672
|
-
offeringId: group.run.eventOfferingId,
|
|
4673
|
-
run: group
|
|
4674
|
-
};
|
|
4675
|
-
}
|
|
4676
|
-
/**
|
|
4677
|
-
* The Event record that speaks for a selection.
|
|
4678
|
-
*
|
|
4679
|
-
* Page metadata, the destination mode and the shared presentation all need one
|
|
4680
|
-
* record; every variant has one, so callers never re-derive it.
|
|
4681
|
-
*/
|
|
4682
|
-
function selectionRepresentativeEvent(selection) {
|
|
4683
|
-
switch (selection.kind) {
|
|
4684
|
-
case "occurrence": return selection.event;
|
|
4685
|
-
case "dateChoice": return selection.dates[0];
|
|
4686
|
-
case "wholeSeriesParent": return selection.eligibleRuns[0].representative;
|
|
4687
|
-
case "wholeSeriesParentUnavailable": return selection.informationalRun.representative;
|
|
4688
|
-
case "wholeSeriesRun": return selection.run.representative;
|
|
4689
|
-
}
|
|
4690
|
-
}
|
|
4691
|
-
/**
|
|
4692
|
-
* Why this page is not taking bookings, when its own state says so.
|
|
4693
|
-
*
|
|
4694
|
-
* A parent course page answers for its runs; everything else answers for the
|
|
4695
|
-
* record the page is about. `null` leaves the booking column exactly as it was.
|
|
4696
|
-
*/
|
|
4697
|
-
function resolveSelectionBookingClosedDetail(selection) {
|
|
4698
|
-
switch (selection.kind) {
|
|
4699
|
-
case "occurrence": return selection.event.bookingClosedDetail ?? null;
|
|
4700
|
-
case "wholeSeriesRun": return selection.run.representative.bookingClosedDetail ?? null;
|
|
4701
|
-
case "dateChoice":
|
|
4702
|
-
case "wholeSeriesParent": return null;
|
|
4703
|
-
case "wholeSeriesParentUnavailable": return selection.bookingClosedDetail;
|
|
4704
|
-
}
|
|
4705
|
-
}
|
|
4706
|
-
function planDropInPanel(selection) {
|
|
4707
|
-
const detail = resolveSelectionBookingClosedDetail(selection);
|
|
4708
|
-
if (detail === null) return { kind: "comeAlong" };
|
|
4709
|
-
switch (detail.kind) {
|
|
4710
|
-
case "opensSoon":
|
|
4711
|
-
case "paused": return { kind: "notRunning" };
|
|
4712
|
-
}
|
|
4713
|
-
}
|
|
4714
|
-
function getPublicEventCanonicalPath(event) {
|
|
4715
|
-
if (event.path) return event.path;
|
|
4716
|
-
return event.destination.kind === "native" ? event.destination.path : null;
|
|
4717
|
-
}
|
|
4718
|
-
function eventOccurrenceContext(event) {
|
|
4719
|
-
return {
|
|
4720
|
-
id: event.occurrenceId,
|
|
4721
|
-
seriesId: event.seriesId,
|
|
4722
|
-
startsAt: event.startsAt,
|
|
4723
|
-
endsAt: event.endsAt,
|
|
4724
|
-
timeZone: event.timeZone,
|
|
4725
|
-
...event.occurrenceTitle ? { overrides: { title: event.occurrenceTitle } } : {}
|
|
4726
|
-
};
|
|
4727
|
-
}
|
|
4728
|
-
//#endregion
|
|
4729
|
-
//#region ../blocks/src/system/runtime/nodes/events/domain/location.ts
|
|
4730
|
-
function formatEventLocation(event) {
|
|
4731
|
-
switch (event.deliveryMode) {
|
|
4732
|
-
case "online": return "Online";
|
|
4733
|
-
case "hybrid": return event.venue ? `${event.venue.name} + online` : "Hybrid";
|
|
4734
|
-
case "in_person": return event.venue?.name ?? "In person";
|
|
4735
|
-
}
|
|
4736
|
-
}
|
|
4737
|
-
/** The line under the venue name. A booked-only venue shows its area, and the address follows the booking. */
|
|
4738
|
-
function eventVenuePlace(venue) {
|
|
4739
|
-
if (venue.addressWithBooking) return {
|
|
4740
|
-
place: venue.area ?? null,
|
|
4741
|
-
addressWithBooking: true
|
|
4742
|
-
};
|
|
4743
|
-
return {
|
|
4744
|
-
place: venue.address,
|
|
4745
|
-
addressWithBooking: false
|
|
4746
|
-
};
|
|
4747
|
-
}
|
|
4748
|
-
//#endregion
|
|
4749
4501
|
//#region ../blocks/src/system/runtime/shared/utils/bookingRoute.ts
|
|
4750
4502
|
const BOOK_TARGET_PARAMS = {
|
|
4751
4503
|
service: "service",
|
|
@@ -8290,14 +8042,22 @@ function membershipCoversEvent(args, event) {
|
|
|
8290
8042
|
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
8291
8043
|
}
|
|
8292
8044
|
/**
|
|
8045
|
+
* Whether a pass or membership could get someone into this event at all. Nobody
|
|
8046
|
+
* books an event that takes no bookings, and a free one has nothing to pay. A
|
|
8047
|
+
* tiered event whose tickets are all free isn't `free`: the dashboard treats it
|
|
8048
|
+
* as priced, and the server refuses to spend anything on a free ticket.
|
|
8049
|
+
*/
|
|
8050
|
+
function eventCanUseProducts(event) {
|
|
8051
|
+
return event.requiresRegistration !== false && event.pricing.kind !== "free";
|
|
8052
|
+
}
|
|
8053
|
+
/**
|
|
8293
8054
|
* Filter site passes to only those that cover the selected event.
|
|
8294
8055
|
*
|
|
8295
8056
|
* Public purchasable products are a pre-auth proxy for whether the pass path is
|
|
8296
8057
|
* worth advertising; owned pass eligibility is checked later after portal auth.
|
|
8297
8058
|
*/
|
|
8298
8059
|
function filterPassesForEvent(sitePasses, event) {
|
|
8299
|
-
if (!sitePasses || !event) return [];
|
|
8300
|
-
if (event.requiresRegistration === false) return [];
|
|
8060
|
+
if (!sitePasses || !event || !eventCanUseProducts(event)) return [];
|
|
8301
8061
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8302
8062
|
return sitePasses.filter((pass) => pass.productUseCase === "event_pass" && passCoversEvent({ eligibleCategoryIds: pass.eligibleCategoryIds }, {
|
|
8303
8063
|
acceptsPasses: event.acceptsPasses,
|
|
@@ -8312,8 +8072,7 @@ function filterPassesForEvent(sitePasses, event) {
|
|
|
8312
8072
|
* after portal auth.
|
|
8313
8073
|
*/
|
|
8314
8074
|
function filterMembershipsForEvent(siteMemberships, event) {
|
|
8315
|
-
if (!siteMemberships || !event) return [];
|
|
8316
|
-
if (event.requiresRegistration === false) return [];
|
|
8075
|
+
if (!siteMemberships || !event || !eventCanUseProducts(event)) return [];
|
|
8317
8076
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8318
8077
|
return siteMemberships.filter((membership) => membershipCoversEvent({ eligibleCategoryIds: membership.eligibleCategoryIds }, {
|
|
8319
8078
|
acceptsMemberships: event.acceptsMemberships,
|
|
@@ -8472,7 +8231,11 @@ function resolveEventDetailsPresentation(input) {
|
|
|
8472
8231
|
function wholeSeriesPriceOptions(pricing) {
|
|
8473
8232
|
return pricing.kind === "tiered" ? pricing.options.filter((option) => option.isActive) : [];
|
|
8474
8233
|
}
|
|
8475
|
-
|
|
8234
|
+
/** The price, with any deposit option said beside it. */
|
|
8235
|
+
function PriceLine({ price, depositNote }) {
|
|
8236
|
+
return /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: price }), depositNote ? `, ${depositNote}` : null] });
|
|
8237
|
+
}
|
|
8238
|
+
function WholeSeriesPricingDisplay({ pricing, depositNote, acceptedItems }) {
|
|
8476
8239
|
const options = wholeSeriesPriceOptions(pricing);
|
|
8477
8240
|
return /* @__PURE__ */ jsxs("div", {
|
|
8478
8241
|
className: "rb-mt-6",
|
|
@@ -8492,7 +8255,14 @@ function WholeSeriesPricingDisplay({ pricing, acceptedItems }) {
|
|
|
8492
8255
|
className: "rb-caption status-muted",
|
|
8493
8256
|
children: option.description
|
|
8494
8257
|
}) : null] }, option.id))
|
|
8495
|
-
}) : /* @__PURE__ */ jsx(
|
|
8258
|
+
}) : /* @__PURE__ */ jsx(PriceLine, {
|
|
8259
|
+
price: formatBookingPriceDisplay(publicEventPricingDisplay(pricing), { decimals: "auto" }),
|
|
8260
|
+
depositNote
|
|
8261
|
+
}),
|
|
8262
|
+
depositNote && options.length > 1 ? /* @__PURE__ */ jsxs("p", {
|
|
8263
|
+
className: "rb-caption rb-mt-1",
|
|
8264
|
+
children: [depositNote.charAt(0).toUpperCase(), depositNote.slice(1)]
|
|
8265
|
+
}) : null,
|
|
8496
8266
|
acceptedItems.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
8497
8267
|
className: "rb-caption rb-mt-1",
|
|
8498
8268
|
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
@@ -8515,7 +8285,7 @@ function TeamMemberName({ name, profilePath }) {
|
|
|
8515
8285
|
}) : /* @__PURE__ */ jsx("strong", { children: name });
|
|
8516
8286
|
}
|
|
8517
8287
|
function formatTicketTypePrice(ticketType, currency) {
|
|
8518
|
-
return
|
|
8288
|
+
return formatBookingPriceDisplay(resolveExactOrFreePriceDisplay(ticketType.priceAmount, currency), { decimals: "auto" });
|
|
8519
8289
|
}
|
|
8520
8290
|
function getDisplayablePricingOptions(event) {
|
|
8521
8291
|
return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).sort((left, right) => left.sortOrder - right.sortOrder) : [];
|
|
@@ -8533,7 +8303,7 @@ function TicketTypePriceList({ ticketTypes, currency }) {
|
|
|
8533
8303
|
}, ticketType.id))
|
|
8534
8304
|
});
|
|
8535
8305
|
}
|
|
8536
|
-
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8306
|
+
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, depositNote, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8537
8307
|
if (isDropIn) return /* @__PURE__ */ jsxs("div", {
|
|
8538
8308
|
className: "rb-mt-6",
|
|
8539
8309
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -8546,6 +8316,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8546
8316
|
});
|
|
8547
8317
|
if (wholeSeriesPricingDisplay) return /* @__PURE__ */ jsx(WholeSeriesPricingDisplay, {
|
|
8548
8318
|
pricing: wholeSeriesPricingDisplay,
|
|
8319
|
+
depositNote,
|
|
8549
8320
|
acceptedItems: [...acceptedItems]
|
|
8550
8321
|
});
|
|
8551
8322
|
if (eventCostLabel) return /* @__PURE__ */ jsxs("div", {
|
|
@@ -8555,7 +8326,10 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8555
8326
|
className: "rb-label rb-mb-2",
|
|
8556
8327
|
children: "Cost"
|
|
8557
8328
|
}),
|
|
8558
|
-
/* @__PURE__ */ jsx(
|
|
8329
|
+
/* @__PURE__ */ jsx(PriceLine, {
|
|
8330
|
+
price: eventCostLabel,
|
|
8331
|
+
depositNote
|
|
8332
|
+
}),
|
|
8559
8333
|
autoApplyDiscount && eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
|
|
8560
8334
|
className: "rb-caption rb-mt-1",
|
|
8561
8335
|
children: formatAutoApplyDiscountLine(autoApplyDiscount, eventPricingCurrency)
|
|
@@ -8578,7 +8352,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8578
8352
|
})
|
|
8579
8353
|
}) : null;
|
|
8580
8354
|
}
|
|
8581
|
-
function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8355
|
+
function EventFacts({ selection, selected, venue, online, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8582
8356
|
const { date, timeRange } = formatEventDateParts({
|
|
8583
8357
|
startsAt: selected.startsAt,
|
|
8584
8358
|
endsAt: selected.endsAt,
|
|
@@ -8600,7 +8374,10 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8600
8374
|
children: timeRange
|
|
8601
8375
|
})
|
|
8602
8376
|
] }),
|
|
8603
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8377
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8378
|
+
venue,
|
|
8379
|
+
online
|
|
8380
|
+
}),
|
|
8604
8381
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8605
8382
|
showCapacity && selected.capacity != null ? /* @__PURE__ */ jsxs("div", {
|
|
8606
8383
|
className: "rb-mt-6",
|
|
@@ -8617,8 +8394,26 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8617
8394
|
]
|
|
8618
8395
|
});
|
|
8619
8396
|
}
|
|
8620
|
-
|
|
8621
|
-
|
|
8397
|
+
const eventOnlinePlaceShown = (event, showVenue) => showVenue ? eventOnlinePlace(event) : null;
|
|
8398
|
+
/** An online event says so where a venue would go; a hybrid one adds it under the venue. */
|
|
8399
|
+
function EventVenueFact({ venue, online }) {
|
|
8400
|
+
if (!venue) {
|
|
8401
|
+
if (!online) return null;
|
|
8402
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8403
|
+
className: "rb-mt-6",
|
|
8404
|
+
children: [
|
|
8405
|
+
/* @__PURE__ */ jsx("div", {
|
|
8406
|
+
className: "rb-label rb-mb-2",
|
|
8407
|
+
children: "Venue"
|
|
8408
|
+
}),
|
|
8409
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: online.mode === "online" ? "Online" : "In person or online" }) }),
|
|
8410
|
+
online.note ? /* @__PURE__ */ jsx("p", {
|
|
8411
|
+
className: "rb-caption",
|
|
8412
|
+
children: online.note
|
|
8413
|
+
}) : null
|
|
8414
|
+
]
|
|
8415
|
+
});
|
|
8416
|
+
}
|
|
8622
8417
|
const { place, addressWithBooking } = eventVenuePlace(venue);
|
|
8623
8418
|
return /* @__PURE__ */ jsxs("div", {
|
|
8624
8419
|
className: "rb-mt-6",
|
|
@@ -8638,7 +8433,11 @@ function EventVenueFact({ venue }) {
|
|
|
8638
8433
|
}) : /* @__PURE__ */ jsx(LocationMapActions, {
|
|
8639
8434
|
location: venue.location,
|
|
8640
8435
|
addressText: venue.address
|
|
8641
|
-
})
|
|
8436
|
+
}),
|
|
8437
|
+
online ? /* @__PURE__ */ jsxs("p", {
|
|
8438
|
+
className: "rb-caption rb-mt-1",
|
|
8439
|
+
children: ["You can also join online.", online.note ? ` ${online.note}` : ""]
|
|
8440
|
+
}) : null
|
|
8642
8441
|
]
|
|
8643
8442
|
});
|
|
8644
8443
|
}
|
|
@@ -8790,21 +8589,27 @@ function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
|
|
|
8790
8589
|
}
|
|
8791
8590
|
/** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
|
|
8792
8591
|
function selectedEventPricing(event, showCost) {
|
|
8793
|
-
const isDropIn = event
|
|
8794
|
-
const wholeSeriesPricing = event
|
|
8795
|
-
const showEventCost = showCost &&
|
|
8592
|
+
const isDropIn = isDropInEvent(event);
|
|
8593
|
+
const wholeSeriesPricing = wholeSeriesPricingOf(event);
|
|
8594
|
+
const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
|
|
8796
8595
|
return {
|
|
8797
8596
|
isDropIn,
|
|
8798
8597
|
wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
|
|
8799
8598
|
eventCostLabel: showEventCost ? formatEventPrice(event) : null,
|
|
8599
|
+
depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
|
|
8800
8600
|
eventPricingCurrency: publicEventPricingCurrency(event.pricing),
|
|
8801
|
-
ticketTypes: showEventCost ? getDisplayablePricingOptions(event) : []
|
|
8601
|
+
ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
|
|
8802
8602
|
};
|
|
8803
8603
|
}
|
|
8604
|
+
const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
|
|
8605
|
+
const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
|
|
8606
|
+
const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
|
|
8607
|
+
const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
|
|
8804
8608
|
function SelectedEventDetailsView(props) {
|
|
8805
8609
|
const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props;
|
|
8806
8610
|
const selected = selection.selected;
|
|
8807
8611
|
const venue = showVenue ? selected.venue : void 0;
|
|
8612
|
+
const online = eventOnlinePlaceShown(selected, showVenue);
|
|
8808
8613
|
const pricing = selectedEventPricing(selected, props.showCost);
|
|
8809
8614
|
return /* @__PURE__ */ jsxs("div", {
|
|
8810
8615
|
className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
|
|
@@ -8822,6 +8627,7 @@ function SelectedEventDetailsView(props) {
|
|
|
8822
8627
|
selection,
|
|
8823
8628
|
selected,
|
|
8824
8629
|
venue,
|
|
8630
|
+
online,
|
|
8825
8631
|
showCapacity,
|
|
8826
8632
|
teamMembers: selected.teamMembers ?? [],
|
|
8827
8633
|
pricing: /* @__PURE__ */ jsx(EventPricingDetails, {
|
|
@@ -8914,11 +8720,14 @@ function EventHeaderPanel(props) {
|
|
|
8914
8720
|
})
|
|
8915
8721
|
});
|
|
8916
8722
|
}
|
|
8917
|
-
function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
8723
|
+
function HeaderPanelFacts({ venue, online, teamMembers, pricing }) {
|
|
8918
8724
|
return /* @__PURE__ */ jsxs("div", {
|
|
8919
8725
|
className: "rb-flex rb-flex-col rb-gap-4",
|
|
8920
8726
|
children: [
|
|
8921
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8727
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8728
|
+
venue,
|
|
8729
|
+
online
|
|
8730
|
+
}),
|
|
8922
8731
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8923
8732
|
pricing ? /* @__PURE__ */ jsx(EventPricingDetails, { ...pricing }) : null
|
|
8924
8733
|
]
|
|
@@ -8928,15 +8737,17 @@ function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
|
8928
8737
|
function headerPanelContent(props) {
|
|
8929
8738
|
const { selection } = props;
|
|
8930
8739
|
const venue = props.showVenue ? selection.selected.venue : void 0;
|
|
8740
|
+
const online = eventOnlinePlaceShown(selection.selected, props.showVenue);
|
|
8931
8741
|
const teamMembers = selection.selected.teamMembers ?? [];
|
|
8932
8742
|
const pricing = headerPanelPricing(props, selection.selected);
|
|
8933
8743
|
const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
|
|
8934
8744
|
return {
|
|
8935
8745
|
venue,
|
|
8746
|
+
online,
|
|
8936
8747
|
teamMembers,
|
|
8937
8748
|
pricing,
|
|
8938
8749
|
hasMap: Boolean(props.showMap && venue && props.selectedVenueDrawing),
|
|
8939
|
-
hasFacts: Boolean(venue) || teamMembers.length > 0 || pricing !== null,
|
|
8750
|
+
hasFacts: Boolean(venue) || online !== null || teamMembers.length > 0 || pricing !== null,
|
|
8940
8751
|
hasDates: props.showOtherDates && scheduled > 0
|
|
8941
8752
|
};
|
|
8942
8753
|
}
|
|
@@ -8950,6 +8761,7 @@ function headerPanelPricing(props, event) {
|
|
|
8950
8761
|
if (pricing.isDropIn) return null;
|
|
8951
8762
|
const detail = {
|
|
8952
8763
|
...pricing,
|
|
8764
|
+
depositNote: null,
|
|
8953
8765
|
acceptedItems: acceptedProductNames(props),
|
|
8954
8766
|
autoApplyDiscount: props.autoApplyDiscount ?? null
|
|
8955
8767
|
};
|
|
@@ -10909,120 +10721,168 @@ function CheckoutSSR({ blockId, siteId, apiBaseUrl, stage, demoEmailSuppressed,
|
|
|
10909
10721
|
});
|
|
10910
10722
|
}
|
|
10911
10723
|
//#endregion
|
|
10724
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
10725
|
+
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
10726
|
+
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
10727
|
+
function giftingSlot(look, slot) {
|
|
10728
|
+
return listLookSlot(look ?? {}, slot);
|
|
10729
|
+
}
|
|
10730
|
+
/** The word above the heading: only one kind on offer names it here, two kinds label their own groups. */
|
|
10731
|
+
function giftingEyebrow(offers, headings) {
|
|
10732
|
+
const giftCards = offers?.giftCards.length ?? 0;
|
|
10733
|
+
const vouchers = offers?.vouchers.length ?? 0;
|
|
10734
|
+
if (giftCards > 0 && vouchers === 0) return headings.giftCards;
|
|
10735
|
+
if (vouchers > 0 && giftCards === 0) return headings.vouchers;
|
|
10736
|
+
return null;
|
|
10737
|
+
}
|
|
10738
|
+
function GiftingPanelHead(props) {
|
|
10739
|
+
const { look } = props;
|
|
10740
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10741
|
+
className: "gifting-panel-head",
|
|
10742
|
+
...giftingSlot(look, "head"),
|
|
10743
|
+
children: [
|
|
10744
|
+
props.eyebrow ? /* @__PURE__ */ jsx("span", {
|
|
10745
|
+
className: "gifting-eyebrow",
|
|
10746
|
+
...giftingSlot(look, "eyebrow"),
|
|
10747
|
+
children: props.eyebrow
|
|
10748
|
+
}) : null,
|
|
10749
|
+
/* @__PURE__ */ jsx("h2", {
|
|
10750
|
+
className: "gifting-heading",
|
|
10751
|
+
...giftingSlot(look, "heading"),
|
|
10752
|
+
children: props.heading
|
|
10753
|
+
}),
|
|
10754
|
+
props.intro ? /* @__PURE__ */ jsx("p", {
|
|
10755
|
+
className: "gifting-intro",
|
|
10756
|
+
...giftingSlot(look, "intro"),
|
|
10757
|
+
children: props.intro
|
|
10758
|
+
}) : null
|
|
10759
|
+
]
|
|
10760
|
+
});
|
|
10761
|
+
}
|
|
10762
|
+
/** Amount buttons are radios, so they keep working from the keyboard and post with the form. */
|
|
10763
|
+
function GiftCardAmounts(props) {
|
|
10764
|
+
const { offer, currency, disabled, onChoose } = props;
|
|
10765
|
+
const denominations = offer.giftCard.fixedDenominations;
|
|
10766
|
+
const checkedChoice = props.initialChoice ?? firstGiftAmountChoice(offer);
|
|
10767
|
+
const chip = (value, label) => /* @__PURE__ */ jsxs("label", {
|
|
10768
|
+
className: "gifting-amount",
|
|
10769
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
10770
|
+
type: "radio",
|
|
10771
|
+
name: props.groupName ?? "amountChoice",
|
|
10772
|
+
value,
|
|
10773
|
+
required: true,
|
|
10774
|
+
disabled,
|
|
10775
|
+
defaultChecked: value === checkedChoice,
|
|
10776
|
+
onChange: onChoose ? () => onChoose(value) : void 0
|
|
10777
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
10778
|
+
...giftingSlot(props.look, "chip"),
|
|
10779
|
+
children: label
|
|
10780
|
+
})]
|
|
10781
|
+
}, value);
|
|
10782
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
10783
|
+
className: "gifting-amounts",
|
|
10784
|
+
...giftingSlot(props.look, "chips"),
|
|
10785
|
+
children: [
|
|
10786
|
+
/* @__PURE__ */ jsx("legend", {
|
|
10787
|
+
className: "gifting-visually-hidden",
|
|
10788
|
+
children: "Amount"
|
|
10789
|
+
}),
|
|
10790
|
+
denominations.map((amount) => chip(String(amount), formatCurrencyAmount(amount, currency))),
|
|
10791
|
+
offer.giftCard.customAmountEnabled ? chip(CUSTOM_GIFT_AMOUNT, "Another amount") : null
|
|
10792
|
+
]
|
|
10793
|
+
});
|
|
10794
|
+
}
|
|
10795
|
+
function firstGiftAmountChoice(offer) {
|
|
10796
|
+
const first = offer.giftCard.fixedDenominations[0];
|
|
10797
|
+
return first === void 0 ? CUSTOM_GIFT_AMOUNT : String(first);
|
|
10798
|
+
}
|
|
10799
|
+
//#endregion
|
|
10912
10800
|
//#region ../blocks/src/system/runtime/nodes/gifting.server.tsx
|
|
10801
|
+
/** What shows until the island takes over: the same panel, with the details form still closed. */
|
|
10913
10802
|
function GiftingSSR({ blockId, ...rest }) {
|
|
10914
10803
|
const islandProps = buildGiftingInteractiveIslandProps(rest);
|
|
10915
|
-
const
|
|
10916
|
-
const
|
|
10804
|
+
const { display, hydration } = islandProps.render;
|
|
10805
|
+
const offers = hydration.offers;
|
|
10806
|
+
const giftCards = offers?.giftCards ?? [];
|
|
10807
|
+
const vouchers = offers?.vouchers ?? [];
|
|
10808
|
+
const hasOffers = giftCards.length > 0 || vouchers.length > 0;
|
|
10809
|
+
const eyebrow = giftingEyebrow(offers, {
|
|
10810
|
+
giftCards: display.giftCardsHeading,
|
|
10811
|
+
vouchers: display.vouchersHeading
|
|
10812
|
+
});
|
|
10917
10813
|
return /* @__PURE__ */ jsx(IslandRoot, {
|
|
10918
10814
|
kind: "gifting",
|
|
10919
10815
|
id: blockId,
|
|
10920
10816
|
as: "section",
|
|
10921
10817
|
attributes: {
|
|
10922
10818
|
className: rest.className ?? void 0,
|
|
10923
|
-
"data-block": "gifting"
|
|
10924
|
-
style: { color: "rgb(var(--tb-text, 17 24 39))" }
|
|
10819
|
+
"data-block": "gifting"
|
|
10925
10820
|
},
|
|
10926
10821
|
value: islandProps,
|
|
10927
10822
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10928
|
-
className: "
|
|
10929
|
-
|
|
10930
|
-
children: [/* @__PURE__ */
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
fontSize: "clamp(1.75rem, 3vw, 2.5rem)",
|
|
10936
|
-
fontWeight: 700,
|
|
10937
|
-
margin: 0
|
|
10938
|
-
},
|
|
10939
|
-
children: islandProps.render.display.heading
|
|
10940
|
-
}), islandProps.render.display.intro ? /* @__PURE__ */ jsx("p", {
|
|
10941
|
-
style: {
|
|
10942
|
-
margin: 0,
|
|
10943
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
10944
|
-
},
|
|
10945
|
-
children: islandProps.render.display.intro
|
|
10946
|
-
}) : null]
|
|
10823
|
+
className: "gifting-panel",
|
|
10824
|
+
...giftingSlot(display, "panel"),
|
|
10825
|
+
children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
10826
|
+
eyebrow,
|
|
10827
|
+
heading: display.heading,
|
|
10828
|
+
intro: display.intro,
|
|
10829
|
+
look: display
|
|
10947
10830
|
}), hasOffers ? /* @__PURE__ */ jsxs("div", {
|
|
10948
|
-
className: "
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
},
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
style: {
|
|
11001
|
-
border: "1px solid rgb(var(--tb-text, 17 24 39) / 0.12)",
|
|
11002
|
-
borderRadius: "1rem",
|
|
11003
|
-
padding: "1rem",
|
|
11004
|
-
background: "rgb(var(--tb-surface, 255 255 255) / 0.92)"
|
|
11005
|
-
},
|
|
11006
|
-
children: [/* @__PURE__ */ jsx("h4", {
|
|
11007
|
-
style: {
|
|
11008
|
-
margin: 0,
|
|
11009
|
-
fontSize: "1.05rem",
|
|
11010
|
-
fontWeight: 700
|
|
11011
|
-
},
|
|
11012
|
-
children: offer.title
|
|
11013
|
-
}), offer.description ? /* @__PURE__ */ jsx("p", {
|
|
11014
|
-
style: {
|
|
11015
|
-
margin: "0.5rem 0 0",
|
|
11016
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
11017
|
-
},
|
|
11018
|
-
children: offer.description
|
|
11019
|
-
}) : null]
|
|
11020
|
-
}, offer.id))
|
|
11021
|
-
})]
|
|
11022
|
-
}) : null]
|
|
10831
|
+
className: "gifting-panel-offers",
|
|
10832
|
+
children: [giftCards.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10833
|
+
className: "gifting-offer",
|
|
10834
|
+
"data-gift-offer": offer.id,
|
|
10835
|
+
children: [
|
|
10836
|
+
giftCards.length > 1 ? /* @__PURE__ */ jsx("h3", {
|
|
10837
|
+
className: "gifting-offer-title",
|
|
10838
|
+
children: offer.title
|
|
10839
|
+
}) : null,
|
|
10840
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10841
|
+
className: "gifting-offer-description",
|
|
10842
|
+
children: offer.description
|
|
10843
|
+
}) : null,
|
|
10844
|
+
/* @__PURE__ */ jsxs("div", {
|
|
10845
|
+
className: "gifting-offer-row",
|
|
10846
|
+
"data-gift-offer-row": "",
|
|
10847
|
+
children: [/* @__PURE__ */ jsx(GiftCardAmounts, {
|
|
10848
|
+
offer,
|
|
10849
|
+
currency: offers?.currency ?? "GBP",
|
|
10850
|
+
groupName: `amountChoice-${offer.id}`,
|
|
10851
|
+
look: display
|
|
10852
|
+
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
10853
|
+
...giftingSlot(display, "action"),
|
|
10854
|
+
type: "button",
|
|
10855
|
+
variant: "primary",
|
|
10856
|
+
size: "md",
|
|
10857
|
+
extraClassName: "gifting-buy",
|
|
10858
|
+
label: "Buy a gift card"
|
|
10859
|
+
})]
|
|
10860
|
+
})
|
|
10861
|
+
]
|
|
10862
|
+
}, offer.id)), vouchers.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10863
|
+
className: "gifting-offer",
|
|
10864
|
+
children: [
|
|
10865
|
+
/* @__PURE__ */ jsx("h3", {
|
|
10866
|
+
className: "gifting-offer-title",
|
|
10867
|
+
children: offer.title
|
|
10868
|
+
}),
|
|
10869
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10870
|
+
className: "gifting-offer-description",
|
|
10871
|
+
children: offer.description
|
|
10872
|
+
}) : null,
|
|
10873
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
10874
|
+
...giftingSlot(display, "action"),
|
|
10875
|
+
type: "button",
|
|
10876
|
+
variant: "primary",
|
|
10877
|
+
size: "md",
|
|
10878
|
+
extraClassName: "gifting-buy",
|
|
10879
|
+
label: "Buy this voucher"
|
|
10880
|
+
})
|
|
10881
|
+
]
|
|
10882
|
+
}, offer.id))]
|
|
11023
10883
|
}) : /* @__PURE__ */ jsx("p", {
|
|
11024
|
-
|
|
11025
|
-
children:
|
|
10884
|
+
className: "gifting-empty",
|
|
10885
|
+
children: display.emptyStateText
|
|
11026
10886
|
})]
|
|
11027
10887
|
})
|
|
11028
10888
|
});
|
|
@@ -11356,6 +11216,10 @@ const WeekAgendaView = ({ days, events, showCapacity, showVenue = true, emptyMes
|
|
|
11356
11216
|
});
|
|
11357
11217
|
};
|
|
11358
11218
|
//#endregion
|
|
11219
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarLoadFailure.tsx
|
|
11220
|
+
/** The same words on the calendar and the week board. */
|
|
11221
|
+
const CALENDAR_LOAD_FAILURE_MESSAGE = "We couldn’t load the events for these dates.";
|
|
11222
|
+
//#endregion
|
|
11359
11223
|
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
|
|
11360
11224
|
function CalendarNavigationChevron({ direction }) {
|
|
11361
11225
|
return /* @__PURE__ */ jsx("svg", {
|
|
@@ -11517,7 +11381,7 @@ const WeekBoardLoadError = ({ navigation, buttonVariant }) => {
|
|
|
11517
11381
|
return /* @__PURE__ */ jsxs("div", {
|
|
11518
11382
|
className: "event-week-board-error",
|
|
11519
11383
|
role: "status",
|
|
11520
|
-
children: [/* @__PURE__ */ jsx("p", { children:
|
|
11384
|
+
children: [/* @__PURE__ */ jsx("p", { children: CALENDAR_LOAD_FAILURE_MESSAGE }), /* @__PURE__ */ jsx(ThemedButton, {
|
|
11521
11385
|
type: "button",
|
|
11522
11386
|
variant: buttonVariant,
|
|
11523
11387
|
size: "sm",
|
|
@@ -12125,6 +11989,16 @@ function EventBookingPanelView({ panel, pageKind, children }) {
|
|
|
12125
11989
|
function EventBookingPanelBody({ panel }) {
|
|
12126
11990
|
switch (panel.kind) {
|
|
12127
11991
|
case "registration": return null;
|
|
11992
|
+
case "cancelled": return /* @__PURE__ */ jsxs("div", {
|
|
11993
|
+
className: "event-booking-panel__cancelled",
|
|
11994
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
11995
|
+
className: "card-title rb-mb-3",
|
|
11996
|
+
children: cancelledDateCopy.titleText
|
|
11997
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
11998
|
+
className: "status-muted rb-text-base rb-leading-relaxed",
|
|
11999
|
+
children: cancelledDateCopy.bodyText
|
|
12000
|
+
})]
|
|
12001
|
+
});
|
|
12128
12002
|
case "dropIn": return /* @__PURE__ */ jsx(DropInPanel, { panel: panel.panel });
|
|
12129
12003
|
case "bookingClosed": return /* @__PURE__ */ jsx(BookingClosedPanel, { detail: panel.detail });
|
|
12130
12004
|
case "closedRun": return /* @__PURE__ */ jsx(ClosedRunPanel, { reason: panel.reason });
|
|
@@ -12144,6 +12018,7 @@ function EventBookingPanelBody({ panel }) {
|
|
|
12144
12018
|
}
|
|
12145
12019
|
function SingleDateBooking({ run }) {
|
|
12146
12020
|
const href = getPublicEventCanonicalPath(run.representative);
|
|
12021
|
+
const coversAll = wholeCourseNote(run);
|
|
12147
12022
|
return /* @__PURE__ */ jsxs("div", {
|
|
12148
12023
|
className: "event-booking-panel__single-date",
|
|
12149
12024
|
children: [
|
|
@@ -12151,9 +12026,9 @@ function SingleDateBooking({ run }) {
|
|
|
12151
12026
|
className: "card-title rb-mb-3",
|
|
12152
12027
|
children: "Book your place"
|
|
12153
12028
|
}),
|
|
12154
|
-
/* @__PURE__ */
|
|
12029
|
+
/* @__PURE__ */ jsxs("p", {
|
|
12155
12030
|
className: "event-booking-panel__run-dates status-muted rb-mb-4 rb-text-base rb-leading-relaxed",
|
|
12156
|
-
children: describeRun(run)
|
|
12031
|
+
children: [describeRun(run), coversAll ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("br", {}), coversAll] }) : null]
|
|
12157
12032
|
}),
|
|
12158
12033
|
href ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
12159
12034
|
variant: "primary",
|
|
@@ -12247,11 +12122,11 @@ function RunChooser({ runs }) {
|
|
|
12247
12122
|
})]
|
|
12248
12123
|
});
|
|
12249
12124
|
}
|
|
12250
|
-
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. */
|
|
12125
|
+
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. Cancelled sessions aren't counted. */
|
|
12251
12126
|
function describeRun(run) {
|
|
12252
|
-
const
|
|
12253
|
-
const
|
|
12254
|
-
const
|
|
12127
|
+
const sessions = orderedLiveRunSessions(run.run.sessions);
|
|
12128
|
+
const first = sessions[0];
|
|
12129
|
+
const sessionLabel = sessionCountLabel(sessions.length);
|
|
12255
12130
|
if (!first) return sessionLabel;
|
|
12256
12131
|
return `${sessionLabel} from ${formatDate$1({
|
|
12257
12132
|
kind: "instant",
|
|
@@ -12264,6 +12139,12 @@ function describeRun(run) {
|
|
|
12264
12139
|
weekday: "long"
|
|
12265
12140
|
})}`;
|
|
12266
12141
|
}
|
|
12142
|
+
const sessionCountLabel = (count) => count === 1 ? "1 session" : `${count} sessions`;
|
|
12143
|
+
/** Said before booking, as the first step of booking says it: one place covers the whole course. */
|
|
12144
|
+
function wholeCourseNote(run) {
|
|
12145
|
+
const count = orderedLiveRunSessions(run.run.sessions).length;
|
|
12146
|
+
return count > 1 ? `One booking covers all ${count} sessions.` : null;
|
|
12147
|
+
}
|
|
12267
12148
|
//#endregion
|
|
12268
12149
|
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingPanelSelection.ts
|
|
12269
12150
|
/** Adapt a loaded page surface to the existing page planners. Catalogues keep their picker. */
|
|
@@ -12322,6 +12203,10 @@ function selectOccurrenceForPanel(events, occurrenceId) {
|
|
|
12322
12203
|
} : null;
|
|
12323
12204
|
}
|
|
12324
12205
|
function planEventBookingPanel({ selection, subject }, now) {
|
|
12206
|
+
if (isCancelledDateSelection(selection)) return {
|
|
12207
|
+
kind: "cancelled",
|
|
12208
|
+
registration: null
|
|
12209
|
+
};
|
|
12325
12210
|
const nonBookingPanel = planNonBookingPanel(selection);
|
|
12326
12211
|
switch (selection.kind) {
|
|
12327
12212
|
case "occurrence":
|
|
@@ -12397,6 +12282,10 @@ function selectionRegistrationTarget(selection, subject) {
|
|
|
12397
12282
|
};
|
|
12398
12283
|
}
|
|
12399
12284
|
}
|
|
12285
|
+
/** Cancelled dates have no new-booking or recovery form, including old direct links. */
|
|
12286
|
+
function isCancelledDateSelection(selection) {
|
|
12287
|
+
return selection.kind === "occurrence" && hasCancelledRegistrationDate([selection.event]);
|
|
12288
|
+
}
|
|
12400
12289
|
//#endregion
|
|
12401
12290
|
//#region ../blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.tsx
|
|
12402
12291
|
function RegistrationClosedState({ title, body }) {
|
|
@@ -13191,14 +13080,14 @@ function NewsletterSubmitRow({ emailField, lookSlots, buttonVariant, buttonLabel
|
|
|
13191
13080
|
});
|
|
13192
13081
|
}
|
|
13193
13082
|
/** Visitor-chosen topics as toggle chips. Real checkboxes underneath. */
|
|
13194
|
-
function NewsletterTopicChips({ choices, disabled, error }) {
|
|
13083
|
+
function NewsletterTopicChips({ choices, question, disabled, error }) {
|
|
13195
13084
|
const errorId = `newsletter_${TOPIC_CHOICE_FIELD_ID}-error`;
|
|
13196
13085
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("fieldset", {
|
|
13197
13086
|
className: "newsletter-topics",
|
|
13198
13087
|
"aria-describedby": error ? errorId : void 0,
|
|
13199
13088
|
children: [/* @__PURE__ */ jsx("legend", {
|
|
13200
13089
|
className: "newsletter-topics-legend",
|
|
13201
|
-
children:
|
|
13090
|
+
children: question
|
|
13202
13091
|
}), /* @__PURE__ */ jsx("div", {
|
|
13203
13092
|
className: "newsletter-topic-chips",
|
|
13204
13093
|
children: choices.map((choice) => /* @__PURE__ */ jsxs("label", {
|
|
@@ -13271,7 +13160,10 @@ function NewsletterFormSSR(props) {
|
|
|
13271
13160
|
className: "newsletter-form-fields",
|
|
13272
13161
|
...listLookSlot(display, "grid"),
|
|
13273
13162
|
children: [
|
|
13274
|
-
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13163
|
+
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13164
|
+
choices: display.choices,
|
|
13165
|
+
question: display.topicsQuestion
|
|
13166
|
+
}) : null,
|
|
13275
13167
|
extraFields.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
13276
13168
|
className: "newsletter-extra-fields",
|
|
13277
13169
|
...listLookSlot(display, "items"),
|
|
@@ -14567,8 +14459,10 @@ function bindItemSurfacePresentation(node, context) {
|
|
|
14567
14459
|
if (!isPlainObject(content) || !isPlainObject(content._effectiveLook)) return context;
|
|
14568
14460
|
const look = content._effectiveLook;
|
|
14569
14461
|
if (!look.surfacePresentation) return context;
|
|
14570
|
-
const
|
|
14571
|
-
const
|
|
14462
|
+
const itemScope = context.scopes.reduce((found, scope) => scope.repeater ? scope : found, void 0);
|
|
14463
|
+
const repeater = itemScope?.repeater;
|
|
14464
|
+
const featured = isPlainObject(itemScope?.value) && itemScope.value.featured === true;
|
|
14465
|
+
const role = repeater ? itemRole(repeater.index, repeater.count, look.itemRoles, featured) : void 0;
|
|
14572
14466
|
return {
|
|
14573
14467
|
...context,
|
|
14574
14468
|
surfacePresentation: selectItemSurfacePresentation(look.surfacePresentation, role)
|
|
@@ -15813,13 +15707,15 @@ function prepareEntry(entry, input) {
|
|
|
15813
15707
|
}
|
|
15814
15708
|
}
|
|
15815
15709
|
/**
|
|
15816
|
-
* Editor admission validates
|
|
15817
|
-
* proof.
|
|
15710
|
+
* Editor admission validates what the owner still decides, without minting a
|
|
15711
|
+
* renderable proof. The Look's decisions are not authoring choices (a frame's
|
|
15712
|
+
* 4/5 is not on the block's ratio list), so the preview renders them unvalidated,
|
|
15713
|
+
* as a public page does, and a hidden stale value can't block it. Returns `null`
|
|
15714
|
+
* when even relaxed validation rejects the draft.
|
|
15818
15715
|
*/
|
|
15819
15716
|
function previewableEditorContent(entry) {
|
|
15820
15717
|
if (entry.block.presentationAdmission.kind !== "editor") return entry.renderableContent;
|
|
15821
|
-
|
|
15822
|
-
return draft.kind === "previewable" ? draft.data : null;
|
|
15718
|
+
return validateManifestDraft(compileManifestContentContract(entry.definition.manifest), entry.ownerEditableContent).kind === "previewable" ? entry.renderableContent : null;
|
|
15823
15719
|
}
|
|
15824
15720
|
function buildPreparedContent(entry, content, input) {
|
|
15825
15721
|
const { dataContext } = input;
|