@maas/vue-equipment 0.29.2 → 0.29.3
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/index.js +5 -10
- package/dist/composables/index.js.map +1 -1
- package/dist/composables/index.mjs +5 -10
- package/dist/composables/index.mjs.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +16 -9
- package/dist/plugins/MagicCommand/index.d.ts +2 -4
- package/dist/plugins/MagicCommand/index.mjs +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +3 -3
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +4 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +5 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +4 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +5 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +4 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +3 -3
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +1 -1
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +3 -3
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicCommand/src/types/index.d.ts +5 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicCookie/index.d.ts +0 -2
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +6 -7
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +6 -6
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +17 -0
- package/dist/plugins/MagicCookie/src/composables/private/{defineCookieApi.mjs → useCookieApi.mjs} +4 -4
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +5 -5
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +4 -4
- package/dist/plugins/MagicCookie/src/types/index.d.ts +6 -10
- package/dist/plugins/MagicDraggable/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +4 -4
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +1 -2
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +4 -4
- package/dist/plugins/MagicDrawer/index.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +3 -4
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +1 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +7 -7
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +494 -170
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +9 -9
- package/dist/plugins/MagicMarquee/nuxt.mjs +1 -5
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +3 -3
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +3 -3
- package/dist/plugins/MagicMenu/index.d.ts +4 -0
- package/dist/plugins/MagicMenu/index.mjs +27 -0
- package/dist/plugins/MagicMenu/nuxt.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +14 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +140 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +26 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +169 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +137 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +29 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +106 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +122 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +26 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +53 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +21 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +18 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +52 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.d.ts +6 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +42 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +15 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +75 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +10 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +178 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.d.ts +7 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +48 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +18 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +262 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuUtils.d.ts +3 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuUtils.mjs +16 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +20 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +116 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +9 -0
- package/dist/plugins/MagicMenu/src/symbols/index.mjs +16 -0
- package/dist/plugins/MagicMenu/src/types/index.d.ts +72 -0
- package/dist/plugins/MagicMenu/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMenu/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMenu/src/utils/defaultOptions.mjs +9 -0
- package/dist/plugins/MagicModal/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +4 -4
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +5 -5
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +2 -2
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.d.ts +3 -3
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +2 -2
- package/dist/plugins/MagicModal/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicModal/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +1 -2
- package/dist/plugins/MagicNoise/index.mjs +1 -2
- package/dist/plugins/MagicNoise/nuxt.mjs +1 -5
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +4 -4
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +5 -5
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +2 -2
- package/dist/plugins/MagicNoise/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/index.d.ts +0 -1
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +9 -30
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +10 -14
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +79 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +20 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +9 -7
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +2 -3
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +23 -4
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicScroll/index.d.ts +3 -3
- package/dist/plugins/MagicScroll/index.mjs +1 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +11 -7
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +2 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +2 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +2 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +2 -2
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +28 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +144 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +0 -1
- package/dist/plugins/MagicScroll/src/types/index.d.ts +19 -25
- package/dist/plugins/MagicToast/index.d.ts +0 -2
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +3 -3
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -7
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +4 -14
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +6 -6
- package/dist/plugins/MagicToast/src/types/index.d.ts +20 -21
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/index.js +4 -8
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -8
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +9 -4
- package/dist/plugins/MagicCookie/src/composables/private/defineCookieApi.d.ts +0 -12
- package/dist/plugins/MagicScroll/src/composables/useCollisionDetect.d.ts +0 -6
- package/dist/plugins/MagicScroll/src/composables/useCollisionDetect.mjs +0 -119
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { RequireAllNested } from '@maas/vue-equipment/utils';
|
|
2
|
+
type MenuMode = 'dropdown' | 'menubar' | 'context';
|
|
3
|
+
export interface MagicMenuOptions {
|
|
4
|
+
mode?: MenuMode;
|
|
5
|
+
transition?: {
|
|
6
|
+
initial?: string;
|
|
7
|
+
final?: string;
|
|
8
|
+
nested?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export type MenuTrigger = 'click' | 'mouseenter' | 'mouseleave' | 'right-click';
|
|
12
|
+
export type Coordinates = {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
export interface MenuItem {
|
|
17
|
+
id: string;
|
|
18
|
+
active: boolean;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface MenuView {
|
|
22
|
+
id: string;
|
|
23
|
+
active: boolean;
|
|
24
|
+
items: MenuItem[];
|
|
25
|
+
parent: {
|
|
26
|
+
item: string;
|
|
27
|
+
views: string[];
|
|
28
|
+
};
|
|
29
|
+
children: {
|
|
30
|
+
trigger?: HTMLElement;
|
|
31
|
+
content?: HTMLElement;
|
|
32
|
+
};
|
|
33
|
+
click?: Coordinates;
|
|
34
|
+
}
|
|
35
|
+
export interface MenuState {
|
|
36
|
+
id: string;
|
|
37
|
+
active: boolean;
|
|
38
|
+
views: MenuView[];
|
|
39
|
+
options: RequireAllNested<MagicMenuOptions>;
|
|
40
|
+
input: {
|
|
41
|
+
type: 'keyboard' | 'pointer';
|
|
42
|
+
disabled: ('keyboard' | 'pointer')[];
|
|
43
|
+
view: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export type MenuEvents = {
|
|
47
|
+
beforeEnter: {
|
|
48
|
+
id: string;
|
|
49
|
+
view: string;
|
|
50
|
+
};
|
|
51
|
+
enter: {
|
|
52
|
+
id: string;
|
|
53
|
+
view: string;
|
|
54
|
+
};
|
|
55
|
+
afterEnter: {
|
|
56
|
+
id: string;
|
|
57
|
+
view: string;
|
|
58
|
+
};
|
|
59
|
+
beforeLeave: {
|
|
60
|
+
id: string;
|
|
61
|
+
view: string;
|
|
62
|
+
};
|
|
63
|
+
leave: {
|
|
64
|
+
id: string;
|
|
65
|
+
view: string;
|
|
66
|
+
};
|
|
67
|
+
afterLeave: {
|
|
68
|
+
id: string;
|
|
69
|
+
view: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export {};
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MagicModal from './src/components/MagicModal.vue.js';
|
|
2
2
|
import { useMagicModal } from './src/composables/useMagicModal.js';
|
|
3
3
|
import type { Plugin } from 'vue';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MagicModalOptions } from './src/types/index.js';
|
|
5
5
|
declare const MagicModalPlugin: Plugin;
|
|
6
6
|
export { MagicModalPlugin, MagicModal, useMagicModal };
|
|
7
|
-
export type {
|
|
7
|
+
export type { MagicModalOptions };
|
|
@@ -71,14 +71,14 @@ import { useModalDOM } from '../composables/private/useModalDOM'
|
|
|
71
71
|
import { useModalCallback } from '../composables/private/useModalCallback'
|
|
72
72
|
import { useMagicModal } from '../composables/useMagicModal'
|
|
73
73
|
|
|
74
|
-
import type {
|
|
74
|
+
import type { MagicModalOptions } from './../types/index'
|
|
75
75
|
|
|
76
76
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css'
|
|
77
77
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css'
|
|
78
78
|
|
|
79
|
-
// Prevent
|
|
79
|
+
// Prevent keyListener array from being merged with default
|
|
80
80
|
const customDefu = createDefu((obj, key, value) => {
|
|
81
|
-
if (key === '
|
|
81
|
+
if (key === 'close') {
|
|
82
82
|
obj[key] = value
|
|
83
83
|
return true
|
|
84
84
|
}
|
|
@@ -89,7 +89,7 @@ interface MagicModalProps {
|
|
|
89
89
|
class?: MaybeRef<string>
|
|
90
90
|
component?: Component
|
|
91
91
|
props?: Record<string, unknown>
|
|
92
|
-
options?:
|
|
92
|
+
options?: MagicModalOptions
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
const props = withDefaults(defineProps<MagicModalProps>(), {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MagicModalOptions } from './../types/index';
|
|
3
3
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
4
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
5
5
|
interface MagicModalProps {
|
|
@@ -7,14 +7,14 @@ interface MagicModalProps {
|
|
|
7
7
|
class?: MaybeRef<string>;
|
|
8
8
|
component?: Component;
|
|
9
9
|
props?: Record<string, unknown>;
|
|
10
|
-
options?:
|
|
10
|
+
options?: MagicModalOptions;
|
|
11
11
|
}
|
|
12
12
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicModalProps>, {
|
|
13
|
-
options: () =>
|
|
13
|
+
options: () => MagicModalOptions;
|
|
14
14
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicModalProps>, {
|
|
15
|
-
options: () =>
|
|
15
|
+
options: () => MagicModalOptions;
|
|
16
16
|
}>>>, {
|
|
17
|
-
options:
|
|
17
|
+
options: MagicModalOptions;
|
|
18
18
|
}, {}>, {
|
|
19
19
|
backdrop?(_: {}): any;
|
|
20
20
|
default?(_: {}): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MagicModalOptions } from '../../types.js';
|
|
3
3
|
type UseModalCallbackArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mappedOptions:
|
|
5
|
+
mappedOptions: MagicModalOptions;
|
|
6
6
|
addScrollLockPadding: () => void;
|
|
7
7
|
removeScrollLockPadding: () => void;
|
|
8
8
|
lockScroll: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type MaybeElementRef } from '@vueuse/core';
|
|
2
|
-
import type {
|
|
3
|
-
export type
|
|
2
|
+
import type { MagicModalOptions } from '../../types/index.js';
|
|
3
|
+
export type useModalDOMArgs = Pick<MagicModalOptions, 'scrollLock' | 'focusTrap'> & {
|
|
4
4
|
focusTarget: MaybeElementRef;
|
|
5
5
|
};
|
|
6
|
-
export declare function useModalDOM(
|
|
6
|
+
export declare function useModalDOM(args?: useModalDOMArgs): {
|
|
7
7
|
trapFocus: () => void;
|
|
8
8
|
releaseFocus: () => void;
|
|
9
9
|
lockScroll: () => void;
|
|
@@ -9,9 +9,9 @@ const defaultOptions = {
|
|
|
9
9
|
scrollLock: true
|
|
10
10
|
};
|
|
11
11
|
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : ref(false);
|
|
12
|
-
export function useModalDOM(
|
|
12
|
+
export function useModalDOM(args) {
|
|
13
13
|
const positionFixedElements = ref([]);
|
|
14
|
-
const mappedOptions = defu(
|
|
14
|
+
const mappedOptions = defu(args, defaultOptions);
|
|
15
15
|
const focusTrap = mappedOptions.focusTarget ? typeof mappedOptions.focusTrap === "boolean" ? useFocusTrap(mappedOptions.focusTarget) : useFocusTrap(mappedOptions.focusTarget, mappedOptions.focusTrap) : void 0;
|
|
16
16
|
function trapFocus() {
|
|
17
17
|
if (focusTrap) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MagicModalOptions } from '../types.js';
|
|
2
2
|
import type { RequireAll } from '@maas/vue-equipment/utils';
|
|
3
|
-
declare const defaultOptions: RequireAll<
|
|
3
|
+
declare const defaultOptions: RequireAll<MagicModalOptions>;
|
|
4
4
|
export { defaultOptions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
2
|
import MagicNoise from './src/components/MagicNoise.vue.js';
|
|
3
|
-
import { useNoiseApi } from './src/composables/private/useNoiseApi.js';
|
|
4
3
|
declare const MagicNoisePlugin: Plugin;
|
|
5
|
-
export { MagicNoisePlugin, MagicNoise
|
|
4
|
+
export { MagicNoisePlugin, MagicNoise };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import MagicNoise from "./src/components/MagicNoise.vue";
|
|
2
|
-
import { useNoiseApi } from "./src/composables/private/useNoiseApi.mjs";
|
|
3
2
|
const MagicNoisePlugin = {
|
|
4
3
|
install: (app) => {
|
|
5
4
|
app.component("MagicNoise", MagicNoise);
|
|
6
5
|
}
|
|
7
6
|
};
|
|
8
|
-
export { MagicNoisePlugin, MagicNoise
|
|
7
|
+
export { MagicNoisePlugin, MagicNoise };
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
import { onMounted, onUnmounted, watch, shallowRef } from 'vue'
|
|
12
12
|
import { useResizeObserver, useDebounceFn } from '@vueuse/core'
|
|
13
13
|
import { useNoiseApi } from '../composables/private/useNoiseApi'
|
|
14
|
-
import type {
|
|
14
|
+
import type { MagicNoiseOptions } from '../types'
|
|
15
15
|
|
|
16
|
-
interface
|
|
17
|
-
options?:
|
|
16
|
+
interface MagicNoiseProps {
|
|
17
|
+
options?: MagicNoiseOptions
|
|
18
18
|
pause?: boolean
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const props = withDefaults(defineProps<
|
|
21
|
+
const props = withDefaults(defineProps<MagicNoiseProps>(), {
|
|
22
22
|
pause: false,
|
|
23
23
|
})
|
|
24
24
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
interface
|
|
3
|
-
options?:
|
|
1
|
+
import type { MagicNoiseOptions } from '../types';
|
|
2
|
+
interface MagicNoiseProps {
|
|
3
|
+
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicNoiseProps>, {
|
|
7
7
|
pause: boolean;
|
|
8
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicNoiseProps>, {
|
|
9
9
|
pause: boolean;
|
|
10
10
|
}>>>, {
|
|
11
11
|
pause: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MagicNoiseOptions, RafControls } from '../../types.js';
|
|
3
3
|
type UseNoiseApiArgs = {
|
|
4
4
|
canvasRef: Ref<HTMLCanvasElement | undefined>;
|
|
5
5
|
offCanvasRef: Ref<HTMLCanvasElement | undefined>;
|
|
6
|
-
options?: MaybeRef<
|
|
6
|
+
options?: MaybeRef<MagicNoiseOptions>;
|
|
7
7
|
};
|
|
8
8
|
export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNoiseApiArgs): {
|
|
9
9
|
initialize: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MagicNoiseOptions } from '../types/index.js';
|
|
2
2
|
import type { RequireAll } from '@maas/vue-equipment/utils';
|
|
3
|
-
declare const defaultOptions: RequireAll<
|
|
3
|
+
declare const defaultOptions: RequireAll<MagicNoiseOptions>;
|
|
4
4
|
export { defaultOptions };
|
|
@@ -9,4 +9,3 @@ import MagicPlayerTimeline from './src/components/MagicPlayerTimeline.vue.js';
|
|
|
9
9
|
import { useMagicPlayer } from './src/composables/useMagicPlayer.js';
|
|
10
10
|
declare const MagicPlayerPlugin: Plugin;
|
|
11
11
|
export { MagicPlayerPlugin, MagicPlayer, MagicPlayerControls, MagicPlayerDisplayTime, MagicPlayerMuxPopover, MagicPlayerPoster, MagicPlayerOverlay, MagicPlayerTimeline, useMagicPlayer, };
|
|
12
|
-
export type * from './src/types/index';
|
|
@@ -22,13 +22,13 @@ import { usePlayerAudioApi } from '../composables/private/usePlayerAudioApi'
|
|
|
22
22
|
import { usePlayerMediaApi } from '../composables/private/usePlayerMediaApi'
|
|
23
23
|
import { usePlayerRuntime } from '../composables/private/usePlayerRuntime'
|
|
24
24
|
|
|
25
|
-
interface
|
|
25
|
+
interface MagicAudioPlayerProps {
|
|
26
26
|
id: string
|
|
27
27
|
src: string
|
|
28
28
|
loop?: boolean
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const props = withDefaults(defineProps<
|
|
31
|
+
const props = withDefaults(defineProps<MagicAudioPlayerProps>(), {
|
|
32
32
|
src: '',
|
|
33
33
|
loop: false,
|
|
34
34
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface MagicAudioPlayerProps {
|
|
2
2
|
id: string;
|
|
3
3
|
src: string;
|
|
4
4
|
loop?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
6
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicAudioPlayerProps>, {
|
|
7
7
|
src: string;
|
|
8
8
|
loop: boolean;
|
|
9
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
9
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicAudioPlayerProps>, {
|
|
10
10
|
src: string;
|
|
11
11
|
loop: boolean;
|
|
12
12
|
}>>>, {
|
|
@@ -64,11 +64,11 @@ import { usePlayerControlsApi } from '../composables/private/usePlayerControlsAp
|
|
|
64
64
|
import IconPlay from './icons/Play.vue'
|
|
65
65
|
import IconPause from './icons/Pause.vue'
|
|
66
66
|
|
|
67
|
-
interface
|
|
67
|
+
interface MagicAudioPlayerControlsProps {
|
|
68
68
|
id: string
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const props = defineProps<
|
|
71
|
+
const props = defineProps<MagicAudioPlayerControlsProps>()
|
|
72
72
|
|
|
73
73
|
const barRef = ref<HTMLDivElement | undefined>(undefined)
|
|
74
74
|
const trackRef = ref<HTMLDivElement | undefined>(undefined)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface MagicAudioPlayerControlsProps {
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<MagicAudioPlayerControlsProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAudioPlayerControlsProps>>>, {}, {}>, {
|
|
5
5
|
playIcon?(_: {}): any;
|
|
6
6
|
pauseIcon?(_: {}): any;
|
|
7
7
|
}>;
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
<div
|
|
3
3
|
ref="playerRef"
|
|
4
4
|
class="magic-player"
|
|
5
|
-
:style="computedStyle"
|
|
6
5
|
@mouseenter="onMouseenter"
|
|
7
6
|
@mouseleave="onMouseleave"
|
|
8
7
|
>
|
|
9
8
|
<video
|
|
10
9
|
ref="videoRef"
|
|
11
10
|
class="magic-player__video"
|
|
12
|
-
preload="auto"
|
|
13
11
|
playsinline
|
|
14
12
|
disablePictureInPicture
|
|
15
|
-
:
|
|
13
|
+
:preload="preload"
|
|
14
|
+
:loop="loop"
|
|
16
15
|
:muted="muted"
|
|
17
16
|
/>
|
|
18
17
|
<slot />
|
|
@@ -26,24 +25,22 @@ import { usePlayerVideoApi } from '../composables/private/usePlayerVideoApi'
|
|
|
26
25
|
import { usePlayerMediaApi } from '../composables/private/usePlayerMediaApi'
|
|
27
26
|
import { usePlayerRuntime } from '../composables/private/usePlayerRuntime'
|
|
28
27
|
|
|
29
|
-
import type {
|
|
28
|
+
import type { MagicPlayerSourceType } from './../types'
|
|
30
29
|
|
|
31
|
-
interface
|
|
30
|
+
interface MagicPlayerProps {
|
|
32
31
|
id: string
|
|
33
|
-
srcType?:
|
|
32
|
+
srcType?: MagicPlayerSourceType
|
|
34
33
|
src: string
|
|
35
|
-
ratio?: string
|
|
36
|
-
fill?: boolean
|
|
37
34
|
autoplay?: boolean
|
|
35
|
+
preload?: 'auto' | 'metadata' | 'none'
|
|
38
36
|
loop?: boolean
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
const props = withDefaults(defineProps<
|
|
39
|
+
const props = withDefaults(defineProps<MagicPlayerProps>(), {
|
|
42
40
|
srcType: 'native',
|
|
43
41
|
src: '',
|
|
44
|
-
ratio: '16:9',
|
|
45
|
-
fill: false,
|
|
46
42
|
autoplay: false,
|
|
43
|
+
preload: 'metadata',
|
|
47
44
|
loop: false,
|
|
48
45
|
})
|
|
49
46
|
|
|
@@ -82,24 +79,6 @@ useIntersectionObserver(
|
|
|
82
79
|
}
|
|
83
80
|
)
|
|
84
81
|
|
|
85
|
-
const computedRatio = computed(() => {
|
|
86
|
-
if (props.ratio) {
|
|
87
|
-
return props.ratio.split(':')
|
|
88
|
-
} else {
|
|
89
|
-
return undefined
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
const computedStyle = computed(() => {
|
|
94
|
-
return {
|
|
95
|
-
height: props.fill ? '100%' : undefined,
|
|
96
|
-
'aspect-ratio':
|
|
97
|
-
computedRatio.value && !props.fill
|
|
98
|
-
? `${computedRatio.value[0]}/${computedRatio.value[1]}`
|
|
99
|
-
: undefined,
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
|
|
103
82
|
onMounted(() => {
|
|
104
83
|
initialize()
|
|
105
84
|
if (props.autoplay) {
|
|
@@ -113,5 +92,5 @@ onBeforeUnmount(() => {
|
|
|
113
92
|
</script>
|
|
114
93
|
|
|
115
94
|
<style>
|
|
116
|
-
:root{--magic-player-aspect-ratio:16/9}.magic-player{aspect-ratio:var(--magic-player-aspect-ratio);overflow:hidden;position:relative;width:100%}.magic-player__video{height:100%;
|
|
95
|
+
:root{--magic-player-aspect-ratio:16/9;--magic-player-background:#000;--magic-player-height:auto}.magic-player{aspect-ratio:var(--magic-player-aspect-ratio);background:var(--magic-player-background);height:var(--magic-player-height);overflow:hidden;position:relative;width:100%}.magic-player__video{height:100%;inset:0;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%}
|
|
117
96
|
</style>
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
interface
|
|
1
|
+
import type { MagicPlayerSourceType } from './../types';
|
|
2
|
+
interface MagicPlayerProps {
|
|
3
3
|
id: string;
|
|
4
|
-
srcType?:
|
|
4
|
+
srcType?: MagicPlayerSourceType;
|
|
5
5
|
src: string;
|
|
6
|
-
ratio?: string;
|
|
7
|
-
fill?: boolean;
|
|
8
6
|
autoplay?: boolean;
|
|
7
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
9
8
|
loop?: boolean;
|
|
10
9
|
}
|
|
11
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
10
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicPlayerProps>, {
|
|
12
11
|
srcType: string;
|
|
13
12
|
src: string;
|
|
14
|
-
ratio: string;
|
|
15
|
-
fill: boolean;
|
|
16
13
|
autoplay: boolean;
|
|
14
|
+
preload: string;
|
|
17
15
|
loop: boolean;
|
|
18
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<
|
|
16
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicPlayerProps>, {
|
|
19
17
|
srcType: string;
|
|
20
18
|
src: string;
|
|
21
|
-
ratio: string;
|
|
22
|
-
fill: boolean;
|
|
23
19
|
autoplay: boolean;
|
|
20
|
+
preload: string;
|
|
24
21
|
loop: boolean;
|
|
25
22
|
}>>>, {
|
|
26
|
-
fill: boolean;
|
|
27
23
|
src: string;
|
|
28
24
|
loop: boolean;
|
|
29
|
-
srcType:
|
|
30
|
-
ratio: string;
|
|
25
|
+
srcType: MagicPlayerSourceType;
|
|
31
26
|
autoplay: boolean;
|
|
27
|
+
preload: "metadata" | "auto" | "none";
|
|
32
28
|
}, {}>, {
|
|
33
29
|
default?(_: {}): any;
|
|
34
30
|
}>;
|