@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260423063335 → 0.8.1-dev.20260423085135
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.
|
@@ -20,6 +20,7 @@ var HlsPlayer = React.memo(
|
|
|
20
20
|
const [isHovered, setIsHovered] = useState(false);
|
|
21
21
|
const [isMobile, setIsMobile] = useState(false);
|
|
22
22
|
const [isControlsVisible, setIsControlsVisible] = useState(true);
|
|
23
|
+
const [isPosterVisible, setIsPosterVisible] = useState(true);
|
|
23
24
|
const wasManuallyPausedRef = useRef(false);
|
|
24
25
|
const inactivityTimerRef = useRef(null);
|
|
25
26
|
const INACTIVITY_DELAY = 2500;
|
|
@@ -37,6 +38,20 @@ var HlsPlayer = React.memo(
|
|
|
37
38
|
window.addEventListener("resize", checkMobile);
|
|
38
39
|
return () => window.removeEventListener("resize", checkMobile);
|
|
39
40
|
}, []);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const v = videoRef.current;
|
|
43
|
+
if (!v) return;
|
|
44
|
+
const onPlaying = () => setIsPosterVisible(false);
|
|
45
|
+
const onPause = () => {
|
|
46
|
+
if (v.currentTime === 0) setIsPosterVisible(true);
|
|
47
|
+
};
|
|
48
|
+
v.addEventListener("playing", onPlaying);
|
|
49
|
+
v.addEventListener("pause", onPause);
|
|
50
|
+
return () => {
|
|
51
|
+
v.removeEventListener("playing", onPlaying);
|
|
52
|
+
v.removeEventListener("pause", onPause);
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
40
55
|
const resetInactivityTimer = useCallback(() => {
|
|
41
56
|
setIsControlsVisible(true);
|
|
42
57
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -127,6 +142,7 @@ var HlsPlayer = React.memo(
|
|
|
127
142
|
}, [isMobile, resetInactivityTimer]);
|
|
128
143
|
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
129
144
|
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
145
|
+
const isPlayOnHover = playOptions === "playOnHover";
|
|
130
146
|
if (resolvedSources.length === 0) return null;
|
|
131
147
|
return /* @__PURE__ */ jsxs(
|
|
132
148
|
"div",
|
|
@@ -143,7 +159,7 @@ var HlsPlayer = React.memo(
|
|
|
143
159
|
className: "w-full h-full object-contain",
|
|
144
160
|
poster: fallbackPoster,
|
|
145
161
|
controls: showControls && (isMobile || isPlaying),
|
|
146
|
-
muted: playOptions === "autoplay" ||
|
|
162
|
+
muted: playOptions === "autoplay" || isPlayOnHover,
|
|
147
163
|
autoPlay: playOptions === "autoplay",
|
|
148
164
|
loop,
|
|
149
165
|
playsInline: true,
|
|
@@ -159,10 +175,14 @@ var HlsPlayer = React.memo(
|
|
|
159
175
|
))
|
|
160
176
|
}
|
|
161
177
|
),
|
|
162
|
-
!isMobile &&
|
|
178
|
+
!isMobile && fallbackPoster && /* @__PURE__ */ jsxs(
|
|
163
179
|
"picture",
|
|
164
180
|
{
|
|
165
|
-
className:
|
|
181
|
+
className: "absolute inset-0 pointer-events-none",
|
|
182
|
+
style: {
|
|
183
|
+
opacity: isPosterVisible && (!isPlayOnHover || !isHovered) ? 1 : 0,
|
|
184
|
+
transition: "opacity 0.4s ease"
|
|
185
|
+
},
|
|
166
186
|
children: [
|
|
167
187
|
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ jsx("source", { media, srcSet: src }, i)),
|
|
168
188
|
/* @__PURE__ */ jsx(
|
|
@@ -178,7 +198,7 @@ var HlsPlayer = React.memo(
|
|
|
178
198
|
]
|
|
179
199
|
}
|
|
180
200
|
),
|
|
181
|
-
!isMobile && /* @__PURE__ */ jsx(
|
|
201
|
+
!isMobile && !isPlayOnHover && /* @__PURE__ */ jsx(
|
|
182
202
|
"div",
|
|
183
203
|
{
|
|
184
204
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
package/dist/index.d.mts
CHANGED
|
@@ -366,4 +366,16 @@ declare const EmailInput: React.FC<InputControlProps>;
|
|
|
366
366
|
|
|
367
367
|
declare const TimeInput: React.FC<InputControlProps>;
|
|
368
368
|
|
|
369
|
-
|
|
369
|
+
interface TabItem {
|
|
370
|
+
tabTitle: string;
|
|
371
|
+
displayOrder: number;
|
|
372
|
+
landingPageUrl: string;
|
|
373
|
+
isActive: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface NavigationTabsV2Props {
|
|
376
|
+
tabs: TabItem[];
|
|
377
|
+
params?: Record<string, any>;
|
|
378
|
+
}
|
|
379
|
+
declare const NavigationTabsV2: React.FC<NavigationTabsV2Props>;
|
|
380
|
+
|
|
381
|
+
export { type ActionResponse, BooleanSelect, CheckboxInput, ColorInput, DataList, DataListRenderer, DateTimeInput, EmailInput, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -366,4 +366,16 @@ declare const EmailInput: React.FC<InputControlProps>;
|
|
|
366
366
|
|
|
367
367
|
declare const TimeInput: React.FC<InputControlProps>;
|
|
368
368
|
|
|
369
|
-
|
|
369
|
+
interface TabItem {
|
|
370
|
+
tabTitle: string;
|
|
371
|
+
displayOrder: number;
|
|
372
|
+
landingPageUrl: string;
|
|
373
|
+
isActive: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface NavigationTabsV2Props {
|
|
376
|
+
tabs: TabItem[];
|
|
377
|
+
params?: Record<string, any>;
|
|
378
|
+
}
|
|
379
|
+
declare const NavigationTabsV2: React.FC<NavigationTabsV2Props>;
|
|
380
|
+
|
|
381
|
+
export { type ActionResponse, BooleanSelect, CheckboxInput, ColorInput, DataList, DataListRenderer, DateTimeInput, EmailInput, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -515,6 +515,7 @@ var init_HlsPlayer = __esm({
|
|
|
515
515
|
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
516
516
|
const [isMobile, setIsMobile] = (0, import_react35.useState)(false);
|
|
517
517
|
const [isControlsVisible, setIsControlsVisible] = (0, import_react35.useState)(true);
|
|
518
|
+
const [isPosterVisible, setIsPosterVisible] = (0, import_react35.useState)(true);
|
|
518
519
|
const wasManuallyPausedRef = (0, import_react35.useRef)(false);
|
|
519
520
|
const inactivityTimerRef = (0, import_react35.useRef)(null);
|
|
520
521
|
const INACTIVITY_DELAY = 2500;
|
|
@@ -532,6 +533,20 @@ var init_HlsPlayer = __esm({
|
|
|
532
533
|
window.addEventListener("resize", checkMobile);
|
|
533
534
|
return () => window.removeEventListener("resize", checkMobile);
|
|
534
535
|
}, []);
|
|
536
|
+
(0, import_react35.useEffect)(() => {
|
|
537
|
+
const v = videoRef.current;
|
|
538
|
+
if (!v) return;
|
|
539
|
+
const onPlaying = () => setIsPosterVisible(false);
|
|
540
|
+
const onPause = () => {
|
|
541
|
+
if (v.currentTime === 0) setIsPosterVisible(true);
|
|
542
|
+
};
|
|
543
|
+
v.addEventListener("playing", onPlaying);
|
|
544
|
+
v.addEventListener("pause", onPause);
|
|
545
|
+
return () => {
|
|
546
|
+
v.removeEventListener("playing", onPlaying);
|
|
547
|
+
v.removeEventListener("pause", onPause);
|
|
548
|
+
};
|
|
549
|
+
}, []);
|
|
535
550
|
const resetInactivityTimer = (0, import_react35.useCallback)(() => {
|
|
536
551
|
setIsControlsVisible(true);
|
|
537
552
|
if (inactivityTimerRef.current) clearTimeout(inactivityTimerRef.current);
|
|
@@ -622,6 +637,7 @@ var init_HlsPlayer = __esm({
|
|
|
622
637
|
}, [isMobile, resetInactivityTimer]);
|
|
623
638
|
const posterSources = resolvedSources.filter((s) => s.media && s.posterUrl);
|
|
624
639
|
const fallbackPoster = posterUrl ?? resolvedSources.find((s) => !s.media)?.posterUrl ?? resolvedSources[0]?.posterUrl;
|
|
640
|
+
const isPlayOnHover = playOptions === "playOnHover";
|
|
625
641
|
if (resolvedSources.length === 0) return null;
|
|
626
642
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
627
643
|
"div",
|
|
@@ -638,7 +654,7 @@ var init_HlsPlayer = __esm({
|
|
|
638
654
|
className: "w-full h-full object-contain",
|
|
639
655
|
poster: fallbackPoster,
|
|
640
656
|
controls: showControls && (isMobile || isPlaying),
|
|
641
|
-
muted: playOptions === "autoplay" ||
|
|
657
|
+
muted: playOptions === "autoplay" || isPlayOnHover,
|
|
642
658
|
autoPlay: playOptions === "autoplay",
|
|
643
659
|
loop,
|
|
644
660
|
playsInline: true,
|
|
@@ -654,10 +670,14 @@ var init_HlsPlayer = __esm({
|
|
|
654
670
|
))
|
|
655
671
|
}
|
|
656
672
|
),
|
|
657
|
-
!isMobile &&
|
|
673
|
+
!isMobile && fallbackPoster && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
658
674
|
"picture",
|
|
659
675
|
{
|
|
660
|
-
className:
|
|
676
|
+
className: "absolute inset-0 pointer-events-none",
|
|
677
|
+
style: {
|
|
678
|
+
opacity: isPosterVisible && (!isPlayOnHover || !isHovered) ? 1 : 0,
|
|
679
|
+
transition: "opacity 0.4s ease"
|
|
680
|
+
},
|
|
661
681
|
children: [
|
|
662
682
|
posterSources.map(({ media, posterUrl: src }, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("source", { media, srcSet: src }, i)),
|
|
663
683
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
@@ -673,7 +693,7 @@ var init_HlsPlayer = __esm({
|
|
|
673
693
|
]
|
|
674
694
|
}
|
|
675
695
|
),
|
|
676
|
-
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
696
|
+
!isMobile && !isPlayOnHover && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
677
697
|
"div",
|
|
678
698
|
{
|
|
679
699
|
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
@@ -1103,6 +1123,7 @@ __export(index_exports, {
|
|
|
1103
1123
|
LineTextInput: () => LineTextInput_default,
|
|
1104
1124
|
MoneyInput: () => MoneyInput_default,
|
|
1105
1125
|
MultilineTextInput: () => MultilineTextInput_default,
|
|
1126
|
+
NavigationTabsV2: () => NavigationTabsV2_default,
|
|
1106
1127
|
NumberInput: () => NumberInput_default,
|
|
1107
1128
|
OtpInput: () => OtpInput_default,
|
|
1108
1129
|
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
@@ -3623,7 +3644,7 @@ var DataListRenderer = ({
|
|
|
3623
3644
|
(0, import_react34.useEffect)(() => {
|
|
3624
3645
|
const fetchData = async () => {
|
|
3625
3646
|
if (!serviceRoute) return;
|
|
3626
|
-
|
|
3647
|
+
const resolvedRoute = resolveRoutePlaceholders(serviceRoute, params);
|
|
3627
3648
|
const queryString = OdataBuilder.getOdataQueryString(query);
|
|
3628
3649
|
const separator = resolvedRoute.includes("?") ? "&" : "?";
|
|
3629
3650
|
const finalUrl = resolvedRoute + (queryString ? separator + queryString : "");
|
|
@@ -5985,6 +6006,47 @@ var Toast_default = Toast;
|
|
|
5985
6006
|
|
|
5986
6007
|
// src/index.ts
|
|
5987
6008
|
init_ToastService();
|
|
6009
|
+
|
|
6010
|
+
// src/components/NavigationTabsV2.tsx
|
|
6011
|
+
var import_link3 = __toESM(require("next/link"));
|
|
6012
|
+
var import_navigation3 = require("next/navigation");
|
|
6013
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6014
|
+
function resolveRoutePlaceholders2(route, params) {
|
|
6015
|
+
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
6016
|
+
const value = params[key];
|
|
6017
|
+
if (value === void 0 || value === null) {
|
|
6018
|
+
console.warn(`No value found for route param: ${key}`);
|
|
6019
|
+
return "";
|
|
6020
|
+
}
|
|
6021
|
+
return value;
|
|
6022
|
+
});
|
|
6023
|
+
}
|
|
6024
|
+
var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
6025
|
+
const pathname = (0, import_navigation3.usePathname)();
|
|
6026
|
+
const shouldHideTabs = pathname?.includes("/add");
|
|
6027
|
+
if (shouldHideTabs) return null;
|
|
6028
|
+
const mappedTabs = tabs?.sort((a, b) => a.displayOrder - b.displayOrder)?.map((tab) => ({
|
|
6029
|
+
tabTitle: tab.tabTitle,
|
|
6030
|
+
displayOrder: tab.displayOrder,
|
|
6031
|
+
landingPageUrl: resolveRoutePlaceholders2(
|
|
6032
|
+
tab.landingPageUrl,
|
|
6033
|
+
params
|
|
6034
|
+
),
|
|
6035
|
+
isActive: tab.isActive
|
|
6036
|
+
})) || [];
|
|
6037
|
+
if (mappedTabs.length === 0) return null;
|
|
6038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
6039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6040
|
+
"div",
|
|
6041
|
+
{
|
|
6042
|
+
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
6043
|
+
${isActive ? "bg-info-base" : "bg-neutral-weak "}`,
|
|
6044
|
+
children: tabTitle
|
|
6045
|
+
}
|
|
6046
|
+
) }, landingPageUrl);
|
|
6047
|
+
}) });
|
|
6048
|
+
};
|
|
6049
|
+
var NavigationTabsV2_default = NavigationTabsV2;
|
|
5988
6050
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5989
6051
|
0 && (module.exports = {
|
|
5990
6052
|
BooleanSelect,
|
|
@@ -5999,6 +6061,7 @@ init_ToastService();
|
|
|
5999
6061
|
LineTextInput,
|
|
6000
6062
|
MoneyInput,
|
|
6001
6063
|
MultilineTextInput,
|
|
6064
|
+
NavigationTabsV2,
|
|
6002
6065
|
NumberInput,
|
|
6003
6066
|
OtpInput,
|
|
6004
6067
|
PageBodyRenderer,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HlsPlayer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TXHD4F4A.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Button_default,
|
|
6
6
|
ServiceClient_default,
|
|
@@ -2517,7 +2517,7 @@ var DataListRenderer = ({
|
|
|
2517
2517
|
useEffect7(() => {
|
|
2518
2518
|
const fetchData = async () => {
|
|
2519
2519
|
if (!serviceRoute) return;
|
|
2520
|
-
|
|
2520
|
+
const resolvedRoute = resolveRoutePlaceholders(serviceRoute, params);
|
|
2521
2521
|
const queryString = OdataBuilder.getOdataQueryString(query);
|
|
2522
2522
|
const separator = resolvedRoute.includes("?") ? "&" : "?";
|
|
2523
2523
|
const finalUrl = resolvedRoute + (queryString ? separator + queryString : "");
|
|
@@ -2782,7 +2782,7 @@ var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
|
2782
2782
|
|
|
2783
2783
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2784
2784
|
import { Fragment as Fragment3, jsx as jsx41 } from "react/jsx-runtime";
|
|
2785
|
-
var HlsPlayer = dynamic(() => import("./HlsPlayer-
|
|
2785
|
+
var HlsPlayer = dynamic(() => import("./HlsPlayer-GV3FOPYT.mjs"), {
|
|
2786
2786
|
ssr: false
|
|
2787
2787
|
});
|
|
2788
2788
|
var getNestedValue = (obj, path) => {
|
|
@@ -4251,7 +4251,7 @@ var Pagination_default = Pagination;
|
|
|
4251
4251
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4252
4252
|
import dynamic5 from "next/dynamic";
|
|
4253
4253
|
import { Fragment as Fragment9, jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4254
|
-
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-
|
|
4254
|
+
var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-GV3FOPYT.mjs"), { ssr: false });
|
|
4255
4255
|
var deviceToMediaQuery = (device) => {
|
|
4256
4256
|
switch (device) {
|
|
4257
4257
|
case "sm":
|
|
@@ -4868,6 +4868,47 @@ var Toast = () => {
|
|
|
4868
4868
|
] }) }) });
|
|
4869
4869
|
};
|
|
4870
4870
|
var Toast_default = Toast;
|
|
4871
|
+
|
|
4872
|
+
// src/components/NavigationTabsV2.tsx
|
|
4873
|
+
import Link3 from "next/link";
|
|
4874
|
+
import { usePathname as usePathname2 } from "next/navigation";
|
|
4875
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4876
|
+
function resolveRoutePlaceholders2(route, params) {
|
|
4877
|
+
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
4878
|
+
const value = params[key];
|
|
4879
|
+
if (value === void 0 || value === null) {
|
|
4880
|
+
console.warn(`No value found for route param: ${key}`);
|
|
4881
|
+
return "";
|
|
4882
|
+
}
|
|
4883
|
+
return value;
|
|
4884
|
+
});
|
|
4885
|
+
}
|
|
4886
|
+
var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
4887
|
+
const pathname = usePathname2();
|
|
4888
|
+
const shouldHideTabs = pathname?.includes("/add");
|
|
4889
|
+
if (shouldHideTabs) return null;
|
|
4890
|
+
const mappedTabs = tabs?.sort((a, b) => a.displayOrder - b.displayOrder)?.map((tab) => ({
|
|
4891
|
+
tabTitle: tab.tabTitle,
|
|
4892
|
+
displayOrder: tab.displayOrder,
|
|
4893
|
+
landingPageUrl: resolveRoutePlaceholders2(
|
|
4894
|
+
tab.landingPageUrl,
|
|
4895
|
+
params
|
|
4896
|
+
),
|
|
4897
|
+
isActive: tab.isActive
|
|
4898
|
+
})) || [];
|
|
4899
|
+
if (mappedTabs.length === 0) return null;
|
|
4900
|
+
return /* @__PURE__ */ jsx64("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
4901
|
+
return /* @__PURE__ */ jsx64(Link3, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ jsx64(
|
|
4902
|
+
"div",
|
|
4903
|
+
{
|
|
4904
|
+
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
4905
|
+
${isActive ? "bg-info-base" : "bg-neutral-weak "}`,
|
|
4906
|
+
children: tabTitle
|
|
4907
|
+
}
|
|
4908
|
+
) }, landingPageUrl);
|
|
4909
|
+
}) });
|
|
4910
|
+
};
|
|
4911
|
+
var NavigationTabsV2_default = NavigationTabsV2;
|
|
4871
4912
|
export {
|
|
4872
4913
|
BooleanSelect_default as BooleanSelect,
|
|
4873
4914
|
CheckboxInput_default as CheckboxInput,
|
|
@@ -4881,6 +4922,7 @@ export {
|
|
|
4881
4922
|
LineTextInput_default as LineTextInput,
|
|
4882
4923
|
MoneyInput_default as MoneyInput,
|
|
4883
4924
|
MultilineTextInput_default as MultilineTextInput,
|
|
4925
|
+
NavigationTabsV2_default as NavigationTabsV2,
|
|
4884
4926
|
NumberInput_default as NumberInput,
|
|
4885
4927
|
OtpInput_default as OtpInput,
|
|
4886
4928
|
PageBodyRenderer_default as PageBodyRenderer,
|
package/package.json
CHANGED