@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,30 +1,43 @@
1
- import { ref, toValue, nextTick } from "vue";
1
+ import {
2
+ ref,
3
+ toRefs,
4
+ computed,
5
+ toValue,
6
+ nextTick
7
+ } from "vue";
2
8
  import { computedWithControl } from "@vueuse/core";
3
9
  import { interpolate } from "@maas/vue-equipment/utils";
4
10
  import { useMagicEmitter } from "@maas/vue-equipment/plugins";
5
11
  import { defu } from "defu";
12
+ import { useDraggableState } from "./useDraggableState.mjs";
6
13
  export function useDraggableSnap(args) {
14
+ const { id, animation, snapPoints } = args;
15
+ const { initializeState } = useDraggableState(toValue(id));
16
+ const state = initializeState();
7
17
  const {
8
- id,
9
- draggedX,
10
- draggedY,
11
18
  lastDraggedX,
12
19
  lastDraggedY,
20
+ draggedX,
21
+ draggedY,
13
22
  elRect,
14
23
  wrapperRect,
15
- animation,
16
- snapPoints
17
- } = args;
24
+ activeSnapPoint
25
+ } = toRefs(state);
18
26
  const interpolationIdX = ref(void 0);
19
27
  const interpolationIdY = ref(void 0);
20
- const activeSnapPoint = ref(void 0);
28
+ const mappedActiveSnapPoint = computed(() => {
29
+ if (!activeSnapPoint.value) {
30
+ return void 0;
31
+ }
32
+ return mapSnapPoint(activeSnapPoint.value);
33
+ });
21
34
  const mappedSnapPoints = computedWithControl(
22
35
  () => toValue(wrapperRect),
23
36
  () => {
24
37
  const mapped = toValue(snapPoints).map((snapPoint) => {
25
38
  return mapSnapPoint(snapPoint);
26
39
  }).filter((snapPoint) => snapPoint !== void 0);
27
- return mapped;
40
+ return mapped ?? [];
28
41
  }
29
42
  );
