@maas/vue-equipment 0.36.2 → 0.36.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 (31) hide show
  1. package/dist/nuxt/module.json +1 -1
  2. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +1 -1
  3. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +37 -2
  4. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +1 -1
  5. package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +2 -2
  6. package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +1 -1
  7. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +2 -2
  8. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +1 -1
  9. package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +2 -2
  10. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +3 -3
  11. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +3 -3
  12. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +2 -2
  13. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +1 -1
  14. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +2 -2
  15. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +3 -3
  16. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +1 -1
  17. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +2 -2
  18. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +38 -3
  19. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +1 -1
  20. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +2 -2
  21. package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +2 -2
  22. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +24 -8
  23. package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +2 -2
  24. package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +3 -3
  25. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +2 -4
  26. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +1 -1
  27. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +1 -1
  28. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +18 -1
  29. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +3 -3
  30. package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +1 -1
  31. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.36.1",
4
+ "version": "0.36.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "unknown"
@@ -6,7 +6,7 @@ interface MagicAccordionContentProps {
6
6
  declare function __VLS_template(): {
7
7
  slots: {
8
8
  default?(_: {
9
- isActive: any;
9
+ isActive: boolean | undefined;
10
10
  }): any;
11
11
  };
12
12
  refs: {};
@@ -8,11 +8,46 @@ interface MagicAccordionTriggerProps {
8
8
  declare function __VLS_template(): {
9
9
  slots: {
10
10
  default?(_: {
11
- isActive: any;
11
+ isActive: boolean | undefined;
12
12
  }): any;
13
13
  };
14
14
  refs: {
15
- elRef: any;
15
+ elRef: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
16
+ asChild: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ as: {
21
+ type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
22
+ default: string;
23
+ };
24
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
+ [key: string]: any;
26
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
27
+ asChild: boolean;
28
+ as: import("@maas/vue-primitive").ElementOrComponent;
29
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
30
+ P: {};
31
+ B: {};
32
+ D: {};
33
+ C: {};
34
+ M: {};
35
+ Defaults: {};
36
+ }, Readonly<import("vue").ExtractPropTypes<{
37
+ asChild: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ as: {
42
+ type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
43
+ default: string;
44
+ };
45
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
+ [key: string]: any;
47
+ }>, {}, {}, {}, {
48
+ asChild: boolean;
49
+ as: import("@maas/vue-primitive").ElementOrComponent;
50
+ }> | null;
16
51
  };
17
52
  attrs: Partial<{}>;
18
53
  };
@@ -6,7 +6,7 @@ interface MagicAccordionViewProps {
6
6
  declare function __VLS_template(): {
7
7
  slots: {
8
8
  default?(_: {
9
- isActive: any;
9
+ isActive: boolean;
10
10
  }): any;
11
11
  };
12
12
  refs: {};
@@ -9,15 +9,15 @@ declare function __VLS_template(): {
9
9
  default?(_: {}): any;
10
10
  };
11
11
  refs: {
12
- elRef: any;
12
+ elRef: HTMLDivElement;
13
13
  };
14
14
  attrs: Partial<{}>;
15
15
  };
16
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
17
  declare const __VLS_component: import("vue").DefineComponent<MagicAutoSizeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAutoSizeProps> & Readonly<{}>, {
18
+ immediate: boolean;
18
19
  width: boolean;
19
20
  height: boolean;
20
- immediate: boolean;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
23
  export default _default;
@@ -3,7 +3,7 @@ declare function __VLS_template(): {
3
3
  default?(_: {}): any;
4
4
  };
5
5
  refs: {
6
- elRef: any;
6
+ elRef: HTMLDivElement;
7
7
  };
8
8
  attrs: Partial<{}>;
9
9
  };
@@ -8,11 +8,11 @@ interface MagicCommandItemProps {
8
8
  declare function __VLS_template(): {
9
9
  slots: {
10
10
  default?(_: {
11
- isActive: any;
11
+ isActive: boolean;
12
12
  }): any;
13
13
  };
14
14
  refs: {
15
- elRef: any;
15
+ elRef: HTMLDivElement;
16
16
  };
17
17
  attrs: Partial<{}>;
18
18
  };
@@ -7,7 +7,7 @@ declare function __VLS_template(): {
7
7
  default?(_: {}): any;
8
8
  };
9
9
  refs: {
10
- elRef: any;
10
+ elRef: HTMLDivElement;
11
11
  };
12
12
  attrs: Partial<{}>;
13
13
  };
@@ -4,8 +4,8 @@ type MagicCookieProps = {
4
4
  maxAge?: number;
5
5
  };
6
6
  declare function __VLS_template(): {
7
- slots: Partial<Record<any, (_: {
8
- cookie: any;
7
+ slots: Partial<Record<string, (_: {
8
+ cookie: MagicCookieRecord;
9
9
  }) => any>> & {
10
10
  default?(_: {}): any;
11
11
  actions?(_: {}): any;
@@ -10,9 +10,9 @@ declare function __VLS_template(): {
10
10
  default?(_: {}): any;
11
11
  };
12
12
  refs: {
13
- drawerRef: any;
14
- wrapperRef: any;
15
- elRef: any;
13
+ drawerRef: HTMLDivElement;
14
+ wrapperRef: HTMLDivElement;
15
+ elRef: unknown;
16
16
  };
17
17
  attrs: Partial<{}>;
18
18
  };
@@ -21,9 +21,9 @@ declare function __VLS_template(): {
21
21
  default?(_: {}): any;
22
22
  };
23
23
  refs: {
24
- drawerRef: any;
25
- wrapperRef: any;
26
- elRef: any;
24
+ drawerRef: HTMLDivElement;
25
+ wrapperRef: HTMLDivElement;
26
+ elRef: unknown;
27
27
  };
28
28
  attrs: Partial<{}>;
29
29
  };
@@ -8,8 +8,8 @@ declare function __VLS_template(): {
8
8
  default?(_: {}): any;
9
9
  };
10
10
  refs: {
11
- parentRef: any;
12
- childRef: any;
11
+ parentRef: HTMLDivElement;
12
+ childRef: HTMLDivElement;
13
13
  };
14
14
  attrs: Partial<{}>;
15
15
  };
@@ -11,7 +11,7 @@ declare function __VLS_template(): {
11
11
  default?(_: {}): any;
12
12
  };
13
13
  refs: {
14
- contentRef: any;
14
+ contentRef: HTMLDivElement;
15
15
  };
16
16
  attrs: Partial<{}>;
17
17
  };
@@ -11,8 +11,8 @@ declare function __VLS_template(): {
11
11
  default?(_: {}): any;
12
12
  };
13
13
  refs: {
14
- elRef: any;
15
- arrowRef: any;
14
+ elRef: HTMLDivElement;
15
+ arrowRef: HTMLDivElement;
16
16
  };
17
17
  attrs: Partial<{}>;
18
18
  };
@@ -5,12 +5,12 @@ interface MagicMenuItemProps {
5
5
  declare function __VLS_template(): {
6
6
  slots: {
7
7
  default?(_: {
8
- isActive: any;
9
- isDisabled: any;
8
+ isActive: boolean;
9
+ isDisabled: boolean | undefined;
10
10
  }): any;
11
11
  };
12
12
  refs: {
13
- elRef: any;
13
+ elRef: HTMLDivElement;
14
14
  };
15
15
  attrs: Partial<{}>;
16
16
  };
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
9
9
  default?(_: {}): any;
10
10
  };
11
11
  refs: {
12
- elRef: any;
12
+ elRef: HTMLDivElement;
13
13
  };
14
14
  attrs: Partial<{}>;
15
15
  };
@@ -10,8 +10,8 @@ interface MagicMenuRemoteProps {
10
10
  declare function __VLS_template(): {
11
11
  slots: {
12
12
  default?(_: {
13
- channelActive: any;
14
- remoteDisabled: any;
13
+ channelActive: boolean;
14
+ remoteDisabled: boolean | undefined;
15
15
  }): any;
16
16
  };
17
17
  refs: {};
@@ -7,12 +7,47 @@ interface MagicMenuTriggerProps {
7
7
  declare function __VLS_template(): {
8
8
  slots: {
9
9
  default?(_: {
10
- viewActive: any;
11
- triggerDisabled: any;
10
+ viewActive: boolean | undefined;
11
+ triggerDisabled: boolean;
12
12
  }): any;
13
13
  };
14
14
  refs: {
15
- elRef: any;
15
+ elRef: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
16
+ asChild: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ as: {
21
+ type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
22
+ default: string;
23
+ };
24
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
+ [key: string]: any;
26
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
27
+ asChild: boolean;
28
+ as: import("@maas/vue-primitive").ElementOrComponent;
29
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
30
+ P: {};
31
+ B: {};
32
+ D: {};
33
+ C: {};
34
+ M: {};
35
+ Defaults: {};
36
+ }, Readonly<import("vue").ExtractPropTypes<{
37
+ asChild: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ as: {
42
+ type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
43
+ default: string;
44
+ };
45
+ }>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
+ [key: string]: any;
47
+ }>, {}, {}, {}, {
48
+ asChild: boolean;
49
+ as: import("@maas/vue-primitive").ElementOrComponent;
50
+ }> | null;
16
51
  };
17
52
  attrs: Partial<{}>;
18
53
  };
@@ -14,7 +14,7 @@ declare function __VLS_template(): {
14
14
  default?(_: {}): any;
15
15
  };
16
16
  refs: {
17
- modalRef: any;
17
+ modalRef: HTMLDivElement;
18
18
  };
19
19
  attrs: Partial<{}>;
20
20
  };
@@ -8,8 +8,8 @@ declare function __VLS_template(): {
8
8
  default?(_: {}): any;
9
9
  };
10
10
  refs: {
11
- playerRef: any;
12
- audioRef: any;
11
+ playerRef: HTMLDivElement;
12
+ audioRef: HTMLAudioElement;
13
13
  };
14
14
  attrs: Partial<{}>;
15
15
  };
