@maas/vue-equipment 0.40.0 → 1.0.0-beta.1
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 +2 -13
- package/dist/composables/index.js +65 -128
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +26 -40
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +13 -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 +17 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +11 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +71 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +12 -7
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +51 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +13 -4
- 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/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +1 -1
- 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 +192 -0
- package/dist/plugins/MagicCommand/src/components/{MagicCommandBody.vue.d.ts → MagicCommandContent.vue.d.ts} +4 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -3
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +108 -79
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +18 -9
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +11 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +94 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +52 -7
- 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 +110 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +75 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -9
- 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 +22 -4
- 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 +8 -1
- 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 +33 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +32 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/{MagicCommand/src/components/MagicCommandHead.vue.d.ts → MagicCookie/src/components/MagicCookieView.vue.d.ts} +6 -2
- 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 +142 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +6 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +3 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +11 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +8 -8
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +10 -5
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +5 -5
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +491 -336
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -6
- 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/useDrawerDrag.d.ts +7 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +26 -16
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +2 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +5 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +46 -29
- 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 +2 -2
- 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 +14 -10
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +3 -7
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +52 -44
- 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 +79 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +10 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +247 -215
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +12 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +235 -211
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +126 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +94 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +49 -4
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +98 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +111 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +13 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +8 -8
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +35 -26
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +12 -6
- 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.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +99 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +265 -165
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +12 -6
- 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/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 +11 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- 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 +78 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +134 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +33 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +11 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +116 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +13 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +83 -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 +94 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +222 -0
- package/dist/plugins/MagicPlayer/src/components/{MagicPlayerControls.vue.d.ts → MagicPlayerVideoControls.vue.d.ts} +12 -5
- 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.mjs +5 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +18 -22
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +6 -8
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +2 -6
- 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 +67 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +14 -4
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +14 -7
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +15 -9
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +76 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -7
- 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 +5 -3
- 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 +296 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +23 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +155 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +33 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +7 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +34 -29
- 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 +41 -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 +13 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +26 -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 +0 -1
- package/dist/plugins/index.mjs +0 -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 +1 -2
- package/dist/utils/index.js +2 -53
- package/dist/utils/index.js.map +1 -1
- package/package.json +52 -57
- 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.d.ts +0 -2
- 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/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/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/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/MagicToast.vue.d.ts +0 -14
- 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
|
@@ -1,120 +1,122 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return storyboard.value.tile_height / pixelRatio.value
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
async function init() {
|
|
61
|
-
if (!props.playbackId) return
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
storyboard.value = await fetch(
|
|
65
|
-
`https://image.mux.com/${props.playbackId}/storyboard.json`
|
|
66
|
-
).then((res) => res.json())
|
|
67
|
-
|
|
68
|
-
if (!storyboard.value) throw new Error()
|
|
69
|
-
|
|
70
|
-
image = new Image()
|
|
71
|
-
image.src = storyboard.value.url
|
|
72
|
-
await image.decode()
|
|
73
|
-
|
|
74
|
-
context = canvasRef.value.getContext('2d')!
|
|
75
|
-
context.drawImage(image, 0, 0)
|
|
76
|
-
} catch (e: any) {
|
|
77
|
-
console.error('Can not initialize timeine preview.', e)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function drawFrame(time: number) {
|
|
82
|
-
if (!storyboard.value || !context || !image) return
|
|
83
|
-
|
|
84
|
-
const { tile_height, tile_width, tiles } = storyboard.value
|
|
85
|
-
|
|
86
|
-
let closestIndex = -1
|
|
87
|
-
let minDifference = Infinity
|
|
88
|
-
|
|
89
|
-
for (let i = 0; i < tiles.length; i++) {
|
|
90
|
-
const { start } = tiles[i]
|
|
91
|
-
const difference = Math.abs(start - time)
|
|
92
|
-
|
|
93
|
-
if (difference < minDifference) {
|
|
94
|
-
minDifference = difference
|
|
95
|
-
closestIndex = i
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["width", "height"];
|
|
5
|
+
import { shallowRef, onMounted, watch, computed, inject } from "vue";
|
|
6
|
+
import { useDevicePixelRatio } from "@vueuse/core";
|
|
7
|
+
import { usePlayerControlsApi } from "../composables/private/usePlayerControlsApi";
|
|
8
|
+
import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
|
|
9
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
10
|
+
__name: "MagicPlayerMuxPopover",
|
|
11
|
+
props: {
|
|
12
|
+
playbackId: { type: String, required: false }
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
16
|
+
const injectedOptions = inject(MagicPlayerOptionsKey, void 0);
|
|
17
|
+
if (!instanceId || !injectedOptions) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"MagicPlayerMuxPopover must be nested inside MagicPlayerVideoControls."
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const { seekedTime } = usePlayerControlsApi({ id: instanceId });
|
|
23
|
+
const { pixelRatio } = useDevicePixelRatio();
|
|
24
|
+
const canvasRef = shallowRef();
|
|
25
|
+
const storyboard = shallowRef();
|
|
26
|
+
let context = void 0;
|
|
27
|
+
let image = void 0;
|
|
28
|
+
const thumbWidth = computed(() => {
|
|
29
|
+
if (!storyboard.value) return 0;
|
|
30
|
+
return storyboard.value.tile_width / pixelRatio.value;
|
|
31
|
+
});
|
|
32
|
+
const thumbHeight = computed(() => {
|
|
33
|
+
if (!storyboard.value) return 0;
|
|
34
|
+
return storyboard.value.tile_height / pixelRatio.value;
|
|
35
|
+
});
|
|
36
|
+
function getMuxId(url) {
|
|
37
|
+
const match = url?.match(/mux\.com\/([^\/]+)/);
|
|
38
|
+
return match?.[1];
|
|
39
|
+
}
|
|
40
|
+
async function init() {
|
|
41
|
+
const parsedPlaybackId = getMuxId(injectedOptions?.src);
|
|
42
|
+
const mappedPlaybackId = __props.playbackId ?? parsedPlaybackId;
|
|
43
|
+
if (!mappedPlaybackId) return;
|
|
44
|
+
try {
|
|
45
|
+
storyboard.value = await fetch(
|
|
46
|
+
`https://image.mux.com/${mappedPlaybackId}/storyboard.json`
|
|
47
|
+
).then((res) => res.json());
|
|
48
|
+
if (!storyboard.value) throw new Error();
|
|
49
|
+
image = new Image();
|
|
50
|
+
image.src = storyboard.value.url;
|
|
51
|
+
await image.decode();
|
|
52
|
+
context = canvasRef.value.getContext("2d");
|
|
53
|
+
context.drawImage(image, 0, 0);
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error("Can not initialize timeine preview.", e);
|
|
56
|
+
}
|
|
96
57
|
}
|
|
58
|
+
function drawFrame(time) {
|
|
59
|
+
if (!storyboard.value || !context || !image) return;
|
|
60
|
+
const { tile_height, tile_width, tiles } = storyboard.value;
|
|
61
|
+
let closestIndex = -1;
|
|
62
|
+
let minDifference = Infinity;
|
|
63
|
+
for (let i = 0; i < tiles.length; i++) {
|
|
64
|
+
const { start } = tiles[i];
|
|
65
|
+
const difference = Math.abs(start - time);
|
|
66
|
+
if (difference < minDifference) {
|
|
67
|
+
minDifference = difference;
|
|
68
|
+
closestIndex = i;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const tile = tiles[closestIndex];
|
|
72
|
+
context.drawImage(
|
|
73
|
+
image,
|
|
74
|
+
tile.x,
|
|
75
|
+
tile.y,
|
|
76
|
+
tile_width,
|
|
77
|
+
tile_height,
|
|
78
|
+
0,
|
|
79
|
+
0,
|
|
80
|
+
tile_width,
|
|
81
|
+
tile_height
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
onMounted(init);
|
|
85
|
+
watch(() => seekedTime?.value, drawFrame);
|
|
86
|
+
return (_ctx, _cache) => {
|
|
87
|
+
return _openBlock(), _createElementBlock(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
style: _normalizeStyle({
|
|
91
|
+
width: `${thumbWidth.value}px`,
|
|
92
|
+
height: `${thumbHeight.value}px`
|
|
93
|
+
}),
|
|
94
|
+
class: "magic-player-mux-popover"
|
|
95
|
+
},
|
|
96
|
+
[
|
|
97
|
+
_createElementVNode("canvas", {
|
|
98
|
+
ref_key: "canvasRef",
|
|
99
|
+
ref: canvasRef,
|
|
100
|
+
width: storyboard.value?.tile_width,
|
|
101
|
+
height: storyboard.value?.tile_height
|
|
102
|
+
}, null, 8, _hoisted_1)
|
|
103
|
+
],
|
|
104
|
+
4
|
|
105
|
+
/* STYLE */
|
|
106
|
+
);
|
|
107
|
+
};
|
|
97
108
|
}
|
|
98
|
-
|
|
99
|
-
const tile = tiles[closestIndex]
|
|
100
|
-
|
|
101
|
-
context.drawImage(
|
|
102
|
-
image,
|
|
103
|
-
tile.x,
|
|
104
|
-
tile.y,
|
|
105
|
-
tile_width,
|
|
106
|
-
tile_height,
|
|
107
|
-
0,
|
|
108
|
-
0,
|
|
109
|
-
tile_width,
|
|
110
|
-
tile_height
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
onMounted(init)
|
|
115
|
-
watch(() => seekedTime?.value, drawFrame)
|
|
109
|
+
});
|
|
116
110
|
</script>
|
|
117
111
|
|
|
118
112
|
<style>
|
|
119
|
-
.magic-player-mux-popover
|
|
113
|
+
.magic-player-mux-popover {
|
|
114
|
+
border-radius: var(--magic-player-popover-border-radius, 0.25rem);
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.magic-player-mux-popover canvas {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: auto;
|
|
121
|
+
}
|
|
120
122
|
</style>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const _default: import("vue").DefineComponent<MagicPlayerMuxPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerMuxPopoverProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
1
|
+
interface MagicPlayerMuxPopoverProps {
|
|
2
|
+
playbackId?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicPlayerMuxPopoverProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicPlayerMuxPopoverProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
5
|
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToOption<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: import('vue').PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,64 +1,117 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, Fragment as _Fragment, withModifiers as _withModifiers } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-playing", "data-paused", "data-waiting", "data-idle", "data-hover"];
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "magic-player-overlay__button"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "magic-player-overlay__button"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_4 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "magic-player-overlay__button"
|
|
16
|
+
};
|
|
17
|
+
import { inject } from "vue";
|
|
18
|
+
import { useIdle } from "@vueuse/core";
|
|
19
|
+
import IconPlay from "./icons/Play.vue";
|
|
20
|
+
import IconPause from "./icons/Pause.vue";
|
|
21
|
+
import IconWaiting from "./icons/Waiting.vue";
|
|
22
|
+
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
23
|
+
import { usePlayerVideoApi } from "../composables/private/usePlayerVideoApi";
|
|
24
|
+
import { MagicPlayerInstanceId } from "../symbols";
|
|
25
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
26
|
+
__name: "MagicPlayerOverlay",
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
29
|
+
if (!instanceId) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
"MagicPlayerOverlay must be nested inside MagicPlayerProvider."
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const { playing, waiting } = usePlayerMediaApi({
|
|
35
|
+
id: instanceId
|
|
36
|
+
});
|
|
37
|
+
const { mouseEntered, togglePlay } = usePlayerVideoApi({
|
|
38
|
+
id: instanceId
|
|
39
|
+
});
|
|
40
|
+
const { idle } = useIdle(3e3);
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return _openBlock(), _createElementBlock("div", {
|
|
43
|
+
class: "magic-player-overlay",
|
|
44
|
+
"data-playing": _unref(playing),
|
|
45
|
+
"data-paused": !_unref(playing),
|
|
46
|
+
"data-waiting": _unref(waiting),
|
|
47
|
+
"data-idle": _unref(idle),
|
|
48
|
+
"data-hover": _unref(mouseEntered),
|
|
49
|
+
onClick: _cache[0] || (_cache[0] = _withModifiers(
|
|
50
|
+
//@ts-ignore
|
|
51
|
+
(...args) => _unref(togglePlay) && _unref(togglePlay)(...args),
|
|
52
|
+
["stop"]
|
|
53
|
+
))
|
|
54
|
+
}, [
|
|
55
|
+
_renderSlot(_ctx.$slots, "default", {}, () => [
|
|
56
|
+
_unref(waiting) ? (_openBlock(), _createElementBlock("button", _hoisted_2, [
|
|
57
|
+
_renderSlot(_ctx.$slots, "waitingIcon", {}, () => [
|
|
58
|
+
_createVNode(IconWaiting)
|
|
59
|
+
])
|
|
60
|
+
])) : (_openBlock(), _createElementBlock(
|
|
61
|
+
_Fragment,
|
|
62
|
+
{ key: 1 },
|
|
63
|
+
[
|
|
64
|
+
!_unref(playing) ? (_openBlock(), _createElementBlock("button", _hoisted_3, [
|
|
65
|
+
_renderSlot(_ctx.$slots, "playIcon", {}, () => [
|
|
66
|
+
_createVNode(IconPlay)
|
|
67
|
+
])
|
|
68
|
+
])) : (_openBlock(), _createElementBlock("button", _hoisted_4, [
|
|
69
|
+
_renderSlot(_ctx.$slots, "pauseIcon", {}, () => [
|
|
70
|
+
_createVNode(IconPause)
|
|
71
|
+
])
|
|
72
|
+
]))
|
|
73
|
+
],
|
|
74
|
+
64
|
|
75
|
+
/* STABLE_FRAGMENT */
|
|
76
|
+
))
|
|
77
|
+
])
|
|
78
|
+
], 8, _hoisted_1);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
</script>
|
|
45
83
|
|
|
46
|
-
|
|
47
|
-
|
|
84
|
+
<style>
|
|
85
|
+
.magic-player-overlay {
|
|
86
|
+
position: absolute;
|
|
87
|
+
inset: 0;
|
|
88
|
+
background-color: var(--magic-player-overlay-background, rgba(0, 0, 0, 0.3));
|
|
89
|
+
color: var(--magic-player-overlay-color, rgba(255, 255, 255, 1));
|
|
90
|
+
transition: var(--magic-player-overlay-transition, opacity 300ms ease);
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
cursor: pointer;
|
|
48
95
|
}
|
|
49
96
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
97
|
+
.magic-player-overlay__button {
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
color: inherit;
|
|
100
|
+
border: 0;
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
outline: none;
|
|
104
|
+
appearance: none;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
width: var(--magic-player-overlay-button-size, 2.5rem);
|
|
107
|
+
height: var(--magic-player-overlay-button-size, 2.5rem);
|
|
108
|
+
}
|
|
58
109
|
|
|
59
|
-
|
|
60
|
-
|
|
110
|
+
.magic-player-overlay.-playing[data-idle='true'] {
|
|
111
|
+
opacity: 0;
|
|
112
|
+
}
|
|
61
113
|
|
|
62
|
-
|
|
63
|
-
|
|
114
|
+
.magic-player-overlay.-playing[data-hover='false'] {
|
|
115
|
+
opacity: 0;
|
|
116
|
+
}
|
|
64
117
|
</style>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
interface MagicPlayerOverlayProps {
|
|
2
|
-
id: string;
|
|
3
|
-
}
|
|
4
1
|
declare function __VLS_template(): {
|
|
5
2
|
attrs: Partial<{}>;
|
|
6
3
|
slots: {
|
|
@@ -13,7 +10,7 @@ declare function __VLS_template(): {
|
|
|
13
10
|
rootEl: HTMLDivElement;
|
|
14
11
|
};
|
|
15
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
14
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
15
|
export default _default;
|
|
19
16
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = { class: "magic-player-poster" };
|
|
5
|
+
import { inject } from "vue";
|
|
6
|
+
import { usePlayerRuntime } from "../composables/private/usePlayerRuntime";
|
|
7
|
+
import { usePlayerVideoApi } from "../composables/private/usePlayerVideoApi";
|
|
8
|
+
import { MagicPlayerInstanceId } from "../symbols";
|
|
9
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
10
|
+
__name: "MagicPlayerPoster",
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const instanceId = inject(MagicPlayerInstanceId, void 0);
|
|
13
|
+
if (!instanceId) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"MagicPlayerPoster must be nested inside MagicPlayerProvider."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const { loaded } = usePlayerRuntime({
|
|
19
|
+
id: instanceId
|
|
20
|
+
});
|
|
21
|
+
const { touched } = usePlayerVideoApi({
|
|
22
|
+
id: instanceId
|
|
23
|
+
});
|
|
24
|
+
return (_ctx, _cache) => {
|
|
25
|
+
return _withDirectives((_openBlock(), _createElementBlock(
|
|
26
|
+
"div",
|
|
27
|
+
_hoisted_1,
|
|
28
|
+
[
|
|
29
|
+
_renderSlot(_ctx.$slots, "default")
|
|
30
|
+
],
|
|
31
|
+
512
|
|
32
|
+
/* NEED_PATCH */
|
|
33
|
+
)), [
|
|
34
|
+
[_vShow, !_unref(loaded) || !_unref(touched)]
|
|
35
|
+
]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
23
39
|
</script>
|
|
24
40
|
|
|
25
41
|
<style>
|
|
26
|
-
.magic-player-poster{
|
|
42
|
+
.magic-player-poster {
|
|
43
|
+
position: absolute;
|
|
44
|
+
inset: 0;
|
|
45
|
+
}
|
|
27
46
|
</style>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export type MagicPlayerPosterProps = {
|
|
2
|
-
id: string;
|
|
3
|
-
};
|
|
4
1
|
declare function __VLS_template(): {
|
|
5
2
|
attrs: Partial<{}>;
|
|
6
3
|
slots: {
|
|
@@ -10,7 +7,7 @@ declare function __VLS_template(): {
|
|
|
10
7
|
rootEl: HTMLDivElement;
|
|
11
8
|
};
|
|
12
9
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
11
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
12
|
export default _default;
|
|
16
13
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-mode", "data-fullscreen", "data-touched", "data-playing", "data-paused", "data-waiting", "data-loaded", "data-muted"];
|
|
5
|
+
import { ref, provide } from "vue";
|
|
6
|
+
import defu from "defu";
|
|
7
|
+
import { usePlayerVideoApi } from "../composables/private/usePlayerVideoApi";
|
|
8
|
+
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
9
|
+
import { usePlayerRuntime } from "../composables/private/usePlayerRuntime";
|
|
10
|
+
import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
|
|
11
|
+
import { defaultOptions } from "../utils/defaultOptions";
|
|
12
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
13
|
+
__name: "MagicPlayerProvider",
|
|
14
|
+
props: {
|
|
15
|
+
id: { type: null, required: true },
|
|
16
|
+
options: { type: Object, required: false }
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const mappedOptions = defu(__props.options, defaultOptions);
|
|
20
|
+
const playerRef = ref(void 0);
|
|
21
|
+
const { playing, waiting, muted } = usePlayerMediaApi({
|
|
22
|
+
id: __props.id
|
|
23
|
+
});
|
|
24
|
+
const { loaded } = usePlayerRuntime({
|
|
25
|
+
id: __props.id,
|
|
26
|
+
src: mappedOptions.src,
|
|
27
|
+
srcType: mappedOptions.srcType
|
|
28
|
+
});
|
|
29
|
+
const { onMouseenter, onMouseleave, isFullscreen, touched } = usePlayerVideoApi(
|
|
30
|
+
{
|
|
31
|
+
id: __props.id,
|
|
32
|
+
playerRef
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
provide(MagicPlayerInstanceId, __props.id);
|
|
36
|
+
provide(MagicPlayerOptionsKey, mappedOptions);
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return _openBlock(), _createElementBlock("div", {
|
|
39
|
+
ref_key: "playerRef",
|
|
40
|
+
ref: playerRef,
|
|
41
|
+
class: "magic-player-provider",
|
|
42
|
+
"data-mode": _unref(mappedOptions).mode,
|
|
43
|
+
"data-fullscreen": _unref(isFullscreen),
|
|
44
|
+
"data-touched": _unref(touched),
|
|
45
|
+
"data-playing": _unref(playing),
|
|
46
|
+
"data-paused": !_unref(playing),
|
|
47
|
+
"data-waiting": _unref(waiting),
|
|
48
|
+
"data-loaded": _unref(loaded),
|
|
49
|
+
"data-muted": _unref(muted),
|
|
50
|
+
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
|
|
51
|
+
(...args) => _unref(onMouseenter) && _unref(onMouseenter)(...args)),
|
|
52
|
+
onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
|
|
53
|
+
(...args) => _unref(onMouseleave) && _unref(onMouseleave)(...args))
|
|
54
|
+
}, [
|
|
55
|
+
_renderSlot(_ctx.$slots, "default")
|
|
56
|
+
], 40, _hoisted_1);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style>
|
|
63
|
+
.magic-player-provider {
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.magic-player-provider[data-mode='video'] {
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
height: var(--magic-player-provider-height, auto);
|
|
71
|
+
aspect-ratio: var(--magic-player-provider-aspect-ratio, 16 / 9);
|
|
72
|
+
background: var(--magic-player-provider-background, #000);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.magic-player-provider[data-loaded='true'][data-mode='video'] {
|
|
76
|
+
--magic-player-provider-background: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.magic-player-provider[data-mode='audio'] {
|
|
80
|
+
position: relative;
|
|
81
|
+
width: 100%;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { MagicPlayerOptions } from '../types/index.js';
|
|
3
|
+
interface MagicPlayerProps {
|
|
4
|
+
id: MaybeRef<string>;
|
|
5
|
+
options?: MagicPlayerOptions;
|
|
6
|
+
}
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {
|
|
13
|
+
playerRef: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
rootEl: HTMLDivElement;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicPlayerProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicPlayerProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToOption<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|