30
43
  const snapPointsMap = computedWithControl(
@@ -54,60 +67,65 @@ export function useDraggableSnap(args) {
54
67
  const mappedSnapPoint = typeof snapPoint === "string" ? [snapPoint] : snapPoint;
55
68
  const [position, offset] = mappedSnapPoint;
56
69
  const mappedOffset = defu(offset, { x: 0, y: 0 });
70
+ let x = 0;
71
+ let y = 0;
57
72
  switch (position) {
58
- case "top-left":
59
- return {
60
- x: mappedOffset.x,
61
- y: mappedOffset.y
62
- };
63
- case "top":
64
- return {
65
- x: wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2,
66
- y: mappedOffset.y
67
- };
68
- case "top-right":
69
- return {
70
- x: wrapperRect.value.width - mappedOffset.x - elRect.value.width,
71
- y: mappedOffset.y
72
- };
73
- case "left":
74
- return {
75
- x: mappedOffset.x,
76
- y: wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2
77
- };
78
- case "center":
79
- return {
80
- x: wrapperRect.value.width / 2 - elRect.value.width / 2 + mappedOffset.x,
81
- y: wrapperRect.value.height / 2 - elRect.value.height / 2 + mappedOffset.y
82
- };
83
- case "right":
84
- return {
85
- x: wrapperRect.value.width - mappedOffset.x - elRect.value.width,
86
- y: wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2
87
- };
88
- case "bottom-left":
89
- return {
90
- x: mappedOffset.x,
91
- y: wrapperRect.value.height + mappedOffset.y - elRect.value.height
92
- };
93
- case "bottom":
94
- return {
95
- x: wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2,
96
- y: wrapperRect.value.height - mappedOffset.y - elRect.value.height
97
- };
98
- case "bottom-right":
99
- return {
100
- x: wrapperRect.value.width - mappedOffset.x - elRect.value.width,
101
- y: wrapperRect.value.height - mappedOffset.y - elRect.value.height
102
- };
73
+ case "top-left": {
74
+ x = mappedOffset.x;
75
+ y = mappedOffset.y;
76
+ break;
77
+ }
78
+ case "top": {
79
+ x = wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2;
80
+ y = mappedOffset.y;
81
+ break;
82
+ }
83
+ case "top-right": {
84
+ x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
85
+ y = mappedOffset.y;
86
+ break;
87
+ }
88
+ case "left": {
89
+ x = mappedOffset.x;
90
+ y = wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2;
91
+ break;
92
+ }
93
+ case "center": {
94
+ x = wrapperRect.value.width / 2 - elRect.value.width / 2 + mappedOffset.x;
95
+ y = wrapperRect.value.height / 2 - elRect.value.height / 2 + mappedOffset.y;
96
+ break;
97
+ }
98
+ case "right": {
99
+ x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
100
+ y = wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2;
101
+ break;
102
+ }
103
+ case "bottom-left": {
104
+ x = mappedOffset.x;
105
+ y = wrapperRect.value.height + mappedOffset.y - elRect.value.height;
106
+ break;
107
+ }
108
+ case "bottom": {
109
+ x = wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2;
110
+ y = wrapperRect.value.height - mappedOffset.y - elRect.value.height;
111
+ break;
112
+ }
113
+ case "bottom-right": {
114
+ x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
115
+ y = wrapperRect.value.height - mappedOffset.y - elRect.value.height;
116
+ break;
117
+ }
103
118
  }
119
+ return { x: Math.round(x), y: Math.round(y) };
104
120
  }
105
121
  function cancelInterpolation() {
106
122
  if (interpolationIdY.value) {
107
123
  cancelAnimationFrame(interpolationIdY.value);
124
+ interpolationIdY.value = void 0;
108
125
  }
109
126
  if (interpolationIdX.value) {
110
127
  cancelAnimationFrame(interpolationIdX.value);
128
+ interpolationIdX.value = void 0;
111
129
  }
112
130
  }
113
131
  function interpolateDragged(args2) {
@@ -131,8 +149,8 @@ export function useDraggableSnap(args) {
131
149
  emitter.emit("afterSnap", { id: toValue(id), snapPoint });
132
150
  }
133
151
  if (draggedY.value === y) {
134
- lastDraggedX.value = draggedX.value;
135
- lastDraggedY.value = draggedY.value;
152
+ lastDraggedY.value = y;
153
+ interpolationIdY.value = void 0;
136
154
  }
137
155
  },
138
156
  interpolationIdCallback(id2) {
@@ -150,8 +168,8 @@ export function useDraggableSnap(args) {
150
168
  emitter.emit("afterSnap", { id: toValue(id), snapPoint });
151
169
  }
152
170
  if (draggedX.value === x) {
153
- lastDraggedX.value = draggedX.value;
154
- lastDraggedY.value = draggedY.value;
171
+ lastDraggedX.value = x;
172
+ interpolationIdX.value = void 0;
155
173
  }
156
174
  },
157
175
  interpolationIdCallback(id2) {
@@ -181,8 +199,8 @@ export function useDraggableSnap(args) {
181
199
  activeSnapPoint.value = snapPoint;
182
200
  }
183
201
  return {
202
+ mappedActiveSnapPoint,
184
203
  mappedSnapPoints,
185
- activeSnapPoint,
186
204
  snapPointsMap,
187
205
  mapSnapPoint,
188
206
  interpolateDragged,
@@ -16,7 +16,8 @@ export function useDraggableState(id) {
16
16
  draggedX: 0,
17
17
  draggedY: 0,
18
18
  elRect: void 0,
19
- wrapperRect: void 0
19
+ wrapperRect: void 0,
20
+ activeSnapPoint: void 0
20
21
  };
21
22
  return reactive(state);
22
23
  }
@@ -53,6 +53,7 @@ export interface DraggableState {
53
53
  draggedY: number;
54
54
  elRect: DOMRect | undefined;
55
55
  wrapperRect: DOMRect | undefined;
56
+ activeSnapPoint: DraggableSnapPoint | undefined;
56
57
  }
57
58
  export type DraggableEvents = {
58
59
  beforeSnap: {
@@ -101,14 +101,8 @@ const customDefu = createDefu((obj, key, value) => {
101
101
  }
102
102
  });
103
103
  const { options = {}, id } = defineProps({
104
- id: {
105
- type: null,
106
- required: true
107
- },
108
- options: {
109
- type: Object,
110
- required: false
111
- }
104
+ id: { type: null, required: true },
105
+ options: { type: Object, required: false }
112
106
  });
113
107
  const mappedOptions = customDefu(options, defaultOptions);
114
108
  const mappedId = toValue(id);
@@ -76,9 +76,6 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
76
76
  easing?: (t: number) => number;
77
77
  };
78
78
  });
