@maas/vue-equipment 1.0.0-beta.4 → 1.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/useCountdown/index.d.ts +23 -0
- package/dist/composables/useCountdown/index.js +133 -0
- package/dist/composables/useCountdown/index.js.map +1 -0
- package/dist/composables/useEasings/index.d.ts +21 -0
- package/dist/composables/useEasings/index.js +40 -0
- package/dist/composables/useEasings/index.js.map +1 -0
- package/dist/composables/useMetaViewport/index.d.ts +9 -0
- package/dist/composables/useMetaViewport/index.js +29 -0
- package/dist/composables/useMetaViewport/index.js.map +1 -0
- package/dist/composables/useScrollTo/index.d.ts +49 -0
- package/dist/composables/useScrollTo/index.js +152 -0
- package/dist/composables/useScrollTo/index.js.map +1 -0
- package/dist/nuxt/module.d.mts +4 -3
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +55 -35
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.d.vue.ts +26 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +70 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +11 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +18 -32
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.d.vue.ts +23 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +62 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +10 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +40 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +9 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +4 -4
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +9 -8
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.d.ts +1 -5
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +3 -3
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.d.vue.ts +15 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +164 -152
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +9 -15
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +50 -54
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.d.vue.ts +27 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +89 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +15 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +39 -49
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +75 -76
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.d.vue.ts +3 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +30 -40
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +88 -85
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +10 -61
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.d.vue.ts +19 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +44 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +9 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +11 -13
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +63 -44
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +21 -4
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.d.vue.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +43 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +9 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.d.vue.ts +17 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +47 -73
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +11 -15
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +1 -1
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +12 -4
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +10 -6
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.d.vue.ts +19 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +92 -101
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +7 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +63 -66
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +37 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +114 -56
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/composables/useMagicDraggable.mjs +1 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.d.vue.ts +31 -0
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +290 -324
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +19 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +37 -15
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +16 -5
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +55 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerUtils.mjs +21 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +7 -2
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicError/index.d.ts +5 -0
- package/dist/plugins/MagicError/index.mjs +3 -0
- package/dist/plugins/MagicError/nuxt.d.ts +2 -0
- package/dist/plugins/MagicError/nuxt.mjs +12 -0
- package/dist/plugins/MagicError/package.json +40 -0
- package/dist/plugins/MagicError/src/MagicError.mjs +0 -0
- package/dist/plugins/MagicError/src/class/MagicError.d.ts +6 -0
- package/dist/plugins/MagicError/src/class/MagicError.mjs +15 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.d.ts +18 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.mjs +31 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.d.vue.ts +21 -0
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +9 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.d.vue.ts +17 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +60 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +7 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +189 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -26
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.d.vue.ts +26 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +103 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +69 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +10 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +99 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +12 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +57 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +11 -24
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +38 -16
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +12 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +45 -18
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +31 -10
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +4 -4
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.d.vue.ts +24 -0
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +11 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +1 -1
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +37 -15
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.d.vue.ts +8 -0
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +17 -9
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.d.vue.ts +8 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +181 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +8 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +35 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +103 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.d.vue.ts +18 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +129 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +10 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +38 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +131 -102
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.d.vue.ts +25 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +140 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +18 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.d.vue.ts +13 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +26 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +7 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +7 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +66 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +128 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.d.vue.ts +36 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +185 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +25 -34
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +113 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +113 -49
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +62 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +50 -93
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-overlay.css +0 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +77 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +7 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.d.vue.ts +18 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +60 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.d.vue.ts +36 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +25 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +71 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +9 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +17 -7
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.d.vue.ts +15 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +91 -110
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +8 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.d.vue.ts +17 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +66 -82
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +7 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +9 -7
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +36 -16
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/types/index.d.ts +11 -11
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +42 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +25 -21
- package/dist/composables/index.d.ts +0 -97
- package/dist/composables/index.js +0 -338
- package/dist/composables/index.js.map +0 -1
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/.turbo/turbo-lint.log +0 -13
- package/dist/plugins/.turbo/turbo-release.log +0 -7
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/plugins/index.d.ts +0 -13
- package/dist/plugins/index.mjs +0 -13
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/plugins/{.turbo/turbo-build.log → MagicError/src/MagicError.d.ts} +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.d.ts +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.mjs +0 -0
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div :data-id="mappedId" class="magic-menu-view">
|
|
3
|
+
<slot :view-active="view.active" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
5
8
|
import { computed, inject, onBeforeUnmount, provide, useId } from "vue";
|
|
6
9
|
import { useMenuView } from "../composables/private/useMenuView";
|
|
7
10
|
import {
|
|
@@ -11,64 +14,57 @@ import {
|
|
|
11
14
|
MagicMenuItemId,
|
|
12
15
|
MagicMenuViewActive
|
|
13
16
|
} from "../symbols";
|
|
17
|
+
import {
|
|
18
|
+
useMagicError
|
|
19
|
+
} from "@maas/vue-equipment/plugins/MagicError";
|
|
14
20
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
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
|
-
case "navigation":
|
|
40
|
-
return "bottom";
|
|
41
|
-
case "menubar":
|
|
42
|
-
return !itemId ? "bottom-start" : "right-start";
|
|
43
|
-
case "dropdown":
|
|
44
|
-
return !itemId ? "bottom" : "right-start";
|
|
45
|
-
case "context":
|
|
46
|
-
return "right-start";
|
|
47
|
-
default:
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const view = initializeView({
|
|
52
|
-
id: mappedId.value,
|
|
53
|
-
parent: { views: parentTree, item: itemId ?? "" },
|
|
54
|
-
placement: mappedPlacement.value ?? "bottom"
|
|
55
|
-
});
|
|
56
|
-
provide(MagicMenuParentTree, mappedParentTree.value);
|
|
57
|
-
provide(MagicMenuViewId, mappedId.value);
|
|
58
|
-
provide(MagicMenuViewActive, mappedActive);
|
|
59
|
-
onBeforeUnmount(() => {
|
|
60
|
-
deleteView(mappedId.value);
|
|
61
|
-
});
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return _openBlock(), _createElementBlock("div", {
|
|
64
|
-
id: mappedId.value,
|
|
65
|
-
class: "magic-menu-view"
|
|
66
|
-
}, [
|
|
67
|
-
_renderSlot(_ctx.$slots, "default", {
|
|
68
|
-
viewActive: _unref(view).active
|
|
69
|
-
})
|
|
70
|
-
], 8, _hoisted_1);
|
|
71
|
-
};
|
|
21
|
+
const { id, placement } = defineProps({
|
|
22
|
+
id: { type: String, required: false },
|
|
23
|
+
placement: { type: String, required: false }
|
|
24
|
+
});
|
|
25
|
+
const magicError = useMagicError({
|
|
26
|
+
prefix: "MagicMenu",
|
|
27
|
+
source: "MagicMenu"
|
|
28
|
+
});
|
|
29
|
+
const parentTree = inject(MagicMenuParentTree, []);
|
|
30
|
+
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
31
|
+
const itemId = inject(MagicMenuItemId, void 0);
|
|
32
|
+
magicError.assert(instanceId, {
|
|
33
|
+
message: "MagicMenuView must be nested inside MagicMenuProvider",
|
|
34
|
+
errorCode: "missing_instance_id"
|
|
35
|
+
});
|
|
36
|
+
const mappedId = computed(() => id ?? `magic-menu-view-${useId()}`);
|
|
37
|
+
const mappedParentTree = computed(() => [...parentTree, mappedId.value]);
|
|
38
|
+
const mappedActive = computed(() => view.active);
|
|
39
|
+
const { initializeView, deleteView } = useMenuView(instanceId);
|
|
40
|
+
const { initializeState } = useMenuState(instanceId);
|
|
41
|
+
const state = initializeState();
|
|
42
|
+
const mappedPlacement = computed(() => {
|
|
43
|
+
if (placement) {
|
|
44
|
+
return placement;
|
|
72
45
|
}
|
|
46
|
+
switch (state.options.mode) {
|
|
47
|
+
case "navigation":
|
|
48
|
+
return "bottom";
|
|
49
|
+
case "menubar":
|
|
50
|
+
return !itemId ? "bottom-start" : "right-start";
|
|
51
|
+
case "dropdown":
|
|
52
|
+
return !itemId ? "bottom" : "right-start";
|
|
53
|
+
case "context":
|
|
54
|
+
return "right-start";
|
|
55
|
+
default:
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const view = initializeView({
|
|
60
|
+
id: mappedId.value,
|
|
61
|
+
parent: { views: parentTree, item: itemId ?? "" },
|
|
62
|
+
placement: mappedPlacement.value ?? "bottom"
|
|
63
|
+
});
|
|
64
|
+
provide(MagicMenuParentTree, mappedParentTree.value);
|
|
65
|
+
provide(MagicMenuViewId, mappedId.value);
|
|
66
|
+
provide(MagicMenuViewActive, mappedActive);
|
|
67
|
+
onBeforeUnmount(() => {
|
|
68
|
+
deleteView(mappedId.value);
|
|
73
69
|
});
|
|
74
70
|
</script>
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MenuPlacement } from '../types/index.js';
|
|
2
2
|
interface MagicMenuViewProps {
|
|
3
3
|
id?: string;
|
|
4
|
-
placement?:
|
|
4
|
+
placement?: MenuPlacement;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
slots: {
|
|
9
|
-
default?(_: {
|
|
10
|
-
viewActive: boolean;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {};
|
|
14
|
-
rootEl: HTMLDivElement;
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
viewActive: boolean;
|
|
15
8
|
};
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
-
export default _default;
|
|
20
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
28
11
|
};
|
|
29
|
-
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<MagicMenuViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
17
|
new (): {
|
|
31
18
|
$slots: S;
|
|
32
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toValue } from "vue";
|
|
2
|
-
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
2
|
+
import { useMagicEmitter } from "@maas/vue-equipment/plugins/MagicEmitter";
|
|
3
3
|
import { ModeScrollLock } from "../../utils/modeScrollLockDefaults.mjs";
|
|
4
4
|
export function useMenuCallback(args) {
|
|
5
5
|
const {
|
|
@@ -24,10 +24,10 @@ export function useMenuCallback(args) {
|
|
|
24
24
|
emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
|
|
25
25
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
26
26
|
if (scrollLock) {
|
|
27
|
-
lockScroll();
|
|
28
27
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
29
28
|
addScrollLockPadding();
|
|
30
29
|
}
|
|
30
|
+
lockScroll();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function onBeforeLeave() {
|
|
@@ -22,7 +22,9 @@ export function useMenuChannel(args) {
|
|
|
22
22
|
return channel;
|
|
23
23
|
}
|
|
24
24
|
function unselectSiblings(id) {
|
|
25
|
-
if (!view?.channels)
|
|
25
|
+
if (!view?.channels) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
26
28
|
for (const channel of view.channels) {
|
|
27
29
|
if (channel.id !== id) {
|
|
28
30
|
channel.active = false;
|
|
@@ -30,7 +32,9 @@ export function useMenuChannel(args) {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
function getChannel(id) {
|
|
33
|
-
if (!view?.channels)
|
|
35
|
+
if (!view?.channels) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
34
38
|
const channel = view.channels.find((ch) => ch.id === id);
|
|
35
39
|
if (channel) {
|
|
36
40
|
channelMap.set(id, channel);
|
|
@@ -44,7 +48,9 @@ export function useMenuChannel(args) {
|
|
|
44
48
|
return channel;
|
|
45
49
|
}
|
|
46
50
|
function deleteChannel(id) {
|
|
47
|
-
if (!view?.channels)
|
|
51
|
+
if (!view?.channels) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
const index = view.channels.findIndex((channel) => channel.id === id);
|
|
49
55
|
if (index !== -1) {
|
|
50
56
|
view.channels.splice(index, 1);
|
|
@@ -53,13 +59,17 @@ export function useMenuChannel(args) {
|
|
|
53
59
|
}
|
|
54
60
|
function selectChannel(id) {
|
|
55
61
|
const channel = getChannel(id);
|
|
56
|
-
if (!channel)
|
|
62
|
+
if (!channel) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
57
65
|
channel.active = true;
|
|
58
66
|
unselectSiblings(id);
|
|
59
67
|
}
|
|
60
68
|
function unselectChannel(id) {
|
|
61
69
|
const channel = getChannel(id);
|
|
62
|
-
if (!channel)
|
|
70
|
+
if (!channel) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
63
73
|
channel.active = false;
|
|
64
74
|
}
|
|
65
75
|
return {
|
|
@@ -7,9 +7,9 @@ export declare function useMenuCursor(view: MenuView, debug?: boolean): {
|
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
}[]>;
|
|
10
|
-
isInsideFrom: import("vue").
|
|
11
|
-
isInsideTo: import("vue").
|
|
12
|
-
isInsideTriangle: import("vue").
|
|
10
|
+
isInsideFrom: import("vue").ShallowRef<boolean, boolean>;
|
|
11
|
+
isInsideTo: import("vue").ShallowRef<boolean, boolean>;
|
|
12
|
+
isInsideTriangle: import("vue").ShallowRef<boolean, boolean>;
|
|
13
13
|
initialize: () => void;
|
|
14
14
|
destroy: () => void;
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useEventListener } from "@vueuse/core";
|
|
3
3
|
export function useMenuCursor(view, debug = false) {
|
|
4
4
|
let cancelListener = new AbortController();
|
|
@@ -7,9 +7,9 @@ export function useMenuCursor(view, debug = false) {
|
|
|
7
7
|
{ x: 0, y: 0 },
|
|
8
8
|
{ x: 0, y: 0 }
|
|
9
9
|
]);
|
|
10
|
-
const isInsideFrom =
|
|
11
|
-
const isInsideTo =
|
|
12
|
-
const isInsideTriangle =
|
|
10
|
+
const isInsideFrom = shallowRef(false);
|
|
11
|
+
const isInsideTo = shallowRef(false);
|
|
12
|
+
const isInsideTriangle = shallowRef(false);
|
|
13
13
|
function extendTriangle(vertices, pixelAmount) {
|
|
14
14
|
const [a, b, c] = vertices;
|
|
15
15
|
switch (view?.placement) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
matchClass,
|
|
5
|
+
scrollbarGutterSupport,
|
|
6
|
+
scrollbarWidth
|
|
7
|
+
} from "@maas/vue-equipment/utils";
|
|
8
|
+
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
9
|
export function useMenuDOM() {
|
|
6
10
|
const positionFixedElements = ref([]);
|
|
7
11
|
function lockScroll() {
|
|
@@ -11,26 +15,44 @@ export function useMenuDOM() {
|
|
|
11
15
|
scrollLock.value = false;
|
|
12
16
|
}
|
|
13
17
|
function addScrollLockPadding() {
|
|
14
|
-
if (typeof window === "undefined")
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
document.body.style.
|
|
18
|
+
if (typeof window === "undefined") {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const exclude = new RegExp(/magic-menu/);
|
|
22
|
+
document.body.style.setProperty(
|
|
23
|
+
"--scrollbar-width",
|
|
24
|
+
`${scrollbarWidth()}px`
|
|
25
|
+
);
|
|
19
26
|
positionFixedElements.value = [
|
|
20
27
|
...document.body.getElementsByTagName("*")
|
|
21
28
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
29
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
26
30
|
);
|
|
31
|
+
switch (scrollbarGutterSupport()) {
|
|
32
|
+
case true:
|
|
33
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
34
|
+
positionFixedElements.value.forEach((elem) => {
|
|
35
|
+
elem.style.scrollbarGutter = "stable";
|
|
36
|
+
elem.style.overflow = "auto";
|
|
37
|
+
});
|
|
38
|
+
break;
|
|
39
|
+
case false:
|
|
40
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
41
|
+
positionFixedElements.value.forEach(
|
|
42
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
43
|
+
);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
27
46
|
}
|
|
28
47
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
48
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
49
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
document.body.style.paddingRight = "";
|
|
51
|
+
positionFixedElements.value.forEach((elem) => {
|
|
52
|
+
elem.style.paddingRight = "";
|
|
53
|
+
elem.style.scrollbarGutter = "";
|
|
54
|
+
elem.style.overflow = "";
|
|
55
|
+
});
|
|
34
56
|
}
|
|
35
57
|
return {
|
|
36
58
|
lockScroll,
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { reactive } from "vue";
|
|
2
2
|
import { usePointer, watchOnce } from "@vueuse/core";
|
|
3
|
+
import { useMagicError } from "@maas/vue-equipment/plugins/MagicError";
|
|
3
4
|
import { useMenuView } from "./useMenuView.mjs";
|
|
4
5
|
import { useMenuState } from "./useMenuState.mjs";
|
|
5
6
|
export function useMenuItem(args) {
|
|
6
7
|
const { instanceId, viewId } = args;
|
|
8
|
+
const { throwError } = useMagicError({
|
|
9
|
+
prefix: "MagicMenu",
|
|
10
|
+
source: "useMenuItem"
|
|
11
|
+
});
|
|
7
12
|
const { initializeState } = useMenuState(instanceId);
|
|
8
13
|
const state = initializeState();
|
|
9
14
|
const { getView, unselectDescendingViews } = useMenuView(instanceId);
|
|
10
15
|
const view = getView(viewId);
|
|
11
16
|
if (!view) {
|
|
12
|
-
|
|
17
|
+
throwError({
|
|
18
|
+
message: `View ${viewId} not found`,
|
|
19
|
+
errorCode: "view_id_not_found"
|
|
20
|
+
});
|
|
13
21
|
}
|
|
14
22
|
function createItem(args2) {
|
|
15
23
|
const { id, disabled } = args2;
|
|
@@ -36,7 +44,9 @@ export function useMenuItem(args) {
|
|
|
36
44
|
return item;
|
|
37
45
|
}
|
|
38
46
|
function deleteItem(id) {
|
|
39
|
-
if (!view?.items)
|
|
47
|
+
if (!view?.items) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
40
50
|
view.items = view.items.filter((x) => x.id !== id);
|
|
41
51
|
}
|
|
42
52
|
function getItem(id) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MaybeRef } from 'vue';
|
|
2
2
|
export declare function useMenuKeyListener(instanceId: MaybeRef<string>): {
|
|
3
3
|
onArrowRight: (e: KeyboardEvent) => Promise<void>;
|
|
4
4
|
onArrowLeft: (e: KeyboardEvent) => void;
|
|
5
5
|
onArrowUp: (e: KeyboardEvent) => void;
|
|
6
6
|
onArrowDown: (e: KeyboardEvent) => void;
|
|
7
7
|
onEscape: (e: KeyboardEvent) => void;
|
|
8
|
-
|
|
8
|
+
onReturn: (e: KeyboardEvent) => Promise<void>;
|
|
9
9
|
onTab: (e: KeyboardEvent) => void;
|
|
10
10
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { useMagicError } from "@maas/vue-equipment/plugins/MagicError";
|
|
1
2
|
import { useMenuState } from "./useMenuState.mjs";
|
|
2
3
|
import { useMenuView } from "./useMenuView.mjs";
|
|
3
4
|
import { useMenuItem } from "./useMenuItem.mjs";
|
|
4
5
|
export function useMenuKeyListener(instanceId) {
|
|
5
6
|
const { initializeState } = useMenuState(instanceId);
|
|
6
7
|
const state = initializeState();
|
|
8
|
+
const { throwError, logWarning } = useMagicError({
|
|
9
|
+
prefix: "MagicMenu",
|
|
10
|
+
source: "useMenuKeyListener"
|
|
11
|
+
});
|
|
7
12
|
const {
|
|
8
13
|
selectView,
|
|
9
14
|
unselectView,
|
|
@@ -19,11 +24,17 @@ export function useMenuKeyListener(instanceId) {
|
|
|
19
24
|
function keyStrokeGuard(e) {
|
|
20
25
|
switch (true) {
|
|
21
26
|
case (!state.active && state.options.debug):
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
throwError({
|
|
28
|
+
message: `'MagicMenu ${state.id} is not active'`,
|
|
29
|
+
errorCode: "menu_not_active"
|
|
30
|
+
});
|
|
31
|
+
case state.active:
|
|
24
32
|
state.input.type = "keyboard";
|
|
25
|
-
e.preventDefault();
|
|
26
33
|
e.stopPropagation();
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
state.input.type = "keyboard";
|
|
27
38
|
}
|
|
28
39
|
}
|
|
29
40
|
function getEnabledItems(view) {
|
|
@@ -31,13 +42,16 @@ export function useMenuKeyListener(instanceId) {
|
|
|
31
42
|
}
|
|
32
43
|
function selectFirstItem(view) {
|
|
33
44
|
const { selectItem } = useMenuItem({ instanceId, viewId: view.id });
|
|
34
|
-
|
|
45
|
+
const firstItem = getEnabledItems(view)[0];
|
|
46
|
+
if (firstItem) {
|
|
47
|
+
selectItem(firstItem.id, true);
|
|
48
|
+
}
|
|
35
49
|
}
|
|
36
50
|
async function onArrowRight(e) {
|
|
37
51
|
try {
|
|
38
52
|
keyStrokeGuard(e);
|
|
39
53
|
} catch (e2) {
|
|
40
|
-
|
|
54
|
+
logWarning(String(e2));
|
|
41
55
|
}
|
|
42
56
|
if (!state.input.view) {
|
|
43
57
|
return;
|
|
@@ -66,7 +80,7 @@ export function useMenuKeyListener(instanceId) {
|
|
|
66
80
|
try {
|
|
67
81
|
keyStrokeGuard(e);
|
|
68
82
|
} catch (e2) {
|
|
69
|
-
|
|
83
|
+
logWarning(String(e2));
|
|
70
84
|
}
|
|
71
85
|
if (!state.input.view) {
|
|
72
86
|
return;
|
|
@@ -90,23 +104,31 @@ export function useMenuKeyListener(instanceId) {
|
|
|
90
104
|
try {
|
|
91
105
|
keyStrokeGuard(e);
|
|
92
106
|
} catch (e2) {
|
|
93
|
-
|
|
107
|
+
logWarning(String(e2));
|
|
94
108
|
}
|
|
95
109
|
if (!state.input.view) {
|
|
96
110
|
return;
|
|
97
111
|
}
|
|
98
112
|
const viewId = state.input.view;
|
|
99
113
|
const inputView = getView(viewId);
|
|
100
|
-
if (!inputView)
|
|
114
|
+
if (!inputView) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
101
117
|
const enabledItems = getEnabledItems(inputView);
|
|
102
118
|
const prevIndex = enabledItems.findIndex((item) => item.active) - 1;
|
|
103
119
|
if (prevIndex >= 0) {
|
|
104
120
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
105
|
-
|
|
121
|
+
const prevItem = enabledItems[prevIndex];
|
|
122
|
+
if (prevItem) {
|
|
123
|
+
selectItem(prevItem.id, true);
|
|
124
|
+
}
|
|
106
125
|
unselectUnrelatedViews(viewId);
|
|
107
126
|
} else if (prevIndex !== -1) {
|
|
108
127
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
109
|
-
|
|
128
|
+
const lastItem = enabledItems[enabledItems.length - 1];
|
|
129
|
+
if (lastItem) {
|
|
130
|
+
selectItem(lastItem.id, true);
|
|
131
|
+
}
|
|
110
132
|
unselectUnrelatedViews(viewId);
|
|
111
133
|
}
|
|
112
134
|
}
|
|
@@ -114,19 +136,24 @@ export function useMenuKeyListener(instanceId) {
|
|
|
114
136
|
try {
|
|
115
137
|
keyStrokeGuard(e);
|
|
116
138
|
} catch (e2) {
|
|
117
|
-
|
|
139
|
+
logWarning(String(e2));
|
|
118
140
|
}
|
|
119
141
|
if (!state.input.view) {
|
|
120
142
|
return;
|
|
121
143
|
}
|
|
122
144
|
const viewId = state.input.view;
|
|
123
145
|
const inputView = getView(viewId);
|
|
124
|
-
if (!inputView)
|
|
146
|
+
if (!inputView) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
125
149
|
const enabledItems = getEnabledItems(inputView);
|
|
126
150
|
const nextIndex = enabledItems.findIndex((item) => item.active) + 1;
|
|
127
151
|
if (nextIndex >= 0) {
|
|
128
152
|
const { selectItem } = useMenuItem({ instanceId, viewId });
|
|
129
|
-
|
|
153
|
+
const nextItem = enabledItems[nextIndex];
|
|
154
|
+
if (nextItem) {
|
|
155
|
+
selectItem(nextItem.id, true);
|
|
156
|
+
}
|
|
130
157
|
unselectUnrelatedViews(viewId);
|
|
131
158
|
}
|
|
132
159
|
}
|
|
@@ -134,17 +161,17 @@ export function useMenuKeyListener(instanceId) {
|
|
|
134
161
|
try {
|
|
135
162
|
keyStrokeGuard(e);
|
|
136
163
|
} catch (e2) {
|
|
137
|
-
|
|
164
|
+
logWarning(String(e2));
|
|
138
165
|
}
|
|
139
166
|
state.active = false;
|
|
140
167
|
state.input.view = "";
|
|
141
168
|
unselectAllViews();
|
|
142
169
|
}
|
|
143
|
-
async function
|
|
170
|
+
async function onReturn(e) {
|
|
144
171
|
try {
|
|
145
172
|
keyStrokeGuard(e);
|
|
146
173
|
} catch (e2) {
|
|
147
|
-
|
|
174
|
+
logWarning(String(e2));
|
|
148
175
|
}
|
|
149
176
|
if (!state.input.view) {
|
|
150
177
|
return;
|
|
@@ -167,7 +194,7 @@ export function useMenuKeyListener(instanceId) {
|
|
|
167
194
|
try {
|
|
168
195
|
keyStrokeGuard(e);
|
|
169
196
|
} catch (e2) {
|
|
170
|
-
|
|
197
|
+
logWarning(String(e2));
|
|
171
198
|
}
|
|
172
199
|
}
|
|
173
200
|
}
|
|
@@ -177,7 +204,7 @@ export function useMenuKeyListener(instanceId) {
|
|
|
177
204
|
onArrowUp,
|
|
178
205
|
onArrowDown,
|
|
179
206
|
onEscape,
|
|
180
|
-
|
|
207
|
+
onReturn,
|
|
181
208
|
onTab
|
|
182
209
|
};
|
|
183
210
|
}
|
|
@@ -7,11 +7,11 @@ type UseMenuTriggerArgs = {
|
|
|
7
7
|
itemId?: string;
|
|
8
8
|
mappedDisabled: ComputedRef<boolean>;
|
|
9
9
|
mappedTrigger: ComputedRef<Interaction[]>;
|
|
10
|
-
elRef: Ref<InstanceType<typeof Primitive> |
|
|
10
|
+
elRef: Ref<InstanceType<typeof Primitive> | null>;
|
|
11
11
|
};
|
|
12
12
|
export declare function useMenuTrigger(args: UseMenuTriggerArgs): {
|
|
13
13
|
onMouseenter: () => void;
|
|
14
14
|
onClick: (e: MouseEvent) => void;
|
|
15
|
-
|
|
15
|
+
onKeypress: (e: KeyboardEvent) => void;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {} from "vue";
|
|
2
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
1
3
|
import { useMagicKeys, useFocus } from "@vueuse/core";
|
|
2
4
|
import { useMenuView } from "./useMenuView.mjs";
|
|
3
5
|
import { useMenuState } from "./useMenuState.mjs";
|
|
@@ -32,7 +34,7 @@ export function useMenuTrigger(args) {
|
|
|
32
34
|
unselectView(viewId);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
function
|
|
37
|
+
function onKeypress(e) {
|
|
36
38
|
if (focused.value && !mappedDisabled.value && !view?.active) {
|
|
37
39
|
e.preventDefault();
|
|
38
40
|
e.stopPropagation();
|
|
@@ -95,6 +97,6 @@ export function useMenuTrigger(args) {
|
|
|
95
97
|
return {
|
|
96
98
|
onMouseenter,
|
|
97
99
|
onClick,
|
|
98
|
-
|
|
100
|
+
onKeypress
|
|
99
101
|
};
|
|
100
102
|
}
|