@riverbankcms/sdk 0.149.0 → 0.150.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DBKln68M.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +3 -3
- package/dist/{PreviewEditorUI-DpRX4Mum.mjs → PreviewEditorUI-BIJucTRd.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-DJPmPY-r.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +4 -3
- package/dist/{SiteChromeCustomizeContext-JYA0cJ_Z.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4454 -4059
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +90 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +4 -4
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +1 -0
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/types.d.ts +5 -6
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +30 -1
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/client/{BookingMailingListNote-Cr3EeTP5.mjs → BookingMailingListNote-CYHOufsI.mjs} +10 -440
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BFGB1Fay.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-DKYV0_ft.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-B9UIcEYc.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CFLPkP0K.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-JjmgxEsR.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-CKV1Jh2m.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-DXWIfT3T.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-CjZgHNvv.mjs → bookingForm-BVPJE5RQ.mjs} +11 -10
- package/dist/client/bookings.mjs +2668 -1134
- package/dist/client/{carousel-DSLikmvZ.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-HDjWReFt.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-CUvRZA3W.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3042 -1868
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-DFmaZa-Q.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-BBep1JnF.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-zEobhxo4.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-Dp7bz5k-.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-FE-zqTt7.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BMt5snal.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-O6ZxHfOb.mjs → eventRegistration-BoXfSFgZ.mjs} +1403 -857
- package/dist/client/{form-DFa1D8vt.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-CmjHLR-N.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +123 -64
- package/dist/client/{locationMap-BXKP_lGh.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-CU-HmxGx.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-KEAEsibq.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Ckp7MGnt.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-D91V0sYa.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-DZd6RJeA.mjs → propsDecoder-DiIeBopB.mjs} +758 -245
- package/dist/client/rendering/client.mjs +4381 -2892
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3026 -1852
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-E1EkhhYY.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-4F2jLQPI.mjs → shop-CYT5P-S5.mjs} +8 -8
- package/dist/client/{shop-commerce-store-vicweP2K.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-BbfCJjB3.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DlONJt0T.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-COYyL3m7.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-CwvFFjB-.mjs → sdk-runtime-2p8uQk1V.mjs} +1 -1
- package/dist/{separator-ByL72zUT.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4066 -3765
- package/dist/server/config-validation.mjs +185 -126
- package/dist/server/config.mjs +185 -126
- package/dist/server/data.mjs +123 -64
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +615 -314
- package/dist/server/page-converter.mjs +100 -56
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4041 -3751
- package/dist/server/rendering.mjs +4069 -3768
- package/dist/server/routing.mjs +149 -72
- package/dist/server/server.mjs +124 -65
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
package/dist/server/theme.mjs
CHANGED
|
@@ -247,120 +247,6 @@ function isOnColorBackgroundCandidateToken(token) {
|
|
|
247
247
|
return BACKGROUND_ROLE_NAMES.has(role);
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
|
-
//#region ../theme-core/src/palette/generateShades.ts
|
|
251
|
-
function generateShades(hexColor, name) {
|
|
252
|
-
const shadeSteps = [
|
|
253
|
-
50,
|
|
254
|
-
100,
|
|
255
|
-
200,
|
|
256
|
-
300,
|
|
257
|
-
400,
|
|
258
|
-
500,
|
|
259
|
-
600,
|
|
260
|
-
700,
|
|
261
|
-
800,
|
|
262
|
-
900,
|
|
263
|
-
950
|
|
264
|
-
];
|
|
265
|
-
const base = featuresFromHex(hexColor);
|
|
266
|
-
const hue = base.okH;
|
|
267
|
-
const baseChroma = base.okC;
|
|
268
|
-
const toneMap = {
|
|
269
|
-
50: .975,
|
|
270
|
-
100: .945,
|
|
271
|
-
200: .89,
|
|
272
|
-
300: .82,
|
|
273
|
-
400: .74,
|
|
274
|
-
500: .66,
|
|
275
|
-
600: .58,
|
|
276
|
-
700: .49,
|
|
277
|
-
800: .4,
|
|
278
|
-
900: .28,
|
|
279
|
-
950: .16
|
|
280
|
-
};
|
|
281
|
-
const shadeDefs = shadeSteps.map((step, idx) => {
|
|
282
|
-
const t = idx / (shadeSteps.length - 1);
|
|
283
|
-
const L = toneMap[step];
|
|
284
|
-
const C = baseChroma * (.06 + .94 * Math.sin(Math.PI * t));
|
|
285
|
-
return {
|
|
286
|
-
name: `${name}-${step}`,
|
|
287
|
-
hex: oklchToHexGamut(L, C, hue)
|
|
288
|
-
};
|
|
289
|
-
});
|
|
290
|
-
shadeDefs.push({
|
|
291
|
-
name,
|
|
292
|
-
hex: hexColor
|
|
293
|
-
});
|
|
294
|
-
return shadeDefs;
|
|
295
|
-
}
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region ../theme-core/src/palette/expandPalette.ts
|
|
298
|
-
function colorsToMap(palette) {
|
|
299
|
-
const map = {};
|
|
300
|
-
for (const c of palette.colors) map[c.name] = c.hex;
|
|
301
|
-
return map;
|
|
302
|
-
}
|
|
303
|
-
function isBackgroundDark(hex) {
|
|
304
|
-
try {
|
|
305
|
-
return featuresFromHex(hex).Y < .5;
|
|
306
|
-
} catch {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
const nonShadeablePaletteRoleNames = /* @__PURE__ */ new Set([
|
|
311
|
-
"success",
|
|
312
|
-
"warning",
|
|
313
|
-
"destructive"
|
|
314
|
-
]);
|
|
315
|
-
/**
|
|
316
|
-
* Status role aliases the persisted palette does not carry itself.
|
|
317
|
-
*
|
|
318
|
-
* Generators reference `--tb-error` (the site-style-owned input error border)
|
|
319
|
-
* and `--tb-info` (`.alert-info`, `.status-info`, the field-note rule), but the
|
|
320
|
-
* palette schema only defines `destructive` and has no `info` role at all.
|
|
321
|
-
* Without these aliases those declarations name variables that are never
|
|
322
|
-
* defined and browsers drop them. The SDK bridge resolves the same pair via
|
|
323
|
-
* TOKEN_ALIASES, so both runtimes agree on what a status token means.
|
|
324
|
-
*
|
|
325
|
-
* Runs after the danger → destructive promotion above, so `destructive` is
|
|
326
|
-
* already the single source of truth for the error colour.
|
|
327
|
-
*/
|
|
328
|
-
function statusAliasTokens(expanded) {
|
|
329
|
-
const aliases = {};
|
|
330
|
-
if (expanded.destructive) aliases.error = expanded.destructive;
|
|
331
|
-
if (expanded.accent) aliases.info = expanded.accent;
|
|
332
|
-
return aliases;
|
|
333
|
-
}
|
|
334
|
-
function expandPalette(palette) {
|
|
335
|
-
const base = colorsToMap(palette);
|
|
336
|
-
const expanded = { ...base };
|
|
337
|
-
generateNeutralScale({
|
|
338
|
-
background: base.background || base.surface || "#ffffff",
|
|
339
|
-
steps: 11,
|
|
340
|
-
warm: false
|
|
341
|
-
}).forEach((n) => {
|
|
342
|
-
expanded[n.name] = n.hex;
|
|
343
|
-
});
|
|
344
|
-
for (const [name, hex] of Object.entries(base)) {
|
|
345
|
-
if (nonShadeablePaletteRoleNames.has(name)) continue;
|
|
346
|
-
if (hex) generateShades(hex, name).forEach((shade) => {
|
|
347
|
-
expanded[shade.name] = shade.hex;
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
if (base.text) expanded.body = base.text;
|
|
351
|
-
if (base.danger && !base.destructive) expanded.destructive = base.danger;
|
|
352
|
-
Object.assign(expanded, statusAliasTokens(expanded));
|
|
353
|
-
const isDark = base.background ? isBackgroundDark(base.background) : false;
|
|
354
|
-
expanded.mutedText = palette.meta?.mode === "dark" || isDark ? expanded["neutral-600"] ?? "#666" : expanded["neutral-500"] ?? "#888";
|
|
355
|
-
for (const [token, hex] of Object.entries({ ...expanded })) {
|
|
356
|
-
if (!hex || !isOnColorBackgroundCandidateToken(token)) continue;
|
|
357
|
-
const onToken = onColorTokenName(token);
|
|
358
|
-
if (expanded[onToken]) continue;
|
|
359
|
-
expanded[onToken] = getTextColorForBackground(hex);
|
|
360
|
-
}
|
|
361
|
-
return expanded;
|
|
362
|
-
}
|
|
363
|
-
//#endregion
|
|
364
250
|
//#region ../theme-core/src/tokens/colorTokenParts.ts
|
|
365
251
|
function parseOpacityPercent(source) {
|
|
366
252
|
const trimmed = source.trim();
|
|
@@ -636,6 +522,120 @@ z.string().transform((value, ctx) => {
|
|
|
636
522
|
return z.NEVER;
|
|
637
523
|
});
|
|
638
524
|
//#endregion
|
|
525
|
+
//#region ../theme-core/src/palette/generateShades.ts
|
|
526
|
+
function generateShades(hexColor, name) {
|
|
527
|
+
const shadeSteps = [
|
|
528
|
+
50,
|
|
529
|
+
100,
|
|
530
|
+
200,
|
|
531
|
+
300,
|
|
532
|
+
400,
|
|
533
|
+
500,
|
|
534
|
+
600,
|
|
535
|
+
700,
|
|
536
|
+
800,
|
|
537
|
+
900,
|
|
538
|
+
950
|
|
539
|
+
];
|
|
540
|
+
const base = featuresFromHex(hexColor);
|
|
541
|
+
const hue = base.okH;
|
|
542
|
+
const baseChroma = base.okC;
|
|
543
|
+
const toneMap = {
|
|
544
|
+
50: .975,
|
|
545
|
+
100: .945,
|
|
546
|
+
200: .89,
|
|
547
|
+
300: .82,
|
|
548
|
+
400: .74,
|
|
549
|
+
500: .66,
|
|
550
|
+
600: .58,
|
|
551
|
+
700: .49,
|
|
552
|
+
800: .4,
|
|
553
|
+
900: .28,
|
|
554
|
+
950: .16
|
|
555
|
+
};
|
|
556
|
+
const shadeDefs = shadeSteps.map((step, idx) => {
|
|
557
|
+
const t = idx / (shadeSteps.length - 1);
|
|
558
|
+
const L = toneMap[step];
|
|
559
|
+
const C = baseChroma * (.06 + .94 * Math.sin(Math.PI * t));
|
|
560
|
+
return {
|
|
561
|
+
name: `${name}-${step}`,
|
|
562
|
+
hex: oklchToHexGamut(L, C, hue)
|
|
563
|
+
};
|
|
564
|
+
});
|
|
565
|
+
shadeDefs.push({
|
|
566
|
+
name,
|
|
567
|
+
hex: hexColor
|
|
568
|
+
});
|
|
569
|
+
return shadeDefs;
|
|
570
|
+
}
|
|
571
|
+
//#endregion
|
|
572
|
+
//#region ../theme-core/src/palette/expandPalette.ts
|
|
573
|
+
function colorsToMap(palette) {
|
|
574
|
+
const map = {};
|
|
575
|
+
for (const c of palette.colors) map[c.name] = c.hex;
|
|
576
|
+
return map;
|
|
577
|
+
}
|
|
578
|
+
function isBackgroundDark(hex) {
|
|
579
|
+
try {
|
|
580
|
+
return featuresFromHex(hex).Y < .5;
|
|
581
|
+
} catch {
|
|
582
|
+
return false;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
const nonShadeablePaletteRoleNames = /* @__PURE__ */ new Set([
|
|
586
|
+
"success",
|
|
587
|
+
"warning",
|
|
588
|
+
"destructive"
|
|
589
|
+
]);
|
|
590
|
+
/**
|
|
591
|
+
* Status role aliases the persisted palette does not carry itself.
|
|
592
|
+
*
|
|
593
|
+
* Generators reference `--tb-error` (the site-style-owned input error border)
|
|
594
|
+
* and `--tb-info` (`.alert-info`, `.status-info`, the field-note rule), but the
|
|
595
|
+
* palette schema only defines `destructive` and has no `info` role at all.
|
|
596
|
+
* Without these aliases those declarations name variables that are never
|
|
597
|
+
* defined and browsers drop them. The SDK bridge resolves the same pair via
|
|
598
|
+
* TOKEN_ALIASES, so both runtimes agree on what a status token means.
|
|
599
|
+
*
|
|
600
|
+
* Runs after the danger → destructive promotion above, so `destructive` is
|
|
601
|
+
* already the single source of truth for the error colour.
|
|
602
|
+
*/
|
|
603
|
+
function statusAliasTokens(expanded) {
|
|
604
|
+
const aliases = {};
|
|
605
|
+
if (expanded.destructive) aliases.error = expanded.destructive;
|
|
606
|
+
if (expanded.accent) aliases.info = expanded.accent;
|
|
607
|
+
return aliases;
|
|
608
|
+
}
|
|
609
|
+
function expandPalette(palette) {
|
|
610
|
+
const base = colorsToMap(palette);
|
|
611
|
+
const expanded = { ...base };
|
|
612
|
+
generateNeutralScale({
|
|
613
|
+
background: base.background || base.surface || "#ffffff",
|
|
614
|
+
steps: 11,
|
|
615
|
+
warm: false
|
|
616
|
+
}).forEach((n) => {
|
|
617
|
+
expanded[n.name] = n.hex;
|
|
618
|
+
});
|
|
619
|
+
for (const [name, hex] of Object.entries(base)) {
|
|
620
|
+
if (nonShadeablePaletteRoleNames.has(name)) continue;
|
|
621
|
+
if (hex) generateShades(hex, name).forEach((shade) => {
|
|
622
|
+
expanded[shade.name] = shade.hex;
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
if (base.text) expanded.body = base.text;
|
|
626
|
+
if (base.danger && !base.destructive) expanded.destructive = base.danger;
|
|
627
|
+
Object.assign(expanded, statusAliasTokens(expanded));
|
|
628
|
+
const isDark = base.background ? isBackgroundDark(base.background) : false;
|
|
629
|
+
expanded.mutedText = palette.meta?.mode === "dark" || isDark ? expanded["neutral-600"] ?? "#666" : expanded["neutral-500"] ?? "#888";
|
|
630
|
+
for (const [token, hex] of Object.entries({ ...expanded })) {
|
|
631
|
+
if (!hex || !isOnColorBackgroundCandidateToken(token)) continue;
|
|
632
|
+
const onToken = onColorTokenName(token);
|
|
633
|
+
if (expanded[onToken]) continue;
|
|
634
|
+
expanded[onToken] = getTextColorForBackground(hex);
|
|
635
|
+
}
|
|
636
|
+
return expanded;
|
|
637
|
+
}
|
|
638
|
+
//#endregion
|
|
639
639
|
//#region ../theme-core/src/footer/mode.ts
|
|
640
640
|
const footerModeSchema = z.enum([
|
|
641
641
|
"default",
|
|
@@ -4937,12 +4937,22 @@ const mediaPresentationSchema = commonSchema.extend({
|
|
|
4937
4937
|
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
4938
4938
|
commonSchema.extend({
|
|
4939
4939
|
type: z.literal("color"),
|
|
4940
|
-
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
4940
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4941
|
+
/**
|
|
4942
|
+
* Compiler-owned. The scrim a site-style colour surface lays over media
|
|
4943
|
+
* that replaces it (a Look's band meeting an authored photo), sized so the
|
|
4944
|
+
* surface's foreground stays legible over any pixel. A colour background
|
|
4945
|
+
* never draws it itself; `resolveSectionBackground` moves it onto the
|
|
4946
|
+
* merged media background as its overlay.
|
|
4947
|
+
*/
|
|
4948
|
+
mediaScrim: boxBackgroundOverlaySchema.nullable().optional()
|
|
4941
4949
|
}),
|
|
4942
4950
|
commonSchema.extend({
|
|
4943
4951
|
type: z.literal("gradient"),
|
|
4944
4952
|
gradient: z.string().nullable().optional(),
|
|
4945
|
-
gradientPresetId: z.string().min(1).nullable().optional()
|
|
4953
|
+
gradientPresetId: z.string().min(1).nullable().optional(),
|
|
4954
|
+
/** Compiler-owned; see the colour branch. */
|
|
4955
|
+
mediaScrim: boxBackgroundOverlaySchema.nullable().optional()
|
|
4946
4956
|
}),
|
|
4947
4957
|
mediaPresentationSchema.extend({
|
|
4948
4958
|
type: z.literal("image"),
|