@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,40 +1,40 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = { class: "magic-scroll-provider" };
|
|
5
|
+
import { provide, computed } from "vue";
|
|
6
|
+
import { useScroll, unrefElement } from "@vueuse/core";
|
|
7
|
+
import { MagicScrollReturn, MagicScrollTarget } from "../symbols";
|
|
8
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
9
|
+
__name: "MagicScrollProvider",
|
|
10
|
+
props: {
|
|
11
|
+
target: { type: null, required: false }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const mappedTarget = computed(() => {
|
|
15
|
+
switch (true) {
|
|
16
|
+
case !!__props.target:
|
|
17
|
+
return unrefElement(__props.target);
|
|
18
|
+
case typeof window !== "undefined":
|
|
19
|
+
return window;
|
|
20
|
+
default:
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const providedTarget = computed(() => {
|
|
25
|
+
if (__props.target) {
|
|
26
|
+
return unrefElement(__props.target);
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
});
|
|
30
|
+
const scrollReturn = useScroll(mappedTarget);
|
|
31
|
+
provide(MagicScrollReturn, scrollReturn);
|
|
32
|
+
provide(MagicScrollTarget, providedTarget);
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
35
|
+
_renderSlot(_ctx.$slots, "default", { scrollReturn: _unref(scrollReturn) })
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
40
|
</script>
|
|
@@ -1,42 +1,56 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type MaybeElementRef } from '@vueuse/core';
|
|
2
2
|
interface MagicScrollProviderProps {
|
|
3
|
-
|
|
4
|
-
el?: MaybeComputedElementRef<HTMLElement>;
|
|
3
|
+
target?: MaybeElementRef<HTMLElement>;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
declare const scrollReturn: {
|
|
6
|
+
x: import("vue").WritableComputedRef<number, number>;
|
|
7
|
+
y: import("vue").WritableComputedRef<number, number>;
|
|
8
|
+
isScrolling: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
arrivedState: {
|
|
10
|
+
left: boolean;
|
|
11
|
+
right: boolean;
|
|
12
|
+
top: boolean;
|
|
13
|
+
bottom: boolean;
|
|
14
|
+
};
|
|
15
|
+
directions: {
|
|
16
|
+
left: boolean;
|
|
17
|
+
right: boolean;
|
|
18
|
+
top: boolean;
|
|
19
|
+
bottom: boolean;
|
|
20
|
+
};
|
|
21
|
+
measure(): void;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
24
|
+
declare var __VLS_1: {
|
|
25
|
+
scrollReturn: {
|
|
26
|
+
x: import("vue").WritableComputedRef<number, number>;
|
|
27
|
+
y: import("vue").WritableComputedRef<number, number>;
|
|
28
|
+
isScrolling: import("vue").Ref<boolean, boolean>;
|
|
29
|
+
arrivedState: {
|
|
30
|
+
left: boolean;
|
|
31
|
+
right: boolean;
|
|
32
|
+
top: boolean;
|
|
33
|
+
bottom: boolean;
|
|
34
|
+
};
|
|
35
|
+
directions: {
|
|
36
|
+
left: boolean;
|
|
37
|
+
right: boolean;
|
|
38
|
+
top: boolean;
|
|
39
|
+
bottom: boolean;
|
|
40
|
+
};
|
|
41
|
+
measure(): void;
|
|
29
42
|
};
|
|
30
|
-
refs: {};
|
|
31
|
-
rootEl: HTMLDivElement;
|
|
32
43
|
};
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
45
|
+
default?: (props: typeof __VLS_1) => any;
|
|
46
|
+
}>;
|
|
47
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicScrollProviderProps, {
|
|
48
|
+
scrollReturn: typeof scrollReturn;
|
|
49
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
38
52
|
export default _default;
|
|
39
|
-
type
|
|
53
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
54
|
new (): {
|
|
41
55
|
$slots: S;
|
|
42
56
|
};
|
|
@@ -1,78 +1,89 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { ref, provide, inject, onMounted, watch, nextTick, readonly } from 'vue'
|
|
9
|
-
import { useIntersectionObserver } from '@vueuse/core'
|
|
10
|
-
import { useScrollApi } from '../composables/private/useScrollApi'
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
ref: "el",
|
|
6
|
+
class: "magic-scroll-scene"
|
|
7
|
+
};
|
|
11
8
|
import {
|
|
12
|
-
|
|
9
|
+
shallowRef,
|
|
10
|
+
provide,
|
|
11
|
+
inject,
|
|
12
|
+
watch,
|
|
13
|
+
nextTick,
|
|
14
|
+
readonly,
|
|
15
|
+
useTemplateRef
|
|
16
|
+
} from "vue";
|
|
17
|
+
import { useIntersectionObserver } from "@vueuse/core";
|
|
18
|
+
import { useScrollApi } from "../composables/private/useScrollApi";
|
|
19
|
+
import {
|
|
20
|
+
MagicScrollTarget,
|
|
13
21
|
MagicScrollProgress,
|
|
14
|
-
MagicScrollReturn
|
|
15
|
-
} from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
to?: FromTo
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const props = withDefaults(defineProps<MagicScrollSceneProps>(), {
|
|
25
|
-
from: 'top-bottom',
|
|
26
|
-
to: 'bottom-top',
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const scrollReturn = inject(MagicScrollReturn, undefined)
|
|
30
|
-
const scrollParent = inject(MagicScrollParent)
|
|
31
|
-
|
|
32
|
-
const elRef = ref<HTMLElement | undefined>(undefined)
|
|
33
|
-
const progress = ref(0)
|
|
34
|
-
const intersecting = ref()
|
|
35
|
-
|
|
36
|
-
const { getCalculations, getProgress } = useScrollApi({
|
|
37
|
-
child: elRef,
|
|
38
|
-
parent: scrollParent,
|
|
39
|
-
from: props.from,
|
|
40
|
-
to: props.to,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
async function calculate() {
|
|
44
|
-
getCalculations()
|
|
45
|
-
await nextTick()
|
|
46
|
-
progress.value = getProgress()
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
watch(
|
|
50
|
-
() => scrollReturn?.y.value,
|
|
51
|
-
() => {
|
|
52
|
-
if (intersecting.value) {
|
|
53
|
-
calculate()
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
watch(
|
|
59
|
-
() => scrollReturn?.y.value,
|
|
60
|
-
() => {
|
|
61
|
-
calculate()
|
|
22
|
+
MagicScrollReturn
|
|
23
|
+
} from "../symbols";
|
|
24
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
25
|
+
__name: "MagicScrollScene",
|
|
26
|
+
props: {
|
|
27
|
+
from: { type: String, required: false, default: "top-bottom" },
|
|
28
|
+
to: { type: String, required: false, default: "bottom-top" }
|
|
62
29
|
},
|
|
63
|
-
{
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
([{ isIntersecting }]) => {
|
|
69
|
-
intersecting.value = isIntersecting
|
|
70
|
-
if (isIntersecting) {
|
|
71
|
-
calculate()
|
|
30
|
+
setup(__props) {
|
|
31
|
+
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
32
|
+
const scrollTarget = inject(MagicScrollTarget, void 0);
|
|
33
|
+
if (!scrollTarget) {
|
|
34
|
+
console.error("MagicScrollScene must be used within a MagicScrollProvider");
|
|
72
35
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
const progress = shallowRef(0);
|
|
37
|
+
const intersecting = shallowRef(false);
|
|
38
|
+
const elRef = useTemplateRef("el");
|
|
39
|
+
const { getCalculations, getProgress } = useScrollApi({
|
|
40
|
+
child: elRef,
|
|
41
|
+
parent: scrollTarget,
|
|
42
|
+
from: __props.from,
|
|
43
|
+
to: __props.to
|
|
44
|
+
});
|
|
45
|
+
async function calculate() {
|
|
46
|
+
getCalculations();
|
|
47
|
+
await nextTick();
|
|
48
|
+
progress.value = getProgress();
|
|
49
|
+
}
|
|
50
|
+
watch(
|
|
51
|
+
() => scrollReturn?.y.value,
|
|
52
|
+
() => {
|
|
53
|
+
if (intersecting.value) {
|
|
54
|
+
calculate();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
watch(
|
|
59
|
+
() => scrollReturn?.y.value,
|
|
60
|
+
() => {
|
|
61
|
+
calculate();
|
|
62
|
+
},
|
|
63
|
+
{ once: true }
|
|
64
|
+
);
|
|
65
|
+
useIntersectionObserver(
|
|
66
|
+
elRef,
|
|
67
|
+
([{ isIntersecting }]) => {
|
|
68
|
+
intersecting.value = isIntersecting;
|
|
69
|
+
if (isIntersecting) {
|
|
70
|
+
calculate();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{ rootMargin: "150% 0px 150% 0px", immediate: true }
|
|
74
|
+
);
|
|
75
|
+
provide(MagicScrollProgress, readonly(progress));
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return _openBlock(), _createElementBlock(
|
|
78
|
+
"div",
|
|
79
|
+
_hoisted_1,
|
|
80
|
+
[
|
|
81
|
+
_renderSlot(_ctx.$slots, "default", { progress: progress.value })
|
|
82
|
+
],
|
|
83
|
+
512
|
|
84
|
+
/* NEED_PATCH */
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
78
89
|
</script>
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScrollIntersection } from '../types/index.js';
|
|
2
2
|
interface MagicScrollSceneProps {
|
|
3
|
-
from?:
|
|
4
|
-
to?:
|
|
3
|
+
from?: ScrollIntersection;
|
|
4
|
+
to?: ScrollIntersection;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
progress: number;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {
|
|
14
|
-
elRef: HTMLDivElement;
|
|
15
|
-
};
|
|
16
|
-
rootEl: HTMLDivElement;
|
|
6
|
+
declare const progress: import("vue").ShallowRef<number, number>;
|
|
7
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
progress: number;
|
|
17
10
|
};
|
|
18
|
-
type
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicScrollSceneProps, {
|
|
15
|
+
progress: typeof progress;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollSceneProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollSceneProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollSceneProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
24
19
|
export default _default;
|
|
25
|
-
type
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
21
|
new (): {
|
|
27
22
|
$slots: S;
|
|
28
23
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { CollisionOffset } from '../../types/index.js';
|
|
3
|
+
type UseCollisionDetectionArgs = {
|
|
4
|
+
id: string;
|
|
5
|
+
child: MaybeRef<HTMLElement | null>;
|
|
6
|
+
parent: MaybeRef<HTMLElement | null | undefined>;
|
|
7
|
+
scrollY: MaybeRef<number>;
|
|
8
|
+
offset?: CollisionOffset;
|
|
9
|
+
};
|
|
10
|
+
export declare function useCollisionDetection(args: UseCollisionDetectionArgs): {
|
|
11
|
+
observe: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { shallowRef, reactive, computed, toValue } from "vue";
|
|
2
|
+
import { useElementBounding } from "@vueuse/core";
|
|
3
|
+
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
4
|
+
export function useCollisionDetection(args) {
|
|
5
|
+
const { id, scrollY, child, parent, offset } = args;
|
|
6
|
+
const alerted = reactive({
|
|
7
|
+
up: {
|
|
8
|
+
top: {
|
|
9
|
+
top: false,
|
|
10
|
+
bottom: false
|
|
11
|
+
},
|
|
12
|
+
bottom: {
|
|
13
|
+
top: false,
|
|
14
|
+
bottom: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
down: {
|
|
18
|
+
top: {
|
|
19
|
+
top: false,
|
|
20
|
+
bottom: false
|
|
21
|
+
},
|
|
22
|
+
bottom: {
|
|
23
|
+
top: false,
|
|
24
|
+
bottom: false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const childBoundingRect = useElementBounding(child);
|
|
29
|
+
const parentBoundingRect = useElementBounding(parent);
|
|
30
|
+
const mappedOffset = { top: 0, bottom: 0, ...offset };
|
|
31
|
+
const lastScrollY = shallowRef(0);
|
|
32
|
+
const scrollDirection = shallowRef();
|
|
33
|
+
const oppositeScrollDirection = computed(
|
|
34
|
+
() => scrollDirection.value === "up" ? "down" : "up"
|
|
35
|
+
);
|
|
36
|
+
function observe() {
|
|
37
|
+
if (!lastScrollY.value) {
|
|
38
|
+
lastScrollY.value = toValue(scrollY);
|
|
39
|
+
reset();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
scrollDirection.value = lastScrollY.value <= toValue(scrollY) ? "down" : "up";
|
|
43
|
+
lastScrollY.value = toValue(scrollY);
|
|
44
|
+
if (scrollDirection.value) {
|
|
45
|
+
observeItem({
|
|
46
|
+
childEdge: "top",
|
|
47
|
+
parentEdge: "top",
|
|
48
|
+
direction: scrollDirection.value
|
|
49
|
+
});
|
|
50
|
+
observeItem({
|
|
51
|
+
childEdge: "top",
|
|
52
|
+
parentEdge: "bottom",
|
|
53
|
+
direction: scrollDirection.value
|
|
54
|
+
});
|
|
55
|
+
observeItem({
|
|
56
|
+
childEdge: "bottom",
|
|
57
|
+
parentEdge: "bottom",
|
|
58
|
+
direction: scrollDirection.value
|
|
59
|
+
});
|
|
60
|
+
observeItem({
|
|
61
|
+
childEdge: "bottom",
|
|
62
|
+
parentEdge: "top",
|
|
63
|
+
direction: scrollDirection.value
|
|
64
|
+
});
|
|
65
|
+
resetItem({
|
|
66
|
+
childEdge: "top",
|
|
67
|
+
parentEdge: "top",
|
|
68
|
+
direction: oppositeScrollDirection.value
|
|
69
|
+
});
|
|
70
|
+
resetItem({
|
|
71
|
+
childEdge: "top",
|
|
72
|
+
parentEdge: "bottom",
|
|
73
|
+
direction: oppositeScrollDirection.value
|
|
74
|
+
});
|
|
75
|
+
resetItem({
|
|
76
|
+
childEdge: "bottom",
|
|
77
|
+
parentEdge: "bottom",
|
|
78
|
+
direction: oppositeScrollDirection.value
|
|
79
|
+
});
|
|
80
|
+
resetItem({
|
|
81
|
+
childEdge: "bottom",
|
|
82
|
+
parentEdge: "top",
|
|
83
|
+
direction: oppositeScrollDirection.value
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function reset() {
|
|
88
|
+
alerted.up.top.top = false;
|
|
89
|
+
alerted.up.top.bottom = false;
|
|
90
|
+
alerted.up.bottom.top = false;
|
|
91
|
+
alerted.up.bottom.bottom = false;
|
|
92
|
+
alerted.down.top.top = false;
|
|
93
|
+
alerted.down.top.bottom = false;
|
|
94
|
+
alerted.down.bottom.top = false;
|
|
95
|
+
alerted.down.bottom.bottom = false;
|
|
96
|
+
}
|
|
97
|
+
function observeItem(args2) {
|
|
98
|
+
const { childEdge, parentEdge, direction } = args2;
|
|
99
|
+
if (alerted[direction][childEdge][parentEdge]) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const offset2 = mappedOffset[parentEdge];
|
|
103
|
+
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
104
|
+
const mappedParentEdge = toValue(parentBoundingRect[parentEdge]) + offset2;
|
|
105
|
+
if (direction === "down" && mappedChildEdge <= mappedParentEdge || direction === "up" && mappedChildEdge >= mappedParentEdge) {
|
|
106
|
+
alerted[direction][childEdge][parentEdge] = true;
|
|
107
|
+
useMagicEmitter().emit("collision", {
|
|
108
|
+
id,
|
|
109
|
+
direction,
|
|
110
|
+
parentEdge,
|
|
111
|
+
childEdge
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function resetItem(args2) {
|
|
116
|
+
const { childEdge, parentEdge, direction } = args2;
|
|
117
|
+
if (!alerted[direction][childEdge][parentEdge]) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const offset2 = mappedOffset[parentEdge];
|
|
121
|
+
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
122
|
+
const mappedParentEdge = toValue(parentBoundingRect[parentEdge]) + offset2;
|
|
123
|
+
if (direction === "down" && mappedChildEdge >= mappedParentEdge || direction === "up" && mappedChildEdge <= mappedParentEdge) {
|
|
124
|
+
alerted[direction][childEdge][parentEdge] = false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
observe
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type MaybeRef, type MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ScrollIntersection } from '../../types/index.js';
|
|
3
3
|
type UseScrollApiParams = {
|
|
4
4
|
child: MaybeRef<HTMLElement | null | undefined>;
|
|
5
5
|
parent: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
6
|
-
from:
|
|
7
|
-
to:
|
|
6
|
+
from: ScrollIntersection;
|
|
7
|
+
to: ScrollIntersection;
|
|
8
8
|
};
|
|
9
9
|
export declare function useScrollApi(params: UseScrollApiParams): {
|
|
10
10
|
getCalculations: () => void;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
shallowRef,
|
|
4
|
+
inject,
|
|
5
|
+
toValue
|
|
6
|
+
} from "vue";
|
|
2
7
|
import { useWindowSize } from "@vueuse/core";
|
|
3
8
|
import { MagicScrollReturn } from "../../symbols/index.mjs";
|
|
4
9
|
import { clampValue } from "@maas/vue-equipment/utils";
|
|
5
10
|
export function useScrollApi(params) {
|
|
6
11
|
const { child, parent, from, to } = params;
|
|
7
12
|
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
8
|
-
const childRect = ref();
|
|
9
|
-
const parentRect = ref();
|
|
10
|
-
const start =
|
|
11
|
-
const end =
|
|
13
|
+
const childRect = ref(void 0);
|
|
14
|
+
const parentRect = ref(void 0);
|
|
15
|
+
const start = shallowRef(0);
|
|
16
|
+
const end = shallowRef(0);
|
|
17
|
+
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
12
18
|
function splitLocation(location) {
|
|
13
19
|
return {
|
|
14
20
|
child: location.match(/^[a-z]+/)[0],
|
|
@@ -30,7 +36,9 @@ export function useScrollApi(params) {
|
|
|
30
36
|
y += childRect.value.top + childRect.value.height + scrollY;
|
|
31
37
|
break;
|
|
32
38
|
}
|
|
33
|
-
if (!parentRect.value)
|
|
39
|
+
if (!parentRect.value) {
|
|
40
|
+
return y;
|
|
41
|
+
}
|
|
34
42
|
const dimensions = {
|
|
35
43
|
width: toValue(parentRect.value.width),
|
|
36
44
|
height: toValue(parentRect.value.height),
|
|
@@ -54,7 +62,11 @@ export function useScrollApi(params) {
|
|
|
54
62
|
}
|
|
55
63
|
function getCalculations() {
|
|
56
64
|
childRect.value = toValue(child)?.getBoundingClientRect();
|
|
57
|
-
parentRect.value = toValue(parent) ? toValue(parent)?.getBoundingClientRect() : {
|
|
65
|
+
parentRect.value = toValue(parent) ? toValue(parent)?.getBoundingClientRect() : {
|
|
66
|
+
width: windowWidth.value,
|
|
67
|
+
height: windowHeight.value,
|
|
68
|
+
top: 0
|
|
69
|
+
};
|
|
58
70
|
start.value = getOffsetTop(splitLocation(from));
|
|
59
71
|
end.value = getOffsetTop(splitLocation(to));
|
|
60
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey, Ref, MaybeRef } from 'vue';
|
|
2
2
|
import type { UseScrollReturn } from '@vueuse/core';
|
|
3
|
-
declare const
|
|
3
|
+
declare const MagicScrollTarget: InjectionKey<MaybeRef<HTMLElement | null | undefined>>;
|
|
4
4
|
declare const MagicScrollProgress: InjectionKey<Ref<number>>;
|
|
5
5
|
declare const MagicScrollReturn: InjectionKey<UseScrollReturn | undefined>;
|
|
6
|
-
export {
|
|
6
|
+
export { MagicScrollTarget, MagicScrollProgress, MagicScrollReturn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const MagicScrollTarget = Symbol();
|
|
2
2
|
const MagicScrollProgress = Symbol();
|
|
3
3
|
const MagicScrollReturn = Symbol();
|
|
4
|
-
export {
|
|
4
|
+
export { MagicScrollTarget, MagicScrollProgress, MagicScrollReturn };
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
width: number;
|
|
3
|
-
height: number;
|
|
4
|
-
};
|
|
1
|
+
import type { DOMKeyframesDefinition, AnimationOptions } from 'motion';
|
|
5
2
|
export type ScrollDirection = 'up' | 'down';
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) => number);
|
|
12
|
-
export interface MagicScrollCollisionEntry {
|
|
13
|
-
offset?: {
|
|
14
|
-
top: Offset;
|
|
15
|
-
bottom: Offset;
|
|
16
|
-
};
|
|
17
|
-
element?: string;
|
|
18
|
-
data: Record<string, unknown>;
|
|
3
|
+
export type CollisionEdge = 'top' | 'bottom';
|
|
4
|
+
export type ScrollIntersection = 'top-top' | 'top-center' | 'top-bottom' | 'center-top' | 'center-center' | 'center-bottom' | 'bottom-top' | 'bottom-center' | 'bottom-bottom';
|
|
5
|
+
export interface CollisionOffset {
|
|
6
|
+
top: number;
|
|
7
|
+
bottom: number;
|
|
19
8
|
}
|
|
20
|
-
export
|
|
9
|
+
export interface ScrollEvents {
|
|
21
10
|
collision: {
|
|
11
|
+
id: string;
|
|
22
12
|
direction: ScrollDirection;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
data?: Record<string, unknown>;
|
|
13
|
+
childEdge: CollisionEdge;
|
|
14
|
+
parentEdge: CollisionEdge;
|
|
26
15
|
};
|
|
27
|
-
}
|
|
16
|
+
}
|
|
17
|
+
export type MagicScrollSequence = [DOMKeyframesDefinition, AnimationOptions?][];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import MagicToast from './src/components/MagicToast.vue.js';
|
|
2
1
|
import { useMagicToast } from './src/composables/useMagicToast.js';
|
|
3
2
|
import type { Plugin } from 'vue';
|
|
3
|
+
import type { MagicToastOptions } from './src/types/index.js';
|
|
4
4
|
declare const MagicToastPlugin: Plugin;
|
|
5
|
-
export { MagicToastPlugin,
|
|
5
|
+
export { MagicToastPlugin, useMagicToast };
|
|
6
|
+
export type { MagicToastOptions };
|