@pipelex/mthds-ui 0.58.3 → 0.60.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 (55) hide show
  1. package/README.md +2 -3
  2. package/dist/{chunk-S4UMMHLE.js → chunk-43NAVRQK.js} +17 -2
  3. package/dist/chunk-43NAVRQK.js.map +1 -0
  4. package/dist/{chunk-6KWNAU4F.js → chunk-BQZ3BPJM.js} +13 -1
  5. package/dist/chunk-BQZ3BPJM.js.map +1 -0
  6. package/dist/{chunk-XMTXWXFO.js → chunk-KKT6OVO6.js} +3 -3
  7. package/dist/{chunk-5N3MP5TD.js → chunk-PWKNMKFA.js} +106 -35
  8. package/dist/chunk-PWKNMKFA.js.map +1 -0
  9. package/dist/{chunk-ZRSFFUHA.js → chunk-S36KN6CG.js} +3 -3
  10. package/dist/chunk-UVEGKTBU.js +600 -0
  11. package/dist/chunk-UVEGKTBU.js.map +1 -0
  12. package/dist/{chunk-7QUQJW6Q.js → chunk-YQJNKQWO.js} +91 -285
  13. package/dist/chunk-YQJNKQWO.js.map +1 -0
  14. package/dist/form/index.d.ts +0 -1
  15. package/dist/form/react/index.d.ts +1 -1
  16. package/dist/form/react/index.js +2 -2
  17. package/dist/graph/index.d.ts +48 -21
  18. package/dist/graph/index.js +67 -27
  19. package/dist/graph/react/detail/DetailPanel.css +49 -0
  20. package/dist/graph/react/graph-core.css +20 -0
  21. package/dist/graph/react/index.d.ts +2 -2
  22. package/dist/graph/react/index.js +94 -31
  23. package/dist/graph/react/index.js.map +1 -1
  24. package/dist/graph/react/styles/simple/SimpleDetailPanel.css +20 -0
  25. package/dist/graph/react/styles/simple/SimpleStyle.css +13 -0
  26. package/dist/index.d.ts +3 -2
  27. package/dist/index.js +67 -27
  28. package/dist/methodWords-DIEg1PVT.d.ts +180 -0
  29. package/dist/{registryJoin-CMfBspIs.d.ts → registryJoin-Cj1mIkqe.d.ts} +18 -10
  30. package/dist/standalone/graph-standalone.html +232 -130
  31. package/dist/standalone/graph-viewer.css +102 -0
  32. package/dist/standalone/graph-viewer.js +130 -130
  33. package/dist/static-graph/index.d.ts +1 -1
  34. package/dist/static-graph/index.js +33 -12
  35. package/dist/static-graph/index.js.map +1 -1
  36. package/dist/timeline/index.d.ts +42 -7
  37. package/dist/timeline/index.js +8 -3
  38. package/dist/timeline/react/RunTimeline.css +18 -0
  39. package/dist/timeline/react/index.d.ts +3 -2
  40. package/dist/timeline/react/index.js +22 -13
  41. package/dist/timeline/react/index.js.map +1 -1
  42. package/dist/timeline/react/styles/simple/SimpleProgress.css +25 -0
  43. package/dist/{types-CnDJyLYo.d.ts → types-BygAt1Si.d.ts} +51 -1
  44. package/package.json +3 -7
  45. package/dist/chunk-5N3MP5TD.js.map +0 -1
  46. package/dist/chunk-6KWNAU4F.js.map +0 -1
  47. package/dist/chunk-7QUQJW6Q.js.map +0 -1
  48. package/dist/chunk-P6IGZVWE.js +0 -155
  49. package/dist/chunk-P6IGZVWE.js.map +0 -1
  50. package/dist/chunk-S4UMMHLE.js.map +0 -1
  51. package/dist/form/brand/index.d.ts +0 -1
  52. package/dist/form/brand/index.js +0 -3
  53. package/dist/form/brand/index.js.map +0 -1
  54. /package/dist/{chunk-XMTXWXFO.js.map → chunk-KKT6OVO6.js.map} +0 -0
  55. /package/dist/{chunk-ZRSFFUHA.js.map → chunk-S36KN6CG.js.map} +0 -0
