@maas/vue-equipment 0.40.0 → 1.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -16
- package/dist/composables/index.d.ts +7 -18
- package/dist/composables/index.js +79 -132
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +35 -42
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +5 -0
- package/dist/plugins/.turbo/turbo-release.log +7 -0
- package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
- package/dist/plugins/MagicAccordion/index.d.ts +2 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
- package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
- package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
- package/dist/plugins/MagicCommand/index.d.ts +2 -0
- package/dist/plugins/MagicCommand/index.mjs +9 -11
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
- package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
- package/dist/plugins/MagicCookie/index.d.ts +5 -3
- package/dist/plugins/MagicCookie/index.mjs +7 -3
- package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
- package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
- package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
- package/dist/plugins/MagicMenu/index.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +266 -166
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/index.d.ts +4 -9
- package/dist/plugins/MagicPlayer/index.mjs +11 -17
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
- package/dist/plugins/MagicScroll/index.d.ts +4 -10
- package/dist/plugins/MagicScroll/index.mjs +2 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
- package/dist/plugins/MagicToast/index.d.ts +3 -2
- package/dist/plugins/MagicToast/index.mjs +3 -3
- package/dist/plugins/MagicToast/nuxt.mjs +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
- package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
- package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
- package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
- package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/utils/css/animations/auto-size-out.css +12 -0
- package/dist/utils/css/animations/squash-y.css +5 -0
- package/dist/utils/css/animations.css +2 -1
- package/dist/utils/index.d.ts +10 -6
- package/dist/utils/index.js +41 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +62 -58
- package/dist/composables/index.d.mts +0 -108
- package/dist/composables/index.mjs +0 -383
- package/dist/composables/index.mjs.map +0 -1
- package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
- package/dist/plugins/MagicAutoSize/index.mjs +0 -7
- package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
- package/dist/utils/index.d.mts +0 -80
- package/dist/utils/index.mjs +0 -200
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Options } from 'focus-trap';
|
|
1
|
+
import { type Options as FocusTrapOptions } from 'focus-trap';
|
|
2
2
|
export interface MagicModalOptions {
|
|
3
3
|
backdrop?: boolean;
|
|
4
4
|
tag?: 'dialog' | 'div';
|
|
5
|
-
focusTrap?: boolean |
|
|
5
|
+
focusTrap?: boolean | FocusTrapOptions;
|
|
6
6
|
scrollLock?: boolean | {
|
|
7
7
|
padding: boolean;
|
|
8
8
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { Plugin } from 'vue';
|
|
2
1
|
import MagicNoise from './src/components/MagicNoise.vue.js';
|
|
2
|
+
import type { Plugin } from 'vue';
|
|
3
|
+
import type { MagicNoiseOptions } from './src/types/index.js';
|
|
3
4
|
declare const MagicNoisePlugin: Plugin;
|
|
4
5
|
export { MagicNoisePlugin, MagicNoise };
|
|
6
|
+
export type { MagicNoiseOptions };
|
|
@@ -1,72 +1,129 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-loading"];
|
|
5
|
+
const _hoisted_2 = { class: "magic-noise__inner" };
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
ref: "canvas",
|
|
8
|
+
class: "magic-noise__canvas"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
ref: "offCanvas",
|
|
12
|
+
class: "magic-noise__off-canvas"
|
|
13
|
+
};
|
|
14
|
+
import { onMounted, onUnmounted, watch, useTemplateRef } from "vue";
|
|
15
|
+
import { useResizeObserver, useDebounceFn } from "@vueuse/core";
|
|
16
|
+
import { useNoiseApi } from "../composables/private/useNoiseApi";
|
|
17
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
18
|
+
__name: "MagicNoise",
|
|
19
|
+
props: {
|
|
20
|
+
options: { type: Object, required: false },
|
|
21
|
+
pause: { type: Boolean, required: false, default: false }
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const canvasRef = useTemplateRef("canvas");
|
|
25
|
+
const offCanvasRef = useTemplateRef("offCanvas");
|
|
26
|
+
const noiseApi = useNoiseApi({
|
|
27
|
+
canvasRef,
|
|
28
|
+
offCanvasRef,
|
|
29
|
+
options: __props.options
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
initialize,
|
|
33
|
+
drawControls,
|
|
34
|
+
transferControls,
|
|
35
|
+
throttledDraw,
|
|
36
|
+
throttledRotateAndTransfer,
|
|
37
|
+
isReady
|
|
38
|
+
} = noiseApi;
|
|
39
|
+
useResizeObserver(canvasRef, useDebounceFn(initialize, 100));
|
|
40
|
+
watch(
|
|
41
|
+
() => __props.pause,
|
|
42
|
+
(pause) => {
|
|
43
|
+
if (pause) {
|
|
44
|
+
drawControls.value?.pause();
|
|
45
|
+
transferControls.value?.pause();
|
|
46
|
+
} else {
|
|
47
|
+
drawControls.value?.resume();
|
|
48
|
+
transferControls.value?.resume();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
throttledDraw();
|
|
54
|
+
throttledRotateAndTransfer();
|
|
55
|
+
});
|
|
56
|
+
onUnmounted(() => {
|
|
57
|
+
isReady.value = false;
|
|
58
|
+
transferControls.value?.pause();
|
|
59
|
+
drawControls.value?.pause();
|
|
60
|
+
});
|
|
61
|
+
return (_ctx, _cache) => {
|
|
62
|
+
return _openBlock(), _createElementBlock("div", {
|
|
63
|
+
class: "magic-noise",
|
|
64
|
+
"data-loading": !_unref(isReady)
|
|
65
|
+
}, [
|
|
66
|
+
_createElementVNode("div", _hoisted_2, [
|
|
67
|
+
_createElementVNode(
|
|
68
|
+
"canvas",
|
|
69
|
+
_hoisted_3,
|
|
70
|
+
null,
|
|
71
|
+
512
|
|
72
|
+
/* NEED_PATCH */
|
|
73
|
+
),
|
|
74
|
+
_createElementVNode(
|
|
75
|
+
"canvas",
|
|
76
|
+
_hoisted_4,
|
|
77
|
+
null,
|
|
78
|
+
512
|
|
79
|
+
/* NEED_PATCH */
|
|
80
|
+
)
|
|
81
|
+
])
|
|
82
|
+
], 8, _hoisted_1);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
</script>
|
|
15
87
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
88
|
+
<style>
|
|
89
|
+
:root {
|
|
90
|
+
--magic-noise-loading-transition: color 300ms ease, opacity 300ms ease;
|
|
19
91
|
}
|
|
20
92
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
offCanvasRef,
|
|
31
|
-
options: props.options,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const {
|
|
35
|
-
initialize,
|
|
36
|
-
drawControls,
|
|
37
|
-
transferControls,
|
|
38
|
-
throttledDraw,
|
|
39
|
-
throttledRotateAndTransfer,
|
|
40
|
-
isReady,
|
|
41
|
-
} = noiseApi
|
|
42
|
-
|
|
43
|
-
useResizeObserver(canvasRef, useDebounceFn(initialize, 100))
|
|
44
|
-
|
|
45
|
-
watch(
|
|
46
|
-
() => props.pause,
|
|
47
|
-
(pause) => {
|
|
48
|
-
if (pause) {
|
|
49
|
-
drawControls.value?.pause()
|
|
50
|
-
transferControls.value?.pause()
|
|
51
|
-
} else {
|
|
52
|
-
drawControls.value?.resume()
|
|
53
|
-
transferControls.value?.resume()
|
|
93
|
+
.magic-noise {
|
|
94
|
+
position: relative;
|
|
95
|
+
user-select: none;
|
|
96
|
+
transition: var(--magic-noise-loading-transition);
|
|
97
|
+
background: var(--magic-noise-background, #000);
|
|
98
|
+
&[data-loading='true'] {
|
|
99
|
+
background: var(--magic-noise-loading-background, #000);
|
|
100
|
+
& > .magic-noise__inner {
|
|
101
|
+
opacity: 0;
|
|
54
102
|
}
|
|
55
103
|
}
|
|
56
|
-
|
|
104
|
+
}
|
|
57
105
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
106
|
+
.magic-noise__inner {
|
|
107
|
+
position: relative;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 100%;
|
|
110
|
+
transition: var(--magic-noise-loading-transition);
|
|
111
|
+
}
|
|
62
112
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
113
|
+
.magic-noise__canvas {
|
|
114
|
+
position: absolute;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
top: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
object-fit: cover;
|
|
120
|
+
}
|
|
69
121
|
|
|
70
|
-
|
|
71
|
-
:
|
|
122
|
+
.magic-noise__off-canvas {
|
|
123
|
+
position: absolute;
|
|
124
|
+
top: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
visibility: hidden;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
}
|
|
72
129
|
</style>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { MagicNoiseOptions } from '../types';
|
|
1
|
+
import type { MagicNoiseOptions } from '../types/index.js';
|
|
2
2
|
interface MagicNoiseProps {
|
|
3
3
|
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {
|
|
7
|
-
pause: boolean;
|
|
8
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
7
|
export default _default;
|
|
@@ -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,9 +14,9 @@ export function useNoiseApi({
|
|
|
14
14
|
}) {
|
|
15
15
|
const tiles = shallowRef([]);
|
|
16
16
|
const pixels = shallowRef([]);
|
|
17
|
-
const isReady =
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const isReady = shallowRef(false);
|
|
18
|
+
const context = shallowRef(null);
|
|
19
|
+
const offContext = shallowRef(null);
|
|
20
20
|
const { width, height } = useElementSize(canvasRef);
|
|
21
21
|
const { pixelRatio } = useDevicePixelRatio();
|
|
22
22
|
const drawControls = shallowRef(void 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,202 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-flip", "data-id"];
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
id: "magic-pie__svg",
|
|
7
|
+
viewBox: "0 0 100 100",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_3 = { mask: "url(#magic-pie__mask)" };
|
|
11
|
+
const _hoisted_4 = ["d"];
|
|
12
|
+
import { computed, toRefs, onBeforeUnmount } from "vue";
|
|
13
|
+
import { usePieState } from "../composables/private/usePieState";
|
|
14
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
15
|
+
__name: "MagicPie",
|
|
16
|
+
props: {
|
|
17
|
+
id: { type: String, required: true },
|
|
18
|
+
options: { type: Object, required: false }
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const { initializeState, deleteState } = usePieState(__props.id);
|
|
22
|
+
const state = initializeState();
|
|
23
|
+
const { percentage } = toRefs(state);
|
|
24
|
+
function generatePath(points) {
|
|
25
|
+
if (points.length < 2) {
|
|
26
|
+
throw new Error("At least two points are required to generate a path.");
|
|
27
|
+
}
|
|
28
|
+
let path2 = `M ${points[0][0]} ${points[0][1]}`;
|
|
29
|
+
for (let i = 1; i < points.length; i++) {
|
|
30
|
+
path2 += ` L ${points[i][0]} ${points[i][1]}`;
|
|
31
|
+
}
|
|
32
|
+
return path2;
|
|
33
|
+
}
|
|
34
|
+
function generatePie(percentage2, flip) {
|
|
35
|
+
if (percentage2 < 0 || percentage2 > 100) {
|
|
36
|
+
throw new Error("percentage needs to be between 0 and 100");
|
|
37
|
+
}
|
|
38
|
+
const size = 100;
|
|
39
|
+
const points = [
|
|
40
|
+
[size / 2, size / 2],
|
|
41
|
+
[size / 2, 0]
|
|
42
|
+
];
|
|
43
|
+
function getEndpoint(percentage3, size2) {
|
|
44
|
+
const circumference = size2 * 4;
|
|
45
|
+
const distance = percentage3 / 100 * circumference;
|
|
46
|
+
if (distance === 0) {
|
|
47
|
+
return [size2 / 2, 0];
|
|
48
|
+
}
|
|
49
|
+
const position = Math.floor(distance / (size2 / 2)) % 8;
|
|
50
|
+
const remainingDistance = distance % (size2 / 2);
|
|
51
|
+
let x = 0;
|
|
52
|
+
let y = 0;
|
|
53
|
+
switch (position) {
|
|
54
|
+
case 0:
|
|
55
|
+
x = size2 / 2 + remainingDistance;
|
|
56
|
+
y = 0;
|
|
57
|
+
break;
|
|
58
|
+
case 1:
|
|
59
|
+
x = size2;
|
|
60
|
+
y = remainingDistance;
|
|
61
|
+
break;
|
|
62
|
+
case 2:
|
|
63
|
+
x = size2;
|
|
64
|
+
y = size2 / 2 + remainingDistance;
|
|
65
|
+
break;
|
|
66
|
+
case 3:
|
|
67
|
+
x = size2 - remainingDistance;
|
|
68
|
+
y = size2;
|
|
69
|
+
break;
|
|
70
|
+
case 4:
|
|
71
|
+
x = size2 / 2 - remainingDistance;
|
|
72
|
+
y = size2;
|
|
73
|
+
break;
|
|
74
|
+
case 5:
|
|
75
|
+
x = 0;
|
|
76
|
+
y = size2 - remainingDistance;
|
|
77
|
+
break;
|
|
78
|
+
case 6:
|
|
79
|
+
x = 0;
|
|
80
|
+
y = size2 / 2 - remainingDistance;
|
|
81
|
+
break;
|
|
82
|
+
case 7:
|
|
83
|
+
x = remainingDistance;
|
|
84
|
+
y = 0;
|
|
85
|
+
}
|
|
86
|
+
return [x, y];
|
|
87
|
+
}
|
|
88
|
+
if (flip) {
|
|
89
|
+
if (100 - percentage2 >= 12.5) {
|
|
90
|
+
points.push([0, 0]);
|
|
91
|
+
}
|
|
92
|
+
if (100 - percentage2 >= 25) {
|
|
93
|
+
points.push([0, size / 2]);
|
|
94
|
+
}
|
|
95
|
+
if (100 - percentage2 >= 37.5) {
|
|
96
|
+
points.push([0, size]);
|
|
97
|
+
}
|
|
98
|
+
if (100 - percentage2 >= 50) {
|
|
99
|
+
points.push([size / 2, size]);
|
|
100
|
+
}
|
|
101
|
+
if (100 - percentage2 >= 62.5) {
|
|
102
|
+
points.push([size, size]);
|
|
103
|
+
}
|
|
104
|
+
if (100 - percentage2 >= 75) {
|
|
105
|
+
points.push([size, size / 2]);
|
|
106
|
+
}
|
|
107
|
+
if (100 - percentage2 >= 87.5) {
|
|
108
|
+
points.push([size, 0]);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
if (percentage2 >= 12.5) {
|
|
112
|
+
points.push([size, 0]);
|
|
113
|
+
}
|
|
114
|
+
if (percentage2 >= 25) {
|
|
115
|
+
points.push([size, size / 2]);
|
|
116
|
+
}
|
|
117
|
+
if (percentage2 >= 37.5) {
|
|
118
|
+
points.push([size, size]);
|
|
119
|
+
}
|
|
120
|
+
if (percentage2 >= 50) {
|
|
121
|
+
points.push([size / 2, size]);
|
|
122
|
+
}
|
|
123
|
+
if (percentage2 >= 62.5) {
|
|
124
|
+
points.push([0, size]);
|
|
125
|
+
}
|
|
126
|
+
if (percentage2 >= 75) {
|
|
127
|
+
points.push([0, size / 2]);
|
|
128
|
+
}
|
|
129
|
+
if (percentage2 >= 87.5) {
|
|
130
|
+
points.push([0, 0]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
points.push(getEndpoint(percentage2, size));
|
|
134
|
+
return generatePath(points);
|
|
135
|
+
}
|
|
136
|
+
const path = computed(() => {
|
|
137
|
+
return generatePie(percentage.value, __props.options?.flip);
|
|
138
|
+
});
|
|
139
|
+
onBeforeUnmount(() => {
|
|
140
|
+
deleteState();
|
|
141
|
+
});
|
|
142
|
+
return (_ctx, _cache) => {
|
|
143
|
+
return _openBlock(), _createElementBlock("div", {
|
|
144
|
+
class: "magic-pie",
|
|
145
|
+
"data-flip": _ctx.options?.flip,
|
|
146
|
+
"data-id": _ctx.id
|
|
147
|
+
}, [
|
|
148
|
+
(_openBlock(), _createElementBlock("svg", _hoisted_2, [
|
|
149
|
+
_cache[1] || (_cache[1] = _createElementVNode(
|
|
150
|
+
"mask",
|
|
151
|
+
{ id: "magic-pie__mask" },
|
|
152
|
+
[
|
|
153
|
+
_createElementVNode("circle", {
|
|
154
|
+
cx: "50",
|
|
155
|
+
cy: "50",
|
|
156
|
+
r: "50",
|
|
157
|
+
fill: "white"
|
|
158
|
+
})
|
|
159
|
+
],
|
|
160
|
+
-1
|
|
161
|
+
/* HOISTED */
|
|
162
|
+
)),
|
|
163
|
+
_createElementVNode("g", _hoisted_3, [
|
|
164
|
+
_cache[0] || (_cache[0] = _createElementVNode(
|
|
165
|
+
"rect",
|
|
166
|
+
{
|
|
167
|
+
width: "100",
|
|
168
|
+
height: "100"
|
|
169
|
+
},
|
|
170
|
+
null,
|
|
171
|
+
-1
|
|
172
|
+
/* HOISTED */
|
|
173
|
+
)),
|
|
174
|
+
_createElementVNode("path", { d: path.value }, null, 8, _hoisted_4)
|
|
175
|
+
])
|
|
176
|
+
]))
|
|
177
|
+
], 8, _hoisted_1);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<style>
|
|
184
|
+
.magic-pie {
|
|
185
|
+
position: relative;
|
|
186
|
+
|
|
187
|
+
& path {
|
|
188
|
+
fill: var(--magic-pie-foreground, currentColor);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
& rect {
|
|
192
|
+
fill: var(--magic-pie-background, transparent);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
#magic-pie__svg {
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
199
|
+
margin-left: auto;
|
|
200
|
+
margin-right: auto;
|
|
201
|
+
}
|
|
202
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MagicPieOptions } from '../types/index.js';
|
|
2
|
+
interface MagicPieProps {
|
|
3
|
+
id: string;
|
|
4
|
+
options?: MagicPieOptions;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicPieProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPieProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
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) state = addState(toValue(id));
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
function deleteState() {
|
|
25
|
+
pieStateStore.value = pieStateStore.value.filter(
|
|
26
|
+
(x) => x.id !== id
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
initializeState,
|
|
31
|
+
deleteState
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -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,11 +1,6 @@
|
|
|
1
|
-
import type { Plugin } from 'vue';
|
|
2
|
-
import MagicPlayer from './src/components/MagicPlayer.vue.js';
|
|
3
|
-
import MagicPlayerControls from './src/components/MagicPlayerControls.vue.js';
|
|
4
|
-
import MagicPlayerDisplayTime from './src/components/MagicPlayerDisplayTime.vue.js';
|
|
5
|
-
import MagicPlayerMuxPopover from './src/components/MagicPlayerMuxPopover.vue.js';
|
|
6
|
-
import MagicPlayerOverlay from './src/components/MagicPlayerOverlay.vue.js';
|
|
7
|
-
import MagicPlayerPoster from './src/components/MagicPlayerPoster.vue.js';
|
|
8
|
-
import MagicPlayerTimeline from './src/components/MagicPlayerTimeline.vue.js';
|
|
9
1
|
import { useMagicPlayer } from './src/composables/useMagicPlayer.js';
|
|
2
|
+
import type { Plugin } from 'vue';
|
|
3
|
+
import type { MagicPlayerOptions } from './src/types/index.js';
|
|
10
4
|
declare const MagicPlayerPlugin: Plugin;
|
|
11
|
-
export { MagicPlayerPlugin,
|
|
5
|
+
export { MagicPlayerPlugin, useMagicPlayer };
|
|
6
|
+
export type { MagicPlayerOptions };
|