@knotx/plugins-canvas 0.5.2 → 0.5.4

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
@@ -501,8 +501,15 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
501
501
  );
502
502
  }
503
503
  createZoomPanPinch() {
504
+ var _a2;
504
505
  const defaultTransform = this.getDefaultTransform();
505
- this.zoomPanPinch = new reactZoomPanPinch.ZoomPanPinch(this.config);
506
+ this.zoomPanPinch = new reactZoomPanPinch.ZoomPanPinch(__spreadProps(__spreadValues({}, this.config), {
507
+ alignmentAnimation: __spreadValues({
508
+ // react-zoom-pan-pinch/src/constants/state.constants.ts 里有默认值 100, 会影响初始位置计算, 造成无效的视口内搜索, 手动重置为 0 优化性能
509
+ sizeX: 0,
510
+ sizeY: 0
511
+ }, (_a2 = this.config) == null ? void 0 : _a2.alignmentAnimation)
512
+ }));
506
513
  if (defaultTransform && this.container && this.contentSize) {
507
514
  this.zoomPanPinch.presetTransformStateBeforeInit({
508
515
  wrapperSize: this.container,
package/dist/index.js CHANGED
@@ -499,8 +499,15 @@ class Canvas extends (_a = BasePlugin, _transform_dec = [register("transform")],
499
499
  );
500
500
  }
501
501
  createZoomPanPinch() {
502
+ var _a2;
502
503
  const defaultTransform = this.getDefaultTransform();
503
- this.zoomPanPinch = new ZoomPanPinch(this.config);
504
+ this.zoomPanPinch = new ZoomPanPinch(__spreadProps(__spreadValues({}, this.config), {
505
+ alignmentAnimation: __spreadValues({
506
+ // react-zoom-pan-pinch/src/constants/state.constants.ts 里有默认值 100, 会影响初始位置计算, 造成无效的视口内搜索, 手动重置为 0 优化性能
507
+ sizeX: 0,
508
+ sizeY: 0
509
+ }, (_a2 = this.config) == null ? void 0 : _a2.alignmentAnimation)
510
+ }));
504
511
  if (defaultTransform && this.container && this.contentSize) {
505
512
  this.zoomPanPinch.presetTransformStateBeforeInit({
506
513
  wrapperSize: this.container,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-canvas",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
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.5.2",
33
- "@knotx/plugins-history": "0.5.2"
32
+ "@knotx/jsx": "0.5.4",
33
+ "@knotx/plugins-history": "0.5.4"
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.5.2",
40
- "@knotx/decorators": "0.5.2"
39
+ "@knotx/core": "0.5.4",
40
+ "@knotx/decorators": "0.5.4"
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.5.2",
47
- "@knotx/eslint-config": "0.5.2",
48
- "@knotx/jsx": "0.5.2",
49
- "@knotx/plugins-history": "0.5.2",
50
- "@knotx/typescript-config": "0.5.2"
46
+ "@knotx/build-config": "0.5.4",
47
+ "@knotx/eslint-config": "0.5.4",
48
+ "@knotx/jsx": "0.5.4",
49
+ "@knotx/plugins-history": "0.5.4",
50
+ "@knotx/typescript-config": "0.5.4"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "unbuild",