system-canvas 0.1.0 → 0.1.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/actions.d.ts +50 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +85 -0
- package/dist/actions.js.map +1 -0
- package/dist/canvas.d.ts +40 -1
- package/dist/canvas.d.ts.map +1 -1
- package/dist/canvas.js +180 -0
- package/dist/canvas.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/lanes.d.ts +50 -0
- package/dist/lanes.d.ts.map +1 -0
- package/dist/lanes.js +129 -0
- package/dist/lanes.js.map +1 -0
- package/dist/paths.d.ts +15 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +41 -0
- package/dist/paths.js.map +1 -0
- package/dist/rendering/index.d.ts +2 -1
- package/dist/rendering/index.d.ts.map +1 -1
- package/dist/rendering/index.js +1 -1
- package/dist/rendering/index.js.map +1 -1
- package/dist/rendering/viewport-math.d.ts +28 -0
- package/dist/rendering/viewport-math.d.ts.map +1 -1
- package/dist/rendering/viewport-math.js +49 -0
- package/dist/rendering/viewport-math.js.map +1 -1
- package/dist/rollup.d.ts +23 -0
- package/dist/rollup.d.ts.map +1 -0
- package/dist/rollup.js +56 -0
- package/dist/rollup.js.map +1 -0
- package/dist/slots.d.ts +65 -0
- package/dist/slots.d.ts.map +1 -0
- package/dist/slots.js +367 -0
- package/dist/slots.js.map +1 -0
- package/dist/themes/blueprint.d.ts.map +1 -1
- package/dist/themes/blueprint.js +13 -1
- package/dist/themes/blueprint.js.map +1 -1
- package/dist/themes/dark.d.ts.map +1 -1
- package/dist/themes/dark.js +13 -1
- package/dist/themes/dark.js.map +1 -1
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +1 -0
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/light.d.ts.map +1 -1
- package/dist/themes/light.js +13 -1
- package/dist/themes/light.js.map +1 -1
- package/dist/themes/midnight.d.ts.map +1 -1
- package/dist/themes/midnight.js +13 -1
- package/dist/themes/midnight.js.map +1 -1
- package/dist/themes/resolve.d.ts.map +1 -1
- package/dist/themes/resolve.js +5 -0
- package/dist/themes/resolve.js.map +1 -1
- package/dist/themes/roadmap.d.ts +13 -0
- package/dist/themes/roadmap.d.ts.map +1 -0
- package/dist/themes/roadmap.js +264 -0
- package/dist/themes/roadmap.js.map +1 -0
- package/dist/themes/warm.d.ts.map +1 -1
- package/dist/themes/warm.js +13 -1
- package/dist/themes/warm.js.map +1 -1
- package/dist/types.d.ts +419 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CanvasNode, CanvasTheme, NodeAction, NodeActionGroup, NodeUpdate } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a NodeAction's patch against the given node.
|
|
4
|
+
*
|
|
5
|
+
* Actions may declare their patch as a static object or as a function
|
|
6
|
+
* that receives the current node — the function form enables toggles,
|
|
7
|
+
* cycles, and customData merges.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveActionPatch(action: NodeAction, node: CanvasNode): NodeUpdate;
|
|
10
|
+
/**
|
|
11
|
+
* Build the default action group used when a theme does not declare its
|
|
12
|
+
* own `nodeActions`. Renders the theme's preset colors "1".."6" as
|
|
13
|
+
* swatches that patch the node's `color`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildDefaultColorActions(theme: CanvasTheme): NodeActionGroup;
|
|
16
|
+
/**
|
|
17
|
+
* Return the effective list of action groups for a theme. Themes that
|
|
18
|
+
* declare `nodeActions` win; otherwise a generic color-swatch group is
|
|
19
|
+
* synthesized from `presetColors`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getNodeActions(theme: CanvasTheme): NodeActionGroup[];
|
|
22
|
+
/**
|
|
23
|
+
* Filter a group's actions against a specific node using each action's
|
|
24
|
+
* `appliesTo` predicate (actions without `appliesTo` always apply).
|
|
25
|
+
*/
|
|
26
|
+
export declare function filterActionsForNode(group: NodeActionGroup, node: CanvasNode): NodeAction[];
|
|
27
|
+
/**
|
|
28
|
+
* Resolve the effective toolbar action groups for a specific node.
|
|
29
|
+
*
|
|
30
|
+
* Precedence:
|
|
31
|
+
* 1. The node's category defines `toolbar` → use it (no merge).
|
|
32
|
+
* 2. Otherwise fall back to `getNodeActions(theme)`.
|
|
33
|
+
*
|
|
34
|
+
* This is the per-node version of `getNodeActions`, used by `NodeToolbar`
|
|
35
|
+
* so categories can own their toolbar alongside their visuals.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getNodeActionsForNode(node: CanvasNode, theme: CanvasTheme): NodeActionGroup[];
|
|
38
|
+
/**
|
|
39
|
+
* Build the default toolbar groups for a theme — the same value
|
|
40
|
+
* `getNodeActions` would return when no `nodeActions` is declared.
|
|
41
|
+
*
|
|
42
|
+
* Exposed so categories can spread the default into their own toolbar
|
|
43
|
+
* without duplicating the color-swatch construction:
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* toolbar: [...buildDefaultToolbar(theme), { id: 'status', ... }]
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildDefaultToolbar(theme: CanvasTheme): NodeActionGroup[];
|
|
50
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,UAAU,EACX,MAAM,YAAY,CAAA;AAEnB;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,GACf,UAAU,CAEZ;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,CAkB5E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,EAAE,CAKpE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,UAAU,GACf,UAAU,EAAE,CAEd;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,WAAW,GACjB,eAAe,EAAE,CAMnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,EAAE,CAEzE"}
|
package/dist/actions.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a NodeAction's patch against the given node.
|
|
3
|
+
*
|
|
4
|
+
* Actions may declare their patch as a static object or as a function
|
|
5
|
+
* that receives the current node — the function form enables toggles,
|
|
6
|
+
* cycles, and customData merges.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveActionPatch(action, node) {
|
|
9
|
+
return typeof action.patch === 'function' ? action.patch(node) : action.patch;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Build the default action group used when a theme does not declare its
|
|
13
|
+
* own `nodeActions`. Renders the theme's preset colors "1".."6" as
|
|
14
|
+
* swatches that patch the node's `color`.
|
|
15
|
+
*/
|
|
16
|
+
export function buildDefaultColorActions(theme) {
|
|
17
|
+
const keys = Object.keys(theme.presetColors).sort();
|
|
18
|
+
const actions = keys.map((key) => {
|
|
19
|
+
const preset = theme.presetColors[key];
|
|
20
|
+
return {
|
|
21
|
+
id: `color-${key}`,
|
|
22
|
+
label: `Color ${key}`,
|
|
23
|
+
swatch: preset.stroke,
|
|
24
|
+
patch: { color: key },
|
|
25
|
+
isActive: (n) => n.color === key,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
id: 'color',
|
|
30
|
+
label: 'Color',
|
|
31
|
+
kind: 'swatches',
|
|
32
|
+
actions,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Return the effective list of action groups for a theme. Themes that
|
|
37
|
+
* declare `nodeActions` win; otherwise a generic color-swatch group is
|
|
38
|
+
* synthesized from `presetColors`.
|
|
39
|
+
*/
|
|
40
|
+
export function getNodeActions(theme) {
|
|
41
|
+
if (theme.nodeActions && theme.nodeActions.length > 0) {
|
|
42
|
+
return theme.nodeActions;
|
|
43
|
+
}
|
|
44
|
+
return [buildDefaultColorActions(theme)];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Filter a group's actions against a specific node using each action's
|
|
48
|
+
* `appliesTo` predicate (actions without `appliesTo` always apply).
|
|
49
|
+
*/
|
|
50
|
+
export function filterActionsForNode(group, node) {
|
|
51
|
+
return group.actions.filter((a) => !a.appliesTo || a.appliesTo(node));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the effective toolbar action groups for a specific node.
|
|
55
|
+
*
|
|
56
|
+
* Precedence:
|
|
57
|
+
* 1. The node's category defines `toolbar` → use it (no merge).
|
|
58
|
+
* 2. Otherwise fall back to `getNodeActions(theme)`.
|
|
59
|
+
*
|
|
60
|
+
* This is the per-node version of `getNodeActions`, used by `NodeToolbar`
|
|
61
|
+
* so categories can own their toolbar alongside their visuals.
|
|
62
|
+
*/
|
|
63
|
+
export function getNodeActionsForNode(node, theme) {
|
|
64
|
+
if (node.category) {
|
|
65
|
+
const def = theme.categories?.[node.category];
|
|
66
|
+
if (def?.toolbar && def.toolbar.length > 0)
|
|
67
|
+
return def.toolbar;
|
|
68
|
+
}
|
|
69
|
+
return getNodeActions(theme);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build the default toolbar groups for a theme — the same value
|
|
73
|
+
* `getNodeActions` would return when no `nodeActions` is declared.
|
|
74
|
+
*
|
|
75
|
+
* Exposed so categories can spread the default into their own toolbar
|
|
76
|
+
* without duplicating the color-swatch construction:
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* toolbar: [...buildDefaultToolbar(theme), { id: 'status', ... }]
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export function buildDefaultToolbar(theme) {
|
|
83
|
+
return theme.nodeActions ?? [buildDefaultColorActions(theme)];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAkB,EAClB,IAAgB;IAEhB,OAAO,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;AAC/E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAkB;IACzD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,OAAO,GAAiB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QACtC,OAAO;YACL,EAAE,EAAE,SAAS,GAAG,EAAE;YAClB,KAAK,EAAE,SAAS,GAAG,EAAE;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;YACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG;SACjC,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO;QACL,EAAE,EAAE,OAAO;QACX,KAA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+
import type { CanvasData, CanvasNode, CanvasEdge, ResolvedNode, CanvasTheme, NodeUpdate, EdgeUpdate, NodeMenuOption } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Resolve all nodes in a canvas, applying category defaults and color resolution.
|
|
4
4
|
*
|
|
@@ -25,4 +25,43 @@ export declare function getGroupChildren(group: ResolvedNode, allNodes: Resolved
|
|
|
25
25
|
* Validate a canvas document. Returns an array of error messages (empty if valid).
|
|
26
26
|
*/
|
|
27
27
|
export declare function validateCanvas(canvas: CanvasData): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Generate a unique node id. Uses crypto.randomUUID() when available,
|
|
30
|
+
* else falls back to a random base36 string.
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateNodeId(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Build the list of options that should appear in the add-node menu:
|
|
35
|
+
* first every merged category (theme + canvas-level) with its visual
|
|
36
|
+
* treatment, then the four base JSON Canvas node types.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getNodeMenuOptions(canvas: CanvasData, theme: CanvasTheme): NodeMenuOption[];
|
|
39
|
+
/**
|
|
40
|
+
* Build a new CanvasNode for the given menu option at (x, y).
|
|
41
|
+
* Dimensions come from the theme category when applicable; otherwise
|
|
42
|
+
* sensible defaults are used.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createNodeFromOption(option: NodeMenuOption, x: number, y: number, id?: string,
|
|
45
|
+
/**
|
|
46
|
+
* Optional theme — when provided and the option is a category, the
|
|
47
|
+
* category's `defaultCustomData` is deep-cloned onto the new node so
|
|
48
|
+
* consumers don't have to wire this themselves. Deep cloning uses
|
|
49
|
+
* `structuredClone` when available so two new nodes never share nested
|
|
50
|
+
* references.
|
|
51
|
+
*/
|
|
52
|
+
theme?: CanvasTheme): CanvasNode;
|
|
53
|
+
/** Append a node to a canvas, returning a new CanvasData. */
|
|
54
|
+
export declare function addNode(canvas: CanvasData, node: CanvasNode): CanvasData;
|
|
55
|
+
/** Generate a unique edge id. */
|
|
56
|
+
export declare function generateEdgeId(): string;
|
|
57
|
+
/** Append an edge to a canvas, returning a new CanvasData. */
|
|
58
|
+
export declare function addEdge(canvas: CanvasData, edge: CanvasEdge): CanvasData;
|
|
59
|
+
/** Patch a node by id. Returns the same reference if the node is not found. */
|
|
60
|
+
export declare function updateNode(canvas: CanvasData, nodeId: string, patch: NodeUpdate): CanvasData;
|
|
61
|
+
/** Remove a node AND any edges that reference it. */
|
|
62
|
+
export declare function removeNode(canvas: CanvasData, nodeId: string): CanvasData;
|
|
63
|
+
/** Patch an edge by id. Returns the same reference if the edge is not found. */
|
|
64
|
+
export declare function updateEdge(canvas: CanvasData, edgeId: string, patch: EdgeUpdate): CanvasData;
|
|
65
|
+
/** Remove an edge by id. */
|
|
66
|
+
export declare function removeEdge(canvas: CanvasData, edgeId: string): CanvasData;
|
|
28
67
|
//# sourceMappingURL=canvas.d.ts.map
|
package/dist/canvas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EAEf,MAAM,YAAY,CAAA;AAiBnB;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,WAAW,GACjB;IAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CAYhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAM3B;AAED;;GAEG;AACH,wBAAgB,YAAY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wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAGzE"}
|
package/dist/canvas.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { resolveNode } from './themes/resolve.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deep-clone a plain JSON-ish value. Prefers `structuredClone` (available
|
|
4
|
+
* in modern runtimes and Node 17+); falls back to JSON round-trip for
|
|
5
|
+
* environments that lack it. Used for per-instance cloning of a category's
|
|
6
|
+
* `defaultCustomData` so two new nodes can't share nested references.
|
|
7
|
+
*/
|
|
8
|
+
function deepClone(value) {
|
|
9
|
+
const g = globalThis;
|
|
10
|
+
if (typeof g.structuredClone === 'function') {
|
|
11
|
+
return g.structuredClone(value);
|
|
12
|
+
}
|
|
13
|
+
return JSON.parse(JSON.stringify(value));
|
|
14
|
+
}
|
|
2
15
|
/**
|
|
3
16
|
* Resolve all nodes in a canvas, applying category defaults and color resolution.
|
|
4
17
|
*
|
|
@@ -92,4 +105,171 @@ export function validateCanvas(canvas) {
|
|
|
92
105
|
}
|
|
93
106
|
return errors;
|
|
94
107
|
}
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Editing helpers
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
/**
|
|
112
|
+
* Generate a unique node id. Uses crypto.randomUUID() when available,
|
|
113
|
+
* else falls back to a random base36 string.
|
|
114
|
+
*/
|
|
115
|
+
export function generateNodeId() {
|
|
116
|
+
const g = globalThis;
|
|
117
|
+
if (g.crypto?.randomUUID) {
|
|
118
|
+
return g.crypto.randomUUID();
|
|
119
|
+
}
|
|
120
|
+
return ('n_' +
|
|
121
|
+
Math.random().toString(36).slice(2, 10) +
|
|
122
|
+
Math.random().toString(36).slice(2, 6));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Build the list of options that should appear in the add-node menu:
|
|
126
|
+
* first every merged category (theme + canvas-level) with its visual
|
|
127
|
+
* treatment, then the four base JSON Canvas node types.
|
|
128
|
+
*/
|
|
129
|
+
export function getNodeMenuOptions(canvas, theme) {
|
|
130
|
+
const mergedCategories = {
|
|
131
|
+
...theme.categories,
|
|
132
|
+
...(canvas.theme?.categories ?? {}),
|
|
133
|
+
};
|
|
134
|
+
const categoryOptions = Object.entries(mergedCategories).map(([key, def]) => ({
|
|
135
|
+
kind: 'category',
|
|
136
|
+
value: key,
|
|
137
|
+
label: key,
|
|
138
|
+
icon: def.icon ?? null,
|
|
139
|
+
fill: def.fill,
|
|
140
|
+
stroke: def.stroke,
|
|
141
|
+
nodeType: def.type ?? 'text',
|
|
142
|
+
}));
|
|
143
|
+
const baseTypes = ['text', 'file', 'link', 'group'];
|
|
144
|
+
const typeOptions = baseTypes.map((t) => ({
|
|
145
|
+
kind: 'type',
|
|
146
|
+
value: t,
|
|
147
|
+
label: t,
|
|
148
|
+
nodeType: t,
|
|
149
|
+
}));
|
|
150
|
+
return [...categoryOptions, ...typeOptions];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Build a new CanvasNode for the given menu option at (x, y).
|
|
154
|
+
* Dimensions come from the theme category when applicable; otherwise
|
|
155
|
+
* sensible defaults are used.
|
|
156
|
+
*/
|
|
157
|
+
export function createNodeFromOption(option, x, y, id = generateNodeId(),
|
|
158
|
+
/**
|
|
159
|
+
* Optional theme — when provided and the option is a category, the
|
|
160
|
+
* category's `defaultCustomData` is deep-cloned onto the new node so
|
|
161
|
+
* consumers don't have to wire this themselves. Deep cloning uses
|
|
162
|
+
* `structuredClone` when available so two new nodes never share nested
|
|
163
|
+
* references.
|
|
164
|
+
*/
|
|
165
|
+
theme) {
|
|
166
|
+
const base = {
|
|
167
|
+
id,
|
|
168
|
+
type: option.nodeType,
|
|
169
|
+
x,
|
|
170
|
+
y,
|
|
171
|
+
};
|
|
172
|
+
if (option.kind === 'category') {
|
|
173
|
+
base.category = option.value;
|
|
174
|
+
const def = theme?.categories?.[option.value];
|
|
175
|
+
if (def?.defaultCustomData) {
|
|
176
|
+
base.customData = deepClone(def.defaultCustomData);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Provide reasonable type-specific starter content / dimensions.
|
|
180
|
+
switch (option.nodeType) {
|
|
181
|
+
case 'text':
|
|
182
|
+
base.text = base.text ?? 'New node';
|
|
183
|
+
if (option.kind === 'type') {
|
|
184
|
+
base.width = 140;
|
|
185
|
+
base.height = 60;
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case 'file':
|
|
189
|
+
base.file = '';
|
|
190
|
+
if (option.kind === 'type') {
|
|
191
|
+
base.width = 160;
|
|
192
|
+
base.height = 52;
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
195
|
+
case 'link':
|
|
196
|
+
base.url = '';
|
|
197
|
+
if (option.kind === 'type') {
|
|
198
|
+
base.width = 200;
|
|
199
|
+
base.height = 60;
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
case 'group':
|
|
203
|
+
base.label = option.kind === 'category' ? option.value : 'New group';
|
|
204
|
+
if (option.kind === 'type') {
|
|
205
|
+
base.width = 300;
|
|
206
|
+
base.height = 200;
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
return base;
|
|
211
|
+
}
|
|
212
|
+
/** Append a node to a canvas, returning a new CanvasData. */
|
|
213
|
+
export function addNode(canvas, node) {
|
|
214
|
+
return {
|
|
215
|
+
...canvas,
|
|
216
|
+
nodes: [...(canvas.nodes ?? []), node],
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/** Generate a unique edge id. */
|
|
220
|
+
export function generateEdgeId() {
|
|
221
|
+
const g = globalThis;
|
|
222
|
+
if (g.crypto?.randomUUID) {
|
|
223
|
+
return g.crypto.randomUUID();
|
|
224
|
+
}
|
|
225
|
+
return ('e_' +
|
|
226
|
+
Math.random().toString(36).slice(2, 10) +
|
|
227
|
+
Math.random().toString(36).slice(2, 6));
|
|
228
|
+
}
|
|
229
|
+
/** Append an edge to a canvas, returning a new CanvasData. */
|
|
230
|
+
export function addEdge(canvas, edge) {
|
|
231
|
+
return {
|
|
232
|
+
...canvas,
|
|
233
|
+
edges: [...(canvas.edges ?? []), edge],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** Patch a node by id. Returns the same reference if the node is not found. */
|
|
237
|
+
export function updateNode(canvas, nodeId, patch) {
|
|
238
|
+
const nodes = canvas.nodes ?? [];
|
|
239
|
+
let changed = false;
|
|
240
|
+
const next = nodes.map((n) => {
|
|
241
|
+
if (n.id !== nodeId)
|
|
242
|
+
return n;
|
|
243
|
+
changed = true;
|
|
244
|
+
return { ...n, ...patch };
|
|
245
|
+
});
|
|
246
|
+
if (!changed)
|
|
247
|
+
return canvas;
|
|
248
|
+
return { ...canvas, nodes: next };
|
|
249
|
+
}
|
|
250
|
+
/** Remove a node AND any edges that reference it. */
|
|
251
|
+
export function removeNode(canvas, nodeId) {
|
|
252
|
+
const nodes = (canvas.nodes ?? []).filter((n) => n.id !== nodeId);
|
|
253
|
+
const edges = (canvas.edges ?? []).filter((e) => e.fromNode !== nodeId && e.toNode !== nodeId);
|
|
254
|
+
return { ...canvas, nodes, edges };
|
|
255
|
+
}
|
|
256
|
+
/** Patch an edge by id. Returns the same reference if the edge is not found. */
|
|
257
|
+
export function updateEdge(canvas, edgeId, patch) {
|
|
258
|
+
const edges = canvas.edges ?? [];
|
|
259
|
+
let changed = false;
|
|
260
|
+
const next = edges.map((e) => {
|
|
261
|
+
if (e.id !== edgeId)
|
|
262
|
+
return e;
|
|
263
|
+
changed = true;
|
|
264
|
+
return { ...e, ...patch };
|
|
265
|
+
});
|
|
266
|
+
if (!changed)
|
|
267
|
+
return canvas;
|
|
268
|
+
return { ...canvas, edges: next };
|
|
269
|
+
}
|
|
270
|
+
/** Remove an edge by id. */
|
|
271
|
+
export function removeEdge(canvas, edgeId) {
|
|
272
|
+
const edges = (canvas.edges ?? []).filter((e) => e.id !== edgeId);
|
|
273
|
+
return { ...canvas, edges };
|
|
274
|
+
}
|
|
95
275
|
//# sourceMappingURL=canvas.js.map
|
package/dist/canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD;;;;;GAKG;AACH,SAAS,SAAS,CAAI,KAAQ;IAC5B,MAAM,CAAC,GAAQ,UAAiB,CAAA;IAChC,IAAI,OAAO,CAAC,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAC5C,OAAO,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAM,CAAA;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkB,EAClB,KAAkB;IAElB,+CAA+C;IAC/C,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU;QAC7C,CAAC,CAAC;YACE,GAAG,KAAK;YACR,UAAU,EAAE,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE;SAChE;QACH,CAAC,CAAC,KAAK,CAAA;IAET,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAA;IAC7E,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAA;IAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,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AG,CAAC,EAAE,GAAG,KAAK,EAAE,CAAA;IAC3B,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,OAAO;QAAE,OAAO,MAAM,CAAA;IAC3B,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACnC,CAAC;AAED,4BAA4B;AAC5B,MAAM,UAAU,UAAU,CAAC,MAAkB,EAAE,MAAc;IAC3D,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAA;IACjE,OAAO,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAA;AAC7B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
export type { CanvasColor, NodeType, Side, EndShape, EdgeStyle, BackgroundStyle, CanvasNode, CanvasEdge, CanvasData, CanvasThemeHint, CategoryDefinition, PresetColor, GridConfig, RefIndicatorConfig, NodeTheme, EdgeTheme, GroupTheme, BreadcrumbTheme, CanvasTheme, ResolvedNode, AnchorPoint, ViewportState, BreadcrumbEntry, BoundingBox, ContextMenuEvent, } from './types.js';
|
|
2
|
-
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
3
|
-
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
4
|
-
export {
|
|
1
|
+
export type { CanvasColor, NodeType, Side, EndShape, EdgeStyle, BackgroundStyle, CanvasNode, CanvasEdge, CanvasData, CanvasThemeHint, CategoryDefinition, PresetColor, GridConfig, RefIndicatorConfig, NodeTheme, EdgeTheme, GroupTheme, BreadcrumbTheme, LanesTheme, CanvasLane, CanvasTheme, ResolvedNode, AnchorPoint, ViewportState, BreadcrumbEntry, BoundingBox, ContextMenuEvent, NodeUpdate, EdgeUpdate, NodeMenuOption, NodeAction, NodeActionGroup, SlotPosition, CategorySlots, SlotSpec, ColorSlot, ProgressSlot, CountSlot, TextSlot, DotSlot, PillSlot, CustomSlot, NodeAccessor, SlotContext, SlotRect, RollupResult, EditableField, EditableFieldKind, } from './types.js';
|
|
2
|
+
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, roadmapTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
3
|
+
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, fitBoundsIntoRect, canvasRectToScreenRect, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
4
|
+
export type { Rect } from './rendering/index.js';
|
|
5
|
+
export { findLaneAt, snapToLane, evenLanes, lanesExtent } from './lanes.js';
|
|
6
|
+
export { resolveActionPatch, buildDefaultColorActions, getNodeActions, getNodeActionsForNode, buildDefaultToolbar, filterActionsForNode, } from './actions.js';
|
|
7
|
+
export { rollupNodes, rollupNodesDeep } from './rollup.js';
|
|
8
|
+
export { computeCategorySlotRegions, resolveAccessor, resolveAccessorOr, getCategorySlots, pickRefIndicatorCorner, slotEntries, computeReflowReservations, } from './slots.js';
|
|
9
|
+
export type { ReflowReservations } from './slots.js';
|
|
10
|
+
export { getAtPath, setAtPath } from './paths.js';
|
|
11
|
+
export { resolveCanvas, buildNodeMap, getNodeLabel, getGroupChildren, validateCanvas, generateNodeId, getNodeMenuOptions, createNodeFromOption, addNode, updateNode, removeNode, generateEdgeId, addEdge, updateEdge, removeEdge, } from './canvas.js';
|
|
5
12
|
export declare const themes: {
|
|
6
13
|
readonly dark: import("./types.js").CanvasTheme;
|
|
7
14
|
readonly midnight: import("./types.js").CanvasTheme;
|
|
8
15
|
readonly light: import("./types.js").CanvasTheme;
|
|
9
16
|
readonly blueprint: import("./types.js").CanvasTheme;
|
|
10
17
|
readonly warm: import("./types.js").CanvasTheme;
|
|
18
|
+
readonly roadmap: import("./types.js").CanvasTheme;
|
|
11
19
|
};
|
|
12
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,eAAe,EAEf,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAGhD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG3E,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAG1D,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,GAC1B,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGjD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,UAAU,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAA;AAUpB,eAAO,MAAM,MAAM;;;;;;;CAOT,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
// Themes
|
|
2
|
-
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
2
|
+
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, roadmapTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
3
3
|
// Rendering utilities
|
|
4
|
-
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
4
|
+
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, fitBoundsIntoRect, canvasRectToScreenRect, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
5
|
+
// Lane helpers
|
|
6
|
+
export { findLaneAt, snapToLane, evenLanes, lanesExtent } from './lanes.js';
|
|
7
|
+
// Action helpers
|
|
8
|
+
export { resolveActionPatch, buildDefaultColorActions, getNodeActions, getNodeActionsForNode, buildDefaultToolbar, filterActionsForNode, } from './actions.js';
|
|
9
|
+
// Rollup helpers
|
|
10
|
+
export { rollupNodes, rollupNodesDeep } from './rollup.js';
|
|
11
|
+
// Category-slot helpers
|
|
12
|
+
export { computeCategorySlotRegions, resolveAccessor, resolveAccessorOr, getCategorySlots, pickRefIndicatorCorner, slotEntries, computeReflowReservations, } from './slots.js';
|
|
13
|
+
// Path utilities (for form editor field paths like 'customData.status')
|
|
14
|
+
export { getAtPath, setAtPath } from './paths.js';
|
|
5
15
|
// Canvas helpers
|
|
6
|
-
export { resolveCanvas, buildNodeMap, getNodeLabel, getGroupChildren, validateCanvas, } from './canvas.js';
|
|
16
|
+
export { resolveCanvas, buildNodeMap, getNodeLabel, getGroupChildren, validateCanvas, generateNodeId, getNodeMenuOptions, createNodeFromOption, addNode, updateNode, removeNode, generateEdgeId, addEdge, updateEdge, removeEdge, } from './canvas.js';
|
|
7
17
|
// Convenience theme collection
|
|
8
18
|
import { darkTheme as _dark } from './themes/dark.js';
|
|
9
19
|
import { midnightTheme as _midnight } from './themes/midnight.js';
|
|
10
20
|
import { lightTheme as _light } from './themes/light.js';
|
|
11
21
|
import { blueprintTheme as _blueprint } from './themes/blueprint.js';
|
|
12
22
|
import { warmTheme as _warm } from './themes/warm.js';
|
|
23
|
+
import { roadmapTheme as _roadmap } from './themes/roadmap.js';
|
|
13
24
|
export const themes = {
|
|
14
25
|
dark: _dark,
|
|
15
26
|
midnight: _midnight,
|
|
16
27
|
light: _light,
|
|
17
28
|
blueprint: _blueprint,
|
|
18
29
|
warm: _warm,
|
|
30
|
+
roadmap: _roadmap,
|
|
19
31
|
};
|
|
20
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqDA,SAAS;AACT,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAE1B,sBAAsB;AACtB,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAA;AAG7B,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE3E,iBAAiB;AACjB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAA;AAErB,iBAAiB;AACjB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,wBAAwB;AACxB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,GAC1B,MAAM,YAAY,CAAA;AAGnB,wEAAwE;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEjD,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,UAAU,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAA;AAEpB,+BAA+B;AAC/B,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,QAAQ;CACT,CAAA"}
|
package/dist/lanes.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CanvasLane } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Find the lane (if any) that contains the given position along its axis.
|
|
4
|
+
*
|
|
5
|
+
* For `columns`, pass the node's x (or x + width/2). For `rows`, pass y.
|
|
6
|
+
* Returns the first matching lane, or null if the position sits outside
|
|
7
|
+
* every lane.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findLaneAt(pos: number, lanes: CanvasLane[] | undefined): CanvasLane | null;
|
|
10
|
+
/**
|
|
11
|
+
* Snap a position to a lane boundary.
|
|
12
|
+
*
|
|
13
|
+
* `edge: 'start'` (default) snaps to the lane's start edge — useful for
|
|
14
|
+
* snapping a node's x/y when you want nodes to left/top-align in their lane.
|
|
15
|
+
* `edge: 'center'` snaps so an object of the given `size` is centered
|
|
16
|
+
* within the lane — useful when nodes sit visually centered in their row
|
|
17
|
+
* or column. Requires `size` to behave as expected; falls back to `start`
|
|
18
|
+
* behavior when `size` is 0.
|
|
19
|
+
* `edge: 'nearest'` snaps to whichever boundary (start, end, or any interior
|
|
20
|
+
* divider between two adjacent lanes) is closest — useful when the user
|
|
21
|
+
* drags across lane borders.
|
|
22
|
+
*
|
|
23
|
+
* If `size` is provided, the input is treated as the leading edge of an
|
|
24
|
+
* object of that size, and the snap target accounts for keeping the object
|
|
25
|
+
* fully inside a single lane when possible.
|
|
26
|
+
*
|
|
27
|
+
* Returns `pos` unchanged when `lanes` is empty or the position falls
|
|
28
|
+
* outside every lane (nothing meaningful to snap to).
|
|
29
|
+
*/
|
|
30
|
+
export declare function snapToLane(pos: number, lanes: CanvasLane[] | undefined, options?: {
|
|
31
|
+
edge?: 'start' | 'center' | 'nearest';
|
|
32
|
+
size?: number;
|
|
33
|
+
}): number;
|
|
34
|
+
/**
|
|
35
|
+
* Convenience: produce a set of equally-sized lanes from an array of labels.
|
|
36
|
+
*
|
|
37
|
+
* Consumers that don't want to compute pixel positions can write
|
|
38
|
+
* `evenLanes(['Now', 'Next', 'Later'])` and get three 400-wide lanes
|
|
39
|
+
* starting at x = 0.
|
|
40
|
+
*/
|
|
41
|
+
export declare function evenLanes(labels: string[], size?: number, start?: number): CanvasLane[];
|
|
42
|
+
/**
|
|
43
|
+
* Total extent covered by a lane list (from first.start to last end).
|
|
44
|
+
* Returns 0 when the list is empty.
|
|
45
|
+
*/
|
|
46
|
+
export declare function lanesExtent(lanes: CanvasLane[] | undefined): {
|
|
47
|
+
start: number;
|
|
48
|
+
end: number;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=lanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lanes.d.ts","sourceRoot":"","sources":["../src/lanes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,GAC9B,UAAU,GAAG,IAAI,CAMnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,EAC/B,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACrE,MAAM,CA0DR;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,GAAE,MAAY,EAClB,KAAK,GAAE,MAAU,GAChB,UAAU,EAAE,CAOd;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,GAC9B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAShC"}
|