@pipelex/mthds-ui 0.29.0 → 0.30.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 (33) hide show
  1. package/README.md +14 -8
  2. package/dist/{chunk-ZTXSDTVF.js → chunk-3BXB6HSF.js} +1304 -31
  3. package/dist/chunk-3BXB6HSF.js.map +1 -0
  4. package/dist/{chunk-Y46574OW.js → chunk-GAOBB3UT.js} +5 -2
  5. package/dist/chunk-GAOBB3UT.js.map +1 -0
  6. package/dist/chunk-KB2DIEVF.js +1 -0
  7. package/dist/{chunk-3I3ZPYMW.js → chunk-PJTYQURQ.js} +33 -1
  8. package/dist/chunk-PJTYQURQ.js.map +1 -0
  9. package/dist/form/react/index.d.ts +1 -1
  10. package/dist/form/react/index.js +2 -2
  11. package/dist/graph/index.d.ts +336 -9
  12. package/dist/graph/index.js +98 -4
  13. package/dist/graph/react/index.d.ts +26 -2
  14. package/dist/graph/react/index.js +975 -371
  15. package/dist/graph/react/index.js.map +1 -1
  16. package/dist/graph/react/styles/simple/SimpleStyle.css +434 -0
  17. package/dist/graph/react/viewer/GraphToolbar.css +114 -0
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +98 -4
  20. package/dist/standalone/graph-standalone.html +714 -165
  21. package/dist/standalone/graph-viewer.css +549 -0
  22. package/dist/standalone/graph-viewer.js +164 -164
  23. package/dist/static-graph/index.d.ts +1 -1
  24. package/dist/static-graph/index.js +1 -1
  25. package/dist/{types-BaFWy56P.d.ts → types-BNqjYF_x.d.ts} +152 -1
  26. package/package.json +2 -1
  27. package/dist/chunk-3I3ZPYMW.js.map +0 -1
  28. package/dist/chunk-F6TZIJ7A.js +0 -1
  29. package/dist/chunk-Y46574OW.js.map +0 -1
  30. package/dist/chunk-ZTXSDTVF.js.map +0 -1
  31. package/dist/graph/react/index.css +0 -749
  32. package/dist/graph/react/index.css.map +0 -1
  33. /package/dist/{chunk-F6TZIJ7A.js.map → chunk-KB2DIEVF.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import { p as GraphSpecNode, r as CardNode, s as PipeCallNode, b as GraphSpec, D as DataflowAnalysis, C as ConceptInfo, P as PipeBlueprintUnion, t as GraphData, o as GraphSpecMode, u as PipeCardPayload, m as FoldToggleOptions, e as GraphNode, d as GraphEdge, c as GraphNodeData, N as NodeValidationSummary, V as ValidationIssue, j as GraphSpecNodeIoItem, g as GraphDirection, v as LayoutConfig, f as GraphConfig, T as ToolbarPosition, G as GraphTheme } from '../types-BaFWy56P.js';
2
- export { A as ARROW_CLOSED_MARKER, B as BINDING_STEP_TYPE, w as BindingNode, x as BindingStepSpec, y as BindingStepType, z as CONTROLLER_PADDING_BOTTOM, E as CONTROLLER_PADDING_TOP, H as CONTROLLER_PADDING_X, I as EDGE_TYPE, J as EdgeType, K as FOLD_MODE, M as FieldResolution, F as FoldMode, O as GRAPH_DIRECTION, Q as GRAPH_SPEC_MODE, R as GRAPH_THEME, S as GRAPH_THEME_MODE, U as GraphSpecEdge, W as GraphSpecEdgeKind, X as GraphSpecMeta, Y as GraphSpecModelUsage, Z as GraphSpecNodeError, _ as GraphSpecNodeIo, $ as GraphSpecNodeTiming, a0 as GraphSpecNodeUsage, a1 as GraphSpecUsage, h as GraphThemeMode, a2 as JudgmentQuestionSpec, a3 as KNOWN_PIPE_TYPES, L as LabelDescriptor, a4 as NODE_TYPE_CONTROLLER, a5 as NODE_TYPE_PIPE_CARD, a6 as NODE_TYPE_STUFF, a7 as NodeKind, n as NodePipeType, a8 as PipeBatchBlueprint, a9 as PipeBlueprintBase, aa as PipeComposeBlueprint, ab as PipeComposeConstructBlueprint, ac as PipeComposeConstructField, ad as PipeConditionBlueprint, l as PipeControllerType, ae as PipeDocGenBlueprint, af as PipeExtractBlueprint, ag as PipeFuncBlueprint, ah as PipeImgGenBlueprint, ai as PipeJudgeBlueprint, aj as PipeLLMBlueprint, q as PipeOperatorType, ak as PipeParallelBlueprint, al as PipeSearchBlueprint, am as PipeSequenceBlueprint, an as PipeSignatureBlueprint, i as PipeStatus, ao as PipeStructureBlueprint, ap as PipeType, a as PresenceMarker, aq as STUFF_ID_PREFIX, ar as SequenceStepSpec, as as StuffMultiplicity, at as StuffRegistryEntry, au as StuffRole, av as StuffSpecInfo, aw as SubPipeSpec, ax as TOOLBAR_POSITION, ay as TemplateBlueprint, az as ToolbarOrientation, aA as ToolbarSide, aB as VALIDATION_STATE, k as ValidationState, aC as graphSpecMode, aD as isBindingNode, aE as isBindingStepSpec, aF as isDryGraphSpec, aG as isPluralMultiplicity, aH as isStaticGraphSpec, aI as isStuffNodeId, aJ as multiplicitySuffix, aK as nodeHeight, aL as nodeWidth, aM as stuffDigestFromId, aN as stuffNodeId, aO as toolbarOrientation, aP as toolbarSide } from '../types-BaFWy56P.js';
1
+ import { q as GraphSpecNode, s as CardNode, t as PipeCallNode, b as GraphSpec, D as DataflowAnalysis, C as ConceptInfo, P as PipeBlueprintUnion, u as GraphData, p as GraphSpecMode, v as PipeCardPayload, n as FoldToggleOptions, e as GraphNode, d as GraphEdge, c as GraphNodeData, N as NodeValidationSummary, V as ValidationIssue, k as GraphSpecNodeIoItem, g as GraphDirection, w as LayoutConfig, E as EdgeRoute, x as GraphPoint, f as GraphConfig, T as ToolbarPosition, i as GraphStyleId, G as GraphTheme, o as NodePipeType, S as StepCategory, j as PipeStatus } from '../types-BNqjYF_x.js';
2
+ export { A as ARROW_CLOSED_MARKER, B as BINDING_STEP_TYPE, y as BindingNode, z as BindingStepSpec, H as BindingStepType, I as CONTROLLER_PADDING_BOTTOM, J as CONTROLLER_PADDING_TOP, K as CONTROLLER_PADDING_X, M as EDGE_TYPE, O as EDGE_TYPE_ROUTED, Q as EdgeType, R as FOLD_MODE, U as FieldResolution, F as FoldMode, W as GRAPH_DIRECTION, X as GRAPH_SPEC_MODE, Y as GRAPH_STYLE, Z as GRAPH_THEME, _ as GRAPH_THEME_MODE, $ as GraphSpecEdge, a0 as GraphSpecEdgeKind, a1 as GraphSpecMeta, a2 as GraphSpecModelUsage, a3 as GraphSpecNodeError, a4 as GraphSpecNodeIo, a5 as GraphSpecNodeTiming, a6 as GraphSpecNodeUsage, a7 as GraphSpecUsage, h as GraphThemeMode, a8 as JudgmentQuestionSpec, a9 as KNOWN_PIPE_TYPES, L as LabelDescriptor, aa as NODE_TYPE_CONTROLLER, ab as NODE_TYPE_PIPE_CARD, ac as NODE_TYPE_SIMPLE_DECISION, ad as NODE_TYPE_SIMPLE_FRAME, ae as NODE_TYPE_SIMPLE_STEP, af as NODE_TYPE_SIMPLE_TERMINAL, ag as NODE_TYPE_STUFF, ah as NodeKind, ai as PipeBatchBlueprint, aj as PipeBlueprintBase, ak as PipeComposeBlueprint, al as PipeComposeConstructBlueprint, am as PipeComposeConstructField, an as PipeConditionBlueprint, m as PipeControllerType, ao as PipeDocGenBlueprint, ap as PipeExtractBlueprint, aq as PipeFuncBlueprint, ar as PipeImgGenBlueprint, as as PipeJudgeBlueprint, at as PipeLLMBlueprint, r as PipeOperatorType, au as PipeParallelBlueprint, av as PipeSearchBlueprint, aw as PipeSequenceBlueprint, ax as PipeSignatureBlueprint, ay as PipeStructureBlueprint, az as PipeType, a as PresenceMarker, aA as STEP_CATEGORY, aB as STUFF_ID_PREFIX, aC as SequenceStepSpec, aD as SimpleNodePayload, aE as StuffMultiplicity, aF as StuffRegistryEntry, aG as StuffRole, aH as StuffSpecInfo, aI as SubPipeSpec, aJ as TOOLBAR_POSITION, aK as TemplateBlueprint, aL as ToolbarOrientation, aM as ToolbarSide, aN as VALIDATION_STATE, l as ValidationState, aO as graphSpecMode, aP as isBindingNode, aQ as isBindingStepSpec, aR as isDryGraphSpec, aS as isPluralMultiplicity, aT as isStaticGraphSpec, aU as isStuffNodeId, aV as multiplicitySuffix, aW as nodeHeight, aX as nodeWidth, aY as stuffDigestFromId, aZ as stuffNodeId, a_ as toolbarOrientation, a$ as toolbarSide } from '../types-BNqjYF_x.js';
3
3
  export { P as ParsedPipeRef, m as makePipeRef, p as parsePipeRef } from '../pipeRefs-BQJO5nh5.js';
4
4
  import { ElkNode } from 'elkjs/lib/elk-api';
5
5
 
@@ -150,7 +150,10 @@ declare function applyFolds(graphData: GraphData, analysis: DataflowAnalysis, gr
150
150
  * Each issue's target ids are remapped through the fold containment
151
151
  * (`outermostFoldedAncestor`): an issue on a node hidden inside a folded
152
152
  * controller decorates the folded controller's card instead, so folding never
153
- * hides an error. Targets that don't resolve to a rendered node (e.g. a
153
+ * hides an error. They then go through the style's `standIns`: an issue on a
154
+ * node the style does not draw decorates the drawn node standing for it, such
155
+ * as a batch item's run in the simple style, drawn once for every item. Targets
156
+ * that don't resolve to a rendered node (e.g. a
154
157
  * diagnostic about a pipe that was skipped during the static walk) simply
155
158
  * produce no decoration — those issues stay panel-only.
156
159
  *
@@ -158,14 +161,14 @@ declare function applyFolds(graphData: GraphData, analysis: DataflowAnalysis, gr
158
161
  * invocations of a broken pipe shows 2, matching the sum of the badges that
159
162
  * become visible when it is expanded.
160
163
  */
161
- declare function buildValidationDecorations(issues: readonly ValidationIssue[] | undefined, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>): Map<string, NodeValidationSummary>;
164
+ declare function buildValidationDecorations(issues: readonly ValidationIssue[] | undefined, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>, standIns?: ReadonlyMap<string, string>): Map<string, NodeValidationSummary>;
162
165
  /**
163
166
  * Resolve the rendered node a panel row should navigate to: the issue's first
164
- * target, remapped through the fold containment, and only if that id is
165
- * actually rendered. `null` for panel-only issues (no target, or the target
166
- * never became a node).
167
+ * target, remapped through the fold containment and the style's stand-ins, and
168
+ * only if that id is actually rendered. `null` for panel-only issues (no
169
+ * target, or the target never became a node).
167
170
  */
168
- declare function resolveIssueTargetNodeId(issue: ValidationIssue, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>, renderedNodeIds: ReadonlySet<string>): string | null;
171
+ declare function resolveIssueTargetNodeId(issue: ValidationIssue, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>, renderedNodeIds: ReadonlySet<string>, standIns?: ReadonlyMap<string, string>): string | null;
169
172
  /**
170
173
  * Stamp the decoration map onto rendered nodes (and their pipe-card payloads).
171
174
  * Nodes whose decoration is unchanged are returned as-is; a node whose issues
@@ -265,6 +268,12 @@ interface ElkPositionResult {
265
268
  height: number;
266
269
  }
267
270
  declare function extractAbsolutePositions(elkResult: ElkNode): Record<string, ElkPositionResult>;
271
+ /**
272
+ * Every edge's route, keyed by edge id, from a layout run with `routeEdges`
273
+ * (its coordinates are then the root's). An edge ELK reports no section for is
274
+ * left out, and is drawn as a free curve.
275
+ */
276
+ declare function extractEdgeRoutes(elkResult: ElkNode): Record<string, EdgeRoute>;
268
277
 
269
278
  interface LayoutResult {
270
279
  nodes: GraphNode[];
@@ -274,6 +283,32 @@ interface LayoutResult {
274
283
  }
275
284
  declare function getLayoutedElements(nodes: GraphNode[], edges: GraphEdge[], direction: GraphDirection, layoutConfig?: LayoutConfig, graphspec?: GraphSpec | null, analysis?: DataflowAnalysis | null): Promise<LayoutResult>;
276
285
 
286
+ /**
287
+ * How far a measured handle may sit from the port the layout routed from
288
+ * before the route is stale: a node dragged away. Handles are drawn a few
289
+ * pixels outside their node, which this absorbs.
290
+ */
291
+ declare const ROUTE_ENDPOINT_TOLERANCE_PX = 8;
292
+ /** The radius each bend of a route is rounded with, shrunk on short segments. */
293
+ declare const ROUTE_CORNER_RADIUS_PX = 8;
294
+ /**
295
+ * A route's points with its ends moved onto the measured handles, or null
296
+ * when either handle is too far from the port the layout routed from. The
297
+ * point next to a moved end moves with it along the segment's axis, so an
298
+ * orthogonal route stays orthogonal.
299
+ */
300
+ declare function fitRoute(points: readonly GraphPoint[], source: GraphPoint, target: GraphPoint, tolerance?: number): GraphPoint[] | null;
301
+ /**
302
+ * An SVG path through a polyline, each bend rounded by a quadratic curve. A
303
+ * bend's radius shrinks to half its shorter segment, so close bends never
304
+ * overshoot each other.
305
+ */
306
+ declare function roundedPolylinePath(points: readonly GraphPoint[], radius?: number): string;
307
+ /** The point halfway along a polyline, for a label the layout did not place. */
308
+ declare function polylineMidpoint(points: readonly GraphPoint[]): GraphPoint;
309
+ /** Where a routed edge's label is centred: the box the layout placed, or the route's midpoint. */
310
+ declare function routeLabelCenter(route: EdgeRoute, fitted: readonly GraphPoint[]): GraphPoint;
311
+
277
312
  /** Max visible children before a parallel/batch controller auto-collapses. */
278
313
  declare const MAX_VISIBLE_CONTROLLER_CHILDREN = 5;
279
314
  /** Position and size for a controller, as computed by the layout engine. */
@@ -305,13 +340,305 @@ declare function applyControllers(layoutedNodes: GraphNode[], layoutedEdges: Gra
305
340
  nodes: GraphNode[];
306
341
  edges: GraphEdge[];
307
342
  };
343
+ /**
344
+ * Order nodes so every group node comes before its children, which ReactFlow
345
+ * requires. Stable within a nesting depth. Throws on a cycle in the parent
346
+ * chain rather than looping.
347
+ */
348
+ declare function sortParentsFirst(nodes: GraphNode[]): GraphNode[];
308
349
 
309
350
  declare const DARK_PALETTE_COLORS: Record<string, string>;
310
351
  declare const LIGHT_PALETTE_COLORS: Record<string, string>;
311
352
  declare function getPaletteForTheme(theme: GraphTheme): Record<string, string>;
312
353
  declare const DEFAULT_GRAPH_CONFIG: GraphConfig & {
313
354
  toolbarPosition: ToolbarPosition;
355
+ graphStyle: GraphStyleId;
314
356
  };
315
357
  declare function getPaletteColors(): Record<string, string>;
316
358
 
317
- export { CardNode, ConceptInfo, type ControllerRect, DARK_PALETTE_COLORS, DEFAULT_GRAPH_CONFIG, DataflowAnalysis, type ElkPositionResult, FoldToggleOptions, GraphConfig, GraphData, GraphDirection, GraphEdge, GraphNode, GraphNodeData, GraphSpec, GraphSpecMode, GraphSpecNode, GraphSpecNodeIoItem, GraphSpecValidationError, GraphTheme, LIGHT_PALETTE_COLORS, LayoutConfig, type LayoutResult, MAX_VISIBLE_CONTROLLER_CHILDREN, NodeValidationSummary, PipeBlueprintUnion, PipeCallNode, PipeCardPayload, type StuffLocation, ToolbarPosition, ValidationIssue, applyControllers, applyFolds, applyValidationDecorations, asCardNode, asPipeCallNode, buildChildToControllerMap, buildContainmentChain, buildControllerNodes, buildDataflowAnalysis, buildDataflowGraph, buildElkGraph, buildGraph, buildPipeCardPayload, buildValidationDecorations, estimateNodeDimensions, extractAbsolutePositions, findCousinControllers, findStuffByDigest, getConceptInfo, getLayoutedElements, getPaletteColors, getPaletteForTheme, getPipeBlueprint, inputPortId, outermostFoldedAncestor, outputPortId, pipeRefOf, resolveConceptRef, resolveIssueTargetNodeId, validateGraphSpec };
359
+ /** Which of the toolbar's controls make sense for a style. */
360
+ interface GraphStyleCapabilities {
361
+ /**
362
+ * The toolbar's show/hide controllers toggle applies: the style draws
363
+ * controller frames on demand. A style that decides its own frames hides it.
364
+ */
365
+ controllerFrameToggle: boolean;
366
+ /**
367
+ * Fold-all and expand-all apply. In a style that also has the frame toggle
368
+ * they apply only while the frames are shown, since a fold is undone from a
369
+ * frame.
370
+ */
371
+ foldAll: boolean;
372
+ }
373
+ /** What the registry says of one style: what it is called, what it is for, and what it supports. */
374
+ interface GraphStyleDescriptor {
375
+ id: GraphStyleId;
376
+ /** The style's name in the toolbar menu. */
377
+ name: string;
378
+ /** One line saying what the style shows, under its name in the menu. */
379
+ description: string;
380
+ capabilities: GraphStyleCapabilities;
381
+ /**
382
+ * How the style lays out: its spacing, which replaces `config.nodesep` and
383
+ * `config.ranksep` for it, the room its frames keep around their steps, and
384
+ * whether its edges follow routes around the nodes in their way. A style
385
+ * that leaves it undefined keeps the host's spacing and the controller
386
+ * groups' padding, and draws free curves of the host's `edgeType`.
387
+ */
388
+ layout?: Required<LayoutConfig>;
389
+ }
390
+ declare const GRAPH_STYLES: Record<GraphStyleId, GraphStyleDescriptor>;
391
+ /** Every registered style, in the order the menu lists them. */
392
+ declare const GRAPH_STYLE_IDS: readonly GraphStyleId[];
393
+ /**
394
+ * Whether a value names a registered style. For values that cross an untyped
395
+ * boundary — an editor setting, the standalone page's config embed, a host
396
+ * written in plain JavaScript — before they reach the viewer.
397
+ */
398
+ declare function isGraphStyleId(value: unknown): value is GraphStyleId;
399
+ /**
400
+ * Resolve the active style from `(graphStyle prop, config.graphStyle, default)`.
401
+ * Pure + exported so the controlled/reactive precedence is unit-testable
402
+ * without React, under the same contract `resolveExternalThemeMode` holds:
403
+ * - the prop wins when it names a style,
404
+ * - falls back to `config.graphStyle` when the prop is undefined (so a host can
405
+ * hand control back to config after passing the prop),
406
+ * - falls back to the library default (`detailed`) when neither is set.
407
+ *
408
+ * A value naming no registered style is treated as unset rather than thrown
409
+ * on: a style is a preference, and a host relaying a setting written for a
410
+ * newer version of this package should still get a graph.
411
+ */
412
+ declare function resolveGraphStyle(styleProp: unknown, configStyle: unknown): GraphStyleId;
413
+ /**
414
+ * The styles the toolbar menu offers, from the viewer's `styleMenu` prop:
415
+ * nothing for `false` or `undefined` (the menu is opt-in), every registered
416
+ * style in registry order for `true`, and for a list the registered styles it
417
+ * names, in its order and without repeats. A menu needs two styles to choose
418
+ * between, so fewer than two offer none.
419
+ */
420
+ declare function resolveStyleMenu(styleMenu: boolean | readonly GraphStyleId[] | undefined): GraphStyleId[];
421
+
422
+ /** The last segment of a dotted ref: the code without its domain (`recruitment.CandidateProfile` → `CandidateProfile`). */
423
+ declare function stripDomain(ref: string): string;
424
+ /**
425
+ * An identifier as words in sentence case: `job_offer` → "Job offer",
426
+ * `CandidateProfile` → "Candidate profile", `pr_url` → "PR URL",
427
+ * `cvs` → "CVs". A dotted ref is humanized by its last segment.
428
+ */
429
+ declare function humanizeIdentifier(identifier: string): string;
430
+ /** A concept's plain name, from its code or ref: a native's own plain name, or the humanized code. */
431
+ declare function conceptPlainName(conceptRef: string): string;
432
+ /** Whether a concept is a native that names no particular kind of content (`Anything`, `Dynamic`, `Composite`). */
433
+ declare function isGenericConcept(conceptRef: string): boolean;
434
+ /**
435
+ * Authored text as a title: whitespace collapsed (descriptions are often
436
+ * written across lines), the first letter capitalized, and a single closing
437
+ * period dropped, since a label in a box reads as a heading. Nothing else is
438
+ * touched: the words are the author's.
439
+ */
440
+ declare function sentenceCase(text: string): string;
441
+ /**
442
+ * A condition's outcome as an arrow label: `english` → "English",
443
+ * `high_priority` → "High priority", a yes-or-no test's `true` and `false` →
444
+ * "Yes" and "No", and the `default` outcome → "Otherwise". A branch taken on
445
+ * several outcomes, written `no_fit | default` as the static builder labels it,
446
+ * reads "No fit or otherwise".
447
+ */
448
+ declare function outcomeLabel(outcome: string): string;
449
+
450
+ /** A text's rendered width at a font size, in pixels. */
451
+ declare function textWidthPx(text: string, fontPx: number): number;
452
+ /** How many lines a text wraps to at a width, and whether it fits in `maxLines`. */
453
+ interface WrapEstimate {
454
+ /** Lines the text needs, unclamped. */
455
+ lines: number;
456
+ /** Lines it is drawn on: `lines` clamped to `maxLines`. */
457
+ drawnLines: number;
458
+ /** Whether the text is cut, so its box must carry the full text in a tooltip. */
459
+ clamped: boolean;
460
+ }
461
+ /**
462
+ * Estimate a text's wrapped line count by greedy word wrap at a line width,
463
+ * the way the browser wraps it. A word wider than a line is broken across as
464
+ * many lines as it needs (`overflow-wrap: anywhere`), starting on a line of
465
+ * its own.
466
+ */
467
+ declare function estimateWrap(text: string, lineWidthPx: number, fontPx: number, maxLines: number): WrapEstimate;
468
+
469
+ declare const SIMPLE_STEP_WIDTH = 160;
470
+ /**
471
+ * The wider box a step takes when its title would need more lines than
472
+ * `SIMPLE_TITLE_MAX_LINES` at `SIMPLE_STEP_WIDTH` and fits them at this one:
473
+ * one step of width, not a box per title, so a column of steps keeps its rhythm.
474
+ */
475
+ declare const SIMPLE_STEP_WIDE_WIDTH = 200;
476
+ declare const SIMPLE_STEP_TITLE_FONT_PX = 15;
477
+ declare const SIMPLE_TITLE_MAX_LINES = 3;
478
+ declare const SIMPLE_TERMINAL_WIDTH = 124;
479
+ /**
480
+ * The widths a decision diamond may take, narrowest first: it takes the first
481
+ * at which its text fits in `SIMPLE_TITLE_MAX_LINES`, so a long question
482
+ * widens the diamond rather than losing its end.
483
+ */
484
+ declare const SIMPLE_DECISION_WIDTHS: readonly number[];
485
+ /**
486
+ * The controller depth from which the simple style folds a sub-method by
487
+ * default (the method's own controller is depth 0). Deep nesting is where a
488
+ * flowchart stops reading as one; a folded sub-method is one step a reader
489
+ * can open. Only sequences fold this way: a decision, a loop or a parallel is
490
+ * structure the reader came to see, however deep it sits.
491
+ */
492
+ declare const SIMPLE_FOLD_DEPTH = 3;
493
+ /**
494
+ * The category each card class reads as. Exhaustive over `NodePipeType`, so a
495
+ * new pipe class must say what it is. A binding step is drawn only when it
496
+ * failed, as the field it was picking.
497
+ */
498
+ declare const STEP_CATEGORY_BY_PIPE_TYPE: Record<NodePipeType, StepCategory>;
499
+ /** The plain word each category is shown with. */
500
+ declare const STEP_CATEGORY_WORDS: Record<StepCategory, string>;
501
+ /** The size of a step box for its title and markers. */
502
+ declare function simpleStepSize(title: string, options?: {
503
+ forEach?: boolean;
504
+ innerSteps?: boolean;
505
+ }): {
506
+ width: number;
507
+ height: number;
508
+ };
509
+ /** The size of an input or output's document shape. */
510
+ declare function simpleTerminalSize(title: string, hasSubtitle: boolean): {
511
+ width: number;
512
+ height: number;
513
+ };
514
+ /**
515
+ * The size of a decision diamond for its text: the narrowest of
516
+ * `SIMPLE_DECISION_WIDTHS` its text fits in, and the height that keeps the
517
+ * text block inside the rhombus.
518
+ */
519
+ declare function simpleDecisionSize(title: string): {
520
+ width: number;
521
+ height: number;
522
+ };
523
+ /**
524
+ * How a step title wraps in a box of a width (the default box unless given):
525
+ * what the readability rubric checks, at the width the step is drawn at.
526
+ */
527
+ declare function simpleTitleWrap(title: string, boxWidth?: number): WrapEstimate;
528
+ /** The status a step drawn once stands for when it ran several times (once per batch item). */
529
+ declare function aggregateStatus(statuses: readonly PipeStatus[]): PipeStatus | undefined;
530
+ interface SimpleProjectionInput {
531
+ graphspec: GraphSpec;
532
+ /** The dataflow graph after the folds: what the detailed style would lay out. */
533
+ nodes: GraphNode[];
534
+ /** The analysis after the folds (a folded controller is one producer and consumer). */
535
+ analysis: DataflowAnalysis;
536
+ /** The analysis before the folds: the full containment, which a fold hides. */
537
+ rawAnalysis: DataflowAnalysis;
538
+ }
539
+ interface SimpleProjection {
540
+ nodes: GraphNode[];
541
+ edges: GraphEdge[];
542
+ /**
543
+ * The analysis the layout and the frames read: the "for each" frames are its
544
+ * only controllers, holding the nodes drawn inside them, and it names no
545
+ * producer or consumer, since every value the style draws is a method input
546
+ * or a final output and sits outside every frame.
547
+ */
548
+ analysis: DataflowAnalysis;
549
+ /** Each spec node the style does not draw, mapped to the drawn node that stands for it. */
550
+ standIns: ReadonlyMap<string, string>;
551
+ }
552
+ /**
553
+ * Project the folded dataflow graph into the simple style's nodes and edges.
554
+ * Node ids stay the GraphSpec's — a step keeps its pipe node's id and a method
555
+ * input or final output keeps its stuff node's — so selection, the detail
556
+ * panel, run status and validation decorations find them as in any style.
557
+ */
558
+ declare function projectSimpleGraph(input: SimpleProjectionInput): SimpleProjection;
559
+ /**
560
+ * The size an arrow label is drawn at, background included, so the layout
561
+ * reserves room for it: the text at `EDGE_LABEL_FONT_PX`, padded by
562
+ * `EDGE_LABEL_PADDING`.
563
+ */
564
+ declare function simpleEdgeLabelSize(label: string): {
565
+ width: number;
566
+ height: number;
567
+ };
568
+ /**
569
+ * The controllers the simple style folds when a graph is first drawn: every
570
+ * sub-method (a sequence) from `SIMPLE_FOLD_DEPTH` levels down. The host's own fold mode
571
+ * still applies on top.
572
+ */
573
+ declare function simpleDefaultFolds(graphspec: GraphSpec, rawAnalysis: DataflowAnalysis): Set<string>;
574
+ /**
575
+ * Wrap the laid-out nodes in the simple style's "for each" frames: the group
576
+ * nodes are built by the same pass that builds the detailed style's controller
577
+ * groups, at the positions and sizes the layout gave them, and take what they
578
+ * say from the projection's placeholders. Mutates the content nodes' `parentId`
579
+ * and positions as that pass does, so callers pass a copy of the layout.
580
+ */
581
+ declare function applySimpleFrames(args: {
582
+ nodes: GraphNode[];
583
+ edges: GraphEdge[];
584
+ graphspec: GraphSpec;
585
+ analysis: DataflowAnalysis;
586
+ controllerPositions?: Record<string, ControllerRect>;
587
+ onToggleFold?: (controllerId: string, options?: FoldToggleOptions) => void;
588
+ }): {
589
+ nodes: GraphNode[];
590
+ edges: GraphEdge[];
591
+ };
592
+
593
+ /** What a style's projection receives: the dataflow graph after the folds, for one spec. */
594
+ interface StyleProjectionArgs {
595
+ graphspec: GraphSpec;
596
+ nodes: GraphNode[];
597
+ edges: GraphEdge[];
598
+ /** The analysis after the folds; null for a spec with no data flow. */
599
+ analysis: DataflowAnalysis | null;
600
+ /** The analysis before the folds; null for a spec with no data flow. */
601
+ rawAnalysis: DataflowAnalysis | null;
602
+ }
603
+ /** What the layout lays out for a style, and the analysis its frames are built from. */
604
+ interface StyleProjection {
605
+ nodes: GraphNode[];
606
+ edges: GraphEdge[];
607
+ analysis: DataflowAnalysis | null;
608
+ /**
609
+ * For a style that draws some of the spec's nodes through others: each node
610
+ * it does not draw, mapped to the drawn node that stands for it, so that a
611
+ * validation issue pinned to the first still badges the second.
612
+ */
613
+ standIns?: ReadonlyMap<string, string>;
614
+ }
615
+ /** What a style's frame pass receives: the laid-out nodes, and the viewer's frame and fold state. */
616
+ interface StyleFrameArgs {
617
+ nodes: GraphNode[];
618
+ edges: GraphEdge[];
619
+ graphspec: GraphSpec | null;
620
+ analysis: DataflowAnalysis | null;
621
+ controllerPositions?: Record<string, ControllerRect>;
622
+ showControllers: boolean;
623
+ expandedControllers?: ReadonlySet<string>;
624
+ onToggleCollapse?: (controllerId: string) => void;
625
+ onToggleFold?: (controllerId: string, options?: FoldToggleOptions) => void;
626
+ }
627
+ /**
628
+ * The drawing pipeline a style contributes, in the order the viewer runs it:
629
+ * the controllers it folds on a fresh graph, the projection of the folded
630
+ * dataflow graph into the nodes and edges it lays out, and the pass that wraps
631
+ * the laid-out nodes in its frames. Pure: the node components that draw the
632
+ * result are the React layer's.
633
+ */
634
+ interface GraphStylePipeline {
635
+ defaultFolds(graphspec: GraphSpec, rawAnalysis: DataflowAnalysis): Set<string>;
636
+ project(args: StyleProjectionArgs): StyleProjection;
637
+ frame(args: StyleFrameArgs): {
638
+ nodes: GraphNode[];
639
+ edges: GraphEdge[];
640
+ };
641
+ }
642
+ declare const GRAPH_STYLE_PIPELINES: Record<GraphStyleId, GraphStylePipeline>;
643
+
644
+ export { CardNode, ConceptInfo, type ControllerRect, DARK_PALETTE_COLORS, DEFAULT_GRAPH_CONFIG, DataflowAnalysis, EdgeRoute, type ElkPositionResult, FoldToggleOptions, GRAPH_STYLES, GRAPH_STYLE_IDS, GRAPH_STYLE_PIPELINES, GraphConfig, GraphData, GraphDirection, GraphEdge, GraphNode, GraphNodeData, GraphPoint, GraphSpec, GraphSpecMode, GraphSpecNode, GraphSpecNodeIoItem, GraphSpecValidationError, type GraphStyleCapabilities, type GraphStyleDescriptor, GraphStyleId, type GraphStylePipeline, GraphTheme, LIGHT_PALETTE_COLORS, LayoutConfig, type LayoutResult, MAX_VISIBLE_CONTROLLER_CHILDREN, NodePipeType, NodeValidationSummary, PipeBlueprintUnion, PipeCallNode, PipeCardPayload, PipeStatus, ROUTE_CORNER_RADIUS_PX, ROUTE_ENDPOINT_TOLERANCE_PX, SIMPLE_DECISION_WIDTHS, SIMPLE_FOLD_DEPTH, SIMPLE_STEP_TITLE_FONT_PX, SIMPLE_STEP_WIDE_WIDTH, SIMPLE_STEP_WIDTH, SIMPLE_TERMINAL_WIDTH, SIMPLE_TITLE_MAX_LINES, STEP_CATEGORY_BY_PIPE_TYPE, STEP_CATEGORY_WORDS, type SimpleProjection, type SimpleProjectionInput, StepCategory, type StuffLocation, type StyleFrameArgs, type StyleProjection, type StyleProjectionArgs, ToolbarPosition, ValidationIssue, type WrapEstimate, aggregateStatus, applyControllers, applyFolds, applySimpleFrames, applyValidationDecorations, asCardNode, asPipeCallNode, buildChildToControllerMap, buildContainmentChain, buildControllerNodes, buildDataflowAnalysis, buildDataflowGraph, buildElkGraph, buildGraph, buildPipeCardPayload, buildValidationDecorations, conceptPlainName, estimateNodeDimensions, estimateWrap, extractAbsolutePositions, extractEdgeRoutes, findCousinControllers, findStuffByDigest, fitRoute, getConceptInfo, getLayoutedElements, getPaletteColors, getPaletteForTheme, getPipeBlueprint, humanizeIdentifier, inputPortId, isGenericConcept, isGraphStyleId, outcomeLabel, outermostFoldedAncestor, outputPortId, pipeRefOf, polylineMidpoint, projectSimpleGraph, resolveConceptRef, resolveGraphStyle, resolveIssueTargetNodeId, resolveStyleMenu, roundedPolylinePath, routeLabelCenter, sentenceCase, simpleDecisionSize, simpleDefaultFolds, simpleEdgeLabelSize, simpleStepSize, simpleTerminalSize, simpleTitleWrap, sortParentsFirst, stripDomain, textWidthPx, validateGraphSpec };
@@ -1,9 +1,25 @@
1
- import "../chunk-F6TZIJ7A.js";
1
+ import "../chunk-KB2DIEVF.js";
2
2
  import {
3
+ GRAPH_STYLES,
4
+ GRAPH_STYLE_IDS,
5
+ GRAPH_STYLE_PIPELINES,
3
6
  GraphSpecValidationError,
4
7
  MAX_VISIBLE_CONTROLLER_CHILDREN,
8
+ ROUTE_CORNER_RADIUS_PX,
9
+ ROUTE_ENDPOINT_TOLERANCE_PX,
10
+ SIMPLE_DECISION_WIDTHS,
11
+ SIMPLE_FOLD_DEPTH,
12
+ SIMPLE_STEP_TITLE_FONT_PX,
13
+ SIMPLE_STEP_WIDE_WIDTH,
14
+ SIMPLE_STEP_WIDTH,
15
+ SIMPLE_TERMINAL_WIDTH,
16
+ SIMPLE_TITLE_MAX_LINES,
17
+ STEP_CATEGORY_BY_PIPE_TYPE,
18
+ STEP_CATEGORY_WORDS,
19
+ aggregateStatus,
5
20
  applyControllers,
6
21
  applyFolds,
22
+ applySimpleFrames,
7
23
  applyValidationDecorations,
8
24
  asCardNode,
9
25
  asPipeCallNode,
@@ -16,21 +32,45 @@ import {
16
32
  buildGraph,
17
33
  buildPipeCardPayload,
18
34
  buildValidationDecorations,
35
+ conceptPlainName,
19
36
  estimateNodeDimensions,
37
+ estimateWrap,
20
38
  extractAbsolutePositions,
39
+ extractEdgeRoutes,
21
40
  findCousinControllers,
22
41
  findStuffByDigest,
42
+ fitRoute,
23
43
  getConceptInfo,
24
44
  getLayoutedElements,
25
45
  getPipeBlueprint,
46
+ humanizeIdentifier,
26
47
  inputPortId,
48
+ isGenericConcept,
49
+ isGraphStyleId,
50
+ outcomeLabel,
27
51
  outermostFoldedAncestor,
28
52
  outputPortId,
29
53
  pipeRefOf,
54
+ polylineMidpoint,
55
+ projectSimpleGraph,
30
56
  resolveConceptRef,
57
+ resolveGraphStyle,
31
58
  resolveIssueTargetNodeId,
59
+ resolveStyleMenu,
60
+ roundedPolylinePath,
61
+ routeLabelCenter,
62
+ sentenceCase,
63
+ simpleDecisionSize,
64
+ simpleDefaultFolds,
65
+ simpleEdgeLabelSize,
66
+ simpleStepSize,
67
+ simpleTerminalSize,
68
+ simpleTitleWrap,
69
+ sortParentsFirst,
70
+ stripDomain,
71
+ textWidthPx,
32
72
  validateGraphSpec
33
- } from "../chunk-ZTXSDTVF.js";
73
+ } from "../chunk-3BXB6HSF.js";
34
74
  import {
35
75
  makePipeRef,
36
76
  parsePipeRef
@@ -41,7 +81,7 @@ import {
41
81
  LIGHT_PALETTE_COLORS,
42
82
  getPaletteColors,
43
83
  getPaletteForTheme
44
- } from "../chunk-Y46574OW.js";
84
+ } from "../chunk-GAOBB3UT.js";
45
85
  import {
46
86
  ARROW_CLOSED_MARKER,
47
87
  BINDING_STEP_TYPE,
@@ -49,15 +89,22 @@ import {
49
89
  CONTROLLER_PADDING_TOP,
50
90
  CONTROLLER_PADDING_X,
51
91
  EDGE_TYPE,
92
+ EDGE_TYPE_ROUTED,
52
93
  FOLD_MODE,
53
94
  GRAPH_DIRECTION,
54
95
  GRAPH_SPEC_MODE,
96
+ GRAPH_STYLE,
55
97
  GRAPH_THEME,
56
98
  GRAPH_THEME_MODE,
57
99
  KNOWN_PIPE_TYPES,
58
100
  NODE_TYPE_CONTROLLER,
59
101
  NODE_TYPE_PIPE_CARD,
102
+ NODE_TYPE_SIMPLE_DECISION,
103
+ NODE_TYPE_SIMPLE_FRAME,
104
+ NODE_TYPE_SIMPLE_STEP,
105
+ NODE_TYPE_SIMPLE_TERMINAL,
60
106
  NODE_TYPE_STUFF,
107
+ STEP_CATEGORY,
61
108
  STUFF_ID_PREFIX,
62
109
  TOOLBAR_POSITION,
63
110
  VALIDATION_STATE,
@@ -75,7 +122,7 @@ import {
75
122
  stuffNodeId,
76
123
  toolbarOrientation,
77
124
  toolbarSide
78
- } from "../chunk-3I3ZPYMW.js";
125
+ } from "../chunk-PJTYQURQ.js";
79
126
  import "../chunk-2NMEKWO5.js";
80
127
  export {
81
128
  ARROW_CLOSED_MARKER,
@@ -86,9 +133,14 @@ export {
86
133
  DARK_PALETTE_COLORS,
87
134
  DEFAULT_GRAPH_CONFIG,
88
135
  EDGE_TYPE,
136
+ EDGE_TYPE_ROUTED,
89
137
  FOLD_MODE,
90
138
  GRAPH_DIRECTION,
91
139
  GRAPH_SPEC_MODE,
140
+ GRAPH_STYLE,
141
+ GRAPH_STYLES,
142
+ GRAPH_STYLE_IDS,
143
+ GRAPH_STYLE_PIPELINES,
92
144
  GRAPH_THEME,
93
145
  GRAPH_THEME_MODE,
94
146
  GraphSpecValidationError,
@@ -97,12 +149,30 @@ export {
97
149
  MAX_VISIBLE_CONTROLLER_CHILDREN,
98
150
  NODE_TYPE_CONTROLLER,
99
151
  NODE_TYPE_PIPE_CARD,
152
+ NODE_TYPE_SIMPLE_DECISION,
153
+ NODE_TYPE_SIMPLE_FRAME,
154
+ NODE_TYPE_SIMPLE_STEP,
155
+ NODE_TYPE_SIMPLE_TERMINAL,
100
156
  NODE_TYPE_STUFF,
157
+ ROUTE_CORNER_RADIUS_PX,
158
+ ROUTE_ENDPOINT_TOLERANCE_PX,
159
+ SIMPLE_DECISION_WIDTHS,
160
+ SIMPLE_FOLD_DEPTH,
161
+ SIMPLE_STEP_TITLE_FONT_PX,
162
+ SIMPLE_STEP_WIDE_WIDTH,
163
+ SIMPLE_STEP_WIDTH,
164
+ SIMPLE_TERMINAL_WIDTH,
165
+ SIMPLE_TITLE_MAX_LINES,
166
+ STEP_CATEGORY,
167
+ STEP_CATEGORY_BY_PIPE_TYPE,
168
+ STEP_CATEGORY_WORDS,
101
169
  STUFF_ID_PREFIX,
102
170
  TOOLBAR_POSITION,
103
171
  VALIDATION_STATE,
172
+ aggregateStatus,
104
173
  applyControllers,
105
174
  applyFolds,
175
+ applySimpleFrames,
106
176
  applyValidationDecorations,
107
177
  asCardNode,
108
178
  asPipeCallNode,
@@ -115,20 +185,27 @@ export {
115
185
  buildGraph,
116
186
  buildPipeCardPayload,
117
187
  buildValidationDecorations,
188
+ conceptPlainName,
118
189
  estimateNodeDimensions,
190
+ estimateWrap,
119
191
  extractAbsolutePositions,
192
+ extractEdgeRoutes,
120
193
  findCousinControllers,
121
194
  findStuffByDigest,
195
+ fitRoute,
122
196
  getConceptInfo,
123
197
  getLayoutedElements,
124
198
  getPaletteColors,
125
199
  getPaletteForTheme,
126
200
  getPipeBlueprint,
127
201
  graphSpecMode,
202
+ humanizeIdentifier,
128
203
  inputPortId,
129
204
  isBindingNode,
130
205
  isBindingStepSpec,
131
206
  isDryGraphSpec,
207
+ isGenericConcept,
208
+ isGraphStyleId,
132
209
  isPluralMultiplicity,
133
210
  isStaticGraphSpec,
134
211
  isStuffNodeId,
@@ -136,14 +213,31 @@ export {
136
213
  multiplicitySuffix,
137
214
  nodeHeight,
138
215
  nodeWidth,
216
+ outcomeLabel,
139
217
  outermostFoldedAncestor,
140
218
  outputPortId,
141
219
  parsePipeRef,
142
220
  pipeRefOf,
221
+ polylineMidpoint,
222
+ projectSimpleGraph,
143
223
  resolveConceptRef,
224
+ resolveGraphStyle,
144
225
  resolveIssueTargetNodeId,
226
+ resolveStyleMenu,
227
+ roundedPolylinePath,
228
+ routeLabelCenter,
229
+ sentenceCase,
230
+ simpleDecisionSize,
231
+ simpleDefaultFolds,
232
+ simpleEdgeLabelSize,
233
+ simpleStepSize,
234
+ simpleTerminalSize,
235
+ simpleTitleWrap,
236
+ sortParentsFirst,
237
+ stripDomain,
145
238
  stuffDigestFromId,
146
239
  stuffNodeId,
240
+ textWidthPx,
147
241
  toolbarOrientation,
148
242
  toolbarSide,
149
243
  validateGraphSpec
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { b as GraphSpec, c as GraphNodeData, d as GraphEdge, e as GraphNode, f as GraphConfig, g as GraphDirection, F as FoldMode, h as GraphThemeMode, T as ToolbarPosition, G as GraphTheme, i as PipeStatus, j as GraphSpecNodeIoItem, k as ValidationState, V as ValidationIssue, L as LabelDescriptor, l as PipeControllerType, m as FoldToggleOptions, N as NodeValidationSummary, n as NodePipeType, o as GraphSpecMode, C as ConceptInfo, p as GraphSpecNode } from '../../types-BaFWy56P.js';
4
- export { q as PipeOperatorType } from '../../types-BaFWy56P.js';
3
+ import { b as GraphSpec, c as GraphNodeData, d as GraphEdge, e as GraphNode, f as GraphConfig, g as GraphDirection, F as FoldMode, h as GraphThemeMode, T as ToolbarPosition, i as GraphStyleId, G as GraphTheme, j as PipeStatus, k as GraphSpecNodeIoItem, l as ValidationState, V as ValidationIssue, L as LabelDescriptor, m as PipeControllerType, n as FoldToggleOptions, N as NodeValidationSummary, o as NodePipeType, p as GraphSpecMode, C as ConceptInfo, q as GraphSpecNode } from '../../types-BNqjYF_x.js';
4
+ export { r as PipeOperatorType } from '../../types-BNqjYF_x.js';
5
5
  import { PipeIOContracts, OutputForm, InputForm, SaveFiles } from '@pipelex/mthds-form';
6
6
  import { ResolveUrl, ResolveShareUrl, DownloadDisplay } from '@pipelex/mthds-form/react';
7
7
  import { Edge, Node, ReactFlowInstance } from '@xyflow/react';
@@ -98,6 +98,8 @@ declare function toAppNodes(nodes: GraphNode[]): AppNode[];
98
98
  * Domain-only fields (_batchEdge, _crossGroup) are dropped — they're only used
99
99
  * by pure graph logic (layout weight calculation), not by ReactFlow rendering.
100
100
  * The markerEnd cast is safe: our { type: "arrowclosed", color } satisfies EdgeMarker.
101
+ * A route the layout computed travels in `data.route`, where the routed edge
102
+ * component reads it (see `RoutedEdgeData`).
101
103
  */
102
104
  declare function toAppEdges(edges: GraphEdge[]): AppEdge[];
103
105
 
@@ -157,6 +159,28 @@ interface GraphViewerProps {
157
159
  * Precedence: this prop → `config.toolbarPosition` → `"top-right"`.
158
160
  */
159
161
  toolbarPosition?: ToolbarPosition;
162
+ /**
163
+ * The style the graph is drawn in: `detailed` (every pipe with its inputs,
164
+ * outputs and settings) or `simple` (the method's steps in plain words).
165
+ * Reactive, like `theme`: passing it drives the active style, and clearing it
166
+ * back to `undefined` hands control to `config.graphStyle`, then the default
167
+ * `detailed`. The toolbar's style menu, when shown, changes it too. A value
168
+ * naming no registered style is treated as unset. This library persists
169
+ * nothing: the host keeps the choice, reported by `onGraphStyleChange`.
170
+ */
171
+ graphStyle?: GraphStyleId;
172
+ /**
173
+ * Called whenever the style changes — from the menu, or from a prop or config
174
+ * update — so the host can persist it. Not called on mount.
175
+ */
176
+ onGraphStyleChange?: (style: GraphStyleId) => void;
177
+ /**
178
+ * Show a style menu in the toolbar. Opt-in: `true` offers every registered
179
+ * style in registry order, a list offers those styles in that order, and the
180
+ * default offers no menu, for a host that fixes the style for its audience.
181
+ * A menu needs two styles to choose between.
182
+ */
183
+ styleMenu?: boolean | readonly GraphStyleId[];
160
184
  /**
161
185
  * Host-injected environment theme, authoritative when set. Forwarded to the
162
186
  * `system` resolver so non-browser hosts (e.g. VS Code webviews, where