@maas/vue-equipment 1.0.0-beta.6 → 1.0.0-beta.8

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 (141) hide show
  1. package/dist/composables/index.d.ts +5 -5
  2. package/dist/composables/index.js +14 -8
  3. package/dist/composables/index.js.map +1 -1
  4. package/dist/nuxt/module.json +1 -1
  5. package/dist/nuxt/module.mjs +2 -2
  6. package/dist/plugins/.turbo/turbo-lint.log +2 -2
  7. package/dist/plugins/MagicAccordion/demo/data/footer.json +1 -1
  8. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +3 -3
  9. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +2 -2
  10. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +15 -13
  11. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +6 -157
  12. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
  13. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +4 -2
  14. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
  15. package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
  16. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +11 -4
  17. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
  18. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +0 -4
  19. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +3 -8
  20. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +5 -7
  21. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +3 -87
  22. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +7 -7
  23. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +1 -4
  24. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -5
  25. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +3 -157
  26. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +3 -3
  27. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
  28. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
  29. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
  30. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
  31. package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
  32. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +3 -3
  33. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +3 -3
  34. package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
  35. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +10 -12
  36. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +4 -25
  37. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
  38. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +4 -4
  39. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
  40. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -3
  41. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +12 -15
  42. package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
  43. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +20 -21
  44. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +188 -0
  45. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
  46. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
  47. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
  48. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
  49. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
  50. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
  51. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
  52. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
  53. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
  54. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +15 -15
  55. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +25 -0
  56. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
  57. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
  58. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +27 -0
  59. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +3 -6
  60. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +56 -0
  61. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +5 -7
  62. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +53 -0
  63. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +1 -12
  64. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +3 -8
  65. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +6 -6
  66. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +1 -85
  67. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +1 -1
  68. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +2 -2
  69. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +3 -4
  70. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +3 -157
  71. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +3 -3
  72. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
  73. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
  74. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
  75. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
  76. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
  77. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
  78. package/dist/plugins/MagicModal/src/components/MagicModal.vue +6 -6
  79. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +60 -0
  80. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
  81. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +13 -13
  82. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -5
  83. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
  84. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
  85. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +14 -8
  86. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +1 -4
  87. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +29 -29
  88. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
  89. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -1
  90. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +19 -8
  91. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -4
  92. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +35 -0
  93. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -5
  94. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +3 -4
  95. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -11
  96. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
  97. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +3 -4
  98. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +1 -4
  99. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +23 -24
  100. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
  101. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  102. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  103. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  104. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  105. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  106. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  107. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  108. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
  109. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +3 -3
  110. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
  111. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +15 -9
  112. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
  113. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +18 -11
  114. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -3
  115. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +3 -3
  116. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
  117. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +4 -4
  118. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +20 -20
  119. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +17 -8
  120. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +4 -10
  121. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +7 -7
  122. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +4 -10
  123. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +3 -3
  124. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +17 -9
  125. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +4 -9
  126. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
  127. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +3 -3
  128. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +8 -3
  129. package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
  130. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +9 -10
  131. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -59
  132. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +5 -8
  133. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +3 -8
  134. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +22 -22
  135. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
  136. package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
  137. package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
  138. package/dist/utils/index.d.ts +7 -3
  139. package/dist/utils/index.js +25 -0
  140. package/dist/utils/index.js.map +1 -1
  141. package/package.json +3 -3
@@ -6,15 +6,7 @@ const _hoisted_2 = {
6
6
  key: 0,
7
7
  class: "magic-menu-item__pointer-guard"
8
8
  };
9
- import {
10
- ref,
11
- computed,
12
- inject,
13
- provide,
14
- onBeforeUnmount,
15
- watch,
16
- useId
17
- } from "vue";
9
+ import { computed, inject, provide, onBeforeUnmount, watch, useId } from "vue";
18
10
  import { useMenuItem } from "../composables/private/useMenuItem";
19
11
  import { useMenuState } from "../composables/private/useMenuState";
20
12
  import { useMenuView } from "../composables/private/useMenuView";
