@maas/vue-equipment 0.40.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +6 -16
  2. package/dist/composables/index.d.ts +2 -13
  3. package/dist/composables/index.js +65 -128
  4. package/dist/composables/index.js.map +1 -1
  5. package/dist/nuxt/module.json +1 -1
  6. package/dist/nuxt/module.mjs +26 -40
  7. package/dist/plugins/.turbo/turbo-build.log +0 -0
  8. package/dist/plugins/.turbo/turbo-lint.log +13 -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 +17 -2
  14. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
  15. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +11 -2
  16. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +71 -71
  17. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +12 -7
  18. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +51 -50
  19. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +13 -4
  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/useAccordionView.mjs +11 -10
  24. package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +1 -1
  25. package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
  26. package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
  27. package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
  28. package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
  29. package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
  30. package/dist/plugins/MagicCommand/index.d.ts +2 -0
  31. package/dist/plugins/MagicCommand/index.mjs +9 -11
  32. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +192 -0
  33. package/dist/plugins/MagicCommand/src/components/{MagicCommandBody.vue.d.ts → MagicCommandContent.vue.d.ts} +4 -2
  34. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
  35. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -3
  36. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +108 -79
  37. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +18 -9
  38. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
  39. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +11 -2
  40. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +94 -62
  41. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +52 -7
  42. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
  43. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
  44. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +110 -0
  45. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +75 -0
  46. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
  47. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -9
  48. package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
  49. package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
  50. package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
  51. package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
  52. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +22 -4
  53. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
  54. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
  55. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
  56. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
  57. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
  58. package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
  59. package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
  60. package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
  61. package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
  62. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +8 -1
  63. package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
  64. package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
  65. package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
  66. package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
  67. package/dist/plugins/MagicCookie/index.d.ts +5 -3
  68. package/dist/plugins/MagicCookie/index.mjs +7 -3
  69. package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
  70. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
  71. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +33 -0
  72. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
  73. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +32 -0
  74. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
  75. package/dist/plugins/{MagicCommand/src/components/MagicCommandHead.vue.d.ts → MagicCookie/src/components/MagicCookieView.vue.d.ts} +6 -2
  76. package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
  77. package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
  78. package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
  79. package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
  80. package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
  81. package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
  82. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
  83. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
  84. package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
  85. package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
  86. package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
  87. package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
  88. package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
  89. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +142 -97
  90. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +12 -6
  91. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +6 -6
  92. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +3 -1
  93. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -4
  94. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +11 -8
  95. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
  96. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +8 -8
  97. package/dist/plugins/MagicDraggable/src/types/index.d.ts +10 -5
  98. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
  99. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +5 -5
  100. package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
  101. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +491 -336
  102. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -6
  103. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
  104. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
  105. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +7 -9
  106. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +26 -16
  107. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +2 -3
  108. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
  109. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
  110. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +5 -6
  111. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +46 -29
  112. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
  113. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
  114. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +2 -2
  115. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
  116. package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
  117. package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
  118. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
  119. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
  120. package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
  121. package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
  122. package/dist/plugins/MagicMarquee/index.d.ts +4 -2
  123. package/dist/plugins/MagicMarquee/index.mjs +2 -1
  124. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
  125. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +14 -10
  126. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +3 -7
  127. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +52 -44
  128. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
  129. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
  130. package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
  131. package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
  132. package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
  133. package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
  134. package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
  135. package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
  136. package/dist/plugins/MagicMenu/index.d.ts +2 -0
  137. package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
  138. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +79 -69
  139. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +10 -1
  140. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +247 -215
  141. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +12 -1
  142. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +235 -211
  143. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -2
  144. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +126 -124
  145. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -6
  146. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +94 -96
  147. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +49 -4
  148. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +98 -87
  149. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +11 -2
  150. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +111 -112
  151. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -2
  152. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
  153. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +13 -2
  154. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
  155. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +8 -8
  156. package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +35 -26
  157. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +12 -6
  158. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
  159. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
  160. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
  161. package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
  162. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
  163. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
  164. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +99 -75
  165. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +3 -3
  166. package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
  167. package/dist/plugins/MagicModal/src/components/MagicModal.vue +265 -165
  168. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +12 -6
  169. package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
  170. package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
  171. package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
  172. package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
  173. package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
  174. package/dist/plugins/MagicNoise/index.d.ts +3 -1
  175. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
  176. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +11 -4
  177. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
  178. package/dist/plugins/MagicPlayer/index.d.ts +4 -9
  179. package/dist/plugins/MagicPlayer/index.mjs +11 -17
  180. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +78 -0
  181. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
  182. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +134 -0
  183. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +33 -0
  184. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
  185. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +11 -5
  186. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +116 -114
  187. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +13 -5
  188. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
  189. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -4
  190. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
  191. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -4
  192. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +83 -0
  193. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
  194. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
  195. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
  196. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +94 -0
  197. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
  198. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +222 -0
  199. package/dist/plugins/MagicPlayer/src/components/{MagicPlayerControls.vue.d.ts → MagicPlayerVideoControls.vue.d.ts} +12 -5
  200. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  201. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  202. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  203. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  204. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  205. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  206. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
  207. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  208. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +5 -6
  209. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +18 -22
  210. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +13 -13
  211. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
  212. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +4 -4
  213. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +6 -8
  214. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +2 -6
  215. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
  216. package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
  217. package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
  218. package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
  219. package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
  220. package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
  221. package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
  222. package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
  223. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
  224. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
  225. package/dist/plugins/MagicScroll/index.d.ts +4 -10
  226. package/dist/plugins/MagicScroll/index.mjs +2 -11
  227. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +67 -31
  228. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +14 -4
  229. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
  230. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +14 -7
  231. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
  232. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +15 -9
  233. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +76 -73
  234. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -7
  235. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
  236. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
  237. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
  238. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +5 -3
  239. package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
  240. package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
  241. package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
  242. package/dist/plugins/MagicToast/index.d.ts +3 -2
  243. package/dist/plugins/MagicToast/index.mjs +3 -3
  244. package/dist/plugins/MagicToast/nuxt.mjs +2 -2
  245. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +296 -0
  246. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +23 -0
  247. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +155 -0
  248. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +33 -0
  249. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +7 -30
  250. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +34 -29
  251. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
  252. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
  253. package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
  254. package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
  255. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
  256. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +41 -0
  257. package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
  258. package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
  259. package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
  260. package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
  261. package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +13 -8
  262. package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +26 -23
  263. package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
  264. package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
  265. package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
  266. package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
  267. package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
  268. package/dist/plugins/index.d.ts +0 -1
  269. package/dist/plugins/index.mjs +0 -1
  270. package/dist/utils/css/animations/auto-size-out.css +12 -0
  271. package/dist/utils/css/animations/squash-y.css +5 -0
  272. package/dist/utils/css/animations.css +2 -1
  273. package/dist/utils/index.d.ts +1 -2
  274. package/dist/utils/index.js +2 -53
  275. package/dist/utils/index.js.map +1 -1
  276. package/package.json +52 -57
  277. package/dist/composables/index.d.mts +0 -108
  278. package/dist/composables/index.mjs +0 -383
  279. package/dist/composables/index.mjs.map +0 -1
  280. package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
  281. package/dist/plugins/MagicAutoSize/index.mjs +0 -7
  282. package/dist/plugins/MagicAutoSize/nuxt.d.ts +0 -2
  283. package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
  284. package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
  285. package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
  286. package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
  287. package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
  288. package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
  289. package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
  290. package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
  291. package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
  292. package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
  293. package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
  294. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
  295. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
  296. package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
  297. package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
  298. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
  299. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
  300. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
  301. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
  302. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
  303. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
  304. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
  305. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
  306. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
  307. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
  308. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
  309. package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
  310. package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +0 -14
  311. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
  312. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
  313. package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
  314. package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
  315. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
  316. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
  317. package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
  318. package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
  319. package/dist/utils/index.d.mts +0 -80
  320. package/dist/utils/index.mjs +0 -200
  321. package/dist/utils/index.mjs.map +0 -1
