@knotx/core 0.4.4 → 0.4.6

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.
@@ -1,4 +1,4 @@
1
1
  import 'jsonschema';
2
2
  import 'rxjs';
3
- export { C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.cjs';
3
+ export { C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.cjs';
4
4
  import '@knotx/data';
@@ -1,4 +1,4 @@
1
1
  import 'jsonschema';
2
2
  import 'rxjs';
3
- export { C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.mjs';
3
+ export { C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.mjs';
4
4
  import '@knotx/data';
@@ -1,4 +1,4 @@
1
1
  import 'jsonschema';
2
2
  import 'rxjs';
3
- export { C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.js';
3
+ export { C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.js';
4
4
  import '@knotx/data';
package/dist/index.cjs CHANGED
@@ -4,7 +4,6 @@ const definition = require('./definition.cjs');
4
4
  const jsonschema = require('jsonschema');
5
5
  const lodashEs = require('lodash-es');
6
6
  const rxjs = require('rxjs');
7
- const core = require('@knotx/core');
8
7
  const utils = require('@knotx/utils');
9
8
  const data = require('@knotx/data');
10
9
 
@@ -150,24 +149,12 @@ var __spreadValues$2 = (a, b) => {
150
149
  function getLayerRenders(plugin) {
151
150
  var _a;
152
151
  const components = [];
153
- let isRenderConsumed = false;
154
152
  for (const [name, layer] of Object.entries((_a = Reflect.get(plugin, utils.getSymbol("layer"))) != null ? _a : {})) {
155
153
  components.push(__spreadValues$2({
156
154
  plugin: plugin.name,
157
155
  name: `${plugin.name}:${name}`,
158
156
  render: wrapRender(Reflect.get(plugin, name), plugin)
159
157
  }, layer));
160
- if (name === "render") {
161
- isRenderConsumed = true;
162
- }
163
- }
164
- if (!isRenderConsumed && plugin.render) {
165
- components.push({
166
- plugin: plugin.name,
167
- name: `${plugin.name}:render`,
168
- layer: core.Layer.Foreground,
169
- render: wrapRender(plugin.render, plugin)
170
- });
171
158
  }
172
159
  return components;
173
160
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Engine } from './shared/core.DA6YV1kV.cjs';
2
- export { G as BasePlugin, A as CallToolMethod, C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, D as Interaction, F as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.cjs';
1
+ import { E as Engine } from './shared/core.CWQeg3bH.cjs';
2
+ export { J as BasePlugin, A as CallToolMethod, C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, F as Interaction, G as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.cjs';
3
3
  import { RenderType, IPlugin, LayerComponent } from '@knotx/core';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
  export * from '@knotx/data';
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Engine } from './shared/core.DA6YV1kV.mjs';
2
- export { G as BasePlugin, A as CallToolMethod, C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, D as Interaction, F as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.mjs';
1
+ import { E as Engine } from './shared/core.CWQeg3bH.mjs';
2
+ export { J as BasePlugin, A as CallToolMethod, C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, F as Interaction, G as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.mjs';
3
3
  import { RenderType, IPlugin, LayerComponent } from '@knotx/core';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
  export * from '@knotx/data';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Engine } from './shared/core.DA6YV1kV.js';
2
- export { G as BasePlugin, A as CallToolMethod, C as Container, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, D as Interaction, F as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.DA6YV1kV.js';
1
+ import { E as Engine } from './shared/core.CWQeg3bH.js';
2
+ export { J as BasePlugin, A as CallToolMethod, C as Container, D as Direction, d as Edge, e as EdgeConfig, v as EdgeOperation, t as EdgeOperationPipe, x as EdgeOperatorFunction, f as EdgeProps, i as EdgeRender, h as EdgeRenderType, z as EngineOptions, p as EngineTools, H as HorizontalAlignment, y as IEngineRuntime, k as IPlugin, q as IPluginInfo, I as IRecord, r as IToolInfo, F as Interaction, G as InteractionManager, B as InteractionPriority, L as Layer, j as LayerComponent, b as Node, a as NodeMeasured, u as NodeOperation, s as NodeOperationPipe, w as NodeOperatorFunction, N as NodePosition, c as NodeProps, g as NodeRenderType, l as Plugin, m as PluginConfigs, n as PluginData, o as PluginTools, P as Position, R as RenderType, V as VerticalAlignment } from './shared/core.CWQeg3bH.js';
3
3
  import { RenderType, IPlugin, LayerComponent } from '@knotx/core';
4
4
  import { BehaviorSubject } from 'rxjs';
5
5
  export * from '@knotx/data';
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@ export { Layer } from './definition.js';
2
2
  import { Validator } from 'jsonschema';
3
3
  import { set, get } from 'lodash-es';
4
4
  import { BehaviorSubject, identity } from 'rxjs';
5
- import { Layer } from '@knotx/core';
6
5
  import { getSymbol } from '@knotx/utils';
7
6
  export * from '@knotx/utils';
8
7
  import { DataManager } from '@knotx/data';
@@ -150,24 +149,12 @@ var __spreadValues$2 = (a, b) => {
150
149
  function getLayerRenders(plugin) {
151
150
  var _a;
152
151
  const components = [];
153
- let isRenderConsumed = false;
154
152
  for (const [name, layer] of Object.entries((_a = Reflect.get(plugin, getSymbol("layer"))) != null ? _a : {})) {
155
153
  components.push(__spreadValues$2({
156
154
  plugin: plugin.name,
157
155
  name: `${plugin.name}:${name}`,
158
156
  render: wrapRender(Reflect.get(plugin, name), plugin)
159
157
  }, layer));
160
- if (name === "render") {
161
- isRenderConsumed = true;
162
- }
163
- }
164
- if (!isRenderConsumed && plugin.render) {
165
- components.push({
166
- plugin: plugin.name,
167
- name: `${plugin.name}:render`,
168
- layer: Layer.Foreground,
169
- render: wrapRender(plugin.render, plugin)
170
- });
171
158
  }
172
159
  return components;
173
160
  }
@@ -123,7 +123,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
123
123
  get nodes(): Node<TNode>[];
124
124
  get edges(): Edge<TEdge>[];
125
125
  get layers(): Map<number, LayerComponent<TRenderType>[]>;
126
- get plugins(): IPlugin<string, any, RenderType>[];
126
+ get plugins(): IPlugin<string, any>[];
127
127
  constructor(options: EngineOptions<TNode, TEdge>);
128
128
  private init;
129
129
  callTool: CallToolMethod;
@@ -173,7 +173,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
173
173
  destroy(): void;
174
174
  }
175
175
 
176
- declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig, TRenderType> {
176
+ declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig> {
177
177
  abstract name: TPluginName;
178
178
  constructor(__: TPluginConfig);
179
179
  private static _instanceId;
@@ -190,6 +190,7 @@ declare abstract class BasePlugin<TPluginName extends string = string, TPluginCo
190
190
 
191
191
  type HorizontalAlignment = 'left' | 'right';
192
192
  type VerticalAlignment = 'top' | 'bottom';
193
+ type Direction = 'horizontal' | 'vertical';
193
194
  type IRecord = Record<string, any>;
194
195
  interface NodePosition {
195
196
  x: number;
@@ -262,14 +263,13 @@ interface LayerComponent<TRenderType> {
262
263
  */
263
264
  offset?: number;
264
265
  }
265
- interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> {
266
+ interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any> {
266
267
  name: TPluginName;
267
268
  pluginId: string;
268
269
  description?: string;
269
270
  onInit?: (config: TPluginConfig) => void;
270
271
  onConfigChange?: (config: TPluginConfig) => void;
271
272
  onDestroy?: () => void;
272
- render?: (...args: Parameters<TRenderType>) => ReturnType<TRenderType>;
273
273
  }
274
274
  type Plugin<TName extends string = string, TConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> = new (__: TConfig) => BasePlugin<TName, TConfig, TRenderType>;
275
275
  type PluginConfigs<TPlugins extends Plugin[]> = ((TPlugins[number] extends Plugin<infer T> ? {
@@ -329,4 +329,4 @@ interface IEngineRuntime {
329
329
  };
330
330
  }
331
331
 
332
- export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Interaction as D, Engine as E, InteractionManager as F, BasePlugin as G, type HorizontalAlignment as H, type IRecord as I, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
332
+ export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Direction as D, Engine as E, type Interaction as F, InteractionManager as G, type HorizontalAlignment as H, type IRecord as I, BasePlugin as J, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
@@ -123,7 +123,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
123
123
  get nodes(): Node<TNode>[];
124
124
  get edges(): Edge<TEdge>[];
125
125
  get layers(): Map<number, LayerComponent<TRenderType>[]>;
126
- get plugins(): IPlugin<string, any, RenderType>[];
126
+ get plugins(): IPlugin<string, any>[];
127
127
  constructor(options: EngineOptions<TNode, TEdge>);
128
128
  private init;
129
129
  callTool: CallToolMethod;
@@ -173,7 +173,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
173
173
  destroy(): void;
174
174
  }
175
175
 
176
- declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig, TRenderType> {
176
+ declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig> {
177
177
  abstract name: TPluginName;
178
178
  constructor(__: TPluginConfig);
179
179
  private static _instanceId;
@@ -190,6 +190,7 @@ declare abstract class BasePlugin<TPluginName extends string = string, TPluginCo
190
190
 
191
191
  type HorizontalAlignment = 'left' | 'right';
192
192
  type VerticalAlignment = 'top' | 'bottom';
193
+ type Direction = 'horizontal' | 'vertical';
193
194
  type IRecord = Record<string, any>;
194
195
  interface NodePosition {
195
196
  x: number;
@@ -262,14 +263,13 @@ interface LayerComponent<TRenderType> {
262
263
  */
263
264
  offset?: number;
264
265
  }
265
- interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> {
266
+ interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any> {
266
267
  name: TPluginName;
267
268
  pluginId: string;
268
269
  description?: string;
269
270
  onInit?: (config: TPluginConfig) => void;
270
271
  onConfigChange?: (config: TPluginConfig) => void;
271
272
  onDestroy?: () => void;
272
- render?: (...args: Parameters<TRenderType>) => ReturnType<TRenderType>;
273
273
  }
274
274
  type Plugin<TName extends string = string, TConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> = new (__: TConfig) => BasePlugin<TName, TConfig, TRenderType>;
275
275
  type PluginConfigs<TPlugins extends Plugin[]> = ((TPlugins[number] extends Plugin<infer T> ? {
@@ -329,4 +329,4 @@ interface IEngineRuntime {
329
329
  };
330
330
  }
331
331
 
332
- export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Interaction as D, Engine as E, InteractionManager as F, BasePlugin as G, type HorizontalAlignment as H, type IRecord as I, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
332
+ export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Direction as D, Engine as E, type Interaction as F, InteractionManager as G, type HorizontalAlignment as H, type IRecord as I, BasePlugin as J, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
@@ -123,7 +123,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
123
123
  get nodes(): Node<TNode>[];
124
124
  get edges(): Edge<TEdge>[];
125
125
  get layers(): Map<number, LayerComponent<TRenderType>[]>;
126
- get plugins(): IPlugin<string, any, RenderType>[];
126
+ get plugins(): IPlugin<string, any>[];
127
127
  constructor(options: EngineOptions<TNode, TEdge>);
128
128
  private init;
129
129
  callTool: CallToolMethod;
@@ -173,7 +173,7 @@ declare class Engine<TRenderType extends RenderType = RenderType, TNode extends
173
173
  destroy(): void;
174
174
  }
175
175
 
176
- declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig, TRenderType> {
176
+ declare abstract class BasePlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = undefined, TRenderType extends RenderType = RenderType> implements IPlugin<TPluginName, TPluginConfig> {
177
177
  abstract name: TPluginName;
178
178
  constructor(__: TPluginConfig);
179
179
  private static _instanceId;
@@ -190,6 +190,7 @@ declare abstract class BasePlugin<TPluginName extends string = string, TPluginCo
190
190
 
191
191
  type HorizontalAlignment = 'left' | 'right';
192
192
  type VerticalAlignment = 'top' | 'bottom';
193
+ type Direction = 'horizontal' | 'vertical';
193
194
  type IRecord = Record<string, any>;
194
195
  interface NodePosition {
195
196
  x: number;
@@ -262,14 +263,13 @@ interface LayerComponent<TRenderType> {
262
263
  */
263
264
  offset?: number;
264
265
  }
265
- interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> {
266
+ interface IPlugin<TPluginName extends string = string, TPluginConfig extends IRecord | undefined = any> {
266
267
  name: TPluginName;
267
268
  pluginId: string;
268
269
  description?: string;
269
270
  onInit?: (config: TPluginConfig) => void;
270
271
  onConfigChange?: (config: TPluginConfig) => void;
271
272
  onDestroy?: () => void;
272
- render?: (...args: Parameters<TRenderType>) => ReturnType<TRenderType>;
273
273
  }
274
274
  type Plugin<TName extends string = string, TConfig extends IRecord | undefined = any, TRenderType extends RenderType = RenderType> = new (__: TConfig) => BasePlugin<TName, TConfig, TRenderType>;
275
275
  type PluginConfigs<TPlugins extends Plugin[]> = ((TPlugins[number] extends Plugin<infer T> ? {
@@ -329,4 +329,4 @@ interface IEngineRuntime {
329
329
  };
330
330
  }
331
331
 
332
- export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Interaction as D, Engine as E, InteractionManager as F, BasePlugin as G, type HorizontalAlignment as H, type IRecord as I, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
332
+ export { type CallToolMethod as A, InteractionPriority as B, type Container as C, type Direction as D, Engine as E, type Interaction as F, InteractionManager as G, type HorizontalAlignment as H, type IRecord as I, BasePlugin as J, Layer as L, type NodePosition as N, type Position as P, type RenderType as R, type VerticalAlignment as V, type NodeMeasured as a, type Node as b, type NodeProps as c, type Edge as d, type EdgeConfig as e, type EdgeProps as f, type NodeRenderType as g, type EdgeRenderType as h, type EdgeRender as i, type LayerComponent as j, type IPlugin as k, type Plugin as l, type PluginConfigs as m, type PluginData as n, type PluginTools as o, type EngineTools as p, type IPluginInfo as q, type IToolInfo as r, type NodeOperationPipe as s, type EdgeOperationPipe as t, type NodeOperation as u, type EdgeOperation as v, type NodeOperatorFunction as w, type EdgeOperatorFunction as x, type IEngineRuntime as y, type EngineOptions as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/core",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Core for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -46,14 +46,14 @@
46
46
  "jsonschema": "^1.5.0",
47
47
  "lodash-es": "^4.17.21",
48
48
  "rxjs": "^7.8.1",
49
- "@knotx/data": "0.4.4",
50
- "@knotx/utils": "0.4.4"
49
+ "@knotx/data": "0.4.6",
50
+ "@knotx/utils": "0.4.6"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/lodash-es": "^4.17.12",
54
- "@knotx/build-config": "0.4.4",
55
- "@knotx/eslint-config": "0.4.4",
56
- "@knotx/typescript-config": "0.4.4"
54
+ "@knotx/build-config": "0.4.6",
55
+ "@knotx/eslint-config": "0.4.6",
56
+ "@knotx/typescript-config": "0.4.6"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "unbuild",