@maas/vue-equipment 1.0.0-beta.35 → 1.0.0-beta.37
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 +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 +4 -4
- 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/MagicAccordion/src/composables/useMagicAccordion.d.ts +1 -5
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +2 -3
- 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 +8 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +3 -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 +8 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +1 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +11 -13
- 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/MagicEmitter/src/composables/useMagicEmitter.d.ts +4 -4
- 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 +8 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +3 -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.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +22 -7
- 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 +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +7 -3
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +3 -1
- package/dist/plugins/MagicToast/src/types/index.d.ts +8 -8
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +22 -30
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.d.ts +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.mjs +0 -0
|
@@ -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",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {} from "vue";
|
|
2
1
|
import { useMagicError } from "@maas/vue-equipment/plugins/MagicError";
|
|
3
2
|
import { useMenuState } from "./useMenuState.mjs";
|
|
4
3
|
import { useMenuView } from "./useMenuView.mjs";
|
|
@@ -43,7 +42,10 @@ export function useMenuKeyListener(instanceId) {
|
|
|
43
42
|
}
|
|
44
43
|
function selectFirstItem(view) {
|
|
45
44
|
const { selectItem } = useMenuItem({ instanceId, viewId: view.id });
|
|
46
|
-
|
|
45
|
+
const firstItem = getEnabledItems(view)[0];
|
|
46
|
+
if (firstItem) {
|
|
47
|
+
selectItem(firstItem.id, true);
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
async function onArrowRight(e) {
|
|
49
51
|
try {
|
|
@@ -109,16 +111,24 @@ export function useMenuKeyListener(instanceId) {
|
|
|
109
111
|
}
|
|
110
112
|
const viewId = state.input.view;
|
|
111
113
|
const inputView = getView(viewId);
|
|
112
|
-
if (!inputView)
|
|
114
|
+
if (!inputView) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
113
117
|
const enabledItems = getEnabledItems(inputView);
|
|
114
118
|
const prevIndex = enabledItems.findIndex((item) => item.active) - 1;
|
|
115
119
|
if (prevIndex >= 0) {
|
|
116
120
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
117
|
-
|
|
121
|
+
const prevItem = enabledItems[prevIndex];
|
|
122
|
+
if (prevItem) {
|
|
123
|
+
selectItem(prevItem.id, true);
|
|
124
|
+
}
|
|
118
125
|
unselectUnrelatedViews(viewId);
|
|
119
126
|
} else if (prevIndex !== -1) {
|
|
120
127
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
121
|
-
|
|
128
|
+
const lastItem = enabledItems[enabledItems.length - 1];
|
|
129
|
+
if (lastItem) {
|
|
130
|
+
selectItem(lastItem.id, true);
|
|
131
|
+
}
|
|
122
132
|
unselectUnrelatedViews(viewId);
|
|
123
133
|
}
|
|
124
134
|
}
|
|
@@ -133,12 +143,17 @@ export function useMenuKeyListener(instanceId) {
|
|
|
133
143
|
}
|
|
134
144
|
const viewId = state.input.view;
|
|
135
145
|
const inputView = getView(viewId);
|
|
136
|
-
if (!inputView)
|
|
146
|
+
if (!inputView) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
137
149
|
const enabledItems = getEnabledItems(inputView);
|
|
138
150
|
const nextIndex = enabledItems.findIndex((item) => item.active) + 1;
|
|
139
151
|
if (nextIndex >= 0) {
|
|
140
152
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
141
|
-
|
|
153
|
+
const nextItem = enabledItems[nextIndex];
|
|
154
|
+
if (nextItem) {
|
|
155
|
+
selectItem(nextItem.id, true);
|
|
156
|
+
}
|
|
142
157
|
unselectUnrelatedViews(viewId);
|
|
143
158
|
}
|
|
144
159
|
}
|
|
@@ -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 & {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -25,7 +25,7 @@ type __VLS_Slots = {} & {
|
|
|
25
25
|
} & {
|
|
26
26
|
fullscreenEnterIcon?: (props: typeof __VLS_47) => any;
|
|
27
27
|
};
|
|
28
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerControlsProps,
|
|
28
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicPlayerControlsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerControlsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
30
|
export default _default;
|
|
31
31
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -46,7 +46,9 @@ export function usePlayerState(id) {
|
|
|
46
46
|
let state = playerStateStore.value.find((entry) => {
|
|
47
47
|
return entry.id === id;
|
|
48
48
|
});
|
|
49
|
-
if (!state)
|
|
49
|
+
if (!state) {
|
|
50
|
+
state = addState(toValue(id));
|
|
51
|
+
}
|
|
50
52
|
return state;
|
|
51
53
|
}
|
|
52
54
|
function deleteState() {
|
|
@@ -7,7 +7,7 @@ declare var __VLS_1: {};
|
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
8
|
default?: (props: typeof __VLS_1) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicScrollCollisionProps,
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollCollisionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollCollisionProps> & 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 & {
|
|
@@ -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<MagicScrollMotionProps,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollMotionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollMotionProps> & 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 & {
|
|
@@ -25,7 +25,7 @@ declare var __VLS_1: {
|
|
|
25
25
|
type __VLS_Slots = {} & {
|
|
26
26
|
default?: (props: typeof __VLS_1) => any;
|
|
27
27
|
};
|
|
28
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicScrollProviderProps,
|
|
28
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
30
|
export default _default;
|
|
31
31
|
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<MagicScrollSceneProps,
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollSceneProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollSceneProps> & 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 & {
|
|
@@ -55,7 +55,7 @@ import { useToastView } from "../composables/private/useToastView";
|
|
|
55
55
|
import { useToastCallback } from "../composables/private/useToastCallback";
|
|
56
56
|
import { useToastListener } from "../composables/private/useToastListener";
|
|
57
57
|
import MagicToastView from "./MagicToastView.vue";
|
|
58
|
-
import { MagicToastInstanceId } from "
|
|
58
|
+
import { MagicToastInstanceId } from "../symbols";
|
|
59
59
|
import "@maas/vue-equipment/utils/css/keyframes/fade-out.css";
|
|
60
60
|
import "@maas/vue-equipment/utils/css/keyframes/squash-y.css";
|
|
61
61
|
import "@maas/vue-equipment/utils/css/keyframes/slide-ltr-in.css";
|
|
@@ -10,5 +10,5 @@ interface MagicToastProps {
|
|
|
10
10
|
id: MaybeRef<string>;
|
|
11
11
|
options?: MagicToastOptions;
|
|
12
12
|
}
|
|
13
|
-
declare const _default: import("vue").DefineComponent<MagicToastProps,
|
|
13
|
+
declare const _default: import("vue").DefineComponent<MagicToastProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
export default _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
class="magic-toast-view"
|
|
4
4
|
:data-id="id"
|
|
5
5
|
:data-expanded="state.expanded"
|
|
6
|
-
:data-dragging="view
|
|
6
|
+
:data-dragging="view?.dragging"
|
|
7
7
|
:data-position="state.options.position"
|
|
8
8
|
:data-debug="state.options.debug"
|
|
9
9
|
:style="{
|
|
@@ -29,7 +29,7 @@ import { computed, inject } from "vue";
|
|
|
29
29
|
import {
|
|
30
30
|
useMagicError
|
|
31
31
|
} from "@maas/vue-equipment/plugins/MagicError";
|
|
32
|
-
import { MagicToastInstanceId } from "
|
|
32
|
+
import { MagicToastInstanceId } from "../symbols";
|
|
33
33
|
import { useToastState } from "../composables/private/useToastState";
|
|
34
34
|
import { useToastDrag } from "../composables/private/useToastDrag";
|
|
35
35
|
const { id, index } = defineProps({
|
|
@@ -50,7 +50,11 @@ const state = initializeState();
|
|
|
50
50
|
const count = computed(() => state.views.length);
|
|
51
51
|
const view = computed(() => state.views[index]);
|
|
52
52
|
const reversedIndex = computed(() => count.value - index - 1);
|
|
53
|
-
|
|
53
|
+
magicError.assert(view.value, {
|
|
54
|
+
message: "MagicToastView could not be registered",
|
|
55
|
+
errorCode: "missing_view"
|
|
56
|
+
});
|
|
57
|
+
const height = computed(() => `${view.value?.dimensions?.height}px`);
|
|
54
58
|
const offset = computed(() => {
|
|
55
59
|
const mapped = state.views.slice(0, reversedIndex.value).reduce((acc, view2) => acc + (view2.dimensions?.height ?? 0), 0);
|
|
56
60
|
return `${mapped}px`;
|
|
@@ -6,7 +6,7 @@ declare var __VLS_1: {};
|
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_1) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicToastViewProps,
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicToastViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastViewProps> & 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 & {
|
|
@@ -12,7 +12,7 @@ export function useToastCallback(instanceId) {
|
|
|
12
12
|
}
|
|
13
13
|
function onEnter() {
|
|
14
14
|
emitter.emit("enter", toValue(instanceId));
|
|
15
|
-
if (state.views.length && state.options.layout?.max && state.views.length > state.options.layout.max) {
|
|
15
|
+
if (state.views.length && state.views[0] && state.options.layout?.max && state.views.length > state.options.layout.max) {
|
|
16
16
|
deleteView(state.views[0].id);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -14,7 +14,9 @@ export function useToastScrollLock() {
|
|
|
14
14
|
scrollLock.value = false;
|
|
15
15
|
}
|
|
16
16
|
function addScrollLockPadding() {
|
|
17
|
-
if (typeof window === "undefined")
|
|
17
|
+
if (typeof window === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
18
20
|
document.body.style.setProperty(
|
|
19
21
|
"--scrollbar-width",
|
|
20
22
|
`${scrollbarWidth()}px`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MaybeRef } from 'vue';
|
|
2
2
|
import type { RequireAll } from '@maas/vue-equipment/utils';
|
|
3
3
|
type Position = 'top-left' | 'top' | 'top-right' | 'left' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
|
|
4
|
-
export
|
|
4
|
+
export interface ToastView {
|
|
5
5
|
id: string;
|
|
6
6
|
component: object;
|
|
7
7
|
props?: MaybeRef<Record<string, unknown>>;
|
|
@@ -24,22 +24,22 @@ export type ToastView = {
|
|
|
24
24
|
lastDraggedY: number;
|
|
25
25
|
draggedX: number;
|
|
26
26
|
draggedY: number;
|
|
27
|
-
}
|
|
28
|
-
export
|
|
27
|
+
}
|
|
28
|
+
export interface ToastState {
|
|
29
29
|
id: string;
|
|
30
30
|
views: ToastView[];
|
|
31
31
|
options: ToastDefaultOptions;
|
|
32
32
|
expanded: boolean;
|
|
33
33
|
animating: boolean;
|
|
34
|
-
}
|
|
35
|
-
export
|
|
34
|
+
}
|
|
35
|
+
export interface ActiveToast {
|
|
36
36
|
id: string;
|
|
37
37
|
height: number;
|
|
38
38
|
padding: {
|
|
39
39
|
top: number;
|
|
40
40
|
bottom: number;
|
|
41
41
|
};
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
export interface ToastEvents {
|
|
44
44
|
beforeEnter: string;
|
|
45
45
|
enter: string;
|
|
@@ -48,7 +48,7 @@ export interface ToastEvents {
|
|
|
48
48
|
leave: string;
|
|
49
49
|
afterLeave: string;
|
|
50
50
|
}
|
|
51
|
-
export
|
|
51
|
+
export interface MagicToastOptions {
|
|
52
52
|
debug?: boolean;
|
|
53
53
|
position?: Position;
|
|
54
54
|
duration?: number;
|
|
@@ -78,7 +78,7 @@ export type MagicToastOptions = {
|
|
|
78
78
|
distance?: number;
|
|
79
79
|
momentum?: number;
|
|
80
80
|
};
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
82
|
export type ToastDefaultOptions = RequireAll<MagicToastOptions> & {
|
|
83
83
|
threshold: RequireAll<MagicToastOptions['threshold']>;
|
|
84
84
|
animation: RequireAll<MagicToastOptions['animation']>;
|
package/dist/utils/index.js
CHANGED
|
@@ -99,7 +99,9 @@ function interpolate(args) {
|
|
|
99
99
|
|
|
100
100
|
// src/functions/isIOS.ts
|
|
101
101
|
function isIOS() {
|
|
102
|
-
if (typeof window === "undefined")
|
|
102
|
+
if (typeof window === "undefined") {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
103
105
|
return /iPad|iPhone|iPod/.test(navigator == null ? void 0 : navigator.userAgent);
|
|
104
106
|
}
|
|
105
107
|
|