@rxflow/base 0.0.4-alpha.6 → 0.0.4-alpha.7
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.map +1 -1
- package/cjs/Flow.js +6 -1
- package/cjs/components/Nodes/DefaultNode.d.ts +1 -1
- package/cjs/components/Nodes/DefaultNode.d.ts.map +1 -1
- package/cjs/components/Nodes/DefaultNode.js +0 -3
- package/cjs/components/Nodes/GroupNode.d.ts +1 -1
- package/cjs/components/Nodes/GroupNode.d.ts.map +1 -1
- package/cjs/components/Nodes/GroupNode.js +1 -5
- package/cjs/components/Nodes/InputNode.d.ts +1 -1
- package/cjs/components/Nodes/InputNode.d.ts.map +1 -1
- package/cjs/components/Nodes/InputNode.js +0 -3
- package/cjs/components/Nodes/OutputNode.d.ts +1 -1
- package/cjs/components/Nodes/OutputNode.d.ts.map +1 -1
- package/cjs/components/Nodes/OutputNode.js +0 -3
- package/cjs/hoc/createFlow.d.ts +1 -3
- package/cjs/hoc/createFlow.d.ts.map +1 -1
- package/cjs/hoc/createFlow.js +3 -10
- package/cjs/hoc/withFlowProvider.d.ts +2 -1
- package/cjs/hoc/withFlowProvider.d.ts.map +1 -1
- package/cjs/hoc/withFlowProvider.js +1 -0
- package/cjs/hooks/index.d.ts +0 -3
- package/cjs/hooks/index.d.ts.map +1 -1
- package/cjs/hooks/index.js +0 -33
- package/cjs/hooks/props/index.d.ts +0 -2
- package/cjs/hooks/props/index.d.ts.map +1 -1
- package/cjs/hooks/props/index.js +0 -22
- package/cjs/hooks/props/useFlowProps.d.ts +9 -6
- package/cjs/hooks/props/useFlowProps.d.ts.map +1 -1
- package/cjs/hooks/props/useFlowProps.js +7 -4
- package/cjs/hooks/props/useGetFlowProps.d.ts +10 -8
- package/cjs/hooks/props/useGetFlowProps.d.ts.map +1 -1
- package/cjs/hooks/props/useGetFlowProps.js +8 -8
- package/cjs/hooks/useNodeTypes.d.ts.map +1 -1
- package/cjs/hooks/useNodeTypes.js +3 -5
- package/cjs/index.d.ts +1 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +8 -1
- package/cjs/providers/FlowProvider/Context.d.ts +16 -0
- package/cjs/providers/FlowProvider/Context.d.ts.map +1 -0
- package/cjs/providers/FlowProvider/Context.js +19 -0
- package/cjs/providers/FlowProvider/Provider.d.ts +6 -0
- package/cjs/providers/FlowProvider/Provider.d.ts.map +1 -0
- package/cjs/providers/FlowProvider/Provider.js +39 -0
- package/cjs/providers/FlowProvider/index.d.ts +9 -0
- package/cjs/providers/FlowProvider/index.d.ts.map +1 -0
- package/cjs/providers/FlowProvider/index.js +50 -0
- package/cjs/providers/FlowProvider/initialState.d.ts +21 -0
- package/cjs/providers/FlowProvider/initialState.d.ts.map +1 -0
- package/cjs/providers/FlowProvider/initialState.js +36 -0
- package/cjs/store/PropsStore/InjectStyle.d.ts +13 -0
- package/cjs/store/PropsStore/InjectStyle.d.ts.map +1 -0
- package/cjs/store/PropsStore/InjectStyle.js +42 -0
- package/cjs/store/PropsStore/index.d.ts +9 -0
- package/cjs/store/PropsStore/index.d.ts.map +1 -0
- package/cjs/store/PropsStore/index.js +77 -0
- package/cjs/types.d.ts +11 -7
- package/cjs/types.d.ts.map +1 -1
- package/esm/Flow.d.ts.map +1 -1
- package/esm/Flow.js +6 -2
- package/esm/components/Nodes/DefaultNode.d.ts +1 -1
- package/esm/components/Nodes/DefaultNode.d.ts.map +1 -1
- package/esm/components/Nodes/DefaultNode.js +1 -4
- package/esm/components/Nodes/GroupNode.d.ts +1 -1
- package/esm/components/Nodes/GroupNode.d.ts.map +1 -1
- package/esm/components/Nodes/GroupNode.js +2 -3
- package/esm/components/Nodes/InputNode.d.ts +1 -1
- package/esm/components/Nodes/InputNode.d.ts.map +1 -1
- package/esm/components/Nodes/InputNode.js +1 -4
- package/esm/components/Nodes/OutputNode.d.ts +1 -1
- package/esm/components/Nodes/OutputNode.d.ts.map +1 -1
- package/esm/components/Nodes/OutputNode.js +1 -4
- package/esm/hoc/createFlow.d.ts +1 -3
- package/esm/hoc/createFlow.d.ts.map +1 -1
- package/esm/hoc/createFlow.js +4 -10
- package/esm/hoc/withFlowProvider.d.ts +2 -1
- package/esm/hoc/withFlowProvider.d.ts.map +1 -1
- package/esm/hoc/withFlowProvider.js +1 -0
- package/esm/hooks/index.d.ts +0 -3
- package/esm/hooks/index.d.ts.map +1 -1
- package/esm/hooks/index.js +0 -3
- package/esm/hooks/props/index.d.ts +0 -2
- package/esm/hooks/props/index.d.ts.map +1 -1
- package/esm/hooks/props/index.js +0 -2
- package/esm/hooks/props/useFlowProps.d.ts +9 -6
- package/esm/hooks/props/useFlowProps.d.ts.map +1 -1
- package/esm/hooks/props/useFlowProps.js +7 -4
- package/esm/hooks/props/useGetFlowProps.d.ts +10 -8
- package/esm/hooks/props/useGetFlowProps.d.ts.map +1 -1
- package/esm/hooks/props/useGetFlowProps.js +8 -9
- package/esm/hooks/useNodeTypes.d.ts.map +1 -1
- package/esm/hooks/useNodeTypes.js +3 -5
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/providers/FlowProvider/Context.d.ts +16 -0
- package/esm/providers/FlowProvider/Context.d.ts.map +1 -0
- package/esm/providers/FlowProvider/Context.js +12 -0
- package/esm/providers/FlowProvider/Provider.d.ts +6 -0
- package/esm/providers/FlowProvider/Provider.d.ts.map +1 -0
- package/esm/providers/FlowProvider/Provider.js +34 -0
- package/esm/providers/FlowProvider/index.d.ts +9 -0
- package/esm/providers/FlowProvider/index.d.ts.map +1 -0
- package/esm/providers/FlowProvider/index.js +29 -0
- package/esm/providers/FlowProvider/initialState.d.ts +21 -0
- package/esm/providers/FlowProvider/initialState.d.ts.map +1 -0
- package/esm/{components/NodeRenderFactory.js → providers/FlowProvider/initialState.js} +21 -11
- package/esm/store/PropsStore/InjectStyle.d.ts +13 -0
- package/esm/store/PropsStore/InjectStyle.d.ts.map +1 -0
- package/esm/store/PropsStore/InjectStyle.js +48 -0
- package/esm/store/PropsStore/index.d.ts +9 -0
- package/esm/store/PropsStore/index.d.ts.map +1 -0
- package/esm/store/{PropsStore.js → PropsStore/index.js} +16 -66
- package/esm/types.d.ts +11 -7
- package/esm/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/cjs/components/NodeRenderFactory.d.ts +0 -11
- package/cjs/components/NodeRenderFactory.d.ts.map +0 -1
- package/cjs/components/NodeRenderFactory.js +0 -26
- package/cjs/hooks/node/useInitialized.d.ts +0 -2
- package/cjs/hooks/node/useInitialized.d.ts.map +0 -1
- package/cjs/hooks/node/useInitialized.js +0 -20
- package/cjs/hooks/node/useNodeInitialize.d.ts +0 -2
- package/cjs/hooks/node/useNodeInitialize.d.ts.map +0 -1
- package/cjs/hooks/node/useNodeInitialize.js +0 -23
- package/cjs/hooks/props/useGetInputProps.d.ts +0 -18
- package/cjs/hooks/props/useGetInputProps.d.ts.map +0 -1
- package/cjs/hooks/props/useGetInputProps.js +0 -38
- package/cjs/hooks/props/useInputProps.d.ts +0 -14
- package/cjs/hooks/props/useInputProps.d.ts.map +0 -1
- package/cjs/hooks/props/useInputProps.js +0 -33
- package/cjs/providers/FlowProvider.d.ts +0 -24
- package/cjs/providers/FlowProvider.d.ts.map +0 -1
- package/cjs/providers/FlowProvider.js +0 -110
- package/cjs/store/PropsStore.d.ts +0 -21
- package/cjs/store/PropsStore.d.ts.map +0 -1
- package/cjs/store/PropsStore.js +0 -110
- package/esm/components/NodeRenderFactory.d.ts +0 -11
- package/esm/components/NodeRenderFactory.d.ts.map +0 -1
- package/esm/hooks/node/useInitialized.d.ts +0 -2
- package/esm/hooks/node/useInitialized.d.ts.map +0 -1
- package/esm/hooks/node/useInitialized.js +0 -12
- package/esm/hooks/node/useNodeInitialize.d.ts +0 -2
- package/esm/hooks/node/useNodeInitialize.d.ts.map +0 -1
- package/esm/hooks/node/useNodeInitialize.js +0 -15
- package/esm/hooks/props/useGetInputProps.d.ts +0 -18
- package/esm/hooks/props/useGetInputProps.d.ts.map +0 -1
- package/esm/hooks/props/useGetInputProps.js +0 -31
- package/esm/hooks/props/useInputProps.d.ts +0 -14
- package/esm/hooks/props/useInputProps.d.ts.map +0 -1
- package/esm/hooks/props/useInputProps.js +0 -27
- package/esm/providers/FlowProvider.d.ts +0 -24
- package/esm/providers/FlowProvider.d.ts.map +0 -1
- package/esm/providers/FlowProvider.js +0 -110
- package/esm/store/PropsStore.d.ts +0 -21
- package/esm/store/PropsStore.d.ts.map +0 -1
package/cjs/Flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAYvB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAYvB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CA6azH"}
|
package/cjs/Flow.js
CHANGED
|
@@ -38,6 +38,8 @@ const proOptions = {
|
|
|
38
38
|
|
|
39
39
|
function Flow(props) {
|
|
40
40
|
const {
|
|
41
|
+
id,
|
|
42
|
+
// Flow 实例唯一标识(不传递给 ReactFlow,仅用于内部状态管理)
|
|
41
43
|
width,
|
|
42
44
|
height,
|
|
43
45
|
showControls = true,
|
|
@@ -142,6 +144,7 @@ function Flow(props) {
|
|
|
142
144
|
onNodeDragStop: userOnNodeDragStop,
|
|
143
145
|
// 性能相关配置(外层定义)
|
|
144
146
|
onlyRenderVisibleElements = true,
|
|
147
|
+
edgesFocusable: userEdgesFocusable,
|
|
145
148
|
// 扩展属性
|
|
146
149
|
flowProps: userFlowProps = {}
|
|
147
150
|
} = props;
|
|
@@ -192,6 +195,7 @@ function Flow(props) {
|
|
|
192
195
|
const reactFlowProps = (0, _react2.useMemo)(() => {
|
|
193
196
|
// 构建传递给 ReactFlow 的属性
|
|
194
197
|
const options = {
|
|
198
|
+
id,
|
|
195
199
|
// 默认配置
|
|
196
200
|
preventScrolling: true,
|
|
197
201
|
proOptions: proOptions,
|
|
@@ -204,6 +208,7 @@ function Flow(props) {
|
|
|
204
208
|
maxZoom: userMaxZoom,
|
|
205
209
|
defaultViewport: userDefaultViewport,
|
|
206
210
|
onlyRenderVisibleElements,
|
|
211
|
+
edgesFocusable: userEdgesFocusable,
|
|
207
212
|
// 节点交互相关
|
|
208
213
|
nodesDraggable: userNodesDraggable ?? false,
|
|
209
214
|
nodesConnectable: userNodesConnectable,
|
|
@@ -285,7 +290,7 @@ function Flow(props) {
|
|
|
285
290
|
options.elementsSelectable = false;
|
|
286
291
|
}
|
|
287
292
|
return options;
|
|
288
|
-
}, [userFlowProps, _nodes, readOnly, onlyRenderVisibleElements, autoCenter, plugins?.scroller,
|
|
293
|
+
}, [id, userFlowProps, _nodes, readOnly, onlyRenderVisibleElements, userEdgesFocusable, autoCenter, plugins?.scroller,
|
|
289
294
|
// 视图和缩放相关
|
|
290
295
|
userFitView, userFitViewOptions, userMinZoom, userMaxZoom, userDefaultViewport,
|
|
291
296
|
// 节点交互相关
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuiltInNode, NodeProps } from '@xyflow/react';
|
|
2
|
-
export declare function DefaultNode({
|
|
2
|
+
export declare function DefaultNode({ data, isConnectable, targetPosition, sourcePosition, }: NodeProps<BuiltInNode>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=DefaultNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;AAG7D,wBAAgB,WAAW,CACzB,EACE,IAAI,EACJ,aAAa,EACb,cAA6B,EAC7B,cAAgC,GACjC,EAAE,SAAS,CAAC,WAAW,CAAC,2CAQ1B"}
|
|
@@ -6,16 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DefaultNode = DefaultNode;
|
|
7
7
|
var _react = require("@xyflow/react");
|
|
8
8
|
var _system = require("@xyflow/system");
|
|
9
|
-
var _ = require("../..");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function DefaultNode({
|
|
12
|
-
id,
|
|
13
11
|
data,
|
|
14
12
|
isConnectable,
|
|
15
13
|
targetPosition = _system.Position.Top,
|
|
16
14
|
sourcePosition = _system.Position.Bottom
|
|
17
15
|
}) {
|
|
18
|
-
(0, _.useNodeInitialize)(id);
|
|
19
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
20
17
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Handle, {
|
|
21
18
|
type: "target",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupNode.d.ts","sourceRoot":"","sources":["GroupNode.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupNode.d.ts","sourceRoot":"","sources":["GroupNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,wBAAgB,SAAS,CAAC,EAAE,EAAE,SAAS,QAEtC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuiltInNode, NodeProps } from '@xyflow/react';
|
|
2
|
-
export declare function InputNode({
|
|
2
|
+
export declare function InputNode({ data, isConnectable, sourcePosition }: NodeProps<BuiltInNode>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=InputNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNode.d.ts","sourceRoot":"","sources":["InputNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"InputNode.d.ts","sourceRoot":"","sources":["InputNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;AAG7D,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAAgC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAO1G"}
|
|
@@ -6,15 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.InputNode = InputNode;
|
|
7
7
|
var _react = require("@xyflow/react");
|
|
8
8
|
var _system = require("@xyflow/system");
|
|
9
|
-
var _ = require("../..");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function InputNode({
|
|
12
|
-
id,
|
|
13
11
|
data,
|
|
14
12
|
isConnectable,
|
|
15
13
|
sourcePosition = _system.Position.Bottom
|
|
16
14
|
}) {
|
|
17
|
-
(0, _.useNodeInitialize)(id);
|
|
18
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
19
16
|
children: [data?.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Handle, {
|
|
20
17
|
type: "source",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuiltInNode, NodeProps } from '@xyflow/react';
|
|
2
|
-
export declare function OutputNode({
|
|
2
|
+
export declare function OutputNode({ data, isConnectable, targetPosition }: NodeProps<BuiltInNode>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=OutputNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputNode.d.ts","sourceRoot":"","sources":["OutputNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"OutputNode.d.ts","sourceRoot":"","sources":["OutputNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAS,MAAM,eAAe,CAAC;AAG7D,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAA6B,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAOxG"}
|
|
@@ -6,15 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.OutputNode = OutputNode;
|
|
7
7
|
var _react = require("@xyflow/react");
|
|
8
8
|
var _system = require("@xyflow/system");
|
|
9
|
-
var _ = require("../..");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function OutputNode({
|
|
12
|
-
id,
|
|
13
11
|
data,
|
|
14
12
|
isConnectable,
|
|
15
13
|
targetPosition = _system.Position.Top
|
|
16
14
|
}) {
|
|
17
|
-
(0, _.useNodeInitialize)(id);
|
|
18
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
19
16
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Handle, {
|
|
20
17
|
type: "target",
|
package/cjs/hoc/createFlow.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author: yanxianliang
|
|
3
3
|
* @date: 2025-10-15 15:25
|
|
4
|
-
* @modified:2025/1/
|
|
4
|
+
* @modified:2025/1/25 by yanxianliang
|
|
5
5
|
* @desc: 创建 Flow 组件
|
|
6
6
|
*
|
|
7
|
-
* 提供公共能力封装,支持双层 Props 存储
|
|
8
|
-
*
|
|
9
7
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
10
8
|
*/
|
|
11
9
|
import { Edge, Node } from "@xyflow/react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFlow.d.ts","sourceRoot":"","sources":["createFlow.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"createFlow.d.ts","sourceRoot":"","sources":["createFlow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAwBxC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CACxB,WAAW,GAAG,cAAc,EAC5B,YAAY,GAAG,EAAE,EACjB,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC5B,QAAQ,SAAS,IAAI,GAAG,IAAI,EAE5B,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,EACrF,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAAK,iBAAiB,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,4FAwBpI"}
|
package/cjs/hoc/createFlow.js
CHANGED
|
@@ -14,11 +14,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
/**
|
|
15
15
|
* @author: yanxianliang
|
|
16
16
|
* @date: 2025-10-15 15:25
|
|
17
|
-
* @modified:2025/1/
|
|
17
|
+
* @modified:2025/1/25 by yanxianliang
|
|
18
18
|
* @desc: 创建 Flow 组件
|
|
19
19
|
*
|
|
20
|
-
* 提供公共能力封装,支持双层 Props 存储
|
|
21
|
-
*
|
|
22
20
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
23
21
|
*/
|
|
24
22
|
|
|
@@ -73,17 +71,12 @@ function createFlow(FlowComponent, usePropsTransform) {
|
|
|
73
71
|
}
|
|
74
72
|
const {
|
|
75
73
|
children,
|
|
76
|
-
...
|
|
74
|
+
...propsWithoutChildren
|
|
77
75
|
} = flowProps;
|
|
78
|
-
const {
|
|
79
|
-
children: inputChildren,
|
|
80
|
-
...inputPropsWithoutChildren
|
|
81
|
-
} = props;
|
|
82
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider, {
|
|
83
77
|
prefixCls: 'rxflow',
|
|
84
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropsStore.PropsStore, {
|
|
85
|
-
|
|
86
|
-
flowProps: flowPropsWithoutChildren,
|
|
79
|
+
props: propsWithoutChildren,
|
|
87
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RenderFlowWithProps, {
|
|
88
81
|
FlowComponent: FlowComponent,
|
|
89
82
|
children: children
|
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
-
|
|
10
|
+
import { IBaseFlowProps } from "../types";
|
|
11
|
+
export declare const withFlowProvider: <P extends IBaseFlowProps<import("@xyflow/react").Node, import("@xyflow/react").Edge> = Record<string, any>>(ComponentType: React.ComponentType<P>) => (props: P) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
//# sourceMappingURL=withFlowProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFlowProvider.d.ts","sourceRoot":"","sources":["withFlowProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"withFlowProvider.d.ts","sourceRoot":"","sources":["withFlowProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,gBAAgB,iKACX,CAAC,4CAOlB,CAAA"}
|
|
@@ -20,6 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
const withFlowProvider = ComponentType => {
|
|
21
21
|
return props => {
|
|
22
22
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlowProvider.FlowProvider, {
|
|
23
|
+
id: props.id,
|
|
23
24
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ComponentType, {
|
|
24
25
|
...props
|
|
25
26
|
})
|
package/cjs/hooks/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
export * from './useNodeTypes';
|
|
10
10
|
export * from './useTheme';
|
|
11
11
|
export * from './useThemeVars';
|
|
12
|
-
export * from './node/useNodeInitialize';
|
|
13
12
|
export * from './node/useNodeTypeMap';
|
|
14
13
|
export * from './useFlowId';
|
|
15
14
|
export * from './node/useNodes';
|
|
@@ -18,8 +17,6 @@ export * from './edges/useOnEdgesChange';
|
|
|
18
17
|
export * from './state/useSetState';
|
|
19
18
|
export * from './state/useGetState';
|
|
20
19
|
export * from './state/useSelector';
|
|
21
|
-
export * from './props/useInputProps';
|
|
22
20
|
export * from './props/useFlowProps';
|
|
23
|
-
export * from './props/useGetInputProps';
|
|
24
21
|
export * from './props/useGetFlowProps';
|
|
25
22
|
//# sourceMappingURL=index.d.ts.map
|
package/cjs/hooks/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
package/cjs/hooks/index.js
CHANGED
|
@@ -36,17 +36,6 @@ Object.keys(_useThemeVars).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _useNodeInitialize = require("./node/useNodeInitialize");
|
|
40
|
-
Object.keys(_useNodeInitialize).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _useNodeInitialize[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _useNodeInitialize[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
39
|
var _useNodeTypeMap = require("./node/useNodeTypeMap");
|
|
51
40
|
Object.keys(_useNodeTypeMap).forEach(function (key) {
|
|
52
41
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -135,17 +124,6 @@ Object.keys(_useSelector).forEach(function (key) {
|
|
|
135
124
|
}
|
|
136
125
|
});
|
|
137
126
|
});
|
|
138
|
-
var _useInputProps = require("./props/useInputProps");
|
|
139
|
-
Object.keys(_useInputProps).forEach(function (key) {
|
|
140
|
-
if (key === "default" || key === "__esModule") return;
|
|
141
|
-
if (key in exports && exports[key] === _useInputProps[key]) return;
|
|
142
|
-
Object.defineProperty(exports, key, {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function () {
|
|
145
|
-
return _useInputProps[key];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
127
|
var _useFlowProps = require("./props/useFlowProps");
|
|
150
128
|
Object.keys(_useFlowProps).forEach(function (key) {
|
|
151
129
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -157,17 +135,6 @@ Object.keys(_useFlowProps).forEach(function (key) {
|
|
|
157
135
|
}
|
|
158
136
|
});
|
|
159
137
|
});
|
|
160
|
-
var _useGetInputProps = require("./props/useGetInputProps");
|
|
161
|
-
Object.keys(_useGetInputProps).forEach(function (key) {
|
|
162
|
-
if (key === "default" || key === "__esModule") return;
|
|
163
|
-
if (key in exports && exports[key] === _useGetInputProps[key]) return;
|
|
164
|
-
Object.defineProperty(exports, key, {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () {
|
|
167
|
-
return _useGetInputProps[key];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
138
|
var _useGetFlowProps = require("./props/useGetFlowProps");
|
|
172
139
|
Object.keys(_useGetFlowProps).forEach(function (key) {
|
|
173
140
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
package/cjs/hooks/props/index.js
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _useInputProps = require("./useInputProps");
|
|
7
|
-
Object.keys(_useInputProps).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _useInputProps[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _useInputProps[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
6
|
var _useFlowProps = require("./useFlowProps");
|
|
18
7
|
Object.keys(_useFlowProps).forEach(function (key) {
|
|
19
8
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -25,17 +14,6 @@ Object.keys(_useFlowProps).forEach(function (key) {
|
|
|
25
14
|
}
|
|
26
15
|
});
|
|
27
16
|
});
|
|
28
|
-
var _useGetInputProps = require("./useGetInputProps");
|
|
29
|
-
Object.keys(_useGetInputProps).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _useGetInputProps[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _useGetInputProps[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
17
|
var _useGetFlowProps = require("./useGetFlowProps");
|
|
40
18
|
Object.keys(_useGetFlowProps).forEach(function (key) {
|
|
41
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author: yanxianliang
|
|
3
3
|
* @date: 2025-01-17
|
|
4
|
-
* @desc:
|
|
4
|
+
* @desc: 获取 Flow props
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
7
7
|
*/
|
|
8
8
|
import { IBaseFlowProps } from "../../types";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 获取 Flow props
|
|
11
|
+
*
|
|
12
|
+
* 注意:虽然 flowProps 包含函数属性,但只有数据属性变化才会触发更新。
|
|
13
|
+
* 函数属性变化不会触发组件重渲染,但通过 useGetFlowProps 可以获取最新的函数引用。
|
|
11
14
|
*
|
|
12
15
|
* @example
|
|
13
|
-
* // 获取全部
|
|
14
|
-
* const
|
|
16
|
+
* // 获取全部 props
|
|
17
|
+
* const props = useFlowProps<IBloodlineFlowProps>();
|
|
15
18
|
*
|
|
16
19
|
* @example
|
|
17
20
|
* // 使用 selector 获取特定属性
|
|
18
21
|
* const nodes = useFlowProps(state => state.nodes);
|
|
19
22
|
* const theme = useFlowProps(state => state.theme);
|
|
20
23
|
*/
|
|
21
|
-
export declare function useFlowProps<
|
|
22
|
-
export declare function useFlowProps<
|
|
24
|
+
export declare function useFlowProps<TProps = IBaseFlowProps>(): TProps;
|
|
25
|
+
export declare function useFlowProps<TProps = IBaseFlowProps, U = unknown>(selector: (state: TProps) => U): U;
|
|
23
26
|
//# sourceMappingURL=useFlowProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFlowProps.d.ts","sourceRoot":"","sources":["useFlowProps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C
|
|
1
|
+
{"version":3,"file":"useFlowProps.d.ts","sourceRoot":"","sources":["useFlowProps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAG,cAAc,KAAK,MAAM,CAAC;AAChE,wBAAgB,YAAY,CAAC,MAAM,GAAG,cAAc,EAAE,CAAC,GAAG,OAAO,EAC/D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAC7B,CAAC,CAAC"}
|
|
@@ -8,17 +8,20 @@ var _useSelector = require("../state/useSelector");
|
|
|
8
8
|
/**
|
|
9
9
|
* @author: yanxianliang
|
|
10
10
|
* @date: 2025-01-17
|
|
11
|
-
* @desc:
|
|
11
|
+
* @desc: 获取 Flow props
|
|
12
12
|
*
|
|
13
13
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 获取 Flow props
|
|
18
|
+
*
|
|
19
|
+
* 注意:虽然 flowProps 包含函数属性,但只有数据属性变化才会触发更新。
|
|
20
|
+
* 函数属性变化不会触发组件重渲染,但通过 useGetFlowProps 可以获取最新的函数引用。
|
|
18
21
|
*
|
|
19
22
|
* @example
|
|
20
|
-
* // 获取全部
|
|
21
|
-
* const
|
|
23
|
+
* // 获取全部 props
|
|
24
|
+
* const props = useFlowProps<IBloodlineFlowProps>();
|
|
22
25
|
*
|
|
23
26
|
* @example
|
|
24
27
|
* // 使用 selector 获取特定属性
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { IBaseFlowProps } from "../../types";
|
|
2
|
+
type GetterFn<TProps> = {
|
|
3
|
+
(): TProps;
|
|
4
|
+
<U>(selector: (state: TProps) => U): U;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
|
-
*
|
|
7
|
+
* 获取 Flow props 的 getter 函数
|
|
4
8
|
* 用于在回调函数中获取最新的 props,避免闭包问题
|
|
5
9
|
*
|
|
6
10
|
* @example
|
|
7
|
-
* const
|
|
11
|
+
* const getProps = useGetFlowProps<IBloodlineFlowProps>();
|
|
8
12
|
*
|
|
9
13
|
* const handleClick = () => {
|
|
10
|
-
* const nodes =
|
|
14
|
+
* const nodes = getProps(state => state.nodes);
|
|
11
15
|
* // 或获取全部
|
|
12
|
-
* const allProps =
|
|
16
|
+
* const allProps = getProps();
|
|
13
17
|
* };
|
|
14
18
|
*/
|
|
15
|
-
export declare const useGetFlowProps: <
|
|
16
|
-
|
|
17
|
-
<U>(selector: (state: TFlowProps) => U): U;
|
|
18
|
-
};
|
|
19
|
+
export declare const useGetFlowProps: <TProps = IBaseFlowProps<import("@xyflow/react").Node, import("@xyflow/react").Edge>>() => GetterFn<TProps>;
|
|
20
|
+
export {};
|
|
19
21
|
//# sourceMappingURL=useGetFlowProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetFlowProps.d.ts","sourceRoot":"","sources":["useGetFlowProps.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5D
|
|
1
|
+
{"version":3,"file":"useGetFlowProps.d.ts","sourceRoot":"","sources":["useGetFlowProps.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5D,KAAK,QAAQ,CAAC,MAAM,IAAI;IACtB,IAAI,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,6FAAgC,SAAS,MAAM,CAS1E,CAAC"}
|
|
@@ -9,30 +9,30 @@ var _useGetState = require("../state/useGetState");
|
|
|
9
9
|
/**
|
|
10
10
|
* @author: yanxianliang
|
|
11
11
|
* @date: 2025-01-17
|
|
12
|
-
* @desc:
|
|
12
|
+
* @desc: 获取 Flow props 的 getter 函数(非响应式)
|
|
13
13
|
*
|
|
14
14
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* 获取 Flow props 的 getter 函数
|
|
19
19
|
* 用于在回调函数中获取最新的 props,避免闭包问题
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
-
* const
|
|
22
|
+
* const getProps = useGetFlowProps<IBloodlineFlowProps>();
|
|
23
23
|
*
|
|
24
24
|
* const handleClick = () => {
|
|
25
|
-
* const nodes =
|
|
25
|
+
* const nodes = getProps(state => state.nodes);
|
|
26
26
|
* // 或获取全部
|
|
27
|
-
* const allProps =
|
|
27
|
+
* const allProps = getProps();
|
|
28
28
|
* };
|
|
29
29
|
*/
|
|
30
30
|
const useGetFlowProps = () => {
|
|
31
31
|
const getState = (0, _useGetState.useGetState)();
|
|
32
|
-
|
|
32
|
+
const getter = (0, _react.useCallback)(selector => {
|
|
33
33
|
const flowProps = getState().flowProps;
|
|
34
34
|
return selector ? selector(flowProps) : flowProps;
|
|
35
|
-
}
|
|
36
|
-
return
|
|
35
|
+
}, [getState]);
|
|
36
|
+
return getter;
|
|
37
37
|
};
|
|
38
38
|
exports.useGetFlowProps = useGetFlowProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodeTypes.d.ts","sourceRoot":"","sources":["useNodeTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useNodeTypes.d.ts","sourceRoot":"","sources":["useNodeTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAM3D;;GAEG;AACH,eAAO,MAAM,YAAY,6EAA8E,eAAe,QAAQ,EAAE,QAAQ,CAAC,CAAC,WAAW,CAAC,sCAwBrJ,CAAA"}
|
|
@@ -9,7 +9,6 @@ var _InputNode = require("../components/Nodes/InputNode");
|
|
|
9
9
|
var _DefaultNode = require("../components/Nodes/DefaultNode");
|
|
10
10
|
var _OutputNode = require("../components/Nodes/OutputNode");
|
|
11
11
|
var _GroupNode = require("../components/Nodes/GroupNode");
|
|
12
|
-
var _NodeRenderFactory = require("../components/NodeRenderFactory");
|
|
13
12
|
/**
|
|
14
13
|
* @author: yanxianliang
|
|
15
14
|
* @date: 2025-07-02 11:40
|
|
@@ -40,11 +39,10 @@ const useNodeTypes = nodeTypeList => {
|
|
|
40
39
|
defaultSize,
|
|
41
40
|
measureHandles
|
|
42
41
|
} = item;
|
|
43
|
-
const nodeType = (0, _NodeRenderFactory.nodeRenderFactory)(component);
|
|
44
42
|
// defaultSize 和 measureHandles绑定
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
nodeTypes[type] =
|
|
43
|
+
component.defaultSize = defaultSize;
|
|
44
|
+
component.measureHandles = measureHandles;
|
|
45
|
+
nodeTypes[type] = component; // 高阶组件
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
}
|
package/cjs/index.d.ts
CHANGED
|
@@ -26,6 +26,6 @@ export * from './hoc/withFlowProvider';
|
|
|
26
26
|
export * from './constants/NodeRoleType';
|
|
27
27
|
export * from './constants/InnerFlowType';
|
|
28
28
|
export * from './constants/SelectionStrategy';
|
|
29
|
-
export { FlowContext, FlowProvider } from './providers/FlowProvider';
|
|
29
|
+
export { FlowContext, FlowProvider, setInitialState } from './providers/FlowProvider';
|
|
30
30
|
export { Flow };
|
|
31
31
|
//# sourceMappingURL=index.d.ts.map
|
package/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,QAAA,MAAM,QAAQ,qLAAmB,CAAC;AAElC,eAAe,QAAQ,CAAC;AAGxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,QAAA,MAAM,QAAQ,qLAAmB,CAAC;AAElC,eAAe,QAAQ,CAAC;AAGxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGtF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/cjs/index.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Flow: true,
|
|
8
8
|
FlowContext: true,
|
|
9
|
-
FlowProvider: true
|
|
9
|
+
FlowProvider: true,
|
|
10
|
+
setInitialState: true
|
|
10
11
|
};
|
|
11
12
|
Object.defineProperty(exports, "Flow", {
|
|
12
13
|
enumerable: true,
|
|
@@ -27,6 +28,12 @@ Object.defineProperty(exports, "FlowProvider", {
|
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
30
|
exports.default = void 0;
|
|
31
|
+
Object.defineProperty(exports, "setInitialState", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _FlowProvider.setInitialState;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
30
37
|
var _Flow = require("./Flow");
|
|
31
38
|
var _createFlow = require("./hoc/createFlow");
|
|
32
39
|
Object.keys(_createFlow).forEach(function (key) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2026-01-25 09:36
|
|
4
|
+
* @modified:2026/1/25 09:36 by yanxianliang
|
|
5
|
+
* @desc: Context管理
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2026 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { UseBoundStore } from "zustand";
|
|
11
|
+
import type { StoreApi } from "zustand/vanilla";
|
|
12
|
+
import { BaseStateType } from "../../types";
|
|
13
|
+
export declare const FlowContext: React.Context<{
|
|
14
|
+
useStore?: UseBoundStore<StoreApi<BaseStateType>> | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["Context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,eAAO,MAAM,WAAW;;EAEe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FlowContext = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
/**
|
|
10
|
+
* @author: yanxianliang
|
|
11
|
+
* @date: 2026-01-25 09:36
|
|
12
|
+
* @modified:2026/1/25 09:36 by yanxianliang
|
|
13
|
+
* @desc: Context管理
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2026 by yanxianliang, All Rights Reserved.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// Context 外部提供,支持 inner hooks
|
|
19
|
+
const FlowContext = exports.FlowContext = /*#__PURE__*/_react.default.createContext(null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["Provider.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,QAAQ;cAKP,MAAM,SAAS;;6CAkB5B,CAAC"}
|