@@ -1,7 +1,8 @@
1
- import { P as ProgressSnapshot, B as BatchProgress, I as InvocationStatus, c as PathSegment, d as ProgressInvocation, a as ProgressTimestamp, e as ProgressDegradation, R as RunProgressStatus, f as ProgressMode, b as TimelinePipeRegistry } from '../registryJoin-CMfBspIs.js';
2
- export { C as ConditionProgress, D as DEFAULT_TIMELINE_STYLE, g as DEGRADATION_REASON, h as DefaultPathSegment, E as ExecutionAttempt, i as INVOCATION_STATUS, j as InvocationFailure, k as InvocationTreeNode, J as JoinedBatch, l as JoinedTitle, N as NumberedStep, O as OrdinalPathSegment, m as OutcomePathSegment, n as PATH_SEGMENT_KIND, o as PROGRESS_MODE, p as PathSegmentKind, q as RUN_PROGRESS_STATUS, r as TIMELINE_STYLE, s as TIMELINE_STYLES, t as TIMELINE_STYLE_IDS, u as TimelineStyleDescriptor, T as TimelineStyleId, U as UnknownPathSegment, v as buildInvocationTree, w as compareSiblings, x as compareTimestamps, y as decodeOutcomeKey, z as invocationPathDepth, A as isItemNode, F as isOrdinalSegment, G as isOutcomeNode, H as isRunEnded, K as isTimelineStyleId, L as joinBatch, M as joinedSequence, Q as lastPathSegment, S as parentInvocationPath, V as parsePathSegment, W as pipeOf, X as qualifyPipeCode, Y as resolveTimelineStyle, Z as resolveTimelineStyleMenu, _ as sequenceMatches, $ as sequenceOf, a0 as splitInvocationPath, a1 as stepAt, a2 as stepNumberOf, a3 as stepsAfter, a4 as timestampMs, a5 as titleOf } from '../registryJoin-CMfBspIs.js';
1
+ import { P as ProgressSnapshot, B as BatchProgress, I as InvocationStatus, c as PathSegment, d as ProgressInvocation, a as ProgressTimestamp, e as ProgressDegradation, R as RunProgressStatus, f as ProgressMode, b as TimelinePipeRegistry } from '../registryJoin-Cj1mIkqe.js';
2
+ export { C as ConditionProgress, D as DEFAULT_TIMELINE_STYLE, g as DEGRADATION_REASON, h as DefaultPathSegment, E as ExecutionAttempt, i as INVOCATION_STATUS, j as InvocationFailure, k as InvocationTreeNode, J as JoinedBatch, l as JoinedTitle, N as NumberedStep, O as OrdinalPathSegment, m as OutcomePathSegment, n as PATH_SEGMENT_KIND, o as PROGRESS_MODE, p as PathSegmentKind, q as RUN_PROGRESS_STATUS, r as TIMELINE_STYLE, s as TIMELINE_STYLES, t as TIMELINE_STYLE_IDS, u as TimelineStyleDescriptor, T as TimelineStyleId, U as UnknownPathSegment, v as buildInvocationTree, w as compareSiblings, x as compareTimestamps, y as decodeOutcomeKey, z as invocationPathDepth, A as isItemNode, F as isOrdinalSegment, G as isOutcomeNode, H as isPlumbingPipe, K as isPlumbingRef, L as isRunEnded, M as isTimelineStyleId, Q as joinBatch, S as joinedSequence, V as lastPathSegment, W as parentInvocationPath, X as parsePathSegment, Y as pipeOf, Z as qualifyPipeCode, _ as resolveTimelineStyle, $ as resolveTimelineStyleMenu, a0 as sequenceMatches, a1 as sequenceOf, a2 as splitInvocationPath, a3 as stepAt, a4 as stepNumberOf, a5 as stepsAfter, a6 as timestampMs, a7 as titleOf } from '../registryJoin-Cj1mIkqe.js';
3
3
  import { Problem } from 'mthds/errors';
4
- import '../types-CnDJyLYo.js';
4
+ import { O as OutcomeTone } from '../types-BygAt1Si.js';
5
+ import { W as WordingSource } from '../methodWords-DIEg1PVT.js';
5
6
 
6
7
  /**
7
8
  * The stream of progress a snapshot belongs to, as one string: its run, its
@@ -367,7 +368,7 @@ declare function formatClockTime(ms: number): string;
367
368
  * method's pipe registry, as a checklist of lines in the method's own words.
368
369
  *
369
370
  * Pure and language-free. A line carries its kind, its state, its title as the
370
- * author wrote it, its counts, its outcome and its health as data, never a
371
+ * author wrote it (the pipe's `activity`, else its description), its counts, its outcome and its health as data, never a
371
372
  * sentence: the React view words them through its strings table, and a host can
372
373
  * read the same lines to word progress elsewhere. It keys nothing on time, so
373
374
  * the view keeps every line it drew in place across snapshots and only the
@@ -427,12 +428,32 @@ declare const DEFAULT_WIDE_PARALLEL_THRESHOLD = 5;
427
428
  * line instead, so a method nested five levels deep still reads as a short list.
428
429
  */
