sequential-workflow-designer-react 0.7.0 → 0.8.1
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 +245 -0
- package/lib/{SequentialWorkflowDesigner.js → esm/index.js} +234 -135
- package/lib/index.d.ts +56 -4
- package/package.json +31 -12
- package/lib/GlobalEditorWrapper.d.ts +0 -12
- package/lib/GlobalEditorWrapper.js +0 -39
- package/lib/SequentialWorkflowDesigner.d.ts +0 -18
- package/lib/StepEditorWrapper.d.ts +0 -20
- package/lib/StepEditorWrapper.js +0 -62
- package/lib/WrappedDefinition.d.ts +0 -6
- package/lib/WrappedDefinition.js +0 -6
- package/lib/index.js +0 -4
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var ReactDOM = require('react-dom/client');
|
|
6
|
+
var sequentialWorkflowDesigner = require('sequential-workflow-designer');
|
|
7
|
+
|
|
8
|
+
/******************************************************************************
|
|
9
|
+
Copyright (c) Microsoft Corporation.
|
|
10
|
+
|
|
11
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12
|
+
purpose with or without fee is hereby granted.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
+
***************************************************************************** */
|
|
22
|
+
|
|
23
|
+
var __assign = function() {
|
|
24
|
+
__assign = Object.assign || function __assign(t) {
|
|
25
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
26
|
+
s = arguments[i];
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
31
|
+
return __assign.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var globalEditorWrapperContext$1 = react.createContext(null);
|
|
35
|
+
function useGlobalEditor() {
|
|
36
|
+
var wrapper = react.useContext(globalEditorWrapperContext$1);
|
|
37
|
+
if (!wrapper) {
|
|
38
|
+
throw new Error('Cannot find global editor context');
|
|
39
|
+
}
|
|
40
|
+
return wrapper;
|
|
41
|
+
}
|
|
42
|
+
function GlobalEditorWrapperContext(props) {
|
|
43
|
+
var _a = react.useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
44
|
+
function createWrapper() {
|
|
45
|
+
return {
|
|
46
|
+
properties: props.definition.properties,
|
|
47
|
+
setProperty: setProperty
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function forward() {
|
|
51
|
+
setWrapper(createWrapper());
|
|
52
|
+
}
|
|
53
|
+
function setProperty(name, value) {
|
|
54
|
+
props.definition.properties[name] = value;
|
|
55
|
+
props.context.notifyPropertiesChanged();
|
|
56
|
+
forward();
|
|
57
|
+
}
|
|
58
|
+
return jsxRuntime.jsx(globalEditorWrapperContext$1.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var globalEditorWrapperContext = react.createContext(null);
|
|
62
|
+
function useStepEditor() {
|
|
63
|
+
var wrapper = react.useContext(globalEditorWrapperContext);
|
|
64
|
+
if (!wrapper) {
|
|
65
|
+
throw new Error('Cannot find step editor context');
|
|
66
|
+
}
|
|
67
|
+
return wrapper;
|
|
68
|
+
}
|
|
69
|
+
function StepEditorWrapperContext(props) {
|
|
70
|
+
var _a = react.useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
71
|
+
function createWrapper() {
|
|
72
|
+
return {
|
|
73
|
+
id: props.step.id,
|
|
74
|
+
type: props.step.type,
|
|
75
|
+
componentType: props.step.componentType,
|
|
76
|
+
name: props.step.name,
|
|
77
|
+
properties: props.step.properties,
|
|
78
|
+
step: props.step,
|
|
79
|
+
setName: setName,
|
|
80
|
+
setProperty: setProperty,
|
|
81
|
+
notifyPropertiesChanged: notifyPropertiesChanged,
|
|
82
|
+
notifyChildrenChanged: notifyChildrenChanged
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function forward() {
|
|
86
|
+
setWrapper(createWrapper());
|
|
87
|
+
}
|
|
88
|
+
function setName(name) {
|
|
89
|
+
props.step.name = name;
|
|
90
|
+
notifyNameChanged();
|
|
91
|
+
}
|
|
92
|
+
function setProperty(name, value) {
|
|
93
|
+
props.step.properties[name] = value;
|
|
94
|
+
notifyPropertiesChanged();
|
|
95
|
+
}
|
|
96
|
+
function notifyNameChanged() {
|
|
97
|
+
props.context.notifyNameChanged();
|
|
98
|
+
forward();
|
|
99
|
+
}
|
|
100
|
+
function notifyPropertiesChanged() {
|
|
101
|
+
props.context.notifyPropertiesChanged();
|
|
102
|
+
forward();
|
|
103
|
+
}
|
|
104
|
+
function notifyChildrenChanged() {
|
|
105
|
+
props.context.notifyChildrenChanged();
|
|
106
|
+
forward();
|
|
107
|
+
}
|
|
108
|
+
return jsxRuntime.jsx(globalEditorWrapperContext.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function wrapDefinition(value, isValid) {
|
|
112
|
+
return {
|
|
113
|
+
value: value,
|
|
114
|
+
isValid: isValid
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function SequentialWorkflowDesigner(props) {
|
|
119
|
+
var _a = react.useState(null), placeholder = _a[0], setPlaceholder = _a[1];
|
|
120
|
+
var onDefinitionChangeRef = react.useRef(props.onDefinitionChange);
|
|
121
|
+
var onSelectedStepIdChangedRef = react.useRef(props.onSelectedStepIdChanged);
|
|
122
|
+
var globalEditorRef = react.useRef(props.globalEditor);
|
|
123
|
+
var stepEditorRef = react.useRef(props.stepEditor);
|
|
124
|
+
var designerRef = react.useRef(null);
|
|
125
|
+
var editorRootRef = react.useRef(null);
|
|
126
|
+
var definition = props.definition;
|
|
127
|
+
var selectedStepId = props.selectedStepId;
|
|
128
|
+
var isReadonly = props.isReadonly;
|
|
129
|
+
var theme = props.theme;
|
|
130
|
+
var undoStackSize = props.undoStackSize;
|
|
131
|
+
var stepsConfiguration = props.stepsConfiguration;
|
|
132
|
+
var toolboxConfiguration = props.toolboxConfiguration;
|
|
133
|
+
var extensions = props.extensions;
|
|
134
|
+
function forwardDefinition() {
|
|
135
|
+
if (designerRef.current) {
|
|
136
|
+
var def = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
|
|
137
|
+
onDefinitionChangeRef.current(def);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function globalEditorProvider(def, context) {
|
|
141
|
+
return editorProvider(editorRootRef, jsxRuntime.jsx(GlobalEditorWrapperContext, __assign({ definition: def, context: context }, { children: globalEditorRef.current })));
|
|
142
|
+
}
|
|
143
|
+
function stepEditorProvider(step, context) {
|
|
144
|
+
return editorProvider(editorRootRef, jsxRuntime.jsx(StepEditorWrapperContext, __assign({ step: step, context: context }, { children: stepEditorRef.current })));
|
|
145
|
+
}
|
|
146
|
+
react.useEffect(function () {
|
|
147
|
+
onDefinitionChangeRef.current = props.onDefinitionChange;
|
|
148
|
+
}, [props.onDefinitionChange]);
|
|
149
|
+
react.useEffect(function () {
|
|
150
|
+
onSelectedStepIdChangedRef.current = props.onSelectedStepIdChanged;
|
|
151
|
+
}, [props.onSelectedStepIdChanged]);
|
|
152
|
+
react.useEffect(function () {
|
|
153
|
+
globalEditorRef.current = props.globalEditor;
|
|
154
|
+
}, [props.globalEditor]);
|
|
155
|
+
react.useEffect(function () {
|
|
156
|
+
stepEditorRef.current = props.stepEditor;
|
|
157
|
+
}, [props.stepEditor]);
|
|
158
|
+
react.useEffect(function () {
|
|
159
|
+
if (!placeholder) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (designerRef.current) {
|
|
163
|
+
var isNotChanged = definition.value === designerRef.current.getDefinition();
|
|
164
|
+
if (isNotChanged) {
|
|
165
|
+
if (selectedStepId !== undefined && selectedStepId !== designerRef.current.getSelectedStepId()) {
|
|
166
|
+
if (selectedStepId) {
|
|
167
|
+
designerRef.current.selectStepById(selectedStepId);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
designerRef.current.clearSelectedStep();
|
|
171
|
+
}
|
|
172
|
+
// console.log('sqd: selected step updated');
|
|
173
|
+
}
|
|
174
|
+
if (isReadonly !== undefined && isReadonly !== designerRef.current.isReadonly()) {
|
|
175
|
+
designerRef.current.setIsReadonly(isReadonly);
|
|
176
|
+
// console.log('sqd: readonly updated');
|
|
177
|
+
}
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
designerRef.current.destroy();
|
|
181
|
+
designerRef.current = null;
|
|
182
|
+
}
|
|
183
|
+
var designer = sequentialWorkflowDesigner.Designer.create(placeholder, definition.value, {
|
|
184
|
+
theme: theme,
|
|
185
|
+
undoStackSize: undoStackSize,
|
|
186
|
+
toolbox: toolboxConfiguration,
|
|
187
|
+
steps: stepsConfiguration,
|
|
188
|
+
editors: {
|
|
189
|
+
isHidden: false,
|
|
190
|
+
globalEditorProvider: globalEditorProvider,
|
|
191
|
+
stepEditorProvider: stepEditorProvider
|
|
192
|
+
},
|
|
193
|
+
extensions: extensions
|
|
194
|
+
});
|
|
195
|
+
if (selectedStepId) {
|
|
196
|
+
designer.selectStepById(selectedStepId);
|
|
197
|
+
}
|
|
198
|
+
if (isReadonly) {
|
|
199
|
+
designer.setIsReadonly(isReadonly);
|
|
200
|
+
}
|
|
201
|
+
// console.log('sqd: designer rendered');
|
|
202
|
+
designer.onReady.subscribe(forwardDefinition);
|
|
203
|
+
designer.onDefinitionChanged.subscribe(forwardDefinition);
|
|
204
|
+
designer.onSelectedStepIdChanged.subscribe(function (stepId) {
|
|
205
|
+
if (onSelectedStepIdChangedRef.current) {
|
|
206
|
+
onSelectedStepIdChangedRef.current(stepId);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
designerRef.current = designer;
|
|
210
|
+
}, [placeholder, definition, selectedStepId, isReadonly, theme, undoStackSize, toolboxConfiguration, stepsConfiguration, extensions]);
|
|
211
|
+
react.useEffect(function () {
|
|
212
|
+
return function () {
|
|
213
|
+
if (editorRootRef.current) {
|
|
214
|
+
var oldRoot_1 = editorRootRef.current;
|
|
215
|
+
editorRootRef.current = null;
|
|
216
|
+
setTimeout(function () { return oldRoot_1.unmount(); });
|
|
217
|
+
}
|
|
218
|
+
if (designerRef.current) {
|
|
219
|
+
designerRef.current.destroy();
|
|
220
|
+
designerRef.current = null;
|
|
221
|
+
// console.log('sqd: designer destroyed');
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}, []);
|
|
225
|
+
return jsxRuntime.jsx("div", { ref: setPlaceholder, className: "sqd-designer-react" });
|
|
226
|
+
}
|
|
227
|
+
function editorProvider(rootRef, element) {
|
|
228
|
+
if (rootRef.current) {
|
|
229
|
+
var oldRoot_2 = rootRef.current;
|
|
230
|
+
rootRef.current = null;
|
|
231
|
+
setTimeout(function () { return oldRoot_2.unmount(); });
|
|
232
|
+
}
|
|
233
|
+
var container = document.createElement('div');
|
|
234
|
+
container.className = 'sqd-editor-react';
|
|
235
|
+
rootRef.current = ReactDOM.createRoot(container);
|
|
236
|
+
rootRef.current.render(element);
|
|
237
|
+
return container;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
exports.GlobalEditorWrapperContext = GlobalEditorWrapperContext;
|
|
241
|
+
exports.SequentialWorkflowDesigner = SequentialWorkflowDesigner;
|
|
242
|
+
exports.StepEditorWrapperContext = StepEditorWrapperContext;
|
|
243
|
+
exports.useGlobalEditor = useGlobalEditor;
|
|
244
|
+
exports.useStepEditor = useStepEditor;
|
|
245
|
+
exports.wrapDefinition = wrapDefinition;
|
|
@@ -1,139 +1,238 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useState, useRef, useEffect } from 'react';
|
|
13
3
|
import ReactDOM from 'react-dom/client';
|
|
14
|
-
import { useEffect, useRef, useState } from 'react';
|
|
15
4
|
import { Designer } from 'sequential-workflow-designer';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, []);
|
|
126
|
-
return _jsx("div", { ref: setPlaceholder, className: "sqd-designer-react" });
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
|
|
9
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
+
purpose with or without fee is hereby granted.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
16
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
***************************************************************************** */
|
|
20
|
+
|
|
21
|
+
var __assign = function() {
|
|
22
|
+
__assign = Object.assign || function __assign(t) {
|
|
23
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
24
|
+
s = arguments[i];
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
return __assign.apply(this, arguments);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var globalEditorWrapperContext$1 = createContext(null);
|
|
33
|
+
function useGlobalEditor() {
|
|
34
|
+
var wrapper = useContext(globalEditorWrapperContext$1);
|
|
35
|
+
if (!wrapper) {
|
|
36
|
+
throw new Error('Cannot find global editor context');
|
|
37
|
+
}
|
|
38
|
+
return wrapper;
|
|
39
|
+
}
|
|
40
|
+
function GlobalEditorWrapperContext(props) {
|
|
41
|
+
var _a = useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
42
|
+
function createWrapper() {
|
|
43
|
+
return {
|
|
44
|
+
properties: props.definition.properties,
|
|
45
|
+
setProperty: setProperty
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function forward() {
|
|
49
|
+
setWrapper(createWrapper());
|
|
50
|
+
}
|
|
51
|
+
function setProperty(name, value) {
|
|
52
|
+
props.definition.properties[name] = value;
|
|
53
|
+
props.context.notifyPropertiesChanged();
|
|
54
|
+
forward();
|
|
55
|
+
}
|
|
56
|
+
return jsx(globalEditorWrapperContext$1.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var globalEditorWrapperContext = createContext(null);
|
|
60
|
+
function useStepEditor() {
|
|
61
|
+
var wrapper = useContext(globalEditorWrapperContext);
|
|
62
|
+
if (!wrapper) {
|
|
63
|
+
throw new Error('Cannot find step editor context');
|
|
64
|
+
}
|
|
65
|
+
return wrapper;
|
|
66
|
+
}
|
|
67
|
+
function StepEditorWrapperContext(props) {
|
|
68
|
+
var _a = useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
69
|
+
function createWrapper() {
|
|
70
|
+
return {
|
|
71
|
+
id: props.step.id,
|
|
72
|
+
type: props.step.type,
|
|
73
|
+
componentType: props.step.componentType,
|
|
74
|
+
name: props.step.name,
|
|
75
|
+
properties: props.step.properties,
|
|
76
|
+
step: props.step,
|
|
77
|
+
setName: setName,
|
|
78
|
+
setProperty: setProperty,
|
|
79
|
+
notifyPropertiesChanged: notifyPropertiesChanged,
|
|
80
|
+
notifyChildrenChanged: notifyChildrenChanged
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function forward() {
|
|
84
|
+
setWrapper(createWrapper());
|
|
85
|
+
}
|
|
86
|
+
function setName(name) {
|
|
87
|
+
props.step.name = name;
|
|
88
|
+
notifyNameChanged();
|
|
89
|
+
}
|
|
90
|
+
function setProperty(name, value) {
|
|
91
|
+
props.step.properties[name] = value;
|
|
92
|
+
notifyPropertiesChanged();
|
|
93
|
+
}
|
|
94
|
+
function notifyNameChanged() {
|
|
95
|
+
props.context.notifyNameChanged();
|
|
96
|
+
forward();
|
|
97
|
+
}
|
|
98
|
+
function notifyPropertiesChanged() {
|
|
99
|
+
props.context.notifyPropertiesChanged();
|
|
100
|
+
forward();
|
|
101
|
+
}
|
|
102
|
+
function notifyChildrenChanged() {
|
|
103
|
+
props.context.notifyChildrenChanged();
|
|
104
|
+
forward();
|
|
105
|
+
}
|
|
106
|
+
return jsx(globalEditorWrapperContext.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function wrapDefinition(value, isValid) {
|
|
110
|
+
return {
|
|
111
|
+
value: value,
|
|
112
|
+
isValid: isValid
|
|
113
|
+
};
|
|
127
114
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
115
|
+
|
|
116
|
+
function SequentialWorkflowDesigner(props) {
|
|
117
|
+
var _a = useState(null), placeholder = _a[0], setPlaceholder = _a[1];
|
|
118
|
+
var onDefinitionChangeRef = useRef(props.onDefinitionChange);
|
|
119
|
+
var onSelectedStepIdChangedRef = useRef(props.onSelectedStepIdChanged);
|
|
120
|
+
var globalEditorRef = useRef(props.globalEditor);
|
|
121
|
+
var stepEditorRef = useRef(props.stepEditor);
|
|
122
|
+
var designerRef = useRef(null);
|
|
123
|
+
var editorRootRef = useRef(null);
|
|
124
|
+
var definition = props.definition;
|
|
125
|
+
var selectedStepId = props.selectedStepId;
|
|
126
|
+
var isReadonly = props.isReadonly;
|
|
127
|
+
var theme = props.theme;
|
|
128
|
+
var undoStackSize = props.undoStackSize;
|
|
129
|
+
var stepsConfiguration = props.stepsConfiguration;
|
|
130
|
+
var toolboxConfiguration = props.toolboxConfiguration;
|
|
131
|
+
var extensions = props.extensions;
|
|
132
|
+
function forwardDefinition() {
|
|
133
|
+
if (designerRef.current) {
|
|
134
|
+
var def = wrapDefinition(designerRef.current.getDefinition(), designerRef.current.isValid());
|
|
135
|
+
onDefinitionChangeRef.current(def);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function globalEditorProvider(def, context) {
|
|
139
|
+
return editorProvider(editorRootRef, jsx(GlobalEditorWrapperContext, __assign({ definition: def, context: context }, { children: globalEditorRef.current })));
|
|
140
|
+
}
|
|
141
|
+
function stepEditorProvider(step, context) {
|
|
142
|
+
return editorProvider(editorRootRef, jsx(StepEditorWrapperContext, __assign({ step: step, context: context }, { children: stepEditorRef.current })));
|
|
143
|
+
}
|
|
144
|
+
useEffect(function () {
|
|
145
|
+
onDefinitionChangeRef.current = props.onDefinitionChange;
|
|
146
|
+
}, [props.onDefinitionChange]);
|
|
147
|
+
useEffect(function () {
|
|
148
|
+
onSelectedStepIdChangedRef.current = props.onSelectedStepIdChanged;
|
|
149
|
+
}, [props.onSelectedStepIdChanged]);
|
|
150
|
+
useEffect(function () {
|
|
151
|
+
globalEditorRef.current = props.globalEditor;
|
|
152
|
+
}, [props.globalEditor]);
|
|
153
|
+
useEffect(function () {
|
|
154
|
+
stepEditorRef.current = props.stepEditor;
|
|
155
|
+
}, [props.stepEditor]);
|
|
156
|
+
useEffect(function () {
|
|
157
|
+
if (!placeholder) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (designerRef.current) {
|
|
161
|
+
var isNotChanged = definition.value === designerRef.current.getDefinition();
|
|
162
|
+
if (isNotChanged) {
|
|
163
|
+
if (selectedStepId !== undefined && selectedStepId !== designerRef.current.getSelectedStepId()) {
|
|
164
|
+
if (selectedStepId) {
|
|
165
|
+
designerRef.current.selectStepById(selectedStepId);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
designerRef.current.clearSelectedStep();
|
|
169
|
+
}
|
|
170
|
+
// console.log('sqd: selected step updated');
|
|
171
|
+
}
|
|
172
|
+
if (isReadonly !== undefined && isReadonly !== designerRef.current.isReadonly()) {
|
|
173
|
+
designerRef.current.setIsReadonly(isReadonly);
|
|
174
|
+
// console.log('sqd: readonly updated');
|
|
175
|
+
}
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
designerRef.current.destroy();
|
|
179
|
+
designerRef.current = null;
|
|
180
|
+
}
|
|
181
|
+
var designer = Designer.create(placeholder, definition.value, {
|
|
182
|
+
theme: theme,
|
|
183
|
+
undoStackSize: undoStackSize,
|
|
184
|
+
toolbox: toolboxConfiguration,
|
|
185
|
+
steps: stepsConfiguration,
|
|
186
|
+
editors: {
|
|
187
|
+
isHidden: false,
|
|
188
|
+
globalEditorProvider: globalEditorProvider,
|
|
189
|
+
stepEditorProvider: stepEditorProvider
|
|
190
|
+
},
|
|
191
|
+
extensions: extensions
|
|
192
|
+
});
|
|
193
|
+
if (selectedStepId) {
|
|
194
|
+
designer.selectStepById(selectedStepId);
|
|
195
|
+
}
|
|
196
|
+
if (isReadonly) {
|
|
197
|
+
designer.setIsReadonly(isReadonly);
|
|
198
|
+
}
|
|
199
|
+
// console.log('sqd: designer rendered');
|
|
200
|
+
designer.onReady.subscribe(forwardDefinition);
|
|
201
|
+
designer.onDefinitionChanged.subscribe(forwardDefinition);
|
|
202
|
+
designer.onSelectedStepIdChanged.subscribe(function (stepId) {
|
|
203
|
+
if (onSelectedStepIdChangedRef.current) {
|
|
204
|
+
onSelectedStepIdChangedRef.current(stepId);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
designerRef.current = designer;
|
|
208
|
+
}, [placeholder, definition, selectedStepId, isReadonly, theme, undoStackSize, toolboxConfiguration, stepsConfiguration, extensions]);
|
|
209
|
+
useEffect(function () {
|
|
210
|
+
return function () {
|
|
211
|
+
if (editorRootRef.current) {
|
|
212
|
+
var oldRoot_1 = editorRootRef.current;
|
|
213
|
+
editorRootRef.current = null;
|
|
214
|
+
setTimeout(function () { return oldRoot_1.unmount(); });
|
|
215
|
+
}
|
|
216
|
+
if (designerRef.current) {
|
|
217
|
+
designerRef.current.destroy();
|
|
218
|
+
designerRef.current = null;
|
|
219
|
+
// console.log('sqd: designer destroyed');
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}, []);
|
|
223
|
+
return jsx("div", { ref: setPlaceholder, className: "sqd-designer-react" });
|
|
224
|
+
}
|
|
225
|
+
function editorProvider(rootRef, element) {
|
|
226
|
+
if (rootRef.current) {
|
|
227
|
+
var oldRoot_2 = rootRef.current;
|
|
228
|
+
rootRef.current = null;
|
|
229
|
+
setTimeout(function () { return oldRoot_2.unmount(); });
|
|
230
|
+
}
|
|
231
|
+
var container = document.createElement('div');
|
|
232
|
+
container.className = 'sqd-editor-react';
|
|
233
|
+
rootRef.current = ReactDOM.createRoot(container);
|
|
234
|
+
rootRef.current.render(element);
|
|
235
|
+
return container;
|
|
139
236
|
}
|
|
237
|
+
|
|
238
|
+
export { GlobalEditorWrapperContext, SequentialWorkflowDesigner, StepEditorWrapperContext, useGlobalEditor, useStepEditor, wrapDefinition };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Definition, GlobalEditorContext, StepsConfiguration, ToolboxConfiguration, DesignerExtension, Step, StepEditorContext } from 'sequential-workflow-designer';
|
|
3
|
+
|
|
4
|
+
interface GlobalEditorWrapper<TDefinition extends Definition> {
|
|
5
|
+
readonly properties: TDefinition['properties'];
|
|
6
|
+
setProperty(name: keyof TDefinition['properties'], value: TDefinition['properties'][typeof name]): void;
|
|
7
|
+
}
|
|
8
|
+
declare function useGlobalEditor<TDefinition extends Definition = Definition>(): GlobalEditorWrapper<TDefinition>;
|
|
9
|
+
declare function GlobalEditorWrapperContext(props: {
|
|
10
|
+
children: JSX.Element;
|
|
11
|
+
definition: Definition;
|
|
12
|
+
context: GlobalEditorContext;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface WrappedDefinition<TDefinition extends Definition = Definition> {
|
|
16
|
+
readonly value: TDefinition;
|
|
17
|
+
readonly isValid: boolean | undefined;
|
|
18
|
+
}
|
|
19
|
+
declare function wrapDefinition<TDefinition extends Definition = Definition>(value: TDefinition, isValid?: boolean): WrappedDefinition<TDefinition>;
|
|
20
|
+
|
|
21
|
+
interface SequentialWorkflowDesignerProps<TDefinition extends Definition> {
|
|
22
|
+
definition: WrappedDefinition<TDefinition>;
|
|
23
|
+
onDefinitionChange: (state: WrappedDefinition<TDefinition>) => void;
|
|
24
|
+
selectedStepId?: string | null;
|
|
25
|
+
onSelectedStepIdChanged?: (stepId: string | null) => void;
|
|
26
|
+
isReadonly?: boolean;
|
|
27
|
+
globalEditor: JSX.Element;
|
|
28
|
+
stepEditor: JSX.Element;
|
|
29
|
+
theme?: string;
|
|
30
|
+
undoStackSize?: number;
|
|
31
|
+
stepsConfiguration: StepsConfiguration;
|
|
32
|
+
toolboxConfiguration: ToolboxConfiguration;
|
|
33
|
+
extensions?: DesignerExtension[];
|
|
34
|
+
}
|
|
35
|
+
declare function SequentialWorkflowDesigner<TDefinition extends Definition>(props: SequentialWorkflowDesignerProps<TDefinition>): JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface StepEditorWrapper<TStep extends Step> {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly type: TStep['type'];
|
|
40
|
+
readonly componentType: TStep['componentType'];
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly properties: TStep['properties'];
|
|
43
|
+
readonly step: TStep;
|
|
44
|
+
setName(name: string): void;
|
|
45
|
+
setProperty(name: keyof TStep['properties'], value: TStep['properties'][typeof name]): void;
|
|
46
|
+
notifyPropertiesChanged(): void;
|
|
47
|
+
notifyChildrenChanged(): void;
|
|
48
|
+
}
|
|
49
|
+
declare function useStepEditor<TStep extends Step = Step>(): StepEditorWrapper<TStep>;
|
|
50
|
+
declare function StepEditorWrapperContext(props: {
|
|
51
|
+
children: JSX.Element;
|
|
52
|
+
step: Step;
|
|
53
|
+
context: StepEditorContext;
|
|
54
|
+
}): JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { GlobalEditorWrapper, GlobalEditorWrapperContext, SequentialWorkflowDesigner, SequentialWorkflowDesignerProps, StepEditorWrapper, StepEditorWrapperContext, WrappedDefinition, useGlobalEditor, useStepEditor, wrapDefinition };
|
package/package.json
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sequential-workflow-designer-react",
|
|
3
3
|
"description": "React wrapper for Sequential Workflow Designer component.",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"
|
|
4
|
+
"version": "0.8.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/esm/index.js",
|
|
6
7
|
"types": "./lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": {
|
|
11
|
+
"require": "./lib/index.d.ts",
|
|
12
|
+
"default": "./lib/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"default": {
|
|
15
|
+
"require": "./lib/cjs/index.cjs",
|
|
16
|
+
"default": "./lib/esm/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "NoCode JS",
|
|
22
|
+
"url": "https://nocode-js.com/"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://nocode-js.com/",
|
|
25
|
+
"license": "MIT",
|
|
7
26
|
"repository": {
|
|
8
27
|
"type": "git",
|
|
9
28
|
"url": "https://github.com/nocode-js/sequential-workflow-designer.git"
|
|
@@ -14,25 +33,21 @@
|
|
|
14
33
|
"publishConfig": {
|
|
15
34
|
"registry": "https://registry.npmjs.org/"
|
|
16
35
|
},
|
|
17
|
-
"author": "N4NO.com",
|
|
18
|
-
"license": "MIT",
|
|
19
36
|
"scripts": {
|
|
20
37
|
"prepare": "cp ../LICENSE LICENSE",
|
|
21
38
|
"clean": "rm -rf lib",
|
|
22
|
-
"start": "
|
|
23
|
-
"build": "yarn clean &&
|
|
39
|
+
"start": "rollup -c --watch",
|
|
40
|
+
"build": "yarn clean && rollup -c",
|
|
24
41
|
"prettier": "prettier --check ./src",
|
|
25
42
|
"prettier:fix": "prettier --write ./src",
|
|
26
43
|
"eslint": "eslint ./src --ext .ts",
|
|
27
44
|
"test:single": "jest",
|
|
28
45
|
"test": "jest --watchAll"
|
|
29
46
|
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"react": "^18.2.0",
|
|
32
|
-
"react-dom": "^18.2.0"
|
|
33
|
-
},
|
|
34
47
|
"peerDependencies": {
|
|
35
|
-
"
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"sequential-workflow-designer": "^0.8.1"
|
|
36
51
|
},
|
|
37
52
|
"devDependencies": {
|
|
38
53
|
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
@@ -46,6 +61,10 @@
|
|
|
46
61
|
"@types/jest": "^29.2.5",
|
|
47
62
|
"ts-jest": "^29.0.3",
|
|
48
63
|
"prettier": "^2.8.2",
|
|
64
|
+
"rollup": "^3.18.0",
|
|
65
|
+
"rollup-plugin-dts": "^5.2.0",
|
|
66
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
67
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
49
68
|
"typescript": "^4.9.4"
|
|
50
69
|
},
|
|
51
70
|
"keywords": [
|
|
@@ -58,4 +77,4 @@
|
|
|
58
77
|
"react",
|
|
59
78
|
"reactjs"
|
|
60
79
|
]
|
|
61
|
-
}
|
|
80
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Definition, GlobalEditorContext, Properties, PropertyValue } from 'sequential-workflow-designer';
|
|
3
|
-
export interface GlobalEditorWrapper {
|
|
4
|
-
readonly properties: Properties;
|
|
5
|
-
setProperty(name: string, value: PropertyValue): void;
|
|
6
|
-
}
|
|
7
|
-
export declare function useGlobalEditor(): GlobalEditorWrapper;
|
|
8
|
-
export declare function GlobalEditorWrapperContext(props: {
|
|
9
|
-
children: JSX.Element;
|
|
10
|
-
definition: Definition;
|
|
11
|
-
context: GlobalEditorContext;
|
|
12
|
-
}): JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { createContext, useContext, useState } from 'react';
|
|
14
|
-
var globalEditorWrapperContext = createContext(null);
|
|
15
|
-
export function useGlobalEditor() {
|
|
16
|
-
var wrapper = useContext(globalEditorWrapperContext);
|
|
17
|
-
if (!wrapper) {
|
|
18
|
-
throw new Error('Cannot find global editor context');
|
|
19
|
-
}
|
|
20
|
-
return wrapper;
|
|
21
|
-
}
|
|
22
|
-
export function GlobalEditorWrapperContext(props) {
|
|
23
|
-
var _a = useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
24
|
-
function createWrapper() {
|
|
25
|
-
return {
|
|
26
|
-
properties: props.definition.properties,
|
|
27
|
-
setProperty: setProperty
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function forward() {
|
|
31
|
-
setWrapper(createWrapper());
|
|
32
|
-
}
|
|
33
|
-
function setProperty(name, value) {
|
|
34
|
-
props.definition.properties[name] = value;
|
|
35
|
-
props.context.notifyPropertiesChanged();
|
|
36
|
-
forward();
|
|
37
|
-
}
|
|
38
|
-
return _jsx(globalEditorWrapperContext.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
39
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ToolboxConfiguration, StepsConfiguration, DesignerExtension } from 'sequential-workflow-designer';
|
|
3
|
-
import { WrappedDefinition } from './WrappedDefinition';
|
|
4
|
-
export interface SequentialWorkflowDesignerProps {
|
|
5
|
-
definition: WrappedDefinition;
|
|
6
|
-
onDefinitionChange: (state: WrappedDefinition) => void;
|
|
7
|
-
selectedStepId?: string | null;
|
|
8
|
-
onSelectedStepIdChanged?: (stepId: string | null) => void;
|
|
9
|
-
isReadonly?: boolean;
|
|
10
|
-
globalEditor: JSX.Element;
|
|
11
|
-
stepEditor: JSX.Element;
|
|
12
|
-
theme?: string;
|
|
13
|
-
undoStackSize?: number;
|
|
14
|
-
stepsConfiguration: StepsConfiguration;
|
|
15
|
-
toolboxConfiguration: ToolboxConfiguration;
|
|
16
|
-
extensions?: DesignerExtension[];
|
|
17
|
-
}
|
|
18
|
-
export declare function SequentialWorkflowDesigner(props: SequentialWorkflowDesignerProps): JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ComponentType, Properties, PropertyValue, Step, StepEditorContext } from 'sequential-workflow-designer';
|
|
3
|
-
export interface StepEditorWrapper {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly type: string;
|
|
6
|
-
readonly componentType: ComponentType;
|
|
7
|
-
readonly name: string;
|
|
8
|
-
readonly properties: Properties;
|
|
9
|
-
readonly step: Step;
|
|
10
|
-
setName(name: string): void;
|
|
11
|
-
setProperty(name: string, value: PropertyValue): void;
|
|
12
|
-
notifyPropertiesChanged(): void;
|
|
13
|
-
notifyChildrenChanged(): void;
|
|
14
|
-
}
|
|
15
|
-
export declare function useStepEditor(): StepEditorWrapper;
|
|
16
|
-
export declare function StepEditorWrapperContext(props: {
|
|
17
|
-
children: JSX.Element;
|
|
18
|
-
step: Step;
|
|
19
|
-
context: StepEditorContext;
|
|
20
|
-
}): JSX.Element;
|
package/lib/StepEditorWrapper.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { createContext, useContext, useState } from 'react';
|
|
14
|
-
var globalEditorWrapperContext = createContext(null);
|
|
15
|
-
export function useStepEditor() {
|
|
16
|
-
var wrapper = useContext(globalEditorWrapperContext);
|
|
17
|
-
if (!wrapper) {
|
|
18
|
-
throw new Error('Cannot find step editor context');
|
|
19
|
-
}
|
|
20
|
-
return wrapper;
|
|
21
|
-
}
|
|
22
|
-
export function StepEditorWrapperContext(props) {
|
|
23
|
-
var _a = useState(function () { return createWrapper(); }), wrapper = _a[0], setWrapper = _a[1];
|
|
24
|
-
function createWrapper() {
|
|
25
|
-
return {
|
|
26
|
-
id: props.step.id,
|
|
27
|
-
type: props.step.type,
|
|
28
|
-
componentType: props.step.componentType,
|
|
29
|
-
name: props.step.name,
|
|
30
|
-
properties: props.step.properties,
|
|
31
|
-
step: props.step,
|
|
32
|
-
setName: setName,
|
|
33
|
-
setProperty: setProperty,
|
|
34
|
-
notifyPropertiesChanged: notifyPropertiesChanged,
|
|
35
|
-
notifyChildrenChanged: notifyChildrenChanged
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function forward() {
|
|
39
|
-
setWrapper(createWrapper());
|
|
40
|
-
}
|
|
41
|
-
function setName(name) {
|
|
42
|
-
props.step.name = name;
|
|
43
|
-
notifyNameChanged();
|
|
44
|
-
}
|
|
45
|
-
function setProperty(name, value) {
|
|
46
|
-
props.step.properties[name] = value;
|
|
47
|
-
notifyPropertiesChanged();
|
|
48
|
-
}
|
|
49
|
-
function notifyNameChanged() {
|
|
50
|
-
props.context.notifyNameChanged();
|
|
51
|
-
forward();
|
|
52
|
-
}
|
|
53
|
-
function notifyPropertiesChanged() {
|
|
54
|
-
props.context.notifyPropertiesChanged();
|
|
55
|
-
forward();
|
|
56
|
-
}
|
|
57
|
-
function notifyChildrenChanged() {
|
|
58
|
-
props.context.notifyChildrenChanged();
|
|
59
|
-
forward();
|
|
60
|
-
}
|
|
61
|
-
return _jsx(globalEditorWrapperContext.Provider, __assign({ value: wrapper }, { children: props.children }));
|
|
62
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Definition } from 'sequential-workflow-designer';
|
|
2
|
-
export interface WrappedDefinition {
|
|
3
|
-
readonly value: Definition;
|
|
4
|
-
readonly isValid: boolean | undefined;
|
|
5
|
-
}
|
|
6
|
-
export declare function wrapDefinition(value: Definition, isValid?: boolean): WrappedDefinition;
|
package/lib/WrappedDefinition.js
DELETED
package/lib/index.js
DELETED