@riverbankcms/sdk 0.166.0 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +5 -0
- package/dist/_dts/{BlocksIslandsHydrator-CPvN6RBW.d.ts → BlocksIslandsHydrator-CiD_VVGM.d.ts} +1 -1
- package/dist/_dts/{Page-rW0xgQCA.d.ts → Page-Bj6VJRS5.d.ts} +9 -8
- package/dist/_dts/{SdkPreviewMode-BWZh2WCk.d.ts → SdkPreviewMode-ChpsnwDX.d.ts} +2 -2
- package/dist/_dts/{client-D4BXQEZc.d.ts → client-C8mfUxrJ.d.ts} +73 -35
- package/dist/_dts/{content-types-MUzta0l9.d.ts → content-types-_vXZyR4H.d.ts} +2 -2
- package/dist/_dts/{contracts-Cl9Xh1DO.d.ts → contracts-CJFfrVKU.d.ts} +9 -5
- package/dist/_dts/{footerPageOutline-4BgLKehl.d.ts → footerPageOutline-CMegb23G.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-BsmJ0qKh.d.ts → generatePageMetadata-D9YdAIMh.d.ts} +2 -2
- package/dist/_dts/{index-DdcwPqQN.d.ts → index-BQXaZ7aY.d.ts} +4 -4
- package/dist/_dts/{index-ahxQCUc7.d.ts → index-Bpr-wT5k.d.ts} +2 -2
- package/dist/_dts/{index--qflsCiy.d.ts → index-C7_Rz8EY.d.ts} +3 -3
- package/dist/_dts/{index-kQ5xkM6X.d.ts → index-Cx2BQlHL.d.ts} +3 -3
- package/dist/_dts/{index-Bmboeb49.d.ts → index-Dgz6yhsy.d.ts} +1 -1
- package/dist/_dts/index-Vh8B9FSa.d.ts +14 -0
- package/dist/_dts/{index-BgJ2aU5c.d.ts → index-vR3p9Bu-.d.ts} +2 -2
- package/dist/_dts/{loadContent-BG5IAV-V.d.ts → loadContent-dhWSgLeS.d.ts} +7 -7
- package/dist/_dts/previewCompiler-BVVgDSdq.d.ts +1 -0
- package/dist/_dts/{index-wbBZ0awa.d.ts → request-BrYhNV9Z.d.ts} +81287 -47810
- package/dist/_dts/{resolveBlockData-Cmcle_zV.d.ts → resolveBlockData-BfSHm8Ms.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-BRJUTFoH.d.ts → resolvePageContent-gZJ4i1wN.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/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 +6 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- 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 +1 -1
- 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 +7 -5
- 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 +1 -1
- package/dist/_dts/{types-BX3Y-EW3.d.ts → types-BB33-Spd.d.ts} +3 -3
- package/dist/_dts/{types-DF54stxv.d.ts → types-BVFXYtRg.d.ts} +7 -7
- package/dist/_dts/{types-DuiHLiPo.d.ts → types-FOsJ-KYb.d.ts} +4 -2
- package/dist/_dts/{validation-Bxi0f81D.d.ts → validation-DckTc6TQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DwiRGtgh.mjs → BlocksIslandsHydrator-DcwEaliO.mjs} +21 -21
- package/dist/client/BookingMailingListNote-Dsugoe-n.mjs +946 -0
- package/dist/client/BookingQuestionFields-Bhh0cvsl.mjs +359 -0
- package/dist/client/{CalendarNavigationChevron-5a0x0vcC.mjs → CalendarNavigationChevron-CNe3ZjdC.mjs} +166 -17
- package/dist/client/{CheckboxChoice-CZ-anOqV.mjs → CheckboxChoice-W_uiRgDK.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-B2qLkPRB.mjs → DemoBookingPortalAccess-BeiZxEUJ.mjs} +7 -7
- package/dist/client/{EventCalendar.client-BhADnDCg.mjs → EventCalendar.client-BL943-tl.mjs} +11 -30
- package/dist/client/{EventCombined.client-jik34zTb.mjs → EventCombined.client-BFVxECTp.mjs} +137 -61
- package/dist/client/{EventEmbeddedCheckoutStep-D_14yqAU.mjs → EventEmbeddedCheckoutStep-Cf-HRHtb.mjs} +1 -1
- package/dist/client/{EventItem-CMKrtkT7.mjs → EventItem-BIc4gjiD.mjs} +86 -17
- package/dist/client/{EventListWeekNavigation-AGHjxy6C.mjs → EventListWeekNavigation-a0QEIEf0.mjs} +1 -1
- package/dist/client/{EventListing.client-DZeDM0Qt.mjs → EventListing.client-CEFTC3jH.mjs} +3 -3
- package/dist/client/{EventListing.view-3BBRdNVa.mjs → EventListing.view-Bt2sBBms.mjs} +41 -50
- package/dist/client/{EventRegistrationPayment-CpNcpga4.mjs → EventRegistrationPayment-D9YBNb_E.mjs} +255 -40
- package/dist/client/{LocationMapActions-D5-H9ooQ.mjs → LocationMapActions-gqzt5gkW.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-C30geMl-.mjs → MapDrawingSvg-13JQI7_z.mjs} +22 -2
- package/dist/client/{Page-DNDZLRlB.mjs → Page-D_M2Vxz3.mjs} +26063 -22139
- package/dist/client/{ProtectedSubmitButton-8DuDw2ag.mjs → ProtectedSubmitButton-C3H26pN9.mjs} +1 -1
- package/dist/client/{StepIndicator-Bin7YR0A.mjs → StepIndicator-CaN8snZ8.mjs} +3 -3
- package/dist/client/{TabBarFragment-_IAthZVM.mjs → TabBarFragment-DkVKtK5a.mjs} +19 -19
- package/dist/client/{ThemedButton-8jUc02mZ.mjs → ThemedButton-BdnEwA38.mjs} +2 -5
- package/dist/client/accessibleSurfaces-chpD4C2c.mjs +4278 -0
- package/dist/client/{accordion-uVqNowRX.mjs → accordion-DE7OG--d.mjs} +1 -1
- package/dist/client/{booking-form.client-w-PvyWBv.mjs → booking-form.client-CS1PPjw7.mjs} +842 -374
- package/dist/client/{bookingForm-DNMojb6A.mjs → bookingForm-DE2CwIU9.mjs} +5 -4
- package/dist/client/{src-DjnxOjXG.mjs → bookingQuestionValues-BjcyCru5.mjs} +88 -1
- package/dist/client/bookingQuestions-BHq83mzS.mjs +13 -0
- package/dist/client/bookings.mjs +18 -13
- package/dist/client/{carousel-C8kxI3Dm.mjs → carousel-DZyUdnFh.mjs} +3 -3
- package/dist/client/{carousel.client-BO7sCEpH.mjs → carousel.client-BD4DXMtI.mjs} +62 -16
- package/dist/client/{carousel.shared-DBnWEJzo.mjs → carousel.shared-BFQ3kBEw.mjs} +6 -3
- package/dist/client/{cart-DCxjE3Is.mjs → cart-D7HkkNwe.mjs} +3 -3
- package/dist/client/{cart.client-Ceeng8fB.mjs → cart.client-H4sv2TpD.mjs} +1 -1
- package/dist/client/{checkout-B0EKbeVv.mjs → checkout-2qVyG-Sh.mjs} +3 -3
- package/dist/client/{checkout.client-DtPj3fYk.mjs → checkout.client-DAjrBZ74.mjs} +1 -1
- package/dist/client/client.mjs +325 -65
- package/dist/client/{context-n6IZigd3.mjs → context-DXmIbXCK.mjs} +300 -3
- package/dist/client/{cta-CDeAwYoN.mjs → cta-DP_IBnq3.mjs} +2 -2
- package/dist/client/{dateFormatting-BWPzdeZE.mjs → dateFormatting-CwrkFZTr.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BdXu0fj-.mjs → demoPortalMagicLink-DQXK-Fh6.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-VHfv8M6-.mjs → enhanceHeaderSection-DheQj7rg.mjs} +4 -4
- package/dist/client/{event-details.client-Cfr1_Cj4.mjs → event-details.client-C5UufcRp.mjs} +1 -1
- package/dist/client/{event-registration.client-BhygihpQ.mjs → event-registration.client-CMGg63IU.mjs} +73 -239
- package/dist/client/{eventCalendar-B4XCL9u6.mjs → eventCalendar-DlD0GCEy.mjs} +4 -4
- package/dist/client/{eventCombined-DVjz4wdf.mjs → eventCombined-DoSi8p_l.mjs} +4 -4
- package/dist/client/{eventDetails-B0DA1Nw1.mjs → eventDetails-DzuQYgmO.mjs} +2 -2
- package/dist/client/{eventListing-2-xjn2nz.mjs → eventListing-CkiMjl0g.mjs} +4 -4
- package/dist/client/{eventRegistration-ng4iGo9O.mjs → eventRegistration-CjS3Zpjp.mjs} +4 -4
- package/dist/client/{form-BeNQiZ2V.mjs → form-DgQqm7T2.mjs} +3 -3
- package/dist/client/{form.client-BFdCKlp7.mjs → form.client-BI9Dcsq5.mjs} +5 -5
- package/dist/client/{form.parts-C7gLK3jh.mjs → form.parts-DevF0L_A.mjs} +3 -3
- package/dist/client/{formatDate-CWfelfMt.mjs → formatDate-DDyURjoe.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-CalNAShx.mjs → headerSection-DYIG6Pwb.mjs} +2 -2
- package/dist/client/{mediaAssets-DpPauppt.mjs → mediaAssets-B99AP7ai.mjs} +1 -1
- package/dist/client/{mediaContext-BLo4NtjP.mjs → mediaContext-Fusweriw.mjs} +1 -1
- package/dist/client/{newsletter-form.client-Dq7GHGXU.mjs → newsletter-form.client-BWp7Y1e1.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-BSMDYQiS.mjs → newsletter-form.parts-Dg8s9NwJ.mjs} +2 -2
- package/dist/client/{newsletterForm-snzZ4L6i.mjs → newsletterForm-DnPraMzx.mjs} +3 -3
- package/dist/client/{noop-D-RG9eR3.mjs → noop-ByFRHYQ2.mjs} +456 -491
- package/dist/client/portal/client.mjs +76 -229
- package/dist/client/{product-detail.client-Gu0INDb7.mjs → product-detail.client-BFAgHrdg.mjs} +1 -1
- package/dist/client/{product-list.client-BmH40fNf.mjs → product-list.client-DVrs_DyY.mjs} +1 -1
- package/dist/client/{productDetail-DsPUmJ0z.mjs → productDetail-D4rvl6Xg.mjs} +3 -3
- package/dist/client/{productList-DjGrjOwD.mjs → productList-B8o5AOMX.mjs} +3 -3
- package/dist/client/{propsDecoder-kTVPMnfD.mjs → propsDecoder-hhotPP6P.mjs} +5 -5
- package/dist/client/{registry.server-CKK_RXZo.mjs → registry.server-Ch3EpupA.mjs} +2296 -2489
- package/dist/client/{surfaceTransportMarker-BXepAVF6.mjs → renderableMediaAssetAdmission-BlfqYLJW.mjs} +1 -18
- package/dist/client/rendering/client.mjs +30 -30
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +10 -9
- package/dist/client/{richText-coerce-BcjTX-7h.mjs → richText-coerce-C3LabQ1O.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CaXesATK.mjs → routeIslandApiConfig-CQGlxId8.mjs} +1 -1
- package/dist/client/runtimeResponse-BP-L6exS.mjs +3 -0
- package/dist/client/runtimeResponse-Dg4XFsuM.mjs +9 -0
- package/dist/client/{shop-commerce-BxYYXLNK.mjs → shop-commerce-VDbVaKY-.mjs} +12 -12
- package/dist/client/{shop-commerce-store-Dp3Nl5YK.mjs → shop-commerce-store-DqdgJ8Zw.mjs} +1 -1
- package/dist/client/{shop-DLufMauE.mjs → shop-rRXplPGZ.mjs} +3 -3
- package/dist/client/{shop.client-CBy9_alG.mjs → shop.client-DdwvMvaK.mjs} +13 -13
- package/dist/client/{shop.interactive-BM0NRsFQ.mjs → shop.interactive-C8OvFY06.mjs} +167 -68
- package/dist/client/{shopShared-lS23OQE-.mjs → shopShared-BeuJiGPU.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/surfaceTransportMarker-BuwkYxsI.mjs +19 -0
- package/dist/client/{timetableModel-DzRWikCU.mjs → timetableModel-Cko9LRKy.mjs} +13 -158
- package/dist/client/{types-sF-IrGQr.mjs → types-5fOsPIpL.mjs} +248 -111
- package/dist/client/{useAvailableSlots-C3LphWDX.mjs → useAvailableSlots-M6QIEiWf.mjs} +3 -3
- package/dist/client/{useDiscountApply-SLoWhcen.mjs → useDiscountApply-BJSnyO0f.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-D6a2BJij.mjs → useDiscountCodeUi-D3XnOSCi.mjs} +1 -1
- package/dist/client/{useEventPagination-Ccr4TZlm.mjs → useEventPagination-PhTIoFVX.mjs} +7 -7
- package/dist/client/{view-DAVEoe8A.mjs → view-448wvvEY.mjs} +21 -12
- package/dist/client/{view-8w4GA8rf.mjs → view-L_mkgtnk.mjs} +4 -4
- package/dist/client/{site-styles-DELkUk9s.mjs → wizardSteps-CFulHWnT.mjs} +19371 -17045
- package/dist/preview-next/client/{ArrangementLookControls-DY5TzhEa.mjs → ArrangementLookControls-BpvnOGlN.mjs} +26 -17
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-C_h1cMYm.mjs → EventEmbeddedCheckoutStep-8-qtHjpb.mjs} +1 -1
- package/dist/preview-next/client/{LocationPickerEnvironment-D56RD3e_.mjs → LocationPickerEnvironment-CZQ4vkRe.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-DFnyCckr.mjs → MapLibreEditMap-CP4w7T_0.mjs} +2 -2
- package/dist/preview-next/client/{PreviewEditorSidebar-DdnhmdFO.mjs → PreviewEditorSidebar-C0OtdWu_.mjs} +432 -127
- package/dist/preview-next/client/{PreviewEditorUI-C7ZmYE33.mjs → PreviewEditorUI-Csc5vH5k.mjs} +6 -6
- package/dist/preview-next/client/{PreviewShell-DnO38NaL.mjs → PreviewShell-BOLH_pm-.mjs} +252 -158
- package/dist/preview-next/client/{SdkPreviewModeRuntime-D2OtoRMB.mjs → SdkPreviewModeRuntime-CKodLReY.mjs} +31 -32
- package/dist/preview-next/client/{SiteChromeCustomizeButton-eIu2RejJ.mjs → SiteChromeCustomizeButton-BeEZpeKn.mjs} +19484 -18082
- package/dist/preview-next/client/{ThemedButton-C0dgGJ5k.mjs → ThemedButton-BQU45t-E.mjs} +260 -121
- package/dist/preview-next/client/{lucide-react-CPBCf6QT.mjs → lucide-react-DkZ8fO-G.mjs} +1 -1
- package/dist/preview-next/client/{previewAssistantSlot-Bp1AlAxx.mjs → previewAssistantSlot-BBdN5kfY.mjs} +21470 -16697
- package/dist/preview-next/client/{previewChromeSurface-D2cREDJ5.mjs → previewChromeSurface-VZtGwPuH.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DK0PUhLL.mjs → sdk-runtime-kiZkMcuR.mjs} +2 -2
- package/dist/preview-next/client/{useAutosaveStatus--Pw8vnef.mjs → useAutosaveStatus-BiIHEeE0.mjs} +2 -2
- package/dist/preview-next/client/{useBlockCustomizeControls-C1Rl73N4.mjs → useBlockCustomizeControls-BuFLIpmX.mjs} +2 -93
- package/dist/preview-next/client/{useOpenBlockForSetup-CL3842FM.mjs → useOpenBlockForSetup-DlxYgmh_.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-Bq7SUX3K.mjs → route-contract-C0sCvCYL.mjs} +248 -0
- package/dist/server/{Block.shared-wXr7Iwhs.mjs → Block.shared-Dnhc0Wu5.mjs} +5 -5
- package/dist/server/{ThemeScopeCore-BI2mld9R.mjs → ThemeScopeCore-NAQ_zsFu.mjs} +1173 -148
- package/dist/server/{accessibleSurfaces-CuN8U_iU.mjs → accessibleSurfaces-108nxyGc.mjs} +520 -129
- package/dist/server/{bindings-DjdUq9FR.mjs → bindings-DLoZYUxG.mjs} +2 -2
- package/dist/server/{client-07UeMDzA.mjs → client-Bc8jI8zN.mjs} +346 -63
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +1 -1
- package/dist/server/{validation-CDd6m8Ry.mjs → customCss-QymcmOZ-.mjs} +12 -55
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/headerVariant-BwR9NV4b.mjs +463 -0
- package/dist/server/{identity-Bn9OQiT1.mjs → identity-20XHqyuO.mjs} +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-ClpaSlBb.mjs → loadContent-D61gpqHB.mjs} +4 -5
- package/dist/server/{loadPage-BwtVqpaA.mjs → loadPage-B4ZYpIcd.mjs} +2 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/{media-DnlczCMA.mjs → media-Brn9FW5s.mjs} +15 -1
- package/dist/server/metadata.mjs +5 -1
- package/dist/server/{mode-Cv_TG9gP.mjs → mode-bkFS8glh.mjs} +4 -2
- package/dist/server/next/revalidate.mjs +9 -4
- package/dist/server/next.mjs +6 -6
- package/dist/server/{opaqueSurface-3YSDPtDe.mjs → opaqueSurface-BawlEAd_.mjs} +6 -6
- package/dist/server/{overrideResolution-Du_w3LY4.mjs → overrideResolution-CDReKy2P.mjs} +1 -1
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/{pageRenderPlan-BShULdc2.mjs → pageRenderPlan-ByVTA7-4.mjs} +375 -171
- package/dist/server/{pageRuntimeSupport-C4Dh5-mB.mjs → pageRuntimeSupport-Dzz_Dze6.mjs} +291 -5
- package/dist/server/{pageShared-HdKFBpaX.mjs → pageShared-Dk5Ku6hs.mjs} +12184 -11593
- package/dist/server/{schema-C2PqHrMo.mjs → parseThemeForPersistence-pJPGfMrf.mjs} +593 -1591
- package/dist/server/{prebuild-Cl-bkaMA.mjs → prebuild-CW4M0WEZ.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-C4yUmz-r.mjs → prefetchBlockData-Bvx0SiIM.mjs} +5 -34
- package/dist/server/{registry-TFPJdGQi.mjs → registry-Bh0Y25zH.mjs} +6041 -4562
- 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 +8 -8
- package/dist/server/{resolveBlockData-OHlOXlOE.mjs → resolveBlockData-CnHHst9r.mjs} +1 -1
- package/dist/server/{resolveButtonColourStates-lry2ORwX.mjs → resolveButtonColourStates-Cn6j8Ee0.mjs} +393 -502
- package/dist/server/responseMedia-t6gs0cB7.mjs +115 -0
- package/dist/server/{richTextSchema-Euhuj-7V.mjs → richTextSchema-DQ2NBP0n.mjs} +5 -16
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +2 -3
- package/dist/server/theme.mjs +1 -2
- package/dist/server/{three-pass-converter-_j2UE2tR.mjs → three-pass-converter-CQWdnfjV.mjs} +1 -1
- package/dist/server/{validation-DIBFZeMB.mjs → validation-D2bHWSxJ.mjs} +59 -10
- package/dist/server/{version-DZWZM1H6.mjs → version-DkM1eAxG.mjs} +1 -1
- package/dist/styles/index.css +991 -48
- package/package.json +4 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-mMMvLLAJ.d.ts +0 -31339
- package/dist/client/BookingMailingListNote-DOWOZYlK.mjs +0 -331
- package/dist/client/DemoPortalSignInLink-B9YrzZt2.mjs +0 -19
- package/dist/client/events-BmqPeeQm.mjs +0 -20
- package/dist/client/site-styles-D8jEPGxA.mjs +0 -3
- package/dist/client/useBookingNowIso-Da-f9iHw.mjs +0 -58
- package/dist/client/wizardSteps-DNpajrAH.mjs +0 -6926
- package/dist/server/parseThemeForPersistence-CJMrEkze.mjs +0 -52
- package/dist/server/publicProducts-W9hDRwjz.mjs +0 -64
|
@@ -1,5 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as relativeLuminance, C as opaqueButtonColourTokenSchema, D as oklabDistance, E as colourFamily, Et as parseThemeColorToken, F as ORDINARY_TEXT_MIN_CONTRAST_RATIO, H as worstContrast, I as assertContrastRatio, J as oklchToOklab, K as oklabToSrgb, L as contrastRatio, M as onColorTokenName, O as deriveSurfaceDecorationColors, P as pickBlackOrWhiteTextColor, R as maxContrastBlackOrWhite, St as paletteColorsFromEntries, T as VARIANT_ROLES, Tt as parseColorTokenParts, U as featuresFromHex, V as solidPaint, W as hexToRgb, Y as rgbToHex, a as BORDER_RADIUS_MAP, b as buttonSystemSchema, bt as normalizePaletteHex, c as ELEVATION_OFFSET, et as completeSurfaceForegrounds, f as STANDARD_BUTTON_SURFACE_POLICY, ft as rgbColorValue, gt as PALETTE_TOKEN_NAMES, k as deriveSurfaceMutedColor, l as FONT_SIZE_MAP, n as compileButtonColourStates, o as BORDER_WIDTH_MAP, t as buttonStateBorder, u as generateShadowValue, vt as hexColorSchema, wt as paletteModeSchema } from "./resolveButtonColourStates-Cn6j8Ee0.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
//#region ../theme-core/src/palette/colors.ts
|
|
4
|
+
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
5
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
6
|
+
function requirePaletteColorsFromEntries(entries) {
|
|
7
|
+
const result = paletteColorsFromEntries(entries);
|
|
8
|
+
if (result.ok) return result.colors;
|
|
9
|
+
throw new Error(`Invalid complete palette: ${result.error.kind}`);
|
|
10
|
+
}
|
|
11
|
+
function paletteColorFingerprint(colors) {
|
|
12
|
+
return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
|
|
13
|
+
}
|
|
14
|
+
function canonicalPaletteHashInput(colors, mode) {
|
|
15
|
+
return `${mode}|${paletteColorFingerprint(colors)}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Stable curated-catalogue identity. Do not reorder roles: the order comes
|
|
19
|
+
* from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
|
|
20
|
+
*/
|
|
21
|
+
function paletteValueKey(colors, mode) {
|
|
22
|
+
return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
|
|
23
|
+
}
|
|
24
|
+
/** Parses only the exact v1 canonical form emitted by paletteValueKey. */
|
|
25
|
+
function parsePaletteValueKey(value) {
|
|
26
|
+
if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
|
|
27
|
+
const [rawMode, ...rawRoles] = value.slice(17).split("|");
|
|
28
|
+
const mode = paletteModeSchema.safeParse(rawMode);
|
|
29
|
+
if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
|
|
30
|
+
const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
|
|
31
|
+
const separator = roleValue.indexOf(":");
|
|
32
|
+
return separator === -1 ? {
|
|
33
|
+
name: "",
|
|
34
|
+
hex: ""
|
|
35
|
+
} : {
|
|
36
|
+
name: roleValue.slice(0, separator),
|
|
37
|
+
hex: roleValue.slice(separator + 1)
|
|
38
|
+
};
|
|
39
|
+
}));
|
|
40
|
+
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
const paletteValueKeySchema = z.string().transform((value, ctx) => {
|
|
44
|
+
const parsed = parsePaletteValueKey(value);
|
|
45
|
+
if (parsed) return parsed;
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
code: "custom",
|
|
48
|
+
message: "Invalid canonical palette value key"
|
|
49
|
+
});
|
|
50
|
+
return z.NEVER;
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
3
53
|
//#region ../theme-core/src/palette/utils/opaqueSurfaceColor.ts
|
|
4
54
|
/** Resolve an opaque colour, compositing alpha against an explicit underlay. */
|
|
5
55
|
function resolveOpaqueSurfaceHex(reference, palette, underlayReference) {
|
|
@@ -121,6 +171,121 @@ function survivesEveryBackdrop(token, palette, backdrops) {
|
|
|
121
171
|
});
|
|
122
172
|
}
|
|
123
173
|
//#endregion
|
|
174
|
+
//#region ../site-contracts/src/renderResults/buttonTypes.ts
|
|
175
|
+
const BUTTON_VISUAL_STATES = [
|
|
176
|
+
"base",
|
|
177
|
+
"hover",
|
|
178
|
+
"focus",
|
|
179
|
+
"active",
|
|
180
|
+
"disabled"
|
|
181
|
+
];
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../theme-core/src/surfaces/inkCertificate.ts
|
|
184
|
+
/**
|
|
185
|
+
* The ink certificate: every colour the site paints text or a mark on is held to
|
|
186
|
+
* its threshold here, on every backdrop it shows. An ink that misses takes the
|
|
187
|
+
* black/white ink that clears all of them; inks that pass are kept as they are,
|
|
188
|
+
* so a palette that already passes paints exactly what it declared. It never
|
|
189
|
+
* throws, because owner palettes are arbitrary.
|
|
190
|
+
*
|
|
191
|
+
* Surfaces (`certifySurface`), every measured foreground (`resolveSurfaceForeground`)
|
|
192
|
+
* and the chrome colours painted outside a foreground contract all certify here.
|
|
193
|
+
*/
|
|
194
|
+
const contrastThresholdByPolicy = {
|
|
195
|
+
"body-aa": 4.5,
|
|
196
|
+
"large-text-aa": 3,
|
|
197
|
+
decorative: 1
|
|
198
|
+
};
|
|
199
|
+
/** Headings are large text; every other foreground role is ordinary text. */
|
|
200
|
+
const surfaceTextPolicy = Object.freeze({
|
|
201
|
+
heading: "large-text-aa",
|
|
202
|
+
text: "body-aa",
|
|
203
|
+
link: "body-aa",
|
|
204
|
+
linkHover: "body-aa",
|
|
205
|
+
supporting: "body-aa",
|
|
206
|
+
muted: "body-aa"
|
|
207
|
+
});
|
|
208
|
+
/**
|
|
209
|
+
* Text shown only while a pointer hovers needs 3:1: the reader has already
|
|
210
|
+
* found it at rest, where it holds 4.5:1. States that stay on screen (open,
|
|
211
|
+
* the current-page link) keep the text threshold.
|
|
212
|
+
*/
|
|
213
|
+
const HOVER_TEXT_THRESHOLD = contrastThresholdByPolicy["large-text-aa"];
|
|
214
|
+
const FALLBACK_INKS = ["#000000", "#FFFFFF"];
|
|
215
|
+
const isFallbackInk = (ink) => FALLBACK_INKS.includes(ink);
|
|
216
|
+
function inkReference(ink) {
|
|
217
|
+
return isFallbackInk(ink) ? `raw:${ink}` : ink;
|
|
218
|
+
}
|
|
219
|
+
/** A token, `rgba()` or literal, composited over each backdrop, clears the threshold on all of them. */
|
|
220
|
+
function inkClearsBackdrops(ink, threshold, backdrops, measurement) {
|
|
221
|
+
return backdrops.every((backdrop) => {
|
|
222
|
+
const hex = resolveOpaqueSurfaceHex(ink, measurement.palette, backdrop);
|
|
223
|
+
return hex !== null && contrastRatio(hex, backdrop, measurement.colourIndex) >= threshold;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/** The black/white ink that clears every backdrop at ordinary-text contrast, preferring the best one for the painted end. */
|
|
227
|
+
function fallbackInk(backdrops, measurement) {
|
|
228
|
+
const [endpoint] = backdrops.slice(-1);
|
|
229
|
+
return [...endpoint ? [pickBlackOrWhiteTextColor(endpoint)] : [], ...FALLBACK_INKS].find((candidate) => inkClearsBackdrops(candidate, contrastThresholdByPolicy["body-aa"], backdrops, measurement)) ?? null;
|
|
230
|
+
}
|
|
231
|
+
function failingInks(inks, backdrops, measurement) {
|
|
232
|
+
return {
|
|
233
|
+
roles: Object.keys(inks.foreground).filter((role) => !inkClearsBackdrops(inks.foreground[role], contrastThresholdByPolicy[surfaceTextPolicy[role]], backdrops, measurement)),
|
|
234
|
+
mark: inks.mark !== void 0 && !inkClearsBackdrops(inks.mark, 3, backdrops, measurement) ? ["mark"] : []
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function replaceFailing(inks, failing, ink) {
|
|
238
|
+
return {
|
|
239
|
+
foreground: {
|
|
240
|
+
...inks.foreground,
|
|
241
|
+
...Object.fromEntries(failing.roles.map((role) => [role, ink]))
|
|
242
|
+
},
|
|
243
|
+
...inks.mark === void 0 ? {} : { mark: failing.mark.length > 0 ? ink : inks.mark },
|
|
244
|
+
fallback: [...failing.roles, ...failing.mark]
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Hold every role to its text policy and the mark to 3:1 on every backdrop.
|
|
249
|
+
* Null only when neither black nor white clears every backdrop, which only a
|
|
250
|
+
* radial tint's samples can do: `certifySolidSurfaceInks` is the total form for
|
|
251
|
+
* one solid backdrop.
|
|
252
|
+
*/
|
|
253
|
+
function certifySurfaceInks(inks, backdrops, measurement) {
|
|
254
|
+
const failing = failingInks(inks, backdrops, measurement);
|
|
255
|
+
if (failing.roles.length === 0 && failing.mark.length === 0) return {
|
|
256
|
+
...inks,
|
|
257
|
+
fallback: []
|
|
258
|
+
};
|
|
259
|
+
const ink = fallbackInk(backdrops, measurement);
|
|
260
|
+
return ink ? replaceFailing(inks, failing, ink) : null;
|
|
261
|
+
}
|
|
262
|
+
/** One solid backdrop: black or white always reaches 4.58:1 on it, so certification always succeeds. */
|
|
263
|
+
function certifySolidSurfaceInks(inks, backdrop, measurement) {
|
|
264
|
+
const failing = failingInks(inks, [backdrop], measurement);
|
|
265
|
+
if (failing.roles.length === 0 && failing.mark.length === 0) return {
|
|
266
|
+
...inks,
|
|
267
|
+
fallback: []
|
|
268
|
+
};
|
|
269
|
+
return replaceFailing(inks, failing, pickBlackOrWhiteTextColor(backdrop));
|
|
270
|
+
}
|
|
271
|
+
/** Kept when the ink clears the threshold, otherwise the black/white ink, which always clears a solid backdrop. */
|
|
272
|
+
function certifyPaint(place, ink, threshold, backdrop, measurement) {
|
|
273
|
+
return inkClearsBackdrops(ink, threshold, [backdrop], measurement) ? {
|
|
274
|
+
place,
|
|
275
|
+
ink,
|
|
276
|
+
backdrop,
|
|
277
|
+
threshold,
|
|
278
|
+
fallback: false
|
|
279
|
+
} : {
|
|
280
|
+
place,
|
|
281
|
+
ink: pickBlackOrWhiteTextColor(backdrop),
|
|
282
|
+
backdrop,
|
|
283
|
+
threshold,
|
|
284
|
+
fallback: true,
|
|
285
|
+
declared: ink
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
124
289
|
//#region ../theme-core/src/palette/utils/inkSolver.ts
|
|
125
290
|
/**
|
|
126
291
|
* How far (OKLab ΔE) a brand colour drawn as ink may be nudged along its own
|
|
@@ -304,7 +469,7 @@ function resolveMeasuredForeground(backgroundReference, backgroundHex, candidate
|
|
|
304
469
|
derivedOnToken,
|
|
305
470
|
...FALLBACK_TEXT_TOKENS
|
|
306
471
|
], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? pickBlackOrWhiteTextColor(backgroundHex);
|
|
307
|
-
return knownForeground({
|
|
472
|
+
return certifiedForeground(knownForeground({
|
|
308
473
|
text,
|
|
309
474
|
heading: safeTokenOr(candidates.heading, text, backgroundHex, palette),
|
|
310
475
|
link: safeTokenOr(candidates.link, text, backgroundHex, palette),
|
|
@@ -313,7 +478,28 @@ function resolveMeasuredForeground(backgroundReference, backgroundHex, candidate
|
|
|
313
478
|
kind: "measured",
|
|
314
479
|
backdropHex: backgroundHex,
|
|
315
480
|
inks: solveSurfaceInks(backgroundHex, text, palette)
|
|
316
|
-
}, candidates.linkHover, palette);
|
|
481
|
+
}, candidates.linkHover, palette), palette);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Every measured foreground goes through the ink certificate, whoever paints it
|
|
485
|
+
* (sections, cards, header, footer, accordions). The candidates above are chosen
|
|
486
|
+
* to pass, so the certificate is normally a no-op and the foreground is returned
|
|
487
|
+
* as it was; an ink that misses takes black/white, and the solved inks follow
|
|
488
|
+
* the certified text.
|
|
489
|
+
*/
|
|
490
|
+
function certifiedForeground(foreground, palette) {
|
|
491
|
+
const { backdropHex } = foreground.provenance;
|
|
492
|
+
const certified = certifySolidSurfaceInks({ foreground: foreground.roles }, backdropHex, { palette });
|
|
493
|
+
if (certified.fallback.length === 0) return foreground;
|
|
494
|
+
return {
|
|
495
|
+
...foreground,
|
|
496
|
+
roles: certified.foreground,
|
|
497
|
+
provenance: {
|
|
498
|
+
...foreground.provenance,
|
|
499
|
+
inks: solveSurfaceInks(backdropHex, certified.foreground.text, palette),
|
|
500
|
+
fallback: certified.fallback
|
|
501
|
+
}
|
|
502
|
+
};
|
|
317
503
|
}
|
|
318
504
|
function resolveTrustedTreatmentForeground(candidates, palette) {
|
|
319
505
|
const text = canonicalToken(candidates.text, palette);
|
|
@@ -409,19 +595,125 @@ function normalizedReference(value) {
|
|
|
409
595
|
}
|
|
410
596
|
//#endregion
|
|
411
597
|
//#region ../theme-core/src/site-styles/ownedThemeSnapshot.ts
|
|
598
|
+
const ownedThemeValues = /* @__PURE__ */ new WeakSet();
|
|
599
|
+
function isOwnedThemeValue(value) {
|
|
600
|
+
return ownedThemeValues.has(value);
|
|
601
|
+
}
|
|
412
602
|
/** Copy before freezing: the editor still owns its source data. */
|
|
413
603
|
function ownedThemeSnapshot(input) {
|
|
414
|
-
return freezeOwnedThemeValue(structuredClone(input));
|
|
604
|
+
return typeof input === "object" && input !== null && isOwnedThemeValue(input) ? input : freezeOwnedThemeValue(structuredClone(input));
|
|
415
605
|
}
|
|
416
606
|
/** Only freshly owned data belongs here; no caller-owned object is frozen. */
|
|
417
607
|
function freezeOwnedThemeValue(value) {
|
|
418
608
|
if (typeof value === "object" && value !== null) {
|
|
609
|
+
if (ownedThemeValues.has(value)) return value;
|
|
419
610
|
Object.values(value).forEach(freezeOwnedThemeValue);
|
|
420
611
|
Object.freeze(value);
|
|
612
|
+
ownedThemeValues.add(value);
|
|
421
613
|
}
|
|
422
614
|
return value;
|
|
423
615
|
}
|
|
424
616
|
//#endregion
|
|
617
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
618
|
+
const CSS_COLOR_FUNCTION_PATTERN = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
619
|
+
const CSS_HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
620
|
+
const CSS_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
621
|
+
"transparent",
|
|
622
|
+
"currentcolor",
|
|
623
|
+
"inherit",
|
|
624
|
+
"initial",
|
|
625
|
+
"revert",
|
|
626
|
+
"revert-layer",
|
|
627
|
+
"unset"
|
|
628
|
+
]);
|
|
629
|
+
const COMMON_CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
630
|
+
"black",
|
|
631
|
+
"blue",
|
|
632
|
+
"gray",
|
|
633
|
+
"green",
|
|
634
|
+
"grey",
|
|
635
|
+
"orange",
|
|
636
|
+
"pink",
|
|
637
|
+
"purple",
|
|
638
|
+
"red",
|
|
639
|
+
"white",
|
|
640
|
+
"yellow"
|
|
641
|
+
]);
|
|
642
|
+
function isCssColorLiteral(value) {
|
|
643
|
+
const trimmed = value.trim();
|
|
644
|
+
if (!trimmed) return false;
|
|
645
|
+
return CSS_HEX_COLOR_PATTERN.test(trimmed) || CSS_COLOR_FUNCTION_PATTERN.test(trimmed) || /^var\(/i.test(trimmed) || CSS_COLOR_KEYWORDS.has(trimmed.toLowerCase());
|
|
646
|
+
}
|
|
647
|
+
function parseThemeToken(token) {
|
|
648
|
+
const trimmed = token.trim();
|
|
649
|
+
const match = trimmed.match(/^(.*?)-(\d{2,3})$/);
|
|
650
|
+
if (!match) return {
|
|
651
|
+
role: trimmed,
|
|
652
|
+
shade: null
|
|
653
|
+
};
|
|
654
|
+
const role = match[1] ?? trimmed;
|
|
655
|
+
const shade = match[2] ? Number(match[2]) : null;
|
|
656
|
+
return {
|
|
657
|
+
role,
|
|
658
|
+
shade: Number.isFinite(shade) ? shade : null
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function parseContextThemeColorToken(value, context) {
|
|
662
|
+
const parts = parseColorTokenParts(value);
|
|
663
|
+
if (parts.kind !== "token") return null;
|
|
664
|
+
if (!(Boolean(context?.palette?.[value.trim()]) || parts.opacityPercent !== null && Boolean(context?.palette?.[parts.token]))) return null;
|
|
665
|
+
return value.trim();
|
|
666
|
+
}
|
|
667
|
+
function isTokenShapedTypo(value) {
|
|
668
|
+
if (COMMON_CSS_NAMED_COLORS.has(value.toLowerCase())) return false;
|
|
669
|
+
if (!/^[a-zA-Z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*(?:\/[^/]+)?$/.test(value)) return false;
|
|
670
|
+
return !isCssColorLiteral(value);
|
|
671
|
+
}
|
|
672
|
+
function warnUnknownThemeColorReference(value) {
|
|
673
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") return;
|
|
674
|
+
if (!isTokenShapedTypo(value)) return;
|
|
675
|
+
console.warn(`[theme-core] Unknown Theme V2 color token "${value}" treated as literal CSS. Use raw:* for deliberate custom CSS values.`);
|
|
676
|
+
}
|
|
677
|
+
function parseThemeColorReference(input, context) {
|
|
678
|
+
const trimmed = input.trim();
|
|
679
|
+
if (trimmed.startsWith("raw:")) return {
|
|
680
|
+
kind: "literal-css",
|
|
681
|
+
value: trimmed.slice(4)
|
|
682
|
+
};
|
|
683
|
+
const contextToken = parseContextThemeColorToken(trimmed, context);
|
|
684
|
+
if (contextToken) return {
|
|
685
|
+
kind: "palette-context-token",
|
|
686
|
+
token: contextToken
|
|
687
|
+
};
|
|
688
|
+
const knownToken = parseThemeColorToken(trimmed);
|
|
689
|
+
if (knownToken) return {
|
|
690
|
+
kind: "theme-token",
|
|
691
|
+
token: knownToken
|
|
692
|
+
};
|
|
693
|
+
warnUnknownThemeColorReference(trimmed);
|
|
694
|
+
return {
|
|
695
|
+
kind: "literal-css",
|
|
696
|
+
value: trimmed
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
function resolveThemeColorReferenceValue(input, context) {
|
|
700
|
+
const reference = parseThemeColorReference(input, context);
|
|
701
|
+
return reference.kind === "literal-css" ? reference.value : rgbColorValue(reference.token);
|
|
702
|
+
}
|
|
703
|
+
function resolveTokenOrCssColorValue(input, context) {
|
|
704
|
+
return resolveThemeColorReferenceValue(input, context);
|
|
705
|
+
}
|
|
706
|
+
function resolveOnColorForThemeToken(token) {
|
|
707
|
+
if (!parseThemeColorToken(token)) return null;
|
|
708
|
+
const parts = parseColorTokenParts(token);
|
|
709
|
+
if (parts.kind !== "token") return null;
|
|
710
|
+
const { role, shade } = parseThemeToken(parts.token);
|
|
711
|
+
const normalizedRole = role.trim();
|
|
712
|
+
if (!normalizedRole) return null;
|
|
713
|
+
if (!shade) return rgbColorValue(`on${normalizedRole.charAt(0).toUpperCase() + normalizedRole.slice(1)}`);
|
|
714
|
+
return shade <= 400 ? "#000000" : "#FFFFFF";
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
425
717
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
426
718
|
const PUBLIC_BUTTON_ROLES = VARIANT_ROLES;
|
|
427
719
|
function defineButtonStyleRecipe(recipe) {
|
|
@@ -818,15 +1110,15 @@ function preferredButtonResolution(requested, compiled, role) {
|
|
|
818
1110
|
focusIndicator: compiled.focusIndicator,
|
|
819
1111
|
boundary: boundaryForVariant(requested)
|
|
820
1112
|
};
|
|
821
|
-
return compiled.contextualHoverRepair ? {
|
|
1113
|
+
return compiled.contextualHoverRepair ? withBorderEvidence({
|
|
822
1114
|
...appearance,
|
|
823
1115
|
kind: "repaired",
|
|
824
1116
|
candidate: "contextual-hover",
|
|
825
1117
|
rejectedCandidates: []
|
|
826
|
-
} : {
|
|
1118
|
+
}, requested) : withBorderEvidence({
|
|
827
1119
|
...appearance,
|
|
828
1120
|
kind: "preferred"
|
|
829
|
-
};
|
|
1121
|
+
}, requested);
|
|
830
1122
|
}
|
|
831
1123
|
/** Ordered, lazy fallback selection; the rejected evidence belongs to this decision. */
|
|
832
1124
|
function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
@@ -839,7 +1131,7 @@ function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
|
839
1131
|
const candidate = candidateVariant(fallback, requested, input.buttonSystem);
|
|
840
1132
|
if (!candidate) return resolveFallbackButtonRole(input, requested, remaining, rejected);
|
|
841
1133
|
const compiled = compileCandidate(candidate.variant, input);
|
|
842
|
-
return compiled.ok ? {
|
|
1134
|
+
return compiled.ok ? withBorderEvidence({
|
|
843
1135
|
kind: "repaired",
|
|
844
1136
|
requestedRole: input.role,
|
|
845
1137
|
candidate: candidate.name,
|
|
@@ -847,7 +1139,7 @@ function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
|
847
1139
|
focusIndicator: compiled.focusIndicator,
|
|
848
1140
|
boundary: candidate.boundary,
|
|
849
1141
|
rejectedCandidates: rejected
|
|
850
|
-
} : resolveFallbackButtonRole(input, requested, remaining, [...rejected, {
|
|
1142
|
+
}, candidate.variant) : resolveFallbackButtonRole(input, requested, remaining, [...rejected, {
|
|
851
1143
|
candidate: candidate.name,
|
|
852
1144
|
error: compiled.error
|
|
853
1145
|
}]);
|
|
@@ -954,6 +1246,14 @@ function candidateVariant(fallback, requested, system) {
|
|
|
954
1246
|
}
|
|
955
1247
|
};
|
|
956
1248
|
}
|
|
1249
|
+
/** Each state's border travels with the decision, copied so freezing it never touches the caller's variant. */
|
|
1250
|
+
function withBorderEvidence(value, variant) {
|
|
1251
|
+
const borders = ownedThemeSnapshot(Object.fromEntries(BUTTON_VISUAL_STATES.map((state) => [state, buttonStateBorder(variant, state)])));
|
|
1252
|
+
return {
|
|
1253
|
+
...value,
|
|
1254
|
+
borders
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
957
1257
|
function boundaryForVariant(variant) {
|
|
958
1258
|
if (!variant.border) return null;
|
|
959
1259
|
return {
|
|
@@ -1125,11 +1425,6 @@ const SURFACE_TRANSPORT_KEY = "$surfaceTransport";
|
|
|
1125
1425
|
//#endregion
|
|
1126
1426
|
//#region ../theme-core/src/site-styles/accessibleSurfaces.ts
|
|
1127
1427
|
const ON_BACKGROUND = { kind: "on-background" };
|
|
1128
|
-
const contrastThresholdByPolicy = {
|
|
1129
|
-
"body-aa": 4.5,
|
|
1130
|
-
"large-text-aa": 3,
|
|
1131
|
-
decorative: 1
|
|
1132
|
-
};
|
|
1133
1428
|
const surfaceRecipes = {
|
|
1134
1429
|
base: {
|
|
1135
1430
|
backgroundCandidates: ["background", "surface"],
|
|
@@ -1510,42 +1805,25 @@ function missingBackgroundSurface(input) {
|
|
|
1510
1805
|
rejectedCandidates: input.rejectedCandidates
|
|
1511
1806
|
};
|
|
1512
1807
|
}
|
|
1513
|
-
const resolvedSurfaceBrand = Symbol("ResolvedSurface");
|
|
1514
1808
|
const surfaceOwners = /* @__PURE__ */ new WeakSet();
|
|
1515
1809
|
const preparedIndexOwners = /* @__PURE__ */ new WeakSet();
|
|
1516
1810
|
const surfaceTransports = /* @__PURE__ */ new WeakMap();
|
|
1517
|
-
const ownedRevisionInputs = /* @__PURE__ */ new WeakMap();
|
|
1518
1811
|
const revisionOwners = /* @__PURE__ */ new WeakMap();
|
|
1519
1812
|
const surfaceRevisionOwners = /* @__PURE__ */ new WeakMap();
|
|
1520
|
-
const surfaceTextPolicy = Object.freeze({
|
|
1521
|
-
heading: "large-text-aa",
|
|
1522
|
-
text: "body-aa",
|
|
1523
|
-
link: "body-aa",
|
|
1524
|
-
linkHover: "body-aa",
|
|
1525
|
-
supporting: "body-aa",
|
|
1526
|
-
muted: "body-aa"
|
|
1527
|
-
});
|
|
1528
1813
|
function ownSurfaceRevision(context) {
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
registerOwnedRevisionInputs(revision);
|
|
1535
|
-
surfaceRevisionOwners.set(revision, { revision });
|
|
1536
|
-
revisionOwners.set(revision.palette, /* @__PURE__ */ new Map([[revision.buttonSystem, revision]]));
|
|
1537
|
-
return revision;
|
|
1538
|
-
}
|
|
1539
|
-
const revisions = revisionOwners.get(context.palette) ?? /* @__PURE__ */ new Map();
|
|
1540
|
-
const existing = revisions.get(context.buttonSystem);
|
|
1814
|
+
const palette = ownedThemeSnapshot(context.palette);
|
|
1815
|
+
const buttonSystem = context.buttonSystem === void 0 ? void 0 : ownedThemeSnapshot(context.buttonSystem);
|
|
1816
|
+
if (!isOwnedThemeValue(palette)) throw new TypeError("A surface context needs a palette object.");
|
|
1817
|
+
const revisions = revisionOwners.get(palette) ?? /* @__PURE__ */ new Map();
|
|
1818
|
+
const existing = revisions.get(buttonSystem);
|
|
1541
1819
|
if (existing) return existing;
|
|
1542
1820
|
const revision = Object.freeze({
|
|
1543
|
-
palette
|
|
1544
|
-
buttonSystem
|
|
1821
|
+
palette,
|
|
1822
|
+
buttonSystem
|
|
1545
1823
|
});
|
|
1546
1824
|
surfaceRevisionOwners.set(revision, { revision });
|
|
1547
|
-
revisions.set(
|
|
1548
|
-
revisionOwners.set(
|
|
1825
|
+
revisions.set(buttonSystem, revision);
|
|
1826
|
+
revisionOwners.set(palette, revisions);
|
|
1549
1827
|
return revision;
|
|
1550
1828
|
}
|
|
1551
1829
|
/** Local computation keeps its colour index; transport references only the owning revision inputs. */
|
|
@@ -1563,12 +1841,6 @@ function surfaceTransportContext(context) {
|
|
|
1563
1841
|
});
|
|
1564
1842
|
return result;
|
|
1565
1843
|
}
|
|
1566
|
-
/** Called only after copying and recursively freezing owner inputs. */
|
|
1567
|
-
function registerOwnedRevisionInputs(context) {
|
|
1568
|
-
const buttons = ownedRevisionInputs.get(context.palette) ?? /* @__PURE__ */ new Set();
|
|
1569
|
-
buttons.add(context.buttonSystem);
|
|
1570
|
-
ownedRevisionInputs.set(context.palette, buttons);
|
|
1571
|
-
}
|
|
1572
1844
|
function isResolvedSurface(value) {
|
|
1573
1845
|
return typeof value === "object" && value !== null && surfaceOwners.has(value) && "kind" in value && (value.kind === "owned" || value.kind === "inherit");
|
|
1574
1846
|
}
|
|
@@ -1579,6 +1851,38 @@ function requireResolvedSurface(value) {
|
|
|
1579
1851
|
function resolveSurface(spec, context) {
|
|
1580
1852
|
return spec.kind === "section" ? resolveSectionSurface(spec.background, context) : preparedSurfaceValue(spec, context) ?? certifySurface(spec, context);
|
|
1581
1853
|
}
|
|
1854
|
+
function prepareSurfaceIndex(specs, context) {
|
|
1855
|
+
const snapshot = ownedThemeSnapshot({
|
|
1856
|
+
palette: context.palette,
|
|
1857
|
+
buttonSystem: context.buttonSystem,
|
|
1858
|
+
colourIndex: context.colourIndex,
|
|
1859
|
+
linkHoverToken: context.linkHoverToken,
|
|
1860
|
+
foreground: context.foreground,
|
|
1861
|
+
compositeBase: context.compositeBase,
|
|
1862
|
+
buttonContext: context.buttonContext,
|
|
1863
|
+
solvedInks: context.solvedInks
|
|
1864
|
+
});
|
|
1865
|
+
return surfaceIndexFromOwnedInputs(ownedThemeSnapshot(specs), snapshot);
|
|
1866
|
+
}
|
|
1867
|
+
/** Private construction path: both entry points above own and freeze these inputs. */
|
|
1868
|
+
function surfaceIndexFromOwnedInputs(specs, context) {
|
|
1869
|
+
const entries = [...new Map(specs.map((spec) => [surfaceResolutionKey(spec, context), spec]))].flatMap(([key, spec]) => preparedSurfaceEntry(key, spec, context));
|
|
1870
|
+
const index = Object.freeze({
|
|
1871
|
+
palette: context.palette,
|
|
1872
|
+
buttonSystem: context.buttonSystem,
|
|
1873
|
+
colourIndex: context.colourIndex,
|
|
1874
|
+
values: freezeOwnedThemeValue(Object.fromEntries(entries))
|
|
1875
|
+
});
|
|
1876
|
+
preparedIndexOwners.add(index);
|
|
1877
|
+
return index;
|
|
1878
|
+
}
|
|
1879
|
+
function preparedSurfaceEntry(key, spec, context) {
|
|
1880
|
+
try {
|
|
1881
|
+
return [[key, certifySurface(spec, context)]];
|
|
1882
|
+
} catch {
|
|
1883
|
+
return [];
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1582
1886
|
function matchingPreparedSurfaceIndex(index, context) {
|
|
1583
1887
|
return index && preparedIndexOwners.has(index) && index.palette === context.palette && index.buttonSystem === context.buttonSystem && index.colourIndex === context.colourIndex ? index : void 0;
|
|
1584
1888
|
}
|
|
@@ -1611,7 +1915,7 @@ function resolveSurfaceSpec(spec, context) {
|
|
|
1611
1915
|
token: spec.token
|
|
1612
1916
|
}, {
|
|
1613
1917
|
...context,
|
|
1614
|
-
buttonContext: spec
|
|
1918
|
+
buttonContext: surfaceButtonRequest(spec, context),
|
|
1615
1919
|
...spec.foreground ? { foreground: {
|
|
1616
1920
|
...context.foreground,
|
|
1617
1921
|
...spec.foreground
|
|
@@ -1650,68 +1954,63 @@ function recipeForegroundCandidates(recipe, context) {
|
|
|
1650
1954
|
};
|
|
1651
1955
|
}
|
|
1652
1956
|
/** Declared grounds are parsed once; legacy stored paints use the unmeasured value arm. */
|
|
1653
|
-
function resolveDeclaredSolidSurface(paint, context
|
|
1654
|
-
return resolveOwnedSurface(paint, context, hexColorSchema.parse(resolveOpaqueSurfaceHex(paint.token, context.palette, context.compositeBase))
|
|
1957
|
+
function resolveDeclaredSolidSurface(paint, context) {
|
|
1958
|
+
return resolveOwnedSurface(paint, context, hexColorSchema.parse(resolveOpaqueSurfaceHex(paint.token, context.palette, context.compositeBase)));
|
|
1655
1959
|
}
|
|
1656
|
-
function resolveOwnedSurface(paint, context, measuredBackdrop
|
|
1657
|
-
const
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
textColor: text
|
|
1665
|
-
};
|
|
1666
|
-
const candidates = {
|
|
1667
|
-
linkHover: context.linkHoverToken,
|
|
1668
|
-
...context.foreground
|
|
1960
|
+
function resolveOwnedSurface(paint, context, measuredBackdrop) {
|
|
1961
|
+
const resolved = resolveOwnedForeground(paint, context, measuredBackdrop);
|
|
1962
|
+
const decision = {
|
|
1963
|
+
kind: "owned",
|
|
1964
|
+
foreground: ownedForegroundRoles(resolved, paint.foregroundToken ?? "text", context.foreground),
|
|
1965
|
+
inks: ownedInkPublication(resolved, context),
|
|
1966
|
+
decorations: surfaceDecorationColors(resolved, context.palette),
|
|
1967
|
+
hoverDecoration: resolved.kind === "known" ? resolved.hoverDecoration : "underline"
|
|
1669
1968
|
};
|
|
1670
|
-
const
|
|
1671
|
-
|
|
1672
|
-
paint
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
tintBase
|
|
1676
|
-
});
|
|
1677
|
-
if (paint.kind === "gradient") return {
|
|
1969
|
+
const primaryButton = surfaceButtonRequest({
|
|
1970
|
+
kind: "paint",
|
|
1971
|
+
paint
|
|
1972
|
+
}, context)?.primary;
|
|
1973
|
+
if (paint.kind === "solid" && resolved.kind === "known" && resolved.provenance.kind === "measured") return {
|
|
1678
1974
|
...decision,
|
|
1679
1975
|
paint,
|
|
1680
|
-
|
|
1976
|
+
foreground: resolved.roles,
|
|
1977
|
+
...primaryButton ? { primaryButton } : {},
|
|
1978
|
+
contrast: surfaceContrast(resolved.roles, resolved.provenance.backdropHex, context.palette, context.colourIndex)
|
|
1681
1979
|
};
|
|
1682
|
-
|
|
1980
|
+
const buttonContext = surfaceButtons(paint, resolved.kind === "known" ? resolved.roles.link : void 0, primaryButton, context);
|
|
1981
|
+
return paint.kind === "gradient" ? {
|
|
1982
|
+
...decision,
|
|
1983
|
+
paint,
|
|
1984
|
+
contrast: { kind: "unmeasured" },
|
|
1985
|
+
buttonContext
|
|
1986
|
+
} : {
|
|
1683
1987
|
...decision,
|
|
1684
1988
|
paint,
|
|
1685
1989
|
contrast: {
|
|
1686
1990
|
kind: "unmeasured",
|
|
1687
1991
|
reason: "legacy-unresolvable-solid",
|
|
1688
1992
|
source: "paint"
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
return {
|
|
1692
|
-
...decision,
|
|
1693
|
-
paint,
|
|
1694
|
-
foreground: resolved.roles,
|
|
1695
|
-
contrast: surfaceContrast(resolved.roles, resolved.provenance.backdropHex, context.palette, context.colourIndex)
|
|
1993
|
+
},
|
|
1994
|
+
buttonContext
|
|
1696
1995
|
};
|
|
1697
1996
|
}
|
|
1698
|
-
/**
|
|
1699
|
-
function
|
|
1700
|
-
const
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
foreground
|
|
1705
|
-
}, tintBase, context.palette) : void 0;
|
|
1706
|
-
return {
|
|
1707
|
-
kind: "owned",
|
|
1708
|
-
foreground,
|
|
1709
|
-
inks: tintBase ? { kind: "reset" } : ownedInkPublication(resolved, context),
|
|
1710
|
-
...tintBase ? { tintBase } : {},
|
|
1711
|
-
decorations: surfaceDecorationColors(resolved, context.palette),
|
|
1712
|
-
hoverDecoration: resolved.kind === "known" ? resolved.hoverDecoration : "underline",
|
|
1713
|
-
buttonContext: resolveSurfaceButtons(paint, resolved.kind === "known" ? resolved.roles : void 0, context, samples)
|
|
1997
|
+
/** A solid paint is measured against its own backdrop when it's known, otherwise over the composite base. */
|
|
1998
|
+
function resolveOwnedForeground(paint, context, measuredBackdrop) {
|
|
1999
|
+
const textColor = paint.foregroundToken ?? "text";
|
|
2000
|
+
const candidates = {
|
|
2001
|
+
linkHover: context.linkHoverToken,
|
|
2002
|
+
...context.foreground
|
|
1714
2003
|
};
|
|
2004
|
+
if (paint.kind === "gradient") return resolveSurfaceForeground({
|
|
2005
|
+
type: "gradient",
|
|
2006
|
+
textColor
|
|
2007
|
+
}, context.palette, candidates, { compositeBase: context.compositeBase });
|
|
2008
|
+
const background = {
|
|
2009
|
+
type: "color",
|
|
2010
|
+
color: paint.token,
|
|
2011
|
+
textColor
|
|
2012
|
+
};
|
|
2013
|
+
return measuredBackdrop ? resolveSurfaceForeground(background, context.palette, candidates, { measuredBackdrop }) : resolveSurfaceForeground(background, context.palette, candidates, { compositeBase: context.compositeBase });
|
|
1715
2014
|
}
|
|
1716
2015
|
/** A paint the element owns but that resolves as inherited (an empty token) still blocks outer inks. */
|
|
1717
2016
|
function ownedInkPublication(resolved, context) {
|
|
@@ -1731,23 +2030,37 @@ function ownedForegroundRoles(resolved, text, candidates) {
|
|
|
1731
2030
|
muted: fallback
|
|
1732
2031
|
});
|
|
1733
2032
|
}
|
|
1734
|
-
function
|
|
2033
|
+
function surfaceButtons(paint, link, primaryToken, context, backgroundSamples) {
|
|
1735
2034
|
return resolveSurfaceButtonContext({
|
|
1736
2035
|
surface: paint.kind === "solid" ? {
|
|
1737
2036
|
kind: "solid",
|
|
1738
2037
|
color: paint.token,
|
|
1739
2038
|
composited: false,
|
|
1740
|
-
foreground:
|
|
2039
|
+
foreground: link,
|
|
1741
2040
|
...backgroundSamples ? { backgroundSamples } : {}
|
|
1742
2041
|
} : { kind: "gradient" },
|
|
1743
2042
|
palette: context.palette,
|
|
1744
2043
|
colourIndex: context.colourIndex,
|
|
1745
2044
|
buttonSystem: context.buttonSystem,
|
|
1746
2045
|
fallbackToken: context.compositeBase,
|
|
1747
|
-
primaryToken
|
|
2046
|
+
primaryToken,
|
|
1748
2047
|
withoutButtonSystem: "reset"
|
|
1749
2048
|
});
|
|
1750
2049
|
}
|
|
2050
|
+
/** Buttons on a certified paint use the link ink the certificate kept, which may be the black/white fallback. */
|
|
2051
|
+
function withCertifiedButtons(decision, context) {
|
|
2052
|
+
const { primaryButton, ...certified } = decision;
|
|
2053
|
+
return {
|
|
2054
|
+
...certified,
|
|
2055
|
+
buttonContext: surfaceButtons(decision.paint, decision.foreground.link, primaryButton, context, tintGroundSamples(decision, context))
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
/** A radial tint's grounds besides its painted end, so its buttons are judged on every sample. */
|
|
2059
|
+
function tintGroundSamples(decision, context) {
|
|
2060
|
+
if (decision.tintBase === void 0) return void 0;
|
|
2061
|
+
const [first, ...rest] = surfaceBackdrops(decision, context).slice(0, -1);
|
|
2062
|
+
return first === void 0 ? void 0 : [first, ...rest];
|
|
2063
|
+
}
|
|
1751
2064
|
function surfaceContrast(roles, backdrop, palette, colourIndex) {
|
|
1752
2065
|
const ratio = (token) => contrastRatio(resolveOpaqueSurfaceHex(token, palette, backdrop) ?? backdrop, backdrop, colourIndex);
|
|
1753
2066
|
return {
|
|
@@ -1791,8 +2104,7 @@ function resolveSectionSurface(background, context) {
|
|
|
1791
2104
|
buttonContext,
|
|
1792
2105
|
proof: sectionProof(background, foreground),
|
|
1793
2106
|
revision,
|
|
1794
|
-
textPolicy: surfaceTextPolicy
|
|
1795
|
-
[resolvedSurfaceBrand]: true
|
|
2107
|
+
textPolicy: surfaceTextPolicy
|
|
1796
2108
|
};
|
|
1797
2109
|
Object.defineProperties(result, {
|
|
1798
2110
|
buttonContext: { enumerable: false },
|
|
@@ -1818,36 +2130,49 @@ function resolveTintSurface(spec, context) {
|
|
|
1818
2130
|
kind: "token",
|
|
1819
2131
|
token: spec.base
|
|
1820
2132
|
}, context);
|
|
1821
|
-
const source = spec.source
|
|
2133
|
+
const source = tintSource(spec.source, base, context.palette);
|
|
1822
2134
|
const token = source ? resolveOpaqueSurfaceHex(`${source}/${spec.opacity}`, context.palette, spec.base) : null;
|
|
1823
2135
|
const hex = source ? resolveConcreteColorHex(source, context.palette) : null;
|
|
1824
2136
|
const tinted = token ?? (hex ? resolveOpaqueSurfaceHex(hexToRgba(hex, spec.opacity / 100), context.palette, spec.base) : null);
|
|
1825
2137
|
if (!tinted) throw new Error(`Cannot derive tint on ${spec.base}`);
|
|
1826
|
-
|
|
2138
|
+
const solid = resolveDeclaredSolidSurface({
|
|
1827
2139
|
kind: "solid",
|
|
1828
2140
|
token: tinted
|
|
1829
2141
|
}, {
|
|
1830
2142
|
...context,
|
|
2143
|
+
buttonContext: surfaceButtonRequest(spec, context),
|
|
1831
2144
|
foreground: base.foreground
|
|
1832
|
-
}, spec.gradient === "radial" ? spec.base : void 0);
|
|
1833
|
-
}
|
|
1834
|
-
/** A sampled gradient may never borrow a proof for just its painted endpoint. */
|
|
1835
|
-
function checkedTintSamples(surface, base, palette) {
|
|
1836
|
-
const paint = resolveOpaqueSurfaceHex(surface.paint.token, palette, base);
|
|
1837
|
-
const underlay = resolveOpaqueSurfaceHex(base, palette, "background");
|
|
1838
|
-
if (!paint || !underlay) throw new Error("Tint needs a measurable underlay");
|
|
1839
|
-
const samples = [underlay, ...[
|
|
1840
|
-
.25,
|
|
1841
|
-
.5,
|
|
1842
|
-
.75
|
|
1843
|
-
].map((alpha) => compositeHex(paint, alpha, underlay))];
|
|
1844
|
-
Object.entries(surface.foreground).forEach(([role, token]) => {
|
|
1845
|
-
if (![paint, ...samples].every((sample) => {
|
|
1846
|
-
const ink = resolveOpaqueSurfaceHex(token, palette, sample);
|
|
1847
|
-
return ink !== null && contrastRatio(ink, sample) >= (role === "heading" ? 3 : 4.5);
|
|
1848
|
-
})) throw new RangeError(`No checked tint gradient for ${role} on ${base}`);
|
|
1849
2145
|
});
|
|
1850
|
-
return
|
|
2146
|
+
return spec.gradient === "radial" ? {
|
|
2147
|
+
...solid,
|
|
2148
|
+
inks: { kind: "reset" },
|
|
2149
|
+
tintBase: spec.base
|
|
2150
|
+
} : solid;
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* The button colour a surface asks for, which it also hands to what is painted on it. An explicit request
|
|
2154
|
+
* wins; otherwise a paint asks for its own button context, and a shade for the context of the paint it shades.
|
|
2155
|
+
* The request is checked anew on every surface that receives it.
|
|
2156
|
+
*/
|
|
2157
|
+
function surfaceButtonRequest(spec, context) {
|
|
2158
|
+
const forToken = (token) => context.buttonContext ?? context.buttonSystem?.surfaceContexts?.[token];
|
|
2159
|
+
switch (spec.kind) {
|
|
2160
|
+
case "token": return spec.buttonContext ?? forToken(spec.token);
|
|
2161
|
+
case "tint": return spec.source === "shade" ? forToken(spec.base) : context.buttonContext;
|
|
2162
|
+
case "paint": return spec.paint.kind === "solid" ? forToken(spec.paint.token) : context.buttonContext;
|
|
2163
|
+
case "recipe": return context.buttonContext;
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
/** Shade direction belongs to the palette, while the tint's base is the actual paint. */
|
|
2167
|
+
function tintSource(source, base, palette) {
|
|
2168
|
+
switch (source) {
|
|
2169
|
+
case "text": return base.foreground.text;
|
|
2170
|
+
case "mark": return base.decorations?.mark;
|
|
2171
|
+
case "shade": {
|
|
2172
|
+
const background = resolveOpaqueSurfaceHex("background", palette, "background");
|
|
2173
|
+
return background && featuresFromHex(background).Y < .5 ? "#ffffff" : "#000000";
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
1851
2176
|
}
|
|
1852
2177
|
function hexToRgba(hex, alpha) {
|
|
1853
2178
|
const { r, g, b } = hexToRgb(hex);
|
|
@@ -1897,7 +2222,11 @@ const surfaceSpecSchema = z.discriminatedUnion("kind", [
|
|
|
1897
2222
|
z.object({
|
|
1898
2223
|
kind: z.literal("tint"),
|
|
1899
2224
|
base: z.string(),
|
|
1900
|
-
source: z.enum([
|
|
2225
|
+
source: z.enum([
|
|
2226
|
+
"text",
|
|
2227
|
+
"mark",
|
|
2228
|
+
"shade"
|
|
2229
|
+
]),
|
|
1901
2230
|
opacity: z.number().finite(),
|
|
1902
2231
|
gradient: z.literal("radial").optional()
|
|
1903
2232
|
})
|
|
@@ -1949,9 +2278,8 @@ function certifySurface(spec, context) {
|
|
|
1949
2278
|
})
|
|
1950
2279
|
})
|
|
1951
2280
|
};
|
|
1952
|
-
const decision = resolveSurfaceSpec(inputs.spec, inputs.context);
|
|
2281
|
+
const decision = certifyThresholds(resolveSurfaceSpec(inputs.spec, inputs.context), inputs.context);
|
|
1953
2282
|
const result = Object.assign(surfaceProof(decision, spec), {
|
|
1954
|
-
[resolvedSurfaceBrand]: true,
|
|
1955
2283
|
revision,
|
|
1956
2284
|
textPolicy: surfaceTextPolicy,
|
|
1957
2285
|
$surface: inputs
|
|
@@ -1968,6 +2296,71 @@ function certifySurface(spec, context) {
|
|
|
1968
2296
|
function isSolidSurfaceDecision(decision) {
|
|
1969
2297
|
return decision.kind === "owned" && decision.contrast.kind === "measured";
|
|
1970
2298
|
}
|
|
2299
|
+
function isSolidInkDecision(decision) {
|
|
2300
|
+
return decision.kind === "owned" && decision.contrast.kind === "measured";
|
|
2301
|
+
}
|
|
2302
|
+
const TINT_SAMPLE_ALPHAS = [
|
|
2303
|
+
0,
|
|
2304
|
+
.25,
|
|
2305
|
+
.5,
|
|
2306
|
+
.75,
|
|
2307
|
+
1
|
|
2308
|
+
];
|
|
2309
|
+
/**
|
|
2310
|
+
* The certificate asserts every threshold it measures, on every backdrop the
|
|
2311
|
+
* paint shows (each sample of a radial tint). It never throws, because owner
|
|
2312
|
+
* palettes are arbitrary: an ink that misses takes the black/white ink, and a
|
|
2313
|
+
* radial tint that no ink can clear paints flat. Buttons are derived from the
|
|
2314
|
+
* certified inks, so they never keep a link ink the certificate replaced, and
|
|
2315
|
+
* the button resolver judges them on every sample of a radial tint.
|
|
2316
|
+
*/
|
|
2317
|
+
function certifyThresholds(decision, context) {
|
|
2318
|
+
if (!isSolidInkDecision(decision)) return decision;
|
|
2319
|
+
const inks = withFallbackInks(decision, context);
|
|
2320
|
+
if (inks) return withCertifiedButtons(inks, context);
|
|
2321
|
+
const { tintBase: _flattened, ...flatTint } = decision;
|
|
2322
|
+
const flat = withFallbackInks(flatTint, context) ?? flatTint;
|
|
2323
|
+
return withCertifiedButtons({
|
|
2324
|
+
...flat,
|
|
2325
|
+
contrast: {
|
|
2326
|
+
...flat.contrast,
|
|
2327
|
+
fallback: ["radial-tint", ...flat.contrast.fallback ?? []]
|
|
2328
|
+
}
|
|
2329
|
+
}, context);
|
|
2330
|
+
}
|
|
2331
|
+
/** Every backdrop a solid paint shows: its colour, or each sample from a radial tint's base to its paint. */
|
|
2332
|
+
function surfaceBackdrops(decision, context) {
|
|
2333
|
+
const paint = resolveOpaqueSurfaceHex(decision.paint.token, context.palette, decision.tintBase ?? context.compositeBase);
|
|
2334
|
+
if (!paint) return [];
|
|
2335
|
+
const underlay = decision.tintBase ? resolveOpaqueSurfaceHex(decision.tintBase, context.palette, "background") : null;
|
|
2336
|
+
return underlay ? TINT_SAMPLE_ALPHAS.map((alpha) => compositeHex(paint, alpha, underlay)) : [paint];
|
|
2337
|
+
}
|
|
2338
|
+
/** Null only when no black/white ink clears every backdrop of a radial tint. */
|
|
2339
|
+
function withFallbackInks(decision, context) {
|
|
2340
|
+
const backdrops = surfaceBackdrops(decision, context);
|
|
2341
|
+
const [endpoint] = backdrops.slice(-1);
|
|
2342
|
+
if (!endpoint) return decision;
|
|
2343
|
+
const certified = certifySurfaceInks({
|
|
2344
|
+
foreground: decision.foreground,
|
|
2345
|
+
mark: decision.decorations?.mark
|
|
2346
|
+
}, backdrops, context);
|
|
2347
|
+
if (!certified) return null;
|
|
2348
|
+
if (certified.fallback.length === 0) return decision;
|
|
2349
|
+
const decorations = decision.decorations && certified.mark !== void 0 ? {
|
|
2350
|
+
...decision.decorations,
|
|
2351
|
+
mark: certified.mark
|
|
2352
|
+
} : decision.decorations;
|
|
2353
|
+
const contrast = surfaceContrast(certified.foreground, endpoint, context.palette, context.colourIndex);
|
|
2354
|
+
return {
|
|
2355
|
+
...decision,
|
|
2356
|
+
foreground: certified.foreground,
|
|
2357
|
+
decorations,
|
|
2358
|
+
contrast: {
|
|
2359
|
+
...contrast,
|
|
2360
|
+
fallback: certified.fallback
|
|
2361
|
+
}
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
1971
2364
|
function surfaceProof(decision, spec) {
|
|
1972
2365
|
if (decision.kind === "inherit") return {
|
|
1973
2366
|
...decision,
|
|
@@ -1977,7 +2370,7 @@ function surfaceProof(decision, spec) {
|
|
|
1977
2370
|
...decision,
|
|
1978
2371
|
proof: "unproven-media"
|
|
1979
2372
|
};
|
|
1980
|
-
const proof =
|
|
2373
|
+
const proof = decision.tintBase !== void 0 ? "checked-gradient-or-scrim" : spec.kind === "tint" || /\/|rgba\(/.test(decision.paint.token) ? "checked-composited" : "checked-solid";
|
|
1981
2374
|
return {
|
|
1982
2375
|
...decision,
|
|
1983
2376
|
proof
|
|
@@ -2057,12 +2450,10 @@ function parseSurfaceTree(value, solvedInks) {
|
|
|
2057
2450
|
if (!isSurfaceTreeRecord(value) || !("$surfaceTransport" in value)) return mapSurfaceTreeChildren(value, (item) => parseSurfaceTree(item, solvedInks));
|
|
2058
2451
|
const envelope = surfaceEnvelopeSchema.parse(value)[SURFACE_TRANSPORT_KEY];
|
|
2059
2452
|
const revisions = envelope.revisions.map((revision) => {
|
|
2060
|
-
|
|
2453
|
+
return ownSurfaceRevision(ownedThemeSnapshot({
|
|
2061
2454
|
palette: revision.palette,
|
|
2062
2455
|
buttonSystem: revision.buttonSystem
|
|
2063
|
-
});
|
|
2064
|
-
registerOwnedRevisionInputs(owned);
|
|
2065
|
-
return ownSurfaceRevision(owned);
|
|
2456
|
+
}));
|
|
2066
2457
|
});
|
|
2067
2458
|
const decode = (item) => {
|
|
2068
2459
|
if (isSurfaceTreeRecord(item) && "$surfaceRevision" in item) {
|
|
@@ -2099,4 +2490,4 @@ function mapSurfaceTreeChildren(value, map) {
|
|
|
2099
2490
|
return isSurfaceTreeRecord(value) ? Object.fromEntries(Object.entries(value).map(([key, item]) => [key, map(item)])) : value;
|
|
2100
2491
|
}
|
|
2101
2492
|
//#endregion
|
|
2102
|
-
export {
|
|
2493
|
+
export { ownedThemeSnapshot as A, resolveConcreteColorHex as B, mapButtonRoleAppearances as C, resolveThemeColorReferenceValue as D, resolveOnColorForThemeToken as E, HOVER_TEXT_THRESHOLD as F, paletteValueKey as H, certifyPaint as I, contrastThresholdByPolicy as L, safeTokenOr as M, surfaceInkPublication as N, resolveTokenOrCssColorValue as O, solveSurfaceInks as P, inkReference as R, defineButtonStyleRecipe as S, isCssColorLiteral as T, paletteValueKeySchema as U, resolveOpaqueSurfaceHex as V, requirePaletteColorsFromEntries as W, buttonStateAppearanceDeclarations as _, resolveSurface as a, paddingDeclarations as b, surfaceDecorationColors as c, scrimTone as d, actionVariableFallback as f, buttonShadow as g, buttonRadius as h, requireResolvedSurface as i, resolveSurfaceForeground as j, freezeOwnedThemeValue as k, compositeHex as l, buttonBorder as m, parseSurfaceTree as n, serializeSurfaceTree as o, contextualButtonSurfaceResetStyles as p, prepareSurfaceIndex as r, surfaceButtonRequest as s, parseResolvedSurface as t, gradientScrimSamples as u, buttonTypographyDeclarations as v, mapButtonVisualAppearances as w, PUBLIC_BUTTON_ROLES as x, materializeRuntimeButtonAppearance as y, planForegroundHover as z };
|