429
430
  declare const SIMPLE_MAX_DEPTH = 2;
430
- /** On a decision, the outcome it took; on a branch of a condition that resolved none, the outcome it stands for. */
431
+ /**
432
+ * On a decision, the outcome it took; on a branch of a condition that resolved
433
+ * none, the outcome it stands for. Its words come from the condition's outcome
434
+ * table in the registry (MTHDS, "Outcome Labels"), each `null` when the method
435
+ * gives none: then the view words the key itself.
436
+ */
431
437
  interface SimpleOutcome {
432
438
  /** The outcome map's key, decoded; `null` for the default outcome. */
433
439
  key: string | null;
434
440
  /** True when it is the condition's `selected_outcome`, false when read off the branch's path. */
435
441
  resolved: boolean;
442
+ /**
443
+ * The outcome's name for people ("Detailed check"). On a dry run's branch
444
+ * that several outcomes share, the branch's name, as its arrow in the graph
445
+ * reads ("Approve or Standard check").
446
+ */
447
+ label: string | null;
448
+ /** What taking the outcome means, which the view shows under the line where there is room. */
449
+ description: string | null;
450
+ /**
451
+ * The tone the outcome reads in, by the rule every view follows
452
+ * (`outcomeTone`): the tone the method states, else neutral when it gives
453
+ * the outcome a label, else `null`. A branch several outcomes share takes a
454
+ * tone only when every one of them has one and they agree.
455
+ */
456
+ tone: OutcomeTone | null;
436
457
  }
437
458
  /** On a branch step of an expanded batch, how many items stand at each state of it. */
