@maas/vue-equipment 0.40.0 → 1.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -16
- package/dist/composables/index.d.ts +7 -18
- package/dist/composables/index.js +79 -132
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +35 -42
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +5 -0
- package/dist/plugins/.turbo/turbo-release.log +7 -0
- package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
- package/dist/plugins/MagicAccordion/index.d.ts +2 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
- package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
- package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
- package/dist/plugins/MagicCommand/index.d.ts +2 -0
- package/dist/plugins/MagicCommand/index.mjs +9 -11
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
- package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
- package/dist/plugins/MagicCookie/index.d.ts +5 -3
- package/dist/plugins/MagicCookie/index.mjs +7 -3
- package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
- package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
- package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
- package/dist/plugins/MagicMenu/index.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +266 -166
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/index.d.ts +4 -9
- package/dist/plugins/MagicPlayer/index.mjs +11 -17
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
- package/dist/plugins/MagicScroll/index.d.ts +4 -10
- package/dist/plugins/MagicScroll/index.mjs +2 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
- package/dist/plugins/MagicToast/index.d.ts +3 -2
- package/dist/plugins/MagicToast/index.mjs +3 -3
- package/dist/plugins/MagicToast/nuxt.mjs +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
- package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
- package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
- package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
- package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/utils/css/animations/auto-size-out.css +12 -0
- package/dist/utils/css/animations/squash-y.css +5 -0
- package/dist/utils/css/animations.css +2 -1
- package/dist/utils/index.d.ts +10 -6
- package/dist/utils/index.js +41 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +62 -58
- package/dist/composables/index.d.mts +0 -108
- package/dist/composables/index.mjs +0 -383
- package/dist/composables/index.mjs.map +0 -1
- package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
- package/dist/plugins/MagicAutoSize/index.mjs +0 -7
- package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
- package/dist/utils/index.d.mts +0 -80
- package/dist/utils/index.mjs +0 -200
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
interface MagicCommandItemProps {
|
|
2
2
|
id?: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
listener?: ('click' | 'mouseenter' | 'touchstart')[];
|
|
6
|
-
keys?: string[];
|
|
3
|
+
initial?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
7
5
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
rootEl: HTMLDivElement;
|
|
6
|
+
declare const mappedId: import("vue").ComputedRef<string>;
|
|
7
|
+
declare const item: import("../types").CommandItem;
|
|
8
|
+
declare const pointerDisabled: import("vue").ComputedRef<boolean>;
|
|
9
|
+
declare function guardedSelect(): void;
|
|
10
|
+
declare function onClick(event: MouseEvent): void;
|
|
11
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
itemActive: boolean;
|
|
14
|
+
itemDisabled: boolean;
|
|
19
15
|
};
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
17
|
+
default?: (props: typeof __VLS_1) => any;
|
|
18
|
+
}>;
|
|
19
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCommandItemProps, {
|
|
20
|
+
mappedId: typeof mappedId;
|
|
21
|
+
item: typeof item;
|
|
22
|
+
pointerDisabled: typeof pointerDisabled;
|
|
23
|
+
guardedSelect: typeof guardedSelect;
|
|
24
|
+
onClick: typeof onClick;
|
|
25
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
|
+
click: (event: MouseEvent) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<MagicCommandItemProps> & Readonly<{
|
|
28
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCommandItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
|
+
click: (event: MouseEvent) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<MagicCommandItemProps> & Readonly<{
|
|
33
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
26
36
|
export default _default;
|
|
27
|
-
type
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
38
|
new (): {
|
|
29
39
|
$slots: S;
|
|
30
40
|
};
|
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { inject, watch, onBeforeUnmount } from "vue";
|
|
5
|
+
import {
|
|
6
|
+
useMagicModal,
|
|
7
|
+
useMagicEmitter
|
|
8
|
+
} from "@maas/vue-equipment/plugins";
|
|
9
|
+
import { useMagicCommand } from "../composables/useMagicCommand";
|
|
10
|
+
import { MagicCommandInstanceId } from "../symbols";
|
|
11
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
inheritAttrs: false
|
|
14
|
+
},
|
|
15
|
+
__name: "MagicCommandModal",
|
|
16
|
+
props: {
|
|
17
|
+
options: { type: null, required: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const instanceId = inject(MagicCommandInstanceId, "");
|
|
21
|
+
const emitter = useMagicEmitter();
|
|
22
|
+
function afterLeaveCallback(payload) {
|
|
23
|
+
if (typeof payload === "string" && payload === instanceId) {
|
|
24
|
+
close();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const { close, isActive } = useMagicCommand(instanceId);
|
|
28
|
+
const modalApi = useMagicModal(instanceId);
|
|
29
|
+
watch(isActive, (value) => {
|
|
30
|
+
if (value) {
|
|
31
|
+
modalApi.open();
|
|
32
|
+
} else {
|
|
33
|
+
modalApi.close();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
emitter.on("afterLeave", afterLeaveCallback);
|
|
37
|
+
onBeforeUnmount(() => {
|
|
38
|
+
emitter.off("afterLeave", afterLeaveCallback);
|
|
39
|
+
close();
|
|
40
|
+
});
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
const _component_magic_modal = _resolveComponent("magic-modal");
|
|
43
|
+
return _openBlock(), _createBlock(_component_magic_modal, _mergeProps({
|
|
44
|
+
id: _unref(instanceId),
|
|
45
|
+
class: "magic-command-modal",
|
|
46
|
+
options: _ctx.options
|
|
47
|
+
}, _ctx.$attrs), {
|
|
48
|
+
default: _withCtx(() => [
|
|
49
|
+
_renderSlot(_ctx.$slots, "default")
|
|
50
|
+
]),
|
|
51
|
+
_: 3
|
|
52
|
+
/* FORWARDED */
|
|
53
|
+
}, 16, ["id", "options"]);
|
|
54
|
+
};
|
|
46
55
|
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
emitter.on('afterLeave', afterLeaveCallback)
|
|
50
|
-
|
|
51
|
-
onBeforeUnmount(() => {
|
|
52
|
-
emitter.off('afterLeave', afterLeaveCallback)
|
|
53
|
-
close()
|
|
54
|
-
})
|
|
56
|
+
});
|
|
55
57
|
</script>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { MagicCommandModalOptions } from '../types';
|
|
1
|
+
import type { MagicCommandModalOptions } from '../types/index.js';
|
|
2
2
|
interface MagicCommandProps {
|
|
3
3
|
options?: MagicCommandModalOptions;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
declare const instanceId: import("vue").MaybeRef<string>;
|
|
6
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
7
|
+
declare var __VLS_6: {};
|
|
8
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
9
|
+
default?: (props: typeof __VLS_6) => any;
|
|
10
|
+
}>;
|
|
11
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCommandProps, {
|
|
12
|
+
instanceId: typeof instanceId;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_component: import("vue").DefineComponent<MagicCommandProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
declare const _default:
|
|
15
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
16
|
export default _default;
|
|
17
|
-
type
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
18
|
new (): {
|
|
19
19
|
$slots: S;
|
|
20
20
|
};
|
|
@@ -1,66 +1,96 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
obj
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
interface MagicCommandProps {
|
|
26
|
-
id: MaybeRef<string>
|
|
27
|
-
options?: MagicCommandOptions
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const props = withDefaults(defineProps<MagicCommandProps>(), {
|
|
31
|
-
options: () => defaultOptions,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const keys = useMagicKeys()
|
|
35
|
-
const commandApi = useMagicCommand(props.id)
|
|
36
|
-
const mappedOptions = customDefu(props.options, defaultOptions)
|
|
37
|
-
|
|
38
|
-
const { open, close } = commandApi
|
|
39
|
-
|
|
40
|
-
if (mappedOptions.keys?.open) {
|
|
41
|
-
for (const key of mappedOptions.keys.open) {
|
|
42
|
-
watch(keys[key], (value) => {
|
|
43
|
-
if (value) {
|
|
44
|
-
open()
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { shallowRef, provide, watch, onBeforeUnmount } from "vue";
|
|
5
|
+
import { useMagicKeys, usePointer } from "@vueuse/core";
|
|
6
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
7
|
+
import { createDefu } from "defu";
|
|
8
|
+
import { useCommandState } from "../composables/private/useCommandState";
|
|
9
|
+
import { useMagicCommand } from "../composables/useMagicCommand";
|
|
10
|
+
import { defaultOptions } from "../utils/defaultOptions";
|
|
11
|
+
import { MagicCommandInstanceId, MagicCommandProviderOptions } from "../symbols";
|
|
12
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
13
|
+
__name: "MagicCommandProvider",
|
|
14
|
+
props: {
|
|
15
|
+
id: { type: null, required: true },
|
|
16
|
+
asChild: { type: Boolean, required: false },
|
|
17
|
+
options: { type: Object, required: false, default: () => ({}) }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const customDefu = createDefu((obj, key, value) => {
|
|
21
|
+
if (key === "open" || key === "close" || key === "next" || key === "prev") {
|
|
22
|
+
obj[key] = value;
|
|
23
|
+
return true;
|
|
45
24
|
}
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
});
|
|
26
|
+
const mappedOptions = customDefu(__props.options, defaultOptions);
|
|
27
|
+
const { initializeState, deleteState } = useCommandState(__props.id);
|
|
28
|
+
const state = initializeState(mappedOptions);
|
|
29
|
+
const lastX = shallowRef(0);
|
|
30
|
+
const lastY = shallowRef(0);
|
|
31
|
+
const { x, y } = usePointer();
|
|
32
|
+
watch(
|
|
33
|
+
() => state?.input.type,
|
|
34
|
+
(value) => {
|
|
35
|
+
if (value === "keyboard") {
|
|
36
|
+
lastX.value = x.value;
|
|
37
|
+
lastY.value = y.value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
watch([x, y], ([x2, y2]) => {
|
|
42
|
+
if (x2 !== lastX.value || y2 !== lastY.value) {
|
|
43
|
+
if (state) {
|
|
44
|
+
state.input.type = "pointer";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const keys = useMagicKeys();
|
|
49
|
+
const commandApi = useMagicCommand(__props.id);
|
|
50
|
+
const { open, close } = commandApi;
|
|
51
|
+
if (mappedOptions.keyListener?.open) {
|
|
52
|
+
for (const key of mappedOptions.keyListener.open) {
|
|
53
|
+
watch(keys[key], (value) => {
|
|
54
|
+
if (value) {
|
|
55
|
+
open();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (mappedOptions.keyListener?.close) {
|
|
61
|
+
for (const key of mappedOptions.keyListener.close) {
|
|
62
|
+
watch(keys[key], (value) => {
|
|
63
|
+
if (value) {
|
|
64
|
+
close();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
55
67
|
}
|
|
56
|
-
}
|
|
68
|
+
}
|
|
69
|
+
onBeforeUnmount(() => {
|
|
70
|
+
deleteState();
|
|
71
|
+
});
|
|
72
|
+
provide(MagicCommandInstanceId, __props.id);
|
|
73
|
+
provide(MagicCommandProviderOptions, mappedOptions);
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
76
|
+
"data-id": _ctx.id,
|
|
77
|
+
"as-child": _ctx.asChild,
|
|
78
|
+
class: "magic-command-provider"
|
|
79
|
+
}, {
|
|
80
|
+
default: _withCtx(() => [
|
|
81
|
+
_renderSlot(_ctx.$slots, "default")
|
|
82
|
+
]),
|
|
83
|
+
_: 3
|
|
84
|
+
/* FORWARDED */
|
|
85
|
+
}, 8, ["data-id", "as-child"]);
|
|
86
|
+
};
|
|
57
87
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
onBeforeUnmount(() => {
|
|
61
|
-
close()
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
provide(MagicCommandInstanceId, props.id)
|
|
65
|
-
provide(MagicCommandProviderOptions, mappedOptions)
|
|
88
|
+
});
|
|
66
89
|
</script>
|
|
90
|
+
|
|
91
|
+
<style>
|
|
92
|
+
.magic-command-provider {
|
|
93
|
+
outline: none;
|
|
94
|
+
user-select: none;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
3
|
+
import type { MagicCommandOptions } from '../types/index.js';
|
|
4
|
+
interface MagicCommandProviderProps {
|
|
4
5
|
id: MaybeRef<string>;
|
|
6
|
+
asChild?: boolean;
|
|
5
7
|
options?: MagicCommandOptions;
|
|
6
8
|
}
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const
|
|
17
|
-
options: MagicCommandOptions;
|
|
18
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
19
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
9
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
|
+
declare var __VLS_6: {};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_6) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCommandProviderProps, {
|
|
15
|
+
Primitive: typeof Primitive;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCommandProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
19
|
export default _default;
|
|
21
|
-
type
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
21
|
new (): {
|
|
23
22
|
$slots: S;
|
|
24
23
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
ref: "el",
|
|
6
|
+
class: "magic-command-renderer"
|
|
7
|
+
};
|
|
8
|
+
import { inject, onBeforeUnmount, useTemplateRef } from "vue";
|
|
9
|
+
import {
|
|
10
|
+
useMagicEmitter
|
|
11
|
+
} from "@maas/vue-equipment/plugins";
|
|
12
|
+
import { MagicCommandInstanceId } from "./../symbols";
|
|
13
|
+
import { useCommandState } from "../composables/private/useCommandState";
|
|
14
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
15
|
+
__name: "MagicCommandRenderer",
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const instanceId = inject(MagicCommandInstanceId, "");
|
|
18
|
+
const emitter = useMagicEmitter();
|
|
19
|
+
if (!instanceId) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
"MagicCommandRenderer must be nested inside MagicCommandProvider"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const elRef = useTemplateRef("el");
|
|
25
|
+
const { initializeState } = useCommandState(instanceId);
|
|
26
|
+
const state = initializeState();
|
|
27
|
+
function enterCallback(payload) {
|
|
28
|
+
if (typeof payload === "string" && payload === instanceId) {
|
|
29
|
+
state.renderer = elRef.value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
emitter.on("enter", enterCallback);
|
|
33
|
+
onBeforeUnmount(() => {
|
|
34
|
+
emitter.off("enter", enterCallback);
|
|
35
|
+
});
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
return _openBlock(), _createElementBlock(
|
|
38
|
+
"div",
|
|
39
|
+
_hoisted_1,
|
|
40
|
+
null,
|
|
41
|
+
512
|
|
42
|
+
/* NEED_PATCH */
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.magic-command-renderer {
|
|
51
|
+
position: relative;
|
|
52
|
+
width: var(--magic-command-renderer-width, 100%);
|
|
53
|
+
height: var(--magic-command-renderer-height, 100%);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.magic-command-content--fade-enter-active {
|
|
57
|
+
animation: fade-in 2000ms ease;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.magic-command-content--fade-leave-active {
|
|
61
|
+
animation: fade-out 2000ms ease;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { computed, inject, useTemplateRef, toValue, watch } from "vue";
|
|
5
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
6
|
+
import { useCommandView } from "../composables/private/useCommandView";
|
|
7
|
+
import { useCommandTrigger } from "../composables/private/useCommandTrigger";
|
|
8
|
+
import {
|
|
9
|
+
MagicCommandInstanceId,
|
|
10
|
+
MagicCommandViewId,
|
|
11
|
+
MagicCommandItemActive,
|
|
12
|
+
MagicCommandItemDisabled,
|
|
13
|
+
MagicCommandProviderOptions
|
|
14
|
+
} from "../symbols";
|
|
15
|
+
import { useMagicKeys } from "@vueuse/core";
|
|
16
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
17
|
+
__name: "MagicCommandTrigger",
|
|
18
|
+
props: {
|
|
19
|
+
viewId: { type: String, required: false },
|
|
20
|
+
active: { type: Boolean, required: false, default: () => void 0 },
|
|
21
|
+
disabled: { type: Boolean, required: false, default: () => void 0 },
|
|
22
|
+
action: { type: String, required: false, default: "open" },
|
|
23
|
+
trigger: { type: Array, required: false, default: () => ["click"] },
|
|
24
|
+
asChild: { type: Boolean, required: false }
|
|
25
|
+
},
|
|
26
|
+
setup(__props) {
|
|
27
|
+
const elRef = useTemplateRef("el");
|
|
28
|
+
const instanceId = inject(MagicCommandInstanceId, void 0);
|
|
29
|
+
const itemActive = inject(MagicCommandItemActive, void 0);
|
|
30
|
+
const itemDisabled = inject(MagicCommandItemDisabled, void 0);
|
|
31
|
+
const injectedViewId = inject(MagicCommandViewId, void 0);
|
|
32
|
+
const mappedViewId = computed(() => __props.viewId ?? injectedViewId);
|
|
33
|
+
if (!instanceId) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
"MagicCommandTrigger must be nested inside MagicCommandProvider"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (!mappedViewId.value) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
"MagicCommandTrigger must be nested inside MagicCommandView or a viewId must be provided"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const { getView } = useCommandView(instanceId);
|
|
44
|
+
const view = getView(mappedViewId.value);
|
|
45
|
+
const mappedActive = computed(() => __props.active ?? toValue(itemActive) ?? false);
|
|
46
|
+
const mappedDisabled = computed(
|
|
47
|
+
() => __props.disabled ?? toValue(itemDisabled) ?? false
|
|
48
|
+
);
|
|
49
|
+
const options = inject(MagicCommandProviderOptions, void 0);
|
|
50
|
+
const { onMouseenter, onClick, onEnter } = useCommandTrigger({
|
|
51
|
+
instanceId,
|
|
52
|
+
viewId: mappedViewId.value,
|
|
53
|
+
mappedActive,
|
|
54
|
+
mappedDisabled,
|
|
55
|
+
trigger: __props.trigger,
|
|
56
|
+
action: __props.action,
|
|
57
|
+
elRef
|
|
58
|
+
});
|
|
59
|
+
watch(
|
|
60
|
+
() => view?.active,
|
|
61
|
+
async (value) => {
|
|
62
|
+
if (value) {
|
|
63
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
64
|
+
toValue(elRef)?.$el?.blur();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
const keys = useMagicKeys();
|
|
69
|
+
if (options?.keyListener?.enter) {
|
|
70
|
+
for (const key of options.keyListener.enter) {
|
|
71
|
+
watch(keys[key], (value) => {
|
|
72
|
+
if (value) {
|
|
73
|
+
onEnter();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return (_ctx, _cache) => {
|
|
79
|
+
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
80
|
+
ref: "el",
|
|
81
|
+
"data-id": `${mappedViewId.value}-trigger`,
|
|
82
|
+
"data-active": mappedActive.value,
|
|
83
|
+
"data-disabled": mappedDisabled.value,
|
|
84
|
+
"as-child": _ctx.asChild,
|
|
85
|
+
class: "magic-command-trigger",
|
|
86
|
+
onClick: _unref(onClick),
|
|
87
|
+
onMouseenter: _unref(onMouseenter)
|
|
88
|
+
}, {
|
|
89
|
+
default: _withCtx(() => [
|
|
90
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
91
|
+
viewActive: _unref(view)?.active,
|
|
92
|
+
triggerDisabled: mappedDisabled.value
|
|
93
|
+
})
|
|
94
|
+
]),
|
|
95
|
+
_: 3
|
|
96
|
+
/* FORWARDED */
|
|
97
|
+
}, 8, ["data-id", "data-active", "data-disabled", "as-child", "onClick", "onMouseenter"]);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<style>
|
|
104
|
+
.magic-menu-trigger {
|
|
105
|
+
cursor: var(--magic-command-trigger-cursor, pointer);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.magic-menu-trigger[data-disabled='true'] {
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
2
|
+
import type { Interaction, Action } from '../types/index.js';
|
|
3
|
+
interface MagicCommandTriggerProps {
|
|
4
|
+
viewId?: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
action?: Action;
|
|
8
|
+
trigger?: Interaction[];
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const mappedViewId: import("vue").ComputedRef<string | undefined>;
|
|
12
|
+
declare const view: import("../types").CommandView | undefined;
|
|
13
|
+
declare const mappedActive: import("vue").ComputedRef<boolean>;
|
|
14
|
+
declare const mappedDisabled: import("vue").ComputedRef<boolean>;
|
|
15
|
+
declare const onMouseenter: () => Promise<void>, onClick: (e: MouseEvent) => Promise<void>;
|
|
16
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
17
|
+
declare var __VLS_12: {
|
|
18
|
+
viewActive: boolean | undefined;
|
|
19
|
+
triggerDisabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
22
|
+
default?: (props: typeof __VLS_12) => any;
|
|
23
|
+
}>;
|
|
24
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCommandTriggerProps, {
|
|
25
|
+
Primitive: typeof Primitive;
|
|
26
|
+
mappedViewId: typeof mappedViewId;
|
|
27
|
+
view: typeof view;
|
|
28
|
+
mappedActive: typeof mappedActive;
|
|
29
|
+
mappedDisabled: typeof mappedDisabled;
|
|
30
|
+
onMouseenter: typeof onMouseenter;
|
|
31
|
+
onClick: typeof onClick;
|
|
32
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCommandTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|