@ruckc/truss-graph 1.53.0 → 1.54.1
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/Graph.svelte +7 -2
- package/dist/Graph.svelte.d.ts +5 -1
- package/package.json +1 -1
package/dist/Graph.svelte
CHANGED
|
@@ -140,7 +140,11 @@
|
|
|
140
140
|
minimapPosition?: 'bottom-right' | 'bottom-left';
|
|
141
141
|
/** The minimap is hidden while the graph is narrower than this many pixels, so it does not cover nodes on phones (default 480). 0 always shows it. */
|
|
142
142
|
minimapMinWidth?: number;
|
|
143
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Custom node components by `node.type`. Each is a snippet receiving `{ node, selected, dragging, update }` and draws the whole node.
|
|
145
|
+
* The node box is bare (no fill) and its text inherits `--tr-on-surface`: paint a surface with tokens (`--tr-surface-container-low`,
|
|
146
|
+
* `--tr-outline-variant`), not fixed colours, or dark mode and themes put light text on your light fill.
|
|
147
|
+
*/
|
|
144
148
|
nodeTypes?: Record<string, NodeRenderer>;
|
|
145
149
|
/** Custom component for every node that has no matching `nodeTypes` entry. */
|
|
146
150
|
node?: NodeRenderer;
|
|
@@ -908,5 +912,6 @@
|
|
|
908
912
|
.mmn[data-kind='danger'] { fill: var(--tr-danger); }
|
|
909
913
|
.mmn[data-selected='true'] { stroke: var(--tr-on-surface); stroke-width: 1.5; }
|
|
910
914
|
.mmv { fill: var(--tr-primary); fill-opacity: 0.12; stroke: var(--tr-primary); stroke-width: 1.5; pointer-events: none; }
|
|
911
|
-
|
|
915
|
+
/* the buttons sit at least 24px apart centre to centre (WCAG 2.5.8 spacing): 2px apart, 4px once compact makes them 20px (#292) */
|
|
916
|
+
.controls { position: absolute; right: 8px; top: 8px; display: flex; gap: max(2px, calc(24px - var(--tr-control-h-sm))); padding: 2px; background: var(--tr-surface-container-highest); border: 1px solid var(--tr-outline-variant); border-radius: var(--tr-radius-pill); box-shadow: var(--tr-elevation-2); cursor: default; }
|
|
912
917
|
</style>
|
package/dist/Graph.svelte.d.ts
CHANGED
|
@@ -74,7 +74,11 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class
|
|
|
74
74
|
minimapPosition?: 'bottom-right' | 'bottom-left';
|
|
75
75
|
/** The minimap is hidden while the graph is narrower than this many pixels, so it does not cover nodes on phones (default 480). 0 always shows it. */
|
|
76
76
|
minimapMinWidth?: number;
|
|
77
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Custom node components by `node.type`. Each is a snippet receiving `{ node, selected, dragging, update }` and draws the whole node.
|
|
79
|
+
* The node box is bare (no fill) and its text inherits `--tr-on-surface`: paint a surface with tokens (`--tr-surface-container-low`,
|
|
80
|
+
* `--tr-outline-variant`), not fixed colours, or dark mode and themes put light text on your light fill.
|
|
81
|
+
*/
|
|
78
82
|
nodeTypes?: Record<string, NodeRenderer>;
|
|
79
83
|
/** Custom component for every node that has no matching `nodeTypes` entry. */
|
|
80
84
|
node?: NodeRenderer;
|