@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.31

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 (274) hide show
  1. package/README.md +2 -2
  2. package/dist/composables/index.d.ts +5 -5
  3. package/dist/composables/index.js +23 -13
  4. package/dist/composables/index.js.map +1 -1
  5. package/dist/nuxt/module.d.mts +2 -1
  6. package/dist/nuxt/module.json +2 -2
  7. package/dist/nuxt/module.mjs +32 -25
  8. package/dist/nuxt/types.d.mts +3 -1
  9. package/dist/plugins/.turbo/turbo-lint.log +1 -9
  10. package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
  11. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +61 -84
  12. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +10 -24
  13. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
  14. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +6 -20
  15. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
  16. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +9 -24
  17. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
  18. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +8 -22
  19. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +2 -2
  20. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +4 -3
  21. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
  22. package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
  23. package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
  24. package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
  25. package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
  26. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +148 -154
  27. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +7 -14
  28. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
  29. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +6 -20
  30. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
  31. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +13 -25
  32. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
  33. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +6 -20
  34. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
  35. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +6 -22
  36. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
  37. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
  38. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +9 -25
  39. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
  40. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +8 -22
  41. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
  42. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
  43. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +2 -2
  44. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
  45. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
  46. package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
  47. package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
  48. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
  49. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +8 -22
  50. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
  51. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +6 -20
  52. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +42 -74
  53. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +9 -14
  54. package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +3 -2
  55. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
  56. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +9 -5
  57. package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
  58. package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -2
  59. package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
  60. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +82 -100
  61. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -24
  62. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
  63. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
  64. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
  65. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
  66. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +103 -53
  67. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
  68. package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
  69. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
  70. package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
  71. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +284 -323
  72. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +18 -35
  73. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
  74. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
  75. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
  76. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
  77. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
  78. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
  79. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
  80. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
  81. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
  82. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
  83. package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
  84. package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
  85. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
  86. package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
  87. package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
  88. package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
  89. package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
  90. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
  91. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +8 -24
  92. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
  93. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
  94. package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
  95. package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
  96. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
  97. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +6 -20
  98. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +180 -216
  99. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +10 -25
  100. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
  101. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +8 -24
  102. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
  103. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +13 -25
  104. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
  105. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +6 -22
  106. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
  107. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +9 -23
  108. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
  109. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -25
  110. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
  111. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +8 -22
  112. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
  113. package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
  114. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
  115. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
  116. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
  117. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +1 -1
  118. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +8 -4
  119. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
  120. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
  121. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
  122. package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
  123. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
  124. package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
  125. package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
  126. package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
  127. package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
  128. package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
  129. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -25
  130. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
  131. package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
  132. package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
  133. package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
  134. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
  135. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
  136. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
  137. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +10 -6
  138. package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
  139. package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
  140. package/dist/plugins/MagicPie/index.d.ts +7 -0
  141. package/dist/plugins/MagicPie/index.mjs +8 -0
  142. package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
  143. package/dist/plugins/MagicPie/nuxt.mjs +23 -0
  144. package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -0
  145. package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
  146. package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
  147. package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
  148. package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
  149. package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
  150. package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
  151. package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
  152. package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
  153. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +93 -65
  154. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +123 -127
  155. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +9 -25
  156. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
  157. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
  158. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +117 -103
  159. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
  160. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +134 -82
  161. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +17 -13
  162. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +20 -36
  163. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -10
  164. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
  165. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -22
  166. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
  167. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +118 -68
  168. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +179 -210
  169. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +24 -34
  170. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
  171. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
  172. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
  173. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
  174. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
  175. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
  176. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
  177. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +59 -176
  178. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
  179. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
  180. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -4
  181. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +19 -35
  182. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
  183. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +60 -0
  184. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
  185. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +43 -91
  186. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
  187. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
  188. package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
  189. package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
  190. package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
  191. package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
  192. package/dist/plugins/MagicPlayer/src/types/index.d.ts +75 -10
  193. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
  194. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +6 -1
  195. package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
  196. package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
  197. package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
  198. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
  199. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +6 -22
  200. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
  201. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +6 -22
  202. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
  203. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +24 -21
  204. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
  205. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +8 -24
  206. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
  207. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
  208. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
  209. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
  210. package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
  211. package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
  212. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +90 -109
  213. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +7 -16
  214. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +53 -81
  215. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +6 -23
  216. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
  217. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
  218. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
  219. package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
  220. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
  221. package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
  222. package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
  223. package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
  224. package/dist/plugins/MagicToast/src/types/index.d.ts +3 -3
  225. package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
  226. package/dist/plugins/index.d.ts +1 -0
  227. package/dist/plugins/index.mjs +1 -0
  228. package/dist/utils/css/animations/fade-down.css +9 -0
  229. package/dist/utils/css/animations.css +9 -22
  230. package/dist/utils/css/easings.css +9 -1
  231. package/dist/utils/css/keyframes.css +22 -0
  232. package/dist/utils/index.d.ts +9 -4
  233. package/dist/utils/index.js +39 -3
  234. package/dist/utils/index.js.map +1 -1
  235. package/package.json +13 -9
  236. package/dist/nuxt/module.cjs +0 -5
  237. package/dist/nuxt/module.d.ts +0 -9
  238. package/dist/nuxt/types.d.ts +0 -1
  239. package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
  240. package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
  241. package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
  242. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
  243. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
  244. package/dist/utils/css/transitions.css +0 -8
  245. /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
  246. /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
  247. /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
  248. /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
  249. /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
  250. /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
  251. /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
  252. /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
  253. /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
  254. /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
  255. /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
  256. /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
  257. /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
  258. /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
  259. /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
  260. /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
  261. /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
  262. /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
  263. /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
  264. /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
  265. /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
  266. /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
  267. /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
  268. /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
  269. /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
  270. /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
  271. /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
  272. /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
  273. /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
  274. /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