79
- backdrop: boolean;
80
- tag: "div" | "dialog";
81
- focusTrap: boolean | import("focus-trap").Options;
82
79
  scrollLock: {
83
80
  padding: boolean;
84
81
  } | ((boolean | {
@@ -110,10 +107,6 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
110
107
  } & true, "padding"> & {
111
108
  padding: boolean;
112
109
  });
113
- teleport: {
114
- target?: string;
115
- disabled?: boolean;
116
- };
117
110
  keyListener: ({
118
111
  close?: string[] | false;
119
112
  } & import("../../../../utils/index.js").RequireAll<{
@@ -127,8 +120,15 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
127
120
  }>, "close"> & {
128
121
  close: (false | string[] | undefined) & (false | string[]);
129
122
  });
130
- position: "right" | "left" | "top" | "bottom";
123
+ position: "left" | "top" | "right" | "bottom";
124
+ backdrop: boolean;
125
+ tag: "div" | "dialog";
126
+ focusTrap: boolean | import("focus-trap").Options;
131
127
  snapPoints: import("../types/index.js").DrawerSnapPoint[];
128
+ teleport: {
129
+ target?: string;
130
+ disabled?: boolean;
131
+ };
132
132
  initial: {
133
133
  open?: boolean;
134
134
  transition?: boolean;
@@ -21,14 +21,8 @@ import { useTemplateRef, onMounted, onBeforeUnmount } from "vue";
21
21
  import { useMarqueeApi } from "../composables/private/useMarqueeApi";
22
22
  import { useMarqueeState } from "../composables/private/useMarqueeState";
23
23
  const { id, options } = defineProps({
24
- id: {
25
- type: null,
26
- required: true
27
- },
28
- options: {
29
- type: Object,
30
- required: false
31
- }
24
+ id: { type: null, required: true },
25
+ options: { type: Object, required: false }
32
26
  });
33
27
  const { deleteState, initializeState } = useMarqueeState(id);
34
28
  initializeState(options);
@@ -23,14 +23,8 @@ import {
23
23
  } from "../symbols";
24
24
  import { useMenuState } from "../composables/private/useMenuState";
25
25
  const { transition, id } = defineProps({
26
- id: {
27
- type: String,
28
- required: true
29
- },
30
- transition: {
31
- type: String,
32
- required: false
33
- }
26
+ id: { type: String, required: true },
27
+ transition: { type: String, required: false }
34
28
  });
35
29
  const instanceId = inject(MagicMenuInstanceId, void 0);
36
30
  const viewId = inject(MagicMenuViewId, void 0);
@@ -83,23 +83,10 @@ defineOptions({
83
83
  inheritAttrs: false
84
84
  });
85
85
  const { arrow = void 0, transition } = defineProps({
86
- arrow: {
87
- type: Boolean,
88
- required: false,
89
- skipCheck: true
90
- },
91
- middleware: {
92
- type: Array,
93
- required: false
94
- },
95
- transition: {
96
- type: String,
97
- required: false
98
- },
99
- referenceEl: {
100
- type: null,
101
- required: false
102
- }
86
+ arrow: { type: Boolean, required: false, skipCheck: true },
87
+ middleware: { type: Array, required: false },
88
+ transition: { type: String, required: false },
89
+ referenceEl: { type: null, required: false }
103
90
  });
104
91
  const instanceId = inject(MagicMenuInstanceId, void 0);
105
92
  const viewId = inject(MagicMenuViewId, void 0);
@@ -41,22 +41,10 @@ import { useMenuView } from "../composables/private/useMenuView";
41
41
  import { useMenuState } from "../composables/private/useMenuState";
42
42
  import { ModeFloatingStrategy } from "../utils/modeFloatingStrategyDefaults";
43
43
  const { placement, middleware, arrow, referenceEl } = defineProps({
44
- placement: {
45
- type: null,
46
- required: false
47
- },
48
- middleware: {
49
- type: Array,
50
- required: false
51
- },
52
- arrow: {
53
- type: Boolean,
54
- required: false
55
- },
56
- referenceEl: {
57
- type: null,
58
- required: false
59
- }
44
+ placement: { type: null, required: false },
45
+ middleware: { type: Array, required: false },
46
+ arrow: { type: Boolean, required: false },
47
+ referenceEl: { type: null, required: false }
60
48
  });
61
49
  const elRef = useTemplateRef("el");
62
50
  const arrowRef = useTemplateRef("arrow");
@@ -29,14 +29,8 @@ import {
29
29
  MagicMenuItemActive
30
30
  } from "../symbols";
31
31
  const { id, disabled } = defineProps({
32
- id: {
33
- type: String,
34
- required: false
35
- },
36
- disabled: {
37
- type: Boolean,
38
- required: false
39
- }
32
+ id: { type: String, required: false },
33
+ disabled: { type: Boolean, required: false }
40
34
  });
41
35
  const emit = defineEmits(["click"]);
42
36
  const instanceId = inject(MagicMenuInstanceId, void 0);
@@ -27,18 +27,9 @@ import { useMenuKeyListener } from "../composables/private/useMenuKeyListener";
27
27
  import { MagicMenuInstanceId } from "../symbols";
28
28
  import { defaultOptions } from "../utils/defaultOptions";
29
29
  const { id, options } = defineProps({
30
- id: {
31
- type: null,
32
- required: true
33
- },
34
- asChild: {
35
- type: Boolean,
36
- required: false
37
- },
38
- options: {
39
- type: Object,
40
- required: false
41
- }
30
+ id: { type: null, required: true },
31
+ asChild: { type: Boolean, required: false },
32
+ options: { type: Object, required: false }
42
33
  });
43
34
  const elRef = useTemplateRef("el");
44
35
  const mappedOptions = defu(options, defaultOptions);
@@ -20,30 +20,12 @@ import { useMenuChannel } from "../composables/private/useMenuChannel";
20
20
  import { MagicMenuInstanceId, MagicMenuViewId } from "../symbols";
21
21
  import { useMenuRemote } from "../composables/private/useMenuRemote";
22
22
  const { disabled, channelId, instanceId, viewId, trigger } = defineProps({
23
- channelId: {
24
- type: String,
25
- required: true
26
- },
27
- viewId: {
28
- type: String,
29
- required: false
30
- },
31
- instanceId: {
32
- type: String,
33
- required: false
34
- },
35
- disabled: {
36
- type: Boolean,
37
- required: false
38
- },
39
- trigger: {
40
- type: Array,
41
- required: false
42
- },
43
- asChild: {
44
- type: Boolean,
45
- required: false
46
- }
23
+ channelId: { type: String, required: true },
24
+ viewId: { type: String, required: false },
25
+ instanceId: { type: String, required: false },
26
+ disabled: { type: Boolean, required: false },
27
+ trigger: { type: Array, required: false },
28
+ asChild: { type: Boolean, required: false }
47
29
  });
48
30
  const injectedInstanceId = inject(MagicMenuInstanceId, instanceId);
49
31
  const injectedViewId = inject(MagicMenuViewId, viewId);
@@ -29,26 +29,11 @@ import {
29
29
  } from "../symbols";
30
30
  import { onKeyStroke } from "@vueuse/core";
31
31
  const { instanceId, viewId, disabled, trigger } = defineProps({
32
- instanceId: {
33
- type: String,
34
- required: false
35
- },
36
- viewId: {
37
- type: String,
38
- required: false
39
- },
40
- disabled: {
41
- type: Boolean,
42
- required: false
43
- },
44
- trigger: {
45
- type: Array,
46
- required: false
47
- },
48
- asChild: {
49
- type: Boolean,
50
- required: false
51
- }
32
+ instanceId: { type: String, required: false },
33
+ viewId: { type: String, required: false },
34
+ disabled: { type: Boolean, required: false },
35
+ trigger: { type: Array, required: false },
36
+ asChild: { type: Boolean, required: false }
52
37
  });
53
38
  const elRef = useTemplateRef("el");
54
39
  const injectedInstanceId = inject(MagicMenuInstanceId, void 0);
@@ -16,14 +16,8 @@ import {
16
16
  } from "../symbols";
17
17
  import { useMenuState } from "../composables/private/useMenuState";
18
18
  const { id, placement } = defineProps({
19
- id: {
20
- type: String,
21
- required: false
22
- },
23
- placement: {
24
- type: null,
25
- required: false
26
- }
19
+ id: { type: String, required: false },
20
+ placement: { type: null, required: false }
27
21
  });
28
22
  const parentTree = inject(MagicMenuParentTree, []);
29
23
  const instanceId = inject(MagicMenuInstanceId, void 0);
@@ -74,18 +74,9 @@ const customDefu = createDefu((obj, key, value) => {
74
74
  }
75
75
  });
76
76
  const { id, options = {} } = defineProps({
77
- id: {
78
- type: null,
79
- required: true
80
- },
81
- props: {
82
- type: Object,
83
- required: false
84
- },
85
- options: {
86
- type: Object,
87
- required: false
88
- }
77
+ id: { type: null, required: true },
78
+ props: { type: Object, required: false },
79
+ options: { type: Object, required: false }
89
80
  });
90
81
  const mappedOptions = customDefu(options, defaultOptions);
91
82
  const mappedId = toValue(id);
@@ -12,19 +12,19 @@ declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> &
12
12
  content?: string;
13
13
  backdrop?: string;
14
14
  };
