@tangle-network/sandbox-ui 0.93.0 → 0.94.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.
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
COMPACT_NODE_SIZE,
|
|
6
6
|
COMPACT_TILE,
|
|
7
|
+
OUTPUT_PREVIEW_CHARS,
|
|
8
|
+
OUTPUT_ROWS,
|
|
7
9
|
buildWorkflowGraph,
|
|
8
10
|
clampPreview,
|
|
9
11
|
fmtCost,
|
|
@@ -12,7 +14,7 @@ import {
|
|
|
12
14
|
providerLabel,
|
|
13
15
|
shortModel,
|
|
14
16
|
triggerNodeIndex
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7QKAVIZX.js";
|
|
16
18
|
import {
|
|
17
19
|
ModelBrandStack,
|
|
18
20
|
modelBrandFor
|
|
@@ -566,7 +568,7 @@ function WorkflowNode({ id, data }) {
|
|
|
566
568
|
const trimmed = source.text.trim();
|
|
567
569
|
if (!trimmed) return null;
|
|
568
570
|
const shape = classifyOutput(
|
|
569
|
-
clampPreview(trimmed),
|
|
571
|
+
clampPreview(trimmed, OUTPUT_PREVIEW_CHARS),
|
|
570
572
|
isAgent && source.tone !== "error"
|
|
571
573
|
);
|
|
572
574
|
return shape.kind === "empty" ? null : { shape, tone: source.tone, label: source.label };
|
|
@@ -728,7 +730,7 @@ function WorkflowNode({ id, data }) {
|
|
|
728
730
|
{
|
|
729
731
|
shape: runOutput.shape,
|
|
730
732
|
tone: runOutput.tone,
|
|
731
|
-
rows:
|
|
733
|
+
rows: OUTPUT_ROWS
|
|
732
734
|
}
|
|
733
735
|
)
|
|
734
736
|
] }),
|
|
@@ -974,6 +976,20 @@ function WorkflowGraph({
|
|
|
974
976
|
},
|
|
975
977
|
[onNodeClick]
|
|
976
978
|
);
|
|
979
|
+
const handleNodeKeyDown = useCallback(
|
|
980
|
+
(event) => {
|
|
981
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
982
|
+
if (!(event.target instanceof HTMLElement)) return;
|
|
983
|
+
const nodeId = event.target.closest(".react-flow__node")?.getAttribute("data-id");
|
|
984
|
+
if (!nodeId) return;
|
|
985
|
+
const node = nodesRef.current.find((n) => n.id === nodeId);
|
|
986
|
+
if (!node) return;
|
|
987
|
+
event.preventDefault();
|
|
988
|
+
event.stopPropagation();
|
|
989
|
+
onNodeClick?.(node.id, node.data);
|
|
990
|
+
},
|
|
991
|
+
[onNodeClick]
|
|
992
|
+
);
|
|
977
993
|
if (structural.error || structural.nodes.length === 0) {
|
|
978
994
|
return /* @__PURE__ */ jsx3(
|
|
979
995
|
"div",
|
|
@@ -997,6 +1013,7 @@ function WorkflowGraph({
|
|
|
997
1013
|
rfRef.current = inst;
|
|
998
1014
|
},
|
|
999
1015
|
onNodeClick: onNodeClick ? handleNodeClick : void 0,
|
|
1016
|
+
onKeyDown: onNodeClick ? handleNodeKeyDown : void 0,
|
|
1000
1017
|
fitView: true,
|
|
1001
1018
|
fitViewOptions: { ...FIT_VIEW, maxZoom: fitZoomCeiling(compact) },
|
|
1002
1019
|
proOptions: { hideAttribution: true },
|
|
@@ -238,7 +238,9 @@ var CARD_CHROME = 20;
|
|
|
238
238
|
var HEADER_ROW = 34;
|
|
239
239
|
var DESCRIPTION_ROW = 40;
|
|
240
240
|
var META_ROW = 27;
|
|
241
|
-
var
|
|
241
|
+
var OUTPUT_ROWS = 3;
|
|
242
|
+
var OUTPUT_ROW = 89;
|
|
243
|
+
var OUTPUT_PREVIEW_CHARS = 240;
|
|
242
244
|
var FOOTER_ROW = 28;
|
|
243
245
|
var COMPACT_TILE = 76;
|
|
244
246
|
var COMPACT_GAP = 8;
|
|
@@ -795,6 +797,8 @@ export {
|
|
|
795
797
|
triggerNodeIndex,
|
|
796
798
|
actionNodeId,
|
|
797
799
|
branchNodeId,
|
|
800
|
+
OUTPUT_ROWS,
|
|
801
|
+
OUTPUT_PREVIEW_CHARS,
|
|
798
802
|
COMPACT_TILE,
|
|
799
803
|
COMPACT_NODE_SIZE,
|
|
800
804
|
buildWorkflowGraph
|
package/dist/workflows.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
buildWorkflowGraph,
|
|
6
6
|
triggerNodeId,
|
|
7
7
|
triggerNodeIndex
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7QKAVIZX.js";
|
|
9
9
|
import {
|
|
10
10
|
ModelBrandStack,
|
|
11
11
|
modelBrandFor
|
|
@@ -36,7 +36,7 @@ function retryImport(factory, retries = 2, delayMs = 350) {
|
|
|
36
36
|
function lazyWorkflowGraph() {
|
|
37
37
|
return lazy(
|
|
38
38
|
() => retryImport(
|
|
39
|
-
() => import("./WorkflowGraph-
|
|
39
|
+
() => import("./WorkflowGraph-4TQFLY3E.js").then((m) => ({ default: m.WorkflowGraph }))
|
|
40
40
|
)
|
|
41
41
|
);
|
|
42
42
|
}
|
package/package.json
CHANGED