sequential-workflow-designer 0.35.0 → 0.35.2

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
@@ -106,10 +106,10 @@ Add the below code to your head section in HTML document.
106
106
  ```html
107
107
  <head>
108
108
  ...
109
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.0/css/designer.css" rel="stylesheet">
110
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.0/css/designer-light.css" rel="stylesheet">
111
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.0/css/designer-dark.css" rel="stylesheet">
112
- <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.0/dist/index.umd.js"></script>
109
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.2/css/designer.css" rel="stylesheet">
110
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.2/css/designer-light.css" rel="stylesheet">
111
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.2/css/designer-dark.css" rel="stylesheet">
112
+ <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.2/dist/index.umd.js"></script>
113
113
  ```
114
114
 
115
115
  Call the designer by:
package/dist/index.umd.js CHANGED
@@ -435,7 +435,7 @@
435
435
  this.cache = undefined;
436
436
  };
437
437
  }
438
- find(vLt, vWidth, vHeight) {
438
+ find(vLt, vWidth, vHeight, vScale) {
439
439
  var _a;
440
440
  if (!this.cache) {
441
441
  const scroll = new Vector(window.scrollX, window.scrollY);
@@ -452,8 +452,8 @@
452
452
  });
453
453
  this.cache.sort((a, b) => a.diagSq - b.diagSq);
454
454
  }
455
- const vR = vLt.x + vWidth;
456
- const vB = vLt.y + vHeight;
455
+ const vR = vLt.x + vWidth * vScale;
456
+ const vB = vLt.y + vHeight * vScale;
457
457
  return (_a = this.cache.find(p => {
458
458
  return Math.max(vLt.x, p.lt.x) < Math.min(vR, p.br.x) && Math.max(vLt.y, p.lt.y) < Math.min(vB, p.br.y);
459
459
  })) === null || _a === void 0 ? void 0 : _a.placeholder;
@@ -514,7 +514,7 @@
514
514
  if (this.state) {
515
515
  const newPosition = this.state.startPosition.subtract(delta).subtract(this.state.offset);
516
516
  this.view.setPosition(newPosition);
517
- const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height);
517
+ const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height, this.view.component.scale);
518
518
  if (this.currentPlaceholder !== placeholder) {
519
519
  if (this.currentPlaceholder) {
520
520
  this.currentPlaceholder.setIsHover(false);
@@ -1198,7 +1198,7 @@
1198
1198
  }
1199
1199
  }
1200
1200
 
1201
- const defaultConfiguration$5 = {
1201
+ const defaultConfiguration$3 = {
1202
1202
  view: {
1203
1203
  size: 22,
1204
1204
  iconSize: 12
@@ -1206,7 +1206,7 @@
1206
1206
  };
1207
1207
  class ValidationErrorBadgeExtension {
1208
1208
  static create(configuration) {
1209
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1209
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
1210
1210
  }
1211
1211
  constructor(configuration) {
1212
1212
  this.configuration = configuration;
@@ -1627,7 +1627,7 @@
1627
1627
  }
1628
1628
  }
1629
1629
 
1630
- const defaultViewConfiguration$2 = {
1630
+ const defaultViewConfiguration$4 = {
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$2), this.configuration.view) : defaultViewConfiguration$2;
1649
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$4), this.configuration.view) : defaultViewConfiguration$4;
1650
1650
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1651
1651
  }
1652
1652
  }
@@ -2131,14 +2131,14 @@
2131
2131
  }
2132
2132
  }
2133
2133
 
2134
- const defaultConfiguration$4 = {
2134
+ const defaultConfiguration$2 = {
2135
2135
  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],
2136
2136
  smoothDeltaYLimit: 16,
2137
2137
  padding: 10
2138
2138
  };
2139
2139
  class DefaultViewportController {
2140
2140
  static create(api, configuration) {
2141
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
2141
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2;
2142
2142
  const nqn = new NextQuantifiedNumber(config.scales);
2143
2143
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
2144
2144
  }
@@ -2458,13 +2458,13 @@
2458
2458
  }
