@maas/vue-equipment 1.0.0-beta.4 → 1.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/useCountdown/index.d.ts +23 -0
- package/dist/composables/useCountdown/index.js +133 -0
- package/dist/composables/useCountdown/index.js.map +1 -0
- package/dist/composables/useEasings/index.d.ts +21 -0
- package/dist/composables/useEasings/index.js +40 -0
- package/dist/composables/useEasings/index.js.map +1 -0
- package/dist/composables/useMetaViewport/index.d.ts +9 -0
- package/dist/composables/useMetaViewport/index.js +29 -0
- package/dist/composables/useMetaViewport/index.js.map +1 -0
- package/dist/composables/useScrollTo/index.d.ts +49 -0
- package/dist/composables/useScrollTo/index.js +152 -0
- package/dist/composables/useScrollTo/index.js.map +1 -0
- package/dist/nuxt/module.d.mts +4 -3
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +55 -35
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.d.vue.ts +26 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +70 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +11 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +18 -32
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.d.vue.ts +23 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +62 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +10 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +40 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +9 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +4 -4
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +9 -8
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.d.ts +1 -5
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +3 -3
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.d.vue.ts +15 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +164 -152
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +9 -15
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +50 -54
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.d.vue.ts +27 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +89 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +15 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +39 -49
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +75 -76
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.d.vue.ts +3 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +30 -40
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +88 -85
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +10 -61
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.d.vue.ts +19 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +44 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +9 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +11 -13
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +63 -44
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +21 -4
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.d.vue.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +43 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +9 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.d.vue.ts +17 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +47 -73
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +11 -15
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +1 -1
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +12 -4
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +10 -6
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.d.vue.ts +19 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +92 -101
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +7 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +63 -66
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +37 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +114 -56
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/composables/useMagicDraggable.mjs +1 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.d.vue.ts +31 -0
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +290 -324
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +19 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +37 -15
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +16 -5
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +55 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerUtils.mjs +21 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +7 -2
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicError/index.d.ts +5 -0
- package/dist/plugins/MagicError/index.mjs +3 -0
- package/dist/plugins/MagicError/nuxt.d.ts +2 -0
- package/dist/plugins/MagicError/nuxt.mjs +12 -0
- package/dist/plugins/MagicError/package.json +40 -0
- package/dist/plugins/MagicError/src/MagicError.mjs +0 -0
- package/dist/plugins/MagicError/src/class/MagicError.d.ts +6 -0
- package/dist/plugins/MagicError/src/class/MagicError.mjs +15 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.d.ts +18 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.mjs +31 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.d.vue.ts +21 -0
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +9 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.d.vue.ts +17 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +60 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +7 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +189 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -26
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.d.vue.ts +26 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +103 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +69 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +10 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +99 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +12 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +57 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +11 -24
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +38 -16
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +12 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +45 -18
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +31 -10
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +4 -4
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.d.vue.ts +24 -0
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +11 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +1 -1
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +37 -15
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.d.vue.ts +8 -0
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +17 -9
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.d.vue.ts +8 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +181 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +8 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +35 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +103 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.d.vue.ts +18 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +129 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +10 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +38 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +131 -102
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.d.vue.ts +25 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +140 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +18 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.d.vue.ts +13 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +26 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +7 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +7 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +66 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +128 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.d.vue.ts +36 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +185 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +25 -34
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +113 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +113 -49
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +62 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +50 -93
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-overlay.css +0 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +77 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +7 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.d.vue.ts +18 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +60 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.d.vue.ts +36 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +25 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +71 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +9 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +17 -7
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.d.vue.ts +15 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +91 -110
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +8 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.d.vue.ts +17 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +66 -82
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +7 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +9 -7
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +36 -16
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/types/index.d.ts +11 -11
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +42 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +25 -21
- package/dist/composables/index.d.ts +0 -97
- package/dist/composables/index.js +0 -338
- package/dist/composables/index.js.map +0 -1
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/.turbo/turbo-lint.log +0 -13
- package/dist/plugins/.turbo/turbo-release.log +0 -7
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/plugins/index.d.ts +0 -13
- package/dist/plugins/index.mjs +0 -13
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/plugins/{.turbo/turbo-build.log → MagicError/src/MagicError.d.ts} +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.d.ts +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.mjs +0 -0
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -30,7 +30,9 @@ export function useCommandItem(args) {
|
|
|
30
30
|
return item;
|
|
31
31
|
}
|
|
32
32
|
function deleteItem(id) {
|
|
33
|
-
if (!view?.items)
|
|
33
|
+
if (!view?.items) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
34
36
|
view.items = view.items.filter((x) => x.id !== id);
|
|
35
37
|
}
|
|
36
38
|
function getItem(id) {
|
|
@@ -49,12 +51,10 @@ export function useCommandItem(args) {
|
|
|
49
51
|
const index = view?.items.findIndex(
|
|
50
52
|
(item) => item.id === activeItem.value?.id
|
|
51
53
|
);
|
|
52
|
-
if (index !== void 0) {
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
selectItem(
|
|
56
|
-
} else if (view && loop) {
|
|
57
|
-
selectItem(view.items[0].id);
|
|
54
|
+
if (index !== void 0 && view) {
|
|
55
|
+
const nextItem = view.items[index + 1] ?? (loop ? view.items[0] : void 0);
|
|
56
|
+
if (nextItem) {
|
|
57
|
+
selectItem(nextItem.id);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -62,12 +62,10 @@ export function useCommandItem(args) {
|
|
|
62
62
|
const index = view?.items.findIndex(
|
|
63
63
|
(item) => item.id === activeItem.value?.id
|
|
64
64
|
);
|
|
65
|
-
if (index !== void 0) {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
selectItem(
|
|
69
|
-
} else if (view && loop) {
|
|
70
|
-
selectItem(view.items[view.items.length - 1].id);
|
|
65
|
+
if (index !== void 0 && view) {
|
|
66
|
+
const prevItem = view.items[index - 1] ?? (loop ? view.items[view.items.length - 1] : void 0);
|
|
67
|
+
if (prevItem) {
|
|
68
|
+
selectItem(prevItem.id);
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { type MaybeRef, type Ref } from 'vue';
|
|
2
2
|
interface IsElementAboveArgs {
|
|
3
3
|
element: MaybeRef<HTMLElement>;
|
|
4
4
|
ancestor?: HTMLElement;
|
|
@@ -15,7 +15,7 @@ interface ScrollInFromBottomArgs {
|
|
|
15
15
|
element: MaybeRef<HTMLElement>;
|
|
16
16
|
ancestor?: HTMLElement;
|
|
17
17
|
}
|
|
18
|
-
export declare function useCommandScroll(parent:
|
|
18
|
+
export declare function useCommandScroll(parent: Ref<HTMLElement | null>): {
|
|
19
19
|
findElement: (id: string) => HTMLElement | null;
|
|
20
20
|
findScrollableAncestor: (element: HTMLElement | null) => HTMLElement | undefined;
|
|
21
21
|
isElementAbove: (args: IsElementAboveArgs) => boolean;
|
|
@@ -8,11 +8,11 @@ type UseCommandTriggerArgs = {
|
|
|
8
8
|
mappedActive?: ComputedRef<boolean>;
|
|
9
9
|
trigger: Interaction[];
|
|
10
10
|
action: Action;
|
|
11
|
-
elRef: Ref<InstanceType<typeof Primitive> |
|
|
11
|
+
elRef: Ref<InstanceType<typeof Primitive> | null>;
|
|
12
12
|
};
|
|
13
13
|
export declare function useCommandTrigger(args: UseCommandTriggerArgs): {
|
|
14
14
|
onMouseenter: () => Promise<void>;
|
|
15
15
|
onClick: (e: MouseEvent) => Promise<void>;
|
|
16
|
-
|
|
16
|
+
onKeypress: (e?: KeyboardEvent) => Promise<void>;
|
|
17
17
|
};
|
|
18
18
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nextTick } from "vue";
|
|
2
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
2
3
|
import { useFocus } from "@vueuse/core";
|
|
3
4
|
import { useCommandView } from "./useCommandView.mjs";
|
|
4
5
|
import { useCommandState } from "./useCommandState.mjs";
|
|
@@ -17,7 +18,7 @@ export function useCommandTrigger(args) {
|
|
|
17
18
|
const { initializeState } = useCommandState(instanceId);
|
|
18
19
|
const state = initializeState();
|
|
19
20
|
const { focused } = useFocus(elRef);
|
|
20
|
-
async function
|
|
21
|
+
async function onKeypress(e) {
|
|
21
22
|
if ((focused.value || mappedActive?.value) && !mappedDisabled.value && !view?.active) {
|
|
22
23
|
e?.preventDefault();
|
|
23
24
|
e?.stopPropagation();
|
|
@@ -71,6 +72,6 @@ export function useCommandTrigger(args) {
|
|
|
71
72
|
return {
|
|
72
73
|
onMouseenter,
|
|
73
74
|
onClick,
|
|
74
|
-
|
|
75
|
+
onKeypress
|
|
75
76
|
};
|
|
76
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
2
|
import type { CommandView } from '../../types/index.js';
|
|
3
3
|
type InitializeViewArgs = Pick<CommandView, 'id' | 'parent' | 'initial'>;
|
|
4
|
-
export declare function useCommandView(
|
|
4
|
+
export declare function useCommandView(id: MaybeRef<string>): {
|
|
5
5
|
currentView: import("vue").ComputedRef<CommandView | undefined>;
|
|
6
6
|
initializeView: (args: InitializeViewArgs) => CommandView;
|
|
7
7
|
deleteView: (id: string) => void;
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import { reactive, computed, toValue } from "vue";
|
|
2
|
+
import { useMagicError } from "@maas/vue-equipment/plugins/MagicError";
|
|
2
3
|
import { useCommandState } from "./useCommandState.mjs";
|
|
3
4
|
function isAbortError(error) {
|
|
4
5
|
return error instanceof DOMException && error.name === "AbortError";
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const { logWarning } = useMagicError({
|
|
8
|
+
prefix: "MagicCommand",
|
|
9
|
+
source: "useCommandView"
|
|
10
|
+
});
|
|
11
|
+
export function useCommandView(id) {
|
|
12
|
+
const { initializeState } = useCommandState(id);
|
|
8
13
|
const state = initializeState();
|
|
9
|
-
const currentInstanceId = toValue(
|
|
14
|
+
const currentInstanceId = toValue(id);
|
|
10
15
|
const currentView = computed(() => {
|
|
11
16
|
const activeViews = state.views.filter((view) => view.active);
|
|
12
|
-
if (activeViews.length === 0)
|
|
13
|
-
|
|
17
|
+
if (activeViews.length === 0) {
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
if (activeViews.length === 1) {
|
|
21
|
+
return activeViews[0];
|
|
22
|
+
}
|
|
14
23
|
return activeViews.reduce(
|
|
15
24
|
(a, b) => a.parent.views.length >= b.parent.views.length ? a : b
|
|
16
25
|
);
|
|
17
26
|
});
|
|
18
27
|
const viewMap = /* @__PURE__ */ new Map();
|
|
19
28
|
function createView(args) {
|
|
20
|
-
const { id, parent, initial } = args;
|
|
29
|
+
const { id: id2, parent, initial } = args;
|
|
21
30
|
if (parent.views.length === 0) {
|
|
22
31
|
parent.views.push(currentInstanceId);
|
|
23
32
|
}
|
|
24
33
|
const view = reactive({
|
|
25
|
-
id,
|
|
34
|
+
id: id2,
|
|
26
35
|
parent,
|
|
27
36
|
initial,
|
|
28
37
|
active: false,
|
|
@@ -33,7 +42,7 @@ export function useCommandView(instanceId) {
|
|
|
33
42
|
unselectAbortController: new AbortController()
|
|
34
43
|
}
|
|
35
44
|
});
|
|
36
|
-
viewMap.set(
|
|
45
|
+
viewMap.set(id2, view);
|
|
37
46
|
return view;
|
|
38
47
|
}
|
|
39
48
|
function addView(args) {
|
|
@@ -55,35 +64,37 @@ export function useCommandView(instanceId) {
|
|
|
55
64
|
const view = state?.views.findLast((view2) => view2.active)?.id;
|
|
56
65
|
state.input.view = view;
|
|
57
66
|
}
|
|
58
|
-
function getView(
|
|
59
|
-
let view = viewMap.get(
|
|
67
|
+
function getView(id2) {
|
|
68
|
+
let view = viewMap.get(id2);
|
|
60
69
|
if (!view) {
|
|
61
|
-
view = state.views.find((v) => v.id ===
|
|
62
|
-
if (view) viewMap.set(
|
|
70
|
+
view = state.views.find((v) => v.id === id2);
|
|
71
|
+
if (view) viewMap.set(id2, view);
|
|
63
72
|
}
|
|
64
73
|
return view;
|
|
65
74
|
}
|
|
66
|
-
function deleteView(
|
|
67
|
-
const index = state.views.findIndex((view) => view.id ===
|
|
75
|
+
function deleteView(id2) {
|
|
76
|
+
const index = state.views.findIndex((view) => view.id === id2);
|
|
68
77
|
if (index !== -1) {
|
|
69
78
|
state.views.splice(index, 1);
|
|
70
|
-
viewMap.delete(
|
|
79
|
+
viewMap.delete(id2);
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
|
-
function getRelativeViewIndex(
|
|
74
|
-
const view = getView(
|
|
75
|
-
if (!view)
|
|
82
|
+
function getRelativeViewIndex(id2) {
|
|
83
|
+
const view = getView(id2);
|
|
84
|
+
if (!view) {
|
|
85
|
+
return -1;
|
|
86
|
+
}
|
|
76
87
|
const nestingLevel = view.parent.views.length;
|
|
77
88
|
return state.views.findIndex(
|
|
78
|
-
(v) => v.parent.views.length === nestingLevel && v.id ===
|
|
89
|
+
(v) => v.parent.views.length === nestingLevel && v.id === id2
|
|
79
90
|
);
|
|
80
91
|
}
|
|
81
|
-
function getNextView(
|
|
82
|
-
const index = state.views.findIndex((view) => view.id ===
|
|
92
|
+
function getNextView(id2) {
|
|
93
|
+
const index = state.views.findIndex((view) => view.id === id2);
|
|
83
94
|
return index !== -1 ? state.views[index + 1] : void 0;
|
|
84
95
|
}
|
|
85
|
-
function getPreviousView(
|
|
86
|
-
const index = state.views.findIndex((view) => view.id ===
|
|
96
|
+
function getPreviousView(id2) {
|
|
97
|
+
const index = state.views.findIndex((view) => view.id === id2);
|
|
87
98
|
return index > 0 ? state.views[index - 1] : void 0;
|
|
88
99
|
}
|
|
89
100
|
function getTopLevelView() {
|
|
@@ -92,21 +103,27 @@ export function useCommandView(instanceId) {
|
|
|
92
103
|
function getNestedView(itemId) {
|
|
93
104
|
return state.views.find((view) => view.parent.item === itemId);
|
|
94
105
|
}
|
|
95
|
-
function getParentView(
|
|
96
|
-
const view = getView(
|
|
97
|
-
if (!view)
|
|
106
|
+
function getParentView(id2) {
|
|
107
|
+
const view = getView(id2);
|
|
108
|
+
if (!view) {
|
|
109
|
+
return void 0;
|
|
110
|
+
}
|
|
98
111
|
const parentId = view.parent.views[view.parent.views.length - 1];
|
|
99
112
|
return parentId ? getView(parentId) : void 0;
|
|
100
113
|
}
|
|
101
|
-
function getUnrelatedViews(
|
|
102
|
-
const view = getView(
|
|
103
|
-
if (!view)
|
|
114
|
+
function getUnrelatedViews(id2) {
|
|
115
|
+
const view = getView(id2);
|
|
116
|
+
if (!view) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
104
119
|
const parentViewsSet = new Set(view.parent.views);
|
|
105
|
-
return state.views.filter((v) => v.id !==
|
|
120
|
+
return state.views.filter((v) => v.id !== id2 && !parentViewsSet.has(v.id));
|
|
106
121
|
}
|
|
107
|
-
async function selectView(
|
|
108
|
-
const view = getView(
|
|
109
|
-
if (!view)
|
|
122
|
+
async function selectView(id2, delayMs = 0) {
|
|
123
|
+
const view = getView(id2);
|
|
124
|
+
if (!view) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
110
127
|
if (view.state.unselectAbortController) {
|
|
111
128
|
view.state.unselectAbortController.abort();
|
|
112
129
|
}
|
|
@@ -120,7 +137,7 @@ export function useCommandView(instanceId) {
|
|
|
120
137
|
activateView();
|
|
121
138
|
} catch (error) {
|
|
122
139
|
if (isAbortError(error) && state.options.debug) {
|
|
123
|
-
|
|
140
|
+
logWarning("selectView() was interrupted by a call to unselectView()");
|
|
124
141
|
}
|
|
125
142
|
}
|
|
126
143
|
}
|
|
@@ -131,9 +148,11 @@ export function useCommandView(instanceId) {
|
|
|
131
148
|
activateView();
|
|
132
149
|
}
|
|
133
150
|
}
|
|
134
|
-
async function unselectView(
|
|
135
|
-
const view = getView(
|
|
136
|
-
if (!view)
|
|
151
|
+
async function unselectView(id2, delayMs = 0) {
|
|
152
|
+
const view = getView(id2);
|
|
153
|
+
if (!view) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
137
156
|
if (view.state.selectAbortController) {
|
|
138
157
|
view.state.selectAbortController.abort();
|
|
139
158
|
}
|
|
@@ -147,12 +166,12 @@ export function useCommandView(instanceId) {
|
|
|
147
166
|
activateView();
|
|
148
167
|
} catch (error) {
|
|
149
168
|
if (isAbortError(error) && state.options.debug) {
|
|
150
|
-
|
|
169
|
+
logWarning("unselectView() was interrupted by a call to selectView()");
|
|
151
170
|
}
|
|
152
171
|
}
|
|
153
172
|
}
|
|
154
|
-
function unselectUnrelatedViews(
|
|
155
|
-
const views = getUnrelatedViews(
|
|
173
|
+
function unselectUnrelatedViews(id2) {
|
|
174
|
+
const views = getUnrelatedViews(id2);
|
|
156
175
|
for (const view of views) {
|
|
157
176
|
view.active = false;
|
|
158
177
|
}
|
|
@@ -163,8 +182,8 @@ export function useCommandView(instanceId) {
|
|
|
163
182
|
}
|
|
164
183
|
}
|
|
165
184
|
function initializeView(args) {
|
|
166
|
-
const { id } = args;
|
|
167
|
-
const view = getView(
|
|
185
|
+
const { id: id2 } = args;
|
|
186
|
+
const view = getView(id2) ?? addView(args);
|
|
168
187
|
return view;
|
|
169
188
|
}
|
|
170
189
|
function sortViewItems(viewId) {
|
|
@@ -173,8 +192,8 @@ export function useCommandView(instanceId) {
|
|
|
173
192
|
const elements = Array.from(
|
|
174
193
|
parent?.querySelectorAll(".magic-command-item") ?? []
|
|
175
194
|
);
|
|
176
|
-
function getIndex(
|
|
177
|
-
return elements.findIndex((el) => el.dataset.id ===
|
|
195
|
+
function getIndex(id2) {
|
|
196
|
+
return elements.findIndex((el) => el.dataset.id === id2);
|
|
178
197
|
}
|
|
179
198
|
view?.items?.sort((a, b) => getIndex(a.id) - getIndex(b.id));
|
|
180
199
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { computed, nextTick } from "vue";
|
|
2
|
+
import { useMagicError } from "@maas/vue-equipment/plugins/MagicError";
|
|
2
3
|
import { useCommandState } from "./private/useCommandState.mjs";
|
|
3
4
|
import { useCommandItem } from "./private/useCommandItem.mjs";
|
|
4
5
|
import { useCommandView } from "./private/useCommandView.mjs";
|
|
6
|
+
const { throwError } = useMagicError({
|
|
7
|
+
prefix: "MagicCommand",
|
|
8
|
+
source: "useMagicCommand"
|
|
9
|
+
});
|
|
5
10
|
export function useMagicCommand(id) {
|
|
6
11
|
const { initializeState } = useCommandState(id);
|
|
7
12
|
const state = initializeState();
|
|
@@ -20,10 +25,16 @@ export function useMagicCommand(id) {
|
|
|
20
25
|
function selectItem(args) {
|
|
21
26
|
const { id: id2, viewId } = args;
|
|
22
27
|
if (!viewId) {
|
|
23
|
-
|
|
28
|
+
throwError({
|
|
29
|
+
message: "viewId is required to select an item",
|
|
30
|
+
errorCode: "view_id_required"
|
|
31
|
+
});
|
|
24
32
|
}
|
|
25
33
|
if (!id2) {
|
|
26
|
-
|
|
34
|
+
throwError({
|
|
35
|
+
message: "id is required to select an item",
|
|
36
|
+
errorCode: "id_required"
|
|
37
|
+
});
|
|
27
38
|
}
|
|
28
39
|
const { selectItem: selectItem2 } = useCommandItem({
|
|
29
40
|
instanceId: id2,
|
|
@@ -34,10 +45,16 @@ export function useMagicCommand(id) {
|
|
|
34
45
|
function unselectItem(args) {
|
|
35
46
|
const { id: id2, viewId } = args;
|
|
36
47
|
if (!viewId) {
|
|
37
|
-
|
|
48
|
+
throwError({
|
|
49
|
+
message: "viewId is required to select an item",
|
|
50
|
+
errorCode: "view_id_required"
|
|
51
|
+
});
|
|
38
52
|
}
|
|
39
53
|
if (!id2) {
|
|
40
|
-
|
|
54
|
+
throwError({
|
|
55
|
+
message: "id is required to select an item",
|
|
56
|
+
errorCode: "id_required"
|
|
57
|
+
});
|
|
41
58
|
}
|
|
42
59
|
const { unselectItem: unselectItem2 } = useCommandItem({
|
|
43
60
|
instanceId: id2,
|
|
@@ -1,12 +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
4
|
declare const MagicCommandParentTree: InjectionKey<string[]>;
|
|
5
5
|
declare const MagicCommandViewId: InjectionKey<string>;
|
|
6
|
-
declare const MagicCommandViewActive: InjectionKey<
|
|
6
|
+
declare const MagicCommandViewActive: InjectionKey<Ref<boolean>>;
|
|
7
7
|
declare const MagicCommandContentId: InjectionKey<string>;
|
|
8
8
|
declare const MagicCommandItemId: InjectionKey<string>;
|
|
9
|
-
declare const MagicCommandItemActive: InjectionKey<
|
|
10
|
-
declare const MagicCommandItemDisabled: InjectionKey<
|
|
9
|
+
declare const MagicCommandItemActive: InjectionKey<Ref<boolean>>;
|
|
10
|
+
declare const MagicCommandItemDisabled: InjectionKey<Ref<boolean>>;
|
|
11
11
|
declare const MagicCommandProviderOptions: InjectionKey<MagicCommandOptions>;
|
|
12
12
|
export { MagicCommandInstanceId, MagicCommandParentTree, MagicCommandViewId, MagicCommandViewActive, MagicCommandContentId, MagicCommandItemId, MagicCommandItemActive, MagicCommandItemDisabled, MagicCommandProviderOptions, };
|
|
@@ -46,14 +46,14 @@ export interface CommandState {
|
|
|
46
46
|
id: string;
|
|
47
47
|
active: boolean;
|
|
48
48
|
views: CommandView[];
|
|
49
|
-
renderer: HTMLElement |
|
|
49
|
+
renderer: HTMLElement | null;
|
|
50
50
|
options: MagicCommandOptions;
|
|
51
51
|
input: {
|
|
52
52
|
type: 'keyboard' | 'pointer';
|
|
53
53
|
view: string | undefined;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
export
|
|
56
|
+
export interface CommandEvents {
|
|
57
57
|
beforeEnter: {
|
|
58
58
|
id: string;
|
|
59
59
|
viewId: string;
|
|
@@ -78,6 +78,6 @@ export type CommandEvents = {
|
|
|
78
78
|
id: string;
|
|
79
79
|
viewId: string;
|
|
80
80
|
};
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
82
|
export type { MagicModalOptions as MagicCommandModalOptions };
|
|
83
83
|
export type { MagicDrawerOptions as MagicCommandDrawerOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface MagicCookieItemProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
optional?: boolean;
|
|
4
|
+
maxAge?: number;
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
item: import("../types/index.js").CookieItem;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<MagicCookieItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="magic-cookie-item"
|
|
4
|
+
:data-id="mappedId"
|
|
5
|
+
:data-optional="item.optional"
|
|
6
|
+
:data-active="item.active"
|
|
7
|
+
>
|
|
8
|
+
<slot :item="item" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
5
13
|
import { computed, inject, provide, onBeforeUnmount, useId } from "vue";
|
|
14
|
+
import {
|
|
15
|
+
useMagicError
|
|
16
|
+
} from "@maas/vue-equipment/plugins/MagicError";
|
|
6
17
|
import { useCookieItem } from "../composables/private/useCookieItem";
|
|
7
18
|
import {
|
|
8
19
|
MagicCookieInstanceId,
|
|
9
20
|
MagicCookieItemId,
|
|
10
21
|
MagicCookieItemActive
|
|
11
22
|
} from "../symbols";
|
|
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
|
-
return _openBlock(), _createElementBlock("div", {
|
|
41
|
-
class: "magic-cookie-item",
|
|
42
|
-
"data-optional": _unref(item).optional,
|
|
43
|
-
"data-active": _unref(item).active
|
|
44
|
-
}, [
|
|
45
|
-
_renderSlot(_ctx.$slots, "default", { item: _unref(item) })
|
|
46
|
-
], 8, _hoisted_1);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
23
|
+
const { id, optional, maxAge } = defineProps({
|
|
24
|
+
id: { type: String, required: false },
|
|
25
|
+
optional: { type: Boolean, required: false },
|
|
26
|
+
maxAge: { type: Number, required: false }
|
|
27
|
+
});
|
|
28
|
+
const magicError = useMagicError({
|
|
29
|
+
prefix: "MagicCookie",
|
|
30
|
+
source: "MagicCookieItem"
|
|
31
|
+
});
|
|
32
|
+
const instanceId = inject(MagicCookieInstanceId, void 0);
|
|
33
|
+
magicError.assert(instanceId, {
|
|
34
|
+
message: "MagicCookieItem must be nested inside MagicCookieProvider",
|
|
35
|
+
errorCode: "missing_instance_id"
|
|
36
|
+
});
|
|
37
|
+
const mappedId = computed(() => id ?? `magic-cookie-item-${useId()}`);
|
|
38
|
+
const mappedActive = computed(() => item.active);
|
|
39
|
+
const { initializeItem, deleteItem } = useCookieItem({
|
|
40
|
+
instanceId
|
|
41
|
+
});
|
|
42
|
+
const item = initializeItem({
|
|
43
|
+
id: mappedId.value,
|
|
44
|
+
optional,
|
|
45
|
+
maxAge
|
|
46
|
+
});
|
|
47
|
+
provide(MagicCookieItemId, mappedId.value);
|
|
48
|
+
provide(MagicCookieItemActive, mappedActive);
|
|
49
|
+
onBeforeUnmount(() => {
|
|
50
|
+
deleteItem(mappedId.value);
|
|
49
51
|
});
|
|
50
52
|
</script>
|
|
51
53
|
|
|
@@ -3,30 +3,17 @@ interface MagicCookieItemProps {
|
|
|
3
3
|
optional?: boolean;
|
|
4
4
|
maxAge?: number;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
slots: {
|
|
9
|
-
default?(_: {
|
|
10
|
-
item: import("../types").CookieItem;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {};
|
|
14
|
-
rootEl: HTMLDivElement;
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
item: import("../types/index.js").CookieItem;
|
|
15
8
|
};
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
-
export default _default;
|
|
20
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
28
11
|
};
|
|
29
|
-
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<MagicCookieItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
17
|
new (): {
|
|
31
18
|
$slots: S;
|
|
32
19
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { MagicCookieOptions } from '../types/index.js';
|
|
3
|
+
type MagicCookieProviderProps = {
|
|
4
|
+
id: MaybeRef<string>;
|
|
5
|
+
options?: MagicCookieOptions;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_7: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_7) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<MagicCookieProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|