sequential-workflow-designer-react 0.35.2 → 0.36.0

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
@@ -184,10 +184,10 @@ function SequentialWorkflowDesigner(props) {
184
184
  var preferenceStorage = props.preferenceStorage;
185
185
  var extensions = props.extensions;
186
186
  var i18n = props.i18n;
187
- function forwardDefinition() {
187
+ function forwardDefinition(event) {
188
188
  if (designerRef.current) {
189
189
  var wd = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
190
- onDefinitionChangeRef.current(wd);
190
+ onDefinitionChangeRef.current(wd, event);
191
191
  }
192
192
  }
193
193
  function rootEditorProvider(def, context, isReadonly) {
@@ -311,7 +311,7 @@ function SequentialWorkflowDesigner(props) {
311
311
  designer.selectStepById(selectedStepId);
312
312
  }
313
313
  // console.log('sqd: designer rendered');
314
- designer.onReady.subscribe(forwardDefinition);
314
+ designer.onReady.subscribe(function () { return forwardDefinition(); });
315
315
  designer.onDefinitionChanged.subscribe(forwardDefinition);
316
316
  designer.onSelectedStepIdChanged.subscribe(function (stepId) {
317
317
  if (onSelectedStepIdChangedRef.current) {
package/lib/esm/index.js CHANGED
@@ -182,10 +182,10 @@ function SequentialWorkflowDesigner(props) {
182
182
  var preferenceStorage = props.preferenceStorage;
183
183
  var extensions = props.extensions;
184
184
  var i18n = props.i18n;
185
- function forwardDefinition() {
185
+ function forwardDefinition(event) {
186
186
  if (designerRef.current) {
187
187
  var wd = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
188
- onDefinitionChangeRef.current(wd);
188
+ onDefinitionChangeRef.current(wd, event);
189
189
  }
190
190
  }
191
191
  function rootEditorProvider(def, context, isReadonly) {
@@ -309,7 +309,7 @@ function SequentialWorkflowDesigner(props) {
309
309
  designer.selectStepById(selectedStepId);
310
310
  }
311
311
  // console.log('sqd: designer rendered');
312
- designer.onReady.subscribe(forwardDefinition);
312
+ designer.onReady.subscribe(function () { return forwardDefinition(); });
313
313
  designer.onDefinitionChanged.subscribe(forwardDefinition);
314
314
  designer.onSelectedStepIdChanged.subscribe(function (stepId) {
315
315
  if (onSelectedStepIdChangedRef.current) {
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { MutableRefObject, Context, ReactNode, DependencyList } from 'react';
3
3
  import ReactDOM from 'react-dom/client';
4
- import { Definition, RootEditorContext, SimpleEvent, Designer, ToolboxConfiguration, RootEditorProvider, StepEditorProvider, StepsConfiguration, ValidatorConfiguration, PlaceholderConfiguration, KeyboardConfiguration, PreferenceStorage, CustomActionHandler, DesignerExtension, I18n, Step, StepEditorContext } from 'sequential-workflow-designer';
4
+ import { Definition, RootEditorContext, SimpleEvent, Designer, ToolboxConfiguration, DefinitionChangedEvent, RootEditorProvider, StepEditorProvider, StepsConfiguration, ValidatorConfiguration, PlaceholderConfiguration, KeyboardConfiguration, PreferenceStorage, CustomActionHandler, DesignerExtension, I18n, Step, StepEditorContext } from 'sequential-workflow-designer';
5
5
 
6
6
  declare class Presenter {
7
7
  static render(className: string, rootRef: MutableRefObject<ReactDOM.Root | null>, element: JSX.Element): HTMLElement;
@@ -75,7 +75,7 @@ declare function useSequentialWorkflowDesignerController(deps?: DependencyList):
75
75
  type ReactToolboxConfiguration = Omit<ToolboxConfiguration, 'isCollapsed'>;
76
76
  interface SequentialWorkflowDesignerProps<TDefinition extends Definition> {
77
77
  definition: WrappedDefinition<TDefinition>;
78
- onDefinitionChange: (state: WrappedDefinition<TDefinition>) => void;
78
+ onDefinitionChange: (state: WrappedDefinition<TDefinition>, event?: DefinitionChangedEvent) => void;
79
79
  selectedStepId?: string | null;
80
80
  onSelectedStepIdChanged?: (stepId: string | null) => void;
81
81
  onStepUnselectionBlocked?: (targetStepId: string | null) => void;
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.35.2",
4
+ "version": "0.36.0",
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.35.2"
50
+ "sequential-workflow-designer": "^0.36.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -63,7 +63,7 @@
63
63
  "prettier": "^3.2.5",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0",
66
- "sequential-workflow-designer": "^0.35.2",
66
+ "sequential-workflow-designer": "^0.36.0",
67
67
  "rollup": "^4.40.0",
68
68
  "rollup-plugin-dts": "^6.2.1",
69
69
  "rollup-plugin-typescript2": "^0.36.0",