438
459
  interface SimpleItemTally {
@@ -484,9 +505,10 @@ interface SimpleProgressLine {
484
505
  key: string;
485
506
  kind: SimpleLineKind;
486
507
  state: SimpleLineState;
487
- /** The pipe's description as a title, or its humanized code when the registry has none. */
508
+ /** The pipe's `activity`, else its description, as a title, or its humanized code when the registry has neither. */
488
509
  title: string;
489
- titleFromDescription: boolean;
510
+ /** Where the title came from. */
511
+ titleSource: WordingSource;
490
512
  /** On a for-each line, the item's name in a sentence (`filing`), `null` when the registry does not name it. */
491
513
  forEachItem: string | null;
492
514
  outcome: SimpleOutcome | null;
@@ -562,6 +584,13 @@ interface SimpleProgressOptions {
562
584
  expanded?: Readonly<Record<string, boolean>>;
563
585
  /** A parallel with more branches than this folds its finished ones. Defaults to `DEFAULT_WIDE_PARALLEL_THRESHOLD`. */
564
586
  wideParallelThreshold?: number;
587
+ /**
588
+ * Draw the plumbing steps too: a PipeCompose, and a PipeFunc whose output is
589
+ * no file (MTHDS, "What a Run Shows"). Off by default, since a person
590
+ * following a run waits for none of them; a plumbing step that failed, is
591
+ * being tried again or where the run is stuck is drawn either way.
592
+ */
593
+ showPlumbing?: boolean;
565
594
  }
566
595
  /**
567
596
  * The checklist the simple style draws for a snapshot.
@@ -576,6 +605,12 @@ interface SimpleProgressOptions {
576
605
  * branches into one line. Annotations of work no line shows are shown on the
577
606
  * nearest drawn line.
578
607
  *
608
+ * A line is titled by its pipe's `activity`, else its description, else its
609
+ * humanized code, and a decision's outcome carries the words its outcome table
610
+ * gives it. Plumbing (`isPlumbingStep`: a PipeCompose, a binding step, a
611
+ * PipeFunc that writes no file) has no line unless it failed, is retrying or is
612
+ * stuck, or `showPlumbing` asks for every step.
613
+ *
579
614
  * Pure, and a function of its arguments alone.
580
615
  */
581
616
  declare function buildSimpleProgress(snapshot: ProgressSnapshot, options?: SimpleProgressOptions): SimpleProgress;
@@ -34,6 +34,8 @@ import {
34
34
  isItemNode,
35
35
  isOrdinalSegment,
36
36
  isOutcomeNode,
37
+ isPlumbingPipe,
38
+ isPlumbingRef,
37
39
  isRunEnded,
38
40
  isSameProgressStream,
39
41
  isTimelineRow,
@@ -62,9 +64,10 @@ import {
62
64
  timelineWindowAt,
63
65
  timestampMs,
64
66
  titleOf
65
- } from "../chunk-5N3MP5TD.js";
66
- import "../chunk-P6IGZVWE.js";
67
- import "../chunk-6KWNAU4F.js";
67
+ } from "../chunk-PWKNMKFA.js";
68
+ import "../chunk-UVEGKTBU.js";
69
+ import "../chunk-2N65P32H.js";
70
+ import "../chunk-BQZ3BPJM.js";
68
71
  import "../chunk-2NMEKWO5.js";
69
72
  export {
70
73
  DEFAULT_BATCH_PAGE_SIZE,
@@ -102,6 +105,8 @@ export {
102
105
  isItemNode,
103
106
  isOrdinalSegment,
104
107
  isOutcomeNode,
108
+ isPlumbingPipe,
109
+ isPlumbingRef,
105
110
  isRunEnded,
106
111
  isSameProgressStream,
107
112
  isTimelineRow,
@@ -9,6 +9,24 @@
9
9
  /* `--mthds-run-timeline-axis-span` is no hook: the component sets it on its */
10
10
  /* body as the axis grows. */
11
11
 
12
+ /* The tone roles (`OUTCOME_TONE_COLORS` in `graphConfig.ts`), which colour a */
13
+ /* decision's outcome. Not in the inline palette: they are the form kernel's */
14
+ /* tokens too, which a host sets from its own stylesheet, so their defaults */
15
+ /* are declared here at zero specificity, per theme, and a host rule on the */
16
+ /* container wins over them; `paletteColors`, inline, wins over both. */
17
+ :where(.mthds-run-timeline--dark) {
18
+ --positive: hsl(142 69% 58%);
19
+ --caution: hsl(43 96% 56%);
20
+ --negative: hsl(0 91% 71%);
21
+ --neutral: hsl(240 5% 64.9%);
22
+ }
23
+ :where(.mthds-run-timeline--light) {
24
+ --positive: hsl(142 72% 29%);
25
+ --caution: hsl(26 90% 37%);
26
+ --negative: hsl(0 74% 42%);
27
+ --neutral: hsl(240 5.2% 33.9%);
28
+ }
29
+
12
30
  .mthds-run-timeline {
13
31
  --mthds-run-timeline-name-width: minmax(8rem, 36%);
14
32
  --mthds-run-timeline-meta-width: 10.5rem;
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
- import { G as GraphThemeMode, a as GraphTheme } from '../../types-CnDJyLYo.js';
3
- import { P as ProgressSnapshot, a as ProgressTimestamp, T as TimelineStyleId, b as TimelinePipeRegistry } from '../../registryJoin-CMfBspIs.js';
2
+ import { G as GraphThemeMode, a as GraphTheme } from '../../types-BygAt1Si.js';
3
+ import { P as ProgressSnapshot, a as ProgressTimestamp, T as TimelineStyleId, b as TimelinePipeRegistry } from '../../registryJoin-Cj1mIkqe.js';
4
4
  import 'mthds/errors';
5
+ import '../../methodWords-DIEg1PVT.js';
5
6
 
6
7
  interface RunTimelineProps {
7
8
  /**
@@ -2,11 +2,8 @@
2
2
  import {
3
3
  StyleMenu,
4
4
  useSystemTheme
5
- } from "../../chunk-ZRSFFUHA.js";
6
- import "../../chunk-XMTXWXFO.js";
7
- import {
8
- getPaletteForTheme
9
- } from "../../chunk-S4UMMHLE.js";
5
+ } from "../../chunk-S36KN6CG.js";
6
+ import "../../chunk-KKT6OVO6.js";
10
7
  import {
11
8
  INVOCATION_STATUS,
12
9
  KEPT_VISIBLE_REASON,
@@ -36,13 +33,17 @@ import {
36
33
  timelineTicks,
37
34
  timelineWindowAt,
38
35
  timestampMs
39
- } from "../../chunk-5N3MP5TD.js";
36
+ } from "../../chunk-PWKNMKFA.js";
40
37
  import {
41
- outcomeLabel
42
- } from "../../chunk-P6IGZVWE.js";
38
+ outcomeKeyLabel
39
+ } from "../../chunk-UVEGKTBU.js";
40
+ import "../../chunk-2N65P32H.js";
41
+ import {
42
+ getPaletteForTheme
43
+ } from "../../chunk-43NAVRQK.js";
43
44
  import {
44
45
  GRAPH_THEME_MODE
45
- } from "../../chunk-6KWNAU4F.js";
46
+ } from "../../chunk-BQZ3BPJM.js";
46
47
  import {
47
48
  __spreadProps,
48
49
  __spreadValues
@@ -149,8 +150,11 @@ var DEFAULT_SIMPLE_PROGRESS_STRINGS = {
149
150
  checklistLabel: "Steps of the run",
150
151
  together: "at the same time",
151
152
  forEach: (item) => `for each ${item != null ? item : "item"}`,
152
- outcomeTaken: (key) => `\u2192 ${key === null ? "Default" : outcomeLabel(key)}`,
153
- branchFor: (key) => key === null ? "otherwise" : `if ${outcomeLabel(key)}`,
153
+ outcomeTaken: (key, label) => `\u2192 ${label != null ? label : key === null ? "Default" : outcomeKeyLabel(key)}`,
154
+ branchFor: (key, label) => {
155
+ if (key === null) return label === null ? "otherwise" : `otherwise: ${label}`;
156
+ return `if ${label != null ? label : outcomeKeyLabel(key)}`;
157
+ },
154
158
  finishedBranches: (count) => `${count} done`,
155
159
  now: "Now:",
156
160
  batchCounts: (done, total, running, failed, skipped) => {
@@ -378,6 +382,10 @@ function itemOfChild(parent, child) {
378
382
  if (child.kind === SIMPLE_LINE_KIND.FOR_EACH) return child.forEachItem;
379
383
  return parent.kind === SIMPLE_LINE_KIND.FOR_EACH ? parent.forEachItem : null;
380
384
  }
385
+ function outcomeClass(outcome) {
386
+ const base = "mthds-simple-progress-outcome";
387
+ return outcome.tone === null ? base : `${base} ${base}--${outcome.tone}`;
388
+ }
381
389
  var LineView = React3.memo(function LineView2({
382
390
  line,
383
391
  item,
@@ -385,7 +393,7 @@ var LineView = React3.memo(function LineView2({
385
393
  onToggle,
386
394
  strings
387
395
  }) {
388
- var _a;
396
+ var _a, _b;
389
397
  const time = timeText(line, line.state === SIMPLE_LINE_STATE.RUNNING ? nowMs : null, strings);
390
398
  const classes = [
391
399
  "mthds-simple-progress-line",
@@ -404,7 +412,7 @@ var LineView = React3.memo(function LineView2({
404
412
  /* @__PURE__ */ jsx("span", { className: "mthds-simple-progress-name", children: title }),
405
413
  line.kind === SIMPLE_LINE_KIND.FOR_EACH && /* @__PURE__ */ jsx("span", { className: "mthds-simple-progress-tag", children: ` \xB7 ${strings.forEach(line.forEachItem)}` }),
406
414
  line.kind === SIMPLE_LINE_KIND.TOGETHER && /* @__PURE__ */ jsx("span", { className: "mthds-simple-progress-tag", children: ` \xB7 ${strings.together}` }),
407
- line.outcome && /* @__PURE__ */ jsx("span", { className: "mthds-simple-progress-outcome", children: line.outcome.resolved ? strings.outcomeTaken(line.outcome.key) : strings.branchFor(line.outcome.key) }),
415
+ line.outcome && /* @__PURE__ */ jsx("span", { className: outcomeClass(line.outcome), children: line.outcome.resolved ? strings.outcomeTaken(line.outcome.key, line.outcome.label) : strings.branchFor(line.outcome.key, line.outcome.label) }),
408
416
  /* @__PURE__ */ jsx("span", { className: "mthds-run-timeline-sr", children: `, ${strings.state[line.state]}` })
409
417
  ] }),
410
418
  /* @__PURE__ */ jsx(Tally, { line, strings }),
@@ -431,6 +439,7 @@ var LineView = React3.memo(function LineView2({
431
439
  }
432
440
  ) : /* @__PURE__ */ jsx("span", { className: "mthds-simple-progress-toggle-spacer", "aria-hidden": "true" })
433
441
  ] }),
442
+ ((_b = line.outcome) == null ? void 0 : _b.resolved) && line.outcome.description && /* @__PURE__ */ jsx("p", { className: "mthds-simple-progress-outcome-description", children: line.outcome.description }),
434
443
  /* @__PURE__ */ jsx(BatchCounts, { line, strings }),
435
444
  /* @__PURE__ */ jsx(HealthNotes, { line, item, strings }),
436
445
  line.expanded && line.children.length > 0 && /* @__PURE__ */ jsx("ol", { className: "mthds-simple-progress-lines mthds-simple-progress-lines--nested", children: line.children.map((child) => /* @__PURE__ */ jsx(