sequential-workflow-designer 0.30.0 → 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/README.md CHANGED
@@ -88,6 +88,7 @@ If you use [css-loader](https://webpack.js.org/loaders/css-loader/) or similar,
88
88
  ```ts
89
89
  import 'sequential-workflow-designer/css/designer.css';
90
90
  import 'sequential-workflow-designer/css/designer-light.css';
91
+ import 'sequential-workflow-designer/css/designer-soft.css';
91
92
  import 'sequential-workflow-designer/css/designer-dark.css';
92
93
  ```
93
94
 
@@ -105,10 +106,10 @@ Add the below code to your head section in HTML document.
105
106
  ```html
106
107
  <head>
107
108
  ...
108
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.0/css/designer.css" rel="stylesheet">
109
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.0/css/designer-light.css" rel="stylesheet">
110
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.0/css/designer-dark.css" rel="stylesheet">
111
- <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.0/dist/index.umd.js"></script>
109
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.1/css/designer.css" rel="stylesheet">
110
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.1/css/designer-light.css" rel="stylesheet">
111
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.1/css/designer-dark.css" rel="stylesheet">
112
+ <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.1/dist/index.umd.js"></script>
112
113
  ```
113
114
 
114
115
  Call the designer by:
package/dist/index.umd.js CHANGED
@@ -1197,7 +1197,7 @@
1197
1197
  }
1198
1198
  }
1199
1199
 
1200
- const defaultConfiguration$6 = {
1200
+ const defaultConfiguration$5 = {
1201
1201
  view: {
1202
1202
  size: 22,
1203
1203
  iconSize: 12
@@ -1205,7 +1205,7 @@
1205
1205
  };
1206
1206
  class ValidationErrorBadgeExtension {
1207
1207
  static create(configuration) {
1208
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$6);
1208
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1209
1209
  }
1210
1210
  constructor(configuration) {
1211
1211
  this.configuration = configuration;
@@ -1627,7 +1627,7 @@
1627
1627
  }
1628
1628
  }
1629
1629
 
1630
- const defaultViewConfiguration$1 = {
1630
+ const defaultViewConfiguration$2 = {
1631
1631
  size: 30,
1632
1632
  defaultIconSize: 22,
1633
1633
  folderIconSize: 18,
@@ -1646,7 +1646,7 @@
1646
1646
  }
1647
1647
  create(parentElement, sequence, parentPlaceIndicator, context) {
1648
1648
  var _a;
1649
- const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$1), this.configuration.view) : defaultViewConfiguration$1;
1649
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$2), this.configuration.view) : defaultViewConfiguration$2;
1650
1650
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1651
1651
  }
1652
1652
  }
@@ -1881,13 +1881,13 @@
1881
1881
  }
1882
1882
  };
1883
1883
  }
