@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.
Files changed (349) hide show
  1. package/README.md +6 -16
  2. package/dist/composables/index.d.ts +7 -18
  3. package/dist/composables/index.js +79 -132
  4. package/dist/composables/index.js.map +1 -1
  5. package/dist/nuxt/module.json +1 -1
  6. package/dist/nuxt/module.mjs +35 -42
  7. package/dist/plugins/.turbo/turbo-build.log +0 -0
  8. package/dist/plugins/.turbo/turbo-lint.log +5 -0
  9. package/dist/plugins/.turbo/turbo-release.log +7 -0
  10. package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
  11. package/dist/plugins/MagicAccordion/index.d.ts +2 -0
  12. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
  13. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
  14. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
  15. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
  16. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
  17. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
  18. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
  19. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
  20. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
  21. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
  22. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
  23. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
  24. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
  25. package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
  26. package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
  27. package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
  28. package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
  29. package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
  30. package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
  31. package/dist/plugins/MagicCommand/index.d.ts +2 -0
  32. package/dist/plugins/MagicCommand/index.mjs +9 -11
  33. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
  34. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
  35. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
  36. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
  37. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
  38. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
  39. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
  40. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
  41. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
  42. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
  43. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
  44. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
  45. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
  46. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
  47. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
  48. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
  49. package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
  50. package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
  51. package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
  52. package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
  53. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
  54. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
  55. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
  56. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
  57. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
  58. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
  59. package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
  60. package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
  61. package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
  62. package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
  63. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
  64. package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
  65. package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
  66. package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
  67. package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
  68. package/dist/plugins/MagicCookie/index.d.ts +5 -3
  69. package/dist/plugins/MagicCookie/index.mjs +7 -3
  70. package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
  71. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
  72. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
  73. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
  74. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
  75. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
  76. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
  77. package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
  78. package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
  79. package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
  80. package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
  81. package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
  82. package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
  83. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
  84. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
  85. package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
  86. package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
  87. package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
  88. package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
  89. package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
  90. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
  91. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
  92. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
  93. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
  94. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
  95. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
  96. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
  97. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
  98. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
  99. package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
  100. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
  101. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
  102. package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
  103. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
  104. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
  105. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
  106. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
  107. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
  108. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
  109. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
  110. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
  111. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
  112. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
  113. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
  114. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
  115. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
  116. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
  117. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
  118. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
  119. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
  120. package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
  121. package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
  122. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
  123. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
  124. package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
  125. package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
  126. package/dist/plugins/MagicMarquee/index.d.ts +4 -2
  127. package/dist/plugins/MagicMarquee/index.mjs +2 -1
  128. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
  129. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
  130. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
  131. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
  132. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
  133. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
  134. package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
  135. package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
  136. package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
  137. package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
  138. package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
  139. package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
  140. package/dist/plugins/MagicMenu/index.d.ts +2 -0
  141. package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
  142. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
  143. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
  144. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
  145. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
  146. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
  147. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
  148. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
  149. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
  150. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
  151. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
  152. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
  153. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
  154. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
  155. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
  156. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
  157. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
  158. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
  159. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
  160. package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
  161. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
  162. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
  163. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
  164. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
  165. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
  166. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
  167. package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
  168. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
  169. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
  170. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
  171. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
  172. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
  173. package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
  174. package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
  175. package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
  176. package/dist/plugins/MagicModal/src/components/MagicModal.vue +266 -166
  177. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
  178. package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
  179. package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
  180. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
  181. package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
  182. package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
  183. package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
  184. package/dist/plugins/MagicNoise/index.d.ts +3 -1
  185. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
  186. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
  187. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
  188. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
  189. package/dist/plugins/MagicPie/index.d.ts +7 -0
  190. package/dist/plugins/MagicPie/index.mjs +8 -0
  191. package/dist/plugins/MagicPie/nuxt.mjs +23 -0
  192. package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -0
  193. package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
  194. package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
  195. package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
  196. package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
  197. package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
  198. package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
  199. package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
  200. package/dist/plugins/MagicPlayer/index.d.ts +4 -9
  201. package/dist/plugins/MagicPlayer/index.mjs +11 -17
  202. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
  203. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
  204. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
  205. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
  206. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
  207. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
  208. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
  209. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
  210. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
  211. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
  212. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
  213. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
  214. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
  215. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
  216. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
  217. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
  218. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
  219. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
  220. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
  221. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
  222. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  223. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  224. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  225. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  226. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  227. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  228. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
  229. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  230. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
  231. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
  232. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
  233. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
  234. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
  235. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
  236. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
  237. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
  238. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
  239. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
  240. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
  241. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
  242. package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
  243. package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
  244. package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
  245. package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
  246. package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
  247. package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
  248. package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
  249. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
  250. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
  251. package/dist/plugins/MagicScroll/index.d.ts +4 -10
  252. package/dist/plugins/MagicScroll/index.mjs +2 -11
  253. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
  254. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
  255. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
  256. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
  257. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
  258. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
  259. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
  260. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
  261. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
  262. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
  263. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
  264. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
  265. package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
  266. package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
  267. package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
  268. package/dist/plugins/MagicToast/index.d.ts +3 -2
  269. package/dist/plugins/MagicToast/index.mjs +3 -3
  270. package/dist/plugins/MagicToast/nuxt.mjs +2 -2
  271. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
  272. package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
  273. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
  274. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
  275. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
  276. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
  277. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
  278. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
  279. package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
  280. package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
  281. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
  282. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
  283. package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
  284. package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
  285. package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
  286. package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
  287. package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
  288. package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
  289. package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
  290. package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
  291. package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
  292. package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
  293. package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
  294. package/dist/plugins/index.d.ts +1 -1
  295. package/dist/plugins/index.mjs +1 -1
  296. package/dist/utils/css/animations/auto-size-out.css +12 -0
  297. package/dist/utils/css/animations/squash-y.css +5 -0
  298. package/dist/utils/css/animations.css +2 -1
  299. package/dist/utils/index.d.ts +10 -6
  300. package/dist/utils/index.js +41 -56
  301. package/dist/utils/index.js.map +1 -1
  302. package/package.json +62 -58
  303. package/dist/composables/index.d.mts +0 -108
  304. package/dist/composables/index.mjs +0 -383
  305. package/dist/composables/index.mjs.map +0 -1
  306. package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
  307. package/dist/plugins/MagicAutoSize/index.mjs +0 -7
  308. package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
  309. package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
  310. package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
  311. package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
  312. package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
  313. package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
  314. package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
  315. package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
  316. package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
  317. package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
  318. package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
  319. package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
  320. package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
  321. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
  322. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
  323. package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
  324. package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
  325. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
  326. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
  327. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
  328. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
  329. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
  330. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
  331. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
  332. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
  333. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
  334. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
  335. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
  336. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
  337. package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
  338. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
  339. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
  340. package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
  341. package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
  342. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
  343. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
  344. package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
  345. package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
  346. package/dist/utils/index.d.mts +0 -80
  347. package/dist/utils/index.mjs +0 -200
  348. package/dist/utils/index.mjs.map +0 -1
  349. /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
