@eshal-bot/chat-widget 0.1.120 → 0.1.122

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.
@@ -89365,12 +89365,22 @@
89365
89365
  const _ISO_DATETIME_CELL_RE = /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2})?(\.\d+)?(Z|[+-]\d{2}:?\d{2})?)?$/;
89366
89366
  function _formatDateCell(value) {
89367
89367
  if (typeof value !== 'string') return null;
89368
- if (!_ISO_DATETIME_CELL_RE.test(value.trim())) return null;
89369
- const d = new Date(value);
89368
+ const trimmed = value.trim();
89369
+ if (!_ISO_DATETIME_CELL_RE.test(trimmed)) return null;
89370
+ // A date-time string with no trailing 'Z'/offset is parsed by `new
89371
+ // Date()` as LOCAL time (ECMA-262), but we read it back below via UTC
89372
+ // getters - so a timezone-less value must be normalized to UTC first,
89373
+ // or a non-UTC runtime renders the wrong calendar day/time (EV-2783
89374
+ // follow-up). Date-only strings (no time part) are already parsed as
89375
+ // UTC midnight per spec and need no change.
89376
+ const hasTime = /[T ]\d{2}:\d{2}/.test(trimmed);
89377
+ const hasTz = /(Z|[+-]\d{2}:?\d{2})$/.test(trimmed);
89378
+ const parseable = hasTime && !hasTz ? "".concat(trimmed.replace(' ', 'T'), "Z") : trimmed;
89379
+ const d = new Date(parseable);
89370
89380
  if (isNaN(d.getTime())) return null;
89371
- const hasTime = /[T ]\d{2}:\d{2}/.test(value) && (d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0 || d.getUTCSeconds() !== 0);
89381
+ const hasNonMidnightTime = hasTime && (d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0 || d.getUTCSeconds() !== 0);
89372
89382
  const dateStr = "".concat(_MONTH_NAMES[d.getUTCMonth()], " ").concat(d.getUTCDate(), ", ").concat(d.getUTCFullYear());
89373
- if (!hasTime) return dateStr;
89383
+ if (!hasNonMidnightTime) return dateStr;
89374
89384
  const h = d.getUTCHours();
89375
89385
  const ampm = h >= 12 ? 'PM' : 'AM';
89376
89386
  const h12 = h % 12 || 12;
@@ -90984,7 +90994,15 @@
90984
90994
  gap: 3,
90985
90995
  height: 20,
90986
90996
  padding: "0 5px 0 6px",
90987
- margin: "0 2px",
90997
+ // Logical, and deliberately asymmetric: the leading side stays
90998
+ // tight (the rehype plugin glues the pill to its word with an
90999
+ // NBSP, so the pill reads as belonging to the claim it cites),
91000
+ // while the trailing side gets real space so the next sentence
91001
+ // does not butt straight up against the border. `margin: 0 2px`
91002
+ // on both sides is what made a paragraph of cited claims read
91003
+ // as one unbroken blob.
91004
+ marginInlineStart: 2,
91005
+ marginInlineEnd: 7,
90988
91006
  fontSize: 11,
90989
91007
  lineHeight: 1,
90990
91008
  borderRadius: 5,