@riverbankcms/sdk 0.92.0 → 0.94.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-3CI5MKV3.mjs → PreviewEditorSidebar-D3PAF7NW.mjs} +3 -3
- package/dist/{PreviewEditorUI-DKEP636I.mjs → PreviewEditorUI-G5JVJEIJ.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-NHTLRNQD.mjs +8 -0
- package/dist/_dts/api/src/common/envelope.d.ts +10 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +14 -14
- package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +5 -15
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +46 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +43 -36
- package/dist/_dts/media-core/src/fileUploadFinalization.d.ts +29 -1
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/legacyMediaValue.d.ts +11 -0
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +2 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-UOMTCHZD.mjs → chunk-A63UXN3P.mjs} +21 -19
- package/dist/{chunk-U5YM4AWE.mjs → chunk-AJZGT6YG.mjs} +1 -1
- package/dist/{chunk-6D7PLF4M.mjs → chunk-AQ6RT6LZ.mjs} +2 -2
- package/dist/{chunk-ZA2S7H34.mjs → chunk-NT76QGIJ.mjs} +98 -1
- package/dist/{chunk-I6EOKV6B.mjs → chunk-PCNCETBI.mjs} +676 -386
- package/dist/{chunk-LERKJM3E.mjs → chunk-XIK2HYI3.mjs} +7 -7
- package/dist/cli/index.mjs +198 -87
- package/dist/client/{accordion-BUDH2G3S.mjs → accordion-RNQIPG55.mjs} +2 -2
- package/dist/client/{bookingForm-NQMCELVB.mjs → bookingForm-HYEEVRLP.mjs} +5 -5
- package/dist/client/{carousel-ONCEW6IJ.mjs → carousel-W7DQ3YPU.mjs} +3 -3
- package/dist/client/{cart-V2TCK2GI.mjs → cart-PXJ3SXXO.mjs} +6 -6
- package/dist/client/{checkout-ZI7SWNCS.mjs → checkout-X3JYSOXI.mjs} +6 -6
- package/dist/client/{chunk-R3CZQLXF.mjs → chunk-6SYGVVWA.mjs} +1 -1
- package/dist/client/{chunk-N2WJPTF7.mjs → chunk-DUOHLWLF.mjs} +3 -3
- package/dist/client/{chunk-KXYEKEV6.mjs → chunk-IXDSXF2D.mjs} +7 -7
- package/dist/client/{chunk-ZJDBOLX7.mjs → chunk-J6TMMMXW.mjs} +2 -2
- package/dist/client/{chunk-B5UC2D6X.mjs → chunk-JNE6UI6U.mjs} +1 -1
- package/dist/client/{chunk-QQNVQ62W.mjs → chunk-OLAOAZEO.mjs} +1 -1
- package/dist/client/{chunk-AUMRQ242.mjs → chunk-PICR3NTQ.mjs} +2 -2
- package/dist/client/{chunk-ERQDHUS2.mjs → chunk-Q47XGAGS.mjs} +1 -1
- package/dist/client/{chunk-HQWIJLYN.mjs → chunk-WERRJXNJ.mjs} +1 -1
- package/dist/client/{chunk-JXY6NHG6.mjs → chunk-YYVGSYBO.mjs} +5 -5
- package/dist/client/client.mjs +127 -17
- package/dist/client/{courseRegistration-JPWAQ6KM.mjs → courseRegistration-QZ67PVHO.mjs} +5 -5
- package/dist/client/{eventCalendar-QDOCHBBV.mjs → eventCalendar-V3BDHQNT.mjs} +8 -8
- package/dist/client/{eventCombined-ZS2CXSIE.mjs → eventCombined-XYFRN2RG.mjs} +8 -8
- package/dist/client/{eventDetails-5LOBMPLN.mjs → eventDetails-TFE5TWKV.mjs} +8 -8
- package/dist/client/{eventListing-SBGY4I3L.mjs → eventListing-IQ6AGWZ6.mjs} +8 -8
- package/dist/client/{eventRegistration-XGPIU3Z2.mjs → eventRegistration-WGJVFKQJ.mjs} +8 -8
- package/dist/client/{form-R7D4LZWW.mjs → form-6UZY6RUA.mjs} +2 -2
- package/dist/client/{headerSection-RRLYUCGC.mjs → headerSection-RSFXY6V3.mjs} +3 -3
- package/dist/client/hooks.mjs +35 -3
- package/dist/client/{locationMap-35ZJMRBZ.mjs → locationMap-24FH67I4.mjs} +3 -3
- package/dist/client/{newsletterForm-MJ2VCFUT.mjs → newsletterForm-QVL3MLTN.mjs} +2 -2
- package/dist/client/{productDetail-2O7YQNBX.mjs → productDetail-ZDYN3G4T.mjs} +6 -6
- package/dist/client/{productList-FDP5BH7W.mjs → productList-4BMJLQHZ.mjs} +6 -6
- package/dist/client/rendering/client.mjs +8 -0
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +69 -2
- package/dist/client/{shop-BGYJ3LDT.mjs → shop-U5C634FF.mjs} +6 -6
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-B3TFXRXZ.mjs → sdk-runtime-VGV46WVB.mjs} +6 -6
- package/dist/server/components.mjs +121 -61
- package/dist/server/config-validation.mjs +35 -3
- package/dist/server/config.mjs +35 -3
- package/dist/server/data.mjs +35 -3
- package/dist/server/index.mjs +104 -29
- package/dist/server/next.mjs +183 -80
- package/dist/server/page-converter.mjs +3 -3
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +121 -61
- package/dist/server/rendering.mjs +121 -61
- package/dist/server/routing.mjs +102 -62
- package/dist/server/server.mjs +167 -92
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-BRGRDQFH.mjs +0 -8
- /package/dist/client/{chunk-GH6IIOOE.mjs → chunk-PCHACQEB.mjs} +0 -0
package/dist/server/server.mjs
CHANGED
|
@@ -6545,6 +6545,104 @@ function resolveApiBaseUrl() {
|
|
|
6545
6545
|
return getCmsApiUrl();
|
|
6546
6546
|
}
|
|
6547
6547
|
|
|
6548
|
+
// ../api/src/common/envelope.ts
|
|
6549
|
+
var API_ERROR_CODES = [
|
|
6550
|
+
"auth:unauthenticated",
|
|
6551
|
+
"auth:token_expired",
|
|
6552
|
+
"auth:token_invalid",
|
|
6553
|
+
"auth:forbidden",
|
|
6554
|
+
"auth:mfa_required",
|
|
6555
|
+
"auth:sudo_required",
|
|
6556
|
+
"auth:insufficient_permissions",
|
|
6557
|
+
"auth:impersonation_restricted",
|
|
6558
|
+
"validation:invalid_input",
|
|
6559
|
+
"validation:missing_field",
|
|
6560
|
+
"validation:invalid_format",
|
|
6561
|
+
"validation:payload_too_large",
|
|
6562
|
+
"resource:not_found",
|
|
6563
|
+
"resource:already_exists",
|
|
6564
|
+
"resource:conflict",
|
|
6565
|
+
"resource:gone",
|
|
6566
|
+
"rate_limit:exceeded",
|
|
6567
|
+
"billing:payment_required",
|
|
6568
|
+
"billing:plan_limit_exceeded",
|
|
6569
|
+
"billing:pass_redemption_failed",
|
|
6570
|
+
"server:internal_error",
|
|
6571
|
+
"server:unavailable",
|
|
6572
|
+
"external:service_error",
|
|
6573
|
+
"external:registrar_orphaned_contact_profile",
|
|
6574
|
+
"network:connection_error",
|
|
6575
|
+
"network:timeout",
|
|
6576
|
+
"network:dns_error"
|
|
6577
|
+
];
|
|
6578
|
+
var API_ERROR_CODE_SET = new Set(API_ERROR_CODES);
|
|
6579
|
+
function isApiErrorCode(value) {
|
|
6580
|
+
return typeof value === "string" && API_ERROR_CODE_SET.has(value);
|
|
6581
|
+
}
|
|
6582
|
+
function isApiError(result) {
|
|
6583
|
+
return result.success === false;
|
|
6584
|
+
}
|
|
6585
|
+
function isApiSuccess(result) {
|
|
6586
|
+
return result.success === true;
|
|
6587
|
+
}
|
|
6588
|
+
function isRecord(value) {
|
|
6589
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6590
|
+
}
|
|
6591
|
+
function isFieldError(value) {
|
|
6592
|
+
return isRecord(value) && typeof value.field === "string" && typeof value.code === "string" && typeof value.message === "string";
|
|
6593
|
+
}
|
|
6594
|
+
function fieldErrorsFromUnknown(value) {
|
|
6595
|
+
if (!Array.isArray(value)) return null;
|
|
6596
|
+
return value.every(isFieldError) ? value : null;
|
|
6597
|
+
}
|
|
6598
|
+
function extractEnvelopeErrorObject(body) {
|
|
6599
|
+
if (!isRecord(body)) return null;
|
|
6600
|
+
const error = body.error;
|
|
6601
|
+
if (!isRecord(error)) return null;
|
|
6602
|
+
if ("success" in body && body.success !== false) {
|
|
6603
|
+
return null;
|
|
6604
|
+
}
|
|
6605
|
+
return error;
|
|
6606
|
+
}
|
|
6607
|
+
function extractApiEnvelopeErrorDetails(body) {
|
|
6608
|
+
const error = extractEnvelopeErrorObject(body);
|
|
6609
|
+
if (!error) {
|
|
6610
|
+
return {
|
|
6611
|
+
rawCode: null,
|
|
6612
|
+
code: null,
|
|
6613
|
+
message: null,
|
|
6614
|
+
status: null,
|
|
6615
|
+
fieldErrors: null
|
|
6616
|
+
};
|
|
6617
|
+
}
|
|
6618
|
+
const rawCode = typeof error.code === "string" ? error.code : null;
|
|
6619
|
+
const message = typeof error.message === "string" && error.message.trim().length > 0 ? error.message : null;
|
|
6620
|
+
return {
|
|
6621
|
+
rawCode,
|
|
6622
|
+
code: isApiErrorCode(rawCode) ? rawCode : null,
|
|
6623
|
+
message,
|
|
6624
|
+
status: typeof error.status === "number" && Number.isFinite(error.status) ? error.status : null,
|
|
6625
|
+
fieldErrors: fieldErrorsFromUnknown(error.fieldErrors)
|
|
6626
|
+
};
|
|
6627
|
+
}
|
|
6628
|
+
var ApiEnvelopeError = class extends Error {
|
|
6629
|
+
constructor(error) {
|
|
6630
|
+
super(error.message);
|
|
6631
|
+
this.name = "ApiEnvelopeError";
|
|
6632
|
+
this.code = error.code;
|
|
6633
|
+
this.requestId = error.requestId;
|
|
6634
|
+
this.timestamp = error.timestamp;
|
|
6635
|
+
this.status = error.status;
|
|
6636
|
+
this.fieldErrors = error.fieldErrors;
|
|
6637
|
+
}
|
|
6638
|
+
};
|
|
6639
|
+
function unwrapResponse(result) {
|
|
6640
|
+
if (isApiSuccess(result)) {
|
|
6641
|
+
return result.data;
|
|
6642
|
+
}
|
|
6643
|
+
throw new ApiEnvelopeError(result.error);
|
|
6644
|
+
}
|
|
6645
|
+
|
|
6548
6646
|
// ../api/src/request.ts
|
|
6549
6647
|
var revalidateTag = null;
|
|
6550
6648
|
var revalidateTagResolved = false;
|
|
@@ -6923,6 +7021,7 @@ function createParsedClient(rawClient) {
|
|
|
6923
7021
|
const auth = config.auth ?? "user";
|
|
6924
7022
|
if (!response.ok) {
|
|
6925
7023
|
const body = await parseErrorBody(response);
|
|
7024
|
+
const envelopeError = extractApiEnvelopeErrorDetails(body);
|
|
6926
7025
|
const requestId = response.headers.get("x-request-id") ?? void 0;
|
|
6927
7026
|
const retryAfterMs = parseRetryAfterHeader(response.headers.get("retry-after"));
|
|
6928
7027
|
throw new ApiRequestError(
|
|
@@ -6934,6 +7033,7 @@ function createParsedClient(rawClient) {
|
|
|
6934
7033
|
auth,
|
|
6935
7034
|
requestId,
|
|
6936
7035
|
body,
|
|
7036
|
+
errorCode: envelopeError.code ?? void 0,
|
|
6937
7037
|
retryAfterMs
|
|
6938
7038
|
}
|
|
6939
7039
|
);
|
|
@@ -6954,31 +7054,6 @@ function createBearerAPIClient(token, baseUrl) {
|
|
|
6954
7054
|
return createCMSClient(authHeaders, baseUrl);
|
|
6955
7055
|
}
|
|
6956
7056
|
|
|
6957
|
-
// ../api/src/common/envelope.ts
|
|
6958
|
-
function isApiError(result) {
|
|
6959
|
-
return result.success === false;
|
|
6960
|
-
}
|
|
6961
|
-
function isApiSuccess(result) {
|
|
6962
|
-
return result.success === true;
|
|
6963
|
-
}
|
|
6964
|
-
var ApiEnvelopeError = class extends Error {
|
|
6965
|
-
constructor(error) {
|
|
6966
|
-
super(error.message);
|
|
6967
|
-
this.name = "ApiEnvelopeError";
|
|
6968
|
-
this.code = error.code;
|
|
6969
|
-
this.requestId = error.requestId;
|
|
6970
|
-
this.timestamp = error.timestamp;
|
|
6971
|
-
this.status = error.status;
|
|
6972
|
-
this.fieldErrors = error.fieldErrors;
|
|
6973
|
-
}
|
|
6974
|
-
};
|
|
6975
|
-
function unwrapResponse(result) {
|
|
6976
|
-
if (isApiSuccess(result)) {
|
|
6977
|
-
return result.data;
|
|
6978
|
-
}
|
|
6979
|
-
throw new ApiEnvelopeError(result.error);
|
|
6980
|
-
}
|
|
6981
|
-
|
|
6982
7057
|
// src/client/cache.ts
|
|
6983
7058
|
var SimpleCache = class {
|
|
6984
7059
|
constructor(options = {}) {
|
|
@@ -7095,7 +7170,7 @@ var SimpleCache = class {
|
|
|
7095
7170
|
};
|
|
7096
7171
|
|
|
7097
7172
|
// src/version.ts
|
|
7098
|
-
var SDK_VERSION = "0.
|
|
7173
|
+
var SDK_VERSION = "0.94.0";
|
|
7099
7174
|
|
|
7100
7175
|
// src/client/error.ts
|
|
7101
7176
|
var RiverbankApiError = class _RiverbankApiError extends Error {
|
|
@@ -9600,9 +9675,6 @@ function formatKeyAsLabel(key) {
|
|
|
9600
9675
|
return key.replace(/([A-Z])/g, " $1").replace(/[-_]/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
9601
9676
|
}
|
|
9602
9677
|
|
|
9603
|
-
// ../blocks/src/system/manifest/schema.ts
|
|
9604
|
-
import { z as z4 } from "zod";
|
|
9605
|
-
|
|
9606
9678
|
// ../media-core/src/transformRect.ts
|
|
9607
9679
|
function isValidTransformRectStructure(rect) {
|
|
9608
9680
|
if (!Array.isArray(rect) || rect.length !== 4) return false;
|
|
@@ -9696,6 +9768,9 @@ function rotateNormalizedPoint(point, rotation) {
|
|
|
9696
9768
|
}
|
|
9697
9769
|
}
|
|
9698
9770
|
|
|
9771
|
+
// ../blocks/src/system/manifest/schema.ts
|
|
9772
|
+
import { z as z4 } from "zod";
|
|
9773
|
+
|
|
9699
9774
|
// ../blocks/src/system/node/schema.ts
|
|
9700
9775
|
import { z as z3 } from "zod";
|
|
9701
9776
|
var transformStepSchema = z3.object({
|
|
@@ -28135,7 +28210,7 @@ var mediaTransforms = [mediaFromUrl];
|
|
|
28135
28210
|
import { z as z37 } from "zod";
|
|
28136
28211
|
|
|
28137
28212
|
// ../blocks/src/lib/typeGuards.ts
|
|
28138
|
-
function
|
|
28213
|
+
function isRecord3(value) {
|
|
28139
28214
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28140
28215
|
}
|
|
28141
28216
|
function isObjectRecord2(value) {
|
|
@@ -28150,16 +28225,16 @@ var interpolateRichTextTokensOptionsSchema = z37.object({
|
|
|
28150
28225
|
var richTextTokenPattern = /\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g;
|
|
28151
28226
|
function getSiteName(context) {
|
|
28152
28227
|
const viewModel = context.viewModel;
|
|
28153
|
-
if (!
|
|
28228
|
+
if (!isRecord3(viewModel)) return null;
|
|
28154
28229
|
const site = viewModel.site;
|
|
28155
|
-
if (
|
|
28230
|
+
if (isRecord3(site) && typeof site.title === "string") {
|
|
28156
28231
|
const title = site.title.trim();
|
|
28157
28232
|
return title.length > 0 ? title : null;
|
|
28158
28233
|
}
|
|
28159
28234
|
const root = viewModel.$root;
|
|
28160
|
-
if (
|
|
28235
|
+
if (isRecord3(root)) {
|
|
28161
28236
|
const rootSite = root.site;
|
|
28162
|
-
if (
|
|
28237
|
+
if (isRecord3(rootSite) && typeof rootSite.title === "string") {
|
|
28163
28238
|
const title = rootSite.title.trim();
|
|
28164
28239
|
if (title.length > 0) return title;
|
|
28165
28240
|
}
|
|
@@ -28181,7 +28256,7 @@ function replaceTokenText(input, allowedTokens, tokenValues) {
|
|
|
28181
28256
|
});
|
|
28182
28257
|
}
|
|
28183
28258
|
function visitRichTextNode(node, allowedTokens, tokenValues) {
|
|
28184
|
-
if (!
|
|
28259
|
+
if (!isRecord3(node)) return node;
|
|
28185
28260
|
let changed = false;
|
|
28186
28261
|
const nextNode = { ...node };
|
|
28187
28262
|
if (nextNode.type === "text" && typeof nextNode.text === "string") {
|
|
@@ -28207,13 +28282,13 @@ function visitRichTextNode(node, allowedTokens, tokenValues) {
|
|
|
28207
28282
|
return changed ? nextNode : node;
|
|
28208
28283
|
}
|
|
28209
28284
|
function interpolateRichTextTokens(value, options, context) {
|
|
28210
|
-
if (!
|
|
28285
|
+
if (!isRecord3(value)) return value;
|
|
28211
28286
|
const allowedTokens = new Set(options.tokens);
|
|
28212
28287
|
const tokenValues = {
|
|
28213
28288
|
year: String((/* @__PURE__ */ new Date()).getFullYear()),
|
|
28214
28289
|
site_name: getSiteName(context)
|
|
28215
28290
|
};
|
|
28216
|
-
if (
|
|
28291
|
+
if (isRecord3(value.doc)) {
|
|
28217
28292
|
const nextDoc = visitRichTextNode(value.doc, allowedTokens, tokenValues);
|
|
28218
28293
|
if (nextDoc === value.doc) return value;
|
|
28219
28294
|
return { ...value, doc: nextDoc };
|
|
@@ -30720,10 +30795,10 @@ var RichTextDocSchema = z40.object({
|
|
|
30720
30795
|
content: z40.array(TipTapNodeSchema)
|
|
30721
30796
|
});
|
|
30722
30797
|
function unwrapRichTextRoot(value) {
|
|
30723
|
-
if (!
|
|
30798
|
+
if (!isRecord3(value)) return value;
|
|
30724
30799
|
if (!("doc" in value)) return value;
|
|
30725
30800
|
const inner = value.doc;
|
|
30726
|
-
if (
|
|
30801
|
+
if (isRecord3(inner) && inner.type === "doc") return inner;
|
|
30727
30802
|
return value;
|
|
30728
30803
|
}
|
|
30729
30804
|
|
|
@@ -31340,11 +31415,11 @@ function isEventContentType(slug) {
|
|
|
31340
31415
|
}
|
|
31341
31416
|
|
|
31342
31417
|
// ../blocks/src/system/runtime/nodes/events/shared/destination.ts
|
|
31343
|
-
function
|
|
31418
|
+
function isRecord4(value) {
|
|
31344
31419
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31345
31420
|
}
|
|
31346
31421
|
function isRuntimeEventDestination(value) {
|
|
31347
|
-
if (!
|
|
31422
|
+
if (!isRecord4(value) || typeof value.kind !== "string") return false;
|
|
31348
31423
|
if (value.kind === "native") {
|
|
31349
31424
|
return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
|
|
31350
31425
|
}
|
|
@@ -31410,22 +31485,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
31410
31485
|
function readCurrency(value) {
|
|
31411
31486
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
31412
31487
|
}
|
|
31413
|
-
function
|
|
31488
|
+
function isRecord5(value) {
|
|
31414
31489
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31415
31490
|
}
|
|
31416
31491
|
function isPublicEventPricing(value) {
|
|
31417
|
-
if (!
|
|
31492
|
+
if (!isRecord5(value) || typeof value.kind !== "string") return false;
|
|
31418
31493
|
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "sliding_scale" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
|
|
31419
31494
|
}
|
|
31420
31495
|
function isPublicEventTicketType(value) {
|
|
31421
|
-
return
|
|
31496
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
31422
31497
|
}
|
|
31423
31498
|
function readTicketTypePriceDisplay(value, currency) {
|
|
31424
31499
|
const display = readLegacyPriceDisplay(value, currency);
|
|
31425
31500
|
return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
|
|
31426
31501
|
}
|
|
31427
31502
|
function readLegacyPriceDisplay(value, currency) {
|
|
31428
|
-
if (!
|
|
31503
|
+
if (!isRecord5(value) || typeof value.kind !== "string") {
|
|
31429
31504
|
return { kind: "unavailable", currency };
|
|
31430
31505
|
}
|
|
31431
31506
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -31464,7 +31539,7 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
31464
31539
|
case "unavailable":
|
|
31465
31540
|
return { kind: "unavailable", currency: displayCurrency };
|
|
31466
31541
|
case "course":
|
|
31467
|
-
return
|
|
31542
|
+
return isRecord5(value.display) ? {
|
|
31468
31543
|
kind: "course",
|
|
31469
31544
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
31470
31545
|
} : {
|
|
@@ -31748,7 +31823,7 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
31748
31823
|
})
|
|
31749
31824
|
});
|
|
31750
31825
|
function normalizeEventRegistrationEventInput(value) {
|
|
31751
|
-
if (!
|
|
31826
|
+
if (!isRecord6(value)) {
|
|
31752
31827
|
return value;
|
|
31753
31828
|
}
|
|
31754
31829
|
return {
|
|
@@ -31757,7 +31832,7 @@ function normalizeEventRegistrationEventInput(value) {
|
|
|
31757
31832
|
pricing: resolveRuntimeEventPricing(value)
|
|
31758
31833
|
};
|
|
31759
31834
|
}
|
|
31760
|
-
function
|
|
31835
|
+
function isRecord6(value) {
|
|
31761
31836
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31762
31837
|
}
|
|
31763
31838
|
var eventRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
@@ -34319,7 +34394,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
|
|
|
34319
34394
|
return keys.length >= 2 ? keys : [];
|
|
34320
34395
|
}
|
|
34321
34396
|
function normalizeOfferingsPreviewContentForWrite(value) {
|
|
34322
|
-
if (!
|
|
34397
|
+
if (!isRecord7(value)) return null;
|
|
34323
34398
|
const groupOrderValue = value.groupOrder;
|
|
34324
34399
|
if (Array.isArray(groupOrderValue)) {
|
|
34325
34400
|
const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
|
|
@@ -34332,7 +34407,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
|
|
|
34332
34407
|
return { ...value, groupOrder: [] };
|
|
34333
34408
|
}
|
|
34334
34409
|
const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
|
|
34335
|
-
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(
|
|
34410
|
+
Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord7) : []
|
|
34336
34411
|
);
|
|
34337
34412
|
return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
|
|
34338
34413
|
}
|
|
@@ -34346,7 +34421,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
|
|
|
34346
34421
|
}
|
|
34347
34422
|
return keys;
|
|
34348
34423
|
}
|
|
34349
|
-
function
|
|
34424
|
+
function isRecord7(value) {
|
|
34350
34425
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
34351
34426
|
}
|
|
34352
34427
|
|
|
@@ -34713,7 +34788,7 @@ function isOfferingsPreviewItemLimit(value) {
|
|
|
34713
34788
|
return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
|
|
34714
34789
|
}
|
|
34715
34790
|
function normalizeOfferingsPreviewGroupOverride(value) {
|
|
34716
|
-
if (!
|
|
34791
|
+
if (!isRecord8(value)) return [];
|
|
34717
34792
|
const override = {};
|
|
34718
34793
|
if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
|
|
34719
34794
|
override.sourceKey = value.sourceKey;
|
|
@@ -34745,12 +34820,12 @@ function isButtonVariant(value) {
|
|
|
34745
34820
|
return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
|
|
34746
34821
|
}
|
|
34747
34822
|
function normalizeCardStylesContent(value) {
|
|
34748
|
-
return
|
|
34823
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
34749
34824
|
}
|
|
34750
34825
|
function normalizeSectionStylesContent(value) {
|
|
34751
|
-
return
|
|
34826
|
+
return isRecord8(value) || value === null ? value : void 0;
|
|
34752
34827
|
}
|
|
34753
|
-
function
|
|
34828
|
+
function isRecord8(value) {
|
|
34754
34829
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
34755
34830
|
}
|
|
34756
34831
|
|
|
@@ -37830,7 +37905,7 @@ function deriveNewsletterSignupRuntimeSource(values) {
|
|
|
37830
37905
|
};
|
|
37831
37906
|
}
|
|
37832
37907
|
function sanitizeNewsletterSignupPublicContent(content) {
|
|
37833
|
-
if (!
|
|
37908
|
+
if (!isRecord9(content)) return content;
|
|
37834
37909
|
const provider = parseNewsletterSignupDestinationProvider(content.destinationProvider) ?? getProviderFromExplicitDestination(content.destination);
|
|
37835
37910
|
const {
|
|
37836
37911
|
destination: _destination,
|
|
@@ -37849,7 +37924,7 @@ function sanitizeNewsletterSignupPublicContent(content) {
|
|
|
37849
37924
|
return mutablePublicContent;
|
|
37850
37925
|
}
|
|
37851
37926
|
function getProviderFromExplicitDestination(destination) {
|
|
37852
|
-
if (!
|
|
37927
|
+
if (!isRecord9(destination) || typeof destination.tag !== "string") return null;
|
|
37853
37928
|
if (destination.tag === "riverbank_list") return "riverbank";
|
|
37854
37929
|
if (destination.tag === "mailchimp_audience") return "mailchimp";
|
|
37855
37930
|
return null;
|
|
@@ -37861,7 +37936,7 @@ function parseTrimmedString(value) {
|
|
|
37861
37936
|
const trimmed = value.trim();
|
|
37862
37937
|
return trimmed.length > 0 ? trimmed : null;
|
|
37863
37938
|
}
|
|
37864
|
-
function
|
|
37939
|
+
function isRecord9(value) {
|
|
37865
37940
|
return typeof value === "object" && value !== null;
|
|
37866
37941
|
}
|
|
37867
37942
|
|
|
@@ -40018,7 +40093,7 @@ var defaultTransforms = createTransformRegistry(builtinTransformDefinitions);
|
|
|
40018
40093
|
// ../blocks/src/system/data/linkedContentEntries.ts
|
|
40019
40094
|
var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
|
|
40020
40095
|
function coerceLinkedContentEntriesPayload(payload) {
|
|
40021
|
-
if (!
|
|
40096
|
+
if (!isRecord10(payload)) return payload;
|
|
40022
40097
|
const response = payload;
|
|
40023
40098
|
if (!Array.isArray(response.entries)) return payload;
|
|
40024
40099
|
const contentType = parsePublicContentTypeMeta(response.contentType);
|
|
@@ -40026,12 +40101,12 @@ function coerceLinkedContentEntriesPayload(payload) {
|
|
|
40026
40101
|
return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
|
|
40027
40102
|
}
|
|
40028
40103
|
function enrichLinkedContentEntry(entry, contentType) {
|
|
40029
|
-
if (!
|
|
40104
|
+
if (!isRecord10(entry)) return entry;
|
|
40030
40105
|
const entryId = typeof entry.id === "string" ? entry.id : null;
|
|
40031
40106
|
if (!entryId) return entry;
|
|
40032
40107
|
const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
|
|
40033
40108
|
const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
|
|
40034
|
-
const content =
|
|
40109
|
+
const content = isRecord10(entry.content) ? entry.content : {};
|
|
40035
40110
|
const meta = {
|
|
40036
40111
|
kind: "linked-content-entry",
|
|
40037
40112
|
entryId,
|
|
@@ -40124,7 +40199,7 @@ function capitalize(value) {
|
|
|
40124
40199
|
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
40125
40200
|
}
|
|
40126
40201
|
function parsePublicContentTypeMeta(value) {
|
|
40127
|
-
if (!
|
|
40202
|
+
if (!isRecord10(value)) return null;
|
|
40128
40203
|
if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
|
|
40129
40204
|
return {
|
|
40130
40205
|
key: value.key,
|
|
@@ -40134,7 +40209,7 @@ function parsePublicContentTypeMeta(value) {
|
|
|
40134
40209
|
};
|
|
40135
40210
|
}
|
|
40136
40211
|
function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
40137
|
-
if (!
|
|
40212
|
+
if (!isRecord10(value) || typeof value.kind !== "string") return null;
|
|
40138
40213
|
switch (value.kind) {
|
|
40139
40214
|
case "generic":
|
|
40140
40215
|
return { kind: "generic" };
|
|
@@ -40148,7 +40223,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
|
|
|
40148
40223
|
}
|
|
40149
40224
|
}
|
|
40150
40225
|
function parsePublicContentTypeFieldMeta(value) {
|
|
40151
|
-
if (!
|
|
40226
|
+
if (!isRecord10(value)) return [];
|
|
40152
40227
|
if (typeof value.id !== "string" || typeof value.type !== "string") return [];
|
|
40153
40228
|
return [{
|
|
40154
40229
|
id: value.id,
|
|
@@ -40162,7 +40237,7 @@ function parseStringArray(value) {
|
|
|
40162
40237
|
if (!Array.isArray(value)) return null;
|
|
40163
40238
|
return value.filter((item) => typeof item === "string");
|
|
40164
40239
|
}
|
|
40165
|
-
function
|
|
40240
|
+
function isRecord10(value) {
|
|
40166
40241
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
40167
40242
|
}
|
|
40168
40243
|
|
|
@@ -41933,7 +42008,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
|
|
|
41933
42008
|
}
|
|
41934
42009
|
|
|
41935
42010
|
// ../api/src/utils/isRecord.ts
|
|
41936
|
-
function
|
|
42011
|
+
function isRecord11(value) {
|
|
41937
42012
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41938
42013
|
}
|
|
41939
42014
|
|
|
@@ -42240,7 +42315,7 @@ function sanitizeMarks(marks) {
|
|
|
42240
42315
|
if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
|
|
42241
42316
|
return [{ type: mark.type }];
|
|
42242
42317
|
}
|
|
42243
|
-
if (mark.type === "link" &&
|
|
42318
|
+
if (mark.type === "link" && isRecord11(mark.attrs) && typeof mark.attrs.href === "string") {
|
|
42244
42319
|
const attrs = { href: mark.attrs.href };
|
|
42245
42320
|
if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
|
|
42246
42321
|
attrs.target = mark.attrs.target;
|
|
@@ -42255,10 +42330,10 @@ function sanitizeMarks(marks) {
|
|
|
42255
42330
|
return sanitized.length > 0 ? sanitized : void 0;
|
|
42256
42331
|
}
|
|
42257
42332
|
function unwrapRichTextValue(value) {
|
|
42258
|
-
if (
|
|
42333
|
+
if (isRecord11(value) && isRecord11(value.doc)) {
|
|
42259
42334
|
return unwrapRichTextValue(value.doc);
|
|
42260
42335
|
}
|
|
42261
|
-
if (
|
|
42336
|
+
if (isRecord11(value) && value.type === "doc") {
|
|
42262
42337
|
return {
|
|
42263
42338
|
type: "doc",
|
|
42264
42339
|
content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
|
|
@@ -42267,7 +42342,7 @@ function unwrapRichTextValue(value) {
|
|
|
42267
42342
|
return EMPTY_SITE_BANNER_BODY;
|
|
42268
42343
|
}
|
|
42269
42344
|
function isTipTapNodeLike(value) {
|
|
42270
|
-
return
|
|
42345
|
+
return isRecord11(value) && typeof value.type === "string";
|
|
42271
42346
|
}
|
|
42272
42347
|
function coerceTipTapNode(value) {
|
|
42273
42348
|
return {
|
|
@@ -42275,9 +42350,9 @@ function coerceTipTapNode(value) {
|
|
|
42275
42350
|
...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
|
|
42276
42351
|
...typeof value.text === "string" ? { text: value.text } : {},
|
|
42277
42352
|
...Array.isArray(value.marks) ? {
|
|
42278
|
-
marks: value.marks.filter((mark) =>
|
|
42353
|
+
marks: value.marks.filter((mark) => isRecord11(mark) && typeof mark.type === "string").map((mark) => ({
|
|
42279
42354
|
type: mark.type,
|
|
42280
|
-
...
|
|
42355
|
+
...isRecord11(mark.attrs) ? { attrs: mark.attrs } : {}
|
|
42281
42356
|
}))
|
|
42282
42357
|
} : {}
|
|
42283
42358
|
};
|
|
@@ -42412,7 +42487,7 @@ var ENTRY_REF_KEYS = [
|
|
|
42412
42487
|
"entryId",
|
|
42413
42488
|
"slug"
|
|
42414
42489
|
];
|
|
42415
|
-
function
|
|
42490
|
+
function isRecord12(value) {
|
|
42416
42491
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
42417
42492
|
}
|
|
42418
42493
|
function extractManualEntryRef(item) {
|
|
@@ -42420,7 +42495,7 @@ function extractManualEntryRef(item) {
|
|
|
42420
42495
|
const trimmed = item.trim();
|
|
42421
42496
|
return trimmed.length > 0 ? trimmed : null;
|
|
42422
42497
|
}
|
|
42423
|
-
if (!
|
|
42498
|
+
if (!isRecord12(item)) return null;
|
|
42424
42499
|
for (const key of ENTRY_REF_KEYS) {
|
|
42425
42500
|
const raw = item[key];
|
|
42426
42501
|
if (typeof raw === "string" && raw.trim().length > 0) {
|
|
@@ -42777,7 +42852,7 @@ function collectMediaAssetSidecar(mediaAssets) {
|
|
|
42777
42852
|
return Array.isArray(mediaAssets) && mediaAssets.length > 0 ? mediaAssets : void 0;
|
|
42778
42853
|
}
|
|
42779
42854
|
function convertPageResponseBlock(block) {
|
|
42780
|
-
if (!
|
|
42855
|
+
if (!isRecord13(block)) {
|
|
42781
42856
|
throw new Error("Invalid block format in page API response");
|
|
42782
42857
|
}
|
|
42783
42858
|
if (typeof block.id !== "string" && block.id !== null) {
|
|
@@ -42808,20 +42883,20 @@ function buildPageOutline(input) {
|
|
|
42808
42883
|
blocks: input.blocks.map(convertPageResponseBlock)
|
|
42809
42884
|
};
|
|
42810
42885
|
}
|
|
42811
|
-
function
|
|
42886
|
+
function isRecord13(value) {
|
|
42812
42887
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
42813
42888
|
}
|
|
42814
42889
|
function readContentRecord(value) {
|
|
42815
|
-
return
|
|
42890
|
+
return isRecord13(value) ? value : void 0;
|
|
42816
42891
|
}
|
|
42817
42892
|
function readNestedContentRecord(value) {
|
|
42818
|
-
if (!
|
|
42893
|
+
if (!isRecord13(value)) return null;
|
|
42819
42894
|
return readContentRecord(value.data) ?? null;
|
|
42820
42895
|
}
|
|
42821
42896
|
function sanitizeSdkRuntimeBlockContent(blockKind, content) {
|
|
42822
42897
|
if (blockKind !== "block.newsletter-signup") return content;
|
|
42823
42898
|
const sanitized = sanitizeNewsletterSignupPublicContent(content);
|
|
42824
|
-
return
|
|
42899
|
+
return isRecord13(sanitized) ? sanitized : {};
|
|
42825
42900
|
}
|
|
42826
42901
|
function sanitizeNullableSdkRuntimeBlockContent(blockKind, content) {
|
|
42827
42902
|
return content ? sanitizeSdkRuntimeBlockContent(blockKind, content) : null;
|
|
@@ -42914,7 +42989,7 @@ function applyBindings(bindings, context) {
|
|
|
42914
42989
|
}
|
|
42915
42990
|
continue;
|
|
42916
42991
|
}
|
|
42917
|
-
if (
|
|
42992
|
+
if (isRecord3(bindingSpec)) {
|
|
42918
42993
|
const nested = applyBindings(bindingSpec, context);
|
|
42919
42994
|
if (Object.keys(nested).length > 0) {
|
|
42920
42995
|
setBindingValue(result, key, nested);
|
|
@@ -42947,7 +43022,7 @@ function setBindingValue(target, path, value) {
|
|
|
42947
43022
|
current[Number(segment)] = value;
|
|
42948
43023
|
return;
|
|
42949
43024
|
}
|
|
42950
|
-
if (
|
|
43025
|
+
if (isRecord3(current)) {
|
|
42951
43026
|
current[segment] = value;
|
|
42952
43027
|
}
|
|
42953
43028
|
return;
|
|
@@ -42959,17 +43034,17 @@ function setBindingValue(target, path, value) {
|
|
|
42959
43034
|
if (nextWantsArray) {
|
|
42960
43035
|
if (!Array.isArray(existing)) current[index] = [];
|
|
42961
43036
|
} else {
|
|
42962
|
-
if (!
|
|
43037
|
+
if (!isRecord3(existing)) current[index] = {};
|
|
42963
43038
|
}
|
|
42964
43039
|
current = current[index];
|
|
42965
43040
|
continue;
|
|
42966
43041
|
}
|
|
42967
|
-
if (
|
|
43042
|
+
if (isRecord3(current)) {
|
|
42968
43043
|
const existing = current[segment];
|
|
42969
43044
|
if (nextWantsArray) {
|
|
42970
43045
|
if (!Array.isArray(existing)) current[segment] = [];
|
|
42971
43046
|
} else {
|
|
42972
|
-
if (!
|
|
43047
|
+
if (!isRecord3(existing)) current[segment] = {};
|
|
42973
43048
|
}
|
|
42974
43049
|
current = current[segment];
|
|
42975
43050
|
continue;
|
|
@@ -43009,7 +43084,7 @@ function getPath(source, path) {
|
|
|
43009
43084
|
const segments = path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
43010
43085
|
let current = source;
|
|
43011
43086
|
for (const segment of segments) {
|
|
43012
|
-
if (!
|
|
43087
|
+
if (!isRecord3(current)) return void 0;
|
|
43013
43088
|
current = current[segment];
|
|
43014
43089
|
}
|
|
43015
43090
|
return current;
|
|
@@ -43029,13 +43104,13 @@ function applyTransform(name, value) {
|
|
|
43029
43104
|
}
|
|
43030
43105
|
function extractFirstParagraph(value) {
|
|
43031
43106
|
const unwrapped = unwrapRichTextRoot(value);
|
|
43032
|
-
if (!
|
|
43107
|
+
if (!isRecord3(unwrapped)) return null;
|
|
43033
43108
|
const doc = unwrapped;
|
|
43034
43109
|
if (!Array.isArray(doc.content)) return null;
|
|
43035
43110
|
for (const node of doc.content) {
|
|
43036
|
-
if (!
|
|
43111
|
+
if (!isRecord3(node)) continue;
|
|
43037
43112
|
if (node.type !== "paragraph" || !Array.isArray(node.content)) continue;
|
|
43038
|
-
const text2 = node.content.filter((item) =>
|
|
43113
|
+
const text2 = node.content.filter((item) => isRecord3(item) && item.type === "text").map((item) => typeof item.text === "string" ? item.text : "").join("").trim();
|
|
43039
43114
|
if (text2.length > 0) {
|
|
43040
43115
|
return text2;
|
|
43041
43116
|
}
|
|
@@ -43049,7 +43124,7 @@ function formatDate(value, options) {
|
|
|
43049
43124
|
return new Intl.DateTimeFormat(void 0, options).format(date);
|
|
43050
43125
|
}
|
|
43051
43126
|
function isBindingDescriptor(value) {
|
|
43052
|
-
if (!
|
|
43127
|
+
if (!isRecord3(value) || typeof value.source !== "string") {
|
|
43053
43128
|
return false;
|
|
43054
43129
|
}
|
|
43055
43130
|
if (!BINDING_SOURCES.includes(value.source)) {
|
|
@@ -43070,7 +43145,7 @@ function isBindingDescriptor(value) {
|
|
|
43070
43145
|
}
|
|
43071
43146
|
}
|
|
43072
43147
|
function isBindingDescriptorLike(value) {
|
|
43073
|
-
return isBindingDescriptor(value) || typeof value === "string" ||
|
|
43148
|
+
return isBindingDescriptor(value) || typeof value === "string" || isRecord3(value) && typeof value.source === "string" && typeof value.path === "string";
|
|
43074
43149
|
}
|
|
43075
43150
|
function normalizeBindingInput(value) {
|
|
43076
43151
|
if (isBindingDescriptor(value)) return value;
|
|
@@ -43086,7 +43161,7 @@ function normalizeValue(value) {
|
|
|
43086
43161
|
if (Array.isArray(value)) {
|
|
43087
43162
|
return value.map((item) => normalizeValue(item));
|
|
43088
43163
|
}
|
|
43089
|
-
if (!
|
|
43164
|
+
if (!isRecord3(value)) {
|
|
43090
43165
|
return value;
|
|
43091
43166
|
}
|
|
43092
43167
|
if (isDocWrapper(value)) {
|
|
@@ -43100,7 +43175,7 @@ function isDocWrapper(value) {
|
|
|
43100
43175
|
const keys = Object.keys(value);
|
|
43101
43176
|
if (keys.length !== 1) return false;
|
|
43102
43177
|
const doc = value.doc;
|
|
43103
|
-
return
|
|
43178
|
+
return isRecord3(doc) && typeof doc.type === "string" && doc.type === "doc";
|
|
43104
43179
|
}
|
|
43105
43180
|
|
|
43106
43181
|
// src/rendering/helpers/bindings.ts
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
export { SdkPreviewModeRuntime } from './chunk-LERKJM3E.mjs';
|
|
3
|
-
import './chunk-U5YM4AWE.mjs';
|
|
4
|
-
import './chunk-UOMTCHZD.mjs';
|
|
5
|
-
import './chunk-6D7PLF4M.mjs';
|
|
6
|
-
import './chunk-I6EOKV6B.mjs';
|
|
7
|
-
import './chunk-ZA2S7H34.mjs';
|
|
8
|
-
import './chunk-R7POPVJR.mjs';
|
|
File without changes
|