@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-optional", "data-active"];
|
|
5
|
+
import { computed, inject, provide, onBeforeUnmount, useId } from "vue";
|
|
6
|
+
import { useCookieItem } from "../composables/private/useCookieItem";
|
|
7
|
+
import {
|
|
8
|
+
MagicCookieInstanceId,
|
|
9
|
+
MagicCookieItemId,
|
|
10
|
+
MagicCookieItemActive
|
|
11
|
+
} from "../symbols";
|
|
12
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
13
|
+
__name: "MagicCookieItem",
|
|
14
|
+
props: {
|
|
15
|
+
id: { type: String, required: false },
|
|
16
|
+
optional: { type: Boolean, required: false },
|
|
17
|
+
maxAge: { type: Number, required: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const instanceId = inject(MagicCookieInstanceId, void 0);
|
|
21
|
+
if (!instanceId) {
|
|
22
|
+
throw new Error("MagicCookieItem must be nested inside MagicCookieProvider");
|
|
23
|
+
}
|
|
24
|
+
const mappedId = computed(() => __props.id ?? `magic-cookie-item-${useId()}`);
|
|
25
|
+
const mappedActive = computed(() => item.active);
|
|
26
|
+
const { initializeItem, deleteItem } = useCookieItem({
|
|
27
|
+
instanceId
|
|
28
|
+
});
|
|
29
|
+
const item = initializeItem({
|
|
30
|
+
id: mappedId.value,
|
|
31
|
+
optional: __props.optional,
|
|
32
|
+
maxAge: __props.maxAge
|
|
33
|
+
});
|
|
34
|
+
provide(MagicCookieItemId, mappedId.value);
|
|
35
|
+
provide(MagicCookieItemActive, mappedActive);
|
|
36
|
+
onBeforeUnmount(() => {
|
|
37
|
+
deleteItem(mappedId.value);
|
|
38
|
+
});
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return _openBlock(), _createElementBlock("div", {
|
|
41
|
+
class: "magic-cookie-item",
|
|
42
|
+
"data-optional": _unref(item).optional,
|
|
43
|
+
"data-active": _unref(item).active
|
|
44
|
+
}, [
|
|
45
|
+
_renderSlot(_ctx.$slots, "default", { item: _unref(item) })
|
|
46
|
+
], 8, _hoisted_1);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
.magic-cookie-item {
|
|
54
|
+
cursor: var(--magic-cookie-item-cursor, default);
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface MagicCookieItemProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
optional?: boolean;
|
|
4
|
+
maxAge?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const item: import("../types").CookieItem;
|
|
7
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
item: import("../types").CookieItem;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCookieItemProps, {
|
|
15
|
+
item: typeof item;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCookieItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { provide } from "vue";
|
|
5
|
+
import { defu } from "defu";
|
|
6
|
+
import { useCookieState } from "../composables/private/useCookieState";
|
|
7
|
+
import { defaultOptions } from "../utils/defaultOptions";
|
|
8
|
+
import { MagicCookieInstanceId } from "../symbols";
|
|
9
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
10
|
+
...{
|
|
11
|
+
inheritAttrs: false
|
|
12
|
+
},
|
|
13
|
+
__name: "MagicCookieProvider",
|
|
14
|
+
props: {
|
|
15
|
+
id: { type: null, required: true },
|
|
16
|
+
options: { type: Object, required: false }
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const mappedOptions = defu(__props.options, defaultOptions);
|
|
20
|
+
const { initializeState } = useCookieState(__props.id);
|
|
21
|
+
initializeState(mappedOptions);
|
|
22
|
+
provide(MagicCookieInstanceId, __props.id);
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
const _component_client_only = _resolveComponent("client-only");
|
|
25
|
+
return _openBlock(), _createBlock(_component_client_only, null, {
|
|
26
|
+
default: _withCtx(() => [
|
|
27
|
+
_createElementVNode(
|
|
28
|
+
"div",
|
|
29
|
+
_mergeProps({ class: "magic-cookie-provider" }, _ctx.$attrs),
|
|
30
|
+
[
|
|
31
|
+
_renderSlot(_ctx.$slots, "default")
|
|
32
|
+
],
|
|
33
|
+
16
|
|
34
|
+
/* FULL_PROPS */
|
|
35
|
+
)
|
|
36
|
+
]),
|
|
37
|
+
_: 3
|
|
38
|
+
/* FORWARDED */
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { MagicCookieOptions } from '../types/index.js';
|
|
3
|
+
type MagicCookieProviderProps = {
|
|
4
|
+
id: MaybeRef<string>;
|
|
5
|
+
options?: MagicCookieOptions;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
8
|
+
declare var __VLS_6: {};
|
|
9
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
10
|
+
default?: (props: typeof __VLS_6) => any;
|
|
11
|
+
}>;
|
|
12
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicCookieProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCookieProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCookieProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = { class: "magic-cookie-view__inner" };
|
|
5
|
+
import { inject } from "vue";
|
|
6
|
+
import { AutoSize } from "@maas/vue-autosize";
|
|
7
|
+
import { useCookieState } from "../composables/private/useCookieState";
|
|
8
|
+
import { useCookieCallback } from "../composables/private/useCookieCallback";
|
|
9
|
+
import { MagicCookieInstanceId } from "../symbols";
|
|
10
|
+
import "@maas/vue-equipment/utils/css/animations/fade-in.css";
|
|
11
|
+
import "@maas/vue-equipment/utils/css/animations/auto-size-out.css";
|
|
12
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
13
|
+
__name: "MagicCookieView",
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const instanceId = inject(MagicCookieInstanceId, void 0);
|
|
16
|
+
if (!instanceId) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
"MagicCookiePreferences must be used within a MagicCookieProvider"
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
const { initializeState } = useCookieState(instanceId);
|
|
22
|
+
const state = initializeState();
|
|
23
|
+
const {
|
|
24
|
+
onBeforeEnter,
|
|
25
|
+
onEnter,
|
|
26
|
+
onAfterEnter,
|
|
27
|
+
onBeforeLeave,
|
|
28
|
+
onLeave,
|
|
29
|
+
onAfterLeave
|
|
30
|
+
} = useCookieCallback(instanceId);
|
|
31
|
+
return (_ctx, _cache) => {
|
|
32
|
+
return _openBlock(), _createElementBlock(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
class: "magic-cookie-view",
|
|
36
|
+
style: _normalizeStyle({ "--mc-duration": `${_unref(state).options.animation?.duration}ms` })
|
|
37
|
+
},
|
|
38
|
+
[
|
|
39
|
+
_createVNode(_unref(AutoSize), { width: false }, {
|
|
40
|
+
default: _withCtx(() => [
|
|
41
|
+
_createVNode(_Transition, {
|
|
42
|
+
name: _unref(state).options.transition,
|
|
43
|
+
onBeforeLeave: _unref(onBeforeLeave),
|
|
44
|
+
onLeave: _unref(onLeave),
|
|
45
|
+
onAfterLeave: _unref(onAfterLeave),
|
|
46
|
+
onBeforeEnter: _unref(onBeforeEnter),
|
|
47
|
+
onEnter: _unref(onEnter),
|
|
48
|
+
onAfterEnter: _unref(onAfterEnter),
|
|
49
|
+
persisted: ""
|
|
50
|
+
}, {
|
|
51
|
+
default: _withCtx(() => [
|
|
52
|
+
_withDirectives(_createElementVNode(
|
|
53
|
+
"div",
|
|
54
|
+
_hoisted_1,
|
|
55
|
+
[
|
|
56
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
57
|
+
viewActive: _unref(state).viewActive
|
|
58
|
+
})
|
|
59
|
+
],
|
|
60
|
+
512
|
|
61
|
+
/* NEED_PATCH */
|
|
62
|
+
), [
|
|
63
|
+
[_vShow, _unref(state).viewActive]
|
|
64
|
+
])
|
|
65
|
+
]),
|
|
66
|
+
_: 3
|
|
67
|
+
/* FORWARDED */
|
|
68
|
+
}, 8, ["name", "onBeforeLeave", "onLeave", "onAfterLeave", "onBeforeEnter", "onEnter", "onAfterEnter"])
|
|
69
|
+
]),
|
|
70
|
+
_: 3
|
|
71
|
+
/* FORWARDED */
|
|
72
|
+
})
|
|
73
|
+
],
|
|
74
|
+
4
|
|
75
|
+
/* STYLE */
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
.magic-cookie-view {
|
|
84
|
+
width: 100%;
|
|
85
|
+
clip-path: var(--magic-cookie-view-clip-path, inset(0));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.magic-cookie-view-enter-active {
|
|
89
|
+
position: relative;
|
|
90
|
+
animation: fade-in var(--mc-duration) var(--ease-in-out);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.magic-cookie-view-leave-active {
|
|
94
|
+
animation: auto-size-out var(--mc-duration) var(--ease-in-out);
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AutoSize } from '@maas/vue-autosize';
|
|
2
|
+
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
3
|
+
import '@maas/vue-equipment/utils/css/animations/auto-size-out.css';
|
|
4
|
+
declare const state: import("../types").CookieState;
|
|
5
|
+
declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
|
|
6
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
7
|
+
declare var __VLS_18: {
|
|
8
|
+
viewActive: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
11
|
+
default?: (props: typeof __VLS_18) => any;
|
|
12
|
+
}>;
|
|
13
|
+
declare const __VLS_self: import("vue").DefineComponent<{}, {
|
|
14
|
+
AutoSize: typeof AutoSize;
|
|
15
|
+
state: typeof state;
|
|
16
|
+
onBeforeEnter: typeof onBeforeEnter;
|
|
17
|
+
onEnter: typeof onEnter;
|
|
18
|
+
onAfterEnter: typeof onAfterEnter;
|
|
19
|
+
onBeforeLeave: typeof onBeforeLeave;
|
|
20
|
+
onLeave: typeof onLeave;
|
|
21
|
+
onAfterLeave: typeof onAfterLeave;
|
|
22
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
export declare function useCookieCallback(instanceId: MaybeRef<string>): {
|
|
3
|
+
onBeforeEnter: () => void;
|
|
4
|
+
onEnter: () => void;
|
|
5
|
+
onAfterEnter: () => Promise<void>;
|
|
6
|
+
onBeforeLeave: () => void;
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
onAfterLeave: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { toValue } from "vue";
|
|
2
|
+
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
3
|
+
export function useCookieCallback(instanceId) {
|
|
4
|
+
const emitter = useMagicEmitter();
|
|
5
|
+
function onBeforeEnter() {
|
|
6
|
+
emitter.emit("beforeEnter", toValue(instanceId));
|
|
7
|
+
}
|
|
8
|
+
function onEnter() {
|
|
9
|
+
emitter.emit("enter", toValue(instanceId));
|
|
10
|
+
}
|
|
11
|
+
async function onAfterEnter() {
|
|
12
|
+
emitter.emit("afterEnter", toValue(instanceId));
|
|
13
|
+
}
|
|
14
|
+
function onBeforeLeave() {
|
|
15
|
+
emitter.emit("beforeLeave", toValue(instanceId));
|
|
16
|
+
}
|
|
17
|
+
function onLeave() {
|
|
18
|
+
emitter.emit("leave", toValue(instanceId));
|
|
19
|
+
}
|
|
20
|
+
function onAfterLeave() {
|
|
21
|
+
emitter.emit("afterLeave", toValue(instanceId));
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
onBeforeEnter,
|
|
25
|
+
onEnter,
|
|
26
|
+
onAfterEnter,
|
|
27
|
+
onBeforeLeave,
|
|
28
|
+
onLeave,
|
|
29
|
+
onAfterLeave
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { CookieItem } from '../../types/index.js';
|
|
3
|
+
type UseCookieItemArgs = {
|
|
4
|
+
instanceId: MaybeRef<string>;
|
|
5
|
+
};
|
|
6
|
+
type InitializeItemArgs = Omit<CookieItem, 'active'>;
|
|
7
|
+
export declare function useCookieItem(args: UseCookieItemArgs): {
|
|
8
|
+
initializeItem: (args: InitializeItemArgs) => CookieItem;
|
|
9
|
+
deleteItem: (id: string) => void;
|
|
10
|
+
getItem: (id: string) => CookieItem | undefined;
|
|
11
|
+
selectItem: (id: string, timestamp?: number) => void;
|
|
12
|
+
unselectItem: (id: string, timestamp?: number) => void;
|
|
13
|
+
toggleItem: (id: string) => void;
|
|
14
|
+
setItemCookie: (id: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { reactive, toValue } from "vue";
|
|
2
|
+
import { useCookies } from "@vueuse/integrations/useCookies";
|
|
3
|
+
import { useCookieState } from "./useCookieState.mjs";
|
|
4
|
+
export function useCookieItem(args) {
|
|
5
|
+
const { instanceId } = args;
|
|
6
|
+
const { initializeState } = useCookieState(instanceId);
|
|
7
|
+
const state = initializeState();
|
|
8
|
+
function getBrowserCookie(id) {
|
|
9
|
+
const universalCookies = useCookies([id]);
|
|
10
|
+
return universalCookies.get(id);
|
|
11
|
+
}
|
|
12
|
+
function createItem(args2) {
|
|
13
|
+
const { id, optional, maxAge = state.options.maxAge } = args2;
|
|
14
|
+
const storedValue = getBrowserCookie(id);
|
|
15
|
+
const mappedActive = storedValue ?? (optional === false ? true : false);
|
|
16
|
+
const mappedOptional = optional ?? true;
|
|
17
|
+
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
18
|
+
const item = {
|
|
19
|
+
id,
|
|
20
|
+
active: mappedActive,
|
|
21
|
+
optional: mappedOptional,
|
|
22
|
+
timestamp,
|
|
23
|
+
maxAge
|
|
24
|
+
};
|
|
25
|
+
console.log(item);
|
|
26
|
+
return reactive(item);
|
|
27
|
+
}
|
|
28
|
+
function addItem(args2) {
|
|
29
|
+
const item = createItem(args2);
|
|
30
|
+
state.items.push(item);
|
|
31
|
+
return item;
|
|
32
|
+
}
|
|
33
|
+
function initializeItem(args2) {
|
|
34
|
+
const { id } = args2;
|
|
35
|
+
const item = getItem(id) ?? addItem(args2);
|
|
36
|
+
return item;
|
|
37
|
+
}
|
|
38
|
+
function deleteItem(id) {
|
|
39
|
+
if (!state?.items) return;
|
|
40
|
+
state.items = state.items.filter((x) => x.id !== id);
|
|
41
|
+
}
|
|
42
|
+
function getItem(id) {
|
|
43
|
+
return state?.items.find((item) => {
|
|
44
|
+
return item.id === id;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function selectItem(id, timestamp) {
|
|
48
|
+
const item = getItem(id);
|
|
49
|
+
if (item) {
|
|
50
|
+
item.active = true;
|
|
51
|
+
item.timestamp = timestamp ?? item.timestamp;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function unselectItem(id, timestamp) {
|
|
55
|
+
const item = getItem(id);
|
|
56
|
+
if (item) {
|
|
57
|
+
item.active = false;
|
|
58
|
+
item.timestamp = timestamp ?? item.timestamp;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function toggleItem(id) {
|
|
62
|
+
const item = getItem(id);
|
|
63
|
+
if (item) {
|
|
64
|
+
item.active = !item.active;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function setItemCookie(id) {
|
|
68
|
+
const item = getItem(id);
|
|
69
|
+
if (!item) {
|
|
70
|
+
console.warn(`Item ${id} not found. Cookie cannot be set.`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
useCookies([id]).set(toValue(id), item.active, {
|
|
74
|
+
path: "/",
|
|
75
|
+
maxAge: item.maxAge
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
initializeItem,
|
|
80
|
+
deleteItem,
|
|
81
|
+
getItem,
|
|
82
|
+
selectItem,
|
|
83
|
+
unselectItem,
|
|
84
|
+
toggleItem,
|
|
85
|
+
setItemCookie
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
+
import type { CookieState, MagicCookieOptions } from '../../types/index.js';
|
|
3
|
+
export declare function useCookieState(instanceId: MaybeRef<string>): {
|
|
4
|
+
initializeState: (options?: MagicCookieOptions) => CookieState;
|
|
5
|
+
deleteState: () => void;
|
|
6
|
+
cookieStateStore: Ref<CookieState[], CookieState[]>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ref, reactive, toValue } from "vue";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { defaultOptions } from "../../utils/defaultOptions.mjs";
|
|
4
|
+
const cookieStateStore = ref([]);
|
|
5
|
+
export function useCookieState(instanceId) {
|
|
6
|
+
function createState(id) {
|
|
7
|
+
const state = {
|
|
8
|
+
id,
|
|
9
|
+
items: [],
|
|
10
|
+
options: { ...defaultOptions },
|
|
11
|
+
viewActive: false
|
|
12
|
+
};
|
|
13
|
+
return reactive(state);
|
|
14
|
+
}
|
|
15
|
+
function addState(id) {
|
|
16
|
+
const state = createState(id);
|
|
17
|
+
cookieStateStore.value = [...cookieStateStore.value, state];
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
function initializeState(options) {
|
|
21
|
+
let state = cookieStateStore.value.find((entry) => {
|
|
22
|
+
return entry.id === toValue(instanceId);
|
|
23
|
+
});
|
|
24
|
+
if (!state) {
|
|
25
|
+
state = addState(toValue(instanceId));
|
|
26
|
+
}
|
|
27
|
+
if (options) {
|
|
28
|
+
const mappedOptions = defu(options, defaultOptions);
|
|
29
|
+
state.options = mappedOptions;
|
|
30
|
+
}
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
function deleteState() {
|
|
34
|
+
cookieStateStore.value = cookieStateStore.value.filter(
|
|
35
|
+
(x) => x.id !== toValue(instanceId)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
initializeState,
|
|
40
|
+
deleteState,
|
|
41
|
+
cookieStateStore
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { CookieConsent, MagicCookieCallbackArgs } from '../types/index.js';
|
|
3
|
+
export declare function useMagicCookie(id: MaybeRef<string>): {
|
|
4
|
+
showView: () => void;
|
|
5
|
+
hideView: () => void;
|
|
6
|
+
toggleView: () => void;
|
|
7
|
+
cookieConsent: import("vue").ComputedRef<CookieConsent>;
|
|
8
|
+
selectItem: (id: string, timestamp?: number) => void;
|
|
9
|
+
unselectItem: (id: string, timestamp?: number) => void;
|
|
10
|
+
toggleItem: (id: string) => void;
|
|
11
|
+
acceptAll: () => Promise<void>;
|
|
12
12
|
acceptSelected: () => void;
|
|
13
|
-
|
|
14
|
-
onAccept: (
|
|
15
|
-
onAcceptSelected: (
|
|
16
|
-
onReject: (
|
|
13
|
+
rejectAll: () => Promise<void>;
|
|
14
|
+
onAccept: (callback: (args: MagicCookieCallbackArgs) => void) => void;
|
|
15
|
+
onAcceptSelected: (callback: (args: MagicCookieCallbackArgs) => void) => void;
|
|
16
|
+
onReject: (callback: (args: MagicCookieCallbackArgs) => void) => void;
|
|
17
17
|
};
|
|
18
18
|
export type UseMagicCookieReturn = ReturnType<typeof useMagicCookie>;
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import { computed,
|
|
2
|
-
import { useCookies } from "@vueuse/integrations/useCookies";
|
|
3
|
-
import { toValue } from "@vueuse/core";
|
|
1
|
+
import { computed, nextTick } from "vue";
|
|
4
2
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
get: () => {
|
|
12
|
-
return universalCookies.get("cookie_consent");
|
|
13
|
-
},
|
|
14
|
-
set: (value) => {
|
|
15
|
-
universalCookies.set("cookie_consent", value, {
|
|
16
|
-
path: "/",
|
|
17
|
-
maxAge: cookieApiStore.value?.maxAge
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
3
|
+
import { useCookieState } from "./private/useCookieState.mjs";
|
|
4
|
+
import { useCookieItem } from "./private/useCookieItem.mjs";
|
|
5
|
+
export function useMagicCookie(id) {
|
|
6
|
+
const { selectItem, unselectItem, toggleItem, setItemCookie } = useCookieItem(
|
|
7
|
+
{ instanceId: id }
|
|
8
|
+
);
|
|
21
9
|
const emitter = useMagicEmitter();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
const { initializeState } = useCookieState(id);
|
|
11
|
+
const state = initializeState();
|
|
12
|
+
const cookieConsent = computed(
|
|
13
|
+
() => state?.items.reduce(
|
|
14
|
+
(acc, cookie) => ({
|
|
15
|
+
...acc,
|
|
16
|
+
[cookie.id]: cookie.optional === false ? true : cookie.active
|
|
17
|
+
}),
|
|
18
|
+
{}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
function showView() {
|
|
22
|
+
state.viewActive = true;
|
|
23
|
+
}
|
|
24
|
+
function hideView() {
|
|
25
|
+
state.viewActive = false;
|
|
28
26
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, {});
|
|
34
|
-
selectedCookies.value = cookies;
|
|
27
|
+
function toggleView() {
|
|
28
|
+
state.viewActive = !state.viewActive;
|
|
29
|
+
}
|
|
30
|
+
async function acceptAll() {
|
|
35
31
|
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
for (const cookie of state.items) {
|
|
33
|
+
selectItem(cookie.id, timestamp);
|
|
34
|
+
setItemCookie(cookie.id);
|
|
35
|
+
}
|
|
36
|
+
await nextTick();
|
|
37
|
+
emitter.emit("acceptAll", cookieConsent.value);
|
|
38
38
|
}
|
|
39
39
|
function acceptSelected() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
cookies: selectedCookies.value
|
|
44
|
-
};
|
|
40
|
+
for (const cookie of state.items) {
|
|
41
|
+
setItemCookie(cookie.id);
|
|
42
|
+
}
|
|
45
43
|
emitter.emit("acceptSelected", cookieConsent.value);
|
|
46
44
|
}
|
|
47
|
-
function
|
|
48
|
-
const cookies = cookieApiStore.value?.cookies?.reduce((result, cookie) => {
|
|
49
|
-
result[cookie.key] = cookie.optional === false ? true : false;
|
|
50
|
-
return result;
|
|
51
|
-
}, {});
|
|
52
|
-
selectedCookies.value = cookies;
|
|
45
|
+
async function rejectAll() {
|
|
53
46
|
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
for (const cookie of state.items) {
|
|
48
|
+
if (cookie.optional !== false) {
|
|
49
|
+
unselectItem(cookie.id, timestamp);
|
|
50
|
+
}
|
|
51
|
+
setItemCookie(cookie.id);
|
|
52
|
+
}
|
|
53
|
+
await nextTick();
|
|
54
|
+
emitter.emit("rejectAll", cookieConsent.value);
|
|
56
55
|
}
|
|
57
|
-
function onAccept(
|
|
58
|
-
emitter.on("
|
|
56
|
+
function onAccept(callback) {
|
|
57
|
+
emitter.on("acceptAll", callback);
|
|
59
58
|
}
|
|
60
|
-
function onAcceptSelected(
|
|
61
|
-
emitter.on(
|
|
62
|
-
"acceptSelected",
|
|
63
|
-
(args) => handler(toValue(args))
|
|
64
|
-
);
|
|
59
|
+
function onAcceptSelected(callback) {
|
|
60
|
+
emitter.on("acceptSelected", callback);
|
|
65
61
|
}
|
|
66
|
-
function onReject(
|
|
67
|
-
emitter.on("
|
|
62
|
+
function onReject(callback) {
|
|
63
|
+
emitter.on("rejectAll", callback);
|
|
68
64
|
}
|
|
69
65
|
return {
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
showView,
|
|
67
|
+
hideView,
|
|
68
|
+
toggleView,
|
|
72
69
|
cookieConsent,
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
selectItem,
|
|
71
|
+
unselectItem,
|
|
72
|
+
toggleItem,
|
|
73
|
+
acceptAll,
|
|
75
74
|
acceptSelected,
|
|
76
|
-
|
|
75
|
+
rejectAll,
|
|
77
76
|
onAccept,
|
|
78
77
|
onAcceptSelected,
|
|
79
78
|
onReject
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InjectionKey, MaybeRef, Ref } from 'vue';
|
|
2
|
+
declare const MagicCookieInstanceId: InjectionKey<MaybeRef<string>>;
|
|
3
|
+
declare const MagicCookieItemId: InjectionKey<string>;
|
|
4
|
+
declare const MagicCookieItemActive: InjectionKey<Ref<boolean>>;
|
|
5
|
+
export { MagicCookieInstanceId, MagicCookieItemId, MagicCookieItemActive };
|