@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,56 +0,0 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { MagicScrollCollisionEntry, Offset } from '../../types/index.js';
|
|
3
|
-
type AlertPositions = {
|
|
4
|
-
top: boolean;
|
|
5
|
-
bottom: boolean;
|
|
6
|
-
};
|
|
7
|
-
type UseCollisionDetectArgs = {
|
|
8
|
-
scrollY: MaybeRef<number>;
|
|
9
|
-
entries: MagicScrollCollisionEntry[];
|
|
10
|
-
parent: HTMLElement | undefined;
|
|
11
|
-
};
|
|
12
|
-
interface MappedEntry extends Omit<MagicScrollCollisionEntry, 'element'> {
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
alerted: {
|
|
15
|
-
up: AlertPositions;
|
|
16
|
-
down: AlertPositions;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare function useCollisionDetect(args: UseCollisionDetectArgs): {
|
|
20
|
-
mappedEntries: import("vue").Ref<{
|
|
21
|
-
element: HTMLElement;
|
|
22
|
-
alerted: {
|
|
23
|
-
up: {
|
|
24
|
-
top: boolean;
|
|
25
|
-
bottom: boolean;
|
|
26
|
-
};
|
|
27
|
-
down: {
|
|
28
|
-
top: boolean;
|
|
29
|
-
bottom: boolean;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
data: Record<string, unknown>;
|
|
33
|
-
offset?: {
|
|
34
|
-
top: Offset;
|
|
35
|
-
bottom: Offset;
|
|
36
|
-
} | undefined;
|
|
37
|
-
}[], MappedEntry[] | {
|
|
38
|
-
element: HTMLElement;
|
|
39
|
-
alerted: {
|
|
40
|
-
up: {
|
|
41
|
-
top: boolean;
|
|
42
|
-
bottom: boolean;
|
|
43
|
-
};
|
|
44
|
-
down: {
|
|
45
|
-
top: boolean;
|
|
46
|
-
bottom: boolean;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
data: Record<string, unknown>;
|
|
50
|
-
offset?: {
|
|
51
|
-
top: Offset;
|
|
52
|
-
bottom: Offset;
|
|
53
|
-
} | undefined;
|
|
54
|
-
}[]>;
|
|
55
|
-
};
|
|
56
|
-
export {};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { ref, watch, computed, toValue } from "vue";
|
|
2
|
-
import { useIntersectionObserver, useWindowSize } from "@vueuse/core";
|
|
3
|
-
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
4
|
-
export function useCollisionDetect(args) {
|
|
5
|
-
const { scrollY, entries, parent } = args;
|
|
6
|
-
const lastScrollY = ref(0);
|
|
7
|
-
const intersecting = ref();
|
|
8
|
-
const scrollDirection = ref();
|
|
9
|
-
const mappedEntries = ref([]);
|
|
10
|
-
const oppositeScrollDirection = computed(
|
|
11
|
-
() => scrollDirection.value === "up" ? "down" : "up"
|
|
12
|
-
);
|
|
13
|
-
const windowDimensions = useWindowSize();
|
|
14
|
-
function getOffset(payload) {
|
|
15
|
-
return typeof payload === "function" ? payload({
|
|
16
|
-
vh: toValue(windowDimensions.height),
|
|
17
|
-
vw: toValue(windowDimensions.width)
|
|
18
|
-
}) : payload ?? 0;
|
|
19
|
-
}
|
|
20
|
-
function initialize() {
|
|
21
|
-
if (!parent) return;
|
|
22
|
-
mappedEntries.value = entries.map((entry) => {
|
|
23
|
-
const alerted = {
|
|
24
|
-
up: {
|
|
25
|
-
top: false,
|
|
26
|
-
bottom: false
|
|
27
|
-
},
|
|
28
|
-
down: {
|
|
29
|
-
top: false,
|
|
30
|
-
bottom: false
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const offset = { top: 0, bottom: 0, ...entry.offset };
|
|
34
|
-
const element = entry.element ? parent?.querySelector(entry.element) : parent;
|
|
35
|
-
if (!element) {
|
|
36
|
-
return void 0;
|
|
37
|
-
} else {
|
|
38
|
-
return { ...entry, offset, element, alerted };
|
|
39
|
-
}
|
|
40
|
-
}).filter((element) => !!element);
|
|
41
|
-
useIntersectionObserver(
|
|
42
|
-
parent.querySelector("*"),
|
|
43
|
-
([{ isIntersecting }]) => {
|
|
44
|
-
intersecting.value = isIntersecting;
|
|
45
|
-
},
|
|
46
|
-
{ rootMargin: "50% 0px 50% 0px", threshold: 0.01 }
|
|
47
|
-
);
|
|
48
|
-
observeAll();
|
|
49
|
-
}
|
|
50
|
-
function observeAll() {
|
|
51
|
-
if (!lastScrollY.value) {
|
|
52
|
-
lastScrollY.value = toValue(scrollY);
|
|
53
|
-
resetAll();
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
scrollDirection.value = lastScrollY.value <= toValue(scrollY) ? "down" : "up";
|
|
57
|
-
lastScrollY.value = toValue(scrollY);
|
|
58
|
-
let i = mappedEntries.value.length;
|
|
59
|
-
while (i--) {
|
|
60
|
-
const entry = mappedEntries.value[i];
|
|
61
|
-
if (!entry.element) return;
|
|
62
|
-
const boundingRect = entry.element.getBoundingClientRect();
|
|
63
|
-
if (scrollDirection.value) {
|
|
64
|
-
observeEntry({
|
|
65
|
-
position: "top",
|
|
66
|
-
direction: scrollDirection.value,
|
|
67
|
-
boundingRect,
|
|
68
|
-
entry
|
|
69
|
-
});
|
|
70
|
-
observeEntry({
|
|
71
|
-
position: "bottom",
|
|
72
|
-
direction: scrollDirection.value,
|
|
73
|
-
boundingRect,
|
|
74
|
-
entry
|
|
75
|
-
});
|
|
76
|
-
resetEntry({
|
|
77
|
-
position: "top",
|
|
78
|
-
direction: oppositeScrollDirection.value,
|
|
79
|
-
boundingRect,
|
|
80
|
-
entry
|
|
81
|
-
});
|
|
82
|
-
resetEntry({
|
|
83
|
-
position: "bottom",
|
|
84
|
-
direction: oppositeScrollDirection.value,
|
|
85
|
-
boundingRect,
|
|
86
|
-
entry
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function resetAll() {
|
|
92
|
-
mappedEntries.value = mappedEntries.value.map((entry) => {
|
|
93
|
-
const alerted = {
|
|
94
|
-
up: {
|
|
95
|
-
top: false,
|
|
96
|
-
bottom: false
|
|
97
|
-
},
|
|
98
|
-
down: {
|
|
99
|
-
top: false,
|
|
100
|
-
bottom: false
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return { ...entry, alerted };
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function observeEntry(args2) {
|
|
107
|
-
const { position, direction, boundingRect, entry } = args2;
|
|
108
|
-
const offset = getOffset(entry.offset[position] ?? 0);
|
|
109
|
-
if (entry.alerted[direction][position]) return;
|
|
110
|
-
if (direction === "down" && boundingRect[position] <= offset || direction === "up" && boundingRect[position] >= offset) {
|
|
111
|
-
entry.alerted[direction][position] = true;
|
|
112
|
-
useMagicEmitter().emit("collision", {
|
|
113
|
-
direction,
|
|
114
|
-
position,
|
|
115
|
-
element: entry.element,
|
|
116
|
-
data: entry.data
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function resetEntry(args2) {
|
|
121
|
-
const { position, direction, boundingRect, entry } = args2;
|
|
122
|
-
const offset = getOffset(entry.offset[position] ?? 0);
|
|
123
|
-
if (!entry.alerted[direction][position]) return;
|
|
124
|
-
if (direction === "down" && boundingRect[position] >= offset || direction === "up" && boundingRect[position] <= offset) {
|
|
125
|
-
entry.alerted[direction][position] = false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
initialize();
|
|
129
|
-
watch(
|
|
130
|
-
() => toValue(scrollY),
|
|
131
|
-
() => {
|
|
132
|
-
if (intersecting.value) {
|
|
133
|
-
observeAll();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
return {
|
|
138
|
-
mappedEntries
|
|
139
|
-
};
|
|
140
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport
|
|
3
|
-
:key="teleportKey"
|
|
4
|
-
:to="mappedOptions.teleport?.target"
|
|
5
|
-
:disabled="mappedOptions.teleport?.disabled"
|
|
6
|
-
>
|
|
7
|
-
<div class="magic-toast" :id="toValue(id)" :class="toValue(props.class)">
|
|
8
|
-
<transition-group
|
|
9
|
-
tag="ol"
|
|
10
|
-
ref="listRef"
|
|
11
|
-
class="magic-toast__inner"
|
|
12
|
-
:name="mappedOptions.transitions!.list"
|
|
13
|
-
:on-before-enter="onBeforeEnter"
|
|
14
|
-
:on-enter="onEnter"
|
|
15
|
-
:on-after-enter="onAfterEnter"
|
|
16
|
-
:on-before-leave="onBeforeLeave"
|
|
17
|
-
:on-leave="onLeave"
|
|
18
|
-
:on-after-leave="onAfterLeave"
|
|
19
|
-
>
|
|
20
|
-
<magic-toast-component
|
|
21
|
-
v-for="(toast, index) in toasts"
|
|
22
|
-
:id="toast.id"
|
|
23
|
-
:key="toast.id"
|
|
24
|
-
:index="index"
|
|
25
|
-
:total="count || 0"
|
|
26
|
-
:siblings="activeToasts"
|
|
27
|
-
:class="{
|
|
28
|
-
expanded: isExpanded,
|
|
29
|
-
}"
|
|
30
|
-
@mouseenter="onMouseenter"
|
|
31
|
-
@mouseleave="onMouseleave"
|
|
32
|
-
>
|
|
33
|
-
<component
|
|
34
|
-
:is="toast.component"
|
|
35
|
-
v-bind="toast.props"
|
|
36
|
-
@close="toast.remove"
|
|
37
|
-
@click.self="onClick"
|
|
38
|
-
/>
|
|
39
|
-
</magic-toast-component>
|
|
40
|
-
</transition-group>
|
|
41
|
-
</div>
|
|
42
|
-
</Teleport>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script setup lang="ts">
|
|
46
|
-
import {
|
|
47
|
-
toValue,
|
|
48
|
-
ref,
|
|
49
|
-
watch,
|
|
50
|
-
onBeforeMount,
|
|
51
|
-
onUnmounted,
|
|
52
|
-
useId,
|
|
53
|
-
type MaybeRef,
|
|
54
|
-
} from 'vue'
|
|
55
|
-
import { defu } from 'defu'
|
|
56
|
-
import { onClickOutside, type MaybeElement } from '@vueuse/core'
|
|
57
|
-
import { defaultOptions } from './../utils/defaultOptions'
|
|
58
|
-
import { useToastApi } from '../composables/private/useToastApi'
|
|
59
|
-
import { useToastCallback } from './../composables/private/useToastCallback'
|
|
60
|
-
import { useMagicToast } from '../composables/useMagicToast'
|
|
61
|
-
|
|
62
|
-
import MagicToastComponent from './MagicToastComponent.vue'
|
|
63
|
-
|
|
64
|
-
import type { MagicToastOptions } from './../types/index'
|
|
65
|
-
|
|
66
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css'
|
|
67
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css'
|
|
68
|
-
import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css'
|
|
69
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css'
|
|
70
|
-
import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css'
|
|
71
|
-
|
|
72
|
-
interface MagicToastProps {
|
|
73
|
-
id: MaybeRef<string>
|
|
74
|
-
class: MaybeRef<string>
|
|
75
|
-
options?: MagicToastOptions
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const props = defineProps<MagicToastProps>()
|
|
79
|
-
|
|
80
|
-
const { initialize, destroy } = useToastApi(props.id)
|
|
81
|
-
const { toasts, count, firstToast } = useMagicToast(props.id)
|
|
82
|
-
|
|
83
|
-
const mappedOptions = defu(props.options, defaultOptions)
|
|
84
|
-
const isExpanded = ref(mappedOptions.layout?.expand === true)
|
|
85
|
-
const teleportKey = ref(useId())
|
|
86
|
-
const listRef = ref<MaybeElement>()
|
|
87
|
-
|
|
88
|
-
const {
|
|
89
|
-
onBeforeEnter,
|
|
90
|
-
onEnter,
|
|
91
|
-
onAfterEnter,
|
|
92
|
-
onBeforeLeave,
|
|
93
|
-
onLeave,
|
|
94
|
-
onAfterLeave,
|
|
95
|
-
activeToasts,
|
|
96
|
-
} = useToastCallback({ id: props.id, mappedOptions, count, firstToast })
|
|
97
|
-
|
|
98
|
-
function onMouseenter() {
|
|
99
|
-
if (mappedOptions.layout?.expand === 'hover') {
|
|
100
|
-
isExpanded.value = true
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function onMouseleave() {
|
|
105
|
-
if (mappedOptions.layout?.expand === 'hover') {
|
|
106
|
-
isExpanded.value = false
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function onClick() {
|
|
111
|
-
if (mappedOptions.layout?.expand === 'click') {
|
|
112
|
-
isExpanded.value = true
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function outsideClickCallback() {
|
|
117
|
-
if (mappedOptions.layout?.expand === 'click') {
|
|
118
|
-
isExpanded.value = false
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
onClickOutside(listRef, outsideClickCallback)
|
|
123
|
-
|
|
124
|
-
// Lifecycle hooks and listeners
|
|
125
|
-
watch(
|
|
126
|
-
() => props.id,
|
|
127
|
-
() => (teleportKey.value = useId())
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
onBeforeMount(() => {
|
|
131
|
-
initialize()
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
onUnmounted(() => {
|
|
135
|
-
destroy(toValue(props.id))
|
|
136
|
-
})
|
|
137
|
-
</script>
|
|
138
|
-
|
|
139
|
-
<style>
|
|
140
|
-
:root{--magic-toast-transform-x:0;--magic-toast-transform-y:0;--magic-toast-padding-x:1rem;--magic-toast-padding-y:1rem;--mt-multiplier-x:1;--mt-multiplier-y:1;--mt-align-items:flex-start;--mt-justify-content:center}.magic-toast{align-items:center;background:transparent;color:inherit;flex-direction:column;inset:0;justify-content:center;pointer-events:none;position:fixed;z-index:var(--magic-toast-z-index,999)}.magic-toast,.magic-toast__inner{display:flex;height:100%;width:100%}.magic-toast__inner{align-items:var(--mt-align-items);justify-content:var(--mt-justify-content);max-height:100%;overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:none;-ms-overflow-style:none}.magic-toast__inner::-webkit-scrollbar{display:none}.magic-toast__inner *{pointer-events:all}.magic-toast.-top-center,.magic-toast.-top-left,.magic-toast.-top-right{--magic-toast-transform-y:10;--magic-toast-enter-animation:slide-ttb-in 300ms ease;--mt-multiplier-y:1;--mt-align-items:flex-start}.magic-toast.-top-center .magic-toast-component,.magic-toast.-top-left .magic-toast-component,.magic-toast.-top-right .magic-toast-component{padding-top:var(--magic-toast-padding-y,1rem)}.magic-toast.-bottom-center,.magic-toast.-bottom-left,.magic-toast.-bottom-right{--magic-toast-transform-y:10;--magic-toast-enter-animation:slide-btt-in 300ms ease;--mt-multiplier-y:-1;--mt-align-items:flex-end}.magic-toast.-bottom-center .magic-toast-component,.magic-toast.-bottom-left .magic-toast-component,.magic-toast.-bottom-right .magic-toast-component{padding-bottom:var(--magic-toast-padding-y,1rem)}.magic-toast.-bottom-left,.magic-toast.-top-left{--mt-justify-content:flex-start}.magic-toast.-bottom-left .magic-toast-component,.magic-toast.-top-left .magic-toast-component{padding-left:var(--magic-toast-padding-x,1rem)}.magic-toast.-bottom-right,.magic-toast.-top-right{--mt-justify-content:flex-end}.magic-toast.-bottom-right .magic-toast-component,.magic-toast.-top-right .magic-toast-component{padding-right:var(--magic-toast-padding-x,1rem)}.magic-toast.-from-left{--magic-toast-enter-animation:slide-ltr-in 300ms ease;--magic-toast-transform-y:0;--magic-toast-transform-x:30;--mt-multiplier-x:1}.magic-toast.-from-right{--magic-toast-enter-animation:slide-rtl-in 300ms ease;--magic-toast-transform-y:0;--magic-toast-transform-x:30;--mt-multiplier-x:-1}.magic-toast--list-enter-active{animation:var(--magic-toast-enter-animation,unset)}.magic-toast--list-leave-active{animation:var(--magic-toast-leave-animation,fade-out .3s ease)}
|
|
141
|
-
</style>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li
|
|
3
|
-
class="magic-toast-component"
|
|
4
|
-
ref="elRef"
|
|
5
|
-
@mouseenter="onMouseenter"
|
|
6
|
-
:id="id"
|
|
7
|
-
>
|
|
8
|
-
<div class="magic-toast-component__inner">
|
|
9
|
-
<slot />
|
|
10
|
-
</div>
|
|
11
|
-
</li>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts" setup>
|
|
15
|
-
import { ref, computed, onMounted, watchEffect } from 'vue'
|
|
16
|
-
import { type ActiveToast } from './../types'
|
|
17
|
-
|
|
18
|
-
interface MagicToastComponentProps {
|
|
19
|
-
index: number
|
|
20
|
-
total: number
|
|
21
|
-
id: string
|
|
22
|
-
siblings: ActiveToast[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const props = defineProps<MagicToastComponentProps>()
|
|
26
|
-
const emit = defineEmits<{
|
|
27
|
-
mouseenter: [event: Event]
|
|
28
|
-
}>()
|
|
29
|
-
|
|
30
|
-
const elRef = ref<HTMLElement | undefined>(undefined)
|
|
31
|
-
const newerSiblings = computed(() => {
|
|
32
|
-
return props.siblings.slice(props.index + 1)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
function setIndex() {
|
|
36
|
-
const index = (props.total - props.index - 1).toString()
|
|
37
|
-
elRef.value?.style.setProperty('--mt-index', index)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function setOffset() {
|
|
41
|
-
const offset = newerSiblings.value.reduce((acc, curr) => {
|
|
42
|
-
return acc + curr.height - curr.padding.top - curr.padding.bottom
|
|
43
|
-
}, 0)
|
|
44
|
-
elRef.value?.style.setProperty('--mt-offset', `${offset}`)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function onMouseenter(event: Event) {
|
|
48
|
-
emit('mouseenter', event)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onMounted(() => {
|
|
52
|
-
setIndex()
|
|
53
|
-
setOffset()
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
watchEffect(() => {
|
|
57
|
-
setIndex()
|
|
58
|
-
setOffset()
|
|
59
|
-
})
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<style>
|
|
63
|
-
.magic-toast-component{--mt-index:0;--mt-offset:0;--mt-matrix-scale:calc(1 - var(--magic-toast-scale, 0.1)*var(--mt-index, 0));--mt-matrix-transform-x:calc(var(--magic-toast-transform-x)*var(--mt-index, 0)*var(--mt-multiplier-x));--mt-matrix-transform-y:calc(var(--magic-toast-transform-y)*var(--mt-index, 0)*var(--mt-multiplier-y));list-style:none;position:absolute}.magic-toast-component__inner{height:100%;position:relative;transform:matrix(var(--mt-matrix-scale),0,0,var(--mt-matrix-scale),var(--mt-matrix-transform-x),var(--mt-matrix-transform-y));transition:var(--magic-toast-transition,transform .3s ease);width:100%}.magic-toast-component.expanded{--mt-matrix-scale:1;--mt-matrix-transform-y:calc(var(--mt-offset)*var(--mt-multiplier-y));--mt-matrix-transform-x:0}.magic-toast-component.expanded:not(:last-child) .magic-toast-component__inner{padding-bottom:calc(var(--magic-toast-gap, .75rem)*var(--mt-index));padding-top:calc(var(--magic-toast-gap, .75rem)*var(--mt-index))}
|
|
64
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type ActiveToast } from './../types';
|
|
2
|
-
interface MagicToastComponentProps {
|
|
3
|
-
index: number;
|
|
4
|
-
total: number;
|
|
5
|
-
id: string;
|
|
6
|
-
siblings: ActiveToast[];
|
|
7
|
-
}
|
|
8
|
-
declare function __VLS_template(): {
|
|
9
|
-
attrs: Partial<{}>;
|
|
10
|
-
slots: {
|
|
11
|
-
default?(_: {}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {
|
|
14
|
-
elRef: HTMLLIElement;
|
|
15
|
-
};
|
|
16
|
-
rootEl: HTMLLIElement;
|
|
17
|
-
};
|
|
18
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicToastComponentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
mouseenter: (event: Event) => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<MagicToastComponentProps> & Readonly<{
|
|
22
|
-
onMouseenter?: ((event: Event) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLLIElement>;
|
|
24
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
-
export default _default;
|
|
26
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
-
new (): {
|
|
28
|
-
$slots: S;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { toValue } from "vue";
|
|
2
|
-
import { useToastStore } from "./useToastStore.mjs";
|
|
3
|
-
import { useMagicToast } from "../useMagicToast.mjs";
|
|
4
|
-
export function useToastApi(id) {
|
|
5
|
-
const { findInstance, addInstance, removeInstance } = useToastStore();
|
|
6
|
-
const { clear } = useMagicToast(toValue(id));
|
|
7
|
-
function initialize() {
|
|
8
|
-
const mappedId = toValue(id);
|
|
9
|
-
if (!findInstance(mappedId)) {
|
|
10
|
-
return addInstance(mappedId);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function destroy(id2) {
|
|
14
|
-
if (!id2) return;
|
|
15
|
-
clear();
|
|
16
|
-
removeInstance(toValue(id2));
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
initialize,
|
|
20
|
-
destroy
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export function useToastInternalApi() {
|
|
2
|
-
function uuid() {
|
|
3
|
-
return Math.random().toString(36).slice(2, 11);
|
|
4
|
-
}
|
|
5
|
-
function removeToastAfterTimeout(id, duration, ctx) {
|
|
6
|
-
if (duration > 0) {
|
|
7
|
-
setTimeout(() => {
|
|
8
|
-
ctx.remove(id);
|
|
9
|
-
}, duration);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function addToast(args, ctx) {
|
|
13
|
-
const id = uuid();
|
|
14
|
-
let { component, props, duration = 0 } = args;
|
|
15
|
-
const toast = {
|
|
16
|
-
component,
|
|
17
|
-
props,
|
|
18
|
-
id,
|
|
19
|
-
remove: () => ctx.remove(id)
|
|
20
|
-
};
|
|
21
|
-
ctx.toasts.push(toast);
|
|
22
|
-
removeToastAfterTimeout(id, duration, ctx);
|
|
23
|
-
return id;
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
addToast
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ToastInstance, AddToastArgs } from '../../types/index.js';
|
|
2
|
-
export declare function useToastStore(): {
|
|
3
|
-
toastStore: import("vue").Ref<{
|
|
4
|
-
id: string;
|
|
5
|
-
toasts: {
|
|
6
|
-
id: string;
|
|
7
|
-
component: Object;
|
|
8
|
-
props?: Record<string, any> | undefined;
|
|
9
|
-
remove: Function;
|
|
10
|
-
}[];
|
|
11
|
-
add: (args: AddToastArgs) => string;
|
|
12
|
-
remove: (id: string) => void;
|
|
13
|
-
}[], ToastInstance[] | {
|
|
14
|
-
id: string;
|
|
15
|
-
toasts: {
|
|
16
|
-
id: string;
|
|
17
|
-
component: Object;
|
|
18
|
-
props?: Record<string, any> | undefined;
|
|
19
|
-
remove: Function;
|
|
20
|
-
}[];
|
|
21
|
-
add: (args: AddToastArgs) => string;
|
|
22
|
-
remove: (id: string) => void;
|
|
23
|
-
}[]>;
|
|
24
|
-
findInstance: (id: string) => ToastInstance | undefined;
|
|
25
|
-
addInstance: (id: string) => ToastInstance;
|
|
26
|
-
removeInstance: (id: string) => void;
|
|
27
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { useToastInternalApi } from "./useToastInternalApi.mjs";
|
|
3
|
-
const toastStore = ref([]);
|
|
4
|
-
export function useToastStore() {
|
|
5
|
-
const { addToast } = useToastInternalApi();
|
|
6
|
-
function createInstance(id) {
|
|
7
|
-
const instance = {
|
|
8
|
-
id,
|
|
9
|
-
toasts: [],
|
|
10
|
-
add: function(args) {
|
|
11
|
-
return addToast(args, this);
|
|
12
|
-
},
|
|
13
|
-
remove: function(id2) {
|
|
14
|
-
this.toasts = this.toasts.filter((toast) => toast.id !== id2);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return instance;
|
|
18
|
-
}
|
|
19
|
-
function findInstance(id) {
|
|
20
|
-
const instance = toastStore.value.find(
|
|
21
|
-
(instance2) => instance2.id === id
|
|
22
|
-
);
|
|
23
|
-
return instance;
|
|
24
|
-
}
|
|
25
|
-
function addInstance(id) {
|
|
26
|
-
const instance = createInstance(id);
|
|
27
|
-
toastStore.value.push(instance);
|
|
28
|
-
return instance;
|
|
29
|
-
}
|
|
30
|
-
function removeInstance(id) {
|
|
31
|
-
toastStore.value = toastStore.value.filter(
|
|
32
|
-
(instance) => instance.id !== id
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
toastStore,
|
|
37
|
-
findInstance,
|
|
38
|
-
addInstance,
|
|
39
|
-
removeInstance
|
|
40
|
-
};
|
|
41
|
-
}
|
package/dist/utils/index.d.mts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
declare function clampValue(value: number, min: number, max: number): number;
|
|
2
|
-
|
|
3
|
-
declare function linear(t: number): number;
|
|
4
|
-
declare function easeInQuad(t: number): number;
|
|
5
|
-
declare function easeOutQuad(t: number): number;
|
|
6
|
-
declare function easeInOutQuad(t: number): number;
|
|
7
|
-
declare function easeOutBack(t: number, o?: number): number;
|
|
8
|
-
declare function easeInCubic(t: number): number;
|
|
9
|
-
declare function easeOutCubic(t: number): number;
|
|
10
|
-
declare function easeInOutCubic(t: number): number;
|
|
11
|
-
declare function easeInQuart(t: number): number;
|
|
12
|
-
declare function easeOutQuart(t: number): number;
|
|
13
|
-
declare function easeInOutQuart(t: number): number;
|
|
14
|
-
declare function easeInQuint(t: number): number;
|
|
15
|
-
declare function easeOutQuint(t: number): number;
|
|
16
|
-
declare function easeInOutQuint(t: number): number;
|
|
17
|
-
|
|
18
|
-
declare function formatTime(seconds: number, guide: number): string;
|
|
19
|
-
|
|
20
|
-
type InterpolateArgs = {
|
|
21
|
-
from: number;
|
|
22
|
-
to: number;
|
|
23
|
-
duration: number;
|
|
24
|
-
interval?: number;
|
|
25
|
-
easing?: (t: number) => number;
|
|
26
|
-
callback: (result: number) => void;
|
|
27
|
-
};
|
|
28
|
-
declare function interpolate(args: InterpolateArgs): void;
|
|
29
|
-
|
|
30
|
-
declare function isIOS(): boolean;
|
|
31
|
-
|
|
32
|
-
interface isWithinRangeArgs {
|
|
33
|
-
input: number;
|
|
34
|
-
base: number;
|
|
35
|
-
threshold: number;
|
|
36
|
-
}
|
|
37
|
-
declare function isWithinRange(args: isWithinRangeArgs): boolean;
|
|
38
|
-
|
|
39
|
-
declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
|
40
|
-
|
|
41
|
-
declare function matchClass(el: Element, regex: RegExp): boolean;
|
|
42
|
-
|
|
43
|
-
interface GuardedSetPointerCaptureArgs {
|
|
44
|
-
event: PointerEvent;
|
|
45
|
-
element?: Element;
|
|
46
|
-
debug?: boolean;
|
|
47
|
-
}
|
|
48
|
-
interface GuardedReleasePointerCaptureArgs {
|
|
49
|
-
event: PointerEvent;
|
|
50
|
-
element?: Element;
|
|
51
|
-
}
|
|
52
|
-
declare function guardedSetPointerCapture(args: GuardedSetPointerCaptureArgs): void;
|
|
53
|
-
declare function guardedReleasePointerCapture(args: GuardedReleasePointerCaptureArgs): void;
|
|
54
|
-
|
|
55
|
-
interface SlugifyOptions {
|
|
56
|
-
separator?: string;
|
|
57
|
-
trim?: boolean;
|
|
58
|
-
remove?: RegExp;
|
|
59
|
-
strict?: boolean;
|
|
60
|
-
lowercase?: boolean;
|
|
61
|
-
}
|
|
62
|
-
declare function slugify(string: string, options?: SlugifyOptions): string;
|
|
63
|
-
|
|
64
|
-
declare function uniq<T extends any[]>(a: T): any[];
|
|
65
|
-
|
|
66
|
-
type PickPartial<T, K extends keyof T> = {
|
|
67
|
-
[P in K]: Partial<T[P]>;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
type RequireAll<T> = {
|
|
71
|
-
[P in keyof T]-?: T[P];
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
type RequireAllNested<T> = {
|
|
75
|
-
[P in keyof T]-?: RequireAllNested<T[P]>;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
type ValueOf<T> = T[keyof T];
|
|
79
|
-
|
|
80
|
-
export { type InterpolateArgs, type PickPartial, type RequireAll, type RequireAllNested, type SlugifyOptions, type ValueOf, clampValue, easeInCubic, easeInOutCubic, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInQuad, easeInQuart, easeInQuint, easeOutBack, easeOutCubic, easeOutQuad, easeOutQuart, easeOutQuint, formatTime, guardedReleasePointerCapture, guardedSetPointerCapture, interpolate, isIOS, isWithinRange, linear, mapValue, matchClass, slugify, uniq };
|