@pipelex/mthds-ui 0.16.0 → 0.18.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 +38 -4
- package/dist/chunk-2N65P32H.js +17 -0
- package/dist/chunk-2N65P32H.js.map +1 -0
- package/dist/{chunk-UDA2XA23.js → chunk-BFQHQQ3E.js} +95 -189
- package/dist/chunk-BFQHQQ3E.js.map +1 -0
- package/dist/chunk-HASMGCVK.js +195 -0
- package/dist/chunk-HASMGCVK.js.map +1 -0
- package/dist/{chunk-HURB2U53.js → chunk-RJVEDP7M.js} +2 -16
- package/dist/chunk-RJVEDP7M.js.map +1 -0
- package/dist/form/react/RunPanel.css +131 -0
- package/dist/form/react/index.d.ts +188 -0
- package/dist/form/react/index.js +265 -0
- package/dist/form/react/index.js.map +1 -0
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +13 -9
- package/dist/graph/react/detail/DetailPanel.css +65 -0
- package/dist/graph/react/index.css +46 -0
- package/dist/graph/react/index.css.map +1 -1
- package/dist/graph/react/index.d.ts +2 -2
- package/dist/graph/react/index.js +608 -373
- package/dist/graph/react/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -9
- package/dist/shiki/index.js +8 -2
- package/dist/shiki/index.js.map +1 -1
- package/dist/standalone/graph-standalone.html +75 -10
- package/dist/standalone/graph-viewer.css +65 -0
- package/dist/standalone/graph-viewer.js +10 -10
- package/dist/static-graph/index.d.ts +4 -2
- package/dist/static-graph/index.js +64 -21
- package/dist/static-graph/index.js.map +1 -1
- package/dist/{types-DM_Ws3oW.d.ts → types-Cv5Elty8.d.ts} +101 -1
- package/package.json +12 -1
- package/dist/chunk-HURB2U53.js.map +0 -1
- package/dist/chunk-UDA2XA23.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,10 +14,11 @@ Released versions are listed on the [npm page](https://www.npmjs.com/package/@pi
|
|
|
14
14
|
|
|
15
15
|
### Peer dependencies
|
|
16
16
|
|
|
17
|
-
| Dependency
|
|
18
|
-
|
|
|
19
|
-
| `react`, `react-dom`
|
|
20
|
-
| `shiki`
|
|
17
|
+
| Dependency | Required | Used by |
|
|
18
|
+
| --------------------- | -------- | ----------------------------------------- |
|
|
19
|
+
| `react`, `react-dom` | no | React layer (`graph/react`, `form/react`) |
|
|
20
|
+
| `shiki` | no | Syntax highlighting (`shiki`) |
|
|
21
|
+
| `@pipelex/mthds-form` | no | Run form panel (`form/react`) |
|
|
21
22
|
|
|
22
23
|
### Bundled dependencies
|
|
23
24
|
|
|
@@ -271,6 +272,7 @@ See `graphConfig.ts` for the full default palette.
|
|
|
271
272
|
| ------------------------------- | ------------------------------------------------------------------ |
|
|
272
273
|
| `@pipelex/mthds-ui` | Pure-TS graph logic — types, builders, layout, controllers, config |
|
|
273
274
|
| `@pipelex/mthds-ui/graph/react` | React components — `GraphViewer`, label helpers, type converters |
|
|
275
|
+
| `@pipelex/mthds-ui/form/react` | `RunPanel` — a pipe's input form (needs `@pipelex/mthds-form`) |
|
|
274
276
|
| `@pipelex/mthds-ui/shiki` | MTHDS syntax highlighting with shiki |
|
|
275
277
|
|
|
276
278
|
## Pure TypeScript usage
|
|
@@ -295,6 +297,38 @@ const { nodes, edges } = getLayoutedElements(graphData.nodes, graphData.edges, "
|
|
|
295
297
|
const final = applyControllers(nodes, edges, graphspec, analysis, true);
|
|
296
298
|
```
|
|
297
299
|
|
|
300
|
+
## Run form panel
|
|
301
|
+
|
|
302
|
+
`RunPanel` renders a pipe's input form from its IO contract: the fields, the readiness verdict on the Run button, and the wire-ready payload a run receives.
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
npm install @pipelex/mthds-form # optional peer — graph-only consumers skip it
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
import { getPipeIOContract } from "@pipelex/mthds-form";
|
|
310
|
+
import { RunPanel } from "@pipelex/mthds-ui/form/react";
|
|
311
|
+
import "@pipelex/mthds-ui/form/react/RunPanel.css";
|
|
312
|
+
|
|
313
|
+
// Note the argument order — the kernel's README currently shows it wrong.
|
|
314
|
+
const contract = getPipeIOContract(pipeIoContracts, domain, pipeCode);
|
|
315
|
+
|
|
316
|
+
<RunPanel
|
|
317
|
+
contract={contract}
|
|
318
|
+
values={values}
|
|
319
|
+
onValuesChange={setValues}
|
|
320
|
+
onRun={(apiInputs) => execute(pipeCode, apiInputs)}
|
|
321
|
+
title={pipeCode}
|
|
322
|
+
theme="dark"
|
|
323
|
+
/>;
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
`onRun` fires only once the kernel's run gate passes. This library renders and never executes: no API client, no upload, no storage resolution — the host injects all three.
|
|
327
|
+
|
|
328
|
+
The controls are the kernel's, styled with Tailwind over shadcn tokens, so **bringing in their styling is the host's lane** — either add `./node_modules/@pipelex/mthds-form/dist/**/*.js` to your Tailwind `content` globs, or import the prebuilt `@pipelex/mthds-form/theme.css` + `styles.css`. Pick one; they are mutually exclusive, and a Tailwind host that forgets the glob gets a _mostly_-styled form that reads like a broken design system.
|
|
329
|
+
|
|
330
|
+
Full contract, the styling trap, the `.dark` bridge and the `mthds-run-panel` token hook: [docs/run-form-panel.md](./docs/run-form-panel.md).
|
|
331
|
+
|
|
298
332
|
## Shiki integration
|
|
299
333
|
|
|
300
334
|
Syntax-highlight MTHDS code with the bundled grammar and themes:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/graph/pipeRefs.ts
|
|
2
|
+
function parsePipeRef(raw) {
|
|
3
|
+
if (raw.includes("->")) return null;
|
|
4
|
+
if (raw === "" || raw.startsWith(".") || raw.endsWith(".") || raw.includes("..")) return null;
|
|
5
|
+
const dot = raw.lastIndexOf(".");
|
|
6
|
+
if (dot === -1) return { domainPath: null, pipeCode: raw };
|
|
7
|
+
return { domainPath: raw.slice(0, dot), pipeCode: raw.slice(dot + 1) };
|
|
8
|
+
}
|
|
9
|
+
function makePipeRef(domainCode, pipeCode) {
|
|
10
|
+
return `${domainCode}.${pipeCode}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
parsePipeRef,
|
|
15
|
+
makePipeRef
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-2N65P32H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/pipeRefs.ts"],"sourcesContent":["// Pipe-ref helpers — the presentation-side mirror of pipelex's `QualifiedRef`\n// (`pipelex/core/qualified_ref.py`). A pipe ref is `domain_code.pipe_code`\n// (the domain path may be multi-segment: `legal.contracts.compute_score`);\n// parsing splits on the LAST dot. Hosts must use these helpers instead of\n// re-implementing the split, so every consumer agrees with the runtime on\n// what a ref means.\n\n/** A parsed pipe ref: the (possibly multi-segment) domain path and the bare code. */\nexport interface ParsedPipeRef {\n /** Dotted domain path (`scoring`, `legal.contracts`), or null for a bare ref. */\n domainPath: string | null;\n /** The bare pipe code (`compute_score`). */\n pipeCode: string;\n}\n\n/**\n * Parse a pipe ref with `QualifiedRef.parse` semantics: split on the last dot,\n * reject malformed forms (empty, leading/trailing dot, consecutive dots) by\n * returning `null` instead of throwing. Cross-package refs (`alias->…`) are\n * opaque in the presentation chain for now and also return `null` — an issue\n * about one stays untargetable rather than mis-resolved.\n */\nexport function parsePipeRef(raw: string): ParsedPipeRef | null {\n if (raw.includes(\"->\")) return null;\n if (raw === \"\" || raw.startsWith(\".\") || raw.endsWith(\".\") || raw.includes(\"..\")) return null;\n const dot = raw.lastIndexOf(\".\");\n if (dot === -1) return { domainPath: null, pipeCode: raw };\n return { domainPath: raw.slice(0, dot), pipeCode: raw.slice(dot + 1) };\n}\n\n/** Render a fully-qualified pipe ref (`QualifiedRef.full_ref`): `domain_code.pipe_code`. */\nexport function makePipeRef(domainCode: string, pipeCode: string): string {\n return `${domainCode}.${pipeCode}`;\n}\n"],"mappings":";AAsBO,SAAS,aAAa,KAAmC;AAC9D,MAAI,IAAI,SAAS,IAAI,EAAG,QAAO;AAC/B,MAAI,QAAQ,MAAM,IAAI,WAAW,GAAG,KAAK,IAAI,SAAS,GAAG,KAAK,IAAI,SAAS,IAAI,EAAG,QAAO;AACzF,QAAM,MAAM,IAAI,YAAY,GAAG;AAC/B,MAAI,QAAQ,GAAI,QAAO,EAAE,YAAY,MAAM,UAAU,IAAI;AACzD,SAAO,EAAE,YAAY,IAAI,MAAM,GAAG,GAAG,GAAG,UAAU,IAAI,MAAM,MAAM,CAAC,EAAE;AACvE;AAGO,SAAS,YAAY,YAAoB,UAA0B;AACxE,SAAO,GAAG,UAAU,IAAI,QAAQ;AAClC;","names":[]}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makePipeRef
|
|
3
|
+
} from "./chunk-2N65P32H.js";
|
|
1
4
|
import {
|
|
2
5
|
ARROW_CLOSED_MARKER,
|
|
3
6
|
CONTROLLER_PADDING_BOTTOM,
|
|
4
7
|
CONTROLLER_PADDING_TOP,
|
|
5
8
|
CONTROLLER_PADDING_X,
|
|
6
|
-
EDGE_TYPE,
|
|
7
|
-
FOLD_MODE,
|
|
8
|
-
GRAPH_THEME,
|
|
9
|
-
GRAPH_THEME_MODE,
|
|
10
9
|
KNOWN_PIPE_TYPES,
|
|
11
10
|
NODE_TYPE_CONTROLLER,
|
|
12
11
|
NODE_TYPE_PIPE_CARD,
|
|
13
12
|
NODE_TYPE_STUFF,
|
|
14
|
-
TOOLBAR_POSITION,
|
|
15
13
|
graphSpecMode,
|
|
16
14
|
isStuffNodeId,
|
|
17
|
-
makePipeRef,
|
|
18
15
|
nodeHeight,
|
|
19
16
|
nodeWidth,
|
|
20
17
|
stuffDigestFromId,
|
|
21
18
|
stuffNodeId
|
|
22
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RJVEDP7M.js";
|
|
23
20
|
import {
|
|
24
21
|
__objRest,
|
|
25
22
|
__spreadProps,
|
|
@@ -77,6 +74,81 @@ function validateIoItem(item, path) {
|
|
|
77
74
|
}
|
|
78
75
|
requireNonEmptyString(item.name, `${path}.name`);
|
|
79
76
|
}
|
|
77
|
+
function requireNumber(value, path) {
|
|
78
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
79
|
+
fail(path, `expected a finite number, got ${describe(value)}`);
|
|
80
|
+
}
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
function requireNullableNumber(value, path) {
|
|
84
|
+
if (value === null) return;
|
|
85
|
+
requireNumber(value, path);
|
|
86
|
+
}
|
|
87
|
+
function normalizeNullableNumber(value, path) {
|
|
88
|
+
if (value === void 0 || value === null) return null;
|
|
89
|
+
return requireNumber(value, path);
|
|
90
|
+
}
|
|
91
|
+
function requireNumberRecord(value, path) {
|
|
92
|
+
if (!isPlainObject(value)) {
|
|
93
|
+
fail(path, `expected an object, got ${describe(value)}`);
|
|
94
|
+
}
|
|
95
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
96
|
+
requireNumber(entry, `${path}.${key}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function validateUsage(usage, path) {
|
|
100
|
+
if (!isPlainObject(usage)) {
|
|
101
|
+
fail(path, `expected an object, got ${describe(usage)}`);
|
|
102
|
+
}
|
|
103
|
+
requireNumber(usage.inference_calls, `${path}.inference_calls`);
|
|
104
|
+
requireNumber(usage.rated_inference_calls, `${path}.rated_inference_calls`);
|
|
105
|
+
requireNumberRecord(usage.nb_tokens_by_category, `${path}.nb_tokens_by_category`);
|
|
106
|
+
requireNumber(usage.total_tokens, `${path}.total_tokens`);
|
|
107
|
+
requireNullableNumber(usage.cost, `${path}.cost`);
|
|
108
|
+
usage.cost_input = normalizeNullableNumber(usage.cost_input, `${path}.cost_input`);
|
|
109
|
+
usage.cost_output = normalizeNullableNumber(usage.cost_output, `${path}.cost_output`);
|
|
110
|
+
requireNumber(usage.subtree_inference_calls, `${path}.subtree_inference_calls`);
|
|
111
|
+
requireNumber(usage.subtree_rated_inference_calls, `${path}.subtree_rated_inference_calls`);
|
|
112
|
+
requireNumberRecord(usage.subtree_nb_tokens_by_category, `${path}.subtree_nb_tokens_by_category`);
|
|
113
|
+
requireNumber(usage.subtree_total_tokens, `${path}.subtree_total_tokens`);
|
|
114
|
+
requireNullableNumber(usage.subtree_cost, `${path}.subtree_cost`);
|
|
115
|
+
usage.subtree_cost_input = normalizeNullableNumber(
|
|
116
|
+
usage.subtree_cost_input,
|
|
117
|
+
`${path}.subtree_cost_input`
|
|
118
|
+
);
|
|
119
|
+
usage.subtree_cost_output = normalizeNullableNumber(
|
|
120
|
+
usage.subtree_cost_output,
|
|
121
|
+
`${path}.subtree_cost_output`
|
|
122
|
+
);
|
|
123
|
+
usage.by_model = normalizeModelUsageList(usage.by_model, `${path}.by_model`);
|
|
124
|
+
usage.subtree_by_model = normalizeModelUsageList(
|
|
125
|
+
usage.subtree_by_model,
|
|
126
|
+
`${path}.subtree_by_model`
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function normalizeModelUsageList(value, path) {
|
|
130
|
+
if (value === void 0) return [];
|
|
131
|
+
if (!Array.isArray(value)) {
|
|
132
|
+
fail(path, `expected an array when present, got ${describe(value)}`);
|
|
133
|
+
}
|
|
134
|
+
value.forEach((entry, index) => {
|
|
135
|
+
const entryPath = `${path}[${index}]`;
|
|
136
|
+
if (!isPlainObject(entry)) {
|
|
137
|
+
fail(entryPath, `expected an object, got ${describe(entry)}`);
|
|
138
|
+
}
|
|
139
|
+
requireNonEmptyString(entry.inference_model_name, `${entryPath}.inference_model_name`);
|
|
140
|
+
requireNonEmptyString(entry.inference_model_id, `${entryPath}.inference_model_id`);
|
|
141
|
+
if (entry.model_type === void 0) {
|
|
142
|
+
entry.model_type = "unknown";
|
|
143
|
+
} else {
|
|
144
|
+
requireNonEmptyString(entry.model_type, `${entryPath}.model_type`);
|
|
145
|
+
}
|
|
146
|
+
requireNumber(entry.inference_calls, `${entryPath}.inference_calls`);
|
|
147
|
+
requireNumber(entry.rated_inference_calls, `${entryPath}.rated_inference_calls`);
|
|
148
|
+
requireNullableNumber(entry.cost, `${entryPath}.cost`);
|
|
149
|
+
});
|
|
150
|
+
return value;
|
|
151
|
+
}
|
|
80
152
|
function validateNode(node, path) {
|
|
81
153
|
if (!isPlainObject(node)) {
|
|
82
154
|
fail(path, `expected an object, got ${describe(node)}`);
|
|
@@ -124,6 +196,11 @@ function validateNode(node, path) {
|
|
|
124
196
|
}
|
|
125
197
|
io.inputs.forEach((item, j) => validateIoItem(item, `${path}.io.inputs[${j}]`));
|
|
126
198
|
io.outputs.forEach((item, j) => validateIoItem(item, `${path}.io.outputs[${j}]`));
|
|
199
|
+
if (node.usage === null) {
|
|
200
|
+
delete node.usage;
|
|
201
|
+
} else if (node.usage !== void 0) {
|
|
202
|
+
validateUsage(node.usage, `${path}.usage`);
|
|
203
|
+
}
|
|
127
204
|
}
|
|
128
205
|
function validateEdge(edge, path) {
|
|
129
206
|
if (!isPlainObject(edge)) {
|
|
@@ -173,6 +250,15 @@ function validateGraphSpec(raw) {
|
|
|
173
250
|
`expected an object when present, got ${describe(raw.concept_registry)}`
|
|
174
251
|
);
|
|
175
252
|
}
|
|
253
|
+
if (raw.usage === null) {
|
|
254
|
+
delete raw.usage;
|
|
255
|
+
} else if (raw.usage !== void 0) {
|
|
256
|
+
if (!isPlainObject(raw.usage)) {
|
|
257
|
+
fail("usage", `expected an object when present, got ${describe(raw.usage)}`);
|
|
258
|
+
}
|
|
259
|
+
validateUsage(raw.usage.total, "usage.total");
|
|
260
|
+
validateUsage(raw.usage.unattributed, "usage.unattributed");
|
|
261
|
+
}
|
|
176
262
|
raw.nodes.forEach((node, i) => validateNode(node, `nodes[${i}]`));
|
|
177
263
|
raw.edges.forEach((edge, i) => validateEdge(edge, `edges[${i}]`));
|
|
178
264
|
return raw;
|
|
@@ -1491,181 +1577,6 @@ function applyControllers(layoutedNodes, layoutedEdges, graphspec, analysis, sho
|
|
|
1491
1577
|
return { nodes: allNodes, edges: filteredEdges };
|
|
1492
1578
|
}
|
|
1493
1579
|
|
|
1494
|
-
// src/graph/graphConfig.ts
|
|
1495
|
-
var FONT_TOKENS = {
|
|
1496
|
-
"--font-sans": '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
1497
|
-
"--font-mono": '"JetBrains Mono", "Monaco", "Menlo", monospace'
|
|
1498
|
-
};
|
|
1499
|
-
var DARK_PALETTE_COLORS = __spreadProps(__spreadValues({}, FONT_TOKENS), {
|
|
1500
|
-
// Surfaces
|
|
1501
|
-
"--surface-page": "#0a0a0a",
|
|
1502
|
-
"--surface-panel": "#111118",
|
|
1503
|
-
"--surface-overlay": "rgba(17, 17, 24, 0.8)",
|
|
1504
|
-
"--surface-overlay-hover": "rgba(30, 30, 40, 0.9)",
|
|
1505
|
-
"--surface-overlay-disabled": "rgba(17, 17, 24, 0.6)",
|
|
1506
|
-
"--surface-elevated": "rgba(255, 255, 255, 0.06)",
|
|
1507
|
-
"--surface-elevated-hover": "rgba(255, 255, 255, 0.1)",
|
|
1508
|
-
"--surface-sunken": "rgba(255, 255, 255, 0.03)",
|
|
1509
|
-
"--surface-pill": "rgba(255, 255, 255, 0.06)",
|
|
1510
|
-
"--surface-pill-border": "rgba(255, 255, 255, 0.08)",
|
|
1511
|
-
// Borders
|
|
1512
|
-
"--border-subtle": "rgba(255, 255, 255, 0.06)",
|
|
1513
|
-
"--border-default": "rgba(255, 255, 255, 0.1)",
|
|
1514
|
-
"--border-strong": "rgba(255, 255, 255, 0.18)",
|
|
1515
|
-
"--border-dashed": "rgba(255, 255, 255, 0.15)",
|
|
1516
|
-
// Text
|
|
1517
|
-
"--text-primary": "#f8fafc",
|
|
1518
|
-
"--text-default": "#e2e8f0",
|
|
1519
|
-
"--text-secondary": "#cbd5e1",
|
|
1520
|
-
"--text-muted": "#94a3b8",
|
|
1521
|
-
"--text-dim": "#64748b",
|
|
1522
|
-
"--text-on-accent": "#0e0e0e",
|
|
1523
|
-
// Effects
|
|
1524
|
-
"--shadow-sm": "0 2px 8px rgba(0, 0, 0, 0.4)",
|
|
1525
|
-
"--shadow-md": "0 4px 16px rgba(0, 0, 0, 0.6)",
|
|
1526
|
-
"--shadow-lg": "0 8px 24px rgba(0, 0, 0, 0.5)",
|
|
1527
|
-
"--focus-ring": "rgba(59, 130, 246, 0.6)",
|
|
1528
|
-
// Domain-semantic colors (graph nodes/edges)
|
|
1529
|
-
"--color-pipe": "#ff6b6b",
|
|
1530
|
-
"--color-pipe-bg": "rgba(224,108,117,0.18)",
|
|
1531
|
-
"--color-pipe-text": "#ffffff",
|
|
1532
|
-
"--color-stuff": "#4ECDC4",
|
|
1533
|
-
"--color-stuff-bg": "rgba(78,205,196,0.12)",
|
|
1534
|
-
"--color-stuff-border": "#9ddcfd",
|
|
1535
|
-
"--color-stuff-text": "#98FB98",
|
|
1536
|
-
"--color-stuff-text-dim": "#9ddcfd",
|
|
1537
|
-
"--color-edge": "#FFFACD",
|
|
1538
|
-
"--color-batch-item": "#bd93f9",
|
|
1539
|
-
"--color-batch-aggregate": "#50fa7b",
|
|
1540
|
-
"--color-parallel-combine": "#d6a4ff",
|
|
1541
|
-
"--color-success": "#50FA7B",
|
|
1542
|
-
"--color-success-bg": "rgba(80,250,123,0.15)",
|
|
1543
|
-
"--color-error": "#FF5555",
|
|
1544
|
-
"--color-error-bg": "rgba(255,85,85,0.15)",
|
|
1545
|
-
"--color-error-border": "rgba(255,85,85,0.2)",
|
|
1546
|
-
"--color-accent": "#8BE9FD",
|
|
1547
|
-
"--color-accent-strong": "#3b82f6",
|
|
1548
|
-
"--color-warning": "#FFB86C",
|
|
1549
|
-
// Controller-group palette (tinted borders/backgrounds per controller type)
|
|
1550
|
-
"--ctrl-sequence-border": "rgba(148, 163, 184, 0.25)",
|
|
1551
|
-
"--ctrl-sequence-bg": "rgba(148, 163, 184, 0.03)",
|
|
1552
|
-
"--ctrl-sequence-text": "#94a3b8",
|
|
1553
|
-
"--ctrl-parallel-border": "rgba(139, 233, 253, 0.35)",
|
|
1554
|
-
"--ctrl-parallel-bg": "rgba(139, 233, 253, 0.03)",
|
|
1555
|
-
"--ctrl-parallel-text": "#8be9fd",
|
|
1556
|
-
"--ctrl-condition-border": "rgba(251, 191, 36, 0.35)",
|
|
1557
|
-
"--ctrl-condition-bg": "rgba(251, 191, 36, 0.03)",
|
|
1558
|
-
"--ctrl-condition-text": "#fbbf24",
|
|
1559
|
-
"--ctrl-batch-border": "rgba(167, 139, 250, 0.35)",
|
|
1560
|
-
"--ctrl-batch-bg": "rgba(167, 139, 250, 0.03)",
|
|
1561
|
-
"--ctrl-batch-text": "#a78bfa",
|
|
1562
|
-
"--ctrl-folded-bg": "rgba(148, 163, 184, 0.25)",
|
|
1563
|
-
"--ctrl-folded-border": "rgba(148, 163, 184, 0.4)",
|
|
1564
|
-
// Legacy aliases — kept so existing inline styles in graph builders keep
|
|
1565
|
-
// working until they're migrated. New code should use the semantic tokens.
|
|
1566
|
-
"--color-bg": "#0a0a0a",
|
|
1567
|
-
"--color-bg-dots": "rgba(255, 255, 255, 0.35)",
|
|
1568
|
-
"--color-text-muted": "#94a3b8",
|
|
1569
|
-
"--color-controller-text": "#94a3b8"
|
|
1570
|
-
});
|
|
1571
|
-
var LIGHT_PALETTE_COLORS = __spreadProps(__spreadValues({}, FONT_TOKENS), {
|
|
1572
|
-
// Surfaces — chart stays a soft off-white, panels slightly cooler
|
|
1573
|
-
"--surface-page": "#f8fafc",
|
|
1574
|
-
"--surface-panel": "#ffffff",
|
|
1575
|
-
"--surface-overlay": "rgba(255, 255, 255, 0.92)",
|
|
1576
|
-
"--surface-overlay-hover": "rgba(241, 245, 249, 0.96)",
|
|
1577
|
-
"--surface-overlay-disabled": "rgba(255, 255, 255, 0.7)",
|
|
1578
|
-
"--surface-elevated": "rgba(15, 23, 42, 0.05)",
|
|
1579
|
-
"--surface-elevated-hover": "rgba(15, 23, 42, 0.09)",
|
|
1580
|
-
"--surface-sunken": "rgba(15, 23, 42, 0.03)",
|
|
1581
|
-
"--surface-pill": "rgba(15, 23, 42, 0.05)",
|
|
1582
|
-
"--surface-pill-border": "rgba(15, 23, 42, 0.1)",
|
|
1583
|
-
// Borders
|
|
1584
|
-
"--border-subtle": "rgba(15, 23, 42, 0.08)",
|
|
1585
|
-
"--border-default": "rgba(15, 23, 42, 0.12)",
|
|
1586
|
-
"--border-strong": "rgba(15, 23, 42, 0.22)",
|
|
1587
|
-
"--border-dashed": "rgba(15, 23, 42, 0.18)",
|
|
1588
|
-
// Text
|
|
1589
|
-
"--text-primary": "#020617",
|
|
1590
|
-
"--text-default": "#0f172a",
|
|
1591
|
-
"--text-secondary": "#1e293b",
|
|
1592
|
-
"--text-muted": "#475569",
|
|
1593
|
-
"--text-dim": "#64748b",
|
|
1594
|
-
"--text-on-accent": "#ffffff",
|
|
1595
|
-
// Effects
|
|
1596
|
-
"--shadow-sm": "0 2px 8px rgba(15, 23, 42, 0.08)",
|
|
1597
|
-
"--shadow-md": "0 4px 16px rgba(15, 23, 42, 0.14)",
|
|
1598
|
-
"--shadow-lg": "0 8px 24px rgba(15, 23, 42, 0.15)",
|
|
1599
|
-
"--focus-ring": "rgba(2, 132, 199, 0.5)",
|
|
1600
|
-
// Domain-semantic colors — darker for contrast on light backgrounds
|
|
1601
|
-
"--color-pipe": "#dc2626",
|
|
1602
|
-
"--color-pipe-bg": "rgba(220, 38, 38, 0.1)",
|
|
1603
|
-
"--color-pipe-text": "#ffffff",
|
|
1604
|
-
"--color-stuff": "#0891b2",
|
|
1605
|
-
"--color-stuff-bg": "rgba(8, 145, 178, 0.08)",
|
|
1606
|
-
"--color-stuff-border": "#0e7490",
|
|
1607
|
-
"--color-stuff-text": "#0f172a",
|
|
1608
|
-
"--color-stuff-text-dim": "#475569",
|
|
1609
|
-
"--color-edge": "#64748b",
|
|
1610
|
-
"--color-batch-item": "#7c3aed",
|
|
1611
|
-
"--color-batch-aggregate": "#15803d",
|
|
1612
|
-
"--color-parallel-combine": "#6d28d9",
|
|
1613
|
-
"--color-success": "#15803d",
|
|
1614
|
-
"--color-success-bg": "rgba(21, 128, 61, 0.12)",
|
|
1615
|
-
"--color-error": "#dc2626",
|
|
1616
|
-
"--color-error-bg": "rgba(220, 38, 38, 0.1)",
|
|
1617
|
-
"--color-error-border": "rgba(220, 38, 38, 0.25)",
|
|
1618
|
-
"--color-accent": "#0284c7",
|
|
1619
|
-
"--color-accent-strong": "#0284c7",
|
|
1620
|
-
"--color-warning": "#d97706",
|
|
1621
|
-
// Controller-group palette
|
|
1622
|
-
"--ctrl-sequence-border": "rgba(71, 85, 105, 0.3)",
|
|
1623
|
-
"--ctrl-sequence-bg": "rgba(71, 85, 105, 0.04)",
|
|
1624
|
-
"--ctrl-sequence-text": "#475569",
|
|
1625
|
-
"--ctrl-parallel-border": "rgba(8, 145, 178, 0.4)",
|
|
1626
|
-
"--ctrl-parallel-bg": "rgba(8, 145, 178, 0.05)",
|
|
1627
|
-
"--ctrl-parallel-text": "#0e7490",
|
|
1628
|
-
"--ctrl-condition-border": "rgba(217, 119, 6, 0.4)",
|
|
1629
|
-
"--ctrl-condition-bg": "rgba(217, 119, 6, 0.05)",
|
|
1630
|
-
"--ctrl-condition-text": "#b45309",
|
|
1631
|
-
"--ctrl-batch-border": "rgba(124, 58, 237, 0.4)",
|
|
1632
|
-
"--ctrl-batch-bg": "rgba(124, 58, 237, 0.05)",
|
|
1633
|
-
"--ctrl-batch-text": "#6d28d9",
|
|
1634
|
-
"--ctrl-folded-bg": "rgba(71, 85, 105, 0.18)",
|
|
1635
|
-
"--ctrl-folded-border": "rgba(71, 85, 105, 0.35)",
|
|
1636
|
-
// Legacy aliases
|
|
1637
|
-
"--color-bg": "#f8fafc",
|
|
1638
|
-
"--color-bg-dots": "rgba(15, 23, 42, 0.18)",
|
|
1639
|
-
"--color-text-muted": "#475569",
|
|
1640
|
-
"--color-controller-text": "#475569"
|
|
1641
|
-
});
|
|
1642
|
-
function getPaletteForTheme(theme) {
|
|
1643
|
-
return theme === GRAPH_THEME.LIGHT ? LIGHT_PALETTE_COLORS : DARK_PALETTE_COLORS;
|
|
1644
|
-
}
|
|
1645
|
-
var DEFAULT_GRAPH_CONFIG = {
|
|
1646
|
-
direction: "LR",
|
|
1647
|
-
showControllers: false,
|
|
1648
|
-
foldMode: FOLD_MODE.EXPANDED,
|
|
1649
|
-
// `system` follows the host environment (OS/browser, or editor theme) out of
|
|
1650
|
-
// the box — the least-surprising default for an embedded component. Hosts
|
|
1651
|
-
// that want a fixed appearance pass `theme: "dark"` / `"light"` explicitly.
|
|
1652
|
-
theme: GRAPH_THEME_MODE.SYSTEM,
|
|
1653
|
-
// Backward-compatible default: the toolbar stays pinned top-right unless the
|
|
1654
|
-
// host overrides it via `config.toolbarPosition` or the `toolbarPosition` prop.
|
|
1655
|
-
toolbarPosition: TOOLBAR_POSITION.TOP_RIGHT,
|
|
1656
|
-
nodesep: 50,
|
|
1657
|
-
ranksep: 100,
|
|
1658
|
-
edgeType: EDGE_TYPE.DEFAULT,
|
|
1659
|
-
initialZoom: null,
|
|
1660
|
-
panToTop: true
|
|
1661
|
-
// `paletteColors` intentionally omitted from the default. The viewer derives
|
|
1662
|
-
// the palette from the active `theme`. Consumers only set `paletteColors` to
|
|
1663
|
-
// override specific tokens (sparse merge on top of the theme palette).
|
|
1664
|
-
};
|
|
1665
|
-
function getPaletteColors() {
|
|
1666
|
-
return DARK_PALETTE_COLORS;
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
1580
|
export {
|
|
1670
1581
|
GraphSpecValidationError,
|
|
1671
1582
|
validateGraphSpec,
|
|
@@ -1693,11 +1604,6 @@ export {
|
|
|
1693
1604
|
getLayoutedElements,
|
|
1694
1605
|
MAX_VISIBLE_CONTROLLER_CHILDREN,
|
|
1695
1606
|
buildControllerNodes,
|
|
1696
|
-
applyControllers
|
|
1697
|
-
DARK_PALETTE_COLORS,
|
|
1698
|
-
LIGHT_PALETTE_COLORS,
|
|
1699
|
-
getPaletteForTheme,
|
|
1700
|
-
DEFAULT_GRAPH_CONFIG,
|
|
1701
|
-
getPaletteColors
|
|
1607
|
+
applyControllers
|
|
1702
1608
|
};
|
|
1703
|
-
//# sourceMappingURL=chunk-
|
|
1609
|
+
//# sourceMappingURL=chunk-BFQHQQ3E.js.map
|