@knotx/react 0.5.5 → 0.5.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/dist/index.cjs CHANGED
@@ -47,7 +47,8 @@ function initReactEngine({
47
47
  nodes = [],
48
48
  edges = [],
49
49
  plugins = [],
50
- pluginConfig = {}
50
+ pluginConfig = {},
51
+ logger
51
52
  }) {
52
53
  return new core.Engine({
53
54
  container,
@@ -79,7 +80,8 @@ function initReactEngine({
79
80
  return state;
80
81
  }
81
82
  }
82
- }
83
+ },
84
+ logger
83
85
  });
84
86
  }
85
87
 
@@ -211,7 +213,8 @@ const Knotx = react.memo(react.forwardRef(({
211
213
  pluginConfig,
212
214
  disablePresetPlugins = false,
213
215
  onInit,
214
- direction = "horizontal"
216
+ direction = "horizontal",
217
+ logger
215
218
  }, ref) => {
216
219
  const [, rerender] = react.useReducer((state) => state + 1, 0);
217
220
  const initRef = react.useRef(false);
@@ -223,7 +226,8 @@ const Knotx = react.memo(react.forwardRef(({
223
226
  nodes: nodes != null ? nodes : initialNodes,
224
227
  edges: edges != null ? edges : initialEdges,
225
228
  plugins,
226
- pluginConfig
229
+ pluginConfig,
230
+ logger
227
231
  });
228
232
  }
229
233
  const setContainer = useContainerRef((containerSize) => {
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { IRecord, Engine, Plugin, Node, Edge, Direction } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge, Direction, Logger } from '@knotx/core';
2
2
  export { Direction, Edge, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, Node, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
3
3
  import { FC, MutableRefObject, Ref, CSSProperties, ForwardedRef, ReactElement } from 'react';
4
4
 
@@ -45,6 +45,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IR
45
45
  disablePresetPlugins?: boolean;
46
46
  onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
47
47
  direction?: Direction;
48
+ logger?: Logger;
48
49
  } & ((TPlugins[number] extends Plugin<infer T> ? {
49
50
  [TName in T as Extract<TPlugins[number], Plugin<TName>> extends Plugin<TName, undefined> ? never : TName]: Extract<TPlugins[number], Plugin<TName>> extends infer T ? T extends Plugin<TName, infer TConfig> ? TConfig : never : never;
50
51
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { IRecord, Engine, Plugin, Node, Edge, Direction } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge, Direction, Logger } from '@knotx/core';
2
2
  export { Direction, Edge, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, Node, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
3
3
  import { FC, MutableRefObject, Ref, CSSProperties, ForwardedRef, ReactElement } from 'react';
4
4
 
@@ -45,6 +45,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IR
45
45
  disablePresetPlugins?: boolean;
46
46
  onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
47
47
  direction?: Direction;
48
+ logger?: Logger;
48
49
  } & ((TPlugins[number] extends Plugin<infer T> ? {
49
50
  [TName in T as Extract<TPlugins[number], Plugin<TName>> extends Plugin<TName, undefined> ? never : TName]: Extract<TPlugins[number], Plugin<TName>> extends infer T ? T extends Plugin<TName, infer TConfig> ? TConfig : never : never;
50
51
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IRecord, Engine, Plugin, Node, Edge, Direction } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge, Direction, Logger } from '@knotx/core';
2
2
  export { Direction, Edge, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, Node, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
3
3
  import { FC, MutableRefObject, Ref, CSSProperties, ForwardedRef, ReactElement } from 'react';
4
4
 
@@ -45,6 +45,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IR
45
45
  disablePresetPlugins?: boolean;
46
46
  onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
47
47
  direction?: Direction;
48
+ logger?: Logger;
48
49
  } & ((TPlugins[number] extends Plugin<infer T> ? {
49
50
  [TName in T as Extract<TPlugins[number], Plugin<TName>> extends Plugin<TName, undefined> ? never : TName]: Extract<TPlugins[number], Plugin<TName>> extends infer T ? T extends Plugin<TName, infer TConfig> ? TConfig : never : never;
50
51
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
package/dist/index.js CHANGED
@@ -45,7 +45,8 @@ function initReactEngine({
45
45
  nodes = [],
46
46
  edges = [],
47
47
  plugins = [],
48
- pluginConfig = {}
48
+ pluginConfig = {},
49
+ logger
49
50
  }) {
50
51
  return new Engine({
51
52
  container,
@@ -77,7 +78,8 @@ function initReactEngine({
77
78
  return state;
78
79
  }
79
80
  }
80
- }
81
+ },
82
+ logger
81
83
  });
82
84
  }
83
85
 
@@ -209,7 +211,8 @@ const Knotx = memo(forwardRef(({
209
211
  pluginConfig,
210
212
  disablePresetPlugins = false,
211
213
  onInit,
212
- direction = "horizontal"
214
+ direction = "horizontal",
215
+ logger
213
216
  }, ref) => {
214
217
  const [, rerender] = useReducer((state) => state + 1, 0);
215
218
  const initRef = useRef(false);
@@ -221,7 +224,8 @@ const Knotx = memo(forwardRef(({
221
224
  nodes: nodes != null ? nodes : initialNodes,
222
225
  edges: edges != null ? edges : initialEdges,
223
226
  plugins,
224
- pluginConfig
227
+ pluginConfig,
228
+ logger
225
229
  });
226
230
  }
227
231
  const setContainer = useContainerRef((containerSize) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/react",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "React for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -33,19 +33,19 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "rxjs": "^7.8.1",
36
- "@knotx/core": "0.5.5",
37
- "@knotx/jsx": "0.5.5",
38
- "@knotx/plugins-base-render": "0.5.5"
36
+ "@knotx/core": "0.5.7",
37
+ "@knotx/jsx": "0.5.7",
38
+ "@knotx/plugins-base-render": "0.5.7"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/react": "^17.0.0",
42
42
  "@types/react-dom": "^17.0.0",
43
43
  "react": "^17.0.0",
44
44
  "react-dom": "^17.0.0",
45
- "@knotx/build-config": "0.5.5",
46
- "@knotx/eslint-config": "0.5.5",
47
- "@knotx/jsx": "0.5.5",
48
- "@knotx/typescript-config": "0.5.5"
45
+ "@knotx/build-config": "0.5.7",
46
+ "@knotx/eslint-config": "0.5.7",
47
+ "@knotx/jsx": "0.5.7",
48
+ "@knotx/typescript-config": "0.5.7"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "unbuild",