@maas/vue-equipment 1.0.0-beta.12 → 1.0.0-beta.14
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/nuxt/module.json +1 -1
- package/dist/plugins/.turbo/turbo-lint.log +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +65 -82
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +24 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +65 -61
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +41 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +137 -150
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +45 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +80 -82
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +40 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +68 -74
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +22 -38
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +95 -85
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +41 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +41 -39
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +23 -34
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +40 -73
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +70 -87
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +7 -7
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +262 -304
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -12
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +100 -100
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +41 -69
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +54 -59
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +188 -208
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +181 -194
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +91 -100
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +83 -85
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +79 -75
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +106 -105
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +54 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +136 -164
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +53 -78
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +147 -175
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +51 -62
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +101 -122
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +8 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +35 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +101 -108
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +49 -77
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +18 -37
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +45 -52
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +74 -70
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +171 -213
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +8 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +6 -47
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +4 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +147 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +1 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +17 -164
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +0 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +6 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +56 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +0 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +7 -62
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +32 -51
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +47 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +10 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +29 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +49 -59
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +63 -70
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +29 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +59 -69
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +80 -95
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +52 -70
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +2 -2
- package/package.json +4 -4
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
|
@@ -1,84 +1,56 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="magic-player-overlay"
|
|
4
|
+
:data-playing="playing"
|
|
5
|
+
:data-paused="!playing"
|
|
6
|
+
:data-waiting="waiting"
|
|
7
|
+
:data-idle="idle"
|
|
8
|
+
:data-hover="mouseEntered"
|
|
9
|
+
@click.stop="togglePlay"
|
|
10
|
+
>
|
|
11
|
+
<slot>
|
|
12
|
+
<template v-if="waiting">
|
|
13
|
+
<button class="magic-player-overlay__button">
|
|
14
|
+
<slot name="waitingIcon">
|
|
15
|
+
<icon-waiting />
|
|
16
|
+
</slot>
|
|
17
|
+
</button>
|
|
18
|
+
</template>
|
|
19
|
+
<template v-else>
|
|
20
|
+
<button v-if="!playing" class="magic-player-overlay__button">
|
|
21
|
+
<slot name="playIcon">
|
|
22
|
+
<icon-play />
|
|
23
|
+
</slot>
|
|
24
|
+
</button>
|
|
25
|
+
<button v-else class="magic-player-overlay__button">
|
|
26
|
+
<slot name="pauseIcon">
|
|
27
|
+
<icon-pause />
|
|
28
|
+
</slot>
|
|
29
|
+
</button>
|
|
30
|
+
</template>
|
|
31
|
+
</slot>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { inject, toRefs } from "vue";
|
|
18
37
|
import { useIdle } from "@vueuse/core";
|
|
19
|
-
import
|
|
20
|
-
import IconPause from "./icons/Pause.vue";
|
|
21
|
-
import IconWaiting from "./icons/Waiting.vue";
|
|
22
|
-
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
38
|
+
import { usePlayerState } from "../composables/private/usePlayerState";
|
|
23
39
|
import { usePlayerVideoApi } from "../composables/private/usePlayerVideoApi";
|
|
24
40
|
import { MagicPlayerInstanceId } from "../symbols";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
const { mouseEntered, togglePlay } = usePlayerVideoApi({
|
|
38
|
-
id: instanceId
|
|
39
|
-
});
|
|
40
|
-
const { idle } = useIdle(3e3);
|
|
41
|
-
return (_ctx, _cache) => {
|
|
42
|
-
return _openBlock(), _createElementBlock("div", {
|
|
43
|
-
class: "magic-player-overlay",
|
|
44
|
-
"data-playing": _unref(playing),
|
|
45
|
-
"data-paused": !_unref(playing),
|
|
46
|
-
"data-waiting": _unref(waiting),
|
|
47
|
-
"data-idle": _unref(idle),
|
|
48
|
-
"data-hover": _unref(mouseEntered),
|
|
49
|
-
onClick: _cache[0] || (_cache[0] = _withModifiers(
|
|
50
|
-
//@ts-ignore
|
|
51
|
-
(...args) => _unref(togglePlay) && _unref(togglePlay)(...args),
|
|
52
|
-
["stop"]
|
|
53
|
-
))
|
|
54
|
-
}, [
|
|
55
|
-
_renderSlot(_ctx.$slots, "default", {}, () => [
|
|
56
|
-
_unref(waiting) ? (_openBlock(), _createElementBlock("button", _hoisted_2, [
|
|
57
|
-
_renderSlot(_ctx.$slots, "waitingIcon", {}, () => [
|
|
58
|
-
_createVNode(IconWaiting)
|
|
59
|
-
])
|
|
60
|
-
])) : (_openBlock(), _createElementBlock(
|
|
61
|
-
_Fragment,
|
|
62
|
-
{ key: 1 },
|
|
63
|
-
[
|
|
64
|
-
!_unref(playing) ? (_openBlock(), _createElementBlock("button", _hoisted_3, [
|
|
65
|
-
_renderSlot(_ctx.$slots, "playIcon", {}, () => [
|
|
66
|
-
_createVNode(IconPlay)
|
|
67
|
-
])
|
|
68
|
-
])) : (_openBlock(), _createElementBlock("button", _hoisted_4, [
|
|
69
|
-
_renderSlot(_ctx.$slots, "pauseIcon", {}, () => [
|
|
70
|
-
_createVNode(IconPause)
|
|
71
|
-
])
|
|
72
|
-
]))
|
|
73
|
-
],
|
|
74
|
-
64
|
|
75
|
-
/* STABLE_FRAGMENT */
|
|
76
|
-
))
|
|
77
|
-
])
|
|
78
|
-
], 8, _hoisted_1);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
41
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
42
|
+
if (!instanceId) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
"MagicPlayerOverlay must be nested inside MagicPlayerProvider."
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const { initializeState } = usePlayerState(instanceId);
|
|
48
|
+
const state = initializeState();
|
|
49
|
+
const { mouseEntered, playing, waiting } = toRefs(state);
|
|
50
|
+
const { togglePlay } = usePlayerVideoApi({
|
|
51
|
+
id: instanceId
|
|
81
52
|
});
|
|
53
|
+
const { idle } = useIdle(3e3);
|
|
82
54
|
</script>
|
|
83
55
|
|
|
84
56
|
<style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import IconPlay from './icons/Play.vue.js';
|
|
2
2
|
import IconPause from './icons/Pause.vue.js';
|
|
3
3
|
import IconWaiting from './icons/Waiting.vue.js';
|
|
4
|
-
declare const playing: import("vue").
|
|
5
|
-
declare const
|
|
4
|
+
declare const mouseEntered: import("vue").Ref<boolean, boolean>, playing: import("vue").Ref<boolean, boolean>, waiting: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
declare const togglePlay: () => void;
|
|
6
6
|
declare const idle: import("vue").Ref<boolean, boolean>;
|
|
7
7
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
8
8
|
declare var __VLS_1: {}, __VLS_3: {}, __VLS_8: {}, __VLS_13: {};
|
|
@@ -19,9 +19,9 @@ declare const __VLS_self: import("vue").DefineComponent<{}, {
|
|
|
19
19
|
IconPlay: typeof IconPlay;
|
|
20
20
|
IconPause: typeof IconPause;
|
|
21
21
|
IconWaiting: typeof IconWaiting;
|
|
22
|
+
mouseEntered: typeof mouseEntered;
|
|
22
23
|
playing: typeof playing;
|
|
23
24
|
waiting: typeof waiting;
|
|
24
|
-
mouseEntered: typeof mouseEntered;
|
|
25
25
|
togglePlay: typeof togglePlay;
|
|
26
26
|
idle: typeof idle;
|
|
27
27
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div v-show="!loaded || !touched" class="magic-player-poster">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { inject, toRefs } from "vue";
|
|
9
|
+
import { usePlayerState } from "../composables/private/usePlayerState";
|
|
8
10
|
import { MagicPlayerInstanceId } from "../symbols";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { loaded } = usePlayerRuntime({
|
|
19
|
-
id: instanceId
|
|
20
|
-
});
|
|
21
|
-
const { touched } = usePlayerVideoApi({
|
|
22
|
-
id: instanceId
|
|
23
|
-
});
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
return _withDirectives((_openBlock(), _createElementBlock(
|
|
26
|
-
"div",
|
|
27
|
-
_hoisted_1,
|
|
28
|
-
[
|
|
29
|
-
_renderSlot(_ctx.$slots, "default")
|
|
30
|
-
],
|
|
31
|
-
512
|
|
32
|
-
/* NEED_PATCH */
|
|
33
|
-
)), [
|
|
34
|
-
[_vShow, !_unref(loaded) || !_unref(touched)]
|
|
35
|
-
]);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
11
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
12
|
+
if (!instanceId) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"MagicPlayerPoster must be nested inside MagicPlayerProvider."
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const { initializeState } = usePlayerState(instanceId);
|
|
18
|
+
const state = initializeState();
|
|
19
|
+
const { loaded, touched } = toRefs(state);
|
|
39
20
|
</script>
|
|
40
21
|
|
|
41
22
|
<style>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
declare const loaded: import("vue").
|
|
2
|
-
declare const touched: import("vue").ShallowRef<boolean, boolean>;
|
|
1
|
+
declare const loaded: import("vue").Ref<boolean, boolean>, touched: import("vue").Ref<boolean, boolean>;
|
|
3
2
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
4
3
|
declare var __VLS_1: {};
|
|
5
4
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
@@ -1,61 +1,54 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="player"
|
|
4
|
+
class="magic-player-provider"
|
|
5
|
+
:data-id="id"
|
|
6
|
+
:data-mode="mappedOptions.mode"
|
|
7
|
+
:data-fullscreen="isFullscreen"
|
|
8
|
+
:data-touched="touched"
|
|
9
|
+
:data-playing="playing"
|
|
10
|
+
:data-paused="!playing"
|
|
11
|
+
:data-waiting="waiting"
|
|
12
|
+
:data-loaded="loaded"
|
|
13
|
+
:data-muted="muted"
|
|
14
|
+
@mouseenter="onMouseenter"
|
|
15
|
+
@mouseleave="onMouseleave"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup>
|
|
22
|
+
import { toRefs, provide, onUnmounted } from "vue";
|
|
6
23
|
import defu from "defu";
|
|
7
|
-
import {
|
|
8
|
-
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
9
|
-
import { usePlayerRuntime } from "../composables/private/usePlayerRuntime";
|
|
24
|
+
import { usePlayerState } from "../composables/private/usePlayerState";
|
|
10
25
|
import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
|
|
11
26
|
import { defaultOptions } from "../utils/defaultOptions";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options: { type: Object, required: false }
|
|
27
|
+
const { id, options } = defineProps({
|
|
28
|
+
id: {
|
|
29
|
+
type: null,
|
|
30
|
+
required: true
|
|
17
31
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const { playing, waiting, muted } = usePlayerMediaApi({
|
|
22
|
-
id: __props.id
|
|
23
|
-
});
|
|
24
|
-
const { loaded } = usePlayerRuntime({
|
|
25
|
-
id: __props.id,
|
|
26
|
-
src: mappedOptions.src,
|
|
27
|
-
srcType: mappedOptions.srcType
|
|
28
|
-
});
|
|
29
|
-
const { onMouseenter, onMouseleave, isFullscreen, touched } = usePlayerVideoApi(
|
|
30
|
-
{
|
|
31
|
-
id: __props.id,
|
|
32
|
-
playerRef
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
provide(MagicPlayerInstanceId, __props.id);
|
|
36
|
-
provide(MagicPlayerOptionsKey, mappedOptions);
|
|
37
|
-
return (_ctx, _cache) => {
|
|
38
|
-
return _openBlock(), _createElementBlock("div", {
|
|
39
|
-
ref: "player",
|
|
40
|
-
class: "magic-player-provider",
|
|
41
|
-
"data-mode": _unref(mappedOptions).mode,
|
|
42
|
-
"data-fullscreen": _unref(isFullscreen),
|
|
43
|
-
"data-touched": _unref(touched),
|
|
44
|
-
"data-playing": _unref(playing),
|
|
45
|
-
"data-paused": !_unref(playing),
|
|
46
|
-
"data-waiting": _unref(waiting),
|
|
47
|
-
"data-loaded": _unref(loaded),
|
|
48
|
-
"data-muted": _unref(muted),
|
|
49
|
-
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
|
|
50
|
-
(...args) => _unref(onMouseenter) && _unref(onMouseenter)(...args)),
|
|
51
|
-
onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
|
|
52
|
-
(...args) => _unref(onMouseleave) && _unref(onMouseleave)(...args))
|
|
53
|
-
}, [
|
|
54
|
-
_renderSlot(_ctx.$slots, "default")
|
|
55
|
-
], 40, _hoisted_1);
|
|
56
|
-
};
|
|
32
|
+
options: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: false
|
|
57
35
|
}
|
|
58
36
|
});
|
|
37
|
+
const mappedOptions = defu(options, defaultOptions);
|
|
38
|
+
const { initializeState, deleteState } = usePlayerState(id);
|
|
39
|
+
const state = initializeState();
|
|
40
|
+
const { playing, waiting, muted, loaded, isFullscreen, touched, mouseEntered } = toRefs(state);
|
|
41
|
+
function onMouseenter() {
|
|
42
|
+
mouseEntered.value = true;
|
|
43
|
+
}
|
|
44
|
+
function onMouseleave() {
|
|
45
|
+
mouseEntered.value = false;
|
|
46
|
+
}
|
|
47
|
+
onUnmounted(() => {
|
|
48
|
+
deleteState();
|
|
49
|
+
});
|
|
50
|
+
provide(MagicPlayerInstanceId, id);
|
|
51
|
+
provide(MagicPlayerOptionsKey, mappedOptions);
|
|
59
52
|
</script>
|
|
60
53
|
|
|
61
54
|
<style>
|
|
@@ -5,9 +5,9 @@ interface MagicPlayerProps {
|
|
|
5
5
|
options?: MagicPlayerOptions;
|
|
6
6
|
}
|
|
7
7
|
declare const mappedOptions: MagicPlayerOptions;
|
|
8
|
-
declare const playing: import("vue").
|
|
9
|
-
declare
|
|
10
|
-
declare
|
|
8
|
+
declare const playing: import("vue").Ref<boolean, boolean>, waiting: import("vue").Ref<boolean, boolean>, muted: import("vue").Ref<boolean, boolean>, loaded: import("vue").Ref<boolean, boolean>, isFullscreen: import("vue").Ref<boolean, boolean>, touched: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
declare function onMouseenter(): void;
|
|
10
|
+
declare function onMouseleave(): void;
|
|
11
11
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
12
12
|
declare var __VLS_1: {};
|
|
13
13
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
@@ -19,10 +19,10 @@ declare const __VLS_self: import("vue").DefineComponent<MagicPlayerProps, {
|
|
|
19
19
|
waiting: typeof waiting;
|
|
20
20
|
muted: typeof muted;
|
|
21
21
|
loaded: typeof loaded;
|
|
22
|
-
onMouseenter: typeof onMouseenter;
|
|
23
|
-
onMouseleave: typeof onMouseleave;
|
|
24
22
|
isFullscreen: typeof isFullscreen;
|
|
25
23
|
touched: typeof touched;
|
|
24
|
+
onMouseenter: typeof onMouseenter;
|
|
25
|
+
onMouseleave: typeof onMouseleave;
|
|
26
26
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
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>;
|
|
28
28
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -1,112 +1,63 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="track" class="magic-player-timeline">
|
|
3
|
+
<div
|
|
4
|
+
class="magic-player-timeline__target"
|
|
5
|
+
@pointerdown="onPointerdown"
|
|
6
|
+
@pointermove="onPointermove"
|
|
7
|
+
>
|
|
8
|
+
<div class="magic-player-timeline__track">
|
|
9
|
+
<div
|
|
10
|
+
class="magic-player-timeline__thumb"
|
|
11
|
+
:style="{ left: `${scrubbedPercentage}%` }"
|
|
12
|
+
>
|
|
13
|
+
<div class="magic-player-timeline__thumb-handle" />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="magic-player-timeline__inner-track">
|
|
16
|
+
<div
|
|
17
|
+
class="magic-player-timeline__buffered"
|
|
18
|
+
:style="{ left: `${bufferedPercentage}%` }"
|
|
19
|
+
/>
|
|
20
|
+
<div
|
|
21
|
+
v-show="controlsMouseEntered"
|
|
22
|
+
class="magic-player-timeline__seeked"
|
|
23
|
+
:style="{ left: `${seekedPercentage}%` }"
|
|
24
|
+
/>
|
|
25
|
+
<div
|
|
26
|
+
class="magic-player-timeline__scrubbed"
|
|
27
|
+
:style="{ left: `${scrubbedPercentage}%` }"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { inject, toRefs } from "vue";
|
|
8
37
|
import { usePlayerControlsApi } from "../composables/private/usePlayerControlsApi";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
34
|
-
_createElementVNode(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
class: "magic-player-timeline__target",
|
|
38
|
-
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
|
|
39
|
-
(...args) => _unref(onMouseenter) && _unref(onMouseenter)(...args)),
|
|
40
|
-
onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
|
|
41
|
-
(...args) => _unref(onMouseleave) && _unref(onMouseleave)(...args)),
|
|
42
|
-
onPointerdown: _cache[2] || (_cache[2] = //@ts-ignore
|
|
43
|
-
(...args) => _unref(onPointerdown) && _unref(onPointerdown)(...args)),
|
|
44
|
-
onPointerup: _cache[3] || (_cache[3] = //@ts-ignore
|
|
45
|
-
(...args) => _unref(onPointerup) && _unref(onPointerup)(...args)),
|
|
46
|
-
onPointermove: _cache[4] || (_cache[4] = //@ts-ignore
|
|
47
|
-
(...args) => _unref(onPointermove) && _unref(onPointermove)(...args))
|
|
48
|
-
},
|
|
49
|
-
[
|
|
50
|
-
_createElementVNode("div", _hoisted_2, [
|
|
51
|
-
_createElementVNode(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
class: "magic-player-timeline__thumb",
|
|
55
|
-
style: _normalizeStyle({ left: `${_unref(scrubbedPercentage)}%` })
|
|
56
|
-
},
|
|
57
|
-
_cache[5] || (_cache[5] = [
|
|
58
|
-
_createElementVNode(
|
|
59
|
-
"div",
|
|
60
|
-
{ class: "magic-player-timeline__thumb-handle" },
|
|
61
|
-
null,
|
|
62
|
-
-1
|
|
63
|
-
/* HOISTED */
|
|
64
|
-
)
|
|
65
|
-
]),
|
|
66
|
-
4
|
|
67
|
-
/* STYLE */
|
|
68
|
-
),
|
|
69
|
-
_createElementVNode("div", _hoisted_3, [
|
|
70
|
-
_createElementVNode(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
class: "magic-player-timeline__buffered",
|
|
74
|
-
style: _normalizeStyle({ left: `${_unref(bufferedPercentage)}%` })
|
|
75
|
-
},
|
|
76
|
-
null,
|
|
77
|
-
4
|
|
78
|
-
/* STYLE */
|
|
79
|
-
),
|
|
80
|
-
_withDirectives(_createElementVNode(
|
|
81
|
-
"div",
|
|
82
|
-
{
|
|
83
|
-
class: "magic-player-timeline__seeked",
|
|
84
|
-
style: _normalizeStyle({ left: `${_unref(seekedPercentage)}%` })
|
|
85
|
-
},
|
|
86
|
-
null,
|
|
87
|
-
4
|
|
88
|
-
/* STYLE */
|
|
89
|
-
), [
|
|
90
|
-
[_vShow, _unref(mouseEntered)]
|
|
91
|
-
]),
|
|
92
|
-
_createElementVNode(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
class: "magic-player-timeline__scrubbed",
|
|
96
|
-
style: _normalizeStyle({ left: `${_unref(scrubbedPercentage)}%` })
|
|
97
|
-
},
|
|
98
|
-
null,
|
|
99
|
-
4
|
|
100
|
-
/* STYLE */
|
|
101
|
-
)
|
|
102
|
-
])
|
|
103
|
-
])
|
|
104
|
-
],
|
|
105
|
-
32
|
|
106
|
-
/* NEED_HYDRATION */
|
|
107
|
-
)
|
|
108
|
-
]);
|
|
109
|
-
};
|
|
110
|
-
}
|
|
38
|
+
import { usePlayerState } from "../composables/private/usePlayerState";
|
|
39
|
+
import {
|
|
40
|
+
MagicPlayerInstanceId,
|
|
41
|
+
MagicPlayerTrackRef,
|
|
42
|
+
MagicPlayerPopoverRef,
|
|
43
|
+
MagicPlayerBarRef
|
|
44
|
+
} from "../symbols";
|
|
45
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
46
|
+
if (!instanceId) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
"MagicPlayerPoster must be nested inside MagicPlayerVideoControls or MagicPlayerAudioControls."
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
const { initializeState } = usePlayerState(instanceId);
|
|
52
|
+
const state = initializeState();
|
|
53
|
+
const { controlsMouseEntered, seekedPercentage, scrubbedPercentage } = toRefs(state);
|
|
54
|
+
const barRef = inject(MagicPlayerBarRef);
|
|
55
|
+
const trackRef = inject(MagicPlayerTrackRef);
|
|
56
|
+
const popoverRef = inject(MagicPlayerPopoverRef);
|
|
57
|
+
const { bufferedPercentage, onPointerdown, onPointermove } = usePlayerControlsApi({
|
|
58
|
+
id: instanceId,
|
|
59
|
+
barRef,
|
|
60
|
+
trackRef,
|
|
61
|
+
popoverRef
|
|
111
62
|
});
|
|
112
63
|
</script>
|