@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
package/dist/server.js
CHANGED
|
@@ -1560,6 +1560,89 @@ var init_DateTimeViewClient = __esm({
|
|
|
1560
1560
|
}
|
|
1561
1561
|
});
|
|
1562
1562
|
|
|
1563
|
+
// src/components/controls/view/TimeUntilStartsClient.tsx
|
|
1564
|
+
var TimeUntilStartsClient_exports = {};
|
|
1565
|
+
__export(TimeUntilStartsClient_exports, {
|
|
1566
|
+
default: () => TimeUntilStartsClient_default
|
|
1567
|
+
});
|
|
1568
|
+
var import_react20, import_jsx_runtime29, TimeUntilStartsClient, TimeUntilStartsClient_default;
|
|
1569
|
+
var init_TimeUntilStartsClient = __esm({
|
|
1570
|
+
"src/components/controls/view/TimeUntilStartsClient.tsx"() {
|
|
1571
|
+
"use strict";
|
|
1572
|
+
"use client";
|
|
1573
|
+
import_react20 = require("react");
|
|
1574
|
+
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1575
|
+
TimeUntilStartsClient = (props) => {
|
|
1576
|
+
const calculateTimeDifference = (startDate) => {
|
|
1577
|
+
const now = /* @__PURE__ */ new Date();
|
|
1578
|
+
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
1579
|
+
const startDateUtc = new Date(startDate);
|
|
1580
|
+
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
1581
|
+
const isPast = diffMs < 0;
|
|
1582
|
+
const absoluteDiffMs = Math.abs(diffMs);
|
|
1583
|
+
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
1584
|
+
const diffHours = Math.floor(
|
|
1585
|
+
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
1586
|
+
);
|
|
1587
|
+
const diffMinutes = Math.floor(
|
|
1588
|
+
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
1589
|
+
);
|
|
1590
|
+
if (absoluteDiffMs < 6e4) {
|
|
1591
|
+
return "Just now";
|
|
1592
|
+
}
|
|
1593
|
+
let timeParts = [
|
|
1594
|
+
{ value: diffDays, unit: "days" },
|
|
1595
|
+
{ value: diffHours, unit: "hours" },
|
|
1596
|
+
{ value: diffMinutes, unit: "minutes" }
|
|
1597
|
+
];
|
|
1598
|
+
timeParts = timeParts.filter((part) => part.value > 0);
|
|
1599
|
+
if (isPast) {
|
|
1600
|
+
if (diffDays > 0) {
|
|
1601
|
+
return `${diffDays} day(s) ago`;
|
|
1602
|
+
} else if (diffHours > 0) {
|
|
1603
|
+
return `${diffHours} hour(s) ago`;
|
|
1604
|
+
} else if (diffMinutes > 0) {
|
|
1605
|
+
return `${diffMinutes} minute(s) ago`;
|
|
1606
|
+
} else {
|
|
1607
|
+
return "Just now";
|
|
1608
|
+
}
|
|
1609
|
+
} else {
|
|
1610
|
+
if (timeParts.length > 2) {
|
|
1611
|
+
timeParts = timeParts.slice(0, 2);
|
|
1612
|
+
}
|
|
1613
|
+
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
1614
|
+
return displayString ? `Starting in ${displayString}` : "Started";
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
const isValidDate = (date) => {
|
|
1618
|
+
return !isNaN(Date.parse(date));
|
|
1619
|
+
};
|
|
1620
|
+
const [timeUntilStart, setTimeUntilStart] = (0, import_react20.useState)(() => {
|
|
1621
|
+
if (props.value && isValidDate(props.value)) {
|
|
1622
|
+
return calculateTimeDifference(props.value);
|
|
1623
|
+
}
|
|
1624
|
+
return "";
|
|
1625
|
+
});
|
|
1626
|
+
(0, import_react20.useEffect)(() => {
|
|
1627
|
+
if (props.value && isValidDate(props.value)) {
|
|
1628
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
1629
|
+
const initialTimeout = setTimeout(() => {
|
|
1630
|
+
const interval = setInterval(() => {
|
|
1631
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
1632
|
+
}, 6e4);
|
|
1633
|
+
return () => clearInterval(interval);
|
|
1634
|
+
}, 5e3);
|
|
1635
|
+
return () => clearTimeout(initialTimeout);
|
|
1636
|
+
} else {
|
|
1637
|
+
setTimeUntilStart("");
|
|
1638
|
+
}
|
|
1639
|
+
}, [props.value]);
|
|
1640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: timeUntilStart });
|
|
1641
|
+
};
|
|
1642
|
+
TimeUntilStartsClient_default = TimeUntilStartsClient;
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
|
|
1563
1646
|
// src/components/CopyButton.tsx
|
|
1564
1647
|
var CopyButton_exports = {};
|
|
1565
1648
|
__export(CopyButton_exports, {
|
|
@@ -1683,7 +1766,11 @@ var init_IframeClient = __esm({
|
|
|
1683
1766
|
import_react31 = __toESM(require("react"));
|
|
1684
1767
|
init_IFrameLoaderView();
|
|
1685
1768
|
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1686
|
-
IframeClient = ({
|
|
1769
|
+
IframeClient = ({
|
|
1770
|
+
src,
|
|
1771
|
+
width,
|
|
1772
|
+
height
|
|
1773
|
+
}) => {
|
|
1687
1774
|
const iframeRef = (0, import_react31.useRef)(null);
|
|
1688
1775
|
const [iframeHeight, setIframeHeight] = (0, import_react31.useState)("100%");
|
|
1689
1776
|
const [isDataFound, setIsDataFound] = (0, import_react31.useState)(null);
|
|
@@ -1692,11 +1779,11 @@ var init_IframeClient = __esm({
|
|
|
1692
1779
|
const eventName = event?.data?.eventName;
|
|
1693
1780
|
const payload = event?.data?.payload;
|
|
1694
1781
|
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
1695
|
-
let
|
|
1782
|
+
let height2 = 500;
|
|
1696
1783
|
if (payload.height > 500) {
|
|
1697
|
-
|
|
1784
|
+
height2 = payload.height + 50;
|
|
1698
1785
|
}
|
|
1699
|
-
setIframeHeight(`${
|
|
1786
|
+
setIframeHeight(`${height2}px`);
|
|
1700
1787
|
}
|
|
1701
1788
|
};
|
|
1702
1789
|
window.addEventListener("message", handleReceiveMessage);
|
|
@@ -1705,7 +1792,10 @@ var init_IframeClient = __esm({
|
|
|
1705
1792
|
(0, import_react31.useEffect)(() => {
|
|
1706
1793
|
const handleResize = () => {
|
|
1707
1794
|
if (iframeRef.current) {
|
|
1708
|
-
iframeRef.current.contentWindow?.postMessage(
|
|
1795
|
+
iframeRef.current.contentWindow?.postMessage(
|
|
1796
|
+
{ eventName: "RESIZE" },
|
|
1797
|
+
"*"
|
|
1798
|
+
);
|
|
1709
1799
|
}
|
|
1710
1800
|
};
|
|
1711
1801
|
window.addEventListener("resize", handleResize);
|
|
@@ -1721,7 +1811,7 @@ var init_IframeClient = __esm({
|
|
|
1721
1811
|
src,
|
|
1722
1812
|
className: "w-full h-full border-none",
|
|
1723
1813
|
scrolling: "no",
|
|
1724
|
-
style: { height: iframeHeight },
|
|
1814
|
+
style: { width: width || "100%", height: height || iframeHeight },
|
|
1725
1815
|
onLoad: handleIframeLoad
|
|
1726
1816
|
}
|
|
1727
1817
|
) }) });
|
|
@@ -3276,75 +3366,10 @@ var DateTimeView = (0, import_dynamic5.default)(() => Promise.resolve().then(()
|
|
|
3276
3366
|
var DateTimeVew_default = DateTimeView;
|
|
3277
3367
|
|
|
3278
3368
|
// src/components/controls/view/TimeUntilStarts.tsx
|
|
3279
|
-
var
|
|
3280
|
-
var
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
const now = /* @__PURE__ */ new Date();
|
|
3284
|
-
const nowUtc = new Date(now.getTime() + now.getTimezoneOffset() * 6e4);
|
|
3285
|
-
const startDateUtc = new Date(startDate);
|
|
3286
|
-
const diffMs = startDateUtc.getTime() - nowUtc.getTime();
|
|
3287
|
-
const isPast = diffMs < 0;
|
|
3288
|
-
const absoluteDiffMs = Math.abs(diffMs);
|
|
3289
|
-
const diffDays = Math.floor(absoluteDiffMs / (1e3 * 60 * 60 * 24));
|
|
3290
|
-
const diffHours = Math.floor(
|
|
3291
|
-
absoluteDiffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)
|
|
3292
|
-
);
|
|
3293
|
-
const diffMinutes = Math.floor(
|
|
3294
|
-
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
3295
|
-
);
|
|
3296
|
-
if (absoluteDiffMs < 6e4) {
|
|
3297
|
-
return "Just now";
|
|
3298
|
-
}
|
|
3299
|
-
let timeParts = [
|
|
3300
|
-
{ value: diffDays, unit: "days" },
|
|
3301
|
-
{ value: diffHours, unit: "hours" },
|
|
3302
|
-
{ value: diffMinutes, unit: "minutes" }
|
|
3303
|
-
];
|
|
3304
|
-
timeParts = timeParts.filter((part) => part.value > 0);
|
|
3305
|
-
if (isPast) {
|
|
3306
|
-
if (diffDays > 0) {
|
|
3307
|
-
return `${diffDays} day(s) ago`;
|
|
3308
|
-
} else if (diffHours > 0) {
|
|
3309
|
-
return `${diffHours} hour(s) ago`;
|
|
3310
|
-
} else if (diffMinutes > 0) {
|
|
3311
|
-
return `${diffMinutes} minute(s) ago`;
|
|
3312
|
-
} else {
|
|
3313
|
-
return "Just now";
|
|
3314
|
-
}
|
|
3315
|
-
} else {
|
|
3316
|
-
if (timeParts.length > 2) {
|
|
3317
|
-
timeParts = timeParts.slice(0, 2);
|
|
3318
|
-
}
|
|
3319
|
-
const displayString = timeParts.map((part) => `${part.value} ${part.unit}`).join(" ");
|
|
3320
|
-
return displayString ? `Starting in ${displayString}` : "Started";
|
|
3321
|
-
}
|
|
3322
|
-
};
|
|
3323
|
-
const isValidDate = (date) => {
|
|
3324
|
-
return !isNaN(Date.parse(date));
|
|
3325
|
-
};
|
|
3326
|
-
const [timeUntilStart, setTimeUntilStart] = (0, import_react20.useState)(() => {
|
|
3327
|
-
if (props.value && isValidDate(props.value)) {
|
|
3328
|
-
return calculateTimeDifference(props.value);
|
|
3329
|
-
}
|
|
3330
|
-
return "";
|
|
3331
|
-
});
|
|
3332
|
-
(0, import_react20.useEffect)(() => {
|
|
3333
|
-
if (props.value && isValidDate(props.value)) {
|
|
3334
|
-
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
3335
|
-
const initialTimeout = setTimeout(() => {
|
|
3336
|
-
const interval = setInterval(() => {
|
|
3337
|
-
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
3338
|
-
}, 6e4);
|
|
3339
|
-
return () => clearInterval(interval);
|
|
3340
|
-
}, 5e3);
|
|
3341
|
-
return () => clearTimeout(initialTimeout);
|
|
3342
|
-
} else {
|
|
3343
|
-
setTimeUntilStart("");
|
|
3344
|
-
}
|
|
3345
|
-
}, [props.value]);
|
|
3346
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: timeUntilStart });
|
|
3347
|
-
};
|
|
3369
|
+
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
3370
|
+
var TimeUntilStarts = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_TimeUntilStartsClient(), TimeUntilStartsClient_exports)), {
|
|
3371
|
+
ssr: false
|
|
3372
|
+
});
|
|
3348
3373
|
var TimeUntilStarts_default = TimeUntilStarts;
|
|
3349
3374
|
|
|
3350
3375
|
// src/components/controls/view/ViewControl.tsx
|
|
@@ -3370,7 +3395,7 @@ var ViewControl = (props) => {
|
|
|
3370
3395
|
[ViewControlTypes_default.status]: StatusView_default,
|
|
3371
3396
|
[ViewControlTypes_default.statusBg]: StatusBgView_default,
|
|
3372
3397
|
[ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
|
|
3373
|
-
|
|
3398
|
+
[ViewControlTypes_default.timeUntilStarts]: TimeUntilStarts_default,
|
|
3374
3399
|
// [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
|
|
3375
3400
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
|
|
3376
3401
|
[ViewControlTypes_default.booleanView]: BooleanView_default,
|
|
@@ -3648,9 +3673,9 @@ var QuoteNode_default = QuoteNode;
|
|
|
3648
3673
|
|
|
3649
3674
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3650
3675
|
var import_react28 = __toESM(require("react"));
|
|
3651
|
-
var
|
|
3676
|
+
var import_dynamic7 = __toESM(require("next/dynamic"));
|
|
3652
3677
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3653
|
-
var CopyButton2 = (0,
|
|
3678
|
+
var CopyButton2 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
3654
3679
|
ssr: false,
|
|
3655
3680
|
// optional: fallback UI while loading
|
|
3656
3681
|
loading: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
@@ -3787,13 +3812,13 @@ var WidgetNode = (props) => {
|
|
|
3787
3812
|
var WidgetNode_default = WidgetNode;
|
|
3788
3813
|
|
|
3789
3814
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3790
|
-
var
|
|
3815
|
+
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
3791
3816
|
var import_react34 = __toESM(require("react"));
|
|
3792
3817
|
|
|
3793
3818
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3794
|
-
var
|
|
3819
|
+
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
3795
3820
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3796
|
-
var IframeClient2 = (0,
|
|
3821
|
+
var IframeClient2 = (0, import_dynamic8.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
3797
3822
|
ssr: false
|
|
3798
3823
|
});
|
|
3799
3824
|
var EmbedNode = (props) => {
|
|
@@ -4033,9 +4058,9 @@ var NoDataFound = () => {
|
|
|
4033
4058
|
var NoDataFound_default = NoDataFound;
|
|
4034
4059
|
|
|
4035
4060
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4036
|
-
var
|
|
4061
|
+
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
4037
4062
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4038
|
-
var HlsPlayer4 = (0,
|
|
4063
|
+
var HlsPlayer4 = (0, import_dynamic9.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
4039
4064
|
var deviceToMediaQuery = (device) => {
|
|
4040
4065
|
switch (device) {
|
|
4041
4066
|
case "lg":
|
|
@@ -4883,8 +4908,8 @@ var DocumentNode_default = DocumentNode;
|
|
|
4883
4908
|
|
|
4884
4909
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4885
4910
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4886
|
-
var Pagination2 = (0,
|
|
4887
|
-
var Slider2 = (0,
|
|
4911
|
+
var Pagination2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
4912
|
+
var Slider2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
4888
4913
|
ssr: false
|
|
4889
4914
|
});
|
|
4890
4915
|
function toCamelCase(str) {
|