@@ -1,192 +1,292 @@
1
- <template>
2
- <teleport
3
- v-if="wrapperActive"
4
- :to="mappedOptions.teleport?.target"
5
- :disabled="mappedOptions.teleport?.disabled"
6
- >
7
- <div
8
- ref="modalRef"
9
- class="magic-modal"
10
- :id="toValue(id)"
11
- v-bind="$attrs"
12
- @click.self="close"
13
- aria-modal="true"
14
- >
15
- <transition
16
- v-if="mappedOptions.backdrop || !!$slots.backdrop"
17
- :name="mappedOptions.transition?.backdrop"
18
- >
19
- <div
20
- v-show="innerActive"
21
- class="magic-modal__backdrop"
22
- @click.self="close"
23
- >
24
- <slot name="backdrop" />
25
- </div>
26
- </transition>
27
- <transition
28
- :name="mappedOptions.transition?.content"
29
- @before-leave="onBeforeLeave"
30
- @leave="onLeave"
31
- @after-leave="onAfterLeave"
32
- @before-enter="onBeforeEnter"
33
- @enter="onEnter"
34
- @after-enter="onAfterEnter"
35
- >
36
- <component
37
- :is="mappedOptions.tag"
38
- v-show="innerActive"
39
- class="magic-modal__content"
40
- @click.self="close"
41
- >
42
- <component
43
- v-if="component"
44
- v-bind="props"
45
- :is="component"
46
- @close="close"
47
- />
48
- <slot v-else />
49
- </component>
50
- </transition>
51
- </div>
52
- </teleport>
53
- </template>
54
-
55
- <script setup lang="ts">
1
+ <script>
2
+ import { defineComponent as _defineComponent } from "vue";
3
+ import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, createVNode as _createVNode, mergeProps as _mergeProps, Teleport as _Teleport } from "vue";
4
+ const _hoisted_1 = ["data-id"];
56
5
  import {
57
- ref,
6
+ useTemplateRef,
7
+ shallowRef,
58
8
  watch,
59
9
  nextTick,
60
10
  toValue,
61
11
  onBeforeUnmount,
62
- onUnmounted,
63
- type Component,
64
- type MaybeRef,
65
- } from 'vue'
66
- import { createDefu } from 'defu'
67
- import { onKeyStroke } from '@vueuse/core'
68
- import { defaultOptions } from './../utils/defaultOptions'
69
- import { useModalDOM } from '../composables/private/useModalDOM'
70
- import { useModalCallback } from '../composables/private/useModalCallback'
71
- import { useMagicModal } from '../composables/useMagicModal'
72
-
73
- import type { MagicModalOptions } from './../types/index'
74
-
75
- import '@maas/vue-equipment/utils/css/animations/fade-in.css'
76
- import '@maas/vue-equipment/utils/css/animations/fade-out.css'
77
-
78
- defineOptions({
79
- inheritAttrs: false,
80
- })
81
-
82
- // Prevent keyListener array from being merged with default
83
- const customDefu = createDefu((obj, key, value) => {
84
- if (key === 'close') {
85
- obj[key] = value
86
- return true
12
+ onUnmounted
13
+ } from "vue";
14
+ import { createDefu } from "defu";
15
+ import { onKeyStroke } from "@vueuse/core";
16
+ import { defaultOptions } from "./../utils/defaultOptions";
17
+ import { useModalDOM } from "../composables/private/useModalDOM";
18
+ import { useModalCallback } from "../composables/private/useModalCallback";
19
+ import { useMagicModal } from "../composables/useMagicModal";
20
+ import "@maas/vue-equipment/utils/css/animations/fade-in.css";
21
+ import "@maas/vue-equipment/utils/css/animations/fade-out.css";
22
+ export default /* @__PURE__ */ _defineComponent({
23
+ ...{
24
+ inheritAttrs: false
25
+ },
26
+ __name: "MagicModal",
27
+ props: {
28
+ id: { type: null, required: true },
29
+ props: { type: Object, required: false },
30
+ options: { type: Object, required: false, default: () => ({}) }
31
+ },
32
+ setup(__props) {
33
+ const customDefu = createDefu((obj, key, value) => {
34
+ if (key === "close") {
35
+ obj[key] = value;
36
+ return true;
37
+ }
38
+ });
39
+ const mappedOptions = customDefu(__props.options, defaultOptions);
40
+ const modalRef = useTemplateRef("modal");
41
+ const {
42
+ trapFocus,
43
+ releaseFocus,
44
+ lockScroll,
45
+ unlockScroll,
46
+ addScrollLockPadding,
47
+ removeScrollLockPadding
48
+ } = useModalDOM({
49
+ focusTarget: modalRef,
50
+ focusTrap: mappedOptions.focusTrap
51
+ });
52
+ const { isActive, close } = useMagicModal(__props.id);
53
+ const innerActive = shallowRef(false);
54
+ const wrapperActive = shallowRef(false);
55
+ const {
56
+ onBeforeEnter,
57
+ onEnter,
58
+ onAfterEnter,
59
+ onBeforeLeave,
60
+ onLeave,
61
+ onAfterLeave
62
+ } = useModalCallback({
63
+ id: __props.id,
64
+ mappedOptions,
65
+ addScrollLockPadding,
66
+ removeScrollLockPadding,
67
+ lockScroll,
68
+ unlockScroll,
69
+ trapFocus,
70
+ releaseFocus,
71
+ wrapperActive
72
+ });
73
+ async function onOpen() {
74
+ wrapperActive.value = true;
75
+ await nextTick();
76
+ innerActive.value = true;
77
+ }
78
+ function onClose() {
79
+ innerActive.value = false;
80
+ }
81
+ if (mappedOptions.keyListener?.close) {
82
+ for (const key of mappedOptions.keyListener.close) {
83
+ onKeyStroke(key, (e) => {
84
+ close();
85
+ e.preventDefault();
86
+ });
87
+ }
88
+ }
89
+ watch(isActive, async (value) => {
90
+ if (value) {
91
+ await onOpen();
92
+ } else {
93
+ onClose();
94
+ }
95
+ });
96
+ onBeforeUnmount(() => {
97
+ close();
98
+ });
99
+ onUnmounted(() => {
100
+ if (mappedOptions.scrollLock) {
101
+ unlockScroll();
102
+ if (typeof mappedOptions.scrollLock === "object" && mappedOptions.scrollLock.padding) {
103
+ removeScrollLockPadding();
104
+ }
105
+ }
106
+ if (mappedOptions.focusTrap) {
107
+ releaseFocus();
108
+ }
109
+ });
110
+ return (_ctx, _cache) => {
111
+ return wrapperActive.value ? (_openBlock(), _createBlock(_Teleport, {
112
+ key: 0,
113
+ to: _unref(mappedOptions).teleport?.target,
114
+ disabled: _unref(mappedOptions).teleport?.disabled
115
+ }, [
116
+ _createElementVNode("div", _mergeProps({
117
+ ref: "modal",
118
+ class: "magic-modal",
119
+ "data-id": toValue(_ctx.id)
120
+ }, _ctx.$attrs, {
121
+ "aria-modal": "true",
122
+ onClick: _cache[1] || (_cache[1] = _withModifiers(
123
+ //@ts-ignore
124
+ (...args) => _unref(close) && _unref(close)(...args),
125
+ ["self"]
126
+ ))
127
+ }), [
128
+ _unref(mappedOptions).backdrop || !!_ctx.$slots.backdrop ? (_openBlock(), _createBlock(_Transition, {
129
+ key: 0,
130
+ name: _unref(mappedOptions).transition?.backdrop,
131
+ persisted: ""
132
+ }, {
133
+ default: _withCtx(() => [
134
+ _withDirectives(_createElementVNode(
135
+ "div",
136
+ {
137
+ class: "magic-modal__backdrop",
138
+ onClick: _cache[0] || (_cache[0] = _withModifiers(
139
+ //@ts-ignore
140
+ (...args) => _unref(close) && _unref(close)(...args),
141
+ ["self"]
142
+ ))
143
+ },
144
+ [
145
+ _renderSlot(_ctx.$slots, "backdrop")
146
+ ],
147
+ 512
148
+ /* NEED_PATCH */
149
+ ), [
150
+ [_vShow, innerActive.value]
151
+ ])
152
+ ]),
153
+ _: 3
154
+ /* FORWARDED */
155
+ }, 8, ["name"])) : _createCommentVNode("v-if", true),
156
+ _createVNode(_Transition, {
157
+ name: _unref(mappedOptions).transition?.content,
158
+ onBeforeLeave: _unref(onBeforeLeave),
159
+ onLeave: _unref(onLeave),
160
+ onAfterLeave: _unref(onAfterLeave),
161
+ onBeforeEnter: _unref(onBeforeEnter),
162
+ onEnter: _unref(onEnter),
163
+ onAfterEnter: _unref(onAfterEnter),
164
+ persisted: ""
165
+ }, {
166
+ default: _withCtx(() => [
167
+ _withDirectives((_openBlock(), _createBlock(_resolveDynamicComponent(_unref(mappedOptions).tag), {
168
+ class: "magic-modal__content",
169
+ onClick: _withModifiers(_unref(close), ["self"])
170
+ }, {
171
+ default: _withCtx(() => [
172
+ _renderSlot(_ctx.$slots, "default")
173
+ ]),
174
+ _: 3
175
+ /* FORWARDED */
176
+ }, 8, ["onClick"])), [
177
+ [_vShow, innerActive.value]
178
+ ])
179
+ ]),
180
+ _: 3
181
+ /* FORWARDED */
182
+ }, 8, ["name", "onBeforeLeave", "onLeave", "onAfterLeave", "onBeforeEnter", "onEnter", "onAfterEnter"])
183
+ ], 16, _hoisted_1)
184
+ ], 8, ["to", "disabled"])) : _createCommentVNode("v-if", true);
185
+ };
87
186
  }
88
- })
187
+ });
188
+ </script>
89
189
 
