@sepveneto/free-dom 0.14.4 → 0.14.5

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-1868-izUYPQak4pI8/core/src/style/index.css */
1
+ /* ../../../../../../../tmp/tmp-2007-pV5QZ04PRQu3/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);
@@ -21,8 +21,7 @@
21
21
  .vv-free-dom--draggable__disabled {
22
22
  cursor: initial;
23
23
  }
24
- .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected::after,
25
- .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected:focus-visible {
24
+ .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected::after {
26
25
  content: "";
27
26
  z-index: 1;
28
27
  display: block;
@@ -32,10 +31,9 @@
32
31
  top: 0;
33
32
  left: 0;
34
33
  background: var(--vv-free-dom--selected);
35
- outline: 2px dashed var(--vv-free-dom--theme);
34
+ border: 2px dashed var(--vv-free-dom--theme);
36
35
  }
37
- .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected::after::selection,
38
- .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected:focus-visible::selection {
36
+ .vv-free-dom--draggable__mask.vv-free-dom--draggable__selected::after::selection {
39
37
  background-color: transparent !important;
40
38
  }
41
39
  .vv-free-dom--line {
package/dist/index.js CHANGED
@@ -179,11 +179,11 @@ var require_common = __commonJS({
179
179
  let enableOverride = null;
180
180
  let namespacesCache;
181
181
  let enabledCache;
182
- function debug3(...args) {
183
- if (!debug3.enabled) {
182
+ function debug2(...args) {
183
+ if (!debug2.enabled) {
184
184
  return;
185
185
  }
186
- const self2 = debug3;
186
+ const self2 = debug2;
187
187
  const curr = Number(/* @__PURE__ */ new Date());
188
188
  const ms = curr - (prevTime || curr);
189
189
  self2.diff = ms;
