@maas/vue-equipment 0.29.1 → 0.29.3

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 (169) hide show
  1. package/dist/composables/index.js +5 -10
  2. package/dist/composables/index.js.map +1 -1
  3. package/dist/composables/index.mjs +5 -10
  4. package/dist/composables/index.mjs.map +1 -1
  5. package/dist/nuxt/module.json +1 -1
  6. package/dist/nuxt/module.mjs +16 -9
  7. package/dist/plugins/MagicCommand/index.d.ts +2 -4
  8. package/dist/plugins/MagicCommand/index.mjs +2 -2
  9. package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +3 -3
  10. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +2 -2
  11. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +2 -2
  12. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +4 -4
  13. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +5 -5
  14. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +2 -2
  15. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +2 -2
  16. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +4 -4
  17. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +5 -5
  18. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +4 -2
  19. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +3 -3
  20. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +1 -1
  21. package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +1 -1
  22. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +3 -3
  23. package/dist/plugins/MagicCommand/src/symbols/index.mjs +2 -2
  24. package/dist/plugins/MagicCommand/src/types/index.d.ts +5 -5
  25. package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +2 -2
  26. package/dist/plugins/MagicCookie/index.d.ts +0 -2
  27. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +6 -7
  28. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +6 -6
  29. package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +17 -0
  30. package/dist/plugins/MagicCookie/src/composables/private/{defineCookieApi.mjs → useCookieApi.mjs} +4 -4
  31. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +5 -5
  32. package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +4 -4
  33. package/dist/plugins/MagicCookie/src/types/index.d.ts +6 -10
  34. package/dist/plugins/MagicDraggable/index.d.ts +2 -2
  35. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +4 -4
  36. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -6
  37. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +1 -2
  38. package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
  39. package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +4 -4
  40. package/dist/plugins/MagicDrawer/index.d.ts +2 -2
  41. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +3 -4
  42. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +3 -3
  43. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +2 -2
  44. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.d.ts +3 -3
  45. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +2 -2
  46. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -1
  47. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +3 -1
  48. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +1 -3
  49. package/dist/plugins/MagicDrawer/src/types/index.d.ts +1 -1
  50. package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +7 -7
  51. package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +494 -170
  52. package/dist/plugins/MagicEmitter/src/types/index.d.ts +9 -9
  53. package/dist/plugins/MagicMarquee/nuxt.mjs +1 -5
  54. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +3 -3
  55. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +3 -3
  56. package/dist/plugins/MagicMenu/index.d.ts +4 -0
  57. package/dist/plugins/MagicMenu/index.mjs +27 -0
  58. package/dist/plugins/MagicMenu/nuxt.d.ts +2 -0
  59. package/dist/plugins/MagicMenu/nuxt.mjs +14 -0
  60. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +140 -0
  61. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +26 -0
  62. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +169 -0
  63. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +24 -0
  64. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +137 -0
  65. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +29 -0
  66. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +106 -0
  67. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +24 -0
  68. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +122 -0
  69. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +26 -0
  70. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +53 -0
  71. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +21 -0
  72. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +18 -0
  73. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +52 -0
  74. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.d.ts +6 -0
  75. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +42 -0
  76. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +15 -0
  77. package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +75 -0
  78. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +10 -0
  79. package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +178 -0
  80. package/dist/plugins/MagicMenu/src/composables/private/useMenuState.d.ts +7 -0
  81. package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +48 -0
  82. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +18 -0
  83. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +262 -0
  84. package/dist/plugins/MagicMenu/src/composables/private/useMenuUtils.d.ts +3 -0
  85. package/dist/plugins/MagicMenu/src/composables/private/useMenuUtils.mjs +16 -0
  86. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +20 -0
  87. package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +116 -0
  88. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +9 -0
  89. package/dist/plugins/MagicMenu/src/symbols/index.mjs +16 -0
  90. package/dist/plugins/MagicMenu/src/types/index.d.ts +72 -0
  91. package/dist/plugins/MagicMenu/src/types/index.mjs +0 -0
  92. package/dist/plugins/MagicMenu/src/utils/defaultOptions.d.ts +4 -0
  93. package/dist/plugins/MagicMenu/src/utils/defaultOptions.mjs +9 -0
  94. package/dist/plugins/MagicModal/index.d.ts +2 -2
  95. package/dist/plugins/MagicModal/src/components/MagicModal.vue +4 -4
  96. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +5 -5
  97. package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +2 -2
  98. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.d.ts +3 -3
  99. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +2 -2
  100. package/dist/plugins/MagicModal/src/types/index.d.ts +1 -1
  101. package/dist/plugins/MagicModal/src/utils/defaultOptions.d.ts +2 -2
  102. package/dist/plugins/MagicNoise/index.d.ts +1 -2
  103. package/dist/plugins/MagicNoise/index.mjs +1 -2
  104. package/dist/plugins/MagicNoise/nuxt.mjs +1 -5
  105. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +4 -4
  106. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +5 -5
  107. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +2 -2
  108. package/dist/plugins/MagicNoise/src/types/index.d.ts +1 -1
  109. package/dist/plugins/MagicNoise/src/utils/defaultOptions.d.ts +2 -2
  110. package/dist/plugins/MagicPlayer/index.d.ts +0 -1
  111. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +2 -2
  112. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +3 -3
  113. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +2 -2
  114. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +2 -2
  115. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +9 -30
  116. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +10 -14
  117. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +79 -56
  118. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +20 -2
  119. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +2 -2
  120. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +3 -3
  121. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +9 -7
  122. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +2 -2
  123. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +2 -2
  124. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +2 -2
  125. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +2 -3
  126. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +2 -2
  127. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +3 -0
  128. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
  129. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +23 -4
  130. package/dist/plugins/MagicPlayer/src/types/index.d.ts +1 -1
  131. package/dist/plugins/MagicScroll/index.d.ts +3 -3
  132. package/dist/plugins/MagicScroll/index.mjs +1 -2
  133. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +11 -7
  134. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +2 -2
  135. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +2 -2
  136. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +3 -3
  137. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +2 -2
  138. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +3 -3
  139. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +2 -2
  140. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +3 -3
  141. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +2 -2
  142. package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +3 -3
  143. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +28 -0
  144. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +144 -0
  145. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +0 -1
  146. package/dist/plugins/MagicScroll/src/types/index.d.ts +19 -25
  147. package/dist/plugins/MagicToast/index.d.ts +0 -2
  148. package/dist/plugins/MagicToast/src/components/MagicToast.vue +4 -4
  149. package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +2 -2
  150. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +4 -4
  151. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +5 -5
  152. package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +1 -1
  153. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +3 -3
  154. package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -7
  155. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +2 -2
  156. package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +4 -14
  157. package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +6 -6
  158. package/dist/plugins/MagicToast/src/types/index.d.ts +20 -21
  159. package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -2
  160. package/dist/plugins/index.d.ts +1 -0
  161. package/dist/plugins/index.mjs +1 -0
  162. package/dist/utils/index.js +4 -8
  163. package/dist/utils/index.js.map +1 -1
  164. package/dist/utils/index.mjs +4 -8
  165. package/dist/utils/index.mjs.map +1 -1
  166. package/package.json +9 -4
  167. package/dist/plugins/MagicCookie/src/composables/private/defineCookieApi.d.ts +0 -12
  168. package/dist/plugins/MagicScroll/src/composables/useCollisionDetect.d.ts +0 -6
  169. package/dist/plugins/MagicScroll/src/composables/useCollisionDetect.mjs +0 -119
