@riverbankcms/sdk 0.162.0 → 0.164.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 +9 -0
- package/README.md +12 -1
- package/dist/_dts/{BlocksIslandsHydrator-PZUoA872.d.ts → BlocksIslandsHydrator-CubPwupc.d.ts} +1 -1
- package/dist/_dts/{Page-CdQS6C7i.d.ts → Page-CDzsagB2.d.ts} +15 -12
- package/dist/_dts/{SdkPreviewMode-CNGO-5f1.d.ts → SdkPreviewMode-CPRQbRCI.d.ts} +2 -3
- package/dist/_dts/{client-DGa53rjL.d.ts → client-CbeYTSry.d.ts} +13 -41
- package/dist/_dts/{content-types-K9R7P-KF.d.ts → content-types--uYRIcIF.d.ts} +2 -2
- package/dist/_dts/{contracts-CyBaPaIq.d.ts → contracts-DJQYAOsv.d.ts} +5 -4
- package/dist/_dts/{footerPageOutline-B6jmKmon.d.ts → footerPageOutline-CKkhBwgJ.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-iemoR3AN.d.ts → generatePageMetadata--qd7NCIA.d.ts} +2 -2
- package/dist/_dts/{index-DEu85xBt.d.ts → index-BZE-1azr.d.ts} +1 -1
- package/dist/_dts/{index-Wm62sXf2.d.ts → index-BpEbwDM7.d.ts} +4 -4
- package/dist/_dts/index-CXsnaCGe.d.ts +10 -0
- package/dist/_dts/{index-8CN0Nd-Z.d.ts → index-CjdIn9-_.d.ts} +2 -2
- package/dist/_dts/{index-BtnsA14K.d.ts → index-DYQFmf--.d.ts} +4 -3
- package/dist/_dts/{index-Dbd0Sn0G.d.ts → index-D_pQO-AS.d.ts} +21723 -21361
- package/dist/_dts/{index-Du1IRglc.d.ts → index-DriYVLfT.d.ts} +2 -2
- package/dist/_dts/{index-DI2yaSPY.d.ts → index-JS8WYgD3.d.ts} +31248 -30975
- package/dist/_dts/{index-Jlcq6w69.d.ts → index-wegfy7lf.d.ts} +3 -3
- package/dist/_dts/{loadContent-BPfAAZDW.d.ts → loadContent-DUi94Qfk.d.ts} +15 -30
- package/dist/_dts/{resolvePageContent-DWbrtKf8.d.ts → resolvePageContent-JDE0ry6T.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +3 -4
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +6 -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 +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -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/index.d.ts +13 -7
- 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/spam-protection/index.d.ts +32 -52
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-ClZ-BQL_.d.ts → types-DiciZDrk.d.ts} +3 -3
- package/dist/_dts/{types-CVv2H4AT.d.ts → types-DubJnBnI.d.ts} +7 -7
- package/dist/_dts/{types-CfNG5koF.d.ts → types-W40f2olO.d.ts} +3 -2
- package/dist/_dts/{validation-BJ6Lf_Dr.d.ts → validation-BF4_zNkR.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-COqlgWYU.mjs → BlocksIslandsHydrator-64hFxF02.mjs} +20 -20
- package/dist/client/{BookingMailingListNote-CFYPDEHH.mjs → BookingMailingListNote-CSQyFm9J.mjs} +1 -1
- package/dist/client/{CalendarNavigationChevron-COBVxgHb.mjs → CalendarNavigationChevron-Bvkx8Z7Y.mjs} +6 -6
- package/dist/client/{CheckboxChoice-C7X9dJ8A.mjs → CheckboxChoice-3PhxDxgR.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-CvT0E9AR.mjs → DemoBookingPortalAccess-pt2xXBQp.mjs} +5 -5
- package/dist/client/{DemoPortalSignInLink-EBOBN5dT.mjs → DemoPortalSignInLink-Qw780EfW.mjs} +1 -1
- package/dist/client/{EventCalendar.client-U6pKcntV.mjs → EventCalendar.client-DWoboRW5.mjs} +9 -9
- package/dist/client/{EventCombined.client-CNzwEHws.mjs → EventCombined.client-C98ucpcP.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B9yAWV_k.mjs → EventEmbeddedCheckoutStep-DHRlFfkp.mjs} +2 -1
- package/dist/client/{EventItem-M5rpaHxi.mjs → EventItem-hrSyTApW.mjs} +102 -22
- package/dist/client/{EventListWeekNavigation-D4ieBLDY.mjs → EventListWeekNavigation-C3t7H13W.mjs} +1 -1
- package/dist/client/{EventListing.client-B8F40Rmn.mjs → EventListing.client-Cp11sBX_.mjs} +3 -3
- package/dist/client/{EventListing.view-k4lhuCn5.mjs → EventListing.view-Dd5QHIAf.mjs} +7 -56
- package/dist/client/{EventRegistrationPayment-C3g8_Hqb.mjs → EventRegistrationPayment-ByT88VHR.mjs} +18 -22
- package/dist/client/{LocationMapActions-CAjt7qVo.mjs → LocationMapActions-BsepG5Vv.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-_aIK2ojv.mjs → MapDrawingSvg-R4JMT4yd.mjs} +1 -1
- package/dist/client/{Page-DJBIQBOw.mjs → Page-Dub71o3c.mjs} +956 -378
- package/dist/client/ProtectedSubmitButton-DGbgGvdh.mjs +14 -0
- package/dist/client/SpamProtectionWidget-CRsKTQV-.mjs +139 -0
- package/dist/client/{StepIndicator-CFacB1z6.mjs → StepIndicator-Bp7MyutT.mjs} +2 -2
- package/dist/client/{TabBarFragment-BLsfQskO.mjs → TabBarFragment-C4WJyybx.mjs} +1 -1
- package/dist/client/{ThemedButton-BWsDgjMC.mjs → ThemedButton-BGVwNwE-.mjs} +2 -898
- package/dist/client/{accordion-CtO2XF7M.mjs → accordion-vCG_JC5t.mjs} +1 -1
- package/dist/client/altchaProtection-BWchRM3v.mjs +12 -0
- package/dist/client/{booking-form.client-RICCQ0h2.mjs → booking-form.client-CHTbcZJM.mjs} +23 -56
- package/dist/client/{bookingForm-SvjLPx8i.mjs → bookingForm-BxbUbzUr.mjs} +4 -4
- package/dist/client/bookings.mjs +23 -32
- package/dist/client/{carousel-BR-zCD3O.mjs → carousel-FM1mkkL0.mjs} +2 -2
- package/dist/client/{carousel.client-CEWtoZd3.mjs → carousel.client-ChoLiWwD.mjs} +1 -1
- package/dist/client/{cart-C6YpKbZZ.mjs → cart-BDFhbh9j.mjs} +3 -3
- package/dist/client/{cart.client-dC938WrX.mjs → cart.client-x3HOke6T.mjs} +1 -1
- package/dist/client/{checkout-Dy9RlREI.mjs → checkout-BibhwnTd.mjs} +3 -3
- package/dist/client/{checkout.client-CefG0d2F.mjs → checkout.client-CE4jUi0G.mjs} +1 -1
- package/dist/client/client.mjs +216 -109
- package/dist/client/{context-BFwxgZpB.mjs → context-BNAM7NsW.mjs} +17 -3
- package/dist/client/{cta-DtA42Xio.mjs → cta-ChiN1Vgg.mjs} +1 -1
- package/dist/client/{dateFormatting-yP1B7F0O.mjs → dateFormatting-QwBSo0hK.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-WOiT5Ryi.mjs → demoPortalMagicLink-NwKJk6gn.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-Dh8c_Lq-.mjs → enhanceHeaderSection-D4zqEBDl.mjs} +3 -3
- package/dist/client/{event-details.client-BFgsLqTj.mjs → event-details.client-jFyFjOIC.mjs} +1 -1
- package/dist/client/{event-registration.client-BaXZ1-Ky.mjs → event-registration.client-BK_jVv3R.mjs} +37 -55
- package/dist/client/{eventCalendar-COLwF80U.mjs → eventCalendar-DSkzejQh.mjs} +4 -4
- package/dist/client/{eventCombined-D3Ltwu03.mjs → eventCombined-BG-BEaYh.mjs} +4 -4
- package/dist/client/{eventDetails-CBrkimXu.mjs → eventDetails-BhIwXAKe.mjs} +2 -2
- package/dist/client/{eventListing-CedKVA1S.mjs → eventListing-DQtyO1Xj.mjs} +4 -4
- package/dist/client/{eventRegistration-DkQQfR1b.mjs → eventRegistration-DRTz8X0M.mjs} +4 -4
- package/dist/client/{form-XFy9uXSJ.mjs → form-GXqjObPC.mjs} +3 -3
- package/dist/client/{form.client-B0iancFK.mjs → form.client-CoKNba2e.mjs} +33 -24
- package/dist/client/{form.parts-DMbolu9Y.mjs → form.parts-magB_epJ.mjs} +6 -5
- package/dist/client/{formatDate-Jm5MQOCA.mjs → formatDate-BiloOyjS.mjs} +1 -1
- package/dist/client/gifting/client.mjs +4 -3
- package/dist/client/{headerSection-WjlECjtV.mjs → headerSection-BMQCPHT3.mjs} +2 -2
- package/dist/client/mediaAssets-BX-vWwQc.mjs +43 -0
- package/dist/client/{mediaContext-CNzWmoA4.mjs → mediaContext-CdqGYlWl.mjs} +1 -1
- package/dist/client/{newsletter-form.client-D-XwJTjN.mjs → newsletter-form.client-8orCez1z.mjs} +99 -84
- package/dist/client/{newsletter-form.parts-H92f30y0.mjs → newsletter-form.parts-D8NgHY_F.mjs} +11 -7
- package/dist/client/{newsletterForm-DMuxzu6I.mjs → newsletterForm-BhBNsS3n.mjs} +3 -3
- package/dist/client/{noop-B3RNPVrt.mjs → noop-C2vZse15.mjs} +3 -3
- package/dist/client/portal/client.mjs +13 -12
- package/dist/client/{product-detail.client-B3HuuykE.mjs → product-detail.client-CQ0k0fbH.mjs} +1 -1
- package/dist/client/{product-list.client-CzsDrHQO.mjs → product-list.client-Xlr1P0x9.mjs} +1 -1
- package/dist/client/{productDetail-CbBUVWgd.mjs → productDetail-BsCao6X4.mjs} +3 -3
- package/dist/client/{productList-vqOKH2mh.mjs → productList-Cc-PmbEe.mjs} +3 -3
- package/dist/client/{propsDecoder-CkSUep5a.mjs → propsDecoder-DikkDJ9x.mjs} +3 -3
- package/dist/client/protection-C0PoH1lT.mjs +104 -0
- package/dist/client/purchase-BMsWpx8y.mjs +894 -0
- package/dist/client/{registry.server-cZ24QwtW.mjs → registry.server-BpLZo3bC.mjs} +27 -24
- package/dist/client/rendering/client.mjs +27 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -19
- package/dist/client/{richText-coerce-DDcCKvBJ.mjs → richText-coerce-WuMYrBm3.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DYBioANh.mjs → routeIslandApiConfig-DNx6b07x.mjs} +1 -1
- package/dist/client/{schema-DNHLlze-.mjs → schema-DMUkBtIO.mjs} +3517 -3147
- package/dist/client/{shop-CF0dhnfH.mjs → shop-DyXtB5TD.mjs} +3 -3
- package/dist/client/{shop-commerce-store-Ba8zPlIg.mjs → shop-commerce-store-CbBsS1kD.mjs} +1 -1
- package/dist/client/{shop-commerce-DQznNBEo.mjs → shop-commerce-xjWH7-Ym.mjs} +11 -11
- package/dist/client/{shop.client-DqfYoqWH.mjs → shop.client-QOKqQPgK.mjs} +12 -12
- package/dist/client/{shop.interactive-CreQ0I7i.mjs → shop.interactive-BQdm441g.mjs} +62 -34
- package/dist/client/{shopShared-D-yh-P7g.mjs → shopShared-CyW6MU48.mjs} +2 -2
- package/dist/client/{site-styles-B9HgmY07.mjs → site-styles-BLHYJ8S7.mjs} +755 -35
- package/dist/client/spam-protection.mjs +4 -69
- package/dist/client/{timetableModel-DCdVErTJ.mjs → timetableModel-BgdkhRuA.mjs} +10 -10
- package/dist/client/{useAvailableSlots-Cvgdp2DH.mjs → useAvailableSlots-wmdo6uZ8.mjs} +3 -3
- package/dist/client/{useBookingNowIso-DrTnGNzD.mjs → useBookingNowIso-CUExAee1.mjs} +1 -1
- package/dist/client/{useDiscountApply-CULjnXGl.mjs → useDiscountApply-BRM-OoTN.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-Gn_m7e0o.mjs → useDiscountCodeUi-BEIvL31G.mjs} +1 -1
- package/dist/client/{useEventPagination-CsysCF22.mjs → useEventPagination-Dk3g64we.mjs} +6 -6
- package/dist/client/{view-DMyTchi7.mjs → view-BnaOmrap.mjs} +4 -4
- package/dist/client/{view-BpBjo9Te.mjs → view-vhKGFfC3.mjs} +7 -7
- package/dist/client/{wizardSteps-BO2OmMO9.mjs → wizardSteps-xqU4q63H.mjs} +14 -14
- package/dist/preview-next/before-render.mjs +1 -1
- package/dist/preview-next/chrome.css +1 -1
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-DLsSmZbO.mjs → EventEmbeddedCheckoutStep-43wIAWr4.mjs} +1 -1
- package/dist/preview-next/client/{PreviewEditorSidebar-ChrW9VEo.mjs → PreviewEditorSidebar-C3AQVxQt.mjs} +74 -72
- package/dist/preview-next/client/{PreviewEditorUI-VaHvYtrA.mjs → PreviewEditorUI-C-1zDCR_.mjs} +151 -126
- package/dist/preview-next/client/{SdkPreviewModeRuntime-DWwktlWs.mjs → SdkPreviewModeRuntime-B47yHFL0.mjs} +371 -1433
- package/dist/preview-next/client/{SdkPreviewModeRuntime-Bz7jR6nl.mjs → SdkPreviewModeRuntime-C6Rhm2NQ.mjs} +1 -1
- package/dist/preview-next/client/{ThemedButton-CHKOWXxl.mjs → ThemedButton-g7NPrsGp.mjs} +462 -110
- package/dist/preview-next/client/{previewAuthStore-C0VUwEHz.mjs → previewAuthStore-By_zfrS5.mjs} +164988 -163471
- package/dist/preview-next/client/{previewChromeSurface-Dhyx2YrS.mjs → previewChromeSurface-Cjwxv90x.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-C2GWOCyj.mjs → sdk-runtime-BG2HYvQj.mjs} +1 -1
- package/dist/preview-next/client/{siteStyleAccess-DHyzUpv4.mjs → siteStyleAccess-BiSyYyyr.mjs} +10854 -9509
- package/dist/preview-next/client/{spinner-BeR2S8oG.mjs → spinner-DnWpeDp2.mjs} +1 -1
- package/dist/preview-next/edit-map.css +37 -0
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/maplibre-gl.css +1 -0
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-CkrFDMrl.mjs → route-contract-D5tHZEz5.mjs} +40 -42
- package/dist/preview-next/upload-structure.css +18 -0
- package/dist/server/{Block.shared-DxvNGDig.mjs → Block.shared-Iy7g11iP.mjs} +17 -16
- package/dist/server/{bindings-BuhKvYkE.mjs → bindings-BVJGgUT0.mjs} +2 -2
- package/dist/server/{client-BobW6DOz.mjs → client-CiKaE8ms.mjs} +215 -109
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{effectiveNavLinkStyle-B-MKSt0p.mjs → effectiveNavLinkStyle-EDSdd_oK.mjs} +725 -18
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-CCG_3mbY.mjs → loadContent-BuintpdO.mjs} +6 -4
- package/dist/server/loadPage-BwjncpJf.mjs +2 -0
- package/dist/server/{loadPage-jntGoMrf.mjs → loadPage-Dk4wea8M.mjs} +3 -2
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-BBOlgn4Z.mjs → overrideResolution-BDiQWM7D.mjs} +1 -1
- package/dist/server/{overrides-DByQwIyW.mjs → overrides-DVemf-GV.mjs} +231 -114
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{prebuild-DrwcTk2t.mjs → prebuild-DubLNgRH.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-LfgxSJYE.mjs → prefetchBlockData-Bnbwoe5n.mjs} +53 -28
- package/dist/server/{publicProducts-8A3T5v4M.mjs → publicProducts-D3Fc5TKk.mjs} +85 -70
- package/dist/server/{registry-Digv02oV.mjs → registry-zjd1P2Dl.mjs} +127 -59
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-C23t8-77.mjs → resolveBlockData-CZJ--nH6.mjs} +1 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-BiqpDRwB.mjs → schema-BlTWmTSl.mjs} +4163 -3793
- package/dist/server/server.mjs +3 -3
- package/dist/server/{site-styles-DrkprQPL.mjs → site-styles-yHytcXIB.mjs} +33 -20
- package/dist/server/{siteChromeOverlayClearance-BmKKkkbh.mjs → siteChromeOverlayClearance-D0uCNZ7E.mjs} +159 -107
- package/dist/server/{src-08GY1njw.mjs → src-cbbK3Bho.mjs} +547 -147
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-CSd_Vusz.mjs → themeAdmission-BdY8lP-K.mjs} +3 -2
- package/dist/server/{validation-DdUTkBOZ.mjs → validation-CGH-Xs4E.mjs} +2 -2
- package/dist/server/{version-DdIOqIDe.mjs → version-DoOG6F13.mjs} +1 -1
- package/dist/styles/index.css +399 -112
- package/package.json +2 -3
- package/dist/_dts/AltchaWidget-COIYJ7DF.d.ts +0 -33
- package/dist/_dts/index-C39F9KaB.d.ts +0 -77
- package/dist/client/mediaAssets-BkoW_PEn.mjs +0 -16
- package/dist/client/src-BNZzXgWu.mjs +0 -102
- package/dist/server/loadPage-Bk9HDh9K.mjs +0 -2
|
@@ -807,11 +807,6 @@ const eventRegistrationErrors = {
|
|
|
807
807
|
message: "The payment options for this event have changed. Please check the latest options before continuing.",
|
|
808
808
|
action: "payment-options"
|
|
809
809
|
},
|
|
810
|
-
verificationFailed: {
|
|
811
|
-
endsCommand: false,
|
|
812
|
-
message: "We couldn’t confirm this request came from a person. Please refresh the page and try again.",
|
|
813
|
-
action: "none"
|
|
814
|
-
},
|
|
815
810
|
idempotencyConflict: {
|
|
816
811
|
endsCommand: false,
|
|
817
812
|
message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
|
|
@@ -3073,6 +3068,38 @@ function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FAL
|
|
|
3073
3068
|
if (role === "linkHover") return `var(${roleVariable}, ${surfaceForegroundValue("link", fallback)})`;
|
|
3074
3069
|
return `var(${roleVariable}, var(${SURFACE_FOREGROUND_CSS_VARS.text}, ${fallback}))`;
|
|
3075
3070
|
}
|
|
3071
|
+
/** The three solved inks, published beside the foreground roles by the same surfaces. */
|
|
3072
|
+
const SURFACE_INK_CSS_VARS = {
|
|
3073
|
+
brand: "--rb-surface-brand-color",
|
|
3074
|
+
accent: "--rb-surface-accent-color",
|
|
3075
|
+
focus: "--rb-surface-focus-color"
|
|
3076
|
+
};
|
|
3077
|
+
/**
|
|
3078
|
+
* The declarations for a surface's ink publication. An exact ink is a token
|
|
3079
|
+
* reference (`rgb(var(--tb-primary))`), so a site's own token value wins; a
|
|
3080
|
+
* nudged or replaced ink is a literal colour.
|
|
3081
|
+
*/
|
|
3082
|
+
function surfaceInkStyle(publication) {
|
|
3083
|
+
switch (publication.kind) {
|
|
3084
|
+
case "none": return {};
|
|
3085
|
+
case "reset": return inkVariables(() => "initial");
|
|
3086
|
+
case "solved": return inkVariables((role) => {
|
|
3087
|
+
const ink = publication.inks[role];
|
|
3088
|
+
const token = parseThemeColorToken(ink);
|
|
3089
|
+
return token ? rgbColorValue(token) : ink;
|
|
3090
|
+
});
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
function surfaceInkDeclarations(publication) {
|
|
3094
|
+
return Object.entries(surfaceInkStyle(publication)).map(([property, value]) => `${property}: ${value};`);
|
|
3095
|
+
}
|
|
3096
|
+
function inkVariables(value) {
|
|
3097
|
+
return {
|
|
3098
|
+
[SURFACE_INK_CSS_VARS.brand]: value("brand"),
|
|
3099
|
+
[SURFACE_INK_CSS_VARS.accent]: value("accent"),
|
|
3100
|
+
[SURFACE_INK_CSS_VARS.focus]: value("focus")
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3076
3103
|
function surfaceForegroundValueWithOpacity(role, opacityPercent) {
|
|
3077
3104
|
if (!Number.isFinite(opacityPercent) || opacityPercent < 0 || opacityPercent > 100) throw new RangeError("Surface foreground opacity must be between 0 and 100.");
|
|
3078
3105
|
return `color-mix(in srgb, ${surfaceForegroundValue(role)} ${opacityPercent}%, transparent)`;
|
|
@@ -3216,6 +3243,23 @@ function oklchToOklab(L, C, h) {
|
|
|
3216
3243
|
function inSRGB(r, g, b) {
|
|
3217
3244
|
return r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255;
|
|
3218
3245
|
}
|
|
3246
|
+
/**
|
|
3247
|
+
* OKLCH to linear sRGB with no clamping, so a gamut test can see a channel
|
|
3248
|
+
* that leaves [0, 1]. `oklabToSrgb` clamps before `inSRGB` looks, which is why
|
|
3249
|
+
* `oklchToHexGamut` can clip; that function is left alone on purpose, because
|
|
3250
|
+
* changing it would move every generated shade on live sites (issue 1633).
|
|
3251
|
+
*/
|
|
3252
|
+
function oklchToLinearSrgb(L, C, h) {
|
|
3253
|
+
const { a, b } = oklchToOklab(L, C, h);
|
|
3254
|
+
return oklabToLinearSrgb(L, a, b);
|
|
3255
|
+
}
|
|
3256
|
+
function inLinearSrgbGamut(rgb) {
|
|
3257
|
+
return [
|
|
3258
|
+
rgb.r,
|
|
3259
|
+
rgb.g,
|
|
3260
|
+
rgb.b
|
|
3261
|
+
].every((v) => v >= -1e-6 && v <= 1.000001);
|
|
3262
|
+
}
|
|
3219
3263
|
function oklchToHexGamut(L, C, h) {
|
|
3220
3264
|
let lo = 0, hi = C, best = 0;
|
|
3221
3265
|
for (let i = 0; i < 18; i++) {
|
|
@@ -3323,6 +3367,17 @@ function solidPaint(hex, index) {
|
|
|
3323
3367
|
const y = hexLuminance(hex, index);
|
|
3324
3368
|
return new Interval(y, y);
|
|
3325
3369
|
}
|
|
3370
|
+
function luminanceRatio(a, b) {
|
|
3371
|
+
return a >= b ? (a + .05) / (b + .05) : (b + .05) / (a + .05);
|
|
3372
|
+
}
|
|
3373
|
+
/** The lowest contrast an ink of luminance `ink` has against any point of `paint`. */
|
|
3374
|
+
function worstContrast(ink, paint) {
|
|
3375
|
+
if (ink >= paint.lo && ink <= paint.hi) return 1;
|
|
3376
|
+
return Math.min(luminanceRatio(ink, paint.lo), luminanceRatio(ink, paint.hi));
|
|
3377
|
+
}
|
|
3378
|
+
function assertContrastRatio(ratio) {
|
|
3379
|
+
if (!Number.isFinite(ratio) || ratio <= 1 || ratio > 21) throw new Error(`Contrast ratio must be above 1 and at most 21: ${ratio}`);
|
|
3380
|
+
}
|
|
3326
3381
|
/**
|
|
3327
3382
|
* The one black-or-white rule: literal black or white, whichever contrasts more
|
|
3328
3383
|
* with the whole paint (black on a tie). It always returns, even when neither
|
|
@@ -3884,6 +3939,214 @@ function arrangementPaletteTokens(base, options) {
|
|
|
3884
3939
|
};
|
|
3885
3940
|
}
|
|
3886
3941
|
//#endregion
|
|
3942
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/assertClassBrand.js
|
|
3943
|
+
function _assertClassBrand(e, t, n) {
|
|
3944
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
3945
|
+
throw new TypeError("Private element is not present on this object");
|
|
3946
|
+
}
|
|
3947
|
+
//#endregion
|
|
3948
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldSet2.js
|
|
3949
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
3950
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
3951
|
+
}
|
|
3952
|
+
//#endregion
|
|
3953
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldGet2.js
|
|
3954
|
+
function _classPrivateFieldGet2(s, a) {
|
|
3955
|
+
return s.get(_assertClassBrand(s, a));
|
|
3956
|
+
}
|
|
3957
|
+
//#endregion
|
|
3958
|
+
//#region ../theme-core/src/palette/family.ts
|
|
3959
|
+
var _members = /* @__PURE__ */ new WeakMap();
|
|
3960
|
+
/**
|
|
3961
|
+
* Only `colourFamily` makes one (the class is not exported), so a caller can't
|
|
3962
|
+
* swap in its own members and still hand the solver a valid family. That
|
|
3963
|
+
* matters because `unpaintable` relies on the members running from black to
|
|
3964
|
+
* white.
|
|
3965
|
+
*/
|
|
3966
|
+
var Family = class {
|
|
3967
|
+
constructor(seed, members) {
|
|
3968
|
+
this.seed = seed;
|
|
3969
|
+
_classPrivateFieldInitSpec(this, _members, void 0);
|
|
3970
|
+
_classPrivateFieldSet2(_members, this, Object.freeze(members));
|
|
3971
|
+
}
|
|
3972
|
+
/** Unique by hex, ascending luminance. Includes the exact seed, black and white. */
|
|
3973
|
+
get members() {
|
|
3974
|
+
return _classPrivateFieldGet2(_members, this);
|
|
3975
|
+
}
|
|
3976
|
+
};
|
|
3977
|
+
const GAMUT_BISECTION_STEPS = 18;
|
|
3978
|
+
/** The highest chroma at or below `c` that stays inside sRGB at this lightness and hue. */
|
|
3979
|
+
function gamutChroma(l, c, h) {
|
|
3980
|
+
if (inLinearSrgbGamut(oklchToLinearSrgb(l, c, h))) return c;
|
|
3981
|
+
return Array.from({ length: GAMUT_BISECTION_STEPS }).reduce(({ lo, hi }) => {
|
|
3982
|
+
const mid = (lo + hi) / 2;
|
|
3983
|
+
return inLinearSrgbGamut(oklchToLinearSrgb(l, mid, h)) ? {
|
|
3984
|
+
lo: mid,
|
|
3985
|
+
hi
|
|
3986
|
+
} : {
|
|
3987
|
+
lo,
|
|
3988
|
+
hi: mid
|
|
3989
|
+
};
|
|
3990
|
+
}, {
|
|
3991
|
+
lo: 0,
|
|
3992
|
+
hi: c
|
|
3993
|
+
}).lo;
|
|
3994
|
+
}
|
|
3995
|
+
function oklabDistance(a, b) {
|
|
3996
|
+
return Math.hypot(a.L - b.L, a.a - b.a, a.b - b.b);
|
|
3997
|
+
}
|
|
3998
|
+
function colourFamily(seedHex) {
|
|
3999
|
+
if (!/^#[0-9a-f]{6}$/i.test(seedHex)) throw new Error(`Expected an opaque #rrggbb colour: ${seedHex}`);
|
|
4000
|
+
const features = featuresFromHex(seedHex.toLowerCase());
|
|
4001
|
+
const seed = member(seedHex.toLowerCase(), {
|
|
4002
|
+
l: features.okL,
|
|
4003
|
+
c: features.okC,
|
|
4004
|
+
h: features.okH
|
|
4005
|
+
});
|
|
4006
|
+
const seedTaper = Math.max(.001, Math.sin(Math.PI * seed.sample.l));
|
|
4007
|
+
const samples = Array.from({ length: 513 }, (_, i) => {
|
|
4008
|
+
const l = i / 512;
|
|
4009
|
+
return sampleMember({
|
|
4010
|
+
l,
|
|
4011
|
+
c: gamutChroma(l, seed.sample.c * Math.min(1, Math.sin(Math.PI * l) / seedTaper), seed.sample.h),
|
|
4012
|
+
h: seed.sample.h
|
|
4013
|
+
});
|
|
4014
|
+
});
|
|
4015
|
+
return new Family(seed, [...new Map([seed, ...samples].map((candidate) => [candidate.hex, candidate]).reverse()).values()].sort((a, b) => a.y - b.y || (a.hex < b.hex ? -1 : a.hex > b.hex ? 1 : 0)));
|
|
4016
|
+
}
|
|
4017
|
+
function sampleMember(sample) {
|
|
4018
|
+
const { r, g, b } = oklchToLinearSrgb(sample.l, sample.c, sample.h);
|
|
4019
|
+
return member(rgbToHex(linearToSrgb(r), linearToSrgb(g), linearToSrgb(b)), sample);
|
|
4020
|
+
}
|
|
4021
|
+
function member(hex, sample) {
|
|
4022
|
+
const { r, g, b } = hexToRgb(hex);
|
|
4023
|
+
return {
|
|
4024
|
+
hex,
|
|
4025
|
+
y: hexLuminance(hex),
|
|
4026
|
+
oklab: srgbToOklab(r, g, b),
|
|
4027
|
+
sample
|
|
4028
|
+
};
|
|
4029
|
+
}
|
|
4030
|
+
//#endregion
|
|
4031
|
+
//#region ../theme-core/src/palette/utils/inkSolver.ts
|
|
4032
|
+
/**
|
|
4033
|
+
* How far (OKLab ΔE) a brand colour drawn as ink may be nudged along its own
|
|
4034
|
+
* family before it stops reading as that colour. Past this the caller uses
|
|
4035
|
+
* neutral or palette text instead (Will, 2026-10-14).
|
|
4036
|
+
*/
|
|
4037
|
+
const BRAND_INK_MAX_DELTA_E = .08;
|
|
4038
|
+
/**
|
|
4039
|
+
* The seed itself when it clears `paint`, otherwise the family member nearest
|
|
4040
|
+
* the seed (OKLab ΔE) that clears. On a light ground that is darker, on a dark
|
|
4041
|
+
* one lighter. A passing member further than `maxDistance` from the seed is
|
|
4042
|
+
* refused as `too-far`, which is distinct from `unpaintable`: the family runs
|
|
4043
|
+
* from black to white, so if no member clears, neither does black or white.
|
|
4044
|
+
*/
|
|
4045
|
+
function inkFrom(family, paint, ratio, maxDistance = BRAND_INK_MAX_DELTA_E) {
|
|
4046
|
+
assertContrastRatio(ratio);
|
|
4047
|
+
if (!Number.isFinite(maxDistance) || maxDistance < 0) throw new RangeError(`Maximum ink distance must be finite and not negative: ${maxDistance}`);
|
|
4048
|
+
const seedRatio = worstContrast(family.seed.y, paint);
|
|
4049
|
+
if (seedRatio >= ratio) return {
|
|
4050
|
+
kind: "ink",
|
|
4051
|
+
hex: family.seed.hex,
|
|
4052
|
+
ratio: seedRatio,
|
|
4053
|
+
source: "exact"
|
|
4054
|
+
};
|
|
4055
|
+
const nearest = family.members.reduce((best, member) => {
|
|
4056
|
+
const achieved = worstContrast(member.y, paint);
|
|
4057
|
+
if (achieved < ratio) return best;
|
|
4058
|
+
const distance = oklabDistance(member.oklab, family.seed.oklab);
|
|
4059
|
+
return best === null || distance < best.distance ? {
|
|
4060
|
+
hex: member.hex,
|
|
4061
|
+
distance,
|
|
4062
|
+
ratio: achieved
|
|
4063
|
+
} : best;
|
|
4064
|
+
}, null);
|
|
4065
|
+
if (nearest === null) return {
|
|
4066
|
+
kind: "unpaintable",
|
|
4067
|
+
interval: paint,
|
|
4068
|
+
ratio
|
|
4069
|
+
};
|
|
4070
|
+
if (nearest.distance > maxDistance) return {
|
|
4071
|
+
kind: "too-far",
|
|
4072
|
+
nearest: {
|
|
4073
|
+
hex: nearest.hex,
|
|
4074
|
+
distance: nearest.distance
|
|
4075
|
+
},
|
|
4076
|
+
maxDistance
|
|
4077
|
+
};
|
|
4078
|
+
return {
|
|
4079
|
+
kind: "ink",
|
|
4080
|
+
hex: nearest.hex,
|
|
4081
|
+
ratio: nearest.ratio,
|
|
4082
|
+
source: "family"
|
|
4083
|
+
};
|
|
4084
|
+
}
|
|
4085
|
+
//#endregion
|
|
4086
|
+
//#region ../theme-core/src/surfaces/surfaceInks.ts
|
|
4087
|
+
const INK_SEEDS = {
|
|
4088
|
+
brand: {
|
|
4089
|
+
token: "primary",
|
|
4090
|
+
ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
|
|
4091
|
+
},
|
|
4092
|
+
accent: {
|
|
4093
|
+
token: "accent",
|
|
4094
|
+
ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
|
|
4095
|
+
},
|
|
4096
|
+
focus: {
|
|
4097
|
+
token: "primary",
|
|
4098
|
+
ratio: 3
|
|
4099
|
+
}
|
|
4100
|
+
};
|
|
4101
|
+
/**
|
|
4102
|
+
* Solve the three inks for a measured solid paint. `textInk` is the surface's
|
|
4103
|
+
* own (already certified) text ink: it stands in when the owner's colour is
|
|
4104
|
+
* missing, or can only clear the paint by drifting too far from itself.
|
|
4105
|
+
* A block owner can supply an authored shade candidate for a local ink.
|
|
4106
|
+
*/
|
|
4107
|
+
function solveSurfaceInks(backdropHex, textInk, palette, candidates = {}) {
|
|
4108
|
+
const paint = solidPaint(backdropHex);
|
|
4109
|
+
const fallback = literalInk(resolveConcreteColorHex(textInk, palette) ?? pickBlackOrWhiteTextColor(backdropHex));
|
|
4110
|
+
return {
|
|
4111
|
+
brand: solveInk({
|
|
4112
|
+
...INK_SEEDS.brand,
|
|
4113
|
+
token: candidates.brand ?? INK_SEEDS.brand.token
|
|
4114
|
+
}, paint, palette, fallback),
|
|
4115
|
+
accent: solveInk({
|
|
4116
|
+
...INK_SEEDS.accent,
|
|
4117
|
+
token: candidates.accent ?? INK_SEEDS.accent.token
|
|
4118
|
+
}, paint, palette, fallback),
|
|
4119
|
+
focus: solveInk({
|
|
4120
|
+
...INK_SEEDS.focus,
|
|
4121
|
+
token: candidates.focus ?? INK_SEEDS.focus.token
|
|
4122
|
+
}, paint, palette, fallback)
|
|
4123
|
+
};
|
|
4124
|
+
}
|
|
4125
|
+
function solveInk(seed, paint, palette, fallback) {
|
|
4126
|
+
const token = parseThemeColorToken(seed.token);
|
|
4127
|
+
const seedHex = hexColorSchema.safeParse(resolveConcreteColorHex(seed.token, palette));
|
|
4128
|
+
if (!token || !seedHex.success) return fallback;
|
|
4129
|
+
const solved = inkFrom(familyOf(seedHex.data), paint, seed.ratio);
|
|
4130
|
+
switch (solved.kind) {
|
|
4131
|
+
case "ink": return solved.source === "exact" ? token : literalInk(solved.hex);
|
|
4132
|
+
case "too-far":
|
|
4133
|
+
case "unpaintable": return fallback;
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
function literalInk(hex) {
|
|
4137
|
+
return hexColorSchema.parse(hex.toLowerCase());
|
|
4138
|
+
}
|
|
4139
|
+
const FAMILY_CACHE_LIMIT = 64;
|
|
4140
|
+
const families = /* @__PURE__ */ new Map();
|
|
4141
|
+
function familyOf(seed) {
|
|
4142
|
+
const cached = families.get(seed);
|
|
4143
|
+
if (cached) return cached;
|
|
4144
|
+
if (families.size >= FAMILY_CACHE_LIMIT) families.clear();
|
|
4145
|
+
const family = colourFamily(seed);
|
|
4146
|
+
families.set(seed, family);
|
|
4147
|
+
return family;
|
|
4148
|
+
}
|
|
4149
|
+
//#endregion
|
|
3887
4150
|
//#region ../theme-core/src/surfaces/resolveSurfaceForeground.ts
|
|
3888
4151
|
const FALLBACK_TEXT_TOKENS = [
|
|
3889
4152
|
"text",
|
|
@@ -3918,7 +4181,7 @@ function resolveAuthoredBackground(background, palette, authored, options) {
|
|
|
3918
4181
|
}, palette);
|
|
3919
4182
|
if (background.type === "color") {
|
|
3920
4183
|
const backgroundReference = normalizedReference(background.color);
|
|
3921
|
-
if (!backgroundReference || backgroundReference === "transparent") return { kind: "
|
|
4184
|
+
if (!backgroundReference || backgroundReference === "transparent") return { kind: "inherits" };
|
|
3922
4185
|
return resolveDeterministicForeground(backgroundReference, authored, palette, options.compositeBase);
|
|
3923
4186
|
}
|
|
3924
4187
|
return resolveTrustedTreatmentForeground(authored, palette);
|
|
@@ -3955,12 +4218,13 @@ function resolveMeasuredForeground(backgroundReference, backgroundHex, candidate
|
|
|
3955
4218
|
supporting: safeTokenOr(candidates.supporting, text, backgroundHex, palette)
|
|
3956
4219
|
}, {
|
|
3957
4220
|
kind: "measured",
|
|
3958
|
-
backdropHex: backgroundHex
|
|
4221
|
+
backdropHex: backgroundHex,
|
|
4222
|
+
inks: solveSurfaceInks(backgroundHex, text, palette)
|
|
3959
4223
|
}, candidates.linkHover, palette);
|
|
3960
4224
|
}
|
|
3961
4225
|
function resolveTrustedTreatmentForeground(candidates, palette) {
|
|
3962
4226
|
const text = canonicalToken(candidates.text, palette);
|
|
3963
|
-
if (!text) return { kind: "
|
|
4227
|
+
if (!text) return { kind: "unmeasured-paint" };
|
|
3964
4228
|
return knownForeground({
|
|
3965
4229
|
text,
|
|
3966
4230
|
heading: canonicalToken(candidates.heading, palette) ?? text,
|
|
@@ -3994,6 +4258,21 @@ function canonicalHoverToken(reference, palette) {
|
|
|
3994
4258
|
}
|
|
3995
4259
|
return canonicalToken(reference, palette);
|
|
3996
4260
|
}
|
|
4261
|
+
/**
|
|
4262
|
+
* The one rule for what a resolved foreground publishes for the solved inks.
|
|
4263
|
+
* Only a measured paint under a publishing runtime publishes inks; any other
|
|
4264
|
+
* paint it owns resets them, and a paint it only inherits publishes nothing.
|
|
4265
|
+
*/
|
|
4266
|
+
function surfaceInkPublication(foreground, policy) {
|
|
4267
|
+
switch (foreground.kind) {
|
|
4268
|
+
case "inherits": return { kind: "none" };
|
|
4269
|
+
case "unmeasured-paint": return { kind: "reset" };
|
|
4270
|
+
case "known": return foreground.provenance.kind === "measured" && policy === "publish" ? {
|
|
4271
|
+
kind: "solved",
|
|
4272
|
+
inks: foreground.provenance.inks
|
|
4273
|
+
} : { kind: "reset" };
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
3997
4276
|
/** Keep a candidate only when it meets ordinary-text contrast on the ground. */
|
|
3998
4277
|
function safeTokenOr(candidate, fallback, backgroundHex, palette) {
|
|
3999
4278
|
return firstSafeToken([candidate], backgroundHex, palette) ?? fallback;
|
|
@@ -6343,7 +6622,7 @@ function ownSurfaceRevision(context) {
|
|
|
6343
6622
|
buttonSystem: context.buttonSystem
|
|
6344
6623
|
});
|
|
6345
6624
|
registerOwnedRevisionInputs(revision);
|
|
6346
|
-
surfaceRevisionOwners.set(revision, revision);
|
|
6625
|
+
surfaceRevisionOwners.set(revision, { revision });
|
|
6347
6626
|
revisionOwners.set(revision.palette, /* @__PURE__ */ new Map([[revision.buttonSystem, revision]]));
|
|
6348
6627
|
return revision;
|
|
6349
6628
|
}
|
|
@@ -6354,7 +6633,7 @@ function ownSurfaceRevision(context) {
|
|
|
6354
6633
|
palette: context.palette,
|
|
6355
6634
|
buttonSystem: context.buttonSystem
|
|
6356
6635
|
});
|
|
6357
|
-
surfaceRevisionOwners.set(revision, revision);
|
|
6636
|
+
surfaceRevisionOwners.set(revision, { revision });
|
|
6358
6637
|
revisions.set(context.buttonSystem, revision);
|
|
6359
6638
|
revisionOwners.set(context.palette, revisions);
|
|
6360
6639
|
return revision;
|
|
@@ -6364,9 +6643,14 @@ function surfaceTransportContext(context) {
|
|
|
6364
6643
|
const revision = ownSurfaceRevision(context);
|
|
6365
6644
|
const result = Object.freeze({
|
|
6366
6645
|
...revision,
|
|
6367
|
-
colourIndex: context.colourIndex
|
|
6646
|
+
colourIndex: context.colourIndex,
|
|
6647
|
+
solvedInks: context.solvedInks
|
|
6648
|
+
});
|
|
6649
|
+
const preparedSurfaces = matchingPreparedSurfaceIndex(preparedSurfaceIndexFor(context), result);
|
|
6650
|
+
surfaceRevisionOwners.set(result, {
|
|
6651
|
+
revision,
|
|
6652
|
+
preparedSurfaces
|
|
6368
6653
|
});
|
|
6369
|
-
surfaceRevisionOwners.set(result, revision);
|
|
6370
6654
|
return result;
|
|
6371
6655
|
}
|
|
6372
6656
|
/** Called only after copying and recursively freezing owner inputs. */
|
|
@@ -6378,10 +6662,6 @@ function registerOwnedRevisionInputs(context) {
|
|
|
6378
6662
|
function isResolvedSurface(value) {
|
|
6379
6663
|
return typeof value === "object" && value !== null && surfaceOwners.has(value) && "kind" in value && (value.kind === "owned" || value.kind === "inherit");
|
|
6380
6664
|
}
|
|
6381
|
-
/** Opaque immutable surface/context values have no child DTOs to project. */
|
|
6382
|
-
function isSurfaceTransportLeaf(value) {
|
|
6383
|
-
return isResolvedSurface(value) || isSurfaceTreeRecord(value) && surfaceRevisionOwners.has(value);
|
|
6384
|
-
}
|
|
6385
6665
|
/** Runtime serializers reject copies and forged structural objects, too. */
|
|
6386
6666
|
function requireResolvedSurface(value) {
|
|
6387
6667
|
if (!isResolvedSurface(value)) throw new Error("Surface must be produced by resolveSurface");
|
|
@@ -6390,9 +6670,8 @@ function resolveSurface(spec, context) {
|
|
|
6390
6670
|
return spec.kind === "section" ? resolveSectionSurface(spec.background, context) : preparedSurfaceValue(spec, context) ?? certifySurface(spec, context);
|
|
6391
6671
|
}
|
|
6392
6672
|
/** Own one theme revision; derive its surface decisions without copying its inputs again. */
|
|
6393
|
-
function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
6394
|
-
const
|
|
6395
|
-
const snapshot = freezeOwnedThemeValue(theme);
|
|
6673
|
+
function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => [], solvedInks) {
|
|
6674
|
+
const snapshot = freezeOwnedThemeValue(structuredClone(inputTheme));
|
|
6396
6675
|
const declarations = ownedThemeSnapshot(selectSurfaces(snapshot));
|
|
6397
6676
|
const palette = freezeOwnedThemeValue(expandPalette(snapshot.palette, {
|
|
6398
6677
|
arrangement: snapshot.skin !== void 0,
|
|
@@ -6402,12 +6681,13 @@ function prepareThemeSurfaceRevision(inputTheme, selectSurfaces = () => []) {
|
|
|
6402
6681
|
kind: "concrete-palette",
|
|
6403
6682
|
palette,
|
|
6404
6683
|
colourIndex: preparePaletteColourIndex(palette),
|
|
6405
|
-
buttonSystem: snapshot.buttons
|
|
6684
|
+
buttonSystem: snapshot.buttons,
|
|
6685
|
+
solvedInks
|
|
6406
6686
|
});
|
|
6407
6687
|
registerOwnedRevisionInputs(context);
|
|
6408
6688
|
const preparedSurfaces = declarations.length === 0 ? void 0 : surfaceIndexFromOwnedInputs(declarations, context);
|
|
6409
6689
|
return Object.freeze({
|
|
6410
|
-
theme,
|
|
6690
|
+
theme: snapshot,
|
|
6411
6691
|
context: Object.freeze({
|
|
6412
6692
|
...context,
|
|
6413
6693
|
preparedSurfaces
|
|
@@ -6434,10 +6714,14 @@ function preparedSurfaceEntry(key, spec, context) {
|
|
|
6434
6714
|
return [];
|
|
6435
6715
|
}
|
|
6436
6716
|
}
|
|
6717
|
+
function matchingPreparedSurfaceIndex(index, context) {
|
|
6718
|
+
return index && preparedIndexOwners.has(index) && index.palette === context.palette && index.buttonSystem === context.buttonSystem && index.colourIndex === context.colourIndex ? index : void 0;
|
|
6719
|
+
}
|
|
6720
|
+
function preparedSurfaceIndexFor(context) {
|
|
6721
|
+
return matchingPreparedSurfaceIndex(context.preparedSurfaces ?? surfaceRevisionOwners.get(context)?.preparedSurfaces, context);
|
|
6722
|
+
}
|
|
6437
6723
|
function preparedSurfaceValue(spec, context) {
|
|
6438
|
-
|
|
6439
|
-
if (!index || !preparedIndexOwners.has(index) || index.palette !== context.palette || index.buttonSystem !== context.buttonSystem || index.colourIndex !== context.colourIndex) return void 0;
|
|
6440
|
-
return index.values[surfaceResolutionKey(spec, context)];
|
|
6724
|
+
return preparedSurfaceIndexFor(context)?.values[surfaceResolutionKey(spec, context)];
|
|
6441
6725
|
}
|
|
6442
6726
|
function surfaceResolutionKey(spec, context) {
|
|
6443
6727
|
const declaration = spec.kind === "tint" ? {
|
|
@@ -6449,7 +6733,8 @@ function surfaceResolutionKey(spec, context) {
|
|
|
6449
6733
|
context.linkHoverToken,
|
|
6450
6734
|
context.foreground,
|
|
6451
6735
|
context.compositeBase,
|
|
6452
|
-
context.buttonContext
|
|
6736
|
+
context.buttonContext,
|
|
6737
|
+
context.solvedInks
|
|
6453
6738
|
]);
|
|
6454
6739
|
}
|
|
6455
6740
|
function resolveSurfaceSpec(spec, context) {
|
|
@@ -6521,6 +6806,7 @@ function resolveOwnedSurface(paint, context, measuredBackdrop) {
|
|
|
6521
6806
|
const decision = {
|
|
6522
6807
|
kind: "owned",
|
|
6523
6808
|
foreground: ownedForegroundRoles(resolved, text, context.foreground),
|
|
6809
|
+
inks: ownedInkPublication(resolved, context),
|
|
6524
6810
|
decorations: surfaceDecorationColors(resolved, context.palette),
|
|
6525
6811
|
hoverDecoration: resolved.kind === "known" ? resolved.hoverDecoration : "underline",
|
|
6526
6812
|
buttonContext: resolveSurfaceButtons(paint, resolved, context)
|
|
@@ -6530,12 +6816,7 @@ function resolveOwnedSurface(paint, context, measuredBackdrop) {
|
|
|
6530
6816
|
paint,
|
|
6531
6817
|
contrast: { kind: "unmeasured" }
|
|
6532
6818
|
};
|
|
6533
|
-
|
|
6534
|
-
return contrast.kind === "measured" ? {
|
|
6535
|
-
...decision,
|
|
6536
|
-
paint,
|
|
6537
|
-
contrast
|
|
6538
|
-
} : {
|
|
6819
|
+
if (resolved.kind !== "known" || resolved.provenance.kind !== "measured") return {
|
|
6539
6820
|
...decision,
|
|
6540
6821
|
paint,
|
|
6541
6822
|
contrast: {
|
|
@@ -6544,6 +6825,17 @@ function resolveOwnedSurface(paint, context, measuredBackdrop) {
|
|
|
6544
6825
|
source: "paint"
|
|
6545
6826
|
}
|
|
6546
6827
|
};
|
|
6828
|
+
return {
|
|
6829
|
+
...decision,
|
|
6830
|
+
paint,
|
|
6831
|
+
foreground: resolved.roles,
|
|
6832
|
+
contrast: surfaceContrast(resolved.roles, resolved.provenance.backdropHex, context.palette, context.colourIndex)
|
|
6833
|
+
};
|
|
6834
|
+
}
|
|
6835
|
+
/** A paint the element owns but that resolves as inherited (an empty token) still blocks outer inks. */
|
|
6836
|
+
function ownedInkPublication(resolved, context) {
|
|
6837
|
+
const publication = surfaceInkPublication(resolved, context.solvedInks ?? "withhold");
|
|
6838
|
+
return publication.kind === "none" ? { kind: "reset" } : publication;
|
|
6547
6839
|
}
|
|
6548
6840
|
/** Unprovable legacy paint retains its declared foreground instead of inventing one. */
|
|
6549
6841
|
function ownedForegroundRoles(resolved, text, candidates) {
|
|
@@ -6574,25 +6866,23 @@ function resolveSurfaceButtons(paint, foreground, context) {
|
|
|
6574
6866
|
withoutButtonSystem: "reset"
|
|
6575
6867
|
});
|
|
6576
6868
|
}
|
|
6577
|
-
function surfaceContrast(
|
|
6578
|
-
if (foreground.kind !== "known" || foreground.provenance.kind !== "measured") return { kind: "unmeasured" };
|
|
6579
|
-
const backdrop = foreground.provenance.backdropHex;
|
|
6869
|
+
function surfaceContrast(roles, backdrop, palette, colourIndex) {
|
|
6580
6870
|
const ratio = (token) => contrastRatio(resolveOpaqueSurfaceHex(token, palette, backdrop) ?? backdrop, backdrop, colourIndex);
|
|
6581
6871
|
return {
|
|
6582
6872
|
kind: "measured",
|
|
6583
6873
|
ratios: {
|
|
6584
|
-
text: ratio(
|
|
6585
|
-
heading: ratio(
|
|
6586
|
-
link: ratio(
|
|
6587
|
-
linkHover: ratio(
|
|
6588
|
-
supporting: ratio(
|
|
6589
|
-
muted: ratio(
|
|
6874
|
+
text: ratio(roles.text),
|
|
6875
|
+
heading: ratio(roles.heading),
|
|
6876
|
+
link: ratio(roles.link),
|
|
6877
|
+
linkHover: ratio(roles.linkHover),
|
|
6878
|
+
supporting: ratio(roles.supporting),
|
|
6879
|
+
muted: ratio(roles.muted)
|
|
6590
6880
|
}
|
|
6591
6881
|
};
|
|
6592
6882
|
}
|
|
6593
6883
|
/** Runtime backgrounds retain authored media, compositing and unknown foregrounds. */
|
|
6594
6884
|
function resolveSectionSurface(background, context) {
|
|
6595
|
-
const foreground = background === null ? { kind: "
|
|
6885
|
+
const foreground = background === null ? { kind: "inherits" } : resolveSurfaceForeground(background, context.palette, {
|
|
6596
6886
|
linkHover: context.linkHoverToken,
|
|
6597
6887
|
...context.foreground
|
|
6598
6888
|
}, { compositeBase: context.compositeBase });
|
|
@@ -6603,23 +6893,27 @@ function resolveSectionSurface(background, context) {
|
|
|
6603
6893
|
foreground: foreground.kind === "known" ? foreground.roles.link : void 0
|
|
6604
6894
|
} : background.type === "gradient" ? { kind: "gradient" } : { kind: "image" };
|
|
6605
6895
|
const revision = ownSurfaceRevision(context);
|
|
6896
|
+
const buttonContext = resolveSurfaceButtonContext({
|
|
6897
|
+
surface,
|
|
6898
|
+
palette: revision.palette,
|
|
6899
|
+
buttonSystem: revision.buttonSystem,
|
|
6900
|
+
primaryToken: sectionPrimaryButtonToken(background, context),
|
|
6901
|
+
fallbackToken: context.compositeBase,
|
|
6902
|
+
withoutButtonSystem: "inherit"
|
|
6903
|
+
});
|
|
6606
6904
|
const result = {
|
|
6607
6905
|
kind: "section",
|
|
6608
6906
|
foreground,
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
buttonSystem: revision.buttonSystem,
|
|
6613
|
-
primaryToken: sectionPrimaryButtonToken(background, context),
|
|
6614
|
-
fallbackToken: context.compositeBase,
|
|
6615
|
-
withoutButtonSystem: "inherit"
|
|
6616
|
-
}).styles,
|
|
6907
|
+
inks: surfaceInkPublication(foreground, context.solvedInks ?? "withhold"),
|
|
6908
|
+
buttonStyles: buttonContext.styles,
|
|
6909
|
+
buttonContext,
|
|
6617
6910
|
proof: sectionProof(background, foreground),
|
|
6618
6911
|
revision,
|
|
6619
6912
|
textPolicy: surfaceTextPolicy,
|
|
6620
6913
|
[resolvedSurfaceBrand]: true
|
|
6621
6914
|
};
|
|
6622
6915
|
Object.defineProperties(result, {
|
|
6916
|
+
buttonContext: { enumerable: false },
|
|
6623
6917
|
proof: { enumerable: false },
|
|
6624
6918
|
revision: { enumerable: false },
|
|
6625
6919
|
textPolicy: { enumerable: false }
|
|
@@ -6658,6 +6952,7 @@ function resolveTintSurface(spec, context) {
|
|
|
6658
6952
|
assertTintSamples(solid, spec.base, context.palette);
|
|
6659
6953
|
return {
|
|
6660
6954
|
...solid,
|
|
6955
|
+
inks: { kind: "reset" },
|
|
6661
6956
|
tintBase: spec.base
|
|
6662
6957
|
};
|
|
6663
6958
|
}
|
|
@@ -6704,6 +6999,7 @@ const paintInputSchema = z.discriminatedUnion("kind", [
|
|
|
6704
6999
|
z.object({ kind: z.literal("transparent") })
|
|
6705
7000
|
]);
|
|
6706
7001
|
const buttonInputSchema = z.object({ primary: opaqueButtonColourTokenSchema });
|
|
7002
|
+
const solvedInksSchema = z.enum(["publish", "withhold"]);
|
|
6707
7003
|
const surfaceSpecSchema = z.discriminatedUnion("kind", [
|
|
6708
7004
|
z.object({
|
|
6709
7005
|
kind: z.literal("recipe"),
|
|
@@ -6740,16 +7036,21 @@ const surfaceTransportSchema = z.object({ $surface: z.object({
|
|
|
6740
7036
|
foreground: foregroundInputSchema.optional(),
|
|
6741
7037
|
linkHoverToken: z.string().optional(),
|
|
6742
7038
|
compositeBase: z.string().optional(),
|
|
6743
|
-
buttonContext: buttonInputSchema.optional()
|
|
7039
|
+
buttonContext: buttonInputSchema.optional(),
|
|
7040
|
+
solvedInks: solvedInksSchema.optional()
|
|
6744
7041
|
})
|
|
6745
7042
|
}) });
|
|
6746
7043
|
/** Deserialised output is never evidence: parse the inputs and rerun their owner. */
|
|
6747
7044
|
function parseResolvedSurface(value) {
|
|
6748
|
-
|
|
6749
|
-
|
|
7045
|
+
return resolveTransportedSurface(value);
|
|
7046
|
+
}
|
|
7047
|
+
function resolveTransportedSurface(value, solvedInks) {
|
|
7048
|
+
if (isResolvedSurface(value) && solvedInks === void 0) return value;
|
|
7049
|
+
const { spec, context } = isResolvedSurface(value) ? serializeResolvedSurface(value).$surface : surfaceTransportSchema.parse(value).$surface;
|
|
6750
7050
|
return resolveSurface(spec, {
|
|
6751
7051
|
...context,
|
|
6752
|
-
buttonSystem: context.buttonSystem
|
|
7052
|
+
buttonSystem: context.buttonSystem,
|
|
7053
|
+
solvedInks: solvedInks ?? context.solvedInks
|
|
6753
7054
|
});
|
|
6754
7055
|
}
|
|
6755
7056
|
/** Wire only the owner inputs; parsed CSS/results are recomputed, never trusted. */
|
|
@@ -6769,14 +7070,14 @@ function certifySurface(spec, context) {
|
|
|
6769
7070
|
foreground: context.foreground,
|
|
6770
7071
|
linkHoverToken: context.linkHoverToken,
|
|
6771
7072
|
compositeBase: context.compositeBase,
|
|
6772
|
-
buttonContext: context.buttonContext
|
|
7073
|
+
buttonContext: context.buttonContext,
|
|
7074
|
+
solvedInks: context.solvedInks
|
|
6773
7075
|
})
|
|
6774
7076
|
})
|
|
6775
7077
|
};
|
|
6776
7078
|
const decision = resolveSurfaceSpec(inputs.spec, inputs.context);
|
|
6777
|
-
const result = Object.assign(decision, {
|
|
7079
|
+
const result = Object.assign(surfaceProof(decision, spec), {
|
|
6778
7080
|
[resolvedSurfaceBrand]: true,
|
|
6779
|
-
proof: surfaceProof(decision, spec),
|
|
6780
7081
|
revision,
|
|
6781
7082
|
textPolicy: surfaceTextPolicy,
|
|
6782
7083
|
$surface: inputs
|
|
@@ -6790,11 +7091,23 @@ function certifySurface(spec, context) {
|
|
|
6790
7091
|
surfaceTransports.set(result, inputs);
|
|
6791
7092
|
return freezeOwnedThemeValue(result);
|
|
6792
7093
|
}
|
|
7094
|
+
function isSolidSurfaceDecision(decision) {
|
|
7095
|
+
return decision.kind === "owned" && decision.contrast.kind === "measured";
|
|
7096
|
+
}
|
|
6793
7097
|
function surfaceProof(decision, spec) {
|
|
6794
|
-
if (decision.kind === "inherit") return
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
7098
|
+
if (decision.kind === "inherit") return {
|
|
7099
|
+
...decision,
|
|
7100
|
+
proof: "inherit"
|
|
7101
|
+
};
|
|
7102
|
+
if (!isSolidSurfaceDecision(decision)) return {
|
|
7103
|
+
...decision,
|
|
7104
|
+
proof: "unproven-media"
|
|
7105
|
+
};
|
|
7106
|
+
const proof = spec.kind === "tint" ? spec.gradient === "radial" ? "checked-gradient-or-scrim" : "checked-composited" : /\/|rgba\(/.test(decision.paint.token) ? "checked-composited" : "checked-solid";
|
|
7107
|
+
return {
|
|
7108
|
+
...decision,
|
|
7109
|
+
proof
|
|
7110
|
+
};
|
|
6798
7111
|
}
|
|
6799
7112
|
function sectionProof(background, foreground) {
|
|
6800
7113
|
if (background === null) return "inherit";
|
|
@@ -6814,8 +7127,11 @@ function serializeSurfaceTree(value) {
|
|
|
6814
7127
|
return index;
|
|
6815
7128
|
};
|
|
6816
7129
|
const encode = (item) => {
|
|
6817
|
-
const revision = isSurfaceTreeRecord(item) ? surfaceRevisionOwners.get(item) : void 0;
|
|
6818
|
-
if (revision) return {
|
|
7130
|
+
const revision = isSurfaceTreeRecord(item) ? surfaceRevisionOwners.get(item)?.revision : void 0;
|
|
7131
|
+
if (revision) return {
|
|
7132
|
+
$surfaceRevision: revisionIndex(revision),
|
|
7133
|
+
solvedInks: isSurfaceTreeRecord(item) ? item.solvedInks : void 0
|
|
7134
|
+
};
|
|
6819
7135
|
if (isResolvedSurface(item)) {
|
|
6820
7136
|
const input = serializeResolvedSurface(item).$surface;
|
|
6821
7137
|
const index = revisionIndex(item.revision);
|
|
@@ -6848,14 +7164,23 @@ const surfaceReferenceSchema = z.object({ $surface: z.object({
|
|
|
6848
7164
|
foreground: foregroundInputSchema.optional(),
|
|
6849
7165
|
linkHoverToken: z.string().optional(),
|
|
6850
7166
|
compositeBase: z.string().optional(),
|
|
6851
|
-
buttonContext: buttonInputSchema.optional()
|
|
7167
|
+
buttonContext: buttonInputSchema.optional(),
|
|
7168
|
+
solvedInks: solvedInksSchema.optional()
|
|
6852
7169
|
})
|
|
6853
7170
|
}) });
|
|
6854
|
-
const surfaceRevisionReferenceSchema = z.object({
|
|
7171
|
+
const surfaceRevisionReferenceSchema = z.object({
|
|
7172
|
+
$surfaceRevision: z.number().int().nonnegative(),
|
|
7173
|
+
solvedInks: solvedInksSchema.optional()
|
|
7174
|
+
});
|
|
6855
7175
|
/** Recreate owner results before any island's ordinary schema consumes them. */
|
|
6856
|
-
function parseSurfaceTree(value) {
|
|
6857
|
-
if (
|
|
6858
|
-
|
|
7176
|
+
function parseSurfaceTree(value, solvedInks) {
|
|
7177
|
+
if (isResolvedSurface(value)) return resolveTransportedSurface(value, solvedInks);
|
|
7178
|
+
const revision = isSurfaceTreeRecord(value) ? surfaceRevisionOwners.get(value)?.revision : void 0;
|
|
7179
|
+
if (revision) return solvedInks === void 0 ? value : surfaceTransportContext({
|
|
7180
|
+
...revision,
|
|
7181
|
+
solvedInks
|
|
7182
|
+
});
|
|
7183
|
+
if (!isSurfaceTreeRecord(value) || !("$surfaceTransport" in value)) return mapSurfaceTreeChildren(value, (item) => parseSurfaceTree(item, solvedInks));
|
|
6859
7184
|
const envelope = surfaceEnvelopeSchema.parse(value).$surfaceTransport;
|
|
6860
7185
|
const revisions = envelope.revisions.map((revision) => {
|
|
6861
7186
|
const owned = ownedThemeSnapshot({
|
|
@@ -6867,9 +7192,14 @@ function parseSurfaceTree(value) {
|
|
|
6867
7192
|
});
|
|
6868
7193
|
const decode = (item) => {
|
|
6869
7194
|
if (isSurfaceTreeRecord(item) && "$surfaceRevision" in item) {
|
|
6870
|
-
const
|
|
7195
|
+
const reference = surfaceRevisionReferenceSchema.parse(item);
|
|
7196
|
+
const revision = revisions[reference.$surfaceRevision];
|
|
6871
7197
|
if (!revision) throw new Error("Unknown surface revision");
|
|
6872
|
-
|
|
7198
|
+
const policy = solvedInks ?? reference.solvedInks;
|
|
7199
|
+
return policy === void 0 ? revision : surfaceTransportContext({
|
|
7200
|
+
...revision,
|
|
7201
|
+
solvedInks: policy
|
|
7202
|
+
});
|
|
6873
7203
|
}
|
|
6874
7204
|
if (isSurfaceTreeRecord(item) && "$surface" in item) {
|
|
6875
7205
|
const request = surfaceReferenceSchema.parse(item).$surface;
|
|
@@ -6878,7 +7208,8 @@ function parseSurfaceTree(value) {
|
|
|
6878
7208
|
return resolveSurface(request.spec, {
|
|
6879
7209
|
...revision,
|
|
6880
7210
|
...request.context,
|
|
6881
|
-
buttonSystem: revision.buttonSystem
|
|
7211
|
+
buttonSystem: revision.buttonSystem,
|
|
7212
|
+
solvedInks: solvedInks ?? request.context.solvedInks
|
|
6882
7213
|
});
|
|
6883
7214
|
}
|
|
6884
7215
|
return mapSurfaceTreeChildren(item, decode);
|
|
@@ -6901,7 +7232,8 @@ function opaqueSurfaceContextFromTheme(theme) {
|
|
|
6901
7232
|
palette,
|
|
6902
7233
|
colourIndex: preparePaletteColourIndex(palette),
|
|
6903
7234
|
buttonSystem: theme.buttons,
|
|
6904
|
-
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken
|
|
7235
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken,
|
|
7236
|
+
solvedInks: "publish"
|
|
6905
7237
|
};
|
|
6906
7238
|
}
|
|
6907
7239
|
/**
|
|
@@ -6924,6 +7256,7 @@ function opaqueSurfaceDeclarations(surface, arrangement = false) {
|
|
|
6924
7256
|
...arrangement ? { muted: colorValue(foreground.muted) } : {},
|
|
6925
7257
|
hoverDecoration: surface.hoverDecoration
|
|
6926
7258
|
}),
|
|
7259
|
+
...surfaceInkDeclarations(surface.inks),
|
|
6927
7260
|
...arrangement && surface.decorations !== void 0 ? [`${SURFACE_FOREGROUND_CSS_VARS.line}: ${surface.decorations.line};`, `${SURFACE_FOREGROUND_CSS_VARS.mark}: ${surface.decorations.mark};`] : [],
|
|
6928
7261
|
...Object.entries(surface.buttonContext.styles).map(([property, value]) => `${property}: ${value};`)
|
|
6929
7262
|
];
|
|
@@ -6937,6 +7270,7 @@ function inheritedSurfaceDeclarations(arrangement) {
|
|
|
6937
7270
|
return [
|
|
6938
7271
|
"color",
|
|
6939
7272
|
...Object.entries(SURFACE_FOREGROUND_CSS_VARS).filter(([role]) => arrangement || role !== "line" && role !== "mark" && role !== "muted").map(([, variable]) => variable),
|
|
7273
|
+
...Object.values(SURFACE_INK_CSS_VARS),
|
|
6940
7274
|
"--rb-surface-link-hover-decoration",
|
|
6941
7275
|
...Object.keys(contextualButtonSurfaceResetStyles())
|
|
6942
7276
|
].map((property) => `${property}: inherit;`);
|
|
@@ -7486,7 +7820,7 @@ function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
|
7486
7820
|
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
7487
7821
|
}
|
|
7488
7822
|
function generateCardCss(options) {
|
|
7489
|
-
const { themeId, theme, cardSystem: providedCardSystem } = options;
|
|
7823
|
+
const { themeId, theme, cardSystem: providedCardSystem, solvedInks } = options;
|
|
7490
7824
|
const tokens = new TokenResolver(theme);
|
|
7491
7825
|
const palette = expandPalette(theme.palette);
|
|
7492
7826
|
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
@@ -7499,11 +7833,11 @@ function generateCardCss(options) {
|
|
|
7499
7833
|
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
7500
7834
|
emittedGroupKeys.add(groupKey);
|
|
7501
7835
|
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
7502
|
-
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette));
|
|
7836
|
+
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
7503
7837
|
}
|
|
7504
7838
|
for (const [groupKey, group] of aliasGroups) {
|
|
7505
7839
|
if (emittedGroupKeys.has(groupKey)) continue;
|
|
7506
|
-
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette));
|
|
7840
|
+
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
7507
7841
|
}
|
|
7508
7842
|
return cssChunks.filter(Boolean).join("\n\n");
|
|
7509
7843
|
}
|
|
@@ -7566,7 +7900,7 @@ const MEDIA_CORNER_MAP = {
|
|
|
7566
7900
|
* This CSS-first approach eliminates runtime transforms for styling,
|
|
7567
7901
|
* keeping transforms only for data normalization and dynamic layout.
|
|
7568
7902
|
*/
|
|
7569
|
-
function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palette) {
|
|
7903
|
+
function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palette, solvedInks) {
|
|
7570
7904
|
const selectorsFor = (suffix) => cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}${suffix}`).join(",\n");
|
|
7571
7905
|
const containerSelectors = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}`);
|
|
7572
7906
|
const containerSelector = containerSelectors.join(",\n");
|
|
@@ -7574,7 +7908,7 @@ function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palett
|
|
|
7574
7908
|
const contentSelector = selectorsFor(" .card-content");
|
|
7575
7909
|
const fallbackBackgroundSelector = selectorsFor(" > .rb-bg-surface");
|
|
7576
7910
|
const rules = [];
|
|
7577
|
-
rules.push(...cardSurfaceRules(variant, tokens, theme, palette));
|
|
7911
|
+
rules.push(...cardSurfaceRules(variant, tokens, theme, palette, solvedInks));
|
|
7578
7912
|
const resolveColor = (token) => tokens.getColor(token);
|
|
7579
7913
|
rules.push(...cardBorderDeclarations(variant.border ? borderDeclaration(variant.border, tokens) : null, variant.decorations, resolveColor));
|
|
7580
7914
|
const corners = variant.corners ?? theme.corners;
|
|
@@ -7598,7 +7932,7 @@ function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palett
|
|
|
7598
7932
|
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
7599
7933
|
].join("\n\n");
|
|
7600
7934
|
}
|
|
7601
|
-
function cardSurfaceRules(variant, tokens, theme, palette) {
|
|
7935
|
+
function cardSurfaceRules(variant, tokens, theme, palette, solvedInks) {
|
|
7602
7936
|
if (variant.background.type === "transparent") return ["background: transparent"];
|
|
7603
7937
|
const surface = resolveSurface({
|
|
7604
7938
|
kind: "paint",
|
|
@@ -7606,7 +7940,8 @@ function cardSurfaceRules(variant, tokens, theme, palette) {
|
|
|
7606
7940
|
}, {
|
|
7607
7941
|
palette,
|
|
7608
7942
|
buttonSystem: theme.buttons,
|
|
7609
|
-
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken
|
|
7943
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken,
|
|
7944
|
+
solvedInks
|
|
7610
7945
|
});
|
|
7611
7946
|
return [cardBackgroundRule(variant.background, tokens), ...opaqueSurfaceDeclarations(surface)];
|
|
7612
7947
|
}
|
|
@@ -8937,39 +9272,49 @@ function renderHeaderPaintTargetRule(target, rules) {
|
|
|
8937
9272
|
"border-radius: inherit;",
|
|
8938
9273
|
"z-index: -1;"
|
|
8939
9274
|
] : [];
|
|
8940
|
-
return `${target.selector} {\n ${[...pseudoElementSetup, ...rules].join("\n ")}\n}`;
|
|
8941
|
-
}
|
|
8942
|
-
case "viewport-band": {
|
|
8943
|
-
const { top, bottom } = target.extent;
|
|
8944
|
-
const ownerRules = [
|
|
8945
|
-
`${top.customProperty}: ${top.value};`,
|
|
8946
|
-
`${bottom.customProperty}: ${bottom.value};`,
|
|
8947
|
-
`${top.ownerProperty}: var(${top.customProperty});`,
|
|
8948
|
-
...target.ownerNeedsPositioning ? ["position: relative;"] : [],
|
|
8949
|
-
"isolation: isolate;",
|
|
8950
|
-
"background: none;",
|
|
8951
|
-
"backdrop-filter: none;",
|
|
8952
|
-
"-webkit-backdrop-filter: none;",
|
|
8953
|
-
"border: 0;",
|
|
8954
|
-
"box-shadow: none;"
|
|
8955
|
-
];
|
|
8956
|
-
const bandRules = [
|
|
8957
|
-
"content: \"\";",
|
|
8958
|
-
"position: absolute;",
|
|
8959
|
-
`top: calc(-1 * var(${top.customProperty}));`,
|
|
8960
|
-
`bottom: calc(-1 * var(${bottom.customProperty}));`,
|
|
8961
|
-
"left: 50%;",
|
|
8962
|
-
"width: 100vw;",
|
|
8963
|
-
"transform: translateX(-50%);",
|
|
8964
|
-
"pointer-events: none;",
|
|
8965
|
-
"border-radius: 0;",
|
|
8966
|
-
"z-index: -1;",
|
|
8967
|
-
...rules
|
|
8968
|
-
];
|
|
8969
|
-
return `${target.clipSelector} {\n overflow-x: clip;\n}\n${target.ownerSelector} {\n ${ownerRules.join("\n ")}\n}\n${target.selector} {\n ${bandRules.join("\n ")}\n}`;
|
|
9275
|
+
return `${target.pseudoElement === "inset" ? headerPaintOwnerInks(target.selector.replace(/::before$/, ""), rules) : ""}${target.selector} {\n ${[...pseudoElementSetup, ...rules].join("\n ")}\n}`;
|
|
8970
9276
|
}
|
|
9277
|
+
case "viewport-band": return renderViewportBandPaint(target, rules);
|
|
8971
9278
|
}
|
|
8972
9279
|
}
|
|
9280
|
+
function headerInkRules(rules) {
|
|
9281
|
+
return rules.filter((rule) => Object.values(SURFACE_INK_CSS_VARS).some((variable) => rule.startsWith(`${variable}:`)));
|
|
9282
|
+
}
|
|
9283
|
+
function headerPaintOwnerInks(selector, rules) {
|
|
9284
|
+
const inks = headerInkRules(rules);
|
|
9285
|
+
return inks.length === 0 ? "" : `${selector} {\n ${inks.join("\n ")}\n}\n`;
|
|
9286
|
+
}
|
|
9287
|
+
/** Viewport paint stays on its pseudo-element; inherited ink belongs to the content owner. */
|
|
9288
|
+
function renderViewportBandPaint(target, rules) {
|
|
9289
|
+
const { top, bottom } = target.extent;
|
|
9290
|
+
const ownerRules = [
|
|
9291
|
+
`${top.customProperty}: ${top.value};`,
|
|
9292
|
+
`${bottom.customProperty}: ${bottom.value};`,
|
|
9293
|
+
`${top.ownerProperty}: var(${top.customProperty});`,
|
|
9294
|
+
...target.ownerNeedsPositioning ? ["position: relative;"] : [],
|
|
9295
|
+
"isolation: isolate;",
|
|
9296
|
+
"background: none;",
|
|
9297
|
+
"backdrop-filter: none;",
|
|
9298
|
+
"-webkit-backdrop-filter: none;",
|
|
9299
|
+
"border: 0;",
|
|
9300
|
+
"box-shadow: none;",
|
|
9301
|
+
...headerInkRules(rules)
|
|
9302
|
+
];
|
|
9303
|
+
const bandRules = [
|
|
9304
|
+
"content: \"\";",
|
|
9305
|
+
"position: absolute;",
|
|
9306
|
+
`top: calc(-1 * var(${top.customProperty}));`,
|
|
9307
|
+
`bottom: calc(-1 * var(${bottom.customProperty}));`,
|
|
9308
|
+
"left: 50%;",
|
|
9309
|
+
"width: 100vw;",
|
|
9310
|
+
"transform: translateX(-50%);",
|
|
9311
|
+
"pointer-events: none;",
|
|
9312
|
+
"border-radius: 0;",
|
|
9313
|
+
"z-index: -1;",
|
|
9314
|
+
...rules
|
|
9315
|
+
];
|
|
9316
|
+
return `${target.clipSelector} {\n overflow-x: clip;\n}\n${target.ownerSelector} {\n ${ownerRules.join("\n ")}\n}\n${target.selector} {\n ${bandRules.join("\n ")}\n}`;
|
|
9317
|
+
}
|
|
8973
9318
|
//#endregion
|
|
8974
9319
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
8975
9320
|
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
@@ -8990,7 +9335,8 @@ function generateHeaderScrollTreatmentStyles(treatment, themeId, variant, surfac
|
|
|
8990
9335
|
`background-color: rgb(${backgroundChannels} / 0.60);`,
|
|
8991
9336
|
`backdrop-filter: ${CONTRAST_GLASS_BLUR};`,
|
|
8992
9337
|
`-webkit-backdrop-filter: ${CONTRAST_GLASS_BLUR};`,
|
|
8993
|
-
...surfaceRules
|
|
9338
|
+
...surfaceRules,
|
|
9339
|
+
...surfaceInkDeclarations({ kind: "reset" }).map((rule) => rule.replace(";", " !important;"))
|
|
8994
9340
|
]);
|
|
8995
9341
|
}
|
|
8996
9342
|
}
|
|
@@ -9401,6 +9747,12 @@ const dropdownStyleSchema = z.object({
|
|
|
9401
9747
|
"md",
|
|
9402
9748
|
"lg"
|
|
9403
9749
|
]).default("md"),
|
|
9750
|
+
surfaceTreatment: z.discriminatedUnion("kind", [z.object({ kind: z.literal("solid") }), z.object({
|
|
9751
|
+
kind: z.literal("frosted"),
|
|
9752
|
+
tone: z.enum(["fixed", "opening"]),
|
|
9753
|
+
opacity: z.number().min(0).max(1),
|
|
9754
|
+
blur: z.enum(["sm", "md"])
|
|
9755
|
+
})]).optional(),
|
|
9404
9756
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
9405
9757
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
9406
9758
|
textTransform: z.enum([
|
|
@@ -18070,4 +18422,4 @@ function ThemedAuthoredButton({ label, href, variant, size, extraClassName, disa
|
|
|
18070
18422
|
});
|
|
18071
18423
|
}
|
|
18072
18424
|
//#endregion
|
|
18073
|
-
export { headerInteractionPalettePair as $,
|
|
18425
|
+
export { headerInteractionPalettePair as $, unsafeAsCustomerPassId as $i, surfaceForegroundValue as $n, offeringsPreviewCompositionTreatmentValues as $r, borderColorStyle as $t, resolveButtonStyleSelection as A, repriceBookingCollectionOptions as Ai, surfaceInkPublication as An, asBlockOrderIndex as Ar, NAV_LINK_LETTER_SPACING_MAP as At, generateBaseInteractiveCSS as B, parseContentVersionId as Bi, resolveOpaqueSurfaceHex as Bn, defineBlockDesignCapability as Br, INPUT_SPACING_MAP as Bt, FileTextIcon as C, parseEventRegistrationErrorReason as Ci, resolveTokenOrCssColorValue as Cn, resolveManagedMediaReference as Cr, resolveBrandDisplay as Ct, buttonStyleSelectionParameterValue as D, planCheckoutPaymentFlow as Di, surfaceToneFromForegroundToken as Dn, arrangementModes as Dr, parseBlockCustomCssRules as Dt, buttonStyleHoverPreferenceValue as E, confirmationPaymentSchema as Ei, selectLogoVariant as En, skinTokenCssVars as Er, getComponentShadowVar as Et, buttonStyleSelectionsEqual as F, getBookingInstalmentPlanIntervalCount as Fi, getTextColorForBackground as Fn, asDesignSystemTemplateId as Fr, navLinkOwnsHoverForeground as Ft, containerStylesOverrideSchema as G, parseFormId as Gi, featuresFromHex as Gn, eyebrowTreatmentValues as Gr, ACCORDION_TRIGGER_LETTER_SPACING as Gt, parseThemeButtonVariantId as H, parseEditorSessionGeneration as Hi, defaultThemeTokens as Hn, defineFrameCapability as Hr, ACCORDION_OPEN_ACCENT_THICKNESS as Ht, generateButtonActionLayoutCss as I, formatCurrencyAmount as Ii, compositeHex$1 as In, asLayoutVariantKey as Ir, navLinkOwnsUnderline as It, sectionStylesOverrideSchema as J, parseSiteId as Ji, SURFACE_FOREGROUND_CSS_VARS as Jn, headingDecorationColorTokenValues as Jr, cardSurfacePaint as Jt, corners as K, parsePageId as Ki, hexToRgb as Kn, featureCardCompositionTreatmentValues as Kr, ICON_CONFIG as Kt, generateButtonCss as L, expectParsedBrandedId as Li, planForegroundHover as Ln, asPageFlowPresetId as Lr, navEffectPolicy as Lt, updateButtonStyleSelectionChoice as M, resolveBookingCollectionOptionFacts as Mi, _classPrivateFieldGet2 as Mn, asDesignBlockId as Mr, NAV_LINK_PADDING_X_MAP as Mt, buttonStyleSelectionKey as N, getBookingLaterInstalments as Ni, _classPrivateFieldSet2 as Nn, asDesignBoundaryId as Nr, NAV_LINK_TEXT_SIZE_MAP as Nt, defaultButtonStyleSelectionFor as O, planFlexibleBalanceCreditFirst as Oi, resolveSurfaceForeground as On, asAppearancePresetId as Or, parseCustomCssRules as Ot, buttonStyleSelectionSchema as P, validateBookingPaymentOptionKinds as Pi, expandPalette as Pn, asDesignPageId as Pr, navLinkHoverColorCandidate as Pt, runtimeBoxBackgroundSchema as Q, unsafeAsAppointmentServiceId as Qi, surfaceForegroundStyle as Qn, noHeadingDecoration as Qr, backgroundColorStyle as Qt, generateDefaultButtonSystem as R, parseApiKeyId as Ri, worstCaseGlassBackdrop as Rn, asSiteStyleId as Rr, FONT_WEIGHT_MAP$1 as Rt, FileSpreadsheetIcon as S, eventRegistrationErrors as Si, resolveThemeColorReferenceValue as Sn, indexRenderableMediaAssets as Sr, logoSizePolicyValues as St, PlusIcon as T, getStripeMinimumChargeRequirement as Ti, PUBLIC_BUTTON_ROLES as Tn, parseCanonicalMediaIdentifier as Tr, getComponentBorderWidthPx as Tt, parseThemeForPersistence as U, parseEventOfferingId as Ui, ORDINARY_TEXT_MIN_CONTRAST_RATIO as Un, designIssueSeverityForPolicy as Ur, ACCORDION_SPACING_MAP as Ut, generateInteractiveChildInheritanceCSS as V, parseEditorClientId as Vi, buildThemeTokens as Vn, defineExactCatalog as Vr, LABEL_FONT_SIZE_MAP as Vt, cardStylesOverrideSchema as W, parseEventSeriesId as Wi, _classPrivateFieldInitSpec as Wn, eventListTreatmentValues as Wr, ACCORDION_TRIGGER_FONT_SCALE as Wt, boxBackgroundOverlaySchema as X, parseUserId as Xi, surfaceForegroundDeclarations as Xn, isArrangementMode as Xr, renderCssDeclarations as Xt, themeSchema as Y, parseSiteTermsVersionId as Yi, SURFACE_INK_CSS_VARS as Yn, introCompositionTreatmentValues as Yr, generateCardCss as Yt, boxBackgroundSchema as Z, unsafeAsAppointmentResourceId as Zi, surfaceForegroundInputFromResolved as Zn, makeBoundaryId as Zr, TokenResolver as Zt, CirclePlusIcon as _, parseColorTokenParts as _i, gradientScrimSamples as _n, imageMediaSchema as _r, siteChromeBackgroundOverrideOwner as _t, ThemedDownloadLink as a, unsafeAsSiteId as aa, toNonEmptyReadonlyArray as ai, mapDrawingStyle as an, cardRoleSchema as ar, renderHeaderPaintTargetRules as at, FileArchiveIcon as b, checkBrowserStripeKey as bi, isCssColorLiteral as bn, buildRenderableMediaAssetIndex as br, brandDisplayModeValues as bt, isKnownIconName as c, buildGoogleFontFamilyQuery as ci, contrastThresholdByPolicy as cn, normalizeCardRole as cr, MQ_LG_UP as ct, resolveIconPickerPreset as d, getSiteFontsStorageUrl as di, prepareThemeSurfaceRevision as dn, paletteColorsEqual as dr, MQ_SM_UP as dt, unsafeAsFormId as ea, panelFrame as ei, cssVarValue as en, surfaceForegroundValueWithOpacity as er, headerInteractionPaletteValues as et, SEMANTIC_ICON_DEFINITIONS as f, VARIANT_ROLES as fi, resolveSurface as fn, paletteColorsSchema as fr, MQ_TABLET_ONLY as ft, CircleMinusIcon as g, parseBlockColorToken as gi, toAccessibleColorSurfaceIntent as gn, requirePaletteColorsFromEntries as gr, pageDesignEditorBackgroundOverrideOwner as gt, ChevronDownIcon as h, themeColorShadeSteps as hi, surfaceTransportContext as hn, paletteValueKeySchema as hr, isThemeV2NormalEditorRawStylePath as ht, ThemedButtonSpecimen as i, unsafeAsPositiveSeconds as ia, tileTreatmentValues as ii, textColorValue as in, generateShadowValue$1 as ir, getHeaderPaintTargets as it, updateButtonStyleHoverPreference as j, resolveAvailableBookingCollectionOptions as ji, solveSurfaceInks as jn, asBoundaryOptionId as jr, NAV_LINK_PADDING_MAP as jt, findButtonStyleRecipe as k, isBookingCollectionEquivalentToUpfront as ki, safeTokenOr as kn, asBlockContentVersionId as kr, NAV_LINK_BORDER_RADIUS_MAP as kt, ICON_PICKER_PRESETS as l, generateFontFaceCss as li, parseResolvedSurface as ln, hexColorSchema as lr, MQ_MD_DOWN as lt, ArrowDownIcon as m, parseThemeColorToken as mi, surfaceDecorationColors as mn, paletteValueKey as mr, isThemeV2NormalEditorRawStyleFieldName as mt, ThemedButton as n, unsafeAsPassId as na, requireNonEmptyReadonlyArray as ni, rgbColorValue as nn, surfaceInkStyle as nr, generateHeaderScrollTreatmentStyles as nt, getIconComponent as o, unsafeAsStorageBucketName as oa, visibleHeadingDecorationFamilyValues as oi, opaqueSurfaceContextFromTheme as on, cardRoleValues as or, BREAKPOINT_LG as ot, isSemanticIconId as p, unsafeAsOpaqueButtonColourToken as pi, serializeSurfaceTree as pn, paletteModeSchema as pr, headerVariantValues as pt, headerPositioningValues as q, parsePageSurfaceId as qi, DEFAULT_SURFACE_TEXT_COLOR as qn, flushPanelFrame as qr, ICON_SIZE_PX as qt, ThemedButtonLink as r, unsafeAsPositiveByteCount as ra, testimonialsCompositionTreatmentValues as ri, textColorStyle as rn, resolveCardRole as rr, generateMobileOverlayBackdropFilterFix as rt, getIconPickerOptionsForPreset as s, unsafeAsStoragePath as sa, buildFontPreviewUrl as si, opaqueSurfaceDeclarations as sn, cardVariantRoleValues as sr, BREAKPOINT_XL as st, ThemedAuthoredButton as t, unsafeAsMediaAssetId as ta, plainFrame as ti, mergeStyles as tn, surfaceInkDeclarations as tr, headerInteractionQuietPalette as tt, isIconPickerPreset as u, getFontWidthRange as ui, parseSurfaceTree as un, paletteColorEntries as ur, MQ_SM_DOWN as ut, ClockIcon as v, SpinnerNode as vi, minimumScrimOpacity as vn, mediaSchema as vr, stripStaleTransitionStyleGroup as vt, MinusIcon as w, checkoutCopy as wi, generateShadowValue as wn, mediaIdentifierSchema as wr, selectLogoAccommodation as wt, FileAudioIcon as x, eventRegistrationErrorEndsCommand as xi, resolveOnColorForThemeToken as xn, renderableMediaAssetSchema as xr, deterministicLogoFactsForShape as xt, ExternalLinkIcon as y, clsx as yi, scrimTone as yn, runtimeMediaSchema as yr, themeV2RuntimeStyleFieldNames as yt, generateEffectsCSS as z, parseContentEntryId as zi, resolveConcreteColorHex as zn, assertNever as zr, INPUT_FONT_SIZE_MAP as zt };
|