@riverbankcms/sdk 0.132.0 → 0.134.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 +10 -0
- package/dist/{PreviewEditorSidebar-DKQ5eFK9.mjs → PreviewEditorSidebar-DfRhJPFQ.mjs} +3 -3
- package/dist/{PreviewEditorUI-CNTcOjCC.mjs → PreviewEditorUI-Dppxcr_g.mjs} +2 -2
- package/dist/{SdkPreviewModeRuntime-DJu3qu33.mjs → SdkPreviewModeRuntime-8CyGCXir.mjs} +46 -15
- package/dist/{SiteChromeCustomizeContext-2TzT3vbj.mjs → SiteChromeCustomizeContext-DVMTMvqA.mjs} +497 -169
- package/dist/_dts/ai/src/contracts/proposals.d.ts +384 -384
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +219 -219
- package/dist/_dts/api/src/accountApi.d.ts +5 -5
- package/dist/_dts/api/src/appointmentEndpointDefinitions.d.ts +1 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -14
- package/dist/_dts/api/src/bookings.d.ts +2 -2
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -1
- package/dist/_dts/api/src/courseEndpointDefinitions.d.ts +2 -2
- package/dist/_dts/api/src/endpoints.d.ts +3 -3
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation/contracts.d.ts +9 -6
- package/dist/_dts/api/src/navigation/linkResolver.d.ts +6 -2
- package/dist/_dts/api/src/navigation/types.d.ts +23 -6
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicBookingService.d.ts +15 -0
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +50 -50
- package/dist/_dts/api/src/siteBanner.d.ts +4 -2
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/api/src/webhooks.d.ts +12 -12
- package/dist/_dts/blocks/src/client.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +28 -72
- package/dist/_dts/blocks/src/index.d.ts +3 -2
- package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +2 -2
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +36 -14
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +148 -148
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingConsent.d.ts +36 -0
- package/dist/_dts/blocks/src/system/manifest/hydrateLinks.d.ts +9 -2
- package/dist/_dts/blocks/src/system/manifest/resolveBlockData.d.ts +8 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +79 -79
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -11
- package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/DynamicFormFields.d.ts +3 -19
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.consent.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.field-values.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.fields.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +38 -144
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -19
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +18 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/validation.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/whole-series-registration.headless.contract.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +34 -12
- package/dist/_dts/blocks/src/system/runtime/shared/components/BookingConsentAgreement.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/shared/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/types/link.d.ts +7 -1
- package/dist/_dts/content-model/src/content-types/schema.d.ts +4 -4
- package/dist/_dts/core/src/booking-consent.d.ts +8 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +9 -3
- package/dist/_dts/db/src/schemas/forms.d.ts +21 -21
- package/dist/_dts/db/src/types/jsonb.d.ts +1 -1
- package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +2 -1
- package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +3 -2
- package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +3 -4
- package/dist/_dts/media-core/src/usageScanner.d.ts +1 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +7 -89
- package/dist/_dts/sdk/src/config/validation.d.ts +30 -30
- package/dist/_dts/sdk/src/contracts/content.d.ts +10 -36
- package/dist/_dts/sdk/src/contracts/rendering.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +9 -9
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -19
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +12 -12
- package/dist/_dts/theme-core/src/cards/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +72 -72
- package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
- package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +82 -82
- package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button.d.ts +1 -1
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/client/{StepIndicator-CGixP_LW.mjs → BookingConsentAgreement-BxgpGEFD.mjs} +26 -4
- package/dist/client/{DiscountCodeDisclosure-DO7llLxm.mjs → DiscountCodeDisclosure-CfuPOHD0.mjs} +1 -1
- package/dist/client/{EventCombined.client-xID7zN__.mjs → EventCombined.client-DB8Qfzi-.mjs} +3 -3
- package/dist/client/{EventListing.client-CriBslp0.mjs → EventListing.client-DD4X8hp4.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DYmHnM8g.mjs → LeafletStaticMap-QhgIBQbv.mjs} +1 -1
- package/dist/client/{WholeSeriesRegistrationWizard-BEjzSiOA.mjs → WholeSeriesRegistrationWizard-DwtC7bCs.mjs} +72 -22
- package/dist/client/{accordion-CgFbnnnQ.mjs → accordion-DFXpLvwg.mjs} +1 -1
- package/dist/client/{bookingForm-dUyGpbxc.mjs → bookingForm-sI05d3lk.mjs} +73 -47
- package/dist/client/bookings.mjs +989 -140
- package/dist/client/{carousel-BvBwkUzx.mjs → carousel-wjyWTZCh.mjs} +1 -1
- package/dist/client/{cart-DiZENT2E.mjs → cart-DCwdpA4i.mjs} +3 -3
- package/dist/client/{checkout-Dq13KIgR.mjs → checkout-DTDW3l0R.mjs} +3 -3
- package/dist/client/checkoutUrls-DQYC_Br-.mjs +187 -0
- package/dist/client/client.mjs +556 -237
- package/dist/client/{context-B83PiNzm.mjs → context-TSK1CGx8.mjs} +1 -14
- package/dist/client/{courseRegistration-CKC5NmyH.mjs → courseRegistration-A-Tg7qw_.mjs} +3 -3
- package/dist/client/{eventCalendar-BF0Jatfw.mjs → eventCalendar-B0Zg-i_w.mjs} +5 -5
- package/dist/client/{eventCombined-BuoCF8je.mjs → eventCombined-B8Y2wizd.mjs} +3 -3
- package/dist/client/{eventDetails-CKwh0S9s.mjs → eventDetails-DPDOwURJ.mjs} +3 -3
- package/dist/client/{eventListing-eUxaWFaB.mjs → eventListing-CjBcmSLn.mjs} +3 -3
- package/dist/client/{eventRegistration-CfkNOkPb.mjs → eventRegistration-CK30HsAq.mjs} +111 -64
- package/dist/client/{form-C17H1c_H.mjs → form-CUXfsABE.mjs} +2 -2
- package/dist/client/{headerSection-DEwUmrtt.mjs → headerSection-N-mN3rjr.mjs} +2 -2
- package/dist/client/hooks.mjs +106 -3
- package/dist/client/{locationMap-Pf2QwuvW.mjs → locationMap-oiIDQMBt.mjs} +2 -2
- package/dist/client/{newsletterForm-BWQAH5Sv.mjs → newsletterForm-CkQ2tTrM.mjs} +2 -2
- package/dist/client/{pricing-CVdvbopJ.mjs → pricing-Caa0QWzh.mjs} +1 -1
- package/dist/client/{productDetail-BZi1Fa_G.mjs → productDetail-CnidyrsN.mjs} +3 -3
- package/dist/client/{productList-qq-55DNk.mjs → productList-CttYcS_S.mjs} +3 -3
- package/dist/client/{propsDecoder-BxmqPKdP.mjs → propsDecoder-CeUMxI9a.mjs} +211 -100
- package/dist/client/rendering/client.mjs +428 -151
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +643 -324
- package/dist/client/{scrollToBlock-B3CcKdtG.mjs → scrollToBlock-lPr1oqxB.mjs} +1 -1
- package/dist/client/{shop-DNWJPut5.mjs → shop-DXQtMo2O.mjs} +6 -6
- package/dist/client/{shop-commerce-BhvQCosS.mjs → shop-commerce-quDL411J.mjs} +7 -164
- package/dist/client/{shop-commerce-store-B04sCNnW.mjs → shop-commerce-store-Dnu-8Iub.mjs} +1 -1
- package/dist/client/{shopShared-DNNgZlmW.mjs → shopShared-BWPUURvG.mjs} +3 -3
- package/dist/client/{useEventFilters-CUmhE24_.mjs → useEventFilters-DRhWp2_5.mjs} +3 -3
- package/dist/client/{usePolling-M5jG675x.mjs → usePolling-UN4WKnaM.mjs} +2 -2
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-BEXb1wqo.mjs → sdk-runtime-Ca5RD78X.mjs} +1 -1
- package/dist/{separator-DGMuip1D.mjs → separator-CMhj6BTi.mjs} +1 -1
- package/dist/server/components.mjs +117 -37
- package/dist/server/config-validation.mjs +106 -3
- package/dist/server/config.mjs +106 -3
- package/dist/server/data.mjs +106 -3
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +186 -106
- package/dist/server/page-converter.mjs +105 -2
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +119 -37
- package/dist/server/rendering.mjs +117 -37
- package/dist/server/routing.mjs +132 -73
- package/dist/server/server.mjs +107 -4
- package/dist/server/theme-bridge.mjs +4 -4
- package/package.json +2 -2
- package/dist/client/checkoutUrls-Ct8Mxna3.mjs +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-CeUMxI9a.mjs";
|
|
2
2
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
3
3
|
import { n as normalizeCarouselProps, t as CarouselNodeClient } from "./carousel.client-59G_WMr4.mjs";
|
|
4
4
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { t as CartController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-CeUMxI9a.mjs";
|
|
2
|
+
import { t as CartController } from "./shop-commerce-quDL411J.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-BWPUURvG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/cart.client.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
-
import { n as CheckoutController } from "./shop-commerce-
|
|
3
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
1
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-CeUMxI9a.mjs";
|
|
2
|
+
import { n as CheckoutController } from "./shop-commerce-quDL411J.mjs";
|
|
3
|
+
import { t as mountShopBlockIsland } from "./shopShared-BWPUURvG.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region ../blocks/src/system/runtime/nodes/checkout.client.tsx
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as getCurrentResolveImageUrlContext, c as resolveImageUrlWithContext, t as ImagePresets } from "./media-BOHuueS5.mjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region ../blocks/src/primitives/content/utils/sanitizeHref.ts
|
|
6
|
+
const SAFE_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
7
|
+
"http:",
|
|
8
|
+
"https:",
|
|
9
|
+
"mailto:",
|
|
10
|
+
"tel:"
|
|
11
|
+
]);
|
|
12
|
+
const CONTROL_CHARS_PATTERN = /[\u0000-\u001F\u007F]+/g;
|
|
13
|
+
function normalizeInput(value) {
|
|
14
|
+
return value.replace(CONTROL_CHARS_PATTERN, "").trim();
|
|
15
|
+
}
|
|
16
|
+
function decodeForSchemeCheck(value) {
|
|
17
|
+
try {
|
|
18
|
+
return decodeURIComponent(value);
|
|
19
|
+
} catch {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns a safe href for rich-text anchors, or null when the value should not be rendered.
|
|
25
|
+
*
|
|
26
|
+
* Policy:
|
|
27
|
+
* - Allow absolute URLs with protocols: http, https, mailto, tel.
|
|
28
|
+
* - Allow root-relative ("/path") and hash-only ("#section") links.
|
|
29
|
+
* - Reject protocol-relative URLs ("//example.com"), bare domains ("example.com"),
|
|
30
|
+
* executable schemes (javascript/data/vbscript), malformed URLs, and empty values.
|
|
31
|
+
* - Preserve percent-encoding from the original normalized input.
|
|
32
|
+
*/
|
|
33
|
+
function sanitizeHref(raw) {
|
|
34
|
+
if (typeof raw !== "string") return null;
|
|
35
|
+
const normalized = normalizeInput(raw);
|
|
36
|
+
if (!normalized) return null;
|
|
37
|
+
if (normalized.startsWith("//")) return null;
|
|
38
|
+
if (normalized.startsWith("/")) return normalized;
|
|
39
|
+
if (normalized.startsWith("#")) return normalized;
|
|
40
|
+
const schemeMatch = normalizeInput(decodeForSchemeCheck(normalized)).match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
|
|
41
|
+
if (!schemeMatch) return null;
|
|
42
|
+
const rawScheme = schemeMatch[1];
|
|
43
|
+
if (!rawScheme) return null;
|
|
44
|
+
const protocol = `${rawScheme.toLowerCase()}:`;
|
|
45
|
+
if (!SAFE_PROTOCOLS.has(protocol)) return null;
|
|
46
|
+
try {
|
|
47
|
+
const parsed = new URL(normalized);
|
|
48
|
+
if (!SAFE_PROTOCOLS.has(parsed.protocol.toLowerCase())) return null;
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return normalized;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region ../blocks/src/primitives/content/components/RichText.tsx
|
|
56
|
+
function parseDimension(value) {
|
|
57
|
+
if (typeof value === "number" && Number.isFinite(value) && value > 0) return Math.round(value);
|
|
58
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
59
|
+
const parsed = Number(value);
|
|
60
|
+
if (Number.isFinite(parsed) && parsed > 0) return Math.round(parsed);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function normalizeRel(target, rel) {
|
|
64
|
+
const normalizedRel = rel?.trim();
|
|
65
|
+
if (target !== "_blank") return normalizedRel && normalizedRel.length > 0 ? normalizedRel : void 0;
|
|
66
|
+
const tokens = new Set((normalizedRel ?? "").split(/\s+/).map((token) => token.trim().toLowerCase()).filter(Boolean));
|
|
67
|
+
tokens.add("noopener");
|
|
68
|
+
tokens.add("noreferrer");
|
|
69
|
+
return Array.from(tokens).join(" ");
|
|
70
|
+
}
|
|
71
|
+
function renderMarks(text, marks, key, linkTarget) {
|
|
72
|
+
if (!marks || marks.length === 0) return text;
|
|
73
|
+
return marks.reduce((acc, mark) => {
|
|
74
|
+
switch (mark.type) {
|
|
75
|
+
case "bold":
|
|
76
|
+
case "strong": return /* @__PURE__ */ jsx("strong", { children: acc }, `${key}-b`);
|
|
77
|
+
case "italic":
|
|
78
|
+
case "em": return /* @__PURE__ */ jsx("em", { children: acc }, `${key}-i`);
|
|
79
|
+
case "link": {
|
|
80
|
+
if (typeof acc === "string" && acc.length === 0) return acc;
|
|
81
|
+
const attrs = mark.attrs ?? {};
|
|
82
|
+
const href = sanitizeHref(attrs.href);
|
|
83
|
+
if (!href) return acc;
|
|
84
|
+
const storedTarget = typeof attrs.target === "string" && attrs.target.trim().length > 0 ? attrs.target.trim() : void 0;
|
|
85
|
+
const target = linkTarget === "new-tab" ? "_blank" : storedTarget;
|
|
86
|
+
return /* @__PURE__ */ jsx("a", {
|
|
87
|
+
href,
|
|
88
|
+
target,
|
|
89
|
+
rel: normalizeRel(target, typeof attrs.rel === "string" ? attrs.rel : void 0),
|
|
90
|
+
children: acc
|
|
91
|
+
}, `${key}-l`);
|
|
92
|
+
}
|
|
93
|
+
default: return acc;
|
|
94
|
+
}
|
|
95
|
+
}, text);
|
|
96
|
+
}
|
|
97
|
+
function renderDoc(node, key, imageResolveContext, linkTarget) {
|
|
98
|
+
if (!node || !node.type) return null;
|
|
99
|
+
const children = node.content?.map((child, index) => renderDoc(child, `${key}-${index}`, imageResolveContext, linkTarget));
|
|
100
|
+
switch (node.type) {
|
|
101
|
+
case "doc": return /* @__PURE__ */ jsx(Fragment, { children });
|
|
102
|
+
case "paragraph":
|
|
103
|
+
if (!children && !node.text) return /* @__PURE__ */ jsx("p", {}, key);
|
|
104
|
+
return /* @__PURE__ */ jsx("p", { children: children ?? renderMarks(node.text ?? "", node.marks, key, linkTarget) }, key);
|
|
105
|
+
case "heading": {
|
|
106
|
+
const headingTag = `h${Math.min(Math.max(node.attrs?.level ?? 2, 1), 6)}`;
|
|
107
|
+
return React.createElement(headingTag, { key }, children);
|
|
108
|
+
}
|
|
109
|
+
case "bulletList": return /* @__PURE__ */ jsx("ul", { children }, key);
|
|
110
|
+
case "orderedList": return /* @__PURE__ */ jsx("ol", { children }, key);
|
|
111
|
+
case "listItem": return /* @__PURE__ */ jsx("li", { children }, key);
|
|
112
|
+
case "blockquote": return /* @__PURE__ */ jsx("blockquote", { children }, key);
|
|
113
|
+
case "horizontalRule": return /* @__PURE__ */ jsx("hr", {}, key);
|
|
114
|
+
case "hardBreak": return /* @__PURE__ */ jsx("br", {}, key);
|
|
115
|
+
case "image": {
|
|
116
|
+
const attrs = node.attrs ?? {};
|
|
117
|
+
const src = typeof attrs.src === "string" ? attrs.src.trim() : "";
|
|
118
|
+
const identifier = typeof attrs.identifier === "string" ? attrs.identifier.trim() : "";
|
|
119
|
+
const alt = typeof attrs.alt === "string" ? attrs.alt : "";
|
|
120
|
+
const title = typeof attrs.title === "string" && attrs.title.trim().length > 0 ? attrs.title : void 0;
|
|
121
|
+
const width = parseDimension(attrs.width);
|
|
122
|
+
const height = parseDimension(attrs.height);
|
|
123
|
+
const resolvedSrc = src || (identifier ? resolveImageUrlWithContext({
|
|
124
|
+
type: "image",
|
|
125
|
+
identifier
|
|
126
|
+
}, width ? {
|
|
127
|
+
width,
|
|
128
|
+
resize: "contain",
|
|
129
|
+
quality: 85
|
|
130
|
+
} : height ? {
|
|
131
|
+
height,
|
|
132
|
+
resize: "contain",
|
|
133
|
+
quality: 85
|
|
134
|
+
} : ImagePresets.full, imageResolveContext ?? void 0) ?? "" : "");
|
|
135
|
+
if (!resolvedSrc) return null;
|
|
136
|
+
return /* @__PURE__ */ jsx("img", {
|
|
137
|
+
src: resolvedSrc,
|
|
138
|
+
alt,
|
|
139
|
+
title,
|
|
140
|
+
width,
|
|
141
|
+
height,
|
|
142
|
+
loading: "lazy",
|
|
143
|
+
decoding: "async"
|
|
144
|
+
}, key);
|
|
145
|
+
}
|
|
146
|
+
case "text": return renderMarks(node.text ?? "", node.marks, key, linkTarget);
|
|
147
|
+
default: return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const DEFAULT_RICH_TEXT_CLASS = "rb-prose rb-max-w-none";
|
|
151
|
+
function RichText({ as: Comp = "div", className, doc, path, linkTarget = "stored" }) {
|
|
152
|
+
const imageResolveContext = getCurrentResolveImageUrlContext() ?? null;
|
|
153
|
+
const content = doc ? renderDoc(doc, "doc", imageResolveContext, linkTarget) : null;
|
|
154
|
+
const dataAttributes = path ? { "data-builder-richtext": path } : void 0;
|
|
155
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
156
|
+
className: className?.trim() || DEFAULT_RICH_TEXT_CLASS,
|
|
157
|
+
...dataAttributes,
|
|
158
|
+
children: content
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
|
|
163
|
+
/**
|
|
164
|
+
* Build return URLs for Stripe checkout redirect.
|
|
165
|
+
*
|
|
166
|
+
* Constructs success and cancel URLs that preserve existing query params
|
|
167
|
+
* and include the block anchor hash for post-redirect scroll targeting.
|
|
168
|
+
*
|
|
169
|
+
* @param paramName - Query parameter name to add (e.g., 'enrollment', 'registration')
|
|
170
|
+
* @param anchorId - Block anchor ID for hash fragment (e.g., 'course-registration')
|
|
171
|
+
* @returns Object with success and cancel URLs
|
|
172
|
+
*/
|
|
173
|
+
function buildCheckoutReturnUrls(paramName, anchorId) {
|
|
174
|
+
const currentUrl = new URL(window.location.href);
|
|
175
|
+
const hash = `#${anchorId}`;
|
|
176
|
+
const successParams = new URLSearchParams(currentUrl.search);
|
|
177
|
+
successParams.set(paramName, "success");
|
|
178
|
+
const successUrl = `${currentUrl.origin}${currentUrl.pathname}?${successParams.toString()}${hash}`;
|
|
179
|
+
const cancelParams = new URLSearchParams(currentUrl.search);
|
|
180
|
+
cancelParams.set(paramName, "cancelled");
|
|
181
|
+
return {
|
|
182
|
+
successUrl,
|
|
183
|
+
cancelUrl: `${currentUrl.origin}${currentUrl.pathname}?${cancelParams.toString()}${hash}`
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
export { RichText as n, buildCheckoutReturnUrls as t };
|