@maas/vue-equipment 0.40.0 → 1.0.0-beta.10
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 +6 -16
- package/dist/composables/index.d.ts +7 -18
- package/dist/composables/index.js +79 -132
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +35 -42
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +5 -0
- package/dist/plugins/.turbo/turbo-release.log +7 -0
- package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
- package/dist/plugins/MagicAccordion/index.d.ts +2 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
- package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
- package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
- package/dist/plugins/MagicCommand/index.d.ts +2 -0
- package/dist/plugins/MagicCommand/index.mjs +9 -11
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
- package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
- package/dist/plugins/MagicCookie/index.d.ts +5 -3
- package/dist/plugins/MagicCookie/index.mjs +7 -3
- package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
- package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
- package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
- package/dist/plugins/MagicMenu/index.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -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/src/components/MagicModal.vue +266 -166
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -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/index.d.ts +4 -9
- package/dist/plugins/MagicPlayer/index.mjs +11 -17
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
- package/dist/plugins/MagicScroll/index.d.ts +4 -10
- package/dist/plugins/MagicScroll/index.mjs +2 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
- package/dist/plugins/MagicToast/index.d.ts +3 -2
- package/dist/plugins/MagicToast/index.mjs +3 -3
- package/dist/plugins/MagicToast/nuxt.mjs +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
- package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
- package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
- package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
- package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/utils/css/animations/auto-size-out.css +12 -0
- package/dist/utils/css/animations/squash-y.css +5 -0
- package/dist/utils/css/animations.css +2 -1
- package/dist/utils/index.d.ts +10 -6
- package/dist/utils/index.js +41 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +62 -58
- package/dist/composables/index.d.mts +0 -108
- package/dist/composables/index.mjs +0 -383
- package/dist/composables/index.mjs.map +0 -1
- package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
- package/dist/plugins/MagicAutoSize/index.mjs +0 -7
- package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
- package/dist/utils/index.d.mts +0 -80
- package/dist/utils/index.mjs +0 -200
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
shallowRef,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
toValue
|
|
7
|
+
} from "vue";
|
|
2
8
|
import {
|
|
3
9
|
useResizeObserver,
|
|
4
10
|
useEventListener,
|
|
@@ -9,24 +15,20 @@ import { usePlayerMediaApi } from "./usePlayerMediaApi.mjs";
|
|
|
9
15
|
import { usePlayerVideoApi } from "./usePlayerVideoApi.mjs";
|
|
10
16
|
import { usePlayerStateEmitter } from "./usePlayerStateEmitter.mjs";
|
|
11
17
|
export function usePlayerControlsApi(args) {
|
|
12
|
-
const resumePlay =
|
|
18
|
+
const resumePlay = shallowRef(false);
|
|
13
19
|
const barRect = ref(void 0);
|
|
14
20
|
const trackRect = ref(void 0);
|
|
15
21
|
const popoverRect = ref(void 0);
|
|
16
|
-
const { trackRef, barRef, popoverRef } = args;
|
|
17
|
-
const { buffered, duration, playing, currentTime } = usePlayerMediaApi({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const seekedPercentage = ref(0);
|
|
27
|
-
const scrubbedPercentage = ref(0);
|
|
28
|
-
const thumbPercentage = ref(0);
|
|
29
|
-
const popoverOffsetX = ref(0);
|
|
22
|
+
const { id, trackRef, barRef, popoverRef } = args;
|
|
23
|
+
const { buffered, duration, playing, currentTime } = usePlayerMediaApi({ id });
|
|
24
|
+
const { play, pause, seek } = usePlayerVideoApi({ id });
|
|
25
|
+
const dragging = shallowRef(false);
|
|
26
|
+
const mouseEntered = shallowRef(false);
|
|
27
|
+
const seekedTime = shallowRef(0);
|
|
28
|
+
const seekedPercentage = shallowRef(0);
|
|
29
|
+
const scrubbedPercentage = shallowRef(0);
|
|
30
|
+
const thumbPercentage = shallowRef(0);
|
|
31
|
+
const popoverOffsetX = shallowRef(0);
|
|
30
32
|
const bufferedPercentage = computed(() => {
|
|
31
33
|
if (!buffered) return 0;
|
|
32
34
|
const endBuffer = buffered.value?.length > 0 ? buffered.value[0][1] : 0;
|
|
@@ -119,8 +121,8 @@ export function usePlayerControlsApi(args) {
|
|
|
119
121
|
defaultWindow,
|
|
120
122
|
"resize",
|
|
121
123
|
() => {
|
|
122
|
-
getTimelineTrackSize;
|
|
123
|
-
getPopoverSizes;
|
|
124
|
+
getTimelineTrackSize();
|
|
125
|
+
getPopoverSizes();
|
|
124
126
|
},
|
|
125
127
|
{
|
|
126
128
|
passive: true
|
|
@@ -128,7 +130,7 @@ export function usePlayerControlsApi(args) {
|
|
|
128
130
|
);
|
|
129
131
|
const emitter = usePlayerStateEmitter();
|
|
130
132
|
emitter.on("update", (payload) => {
|
|
131
|
-
if (payload.id !== toValue(
|
|
133
|
+
if (payload.id !== toValue(id)) return;
|
|
132
134
|
if (payload.api === "controls") {
|
|
133
135
|
switch (payload.key) {
|
|
134
136
|
case "dragging": {
|
|
@@ -176,7 +178,7 @@ export function usePlayerControlsApi(args) {
|
|
|
176
178
|
});
|
|
177
179
|
watch(dragging, (value) => {
|
|
178
180
|
emitter.emit("update", {
|
|
179
|
-
id: toValue(
|
|
181
|
+
id: toValue(id),
|
|
180
182
|
api: "controls",
|
|
181
183
|
key: "dragging",
|
|
182
184
|
value
|
|
@@ -184,7 +186,7 @@ export function usePlayerControlsApi(args) {
|
|
|
184
186
|
});
|
|
185
187
|
watch(mouseEntered, (value) => {
|
|
186
188
|
emitter.emit("update", {
|
|
187
|
-
id: toValue(
|
|
189
|
+
id: toValue(id),
|
|
188
190
|
api: "controls",
|
|
189
191
|
key: "mouseEntered",
|
|
190
192
|
value
|
|
@@ -192,7 +194,7 @@ export function usePlayerControlsApi(args) {
|
|
|
192
194
|
});
|
|
193
195
|
watch(seekedTime, (value) => {
|
|
194
196
|
emitter.emit("update", {
|
|
195
|
-
id: toValue(
|
|
197
|
+
id: toValue(id),
|
|
196
198
|
api: "controls",
|
|
197
199
|
key: "seekedTime",
|
|
198
200
|
value
|
|
@@ -200,7 +202,7 @@ export function usePlayerControlsApi(args) {
|
|
|
200
202
|
});
|
|
201
203
|
watch(seekedPercentage, (value) => {
|
|
202
204
|
emitter.emit("update", {
|
|
203
|
-
id: toValue(
|
|
205
|
+
id: toValue(id),
|
|
204
206
|
api: "controls",
|
|
205
207
|
key: "seekedPercentage",
|
|
206
208
|
value
|
|
@@ -208,7 +210,7 @@ export function usePlayerControlsApi(args) {
|
|
|
208
210
|
});
|
|
209
211
|
watch(scrubbedPercentage, (value) => {
|
|
210
212
|
emitter.emit("update", {
|
|
211
|
-
id: toValue(
|
|
213
|
+
id: toValue(id),
|
|
212
214
|
api: "controls",
|
|
213
215
|
key: "scrubbedPercentage",
|
|
214
216
|
value
|
|
@@ -216,7 +218,7 @@ export function usePlayerControlsApi(args) {
|
|
|
216
218
|
});
|
|
217
219
|
watch(bufferedPercentage, (value) => {
|
|
218
220
|
emitter.emit("update", {
|
|
219
|
-
id: toValue(
|
|
221
|
+
id: toValue(id),
|
|
220
222
|
api: "controls",
|
|
221
223
|
key: "bufferedPercentage",
|
|
222
224
|
value
|
|
@@ -224,7 +226,7 @@ export function usePlayerControlsApi(args) {
|
|
|
224
226
|
});
|
|
225
227
|
watch(thumbPercentage, (value) => {
|
|
226
228
|
emitter.emit("update", {
|
|
227
|
-
id: toValue(
|
|
229
|
+
id: toValue(id),
|
|
228
230
|
api: "controls",
|
|
229
231
|
key: "thumbPercentage",
|
|
230
232
|
value
|
|
@@ -232,7 +234,7 @@ export function usePlayerControlsApi(args) {
|
|
|
232
234
|
});
|
|
233
235
|
watch(popoverOffsetX, (value) => {
|
|
234
236
|
emitter.emit("update", {
|
|
235
|
-
id: toValue(
|
|
237
|
+
id: toValue(id),
|
|
236
238
|
api: "controls",
|
|
237
239
|
key: "popoverOffsetX",
|
|
238
240
|
value
|
|
@@ -240,7 +242,7 @@ export function usePlayerControlsApi(args) {
|
|
|
240
242
|
});
|
|
241
243
|
watch(resumePlay, (value) => {
|
|
242
244
|
emitter.emit("update", {
|
|
243
|
-
id: toValue(
|
|
245
|
+
id: toValue(id),
|
|
244
246
|
api: "controls",
|
|
245
247
|
key: "resumePlay",
|
|
246
248
|
value
|
|
@@ -249,7 +251,7 @@ export function usePlayerControlsApi(args) {
|
|
|
249
251
|
watch(barRect, (value) => {
|
|
250
252
|
if (!value) return;
|
|
251
253
|
emitter.emit("update", {
|
|
252
|
-
id: toValue(
|
|
254
|
+
id: toValue(id),
|
|
253
255
|
api: "controls",
|
|
254
256
|
key: "barRect",
|
|
255
257
|
value
|
|
@@ -258,7 +260,7 @@ export function usePlayerControlsApi(args) {
|
|
|
258
260
|
watch(trackRect, (value) => {
|
|
259
261
|
if (!value) return;
|
|
260
262
|
emitter.emit("update", {
|
|
261
|
-
id: toValue(
|
|
263
|
+
id: toValue(id),
|
|
262
264
|
api: "controls",
|
|
263
265
|
key: "trackRect",
|
|
264
266
|
value
|
|
@@ -267,7 +269,7 @@ export function usePlayerControlsApi(args) {
|
|
|
267
269
|
watch(popoverRect, (value) => {
|
|
268
270
|
if (!value) return;
|
|
269
271
|
emitter.emit("update", {
|
|
270
|
-
id: toValue(
|
|
272
|
+
id: toValue(id),
|
|
271
273
|
api: "controls",
|
|
272
274
|
key: "popoverRect",
|
|
273
275
|
value
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { Buffered } from '../../types/index.js';
|
|
3
3
|
export type UsePlayerMediaApiArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mediaRef?:
|
|
5
|
+
mediaRef?: Ref<HTMLMediaElement | null>;
|
|
6
6
|
};
|
|
7
7
|
export declare function usePlayerMediaApi(args: UsePlayerMediaApiArgs): {
|
|
8
|
-
currentTime: import("vue").
|
|
8
|
+
currentTime: import("vue").ShallowRef<number, number>;
|
|
9
9
|
remainingTime: import("vue").ComputedRef<number>;
|
|
10
|
-
duration: import("vue").
|
|
11
|
-
seeking: import("vue").
|
|
12
|
-
volume: import("vue").
|
|
13
|
-
rate: import("vue").
|
|
14
|
-
waiting: import("vue").
|
|
15
|
-
ended: import("vue").
|
|
16
|
-
playing: import("vue").
|
|
17
|
-
stalled: import("vue").
|
|
18
|
-
buffered:
|
|
19
|
-
muted: import("vue").
|
|
10
|
+
duration: import("vue").ShallowRef<number, number>;
|
|
11
|
+
seeking: import("vue").ShallowRef<boolean, boolean>;
|
|
12
|
+
volume: import("vue").ShallowRef<number, number>;
|
|
13
|
+
rate: import("vue").ShallowRef<number, number>;
|
|
14
|
+
waiting: import("vue").ShallowRef<boolean, boolean>;
|
|
15
|
+
ended: import("vue").ShallowRef<boolean, boolean>;
|
|
16
|
+
playing: import("vue").ShallowRef<boolean, boolean>;
|
|
17
|
+
stalled: import("vue").ShallowRef<boolean, boolean>;
|
|
18
|
+
buffered: Ref<[number, number][], Buffered | [number, number][]>;
|
|
19
|
+
muted: import("vue").ShallowRef<boolean, boolean>;
|
|
20
20
|
};
|
|
21
21
|
export type UsePlayerMediaApiReturn = ReturnType<typeof usePlayerMediaApi>;
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
shallowRef,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
unref,
|
|
7
|
+
toValue
|
|
8
|
+
} from "vue";
|
|
2
9
|
import { useEventListener, watchIgnorable } from "@vueuse/core";
|
|
3
10
|
import { usePlayerStateEmitter } from "./usePlayerStateEmitter.mjs";
|
|
4
11
|
export function usePlayerMediaApi(args) {
|
|
5
|
-
const currentTime =
|
|
6
|
-
const duration =
|
|
7
|
-
const seeking =
|
|
8
|
-
const volume =
|
|
9
|
-
const rate =
|
|
10
|
-
const waiting =
|
|
11
|
-
const ended =
|
|
12
|
-
const playing =
|
|
13
|
-
const stalled =
|
|
12
|
+
const currentTime = shallowRef(0);
|
|
13
|
+
const duration = shallowRef(0);
|
|
14
|
+
const seeking = shallowRef(false);
|
|
15
|
+
const volume = shallowRef(1);
|
|
16
|
+
const rate = shallowRef(1);
|
|
17
|
+
const waiting = shallowRef(false);
|
|
18
|
+
const ended = shallowRef(false);
|
|
19
|
+
const playing = shallowRef(false);
|
|
20
|
+
const stalled = shallowRef(false);
|
|
14
21
|
const buffered = ref([]);
|
|
15
|
-
const muted =
|
|
16
|
-
const { mediaRef } = args;
|
|
22
|
+
const muted = shallowRef(false);
|
|
23
|
+
const { mediaRef, id } = args;
|
|
17
24
|
const remainingTime = computed(() => duration.value - currentTime.value);
|
|
18
25
|
function timeRangeToArray(timeRanges) {
|
|
19
26
|
let ranges = [];
|
|
@@ -122,7 +129,7 @@ export function usePlayerMediaApi(args) {
|
|
|
122
129
|
});
|
|
123
130
|
const emitter = usePlayerStateEmitter();
|
|
124
131
|
emitter.on("update", (payload) => {
|
|
125
|
-
if (payload.id !== toValue(
|
|
132
|
+
if (payload.id !== toValue(id)) return;
|
|
126
133
|
if (payload.api === "media") {
|
|
127
134
|
switch (payload.key) {
|
|
128
135
|
case "currentTime":
|
|
@@ -163,7 +170,7 @@ export function usePlayerMediaApi(args) {
|
|
|
163
170
|
});
|
|
164
171
|
watch(currentTime, (value) => {
|
|
165
172
|
emitter.emit("update", {
|
|
166
|
-
id: toValue(
|
|
173
|
+
id: toValue(id),
|
|
167
174
|
api: "media",
|
|
168
175
|
key: "currentTime",
|
|
169
176
|
value
|
|
@@ -171,7 +178,7 @@ export function usePlayerMediaApi(args) {
|
|
|
171
178
|
});
|
|
172
179
|
watch(duration, (value) => {
|
|
173
180
|
emitter.emit("update", {
|
|
174
|
-
id: toValue(
|
|
181
|
+
id: toValue(id),
|
|
175
182
|
api: "media",
|
|
176
183
|
key: "duration",
|
|
177
184
|
value
|
|
@@ -179,7 +186,7 @@ export function usePlayerMediaApi(args) {
|
|
|
179
186
|
});
|
|
180
187
|
watch(seeking, (value) => {
|
|
181
188
|
emitter.emit("update", {
|
|
182
|
-
id: toValue(
|
|
189
|
+
id: toValue(id),
|
|
183
190
|
api: "media",
|
|
184
191
|
key: "seeking",
|
|
185
192
|
value
|
|
@@ -187,7 +194,7 @@ export function usePlayerMediaApi(args) {
|
|
|
187
194
|
});
|
|
188
195
|
watch(volume, (value) => {
|
|
189
196
|
emitter.emit("update", {
|
|
190
|
-
id: toValue(
|
|
197
|
+
id: toValue(id),
|
|
191
198
|
api: "media",
|
|
192
199
|
key: "volume",
|
|
193
200
|
value
|
|
@@ -195,7 +202,7 @@ export function usePlayerMediaApi(args) {
|
|
|
195
202
|
});
|
|
196
203
|
watch(rate, (value) => {
|
|
197
204
|
emitter.emit("update", {
|
|
198
|
-
id: toValue(
|
|
205
|
+
id: toValue(id),
|
|
199
206
|
api: "media",
|
|
200
207
|
key: "rate",
|
|
201
208
|
value
|
|
@@ -203,7 +210,7 @@ export function usePlayerMediaApi(args) {
|
|
|
203
210
|
});
|
|
204
211
|
watch(waiting, (value) => {
|
|
205
212
|
emitter.emit("update", {
|
|
206
|
-
id: toValue(
|
|
213
|
+
id: toValue(id),
|
|
207
214
|
api: "media",
|
|
208
215
|
key: "waiting",
|
|
209
216
|
value
|
|
@@ -211,7 +218,7 @@ export function usePlayerMediaApi(args) {
|
|
|
211
218
|
});
|
|
212
219
|
watch(ended, (value) => {
|
|
213
220
|
emitter.emit("update", {
|
|
214
|
-
id: toValue(
|
|
221
|
+
id: toValue(id),
|
|
215
222
|
api: "media",
|
|
216
223
|
key: "ended",
|
|
217
224
|
value
|
|
@@ -219,7 +226,7 @@ export function usePlayerMediaApi(args) {
|
|
|
219
226
|
});
|
|
220
227
|
watch(playing, (value) => {
|
|
221
228
|
emitter.emit("update", {
|
|
222
|
-
id: toValue(
|
|
229
|
+
id: toValue(id),
|
|
223
230
|
api: "media",
|
|
224
231
|
key: "playing",
|
|
225
232
|
value
|
|
@@ -227,7 +234,7 @@ export function usePlayerMediaApi(args) {
|
|
|
227
234
|
});
|
|
228
235
|
watch(stalled, (value) => {
|
|
229
236
|
emitter.emit("update", {
|
|
230
|
-
id: toValue(
|
|
237
|
+
id: toValue(id),
|
|
231
238
|
api: "media",
|
|
232
239
|
key: "stalled",
|
|
233
240
|
value
|
|
@@ -235,7 +242,7 @@ export function usePlayerMediaApi(args) {
|
|
|
235
242
|
});
|
|
236
243
|
watch(buffered, (value) => {
|
|
237
244
|
emitter.emit("update", {
|
|
238
|
-
id: toValue(
|
|
245
|
+
id: toValue(id),
|
|
239
246
|
api: "media",
|
|
240
247
|
key: "buffered",
|
|
241
248
|
value
|
|
@@ -243,7 +250,7 @@ export function usePlayerMediaApi(args) {
|
|
|
243
250
|
});
|
|
244
251
|
watch(muted, (value) => {
|
|
245
252
|
emitter.emit("update", {
|
|
246
|
-
id: toValue(
|
|
253
|
+
id: toValue(id),
|
|
247
254
|
api: "media",
|
|
248
255
|
key: "muted",
|
|
249
256
|
value
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
1
|
+
import { type MaybeRef, type Ref } from 'vue';
|
|
2
|
+
import type { MagicPlayerOptions } from '../../types/index.js';
|
|
3
3
|
export type UsePlayerRuntimeArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mediaRef?:
|
|
6
|
-
srcType?:
|
|
5
|
+
mediaRef?: Ref<HTMLVideoElement | HTMLAudioElement | null>;
|
|
6
|
+
srcType?: MagicPlayerOptions['srcType'];
|
|
7
7
|
src?: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function usePlayerRuntime(args: UsePlayerRuntimeArgs): {
|
|
10
|
-
loaded: import("vue").
|
|
10
|
+
loaded: import("vue").ShallowRef<boolean, boolean>;
|
|
11
11
|
initialize: () => void;
|
|
12
12
|
destroy: () => void;
|
|
13
13
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowRef, watch, toValue } from "vue";
|
|
2
2
|
import { usePlayerStateEmitter } from "./usePlayerStateEmitter.mjs";
|
|
3
3
|
import { useEventListener } from "@vueuse/core";
|
|
4
4
|
export function usePlayerRuntime(args) {
|
|
5
5
|
let hls;
|
|
6
|
-
const loaded =
|
|
7
|
-
const defferedLoading =
|
|
6
|
+
const loaded = shallowRef(false);
|
|
7
|
+
const defferedLoading = shallowRef(false);
|
|
8
8
|
const { mediaRef, srcType, src } = args;
|
|
9
|
-
|
|
9
|
+
function useNative() {
|
|
10
10
|
const el = toValue(mediaRef);
|
|
11
11
|
if (!el || !src) return;
|
|
12
12
|
el.src = src;
|
|
@@ -17,8 +17,8 @@ export function usePlayerRuntime(args) {
|
|
|
17
17
|
},
|
|
18
18
|
{ once: true }
|
|
19
19
|
);
|
|
20
|
-
}
|
|
21
|
-
|
|
20
|
+
}
|
|
21
|
+
async function useHlsJS() {
|
|
22
22
|
const el = toValue(mediaRef);
|
|
23
23
|
if (!el) return;
|
|
24
24
|
useEventListener(mediaRef, "play", () => {
|
|
@@ -49,7 +49,7 @@ export function usePlayerRuntime(args) {
|
|
|
49
49
|
hls.loadSource(src);
|
|
50
50
|
hls.attachMedia(el);
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
function initialize() {
|
|
54
54
|
if (srcType === "native") {
|
|
55
55
|
useNative();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { type MaybeRef, type Ref } from 'vue';
|
|
2
2
|
export type UsePlayerVideoApiArgs = {
|
|
3
3
|
id: MaybeRef<string>;
|
|
4
|
-
playerRef?:
|
|
5
|
-
videoRef?:
|
|
4
|
+
playerRef?: Ref<HTMLElement | null>;
|
|
5
|
+
videoRef?: Ref<HTMLVideoElement | null>;
|
|
6
6
|
};
|
|
7
7
|
export declare function usePlayerVideoApi(args: UsePlayerVideoApiArgs): {
|
|
8
|
-
mouseEntered: import("vue").
|
|
9
|
-
isFullscreen:
|
|
10
|
-
touched: import("vue").
|
|
8
|
+
mouseEntered: import("vue").ShallowRef<boolean, boolean>;
|
|
9
|
+
isFullscreen: Ref<boolean, boolean>;
|
|
10
|
+
touched: import("vue").ShallowRef<boolean, boolean>;
|
|
11
11
|
play: () => void;
|
|
12
12
|
pause: () => void;
|
|
13
13
|
togglePlay: () => void;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { ref, watch, toValue } from "vue";
|
|
1
|
+
import { ref, shallowRef, watch, toValue } from "vue";
|
|
2
2
|
import { useFullscreen } from "@vueuse/core";
|
|
3
3
|
import { isIOS } from "@maas/vue-equipment/utils";
|
|
4
4
|
import { usePlayerStateEmitter } from "./usePlayerStateEmitter.mjs";
|
|
5
5
|
import { usePlayerMediaApi } from "./usePlayerMediaApi.mjs";
|
|
6
6
|
export function usePlayerVideoApi(args) {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const touched = ref(false);
|
|
13
|
-
const mouseEntered = ref(false);
|
|
7
|
+
const { id, playerRef, videoRef } = args;
|
|
8
|
+
const fullscreenTarget = ref(null);
|
|
9
|
+
const { playing, currentTime, muted } = usePlayerMediaApi({ id });
|
|
10
|
+
const touched = shallowRef(false);
|
|
11
|
+
const mouseEntered = shallowRef(false);
|
|
14
12
|
const { isFullscreen, enter, exit } = useFullscreen(fullscreenTarget);
|
|
15
13
|
function play() {
|
|
16
14
|
playing.value = true;
|
|
@@ -82,7 +80,7 @@ export function usePlayerVideoApi(args) {
|
|
|
82
80
|
}
|
|
83
81
|
const emitter = usePlayerStateEmitter();
|
|
84
82
|
emitter.on("update", (payload) => {
|
|
85
|
-
if (payload.id !== toValue(
|
|
83
|
+
if (payload.id !== toValue(id)) return;
|
|
86
84
|
if (payload.api === "player") {
|
|
87
85
|
switch (payload.key) {
|
|
88
86
|
case "mouseEntered":
|
|
@@ -99,7 +97,7 @@ export function usePlayerVideoApi(args) {
|
|
|
99
97
|
});
|
|
100
98
|
watch(mouseEntered, (value) => {
|
|
101
99
|
emitter.emit("update", {
|
|
102
|
-
id: toValue(
|
|
100
|
+
id: toValue(id),
|
|
103
101
|
api: "player",
|
|
104
102
|
key: "mouseEntered",
|
|
105
103
|
value
|
|
@@ -107,7 +105,7 @@ export function usePlayerVideoApi(args) {
|
|
|
107
105
|
});
|
|
108
106
|
watch(touched, (value) => {
|
|
109
107
|
emitter.emit("update", {
|
|
110
|
-
id: toValue(
|
|
108
|
+
id: toValue(id),
|
|
111
109
|
api: "player",
|
|
112
110
|
key: "touched",
|
|
113
111
|
value
|
|
@@ -116,7 +114,7 @@ export function usePlayerVideoApi(args) {
|
|
|
116
114
|
watch(fullscreenTarget, (value) => {
|
|
117
115
|
if (!value) return;
|
|
118
116
|
emitter.emit("update", {
|
|
119
|
-
id: toValue(
|
|
117
|
+
id: toValue(id),
|
|
120
118
|
api: "player",
|
|
121
119
|
key: "fullscreenTarget",
|
|
122
120
|
value
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import type { MaybeRef } from '
|
|
2
|
-
|
|
3
|
-
id: MaybeRef<string>;
|
|
4
|
-
};
|
|
5
|
-
export declare function useMagicPlayer(args: usePlayerApiArgs): {
|
|
1
|
+
import type { MaybeRef } from 'vue';
|
|
2
|
+
export declare function useMagicPlayer(id: MaybeRef<string>): {
|
|
6
3
|
mediaApi: {
|
|
7
|
-
currentTime: import("vue").
|
|
4
|
+
currentTime: import("vue").ShallowRef<number, number>;
|
|
8
5
|
remainingTime: import("vue").ComputedRef<number>;
|
|
9
|
-
duration: import("vue").
|
|
10
|
-
seeking: import("vue").
|
|
11
|
-
volume: import("vue").
|
|
12
|
-
rate: import("vue").
|
|
13
|
-
waiting: import("vue").
|
|
14
|
-
ended: import("vue").
|
|
15
|
-
playing: import("vue").
|
|
16
|
-
stalled: import("vue").
|
|
6
|
+
duration: import("vue").ShallowRef<number, number>;
|
|
7
|
+
seeking: import("vue").ShallowRef<boolean, boolean>;
|
|
8
|
+
volume: import("vue").ShallowRef<number, number>;
|
|
9
|
+
rate: import("vue").ShallowRef<number, number>;
|
|
10
|
+
waiting: import("vue").ShallowRef<boolean, boolean>;
|
|
11
|
+
ended: import("vue").ShallowRef<boolean, boolean>;
|
|
12
|
+
playing: import("vue").ShallowRef<boolean, boolean>;
|
|
13
|
+
stalled: import("vue").ShallowRef<boolean, boolean>;
|
|
17
14
|
buffered: import("vue").Ref<[number, number][], import("../types").Buffered | [number, number][]>;
|
|
18
|
-
muted: import("vue").
|
|
15
|
+
muted: import("vue").ShallowRef<boolean, boolean>;
|
|
19
16
|
};
|
|
20
17
|
videoApi: {
|
|
21
|
-
mouseEntered: import("vue").
|
|
18
|
+
mouseEntered: import("vue").ShallowRef<boolean, boolean>;
|
|
22
19
|
isFullscreen: import("vue").Ref<boolean, boolean>;
|
|
23
|
-
touched: import("vue").
|
|
20
|
+
touched: import("vue").ShallowRef<boolean, boolean>;
|
|
24
21
|
play: () => void;
|
|
25
22
|
pause: () => void;
|
|
26
23
|
togglePlay: () => void;
|
|
@@ -33,14 +30,14 @@ export declare function useMagicPlayer(args: usePlayerApiArgs): {
|
|
|
33
30
|
onMouseleave: () => void;
|
|
34
31
|
};
|
|
35
32
|
controlsApi: {
|
|
36
|
-
mouseEntered: import("vue").
|
|
37
|
-
dragging: import("vue").
|
|
38
|
-
seekedTime: import("vue").
|
|
39
|
-
seekedPercentage: import("vue").
|
|
40
|
-
scrubbedPercentage: import("vue").
|
|
33
|
+
mouseEntered: import("vue").ShallowRef<boolean, boolean>;
|
|
34
|
+
dragging: import("vue").ShallowRef<boolean, boolean>;
|
|
35
|
+
seekedTime: import("vue").ShallowRef<number, number>;
|
|
36
|
+
seekedPercentage: import("vue").ShallowRef<number, number>;
|
|
37
|
+
scrubbedPercentage: import("vue").ShallowRef<number, number>;
|
|
41
38
|
bufferedPercentage: import("vue").ComputedRef<number>;
|
|
42
|
-
thumbPercentage: import("vue").
|
|
43
|
-
popoverOffsetX: import("vue").
|
|
39
|
+
thumbPercentage: import("vue").ShallowRef<number, number>;
|
|
40
|
+
popoverOffsetX: import("vue").ShallowRef<number, number>;
|
|
44
41
|
onMouseenter: () => void;
|
|
45
42
|
onMouseleave: () => void;
|
|
46
43
|
onPointerdown: (e: MouseEvent | TouchEvent) => void;
|
|
@@ -69,10 +66,9 @@ export declare function useMagicPlayer(args: usePlayerApiArgs): {
|
|
|
69
66
|
} | undefined>;
|
|
70
67
|
};
|
|
71
68
|
playerRuntime: {
|
|
72
|
-
loaded: import("vue").
|
|
69
|
+
loaded: import("vue").ShallowRef<boolean, boolean>;
|
|
73
70
|
initialize: () => void;
|
|
74
71
|
destroy: () => void;
|
|
75
72
|
};
|
|
76
73
|
};
|
|
77
74
|
export type UseMagicPlayerReturn = ReturnType<typeof useMagicPlayer>;
|
|
78
|
-
export {};
|
|
@@ -2,11 +2,11 @@ import { usePlayerMediaApi } from "./private/usePlayerMediaApi.mjs";
|
|
|
2
2
|
import { usePlayerVideoApi } from "./private/usePlayerVideoApi.mjs";
|
|
3
3
|
import { usePlayerRuntime } from "./private/usePlayerRuntime.mjs";
|
|
4
4
|
import { usePlayerControlsApi } from "./private/usePlayerControlsApi.mjs";
|
|
5
|
-
export function useMagicPlayer(
|
|
6
|
-
const mediaApi = usePlayerMediaApi({ id
|
|
7
|
-
const videoApi = usePlayerVideoApi({ id
|
|
8
|
-
const controlsApi = usePlayerControlsApi({ id
|
|
9
|
-
const playerRuntime = usePlayerRuntime({ id
|
|
5
|
+
export function useMagicPlayer(id) {
|
|
6
|
+
const mediaApi = usePlayerMediaApi({ id });
|
|
7
|
+
const videoApi = usePlayerVideoApi({ id });
|
|
8
|
+
const controlsApi = usePlayerControlsApi({ id });
|
|
9
|
+
const playerRuntime = usePlayerRuntime({ id });
|
|
10
10
|
return {
|
|
11
11
|
mediaApi,
|
|
12
12
|
videoApi,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@import './magic-player-timeline.css';
|
|
2
|
+
@import './magic-player-display-time.css';
|
|
3
|
+
|
|
4
|
+
/* We keep this variable since it's used in multiple places */
|
|
5
|
+
:root {
|
|
6
|
+
--magic-player-audio-controls-height: 3rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.magic-player-audio-controls {
|
|
10
|
+
width: 100%;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.magic-player-audio-controls__bar {
|
|
15
|
+
width: 100%;
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
pointer-events: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.magic-player-audio-controls__bar--inner {
|
|
24
|
+
width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
height: var(--magic-player-audio-controls-height);
|
|
27
|
+
padding: 0;
|
|
28
|
+
color: inherit;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.magic-player-audio-controls__item {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
user-select: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.magic-player-audio-controls__item.-shrink-0 {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.magic-player-audio-controls__item.-grow {
|
|
44
|
+
flex-grow: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.magic-player-audio-controls__item button {
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
color: inherit;
|
|
50
|
+
border: 0;
|
|
51
|
+
outline: none;
|
|
52
|
+
appearance: none;
|
|
53
|
+
padding: 0;
|
|
54
|
+
border-radius: 0;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
width: 3rem;
|
|
57
|
+
height: var(--magic-player-audio-controls-height);
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.magic-player-audio-controls__item button svg {
|
|
64
|
+
display: block;
|
|
65
|
+
width: 1.25rem;
|
|
66
|
+
height: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.magic-player-audio-controls__timeline {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@container (max-width: 480px) {
|
|
74
|
+
.magic-player-audio-controls__item[data-slot='display-time-current'] {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@container (max-width: 320px) {
|
|
80
|
+
.magic-player-audio-controls__item[data-slot='display-time-duration'] {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
.magic-player-audio-controls__item[data-slot='timeline'] {
|
|
84
|
+
padding-right: 1rem;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@container (max-width: 240px) {
|
|
89
|
+
.magic-player-audio-controls__item[data-slot='timeline'] {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
.magic-player-audio-controls__bar--inner {
|
|
93
|
+
justify-content: center;
|
|
94
|
+
}
|
|
95
|
+
}
|