@activecollab/components 2.0.406 → 2.0.408

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.
@@ -217,6 +217,54 @@ const StatusChip = _ref => {
217
217
  });
218
218
  };
219
219
 
220
+ /* --- Relative "ago" time -------------------------------------------------- */
221
+ /* The Time column reads relative to a fixed "now" so the mock's examples stay */
222
+ /* stable across renders — a live clock would drift the buckets on every reload */
223
+ /* and the crafted "3 minutes ago" / "Yesterday" rows would lose their meaning. */
224
+
225
+ const NOW = new Date(2026, 7, 11, 15, 0, 0); // Tue, 11 Aug 2026, 15:00
226
+ const NOW_TS = Math.floor(NOW.getTime() / 1000);
227
+ const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
228
+ const pad2 = value => String(value).padStart(2, "0");
229
+ const startOfDay = date => new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
230
+
231
+ /**
232
+ * When a webhook was received, in the app's relative style:
233
+ * < 1 min → "Just now"
234
+ * < 1 hour → "N minutes ago"
235
+ * earlier today → "Today, HH:MM"
236
+ * yesterday → "Yesterday, HH:MM"
237
+ * older, this year → "MMM D"
238
+ * older, earlier years → "MMM D, YYYY"
239
+ */
240
+ const formatReceivedAt = function (receivedAt, now) {
241
+ if (now === void 0) {
242
+ now = NOW;
243
+ }
244
+ const then = new Date(receivedAt * 1000);
245
+ const diffMinutes = Math.floor((now.getTime() - then.getTime()) / 60000);
246
+ if (diffMinutes < 1) {
247
+ return "Just now";
248
+ }
249
+ if (diffMinutes < 60) {
250
+ return diffMinutes + " " + (diffMinutes === 1 ? "minute" : "minutes") + " ago";
251
+ }
252
+ const time = pad2(then.getHours()) + ":" + pad2(then.getMinutes());
253
+ const dayDiff = Math.round((startOfDay(now) - startOfDay(then)) / 86400000);
254
+ if (dayDiff === 0) {
255
+ return "Today, " + time;
256
+ }
257
+ if (dayDiff === 1) {
258
+ return "Yesterday, " + time;
259
+ }
260
+ const date = MONTHS[then.getMonth()] + " " + then.getDate();
261
+ return then.getFullYear() === now.getFullYear() ? date : date + ", " + then.getFullYear();
262
+ };
263
+
264
+ /* Timestamp helpers for the mock data below. */
265
+ const secondsAgo = seconds => NOW_TS - seconds;
266
+ const at = (year, month, day, hour, minute) => Math.floor(new Date(year, month, day, hour, minute, 0).getTime() / 1000);
267
+
220
268
  /* --- Mock log data (newest first is enforced by sorting on receivedAt) --- */
221
269
 