@@ -213,12 +213,12 @@ var require_common = __commonJS({
213
213
  const logFn = self2.log || createDebug.log;
214
214
  logFn.apply(self2, args);
215
215
  }
216
- debug3.namespace = namespace;
217
- debug3.useColors = createDebug.useColors();
218
- debug3.color = createDebug.selectColor(namespace);
219
- debug3.extend = extend;
220
- debug3.destroy = createDebug.destroy;
221
- Object.defineProperty(debug3, "enabled", {
216
+ debug2.namespace = namespace;
217
+ debug2.useColors = createDebug.useColors();
218
+ debug2.color = createDebug.selectColor(namespace);
219
+ debug2.extend = extend;
220
+ debug2.destroy = createDebug.destroy;
221
+ Object.defineProperty(debug2, "enabled", {
222
222
  enumerable: true,
223
223
  configurable: false,
224
224
  get: () => {
@@ -236,9 +236,9 @@ var require_common = __commonJS({
236
236
  }
237
237
  });
238
238
  if (typeof createDebug.init === "function") {
239
- createDebug.init(debug3);
239
+ createDebug.init(debug2);
240
240
  }
241
- return debug3;
241
+ return debug2;
242
242
  }
243
243
  function extend(namespace, delimiter) {
244
244
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -763,11 +763,11 @@ var require_node = __commonJS({
763
763
  function load() {
764
764
  return process.env.DEBUG;
765
765
  }
766
- function init(debug3) {
767
- debug3.inspectOpts = {};
766
+ function init(debug2) {
767
+ debug2.inspectOpts = {};
768
768
  const keys = Object.keys(exports.inspectOpts);
769
769
  for (let i = 0; i < keys.length; i++) {
770
- debug3.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
770
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
771
771
  }
772
772
  }
773
773
  module2.exports = require_common()(exports);
@@ -38170,7 +38170,7 @@ var require_runtime_core_cjs_prod = __commonJS({
38170
38170
  isUnmounting: false,
38171
38171
  leavingVNodes: /* @__PURE__ */ new Map()
38172
38172
  };
38173
- onMounted6(() => {
38173
+ onMounted7(() => {
38174
38174
  state2.isMounted = true;
38175
38175
  });
38176
38176
  onBeforeUnmount3(() => {
@@ -39489,7 +39489,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39489
39489
  }
39490
39490
  }
39491
39491
  };
39492
- onMounted6(cacheSubtree);
39492
+ onMounted7(cacheSubtree);
39493
39493
  onUpdated2(cacheSubtree);
39494
39494
  onBeforeUnmount3(() => {
39495
39495
  cache.forEach((cached) => {
@@ -39647,7 +39647,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39647
39647
  }
39648
39648
  };
39649
39649
  var onBeforeMount2 = createHook("bm");
39650
- var onMounted6 = createHook("m");
39650
+ var onMounted7 = createHook("m");
39651
39651
  var onBeforeUpdate2 = createHook(
39652
39652
  "bu"
39653
39653
  );
@@ -40162,7 +40162,7 @@ var require_runtime_core_cjs_prod = __commonJS({
40162
40162
  }
40163
40163
  }
40164
40164
  registerLifecycleHook(onBeforeMount2, beforeMount);
40165
- registerLifecycleHook(onMounted6, mounted);
40165
+ registerLifecycleHook(onMounted7, mounted);
40166
40166
  registerLifecycleHook(onBeforeUpdate2, beforeUpdate);
40167
40167
  registerLifecycleHook(onUpdated2, updated);
40168
40168
  registerLifecycleHook(onActivated, activated);
@@ -42296,7 +42296,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42296
42296
  return ctx;
42297
42297
  }
42298
42298
  };
42299
- function watchEffect7(effect, options) {
42299
+ function watchEffect6(effect, options) {
42300
42300
  return doWatch(effect, null, options);
42301
42301
  }
42302
42302
  function watchPostEffect(effect, options) {
@@ -44128,7 +44128,7 @@ var require_runtime_core_cjs_prod = __commonJS({
44128
44128
  exports.onBeforeUpdate = onBeforeUpdate2;
44129
44129
  exports.onDeactivated = onDeactivated;
44130
44130
  exports.onErrorCaptured = onErrorCaptured;
44131
- exports.onMounted = onMounted6;
44131
+ exports.onMounted = onMounted7;
44132
44132
  exports.onRenderTracked = onRenderTracked;
44133
44133
  exports.onRenderTriggered = onRenderTriggered;
44134
44134
  exports.onServerPrefetch = onServerPrefetch;
@@ -44164,7 +44164,7 @@ var require_runtime_core_cjs_prod = __commonJS({
44164
44164
  exports.version = version3;
44165
44165
  exports.warn = warn$1;
44166
44166
  exports.watch = watch8;
44167
- exports.watchEffect = watchEffect7;
44167
+ exports.watchEffect = watchEffect6;
44168
44168
  exports.watchPostEffect = watchPostEffect;
44169
44169
  exports.watchSyncEffect = watchSyncEffect;
44170
44170
  exports.withAsyncContext = withAsyncContext;
@@ -45300,7 +45300,7 @@ var require_runtime_core_cjs = __commonJS({
45300
45300
  isUnmounting: false,
45301
45301
  leavingVNodes: /* @__PURE__ */ new Map()
45302
45302
  };
45303
- onMounted6(() => {
45303
+ onMounted7(() => {
45304
45304
  state2.isMounted = true;
45305
45305
  });
45306
45306
  onBeforeUnmount3(() => {
@@ -46851,7 +46851,7 @@ Server rendered element contains fewer child nodes than client vdom.`
46851
46851
  }
46852
46852
  }
46853
46853
  };
46854
- onMounted6(cacheSubtree);
46854
+ onMounted7(cacheSubtree);
46855
46855
  onUpdated2(cacheSubtree);
46856
46856
  onBeforeUnmount3(() => {
46857
46857
  cache.forEach((cached) => {
@@ -47017,7 +47017,7 @@ Server rendered element contains fewer child nodes than client vdom.`
47017
47017
  }
47018
47018
  };
47019
47019
  var onBeforeMount2 = createHook("bm");
47020
- var onMounted6 = createHook("m");
47020
+ var onMounted7 = createHook("m");
47021
47021
  var onBeforeUpdate2 = createHook(
47022
47022
  "bu"
47023
47023
  );
@@ -47754,7 +47754,7 @@ If this is a native custom element, make sure to exclude it from component resol
47754
47754
  }
47755
47755
  }
47756
47756
  registerLifecycleHook(onBeforeMount2, beforeMount);
47757
- registerLifecycleHook(onMounted6, mounted);
47757
+ registerLifecycleHook(onMounted7, mounted);
47758
47758
  registerLifecycleHook(onBeforeUpdate2, beforeUpdate);
47759
47759
  registerLifecycleHook(onUpdated2, updated);
47760
47760
  registerLifecycleHook(onActivated, activated);
@@ -50302,7 +50302,7 @@ If you want to remount the same app, move your app creation logic into a factory
50302
50302
  return ctx;
50303
50303
  }
50304
50304
  };
50305
- function watchEffect7(effect, options) {
50305
+ function watchEffect6(effect, options) {
50306
50306
  return doWatch(effect, null, options);
50307
50307
  }
50308
50308
  function watchPostEffect(effect, options) {
@@ -52670,7 +52670,7 @@ Component that was made reactive: `,
52670
52670
  exports.onBeforeUpdate = onBeforeUpdate2;
52671
52671
  exports.onDeactivated = onDeactivated;
52672
52672
  exports.onErrorCaptured = onErrorCaptured;
52673
- exports.onMounted = onMounted6;
52673
+ exports.onMounted = onMounted7;
52674
52674
  exports.onRenderTracked = onRenderTracked;
52675
52675
  exports.onRenderTriggered = onRenderTriggered;
52676
52676
  exports.onServerPrefetch = onServerPrefetch;
@@ -52706,7 +52706,7 @@ Component that was made reactive: `,
52706
52706
  exports.version = version3;
52707
52707
  exports.warn = warn2;
52708
52708
  exports.watch = watch8;
52709
- exports.watchEffect = watchEffect7;
52709
+ exports.watchEffect = watchEffect6;
52710
52710
  exports.watchPostEffect = watchPostEffect;
52711
52711
  exports.watchSyncEffect = watchSyncEffect;
52712
52712
  exports.withAsyncContext = withAsyncContext;
@@ -57706,8 +57706,8 @@ function useMask(target, props, nodes, size) {
57706
57706
  return Math.max(a, c) - Math.min(b, d) <= -standard;
57707
57707
  }
57708
57708
  function offsetFormat(evt) {
57709
- const offsetX = evt.clientX - rect.x.value;
57710
- const offsetY = evt.clientY - rect.y.value;
57709
+ const offsetX = (evt.clientX - rect.x.value) / props.transformScale;
57710
+ const offsetY = (evt.clientY - rect.y.value) / props.transformScale;
57711
57711
  return {
57712
57712
  x: offsetX,
57713
57713
  y: offsetY
@@ -58469,8 +58469,6 @@ var freeDom = (0, import_vue_demi17.defineComponent)({
58469
58469
  var freeDom_default = freeDom;
58470
58470
 
58471
58471
  // src/components/freeDomWrap.ts
58472
- var import_debug2 = __toESM(require_src());
58473
- var debug2 = (0, import_debug2.default)("freeDom:wrap");
58474
58472
  var freeDomWrapProps = {
58475
58473
  diff: {
58476
58474
  type: Number,
@@ -58521,32 +58519,23 @@ var FreeDomWrap = (0, import_vue_demi18.defineComponent)({
58521
58519
  const eventBus = useEventBus();
58522
58520
  const nodes = (0, import_vue_demi18.ref)([]);
58523
58521
  const history = useOperateHistory(nodes);
58524
- const width = (0, import_vue_demi18.ref)(props.width);
58525
- const height = (0, import_vue_demi18.ref)(props.height);
58522
+ const width = (0, import_vue_demi18.ref)();
58523
+ const height = (0, import_vue_demi18.ref)();
58526
58524
  const rectRef = (0, import_vue_demi18.shallowRef)();
58527
- const wrapRect = useElementBounding(rectRef);
58528
58525
  const wrapStyle = (0, import_vue_demi18.computed)(() => ({
58529
58526
  height: height.value + "px",
58530
58527
  width: width.value + "px"
58531
58528
  }));
58532
- (0, import_vue_demi18.watchEffect)(() => {
58533
- width.value = props.width;
58534
- height.value = props.height;
58529
+ (0, import_vue_demi18.onMounted)(() => {
58530
+ if (rectRef.value) {
58531
+ const { width: w, height: h7 } = window.getComputedStyle(rectRef.value);
58532
+ width.value = props.width || Math.round(parseFloat(w)) || 0;
58533
+ height.value = props.height || Math.round(parseFloat(h7)) || 0;
58534
+ }
58535
58535
  });
58536
- (0, import_vue_demi18.watch)([
58537
- wrapRect.width,
58538
- wrapRect.height,
58539
- () => nodes.value.length
58540
- ], ([w, h7]) => {
58541
- debug2("update size");
58542
- if (!w || !h7)
58543
- return;
58544
- width.value = w;
58545
- height.value = h7;
58546
- emit("update:width", w);
58547
- emit("update:height", h7);
58536
+ (0, import_vue_demi18.watch)([width, height, () => nodes.value.length], () => {
58548
58537
  runCorrect();
58549
- }, { immediate: true });
58538
+ });
58550
58539
  const selectedNodes = (0, import_vue_demi18.computed)(() => nodes.value.filter((node) => node.node.selected));
58551
58540
  const expandSize = (node) => {
58552
58541
  let expandWidth = props.autoExpand;
@@ -58696,14 +58685,16 @@ var FreeDomWrap = (0, import_vue_demi18.defineComponent)({
58696
58685
  const main = createRender(
58697
58686
  "section",
58698
58687
  {
58699
- ref: "rectRef",
58700
58688
  class: "vv-free-dom--scene",
58701
58689
  style: this.wrapStyle
58702
58690
  }
58703
58691
  )(slotList);
58704
58692
  const wrap = (comp) => createRender(
58705
58693
  "section",
58706
- {},
58694
+ {
58695
+ ref: "rectRef",
58696
+ style: "overflow: hidden;"
58697
+ },
58707
58698
  {},
58708
58699
  {
58709
58700
  onMousedown: this.mask.handleMousedown,
package/dist/index.mjs CHANGED
@@ -180,11 +180,11 @@ var require_common = __commonJS({
180
180
  let enableOverride = null;
181
181
  let namespacesCache;
182
182
  let enabledCache;
183
- function debug3(...args) {
184
- if (!debug3.enabled) {
183
+ function debug2(...args) {
184
+ if (!debug2.enabled) {
185
185
  return;
186
186
  }
187
- const self2 = debug3;
187
+ const self2 = debug2;
188
188
  const curr = Number(/* @__PURE__ */ new Date());
189
189
  const ms = curr - (prevTime || curr);
190
190
  self2.diff = ms;
@@ -214,12 +214,12 @@ var require_common = __commonJS({
214
214
  const logFn = self2.log || createDebug.log;
215
215
  logFn.apply(self2, args);
216
216
  }
217
- debug3.namespace = namespace;
218
- debug3.useColors = createDebug.useColors();
219
- debug3.color = createDebug.selectColor(namespace);
220
- debug3.extend = extend;
221
- debug3.destroy = createDebug.destroy;
222
- Object.defineProperty(debug3, "enabled", {
217
+ debug2.namespace = namespace;
218
+ debug2.useColors = createDebug.useColors();
219
+ debug2.color = createDebug.selectColor(namespace);
220
+ debug2.extend = extend;
221
+ debug2.destroy = createDebug.destroy;
222
+ Object.defineProperty(debug2, "enabled", {
223
223
  enumerable: true,
224
224
  configurable: false,
225
225
  get: () => {
@@ -237,9 +237,9 @@ var require_common = __commonJS({
237
237
  }
238
238
  });
239
239
  if (typeof createDebug.init === "function") {
240
- createDebug.init(debug3);
240
+ createDebug.init(debug2);
241
241
  }
242
- return debug3;
242
+ return debug2;
243
243
  }
244
244
  function extend(namespace, delimiter) {
245
245
  const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
@@ -764,11 +764,11 @@ var require_node = __commonJS({
764
764
  function load() {
765
765
  return process.env.DEBUG;
766
766
  }
767
- function init(debug3) {
768
- debug3.inspectOpts = {};
767
+ function init(debug2) {
768
+ debug2.inspectOpts = {};
769
769
  const keys = Object.keys(exports.inspectOpts);
770
770
  for (let i = 0; i < keys.length; i++) {
771
- debug3.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
771
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
772
772
  }
773
773
  }
774
774
  module.exports = require_common()(exports);
@@ -38171,7 +38171,7 @@ var require_runtime_core_cjs_prod = __commonJS({
38171
38171
  isUnmounting: false,
38172
38172
  leavingVNodes: /* @__PURE__ */ new Map()
38173
38173
  };
38174
- onMounted6(() => {
38174
+ onMounted7(() => {
38175
38175
  state2.isMounted = true;
38176
38176
  });
38177
38177
  onBeforeUnmount3(() => {
@@ -39490,7 +39490,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39490
39490
  }
39491
39491
  }
39492
39492
  };
39493
- onMounted6(cacheSubtree);
39493
+ onMounted7(cacheSubtree);
39494
39494
  onUpdated2(cacheSubtree);
39495
39495
  onBeforeUnmount3(() => {
39496
39496
  cache.forEach((cached) => {
@@ -39648,7 +39648,7 @@ var require_runtime_core_cjs_prod = __commonJS({
39648
39648
  }
39649
39649
  };
39650
39650
  var onBeforeMount2 = createHook("bm");
39651
- var onMounted6 = createHook("m");
39651
+ var onMounted7 = createHook("m");
39652
39652
  var onBeforeUpdate2 = createHook(
39653
39653
  "bu"
39654
39654
  );
@@ -40163,7 +40163,7 @@ var require_runtime_core_cjs_prod = __commonJS({
40163
40163
  }
40164
40164
  }
40165
40165
  registerLifecycleHook(onBeforeMount2, beforeMount);
40166
- registerLifecycleHook(onMounted6, mounted);
40166
+ registerLifecycleHook(onMounted7, mounted);
40167
40167
  registerLifecycleHook(onBeforeUpdate2, beforeUpdate);
40168
40168
  registerLifecycleHook(onUpdated2, updated);
40169
40169
  registerLifecycleHook(onActivated, activated);
@@ -42297,7 +42297,7 @@ var require_runtime_core_cjs_prod = __commonJS({
42297
42297
  return ctx;
42298
42298
  }
42299
42299
  };
42300
- function watchEffect7(effect, options) {
42300
+ function watchEffect6(effect, options) {
42301
42301
  return doWatch(effect, null, options);
42302
42302
  }
42303
42303
  function watchPostEffect(effect, options) {
@@ -44129,7 +44129,7 @@ var require_runtime_core_cjs_prod = __commonJS({
44129
44129
  exports.onBeforeUpdate = onBeforeUpdate2;
44130
44130
  exports.onDeactivated = onDeactivated;
44131
44131
  exports.onErrorCaptured = onErrorCaptured;
44132
- exports.onMounted = onMounted6;
44132
+ exports.onMounted = onMounted7;
44133
44133
  exports.onRenderTracked = onRenderTracked;
44134
44134
  exports.onRenderTriggered = onRenderTriggered;
44135
44135
  exports.onServerPrefetch = onServerPrefetch;
@@ -44165,7 +44165,7 @@ var require_runtime_core_cjs_prod = __commonJS({
44165
44165
  exports.version = version3;
44166
44166
  exports.warn = warn$1;
44167
44167
  exports.watch = watch8;
44168
- exports.watchEffect = watchEffect7;
44168
+ exports.watchEffect = watchEffect6;
44169
44169
  exports.watchPostEffect = watchPostEffect;
44170
44170
  exports.watchSyncEffect = watchSyncEffect;
44171
44171
  exports.withAsyncContext = withAsyncContext;
@@ -45301,7 +45301,7 @@ var require_runtime_core_cjs = __commonJS({
45301
45301
  isUnmounting: false,
45302
45302
  leavingVNodes: /* @__PURE__ */ new Map()
45303
45303
  };
45304
- onMounted6(() => {
45304
+ onMounted7(() => {
45305
45305
  state2.isMounted = true;
45306
45306
  });
45307
45307
  onBeforeUnmount3(() => {
@@ -46852,7 +46852,7 @@ Server rendered element contains fewer child nodes than client vdom.`
46852
46852
  }
46853
46853
  }
46854
46854
  };
46855
- onMounted6(cacheSubtree);
46855
+ onMounted7(cacheSubtree);
46856
46856
  onUpdated2(cacheSubtree);
46857
46857
  onBeforeUnmount3(() => {
46858
46858
  cache.forEach((cached) => {
@@ -47018,7 +47018,7 @@ Server rendered element contains fewer child nodes than client vdom.`
47018
47018
  }
47019
47019
  };
47020
47020
  var onBeforeMount2 = createHook("bm");
47021
- var onMounted6 = createHook("m");
47021
+ var onMounted7 = createHook("m");
47022
47022
  var onBeforeUpdate2 = createHook(
47023
47023
  "bu"
47024
47024
  );
@@ -47755,7 +47755,7 @@ If this is a native custom element, make sure to exclude it from component resol
47755
47755
  }
47756
47756
  }
47757
47757
  registerLifecycleHook(onBeforeMount2, beforeMount);
47758
- registerLifecycleHook(onMounted6, mounted);
47758
+ registerLifecycleHook(onMounted7, mounted);
47759
47759
  registerLifecycleHook(onBeforeUpdate2, beforeUpdate);
47760
47760
  registerLifecycleHook(onUpdated2, updated);
47761
47761
  registerLifecycleHook(onActivated, activated);
@@ -50303,7 +50303,7 @@ If you want to remount the same app, move your app creation logic into a factory
50303
50303
  return ctx;
50304
50304
  }
50305
50305
  };
50306
- function watchEffect7(effect, options) {
50306
+ function watchEffect6(effect, options) {
50307
50307
  return doWatch(effect, null, options);
50308
50308
  }
50309
50309
  function watchPostEffect(effect, options) {
@@ -52671,7 +52671,7 @@ Component that was made reactive: `,
52671
52671
  exports.onBeforeUpdate = onBeforeUpdate2;
52672
52672
  exports.onDeactivated = onDeactivated;
52673
52673
  exports.onErrorCaptured = onErrorCaptured;
52674
- exports.onMounted = onMounted6;
52674
+ exports.onMounted = onMounted7;
52675
52675
  exports.onRenderTracked = onRenderTracked;
52676
52676
  exports.onRenderTriggered = onRenderTriggered;
52677
52677
  exports.onServerPrefetch = onServerPrefetch;
@@ -52707,7 +52707,7 @@ Component that was made reactive: `,
52707
52707
  exports.version = version3;
52708
52708
  exports.warn = warn2;
52709
52709
  exports.watch = watch8;
52710
- exports.watchEffect = watchEffect7;
52710
+ exports.watchEffect = watchEffect6;
52711
52711
  exports.watchPostEffect = watchPostEffect;
52712
52712
  exports.watchSyncEffect = watchSyncEffect;
52713
52713
  exports.withAsyncContext = withAsyncContext;
@@ -56371,13 +56371,13 @@ var require_vue = __commonJS({
56371
56371
  import {
56372
56372
  computed as computed11,
56373
56373
  defineComponent as defineComponent6,
56374
+ onMounted as onMounted5,
56374
56375
  provide as provide2,
56375
56376
  reactive as reactive5,
56376
56377
  ref as ref13,
56377
56378
  shallowRef as shallowRef6,
56378
56379
  toRefs as toRefs2,
56379
- watch as watch6,
56380
- watchEffect as watchEffect6
56380
+ watch as watch6
56381
56381
  } from "vue-demi";
56382
56382
 
56383
56383
  // src/util/tokens.ts
@@ -57706,8 +57706,8 @@ function useMask(target, props, nodes, size) {
57706
57706
  return Math.max(a, c) - Math.min(b, d) <= -standard;
57707
57707
  }
57708
57708
  function offsetFormat(evt) {
57709
- const offsetX = evt.clientX - rect.x.value;
57710
- const offsetY = evt.clientY - rect.y.value;
57709
+ const offsetX = (evt.clientX - rect.x.value) / props.transformScale;
57710
+ const offsetY = (evt.clientY - rect.y.value) / props.transformScale;
57711
57711
  return {
57712
57712
  x: offsetX,
57713
57713
  y: offsetY
@@ -58469,8 +58469,6 @@ var freeDom = defineComponent5({
58469
58469
  var freeDom_default = freeDom;
58470
58470
 
58471
58471
  // src/components/freeDomWrap.ts
58472
- var import_debug2 = __toESM(require_src());
58473
- var debug2 = (0, import_debug2.default)("freeDom:wrap");
58474
58472
  var freeDomWrapProps = {
58475
58473
  diff: {
58476
58474
  type: Number,
@@ -58521,32 +58519,23 @@ var FreeDomWrap = defineComponent6({
58521
58519
  const eventBus = useEventBus();
58522
58520
  const nodes = ref13([]);
58523
58521
  const history = useOperateHistory(nodes);
58524
- const width = ref13(props.width);
58525
- const height = ref13(props.height);
58522
+ const width = ref13();
58523
+ const height = ref13();
58526
58524
  const rectRef = shallowRef6();
58527
- const wrapRect = useElementBounding(rectRef);
58528
58525
  const wrapStyle = computed11(() => ({
58529
58526
  height: height.value + "px",
58530
58527
  width: width.value + "px"
58531
58528
  }));
58532
- watchEffect6(() => {
58533
- width.value = props.width;
58534
- height.value = props.height;
58529
+ onMounted5(() => {
58530
+ if (rectRef.value) {
58531
+ const { width: w, height: h7 } = window.getComputedStyle(rectRef.value);
58532
+ width.value = props.width || Math.round(parseFloat(w)) || 0;
58533
+ height.value = props.height || Math.round(parseFloat(h7)) || 0;
58534
+ }
58535
58535
  });
58536
- watch6([
58537
- wrapRect.width,
58538
- wrapRect.height,
58539
- () => nodes.value.length
58540
- ], ([w, h7]) => {
58541
- debug2("update size");
58542
- if (!w || !h7)
58543
- return;
58544
- width.value = w;
58545
- height.value = h7;
58546
- emit("update:width", w);
58547
- emit("update:height", h7);
58536
+ watch6([width, height, () => nodes.value.length], () => {
58548
58537
  runCorrect();
58549
- }, { immediate: true });
58538
+ });
58550
58539
  const selectedNodes = computed11(() => nodes.value.filter((node) => node.node.selected));
58551
58540
  const expandSize = (node) => {
58552
58541
  let expandWidth = props.autoExpand;
@@ -58696,14 +58685,16 @@ var FreeDomWrap = defineComponent6({
58696
58685
  const main = createRender(
58697
58686
  "section",
58698
58687
  {
58699
- ref: "rectRef",
58700
58688
  class: "vv-free-dom--scene",
58701
58689
  style: this.wrapStyle
58702
58690
  }
58703
58691
  )(slotList);
58704
58692
  const wrap = (comp) => createRender(
58705
58693
  "section",
58706
- {},
58694
+ {
58695
+ ref: "rectRef",
58696
+ style: "overflow: hidden;"
58697
+ },
58707
58698
  {},
58708
58699
  {
58709
58700
  onMousedown: this.mask.handleMousedown,
@@ -58724,7 +58715,7 @@ var FreeDomWrap = defineComponent6({
58724
58715
  import { Fragment as Fragment2, defineComponent as defineComponent8, h as h6, provide as provide3, reactive as reactive6, ref as ref16, toRefs as toRefs3 } from "vue-demi";
58725
58716
 
58726
58717
  // src/components/gridItem.ts
58727
- import { defineComponent as defineComponent7, inject as inject5, onMounted as onMounted5, ref as ref14, watch as watch7 } from "vue-demi";
58718
+ import { defineComponent as defineComponent7, inject as inject5, onMounted as onMounted6, ref as ref14, watch as watch7 } from "vue-demi";
58728
58719
 
58729
58720
  // src/components/tokens.ts
58730
58721
  var gridLayoutContextKey = Symbol("gridLayoutContext");
@@ -58795,7 +58786,7 @@ var GridItem = defineComponent7({
58795
58786
  if (!layout) {
58796
58787
  throw new Error("TODO");
58797
58788
  }
58798
- onMounted5(() => {
58789
+ onMounted6(() => {
58799
58790
  moveDroppingItem();
58800
58791
  });
58801
58792
  watch7(() => props.droppingPosition, (currPos, prevPos) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sepveneto/free-dom",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",