@nocobase/flow-engine 2.1.0-beta.36 → 2.1.0-beta.37
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { FlowContext, FlowEngineContext } from './flowContext';
|
|
11
|
-
import { FlowView } from './views/FlowView';
|
|
11
|
+
import { FlowView, FlowViewer } from './views/FlowView';
|
|
12
12
|
export declare const FlowReactContext: React.Context<FlowContext>;
|
|
13
13
|
export declare const FlowViewContext: React.Context<FlowContext>;
|
|
14
14
|
export declare function FlowContextProvider(props: {
|
|
@@ -22,3 +22,7 @@ export declare const FlowViewContextProvider: React.MemoExoticComponent<(props:
|
|
|
22
22
|
export declare function useFlowContext<T = FlowEngineContext>(): T;
|
|
23
23
|
export declare function useFlowViewContext<T = FlowEngineContext>(): T;
|
|
24
24
|
export declare function useFlowView(): FlowView;
|
|
25
|
+
/**
|
|
26
|
+
* Access the `FlowViewer` that opens new drawers / modals / pages (`viewer.drawer({...})`, `viewer.modal({...})`, etc.). This is the counterpart to `useFlowView()`: `useFlowView()` returns the *current* mounted view (use it to close yourself, render Header/Footer slots, etc.), while `useFlowViewer()` returns the surface that lets you open a *new* view from inside any flow-context subtree.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useFlowViewer(): FlowViewer;
|
|
@@ -43,7 +43,8 @@ __export(FlowContextProvider_exports, {
|
|
|
43
43
|
FlowViewContextProvider: () => FlowViewContextProvider,
|
|
44
44
|
useFlowContext: () => useFlowContext,
|
|
45
45
|
useFlowView: () => useFlowView,
|
|
46
|
-
useFlowViewContext: () => useFlowViewContext
|
|
46
|
+
useFlowViewContext: () => useFlowViewContext,
|
|
47
|
+
useFlowViewer: () => useFlowViewer
|
|
47
48
|
});
|
|
48
49
|
module.exports = __toCommonJS(FlowContextProvider_exports);
|
|
49
50
|
var import_react = __toESM(require("react"));
|
|
@@ -70,6 +71,11 @@ function useFlowView() {
|
|
|
70
71
|
return ctx.view;
|
|
71
72
|
}
|
|
72
73
|
__name(useFlowView, "useFlowView");
|
|
74
|
+
function useFlowViewer() {
|
|
75
|
+
const ctx = useFlowContext();
|
|
76
|
+
return ctx.viewer;
|
|
77
|
+
}
|
|
78
|
+
__name(useFlowViewer, "useFlowViewer");
|
|
73
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
74
80
|
0 && (module.exports = {
|
|
75
81
|
FlowContextProvider,
|
|
@@ -78,5 +84,6 @@ __name(useFlowView, "useFlowView");
|
|
|
78
84
|
FlowViewContextProvider,
|
|
79
85
|
useFlowContext,
|
|
80
86
|
useFlowView,
|
|
81
|
-
useFlowViewContext
|
|
87
|
+
useFlowViewContext,
|
|
88
|
+
useFlowViewer
|
|
82
89
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/flow-engine",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.37",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A standalone flow engine for NocoBase, managing workflows, models, and actions.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@formily/antd-v5": "1.x",
|
|
10
10
|
"@formily/reactive": "2.x",
|
|
11
|
-
"@nocobase/sdk": "2.1.0-beta.
|
|
12
|
-
"@nocobase/shared": "2.1.0-beta.
|
|
11
|
+
"@nocobase/sdk": "2.1.0-beta.37",
|
|
12
|
+
"@nocobase/shared": "2.1.0-beta.37",
|
|
13
13
|
"ahooks": "^3.7.2",
|
|
14
14
|
"axios": "^1.7.0",
|
|
15
15
|
"dayjs": "^1.11.9",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
],
|
|
38
38
|
"author": "NocoBase Team",
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
|
|
41
41
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import React, { createContext, useContext } from 'react';
|
|
11
11
|
import { FlowContext, FlowEngineContext } from './flowContext';
|
|
12
|
-
import { FlowView } from './views/FlowView';
|
|
12
|
+
import { FlowView, FlowViewer } from './views/FlowView';
|
|
13
13
|
|
|
14
14
|
export const FlowReactContext = createContext<FlowContext>(null);
|
|
15
15
|
export const FlowViewContext = createContext<FlowContext>(null);
|
|
@@ -40,3 +40,11 @@ export function useFlowView() {
|
|
|
40
40
|
const ctx = useFlowContext();
|
|
41
41
|
return ctx.view as FlowView;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Access the `FlowViewer` that opens new drawers / modals / pages (`viewer.drawer({...})`, `viewer.modal({...})`, etc.). This is the counterpart to `useFlowView()`: `useFlowView()` returns the *current* mounted view (use it to close yourself, render Header/Footer slots, etc.), while `useFlowViewer()` returns the surface that lets you open a *new* view from inside any flow-context subtree.
|
|
46
|
+
*/
|
|
47
|
+
export function useFlowViewer() {
|
|
48
|
+
const ctx = useFlowContext();
|
|
49
|
+
return ctx.viewer as FlowViewer;
|
|
50
|
+
}
|