sequential-workflow-designer 0.17.0 → 0.18.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/README.md +4 -4
- package/dist/index.umd.js +16 -8
- package/lib/cjs/index.cjs +16 -8
- package/lib/esm/index.js +16 -9
- package/lib/index.d.ts +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,10 +96,10 @@ Add the below code to your head section in HTML document.
|
|
|
96
96
|
```html
|
|
97
97
|
<head>
|
|
98
98
|
...
|
|
99
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.
|
|
100
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.
|
|
101
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.
|
|
102
|
-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.
|
|
99
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.18.1/css/designer.css" rel="stylesheet">
|
|
100
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.18.1/css/designer-light.css" rel="stylesheet">
|
|
101
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.18.1/css/designer-dark.css" rel="stylesheet">
|
|
102
|
+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.18.1/dist/index.umd.js"></script>
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Call the designer by:
|
package/dist/index.umd.js
CHANGED
|
@@ -205,6 +205,11 @@
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
function getAbsolutePosition(element) {
|
|
209
|
+
const rect = element.getBoundingClientRect();
|
|
210
|
+
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
211
|
+
}
|
|
212
|
+
|
|
208
213
|
class Uid {
|
|
209
214
|
static next() {
|
|
210
215
|
const bytes = new Uint8Array(16);
|
|
@@ -474,9 +479,8 @@
|
|
|
474
479
|
const hasSameSize = this.draggedStepComponent.view.width === this.view.component.width &&
|
|
475
480
|
this.draggedStepComponent.view.height === this.view.component.height;
|
|
476
481
|
if (hasSameSize) {
|
|
477
|
-
const scroll = new Vector(window.scrollX, window.scrollY);
|
|
478
482
|
// Mouse cursor will be positioned on the same place as the source component.
|
|
479
|
-
const pagePosition = this.draggedStepComponent.view.getClientPosition()
|
|
483
|
+
const pagePosition = this.draggedStepComponent.view.getClientPosition();
|
|
480
484
|
offset = position.subtract(pagePosition);
|
|
481
485
|
}
|
|
482
486
|
}
|
|
@@ -1271,8 +1275,7 @@
|
|
|
1271
1275
|
this.height = height;
|
|
1272
1276
|
}
|
|
1273
1277
|
getClientPosition() {
|
|
1274
|
-
|
|
1275
|
-
return new Vector(rect.x, rect.y);
|
|
1278
|
+
return getAbsolutePosition(this.lines[0]);
|
|
1276
1279
|
}
|
|
1277
1280
|
resolveClick(click) {
|
|
1278
1281
|
const regionPosition = this.getClientPosition();
|
|
@@ -1669,8 +1672,7 @@
|
|
|
1669
1672
|
return !!outputView;
|
|
1670
1673
|
},
|
|
1671
1674
|
getClientPosition() {
|
|
1672
|
-
|
|
1673
|
-
return new Vector(r.x, r.y);
|
|
1675
|
+
return getAbsolutePosition(rect);
|
|
1674
1676
|
},
|
|
1675
1677
|
resolveClick(click) {
|
|
1676
1678
|
return g.contains(click.element) ? true : null;
|
|
@@ -2657,8 +2659,7 @@
|
|
|
2657
2659
|
});
|
|
2658
2660
|
}
|
|
2659
2661
|
getCanvasPosition() {
|
|
2660
|
-
|
|
2661
|
-
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
2662
|
+
return getAbsolutePosition(this.canvas);
|
|
2662
2663
|
}
|
|
2663
2664
|
getCanvasSize() {
|
|
2664
2665
|
return new Vector(this.canvas.clientWidth, this.canvas.clientHeight);
|
|
@@ -4515,6 +4516,12 @@
|
|
|
4515
4516
|
getStepParents(needle) {
|
|
4516
4517
|
return this.walker.getParents(this.state.definition, needle);
|
|
4517
4518
|
}
|
|
4519
|
+
/**
|
|
4520
|
+
* @returns the definition walker.
|
|
4521
|
+
*/
|
|
4522
|
+
getWalker() {
|
|
4523
|
+
return this.walker;
|
|
4524
|
+
}
|
|
4518
4525
|
/**
|
|
4519
4526
|
* @description Destroys the designer and deletes all nodes from the placeholder.
|
|
4520
4527
|
*/
|
|
@@ -4600,6 +4607,7 @@
|
|
|
4600
4607
|
exports.createContainerStepComponentViewFactory = createContainerStepComponentViewFactory;
|
|
4601
4608
|
exports.createSwitchStepComponentViewFactory = createSwitchStepComponentViewFactory;
|
|
4602
4609
|
exports.createTaskStepComponentViewFactory = createTaskStepComponentViewFactory;
|
|
4610
|
+
exports.getAbsolutePosition = getAbsolutePosition;
|
|
4603
4611
|
exports.race = race;
|
|
4604
4612
|
|
|
4605
4613
|
}));
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -203,6 +203,11 @@ class Vector {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
function getAbsolutePosition(element) {
|
|
207
|
+
const rect = element.getBoundingClientRect();
|
|
208
|
+
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
209
|
+
}
|
|
210
|
+
|
|
206
211
|
class Uid {
|
|
207
212
|
static next() {
|
|
208
213
|
const bytes = new Uint8Array(16);
|
|
@@ -472,9 +477,8 @@ class DragStepBehavior {
|
|
|
472
477
|
const hasSameSize = this.draggedStepComponent.view.width === this.view.component.width &&
|
|
473
478
|
this.draggedStepComponent.view.height === this.view.component.height;
|
|
474
479
|
if (hasSameSize) {
|
|
475
|
-
const scroll = new Vector(window.scrollX, window.scrollY);
|
|
476
480
|
// Mouse cursor will be positioned on the same place as the source component.
|
|
477
|
-
const pagePosition = this.draggedStepComponent.view.getClientPosition()
|
|
481
|
+
const pagePosition = this.draggedStepComponent.view.getClientPosition();
|
|
478
482
|
offset = position.subtract(pagePosition);
|
|
479
483
|
}
|
|
480
484
|
}
|
|
@@ -1269,8 +1273,7 @@ class RegionView {
|
|
|
1269
1273
|
this.height = height;
|
|
1270
1274
|
}
|
|
1271
1275
|
getClientPosition() {
|
|
1272
|
-
|
|
1273
|
-
return new Vector(rect.x, rect.y);
|
|
1276
|
+
return getAbsolutePosition(this.lines[0]);
|
|
1274
1277
|
}
|
|
1275
1278
|
resolveClick(click) {
|
|
1276
1279
|
const regionPosition = this.getClientPosition();
|
|
@@ -1667,8 +1670,7 @@ const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElemen
|
|
|
1667
1670
|
return !!outputView;
|
|
1668
1671
|
},
|
|
1669
1672
|
getClientPosition() {
|
|
1670
|
-
|
|
1671
|
-
return new Vector(r.x, r.y);
|
|
1673
|
+
return getAbsolutePosition(rect);
|
|
1672
1674
|
},
|
|
1673
1675
|
resolveClick(click) {
|
|
1674
1676
|
return g.contains(click.element) ? true : null;
|
|
@@ -2472,8 +2474,7 @@ class WorkspaceView {
|
|
|
2472
2474
|
});
|
|
2473
2475
|
}
|
|
2474
2476
|
getCanvasPosition() {
|
|
2475
|
-
|
|
2476
|
-
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
2477
|
+
return getAbsolutePosition(this.canvas);
|
|
2477
2478
|
}
|
|
2478
2479
|
getCanvasSize() {
|
|
2479
2480
|
return new Vector(this.canvas.clientWidth, this.canvas.clientHeight);
|
|
@@ -4330,6 +4331,12 @@ class Designer {
|
|
|
4330
4331
|
getStepParents(needle) {
|
|
4331
4332
|
return this.walker.getParents(this.state.definition, needle);
|
|
4332
4333
|
}
|
|
4334
|
+
/**
|
|
4335
|
+
* @returns the definition walker.
|
|
4336
|
+
*/
|
|
4337
|
+
getWalker() {
|
|
4338
|
+
return this.walker;
|
|
4339
|
+
}
|
|
4333
4340
|
/**
|
|
4334
4341
|
* @description Destroys the designer and deletes all nodes from the placeholder.
|
|
4335
4342
|
*/
|
|
@@ -4414,6 +4421,7 @@ exports.WorkspaceApi = WorkspaceApi;
|
|
|
4414
4421
|
exports.createContainerStepComponentViewFactory = createContainerStepComponentViewFactory;
|
|
4415
4422
|
exports.createSwitchStepComponentViewFactory = createSwitchStepComponentViewFactory;
|
|
4416
4423
|
exports.createTaskStepComponentViewFactory = createTaskStepComponentViewFactory;
|
|
4424
|
+
exports.getAbsolutePosition = getAbsolutePosition;
|
|
4417
4425
|
exports.race = race;
|
|
4418
4426
|
Object.keys(sequentialWorkflowModel).forEach(function (k) {
|
|
4419
4427
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
package/lib/esm/index.js
CHANGED
|
@@ -202,6 +202,11 @@ class Vector {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function getAbsolutePosition(element) {
|
|
206
|
+
const rect = element.getBoundingClientRect();
|
|
207
|
+
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
208
|
+
}
|
|
209
|
+
|
|
205
210
|
class Uid {
|
|
206
211
|
static next() {
|
|
207
212
|
const bytes = new Uint8Array(16);
|
|
@@ -471,9 +476,8 @@ class DragStepBehavior {
|
|
|
471
476
|
const hasSameSize = this.draggedStepComponent.view.width === this.view.component.width &&
|
|
472
477
|
this.draggedStepComponent.view.height === this.view.component.height;
|
|
473
478
|
if (hasSameSize) {
|
|
474
|
-
const scroll = new Vector(window.scrollX, window.scrollY);
|
|
475
479
|
// Mouse cursor will be positioned on the same place as the source component.
|
|
476
|
-
const pagePosition = this.draggedStepComponent.view.getClientPosition()
|
|
480
|
+
const pagePosition = this.draggedStepComponent.view.getClientPosition();
|
|
477
481
|
offset = position.subtract(pagePosition);
|
|
478
482
|
}
|
|
479
483
|
}
|
|
@@ -1268,8 +1272,7 @@ class RegionView {
|
|
|
1268
1272
|
this.height = height;
|
|
1269
1273
|
}
|
|
1270
1274
|
getClientPosition() {
|
|
1271
|
-
|
|
1272
|
-
return new Vector(rect.x, rect.y);
|
|
1275
|
+
return getAbsolutePosition(this.lines[0]);
|
|
1273
1276
|
}
|
|
1274
1277
|
resolveClick(click) {
|
|
1275
1278
|
const regionPosition = this.getClientPosition();
|
|
@@ -1666,8 +1669,7 @@ const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElemen
|
|
|
1666
1669
|
return !!outputView;
|
|
1667
1670
|
},
|
|
1668
1671
|
getClientPosition() {
|
|
1669
|
-
|
|
1670
|
-
return new Vector(r.x, r.y);
|
|
1672
|
+
return getAbsolutePosition(rect);
|
|
1671
1673
|
},
|
|
1672
1674
|
resolveClick(click) {
|
|
1673
1675
|
return g.contains(click.element) ? true : null;
|
|
@@ -2471,8 +2473,7 @@ class WorkspaceView {
|
|
|
2471
2473
|
});
|
|
2472
2474
|
}
|
|
2473
2475
|
getCanvasPosition() {
|
|
2474
|
-
|
|
2475
|
-
return new Vector(rect.x + window.scrollX, rect.y + window.scrollY);
|
|
2476
|
+
return getAbsolutePosition(this.canvas);
|
|
2476
2477
|
}
|
|
2477
2478
|
getCanvasSize() {
|
|
2478
2479
|
return new Vector(this.canvas.clientWidth, this.canvas.clientHeight);
|
|
@@ -4329,6 +4330,12 @@ class Designer {
|
|
|
4329
4330
|
getStepParents(needle) {
|
|
4330
4331
|
return this.walker.getParents(this.state.definition, needle);
|
|
4331
4332
|
}
|
|
4333
|
+
/**
|
|
4334
|
+
* @returns the definition walker.
|
|
4335
|
+
*/
|
|
4336
|
+
getWalker() {
|
|
4337
|
+
return this.walker;
|
|
4338
|
+
}
|
|
4332
4339
|
/**
|
|
4333
4340
|
* @description Destroys the designer and deletes all nodes from the placeholder.
|
|
4334
4341
|
*/
|
|
@@ -4371,4 +4378,4 @@ class StepsDesignerExtension {
|
|
|
4371
4378
|
class StepsExtension extends StepsDesignerExtension {
|
|
4372
4379
|
}
|
|
4373
4380
|
|
|
4374
|
-
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ControlBarApi, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerExtension, DefinitionChangeType, Designer, DesignerApi, DesignerContext, DesignerState, Dom, Editor, EditorApi, Icons, InputView, JoinView, KeyboardAction, LabelView, LineGridDesignerExtension, ObjectCloner, OutputView, PathBarApi, PlaceholderDirection, QuantifiedScaleViewportCalculator, RectPlaceholder, RectPlaceholderView, RegionView, ServicesResolver, SimpleEvent, StepComponent, StepExtensionResolver, StepsDesignerExtension, StepsExtension, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, race };
|
|
4381
|
+
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ControlBarApi, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerExtension, DefinitionChangeType, Designer, DesignerApi, DesignerContext, DesignerState, Dom, Editor, EditorApi, Icons, InputView, JoinView, KeyboardAction, LabelView, LineGridDesignerExtension, ObjectCloner, OutputView, PathBarApi, PlaceholderDirection, QuantifiedScaleViewportCalculator, RectPlaceholder, RectPlaceholderView, RegionView, ServicesResolver, SimpleEvent, StepComponent, StepExtensionResolver, StepsDesignerExtension, StepsExtension, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
package/lib/index.d.ts
CHANGED
|
@@ -309,6 +309,8 @@ declare class Dom {
|
|
|
309
309
|
static toggleClass(element: Element, isEnabled: boolean, className: string): void;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
declare function getAbsolutePosition(element: Element): Vector;
|
|
313
|
+
|
|
312
314
|
declare class Uid {
|
|
313
315
|
static next(): string;
|
|
314
316
|
}
|
|
@@ -1143,6 +1145,10 @@ declare class Designer<TDefinition extends Definition = Definition> {
|
|
|
1143
1145
|
* @returns parent steps and branch names.
|
|
1144
1146
|
*/
|
|
1145
1147
|
getStepParents(needle: Sequence | Step | string): StepOrName[];
|
|
1148
|
+
/**
|
|
1149
|
+
* @returns the definition walker.
|
|
1150
|
+
*/
|
|
1151
|
+
getWalker(): DefinitionWalker;
|
|
1146
1152
|
/**
|
|
1147
1153
|
* @description Destroys the designer and deletes all nodes from the placeholder.
|
|
1148
1154
|
*/
|
|
@@ -1191,4 +1197,4 @@ declare class StepsExtension extends StepsDesignerExtension {
|
|
|
1191
1197
|
interface StepsExtensionConfiguration extends StepsDesignerExtensionConfiguration {
|
|
1192
1198
|
}
|
|
1193
1199
|
|
|
1194
|
-
export { Attributes, Badge, BadgeExtension, BadgeView, Badges, BadgesResult, BaseClickCommand, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommand, ClickCommandType, ClickDetails, Component, ComponentContext, ComponentView, ContainerStep, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ControlBarApi, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerExtension, DefinitionChangeType, DefinitionChangedEvent, Designer, DesignerApi, DesignerConfiguration, DesignerContext, DesignerExtension, DesignerState, Dom, DraggedComponent, DraggedComponentExtension, Editor, EditorApi, EditorsConfiguration, Grid, GridExtension, Icons, InputView, JoinView, KeyboardAction, KeyboardConfiguration, LabelView, LineGridConfiguration, LineGridDesignerExtension, ObjectCloner, OpenFolderClickCommand, OutputView, PathBarApi, Placeholder, PlaceholderController, PlaceholderControllerExtension, PlaceholderDirection, PlaceholderExtension, PlaceholderView, QuantifiedScaleViewportCalculator, RectPlaceholder, RectPlaceholderConfiguration, RectPlaceholderView, RegionView, RerenderStepClickCommand, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, ServicesResolver, SimpleEvent, SimpleEventListener, StepComponent, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepExtensionResolver, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtension, StepsDesignerExtensionConfiguration, StepsExtension, StepsExtensionConfiguration, SwitchStep, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStep, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxApi, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, Uid, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtension, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Vector, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, race };
|
|
1200
|
+
export { Attributes, Badge, BadgeExtension, BadgeView, Badges, BadgesResult, BaseClickCommand, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommand, ClickCommandType, ClickDetails, Component, ComponentContext, ComponentView, ContainerStep, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ControlBarApi, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerExtension, DefinitionChangeType, DefinitionChangedEvent, Designer, DesignerApi, DesignerConfiguration, DesignerContext, DesignerExtension, DesignerState, Dom, DraggedComponent, DraggedComponentExtension, Editor, EditorApi, EditorsConfiguration, Grid, GridExtension, Icons, InputView, JoinView, KeyboardAction, KeyboardConfiguration, LabelView, LineGridConfiguration, LineGridDesignerExtension, ObjectCloner, OpenFolderClickCommand, OutputView, PathBarApi, Placeholder, PlaceholderController, PlaceholderControllerExtension, PlaceholderDirection, PlaceholderExtension, PlaceholderView, QuantifiedScaleViewportCalculator, RectPlaceholder, RectPlaceholderConfiguration, RectPlaceholderView, RegionView, RerenderStepClickCommand, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, ServicesResolver, SimpleEvent, SimpleEventListener, StepComponent, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepExtensionResolver, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtension, StepsDesignerExtensionConfiguration, StepsExtension, StepsExtensionConfiguration, SwitchStep, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStep, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxApi, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, Uid, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtension, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Vector, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
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.18.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|