@maas/vue-equipment 0.40.0 → 1.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -16
- package/dist/composables/index.d.ts +7 -18
- package/dist/composables/index.js +79 -132
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +35 -42
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +5 -0
- package/dist/plugins/.turbo/turbo-release.log +7 -0
- package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
- package/dist/plugins/MagicAccordion/index.d.ts +2 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
- package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
- package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
- package/dist/plugins/MagicCommand/index.d.ts +2 -0
- package/dist/plugins/MagicCommand/index.mjs +9 -11
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
- package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
- package/dist/plugins/MagicCookie/index.d.ts +5 -3
- package/dist/plugins/MagicCookie/index.mjs +7 -3
- package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
- package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
- package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
- package/dist/plugins/MagicMenu/index.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +266 -166
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/index.d.ts +4 -9
- package/dist/plugins/MagicPlayer/index.mjs +11 -17
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
- package/dist/plugins/MagicScroll/index.d.ts +4 -10
- package/dist/plugins/MagicScroll/index.mjs +2 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
- package/dist/plugins/MagicToast/index.d.ts +3 -2
- package/dist/plugins/MagicToast/index.mjs +3 -3
- package/dist/plugins/MagicToast/nuxt.mjs +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
- package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
- package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
- package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
- package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/utils/css/animations/auto-size-out.css +12 -0
- package/dist/utils/css/animations/squash-y.css +5 -0
- package/dist/utils/css/animations.css +2 -1
- package/dist/utils/index.d.ts +10 -6
- package/dist/utils/index.js +41 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +62 -58
- package/dist/composables/index.d.mts +0 -108
- package/dist/composables/index.mjs +0 -383
- package/dist/composables/index.mjs.map +0 -1
- package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
- package/dist/plugins/MagicAutoSize/index.mjs +0 -7
- package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
- package/dist/utils/index.d.mts +0 -80
- package/dist/utils/index.mjs +0 -200
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { nextTick } from "vue";
|
|
2
|
+
import { useFocus } from "@vueuse/core";
|
|
3
|
+
import { useCommandView } from "./useCommandView.mjs";
|
|
4
|
+
import { useCommandState } from "./useCommandState.mjs";
|
|
5
|
+
export function useCommandTrigger(args) {
|
|
6
|
+
const {
|
|
7
|
+
instanceId,
|
|
8
|
+
viewId,
|
|
9
|
+
trigger,
|
|
10
|
+
action,
|
|
11
|
+
mappedDisabled,
|
|
12
|
+
mappedActive,
|
|
13
|
+
elRef
|
|
14
|
+
} = args;
|
|
15
|
+
const { getView, selectView, unselectView } = useCommandView(instanceId);
|
|
16
|
+
const view = getView(viewId);
|
|
17
|
+
const { initializeState } = useCommandState(instanceId);
|
|
18
|
+
const state = initializeState();
|
|
19
|
+
const { focused } = useFocus(elRef);
|
|
20
|
+
async function onEnter(e) {
|
|
21
|
+
if ((focused.value || mappedActive?.value) && !mappedDisabled.value && !view?.active) {
|
|
22
|
+
e?.preventDefault();
|
|
23
|
+
e?.stopPropagation();
|
|
24
|
+
state.input.type = "keyboard";
|
|
25
|
+
switch (action) {
|
|
26
|
+
case "close":
|
|
27
|
+
unselectView(viewId);
|
|
28
|
+
break;
|
|
29
|
+
case "open":
|
|
30
|
+
if (!state.active) {
|
|
31
|
+
state.active = true;
|
|
32
|
+
await nextTick();
|
|
33
|
+
}
|
|
34
|
+
selectView(viewId);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function onMouseenter() {
|
|
40
|
+
if (trigger.includes("mouseenter") && !mappedDisabled.value && viewId && view) {
|
|
41
|
+
switch (action) {
|
|
42
|
+
case "close":
|
|
43
|
+
unselectView(viewId);
|
|
44
|
+
break;
|
|
45
|
+
case "open":
|
|
46
|
+
if (!state.active) {
|
|
47
|
+
state.active = true;
|
|
48
|
+
await nextTick();
|
|
49
|
+
}
|
|
50
|
+
selectView(viewId);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function onClick(e) {
|
|
56
|
+
if (trigger.includes("click") && !mappedDisabled.value && e.button === 0 && viewId) {
|
|
57
|
+
switch (action) {
|
|
58
|
+
case "close":
|
|
59
|
+
unselectView(viewId);
|
|
60
|
+
break;
|
|
61
|
+
case "open":
|
|
62
|
+
if (!state.active) {
|
|
63
|
+
state.active = true;
|
|
64
|
+
await nextTick();
|
|
65
|
+
}
|
|
66
|
+
selectView(viewId);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
onMouseenter,
|
|
73
|
+
onClick,
|
|
74
|
+
onEnter
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { CommandView } from '../../types/index.js';
|
|
3
|
+
type InitializeViewArgs = Pick<CommandView, 'id' | 'parent' | 'initial'>;
|
|
4
|
+
export declare function useCommandView(instanceId: MaybeRef<string>): {
|
|
5
|
+
currentView: import("vue").ComputedRef<CommandView | undefined>;
|
|
6
|
+
initializeView: (args: InitializeViewArgs) => CommandView;
|
|
7
|
+
deleteView: (id: string) => void;
|
|
8
|
+
getView: (id: string) => CommandView | undefined;
|
|
9
|
+
getRelativeViewIndex: (id: string) => number;
|
|
10
|
+
getNextView: (id: string) => CommandView | undefined;
|
|
11
|
+
getPreviousView: (id: string) => CommandView | undefined;
|
|
12
|
+
getTopLevelView: () => CommandView | undefined;
|
|
13
|
+
getNestedView: (itemId: string) => CommandView | undefined;
|
|
14
|
+
getParentView: (id: string) => CommandView | undefined;
|
|
15
|
+
selectView: (id: string, delayMs?: number) => Promise<void>;
|
|
16
|
+
selectInitialView: () => void;
|
|
17
|
+
unselectView: (id: string, delayMs?: number) => Promise<void>;
|
|
18
|
+
unselectUnrelatedViews: (id: string) => void;
|
|
19
|
+
unselectAllViews: () => void;
|
|
20
|
+
sortViewItems: (viewId: string) => void;
|
|
6
21
|
};
|
|
22
|
+
export {};
|
|
@@ -1,24 +1,199 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { reactive, computed, toValue } from "vue";
|
|
2
|
+
import { useCommandState } from "./useCommandState.mjs";
|
|
3
|
+
function isAbortError(error) {
|
|
4
|
+
return error instanceof DOMException && error.name === "AbortError";
|
|
5
|
+
}
|
|
6
|
+
export function useCommandView(instanceId) {
|
|
7
|
+
const { initializeState } = useCommandState(instanceId);
|
|
8
|
+
const state = initializeState();
|
|
9
|
+
const currentInstanceId = toValue(instanceId);
|
|
10
|
+
const currentView = computed(() => {
|
|
11
|
+
const activeViews = state.views.filter((view) => view.active);
|
|
12
|
+
if (activeViews.length === 0) return void 0;
|
|
13
|
+
if (activeViews.length === 1) return activeViews[0];
|
|
14
|
+
return activeViews.reduce(
|
|
15
|
+
(a, b) => a.parent.views.length >= b.parent.views.length ? a : b
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
const viewMap = /* @__PURE__ */ new Map();
|
|
19
|
+
function createView(args) {
|
|
20
|
+
const { id, parent, initial } = args;
|
|
21
|
+
if (parent.views.length === 0) {
|
|
22
|
+
parent.views.push(currentInstanceId);
|
|
23
|
+
}
|
|
24
|
+
const view = reactive({
|
|
25
|
+
id,
|
|
26
|
+
parent,
|
|
27
|
+
initial,
|
|
28
|
+
active: false,
|
|
29
|
+
items: [],
|
|
30
|
+
channels: [],
|
|
31
|
+
state: {
|
|
32
|
+
selectAbortController: new AbortController(),
|
|
33
|
+
unselectAbortController: new AbortController()
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
viewMap.set(id, view);
|
|
37
|
+
return view;
|
|
38
|
+
}
|
|
39
|
+
function addView(args) {
|
|
40
|
+
const view = createView(args);
|
|
41
|
+
state.views.push(view);
|
|
42
|
+
return view;
|
|
43
|
+
}
|
|
44
|
+
function delay(ms, signal) {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const timer = setTimeout(resolve, ms);
|
|
47
|
+
const abortHandler = () => {
|
|
48
|
+
clearTimeout(timer);
|
|
49
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
50
|
+
};
|
|
51
|
+
signal.addEventListener("abort", abortHandler, { once: true });
|
|
16
52
|
});
|
|
17
53
|
}
|
|
54
|
+
function activateView() {
|
|
55
|
+
const view = state?.views.findLast((view2) => view2.active)?.id;
|
|
56
|
+
state.input.view = view;
|
|
57
|
+
}
|
|
58
|
+
function getView(id) {
|
|
59
|
+
let view = viewMap.get(id);
|
|
60
|
+
if (!view) {
|
|
61
|
+
view = state.views.find((v) => v.id === id);
|
|
62
|
+
if (view) viewMap.set(id, view);
|
|
63
|
+
}
|
|
64
|
+
return view;
|
|
65
|
+
}
|
|
66
|
+
function deleteView(id) {
|
|
67
|
+
const index = state.views.findIndex((view) => view.id === id);
|
|
68
|
+
if (index !== -1) {
|
|
69
|
+
state.views.splice(index, 1);
|
|
70
|
+
viewMap.delete(id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function getRelativeViewIndex(id) {
|
|
74
|
+
const view = getView(id);
|
|
75
|
+
if (!view) return -1;
|
|
76
|
+
const nestingLevel = view.parent.views.length;
|
|
77
|
+
return state.views.findIndex(
|
|
78
|
+
(v) => v.parent.views.length === nestingLevel && v.id === id
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function getNextView(id) {
|
|
82
|
+
const index = state.views.findIndex((view) => view.id === id);
|
|
83
|
+
return index !== -1 ? state.views[index + 1] : void 0;
|
|
84
|
+
}
|
|
85
|
+
function getPreviousView(id) {
|
|
86
|
+
const index = state.views.findIndex((view) => view.id === id);
|
|
87
|
+
return index > 0 ? state.views[index - 1] : void 0;
|
|
88
|
+
}
|
|
89
|
+
function getTopLevelView() {
|
|
90
|
+
return state.views.find((view) => view.active && !view.parent.item);
|
|
91
|
+
}
|
|
92
|
+
function getNestedView(itemId) {
|
|
93
|
+
return state.views.find((view) => view.parent.item === itemId);
|
|
94
|
+
}
|
|
95
|
+
function getParentView(id) {
|
|
96
|
+
const view = getView(id);
|
|
97
|
+
if (!view) return void 0;
|
|
98
|
+
const parentId = view.parent.views[view.parent.views.length - 1];
|
|
99
|
+
return parentId ? getView(parentId) : void 0;
|
|
100
|
+
}
|
|
101
|
+
function getUnrelatedViews(id) {
|
|
102
|
+
const view = getView(id);
|
|
103
|
+
if (!view) return [];
|
|
104
|
+
const parentViewsSet = new Set(view.parent.views);
|
|
105
|
+
return state.views.filter((v) => v.id !== id && !parentViewsSet.has(v.id));
|
|
106
|
+
}
|
|
107
|
+
async function selectView(id, delayMs = 0) {
|
|
108
|
+
const view = getView(id);
|
|
109
|
+
if (!view) return;
|
|
110
|
+
if (view.state.unselectAbortController) {
|
|
111
|
+
view.state.unselectAbortController.abort();
|
|
112
|
+
}
|
|
113
|
+
const abortController = new AbortController();
|
|
114
|
+
view.state.selectAbortController = abortController;
|
|
115
|
+
try {
|
|
116
|
+
if (delayMs > 0) {
|
|
117
|
+
await delay(delayMs, abortController.signal);
|
|
118
|
+
}
|
|
119
|
+
view.active = true;
|
|
120
|
+
activateView();
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (isAbortError(error) && state.options.debug) {
|
|
123
|
+
console.log("selectView() was interrupted by a call to unselectView()");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function selectInitialView() {
|
|
128
|
+
const initialView = state.views?.find((view) => view.initial);
|
|
129
|
+
if (initialView) {
|
|
130
|
+
initialView.active = true;
|
|
131
|
+
activateView();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function unselectView(id, delayMs = 0) {
|
|
135
|
+
const view = getView(id);
|
|
136
|
+
if (!view) return;
|
|
137
|
+
if (view.state.selectAbortController) {
|
|
138
|
+
view.state.selectAbortController.abort();
|
|
139
|
+
}
|
|
140
|
+
const abortController = new AbortController();
|
|
141
|
+
view.state.unselectAbortController = abortController;
|
|
142
|
+
try {
|
|
143
|
+
if (delayMs > 0) {
|
|
144
|
+
await delay(delayMs, abortController.signal);
|
|
145
|
+
}
|
|
146
|
+
view.active = false;
|
|
147
|
+
activateView();
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (isAbortError(error) && state.options.debug) {
|
|
150
|
+
console.log("unselectView() was interrupted by a call to selectView()");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function unselectUnrelatedViews(id) {
|
|
155
|
+
const views = getUnrelatedViews(id);
|
|
156
|
+
for (const view of views) {
|
|
157
|
+
view.active = false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function unselectAllViews() {
|
|
161
|
+
for (const view of state.views) {
|
|
162
|
+
view.active = false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function initializeView(args) {
|
|
166
|
+
const { id } = args;
|
|
167
|
+
const view = getView(id) ?? addView(args);
|
|
168
|
+
return view;
|
|
169
|
+
}
|
|
170
|
+
function sortViewItems(viewId) {
|
|
171
|
+
const parent = document.querySelector(`[data-id="${viewId}-content"]`);
|
|
172
|
+
const view = getView(viewId);
|
|
173
|
+
const elements = Array.from(
|
|
174
|
+
parent?.querySelectorAll(".magic-command-item") ?? []
|
|
175
|
+
);
|
|
176
|
+
function getIndex(id) {
|
|
177
|
+
return elements.findIndex((el) => el.dataset.id === id);
|
|
178
|
+
}
|
|
179
|
+
view?.items?.sort((a, b) => getIndex(a.id) - getIndex(b.id));
|
|
180
|
+
}
|
|
18
181
|
return {
|
|
182
|
+
currentView,
|
|
183
|
+
initializeView,
|
|
184
|
+
deleteView,
|
|
185
|
+
getView,
|
|
186
|
+
getRelativeViewIndex,
|
|
187
|
+
getNextView,
|
|
188
|
+
getPreviousView,
|
|
189
|
+
getTopLevelView,
|
|
190
|
+
getNestedView,
|
|
191
|
+
getParentView,
|
|
19
192
|
selectView,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
193
|
+
selectInitialView,
|
|
194
|
+
unselectView,
|
|
195
|
+
unselectUnrelatedViews,
|
|
196
|
+
unselectAllViews,
|
|
197
|
+
sortViewItems
|
|
23
198
|
};
|
|
24
199
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
+
interface SelectItemArgs {
|
|
3
|
+
id: string;
|
|
4
|
+
viewId: string;
|
|
5
|
+
}
|
|
6
|
+
interface UnselectItemArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
viewId: string;
|
|
9
|
+
}
|
|
2
10
|
export declare function useMagicCommand(id: MaybeRef<string>): {
|
|
3
11
|
isActive: import("vue").ComputedRef<boolean>;
|
|
4
|
-
open: () => void
|
|
12
|
+
open: () => Promise<void>;
|
|
5
13
|
close: () => void;
|
|
6
|
-
selectItem: (
|
|
7
|
-
|
|
8
|
-
selectView: (id: string) => void
|
|
9
|
-
|
|
14
|
+
selectItem: (args: SelectItemArgs) => void;
|
|
15
|
+
unselectItem: (args: UnselectItemArgs) => void;
|
|
16
|
+
selectView: (id: string, delayMs?: number) => Promise<void>;
|
|
17
|
+
unselectView: (id: string, delayMs?: number) => Promise<void>;
|
|
10
18
|
};
|
|
19
|
+
export {};
|
|
@@ -1,27 +1,57 @@
|
|
|
1
|
-
import { computed,
|
|
2
|
-
import {
|
|
1
|
+
import { computed, nextTick } from "vue";
|
|
2
|
+
import { useCommandState } from "./private/useCommandState.mjs";
|
|
3
3
|
import { useCommandItem } from "./private/useCommandItem.mjs";
|
|
4
4
|
import { useCommandView } from "./private/useCommandView.mjs";
|
|
5
5
|
export function useMagicCommand(id) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
);
|
|
9
|
-
const {
|
|
10
|
-
function open() {
|
|
11
|
-
|
|
6
|
+
const { initializeState } = useCommandState(id);
|
|
7
|
+
const state = initializeState();
|
|
8
|
+
const isActive = computed(() => state.active);
|
|
9
|
+
const { selectView, unselectView, selectInitialView, unselectAllViews } = useCommandView(id);
|
|
10
|
+
async function open() {
|
|
11
|
+
state.active = true;
|
|
12
|
+
await nextTick();
|
|
13
|
+
selectInitialView();
|
|
12
14
|
}
|
|
13
15
|
function close() {
|
|
14
|
-
|
|
16
|
+
state.active = false;
|
|
17
|
+
state.input.view = void 0;
|
|
18
|
+
unselectAllViews();
|
|
19
|
+
}
|
|
20
|
+
function selectItem(args) {
|
|
21
|
+
const { id: id2, viewId } = args;
|
|
22
|
+
if (!viewId) {
|
|
23
|
+
throw new Error("viewId is required to select an item");
|
|
24
|
+
}
|
|
25
|
+
if (!id2) {
|
|
26
|
+
throw new Error("id is required to select an item");
|
|
27
|
+
}
|
|
28
|
+
const { selectItem: selectItem2 } = useCommandItem({
|
|
29
|
+
instanceId: id2,
|
|
30
|
+
viewId
|
|
31
|
+
});
|
|
32
|
+
return selectItem2(id2);
|
|
33
|
+
}
|
|
34
|
+
function unselectItem(args) {
|
|
35
|
+
const { id: id2, viewId } = args;
|
|
36
|
+
if (!viewId) {
|
|
37
|
+
throw new Error("viewId is required to select an item");
|
|
38
|
+
}
|
|
39
|
+
if (!id2) {
|
|
40
|
+
throw new Error("id is required to select an item");
|
|
41
|
+
}
|
|
42
|
+
const { unselectItem: unselectItem2 } = useCommandItem({
|
|
43
|
+
instanceId: id2,
|
|
44
|
+
viewId
|
|
45
|
+
});
|
|
46
|
+
return unselectItem2(id2);
|
|
15
47
|
}
|
|
16
|
-
const { selectItem, selectLastItem } = useCommandItem(toValue(id));
|
|
17
|
-
const { selectView, selectLastView } = useCommandView();
|
|
18
48
|
return {
|
|
19
49
|
isActive,
|
|
20
50
|
open,
|
|
21
51
|
close,
|
|
22
52
|
selectItem,
|
|
23
|
-
|
|
53
|
+
unselectItem,
|
|
24
54
|
selectView,
|
|
25
|
-
|
|
55
|
+
unselectView
|
|
26
56
|
};
|
|
27
57
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import type { InjectionKey, MaybeRef } from 'vue';
|
|
1
|
+
import type { InjectionKey, MaybeRef, Ref } from 'vue';
|
|
2
2
|
import type { MagicCommandOptions } from '../types/index.js';
|
|
3
3
|
declare const MagicCommandInstanceId: InjectionKey<MaybeRef<string>>;
|
|
4
|
+
declare const MagicCommandParentTree: InjectionKey<string[]>;
|
|
5
|
+
declare const MagicCommandViewId: InjectionKey<string>;
|
|
6
|
+
declare const MagicCommandViewActive: InjectionKey<Ref<boolean>>;
|
|
7
|
+
declare const MagicCommandContentId: InjectionKey<string>;
|
|
8
|
+
declare const MagicCommandItemId: InjectionKey<string>;
|
|
9
|
+
declare const MagicCommandItemActive: InjectionKey<Ref<boolean>>;
|
|
10
|
+
declare const MagicCommandItemDisabled: InjectionKey<Ref<boolean>>;
|
|
4
11
|
declare const MagicCommandProviderOptions: InjectionKey<MagicCommandOptions>;
|
|
5
|
-
export { MagicCommandInstanceId, MagicCommandProviderOptions };
|
|
12
|
+
export { MagicCommandInstanceId, MagicCommandParentTree, MagicCommandViewId, MagicCommandViewActive, MagicCommandContentId, MagicCommandItemId, MagicCommandItemActive, MagicCommandItemDisabled, MagicCommandProviderOptions, };
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
const MagicCommandInstanceId = Symbol();
|
|
2
|
+
const MagicCommandParentTree = Symbol();
|
|
3
|
+
const MagicCommandViewId = Symbol();
|
|
4
|
+
const MagicCommandViewActive = Symbol();
|
|
5
|
+
const MagicCommandContentId = Symbol();
|
|
6
|
+
const MagicCommandItemId = Symbol();
|
|
7
|
+
const MagicCommandItemActive = Symbol();
|
|
8
|
+
const MagicCommandItemDisabled = Symbol();
|
|
2
9
|
const MagicCommandProviderOptions = Symbol();
|
|
3
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
MagicCommandInstanceId,
|
|
12
|
+
MagicCommandParentTree,
|
|
13
|
+
MagicCommandViewId,
|
|
14
|
+
MagicCommandViewActive,
|
|
15
|
+
MagicCommandContentId,
|
|
16
|
+
MagicCommandItemId,
|
|
17
|
+
MagicCommandItemActive,
|
|
18
|
+
MagicCommandItemDisabled,
|
|
19
|
+
MagicCommandProviderOptions
|
|
20
|
+
};
|
|
@@ -1,23 +1,83 @@
|
|
|
1
1
|
import type { MagicModalOptions } from '../../../MagicModal/index.js';
|
|
2
2
|
import type { MagicDrawerOptions } from '../../../MagicDrawer/index.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { RequireAllNested } from '@maas/vue-equipment/utils';
|
|
4
|
+
export interface MagicCommandOptions {
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
transition?: {
|
|
7
|
+
content?: string;
|
|
8
|
+
};
|
|
9
|
+
keyListener?: {
|
|
5
10
|
open?: string[] | false;
|
|
6
11
|
close?: string[] | false;
|
|
7
12
|
next?: string[] | false;
|
|
8
13
|
prev?: string[] | false;
|
|
14
|
+
enter?: string[] | false;
|
|
9
15
|
};
|
|
10
16
|
loop?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type CommandEvents = {
|
|
13
|
-
beforeEnter: string;
|
|
14
|
-
enter: string;
|
|
15
|
-
afterEnter: string;
|
|
16
|
-
beforeLeave: string;
|
|
17
|
-
leave: string;
|
|
18
|
-
afterLeave: string;
|
|
19
|
-
};
|
|
20
|
-
export interface MagicCommandModalOptions extends MagicModalOptions {
|
|
21
17
|
}
|
|
22
|
-
export
|
|
18
|
+
export type CommandDefaultOptions = RequireAllNested<MagicCommandOptions>;
|
|
19
|
+
export type Action = 'open' | 'close';
|
|
20
|
+
export type Interaction = 'click' | 'mouseenter';
|
|
21
|
+
export interface CommandItem {
|
|
22
|
+
id: string;
|
|
23
|
+
active: boolean;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CommandChannel {
|
|
27
|
+
id: string;
|
|
28
|
+
active: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface CommandView {
|
|
31
|
+
id: string;
|
|
32
|
+
active: boolean;
|
|
33
|
+
initial: boolean;
|
|
34
|
+
items: CommandItem[];
|
|
35
|
+
channels: CommandChannel[];
|
|
36
|
+
parent: {
|
|
37
|
+
item: string;
|
|
38
|
+
views: string[];
|
|
39
|
+
};
|
|
40
|
+
state: {
|
|
41
|
+
selectAbortController: AbortController;
|
|
42
|
+
unselectAbortController: AbortController;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface CommandState {
|
|
46
|
+
id: string;
|
|
47
|
+
active: boolean;
|
|
48
|
+
views: CommandView[];
|
|
49
|
+
renderer: HTMLElement | null;
|
|
50
|
+
options: MagicCommandOptions;
|
|
51
|
+
input: {
|
|
52
|
+
type: 'keyboard' | 'pointer';
|
|
53
|
+
view: string | undefined;
|
|
54
|
+
};
|
|
23
55
|
}
|
|
56
|
+
export type CommandEvents = {
|
|
57
|
+
beforeEnter: {
|
|
58
|
+
id: string;
|
|
59
|
+
viewId: string;
|
|
60
|
+
};
|
|
61
|
+
enter: {
|
|
62
|
+
id: string;
|
|
63
|
+
viewId: string;
|
|
64
|
+
};
|
|
65
|
+
afterEnter: {
|
|
66
|
+
id: string;
|
|
67
|
+
viewId: string;
|
|
68
|
+
};
|
|
69
|
+
beforeLeave: {
|
|
70
|
+
id: string;
|
|
71
|
+
viewId: string;
|
|
72
|
+
};
|
|
73
|
+
leave: {
|
|
74
|
+
id: string;
|
|
75
|
+
viewId: string;
|
|
76
|
+
};
|
|
77
|
+
afterLeave: {
|
|
78
|
+
id: string;
|
|
79
|
+
viewId: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export type { MagicModalOptions as MagicCommandModalOptions };
|
|
83
|
+
export type { MagicDrawerOptions as MagicCommandDrawerOptions };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type DefaultOptions = typeof defaultOptions;
|
|
5
|
-
export { defaultOptions, type DefaultOptions };
|
|
1
|
+
import type { CommandDefaultOptions } from '../types/index.js';
|
|
2
|
+
declare const defaultOptions: CommandDefaultOptions;
|
|
3
|
+
export { defaultOptions };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
const defaultOptions = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
debug: false,
|
|
3
|
+
transition: {
|
|
4
|
+
content: "magic-command-content"
|
|
5
|
+
},
|
|
6
|
+
keyListener: {
|
|
7
|
+
open: ["Cmd+k", "Ctrl+k"],
|
|
4
8
|
close: ["Escape"],
|
|
5
9
|
next: ["ArrowDown"],
|
|
6
|
-
prev: ["ArrowUp"]
|
|
10
|
+
prev: ["ArrowUp"],
|
|
11
|
+
enter: ["Enter"]
|
|
7
12
|
},
|
|
8
13
|
loop: false
|
|
9
14
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MagicCookie from './src/components/MagicCookie.vue.js';
|
|
1
|
+
import MagicCookieProvider from './src/components/MagicCookieProvider.vue.js';
|
|
3
2
|
import { useMagicCookie } from './src/composables/useMagicCookie.js';
|
|
3
|
+
import type { Plugin } from 'vue';
|
|
4
|
+
import type { MagicCookieCallbackArgs, MagicCookieOptions } from './src/types/index.js';
|
|
4
5
|
declare const MagicCookiePlugin: Plugin;
|
|
5
|
-
export { MagicCookiePlugin,
|
|
6
|
+
export { MagicCookiePlugin, MagicCookieProvider, useMagicCookie };
|
|
7
|
+
export type { MagicCookieCallbackArgs, MagicCookieOptions };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MagicCookieItem from "./src/components/MagicCookieItem.vue";
|
|
2
|
+
import MagicCookieView from "./src/components/MagicCookieView.vue";
|
|
3
|
+
import MagicCookieProvider from "./src/components/MagicCookieProvider.vue";
|
|
2
4
|
import { useMagicCookie } from "./src/composables/useMagicCookie.mjs";
|
|
3
5
|
const MagicCookiePlugin = {
|
|
4
6
|
install: (app) => {
|
|
5
|
-
app.component("
|
|
7
|
+
app.component("MagicCookieView", MagicCookieView);
|
|
8
|
+
app.component("MagicCookieProvider", MagicCookieProvider);
|
|
9
|
+
app.component("MagicCookieItem", MagicCookieItem);
|
|
6
10
|
}
|
|
7
11
|
};
|
|
8
|
-
export { MagicCookiePlugin,
|
|
12
|
+
export { MagicCookiePlugin, MagicCookieProvider, useMagicCookie };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineNuxtModule,
|
|
3
3
|
createResolver,
|
|
4
|
-
|
|
4
|
+
addComponentsDir,
|
|
5
5
|
addImports,
|
|
6
6
|
extendViteConfig
|
|
7
7
|
} from "@nuxt/kit";
|
|
@@ -18,18 +18,14 @@ export default defineNuxtModule({
|
|
|
18
18
|
config.optimizeDeps.include = config.optimizeDeps.include || [];
|
|
19
19
|
config.optimizeDeps.include.push("universal-cookie");
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
addComponentsDir({
|
|
22
|
+
path: resolver.resolve("src/components"),
|
|
23
|
+
global: true,
|
|
24
|
+
pathPrefix: false
|
|
25
25
|
});
|
|
26
26
|
addImports({
|
|
27
27
|
from: "@maas/vue-equipment/plugins/MagicCookie",
|
|
28
28
|
name: "useMagicCookie"
|
|
29
29
|
});
|
|
30
|
-
addImports({
|
|
31
|
-
from: "@maas/vue-equipment/plugins/MagicCookie",
|
|
32
|
-
name: "useCookietEmitter"
|
|
33
|
-
});
|
|
34
30
|
}
|
|
35
31
|
});
|