@maas/vue-equipment 1.0.0-beta.17 → 1.0.0-beta.19
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/nuxt/module.json +2 -2
- package/dist/nuxt/types.d.mts +2 -6
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +3 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +3 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +4 -16
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +3 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +1 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +3 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +1 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +3 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -24
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -8
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +3 -12
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +2 -8
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +12 -9
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +4 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +38 -61
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -17
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +77 -59
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +2 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -0
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +2 -8
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +37 -37
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +4 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +4 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +3 -12
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +6 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +5 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -8
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +3 -12
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +5 -5
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +2 -8
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +2 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +2 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +3 -12
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +2 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +3 -12
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +1 -4
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +2 -8
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +13 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +34 -29
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +2 -8
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +2 -8
- package/package.json +2 -2
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -10
- package/dist/nuxt/types.d.ts +0 -7
|
@@ -25,14 +25,8 @@ import { usePlayerState } from "../composables/private/usePlayerState";
|
|
|
25
25
|
import { MagicPlayerInstanceId, MagicPlayerOptionsKey } from "../symbols";
|
|
26
26
|
import { defaultOptions } from "../utils/defaultOptions";
|
|
27
27
|
const { id, options } = defineProps({
|
|
28
|
-
id: {
|
|
29
|
-
|
|
30
|
-
required: true
|
|
31
|
-
},
|
|
32
|
-
options: {
|
|
33
|
-
type: Object,
|
|
34
|
-
required: false
|
|
35
|
-
}
|
|
28
|
+
id: { type: null, required: true },
|
|
29
|
+
options: { type: Object, required: false }
|
|
36
30
|
});
|
|
37
31
|
const mappedOptions = defu(options, defaultOptions);
|
|
38
32
|
const { initializeState, deleteState } = usePlayerState(id);
|
|
@@ -108,18 +108,9 @@ const {
|
|
|
108
108
|
standalone = false,
|
|
109
109
|
transition
|
|
110
110
|
} = defineProps({
|
|
111
|
-
id: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
standalone: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
required: false
|
|
118
|
-
},
|
|
119
|
-
transition: {
|
|
120
|
-
type: String,
|
|
121
|
-
required: false
|
|
122
|
-
}
|
|
111
|
+
id: { type: String, required: false },
|
|
112
|
+
standalone: { type: Boolean, required: false },
|
|
113
|
+
transition: { type: String, required: false }
|
|
123
114
|
});
|
|
124
115
|
const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
|
|
125
116
|
const mappedInstanceId = computed(() => id ?? injectedInstanceId);
|
|
@@ -19,14 +19,8 @@ import { useCollisionDetection } from "../composables/private/useCollisionDetect
|
|
|
19
19
|
import { MagicScrollReturn, MagicScrollTarget } from "../symbols";
|
|
20
20
|
import { useIntersectionObserver } from "@vueuse/core";
|
|
21
21
|
const { id, offset } = defineProps({
|
|
22
|
-
id: {
|
|
23
|
-
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
|
-
offset: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: false
|
|
29
|
-
}
|
|
22
|
+
id: { type: String, required: false },
|
|
23
|
+
offset: { type: Object, required: false }
|
|
30
24
|
});
|
|
31
25
|
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
32
26
|
const scrollTarget = inject(MagicScrollTarget);
|
|
@@ -14,18 +14,9 @@ import {
|
|
|
14
14
|
import { MagicScrollProgress } from "../symbols";
|
|
15
15
|
import {} from "../types";
|
|
16
16
|
const { progress, sequence, sequenceOptions } = defineProps({
|
|
17
|
-
sequence: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
sequenceOptions: {
|
|
22
|
-
type: Object,
|
|
23
|
-
required: false
|
|
24
|
-
},
|
|
25
|
-
progress: {
|
|
26
|
-
type: Number,
|
|
27
|
-
required: false
|
|
28
|
-
}
|
|
17
|
+
sequence: { type: Array, required: true },
|
|
18
|
+
sequenceOptions: { type: Object, required: false },
|
|
19
|
+
progress: { type: Number, required: false }
|
|
29
20
|
});
|
|
30
21
|
const animation = ref(void 0);
|
|
31
22
|
const elRef = useTemplateRef("el");
|
|
@@ -9,10 +9,7 @@ import { provide, computed } from "vue";
|
|
|
9
9
|
import { useScroll, unrefElement } from "@vueuse/core";
|
|
10
10
|
import { MagicScrollReturn, MagicScrollTarget } from "../symbols";
|
|
11
11
|
const { target } = defineProps({
|
|
12
|
-
target: {
|
|
13
|
-
type: null,
|
|
14
|
-
required: false
|
|
15
|
-
}
|
|
12
|
+
target: { type: null, required: false }
|
|
16
13
|
});
|
|
17
14
|
const mappedTarget = computed(() => {
|
|
18
15
|
switch (true) {
|
|
@@ -22,14 +22,8 @@ import {
|
|
|
22
22
|
MagicScrollReturn
|
|
23
23
|
} from "../symbols";
|
|
24
24
|
const { from = "top-bottom", to = "bottom-top" } = defineProps({
|
|
25
|
-
from: {
|
|
26
|
-
|
|
27
|
-
required: false
|
|
28
|
-
},
|
|
29
|
-
to: {
|
|
30
|
-
type: String,
|
|
31
|
-
required: false
|
|
32
|
-
}
|
|
25
|
+
from: { type: String, required: false },
|
|
26
|
+
to: { type: String, required: false }
|
|
33
27
|
});
|
|
34
28
|
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
35
29
|
const scrollTarget = inject(MagicScrollTarget, void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowRef, reactive, computed, toValue } from "vue";
|
|
2
|
-
import { useElementBounding } from "@vueuse/core";
|
|
2
|
+
import { useElementBounding, useWindowSize } from "@vueuse/core";
|
|
3
3
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
4
4
|
export function useCollisionDetection(args) {
|
|
5
5
|
const { id, scrollY, child, parent, offset } = args;
|
|
@@ -25,8 +25,18 @@ export function useCollisionDetection(args) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
+
const { width, height } = useWindowSize();
|
|
29
|
+
const windowBoundingRect = {
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
right: width,
|
|
33
|
+
bottom: height,
|
|
34
|
+
top: shallowRef(0),
|
|
35
|
+
left: shallowRef(0)
|
|
36
|
+
};
|
|
28
37
|
const childBoundingRect = useElementBounding(child);
|
|
29
38
|
const parentBoundingRect = useElementBounding(parent);
|
|
39
|
+
const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
|
|
30
40
|
const mappedOffset = { top: 0, bottom: 0, ...offset };
|
|
31
41
|
const lastScrollY = shallowRef(0);
|
|
32
42
|
const scrollDirection = shallowRef();
|
|
@@ -101,7 +111,7 @@ export function useCollisionDetection(args) {
|
|
|
101
111
|
}
|
|
102
112
|
const offset2 = mappedOffset[parentEdge];
|
|
103
113
|
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
104
|
-
const mappedParentEdge = toValue(
|
|
114
|
+
const mappedParentEdge = toValue(mappedParentBoundingRect[parentEdge]) + offset2;
|
|
105
115
|
if (direction === "down" && mappedChildEdge <= mappedParentEdge || direction === "up" && mappedChildEdge >= mappedParentEdge) {
|
|
106
116
|
alerted[direction][childEdge][parentEdge] = true;
|
|
107
117
|
useMagicEmitter().emit("collision", {
|
|
@@ -119,7 +129,7 @@ export function useCollisionDetection(args) {
|
|
|
119
129
|
}
|
|
120
130
|
const offset2 = mappedOffset[parentEdge];
|
|
121
131
|
const mappedChildEdge = toValue(childBoundingRect[childEdge]);
|
|
122
|
-
const mappedParentEdge = toValue(
|
|
132
|
+
const mappedParentEdge = toValue(mappedParentBoundingRect[parentEdge]) + offset2;
|
|
123
133
|
if (direction === "down" && mappedChildEdge >= mappedParentEdge || direction === "up" && mappedChildEdge <= mappedParentEdge) {
|
|
124
134
|
alerted[direction][childEdge][parentEdge] = false;
|
|
125
135
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type MaybeRef, type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { ScrollIntersection } from '../../types/index.js';
|
|
3
|
-
type
|
|
3
|
+
type UseScrollApiArgs = {
|
|
4
4
|
child: MaybeRef<HTMLElement | null | undefined>;
|
|
5
5
|
parent: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
6
6
|
from: ScrollIntersection;
|
|
7
7
|
to: ScrollIntersection;
|
|
8
8
|
};
|
|
9
|
-
export declare function useScrollApi(
|
|
9
|
+
export declare function useScrollApi(args: UseScrollApiArgs): {
|
|
10
10
|
getCalculations: () => void;
|
|
11
11
|
getProgress: () => number;
|
|
12
12
|
};
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ref,
|
|
3
2
|
shallowRef,
|
|
4
3
|
inject,
|
|
5
4
|
toValue
|
|
6
5
|
} from "vue";
|
|
7
|
-
import { useWindowSize } from "@vueuse/core";
|
|
8
|
-
import { MagicScrollReturn } from "../../symbols/index.mjs";
|
|
6
|
+
import { useElementBounding, useWindowSize } from "@vueuse/core";
|
|
9
7
|
import { clampValue } from "@maas/vue-equipment/utils";
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { MagicScrollReturn } from "../../symbols/index.mjs";
|
|
9
|
+
export function useScrollApi(args) {
|
|
10
|
+
const { child, parent, from, to } = args;
|
|
12
11
|
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
13
|
-
const childRect = ref(void 0);
|
|
14
|
-
const parentRect = ref(void 0);
|
|
15
12
|
const start = shallowRef(0);
|
|
16
13
|
const end = shallowRef(0);
|
|
17
|
-
const { width
|
|
14
|
+
const { width, height } = useWindowSize();
|
|
15
|
+
const windowBoundingRect = {
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
right: width,
|
|
19
|
+
bottom: height,
|
|
20
|
+
top: shallowRef(0),
|
|
21
|
+
left: shallowRef(0)
|
|
22
|
+
};
|
|
23
|
+
const childBoundingRect = useElementBounding(child);
|
|
24
|
+
const parentBoundingRect = useElementBounding(parent);
|
|
25
|
+
const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
|
|
18
26
|
function splitLocation(location) {
|
|
19
27
|
return {
|
|
20
28
|
child: location.match(/^[a-z]+/)[0],
|
|
@@ -23,55 +31,52 @@ export function useScrollApi(params) {
|
|
|
23
31
|
}
|
|
24
32
|
function getOffsetTop(points) {
|
|
25
33
|
let y = 0;
|
|
26
|
-
if (!childRect.value) return y;
|
|
27
34
|
const scrollY = toValue(scrollReturn?.y) || 0;
|
|
35
|
+
const parentTop = mappedParentBoundingRect.top.value;
|
|
36
|
+
const parentHeight = mappedParentBoundingRect.height.value;
|
|
37
|
+
const childTop = childBoundingRect.top.value;
|
|
38
|
+
const childHeight = childBoundingRect.height.value;
|
|
39
|
+
if (!childHeight) {
|
|
40
|
+
return y;
|
|
41
|
+
}
|
|
28
42
|
switch (points.child) {
|
|
29
43
|
case "top":
|
|
30
|
-
y +=
|
|
44
|
+
y += childTop + scrollY;
|
|
31
45
|
break;
|
|
32
46
|
case "center":
|
|
33
|
-
y +=
|
|
47
|
+
y += childTop + childHeight / 2 + scrollY;
|
|
34
48
|
break;
|
|
35
49
|
case "bottom":
|
|
36
|
-
y +=
|
|
50
|
+
y += childTop + childHeight + scrollY;
|
|
37
51
|
break;
|
|
38
52
|
}
|
|
39
|
-
if (!
|
|
53
|
+
if (!mappedParentBoundingRect.height.value) {
|
|
40
54
|
return y;
|
|
41
55
|
}
|
|
42
|
-
const dimensions = {
|
|
43
|
-
width: toValue(parentRect.value.width),
|
|
44
|
-
height: toValue(parentRect.value.height),
|
|
45
|
-
top: toValue(parentRect.value.top)
|
|
46
|
-
};
|
|
47
56
|
switch (points.parent) {
|
|
48
57
|
case "top":
|
|
49
|
-
y -=
|
|
58
|
+
y -= parentTop;
|
|
50
59
|
break;
|
|
51
60
|
case "center":
|
|
52
|
-
y -=
|
|
61
|
+
y -= parentTop + parentHeight / 2;
|
|
53
62
|
break;
|
|
54
63
|
case "bottom":
|
|
55
|
-
y -=
|
|
64
|
+
y -= parentTop + parentHeight;
|
|
56
65
|
break;
|
|
57
66
|
case "initial":
|
|
58
|
-
y -=
|
|
67
|
+
y -= childTop + scrollY;
|
|
59
68
|
break;
|
|
60
69
|
}
|
|
61
70
|
return y;
|
|
62
71
|
}
|
|
63
72
|
function getCalculations() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
width: windowWidth.value,
|
|
67
|
-
height: windowHeight.value,
|
|
68
|
-
top: 0
|
|
69
|
-
};
|
|
73
|
+
childBoundingRect.update();
|
|
74
|
+
parentBoundingRect.update();
|
|
70
75
|
start.value = getOffsetTop(splitLocation(from));
|
|
71
76
|
end.value = getOffsetTop(splitLocation(to));
|
|
72
77
|
}
|
|
73
78
|
function getProgress() {
|
|
74
|
-
const scrollY = toValue(scrollReturn?.y)
|
|
79
|
+
const scrollY = toValue(scrollReturn?.y) ?? 0;
|
|
75
80
|
const total = Math.abs(end.value - start.value);
|
|
76
81
|
const current = scrollY - start.value;
|
|
77
82
|
return clampValue(current / total, 0, 1);
|
|
@@ -63,14 +63,8 @@ import "@maas/vue-equipment/utils/css/animations/slide-rtl-in.css";
|
|
|
63
63
|
import "@maas/vue-equipment/utils/css/animations/slide-rtl-out.css";
|
|
64
64
|
import { useToastListener } from "../composables/private/useToastListener";
|
|
65
65
|
const { id, options } = defineProps({
|
|
66
|
-
id: {
|
|
67
|
-
|
|
68
|
-
required: true
|
|
69
|
-
},
|
|
70
|
-
options: {
|
|
71
|
-
type: Object,
|
|
72
|
-
required: false
|
|
73
|
-
}
|
|
66
|
+
id: { type: null, required: true },
|
|
67
|
+
options: { type: Object, required: false }
|
|
74
68
|
});
|
|
75
69
|
const mappedId = toValue(id);
|
|
76
70
|
defineOptions({
|
|
@@ -31,14 +31,8 @@ import { useToastState } from "../composables/private/useToastState";
|
|
|
31
31
|
import { useToastDrag } from "../composables/private/useToastDrag";
|
|
32
32
|
import "@maas/vue-equipment/utils/css/transitions/fade.css";
|
|
33
33
|
const { id, index } = defineProps({
|
|
34
|
-
id: {
|
|
35
|
-
|
|
36
|
-
required: true
|
|
37
|
-
},
|
|
38
|
-
index: {
|
|
39
|
-
type: Number,
|
|
40
|
-
required: true
|
|
41
|
-
}
|
|
34
|
+
id: { type: String, required: true },
|
|
35
|
+
index: { type: Number, required: true }
|
|
42
36
|
});
|
|
43
37
|
const instanceId = inject(MagicToastInstanceId, void 0);
|
|
44
38
|
if (!instanceId) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maas/vue-equipment",
|
|
3
3
|
"description": "Our Frontend Toolkit, Free and Open Source",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.19",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Robin Scholz",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"volta": {
|
|
141
141
|
"node": "20.18.1"
|
|
142
142
|
},
|
|
143
|
-
"packageManager": "pnpm@10.
|
|
143
|
+
"packageManager": "pnpm@10.8.0",
|
|
144
144
|
"pnpm": {
|
|
145
145
|
"overrides": {
|
|
146
146
|
"typescript": "catalog:"
|
package/dist/nuxt/module.cjs
DELETED
package/dist/nuxt/module.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
plugins?: string[] | boolean;
|
|
5
|
-
composables?: string[] | boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
|
-
|
|
9
|
-
export { _default as default };
|
|
10
|
-
export type { ModuleOptions };
|
package/dist/nuxt/types.d.ts
DELETED