@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.31
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 +2 -2
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +4 -3
- 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 +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
- 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 +3 -2
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +9 -5
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -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.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +8 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
- 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 +13 -9
- 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,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRefs, watch, toValue } from "vue";
|
|
2
2
|
import { useFullscreen } from "@vueuse/core";
|
|
3
3
|
import { isIOS } from "@maas/vue-equipment/utils";
|
|
4
|
-
import {
|
|
5
|
-
import { usePlayerMediaApi } from "./usePlayerMediaApi.mjs";
|
|
4
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
6
5
|
export function usePlayerVideoApi(args) {
|
|
7
6
|
const { id, playerRef, videoRef } = args;
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const { isFullscreen, enter, exit } = useFullscreen(fullscreenTarget);
|
|
7
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
8
|
+
const state = initializeState();
|
|
9
|
+
const { currentTime, playing, paused, muted, fullscreenTarget, fullscreen } = toRefs(state);
|
|
10
|
+
const { enter, exit, isFullscreen } = useFullscreen(fullscreenTarget);
|
|
13
11
|
function play() {
|
|
14
12
|
playing.value = true;
|
|
13
|
+
paused.value = false;
|
|
15
14
|
}
|
|
16
15
|
function pause() {
|
|
17
16
|
playing.value = false;
|
|
17
|
+
paused.value = true;
|
|
18
18
|
}
|
|
19
19
|
function togglePlay() {
|
|
20
20
|
playing.value = !playing.value;
|
|
21
|
+
paused.value = !playing.value;
|
|
21
22
|
}
|
|
22
23
|
function seek(time) {
|
|
23
24
|
currentTime.value = time;
|
|
@@ -28,11 +29,38 @@ export function usePlayerVideoApi(args) {
|
|
|
28
29
|
function unmute() {
|
|
29
30
|
muted.value = false;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
function initializeFullscreen() {
|
|
33
|
+
if (!playerRef || !videoRef) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
watch(
|
|
37
|
+
[playerRef, videoRef],
|
|
38
|
+
([player, video]) => {
|
|
39
|
+
switch (true) {
|
|
40
|
+
case (!!video && !!player):
|
|
41
|
+
fullscreenTarget.value = isIOS() ? toValue(video) : toValue(player);
|
|
42
|
+
break;
|
|
43
|
+
case !!player:
|
|
44
|
+
fullscreenTarget.value = toValue(player);
|
|
45
|
+
break;
|
|
46
|
+
case !!video:
|
|
47
|
+
fullscreenTarget.value = toValue(video);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
immediate: true
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
watch(
|
|
56
|
+
isFullscreen,
|
|
57
|
+
(newFullscreen) => {
|
|
58
|
+
fullscreen.value = newFullscreen;
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
immediate: true
|
|
62
|
+
}
|
|
63
|
+
);
|
|
36
64
|
}
|
|
37
65
|
function enterFullscreen() {
|
|
38
66
|
if (!fullscreenTarget.value) {
|
|
@@ -48,91 +76,15 @@ export function usePlayerVideoApi(args) {
|
|
|
48
76
|
}
|
|
49
77
|
exit();
|
|
50
78
|
}
|
|
51
|
-
watch(playing, (value) => {
|
|
52
|
-
if (!touched.value && value) {
|
|
53
|
-
touched.value = true;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
if (playerRef && !videoRef) {
|
|
57
|
-
watch(playerRef, (value) => {
|
|
58
|
-
if (value) {
|
|
59
|
-
fullscreenTarget.value = toValue(value);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (videoRef && !playerRef) {
|
|
64
|
-
watch(videoRef, (value) => {
|
|
65
|
-
if (value) {
|
|
66
|
-
fullscreenTarget.value = toValue(value);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
if (videoRef && playerRef) {
|
|
71
|
-
watch([playerRef, videoRef], ([player, video]) => {
|
|
72
|
-
if (player && video) {
|
|
73
|
-
fullscreenTarget.value = isIOS() ? toValue(video) : toValue(player);
|
|
74
|
-
} else if (player) {
|
|
75
|
-
fullscreenTarget.value = toValue(player);
|
|
76
|
-
} else if (video) {
|
|
77
|
-
fullscreenTarget.value = toValue(video);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
const emitter = usePlayerStateEmitter();
|
|
82
|
-
emitter.on("update", (payload) => {
|
|
83
|
-
if (payload.id !== toValue(id)) return;
|
|
84
|
-
if (payload.api === "player") {
|
|
85
|
-
switch (payload.key) {
|
|
86
|
-
case "mouseEntered":
|
|
87
|
-
mouseEntered.value = payload.value;
|
|
88
|
-
break;
|
|
89
|
-
case "fullscreenTarget":
|
|
90
|
-
fullscreenTarget.value = payload.value;
|
|
91
|
-
break;
|
|
92
|
-
case "touched":
|
|
93
|
-
touched.value = payload.value;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
watch(mouseEntered, (value) => {
|
|
99
|
-
emitter.emit("update", {
|
|
100
|
-
id: toValue(id),
|
|
101
|
-
api: "player",
|
|
102
|
-
key: "mouseEntered",
|
|
103
|
-
value
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
watch(touched, (value) => {
|
|
107
|
-
emitter.emit("update", {
|
|
108
|
-
id: toValue(id),
|
|
109
|
-
api: "player",
|
|
110
|
-
key: "touched",
|
|
111
|
-
value
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
watch(fullscreenTarget, (value) => {
|
|
115
|
-
if (!value) return;
|
|
116
|
-
emitter.emit("update", {
|
|
117
|
-
id: toValue(id),
|
|
118
|
-
api: "player",
|
|
119
|
-
key: "fullscreenTarget",
|
|
120
|
-
value
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
79
|
return {
|
|
124
|
-
mouseEntered,
|
|
125
|
-
isFullscreen,
|
|
126
|
-
touched,
|
|
127
80
|
play,
|
|
128
81
|
pause,
|
|
129
82
|
togglePlay,
|
|
130
83
|
seek,
|
|
131
84
|
mute,
|
|
132
85
|
unmute,
|
|
86
|
+
initializeFullscreen,
|
|
133
87
|
enterFullscreen,
|
|
134
|
-
exitFullscreen
|
|
135
|
-
onMouseenter,
|
|
136
|
-
onMouseleave
|
|
88
|
+
exitFullscreen
|
|
137
89
|
};
|
|
138
90
|
}
|
|
@@ -1,73 +1,58 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
2
|
export declare function useMagicPlayer(id: MaybeRef<string>): {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
duration: import("vue").Ref<number, number>;
|
|
4
|
+
seeking: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
volume: import("vue").Ref<number, number>;
|
|
6
|
+
rate: import("vue").Ref<number, number>;
|
|
7
|
+
loaded: import("vue").Ref<boolean, boolean>;
|
|
8
|
+
waiting: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
ended: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
playing: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
started: import("vue").Ref<boolean, boolean>;
|
|
12
|
+
paused: import("vue").Ref<boolean, boolean>;
|
|
13
|
+
stalled: import("vue").Ref<boolean, boolean>;
|
|
14
|
+
buffered: import("vue").Ref<import("../types/index.js").Buffered, import("../types/index.js").Buffered>;
|
|
15
|
+
muted: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
touched: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
dragging: import("vue").Ref<boolean, boolean>;
|
|
18
|
+
fullscreen: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
currentTime: import("vue").Ref<number, number>;
|
|
20
|
+
seekedTime: import("vue").Ref<number | null, number | null>;
|
|
21
|
+
seekedPercentage: import("vue").Ref<number, number>;
|
|
22
|
+
scrubbedPercentage: import("vue").Ref<number, number>;
|
|
23
|
+
thumbPercentage: import("vue").Ref<number, number>;
|
|
24
|
+
popoverOffsetX: import("vue").Ref<number | null, number | null>;
|
|
25
|
+
audioApi: {
|
|
26
|
+
play: () => void;
|
|
27
|
+
pause: () => void;
|
|
28
|
+
togglePlay: () => void;
|
|
29
|
+
seek: (time: number) => void;
|
|
30
|
+
mute: () => void;
|
|
31
|
+
unmute: () => void;
|
|
16
32
|
};
|
|
17
33
|
videoApi: {
|
|
18
|
-
mouseEntered: import("vue").Ref<boolean, boolean>;
|
|
19
|
-
isFullscreen: import("vue").Ref<boolean, boolean>;
|
|
20
|
-
touched: import("vue").Ref<boolean, boolean>;
|
|
21
34
|
play: () => void;
|
|
22
35
|
pause: () => void;
|
|
23
36
|
togglePlay: () => void;
|
|
24
37
|
seek: (time: number) => void;
|
|
25
38
|
mute: () => void;
|
|
26
39
|
unmute: () => void;
|
|
40
|
+
initializeFullscreen: () => void;
|
|
27
41
|
enterFullscreen: () => void;
|
|
28
42
|
exitFullscreen: () => void;
|
|
29
|
-
onMouseenter: () => void;
|
|
30
|
-
onMouseleave: () => void;
|
|
31
43
|
};
|
|
32
44
|
controlsApi: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
seekedTime: import("vue").Ref<number, number>;
|
|
36
|
-
seekedPercentage: import("vue").Ref<number, number>;
|
|
37
|
-
scrubbedPercentage: import("vue").Ref<number, number>;
|
|
45
|
+
initialize: () => void;
|
|
46
|
+
destroy: () => void;
|
|
38
47
|
bufferedPercentage: import("vue").ComputedRef<number>;
|
|
39
|
-
thumbPercentage: import("vue").Ref<number, number>;
|
|
40
|
-
popoverOffsetX: import("vue").Ref<number, number>;
|
|
41
48
|
onMouseenter: () => void;
|
|
42
49
|
onMouseleave: () => void;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onPointermove: (e:
|
|
46
|
-
trackRect: import("vue").Ref<{
|
|
47
|
-
height: number;
|
|
48
|
-
width: number;
|
|
49
|
-
x: number;
|
|
50
|
-
y: number;
|
|
51
|
-
readonly bottom: number;
|
|
52
|
-
readonly left: number;
|
|
53
|
-
readonly right: number;
|
|
54
|
-
readonly top: number;
|
|
55
|
-
toJSON: () => any;
|
|
56
|
-
} | undefined, DOMRect | {
|
|
57
|
-
height: number;
|
|
58
|
-
width: number;
|
|
59
|
-
x: number;
|
|
60
|
-
y: number;
|
|
61
|
-
readonly bottom: number;
|
|
62
|
-
readonly left: number;
|
|
63
|
-
readonly right: number;
|
|
64
|
-
readonly top: number;
|
|
65
|
-
toJSON: () => any;
|
|
66
|
-
} | undefined>;
|
|
50
|
+
onMouseleaveTimeline: () => void;
|
|
51
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
52
|
+
onPointermove: (e: PointerEvent) => void;
|
|
67
53
|
};
|
|
68
54
|
playerRuntime: {
|
|
69
|
-
|
|
70
|
-
initialize: () => void;
|
|
55
|
+
initialize: (autoplay?: boolean) => void;
|
|
71
56
|
destroy: () => void;
|
|
72
57
|
};
|
|
73
58
|
};
|
|
@@ -1,14 +1,64 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRefs } from "vue";
|
|
2
2
|
import { usePlayerVideoApi } from "./private/usePlayerVideoApi.mjs";
|
|
3
|
+
import { usePlayerAudioApi } from "./private/usePlayerAudioApi.mjs";
|
|
3
4
|
import { usePlayerRuntime } from "./private/usePlayerRuntime.mjs";
|
|
4
5
|
import { usePlayerControlsApi } from "./private/usePlayerControlsApi.mjs";
|
|
6
|
+
import { usePlayerState } from "./private/usePlayerState.mjs";
|
|
5
7
|
export function useMagicPlayer(id) {
|
|
6
|
-
const
|
|
8
|
+
const audioApi = usePlayerAudioApi({ id });
|
|
7
9
|
const videoApi = usePlayerVideoApi({ id });
|
|
8
10
|
const controlsApi = usePlayerControlsApi({ id });
|
|
9
11
|
const playerRuntime = usePlayerRuntime({ id });
|
|
12
|
+
const { initializeState } = usePlayerState(id);
|
|
13
|
+
const state = initializeState();
|
|
14
|
+
const {
|
|
15
|
+
currentTime,
|
|
16
|
+
duration,
|
|
17
|
+
seeking,
|
|
18
|
+
volume,
|
|
19
|
+
rate,
|
|
20
|
+
loaded,
|
|
21
|
+
waiting,
|
|
22
|
+
ended,
|
|
23
|
+
playing,
|
|
24
|
+
started,
|
|
25
|
+
paused,
|
|
26
|
+
stalled,
|
|
27
|
+
buffered,
|
|
28
|
+
muted,
|
|
29
|
+
touched,
|
|
30
|
+
dragging,
|
|
31
|
+
fullscreen,
|
|
32
|
+
seekedTime,
|
|
33
|
+
seekedPercentage,
|
|
34
|
+
scrubbedPercentage,
|
|
35
|
+
thumbPercentage,
|
|
36
|
+
popoverOffsetX
|
|
37
|
+
} = toRefs(state);
|
|
10
38
|
return {
|
|
11
|
-
|
|
39
|
+
duration,
|
|
40
|
+
seeking,
|
|
41
|
+
volume,
|
|
42
|
+
rate,
|
|
43
|
+
loaded,
|
|
44
|
+
waiting,
|
|
45
|
+
ended,
|
|
46
|
+
playing,
|
|
47
|
+
started,
|
|
48
|
+
paused,
|
|
49
|
+
stalled,
|
|
50
|
+
buffered,
|
|
51
|
+
muted,
|
|
52
|
+
touched,
|
|
53
|
+
dragging,
|
|
54
|
+
fullscreen,
|
|
55
|
+
currentTime,
|
|
56
|
+
seekedTime,
|
|
57
|
+
seekedPercentage,
|
|
58
|
+
scrubbedPercentage,
|
|
59
|
+
thumbPercentage,
|
|
60
|
+
popoverOffsetX,
|
|
61
|
+
audioApi,
|
|
12
62
|
videoApi,
|
|
13
63
|
controlsApi,
|
|
14
64
|
playerRuntime
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
height: var(--magic-player-timeline-track-height);
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
|
+
touch-action: none;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.magic-player-timeline__target {
|
|
@@ -19,6 +20,10 @@
|
|
|
19
20
|
cursor: pointer;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
[data-dragging='true'] .magic-player-timeline__target {
|
|
24
|
+
cursor: grabbing;
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
.magic-player-timeline__track {
|
|
23
28
|
position: relative;
|
|
24
29
|
width: 100%;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { InjectionKey, MaybeRef } from 'vue';
|
|
1
|
+
import type { InjectionKey, MaybeRef, Ref } from 'vue';
|
|
2
2
|
import type { MagicPlayerOptions } from '../types/index.js';
|
|
3
3
|
declare const MagicPlayerInstanceId: InjectionKey<MaybeRef<string>>;
|
|
4
4
|
declare const MagicPlayerOptionsKey: InjectionKey<MagicPlayerOptions>;
|
|
5
|
-
|
|
5
|
+
declare const MagicPlayerRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
6
|
+
declare const MagicPlayerTrackRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
7
|
+
declare const MagicPlayerBarRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
8
|
+
declare const MagicPlayerPopoverRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
9
|
+
export { MagicPlayerInstanceId, MagicPlayerOptionsKey, MagicPlayerRef, MagicPlayerTrackRef, MagicPlayerBarRef, MagicPlayerPopoverRef, };
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
const MagicPlayerInstanceId = Symbol();
|
|
2
2
|
const MagicPlayerOptionsKey = Symbol();
|
|
3
|
-
|
|
3
|
+
const MagicPlayerRef = Symbol();
|
|
4
|
+
const MagicPlayerTrackRef = Symbol();
|
|
5
|
+
const MagicPlayerBarRef = Symbol();
|
|
6
|
+
const MagicPlayerPopoverRef = Symbol();
|
|
7
|
+
export {
|
|
8
|
+
MagicPlayerInstanceId,
|
|
9
|
+
MagicPlayerOptionsKey,
|
|
10
|
+
MagicPlayerRef,
|
|
11
|
+
MagicPlayerTrackRef,
|
|
12
|
+
MagicPlayerBarRef,
|
|
13
|
+
MagicPlayerPopoverRef
|
|
14
|
+
};
|
|
@@ -1,22 +1,87 @@
|
|
|
1
|
+
type PlayerMode = 'audio' | 'video';
|
|
1
2
|
export interface MagicPlayerOptions {
|
|
2
3
|
src: string;
|
|
3
|
-
mode?:
|
|
4
|
+
mode?: PlayerMode;
|
|
4
5
|
srcType?: 'native' | 'hls';
|
|
5
6
|
preload?: 'auto' | 'metadata' | 'none';
|
|
6
7
|
autoplay?: boolean;
|
|
8
|
+
playback?: ('viewport' | 'window')[] | false;
|
|
7
9
|
loop?: boolean;
|
|
8
10
|
transition?: {
|
|
11
|
+
videoControls?: string;
|
|
12
|
+
overlay?: string;
|
|
13
|
+
icons?: string;
|
|
14
|
+
};
|
|
15
|
+
threshold?: {
|
|
16
|
+
idle?: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface RequiredMagicPlayerOptions {
|
|
20
|
+
src: string;
|
|
21
|
+
mode: 'audio' | 'video';
|
|
22
|
+
srcType: 'native' | 'hls';
|
|
23
|
+
preload: 'auto' | 'metadata' | 'none';
|
|
24
|
+
autoplay: boolean;
|
|
25
|
+
loop: boolean;
|
|
26
|
+
transition: {
|
|
9
27
|
videoControls: string;
|
|
28
|
+
overlay: string;
|
|
29
|
+
icons: string;
|
|
30
|
+
};
|
|
31
|
+
threshold: {
|
|
32
|
+
idle: number;
|
|
10
33
|
};
|
|
11
34
|
}
|
|
12
|
-
type API = 'media' | 'player' | 'controls' | 'runtime' | 'player';
|
|
13
35
|
export type Buffered = [number, number][];
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
export interface PlayerState {
|
|
37
|
+
id: string;
|
|
38
|
+
buffered: Buffered;
|
|
39
|
+
currentTime: number;
|
|
40
|
+
dragging: boolean;
|
|
41
|
+
duration: number;
|
|
42
|
+
ended: boolean;
|
|
43
|
+
loaded: boolean;
|
|
44
|
+
muted: boolean;
|
|
45
|
+
paused: boolean;
|
|
46
|
+
playing: boolean;
|
|
47
|
+
rate: number;
|
|
48
|
+
seeking: boolean;
|
|
49
|
+
stalled: boolean;
|
|
50
|
+
started: boolean;
|
|
51
|
+
touched: boolean;
|
|
52
|
+
volume: number;
|
|
53
|
+
waiting: boolean;
|
|
54
|
+
fullscreen: boolean;
|
|
55
|
+
fullscreenTarget: HTMLElement | null;
|
|
56
|
+
mouseEntered: boolean;
|
|
57
|
+
controlsMouseEntered: boolean;
|
|
58
|
+
seekedTime: number | null;
|
|
59
|
+
seekedPercentage: number;
|
|
60
|
+
scrubbedPercentage: number;
|
|
61
|
+
thumbPercentage: number;
|
|
62
|
+
popoverOffsetX: number | null;
|
|
63
|
+
hasOverlay: boolean;
|
|
64
|
+
hasControls: boolean;
|
|
65
|
+
controlsBarRect: DOMRect | undefined;
|
|
66
|
+
controlsTrackRect: DOMRect | undefined;
|
|
67
|
+
controlsPopoverRect: DOMRect | undefined;
|
|
68
|
+
}
|
|
69
|
+
export interface PlayerEvents {
|
|
70
|
+
onDragStart: string;
|
|
71
|
+
onDragEnd: string;
|
|
72
|
+
onEnd: string;
|
|
73
|
+
onFullscreenEnter: string;
|
|
74
|
+
onFullscreenLeave: string;
|
|
75
|
+
onLoad: string;
|
|
76
|
+
onMute: string;
|
|
77
|
+
onUnmute: string;
|
|
78
|
+
onPause: string;
|
|
79
|
+
onPlay: string;
|
|
80
|
+
onRateChange: string;
|
|
81
|
+
onStall: string;
|
|
82
|
+
onStart: string;
|
|
83
|
+
onTouch: string;
|
|
84
|
+
onVolumeChange: string;
|
|
85
|
+
onWait: string;
|
|
86
|
+
}
|
|
22
87
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const defaultOptions:
|
|
1
|
+
import type { RequiredMagicPlayerOptions } from '../types/index.js';
|
|
2
|
+
declare const defaultOptions: RequiredMagicPlayerOptions;
|
|
3
3
|
export { defaultOptions };
|
|
@@ -6,7 +6,12 @@ const defaultOptions = {
|
|
|
6
6
|
autoplay: false,
|
|
7
7
|
loop: false,
|
|
8
8
|
transition: {
|
|
9
|
-
videoControls: "magic-player-video-controls"
|
|
9
|
+
videoControls: "magic-player-video-controls",
|
|
10
|
+
overlay: "magic-player-overlay",
|
|
11
|
+
icons: "magic-player-icons"
|
|
12
|
+
},
|
|
13
|
+
threshold: {
|
|
14
|
+
idle: 3e3
|
|
10
15
|
}
|
|
11
16
|
};
|
|
12
17
|
export { defaultOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|
|
@@ -1,68 +1,61 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="el" class="magic-scroll-collision">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import {
|
|
9
|
+
shallowRef,
|
|
10
|
+
inject,
|
|
11
|
+
computed,
|
|
12
|
+
toValue,
|
|
13
|
+
watch,
|
|
14
|
+
useId,
|
|
15
|
+
onMounted,
|
|
16
|
+
useTemplateRef
|
|
17
|
+
} from "vue";
|
|
5
18
|
import { useCollisionDetection } from "../composables/private/useCollisionDetection";
|
|
6
19
|
import { MagicScrollReturn, MagicScrollTarget } from "../symbols";
|
|
7
20
|
import { useIntersectionObserver } from "@vueuse/core";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
() => scrollY.value,
|
|
35
|
-
() => {
|
|
36
|
-
if (intersecting.value) {
|
|
37
|
-
observe();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
useIntersectionObserver(
|
|
42
|
-
elRef,
|
|
43
|
-
([{ isIntersecting }]) => {
|
|
44
|
-
intersecting.value = isIntersecting;
|
|
45
|
-
},
|
|
46
|
-
{ rootMargin: "150% 0px 150% 0px", immediate: true }
|
|
47
|
-
);
|
|
48
|
-
onMounted(() => {
|
|
21
|
+
const { id, offset } = defineProps({
|
|
22
|
+
id: { type: String, required: false },
|
|
23
|
+
offset: { type: Object, required: false }
|
|
24
|
+
});
|
|
25
|
+
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
26
|
+
const scrollTarget = inject(MagicScrollTarget);
|
|
27
|
+
if (!scrollTarget) {
|
|
28
|
+
console.error(
|
|
29
|
+
"MagicScrollCollision must be used within a MagicScrollProvider"
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const intersecting = shallowRef(false);
|
|
33
|
+
const elRef = useTemplateRef("el");
|
|
34
|
+
const scrollY = computed(() => toValue(scrollReturn?.y) || 0);
|
|
35
|
+
const mappedId = computed(() => id ?? `magic-scroll-collision-${useId()}`);
|
|
36
|
+
const { observe } = useCollisionDetection({
|
|
37
|
+
id: mappedId.value,
|
|
38
|
+
child: elRef,
|
|
39
|
+
parent: scrollTarget,
|
|
40
|
+
scrollY,
|
|
41
|
+
offset
|
|
42
|
+
});
|
|
43
|
+
watch(
|
|
44
|
+
() => scrollY.value,
|
|
45
|
+
() => {
|
|
46
|
+
if (intersecting.value) {
|
|
49
47
|
observe();
|
|
50
|
-
}
|
|
51
|
-
return (_ctx, _cache) => {
|
|
52
|
-
return _openBlock(), _createElementBlock(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
ref_key: "elRef",
|
|
56
|
-
ref: elRef,
|
|
57
|
-
class: "magic-scroll-collision"
|
|
58
|
-
},
|
|
59
|
-
[
|
|
60
|
-
_renderSlot(_ctx.$slots, "default")
|
|
61
|
-
],
|
|
62
|
-
512
|
|
63
|
-
/* NEED_PATCH */
|
|
64
|
-
);
|
|
65
|
-
};
|
|
48
|
+
}
|
|
66
49
|
}
|
|
50
|
+
);
|
|
51
|
+
useIntersectionObserver(
|
|
52
|
+
elRef,
|
|
53
|
+
([{ isIntersecting }]) => {
|
|
54
|
+
intersecting.value = isIntersecting;
|
|
55
|
+
},
|
|
56
|
+
{ rootMargin: "150% 0px 150% 0px", immediate: true }
|
|
57
|
+
);
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
observe();
|
|
67
60
|
});
|
|
68
61
|
</script>
|