15
- backdrop: boolean;
16
- tag: "div" | "dialog";
17
- focusTrap: boolean | import("focus-trap").Options;
18
15
  scrollLock: boolean | {
19
16
  padding: boolean;
20
17
  };
18
+ keyListener: {
19
+ close?: string[] | false;
20
+ };
21
+ backdrop: boolean;
22
+ tag: "div" | "dialog";
23
+ focusTrap: boolean | import("focus-trap").Options;
21
24
  teleport: {
22
25
  target?: string;
23
26
  disabled?: boolean;
24
27
  };
25
- keyListener: {
26
- close?: string[] | false;
27
- };
28
28
  };
29
29
  declare const mappedId: string;
30
30
  declare const close: () => void;
@@ -12,14 +12,8 @@ import { onMounted, onUnmounted, watch, useTemplateRef } from "vue";
12
12
  import { useResizeObserver, useDebounceFn } from "@vueuse/core";
13
13
  import { useNoiseApi } from "../composables/private/useNoiseApi";
14
14
  const { pause = false, options } = defineProps({
15
- options: {
16
- type: Object,
17
- required: false
18
- },
19
- pause: {
20
- type: Boolean,
21
- required: false
22
- }
15
+ options: { type: Object, required: false },
16
+ pause: { type: Boolean, required: false }
23
17
  });