@@ -1,10 +1,10 @@
1
- interface Props {
1
+ interface MagicCommandViewProps {
2
2
  id?: string;
3
3
  default?: boolean;
4
4
  }
5
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
5
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicCommandViewProps>, {
6
6
  default: boolean;
7
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
7
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicCommandViewProps>, {
8
8
  default: boolean;
9
9
  }>>>, {
10
10
  default: boolean;
@@ -25,7 +25,7 @@ export function useCommandScroll(parent) {
25
25
  return elementRect.bottom >= parentBottom;
26
26
  }
27
27
  function findElement(id) {
28
- return mappedParent.value.querySelector(`[data-item-id="${id}"]`);
28
+ return mappedParent.value.querySelector(`[data-id="${id}"]`);
29
29
  }
30
30
  function scrollInFromTop(element) {
31
31
  const elementRect = element.getBoundingClientRect();
@@ -18,7 +18,7 @@ export function useCommandStore() {
18
18
  function sortItems(id, parent) {
19
19
  const instance = findInstance(id);
20
20
  if (instance) {
21
- const itemElements = parent.querySelectorAll("[data-item-id]");
21
+ const itemElements = parent.querySelectorAll("[data-id]");
22
22
  itemElements.forEach((el, index) => {
23
23
  const itemId = el.dataset.itemId;
24
24
  const item = instance.items?.find((item2) => item2.id === itemId);
@@ -1,5 +1,5 @@
1
1
  import type { InjectionKey, MaybeRef } from 'vue';
2
- import type { CommandOptions } from '../types.js';
2
+ import type { MagicCommandOptions } from '../types.js';
3
3
  declare const MagicCommandInstanceId: InjectionKey<MaybeRef<string>>;
4
- declare const MagicCommandOptions: InjectionKey<CommandOptions>;
5
- export { MagicCommandInstanceId, MagicCommandOptions };
4
+ declare const MagicCommandProviderOptions: InjectionKey<MagicCommandOptions>;
5
+ export { MagicCommandInstanceId, MagicCommandProviderOptions };
@@ -1,3 +1,3 @@
1
1
  const MagicCommandInstanceId = Symbol();
2
- const MagicCommandOptions = Symbol();
3
- export { MagicCommandInstanceId, MagicCommandOptions };
2
+ const MagicCommandProviderOptions = Symbol();
3
+ export { MagicCommandInstanceId, MagicCommandProviderOptions };
@@ -1,6 +1,6 @@
1
- import type { ModalOptions } from '../../../MagicModal.js';
2
- import type { DrawerOptions } from '../../../MagicDrawer.js';
3
- export type CommandOptions = {
1
+ import type { MagicModalOptions } from '../../../MagicModal.js';
2
+ import type { MagicDrawerOptions } from '../../../MagicDrawer.js';
3
+ export type MagicCommandOptions = {
4
4
  keys?: {
5
5
  open?: string[] | false;
6
6
  close?: string[] | false;
@@ -17,7 +17,7 @@ export type CommandEvents = {
17
17
  leave: string;
18
18
  afterLeave: string;
19
19
  };
20
- export interface CommandModalOptions extends ModalOptions {
20
+ export interface MagicCommandModalOptions extends MagicModalOptions {
21
21
  }
22
- export interface CommandDrawerOptions extends DrawerOptions {
22
+ export interface MagicCommandDrawerOptions extends MagicDrawerOptions {
23
23
  }
@@ -1,5 +1,5 @@
1
- import type { CommandOptions } from '../types.js';
1
+ import type { MagicCommandOptions } from '../types.js';
2
2
  import type { RequireAllNested } from '@maas/vue-equipment/utils';
3
- declare const defaultOptions: RequireAllNested<CommandOptions>;
3
+ declare const defaultOptions: RequireAllNested<MagicCommandOptions>;
4
4
  type DefaultOptions = typeof defaultOptions;
5
5
  export { defaultOptions, type DefaultOptions };
@@ -1,7 +1,5 @@
1
1
  import type { Plugin } from 'vue';
2
2
  import MagicCookie from './src/components/MagicCookie.vue.js';
3
3
  import { useMagicCookie } from './src/composables/useMagicCookie.js';
4
- import type { CookieEvents } from './src/types/index.js';
5
4
  declare const MagicCookiePlugin: Plugin;
6
5
  export { MagicCookiePlugin, MagicCookie, useMagicCookie };
7
- export type { CookieEvents };
@@ -82,27 +82,26 @@
82
82
  </template>
83
83
 
84
84
  <script lang="ts" setup>
85
- import { defineCookieApi } from '../composables/private/defineCookieApi'
85
+ import { useCookieApi } from '../composables/private/useCookieApi'
86
86
  import { useMagicCookie } from '../composables/useMagicCookie'
87
- import type { CookieRecord } from '../types'
87
+ import type { MagicCookieRecord } from '../types'
88
88
 
89
89
  // Define the props and their default values
90
- type Props = {
91
- cookies: CookieRecord[]
90
+ type MagicCookieProps = {
91
+ cookies: MagicCookieRecord[]
92
92
  maxAge?: number
93
93
  }
94
94
 
95
- const props = withDefaults(defineProps<Props>(), {
95
+ const props = withDefaults(defineProps<MagicCookieProps>(), {
96
96
  maxAge: 60 * 60 * 24 * 30,
97
97
  })
98
98
 
99
99
  // Initialize the Cookie API
100
- defineCookieApi({
100
+ useCookieApi({
101
101
  cookies: props.cookies,
102
102
  maxAge: props.maxAge,
103
103
  })
104
104
 
105
- // Use the Cookie API
106
105
  const {
107
106
  preferencesVisible,
108
107
  selectedCookies,
@@ -1,16 +1,16 @@
1
- import type { CookieRecord } from '../types';
2
- type Props = {
3
- cookies: CookieRecord[];
1
+ import type { MagicCookieRecord } from '../types';
2
+ type MagicCookieProps = {
3
+ cookies: MagicCookieRecord[];
4
4
  maxAge?: number;
5
5
  };
6
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
6
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicCookieProps>, {
7
7
  maxAge: number;
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
8
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicCookieProps>, {
9
9
  maxAge: number;
10
10
  }>>>, {
11
11
  maxAge: number;
12
12
  }, {}>, Partial<Record<string, (_: {
13
- cookie: CookieRecord;
13
+ cookie: MagicCookieRecord;
14
14
  }) => any>> & {
15
15
  default?(_: {}): any;
16
16
  actions?(_: {}): any;
@@ -0,0 +1,17 @@
1
+ import type { MagicCookieRecord } from '../../types.js';
2
+ type UseCookieApiArgs = {
3
+ cookies: MagicCookieRecord[];
4
+ maxAge?: number;
5
+ };
6
+ export declare const cookieApiStore: import("vue").Ref<{
7
+ cookies: {
8
+ [x: string]: unknown;
9
+ key: string;
10
+ optional?: boolean | undefined;
11
+ title?: string | undefined;
12
+ text?: string | undefined;
13
+ }[];
14
+ maxAge: number | undefined;
15
+ }>;
16
+ export declare function useCookieApi({ cookies, maxAge }: UseCookieApiArgs): void;
17
+ export {};
@@ -1,14 +1,14 @@
1
1
  import { ref } from "vue";
2
2
  import { slugify } from "@maas/vue-equipment/utils";
3
- export const globalApiState = ref({
3
+ export const cookieApiStore = ref({
4
4
  cookies: [],
5
5
  maxAge: void 0
6
6
  });
7
- export function defineCookieApi({ cookies, maxAge }) {
7
+ export function useCookieApi({ cookies, maxAge }) {
8
8
  if (!Array.isArray(cookies)) {
9
9
  console.warn('Invalid configuration. "cookies" must be an array.');
10
10
  }
11
- globalApiState.value.cookies = cookies?.map((cookie) => {
11
+ cookieApiStore.value.cookies = cookies?.map((cookie) => {
12
12
  return {
13
13
  ...cookie,
14
14
  key: slugify(cookie.key, {
@@ -18,5 +18,5 @@ export function defineCookieApi({ cookies, maxAge }) {
18
18
  })
19
19
  };
20
20
  });
21
- globalApiState.value.maxAge = maxAge;
21
+ cookieApiStore.value.maxAge = maxAge;
22
22
  }
@@ -1,16 +1,16 @@
1
- import type { CookieConsent } from '../types.js';
1
+ import type { MagicCookieConsent } from '../types.js';
2
2
  export declare function useMagicCookie(): {
3
3
  preferencesVisible: import("vue").Ref<boolean>;
4
4
  selectedCookies: import("vue").Ref<{
5
5
  [key: string]: boolean;
6
6
  }>;
7
- cookieConsent: import("vue").WritableComputedRef<CookieConsent>;
7
+ cookieConsent: import("vue").WritableComputedRef<MagicCookieConsent>;
8
8
  toggleSelection: (key: string) => void;
9
9
  accept: () => void;
10
10
  acceptSelected: () => void;
11
11
  reject: () => void;
12
- onAccept: (handler: (args: CookieConsent) => void) => void;
13
- onAcceptSelected: (handler: (args: CookieConsent) => void) => void;
14
- onReject: (handler: (args: CookieConsent) => void) => void;
12
+ onAccept: (handler: (args: MagicCookieConsent) => void) => void;
13
+ onAcceptSelected: (handler: (args: MagicCookieConsent) => void) => void;
14
+ onReject: (handler: (args: MagicCookieConsent) => void) => void;
15
15
  };
16
16
  export type UseMagicCookieReturn = ReturnType<typeof useMagicCookie>;
@@ -2,7 +2,7 @@ import { computed, ref } from "vue";
2
2
  import { useCookies } from "@vueuse/integrations/useCookies";
3
3
  import { toValue } from "@vueuse/core";
4
4
  import { useMagicEmitter } from "@maas/vue-equipment/plugins";
5
- import { globalApiState } from "./private/defineCookieApi.mjs";
5
+ import { cookieApiStore } from "./private/useCookieApi.mjs";
6
6
  const preferencesVisible = ref(false);
7
7
  const selectedCookies = ref({});
8
8
  export function useMagicCookie() {
@@ -13,7 +13,7 @@ export function useMagicCookie() {
13
13
  },
14
14
  set: (value) => {
15
15
  universalCookies.set("cookie_consent", value, {
16
- maxAge: globalApiState.value?.maxAge
16
+ maxAge: cookieApiStore.value?.maxAge
17
17
  });
18
18
  }
19
19
  });
@@ -26,7 +26,7 @@ export function useMagicCookie() {
26
26
  };
27
27
  }
28
28
  function accept() {
29
- const cookies = globalApiState.value?.cookies?.reduce((result, cookie) => {
29
+ const cookies = cookieApiStore.value?.cookies?.reduce((result, cookie) => {
30
30
  result[cookie.key] = true;
31
31
  return result;
32
32
  }, {});
@@ -44,7 +44,7 @@ export function useMagicCookie() {
44
44
  emitter.emit("acceptSelected", cookieConsent.value);
45
45
  }
46
46
  function reject() {
47
- const cookies = globalApiState.value?.cookies?.reduce((result, cookie) => {
47
+ const cookies = cookieApiStore.value?.cookies?.reduce((result, cookie) => {
48
48
  result[cookie.key] = cookie.optional === false ? true : false;
49
49
  return result;
50
50
  }, {});
@@ -1,20 +1,16 @@
1
- export type CookieApiDefinition = {
2
- cookies: CookieRecord[];
3
- maxAge?: number;
4
- };
5
- export type CookieRecord = {
1
+ export type MagicCookieRecord = {
6
2
  key: string;
7
3
  optional?: boolean;
8
4
  title?: string;
9
5
  text?: string;
10
- [key: string]: any;
6
+ [key: string]: unknown;
11
7
  };
12
- export type CookieConsent = {
8
+ export type MagicCookieConsent = {
13
9
  timestamp: number | undefined;
14
10
  cookies: Record<string, boolean>;
15
11
  };
16
12
  export type CookieEvents = {
17
- accept: CookieConsent;
18
- reject: CookieConsent;
19
- acceptSelected: CookieConsent;
13
+ accept: MagicCookieConsent;
14
+ reject: MagicCookieConsent;
15
+ acceptSelected: MagicCookieConsent;
20
16
  };
@@ -1,6 +1,6 @@
1
1
  import type { Plugin } from 'vue';
2
2
  import MagicDraggable from './src/components/MagicDraggable.vue.js';
3
- import type { DraggableOptions, DraggableEvents } from './src/types.js';
3
+ import type { MagicDraggableOptions } from './src/types.js';
4
4
  declare const MagicDraggablePlugin: Plugin;
5
5
  export { MagicDraggablePlugin, MagicDraggable };
6
- export type { DraggableOptions, DraggableEvents };
6
+ export type { MagicDraggableOptions };
@@ -43,17 +43,17 @@ import { useDraggableDrag } from '../composables/private/useDraggableDrag'
43
43
  import { useDraggableState } from '../composables/private/useDraggableState'
44
44
  import { defaultOptions } from '../utils/defaultOptions'
45
45
 
46
- import type { DraggableOptions } from '../types'
46
+ import type { MagicDraggableOptions } from '../types'
47
47
 
48
- interface MagicDrawerProps {
48
+ interface MagicDraggableProps {
49
49
  id: MaybeRef<string>
50
50
  class?: MaybeRef<string>
51
51
  component?: Component
52
52
  props?: Record<string, unknown>
53
- options?: DraggableOptions
53
+ options?: MagicDraggableOptions
54
54
  }
55
55
 
56
- const props = withDefaults(defineProps<MagicDrawerProps>(), {
56
+ const props = withDefaults(defineProps<MagicDraggableProps>(), {
57
57
  options: () => defaultOptions,
58
58
  })
59
59
 
@@ -1,18 +1,18 @@
1
1
  import { type Component, type MaybeRef } from 'vue';
2
- import type { DraggableOptions } from '../types';
3
- interface MagicDrawerProps {
2
+ import type { MagicDraggableOptions } from '../types';
3
+ interface MagicDraggableProps {
4
4
  id: MaybeRef<string>;
5
5
  class?: MaybeRef<string>;
6
6
  component?: Component;
7
7
  props?: Record<string, unknown>;
8
- options?: DraggableOptions;
8
+ options?: MagicDraggableOptions;
9
9
  }
10
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDrawerProps>, {
10
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDraggableProps>, {
11
11
  options: () => any;
12
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDrawerProps>, {
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDraggableProps>, {
13
13
  options: () => any;
14
14
  }>>>, {
15
- options: DraggableOptions;
15
+ options: MagicDraggableOptions;
16
16
  }, {}>, {
17
17
  default?(_: {}): any;
18
18
  }>;
@@ -1,6 +1,5 @@
1
1
  import { type MaybeRef } from 'vue';
2
- import type { DraggableState } from '../../types/index.js';
3
2
  export declare function useDraggableState(id: MaybeRef<string>): {
4
- initializeState: () => import("vue").ToRefs<DraggableState>;
3
+ initializeState: () => import("vue").ToRefs<any>;
5
4
  deleteState: () => void;
6
5
  };
@@ -10,7 +10,7 @@ export type DraggableSnapPoint = [
10
10
  y?: number;
11
11
  }
12
12
  ] | Position;
13
- export interface DraggableOptions {
13
+ export interface MagicDraggableOptions {
14
14
  tag?: 'dialog' | 'div';
15
15
  threshold?: {
16
16
  distance?: number;
@@ -1,8 +1,8 @@
1
- import type { DraggableOptions } from '../types.js';
1
+ import type { MagicDraggableOptions } from '../types.js';
2
2
  import type { RequireAll } from '@maas/vue-equipment/utils';
3
- type DefaultOptions = RequireAll<DraggableOptions> & {
4
- threshold: RequireAll<DraggableOptions['threshold']>;
5
- animation: RequireAll<DraggableOptions['animation']>;
3
+ type DefaultOptions = RequireAll<MagicDraggableOptions> & {
4
+ threshold: RequireAll<MagicDraggableOptions['threshold']>;
5
+ animation: RequireAll<MagicDraggableOptions['animation']>;
6
6
  };
7
7
  declare const defaultOptions: DefaultOptions;
8
8
  export { defaultOptions, type DefaultOptions };
@@ -1,7 +1,7 @@
1
1
  import MagicDrawer from './src/components/MagicDrawer.vue.js';
2
2
  import { useMagicDrawer } from './src/composables/useMagicDrawer.js';
3
3
  import type { Plugin } from 'vue';
4
- import type { DrawerEvents, DrawerOptions } from './src/types/index.js';
4
+ import type { MagicDrawerOptions } from './src/types/index.js';
5
5
  declare const MagicDrawerPlugin: Plugin;
6
6
  export { MagicDrawerPlugin, MagicDrawer, useMagicDrawer };
7
- export type { DrawerEvents, DrawerOptions };
7
+ export type { MagicDrawerOptions };
@@ -75,7 +75,6 @@ import {
75
75
  nextTick,
76
76
  toValue,
77
77
  onBeforeMount,
78
- onMounted,
79
78
  onBeforeUnmount,
80
79
  onUnmounted,
81
80
  type Component,
@@ -92,7 +91,7 @@ import { useDrawerDrag } from '../composables/private/useDrawerDrag'
92
91
  import { useDrawerWheel } from '../composables/private/useDrawerWheel'
93
92
  import { useDrawerState } from '../composables/private/useDrawerState'
94
93
 
95
- import type { DrawerOptions } from '../types/index'
94
+ import type { MagicDrawerOptions } from '../types/index'
96
95
 
97
96
  import '@maas/vue-equipment/utils/css/animations/fade-in.css'
98
97
  import '@maas/vue-equipment/utils/css/animations/fade-out.css'
@@ -109,7 +108,7 @@ import { useMagicDrawer } from '../composables/useMagicDrawer'
109
108
  // Prevent deep merge of certain options
110
109
  // In this case, don’t merge the `close` and `points` options
111
110
  const customDefu = createDefu((obj, key, value) => {
112
- if (key === 'close' || key === 'points') {
111
+ if (key === 'close' || key === 'snapPoints') {
113
112
  obj[key] = value
114
113
  return true
115
114
  }
@@ -120,7 +119,7 @@ interface MagicDrawerProps {
120
119
  class?: MaybeRef<string>
121
120
  component?: Component
122
121
  props?: Record<string, unknown>
123
- options?: DrawerOptions
122
+ options?: MagicDrawerOptions
124
123
  }
125
124
 
126
125
  const props = withDefaults(defineProps<MagicDrawerProps>(), {
@@ -1,5 +1,5 @@
1
1
  import { type Component, type MaybeRef } from 'vue';
2
- import type { DrawerOptions } from '../types/index';
2
+ import type { MagicDrawerOptions } from '../types/index';
3
3
  import '@maas/vue-equipment/utils/css/animations/fade-in.css';
4
4
  import '@maas/vue-equipment/utils/css/animations/fade-out.css';
5
5
  import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
@@ -15,14 +15,14 @@ interface MagicDrawerProps {
15
15
  class?: MaybeRef<string>;
16
16
  component?: Component;
17
17
  props?: Record<string, unknown>;
18
- options?: DrawerOptions;
18
+ options?: MagicDrawerOptions;
19
19
  }
20
20
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDrawerProps>, {
21
21
  options: () => any;
22
22
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDrawerProps>, {
23
23
  options: () => any;
24
24
  }>>>, {
25
- options: DrawerOptions;
25
+ options: MagicDrawerOptions;
26
26
  }, {}>, {
27
27
  backdrop?(_: {}): any;
28
28
  default?(_: {}): any;
@@ -1,8 +1,8 @@
1
1
  import { type Ref, type MaybeRef } from 'vue';
2
- import type { DrawerOptions } from '../../types.js';
2
+ import type { MagicDrawerOptions } from '../../types.js';
3
3
  type UseDrawerCallbackArgs = {
4
4
  id: MaybeRef<string>;
5
- mappedOptions: DrawerOptions;
5
+ mappedOptions: MagicDrawerOptions;
6
6
  addScrollLockPadding: () => void;
7
7
  removeScrollLockPadding: () => void;
8
8
  lockScroll: () => void;
@@ -1,9 +1,9 @@
1
1
  import { type MaybeElementRef } from '@vueuse/core';
2
- import type { DrawerOptions } from '../../types/index.js';
3
- export type UseDrawerDOMOptions = Pick<DrawerOptions, 'scrollLock' | 'focusTrap'> & {
2
+ import type { MagicDrawerOptions } from '../../types/index.js';
3
+ export type UseDrawerDOMArgs = Pick<MagicDrawerOptions, 'scrollLock' | 'focusTrap'> & {
4
4
  focusTarget: MaybeElementRef;
5
5
  };
6
- export declare function useDrawerDOM(options?: UseDrawerDOMOptions): {
6
+ export declare function useDrawerDOM(args?: UseDrawerDOMArgs): {
7
7
  trapFocus: () => void;
8
8
  releaseFocus: () => void;
9
9
  lockScroll: () => void;
@@ -9,9 +9,9 @@ const defaultOptions = {
9
9
  scrollLock: true
10
10
  };
11
11
  const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : ref(false);
12
- export function useDrawerDOM(options) {
12
+ export function useDrawerDOM(args) {
13
13
  const positionFixedElements = ref([]);
14
- const mappedOptions = defu(options, defaultOptions);
14
+ const mappedOptions = defu(args, defaultOptions);
15
15
  const focusTrap = mappedOptions.focusTarget ? typeof mappedOptions.focusTrap === "boolean" ? useFocusTrap(mappedOptions.focusTarget) : useFocusTrap(mappedOptions.focusTarget, mappedOptions.focusTrap) : void 0;
16
16
  function trapFocus() {
17
17
  if (focusTrap) {
@@ -14,7 +14,9 @@ import {
14
14
  useScrollLock
15
15
  } from "@vueuse/core";
16
16
  import { isIOS, isWithinRange } from "@maas/vue-equipment/utils";
17
- import { useMagicEmitter } from "@maas/vue-equipment/plugins";
17
+ import {
18
+ useMagicEmitter
19
+ } from "@maas/vue-equipment/plugins";
18
20
  import { useDrawerSnap } from "./useDrawerSnap.mjs";
19
21
  import { useDrawerGuards } from "./useDrawerGuards.mjs";
20
22
  import { useDrawerUtils } from "./useDrawerUtils.mjs";
@@ -8,7 +8,9 @@ import {
8
8
  } from "vue";
9
9
  import { useElementBounding, useRafFn } from "@vueuse/core";
10
10
  import { clampValue, mapValue } from "@maas/vue-equipment/utils";
11
- import { useMagicEmitter } from "@maas/vue-equipment/plugins";
11
+ import {
12
+ useMagicEmitter
13
+ } from "@maas/vue-equipment/plugins";
12
14
  import { useDrawerState } from "./useDrawerState.mjs";
13
15
  export function useDrawerProgress(args) {
14
16
  const { id, drawerRef, elRef, position, overshoot } = args;
@@ -42,9 +42,7 @@ export function useDrawerState(id) {
42
42
  return toRefs(instance);
43
43
  }
44
44
  function deleteState() {
45
- drawerStateStore.value = drawerStateStore.value.filter(
46
- (x) => x.id !== id
47
- );
45
+ drawerStateStore.value = drawerStateStore.value.filter((x) => x.id !== id);
48
46
  }
49
47
  return {
50
48
  addState,
@@ -1,6 +1,6 @@
1
1
  import { type Options } from 'focus-trap';
2
2
  export type DrawerSnapPoint = number | `${string}px`;
3
- export interface DrawerOptions {
3
+ export interface MagicDrawerOptions {
4
4
  position?: 'top' | 'right' | 'bottom' | 'left';
5
5
  backdrop?: boolean;
6
6
  tag?: 'dialog' | 'div';
@@ -1,11 +1,11 @@
1
- import type { DrawerOptions } from '../types.js';
1
+ import type { MagicDrawerOptions } from '../types.js';
2
2
  import type { RequireAll } from '@maas/vue-equipment/utils';
3
- type DefaultOptions = RequireAll<DrawerOptions> & {
4
- scrollLock: RequireAll<DrawerOptions['scrollLock']>;
5
- threshold: RequireAll<DrawerOptions['threshold']>;
6
- animation: RequireAll<DrawerOptions['animation']>;
7
- initial: RequireAll<DrawerOptions['initial']>;
8
- keyListener: RequireAll<DrawerOptions['keyListener']>;
3
+ type DefaultOptions = RequireAll<MagicDrawerOptions> & {
4
+ scrollLock: RequireAll<MagicDrawerOptions['scrollLock']>;
5
+ threshold: RequireAll<MagicDrawerOptions['threshold']>;
6
+ animation: RequireAll<MagicDrawerOptions['animation']>;
7
+ initial: RequireAll<MagicDrawerOptions['initial']>;
8
+ keyListener: RequireAll<MagicDrawerOptions['keyListener']>;
9
9
  };
10
10
  declare const defaultOptions: DefaultOptions;
11
11
  export { defaultOptions, type DefaultOptions };