@knotx/plugins-drag 0.4.16 → 0.5.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/dist/index.cjs CHANGED
@@ -162,7 +162,7 @@ class Drag extends (_a = core.BasePlugin, _getNode_dec = [decorators.inject.getN
162
162
  */
163
163
  startCanvasScrollListener(dragMove$) {
164
164
  if (this.canvasScrollAnimationFrame !== null) {
165
- cancelAnimationFrame(this.canvasScrollAnimationFrame);
165
+ core.cancelAnimationFrame(this.canvasScrollAnimationFrame);
166
166
  }
167
167
  const checkCanvasScroll = () => {
168
168
  if (!this.isDragging) {
@@ -181,9 +181,9 @@ class Drag extends (_a = core.BasePlugin, _getNode_dec = [decorators.inject.getN
181
181
  });
182
182
  }
183
183
  this.lastCanvasPosition = { x: positionX, y: positionY };
184
- this.canvasScrollAnimationFrame = requestAnimationFrame(checkCanvasScroll);
184
+ this.canvasScrollAnimationFrame = core.requestAnimationFrame(checkCanvasScroll);
185
185
  };
186
- this.canvasScrollAnimationFrame = requestAnimationFrame(checkCanvasScroll);
186
+ this.canvasScrollAnimationFrame = core.requestAnimationFrame(checkCanvasScroll);
187
187
  }
188
188
  init() {
189
189
  const dragStart$ = new rxjs.Subject();
@@ -194,7 +194,7 @@ class Drag extends (_a = core.BasePlugin, _getNode_dec = [decorators.inject.getN
194
194
  dragEnd$.next();
195
195
  this.isDragging = false;
196
196
  if (this.canvasScrollAnimationFrame !== null) {
197
- cancelAnimationFrame(this.canvasScrollAnimationFrame);
197
+ core.cancelAnimationFrame(this.canvasScrollAnimationFrame);
198
198
  this.canvasScrollAnimationFrame = null;
199
199
  }
200
200
  (_a2 = this.currentInteractable) == null ? void 0 : _a2.draggable(this.options);
@@ -297,7 +297,7 @@ class Drag extends (_a = core.BasePlugin, _getNode_dec = [decorators.inject.getN
297
297
  var _a2;
298
298
  (_a2 = this.currentInteractable) == null ? void 0 : _a2.unset();
299
299
  if (this.canvasScrollAnimationFrame !== null) {
300
- cancelAnimationFrame(this.canvasScrollAnimationFrame);
300
+ core.cancelAnimationFrame(this.canvasScrollAnimationFrame);
301
301
  this.canvasScrollAnimationFrame = null;
302
302
  }
303
303
  dragStart$.complete();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bem, BasePlugin, InteractionPriority } from '@knotx/core';
1
+ import { bem, cancelAnimationFrame, requestAnimationFrame, BasePlugin, InteractionPriority } from '@knotx/core';
2
2
  import { inject, register, OnInit, OnDestroy } from '@knotx/decorators';
3
3
  import interact from 'interactjs';
4
4
  import { BehaviorSubject, Subject } from 'rxjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-drag",
3
- "version": "0.4.16",
3
+ "version": "0.5.1",
4
4
  "description": "Drag Plugin for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -28,21 +28,21 @@
28
28
  "dist"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@knotx/jsx": "0.4.16",
32
- "@knotx/plugins-canvas": "0.4.16"
31
+ "@knotx/jsx": "0.5.1",
32
+ "@knotx/plugins-canvas": "0.5.1"
33
33
  },
34
34
  "dependencies": {
35
35
  "interactjs": "^1.10.27",
36
36
  "rxjs": "^7.8.1",
37
- "@knotx/core": "0.4.16",
38
- "@knotx/decorators": "0.4.16"
37
+ "@knotx/core": "0.5.1",
38
+ "@knotx/decorators": "0.5.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@knotx/build-config": "0.4.16",
42
- "@knotx/eslint-config": "0.4.16",
43
- "@knotx/jsx": "0.4.16",
44
- "@knotx/plugins-canvas": "0.4.16",
45
- "@knotx/typescript-config": "0.4.16"
41
+ "@knotx/build-config": "0.5.1",
42
+ "@knotx/eslint-config": "0.5.1",
43
+ "@knotx/jsx": "0.5.1",
44
+ "@knotx/plugins-canvas": "0.5.1",
45
+ "@knotx/typescript-config": "0.5.1"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "unbuild",