@knotx/plugins-canvas 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 +7 -7
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -225,7 +225,7 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
|
|
|
225
225
|
setConfig: (config) => {
|
|
226
226
|
this.edgeScroll.config = __spreadValues(__spreadValues({}, this.edgeScroll.config), config);
|
|
227
227
|
if (this.edgeScroll.config.enabled && this.edgeScrollAnimationFrame !== null) {
|
|
228
|
-
cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
228
|
+
core.cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
229
229
|
this.edgeScrollAnimationFrame = null;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -278,14 +278,14 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
|
|
|
278
278
|
y: e.clientY - rect.top
|
|
279
279
|
};
|
|
280
280
|
if (this.edgeScrollAnimationFrame === null) {
|
|
281
|
-
this.edgeScrollAnimationFrame = requestAnimationFrame(this.handleEdgeScroll);
|
|
281
|
+
this.edgeScrollAnimationFrame = core.requestAnimationFrame(this.handleEdgeScroll);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
});
|
|
285
285
|
__publicField(this, "onMouseLeave", (e) => {
|
|
286
286
|
this.mousePosition = null;
|
|
287
287
|
if (this.edgeScrollAnimationFrame !== null) {
|
|
288
|
-
cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
288
|
+
core.cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
289
289
|
this.edgeScrollAnimationFrame = null;
|
|
290
290
|
}
|
|
291
291
|
this.listeners.mouseleave.forEach((listener) => {
|
|
@@ -335,7 +335,7 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
|
|
|
335
335
|
const newPositionY = currentState.positionY + deltaY;
|
|
336
336
|
this.ref.setTransform(newPositionX, newPositionY, currentState.scale, 0);
|
|
337
337
|
}
|
|
338
|
-
this.edgeScrollAnimationFrame = requestAnimationFrame(this.handleEdgeScroll);
|
|
338
|
+
this.edgeScrollAnimationFrame = core.requestAnimationFrame(this.handleEdgeScroll);
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
scrollNodeIntoView({ nodeId, scale = this.transform.scale, block, inline, offset, animationTime }) {
|
|
@@ -416,8 +416,8 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
|
|
|
416
416
|
}
|
|
417
417
|
let frame;
|
|
418
418
|
const unsubscribe = transformRef == null ? void 0 : transformRef.instance.onChange((ref) => {
|
|
419
|
-
cancelAnimationFrame(frame);
|
|
420
|
-
frame = requestAnimationFrame(() => {
|
|
419
|
+
core.cancelAnimationFrame(frame);
|
|
420
|
+
frame = core.requestAnimationFrame(() => {
|
|
421
421
|
if (lodashEs.isEqual(this.transform, ref.state)) {
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
@@ -483,7 +483,7 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
|
|
|
483
483
|
this.subscriptions.push(() => {
|
|
484
484
|
Object.values(this.listeners).forEach((set) => set.clear());
|
|
485
485
|
if (this.edgeScrollAnimationFrame !== null) {
|
|
486
|
-
cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
486
|
+
core.cancelAnimationFrame(this.edgeScrollAnimationFrame);
|
|
487
487
|
this.edgeScrollAnimationFrame = null;
|
|
488
488
|
}
|
|
489
489
|
this.rootElement = null;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from '@knotx/jsx/jsx-runtime';
|
|
2
|
-
import { Layer, DataManager, use, DOMElement, bem, BasePlugin, InteractionPriority } from '@knotx/core';
|
|
2
|
+
import { Layer, DataManager, use, DOMElement, cancelAnimationFrame, requestAnimationFrame, bem, BasePlugin, InteractionPriority } from '@knotx/core';
|
|
3
3
|
import { register, inject, tool, layer, OnInit } from '@knotx/decorators';
|
|
4
4
|
import { TransformWrapper, TransformComponent, ZoomPanPinch } from '@knotx/react-zoom-pan-pinch';
|
|
5
5
|
import { isEqual, merge } from 'lodash-es';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knotx/plugins-canvas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Canvas Plugin for Knotx",
|
|
5
5
|
"author": "boenfu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=17.0.0",
|
|
32
|
-
"@knotx/jsx": "0.
|
|
33
|
-
"@knotx/plugins-history": "0.
|
|
32
|
+
"@knotx/jsx": "0.5.1",
|
|
33
|
+
"@knotx/plugins-history": "0.5.1"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@knotx/react-zoom-pan-pinch": "^3.9.12",
|
|
37
37
|
"lodash-es": "^4.17.21",
|
|
38
38
|
"rxjs": "^7.8.1",
|
|
39
|
-
"@knotx/core": "0.
|
|
40
|
-
"@knotx/decorators": "0.
|
|
39
|
+
"@knotx/core": "0.5.1",
|
|
40
|
+
"@knotx/decorators": "0.5.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/lodash-es": "^4.17.12",
|
|
44
44
|
"@types/react": "^17.0.0",
|
|
45
45
|
"react": "^17.0.0",
|
|
46
|
-
"@knotx/build-config": "0.
|
|
47
|
-
"@knotx/eslint-config": "0.
|
|
48
|
-
"@knotx/jsx": "0.
|
|
49
|
-
"@knotx/plugins-history": "0.
|
|
50
|
-
"@knotx/typescript-config": "0.
|
|
46
|
+
"@knotx/build-config": "0.5.1",
|
|
47
|
+
"@knotx/eslint-config": "0.5.1",
|
|
48
|
+
"@knotx/jsx": "0.5.1",
|
|
49
|
+
"@knotx/plugins-history": "0.5.1",
|
|
50
|
+
"@knotx/typescript-config": "0.5.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "unbuild",
|