@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -1
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +32 -25
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +61 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +10 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +9 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +8 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +148 -154
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +7 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +13 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +9 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +8 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +1 -0
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +8 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +42 -74
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +9 -14
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +0 -1
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +82 -100
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +103 -53
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +284 -323
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +18 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +8 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +6 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +180 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +10 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +8 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +13 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +9 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +8 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +2 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -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/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +10 -6
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -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/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +93 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +123 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +9 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +117 -103
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +134 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +17 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +20 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +118 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +179 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +24 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +59 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +19 -35
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +60 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +43 -91
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +75 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +6 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +24 -21
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +8 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +90 -109
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +7 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +53 -81
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +6 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +11 -7
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -3,30 +3,14 @@ interface MagicScrollCollisionProps {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
offset?: CollisionOffset;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
default?(_: {}): any;
|
|
10
|
-
};
|
|
11
|
-
refs: {
|
|
12
|
-
elRef: any;
|
|
13
|
-
};
|
|
14
|
-
rootEl: any;
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
declare const
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollCollisionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollCollisionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
12
|
export default _default;
|
|
20
|
-
type
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
14
|
new (): {
|
|
31
15
|
$slots: S;
|
|
32
16
|
};
|
|
@@ -1,81 +1,66 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="el" class="magic-scroll-motion">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { ref, inject, computed, onMounted, watch, useTemplateRef } from "vue";
|
|
5
9
|
import { unrefElement } from "@vueuse/core";
|
|
6
10
|
import defu from "defu";
|
|
7
11
|
import {
|
|
8
12
|
animate
|
|
9
13
|
} from "motion";
|
|
10
14
|
import { MagicScrollProgress } from "../symbols";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
import {} from "../types";
|
|
16
|
+
const { progress, sequence, sequenceOptions } = defineProps({
|
|
17
|
+
sequence: { type: Array, required: true },
|
|
18
|
+
sequenceOptions: { type: Object, required: false },
|
|
19
|
+
progress: { type: Number, required: false }
|
|
20
|
+
});
|
|
21
|
+
const animation = ref(void 0);
|
|
22
|
+
const elRef = useTemplateRef("el");
|
|
23
|
+
const injectedProgress = inject(
|
|
24
|
+
MagicScrollProgress,
|
|
25
|
+
computed(() => 0)
|
|
26
|
+
);
|
|
27
|
+
const mappedProgress = computed(() => {
|
|
28
|
+
return progress || injectedProgress.value || 0;
|
|
29
|
+
});
|
|
30
|
+
const defaultSequenceOptions = {
|
|
31
|
+
duration: 1,
|
|
32
|
+
delay: 0
|
|
33
|
+
};
|
|
34
|
+
const mappedSequenceOptions = defu(sequenceOptions, defaultSequenceOptions);
|
|
35
|
+
function createAnimation() {
|
|
36
|
+
const el = unrefElement(elRef);
|
|
37
|
+
if (!sequence || !sequence.length || !el) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const mappedSequence = sequence.map((item) => {
|
|
41
|
+
const [animation2 = [], options = {}] = item;
|
|
42
|
+
return [el, animation2, options];
|
|
43
|
+
});
|
|
44
|
+
animation.value = animate(mappedSequence, mappedSequenceOptions);
|
|
45
|
+
animation.value.pause();
|
|
46
|
+
animation.value.time = mappedProgress.value;
|
|
47
|
+
}
|
|
48
|
+
watch(mappedProgress, (value) => {
|
|
49
|
+
if (!value && value !== 0 || !animation.value) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
animation.value.time = value;
|
|
53
|
+
});
|
|
54
|
+
watch(
|
|
55
|
+
() => sequence,
|
|
56
|
+
() => {
|
|
57
|
+
createAnimation();
|
|
17
58
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const elRef = ref(void 0);
|
|
21
|
-
const injectedProgress = inject(
|
|
22
|
-
MagicScrollProgress,
|
|
23
|
-
computed(() => 0)
|
|
24
|
-
);
|
|
25
|
-
const mappedProgress = computed(() => {
|
|
26
|
-
return __props.progress || injectedProgress.value || 0;
|
|
27
|
-
});
|
|
28
|
-
const defaultSequenceOptions = {
|
|
29
|
-
duration: 1,
|
|
30
|
-
delay: 0
|
|
31
|
-
};
|
|
32
|
-
const mappedSequenceOptions = defu(__props.sequenceOptions, defaultSequenceOptions);
|
|
33
|
-
function createAnimation() {
|
|
34
|
-
const el = unrefElement(elRef);
|
|
35
|
-
if (!__props.sequence || !__props.sequence.length || !el) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const mappedSequence = __props.sequence.map((item) => {
|
|
39
|
-
const [animation2 = [], options = {}] = item;
|
|
40
|
-
return [el, animation2, options];
|
|
41
|
-
});
|
|
42
|
-
animation.value = animate(mappedSequence, mappedSequenceOptions);
|
|
43
|
-
animation.value.pause();
|
|
44
|
-
animation.value.time = mappedProgress.value;
|
|
45
|
-
}
|
|
46
|
-
watch(mappedProgress, (value) => {
|
|
47
|
-
if (!value && value !== 0 || !animation.value) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
animation.value.time = value;
|
|
51
|
-
});
|
|
52
|
-
watch(
|
|
53
|
-
() => __props.sequence,
|
|
54
|
-
() => {
|
|
55
|
-
createAnimation();
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
deep: true
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
onMounted(() => {
|
|
62
|
-
createAnimation();
|
|
63
|
-
});
|
|
64
|
-
return (_ctx, _cache) => {
|
|
65
|
-
return _openBlock(), _createElementBlock(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
ref_key: "elRef",
|
|
69
|
-
ref: elRef,
|
|
70
|
-
class: "magic-scroll-motion"
|
|
71
|
-
},
|
|
72
|
-
[
|
|
73
|
-
_renderSlot(_ctx.$slots, "default")
|
|
74
|
-
],
|
|
75
|
-
512
|
|
76
|
-
/* NEED_PATCH */
|
|
77
|
-
);
|
|
78
|
-
};
|
|
59
|
+
{
|
|
60
|
+
deep: true
|
|
79
61
|
}
|
|
62
|
+
);
|
|
63
|
+
onMounted(() => {
|
|
64
|
+
createAnimation();
|
|
80
65
|
});
|
|
81
66
|
</script>
|
|
@@ -5,30 +5,14 @@ interface MagicScrollMotionProps {
|
|
|
5
5
|
sequenceOptions?: SequenceOptions;
|
|
6
6
|
progress?: number;
|
|
7
7
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default?(_: {}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {
|
|
14
|
-
elRef: any;
|
|
15
|
-
};
|
|
16
|
-
rootEl: any;
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
11
|
};
|
|
18
|
-
|
|
19
|
-
declare const
|
|
20
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicScrollMotionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollMotionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
21
14
|
export default _default;
|
|
22
|
-
type
|
|
23
|
-
type __VLS_TypePropsToOption<T> = {
|
|
24
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
25
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
26
|
-
} : {
|
|
27
|
-
type: import('vue').PropType<T[K]>;
|
|
28
|
-
required: true;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
16
|
new (): {
|
|
33
17
|
$slots: S;
|
|
34
18
|
};
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="magic-scroll-provider">
|
|
3
|
+
<slot :scroll-return="scrollReturn" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
5
8
|
import { provide, computed } from "vue";
|
|
6
9
|
import { useScroll, unrefElement } from "@vueuse/core";
|
|
7
10
|
import { MagicScrollReturn, MagicScrollTarget } from "../symbols";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
}
|
|
11
|
+
const { target } = defineProps({
|
|
12
|
+
target: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
const mappedTarget = computed(() => {
|
|
15
|
+
switch (true) {
|
|
16
|
+
case !!target:
|
|
17
|
+
return unrefElement(target);
|
|
18
|
+
case typeof window !== "undefined":
|
|
19
|
+
return window;
|
|
20
|
+
default:
|
|
28
21
|
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
22
|
}
|
|
39
23
|
});
|
|
24
|
+
const providedTarget = computed(() => {
|
|
25
|
+
if (target) {
|
|
26
|
+
return unrefElement(target);
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
});
|
|
30
|
+
const scrollReturn = useScroll(mappedTarget);
|
|
31
|
+
provide(MagicScrollReturn, scrollReturn);
|
|
32
|
+
provide(MagicScrollTarget, providedTarget);
|
|
40
33
|
</script>
|
|
@@ -2,30 +2,33 @@ import { type MaybeElementRef } from '@vueuse/core';
|
|
|
2
2
|
interface MagicScrollProviderProps {
|
|
3
3
|
target?: MaybeElementRef<HTMLElement>;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
declare var __VLS_1: {
|
|
6
|
+
scrollReturn: {
|
|
7
|
+
x: import("vue").WritableComputedRef<number, number>;
|
|
8
|
+
y: import("vue").WritableComputedRef<number, number>;
|
|
9
|
+
isScrolling: import("vue").ShallowRef<boolean, boolean>;
|
|
10
|
+
arrivedState: {
|
|
11
|
+
left: boolean;
|
|
12
|
+
right: boolean;
|
|
13
|
+
top: boolean;
|
|
14
|
+
bottom: boolean;
|
|
15
|
+
};
|
|
16
|
+
directions: {
|
|
17
|
+
left: boolean;
|
|
18
|
+
right: boolean;
|
|
19
|
+
top: boolean;
|
|
20
|
+
bottom: boolean;
|
|
21
|
+
};
|
|
22
|
+
measure(): void;
|
|
11
23
|
};
|
|
12
|
-
refs: {};
|
|
13
|
-
rootEl: any;
|
|
14
24
|
};
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
-
export default _default;
|
|
19
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
20
|
-
type __VLS_TypePropsToOption<T> = {
|
|
21
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
22
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
23
|
-
} : {
|
|
24
|
-
type: import('vue').PropType<T[K]>;
|
|
25
|
-
required: true;
|
|
26
|
-
};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
default?: (props: typeof __VLS_1) => any;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
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>;
|
|
29
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
32
|
new (): {
|
|
30
33
|
$slots: S;
|
|
31
34
|
};
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="el" class="magic-scroll-scene">
|
|
3
|
+
<slot :progress="progress" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import {
|
|
9
|
+
shallowRef,
|
|
10
|
+
provide,
|
|
11
|
+
inject,
|
|
12
|
+
watch,
|
|
13
|
+
nextTick,
|
|
14
|
+
readonly,
|
|
15
|
+
useTemplateRef
|
|
16
|
+
} from "vue";
|
|
5
17
|
import { useIntersectionObserver } from "@vueuse/core";
|
|
6
18
|
import { useScrollApi } from "../composables/private/useScrollApi";
|
|
7
19
|
import {
|
|
@@ -9,73 +21,53 @@ import {
|
|
|
9
21
|
MagicScrollProgress,
|
|
10
22
|
MagicScrollReturn
|
|
11
23
|
} from "../symbols";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
const { from = "top-bottom", to = "bottom-top" } = defineProps({
|
|
25
|
+
from: { type: String, required: false },
|
|
26
|
+
to: { type: String, required: false }
|
|
27
|
+
});
|
|
28
|
+
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
29
|
+
const scrollTarget = inject(MagicScrollTarget, void 0);
|
|
30
|
+
if (!scrollTarget) {
|
|
31
|
+
console.error("MagicScrollScene must be used within a MagicScrollProvider");
|
|
32
|
+
}
|
|
33
|
+
const progress = shallowRef(0);
|
|
34
|
+
const intersecting = shallowRef(false);
|
|
35
|
+
const elRef = useTemplateRef("el");
|
|
36
|
+
const { getCalculations, getProgress } = useScrollApi({
|
|
37
|
+
child: elRef,
|
|
38
|
+
parent: scrollTarget,
|
|
39
|
+
from,
|
|
40
|
+
to
|
|
41
|
+
});
|
|
42
|
+
async function calculate() {
|
|
43
|
+
getCalculations();
|
|
44
|
+
await nextTick();
|
|
45
|
+
progress.value = getProgress();
|
|
46
|
+
}
|
|
47
|
+
watch(
|
|
48
|
+
() => scrollReturn?.y.value,
|
|
49
|
+
() => {
|
|
50
|
+
if (intersecting.value) {
|
|
51
|
+
calculate();
|
|
37
52
|
}
|
|
38
|
-
watch(
|
|
39
|
-
() => scrollReturn?.y.value,
|
|
40
|
-
() => {
|
|
41
|
-
if (intersecting.value) {
|
|
42
|
-
calculate();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
watch(
|
|
47
|
-
() => scrollReturn?.y.value,
|
|
48
|
-
() => {
|
|
49
|
-
calculate();
|
|
50
|
-
},
|
|
51
|
-
{ once: true }
|
|
52
|
-
);
|
|
53
|
-
useIntersectionObserver(
|
|
54
|
-
elRef,
|
|
55
|
-
([{ isIntersecting }]) => {
|
|
56
|
-
intersecting.value = isIntersecting;
|
|
57
|
-
if (isIntersecting) {
|
|
58
|
-
calculate();
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{ rootMargin: "150% 0px 150% 0px", immediate: true }
|
|
62
|
-
);
|
|
63
|
-
provide(MagicScrollProgress, readonly(progress));
|
|
64
|
-
return (_ctx, _cache) => {
|
|
65
|
-
return _openBlock(), _createElementBlock(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
ref_key: "elRef",
|
|
69
|
-
ref: elRef,
|
|
70
|
-
class: "magic-scroll-scene"
|
|
71
|
-
},
|
|
72
|
-
[
|
|
73
|
-
_renderSlot(_ctx.$slots, "default", { progress: progress.value })
|
|
74
|
-
],
|
|
75
|
-
512
|
|
76
|
-
/* NEED_PATCH */
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
53
|
}
|
|
80
|
-
|
|
54
|
+
);
|
|
55
|
+
watch(
|
|
56
|
+
() => scrollReturn?.y.value,
|
|
57
|
+
() => {
|
|
58
|
+
calculate();
|
|
59
|
+
},
|
|
60
|
+
{ once: true }
|
|
61
|
+
);
|
|
62
|
+
useIntersectionObserver(
|
|
63
|
+
elRef,
|
|
64
|
+
([{ isIntersecting }]) => {
|
|
65
|
+
intersecting.value = isIntersecting;
|
|
66
|
+
if (isIntersecting) {
|
|
67
|
+
calculate();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{ rootMargin: "150% 0px 150% 0px", immediate: true }
|
|
71
|
+
);
|
|
72
|
+
provide(MagicScrollProgress, readonly(progress));
|
|
81
73
|
</script>
|
|
@@ -3,32 +3,16 @@ interface MagicScrollSceneProps {
|
|
|
3
3
|
from?: ScrollIntersection;
|
|
4
4
|
to?: ScrollIntersection;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
slots: {
|
|
9
|
-
default?(_: {
|
|
10
|
-
progress: any;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {
|
|
14
|
-
elRef: any;
|
|
15
|
-
};
|
|
16
|
-
rootEl: any;
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
progress: number;
|
|
17
8
|
};
|
|
18
|
-
type
|
|
19
|
-
|
|
20
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
-
export default _default;
|
|
22
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
23
|
-
type __VLS_TypePropsToOption<T> = {
|
|
24
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
25
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
26
|
-
} : {
|
|
27
|
-
type: import('vue').PropType<T[K]>;
|
|
28
|
-
required: true;
|
|
29
|
-
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
30
11
|
};
|
|
31
|
-
|
|
12
|
+
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>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
16
|
new (): {
|
|
33
17
|
$slots: S;
|
|
34
18
|
};
|
|
@@ -2,8 +2,8 @@ import { type MaybeRef } from 'vue';
|
|
|
2
2
|
import type { CollisionOffset } from '../../types/index.js';
|
|
3
3
|
type UseCollisionDetectionArgs = {
|
|
4
4
|
id: string;
|
|
5
|
-
child: MaybeRef<HTMLElement |
|
|
6
|
-
parent: MaybeRef<HTMLElement | undefined>;
|
|
5
|
+
child: MaybeRef<HTMLElement | null>;
|
|
6
|
+
parent: MaybeRef<HTMLElement | null | undefined>;
|
|
7
7
|
scrollY: MaybeRef<number>;
|
|
8
8
|
offset?: CollisionOffset;
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useElementBounding } from "@vueuse/core";
|
|
1
|
+
import { shallowRef, reactive, computed, toValue } from "vue";
|
|
2
|
+
import { useElementBounding, useWindowSize } from "@vueuse/core";
|
|
3
3
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
4
4
|
export function useCollisionDetection(args) {
|
|
5
5
|
const { id, scrollY, child, parent, offset } = args;
|
|
@@ -25,11 +25,21 @@ export function useCollisionDetection(args) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
+
const { width, height } = useWindowSize();
|
|
29
|
+
const windowBoundingRect = {
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
right: width,
|
|
33
|
+
bottom: height,
|
|
34
|
+
top: shallowRef(0),
|
|
35
|
+
left: shallowRef(0)
|
|
36
|
+
};
|
|
28
37
|
const childBoundingRect = useElementBounding(child);
|
|
29
38
|
const parentBoundingRect = useElementBounding(parent);
|
|
39
|
+
const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
|
|
30
40
|
const mappedOffset = { top: 0, bottom: 0, ...offset };
|
|
31
|
-
const lastScrollY =
|
|
32
|
-
const scrollDirection =
|
|
41
|
+
const lastScrollY = shallowRef(0);
|
|
42
|
+
const scrollDirection = shallowRef();
|
|
33
43
|
const oppositeScrollDirection = computed(
|
|
34
44
|
() => scrollDirection.value === "up" ? "down" : "up"
|
|
35
45
|
);
|
|
@@ -101,7 +111,7 @@ export function useCollisionDetection(args) {
|
|
|
101
111
|
}
|
|
102
112
|
const offset2 = mappedOffset[parentEdge];
|
|
103
113
|
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
104
|
-
const mappedParentEdge = toValue(
|
|
114
|
+
const mappedParentEdge = toValue(mappedParentBoundingRect[parentEdge]) + offset2;
|
|
105
115
|
if (direction === "down" && mappedChildEdge <= mappedParentEdge || direction === "up" && mappedChildEdge >= mappedParentEdge) {
|
|
106
116
|
alerted[direction][childEdge][parentEdge] = true;
|
|
107
117
|
useMagicEmitter().emit("collision", {
|
|
@@ -119,7 +129,7 @@ export function useCollisionDetection(args) {
|
|
|
119
129
|
}
|
|
120
130
|
const offset2 = mappedOffset[parentEdge];
|
|
121
131
|
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
122
|
-
const mappedParentEdge = toValue(
|
|
132
|
+
const mappedParentEdge = toValue(mappedParentBoundingRect[parentEdge]) + offset2;
|
|
123
133
|
if (direction === "down" && mappedChildEdge >= mappedParentEdge || direction === "up" && mappedChildEdge <= mappedParentEdge) {
|
|
124
134
|
alerted[direction][childEdge][parentEdge] = false;
|
|
125
135
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type MaybeRef, type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { ScrollIntersection } from '../../types/index.js';
|
|
3
|
-
type
|
|
3
|
+
type UseScrollApiArgs = {
|
|
4
4
|
child: MaybeRef<HTMLElement | null | undefined>;
|
|
5
5
|
parent: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
6
6
|
from: ScrollIntersection;
|
|
7
7
|
to: ScrollIntersection;
|
|
8
8
|
};
|
|
9
|
-
export declare function useScrollApi(
|
|
9
|
+
export declare function useScrollApi(args: UseScrollApiArgs): {
|
|
10
10
|
getCalculations: () => void;
|
|
11
11
|
getProgress: () => number;
|
|
12
12
|
};
|