@pipelex/mthds-ui 0.8.0 → 0.10.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.
@@ -313,16 +313,86 @@ declare const FOLD_MODE: {
313
313
  readonly AUTO: "auto";
314
314
  };
315
315
  type FoldMode = (typeof FOLD_MODE)[keyof typeof FOLD_MODE];
316
+ /**
317
+ * The *resolved* binary theme — the value that actually drives the palette and
318
+ * the container class. `getPaletteForTheme` takes this. `system` is never a
319
+ * resolved theme; it resolves to one of these via the environment.
320
+ */
316
321
  declare const GRAPH_THEME: {
317
322
  readonly DARK: "dark";
318
323
  readonly LIGHT: "light";
319
324
  };
320
325
  type GraphTheme = (typeof GRAPH_THEME)[keyof typeof GRAPH_THEME];
326
+ /**
327
+ * The user's theme *selection* — what the toolbar cycles, what gets persisted
328
+ * and reported. `system` follows the host environment (browser `prefers-color-scheme`
329
+ * or an injected `systemTheme`) and resolves to a binary `GraphTheme` at render
330
+ * time. The `dark`/`light` overlap with `GraphTheme` is intentional: a resolved
331
+ * theme is also a valid mode.
332
+ */
333
+ declare const GRAPH_THEME_MODE: {
334
+ readonly DARK: "dark";
335
+ readonly LIGHT: "light";
336
+ readonly SYSTEM: "system";
337
+ };
338
+ type GraphThemeMode = (typeof GRAPH_THEME_MODE)[keyof typeof GRAPH_THEME_MODE];
339
+ /**
340
+ * Anchor for the built-in floating toolbar. The values match ReactFlow's
341
+ * `PanelPosition` union exactly, so they pass straight to `<Panel position=…>`
342
+ * (the React layer asserts that subset relationship at compile time). Orientation
343
+ * is *derived* from the position, never configured independently — see
344
+ * `toolbarOrientation`: only the two edge-center anchors are vertical, everything
345
+ * else (corners + top/bottom-center) is a horizontal bar.
346
+ *
347
+ * `types.ts` stays React-free, so `PanelPosition` is intentionally NOT imported
348
+ * here — the compatibility assertion lives in `GraphToolbar.tsx`.
349
+ */
350
+ declare const TOOLBAR_POSITION: {
351
+ readonly TOP_LEFT: "top-left";
352
+ readonly TOP_CENTER: "top-center";
353
+ readonly TOP_RIGHT: "top-right";
354
+ readonly BOTTOM_LEFT: "bottom-left";
355
+ readonly BOTTOM_CENTER: "bottom-center";
356
+ readonly BOTTOM_RIGHT: "bottom-right";
357
+ readonly CENTER_LEFT: "center-left";
358
+ readonly CENTER_RIGHT: "center-right";
359
+ };
360
+ type ToolbarPosition = (typeof TOOLBAR_POSITION)[keyof typeof TOOLBAR_POSITION];
361
+ type ToolbarOrientation = "horizontal" | "vertical";
362
+ /**
363
+ * Derive the bar orientation from its anchor. "Corners are horizontal, edges
364
+ * decide the rest": only `center-left` / `center-right` produce a vertical bar;
365
+ * every other position (the four corners plus `top-center` / `bottom-center`) is
366
+ * horizontal. Pure + React-free so it is unit-testable without rendering.
367
+ */
368
+ declare function toolbarOrientation(position: ToolbarPosition): ToolbarOrientation;
369
+ type ToolbarSide = "left" | "center" | "right";
370
+ /**
371
+ * Derive which edge the anchor hugs. The built-in `DetailPanel` overlays the
372
+ * right edge, so only right-side anchors (`*-right`) need to dodge it — the
373
+ * toolbar reads this to decide whether to shift left while the panel is open.
374
+ * Pure + React-free so it is unit-testable without rendering, and exhaustively
375
+ * switched so adding a `TOOLBAR_POSITION` value without a side fails to compile
376
+ * — exactly like {@link toolbarOrientation}.
377
+ */
378
+ declare function toolbarSide(position: ToolbarPosition): ToolbarSide;
321
379
  interface GraphConfig {
322
380
  direction?: GraphDirection;
323
381
  showControllers?: boolean;
324
382
  foldMode?: FoldMode;
325
- theme?: GraphTheme;
383
+ /**
384
+ * Theme *mode*: `dark | light | system`. `system` follows the host environment.
385
+ * Defaults to `system` (see `DEFAULT_GRAPH_CONFIG`). Pass `dark`/`light` to pin
386
+ * a fixed appearance.
387
+ */
388
+ theme?: GraphThemeMode;
389
+ /**
390
+ * Anchor for the built-in floating toolbar (default `top-right`). Orientation
391
+ * is derived from the position — see {@link toolbarOrientation}. The
392
+ * `toolbarPosition` *prop* on `GraphViewer` takes precedence over this; both
393
+ * are reactive and persistence is the host's responsibility.
394
+ */
395
+ toolbarPosition?: ToolbarPosition;
326
396
  nodesep?: number;
327
397
  ranksep?: number;
328
398
  edgeType?: EdgeType;
@@ -431,4 +501,4 @@ declare const ARROW_CLOSED_MARKER = "arrowclosed";
431
501
  declare function nodeWidth(n: GraphNode): number;
432
502
  declare function nodeHeight(n: GraphNode): number;
433
503
 
434
- export { type PipeParallelBlueprint as $, ARROW_CLOSED_MARKER as A, type GraphSpecEdgeKind as B, type ConceptInfo as C, type DataflowAnalysis as D, EDGE_TYPE as E, type FoldMode as F, type GraphNodeData as G, type GraphSpecNodeError as H, type GraphSpecNodeIo as I, type GraphSpecNodeTiming as J, KNOWN_PIPE_TYPES as K, type LabelDescriptor as L, NODE_TYPE_PIPE_CARD as M, NODE_TYPE_CONTROLLER as N, NODE_TYPE_STUFF as O, type PipeStatus as P, type NodeKind as Q, type PipeBatchBlueprint as R, type PipeBlueprintBase as S, type PipeComposeBlueprint as T, type PipeComposeConstructBlueprint as U, type PipeComposeConstructField as V, type PipeConditionBlueprint as W, type PipeExtractBlueprint as X, type PipeFuncBlueprint as Y, type PipeImgGenBlueprint as Z, type PipeLLMBlueprint as _, type GraphEdge as a, type PipeSearchBlueprint as a0, type PipeSequenceBlueprint as a1, type PipeSignatureBlueprint as a2, STUFF_ID_PREFIX as a3, type StuffRole as a4, type StuffSpecInfo as a5, type SubPipeSpec as a6, type TemplateBlueprint as a7, isStuffNodeId as a8, nodeHeight as a9, nodeWidth as aa, stuffDigestFromId as ab, stuffNodeId as ac, type GraphNode as b, type GraphSpec as c, type GraphConfig as d, type GraphDirection as e, type GraphTheme as f, type PipeControllerType as g, type FoldToggleOptions as h, type PipeType as i, type GraphSpecNode as j, type GraphSpecNodeIoItem as k, type PipeOperatorType as l, type PipeCallNode as m, type PipeBlueprintUnion as n, type GraphData as o, type PipeCardPayload as p, type LayoutConfig as q, CONTROLLER_PADDING_BOTTOM as r, CONTROLLER_PADDING_TOP as s, CONTROLLER_PADDING_X as t, type EdgeType as u, FOLD_MODE as v, type FieldResolution as w, GRAPH_DIRECTION as x, GRAPH_THEME as y, type GraphSpecEdge as z };
504
+ export { type PipeFuncBlueprint as $, ARROW_CLOSED_MARKER as A, GRAPH_THEME_MODE as B, type ConceptInfo as C, type DataflowAnalysis as D, EDGE_TYPE as E, type FoldMode as F, type GraphNodeData as G, type GraphSpecEdge as H, type GraphSpecEdgeKind as I, type GraphSpecNodeError as J, type GraphSpecNodeIo as K, type LabelDescriptor as L, type GraphSpecNodeTiming as M, KNOWN_PIPE_TYPES as N, NODE_TYPE_CONTROLLER as O, type PipeStatus as P, NODE_TYPE_PIPE_CARD as Q, NODE_TYPE_STUFF as R, type NodeKind as S, type ToolbarPosition as T, type PipeBatchBlueprint as U, type PipeBlueprintBase as V, type PipeComposeBlueprint as W, type PipeComposeConstructBlueprint as X, type PipeComposeConstructField as Y, type PipeConditionBlueprint as Z, type PipeExtractBlueprint as _, type GraphEdge as a, type PipeImgGenBlueprint as a0, type PipeLLMBlueprint as a1, type PipeParallelBlueprint as a2, type PipeSearchBlueprint as a3, type PipeSequenceBlueprint as a4, type PipeSignatureBlueprint as a5, STUFF_ID_PREFIX as a6, type StuffRole as a7, type StuffSpecInfo as a8, type SubPipeSpec as a9, TOOLBAR_POSITION as aa, type TemplateBlueprint as ab, type ToolbarOrientation as ac, type ToolbarSide as ad, isStuffNodeId as ae, nodeHeight as af, nodeWidth as ag, stuffDigestFromId as ah, stuffNodeId as ai, toolbarOrientation as aj, toolbarSide as ak, type GraphNode as b, type GraphSpec as c, type GraphConfig as d, type GraphDirection as e, type GraphThemeMode as f, type GraphTheme as g, type PipeControllerType as h, type FoldToggleOptions as i, type PipeType as j, type GraphSpecNode as k, type GraphSpecNodeIoItem as l, type PipeOperatorType as m, type PipeCallNode as n, type PipeBlueprintUnion as o, type GraphData as p, type PipeCardPayload as q, type LayoutConfig as r, CONTROLLER_PADDING_BOTTOM as s, CONTROLLER_PADDING_TOP as t, CONTROLLER_PADDING_X as u, type EdgeType as v, FOLD_MODE as w, type FieldResolution as x, GRAPH_DIRECTION as y, GRAPH_THEME as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipelex/mthds-ui",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Shared graph rendering logic for MTHDS method visualization",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "**/*.css"
16
16
  ],
17
17
  "engines": {
18
- "node": ">=18"
18
+ "node": ">=22"
19
19
  },
20
20
  "main": "./dist/index.js",
21
21
  "types": "./dist/index.d.ts",