@statelyai/flow-react 0.6.0 → 0.7.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/README.md +51 -8
- package/dist/esm/backgrounds.d.ts +13 -7
- package/dist/esm/backgrounds.js +1 -95
- package/dist/esm/backgrounds2.js +124 -0
- package/dist/esm/index.d.ts +206 -36
- package/dist/esm/index.js +1109 -221
- package/package.json +14 -11
- package/dist/esm/FlowInstanceContext.js +0 -20
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statelyai/flow-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Thin React adapter for @statelyai/flow with core and DOM re-exports.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
5
7
|
"keywords": [
|
|
6
8
|
"flow",
|
|
7
9
|
"diagram",
|
|
@@ -31,33 +33,34 @@
|
|
|
31
33
|
},
|
|
32
34
|
"license": "MIT",
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"@statelyai/flow
|
|
36
|
+
"use-sync-external-store": "^1.6.0",
|
|
37
|
+
"@statelyai/flow": "0.6.0",
|
|
38
|
+
"@statelyai/flow-dom": "3.2.1"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
41
|
"react": "^18.2.0 || ^19.0.0",
|
|
39
42
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
45
|
+
"@dagrejs/dagre": "^3.0.0",
|
|
42
46
|
"@playwright/test": "^1.60.0",
|
|
43
|
-
"@statelyai/graph": "^2.
|
|
47
|
+
"@statelyai/graph": "^2.1.0",
|
|
44
48
|
"@storybook/addon-docs": "^10.1.2",
|
|
45
49
|
"@storybook/react-vite": "^10.1.2",
|
|
46
|
-
"@storybook/test-runner": "^0.24.4",
|
|
47
50
|
"@testing-library/react": "^16.1.0",
|
|
48
51
|
"@types/d3-force": "^3.0.10",
|
|
49
52
|
"@types/dagre": "^0.7.54",
|
|
50
53
|
"@types/react": "^19.2.14",
|
|
51
54
|
"@types/react-dom": "^19.2.3",
|
|
55
|
+
"@types/use-sync-external-store": "^1.5.0",
|
|
52
56
|
"@vitejs/plugin-react": "^5.2.0",
|
|
53
57
|
"@vitest/browser": "^4.1.0",
|
|
54
58
|
"@vitest/browser-playwright": "^4.1.0",
|
|
59
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
55
60
|
"@xyflow/react": "^12.11.0",
|
|
56
|
-
"concurrently": "^10.0.3",
|
|
57
61
|
"d3-force": "^3.0.0",
|
|
58
62
|
"dagre": "^0.8.5",
|
|
59
63
|
"elkjs": "^0.11.1",
|
|
60
|
-
"html-to-image": "^1.11.13",
|
|
61
64
|
"http-server": "^14.1.1",
|
|
62
65
|
"jsdom": "^25.0.0",
|
|
63
66
|
"leva": "^0.10.1",
|
|
@@ -66,22 +69,22 @@
|
|
|
66
69
|
"react-dom": "^19.2.5",
|
|
67
70
|
"react-scan": "^0.5.7",
|
|
68
71
|
"storybook": "^10.1.2",
|
|
69
|
-
"tsdown": "^0.
|
|
72
|
+
"tsdown": "^0.22.13",
|
|
70
73
|
"typescript": "^5.8.0",
|
|
71
74
|
"vite": "^8.0.0",
|
|
72
75
|
"vitest": "^4.1.0",
|
|
73
|
-
"wait-on": "^9.0.10",
|
|
74
76
|
"yjs": "^13.6.31"
|
|
75
77
|
},
|
|
76
78
|
"scripts": {
|
|
77
79
|
"dev": "tsdown --watch",
|
|
78
80
|
"build": "tsdown",
|
|
79
81
|
"test": "vitest run",
|
|
82
|
+
"test:coverage": "vitest run --coverage",
|
|
80
83
|
"typecheck": "tsc --noEmit",
|
|
81
84
|
"test:browser": "vitest run --config vitest.browser.config.mjs",
|
|
82
85
|
"test:e2e": "playwright test",
|
|
86
|
+
"bench:browser": "playwright test --config playwright.performance.config.ts",
|
|
83
87
|
"storybook": "storybook dev -p 6008",
|
|
84
|
-
"storybook:build": "storybook build"
|
|
85
|
-
"test:stories": "storybook build --quiet && concurrently -k -s first -n SB,TEST \"http-server storybook-static -p 6010 --silent\" \"wait-on tcp:127.0.0.1:6010 && test-storybook --url http://127.0.0.1:6010 --maxWorkers=2\""
|
|
88
|
+
"storybook:build": "storybook build"
|
|
86
89
|
}
|
|
87
90
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/FlowInstanceContext.tsx
|
|
4
|
-
const FlowInstanceContext = createContext(null);
|
|
5
|
-
function FlowInstanceProvider(props) {
|
|
6
|
-
return /* @__PURE__ */ jsx(FlowInstanceContext.Provider, {
|
|
7
|
-
value: props.flow,
|
|
8
|
-
children: props.children
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function useFlowInstance() {
|
|
12
|
-
const flow = useContext(FlowInstanceContext);
|
|
13
|
-
if (!flow) throw new Error("Flow instance is missing. Wrap this tree in <FlowInstanceProvider flow={flow}>.");
|
|
14
|
-
return flow;
|
|
15
|
-
}
|
|
16
|
-
function useOptionalFlowInstance() {
|
|
17
|
-
return useContext(FlowInstanceContext);
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { useFlowInstance as n, useOptionalFlowInstance as r, FlowInstanceProvider as t };
|