sequential-workflow-designer 0.19.3 → 0.19.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/README.md +4 -4
- package/dist/index.umd.js +50 -46
- package/lib/cjs/index.cjs +50 -46
- package/lib/esm/index.js +50 -47
- package/lib/index.d.ts +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,10 +100,10 @@ Add the below code to your head section in HTML document.
|
|
|
100
100
|
```html
|
|
101
101
|
<head>
|
|
102
102
|
...
|
|
103
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.
|
|
104
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.
|
|
105
|
-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.
|
|
106
|
-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.
|
|
103
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer.css" rel="stylesheet">
|
|
104
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer-light.css" rel="stylesheet">
|
|
105
|
+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer-dark.css" rel="stylesheet">
|
|
106
|
+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/dist/index.umd.js"></script>
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Call the designer by:
|
package/dist/index.umd.js
CHANGED
|
@@ -1140,6 +1140,15 @@
|
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
1142
|
|
|
1143
|
+
class ComponentDom {
|
|
1144
|
+
static stepG(componentClassName, type, id) {
|
|
1145
|
+
return Dom.svg('g', {
|
|
1146
|
+
class: `sqd-step-${componentClassName} sqd-type-${type}`,
|
|
1147
|
+
'data-step-id': id
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1143
1152
|
class InputView {
|
|
1144
1153
|
static createRectInput(parent, x, y, size, iconSize, iconUrl) {
|
|
1145
1154
|
const g = Dom.svg('g');
|
|
@@ -1345,43 +1354,6 @@
|
|
|
1345
1354
|
return line;
|
|
1346
1355
|
}
|
|
1347
1356
|
|
|
1348
|
-
class RectPlaceholderView {
|
|
1349
|
-
static create(parent, width, height, radius, iconSize, direction) {
|
|
1350
|
-
const g = Dom.svg('g', {
|
|
1351
|
-
visibility: 'hidden',
|
|
1352
|
-
class: 'sqd-placeholder'
|
|
1353
|
-
});
|
|
1354
|
-
parent.appendChild(g);
|
|
1355
|
-
const rect = Dom.svg('rect', {
|
|
1356
|
-
class: 'sqd-placeholder-rect',
|
|
1357
|
-
width,
|
|
1358
|
-
height,
|
|
1359
|
-
rx: radius,
|
|
1360
|
-
ry: radius
|
|
1361
|
-
});
|
|
1362
|
-
g.appendChild(rect);
|
|
1363
|
-
if (direction) {
|
|
1364
|
-
const iconD = direction === exports.PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1365
|
-
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1366
|
-
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1367
|
-
}
|
|
1368
|
-
parent.appendChild(g);
|
|
1369
|
-
return new RectPlaceholderView(rect, g);
|
|
1370
|
-
}
|
|
1371
|
-
constructor(rect, g) {
|
|
1372
|
-
this.rect = rect;
|
|
1373
|
-
this.g = g;
|
|
1374
|
-
}
|
|
1375
|
-
setIsHover(isHover) {
|
|
1376
|
-
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1377
|
-
}
|
|
1378
|
-
setIsVisible(isVisible) {
|
|
1379
|
-
Dom.attrs(this.g, {
|
|
1380
|
-
visibility: isVisible ? 'visible' : 'hidden'
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
1357
|
class DefaultSequenceComponentView {
|
|
1386
1358
|
static create(parent, sequenceContext, componentContext) {
|
|
1387
1359
|
const phWidth = componentContext.services.placeholder.gapSize.x;
|
|
@@ -1510,9 +1482,7 @@
|
|
|
1510
1482
|
|
|
1511
1483
|
const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepContext, viewContext) => {
|
|
1512
1484
|
const { step } = stepContext;
|
|
1513
|
-
const g =
|
|
1514
|
-
class: `sqd-step-container sqd-type-${step.type}`
|
|
1515
|
-
});
|
|
1485
|
+
const g = ComponentDom.stepG('container', step.type, step.id);
|
|
1516
1486
|
parentElement.appendChild(g);
|
|
1517
1487
|
const labelView = LabelView.create(g, cfg.paddingTop, cfg.label, step.name, 'primary');
|
|
1518
1488
|
const sequenceComponent = viewContext.createSequenceComponent(g, step.sequence);
|
|
@@ -1558,9 +1528,7 @@
|
|
|
1558
1528
|
|
|
1559
1529
|
const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
|
|
1560
1530
|
const { step } = stepContext;
|
|
1561
|
-
const g =
|
|
1562
|
-
class: `sqd-step-switch sqd-type-${step.type}`
|
|
1563
|
-
});
|
|
1531
|
+
const g = ComponentDom.stepG('switch', step.type, step.id);
|
|
1564
1532
|
parent.appendChild(g);
|
|
1565
1533
|
const branchNames = Object.keys(step.branches);
|
|
1566
1534
|
const branchComponents = branchNames.map(branchName => {
|
|
@@ -1661,9 +1629,7 @@
|
|
|
1661
1629
|
|
|
1662
1630
|
const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElement, stepContext, viewContext) => {
|
|
1663
1631
|
const { step } = stepContext;
|
|
1664
|
-
const g =
|
|
1665
|
-
class: `sqd-step-task sqd-type-${step.type}`
|
|
1666
|
-
});
|
|
1632
|
+
const g = ComponentDom.stepG('task', step.type, step.id);
|
|
1667
1633
|
parentElement.appendChild(g);
|
|
1668
1634
|
const boxHeight = cfg.paddingY * 2 + cfg.iconSize;
|
|
1669
1635
|
const text = Dom.svg('text', {
|
|
@@ -1943,6 +1909,43 @@
|
|
|
1943
1909
|
}
|
|
1944
1910
|
}
|
|
1945
1911
|
|
|
1912
|
+
class RectPlaceholderView {
|
|
1913
|
+
static create(parent, width, height, radius, iconSize, direction) {
|
|
1914
|
+
const g = Dom.svg('g', {
|
|
1915
|
+
visibility: 'hidden',
|
|
1916
|
+
class: 'sqd-placeholder'
|
|
1917
|
+
});
|
|
1918
|
+
parent.appendChild(g);
|
|
1919
|
+
const rect = Dom.svg('rect', {
|
|
1920
|
+
class: 'sqd-placeholder-rect',
|
|
1921
|
+
width,
|
|
1922
|
+
height,
|
|
1923
|
+
rx: radius,
|
|
1924
|
+
ry: radius
|
|
1925
|
+
});
|
|
1926
|
+
g.appendChild(rect);
|
|
1927
|
+
if (direction) {
|
|
1928
|
+
const iconD = direction === exports.PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1929
|
+
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1930
|
+
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1931
|
+
}
|
|
1932
|
+
parent.appendChild(g);
|
|
1933
|
+
return new RectPlaceholderView(rect, g);
|
|
1934
|
+
}
|
|
1935
|
+
constructor(rect, g) {
|
|
1936
|
+
this.rect = rect;
|
|
1937
|
+
this.g = g;
|
|
1938
|
+
}
|
|
1939
|
+
setIsHover(isHover) {
|
|
1940
|
+
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1941
|
+
}
|
|
1942
|
+
setIsVisible(isVisible) {
|
|
1943
|
+
Dom.attrs(this.g, {
|
|
1944
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1946
1949
|
class RectPlaceholder {
|
|
1947
1950
|
static create(parent, size, direction, sequence, index, configuration) {
|
|
1948
1951
|
const view = RectPlaceholderView.create(parent, size.x, size.y, configuration.radius, configuration.iconSize, direction);
|
|
@@ -4708,6 +4711,7 @@
|
|
|
4708
4711
|
exports.CenteredViewportCalculator = CenteredViewportCalculator;
|
|
4709
4712
|
exports.ClassicWheelControllerExtension = ClassicWheelControllerExtension;
|
|
4710
4713
|
exports.ComponentContext = ComponentContext;
|
|
4714
|
+
exports.ComponentDom = ComponentDom;
|
|
4711
4715
|
exports.ControlBarApi = ControlBarApi;
|
|
4712
4716
|
exports.CustomActionController = CustomActionController;
|
|
4713
4717
|
exports.DefaultSequenceComponent = DefaultSequenceComponent;
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -1138,6 +1138,15 @@ class ValidationErrorBadgeExtension {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
1140
|
|
|
1141
|
+
class ComponentDom {
|
|
1142
|
+
static stepG(componentClassName, type, id) {
|
|
1143
|
+
return Dom.svg('g', {
|
|
1144
|
+
class: `sqd-step-${componentClassName} sqd-type-${type}`,
|
|
1145
|
+
'data-step-id': id
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1141
1150
|
class InputView {
|
|
1142
1151
|
static createRectInput(parent, x, y, size, iconSize, iconUrl) {
|
|
1143
1152
|
const g = Dom.svg('g');
|
|
@@ -1343,43 +1352,6 @@ function drawLine(parent, x1, y1, x2, y2) {
|
|
|
1343
1352
|
return line;
|
|
1344
1353
|
}
|
|
1345
1354
|
|
|
1346
|
-
class RectPlaceholderView {
|
|
1347
|
-
static create(parent, width, height, radius, iconSize, direction) {
|
|
1348
|
-
const g = Dom.svg('g', {
|
|
1349
|
-
visibility: 'hidden',
|
|
1350
|
-
class: 'sqd-placeholder'
|
|
1351
|
-
});
|
|
1352
|
-
parent.appendChild(g);
|
|
1353
|
-
const rect = Dom.svg('rect', {
|
|
1354
|
-
class: 'sqd-placeholder-rect',
|
|
1355
|
-
width,
|
|
1356
|
-
height,
|
|
1357
|
-
rx: radius,
|
|
1358
|
-
ry: radius
|
|
1359
|
-
});
|
|
1360
|
-
g.appendChild(rect);
|
|
1361
|
-
if (direction) {
|
|
1362
|
-
const iconD = direction === exports.PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1363
|
-
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1364
|
-
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1365
|
-
}
|
|
1366
|
-
parent.appendChild(g);
|
|
1367
|
-
return new RectPlaceholderView(rect, g);
|
|
1368
|
-
}
|
|
1369
|
-
constructor(rect, g) {
|
|
1370
|
-
this.rect = rect;
|
|
1371
|
-
this.g = g;
|
|
1372
|
-
}
|
|
1373
|
-
setIsHover(isHover) {
|
|
1374
|
-
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1375
|
-
}
|
|
1376
|
-
setIsVisible(isVisible) {
|
|
1377
|
-
Dom.attrs(this.g, {
|
|
1378
|
-
visibility: isVisible ? 'visible' : 'hidden'
|
|
1379
|
-
});
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
1355
|
class DefaultSequenceComponentView {
|
|
1384
1356
|
static create(parent, sequenceContext, componentContext) {
|
|
1385
1357
|
const phWidth = componentContext.services.placeholder.gapSize.x;
|
|
@@ -1508,9 +1480,7 @@ class DefaultSequenceComponent {
|
|
|
1508
1480
|
|
|
1509
1481
|
const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepContext, viewContext) => {
|
|
1510
1482
|
const { step } = stepContext;
|
|
1511
|
-
const g =
|
|
1512
|
-
class: `sqd-step-container sqd-type-${step.type}`
|
|
1513
|
-
});
|
|
1483
|
+
const g = ComponentDom.stepG('container', step.type, step.id);
|
|
1514
1484
|
parentElement.appendChild(g);
|
|
1515
1485
|
const labelView = LabelView.create(g, cfg.paddingTop, cfg.label, step.name, 'primary');
|
|
1516
1486
|
const sequenceComponent = viewContext.createSequenceComponent(g, step.sequence);
|
|
@@ -1556,9 +1526,7 @@ const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepCon
|
|
|
1556
1526
|
|
|
1557
1527
|
const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
|
|
1558
1528
|
const { step } = stepContext;
|
|
1559
|
-
const g =
|
|
1560
|
-
class: `sqd-step-switch sqd-type-${step.type}`
|
|
1561
|
-
});
|
|
1529
|
+
const g = ComponentDom.stepG('switch', step.type, step.id);
|
|
1562
1530
|
parent.appendChild(g);
|
|
1563
1531
|
const branchNames = Object.keys(step.branches);
|
|
1564
1532
|
const branchComponents = branchNames.map(branchName => {
|
|
@@ -1659,9 +1627,7 @@ const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, view
|
|
|
1659
1627
|
|
|
1660
1628
|
const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElement, stepContext, viewContext) => {
|
|
1661
1629
|
const { step } = stepContext;
|
|
1662
|
-
const g =
|
|
1663
|
-
class: `sqd-step-task sqd-type-${step.type}`
|
|
1664
|
-
});
|
|
1630
|
+
const g = ComponentDom.stepG('task', step.type, step.id);
|
|
1665
1631
|
parentElement.appendChild(g);
|
|
1666
1632
|
const boxHeight = cfg.paddingY * 2 + cfg.iconSize;
|
|
1667
1633
|
const text = Dom.svg('text', {
|
|
@@ -1941,6 +1907,43 @@ class StepExtensionResolver {
|
|
|
1941
1907
|
}
|
|
1942
1908
|
}
|
|
1943
1909
|
|
|
1910
|
+
class RectPlaceholderView {
|
|
1911
|
+
static create(parent, width, height, radius, iconSize, direction) {
|
|
1912
|
+
const g = Dom.svg('g', {
|
|
1913
|
+
visibility: 'hidden',
|
|
1914
|
+
class: 'sqd-placeholder'
|
|
1915
|
+
});
|
|
1916
|
+
parent.appendChild(g);
|
|
1917
|
+
const rect = Dom.svg('rect', {
|
|
1918
|
+
class: 'sqd-placeholder-rect',
|
|
1919
|
+
width,
|
|
1920
|
+
height,
|
|
1921
|
+
rx: radius,
|
|
1922
|
+
ry: radius
|
|
1923
|
+
});
|
|
1924
|
+
g.appendChild(rect);
|
|
1925
|
+
if (direction) {
|
|
1926
|
+
const iconD = direction === exports.PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1927
|
+
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1928
|
+
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1929
|
+
}
|
|
1930
|
+
parent.appendChild(g);
|
|
1931
|
+
return new RectPlaceholderView(rect, g);
|
|
1932
|
+
}
|
|
1933
|
+
constructor(rect, g) {
|
|
1934
|
+
this.rect = rect;
|
|
1935
|
+
this.g = g;
|
|
1936
|
+
}
|
|
1937
|
+
setIsHover(isHover) {
|
|
1938
|
+
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1939
|
+
}
|
|
1940
|
+
setIsVisible(isVisible) {
|
|
1941
|
+
Dom.attrs(this.g, {
|
|
1942
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1944
1947
|
class RectPlaceholder {
|
|
1945
1948
|
static create(parent, size, direction, sequence, index, configuration) {
|
|
1946
1949
|
const view = RectPlaceholderView.create(parent, size.x, size.y, configuration.radius, configuration.iconSize, direction);
|
|
@@ -4523,6 +4526,7 @@ exports.Badges = Badges;
|
|
|
4523
4526
|
exports.CenteredViewportCalculator = CenteredViewportCalculator;
|
|
4524
4527
|
exports.ClassicWheelControllerExtension = ClassicWheelControllerExtension;
|
|
4525
4528
|
exports.ComponentContext = ComponentContext;
|
|
4529
|
+
exports.ComponentDom = ComponentDom;
|
|
4526
4530
|
exports.ControlBarApi = ControlBarApi;
|
|
4527
4531
|
exports.CustomActionController = CustomActionController;
|
|
4528
4532
|
exports.DefaultSequenceComponent = DefaultSequenceComponent;
|
package/lib/esm/index.js
CHANGED
|
@@ -1137,6 +1137,15 @@ class ValidationErrorBadgeExtension {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
|
|
1140
|
+
class ComponentDom {
|
|
1141
|
+
static stepG(componentClassName, type, id) {
|
|
1142
|
+
return Dom.svg('g', {
|
|
1143
|
+
class: `sqd-step-${componentClassName} sqd-type-${type}`,
|
|
1144
|
+
'data-step-id': id
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1140
1149
|
class InputView {
|
|
1141
1150
|
static createRectInput(parent, x, y, size, iconSize, iconUrl) {
|
|
1142
1151
|
const g = Dom.svg('g');
|
|
@@ -1342,43 +1351,6 @@ function drawLine(parent, x1, y1, x2, y2) {
|
|
|
1342
1351
|
return line;
|
|
1343
1352
|
}
|
|
1344
1353
|
|
|
1345
|
-
class RectPlaceholderView {
|
|
1346
|
-
static create(parent, width, height, radius, iconSize, direction) {
|
|
1347
|
-
const g = Dom.svg('g', {
|
|
1348
|
-
visibility: 'hidden',
|
|
1349
|
-
class: 'sqd-placeholder'
|
|
1350
|
-
});
|
|
1351
|
-
parent.appendChild(g);
|
|
1352
|
-
const rect = Dom.svg('rect', {
|
|
1353
|
-
class: 'sqd-placeholder-rect',
|
|
1354
|
-
width,
|
|
1355
|
-
height,
|
|
1356
|
-
rx: radius,
|
|
1357
|
-
ry: radius
|
|
1358
|
-
});
|
|
1359
|
-
g.appendChild(rect);
|
|
1360
|
-
if (direction) {
|
|
1361
|
-
const iconD = direction === PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1362
|
-
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1363
|
-
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1364
|
-
}
|
|
1365
|
-
parent.appendChild(g);
|
|
1366
|
-
return new RectPlaceholderView(rect, g);
|
|
1367
|
-
}
|
|
1368
|
-
constructor(rect, g) {
|
|
1369
|
-
this.rect = rect;
|
|
1370
|
-
this.g = g;
|
|
1371
|
-
}
|
|
1372
|
-
setIsHover(isHover) {
|
|
1373
|
-
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1374
|
-
}
|
|
1375
|
-
setIsVisible(isVisible) {
|
|
1376
|
-
Dom.attrs(this.g, {
|
|
1377
|
-
visibility: isVisible ? 'visible' : 'hidden'
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
1354
|
class DefaultSequenceComponentView {
|
|
1383
1355
|
static create(parent, sequenceContext, componentContext) {
|
|
1384
1356
|
const phWidth = componentContext.services.placeholder.gapSize.x;
|
|
@@ -1507,9 +1479,7 @@ class DefaultSequenceComponent {
|
|
|
1507
1479
|
|
|
1508
1480
|
const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepContext, viewContext) => {
|
|
1509
1481
|
const { step } = stepContext;
|
|
1510
|
-
const g =
|
|
1511
|
-
class: `sqd-step-container sqd-type-${step.type}`
|
|
1512
|
-
});
|
|
1482
|
+
const g = ComponentDom.stepG('container', step.type, step.id);
|
|
1513
1483
|
parentElement.appendChild(g);
|
|
1514
1484
|
const labelView = LabelView.create(g, cfg.paddingTop, cfg.label, step.name, 'primary');
|
|
1515
1485
|
const sequenceComponent = viewContext.createSequenceComponent(g, step.sequence);
|
|
@@ -1555,9 +1525,7 @@ const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepCon
|
|
|
1555
1525
|
|
|
1556
1526
|
const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
|
|
1557
1527
|
const { step } = stepContext;
|
|
1558
|
-
const g =
|
|
1559
|
-
class: `sqd-step-switch sqd-type-${step.type}`
|
|
1560
|
-
});
|
|
1528
|
+
const g = ComponentDom.stepG('switch', step.type, step.id);
|
|
1561
1529
|
parent.appendChild(g);
|
|
1562
1530
|
const branchNames = Object.keys(step.branches);
|
|
1563
1531
|
const branchComponents = branchNames.map(branchName => {
|
|
@@ -1658,9 +1626,7 @@ const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, view
|
|
|
1658
1626
|
|
|
1659
1627
|
const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElement, stepContext, viewContext) => {
|
|
1660
1628
|
const { step } = stepContext;
|
|
1661
|
-
const g =
|
|
1662
|
-
class: `sqd-step-task sqd-type-${step.type}`
|
|
1663
|
-
});
|
|
1629
|
+
const g = ComponentDom.stepG('task', step.type, step.id);
|
|
1664
1630
|
parentElement.appendChild(g);
|
|
1665
1631
|
const boxHeight = cfg.paddingY * 2 + cfg.iconSize;
|
|
1666
1632
|
const text = Dom.svg('text', {
|
|
@@ -1940,6 +1906,43 @@ class StepExtensionResolver {
|
|
|
1940
1906
|
}
|
|
1941
1907
|
}
|
|
1942
1908
|
|
|
1909
|
+
class RectPlaceholderView {
|
|
1910
|
+
static create(parent, width, height, radius, iconSize, direction) {
|
|
1911
|
+
const g = Dom.svg('g', {
|
|
1912
|
+
visibility: 'hidden',
|
|
1913
|
+
class: 'sqd-placeholder'
|
|
1914
|
+
});
|
|
1915
|
+
parent.appendChild(g);
|
|
1916
|
+
const rect = Dom.svg('rect', {
|
|
1917
|
+
class: 'sqd-placeholder-rect',
|
|
1918
|
+
width,
|
|
1919
|
+
height,
|
|
1920
|
+
rx: radius,
|
|
1921
|
+
ry: radius
|
|
1922
|
+
});
|
|
1923
|
+
g.appendChild(rect);
|
|
1924
|
+
if (direction) {
|
|
1925
|
+
const iconD = direction === PlaceholderDirection.in ? Icons.folderIn : Icons.folderOut;
|
|
1926
|
+
const icon = Icons.appendPath(g, 'sqd-placeholder-icon-path', iconD, iconSize);
|
|
1927
|
+
Dom.translate(icon, (width - iconSize) / 2, (height - iconSize) / 2);
|
|
1928
|
+
}
|
|
1929
|
+
parent.appendChild(g);
|
|
1930
|
+
return new RectPlaceholderView(rect, g);
|
|
1931
|
+
}
|
|
1932
|
+
constructor(rect, g) {
|
|
1933
|
+
this.rect = rect;
|
|
1934
|
+
this.g = g;
|
|
1935
|
+
}
|
|
1936
|
+
setIsHover(isHover) {
|
|
1937
|
+
Dom.toggleClass(this.g, isHover, 'sqd-hover');
|
|
1938
|
+
}
|
|
1939
|
+
setIsVisible(isVisible) {
|
|
1940
|
+
Dom.attrs(this.g, {
|
|
1941
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1943
1946
|
class RectPlaceholder {
|
|
1944
1947
|
static create(parent, size, direction, sequence, index, configuration) {
|
|
1945
1948
|
const view = RectPlaceholderView.create(parent, size.x, size.y, configuration.radius, configuration.iconSize, direction);
|
|
@@ -4518,4 +4521,4 @@ class StepsDesignerExtension {
|
|
|
4518
4521
|
}
|
|
4519
4522
|
}
|
|
4520
4523
|
|
|
4521
|
-
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ControlBarApi, CustomActionController, 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, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
|
4524
|
+
export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ComponentDom, ControlBarApi, CustomActionController, 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, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, WorkspaceApi, createContainerStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
|
package/lib/index.d.ts
CHANGED
|
@@ -509,6 +509,10 @@ declare class ValidationErrorBadgeExtension implements BadgeExtension {
|
|
|
509
509
|
readonly createStartValue: () => boolean;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
+
declare class ComponentDom {
|
|
513
|
+
static stepG(componentClassName: string, type: string, id: string): SVGGElement;
|
|
514
|
+
}
|
|
515
|
+
|
|
512
516
|
declare class InputView {
|
|
513
517
|
private readonly root;
|
|
514
518
|
static createRectInput(parent: SVGElement, x: number, y: number, size: number, iconSize: number, iconUrl: string | null): InputView;
|
|
@@ -555,15 +559,6 @@ declare class RegionView {
|
|
|
555
559
|
setIsSelected(isSelected: boolean): void;
|
|
556
560
|
}
|
|
557
561
|
|
|
558
|
-
declare class RectPlaceholderView implements PlaceholderView {
|
|
559
|
-
readonly rect: SVGElement;
|
|
560
|
-
readonly g: SVGGElement;
|
|
561
|
-
static create(parent: SVGElement, width: number, height: number, radius: number, iconSize: number, direction: PlaceholderDirection): RectPlaceholderView;
|
|
562
|
-
private constructor();
|
|
563
|
-
setIsHover(isHover: boolean): void;
|
|
564
|
-
setIsVisible(isVisible: boolean): void;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
562
|
declare class DefaultSequenceComponentView implements ComponentView {
|
|
568
563
|
readonly g: SVGGElement;
|
|
569
564
|
readonly width: number;
|
|
@@ -686,6 +681,15 @@ interface RectPlaceholderConfiguration {
|
|
|
686
681
|
iconSize: number;
|
|
687
682
|
}
|
|
688
683
|
|
|
684
|
+
declare class RectPlaceholderView implements PlaceholderView {
|
|
685
|
+
readonly rect: SVGElement;
|
|
686
|
+
readonly g: SVGGElement;
|
|
687
|
+
static create(parent: SVGElement, width: number, height: number, radius: number, iconSize: number, direction: PlaceholderDirection): RectPlaceholderView;
|
|
688
|
+
private constructor();
|
|
689
|
+
setIsHover(isHover: boolean): void;
|
|
690
|
+
setIsVisible(isVisible: boolean): void;
|
|
691
|
+
}
|
|
692
|
+
|
|
689
693
|
declare class RectPlaceholder implements Placeholder {
|
|
690
694
|
readonly view: RectPlaceholderView;
|
|
691
695
|
readonly parentSequence: Sequence;
|
|
@@ -1210,4 +1214,4 @@ declare class StepsDesignerExtension implements DesignerExtension {
|
|
|
1210
1214
|
protected constructor(steps: StepExtension<Step>[]);
|
|
1211
1215
|
}
|
|
1212
1216
|
|
|
1213
|
-
export { Attributes, Badge, BadgeExtension, BadgeView, Badges, BadgesResult, BaseClickCommand, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommand, ClickCommandType, ClickDetails, Component, ComponentContext, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, ControlBarApi, CustomAction, CustomActionController, 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, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, ServicesResolver, SimpleEvent, SimpleEventListener, StateModifierDependency, StepComponent, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepExtensionResolver, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtension, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, 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 };
|
|
1217
|
+
export { Attributes, Badge, BadgeExtension, BadgeView, Badges, BadgesResult, BaseClickCommand, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommand, ClickCommandType, ClickDetails, Component, ComponentContext, ComponentDom, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, ControlBarApi, CustomAction, CustomActionController, 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, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, ServicesResolver, SimpleEvent, SimpleEventListener, StateModifierDependency, StepComponent, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepExtensionResolver, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtension, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, 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.19.
|
|
4
|
+
"version": "0.19.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|