90
- interface MagicModalProps {
91
- id: MaybeRef<string>
92
- component?: Component
93
- props?: Record<string, unknown>
94
- options?: MagicModalOptions
190
+ <style>
191
+ @keyframes mm-content-enter {
192
+ 0% {
193
+ opacity: 0;
194
+ transform: translate3d(0, 2rem, 0);
195
+ }
196
+ 100% {
197
+ opacity: 1;
198
+ transform: translate3d(0, 0, 0);
199
+ }
95
200
  }
96
201
 
97
- const props = withDefaults(defineProps<MagicModalProps>(), {
98
- options: () => defaultOptions,
99
- })
202
+ @keyframes mm-content-leave {
203
+ 0% {
204
+ opacity: 1;
205
+ transform: scale(1);
206
+ }
207
+ 100% {
208
+ opacity: 0;
209
+ transform: scale(1.02);
210
+ }
211
+ }
100
212
 
101
- const mappedOptions = customDefu(props.options, defaultOptions)
102
- const modalRef = ref<HTMLElement | undefined>(undefined)
103
- const {
104
- trapFocus,
105
- releaseFocus,
106
- lockScroll,
107
- unlockScroll,
108
- addScrollLockPadding,
109
- removeScrollLockPadding,
110
- } = useModalDOM({
111
- focusTarget: modalRef,
112
- focusTrap: mappedOptions.focusTrap,
113
- })
213
+ .magic-modal {
214
+ position: fixed;
215
+ inset: 0;
216
+ width: 100%;
217
+ height: 100%;
218
+ display: flex;
219
+ justify-content: center;
220
+ align-items: center;
221
+ z-index: var(--magic-modal-z-index, 999);
222
+ background: transparent;
223
+ color: inherit;
224
+ padding: 0;
225
+ border: none;
226
+ }
114
227
 
115
- const { isActive, close } = useMagicModal(props.id)
228
+ .magic-modal__content {
229
+ -webkit-overflow-scrolling: touch;
230
+ scroll-behavior: smooth;
231
+ max-height: 100%;
232
+ width: 100%;
233
+ display: flex;
234
+ align-items: var(--magic-modal-content-align-items, center);
235
+ justify-content: var(--magic-modal-content-justify-content, center);
236
+ overflow-y: var(--magic-modal-content-overflow-y, auto);
237
+ }
116
238
 
117
- // Split isActive into two values to animate modal smoothly
118
- const innerActive = ref(false)
119
- const wrapperActive = ref(false)
239
+ /* Reset default dialog styles */
240
+ dialog.magic-modal__content {
241
+ margin: 0;
242
+ padding: 0;
243
+ border: 0;
244
+ background: transparent;
245
+ outline: 0;
246
+ }
120
247
 
121
- const {
122
- onBeforeEnter,
123
- onEnter,
124
- onAfterEnter,
125
- onBeforeLeave,
126
- onLeave,
127
- onAfterLeave,
128
- } = useModalCallback({
129
- id: props.id,
130
- mappedOptions,
131
- addScrollLockPadding,
132
- removeScrollLockPadding,
133
- lockScroll,
134
- unlockScroll,
135
- trapFocus,
136
- releaseFocus,
137
- wrapperActive,
138
- })
248
+ dialog.magic-modal__content::backdrop {
249
+ background-color: transparent;
250
+ }
139
251
 
140
- // Handle state
141
- async function onOpen() {
142
- wrapperActive.value = true
143
- await nextTick()
144
- innerActive.value = true
252
+ .magic-modal__backdrop {
253
+ position: fixed;
254
+ top: 0;
255
+ left: 0;
256
+ right: 0;
257
+ bottom: 0;
258
+ width: 100%;
259
+ height: 100%;
260
+ background-color: var(--magic-modal-backdrop-color, rgba(0, 0, 0, 0.5));
261
+ backdrop-filter: var(--magic-modal-backdrop-filter, unset);
262
+ z-index: -1;
145
263
  }
146
264
 
147
- function onClose() {
148
- innerActive.value = false
265
+ /* Content */
266
+ .magic-modal-content-enter-active {
267
+ animation: mm-content-enter 175ms ease;
149
268
  }
150
269
 
151
- if (mappedOptions.keyListener?.close) {
152
- for (const key of mappedOptions.keyListener.close) {
153
- onKeyStroke(key, (e) => {
154
- close()
155
- e.preventDefault()
156
- })
157
- }
270
+ .magic-modal-content-leave-active {
271
+ animation: mm-content-leave 175ms ease;
158
272
  }
159
273
 
160
- watch(isActive, async (value) => {
161
- if (value) {
162
- await onOpen()
163
- } else {
164
- onClose()
274
+ @media (prefers-reduced-motion) {
275
+ .magic-modal-content-enter-active {
276
+ animation: fade-in 175ms ease;
165
277
  }
166
- })
167
-
168
- // Reset state on unmount
169
- onBeforeUnmount(() => {
170
- close()
171
- })
172
278
 
173
- onUnmounted(() => {
174
- if (mappedOptions.scrollLock) {
175
- unlockScroll()
176
- if (
177
- typeof mappedOptions.scrollLock === 'object' &&
178
- mappedOptions.scrollLock.padding
179
- ) {
180
- removeScrollLockPadding()
181
- }
279
+ .magic-modal-content-leave-active {
280
+ animation: fade-out 175ms ease;
182
281
  }
282
+ }
183
283
 
184
- if (mappedOptions.focusTrap) {
185
- releaseFocus()
186
- }
187
- })
188
- </script>
284
+ /* Backdrop */
285
+ .magic-modal-backdrop-enter-active {
286
+ animation: fade-in 175ms ease;
287
+ }
189
288
 
190
- <style>
191
- @keyframes magic-modal-content-enter{0%{opacity:0;transform:translate3d(0,2rem,0)}to{opacity:1;transform:translateZ(0)}}@keyframes magic-modal-content-leave{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(1.02)}}.magic-modal{align-items:center;background:transparent;border:none;color:inherit;display:flex;height:100%;inset:0;justify-content:center;padding:0;position:fixed;width:100%;z-index:var(--magic-modal-z-index,999)}.magic-modal__content{-webkit-overflow-scrolling:touch;align-items:var(--magic-modal-content-align-items,center);display:flex;justify-content:var(--magic-modal-content-justify-content,center);max-height:100%;overflow-y:var(--magic-modal-content-overflow-y,auto);scroll-behavior:smooth;width:100%}dialog.magic-modal__content{background:transparent;border:0;margin:0;outline:0;padding:0}dialog.magic-modal__content::backdrop{background-color:transparent}.magic-modal__backdrop{-webkit-backdrop-filter:var(--magic-modal-backdrop-filter,unset);backdrop-filter:var(--magic-modal-backdrop-filter,unset);background-color:var(--magic-modal-backdrop-color,rgba(0,0,0,.5));bottom:0;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:-1}.magic-modal--content-enter-active{animation:magic-modal-content-enter .3s ease}.magic-modal--content-leave-active{animation:magic-modal-content-leave .3s ease}@media (prefers-reduced-motion){.magic-modal--content-enter-active{animation:fade-in .3s ease}.magic-modal--content-leave-active{animation:fade-out .3s ease}}.magic-modal--backdrop-enter-active{animation:fade-in .3s ease}.magic-modal--backdrop-leave-active{animation:fade-out .3s ease}
289
+ .magic-modal-backdrop-leave-active {
290
+ animation: fade-out 175ms ease;
291
+ }
192
292
  </style>
@@ -1,31 +1,59 @@
1
- import { type Component, type MaybeRef } from 'vue';
2
- import type { MagicModalOptions } from './../types/index';
1
+ import { toValue, type MaybeRef } from 'vue';
2
+ import type { MagicModalOptions } from './../types/index.js';
3
3
  import '@maas/vue-equipment/utils/css/animations/fade-in.css';
4
4
  import '@maas/vue-equipment/utils/css/animations/fade-out.css';
5
5
  interface MagicModalProps {
6
6
  id: MaybeRef<string>;
7
- component?: Component;
8
7
  props?: Record<string, unknown>;
9
8
  options?: MagicModalOptions;
10
9
  }
11
- declare function __VLS_template(): {
12
- attrs: Partial<{}>;
13
- slots: {
14
- backdrop?(_: {}): any;
15
- default?(_: {}): any;
10
+ declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> & Omit<import("../../../../utils").RequireAll<MagicModalOptions>, keyof MagicModalOptions> & {
11
+ transition: {
12
+ content?: string;
13
+ backdrop?: string;
16
14
  };
17
- refs: {
18
- modalRef: HTMLDivElement;
15
+ backdrop: boolean;
16
+ tag: "div" | "dialog";
17
+ focusTrap: boolean | import("focus-trap").Options;
18
+ scrollLock: boolean | {
19
+ padding: boolean;
20
+ };
21
+ teleport: {
22
+ target?: string;
23
+ disabled?: boolean;
24
+ };
25
+ keyListener: {
26
+ close?: string[] | false;
19
27
  };
20
- rootEl: any;
21
28
  };
22
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
- declare const __VLS_component: import("vue").DefineComponent<MagicModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {
24
- options: MagicModalOptions;
25
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
+ declare const close: () => void;
30
+ declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
31
+ declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
32
+ declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
33
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
34
+ declare var __VLS_9: {}, __VLS_32: {};
35
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
36
+ backdrop?: (props: typeof __VLS_9) => any;
37
+ } & {
38
+ default?: (props: typeof __VLS_32) => any;
39
+ }>;
40
+ declare const __VLS_self: import("vue").DefineComponent<MagicModalProps, {
41
+ toValue: typeof toValue;
42
+ mappedOptions: typeof mappedOptions;
43
+ close: typeof close;
44
+ innerActive: typeof innerActive;
45
+ wrapperActive: typeof wrapperActive;
46
+ onBeforeEnter: typeof onBeforeEnter;
47
+ onEnter: typeof onEnter;
48
+ onAfterEnter: typeof onAfterEnter;
49
+ onBeforeLeave: typeof onBeforeLeave;
50
+ onLeave: typeof onLeave;
51
+ onAfterLeave: typeof onAfterLeave;
52
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
53
+ declare const __VLS_component: import("vue").DefineComponent<MagicModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
27
55
  export default _default;
28
- type __VLS_WithTemplateSlots<T, S> = T & {
56
+ type __VLS_WithSlots<T, S> = T & {
29
57
  new (): {
30
58
  $slots: S;
31
59
  };
@@ -12,11 +12,11 @@ type UseModalCallbackArgs = {
12
12
  wrapperActive: Ref<boolean>;
13
13
  };
14
14
  export declare function useModalCallback(args: UseModalCallbackArgs): {
15
- onBeforeEnter: (_el?: Element) => void;
16
- onEnter: (_el?: Element) => void;
17
- onAfterEnter: (_el?: Element) => Promise<void>;
18
- onBeforeLeave: (_el?: Element) => void;
19
- onLeave: (_el?: Element) => void;
20
- onAfterLeave: (_el?: Element) => void;
15
+ onBeforeEnter: () => void;
16
+ onEnter: () => void;
17
+ onAfterEnter: () => Promise<void>;
18
+ onBeforeLeave: () => void;
19
+ onLeave: () => void;
20
+ onAfterLeave: () => void;
21
21
  };
22
22
  export {};
@@ -13,7 +13,7 @@ export function useModalCallback(args) {
13
13
  wrapperActive
14
14
  } = args;
15
15
  const emitter = useMagicEmitter();
16
- function onBeforeEnter(_el) {
16
+ function onBeforeEnter() {
17
17
  emitter.emit("beforeEnter", toValue(id));
18
18
  if (mappedOptions.scrollLock) {
19
19
  if (typeof mappedOptions.scrollLock === "object" && mappedOptions.scrollLock.padding) {
@@ -22,23 +22,23 @@ export function useModalCallback(args) {
22
22
  lockScroll();
23
23
  }
24
24
  }
25
- function onEnter(_el) {
25
+ function onEnter() {
26
26
  emitter.emit("enter", toValue(id));
27
27
  }
28
- async function onAfterEnter(_el) {
28
+ async function onAfterEnter() {
29
29
  emitter.emit("afterEnter", toValue(id));
30
30
  if (mappedOptions.focusTrap) {
31
31
  await nextTick();
32
32
  trapFocus();
33
33
  }
34
34
  }
35
- function onBeforeLeave(_el) {
35
+ function onBeforeLeave() {
36
36
  emitter.emit("beforeLeave", toValue(id));
37
37
  }
38
- function onLeave(_el) {
38
+ function onLeave() {
39
39
  emitter.emit("leave", toValue(id));
40
40
  }
41
- function onAfterLeave(_el) {
41
+ function onAfterLeave() {
42
42
  emitter.emit("afterLeave", toValue(id));
43
43
  if (mappedOptions.scrollLock) {
44
44
  unlockScroll();
@@ -1,14 +1,18 @@
1
- import { ref } from "vue";
1
+ import { ref, shallowRef } from "vue";
2
2
  import { defu } from "defu";
3
3
  import { useScrollLock } from "@vueuse/core";
4
4
  import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
5
- import { matchClass } from "@maas/vue-equipment/utils";
5
+ import {
6
+ matchClass,
7
+ scrollbarGutterSupport,
8
+ scrollbarWidth
9
+ } from "@maas/vue-equipment/utils";
6
10
  const defaultOptions = {
7
11
  focusTrap: false,
8
12
  focusTarget: void 0,
9
13
  scrollLock: true
10
14
  };
11
- const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : ref(false);
15
+ const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
12
16
  export function useModalDOM(args) {
13
17
  const positionFixedElements = ref([]);
14
18
  const mappedOptions = defu(args, defaultOptions);
@@ -36,24 +40,40 @@ export function useModalDOM(args) {
36
40
  function addScrollLockPadding() {
37
41
  if (typeof window === "undefined") return;
38
42
  const exclude = new RegExp(/magic-modal(__backdrop)?/);
39
- const scrollbarWidth = window.innerWidth - document.body.offsetWidth;
40
- document.body.style.setProperty("--scrollbar-width", `${scrollbarWidth}px`);
41
- document.body.style.paddingRight = "var(--scrollbar-width)";
43
+ document.body.style.setProperty(
44
+ "--scrollbar-width",
45
+ `${scrollbarWidth()}px`
46
+ );
42
47
  positionFixedElements.value = [
43
48
  ...document.body.getElementsByTagName("*")
44
49
  ].filter(
45
- (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
46
- );
47
- positionFixedElements.value.forEach(
48
- (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
50
+ (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
49
51
  );
52
+ switch (scrollbarGutterSupport()) {
53
+ case true:
54
+ document.documentElement.style.scrollbarGutter = "stable";
55
+ positionFixedElements.value.forEach((elem) => {
56
+ elem.style.scrollbarGutter = "stable";
57
+ elem.style.overflow = "auto";
58
+ });
59
+ break;
60
+ case false:
61
+ document.body.style.paddingRight = "var(--scrollbar-width)";
62
+ positionFixedElements.value.forEach(
63
+ (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
64
+ );
65
+ break;
66
+ }
50
67
  }
51
68
  function removeScrollLockPadding() {
52
- document.body.style.paddingRight = "";
69
+ document.documentElement.style.scrollbarGutter = "";
53
70
  document.body.style.removeProperty("--scrollbar-width");
54
- positionFixedElements.value.forEach(
55
- (elem) => elem.style.paddingRight = ""
56
- );
71
+ document.body.style.paddingRight = "";
72
+ positionFixedElements.value.forEach((elem) => {
73
+ elem.style.paddingRight = "";
74
+ elem.style.scrollbarGutter = "";
75
+ elem.style.overflow = "";
76
+ });
57
77
  }
58
78
  return {
59
79
  trapFocus,
@@ -1,5 +1,5 @@
1
1
  import { ref } from "vue";
2
- let modalStore = ref([]);
2
+ const modalStore = ref([]);
3
3
  export function useModalStore() {
4
4
  function addInstance(id) {
5
5
  modalStore.value.push(id);