@rkmodules/rules 0.0.73 → 0.0.75
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/dist/index.cjs.js +128 -70
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +128 -70
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/Flow/Context.d.ts +7 -0
- package/dist/lib/Flow/index.d.ts +2 -1
- package/dist/lib/Flow/types.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Engine, GraphedFunction } from "../Engine";
|
|
3
3
|
import { WidgetProps } from "./Components/Control";
|
|
4
|
+
import { Prompts } from "./types";
|
|
4
5
|
type FlowContextState = {
|
|
5
6
|
engine: Engine;
|
|
6
7
|
graphedFn: GraphedFunction;
|
|
7
8
|
controls?: Record<string, React.ComponentType<WidgetProps<any>>>;
|
|
9
|
+
prompts?: Prompts;
|
|
8
10
|
};
|
|
9
11
|
export declare const FlowContext: React.Context<FlowContextState>;
|
|
10
12
|
export declare const useEngine: () => Engine;
|
|
11
13
|
export declare const useControls: () => {};
|
|
12
14
|
export declare const useGraphedFunction: () => GraphedFunction;
|
|
15
|
+
export declare const usePrompts: () => {
|
|
16
|
+
confirm: ((string: any) => Promise<boolean>) | typeof confirm;
|
|
17
|
+
alert: typeof alert;
|
|
18
|
+
prompt: ((string: any, defaultValue?: string) => Promise<string | null>) | typeof prompt;
|
|
19
|
+
};
|
|
13
20
|
export {};
|
package/dist/lib/Flow/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { XYPosition } from "@xyflow/react";
|
|
|
3
3
|
import { GraphedFunction } from "../Engine/types";
|
|
4
4
|
import { Engine } from "../Engine";
|
|
5
5
|
import { WidgetProps } from "./Components/Control";
|
|
6
|
-
import { Updater } from "./types";
|
|
6
|
+
import { Prompts, Updater } from "./types";
|
|
7
7
|
import "./style/xyflow.css";
|
|
8
8
|
export * from "./types";
|
|
9
9
|
/**
|
|
@@ -19,5 +19,6 @@ interface FlowProps {
|
|
|
19
19
|
onClick?: (event: React.MouseEvent, position: XYPosition) => void;
|
|
20
20
|
onSelect?: (ids: string[]) => void;
|
|
21
21
|
customControls?: Record<string, React.ComponentType<WidgetProps<any>>>;
|
|
22
|
+
customPrompts?: Prompts;
|
|
22
23
|
}
|
|
23
24
|
export declare function Flow(props: FlowProps): React.JSX.Element;
|
package/dist/lib/Flow/types.d.ts
CHANGED
|
@@ -17,3 +17,8 @@ export type NodeDropItem = {
|
|
|
17
17
|
fn: PrimitiveFunction;
|
|
18
18
|
};
|
|
19
19
|
export type Updater<T> = (oldValue: T) => T;
|
|
20
|
+
export interface Prompts {
|
|
21
|
+
confirm: (string: any) => Promise<boolean>;
|
|
22
|
+
alert: (string: any) => Promise<void>;
|
|
23
|
+
prompt: (string: any, defaultValue?: string) => Promise<string | null>;
|
|
24
|
+
}
|