@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260808070128 → 0.8.1-dev.20260808073515
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/TimeUntilStartsClient-4C7NDEAD.mjs +76 -0
- package/dist/TimeUntilStartsClient-5HGQ5JKM.mjs +78 -0
- package/dist/index.js +103 -85
- package/dist/index.mjs +327 -392
- package/dist/server.js +97 -79
- 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, {
|
|
@@ -3276,75 +3359,10 @@ var DateTimeView = (0, import_dynamic5.default)(() => Promise.resolve().then(()
|
|
|
3276
3359
|
var DateTimeVew_default = DateTimeView;
|
|
3277
3360
|
|
|
3278
3361
|
// 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
|
-
};
|
|
3362
|
+
var import_dynamic6 = __toESM(require("next/dynamic"));
|
|
3363
|
+
var TimeUntilStarts = (0, import_dynamic6.default)(() => Promise.resolve().then(() => (init_TimeUntilStartsClient(), TimeUntilStartsClient_exports)), {
|
|
3364
|
+
ssr: false
|
|
3365
|
+
});
|
|
3348
3366
|
var TimeUntilStarts_default = TimeUntilStarts;
|
|
3349
3367
|
|
|
3350
3368
|
// src/components/controls/view/ViewControl.tsx
|
|
@@ -3370,7 +3388,7 @@ var ViewControl = (props) => {
|
|
|
3370
3388
|
[ViewControlTypes_default.status]: StatusView_default,
|
|
3371
3389
|
[ViewControlTypes_default.statusBg]: StatusBgView_default,
|
|
3372
3390
|
[ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
|
|
3373
|
-
|
|
3391
|
+
[ViewControlTypes_default.timeUntilStarts]: TimeUntilStarts_default,
|
|
3374
3392
|
// [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
|
|
3375
3393
|
[ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
|
|
3376
3394
|
[ViewControlTypes_default.booleanView]: BooleanView_default,
|
|
@@ -3648,9 +3666,9 @@ var QuoteNode_default = QuoteNode;
|
|
|
3648
3666
|
|
|
3649
3667
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3650
3668
|
var import_react28 = __toESM(require("react"));
|
|
3651
|
-
var
|
|
3669
|
+
var import_dynamic7 = __toESM(require("next/dynamic"));
|
|
3652
3670
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3653
|
-
var CopyButton2 = (0,
|
|
3671
|
+
var CopyButton2 = (0, import_dynamic7.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
3654
3672
|
ssr: false,
|
|
3655
3673
|
// optional: fallback UI while loading
|
|
3656
3674
|
loading: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
@@ -3787,13 +3805,13 @@ var WidgetNode = (props) => {
|
|
|
3787
3805
|
var WidgetNode_default = WidgetNode;
|
|
3788
3806
|
|
|
3789
3807
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3790
|
-
var
|
|
3808
|
+
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
3791
3809
|
var import_react34 = __toESM(require("react"));
|
|
3792
3810
|
|
|
3793
3811
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3794
|
-
var
|
|
3812
|
+
var import_dynamic8 = __toESM(require("next/dynamic"));
|
|
3795
3813
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3796
|
-
var IframeClient2 = (0,
|
|
3814
|
+
var IframeClient2 = (0, import_dynamic8.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
3797
3815
|
ssr: false
|
|
3798
3816
|
});
|
|
3799
3817
|
var EmbedNode = (props) => {
|
|
@@ -4033,9 +4051,9 @@ var NoDataFound = () => {
|
|
|
4033
4051
|
var NoDataFound_default = NoDataFound;
|
|
4034
4052
|
|
|
4035
4053
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4036
|
-
var
|
|
4054
|
+
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
4037
4055
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4038
|
-
var HlsPlayer4 = (0,
|
|
4056
|
+
var HlsPlayer4 = (0, import_dynamic9.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
4039
4057
|
var deviceToMediaQuery = (device) => {
|
|
4040
4058
|
switch (device) {
|
|
4041
4059
|
case "lg":
|
|
@@ -4883,8 +4901,8 @@ var DocumentNode_default = DocumentNode;
|
|
|
4883
4901
|
|
|
4884
4902
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4885
4903
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4886
|
-
var Pagination2 = (0,
|
|
4887
|
-
var Slider2 = (0,
|
|
4904
|
+
var Pagination2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
4905
|
+
var Slider2 = (0, import_dynamic10.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
4888
4906
|
ssr: false
|
|
4889
4907
|
});
|
|
4890
4908
|
function toCamelCase(str) {
|