@pipelex/mthds-ui 0.6.5 → 0.8.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/dist/{chunk-ILX53OYM.js → chunk-7VQUZ35P.js} +2 -1
- package/dist/chunk-7VQUZ35P.js.map +1 -0
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +1 -1
- package/dist/graph/react/detail/DetailPanel.css +64 -8
- package/dist/graph/react/graph-core.css +13 -0
- package/dist/graph/react/index.css +40 -8
- package/dist/graph/react/index.css.map +1 -1
- package/dist/graph/react/index.d.ts +11 -3
- package/dist/graph/react/index.js +239 -163
- package/dist/graph/react/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/shiki/index.d.ts +16 -3
- package/dist/shiki/index.js +226 -15
- package/dist/shiki/index.js.map +1 -1
- package/dist/standalone/graph-standalone.html +86 -17
- package/dist/standalone/graph-viewer.css +77 -8
- package/dist/standalone/graph-viewer.js +9 -9
- package/dist/{types-DJTrDxjV.d.ts → types-D7NALhbw.d.ts} +19 -3
- package/package.json +1 -1
- package/dist/chunk-ILX53OYM.js.map +0 -1
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveConceptRef,
|
|
17
17
|
stuffDigestFromId,
|
|
18
18
|
validateGraphSpec
|
|
19
|
-
} from "../../chunk-
|
|
19
|
+
} from "../../chunk-7VQUZ35P.js";
|
|
20
20
|
import {
|
|
21
21
|
__spreadProps,
|
|
22
22
|
__spreadValues
|
|
@@ -29,7 +29,7 @@ import "./stuff/StuffViewer.css";
|
|
|
29
29
|
import "./viewer/GraphToolbar.css";
|
|
30
30
|
|
|
31
31
|
// src/graph/react/viewer/GraphViewer.tsx
|
|
32
|
-
import
|
|
32
|
+
import React8 from "react";
|
|
33
33
|
import {
|
|
34
34
|
ReactFlow,
|
|
35
35
|
useNodesState,
|
|
@@ -496,8 +496,10 @@ function DetailPanel({
|
|
|
496
496
|
"aria-label": "Resize panel"
|
|
497
497
|
}
|
|
498
498
|
),
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
|
|
499
|
+
/* @__PURE__ */ jsxs2("div", { className: "detail-panel-content", children: [
|
|
500
|
+
/* @__PURE__ */ jsx2("div", { className: "detail-panel-close-row", children: /* @__PURE__ */ jsx2("button", { className: "detail-panel-close", onClick: onClose, "aria-label": "Close panel", children: "x" }) }),
|
|
501
|
+
children
|
|
502
|
+
] })
|
|
501
503
|
] });
|
|
502
504
|
}
|
|
503
505
|
|
|
@@ -1131,6 +1133,7 @@ var PIPE_TYPE_BADGES = {
|
|
|
1131
1133
|
PipeImgGen: "ImgGen",
|
|
1132
1134
|
PipeSearch: "Search",
|
|
1133
1135
|
PipeFunc: "Func",
|
|
1136
|
+
PipeSignature: "Signature",
|
|
1134
1137
|
PipeSequence: "Seq",
|
|
1135
1138
|
PipeParallel: "Par",
|
|
1136
1139
|
PipeCondition: "Cond",
|
|
@@ -1285,6 +1288,10 @@ function BlueprintSection({
|
|
|
1285
1288
|
return /* @__PURE__ */ jsx13(PipeBatchSection, { blueprint, executionData });
|
|
1286
1289
|
case "PipeFunc":
|
|
1287
1290
|
return null;
|
|
1291
|
+
case "PipeSignature":
|
|
1292
|
+
return /* @__PURE__ */ jsx13("div", { className: "detail-not-available", children: "Signature stub \u2014 declared but not yet implemented." });
|
|
1293
|
+
default:
|
|
1294
|
+
return null;
|
|
1288
1295
|
}
|
|
1289
1296
|
}
|
|
1290
1297
|
function ExecutionDataSection({
|
|
@@ -1324,6 +1331,7 @@ function GenericExecutionData({ data }) {
|
|
|
1324
1331
|
}
|
|
1325
1332
|
|
|
1326
1333
|
// src/graph/react/detail/ConceptDetailPanel.tsx
|
|
1334
|
+
import React6 from "react";
|
|
1327
1335
|
import { Fragment as Fragment10, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1328
1336
|
function ConceptDetailPanel({
|
|
1329
1337
|
concept,
|
|
@@ -1331,8 +1339,10 @@ function ConceptDetailPanel({
|
|
|
1331
1339
|
isDryRun,
|
|
1332
1340
|
resolveStorageUrl,
|
|
1333
1341
|
canEmbedPdf,
|
|
1334
|
-
onOpenExternally
|
|
1342
|
+
onOpenExternally,
|
|
1343
|
+
instanceKey
|
|
1335
1344
|
}) {
|
|
1345
|
+
var _a;
|
|
1336
1346
|
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
1337
1347
|
/* @__PURE__ */ jsxs14("div", { className: "detail-header", children: [
|
|
1338
1348
|
/* @__PURE__ */ jsx14("span", { className: "detail-concept-code", children: concept.code }),
|
|
@@ -1343,22 +1353,88 @@ function ConceptDetailPanel({
|
|
|
1343
1353
|
"refines ",
|
|
1344
1354
|
/* @__PURE__ */ jsx14("span", { className: "detail-refines-code", children: concept.refines })
|
|
1345
1355
|
] }),
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1356
|
+
/* @__PURE__ */ jsx14(
|
|
1357
|
+
ConceptBody,
|
|
1358
|
+
{
|
|
1359
|
+
concept,
|
|
1360
|
+
ioData,
|
|
1361
|
+
isDryRun,
|
|
1362
|
+
resolveStorageUrl,
|
|
1363
|
+
canEmbedPdf,
|
|
1364
|
+
onOpenExternally
|
|
1365
|
+
},
|
|
1366
|
+
instanceKey != null ? instanceKey : `${concept.code}:${ioData && "digest" in ioData ? ioData.digest : (_a = ioData == null ? void 0 : ioData.name) != null ? _a : ""}`
|
|
1367
|
+
)
|
|
1368
|
+
] });
|
|
1369
|
+
}
|
|
1370
|
+
function ConceptBody({
|
|
1371
|
+
concept,
|
|
1372
|
+
ioData,
|
|
1373
|
+
isDryRun,
|
|
1374
|
+
resolveStorageUrl,
|
|
1375
|
+
canEmbedPdf,
|
|
1376
|
+
onOpenExternally
|
|
1377
|
+
}) {
|
|
1378
|
+
const hasData = Boolean(ioData) && !isDryRun;
|
|
1379
|
+
const [activeTab, setActiveTab] = React6.useState(hasData ? "data" : "structure");
|
|
1380
|
+
const baseId = React6.useId();
|
|
1381
|
+
const tabId = (tab) => `${baseId}-tab-${tab}`;
|
|
1382
|
+
const panelId = (tab) => `${baseId}-tabpanel-${tab}`;
|
|
1383
|
+
const structure = concept.json_schema ? /* @__PURE__ */ jsxs14("div", { children: [
|
|
1384
|
+
/* @__PURE__ */ jsx14("div", { className: "detail-section-label", children: "Structure" }),
|
|
1385
|
+
/* @__PURE__ */ jsx14(SchemaTable, { schema: concept.json_schema, isDryRun })
|
|
1386
|
+
] }) : /* @__PURE__ */ jsx14("div", { className: "detail-not-available", children: "Schema not available" });
|
|
1387
|
+
if (!hasData) return structure;
|
|
1388
|
+
const onTabKeyDown = (event) => {
|
|
1389
|
+
var _a;
|
|
1390
|
+
let next;
|
|
1391
|
+
switch (event.key) {
|
|
1392
|
+
case "ArrowLeft":
|
|
1393
|
+
case "ArrowRight":
|
|
1394
|
+
next = activeTab === "data" ? "structure" : "data";
|
|
1395
|
+
break;
|
|
1396
|
+
case "Home":
|
|
1397
|
+
next = "data";
|
|
1398
|
+
break;
|
|
1399
|
+
case "End":
|
|
1400
|
+
next = "structure";
|
|
1401
|
+
break;
|
|
1402
|
+
default:
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
event.preventDefault();
|
|
1406
|
+
setActiveTab(next);
|
|
1407
|
+
(_a = document.getElementById(tabId(next))) == null ? void 0 : _a.focus();
|
|
1408
|
+
};
|
|
1409
|
+
const renderTab = (tab, label) => /* @__PURE__ */ jsx14(
|
|
1410
|
+
"button",
|
|
1411
|
+
{
|
|
1412
|
+
type: "button",
|
|
1413
|
+
role: "tab",
|
|
1414
|
+
id: tabId(tab),
|
|
1415
|
+
"aria-selected": activeTab === tab,
|
|
1416
|
+
"aria-controls": panelId(tab),
|
|
1417
|
+
tabIndex: activeTab === tab ? 0 : -1,
|
|
1418
|
+
className: `detail-tab ${activeTab === tab ? "detail-tab--active" : ""}`,
|
|
1419
|
+
onClick: () => setActiveTab(tab),
|
|
1420
|
+
onKeyDown: onTabKeyDown,
|
|
1421
|
+
children: label
|
|
1422
|
+
}
|
|
1423
|
+
);
|
|
1424
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
1425
|
+
/* @__PURE__ */ jsxs14("div", { className: "detail-tabs", role: "tablist", "aria-label": "Concept views", children: [
|
|
1426
|
+
renderTab("data", "Data"),
|
|
1427
|
+
renderTab("structure", "Structure")
|
|
1428
|
+
] }),
|
|
1429
|
+
/* @__PURE__ */ jsx14("div", { role: "tabpanel", id: panelId(activeTab), "aria-labelledby": tabId(activeTab), children: activeTab === "data" ? /* @__PURE__ */ jsx14(
|
|
1430
|
+
StuffViewer,
|
|
1431
|
+
{
|
|
1432
|
+
stuff: toStuffViewerData(ioData),
|
|
1433
|
+
resolveStorageUrl,
|
|
1434
|
+
canEmbedPdf,
|
|
1435
|
+
onOpenExternally
|
|
1436
|
+
}
|
|
1437
|
+
) : structure })
|
|
1362
1438
|
] });
|
|
1363
1439
|
}
|
|
1364
1440
|
function SchemaTable({
|
|
@@ -1933,6 +2009,7 @@ var PIPE_TYPE_BADGES2 = {
|
|
|
1933
2009
|
PipeImgGen: "ImgGen",
|
|
1934
2010
|
PipeSearch: "Search",
|
|
1935
2011
|
PipeFunc: "Func",
|
|
2012
|
+
PipeSignature: "Signature",
|
|
1936
2013
|
PipeSequence: "Sequence",
|
|
1937
2014
|
PipeParallel: "Parallel",
|
|
1938
2015
|
PipeCondition: "Condition",
|
|
@@ -1964,14 +2041,16 @@ function PipeCardBase({ data, children }) {
|
|
|
1964
2041
|
const statusConfig = STATUS_CONFIG[data.status];
|
|
1965
2042
|
const isRunning = data.status === "running";
|
|
1966
2043
|
const isController = isControllerType(data.pipeType);
|
|
2044
|
+
const isSignature = data.pipeType === "PipeSignature";
|
|
1967
2045
|
const [inputsExpanded, setInputsExpanded] = useState2(false);
|
|
1968
2046
|
const hasMany = data.inputs.length > MAX_VISIBLE_INPUTS;
|
|
1969
2047
|
const visibleInputs = hasMany && !inputsExpanded ? data.inputs.slice(0, MAX_VISIBLE_INPUTS) : data.inputs;
|
|
1970
2048
|
const hiddenCount = data.inputs.length - MAX_VISIBLE_INPUTS;
|
|
1971
2049
|
const dirClass = data.direction === "TB" ? "pipe-card--tb" : "pipe-card--lr";
|
|
1972
2050
|
const controllerClass = isController ? " pipe-card--controller" : "";
|
|
1973
|
-
const
|
|
1974
|
-
|
|
2051
|
+
const signatureClass = isSignature ? " pipe-card--signature" : "";
|
|
2052
|
+
const badgeClass = isController ? "pipe-card-badge pipe-card-badge--controller" : isSignature ? "pipe-card-badge pipe-card-badge--signature" : "pipe-card-badge";
|
|
2053
|
+
return /* @__PURE__ */ jsxs18("div", { className: `pipe-card ${dirClass}${controllerClass}${signatureClass}`, children: [
|
|
1975
2054
|
/* @__PURE__ */ jsxs18("div", { className: "pipe-card-header", children: [
|
|
1976
2055
|
/* @__PURE__ */ jsx18("span", { className: badgeClass, children: badge }),
|
|
1977
2056
|
/* @__PURE__ */ jsx18("span", { className: "pipe-card-code", title: data.pipeCode, children: data.pipeCode }),
|
|
@@ -2062,6 +2141,7 @@ var PIPE_CARD_REGISTRY = {
|
|
|
2062
2141
|
PipeImgGen: PipeCardBase,
|
|
2063
2142
|
PipeSearch: PipeCardBase,
|
|
2064
2143
|
PipeFunc: PipeCardBase,
|
|
2144
|
+
PipeSignature: PipeCardBase,
|
|
2065
2145
|
PipeSequence: PipeCardBase,
|
|
2066
2146
|
PipeParallel: PipeCardBase,
|
|
2067
2147
|
PipeCondition: PipeCardBase,
|
|
@@ -2098,6 +2178,7 @@ var nodeTypes = __spreadProps(__spreadValues({}, controllerNodeTypes), {
|
|
|
2098
2178
|
pipeCard: PipeCardRFNode
|
|
2099
2179
|
});
|
|
2100
2180
|
function StuffNodeDetail({
|
|
2181
|
+
nodeId,
|
|
2101
2182
|
stuffData,
|
|
2102
2183
|
graphspec,
|
|
2103
2184
|
resolveStorageUrl,
|
|
@@ -2110,6 +2191,7 @@ function StuffNodeDetail({
|
|
|
2110
2191
|
{
|
|
2111
2192
|
concept: conceptInfo,
|
|
2112
2193
|
ioData: stuffData,
|
|
2194
|
+
instanceKey: nodeId,
|
|
2113
2195
|
resolveStorageUrl,
|
|
2114
2196
|
canEmbedPdf,
|
|
2115
2197
|
onOpenExternally
|
|
@@ -2181,29 +2263,29 @@ function GraphViewer(props) {
|
|
|
2181
2263
|
canEmbedPdf,
|
|
2182
2264
|
onOpenExternally
|
|
2183
2265
|
} = props;
|
|
2184
|
-
const graphspec =
|
|
2266
|
+
const graphspec = React8.useMemo(
|
|
2185
2267
|
() => graphspecProp === null ? null : validateGraphSpec(graphspecProp),
|
|
2186
2268
|
[graphspecProp]
|
|
2187
2269
|
);
|
|
2188
|
-
const [direction, setDirection] =
|
|
2270
|
+
const [direction, setDirection] = React8.useState(
|
|
2189
2271
|
() => {
|
|
2190
2272
|
var _a2, _b2;
|
|
2191
2273
|
return (_b2 = (_a2 = initialDirection != null ? initialDirection : config.direction) != null ? _a2 : DEFAULT_GRAPH_CONFIG.direction) != null ? _b2 : GRAPH_DIRECTION.TB;
|
|
2192
2274
|
}
|
|
2193
2275
|
);
|
|
2194
2276
|
const externalTheme = resolveExternalTheme(themeProp, config.theme);
|
|
2195
|
-
const [theme, setTheme] =
|
|
2196
|
-
const prevExternalThemeRef =
|
|
2197
|
-
|
|
2277
|
+
const [theme, setTheme] = React8.useState(externalTheme);
|
|
2278
|
+
const prevExternalThemeRef = React8.useRef(externalTheme);
|
|
2279
|
+
React8.useEffect(() => {
|
|
2198
2280
|
if (externalTheme !== prevExternalThemeRef.current) {
|
|
2199
2281
|
prevExternalThemeRef.current = externalTheme;
|
|
2200
2282
|
setTheme(externalTheme);
|
|
2201
2283
|
}
|
|
2202
2284
|
}, [externalTheme]);
|
|
2203
|
-
const onThemeChangeRef =
|
|
2285
|
+
const onThemeChangeRef = React8.useRef(onThemeChange);
|
|
2204
2286
|
onThemeChangeRef.current = onThemeChange;
|
|
2205
|
-
const prevReportedThemeRef =
|
|
2206
|
-
|
|
2287
|
+
const prevReportedThemeRef = React8.useRef(theme);
|
|
2288
|
+
React8.useEffect(() => {
|
|
2207
2289
|
var _a2;
|
|
2208
2290
|
if (theme !== prevReportedThemeRef.current) {
|
|
2209
2291
|
prevReportedThemeRef.current = theme;
|
|
@@ -2211,26 +2293,26 @@ function GraphViewer(props) {
|
|
|
2211
2293
|
}
|
|
2212
2294
|
}, [theme]);
|
|
2213
2295
|
const effectiveFoldMode = (_b = (_a = initialFoldMode != null ? initialFoldMode : config.foldMode) != null ? _a : DEFAULT_GRAPH_CONFIG.foldMode) != null ? _b : FOLD_MODE.EXPANDED;
|
|
2214
|
-
const [showControllers, setShowControllers] =
|
|
2296
|
+
const [showControllers, setShowControllers] = React8.useState(() => {
|
|
2215
2297
|
var _a2, _b2;
|
|
2216
2298
|
if (effectiveFoldMode === FOLD_MODE.FOLDED) return true;
|
|
2217
2299
|
return (_b2 = (_a2 = initialShowControllers != null ? initialShowControllers : config.showControllers) != null ? _a2 : DEFAULT_GRAPH_CONFIG.showControllers) != null ? _b2 : false;
|
|
2218
2300
|
});
|
|
2219
|
-
const foldModeRef =
|
|
2301
|
+
const foldModeRef = React8.useRef(effectiveFoldMode);
|
|
2220
2302
|
foldModeRef.current = effectiveFoldMode;
|
|
2221
|
-
const containerRef =
|
|
2222
|
-
const [detailSelection, setDetailSelection] =
|
|
2223
|
-
const [conceptOverride, setConceptOverride] =
|
|
2303
|
+
const containerRef = React8.useRef(null);
|
|
2304
|
+
const [detailSelection, setDetailSelection] = React8.useState(null);
|
|
2305
|
+
const [conceptOverride, setConceptOverride] = React8.useState(null);
|
|
2224
2306
|
const {
|
|
2225
2307
|
width: panelWidth,
|
|
2226
2308
|
isDragging: isPanelDragging,
|
|
2227
2309
|
handleMouseDown: onResizeMouseDown
|
|
2228
2310
|
} = useResizable({ defaultWidth: 380, minWidth: 280, maxWidth: 800, containerRef });
|
|
2229
|
-
|
|
2311
|
+
React8.useEffect(() => {
|
|
2230
2312
|
setDetailSelection(null);
|
|
2231
2313
|
setConceptOverride(null);
|
|
2232
2314
|
}, [graphspec]);
|
|
2233
|
-
|
|
2315
|
+
React8.useEffect(() => {
|
|
2234
2316
|
const el = containerRef.current;
|
|
2235
2317
|
if (!el) return;
|
|
2236
2318
|
const themePalette = getPaletteForTheme(theme);
|
|
@@ -2247,12 +2329,12 @@ function GraphViewer(props) {
|
|
|
2247
2329
|
}, [config.paletteColors, theme]);
|
|
2248
2330
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
2249
2331
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
2250
|
-
const reactFlowRef =
|
|
2251
|
-
const initialDataRef =
|
|
2252
|
-
const rawGraphDataRef =
|
|
2253
|
-
const layoutCacheRef =
|
|
2254
|
-
const [expandedControllers, setExpandedControllers] =
|
|
2255
|
-
const toggleCollapse =
|
|
2332
|
+
const reactFlowRef = React8.useRef(null);
|
|
2333
|
+
const initialDataRef = React8.useRef(null);
|
|
2334
|
+
const rawGraphDataRef = React8.useRef(null);
|
|
2335
|
+
const layoutCacheRef = React8.useRef(null);
|
|
2336
|
+
const [expandedControllers, setExpandedControllers] = React8.useState(/* @__PURE__ */ new Set());
|
|
2337
|
+
const toggleCollapse = React8.useCallback((controllerId) => {
|
|
2256
2338
|
setExpandedControllers((prev) => {
|
|
2257
2339
|
const next = new Set(prev);
|
|
2258
2340
|
if (next.has(controllerId)) next.delete(controllerId);
|
|
@@ -2260,8 +2342,8 @@ function GraphViewer(props) {
|
|
|
2260
2342
|
return next;
|
|
2261
2343
|
});
|
|
2262
2344
|
}, []);
|
|
2263
|
-
const [foldedControllers, setFoldedControllers] =
|
|
2264
|
-
const toggleFold =
|
|
2345
|
+
const [foldedControllers, setFoldedControllers] = React8.useState(/* @__PURE__ */ new Set());
|
|
2346
|
+
const toggleFold = React8.useCallback((controllerId, options) => {
|
|
2265
2347
|
setFoldedControllers((prev) => {
|
|
2266
2348
|
const next = new Set(prev);
|
|
2267
2349
|
const shouldFold = !next.has(controllerId);
|
|
@@ -2275,34 +2357,34 @@ function GraphViewer(props) {
|
|
|
2275
2357
|
});
|
|
2276
2358
|
}, []);
|
|
2277
2359
|
const edgeType = config.edgeType || EDGE_TYPE.DEFAULT;
|
|
2278
|
-
const layoutConfig =
|
|
2360
|
+
const layoutConfig = React8.useMemo(
|
|
2279
2361
|
() => ({ nodesep: config.nodesep, ranksep: config.ranksep }),
|
|
2280
2362
|
[config.nodesep, config.ranksep]
|
|
2281
2363
|
);
|
|
2282
|
-
const showControllersRef =
|
|
2364
|
+
const showControllersRef = React8.useRef(showControllers);
|
|
2283
2365
|
showControllersRef.current = showControllers;
|
|
2284
|
-
const directionRef =
|
|
2366
|
+
const directionRef = React8.useRef(direction);
|
|
2285
2367
|
directionRef.current = direction;
|
|
2286
|
-
const layoutConfigRef =
|
|
2368
|
+
const layoutConfigRef = React8.useRef(layoutConfig);
|
|
2287
2369
|
layoutConfigRef.current = layoutConfig;
|
|
2288
|
-
const initialZoomRef =
|
|
2370
|
+
const initialZoomRef = React8.useRef(config.initialZoom);
|
|
2289
2371
|
initialZoomRef.current = config.initialZoom;
|
|
2290
|
-
const panToTopRef =
|
|
2372
|
+
const panToTopRef = React8.useRef(config.panToTop);
|
|
2291
2373
|
panToTopRef.current = config.panToTop;
|
|
2292
|
-
const expandedRef =
|
|
2374
|
+
const expandedRef = React8.useRef(expandedControllers);
|
|
2293
2375
|
expandedRef.current = expandedControllers;
|
|
2294
|
-
const toggleCollapseRef =
|
|
2376
|
+
const toggleCollapseRef = React8.useRef(toggleCollapse);
|
|
2295
2377
|
toggleCollapseRef.current = toggleCollapse;
|
|
2296
|
-
const foldedRef =
|
|
2378
|
+
const foldedRef = React8.useRef(foldedControllers);
|
|
2297
2379
|
foldedRef.current = foldedControllers;
|
|
2298
|
-
const toggleFoldRef =
|
|
2380
|
+
const toggleFoldRef = React8.useRef(toggleFold);
|
|
2299
2381
|
toggleFoldRef.current = toggleFold;
|
|
2300
|
-
const isFirstFoldEffect =
|
|
2301
|
-
const prevFoldSizeRef =
|
|
2302
|
-
const skipNextFoldEffectRef =
|
|
2303
|
-
const statusMapRef =
|
|
2382
|
+
const isFirstFoldEffect = React8.useRef(true);
|
|
2383
|
+
const prevFoldSizeRef = React8.useRef(0);
|
|
2384
|
+
const skipNextFoldEffectRef = React8.useRef(false);
|
|
2385
|
+
const statusMapRef = React8.useRef(statusMap);
|
|
2304
2386
|
statusMapRef.current = statusMap;
|
|
2305
|
-
|
|
2387
|
+
React8.useEffect(() => {
|
|
2306
2388
|
if (!initialDataRef.current) return;
|
|
2307
2389
|
let cancelled = false;
|
|
2308
2390
|
(async () => {
|
|
@@ -2354,7 +2436,7 @@ function GraphViewer(props) {
|
|
|
2354
2436
|
cancelled = true;
|
|
2355
2437
|
};
|
|
2356
2438
|
}, [direction, layoutConfig]);
|
|
2357
|
-
|
|
2439
|
+
React8.useEffect(() => {
|
|
2358
2440
|
if (!layoutCacheRef.current || !initialDataRef.current) return;
|
|
2359
2441
|
const cachedNodes = cloneCachedNodes(layoutCacheRef.current.nodes);
|
|
2360
2442
|
const cachedEdges = layoutCacheRef.current.edges;
|
|
@@ -2374,7 +2456,7 @@ function GraphViewer(props) {
|
|
|
2374
2456
|
);
|
|
2375
2457
|
setEdges(toAppEdges(withControllers.edges));
|
|
2376
2458
|
}, [showControllers, expandedControllers, toggleCollapse, toggleFold]);
|
|
2377
|
-
|
|
2459
|
+
React8.useEffect(() => {
|
|
2378
2460
|
if (!graphspec) {
|
|
2379
2461
|
initialDataRef.current = null;
|
|
2380
2462
|
rawGraphDataRef.current = null;
|
|
@@ -2478,7 +2560,7 @@ function GraphViewer(props) {
|
|
|
2478
2560
|
cancelled = true;
|
|
2479
2561
|
};
|
|
2480
2562
|
}, [graphspec, edgeType]);
|
|
2481
|
-
|
|
2563
|
+
React8.useEffect(() => {
|
|
2482
2564
|
if (isFirstFoldEffect.current) {
|
|
2483
2565
|
isFirstFoldEffect.current = false;
|
|
2484
2566
|
prevFoldSizeRef.current = foldedControllers.size;
|
|
@@ -2558,7 +2640,7 @@ function GraphViewer(props) {
|
|
|
2558
2640
|
cancelled = true;
|
|
2559
2641
|
};
|
|
2560
2642
|
}, [foldedControllers, toggleFold]);
|
|
2561
|
-
|
|
2643
|
+
React8.useEffect(() => {
|
|
2562
2644
|
if (!layoutCacheRef.current || !initialDataRef.current) return;
|
|
2563
2645
|
const cachedNodes = cloneCachedNodes(layoutCacheRef.current.nodes);
|
|
2564
2646
|
const cachedEdges = layoutCacheRef.current.edges;
|
|
@@ -2576,7 +2658,7 @@ function GraphViewer(props) {
|
|
|
2576
2658
|
setNodes(applyStatusOverrides(toAppNodes(hydrateLabels(withControllers.nodes)), statusMap));
|
|
2577
2659
|
setEdges(toAppEdges(withControllers.edges));
|
|
2578
2660
|
}, [statusMap]);
|
|
2579
|
-
const onNodeClick =
|
|
2661
|
+
const onNodeClick = React8.useCallback(
|
|
2580
2662
|
(event, node) => {
|
|
2581
2663
|
var _a2;
|
|
2582
2664
|
const nodeData = node.data;
|
|
@@ -2618,7 +2700,7 @@ function GraphViewer(props) {
|
|
|
2618
2700
|
conceptOverride
|
|
2619
2701
|
]
|
|
2620
2702
|
);
|
|
2621
|
-
const onInit =
|
|
2703
|
+
const onInit = React8.useCallback(
|
|
2622
2704
|
(reactFlowInstance) => {
|
|
2623
2705
|
reactFlowRef.current = reactFlowInstance;
|
|
2624
2706
|
if (onReactFlowInit) {
|
|
@@ -2627,12 +2709,12 @@ function GraphViewer(props) {
|
|
|
2627
2709
|
},
|
|
2628
2710
|
[onReactFlowInit]
|
|
2629
2711
|
);
|
|
2630
|
-
const handlePaneClick =
|
|
2712
|
+
const handlePaneClick = React8.useCallback(() => {
|
|
2631
2713
|
setDetailSelection(null);
|
|
2632
2714
|
setConceptOverride(null);
|
|
2633
2715
|
onPaneClick == null ? void 0 : onPaneClick();
|
|
2634
2716
|
}, [onPaneClick]);
|
|
2635
|
-
const handleConceptClick =
|
|
2717
|
+
const handleConceptClick = React8.useCallback(
|
|
2636
2718
|
(conceptCode) => {
|
|
2637
2719
|
if (!graphspec) return;
|
|
2638
2720
|
const info = resolveConceptRef(graphspec, conceptCode);
|
|
@@ -2644,7 +2726,7 @@ function GraphViewer(props) {
|
|
|
2644
2726
|
const detailOpen = detailSelection !== null || conceptOverride !== null;
|
|
2645
2727
|
const rawAnalysis = (_c = rawGraphDataRef.current) == null ? void 0 : _c.analysis;
|
|
2646
2728
|
const allControllerIds = rawAnalysis == null ? void 0 : rawAnalysis.controllerNodeIds;
|
|
2647
|
-
const foldAllProps =
|
|
2729
|
+
const foldAllProps = React8.useMemo(() => {
|
|
2648
2730
|
if (!showControllers || !allControllerIds || allControllerIds.size === 0) {
|
|
2649
2731
|
return {
|
|
2650
2732
|
onFoldAll: void 0,
|
|
@@ -2660,102 +2742,96 @@ function GraphViewer(props) {
|
|
|
2660
2742
|
expandAllDisabled: foldedControllers.size === 0
|
|
2661
2743
|
};
|
|
2662
2744
|
}, [showControllers, allControllerIds, foldedControllers]);
|
|
2663
|
-
return /* @__PURE__ */ jsxs20(
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
minZoom: 0.1,
|
|
2685
|
-
proOptions: { hideAttribution: true },
|
|
2686
|
-
panActivationKeyCode: null,
|
|
2687
|
-
children: /* @__PURE__ */ jsx20(
|
|
2688
|
-
Background,
|
|
2689
|
-
{
|
|
2690
|
-
variant: BackgroundVariant.Dots,
|
|
2691
|
-
gap: 20,
|
|
2692
|
-
size: 1,
|
|
2693
|
-
color: "var(--color-bg-dots)"
|
|
2694
|
-
}
|
|
2695
|
-
)
|
|
2696
|
-
}
|
|
2697
|
-
),
|
|
2698
|
-
/* @__PURE__ */ jsxs20(
|
|
2699
|
-
DetailPanel,
|
|
2700
|
-
{
|
|
2701
|
-
isOpen: detailOpen,
|
|
2702
|
-
onClose: handlePaneClick,
|
|
2703
|
-
width: panelWidth,
|
|
2704
|
-
isDragging: isPanelDragging,
|
|
2705
|
-
onResizeHandleMouseDown: onResizeMouseDown,
|
|
2706
|
-
children: [
|
|
2707
|
-
conceptOverride ? /* @__PURE__ */ jsx20(ConceptDetailPanel, { concept: conceptOverride }) : selectedSpecNode && graphspec ? /* @__PURE__ */ jsx20(
|
|
2708
|
-
PipeDetailPanel,
|
|
2709
|
-
{
|
|
2710
|
-
node: selectedSpecNode,
|
|
2711
|
-
spec: graphspec,
|
|
2712
|
-
onConceptClick: handleConceptClick
|
|
2713
|
-
}
|
|
2714
|
-
) : (detailSelection == null ? void 0 : detailSelection.stuffData) ? /* @__PURE__ */ jsx20(
|
|
2715
|
-
StuffNodeDetail,
|
|
2716
|
-
{
|
|
2717
|
-
stuffData: detailSelection.stuffData,
|
|
2718
|
-
graphspec,
|
|
2719
|
-
resolveStorageUrl,
|
|
2720
|
-
canEmbedPdf,
|
|
2721
|
-
onOpenExternally
|
|
2722
|
-
}
|
|
2723
|
-
) : null,
|
|
2724
|
-
renderDetailExtra && detailSelection && !conceptOverride && renderDetailExtra(detailSelection.nodeId, detailSelection.nodeData)
|
|
2725
|
-
]
|
|
2726
|
-
}
|
|
2727
|
-
),
|
|
2728
|
-
!hideToolbar && /* @__PURE__ */ jsx20(
|
|
2729
|
-
GraphToolbar,
|
|
2745
|
+
return /* @__PURE__ */ jsxs20("div", { ref: containerRef, className: `react-flow-container react-flow-container--theme-${theme}`, children: [
|
|
2746
|
+
/* @__PURE__ */ jsx20(
|
|
2747
|
+
ReactFlow,
|
|
2748
|
+
{
|
|
2749
|
+
nodes,
|
|
2750
|
+
edges,
|
|
2751
|
+
nodeTypes,
|
|
2752
|
+
onNodesChange,
|
|
2753
|
+
onEdgesChange,
|
|
2754
|
+
onNodeClick,
|
|
2755
|
+
onPaneClick: handlePaneClick,
|
|
2756
|
+
onInit,
|
|
2757
|
+
fitView: true,
|
|
2758
|
+
fitViewOptions: { padding: 0.1 },
|
|
2759
|
+
defaultEdgeOptions: { type: edgeType },
|
|
2760
|
+
panOnScroll: true,
|
|
2761
|
+
minZoom: 0.1,
|
|
2762
|
+
proOptions: { hideAttribution: true },
|
|
2763
|
+
panActivationKeyCode: null,
|
|
2764
|
+
children: /* @__PURE__ */ jsx20(
|
|
2765
|
+
Background,
|
|
2730
2766
|
{
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
onZoomIn: () => {
|
|
2736
|
-
var _a2;
|
|
2737
|
-
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.zoomIn();
|
|
2738
|
-
},
|
|
2739
|
-
onZoomOut: () => {
|
|
2740
|
-
var _a2;
|
|
2741
|
-
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.zoomOut();
|
|
2742
|
-
},
|
|
2743
|
-
onFitView: () => {
|
|
2744
|
-
var _a2;
|
|
2745
|
-
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.fitView({ padding: 0.1 });
|
|
2746
|
-
},
|
|
2747
|
-
onFoldAll: foldAllProps.onFoldAll,
|
|
2748
|
-
onExpandAll: foldAllProps.onExpandAll,
|
|
2749
|
-
foldAllDisabled: foldAllProps.foldAllDisabled,
|
|
2750
|
-
expandAllDisabled: foldAllProps.expandAllDisabled,
|
|
2751
|
-
theme: showThemeToggle ? theme : void 0,
|
|
2752
|
-
onThemeChange: showThemeToggle ? setTheme : void 0,
|
|
2753
|
-
rightOffset: detailOpen ? panelWidth : 0
|
|
2767
|
+
variant: BackgroundVariant.Dots,
|
|
2768
|
+
gap: 20,
|
|
2769
|
+
size: 1,
|
|
2770
|
+
color: "var(--color-bg-dots)"
|
|
2754
2771
|
}
|
|
2755
2772
|
)
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2773
|
+
}
|
|
2774
|
+
),
|
|
2775
|
+
/* @__PURE__ */ jsxs20(
|
|
2776
|
+
DetailPanel,
|
|
2777
|
+
{
|
|
2778
|
+
isOpen: detailOpen,
|
|
2779
|
+
onClose: handlePaneClick,
|
|
2780
|
+
width: panelWidth,
|
|
2781
|
+
isDragging: isPanelDragging,
|
|
2782
|
+
onResizeHandleMouseDown: onResizeMouseDown,
|
|
2783
|
+
children: [
|
|
2784
|
+
conceptOverride ? /* @__PURE__ */ jsx20(ConceptDetailPanel, { concept: conceptOverride }) : selectedSpecNode && graphspec ? /* @__PURE__ */ jsx20(
|
|
2785
|
+
PipeDetailPanel,
|
|
2786
|
+
{
|
|
2787
|
+
node: selectedSpecNode,
|
|
2788
|
+
spec: graphspec,
|
|
2789
|
+
onConceptClick: handleConceptClick
|
|
2790
|
+
}
|
|
2791
|
+
) : (detailSelection == null ? void 0 : detailSelection.stuffData) ? /* @__PURE__ */ jsx20(
|
|
2792
|
+
StuffNodeDetail,
|
|
2793
|
+
{
|
|
2794
|
+
nodeId: detailSelection.nodeId,
|
|
2795
|
+
stuffData: detailSelection.stuffData,
|
|
2796
|
+
graphspec,
|
|
2797
|
+
resolveStorageUrl,
|
|
2798
|
+
canEmbedPdf,
|
|
2799
|
+
onOpenExternally
|
|
2800
|
+
}
|
|
2801
|
+
) : null,
|
|
2802
|
+
renderDetailExtra && detailSelection && !conceptOverride && renderDetailExtra(detailSelection.nodeId, detailSelection.nodeData)
|
|
2803
|
+
]
|
|
2804
|
+
}
|
|
2805
|
+
),
|
|
2806
|
+
!hideToolbar && /* @__PURE__ */ jsx20(
|
|
2807
|
+
GraphToolbar,
|
|
2808
|
+
{
|
|
2809
|
+
direction,
|
|
2810
|
+
onDirectionChange: setDirection,
|
|
2811
|
+
showControllers,
|
|
2812
|
+
onShowControllersChange: setShowControllers,
|
|
2813
|
+
onZoomIn: () => {
|
|
2814
|
+
var _a2;
|
|
2815
|
+
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.zoomIn();
|
|
2816
|
+
},
|
|
2817
|
+
onZoomOut: () => {
|
|
2818
|
+
var _a2;
|
|
2819
|
+
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.zoomOut();
|
|
2820
|
+
},
|
|
2821
|
+
onFitView: () => {
|
|
2822
|
+
var _a2;
|
|
2823
|
+
return (_a2 = reactFlowRef.current) == null ? void 0 : _a2.fitView({ padding: 0.1 });
|
|
2824
|
+
},
|
|
2825
|
+
onFoldAll: foldAllProps.onFoldAll,
|
|
2826
|
+
onExpandAll: foldAllProps.onExpandAll,
|
|
2827
|
+
foldAllDisabled: foldAllProps.foldAllDisabled,
|
|
2828
|
+
expandAllDisabled: foldAllProps.expandAllDisabled,
|
|
2829
|
+
theme: showThemeToggle ? theme : void 0,
|
|
2830
|
+
onThemeChange: showThemeToggle ? setTheme : void 0,
|
|
2831
|
+
rightOffset: detailOpen ? panelWidth : 0
|
|
2832
|
+
}
|
|
2833
|
+
)
|
|
2834
|
+
] });
|
|
2759
2835
|
}
|
|
2760
2836
|
export {
|
|
2761
2837
|
ConceptDetailPanel,
|