@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260808070128 → 0.8.1-dev.20260808091030
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/{IframeClient-RGJFZ5P2.mjs → IframeClient-E6VGPN6S.mjs} +13 -6
- package/dist/{IframeClient-J22NMEVY.mjs → IframeClient-J64QAFNK.mjs} +13 -6
- package/dist/TimeUntilStartsClient-4C7NDEAD.mjs +76 -0
- package/dist/TimeUntilStartsClient-5HGQ5JKM.mjs +78 -0
- package/dist/index.js +116 -91
- package/dist/index.mjs +327 -392
- package/dist/server.js +110 -85
- package/dist/server.mjs +140 -205
- package/package.json +1 -1
|
@@ -49,7 +49,11 @@ var IFrameLoaderView_default = IFrameLoaderView;
|
|
|
49
49
|
|
|
50
50
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
51
51
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
52
|
-
var IframeClient = ({
|
|
52
|
+
var IframeClient = ({
|
|
53
|
+
src,
|
|
54
|
+
width,
|
|
55
|
+
height
|
|
56
|
+
}) => {
|
|
53
57
|
const iframeRef = useRef(null);
|
|
54
58
|
const [iframeHeight, setIframeHeight] = useState("100%");
|
|
55
59
|
const [isDataFound, setIsDataFound] = useState(null);
|
|
@@ -58,11 +62,11 @@ var IframeClient = ({ src }) => {
|
|
|
58
62
|
const eventName = event?.data?.eventName;
|
|
59
63
|
const payload = event?.data?.payload;
|
|
60
64
|
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
61
|
-
let
|
|
65
|
+
let height2 = 500;
|
|
62
66
|
if (payload.height > 500) {
|
|
63
|
-
|
|
67
|
+
height2 = payload.height + 50;
|
|
64
68
|
}
|
|
65
|
-
setIframeHeight(`${
|
|
69
|
+
setIframeHeight(`${height2}px`);
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
window.addEventListener("message", handleReceiveMessage);
|
|
@@ -71,7 +75,10 @@ var IframeClient = ({ src }) => {
|
|
|
71
75
|
useEffect(() => {
|
|
72
76
|
const handleResize = () => {
|
|
73
77
|
if (iframeRef.current) {
|
|
74
|
-
iframeRef.current.contentWindow?.postMessage(
|
|
78
|
+
iframeRef.current.contentWindow?.postMessage(
|
|
79
|
+
{ eventName: "RESIZE" },
|
|
80
|
+
"*"
|
|
81
|
+
);
|
|
75
82
|
}
|
|
76
83
|
};
|
|
77
84
|
window.addEventListener("resize", handleResize);
|
|
@@ -87,7 +94,7 @@ var IframeClient = ({ src }) => {
|
|
|
87
94
|
src,
|
|
88
95
|
className: "w-full h-full border-none",
|
|
89
96
|
scrolling: "no",
|
|
90
|
-
style: { height: iframeHeight },
|
|
97
|
+
style: { width: width || "100%", height: height || iframeHeight },
|
|
91
98
|
onLoad: handleIframeLoad
|
|
92
99
|
}
|
|
93
100
|
) }) });
|
|
@@ -47,7 +47,11 @@ var IFrameLoaderView_default = IFrameLoaderView;
|
|
|
47
47
|
|
|
48
48
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
49
49
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
50
|
-
var IframeClient = ({
|
|
50
|
+
var IframeClient = ({
|
|
51
|
+
src,
|
|
52
|
+
width,
|
|
53
|
+
height
|
|
54
|
+
}) => {
|
|
51
55
|
const iframeRef = useRef(null);
|
|
52
56
|
const [iframeHeight, setIframeHeight] = useState("100%");
|
|
53
57
|
const [isDataFound, setIsDataFound] = useState(null);
|
|
@@ -56,11 +60,11 @@ var IframeClient = ({ src }) => {
|
|
|
56
60
|
const eventName = event?.data?.eventName;
|
|
57
61
|
const payload = event?.data?.payload;
|
|
58
62
|
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
59
|
-
let
|
|
63
|
+
let height2 = 500;
|
|
60
64
|
if (payload.height > 500) {
|
|
61
|
-
|
|
65
|
+
height2 = payload.height + 50;
|
|
62
66
|
}
|
|
63
|
-
setIframeHeight(`${
|
|
67
|
+
setIframeHeight(`${height2}px`);
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
70
|
window.addEventListener("message", handleReceiveMessage);
|
|
@@ -69,7 +73,10 @@ var IframeClient = ({ src }) => {
|
|
|
69
73
|
useEffect(() => {
|
|
70
74
|
const handleResize = () => {
|
|
71
75
|
if (iframeRef.current) {
|
|
72
|
-
iframeRef.current.contentWindow?.postMessage(
|
|
76
|
+
iframeRef.current.contentWindow?.postMessage(
|
|
77
|
+
{ eventName: "RESIZE" },
|
|
78
|
+
"*"
|
|
79
|
+
);
|
|
73
80
|
}
|
|
74
81
|
};
|
|
75
82
|
window.addEventListener("resize", handleResize);
|
|
@@ -85,7 +92,7 @@ var IframeClient = ({ src }) => {
|
|
|
85
92
|
src,
|
|
86
93
|
className: "w-full h-full border-none",
|
|
87
94
|
scrolling: "no",
|
|
88
|
-
style: { height: iframeHeight },
|
|
95
|
+
style: { width: width || "100%", height: height || iframeHeight },
|
|
89
96
|
onLoad: handleIframeLoad
|
|
90
97
|
}
|
|
91
98
|
) }) });
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/controls/view/TimeUntilStartsClient.tsx
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var TimeUntilStartsClient = (props) => {
|
|
7
|
+
const calculateTimeDifference = (startDate) => {
|
|
8
|
+
const now = /* @__PURE__ */ new Date();
|
|
9
|
+
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
10
|
+
const startDateUtc = new Date(startDate);
|
|
11
|
+
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
12
|
+
const isPast = diffMs < 0;
|
|
13
|
+
const absoluteDiffMs = Math.abs(diffMs);
|
|
14
|
+
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
15
|
+
const diffHours = Math.floor(
|
|
16
|
+
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
17
|
+
);
|
|
18
|
+
const diffMinutes = Math.floor(
|
|
19
|
+
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
20
|
+
);
|
|
21
|
+
if (absoluteDiffMs < 6e4) {
|
|
22
|
+
return "Just now";
|
|
23
|
+
}
|
|
24
|
+
let timeParts = [
|
|
25
|
+
{ value: diffDays, unit: "days" },
|
|
26
|
+
{ value: diffHours, unit: "hours" },
|
|
27
|
+
{ value: diffMinutes, unit: "minutes" }
|
|
28
|
+
];
|
|
29
|
+
timeParts = timeParts.filter((part) => part.value > 0);
|
|
30
|
+
if (isPast) {
|
|
31
|
+
if (diffDays > 0) {
|
|
32
|
+
return `${diffDays} day(s) ago`;
|
|
33
|
+
} else if (diffHours > 0) {
|
|
34
|
+
return `${diffHours} hour(s) ago`;
|
|
35
|
+
} else if (diffMinutes > 0) {
|
|
36
|
+
return `${diffMinutes} minute(s) ago`;
|
|
37
|
+
} else {
|
|
38
|
+
return "Just now";
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
if (timeParts.length > 2) {
|
|
42
|
+
timeParts = timeParts.slice(0, 2);
|
|
43
|
+
}
|
|
44
|
+
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
45
|
+
return displayString ? `Starting in ${displayString}` : "Started";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const isValidDate = (date) => {
|
|
49
|
+
return !isNaN(Date.parse(date));
|
|
50
|
+
};
|
|
51
|
+
const [timeUntilStart, setTimeUntilStart] = useState(() => {
|
|
52
|
+
if (props.value && isValidDate(props.value)) {
|
|
53
|
+
return calculateTimeDifference(props.value);
|
|
54
|
+
}
|
|
55
|
+
return "";
|
|
56
|
+
});
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (props.value && isValidDate(props.value)) {
|
|
59
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
60
|
+
const initialTimeout = setTimeout(() => {
|
|
61
|
+
const interval = setInterval(() => {
|
|
62
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
63
|
+
}, 6e4);
|
|
64
|
+
return () => clearInterval(interval);
|
|
65
|
+
}, 5e3);
|
|
66
|
+
return () => clearTimeout(initialTimeout);
|
|
67
|
+
} else {
|
|
68
|
+
setTimeUntilStart("");
|
|
69
|
+
}
|
|
70
|
+
}, [props.value]);
|
|
71
|
+
return /* @__PURE__ */ jsx("div", { children: timeUntilStart });
|
|
72
|
+
};
|
|
73
|
+
var TimeUntilStartsClient_default = TimeUntilStartsClient;
|
|
74
|
+
export {
|
|
75
|
+
TimeUntilStartsClient_default as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
|
|
5
|
+
// src/components/controls/view/TimeUntilStartsClient.tsx
|
|
6
|
+
import { useState, useEffect } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var TimeUntilStartsClient = (props) => {
|
|
9
|
+
const calculateTimeDifference = (startDate) => {
|
|
10
|
+
const now = /* @__PURE__ */ new Date();
|
|
11
|
+
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
12
|
+
const startDateUtc = new Date(startDate);
|
|
13
|
+
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
14
|
+
const isPast = diffMs < 0;
|
|
15
|
+
const absoluteDiffMs = Math.abs(diffMs);
|
|
16
|
+
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
17
|
+
const diffHours = Math.floor(
|
|
18
|
+
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
19
|
+
);
|
|
20
|
+
const diffMinutes = Math.floor(
|
|
21
|
+
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
22
|
+
);
|
|
23
|
+
if (absoluteDiffMs < 6e4) {
|
|
24
|
+
return "Just now";
|
|
25
|
+
}
|
|
26
|
+
let timeParts = [
|
|
27
|
+
{ value: diffDays, unit: "days" },
|
|
28
|
+
{ value: diffHours, unit: "hours" },
|
|
29
|
+
{ value: diffMinutes, unit: "minutes" }
|
|
30
|
+
];
|
|
31
|
+
timeParts = timeParts.filter((part) => part.value > 0);
|
|
32
|
+
if (isPast) {
|
|
33
|
+
if (diffDays > 0) {
|
|
34
|
+
return `${diffDays} day(s) ago`;
|
|
35
|
+
} else if (diffHours > 0) {
|
|
36
|
+
return `${diffHours} hour(s) ago`;
|
|
37
|
+
} else if (diffMinutes > 0) {
|
|
38
|
+
return `${diffMinutes} minute(s) ago`;
|
|
39
|
+
} else {
|
|
40
|
+
return "Just now";
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
if (timeParts.length > 2) {
|
|
44
|
+
timeParts = timeParts.slice(0, 2);
|
|
45
|
+
}
|
|
46
|
+
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
47
|
+
return displayString ? `Starting in ${displayString}` : "Started";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const isValidDate = (date) => {
|
|
51
|
+
return !isNaN(Date.parse(date));
|
|
52
|
+
};
|
|
53
|
+
const [timeUntilStart, setTimeUntilStart] = useState(() => {
|
|
54
|
+
if (props.value && isValidDate(props.value)) {
|
|
55
|
+
return calculateTimeDifference(props.value);
|
|
56
|
+
}
|
|
57
|
+
return "";
|
|
58
|
+
});
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (props.value && isValidDate(props.value)) {
|
|
61
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
62
|
+
const initialTimeout = setTimeout(() => {
|
|
63
|
+
const interval = setInterval(() => {
|
|
64
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
65
|
+
}, 6e4);
|
|
66
|
+
return () => clearInterval(interval);
|
|
67
|
+
}, 5e3);
|
|
68
|
+
return () => clearTimeout(initialTimeout);
|
|
69
|
+
} else {
|
|
70
|
+
setTimeUntilStart("");
|
|
71
|
+
}
|
|
72
|
+
}, [props.value]);
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { children: timeUntilStart });
|
|
74
|
+
};
|
|
75
|
+
var TimeUntilStartsClient_default = TimeUntilStartsClient;
|
|
76
|
+
export {
|
|
77
|
+
TimeUntilStartsClient_default as default
|
|
78
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -823,6 +823,89 @@ var init_DateTimeViewClient = __esm({
|
|
|
823
823
|
}
|
|
824
824
|
});
|
|
825
825
|
|
|
826
|
+
// src/components/controls/view/TimeUntilStartsClient.tsx
|
|
827
|
+
var TimeUntilStartsClient_exports = {};
|
|
828
|
+
__export(TimeUntilStartsClient_exports, {
|
|
829
|
+
default: () => TimeUntilStartsClient_default
|
|
830
|
+
});
|
|
831
|
+
var import_react15, import_jsx_runtime18, TimeUntilStartsClient, TimeUntilStartsClient_default;
|
|
832
|
+
var init_TimeUntilStartsClient = __esm({
|
|
833
|
+
"src/components/controls/view/TimeUntilStartsClient.tsx"() {
|
|
834
|
+
"use strict";
|
|
835
|
+
"use client";
|
|
836
|
+
import_react15 = require("react");
|
|
837
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
838
|
+
TimeUntilStartsClient = (props) => {
|
|
839
|
+
const calculateTimeDifference = (startDate) => {
|
|
840
|
+
const now = /* @__PURE__ */ new Date();
|
|
841
|
+
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
842
|
+
const startDateUtc = new Date(startDate);
|
|
843
|
+
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
844
|
+
const isPast = diffMs < 0;
|
|
845
|
+
const absoluteDiffMs = Math.abs(diffMs);
|
|
846
|
+
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
847
|
+
const diffHours = Math.floor(
|
|
848
|
+
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
849
|
+
);
|
|
850
|
+
const diffMinutes = Math.floor(
|
|
851
|
+
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
852
|
+
);
|
|
853
|
+
if (absoluteDiffMs < 6e4) {
|
|
854
|
+
return "Just now";
|
|
855
|
+
}
|
|
856
|
+
let timeParts = [
|
|
857
|
+
{ value: diffDays, unit: "days" },
|
|
858
|
+
{ value: diffHours, unit: "hours" },
|
|
859
|
+
{ value: diffMinutes, unit: "minutes" }
|
|
860
|
+
];
|
|
861
|
+
timeParts = timeParts.filter((part) => part.value > 0);
|
|
862
|
+
if (isPast) {
|
|
863
|
+
if (diffDays > 0) {
|
|
864
|
+
return `${diffDays} day(s) ago`;
|
|
865
|
+
} else if (diffHours > 0) {
|
|
866
|
+
return `${diffHours} hour(s) ago`;
|
|
867
|
+
} else if (diffMinutes > 0) {
|
|
868
|
+
return `${diffMinutes} minute(s) ago`;
|
|
869
|
+
} else {
|
|
870
|
+
return "Just now";
|
|
871
|
+
}
|
|
872
|
+
} else {
|
|
873
|
+
if (timeParts.length > 2) {
|
|
874
|
+
timeParts = timeParts.slice(0, 2);
|
|
875
|
+
}
|
|
876
|
+
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
877
|
+
return displayString ? `Starting in ${displayString}` : "Started";
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
const isValidDate = (date) => {
|
|
881
|
+
return !isNaN(Date.parse(date));
|
|
882
|
+
};
|
|
883
|
+
const [timeUntilStart, setTimeUntilStart] = (0, import_react15.useState)(() => {
|
|
884
|
+
if (props.value && isValidDate(props.value)) {
|
|
885
|
+
return calculateTimeDifference(props.value);
|
|
886
|
+
}
|
|
887
|
+
return "";
|
|
888
|
+
});
|
|
889
|
+
(0, import_react15.useEffect)(() => {
|
|
890
|
+
if (props.value && isValidDate(props.value)) {
|
|
891
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
892
|
+
const initialTimeout = setTimeout(() => {
|
|
893
|
+
const interval = setInterval(() => {
|
|
894
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
895
|
+
}, 6e4);
|
|
896
|
+
return () => clearInterval(interval);
|
|
897
|
+
}, 5e3);
|
|
898
|
+
return () => clearTimeout(initialTimeout);
|
|
899
|
+
} else {
|
|
900
|
+
setTimeUntilStart("");
|
|
901
|
+
}
|
|
902
|
+
}, [props.value]);
|
|
903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: timeUntilStart });
|
|
904
|
+
};
|
|
905
|
+
TimeUntilStartsClient_default = TimeUntilStartsClient;
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
|
|
826
909
|
// src/components/controls/edit/MultilineTextInput.tsx
|
|
827
910
|
var import_react17, import_jsx_runtime20, MultilineTextInput, MultilineTextInput_default;
|
|
828
911
|
var init_MultilineTextInput = __esm({
|
|
@@ -3913,7 +3996,11 @@ var init_IframeClient = __esm({
|
|
|
3913
3996
|
import_react53 = __toESM(require("react"));
|
|
3914
3997
|
init_IFrameLoaderView();
|
|
3915
3998
|
import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3916
|
-
IframeClient = ({
|
|
3999
|
+
IframeClient = ({
|
|
4000
|
+
src,
|
|
4001
|
+
width,
|
|
4002
|
+
height
|
|
4003
|
+
}) => {
|
|
3917
4004
|
const iframeRef = (0, import_react53.useRef)(null);
|
|
3918
4005
|
const [iframeHeight, setIframeHeight] = (0, import_react53.useState)("100%");
|
|
3919
4006
|
const [isDataFound, setIsDataFound] = (0, import_react53.useState)(null);
|
|
@@ -3922,11 +4009,11 @@ var init_IframeClient = __esm({
|
|
|
3922
4009
|
const eventName = event?.data?.eventName;
|
|
3923
4010
|
const payload = event?.data?.payload;
|
|
3924
4011
|
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
3925
|
-
let
|
|
4012
|
+
let height2 = 500;
|
|
3926
4013
|
if (payload.height > 500) {
|
|
3927
|
-
|
|
4014
|
+
height2 = payload.height + 50;
|
|
3928
4015
|
}
|
|
3929
|
-
setIframeHeight(`${
|
|
4016
|
+
setIframeHeight(`${height2}px`);
|
|
3930
4017
|
}
|
|
3931
4018
|
};
|
|
3932
4019
|
window.addEventListener("message", handleReceiveMessage);
|
|
@@ -3935,7 +4022,10 @@ var init_IframeClient = __esm({
|
|
|
3935
4022
|
(0, import_react53.useEffect)(() => {
|
|
3936
4023
|
const handleResize = () => {
|
|
3937
4024
|
if (iframeRef.current) {
|
|
3938
|
-
iframeRef.current.contentWindow?.postMessage(
|
|
4025
|
+
iframeRef.current.contentWindow?.postMessage(
|
|
4026
|
+
{ eventName: "RESIZE" },
|
|
4027
|
+
"*"
|
|
4028
|
+
);
|
|
3939
4029
|
}
|
|
3940
4030
|
};
|
|
3941
4031
|
window.addEventListener("resize", handleResize);
|
|
@@ -3951,7 +4041,7 @@ var init_IframeClient = __esm({
|
|
|
3951
4041
|
src,
|
|
3952
4042
|
className: "w-full h-full border-none",
|
|
3953
4043
|
scrolling: "no",
|
|
3954
|
-
style: { height: iframeHeight },
|
|
4044
|
+
style: { width: width || "100%", height: height || iframeHeight },
|
|
3955
4045
|
onLoad: handleIframeLoad
|
|
3956
4046
|
}
|
|
3957
4047
|
) }) });
|
|
@@ -5045,75 +5135,10 @@ var DateTimeView = (0, import_dynamic3.default)(() => Promise.resolve().then(()
|
|
|
5045
5135
|
var DateTimeVew_default = DateTimeView;
|
|
5046
5136
|
|
|
5047
5137
|
// src/components/controls/view/TimeUntilStarts.tsx
|
|
5048
|
-
var
|
|
5049
|
-
var
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
const now = /* @__PURE__ */ new Date();
|
|
5053
|
-
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
5054
|
-
const startDateUtc = new Date(startDate);
|
|
5055
|
-
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
5056
|
-
const isPast = diffMs < 0;
|
|
5057
|
-
const absoluteDiffMs = Math.abs(diffMs);
|
|
5058
|
-
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
5059
|
-
const diffHours = Math.floor(
|
|
5060
|
-
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
5061
|
-
);
|
|
5062
|
-
const diffMinutes = Math.floor(
|
|
5063
|
-
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
5064
|
-
);
|
|
5065
|
-
if (absoluteDiffMs < 6e4) {
|
|
5066
|
-
return "Just now";
|
|
5067
|
-
}
|
|
5068
|
-
let timeParts = [
|
|
5069
|
-
{ value: diffDays, unit: "days" },
|
|
5070
|
-
{ value: diffHours, unit: "hours" },
|
|
5071
|
-
{ value: diffMinutes, unit: "minutes" }
|
|
5072
|
-
];
|
|
5073
|
-
timeParts = timeParts.filter((part) => part.value > 0);
|
|
5074
|
-
if (isPast) {
|
|
5075
|
-
if (diffDays > 0) {
|
|
5076
|
-
return `${diffDays} day(s) ago`;
|
|
5077
|
-
} else if (diffHours > 0) {
|
|
5078
|
-
return `${diffHours} hour(s) ago`;
|
|
5079
|
-
} else if (diffMinutes > 0) {
|
|
5080
|
-
return `${diffMinutes} minute(s) ago`;
|
|
5081
|
-
} else {
|
|
5082
|
-
return "Just now";
|
|
5083
|
-
}
|
|
5084
|
-
} else {
|
|
5085
|
-
if (timeParts.length > 2) {
|
|
5086
|
-
timeParts = timeParts.slice(0, 2);
|
|
5087
|
-
}
|
|
5088
|
-
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
5089
|
-
return displayString ? `Starting in ${displayString}` : "Started";
|
|
5090
|
-
}
|
|
5091
|
-
};
|
|
5092
|
-
const isValidDate = (date) => {
|
|
5093
|
-
return !isNaN(Date.parse(date));
|
|
5094
|
-
};
|
|
5095
|
-
const [timeUntilStart, setTimeUntilStart] = (0, import_react15.useState)(() => {
|
|
5096
|
-
if (props.value && isValidDate(props.value)) {
|
|
5097
|
-
return calculateTimeDifference(props.value);
|
|
5098
|
-
}
|
|
5099
|
-
return "";
|
|
5100
|
-
});
|
|
5101
|
-
(0, import_react15.useEffect)(() => {
|
|
5102
|
-
if (props.value && isValidDate(props.value)) {
|
|
5103
|
-
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
5104
|
-
const initialTimeout = setTimeout(() => {
|
|
5105
|
-
const interval = setInterval(() => {
|
|
5106
|
-
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
5107
|
-
}, 6e4);
|
|
5108
|
-
return () => clearInterval(interval);
|
|
5109
|
-
}, 5e3);
|
|
5110
|
-
return () => clearTimeout(initialTimeout);
|
|
5111
|
-
} else {
|
|
5112
|
-
setTimeUntilStart("");
|
|
5113
|
-
}
|
|
5114
|
-
}, [props.value]);
|
|
5115
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: timeUntilStart });
|
|
5116
|
-
};
|
|
5138
|
+
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
5139
|
+
var TimeUntilStarts = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_TimeUntilStartsClient(), TimeUntilStartsClient_exports)), {
|
|
5140
|
+
ssr: false
|
|
5141
|
+
});
|
|
5117
5142
|
var TimeUntilStarts_default = TimeUntilStarts;
|
|
5118
5143
|
|
|
5119
5144
|
// src/components/controls/view/ViewControl.tsx
|
|
@@ -5139,7 +5164,7 @@ var ViewControl = (props) => {
|
|
|
5139
5164
|
[ViewControlTypes_default.status]: StatusView_default,
|
|
5140
5165
|
[ViewControlTypes_default.statusBg]: StatusBgView_default,
|
|
5141
5166
|
[ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
|
|
5142
|
-
|
|
5167
|
+
[ViewControlTypes_default.timeUntilStarts]: TimeUntilStarts_default,
|
|
5143
5168
|
// [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
|
|
5144
5169
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
|
|
5145
5170
|
[ViewControlTypes_default.booleanView]: BooleanView_default,
|
|
@@ -5151,8 +5176,8 @@ var ViewControl = (props) => {
|
|
|
5151
5176
|
var ViewControl_default = ViewControl;
|
|
5152
5177
|
|
|
5153
5178
|
// src/components/controls/edit/InputControl.tsx
|
|
5154
|
-
var
|
|
5155
|
-
var InputControl2 = (0,
|
|
5179
|
+
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5180
|
+
var InputControl2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
5156
5181
|
ssr: false
|
|
5157
5182
|
});
|
|
5158
5183
|
var InputControl_default = InputControl2;
|
|
@@ -5250,9 +5275,9 @@ var import_react43 = __toESM(require("react"));
|
|
|
5250
5275
|
|
|
5251
5276
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
5252
5277
|
init_AssetUtility();
|
|
5253
|
-
var
|
|
5278
|
+
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
5254
5279
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5255
|
-
var HlsPlayer3 = (0,
|
|
5280
|
+
var HlsPlayer3 = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5256
5281
|
var getNestedValue = (obj, path) => {
|
|
5257
5282
|
if (!obj || !path) return void 0;
|
|
5258
5283
|
return path.split(".").reduce((current, key) => {
|
|
@@ -5360,9 +5385,9 @@ var ImageNode_default = ImageNode;
|
|
|
5360
5385
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
5361
5386
|
init_StyleTypes();
|
|
5362
5387
|
init_Hyperlink();
|
|
5363
|
-
var
|
|
5388
|
+
var import_dynamic7 = __toESM(require("next/dynamic"));
|
|
5364
5389
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5365
|
-
var LinkNodeButton2 = (0,
|
|
5390
|
+
var LinkNodeButton2 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
5366
5391
|
ssr: false
|
|
5367
5392
|
});
|
|
5368
5393
|
function getNestedValue2(obj, path) {
|
|
@@ -5795,9 +5820,9 @@ var QuoteNode_default = QuoteNode;
|
|
|
5795
5820
|
|
|
5796
5821
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
5797
5822
|
var import_react50 = __toESM(require("react"));
|
|
5798
|
-
var
|
|
5823
|
+
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
5799
5824
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5800
|
-
var CopyButton2 = (0,
|
|
5825
|
+
var CopyButton2 = (0, import_dynamic8.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
5801
5826
|
ssr: false,
|
|
5802
5827
|
// optional: fallback UI while loading
|
|
5803
5828
|
loading: () => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
@@ -5934,13 +5959,13 @@ var WidgetNode = (props) => {
|
|
|
5934
5959
|
var WidgetNode_default = WidgetNode;
|
|
5935
5960
|
|
|
5936
5961
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5937
|
-
var
|
|
5962
|
+
var import_dynamic11 = __toESM(require("next/dynamic"));
|
|
5938
5963
|
var import_react56 = __toESM(require("react"));
|
|
5939
5964
|
|
|
5940
5965
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
5941
|
-
var
|
|
5966
|
+
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
5942
5967
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5943
|
-
var IframeClient2 = (0,
|
|
5968
|
+
var IframeClient2 = (0, import_dynamic9.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
5944
5969
|
ssr: false
|
|
5945
5970
|
});
|
|
5946
5971
|
var EmbedNode = (props) => {
|
|
@@ -6182,9 +6207,9 @@ var NoDataFound_default = NoDataFound;
|
|
|
6182
6207
|
|
|
6183
6208
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
6184
6209
|
init_AssetUtility();
|
|
6185
|
-
var
|
|
6210
|
+
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
6186
6211
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6187
|
-
var HlsPlayer4 = (0,
|
|
6212
|
+
var HlsPlayer4 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
6188
6213
|
var deviceToMediaQuery = (device) => {
|
|
6189
6214
|
switch (device) {
|
|
6190
6215
|
case "lg":
|
|
@@ -7033,8 +7058,8 @@ var DocumentNode_default = DocumentNode;
|
|
|
7033
7058
|
|
|
7034
7059
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7035
7060
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7036
|
-
var Pagination2 = (0,
|
|
7037
|
-
var Slider2 = (0,
|
|
7061
|
+
var Pagination2 = (0, import_dynamic11.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
7062
|
+
var Slider2 = (0, import_dynamic11.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
7038
7063
|
ssr: false
|
|
7039
7064
|
});
|
|
7040
7065
|
function toCamelCase(str) {
|