@maas/vue-equipment 0.40.0 → 1.0.0-beta.1
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 +2 -13
- package/dist/composables/index.js +65 -128
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +26 -40
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +13 -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 +17 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +11 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +71 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +12 -7
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +51 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +13 -4
- 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/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +1 -1
- 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 +192 -0
- package/dist/plugins/MagicCommand/src/components/{MagicCommandBody.vue.d.ts → MagicCommandContent.vue.d.ts} +4 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -3
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +108 -79
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +18 -9
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +11 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +94 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +52 -7
- 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 +110 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +75 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -9
- 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 +22 -4
- 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 +8 -1
- 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 +33 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +32 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/{MagicCommand/src/components/MagicCommandHead.vue.d.ts → MagicCookie/src/components/MagicCookieView.vue.d.ts} +6 -2
- 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 +142 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +6 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +3 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +11 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +8 -8
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +10 -5
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +5 -5
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +491 -336
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -6
- 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/useDrawerDrag.d.ts +7 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +26 -16
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +2 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +5 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +46 -29
- 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 +2 -2
- 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 +14 -10
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +3 -7
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +52 -44
- 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 +79 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +10 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +247 -215
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +12 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +235 -211
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +126 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +94 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +49 -4
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +98 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +111 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +13 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +8 -8
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +35 -26
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +12 -6
- 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.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +99 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +265 -165
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +12 -6
- 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/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 +11 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- 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 +78 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +134 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +33 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +11 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +116 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +13 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +83 -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 +94 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +222 -0
- package/dist/plugins/MagicPlayer/src/components/{MagicPlayerControls.vue.d.ts → MagicPlayerVideoControls.vue.d.ts} +12 -5
- 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.mjs +5 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +18 -22
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +6 -8
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +2 -6
- 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 +67 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +14 -4
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +14 -7
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +15 -9
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +76 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -7
- 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 +5 -3
- 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 +296 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +23 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +155 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +33 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +7 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +34 -29
- 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 +41 -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 +13 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +26 -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 +0 -1
- package/dist/plugins/index.mjs +0 -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 +1 -2
- package/dist/utils/index.js +2 -53
- package/dist/utils/index.js.map +1 -1
- package/package.json +52 -57
- 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.d.ts +0 -2
- 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/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/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/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/MagicToast.vue.d.ts +0 -14
- 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
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport
|
|
3
|
-
:key="teleportKey"
|
|
4
|
-
:to="mappedOptions.teleport?.target"
|
|
5
|
-
:disabled="mappedOptions.teleport?.disabled"
|
|
6
|
-
>
|
|
7
|
-
<div class="magic-toast" :id="toValue(id)" :class="toValue(props.class)">
|
|
8
|
-
<transition-group
|
|
9
|
-
tag="ol"
|
|
10
|
-
ref="listRef"
|
|
11
|
-
class="magic-toast__inner"
|
|
12
|
-
:name="mappedOptions.transitions!.list"
|
|
13
|
-
:on-before-enter="onBeforeEnter"
|
|
14
|
-
:on-enter="onEnter"
|
|
15
|
-
:on-after-enter="onAfterEnter"
|
|
16
|
-
:on-before-leave="onBeforeLeave"
|
|
17
|
-
:on-leave="onLeave"
|
|
18
|
-
:on-after-leave="onAfterLeave"
|
|
19
|
-
>
|
|
20
|
-
<magic-toast-component
|
|
21
|
-
v-for="(toast, index) in toasts"
|
|
22
|
-
:id="toast.id"
|
|
23
|
-
:key="toast.id"
|
|
24
|
-
:index="index"
|
|
25
|
-
:total="count || 0"
|
|
26
|
-
:siblings="activeToasts"
|
|
27
|
-
:class="{
|
|
28
|
-
expanded: isExpanded,
|
|
29
|
-
}"
|
|
30
|
-
@mouseenter="onMouseenter"
|
|
31
|
-
@mouseleave="onMouseleave"
|
|
32
|
-
>
|
|
33
|
-
<component
|
|
34
|
-
:is="toast.component"
|
|
35
|
-
v-bind="toast.props"
|
|
36
|
-
@close="toast.remove"
|
|
37
|
-
@click.self="onClick"
|
|
38
|
-
/>
|
|
39
|
-
</magic-toast-component>
|
|
40
|
-
</transition-group>
|
|
41
|
-
</div>
|
|
42
|
-
</Teleport>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script setup lang="ts">
|
|
46
|
-
import {
|
|
47
|
-
toValue,
|
|
48
|
-
ref,
|
|
49
|
-
watch,
|
|
50
|
-
onBeforeMount,
|
|
51
|
-
onUnmounted,
|
|
52
|
-
useId,
|
|
53
|
-
type MaybeRef,
|
|
54
|
-
} from 'vue'
|
|
55
|
-
import { defu } from 'defu'
|
|
56
|
-
import { onClickOutside, type MaybeElement } from '@vueuse/core'
|
|
57
|
-
import { defaultOptions } from './../utils/defaultOptions'
|
|
58
|
-
import { useToastApi } from '../composables/private/useToastApi'
|
|
59
|
-
import { useToastCallback } from './../composables/private/useToastCallback'
|
|
60
|
-
import { useMagicToast } from '../composables/useMagicToast'
|
|
61
|
-
|
|
62
|
-
import MagicToastComponent from './MagicToastComponent.vue'
|
|
63
|
-
|
|
64
|
-
import type { MagicToastOptions } from './../types/index'
|
|
65
|
-
|
|
66
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css'
|
|
67
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css'
|
|
68
|
-
import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css'
|
|
69
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css'
|
|
70
|
-
import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css'
|
|
71
|
-
|
|
72
|
-
interface MagicToastProps {
|
|
73
|
-
id: MaybeRef<string>
|
|
74
|
-
class: MaybeRef<string>
|
|
75
|
-
options?: MagicToastOptions
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const props = defineProps<MagicToastProps>()
|
|
79
|
-
|
|
80
|
-
const { initialize, destroy } = useToastApi(props.id)
|
|
81
|
-
const { toasts, count, firstToast } = useMagicToast(props.id)
|
|
82
|
-
|
|
83
|
-
const mappedOptions = defu(props.options, defaultOptions)
|
|
84
|
-
const isExpanded = ref(mappedOptions.layout?.expand === true)
|
|
85
|
-
const teleportKey = ref(useId())
|
|
86
|
-
const listRef = ref<MaybeElement>()
|
|
87
|
-
|
|
88
|
-
const {
|
|
89
|
-
onBeforeEnter,
|
|
90
|
-
onEnter,
|
|
91
|
-
onAfterEnter,
|
|
92
|
-
onBeforeLeave,
|
|
93
|
-
onLeave,
|
|
94
|
-
onAfterLeave,
|
|
95
|
-
activeToasts,
|
|
96
|
-
} = useToastCallback({ id: props.id, mappedOptions, count, firstToast })
|
|
97
|
-
|
|
98
|
-
function onMouseenter() {
|
|
99
|
-
if (mappedOptions.layout?.expand === 'hover') {
|
|
100
|
-
isExpanded.value = true
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function onMouseleave() {
|
|
105
|
-
if (mappedOptions.layout?.expand === 'hover') {
|
|
106
|
-
isExpanded.value = false
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function onClick() {
|
|
111
|
-
if (mappedOptions.layout?.expand === 'click') {
|
|
112
|
-
isExpanded.value = true
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function outsideClickCallback() {
|
|
117
|
-
if (mappedOptions.layout?.expand === 'click') {
|
|
118
|
-
isExpanded.value = false
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
onClickOutside(listRef, outsideClickCallback)
|
|
123
|
-
|
|
124
|
-
// Lifecycle hooks and listeners
|
|
125
|
-
watch(
|
|
126
|
-
() => props.id,
|
|
127
|
-
() => (teleportKey.value = useId())
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
onBeforeMount(() => {
|
|
131
|
-
initialize()
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
onUnmounted(() => {
|
|
135
|
-
destroy(toValue(props.id))
|
|
136
|
-
})
|
|
137
|
-
</script>
|
|
138
|
-
|
|
139
|
-
<style>
|
|
140
|
-
:root{--magic-toast-transform-x:0;--magic-toast-transform-y:0;--magic-toast-padding-x:1rem;--magic-toast-padding-y:1rem;--mt-multiplier-x:1;--mt-multiplier-y:1;--mt-align-items:flex-start;--mt-justify-content:center}.magic-toast{align-items:center;background:transparent;color:inherit;flex-direction:column;inset:0;justify-content:center;pointer-events:none;position:fixed;z-index:var(--magic-toast-z-index,999)}.magic-toast,.magic-toast__inner{display:flex;height:100%;width:100%}.magic-toast__inner{align-items:var(--mt-align-items);justify-content:var(--mt-justify-content);max-height:100%;overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:none;-ms-overflow-style:none}.magic-toast__inner::-webkit-scrollbar{display:none}.magic-toast__inner *{pointer-events:all}.magic-toast.-top-center,.magic-toast.-top-left,.magic-toast.-top-right{--magic-toast-transform-y:10;--magic-toast-enter-animation:slide-ttb-in 300ms ease;--mt-multiplier-y:1;--mt-align-items:flex-start}.magic-toast.-top-center .magic-toast-component,.magic-toast.-top-left .magic-toast-component,.magic-toast.-top-right .magic-toast-component{padding-top:var(--magic-toast-padding-y,1rem)}.magic-toast.-bottom-center,.magic-toast.-bottom-left,.magic-toast.-bottom-right{--magic-toast-transform-y:10;--magic-toast-enter-animation:slide-btt-in 300ms ease;--mt-multiplier-y:-1;--mt-align-items:flex-end}.magic-toast.-bottom-center .magic-toast-component,.magic-toast.-bottom-left .magic-toast-component,.magic-toast.-bottom-right .magic-toast-component{padding-bottom:var(--magic-toast-padding-y,1rem)}.magic-toast.-bottom-left,.magic-toast.-top-left{--mt-justify-content:flex-start}.magic-toast.-bottom-left .magic-toast-component,.magic-toast.-top-left .magic-toast-component{padding-left:var(--magic-toast-padding-x,1rem)}.magic-toast.-bottom-right,.magic-toast.-top-right{--mt-justify-content:flex-end}.magic-toast.-bottom-right .magic-toast-component,.magic-toast.-top-right .magic-toast-component{padding-right:var(--magic-toast-padding-x,1rem)}.magic-toast.-from-left{--magic-toast-enter-animation:slide-ltr-in 300ms ease;--magic-toast-transform-y:0;--magic-toast-transform-x:30;--mt-multiplier-x:1}.magic-toast.-from-right{--magic-toast-enter-animation:slide-rtl-in 300ms ease;--magic-toast-transform-y:0;--magic-toast-transform-x:30;--mt-multiplier-x:-1}.magic-toast--list-enter-active{animation:var(--magic-toast-enter-animation,unset)}.magic-toast--list-leave-active{animation:var(--magic-toast-leave-animation,fade-out .3s ease)}
|
|
141
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { MagicToastOptions } from './../types/index';
|
|
3
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
4
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
|
|
5
|
-
import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css';
|
|
6
|
-
import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css';
|
|
7
|
-
import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css';
|
|
8
|
-
interface MagicToastProps {
|
|
9
|
-
id: MaybeRef<string>;
|
|
10
|
-
class: MaybeRef<string>;
|
|
11
|
-
options?: MagicToastOptions;
|
|
12
|
-
}
|
|
13
|
-
declare const _default: import("vue").DefineComponent<MagicToastProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
export default _default;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li
|
|
3
|
-
class="magic-toast-component"
|
|
4
|
-
ref="elRef"
|
|
5
|
-
@mouseenter="onMouseenter"
|
|
6
|
-
:id="id"
|
|
7
|
-
>
|
|
8
|
-
<div class="magic-toast-component__inner">
|
|
9
|
-
<slot />
|
|
10
|
-
</div>
|
|
11
|
-
</li>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts" setup>
|
|
15
|
-
import { ref, computed, onMounted, watchEffect } from 'vue'
|
|
16
|
-
import { type ActiveToast } from './../types'
|
|
17
|
-
|
|
18
|
-
interface MagicToastComponentProps {
|
|
19
|
-
index: number
|
|
20
|
-
total: number
|
|
21
|
-
id: string
|
|
22
|
-
siblings: ActiveToast[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const props = defineProps<MagicToastComponentProps>()
|
|
26
|
-
const emit = defineEmits<{
|
|
27
|
-
mouseenter: [event: Event]
|
|
28
|
-
}>()
|
|
29
|
-
|
|
30
|
-
const elRef = ref<HTMLElement | undefined>(undefined)
|
|
31
|
-
const newerSiblings = computed(() => {
|
|
32
|
-
return props.siblings.slice(props.index + 1)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
function setIndex() {
|
|
36
|
-
const index = (props.total - props.index - 1).toString()
|
|
37
|
-
elRef.value?.style.setProperty('--mt-index', index)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function setOffset() {
|
|
41
|
-
const offset = newerSiblings.value.reduce((acc, curr) => {
|
|
42
|
-
return acc + curr.height - curr.padding.top - curr.padding.bottom
|
|
43
|
-
}, 0)
|
|
44
|
-
elRef.value?.style.setProperty('--mt-offset', `${offset}`)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function onMouseenter(event: Event) {
|
|
48
|
-
emit('mouseenter', event)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onMounted(() => {
|
|
52
|
-
setIndex()
|
|
53
|
-
setOffset()
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
watchEffect(() => {
|
|
57
|
-
setIndex()
|
|
58
|
-
setOffset()
|
|
59
|
-
})
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<style>
|
|
63
|
-
.magic-toast-component{--mt-index:0;--mt-offset:0;--mt-matrix-scale:calc(1 - var(--magic-toast-scale, 0.1)*var(--mt-index, 0));--mt-matrix-transform-x:calc(var(--magic-toast-transform-x)*var(--mt-index, 0)*var(--mt-multiplier-x));--mt-matrix-transform-y:calc(var(--magic-toast-transform-y)*var(--mt-index, 0)*var(--mt-multiplier-y));list-style:none;position:absolute}.magic-toast-component__inner{height:100%;position:relative;transform:matrix(var(--mt-matrix-scale),0,0,var(--mt-matrix-scale),var(--mt-matrix-transform-x),var(--mt-matrix-transform-y));transition:var(--magic-toast-transition,transform .3s ease);width:100%}.magic-toast-component.expanded{--mt-matrix-scale:1;--mt-matrix-transform-y:calc(var(--mt-offset)*var(--mt-multiplier-y));--mt-matrix-transform-x:0}.magic-toast-component.expanded:not(:last-child) .magic-toast-component__inner{padding-bottom:calc(var(--magic-toast-gap, .75rem)*var(--mt-index));padding-top:calc(var(--magic-toast-gap, .75rem)*var(--mt-index))}
|
|
64
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type ActiveToast } from './../types';
|
|
2
|
-
interface MagicToastComponentProps {
|
|
3
|
-
index: number;
|
|
4
|
-
total: number;
|
|
5
|
-
id: string;
|
|
6
|
-
siblings: ActiveToast[];
|
|
7
|
-
}
|
|
8
|
-
declare function __VLS_template(): {
|
|
9
|
-
attrs: Partial<{}>;
|
|
10
|
-
slots: {
|
|
11
|
-
default?(_: {}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {
|
|
14
|
-
elRef: HTMLLIElement;
|
|
15
|
-
};
|
|
16
|
-
rootEl: HTMLLIElement;
|
|
17
|
-
};
|
|
18
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicToastComponentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
mouseenter: (event: Event) => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<MagicToastComponentProps> & Readonly<{
|
|
22
|
-
onMouseenter?: ((event: Event) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLLIElement>;
|
|
24
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
-
export default _default;
|
|
26
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
-
new (): {
|
|
28
|
-
$slots: S;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { toValue } from "vue";
|
|
2
|
-
import { useToastStore } from "./useToastStore.mjs";
|
|
3
|
-
import { useMagicToast } from "../useMagicToast.mjs";
|
|
4
|
-
export function useToastApi(id) {
|
|
5
|
-
const { findInstance, addInstance, removeInstance } = useToastStore();
|
|
6
|
-
const { clear } = useMagicToast(toValue(id));
|
|
7
|
-
function initialize() {
|
|
8
|
-
const mappedId = toValue(id);
|
|
9
|
-
if (!findInstance(mappedId)) {
|
|
10
|
-
return addInstance(mappedId);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function destroy(id2) {
|
|
14
|
-
if (!id2) return;
|
|
15
|
-
clear();
|
|
16
|
-
removeInstance(toValue(id2));
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
initialize,
|
|
20
|
-
destroy
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export function useToastInternalApi() {
|
|
2
|
-
function uuid() {
|
|
3
|
-
return Math.random().toString(36).slice(2, 11);
|
|
4
|
-
}
|
|
5
|
-
function removeToastAfterTimeout(id, duration, ctx) {
|
|
6
|
-
if (duration > 0) {
|
|
7
|
-
setTimeout(() => {
|
|
8
|
-
ctx.remove(id);
|
|
9
|
-
}, duration);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function addToast(args, ctx) {
|
|
13
|
-
const id = uuid();
|
|
14
|
-
let { component, props, duration = 0 } = args;
|
|
15
|
-
const toast = {
|
|
16
|
-
component,
|
|
17
|
-
props,
|
|
18
|
-
id,
|
|
19
|
-
remove: () => ctx.remove(id)
|
|
20
|
-
};
|
|
21
|
-
ctx.toasts.push(toast);
|
|
22
|
-
removeToastAfterTimeout(id, duration, ctx);
|
|
23
|
-
return id;
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
addToast
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ToastInstance, AddToastArgs } from '../../types/index.js';
|
|
2
|
-
export declare function useToastStore(): {
|
|
3
|
-
toastStore: import("vue").Ref<{
|
|
4
|
-
id: string;
|
|
5
|
-
toasts: {
|
|
6
|
-
id: string;
|
|
7
|
-
component: Object;
|
|
8
|
-
props?: Record<string, any> | undefined;
|
|
9
|
-
remove: Function;
|
|
10
|
-
}[];
|
|
11
|
-
add: (args: AddToastArgs) => string;
|
|
12
|
-
remove: (id: string) => void;
|
|
13
|
-
}[], ToastInstance[] | {
|
|
14
|
-
id: string;
|
|
15
|
-
toasts: {
|
|
16
|
-
id: string;
|
|
17
|
-
component: Object;
|
|
18
|
-
props?: Record<string, any> | undefined;
|
|
19
|
-
remove: Function;
|
|
20
|
-
}[];
|
|
21
|
-
add: (args: AddToastArgs) => string;
|
|
22
|
-
remove: (id: string) => void;
|
|
23
|
-
}[]>;
|
|
24
|
-
findInstance: (id: string) => ToastInstance | undefined;
|
|
25
|
-
addInstance: (id: string) => ToastInstance;
|
|
26
|
-
removeInstance: (id: string) => void;
|
|
27
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
2
|
-
import { useToastInternalApi } from "./useToastInternalApi.mjs";
|
|
3
|
-
const toastStore = ref([]);
|
|
4
|
-
export function useToastStore() {
|
|
5
|
-
const { addToast } = useToastInternalApi();
|
|
6
|
-
function createInstance(id) {
|
|
7
|
-
const instance = {
|
|
8
|
-
id,
|
|
9
|
-
toasts: [],
|
|
10
|
-
add: function(args) {
|
|
11
|
-
return addToast(args, this);
|
|
12
|
-
},
|
|
13
|
-
remove: function(id2) {
|
|
14
|
-
this.toasts = this.toasts.filter((toast) => toast.id !== id2);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return instance;
|
|
18
|
-
}
|
|
19
|
-
function findInstance(id) {
|
|
20
|
-
const instance = toastStore.value.find(
|
|
21
|
-
(instance2) => instance2.id === id
|
|
22
|
-
);
|
|
23
|
-
return instance;
|
|
24
|
-
}
|
|
25
|
-
function addInstance(id) {
|
|
26
|
-
const instance = createInstance(id);
|
|
27
|
-
toastStore.value.push(instance);
|
|
28
|
-
return instance;
|
|
29
|
-
}
|
|
30
|
-
function removeInstance(id) {
|
|
31
|
-
toastStore.value = toastStore.value.filter(
|
|
32
|
-
(instance) => instance.id !== id
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
toastStore,
|
|
37
|
-
findInstance,
|
|
38
|
-
addInstance,
|
|
39
|
-
removeInstance
|
|
40
|
-
};
|
|
41
|
-
}
|
package/dist/utils/index.d.mts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
declare function clampValue(value: number, min: number, max: number): number;
|
|
2
|
-
|
|
3
|
-
declare function linear(t: number): number;
|
|
4
|
-
declare function easeInQuad(t: number): number;
|
|
5
|
-
declare function easeOutQuad(t: number): number;
|
|
6
|
-
declare function easeInOutQuad(t: number): number;
|
|
7
|
-
declare function easeOutBack(t: number, o?: number): number;
|
|
8
|
-
declare function easeInCubic(t: number): number;
|
|
9
|
-
declare function easeOutCubic(t: number): number;
|
|
10
|
-
declare function easeInOutCubic(t: number): number;
|
|
11
|
-
declare function easeInQuart(t: number): number;
|
|
12
|
-
declare function easeOutQuart(t: number): number;
|
|
13
|
-
declare function easeInOutQuart(t: number): number;
|
|
14
|
-
declare function easeInQuint(t: number): number;
|
|
15
|
-
declare function easeOutQuint(t: number): number;
|
|
16
|
-
declare function easeInOutQuint(t: number): number;
|
|
17
|
-
|
|
18
|
-
declare function formatTime(seconds: number, guide: number): string;
|
|
19
|
-
|
|
20
|
-
type InterpolateArgs = {
|
|
21
|
-
from: number;
|
|
22
|
-
to: number;
|
|
23
|
-
duration: number;
|
|
24
|
-
interval?: number;
|
|
25
|
-
easing?: (t: number) => number;
|
|
26
|
-
callback: (result: number) => void;
|
|
27
|
-
};
|
|
28
|
-
declare function interpolate(args: InterpolateArgs): void;
|
|
29
|
-
|
|
30
|
-
declare function isIOS(): boolean;
|
|
31
|
-
|
|
32
|
-
interface isWithinRangeArgs {
|
|
33
|
-
input: number;
|
|
34
|
-
base: number;
|
|
35
|
-
threshold: number;
|
|
36
|
-
}
|
|
37
|
-
declare function isWithinRange(args: isWithinRangeArgs): boolean;
|
|
38
|
-
|
|
39
|
-
declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
|
40
|
-
|
|
41
|
-
declare function matchClass(el: Element, regex: RegExp): boolean;
|
|
42
|
-
|
|
43
|
-
interface GuardedSetPointerCaptureArgs {
|
|
44
|
-
event: PointerEvent;
|
|
45
|
-
element?: Element;
|
|
46
|
-
debug?: boolean;
|
|
47
|
-
}
|
|
48
|
-
interface GuardedReleasePointerCaptureArgs {
|
|
49
|
-
event: PointerEvent;
|
|
50
|
-
element?: Element;
|
|
51
|
-
}
|
|
52
|
-
declare function guardedSetPointerCapture(args: GuardedSetPointerCaptureArgs): void;
|
|
53
|
-
declare function guardedReleasePointerCapture(args: GuardedReleasePointerCaptureArgs): void;
|
|
54
|
-
|
|
55
|
-
interface SlugifyOptions {
|
|
56
|
-
separator?: string;
|
|
57
|
-
trim?: boolean;
|
|
58
|
-
remove?: RegExp;
|
|
59
|
-
strict?: boolean;
|
|
60
|
-
lowercase?: boolean;
|
|
61
|
-
}
|
|
62
|
-
declare function slugify(string: string, options?: SlugifyOptions): string;
|
|
63
|
-
|
|
64
|
-
declare function uniq<T extends any[]>(a: T): any[];
|
|
65
|
-
|
|
66
|
-
type PickPartial<T, K extends keyof T> = {
|
|
67
|
-
[P in K]: Partial<T[P]>;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
type RequireAll<T> = {
|
|
71
|
-
[P in keyof T]-?: T[P];
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
type RequireAllNested<T> = {
|
|
75
|
-
[P in keyof T]-?: RequireAllNested<T[P]>;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
type ValueOf<T> = T[keyof T];
|
|
79
|
-
|
|
80
|
-
export { type InterpolateArgs, type PickPartial, type RequireAll, type RequireAllNested, type SlugifyOptions, type ValueOf, clampValue, easeInCubic, easeInOutCubic, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInQuad, easeInQuart, easeInQuint, easeOutBack, easeOutCubic, easeOutQuad, easeOutQuart, easeOutQuint, formatTime, guardedReleasePointerCapture, guardedSetPointerCapture, interpolate, isIOS, isWithinRange, linear, mapValue, matchClass, slugify, uniq };
|
package/dist/utils/index.mjs
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
// src/functions/clampValue.ts
|
|
2
|
-
function clampValue(value, min, max) {
|
|
3
|
-
return value <= min ? min : value >= max ? max : value;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
// src/functions/easings.ts
|
|
7
|
-
function linear(t) {
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
function easeInQuad(t) {
|
|
11
|
-
return t * t;
|
|
12
|
-
}
|
|
13
|
-
function easeOutQuad(t) {
|
|
14
|
-
return t * (2 - t);
|
|
15
|
-
}
|
|
16
|
-
function easeInOutQuad(t) {
|
|
17
|
-
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
18
|
-
}
|
|
19
|
-
function easeOutBack(t, o = 1.25) {
|
|
20
|
-
return 1 + (t - 1) * (t - 1) * ((o + 1) * (t - 1) + o);
|
|
21
|
-
}
|
|
22
|
-
function easeInCubic(t) {
|
|
23
|
-
return t * t * t;
|
|
24
|
-
}
|
|
25
|
-
function easeOutCubic(t) {
|
|
26
|
-
return --t * t * t + 1;
|
|
27
|
-
}
|
|
28
|
-
function easeInOutCubic(t) {
|
|
29
|
-
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
|
30
|
-
}
|
|
31
|
-
function easeInQuart(t) {
|
|
32
|
-
return t * t * t * t;
|
|
33
|
-
}
|
|
34
|
-
function easeOutQuart(t) {
|
|
35
|
-
return 1 - --t * t * t * t;
|
|
36
|
-
}
|
|
37
|
-
function easeInOutQuart(t) {
|
|
38
|
-
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
|
|
39
|
-
}
|
|
40
|
-
function easeInQuint(t) {
|
|
41
|
-
return t * t * t * t * t;
|
|
42
|
-
}
|
|
43
|
-
function easeOutQuint(t) {
|
|
44
|
-
return 1 + --t * t * t * t * t;
|
|
45
|
-
}
|
|
46
|
-
function easeInOutQuint(t) {
|
|
47
|
-
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// src/functions/toNumber.ts
|
|
51
|
-
function toNumber(value) {
|
|
52
|
-
return typeof value === "string" ? parseFloat(value) : Number(value);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/functions/formatTime.ts
|
|
56
|
-
function formatTime(seconds, guide) {
|
|
57
|
-
seconds = seconds < 0 ? 0 : seconds;
|
|
58
|
-
let s = Math.floor(seconds % 60);
|
|
59
|
-
let m = Math.floor(seconds / 60 % 60);
|
|
60
|
-
let h = Math.floor(seconds / 3600);
|
|
61
|
-
const gm = Math.floor(guide / 60 % 60);
|
|
62
|
-
const gh = Math.floor(guide / 3600);
|
|
63
|
-
if (isNaN(seconds) || seconds === Infinity) {
|
|
64
|
-
h = m = s = "-";
|
|
65
|
-
}
|
|
66
|
-
h = toNumber(h) > 0 || gh > 0 ? h + ":" : "";
|
|
67
|
-
m = ((h || gm >= 10) && toNumber(m) < 10 ? "0" + m : m) + ":";
|
|
68
|
-
s = toNumber(s) < 10 ? "0" + s : s;
|
|
69
|
-
return h + m + s;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/functions/interpolate.ts
|
|
73
|
-
function interpolate(args) {
|
|
74
|
-
const { from, to, duration, callback, easing = (t) => t * (2 - t) } = args;
|
|
75
|
-
let startTime;
|
|
76
|
-
function animate(timestamp) {
|
|
77
|
-
if (!startTime) startTime = timestamp;
|
|
78
|
-
const progress = Math.min(1, (timestamp - startTime) / duration);
|
|
79
|
-
const easedProgress = easing(progress);
|
|
80
|
-
const value = from + (to - from) * easedProgress;
|
|
81
|
-
callback(value);
|
|
82
|
-
if (progress < 1) {
|
|
83
|
-
requestAnimationFrame(animate);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
requestAnimationFrame(animate);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/functions/isIOS.ts
|
|
90
|
-
function isIOS() {
|
|
91
|
-
if (typeof window === "undefined") return false;
|
|
92
|
-
return /iPad|iPhone|iPod/.test(navigator == null ? void 0 : navigator.userAgent);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// src/functions/isWithinRange.ts
|
|
96
|
-
function isWithinRange(args) {
|
|
97
|
-
const { input, base, threshold } = args;
|
|
98
|
-
return input >= base - threshold && input <= base + threshold;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/functions/mapValue.ts
|
|
102
|
-
function mapValue(value, inMin, inMax, outMin, outMax) {
|
|
103
|
-
return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/functions/matchClass.ts
|
|
107
|
-
function matchClass(el, regex) {
|
|
108
|
-
return Array.from(el.classList).some((className) => regex.test(className));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// src/functions/pointerCapture.ts
|
|
112
|
-
function guardedSetPointerCapture(args) {
|
|
113
|
-
const { event, element, debug } = args;
|
|
114
|
-
if (element && event.isPrimary && event.pointerType !== "mouse") {
|
|
115
|
-
try {
|
|
116
|
-
const coalescedEvents = "getCoalescedEvents" in event ? event.getCoalescedEvents() : [event];
|
|
117
|
-
if (coalescedEvents.length > 0) {
|
|
118
|
-
element == null ? void 0 : element.setPointerCapture(event.pointerId);
|
|
119
|
-
}
|
|
120
|
-
} catch (error) {
|
|
121
|
-
if (debug) {
|
|
122
|
-
console.warn("Failed to set pointer capture:", error);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function guardedReleasePointerCapture(args) {
|
|
128
|
-
const { event, element } = args;
|
|
129
|
-
if (element == null ? void 0 : element.hasPointerCapture(event.pointerId)) {
|
|
130
|
-
element.releasePointerCapture(event.pointerId);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// src/functions/slugify.ts
|
|
135
|
-
var defaultOptions = {
|
|
136
|
-
separator: "-",
|
|
137
|
-
trim: true,
|
|
138
|
-
remove: void 0,
|
|
139
|
-
strict: true,
|
|
140
|
-
lowercase: true
|
|
141
|
-
};
|
|
142
|
-
function slugify(string, options) {
|
|
143
|
-
if (typeof string !== "string") {
|
|
144
|
-
throw new Error("slugify: string argument expected");
|
|
145
|
-
}
|
|
146
|
-
const _options = { ...defaultOptions, ...options };
|
|
147
|
-
const charMap = {};
|
|
148
|
-
let slug = string.normalize().split("").reduce(function(result, ch) {
|
|
149
|
-
let appendChar = charMap[ch];
|
|
150
|
-
if (appendChar === void 0) appendChar = ch;
|
|
151
|
-
if (appendChar === (_options == null ? void 0 : _options.separator)) appendChar = " ";
|
|
152
|
-
return result + appendChar.replace((_options == null ? void 0 : _options.remove) || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
|
153
|
-
}, "");
|
|
154
|
-
if (_options.strict) {
|
|
155
|
-
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
|
156
|
-
}
|
|
157
|
-
if (_options.trim) {
|
|
158
|
-
slug = slug.trim();
|
|
159
|
-
}
|
|
160
|
-
if (_options.separator) {
|
|
161
|
-
slug = slug.replace(/ +/g, _options.separator);
|
|
162
|
-
}
|
|
163
|
-
if (_options.lowercase) {
|
|
164
|
-
slug = slug.toLocaleLowerCase();
|
|
165
|
-
}
|
|
166
|
-
return slug;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// src/functions/uniq.ts
|
|
170
|
-
function uniq(a) {
|
|
171
|
-
return Array.from(new Set(a));
|
|
172
|
-
}
|
|
173
|
-
export {
|
|
174
|
-
clampValue,
|
|
175
|
-
easeInCubic,
|
|
176
|
-
easeInOutCubic,
|
|
177
|
-
easeInOutQuad,
|
|
178
|
-
easeInOutQuart,
|
|
179
|
-
easeInOutQuint,
|
|
180
|
-
easeInQuad,
|
|
181
|
-
easeInQuart,
|
|
182
|
-
easeInQuint,
|
|
183
|
-
easeOutBack,
|
|
184
|
-
easeOutCubic,
|
|
185
|
-
easeOutQuad,
|
|
186
|
-
easeOutQuart,
|
|
187
|
-
easeOutQuint,
|
|
188
|
-
formatTime,
|
|
189
|
-
guardedReleasePointerCapture,
|
|
190
|
-
guardedSetPointerCapture,
|
|
191
|
-
interpolate,
|
|
192
|
-
isIOS,
|
|
193
|
-
isWithinRange,
|
|
194
|
-
linear,
|
|
195
|
-
mapValue,
|
|
196
|
-
matchClass,
|
|
197
|
-
slugify,
|
|
198
|
-
uniq
|
|
199
|
-
};
|
|
200
|
-
//# sourceMappingURL=index.mjs.map
|