@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260421114651 → 0.8.1-dev.20260421115845
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,6 +4,7 @@ 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,
|
|
@@ -18,12 +19,14 @@ var HlsPlayer = React.memo(
|
|
|
18
19
|
const [isHovered, setIsHovered] = useState(false);
|
|
19
20
|
const [isMobile, setIsMobile] = useState(false);
|
|
20
21
|
const wasManuallyPausedRef = useRef(false);
|
|
22
|
+
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl }] : [];
|
|
21
23
|
useEffect(() => {
|
|
22
24
|
const checkMobile = () => {
|
|
23
25
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
24
26
|
const isSmallScreen = window.innerWidth <= 768;
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
28
|
+
navigator.userAgent.toLowerCase()
|
|
29
|
+
);
|
|
27
30
|
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
28
31
|
};
|
|
29
32
|
checkMobile();
|
|
@@ -32,31 +35,39 @@ var HlsPlayer = React.memo(
|
|
|
32
35
|
}, []);
|
|
33
36
|
useEffect(() => {
|
|
34
37
|
const v = videoRef.current;
|
|
35
|
-
if (!v ||
|
|
38
|
+
if (!v || resolvedSources.length === 0) return;
|
|
36
39
|
if (hlsRef.current) {
|
|
37
40
|
hlsRef.current.destroy();
|
|
38
41
|
hlsRef.current = null;
|
|
39
42
|
}
|
|
40
43
|
if (Hls.isSupported()) {
|
|
41
44
|
const hls = new Hls();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const onLoadStart = () => {
|
|
46
|
+
const chosenSrc = v.currentSrc;
|
|
47
|
+
if (!chosenSrc) return;
|
|
48
|
+
hls.loadSource(chosenSrc);
|
|
49
|
+
hls.attachMedia(v);
|
|
50
|
+
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
51
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
52
|
+
v.play().catch(console.error);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
57
|
+
v.load();
|
|
49
58
|
hlsRef.current = hls;
|
|
59
|
+
return () => {
|
|
60
|
+
v.removeEventListener("loadstart", onLoadStart);
|
|
61
|
+
hls.destroy();
|
|
62
|
+
hlsRef.current = null;
|
|
63
|
+
};
|
|
50
64
|
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
51
65
|
v.load();
|
|
52
66
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}, [assetUrl]);
|
|
67
|
+
}, [
|
|
68
|
+
// Serialise the source array so the dependency is a stable primitive.
|
|
69
|
+
JSON.stringify(resolvedSources)
|
|
70
|
+
]);
|
|
60
71
|
const handlePlayPause = useCallback(() => {
|
|
61
72
|
const v = videoRef.current;
|
|
62
73
|
if (!v) return;
|
|
@@ -85,6 +96,7 @@ var HlsPlayer = React.memo(
|
|
|
85
96
|
setIsPlaying(false);
|
|
86
97
|
}
|
|
87
98
|
}, [playOptions, isMobile]);
|
|
99
|
+
if (resolvedSources.length === 0) return null;
|
|
88
100
|
return /* @__PURE__ */ jsxs(
|
|
89
101
|
"div",
|
|
90
102
|
{
|
|
@@ -104,7 +116,15 @@ var HlsPlayer = React.memo(
|
|
|
104
116
|
loop,
|
|
105
117
|
playsInline: true,
|
|
106
118
|
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0,
|
|
107
|
-
children:
|
|
119
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ jsx(
|
|
120
|
+
"source",
|
|
121
|
+
{
|
|
122
|
+
src,
|
|
123
|
+
type: "application/x-mpegURL",
|
|
124
|
+
...media ? { media } : {}
|
|
125
|
+
},
|
|
126
|
+
i
|
|
127
|
+
))
|
|
108
128
|
}
|
|
109
129
|
),
|
|
110
130
|
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ jsx(
|
package/dist/index.js
CHANGED
|
@@ -281,6 +281,7 @@ 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,
|
|
@@ -295,12 +296,14 @@ var init_HlsPlayer = __esm({
|
|
|
295
296
|
const [isHovered, setIsHovered] = (0, import_react33.useState)(false);
|
|
296
297
|
const [isMobile, setIsMobile] = (0, import_react33.useState)(false);
|
|
297
298
|
const wasManuallyPausedRef = (0, import_react33.useRef)(false);
|
|
299
|
+
const resolvedSources = sources && sources.length > 0 ? sources : assetUrl ? [{ src: assetUrl }] : [];
|
|
298
300
|
(0, import_react33.useEffect)(() => {
|
|
299
301
|
const checkMobile = () => {
|
|
300
302
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
301
303
|
const isSmallScreen = window.innerWidth <= 768;
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(
|
|
305
|
+
navigator.userAgent.toLowerCase()
|
|
306
|
+
);
|
|
304
307
|
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
305
308
|
};
|
|
306
309
|
checkMobile();
|
|
@@ -309,31 +312,39 @@ var init_HlsPlayer = __esm({
|
|
|
309
312
|
}, []);
|
|
310
313
|
(0, import_react33.useEffect)(() => {
|
|
311
314
|
const v = videoRef.current;
|
|
312
|
-
if (!v ||
|
|
315
|
+
if (!v || resolvedSources.length === 0) return;
|
|
313
316
|
if (hlsRef.current) {
|
|
314
317
|
hlsRef.current.destroy();
|
|
315
318
|
hlsRef.current = null;
|
|
316
319
|
}
|
|
317
320
|
if (import_hls.default.isSupported()) {
|
|
318
321
|
const hls = new import_hls.default();
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
322
|
+
const onLoadStart = () => {
|
|
323
|
+
const chosenSrc = v.currentSrc;
|
|
324
|
+
if (!chosenSrc) return;
|
|
325
|
+
hls.loadSource(chosenSrc);
|
|
326
|
+
hls.attachMedia(v);
|
|
327
|
+
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
328
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
329
|
+
v.play().catch(console.error);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
v.addEventListener("loadstart", onLoadStart, { once: true });
|
|
334
|
+
v.load();
|
|
326
335
|
hlsRef.current = hls;
|
|
336
|
+
return () => {
|
|
337
|
+
v.removeEventListener("loadstart", onLoadStart);
|
|
338
|
+
hls.destroy();
|
|
339
|
+
hlsRef.current = null;
|
|
340
|
+
};
|
|
327
341
|
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
328
342
|
v.load();
|
|
329
343
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}, [assetUrl]);
|
|
344
|
+
}, [
|
|
345
|
+
// Serialise the source array so the dependency is a stable primitive.
|
|
346
|
+
JSON.stringify(resolvedSources)
|
|
347
|
+
]);
|
|
337
348
|
const handlePlayPause = (0, import_react33.useCallback)(() => {
|
|
338
349
|
const v = videoRef.current;
|
|
339
350
|
if (!v) return;
|
|
@@ -362,6 +373,7 @@ var init_HlsPlayer = __esm({
|
|
|
362
373
|
setIsPlaying(false);
|
|
363
374
|
}
|
|
364
375
|
}, [playOptions, isMobile]);
|
|
376
|
+
if (resolvedSources.length === 0) return null;
|
|
365
377
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
366
378
|
"div",
|
|
367
379
|
{
|
|
@@ -381,7 +393,15 @@ var init_HlsPlayer = __esm({
|
|
|
381
393
|
loop,
|
|
382
394
|
playsInline: true,
|
|
383
395
|
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0,
|
|
384
|
-
children:
|
|
396
|
+
children: resolvedSources.map(({ src, media }, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
397
|
+
"source",
|
|
398
|
+
{
|
|
399
|
+
src,
|
|
400
|
+
type: "application/x-mpegURL",
|
|
401
|
+
...media ? { media } : {}
|
|
402
|
+
},
|
|
403
|
+
i
|
|
404
|
+
))
|
|
385
405
|
}
|
|
386
406
|
),
|
|
387
407
|
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
@@ -3395,7 +3415,7 @@ var DataList = (props) => {
|
|
|
3395
3415
|
var DataList_default = DataList;
|
|
3396
3416
|
|
|
3397
3417
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3398
|
-
var
|
|
3418
|
+
var import_react51 = __toESM(require("react"));
|
|
3399
3419
|
|
|
3400
3420
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3401
3421
|
var import_react37 = __toESM(require("react"));
|
|
@@ -4406,7 +4426,7 @@ var FormContainerNode = (props) => {
|
|
|
4406
4426
|
var FormContainerNode_default = FormContainerNode;
|
|
4407
4427
|
|
|
4408
4428
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4409
|
-
var
|
|
4429
|
+
var import_react50 = __toESM(require("react"));
|
|
4410
4430
|
|
|
4411
4431
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4412
4432
|
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
@@ -5104,40 +5124,30 @@ var Pagination = (props) => {
|
|
|
5104
5124
|
var Pagination_default = Pagination;
|
|
5105
5125
|
|
|
5106
5126
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
5107
|
-
var import_react50 = __toESM(require("react"));
|
|
5108
5127
|
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5109
5128
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5110
5129
|
var HlsPlayer3 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5111
5130
|
var deviceToMediaQuery = (device) => {
|
|
5112
5131
|
switch (device) {
|
|
5113
5132
|
case "sm":
|
|
5114
|
-
return "(max-width:
|
|
5133
|
+
return "(max-width: 767px)";
|
|
5115
5134
|
case "md":
|
|
5116
|
-
return "(
|
|
5135
|
+
return "(min-width: 768px) and (max-width: 1199px)";
|
|
5117
5136
|
case "lg":
|
|
5118
|
-
return "(min-width:
|
|
5119
|
-
|
|
5120
|
-
|
|
5137
|
+
return "(min-width: 1200px) and (max-width: 1919px)";
|
|
5138
|
+
case "tv":
|
|
5139
|
+
return "(min-width: 1920px)";
|
|
5121
5140
|
default:
|
|
5122
5141
|
return null;
|
|
5123
5142
|
}
|
|
5124
5143
|
};
|
|
5144
|
+
var DEVICE_ORDER = ["sm", "md", "lg", "tv"];
|
|
5125
5145
|
var parseMaybeNumber = (value) => {
|
|
5126
|
-
if (typeof value === "number")
|
|
5127
|
-
return Number.isFinite(value) ? value : void 0;
|
|
5128
|
-
}
|
|
5146
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
5129
5147
|
if (typeof value !== "string") return void 0;
|
|
5130
5148
|
const n = Number(value);
|
|
5131
5149
|
return Number.isFinite(n) ? n : void 0;
|
|
5132
5150
|
};
|
|
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
5151
|
var ImageGalleryNode = (props) => {
|
|
5142
5152
|
const resolveImageUrl = (imageUrl) => {
|
|
5143
5153
|
if (!imageUrl) return "";
|
|
@@ -5157,49 +5167,49 @@ var ImageGalleryNode = (props) => {
|
|
|
5157
5167
|
const staticImages = rawImages.filter(
|
|
5158
5168
|
(img) => !resolveImageUrl(img.imageUrl).endsWith(".m3u8")
|
|
5159
5169
|
);
|
|
5160
|
-
const
|
|
5170
|
+
const hlsSources = [
|
|
5171
|
+
// Constrained sources in breakpoint order (narrowest first).
|
|
5172
|
+
...DEVICE_ORDER.flatMap((deviceKey) => {
|
|
5173
|
+
const img = hlsImages.find((i) => i.device === deviceKey);
|
|
5174
|
+
if (!img) return [];
|
|
5175
|
+
const src = resolveImageUrl(img.imageUrl);
|
|
5176
|
+
if (!src) return [];
|
|
5177
|
+
const media = deviceToMediaQuery(img.device);
|
|
5178
|
+
return [{ src, ...media ? { media } : {} }];
|
|
5179
|
+
}),
|
|
5180
|
+
// Unconstrained fallback(s) — no media attr, always matches.
|
|
5181
|
+
...hlsImages.filter((img) => !img.device).map((img) => ({ src: resolveImageUrl(img.imageUrl) })).filter((s) => !!s.src)
|
|
5182
|
+
];
|
|
5183
|
+
const primaryHls = hlsImages.find((img) => !img.device) ?? hlsImages[0];
|
|
5184
|
+
const hlsPosterUrl = primaryHls ? resolvePosterUrl(primaryHls.posterUrl) : void 0;
|
|
5185
|
+
const hlsIntrinsicWidth = primaryHls ? parseMaybeNumber(primaryHls.intrinsicWidth)?.toString() : void 0;
|
|
5186
|
+
const hlsIntrinsicHeight = primaryHls ? parseMaybeNumber(primaryHls.intrinsicHeight)?.toString() : void 0;
|
|
5187
|
+
const staticSources = staticImages.filter((img) => !!img.device);
|
|
5188
|
+
const staticFallback = staticImages.find((img) => !img.device) ?? staticImages[0] ?? null;
|
|
5161
5189
|
const FormatClass = {
|
|
5162
5190
|
center: "justify-center",
|
|
5163
5191
|
left: "justify-start",
|
|
5164
5192
|
right: "justify-end"
|
|
5165
5193
|
};
|
|
5166
5194
|
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
|
-
|
|
5184
|
-
|
|
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
|
-
}),
|
|
5198
|
-
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("picture", { children: [
|
|
5199
|
-
["sm", "md", "lg", "tv"].map((deviceKey) => {
|
|
5200
|
-
const match = staticSources.find(
|
|
5201
|
-
(img) => img.device === deviceKey
|
|
5202
|
-
);
|
|
5195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: [
|
|
5196
|
+
hlsSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "max-w-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5197
|
+
HlsPlayer3,
|
|
5198
|
+
{
|
|
5199
|
+
sources: hlsSources,
|
|
5200
|
+
posterUrl: hlsPosterUrl,
|
|
5201
|
+
intrinsicWidth: hlsIntrinsicWidth,
|
|
5202
|
+
intrinsicHeight: hlsIntrinsicHeight,
|
|
5203
|
+
showControls: true,
|
|
5204
|
+
loop: false,
|
|
5205
|
+
playOptions: void 0,
|
|
5206
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
5207
|
+
session: props.session
|
|
5208
|
+
}
|
|
5209
|
+
) }),
|
|
5210
|
+
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("picture", { children: [
|
|
5211
|
+
DEVICE_ORDER.map((deviceKey) => {
|
|
5212
|
+
const match = staticSources.find((img) => img.device === deviceKey);
|
|
5203
5213
|
if (!match) return null;
|
|
5204
5214
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
5205
5215
|
if (!srcUrl) return null;
|
|
@@ -5227,7 +5237,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5227
5237
|
if (img.width) styles.width = img.width;
|
|
5228
5238
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
5229
5239
|
return (
|
|
5230
|
-
|
|
5240
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
5231
5241
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5232
5242
|
"img",
|
|
5233
5243
|
{
|
|
@@ -5471,7 +5481,7 @@ var DivContainer = async (props) => {
|
|
|
5471
5481
|
}
|
|
5472
5482
|
const SelectedNode = NodeTypes2[node.type];
|
|
5473
5483
|
if (!SelectedNode) return null;
|
|
5474
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5475
5485
|
SelectedNode,
|
|
5476
5486
|
{
|
|
5477
5487
|
node,
|
|
@@ -5573,9 +5583,9 @@ var DivContainer = async (props) => {
|
|
|
5573
5583
|
props.node.autoFormat && "auto-format",
|
|
5574
5584
|
props.node.bgClass
|
|
5575
5585
|
].filter(Boolean).join(" ");
|
|
5576
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react50.default.Fragment, { children: [
|
|
5577
5587
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5578
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5588
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5579
5589
|
Wrapper,
|
|
5580
5590
|
{
|
|
5581
5591
|
id: guid,
|
|
@@ -5584,7 +5594,7 @@ var DivContainer = async (props) => {
|
|
|
5584
5594
|
...wrapperProps,
|
|
5585
5595
|
children: dataToRender.map(
|
|
5586
5596
|
(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)(
|
|
5597
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: child }, i)
|
|
5588
5598
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5589
5599
|
)
|
|
5590
5600
|
}
|
|
@@ -5623,11 +5633,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5623
5633
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5624
5634
|
rootNode = pageBodyTree.root;
|
|
5625
5635
|
}
|
|
5626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5627
5637
|
{
|
|
5628
5638
|
}
|
|
5629
5639
|
const SelectedNode = NodeTypes[node.type];
|
|
5630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5640
|
+
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
5641
|
SelectedNode,
|
|
5632
5642
|
{
|
|
5633
5643
|
node,
|
|
@@ -5643,7 +5653,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5643
5653
|
device: props.device,
|
|
5644
5654
|
widgetRenderer: props.widgetRenderer
|
|
5645
5655
|
}
|
|
5646
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5656
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5647
5657
|
SelectedNode,
|
|
5648
5658
|
{
|
|
5649
5659
|
node,
|
|
@@ -5664,13 +5674,13 @@ var PageBodyRenderer = (props) => {
|
|
|
5664
5674
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5665
5675
|
|
|
5666
5676
|
// src/components/Toast.tsx
|
|
5667
|
-
var
|
|
5677
|
+
var import_react52 = require("react");
|
|
5668
5678
|
init_ToastService();
|
|
5669
5679
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5670
5680
|
var Toast = () => {
|
|
5671
|
-
const [showToast, setShowToast] = (0,
|
|
5672
|
-
const [message, setMessage] = (0,
|
|
5673
|
-
const [messageType, setMessageType] = (0,
|
|
5681
|
+
const [showToast, setShowToast] = (0, import_react52.useState)(false);
|
|
5682
|
+
const [message, setMessage] = (0, import_react52.useState)("");
|
|
5683
|
+
const [messageType, setMessageType] = (0, import_react52.useState)("error");
|
|
5674
5684
|
ToastService_default.showError = function(message2) {
|
|
5675
5685
|
setShowToast(true);
|
|
5676
5686
|
setMessage(message2);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HlsPlayer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6C4HXWFR.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-LIFSWOII.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,40 +4105,30 @@ 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
|
-
import {
|
|
4111
|
-
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-
|
|
4109
|
+
import { jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4110
|
+
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-LIFSWOII.mjs"), { ssr: false });
|
|
4112
4111
|
var deviceToMediaQuery = (device) => {
|
|
4113
4112
|
switch (device) {
|
|
4114
4113
|
case "sm":
|
|
4115
|
-
return "(max-width:
|
|
4114
|
+
return "(max-width: 767px)";
|
|
4116
4115
|
case "md":
|
|
4117
|
-
return "(
|
|
4116
|
+
return "(min-width: 768px) and (max-width: 1199px)";
|
|
4118
4117
|
case "lg":
|
|
4119
|
-
return "(min-width:
|
|
4120
|
-
|
|
4121
|
-
|
|
4118
|
+
return "(min-width: 1200px) and (max-width: 1919px)";
|
|
4119
|
+
case "tv":
|
|
4120
|
+
return "(min-width: 1920px)";
|
|
4122
4121
|
default:
|
|
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,49 @@ 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
|
-
|
|
4185
|
-
|
|
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
|
-
}),
|
|
4199
|
-
staticFallback && /* @__PURE__ */ jsx58(Fragment9, { children: /* @__PURE__ */ jsxs33("picture", { children: [
|
|
4200
|
-
["sm", "md", "lg", "tv"].map((deviceKey) => {
|
|
4201
|
-
const match = staticSources.find(
|
|
4202
|
-
(img) => img.device === deviceKey
|
|
4203
|
-
);
|
|
4176
|
+
return /* @__PURE__ */ jsxs33("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: [
|
|
4177
|
+
hlsSources.length > 0 && /* @__PURE__ */ jsx58("div", { className: "max-w-full w-full", children: /* @__PURE__ */ jsx58(
|
|
4178
|
+
HlsPlayer2,
|
|
4179
|
+
{
|
|
4180
|
+
sources: hlsSources,
|
|
4181
|
+
posterUrl: hlsPosterUrl,
|
|
4182
|
+
intrinsicWidth: hlsIntrinsicWidth,
|
|
4183
|
+
intrinsicHeight: hlsIntrinsicHeight,
|
|
4184
|
+
showControls: true,
|
|
4185
|
+
loop: false,
|
|
4186
|
+
playOptions: void 0,
|
|
4187
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4188
|
+
session: props.session
|
|
4189
|
+
}
|
|
4190
|
+
) }),
|
|
4191
|
+
staticFallback && /* @__PURE__ */ jsx58("div", { className: "max-w-full", children: /* @__PURE__ */ jsxs33("picture", { children: [
|
|
4192
|
+
DEVICE_ORDER.map((deviceKey) => {
|
|
4193
|
+
const match = staticSources.find((img) => img.device === deviceKey);
|
|
4204
4194
|
if (!match) return null;
|
|
4205
4195
|
const srcUrl = resolveImageUrl(match.imageUrl);
|
|
4206
4196
|
if (!srcUrl) return null;
|
|
@@ -4228,7 +4218,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4228
4218
|
if (img.width) styles.width = img.width;
|
|
4229
4219
|
if (img.borderRadius) styles.borderRadius = img.borderRadius;
|
|
4230
4220
|
return (
|
|
4231
|
-
|
|
4221
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
4232
4222
|
/* @__PURE__ */ jsx58(
|
|
4233
4223
|
"img",
|
|
4234
4224
|
{
|
|
@@ -4472,7 +4462,7 @@ var DivContainer = async (props) => {
|
|
|
4472
4462
|
}
|
|
4473
4463
|
const SelectedNode = NodeTypes2[node.type];
|
|
4474
4464
|
if (!SelectedNode) return null;
|
|
4475
|
-
return /* @__PURE__ */ jsx59(
|
|
4465
|
+
return /* @__PURE__ */ jsx59(React42.Fragment, { children: /* @__PURE__ */ jsx59(
|
|
4476
4466
|
SelectedNode,
|
|
4477
4467
|
{
|
|
4478
4468
|
node,
|
|
@@ -4574,9 +4564,9 @@ var DivContainer = async (props) => {
|
|
|
4574
4564
|
props.node.autoFormat && "auto-format",
|
|
4575
4565
|
props.node.bgClass
|
|
4576
4566
|
].filter(Boolean).join(" ");
|
|
4577
|
-
return /* @__PURE__ */ jsxs34(
|
|
4567
|
+
return /* @__PURE__ */ jsxs34(React42.Fragment, { children: [
|
|
4578
4568
|
/* @__PURE__ */ jsx59("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4579
|
-
/* @__PURE__ */ jsx59(
|
|
4569
|
+
/* @__PURE__ */ jsx59(React42.Fragment, { children: /* @__PURE__ */ jsx59(
|
|
4580
4570
|
Wrapper,
|
|
4581
4571
|
{
|
|
4582
4572
|
id: guid,
|
|
@@ -4585,7 +4575,7 @@ var DivContainer = async (props) => {
|
|
|
4585
4575
|
...wrapperProps,
|
|
4586
4576
|
children: dataToRender.map(
|
|
4587
4577
|
(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(
|
|
4578
|
+
(child, i) => /* @__PURE__ */ jsx59(React42.Fragment, { children: child }, i)
|
|
4589
4579
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4590
4580
|
)
|
|
4591
4581
|
}
|
|
@@ -4624,11 +4614,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4624
4614
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4625
4615
|
rootNode = pageBodyTree.root;
|
|
4626
4616
|
}
|
|
4627
|
-
return /* @__PURE__ */ jsx60(
|
|
4617
|
+
return /* @__PURE__ */ jsx60(React43.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4628
4618
|
{
|
|
4629
4619
|
}
|
|
4630
4620
|
const SelectedNode = NodeTypes[node.type];
|
|
4631
|
-
return /* @__PURE__ */ jsx60(
|
|
4621
|
+
return /* @__PURE__ */ jsx60(React43.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx60(React43.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx60(React43.Fragment, { children: /* @__PURE__ */ jsx60(
|
|
4632
4622
|
SelectedNode,
|
|
4633
4623
|
{
|
|
4634
4624
|
node,
|
|
@@ -4644,7 +4634,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4644
4634
|
device: props.device,
|
|
4645
4635
|
widgetRenderer: props.widgetRenderer
|
|
4646
4636
|
}
|
|
4647
|
-
) }) : /* @__PURE__ */ jsx60(
|
|
4637
|
+
) }) : /* @__PURE__ */ jsx60(React43.Fragment, { children: /* @__PURE__ */ jsx60(
|
|
4648
4638
|
SelectedNode,
|
|
4649
4639
|
{
|
|
4650
4640
|
node,
|
|
@@ -4666,7 +4656,7 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
4666
4656
|
|
|
4667
4657
|
// src/components/Toast.tsx
|
|
4668
4658
|
import { useState as useState8 } from "react";
|
|
4669
|
-
import { Fragment as
|
|
4659
|
+
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4670
4660
|
var Toast = () => {
|
|
4671
4661
|
const [showToast, setShowToast] = useState8(false);
|
|
4672
4662
|
const [message, setMessage] = useState8("");
|
|
@@ -4709,7 +4699,7 @@ var Toast = () => {
|
|
|
4709
4699
|
const closeToast = () => {
|
|
4710
4700
|
setShowToast(false);
|
|
4711
4701
|
};
|
|
4712
|
-
return /* @__PURE__ */ jsx61(
|
|
4702
|
+
return /* @__PURE__ */ jsx61(Fragment9, { children: showToast && /* @__PURE__ */ jsx61("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs35("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
4713
4703
|
/* @__PURE__ */ jsx61(
|
|
4714
4704
|
"span",
|
|
4715
4705
|
{
|
package/package.json
CHANGED