@pipelex/mthds-ui 0.39.0 → 0.41.0

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.
Files changed (41) hide show
  1. package/README.md +8 -6
  2. package/dist/chunk-6S5TQPTO.js +1349 -0
  3. package/dist/chunk-6S5TQPTO.js.map +1 -0
  4. package/dist/chunk-7JZBXBZS.js +258 -0
  5. package/dist/chunk-7JZBXBZS.js.map +1 -0
  6. package/dist/{chunk-AGFLCOWW.js → chunk-HPARBH6K.js} +14 -197
  7. package/dist/chunk-HPARBH6K.js.map +1 -0
  8. package/dist/chunk-N2F62MW7.js +55 -0
  9. package/dist/chunk-N2F62MW7.js.map +1 -0
  10. package/dist/chunk-P6IGZVWE.js +155 -0
  11. package/dist/chunk-P6IGZVWE.js.map +1 -0
  12. package/dist/form/react/index.d.ts +1 -1
  13. package/dist/graph/index.d.ts +19 -3
  14. package/dist/graph/index.js +20 -12
  15. package/dist/graph/react/index.d.ts +13 -13
  16. package/dist/graph/react/index.js +387 -560
  17. package/dist/graph/react/index.js.map +1 -1
  18. package/dist/graph/react/viewer/GraphToolbar.css +2 -107
  19. package/dist/graph/react/viewer/StyleMenu.css +109 -0
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +20 -12
  22. package/dist/registryJoin-C6Wfkik-.d.ts +441 -0
  23. package/dist/standalone/graph-standalone.html +176 -171
  24. package/dist/standalone/graph-viewer.css +75 -70
  25. package/dist/standalone/graph-viewer.js +101 -101
  26. package/dist/static-graph/index.d.ts +1 -1
  27. package/dist/timeline/index.d.ts +344 -83
  28. package/dist/timeline/index.js +67 -3
  29. package/dist/timeline/react/RunTimeline.css +141 -0
  30. package/dist/timeline/react/index.d.ts +57 -6
  31. package/dist/timeline/react/index.js +929 -120
  32. package/dist/timeline/react/index.js.map +1 -1
  33. package/dist/timeline/react/styles/simple/SimpleProgress.css +354 -0
  34. package/dist/{types-DsrzH6gM.d.ts → types-DLAnYNoi.d.ts} +1 -1
  35. package/package.json +6 -4
  36. package/dist/chunk-AGFLCOWW.js.map +0 -1
  37. package/dist/chunk-ILZJIORT.js +0 -54
  38. package/dist/chunk-ILZJIORT.js.map +0 -1
  39. package/dist/chunk-JJG2TO7P.js +0 -473
  40. package/dist/chunk-JJG2TO7P.js.map +0 -1
  41. package/dist/progressSnapshot-VZ4PLul9.d.ts +0 -191
@@ -434,6 +434,140 @@
434
434
  border: 0;
435
435
  }
436
436
 