@@ -37,7 +29,6 @@ export default /* @__PURE__ */ _defineComponent({
37
29
  const instanceId = inject(MagicMenuInstanceId, void 0);
38
30
  const viewId = inject(MagicMenuViewId, void 0);
39
31
  const contentId = inject(MagicMenuContentId, void 0);
40
- const elRef = ref(void 0);
41
32
  if (!instanceId) {
42
33
  throw new Error("MagicMenuItem must be nested inside MagicMenuProvider");
43
34
  }
@@ -101,8 +92,6 @@ export default /* @__PURE__ */ _defineComponent({
101
92
  });
102
93
  return (_ctx, _cache) => {
103
94
  return _openBlock(), _createElementBlock("div", {
104
- ref_key: "elRef",
105
- ref: elRef,
106
95
  class: "magic-menu-item",
107
96
  "data-id": mappedId.value,
108
97
  "data-disabled": _ctx.disabled,
@@ -2,7 +2,6 @@ interface MagicMenuItemProps {
2
2
  id?: string;
3
3
  disabled?: boolean;
4
4
  }
5
- declare const elRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
6
5
  declare const mappedId: import("vue").ComputedRef<string>;
7
6
  declare const item: import("../types").MenuItem;
8
7
  declare const pointerDisabled: import("vue").ComputedRef<boolean>;
@@ -10,18 +9,14 @@ declare function guardedSelect(): void;
10
9
  declare function guardedUnselect(): void;
11
10
  declare function onClick(event: MouseEvent): void;
12
11
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
13
- declare var __VLS_0: {
12
+ declare var __VLS_1: {
14
13
  itemActive: boolean;
15
14
  itemDisabled: boolean;
16
15
  };
17
16
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
18
- default?: (props: typeof __VLS_0) => any;
17
+ default?: (props: typeof __VLS_1) => any;
19
18
  }>;
20
- type __VLS_TemplateRefs = {
21
- elRef: typeof __VLS_nativeElements['div'];
22
- };
23
19
  declare const __VLS_self: import("vue").DefineComponent<MagicMenuItemProps, {
24
- elRef: typeof elRef;
25
20
  mappedId: typeof mappedId;
26
21
  item: typeof item;
27
22
  pointerDisabled: typeof pointerDisabled;
@@ -37,7 +32,7 @@ declare const __VLS_component: import("vue").DefineComponent<MagicMenuItemProps,
37
32
  click: (event: MouseEvent) => any;
38
33
  }, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
39
34
  onClick?: ((event: MouseEvent) => any) | undefined;
40
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, HTMLDivElement>;
35
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
36
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
42
37
  export default _default;
43
38
  type __VLS_WithSlots<T, S> = T & {
@@ -2,7 +2,8 @@
2
2
  import { defineComponent as _defineComponent } from "vue";
3
3
  import { renderSlot as _renderSlot, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
4
4
  import {
5
- ref,
5
+ useTemplateRef,
6
+ shallowRef,
6
7
  provide,
7
8
  watch,
8
9
  toValue,
@@ -24,12 +25,12 @@ export default /* @__PURE__ */ _defineComponent({
24
25
  options: { type: Object, required: false }
25
26
  },
26
27
  setup(__props) {
27
- const elRef = ref(void 0);
28
+ const elRef = useTemplateRef("el");
28
29
  const mappedOptions = defu(__props.options, defaultOptions);
29
30
  const { initializeState, deleteState } = useMenuState(__props.id);
30
31
  const state = initializeState(mappedOptions);
31
- const lastX = ref(0);
32
- const lastY = ref(0);
32
+ const lastX = shallowRef(0);
33
+ const lastY = shallowRef(0);
33
34
  const { x, y } = usePointer();
34
35
  watch(
35
36
  () => state?.input.type,
@@ -86,8 +87,7 @@ export default /* @__PURE__ */ _defineComponent({
86
87
  provide(MagicMenuInstanceId, __props.id);
87
88
  return (_ctx, _cache) => {
88
89
  return _openBlock(), _createBlock(_unref(Primitive), {
89
- ref_key: "elRef",
90
- ref: elRef,
90
+ ref: "el",
91
91
  "as-child": _ctx.asChild,
92
92
  "data-id": _ctx.id,
93
93
  class: "magic-menu-provider"
@@ -6,99 +6,15 @@ interface MagicMenuProviderProps {
6
6
  asChild?: boolean;
7
7
  options?: MagicMenuOptions;
8
8
  }
9
- declare const elRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
10
9
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
11
- declare const __VLS_0: import("vue").DefineComponent<{
12
- asChild: {
13
- type: BooleanConstructor;
14
- default: boolean;
15
- };
16
- as: {
17
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
18
- default: string;
19
- };
20
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
- [key: string]: any;
22
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
- asChild: {
24
- type: BooleanConstructor;
25
- default: boolean;
26
- };
27
- as: {
28
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
29
- default: string;
30
- };
31
- }>>, {
32
- asChild: boolean;
33
- as: import("@maas/vue-primitive").ElementOrComponent;
34
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
- declare const __VLS_2: import("vue/jsx-runtime").JSX.Element & {
36
- __ctx?: ({
37
- attrs?: any;
38
- slots?: Readonly<{
39
- [name: string]: import("vue").Slot<any> | undefined;
40
- }> | undefined;
41
- emit?: ((event: string, ...args: any[]) => void) | undefined;
42
- } & {
43
- props?: (Partial<{
44
- asChild: boolean;
45
- as: import("@maas/vue-primitive").ElementOrComponent;
46
- }> & Omit<{
47
- readonly asChild: boolean;
48
- readonly as: import("@maas/vue-primitive").ElementOrComponent;
49
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "asChild" | "as"> & Record<string, unknown>) | undefined;
50
- expose?(exposed: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
51
- asChild: {
52
- type: BooleanConstructor;
53
- default: boolean;
54
- };
55
- as: {
56
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
57
- default: string;
58
- };
59
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
60
- [key: string]: any;
61
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
62
- asChild: boolean;
63
- as: import("@maas/vue-primitive").ElementOrComponent;
64
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65
- P: {};
66
- B: {};
67
- D: {};
68
- C: {};
69
- M: {};
70
- Defaults: {};
71
- }, Readonly<import("vue").ExtractPropTypes<{
72
- asChild: {
73
- type: BooleanConstructor;
74
- default: boolean;
75
- };
76
- as: {
77
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
78
- default: string;
79
- };
80
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
81
- [key: string]: any;
82
- }>, {}, {}, {}, {
83
- asChild: boolean;
84
- as: import("@maas/vue-primitive").ElementOrComponent;
85
- }>): void;
86
- }) | undefined;
87
- };
88
- declare var __VLS_6: (Parameters<NonNullable<(typeof __VLS_5)["expose"]>>[0] | null);
89
10
  declare var __VLS_7: {};
90
- declare var __VLS_5: __VLS_PickFunctionalComponentCtx<typeof __VLS_0, typeof __VLS_2>;
91
11
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
92
12
  default?: (props: typeof __VLS_7) => any;
93
13
  }>;
94
- type __VLS_TemplateRefs = {
95
- elRef: typeof __VLS_6;
96
- };
97
14
  declare const __VLS_self: import("vue").DefineComponent<MagicMenuProviderProps, {
98
15
  Primitive: typeof Primitive;
99
- elRef: typeof elRef;
100
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
101
- declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, any>;
17
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
102
18
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
103
19
  export default _default;
104
20
  type __VLS_WithSlots<T, S> = T & {
@@ -29,7 +29,7 @@ export default /* @__PURE__ */ _defineComponent({
29
29
  }
30
30
  if (!mappedViewId.value) {
31
31
  throw new Error(
32
- "MagicMenuTrigger must be nested inside MagicMenuView or a viewId must be provided"
32
+ "MagicMenuRemote must be nested inside MagicMenuView or a viewId must be provided"
33
33
  );
34
34
  }
35
35
  if (!__props.channelId) {
@@ -11,12 +11,12 @@ interface MagicMenuRemoteProps {
11
11
  declare const onClick: () => void, onMouseenter: () => void;
12
12
  declare let channel: import("../types").MenuChannel;
13
13
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
14
- declare var __VLS_10: {
14
+ declare var __VLS_11: {
15
15
  channelActive: boolean;
16
16
  remoteDisabled: boolean;
17
17
  };
18
18
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
19
- default?: (props: typeof __VLS_10) => any;
19
+ default?: (props: typeof __VLS_11) => any;
20
20
  }>;
21
21
  declare const __VLS_self: import("vue").DefineComponent<MagicMenuRemoteProps, {
22
22
  Primitive: typeof Primitive;
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { defineComponent as _defineComponent } from "vue";
3
3
  import { unref as _unref, renderSlot as _renderSlot, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
4
- import { computed, inject, ref, toValue, watch } from "vue";
4
+ import { computed, inject, useTemplateRef, toValue, watch } from "vue";
5
5
  import { Primitive } from "@maas/vue-primitive";
6
6
  import { useMenuState } from "../composables/private/useMenuState";
7
7
  import { useMenuView } from "../composables/private/useMenuView";
@@ -23,7 +23,7 @@ export default /* @__PURE__ */ _defineComponent({
23
23
  asChild: { type: Boolean, required: false }
24
24
  },
25
25
  setup(__props) {
26
- const elRef = ref(void 0);
26
+ const elRef = useTemplateRef("el");
27
27
  const injectedInstanceId = inject(MagicMenuInstanceId, void 0);
28
28
  const injectedViewId = inject(MagicMenuViewId, void 0);
29
29
  const itemId = inject(MagicMenuItemId, void 0);
@@ -94,8 +94,7 @@ export default /* @__PURE__ */ _defineComponent({
94
94
  onKeyStroke("Enter", onEnter);
95
95
  return (_ctx, _cache) => {
96
96
  return _openBlock(), _createBlock(_unref(Primitive), {
97
- ref_key: "elRef",
98
- ref: elRef,
97
+ ref: "el",
99
98
  "data-id": `${mappedViewId.value}-trigger`,
100
99
  "data-active": _unref(view)?.active,
101
100
  "data-disabled": mappedDisabled.value,
@@ -7,175 +7,21 @@ interface MagicMenuTriggerProps {
7
7
  trigger?: Interaction[];
8
8
  asChild?: boolean;
9
9
  }
10
- declare const elRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
11
- asChild: {
12
- type: BooleanConstructor;
13
- default: boolean;
14
- };
15
- as: {
16
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
17
- default: string;
18
- };
19
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
20
- [key: string]: any;
21
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
22
- asChild: boolean;
23
- as: import("@maas/vue-primitive").ElementOrComponent;
24
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
25
- P: {};
26
- B: {};
27
- D: {};
28
- C: {};
29
- M: {};
30
- Defaults: {};
31
- }, Readonly<import("vue").ExtractPropTypes<{
32
- asChild: {
33
- type: BooleanConstructor;
34
- default: boolean;
35
- };
36
- as: {
37
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
38
- default: string;
39
- };
40
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
41
- [key: string]: any;
42
- }>, {}, {}, {}, {
43
- asChild: boolean;
44
- as: import("@maas/vue-primitive").ElementOrComponent;
45
- }> | undefined, import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
46
- asChild: {
47
- type: BooleanConstructor;
48
- default: boolean;
49
- };
50
- as: {
51
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
52
- default: string;
53
- };
54
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
55
- [key: string]: any;
56
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
57
- asChild: boolean;
58
- as: import("@maas/vue-primitive").ElementOrComponent;
59
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
60
- P: {};
61
- B: {};
62
- D: {};
63
- C: {};
64
- M: {};
65
- Defaults: {};
66
- }, Readonly<import("vue").ExtractPropTypes<{
67
- asChild: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- as: {
72
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
73
- default: string;
74
- };
75
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
76
- [key: string]: any;
77
- }>, {}, {}, {}, {
78
- asChild: boolean;
79
- as: import("@maas/vue-primitive").ElementOrComponent;
80
- }> | undefined>;
81
10
  declare const mappedViewId: import("vue").ComputedRef<string | undefined>;
82
11
  declare const view: import("../types").MenuView | undefined;
83
12
  declare const mappedDisabled: import("vue").ComputedRef<boolean>;
84
13
  declare const mappedTabindex: import("vue").ComputedRef<0 | undefined>;
85
14
  declare const onMouseenter: () => void, onClick: (e: MouseEvent) => void;
86
15
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
87
- declare const __VLS_0: import("vue").DefineComponent<{
88
- asChild: {
89
- type: BooleanConstructor;
90
- default: boolean;
91
- };
92
- as: {
93
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
94
- default: string;
95
- };
96
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
97
- [key: string]: any;
98
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
99
- asChild: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- as: {
104
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
105
- default: string;
106
- };
107
- }>>, {
108
- asChild: boolean;
109
- as: import("@maas/vue-primitive").ElementOrComponent;
110
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
111
- declare const __VLS_2: import("vue/jsx-runtime").JSX.Element & {
112
- __ctx?: ({
113
- attrs?: any;
114
- slots?: Readonly<{
115
- [name: string]: import("vue").Slot<any> | undefined;
116
- }> | undefined;
117
- emit?: ((event: string, ...args: any[]) => void) | undefined;
118
- } & {
119
- props?: (Partial<{
120
- asChild: boolean;
121
- as: import("@maas/vue-primitive").ElementOrComponent;
122
- }> & Omit<{
123
- readonly asChild: boolean;
124
- readonly as: import("@maas/vue-primitive").ElementOrComponent;
125
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "asChild" | "as"> & Record<string, unknown>) | undefined;
126
- expose?(exposed: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
127
- asChild: {
128
- type: BooleanConstructor;
129
- default: boolean;
130
- };
131
- as: {
132
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
133
- default: string;
134
- };
135
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
136
- [key: string]: any;
137
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
138
- asChild: boolean;
139
- as: import("@maas/vue-primitive").ElementOrComponent;
140
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
141
- P: {};
142
- B: {};
143
- D: {};
144
- C: {};
145
- M: {};
146
- Defaults: {};
147
- }, Readonly<import("vue").ExtractPropTypes<{
148
- asChild: {
149
- type: BooleanConstructor;
150
- default: boolean;
151
- };
152
- as: {
153
- type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
154
- default: string;
155
- };
156
- }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
157
- [key: string]: any;
158
- }>, {}, {}, {}, {
159
- asChild: boolean;
160
- as: import("@maas/vue-primitive").ElementOrComponent;
161
- }>): void;
162
- }) | undefined;
163
- };
164
- declare var __VLS_6: (Parameters<NonNullable<(typeof __VLS_5)["expose"]>>[0] | null);
165
- declare var __VLS_11: {
16
+ declare var __VLS_13: {
166
17
  viewActive: boolean | undefined;
167
18
  triggerDisabled: boolean;
168
19
  };
169
- declare var __VLS_5: __VLS_PickFunctionalComponentCtx<typeof __VLS_0, typeof __VLS_2>;
170
20
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
171
- default?: (props: typeof __VLS_11) => any;
21
+ default?: (props: typeof __VLS_13) => any;
172
22
  }>;
173
- type __VLS_TemplateRefs = {
174
- elRef: typeof __VLS_6;
175
- };
176
23
  declare const __VLS_self: import("vue").DefineComponent<MagicMenuTriggerProps, {
177
24
  Primitive: typeof Primitive;
178
- elRef: typeof elRef;
179
25
  mappedViewId: typeof mappedViewId;
180
26
  view: typeof view;
181
27
  mappedDisabled: typeof mappedDisabled;
@@ -183,7 +29,7 @@ declare const __VLS_self: import("vue").DefineComponent<MagicMenuTriggerProps, {
183
29
  onMouseenter: typeof onMouseenter;
184
30
  onClick: typeof onClick;
185
31
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
186
- declare const __VLS_component: import("vue").DefineComponent<MagicMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, any>;
32
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
187
33
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
188
34
  export default _default;
189
35
  type __VLS_WithSlots<T, S> = T & {
@@ -6,17 +6,17 @@ interface MagicMenuViewProps {
6
6
  declare const mappedId: import("vue").ComputedRef<string>;
7
7
  declare const view: import("../types").MenuView;
8
8
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
9
- declare var __VLS_0: {
9
+ declare var __VLS_1: {
10
10
  viewActive: boolean;
11
11
  };
12
12
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
13
- default?: (props: typeof __VLS_0) => any;
13
+ default?: (props: typeof __VLS_1) => any;
14
14
  }>;
15
15
  declare const __VLS_self: import("vue").DefineComponent<MagicMenuViewProps, {
16
16
  mappedId: typeof mappedId;
17
17
  view: typeof view;
18
18
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
- declare const __VLS_component: import("vue").DefineComponent<MagicMenuViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
19
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
21
21
  export default _default;
22
22
  type __VLS_WithSlots<T, S> = T & {
@@ -24,10 +24,10 @@ export function useMenuCallback(args) {
24
24
  emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
25
25
  const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
26
26
  if (scrollLock) {
27
- lockScroll();
28
27
  if (typeof scrollLock === "object" && scrollLock.padding) {
29
28
  addScrollLockPadding();
30
29
  }
30
+ lockScroll();
31
31
  }
32
32
  }
33
33
  function onBeforeLeave() {
@@ -7,9 +7,9 @@ export declare function useMenuCursor(view: MenuView, debug?: boolean): {
7
7
  x: number;
8
8
  y: number;
9
9
  }[]>;
10
- isInsideFrom: import("vue").Ref<boolean, boolean>;
11
- isInsideTo: import("vue").Ref<boolean, boolean>;
12
- isInsideTriangle: import("vue").Ref<boolean, boolean>;
10
+ isInsideFrom: import("vue").ShallowRef<boolean, boolean>;
11
+ isInsideTo: import("vue").ShallowRef<boolean, boolean>;
12
+ isInsideTriangle: import("vue").ShallowRef<boolean, boolean>;
13
13
  initialize: () => void;
14
14
  destroy: () => void;
15
15
  };
@@ -1,4 +1,4 @@
1
- import { ref } from "vue";
1
+ import { ref, shallowRef } from "vue";
2
2
  import { useEventListener } from "@vueuse/core";
3
3
  export function useMenuCursor(view, debug = false) {
4
4
  let cancelListener = new AbortController();
@@ -7,9 +7,9 @@ export function useMenuCursor(view, debug = false) {
7
7
  { x: 0, y: 0 },
8
8
  { x: 0, y: 0 }
9
9
  ]);
10
- const isInsideFrom = ref(false);
11
- const isInsideTo = ref(false);
12
- const isInsideTriangle = ref(false);
10
+ const isInsideFrom = shallowRef(false);
11
+ const isInsideTo = shallowRef(false);
12
+ const isInsideTriangle = shallowRef(false);
13
13
  function extendTriangle(vertices, pixelAmount) {
14
14
  const [a, b, c] = vertices;
15
15
  switch (view?.placement) {
@@ -1,7 +1,11 @@
1
- import { ref } from "vue";
1
+ import { ref, shallowRef } from "vue";
2
2
  import { useScrollLock } from "@vueuse/core";
3
- import { matchClass } from "@maas/vue-equipment/utils";
4
- const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : ref(false);
3
+ import {
4
+ matchClass,
5
+ scrollbarGutterSupport,
6
+ scrollbarWidth
7
+ } from "@maas/vue-equipment/utils";
8
+ const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
5
9
  export function useMenuDOM() {
6
10
  const positionFixedElements = ref([]);
7
11
  function lockScroll() {
@@ -12,25 +16,41 @@ export function useMenuDOM() {
12
16
  }
13
17
  function addScrollLockPadding() {
14
18
  if (typeof window === "undefined") return;
15
- const exclude = new RegExp(/magic-menu?/);
16
- const scrollbarWidth = window.innerWidth - document.body.offsetWidth;
17
- document.body.style.setProperty("--scrollbar-width", `${scrollbarWidth}px`);
18
- document.body.style.paddingRight = "var(--scrollbar-width)";
19
+ const exclude = new RegExp(/magic-menu/);
20
+ document.body.style.setProperty(
21
+ "--scrollbar-width",
22
+ `${scrollbarWidth()}px`
23
+ );
19
24
  positionFixedElements.value = [
20
25
  ...document.body.getElementsByTagName("*")
21
26
  ].filter(
22
- (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
23
- );
24
- positionFixedElements.value.forEach(
25
- (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
27
+ (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
26
28
  );
29
+ switch (scrollbarGutterSupport()) {
30
+ case true:
31
+ document.documentElement.style.scrollbarGutter = "stable";
32
+ positionFixedElements.value.forEach((elem) => {
33
+ elem.style.scrollbarGutter = "stable";
34
+ elem.style.overflow = "auto";
35
+ });
36
+ break;
37
+ case false:
38
+ document.body.style.paddingRight = "var(--scrollbar-width)";
39
+ positionFixedElements.value.forEach(
40
+ (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
41
+ );
42
+ break;
43
+ }
27
44
  }
28
45
  function removeScrollLockPadding() {
29
- document.body.style.paddingRight = "";
46
+ document.documentElement.style.scrollbarGutter = "";
30
47
  document.body.style.removeProperty("--scrollbar-width");
31
- positionFixedElements.value.forEach(
32
- (elem) => elem.style.paddingRight = ""
33
- );
48
+ document.body.style.paddingRight = "";
49
+ positionFixedElements.value.forEach((elem) => {
50
+ elem.style.paddingRight = "";
51
+ elem.style.scrollbarGutter = "";
52
+ elem.style.overflow = "";
53
+ });
34
54
  }
35
55
  return {
36
56
  lockScroll,
@@ -7,7 +7,7 @@ type UseMenuTriggerArgs = {
7
7
  itemId?: string;
8
8
  mappedDisabled: ComputedRef<boolean>;
9
9
  mappedTrigger: ComputedRef<Interaction[]>;
10
- elRef: Ref<InstanceType<typeof Primitive> | undefined>;
10
+ elRef: Ref<InstanceType<typeof Primitive> | null>;
11
11
  };
12
12
  export declare function useMenuTrigger(args: UseMenuTriggerArgs): {
13
13
  onMouseenter: () => void;
@@ -1,11 +1,11 @@
1
- import type { InjectionKey, MaybeRef } from 'vue';
1
+ import type { InjectionKey, MaybeRef, Ref } from 'vue';
2
2
  declare const MagicMenuInstanceId: InjectionKey<MaybeRef<string>>;
3
3
  declare const MagicMenuParentTree: InjectionKey<string[]>;
4
4
  declare const MagicMenuViewId: InjectionKey<string>;
5
- declare const MagicMenuViewActive: InjectionKey<MaybeRef<boolean>>;
5
+ declare const MagicMenuViewActive: InjectionKey<Ref<boolean>>;
6
6
  declare const MagicMenuContentId: InjectionKey<string>;
7
7
  declare const MagicMenuItemId: InjectionKey<string>;
8
- declare const MagicMenuItemActive: InjectionKey<MaybeRef<boolean>>;
8
+ declare const MagicMenuItemActive: InjectionKey<Ref<boolean>>;
9
9
  declare const MagicMenuChannelId: InjectionKey<string>;
10
- declare const MagicMenuChannelActive: InjectionKey<MaybeRef<boolean>>;
10
+ declare const MagicMenuChannelActive: InjectionKey<Ref<boolean>>;
11
11
  export { MagicMenuInstanceId, MagicMenuParentTree, MagicMenuViewId, MagicMenuViewActive, MagicMenuContentId, MagicMenuItemId, MagicMenuItemActive, MagicMenuChannelId, MagicMenuChannelActive, };
@@ -3,7 +3,8 @@ import { defineComponent as _defineComponent } from "vue";
3
3
  import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, createVNode as _createVNode, mergeProps as _mergeProps, Teleport as _Teleport } from "vue";
4
4
  const _hoisted_1 = ["data-id"];
5
5
  import {
6
- ref,
6
+ useTemplateRef,
7
+ shallowRef,
7
8
  watch,
8
9
  nextTick,
9
10
  toValue,
@@ -36,7 +37,7 @@ export default /* @__PURE__ */ _defineComponent({
36
37
  }
37
38
  });
38
39
  const mappedOptions = customDefu(__props.options, defaultOptions);
39
- const modalRef = ref(void 0);
40
+ const modalRef = useTemplateRef("modal");
40
41
  const {
41
42
  trapFocus,
42
43
  releaseFocus,
@@ -49,8 +50,8 @@ export default /* @__PURE__ */ _defineComponent({
49
50
  focusTrap: mappedOptions.focusTrap
50
51
  });
51
52
  const { isActive, close } = useMagicModal(__props.id);
52
- const innerActive = ref(false);
53
- const wrapperActive = ref(false);
53
+ const innerActive = shallowRef(false);
54
+ const wrapperActive = shallowRef(false);
54
55
  const {
55
56
  onBeforeEnter,
56
57
  onEnter,
@@ -113,8 +114,7 @@ export default /* @__PURE__ */ _defineComponent({
113
114
  disabled: _unref(mappedOptions).teleport?.disabled
114
115
  }, [
115
116
  _createElementVNode("div", _mergeProps({
116
- ref_key: "modalRef",
117
- ref: modalRef,
117
+ ref: "modal",
118
118
  class: "magic-modal",
119
119
  "data-id": toValue(_ctx.id)
120
120
  }, _ctx.$attrs, {