@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,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MagicToastProvider from "./src/components/MagicToastProvider.vue";
|
|
2
2
|
import { useMagicToast } from "./src/composables/useMagicToast.mjs";
|
|
3
3
|
const MagicToastPlugin = {
|
|
4
4
|
install: (app) => {
|
|
5
|
-
app.component("
|
|
5
|
+
app.component("MagicToastProvider", MagicToastProvider);
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
|
-
export { MagicToastPlugin,
|
|
8
|
+
export { MagicToastPlugin, useMagicToast };
|
|
@@ -11,8 +11,8 @@ export default defineNuxtModule({
|
|
|
11
11
|
setup() {
|
|
12
12
|
const resolver = createResolver(import.meta.url);
|
|
13
13
|
addComponent({
|
|
14
|
-
filePath: resolver.resolve("src/components/
|
|
15
|
-
name: "
|
|
14
|
+
filePath: resolver.resolve("src/components/MagicToastProvider.vue"),
|
|
15
|
+
name: "MagicToastProvider",
|
|
16
16
|
global: true
|
|
17
17
|
});
|
|
18
18
|
addImports({
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, createBlock as _createBlock, withCtx as _withCtx, TransitionGroup as _TransitionGroup, createVNode as _createVNode, createElementVNode as _createElementVNode, Teleport as _Teleport } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id", "data-position", "data-expanded"];
|
|
5
|
+
import {
|
|
6
|
+
toValue,
|
|
7
|
+
useTemplateRef,
|
|
8
|
+
provide,
|
|
9
|
+
watch,
|
|
10
|
+
onBeforeUnmount
|
|
11
|
+
} from "vue";
|
|
12
|
+
import { onClickOutside } from "@vueuse/core";
|
|
13
|
+
import { useToastState } from "../composables/private/useToastState";
|
|
14
|
+
import { useToastView } from "../composables/private/useToastView";
|
|
15
|
+
import { useToastCallback } from "../composables/private/useToastCallback";
|
|
16
|
+
import MagicToastView from "./MagicToastView.vue";
|
|
17
|
+
import { MagicToastInstanceId } from "../../symbols";
|
|
18
|
+
import "@maas/vue-equipment/utils/css/animations/fade-out.css";
|
|
19
|
+
import "@maas/vue-equipment/utils/css/animations/squash-y.css";
|
|
20
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ltr-in.css";
|
|
21
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ltr-out.css";
|
|
22
|
+
import "@maas/vue-equipment/utils/css/animations/slide-rtl-in.css";
|
|
23
|
+
import "@maas/vue-equipment/utils/css/animations/slide-rtl-out.css";
|
|
24
|
+
import { useToastListener } from "../composables/private/useToastListener";
|
|
25
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
26
|
+
...{
|
|
27
|
+
inheritAttrs: false
|
|
28
|
+
},
|
|
29
|
+
__name: "MagicToastProvider",
|
|
30
|
+
props: {
|
|
31
|
+
id: { type: null, required: true },
|
|
32
|
+
options: { type: Object, required: false }
|
|
33
|
+
},
|
|
34
|
+
setup(__props) {
|
|
35
|
+
const { deleteView } = useToastView(__props.id);
|
|
36
|
+
const { deleteState, initializeState } = useToastState(__props.id);
|
|
37
|
+
const state = initializeState(__props.options);
|
|
38
|
+
const listRef = useTemplateRef("list");
|
|
39
|
+
const {
|
|
40
|
+
onBeforeEnter,
|
|
41
|
+
onEnter,
|
|
42
|
+
onAfterEnter,
|
|
43
|
+
onBeforeLeave,
|
|
44
|
+
onLeave,
|
|
45
|
+
onAfterLeave
|
|
46
|
+
} = useToastCallback(__props.id);
|
|
47
|
+
const { onMouseenter, onMouseleave, outsideClickCallback } = useToastListener(__props.id);
|
|
48
|
+
onClickOutside(listRef, outsideClickCallback);
|
|
49
|
+
watch(
|
|
50
|
+
() => __props.options,
|
|
51
|
+
(value) => {
|
|
52
|
+
initializeState(value);
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
deep: true
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
onBeforeUnmount(() => {
|
|
59
|
+
deleteState();
|
|
60
|
+
});
|
|
61
|
+
provide(MagicToastInstanceId, __props.id);
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return _openBlock(), _createBlock(_Teleport, {
|
|
64
|
+
to: _unref(state).options.teleport?.target,
|
|
65
|
+
disabled: _unref(state).options.teleport?.disabled
|
|
66
|
+
}, [
|
|
67
|
+
_createElementVNode("div", _mergeProps({
|
|
68
|
+
"data-id": toValue(_ctx.id),
|
|
69
|
+
"data-position": _unref(state).options.position,
|
|
70
|
+
"data-expanded": _unref(state).expanded,
|
|
71
|
+
class: "magic-toast-provider"
|
|
72
|
+
}, _ctx.$attrs), [
|
|
73
|
+
_createVNode(_TransitionGroup, {
|
|
74
|
+
ref: "list",
|
|
75
|
+
tag: "ol",
|
|
76
|
+
class: "magic-toast-provider__list",
|
|
77
|
+
name: _unref(state).options.transition,
|
|
78
|
+
"on-before-enter": _unref(onBeforeEnter),
|
|
79
|
+
"on-enter": _unref(onEnter),
|
|
80
|
+
"on-after-enter": _unref(onAfterEnter),
|
|
81
|
+
"on-before-leave": _unref(onBeforeLeave),
|
|
82
|
+
"on-leave": _unref(onLeave),
|
|
83
|
+
"on-after-leave": _unref(onAfterLeave),
|
|
84
|
+
onMouseenter: _unref(onMouseenter),
|
|
85
|
+
onMouseleave: _unref(onMouseleave)
|
|
86
|
+
}, {
|
|
87
|
+
default: _withCtx(() => [
|
|
88
|
+
(_openBlock(true), _createElementBlock(
|
|
89
|
+
_Fragment,
|
|
90
|
+
null,
|
|
91
|
+
_renderList(_unref(state).views, (view, index) => {
|
|
92
|
+
return _openBlock(), _createBlock(MagicToastView, {
|
|
93
|
+
id: view.id,
|
|
94
|
+
key: view.id,
|
|
95
|
+
index
|
|
96
|
+
}, {
|
|
97
|
+
default: _withCtx(() => [
|
|
98
|
+
(_openBlock(), _createBlock(_resolveDynamicComponent(view.component), _mergeProps({ ref_for: true }, view.props, {
|
|
99
|
+
onRemove: ($event) => _unref(deleteView)(view.id)
|
|
100
|
+
}), null, 16, ["onRemove"]))
|
|
101
|
+
]),
|
|
102
|
+
_: 2
|
|
103
|
+
/* DYNAMIC */
|
|
104
|
+
}, 1032, ["id", "index"]);
|
|
105
|
+
}),
|
|
106
|
+
128
|
|
107
|
+
/* KEYED_FRAGMENT */
|
|
108
|
+
))
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
/* STABLE */
|
|
112
|
+
}, 8, ["name", "on-before-enter", "on-enter", "on-after-enter", "on-before-leave", "on-leave", "on-after-leave", "onMouseenter", "onMouseleave"])
|
|
113
|
+
], 16, _hoisted_1)
|
|
114
|
+
], 8, ["to", "disabled"]);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style>
|
|
121
|
+
@keyframes mt-slide-ttb-out {
|
|
122
|
+
0% {
|
|
123
|
+
transform: translate3d(0, 0, 0);
|
|
124
|
+
}
|
|
125
|
+
100% {
|
|
126
|
+
transform: translate3d(0, calc(-100% - var(--magic-toast-padding-y)), 0);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@keyframes mt-slide-ttb-in {
|
|
131
|
+
0% {
|
|
132
|
+
transform: translate3d(0, calc(-100% - var(--magic-toast-padding-y)), 0);
|
|
133
|
+
}
|
|
134
|
+
100% {
|
|
135
|
+
transform: translate3d(0, 0, 0);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@keyframes mt-slide-btt-out {
|
|
140
|
+
0% {
|
|
141
|
+
transform: translate3d(0, 0, 0);
|
|
142
|
+
}
|
|
143
|
+
100% {
|
|
144
|
+
transform: translate3d(0, calc(100% + var(--magic-toast-padding-y)), 0);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@keyframes mt-slide-btt-in {
|
|
149
|
+
0% {
|
|
150
|
+
transform: translate3d(0, calc(100% + var(--magic-toast-padding-y)), 0);
|
|
151
|
+
}
|
|
152
|
+
100% {
|
|
153
|
+
transform: translate3d(0, 0, 0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:root {
|
|
158
|
+
--magic-toast-padding-y: 1rem;
|
|
159
|
+
--magic-toast-padding-x: 1rem;
|
|
160
|
+
--magic-toast-gap: 0.75rem;
|
|
161
|
+
--magic-toast-animation-duration: 175ms;
|
|
162
|
+
--magic-toast-scale-factor: 0.05;
|
|
163
|
+
--magic-toast-overlap-y: 1rem;
|
|
164
|
+
|
|
165
|
+
--mt-multiplier-y: 0px;
|
|
166
|
+
--mt-align-items: center;
|
|
167
|
+
--mt-justify-content: flex-end;
|
|
168
|
+
--mt-flex-direction: column;
|
|
169
|
+
--mt-enter-animation: unset;
|
|
170
|
+
--mt-leave-animation: unset;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.magic-toast-provider {
|
|
174
|
+
position: var(--magic-toast-position, fixed);
|
|
175
|
+
inset: var(--magic-toast-inset, 0);
|
|
176
|
+
width: var(--magic-toast-width, 100%);
|
|
177
|
+
height: var(--magic-toast-height, 100%);
|
|
178
|
+
z-index: var(--magic-toast-z-index, 999);
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
align-items: center;
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.magic-toast-provider__list {
|
|
187
|
+
position: relative;
|
|
188
|
+
overflow-y: auto;
|
|
189
|
+
overflow-x: hidden;
|
|
190
|
+
max-height: 100%;
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 100%;
|
|
193
|
+
display: flex;
|
|
194
|
+
padding: var(--magic-toast-padding-y) var(--magic-toast-padding-x);
|
|
195
|
+
flex-direction: var(--mt-flex-direction);
|
|
196
|
+
align-items: var(--mt-align-items);
|
|
197
|
+
justify-content: var(--mt-justify-content);
|
|
198
|
+
scrollbar-width: none;
|
|
199
|
+
-ms-overflow-style: none;
|
|
200
|
+
&::-webkit-scrollbar {
|
|
201
|
+
display: none;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.magic-toast-provider__list * {
|
|
206
|
+
pointer-events: all;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.magic-toast-provider[data-position='top-left'],
|
|
210
|
+
.magic-toast-provider[data-position='top'],
|
|
211
|
+
.magic-toast-provider[data-position='top-right'] {
|
|
212
|
+
--mt-enter-animation: mt-slide-ttb-in var(--magic-toast-animation-duration)
|
|
213
|
+
var(--ease-in-out);
|
|
214
|
+
--mt-leave-animation: mt-slide-ttb-out var(--magic-toast-animation-duration)
|
|
215
|
+
var(--ease-in-out);
|
|
216
|
+
--mt-multiplier-y: 1;
|
|
217
|
+
--mt-justify-content: flex-end;
|
|
218
|
+
--mt-flex-direction: column-reverse;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.magic-toast-provider[data-position='bottom-left'],
|
|
222
|
+
.magic-toast-provider[data-position='bottom'],
|
|
223
|
+
.magic-toast-provider[data-position='bottom-right'] {
|
|
224
|
+
--mt-enter-animation: mt-slide-btt-in var(--magic-toast-animation-duration)
|
|
225
|
+
var(--ease-in-out);
|
|
226
|
+
--mt-leave-animation: mt-slide-btt-out var(--magic-toast-animation-duration)
|
|
227
|
+
var(--ease-in-out);
|
|
228
|
+
--mt-multiplier-y: -1;
|
|
229
|
+
--mt-justify-content: flex-end;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.magic-toast-provider[data-position='top-left'],
|
|
233
|
+
.magic-toast-provider[data-position='bottom-left'] {
|
|
234
|
+
--mt-align-items: flex-start;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.magic-toast-provider[data-position='top-right'],
|
|
238
|
+
.magic-toast-provider[data-position='bottom-right'] {
|
|
239
|
+
--mt-align-items: flex-end;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.magic-toast-provider[data-position='left'] {
|
|
243
|
+
--mt-justify-content: center;
|
|
244
|
+
--mt-align-items: flex-start;
|
|
245
|
+
--mt-enter-animation: slide-ltr-in var(--magic-toast-animation-duration)
|
|
246
|
+
var(--ease-in-out);
|
|
247
|
+
--mt-leave-animation: slide-ltr-out var(--magic-toast-animation-duration)
|
|
248
|
+
var(--ease-in-out);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.magic-toast-provider[data-position='right'] {
|
|
252
|
+
--mt-justify-content: center;
|
|
253
|
+
--mt-align-items: flex-end;
|
|
254
|
+
--mt-enter-animation: slide-rtl-in var(--magic-toast-animation-duration)
|
|
255
|
+
var(--ease-in-out);
|
|
256
|
+
--mt-leave-animation: slide-rtl-out var(--magic-toast-animation-duration)
|
|
257
|
+
var(--ease-in-out);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.magic-toast-enter-active {
|
|
261
|
+
animation: var(--mt-enter-animation, unset);
|
|
262
|
+
position: absolute;
|
|
263
|
+
|
|
264
|
+
&[data-position='bottom-left'],
|
|
265
|
+
&[data-position='bottom'],
|
|
266
|
+
&[data-position='bottom-right'] {
|
|
267
|
+
bottom: calc(var(--mt-height) * var(--mt-index) * 1px);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&[data-position='top-left'],
|
|
271
|
+
&[data-position='top'],
|
|
272
|
+
&[data-position='top-right'] {
|
|
273
|
+
top: calc(var(--mt-height) * var(--mt-index) * 1px);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.magic-toast-leave-active {
|
|
278
|
+
animation: fade-out var(--magic-toast-animation-duration) var(--ease-in-out);
|
|
279
|
+
position: absolute;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.magic-toast-leave-active:last-child {
|
|
283
|
+
animation: var(--mt-leave-animation, unset);
|
|
284
|
+
position: absolute;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.magic-toast-move {
|
|
288
|
+
transition: all var(--magic-toast-animation-duration) var(--ease-in-out);
|
|
289
|
+
}
|
|
290
|
+
</style>
|
package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { MagicToastOptions } from '
|
|
2
|
+
import type { MagicToastOptions } from '../types/index.js';
|
|
3
3
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
4
|
+
import '@maas/vue-equipment/utils/css/animations/squash-y.css';
|
|
4
5
|
import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
|
|
6
|
+
import '@maas/vue-equipment/utils/css/animations/slide-ltr-out.css';
|
|
5
7
|
import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css';
|
|
6
|
-
import '@maas/vue-equipment/utils/css/animations/slide-
|
|
7
|
-
import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css';
|
|
8
|
+
import '@maas/vue-equipment/utils/css/animations/slide-rtl-out.css';
|
|
8
9
|
interface MagicToastProps {
|
|
9
10
|
id: MaybeRef<string>;
|
|
10
|
-
class: MaybeRef<string>;
|
|
11
11
|
options?: MagicToastOptions;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: import("vue").DefineComponent<MagicToastProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id", "data-expanded", "data-dragging", "data-position", "data-debug"];
|
|
5
|
+
import { computed, inject } from "vue";
|
|
6
|
+
import { MagicToastInstanceId } from "../../symbols";
|
|
7
|
+
import { useToastState } from "../composables/private/useToastState";
|
|
8
|
+
import { useToastDrag } from "../composables/private/useToastDrag";
|
|
9
|
+
import "@maas/vue-equipment/utils/css/transitions/fade.css";
|
|
10
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
11
|
+
__name: "MagicToastView",
|
|
12
|
+
props: {
|
|
13
|
+
id: { type: String, required: true },
|
|
14
|
+
index: { type: Number, required: true }
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const instanceId = inject(MagicToastInstanceId, void 0);
|
|
18
|
+
if (!instanceId) {
|
|
19
|
+
throw new Error("MagicToastView must be used within a MagicToastProvider");
|
|
20
|
+
}
|
|
21
|
+
const { initializeState } = useToastState(instanceId);
|
|
22
|
+
const state = initializeState();
|
|
23
|
+
const count = computed(() => state.views.length);
|
|
24
|
+
const view = computed(() => state.views[__props.index]);
|
|
25
|
+
const reversedIndex = computed(() => count.value - __props.index - 1);
|
|
26
|
+
const height = computed(() => `${view.value.dimensions?.height}px`);
|
|
27
|
+
const offset = computed(() => {
|
|
28
|
+
const mapped = state.views.slice(0, reversedIndex.value).reduce((acc, view2) => acc + (view2.dimensions?.height ?? 0), 0);
|
|
29
|
+
return `${mapped}px`;
|
|
30
|
+
});
|
|
31
|
+
const { style, onPointerdown, onClick } = useToastDrag({
|
|
32
|
+
view: view.value,
|
|
33
|
+
instanceId
|
|
34
|
+
});
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return _openBlock(), _createElementBlock("li", {
|
|
37
|
+
class: "magic-toast-view",
|
|
38
|
+
"data-id": _ctx.id,
|
|
39
|
+
"data-expanded": _unref(state).expanded,
|
|
40
|
+
"data-dragging": view.value.dragging,
|
|
41
|
+
"data-position": _unref(state).options.position,
|
|
42
|
+
"data-debug": _unref(state).options.debug,
|
|
43
|
+
style: _normalizeStyle({
|
|
44
|
+
"--mt-index": reversedIndex.value,
|
|
45
|
+
"--mt-offset": offset.value,
|
|
46
|
+
"--mt-height": height.value
|
|
47
|
+
})
|
|
48
|
+
}, [
|
|
49
|
+
_createElementVNode(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
class: "magic-toast-view__inner",
|
|
53
|
+
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
54
|
+
(...args) => _unref(onPointerdown) && _unref(onPointerdown)(...args)),
|
|
55
|
+
onClick: _cache[1] || (_cache[1] = //@ts-ignore
|
|
56
|
+
(...args) => _unref(onClick) && _unref(onClick)(...args))
|
|
57
|
+
},
|
|
58
|
+
[
|
|
59
|
+
_createElementVNode(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
style: _normalizeStyle(_unref(style)),
|
|
63
|
+
class: "magic-toast-view__drag"
|
|
64
|
+
},
|
|
65
|
+
[
|
|
66
|
+
_renderSlot(_ctx.$slots, "default")
|
|
67
|
+
],
|
|
68
|
+
4
|
|
69
|
+
/* STYLE */
|
|
70
|
+
)
|
|
71
|
+
],
|
|
72
|
+
32
|
|
73
|
+
/* NEED_HYDRATION */
|
|
74
|
+
)
|
|
75
|
+
], 12, _hoisted_1);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
:root {
|
|
83
|
+
--magic-toast-view-transition: all var(--magic-toast-animation-duration)
|
|
84
|
+
var(--ease-in-out);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.magic-toast-view {
|
|
88
|
+
cursor: var(--magic-toast-view-cursor, grab);
|
|
89
|
+
position: absolute;
|
|
90
|
+
list-style: none;
|
|
91
|
+
user-select: none;
|
|
92
|
+
|
|
93
|
+
&[data-position='bottom-left'],
|
|
94
|
+
&[data-position='bottom'],
|
|
95
|
+
&[data-position='bottom-right'] {
|
|
96
|
+
padding-top: var(--magic-toast-gap);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&[data-position='top-left'],
|
|
100
|
+
&[data-position='top'],
|
|
101
|
+
&[data-position='top-right'] {
|
|
102
|
+
padding-bottom: var(--magic-toast-gap);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.magic-toast-view[data-expanded='false'] {
|
|
107
|
+
--mt-scale: max(
|
|
108
|
+
calc(1 - (var(--magic-toast-scale-factor) * var(--mt-index))),
|
|
109
|
+
0
|
|
110
|
+
);
|
|
111
|
+
--mt-translate-y: calc(
|
|
112
|
+
((var(--magic-toast-overlap-y) * var(--mt-index) * var(--mt-scale))) *
|
|
113
|
+
var(--mt-multiplier-y)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.magic-toast-view[data-expanded='true'] {
|
|
118
|
+
--mt-scale: 1;
|
|
119
|
+
--mt-translate-y: calc(var(--mt-offset) * var(--mt-multiplier-y));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.magic-toast-view__inner {
|
|
123
|
+
position: relative;
|
|
124
|
+
width: 100%;
|
|
125
|
+
height: 100%;
|
|
126
|
+
transition: var(--magic-toast-view-transition);
|
|
127
|
+
transform: translateY(var(--mt-translate-y)) scale(var(--mt-scale));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.magic-toast-view__drag {
|
|
131
|
+
display: block;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.magic-toast-view[data-dragging='true'] {
|
|
135
|
+
cursor: var(--magic-toast-view-cursor-dragging, grabbing);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.magic-toast-view[data-position='left'] {
|
|
139
|
+
position: absolute;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.magic-toast-view[data-position='right'] {
|
|
143
|
+
position: absolute;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.magic-toast-view[data-debug='true'] {
|
|
147
|
+
outline: solid 1px green;
|
|
148
|
+
& > * {
|
|
149
|
+
outline: solid 1px red;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '@maas/vue-equipment/utils/css/transitions/fade.css';
|
|
2
|
+
interface MagicToastViewProps {
|
|
3
|
+
id: string;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
6
|
+
declare const state: import("../types").ToastState;
|
|
7
|
+
declare const view: import("vue").ComputedRef<import("../types").ToastView>;
|
|
8
|
+
declare const reversedIndex: import("vue").ComputedRef<number>;
|
|
9
|
+
declare const height: import("vue").ComputedRef<string>;
|
|
10
|
+
declare const offset: import("vue").ComputedRef<string>;
|
|
11
|
+
declare const style: import("vue").ComputedRef<string>, onPointerdown: (e: PointerEvent) => void, onClick: (e: MouseEvent) => Promise<void>;
|
|
12
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
13
|
+
declare var __VLS_1: {};
|
|
14
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
15
|
+
default?: (props: typeof __VLS_1) => any;
|
|
16
|
+
}>;
|
|
17
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicToastViewProps, {
|
|
18
|
+
state: typeof state;
|
|
19
|
+
view: typeof view;
|
|
20
|
+
reversedIndex: typeof reversedIndex;
|
|
21
|
+
height: typeof height;
|
|
22
|
+
offset: typeof offset;
|
|
23
|
+
style: typeof style;
|
|
24
|
+
onPointerdown: typeof onPointerdown;
|
|
25
|
+
onClick: typeof onClick;
|
|
26
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicToastViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
export declare function useToastCallback(instanceId: MaybeRef<string>): {
|
|
3
|
+
onBeforeEnter: () => void;
|
|
4
|
+
onEnter: () => void;
|
|
5
|
+
onAfterEnter: (el: HTMLElement) => void;
|
|
6
|
+
onBeforeLeave: () => void;
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
onAfterLeave: (el: HTMLElement) => void;
|
|
8
9
|
};
|
|
9
|
-
export declare function useToastCallback(args: UseToastCallbackArgs): {
|
|
10
|
-
onBeforeEnter: (_el: Element) => void;
|
|
11
|
-
onEnter: (_el: Element) => void;
|
|
12
|
-
onAfterEnter: (el: Element) => void;
|
|
13
|
-
onBeforeLeave: (_el: Element) => void;
|
|
14
|
-
onLeave: (el: Element) => void;
|
|
15
|
-
onAfterLeave: (_el: Element) => void;
|
|
16
|
-
activeToasts: Ref<{
|
|
17
|
-
id: string;
|
|
18
|
-
height: number;
|
|
19
|
-
padding: {
|
|
20
|
-
top: number;
|
|
21
|
-
bottom: number;
|
|
22
|
-
};
|
|
23
|
-
}[], ActiveToast[] | {
|
|
24
|
-
id: string;
|
|
25
|
-
height: number;
|
|
26
|
-
padding: {
|
|
27
|
-
top: number;
|
|
28
|
-
bottom: number;
|
|
29
|
-
};
|
|
30
|
-
}[]>;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toValue } from "vue";
|
|
2
2
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { useToastView } from "./useToastView.mjs";
|
|
4
|
+
import { useToastState } from "./useToastState.mjs";
|
|
5
|
+
export function useToastCallback(instanceId) {
|
|
6
|
+
const { initializeState } = useToastState(instanceId);
|
|
7
|
+
const state = initializeState();
|
|
6
8
|
const emitter = useMagicEmitter();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
const { deleteView, getView } = useToastView(instanceId);
|
|
10
|
+
function onBeforeEnter() {
|
|
11
|
+
emitter.emit("beforeEnter", toValue(instanceId));
|
|
9
12
|
}
|
|
10
|
-
function onEnter(
|
|
11
|
-
emitter.emit("enter", toValue(
|
|
12
|
-
if (
|
|
13
|
-
|
|
13
|
+
function onEnter() {
|
|
14
|
+
emitter.emit("enter", toValue(instanceId));
|
|
15
|
+
if (state.views.length && state.options.layout?.max && state.views.length > state.options.layout.max) {
|
|
16
|
+
deleteView(state.views[0].id);
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
function onAfterEnter(el) {
|
|
17
|
-
emitter.emit("afterEnter", toValue(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
id: el.id,
|
|
20
|
+
emitter.emit("afterEnter", toValue(instanceId));
|
|
21
|
+
const view = getView(el.dataset.id ?? "");
|
|
22
|
+
if (view) {
|
|
23
|
+
const mappedEl = el;
|
|
24
|
+
const style = window.getComputedStyle(mappedEl);
|
|
25
|
+
const dimensions = {
|
|
24
26
|
height: mappedEl.offsetHeight,
|
|
25
27
|
padding: {
|
|
26
28
|
top: parseInt(style.paddingTop),
|
|
27
29
|
bottom: parseInt(style.paddingBottom)
|
|
28
30
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
+
};
|
|
32
|
+
view.dimensions = dimensions;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
|
-
function onBeforeLeave(
|
|
33
|
-
emitter.emit("beforeLeave", toValue(
|
|
35
|
+
function onBeforeLeave() {
|
|
36
|
+
emitter.emit("beforeLeave", toValue(instanceId));
|
|
34
37
|
}
|
|
35
|
-
function onLeave(
|
|
36
|
-
emitter.emit("leave", toValue(
|
|
37
|
-
activeToasts.value = activeToasts.value.filter((item) => item.id !== el.id);
|
|
38
|
+
function onLeave() {
|
|
39
|
+
emitter.emit("leave", toValue(instanceId));
|
|
38
40
|
}
|
|
39
|
-
function onAfterLeave(
|
|
40
|
-
|
|
41
|
+
function onAfterLeave(el) {
|
|
42
|
+
const view = getView(el.dataset.id ?? "");
|
|
43
|
+
if (view) {
|
|
44
|
+
deleteView(view.id);
|
|
45
|
+
}
|
|
46
|
+
emitter.emit("afterLeave", toValue(instanceId));
|
|
41
47
|
}
|
|
42
48
|
return {
|
|
43
49
|
onBeforeEnter,
|
|
@@ -45,7 +51,6 @@ export function useToastCallback(args) {
|
|
|
45
51
|
onAfterEnter,
|
|
46
52
|
onBeforeLeave,
|
|
47
53
|
onLeave,
|
|
48
|
-
onAfterLeave
|
|
49
|
-
activeToasts
|
|
54
|
+
onAfterLeave
|
|
50
55
|
};
|
|
51
56
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { ToastView } from '../../types/index.js';
|
|
3
|
+
interface UseToastDragArgs {
|
|
4
|
+
instanceId: MaybeRef<string>;
|
|
5
|
+
view: ToastView;
|
|
6
|
+
}
|
|
7
|
+
export declare function useToastDrag(args: UseToastDragArgs): {
|
|
8
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
9
|
+
onClick: (e: MouseEvent) => Promise<void>;
|
|
10
|
+
style: import("vue").ComputedRef<string>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|