@maas/vue-equipment 1.0.0-beta.35 → 1.0.0-beta.36
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/composables/useScrollTo/index.js +6 -2
- package/dist/composables/useScrollTo/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -2
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +1 -1
- package/dist/plugins/.turbo/turbo-lint.log +2 -93
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +5 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +13 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +17 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +7 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +3 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +25 -11
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +3 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +0 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +55 -21
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerUtils.mjs +21 -8
- package/dist/plugins/MagicError/package.json +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +4 -3
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +3 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +3 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +6 -2
- package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +1 -1
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +7 -3
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +1 -1
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +3 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +3 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +3 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +22 -30
|
@@ -8,7 +8,7 @@ declare var __VLS_12: {};
|
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
default?: (props: typeof __VLS_12) => any;
|
|
10
10
|
};
|
|
11
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicDraggableProps,
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicDraggableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDraggableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
13
|
export default _default;
|
|
14
14
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -15,7 +15,9 @@ export function useDraggableScrollLock() {
|
|
|
15
15
|
scrollLock.value = false;
|
|
16
16
|
}
|
|
17
17
|
function addScrollLockPadding() {
|
|
18
|
-
if (typeof window === "undefined")
|
|
18
|
+
if (typeof window === "undefined") {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
19
21
|
const exclude = new RegExp(/magic-draggable/);
|
|
20
22
|
document.body.style.setProperty(
|
|
21
23
|
"--scrollbar-width",
|
|
@@ -206,7 +206,7 @@ function convertToPixels(value) {
|
|
|
206
206
|
);
|
|
207
207
|
return 0;
|
|
208
208
|
}
|
|
209
|
-
const numericValue = parseFloat(match[1]);
|
|
209
|
+
const numericValue = parseFloat(match[1] ?? "");
|
|
210
210
|
const unit = match[2];
|
|
211
211
|
const bodyFontSize = window.getComputedStyle(document.body).fontSize;
|
|
212
212
|
const rootFontSize = parseFloat(bodyFontSize) || 16;
|
|
@@ -20,7 +20,7 @@ type __VLS_Slots = {} & {
|
|
|
20
20
|
} & {
|
|
21
21
|
default?: (props: typeof __VLS_37) => any;
|
|
22
22
|
};
|
|
23
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicDrawerProps,
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicDrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDrawerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -38,7 +38,9 @@ export function useDrawerDOM(args) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function addScrollLockPadding() {
|
|
41
|
-
if (typeof window === "undefined")
|
|
41
|
+
if (typeof window === "undefined") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
42
44
|
const exclude = new RegExp(/magic-drawer(__backdrop)?/);
|
|
43
45
|
document.body.style.setProperty(
|
|
44
46
|
"--scrollbar-width",
|
|
@@ -36,13 +36,16 @@ export function useDrawerSnap(args) {
|
|
|
36
36
|
() => toValue(snapPoints),
|
|
37
37
|
() => {
|
|
38
38
|
const extended = toValue(preventDragClose) ? toValue(snapPoints) : [...toValue(snapPoints), 0];
|
|
39
|
-
const mapped = extended.reduce(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
const mapped = extended.reduce(
|
|
40
|
+
(acc, current) => {
|
|
41
|
+
const key = mapSnapPoint(current);
|
|
42
|
+
if (key || key === 0) {
|
|
43
|
+
acc[key] = current;
|
|
44
|
+
}
|
|
45
|
+
return acc;
|
|
46
|
+
},
|
|
47
|
+
{}
|
|
48
|
+
);
|
|
46
49
|
return mapped;
|
|
47
50
|
}
|
|
48
51
|
);
|
|
@@ -104,30 +107,54 @@ export function useDrawerSnap(args) {
|
|
|
104
107
|
switch (position) {
|
|
105
108
|
case "bottom": {
|
|
106
109
|
const rect = toValue(wrapperRect);
|
|
107
|
-
if (reversedSnapPoint === 1)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
if (reversedSnapPoint === 1) {
|
|
111
|
+
return drawerHeight.value;
|
|
112
|
+
}
|
|
113
|
+
if (reversedSnapPoint === 0) {
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
if (!rect) {
|
|
117
|
+
return 0;
|
|
118
|
+
}
|
|
110
119
|
return vh * reversedSnapPoint - rect.top;
|
|
111
120
|
}
|
|
112
121
|
case "top": {
|
|
113
122
|
const rect = toValue(wrapperRect);
|
|
114
|
-
if (reversedSnapPoint === 1)
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
if (reversedSnapPoint === 1) {
|
|
124
|
+
return drawerHeight.value * -1;
|
|
125
|
+
}
|
|
126
|
+
if (reversedSnapPoint === 0) {
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
129
|
+
if (!rect) {
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
117
132
|
return vh * reversedSnapPoint - rect.bottom;
|
|
118
133
|
}
|
|
119
134
|
case "right": {
|
|
120
135
|
const rect = toValue(wrapperRect);
|
|
121
|
-
if (reversedSnapPoint === 1)
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
if (reversedSnapPoint === 1) {
|
|
137
|
+
return drawerWidth.value;
|
|
138
|
+
}
|
|
139
|
+
if (reversedSnapPoint === 0) {
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
if (!rect) {
|
|
143
|
+
return 0;
|
|
144
|
+
}
|
|
124
145
|
return vw * reversedSnapPoint - rect.left;
|
|
125
146
|
}
|
|
126
147
|
case "left": {
|
|
127
148
|
const rect = toValue(wrapperRect);
|
|
128
|
-
if (reversedSnapPoint === 1)
|
|
129
|
-
|
|
130
|
-
|
|
149
|
+
if (reversedSnapPoint === 1) {
|
|
150
|
+
return drawerWidth.value * -1;
|
|
151
|
+
}
|
|
152
|
+
if (reversedSnapPoint === 0) {
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
if (!rect) {
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
131
158
|
return vw * reversedSnapPoint - rect.right;
|
|
132
159
|
}
|
|
133
160
|
default:
|
|
@@ -159,7 +186,9 @@ export function useDrawerSnap(args) {
|
|
|
159
186
|
case "top":
|
|
160
187
|
case "bottom": {
|
|
161
188
|
const mappedSnapPointY = mapSnapPoint(snapPoint);
|
|
162
|
-
if (!mappedSnapPointY && mappedSnapPointY !== 0)
|
|
189
|
+
if (!mappedSnapPointY && mappedSnapPointY !== 0) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
163
192
|
const closestY = findClosestSnapPoint({
|
|
164
193
|
draggedX,
|
|
165
194
|
draggedY: mappedSnapPointY
|
|
@@ -176,7 +205,9 @@ export function useDrawerSnap(args) {
|
|
|
176
205
|
case "left":
|
|
177
206
|
case "right": {
|
|
178
207
|
const mappedSnapPointX = mapSnapPoint(toValue(snapPoint));
|
|
179
|
-
if (!mappedSnapPointX && mappedSnapPointX !== 0)
|
|
208
|
+
if (!mappedSnapPointX && mappedSnapPointX !== 0) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
180
211
|
const closestX = findClosestSnapPoint({
|
|
181
212
|
draggedX: mappedSnapPointX,
|
|
182
213
|
draggedY
|
|
@@ -200,6 +231,9 @@ export function useDrawerSnap(args) {
|
|
|
200
231
|
easing
|
|
201
232
|
} = args2;
|
|
202
233
|
const snapPoint = snapPointsMap.value[to];
|
|
234
|
+
if (!snapPoint && snapPoint !== 0) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
203
237
|
emitter.emit("beforeSnap", { id: toValue(id), snapPoint });
|
|
204
238
|
switch (position) {
|
|
205
239
|
case "bottom":
|
|
@@ -38,7 +38,9 @@ export function useDrawerState(id) {
|
|
|
38
38
|
let state = drawerStateStore.value.find((entry) => {
|
|
39
39
|
return entry.id === id;
|
|
40
40
|
});
|
|
41
|
-
if (!state)
|
|
41
|
+
if (!state) {
|
|
42
|
+
state = addState(toValue(id));
|
|
43
|
+
}
|
|
42
44
|
return state;
|
|
43
45
|
}
|
|
44
46
|
function deleteState() {
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
export function useDrawerUtils() {
|
|
2
2
|
function clamp(value, from, to) {
|
|
3
3
|
if (from > to) {
|
|
4
|
-
if (value > from)
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if (value > from) {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
if (value < to) {
|
|
8
|
+
return to;
|
|
9
|
+
} else {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
7
12
|
} else if (from < to) {
|
|
8
|
-
if (value < from)
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
if (value < from) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
if (value > to) {
|
|
17
|
+
return to;
|
|
18
|
+
} else {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
11
21
|
} else {
|
|
12
|
-
if (value < to)
|
|
13
|
-
|
|
22
|
+
if (value < to) {
|
|
23
|
+
return to;
|
|
24
|
+
} else {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
14
27
|
}
|
|
15
28
|
}
|
|
16
29
|
return {
|
|
@@ -10,7 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
default?: (props: typeof __VLS_3) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMarqueeProps,
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMarqueeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
15
|
export default _default;
|
|
16
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -6,7 +6,7 @@ declare var __VLS_6: {};
|
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_6) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuChannelProps,
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuChannelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuChannelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -14,7 +14,7 @@ type __VLS_Slots = {} & {
|
|
|
14
14
|
} & {
|
|
15
15
|
default?: (props: typeof __VLS_28) => any;
|
|
16
16
|
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuContentProps,
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -41,7 +41,7 @@ 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: { type:
|
|
44
|
+
placement: { type: String, required: false },
|
|
45
45
|
middleware: { type: Array, required: false },
|
|
46
46
|
arrow: { type: Boolean, required: false },
|
|
47
47
|
referenceEl: { type: null, required: false }
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type MaybeRef, type ComponentPublicInstance } from 'vue';
|
|
2
|
-
import { type
|
|
2
|
+
import { type Middleware } from '@floating-ui/vue';
|
|
3
|
+
import type { MenuPlacement } from '../types/index.js';
|
|
3
4
|
interface MagicMenuFloatProps {
|
|
4
|
-
placement?:
|
|
5
|
+
placement?: MenuPlacement;
|
|
5
6
|
middleware?: Middleware[];
|
|
6
7
|
arrow?: boolean;
|
|
7
8
|
referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>;
|
|
@@ -12,7 +13,7 @@ type __VLS_Slots = {} & {
|
|
|
12
13
|
} & {
|
|
13
14
|
default?: (props: typeof __VLS_3) => any;
|
|
14
15
|
};
|
|
15
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuFloatProps,
|
|
16
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuFloatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuFloatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
17
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
18
|
export default _default;
|
|
18
19
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -9,7 +9,7 @@ declare var __VLS_1: {
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_1) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuItemProps,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
13
|
click: (event: MouseEvent) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
|
|
15
15
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
@@ -9,7 +9,7 @@ declare var __VLS_8: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -14,7 +14,7 @@ declare var __VLS_11: {
|
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
15
|
default?: (props: typeof __VLS_11) => any;
|
|
16
16
|
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuRemoteProps,
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuRemoteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuRemoteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -13,7 +13,7 @@ declare var __VLS_13: {
|
|
|
13
13
|
type __VLS_Slots = {} & {
|
|
14
14
|
default?: (props: typeof __VLS_13) => any;
|
|
15
15
|
};
|
|
16
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuTriggerProps,
|
|
16
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
18
|
export default _default;
|
|
19
19
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
21
21
|
const { id, placement } = defineProps({
|
|
22
22
|
id: { type: String, required: false },
|
|
23
|
-
placement: { type:
|
|
23
|
+
placement: { type: String, required: false }
|
|
24
24
|
});
|
|
25
25
|
const magicError = useMagicError({
|
|
26
26
|
prefix: "MagicMenu",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MenuPlacement } from '../types/index.js';
|
|
2
2
|
interface MagicMenuViewProps {
|
|
3
3
|
id?: string;
|
|
4
|
-
placement?:
|
|
4
|
+
placement?: MenuPlacement;
|
|
5
5
|
}
|
|
6
6
|
declare var __VLS_1: {
|
|
7
7
|
viewActive: boolean;
|
|
@@ -9,7 +9,7 @@ declare var __VLS_1: {
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_1) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuViewProps,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -15,7 +15,9 @@ export function useMenuDOM() {
|
|
|
15
15
|
scrollLock.value = false;
|
|
16
16
|
}
|
|
17
17
|
function addScrollLockPadding() {
|
|
18
|
-
if (typeof window === "undefined")
|
|
18
|
+
if (typeof window === "undefined") {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
19
21
|
const exclude = new RegExp(/magic-menu/);
|
|
20
22
|
document.body.style.setProperty(
|
|
21
23
|
"--scrollbar-width",
|
|
@@ -109,7 +109,9 @@ export function useMenuKeyListener(instanceId) {
|
|
|
109
109
|
}
|
|
110
110
|
const viewId = state.input.view;
|
|
111
111
|
const inputView = getView(viewId);
|
|
112
|
-
if (!inputView)
|
|
112
|
+
if (!inputView) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
113
115
|
const enabledItems = getEnabledItems(inputView);
|
|
114
116
|
const prevIndex = enabledItems.findIndex((item) => item.active) - 1;
|
|
115
117
|
if (prevIndex >= 0) {
|
|
@@ -133,7 +135,9 @@ export function useMenuKeyListener(instanceId) {
|
|
|
133
135
|
}
|
|
134
136
|
const viewId = state.input.view;
|
|
135
137
|
const inputView = getView(viewId);
|
|
136
|
-
if (!inputView)
|
|
138
|
+
if (!inputView) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
137
141
|
const enabledItems = getEnabledItems(inputView);
|
|
138
142
|
const nextIndex = enabledItems.findIndex((item) => item.active) + 1;
|
|
139
143
|
if (nextIndex >= 0) {
|
|
@@ -14,8 +14,12 @@ export function useMenuView(instanceId) {
|
|
|
14
14
|
const currentInstanceId = toValue(instanceId);
|
|
15
15
|
const currentView = computed(() => {
|
|
16
16
|
const activeViews = state.views.filter((view) => view.active);
|
|
17
|
-
if (activeViews.length === 0)
|
|
18
|
-
|
|
17
|
+
if (activeViews.length === 0) {
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
if (activeViews.length === 1) {
|
|
21
|
+
return activeViews[0];
|
|
22
|
+
}
|
|
19
23
|
return activeViews.reduce(
|
|
20
24
|
(a, b) => a.parent.views.length >= b.parent.views.length ? a : b
|
|
21
25
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Placement } from '@floating-ui/vue';
|
|
2
1
|
type MenuMode = 'dropdown' | 'menubar' | 'context' | 'navigation';
|
|
3
2
|
export interface MagicMenuOptions {
|
|
4
3
|
mode?: MenuMode;
|
|
@@ -41,6 +40,7 @@ export type Coordinates = {
|
|
|
41
40
|
x: number;
|
|
42
41
|
y: number;
|
|
43
42
|
};
|
|
43
|
+
export type MenuPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
|
|
44
44
|
export interface MenuItem {
|
|
45
45
|
id: string;
|
|
46
46
|
active: boolean;
|
|
@@ -59,7 +59,7 @@ export interface MenuView {
|
|
|
59
59
|
item: string;
|
|
60
60
|
views: string[];
|
|
61
61
|
};
|
|
62
|
-
placement:
|
|
62
|
+
placement: MenuPlacement;
|
|
63
63
|
state: {
|
|
64
64
|
selectAbortController: AbortController;
|
|
65
65
|
unselectAbortController: AbortController;
|
|
@@ -13,7 +13,7 @@ type __VLS_Slots = {} & {
|
|
|
13
13
|
} & {
|
|
14
14
|
default?: (props: typeof __VLS_34) => any;
|
|
15
15
|
};
|
|
16
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicModalProps,
|
|
16
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
18
|
export default _default;
|
|
19
19
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -38,7 +38,9 @@ export function useModalDOM(args) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function addScrollLockPadding() {
|
|
41
|
-
if (typeof window === "undefined")
|
|
41
|
+
if (typeof window === "undefined") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
42
44
|
const exclude = new RegExp(/magic-modal(__backdrop)?/);
|
|
43
45
|
document.body.style.setProperty(
|
|
44
46
|
"--scrollbar-width",
|
|
@@ -3,5 +3,5 @@ interface MagicNoiseProps {
|
|
|
3
3
|
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<MagicNoiseProps,
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
@@ -57,7 +57,7 @@ export function useNoiseApi({
|
|
|
57
57
|
for (let x = 0; x < width2; x += pixelSize) {
|
|
58
58
|
let radian;
|
|
59
59
|
if (rotation) {
|
|
60
|
-
const angle = getRandomRotationAngle();
|
|
60
|
+
const angle = getRandomRotationAngle() ?? 0;
|
|
61
61
|
radian = getRadianFromAngle(angle);
|
|
62
62
|
}
|
|
63
63
|
const pixel = {
|
|
@@ -75,7 +75,9 @@ export function useNoiseApi({
|
|
|
75
75
|
function calculate() {
|
|
76
76
|
const offCanvasHeight = offCanvasRef.value?.height;
|
|
77
77
|
const offCanvasWidth = offCanvasRef.value?.width;
|
|
78
|
-
if (!offCanvasHeight || !offCanvasWidth)
|
|
78
|
+
if (!offCanvasHeight || !offCanvasWidth) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
79
81
|
pixels.value = calculatePixels({
|
|
80
82
|
width: offCanvasWidth,
|
|
81
83
|
height: offCanvasHeight,
|
|
@@ -144,7 +146,9 @@ export function useNoiseApi({
|
|
|
144
146
|
transferControls.value = useRafFn(throttled);
|
|
145
147
|
}
|
|
146
148
|
function draw() {
|
|
147
|
-
if (!offContext.value || !offCanvasRef.value)
|
|
149
|
+
if (!offContext.value || !offCanvasRef.value) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
148
152
|
offContext.value.clearRect(
|
|
149
153
|
0,
|
|
150
154
|
0,
|
|
@@ -3,5 +3,5 @@ interface MagicPieProps {
|
|
|
3
3
|
id: string;
|
|
4
4
|
options?: MagicPieOptions;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<MagicPieProps,
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicPieProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPieProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
@@ -18,7 +18,9 @@ export function usePieState(id) {
|
|
|
18
18
|
let state = pieStateStore.value.find((entry) => {
|
|
19
19
|
return entry.id === id;
|
|
20
20
|
});
|
|
21
|
-
if (!state)
|
|
21
|
+
if (!state) {
|
|
22
|
+
state = addState(toValue(id));
|
|
23
|
+
}
|
|
22
24
|
return state;
|
|
23
25
|
}
|
|
24
26
|
function deleteState() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -7,7 +7,7 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
} & {
|
|
8
8
|
pauseIcon?: (props: typeof __VLS_7) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicAudioPlayerControlsProps,
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicAudioPlayerControlsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAudioPlayerControlsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
12
|
export default _default;
|
|
13
13
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface MagicPlayerDisplayTimeProps {
|
|
2
2
|
type?: 'current' | 'remaining' | 'duration';
|
|
3
3
|
}
|
|
4
|
-
declare const _default: import("vue").DefineComponent<MagicPlayerDisplayTimeProps,
|
|
4
|
+
declare const _default: import("vue").DefineComponent<MagicPlayerDisplayTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerDisplayTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface MagicPlayerMuxPopoverProps {
|
|
2
2
|
playbackId?: string;
|
|
3
3
|
}
|
|
4
|
-
declare const _default: import("vue").DefineComponent<MagicPlayerMuxPopoverProps,
|
|
4
|
+
declare const _default: import("vue").DefineComponent<MagicPlayerMuxPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerMuxPopoverProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
export default _default;
|
|
@@ -14,7 +14,7 @@ type __VLS_Slots = {} & {
|
|
|
14
14
|
} & {
|
|
15
15
|
pauseIcon?: (props: typeof __VLS_25) => any;
|
|
16
16
|
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerOverlayProps,
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerOverlayProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerOverlayProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -2,7 +2,7 @@ declare var __VLS_1: {};
|
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
3
|
default?: (props: typeof __VLS_1) => any;
|
|
4
4
|
};
|
|
5
|
-
declare const __VLS_component: import("vue").DefineComponent<{},
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -8,7 +8,7 @@ declare var __VLS_1: {};
|
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
default?: (props: typeof __VLS_1) => any;
|
|
10
10
|
};
|
|
11
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerProps,
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
13
|
export default _default;
|
|
14
14
|
type __VLS_WithSlots<T, S> = T & {
|