437
+ /* ─── A batch's pager: a row of the list at its items' depth ─────────────── */
438
+ /* Its content starts where an item row's dot does: past the toggle's 16px */
439
+ /* and the name's 6px gap. Previous and Next stay focusable at their ends, */
440
+ /* `aria-disabled` rather than disabled, so they are dimmed here. */
441
+
442
+ .mthds-run-timeline-pager {
443
+ display: flex;
444
+ align-items: center;
445
+ min-height: 30px;
446
+ border-bottom: 1px solid var(--border-subtle);
447
+ animation: mthds-run-timeline-appear 0.3s ease-out;
448
+ }
449
+
450
+ .mthds-run-timeline-pager-nav {
451
+ display: flex;
452
+ flex-wrap: wrap;
453
+ align-items: center;
454
+ gap: 4px 8px;
455
+ min-width: 0;
456
+ margin-left: 22px;
457
+ padding: 3px 0;
458
+ }
459
+
460
+ .mthds-run-timeline-pager-btn {
461
+ display: inline-flex;
462
+ align-items: center;
463
+ gap: 4px;
464
+ padding: 1px 8px;
465
+ border: 1px solid var(--border-default);
466
+ border-radius: 6px;
467
+ background: var(--surface-sunken);
468
+ color: var(--text-secondary);
469
+ font: inherit;
470
+ font-size: 11px;
471
+ line-height: 18px;
472
+ white-space: nowrap;
473
+ cursor: pointer;
474
+ }
475
+
476
+ /* A jump keeps the colour of its trouble on hover, so the neutral hover skips it. */
477
+ .mthds-run-timeline-pager-btn:hover:not([aria-disabled="true"]):not(
478
+ .mthds-run-timeline-pager-jump
479
+ ) {
480
+ border-color: var(--border-strong);
481
+ background: var(--surface-elevated-hover);
482
+ color: var(--text-primary);
483
+ }
484
+
485
+ .mthds-run-timeline-pager-btn:focus-visible {
486
+ outline: 2px solid var(--focus-ring);
487
+ outline-offset: 1px;
488
+ }
489
+
490
+ .mthds-run-timeline-pager-btn[aria-disabled="true"] {
491
+ opacity: 0.45;
492
+ cursor: default;
493
+ }
494
+
495
+ /* The jump to an item in trouble, in the colour of its trouble. */
496
+ .mthds-run-timeline-pager-jump--failed {
497
+ border-color: var(--color-error);
498
+ color: var(--color-error);
499
+ }
500
+
501
+ .mthds-run-timeline-pager-jump--degraded {
502
+ border-color: var(--color-warning);
503
+ color: var(--color-warning);
504
+ }
505
+
506
+ .mthds-run-timeline-pager-jump:hover {
507
+ border-color: currentColor;
508
+ background: var(--surface-elevated-hover);
509
+ }
510
+
511
+ .mthds-run-timeline-pager-range,
512
+ .mthds-run-timeline-pager-more {
513
+ color: var(--text-muted);
514
+ font-size: 11px;
515
+ font-variant-numeric: tabular-nums;
516
+ white-space: nowrap;
517
+ }
518
+
519
+ .mthds-run-timeline-pager-more {
520
+ color: var(--text-secondary);
521
+ }
522
+
523
+ /* ─── The header's style menu ───────────────────────────────────────────── */
524
+ /* The list is the graph viewer's (`StyleMenu.css`); the button is drawn */
525
+ /* here, in the header's own vocabulary. */
526
+
527
+ .mthds-run-timeline-header-end {
528
+ margin-left: auto;
529
+ }
530
+
531
+ .mthds-run-timeline-style-btn {
532
+ display: inline-flex;
533
+ align-items: center;
534
+ justify-content: center;
535
+ width: 26px;
536
+ height: 26px;
537
+ padding: 0;
538
+ border: 1px solid var(--border-default);
539
+ border-radius: 6px;
540
+ background: var(--surface-sunken);
541
+ color: var(--text-secondary);
542
+ cursor: pointer;
543
+ }
544
+
545
+ .mthds-run-timeline-style-btn:hover,
546
+ .mthds-run-timeline-style-btn--open {
547
+ border-color: var(--border-strong);
548
+ background: var(--surface-elevated-hover);
549
+ color: var(--text-primary);
550
+ }
551
+
552
+ .mthds-run-timeline-style-btn:focus-visible {
553
+ outline: 2px solid var(--focus-ring);
554
+ outline-offset: 1px;
555
+ }
556
+
557
+ /* On a phone the button is a 44×44 target, as the graph toolbar's are. */
558
+ @media (max-width: 639.98px) {
559
+ .mthds-run-timeline-style-btn {
560
+ width: 44px;
561
+ height: 44px;
562
+ border-radius: 8px;
563
+ }
564
+
565
+ .mthds-run-timeline-style-btn svg {
566
+ width: 18px;
567
+ height: 18px;
568
+ }
569
+ }
570
+
437
571
  /* ─── Narrow: each row on two lines, its bar across the whole width ───────── */
438
572
 
439
573
  @container mthds-run-timeline (max-width: 560px) {
@@ -470,6 +604,12 @@
470
604
  .mthds-run-timeline-track {
471
605
  min-height: 18px;
472
606
  }
607
+
608
+ /* The pager's buttons grow at narrow width, so they are easier to tap. */
609
+ .mthds-run-timeline-pager-btn {
610
+ padding: 4px 10px;
611
+ line-height: 20px;
612
+ }
473
613
  }
474
614
 
