@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.
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +14 -8
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +2 -2
- package/dist/plugins/.turbo/turbo-lint.log +2 -2
- package/dist/plugins/MagicAccordion/demo/data/footer.json +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +3 -3
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +15 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +6 -157
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +4 -2
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +11 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +0 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +3 -8
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +5 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +3 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +7 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +1 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +3 -157
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +3 -3
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +3 -3
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +3 -3
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +10 -12
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +4 -25
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +4 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -3
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +12 -15
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +20 -21
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +188 -0
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +15 -15
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +25 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +27 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +3 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +56 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +5 -7
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +53 -0
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +1 -12
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +3 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +6 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +1 -85
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +3 -4
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +3 -157
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +6 -6
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +60 -0
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +13 -13
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -5
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +14 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +29 -29
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +19 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +35 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +23 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +15 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +18 -11
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +20 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +17 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +4 -10
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +7 -7
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +4 -10
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +17 -9
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +4 -9
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +8 -3
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +9 -10
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -59
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +5 -8
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +3 -8
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +22 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/utils/index.d.ts +7 -3
- package/dist/utils/index.js +25 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { toValue, type MaybeRef } from 'vue';
|
|
2
|
+
import type { MagicModalOptions } from './../types/index.js';
|
|
3
|
+
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
|
+
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
5
|
+
interface MagicModalProps {
|
|
6
|
+
id: MaybeRef<string>;
|
|
7
|
+
props?: Record<string, unknown>;
|
|
8
|
+
options?: MagicModalOptions;
|
|
9
|
+
}
|
|
10
|
+
declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> & Omit<import("../../../../utils").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 close: () => void;
|
|
30
|
+
declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
|
|
31
|
+
declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
|
|
32
|
+
declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
|
|
33
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
34
|
+
declare var __VLS_9: {}, __VLS_32: {};
|
|
35
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
36
|
+
backdrop?: (props: typeof __VLS_9) => any;
|
|
37
|
+
} & {
|
|
38
|
+
default?: (props: typeof __VLS_32) => any;
|
|
39
|
+
}>;
|
|
40
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicModalProps, {
|
|
41
|
+
toValue: typeof toValue;
|
|
42
|
+
mappedOptions: typeof mappedOptions;
|
|
43
|
+
close: typeof close;
|
|
44
|
+
innerActive: typeof innerActive;
|
|
45
|
+
wrapperActive: typeof wrapperActive;
|
|
46
|
+
onBeforeEnter: typeof onBeforeEnter;
|
|
47
|
+
onEnter: typeof onEnter;
|
|
48
|
+
onAfterEnter: typeof onAfterEnter;
|
|
49
|
+
onBeforeLeave: typeof onBeforeLeave;
|
|
50
|
+
onLeave: typeof onLeave;
|
|
51
|
+
onAfterLeave: typeof onAfterLeave;
|
|
52
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
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>;
|
|
54
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { useScrollLock } from "@vueuse/core";
|
|
4
4
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
matchClass,
|
|
7
|
+
scrollbarGutterSupport,
|
|
8
|
+
scrollbarWidth
|
|
9
|
+
} from "@maas/vue-equipment/utils";
|
|
6
10
|
const defaultOptions = {
|
|
7
11
|
focusTrap: false,
|
|
8
12
|
focusTarget: void 0,
|
|
9
13
|
scrollLock: true
|
|
10
14
|
};
|
|
11
|
-
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) :
|
|
15
|
+
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
12
16
|
export function useModalDOM(args) {
|
|
13
17
|
const positionFixedElements = ref([]);
|
|
14
18
|
const mappedOptions = defu(args, defaultOptions);
|
|
@@ -36,24 +40,40 @@ export function useModalDOM(args) {
|
|
|
36
40
|
function addScrollLockPadding() {
|
|
37
41
|
if (typeof window === "undefined") return;
|
|
38
42
|
const exclude = new RegExp(/magic-modal(__backdrop)?/);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
document.body.style.setProperty(
|
|
44
|
+
"--scrollbar-width",
|
|
45
|
+
`${scrollbarWidth()}px`
|
|
46
|
+
);
|
|
42
47
|
positionFixedElements.value = [
|
|
43
48
|
...document.body.getElementsByTagName("*")
|
|
44
49
|
].filter(
|
|
45
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
46
|
-
);
|
|
47
|
-
positionFixedElements.value.forEach(
|
|
48
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
50
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
49
51
|
);
|
|
52
|
+
switch (scrollbarGutterSupport()) {
|
|
53
|
+
case true:
|
|
54
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
55
|
+
positionFixedElements.value.forEach((elem) => {
|
|
56
|
+
elem.style.scrollbarGutter = "stable";
|
|
57
|
+
elem.style.overflow = "auto";
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
case false:
|
|
61
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
62
|
+
positionFixedElements.value.forEach(
|
|
63
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
64
|
+
);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
68
|
function removeScrollLockPadding() {
|
|
52
|
-
document.
|
|
69
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
53
70
|
document.body.style.removeProperty("--scrollbar-width");
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
document.body.style.paddingRight = "";
|
|
72
|
+
positionFixedElements.value.forEach((elem) => {
|
|
73
|
+
elem.style.paddingRight = "";
|
|
74
|
+
elem.style.scrollbarGutter = "";
|
|
75
|
+
elem.style.overflow = "";
|
|
76
|
+
});
|
|
57
77
|
}
|
|
58
78
|
return {
|
|
59
79
|
trapFocus,
|
|
@@ -3,7 +3,15 @@ import { defineComponent as _defineComponent } from "vue";
|
|
|
3
3
|
import { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
4
|
const _hoisted_1 = ["data-loading"];
|
|
5
5
|
const _hoisted_2 = { class: "magic-noise__inner" };
|
|
6
|
-
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
ref: "canvas",
|
|
8
|
+
class: "magic-noise__canvas"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
ref: "offCanvas",
|
|
12
|
+
class: "magic-noise__off-canvas"
|
|
13
|
+
};
|
|
14
|
+
import { onMounted, onUnmounted, watch, useTemplateRef } from "vue";
|
|
7
15
|
import { useResizeObserver, useDebounceFn } from "@vueuse/core";
|
|
8
16
|
import { useNoiseApi } from "../composables/private/useNoiseApi";
|
|
9
17
|
export default /* @__PURE__ */ _defineComponent({
|
|
@@ -13,8 +21,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
13
21
|
pause: { type: Boolean, required: false, default: false }
|
|
14
22
|
},
|
|
15
23
|
setup(__props) {
|
|
16
|
-
const canvasRef =
|
|
17
|
-
const offCanvasRef =
|
|
24
|
+
const canvasRef = useTemplateRef("canvas");
|
|
25
|
+
const offCanvasRef = useTemplateRef("offCanvas");
|
|
18
26
|
const noiseApi = useNoiseApi({
|
|
19
27
|
canvasRef,
|
|
20
28
|
offCanvasRef,
|
|
@@ -58,22 +66,14 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
58
66
|
_createElementVNode("div", _hoisted_2, [
|
|
59
67
|
_createElementVNode(
|
|
60
68
|
"canvas",
|
|
61
|
-
|
|
62
|
-
ref_key: "canvasRef",
|
|
63
|
-
ref: canvasRef,
|
|
64
|
-
class: "magic-noise__canvas"
|
|
65
|
-
},
|
|
69
|
+
_hoisted_3,
|
|
66
70
|
null,
|
|
67
71
|
512
|
|
68
72
|
/* NEED_PATCH */
|
|
69
73
|
),
|
|
70
74
|
_createElementVNode(
|
|
71
75
|
"canvas",
|
|
72
|
-
|
|
73
|
-
ref_key: "offCanvasRef",
|
|
74
|
-
ref: offCanvasRef,
|
|
75
|
-
class: "magic-noise__off-canvas"
|
|
76
|
-
},
|
|
76
|
+
_hoisted_4,
|
|
77
77
|
null,
|
|
78
78
|
512
|
|
79
79
|
/* NEED_PATCH */
|
|
@@ -3,9 +3,5 @@ interface MagicNoiseProps {
|
|
|
3
3
|
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
canvasRef: typeof __VLS_nativeElements['canvas'];
|
|
8
|
-
offCanvasRef: typeof __VLS_nativeElements['canvas'];
|
|
9
|
-
};
|
|
10
|
-
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, HTMLDivElement>;
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
7
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicNoiseOptions, RafControls } from '../../types/index.js';
|
|
3
3
|
type UseNoiseApiArgs = {
|
|
4
|
-
canvasRef: Ref<HTMLCanvasElement |
|
|
5
|
-
offCanvasRef: Ref<HTMLCanvasElement |
|
|
4
|
+
canvasRef: Ref<HTMLCanvasElement | null>;
|
|
5
|
+
offCanvasRef: Ref<HTMLCanvasElement | null>;
|
|
6
6
|
options?: MaybeRef<MagicNoiseOptions>;
|
|
7
7
|
};
|
|
8
8
|
export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNoiseApiArgs): {
|
|
@@ -11,7 +11,7 @@ export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNo
|
|
|
11
11
|
rotateAndTransfer: () => void;
|
|
12
12
|
throttledDraw: () => void;
|
|
13
13
|
throttledRotateAndTransfer: () => void;
|
|
14
|
-
isReady:
|
|
14
|
+
isReady: import("vue").ShallowRef<boolean, boolean>;
|
|
15
15
|
drawControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
16
16
|
transferControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowRef,
|
|
1
|
+
import { shallowRef, reactive } from "vue";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import {
|
|
4
4
|
useElementSize,
|
|
@@ -14,7 +14,7 @@ export function useNoiseApi({
|
|
|
14
14
|
}) {
|
|
15
15
|
const tiles = shallowRef([]);
|
|
16
16
|
const pixels = shallowRef([]);
|
|
17
|
-
const isReady =
|
|
17
|
+
const isReady = shallowRef(false);
|
|
18
18
|
const context = shallowRef(null);
|
|
19
19
|
const offContext = shallowRef(null);
|
|
20
20
|
const { width, height } = useElementSize(canvasRef);
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
-
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
ref: "el",
|
|
6
|
+
class: "magic-player-audio"
|
|
7
|
+
};
|
|
8
|
+
import {
|
|
9
|
+
useTemplateRef,
|
|
10
|
+
shallowRef,
|
|
11
|
+
inject,
|
|
12
|
+
onMounted,
|
|
13
|
+
onBeforeUnmount
|
|
14
|
+
} from "vue";
|
|
5
15
|
import { useIntersectionObserver } from "@vueuse/core";
|
|
6
16
|
import { usePlayerAudioApi } from "../composables/private/usePlayerAudioApi";
|
|
7
17
|
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
@@ -18,8 +28,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
18
28
|
if (!injectedOptions) {
|
|
19
29
|
throw new Error("MagicPlayerVideo must be used within a MagicPlayerProvider");
|
|
20
30
|
}
|
|
21
|
-
const elRef =
|
|
22
|
-
const pausedByIntersection =
|
|
31
|
+
const elRef = useTemplateRef("el");
|
|
32
|
+
const pausedByIntersection = shallowRef(false);
|
|
23
33
|
const { initialize, destroy } = usePlayerRuntime({
|
|
24
34
|
id: injectedId,
|
|
25
35
|
mediaRef: elRef,
|
|
@@ -57,11 +67,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
57
67
|
return (_ctx, _cache) => {
|
|
58
68
|
return _openBlock(), _createElementBlock(
|
|
59
69
|
"audio",
|
|
60
|
-
|
|
61
|
-
ref_key: "elRef",
|
|
62
|
-
ref: elRef,
|
|
63
|
-
class: "magic-player-audio"
|
|
64
|
-
},
|
|
70
|
+
_hoisted_1,
|
|
65
71
|
null,
|
|
66
72
|
512
|
|
67
73
|
/* NEED_PATCH */
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
elRef: typeof __VLS_nativeElements['audio'];
|
|
3
|
-
};
|
|
4
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, __VLS_TemplateRefs, HTMLAudioElement>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
2
|
export default _default;
|
|
@@ -4,22 +4,30 @@ import { unref as _unref, renderSlot as _renderSlot, createVNode as _createVNode
|
|
|
4
4
|
const _hoisted_1 = ["data-touched", "data-playing", "data-paused", "data-waiting", "data-idle", "data-hover"];
|
|
5
5
|
const _hoisted_2 = { class: "magic-player-audio-controls__bar" };
|
|
6
6
|
const _hoisted_3 = {
|
|
7
|
+
ref: "bar",
|
|
8
|
+
class: "magic-player-audio-controls__bar--inner"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = {
|
|
7
11
|
class: "magic-player-audio-controls__item -shrink-0",
|
|
8
12
|
"data-slot": "play-toggle"
|
|
9
13
|
};
|
|
10
|
-
const
|
|
14
|
+
const _hoisted_5 = {
|
|
11
15
|
class: "magic-player-audio-controls__item -shrink-0",
|
|
12
16
|
"data-slot": "display-time-current"
|
|
13
17
|
};
|
|
14
|
-
const
|
|
18
|
+
const _hoisted_6 = {
|
|
15
19
|
class: "magic-player-audio-controls__item -grow",
|
|
16
20
|
"data-slot": "timeline"
|
|
17
21
|
};
|
|
18
|
-
const
|
|
22
|
+
const _hoisted_7 = {
|
|
23
|
+
ref: "track",
|
|
24
|
+
class: "magic-player-audio-controls__timeline"
|
|
25
|
+
};
|
|
26
|
+
const _hoisted_8 = {
|
|
19
27
|
class: "magic-player-audio-controls__item -shrink-0",
|
|
20
28
|
"data-slot": "display-time-duration"
|
|
21
29
|
};
|
|
22
|
-
import { computed,
|
|
30
|
+
import { computed, inject, provide, useTemplateRef } from "vue";
|
|
23
31
|
import { useIdle } from "@vueuse/core";
|
|
24
32
|
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
25
33
|
import { usePlayerAudioApi } from "../composables/private/usePlayerAudioApi";
|
|
@@ -30,31 +38,31 @@ import { MagicPlayerInstanceId } from "../symbols";
|
|
|
30
38
|
export default /* @__PURE__ */ _defineComponent({
|
|
31
39
|
__name: "MagicPlayerAudioControls",
|
|
32
40
|
props: {
|
|
33
|
-
|
|
41
|
+
instanceId: { type: String, required: false }
|
|
34
42
|
},
|
|
35
43
|
setup(__props) {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
44
|
+
const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
|
|
45
|
+
const mappedInstanceId = computed(() => __props.instanceId ?? injectedInstanceId);
|
|
46
|
+
if (!mappedInstanceId.value) {
|
|
39
47
|
throw new Error(
|
|
40
|
-
"MagicAudioPlayerControls must be nested inside MagicAudioPlayer or
|
|
48
|
+
"MagicAudioPlayerControls must be nested inside MagicAudioPlayer or an instanceId must be provided."
|
|
41
49
|
);
|
|
42
50
|
}
|
|
43
|
-
const barRef =
|
|
44
|
-
const trackRef =
|
|
51
|
+
const barRef = useTemplateRef("bar");
|
|
52
|
+
const trackRef = useTemplateRef("track");
|
|
45
53
|
const { playing, waiting } = usePlayerMediaApi({
|
|
46
|
-
id:
|
|
54
|
+
id: mappedInstanceId.value
|
|
47
55
|
});
|
|
48
56
|
const { play, pause, touched, mouseEntered } = usePlayerAudioApi({
|
|
49
|
-
id:
|
|
57
|
+
id: mappedInstanceId.value
|
|
50
58
|
});
|
|
51
59
|
usePlayerControlsApi({
|
|
52
|
-
id:
|
|
60
|
+
id: mappedInstanceId.value,
|
|
53
61
|
barRef,
|
|
54
62
|
trackRef
|
|
55
63
|
});
|
|
56
64
|
const { idle } = useIdle(3e3);
|
|
57
|
-
provide(MagicPlayerInstanceId,
|
|
65
|
+
provide(MagicPlayerInstanceId, mappedInstanceId.value);
|
|
58
66
|
return (_ctx, _cache) => {
|
|
59
67
|
const _component_magic_player_display_time = _resolveComponent("magic-player-display-time");
|
|
60
68
|
const _component_magic_player_timeline = _resolveComponent("magic-player-timeline");
|
|
@@ -70,13 +78,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
70
78
|
_createElementVNode("div", _hoisted_2, [
|
|
71
79
|
_createElementVNode(
|
|
72
80
|
"div",
|
|
73
|
-
|
|
74
|
-
ref_key: "barRef",
|
|
75
|
-
ref: barRef,
|
|
76
|
-
class: "magic-player-audio-controls__bar--inner"
|
|
77
|
-
},
|
|
81
|
+
_hoisted_3,
|
|
78
82
|
[
|
|
79
|
-
_createElementVNode("div",
|
|
83
|
+
_createElementVNode("div", _hoisted_4, [
|
|
80
84
|
!_unref(playing) ? (_openBlock(), _createElementBlock("button", {
|
|
81
85
|
key: 0,
|
|
82
86
|
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
@@ -95,17 +99,13 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
95
99
|
])
|
|
96
100
|
]))
|
|
97
101
|
]),
|
|
98
|
-
_createElementVNode("div",
|
|
102
|
+
_createElementVNode("div", _hoisted_5, [
|
|
99
103
|
_createVNode(_component_magic_player_display_time, { type: "current" })
|
|
100
104
|
]),
|
|
101
|
-
_createElementVNode("div",
|
|
105
|
+
_createElementVNode("div", _hoisted_6, [
|
|
102
106
|
_createElementVNode(
|
|
103
107
|
"div",
|
|
104
|
-
|
|
105
|
-
ref_key: "trackRef",
|
|
106
|
-
ref: trackRef,
|
|
107
|
-
class: "magic-player-audio-controls__timeline"
|
|
108
|
-
},
|
|
108
|
+
_hoisted_7,
|
|
109
109
|
[
|
|
110
110
|
_createVNode(_component_magic_player_timeline)
|
|
111
111
|
],
|
|
@@ -113,7 +113,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
113
113
|
/* NEED_PATCH */
|
|
114
114
|
)
|
|
115
115
|
]),
|
|
116
|
-
_createElementVNode("div",
|
|
116
|
+
_createElementVNode("div", _hoisted_8, [
|
|
117
117
|
_createVNode(_component_magic_player_display_time, { type: "duration" })
|
|
118
118
|
])
|
|
119
119
|
],
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import IconPlay from './icons/Play.vue.js';
|
|
2
|
+
import IconPause from './icons/Pause.vue.js';
|
|
3
|
+
interface MagicAudioPlayerControlsProps {
|
|
4
|
+
instanceId?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const playing: import("vue").ShallowRef<boolean, boolean>, waiting: import("vue").ShallowRef<boolean, boolean>;
|
|
7
|
+
declare const play: () => void, pause: () => void, touched: import("vue").ShallowRef<boolean, boolean>, mouseEntered: import("vue").ShallowRef<boolean, boolean>;
|
|
8
|
+
declare const idle: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
|
+
declare var __VLS_1: {}, __VLS_6: {};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
playIcon?: (props: typeof __VLS_1) => any;
|
|
13
|
+
} & {
|
|
14
|
+
pauseIcon?: (props: typeof __VLS_6) => any;
|
|
15
|
+
}>;
|
|
16
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicAudioPlayerControlsProps, {
|
|
17
|
+
IconPlay: typeof IconPlay;
|
|
18
|
+
IconPause: typeof IconPause;
|
|
19
|
+
playing: typeof playing;
|
|
20
|
+
waiting: typeof waiting;
|
|
21
|
+
play: typeof play;
|
|
22
|
+
pause: typeof pause;
|
|
23
|
+
touched: typeof touched;
|
|
24
|
+
mouseEntered: typeof mouseEntered;
|
|
25
|
+
idle: typeof idle;
|
|
26
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAudioPlayerControlsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
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>;
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface MagicPlayerDisplayTimeProps {
|
|
2
2
|
type?: 'current' | 'remaining' | 'duration';
|
|
3
3
|
}
|
|
4
|
-
declare const _default: import("vue").DefineComponent<MagicPlayerDisplayTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerDisplayTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
4
|
+
declare const _default: import("vue").DefineComponent<MagicPlayerDisplayTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerDisplayTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
export default _default;
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
4
|
const _hoisted_1 = ["width", "height"];
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
shallowRef,
|
|
7
|
+
onMounted,
|
|
8
|
+
watch,
|
|
9
|
+
computed,
|
|
10
|
+
inject,
|
|
11
|
+
useTemplateRef
|
|
12
|
+
} from "vue";
|
|
6
13
|
import { useDevicePixelRatio } from "@vueuse/core";
|
|
7
14
|
import { usePlayerControlsApi } from "../composables/private/usePlayerControlsApi";
|
|
8
15
|
import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
|
|
@@ -21,7 +28,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
21
28
|
}
|
|
22
29
|
const { seekedTime } = usePlayerControlsApi({ id: instanceId });
|
|
23
30
|
const { pixelRatio } = useDevicePixelRatio();
|
|
24
|
-
const canvasRef =
|
|
31
|
+
const canvasRef = useTemplateRef("canvas");
|
|
25
32
|
const storyboard = shallowRef();
|
|
26
33
|
let context = void 0;
|
|
27
34
|
let image = void 0;
|
|
@@ -35,12 +42,17 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
35
42
|
});
|
|
36
43
|
function getMuxId(url) {
|
|
37
44
|
const match = url?.match(/mux\.com\/([^\/]+)/);
|
|
38
|
-
return match?.[1];
|
|
45
|
+
return match?.[1]?.replace(/\.(m3u8|mp4)$/, "");
|
|
39
46
|
}
|
|
40
47
|
async function init() {
|
|
41
48
|
const parsedPlaybackId = getMuxId(injectedOptions?.src);
|
|
42
49
|
const mappedPlaybackId = __props.playbackId ?? parsedPlaybackId;
|
|
43
|
-
if (!mappedPlaybackId)
|
|
50
|
+
if (!mappedPlaybackId) {
|
|
51
|
+
console.error(
|
|
52
|
+
"MagicPlayerMuxPopover must be nested inside MagicPlayerProvider or a playbackId must be provided"
|
|
53
|
+
);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
44
56
|
try {
|
|
45
57
|
storyboard.value = await fetch(
|
|
46
58
|
`https://image.mux.com/${mappedPlaybackId}/storyboard.json`
|
|
@@ -49,8 +61,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
49
61
|
image = new Image();
|
|
50
62
|
image.src = storyboard.value.url;
|
|
51
63
|
await image.decode();
|
|
52
|
-
context = canvasRef.value
|
|
53
|
-
context
|
|
64
|
+
context = canvasRef.value?.getContext("2d");
|
|
65
|
+
context?.drawImage(image, 0, 0);
|
|
54
66
|
} catch (e) {
|
|
55
67
|
console.error("Can not initialize timeine preview.", e);
|
|
56
68
|
}
|
|
@@ -95,8 +107,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
95
107
|
},
|
|
96
108
|
[
|
|
97
109
|
_createElementVNode("canvas", {
|
|
98
|
-
|
|
99
|
-
ref: canvasRef,
|
|
110
|
+
ref: "canvas",
|
|
100
111
|
width: storyboard.value?.tile_width,
|
|
101
112
|
height: storyboard.value?.tile_height
|
|
102
113
|
}, null, 8, _hoisted_1)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
interface MagicPlayerMuxPopoverProps {
|
|
2
2
|
playbackId?: string;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
canvasRef: typeof __VLS_nativeElements['canvas'];
|
|
6
|
-
};
|
|
7
|
-
declare const _default: import("vue").DefineComponent<MagicPlayerMuxPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerMuxPopoverProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, HTMLDivElement>;
|
|
4
|
+
declare const _default: import("vue").DefineComponent<MagicPlayerMuxPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicPlayerMuxPopoverProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
5
|
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 playing: import("vue").ShallowRef<boolean, boolean>, waiting: import("vue").ShallowRef<boolean, boolean>;
|
|
5
|
+
declare const mouseEntered: import("vue").ShallowRef<boolean, boolean>, togglePlay: () => void;
|
|
6
|
+
declare const idle: import("vue").Ref<boolean, 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> & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
waitingIcon?: (props: typeof __VLS_3) => any;
|
|
13
|
+
} & {
|
|
14
|
+
playIcon?: (props: typeof __VLS_8) => any;
|
|
15
|
+
} & {
|
|
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
|
+
playing: typeof playing;
|
|
23
|
+
waiting: typeof waiting;
|
|
24
|
+
mouseEntered: typeof mouseEntered;
|
|
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>;
|
|
28
|
+
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
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
declare const loaded: import("vue").
|
|
2
|
-
declare const touched: import("vue").
|
|
1
|
+
declare const loaded: import("vue").ShallowRef<boolean, boolean>;
|
|
2
|
+
declare const touched: import("vue").ShallowRef<boolean, boolean>;
|
|
3
3
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
5
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
7
|
}>;
|
|
8
8
|
declare const __VLS_self: import("vue").DefineComponent<{}, {
|
|
9
9
|
loaded: typeof loaded;
|
|
10
10
|
touched: typeof touched;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
12
|
+
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>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
4
|
const _hoisted_1 = ["data-mode", "data-fullscreen", "data-touched", "data-playing", "data-paused", "data-waiting", "data-loaded", "data-muted"];
|
|
5
|
-
import {
|
|
5
|
+
import { useTemplateRef, provide } from "vue";
|
|
6
6
|
import defu from "defu";
|
|
7
7
|
import { usePlayerVideoApi } from "../composables/private/usePlayerVideoApi";
|
|
8
8
|
import { usePlayerMediaApi } from "../composables/private/usePlayerMediaApi";
|
|
@@ -17,7 +17,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
19
19
|
const mappedOptions = defu(__props.options, defaultOptions);
|
|
20
|
-
const playerRef =
|
|
20
|
+
const playerRef = useTemplateRef("player");
|
|
21
21
|
const { playing, waiting, muted } = usePlayerMediaApi({
|
|
22
22
|
id: __props.id
|
|
23
23
|
});
|
|
@@ -36,8 +36,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
36
36
|
provide(MagicPlayerOptionsKey, mappedOptions);
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
38
|
return _openBlock(), _createElementBlock("div", {
|
|
39
|
-
|
|
40
|
-
ref: playerRef,
|
|
39
|
+
ref: "player",
|
|
41
40
|
class: "magic-player-provider",
|
|
42
41
|
"data-mode": _unref(mappedOptions).mode,
|
|
43
42
|
"data-fullscreen": _unref(isFullscreen),
|