@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260421114651 → 0.8.1-dev.20260422062852
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.
|
@@ -4,13 +4,15 @@ import Hls from "hls.js";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
var HlsPlayer = React.memo(
|
|
6
6
|
({
|
|
7
|
+
sources,
|
|
7
8
|
assetUrl,
|
|
8
9
|
posterUrl,
|
|
9
10
|
intrinsicWidth,
|
|
10
11
|
intrinsicHeight,
|
|
11
12
|
showControls = true,
|
|
12
13
|
loop = false,
|
|
13
|
-
playOptions = "autoplay"
|
|
14
|
+
playOptions = "autoplay",
|
|
15
|
+
placementCode = ""
|
|
14
16
|
}) => {
|
|
15
17
|
const videoRef = useRef(null);
|
|
16
18
|
const hlsRef = useRef(null);
|
|
@@ -18,12 +20,14 @@ var HlsPlayer = React.memo(
|
|
|
18
20
|
const [isHovered, setIsHovered] = useState(false);
|
|
19
21
|
const [isMobile, setIsMobile] = useState(false);
|
|
20
22
|
const wasManuallyPausedRef = useRef(false);
|
|
23
|
+
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl }] : [];
|
|
21
24
|
useEffect(() => {
|
|
22
25
|
const checkMobile = () => {
|
|
23
26
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
24
27
|
const isSmallScreen = window.innerWidth <= 768;
|
|
25
|
-
const
|
|
26
|
-
|
|
28
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
29
|
+
navigator.userAgent.toLowerCase()
|
|
30
|
+
);
|
|
27
31
|
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
28
32
|
};
|
|
29
33
|
checkMobile();
|
|
@@ -32,31 +36,39 @@ var HlsPlayer = React.memo(
|
|
|
32
36
|
}, []);
|
|
33
37
|
useEffect(() => {
|
|
34
38
|
const v = videoRef.current;
|
|
35
|
-
if (!v ||
|
|
39
|
+
if (!v || resolvedSources.length === 0) return;
|
|
36
40
|
if (hlsRef.current) {
|
|
37
41
|
hlsRef.current.destroy();
|
|
38
42
|
hlsRef.current = null;
|
|
39
43
|
}
|
|
40
44
|
if (Hls.isSupported()) {
|
|
41
45
|
const hls = new Hls();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const onLoadStart = () => {
|
|
47
|
+
const chosenSrc = v.currentSrc;
|
|
48
|
+
if (!chosenSrc) return;
|
|
49
|
+
hls.loadSource(chosenSrc);
|
|
50
|
+
hls.attachMedia(v);
|
|
51
|
+
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
52
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
53
|
+
v.play().catch(console.error);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
58
|
+
v.load();
|
|
49
59
|
hlsRef.current = hls;
|
|
60
|
+
return () => {
|
|
61
|
+
v.removeEventListener("loadstart", onLoadStart);
|
|
62
|
+
hls.destroy();
|
|
63
|
+
hlsRef.current = null;
|
|
64
|
+
};
|
|
50
65
|
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
51
66
|
v.load();
|
|
52
67
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}, [assetUrl]);
|
|
68
|
+
}, [
|
|
69
|
+
// Serialise the source array so the dependency is a stable primitive.
|
|
70
|
+
JSON.stringify(resolvedSources)
|
|
71
|
+
]);
|
|
60
72
|
const handlePlayPause = useCallback(() => {
|
|
61
73
|
const v = videoRef.current;
|
|
62
74
|
if (!v) return;
|
|
@@ -85,6 +97,7 @@ var HlsPlayer = React.memo(
|
|
|
85
97
|
setIsPlaying(false);
|
|
86
98
|
}
|
|
87
99
|
}, [playOptions, isMobile]);
|
|
100
|
+
if (resolvedSources.length === 0) return null;
|
|
88
101
|
return /* @__PURE__ */ jsxs(
|
|
89
102
|
"div",
|
|
90
103
|
{
|
|
@@ -104,7 +117,15 @@ var HlsPlayer = React.memo(
|
|
|
104
117
|
loop,
|
|
105
118
|
playsInline: true,
|
|
106
119
|
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0,
|
|
107
|
-
children:
|
|
120
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ jsx(
|
|
121
|
+
"source",
|
|
122
|
+
{
|
|
123
|
+
src,
|
|
124
|
+
type: "application/x-mpegURL",
|
|
125
|
+
...media ? { media } : {}
|
|
126
|
+
},
|
|
127
|
+
i
|
|
128
|
+
))
|
|
108
129
|
}
|
|
109
130
|
),
|
|
110
131
|
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ jsx(
|
package/dist/index.js
CHANGED
|
@@ -281,13 +281,15 @@ var init_HlsPlayer = __esm({
|
|
|
281
281
|
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
282
282
|
HlsPlayer = import_react33.default.memo(
|
|
283
283
|
({
|
|
284
|
+
sources,
|
|
284
285
|
assetUrl,
|
|
285
286
|
posterUrl,
|
|
286
287
|
intrinsicWidth,
|
|
287
288
|
intrinsicHeight,
|
|
288
289
|
showControls = true,
|
|
289
290
|
loop = false,
|
|
290
|
-
playOptions = "autoplay"
|
|
291
|
+
playOptions = "autoplay",
|
|
292
|
+
placementCode = ""
|
|
291
293
|
}) => {
|
|
292
294
|
const videoRef = (0, import_react33.useRef)(null);
|
|
293
295
|
const hlsRef = (0, import_react33.useRef)(null);
|
|
@@ -295,12 +297,14 @@ var init_HlsPlayer = __esm({
|
|
|
295
297
|
const [isHovered, setIsHovered] = (0, import_react33.useState)(false);
|
|
296
298
|
const [isMobile, setIsMobile] = (0, import_react33.useState)(false);
|
|
297
299
|
const wasManuallyPausedRef = (0, import_react33.useRef)(false);
|
|
300
|
+
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl }] : [];
|
|
298
301
|
(0, import_react33.useEffect)(() => {
|
|
299
302
|
const checkMobile = () => {
|
|
300
303
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
301
304
|
const isSmallScreen = window.innerWidth <= 768;
|
|
302
|
-
const
|
|
303
|
-
|
|
305
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
306
|
+
navigator.userAgent.toLowerCase()
|
|
307
|
+
);
|
|
304
308
|
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
305
309
|
};
|
|
306
310
|
checkMobile();
|
|
@@ -309,31 +313,39 @@ var init_HlsPlayer = __esm({
|
|
|
309
313
|
}, []);
|
|
310
314
|
(0, import_react33.useEffect)(() => {
|
|
311
315
|
const v = videoRef.current;
|
|
312
|
-
if (!v ||
|
|
316
|
+
if (!v || resolvedSources.length === 0) return;
|
|
313
317
|
if (hlsRef.current) {
|
|
314
318
|
hlsRef.current.destroy();
|
|
315
319
|
hlsRef.current = null;
|
|
316
320
|
}
|
|
317
321
|
if (import_hls.default.isSupported()) {
|
|
318
322
|
const hls = new import_hls.default();
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
const onLoadStart = () => {
|
|
324
|
+
const chosenSrc = v.currentSrc;
|
|
325
|
+
if (!chosenSrc) return;
|
|
326
|
+
hls.loadSource(chosenSrc);
|
|
327
|
+
hls.attachMedia(v);
|
|
328
|
+
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
329
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
330
|
+
v.play().catch(console.error);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
335
|
+
v.load();
|
|
326
336
|
hlsRef.current = hls;
|
|
337
|
+
return () => {
|
|
338
|
+
v.removeEventListener("loadstart", onLoadStart);
|
|
339
|
+
hls.destroy();
|
|
340
|
+
hlsRef.current = null;
|
|
341
|
+
};
|
|
327
342
|
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
328
343
|
v.load();
|
|
329
344
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}, [assetUrl]);
|
|
345
|
+
}, [
|
|
346
|
+
// Serialise the source array so the dependency is a stable primitive.
|
|
347
|
+
JSON.stringify(resolvedSources)
|
|
348
|
+
]);
|
|
337
349
|
const handlePlayPause = (0, import_react33.useCallback)(() => {
|
|
338
350
|
const v = videoRef.current;
|
|
339
351
|
if (!v) return;
|
|
@@ -362,6 +374,7 @@ var init_HlsPlayer = __esm({
|
|
|
362
374
|
setIsPlaying(false);
|
|
363
375
|
}
|
|
364
376
|
}, [playOptions, isMobile]);
|
|
377
|
+
if (resolvedSources.length === 0) return null;
|
|
365
378
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
366
379
|
"div",
|
|
367
380
|
{
|
|
@@ -381,7 +394,15 @@ var init_HlsPlayer = __esm({
|
|
|
381
394
|
loop,
|
|
382
395
|
playsInline: true,
|
|
383
396
|
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0,
|
|
384
|
-
children:
|
|
397
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
398
|
+
"source",
|
|
399
|
+
{
|
|
400
|
+
src,
|
|
401
|
+
type: "application/x-mpegURL",
|
|
402
|
+
...media ? { media } : {}
|
|
403
|
+
},
|
|
404
|
+
i
|
|
405
|
+
))
|
|
385
406
|
}
|
|
386
407
|
),
|
|
387
408
|
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
@@ -3395,7 +3416,7 @@ var DataList = (props) => {
|
|
|
3395
3416
|
var DataList_default = DataList;
|
|
3396
3417
|
|
|
3397
3418
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3398
|
-
var
|
|
3419
|
+
var import_react51 = __toESM(require("react"));
|
|
3399
3420
|
|
|
3400
3421
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3401
3422
|
var import_react37 = __toESM(require("react"));
|
|
@@ -4406,7 +4427,7 @@ var FormContainerNode = (props) => {
|
|
|
4406
4427
|
var FormContainerNode_default = FormContainerNode;
|
|
4407
4428
|
|
|
4408
4429
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4409
|
-
var
|
|
4430
|
+
var import_react50 = __toESM(require("react"));
|
|
4410
4431
|
|
|
4411
4432
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4412
4433
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
@@ -5104,7 +5125,6 @@ var Pagination = (props) => {
|
|
|
5104
5125
|
var Pagination_default = Pagination;
|
|
5105
5126
|
|
|
5106
5127
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5107
|
-
var import_react50 = __toESM(require("react"));
|
|
5108
5128
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5109
5129
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5110
5130
|
var HlsPlayer3 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
@@ -5122,22 +5142,13 @@ var deviceToMediaQuery = (device) => {
|
|
|
5122
5142
|
return null;
|
|
5123
5143
|
}
|
|
5124
5144
|
};
|
|
5145
|
+
var DEVICE_ORDER = ["sm", "md", "lg", "tv"];
|
|
5125
5146
|
var parseMaybeNumber = (value) => {
|
|
5126
|
-
if (typeof value === "number")
|
|
5127
|
-
return Number.isFinite(value) ? value : void 0;
|
|
5128
|
-
}
|
|
5147
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
5129
5148
|
if (typeof value !== "string") return void 0;
|
|
5130
5149
|
const n = Number(value);
|
|
5131
5150
|
return Number.isFinite(n) ? n : void 0;
|
|
5132
5151
|
};
|
|
5133
|
-
var groupImagesForPicture = (images) => {
|
|
5134
|
-
const sources = images.filter((img) => !!img.device);
|
|
5135
|
-
const fallbacks = images.filter((img) => !img.device);
|
|
5136
|
-
return {
|
|
5137
|
-
sources,
|
|
5138
|
-
fallback: fallbacks[0] ?? sources[0] ?? null
|
|
5139
|
-
};
|
|
5140
|
-
};
|
|
5141
5152
|
var ImageGalleryNode = (props) => {
|
|
5142
5153
|
const resolveImageUrl = (imageUrl) => {
|
|
5143
5154
|
if (!imageUrl) return "";
|
|
@@ -5157,49 +5168,50 @@ var ImageGalleryNode = (props) => {
|
|
|
5157
5168
|
const staticImages = rawImages.filter(
|
|
5158
5169
|
(img) => !resolveImageUrl(img.imageUrl).endsWith(".m3u8")
|
|
5159
5170
|
);
|
|
5160
|
-
const
|
|
5171
|
+
const hlsSources = [
|
|
5172
|
+
// Constrained sources in breakpoint order (narrowest first).
|
|
5173
|
+
...DEVICE_ORDER.flatMap((deviceKey) => {
|
|
5174
|
+
const img = hlsImages.find((i) => i.device === deviceKey);
|
|
5175
|
+
if (!img) return [];
|
|
5176
|
+
const src = resolveImageUrl(img.imageUrl);
|
|
5177
|
+
if (!src) return [];
|
|
5178
|
+
const media = deviceToMediaQuery(img.device);
|
|
5179
|
+
return [{ src, ...media ? { media } : {} }];
|
|
5180
|
+
}),
|
|
5181
|
+
// Unconstrained fallback(s) — no media attr, always matches.
|
|
5182
|
+
...hlsImages.filter((img) => !img.device).map((img) => ({ src: resolveImageUrl(img.imageUrl) })).filter((s) => !!s.src)
|
|
5183
|
+
];
|
|
5184
|
+
const primaryHls = hlsImages.find((img) => !img.device) ?? hlsImages[0];
|
|
5185
|
+
const hlsPosterUrl = primaryHls ? resolvePosterUrl(primaryHls.posterUrl) : void 0;
|
|
5186
|
+
const hlsIntrinsicWidth = primaryHls ? parseMaybeNumber(primaryHls.intrinsicWidth)?.toString() : void 0;
|
|
5187
|
+
const hlsIntrinsicHeight = primaryHls ? parseMaybeNumber(primaryHls.intrinsicHeight)?.toString() : void 0;
|
|
5188
|
+
const staticSources = staticImages.filter((img) => !!img.device);
|
|
5189
|
+
const staticFallback = staticImages.find((img) => !img.device) ?? staticImages[0] ?? null;
|
|
5161
5190
|
const FormatClass = {
|
|
5162
5191
|
center: "justify-center",
|
|
5163
5192
|
left: "justify-start",
|
|
5164
5193
|
right: "justify-end"
|
|
5165
5194
|
};
|
|
5166
5195
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
5167
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
assetUrl,
|
|
5184
|
-
posterUrl,
|
|
5185
|
-
intrinsicWidth: intrinsicWidth?.toString(),
|
|
5186
|
-
intrinsicHeight: intrinsicHeight?.toString(),
|
|
5187
|
-
showControls: true,
|
|
5188
|
-
loop: false,
|
|
5189
|
-
playOptions: void 0,
|
|
5190
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
5191
|
-
session: props.session
|
|
5192
|
-
}
|
|
5193
|
-
) })
|
|
5194
|
-
},
|
|
5195
|
-
`hls-${idx}-${img.imageUrl}`
|
|
5196
|
-
);
|
|
5197
|
-
}),
|
|
5196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
5197
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5198
|
+
HlsPlayer3,
|
|
5199
|
+
{
|
|
5200
|
+
sources: hlsSources,
|
|
5201
|
+
posterUrl: hlsPosterUrl,
|
|
5202
|
+
intrinsicWidth: hlsIntrinsicWidth,
|
|
5203
|
+
intrinsicHeight: hlsIntrinsicHeight,
|
|
5204
|
+
showControls: primaryHls?.showControls ?? false,
|
|
5205
|
+
loop: primaryHls?.loop ?? false,
|
|
5206
|
+
playOptions: primaryHls?.playOptions ?? "",
|
|
5207
|
+
placementCode: primaryHls?.placementCode ?? "",
|
|
5208
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
5209
|
+
session: props.session
|
|
5210
|
+
}
|
|
5211
|
+
) }),
|
|
5198
5212
|
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("picture", { children: [
|
|
5199
|
-
|
|
5200
|
-
const match = staticSources.find(
|
|
5201
|
-
(img) => img.device === deviceKey
|
|
5202
|
-
);
|
|
5213
|
+
DEVICE_ORDER.map((deviceKey) => {
|
|
5214
|
+
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5203
5215
|
if (!match) return null;
|
|
5204
5216
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5205
5217
|
if (!srcUrl) return null;
|
|
@@ -5227,7 +5239,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5227
5239
|
if (img.width) styles.width = img.width;
|
|
5228
5240
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5229
5241
|
return (
|
|
5230
|
-
|
|
5242
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
5231
5243
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5232
5244
|
"img",
|
|
5233
5245
|
{
|
|
@@ -5471,7 +5483,7 @@ var DivContainer = async (props) => {
|
|
|
5471
5483
|
}
|
|
5472
5484
|
const SelectedNode = NodeTypes2[node.type];
|
|
5473
5485
|
if (!SelectedNode) return null;
|
|
5474
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5475
5487
|
SelectedNode,
|
|
5476
5488
|
{
|
|
5477
5489
|
node,
|
|
@@ -5573,9 +5585,9 @@ var DivContainer = async (props) => {
|
|
|
5573
5585
|
props.node.autoFormat && "auto-format",
|
|
5574
5586
|
props.node.bgClass
|
|
5575
5587
|
].filter(Boolean).join(" ");
|
|
5576
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react50.default.Fragment, { children: [
|
|
5577
5589
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5578
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5579
5591
|
Wrapper,
|
|
5580
5592
|
{
|
|
5581
5593
|
id: guid,
|
|
@@ -5584,7 +5596,7 @@ var DivContainer = async (props) => {
|
|
|
5584
5596
|
...wrapperProps,
|
|
5585
5597
|
children: dataToRender.map(
|
|
5586
5598
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5587
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5599
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: child }, i)
|
|
5588
5600
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5589
5601
|
)
|
|
5590
5602
|
}
|
|
@@ -5623,11 +5635,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5623
5635
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5624
5636
|
rootNode = pageBodyTree.root;
|
|
5625
5637
|
}
|
|
5626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5627
5639
|
{
|
|
5628
5640
|
}
|
|
5629
5641
|
const SelectedNode = NodeTypes[node.type];
|
|
5630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5631
5643
|
SelectedNode,
|
|
5632
5644
|
{
|
|
5633
5645
|
node,
|
|
@@ -5643,7 +5655,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5643
5655
|
device: props.device,
|
|
5644
5656
|
widgetRenderer: props.widgetRenderer
|
|
5645
5657
|
}
|
|
5646
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5658
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5647
5659
|
SelectedNode,
|
|
5648
5660
|
{
|
|
5649
5661
|
node,
|
|
@@ -5664,13 +5676,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5664
5676
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5665
5677
|
|
|
5666
5678
|
// src/components/Toast.tsx
|
|
5667
|
-
var
|
|
5679
|
+
var import_react52 = require("react");
|
|
5668
5680
|
init_ToastService();
|
|
5669
5681
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5670
5682
|
var Toast = () => {
|
|
5671
|
-
const [showToast, setShowToast] = (0,
|
|
5672
|
-
const [message, setMessage] = (0,
|
|
5673
|
-
const [messageType, setMessageType] = (0,
|
|
5683
|
+
const [showToast, setShowToast] = (0, import_react52.useState)(false);
|
|
5684
|
+
const [message, setMessage] = (0, import_react52.useState)("");
|
|
5685
|
+
const [messageType, setMessageType] = (0, import_react52.useState)("error");
|
|
5674
5686
|
ToastService_default.showError = function(message2) {
|
|
5675
5687
|
setShowToast(true);
|
|
5676
5688
|
setMessage(message2);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HlsPlayer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q46ODS3X.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Button_default,
|
|
6
6
|
ServiceClient_default,
|
|
@@ -2403,7 +2403,7 @@ var DataList = (props) => {
|
|
|
2403
2403
|
var DataList_default = DataList;
|
|
2404
2404
|
|
|
2405
2405
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2406
|
-
import
|
|
2406
|
+
import React43 from "react";
|
|
2407
2407
|
|
|
2408
2408
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2409
2409
|
import React32 from "react";
|
|
@@ -2638,7 +2638,7 @@ var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
|
2638
2638
|
|
|
2639
2639
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2640
2640
|
import { Fragment as Fragment3, jsx as jsx39 } from "react/jsx-runtime";
|
|
2641
|
-
var HlsPlayer = dynamic(() => import("./HlsPlayer-
|
|
2641
|
+
var HlsPlayer = dynamic(() => import("./HlsPlayer-UECDBJDB.mjs"), {
|
|
2642
2642
|
ssr: false
|
|
2643
2643
|
});
|
|
2644
2644
|
var getNestedValue = (obj, path) => {
|
|
@@ -3411,7 +3411,7 @@ var FormContainerNode = (props) => {
|
|
|
3411
3411
|
var FormContainerNode_default = FormContainerNode;
|
|
3412
3412
|
|
|
3413
3413
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3414
|
-
import
|
|
3414
|
+
import React42 from "react";
|
|
3415
3415
|
|
|
3416
3416
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3417
3417
|
import dynamic4 from "next/dynamic";
|
|
@@ -4105,10 +4105,9 @@ var Pagination = (props) => {
|
|
|
4105
4105
|
var Pagination_default = Pagination;
|
|
4106
4106
|
|
|
4107
4107
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4108
|
-
import React42 from "react";
|
|
4109
4108
|
import dynamic5 from "next/dynamic";
|
|
4110
4109
|
import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4111
|
-
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-
|
|
4110
|
+
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-UECDBJDB.mjs"), { ssr: false });
|
|
4112
4111
|
var deviceToMediaQuery = (device) => {
|
|
4113
4112
|
switch (device) {
|
|
4114
4113
|
case "sm":
|
|
@@ -4123,22 +4122,13 @@ var deviceToMediaQuery = (device) => {
|
|
|
4123
4122
|
return null;
|
|
4124
4123
|
}
|
|
4125
4124
|
};
|
|
4125
|
+
var DEVICE_ORDER = ["sm", "md", "lg", "tv"];
|
|
4126
4126
|
var parseMaybeNumber = (value) => {
|
|
4127
|
-
if (typeof value === "number")
|
|
4128
|
-
return Number.isFinite(value) ? value : void 0;
|
|
4129
|
-
}
|
|
4127
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
4130
4128
|
if (typeof value !== "string") return void 0;
|
|
4131
4129
|
const n = Number(value);
|
|
4132
4130
|
return Number.isFinite(n) ? n : void 0;
|
|
4133
4131
|
};
|
|
4134
|
-
var groupImagesForPicture = (images) => {
|
|
4135
|
-
const sources = images.filter((img) => !!img.device);
|
|
4136
|
-
const fallbacks = images.filter((img) => !img.device);
|
|
4137
|
-
return {
|
|
4138
|
-
sources,
|
|
4139
|
-
fallback: fallbacks[0] ?? sources[0] ?? null
|
|
4140
|
-
};
|
|
4141
|
-
};
|
|
4142
4132
|
var ImageGalleryNode = (props) => {
|
|
4143
4133
|
const resolveImageUrl = (imageUrl) => {
|
|
4144
4134
|
if (!imageUrl) return "";
|
|
@@ -4158,49 +4148,50 @@ var ImageGalleryNode = (props) => {
|
|
|
4158
4148
|
const staticImages = rawImages.filter(
|
|
4159
4149
|
(img) => !resolveImageUrl(img.imageUrl).endsWith(".m3u8")
|
|
4160
4150
|
);
|
|
4161
|
-
const
|
|
4151
|
+
const hlsSources = [
|
|
4152
|
+
// Constrained sources in breakpoint order (narrowest first).
|
|
4153
|
+
...DEVICE_ORDER.flatMap((deviceKey) => {
|
|
4154
|
+
const img = hlsImages.find((i) => i.device === deviceKey);
|
|
4155
|
+
if (!img) return [];
|
|
4156
|
+
const src = resolveImageUrl(img.imageUrl);
|
|
4157
|
+
if (!src) return [];
|
|
4158
|
+
const media = deviceToMediaQuery(img.device);
|
|
4159
|
+
return [{ src, ...media ? { media } : {} }];
|
|
4160
|
+
}),
|
|
4161
|
+
// Unconstrained fallback(s) — no media attr, always matches.
|
|
4162
|
+
...hlsImages.filter((img) => !img.device).map((img) => ({ src: resolveImageUrl(img.imageUrl) })).filter((s) => !!s.src)
|
|
4163
|
+
];
|
|
4164
|
+
const primaryHls = hlsImages.find((img) => !img.device) ?? hlsImages[0];
|
|
4165
|
+
const hlsPosterUrl = primaryHls ? resolvePosterUrl(primaryHls.posterUrl) : void 0;
|
|
4166
|
+
const hlsIntrinsicWidth = primaryHls ? parseMaybeNumber(primaryHls.intrinsicWidth)?.toString() : void 0;
|
|
4167
|
+
const hlsIntrinsicHeight = primaryHls ? parseMaybeNumber(primaryHls.intrinsicHeight)?.toString() : void 0;
|
|
4168
|
+
const staticSources = staticImages.filter((img) => !!img.device);
|
|
4169
|
+
const staticFallback = staticImages.find((img) => !img.device) ?? staticImages[0] ?? null;
|
|
4162
4170
|
const FormatClass = {
|
|
4163
4171
|
center: "justify-center",
|
|
4164
4172
|
left: "justify-start",
|
|
4165
4173
|
right: "justify-end"
|
|
4166
4174
|
};
|
|
4167
4175
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
4168
|
-
return /* @__PURE__ */ jsxs33(
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
assetUrl,
|
|
4185
|
-
posterUrl,
|
|
4186
|
-
intrinsicWidth: intrinsicWidth?.toString(),
|
|
4187
|
-
intrinsicHeight: intrinsicHeight?.toString(),
|
|
4188
|
-
showControls: true,
|
|
4189
|
-
loop: false,
|
|
4190
|
-
playOptions: void 0,
|
|
4191
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
4192
|
-
session: props.session
|
|
4193
|
-
}
|
|
4194
|
-
) })
|
|
4195
|
-
},
|
|
4196
|
-
`hls-${idx}-${img.imageUrl}`
|
|
4197
|
-
);
|
|
4198
|
-
}),
|
|
4176
|
+
return /* @__PURE__ */ jsxs33(Fragment9, { children: [
|
|
4177
|
+
hlsSources.length > 0 && /* @__PURE__ */ jsx58(Fragment9, { children: /* @__PURE__ */ jsx58(
|
|
4178
|
+
HlsPlayer2,
|
|
4179
|
+
{
|
|
4180
|
+
sources: hlsSources,
|
|
4181
|
+
posterUrl: hlsPosterUrl,
|
|
4182
|
+
intrinsicWidth: hlsIntrinsicWidth,
|
|
4183
|
+
intrinsicHeight: hlsIntrinsicHeight,
|
|
4184
|
+
showControls: primaryHls?.showControls ?? false,
|
|
4185
|
+
loop: primaryHls?.loop ?? false,
|
|
4186
|
+
playOptions: primaryHls?.playOptions ?? "",
|
|
4187
|
+
placementCode: primaryHls?.placementCode ?? "",
|
|
4188
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4189
|
+
session: props.session
|
|
4190
|
+
}
|
|
4191
|
+
) }),
|
|
4199
4192
|
staticFallback && /* @__PURE__ */ jsx58(Fragment9, { children: /* @__PURE__ */ jsxs33("picture", { children: [
|
|
4200
|
-
|
|
4201
|
-
const match = staticSources.find(
|
|
4202
|
-
(img) => img.device === deviceKey
|
|
4203
|
-
);
|
|
4193
|
+
DEVICE_ORDER.map((deviceKey) => {
|
|
4194
|
+
const match = staticSources.find((img) => img.device === deviceKey);
|
|
4204
4195
|
if (!match) return null;
|
|
4205
4196
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
4206
4197
|
if (!srcUrl) return null;
|
|
@@ -4228,7 +4219,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4228
4219
|
if (img.width) styles.width = img.width;
|
|
4229
4220
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
4230
4221
|
return (
|
|
4231
|
-
|
|
4222
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
4232
4223
|
/* @__PURE__ */ jsx58(
|
|
4233
4224
|
"img",
|
|
4234
4225
|
{
|
|
@@ -4472,7 +4463,7 @@ var DivContainer = async (props) => {
|
|
|
4472
4463
|
}
|
|
4473
4464
|
const SelectedNode = NodeTypes2[node.type];
|
|
4474
4465
|
if (!SelectedNode) return null;
|
|
4475
|
-
return /* @__PURE__ */ jsx59(
|
|
4466
|
+
return /* @__PURE__ */ jsx59(React42.Fragment, { children: /* @__PURE__ */ jsx59(
|
|
4476
4467
|
SelectedNode,
|
|
4477
4468
|
{
|
|
4478
4469
|
node,
|
|
@@ -4574,9 +4565,9 @@ var DivContainer = async (props) => {
|
|
|
4574
4565
|
props.node.autoFormat && "auto-format",
|
|
4575
4566
|
props.node.bgClass
|
|
4576
4567
|
].filter(Boolean).join(" ");
|
|
4577
|
-
return /* @__PURE__ */ jsxs34(
|
|
4568
|
+
return /* @__PURE__ */ jsxs34(React42.Fragment, { children: [
|
|
4578
4569
|
/* @__PURE__ */ jsx59("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4579
|
-
/* @__PURE__ */ jsx59(
|
|
4570
|
+
/* @__PURE__ */ jsx59(React42.Fragment, { children: /* @__PURE__ */ jsx59(
|
|
4580
4571
|
Wrapper,
|
|
4581
4572
|
{
|
|
4582
4573
|
id: guid,
|
|
@@ -4585,7 +4576,7 @@ var DivContainer = async (props) => {
|
|
|
4585
4576
|
...wrapperProps,
|
|
4586
4577
|
children: dataToRender.map(
|
|
4587
4578
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4588
|
-
(child, i) => /* @__PURE__ */ jsx59(
|
|
4579
|
+
(child, i) => /* @__PURE__ */ jsx59(React42.Fragment, { children: child }, i)
|
|
4589
4580
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4590
4581
|
)
|
|
4591
4582
|
}
|
|
@@ -4624,11 +4615,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4624
4615
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4625
4616
|
rootNode = pageBodyTree.root;
|
|
4626
4617
|
}
|
|
4627
|
-
return /* @__PURE__ */ jsx60(
|
|
4618
|
+
return /* @__PURE__ */ jsx60(React43.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4628
4619
|
{
|
|
4629
4620
|
}
|
|
4630
4621
|
const SelectedNode = NodeTypes[node.type];
|
|
4631
|
-
return /* @__PURE__ */ jsx60(
|
|
4622
|
+
return /* @__PURE__ */ jsx60(React43.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx60(React43.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx60(React43.Fragment, { children: /* @__PURE__ */ jsx60(
|
|
4632
4623
|
SelectedNode,
|
|
4633
4624
|
{
|
|
4634
4625
|
node,
|
|
@@ -4644,7 +4635,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4644
4635
|
device: props.device,
|
|
4645
4636
|
widgetRenderer: props.widgetRenderer
|
|
4646
4637
|
}
|
|
4647
|
-
) }) : /* @__PURE__ */ jsx60(
|
|
4638
|
+
) }) : /* @__PURE__ */ jsx60(React43.Fragment, { children: /* @__PURE__ */ jsx60(
|
|
4648
4639
|
SelectedNode,
|
|
4649
4640
|
{
|
|
4650
4641
|
node,
|
package/package.json
CHANGED