@knotx/plugins-selection 0.4.14 → 0.4.16

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/dist/index.cjs CHANGED
@@ -124,6 +124,7 @@ class Selection extends (_a = core.BasePlugin, _selected_dec = [decorators.regis
124
124
  __publicField(this, "selectionAreaClassName");
125
125
  __publicField(this, "ruleMap", /* @__PURE__ */ new Map());
126
126
  __publicField(this, "enableDrag", true);
127
+ __publicField(this, "enableRangeSelect", true);
127
128
  __publicField(this, "isDragging", false);
128
129
  __publicField(this, "scrollingPosition", { x: 0, y: 0 });
129
130
  __publicField(this, "updateFrameId");
@@ -168,8 +169,9 @@ class Selection extends (_a = core.BasePlugin, _selected_dec = [decorators.regis
168
169
  __publicField(this, "onBeforeStart", (_) => {
169
170
  });
170
171
  __publicField(this, "onBeforeDrag", () => {
171
- this.isDragging = this.enableDrag;
172
- return this.enableDrag && this.interaction.canInteract(core.InteractionPriority.MarqueeSelection);
172
+ const isDragging = Boolean(this.enableDrag && this.interaction.canInteract(core.InteractionPriority.MarqueeSelection));
173
+ this.isDragging = isDragging;
174
+ return isDragging;
173
175
  });
174
176
  __publicField(this, "onStart", ({ event, store }) => {
175
177
  var _a2;
@@ -294,6 +296,9 @@ class Selection extends (_a = core.BasePlugin, _selected_dec = [decorators.regis
294
296
  if (config.enableDrag !== void 0) {
295
297
  this.enableDrag = config.enableDrag;
296
298
  }
299
+ if (config.enableRangeSelect !== void 0) {
300
+ this.enableRangeSelect = config.enableRangeSelect;
301
+ }
297
302
  }
298
303
  createSelection() {
299
304
  var _a2;
@@ -310,6 +315,9 @@ class Selection extends (_a = core.BasePlugin, _selected_dec = [decorators.regis
310
315
  startScrollMargins: { x: 24, y: 24 }
311
316
  }
312
317
  },
318
+ features: {
319
+ range: this.enableRangeSelect
320
+ },
313
321
  scrollController: {
314
322
  getScrollPosition: () => {
315
323
  return this.scrollingPosition;
package/dist/index.d.cts CHANGED
@@ -85,6 +85,11 @@ interface SelectionConfig {
85
85
  * default: true
86
86
  */
87
87
  enableDrag?: boolean;
88
+ /**
89
+ * enable range select with shift key
90
+ * default: true
91
+ */
92
+ enableRangeSelect?: boolean;
88
93
  rules?: SelectionRule[];
89
94
  /**
90
95
  * default:
@@ -103,6 +108,7 @@ declare class Selection extends BasePlugin<'selection', SelectionConfig> {
103
108
  private selectionAreaClassName;
104
109
  private ruleMap;
105
110
  private enableDrag;
111
+ private enableRangeSelect;
106
112
  private isDragging;
107
113
  private scrollingPosition;
108
114
  private updateFrameId;
package/dist/index.d.mts CHANGED
@@ -85,6 +85,11 @@ interface SelectionConfig {
85
85
  * default: true
86
86
  */
87
87
  enableDrag?: boolean;
88
+ /**
89
+ * enable range select with shift key
90
+ * default: true
91
+ */
92
+ enableRangeSelect?: boolean;
88
93
  rules?: SelectionRule[];
89
94
  /**
90
95
  * default:
@@ -103,6 +108,7 @@ declare class Selection extends BasePlugin<'selection', SelectionConfig> {
103
108
  private selectionAreaClassName;
104
109
  private ruleMap;
105
110
  private enableDrag;
111
+ private enableRangeSelect;
106
112
  private isDragging;
107
113
  private scrollingPosition;
108
114
  private updateFrameId;
package/dist/index.d.ts CHANGED
@@ -85,6 +85,11 @@ interface SelectionConfig {
85
85
  * default: true
86
86
  */
87
87
  enableDrag?: boolean;
88
+ /**
89
+ * enable range select with shift key
90
+ * default: true
91
+ */
92
+ enableRangeSelect?: boolean;
88
93
  rules?: SelectionRule[];
89
94
  /**
90
95
  * default:
@@ -103,6 +108,7 @@ declare class Selection extends BasePlugin<'selection', SelectionConfig> {
103
108
  private selectionAreaClassName;
104
109
  private ruleMap;
105
110
  private enableDrag;
111
+ private enableRangeSelect;
106
112
  private isDragging;
107
113
  private scrollingPosition;
108
114
  private updateFrameId;
package/dist/index.js CHANGED
@@ -118,6 +118,7 @@ class Selection extends (_a = BasePlugin, _selected_dec = [register("selected")]
118
118
  __publicField(this, "selectionAreaClassName");
119
119
  __publicField(this, "ruleMap", /* @__PURE__ */ new Map());
120
120
  __publicField(this, "enableDrag", true);
121
+ __publicField(this, "enableRangeSelect", true);
121
122
  __publicField(this, "isDragging", false);
122
123
  __publicField(this, "scrollingPosition", { x: 0, y: 0 });
123
124
  __publicField(this, "updateFrameId");
@@ -162,8 +163,9 @@ class Selection extends (_a = BasePlugin, _selected_dec = [register("selected")]
162
163
  __publicField(this, "onBeforeStart", (_) => {
163
164
  });
164
165
  __publicField(this, "onBeforeDrag", () => {
165
- this.isDragging = this.enableDrag;
166
- return this.enableDrag && this.interaction.canInteract(InteractionPriority.MarqueeSelection);
166
+ const isDragging = Boolean(this.enableDrag && this.interaction.canInteract(InteractionPriority.MarqueeSelection));
167
+ this.isDragging = isDragging;
168
+ return isDragging;
167
169
  });
168
170
  __publicField(this, "onStart", ({ event, store }) => {
169
171
  var _a2;
@@ -288,6 +290,9 @@ class Selection extends (_a = BasePlugin, _selected_dec = [register("selected")]
288
290
  if (config.enableDrag !== void 0) {
289
291
  this.enableDrag = config.enableDrag;
290
292
  }
293
+ if (config.enableRangeSelect !== void 0) {
294
+ this.enableRangeSelect = config.enableRangeSelect;
295
+ }
291
296
  }
292
297
  createSelection() {
293
298
  var _a2;
@@ -304,6 +309,9 @@ class Selection extends (_a = BasePlugin, _selected_dec = [register("selected")]
304
309
  startScrollMargins: { x: 24, y: 24 }
305
310
  }
306
311
  },
312
+ features: {
313
+ range: this.enableRangeSelect
314
+ },
307
315
  scrollController: {
308
316
  getScrollPosition: () => {
309
317
  return this.scrollingPosition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-selection",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "description": "Selection Plugin for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -28,19 +28,19 @@
28
28
  "dist"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@knotx/plugins-canvas": "0.4.14"
31
+ "@knotx/plugins-canvas": "0.4.16"
32
32
  },
33
33
  "dependencies": {
34
34
  "@knotx/viselect": "^3.9.0",
35
35
  "rxjs": "^7.8.1",
36
- "@knotx/core": "0.4.14",
37
- "@knotx/decorators": "0.4.14"
36
+ "@knotx/core": "0.4.16",
37
+ "@knotx/decorators": "0.4.16"
38
38
  },
39
39
  "devDependencies": {
40
- "@knotx/build-config": "0.4.14",
41
- "@knotx/eslint-config": "0.4.14",
42
- "@knotx/plugins-canvas": "0.4.14",
43
- "@knotx/typescript-config": "0.4.14"
40
+ "@knotx/build-config": "0.4.16",
41
+ "@knotx/eslint-config": "0.4.16",
42
+ "@knotx/plugins-canvas": "0.4.16",
43
+ "@knotx/typescript-config": "0.4.16"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "unbuild",