sequential-workflow-designer 0.29.2 → 0.30.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 CHANGED
@@ -440,13 +440,16 @@ class PlaceholderFinder {
440
440
  const scroll = new Vector(window.scrollX, window.scrollY);
441
441
  this.cache = this.placeholders.map(placeholder => {
442
442
  const rect = placeholder.getClientRect();
443
+ const lt = new Vector(rect.x, rect.y).add(scroll);
444
+ const br = new Vector(rect.x + rect.width, rect.y + rect.height).add(scroll);
443
445
  return {
444
446
  placeholder,
445
- lt: new Vector(rect.x, rect.y).add(scroll),
446
- br: new Vector(rect.x + rect.width, rect.y + rect.height).add(scroll)
447
+ lt,
448
+ br,
449
+ diagSq: lt.x * lt.x + lt.y * lt.y
447
450
  };
448
451
  });
449
- this.cache.sort((a, b) => a.lt.y - b.lt.y);
452
+ this.cache.sort((a, b) => a.diagSq - b.diagSq);
450
453
  }
451
454
  const vR = vLt.x + vWidth;
452
455
  const vB = vLt.y + vHeight;
@@ -598,7 +601,7 @@ class ToolboxApi {
598
601
  }
599
602
  activateStep(step) {
600
603
  const newStep = ObjectCloner.deepClone(step);
601
- newStep.id = this.uidGenerator ? this.uidGenerator() : Uid.next();
604
+ newStep.id = this.uidGenerator();
602
605
  return newStep;
603
606
  }
604
607
  }
@@ -613,9 +616,9 @@ class StepTypeValidator {
613
616
  }
614
617
 