@@ -7,33 +7,17 @@ interface MagicCommandTriggerProps {
7
7
  trigger?: Interaction[];
8
8
  asChild?: boolean;
9
9
  }
10
- declare function __VLS_template(): {
11
- attrs: Partial<{}>;
12
- slots: {
13
- default?(_: {
14
- viewActive: any;
15
- triggerDisabled: any;
16
- }): any;
17
- };
18
- refs: {
19
- elRef: any;
20
- };
21
- rootEl: any;
10
+ declare var __VLS_12: {
11
+ viewActive: boolean | undefined;
12
+ triggerDisabled: boolean;
22
13
  };
23
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandTriggerProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandTriggerProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
- export default _default;
27
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
- type __VLS_TypePropsToOption<T> = {
29
- [K in keyof T]-?: {} extends Pick<T, K> ? {
30
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
- } : {
32
- type: import('vue').PropType<T[K]>;
33
- required: true;
34
- };
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_12) => any;
35
16
  };
36
- type __VLS_WithTemplateSlots<T, S> = T & {
17
+ declare const __VLS_component: import("vue").DefineComponent<MagicCommandTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandTriggerProps> & 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 & {
37
21
  new (): {
38
22
  $slots: S;
39
23
  };
@@ -1,7 +1,10 @@
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 = ["id"];
1
+ <template>
2
+ <div :data-id="mappedId" class="magic-menu-view">
3
+ <slot :view-active="view.active" />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
5
8
  import { computed, inject, onBeforeUnmount, provide, useId, watch } from "vue";
6
9
  import { useCommandView } from "../composables/private/useCommandView";
7
10
  import {
@@ -11,50 +14,35 @@ import {
11
14
  MagicCommandItemId,
12
15
  MagicCommandViewActive
13
16
  } from "../symbols";
14
- export default /* @__PURE__ */ _defineComponent({
15
- __name: "MagicCommandView",
16
- props: {
17
- id: { type: String, required: false },
18
- initial: { type: Boolean, required: false, default: false }
19
- },
20
- setup(__props) {
21
- const parentTree = inject(MagicCommandParentTree, []);
22
- const instanceId = inject(MagicCommandInstanceId, void 0);
23
- const itemId = inject(MagicCommandItemId, void 0);
24
- if (!instanceId) {
25
- throw new Error("MagicCommandView must be nested inside MagicCommandProvider");
26
- }
27
- const mappedId = computed(() => __props.id ?? `magic-command-view-${useId()}`);
28
- const mappedParentTree = computed(() => [...parentTree, mappedId.value]);
29
- const mappedActive = computed(() => view.active);
30
- const { initializeView, deleteView, sortViewItems } = useCommandView(instanceId);
31
- const view = initializeView({
32
- id: mappedId.value,
33
- parent: { views: parentTree, item: itemId ?? "" },
34
- initial: __props.initial
35
- });
36
- provide(MagicCommandViewId, mappedId.value);
37
- provide(MagicCommandViewActive, mappedActive);
38
- provide(MagicCommandParentTree, mappedParentTree.value);
39
- watch(
40
- () => view?.items,
41
- () => {
42
- sortViewItems(mappedId.value);
43
- }
44
- );
45
- onBeforeUnmount(() => {
46
- deleteView(mappedId.value);
47
- });
48
- return (_ctx, _cache) => {
49
- return _openBlock(), _createElementBlock("div", {
50
- id: mappedId.value,
51
- class: "magic-menu-view"
52
- }, [
53
- _renderSlot(_ctx.$slots, "default", {
54
- viewActive: _unref(view).active
55
- })
56
- ], 8, _hoisted_1);
57
- };
17
+ const { id, initial = false } = defineProps({
18
+ id: { type: String, required: false },
19
+ initial: { type: Boolean, required: false }
20
+ });
21
+ const parentTree = inject(MagicCommandParentTree, []);
22
+ const instanceId = inject(MagicCommandInstanceId, void 0);
23
+ const itemId = inject(MagicCommandItemId, void 0);
24
+ if (!instanceId) {
25
+ throw new Error("MagicCommandView must be nested inside MagicCommandProvider");
26
+ }
27
+ const mappedId = computed(() => id ?? `magic-command-view-${useId()}`);
28
+ const mappedParentTree = computed(() => [...parentTree, mappedId.value]);
29
+ const mappedActive = computed(() => view.active);
30
+ const { initializeView, deleteView, sortViewItems } = useCommandView(instanceId);
31
+ const view = initializeView({
32
+ id: mappedId.value,
33
+ parent: { views: parentTree, item: itemId ?? "" },
34
+ initial
35
+ });
36
+ provide(MagicCommandViewId, mappedId.value);
37
+ provide(MagicCommandViewActive, mappedActive);
38
+ provide(MagicCommandParentTree, mappedParentTree.value);
39
+ watch(
40
+ () => view?.items,
41
+ () => {
42
+ sortViewItems(mappedId.value);
58
43
  }
44
+ );
45
+ onBeforeUnmount(() => {
46
+ deleteView(mappedId.value);
59
47
  });
60
48
  </script>
@@ -2,30 +2,16 @@ interface MagicCommandViewProps {
2
2
  id?: string;
3
3
  initial?: boolean;
4
4
  }
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: {
8
- default?(_: {
9
- viewActive: any;
10
- }): any;
11
- };
12
- refs: {};
13
- rootEl: any;
5
+ declare var __VLS_1: {
6
+ viewActive: boolean;
14
7
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandViewProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandViewProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
- export default _default;
19
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
- type __VLS_TypePropsToOption<T> = {
21
- [K in keyof T]-?: {} extends Pick<T, K> ? {
22
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
- } : {
24
- type: import('vue').PropType<T[K]>;
25
- required: true;
26
- };
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_1) => any;
27
10
  };
28
- type __VLS_WithTemplateSlots<T, S> = T & {
11
+ declare const __VLS_component: import("vue").DefineComponent<MagicCommandViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
29
15
  new (): {
30
16
  $slots: S;
31
17
  };
@@ -1,4 +1,4 @@
1
- import { type MaybeRef } from 'vue';
1
+ import { type MaybeRef, type Ref } from 'vue';
2
2
  interface IsElementAboveArgs {
3
3
  element: MaybeRef<HTMLElement>;
4
4
  ancestor?: HTMLElement;
@@ -15,7 +15,7 @@ interface ScrollInFromBottomArgs {
15
15
  element: MaybeRef<HTMLElement>;
16
16
  ancestor?: HTMLElement;
17
17
  }
18
- export declare function useCommandScroll(parent: MaybeRef<HTMLElement | undefined>): {
18
+ export declare function useCommandScroll(parent: Ref<HTMLElement | null>): {
19
19
  findElement: (id: string) => HTMLElement | null;
20
20
  findScrollableAncestor: (element: HTMLElement | null) => HTMLElement | undefined;
21
21
  isElementAbove: (args: IsElementAboveArgs) => boolean;
@@ -9,7 +9,7 @@ export function useCommandState(instanceId) {
9
9
  id,
10
10
  options: { ...defaultOptions },
11
11
  views: [],
12
- renderer: void 0,
12
+ renderer: null,
13
13
  active: false,
14
14
  input: {
15
15
  type: "pointer",
@@ -8,11 +8,11 @@ type UseCommandTriggerArgs = {
8
8
  mappedActive?: ComputedRef<boolean>;
9
9
  trigger: Interaction[];
10
10
  action: Action;
11
- elRef: Ref<InstanceType<typeof Primitive> | undefined>;
11
+ elRef: Ref<InstanceType<typeof Primitive> | null>;
12
12
  };
13
13
  export declare function useCommandTrigger(args: UseCommandTriggerArgs): {
14
14
  onMouseenter: () => Promise<void>;
15
15
  onClick: (e: MouseEvent) => Promise<void>;
16
- onEnter: (e?: KeyboardEvent) => Promise<void>;
16
+ onKeypress: (e?: KeyboardEvent) => Promise<void>;
17
17
  };
18
18
  export {};
@@ -1,4 +1,5 @@
1
1
  import { nextTick } from "vue";
2
+ import { Primitive } from "@maas/vue-primitive";
2
3
  import { useFocus } from "@vueuse/core";
3
4
  import { useCommandView } from "./useCommandView.mjs";
4
5
  import { useCommandState } from "./useCommandState.mjs";
@@ -17,7 +18,7 @@ export function useCommandTrigger(args) {
17
18
  const { initializeState } = useCommandState(instanceId);
18
19
  const state = initializeState();
19
20
  const { focused } = useFocus(elRef);
20
- async function onEnter(e) {
21
+ async function onKeypress(e) {
21
22
  if ((focused.value || mappedActive?.value) && !mappedDisabled.value && !view?.active) {
22
23
  e?.preventDefault();
23
24
  e?.stopPropagation();
@@ -71,6 +72,6 @@ export function useCommandTrigger(args) {
71
72
  return {
72
73
  onMouseenter,
73
74
  onClick,
74
- onEnter
75
+ onKeypress
75
76
  };
76
77
  }
@@ -1,12 +1,12 @@
1
- import type { InjectionKey, MaybeRef } from 'vue';
1
+ import type { InjectionKey, MaybeRef, Ref } from 'vue';
2
2
  import type { MagicCommandOptions } from '../types/index.js';
3
3
  declare const MagicCommandInstanceId: InjectionKey<MaybeRef<string>>;
4
4
  declare const MagicCommandParentTree: InjectionKey<string[]>;
5
5
  declare const MagicCommandViewId: InjectionKey<string>;
6
- declare const MagicCommandViewActive: InjectionKey<MaybeRef<boolean>>;
6
+ declare const MagicCommandViewActive: InjectionKey<Ref<boolean>>;
7
7
  declare const MagicCommandContentId: InjectionKey<string>;
8
8
  declare const MagicCommandItemId: InjectionKey<string>;
9
- declare const MagicCommandItemActive: InjectionKey<MaybeRef<boolean>>;
10
- declare const MagicCommandItemDisabled: InjectionKey<MaybeRef<boolean>>;
9
+ declare const MagicCommandItemActive: InjectionKey<Ref<boolean>>;
10
+ declare const MagicCommandItemDisabled: InjectionKey<Ref<boolean>>;
11
11
  declare const MagicCommandProviderOptions: InjectionKey<MagicCommandOptions>;
12
12
  export { MagicCommandInstanceId, MagicCommandParentTree, MagicCommandViewId, MagicCommandViewActive, MagicCommandContentId, MagicCommandItemId, MagicCommandItemActive, MagicCommandItemDisabled, MagicCommandProviderOptions, };
@@ -46,14 +46,14 @@ export interface CommandState {
46
46
  id: string;
47
47
  active: boolean;
48
48
  views: CommandView[];
49
- renderer: HTMLElement | undefined;
49
+ renderer: HTMLElement | null;
50
50
  options: MagicCommandOptions;
51
51
  input: {
52
52
  type: 'keyboard' | 'pointer';
53
53
  view: string | undefined;
54
54
  };
55
55
  }
56
- export type CommandEvents = {
56
+ export interface CommandEvents {
57
57
  beforeEnter: {
58
58
  id: string;
59
59
  viewId: string;
@@ -78,6 +78,6 @@ export type CommandEvents = {
78
78
  id: string;
79
79
  viewId: string;
80
80
  };
81
- };
81
+ }
82
82
  export type { MagicModalOptions as MagicCommandModalOptions };
83
83
  export type { MagicDrawerOptions as MagicCommandDrawerOptions };
@@ -1,2 +1,2 @@
1
- declare const _default: import("@nuxt/schema").NuxtModule<import("@nuxt/schema").ModuleOptions, import("@nuxt/schema").ModuleOptions, false>;
1
+ declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
2
2
  export default _default;
@@ -1,7 +1,14 @@
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"];
1
+ <template>
2
+ <div
3
+ class="magic-cookie-item"
4
+ :data-optional="item.optional"
5
+ :data-active="item.active"
6
+ >
7
+ <slot :item="item" />
8
+ </div>
9
+ </template>
10
+
11
+ <script setup>
5
12
  import { computed, inject, provide, onBeforeUnmount, useId } from "vue";
6
13
  import { useCookieItem } from "../composables/private/useCookieItem";
7
14
  import {
@@ -9,43 +16,29 @@ import {
9
16
  MagicCookieItemId,
10
17
  MagicCookieItemActive
11
18
  } 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
- }
19
+ const { id, optional, maxAge } = defineProps({
20
+ id: { type: String, required: false },
21
+ optional: { type: Boolean, required: false },
22
+ maxAge: { type: Number, required: false }
23
+ });
24
+ const instanceId = inject(MagicCookieInstanceId, void 0);
25
+ if (!instanceId) {
26
+ throw new Error("MagicCookieItem must be nested inside MagicCookieProvider");
27
+ }
28
+ const mappedId = computed(() => id ?? `magic-cookie-item-${useId()}`);
29
+ const mappedActive = computed(() => item.active);
30
+ const { initializeItem, deleteItem } = useCookieItem({
31
+ instanceId
32
+ });
33
+ const item = initializeItem({
34
+ id: mappedId.value,
35
+ optional,
36
+ maxAge
37
+ });
38
+ provide(MagicCookieItemId, mappedId.value);
39
+ provide(MagicCookieItemActive, mappedActive);
40
+ onBeforeUnmount(() => {
41
+ deleteItem(mappedId.value);
49
42
  });
50
43
  </script>
51
44
 
@@ -3,30 +3,16 @@ interface MagicCookieItemProps {
3
3
  optional?: boolean;
4
4
  maxAge?: number;
5
5
  }
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: {
9
- default?(_: {
10
- item: any;
11
- }): any;
12
- };
13
- refs: {};
14
- rootEl: any;
6
+ declare var __VLS_1: {
7
+ item: import("../types/index.js").CookieItem;
15
8
  };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCookieItemProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCookieItemProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
- export default _default;
20
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
- type __VLS_TypePropsToOption<T> = {
22
- [K in keyof T]-?: {} extends Pick<T, K> ? {
23
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
- } : {
25
- type: import('vue').PropType<T[K]>;
26
- required: true;
27
- };
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_1) => any;
28
11
  };
29
- type __VLS_WithTemplateSlots<T, S> = T & {
12
+ 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>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
30
16
  new (): {
31
17
  $slots: S;
32
18
  };
@@ -1,43 +1,26 @@
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";
1
+ <template>
2
+ <client-only>
3
+ <div class="magic-cookie-provider" v-bind="$attrs">
4
+ <slot />
5
+ </div>
6
+ </client-only>
7
+ </template>
8
+
9
+ <script setup>
4
10
  import { provide } from "vue";
5
11
  import { defu } from "defu";
6
12
  import { useCookieState } from "../composables/private/useCookieState";
7
13
  import { defaultOptions } from "../utils/defaultOptions";
8
14
  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
- }
15
+ defineOptions({
16
+ inheritAttrs: false
42
17
  });
18
+ const { id, options } = defineProps({
19
+ id: { type: null, required: true },
20
+ options: { type: Object, required: false }
21
+ });
22
+ const mappedOptions = defu(options, defaultOptions);
23
+ const { initializeState } = useCookieState(id);
24
+ initializeState(mappedOptions);
25
+ provide(MagicCookieInstanceId, id);
43
26
  </script>
@@ -4,28 +4,14 @@ type MagicCookieProviderProps = {
4
4
  id: MaybeRef<string>;
5
5
  options?: MagicCookieOptions;
6
6
  };
7
- declare function __VLS_template(): {
8
- attrs: Partial<{}>;
9
- slots: {
10
- default?(_: {}): any;
11
- };
12
- refs: {};
13
- rootEl: any;
7
+ declare var __VLS_6: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_6) => any;
14
10
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCookieProviderProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCookieProviderProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
11
+ 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>;
12
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
18
13
  export default _default;
19
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
- type __VLS_TypePropsToOption<T> = {
21
- [K in keyof T]-?: {} extends Pick<T, K> ? {
22
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
- } : {
24
- type: import('vue').PropType<T[K]>;
25
- required: true;
26
- };
27
- };
28
- type __VLS_WithTemplateSlots<T, S> = T & {
14
+ type __VLS_WithSlots<T, S> = T & {
29
15
  new (): {
30
16
  $slots: S;
31
17
  };
@@ -1,82 +1,50 @@
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" };
1
+ <template>
2
+ <div
3
+ class="magic-cookie-view"
4
+ :style="{ '--mc-duration': `${state.options.animation?.duration}ms` }"
5
+ >
6
+ <auto-size :width="false">
7
+ <transition
8
+ :name="state.options.transition"
9
+ @before-enter="onBeforeEnter"
10
+ @enter="onEnter"
11
+ @after-enter="onAfterEnter"
12
+ @before-leave="onBeforeLeave"
13
+ @leave="onLeave"
14
+ @after-leave="onAfterLeave"
15
+ >
16
+ <div v-show="state.viewActive" class="magic-cookie-view__inner">
17
+ <slot :view-active="state.viewActive" />
18
+ </div>
19
+ </transition>
20
+ </auto-size>
21
+ </div>
22
+ </template>
23
+
24
+ <script setup>
5
25
  import { inject } from "vue";
6
26
  import { AutoSize } from "@maas/vue-autosize";
7
27
  import { useCookieState } from "../composables/private/useCookieState";
8
28
  import { useCookieCallback } from "../composables/private/useCookieCallback";
9
29
  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
- });
30
+ import "@maas/vue-equipment/utils/css/keyframes/fade-in.css";
31
+ import "@maas/vue-equipment/utils/css/keyframes/auto-size-out.css";
32
+ const instanceId = inject(MagicCookieInstanceId, void 0);
33
+ if (!instanceId) {
34
+ throw new Error(
35
+ "MagicCookiePreferences must be used within a MagicCookieProvider"
36
+ );
37
+ }
38
+ const { initializeState } = useCookieState(instanceId);
39
+ const state = initializeState();
40
+ const {
41
+ onBeforeEnter,
42
+ onEnter,
43
+ onAfterEnter,
44
+ onBeforeLeave,
45
+ onLeave,
46
+ onAfterLeave
47
+ } = useCookieCallback(instanceId);
80
48
  </script>
81
49
 
82
50
  <style>