@maas/vue-equipment 1.0.0-beta.23 → 1.0.0-beta.25

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 (77) hide show
  1. package/dist/nuxt/module.json +1 -1
  2. package/dist/nuxt/module.mjs +24 -24
  3. package/dist/plugins/.turbo/turbo-lint.log +2 -2
  4. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +2 -29
  5. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +2 -7
  6. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +2 -16
  7. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +2 -11
  8. package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
  9. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +2 -20
  10. package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +2 -7
  11. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +2 -19
  12. package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +2 -7
  13. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +2 -7
  14. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +2 -18
  15. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +2 -9
  16. package/dist/plugins/MagicCommand/src/types/index.d.ts +2 -2
  17. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +2 -7
  18. package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +2 -4
  19. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +2 -16
  20. package/dist/plugins/MagicCookie/src/types/index.d.ts +2 -2
  21. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +2 -92
  22. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +12 -15
  23. package/dist/plugins/MagicDraggable/src/types/index.d.ts +2 -2
  24. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +2 -161
  25. package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
  26. package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +112 -10
  27. package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
  28. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +2 -7
  29. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +2 -13
  30. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +2 -34
  31. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +2 -33
  32. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +2 -21
  33. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +2 -7
  34. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +2 -12
  35. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +2 -18
  36. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +2 -9
  37. package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
  38. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +2 -40
  39. package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
  40. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +51 -18
  41. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +12 -2
  42. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +2 -22
  43. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +48 -10
  44. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +6 -23
  45. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +6 -3
  46. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +2 -8
  47. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +37 -5
  48. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +2 -18
  49. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +2 -2
  50. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +47 -20
  51. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +11 -10
  52. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +2 -42
  53. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +5 -7
  54. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +5 -1
  55. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
  56. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
  57. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +22 -11
  58. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +4 -4
  59. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +13 -9
  60. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +1 -0
  61. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +39 -32
  62. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +4 -1
  63. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +6 -3
  64. package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +2 -1
  65. package/dist/plugins/MagicPlayer/src/symbols/index.mjs +2 -0
  66. package/dist/plugins/MagicPlayer/src/types/index.d.ts +45 -19
  67. package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
  68. package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
  69. package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
  70. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +2 -4
  71. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +2 -4
  72. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +2 -24
  73. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +2 -7
  74. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +2 -19
  75. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +1 -1
  76. package/dist/plugins/MagicToast/src/types/index.d.ts +2 -2
  77. package/package.json +5 -3
@@ -8,44 +8,12 @@ interface MagicMenuContentProps {
8
8
  transition?: string;
9
9
  referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>;
10
10
  }
11
- declare const viewId: string | undefined;
12
- declare const view: import("../types/index.js").MenuView | undefined;
13
- declare const state: import("../types/index.js").MenuState;
14
- declare const pointerDisabled: import("vue").ComputedRef<boolean>;
15
- declare const mappedTransition: import("vue").ComputedRef<string>;
16
- declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
17
- declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
18
- declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => void, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
19
- declare const coords: import("vue").Ref<{
20
- x: number;
21
- y: number;
22
- }[], import("../types/index.js").Coordinates[] | {
23
- x: number;
24
- y: number;
25
- }[]>;
26
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
27
11
  declare var __VLS_13: {}, __VLS_15: {};
28
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
12
+ type __VLS_Slots = {} & {
29
13
  arrow?: (props: typeof __VLS_13) => any;
30
14
  } & {
31
15
  default?: (props: typeof __VLS_15) => any;
32
- }>;
33
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuContentProps, {
34
- viewId: typeof viewId;
35
- view: typeof view;
36
- state: typeof state;
37
- pointerDisabled: typeof pointerDisabled;
38
- mappedTransition: typeof mappedTransition;
39
- innerActive: typeof innerActive;
40
- wrapperActive: typeof wrapperActive;
41
- onBeforeEnter: typeof onBeforeEnter;
42
- onEnter: typeof onEnter;
43
- onAfterEnter: typeof onAfterEnter;
44
- onBeforeLeave: typeof onBeforeLeave;
45
- onLeave: typeof onLeave;
46
- onAfterLeave: typeof onAfterLeave;
47
- coords: typeof coords;
48
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ };
49
17
  declare const __VLS_component: import("vue").DefineComponent<MagicMenuContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
18
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
51
19
  export default _default;
@@ -6,43 +6,12 @@ interface MagicMenuFloatProps {
6
6
  arrow?: boolean;
7
7
  referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>;
8
8
  }
9
- declare const arrow: boolean;
10
- declare const hasArrow: import("vue").ComputedRef<boolean>;
11
- declare const floatingStyles: Readonly<import("vue").Ref<{
12
- position: import("@floating-ui/vue").Strategy;
13
- top: string;
14
- left: string;
15
- transform?: string;
16
- willChange?: string;
17
- }, {
18
- position: import("@floating-ui/vue").Strategy;
19
- top: string;
20
- left: string;
21
- transform?: string;
22
- willChange?: string;
23
- }>>;
24
- declare const arrowStyles: import("vue").ComputedRef<{
25
- transform?: undefined;
26
- } | {
27
- transform: string;
28
- }>;
29
- declare const placementClasses: import("vue").ComputedRef<string>;
30
- declare const polygonPoints: import("vue").ComputedRef<"50,50 100,100 0,100" | "50,50 100,0 0,0" | "50,50 100,100 100,0" | "50,50 0,100 0,0" | undefined>;
31
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
32
9
  declare var __VLS_1: {}, __VLS_3: {};
33
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
10
+ type __VLS_Slots = {} & {
34
11
  arrow?: (props: typeof __VLS_1) => any;
35
12
  } & {
36
13
  default?: (props: typeof __VLS_3) => any;
37
- }>;
38
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuFloatProps, {
39
- arrow: typeof arrow;
40
- hasArrow: typeof hasArrow;
41
- floatingStyles: typeof floatingStyles;
42
- arrowStyles: typeof arrowStyles;
43
- placementClasses: typeof placementClasses;
44
- polygonPoints: typeof polygonPoints;
45
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuFloatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ };
46
15
  declare const __VLS_component: import("vue").DefineComponent<MagicMenuFloatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuFloatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
16
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
48
17
  export default _default;
@@ -2,32 +2,13 @@ interface MagicMenuItemProps {
2
2
  id?: string;
3
3
  disabled?: boolean;
4
4
  }
5
- declare const mappedId: import("vue").ComputedRef<string>;
6
- declare const item: import("../types/index.js").MenuItem;
7
- declare const pointerDisabled: import("vue").ComputedRef<boolean>;
8
- declare function guardedSelect(): void;
9
- declare function guardedUnselect(): void;
10
- declare function onClick(event: MouseEvent): void;
11
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
12
5
  declare var __VLS_1: {
13
6
  itemActive: boolean;
14
7
  itemDisabled: boolean;
15
8
  };
16
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
9
+ type __VLS_Slots = {} & {
17
10
  default?: (props: typeof __VLS_1) => any;
18
- }>;
19
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuItemProps, {
20
- mappedId: typeof mappedId;
21
- item: typeof item;
22
- pointerDisabled: typeof pointerDisabled;
23
- guardedSelect: typeof guardedSelect;
24
- guardedUnselect: typeof guardedUnselect;
25
- onClick: typeof onClick;
26
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
27
- click: (event: MouseEvent) => any;
28
- }, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
29
- onClick?: ((event: MouseEvent) => any) | undefined;
30
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ };
31
12
  declare const __VLS_component: import("vue").DefineComponent<MagicMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
32
13
  click: (event: MouseEvent) => any;
33
14
  }, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
@@ -1,19 +1,14 @@
1
1
  import { type MaybeRef } from 'vue';
2
- import { Primitive } from '@maas/vue-primitive';
3
2
  import type { MagicMenuOptions } from '../types/index.js';
4
3
  interface MagicMenuProviderProps {
5
4
  id: MaybeRef<string>;
6
5
  asChild?: boolean;
7
6
  options?: MagicMenuOptions;
8
7
  }