2459
2459
  }
2460
2460
 
2461
- const defaultConfiguration$3 = {
2461
+ const defaultConfiguration$1 = {
2462
2462
  gridSizeX: 48,
2463
2463
  gridSizeY: 48
2464
2464
  };
2465
2465
  class LineGridExtension {
2466
2466
  static create(configuration) {
2467
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2467
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2468
2468
  }
2469
2469
  constructor(configuration) {
2470
2470
  this.configuration = configuration;
@@ -2485,7 +2485,7 @@
2485
2485
  }
2486
2486
  }
2487
2487
 
2488
- const defaultConfiguration$2 = {
2488
+ const defaultConfiguration = {
2489
2489
  gapWidth: 88,
2490
2490
  gapHeight: 24,
2491
2491
  radius: 6,
@@ -2493,7 +2493,7 @@
2493
2493
  };
2494
2494
  class RectPlaceholderExtension {
2495
2495
  static create(configuration) {
2496
- return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2496
+ return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2497
2497
  }
2498
2498
  constructor(configuration) {
2499
2499
  this.configuration = configuration;
@@ -2537,35 +2537,34 @@
2537
2537
  }
2538
2538
  }
2539
2539
 
2540
- const defaultConfiguration$1 = {
2541
- view: {
2542
- paddingTop: 20,
2543
- paddingX: 20,
2544
- inputSize: 18,
2545
- inputRadius: 4,
2546
- inputIconSize: 14,
2547
- autoHideInputOnDrag: true,
2548
- isRegionClickable: true,
2549
- label: {
2550
- height: 22,
2551
- paddingX: 10,
2552
- minWidth: 50,
2553
- radius: 10
2554
- }
2540
+ const defaultViewConfiguration$3 = {
2541
+ paddingTop: 20,
2542
+ paddingX: 20,
2543
+ inputSize: 18,
2544
+ inputRadius: 4,
2545
+ inputIconSize: 14,
2546
+ autoHideInputOnDrag: true,
2547
+ isRegionClickable: true,
2548
+ label: {
2549
+ height: 22,
2550
+ paddingX: 10,
2551
+ minWidth: 50,
2552
+ radius: 10
2555
2553
  }
2556
2554
  };
2557
2555
  class ContainerStepExtension {
2558
2556
  static create(configuration) {
2559
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2557
+ return new ContainerStepExtension(configuration);
2560
2558
  }
2561
2559
  constructor(configuration) {
2560
+ var _a, _b, _c, _d;
2562
2561
  this.configuration = configuration;
2563
- this.componentType = 'container';
2564
- this.createComponentView = createContainerStepComponentViewFactory(this.configuration.view);
2562
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'container';
2563
+ this.createComponentView = createContainerStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$3);
2565
2564
  }
2566
2565
  }
2567
2566
 
2568
- const defaultViewConfiguration$1 = {
2567
+ const defaultViewConfiguration$2 = {
2569
2568
  minBranchWidth: 88,
2570
2569
  paddingX: 20,
2571
2570
  paddingTop1: 0,
@@ -2595,34 +2594,33 @@
2595
2594
  return new SwitchStepExtension(configuration);
2596
2595
  }
2597
2596
  constructor(configuration) {
2598
- var _a, _b, _c;
2597
+ var _a, _b, _c, _d, _e;
2599
2598
  this.configuration = configuration;
2600
- this.componentType = 'switch';
2601
- 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);
2599
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'switch';
2600
+ this.createComponentView = createSwitchStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$2, (_e = this.configuration) === null || _e === void 0 ? void 0 : _e.branchNamesResolver);
2602
2601
  }
2603
2602
  }
2604
2603
 
2605
- const defaultConfiguration = {
2606
- view: {
2607
- paddingLeft: 12,
2608
- paddingRight: 12,
2609
- paddingY: 10,
2610
- textMarginLeft: 12,
2611
- minTextWidth: 70,
2612
- iconSize: 22,
2613
- radius: 5,
2614
- inputSize: 14,
2615
- outputSize: 10
2616
- }
2604
+ const defaultViewConfiguration$1 = {
2605
+ paddingLeft: 12,
2606
+ paddingRight: 12,
2607
+ paddingY: 10,
2608
+ textMarginLeft: 12,
2609
+ minTextWidth: 70,
2610
+ iconSize: 22,
2611
+ radius: 5,
2612
+ inputSize: 14,
2613
+ outputSize: 10
2617
2614
  };
2618
2615
  class TaskStepExtension {
2619
2616
  static create(configuration) {
2620
- return new TaskStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2617
+ return new TaskStepExtension(configuration);
2621
2618
  }
2622
2619
  constructor(configuration) {
2620
+ var _a, _b, _c, _d;
2623
2621
  this.configuration = configuration;
2624
- this.componentType = 'task';
2625
- this.createComponentView = createTaskStepComponentViewFactory(false, this.configuration.view);
2622
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'task';
2623
+ this.createComponentView = createTaskStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$1);
2626
2624
  }
2627
2625
  }
2628
2626
 
@@ -2641,10 +2639,10 @@
2641
2639
  return new LaunchPadStepExtension(configuration);
2642
2640
  }
