sequential-workflow-designer 0.30.1 → 0.30.3

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.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>
109
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.3/css/designer.css" rel="stylesheet">
110
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.3/css/designer-light.css" rel="stylesheet">
111
+ <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.3/css/designer-dark.css" rel="stylesheet">
112
+ <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.3/dist/index.umd.js"></script>
113
113
  ```
114
114
 
115
115
  Call the designer by:
package/css/designer.css CHANGED
@@ -143,6 +143,8 @@
143
143
  z-index: 20;
144
144
  padding: 8px 0 8px 8px;
145
145
  white-space: nowrap;
146
+ -webkit-user-select: none;
147
+ user-select: none;
146
148
  }
147
149
 
148
150
  .sqd-control-bar-button {
package/dist/index.umd.js CHANGED
@@ -2286,14 +2286,18 @@
2286
2286
  }
2287
2287
 
2288
2288
  class PlaceholderController {
2289
- static create(configuration) {
2290
- return new PlaceholderController(configuration);
2289
+ static create(state, configuration) {
2290
+ return new PlaceholderController(state, configuration);
2291
2291
  }
2292
- constructor(configuration) {
2293
- var _a, _b, _c, _d;
2292
+ constructor(state, configuration) {
2293
+ var _a, _b;
2294
2294
  this.configuration = configuration;
2295
- this.canCreate = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate) !== null && _b !== void 0 ? _b : (() => true);
2296
- this.canShow = (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.canShow) !== null && _d !== void 0 ? _d : (() => true);
2295
+ const canCreate = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate;
2296
+ const canShow = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.canShow;
2297
+ this.canCreate = canCreate ? (sequence, index) => canCreate(sequence, index, state.definition) : () => true;
2298
+ this.canShow = canShow
2299
+ ? (sequence, index, draggingStepComponentType, draggingStepType) => canShow(sequence, index, draggingStepComponentType, draggingStepType, state.definition)
2300
+ : () => true;
2297
2301
  }
2298
2302
  }
2299
2303
 
@@ -2880,7 +2884,8 @@
2880
2884
  throw new Error(notInitializedError$1);
2881
2885
  }
2882
2886
  const position = (_a = this.state.lastPosition) !== null && _a !== void 0 ? _a : this.state.startPosition;
2883
- const element = this.dom.elementFromPoint(position.x, position.y);
2887
+ const clientPosition = position.subtract(new Vector(window.scrollX, window.scrollY));
2888
+ const element = this.dom.elementFromPoint(clientPosition.x, clientPosition.y);
2884
2889
  this.stop(false, element);
2885
2890
  };
2886
2891
  this.onTouchStart = (e) => {
@@ -3380,7 +3385,7 @@
3380
3385
  const workspaceController = new WorkspaceControllerWrapper();
3381
3386
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3382
3387
  const stepExtensionResolver = StepExtensionResolver.create(services);
3383
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3388
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3384
3389
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new DefinitionWalker();
3385
3390
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3386
3391
  const uidGenerator = (_e = configuration.uidGenerator) !== null && _e !== void 0 ? _e : Uid.next;
package/lib/cjs/index.cjs CHANGED
@@ -2101,14 +2101,18 @@ class StepExtensionResolver {
2101
2101
  }
2102
2102
 
2103
2103
  class PlaceholderController {
2104
- static create(configuration) {
2105
- return new PlaceholderController(configuration);
2104
+ static create(state, configuration) {
2105
+ return new PlaceholderController(state, configuration);
2106
2106
  }
2107
- constructor(configuration) {
2108
- var _a, _b, _c, _d;
2107
+ constructor(state, configuration) {
2108
+ var _a, _b;
2109
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);
2110
+ const canCreate = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate;
2111
+ const canShow = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.canShow;
2112
+ this.canCreate = canCreate ? (sequence, index) => canCreate(sequence, index, state.definition) : () => true;
2113
+ this.canShow = canShow
2114
+ ? (sequence, index, draggingStepComponentType, draggingStepType) => canShow(sequence, index, draggingStepComponentType, draggingStepType, state.definition)
2115
+ : () => true;
2112
2116
  }
2113
2117
  }
2114
2118
 
@@ -2695,7 +2699,8 @@ class BehaviorController {
2695
2699
  throw new Error(notInitializedError$1);
2696
2700
  }
2697
2701
  const position = (_a = this.state.lastPosition) !== null && _a !== void 0 ? _a : this.state.startPosition;
2698
- const element = this.dom.elementFromPoint(position.x, position.y);
2702
+ const clientPosition = position.subtract(new Vector(window.scrollX, window.scrollY));
2703
+ const element = this.dom.elementFromPoint(clientPosition.x, clientPosition.y);
2699
2704
  this.stop(false, element);
2700
2705
  };
2701
2706
  this.onTouchStart = (e) => {
@@ -3195,7 +3200,7 @@ class DesignerContext {
3195
3200
  const workspaceController = new WorkspaceControllerWrapper();
3196
3201
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3197
3202
  const stepExtensionResolver = StepExtensionResolver.create(services);
3198
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3203
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3199
3204
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new sequentialWorkflowModel.DefinitionWalker();
3200
3205
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3201
3206
  const uidGenerator = (_e = configuration.uidGenerator) !== null && _e !== void 0 ? _e : Uid.next;
package/lib/esm/index.js CHANGED
@@ -2100,14 +2100,18 @@ class StepExtensionResolver {
2100
2100
  }
2101
2101
 
2102
2102
  class PlaceholderController {
2103
- static create(configuration) {
2104
- return new PlaceholderController(configuration);
2103
+ static create(state, configuration) {
2104
+ return new PlaceholderController(state, configuration);
2105
2105
  }
2106
- constructor(configuration) {
2107
- var _a, _b, _c, _d;
2106
+ constructor(state, configuration) {
2107
+ var _a, _b;
2108
2108
  this.configuration = configuration;
2109
- this.canCreate = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate) !== null && _b !== void 0 ? _b : (() => true);
2110
- this.canShow = (_d = (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.canShow) !== null && _d !== void 0 ? _d : (() => true);
2109
+ const canCreate = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.canCreate;
2110
+ const canShow = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.canShow;
2111
+ this.canCreate = canCreate ? (sequence, index) => canCreate(sequence, index, state.definition) : () => true;
2112
+ this.canShow = canShow
2113
+ ? (sequence, index, draggingStepComponentType, draggingStepType) => canShow(sequence, index, draggingStepComponentType, draggingStepType, state.definition)
2114
+ : () => true;
2111
2115
  }
2112
2116
  }
2113
2117
 
@@ -2694,7 +2698,8 @@ class BehaviorController {
2694
2698
  throw new Error(notInitializedError$1);
2695
2699
  }
2696
2700
  const position = (_a = this.state.lastPosition) !== null && _a !== void 0 ? _a : this.state.startPosition;
2697
- const element = this.dom.elementFromPoint(position.x, position.y);
2701
+ const clientPosition = position.subtract(new Vector(window.scrollX, window.scrollY));
2702
+ const element = this.dom.elementFromPoint(clientPosition.x, clientPosition.y);
2698
2703
  this.stop(false, element);
2699
2704
  };
2700
2705
  this.onTouchStart = (e) => {
@@ -3194,7 +3199,7 @@ class DesignerContext {
3194
3199
  const workspaceController = new WorkspaceControllerWrapper();
3195
3200
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3196
3201
  const stepExtensionResolver = StepExtensionResolver.create(services);
3197
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3202
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3198
3203
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new DefinitionWalker();
3199
3204
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3200
3205
  const uidGenerator = (_e = configuration.uidGenerator) !== null && _e !== void 0 ? _e : Uid.next;
package/lib/index.d.ts CHANGED
@@ -283,10 +283,10 @@ declare class StepComponentFactory {
283
283
 
284
284
  declare class PlaceholderController {
285
285
  private readonly configuration;
286
- static create(configuration: PlaceholderConfiguration | undefined): PlaceholderController;
287
- private constructor();
286
+ static create(state: DesignerState, configuration: PlaceholderConfiguration | undefined): PlaceholderController;
288
287
  readonly canCreate: (sequence: Sequence, index: number) => boolean;
289
288
  readonly canShow: (sequence: Sequence, index: number, draggingStepComponentType: string, draggingStepType: string) => boolean;
289
+ private constructor();
290
290
  }
291
291
 
292
292
  declare class ComponentContext {
@@ -1139,8 +1139,8 @@ interface StepsConfiguration {
1139
1139
  }
1140
1140
  type StepIconUrlProvider = (componentType: ComponentType, type: string) => string | null;
1141
1141
  interface PlaceholderConfiguration {
1142
- canCreate?: (sequence: Sequence, index: number) => boolean;
1143
- canShow?: (sequence: Sequence, index: number, draggingStepComponentType: ComponentType, draggingStepType: string) => boolean;
1142
+ canCreate?: (sequence: Sequence, index: number, definition: Definition) => boolean;
1143
+ canShow?: (sequence: Sequence, index: number, draggingStepComponentType: ComponentType, draggingStepType: string, definition: Definition) => boolean;
1144
1144
  }
1145
1145
  interface ValidatorConfiguration {
1146
1146
  step?: StepValidator;
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.1",
4
+ "version": "0.30.3",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -129,6 +129,8 @@
129
129
  z-index: 20;
130
130
  padding: 8px 0 8px 8px;
131
131
  white-space: nowrap;
132
+ -webkit-user-select: none;
133
+ user-select: none;
132
134
  }
133
135
  .sqd-control-bar-button {
134
136
  display: inline-block;