24
18
  const canvasRef = useTemplateRef("canvas");
25
19
  const offCanvasRef = useTemplateRef("offCanvas");
@@ -20,14 +20,8 @@
20
20
  import { computed, toRefs, onBeforeUnmount } from "vue";
21
21
  import { usePieState } from "../composables/private/usePieState";
22
22
  const { id, options } = defineProps({
23
- id: {
24
- type: String,
25
- required: true
26
- },
27
- options: {
28
- type: Object,
29
- required: false
30
- }
23
+ id: { type: String, required: true },
24
+ options: { type: Object, required: false }
31
25
  });
32
26
  const { initializeState, deleteState } = usePieState(id);
33
27
  const state = initializeState();
@@ -73,10 +73,7 @@ import {
73
73
  MagicPlayerBarRef
74
74
  } from "../symbols";
75
75
  const { instanceId } = defineProps({
76
- instanceId: {
77
- type: String,
78
- required: false
79
- }
76
+ instanceId: { type: String, required: false }
80
77
  });
81
78
  const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
82
79
  const mappedInstanceId = computed(() => instanceId ?? injectedInstanceId);
@@ -10,10 +10,7 @@ import { formatTime } from "@maas/vue-equipment/utils";
10
10
  import { usePlayerState } from "../composables/private/usePlayerState";
