@tangle-network/sandbox-ui 0.110.0 → 0.111.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.
|
@@ -642,7 +642,7 @@ function NodeMark({
|
|
|
642
642
|
|
|
643
643
|
// src/workflows/WorkflowGraph.tsx
|
|
644
644
|
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
645
|
-
var FIT_VIEW = { padding:
|
|
645
|
+
var FIT_VIEW = { padding: "12px" };
|
|
646
646
|
function fitZoomCeiling(compact) {
|
|
647
647
|
return compact ? 1.5 : 1;
|
|
648
648
|
}
|
|
@@ -1335,6 +1335,7 @@ function WorkflowGraph({
|
|
|
1335
1335
|
variant = "full",
|
|
1336
1336
|
direction = "LR",
|
|
1337
1337
|
defaultCompact,
|
|
1338
|
+
onCompactChange,
|
|
1338
1339
|
className,
|
|
1339
1340
|
wrap = false,
|
|
1340
1341
|
nodeState,
|
|
@@ -1362,6 +1363,7 @@ function WorkflowGraph({
|
|
|
1362
1363
|
const [userCompact, setUserCompact] = useState(
|
|
1363
1364
|
defaultCompact ?? nodeState === void 0
|
|
1364
1365
|
);
|
|
1366
|
+
const nextDensityFrom = useRef(userCompact);
|
|
1365
1367
|
const compact = isPreview || userCompact;
|
|
1366
1368
|
const [displayCompact, setDisplayCompact] = useState(compact);
|
|
1367
1369
|
const rfRef = useRef(
|
|
@@ -1646,7 +1648,14 @@ function WorkflowGraph({
|
|
|
1646
1648
|
children: [
|
|
1647
1649
|
/* @__PURE__ */ jsx3(Background, { gap: 18 }),
|
|
1648
1650
|
!isPreview && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1649
|
-
/* @__PURE__ */ jsx3(
|
|
1651
|
+
/* @__PURE__ */ jsx3(
|
|
1652
|
+
Controls,
|
|
1653
|
+
{
|
|
1654
|
+
showInteractive: false,
|
|
1655
|
+
position: "bottom-right",
|
|
1656
|
+
fitViewOptions: { padding: FIT_VIEW.padding }
|
|
1657
|
+
}
|
|
1658
|
+
),
|
|
1650
1659
|
/* @__PURE__ */ jsxs3(Panel, { position: "top-left", className: "flex items-center gap-1", children: [
|
|
1651
1660
|
addTrigger && /* @__PURE__ */ jsxs3(
|
|
1652
1661
|
"button",
|
|
@@ -1667,7 +1676,12 @@ function WorkflowGraph({
|
|
|
1667
1676
|
"button",
|
|
1668
1677
|
{
|
|
1669
1678
|
type: "button",
|
|
1670
|
-
onClick: () =>
|
|
1679
|
+
onClick: () => {
|
|
1680
|
+
const next = !nextDensityFrom.current;
|
|
1681
|
+
nextDensityFrom.current = next;
|
|
1682
|
+
setUserCompact(next);
|
|
1683
|
+
onCompactChange?.(next);
|
|
1684
|
+
},
|
|
1671
1685
|
"aria-pressed": userCompact,
|
|
1672
1686
|
title: userCompact ? "Expand nodes" : "Collapse nodes",
|
|
1673
1687
|
className: "flex items-center gap-1 rounded-md border border-border bg-card/80 px-2 py-1 text-[11px] text-muted-foreground shadow-sm backdrop-blur transition hover:text-foreground",
|
package/dist/workflows.d.ts
CHANGED
|
@@ -331,6 +331,17 @@ interface WorkflowGraphProps {
|
|
|
331
331
|
* toggle, and the preview variant is always compact.
|
|
332
332
|
*/
|
|
333
333
|
defaultCompact?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Called when the reader moves the density toggle, with the density they
|
|
336
|
+
* chose.
|
|
337
|
+
*
|
|
338
|
+
* `defaultCompact` seeds the graph; this reports back out of it, which is
|
|
339
|
+
* what a host needs to REMEMBER the choice. Without it a host can set an
|
|
340
|
+
* opening density but never learn that the reader wanted the other one, so
|
|
341
|
+
* every navigation puts them back where they started and the toggle has to
|
|
342
|
+
* be found again.
|
|
343
|
+
*/
|
|
344
|
+
onCompactChange?: (compact: boolean) => void;
|
|
334
345
|
/** Sizing for the wrapper; the caller controls height. */
|
|
335
346
|
className?: string;
|
|
336
347
|
/**
|
package/dist/workflows.js
CHANGED
|
@@ -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-2QOORYIR.js").then((m) => ({ default: m.WorkflowGraph }))
|
|
40
40
|
)
|
|
41
41
|
);
|
|
42
42
|
}
|
package/package.json
CHANGED