@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,135 +1,126 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<slot :is-active="item.active" :is-disabled="disabled" />
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script lang="ts" setup>
|
|
18
|
-
import { computed, inject, provide, onBeforeUnmount, watch, useId } from 'vue'
|
|
19
|
-
import { useMenuItem } from '../composables/private/useMenuItem'
|
|
20
|
-
import { useMenuState } from '../composables/private/useMenuState'
|
|
21
|
-
import { useMenuView } from '../composables/private/useMenuView'
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id", "data-disabled", "data-active", "data-pointer-disabled"];
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "magic-menu-item__pointer-guard"
|
|
8
|
+
};
|
|
9
|
+
import { computed, inject, provide, onBeforeUnmount, watch, useId } from "vue";
|
|
10
|
+
import { useMenuItem } from "../composables/private/useMenuItem";
|
|
11
|
+
import { useMenuState } from "../composables/private/useMenuState";
|
|
12
|
+
import { useMenuView } from "../composables/private/useMenuView";
|
|
22
13
|
import {
|
|
23
14
|
MagicMenuInstanceId,
|
|
24
15
|
MagicMenuViewId,
|
|
25
16
|
MagicMenuContentId,
|
|
26
17
|
MagicMenuItemId,
|
|
27
|
-
MagicMenuItemActive
|
|
28
|
-
} from
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
18
|
+
MagicMenuItemActive
|
|
19
|
+
} from "../symbols";
|
|
20
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
21
|
+
__name: "MagicMenuItem",
|
|
22
|
+
props: {
|
|
23
|
+
id: { type: String, required: false },
|
|
24
|
+
disabled: { type: Boolean, required: false }
|
|
25
|
+
},
|
|
26
|
+
emits: ["click"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
const emit = __emit;
|
|
29
|
+
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
30
|
+
const viewId = inject(MagicMenuViewId, void 0);
|
|
31
|
+
const contentId = inject(MagicMenuContentId, void 0);
|
|
32
|
+
if (!instanceId) {
|
|
33
|
+
throw new Error("MagicMenuItem must be nested inside MagicMenuProvider");
|
|
34
|
+
}
|
|
35
|
+
if (!viewId) {
|
|
36
|
+
throw new Error("MagicMenuItem must be nested inside MagicMenuView");
|
|
37
|
+
}
|
|
38
|
+
if (!contentId) {
|
|
39
|
+
throw new Error("MagicMenuItem must be nested inside MagicMenuContent");
|
|
40
|
+
}
|
|
41
|
+
const mappedId = computed(() => __props.id ?? `magic-menu-item-${useId()}`);
|
|
42
|
+
const mappedActive = computed(() => item.active);
|
|
43
|
+
const { initializeItem, deleteItem, selectItem, unselectItem } = useMenuItem({
|
|
44
|
+
instanceId,
|
|
45
|
+
viewId
|
|
46
|
+
});
|
|
47
|
+
const { initializeState } = useMenuState(instanceId);
|
|
48
|
+
const state = initializeState();
|
|
49
|
+
const item = initializeItem({
|
|
50
|
+
id: mappedId.value,
|
|
51
|
+
disabled: __props.disabled ?? false
|
|
52
|
+
});
|
|
53
|
+
const pointerDisabled = computed(() => state.input.disabled.includes("pointer"));
|
|
54
|
+
function guardedSelect() {
|
|
55
|
+
if (state.input.type === "pointer" && !state.input.disabled.includes("pointer") && !item.active && !item.disabled) {
|
|
56
|
+
selectItem(mappedId.value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const { getNestedView, unselectAllViews } = useMenuView(instanceId);
|
|
60
|
+
const nestedView = computed(() => getNestedView(mappedId.value));
|
|
61
|
+
function guardedUnselect() {
|
|
62
|
+
if (!nestedView.value || !nestedView.value.active) {
|
|
63
|
+
unselectItem(mappedId.value);
|
|
64
|
+
} else {
|
|
65
|
+
watch(
|
|
66
|
+
() => nestedView.value?.active,
|
|
67
|
+
(value) => {
|
|
68
|
+
if (!value) {
|
|
69
|
+
unselectItem(mappedId.value);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{ once: true }
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function onClick(event) {
|
|
77
|
+
emit("click", event);
|
|
78
|
+
state.input.type = "pointer";
|
|
79
|
+
state.input.disabled = [];
|
|
80
|
+
if (!item.disabled && !item.active) {
|
|
81
|
+
selectItem(mappedId.value);
|
|
82
|
+
}
|
|
83
|
+
if (!nestedView.value) {
|
|
84
|
+
state.active = false;
|
|
85
|
+
unselectAllViews();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
provide(MagicMenuItemId, mappedId.value);
|
|
89
|
+
provide(MagicMenuItemActive, mappedActive);
|
|
90
|
+
onBeforeUnmount(() => {
|
|
91
|
+
deleteItem(mappedId.value);
|
|
92
|
+
});
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return _openBlock(), _createElementBlock("div", {
|
|
95
|
+
class: "magic-menu-item",
|
|
96
|
+
"data-id": mappedId.value,
|
|
97
|
+
"data-disabled": _ctx.disabled,
|
|
98
|
+
"data-active": _unref(item).active,
|
|
99
|
+
"data-pointer-disabled": pointerDisabled.value,
|
|
100
|
+
onMouseenter: guardedSelect,
|
|
101
|
+
onMousemove: guardedSelect,
|
|
102
|
+
onTouchstartPassive: guardedSelect,
|
|
103
|
+
onMouseleave: guardedUnselect,
|
|
104
|
+
onClick
|
|
105
|
+
}, [
|
|
106
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
107
|
+
itemActive: _unref(item).active,
|
|
108
|
+
itemDisabled: _ctx.disabled
|
|
109
|
+
}),
|
|
110
|
+
pointerDisabled.value ? (_openBlock(), _createElementBlock("div", _hoisted_2)) : _createCommentVNode("v-if", true)
|
|
111
|
+
], 40, _hoisted_1);
|
|
112
|
+
};
|
|
80
113
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Guarded unselect
|
|
84
|
-
// Check for active nested views
|
|
85
|
-
const { getNestedView, unselectAllViews } = useMenuView(instanceId)
|
|
86
|
-
const nestedView = computed(() => getNestedView(mappedId.value))
|
|
114
|
+
});
|
|
115
|
+
</script>
|
|
87
116
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
unselectItem(mappedId.value)
|
|
92
|
-
} else {
|
|
93
|
-
// If there is a nested active view,
|
|
94
|
-
// unselect the item once it is closed
|
|
95
|
-
watch(
|
|
96
|
-
() => nestedView.value?.active,
|
|
97
|
-
(value) => {
|
|
98
|
-
if (!value) {
|
|
99
|
-
unselectItem(mappedId.value)
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{ once: true }
|
|
103
|
-
)
|
|
104
|
-
}
|
|
117
|
+
<style>
|
|
118
|
+
.magic-menu-item {
|
|
119
|
+
cursor: var(--magic-menu-item-cursor, default);
|
|
105
120
|
}
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
state.input.type = 'pointer'
|
|
111
|
-
state.input.disabled = []
|
|
112
|
-
|
|
113
|
-
if (!item.disabled && !item.active) {
|
|
114
|
-
selectItem(mappedId.value)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (!nestedView.value) {
|
|
118
|
-
state.active = false
|
|
119
|
-
unselectAllViews()
|
|
120
|
-
}
|
|
122
|
+
.magic-menu-item__pointer-guard {
|
|
123
|
+
position: absolute;
|
|
124
|
+
inset: 0;
|
|
121
125
|
}
|
|
122
|
-
|
|
123
|
-
// Pass id and active state to children
|
|
124
|
-
provide(MagicMenuItemId, mappedId.value)
|
|
125
|
-
provide(MagicMenuItemActive, item.active)
|
|
126
|
-
|
|
127
|
-
// Lifecycle
|
|
128
|
-
onBeforeUnmount(() => {
|
|
129
|
-
deleteItem(mappedId.value)
|
|
130
|
-
})
|
|
131
|
-
</script>
|
|
132
|
-
|
|
133
|
-
<style>
|
|
134
|
-
.magic-menu-item{cursor:var(--magic-menu-item-cursor,default)}.magic-menu-item.-disabled{cursor:var(--magic-menu-item-cursor-disabled,not-allowed)}.magic-menu-item.-disabled>*{pointer-events:none}
|
|
135
126
|
</style>
|
|
@@ -2,28 +2,40 @@ interface MagicMenuItemProps {
|
|
|
2
2
|
id?: string;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
rootEl: HTMLDivElement;
|
|
5
|
+
declare const mappedId: import("vue").ComputedRef<string>;
|
|
6
|
+
declare const item: import("../types").MenuItem;
|
|
7
|
+
declare const pointerDisabled: import("vue").ComputedRef<boolean>;
|
|
8
|
+
declare function guardedSelect(): void;
|
|
9
|
+
declare function guardedUnselect(): void;
|
|
10
|
+
declare function onClick(event: MouseEvent): void;
|
|
11
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
itemActive: boolean;
|
|
14
|
+
itemDisabled: boolean;
|
|
17
15
|
};
|
|
18
|
-
type
|
|
16
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
17
|
+
default?: (props: typeof __VLS_1) => any;
|
|
18
|
+
}>;
|
|
19
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicMenuItemProps, {
|
|
20
|
+
mappedId: typeof mappedId;
|
|
21
|
+
item: typeof item;
|
|
22
|
+
pointerDisabled: typeof pointerDisabled;
|
|
23
|
+
guardedSelect: typeof guardedSelect;
|
|
24
|
+
guardedUnselect: typeof guardedUnselect;
|
|
25
|
+
onClick: typeof onClick;
|
|
26
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
click: (event: MouseEvent) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
|
|
29
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
31
|
declare const __VLS_component: import("vue").DefineComponent<MagicMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
20
32
|
click: (event: MouseEvent) => any;
|
|
21
33
|
}, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
|
|
22
34
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
24
|
-
declare const _default:
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
37
|
export default _default;
|
|
26
|
-
type
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
39
|
new (): {
|
|
28
40
|
$slots: S;
|
|
29
41
|
};
|
|
@@ -1,102 +1,111 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const mappedOptions = defu(props.options, defaultOptions)
|
|
28
|
-
|
|
29
|
-
const { initializeState, deleteState } = useMenuState(props.id)
|
|
30
|
-
const state = initializeState(mappedOptions)
|
|
31
|
-
|
|
32
|
-
// If the mode changes, save the current pointer position
|
|
33
|
-
// If the pointer moves, switch to mouse mode
|
|
34
|
-
const lastX = ref(0)
|
|
35
|
-
const lastY = ref(0)
|
|
36
|
-
|
|
37
|
-
const { x, y } = usePointer()
|
|
38
|
-
|
|
39
|
-
watch(
|
|
40
|
-
() => state?.input.type,
|
|
41
|
-
(value) => {
|
|
42
|
-
if (value === 'keyboard') {
|
|
43
|
-
lastX.value = x.value
|
|
44
|
-
lastY.value = y.value
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
watch([x, y], ([x, y]) => {
|
|
50
|
-
if (x !== lastX.value || y !== lastY.value) {
|
|
51
|
-
if (state) {
|
|
52
|
-
state.input.type = 'pointer'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
// Add key listener
|
|
58
|
-
const {
|
|
59
|
-
onArrowRight,
|
|
60
|
-
onArrowLeft,
|
|
61
|
-
onArrowUp,
|
|
62
|
-
onArrowDown,
|
|
63
|
-
onEscape,
|
|
64
|
-
onEnter,
|
|
65
|
-
onTab,
|
|
66
|
-
} = useMenuKeyListener(props.id)
|
|
67
|
-
|
|
68
|
-
onKeyStroke('ArrowRight', onArrowRight)
|
|
69
|
-
onKeyStroke('ArrowLeft', onArrowLeft)
|
|
70
|
-
onKeyStroke('ArrowDown', onArrowDown)
|
|
71
|
-
onKeyStroke('ArrowUp', onArrowUp)
|
|
72
|
-
onKeyStroke('Escape', onEscape)
|
|
73
|
-
onKeyStroke('Enter', onEnter)
|
|
74
|
-
onKeyStroke('Tab', onTab)
|
|
75
|
-
|
|
76
|
-
// Handle off-click
|
|
77
|
-
const { unselectAllViews } = useMenuView(props.id)
|
|
78
|
-
|
|
79
|
-
onClickOutside(
|
|
80
|
-
elRef,
|
|
81
|
-
() => {
|
|
82
|
-
if (state) {
|
|
83
|
-
state.active = false
|
|
84
|
-
}
|
|
85
|
-
unselectAllViews()
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import {
|
|
5
|
+
useTemplateRef,
|
|
6
|
+
shallowRef,
|
|
7
|
+
provide,
|
|
8
|
+
watch,
|
|
9
|
+
toValue,
|
|
10
|
+
onBeforeUnmount
|
|
11
|
+
} from "vue";
|
|
12
|
+
import { onClickOutside, onKeyStroke, usePointer } from "@vueuse/core";
|
|
13
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
14
|
+
import { defu } from "defu";
|
|
15
|
+
import { useMenuState } from "../composables/private/useMenuState";
|
|
16
|
+
import { useMenuView } from "../composables/private/useMenuView";
|
|
17
|
+
import { useMenuKeyListener } from "../composables/private/useMenuKeyListener";
|
|
18
|
+
import { MagicMenuInstanceId } from "../symbols";
|
|
19
|
+
import { defaultOptions } from "../utils/defaultOptions";
|
|
20
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
21
|
+
__name: "MagicMenuProvider",
|
|
22
|
+
props: {
|
|
23
|
+
id: { type: null, required: true },
|
|
24
|
+
asChild: { type: Boolean, required: false },
|
|
25
|
+
options: { type: Object, required: false }
|
|
86
26
|
},
|
|
87
|
-
{
|
|
88
|
-
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const elRef = useTemplateRef("el");
|
|
29
|
+
const mappedOptions = defu(__props.options, defaultOptions);
|
|
30
|
+
const { initializeState, deleteState } = useMenuState(__props.id);
|
|
31
|
+
const state = initializeState(mappedOptions);
|
|
32
|
+
const lastX = shallowRef(0);
|
|
33
|
+
const lastY = shallowRef(0);
|
|
34
|
+
const { x, y } = usePointer();
|
|
35
|
+
watch(
|
|
36
|
+
() => state?.input.type,
|
|
37
|
+
(value) => {
|
|
38
|
+
if (value === "keyboard") {
|
|
39
|
+
lastX.value = x.value;
|
|
40
|
+
lastY.value = y.value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
watch([x, y], ([x2, y2]) => {
|
|
45
|
+
if (x2 !== lastX.value || y2 !== lastY.value) {
|
|
46
|
+
if (state) {
|
|
47
|
+
state.input.type = "pointer";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const {
|
|
52
|
+
onArrowRight,
|
|
53
|
+
onArrowLeft,
|
|
54
|
+
onArrowUp,
|
|
55
|
+
onArrowDown,
|
|
56
|
+
onEscape,
|
|
57
|
+
onEnter,
|
|
58
|
+
onTab
|
|
59
|
+
} = useMenuKeyListener(__props.id);
|
|
60
|
+
onKeyStroke("ArrowRight", onArrowRight);
|
|
61
|
+
onKeyStroke("ArrowLeft", onArrowLeft);
|
|
62
|
+
onKeyStroke("ArrowDown", onArrowDown);
|
|
63
|
+
onKeyStroke("ArrowUp", onArrowUp);
|
|
64
|
+
onKeyStroke("Escape", onEscape);
|
|
65
|
+
onKeyStroke("Enter", onEnter);
|
|
66
|
+
onKeyStroke("Tab", onTab);
|
|
67
|
+
const { unselectAllViews } = useMenuView(__props.id);
|
|
68
|
+
onClickOutside(
|
|
69
|
+
elRef,
|
|
70
|
+
() => {
|
|
71
|
+
if (state) {
|
|
72
|
+
state.active = false;
|
|
73
|
+
}
|
|
74
|
+
unselectAllViews();
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
ignore: [
|
|
78
|
+
`[data-id='${toValue(__props.id)}'] .magic-menu-trigger`,
|
|
79
|
+
`[data-id='${toValue(__props.id)}'] .magic-menu-item`,
|
|
80
|
+
`.magic-menu-float`
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
onBeforeUnmount(() => {
|
|
85
|
+
deleteState();
|
|
86
|
+
});
|
|
87
|
+
provide(MagicMenuInstanceId, __props.id);
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
90
|
+
ref: "el",
|
|
91
|
+
"as-child": _ctx.asChild,
|
|
92
|
+
"data-id": _ctx.id,
|
|
93
|
+
class: "magic-menu-provider"
|
|
94
|
+
}, {
|
|
95
|
+
default: _withCtx(() => [
|
|
96
|
+
_renderSlot(_ctx.$slots, "default")
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
/* FORWARDED */
|
|
100
|
+
}, 8, ["as-child", "data-id"]);
|
|
101
|
+
};
|
|
89
102
|
}
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
// Lifecycle
|
|
93
|
-
onBeforeUnmount(() => {
|
|
94
|
-
deleteState()
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
provide(MagicMenuInstanceId, props.id)
|
|
103
|
+
});
|
|
98
104
|
</script>
|
|
99
105
|
|
|
100
106
|
<style>
|
|
101
|
-
.magic-menu-provider{
|
|
107
|
+
.magic-menu-provider {
|
|
108
|
+
outline: none;
|
|
109
|
+
user-select: none;
|
|
110
|
+
}
|
|
102
111
|
</style>
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import
|
|
2
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
3
|
+
import type { MagicMenuOptions } from '../types/index.js';
|
|
3
4
|
interface MagicMenuProviderProps {
|
|
4
5
|
id: MaybeRef<string>;
|
|
6
|
+
asChild?: boolean;
|
|
5
7
|
options?: MagicMenuOptions;
|
|
6
8
|
}
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
19
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
9
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
|
+
declare var __VLS_7: {};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_7) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicMenuProviderProps, {
|
|
15
|
+
Primitive: typeof Primitive;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
19
|
export default _default;
|
|
21
|
-
type
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
21
|
new (): {
|
|
23
22
|
$slots: S;
|
|
24
23
|
};
|