sequential-workflow-designer 0.30.2 → 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.2/css/designer.css" rel="stylesheet">
110
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.2/css/designer-light.css" rel="stylesheet">
111
- <link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.2/css/designer-dark.css" rel="stylesheet">
112
- <script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.30.2/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/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
 
@@ -3381,7 +3385,7 @@
3381
3385
  const workspaceController = new WorkspaceControllerWrapper();
3382
3386
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3383
3387
  const stepExtensionResolver = StepExtensionResolver.create(services);
3384
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3388
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3385
3389
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new DefinitionWalker();
3386
3390
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3387
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
 
@@ -3196,7 +3200,7 @@ class DesignerContext {
3196
3200
  const workspaceController = new WorkspaceControllerWrapper();
3197
3201
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3198
3202
  const stepExtensionResolver = StepExtensionResolver.create(services);
3199
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3203
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3200
3204
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new sequentialWorkflowModel.DefinitionWalker();
3201
3205
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3202
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
 
@@ -3195,7 +3199,7 @@ class DesignerContext {
3195
3199
  const workspaceController = new WorkspaceControllerWrapper();
3196
3200
  const behaviorController = BehaviorController.create(configuration.shadowRoot);
3197
3201
  const stepExtensionResolver = StepExtensionResolver.create(services);
3198
- const placeholderController = PlaceholderController.create(configuration.placeholder);
3202
+ const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3199
3203
  const definitionWalker = (_c = configuration.definitionWalker) !== null && _c !== void 0 ? _c : new DefinitionWalker();
3200
3204
  const i18n = (_d = configuration.i18n) !== null && _d !== void 0 ? _d : ((_, defaultValue) => defaultValue);
3201
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.2",
4
+ "version": "0.30.3",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "types": "./lib/index.d.ts",