@rxflow/base 0.0.2 → 0.0.4-alpha.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/cjs/Flow.d.ts +1 -1
- package/cjs/Flow.d.ts.map +1 -1
- package/cjs/Flow.js +28 -10
- package/cjs/components/Legend/index.d.ts.map +1 -1
- package/cjs/components/Legend/index.js +2 -1
- package/cjs/components/Popover/index.d.ts +1 -9
- package/cjs/components/Popover/index.d.ts.map +1 -1
- package/cjs/components/Popover/index.js +14 -75
- package/cjs/components/Tooltip/index.d.ts +1 -10
- package/cjs/components/Tooltip/index.d.ts.map +1 -1
- package/cjs/components/Tooltip/index.js +11 -83
- package/cjs/edges/manhattan.d.ts.map +1 -1
- package/cjs/edges/manhattan.js +100 -30
- package/cjs/hoc/createFlow.d.ts +30 -4
- package/cjs/hoc/createFlow.d.ts.map +1 -1
- package/cjs/hoc/createFlow.js +45 -18
- package/cjs/hooks/index.d.ts +5 -2
- package/cjs/hooks/index.d.ts.map +1 -1
- package/cjs/hooks/index.js +44 -22
- package/cjs/hooks/props/index.d.ts +12 -0
- package/cjs/hooks/props/index.d.ts.map +1 -0
- package/cjs/hooks/props/index.js +49 -0
- package/cjs/hooks/props/useFlowProps.d.ts +23 -0
- package/cjs/hooks/props/useFlowProps.d.ts.map +1 -0
- package/cjs/hooks/props/useFlowProps.js +34 -0
- package/cjs/hooks/props/useGetFlowProps.d.ts +19 -0
- package/cjs/hooks/props/useGetFlowProps.d.ts.map +1 -0
- package/cjs/hooks/props/useGetFlowProps.js +38 -0
- package/cjs/hooks/props/useGetInputProps.d.ts +18 -0
- package/cjs/hooks/props/useGetInputProps.d.ts.map +1 -0
- package/cjs/hooks/props/useGetInputProps.js +38 -0
- package/cjs/hooks/props/useInputProps.d.ts +14 -0
- package/cjs/hooks/props/useInputProps.d.ts.map +1 -0
- package/cjs/hooks/props/useInputProps.js +33 -0
- package/cjs/hooks/useListenRender.js +4 -4
- package/cjs/hooks/useTheme.d.ts.map +1 -1
- package/cjs/hooks/useTheme.js +3 -2
- package/cjs/index.d.ts +6 -3
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +46 -14
- package/cjs/providers/FlowProvider.d.ts +7 -1
- package/cjs/providers/FlowProvider.d.ts.map +1 -1
- package/cjs/providers/FlowProvider.js +33 -14
- package/cjs/store/PropsStore.d.ts +11 -6
- package/cjs/store/PropsStore.d.ts.map +1 -1
- package/cjs/store/PropsStore.js +55 -39
- package/cjs/types/props.d.ts +83 -0
- package/cjs/types/props.d.ts.map +1 -0
- package/cjs/types/props.js +5 -0
- package/cjs/types.d.ts +5 -1
- package/cjs/types.d.ts.map +1 -1
- package/cjs/utils/wrapNodeTypes.d.ts +30 -0
- package/cjs/utils/wrapNodeTypes.d.ts.map +1 -0
- package/cjs/utils/wrapNodeTypes.js +56 -0
- package/cjs/workers/manhattan.worker.js +12534 -31
- package/cjs/workers/manhattan.worker.js.map +7 -0
- package/esm/Flow.d.ts +1 -1
- package/esm/Flow.d.ts.map +1 -1
- package/esm/Flow.js +30 -16
- package/esm/components/Legend/index.d.ts.map +1 -1
- package/esm/components/Legend/index.js +3 -2
- package/esm/components/Popover/index.d.ts +1 -9
- package/esm/components/Popover/index.d.ts.map +1 -1
- package/esm/components/Popover/index.js +16 -87
- package/esm/components/Tooltip/index.d.ts +1 -10
- package/esm/components/Tooltip/index.d.ts.map +1 -1
- package/esm/components/Tooltip/index.js +14 -97
- package/esm/edges/manhattan.d.ts.map +1 -1
- package/esm/edges/manhattan.js +95 -23
- package/esm/hoc/createFlow.d.ts +30 -4
- package/esm/hoc/createFlow.d.ts.map +1 -1
- package/esm/hoc/createFlow.js +48 -20
- package/esm/hooks/index.d.ts +5 -2
- package/esm/hooks/index.d.ts.map +1 -1
- package/esm/hooks/index.js +8 -3
- package/esm/hooks/props/index.d.ts +12 -0
- package/esm/hooks/props/index.d.ts.map +1 -0
- package/esm/hooks/props/index.js +12 -0
- package/esm/hooks/props/useFlowProps.d.ts +23 -0
- package/esm/hooks/props/useFlowProps.d.ts.map +1 -0
- package/esm/hooks/props/useFlowProps.js +29 -0
- package/esm/hooks/props/useGetFlowProps.d.ts +19 -0
- package/esm/hooks/props/useGetFlowProps.d.ts.map +1 -0
- package/esm/hooks/props/useGetFlowProps.js +31 -0
- package/esm/hooks/props/useGetInputProps.d.ts +18 -0
- package/esm/hooks/props/useGetInputProps.d.ts.map +1 -0
- package/esm/hooks/props/useGetInputProps.js +31 -0
- package/esm/hooks/props/useInputProps.d.ts +14 -0
- package/esm/hooks/props/useInputProps.d.ts.map +1 -0
- package/esm/hooks/props/useInputProps.js +27 -0
- package/esm/hooks/useListenRender.js +4 -4
- package/esm/hooks/useTheme.d.ts.map +1 -1
- package/esm/hooks/useTheme.js +3 -2
- package/esm/index.d.ts +6 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +22 -3
- package/esm/providers/FlowProvider.d.ts +7 -1
- package/esm/providers/FlowProvider.d.ts.map +1 -1
- package/esm/providers/FlowProvider.js +36 -15
- package/esm/store/PropsStore.d.ts +11 -6
- package/esm/store/PropsStore.d.ts.map +1 -1
- package/esm/store/PropsStore.js +75 -34
- package/esm/types/props.d.ts +83 -0
- package/esm/types/props.d.ts.map +1 -0
- package/esm/types/props.js +1 -0
- package/esm/types.d.ts +5 -1
- package/esm/types.d.ts.map +1 -1
- package/esm/utils/wrapNodeTypes.d.ts +30 -0
- package/esm/utils/wrapNodeTypes.d.ts.map +1 -0
- package/esm/utils/wrapNodeTypes.js +55 -0
- package/esm/workers/manhattan.worker.js +1 -1
- package/esm/workers/manhattan.worker.js.map +7 -0
- package/package.json +5 -3
- package/cjs/hooks/props/useGetProps.d.ts +0 -6
- package/cjs/hooks/props/useGetProps.d.ts.map +0 -1
- package/cjs/hooks/props/useGetProps.js +0 -29
- package/cjs/hooks/props/useProps.d.ts +0 -2
- package/cjs/hooks/props/useProps.d.ts.map +0 -1
- package/cjs/hooks/props/useProps.js +0 -20
- package/cjs/hooks/props/usePropsSelector.d.ts +0 -13
- package/cjs/hooks/props/usePropsSelector.d.ts.map +0 -1
- package/cjs/hooks/props/usePropsSelector.js +0 -37
- package/esm/hooks/props/useGetProps.d.ts +0 -6
- package/esm/hooks/props/useGetProps.d.ts.map +0 -1
- package/esm/hooks/props/useGetProps.js +0 -21
- package/esm/hooks/props/useProps.d.ts +0 -2
- package/esm/hooks/props/useProps.d.ts.map +0 -1
- package/esm/hooks/props/useProps.js +0 -14
- package/esm/hooks/props/usePropsSelector.d.ts +0 -13
- package/esm/hooks/props/usePropsSelector.d.ts.map +0 -1
- package/esm/hooks/props/usePropsSelector.js +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxflow/base",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4-alpha.0",
|
|
4
4
|
"description": "BaseFlow - 核心 Flow 组件库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reactflow",
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
"cjs"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "father build"
|
|
40
|
+
"build": "node scripts/build-worker.mjs && father build",
|
|
41
|
+
"build:worker": "node scripts/build-worker.mjs"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@ant-design/icons": "^6.0.0",
|
|
44
45
|
"@antv/hierarchy": "0.6.14",
|
|
45
|
-
"@rxflow/manhattan": "^0.0.
|
|
46
|
+
"@rxflow/manhattan": "^0.0.4-alpha.0",
|
|
46
47
|
"@xyflow/react": "^12.8.6",
|
|
47
48
|
"@xyflow/system": "^0.0.70",
|
|
48
49
|
"@zumer/snapdom": "^1.9.9",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@types/node": "^24.9.1",
|
|
72
73
|
"@types/react": "^19.1.4",
|
|
73
74
|
"@types/react-dom": "^19.1.5",
|
|
75
|
+
"esbuild": "^0.20.0",
|
|
74
76
|
"react": ">=16.0.0",
|
|
75
77
|
"react-dom": ">=16.0.0"
|
|
76
78
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetProps.d.ts","sourceRoot":"","sources":["useGetProps.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,cAAc,EAAC,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,WAAW;QAIH,CAAC;0BAEiB,CAAC,KAAK,CAAC,GAAG,CAAC;CAMjD,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useGetProps = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _useGetState = require("../state/useGetState");
|
|
9
|
-
/**
|
|
10
|
-
* @author: yanxianliang
|
|
11
|
-
* @date: 2025-10-16 16:12
|
|
12
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
13
|
-
* @desc:
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const useGetProps = () => {
|
|
19
|
-
const getState = (0, _useGetState.useGetState)();
|
|
20
|
-
// 如果 selector 是空的
|
|
21
|
-
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
|
|
24
|
-
return (0, _react.useCallback)(selector => {
|
|
25
|
-
const props = getState().props;
|
|
26
|
-
return selector ? selector(props) : props;
|
|
27
|
-
}, []);
|
|
28
|
-
};
|
|
29
|
-
exports.useGetProps = useGetProps;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useProps.d.ts","sourceRoot":"","sources":["useProps.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,kCAEpB,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useProps = void 0;
|
|
7
|
-
var _ = require("../..");
|
|
8
|
-
/**
|
|
9
|
-
* @author: yanxianliang
|
|
10
|
-
* @date: 2025-10-16 20:22
|
|
11
|
-
* @modified:2025/10/16 20:22 by yanxianliang
|
|
12
|
-
* @desc: 获取传入的props
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const useProps = () => {
|
|
18
|
-
return (0, _.useSelector)(state => state.props);
|
|
19
|
-
};
|
|
20
|
-
exports.useProps = useProps;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author: yanxianliang
|
|
3
|
-
* @date: 2025-10-16 16:12
|
|
4
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
5
|
-
* @desc:
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
import { StoreApi } from "zustand/vanilla";
|
|
10
|
-
import { IBaseFlowProps, ExtractState } from "../../types";
|
|
11
|
-
export declare function usePropsSelector<GraphProps = IBaseFlowProps>(): GraphProps;
|
|
12
|
-
export declare function usePropsSelector<GraphProps = IBaseFlowProps, U = unknown>(selector: (state: ExtractState<StoreApi<GraphProps>>) => U): U;
|
|
13
|
-
//# sourceMappingURL=usePropsSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePropsSelector.d.ts","sourceRoot":"","sources":["usePropsSelector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAGzD,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,cAAc,KAAK,UAAU,CAAC;AAC5E,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,cAAc,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.usePropsSelector = usePropsSelector;
|
|
7
|
-
var _useSelector = require("../state/useSelector");
|
|
8
|
-
/**
|
|
9
|
-
* @author: yanxianliang
|
|
10
|
-
* @date: 2025-10-16 16:12
|
|
11
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
12
|
-
* @desc:
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
function usePropsSelector(selector) {
|
|
18
|
-
return (0, _useSelector.useSelector)(state => {
|
|
19
|
-
const props = state.props;
|
|
20
|
-
return selector ? selector(props) : props;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
// export function usePropsSelector<GraphProps = IBaseFlowProps>(): GraphProps;
|
|
26
|
-
// export function usePropsSelector<GraphProps = IBaseFlowProps, U = unknown>(selector: (state: ExtractState<StoreApi<GraphProps>>) => U): U;
|
|
27
|
-
//
|
|
28
|
-
// export function usePropsSelector<
|
|
29
|
-
// GraphProps = IBaseFlowProps,
|
|
30
|
-
// U = any,
|
|
31
|
-
// >(selector?: ExtractState<StoreApi<GraphProps>>) {
|
|
32
|
-
// const useStore = useContext(PropsContext)?.useStore as UseBoundStore<StoreApi<GraphProps>>;
|
|
33
|
-
// if (!useStore) {
|
|
34
|
-
// throw new Error("usePropsSelector must be used within PropsProvider");
|
|
35
|
-
// }
|
|
36
|
-
// return useStore(selector as (state: ExtractState<StoreApi<GraphProps>>) => U);
|
|
37
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGetProps.d.ts","sourceRoot":"","sources":["useGetProps.ts"],"names":[],"mappings":"AASA,OAAO,EAAgB,cAAc,EAAC,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,WAAW;QAIH,CAAC;0BAEiB,CAAC,KAAK,CAAC,GAAG,CAAC;CAMjD,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author: yanxianliang
|
|
3
|
-
* @date: 2025-10-16 16:12
|
|
4
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
5
|
-
* @desc:
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
import { useCallback } from "react";
|
|
10
|
-
import { useGetState } from "../state/useGetState";
|
|
11
|
-
export var useGetProps = function useGetProps() {
|
|
12
|
-
var getState = useGetState();
|
|
13
|
-
// 如果 selector 是空的
|
|
14
|
-
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
|
|
17
|
-
return useCallback(function (selector) {
|
|
18
|
-
var props = getState().props;
|
|
19
|
-
return selector ? selector(props) : props;
|
|
20
|
-
}, []);
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useProps.d.ts","sourceRoot":"","sources":["useProps.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,kCAEpB,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author: yanxianliang
|
|
3
|
-
* @date: 2025-10-16 20:22
|
|
4
|
-
* @modified:2025/10/16 20:22 by yanxianliang
|
|
5
|
-
* @desc: 获取传入的props
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
import { useSelector } from "../..";
|
|
10
|
-
export var useProps = function useProps() {
|
|
11
|
-
return useSelector(function (state) {
|
|
12
|
-
return state.props;
|
|
13
|
-
});
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author: yanxianliang
|
|
3
|
-
* @date: 2025-10-16 16:12
|
|
4
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
5
|
-
* @desc:
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
import { StoreApi } from "zustand/vanilla";
|
|
10
|
-
import { IBaseFlowProps, ExtractState } from "../../types";
|
|
11
|
-
export declare function usePropsSelector<GraphProps = IBaseFlowProps>(): GraphProps;
|
|
12
|
-
export declare function usePropsSelector<GraphProps = IBaseFlowProps, U = unknown>(selector: (state: ExtractState<StoreApi<GraphProps>>) => U): U;
|
|
13
|
-
//# sourceMappingURL=usePropsSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePropsSelector.d.ts","sourceRoot":"","sources":["usePropsSelector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAGzD,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,cAAc,KAAK,UAAU,CAAC;AAC5E,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,cAAc,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author: yanxianliang
|
|
3
|
-
* @date: 2025-10-16 16:12
|
|
4
|
-
* @modified:2025/10/16 16:12 by yanxianliang
|
|
5
|
-
* @desc:
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { useSelector } from "../state/useSelector";
|
|
11
|
-
export function usePropsSelector(selector) {
|
|
12
|
-
return useSelector(function (state) {
|
|
13
|
-
var props = state.props;
|
|
14
|
-
return selector ? selector(props) : props;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
// export function usePropsSelector<GraphProps = IBaseFlowProps>(): GraphProps;
|
|
20
|
-
// export function usePropsSelector<GraphProps = IBaseFlowProps, U = unknown>(selector: (state: ExtractState<StoreApi<GraphProps>>) => U): U;
|
|
21
|
-
//
|
|
22
|
-
// export function usePropsSelector<
|
|
23
|
-
// GraphProps = IBaseFlowProps,
|
|
24
|
-
// U = any,
|
|
25
|
-
// >(selector?: ExtractState<StoreApi<GraphProps>>) {
|
|
26
|
-
// const useStore = useContext(PropsContext)?.useStore as UseBoundStore<StoreApi<GraphProps>>;
|
|
27
|
-
// if (!useStore) {
|
|
28
|
-
// throw new Error("usePropsSelector must be used within PropsProvider");
|
|
29
|
-
// }
|
|
30
|
-
// return useStore(selector as (state: ExtractState<StoreApi<GraphProps>>) => U);
|
|
31
|
-
// }
|