475
615
  @keyframes mthds-run-timeline-appear {
@@ -492,6 +632,7 @@
492
632
 
493
633
  @media (prefers-reduced-motion: reduce) {
494
634
  .mthds-run-timeline-row,
635
+ .mthds-run-timeline-pager,
495
636
  .mthds-run-timeline-bar--growing {
496
637
  animation: none;
497
638
  }
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { G as GraphThemeMode, a as GraphTheme } from '../../types-DsrzH6gM.js';
3
- import { P as ProgressSnapshot, a as ProgressTimestamp } from '../../progressSnapshot-VZ4PLul9.js';
1
+ import * as React from 'react';
2
+ import { G as GraphThemeMode, a as GraphTheme } from '../../types-DLAnYNoi.js';
3
+ import { P as ProgressSnapshot, a as ProgressTimestamp, T as TimelineStyleId, b as TimelinePipeRegistry } from '../../registryJoin-C6Wfkik-.js';
4
4
  import 'mthds/errors';
5
5
 
6
6
  interface RunTimelineProps {
@@ -41,8 +41,57 @@ interface RunTimelineProps {
41
41
  * draws each snapshot as of its `assembled_at`. Defaults to `true`.
42
42
  */
43
43
  live?: boolean;
44
+ /**
45
+ * The style the timeline draws in: `detailed`, the default, every invocation
46
+ * as a bar on a shared time axis; or `simple`, the run as a checklist of its
47
+ * steps in the method's own words, a batch as one line with its counts.
48
+ * Reactive, like `theme`: passing it drives the active style, and clearing it
49
+ * back to `undefined` hands control to the default. The header's style menu,
50
+ * when shown, changes it too. An id this version does not know is treated as
51
+ * unset. This library persists nothing: the host keeps the choice, reported
52
+ * by `onTimelineStyleChange`.
53
+ */
54
+ timelineStyle?: TimelineStyleId;
55
+ /**
56
+ * Called whenever the style changes — from the menu, or from a prop update —
57
+ * so the host can persist it. Not called on mount.
58
+ */
59
+ onTimelineStyleChange?: (style: TimelineStyleId) => void;
60
+ /**
61
+ * Show a style menu at the end of the header. Opt-in: `true` offers every
62
+ * registered style in registry order, a list offers those styles in that
63
+ * order, and the default offers no menu, for a host that fixes the style for
64
+ * its audience. A menu needs two styles to choose between.
65
+ */
66
+ styleMenu?: boolean | readonly TimelineStyleId[];
67
+ /**
68
+ * The registry of the method's pipes, keyed by `pipe_ref`, as a `GraphSpec`'s
69
+ * `pipe_registry`: the simple style titles its lines from the pipes'
70
+ * descriptions, names a batch's item, and lists the steps the run has not
71
+ * reached. Without it each line is titled by its humanized pipe code. The
72
+ * detailed style does not read it.
73
+ */
74
+ pipeRegistry?: TimelinePipeRegistry;
75
+ /**
76
+ * The `pipe_ref` of the pipe the run starts from. A snapshot taken before
77
+ * anything started names no pipe, so with it and `pipeRegistry` the simple
78
+ * style lists the run's steps from the start.
79
+ */
80
+ entryPipeRef?: string;
44
81
  /** A batch holding more items than this starts collapsed. Defaults to `DEFAULT_WIDE_BATCH_THRESHOLD`. */
45
82
  wideBatchThreshold?: number;
83
+ /**
84
+ * How many items one page of a batch holds in the detailed style: an expanded
85
+ * batch with more items draws them a page at a time, and a collapsed one keeps
86
+ * at most this many of its items in trouble in view. Defaults to
87
+ * `DEFAULT_BATCH_PAGE_SIZE`.
88
+ */
89
+ batchPageSize?: number;
90
+ /**
91
+ * In the simple style, a parallel with more branches than this folds its
92
+ * finished branches into one line. Defaults to `DEFAULT_WIDE_PARALLEL_THRESHOLD`.
93
+ */
94
+ wideParallelThreshold?: number;
46
95
  /** Appended to the container's class list. */
47
96
  className?: string;
48
97
  }
@@ -55,15 +104,17 @@ interface RunTimelineProps {
55
104
  * Nothing is drawn in advance: a row appears when the run reaches its
56
105
  * invocation, so there is no method graph behind it and no batch width is ever
57
106
  * guessed. A batch is one collapsible row carrying its counts and a strip of its
58
- * items' states; a wide one starts collapsed and keeps its failed items in view.
107
+ * items' states; a wide one starts collapsed and keeps its failed items in view,
108
+ * a page of them at most, and an expanded one draws its items a page at a time.
59
109
  * A condition's branch carries the outcome it took. A retried invocation shows
60
110
  * its attempts and where its last failure happened, and the invocation where
61
111
  * the run is stuck says so.
62
112
  *
63
113
  * Rows are keyed by path, so repainting with a newer snapshot keeps each drawn
64
- * row in place and what the reader expanded expanded. While the clock ticks,
114
+ * row in place, what the reader expanded expanded, and each batch on the page
115
+ * the reader turned it to. While the clock ticks,
65
116
  * only the axis and the rows whose bars follow the clock are drawn again.
66
117
  */
67
- declare function RunTimeline({ snapshot, theme, systemTheme, paletteColors, now, live, wideBatchThreshold, className, }: RunTimelineProps): react_jsx_runtime.JSX.Element;
118
+ declare function RunTimeline({ snapshot, theme, systemTheme, paletteColors, now, live, timelineStyle, onTimelineStyleChange, styleMenu, pipeRegistry, entryPipeRef, wideBatchThreshold, batchPageSize, wideParallelThreshold, className, }: RunTimelineProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
68
119
 
69
120
  export { RunTimeline, type RunTimelineProps };