@bemedev/mind-flow 0.1.1 → 0.3.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/README.md +10 -10
- package/lib/helpers/createContext.d.ts +7 -2
- package/lib/helpers/createContext.d.ts.map +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +556 -510
- package/lib/output.css +1 -1
- package/lib/server.cjs.js +645 -418
- package/lib/server.es.js +649 -422
- package/lib/services/main.machine.d.ts +4857 -218
- package/lib/services/main.machine.d.ts.map +1 -1
- package/lib/{ui/components/FlowChart.data.d.ts → services/main.machine.data.d.ts} +4 -2
- package/lib/services/main.machine.data.d.ts.map +1 -0
- package/lib/services/main.machine.helpers.d.ts +32 -0
- package/lib/services/main.machine.helpers.d.ts.map +1 -0
- package/lib/services/main.machine.typings.d.ts +126 -0
- package/lib/services/main.machine.typings.d.ts.map +1 -0
- package/lib/ui/Flow.d.ts +2 -0
- package/lib/ui/Flow.d.ts.map +1 -1
- package/lib/ui/components/Bounds.d.ts +2 -0
- package/lib/ui/components/Bounds.d.ts.map +1 -1
- package/lib/ui/components/EdgeComponent.d.ts +3 -2
- package/lib/ui/components/EdgeComponent.d.ts.map +1 -1
- package/lib/ui/components/EdgesBoard.d.ts +2 -0
- package/lib/ui/components/EdgesBoard.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.context.d.ts +5608 -996
- package/lib/ui/components/FlowChart.context.d.ts.map +1 -1
- package/lib/ui/components/FlowChart.d.ts +3 -1
- package/lib/ui/components/FlowChart.d.ts.map +1 -1
- package/lib/ui/components/NodeComponent.d.ts +2 -10
- package/lib/ui/components/NodeComponent.d.ts.map +1 -1
- package/lib/ui/components/NodesBoard.d.ts +2 -0
- package/lib/ui/components/NodesBoard.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/helpers/createContext.ts +7 -2
- package/src/{ui/components/FlowChart.data.ts → services/main.machine.data.ts} +3 -1
- package/src/services/main.machine.helpers.ts +55 -0
- package/src/services/main.machine.ts +288 -70
- package/src/services/main.machine.typings.ts +98 -0
- package/src/ui/Flow.tsx +2 -0
- package/src/ui/components/Bounds.tsx +13 -8
- package/src/ui/components/EdgeComponent.tsx +78 -56
- package/src/ui/components/EdgesBoard.tsx +13 -36
- package/src/ui/components/FlowChart.context.ts +204 -310
- package/src/ui/components/FlowChart.tsx +16 -16
- package/src/ui/components/NodeComponent.tsx +60 -104
- package/src/ui/components/NodesBoard.tsx +74 -47
- package/src/ui/components/classes.ts +1 -1
- package/lib/services/main.typings.d.ts +0 -68
- package/lib/services/main.typings.d.ts.map +0 -1
- package/lib/ui/components/FlowChart.data.d.ts.map +0 -1
- package/src/services/main.typings.ts +0 -50
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowChart.context.d.ts","sourceRoot":"","sources":["../../../src/ui/components/FlowChart.context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlowChart.context.d.ts","sourceRoot":"","sources":["../../../src/ui/components/FlowChart.context.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAO,QAAQ,sCAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkHV,CAAC;;;;mBACT,CAAC;;;;oBAEF,CAAZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;GA4HC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inferT } from '@bemedev/app/typings';
|
|
2
2
|
import { Component } from 'solid-js';
|
|
3
|
-
import { edgeJSON, nodeJSON } from '../../services/main.typings';
|
|
3
|
+
import { edgeJSON, nodeJSON } from '../../services/main.machine.typings';
|
|
4
4
|
/** Serialized node properties type inferred from schema {@linkcode nodeJSON}. */
|
|
5
5
|
export type NodeProps = inferT<typeof nodeJSON>;
|
|
6
6
|
/** Serialized edge properties type inferred from schema {@linkcode edgeJSON}. */
|
|
@@ -52,6 +52,8 @@ export type FlowProps = {
|
|
|
52
52
|
* {@linkcode FlowProps}.
|
|
53
53
|
*
|
|
54
54
|
* @returns The rendered Solid component.
|
|
55
|
+
*
|
|
56
|
+
* @see {@linkcode NodesBoard}, {@linkcode useFlow}, {@linkcode DEFAULT_NODES}
|
|
55
57
|
*/
|
|
56
58
|
export declare const FlowChart: Component<FlowProps>;
|
|
57
59
|
//# sourceMappingURL=FlowChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowChart.d.ts","sourceRoot":"","sources":["../../../src/ui/components/FlowChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlowChart.d.ts","sourceRoot":"","sources":["../../../src/ui/components/FlowChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAI9E,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,kEAAkE;IAClE,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,CAAC,SAAS,GAAG;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,EAAE,CAAC;QACvC,KAAK,CAAC,EAAE,CAAC,SAAS,GAAG;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,EAAE,CAAC;KACxC,CAAC;IACF;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC;AAIF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,SAAS,CA0C1C,CAAC"}
|
|
@@ -10,16 +10,6 @@ declare module 'solid-js' {
|
|
|
10
10
|
type Props = {
|
|
11
11
|
/** Unique identifier of the node. */
|
|
12
12
|
id: string;
|
|
13
|
-
/** Horizontal position of the node in board coordinates. */
|
|
14
|
-
x: number;
|
|
15
|
-
/** Vertical position of the node in board coordinates. */
|
|
16
|
-
y: number;
|
|
17
|
-
/** Optional header label for the node. */
|
|
18
|
-
label?: string;
|
|
19
|
-
/** Body content text of the node. */
|
|
20
|
-
content: string;
|
|
21
|
-
/** Whether the node has an input handle. */
|
|
22
|
-
input: boolean;
|
|
23
13
|
};
|
|
24
14
|
/**
|
|
25
15
|
* Interactive flowchart node component supporting dragging, selection, handle
|
|
@@ -28,6 +18,8 @@ type Props = {
|
|
|
28
18
|
* @param props - Node rendering properties of type {@linkcode Props}.
|
|
29
19
|
*
|
|
30
20
|
* @returns The rendered Solid component.
|
|
21
|
+
*
|
|
22
|
+
* @see {@linkcode useFlow}, {@linkcode HANDLE_CONTAINER_OFFSET_X}, {@linkcode HANDLE_MARGIN_TOP}, {@linkcode HANDLE_SIZE}
|
|
31
23
|
*/
|
|
32
24
|
export declare const NodeComponent: Component<Props>;
|
|
33
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeComponent.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NodeComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeComponent.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NodeComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAQ,MAAM,UAAU,CAAC;AAU3C,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,GAAG,CAAC;QACZ,UAAU,UAAU;YAClB,SAAS,EAAE,GAAG,CAAC;SAChB;KACF;CACF;AAED,uEAAuE;AACvE,KAAK,KAAK,GAAG;IACX,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,KAAK,CAgM1C,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { Component } from 'solid-js';
|
|
|
4
4
|
* panning gestures, and rendered nodes/edges.
|
|
5
5
|
*
|
|
6
6
|
* @returns The rendered Solid component.
|
|
7
|
+
*
|
|
8
|
+
* @see {@linkcode DragBounds}, {@linkcode EdgesBoard}, {@linkcode NodeComponent}, {@linkcode useFlow}, {@linkcode CANVAS_FACTOR}, {@linkcode SCROLL_MULTIPLIER}
|
|
7
9
|
*/
|
|
8
10
|
export declare const NodesBoard: Component;
|
|
9
11
|
//# sourceMappingURL=NodesBoard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodesBoard.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NodesBoard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodesBoard.d.ts","sourceRoot":"","sources":["../../../src/ui/components/NodesBoard.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,SAAS,EAOV,MAAM,UAAU,CAAC;AAQlB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,SA6SxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemedev/mind-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Flow Chart UI library for Solid.js applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"diagram",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"nanoid": "^6.0.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@bemedev/app": "^
|
|
66
|
-
"@bemedev/app-cli": "^
|
|
67
|
-
"@bemedev/app-solidjs": "^
|
|
65
|
+
"@bemedev/app": "^2.5.0",
|
|
66
|
+
"@bemedev/app-cli": "^2.5.0",
|
|
67
|
+
"@bemedev/app-solidjs": "^2.5.1",
|
|
68
68
|
"@bemedev/dev-utils": "^1.2.0",
|
|
69
69
|
"@rollup/plugin-babel": "^7.1.0",
|
|
70
70
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
@@ -82,21 +82,21 @@
|
|
|
82
82
|
"pretty-quick": "^4.2.2",
|
|
83
83
|
"rimraf": "^6.1.3",
|
|
84
84
|
"rolldown": "^1.2.5",
|
|
85
|
-
"rollup": "^4.62.
|
|
85
|
+
"rollup": "^4.62.5",
|
|
86
86
|
"rollup-preset-solid": "^3.0.0",
|
|
87
87
|
"size-limit": "^13.0.3",
|
|
88
88
|
"solid-js": "^1.9.15",
|
|
89
89
|
"tailwindcss": "^4.3.3",
|
|
90
90
|
"tslib": "^2.8.1",
|
|
91
91
|
"typescript": "^7.0.2",
|
|
92
|
-
"vite": "^8.2.
|
|
92
|
+
"vite": "^8.2.2",
|
|
93
93
|
"vite-plugin-dts": "^5.0.3",
|
|
94
94
|
"vite-plugin-solid": "^2.11.14",
|
|
95
95
|
"vitest": "^4.1.11"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@bemedev/app": "^
|
|
99
|
-
"@bemedev/app-solidjs": "^
|
|
98
|
+
"@bemedev/app": "^2.5.0",
|
|
99
|
+
"@bemedev/app-solidjs": "^2.5.1",
|
|
100
100
|
"@thisbeyond/solid-dnd": "^0.7.5",
|
|
101
101
|
"solid-js": "^1.9.15"
|
|
102
102
|
},
|
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
type ParentComponent,
|
|
5
5
|
} from 'solid-js';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Type alias for context options extracted from Solid's
|
|
9
|
+
* {@linkcode createSolidContext}.
|
|
10
|
+
*/
|
|
8
11
|
type Options = Parameters<typeof createSolidContext>[1];
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -16,8 +19,10 @@ type Options = Parameters<typeof createSolidContext>[1];
|
|
|
16
19
|
* `NonNullable<T>`.
|
|
17
20
|
* @param options - Optional context configuration of type {@linkcode Options}.
|
|
18
21
|
*
|
|
19
|
-
* @returns A tuple containing the Provider component of
|
|
22
|
+
* @returns A tuple containing the Provider component of type
|
|
20
23
|
* {@linkcode ParentComponent}, the accessor hook, and the Solid context object.
|
|
24
|
+
*
|
|
25
|
+
* @see {@linkcode createSolidContext}, {@linkcode useContext}
|
|
21
26
|
*/
|
|
22
27
|
export const createContext = <const T>(
|
|
23
28
|
context: () => NonNullable<T>,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeProps } from '
|
|
1
|
+
import type { NodeProps } from '../ui/components/FlowChart';
|
|
2
2
|
|
|
3
3
|
/** Horizontal gap in pixels between a parent node and newly created child node. */
|
|
4
4
|
export const PARENT_CHILD_GAP_WIDTH = 100;
|
|
@@ -47,6 +47,8 @@ export const CONTAINER_DIMENSIONS = { WIDTH: 5000, HEIGHT: 3500 };
|
|
|
47
47
|
* @param width - Node width in pixels, defaults to `0`.
|
|
48
48
|
*
|
|
49
49
|
* @returns 2D offset coordinates for the output handle.
|
|
50
|
+
*
|
|
51
|
+
* @see {@linkcode HANDLE_CENTER_X_OFFSET}, {@linkcode HANDLE_CENTER_Y}
|
|
50
52
|
*/
|
|
51
53
|
export const getDefaultOutputOffset = (width = 0) => ({
|
|
52
54
|
x: width + HANDLE_CENTER_X_OFFSET,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DEFAULT_INPUT_OFFSET, getDefaultOutputOffset } from './main.machine.data';
|
|
2
|
+
import type { Dimension, Point } from './main.machine.typings';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Constructs a unique edge identifier string from source and destination node IDs.
|
|
6
|
+
*
|
|
7
|
+
* @param out - The source node ID string.
|
|
8
|
+
* @param _in - The destination node ID string.
|
|
9
|
+
*
|
|
10
|
+
* @returns Formatted edge identifier string.
|
|
11
|
+
*/
|
|
12
|
+
export const buildEdgeId = (out: string, _in: string) => {
|
|
13
|
+
return `edge = ${out} => ${_in}`;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a formatted node identifier string from a generated ID.
|
|
18
|
+
*
|
|
19
|
+
* @param generated - The generated unique ID string or `null`/`undefined`.
|
|
20
|
+
*
|
|
21
|
+
* @returns Formatted node identifier string.
|
|
22
|
+
*/
|
|
23
|
+
export const buildNodeID = (generated?: string | null) => {
|
|
24
|
+
return `node-${generated}`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Calculates node dimensions, connection points, and handle offsets from position
|
|
29
|
+
* and optional parent dimension.
|
|
30
|
+
*
|
|
31
|
+
* @param position - Node position in board coordinates of type {@linkcode Point}.
|
|
32
|
+
* @param parentDimension - Optional parent node dimension of type
|
|
33
|
+
* {@linkcode Dimension} to inherit sizing and offsets from.
|
|
34
|
+
*
|
|
35
|
+
* @returns Node layout dimension object of type {@linkcode Dimension}.
|
|
36
|
+
*
|
|
37
|
+
* @see {@linkcode getDefaultOutputOffset}, {@linkcode DEFAULT_INPUT_OFFSET}
|
|
38
|
+
*/
|
|
39
|
+
export const calculateDimensions = (
|
|
40
|
+
position: Point,
|
|
41
|
+
parentDimension: Pick<
|
|
42
|
+
Dimension,
|
|
43
|
+
'width' | 'height' | 'outputOffset' | 'inputOffset'
|
|
44
|
+
> = { width: 192, height: 50, inputOffset: DEFAULT_INPUT_OFFSET },
|
|
45
|
+
): Dimension => {
|
|
46
|
+
const width = parentDimension.width;
|
|
47
|
+
const height = parentDimension.height;
|
|
48
|
+
const outputOffset = parentDimension.outputOffset ?? getDefaultOutputOffset(width);
|
|
49
|
+
const inputOffset = parentDimension.inputOffset!;
|
|
50
|
+
|
|
51
|
+
const output = { x: position.x + outputOffset.x, y: position.y + outputOffset.y };
|
|
52
|
+
const input = { x: position.x + inputOffset.x, y: position.y + inputOffset.y };
|
|
53
|
+
|
|
54
|
+
return { width, height, output, input, outputOffset, inputOffset };
|
|
55
|
+
};
|