@riverbankcms/sdk 0.90.0 → 0.91.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/{PreviewEditorSidebar-KVXNF3VW.mjs → PreviewEditorSidebar-3TT47WCF.mjs} +3 -3
- package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-ORCLLUNZ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-GMCDQPZZ.mjs +8 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
- package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
- package/dist/_dts/api/src/index.d.ts +4 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
- package/dist/_dts/api/src/navigation.d.ts +2 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
- package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
- package/dist/_dts/api/src/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/core/src/event-pricing.d.ts +12 -2
- package/dist/_dts/core/src/string.d.ts +12 -0
- package/dist/_dts/sdk/src/cli/sync/validation.d.ts +2 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-GSPFFUVB.mjs → chunk-AFPMCLS7.mjs} +2 -2
- package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-GDT2QGIL.mjs} +1 -1
- package/dist/{chunk-PMBB6MQ7.mjs → chunk-RQUZYSES.mjs} +345 -153
- package/dist/{chunk-AEOYWPE4.mjs → chunk-S3YHJWEU.mjs} +7 -7
- package/dist/{chunk-UG7I7S7W.mjs → chunk-U5YM4AWE.mjs} +1 -1
- package/dist/{chunk-BOQXMCSP.mjs → chunk-ZA2S7H34.mjs} +3 -3
- package/dist/cli/index.mjs +363 -437
- package/dist/cli/init-docs/content/workflow-add-block.md +48 -0
- package/dist/cli/init-docs/content/workflow-custom-block.md +10 -0
- package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-AFX37652.mjs} +2 -2
- package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-32V5QCOW.mjs} +6 -6
- package/dist/client/bookings.mjs +1170 -571
- package/dist/client/{carousel-CVRN6EPP.mjs → carousel-TJGQJ7ER.mjs} +3 -3
- package/dist/client/{cart-IYIBA5CL.mjs → cart-JUU2JEW4.mjs} +6 -6
- package/dist/client/{checkout-O3BGM4GS.mjs → checkout-RD6BTFX4.mjs} +6 -6
- package/dist/client/{chunk-DAS5CIER.mjs → chunk-6QZIBNGV.mjs} +119 -21
- package/dist/client/{chunk-VFHZLZAC.mjs → chunk-6RN62XBV.mjs} +1 -1
- package/dist/client/{chunk-D3ETC2SU.mjs → chunk-C4LP6BPG.mjs} +1 -1
- package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-CKXEUWWA.mjs} +2 -2
- package/dist/client/{chunk-4RTFGHZN.mjs → chunk-E6VIWZUG.mjs} +6 -3
- package/dist/client/{chunk-Z62JYS5O.mjs → chunk-FMZZHAIR.mjs} +2 -2
- package/dist/client/{chunk-FHU6PFPM.mjs → chunk-ISAUXU5R.mjs} +1 -1
- package/dist/client/{chunk-HIHOQGIP.mjs → chunk-LJCX6V7Q.mjs} +9 -9
- package/dist/client/{chunk-6DPXDOIL.mjs → chunk-MLBNVN4H.mjs} +99 -26
- package/dist/client/{chunk-7DH35FGA.mjs → chunk-PMNAV6LO.mjs} +1 -1
- package/dist/client/{chunk-MFPKS6QS.mjs → chunk-RMOFBBNA.mjs} +5 -5
- package/dist/client/{chunk-25W2EQUN.mjs → chunk-RWYFG625.mjs} +17 -8
- package/dist/client/client.mjs +305 -113
- package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-X63QAIVV.mjs} +6 -6
- package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-5T24GCZL.mjs} +9 -9
- package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-AZVTF22X.mjs} +9 -9
- package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-7GPFNLGF.mjs} +9 -9
- package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-QEUMTMUM.mjs} +9 -9
- package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-P2EDKCQZ.mjs} +9 -9
- package/dist/client/{form-ZS6KX4U2.mjs → form-NUJ7H4IN.mjs} +3 -3
- package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-JB7LECPL.mjs} +3 -3
- package/dist/client/hooks.mjs +93 -42
- package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-UEYWUCSW.mjs} +3 -3
- package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-S2YZQ2X7.mjs} +3 -3
- package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-H5MADGG7.mjs} +6 -6
- package/dist/client/{productList-NI72Q62Z.mjs → productList-DK7YON7H.mjs} +6 -6
- package/dist/client/rendering/client.mjs +262 -70
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +306 -114
- package/dist/client/{shop-3ZQPEWYI.mjs → shop-6PA7RDRJ.mjs} +6 -6
- package/dist/client/spam-protection.mjs +10 -10
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-JP5347OB.mjs} +6 -6
- package/dist/server/components.mjs +149 -69
- package/dist/server/config-validation.mjs +85 -34
- package/dist/server/config.mjs +85 -34
- package/dist/server/data.mjs +93 -42
- package/dist/server/index.mjs +1 -1
- package/dist/server/navigation.mjs +2 -2
- package/dist/server/next.mjs +170 -90
- package/dist/server/page-converter.mjs +77 -26
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +161 -81
- package/dist/server/rendering.mjs +165 -85
- package/dist/server/routing.mjs +135 -58
- package/dist/server/server.mjs +102 -51
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
package/dist/server/data.mjs
CHANGED
|
@@ -6497,6 +6497,8 @@ function publicEventPricingType(pricing) {
|
|
|
6497
6497
|
case "ticket_types":
|
|
6498
6498
|
case "course":
|
|
6499
6499
|
return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
|
|
6500
|
+
case "external":
|
|
6501
|
+
return "external";
|
|
6500
6502
|
}
|
|
6501
6503
|
}
|
|
6502
6504
|
function isFreePublicEventPriceDisplay(display) {
|
|
@@ -6510,6 +6512,7 @@ function isFreePublicEventPriceDisplay(display) {
|
|
|
6510
6512
|
case "range":
|
|
6511
6513
|
case "mixed":
|
|
6512
6514
|
case "unavailable":
|
|
6515
|
+
case "external":
|
|
6513
6516
|
return false;
|
|
6514
6517
|
}
|
|
6515
6518
|
}
|
|
@@ -6527,11 +6530,11 @@ function isValidTimeZone(timeZone) {
|
|
|
6527
6530
|
}
|
|
6528
6531
|
function getSafeTimeZone(timeZone) {
|
|
6529
6532
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
6530
|
-
return normalized && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
6533
|
+
return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
6531
6534
|
}
|
|
6532
6535
|
function parseStrictBookingTimeZone(timeZone) {
|
|
6533
6536
|
const normalized = timeZone.trim();
|
|
6534
|
-
if (
|
|
6537
|
+
if (normalized.length === 0 || !isValidTimeZone(normalized)) {
|
|
6535
6538
|
return null;
|
|
6536
6539
|
}
|
|
6537
6540
|
return normalized;
|
|
@@ -6605,7 +6608,7 @@ function parseScheduledBookingDateTime(input) {
|
|
|
6605
6608
|
try {
|
|
6606
6609
|
const startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
6607
6610
|
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
6608
|
-
if (
|
|
6611
|
+
if (timeZone === null) {
|
|
6609
6612
|
return {
|
|
6610
6613
|
ok: false,
|
|
6611
6614
|
field: "timeZone",
|
|
@@ -6651,10 +6654,10 @@ function normalizeLocationAddressText(value) {
|
|
|
6651
6654
|
return null;
|
|
6652
6655
|
}
|
|
6653
6656
|
const trimmed = value.trim();
|
|
6654
|
-
return trimmed ? trimmed : null;
|
|
6657
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
6655
6658
|
}
|
|
6656
6659
|
function hasLocationCoordinates(value) {
|
|
6657
|
-
return typeof value
|
|
6660
|
+
return value != null && typeof value.lat === "number" && typeof value.lng === "number";
|
|
6658
6661
|
}
|
|
6659
6662
|
function toLocationCoordinates(value) {
|
|
6660
6663
|
if (!hasLocationCoordinates(value)) {
|
|
@@ -28072,6 +28075,18 @@ var publicCoursesArraySchema = z42.array(publicCourseSchema);
|
|
|
28072
28075
|
var eventPresetSchema = z43.enum(["event", "class", "workshop", "retreat", "performance"]);
|
|
28073
28076
|
var eventScheduleScopeSchema = z43.enum(["recurring", "oneOff"]);
|
|
28074
28077
|
var eventDestinationModeSchema = z43.enum(["cms-managed", "system-managed"]);
|
|
28078
|
+
var publicEventDestinationSchema = z43.discriminatedUnion("kind", [
|
|
28079
|
+
z43.object({
|
|
28080
|
+
kind: z43.literal("native"),
|
|
28081
|
+
mode: eventDestinationModeSchema,
|
|
28082
|
+
path: z43.string()
|
|
28083
|
+
}),
|
|
28084
|
+
z43.object({
|
|
28085
|
+
kind: z43.literal("external"),
|
|
28086
|
+
url: z43.string(),
|
|
28087
|
+
label: z43.string()
|
|
28088
|
+
})
|
|
28089
|
+
]);
|
|
28075
28090
|
var eventVenueSchema = z43.object({
|
|
28076
28091
|
id: z43.string(),
|
|
28077
28092
|
name: z43.string(),
|
|
@@ -28086,7 +28101,7 @@ var eventCategorySchema = z43.object({
|
|
|
28086
28101
|
name: z43.string(),
|
|
28087
28102
|
color: z43.string().nullable()
|
|
28088
28103
|
});
|
|
28089
|
-
var pricingTypeSchema = z43.enum(["free", "paid"]);
|
|
28104
|
+
var pricingTypeSchema = z43.enum(["free", "paid", "external"]);
|
|
28090
28105
|
var accessRestrictionSchema = z43.enum(["none", "category"]);
|
|
28091
28106
|
var eventPricingModeSchema = z43.enum(["single", "ticket_types"]);
|
|
28092
28107
|
var publicCoursePriceDisplaySchema = z43.discriminatedUnion("kind", [
|
|
@@ -28107,6 +28122,7 @@ var publicEventPriceDisplaySchema = z43.discriminatedUnion("kind", [
|
|
|
28107
28122
|
currency: z43.string()
|
|
28108
28123
|
}),
|
|
28109
28124
|
z43.object({ kind: z43.literal("unavailable"), currency: z43.string() }),
|
|
28125
|
+
z43.object({ kind: z43.literal("external"), label: z43.string() }),
|
|
28110
28126
|
z43.object({ kind: z43.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
28111
28127
|
]);
|
|
28112
28128
|
var publicEventTicketTypePriceDisplaySchema = z43.union([
|
|
@@ -28185,6 +28201,10 @@ var publicEventPricingSchema = z43.discriminatedUnion("kind", [
|
|
|
28185
28201
|
z43.object({
|
|
28186
28202
|
kind: z43.literal("course"),
|
|
28187
28203
|
display: z43.object({ kind: z43.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
28204
|
+
}),
|
|
28205
|
+
z43.object({
|
|
28206
|
+
kind: z43.literal("external"),
|
|
28207
|
+
display: z43.object({ kind: z43.literal("external"), label: z43.string() })
|
|
28188
28208
|
})
|
|
28189
28209
|
]);
|
|
28190
28210
|
var publicTeamMemberSummarySchema = z43.object({
|
|
@@ -28213,7 +28233,8 @@ var publicEventSchema = z43.object({
|
|
|
28213
28233
|
image: mediaSchema2.nullable().optional()
|
|
28214
28234
|
}).optional(),
|
|
28215
28235
|
slug: z43.string(),
|
|
28216
|
-
path: z43.string(),
|
|
28236
|
+
path: z43.string().nullable(),
|
|
28237
|
+
destination: publicEventDestinationSchema,
|
|
28217
28238
|
requiresRegistration: z43.boolean(),
|
|
28218
28239
|
deliveryMode: z43.enum(["in_person", "online", "hybrid"]),
|
|
28219
28240
|
attendanceModes: z43.array(publicEventAttendanceModeAvailabilitySchema),
|
|
@@ -28517,12 +28538,41 @@ function isEventContentType(slug) {
|
|
|
28517
28538
|
return EVENT_CONTENT_TYPE_SLUGS.includes(slug);
|
|
28518
28539
|
}
|
|
28519
28540
|
|
|
28541
|
+
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
28542
|
+
function isRecord3(value) {
|
|
28543
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28544
|
+
}
|
|
28545
|
+
function isRuntimeEventDestination(value) {
|
|
28546
|
+
if (!isRecord3(value) || typeof value.kind !== "string") return false;
|
|
28547
|
+
if (value.kind === "native") {
|
|
28548
|
+
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
28549
|
+
}
|
|
28550
|
+
return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
|
|
28551
|
+
}
|
|
28552
|
+
function resolveRuntimeEventDestination(event) {
|
|
28553
|
+
if (isRuntimeEventDestination(event.destination)) {
|
|
28554
|
+
return event.destination;
|
|
28555
|
+
}
|
|
28556
|
+
return {
|
|
28557
|
+
kind: "native",
|
|
28558
|
+
mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
|
|
28559
|
+
path: typeof event.path === "string" ? event.path : ""
|
|
28560
|
+
};
|
|
28561
|
+
}
|
|
28562
|
+
|
|
28520
28563
|
// ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
|
|
28521
28564
|
var DEFAULT_EVENT_CURRENCY = "USD";
|
|
28522
28565
|
function resolveRuntimeEventPricing(event) {
|
|
28523
28566
|
if (isPublicEventPricing(event.pricing)) {
|
|
28524
28567
|
return event.pricing;
|
|
28525
28568
|
}
|
|
28569
|
+
const destination = resolveRuntimeEventDestination(event);
|
|
28570
|
+
if (destination.kind === "external") {
|
|
28571
|
+
return {
|
|
28572
|
+
kind: "external",
|
|
28573
|
+
display: { kind: "external", label: "External registration" }
|
|
28574
|
+
};
|
|
28575
|
+
}
|
|
28526
28576
|
const legacy = event;
|
|
28527
28577
|
const currency = readCurrency(legacy.currency);
|
|
28528
28578
|
if (event.requiresRegistration === false) {
|
|
@@ -28559,22 +28609,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
28559
28609
|
function readCurrency(value) {
|
|
28560
28610
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
28561
28611
|
}
|
|
28562
|
-
function
|
|
28612
|
+
function isRecord4(value) {
|
|
28563
28613
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28564
28614
|
}
|
|
28565
28615
|
function isPublicEventPricing(value) {
|
|
28566
|
-
if (!
|
|
28567
|
-
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
28616
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
28617
|
+
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
28568
28618
|
}
|
|
28569
28619
|
function isPublicEventTicketType(value) {
|
|
28570
|
-
return
|
|
28620
|
+
return isRecord4(value) && typeof value.id === "string";
|
|
28571
28621
|
}
|
|
28572
28622
|
function readTicketTypePriceDisplay(value, currency) {
|
|
28573
28623
|
const display = readLegacyPriceDisplay(value, currency);
|
|
28574
|
-
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
28624
|
+
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
28575
28625
|
}
|
|
28576
28626
|
function readLegacyPriceDisplay(value, currency) {
|
|
28577
|
-
if (!
|
|
28627
|
+
if (!isRecord4(value) || typeof value.kind !== "string") {
|
|
28578
28628
|
return { kind: "unavailable", currency };
|
|
28579
28629
|
}
|
|
28580
28630
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -28613,7 +28663,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
28613
28663
|
case "unavailable":
|
|
28614
28664
|
return { kind: "unavailable", currency: displayCurrency };
|
|
28615
28665
|
case "course":
|
|
28616
|
-
return
|
|
28666
|
+
return isRecord4(value.display) ? {
|
|
28617
28667
|
kind: "course",
|
|
28618
28668
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
28619
28669
|
} : {
|
|
@@ -28700,7 +28750,7 @@ function resolveEventRequiresPayment(input) {
|
|
|
28700
28750
|
if (!input.event) {
|
|
28701
28751
|
return false;
|
|
28702
28752
|
}
|
|
28703
|
-
return publicEventPricingType(resolveRuntimeEventPricing(input.event))
|
|
28753
|
+
return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
|
|
28704
28754
|
}
|
|
28705
28755
|
|
|
28706
28756
|
// ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
|
|
@@ -28897,15 +28947,16 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
28897
28947
|
})
|
|
28898
28948
|
});
|
|
28899
28949
|
function normalizeEventRegistrationEventInput(value) {
|
|
28900
|
-
if (!
|
|
28950
|
+
if (!isRecord5(value)) {
|
|
28901
28951
|
return value;
|
|
28902
28952
|
}
|
|
28903
28953
|
return {
|
|
28904
28954
|
...value,
|
|
28955
|
+
destination: resolveRuntimeEventDestination(value),
|
|
28905
28956
|
pricing: resolveRuntimeEventPricing(value)
|
|
28906
28957
|
};
|
|
28907
28958
|
}
|
|
28908
|
-
function
|
|
28959
|
+
function isRecord5(value) {
|
|
28909
28960
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28910
28961
|
}
|
|
28911
28962
|
var eventRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
@@ -31467,7 +31518,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
31467
31518
|
return keys.length >= 2 ? keys : [];
|
|
31468
31519
|
}
|
|
31469
31520
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
31470
|
-
if (!
|
|
31521
|
+
if (!isRecord6(value)) return null;
|
|
31471
31522
|
const groupOrderValue = value.groupOrder;
|
|
31472
31523
|
if (Array.isArray(groupOrderValue)) {
|
|
31473
31524
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -31480,7 +31531,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
31480
31531
|
return { ...value, groupOrder: [] };
|
|
31481
31532
|
}
|
|
31482
31533
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
31483
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
31534
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord6) : []
|
|
31484
31535
|
);
|
|
31485
31536
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
31486
31537
|
}
|
|
@@ -31494,7 +31545,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
31494
31545
|
}
|
|
31495
31546
|
return keys;
|
|
31496
31547
|
}
|
|
31497
|
-
function
|
|
31548
|
+
function isRecord6(value) {
|
|
31498
31549
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31499
31550
|
}
|
|
31500
31551
|
|
|
@@ -31861,7 +31912,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
31861
31912
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
31862
31913
|
}
|
|
31863
31914
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
31864
|
-
if (!
|
|
31915
|
+
if (!isRecord7(value)) return [];
|
|
31865
31916
|
const override = {};
|
|
31866
31917
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
31867
31918
|
override.sourceKey = value.sourceKey;
|
|
@@ -31893,12 +31944,12 @@ function isButtonVariant(value) {
|
|
|
31893
31944
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
31894
31945
|
}
|
|
31895
31946
|
function normalizeCardStylesContent(value) {
|
|
31896
|
-
return
|
|
31947
|
+
return isRecord7(value) || value === null ? value : void 0;
|
|
31897
31948
|
}
|
|
31898
31949
|
function normalizeSectionStylesContent(value) {
|
|
31899
|
-
return
|
|
31950
|
+
return isRecord7(value) || value === null ? value : void 0;
|
|
31900
31951
|
}
|
|
31901
|
-
function
|
|
31952
|
+
function isRecord7(value) {
|
|
31902
31953
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31903
31954
|
}
|
|
31904
31955
|
|
|
@@ -36991,11 +37042,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
36991
37042
|
}
|
|
36992
37043
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
36993
37044
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
36994
|
-
if (
|
|
37045
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
36995
37046
|
const routeEntry = routes[routeId];
|
|
36996
37047
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
36997
37048
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
36998
|
-
if (
|
|
37049
|
+
if (href === null) return null;
|
|
36999
37050
|
return {
|
|
37000
37051
|
routeId,
|
|
37001
37052
|
href,
|
|
@@ -37138,7 +37189,7 @@ var defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
|
37138
37189
|
// ../blocks/src/system/data/linkedContentEntries.ts
|
|
37139
37190
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
37140
37191
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
37141
|
-
if (!
|
|
37192
|
+
if (!isRecord8(payload)) return payload;
|
|
37142
37193
|
const response = payload;
|
|
37143
37194
|
if (!Array.isArray(response.entries)) return payload;
|
|
37144
37195
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -37146,12 +37197,12 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
37146
37197
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
37147
37198
|
}
|
|
37148
37199
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
37149
|
-
if (!
|
|
37200
|
+
if (!isRecord8(entry)) return entry;
|
|
37150
37201
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
37151
37202
|
if (!entryId) return entry;
|
|
37152
37203
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
37153
37204
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
37154
|
-
const content =
|
|
37205
|
+
const content = isRecord8(entry.content) ? entry.content : {};
|
|
37155
37206
|
const meta = {
|
|
37156
37207
|
kind: "linked-content-entry",
|
|
37157
37208
|
entryId,
|
|
@@ -37244,7 +37295,7 @@ function capitalize(value) {
|
|
|
37244
37295
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
37245
37296
|
}
|
|
37246
37297
|
function parsePublicContentTypeMeta(value) {
|
|
37247
|
-
if (!
|
|
37298
|
+
if (!isRecord8(value)) return null;
|
|
37248
37299
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
37249
37300
|
return {
|
|
37250
37301
|
key: value.key,
|
|
@@ -37254,7 +37305,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
37254
37305
|
};
|
|
37255
37306
|
}
|
|
37256
37307
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
37257
|
-
if (!
|
|
37308
|
+
if (!isRecord8(value) || typeof value.kind !== "string") return null;
|
|
37258
37309
|
switch (value.kind) {
|
|
37259
37310
|
case "generic":
|
|
37260
37311
|
return { kind: "generic" };
|
|
@@ -37268,7 +37319,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
37268
37319
|
}
|
|
37269
37320
|
}
|
|
37270
37321
|
function parsePublicContentTypeFieldMeta(value) {
|
|
37271
|
-
if (!
|
|
37322
|
+
if (!isRecord8(value)) return [];
|
|
37272
37323
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
37273
37324
|
return [{
|
|
37274
37325
|
id: value.id,
|
|
@@ -37282,7 +37333,7 @@ function parseStringArray(value) {
|
|
|
37282
37333
|
if (!Array.isArray(value)) return null;
|
|
37283
37334
|
return value.filter((item) => typeof item === "string");
|
|
37284
37335
|
}
|
|
37285
|
-
function
|
|
37336
|
+
function isRecord8(value) {
|
|
37286
37337
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37287
37338
|
}
|
|
37288
37339
|
|
|
@@ -39057,7 +39108,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
39057
39108
|
}
|
|
39058
39109
|
|
|
39059
39110
|
// ../api/src/utils/isRecord.ts
|
|
39060
|
-
function
|
|
39111
|
+
function isRecord9(value) {
|
|
39061
39112
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39062
39113
|
}
|
|
39063
39114
|
|
|
@@ -39364,7 +39415,7 @@ function sanitizeMarks(marks) {
|
|
|
39364
39415
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
39365
39416
|
return [{ type: mark.type }];
|
|
39366
39417
|
}
|
|
39367
|
-
if (mark.type === "link" &&
|
|
39418
|
+
if (mark.type === "link" && isRecord9(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
39368
39419
|
const attrs = { href: mark.attrs.href };
|
|
39369
39420
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
39370
39421
|
attrs.target = mark.attrs.target;
|
|
@@ -39379,10 +39430,10 @@ function sanitizeMarks(marks) {
|
|
|
39379
39430
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
39380
39431
|
}
|
|
39381
39432
|
function unwrapRichTextValue(value) {
|
|
39382
|
-
if (
|
|
39433
|
+
if (isRecord9(value) && isRecord9(value.doc)) {
|
|
39383
39434
|
return unwrapRichTextValue(value.doc);
|
|
39384
39435
|
}
|
|
39385
|
-
if (
|
|
39436
|
+
if (isRecord9(value) && value.type === "doc") {
|
|
39386
39437
|
return {
|
|
39387
39438
|
type: "doc",
|
|
39388
39439
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -39391,7 +39442,7 @@ function unwrapRichTextValue(value) {
|
|
|
39391
39442
|
return EMPTY_SITE_BANNER_BODY;
|
|
39392
39443
|
}
|
|
39393
39444
|
function isTipTapNodeLike(value) {
|
|
39394
|
-
return
|
|
39445
|
+
return isRecord9(value) && typeof value.type === "string";
|
|
39395
39446
|
}
|
|
39396
39447
|
function coerceTipTapNode(value) {
|
|
39397
39448
|
return {
|
|
@@ -39399,9 +39450,9 @@ function coerceTipTapNode(value) {
|
|
|
39399
39450
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
39400
39451
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
39401
39452
|
...Array.isArray(value.marks) ? {
|
|
39402
|
-
marks: value.marks.filter((mark) =>
|
|
39453
|
+
marks: value.marks.filter((mark) => isRecord9(mark) && typeof mark.type === "string").map((mark) => ({
|
|
39403
39454
|
type: mark.type,
|
|
39404
|
-
...
|
|
39455
|
+
...isRecord9(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
39405
39456
|
}))
|
|
39406
39457
|
} : {}
|
|
39407
39458
|
};
|
|
@@ -39571,7 +39622,7 @@ var ENTRY_REF_KEYS = [
|
|
|
39571
39622
|
"entryId",
|
|
39572
39623
|
"slug"
|
|
39573
39624
|
];
|
|
39574
|
-
function
|
|
39625
|
+
function isRecord10(value) {
|
|
39575
39626
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
39576
39627
|
}
|
|
39577
39628
|
function extractManualEntryRef(item) {
|
|
@@ -39579,7 +39630,7 @@ function extractManualEntryRef(item) {
|
|
|
39579
39630
|
const trimmed = item.trim();
|
|
39580
39631
|
return trimmed.length > 0 ? trimmed : null;
|
|
39581
39632
|
}
|
|
39582
|
-
if (!
|
|
39633
|
+
if (!isRecord10(item)) return null;
|
|
39583
39634
|
for (const key of ENTRY_REF_KEYS) {
|
|
39584
39635
|
const raw = item[key];
|
|
39585
39636
|
if (typeof raw === "string" && raw.trim().length > 0) {
|
package/dist/server/index.mjs
CHANGED
|
@@ -49,11 +49,11 @@ function extractRouteUpdatedAt(candidate) {
|
|
|
49
49
|
}
|
|
50
50
|
function resolveRouteTargetForStage(routeIdValue, routes, stageInput) {
|
|
51
51
|
const routeId = typeof routeIdValue === "string" ? routeIdValue : null;
|
|
52
|
-
if (
|
|
52
|
+
if (routeId === null || routeId.length === 0 || routes === void 0) return null;
|
|
53
53
|
const routeEntry = routes[routeId];
|
|
54
54
|
if (!isRouteVisibleInStage(routeEntry, stageInput)) return null;
|
|
55
55
|
const href = extractRouteHref(routeEntry, stageInput);
|
|
56
|
-
if (
|
|
56
|
+
if (href === null) return null;
|
|
57
57
|
return {
|
|
58
58
|
routeId,
|
|
59
59
|
href,
|