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