@maas/vue-equipment 1.0.0-beta.4 → 1.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/useCountdown/index.d.ts +23 -0
- package/dist/composables/useCountdown/index.js +133 -0
- package/dist/composables/useCountdown/index.js.map +1 -0
- package/dist/composables/useEasings/index.d.ts +21 -0
- package/dist/composables/useEasings/index.js +40 -0
- package/dist/composables/useEasings/index.js.map +1 -0
- package/dist/composables/useMetaViewport/index.d.ts +9 -0
- package/dist/composables/useMetaViewport/index.js +29 -0
- package/dist/composables/useMetaViewport/index.js.map +1 -0
- package/dist/composables/useScrollTo/index.d.ts +49 -0
- package/dist/composables/useScrollTo/index.js +152 -0
- package/dist/composables/useScrollTo/index.js.map +1 -0
- package/dist/nuxt/module.d.mts +4 -3
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +55 -35
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.d.vue.ts +26 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +70 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +11 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +18 -32
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.d.vue.ts +23 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +62 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +10 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.d.vue.ts +20 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +40 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +9 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +4 -4
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +9 -8
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.d.ts +1 -5
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +3 -3
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.d.vue.ts +15 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +164 -152
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +9 -15
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +50 -54
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.d.vue.ts +27 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +89 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +15 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.d.vue.ts +17 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +39 -49
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +7 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +75 -76
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.d.vue.ts +3 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +30 -40
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +88 -85
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +10 -61
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.d.vue.ts +19 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +44 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +9 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +11 -13
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +63 -44
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +21 -4
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.d.vue.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +43 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +9 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +7 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.d.vue.ts +17 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +47 -73
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +11 -15
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +1 -1
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +12 -4
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +10 -6
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.d.vue.ts +19 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +92 -101
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +7 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +63 -66
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +37 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +114 -56
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/composables/useMagicDraggable.mjs +1 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.d.vue.ts +31 -0
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +290 -324
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +19 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +37 -15
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +16 -5
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +55 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +3 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerUtils.mjs +21 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +7 -2
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicError/index.d.ts +5 -0
- package/dist/plugins/MagicError/index.mjs +3 -0
- package/dist/plugins/MagicError/nuxt.d.ts +2 -0
- package/dist/plugins/MagicError/nuxt.mjs +12 -0
- package/dist/plugins/MagicError/package.json +40 -0
- package/dist/plugins/MagicError/src/MagicError.mjs +0 -0
- package/dist/plugins/MagicError/src/class/MagicError.d.ts +6 -0
- package/dist/plugins/MagicError/src/class/MagicError.mjs +15 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.d.ts +18 -0
- package/dist/plugins/MagicError/src/composables/useMagicError.mjs +31 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.d.vue.ts +21 -0
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +9 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.d.vue.ts +17 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +60 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +7 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +189 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -26
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.d.vue.ts +26 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +103 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +7 -57
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.d.vue.ts +25 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +69 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +10 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.d.vue.ts +24 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +99 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +12 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.d.vue.ts +20 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +57 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +11 -24
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +38 -16
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +12 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +45 -18
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +31 -10
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +4 -4
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.d.vue.ts +24 -0
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +11 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +1 -1
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +37 -15
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.d.vue.ts +8 -0
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +17 -9
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.d.vue.ts +8 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +181 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +8 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +35 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +103 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.d.vue.ts +18 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +129 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +10 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +38 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.d.vue.ts +6 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +131 -102
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +2 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.d.vue.ts +25 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +140 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +18 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.d.vue.ts +13 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +26 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +7 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.d.vue.ts +19 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +7 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +66 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +128 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.d.vue.ts +36 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +185 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +25 -34
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.d.vue.ts +3 -0
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +2 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +113 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +113 -49
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +62 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +50 -93
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-overlay.css +0 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +77 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +7 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.d.vue.ts +18 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +60 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +7 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.d.vue.ts +36 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +25 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.d.vue.ts +20 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +71 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +9 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +17 -7
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.d.vue.ts +15 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +91 -110
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +8 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.d.vue.ts +17 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +66 -82
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +7 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +9 -7
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +36 -16
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/types/index.d.ts +11 -11
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +42 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +25 -21
- package/dist/composables/index.d.ts +0 -97
- package/dist/composables/index.js +0 -338
- package/dist/composables/index.js.map +0 -1
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/.turbo/turbo-lint.log +0 -13
- package/dist/plugins/.turbo/turbo-release.log +0 -7
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/plugins/index.d.ts +0 -13
- package/dist/plugins/index.mjs +0 -13
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/plugins/{.turbo/turbo-build.log → MagicError/src/MagicError.d.ts} +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.d.ts +0 -0
- /package/dist/plugins/MagicToast/{symbols → src/symbols}/index.mjs +0 -0
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MagicNoiseOptions } from '../types/index.js';
|
|
2
|
+
interface MagicNoiseProps {
|
|
3
|
+
options?: MagicNoiseOptions;
|
|
4
|
+
pause?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -1,87 +1,56 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="magic-noise" :data-loading="!isReady">
|
|
3
|
+
<div class="magic-noise__inner">
|
|
4
|
+
<canvas ref="canvas" class="magic-noise__canvas" />
|
|
5
|
+
<canvas ref="offCanvas" class="magic-noise__off-canvas" />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { onMounted, onUnmounted, watch, useTemplateRef } from "vue";
|
|
7
12
|
import { useResizeObserver, useDebounceFn } from "@vueuse/core";
|
|
8
13
|
import { useNoiseApi } from "../composables/private/useNoiseApi";
|
|
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
|
-
() => __props.pause,
|
|
34
|
-
(pause) => {
|
|
35
|
-
if (pause) {
|
|
36
|
-
drawControls.value?.pause();
|
|
37
|
-
transferControls.value?.pause();
|
|
38
|
-
} else {
|
|
39
|
-
drawControls.value?.resume();
|
|
40
|
-
transferControls.value?.resume();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
onMounted(() => {
|
|
45
|
-
throttledDraw();
|
|
46
|
-
throttledRotateAndTransfer();
|
|
47
|
-
});
|
|
48
|
-
onUnmounted(() => {
|
|
49
|
-
isReady.value = false;
|
|
50
|
-
transferControls.value?.pause();
|
|
14
|
+
const { pause = false, options } = defineProps({
|
|
15
|
+
options: { type: Object, required: false },
|
|
16
|
+
pause: { type: Boolean, required: false }
|
|
17
|
+
});
|
|
18
|
+
const canvasRef = useTemplateRef("canvas");
|
|
19
|
+
const offCanvasRef = useTemplateRef("offCanvas");
|
|
20
|
+
const noiseApi = useNoiseApi({
|
|
21
|
+
canvasRef,
|
|
22
|
+
offCanvasRef,
|
|
23
|
+
options
|
|
24
|
+
});
|
|
25
|
+
const {
|
|
26
|
+
initialize,
|
|
27
|
+
drawControls,
|
|
28
|
+
transferControls,
|
|
29
|
+
throttledDraw,
|
|
30
|
+
throttledRotateAndTransfer,
|
|
31
|
+
isReady
|
|
32
|
+
} = noiseApi;
|
|
33
|
+
useResizeObserver(canvasRef, useDebounceFn(initialize, 100));
|
|
34
|
+
watch(
|
|
35
|
+
() => pause,
|
|
36
|
+
(pause2) => {
|
|
37
|
+
if (pause2) {
|
|
51
38
|
drawControls.value?.pause();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
_createElementVNode("div", _hoisted_2, [
|
|
59
|
-
_createElementVNode(
|
|
60
|
-
"canvas",
|
|
61
|
-
{
|
|
62
|
-
ref_key: "canvasRef",
|
|
63
|
-
ref: canvasRef,
|
|
64
|
-
class: "magic-noise__canvas"
|
|
65
|
-
},
|
|
66
|
-
null,
|
|
67
|
-
512
|
|
68
|
-
/* NEED_PATCH */
|
|
69
|
-
),
|
|
70
|
-
_createElementVNode(
|
|
71
|
-
"canvas",
|
|
72
|
-
{
|
|
73
|
-
ref_key: "offCanvasRef",
|
|
74
|
-
ref: offCanvasRef,
|
|
75
|
-
class: "magic-noise__off-canvas"
|
|
76
|
-
},
|
|
77
|
-
null,
|
|
78
|
-
512
|
|
79
|
-
/* NEED_PATCH */
|
|
80
|
-
)
|
|
81
|
-
])
|
|
82
|
-
], 8, _hoisted_1);
|
|
83
|
-
};
|
|
39
|
+
transferControls.value?.pause();
|
|
40
|
+
} else {
|
|
41
|
+
drawControls.value?.resume();
|
|
42
|
+
transferControls.value?.resume();
|
|
43
|
+
}
|
|
84
44
|
}
|
|
45
|
+
);
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
throttledDraw();
|
|
48
|
+
throttledRotateAndTransfer();
|
|
49
|
+
});
|
|
50
|
+
onUnmounted(() => {
|
|
51
|
+
isReady.value = false;
|
|
52
|
+
transferControls.value?.pause();
|
|
53
|
+
drawControls.value?.pause();
|
|
85
54
|
});
|
|
86
55
|
</script>
|
|
87
56
|
|
|
@@ -94,7 +63,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
94
63
|
position: relative;
|
|
95
64
|
user-select: none;
|
|
96
65
|
transition: var(--magic-noise-loading-transition);
|
|
97
|
-
background: var(--magic-noise-background,
|
|
66
|
+
background: var(--magic-noise-background, #000);
|
|
98
67
|
&[data-loading='true'] {
|
|
99
68
|
background: var(--magic-noise-loading-background, #000);
|
|
100
69
|
& > .magic-noise__inner {
|
|
@@ -3,14 +3,6 @@ interface MagicNoiseProps {
|
|
|
3
3
|
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
7
8
|
export default _default;
|
|
8
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
-
type __VLS_TypePropsToOption<T> = {
|
|
10
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
-
} : {
|
|
13
|
-
type: import('vue').PropType<T[K]>;
|
|
14
|
-
required: true;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicNoiseOptions, RafControls } from '../../types/index.js';
|
|
3
3
|
type UseNoiseApiArgs = {
|
|
4
|
-
canvasRef: Ref<HTMLCanvasElement |
|
|
5
|
-
offCanvasRef: Ref<HTMLCanvasElement |
|
|
4
|
+
canvasRef: Ref<HTMLCanvasElement | null>;
|
|
5
|
+
offCanvasRef: Ref<HTMLCanvasElement | null>;
|
|
6
6
|
options?: MaybeRef<MagicNoiseOptions>;
|
|
7
7
|
};
|
|
8
8
|
export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNoiseApiArgs): {
|
|
@@ -11,7 +11,7 @@ export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNo
|
|
|
11
11
|
rotateAndTransfer: () => void;
|
|
12
12
|
throttledDraw: () => void;
|
|
13
13
|
throttledRotateAndTransfer: () => void;
|
|
14
|
-
isReady:
|
|
14
|
+
isReady: import("vue").ShallowRef<boolean, boolean>;
|
|
15
15
|
drawControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
16
16
|
transferControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowRef,
|
|
1
|
+
import { shallowRef, reactive } from "vue";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import {
|
|
4
4
|
useElementSize,
|
|
@@ -14,7 +14,7 @@ export function useNoiseApi({
|
|
|
14
14
|
}) {
|
|
15
15
|
const tiles = shallowRef([]);
|
|
16
16
|
const pixels = shallowRef([]);
|
|
17
|
-
const isReady =
|
|
17
|
+
const isReady = shallowRef(false);
|
|
18
18
|
const context = shallowRef(null);
|
|
19
19
|
const offContext = shallowRef(null);
|
|
20
20
|
const { width, height } = useElementSize(canvasRef);
|
|
@@ -57,7 +57,7 @@ export function useNoiseApi({
|
|
|
57
57
|
for (let x = 0; x < width2; x += pixelSize) {
|
|
58
58
|
let radian;
|
|
59
59
|
if (rotation) {
|
|
60
|
-
const angle = getRandomRotationAngle();
|
|
60
|
+
const angle = getRandomRotationAngle() ?? 0;
|
|
61
61
|
radian = getRadianFromAngle(angle);
|
|
62
62
|
}
|
|
63
63
|
const pixel = {
|
|
@@ -75,7 +75,9 @@ export function useNoiseApi({
|
|
|
75
75
|
function calculate() {
|
|
76
76
|
const offCanvasHeight = offCanvasRef.value?.height;
|
|
77
77
|
const offCanvasWidth = offCanvasRef.value?.width;
|
|
78
|
-
if (!offCanvasHeight || !offCanvasWidth)
|
|
78
|
+
if (!offCanvasHeight || !offCanvasWidth) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
79
81
|
pixels.value = calculatePixels({
|
|
80
82
|
width: offCanvasWidth,
|
|
81
83
|
height: offCanvasHeight,
|
|
@@ -93,7 +95,9 @@ export function useNoiseApi({
|
|
|
93
95
|
}
|
|
94
96
|
function initialize() {
|
|
95
97
|
resetContexts();
|
|
96
|
-
if (!canvasRef.value || !offCanvasRef.value)
|
|
98
|
+
if (!canvasRef.value || !offCanvasRef.value) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
97
101
|
const maxCanvasDim = Math.max(width.value, height.value) * pixelRatio.value;
|
|
98
102
|
const maxOffCanvasDim = maxCanvasDim / Math.sqrt(mappedOptions.tiles);
|
|
99
103
|
const adjustedOffCanvasDim = findBiggerNumber(
|
|
@@ -105,11 +109,13 @@ export function useNoiseApi({
|
|
|
105
109
|
offCanvasRef.value.width = dimensions.offWidth = adjustedOffCanvasDim;
|
|
106
110
|
offCanvasRef.value.height = dimensions.offHeight = adjustedOffCanvasDim;
|
|
107
111
|
context.value = canvasRef.value.getContext("2d", {
|
|
108
|
-
alpha:
|
|
112
|
+
alpha: mappedOptions.alpha,
|
|
113
|
+
colorSpace: mappedOptions.colorSpace
|
|
109
114
|
});
|
|
110
115
|
offContext.value = offCanvasRef.value.getContext("2d", {
|
|
111
|
-
alpha:
|
|
112
|
-
willReadFrequently: true
|
|
116
|
+
alpha: mappedOptions.alpha,
|
|
117
|
+
willReadFrequently: true,
|
|
118
|
+
colorSpace: mappedOptions.colorSpace
|
|
113
119
|
});
|
|
114
120
|
resetPixels();
|
|
115
121
|
calculate();
|
|
@@ -140,7 +146,9 @@ export function useNoiseApi({
|
|
|
140
146
|
transferControls.value = useRafFn(throttled);
|
|
141
147
|
}
|
|
142
148
|
function draw() {
|
|
143
|
-
if (!offContext.value || !offCanvasRef.value)
|
|
149
|
+
if (!offContext.value || !offCanvasRef.value) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
144
152
|
offContext.value.clearRect(
|
|
145
153
|
0,
|
|
146
154
|
0,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import MagicPie from './src/components/MagicPie.vue.js';
|
|
2
|
+
import { useMagicPie } from './src/composables/useMagicPie.js';
|
|
3
|
+
import type { Plugin } from 'vue';
|
|
4
|
+
import type { MagicPieOptions } from './src/types/index.js';
|
|
5
|
+
declare const MagicPiePlugin: Plugin;
|
|
6
|
+
export { MagicPiePlugin, MagicPie, useMagicPie };
|
|
7
|
+
export type { MagicPieOptions };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import MagicPie from "./src/components/MagicPie.vue";
|
|
2
|
+
import { useMagicPie } from "./src/composables/useMagicPie.mjs";
|
|
3
|
+
const MagicPiePlugin = {
|
|
4
|
+
install: (app) => {
|
|
5
|
+
app.component("MagicPie", MagicPie);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export { MagicPiePlugin, MagicPie, useMagicPie };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineNuxtModule,
|
|
3
|
+
createResolver,
|
|
4
|
+
addComponent,
|
|
5
|
+
addImports
|
|
6
|
+
} from "@nuxt/kit";
|
|
7
|
+
export default defineNuxtModule({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "@maas/vue-equipment/nuxt/MagicPie"
|
|
10
|
+
},
|
|
11
|
+
setup() {
|
|
12
|
+
const resolver = createResolver(import.meta.url);
|
|
13
|
+
addComponent({
|
|
14
|
+
filePath: resolver.resolve("src/components/MagicPie.vue"),
|
|
15
|
+
name: "MagicPie",
|
|
16
|
+
global: true
|
|
17
|
+
});
|
|
18
|
+
addImports({
|
|
19
|
+
from: "@maas/vue-equipment/plugins/MagicPie",
|
|
20
|
+
name: "useMagicPie"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MagicPieOptions } from '../types/index.js';
|
|
2
|
+
interface MagicPieProps {
|
|
3
|
+
id: string;
|
|
4
|
+
options?: MagicPieOptions;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<MagicPieProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPieProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="magic-pie" :data-flip="options?.flip" :data-id="id">
|
|
3
|
+
<svg
|
|
4
|
+
id="magic-pie__svg"
|
|
5
|
+
viewBox="0 0 100 100"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<mask id="magic-pie__mask">
|
|
9
|
+
<circle cx="50" cy="50" r="50" fill="white" />
|
|
10
|
+
</mask>
|
|
11
|
+
<g mask="url(#magic-pie__mask)">
|
|
12
|
+
<rect width="100" height="100" />
|
|
13
|
+
<path :d="path" />
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { computed, toRefs, onBeforeUnmount } from "vue";
|
|
21
|
+
import {
|
|
22
|
+
useMagicError
|
|
23
|
+
} from "@maas/vue-equipment/plugins/MagicError";
|
|
24
|
+
import { usePieState } from "../composables/private/usePieState";
|
|
25
|
+
const { id, options } = defineProps({
|
|
26
|
+
id: { type: String, required: true },
|
|
27
|
+
options: { type: Object, required: false }
|
|
28
|
+
});
|
|
29
|
+
const magicError = useMagicError({
|
|
30
|
+
prefix: "MagicPie",
|
|
31
|
+
source: "MagicPie"
|
|
32
|
+
});
|
|
33
|
+
const { initializeState, deleteState } = usePieState(id);
|
|
34
|
+
const state = initializeState();
|
|
35
|
+
const { percentage } = toRefs(state);
|
|
36
|
+
function generatePath(points) {
|
|
37
|
+
if (points.length < 2) {
|
|
38
|
+
magicError.throwError({
|
|
39
|
+
message: "At least two points are required to generate a path",
|
|
40
|
+
errorCode: "missing_points"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
let path2 = `M ${points[0][0]} ${points[0][1]}`;
|
|
44
|
+
for (let i = 1; i < points.length; i++) {
|
|
45
|
+
path2 += ` L ${points[i][0]} ${points[i][1]}`;
|
|
46
|
+
}
|
|
47
|
+
return path2;
|
|
48
|
+
}
|
|
49
|
+
function generatePie(percentage2, flip) {
|
|
50
|
+
if (percentage2 < 0 || percentage2 > 100) {
|
|
51
|
+
magicError.throwError({
|
|
52
|
+
message: "percentage needs to be between 0 and 100",
|
|
53
|
+
errorCode: "invalid_percentage"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const size = 100;
|
|
57
|
+
const points = [
|
|
58
|
+
[size / 2, size / 2],
|
|
59
|
+
[size / 2, 0]
|
|
60
|
+
];
|
|
61
|
+
function getEndpoint(percentage3, size2) {
|
|
62
|
+
const circumference = size2 * 4;
|
|
63
|
+
const distance = percentage3 / 100 * circumference;
|
|
64
|
+
if (distance === 0) {
|
|
65
|
+
return [size2 / 2, 0];
|
|
66
|
+
}
|
|
67
|
+
const position = Math.floor(distance / (size2 / 2)) % 8;
|
|
68
|
+
const remainingDistance = distance % (size2 / 2);
|
|
69
|
+
let x = 0;
|
|
70
|
+
let y = 0;
|
|
71
|
+
switch (position) {
|
|
72
|
+
case 0:
|
|
73
|
+
x = size2 / 2 + remainingDistance;
|
|
74
|
+
y = 0;
|
|
75
|
+
break;
|
|
76
|
+
case 1:
|
|
77
|
+
x = size2;
|
|
78
|
+
y = remainingDistance;
|
|
79
|
+
break;
|
|
80
|
+
case 2:
|
|
81
|
+
x = size2;
|
|
82
|
+
y = size2 / 2 + remainingDistance;
|
|
83
|
+
break;
|
|
84
|
+
case 3:
|
|
85
|
+
x = size2 - remainingDistance;
|
|
86
|
+
y = size2;
|
|
87
|
+
break;
|
|
88
|
+
case 4:
|
|
89
|
+
x = size2 / 2 - remainingDistance;
|
|
90
|
+
y = size2;
|
|
91
|
+
break;
|
|
92
|
+
case 5:
|
|
93
|
+
x = 0;
|
|
94
|
+
y = size2 - remainingDistance;
|
|
95
|
+
break;
|
|
96
|
+
case 6:
|
|
97
|
+
x = 0;
|
|
98
|
+
y = size2 / 2 - remainingDistance;
|
|
99
|
+
break;
|
|
100
|
+
case 7:
|
|
101
|
+
x = remainingDistance;
|
|
102
|
+
y = 0;
|
|
103
|
+
}
|
|
104
|
+
return [x, y];
|
|
105
|
+
}
|
|
106
|
+
if (flip) {
|
|
107
|
+
if (100 - percentage2 >= 12.5) {
|
|
108
|
+
points.push([0, 0]);
|
|
109
|
+
}
|
|
110
|
+
if (100 - percentage2 >= 25) {
|
|
111
|
+
points.push([0, size / 2]);
|
|
112
|
+
}
|
|
113
|
+
if (100 - percentage2 >= 37.5) {
|
|
114
|
+
points.push([0, size]);
|
|
115
|
+
}
|
|
116
|
+
if (100 - percentage2 >= 50) {
|
|
117
|
+
points.push([size / 2, size]);
|
|
118
|
+
}
|
|
119
|
+
if (100 - percentage2 >= 62.5) {
|
|
120
|
+
points.push([size, size]);
|
|
121
|
+
}
|
|
122
|
+
if (100 - percentage2 >= 75) {
|
|
123
|
+
points.push([size, size / 2]);
|
|
124
|
+
}
|
|
125
|
+
if (100 - percentage2 >= 87.5) {
|
|
126
|
+
points.push([size, 0]);
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (percentage2 >= 12.5) {
|
|
130
|
+
points.push([size, 0]);
|
|
131
|
+
}
|
|
132
|
+
if (percentage2 >= 25) {
|
|
133
|
+
points.push([size, size / 2]);
|
|
134
|
+
}
|
|
135
|
+
if (percentage2 >= 37.5) {
|
|
136
|
+
points.push([size, size]);
|
|
137
|
+
}
|
|
138
|
+
if (percentage2 >= 50) {
|
|
139
|
+
points.push([size / 2, size]);
|
|
140
|
+
}
|
|
141
|
+
if (percentage2 >= 62.5) {
|
|
142
|
+
points.push([0, size]);
|
|
143
|
+
}
|
|
144
|
+
if (percentage2 >= 75) {
|
|
145
|
+
points.push([0, size / 2]);
|
|
146
|
+
}
|
|
147
|
+
if (percentage2 >= 87.5) {
|
|
148
|
+
points.push([0, 0]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
points.push(getEndpoint(percentage2, size));
|
|
152
|
+
return generatePath(points);
|
|
153
|
+
}
|
|
154
|
+
const path = computed(() => {
|
|
155
|
+
return generatePie(percentage.value, options?.flip);
|
|
156
|
+
});
|
|
157
|
+
onBeforeUnmount(() => {
|
|
158
|
+
deleteState();
|
|
159
|
+
});
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<style>
|
|
163
|
+
.magic-pie {
|
|
164
|
+
position: relative;
|
|
165
|
+
|
|
166
|
+
& path {
|
|
167
|
+
fill: var(--magic-pie-foreground, currentColor);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
& rect {
|
|
171
|
+
fill: var(--magic-pie-background, transparent);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#magic-pie__svg {
|
|
176
|
+
width: 100%;
|
|
177
|
+
height: 100%;
|
|
178
|
+
margin-left: auto;
|
|
179
|
+
margin-right: auto;
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MagicPieOptions } from '../types/index.js';
|
|
2
|
+
interface MagicPieProps {
|
|
3
|
+
id: string;
|
|
4
|
+
options?: MagicPieOptions;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<MagicPieProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPieProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ref, reactive, toValue } from "vue";
|
|
2
|
+
const pieStateStore = ref([]);
|
|
3
|
+
export function usePieState(id) {
|
|
4
|
+
function createState(id2) {
|
|
5
|
+
const state = {
|
|
6
|
+
id: id2,
|
|
7
|
+
percentage: 0,
|
|
8
|
+
interpolationId: void 0
|
|
9
|
+
};
|
|
10
|
+
return reactive(state);
|
|
11
|
+
}
|
|
12
|
+
function addState(id2) {
|
|
13
|
+
const state = createState(id2);
|
|
14
|
+
pieStateStore.value = [...pieStateStore.value, state];
|
|
15
|
+
return state;
|
|
16
|
+
}
|
|
17
|
+
function initializeState() {
|
|
18
|
+
let state = pieStateStore.value.find((entry) => {
|
|
19
|
+
return entry.id === id;
|
|
20
|
+
});
|
|
21
|
+
if (!state) {
|
|
22
|
+
state = addState(toValue(id));
|
|
23
|
+
}
|
|
24
|
+
return state;
|
|
25
|
+
}
|
|
26
|
+
function deleteState() {
|
|
27
|
+
pieStateStore.value = pieStateStore.value.filter(
|
|
28
|
+
(x) => x.id !== id
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
initializeState,
|
|
33
|
+
deleteState
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
interface InterpolatePercentageArgs {
|
|
3
|
+
value: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
easing?: (t: number) => number;
|
|
6
|
+
}
|
|
7
|
+
export declare function useMagicPie(id: MaybeRef<string>): {
|
|
8
|
+
percentage: import("vue").Ref<number, number>;
|
|
9
|
+
setPercentage: (value: number) => void;
|
|
10
|
+
interpolatePercentage: (args: InterpolatePercentageArgs) => void;
|
|
11
|
+
cancelInterpolatePercentage: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { toValue, toRefs } from "vue";
|
|
2
|
+
import { interpolate, linear } from "@maas/vue-equipment/utils";
|
|
3
|
+
import { usePieState } from "./private/usePieState.mjs";
|
|
4
|
+
export function useMagicPie(id) {
|
|
5
|
+
const { initializeState } = usePieState(toValue(id));
|
|
6
|
+
const state = initializeState();
|
|
7
|
+
const { percentage, interpolationId } = toRefs(state);
|
|
8
|
+
function setPercentage(value) {
|
|
9
|
+
percentage.value = Math.min(Math.max(0, value), 100);
|
|
10
|
+
}
|
|
11
|
+
function interpolatePercentage(args) {
|
|
12
|
+
const { value, duration = 1e3, easing = linear } = args;
|
|
13
|
+
const mappedValue = Math.min(Math.max(0, value), 100);
|
|
14
|
+
if (interpolationId.value) {
|
|
15
|
+
cancelAnimationFrame(interpolationId.value);
|
|
16
|
+
}
|
|
17
|
+
const mappedDuration = duration - duration * percentage.value / 100;
|
|
18
|
+
interpolationId.value = interpolate({
|
|
19
|
+
from: percentage.value,
|
|
20
|
+
to: mappedValue,
|
|
21
|
+
duration: mappedDuration,
|
|
22
|
+
easing,
|
|
23
|
+
callback: (value2) => {
|
|
24
|
+
percentage.value = value2;
|
|
25
|
+
},
|
|
26
|
+
interpolationIdCallback: (id2) => {
|
|
27
|
+
interpolationId.value = id2;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function cancelInterpolatePercentage() {
|
|
32
|
+
if (interpolationId.value) {
|
|
33
|
+
cancelAnimationFrame(interpolationId.value);
|
|
34
|
+
interpolationId.value = void 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
percentage,
|
|
39
|
+
setPercentage,
|
|
40
|
+
interpolatePercentage,
|
|
41
|
+
cancelInterpolatePercentage
|
|
42
|
+
};
|
|
43
|
+
}
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|