@riverbankcms/sdk 0.74.0 → 0.75.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-5XL7M3OM.mjs → PreviewEditorSidebar-U2IHCBYN.mjs} +3 -3
- package/dist/{PreviewEditorUI-ZDFRDJID.mjs → PreviewEditorUI-ZGH2RQNP.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-MTUGBTLQ.mjs +8 -0
- package/dist/_dts/api/src/cache-tags.d.ts +22 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/endpoints.d.ts +24 -24
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +2 -1
- package/dist/_dts/block-form/src/blockDraftSaveability.d.ts +4 -1
- package/dist/_dts/blocks/src/client/booking-form.d.ts +2 -0
- package/dist/_dts/blocks/src/client/carousel.d.ts +1 -0
- package/dist/_dts/blocks/src/client/course-registration.d.ts +2 -0
- package/dist/_dts/blocks/src/client/events.d.ts +4 -0
- package/dist/_dts/blocks/src/client/form.d.ts +2 -0
- package/dist/_dts/blocks/src/client/header.d.ts +1 -0
- package/dist/_dts/blocks/src/client/location-map.d.ts +1 -0
- package/dist/_dts/blocks/src/client/newsletter-form.d.ts +2 -0
- package/dist/_dts/blocks/src/client/shop.d.ts +6 -0
- package/dist/_dts/blocks/src/lib/video.d.ts +2 -0
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +21 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/events/index.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +1 -0
- package/dist/_dts/content-editor/src/hooks/validateBlocksForPublish.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +12 -2
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/islands/deferredVideoEmbeds.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/{chunk-YY7K3QD2.mjs → chunk-BGMNDF6T.mjs} +7 -7
- package/dist/{chunk-2MIWNFJM.mjs → chunk-GFE74WRD.mjs} +309 -84
- package/dist/{chunk-CEQBBLMJ.mjs → chunk-RWXQBRQZ.mjs} +1 -1
- package/dist/{chunk-7RX72SK2.mjs → chunk-VX7B5VAC.mjs} +36 -25
- package/dist/{chunk-YRJKZEQ3.mjs → chunk-Z7JLNTJR.mjs} +1 -1
- package/dist/{chunk-CBD47MTM.mjs → chunk-ZSHFGFUG.mjs} +2 -2
- package/dist/cli/index.mjs +3395 -3753
- package/dist/client/{accordion-ZZVXWV3N.mjs → accordion-T2UD2ZTH.mjs} +1 -1
- package/dist/client/bookingForm-GUP75FKN.mjs +3022 -0
- package/dist/client/bookings.mjs +19 -10
- package/dist/client/{carousel-25WK2H7G.mjs → carousel-2NQA6V57.mjs} +3 -2
- package/dist/client/cart-5TFIAFDS.mjs +18 -0
- package/dist/client/checkout-TP4WAHZE.mjs +18 -0
- package/dist/client/chunk-2PHQZ666.mjs +383 -0
- package/dist/client/chunk-3DCJ45Z2.mjs +36 -0
- package/dist/client/chunk-3PEDD5KJ.mjs +146 -0
- package/dist/client/chunk-CY2ZTSE5.mjs +204 -0
- package/dist/client/chunk-F7LHOKEH.mjs +146 -0
- package/dist/client/{chunk-6VGXRE34.mjs → chunk-FU2QRZMX.mjs} +6 -6
- package/dist/client/chunk-I2MMZO53.mjs +6 -0
- package/dist/client/chunk-II7O4XN3.mjs +2206 -0
- package/dist/client/chunk-M3L3KYYR.mjs +1181 -0
- package/dist/client/chunk-NWOUL6JY.mjs +1378 -0
- package/dist/client/chunk-OJPZEZU2.mjs +31 -0
- package/dist/client/chunk-RTZ3JKKX.mjs +178 -0
- package/dist/client/chunk-TQ5MSPDX.mjs +74 -0
- package/dist/client/chunk-VUAOE3AG.mjs +5592 -0
- package/dist/client/chunk-WJXXNDSE.mjs +245 -0
- package/dist/client/chunk-YLMKMCSJ.mjs +86 -0
- package/dist/client/chunk-ZLMS67RR.mjs +106 -0
- package/dist/client/client.mjs +51626 -52074
- package/dist/client/courseRegistration-5DPU6PDY.mjs +1737 -0
- package/dist/client/{eventCalendar-X6GIPYFM.mjs → eventCalendar-F3GZGTEF.mjs} +13 -2
- package/dist/client/{eventCombined-EZUOPM3G.mjs → eventCombined-BQOB6QMY.mjs} +13 -2
- package/dist/client/eventDetails-PEM2EJWE.mjs +25 -0
- package/dist/client/{eventListing-HEFGAETC.mjs → eventListing-YMIQPVME.mjs} +13 -2
- package/dist/client/{eventRegistration-3LCP2V3P.mjs → eventRegistration-4I6ZNDUF.mjs} +13 -2
- package/dist/client/form-ZJVAYZ6G.mjs +300 -0
- package/dist/client/headerSection-TOT5MGTF.mjs +729 -0
- package/dist/client/hooks.mjs +49 -33
- package/dist/client/locationMap-J66NZREU.mjs +227 -0
- package/dist/client/newsletterForm-ET2XUMRO.mjs +208 -0
- package/dist/client/productDetail-C2XIH7C5.mjs +18 -0
- package/dist/client/productList-T2AZLFTP.mjs +18 -0
- package/dist/client/rendering/client.mjs +11763 -12445
- package/dist/client/rendering/islands.mjs +98 -21
- package/dist/client/rendering.mjs +46778 -47229
- package/dist/client/shop-UZ6IUZXD.mjs +20 -0
- package/dist/preview-next/before-render.mjs +37 -25
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +37 -25
- package/dist/{sdk-runtime-OHNONZ5U.mjs → sdk-runtime-JCUQM63Y.mjs} +6 -6
- package/dist/server/components.mjs +409 -266
- package/dist/server/config-validation.mjs +49 -33
- package/dist/server/config.mjs +49 -33
- package/dist/server/data.mjs +49 -33
- package/dist/server/index.mjs +45 -33
- package/dist/server/next.mjs +405 -262
- package/dist/server/page-converter.mjs +12 -8
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +493 -265
- package/dist/server/rendering.mjs +411 -268
- package/dist/server/routing.mjs +49 -33
- package/dist/server/server.mjs +50 -34
- package/dist/server/theme-bridge.mjs +5 -0
- package/dist/styles/index.css +5 -0
- package/package.json +2 -1
- package/dist/SdkPreviewModeRuntime-CRYNDSPL.mjs +0 -8
- package/dist/client/bookingForm-4X77HKDS.mjs +0 -34
- package/dist/client/cart-JWD2VRFU.mjs +0 -11
- package/dist/client/checkout-V7KYGWL7.mjs +0 -11
- package/dist/client/chunk-5IYGMTUE.mjs +0 -18614
- package/dist/client/chunk-RKCFVIMS.mjs +0 -26
- package/dist/client/courseRegistration-O6ZPK4YT.mjs +0 -29
- package/dist/client/eventDetails-3WODIXET.mjs +0 -14
- package/dist/client/form-AKXQMY6Z.mjs +0 -85
- package/dist/client/headerSection-5KHCMU6B.mjs +0 -12
- package/dist/client/locationMap-7HIADW76.mjs +0 -14
- package/dist/client/newsletterForm-5N4YTMU3.mjs +0 -60
- package/dist/client/productDetail-IZUA7ZP3.mjs +0 -11
- package/dist/client/productList-KWIIJE6I.mjs +0 -11
- package/dist/client/shop-XZQFRQWZ.mjs +0 -13
|
@@ -2,26 +2,102 @@
|
|
|
2
2
|
import { buildResolveImageUrlContext, setContextResolveImageUrlContext } from '../chunk-PMAIXMAB.mjs';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
|
|
5
|
+
// src/rendering/islands/deferredVideoEmbeds.ts
|
|
6
|
+
var DEFERRED_IFRAME_SELECTOR = 'iframe[data-rb-video-embed-deferred="true"]';
|
|
7
|
+
var WRAPPER_SELECTOR = '[data-rb-video-embed-wrapper="true"]';
|
|
8
|
+
var DEFERRED_SRC_ATTRIBUTE = "data-rb-video-embed-src";
|
|
9
|
+
var LOADED_ATTRIBUTE = "data-rb-video-embed-loaded";
|
|
10
|
+
var OBSERVER_ROOT_MARGIN = "800px";
|
|
11
|
+
var observer = null;
|
|
12
|
+
var observedTargets = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
function enhanceDeferredVideoEmbeds(root = document) {
|
|
14
|
+
const iframes = Array.from(root.querySelectorAll(DEFERRED_IFRAME_SELECTOR));
|
|
15
|
+
if (iframes.length === 0) return;
|
|
16
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
17
|
+
iframes.forEach(loadDeferredIframe);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const sharedObserver = getOrCreateObserver();
|
|
21
|
+
iframes.forEach((iframe) => {
|
|
22
|
+
if (iframe.getAttribute("src")) {
|
|
23
|
+
markLoaded(iframe);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const target = getObservationTarget(iframe);
|
|
27
|
+
if (observedTargets.has(target)) return;
|
|
28
|
+
observedTargets.set(target, iframe);
|
|
29
|
+
sharedObserver.observe(target);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function getOrCreateObserver() {
|
|
33
|
+
if (observer) return observer;
|
|
34
|
+
observer = new IntersectionObserver(
|
|
35
|
+
(entries) => {
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (!entry.isIntersecting) continue;
|
|
38
|
+
const iframe = observedTargets.get(entry.target) ?? findDeferredIframe(entry.target);
|
|
39
|
+
observer?.unobserve(entry.target);
|
|
40
|
+
observedTargets.delete(entry.target);
|
|
41
|
+
if (!iframe) continue;
|
|
42
|
+
loadDeferredIframe(iframe);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{ rootMargin: OBSERVER_ROOT_MARGIN }
|
|
46
|
+
);
|
|
47
|
+
return observer;
|
|
48
|
+
}
|
|
49
|
+
function getObservationTarget(iframe) {
|
|
50
|
+
return iframe.closest(WRAPPER_SELECTOR) ?? iframe;
|
|
51
|
+
}
|
|
52
|
+
function findDeferredIframe(target) {
|
|
53
|
+
if (target instanceof HTMLIFrameElement) {
|
|
54
|
+
return target.matches(DEFERRED_IFRAME_SELECTOR) ? target : null;
|
|
55
|
+
}
|
|
56
|
+
return target.querySelector(DEFERRED_IFRAME_SELECTOR);
|
|
57
|
+
}
|
|
58
|
+
function loadDeferredIframe(iframe) {
|
|
59
|
+
if (iframe.getAttribute("src")) {
|
|
60
|
+
markLoaded(iframe);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const src = iframe.getAttribute(DEFERRED_SRC_ATTRIBUTE);
|
|
64
|
+
if (!isSafeHttpsUrl(src)) return;
|
|
65
|
+
iframe.setAttribute("src", src);
|
|
66
|
+
markLoaded(iframe);
|
|
67
|
+
}
|
|
68
|
+
function markLoaded(iframe) {
|
|
69
|
+
iframe.removeAttribute("data-rb-video-embed-deferred");
|
|
70
|
+
iframe.setAttribute(LOADED_ATTRIBUTE, "true");
|
|
71
|
+
}
|
|
72
|
+
function isSafeHttpsUrl(value) {
|
|
73
|
+
if (!value) return false;
|
|
74
|
+
try {
|
|
75
|
+
return new URL(value).protocol === "https:";
|
|
76
|
+
} catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
5
81
|
// src/rendering/islands/hydrateBlocksIslands.ts
|
|
6
82
|
var defaultEnhancerLoaders = {
|
|
7
|
-
accordion: () => import('../accordion-
|
|
8
|
-
headerSection: () => import('../headerSection-
|
|
9
|
-
carousel: () => import('../carousel-
|
|
10
|
-
form: () => import('../form-
|
|
11
|
-
"booking-form": () => import('../bookingForm-
|
|
12
|
-
"event-registration": () => import('../eventRegistration-
|
|
13
|
-
"event-details": () => import('../eventDetails-
|
|
14
|
-
"location-map": () => import('../locationMap-
|
|
15
|
-
"course-registration": () => import('../courseRegistration-
|
|
16
|
-
"event-listing": () => import('../eventListing-
|
|
17
|
-
"event-calendar": () => import('../eventCalendar-
|
|
18
|
-
"event-combined": () => import('../eventCombined-
|
|
19
|
-
"product-list": () => import('../productList-
|
|
20
|
-
"product-detail": () => import('../productDetail-
|
|
21
|
-
"cart": () => import('../cart-
|
|
22
|
-
"checkout": () => import('../checkout-
|
|
23
|
-
shop: () => import('../shop-
|
|
24
|
-
"newsletter-form": () => import('../newsletterForm-
|
|
83
|
+
accordion: () => import('../accordion-T2UD2ZTH.mjs'),
|
|
84
|
+
headerSection: () => import('../headerSection-TOT5MGTF.mjs'),
|
|
85
|
+
carousel: () => import('../carousel-2NQA6V57.mjs'),
|
|
86
|
+
form: () => import('../form-ZJVAYZ6G.mjs'),
|
|
87
|
+
"booking-form": () => import('../bookingForm-GUP75FKN.mjs'),
|
|
88
|
+
"event-registration": () => import('../eventRegistration-4I6ZNDUF.mjs'),
|
|
89
|
+
"event-details": () => import('../eventDetails-PEM2EJWE.mjs'),
|
|
90
|
+
"location-map": () => import('../locationMap-J66NZREU.mjs'),
|
|
91
|
+
"course-registration": () => import('../courseRegistration-5DPU6PDY.mjs'),
|
|
92
|
+
"event-listing": () => import('../eventListing-YMIQPVME.mjs'),
|
|
93
|
+
"event-calendar": () => import('../eventCalendar-F3GZGTEF.mjs'),
|
|
94
|
+
"event-combined": () => import('../eventCombined-BQOB6QMY.mjs'),
|
|
95
|
+
"product-list": () => import('../productList-T2AZLFTP.mjs'),
|
|
96
|
+
"product-detail": () => import('../productDetail-C2XIH7C5.mjs'),
|
|
97
|
+
"cart": () => import('../cart-5TFIAFDS.mjs'),
|
|
98
|
+
"checkout": () => import('../checkout-TP4WAHZE.mjs'),
|
|
99
|
+
shop: () => import('../shop-UZ6IUZXD.mjs'),
|
|
100
|
+
"newsletter-form": () => import('../newsletterForm-ET2XUMRO.mjs')
|
|
25
101
|
};
|
|
26
102
|
var DEFAULT_MAX_RETRIES = 2;
|
|
27
103
|
var RETRY_DELAYS_MS = [250, 1e3];
|
|
@@ -153,6 +229,7 @@ async function mountIsland(island, options) {
|
|
|
153
229
|
}
|
|
154
230
|
function hydrateBlocksIslands(options = {}) {
|
|
155
231
|
const root = options.root ?? document;
|
|
232
|
+
enhanceDeferredVideoEmbeds(root);
|
|
156
233
|
const loaders = resolveLoaders(options);
|
|
157
234
|
const islands = collectIslands(root, loaders);
|
|
158
235
|
if (islands.length === 0) return;
|
|
@@ -167,12 +244,12 @@ function hydrateBlocksIslands(options = {}) {
|
|
|
167
244
|
lazy.forEach(run);
|
|
168
245
|
return;
|
|
169
246
|
}
|
|
170
|
-
const
|
|
247
|
+
const observer2 = new IntersectionObserver(
|
|
171
248
|
(entries) => {
|
|
172
249
|
for (const entry of entries) {
|
|
173
250
|
if (!entry.isIntersecting) continue;
|
|
174
251
|
const element = entry.target;
|
|
175
|
-
|
|
252
|
+
observer2.unobserve(element);
|
|
176
253
|
const kind = element.dataset.rbIsland;
|
|
177
254
|
if (!kind || !isIslandKind(kind, loaders)) continue;
|
|
178
255
|
run({ element, kind });
|
|
@@ -180,7 +257,7 @@ function hydrateBlocksIslands(options = {}) {
|
|
|
180
257
|
},
|
|
181
258
|
{ rootMargin: "200px" }
|
|
182
259
|
);
|
|
183
|
-
lazy.forEach((island) =>
|
|
260
|
+
lazy.forEach((island) => observer2.observe(island.element));
|
|
184
261
|
}
|
|
185
262
|
|
|
186
263
|
// src/rendering/islands/BlocksIslandsHydrator.tsx
|