@pipelex/mthds-ui 0.31.0 → 0.33.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.
package/README.md CHANGED
@@ -94,6 +94,7 @@ Without `pipeIoContracts` and `outputForm` the panel shows each concept's struct
94
94
  | `graphStyle` | `GraphStyleId` | `"detailed"` | The style the graph is drawn in: `detailed` or `simple` |
95
95
  | `styleMenu` | `boolean \| GraphStyleId[]` | — | Offer a style menu in the toolbar (opt-in) |
96
96
  | `onGraphStyleChange` | `(style: GraphStyleId) => void` | — | Called when the style changes, so the host can keep the choice |
97
+ | `interactive` | `boolean` | `true` | `false` draws a still picture sized to its content |
97
98
 
98
99
  The `simple` style draws the method as a flowchart in plain words: steps titled by their descriptions, only the method's inputs and final output as data, decisions with their outcomes, and loops as "for each". See [docs/graph-styles.md](docs/graph-styles.md).
99
100
 
@@ -101,6 +102,8 @@ The `simple` style draws the method as a flowchart in plain words: steps titled
101
102
 
102
103
  The graph container uses `position: absolute; inset: 0` to fill its parent. Make sure the parent element has `position: relative` and a defined height (e.g. `h-full`, `flex-1`, or an explicit height).
103
104
 
105
+ The still presentation (`interactive={false}`) is the exception: its container flows in its parent and takes the height the drawing needs, so the parent gives it a width and no height. See [docs/still-presentation.md](docs/still-presentation.md).
106
+
104
107
  ## GraphSpec
105
108
 