@@ -1,6 +1,22 @@
1
- export declare function useCommandView(): {
2
- selectView: (id: string) => void;
3
- selectLastView: () => void;
4
- activeView: import("vue").Ref<string | undefined, string | undefined>;
5
- lastActiveView: import("vue").Ref<string | undefined, string | undefined>;
1
+ import { type MaybeRef } from 'vue';
2
+ import type { CommandView } from '../../types/index.js';
3
+ type InitializeViewArgs = Pick<CommandView, 'id' | 'parent' | 'initial'>;
4
+ export declare function useCommandView(instanceId: MaybeRef<string>): {
5
+ currentView: import("vue").ComputedRef<CommandView | undefined>;
6
+ initializeView: (args: InitializeViewArgs) => CommandView;
7
+ deleteView: (id: string) => void;
8
+ getView: (id: string) => CommandView | undefined;
9
+ getRelativeViewIndex: (id: string) => number;
10
+ getNextView: (id: string) => CommandView | undefined;
11
+ getPreviousView: (id: string) => CommandView | undefined;
12
+ getTopLevelView: () => CommandView | undefined;
13
+ getNestedView: (itemId: string) => CommandView | undefined;
14
+ getParentView: (id: string) => CommandView | undefined;
15
+ selectView: (id: string, delayMs?: number) => Promise<void>;
16
+ selectInitialView: () => void;
17
+ unselectView: (id: string, delayMs?: number) => Promise<void>;
18
+ unselectUnrelatedViews: (id: string) => void;
19
+ unselectAllViews: () => void;
20
+ sortViewItems: (viewId: string) => void;
6
21
  };
22
+ export {};
@@ -1,24 +1,199 @@
1
- import { ref, watch } from "vue";
2
- const activeView = ref(void 0);
3
- const lastActiveView = ref(void 0);
4
- const watcherActive = ref(false);
5
- export function useCommandView() {
6
- function selectView(id) {
7
- activeView.value = id;
8
- }
9
- function selectLastView() {
10
- activeView.value = lastActiveView.value;
11
- }
12
- if (!watcherActive.value) {
13
- watcherActive.value = true;
14
- watch(activeView, (_newView, oldView) => {
15
- if (oldView) lastActiveView.value = oldView;
1
+ import { reactive, computed, toValue } from "vue";
2
+ import { useCommandState } from "./useCommandState.mjs";
3
+ function isAbortError(error) {
4
+ return error instanceof DOMException && error.name === "AbortError";
5
+ }
6
+ export function useCommandView(instanceId) {
7
+ const { initializeState } = useCommandState(instanceId);
8
+ const state = initializeState();
9
+ const currentInstanceId = toValue(instanceId);
10
+ const currentView = computed(() => {
11
+ const activeViews = state.views.filter((view) => view.active);
12
+ if (activeViews.length === 0) return void 0;
13
+ if (activeViews.length === 1) return activeViews[0];
14
+ return activeViews.reduce(
15
+ (a, b) => a.parent.views.length >= b.parent.views.length ? a : b
16
+ );
17
+ });
18
+ const viewMap = /* @__PURE__ */ new Map();
19
+ function createView(args) {
20
+ const { id, parent, initial } = args;
21
+ if (parent.views.length === 0) {
22
+ parent.views.push(currentInstanceId);
23
+ }
24
+ const view = reactive({
25
+ id,
26
+ parent,
27
+ initial,
28
+ active: false,
29
+ items: [],
30
+ channels: [],
31
+ state: {
32
+ selectAbortController: new AbortController(),
33
+ unselectAbortController: new AbortController()
34
+ }
35
+ });
36
+ viewMap.set(id, view);
37
+ return view;
38
+ }
39
+ function addView(args) {
40
+ const view = createView(args);
41
+ state.views.push(view);
42
+ return view;
43
+ }
44
+ function delay(ms, signal) {
45
+ return new Promise((resolve, reject) => {
46
+ const timer = setTimeout(resolve, ms);
47
+ const abortHandler = () => {
48
+ clearTimeout(timer);
49
+ reject(new DOMException("Aborted", "AbortError"));
50
+ };
51
+ signal.addEventListener("abort", abortHandler, { once: true });
16
52
  });
17
53
  }
54
+ function activateView() {
55
+ const view = state?.views.findLast((view2) => view2.active)?.id;
56
+ state.input.view = view;
57
+ }
58
+ function getView(id) {
59
+ let view = viewMap.get(id);
60
+ if (!view) {
61
+ view = state.views.find((v) => v.id === id);
62
+ if (view) viewMap.set(id, view);
63
+ }
64
+ return view;
65
+ }
66
+ function deleteView(id) {
67
+ const index = state.views.findIndex((view) => view.id === id);
68
+ if (index !== -1) {
69
+ state.views.splice(index, 1);
70
+ viewMap.delete(id);
71
+ }
72
+ }
73
+ function getRelativeViewIndex(id) {
74
+ const view = getView(id);
75
+ if (!view) return -1;
76
+ const nestingLevel = view.parent.views.length;
77
+ return state.views.findIndex(
78
+ (v) => v.parent.views.length === nestingLevel && v.id === id
79
+ );
80
+ }
81
+ function getNextView(id) {
82
+ const index = state.views.findIndex((view) => view.id === id);
83
+ return index !== -1 ? state.views[index + 1] : void 0;
84
+ }
85
+ function getPreviousView(id) {
86
+ const index = state.views.findIndex((view) => view.id === id);
87
+ return index > 0 ? state.views[index - 1] : void 0;
88
+ }
89
+ function getTopLevelView() {
90
+ return state.views.find((view) => view.active && !view.parent.item);
91
+ }
92
+ function getNestedView(itemId) {
93
+ return state.views.find((view) => view.parent.item === itemId);
94
+ }
95
+ function getParentView(id) {
96
+ const view = getView(id);
97
+ if (!view) return void 0;
98
+ const parentId = view.parent.views[view.parent.views.length - 1];
99
+ return parentId ? getView(parentId) : void 0;
100
+ }
101
+ function getUnrelatedViews(id) {
102
+ const view = getView(id);
103
+ if (!view) return [];
104
+ const parentViewsSet = new Set(view.parent.views);
105
+ return state.views.filter((v) => v.id !== id && !parentViewsSet.has(v.id));
106
+ }
107
+ async function selectView(id, delayMs = 0) {
108
+ const view = getView(id);
109
+ if (!view) return;
110
+ if (view.state.unselectAbortController) {
111
+ view.state.unselectAbortController.abort();
112
+ }
113
+ const abortController = new AbortController();
114
+ view.state.selectAbortController = abortController;
115
+ try {
116
+ if (delayMs > 0) {
117
+ await delay(delayMs, abortController.signal);
118
+ }
119
+ view.active = true;
120
+ activateView();
121
+ } catch (error) {
122
+ if (isAbortError(error) && state.options.debug) {
123
+ console.log("selectView() was interrupted by a call to unselectView()");
124
+ }
125
+ }
126
+ }
127
+ function selectInitialView() {
128
+ const initialView = state.views?.find((view) => view.initial);
129
+ if (initialView) {
130
+ initialView.active = true;
131
+ activateView();
132
+ }
133
+ }
134
+ async function unselectView(id, delayMs = 0) {
135
+ const view = getView(id);
136
+ if (!view) return;
137
+ if (view.state.selectAbortController) {
138
+ view.state.selectAbortController.abort();
139
+ }
140
+ const abortController = new AbortController();
141
+ view.state.unselectAbortController = abortController;
142
+ try {
143
+ if (delayMs > 0) {
144
+ await delay(delayMs, abortController.signal);
145
+ }
146
+ view.active = false;
147
+ activateView();
148
+ } catch (error) {
149
+ if (isAbortError(error) && state.options.debug) {
150
+ console.log("unselectView() was interrupted by a call to selectView()");
151
+ }
152
+ }
153
+ }
154
+ function unselectUnrelatedViews(id) {
155
+ const views = getUnrelatedViews(id);
156
+ for (const view of views) {
157
+ view.active = false;
158
+ }
159
+ }
160
+ function unselectAllViews() {
161
+ for (const view of state.views) {
162
+ view.active = false;
163
+ }
164
+ }
165
+ function initializeView(args) {
166
+ const { id } = args;
167
+ const view = getView(id) ?? addView(args);
168
+ return view;
169
+ }
170
+ function sortViewItems(viewId) {
171
+ const parent = document.querySelector(`[data-id="${viewId}-content"]`);
172
+ const view = getView(viewId);
173
+ const elements = Array.from(
174
+ parent?.querySelectorAll(".magic-command-item") ?? []
175
+ );
176
+ function getIndex(id) {
177
+ return elements.findIndex((el) => el.dataset.id === id);
178
+ }
179
+ view?.items?.sort((a, b) => getIndex(a.id) - getIndex(b.id));
180
+ }
18
181
  return {
182
+ currentView,
183
+ initializeView,
184
+ deleteView,
185
+ getView,
186
+ getRelativeViewIndex,
187
+ getNextView,
188
+ getPreviousView,
189
+ getTopLevelView,
190
+ getNestedView,
191
+ getParentView,
19
192
  selectView,
20
- selectLastView,
21
- activeView,
22
- lastActiveView
193
+ selectInitialView,
194
+ unselectView,
195
+ unselectUnrelatedViews,
196
+ unselectAllViews,
197
+ sortViewItems
23
198
  };
24
199
  }
@@ -1,10 +1,19 @@
1
1
  import { type MaybeRef } from 'vue';
2
+ interface SelectItemArgs {
3
+ id: string;
4
+ viewId: string;
5
+ }
6
+ interface UnselectItemArgs {
7
+ id: string;
8
+ viewId: string;
9
+ }
2
10
  export declare function useMagicCommand(id: MaybeRef<string>): {
3
11
  isActive: import("vue").ComputedRef<boolean>;
4
- open: () => void;
12
+ open: () => Promise<void>;
5
13
  close: () => void;
6
- selectItem: (id: string) => void;
7
- selectLastItem: () => void;
8
- selectView: (id: string) => void;
9
- selectLastView: () => void;
14
+ selectItem: (args: SelectItemArgs) => void;
15
+ unselectItem: (args: UnselectItemArgs) => void;
16
+ selectView: (id: string, delayMs?: number) => Promise<void>;
17
+ unselectView: (id: string, delayMs?: number) => Promise<void>;
10
18
  };
19
+ export {};
@@ -1,27 +1,57 @@
1
- import { computed, toValue } from "vue";
2
- import { useCommandStore } from "./private/useCommandStore.mjs";
1
+ import { computed, nextTick } from "vue";
2
+ import { useCommandState } from "./private/useCommandState.mjs";
3
3
  import { useCommandItem } from "./private/useCommandItem.mjs";
4
4
  import { useCommandView } from "./private/useCommandView.mjs";
5
5
  export function useMagicCommand(id) {
6
- const isActive = computed(
7
- () => commandStore.value.map((item) => item.id).includes(toValue(id))
8
- );
9
- const { commandStore, addInstance, removeInstance } = useCommandStore();
10
- function open() {
11
- addInstance(toValue(id));
6
+ const { initializeState } = useCommandState(id);
7
+ const state = initializeState();
8
+ const isActive = computed(() => state.active);
9
+ const { selectView, unselectView, selectInitialView, unselectAllViews } = useCommandView(id);
10
+ async function open() {
11
+ state.active = true;
12
+ await nextTick();
13
+ selectInitialView();
12
14
  }
13
15
  function close() {
14
- removeInstance(toValue(id));
16
+ state.active = false;
17
+ state.input.view = void 0;
18
+ unselectAllViews();
19
+ }
20
+ function selectItem(args) {
21
+ const { id: id2, viewId } = args;
22
+ if (!viewId) {
23
+ throw new Error("viewId is required to select an item");
24
+ }
25
+ if (!id2) {
26
+ throw new Error("id is required to select an item");
27
+ }
28
+ const { selectItem: selectItem2 } = useCommandItem({
29
+ instanceId: id2,
30
+ viewId
31
+ });
32
+ return selectItem2(id2);
33
+ }
34
+ function unselectItem(args) {
35
+ const { id: id2, viewId } = args;
36
+ if (!viewId) {
37
+ throw new Error("viewId is required to select an item");
38
+ }
39
+ if (!id2) {
40
+ throw new Error("id is required to select an item");
41
+ }
42
+ const { unselectItem: unselectItem2 } = useCommandItem({
43
+ instanceId: id2,
44
+ viewId
45
+ });
46
+ return unselectItem2(id2);
15
47
  }
16
- const { selectItem, selectLastItem } = useCommandItem(toValue(id));
17
- const { selectView, selectLastView } = useCommandView();
18
48
  return {
19
49
  isActive,
20
50
  open,
21
51
  close,
22
52
  selectItem,
23
- selectLastItem,
53
+ unselectItem,
24
54
  selectView,
25
- selectLastView
55
+ unselectView
26
56
  };
27
57
  }
@@ -1,5 +1,12 @@
1
1
  import type { InjectionKey, MaybeRef } from 'vue';
2
2
  import type { MagicCommandOptions } from '../types/index.js';
3
3
  declare const MagicCommandInstanceId: InjectionKey<MaybeRef<string>>;
4
+ declare const MagicCommandParentTree: InjectionKey<string[]>;
5
+ declare const MagicCommandViewId: InjectionKey<string>;
6
+ declare const MagicCommandViewActive: InjectionKey<MaybeRef<boolean>>;
7
+ declare const MagicCommandContentId: InjectionKey<string>;
8
+ declare const MagicCommandItemId: InjectionKey<string>;
9
+ declare const MagicCommandItemActive: InjectionKey<MaybeRef<boolean>>;
10
+ declare const MagicCommandItemDisabled: InjectionKey<MaybeRef<boolean>>;
4
11
  declare const MagicCommandProviderOptions: InjectionKey<MagicCommandOptions>;
5
- export { MagicCommandInstanceId, MagicCommandProviderOptions };
12
+ export { MagicCommandInstanceId, MagicCommandParentTree, MagicCommandViewId, MagicCommandViewActive, MagicCommandContentId, MagicCommandItemId, MagicCommandItemActive, MagicCommandItemDisabled, MagicCommandProviderOptions, };
@@ -1,3 +1,20 @@
1
1
  const MagicCommandInstanceId = Symbol();
2
+ const MagicCommandParentTree = Symbol();
3
+ const MagicCommandViewId = Symbol();
4
+ const MagicCommandViewActive = Symbol();
5
+ const MagicCommandContentId = Symbol();
6
+ const MagicCommandItemId = Symbol();
7
+ const MagicCommandItemActive = Symbol();
8
+ const MagicCommandItemDisabled = Symbol();
2
9
  const MagicCommandProviderOptions = Symbol();
3
- export { MagicCommandInstanceId, MagicCommandProviderOptions };
10
+ export {
11
+ MagicCommandInstanceId,
12
+ MagicCommandParentTree,
13
+ MagicCommandViewId,
14
+ MagicCommandViewActive,
15
+ MagicCommandContentId,
16
+ MagicCommandItemId,
17
+ MagicCommandItemActive,
18
+ MagicCommandItemDisabled,
19
+ MagicCommandProviderOptions
20
+ };
@@ -1,23 +1,83 @@
1
1
  import type { MagicModalOptions } from '../../../MagicModal/index.js';
2
2
  import type { MagicDrawerOptions } from '../../../MagicDrawer/index.js';
3
- export type MagicCommandOptions = {
4
- keys?: {
3
+ import type { RequireAllNested } from '@maas/vue-equipment/utils';
4
+ export interface MagicCommandOptions {
5
+ debug?: boolean;
6
+ transition?: {
7
+ content?: string;
8
+ };
9
+ keyListener?: {
5
10
  open?: string[] | false;
6
11
  close?: string[] | false;
7
12
  next?: string[] | false;
8
13
  prev?: string[] | false;
14
+ enter?: string[] | false;
9
15
  };
10
16
  loop?: boolean;
11
- };
12
- export type CommandEvents = {
13
- beforeEnter: string;
14
- enter: string;
15
- afterEnter: string;
16
- beforeLeave: string;
17
- leave: string;
18
- afterLeave: string;
19
- };
20
- export interface MagicCommandModalOptions extends MagicModalOptions {
21
17
  }
22
- export interface MagicCommandDrawerOptions extends MagicDrawerOptions {
18
+ export type CommandDefaultOptions = RequireAllNested<MagicCommandOptions>;
19
+ export type Action = 'open' | 'close';
20
+ export type Interaction = 'click' | 'mouseenter';
21
+ export interface CommandItem {
22
+ id: string;
23
+ active: boolean;
24
+ disabled: boolean;
25
+ }
26
+ export interface CommandChannel {
27
+ id: string;
28
+ active: boolean;
29
+ }
30
+ export interface CommandView {
31
+ id: string;
32
+ active: boolean;
33
+ initial: boolean;
34
+ items: CommandItem[];
35
+ channels: CommandChannel[];
36
+ parent: {
37
+ item: string;
38
+ views: string[];
39
+ };
40
+ state: {
41
+ selectAbortController: AbortController;
42
+ unselectAbortController: AbortController;
43
+ };
44
+ }
45
+ export interface CommandState {
46
+ id: string;
47
+ active: boolean;
48
+ views: CommandView[];
49
+ renderer: HTMLElement | undefined;
50
+ options: MagicCommandOptions;
51
+ input: {
52
+ type: 'keyboard' | 'pointer';
53
+ view: string | undefined;
54
+ };
23
55
  }
56
+ export type CommandEvents = {
57
+ beforeEnter: {
58
+ id: string;
59
+ viewId: string;
60
+ };
61
+ enter: {
62
+ id: string;
63
+ viewId: string;
64
+ };
65
+ afterEnter: {
66
+ id: string;
67
+ viewId: string;
68
+ };
69
+ beforeLeave: {
70
+ id: string;
71
+ viewId: string;
72
+ };
73
+ leave: {
74
+ id: string;
75
+ viewId: string;
76
+ };
77
+ afterLeave: {
78
+ id: string;
79
+ viewId: string;
80
+ };
81
+ };
82
+ export type { MagicModalOptions as MagicCommandModalOptions };
83
+ export type { MagicDrawerOptions as MagicCommandDrawerOptions };
@@ -1,5 +1,3 @@
1
- import type { MagicCommandOptions } from '../types/index.js';
2
- import type { RequireAllNested } from '@maas/vue-equipment/utils';
3
- declare const defaultOptions: RequireAllNested<MagicCommandOptions>;
4
- type DefaultOptions = typeof defaultOptions;
5
- export { defaultOptions, type DefaultOptions };
1
+ import type { CommandDefaultOptions } from '../types/index.js';
2
+ declare const defaultOptions: CommandDefaultOptions;
3
+ export { defaultOptions };
@@ -1,9 +1,14 @@
1
1
  const defaultOptions = {
2
- keys: {
3
- open: ["Cmd+k"],
2
+ debug: false,
3
+ transition: {
4
+ content: "magic-command-content"
5
+ },
6
+ keyListener: {
7
+ open: ["Cmd+k", "Ctrl+k"],
4
8
  close: ["Escape"],
5
9
  next: ["ArrowDown"],
6
- prev: ["ArrowUp"]
10
+ prev: ["ArrowUp"],
11
+ enter: ["Enter"]
7
12
  },
8
13
  loop: false
9
14
  };
@@ -1,5 +1,7 @@
1
- import type { Plugin } from 'vue';
2
- import MagicCookie from './src/components/MagicCookie.vue.js';
1
+ import MagicCookieProvider from './src/components/MagicCookieProvider.vue.js';
3
2
  import { useMagicCookie } from './src/composables/useMagicCookie.js';
3
+ import type { Plugin } from 'vue';
4
+ import type { MagicCookieCallbackArgs, MagicCookieOptions } from './src/types/index.js';
4
5
  declare const MagicCookiePlugin: Plugin;
5
- export { MagicCookiePlugin, MagicCookie, useMagicCookie };
6
+ export { MagicCookiePlugin, MagicCookieProvider, useMagicCookie };
7
+ export type { MagicCookieCallbackArgs, MagicCookieOptions };
@@ -1,8 +1,12 @@
1
- import MagicCookie from "./src/components/MagicCookie.vue";
1
+ import MagicCookieItem from "./src/components/MagicCookieItem.vue";
2
+ import MagicCookieView from "./src/components/MagicCookieView.vue";
3
+ import MagicCookieProvider from "./src/components/MagicCookieProvider.vue";
2
4
  import { useMagicCookie } from "./src/composables/useMagicCookie.mjs";
3
5
  const MagicCookiePlugin = {
4
6
  install: (app) => {
5
- app.component("MagicCookie", MagicCookie);
7
+ app.component("MagicCookieView", MagicCookieView);
8
+ app.component("MagicCookieProvider", MagicCookieProvider);
9
+ app.component("MagicCookieItem", MagicCookieItem);
6
10
  }
7
11
  };
8
- export { MagicCookiePlugin, MagicCookie, useMagicCookie };
12
+ export { MagicCookiePlugin, MagicCookieProvider, useMagicCookie };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  defineNuxtModule,
3
3
  createResolver,
4
- addComponent,
4
+ addComponentsDir,
5
5
  addImports,
6
6
  extendViteConfig
7
7
  } from "@nuxt/kit";
@@ -18,18 +18,14 @@ export default defineNuxtModule({
18
18
  config.optimizeDeps.include = config.optimizeDeps.include || [];
19
19
  config.optimizeDeps.include.push("universal-cookie");
20
20
  });
21
- addComponent({
22
- filePath: resolver.resolve("src/components/MagicCookie.vue"),
23
- name: "MagicCookie",
24
- global: true
21
+ addComponentsDir({
22
+ path: resolver.resolve("src/components"),
23
+ global: true,
24
+ pathPrefix: false
25
25
  });
26
26
  addImports({
27
27
  from: "@maas/vue-equipment/plugins/MagicCookie",
28
28
  name: "useMagicCookie"
29
29
  });
30
- addImports({
31
- from: "@maas/vue-equipment/plugins/MagicCookie",
32
- name: "useCookietEmitter"
33
- });
34
30
  }
35
31
  });
@@ -0,0 +1,56 @@
1
+ <script>
2
+ import { defineComponent as _defineComponent } from "vue";
3
+ import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
4
+ const _hoisted_1 = ["data-optional", "data-active"];
5
+ import { computed, inject, provide, onBeforeUnmount, useId } from "vue";
6
+ import { useCookieItem } from "../composables/private/useCookieItem";
7
+ import {
8
+ MagicCookieInstanceId,
9
+ MagicCookieItemId,
10
+ MagicCookieItemActive
11
+ } from "../symbols";
12
+ export default /* @__PURE__ */ _defineComponent({
13
+ __name: "MagicCookieItem",
14
+ props: {
15
+ id: { type: String, required: false },
16
+ optional: { type: Boolean, required: false },
17
+ maxAge: { type: Number, required: false }
18
+ },
19
+ setup(__props) {
20
+ const instanceId = inject(MagicCookieInstanceId, void 0);
21
+ if (!instanceId) {
22
+ throw new Error("MagicCookieItem must be nested inside MagicCookieProvider");
23
+ }
24
+ const mappedId = computed(() => __props.id ?? `magic-cookie-item-${useId()}`);
25
+ const mappedActive = computed(() => item.active);
26
+ const { initializeItem, deleteItem } = useCookieItem({
27
+ instanceId
28
+ });
29
+ const item = initializeItem({
30
+ id: mappedId.value,
31
+ optional: __props.optional,
32
+ maxAge: __props.maxAge
33
+ });
34
+ provide(MagicCookieItemId, mappedId.value);
35
+ provide(MagicCookieItemActive, mappedActive);
36
+ onBeforeUnmount(() => {
37
+ deleteItem(mappedId.value);
38
+ });
39
+ return (_ctx, _cache) => {
40
+ return _openBlock(), _createElementBlock("div", {
41
+ class: "magic-cookie-item",
42
+ "data-optional": _unref(item).optional,
43
+ "data-active": _unref(item).active
44
+ }, [
45
+ _renderSlot(_ctx.$slots, "default", { item: _unref(item) })
46
+ ], 8, _hoisted_1);
47
+ };
48
+ }
49
+ });
50
+ </script>
51
+
52
+ <style>
53
+ .magic-cookie-item {
54
+ cursor: var(--magic-cookie-item-cursor, default);
55
+ }
56
+ </style>
@@ -0,0 +1,33 @@
1
+ interface MagicCookieItemProps {
2
+ id?: string;
3
+ optional?: boolean;
4
+ maxAge?: number;
5
+ }
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {
10
+ item: import("../types").CookieItem;
11
+ }): any;
12
+ };
13
+ refs: {};
14
+ rootEl: HTMLDivElement;
15
+ };
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
+ };
28
+ };
29
+ type __VLS_WithTemplateSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };