@maas/vue-equipment 1.0.0-beta.16 → 1.0.0-beta.18

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.
Files changed (53) hide show
  1. package/dist/nuxt/module.json +2 -2
  2. package/dist/nuxt/types.d.mts +2 -6
  3. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +3 -12
  4. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +3 -12
  5. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +4 -16
  6. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +3 -12
  7. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +1 -4
  8. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +3 -12
  9. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +1 -4
  10. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +3 -12
  11. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -24
  12. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -8
  13. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +3 -12
  14. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +2 -8
  15. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +12 -9
  16. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +1 -1
  17. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +38 -61
  18. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -17
  19. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +77 -59
  20. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +2 -1
  21. package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -0
  22. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +2 -8
  23. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +8 -8
  24. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +2 -8
  25. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +2 -8
  26. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +4 -17
  27. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +4 -16
  28. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +2 -8
  29. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +3 -12
  30. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +6 -24
  31. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +5 -20
  32. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -8
  33. package/dist/plugins/MagicModal/src/components/MagicModal.vue +3 -12
  34. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +6 -6
  35. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +2 -8
  36. package/dist/plugins/MagicPie/src/components/MagicPie.vue +2 -8
  37. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +1 -4
  38. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +1 -4
  39. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +1 -4
  40. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +2 -8
  41. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +3 -12
  42. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +1 -0
  43. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +2 -0
  44. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +2 -8
  45. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +3 -12
  46. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +1 -4
  47. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +2 -8
  48. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +2 -8
  49. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +2 -8
  50. package/package.json +2 -2
  51. package/dist/nuxt/module.cjs +0 -5
  52. package/dist/nuxt/module.d.ts +0 -10
  53. package/dist/nuxt/types.d.ts +0 -7
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "1.0.0-beta.15",
4
+ "version": "1.0.0-beta.17",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.4",
6
+ "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
@@ -1,7 +1,3 @@
1
- import type { NuxtModule } from '@nuxt/schema'
1
+ export { default } from './module.mjs'
2
2
 
3
- import type { default as Module } from './module.js'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { default } from './module.js'
3
+ export { type ModuleOptions } from './module.mjs'
@@ -39,18 +39,9 @@ import "@maas/vue-equipment/utils/css/animations/fade-in.css";
39
39
  import "@maas/vue-equipment/utils/css/animations/auto-size-out.css";
40
40
  import "@maas/vue-equipment/utils/css/easings.css";
41
41
  const { transition, animation } = defineProps({
42
- asChild: {
43
- type: Boolean,
44
- required: false
45
- },
46
- transition: {
47
- type: String,
48
- required: false
49
- },
50
- animation: {
51
- type: Object,
52
- required: false
53
- }
42
+ asChild: { type: Boolean, required: false },
43
+ transition: { type: String, required: false },
44
+ animation: { type: Object, required: false }
54
45
  });
55
46
  const instanceId = inject(MagicAccordionInstanceId, void 0);
56
47
  const viewId = inject(MagicAccordionViewId, void 0);
@@ -10,18 +10,9 @@ import { Primitive } from "@maas/vue-primitive";
10
10
  import { MagicAccordionInstanceId } from "../symbols";
11
11
  import { useAccordionState } from "../composables/private/useAccordionState";
12
12
  const { id, asChild, options } = defineProps({
13
- id: {
14
- type: null,
15
- required: true
16
- },
17
- asChild: {
18
- type: Boolean,
19
- required: false
20
- },
21
- options: {
22
- type: Object,
23
- required: false
24
- }
13
+ id: { type: null, required: true },
14
+ asChild: { type: Boolean, required: false },
15
+ options: { type: Object, required: false }
25
16
  });
26
17
  const { deleteState, initializeState } = useAccordionState(id);
27
18
  initializeState(options);
