sequential-workflow-designer-react 0.18.2 → 0.18.4

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/lib/cjs/index.cjs CHANGED
@@ -185,8 +185,8 @@ function SequentialWorkflowDesigner(props) {
185
185
  }
186
186
  function forwardDefinition() {
187
187
  if (designerRef.current) {
188
- var def = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
189
- onDefinitionChangeRef.current(def);
188
+ var wd = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
189
+ onDefinitionChangeRef.current(wd);
190
190
  }
191
191
  }
192
192
  function rootEditorProvider(def, context, isReadonly) {
@@ -367,6 +367,13 @@ var SequentialWorkflowDesignerController = /** @class */ (function () {
367
367
  this.updateRootComponent = function () {
368
368
  _this.getDesigner().updateRootComponent();
369
369
  };
370
+ /**
371
+ * Replaces the current definition with a new one and adds the previous definition to the undo stack.
372
+ * @param definition A new definition.
373
+ */
374
+ this.replaceDefinition = function (definition) {
375
+ return _this.getDesigner().replaceDefinition(definition);
376
+ };
370
377
  // Nothing...
371
378
  }
372
379
  SequentialWorkflowDesignerController.create = function () {
package/lib/esm/index.js CHANGED
@@ -183,8 +183,8 @@ function SequentialWorkflowDesigner(props) {
183
183
  }
184
184
  function forwardDefinition() {
185
185
  if (designerRef.current) {
186
- var def = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
187
- onDefinitionChangeRef.current(def);
186
+ var wd = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
187
+ onDefinitionChangeRef.current(wd);
188
188
  }
189
189
  }
190
190
  function rootEditorProvider(def, context, isReadonly) {
@@ -365,6 +365,13 @@ var SequentialWorkflowDesignerController = /** @class */ (function () {
365
365
  this.updateRootComponent = function () {
366
366
  _this.getDesigner().updateRootComponent();
367
367
  };
368
+ /**
369
+ * Replaces the current definition with a new one and adds the previous definition to the undo stack.
370
+ * @param definition A new definition.
371
+ */
372
+ this.replaceDefinition = function (definition) {
373
+ return _this.getDesigner().replaceDefinition(definition);
374
+ };
368
375
  // Nothing...
369
376
  }
370
377
  SequentialWorkflowDesignerController.create = function () {
package/lib/index.d.ts CHANGED
@@ -58,6 +58,11 @@ declare class SequentialWorkflowDesignerController {
58
58
  * @description Rerender the root component and all its children.
59
59
  */
60
60
  readonly updateRootComponent: () => void;
61
+ /**
62
+ * Replaces the current definition with a new one and adds the previous definition to the undo stack.
63
+ * @param definition A new definition.
64
+ */
65
+ readonly replaceDefinition: (definition: Definition) => Promise<void>;
61
66
  /**
62
67
  * @returns `true` if the controller is ready to be used, `false` otherwise.
63
68
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sequential-workflow-designer-react",
3
3
  "description": "React wrapper for Sequential Workflow Designer component.",
4
- "version": "0.18.2",
4
+ "version": "0.18.4",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  "peerDependencies": {
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0",
50
- "sequential-workflow-designer": "^0.18.2"
50
+ "sequential-workflow-designer": "^0.18.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@rollup/plugin-node-resolve": "^15.0.1",
@@ -63,7 +63,7 @@
63
63
  "prettier": "^2.8.2",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0",
66
- "sequential-workflow-designer": "^0.18.2",
66
+ "sequential-workflow-designer": "^0.18.4",
67
67
  "rollup": "^3.18.0",
68
68
  "rollup-plugin-dts": "^5.2.0",
69
69
  "rollup-plugin-typescript2": "^0.34.1",