106
109
  GraphSpec is the data format that describes a pipeline execution graph. It's generated by Pipelex when running or validating MTHDS method bundles.
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-2N65P32H.js";
5
5
  import {
6
6
  DEFAULT_GRAPH_CONFIG
7
- } from "./chunk-7H3RHOYA.js";
7
+ } from "./chunk-K2C5FU4W.js";
8
8
  import {
9
9
  ARROW_CLOSED_MARKER,
10
10
  BINDING_STEP_TYPE,
@@ -31,7 +31,7 @@ import {
31
31
  nodeWidth,
32
32
  stuffDigestFromId,
33
33
  stuffNodeId
34
- } from "./chunk-QRO3TYZE.js";
34
+ } from "./chunk-TMZ2JR2J.js";
35
35
  import {
36
36
  __objRest,
37
37
  __spreadProps,
@@ -480,6 +480,20 @@ function getPipeBlueprint(spec, pipeRef) {
480
480
  var _a;
481
481
  return (_a = spec.pipe_registry) == null ? void 0 : _a[pipeRef];
482
482
  }
483
+ function resolveNodeBlueprint(spec, node) {
484
+ var _a;
485
+ const registry = spec.pipe_registry;
486
+ if (!registry || isBindingNode(node) || !node.pipe_code) return void 0;
487
+ if (node.domain_code) return registry[makePipeRef(node.domain_code, node.pipe_code)];
488
+ const pipelineDomain = (_a = spec.pipeline_ref) == null ? void 0 : _a.domain;
489
+ if (pipelineDomain) {
490
+ const inPipelineDomain = registry[makePipeRef(pipelineDomain, node.pipe_code)];
491
+ if (inPipelineDomain) return inPipelineDomain;
492
+ }
493
+ const suffix = `.${node.pipe_code}`;
494
+ const matches = Object.keys(registry).filter((ref) => ref.endsWith(suffix));
495
+ return matches.length === 1 ? registry[matches[0]] : void 0;
496
+ }
483
497
  function getConceptInfo(spec, conceptRef) {
484
498
  var _a;
485
499
  return (_a = spec.concept_registry) == null ? void 0 : _a[conceptRef];
@@ -501,7 +515,7 @@ function ioPill(item) {
501
515
  concept: item.concept ? item.concept + multiplicitySuffix(item.multiplicity) : ""
502
516
  };
503
517
  }
504
- function buildPipeCardPayload(node, graphMode) {
518
+ function buildPipeCardPayload(node, graphMode, blueprint) {
505
519
  const payload = {
506
520
  pipeCode: node.pipe_code,
507
521
  pipeType: node.pipe_type,
@@ -512,6 +526,10 @@ function buildPipeCardPayload(node, graphMode) {
512
526
  };
513
527
  if (graphMode !== void 0) payload.graphMode = graphMode;
514
528
  if (node.tags !== void 0) payload.tags = node.tags;
529
+ const docGenFormat = (blueprint == null ? void 0 : blueprint.type) === "PipeDocGen" ? blueprint.doc_gen_format : void 0;
530
+ if (typeof docGenFormat === "string" && docGenFormat.trim() !== "") {
531
+ payload.docGenFormat = docGenFormat.trim();
532
+ }
515
533
  return payload;
516
534
  }
517
535
 
@@ -546,7 +564,11 @@ function buildDataflowGraph(graphspec, analysis, edgeType) {
546
564
  const pipeNode = asCardNode(node, `nodes[${node.id}]`);
547
565
  const isFailed = pipeNode.status === "failed";
548
566
  const label = pipeNode.pipe_code;
549
- const pipeCardData = buildPipeCardPayload(pipeNode, graphMode);
567
+ const pipeCardData = buildPipeCardPayload(
568
+ pipeNode,
569
+ graphMode,
570
+ resolveNodeBlueprint(graphspec, pipeNode)
571
+ );
550
572
  nodes.push({
551
573
  id: pipeNode.id,
552
574
  type: NODE_TYPE_PIPE_CARD,
@@ -812,7 +834,11 @@ function applyFolds(graphData, analysis, graphspec, foldedSet, onToggleFold) {
812
834
  if (outermostFoldedAncestor(folded, childToCtrl, foldedSet)) continue;
813
835
  const specNode = findSpecNode(graphspec, folded);
814
836
  if (!specNode) continue;
815
- const payload = buildPipeCardPayload(asPipeCallNode(specNode, folded), graphMode);
837
+ const payload = buildPipeCardPayload(
838
+ asPipeCallNode(specNode, folded),
839
+ graphMode,
840
+ resolveNodeBlueprint(graphspec, specNode)
841
+ );
816
842
  if (onToggleFold) {
817
843
  payload.onExpand = (options) => onToggleFold(folded, options);
818
844
  }
@@ -2829,7 +2855,7 @@ function simpleEdge(id, source, target, label) {
2829
2855
  fontWeight: 600,
2830
2856
  fill: "var(--ctrl-condition-text)"
2831
2857
  };
2832
- edge.labelBgStyle = { fill: "var(--color-bg)", fillOpacity: 0.92 };
2858
+ edge.labelBgStyle = { fill: "var(--simple-edge-label-bg, var(--color-bg))", fillOpacity: 0.92 };
2833
2859
  edge.labelBgPadding = [...EDGE_LABEL_PADDING];
2834
2860
  edge.labelBgBorderRadius = 4;
2835
2861
  edge.labelSize = simpleEdgeLabelSize(label);
@@ -2919,6 +2945,7 @@ export {
2919
2945
  buildDataflowAnalysis,
2920
2946
  buildChildToControllerMap,
2921
2947
  getPipeBlueprint,
2948
+ resolveNodeBlueprint,
2922
2949
  getConceptInfo,
2923
2950
  resolveConceptRef,
2924
2951
  buildPipeCardPayload,
@@ -2983,4 +3010,4 @@ export {
2983
3010
  applySimpleFrames,
2984
3011
  GRAPH_STYLE_PIPELINES
2985
3012
  };
2986
- //# sourceMappingURL=chunk-BXRVND2C.js.map
3013
+ //# sourceMappingURL=chunk-ABUDTHWF.js.map