9
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
10
8
  declare var __VLS_7: {};
11
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
9
+ type __VLS_Slots = {} & {
12
10
  default?: (props: typeof __VLS_7) => any;
13
- }>;
14
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuProviderProps, {
15
- Primitive: typeof Primitive;
16
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ };
17
12
  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>;
18
13
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
19
14
  export default _default;
@@ -1,4 +1,3 @@
1
- import { Primitive } from '@maas/vue-primitive';
2
1
  import type { Interaction } from '../types/index.js';
3
2
  interface MagicMenuRemoteProps {
4
3
  channelId: string;
@@ -8,22 +7,13 @@ interface MagicMenuRemoteProps {
8
7
  trigger?: Interaction[];
9
8
  asChild?: boolean;
10
9
  }
11
- declare const onClick: () => void, onMouseenter: () => void;
12
- declare let channel: import("../types/index.js").MenuChannel;
13
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
14
10
  declare var __VLS_11: {
15
11
  channelActive: boolean;
16
12
  remoteDisabled: boolean;
17
13
  };
18
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
14
+ type __VLS_Slots = {} & {
19
15
  default?: (props: typeof __VLS_11) => any;
20
- }>;
21
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuRemoteProps, {
22
- Primitive: typeof Primitive;
23
- onClick: typeof onClick;
24
- onMouseenter: typeof onMouseenter;
25
- channel: typeof channel;
26
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuRemoteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ };
27
17
  declare const __VLS_component: import("vue").DefineComponent<MagicMenuRemoteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuRemoteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
18
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
29
19
  export default _default;
@@ -1,4 +1,3 @@
1
- import { Primitive } from '@maas/vue-primitive';
2
1
  import type { Interaction } from '../types/index.js';
3
2
  interface MagicMenuTriggerProps {
4
3
  instanceId?: string;
@@ -7,28 +6,13 @@ interface MagicMenuTriggerProps {
7
6
  trigger?: Interaction[];
8
7
  asChild?: boolean;
9
8
  }
10
- declare const mappedViewId: import("vue").ComputedRef<string | undefined>;
11
- declare const view: import("../types/index.js").MenuView | undefined;
12
- declare const mappedDisabled: import("vue").ComputedRef<boolean>;
13
- declare const mappedTabindex: import("vue").ComputedRef<0 | undefined>;
14
- declare const onMouseenter: () => void, onClick: (e: MouseEvent) => void;
15
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
16
9
  declare var __VLS_13: {
17
10
  viewActive: boolean | undefined;
18
11
  triggerDisabled: boolean;
19
12
  };
20
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
13
+ type __VLS_Slots = {} & {
21
14
  default?: (props: typeof __VLS_13) => any;
22
- }>;
23
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuTriggerProps, {
24
- Primitive: typeof Primitive;
25
- mappedViewId: typeof mappedViewId;
26
- view: typeof view;
27
- mappedDisabled: typeof mappedDisabled;
28
- mappedTabindex: typeof mappedTabindex;
29
- onMouseenter: typeof onMouseenter;
30
- onClick: typeof onClick;
31
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ };
32
16
  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>;
33
17
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
34
18
  export default _default;
@@ -3,19 +3,12 @@ interface MagicMenuViewProps {
3
3
  id?: string;
4
4
  placement?: Placement;
5
5
  }
6
- declare const mappedId: import("vue").ComputedRef<string>;
7
- declare const view: import("../types/index.js").MenuView;
8
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
9
6
  declare var __VLS_1: {
10
7
  viewActive: boolean;
11
8
  };
12
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
9
+ type __VLS_Slots = {} & {
13
10
  default?: (props: typeof __VLS_1) => any;
14
- }>;
15
- declare const __VLS_self: import("vue").DefineComponent<MagicMenuViewProps, {
16
- mappedId: typeof mappedId;
17
- view: typeof view;
18
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ };
19
12
  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
13
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
21
14
  export default _default;
@@ -77,7 +77,7 @@ export interface MenuState {
77
77
  view: string | undefined;
78
78
  };
79
79
  }
80
- export type MenuEvents = {
80
+ export interface MenuEvents {
81
81
  beforeEnter: {
82
82
  id: string;
83
83
  viewId: string;
@@ -102,5 +102,5 @@ export type MenuEvents = {
102
102
  id: string;
103
103
  viewId: string;
104
104
  };
105
- };
105
+ }
106
106
  export {};
@@ -7,50 +7,12 @@ interface MagicModalProps {
7
7
  props?: Record<string, unknown>;
8
8
  options?: MagicModalOptions;
9
9
  }
10
- declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> & Omit<import("../../../../utils/index.js").RequireAll<MagicModalOptions>, keyof MagicModalOptions> & {
11
- transition: {
12
- content?: string;
13
- backdrop?: string;
14
- };
15
- backdrop: boolean;
16
- tag: "div" | "dialog";
17
- focusTrap: boolean | import("focus-trap").Options;
18
- scrollLock: boolean | {
19
- padding: boolean;
20
- };
21
- teleport: {
22
- target?: string;
23
- disabled?: boolean;
24
- };
25
- keyListener: {
26
- close?: string[] | false;
27
- };
28
- };
29
- declare const mappedId: string;
30
- declare const close: () => void;
31
- declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
32
- declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
33
- declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
34
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
35
10
  declare var __VLS_9: {}, __VLS_32: {};
36
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
11
+ type __VLS_Slots = {} & {
37
12
  backdrop?: (props: typeof __VLS_9) => any;
38
13
  } & {
39
14
  default?: (props: typeof __VLS_32) => any;
40
- }>;
41
- declare const __VLS_self: import("vue").DefineComponent<MagicModalProps, {
42
- mappedOptions: typeof mappedOptions;
43
- mappedId: typeof mappedId;
44
- close: typeof close;
45
- innerActive: typeof innerActive;
46
- wrapperActive: typeof wrapperActive;
47
- onBeforeEnter: typeof onBeforeEnter;
48
- onEnter: typeof onEnter;
49
- onAfterEnter: typeof onAfterEnter;
50
- onBeforeLeave: typeof onBeforeLeave;
51
- onLeave: typeof onLeave;
52
- onAfterLeave: typeof onAfterLeave;
53
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ };
54
16
  declare const __VLS_component: import("vue").DefineComponent<MagicModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
55
17
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
56
18
  export default _default;
@@ -18,11 +18,11 @@ export interface MagicModalOptions {
18
18
  close?: string[] | false;
19
19
  };
20
20
  }
21
- export type ModalEvents = {
21
+ export interface ModalEvents {
22
22
  beforeEnter: string;
23
23
  enter: string;
24
24
  afterEnter: string;
25
25
  beforeLeave: string;
26
26
  leave: string;
27
27
  afterLeave: string;
28
- };
28
+ }
@@ -6,19 +6,31 @@
6
6
  import {
7
7
  toRefs,
8
8
  useTemplateRef,
9
- shallowRef,
10
9
  inject,
10
+ watch,
11
11
  onMounted,
12
- onBeforeUnmount
12
+ onBeforeUnmount,
13
+ shallowRef,
14
+ computed
13
15
  } from "vue";
14
- import { useIntersectionObserver } from "@vueuse/core";
16
+ import {
17
+ useElementVisibility,
18
+ useEventListener,
19
+ defaultWindow
20
+ } from "@vueuse/core";
15
21
  import { usePlayerAudioApi } from "../composables/private/usePlayerAudioApi";
16
22
  import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
17
23
  import { usePlayerRuntime } from "../composables/private/usePlayerRuntime";
18
24
  import { usePlayerState } from "../composables/private/usePlayerState";
19
- import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
25
+ import { audioModePlaybackDefaults } from "../utils/playbackDefaults";
26
+ import {
27
+ MagicPlayerInstanceId,
28
+ MagicPlayerOptionsKey,
29
+ MagicPlayerRef
30
+ } from "../symbols";
20
31
  const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
21
32
  const injectedOptions = inject(MagicPlayerOptionsKey, void 0);
33
+ const injectedPlayerRef = inject(MagicPlayerRef, void 0);
22
34
  if (!injectedInstanceId) {
23
35
  throw new Error("MagicPlayerVideo must be used within a MagicPlayerProvider");
24
36
  }
@@ -26,7 +38,6 @@ if (!injectedOptions) {
26
38
  throw new Error("MagicPlayerVideo must be used within a MagicPlayerProvider");
27
39
  }
28
40
  const elRef = useTemplateRef("el");
29
- const pausedByIntersection = shallowRef(false);
30
41
  const { initialize, destroy } = usePlayerRuntime({
31
42
  id: injectedInstanceId,
32
43
  mediaRef: elRef,
@@ -42,22 +53,44 @@ const { play, pause } = usePlayerAudioApi({
42
53
  });
43
54
  const { initializeState } = usePlayerState(injectedInstanceId);
44
55
  const state = initializeState();
45
- const { playing } = toRefs(state);
46
- useIntersectionObserver(
47
- elRef,
48
- ([{ isIntersecting }]) => {
49
- if (!isIntersecting && playing.value) {
56
+ const { playing, started } = toRefs(state);
57
+ const wasPlaying = shallowRef(false);
58
+ const isVisible = useElementVisibility(injectedPlayerRef);
59
+ const manageWindow = computed(() => {
60
+ const playbackOptions = injectedOptions.playback || audioModePlaybackDefaults;
61
+ return playbackOptions !== false && playbackOptions?.includes("window");
62
+ });
63
+ const manageViewport = computed(() => {
64
+ const playbackOptions = injectedOptions.playback || audioModePlaybackDefaults;
65
+ return playbackOptions !== false && playbackOptions?.includes("viewport");
66
+ });
67
+ function onWindowFocus() {
68
+ if (isVisible.value && wasPlaying.value) {
69
+ play();
70
+ }
71
+ }
72
+ function onWindowBlur() {
73
+ wasPlaying.value = playing.value;
74
+ pause();
75
+ }
76
+ if (manageWindow.value) {
77
+ useEventListener(defaultWindow, "focus", onWindowFocus);
78
+ useEventListener(defaultWindow, "blur", onWindowBlur);
79
+ }
80
+ if (manageViewport.value) {
81
+ watch(isVisible, (value) => {
82
+ if (!value) {
83
+ wasPlaying.value = playing.value;
50
84
  pause();
51
- pausedByIntersection.value = true;
52
- } else if (isIntersecting && !playing.value && pausedByIntersection.value) {
53
- pausedByIntersection.value = false;
85
+ }
86
+ if (value && wasPlaying.value) {
54
87
  play();
55
88
  }
56
- },
57
- {
58
- immediate: true
59
- }
60
- );
89
+ if (value && injectedOptions.autoplay && !started.value) {
90
+ play();
91
+ }
92
+ });
93
+ }
61
94
  onMounted(() => {
62
95
  initialize();
63
96
  });
@@ -2,9 +2,11 @@
2
2
  <div
3
3
  class="magic-player-audio-controls"
4
4
  :data-touched="touched"
5
+ :data-started="started"
5
6
  :data-playing="playing"
6
- :data-paused="!playing"
7
+ :data-paused="paused"
7
8
  :data-waiting="waiting"
9
+ :data-muted="muted"
8
10
  :data-idle="idle"
9
11
  :data-hover="controlsMouseEntered"
10
12
  @mouseenter="onMouseenter"
@@ -94,7 +96,15 @@ const { initialize, destroy, onMouseenter, onMouseleave } = usePlayerControlsApi
94
96
  });
95
97
  const { initializeState } = usePlayerState(mappedInstanceId.value);
96
98
  const state = initializeState();
97
- const { playing, waiting, touched, controlsMouseEntered } = toRefs(state);
99
+ const {
100
+ playing,
101
+ paused,
102
+ started,
103
+ muted,
104
+ waiting,
105
+ touched,
106
+ controlsMouseEntered
107
+ } = toRefs(state);
98
108
  const { idle } = useIdle(3e3);
99
109
  initialize();
100
110
  onBeforeUnmount(() => {
@@ -1,32 +1,12 @@
1
- import IconPlay from './icons/Play.vue.js';
2
- import IconPause from './icons/Pause.vue.js';
3
1
  interface MagicAudioPlayerControlsProps {
4
2
  instanceId?: string;
5
3
  }
6
- declare const play: () => void, pause: () => void;
7
- declare const onMouseenter: () => void, onMouseleave: () => void;
8
- declare const playing: import("vue").Ref<boolean, boolean>, waiting: import("vue").Ref<boolean, boolean>, touched: import("vue").Ref<boolean, boolean>, controlsMouseEntered: import("vue").Ref<boolean, boolean>;
9
- declare const idle: import("vue").ShallowRef<boolean>;
10
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
11
4
  declare var __VLS_1: {}, __VLS_6: {};
12
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
5
+ type __VLS_Slots = {} & {
13
6
  playIcon?: (props: typeof __VLS_1) => any;
14
7
  } & {
15
8
  pauseIcon?: (props: typeof __VLS_6) => any;
16
- }>;
17
- declare const __VLS_self: import("vue").DefineComponent<MagicAudioPlayerControlsProps, {
18
- IconPlay: typeof IconPlay;
19
- IconPause: typeof IconPause;
20
- play: typeof play;
21
- pause: typeof pause;
22
- onMouseenter: typeof onMouseenter;
23
- onMouseleave: typeof onMouseleave;
24
- playing: typeof playing;
25
- waiting: typeof waiting;
26
- touched: typeof touched;
27
- controlsMouseEntered: typeof controlsMouseEntered;
28
- idle: typeof idle;
29
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAudioPlayerControlsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ };
30
10
  declare const __VLS_component: import("vue").DefineComponent<MagicAudioPlayerControlsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAudioPlayerControlsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
11
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
32
12
  export default _default;
@@ -2,38 +2,49 @@
2
2
  <div
3
3
  class="magic-player-overlay"
4
4
  :data-playing="playing"
5
- :data-paused="!playing"
5
+ :data-touched="touched"
6
+ :data-paused="paused"
7
+ :data-started="started"
6
8
  :data-waiting="waiting"
9
+ :data-loaded="loaded"
10
+ :data-muted="muted"
7
11
  :data-idle="idle"
8
12
  :data-hover="mouseEntered"
9
13
  @click.stop="togglePlay"
10
14
  >
11
15
  <slot>
12
- <template v-if="waiting">
13
- <button class="magic-player-overlay__button">
16
+ <transition name="fade" mode="out-in">
17
+ <button
18
+ v-if="defferedWaiting && started"
19
+ class="magic-player-overlay__button"
20
+ >
14
21
  <slot name="waitingIcon">
15
22
  <icon-waiting />
16
23
  </slot>
17
24
  </button>
18
- </template>
19
- <template v-else>
20
- <button v-if="!playing" class="magic-player-overlay__button">
25
+ <button
26
+ v-else-if="paused || !started"
27
+ class="magic-player-overlay__button"
28
+ >
21
29
  <slot name="playIcon">
22
30
  <icon-play />
23
31
  </slot>
24
32
  </button>
25
- <button v-else class="magic-player-overlay__button">
33
+ <button
34
+ v-else-if="started && !paused"
35
+ class="magic-player-overlay__button"
36
+ >
26
37
  <slot name="pauseIcon">
27
38
  <icon-pause />
28
39
  </slot>
29
40
  </button>
30
- </template>
41
+ </transition>
31
42
  </slot>
32
43
  </div>
33
44
  </template>
34
45
 
35
46
  <script setup>
36
- import { inject, toRefs } from "vue";
47
+ import { watch, ref, inject, toRefs } from "vue";
37
48
  import { useIdle } from "@vueuse/core";
38
49
  import IconPlay from "./icons/Play.vue";
39
50
  import IconPause from "./icons/Pause.vue";
@@ -49,11 +60,38 @@ if (!instanceId) {
49
60
  }
50
61
  const { initializeState } = usePlayerState(instanceId);
51
62
  const state = initializeState();
52
- const { mouseEntered, playing, waiting } = toRefs(state);
63
+ const {
64
+ mouseEntered,
65
+ playing,
66
+ paused,
67
+ started,
68
+ touched,
69
+ muted,
70
+ loaded,
71
+ waiting,
72
+ hasOverlay
73
+ } = toRefs(state);
74
+ hasOverlay.value = true;
53
75
  const { togglePlay } = usePlayerVideoApi({
54
76
  id: instanceId
55
77
  });
56
78
  const { idle } = useIdle(3e3);
79
+ const defferedWaiting = ref(false);
80
+ watch(
81
+ () => waiting.value,
82
+ (value) => {
83
+ switch (value) {
84
+ case true:
85
+ defferedWaiting.value = true;
86
+ break;
87
+ case false:
88
+ setTimeout(() => {
89
+ defferedWaiting.value = false;
90
+ }, 500);
91
+ break;
92
+ }
93
+ }
94
+ );
57
95
  </script>
58
96
 
59
97
  <style>
@@ -1,30 +1,13 @@
1
- import IconPlay from './icons/Play.vue.js';
2
- import IconPause from './icons/Pause.vue.js';
3
- import IconWaiting from './icons/Waiting.vue.js';
4
- declare const mouseEntered: import("vue").Ref<boolean, boolean>, playing: import("vue").Ref<boolean, boolean>, waiting: import("vue").Ref<boolean, boolean>;
5
- declare const togglePlay: () => void;
6
- declare const idle: import("vue").ShallowRef<boolean>;
7
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
8
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_8: {}, __VLS_13: {};
9
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
1
+ declare var __VLS_1: {}, __VLS_7: {}, __VLS_12: {}, __VLS_17: {};
2
+ type __VLS_Slots = {} & {
10
3
  default?: (props: typeof __VLS_1) => any;
11
4
  } & {
12
- waitingIcon?: (props: typeof __VLS_3) => any;
5
+ waitingIcon?: (props: typeof __VLS_7) => any;
13
6
  } & {
14
- playIcon?: (props: typeof __VLS_8) => any;
7
+ playIcon?: (props: typeof __VLS_12) => any;
15
8
  } & {
16
- pauseIcon?: (props: typeof __VLS_13) => any;
17
- }>;
18
- declare const __VLS_self: import("vue").DefineComponent<{}, {
19
- IconPlay: typeof IconPlay;
20
- IconPause: typeof IconPause;
21
- IconWaiting: typeof IconWaiting;
22
- mouseEntered: typeof mouseEntered;
23
- playing: typeof playing;
24
- waiting: typeof waiting;
25
- togglePlay: typeof togglePlay;
26
- idle: typeof idle;
27
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9
+ pauseIcon?: (props: typeof __VLS_17) => any;
10
+ };
28
11
  declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
29
12
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
30
13
  export default _default;
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <div v-show="!loaded || !touched" class="magic-player-poster">
2
+ <div v-show="isVisible" class="magic-player-poster">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
- import { inject, toRefs } from "vue";
8
+ import { inject, toRefs, computed } from "vue";
9
9
  import { usePlayerState } from "../composables/private/usePlayerState";
10
10
  import { MagicPlayerInstanceId } from "../symbols";
11
11
  const instanceId = inject(MagicPlayerInstanceId, void 0);
@@ -16,7 +16,10 @@ if (!instanceId) {
16
16
  }
17
17
  const { initializeState } = usePlayerState(instanceId);
18
18
  const state = initializeState();
19
- const { loaded, touched } = toRefs(state);
19
+ const { loaded, started } = toRefs(state);
20
+ const isVisible = computed(() => {
21
+ return !loaded.value || !started.value;
22
+ });
20
23
  </script>
21
24
 
22
25
  <style>