@rkmodules/rules 0.0.119 → 0.0.121

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.
@@ -14,6 +14,7 @@ export type NormalizedVarDef = {
14
14
  max?: number;
15
15
  step?: number;
16
16
  allowEmpty?: boolean;
17
+ controlProps?: Record<string, any>;
17
18
  };
18
19
  export type VarDef = string | NormalizedVarDef;
19
20
  /**
@@ -1,14 +1,17 @@
1
1
  import React from "react";
2
2
  import { NormalizedVarDef } from "../../Engine";
3
+ import { FunctionNode } from "../types";
3
4
  export interface WidgetProps<T> {
4
5
  value: T;
5
6
  vardef: NormalizedVarDef;
7
+ data: FunctionNode["data"];
6
8
  onChange?: (value: T) => void;
7
9
  }
8
10
  interface ControlProps {
9
11
  value: any;
10
12
  vardef: NormalizedVarDef;
13
+ data: FunctionNode["data"];
11
14
  onChange?: (value: any) => void;
12
15
  }
13
- export declare function Control({ value, vardef, onChange }: ControlProps): React.JSX.Element;
16
+ export declare function Control({ value, vardef, data, onChange }: ControlProps): React.JSX.Element;
14
17
  export {};
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { ReactFlowInstance, XYPosition } from "@xyflow/react";
2
+ import { NodeProps, ReactFlowInstance, 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 { Prompts, Updater } from "./types";
6
+ import { FunctionNode, Prompts, Updater } from "./types";
7
7
  import "./style/xyflow.css";
8
8
  export * from "./types";
9
9
  export { GenericNode } from "./Components/GenericNode";
@@ -17,6 +17,7 @@ interface FlowProps {
17
17
  onClick?: (event: React.MouseEvent, position: XYPosition) => void;
18
18
  onSelect?: (ids: string[]) => void;
19
19
  customControls?: Record<string, React.ComponentType<WidgetProps<any>>>;
20
+ customNodes?: Record<string, React.ComponentType<NodeProps<FunctionNode>>>;
20
21
  customPrompts?: Prompts;
21
22
  onInit?: (instance: ReactFlowInstance) => void;
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkmodules/rules",
3
- "version": "0.0.119",
3
+ "version": "0.0.121",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",