@@ -7,8 +7,8 @@ declare function __VLS_template(): {
7
7
  pauseIcon?(_: {}): any;
8
8
  };
9
9
  refs: {
10
- barRef: any;
11
- trackRef: any;
10
+ barRef: HTMLDivElement;
11
+ trackRef: HTMLDivElement;
12
12
  };
13
13
  attrs: Partial<{}>;
14
14
  };
@@ -19,8 +19,12 @@
19
19
  </template>
20
20
 
21
21
  <script setup lang="ts">
22
- import { ref, onMounted, onBeforeUnmount } from 'vue'
23
- import { useIntersectionObserver } from '@vueuse/core'
22
+ import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
23
+ import {
24
+ useElementVisibility,
25
+ useEventListener,
26
+ defaultWindow,
27
+ } from '@vueuse/core'
24
28
  import { usePlayerVideoApi } from '../composables/private/usePlayerVideoApi'
25
29
  import { usePlayerMediaApi } from '../composables/private/usePlayerMediaApi'
26
30
  import { usePlayerRuntime } from '../composables/private/usePlayerRuntime'
@@ -47,6 +51,8 @@ const props = withDefaults(defineProps<MagicPlayerProps>(), {
47
51
  const playerRef = ref<HTMLDivElement | undefined>(undefined)
48
52
  const videoRef = ref<HTMLVideoElement | undefined>(undefined)
49
53
 
54
+ const isVisible = useElementVisibility(playerRef)
55
+
50
56
  const { playing, muted } = usePlayerMediaApi({
51
57
  id: props.id,
52
58
  mediaRef: videoRef,
@@ -65,13 +71,23 @@ const { onMouseenter, onMouseleave, play, pause } = usePlayerVideoApi({
65
71
  playerRef: playerRef,
66
72
  })
67
73
 
68
- useIntersectionObserver(
69
- playerRef,
70
- ([{ isIntersecting }]) => {
71
- if (!isIntersecting && playing.value) {
72
- pause()
73
- } else if (isIntersecting && !playing.value && props.autoplay) {
74
+ function onWindowFocus() {
75
+ if (isVisible.value && !playing.value && props.autoplay) {
76
+ play()
77
+ }
78
+ }
79
+
80
+ // Auto play when window is focused
81
+ useEventListener(defaultWindow, 'focus', onWindowFocus)
82
+
83
+ // Auto play when element is visible
84
+ watch(
85
+ isVisible,
86
+ (value) => {
87
+ if (value && !playing.value && props.autoplay) {
74
88
  play()
89
+ } else if (!value && playing.value) {
90
+ pause()
75
91
  }
76
92
  },
77
93
  {
@@ -12,8 +12,8 @@ declare function __VLS_template(): {
12
12
  default?(_: {}): any;
13
13
  };
14
14
  refs: {
15
- playerRef: any;
16
- videoRef: any;
15
+ playerRef: HTMLDivElement;
16
+ videoRef: HTMLVideoElement;
17
17
  };
18
18
  attrs: Partial<{}>;
19
19
  };
@@ -18,9 +18,9 @@ declare function __VLS_template(): {
18
18
  fullscreenEnterIcon?(_: {}): any;
19
19
  };
20
20
  refs: {
21
- popoverRef: any;
22
- barRef: any;
23
- trackRef: any;
21
+ popoverRef: HTMLDivElement;
22
+ barRef: HTMLDivElement;
23
+ trackRef: HTMLDivElement;
24
24
  };
25
25
  attrs: Partial<{}>;
26
26
  };
@@ -60,10 +60,8 @@ export function usePlayerMediaApi(args) {
60
60
  if (!el) return;
61
61
  if (isPlaying) {
62
62
  const playPromise = el.play();
63
- if (playPromise !== void 0)
64
- playPromise.catch((error) => {
65
- console.warn("Playback error:", error);
66
- });
63
+ if (playPromise !== void 0) playPromise.catch((error) => {
64
+ });
67
65
  } else {
68
66
  el.pause();
69
67
  }
@@ -7,7 +7,7 @@ declare function __VLS_template(): {
7
7
  default?(_: {}): any;
8
8
  };
9
9
  refs: {
10
- elRef: any;
10
+ elRef: HTMLDivElement;
11
11
  };
12
12
  attrs: Partial<{}>;
13
13
  };
@@ -10,7 +10,7 @@ declare function __VLS_template(): {
10
10
  default?(_: {}): any;
11
11
  };
12
12
  refs: {
13
- elRef: any;
13
+ elRef: HTMLDivElement;
14
14
  };
15
15
  attrs: Partial<{}>;
16
16
  };
@@ -6,7 +6,24 @@ interface MagicScrollProviderProps {
6
6
  declare function __VLS_template(): {
7
7
  slots: {
8
8
  default?(_: {
9
- scrollReturn: any;
9
+ scrollReturn: {
10
+ x: import("vue").WritableComputedRef<number>;
11
+ y: import("vue").WritableComputedRef<number>;
12
+ isScrolling: import("vue").Ref<boolean>;
13
+ arrivedState: {
14
+ left: boolean;
15
+ right: boolean;
16
+ top: boolean;
17
+ bottom: boolean;
18
+ };
19
+ directions: {
20
+ left: boolean;
21
+ right: boolean;
22
+ top: boolean;
23
+ bottom: boolean;
24
+ };
25
+ measure(): void;
26
+ };
10
27
  }): any;
11
28
  };
12
29
  refs: {};
@@ -6,18 +6,18 @@ interface MagicScrollSceneProps {
6
6
  declare function __VLS_template(): {
7
7
  slots: {
8
8
  default?(_: {
9
- progress: any;
9
+ progress: number;
10
10
  }): any;
11
11
  };
12
12
  refs: {
13
- elRef: any;
13
+ elRef: HTMLDivElement;
14
14
  };
15
15
  attrs: Partial<{}>;
16
16
  };
17
17
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
18
  declare const __VLS_component: import("vue").DefineComponent<MagicScrollSceneProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicScrollSceneProps> & Readonly<{}>, {
19
- from: FromTo;
20
19
  to: FromTo;
20
+ from: FromTo;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
23
  export default _default;
@@ -10,7 +10,7 @@ declare function __VLS_template(): {
10
10
  default?(_: {}): any;
11
11
  };
12
12
  refs: {
13
- elRef: any;
13
+ elRef: HTMLLIElement;
14
14
  };
15
15
  attrs: Partial<{}>;
16
16
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "A magic collection of Vue composables, plugins, components and directives",
4
- "version": "0.36.2",
4
+ "version": "0.36.3",
5
5
  "author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
6
6
  "type": "module",
7
7
  "devDependencies": {