@sepveneto/free-dom 0.12.0-beta.2 → 0.12.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.css CHANGED
@@ -1,4 +1,4 @@
1
- /* ../../../../../../../tmp/tmp-1932-reazjYfj4HU7/core/src/style/index.css */
1
+ /* ../../../../../../../tmp/tmp-1868-V6O6nD1p0lI4/core/src/style/index.css */
2
2
  :root {
3
3
  --vv-free-dom--theme: rgb(64, 137, 239);
4
4
  --vv-free-dom--line: var(--vv-free-dom--theme);
@@ -12,6 +12,9 @@
12
12
  position: absolute;
13
13
  cursor: move;
14
14
  }
15
+ .vv-free-dom--draggable img {
16
+ pointer-events: none;
17
+ }
15
18
  .vv-free-dom--draggable:focus-visible {
16
19
  outline: none;
17
20
  }
@@ -127,3 +130,6 @@
127
130
  .vv-resize-dom--disabled {
128
131
  display: none;
129
132
  }
133
+ .vv-resize-dom--box img {
134
+ pointer-events: none;
135
+ }
package/dist/index.js CHANGED
@@ -18449,8 +18449,8 @@ function useDraggableData(props) {
18449
18449
  props.dragStartFn(evt, data);
18450
18450
  };
18451
18451
  const handleDrag = (evt, data) => {
18452
- x.value = data.x;
18453
- y.value = data.y;
18452
+ x.value = Number(data.x.toFixed(2));
18453
+ y.value = Number(data.y.toFixed(2));
18454
18454
  deltaX.value = data.deltaX;
18455
18455
  deltaY.value = data.deltaY;
18456
18456
  props.dragFn(evt, data);
@@ -19661,11 +19661,11 @@ var resizeDomCore = (0, import_vue_demi16.defineComponent)({
19661
19661
  return Array.isArray(_dots) ? _dots : Dots;
19662
19662
  });
19663
19663
  const lastRect = (0, import_vue_demi16.shallowRef)();
19664
- function runConstraints(width, height) {
19664
+ function runConstraints(width, height, axis) {
19665
19665
  const { lockAspectRatio } = props;
19666
19666
  if (!props.minHeight && !props.minWidth && !lockAspectRatio)
19667
19667
  return [width, height];
19668
- if (lockAspectRatio) {
19668
+ if (lockAspectRatio && axis.length === 2) {
19669
19669
  const ratio = props.width / props.height;
19670
19670
  if (ratio > 1) {
19671
19671
  height = Math.max(height, props.minHeight);
@@ -19697,7 +19697,7 @@ var resizeDomCore = (0, import_vue_demi16.defineComponent)({
19697
19697
  let width = props.width + (canDragX ? deltaX : 0);
19698
19698
  let height = props.height + (canDragY ? deltaY : 0);
19699
19699
  if (!evt.shiftKey) {
19700
- [width, height] = runConstraints(width, height);
19700
+ [width, height] = runConstraints(width, height, axis);
19701
19701
  }
19702
19702
  const sizeChanged = width !== props.width || height !== props.height;
19703
19703
  const fnName = `${handleName}Fn`;
@@ -19961,10 +19961,10 @@ var freeDom = (0, import_vue_demi17.defineComponent)({
19961
19961
  const isValid = sceneContext.check?.({ x: _x, y: _y, width: w, height: h8 });
19962
19962
  if (!isValid)
19963
19963
  return;
19964
- width.value = w;
19965
- height.value = h8;
19966
- x.value = _x;
19967
- y.value = _y;
19964
+ width.value = Number(w.toFixed(2));
19965
+ height.value = Number(h8.toFixed(2));
19966
+ x.value = Number(_x.toFixed(2));
19967
+ y.value = Number(_y.toFixed(2));
19968
19968
  props.resizeFn(evt, { node, width: w, height: h8, handle: axis });
19969
19969
  sceneContext?.emit("move");
19970
19970
  };
package/dist/index.mjs CHANGED
@@ -18446,8 +18446,8 @@ function useDraggableData(props) {
18446
18446
  props.dragStartFn(evt, data);
18447
18447
  };
18448
18448
  const handleDrag = (evt, data) => {
18449
- x.value = data.x;
18450
- y.value = data.y;
18449
+ x.value = Number(data.x.toFixed(2));
18450
+ y.value = Number(data.y.toFixed(2));
18451
18451
  deltaX.value = data.deltaX;
18452
18452
  deltaY.value = data.deltaY;
18453
18453
  props.dragFn(evt, data);
@@ -19658,11 +19658,11 @@ var resizeDomCore = defineComponent4({
19658
19658
  return Array.isArray(_dots) ? _dots : Dots;
19659
19659
  });
19660
19660
  const lastRect = shallowRef5();
19661
- function runConstraints(width, height) {
19661
+ function runConstraints(width, height, axis) {
19662
19662
  const { lockAspectRatio } = props;
19663
19663
  if (!props.minHeight && !props.minWidth && !lockAspectRatio)
19664
19664
  return [width, height];
19665
- if (lockAspectRatio) {
19665
+ if (lockAspectRatio && axis.length === 2) {
19666
19666
  const ratio = props.width / props.height;
19667
19667
  if (ratio > 1) {
19668
19668
  height = Math.max(height, props.minHeight);
@@ -19694,7 +19694,7 @@ var resizeDomCore = defineComponent4({
19694
19694
  let width = props.width + (canDragX ? deltaX : 0);
19695
19695
  let height = props.height + (canDragY ? deltaY : 0);
19696
19696
  if (!evt.shiftKey) {
19697
- [width, height] = runConstraints(width, height);
19697
+ [width, height] = runConstraints(width, height, axis);
19698
19698
  }
19699
19699
  const sizeChanged = width !== props.width || height !== props.height;
19700
19700
  const fnName = `${handleName}Fn`;
@@ -19958,10 +19958,10 @@ var freeDom = defineComponent5({
19958
19958
  const isValid = sceneContext.check?.({ x: _x, y: _y, width: w, height: h8 });
19959
19959
  if (!isValid)
19960
19960
  return;
19961
- width.value = w;
19962
- height.value = h8;
19963
- x.value = _x;
19964
- y.value = _y;
19961
+ width.value = Number(w.toFixed(2));
19962
+ height.value = Number(h8.toFixed(2));
19963
+ x.value = Number(_x.toFixed(2));
19964
+ y.value = Number(_y.toFixed(2));
19965
19965
  props.resizeFn(evt, { node, width: w, height: h8, handle: axis });
19966
19966
  sceneContext?.emit("move");
19967
19967
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sepveneto/free-dom",
3
- "version": "0.12.0-beta.2",
3
+ "version": "0.12.1",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",