2643
2641
  constructor(configuration) {
2644
- var _a, _b;
2642
+ var _a, _b, _c, _d;
2645
2643
  this.configuration = configuration;
2646
- this.componentType = 'launchPad';
2647
- this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) !== null && _b !== void 0 ? _b : defaultViewConfiguration);
2644
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'launchPad';
2645
+ this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration);
2648
2646
  }
2649
2647
  }
2650
2648
 
package/lib/cjs/index.cjs CHANGED
@@ -433,7 +433,7 @@ class PlaceholderFinder {
433
433
  this.cache = undefined;
434
434
  };
435
435
  }
436
- find(vLt, vWidth, vHeight) {
436
+ find(vLt, vWidth, vHeight, vScale) {
437
437
  var _a;
438
438
  if (!this.cache) {
439
439
  const scroll = new Vector(window.scrollX, window.scrollY);
@@ -450,8 +450,8 @@ class PlaceholderFinder {
450
450
  });
451
451
  this.cache.sort((a, b) => a.diagSq - b.diagSq);
452
452
  }
453
- const vR = vLt.x + vWidth;
454
- const vB = vLt.y + vHeight;
453
+ const vR = vLt.x + vWidth * vScale;
454
+ const vB = vLt.y + vHeight * vScale;
455
455
  return (_a = this.cache.find(p => {
456
456
  return Math.max(vLt.x, p.lt.x) < Math.min(vR, p.br.x) && Math.max(vLt.y, p.lt.y) < Math.min(vB, p.br.y);
457
457
  })) === null || _a === void 0 ? void 0 : _a.placeholder;
@@ -512,7 +512,7 @@ class DragStepBehavior {
512
512
  if (this.state) {
513
513
  const newPosition = this.state.startPosition.subtract(delta).subtract(this.state.offset);
514
514
  this.view.setPosition(newPosition);
515
- const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height);
515
+ const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height, this.view.component.scale);
516
516
  if (this.currentPlaceholder !== placeholder) {
517
517
  if (this.currentPlaceholder) {
518
518
  this.currentPlaceholder.setIsHover(false);
@@ -1013,7 +1013,7 @@ class ValidationErrorBadge {
1013
1013
  }
1014
1014
  }
1015
1015
 
1016
- const defaultConfiguration$5 = {
1016
+ const defaultConfiguration$3 = {
1017
1017
  view: {
1018
1018
  size: 22,
1019
1019
  iconSize: 12
@@ -1021,7 +1021,7 @@ const defaultConfiguration$5 = {
1021
1021
  };
1022
1022
  class ValidationErrorBadgeExtension {
1023
1023
  static create(configuration) {
1024
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1024
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
1025
1025
  }
1026
1026
  constructor(configuration) {
1027
1027
  this.configuration = configuration;
@@ -1442,7 +1442,7 @@ class StartStopRootComponent {
1442
1442
  }
1443
1443
  }
1444
1444
 
1445
- const defaultViewConfiguration$2 = {
1445
+ const defaultViewConfiguration$4 = {
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$2), this.configuration.view) : defaultViewConfiguration$2;
1464
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$4), this.configuration.view) : defaultViewConfiguration$4;
1465
1465
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1466
1466
  }
1467
1467
  }
@@ -1946,14 +1946,14 @@ class NextQuantifiedNumber {
1946
1946
  }
1947
1947
  }
1948
1948
 
1949
- const defaultConfiguration$4 = {
1949
+ const defaultConfiguration$2 = {
1950
1950
  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],
1951
1951
  smoothDeltaYLimit: 16,
1952
1952
  padding: 10
1953
1953
  };
1954
1954
  class DefaultViewportController {
1955
1955
  static create(api, configuration) {
1956
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
1956
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2;
1957
1957
  const nqn = new NextQuantifiedNumber(config.scales);
1958
1958
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
1959
1959
  }
@@ -2273,13 +2273,13 @@ class LineGrid {
2273
2273
  }
2274
2274
  }
2275
2275
 
2276
- const defaultConfiguration$3 = {
2276
+ const defaultConfiguration$1 = {
2277
2277
  gridSizeX: 48,
2278
2278
  gridSizeY: 48
2279
2279
  };
2280
2280
  class LineGridExtension {
2281
2281
  static create(configuration) {
2282
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2282
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2283
2283
  }
2284
2284
  constructor(configuration) {
2285
2285
  this.configuration = configuration;
@@ -2300,7 +2300,7 @@ class LineGridDesignerExtension {
2300
2300
  }
2301
2301
  }
2302
2302
 
2303
- const defaultConfiguration$2 = {
2303
+ const defaultConfiguration = {
2304
2304
  gapWidth: 88,
2305
2305
  gapHeight: 24,
2306
2306
  radius: 6,
@@ -2308,7 +2308,7 @@ const defaultConfiguration$2 = {
2308
2308
  };
2309
2309
  class RectPlaceholderExtension {
2310
2310
  static create(configuration) {
2311
- return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2311
+ return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2312
2312
  }
2313
2313
  constructor(configuration) {
2314
2314
  this.configuration = configuration;
@@ -2352,35 +2352,34 @@ class StartStopRootComponentDesignerExtension {
2352
2352
  }
2353
2353
  }
2354
2354
 
2355
- const defaultConfiguration$1 = {
2356
- view: {
2357
- paddingTop: 20,
2358
- paddingX: 20,
2359
- inputSize: 18,
2360
- inputRadius: 4,
2361
- inputIconSize: 14,
2362
- autoHideInputOnDrag: true,
2363
- isRegionClickable: true,
2364
- label: {
2365
- height: 22,
2366
- paddingX: 10,
2367
- minWidth: 50,
2368
- radius: 10
2369
- }
2355
+ const defaultViewConfiguration$3 = {
2356
+ paddingTop: 20,
2357
+ paddingX: 20,
2358
+ inputSize: 18,
2359
+ inputRadius: 4,
2360
+ inputIconSize: 14,
2361
+ autoHideInputOnDrag: true,
2362
+ isRegionClickable: true,
2363
+ label: {
2364
+ height: 22,
2365
+ paddingX: 10,
2366
+ minWidth: 50,
2367
+ radius: 10
2370
2368
  }
2371
2369
  };
2372
2370
  class ContainerStepExtension {
2373
2371
  static create(configuration) {
2374
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2372
+ return new ContainerStepExtension(configuration);
2375
2373
  }
2376
2374
  constructor(configuration) {
2375
+ var _a, _b, _c, _d;
2377
2376
  this.configuration = configuration;
2378
- this.componentType = 'container';
2379
- this.createComponentView = createContainerStepComponentViewFactory(this.configuration.view);
2377
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'container';
2378
+ this.createComponentView = createContainerStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$3);
2380
2379
  }
2381
2380
  }
2382
2381
 
2383
- const defaultViewConfiguration$1 = {
2382
+ const defaultViewConfiguration$2 = {
2384
2383
  minBranchWidth: 88,
2385
2384
  paddingX: 20,
2386
2385
  paddingTop1: 0,
@@ -2410,34 +2409,33 @@ class SwitchStepExtension {
2410
2409
  return new SwitchStepExtension(configuration);
2411
2410
  }
2412
2411
  constructor(configuration) {
2413
- var _a, _b, _c;
2412
+ var _a, _b, _c, _d, _e;
2414
2413
  this.configuration = configuration;
2415
- this.componentType = 'switch';
2416
- 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);
2414
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'switch';
2415
+ this.createComponentView = createSwitchStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$2, (_e = this.configuration) === null || _e === void 0 ? void 0 : _e.branchNamesResolver);
2417
2416
  }
2418
2417
  }
2419
2418
 
2420
- const defaultConfiguration = {
2421
- view: {
2422
- paddingLeft: 12,
2423
- paddingRight: 12,
2424
- paddingY: 10,
2425
- textMarginLeft: 12,
2426
- minTextWidth: 70,
2427
- iconSize: 22,
2428
- radius: 5,
2429
- inputSize: 14,
2430
- outputSize: 10
2431
- }
2419
+ const defaultViewConfiguration$1 = {
2420
+ paddingLeft: 12,
2421
+ paddingRight: 12,
2422
+ paddingY: 10,
2423
+ textMarginLeft: 12,
2424
+ minTextWidth: 70,
2425
+ iconSize: 22,
2426
+ radius: 5,
2427
+ inputSize: 14,
2428
+ outputSize: 10
2432
2429
  };
2433
2430
  class TaskStepExtension {
2434
2431
  static create(configuration) {
2435
- return new TaskStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2432
+ return new TaskStepExtension(configuration);
2436
2433
  }
2437
2434
  constructor(configuration) {
2435
+ var _a, _b, _c, _d;
2438
2436
  this.configuration = configuration;
2439
- this.componentType = 'task';
2440
- this.createComponentView = createTaskStepComponentViewFactory(false, this.configuration.view);
2437
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'task';
2438
+ this.createComponentView = createTaskStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$1);
2441
2439
  }
2442
2440
  }
2443
2441
 
@@ -2456,10 +2454,10 @@ class LaunchPadStepExtension {
2456
2454
  return new LaunchPadStepExtension(configuration);
2457
2455
  }
2458
2456
  constructor(configuration) {
2459
- var _a, _b;
2457
+ var _a, _b, _c, _d;
2460
2458
  this.configuration = configuration;
2461
- this.componentType = 'launchPad';
2462
- this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) !== null && _b !== void 0 ? _b : defaultViewConfiguration);
2459
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'launchPad';
2460
+ this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration);
2463
2461
  }
2464
2462
  }
2465
2463
 
package/lib/esm/index.js CHANGED
@@ -432,7 +432,7 @@ class PlaceholderFinder {
432
432
  this.cache = undefined;
433
433
  };
434
434
  }
435
- find(vLt, vWidth, vHeight) {
435
+ find(vLt, vWidth, vHeight, vScale) {
436
436
  var _a;
437
437
  if (!this.cache) {
438
438
  const scroll = new Vector(window.scrollX, window.scrollY);
@@ -449,8 +449,8 @@ class PlaceholderFinder {
449
449
  });
450
450
  this.cache.sort((a, b) => a.diagSq - b.diagSq);
451
451
  }
452
- const vR = vLt.x + vWidth;
453
- const vB = vLt.y + vHeight;
452
+ const vR = vLt.x + vWidth * vScale;
453
+ const vB = vLt.y + vHeight * vScale;
454
454
  return (_a = this.cache.find(p => {
455
455
  return Math.max(vLt.x, p.lt.x) < Math.min(vR, p.br.x) && Math.max(vLt.y, p.lt.y) < Math.min(vB, p.br.y);
456
456
  })) === null || _a === void 0 ? void 0 : _a.placeholder;
@@ -511,7 +511,7 @@ class DragStepBehavior {
511
511
  if (this.state) {
512
512
  const newPosition = this.state.startPosition.subtract(delta).subtract(this.state.offset);
513
513
  this.view.setPosition(newPosition);
514
- const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height);
514
+ const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height, this.view.component.scale);
515
515
  if (this.currentPlaceholder !== placeholder) {
516
516
  if (this.currentPlaceholder) {
517
517
  this.currentPlaceholder.setIsHover(false);
@@ -1012,7 +1012,7 @@ class ValidationErrorBadge {
1012
1012
  }
1013
1013
  }
1014
1014
 
1015
- const defaultConfiguration$5 = {
1015
+ const defaultConfiguration$3 = {
1016
1016
  view: {
1017
1017
  size: 22,
1018
1018
  iconSize: 12
@@ -1020,7 +1020,7 @@ const defaultConfiguration$5 = {
1020
1020
  };
1021
1021
  class ValidationErrorBadgeExtension {
1022
1022
  static create(configuration) {
1023
- return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$5);
1023
+ return new ValidationErrorBadgeExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
1024
1024
  }
1025
1025
  constructor(configuration) {
1026
1026
  this.configuration = configuration;
@@ -1441,7 +1441,7 @@ class StartStopRootComponent {
1441
1441
  }
1442
1442
  }
1443
1443
 
1444
- const defaultViewConfiguration$2 = {
1444
+ const defaultViewConfiguration$4 = {
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$2), this.configuration.view) : defaultViewConfiguration$2;
1463
+ const view = ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) ? Object.assign(Object.assign({}, defaultViewConfiguration$4), this.configuration.view) : defaultViewConfiguration$4;
1464
1464
  return StartStopRootComponent.create(parentElement, sequence, parentPlaceIndicator, context, view);
1465
1465
  }
1466
1466
  }
@@ -1945,14 +1945,14 @@ class NextQuantifiedNumber {
1945
1945
  }
1946
1946
  }
1947
1947
 
1948
- const defaultConfiguration$4 = {
1948
+ const defaultConfiguration$2 = {
1949
1949
  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],
1950
1950
  smoothDeltaYLimit: 16,
1951
1951
  padding: 10
1952
1952
  };
1953
1953
  class DefaultViewportController {
1954
1954
  static create(api, configuration) {
1955
- const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$4;
1955
+ const config = configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2;
1956
1956
  const nqn = new NextQuantifiedNumber(config.scales);
1957
1957
  return new DefaultViewportController(config.smoothDeltaYLimit, nqn, api, config.padding);
1958
1958
  }
@@ -2272,13 +2272,13 @@ class LineGrid {
2272
2272
  }
2273
2273
  }
2274
2274
 
2275
- const defaultConfiguration$3 = {
2275
+ const defaultConfiguration$1 = {
2276
2276
  gridSizeX: 48,
2277
2277
  gridSizeY: 48
2278
2278
  };
2279
2279
  class LineGridExtension {
2280
2280
  static create(configuration) {
2281
- return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$3);
2281
+ return new LineGridExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2282
2282
  }
2283
2283
  constructor(configuration) {
2284
2284
  this.configuration = configuration;
@@ -2299,7 +2299,7 @@ class LineGridDesignerExtension {
2299
2299
  }
2300
2300
  }
2301
2301
 
2302
- const defaultConfiguration$2 = {
2302
+ const defaultConfiguration = {
2303
2303
  gapWidth: 88,
2304
2304
  gapHeight: 24,
2305
2305
  radius: 6,
@@ -2307,7 +2307,7 @@ const defaultConfiguration$2 = {
2307
2307
  };
2308
2308
  class RectPlaceholderExtension {
2309
2309
  static create(configuration) {
2310
- return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$2);
2310
+ return new RectPlaceholderExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2311
2311
  }
2312
2312
  constructor(configuration) {
2313
2313
  this.configuration = configuration;
@@ -2351,35 +2351,34 @@ class StartStopRootComponentDesignerExtension {
2351
2351
  }
2352
2352
  }
2353
2353
 
2354
- const defaultConfiguration$1 = {
2355
- view: {
2356
- paddingTop: 20,
2357
- paddingX: 20,
2358
- inputSize: 18,
2359
- inputRadius: 4,
2360
- inputIconSize: 14,
2361
- autoHideInputOnDrag: true,
2362
- isRegionClickable: true,
2363
- label: {
2364
- height: 22,
2365
- paddingX: 10,
2366
- minWidth: 50,
2367
- radius: 10
2368
- }
2354
+ const defaultViewConfiguration$3 = {
2355
+ paddingTop: 20,
2356
+ paddingX: 20,
2357
+ inputSize: 18,
2358
+ inputRadius: 4,
2359
+ inputIconSize: 14,
2360
+ autoHideInputOnDrag: true,
2361
+ isRegionClickable: true,
2362
+ label: {
2363
+ height: 22,
2364
+ paddingX: 10,
2365
+ minWidth: 50,
2366
+ radius: 10
2369
2367
  }
2370
2368
  };
2371
2369
  class ContainerStepExtension {
2372
2370
  static create(configuration) {
2373
- return new ContainerStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration$1);
2371
+ return new ContainerStepExtension(configuration);
2374
2372
  }
2375
2373
  constructor(configuration) {
2374
+ var _a, _b, _c, _d;
2376
2375
  this.configuration = configuration;
2377
- this.componentType = 'container';
2378
- this.createComponentView = createContainerStepComponentViewFactory(this.configuration.view);
2376
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'container';
2377
+ this.createComponentView = createContainerStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$3);
2379
2378
  }
2380
2379
  }
2381
2380
 
2382
- const defaultViewConfiguration$1 = {
2381
+ const defaultViewConfiguration$2 = {
2383
2382
  minBranchWidth: 88,
2384
2383
  paddingX: 20,
2385
2384
  paddingTop1: 0,
@@ -2409,34 +2408,33 @@ class SwitchStepExtension {
2409
2408
  return new SwitchStepExtension(configuration);
2410
2409
  }
2411
2410
  constructor(configuration) {
2412
- var _a, _b, _c;
2411
+ var _a, _b, _c, _d, _e;
2413
2412
  this.configuration = configuration;
2414
- this.componentType = 'switch';
2415
- 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);
2413
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'switch';
2414
+ this.createComponentView = createSwitchStepComponentViewFactory((_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$2, (_e = this.configuration) === null || _e === void 0 ? void 0 : _e.branchNamesResolver);
2416
2415
  }
2417
2416
  }
2418
2417
 
2419
- const defaultConfiguration = {
2420
- view: {
2421
- paddingLeft: 12,
2422
- paddingRight: 12,
2423
- paddingY: 10,
2424
- textMarginLeft: 12,
2425
- minTextWidth: 70,
2426
- iconSize: 22,
2427
- radius: 5,
2428
- inputSize: 14,
2429
- outputSize: 10
2430
- }
2418
+ const defaultViewConfiguration$1 = {
2419
+ paddingLeft: 12,
2420
+ paddingRight: 12,
2421
+ paddingY: 10,
2422
+ textMarginLeft: 12,
2423
+ minTextWidth: 70,
2424
+ iconSize: 22,
2425
+ radius: 5,
2426
+ inputSize: 14,
2427
+ outputSize: 10
2431
2428
  };
2432
2429
  class TaskStepExtension {
2433
2430
  static create(configuration) {
2434
- return new TaskStepExtension(configuration !== null && configuration !== void 0 ? configuration : defaultConfiguration);
2431
+ return new TaskStepExtension(configuration);
2435
2432
  }
2436
2433
  constructor(configuration) {
2434
+ var _a, _b, _c, _d;
2437
2435
  this.configuration = configuration;
2438
- this.componentType = 'task';
2439
- this.createComponentView = createTaskStepComponentViewFactory(false, this.configuration.view);
2436
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'task';
2437
+ this.createComponentView = createTaskStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration$1);
2440
2438
  }
2441
2439
  }
2442
2440
 
@@ -2455,10 +2453,10 @@ class LaunchPadStepExtension {
2455
2453
  return new LaunchPadStepExtension(configuration);
2456
2454
  }
2457
2455
  constructor(configuration) {
2458
- var _a, _b;
2456
+ var _a, _b, _c, _d;
2459
2457
  this.configuration = configuration;
2460
- this.componentType = 'launchPad';
2461
- this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.view) !== null && _b !== void 0 ? _b : defaultViewConfiguration);
2458
+ this.componentType = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.componentType) !== null && _b !== void 0 ? _b : 'launchPad';
2459
+ this.createComponentView = createLaunchPadStepComponentViewFactory(false, (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.view) !== null && _d !== void 0 ? _d : defaultViewConfiguration);
2462
2460
  }
2463
2461
  }
2464
2462
 
package/lib/index.d.ts CHANGED
@@ -661,7 +661,8 @@ interface ContainerStepComponentViewConfiguration {
661
661
  }
662
662
 
663
663
  interface ContainerStepExtensionConfiguration {
664
- view: ContainerStepComponentViewConfiguration;
664
+ componentType?: string;
665
+ view?: ContainerStepComponentViewConfiguration;
665
666
  }
666
667
 
667
668
  declare const createContainerStepComponentViewFactory: (cfg: ContainerStepComponentViewConfiguration) => StepComponentViewFactory;
@@ -685,6 +686,7 @@ interface LaunchPadStepComponentViewConfiguration {
685
686
  declare const createLaunchPadStepComponentViewFactory: (isInterruptedIfEmpty: boolean, cfg: LaunchPadStepComponentViewConfiguration) => StepComponentViewFactory;
686
687
 
687
688
  interface LaunchPadStepExtensionConfiguration {
689
+ componentType?: string;
688
690
  view?: LaunchPadStepComponentViewConfiguration;
689
691
  }
690
692
 
@@ -718,6 +720,7 @@ interface SwitchStepComponentViewConfiguration {
718
720
 
719
721
  type BranchNamesResolver = (step: BranchedStep) => string[];
720
722
  interface SwitchStepExtensionConfiguration {
723
+ componentType?: string;
721
724
  view?: SwitchStepComponentViewConfiguration;
722
725
  /**
723
726
  * A function that takes a `BranchedStep` and returns an array of branch names.
@@ -744,7 +747,8 @@ interface TaskStepComponentViewConfiguration {
744
747
  declare const createTaskStepComponentViewFactory: (isInterrupted: boolean, cfg: TaskStepComponentViewConfiguration) => StepComponentViewFactory;
745
748
 
746
749
  interface TaskStepExtensionConfiguration {
747
- view: TaskStepComponentViewConfiguration;
750
+ componentType?: string;
751
+ view?: TaskStepComponentViewConfiguration;
748
752
  }
749
753
 
750
754
  declare class CenteredViewportCalculator {
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.35.0",
4
+ "version": "0.35.2",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "types": "./lib/index.d.ts",