@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260325073346 → 0.8.1-dev.20260325110100
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/CopyButton-XONTQQW7.mjs +55 -0
- package/dist/HlsPlayer-FFEIK6FG.mjs +7 -0
- package/dist/chunk-CVVLFQ4J.mjs +131 -0
- package/dist/index.js +243 -192
- package/dist/index.mjs +148 -295
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,207 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
+
// src/components/CopyButton.tsx
|
|
34
|
+
var CopyButton_exports = {};
|
|
35
|
+
__export(CopyButton_exports, {
|
|
36
|
+
default: () => CopyButton
|
|
37
|
+
});
|
|
38
|
+
function CopyButton({ text }) {
|
|
39
|
+
const [copied, setCopied] = (0, import_react41.useState)(false);
|
|
40
|
+
const timeoutRef = (0, import_react41.useRef)(null);
|
|
41
|
+
(0, import_react41.useEffect)(() => {
|
|
42
|
+
return () => {
|
|
43
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
const handleCopy = async () => {
|
|
47
|
+
try {
|
|
48
|
+
await navigator.clipboard.writeText(text);
|
|
49
|
+
setCopied(true);
|
|
50
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
51
|
+
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error("Failed to copy: ", err);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
onClick: handleCopy,
|
|
60
|
+
className: "flex gap-1 items-center hover:text-white transition",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
63
|
+
"svg",
|
|
64
|
+
{
|
|
65
|
+
width: "16",
|
|
66
|
+
height: "16",
|
|
67
|
+
viewBox: "0 0 24 24",
|
|
68
|
+
className: "w-4 h-4",
|
|
69
|
+
fill: "currentColor",
|
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
71
|
+
"path",
|
|
72
|
+
{
|
|
73
|
+
fillRule: "evenodd",
|
|
74
|
+
clipRule: "evenodd",
|
|
75
|
+
d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
copied ? "Copied!" : "Copy code"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
var import_react41, import_jsx_runtime52;
|
|
86
|
+
var init_CopyButton = __esm({
|
|
87
|
+
"src/components/CopyButton.tsx"() {
|
|
88
|
+
"use strict";
|
|
89
|
+
"use client";
|
|
90
|
+
import_react41 = require("react");
|
|
91
|
+
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// src/components/HlsPlayer.tsx
|
|
96
|
+
var HlsPlayer_exports = {};
|
|
97
|
+
__export(HlsPlayer_exports, {
|
|
98
|
+
default: () => HlsPlayer_default
|
|
99
|
+
});
|
|
100
|
+
var import_react43, import_hls, import_jsx_runtime55, HlsPlayer, HlsPlayer_default;
|
|
101
|
+
var init_HlsPlayer = __esm({
|
|
102
|
+
"src/components/HlsPlayer.tsx"() {
|
|
103
|
+
"use strict";
|
|
104
|
+
"use client";
|
|
105
|
+
import_react43 = __toESM(require("react"));
|
|
106
|
+
import_hls = __toESM(require("hls.js"));
|
|
107
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
108
|
+
HlsPlayer = import_react43.default.memo(
|
|
109
|
+
({
|
|
110
|
+
assetUrl,
|
|
111
|
+
posterUrl,
|
|
112
|
+
intrinsicWidth,
|
|
113
|
+
intrinsicHeight,
|
|
114
|
+
showControls = true,
|
|
115
|
+
loop = false,
|
|
116
|
+
playOptions = "autoplay"
|
|
117
|
+
}) => {
|
|
118
|
+
const videoRef = (0, import_react43.useRef)(null);
|
|
119
|
+
const hlsRef = (0, import_react43.useRef)(null);
|
|
120
|
+
const [isPlaying, setIsPlaying] = (0, import_react43.useState)(playOptions === "autoplay");
|
|
121
|
+
const [isHovered, setIsHovered] = (0, import_react43.useState)(false);
|
|
122
|
+
const [isMobile, setIsMobile] = (0, import_react43.useState)(false);
|
|
123
|
+
const wasManuallyPausedRef = (0, import_react43.useRef)(false);
|
|
124
|
+
(0, import_react43.useEffect)(() => {
|
|
125
|
+
const checkMobile = () => {
|
|
126
|
+
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
127
|
+
const isSmallScreen = window.innerWidth <= 768;
|
|
128
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
129
|
+
const isMobileUA = /android|iphone|ipad|ipod/i.test(ua);
|
|
130
|
+
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
131
|
+
};
|
|
132
|
+
checkMobile();
|
|
133
|
+
window.addEventListener("resize", checkMobile);
|
|
134
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
135
|
+
}, []);
|
|
136
|
+
(0, import_react43.useEffect)(() => {
|
|
137
|
+
const v = videoRef.current;
|
|
138
|
+
if (!v || !assetUrl) return;
|
|
139
|
+
if (hlsRef.current) {
|
|
140
|
+
hlsRef.current.destroy();
|
|
141
|
+
hlsRef.current = null;
|
|
142
|
+
}
|
|
143
|
+
if (import_hls.default.isSupported()) {
|
|
144
|
+
const hls = new import_hls.default();
|
|
145
|
+
hls.loadSource(assetUrl);
|
|
146
|
+
hls.attachMedia(v);
|
|
147
|
+
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
148
|
+
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
149
|
+
v.play().catch(console.error);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
hlsRef.current = hls;
|
|
153
|
+
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
154
|
+
v.src = assetUrl;
|
|
155
|
+
}
|
|
156
|
+
}, [assetUrl, isPlaying]);
|
|
157
|
+
const handlePlayPause = (0, import_react43.useCallback)(() => {
|
|
158
|
+
const v = videoRef.current;
|
|
159
|
+
if (!v) return;
|
|
160
|
+
if (v.paused) {
|
|
161
|
+
wasManuallyPausedRef.current = false;
|
|
162
|
+
v.play().then(() => setIsPlaying(true));
|
|
163
|
+
} else {
|
|
164
|
+
wasManuallyPausedRef.current = true;
|
|
165
|
+
v.pause();
|
|
166
|
+
setIsPlaying(false);
|
|
167
|
+
}
|
|
168
|
+
}, []);
|
|
169
|
+
const handleMouseEnter = (0, import_react43.useCallback)(() => {
|
|
170
|
+
if (isMobile) return;
|
|
171
|
+
setIsHovered(true);
|
|
172
|
+
if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
|
|
173
|
+
videoRef.current.play().then(() => setIsPlaying(true));
|
|
174
|
+
}
|
|
175
|
+
}, [playOptions, isMobile]);
|
|
176
|
+
const handleMouseLeave = (0, import_react43.useCallback)(() => {
|
|
177
|
+
if (isMobile) return;
|
|
178
|
+
setIsHovered(false);
|
|
179
|
+
if (playOptions === "playOnHover" && videoRef.current) {
|
|
180
|
+
videoRef.current.pause();
|
|
181
|
+
videoRef.current.currentTime = 0;
|
|
182
|
+
setIsPlaying(false);
|
|
183
|
+
}
|
|
184
|
+
}, [playOptions, isMobile]);
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: "relative w-full aspect-video bg-black",
|
|
189
|
+
onMouseEnter: handleMouseEnter,
|
|
190
|
+
onMouseLeave: handleMouseLeave,
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
193
|
+
"video",
|
|
194
|
+
{
|
|
195
|
+
ref: videoRef,
|
|
196
|
+
className: "w-full h-full object-contain",
|
|
197
|
+
poster: posterUrl,
|
|
198
|
+
controls: showControls && (isMobile || isPlaying),
|
|
199
|
+
muted: playOptions === "autoplay" || playOptions === "playOnHover",
|
|
200
|
+
autoPlay: playOptions === "autoplay",
|
|
201
|
+
loop,
|
|
202
|
+
playsInline: true,
|
|
203
|
+
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
207
|
+
"img",
|
|
208
|
+
{
|
|
209
|
+
src: posterUrl,
|
|
210
|
+
width: intrinsicWidth,
|
|
211
|
+
height: intrinsicHeight,
|
|
212
|
+
alt: "poster",
|
|
213
|
+
className: `absolute inset-0 object-cover transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
!isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
className: "absolute inset-0 flex items-center justify-center cursor-pointer",
|
|
220
|
+
onClick: handlePlayPause,
|
|
221
|
+
children: "\u25B6"
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
HlsPlayer.displayName = "HlsPlayer";
|
|
230
|
+
HlsPlayer_default = HlsPlayer;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
33
234
|
// src/components/IFrameLoaderView.tsx
|
|
34
235
|
var import_react46, import_jsx_runtime61, IFrameLoaderView, IFrameLoaderView_default;
|
|
35
236
|
var init_IFrameLoaderView = __esm({
|
|
@@ -3086,67 +3287,18 @@ var QuoteNode_default = QuoteNode;
|
|
|
3086
3287
|
|
|
3087
3288
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3088
3289
|
var import_react42 = __toESM(require("react"));
|
|
3089
|
-
|
|
3090
|
-
// src/components/CopyButton.tsx
|
|
3091
|
-
var import_react41 = require("react");
|
|
3092
|
-
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3093
|
-
function CopyButton({ text }) {
|
|
3094
|
-
const [copied, setCopied] = (0, import_react41.useState)(false);
|
|
3095
|
-
const timeoutRef = (0, import_react41.useRef)(null);
|
|
3096
|
-
(0, import_react41.useEffect)(() => {
|
|
3097
|
-
return () => {
|
|
3098
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3099
|
-
};
|
|
3100
|
-
}, []);
|
|
3101
|
-
const handleCopy = async () => {
|
|
3102
|
-
try {
|
|
3103
|
-
await navigator.clipboard.writeText(text);
|
|
3104
|
-
setCopied(true);
|
|
3105
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3106
|
-
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
3107
|
-
} catch (err) {
|
|
3108
|
-
console.error("Failed to copy: ", err);
|
|
3109
|
-
}
|
|
3110
|
-
};
|
|
3111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3112
|
-
"button",
|
|
3113
|
-
{
|
|
3114
|
-
onClick: handleCopy,
|
|
3115
|
-
className: "flex gap-1 items-center hover:text-white transition",
|
|
3116
|
-
children: [
|
|
3117
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3118
|
-
"svg",
|
|
3119
|
-
{
|
|
3120
|
-
width: "16",
|
|
3121
|
-
height: "16",
|
|
3122
|
-
viewBox: "0 0 24 24",
|
|
3123
|
-
className: "w-4 h-4",
|
|
3124
|
-
fill: "currentColor",
|
|
3125
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3126
|
-
"path",
|
|
3127
|
-
{
|
|
3128
|
-
fillRule: "evenodd",
|
|
3129
|
-
clipRule: "evenodd",
|
|
3130
|
-
d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
|
|
3131
|
-
}
|
|
3132
|
-
)
|
|
3133
|
-
}
|
|
3134
|
-
),
|
|
3135
|
-
copied ? "Copied!" : "Copy code"
|
|
3136
|
-
]
|
|
3137
|
-
}
|
|
3138
|
-
);
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3290
|
+
var import_dynamic = __toESM(require("next/dynamic"));
|
|
3142
3291
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3292
|
+
var CopyButton2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
3293
|
+
ssr: false,
|
|
3294
|
+
// optional: fallback UI while loading
|
|
3295
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
3296
|
+
});
|
|
3143
3297
|
var CodeNode = (props) => {
|
|
3144
3298
|
const NodeTypes2 = {
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
// @ts-expect-error custom code
|
|
3149
|
-
["link"]: LinkNode_default
|
|
3299
|
+
text: TextNode_default,
|
|
3300
|
+
linebreak: LineBreakNode_default,
|
|
3301
|
+
link: LinkNode_default
|
|
3150
3302
|
};
|
|
3151
3303
|
const textContent = props.node?.children?.map((node) => {
|
|
3152
3304
|
if (node.type === "text") return node.text || "";
|
|
@@ -3157,11 +3309,19 @@ var CodeNode = (props) => {
|
|
|
3157
3309
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "code-block", children: [
|
|
3158
3310
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center relative text-gray-200 bg-gray-800 px-4 py-2.5 text-xs font-sans justify-between rounded-t-md", children: [
|
|
3159
3311
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Code Snippet" }),
|
|
3160
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3312
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CopyButton2, { text: textContent })
|
|
3161
3313
|
] }),
|
|
3162
3314
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("code", { className: "block bg-gray-900 text-gray-100 p-4 rounded-b-md text-sm whitespace-pre-wrap", children: props.node.children && props.node.children.map((node, index) => {
|
|
3163
3315
|
const SelectedNode = NodeTypes2[node.type];
|
|
3164
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3317
|
+
SelectedNode,
|
|
3318
|
+
{
|
|
3319
|
+
node,
|
|
3320
|
+
session: props.session,
|
|
3321
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3322
|
+
routeParameters: props.routeParameters
|
|
3323
|
+
}
|
|
3324
|
+
) }, index);
|
|
3165
3325
|
}) })
|
|
3166
3326
|
] });
|
|
3167
3327
|
};
|
|
@@ -3187,138 +3347,22 @@ var AssetUtility = class {
|
|
|
3187
3347
|
if (!apiBaseUrl) return url;
|
|
3188
3348
|
return `${apiBaseUrl}/${url}`;
|
|
3189
3349
|
}
|
|
3350
|
+
static getAssetUrl(apiBaseUrl) {
|
|
3351
|
+
let domainName = apiBaseUrl.replace("https://", "");
|
|
3352
|
+
return `https://cdn.g-assets.com/${domainName}`;
|
|
3353
|
+
}
|
|
3354
|
+
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
3355
|
+
let domainName = apiBaseUrl.replace("https://", "");
|
|
3356
|
+
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
3357
|
+
}
|
|
3190
3358
|
};
|
|
3191
3359
|
var AssetUtility_default = AssetUtility;
|
|
3192
3360
|
|
|
3193
|
-
// src/components/
|
|
3194
|
-
var
|
|
3195
|
-
var import_hls = __toESM(require("hls.js"));
|
|
3196
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3197
|
-
var HlsPlayer = import_react43.default.memo(
|
|
3198
|
-
({
|
|
3199
|
-
assetUrl,
|
|
3200
|
-
posterUrl,
|
|
3201
|
-
intrinsicWidth,
|
|
3202
|
-
intrinsicHeight,
|
|
3203
|
-
showControls = true,
|
|
3204
|
-
loop = false,
|
|
3205
|
-
playOptions = "autoplay"
|
|
3206
|
-
}) => {
|
|
3207
|
-
const videoRef = (0, import_react43.useRef)(null);
|
|
3208
|
-
const hlsRef = (0, import_react43.useRef)(null);
|
|
3209
|
-
const [isPlaying, setIsPlaying] = (0, import_react43.useState)(playOptions === "autoplay");
|
|
3210
|
-
const [isHovered, setIsHovered] = (0, import_react43.useState)(false);
|
|
3211
|
-
const [isMobile, setIsMobile] = (0, import_react43.useState)(false);
|
|
3212
|
-
const wasManuallyPausedRef = (0, import_react43.useRef)(false);
|
|
3213
|
-
(0, import_react43.useEffect)(() => {
|
|
3214
|
-
const checkMobile = () => {
|
|
3215
|
-
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
3216
|
-
const isSmallScreen = window.innerWidth <= 768;
|
|
3217
|
-
const ua = navigator.userAgent.toLowerCase();
|
|
3218
|
-
const isMobileUA = /android|iphone|ipad|ipod/i.test(ua);
|
|
3219
|
-
setIsMobile(hasTouch || isSmallScreen || isMobileUA);
|
|
3220
|
-
};
|
|
3221
|
-
checkMobile();
|
|
3222
|
-
window.addEventListener("resize", checkMobile);
|
|
3223
|
-
return () => window.removeEventListener("resize", checkMobile);
|
|
3224
|
-
}, []);
|
|
3225
|
-
(0, import_react43.useEffect)(() => {
|
|
3226
|
-
const v = videoRef.current;
|
|
3227
|
-
if (!v || !assetUrl) return;
|
|
3228
|
-
if (hlsRef.current) {
|
|
3229
|
-
hlsRef.current.destroy();
|
|
3230
|
-
hlsRef.current = null;
|
|
3231
|
-
}
|
|
3232
|
-
if (import_hls.default.isSupported()) {
|
|
3233
|
-
const hls = new import_hls.default();
|
|
3234
|
-
hls.loadSource(assetUrl);
|
|
3235
|
-
hls.attachMedia(v);
|
|
3236
|
-
hls.on(import_hls.default.Events.MANIFEST_PARSED, () => {
|
|
3237
|
-
if (isPlaying && !wasManuallyPausedRef.current) {
|
|
3238
|
-
v.play().catch(console.error);
|
|
3239
|
-
}
|
|
3240
|
-
});
|
|
3241
|
-
hlsRef.current = hls;
|
|
3242
|
-
} else if (v.canPlayType("application/vnd.apple.mpegurl")) {
|
|
3243
|
-
v.src = assetUrl;
|
|
3244
|
-
}
|
|
3245
|
-
}, [assetUrl, isPlaying]);
|
|
3246
|
-
const handlePlayPause = (0, import_react43.useCallback)(() => {
|
|
3247
|
-
const v = videoRef.current;
|
|
3248
|
-
if (!v) return;
|
|
3249
|
-
if (v.paused) {
|
|
3250
|
-
wasManuallyPausedRef.current = false;
|
|
3251
|
-
v.play().then(() => setIsPlaying(true));
|
|
3252
|
-
} else {
|
|
3253
|
-
wasManuallyPausedRef.current = true;
|
|
3254
|
-
v.pause();
|
|
3255
|
-
setIsPlaying(false);
|
|
3256
|
-
}
|
|
3257
|
-
}, []);
|
|
3258
|
-
const handleMouseEnter = (0, import_react43.useCallback)(() => {
|
|
3259
|
-
if (isMobile) return;
|
|
3260
|
-
setIsHovered(true);
|
|
3261
|
-
if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
|
|
3262
|
-
videoRef.current.play().then(() => setIsPlaying(true));
|
|
3263
|
-
}
|
|
3264
|
-
}, [playOptions, isMobile]);
|
|
3265
|
-
const handleMouseLeave = (0, import_react43.useCallback)(() => {
|
|
3266
|
-
if (isMobile) return;
|
|
3267
|
-
setIsHovered(false);
|
|
3268
|
-
if (playOptions === "playOnHover" && videoRef.current) {
|
|
3269
|
-
videoRef.current.pause();
|
|
3270
|
-
videoRef.current.currentTime = 0;
|
|
3271
|
-
setIsPlaying(false);
|
|
3272
|
-
}
|
|
3273
|
-
}, [playOptions, isMobile]);
|
|
3274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3275
|
-
"div",
|
|
3276
|
-
{
|
|
3277
|
-
className: "relative w-full aspect-video bg-black",
|
|
3278
|
-
onMouseEnter: handleMouseEnter,
|
|
3279
|
-
onMouseLeave: handleMouseLeave,
|
|
3280
|
-
children: [
|
|
3281
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3282
|
-
"video",
|
|
3283
|
-
{
|
|
3284
|
-
ref: videoRef,
|
|
3285
|
-
className: "w-full h-full object-contain",
|
|
3286
|
-
poster: posterUrl,
|
|
3287
|
-
controls: showControls && (isMobile || isPlaying),
|
|
3288
|
-
muted: playOptions === "autoplay" || playOptions === "playOnHover",
|
|
3289
|
-
autoPlay: playOptions === "autoplay",
|
|
3290
|
-
loop,
|
|
3291
|
-
playsInline: true,
|
|
3292
|
-
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0
|
|
3293
|
-
}
|
|
3294
|
-
),
|
|
3295
|
-
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3296
|
-
"img",
|
|
3297
|
-
{
|
|
3298
|
-
src: posterUrl,
|
|
3299
|
-
width: intrinsicWidth,
|
|
3300
|
-
height: intrinsicHeight,
|
|
3301
|
-
alt: "poster",
|
|
3302
|
-
className: `absolute inset-0 object-cover transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`
|
|
3303
|
-
}
|
|
3304
|
-
),
|
|
3305
|
-
!isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3306
|
-
"div",
|
|
3307
|
-
{
|
|
3308
|
-
className: "absolute inset-0 flex items-center justify-center cursor-pointer",
|
|
3309
|
-
onClick: handlePlayPause,
|
|
3310
|
-
children: "\u25B6"
|
|
3311
|
-
}
|
|
3312
|
-
)
|
|
3313
|
-
]
|
|
3314
|
-
}
|
|
3315
|
-
);
|
|
3316
|
-
}
|
|
3317
|
-
);
|
|
3318
|
-
HlsPlayer.displayName = "HlsPlayer";
|
|
3319
|
-
var HlsPlayer_default = HlsPlayer;
|
|
3361
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3362
|
+
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3320
3363
|
|
|
3321
3364
|
// src/components/DeviceAssetSelector.tsx
|
|
3365
|
+
init_HlsPlayer();
|
|
3322
3366
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3323
3367
|
var DeviceAssetSelector = ({
|
|
3324
3368
|
assets,
|
|
@@ -3403,7 +3447,9 @@ var DeviceAssetSelector = ({
|
|
|
3403
3447
|
intrinsicHeight,
|
|
3404
3448
|
showControls,
|
|
3405
3449
|
loop,
|
|
3406
|
-
playOptions
|
|
3450
|
+
playOptions,
|
|
3451
|
+
apiBaseUrl,
|
|
3452
|
+
session
|
|
3407
3453
|
}
|
|
3408
3454
|
);
|
|
3409
3455
|
} else {
|
|
@@ -3436,6 +3482,9 @@ var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
|
3436
3482
|
|
|
3437
3483
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3438
3484
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3485
|
+
var HlsPlayer2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3486
|
+
ssr: false
|
|
3487
|
+
});
|
|
3439
3488
|
var getNestedValue = (obj, path) => {
|
|
3440
3489
|
if (!obj || !path) return void 0;
|
|
3441
3490
|
return path.split(".").reduce((current, key) => {
|
|
@@ -3525,7 +3574,7 @@ var ImageNode = (props) => {
|
|
|
3525
3574
|
const renderMedia = () => {
|
|
3526
3575
|
if (isHls) {
|
|
3527
3576
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3528
|
-
|
|
3577
|
+
HlsPlayer2,
|
|
3529
3578
|
{
|
|
3530
3579
|
assetUrl: imageUrl,
|
|
3531
3580
|
posterUrl,
|
|
@@ -3533,7 +3582,9 @@ var ImageNode = (props) => {
|
|
|
3533
3582
|
intrinsicHeight: props.node.intrinsicHeight,
|
|
3534
3583
|
showControls: props.node.showControls === "true",
|
|
3535
3584
|
loop: props.node.loop === "true",
|
|
3536
|
-
playOptions: props.node.playOptions
|
|
3585
|
+
playOptions: props.node.playOptions,
|
|
3586
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3587
|
+
session: props.session
|
|
3537
3588
|
}
|
|
3538
3589
|
);
|
|
3539
3590
|
} else {
|
|
@@ -3939,9 +3990,9 @@ var FormContainerNode_default = FormContainerNode;
|
|
|
3939
3990
|
var import_react50 = __toESM(require("react"));
|
|
3940
3991
|
|
|
3941
3992
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3942
|
-
var
|
|
3993
|
+
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
3943
3994
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3944
|
-
var IframeClient2 = (0,
|
|
3995
|
+
var IframeClient2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
3945
3996
|
ssr: false
|
|
3946
3997
|
});
|
|
3947
3998
|
var EmbedNode = (props) => {
|