@knotx/react 0.2.12 → 0.2.14

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
@@ -10,12 +10,15 @@ const pluginsBaseRender = require('@knotx/plugins-base-render');
10
10
  function useContainerRef(onResize) {
11
11
  const [container, setContainer] = react.useState();
12
12
  const [_, setSize] = react.useState();
13
+ const onResizeRef = react.useRef(onResize);
14
+ onResizeRef.current = onResize;
13
15
  react.useLayoutEffect(() => {
14
16
  if (!container)
15
17
  return;
16
18
  const resizeObserver = new ResizeObserver((entries) => {
19
+ var _a;
17
20
  const { width, height } = entries[0].contentRect;
18
- onResize({ width, height });
21
+ (_a = onResizeRef.current) == null ? void 0 : _a.call(onResizeRef, { width, height });
19
22
  setSize({ width, height });
20
23
  });
21
24
  resizeObserver.observe(container);
@@ -59,6 +62,29 @@ function useLayerContent(engineRef) {
59
62
  ) });
60
63
  }
61
64
 
65
+ function useDataUpdate(engineRef, { nodes, edges, initRef }) {
66
+ react.useEffect(() => {
67
+ const engine = engineRef.current;
68
+ if (!engine || !initRef.current) {
69
+ return;
70
+ }
71
+ const previousNodes = engine.nodesManager.dataMap$.value;
72
+ const currentNodes = new Map(nodes == null ? void 0 : nodes.map((node) => [node.id, node]));
73
+ const operation = core.buildDiffOperation(previousNodes, currentNodes);
74
+ engine.dispatchNodeOperation(operation);
75
+ }, [nodes, nodes == null ? void 0 : nodes.length]);
76
+ react.useEffect(() => {
77
+ const engine = engineRef.current;
78
+ if (!engine || !initRef.current) {
79
+ return;
80
+ }
81
+ const previousEdges = engine.edgesManager.dataMap$.value;
82
+ const currentEdges = new Map(edges == null ? void 0 : edges.map((edge) => [edge.id, edge]));
83
+ const operation = core.buildDiffOperation(previousEdges, currentEdges);
84
+ engine.dispatchEdgeOperation(operation);
85
+ }, [edges, edges == null ? void 0 : edges.length]);
86
+ }
87
+
62
88
  function useEngineRef() {
63
89
  const engineRef = react.useRef(null);
64
90
  react.useLayoutEffect(() => () => {
@@ -76,10 +102,14 @@ function useMergedPlugins(plugins, disablePresetPlugins) {
76
102
  return [pluginsBaseRender.BaseRender, ...plugins || []];
77
103
  }, [disablePresetPlugins, plugins]);
78
104
  }
79
- function usePluginConfigUpdate(engineRef, pluginConfig = {}) {
105
+ function usePluginConfigUpdate(engineRef, {
106
+ initRef,
107
+ pluginConfig = {}
108
+ }) {
80
109
  const pluginConfigRef = react.useRef(pluginConfig);
81
110
  react.useLayoutEffect(() => {
82
- if (!engineRef.current) {
111
+ const engine = engineRef.current;
112
+ if (!engine || !initRef.current) {
83
113
  return;
84
114
  }
85
115
  for (const pluginName in pluginConfig) {
@@ -88,7 +118,7 @@ function usePluginConfigUpdate(engineRef, pluginConfig = {}) {
88
118
  continue;
89
119
  }
90
120
  pluginConfigRef.current[pluginName] = pluginConfigValue;
91
- engineRef.current.changePluginConfig(pluginName, pluginConfigValue);
121
+ engine.changePluginConfig(pluginName, pluginConfigValue);
92
122
  }
93
123
  });
94
124
  }
@@ -112,24 +142,39 @@ var __spreadValues = (a, b) => {
112
142
  const Knotx = react.memo(react.forwardRef(({
113
143
  className,
114
144
  style,
145
+ initialNodes,
146
+ initialEdges,
115
147
  nodes,
116
148
  edges,
117
149
  plugins: _plugins,
118
150
  pluginConfig,
119
- disablePresetPlugins = false
151
+ disablePresetPlugins = false,
152
+ onInit
120
153
  }, ref) => {
154
+ const initRef = react.useRef(false);
121
155
  const engineRef = useEngineRef();
122
156
  const plugins = useMergedPlugins(_plugins, disablePresetPlugins);
123
157
  const setContainer = useContainerRef((containerSize) => {
124
158
  if (engineRef.current) {
125
159
  engineRef.current.container = containerSize;
126
160
  } else {
127
- engineRef.current = initReactEngine({ container: containerSize, nodes, edges, plugins, pluginConfig });
161
+ engineRef.current = initReactEngine({
162
+ container: containerSize,
163
+ nodes: nodes != null ? nodes : initialNodes,
164
+ edges: edges != null ? edges : initialEdges,
165
+ plugins,
166
+ pluginConfig
167
+ });
128
168
  }
129
169
  });
130
170
  react.useImperativeHandle(ref, () => ({ engineRef }));
131
- usePluginConfigUpdate(engineRef, pluginConfig);
171
+ useDataUpdate(engineRef, { nodes, edges, initRef });
172
+ usePluginConfigUpdate(engineRef, { pluginConfig, initRef });
132
173
  const content = useLayerContent(engineRef);
174
+ if (!initRef.current && engineRef.current && content) {
175
+ initRef.current = true;
176
+ onInit == null ? void 0 : onInit(engineRef.current);
177
+ }
133
178
  return /* @__PURE__ */ jsxRuntime.jsx(
134
179
  "div",
135
180
  {
package/dist/index.d.cts CHANGED
@@ -1,17 +1,33 @@
1
- import { Engine, Plugin, NodeData, EdgeData } from '@knotx/core';
2
- export { EdgeData, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, NodeData, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge } from '@knotx/core';
2
+ export { 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
 
5
- type ReactEngine = Engine<FC<any>>;
6
- interface KnotxInstance {
7
- engineRef: MutableRefObject<ReactEngine | null>;
5
+ type ReactEngine<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = Engine<FC<any>, TNode, TEdge>;
6
+ interface KnotxInstance<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> {
7
+ engineRef: MutableRefObject<ReactEngine<TNode, TEdge> | null>;
8
8
  }
9
- type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
10
- ref?: Ref<KnotxInstance> | undefined;
9
+ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = {
10
+ ref?: Ref<KnotxInstance<TNode, TEdge>> | undefined;
11
11
  className?: string;
12
12
  style?: CSSProperties;
13
- nodes?: NodeData[];
14
- edges?: EdgeData[];
13
+ /**
14
+ * initial nodes used to create engine
15
+ */
16
+ initialNodes?: Node<TNode>[];
17
+ /**
18
+ * initial edges used to create engine
19
+ */
20
+ initialEdges?: Edge<TEdge>[];
21
+ /**
22
+ * auto dispatch diff operation to engine when nodes changed
23
+ * if not provided , use initialNodes
24
+ */
25
+ nodes?: Node<TNode>[];
26
+ /**
27
+ * auto dispatch diff operation to engine when edges changed
28
+ * if not provided, use initialEdges
29
+ */
30
+ edges?: Edge<TEdge>[];
15
31
  plugins?: TPlugins;
16
32
  /**
17
33
  * disable preset plugins
@@ -20,6 +36,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
20
36
  * @default false
21
37
  */
22
38
  disablePresetPlugins?: boolean;
39
+ onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
23
40
  } & ((TPlugins[number] extends Plugin<infer T> ? {
24
41
  [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;
25
42
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
@@ -29,7 +46,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
29
46
  } : {});
30
47
 
31
48
  declare const Knotx: {
32
- <TPlugins extends Plugin[]>(props: KnotxProps<TPlugins>, ref: ForwardedRef<KnotxInstance>): ReactElement | null;
49
+ <TPlugins extends Plugin[], TNode extends IRecord, TEdge extends IRecord>(props: KnotxProps<TPlugins, TNode, TEdge>, ref: ForwardedRef<KnotxInstance<TNode, TEdge>>): ReactElement | null;
33
50
  displayName?: string | undefined;
34
51
  };
35
52
 
package/dist/index.d.mts CHANGED
@@ -1,17 +1,33 @@
1
- import { Engine, Plugin, NodeData, EdgeData } from '@knotx/core';
2
- export { EdgeData, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, NodeData, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge } from '@knotx/core';
2
+ export { 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
 
5
- type ReactEngine = Engine<FC<any>>;
6
- interface KnotxInstance {
7
- engineRef: MutableRefObject<ReactEngine | null>;
5
+ type ReactEngine<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = Engine<FC<any>, TNode, TEdge>;
6
+ interface KnotxInstance<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> {
7
+ engineRef: MutableRefObject<ReactEngine<TNode, TEdge> | null>;
8
8
  }
9
- type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
10
- ref?: Ref<KnotxInstance> | undefined;
9
+ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = {
10
+ ref?: Ref<KnotxInstance<TNode, TEdge>> | undefined;
11
11
  className?: string;
12
12
  style?: CSSProperties;
13
- nodes?: NodeData[];
14
- edges?: EdgeData[];
13
+ /**
14
+ * initial nodes used to create engine
15
+ */
16
+ initialNodes?: Node<TNode>[];
17
+ /**
18
+ * initial edges used to create engine
19
+ */
20
+ initialEdges?: Edge<TEdge>[];
21
+ /**
22
+ * auto dispatch diff operation to engine when nodes changed
23
+ * if not provided , use initialNodes
24
+ */
25
+ nodes?: Node<TNode>[];
26
+ /**
27
+ * auto dispatch diff operation to engine when edges changed
28
+ * if not provided, use initialEdges
29
+ */
30
+ edges?: Edge<TEdge>[];
15
31
  plugins?: TPlugins;
16
32
  /**
17
33
  * disable preset plugins
@@ -20,6 +36,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
20
36
  * @default false
21
37
  */
22
38
  disablePresetPlugins?: boolean;
39
+ onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
23
40
  } & ((TPlugins[number] extends Plugin<infer T> ? {
24
41
  [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;
25
42
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
@@ -29,7 +46,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
29
46
  } : {});
30
47
 
31
48
  declare const Knotx: {
32
- <TPlugins extends Plugin[]>(props: KnotxProps<TPlugins>, ref: ForwardedRef<KnotxInstance>): ReactElement | null;
49
+ <TPlugins extends Plugin[], TNode extends IRecord, TEdge extends IRecord>(props: KnotxProps<TPlugins, TNode, TEdge>, ref: ForwardedRef<KnotxInstance<TNode, TEdge>>): ReactElement | null;
33
50
  displayName?: string | undefined;
34
51
  };
35
52
 
package/dist/index.d.ts CHANGED
@@ -1,17 +1,33 @@
1
- import { Engine, Plugin, NodeData, EdgeData } from '@knotx/core';
2
- export { EdgeData, EdgeOperation, EdgeOperationPipe, EdgeOperatorFunction, EdgeProps, EdgeRenderType, EngineOptions, IData, IEngineRuntime, IPlugin, Layer, LayerComponent, NodeData, NodeMeasured, NodeOperation, NodeOperationPipe, NodeOperatorFunction, NodePosition, NodeProps, NodeRenderType, Plugin, PluginConfigs, PluginData, PluginTools, Position } from '@knotx/core';
1
+ import { IRecord, Engine, Plugin, Node, Edge } from '@knotx/core';
2
+ export { 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
 
5
- type ReactEngine = Engine<FC<any>>;
6
- interface KnotxInstance {
7
- engineRef: MutableRefObject<ReactEngine | null>;
5
+ type ReactEngine<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = Engine<FC<any>, TNode, TEdge>;
6
+ interface KnotxInstance<TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> {
7
+ engineRef: MutableRefObject<ReactEngine<TNode, TEdge> | null>;
8
8
  }
9
- type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
10
- ref?: Ref<KnotxInstance> | undefined;
9
+ type KnotxProps<TPlugins extends Plugin[] = Plugin[], TNode extends IRecord = IRecord, TEdge extends IRecord = IRecord> = {
10
+ ref?: Ref<KnotxInstance<TNode, TEdge>> | undefined;
11
11
  className?: string;
12
12
  style?: CSSProperties;
13
- nodes?: NodeData[];
14
- edges?: EdgeData[];
13
+ /**
14
+ * initial nodes used to create engine
15
+ */
16
+ initialNodes?: Node<TNode>[];
17
+ /**
18
+ * initial edges used to create engine
19
+ */
20
+ initialEdges?: Edge<TEdge>[];
21
+ /**
22
+ * auto dispatch diff operation to engine when nodes changed
23
+ * if not provided , use initialNodes
24
+ */
25
+ nodes?: Node<TNode>[];
26
+ /**
27
+ * auto dispatch diff operation to engine when edges changed
28
+ * if not provided, use initialEdges
29
+ */
30
+ edges?: Edge<TEdge>[];
15
31
  plugins?: TPlugins;
16
32
  /**
17
33
  * disable preset plugins
@@ -20,6 +36,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
20
36
  * @default false
21
37
  */
22
38
  disablePresetPlugins?: boolean;
39
+ onInit?: (engine: ReactEngine<TNode, TEdge>) => void;
23
40
  } & ((TPlugins[number] extends Plugin<infer T> ? {
24
41
  [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;
25
42
  } : {}) extends infer PluginConfig ? {} extends PluginConfig ? {
@@ -29,7 +46,7 @@ type KnotxProps<TPlugins extends Plugin[] = Plugin[]> = {
29
46
  } : {});
30
47
 
31
48
  declare const Knotx: {
32
- <TPlugins extends Plugin[]>(props: KnotxProps<TPlugins>, ref: ForwardedRef<KnotxInstance>): ReactElement | null;
49
+ <TPlugins extends Plugin[], TNode extends IRecord, TEdge extends IRecord>(props: KnotxProps<TPlugins, TNode, TEdge>, ref: ForwardedRef<KnotxInstance<TNode, TEdge>>): ReactElement | null;
33
50
  displayName?: string | undefined;
34
51
  };
35
52
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { Layer, Engine } from '@knotx/core';
3
- import { useState, useLayoutEffect, useRef, useMemo, memo, forwardRef, useImperativeHandle, useEffect } from 'react';
2
+ import { Layer, buildDiffOperation, Engine } from '@knotx/core';
3
+ import { useState, useRef, useLayoutEffect, useEffect, useMemo, memo, forwardRef, useImperativeHandle } from 'react';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
  import { map, distinctUntilChanged } from 'rxjs/operators';
6
6
  import { BaseRender } from '@knotx/plugins-base-render';
@@ -8,12 +8,15 @@ import { BaseRender } from '@knotx/plugins-base-render';
8
8
  function useContainerRef(onResize) {
9
9
  const [container, setContainer] = useState();
10
10
  const [_, setSize] = useState();
11
+ const onResizeRef = useRef(onResize);
12
+ onResizeRef.current = onResize;
11
13
  useLayoutEffect(() => {
12
14
  if (!container)
13
15
  return;
14
16
  const resizeObserver = new ResizeObserver((entries) => {
17
+ var _a;
15
18
  const { width, height } = entries[0].contentRect;
16
- onResize({ width, height });
19
+ (_a = onResizeRef.current) == null ? void 0 : _a.call(onResizeRef, { width, height });
17
20
  setSize({ width, height });
18
21
  });
19
22
  resizeObserver.observe(container);
@@ -57,6 +60,29 @@ function useLayerContent(engineRef) {
57
60
  ) });
58
61
  }
59
62
 
63
+ function useDataUpdate(engineRef, { nodes, edges, initRef }) {
64
+ useEffect(() => {
65
+ const engine = engineRef.current;
66
+ if (!engine || !initRef.current) {
67
+ return;
68
+ }
69
+ const previousNodes = engine.nodesManager.dataMap$.value;
70
+ const currentNodes = new Map(nodes == null ? void 0 : nodes.map((node) => [node.id, node]));
71
+ const operation = buildDiffOperation(previousNodes, currentNodes);
72
+ engine.dispatchNodeOperation(operation);
73
+ }, [nodes, nodes == null ? void 0 : nodes.length]);
74
+ useEffect(() => {
75
+ const engine = engineRef.current;
76
+ if (!engine || !initRef.current) {
77
+ return;
78
+ }
79
+ const previousEdges = engine.edgesManager.dataMap$.value;
80
+ const currentEdges = new Map(edges == null ? void 0 : edges.map((edge) => [edge.id, edge]));
81
+ const operation = buildDiffOperation(previousEdges, currentEdges);
82
+ engine.dispatchEdgeOperation(operation);
83
+ }, [edges, edges == null ? void 0 : edges.length]);
84
+ }
85
+
60
86
  function useEngineRef() {
61
87
  const engineRef = useRef(null);
62
88
  useLayoutEffect(() => () => {
@@ -74,10 +100,14 @@ function useMergedPlugins(plugins, disablePresetPlugins) {
74
100
  return [BaseRender, ...plugins || []];
75
101
  }, [disablePresetPlugins, plugins]);
76
102
  }
77
- function usePluginConfigUpdate(engineRef, pluginConfig = {}) {
103
+ function usePluginConfigUpdate(engineRef, {
104
+ initRef,
105
+ pluginConfig = {}
106
+ }) {
78
107
  const pluginConfigRef = useRef(pluginConfig);
79
108
  useLayoutEffect(() => {
80
- if (!engineRef.current) {
109
+ const engine = engineRef.current;
110
+ if (!engine || !initRef.current) {
81
111
  return;
82
112
  }
83
113
  for (const pluginName in pluginConfig) {
@@ -86,7 +116,7 @@ function usePluginConfigUpdate(engineRef, pluginConfig = {}) {
86
116
  continue;
87
117
  }
88
118
  pluginConfigRef.current[pluginName] = pluginConfigValue;
89
- engineRef.current.changePluginConfig(pluginName, pluginConfigValue);
119
+ engine.changePluginConfig(pluginName, pluginConfigValue);
90
120
  }
91
121
  });
92
122
  }
@@ -110,24 +140,39 @@ var __spreadValues = (a, b) => {
110
140
  const Knotx = memo(forwardRef(({
111
141
  className,
112
142
  style,
143
+ initialNodes,
144
+ initialEdges,
113
145
  nodes,
114
146
  edges,
115
147
  plugins: _plugins,
116
148
  pluginConfig,
117
- disablePresetPlugins = false
149
+ disablePresetPlugins = false,
150
+ onInit
118
151
  }, ref) => {
152
+ const initRef = useRef(false);
119
153
  const engineRef = useEngineRef();
120
154
  const plugins = useMergedPlugins(_plugins, disablePresetPlugins);
121
155
  const setContainer = useContainerRef((containerSize) => {
122
156
  if (engineRef.current) {
123
157
  engineRef.current.container = containerSize;
124
158
  } else {
125
- engineRef.current = initReactEngine({ container: containerSize, nodes, edges, plugins, pluginConfig });
159
+ engineRef.current = initReactEngine({
160
+ container: containerSize,
161
+ nodes: nodes != null ? nodes : initialNodes,
162
+ edges: edges != null ? edges : initialEdges,
163
+ plugins,
164
+ pluginConfig
165
+ });
126
166
  }
127
167
  });
128
168
  useImperativeHandle(ref, () => ({ engineRef }));
129
- usePluginConfigUpdate(engineRef, pluginConfig);
169
+ useDataUpdate(engineRef, { nodes, edges, initRef });
170
+ usePluginConfigUpdate(engineRef, { pluginConfig, initRef });
130
171
  const content = useLayerContent(engineRef);
172
+ if (!initRef.current && engineRef.current && content) {
173
+ initRef.current = true;
174
+ onInit == null ? void 0 : onInit(engineRef.current);
175
+ }
131
176
  return /* @__PURE__ */ jsx(
132
177
  "div",
133
178
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/react",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
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.2.9",
37
- "@knotx/jsx": "0.2.9",
38
- "@knotx/plugins-base-render": "0.2.11"
36
+ "@knotx/core": "0.2.11",
37
+ "@knotx/jsx": "0.2.11",
38
+ "@knotx/plugins-base-render": "0.2.13"
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.2.9",
46
- "@knotx/eslint-config": "0.2.9",
47
- "@knotx/jsx": "0.2.9",
48
- "@knotx/typescript-config": "0.2.9"
45
+ "@knotx/build-config": "0.2.11",
46
+ "@knotx/eslint-config": "0.2.11",
47
+ "@knotx/jsx": "0.2.11",
48
+ "@knotx/typescript-config": "0.2.11"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "unbuild",