@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260902104957 → 0.8.1-dev.20260902122246

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.
@@ -334,6 +334,10 @@ var CommentImageNode = ({ node, assetBaseUrl }) => {
334
334
  display: "block",
335
335
  width: "auto",
336
336
  height: "auto",
337
+ // Cap the thumbnail so a large upload doesn't blow out the
338
+ // message width/height; the lightbox shows it full size on click.
339
+ maxWidth: "min(320px, 100%)",
340
+ maxHeight: "320px",
337
341
  objectFit: "cover",
338
342
  borderRadius: "0.375rem",
339
343
  margin: "0.5rem 0",
@@ -741,7 +745,6 @@ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
741
745
  var LINK_STYLE = { textDecoration: "underline", wordBreak: "break-word" };
742
746
  var CODE_BLOCK_STYLE = {
743
747
  margin: "0.5rem 0",
744
- padding: "0.625rem 0.75rem",
745
748
  borderRadius: "0.5rem",
746
749
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
747
750
  fontSize: "0.8125rem",
@@ -332,6 +332,10 @@ var CommentImageNode = ({ node, assetBaseUrl }) => {
332
332
  display: "block",
333
333
  width: "auto",
334
334
  height: "auto",
335
+ // Cap the thumbnail so a large upload doesn't blow out the
336
+ // message width/height; the lightbox shows it full size on click.
337
+ maxWidth: "min(320px, 100%)",
338
+ maxHeight: "320px",
335
339
  objectFit: "cover",
336
340
  borderRadius: "0.375rem",
337
341
  margin: "0.5rem 0",
@@ -739,7 +743,6 @@ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
739
743
  var LINK_STYLE = { textDecoration: "underline", wordBreak: "break-word" };
740
744
  var CODE_BLOCK_STYLE = {
741
745
  margin: "0.5rem 0",
742
- padding: "0.625rem 0.75rem",
743
746
  borderRadius: "0.5rem",
744
747
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
745
748
  fontSize: "0.8125rem",
@@ -18,6 +18,11 @@ var TimeUntilStartsClient = (props) => {
18
18
  const diffMinutes = Math.floor(
19
19
  absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
20
20
  );
21
+ if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
22
+ const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
23
+ const padTimePart = (value) => value.toString().padStart(2, "0");
24
+ return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
25
+ }
21
26
  if (absoluteDiffMs < 6e4) {
22
27
  return "Just now";
23
28
  }
@@ -56,14 +61,24 @@ var TimeUntilStartsClient = (props) => {
56
61
  });
57
62
  useEffect(() => {
58
63
  if (props.value && isValidDate(props.value)) {
64
+ const getRemainingMilliseconds = () => {
65
+ const now = /* @__PURE__ */ new Date();
66
+ const nowUtc = new Date(
67
+ now.getTime() + now.getTimezoneOffset() * 6e4
68
+ );
69
+ return new Date(props.value).getTime() - nowUtc.getTime();
70
+ };
71
+ const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
59
72
  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);
73
+ const interval = setInterval(() => {
74
+ if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
75
+ clearInterval(interval);
76
+ window.location.reload();
77
+ return;
78
+ }
79
+ setTimeUntilStart(calculateTimeDifference(props.value));
80
+ }, 1e3);
81
+ return () => clearInterval(interval);
67
82
  } else {
68
83
  setTimeUntilStart("");
69
84
  }
@@ -20,6 +20,11 @@ var TimeUntilStartsClient = (props) => {
20
20
  const diffMinutes = Math.floor(
21
21
  absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
22
22
  );
23
+ if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
24
+ const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
25
+ const padTimePart = (value) => value.toString().padStart(2, "0");
26
+ return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
27
+ }
23
28
  if (absoluteDiffMs < 6e4) {
24
29
  return "Just now";
25
30
  }
@@ -58,14 +63,24 @@ var TimeUntilStartsClient = (props) => {
58
63
  });
59
64
  useEffect(() => {
60
65
  if (props.value && isValidDate(props.value)) {
66
+ const getRemainingMilliseconds = () => {
67
+ const now = /* @__PURE__ */ new Date();
68
+ const nowUtc = new Date(
69
+ now.getTime() + now.getTimezoneOffset() * 6e4
70
+ );
71
+ return new Date(props.value).getTime() - nowUtc.getTime();
72
+ };
73
+ const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
61
74
  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);
75
+ const interval = setInterval(() => {
76
+ if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
77
+ clearInterval(interval);
78
+ window.location.reload();
79
+ return;
80
+ }
81
+ setTimeUntilStart(calculateTimeDifference(props.value));
82
+ }, 1e3);
83
+ return () => clearInterval(interval);
69
84
  } else {
70
85
  setTimeUntilStart("");
71
86
  }
package/dist/index.js CHANGED
@@ -850,6 +850,11 @@ var init_TimeUntilStartsClient = __esm({
850
850
  const diffMinutes = Math.floor(
851
851
  absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
852
852
  );
853
+ if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
854
+ const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
855
+ const padTimePart = (value) => value.toString().padStart(2, "0");
856
+ return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
857
+ }
853
858
  if (absoluteDiffMs < 6e4) {
854
859
  return "Just now";
855
860
  }
@@ -888,14 +893,24 @@ var init_TimeUntilStartsClient = __esm({
888
893
  });
889
894
  (0, import_react16.useEffect)(() => {
890
895
  if (props.value && isValidDate(props.value)) {
896
+ const getRemainingMilliseconds = () => {
897
+ const now = /* @__PURE__ */ new Date();
898
+ const nowUtc = new Date(
899
+ now.getTime() + now.getTimezoneOffset() * 6e4
900
+ );
901
+ return new Date(props.value).getTime() - nowUtc.getTime();
902
+ };
903
+ const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
891
904
  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);
905
+ const interval = setInterval(() => {
906
+ if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
907
+ clearInterval(interval);
908
+ window.location.reload();
909
+ return;
910
+ }
911
+ setTimeUntilStart(calculateTimeDifference(props.value));
912
+ }, 1e3);
913
+ return () => clearInterval(interval);
899
914
  } else {
900
915
  setTimeUntilStart("");
901
916
  }
@@ -1303,6 +1318,10 @@ var init_CommentImageNode = __esm({
1303
1318
  display: "block",
1304
1319
  width: "auto",
1305
1320
  height: "auto",
1321
+ // Cap the thumbnail so a large upload doesn't blow out the
1322
+ // message width/height; the lightbox shows it full size on click.
1323
+ maxWidth: "min(320px, 100%)",
1324
+ maxHeight: "320px",
1306
1325
  objectFit: "cover",
1307
1326
  borderRadius: "0.375rem",
1308
1327
  margin: "0.5rem 0",
@@ -1734,7 +1753,6 @@ var init_CommentNodeRenderer = __esm({
1734
1753
  LINK_STYLE = { textDecoration: "underline", wordBreak: "break-word" };
1735
1754
  CODE_BLOCK_STYLE = {
1736
1755
  margin: "0.5rem 0",
1737
- padding: "0.625rem 0.75rem",
1738
1756
  borderRadius: "0.5rem",
1739
1757
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
1740
1758
  fontSize: "0.8125rem",
package/dist/index.mjs CHANGED
@@ -403,14 +403,14 @@ var DateTimeVew_default = DateTimeView;
403
403
 
404
404
  // src/components/controls/view/TimeUntilStarts.tsx
405
405
  import dynamic4 from "next/dynamic";
406
- var TimeUntilStarts = dynamic4(() => import("./TimeUntilStartsClient-5HGQ5JKM.mjs"), {
406
+ var TimeUntilStarts = dynamic4(() => import("./TimeUntilStartsClient-ZKTMV247.mjs"), {
407
407
  ssr: false
408
408
  });
409
409
  var TimeUntilStarts_default = TimeUntilStarts;
410
410
 
411
411
  // src/components/controls/view/Commentrenderer.tsx
412
412
  import dynamic5 from "next/dynamic";
413
- var CommentRenderer = dynamic5(() => import("./CommentRendererClient-47HE6YFP.mjs"), {
413
+ var CommentRenderer = dynamic5(() => import("./CommentRendererClient-52UOUQAD.mjs"), {
414
414
  ssr: false
415
415
  });
416
416
  var Commentrenderer_default = CommentRenderer;
package/dist/server.js CHANGED
@@ -1637,6 +1637,11 @@ var init_TimeUntilStartsClient = __esm({
1637
1637
  const diffMinutes = Math.floor(
1638
1638
  absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
1639
1639
  );
1640
+ if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
1641
+ const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
1642
+ const padTimePart = (value) => value.toString().padStart(2, "0");
1643
+ return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
1644
+ }
1640
1645
  if (absoluteDiffMs < 6e4) {
1641
1646
  return "Just now";
1642
1647
  }
@@ -1675,14 +1680,24 @@ var init_TimeUntilStartsClient = __esm({
1675
1680
  });
1676
1681
  (0, import_react21.useEffect)(() => {
1677
1682
  if (props.value && isValidDate(props.value)) {
1683
+ const getRemainingMilliseconds = () => {
1684
+ const now = /* @__PURE__ */ new Date();
1685
+ const nowUtc = new Date(
1686
+ now.getTime() + now.getTimezoneOffset() * 6e4
1687
+ );
1688
+ return new Date(props.value).getTime() - nowUtc.getTime();
1689
+ };
1690
+ const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
1678
1691
  setTimeUntilStart(calculateTimeDifference(props.value));
1679
- const initialTimeout = setTimeout(() => {
1680
- const interval = setInterval(() => {
1681
- setTimeUntilStart(calculateTimeDifference(props.value));
1682
- }, 6e4);
1683
- return () => clearInterval(interval);
1684
- }, 5e3);
1685
- return () => clearTimeout(initialTimeout);
1692
+ const interval = setInterval(() => {
1693
+ if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
1694
+ clearInterval(interval);
1695
+ window.location.reload();
1696
+ return;
1697
+ }
1698
+ setTimeUntilStart(calculateTimeDifference(props.value));
1699
+ }, 1e3);
1700
+ return () => clearInterval(interval);
1686
1701
  } else {
1687
1702
  setTimeUntilStart("");
1688
1703
  }
@@ -2090,6 +2105,10 @@ var init_CommentImageNode = __esm({
2090
2105
  display: "block",
2091
2106
  width: "auto",
2092
2107
  height: "auto",
2108
+ // Cap the thumbnail so a large upload doesn't blow out the
2109
+ // message width/height; the lightbox shows it full size on click.
2110
+ maxWidth: "min(320px, 100%)",
2111
+ maxHeight: "320px",
2093
2112
  objectFit: "cover",
2094
2113
  borderRadius: "0.375rem",
2095
2114
  margin: "0.5rem 0",
@@ -2521,7 +2540,6 @@ var init_CommentNodeRenderer = __esm({
2521
2540
  LINK_STYLE = { textDecoration: "underline", wordBreak: "break-word" };
2522
2541
  CODE_BLOCK_STYLE = {
2523
2542
  margin: "0.5rem 0",
2524
- padding: "0.625rem 0.75rem",
2525
2543
  borderRadius: "0.5rem",
2526
2544
  fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
2527
2545
  fontSize: "0.8125rem",
package/dist/server.mjs CHANGED
@@ -736,14 +736,14 @@ var DateTimeVew_default = DateTimeView;
736
736
 
737
737
  // src/components/controls/view/TimeUntilStarts.tsx
738
738
  import dynamic6 from "next/dynamic";
739
- var TimeUntilStarts = dynamic6(() => import("./TimeUntilStartsClient-4C7NDEAD.mjs"), {
739
+ var TimeUntilStarts = dynamic6(() => import("./TimeUntilStartsClient-P4VJIOJJ.mjs"), {
740
740
  ssr: false
741
741
  });
742
742
  var TimeUntilStarts_default = TimeUntilStarts;
743
743
 
744
744
  // src/components/controls/view/Commentrenderer.tsx
745
745
  import dynamic7 from "next/dynamic";
746
- var CommentRenderer = dynamic7(() => import("./CommentRendererClient-WZ4EQKSL.mjs"), {
746
+ var CommentRenderer = dynamic7(() => import("./CommentRendererClient-QC65XBT2.mjs"), {
747
747
  ssr: false
748
748
  });
749
749
  var Commentrenderer_default = CommentRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clyrex-digital/clyrex-controls-dev",
3
- "version": "0.8.1-dev.20260902104957",
3
+ "version": "0.8.1-dev.20260902122246",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",