11
11
  import { MagicPlayerInstanceId } from "../symbols";
12
12
  const { type = "current" } = defineProps({
13
- type: {
14
- type: String,
15
- required: false
16
- }
13
+ type: { type: String, required: false }
17
14
  });
18
15
  const instanceId = inject(MagicPlayerInstanceId);
19
16
  if (!instanceId) {
@@ -28,10 +28,7 @@ import { useDevicePixelRatio } from "@vueuse/core";
28
28
  import { usePlayerState } from "../composables/private/usePlayerState";
29
29
  import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
30
30
  const { playbackId } = defineProps({
31
- playbackId: {
32
- type: String,
33
- required: false
34
- }
31
+ playbackId: { type: String, required: false }
35
32
  });
36
33
  const instanceId = inject(MagicPlayerInstanceId, void 0);
37
34
  const injectedOptions = inject(MagicPlayerOptionsKey, void 0);
@@ -25,14 +25,8 @@ import { usePlayerState } from "../composables/private/usePlayerState";
25
25
  import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
26
26
  import { defaultOptions } from "../utils/defaultOptions";
27
27
  const { id, options } = defineProps({
28
- id: {
29
- type: null,
30
- required: true
31
- },
32
- options: {
33
- type: Object,
34
- required: false
35
- }
28
+ id: { type: null, required: true },
29
+ options: { type: Object, required: false }
36
30
  });
37
31
  const mappedOptions = defu(options, defaultOptions);
38
32
  const { initializeState, deleteState } = usePlayerState(id);
@@ -108,18 +108,9 @@ const {
108
108
  standalone = false,
109
109
  transition
110
110
  } = defineProps({
111
- id: {
112
- type: String,
113
- required: false
114
- },
115
- standalone: {
116
- type: Boolean,
117
- required: false
118
- },
119
- transition: {
120
- type: String,
121
- required: false
122
- }
111
+ id: { type: String, required: false },
112
+ standalone: { type: Boolean, required: false },
113
+ transition: { type: String, required: false }
123
114
  });
124
115
  const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
125
116
  const mappedInstanceId = computed(() => id ?? injectedInstanceId);
@@ -14,6 +14,7 @@ export declare function useMagicPlayer(id: MaybeRef<string>): {
14
14
  touched: import("vue").Ref<boolean, boolean>;
15
15
  dragging: import("vue").Ref<boolean, boolean>;
16
16
  isFullscreen: import("vue").Ref<boolean, boolean>;
17
+ currentTime: import("vue").Ref<number, number>;
17
18
  seekedTime: import("vue").Ref<number, number>;
18
19
  seekedPercentage: import("vue").Ref<number, number>;
19
20
  scrubbedPercentage: import("vue").Ref<number, number>;