@@ -27,22 +27,10 @@ const {
27
27
  trigger = "click",
28
28
  asChild = false
29
29
  } = defineProps({
30
- viewId: {
31
- type: String,
32
- required: false
33
- },
34
- disabled: {
35
- type: null,
36
- required: false
37
- },
38
- trigger: {
39
- type: String,
40
- required: false
41
- },
42
- asChild: {
43
- type: Boolean,
44
- required: false
45
- }
30
+ viewId: { type: String, required: false },
31
+ disabled: { type: null, required: false },
32
+ trigger: { type: String, required: false },
33
+ asChild: { type: Boolean, required: false }
46
34
  });
47
35
  const elRef = useTemplateRef("el");
48
36
  const instanceId = inject(MagicAccordionInstanceId, void 0);
@@ -19,18 +19,9 @@ import {
19
19
  } from "../symbols";
20
20
  import { useAccordionView } from "../composables/private/useAccordionView";
21
21
  const { id, active } = defineProps({
22
- id: {
23
- type: String,
24
- required: false
25
- },
26
- asChild: {
27
- type: Boolean,
28
- required: false
29
- },
30
- active: {
31
- type: Boolean,
32
- required: false
33
- }
22
+ id: { type: String, required: false },
23
+ asChild: { type: Boolean, required: false },
24
+ active: { type: Boolean, required: false }
34
25
  });
35
26
  const instanceId = inject(MagicAccordionInstanceId, void 0);
