@flozy/editor 4.3.9 → 4.4.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.
@@ -222,7 +222,7 @@ const Image = props => {
222
222
  const getWidth = () => {
223
223
  if (resizing) {
224
224
  return {
225
- width: `${size.width}px`,
225
+ width: `${size.widthInPercent}%`,
226
226
  height: objectFit ? `${size.height}px` : "auto"
227
227
  };
228
228
  } else {
@@ -179,7 +179,7 @@ const Video = ({
179
179
  const getWidth = () => {
180
180
  if (resizing) {
181
181
  return {
182
- width: size.width ? `${size.width}px` : "100%",
182
+ width: size.widthInPercent ? `${size.widthInPercent}%` : "100%",
183
183
  height: url ? `${size.height || 370}px` : "auto"
184
184
  };
185
185
  } else {
@@ -50,9 +50,10 @@ const useResize = ({
50
50
  setSize(currentSize => {
51
51
  const calcWidth = (currentSize.width || width) + e.movementX;
52
52
  const cWP = calcWidth / width * 100;
53
+ const calcHeight = (parseInt(currentSize.height) || height) + e.movementY;
53
54
  const calc = {
54
- width: calcWidth,
55
- height: (parseInt(currentSize.height) || height) + e.movementY,
55
+ width: Math.max(calcWidth, 140),
56
+ height: Math.max(calcHeight, 50),
56
57
  widthInPercent: cWP > 100 ? 100 : cWP
57
58
  };
58
59
  latest = calc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.3.9",
3
+ "version": "4.4.1",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"