sequential-workflow-designer 0.35.3 → 0.37.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/README.md +65 -64
- package/dist/index.umd.js +91 -47
- package/lib/cjs/index.cjs +91 -47
- package/lib/esm/index.js +91 -47
- package/lib/index.d.ts +43 -19
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as sequential_workflow_model from 'sequential-workflow-model';
|
|
1
2
|
import { Definition, Step, Sequence, ComponentType, DefinitionWalker, StepWithParentSequence, BranchedStep, StepOrName } from 'sequential-workflow-model';
|
|
2
3
|
export * from 'sequential-workflow-model';
|
|
3
4
|
|
|
@@ -62,7 +63,7 @@ declare class SimpleEvent<T> {
|
|
|
62
63
|
unsubscribe(listener: SimpleEventListener<T>): void;
|
|
63
64
|
readonly forward: (value: T) => void;
|
|
64
65
|
count(): number;
|
|
65
|
-
|
|
66
|
+
once(): Promise<T>;
|
|
66
67
|
}
|
|
67
68
|
type SimpleEventListener<T> = (value: T) => void;
|
|
68
69
|
|
|
@@ -96,15 +97,13 @@ declare class BehaviorController {
|
|
|
96
97
|
private stop;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
changeType: DefinitionChangeType;
|
|
101
|
-
stepId: string | null;
|
|
102
|
-
}
|
|
100
|
+
type DefinitionChangedEventDetails = Omit<DefinitionChangedEvent, 'definition' | 'changeType' | 'stepId'>;
|
|
103
101
|
declare class DesignerState {
|
|
104
102
|
definition: Definition;
|
|
105
103
|
isReadonly: boolean;
|
|
106
104
|
isToolboxCollapsed: boolean;
|
|
107
105
|
isEditorCollapsed: boolean;
|
|
106
|
+
private readonly preferenceStorage;
|
|
108
107
|
readonly onViewportChanged: SimpleEvent<Viewport>;
|
|
109
108
|
readonly onSelectedStepIdChanged: SimpleEvent<string | null>;
|
|
110
109
|
readonly onStepUnselectionBlocked: SimpleEvent<string | null>;
|
|
@@ -112,21 +111,22 @@ declare class DesignerState {
|
|
|
112
111
|
readonly onIsReadonlyChanged: SimpleEvent<boolean>;
|
|
113
112
|
readonly onIsDraggingChanged: SimpleEvent<boolean>;
|
|
114
113
|
readonly onIsDragDisabledChanged: SimpleEvent<boolean>;
|
|
115
|
-
readonly onDefinitionChanged: SimpleEvent<DefinitionChangedEvent
|
|
114
|
+
readonly onDefinitionChanged: SimpleEvent<DefinitionChangedEvent<Definition>>;
|
|
116
115
|
readonly onIsToolboxCollapsedChanged: SimpleEvent<boolean>;
|
|
117
116
|
readonly onIsEditorCollapsedChanged: SimpleEvent<boolean>;
|
|
117
|
+
readonly onPreferencesChanged: SimpleEvent<PreferencesChangedEvent>;
|
|
118
118
|
viewport: Viewport;
|
|
119
119
|
selectedStepId: string | null;
|
|
120
120
|
folderPath: string[];
|
|
121
121
|
isDragging: boolean;
|
|
122
122
|
isDragDisabled: boolean;
|
|
123
|
-
constructor(definition: Definition, isReadonly: boolean, isToolboxCollapsed: boolean, isEditorCollapsed: boolean);
|
|
123
|
+
constructor(definition: Definition, isReadonly: boolean, isToolboxCollapsed: boolean, isEditorCollapsed: boolean, preferenceStorage: PreferenceStorage);
|
|
124
124
|
setSelectedStepId(stepId: string | null): void;
|
|
125
125
|
pushStepIdToFolderPath(stepId: string): void;
|
|
126
126
|
setFolderPath(path: string[]): void;
|
|
127
127
|
tryGetLastStepIdFromFolderPath(): string | null;
|
|
128
128
|
setDefinition(definition: Definition): void;
|
|
129
|
-
notifyDefinitionChanged(changeType: DefinitionChangeType, stepId: string | null): void;
|
|
129
|
+
notifyDefinitionChanged(changeType: DefinitionChangeType, stepId: string | null, details?: DefinitionChangedEventDetails): void;
|
|
130
130
|
notifyStepUnselectionBlocked(stepId: string | null): void;
|
|
131
131
|
setViewport(viewport: Viewport): void;
|
|
132
132
|
setIsReadonly(isReadonly: boolean): void;
|
|
@@ -134,6 +134,8 @@ declare class DesignerState {
|
|
|
134
134
|
setIsDragDisabled(isDragDisabled: boolean): void;
|
|
135
135
|
setIsToolboxCollapsed(isCollapsed: boolean): void;
|
|
136
136
|
setIsEditorCollapsed(isCollapsed: boolean): void;
|
|
137
|
+
setPreferences(changes: PreferenceChange[], stepId: string): void;
|
|
138
|
+
getPreference(key: string): string | null;
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
declare class DefinitionValidator {
|
|
@@ -202,7 +204,7 @@ interface ClickDetails {
|
|
|
202
204
|
position: Vector;
|
|
203
205
|
scale: number;
|
|
204
206
|
}
|
|
205
|
-
type ClickCommand = SelectStepClickCommand |
|
|
207
|
+
type ClickCommand = SelectStepClickCommand | SetPreferencesClickCommand | OpenFolderClickCommand | TriggerCustomActionClickCommand;
|
|
206
208
|
interface BaseClickCommand {
|
|
207
209
|
type: ClickCommandType;
|
|
208
210
|
}
|
|
@@ -210,10 +212,10 @@ interface SelectStepClickCommand extends BaseClickCommand {
|
|
|
210
212
|
type: ClickCommandType.selectStep;
|
|
211
213
|
component: StepComponent;
|
|
212
214
|
}
|
|
213
|
-
interface
|
|
214
|
-
type: ClickCommandType.
|
|
215
|
+
interface SetPreferencesClickCommand extends BaseClickCommand {
|
|
216
|
+
type: ClickCommandType.changePreferences;
|
|
215
217
|
step: Step;
|
|
216
|
-
|
|
218
|
+
changes: PreferenceChange[];
|
|
217
219
|
}
|
|
218
220
|
interface OpenFolderClickCommand extends BaseClickCommand {
|
|
219
221
|
type: ClickCommandType.openFolder;
|
|
@@ -227,7 +229,7 @@ interface TriggerCustomActionClickCommand extends BaseClickCommand {
|
|
|
227
229
|
}
|
|
228
230
|
declare enum ClickCommandType {
|
|
229
231
|
selectStep = 1,
|
|
230
|
-
|
|
232
|
+
changePreferences = 2,
|
|
231
233
|
openFolder = 3,
|
|
232
234
|
triggerCustomAction = 4
|
|
233
235
|
}
|
|
@@ -429,7 +431,7 @@ declare class PathBarApi {
|
|
|
429
431
|
private readonly state;
|
|
430
432
|
private readonly definitionWalker;
|
|
431
433
|
constructor(state: DesignerState, definitionWalker: DefinitionWalker);
|
|
432
|
-
readonly onStateChanged: SimpleEvent<[(string[] | undefined)?, (DefinitionChangedEvent | undefined)?, unknown?, unknown?]>;
|
|
434
|
+
readonly onStateChanged: SimpleEvent<[(string[] | undefined)?, (DefinitionChangedEvent<sequential_workflow_model.Definition> | undefined)?, unknown?, unknown?]>;
|
|
433
435
|
setFolderPath(path: string[]): void;
|
|
434
436
|
getFolderPath(): string[];
|
|
435
437
|
getFolderPathStepNames(): string[];
|
|
@@ -873,7 +875,7 @@ interface StepComponentViewContext {
|
|
|
873
875
|
createPlaceholderForArea(parentElement: SVGElement, size: Vector, direction: PlaceholderDirection, sequence: Sequence, index: number): Placeholder;
|
|
874
876
|
createRegionComponentView(parentElement: SVGElement, componentClassName: string, contentFactory: RegionComponentViewContentFactory): StepComponentView;
|
|
875
877
|
getPreference(key: string): string | null;
|
|
876
|
-
|
|
878
|
+
createPreferenceChange(key: string, value: string): PreferenceChange;
|
|
877
879
|
}
|
|
878
880
|
interface StepContext<S extends Step = Step> {
|
|
879
881
|
parentSequence: Sequence;
|
|
@@ -1205,6 +1207,21 @@ declare enum DefinitionChangeType {
|
|
|
1205
1207
|
stepInserted = 6,
|
|
1206
1208
|
rootPropertyChanged = 7,
|
|
1207
1209
|
rootReplaced = 8
|
|
1210
|
+
}
|
|
1211
|
+
type DuplicatedStepId = [sourceStepId: string, newStepId: string];
|
|
1212
|
+
interface DefinitionChangedEvent<TDefinition extends Definition = Definition> {
|
|
1213
|
+
definition: TDefinition;
|
|
1214
|
+
changeType: DefinitionChangeType;
|
|
1215
|
+
stepId: string | null;
|
|
1216
|
+
duplicatedStepIds?: DuplicatedStepId[];
|
|
1217
|
+
}
|
|
1218
|
+
interface PreferenceChange {
|
|
1219
|
+
key: string;
|
|
1220
|
+
value: string;
|
|
1221
|
+
}
|
|
1222
|
+
interface PreferencesChangedEvent {
|
|
1223
|
+
stepId: string;
|
|
1224
|
+
changes: PreferenceChange[];
|
|
1208
1225
|
}
|
|
1209
1226
|
|
|
1210
1227
|
declare class StateModifier {
|
|
@@ -1230,7 +1247,7 @@ declare class StateModifier {
|
|
|
1230
1247
|
* @description Check the `isDeletable` callback before calling this method.
|
|
1231
1248
|
*/
|
|
1232
1249
|
tryDeleteById(stepId: string): boolean;
|
|
1233
|
-
tryInsert(step: Step, targetSequence: Sequence, targetIndex: number): boolean;
|
|
1250
|
+
tryInsert(step: Step, targetSequence: Sequence, targetIndex: number, details?: DefinitionChangedEventDetails): boolean;
|
|
1234
1251
|
isDraggable(step: Step, parentSequence: Sequence): boolean;
|
|
1235
1252
|
tryMove(sourceSequence: Sequence, step: Step, targetSequence: Sequence, targetIndex: number): boolean;
|
|
1236
1253
|
isDuplicable(step: Step, parentSequence: Sequence): boolean;
|
|
@@ -1323,7 +1340,6 @@ declare class Editor {
|
|
|
1323
1340
|
declare class Designer<TDefinition extends Definition = Definition> {
|
|
1324
1341
|
private readonly view;
|
|
1325
1342
|
private readonly state;
|
|
1326
|
-
private readonly stateModifier;
|
|
1327
1343
|
private readonly walker;
|
|
1328
1344
|
private readonly historyController;
|
|
1329
1345
|
private readonly api;
|
|
@@ -1343,7 +1359,7 @@ declare class Designer<TDefinition extends Definition = Definition> {
|
|
|
1343
1359
|
/**
|
|
1344
1360
|
* @description Fires when the definition has changed.
|
|
1345
1361
|
*/
|
|
1346
|
-
readonly onDefinitionChanged: SimpleEvent<TDefinition
|
|
1362
|
+
readonly onDefinitionChanged: SimpleEvent<DefinitionChangedEvent<TDefinition>>;
|
|
1347
1363
|
/**
|
|
1348
1364
|
* @description Fires when the viewport has changed.
|
|
1349
1365
|
*/
|
|
@@ -1364,6 +1380,14 @@ declare class Designer<TDefinition extends Definition = Definition> {
|
|
|
1364
1380
|
* @description Fires when the editor is collapsed or expanded.
|
|
1365
1381
|
*/
|
|
1366
1382
|
readonly onIsEditorCollapsedChanged: SimpleEvent<boolean>;
|
|
1383
|
+
/**
|
|
1384
|
+
* @description Fires when the root component and all its children are rerendered.
|
|
1385
|
+
*/
|
|
1386
|
+
readonly onRootComponentUpdated: SimpleEvent<void>;
|
|
1387
|
+
/**
|
|
1388
|
+
* @description Fires when any of the designer preferences has changed.
|
|
1389
|
+
*/
|
|
1390
|
+
readonly onPreferencesChanged: SimpleEvent<PreferencesChangedEvent>;
|
|
1367
1391
|
/**
|
|
1368
1392
|
* @returns the current definition of the workflow.
|
|
1369
1393
|
*/
|
|
@@ -1463,4 +1487,4 @@ declare class Designer<TDefinition extends Definition = Definition> {
|
|
|
1463
1487
|
}
|
|
1464
1488
|
|
|
1465
1489
|
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ComponentDom, ControlBarApi, CustomActionController, DefaultRegionComponentViewExtension, DefaultRegionView, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerDesignerExtension, DefaultViewportControllerExtension, DefinitionChangeType, Designer, DesignerApi, DesignerContext, DesignerState, Dom, Editor, EditorApi, Icons, InputView, JoinView, KeyboardAction, LabelView, LineGridDesignerExtension, ObjectCloner, OutputView, PathBarApi, PlaceholderController, PlaceholderDirection, PlaceholderGapOrientation, RectPlaceholder, RectPlaceholderDesignerExtension, RectPlaceholderView, SelectStepBehaviorEndToken, ServicesResolver, SimpleEvent, StartStopRootComponentDesignerExtension, StartStopRootComponentExtension, StepComponent, StepExtensionResolver, StepsDesignerExtension, TYPE, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, ViewportApi, WorkspaceApi, createContainerStepComponentViewFactory, createLaunchPadStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
|
1466
|
-
export type { Attributes, Badge, BadgeExtension, BadgeView, BadgesDecorator, BadgesResult, BaseClickCommand, Behavior, BehaviorEndToken, BranchNamesResolver, ClickBehaviorWrapper, ClickBehaviorWrapperExtension, ClickCommand, ClickDetails, Component, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultViewportControllerConfiguration, DefaultViewportControllerExtensionConfiguration, DefinitionChangedEvent, DesignerConfiguration, DesignerExtension, DraggedComponent, DraggedComponentExtension, EditorsConfiguration, FoundPlaceholders, Grid, GridExtension, I18n, KeyboardConfiguration, LaunchPadStepComponentViewConfiguration, LaunchPadStepExtensionConfiguration, LineGridConfiguration, NextScale, OpenFolderClickCommand, Placeholder, PlaceholderConfiguration, PlaceholderExtension, PlaceholderView, PreferenceStorage, RectPlaceholderConfiguration, RegionComponentViewContentFactory, RegionComponentViewExtension, RegionView, RegionViewFactory,
|
|
1490
|
+
export type { Attributes, Badge, BadgeExtension, BadgeView, BadgesDecorator, BadgesResult, BaseClickCommand, Behavior, BehaviorEndToken, BranchNamesResolver, ClickBehaviorWrapper, ClickBehaviorWrapperExtension, ClickCommand, ClickDetails, Component, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultViewportControllerConfiguration, DefaultViewportControllerExtensionConfiguration, DefinitionChangedEvent, DefinitionChangedEventDetails, DesignerConfiguration, DesignerExtension, DraggedComponent, DraggedComponentExtension, DuplicatedStepId, EditorsConfiguration, FoundPlaceholders, Grid, GridExtension, I18n, KeyboardConfiguration, LaunchPadStepComponentViewConfiguration, LaunchPadStepExtensionConfiguration, LineGridConfiguration, NextScale, OpenFolderClickCommand, Placeholder, PlaceholderConfiguration, PlaceholderExtension, PlaceholderView, PreferenceChange, PreferenceStorage, PreferencesChangedEvent, RectPlaceholderConfiguration, RegionComponentViewContentFactory, RegionComponentViewExtension, RegionView, RegionViewFactory, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, SetPreferencesClickCommand, SimpleEventListener, StartStopRootComponentExtensionConfiguration, StartStopRootComponentViewConfiguration, StateModifierDependency, StepBadgesDecoratorExtension, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceRootSequence };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sequential-workflow-designer",
|
|
3
3
|
"description": "Customizable no-code component for building flow-based programming applications.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|