222
270
  const PAYLOAD_ISSUE_OPENED = JSON.stringify({
@@ -284,8 +332,10 @@ const PAYLOAD_PUSH = JSON.stringify({
284
332
  full_name: "activecollab/feather"
285
333
  }
286
334
  }, null, 2);
287
- const WEBHOOK_LOGS = [{
288
- id: "log-7",
335
+ const WEBHOOK_LOGS = [
336
+ // Just now (< 1 minute)
337
+ {
338
+ id: "log-just-now",
289
339
  connectionId: "gh-activecollab",
290
340
  repositoryId: "ac-feather",
291
341
  eventKind: "issue",
@@ -301,10 +351,11 @@ const WEBHOOK_LOGS = [{
301
351
  }
302
352
  }],
303
353
  payload: PAYLOAD_ISSUE_OPENED,
304
- receivedOn: "Jun 29, 2026 · 14:32",
305
- receivedAt: 1751207520
306
- }, {
307
- id: "log-6",
354
+ receivedAt: secondsAgo(25)
355
+ },
356
+ // Minutes ago
357
+ {
358
+ id: "log-3m",
308
359
  connectionId: "gl-content",
309
360
  repositoryId: "co-handbook",
310
361
  eventKind: "pull_request",
@@ -314,12 +365,11 @@ const WEBHOOK_LOGS = [{
314
365
  summary: "Skipped: merge request has no linked issue"
315
366
  }],
316
367
  payload: PAYLOAD_MERGE_REQUEST,
317
- receivedOn: "Jun 29, 2026 · 11:08",
318
- receivedAt: 1751195280
368
+ receivedAt: secondsAgo(3 * 60)
319
369
  }, {
320
- id: "log-5",
321
- connectionId: "gh-activecollab",
322
- repositoryId: "ac-backend",
370
+ id: "log-12m",
371
+ connectionId: "gh-abstergo",
372
+ repositoryId: "ab-animus",
323
373
  eventKind: "issue",
324
374
  status: "failed",
325
375
  deliveryIdentifier: "9c1185a5-c5e9-4e3f-8a1b-7d6e5f4c3b2a",
@@ -327,12 +377,11 @@ const WEBHOOK_LOGS = [{
327
377
  summary: "Failed at task creation: project not found"
328
378
  }],
329
379
  payload: PAYLOAD_ISSUE_OPENED,
330
- receivedOn: "Jun 28, 2026 · 18:54",
331
- receivedAt: 1751136840
380
+ receivedAt: secondsAgo(12 * 60)
332
381
  }, {
333
- id: "log-4",
334
- connectionId: "gl-content",
335
- repositoryId: "co-handbook",
382
+ id: "log-47m",
383
+ connectionId: "gl-platform",
384
+ repositoryId: "pl-gateway",
336
385
  eventKind: "push",
337
386
  status: "processed",
338
387
  deliveryIdentifier: "f7c3bc1d-8c5a-4b2e-9f0a-1b2c3d4e5f60",
@@ -354,10 +403,11 @@ const WEBHOOK_LOGS = [{
354
403
  }
355
404
  }],
356
405
  payload: PAYLOAD_PUSH,
357
- receivedOn: "Jun 28, 2026 · 09:21",
358
- receivedAt: 1751102460
359
- }, {
360
- id: "log-3",
406
+ receivedAt: secondsAgo(47 * 60)
407
+ },
408
+ // Earlier today
409
+ {
410
+ id: "log-today-1",
361
411
  connectionId: "gh-activecollab",
362
412
  repositoryId: "ac-feather",
363
413
  eventKind: "other",
@@ -368,48 +418,109 @@ const WEBHOOK_LOGS = [{
368
418
  zen: "Keep it logically awesome.",
369
419
  hook_id: 552012
370
420
  }, null, 2),
371
- receivedOn: "Jun 27, 2026 · 16:05",
372
- receivedAt: 1751040300
421
+ receivedAt: at(2026, 7, 11, 10, 0)
373
422
  }, {
374
- id: "log-2",
423
+ id: "log-today-2",
424
+ connectionId: "gh-binford",
425
+ repositoryId: "bi-tool-time",
426
+ eventKind: "pull_request_review",
427
+ status: "processed",
428
+ deliveryIdentifier: "5f2b1c8e-7a3d-4e6f-9b0c-1d2e3f4a5b6c",
429
+ outcomes: [{
430
+ summary: "Referenced task #1699 from pull request #58",
431
+ task: {
432
+ id: 1699,
433
+ name: "Refresh the Tool Time build badge",
434
+ projectName: "Tool Time",
435
+ description: "The build badge shows an old status. Update it when the pipeline finishes."
436
+ }
437
+ }],
438
+ payload: PAYLOAD_MERGE_REQUEST,
439
+ receivedAt: at(2026, 7, 11, 7, 12)
440
+ },
441
+ // Yesterday
442
+ {
443
+ id: "log-yesterday-1",
375
444
  connectionId: "gl-content",
376
445
  repositoryId: "co-marketing",
377
446
  eventKind: "issue",
378
447
  status: "received",
379
448
  deliveryIdentifier: "0716d970-2b9e-4a1d-9c3f-5e6a7b8c9d01",
380
449
  outcomes: [],
381
- receivedOn: "Jun 27, 2026 · 08:47",
382
- receivedAt: 1751013420
450
+ receivedAt: at(2026, 7, 10, 13, 20)
383
451
  }, {
384
- id: "log-1",
452
+ id: "log-yesterday-2",
385
453
  connectionId: "gh-activecollab",
386
454
  repositoryId: "ac-feather",
387
455
  eventKind: "issue",
388
- status: "processed",
456
+ status: "duplicate",
389
457
  deliveryIdentifier: "fa3ebd6742c360b2d9652b7f78d9bd7d",
458
+ outcomes: [],
459
+ payload: PAYLOAD_ISSUE_OPENED,
460
+ receivedAt: at(2026, 7, 10, 9, 5)
461
+ },
462
+ // Older, this year — date only
463
+ {
464
+ id: "log-aug-8",
465
+ connectionId: "gh-activecollab",
466
+ repositoryId: "ac-backend",
467
+ eventKind: "repository",
468
+ status: "skipped",
469
+ deliveryIdentifier: "2c9d0e1f-3a4b-4c5d-8e9f-0a1b2c3d4e5f",
470
+ outcomes: [{
471
+ summary: "Skipped: repository events are not processed"
472
+ }],
473
+ receivedAt: at(2026, 7, 8, 16, 42)
474
+ }, {
475
+ id: "log-jul-30",
476
+ connectionId: "gl-acme-ce",
477
+ repositoryId: "acme-ce",
478
+ eventKind: "push",
479
+ status: "failed",
480
+ deliveryIdentifier: "7d8e9f0a-1b2c-4d3e-9f0a-2b3c4d5e6f70",
390
481
  outcomes: [{
391
- summary: "Created task #1804 from issue #29",
482
+ summary: "Failed to match a repository for this push"
483
+ }],
484
+ payload: PAYLOAD_PUSH,
485
+ receivedAt: at(2026, 6, 30, 11, 9)
486
+ }, {
487
+ id: "log-jun-12",
488
+ connectionId: "gh-abstergo",
489
+ repositoryId: "ab-animus",
490
+ eventKind: "issue",
491
+ status: "processed",
492
+ deliveryIdentifier: "aa11bb22-cc33-4d44-9e55-6f7788990011",
493
+ outcomes: [{
494
+ summary: "Created task #1720 from issue #204",
392
495
  task: {
393
- id: 1804,
394
- name: "Restore missing repository icons",
395
- projectName: "Feather",
396
- description: "Provider icons are missing from the repository list. Restore the GitHub and GitLab glyphs."
496
+ id: 1720,
497
+ name: "Animus sync drops issue labels",
498
+ projectName: "Animus",
499
+ description: "Issue labels are lost when Animus syncs from GitHub. Map the incoming labels onto task labels."
397
500
  }
398
501
  }],
399
502
  payload: PAYLOAD_ISSUE_OPENED,
400
- receivedOn: "Jun 26, 2026 · 13:12",
401
- receivedAt: 1750943520
402
- }, {
403
- id: "log-1-replay",
404
- connectionId: "gh-activecollab",
405
- repositoryId: "ac-feather",
503
+ receivedAt: at(2026, 5, 12, 8, 30)
504
+ },
505
+ // Older, earlier year — date with year
506
+ {
507
+ id: "log-mar-2025",
508
+ connectionId: "gl-platform",
509
+ repositoryId: "pl-gateway",
406
510
  eventKind: "issue",
407
- status: "duplicate",
408
- deliveryIdentifier: "fa3ebd6742c360b2d9652b7f78d9bd7d",
409
- outcomes: [],
511
+ status: "processed",
512
+ deliveryIdentifier: "bb22cc33-dd44-4e55-9f66-7a8899001122",
513
+ outcomes: [{
514
+ summary: "Created task #1533 from issue #88",
515
+ task: {
516
+ id: 1533,
517
+ name: "Gateway times out on large payloads",
518
+ projectName: "API Gateway",
519
+ description: "Large webhook payloads time out at the gateway. Raise the body limit or stream the request."
520
+ }
521
+ }],
410
522
  payload: PAYLOAD_ISSUE_OPENED,
411
- receivedOn: "Jun 26, 2026 · 13:18",
412
- receivedAt: 1750943880
523
+ receivedAt: at(2025, 2, 3, 10, 15)
413
524
  }];
414
525
 
415
526
  /* --- Lightweight, Prism-style JSON syntax highlighter -------------------- */
@@ -471,7 +582,7 @@ const PayloadBlock = _ref3 => {
471
582
  const LogRowWrap = styled.div.withConfig({
472
583
  displayName: "WebhookLogsDialog__LogRowWrap",
473
584
  componentId: "sc-6ol7f6-2"
474
- })(["border-top:1px solid var(--color-theme-300);.lr-summary{box-sizing:border-box;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 8px 8px 12px;background:none;border:0;text-align:left;cursor:pointer;font-family:inherit;&:hover{background-color:var(--color-theme-200);}}.lr-expand{flex-shrink:0;fill:var(--color-theme-600);color:var(--color-theme-600);transform:rotate(180deg);transition:transform 200ms ease;}.lr-expand.open{transform:rotate(0deg);}.lr-conn{display:flex;align-items:center;gap:8px;width:180px;min-width:0;flex-shrink:0;}.lr-conn svg{width:20px;height:20px;flex-shrink:0;}.lr-conn .lr-conn-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.lr-event{flex:1 1 0%;min-width:0;}.lr-status{flex-shrink:0;}.lr-outcomes{width:96px;flex-shrink:0;text-align:right;}.lr-detail{padding:4px 16px 20px 44px;display:flex;flex-direction:column;gap:16px;}.lr-field-label{display:block;margin-bottom:4px;}.lr-id{font-family:\"SFMono-Regular\",Consolas,\"Liberation Mono\",Menlo,monospace;word-break:break-all;}.lr-outcome-list{margin:0;padding-left:16px;display:flex;flex-direction:column;gap:6px;}.lr-outcome{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;}.lr-open-task{padding:0;border:0;background:none;font:inherit;font-size:13px;line-height:18px;color:var(--color-theme-600);text-decoration:underline;cursor:pointer;white-space:nowrap;}.lr-open-task:hover{color:var(--color-theme-800);}"]);
585
+ })(["border-top:1px solid var(--color-theme-300);.lr-summary{box-sizing:border-box;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 8px 8px 12px;background:none;border:0;text-align:left;cursor:pointer;font-family:inherit;&:hover{background-color:var(--color-theme-200);}}.lr-expand{flex-shrink:0;fill:var(--color-theme-600);color:var(--color-theme-600);transform:rotate(180deg);transition:transform 200ms ease;}.lr-expand.open{transform:rotate(0deg);}.lr-conn{display:flex;align-items:center;gap:8px;width:180px;min-width:0;flex-shrink:0;}.lr-conn svg{width:20px;height:20px;flex-shrink:0;}.lr-conn .lr-conn-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.lr-event{flex:1 1 0%;min-width:0;}.lr-time{width:120px;flex-shrink:0;text-align:right;white-space:nowrap;}.lr-status{width:110px;flex-shrink:0;display:flex;}.lr-outcomes{width:96px;flex-shrink:0;text-align:right;}.lr-detail{padding:4px 16px 20px 44px;display:flex;flex-direction:column;gap:16px;}.lr-field-label{display:block;margin-bottom:4px;}.lr-id{font-family:\"SFMono-Regular\",Consolas,\"Liberation Mono\",Menlo,monospace;word-break:break-all;}.lr-outcome-list{margin:0;padding-left:16px;display:flex;flex-direction:column;gap:6px;}.lr-outcome{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;}.lr-open-task{padding:0;border:0;background:none;font:inherit;font-size:13px;line-height:18px;color:var(--color-theme-600);text-decoration:underline;cursor:pointer;white-space:nowrap;}.lr-open-task:hover{color:var(--color-theme-800);}"]);
475
586
  const LogRow = _ref4 => {
476
587
  var _connection$name;
477
588
  let log = _ref4.log,
@@ -496,7 +607,10 @@ const LogRow = _ref4 => {
496
607
  }, (_connection$name = connection == null ? void 0 : connection.name) != null ? _connection$name : "Unknown")), /*#__PURE__*/React.createElement(Body2, {
497
608
  className: "lr-event",
498
609
  color: "tertiary"
499
- }, EVENT_KIND_LABELS[log.eventKind]), /*#__PURE__*/React.createElement("span", {
610
+ }, EVENT_KIND_LABELS[log.eventKind]), /*#__PURE__*/React.createElement(Caption1, {
611
+ className: "lr-time",
612
+ color: "tertiary"
613
+ }, formatReceivedAt(log.receivedAt)), /*#__PURE__*/React.createElement("span", {
500
614
  className: "lr-status"
501
615
  }, /*#__PURE__*/React.createElement(StatusChip, {
502
616
  status: log.status
@@ -634,7 +748,7 @@ const DialogTitleBar = styled.div.withConfig({
634
748
  const LogListHeader = styled.div.withConfig({
635
749
  displayName: "WebhookLogsDialog__LogListHeader",
636
750
  componentId: "sc-6ol7f6-8"
637
- })(["box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:0 8px 8px 44px;.lh-conn{width:180px;flex-shrink:0;}.lh-event{flex:1 1 0%;min-width:0;}.lh-status{width:96px;flex-shrink:0;text-align:right;}.lh-outcomes{width:96px;flex-shrink:0;text-align:right;}"]);
751
+ })(["box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:0 8px 8px 44px;.lh-conn{width:180px;flex-shrink:0;}.lh-event{flex:1 1 0%;min-width:0;}.lh-time{width:120px;flex-shrink:0;text-align:right;}.lh-status{width:110px;flex-shrink:0;text-align:left;}.lh-outcomes{width:96px;flex-shrink:0;text-align:right;}"]);
638
752
  const EmptyLogs = styled.div.withConfig({
639
753
  displayName: "WebhookLogsDialog__EmptyLogs",
640
754
  componentId: "sc-6ol7f6-9"
@@ -798,6 +912,10 @@ export const WebhookLogsDialog = _ref7 => {
798
912
  color: "secondary",
799
913
  weight: "bold"
800
914
  }, "EVENT TYPE"), /*#__PURE__*/React.createElement(Caption2, {
915
+ className: "lh-time",
916
+ color: "secondary",
917
+ weight: "bold"
918
+ }, "TIME"), /*#__PURE__*/React.createElement(Caption2, {
801
919
  className: "lh-status",
802
920
  color: "secondary",
803
921
  weight: "bold"