@riverbankcms/sdk 0.158.0 → 0.160.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/README.md +25 -6
- package/dist/_dts/{BlocksIslandsHydrator-BgNBtEai.d.ts → BlocksIslandsHydrator-CoqeotCL.d.ts} +1 -1
- package/dist/_dts/{Page-DpCo8zXD.d.ts → Page-C0ENVLCF.d.ts} +13 -6
- package/dist/_dts/{SdkPreviewMode-Bv2TMscG.d.ts → SdkPreviewMode-jZK0A49V.d.ts} +54 -126
- package/dist/_dts/{client-B960v2gW.d.ts → client-uMMuPq9V.d.ts} +23 -1
- package/dist/_dts/{content-types-CN0Wy8V6.d.ts → content-types-D6nXGqdQ.d.ts} +18 -18
- package/dist/_dts/{contracts-BFUrby76.d.ts → contracts-Bnmj1nxu.d.ts} +6 -5
- package/dist/_dts/{footerPageOutline-CmoqleLS.d.ts → footerPageOutline-CeLjFX8b.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-Dkvivc3R.d.ts → generatePageMetadata-nyU8q02J.d.ts} +5 -2
- package/dist/_dts/{index-DPfI2t5A.d.ts → index-BaaGBY1v.d.ts} +2 -2
- package/dist/_dts/{index-DCNu_8it.d.ts → index-Bg64CkV-.d.ts} +4 -4
- package/dist/_dts/index-Blwl7yl6.d.ts +13 -0
- package/dist/_dts/{index-DaS_z6ir.d.ts → index-C5xslEBn.d.ts} +2 -2
- package/dist/_dts/{index-DpgkhY-a.d.ts → index-CEaKil7G.d.ts} +2 -2
- package/dist/_dts/{index-Ba6RmuxX.d.ts → index-DahMwisK.d.ts} +3 -3
- package/dist/_dts/index-lkpjIg5i.d.ts +66 -0
- package/dist/_dts/{index-DfkFWUxt.d.ts → index-nVoi_74l.d.ts} +2 -2
- package/dist/_dts/{loadContent-DvvKF4nB.d.ts → loadContent-CYLmzvLq.d.ts} +16 -7
- package/dist/_dts/{resolvePageContent-D0lGwVD6.d.ts → resolvePageContent-DqnxChOs.d.ts} +2 -2
- package/dist/_dts/{constants-DkcKHMX-.d.ts → runtime-BY8DQBbT.d.ts} +10 -16
- package/dist/_dts/{hosted-booking-appearance-BIbit60h.d.ts → schema-D0bNcPWK.d.ts} +6921 -6768
- 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 +12 -6
- 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/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +6 -6
- package/dist/_dts/sdk/src/metadata/index.d.ts +8 -2
- 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 +10 -28
- 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/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/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-BJrRUaY7.d.ts → types-CFrYuXYP.d.ts} +2 -2
- package/dist/_dts/{navigation-n-eTVTIQ.d.ts → types-D8czmbQF.d.ts} +15430 -16836
- package/dist/_dts/{types-BY7PgnDi.d.ts → types-DSgmJ15W.d.ts} +7 -7
- package/dist/_dts/{types-maEnXL6Z.d.ts → types-Dm-KW7nj.d.ts} +10 -13
- package/dist/_dts/{validation-BjuVrMrs.d.ts → validation-Bmb4WnHg.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-WRLS96Ev.mjs → BlocksIslandsHydrator-DZRKi6tT.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-eovghMPa.mjs → BookingMailingListNote-C00sLLdL.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-CIcMQRc1.mjs → CalendarNavigationChevron-CHSi9b3E.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BF9eCNno.mjs → CheckboxChoice-Bhm6RAUL.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CdnFgDyQ.mjs → DemoBookingPortalAccess-CaN-7ui7.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-DHxYgkT6.mjs → DemoPortalSignInLink-ClxN5_xZ.mjs} +1 -1
- package/dist/client/{EventCalendar.client-Dc-ZLxKo.mjs → EventCalendar.client-BncvSa1n.mjs} +10 -9
- package/dist/client/{EventCombined.client-C93XqRIv.mjs → EventCombined.client-DluBxVVu.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B3XUyNY9.mjs → EventEmbeddedCheckoutStep-BiJrMtfp.mjs} +1 -1
- package/dist/client/{EventItem-DnCTygqk.mjs → EventItem-CXhnT9pF.mjs} +11 -6
- package/dist/client/{EventListWeekNavigation-9h97heuQ.mjs → EventListWeekNavigation-V-dtoDlD.mjs} +1 -1
- package/dist/client/{EventListing.client-DFKlQvvs.mjs → EventListing.client-DPO6SZbx.mjs} +3 -3
- package/dist/client/{EventListing.view-pAuTDyrP.mjs → EventListing.view-B-Yi5JZS.mjs} +7 -7
- package/dist/client/{EventRegistrationPayment-rgKlBvhP.mjs → EventRegistrationPayment-Dc3Fnlnw.mjs} +189 -176
- package/dist/client/{LeafletStaticMap-3XiWSgy0.mjs → LeafletStaticMap-ClZCCzAm.mjs} +1 -1
- package/dist/client/{Page-BmpeAwID.mjs → Page-7PkzO04N.mjs} +1949 -2074
- package/dist/client/{StepIndicator-qEq6X5zP.mjs → StepIndicator-DiD6euZ8.mjs} +3 -3
- package/dist/client/{TabBarFragment-DvzIV75f.mjs → TabBarFragment-BHd8GN8y.mjs} +1 -1
- package/dist/client/{ThemedButton-DVBC_pS9.mjs → ThemedButton-C22C9cCF.mjs} +174 -93
- package/dist/client/{accordion-DeObOasQ.mjs → accordion-2m27DsIk.mjs} +1 -1
- package/dist/client/{booking-form.client-DfWeF0lj.mjs → booking-form.client-BddWV5w1.mjs} +12 -12
- package/dist/client/{bookingForm-TnzIBHx2.mjs → bookingForm-bcdXQjmw.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-kkFnbr5Z.mjs → carousel-D7nj9I0y.mjs} +2 -2
- package/dist/client/{carousel.client-BJGoJVtg.mjs → carousel.client-AffDJo_s.mjs} +1 -1
- package/dist/client/{cart-BAXNbFux.mjs → cart-PN6yCw1H.mjs} +3 -3
- package/dist/client/{cart.client-BczxUF70.mjs → cart.client-D4t1f0cJ.mjs} +1 -1
- package/dist/client/{checkout-C5NRhPeP.mjs → checkout-CsTwXVSb.mjs} +3 -3
- package/dist/client/{checkout.client-BuDk3Td9.mjs → checkout.client-BhQE3zY7.mjs} +1 -1
- package/dist/client/client.mjs +25 -13
- package/dist/client/{context-CVsgML69.mjs → context-BLAvalAa.mjs} +1 -1
- package/dist/client/{cta-BWnUuJce.mjs → cta-CUXhX_D7.mjs} +2 -1
- package/dist/client/dateFormatting-BHIHxNuo.mjs +61 -0
- package/dist/client/{demoPortalMagicLink-CUlwvmxf.mjs → demoPortalMagicLink-R-awbk_0.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Cw8nnFj-.mjs → enhanceHeaderSection-9Q93uvTo.mjs} +3 -3
- package/dist/client/{event-details.client-Bl0E_6Vi.mjs → event-details.client-BS1WtG-a.mjs} +2 -2
- package/dist/client/{event-registration.client-DmfLg_LC.mjs → event-registration.client-BXndwsET.mjs} +35 -21
- package/dist/client/{eventCalendar-D1Dwb9VA.mjs → eventCalendar-HyoOt1Qz.mjs} +4 -4
- package/dist/client/{eventCombined-DfsqY1qR.mjs → eventCombined-sdG5oEaH.mjs} +4 -4
- package/dist/client/{eventDetails-BmugDVoa.mjs → eventDetails-FFAknE4w.mjs} +2 -2
- package/dist/client/{eventListing-BPAGJi3C.mjs → eventListing-CGK6urk3.mjs} +4 -4
- package/dist/client/{eventRegistration-DBlz_x6u.mjs → eventRegistration-VhrvCs4l.mjs} +4 -4
- package/dist/client/{form-DVu3ZMjx.mjs → form-C-B5O_ko.mjs} +3 -3
- package/dist/client/{form.client-QZUyABIY.mjs → form.client-DoZVcl8d.mjs} +5 -5
- package/dist/client/{form.parts-Bs0F3v08.mjs → form.parts-mttKpgif.mjs} +3 -3
- package/dist/client/{formatDate-BD9D3dgo.mjs → formatDate-xUSCknEO.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-BQwWW4Yy.mjs → headerSection-BHUEXsaI.mjs} +2 -2
- package/dist/client/{location-map.client-upKuwABk.mjs → location-map.client-Cylb_MHw.mjs} +2 -2
- package/dist/client/{location-map.view-RuBCD10O.mjs → location-map.view-Cx4Bl7ij.mjs} +69 -6
- package/dist/client/{locationMap-1sCbsk0V.mjs → locationMap-QnKJi-nZ.mjs} +2 -2
- package/dist/client/{newsletter-form.client-DBTU3oNv.mjs → newsletter-form.client-D_n0rftg.mjs} +8 -8
- package/dist/client/{newsletter-form.parts-C9I9JBhe.mjs → newsletter-form.parts-DKHye4IE.mjs} +2 -2
- package/dist/client/{newsletterForm-DTPtTxxG.mjs → newsletterForm-tEaYelzx.mjs} +3 -3
- package/dist/client/{noop-DMFt3KdC.mjs → noop-B610YKEx.mjs} +12 -5
- package/dist/client/portal/client.mjs +4562 -174
- package/dist/client/{product-detail.client-BX7M5o6p.mjs → product-detail.client-DUf5x5Jt.mjs} +1 -1
- package/dist/client/{product-list.client-i32QNY4c.mjs → product-list.client-Cqp1BPTV.mjs} +1 -1
- package/dist/client/{productDetail-DWjE9zm7.mjs → productDetail-B8bBiogP.mjs} +3 -3
- package/dist/client/{productList-DZH9_brv.mjs → productList-BKN4D-1z.mjs} +3 -3
- package/dist/client/{propsDecoder-CTzHkEkh.mjs → propsDecoder-2nNZh2Oe.mjs} +3 -3
- package/dist/client/{registry.server-vJ5FlscU.mjs → registry.server-BAm4RPNJ.mjs} +856 -872
- package/dist/client/rendering/client.mjs +27 -26
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +47 -28
- package/dist/client/{richText-coerce-DXAmC72p.mjs → richText-coerce-Cv-qomNB.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CmC7ygin.mjs → routeIslandApiConfig-C5u8MbAA.mjs} +1 -1
- package/dist/client/{shop-C7eL3B37.mjs → shop-DZNC0VKk.mjs} +3 -3
- package/dist/client/{shop-commerce-D8oRN0QJ.mjs → shop-commerce-DdX4LSa3.mjs} +12 -12
- package/dist/client/{shop-commerce-store-CRnQ4M18.mjs → shop-commerce-store-BJtrZov9.mjs} +1 -1
- package/dist/client/{shop.client-X6d6KVmA.mjs → shop.client-DmDd-igg.mjs} +16 -15
- package/dist/client/{shop.interactive-DBMeM8VD.mjs → shop.interactive-5SnnDHz3.mjs} +402 -35
- package/dist/client/{shopShared-Y182kN_s.mjs → shopShared-CPqUlAh9.mjs} +2 -2
- package/dist/client/{src-7cXhT0G_.mjs → src-VIsPY-kw.mjs} +6 -1
- package/dist/client/timetableModel-C19rcHEw.mjs +960 -0
- package/dist/client/{useAvailableSlots-BDV6MHgJ.mjs → useAvailableSlots-BjbJXotk.mjs} +3 -3
- package/dist/client/{useBookingNowIso-DgJEv3ZY.mjs → useBookingNowIso-CMgfL7YJ.mjs} +1 -1
- package/dist/client/{useDiscountApply-BTu9EeT7.mjs → useDiscountApply-KG8jB7WC.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-BfZxdxI-.mjs → useDiscountCodeUi-DK2w_i0a.mjs} +1 -1
- package/dist/client/{useEventPagination-pnvdHGeQ.mjs → useEventPagination-DW6MCirb.mjs} +11 -10
- package/dist/client/uuid-BETKW8rS.mjs +12 -0
- package/dist/client/{view-hJr_L4QC2.mjs → view-CkUn3Y0Y.mjs} +4 -4
- package/dist/client/{view-BPEa6Okm.mjs → view-CseyBW07.mjs} +15 -70
- package/dist/client/{wizardSteps-HdyGoIG3.mjs → wizardSteps-zgq10lN1.mjs} +262 -65
- package/dist/preview-next/before-render.mjs +1 -1
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-BFlBqSu4.mjs → EventEmbeddedCheckoutStep-lUHBrzHv.mjs} +1 -1
- package/dist/preview-next/client/{PreviewEditorSidebar-CXRUbqMp.mjs → PreviewEditorSidebar-DWyUGCAG.mjs} +1217 -107
- package/dist/preview-next/client/{PreviewEditorUI-CxjEV0Fm.mjs → PreviewEditorUI-Wq0b3Daw.mjs} +52 -79
- package/dist/preview-next/client/{SdkPreviewModeRuntime-XdQSGGj_.mjs → SdkPreviewModeRuntime-BtZPcwYV.mjs} +1 -1
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BxI12BBS.mjs → SdkPreviewModeRuntime-wSI_R361.mjs} +720 -2035
- package/dist/preview-next/client/{SiteChromeCustomizeContext-CfRQRwpH.mjs → SiteChromeCustomizeContext-Hc4pYnNe.mjs} +14365 -8155
- package/dist/preview-next/client/{ThemedButton-BEOPss9H.mjs → ThemedButton-DzeycIlD.mjs} +204 -93
- package/dist/preview-next/client/{previewChromeSurface-CH7hd5n7.mjs → previewChromeSurface-Corq4AG7.mjs} +3 -8
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-C6xEU1LI.mjs → sdk-runtime-CWymRWhK.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-QZkJRHl5.mjs +1359 -0
- package/dist/preview-next/client/{spinner-BTf1CZmy.mjs → spinner-C4If5Y-O.mjs} +1 -1
- package/dist/preview-next/editor-base.css +62 -0
- package/dist/preview-next/editor-chrome.css +85 -0
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DM22uOXM.mjs → route-contract-8csADeIT.mjs} +149 -112
- package/dist/server/{Block.shared-DLoilC2J.mjs → Block.shared-D1_gonwM.mjs} +6 -6
- package/dist/server/{bindings-C7DKLVx_.mjs → bindings-CFmJg5lm.mjs} +2 -2
- package/dist/server/{client-CU4wlMLE.mjs → client-DPsi0Dai.mjs} +9 -7
- package/dist/server/config-template-validation.mjs +50 -10
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{generatePageMetadata-CPvssVOp.mjs → generatePageMetadata-DB_lbrZ7.mjs} +28 -2
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-DmQ4BiiQ.mjs → loadContent-RMCcuVU_.mjs} +33 -20
- package/dist/server/loadPage-DUPP51C-.mjs +2 -0
- package/dist/server/{loadPage-BBkDQA57.mjs → loadPage-DhDGzj7t.mjs} +8 -5
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/metadata.mjs +2 -2
- package/dist/server/next.mjs +13 -12
- package/dist/server/{overrideResolution-ByeAbLSO.mjs → overrideResolution-OxY5FMuy.mjs} +1 -1
- package/dist/server/{overrides-BcA6ZPWf.mjs → overrides-Bz_A6sB9.mjs} +586 -518
- package/dist/server/page-converter.mjs +8 -10
- package/dist/server/{prebuild-8T-m7XjB.mjs → prebuild-B_1vrSru.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Bjya-X9t.mjs → prefetchBlockData-B7ukYXXR.mjs} +841 -887
- package/dist/server/{publicProducts-C3meXS2o.mjs → publicProducts-Djbpc81A.mjs} +166 -129
- package/dist/server/{blocks-jlIm0PWc.mjs → registry-eFjKtEhF.mjs} +2349 -1716
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-D0ow8PRJ.mjs → resolveBlockData-DYvEa9c5.mjs} +6 -3
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-Bs735S27.mjs → schema-C3dJ5UkL.mjs} +148 -88
- package/dist/server/server.mjs +3 -3
- package/dist/server/{siteChromeOverlayClearance-BangtD8A.mjs → siteChromeOverlayClearance-DALIAMwo.mjs} +108 -11
- package/dist/server/{src-B935_bzN.mjs → src-C5Mu-z0F.mjs} +268 -189
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-D2-BnmDO.mjs → themeAdmission-ruoyXb_0.mjs} +9 -7
- package/dist/server/{three-pass-converter-CmmchOFC.mjs → three-pass-converter-Chnb1XD-.mjs} +2 -58
- package/dist/server/{validation-Cm41pDUB.mjs → validation-B-Xar8QS.mjs} +22 -63
- package/dist/server/{version-Bo9C3McI.mjs → version-Bg7VHK3i.mjs} +1 -1
- package/dist/styles/index.css +78 -0
- package/package.json +8 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-cnymEAZY.d.ts +0 -1
- package/dist/client/timetableModel-D7PwpaBY.mjs +0 -480
- package/dist/preview-next/client/siteStyleAccess-CRXaC2oL.mjs +0 -1326
- package/dist/server/loadPage-ZrcfjG3X.mjs +0 -2
|
@@ -791,10 +791,6 @@ const eventRegistrationErrors = {
|
|
|
791
791
|
message: "Card payments aren’t available on this web address yet. Please contact the organiser to book.",
|
|
792
792
|
action: "none"
|
|
793
793
|
},
|
|
794
|
-
checkoutTemporarilyUnavailable: {
|
|
795
|
-
message: "Event payments are temporarily unavailable while we make an update. Please try again later.",
|
|
796
|
-
action: "retry"
|
|
797
|
-
},
|
|
798
794
|
paymentPageUnavailable: {
|
|
799
795
|
message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
|
|
800
796
|
action: "retry"
|
|
@@ -3333,11 +3329,33 @@ function relativeLuminance(r, g, b) {
|
|
|
3333
3329
|
const R = srgbToLinear(r), G = srgbToLinear(g), B = srgbToLinear(b);
|
|
3334
3330
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
3335
3331
|
}
|
|
3336
|
-
function
|
|
3337
|
-
const
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3332
|
+
function preparePaletteColourIndex(palette) {
|
|
3333
|
+
const colours = [.../* @__PURE__ */ new Set([
|
|
3334
|
+
...Object.values(palette),
|
|
3335
|
+
"#000000",
|
|
3336
|
+
"#ffffff",
|
|
3337
|
+
"#FFFFFF"
|
|
3338
|
+
])];
|
|
3339
|
+
return Object.freeze(Object.fromEntries(colours.flatMap(colourIndexEntry)));
|
|
3340
|
+
}
|
|
3341
|
+
/** An unused unsupported colour must not turn preparation into an eager validation failure. */
|
|
3342
|
+
function colourIndexEntry(hex) {
|
|
3343
|
+
try {
|
|
3344
|
+
return [[hex, colourLuminance(hex)]];
|
|
3345
|
+
} catch {
|
|
3346
|
+
return [];
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
function colourLuminance(hex) {
|
|
3350
|
+
const { r, g, b } = hexToRgb(hex);
|
|
3351
|
+
return relativeLuminance(r, g, b);
|
|
3352
|
+
}
|
|
3353
|
+
function indexedLuminance(hex, index) {
|
|
3354
|
+
return (index && Object.prototype.hasOwnProperty.call(index, hex) ? index[hex] : void 0) ?? colourLuminance(hex);
|
|
3355
|
+
}
|
|
3356
|
+
function contrastRatio(hex1, hex2, index) {
|
|
3357
|
+
const L1 = indexedLuminance(hex1, index);
|
|
3358
|
+
const L2 = indexedLuminance(hex2, index);
|
|
3341
3359
|
const [hi, lo] = L1 >= L2 ? [L1, L2] : [L2, L1];
|
|
3342
3360
|
return (hi + .05) / (lo + .05);
|
|
3343
3361
|
}
|
|
@@ -4071,6 +4089,7 @@ function defineButtonStyleRecipe(recipe) {
|
|
|
4071
4089
|
}
|
|
4072
4090
|
function mapButtonVisualAppearances(states, transform) {
|
|
4073
4091
|
return {
|
|
4092
|
+
...states,
|
|
4074
4093
|
base: transform(states.base, "base"),
|
|
4075
4094
|
hover: transform(states.hover, "hover"),
|
|
4076
4095
|
focus: transform(states.focus, "focus"),
|
|
@@ -4889,7 +4908,7 @@ function formatButtonColourContractError(error) {
|
|
|
4889
4908
|
}
|
|
4890
4909
|
}
|
|
4891
4910
|
function validateButtonSurfaceContrast(input) {
|
|
4892
|
-
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex);
|
|
4911
|
+
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex, input.colourIndex);
|
|
4893
4912
|
return ratio >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio ? { ok: true } : {
|
|
4894
4913
|
ok: false,
|
|
4895
4914
|
error: {
|
|
@@ -4904,7 +4923,7 @@ function validateButtonSurfaceContrast(input) {
|
|
|
4904
4923
|
};
|
|
4905
4924
|
}
|
|
4906
4925
|
function validateButtonTextContrast(input) {
|
|
4907
|
-
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
4926
|
+
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex, input.colourIndex);
|
|
4908
4927
|
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
4909
4928
|
ok: false,
|
|
4910
4929
|
error: {
|
|
@@ -4926,7 +4945,7 @@ function solidForegroundToken(backgroundToken) {
|
|
|
4926
4945
|
//#region ../theme-core/src/buttons/contextualHover.ts
|
|
4927
4946
|
function resolveContextualHoverPreference(input) {
|
|
4928
4947
|
const preferred = input.instruction.preferredToken;
|
|
4929
|
-
if (preferred && isSafeCandidate(preferred, input.palette, input.surface)) return {
|
|
4948
|
+
if (preferred && isSafeCandidate(preferred, input.palette, input.surface, input.colourIndex)) return {
|
|
4930
4949
|
kind: "resolved",
|
|
4931
4950
|
token: preferred,
|
|
4932
4951
|
repair: null
|
|
@@ -4954,7 +4973,7 @@ function resolveContextualHover(input) {
|
|
|
4954
4973
|
kind: "unavailable",
|
|
4955
4974
|
reason: "no-distinct-shade"
|
|
4956
4975
|
};
|
|
4957
|
-
const textSafe = candidates.filter((candidate) => hasSafeTextContrast(candidate.token, input.palette));
|
|
4976
|
+
const textSafe = candidates.filter((candidate) => hasSafeTextContrast(candidate.token, input.palette, input.colourIndex));
|
|
4958
4977
|
if (textSafe.length === 0) return {
|
|
4959
4978
|
kind: "unavailable",
|
|
4960
4979
|
reason: "no-text-safe-candidate"
|
|
@@ -4971,17 +4990,12 @@ function resolveContextualHover(input) {
|
|
|
4971
4990
|
reason: "no-text-safe-candidate"
|
|
4972
4991
|
};
|
|
4973
4992
|
}
|
|
4974
|
-
const selected = textSafe
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
const contrastDifference = (right.surfaceContrast ?? 0) - (left.surfaceContrast ?? 0);
|
|
4981
|
-
if (contrastDifference !== 0) return contrastDifference;
|
|
4982
|
-
if (left.direction === right.direction) return left.token.localeCompare(right.token);
|
|
4983
|
-
return left.direction === input.instruction.fallbackDirection ? -1 : 1;
|
|
4984
|
-
})[0];
|
|
4993
|
+
const selected = selectSurfaceSafeHover(textSafe, {
|
|
4994
|
+
palette: input.palette,
|
|
4995
|
+
surface: input.surface,
|
|
4996
|
+
colourIndex: input.colourIndex,
|
|
4997
|
+
fallbackDirection: input.instruction.fallbackDirection
|
|
4998
|
+
});
|
|
4985
4999
|
return selected ? {
|
|
4986
5000
|
kind: "resolved",
|
|
4987
5001
|
token: selected.token,
|
|
@@ -4992,6 +5006,20 @@ function resolveContextualHover(input) {
|
|
|
4992
5006
|
reason: "no-surface-safe-candidate"
|
|
4993
5007
|
};
|
|
4994
5008
|
}
|
|
5009
|
+
/** Rank the proven-surface candidates without mixing selection with fallback policy. */
|
|
5010
|
+
function selectSurfaceSafeHover(candidates, input) {
|
|
5011
|
+
return candidates.map((candidate) => ({
|
|
5012
|
+
...candidate,
|
|
5013
|
+
surfaceContrast: contrastRatio(input.palette[candidate.token] ?? "", input.surface.backgroundHex, input.colourIndex)
|
|
5014
|
+
})).filter((candidate) => candidate.surfaceContrast !== null && candidate.surfaceContrast >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio).sort((left, right) => {
|
|
5015
|
+
const distanceDifference = left.distance - right.distance;
|
|
5016
|
+
if (distanceDifference !== 0) return distanceDifference;
|
|
5017
|
+
const contrastDifference = (right.surfaceContrast ?? 0) - (left.surfaceContrast ?? 0);
|
|
5018
|
+
if (contrastDifference !== 0) return contrastDifference;
|
|
5019
|
+
if (left.direction === right.direction) return left.token.localeCompare(right.token);
|
|
5020
|
+
return left.direction === input.fallbackDirection ? -1 : 1;
|
|
5021
|
+
})[0];
|
|
5022
|
+
}
|
|
4995
5023
|
function shadeCandidates(seedToken, palette) {
|
|
4996
5024
|
const match = String(seedToken).match(/^(.*?)(?:-(\d{2,3}))?$/);
|
|
4997
5025
|
const family = match?.[1] ?? String(seedToken);
|
|
@@ -5017,14 +5045,14 @@ function candidate(family, shade, currentShade, direction, seedHex, palette) {
|
|
|
5017
5045
|
surfaceContrast: null
|
|
5018
5046
|
};
|
|
5019
5047
|
}
|
|
5020
|
-
function hasSafeTextContrast(token, palette) {
|
|
5048
|
+
function hasSafeTextContrast(token, palette, colourIndex) {
|
|
5021
5049
|
const background = palette[token];
|
|
5022
5050
|
const foreground = palette[solidForegroundToken(token)];
|
|
5023
|
-
return typeof background === "string" && typeof foreground === "string" && contrastRatio(background, foreground) >= BUTTON_CONTRAST_POLICY.textMinimumRatio;
|
|
5051
|
+
return typeof background === "string" && typeof foreground === "string" && contrastRatio(background, foreground, colourIndex) >= BUTTON_CONTRAST_POLICY.textMinimumRatio;
|
|
5024
5052
|
}
|
|
5025
|
-
function isSafeCandidate(token, palette, surface) {
|
|
5026
|
-
if (!hasSafeTextContrast(token, palette)) return false;
|
|
5027
|
-
return surface ? contrastRatio(palette[token] ?? "", surface.backgroundHex) >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio : true;
|
|
5053
|
+
function isSafeCandidate(token, palette, surface, colourIndex) {
|
|
5054
|
+
if (!hasSafeTextContrast(token, palette, colourIndex)) return false;
|
|
5055
|
+
return surface ? contrastRatio(palette[token] ?? "", surface.backgroundHex, colourIndex) >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio : true;
|
|
5028
5056
|
}
|
|
5029
5057
|
function escapeRegExp(value) {
|
|
5030
5058
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -5036,6 +5064,7 @@ function resolveButtonHoverTreatment(input) {
|
|
|
5036
5064
|
const contextual = resolveContextualHoverPreference({
|
|
5037
5065
|
instruction: input.variant.contextualHover,
|
|
5038
5066
|
palette: input.palette,
|
|
5067
|
+
colourIndex: input.colourIndex,
|
|
5039
5068
|
surface: input.surface
|
|
5040
5069
|
});
|
|
5041
5070
|
if (contextual.kind === "resolved") return {
|
|
@@ -5087,7 +5116,8 @@ function compileButtonColourStates(input) {
|
|
|
5087
5116
|
global: input.global,
|
|
5088
5117
|
fallback: base.treatment,
|
|
5089
5118
|
palette: input.palette,
|
|
5090
|
-
surface: input.surface
|
|
5119
|
+
surface: input.surface,
|
|
5120
|
+
colourIndex: input.colourIndex
|
|
5091
5121
|
});
|
|
5092
5122
|
const edge = buttonEdge(input.variant);
|
|
5093
5123
|
const colours = collectStateColours(mapVisualStates((state) => compileVisualState(input, state, state === "hover" ? hover.treatment : base.treatment, edge, base.nonColourEffects)));
|
|
@@ -5145,6 +5175,7 @@ function compileDeclaredVisualState(input, states, state, treatment) {
|
|
|
5145
5175
|
treatment: transition.treatment,
|
|
5146
5176
|
palette: input.palette,
|
|
5147
5177
|
surface: input.surface,
|
|
5178
|
+
colourIndex: input.colourIndex,
|
|
5148
5179
|
edge
|
|
5149
5180
|
});
|
|
5150
5181
|
return resolved.ok ? {
|
|
@@ -5171,6 +5202,7 @@ function compileVisualState(input, state, treatment, edge, baseEffects) {
|
|
|
5171
5202
|
treatment: transition.treatment,
|
|
5172
5203
|
palette: input.palette,
|
|
5173
5204
|
surface: input.surface,
|
|
5205
|
+
colourIndex: input.colourIndex,
|
|
5174
5206
|
edge
|
|
5175
5207
|
});
|
|
5176
5208
|
return resolved.ok ? {
|
|
@@ -5389,11 +5421,11 @@ function interpolateHex(startHex, endHex, position) {
|
|
|
5389
5421
|
* Derive only what the rendered section can honestly prove about its backing.
|
|
5390
5422
|
* Images, gradients, alpha/composite layers and arbitrary CSS remain unknown.
|
|
5391
5423
|
*/
|
|
5392
|
-
function deriveButtonSurfaceContext(input, palette, fallbackToken) {
|
|
5424
|
+
function deriveButtonSurfaceContext(input, palette, fallbackToken, colourIndex) {
|
|
5393
5425
|
const background = deriveKnownBackground(input, palette, fallbackToken);
|
|
5394
5426
|
if (background.kind === "unknown") return background;
|
|
5395
5427
|
const explicitForeground = resolveKnownColour(input.kind === "solid" || input.kind === "inherit" ? input.foreground ?? "" : "", palette);
|
|
5396
|
-
const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex) >= 4.5 ? explicitForeground : safestBlackOrWhite(background.colour.hex);
|
|
5428
|
+
const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : safestBlackOrWhite(background.colour.hex, colourIndex);
|
|
5397
5429
|
return {
|
|
5398
5430
|
kind: "known-solid",
|
|
5399
5431
|
source: background.source,
|
|
@@ -5476,7 +5508,7 @@ function resolveSurfaceButtonContext(input) {
|
|
|
5476
5508
|
kind: "inherit",
|
|
5477
5509
|
styles: {}
|
|
5478
5510
|
};
|
|
5479
|
-
const context = deriveButtonSurfaceContext(input.surface, input.palette, input.fallbackToken);
|
|
5511
|
+
const context = deriveButtonSurfaceContext(input.surface, input.palette, input.fallbackToken, input.colourIndex);
|
|
5480
5512
|
if (context.kind !== "known-solid") return context.reason === "missing-background" ? {
|
|
5481
5513
|
kind: "inherit",
|
|
5482
5514
|
styles: {}
|
|
@@ -5489,6 +5521,7 @@ function resolveSurfaceButtonContext(input) {
|
|
|
5489
5521
|
styles: knownSurfaceButtonContextStyles({
|
|
5490
5522
|
surface: context.surface,
|
|
5491
5523
|
palette: input.palette,
|
|
5524
|
+
colourIndex: input.colourIndex,
|
|
5492
5525
|
buttonSystem: surfaceButtonSystem(input.buttonSystem, input.primaryToken)
|
|
5493
5526
|
})
|
|
5494
5527
|
};
|
|
@@ -5499,6 +5532,7 @@ function knownSurfaceButtonContextStyles(input) {
|
|
|
5499
5532
|
role,
|
|
5500
5533
|
buttonSystem: input.buttonSystem,
|
|
5501
5534
|
palette: input.palette,
|
|
5535
|
+
colourIndex: input.colourIndex,
|
|
5502
5536
|
surface: input.surface
|
|
5503
5537
|
})))));
|
|
5504
5538
|
}
|
|
@@ -5509,57 +5543,53 @@ function resolveContextualButtonRole(input) {
|
|
|
5509
5543
|
requestedRole: input.role,
|
|
5510
5544
|
rejectedCandidates: []
|
|
5511
5545
|
};
|
|
5512
|
-
const
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
if (preferred.contextualHoverRepair) return {
|
|
5516
|
-
kind: "repaired",
|
|
5517
|
-
requestedRole: input.role,
|
|
5518
|
-
candidate: "contextual-hover",
|
|
5519
|
-
states: preferred.states,
|
|
5520
|
-
focusIndicator: preferred.focusIndicator,
|
|
5521
|
-
boundary: boundaryForVariant(requested),
|
|
5522
|
-
rejectedCandidates: []
|
|
5523
|
-
};
|
|
5524
|
-
return {
|
|
5525
|
-
kind: "preferred",
|
|
5526
|
-
requestedRole: input.role,
|
|
5527
|
-
states: preferred.states,
|
|
5528
|
-
focusIndicator: preferred.focusIndicator,
|
|
5529
|
-
boundary: boundaryForVariant(requested)
|
|
5530
|
-
};
|
|
5531
|
-
}
|
|
5532
|
-
rejected.push({
|
|
5546
|
+
const preferred = compileCandidate(requested, input);
|
|
5547
|
+
if (preferred.ok) return preferredButtonResolution(requested, preferred, input.role);
|
|
5548
|
+
return resolveFallbackButtonRole(input, requested, (input.buttonSystem.surfacePolicy ?? STANDARD_BUTTON_SURFACE_POLICY)[input.role], [{
|
|
5533
5549
|
candidate: "preferred",
|
|
5534
5550
|
error: preferred.error
|
|
5535
|
-
});
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
return {
|
|
5551
|
+
}]);
|
|
5552
|
+
}
|
|
5553
|
+
function preferredButtonResolution(requested, compiled, role) {
|
|
5554
|
+
const appearance = {
|
|
5555
|
+
requestedRole: role,
|
|
5556
|
+
states: compiled.states,
|
|
5557
|
+
focusIndicator: compiled.focusIndicator,
|
|
5558
|
+
boundary: boundaryForVariant(requested)
|
|
5559
|
+
};
|
|
5560
|
+
return compiled.contextualHoverRepair ? {
|
|
5561
|
+
...appearance,
|
|
5562
|
+
kind: "repaired",
|
|
5563
|
+
candidate: "contextual-hover",
|
|
5564
|
+
rejectedCandidates: []
|
|
5565
|
+
} : {
|
|
5566
|
+
...appearance,
|
|
5567
|
+
kind: "preferred"
|
|
5568
|
+
};
|
|
5569
|
+
}
|
|
5570
|
+
/** Ordered, lazy fallback selection; the rejected evidence belongs to this decision. */
|
|
5571
|
+
function resolveFallbackButtonRole(input, requested, fallbacks, rejected) {
|
|
5572
|
+
const [fallback, ...remaining] = fallbacks;
|
|
5573
|
+
if (!fallback) return {
|
|
5559
5574
|
kind: "unresolved",
|
|
5560
5575
|
requestedRole: input.role,
|
|
5561
5576
|
rejectedCandidates: rejected
|
|
5562
5577
|
};
|
|
5578
|
+
const candidate = candidateVariant(fallback, requested, input.buttonSystem);
|
|
5579
|
+
if (!candidate) return resolveFallbackButtonRole(input, requested, remaining, rejected);
|
|
5580
|
+
const compiled = compileCandidate(candidate.variant, input);
|
|
5581
|
+
return compiled.ok ? {
|
|
5582
|
+
kind: "repaired",
|
|
5583
|
+
requestedRole: input.role,
|
|
5584
|
+
candidate: candidate.name,
|
|
5585
|
+
states: candidate.name === "surface-outline" ? withSurfaceInversion(compiled.states, input.surface) : compiled.states,
|
|
5586
|
+
focusIndicator: compiled.focusIndicator,
|
|
5587
|
+
boundary: candidate.boundary,
|
|
5588
|
+
rejectedCandidates: rejected
|
|
5589
|
+
} : resolveFallbackButtonRole(input, requested, remaining, [...rejected, {
|
|
5590
|
+
candidate: candidate.name,
|
|
5591
|
+
error: compiled.error
|
|
5592
|
+
}]);
|
|
5563
5593
|
}
|
|
5564
5594
|
function contextualButtonSurfaceStyles(resolution) {
|
|
5565
5595
|
if (resolution.kind === "unresolved") return resetActionVariables(resolution.requestedRole);
|
|
@@ -5624,12 +5654,13 @@ function actionVariableFallback(role, state, property, fallback) {
|
|
|
5624
5654
|
function actionVariablePrefix(role, state) {
|
|
5625
5655
|
return `--rb-action-${role}-${state}`;
|
|
5626
5656
|
}
|
|
5627
|
-
function compileCandidate(variant,
|
|
5657
|
+
function compileCandidate(variant, context) {
|
|
5628
5658
|
return compileButtonColourStates({
|
|
5629
5659
|
variant,
|
|
5630
|
-
global:
|
|
5631
|
-
palette,
|
|
5632
|
-
surface
|
|
5660
|
+
global: context.buttonSystem.global,
|
|
5661
|
+
palette: context.palette,
|
|
5662
|
+
surface: context.surface,
|
|
5663
|
+
colourIndex: context.colourIndex
|
|
5633
5664
|
});
|
|
5634
5665
|
}
|
|
5635
5666
|
function candidateVariant(fallback, requested, system) {
|
|
@@ -5749,8 +5780,8 @@ function normalizeOpaqueHex(value) {
|
|
|
5749
5780
|
if (!match?.[1]) return null;
|
|
5750
5781
|
return `#${(match[1].length === 3 ? match[1].split("").map((digit) => `${digit}${digit}`).join("") : match[1]).toLowerCase()}`;
|
|
5751
5782
|
}
|
|
5752
|
-
function safestBlackOrWhite(backgroundHex) {
|
|
5753
|
-
return contrastRatio(backgroundHex, "#000000") >= contrastRatio(backgroundHex, "#ffffff") ? {
|
|
5783
|
+
function safestBlackOrWhite(backgroundHex, colourIndex) {
|
|
5784
|
+
return contrastRatio(backgroundHex, "#000000", colourIndex) >= contrastRatio(backgroundHex, "#ffffff", colourIndex) ? {
|
|
5754
5785
|
hex: "#000000",
|
|
5755
5786
|
css: "#000000",
|
|
5756
5787
|
source: "literal-css"
|
|
@@ -5776,8 +5807,10 @@ function contextualBoundaryStyles(boundary) {
|
|
|
5776
5807
|
//#endregion
|
|
5777
5808
|
//#region ../theme-core/src/surfaces/opaqueSurface.ts
|
|
5778
5809
|
function opaqueSurfaceContextFromTheme(theme) {
|
|
5810
|
+
const palette = expandPalette(theme.palette);
|
|
5779
5811
|
return {
|
|
5780
|
-
palette
|
|
5812
|
+
palette,
|
|
5813
|
+
colourIndex: preparePaletteColourIndex(palette),
|
|
5781
5814
|
buttonSystem: theme.buttons,
|
|
5782
5815
|
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken
|
|
5783
5816
|
};
|
|
@@ -6014,6 +6047,20 @@ var TokenResolver = class {
|
|
|
6014
6047
|
}
|
|
6015
6048
|
};
|
|
6016
6049
|
//#endregion
|
|
6050
|
+
//#region ../theme-core/src/site-styles/ownedThemeSnapshot.ts
|
|
6051
|
+
/** Copy before freezing: the editor still owns its source data. */
|
|
6052
|
+
function ownedThemeSnapshot(input) {
|
|
6053
|
+
return freezeOwnedThemeValue(structuredClone(input));
|
|
6054
|
+
}
|
|
6055
|
+
/** Only freshly owned data belongs here; no caller-owned object is frozen. */
|
|
6056
|
+
function freezeOwnedThemeValue(value) {
|
|
6057
|
+
if (typeof value === "object" && value !== null) {
|
|
6058
|
+
Object.values(value).forEach(freezeOwnedThemeValue);
|
|
6059
|
+
Object.freeze(value);
|
|
6060
|
+
}
|
|
6061
|
+
return value;
|
|
6062
|
+
}
|
|
6063
|
+
//#endregion
|
|
6017
6064
|
//#region ../theme-core/src/site-styles/accessibleSurfaces.ts
|
|
6018
6065
|
const ON_BACKGROUND = { kind: "on-background" };
|
|
6019
6066
|
const contrastThresholdByPolicy = {
|
|
@@ -6375,8 +6422,69 @@ function assertNeverSurface(value) {
|
|
|
6375
6422
|
throw new Error(`Unhandled Theme V2 surface intent: ${String(value)}`);
|
|
6376
6423
|
}
|
|
6377
6424
|
function resolveSurface(spec, context) {
|
|
6425
|
+
return spec.kind === "section" ? resolveSectionSurface(spec.background, context) : preparedSurfaceValue(spec, context) ?? resolveSurfaceSpec(spec, context);
|
|
6426
|
+
}
|
|
6427
|
+
/** Own one theme revision; derive its surface decisions without copying its inputs again. */
|
|
6428
|
+
function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
6429
|
+
const theme = structuredClone(inputTheme);
|
|
6430
|
+
const snapshot = freezeOwnedThemeValue(theme);
|
|
6431
|
+
const declarations = ownedThemeSnapshot(selectSurfaces(snapshot));
|
|
6432
|
+
const palette = freezeOwnedThemeValue(expandPalette(snapshot.palette, {
|
|
6433
|
+
arrangement: snapshot.skin !== void 0,
|
|
6434
|
+
marksFrom: snapshot.skinMarks
|
|
6435
|
+
}));
|
|
6436
|
+
const context = Object.freeze({
|
|
6437
|
+
kind: "concrete-palette",
|
|
6438
|
+
palette,
|
|
6439
|
+
colourIndex: preparePaletteColourIndex(palette),
|
|
6440
|
+
buttonSystem: snapshot.buttons
|
|
6441
|
+
});
|
|
6442
|
+
const preparedSurfaces = declarations.length === 0 ? void 0 : surfaceIndexFromOwnedInputs(declarations, context);
|
|
6443
|
+
return Object.freeze({
|
|
6444
|
+
theme,
|
|
6445
|
+
context: Object.freeze({
|
|
6446
|
+
...context,
|
|
6447
|
+
preparedSurfaces
|
|
6448
|
+
})
|
|
6449
|
+
});
|
|
6450
|
+
}
|
|
6451
|
+
/** Private construction path: both entry points above own and freeze these inputs. */
|
|
6452
|
+
function surfaceIndexFromOwnedInputs(specs, context) {
|
|
6453
|
+
const entries = [...new Map(specs.map((spec) => [surfaceResolutionKey(spec, context), spec]))].flatMap(([key, spec]) => preparedSurfaceEntry(key, spec, context));
|
|
6454
|
+
return Object.freeze({
|
|
6455
|
+
palette: context.palette,
|
|
6456
|
+
buttonSystem: context.buttonSystem,
|
|
6457
|
+
colourIndex: context.colourIndex,
|
|
6458
|
+
values: freezeOwnedThemeValue(Object.fromEntries(entries))
|
|
6459
|
+
});
|
|
6460
|
+
}
|
|
6461
|
+
function preparedSurfaceEntry(key, spec, context) {
|
|
6462
|
+
try {
|
|
6463
|
+
return [[key, resolveSurfaceSpec(spec, context)]];
|
|
6464
|
+
} catch {
|
|
6465
|
+
return [];
|
|
6466
|
+
}
|
|
6467
|
+
}
|
|
6468
|
+
function preparedSurfaceValue(spec, context) {
|
|
6469
|
+
const index = context.preparedSurfaces;
|
|
6470
|
+
if (!index || index.palette !== context.palette || index.buttonSystem !== context.buttonSystem || index.colourIndex !== context.colourIndex) return void 0;
|
|
6471
|
+
return index.values[surfaceResolutionKey(spec, context)];
|
|
6472
|
+
}
|
|
6473
|
+
function surfaceResolutionKey(spec, context) {
|
|
6474
|
+
const declaration = spec.kind === "tint" ? {
|
|
6475
|
+
...spec,
|
|
6476
|
+
opacity: String(spec.opacity)
|
|
6477
|
+
} : spec;
|
|
6478
|
+
return JSON.stringify([
|
|
6479
|
+
declaration,
|
|
6480
|
+
context.linkHoverToken,
|
|
6481
|
+
context.foreground,
|
|
6482
|
+
context.compositeBase,
|
|
6483
|
+
context.buttonContext
|
|
6484
|
+
]);
|
|
6485
|
+
}
|
|
6486
|
+
function resolveSurfaceSpec(spec, context) {
|
|
6378
6487
|
switch (spec.kind) {
|
|
6379
|
-
case "section": return resolveSectionSurface(spec.background, context);
|
|
6380
6488
|
case "recipe": return resolveRecipeSurface(spec.intent, context);
|
|
6381
6489
|
case "paint": return spec.paint.kind === "transparent" ? { kind: "inherit" } : resolveOwnedSurface(spec.paint, context);
|
|
6382
6490
|
case "token": return resolveOwnedSurface({
|
|
@@ -6455,7 +6563,7 @@ function resolveOwnedSurface(paint, context) {
|
|
|
6455
6563
|
decorations: surfaceDecorationColors(resolved, context.palette),
|
|
6456
6564
|
hoverDecoration: resolved.kind === "known" ? resolved.hoverDecoration : "underline",
|
|
6457
6565
|
buttonContext: resolveSurfaceButtons(paint, resolved, context),
|
|
6458
|
-
contrast: surfaceContrast(resolved, context.palette)
|
|
6566
|
+
contrast: surfaceContrast(resolved, context.palette, context.colourIndex)
|
|
6459
6567
|
};
|
|
6460
6568
|
}
|
|
6461
6569
|
/** Unprovable legacy paint retains its declared foreground instead of inventing one. */
|
|
@@ -6480,15 +6588,16 @@ function resolveSurfaceButtons(paint, foreground, context) {
|
|
|
6480
6588
|
foreground: foreground.kind === "known" ? foreground.roles.link : void 0
|
|
6481
6589
|
} : { kind: "gradient" },
|
|
6482
6590
|
palette: context.palette,
|
|
6591
|
+
colourIndex: context.colourIndex,
|
|
6483
6592
|
buttonSystem: context.buttonSystem,
|
|
6484
6593
|
primaryToken: context.buttonContext?.primary ?? (paint.kind === "solid" ? context.buttonSystem?.surfaceContexts?.[paint.token]?.primary : void 0),
|
|
6485
6594
|
withoutButtonSystem: "reset"
|
|
6486
6595
|
});
|
|
6487
6596
|
}
|
|
6488
|
-
function surfaceContrast(foreground, palette) {
|
|
6597
|
+
function surfaceContrast(foreground, palette, colourIndex) {
|
|
6489
6598
|
if (foreground.kind !== "known" || foreground.provenance.kind !== "measured") return { kind: "unmeasured" };
|
|
6490
6599
|
const backdrop = foreground.provenance.backdropHex;
|
|
6491
|
-
const ratio = (token) => contrastRatio(resolveConcreteColorHex(token, palette) ?? backdrop, backdrop);
|
|
6600
|
+
const ratio = (token) => contrastRatio(resolveConcreteColorHex(token, palette) ?? backdrop, backdrop, colourIndex);
|
|
6492
6601
|
return {
|
|
6493
6602
|
kind: "measured",
|
|
6494
6603
|
ratios: {
|
|
@@ -6518,6 +6627,7 @@ function resolveSectionSurface(background, context) {
|
|
|
6518
6627
|
foreground: foreground.kind === "known" ? foreground.roles.link : void 0
|
|
6519
6628
|
} : background.type === "gradient" ? { kind: "gradient" } : { kind: "image" },
|
|
6520
6629
|
palette: context.palette,
|
|
6630
|
+
colourIndex: context.colourIndex,
|
|
6521
6631
|
buttonSystem: context.buttonSystem,
|
|
6522
6632
|
primaryToken: sectionPrimaryButtonToken(background, context),
|
|
6523
6633
|
fallbackToken: context.compositeBase,
|
|
@@ -6537,10 +6647,11 @@ function surfaceDecorationColors(foreground, palette) {
|
|
|
6537
6647
|
}
|
|
6538
6648
|
/** Composite the declared palette tint before checking every foreground role. */
|
|
6539
6649
|
function resolveTintSurface(spec, context) {
|
|
6540
|
-
const base =
|
|
6541
|
-
kind: "
|
|
6650
|
+
const base = resolveSurface({
|
|
6651
|
+
kind: "token",
|
|
6542
6652
|
token: spec.base
|
|
6543
6653
|
}, context);
|
|
6654
|
+
if (base.kind !== "owned") throw new Error(`Cannot derive tint on ${spec.base}`);
|
|
6544
6655
|
const source = spec.source === "text" ? base.foreground.text : base.decorations?.mark;
|
|
6545
6656
|
const token = source ? resolveOpaqueSurfaceHex(`${source}/${spec.opacity}`, context.palette, spec.base) : null;
|
|
6546
6657
|
const hex = source ? resolveConcreteColorHex(source, context.palette) : null;
|
|
@@ -9961,7 +10072,7 @@ const EFFECT_PRESETS = [
|
|
|
9961
10072
|
customizableOption: {
|
|
9962
10073
|
name: "solidOnHover",
|
|
9963
10074
|
type: "select",
|
|
9964
|
-
label: "Hover
|
|
10075
|
+
label: "Hover behaviour",
|
|
9965
10076
|
default: "false",
|
|
9966
10077
|
options: ["false", "true"]
|
|
9967
10078
|
},
|
|
@@ -16945,4 +17056,4 @@ function ThemedAuthoredButton({ label, href, variant, size, extraClassName, disa
|
|
|
16945
17056
|
});
|
|
16946
17057
|
}
|
|
16947
17058
|
//#endregion
|
|
16948
|
-
export { headerInteractionPalettePair as $,
|
|
17059
|
+
export { headerInteractionPalettePair as $, paletteValueKey as $n, parseBlockColorToken as $r, surfaceDecorationColors as $t, resolveButtonStyleSelection as A, parseSiteTermsVersionId as Ai, ORDINARY_TEXT_MIN_CONTRAST_RATIO as An, eventListTreatmentValues as Ar, NAV_LINK_LETTER_SPACING_MAP as At, generateBaseInteractiveCSS as B, unsafeAsSiteId as Bi, surfaceForegroundStyle as Bn, plainFrame as Br, INPUT_SPACING_MAP as Bt, FileTextIcon as C, parseEditorClientId as Ci, compositeHex as Cn, asPageFlowPresetId as Cr, resolveBrandDisplay as Ct, buttonStyleSelectionParameterValue as D, parsePageId as Di, resolveOpaqueSurfaceHex as Dn, defineExactCatalog as Dr, parseBlockCustomCssRules as Dt, buttonStyleHoverPreferenceValue as E, parseFormId as Ei, resolveConcreteColorHex as En, defineBlockDesignCapability as Er, getComponentShadowVar as Et, buttonStyleSelectionsEqual as F, unsafeAsFormId as Fi, rgbToHex as Fn, introCompositionTreatmentValues as Fr, navLinkOwnsHoverForeground as Ft, containerStylesOverrideSchema as G, __commonJSMin as Gi, cardRoleValues as Gn, visibleHeadingDecorationFamilyValues as Gr, ACCORDION_TRIGGER_LETTER_SPACING as Gt, parseThemeButtonVariantId as H, unsafeAsStoragePath as Hi, surfaceForegroundValueWithOpacity as Hn, testimonialsCompositionTreatmentValues as Hr, ACCORDION_OPEN_ACCENT_THICKNESS as Ht, generateButtonActionLayoutCss as I, unsafeAsMediaAssetId as Ii, DEFAULT_SURFACE_TEXT_COLOR as In, makeBoundaryId as Ir, navLinkOwnsUnderline as It, sectionStylesOverrideSchema as J, hexColorSchema as Jn, getSiteFontsStorageUrl as Jr, generateCardCss as Jt, corners as K, __exportAll as Ki, cardVariantRoleValues as Kn, buildFontPreviewUrl as Kr, ICON_CONFIG as Kt, generateButtonCss as L, unsafeAsPassId as Li, SURFACE_FOREGROUND_CSS_VARS as Ln, noHeadingDecoration as Lr, navEffectPolicy as Lt, updateButtonStyleSelectionChoice as M, unsafeAsAppointmentResourceId as Mi, relativeLuminance as Mn, featureCardCompositionTreatmentValues as Mr, NAV_LINK_PADDING_X_MAP as Mt, buttonStyleSelectionKey as N, unsafeAsAppointmentServiceId as Ni, featuresFromHex as Nn, flushPanelFrame as Nr, NAV_LINK_TEXT_SIZE_MAP as Nt, defaultButtonStyleSelectionFor as O, parsePageSurfaceId as Oi, buildThemeTokens as On, defineFrameCapability as Or, parseCustomCssRules as Ot, buttonStyleSelectionSchema as P, unsafeAsCustomerPassId as Pi, hexToRgb as Pn, headingDecorationColorTokenValues as Pr, navLinkHoverColorCandidate as Pt, runtimeBoxBackgroundSchema as Q, paletteModeSchema as Qn, themeColorShadeSteps as Qr, resolveSurface as Qt, generateDefaultButtonSystem as R, unsafeAsPositiveByteCount as Ri, surfaceForegroundDeclarations as Rn, offeringsPreviewCompositionTreatmentValues as Rr, FONT_WEIGHT_MAP$1 as Rt, FileSpreadsheetIcon as S, parseContentVersionId as Si, getTextColorForBackground as Sn, asLayoutVariantKey as Sr, logoSizePolicyValues as St, PlusIcon as T, parseEventSeriesId as Ti, worstCaseGlassBackdrop as Tn, assertNever as Tr, getComponentBorderWidthPx as Tt, parseThemeForPersistence as U, err as Ui, generateShadowValue$1 as Un, tileTreatmentValues as Ur, ACCORDION_SPACING_MAP as Ut, generateInteractiveChildInheritanceCSS as V, unsafeAsStorageBucketName as Vi, surfaceForegroundValue as Vn, requireNonEmptyReadonlyArray as Vr, LABEL_FONT_SIZE_MAP as Vt, cardStylesOverrideSchema as W, ok as Wi, cardRoleSchema as Wn, toNonEmptyReadonlyArray as Wr, ACCORDION_TRIGGER_FONT_SCALE as Wt, boxBackgroundOverlaySchema as X, paletteColorsEqual as Xn, unsafeAsOpaqueButtonColourToken as Xr, contrastThresholdByPolicy as Xt, themeSchema as Y, paletteColorEntries as Yn, VARIANT_ROLES as Yr, renderCssDeclarations as Yt, boxBackgroundSchema as Z, paletteColorsSchema as Zn, parseThemeColorToken as Zr, prepareThemeSurfaceRevision as Zt, CirclePlusIcon as _, getBookingInstalmentPlanIntervalCount as _i, selectLogoVariant as _n, asDesignBlockId as _r, siteChromeBackgroundOverrideOwner as _t, ThemedDownloadLink as a, parseEventRegistrationErrorReason as ai, mergeStyles as an, runtimeMediaSchema as ar, renderHeaderPaintTargetRules as at, FileArchiveIcon as b, parseApiKeyId as bi, safeTokenOr as bn, asDesignPageId as br, brandDisplayModeValues as bt, isKnownIconName as c, confirmationPaymentSchema as ci, textColorValue as cn, indexRenderableMediaAssets as cr, MQ_LG_UP as ct, resolveIconPickerPreset as d, isBookingCollectionEquivalentToUpfront as di, isCssColorLiteral as dn, parseCanonicalMediaIdentifier as dr, MQ_SM_UP as dt, parseColorTokenParts as ei, toAccessibleColorSurfaceIntent as en, paletteValueKeySchema as er, headerInteractionPaletteValues as et, SEMANTIC_ICON_DEFINITIONS as f, repriceBookingCollectionOptions as fi, resolveOnColorForThemeToken as fn, skinTokenCssVars as fr, MQ_TABLET_ONLY as ft, CircleMinusIcon as g, validateBookingPaymentOptionKinds as gi, PUBLIC_BUTTON_ROLES as gn, asBoundaryOptionId as gr, pageDesignEditorBackgroundOverrideOwner as gt, ChevronDownIcon as h, getBookingLaterInstalments as hi, generateShadowValue as hn, asBlockOrderIndex as hr, isThemeV2NormalEditorRawStylePath as ht, ThemedButtonSpecimen as i, eventRegistrationErrors as ii, cssVarValue as in, mediaSchema as ir, getHeaderPaintTargets as it, updateButtonStyleHoverPreference as j, parseUserId as ji, contrastRatio as jn, eyebrowTreatmentValues as jr, NAV_LINK_PADDING_MAP as jt, findButtonStyleRecipe as k, parseSiteId as ki, defaultThemeTokens as kn, designIssueSeverityForPolicy as kr, NAV_LINK_BORDER_RADIUS_MAP as kt, ICON_PICKER_PRESETS as l, planCheckoutPaymentFlow as li, opaqueSurfaceContextFromTheme as ln, resolveManagedMediaReference as lr, MQ_MD_DOWN as lt, ArrowDownIcon as m, resolveBookingCollectionOptionFacts as mi, resolveTokenOrCssColorValue as mn, asBlockContentVersionId as mr, isThemeV2NormalEditorRawStyleFieldName as mt, ThemedButton as n, clsx as ni, backgroundColorStyle as nn, imageMediaSchema as nr, generateHeaderScrollTreatmentStyles as nt, getIconComponent as o, checkoutCopy as oi, rgbColorValue as on, buildRenderableMediaAssetIndex as or, BREAKPOINT_LG as ot, isSemanticIconId as p, resolveAvailableBookingCollectionOptions as pi, resolveThemeColorReferenceValue as pn, asAppearancePresetId as pr, headerVariantValues as pt, headerPositioningValues as q, __toESM as qi, normalizeCardRole as qn, generateFontFaceCss as qr, ICON_SIZE_PX as qt, ThemedButtonLink as r, checkBrowserStripeKey as ri, borderColorStyle as rn, mediaPosterSchema as rr, generateMobileOverlayBackdropFilterFix as rt, getIconPickerOptionsForPreset as s, getStripeMinimumChargeRequirement as si, textColorStyle as sn, renderableMediaAssetSchema as sr, BREAKPOINT_XL as st, ThemedAuthoredButton as t, SpinnerNode as ti, TokenResolver as tn, requirePaletteColorsFromEntries as tr, headerInteractionQuietPalette as tt, isIconPickerPreset as u, planFlexibleBalanceCreditFirst as ui, opaqueSurfaceDeclarations as un, mediaIdentifierSchema as ur, MQ_SM_DOWN as ut, ClockIcon as v, formatCurrencyAmount as vi, surfaceToneFromForegroundToken as vn, asDesignBoundaryId as vr, stripStaleTransitionStyleGroup as vt, MinusIcon as w, parseEventOfferingId as wi, planForegroundHover as wn, asSiteStyleId as wr, selectLogoAccommodation as wt, FileAudioIcon as x, parseContentEntryId as xi, expandPalette as xn, asDesignSystemTemplateId as xr, deterministicLogoFactsForShape as xt, ExternalLinkIcon as y, expectParsedBrandedId as yi, resolveSurfaceForeground as yn, asDesignEntryId as yr, themeV2RuntimeStyleFieldNames as yt, generateEffectsCSS as z, unsafeAsPositiveSeconds as zi, surfaceForegroundInputFromResolved as zn, panelFrame as zr, INPUT_FONT_SIZE_MAP as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { ar as SURFACE_DOCUMENT_DATA_ATTRIBUTE, hs as cn, or as SURFACE_IDS, sr as resolveSurfaceDocumentAttributes } from "./SiteChromeCustomizeContext-Hc4pYnNe.mjs";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region ../ui/src/fixed-bottom-surface.tsx
|
|
@@ -32,7 +32,7 @@ function FixedBottomSurface({ children, className, contentClassName, variant = "
|
|
|
32
32
|
const bottomOffset = offsetCssVar ? `var(${offsetCssVar}, 0px)` : "0px";
|
|
33
33
|
return /* @__PURE__ */ jsx("div", {
|
|
34
34
|
ref: surfaceRef,
|
|
35
|
-
className: cn("fixed
|
|
35
|
+
className: cn("fixed bottom-0 left-0 right-[var(--assistant-dock-inset,0px)] backdrop-blur", SURFACE_CLASS_BY_VARIANT[variant], className),
|
|
36
36
|
style: {
|
|
37
37
|
bottom: bottomOffset,
|
|
38
38
|
paddingBottom: "env(safe-area-inset-bottom, 0px)"
|
|
@@ -45,12 +45,7 @@ function FixedBottomSurface({ children, className, contentClassName, variant = "
|
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region ../editor/src/chrome/chromeLayers.ts
|
|
48
|
-
/**
|
|
49
|
-
* Where preview and editor chrome stacks against the site it shows. Sites
|
|
50
|
-
* float their own overlays (the event booking bar sits at 12000 and its
|
|
51
|
-
* booking panel at 14000): the chrome stays above a site's floating bars, so
|
|
52
|
-
* its controls stay clickable while viewing, and below a site's modal panel.
|
|
53
|
-
*/
|
|
48
|
+
/** View-mode preview controls: above a site's floating bars, below its modal panel. */
|
|
54
49
|
const PREVIEW_CHROME_Z_INDEX = 13e3;
|
|
55
50
|
//#endregion
|
|
56
51
|
//#region ../preview-next/src/constants.ts
|
|
@@ -5,13 +5,13 @@ import React from "react";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/preview-next/client/runtime.tsx
|
|
7
7
|
const LazySdkPreviewMode = React.lazy(async () => {
|
|
8
|
-
return { default: (await import("./SdkPreviewModeRuntime-
|
|
8
|
+
return { default: (await import("./SdkPreviewModeRuntime-BtZPcwYV.mjs")).SdkPreviewModeRuntime };
|
|
9
9
|
});
|
|
10
10
|
const LazyPreviewShell = React.lazy(async () => {
|
|
11
|
-
return { default: (await import("./sdk-runtime-
|
|
11
|
+
return { default: (await import("./sdk-runtime-CWymRWhK.mjs")).PreviewShell };
|
|
12
12
|
});
|
|
13
13
|
const LazyPreviewShellLayout = React.lazy(async () => {
|
|
14
|
-
return { default: (await import("./sdk-runtime-
|
|
14
|
+
return { default: (await import("./sdk-runtime-CWymRWhK.mjs")).PreviewShellLayout };
|
|
15
15
|
});
|
|
16
16
|
function SdkPreviewMode(props) {
|
|
17
17
|
return /* @__PURE__ */ jsx(React.Suspense, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./PreviewQueryProvider-BC0V7iAR.mjs";
|
|
3
|
-
import { n as PreviewShell, r as PreviewShellLayout } from "./SdkPreviewModeRuntime-
|
|
3
|
+
import { n as PreviewShell, r as PreviewShellLayout } from "./SdkPreviewModeRuntime-wSI_R361.mjs";
|
|
4
4
|
export { PreviewShell, PreviewShellLayout };
|