@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.30
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/README.md +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -1
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +32 -25
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +61 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +10 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +9 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +8 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +148 -154
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +7 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +13 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +9 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +8 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +1 -0
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +8 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +42 -74
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +9 -14
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +0 -1
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +82 -100
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +103 -53
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +284 -323
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +18 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +8 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +6 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +180 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +10 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +8 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +13 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +9 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +8 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +2 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +10 -6
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +93 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +123 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +9 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +117 -103
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +134 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +17 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +20 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +118 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +179 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +24 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +59 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +19 -35
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +60 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +43 -91
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +75 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +6 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +24 -21
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +8 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +90 -109
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +7 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +53 -81
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +6 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +11 -7
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- 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
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -1,66 +1,96 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
toRefs,
|
|
3
|
+
shallowRef,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
toValue
|
|
7
|
+
} from "vue";
|
|
2
8
|
import {
|
|
3
9
|
useResizeObserver,
|
|
4
10
|
useEventListener,
|
|
5
|
-
defaultWindow
|
|
11
|
+
defaultWindow,
|
|
12
|
+
useThrottleFn
|
|
6
13
|
} from "@vueuse/core";
|
|
14
|
+
import {
|
|
15
|
+
isIOS,
|
|
16
|
+
guardedReleasePointerCapture,
|
|
17
|
+
guardedSetPointerCapture
|
|
18
|
+
} from "@maas/vue-equipment/utils";
|
|
7
19
|
import { clampValue, mapValue } from "@maas/vue-equipment/utils";
|
|
8
|
-
import { usePlayerMediaApi } from "./usePlayerMediaApi.mjs";
|
|
9
20
|
import { usePlayerVideoApi } from "./usePlayerVideoApi.mjs";
|
|
10
|
-
import {
|
|
21
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
11
22
|
export function usePlayerControlsApi(args) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const { id, barRef, trackRef, popoverRef } = args;
|
|
24
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
25
|
+
const state = initializeState();
|
|
26
|
+
const {
|
|
27
|
+
currentTime,
|
|
28
|
+
duration,
|
|
29
|
+
dragging,
|
|
30
|
+
touched,
|
|
31
|
+
controlsMouseEntered,
|
|
32
|
+
seekedTime,
|
|
33
|
+
seekedPercentage,
|
|
34
|
+
scrubbedPercentage,
|
|
35
|
+
thumbPercentage,
|
|
36
|
+
popoverOffsetX,
|
|
37
|
+
playing,
|
|
38
|
+
buffered,
|
|
39
|
+
controlsBarRect,
|
|
40
|
+
controlsTrackRect,
|
|
41
|
+
controlsPopoverRect,
|
|
42
|
+
hasControls
|
|
43
|
+
} = toRefs(state);
|
|
44
|
+
const resumePlay = shallowRef(false);
|
|
45
|
+
let cancelPointerup = void 0;
|
|
46
|
+
let cancelPointermove = void 0;
|
|
47
|
+
let cancelTouchend = void 0;
|
|
26
48
|
const bufferedPercentage = computed(() => {
|
|
27
|
-
if (!buffered)
|
|
49
|
+
if (!buffered.value) {
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
28
52
|
const endBuffer = buffered.value?.length > 0 ? buffered.value[0][1] : 0;
|
|
29
53
|
const percentage = endBuffer / duration.value * 100;
|
|
30
54
|
return clampValue(percentage, 0, thumbPercentage.value);
|
|
31
55
|
});
|
|
56
|
+
const { play, pause, seek } = usePlayerVideoApi({ id });
|
|
32
57
|
function getPopoverOffsetX() {
|
|
33
|
-
if (!
|
|
34
|
-
return
|
|
35
|
-
} else {
|
|
36
|
-
const trackFactor = barRect.value.width / trackRect.value.width;
|
|
37
|
-
const offsetXPercentage = Math.abs(trackRect.value.x - barRect.value.x) / barRect.value.width * 100;
|
|
38
|
-
const popoverWidthPercentage = popoverRect.value.width / barRect.value.width * 100;
|
|
39
|
-
const maxPercentage = 100 - popoverWidthPercentage;
|
|
40
|
-
const percentage = seekedPercentage.value / trackFactor + offsetXPercentage - popoverWidthPercentage / 2;
|
|
41
|
-
popoverOffsetX.value = clampValue(percentage, 0, maxPercentage);
|
|
58
|
+
if (!controlsTrackRect.value || !controlsPopoverRect.value || !controlsBarRect.value) {
|
|
59
|
+
return;
|
|
42
60
|
}
|
|
61
|
+
const trackFactor = controlsBarRect.value.width / controlsTrackRect.value.width;
|
|
62
|
+
const offsetXPercentage = Math.abs(controlsTrackRect.value.x - controlsBarRect.value.x) / controlsBarRect.value.width * 100;
|
|
63
|
+
const popoverWidthPercentage = controlsPopoverRect.value.width / controlsBarRect.value.width * 100;
|
|
64
|
+
const maxPercentage = 100 - popoverWidthPercentage;
|
|
65
|
+
const percentage = seekedPercentage.value / trackFactor + offsetXPercentage - popoverWidthPercentage / 2;
|
|
66
|
+
popoverOffsetX.value = clampValue(percentage, 0, maxPercentage);
|
|
43
67
|
}
|
|
44
68
|
function getTimelineTrackSize() {
|
|
45
69
|
if (!toValue(trackRef)) {
|
|
46
70
|
return;
|
|
47
71
|
}
|
|
48
|
-
|
|
49
|
-
thumbPercentage.value = 100 -
|
|
72
|
+
controlsTrackRect.value = toValue(trackRef).getBoundingClientRect();
|
|
73
|
+
thumbPercentage.value = 100 - controlsTrackRect.value.height / controlsTrackRect.value.width * 100;
|
|
50
74
|
}
|
|
51
75
|
function getPopoverSizes() {
|
|
52
76
|
if (!toValue(barRef) || !toValue(popoverRef)) {
|
|
53
77
|
return;
|
|
54
78
|
}
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
controlsBarRect.value = toValue(barRef).getBoundingClientRect();
|
|
80
|
+
controlsPopoverRect.value = toValue(popoverRef).getBoundingClientRect();
|
|
57
81
|
}
|
|
82
|
+
function getSizes() {
|
|
83
|
+
getTimelineTrackSize();
|
|
84
|
+
getPopoverSizes();
|
|
85
|
+
getPopoverOffsetX();
|
|
86
|
+
}
|
|
87
|
+
const getSizesThrottled = useThrottleFn(getSizes, 100);
|
|
58
88
|
function seekToTrackPosition(absX) {
|
|
59
|
-
if (!
|
|
60
|
-
|
|
89
|
+
if (!controlsTrackRect.value) {
|
|
90
|
+
return;
|
|
61
91
|
}
|
|
62
|
-
const relX = absX -
|
|
63
|
-
const percentage = Math.round(relX /
|
|
92
|
+
const relX = absX - controlsTrackRect.value.x - controlsTrackRect.value.height / 2;
|
|
93
|
+
const percentage = Math.round(relX / controlsTrackRect.value.width * 100);
|
|
64
94
|
seekedPercentage.value = clampValue(percentage, 0, thumbPercentage.value);
|
|
65
95
|
seekedTime.value = duration.value * mapValue(seekedPercentage.value, 0, thumbPercentage.value, 0, 100) / 100;
|
|
66
96
|
if (dragging.value) {
|
|
@@ -69,220 +99,126 @@ export function usePlayerControlsApi(args) {
|
|
|
69
99
|
}
|
|
70
100
|
getPopoverOffsetX();
|
|
71
101
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
102
|
+
function resetTimelineState() {
|
|
103
|
+
seekedTime.value = null;
|
|
104
|
+
seekedPercentage.value = 0;
|
|
105
|
+
popoverOffsetX.value = null;
|
|
76
106
|
}
|
|
77
|
-
function
|
|
78
|
-
mouseEntered.value = false;
|
|
107
|
+
function resetStateAndListeners() {
|
|
79
108
|
dragging.value = false;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
resumePlay.value = playing.value;
|
|
85
|
-
pause();
|
|
86
|
-
const x = e instanceof MouseEvent ? e.pageX : e.touches[0].pageX;
|
|
87
|
-
seekToTrackPosition(x);
|
|
109
|
+
touched.value = false;
|
|
110
|
+
cancelTouchend?.();
|
|
111
|
+
cancelPointerup?.();
|
|
112
|
+
cancelPointermove?.();
|
|
88
113
|
}
|
|
89
|
-
function onPointerup() {
|
|
90
|
-
|
|
114
|
+
function onPointerup(e) {
|
|
115
|
+
resetStateAndListeners();
|
|
116
|
+
resetTimelineState();
|
|
117
|
+
guardedReleasePointerCapture({ event: e, element: barRef?.value });
|
|
91
118
|
if (resumePlay.value) {
|
|
92
119
|
play();
|
|
93
120
|
}
|
|
94
121
|
}
|
|
95
122
|
function onPointermove(e) {
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
if (!e.isPrimary) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
getSizesThrottled();
|
|
127
|
+
e.stopImmediatePropagation();
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
seekToTrackPosition(e.clientX);
|
|
98
130
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
getTimelineTrackSize();
|
|
119
|
-
getPopoverSizes();
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
passive: true
|
|
131
|
+
function onPointerdown(e) {
|
|
132
|
+
if (dragging.value) {
|
|
133
|
+
return;
|
|
134
|
+
} else {
|
|
135
|
+
guardedSetPointerCapture({ event: e, element: barRef?.value });
|
|
136
|
+
resumePlay.value = playing.value;
|
|
137
|
+
dragging.value = true;
|
|
138
|
+
touched.value = true;
|
|
139
|
+
pause();
|
|
140
|
+
getSizes();
|
|
141
|
+
cancelPointerup = useEventListener(document, "pointerup", onPointerup);
|
|
142
|
+
cancelPointermove = useEventListener(
|
|
143
|
+
document,
|
|
144
|
+
"pointermove",
|
|
145
|
+
onPointermove,
|
|
146
|
+
{ passive: false }
|
|
147
|
+
);
|
|
148
|
+
cancelTouchend = isIOS() ? useEventListener(document, "touchend", onPointerup) : void 0;
|
|
149
|
+
onPointermove(e);
|
|
123
150
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
case "mouseEntered": {
|
|
135
|
-
mouseEntered.value = payload.value;
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
case "seekedTime": {
|
|
139
|
-
seekedTime.value = payload.value;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case "seekedPercentage": {
|
|
143
|
-
seekedPercentage.value = payload.value;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case "scrubbedPercentage": {
|
|
147
|
-
scrubbedPercentage.value = payload.value;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
case "thumbPercentage": {
|
|
151
|
-
thumbPercentage.value = payload.value;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
case "popoverOffsetX": {
|
|
155
|
-
popoverOffsetX.value = payload.value;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
case "barRect": {
|
|
159
|
-
barRect.value = payload.value;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
case "trackRect": {
|
|
163
|
-
trackRect.value = payload.value;
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
case "popoverRect": {
|
|
167
|
-
popoverRect.value = payload.value;
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
151
|
+
}
|
|
152
|
+
function onMouseenter() {
|
|
153
|
+
getSizes();
|
|
154
|
+
controlsMouseEntered.value = true;
|
|
155
|
+
}
|
|
156
|
+
function onMouseleave() {
|
|
157
|
+
controlsMouseEntered.value = false;
|
|
158
|
+
if (!dragging.value) {
|
|
159
|
+
resetTimelineState();
|
|
171
160
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
api: "controls",
|
|
201
|
-
key: "seekedPercentage",
|
|
202
|
-
value
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
watch(scrubbedPercentage, (value) => {
|
|
206
|
-
emitter.emit("update", {
|
|
207
|
-
id: toValue(id),
|
|
208
|
-
api: "controls",
|
|
209
|
-
key: "scrubbedPercentage",
|
|
210
|
-
value
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
watch(bufferedPercentage, (value) => {
|
|
214
|
-
emitter.emit("update", {
|
|
215
|
-
id: toValue(id),
|
|
216
|
-
api: "controls",
|
|
217
|
-
key: "bufferedPercentage",
|
|
218
|
-
value
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
watch(thumbPercentage, (value) => {
|
|
222
|
-
emitter.emit("update", {
|
|
223
|
-
id: toValue(id),
|
|
224
|
-
api: "controls",
|
|
225
|
-
key: "thumbPercentage",
|
|
226
|
-
value
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
watch(popoverOffsetX, (value) => {
|
|
230
|
-
emitter.emit("update", {
|
|
231
|
-
id: toValue(id),
|
|
232
|
-
api: "controls",
|
|
233
|
-
key: "popoverOffsetX",
|
|
234
|
-
value
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
watch(resumePlay, (value) => {
|
|
238
|
-
emitter.emit("update", {
|
|
239
|
-
id: toValue(id),
|
|
240
|
-
api: "controls",
|
|
241
|
-
key: "resumePlay",
|
|
242
|
-
value
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
watch(barRect, (value) => {
|
|
246
|
-
if (!value) return;
|
|
247
|
-
emitter.emit("update", {
|
|
248
|
-
id: toValue(id),
|
|
249
|
-
api: "controls",
|
|
250
|
-
key: "barRect",
|
|
251
|
-
value
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
watch(trackRect, (value) => {
|
|
255
|
-
if (!value) return;
|
|
256
|
-
emitter.emit("update", {
|
|
257
|
-
id: toValue(id),
|
|
258
|
-
api: "controls",
|
|
259
|
-
key: "trackRect",
|
|
260
|
-
value
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
watch(popoverRect, (value) => {
|
|
264
|
-
if (!value) return;
|
|
265
|
-
emitter.emit("update", {
|
|
266
|
-
id: toValue(id),
|
|
267
|
-
api: "controls",
|
|
268
|
-
key: "popoverRect",
|
|
269
|
-
value
|
|
161
|
+
}
|
|
162
|
+
function onMouseleaveTimeline() {
|
|
163
|
+
if (!dragging.value) {
|
|
164
|
+
resetTimelineState();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
let watchTrack = null;
|
|
168
|
+
let watchPopover = null;
|
|
169
|
+
let watchBar = null;
|
|
170
|
+
let watchCurrentTime = null;
|
|
171
|
+
let resizeObserverTrack = null;
|
|
172
|
+
let resizeObserverPopover = null;
|
|
173
|
+
let resizeObserverBar = null;
|
|
174
|
+
let windowResizeCleanup = null;
|
|
175
|
+
function initialize() {
|
|
176
|
+
hasControls.value = true;
|
|
177
|
+
watchTrack = watch(() => trackRef, getTimelineTrackSize);
|
|
178
|
+
watchPopover = watch(() => popoverRef, getPopoverSizes);
|
|
179
|
+
watchBar = watch(() => barRef, getPopoverSizes);
|
|
180
|
+
watchCurrentTime = watch(currentTime, (value) => {
|
|
181
|
+
const percentage = value / duration?.value * 100;
|
|
182
|
+
scrubbedPercentage.value = mapValue(
|
|
183
|
+
percentage,
|
|
184
|
+
0,
|
|
185
|
+
100,
|
|
186
|
+
0,
|
|
187
|
+
thumbPercentage.value
|
|
188
|
+
);
|
|
270
189
|
});
|
|
271
|
-
|
|
190
|
+
resizeObserverTrack = useResizeObserver(trackRef, getTimelineTrackSize);
|
|
191
|
+
resizeObserverPopover = useResizeObserver(popoverRef, getPopoverSizes);
|
|
192
|
+
resizeObserverBar = useResizeObserver(barRef, getPopoverSizes);
|
|
193
|
+
windowResizeCleanup = useEventListener(
|
|
194
|
+
defaultWindow,
|
|
195
|
+
"resize",
|
|
196
|
+
() => {
|
|
197
|
+
getSizes();
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
passive: true
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function destroy() {
|
|
205
|
+
watchTrack?.();
|
|
206
|
+
watchPopover?.();
|
|
207
|
+
watchBar?.();
|
|
208
|
+
watchCurrentTime?.();
|
|
209
|
+
resizeObserverTrack?.stop();
|
|
210
|
+
resizeObserverPopover?.stop();
|
|
211
|
+
resizeObserverBar?.stop();
|
|
212
|
+
windowResizeCleanup?.();
|
|
213
|
+
}
|
|
272
214
|
return {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
seekedTime,
|
|
276
|
-
seekedPercentage,
|
|
277
|
-
scrubbedPercentage,
|
|
215
|
+
initialize,
|
|
216
|
+
destroy,
|
|
278
217
|
bufferedPercentage,
|
|
279
|
-
thumbPercentage,
|
|
280
|
-
popoverOffsetX,
|
|
281
218
|
onMouseenter,
|
|
282
219
|
onMouseleave,
|
|
220
|
+
onMouseleaveTimeline,
|
|
283
221
|
onPointerdown,
|
|
284
|
-
|
|
285
|
-
onPointermove,
|
|
286
|
-
trackRect
|
|
222
|
+
onPointermove
|
|
287
223
|
};
|
|
288
224
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
export type UsePlayerEmitterArgs = {
|
|
3
|
+
id: MaybeRef<string>;
|
|
4
|
+
};
|
|
5
|
+
export declare function usePlayerEmitter(args: UsePlayerEmitterArgs): {
|
|
6
|
+
initializeEmitter: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type UsePlayerEmitterReturn = ReturnType<typeof usePlayerEmitter>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { toRefs, watch, toValue } from "vue";
|
|
2
|
+
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
3
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
4
|
+
export function usePlayerEmitter(args) {
|
|
5
|
+
const { id } = args;
|
|
6
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
7
|
+
const state = initializeState();
|
|
8
|
+
const {
|
|
9
|
+
dragging,
|
|
10
|
+
ended,
|
|
11
|
+
fullscreen,
|
|
12
|
+
loaded,
|
|
13
|
+
muted,
|
|
14
|
+
paused,
|
|
15
|
+
playing,
|
|
16
|
+
rate,
|
|
17
|
+
stalled,
|
|
18
|
+
started,
|
|
19
|
+
touched,
|
|
20
|
+
volume,
|
|
21
|
+
waiting
|
|
22
|
+
} = toRefs(state);
|
|
23
|
+
const emitter = useMagicEmitter();
|
|
24
|
+
function initializeEmitter() {
|
|
25
|
+
watch(dragging, (newDragging) => {
|
|
26
|
+
if (newDragging) {
|
|
27
|
+
emitter.emit("onDragStart", toValue(id));
|
|
28
|
+
}
|
|
29
|
+
if (!newDragging) {
|
|
30
|
+
emitter.emit("onDragEnd", toValue(id));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
watch(ended, (newEnded) => {
|
|
34
|
+
if (newEnded) {
|
|
35
|
+
emitter.emit("onEnd", toValue(id));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
watch(fullscreen, (newFullscreen) => {
|
|
39
|
+
if (newFullscreen) {
|
|
40
|
+
emitter.emit("onFullscreenEnter", toValue(id));
|
|
41
|
+
}
|
|
42
|
+
if (!newFullscreen) {
|
|
43
|
+
emitter.emit("onFullscreenLeave", toValue(id));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
watch(loaded, (newLoaded) => {
|
|
47
|
+
if (newLoaded) {
|
|
48
|
+
emitter.emit("onLoad", toValue(id));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
watch(muted, (newMuted) => {
|
|
52
|
+
if (newMuted) {
|
|
53
|
+
emitter.emit("onMute", toValue(id));
|
|
54
|
+
}
|
|
55
|
+
if (!newMuted) {
|
|
56
|
+
emitter.emit("onUnmute", toValue(id));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
watch(paused, (newPaused) => {
|
|
60
|
+
if (newPaused) {
|
|
61
|
+
emitter.emit("onPause", toValue(id));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
watch(playing, (newPlaying) => {
|
|
65
|
+
if (newPlaying) {
|
|
66
|
+
emitter.emit("onPlay", toValue(id));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
watch(rate, (newRate) => {
|
|
70
|
+
if (newRate) {
|
|
71
|
+
emitter.emit("onRateChange", toValue(id));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
watch(started, (newStarted) => {
|
|
75
|
+
if (newStarted) {
|
|
76
|
+
emitter.emit("onStart", toValue(id));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
watch(stalled, (newStalled) => {
|
|
80
|
+
if (newStalled) {
|
|
81
|
+
emitter.emit("onStall", toValue(id));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
watch(touched, (newTouched) => {
|
|
85
|
+
if (newTouched) {
|
|
86
|
+
emitter.emit("onTouch", toValue(id));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
watch(volume, (newVolume) => {
|
|
90
|
+
if (newVolume) {
|
|
91
|
+
emitter.emit("onVolumeChange", toValue(id));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
watch(waiting, (newWaiting) => {
|
|
95
|
+
if (newWaiting) {
|
|
96
|
+
emitter.emit("onWait", toValue(id));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
initializeEmitter
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { Buffered } from '../../types/index.js';
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
3
2
|
export type UsePlayerMediaApiArgs = {
|
|
4
3
|
id: MaybeRef<string>;
|
|
5
|
-
mediaRef?:
|
|
6
|
-
};
|
|
7
|
-
export declare function usePlayerMediaApi(args: UsePlayerMediaApiArgs): {
|
|
8
|
-
currentTime: import("vue").Ref<number, number>;
|
|
9
|
-
remainingTime: import("vue").ComputedRef<number>;
|
|
10
|
-
duration: import("vue").Ref<number, number>;
|
|
11
|
-
seeking: import("vue").Ref<boolean, boolean>;
|
|
12
|
-
volume: import("vue").Ref<number, number>;
|
|
13
|
-
rate: import("vue").Ref<number, number>;
|
|
14
|
-
waiting: import("vue").Ref<boolean, boolean>;
|
|
15
|
-
ended: import("vue").Ref<boolean, boolean>;
|
|
16
|
-
playing: import("vue").Ref<boolean, boolean>;
|
|
17
|
-
stalled: import("vue").Ref<boolean, boolean>;
|
|
18
|
-
buffered: import("vue").Ref<[number, number][], Buffered | [number, number][]>;
|
|
19
|
-
muted: import("vue").Ref<boolean, boolean>;
|
|
4
|
+
mediaRef?: Ref<HTMLMediaElement | null>;
|
|
20
5
|
};
|
|
6
|
+
export declare function usePlayerMediaApi(args: UsePlayerMediaApiArgs): void;
|
|
21
7
|
export type UsePlayerMediaApiReturn = ReturnType<typeof usePlayerMediaApi>;
|