615
618
  class ToolboxDataProvider {
616
- constructor(iconProvider, i18n, configuration) {
617
- this.iconProvider = iconProvider;
619
+ constructor(i18n, iconProvider, configuration) {
618
620
  this.i18n = i18n;
621
+ this.iconProvider = iconProvider;
619
622
  this.configuration = configuration;
620
623
  this.createItemData = (step) => {
621
624
  StepTypeValidator.validate(step.type);
@@ -820,8 +823,8 @@ class DesignerApi {
820
823
  static create(context) {
821
824
  const workspace = new WorkspaceApi(context.state, context.definitionWalker, context.workspaceController);
822
825
  const viewportController = context.services.viewportController.create(workspace);
823
- const toolboxDataProvider = new ToolboxDataProvider(context.componentContext.iconProvider, context.i18n, context.configuration.toolbox);
824
- return new DesignerApi(context.configuration.shadowRoot, ControlBarApi.create(context.state, context.historyController, context.stateModifier), new ToolboxApi(context.state, context, context.behaviorController, toolboxDataProvider, context.configuration.uidGenerator), new EditorApi(context.state, context.definitionWalker, context.stateModifier), workspace, new ViewportApi(context.state, context.workspaceController, viewportController), new PathBarApi(context.state, context.definitionWalker), context.definitionWalker, context.i18n);
826
+ const toolboxDataProvider = new ToolboxDataProvider(context.i18n, context.componentContext.iconProvider, context.configuration.toolbox);
827
+ return new DesignerApi(context.configuration.shadowRoot, ControlBarApi.create(context.state, context.historyController, context.stateModifier), new ToolboxApi(context.state, context, context.behaviorController, toolboxDataProvider, context.uidGenerator), new EditorApi(context.state, context.definitionWalker, context.stateModifier), workspace, new ViewportApi(context.state, context.workspaceController, viewportController), new PathBarApi(context.state, context.definitionWalker), context.definitionWalker, context.i18n);
825
828
  }
826
829
  constructor(shadowRoot, controlBar, toolbox, editor, workspace, viewport, pathBar, definitionWalker, i18n) {
827
830
  this.shadowRoot = shadowRoot;
@@ -1009,7 +1012,7 @@ class ValidationErrorBadge {
1009
1012
  }
1010
1013
  }
1011
1014
 
1012
- const defaultConfiguration$7 = {
1015
+ const defaultConfiguration$5 = {
1013
1016
  view: {
1014
1017
  size: 22,
1015
1018
  iconSize: 12
@@ -1017,7 +1020,7 @@ const defaultConfiguration$7 = {
1017
1020
  };
1018
1021
  class ValidationErrorBadgeExtension {
1019
1022
  static create(configuration) {
1020
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$7);
1023
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1021
1024
  }
1022
1025
  constructor(configuration) {
1023
1026
  this.configuration = configuration;
@@ -1107,7 +1110,7 @@ class JoinView {
1107
1110
  switch (targets.length) {
1108
1111
  case 1:
1109
1112
  if (start.x === targets[0].x) {
1110
- JoinView.createStraightJoin(parent, start, firstTarget.y * dy);
1113
+ JoinView.createStraightJoin(parent, start, h * 2 * dy);
1111
1114
  }
1112
1115
  else {
1113
1116
  appendCurvedJoins(parent, start, targets, h, dy);
@@ -1203,10 +1206,18 @@ class OutputView {
1203
1206
  }
1204
1207
  }
1205
1208
 
1209
+ // PlaceholderExtension
1210
+ exports.PlaceholderGapOrientation = void 0;
1211
+ (function (PlaceholderGapOrientation) {
1212
+ PlaceholderGapOrientation[PlaceholderGapOrientation["along"] = 0] = "along";
1213
+ PlaceholderGapOrientation[PlaceholderGapOrientation["perpendicular"] = 1] = "perpendicular"; // Goes perpendicular to the flow
1214
+ })(exports.PlaceholderGapOrientation || (exports.PlaceholderGapOrientation = {}));
1215
+
1206
1216
  class DefaultSequenceComponentView {
1207
1217
  static create(parent, sequenceContext, componentContext) {
1208
- const phWidth = componentContext.services.placeholder.gapSize.x;
1209
- const phHeight = componentContext.services.placeholder.gapSize.y;
1218
+ const phSize = componentContext.services.placeholder.getGapSize(exports.PlaceholderGapOrientation.along);
1219
+ const phWidth = phSize.x;
1220
+ const phHeight = phSize.y;
1210
1221
  const { sequence } = sequenceContext;
1211
1222
  const g = Dom.svg('g');
1212
1223
  parent.appendChild(g);
@@ -1243,7 +1254,7 @@ class DefaultSequenceComponentView {
1243
1254
  JoinView.createStraightJoin(g, new Vector(joinX, offsetY - phHeight), phHeight);
1244
1255
  }
1245
1256
  if (!sequenceContext.isPreview && componentContext.placeholderController.canCreate(sequence, i)) {
1246
- const ph = componentContext.services.placeholder.createForGap(g, sequence, i);
1257
+ const ph = componentContext.services.placeholder.createForGap(g, sequence, i, exports.PlaceholderGapOrientation.along);
1247
1258
  Dom.translate(ph.view.g, joinX - phWidth / 2, offsetY - phHeight);
1248
1259
  placeholders.push(ph);
1249
1260
  }
@@ -1255,7 +1266,7 @@ class DefaultSequenceComponentView {
1255
1266
  }
1256
1267
  const newIndex = components.length;
1257
1268
  if (!sequenceContext.isPreview && componentContext.placeholderController.canCreate(sequence, newIndex)) {
1258
- const ph = componentContext.services.placeholder.createForGap(g, sequence, newIndex);
1269
+ const ph = componentContext.services.placeholder.createForGap(g, sequence, newIndex, exports.PlaceholderGapOrientation.along);
1259
1270
  Dom.translate(ph.view.g, joinX - phWidth / 2, offsetY - phHeight);
1260
1271
  placeholders.push(ph);
1261
1272
  }
@@ -1303,21 +1314,19 @@ class DefaultSequenceComponent {
1303
1314
  }
1304
1315
  findById(stepId) {
1305
1316
  for (const component of this.view.components) {
1306
- const sc = component.findById(stepId);
1307
- if (sc) {
1308
- return sc;
1317
+ const result = component.findById(stepId);
1318
+ if (result) {
1319
+ return result;
1309
1320
  }
1310
1321
  }
1311
1322
  return null;
1312
1323
  }
1313
1324
  resolvePlaceholders(skipComponent, result) {
1325
+ this.view.components.forEach(component => component.resolvePlaceholders(skipComponent, result));
1314
1326
  this.view.placeholders.forEach(placeholder => result.placeholders.push(placeholder));
1315
- this.view.components.forEach(c => c.resolvePlaceholders(skipComponent, result));
1316
1327
  }
1317
1328
  updateBadges(result) {
1318
- for (const component of this.view.components) {
1319
- component.updateBadges(result);
1320
- }
1329
+ this.view.components.forEach(component => component.updateBadges(result));
1321
1330
  }
1322
1331
  }
1323
1332
 
@@ -1330,7 +1339,7 @@ exports.ClickCommandType = void 0;
1330
1339
  })(exports.ClickCommandType || (exports.ClickCommandType = {}));
1331
1340
  exports.PlaceholderDirection = void 0;
1332
1341
  (function (PlaceholderDirection) {
1333
- PlaceholderDirection[PlaceholderDirection["none"] = 0] = "none";
1342
+ PlaceholderDirection[PlaceholderDirection["gap"] = 0] = "gap";
1334
1343
  PlaceholderDirection[PlaceholderDirection["in"] = 1] = "in";
1335
1344
  PlaceholderDirection[PlaceholderDirection["out"] = 2] = "out";
1336
1345
  })(exports.PlaceholderDirection || (exports.PlaceholderDirection = {}));
@@ -1344,7 +1353,7 @@ class StartStopRootComponentView {
1344
1353
  const sequenceComponent = DefaultSequenceComponent.create(g, {
1345
1354
  sequence,
1346
1355
  depth: 0,
1347
- isInputConnected: true,
1356
+ isInputConnected: Boolean(cfg.start),
1348
1357
  isOutputConnected: true,
1349
1358
  isPreview: false
1350
1359
  }, context);
@@ -1352,9 +1361,11 @@ class StartStopRootComponentView {
1352
1361
  const x = view.joinX - cfg.size / 2;
1353
1362
  const endY = cfg.size + view.height;
1354
1363
  const iconSize = parentPlaceIndicator ? cfg.folderIconSize : cfg.defaultIconSize;
1355
- const startCircle = createCircle('start', parentPlaceIndicator ? cfg.folderIconD : cfg.startIconD, cfg.size, iconSize);
1356
- Dom.translate(startCircle, x, 0);
1357
- g.appendChild(startCircle);
1364
+ if (cfg.start) {
1365
+ const startCircle = createCircle('start', parentPlaceIndicator ? cfg.folderIconD : cfg.start.iconD, cfg.size, iconSize);
1366
+ Dom.translate(startCircle, x, 0);
1367
+ g.appendChild(startCircle);
1368
+ }
1358
1369
  Dom.translate(view.g, 0, cfg.size);
1359
1370
  const stopCircle = createCircle('stop', parentPlaceIndicator ? cfg.folderIconD : cfg.stopIconD, cfg.size, iconSize);
1360
1371
  Dom.translate(stopCircle, x, endY);
@@ -1431,31 +1442,33 @@ class StartStopRootComponent {
1431
1442
  }
1432
1443
  }
1433
1444
 
1434
- const defaultConfiguration$6 = {
1435
- view: {
1436
- size: 30,
1437
- defaultIconSize: 22,
1438
- folderIconSize: 18,
1439
- startIconD: Icons.play,
1440
- stopIconD: Icons.stop,
1441
- folderIconD: Icons.folder
1442
- }
1445
+ const defaultViewConfiguration$2 = {
1446
+ size: 30,
1447
+ defaultIconSize: 22,
1448
+ folderIconSize: 18,
1449
+ start: {
1450
+ iconD: Icons.play
1451
+ },
1452
+ stopIconD: Icons.stop,
1453
+ folderIconD: Icons.folder
1443
1454
  };
1444
1455
  class StartStopRootComponentExtension {
1445
1456
  static create(configuration) {
1446
- return new StartStopRootComponentExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$6);
1457
+ return new StartStopRootComponentExtension(configuration);
1447
1458
  }
1448
1459
  constructor(configuration) {
1449
1460
  this.configuration = configuration;
1450
1461
  }
1451
1462
  create(parentElement, sequence, parentPlaceIndicator, context) {
1452
- return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, this.configuration.view);
1463
+ var _a;
1464
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$2), this.configuration.view) : defaultViewConfiguration$2;
1465
+ return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1453
1466
  }
1454
1467
  }
1455
1468
 
1456
- const COMPONENT_CLASS_NAME$2 = 'container';
1469
+ const COMPONENT_CLASS_NAME$3 = 'container';
1457
1470
  const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepContext, viewContext) => {
1458
- return viewContext.createRegionComponentView(parentElement, COMPONENT_CLASS_NAME$2, (g, regionViewBuilder) => {
1471
+ return viewContext.createRegionComponentView(parentElement, COMPONENT_CLASS_NAME$3, (g, regionViewBuilder) => {
1459
1472
  const step = stepContext.step;
1460
1473
  const name = viewContext.getStepName();
1461
1474
  const labelView = LabelView.create(g, cfg.paddingTop, cfg.label, name, 'primary');
@@ -1481,7 +1494,7 @@ const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepCon
1481
1494
  height,
1482
1495
  joinX,
1483
1496
  placeholders: null,
1484
- sequenceComponents: [sequenceComponent],
1497
+ components: [sequenceComponent],
1485
1498
  hasOutput: sequenceComponent.hasOutput,
1486
1499
  getClientPosition() {
1487
1500
  return regionView.getClientPosition();
@@ -1505,6 +1518,149 @@ const createContainerStepComponentViewFactory = (cfg) => (parentElement, stepCon
1505
1518
  });
1506
1519
  };
1507
1520
 
1521
+ const COMPONENT_CLASS_NAME$2 = 'launch-pad';
1522
+ function createView$1(parentElement, stepContext, viewContext, regionViewFactory, isInterruptedIfEmpty, cfg) {
1523
+ const step = stepContext.step;
1524
+ const sequence = stepContext.step.sequence;
1525
+ const g = ComponentDom.stepG(COMPONENT_CLASS_NAME$2, step.type, step.id);
1526
+ parentElement.appendChild(g);
1527
+ const components = [];
1528
+ let width;
1529
+ let height;
1530
+ let joinX;
1531
+ const placeholdersX = [];
1532
+ let placeholderOrientation;
1533
+ let placeholderSize;
1534
+ let hasOutput;
1535
+ let inputView = null;
1536
+ let outputView = null;
1537
+ if (sequence.length > 0) {
1538
+ let maxComponentHeight = 0;
1539
+ for (let i = 0; i < sequence.length; i++) {
1540
+ const component = viewContext.createStepComponent(g, sequence, sequence[i], i);
1541
+ components.push(component);
1542
+ maxComponentHeight = Math.max(maxComponentHeight, component.view.height);
1543
+ }
1544
+ const joinsX = [];
1545
+ const positionsX = [];
1546
+ const spacesY = [];
1547
+ placeholderOrientation = exports.PlaceholderGapOrientation.perpendicular;
1548
+ placeholderSize = viewContext.getPlaceholderGapSize(placeholderOrientation);
1549
+ placeholdersX.push(0);
1550
+ let positionX = placeholderSize.x;
1551
+ for (let i = 0; i < components.length; i++) {
1552
+ if (i > 0) {
1553
+ placeholdersX.push(positionX);
1554
+ positionX += placeholderSize.x;
1555
+ }
1556
+ const component = components[i];
1557
+ const componentY = (maxComponentHeight - component.view.height) / 2 + cfg.connectionHeight + cfg.paddingY;
1558
+ Dom.translate(component.view.g, positionX, componentY);
1559
+ joinsX.push(positionX + component.view.joinX);
1560
+ positionX += component.view.width;
1561
+ positionsX.push(positionX);
1562
+ spacesY.push(Math.max(0, (maxComponentHeight - component.view.height) / 2));
1563
+ }
1564
+ placeholdersX.push(positionX);
1565
+ positionX += placeholderSize.x;
1566
+ width = positionX;
1567
+ height = maxComponentHeight + 2 * cfg.connectionHeight + 2 * cfg.paddingY;
1568
+ const contentJoinX = components.length % 2 === 0
1569
+ ? positionsX[Math.max(0, Math.floor(components.length / 2) - 1)] + placeholderSize.x / 2
1570
+ : joinsX[Math.floor(components.length / 2)];
1571
+ if (stepContext.isInputConnected) {
1572
+ const joinsTopY = joinsX.map(x => new Vector(x, cfg.connectionHeight));
1573
+ JoinView.createJoins(g, new Vector(contentJoinX, 0), joinsTopY);
1574
+ for (let i = 0; i < joinsX.length; i++) {
1575
+ JoinView.createStraightJoin(g, joinsTopY[i], cfg.paddingY + spacesY[i]);
1576
+ }
1577
+ }
1578
+ const joinsBottomY = joinsX.map(x => new Vector(x, cfg.connectionHeight + 2 * cfg.paddingY + maxComponentHeight));
1579
+ JoinView.createJoins(g, new Vector(contentJoinX, height), joinsBottomY);
1580
+ for (let i = 0; i < joinsX.length; i++) {
1581
+ JoinView.createStraightJoin(g, joinsBottomY[i], -(cfg.paddingY + spacesY[i]));
1582
+ }
1583
+ hasOutput = true;
1584
+ joinX = contentJoinX;
1585
+ }
1586
+ else {
1587
+ placeholderOrientation = exports.PlaceholderGapOrientation.along;
1588
+ placeholderSize = viewContext.getPlaceholderGapSize(placeholderOrientation);
1589
+ placeholdersX.push(cfg.emptyPaddingX);
1590
+ width = placeholderSize.x + cfg.emptyPaddingX * 2;
1591
+ height = placeholderSize.y + cfg.emptyPaddingY * 2;
1592
+ hasOutput = !isInterruptedIfEmpty;
1593
+ if (stepContext.isInputConnected) {
1594
+ inputView = InputView.createRoundInput(g, width / 2, 0, cfg.emptyInputSize);
1595
+ }
1596
+ if (stepContext.isOutputConnected && hasOutput) {
1597
+ outputView = OutputView.create(g, width / 2, height, cfg.emptyOutputSize);
1598
+ }
1599
+ if (cfg.emptyIconSize > 0) {
1600
+ const iconUrl = viewContext.getStepIconUrl();
1601
+ if (iconUrl) {
1602
+ const icon = Dom.svg('image', {
1603
+ href: iconUrl,
1604
+ x: (width - cfg.emptyIconSize) / 2,
1605
+ y: (height - cfg.emptyIconSize) / 2,
1606
+ width: cfg.emptyIconSize,
1607
+ height: cfg.emptyIconSize
1608
+ });
1609
+ g.appendChild(icon);
1610
+ }
1611
+ }
1612
+ joinX = width / 2;
1613
+ }
1614
+ let regionView = null;
1615
+ if (regionViewFactory) {
1616
+ regionView = regionViewFactory(g, [width], height);
1617
+ }
1618
+ const placeholders = [];
1619
+ const placeholderY = (height - placeholderSize.y) / 2;
1620
+ for (let i = 0; i < placeholdersX.length; i++) {
1621
+ const placeholder = viewContext.createPlaceholderForGap(g, sequence, i, placeholderOrientation);
1622
+ placeholders.push(placeholder);
1623
+ Dom.translate(placeholder.view.g, placeholdersX[i], placeholderY);
1624
+ }
1625
+ return {
1626
+ g,
1627
+ width,
1628
+ height,
1629
+ joinX,
1630
+ components,
1631
+ placeholders,
1632
+ hasOutput,
1633
+ getClientPosition() {
1634
+ return getAbsolutePosition(g);
1635
+ },
1636
+ resolveClick(click) {
1637
+ if (regionView) {
1638
+ const result = regionView.resolveClick(click);
1639
+ return result === true || (result === null && g.contains(click.element)) ? true : result;
1640
+ }
1641
+ return null;
1642
+ },
1643
+ setIsDragging(isDragging) {
1644
+ inputView === null || inputView === void 0 ? void 0 : inputView.setIsHidden(isDragging);
1645
+ outputView === null || outputView === void 0 ? void 0 : outputView.setIsHidden(isDragging);
1646
+ },
1647
+ setIsDisabled(isDisabled) {
1648
+ Dom.toggleClass(g, isDisabled, 'sqd-disabled');
1649
+ },
1650
+ setIsSelected(isSelected) {
1651
+ regionView === null || regionView === void 0 ? void 0 : regionView.setIsSelected(isSelected);
1652
+ }
1653
+ };
1654
+ }
1655
+ const createLaunchPadStepComponentViewFactory = (isInterruptedIfEmpty, cfg) => (parentElement, stepContext, viewContext) => {
1656
+ if (cfg.isRegionEnabled) {
1657
+ return viewContext.createRegionComponentView(parentElement, COMPONENT_CLASS_NAME$2, (g, regionViewBuilder) => {
1658
+ return createView$1(g, stepContext, viewContext, regionViewBuilder, isInterruptedIfEmpty, cfg);
1659
+ });
1660
+ }
1661
+ return createView$1(parentElement, stepContext, viewContext, null, isInterruptedIfEmpty, cfg);
1662
+ };
1663
+
1508
1664
  const COMPONENT_CLASS_NAME$1 = 'switch';
1509
1665
  function createView(g, width, height, joinX, viewContext, sequenceComponents, regionView, cfg) {
1510
1666
  let inputView = null;
@@ -1518,7 +1674,7 @@ function createView(g, width, height, joinX, viewContext, sequenceComponents, re
1518
1674
  height,
1519
1675
  joinX,
1520
1676
  placeholders: null,
1521
- sequenceComponents,
1677
+ components: sequenceComponents,
1522
1678
  hasOutput: sequenceComponents ? sequenceComponents.some(c => c.hasOutput) : true,
1523
1679
  getClientPosition() {
1524
1680
  return regionView.getClientPosition();
@@ -1540,13 +1696,13 @@ function createView(g, width, height, joinX, viewContext, sequenceComponents, re
1540
1696
  }
1541
1697
  };
1542
1698
  }
1543
- const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
1699
+ const createSwitchStepComponentViewFactory = (cfg, branchNameResolver) => (parent, stepContext, viewContext) => {
1544
1700
  return viewContext.createRegionComponentView(parent, COMPONENT_CLASS_NAME$1, (g, regionViewBuilder) => {
1545
1701
  const step = stepContext.step;
1546
1702
  const paddingTop = cfg.paddingTop1 + cfg.paddingTop2;
1547
1703
  const name = viewContext.getStepName();
1548
1704
  const nameLabelView = LabelView.create(g, paddingTop, cfg.nameLabel, name, 'primary');
1549
- const branchNames = Object.keys(step.branches);
1705
+ const branchNames = branchNameResolver ? branchNameResolver(step) : Object.keys(step.branches);
1550
1706
  if (branchNames.length === 0) {
1551
1707
  const width = Math.max(nameLabelView.width, cfg.minBranchWidth) + cfg.paddingX * 2;
1552
1708
  const height = nameLabelView.height + paddingTop + cfg.noBranchPaddingBottom;
@@ -1669,7 +1825,7 @@ const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElemen
1669
1825
  height: cfg.iconSize
1670
1826
  });
1671
1827
  g.appendChild(icon);
1672
- const isInputViewHidden = stepContext.depth === 0 && stepContext.position === 0 && !stepContext.isInputConnected;
1828
+ const isInputViewHidden = !stepContext.isInputConnected; // TODO: handle inside the folder
1673
1829
  const isOutputViewHidden = isInterrupted;
1674
1830
  const inputView = isInputViewHidden ? null : InputView.createRoundInput(g, boxWidth / 2, 0, cfg.inputSize);
1675
1831
  const outputView = isOutputViewHidden ? null : OutputView.create(g, boxWidth / 2, boxHeight, cfg.outputSize);
@@ -1678,7 +1834,7 @@ const createTaskStepComponentViewFactory = (isInterrupted, cfg) => (parentElemen
1678
1834
  width: boxWidth,
1679
1835
  height: boxHeight,
1680
1836
  joinX: boxWidth / 2,
1681
- sequenceComponents: null,
1837
+ components: null,
1682
1838
  placeholders: null,
1683
1839
  hasOutput: !!outputView,
1684
1840
  getClientPosition() {
@@ -1779,14 +1935,14 @@ class NextQuantifiedNumber {
1779
1935
  }
1780
1936
  }
1781
1937
 
1782
- const defaultConfiguration$5 = {
1938
+ const defaultConfiguration$4 = {
1783
1939
  scales: [0.06, 0.08, 0.1, 0.12, 0.16, 0.2, 0.26, 0.32, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
1784
1940
  smoothDeltaYLimit: 16,
1785
1941
  padding: 10
1786
1942
  };
1787
1943
  class DefaultViewportController {
1788
1944
  static create(api, configuration) {
1789
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5;
1945
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
1790
1946
  const nqn = new NextQuantifiedNumber(config.scales);
1791
1947
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
1792
1948
  }
@@ -1853,8 +2009,8 @@ class StepComponent {
1853
2009
  if (this.step.id === stepId) {
1854
2010
  return this;
1855
2011
  }
1856
- if (this.view.sequenceComponents) {
1857
- for (const component of this.view.sequenceComponents) {
2012
+ if (this.view.components) {
2013
+ for (const component of this.view.components) {
1858
2014
  const result = component.findById(stepId);
1859
2015
  if (result) {
1860
2016
  return result;
@@ -1864,14 +2020,22 @@ class StepComponent {
1864
2020
  return null;
1865
2021
  }
1866
2022
  resolveClick(click) {
1867
- if (this.view.sequenceComponents) {
1868
- for (const component of this.view.sequenceComponents) {
2023
+ if (this.view.components) {
2024
+ for (const component of this.view.components) {
1869
2025
  const result = component.resolveClick(click);
1870
2026
  if (result) {
1871
2027
  return result;
1872
2028
  }
1873
2029
  }
1874
2030
  }
2031
+ if (this.view.placeholders) {
2032
+ for (const placeholder of this.view.placeholders) {
2033
+ const result = placeholder.resolveClick(click);
2034
+ if (result) {
2035
+ return result;
2036
+ }
2037
+ }
2038
+ }
1875
2039
  const badgeResult = this.badges.resolveClick(click);
1876
2040
  if (badgeResult) {
1877
2041
  return badgeResult;
@@ -1889,8 +2053,8 @@ class StepComponent {
1889
2053
  }
1890
2054
  resolvePlaceholders(skipComponent, result) {
1891
2055
  if (skipComponent !== this) {
1892
- if (this.view.sequenceComponents) {
1893
- this.view.sequenceComponents.forEach(component => component.resolvePlaceholders(skipComponent, result));
2056
+ if (this.view.components) {
2057
+ this.view.components.forEach(component => component.resolvePlaceholders(skipComponent, result));
1894
2058
  }
1895
2059
  if (this.view.placeholders) {
1896
2060
  this.view.placeholders.forEach(ph => result.placeholders.push(ph));
@@ -1908,8 +2072,8 @@ class StepComponent {
1908
2072
  this.view.setIsDisabled(isDisabled);
1909
2073
  }
1910
2074
  updateBadges(result) {
1911
- if (this.view.sequenceComponents) {
1912
- this.view.sequenceComponents.forEach(component => component.updateBadges(result));
2075
+ if (this.view.components) {
2076
+ this.view.components.forEach(component => component.updateBadges(result));
1913
2077
  }
1914
2078
  this.badges.update(result);
1915
2079
  }
@@ -1936,6 +2100,18 @@ class StepExtensionResolver {
1936
2100
  }
1937
2101
  }
1938
2102
 
2103
+ class PlaceholderController {
2104
+ static create(configuration) {
2105
+ return new PlaceholderController(configuration);
2106
+ }
2107
+ constructor(configuration) {
2108
+ var _a, _b, _c, _d;
2109
+ this.configuration = configuration;
2110
+ this.canCreate = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate) !== null && _b !== void 0 ? _b : (() => true);
2111
+ this.canShow = (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.canShow) !== null && _d !== void 0 ? _d : (() => true);
2112
+ }
2113
+ }
2114
+
1939
2115
  class RectPlaceholderView {
1940
2116
  static create(parent, width, height, radius, iconSize, direction) {
1941
2117
  const g = Dom.svg('g', {
@@ -1974,8 +2150,8 @@ class RectPlaceholderView {
1974
2150
  }
1975
2151
 
1976
2152
  class RectPlaceholder {
1977
- static create(parent, size, direction, sequence, index, configuration) {
1978
- const view = RectPlaceholderView.create(parent, size.x, size.y, configuration.radius, configuration.iconSize, direction);
2153
+ static create(parent, size, direction, sequence, index, radius, iconSize) {
2154
+ const view = RectPlaceholderView.create(parent, size.x, size.y, radius, iconSize, direction);
1979
2155
  return new RectPlaceholder(view, sequence, index);
1980
2156
  }
1981
2157
  constructor(view, parentSequence, index) {
@@ -2083,13 +2259,13 @@ class LineGrid {
2083
2259
  }
2084
2260
  }
2085
2261
 
2086
- const defaultConfiguration$4 = {
2262
+ const defaultConfiguration$3 = {
2087
2263
  gridSizeX: 48,
2088
2264
  gridSizeY: 48
2089
2265
  };
2090
2266
  class LineGridExtension {
2091
2267
  static create(configuration) {
2092
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4);
2268
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2093
2269
  }
2094
2270
  constructor(configuration) {
2095
2271
  this.configuration = configuration;
@@ -2119,7 +2295,7 @@ class StartStopRootComponentDesignerExtension {
2119
2295
  }
2120
2296
  }
2121
2297
 
2122
- const defaultConfiguration$3 = {
2298
+ const defaultConfiguration$2 = {
2123
2299
  view: {
2124
2300
  paddingTop: 20,
2125
2301
  paddingX: 20,
@@ -2137,7 +2313,7 @@ const defaultConfiguration$3 = {
2137
2313
  };
2138
2314
  class ContainerStepExtension {
2139
2315
  static create(configuration) {
2140
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2316
+ return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2141
2317
  }
2142
2318
  constructor(configuration) {
2143
2319
  this.configuration = configuration;
@@ -2146,40 +2322,39 @@ class ContainerStepExtension {
2146
2322
  }
2147
2323
  }
2148
2324
 
2149
- const defaultConfiguration$2 = {
2150
- view: {
2151
- minBranchWidth: 88,
2152
- paddingX: 20,
2153
- paddingTop1: 0,
2154
- paddingTop2: 22,
2155
- connectionHeight: 20,
2156
- noBranchPaddingBottom: 24,
2157
- inputSize: 18,
2158
- inputIconSize: 14,
2159
- inputRadius: 4,
2160
- autoHideInputOnDrag: true,
2161
- branchNameLabel: {
2162
- height: 22,
2163
- paddingX: 10,
2164
- minWidth: 50,
2165
- radius: 10
2166
- },
2167
- nameLabel: {
2168
- height: 22,
2169
- paddingX: 10,
2170
- minWidth: 50,
2171
- radius: 10
2172
- }
2325
+ const defaultViewConfiguration$1 = {
2326
+ minBranchWidth: 88,
2327
+ paddingX: 20,
2328
+ paddingTop1: 0,
2329
+ paddingTop2: 22,
2330
+ connectionHeight: 20,
2331
+ noBranchPaddingBottom: 24,
2332
+ inputSize: 18,
2333
+ inputIconSize: 14,
2334
+ inputRadius: 4,
2335
+ autoHideInputOnDrag: true,
2336
+ branchNameLabel: {
2337
+ height: 22,
2338
+ paddingX: 10,
2339
+ minWidth: 50,
2340
+ radius: 10
2341
+ },
2342
+ nameLabel: {
2343
+ height: 22,
2344
+ paddingX: 10,
2345
+ minWidth: 50,
2346
+ radius: 10
2173
2347
  }
2174
2348
  };
2175
2349
  class SwitchStepExtension {
2176
2350
  static create(configuration) {
2177
- return new SwitchStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2351
+ return new SwitchStepExtension(configuration);
2178
2352
  }
2179
2353
  constructor(configuration) {
2354
+ var _a, _b, _c;
2180
2355
  this.configuration = configuration;
2181
2356
  this.componentType = 'switch';
2182
- this.createComponentView = createSwitchStepComponentViewFactory(this.configuration.view);
2357
+ this.createComponentView = createSwitchStepComponentViewFactory((_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) !== null && _b !== void 0 ? _b : defaultViewConfiguration$1, (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.branchNamesResolver);
2183
2358
  }
2184
2359
  }
2185
2360
 
@@ -2207,6 +2382,28 @@ class TaskStepExtension {
2207
2382
  }
2208
2383
  }
2209
2384
 
2385
+ const defaultViewConfiguration = {
2386
+ isRegionEnabled: true,
2387
+ paddingY: 10,
2388
+ connectionHeight: 20,
2389
+ emptyPaddingX: 20,
2390
+ emptyPaddingY: 20,
2391
+ emptyInputSize: 14,
2392
+ emptyOutputSize: 10,
2393
+ emptyIconSize: 24
2394
+ };
2395
+ class LaunchPadStepExtension {
2396
+ static create(configuration) {
2397
+ return new LaunchPadStepExtension(configuration);
2398
+ }
2399
+ constructor(configuration) {
2400
+ var _a, _b;
2401
+ this.configuration = configuration;
2402
+ this.componentType = 'launchPad';
2403
+ this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) !== null && _b !== void 0 ? _b : defaultViewConfiguration);
2404
+ }
2405
+ }
2406
+
2210
2407
  class StepsDesignerExtension {
2211
2408
  static create(configuration) {
2212
2409
  const steps = [];
@@ -2219,6 +2416,9 @@ class StepsDesignerExtension {
2219
2416
  if (configuration.task) {
2220
2417
  steps.push(TaskStepExtension.create(configuration.task));
2221
2418
  }
2419
+ if (configuration.launchPad) {
2420
+ steps.push(LaunchPadStepExtension.create(configuration.launchPad));
2421
+ }
2222
2422
  return new StepsDesignerExtension(steps);
2223
2423
  }
2224
2424
  constructor(steps) {
@@ -2266,6 +2466,17 @@ class StepComponentViewContextFactory {
2266
2466
  i18n: componentContext.i18n,
2267
2467
  getStepIconUrl: () => componentContext.iconProvider.getIconUrl(stepContext.step),
2268
2468
  getStepName: () => componentContext.i18n(`step.${stepContext.step.type}.name`, stepContext.step.name),
2469
+ createStepComponent: (parentElement, parentSequence, step, position) => {
2470
+ return componentContext.stepComponentFactory.create(parentElement, {
2471
+ parentSequence,
2472
+ step,
2473
+ depth: stepContext.depth + 1,
2474
+ position,
2475
+ isInputConnected: stepContext.isInputConnected,
2476
+ isOutputConnected: stepContext.isOutputConnected,
2477
+ isPreview: stepContext.isPreview
2478
+ }, componentContext);
2479
+ },
2269
2480
  createSequenceComponent: (parentElement, sequence) => {
2270
2481
  const sequenceContext = {
2271
2482
  sequence,
@@ -2279,6 +2490,8 @@ class StepComponentViewContextFactory {
2279
2490
  createRegionComponentView(parentElement, componentClassName, contentFactory) {
2280
2491
  return componentContext.services.regionComponentView.create(parentElement, componentClassName, stepContext, this, contentFactory);
2281
2492
  },
2493
+ getPlaceholderGapSize: orientation => componentContext.services.placeholder.getGapSize(orientation),
2494
+ createPlaceholderForGap: componentContext.services.placeholder.createForGap.bind(componentContext.services.placeholder),
2282
2495
  createPlaceholderForArea: componentContext.services.placeholder.createForArea.bind(componentContext.services.placeholder),
2283
2496
  getPreference: (key) => componentContext.preferenceStorage.getItem(preferenceKeyPrefix + key),
2284
2497
  setPreference: (key, value) => componentContext.preferenceStorage.setItem(preferenceKeyPrefix + key, value)
@@ -2300,7 +2513,7 @@ class StepComponentFactory {
2300
2513
  }
2301
2514
 
2302
2515
  class ComponentContext {
2303
- static create(configuration, state, stepExtensionResolver, definitionWalker, preferenceStorage, placeholderController, i18n, services) {
2516
+ static create(configuration, state, stepExtensionResolver, placeholderController, definitionWalker, preferenceStorage, i18n, services) {
2304
2517
  const validator = new DefinitionValidator(configuration.validator, state);
2305
2518
  const iconProvider = new IconProvider(configuration.steps);
2306
2519
  const stepComponentFactory = new StepComponentFactory(stepExtensionResolver);
@@ -2633,14 +2846,15 @@ class SelectedStepIdDefinitionModifierDependency {
2633
2846
  }
2634
2847
 
2635
2848
  class StateModifier {
2636
- static create(definitionWalker, state, configuration) {
2849
+ static create(definitionWalker, uidGenerator, state, configuration) {
2637
2850
  const dependencies = [];
2638
2851
  dependencies.push(new SelectedStepIdDefinitionModifierDependency(state, definitionWalker));
2639
2852
  dependencies.push(new FolderPathDefinitionModifierDependency(state, definitionWalker));
2640
- return new StateModifier(definitionWalker, state, configuration, dependencies);
2853
+ return new StateModifier(definitionWalker, uidGenerator, state, configuration, dependencies);
2641
2854
  }
2642
- constructor(definitionWalker, state, configuration, dependencies) {
2855
+ constructor(definitionWalker, uidGenerator, state, configuration, dependencies) {
2643
2856
  this.definitionWalker = definitionWalker;
2857
+ this.uidGenerator = uidGenerator;
2644
2858
  this.state = state;
2645
2859
  this.configuration = configuration;
2646
2860
  this.dependencies = dependencies;
@@ -2649,15 +2863,17 @@ class StateModifier {
2649
2863
  this.dependencies.push(dependency);
2650
2864
  }
2651
2865
  isSelectable(step, parentSequence) {
2652
- return this.configuration.steps.isSelectable ? this.configuration.steps.isSelectable(step, parentSequence) : true;
2866
+ return this.configuration.isSelectable ? this.configuration.isSelectable(step, parentSequence) : true;
2653
2867
  }
2654
2868
  trySelectStep(step, parentSequence) {
2655
2869
  if (this.isSelectable(step, parentSequence)) {
2656
2870
  this.state.setSelectedStepId(step.id);
2871
+ return true;
2657
2872
  }
2873
+ return false;
2658
2874
  }
2659
2875
  trySelectStepById(stepId) {
2660
- if (this.configuration.steps.isSelectable) {
2876
+ if (this.configuration.isSelectable) {
2661
2877
  const result = this.definitionWalker.getParentSequence(this.state.definition, stepId);
2662
2878
  this.trySelectStep(result.step, result.parentSequence);
2663
2879
  }
@@ -2666,16 +2882,16 @@ class StateModifier {
2666
2882
  }
2667
2883
  }
2668
2884
  isDeletable(stepId) {
2669
- if (this.configuration.steps.isDeletable) {
2885
+ if (this.configuration.isDeletable) {
2670
2886
  const result = this.definitionWalker.getParentSequence(this.state.definition, stepId);
2671
- return this.configuration.steps.isDeletable(result.step, result.parentSequence);
2887
+ return this.configuration.isDeletable(result.step, result.parentSequence);
2672
2888
  }
2673
2889
  return true;
2674
2890
  }
2675
2891
  tryDelete(stepId) {
2676
2892
  const result = this.definitionWalker.getParentSequence(this.state.definition, stepId);
2677
- const canDeleteStep = this.configuration.steps.canDeleteStep
2678
- ? this.configuration.steps.canDeleteStep(result.step, result.parentSequence)
2893
+ const canDeleteStep = this.configuration.canDeleteStep
2894
+ ? this.configuration.canDeleteStep(result.step, result.parentSequence)
2679
2895
  : true;
2680
2896
  if (!canDeleteStep) {
2681
2897
  return false;
@@ -2686,46 +2902,43 @@ class StateModifier {
2686
2902
  return true;
2687
2903
  }
2688
2904
  tryInsert(step, targetSequence, targetIndex) {
2689
- const canInsertStep = this.configuration.steps.canInsertStep
2690
- ? this.configuration.steps.canInsertStep(step, targetSequence, targetIndex)
2691
- : true;
2905
+ const canInsertStep = this.configuration.canInsertStep ? this.configuration.canInsertStep(step, targetSequence, targetIndex) : true;
2692
2906
  if (!canInsertStep) {
2693
2907
  return false;
2694
2908
  }
2695
2909
  SequenceModifier.insertStep(step, targetSequence, targetIndex);
2696
2910
  this.state.notifyDefinitionChanged(exports.DefinitionChangeType.stepInserted, step.id);
2697
- if (!this.configuration.steps.isAutoSelectDisabled) {
2911
+ if (!this.configuration.isAutoSelectDisabled) {
2698
2912
  this.trySelectStepById(step.id);
2699
2913
  }
2700
2914
  return true;
2701
2915
  }
2702
2916
  isDraggable(step, parentSequence) {
2703
- return this.configuration.steps.isDraggable ? this.configuration.steps.isDraggable(step, parentSequence) : true;
2917
+ return this.configuration.isDraggable ? this.configuration.isDraggable(step, parentSequence) : true;
2704
2918
  }
2705
2919
  tryMove(sourceSequence, step, targetSequence, targetIndex) {
2706
2920
  const apply = SequenceModifier.tryMoveStep(sourceSequence, step, targetSequence, targetIndex);
2707
2921
  if (!apply) {
2708
2922
  return false;
2709
2923
  }
2710
- const canMoveStep = this.configuration.steps.canMoveStep
2711
- ? this.configuration.steps.canMoveStep(sourceSequence, step, targetSequence, targetIndex)
2924
+ const canMoveStep = this.configuration.canMoveStep
2925
+ ? this.configuration.canMoveStep(sourceSequence, step, targetSequence, targetIndex)
2712
2926
  : true;
2713
2927
  if (!canMoveStep) {
2714
2928
  return false;
2715
2929
  }
2716
2930
  apply();
2717
2931
  this.state.notifyDefinitionChanged(exports.DefinitionChangeType.stepMoved, step.id);
2718
- if (!this.configuration.steps.isAutoSelectDisabled) {
2932
+ if (!this.configuration.isAutoSelectDisabled) {
2719
2933
  this.trySelectStep(step, targetSequence);
2720
2934
  }
2721
2935
  return true;
2722
2936
  }
2723
2937
  isDuplicable(step, parentSequence) {
2724
- return this.configuration.steps.isDuplicable ? this.configuration.steps.isDuplicable(step, parentSequence) : false;
2938
+ return this.configuration.isDuplicable ? this.configuration.isDuplicable(step, parentSequence) : false;
2725
2939
  }
2726
2940
  tryDuplicate(step, parentSequence) {
2727
- const uidGenerator = this.configuration.uidGenerator ? this.configuration.uidGenerator : Uid.next;
2728
- const duplicator = new StepDuplicator(uidGenerator, this.definitionWalker);
2941
+ const duplicator = new StepDuplicator(this.uidGenerator, this.definitionWalker);
2729
2942
  const index = parentSequence.indexOf(step);
2730
2943
  const newStep = duplicator.duplicate(step);
2731
2944
  return this.tryInsert(newStep, parentSequence, index + 1);
@@ -2971,7 +3184,7 @@ class MemoryPreferenceStorage {
2971
3184
 
2972
3185
  class DesignerContext {
2973
3186
  static create(placeholder, startDefinition, configuration, services) {
2974
- var _a, _b, _c, _d, _e;
3187
+ var _a, _b, _c, _d, _e, _f;
2975
3188
  const definition = ObjectCloner.deepClone(startDefinition);
2976
3189
  const layoutController = new LayoutController(placeholder);
2977
3190
  const isReadonly = Boolean(configuration.isReadonly);
@@ -2980,22 +3193,23 @@ class DesignerContext {
2980
3193
  const theme = configuration.theme || 'light';
2981
3194
  const state = new DesignerState(definition, isReadonly, isToolboxCollapsed, isEditorCollapsed);
2982
3195
  const workspaceController = new WorkspaceControllerWrapper();
2983
- const placeholderController = services.placeholderController.create();
2984
3196
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
2985
3197
  const stepExtensionResolver = StepExtensionResolver.create(services);
3198
+ const placeholderController = PlaceholderController.create(configuration.placeholder);
2986
3199
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new sequentialWorkflowModel.DefinitionWalker();
2987
3200
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
2988
- const stateModifier = StateModifier.create(definitionWalker, state, configuration);
3201
+ const uidGenerator = (_e = configuration.uidGenerator) !== null && _e !== void 0 ? _e : Uid.next;
3202
+ const stateModifier = StateModifier.create(definitionWalker, uidGenerator, state, configuration.steps);
2989
3203
  const customActionController = new CustomActionController(configuration, state, stateModifier);
2990
3204
  let historyController = undefined;
2991
3205
  if (configuration.undoStackSize) {
2992
3206
  historyController = HistoryController.create(configuration.undoStack, state, stateModifier, configuration);
2993
3207
  }
2994
- const preferenceStorage = (_e = configuration.preferenceStorage) !== null && _e !== void 0 ? _e : new MemoryPreferenceStorage();
2995
- const componentContext = ComponentContext.create(configuration, state, stepExtensionResolver, definitionWalker, preferenceStorage, placeholderController, i18n, services);
2996
- return new DesignerContext(theme, state, configuration, services, componentContext, definitionWalker, i18n, stateModifier, layoutController, workspaceController, placeholderController, behaviorController, customActionController, historyController);
3208
+ const preferenceStorage = (_f = configuration.preferenceStorage) !== null && _f !== void 0 ? _f : new MemoryPreferenceStorage();
3209
+ const componentContext = ComponentContext.create(configuration, state, stepExtensionResolver, placeholderController, definitionWalker, preferenceStorage, i18n, services);
3210
+ return new DesignerContext(theme, state, configuration, services, componentContext, definitionWalker, i18n, uidGenerator, stateModifier, layoutController, workspaceController, placeholderController, behaviorController, customActionController, historyController);
2997
3211
  }
2998
- constructor(theme, state, configuration, services, componentContext, definitionWalker, i18n, stateModifier, layoutController, workspaceController, placeholderController, behaviorController, customActionController, historyController) {
3212
+ constructor(theme, state, configuration, services, componentContext, definitionWalker, i18n, uidGenerator, stateModifier, layoutController, workspaceController, placeholderController, behaviorController, customActionController, historyController) {
2999
3213
  this.theme = theme;
3000
3214
  this.state = state;
3001
3215
  this.configuration = configuration;
@@ -3003,6 +3217,7 @@ class DesignerContext {
3003
3217
  this.componentContext = componentContext;
3004
3218
  this.definitionWalker = definitionWalker;
3005
3219
  this.i18n = i18n;
3220
+ this.uidGenerator = uidGenerator;
3006
3221
  this.stateModifier = stateModifier;
3007
3222
  this.layoutController = layoutController;
3008
3223
  this.workspaceController = workspaceController;
@@ -3233,7 +3448,10 @@ class SelectStepBehavior {
3233
3448
  if (interrupt) {
3234
3449
  return;
3235
3450
  }
3236
- this.stateModifier.trySelectStep(this.pressedStepComponent.step, this.pressedStepComponent.parentSequence);
3451
+ if (!this.stateModifier.trySelectStep(this.pressedStepComponent.step, this.pressedStepComponent.parentSequence)) {
3452
+ // If we cannot select the step, we clear the selection.
3453
+ this.state.setSelectedStepId(null);
3454
+ }
3237
3455
  return new SelectStepBehaviorEndToken(this.pressedStepComponent.step.id, Date.now());
3238
3456
  }
3239
3457
  }
@@ -4519,14 +4737,6 @@ class ToolboxExtension {
4519
4737
  }
4520
4738
  }
4521
4739
 
4522
- class DefaultPlaceholderControllerExtension {
4523
- create() {
4524
- return {
4525
- canCreate: () => true
4526
- };
4527
- }
4528
- }
4529
-
4530
4740
  const defaultConfiguration = {
4531
4741
  gapWidth: 88,
4532
4742
  gapHeight: 24,
@@ -4539,13 +4749,18 @@ class RectPlaceholderExtension {
4539
4749
  }
4540
4750
  constructor(configuration) {
4541
4751
  this.configuration = configuration;
4542
- this.gapSize = new Vector(this.configuration.gapWidth, this.configuration.gapHeight);
4752
+ this.alongGapSize = new Vector(defaultConfiguration.gapWidth, defaultConfiguration.gapHeight);
4753
+ this.perpendicularGapSize = new Vector(defaultConfiguration.gapHeight, defaultConfiguration.gapWidth);
4543
4754
  }
4544
- createForGap(parent, parentSequence, index) {
4545
- return RectPlaceholder.create(parent, this.gapSize, exports.PlaceholderDirection.none, parentSequence, index, this.configuration);
4755
+ getGapSize(orientation) {
4756
+ return orientation === exports.PlaceholderGapOrientation.perpendicular ? this.perpendicularGapSize : this.alongGapSize;
4757
+ }
4758
+ createForGap(parent, parentSequence, index, orientation) {
4759
+ const gapSize = this.getGapSize(orientation);
4760
+ return RectPlaceholder.create(parent, gapSize, exports.PlaceholderDirection.gap, parentSequence, index, this.configuration.radius, this.configuration.iconSize);
4546
4761
  }
4547
4762
  createForArea(parent, size, direction, parentSequence, index) {
4548
- return RectPlaceholder.create(parent, size, direction, parentSequence, index, this.configuration);
4763
+ return RectPlaceholder.create(parent, size, direction, parentSequence, index, this.configuration.radius, this.configuration.iconSize);
4549
4764
  }
4550
4765
  }
4551
4766
 
@@ -4614,9 +4829,6 @@ function merge(services, extensions) {
4614
4829
  if (ext.wheelController) {
4615
4830
  services.wheelController = ext.wheelController;
4616
4831
  }
4617
- if (ext.placeholderController) {
4618
- services.placeholderController = ext.placeholderController;
4619
- }
4620
4832
  if (ext.placeholder) {
4621
4833
  services.placeholder = ext.placeholder;
4622
4834
  }
@@ -4650,6 +4862,7 @@ function setDefaults(services, configuration) {
4650
4862
  services.steps.push(ContainerStepExtension.create());
4651
4863
  services.steps.push(SwitchStepExtension.create());
4652
4864
  services.steps.push(TaskStepExtension.create());
4865
+ services.steps.push(LaunchPadStepExtension.create());
4653
4866
  if (!services.stepComponentViewWrapper) {
4654
4867
  services.stepComponentViewWrapper = new DefaultStepComponentViewWrapperExtension();
4655
4868
  }
@@ -4683,9 +4896,6 @@ function setDefaults(services, configuration) {
4683
4896
  if (!services.wheelController) {
4684
4897
  services.wheelController = new ClassicWheelControllerExtension();
4685
4898
  }
4686
- if (!services.placeholderController) {
4687
- services.placeholderController = new DefaultPlaceholderControllerExtension();
4688
- }
4689
4899
  if (!services.placeholder) {
4690
4900
  services.placeholder = RectPlaceholderExtension.create();
4691
4901
  }
@@ -4984,6 +5194,7 @@ exports.LineGridDesignerExtension = LineGridDesignerExtension;
4984
5194
  exports.ObjectCloner = ObjectCloner;
4985
5195
  exports.OutputView = OutputView;
4986
5196
  exports.PathBarApi = PathBarApi;
5197
+ exports.PlaceholderController = PlaceholderController;
4987
5198
  exports.RectPlaceholder = RectPlaceholder;
4988
5199
  exports.RectPlaceholderView = RectPlaceholderView;
4989
5200
  exports.SelectStepBehaviorEndToken = SelectStepBehaviorEndToken;
@@ -5002,6 +5213,7 @@ exports.Vector = Vector;
5002
5213
  exports.ViewportApi = ViewportApi;
5003
5214
  exports.WorkspaceApi = WorkspaceApi;
5004
5215
  exports.createContainerStepComponentViewFactory = createContainerStepComponentViewFactory;
5216
+ exports.createLaunchPadStepComponentViewFactory = createLaunchPadStepComponentViewFactory;
5005
5217
  exports.createSwitchStepComponentViewFactory = createSwitchStepComponentViewFactory;
5006
5218
  exports.createTaskStepComponentViewFactory = createTaskStepComponentViewFactory;
5007
5219
  exports.getAbsolutePosition = getAbsolutePosition;