36
27
  if (!instanceId) {
@@ -21,10 +21,7 @@ defineOptions({
21
21
  inheritAttrs: false
22
22
  });
23
23
  defineProps({
24
- options: {
25
- type: null,
26
- required: false
27
- }
24
+ options: { type: null, required: false }
28
25
  });
29
26
  const instanceId = inject(MagicCommandInstanceId, "");
30
27
  const emitter = useMagicEmitter();
@@ -39,18 +39,9 @@ const {
39
39
  initial = false,
40
40
  disabled = false
41
41
  } = defineProps({
42
- id: {
43
- type: String,
44
- required: false
45
- },
46
- initial: {
47
- type: Boolean,
48
- required: false
49
- },
50
- disabled: {
51
- type: Boolean,
52
- required: false
53
- }
42
+ id: { type: String, required: false },
43
+ initial: { type: Boolean, required: false },
44
+ disabled: { type: Boolean, required: false }
54
45
  });
55
46
  const emit = defineEmits(["click"]);
56
47
  const instanceId = inject(MagicCommandInstanceId, void 0);
@@ -21,10 +21,7 @@ defineOptions({
21
21
  inheritAttrs: false
22
22
  });
23
23
  defineProps({
24
- options: {
25
- type: null,
26
- required: false
27
- }
24
+ options: { type: null, required: false }
28
25
  });
29
26
  const instanceId = inject(MagicCommandInstanceId, "");
30
27
  const emitter = useMagicEmitter();
@@ -14,18 +14,9 @@ import { useMagicCommand } from "../composables/useMagicCommand";
14
14
  import { defaultOptions } from "../utils/defaultOptions";
15
15
  import { MagicCommandInstanceId, MagicCommandProviderOptions } from "../symbols";
16
16
  const { id, options = {} } = defineProps({
17
- id: {
18
- type: null,
19
- required: true
20
- },
21
- asChild: {
22
- type: Boolean,
23
- required: false
24
- },
25
- options: {
26
- type: Object,
27
- required: false
28
- }
17
+ id: { type: null, required: true },
18
+ asChild: { type: Boolean, required: false },
19
+ options: { type: Object, required: false }
29
20
  });
30
21
  const customDefu = createDefu((obj, key, value) => {
31
22
  if (key === "open" || key === "close" || key === "next" || key === "prev") {
@@ -33,30 +33,12 @@ const {
33
33
  action = "open",
34
34
  trigger = ["click"]
35
35
  } = defineProps({
36
- viewId: {
37
- type: String,
38
- required: false
39
- },
40
- active: {
41
- type: Boolean,
42
- required: false
43
- },
44
- disabled: {
45
- type: Boolean,
46
- required: false
47
- },
48
- action: {
49
- type: String,
50
- required: false
51
- },
52
- trigger: {
53
- type: Array,
54
- required: false
55
- },
56
- asChild: {
57
- type: Boolean,
58
- required: false
59
- }
36
+ viewId: { type: String, required: false },
37
+ active: { type: Boolean, required: false },
38
+ disabled: { type: Boolean, required: false },
39
+ action: { type: String, required: false },
40
+ trigger: { type: Array, required: false },
41
+ asChild: { type: Boolean, required: false }
60
42
  });
61
43
  const elRef = useTemplateRef("el");
62
44
  const instanceId = inject(MagicCommandInstanceId, void 0);
@@ -15,14 +15,8 @@ import {
15
15
  MagicCommandViewActive
16
16
  } from "../symbols";
17
17
  const { id, initial = false } = defineProps({
18
- id: {
19
- type: String,
20
- required: false
21
- },
22
- initial: {
23
- type: Boolean,
24
- required: false
25
- }
18
+ id: { type: String, required: false },
19
+ initial: { type: Boolean, required: false }
26
20
  });
27
21
  const parentTree = inject(MagicCommandParentTree, []);
28
22
  const instanceId = inject(MagicCommandInstanceId, void 0);
@@ -17,18 +17,9 @@ import {
17
17
  MagicCookieItemActive
18
18
  } from "../symbols";
19
19
  const { id, optional, maxAge } = defineProps({
20
- id: {
21
- type: String,
22
- required: false
23
- },
24
- optional: {
25
- type: Boolean,
26
- required: false
27
- },
28
- maxAge: {
29
- type: Number,
30
- required: false
31
- }
20
+ id: { type: String, required: false },
21
+ optional: { type: Boolean, required: false },
22
+ maxAge: { type: Number, required: false }
32
23
  });
33
24
  const instanceId = inject(MagicCookieInstanceId, void 0);
34
25
  if (!instanceId) {
@@ -16,14 +16,8 @@ defineOptions({
16
16
  inheritAttrs: false
17
17
  });
18
18
  const { id, options } = defineProps({
19
- id: {
20
- type: null,
21
- required: true
22
- },
23
- options: {
24
- type: Object,
25
- required: false
26
- }
19
+ id: { type: null, required: true },
20
+ options: { type: Object, required: false }
27
21
  });
28
22
  const mappedOptions = defu(options, defaultOptions);
29
23
  const { initializeState } = useCookieState(id);
@@ -24,7 +24,7 @@
24
24
 
25
25
  <script setup>
26
26
  import { useTemplateRef, computed, toValue, toRefs } from "vue";
27
- import { defu } from "defu";
27
+ import { createDefu } from "defu";
28
28
  import { useDraggableDrag } from "../composables/private/useDraggableDrag";
29
29
  import { useDraggableState } from "../composables/private/useDraggableState";
30
30
  import { defaultOptions } from "../utils/defaultOptions";
@@ -32,17 +32,20 @@ defineOptions({
32
32
  inheritAttrs: false
33
33
  });
34
34
  const { id, options = {} } = defineProps({
35
- id: {
36
- type: null,
37
- required: true
38
- },
39
- options: {
40
- type: Object,
41
- required: false
35
+ id: { type: null, required: true },
36
+ options: { type: Object, required: false }
37
+ });
38
+ const customDefu = createDefu((obj, key, value) => {
39
+ if (key === "snapPoints") {
40
+ obj[key] = value;
41
+ return true;
42
42
  }
43
43
  });
44
- const mappedOptions = defu(options, defaultOptions);
44
+ const mappedOptions = customDefu(options, defaultOptions);
45
45
  const mappedId = toValue(id);
46
+ if (!mappedOptions.snapPoints.length) {
47
+ throw new Error("MagicDraggable must have at least one snap point set");
48
+ }
46
49
  const elRef = useTemplateRef("el");
47
50
  const wrapperRef = useTemplateRef("wrapper");
48
51
  const { initializeState } = useDraggableState(id);
@@ -68,10 +68,10 @@ declare const mappedOptions: Omit<MagicDraggableOptions, keyof MagicDraggableOpt
68
68
  easing?: (t: number) => number;
69
69
  };
70
70
  });
71
- tag: "div" | "dialog";
72
71
  scrollLock: boolean | {
73
72
  padding: boolean;
74
73
  };
74
+ tag: "div" | "dialog";
75
75
  snapPoints: import("../types/index.js").DraggableSnapPoint[];
76
76
  initial: {
77
77
  snapPoint?: import("../types/index.js").DraggableSnapPoint;
@@ -53,7 +53,8 @@ export function useDraggableDrag(args) {
53
53
  draggedX,
54
54
  draggedY,
55
55
  elRect,
56
- wrapperRect
56
+ wrapperRect,
57
+ activeSnapPoint
57
58
  } = toRefs(state);
58
59
  let cancelPointerup = void 0;
59
60
  let cancelPointermove = void 0;
@@ -78,21 +79,15 @@ export function useDraggableDrag(args) {
78
79
  });
79
80
  const {
80
81
  snapTo,
81
- activeSnapPoint,
82
+ mappedActiveSnapPoint,
82
83
  mapSnapPoint,
83
84
  mappedSnapPoints,
84
85
  snapPointsMap,
85
86
  interpolateDragged
86
87
  } = useDraggableSnap({
87
88
  id,
88
- elRect,
89
- wrapperRect,
90
89
  animation,
91
- snapPoints,
92
- draggedX,
93
- draggedY,
94
- lastDraggedX,
95
- lastDraggedY
90
+ snapPoints
96
91
  });
97
92
  const emitter = useMagicEmitter();
98
93
  const {
@@ -101,10 +96,9 @@ export function useDraggableDrag(args) {
101
96
  addScrollLockPadding,
102
97
  removeScrollLockPadding
103
98
  } = useDraggableScrollLock();
104
- async function getSizes() {
99
+ function getSizes() {
105
100
  elRect.value = unrefElement(elRef)?.getBoundingClientRect();
106
101
  wrapperRect.value = unrefElement(wrapperRef)?.getBoundingClientRect();
107
- await nextTick();
108
102
  }
109
103
  function setDragged({ x, y }) {
110
104
  draggedX.value = x - originX.value;
@@ -128,33 +122,18 @@ export function useDraggableDrag(args) {
128
122
  });
129
123
  }
130
124
  }
131
- function detectCollision() {
125
+ async function checkSizes() {
126
+ getSizes();
132
127
  const childRect = toValue(elRect);
133
128
  const parentRect = toValue(wrapperRect);
134
129
  if (!childRect || !parentRect) {
130
+ console.warn("MagicDraggable could not calculate sizing");
135
131
  return;
136
132
  }
137
133
  if (childRect.width > parentRect.width || childRect.height > parentRect.height) {
138
134
  console.warn("MagicDraggable is too small for its content");
139
135
  return;
140
136
  }
141
- interpolateTo.value = { x: draggedX.value, y: draggedY.value };
142
- if (childRect.top < parentRect.top) {
143
- interpolateTo.value = { x: interpolateTo.value?.x, y: 0 };
144
- } else if (childRect.bottom > parentRect.bottom) {
145
- interpolateTo.value = {
146
- x: interpolateTo.value?.x,
147
- y: parentRect.height - childRect.height
148
- };
149
- }
150
- if (childRect.left < parentRect.left) {
151
- interpolateTo.value = { x: 0, y: interpolateTo.value?.y };
152
- } else if (childRect.right > parentRect.right) {
153
- interpolateTo.value = {
154
- x: parentRect.width - childRect.width,
155
- y: interpolateTo.value?.y
156
- };
157
- }
158
137
  }
159
138
  function vectorBetweenCoordinates(a, b) {
160
139
  const dx = b.x - a.x;
@@ -255,9 +234,18 @@ export function useDraggableDrag(args) {
255
234
  const draggedCoords = { x: draggedX.value, y: draggedY.value };
256
235
  const closestSnapPoint = mappedSnapPoints.value.reduce((a, b) => {
257
236
  return calculateDistance(a, draggedCoords) < calculateDistance(b, draggedCoords) ? a : b;
258
- });
237
+ }, mappedSnapPoints.value[0]);
259
238
  return closestSnapPoint;
260
239
  }
240
+ function onIdle() {
241
+ interpolateTo.value = findClosestSnapPoint();
242
+ if (distanceThresholdReached.value && momentumThresholdReached.value) {
243
+ intermediateDraggedX.value = draggedX.value;
244
+ intermediateDraggedY.value = draggedY.value;
245
+ distanceThresholdReached.value = false;
246
+ momentumThresholdReached.value = false;
247
+ }
248
+ }
261
249
  function onPointerup(e) {
262
250
  if (!momentumThresholdReached.value && distanceThresholdReached.value) {
263
251
  interpolateTo.value = findClosestSnapPoint();
@@ -265,9 +253,7 @@ export function useDraggableDrag(args) {
265
253
  const { x, y } = interpolateTo.value || {};
266
254
  if (x !== void 0 && y !== void 0) {
267
255
  interpolateDragged({ x, y });
268
- }
269
- if (interpolateTo.value) {
270
- const key = `x${interpolateTo.value.x}y${interpolateTo.value.y}`;
256
+ const key = `x${x}y${y}`;
271
257
  activeSnapPoint.value = snapPointsMap.value[key];
272
258
  }
273
259
  if (intermediateDraggedX.value === draggedX.value && intermediateDraggedY.value === draggedY.value) {
@@ -293,13 +279,11 @@ export function useDraggableDrag(args) {
293
279
  }
294
280
  guardedReleasePointerCapture({ event: e, element: elRef.value });
295
281
  }
296
- function onPointermove(e) {
282
+ async function onPointermove(e) {
297
283
  if (!e.isPrimary) {
298
284
  return;
299
285
  }
300
286
  setDragged({ x: e.screenX, y: e.screenY });
301
- getSizes();
302
- detectCollision();
303
287
  if (!distanceThresholdReached.value) {
304
288
  checkDistance();
305
289
  }
@@ -307,27 +291,20 @@ export function useDraggableDrag(args) {
307
291
  checkMomentum();
308
292
  }
309
293
  if (!distanceThresholdReached.value && !momentumThresholdReached.value) {
310
- interpolateTo.value = { x: lastDraggedX.value, y: lastDraggedY.value };
294
+ const { x, y } = mappedActiveSnapPoint.value ?? {};
295
+ if (x !== void 0 && y !== void 0) {
296
+ interpolateTo.value = { x, y };
297
+ console.log("G", interpolateTo.value);
298
+ }
311
299
  return;
312
300
  }
313
- if (toValue(snapPoints).length) {
314
- findSnapPointByVector();
315
- }
301
+ findSnapPointByVector();
316
302
  emitter.emit("drag", {
317
303
  id: toValue(id),
318
304
  x: draggedX.value,
319
305
  y: draggedY.value
320
306
  });
321
307
  }
322
- function onIdle() {
323
- interpolateTo.value = findClosestSnapPoint();
324
- if (distanceThresholdReached.value && momentumThresholdReached.value) {
325
- intermediateDraggedX.value = draggedX.value;
326
- intermediateDraggedY.value = draggedY.value;
327
- distanceThresholdReached.value = false;
328
- momentumThresholdReached.value = false;
329
- }
330
- }
331
308
  function onPointerdown(e) {
332
309
  const scrollLockValue = toValue(scrollLock);
333
310
  if (scrollLockValue) {
@@ -338,19 +315,21 @@ export function useDraggableDrag(args) {
338
315
  }
339
316
  if (dragging.value) {
340
317
  return;
341
- } else {
342
- guardedSetPointerCapture({ event: e, element: elRef.value });
343
- dragging.value = true;
344
- emitter.emit("beforeDrag", {
345
- id: toValue(id),
346
- x: draggedX.value,
347
- y: draggedY.value
348
- });
349
318
  }
319
+ checkSizes();
320
+ guardedSetPointerCapture({ event: e, element: elRef.value });
321
+ dragging.value = true;
322
+ emitter.emit("beforeDrag", {
323
+ id: toValue(id),
324
+ x: draggedX.value,
325
+ y: draggedY.value
326
+ });
350
327
  intermediateDraggedX.value = draggedX.value;
351
328
  intermediateDraggedY.value = draggedY.value;
352
329
  lastDraggedX.value = draggedX.value;
353
330
  lastDraggedY.value = draggedY.value;
331
+ originX.value = e.screenX - draggedX.value;
332
+ originY.value = e.screenY - draggedY.value;
354
333
  cancelPointerup = useEventListener(document, "pointerup", onPointerup);
355
334
  cancelPointermove = useEventListener(
356
335
  document,
@@ -359,8 +338,6 @@ export function useDraggableDrag(args) {
359
338
  { passive: false }
360
339
  );
361
340
  cancelTouchend = isIOS() ? useEventListener(document, "touchend", onPointerup) : void 0;
362
- originX.value = e.screenX - draggedX.value;
363
- originY.value = e.screenY - draggedY.value;
364
341
  dragStart.value = /* @__PURE__ */ new Date();
365
342
  onPointermove(e);
366
343
  }
@@ -396,7 +373,7 @@ export function useDraggableDrag(args) {
396
373
  });
397
374
  useResizeObserver(wrapperRef, async () => {
398
375
  useThrottleFn(async () => {
399
- await getSizes();
376
+ getSizes();
400
377
  if (activeSnapPoint.value) {
401
378
  await snapTo({ snapPoint: activeSnapPoint.value, interpolate: false });
402
379
  snapPointsMap.trigger();
@@ -406,7 +383,7 @@ export function useDraggableDrag(args) {
406
383
  });
407
384
  useResizeObserver(elRef, async () => {
408
385
  useThrottleFn(async () => {
409
- await getSizes();
386
+ getSizes();
410
387
  if (activeSnapPoint.value) {
411
388
  await snapTo({ snapPoint: activeSnapPoint.value, interpolate: false });
412
389
  snapPointsMap.trigger();
@@ -1,13 +1,7 @@
1
- import { type MaybeRef, type Ref } from 'vue';
1
+ import { type MaybeRef } from 'vue';
2
2
  import type { DraggableSnapPoint, Coordinates, DraggableDefaultOptions } from '../../types/index.js';
3
3
  type UseDraggableSnapArgs = {
4
4
  id: MaybeRef<string>;
5
- elRect: Ref<DOMRect | undefined>;
6
- wrapperRect: Ref<DOMRect | undefined>;
7
- draggedX: Ref<number>;
8
- draggedY: Ref<number>;
9
- lastDraggedX: Ref<number>;
10
- lastDraggedY: Ref<number>;
11
5
  animation: MaybeRef<DraggableDefaultOptions['animation']>;
12
6
  snapPoints: MaybeRef<DraggableDefaultOptions['snapPoints']>;
13
7
  };
@@ -23,17 +17,8 @@ type SnapToArgs = {
23
17
  duration?: number;
24
18
  };
25
19
  export declare function useDraggableSnap(args: UseDraggableSnapArgs): {
20
+ mappedActiveSnapPoint: import("vue").ComputedRef<Coordinates | undefined>;
26
21
  mappedSnapPoints: import("@vueuse/core").ComputedRefWithControl<Coordinates[]>;
27
- activeSnapPoint: Ref<("center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
28
- x?: number | undefined;
29
- y?: number | undefined;
30
- } | undefined] | undefined, "center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
31
- x?: number;
32
- y?: number;
33
- } | undefined] | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
34
- x?: number | undefined;
35
- y?: number | undefined;
36
- } | undefined] | undefined>;
37
22
  snapPointsMap: import("@vueuse/core").ComputedRefWithControl<Record<string, DraggableSnapPoint>>;
38
23
  mapSnapPoint: (snapPoint: DraggableSnapPoint) => Coordinates | undefined;
39
24
  interpolateDragged: (args: InterpolateDraggedArgs) => void;