1884
- const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
1884
+ const createSwitchStepComponentViewFactory = (cfg, branchNameResolver) => (parent, stepContext, viewContext) => {
1885
1885
  return viewContext.createRegionComponentView(parent, COMPONENT_CLASS_NAME$1, (g, regionViewBuilder) => {
1886
1886
  const step = stepContext.step;
1887
1887
  const paddingTop = cfg.paddingTop1 + cfg.paddingTop2;
1888
1888
  const name = viewContext.getStepName();
1889
1889
  const nameLabelView = LabelView.create(g, paddingTop, cfg.nameLabel, name, 'primary');
1890
- const branchNames = Object.keys(step.branches);
1890
+ const branchNames = branchNameResolver ? branchNameResolver(step) : Object.keys(step.branches);
1891
1891
  if (branchNames.length === 0) {
1892
1892
  const width = Math.max(nameLabelView.width, cfg.minBranchWidth) + cfg.paddingX * 2;
1893
1893
  const height = nameLabelView.height + paddingTop + cfg.noBranchPaddingBottom;
@@ -2120,14 +2120,14 @@
2120
2120
  }
2121
2121
  }
2122
2122
 
2123
- const defaultConfiguration$5 = {
2123
+ const defaultConfiguration$4 = {
2124
2124
  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],
2125
2125
  smoothDeltaYLimit: 16,
2126
2126
  padding: 10
2127
2127
  };
2128
2128
  class DefaultViewportController {
2129
2129
  static create(api, configuration) {
2130
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5;
2130
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
2131
2131
  const nqn = new NextQuantifiedNumber(config.scales);
2132
2132
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
2133
2133
  }
@@ -2444,13 +2444,13 @@
2444
2444
  }
2445
2445
  }
2446
2446
 
2447
- const defaultConfiguration$4 = {
2447
+ const defaultConfiguration$3 = {
2448
2448
  gridSizeX: 48,
2449
2449
  gridSizeY: 48
2450
2450
  };
2451
2451
  class LineGridExtension {
2452
2452
  static create(configuration) {
2453
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4);
2453
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2454
2454
  }
2455
2455
  constructor(configuration) {
2456
2456
  this.configuration = configuration;
@@ -2480,7 +2480,7 @@
2480
2480
  }
2481
2481
  }
2482
2482
 
2483
- const defaultConfiguration$3 = {
2483
+ const defaultConfiguration$2 = {
2484
2484
  view: {
2485
2485
  paddingTop: 20,
2486
2486
  paddingX: 20,
@@ -2498,7 +2498,7 @@
2498
2498
  };
2499
2499
  class ContainerStepExtension {
2500
2500
  static create(configuration) {
2501
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2501
+ return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2502
2502
  }
2503
2503
  constructor(configuration) {
2504
2504
  this.configuration = configuration;
@@ -2507,40 +2507,39 @@
2507
2507
  }
2508
2508
  }
2509
2509
 
2510
- const defaultConfiguration$2 = {
2511
- view: {
2512
- minBranchWidth: 88,
2513
- paddingX: 20,
2514
- paddingTop1: 0,
2515
- paddingTop2: 22,
2516
- connectionHeight: 20,
2517
- noBranchPaddingBottom: 24,
2518
- inputSize: 18,
2519
- inputIconSize: 14,
2520
- inputRadius: 4,
2521
- autoHideInputOnDrag: true,
2522
- branchNameLabel: {
2523
- height: 22,
2524
- paddingX: 10,
2525
- minWidth: 50,
2526
- radius: 10
2527
- },
2528
- nameLabel: {
2529
- height: 22,
2530
- paddingX: 10,
2531
- minWidth: 50,
2532
- radius: 10
2533
- }
2510
+ const defaultViewConfiguration$1 = {
2511
+ minBranchWidth: 88,
2512
+ paddingX: 20,
2513
+ paddingTop1: 0,
2514
+ paddingTop2: 22,
2515
+ connectionHeight: 20,
2516
+ noBranchPaddingBottom: 24,
2517
+ inputSize: 18,
2518
+ inputIconSize: 14,
2519
+ inputRadius: 4,
2520
+ autoHideInputOnDrag: true,
2521
+ branchNameLabel: {
2522
+ height: 22,
2523
+ paddingX: 10,
2524
+ minWidth: 50,
2525
+ radius: 10
2526
+ },
2527
+ nameLabel: {
2528
+ height: 22,
2529
+ paddingX: 10,
2530
+ minWidth: 50,
2531
+ radius: 10
2534
2532
  }
2535
2533
  };
2536
2534
  class SwitchStepExtension {
2537
2535
  static create(configuration) {
2538
- return new SwitchStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2536
+ return new SwitchStepExtension(configuration);
2539
2537
  }
2540
2538
  constructor(configuration) {
2539
+ var _a, _b, _c;
2541
2540
  this.configuration = configuration;
2542
2541
  this.componentType = 'switch';
2543
- this.createComponentView = createSwitchStepComponentViewFactory(this.configuration.view);
2542
+ 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);
2544
2543
  }
2545
2544
  }
2546
2545
 
package/lib/cjs/index.cjs CHANGED
@@ -1012,7 +1012,7 @@ class ValidationErrorBadge {
1012
1012
  }
1013
1013
  }
1014
1014
 
1015
- const defaultConfiguration$6 = {
1015
+ const defaultConfiguration$5 = {
1016
1016
  view: {
1017
1017
  size: 22,
1018
1018
  iconSize: 12
@@ -1020,7 +1020,7 @@ const defaultConfiguration$6 = {
1020
1020
  };
1021
1021
  class ValidationErrorBadgeExtension {
1022
1022
  static create(configuration) {
1023
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$6);
1023
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1024
1024
  }
1025
1025
  constructor(configuration) {
1026
1026
  this.configuration = configuration;
@@ -1442,7 +1442,7 @@ class StartStopRootComponent {
1442
1442
  }
1443
1443
  }
1444
1444
 
1445
- const defaultViewConfiguration$1 = {
1445
+ const defaultViewConfiguration$2 = {
1446
1446
  size: 30,
1447
1447
  defaultIconSize: 22,
1448
1448
  folderIconSize: 18,
@@ -1461,7 +1461,7 @@ class StartStopRootComponentExtension {
1461
1461
  }
1462
1462
  create(parentElement, sequence, parentPlaceIndicator, context) {
1463
1463
  var _a;
1464
- const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$1), this.configuration.view) : defaultViewConfiguration$1;
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
1465
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1466
1466
  }
1467
1467
  }
@@ -1696,13 +1696,13 @@ function createView(g, width, height, joinX, viewContext, sequenceComponents, re
1696
1696
  }
1697
1697
  };
1698
1698
  }
1699
- const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
1699
+ const createSwitchStepComponentViewFactory = (cfg, branchNameResolver) => (parent, stepContext, viewContext) => {
1700
1700
  return viewContext.createRegionComponentView(parent, COMPONENT_CLASS_NAME$1, (g, regionViewBuilder) => {
1701
1701
  const step = stepContext.step;
1702
1702
  const paddingTop = cfg.paddingTop1 + cfg.paddingTop2;
1703
1703
  const name = viewContext.getStepName();
1704
1704
  const nameLabelView = LabelView.create(g, paddingTop, cfg.nameLabel, name, 'primary');
1705
- const branchNames = Object.keys(step.branches);
1705
+ const branchNames = branchNameResolver ? branchNameResolver(step) : Object.keys(step.branches);
1706
1706
  if (branchNames.length === 0) {
1707
1707
  const width = Math.max(nameLabelView.width, cfg.minBranchWidth) + cfg.paddingX * 2;
1708
1708
  const height = nameLabelView.height + paddingTop + cfg.noBranchPaddingBottom;
@@ -1935,14 +1935,14 @@ class NextQuantifiedNumber {
1935
1935
  }
1936
1936
  }
1937
1937
 
1938
- const defaultConfiguration$5 = {
1938
+ const defaultConfiguration$4 = {
1939
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],
1940
1940
  smoothDeltaYLimit: 16,
1941
1941
  padding: 10
1942
1942
  };
1943
1943
  class DefaultViewportController {
1944
1944
  static create(api, configuration) {
1945
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5;
1945
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
1946
1946
  const nqn = new NextQuantifiedNumber(config.scales);
1947
1947
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
1948
1948
  }
@@ -2259,13 +2259,13 @@ class LineGrid {
2259
2259
  }
2260
2260
  }
2261
2261
 
2262
- const defaultConfiguration$4 = {
2262
+ const defaultConfiguration$3 = {
2263
2263
  gridSizeX: 48,
2264
2264
  gridSizeY: 48
2265
2265
  };
2266
2266
  class LineGridExtension {
2267
2267
  static create(configuration) {
2268
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4);
2268
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2269
2269
  }
2270
2270
  constructor(configuration) {
2271
2271
  this.configuration = configuration;
@@ -2295,7 +2295,7 @@ class StartStopRootComponentDesignerExtension {
2295
2295
  }
2296
2296
  }
2297
2297
 
2298
- const defaultConfiguration$3 = {
2298
+ const defaultConfiguration$2 = {
2299
2299
  view: {
2300
2300
  paddingTop: 20,
2301
2301
  paddingX: 20,
@@ -2313,7 +2313,7 @@ const defaultConfiguration$3 = {
2313
2313
  };
2314
2314
  class ContainerStepExtension {
2315
2315
  static create(configuration) {
2316
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2316
+ return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2317
2317
  }
2318
2318
  constructor(configuration) {
2319
2319
  this.configuration = configuration;
@@ -2322,40 +2322,39 @@ class ContainerStepExtension {
2322
2322
  }
2323
2323
  }
2324
2324
 
2325
- const defaultConfiguration$2 = {
2326
- view: {
2327
- minBranchWidth: 88,
2328
- paddingX: 20,
2329
- paddingTop1: 0,
2330
- paddingTop2: 22,
2331
- connectionHeight: 20,
2332
- noBranchPaddingBottom: 24,
2333
- inputSize: 18,
2334
- inputIconSize: 14,
2335
- inputRadius: 4,
2336
- autoHideInputOnDrag: true,
2337
- branchNameLabel: {
2338
- height: 22,
2339
- paddingX: 10,
2340
- minWidth: 50,
2341
- radius: 10
2342
- },
2343
- nameLabel: {
2344
- height: 22,
2345
- paddingX: 10,
2346
- minWidth: 50,
2347
- radius: 10
2348
- }
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
2349
2347
  }
2350
2348
  };
2351
2349
  class SwitchStepExtension {
2352
2350
  static create(configuration) {
2353
- return new SwitchStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2351
+ return new SwitchStepExtension(configuration);
2354
2352
  }
2355
2353
  constructor(configuration) {
2354
+ var _a, _b, _c;
2356
2355
  this.configuration = configuration;
2357
2356
  this.componentType = 'switch';
2358
- 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);
2359
2358
  }
2360
2359
  }
2361
2360
 
package/lib/esm/index.js CHANGED
@@ -1011,7 +1011,7 @@ class ValidationErrorBadge {
1011
1011
  }
1012
1012
  }
1013
1013
 
1014
- const defaultConfiguration$6 = {
1014
+ const defaultConfiguration$5 = {
1015
1015
  view: {
1016
1016
  size: 22,
1017
1017
  iconSize: 12
@@ -1019,7 +1019,7 @@ const defaultConfiguration$6 = {
1019
1019
  };
1020
1020
  class ValidationErrorBadgeExtension {
1021
1021
  static create(configuration) {
1022
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$6);
1022
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1023
1023
  }
1024
1024
  constructor(configuration) {
1025
1025
  this.configuration = configuration;
@@ -1441,7 +1441,7 @@ class StartStopRootComponent {
1441
1441
  }
1442
1442
  }
1443
1443
 
1444
- const defaultViewConfiguration$1 = {
1444
+ const defaultViewConfiguration$2 = {
1445
1445
  size: 30,
1446
1446
  defaultIconSize: 22,
1447
1447
  folderIconSize: 18,
@@ -1460,7 +1460,7 @@ class StartStopRootComponentExtension {
1460
1460
  }
1461
1461
  create(parentElement, sequence, parentPlaceIndicator, context) {
1462
1462
  var _a;
1463
- const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$1), this.configuration.view) : defaultViewConfiguration$1;
1463
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$2), this.configuration.view) : defaultViewConfiguration$2;
1464
1464
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1465
1465
  }
1466
1466
  }
@@ -1695,13 +1695,13 @@ function createView(g, width, height, joinX, viewContext, sequenceComponents, re
1695
1695
  }
1696
1696
  };
1697
1697
  }
1698
- const createSwitchStepComponentViewFactory = (cfg) => (parent, stepContext, viewContext) => {
1698
+ const createSwitchStepComponentViewFactory = (cfg, branchNameResolver) => (parent, stepContext, viewContext) => {
1699
1699
  return viewContext.createRegionComponentView(parent, COMPONENT_CLASS_NAME$1, (g, regionViewBuilder) => {
1700
1700
  const step = stepContext.step;
1701
1701
  const paddingTop = cfg.paddingTop1 + cfg.paddingTop2;
1702
1702
  const name = viewContext.getStepName();
1703
1703
  const nameLabelView = LabelView.create(g, paddingTop, cfg.nameLabel, name, 'primary');
1704
- const branchNames = Object.keys(step.branches);
1704
+ const branchNames = branchNameResolver ? branchNameResolver(step) : Object.keys(step.branches);
1705
1705
  if (branchNames.length === 0) {
1706
1706
  const width = Math.max(nameLabelView.width, cfg.minBranchWidth) + cfg.paddingX * 2;
1707
1707
  const height = nameLabelView.height + paddingTop + cfg.noBranchPaddingBottom;
@@ -1934,14 +1934,14 @@ class NextQuantifiedNumber {
1934
1934
  }
1935
1935
  }
1936
1936
 
1937
- const defaultConfiguration$5 = {
1937
+ const defaultConfiguration$4 = {
1938
1938
  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],
1939
1939
  smoothDeltaYLimit: 16,
1940
1940
  padding: 10
1941
1941
  };
1942
1942
  class DefaultViewportController {
1943
1943
  static create(api, configuration) {
1944
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5;
1944
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
1945
1945
  const nqn = new NextQuantifiedNumber(config.scales);
1946
1946
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
1947
1947
  }
@@ -2258,13 +2258,13 @@ class LineGrid {
2258
2258
  }
2259
2259
  }
2260
2260
 
2261
- const defaultConfiguration$4 = {
2261
+ const defaultConfiguration$3 = {
2262
2262
  gridSizeX: 48,
2263
2263
  gridSizeY: 48
2264
2264
  };
2265
2265
  class LineGridExtension {
2266
2266
  static create(configuration) {
2267
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4);
2267
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2268
2268
  }
2269
2269
  constructor(configuration) {
2270
2270
  this.configuration = configuration;
@@ -2294,7 +2294,7 @@ class StartStopRootComponentDesignerExtension {
2294
2294
  }
2295
2295
  }
2296
2296
 
2297
- const defaultConfiguration$3 = {
2297
+ const defaultConfiguration$2 = {
2298
2298
  view: {
2299
2299
  paddingTop: 20,
2300
2300
  paddingX: 20,
@@ -2312,7 +2312,7 @@ const defaultConfiguration$3 = {
2312
2312
  };
2313
2313
  class ContainerStepExtension {
2314
2314
  static create(configuration) {
2315
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2315
+ return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2316
2316
  }
2317
2317
  constructor(configuration) {
2318
2318
  this.configuration = configuration;
@@ -2321,40 +2321,39 @@ class ContainerStepExtension {
2321
2321
  }
2322
2322
  }
2323
2323
 
2324
- const defaultConfiguration$2 = {
2325
- view: {
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
2347
- }
2324
+ const defaultViewConfiguration$1 = {
2325
+ minBranchWidth: 88,
2326
+ paddingX: 20,
2327
+ paddingTop1: 0,
2328
+ paddingTop2: 22,
2329
+ connectionHeight: 20,
2330
+ noBranchPaddingBottom: 24,
2331
+ inputSize: 18,
2332
+ inputIconSize: 14,
2333
+ inputRadius: 4,
2334
+ autoHideInputOnDrag: true,
2335
+ branchNameLabel: {
2336
+ height: 22,
2337
+ paddingX: 10,
2338
+ minWidth: 50,
2339
+ radius: 10
2340
+ },
2341
+ nameLabel: {
2342
+ height: 22,
2343
+ paddingX: 10,
2344
+ minWidth: 50,
2345
+ radius: 10
2348
2346
  }
2349
2347
  };
2350
2348
  class SwitchStepExtension {
2351
2349
  static create(configuration) {
2352
- return new SwitchStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2350
+ return new SwitchStepExtension(configuration);
2353
2351
  }
2354
2352
  constructor(configuration) {
2353
+ var _a, _b, _c;
2355
2354
  this.configuration = configuration;
2356
2355
  this.componentType = 'switch';
2357
- this.createComponentView = createSwitchStepComponentViewFactory(this.configuration.view);
2356
+ 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);
2358
2357
  }
2359
2358
  }
2360
2359
 
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Definition, Step, Sequence, ComponentType, DefinitionWalker, StepWithParentSequence, StepOrName } from 'sequential-workflow-model';
1
+ import { Definition, Step, Sequence, ComponentType, DefinitionWalker, StepWithParentSequence, BranchedStep, StepOrName } from 'sequential-workflow-model';
2
2
  export * from 'sequential-workflow-model';
3
3
 
4
4
  declare class Icons {
@@ -705,12 +705,19 @@ interface SwitchStepComponentViewConfiguration {
705
705
  branchNameLabel: LabelViewConfiguration;
706
706
  }
707
707
 
708
- declare const createSwitchStepComponentViewFactory: (cfg: SwitchStepComponentViewConfiguration) => StepComponentViewFactory;
709
-
708
+ type BranchNamesResolver = (step: BranchedStep) => string[];
710
709
  interface SwitchStepExtensionConfiguration {
711
- view: SwitchStepComponentViewConfiguration;
710
+ view?: SwitchStepComponentViewConfiguration;
711
+ /**
712
+ * A function that takes a `BranchedStep` and returns an array of branch names.
713
+ * If not provided, the default is: `Object.keys(step.branches)`.
714
+ * You can use this to provide custom ordering or filtering of branch names.
715
+ */
716
+ branchNamesResolver?: BranchNamesResolver;
712
717
  }
713
718
 
719
+ declare const createSwitchStepComponentViewFactory: (cfg: SwitchStepComponentViewConfiguration, branchNameResolver: BranchNamesResolver | undefined) => StepComponentViewFactory;
720
+
714
721
  interface TaskStepComponentViewConfiguration {
715
722
  paddingLeft: number;
716
723
  paddingRight: number;
@@ -1416,4 +1423,4 @@ declare class Designer<TDefinition extends Definition = Definition> {
1416
1423
  }
1417
1424
 
1418
1425
  export { Badges, CenteredViewportCalculator, ClassicWheelControllerExtension, ClickCommandType, ComponentContext, ComponentDom, ControlBarApi, CustomActionController, DefaultRegionComponentViewExtension, DefaultRegionView, DefaultSequenceComponent, DefaultSequenceComponentView, DefaultViewportController, DefaultViewportControllerDesignerExtension, DefaultViewportControllerExtension, DefinitionChangeType, Designer, DesignerApi, DesignerContext, DesignerState, Dom, Editor, EditorApi, Icons, InputView, JoinView, KeyboardAction, LabelView, LineGridDesignerExtension, ObjectCloner, OutputView, PathBarApi, PlaceholderController, PlaceholderDirection, PlaceholderGapOrientation, RectPlaceholder, RectPlaceholderView, SelectStepBehaviorEndToken, ServicesResolver, SimpleEvent, StartStopRootComponentDesignerExtension, StartStopRootComponentExtension, StepComponent, StepExtensionResolver, StepsDesignerExtension, TYPE, ToolboxApi, Uid, ValidationErrorBadgeExtension, Vector, ViewportApi, WorkspaceApi, createContainerStepComponentViewFactory, createLaunchPadStepComponentViewFactory, createSwitchStepComponentViewFactory, createTaskStepComponentViewFactory, getAbsolutePosition, race };
1419
- export type { Attributes, Badge, BadgeExtension, BadgeView, BadgesDecorator, BadgesResult, BaseClickCommand, Behavior, BehaviorEndToken, ClickBehaviorWrapper, ClickBehaviorWrapperExtension, ClickCommand, ClickDetails, Component, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultViewportControllerConfiguration, DefaultViewportControllerExtensionConfiguration, DefinitionChangedEvent, DesignerConfiguration, DesignerExtension, DraggedComponent, DraggedComponentExtension, EditorsConfiguration, FoundPlaceholders, Grid, GridExtension, I18n, KeyboardConfiguration, LaunchPadStepComponentViewConfiguration, LaunchPadStepExtensionConfiguration, LineGridConfiguration, NextScale, OpenFolderClickCommand, Placeholder, PlaceholderConfiguration, PlaceholderExtension, PlaceholderView, PreferenceStorage, RectPlaceholderConfiguration, RegionComponentViewContentFactory, RegionComponentViewExtension, RegionView, RegionViewFactory, RerenderStepClickCommand, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, SimpleEventListener, StartStopRootComponentExtensionConfiguration, StartStopRootComponentViewConfiguration, StateModifierDependency, StepBadgesDecoratorExtension, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceRootSequence };
1426
+ export type { Attributes, Badge, BadgeExtension, BadgeView, BadgesDecorator, BadgesResult, BaseClickCommand, Behavior, BehaviorEndToken, BranchNamesResolver, ClickBehaviorWrapper, ClickBehaviorWrapperExtension, ClickCommand, ClickDetails, Component, ComponentView, ContainerStepComponentViewConfiguration, ContainerStepExtensionConfiguration, ContextMenuExtension, ContextMenuItem, ContextMenuItemsProvider, CustomAction, CustomActionHandler, CustomActionHandlerContext, Daemon, DaemonExtension, DefaultViewportControllerConfiguration, DefaultViewportControllerExtensionConfiguration, DefinitionChangedEvent, DesignerConfiguration, DesignerExtension, DraggedComponent, DraggedComponentExtension, EditorsConfiguration, FoundPlaceholders, Grid, GridExtension, I18n, KeyboardConfiguration, LaunchPadStepComponentViewConfiguration, LaunchPadStepExtensionConfiguration, LineGridConfiguration, NextScale, OpenFolderClickCommand, Placeholder, PlaceholderConfiguration, PlaceholderExtension, PlaceholderView, PreferenceStorage, RectPlaceholderConfiguration, RegionComponentViewContentFactory, RegionComponentViewExtension, RegionView, RegionViewFactory, RerenderStepClickCommand, RootComponentExtension, RootEditorContext, RootEditorProvider, RootValidator, SelectStepClickCommand, SelectedStepIdProvider, SequenceComponent, SequenceComponentExtension, SequenceContext, SequencePlaceIndicator, Services, SimpleEventListener, StartStopRootComponentExtensionConfiguration, StartStopRootComponentViewConfiguration, StateModifierDependency, StepBadgesDecoratorExtension, StepComponentView, StepComponentViewContext, StepComponentViewFactory, StepComponentViewWrapperExtension, StepContext, StepDefinition, StepDescriptionProvider, StepEditorContext, StepEditorProvider, StepExtension, StepIconUrlProvider, StepLabelProvider, StepValidator, StepsConfiguration, StepsDesignerExtensionConfiguration, SwitchStepComponentViewConfiguration, SwitchStepExtensionConfiguration, TaskStepComponentViewConfiguration, TaskStepExtensionConfiguration, ToolboxConfiguration, ToolboxGroupConfiguration, TriggerCustomActionClickCommand, UiComponent, UiComponentExtension, UidGenerator, UndoStack, UndoStackItem, ValidationErrorBadgeExtensionConfiguration, ValidationErrorBadgeViewConfiguration, ValidatorConfiguration, Viewport, ViewportController, ViewportControllerExtension, WheelController, WheelControllerExtension, WorkspaceRootSequence };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sequential-workflow-designer",
3
3
  "description": "Customizable no-code component for building flow-based programming applications.",
4
- "version": "0.30.0",
4
+ "version": "0.30.1",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "types": "./lib/index.d.ts",