@knotx/plugins-canvas 0.4.8 → 0.4.9

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
@@ -373,7 +373,8 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
373
373
  (_a2 = this.ref) == null ? void 0 : _a2.resetTransform(animationTime);
374
374
  }
375
375
  render({ children } = { children: null }) {
376
- var _a2, _b, _c, _d;
376
+ var _a2, _b;
377
+ const contentSize = core.use(() => this.contentSize);
377
378
  const defaultTransform = react.useMemo(() => this.getDefaultTransform(), []);
378
379
  const [transformRef, setTransformRef] = react.useReducer((_, ref) => {
379
380
  var _a3;
@@ -457,8 +458,8 @@ class Canvas extends (_a = core.BasePlugin, _transform_dec = [decorators.registe
457
458
  contentClass: core.bem(this.name, "content"),
458
459
  contentStyle: {
459
460
  position: "relative",
460
- width: (_b = (_a2 = this.contentSize) == null ? void 0 : _a2.width) != null ? _b : "100%",
461
- height: (_d = (_c = this.contentSize) == null ? void 0 : _c.height) != null ? _d : "100%"
461
+ width: (_a2 = contentSize == null ? void 0 : contentSize.width) != null ? _a2 : "100%",
462
+ height: (_b = contentSize == null ? void 0 : contentSize.height) != null ? _b : "100%"
462
463
  }
463
464
  }, { [`data-${this.pluginId}`]: "" }), {
464
465
  children: childrenLayers
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from '@knotx/jsx/jsx-runtime';
2
- import { Layer, DOMElement, bem, BasePlugin, InteractionPriority } from '@knotx/core';
2
+ import { Layer, use, DOMElement, bem, BasePlugin, InteractionPriority } from '@knotx/core';
3
3
  import { register, inject, tool, layer, OnInit } from '@knotx/decorators';
4
4
  import { TransformWrapper, TransformComponent } from '@knotx/react-zoom-pan-pinch';
5
5
  import { isEqual, merge } from 'lodash-es';
@@ -371,7 +371,8 @@ class Canvas extends (_a = BasePlugin, _transform_dec = [register("transform")],
371
371
  (_a2 = this.ref) == null ? void 0 : _a2.resetTransform(animationTime);
372
372
  }
373
373
  render({ children } = { children: null }) {
374
- var _a2, _b, _c, _d;
374
+ var _a2, _b;
375
+ const contentSize = use(() => this.contentSize);
375
376
  const defaultTransform = useMemo(() => this.getDefaultTransform(), []);
376
377
  const [transformRef, setTransformRef] = useReducer((_, ref) => {
377
378
  var _a3;
@@ -455,8 +456,8 @@ class Canvas extends (_a = BasePlugin, _transform_dec = [register("transform")],
455
456
  contentClass: bem(this.name, "content"),
456
457
  contentStyle: {
457
458
  position: "relative",
458
- width: (_b = (_a2 = this.contentSize) == null ? void 0 : _a2.width) != null ? _b : "100%",
459
- height: (_d = (_c = this.contentSize) == null ? void 0 : _c.height) != null ? _d : "100%"
459
+ width: (_a2 = contentSize == null ? void 0 : contentSize.width) != null ? _a2 : "100%",
460
+ height: (_b = contentSize == null ? void 0 : contentSize.height) != null ? _b : "100%"
460
461
  }
461
462
  }, { [`data-${this.pluginId}`]: "" }), {
462
463
  children: childrenLayers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-canvas",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Canvas Plugin for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -29,23 +29,23 @@
29
29
  ],
30
30
  "peerDependencies": {
31
31
  "react": ">=17.0.0",
32
- "@knotx/jsx": "0.4.8"
32
+ "@knotx/jsx": "0.4.9"
33
33
  },
34
34
  "dependencies": {
35
35
  "@knotx/react-zoom-pan-pinch": "^3.9.9",
36
36
  "lodash-es": "^4.17.21",
37
37
  "rxjs": "^7.8.1",
38
- "@knotx/core": "0.4.8",
39
- "@knotx/decorators": "0.4.8"
38
+ "@knotx/core": "0.4.9",
39
+ "@knotx/decorators": "0.4.9"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/lodash-es": "^4.17.12",
43
43
  "@types/react": "^17.0.0",
44
44
  "react": "^17.0.0",
45
- "@knotx/build-config": "0.4.8",
46
- "@knotx/eslint-config": "0.4.8",
47
- "@knotx/jsx": "0.4.8",
48
- "@knotx/typescript-config": "0.4.8"
45
+ "@knotx/build-config": "0.4.9",
46
+ "@knotx/eslint-config": "0.4.9",
47
+ "@knotx/jsx": "0.4.9",
48
+ "@knotx/typescript-config": "0.4.9"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "unbuild",