@maas/vue-equipment 1.0.0-beta.7 → 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/nuxt/module.json +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +11 -8
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +3 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +2 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +3 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +1 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +32 -12
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +32 -12
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +33 -13
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +1 -1
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +32 -12
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +9 -9
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +31 -13
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.js +25 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -11,6 +11,7 @@ import { MagicAccordionInstanceId, MagicAccordionViewId } from "../symbols";
|
|
|
11
11
|
export default /* @__PURE__ */ _defineComponent({
|
|
12
12
|
__name: "MagicAccordionTrigger",
|
|
13
13
|
props: {
|
|
14
|
+
viewId: { type: String, required: false },
|
|
14
15
|
disabled: { type: null, required: false, default: false },
|
|
15
16
|
trigger: { type: String, required: false, default: "click" },
|
|
16
17
|
asChild: { type: Boolean, required: false, default: false }
|
|
@@ -18,28 +19,29 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
18
19
|
setup(__props) {
|
|
19
20
|
const elRef = useTemplateRef("el");
|
|
20
21
|
const instanceId = inject(MagicAccordionInstanceId, void 0);
|
|
21
|
-
const
|
|
22
|
+
const injectedViewId = inject(MagicAccordionViewId, void 0);
|
|
23
|
+
const mappedViewId = computed(() => __props.viewId ?? injectedViewId);
|
|
22
24
|
if (!instanceId) {
|
|
23
25
|
throw new Error(
|
|
24
26
|
"MagicAccordionTrigger must be nested inside MagicAccordionProvider"
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
if (!
|
|
29
|
+
if (!mappedViewId.value) {
|
|
28
30
|
throw new Error(
|
|
29
|
-
"MagicAccordionTrigger must be nested inside MagicAccordionView"
|
|
31
|
+
"MagicAccordionTrigger must be nested inside MagicAccordionView or a viewId must be provided"
|
|
30
32
|
);
|
|
31
33
|
}
|
|
32
34
|
const { initializeState } = useAccordionState(instanceId);
|
|
33
35
|
const state = initializeState();
|
|
34
36
|
const { getView } = useAccordionView(instanceId);
|
|
35
|
-
const view = getView(
|
|
37
|
+
const view = getView(mappedViewId.value);
|
|
36
38
|
const mappedDisabled = computed(
|
|
37
39
|
() => toValue(__props.disabled) || state.options.disabled
|
|
38
40
|
);
|
|
39
41
|
const { onMouseenter, onClick, onEnter } = useAccordionTrigger({
|
|
40
|
-
instanceId,
|
|
41
|
-
viewId,
|
|
42
42
|
elRef,
|
|
43
|
+
instanceId,
|
|
44
|
+
viewId: mappedViewId.value,
|
|
43
45
|
disabled: __props.disabled,
|
|
44
46
|
trigger: __props.trigger
|
|
45
47
|
});
|
|
@@ -48,9 +50,10 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
48
50
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
49
51
|
ref: "el",
|
|
50
52
|
"as-child": _ctx.asChild,
|
|
53
|
+
"data-id": `${mappedViewId.value}-trigger`,
|
|
51
54
|
"data-disabled": mappedDisabled.value,
|
|
52
|
-
class: "magic-accordion-trigger",
|
|
53
55
|
as: "button",
|
|
56
|
+
class: "magic-accordion-trigger",
|
|
54
57
|
onMouseenter: _unref(onMouseenter),
|
|
55
58
|
onClick: _unref(onClick)
|
|
56
59
|
}, {
|
|
@@ -61,7 +64,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
61
64
|
]),
|
|
62
65
|
_: 3
|
|
63
66
|
/* FORWARDED */
|
|
64
|
-
}, 8, ["as-child", "data-disabled", "onMouseenter", "onClick"]);
|
|
67
|
+
}, 8, ["as-child", "data-id", "data-disabled", "onMouseenter", "onClick"]);
|
|
65
68
|
};
|
|
66
69
|
}
|
|
67
70
|
});
|
|
@@ -2,10 +2,12 @@ import { type MaybeRef } from 'vue';
|
|
|
2
2
|
import { Primitive } from '@maas/vue-primitive';
|
|
3
3
|
import type { Interaction } from '../types/index.js';
|
|
4
4
|
interface MagicAccordionTriggerProps {
|
|
5
|
+
viewId?: string;
|
|
5
6
|
disabled?: MaybeRef<boolean>;
|
|
6
7
|
trigger?: Interaction;
|
|
7
8
|
asChild?: boolean;
|
|
8
9
|
}
|
|
10
|
+
declare const mappedViewId: import("vue").ComputedRef<string | undefined>;
|
|
9
11
|
declare const view: import("../types").AccordionView | undefined;
|
|
10
12
|
declare const mappedDisabled: import("vue").ComputedRef<boolean | undefined>;
|
|
11
13
|
declare const onMouseenter: () => void, onClick: () => void;
|
|
@@ -18,6 +20,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
|
18
20
|
}>;
|
|
19
21
|
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionTriggerProps, {
|
|
20
22
|
Primitive: typeof Primitive;
|
|
23
|
+
mappedViewId: typeof mappedViewId;
|
|
21
24
|
view: typeof view;
|
|
22
25
|
mappedDisabled: typeof mappedDisabled;
|
|
23
26
|
onMouseenter: typeof onMouseenter;
|
|
@@ -38,6 +38,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
38
38
|
return (_ctx, _cache) => {
|
|
39
39
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
40
40
|
"as-child": _ctx.asChild,
|
|
41
|
+
"data-id": mappedId.value,
|
|
41
42
|
"data-active": _unref(view)?.active,
|
|
42
43
|
class: "magic-accordion-view"
|
|
43
44
|
}, {
|
|
@@ -48,7 +49,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
48
49
|
]),
|
|
49
50
|
_: 3
|
|
50
51
|
/* FORWARDED */
|
|
51
|
-
}, 8, ["as-child", "data-active"]);
|
|
52
|
+
}, 8, ["as-child", "data-id", "data-active"]);
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
});
|
|
@@ -4,6 +4,7 @@ interface MagicAccordionViewProps {
|
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
}
|
|
7
|
+
declare const mappedId: import("vue").ComputedRef<string>;
|
|
7
8
|
declare const view: import("../types").AccordionView;
|
|
8
9
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
10
|
declare var __VLS_6: {
|
|
@@ -14,6 +15,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
|
14
15
|
}>;
|
|
15
16
|
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionViewProps, {
|
|
16
17
|
Primitive: typeof Primitive;
|
|
18
|
+
mappedId: typeof mappedId;
|
|
17
19
|
view: typeof view;
|
|
18
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
21
|
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -73,6 +73,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
73
73
|
provide(MagicCommandProviderOptions, mappedOptions);
|
|
74
74
|
return (_ctx, _cache) => {
|
|
75
75
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
76
|
+
"data-id": _ctx.id,
|
|
76
77
|
"as-child": _ctx.asChild,
|
|
77
78
|
class: "magic-command-provider"
|
|
78
79
|
}, {
|
|
@@ -81,7 +82,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
81
82
|
]),
|
|
82
83
|
_: 3
|
|
83
84
|
/* FORWARDED */
|
|
84
|
-
}, 8, ["as-child"]);
|
|
85
|
+
}, 8, ["data-id", "as-child"]);
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
});
|
|
@@ -36,7 +36,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
if (!mappedViewId.value) {
|
|
39
|
-
throw new Error(
|
|
39
|
+
throw new Error(
|
|
40
|
+
"MagicCommandTrigger must be nested inside MagicCommandView or a viewId must be provided"
|
|
41
|
+
);
|
|
40
42
|
}
|
|
41
43
|
const { getView } = useCommandView(instanceId);
|
|
42
44
|
const view = getView(mappedViewId.value);
|
|
@@ -329,10 +329,10 @@ export function useDraggableDrag(args) {
|
|
|
329
329
|
function onPointerdown(e) {
|
|
330
330
|
const scrollLockValue = toValue(scrollLock);
|
|
331
331
|
if (scrollLockValue) {
|
|
332
|
-
lockScroll();
|
|
333
332
|
if (typeof scrollLockValue === "object" && scrollLockValue.padding) {
|
|
334
333
|
addScrollLockPadding();
|
|
335
334
|
}
|
|
335
|
+
lockScroll();
|
|
336
336
|
}
|
|
337
337
|
if (dragging.value) {
|
|
338
338
|
return;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { shallowRef, ref } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
matchClass,
|
|
5
|
+
scrollbarWidth,
|
|
6
|
+
scrollbarGutterSupport
|
|
7
|
+
} from "@maas/vue-equipment/utils";
|
|
4
8
|
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
9
|
export function useDraggableScrollLock() {
|
|
6
10
|
const positionFixedElements = ref([]);
|
|
@@ -13,24 +17,40 @@ export function useDraggableScrollLock() {
|
|
|
13
17
|
function addScrollLockPadding() {
|
|
14
18
|
if (typeof window === "undefined") return;
|
|
15
19
|
const exclude = new RegExp(/magic-draggable/);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
document.body.style.setProperty(
|
|
21
|
+
"--scrollbar-width",
|
|
22
|
+
`${scrollbarWidth()}px`
|
|
23
|
+
);
|
|
19
24
|
positionFixedElements.value = [
|
|
20
25
|
...document.body.getElementsByTagName("*")
|
|
21
26
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
27
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
26
28
|
);
|
|
29
|
+
switch (scrollbarGutterSupport()) {
|
|
30
|
+
case true:
|
|
31
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
32
|
+
positionFixedElements.value.forEach((elem) => {
|
|
33
|
+
elem.style.scrollbarGutter = "stable";
|
|
34
|
+
elem.style.overflow = "auto";
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
case false:
|
|
38
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
39
|
+
positionFixedElements.value.forEach(
|
|
40
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
41
|
+
);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
46
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
47
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
document.body.style.paddingRight = "";
|
|
49
|
+
positionFixedElements.value.forEach((elem) => {
|
|
50
|
+
elem.style.paddingRight = "";
|
|
51
|
+
elem.style.scrollbarGutter = "";
|
|
52
|
+
elem.style.overflow = "";
|
|
53
|
+
});
|
|
34
54
|
}
|
|
35
55
|
return {
|
|
36
56
|
lockScroll,
|
|
@@ -22,13 +22,13 @@ type SnapToArgs = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare function useDraggableSnap(args: UseDraggableSnapArgs): {
|
|
24
24
|
mappedSnapPoints: import("@vueuse/core").ComputedRefWithControl<Coordinates[]>;
|
|
25
|
-
activeSnapPoint: Ref<("center" | "
|
|
25
|
+
activeSnapPoint: Ref<("center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
26
26
|
x?: number | undefined;
|
|
27
27
|
y?: number | undefined;
|
|
28
|
-
} | undefined] | undefined, "center" | "
|
|
28
|
+
} | undefined] | undefined, "center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
29
29
|
x?: number;
|
|
30
30
|
y?: number;
|
|
31
|
-
} | undefined] | ["center" | "
|
|
31
|
+
} | undefined] | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
32
32
|
x?: number | undefined;
|
|
33
33
|
y?: number | undefined;
|
|
34
34
|
} | undefined] | undefined>;
|
|
@@ -77,7 +77,7 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
79
|
backdrop: boolean;
|
|
80
|
-
tag: "
|
|
80
|
+
tag: "div" | "dialog";
|
|
81
81
|
focusTrap: boolean | import("focus-trap").Options;
|
|
82
82
|
scrollLock: {
|
|
83
83
|
padding: boolean;
|
|
@@ -127,7 +127,7 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
127
127
|
}>, "close"> & {
|
|
128
128
|
close: (false | string[] | undefined) & (false | string[]);
|
|
129
129
|
});
|
|
130
|
-
position: "
|
|
130
|
+
position: "right" | "left" | "top" | "bottom";
|
|
131
131
|
snapPoints: import("../types/index").DrawerSnapPoint[];
|
|
132
132
|
initial: {
|
|
133
133
|
open?: boolean;
|
|
@@ -2,7 +2,11 @@ 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,
|
|
@@ -36,24 +40,40 @@ export function useDrawerDOM(args) {
|
|
|
36
40
|
function addScrollLockPadding() {
|
|
37
41
|
if (typeof window === "undefined") return;
|
|
38
42
|
const exclude = new RegExp(/magic-drawer(__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,
|
|
@@ -29,7 +29,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
29
29
|
}
|
|
30
30
|
if (!mappedViewId.value) {
|
|
31
31
|
throw new Error(
|
|
32
|
-
"
|
|
32
|
+
"MagicMenuRemote must be nested inside MagicMenuView or a viewId must be provided"
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
if (!__props.channelId) {
|
|
@@ -24,10 +24,10 @@ export function useMenuCallback(args) {
|
|
|
24
24
|
emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
|
|
25
25
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
26
26
|
if (scrollLock) {
|
|
27
|
-
lockScroll();
|
|
28
27
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
29
28
|
addScrollLockPadding();
|
|
30
29
|
}
|
|
30
|
+
lockScroll();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function onBeforeLeave() {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
matchClass,
|
|
5
|
+
scrollbarGutterSupport,
|
|
6
|
+
scrollbarWidth
|
|
7
|
+
} from "@maas/vue-equipment/utils";
|
|
4
8
|
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
9
|
export function useMenuDOM() {
|
|
6
10
|
const positionFixedElements = ref([]);
|
|
@@ -12,25 +16,41 @@ export function useMenuDOM() {
|
|
|
12
16
|
}
|
|
13
17
|
function addScrollLockPadding() {
|
|
14
18
|
if (typeof window === "undefined") return;
|
|
15
|
-
const exclude = new RegExp(/magic-menu
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const exclude = new RegExp(/magic-menu/);
|
|
20
|
+
document.body.style.setProperty(
|
|
21
|
+
"--scrollbar-width",
|
|
22
|
+
`${scrollbarWidth()}px`
|
|
23
|
+
);
|
|
19
24
|
positionFixedElements.value = [
|
|
20
25
|
...document.body.getElementsByTagName("*")
|
|
21
26
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
27
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
26
28
|
);
|
|
29
|
+
switch (scrollbarGutterSupport()) {
|
|
30
|
+
case true:
|
|
31
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
32
|
+
positionFixedElements.value.forEach((elem) => {
|
|
33
|
+
elem.style.scrollbarGutter = "stable";
|
|
34
|
+
elem.style.overflow = "auto";
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
case false:
|
|
38
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
39
|
+
positionFixedElements.value.forEach(
|
|
40
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
41
|
+
);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
46
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
47
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
document.body.style.paddingRight = "";
|
|
49
|
+
positionFixedElements.value.forEach((elem) => {
|
|
50
|
+
elem.style.paddingRight = "";
|
|
51
|
+
elem.style.scrollbarGutter = "";
|
|
52
|
+
elem.style.overflow = "";
|
|
53
|
+
});
|
|
34
54
|
}
|
|
35
55
|
return {
|
|
36
56
|
lockScroll,
|
|
@@ -13,7 +13,7 @@ declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> &
|
|
|
13
13
|
backdrop?: string;
|
|
14
14
|
};
|
|
15
15
|
backdrop: boolean;
|
|
16
|
-
tag: "
|
|
16
|
+
tag: "div" | "dialog";
|
|
17
17
|
focusTrap: boolean | import("focus-trap").Options;
|
|
18
18
|
scrollLock: boolean | {
|
|
19
19
|
padding: boolean;
|
|
@@ -2,7 +2,11 @@ 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,
|
|
@@ -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,
|
|
@@ -38,31 +38,31 @@ import { MagicPlayerInstanceId } from "../symbols";
|
|
|
38
38
|
export default /* @__PURE__ */ _defineComponent({
|
|
39
39
|
__name: "MagicPlayerAudioControls",
|
|
40
40
|
props: {
|
|
41
|
-
|
|
41
|
+
instanceId: { type: String, required: false }
|
|
42
42
|
},
|
|
43
43
|
setup(__props) {
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
44
|
+
const injectedInstanceId = inject(MagicPlayerInstanceId, void 0);
|
|
45
|
+
const mappedInstanceId = computed(() => __props.instanceId ?? injectedInstanceId);
|
|
46
|
+
if (!mappedInstanceId.value) {
|
|
47
47
|
throw new Error(
|
|
48
|
-
"MagicAudioPlayerControls must be nested inside MagicAudioPlayer or
|
|
48
|
+
"MagicAudioPlayerControls must be nested inside MagicAudioPlayer or an instanceId must be provided."
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
const barRef = useTemplateRef("bar");
|
|
52
52
|
const trackRef = useTemplateRef("track");
|
|
53
53
|
const { playing, waiting } = usePlayerMediaApi({
|
|
54
|
-
id:
|
|
54
|
+
id: mappedInstanceId.value
|
|
55
55
|
});
|
|
56
56
|
const { play, pause, touched, mouseEntered } = usePlayerAudioApi({
|
|
57
|
-
id:
|
|
57
|
+
id: mappedInstanceId.value
|
|
58
58
|
});
|
|
59
59
|
usePlayerControlsApi({
|
|
60
|
-
id:
|
|
60
|
+
id: mappedInstanceId.value,
|
|
61
61
|
barRef,
|
|
62
62
|
trackRef
|
|
63
63
|
});
|
|
64
64
|
const { idle } = useIdle(3e3);
|
|
65
|
-
provide(MagicPlayerInstanceId,
|
|
65
|
+
provide(MagicPlayerInstanceId, mappedInstanceId.value);
|
|
66
66
|
return (_ctx, _cache) => {
|
|
67
67
|
const _component_magic_player_display_time = _resolveComponent("magic-player-display-time");
|
|
68
68
|
const _component_magic_player_timeline = _resolveComponent("magic-player-timeline");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IconPlay from './icons/Play.vue.js';
|
|
2
2
|
import IconPause from './icons/Pause.vue.js';
|
|
3
3
|
interface MagicAudioPlayerControlsProps {
|
|
4
|
-
|
|
4
|
+
instanceId?: string;
|
|
5
5
|
}
|
|
6
6
|
declare const playing: import("vue").ShallowRef<boolean, boolean>, waiting: import("vue").ShallowRef<boolean, boolean>;
|
|
7
7
|
declare const play: () => void, pause: () => void, touched: import("vue").ShallowRef<boolean, boolean>, mouseEntered: import("vue").ShallowRef<boolean, boolean>;
|
|
@@ -257,10 +257,10 @@ export function useToastDrag(args) {
|
|
|
257
257
|
function onPointerdown(e) {
|
|
258
258
|
const scrollLockValue = toValue(scrollLock);
|
|
259
259
|
if (scrollLockValue) {
|
|
260
|
-
lockScroll();
|
|
261
260
|
if (typeof scrollLockValue === "object" && scrollLockValue.padding) {
|
|
262
261
|
addScrollLockPadding();
|
|
263
262
|
}
|
|
263
|
+
lockScroll();
|
|
264
264
|
}
|
|
265
265
|
if (dragging.value) {
|
|
266
266
|
return;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
scrollbarGutterSupport,
|
|
5
|
+
scrollbarWidth
|
|
6
|
+
} from "@maas/vue-equipment/utils";
|
|
4
7
|
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
8
|
export function useToastScrollLock() {
|
|
6
9
|
const positionFixedElements = ref([]);
|
|
@@ -12,25 +15,40 @@ export function useToastScrollLock() {
|
|
|
12
15
|
}
|
|
13
16
|
function addScrollLockPadding() {
|
|
14
17
|
if (typeof window === "undefined") return;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
document.body.style.setProperty(
|
|
19
|
+
"--scrollbar-width",
|
|
20
|
+
`${scrollbarWidth()}px`
|
|
21
|
+
);
|
|
19
22
|
positionFixedElements.value = [
|
|
20
23
|
...document.body.getElementsByTagName("*")
|
|
21
24
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" &&
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
25
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px"
|
|
26
26
|
);
|
|
27
|
+
switch (scrollbarGutterSupport()) {
|
|
28
|
+
case true:
|
|
29
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
30
|
+
positionFixedElements.value.forEach((elem) => {
|
|
31
|
+
elem.style.scrollbarGutter = "stable";
|
|
32
|
+
elem.style.overflow = "auto";
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
case false:
|
|
36
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
37
|
+
positionFixedElements.value.forEach(
|
|
38
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
39
|
+
);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
27
42
|
}
|
|
28
43
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
44
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
45
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
document.body.style.paddingRight = "";
|
|
47
|
+
positionFixedElements.value.forEach((elem) => {
|
|
48
|
+
elem.style.paddingRight = "";
|
|
49
|
+
elem.style.scrollbarGutter = "";
|
|
50
|
+
elem.style.overflow = "";
|
|
51
|
+
});
|
|
34
52
|
}
|
|
35
53
|
return {
|
|
36
54
|
lockScroll,
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ interface GuardedReleasePointerCaptureArgs {
|
|
|
51
51
|
declare function guardedSetPointerCapture(args: GuardedSetPointerCaptureArgs): void;
|
|
52
52
|
declare function guardedReleasePointerCapture(args: GuardedReleasePointerCaptureArgs): void;
|
|
53
53
|
|
|
54
|
+
declare function scrollbarGutterSupport(): boolean;
|
|
55
|
+
|
|
56
|
+
declare function scrollbarWidth(): number;
|
|
57
|
+
|
|
54
58
|
interface SlugifyOptions {
|
|
55
59
|
separator?: string;
|
|
56
60
|
trim?: boolean;
|
|
@@ -76,4 +80,4 @@ type RequireAllNested<T> = {
|
|
|
76
80
|
|
|
77
81
|
type ValueOf<T> = T[keyof T];
|
|
78
82
|
|
|
79
|
-
export { type InterpolateArgs, type PickPartial, type RequireAll, type RequireAllNested, type SlugifyOptions, type ValueOf, clampValue, easeInCubic, easeInOutCubic, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInQuad, easeInQuart, easeInQuint, easeOutBack, easeOutCubic, easeOutQuad, easeOutQuart, easeOutQuint, formatTime, guardedReleasePointerCapture, guardedSetPointerCapture, interpolate, isIOS, isWithinRange, linear, mapValue, matchClass, slugify, uniq };
|
|
83
|
+
export { type InterpolateArgs, type PickPartial, type RequireAll, type RequireAllNested, type SlugifyOptions, type ValueOf, clampValue, easeInCubic, easeInOutCubic, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInQuad, easeInQuart, easeInQuint, easeOutBack, easeOutCubic, easeOutQuad, easeOutQuart, easeOutQuint, formatTime, guardedReleasePointerCapture, guardedSetPointerCapture, interpolate, isIOS, isWithinRange, linear, mapValue, matchClass, scrollbarGutterSupport, scrollbarWidth, slugify, uniq };
|
package/dist/utils/index.js
CHANGED
|
@@ -131,6 +131,29 @@ function guardedReleasePointerCapture(args) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// src/functions/scrollbarGutterSupport.ts
|
|
135
|
+
function scrollbarGutterSupport() {
|
|
136
|
+
return CSS.supports("scrollbar-gutter", "stable");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// src/functions/scrollbarWidth.ts
|
|
140
|
+
function scrollbarWidth() {
|
|
141
|
+
const wrapper = document.createElement("div");
|
|
142
|
+
wrapper.style.position = "absolute";
|
|
143
|
+
wrapper.style.visibility = "hidden";
|
|
144
|
+
wrapper.style.overflow = "hidden";
|
|
145
|
+
wrapper.style.width = "100px";
|
|
146
|
+
wrapper.style.height = "100px";
|
|
147
|
+
wrapper.style.top = "-9999px";
|
|
148
|
+
wrapper.innerHTML = '<div style="width: 200px; height: 200px;"></div>';
|
|
149
|
+
document.body.appendChild(wrapper);
|
|
150
|
+
const withoutScrollbar = wrapper.clientWidth;
|
|
151
|
+
wrapper.style.overflow = "scroll";
|
|
152
|
+
const withScrollbar = wrapper.clientWidth;
|
|
153
|
+
document.body.removeChild(wrapper);
|
|
154
|
+
return Math.round(withoutScrollbar - withScrollbar);
|
|
155
|
+
}
|
|
156
|
+
|
|
134
157
|
// src/functions/slugify.ts
|
|
135
158
|
var defaultOptions = {
|
|
136
159
|
separator: "-",
|
|
@@ -194,6 +217,8 @@ export {
|
|
|
194
217
|
linear,
|
|
195
218
|
mapValue,
|
|
196
219
|
matchClass,
|
|
220
|
+
scrollbarGutterSupport,
|
|
221
|
+
scrollbarWidth,
|
|
197
222
|
slugify,
|
|
198
223
|
uniq
|
|
199
224
|
};
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../packages/utils/src/functions/clampValue.ts","../../packages/utils/src/functions/easings.ts","../../packages/utils/src/functions/toNumber.ts","../../packages/utils/src/functions/formatTime.ts","../../packages/utils/src/functions/interpolate.ts","../../packages/utils/src/functions/isIOS.ts","../../packages/utils/src/functions/isWithinRange.ts","../../packages/utils/src/functions/mapValue.ts","../../packages/utils/src/functions/matchClass.ts","../../packages/utils/src/functions/pointerCapture.ts","../../packages/utils/src/functions/slugify.ts","../../packages/utils/src/functions/uniq.ts"],"sourcesContent":["export function clampValue(value: number, min: number, max: number) {\n return value <= min ? min : value >= max ? max : value\n}\n","export function linear(t: number) {\n return t\n}\nexport function easeInQuad(t: number) {\n return t * t\n}\nexport function easeOutQuad(t: number) {\n return t * (2 - t)\n}\nexport function easeInOutQuad(t: number) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t\n}\nexport function easeOutBack(t: number, o: number = 1.25) {\n return 1 + (t - 1) * (t - 1) * ((o + 1) * (t - 1) + o)\n}\nexport function easeInCubic(t: number) {\n return t * t * t\n}\nexport function easeOutCubic(t: number) {\n return --t * t * t + 1\n}\nexport function easeInOutCubic(t: number) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1\n}\nexport function easeInQuart(t: number) {\n return t * t * t * t\n}\nexport function easeOutQuart(t: number) {\n return 1 - --t * t * t * t\n}\nexport function easeInOutQuart(t: number) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t\n}\nexport function easeInQuint(t: number) {\n return t * t * t * t * t\n}\nexport function easeOutQuint(t: number) {\n return 1 + --t * t * t * t * t\n}\nexport function easeInOutQuint(t: number) {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t\n}\n","export function toNumber(value: string | number): number {\n return typeof value === 'string' ? parseFloat(value) : Number(value)\n}\n","import { toNumber } from './toNumber'\n\nexport function formatTime(seconds: number, guide: number) {\n seconds = seconds < 0 ? 0 : seconds\n let s: string | number = Math.floor(seconds % 60)\n let m: string | number = Math.floor((seconds / 60) % 60)\n let h: string | number = Math.floor(seconds / 3600)\n const gm = Math.floor((guide / 60) % 60)\n const gh = Math.floor(guide / 3600)\n\n // handle invalid times\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-'\n }\n\n // Check if we need to show hours\n h = toNumber(h) > 0 || gh > 0 ? h + ':' : ''\n\n // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n m = ((h || gm >= 10) && toNumber(m) < 10 ? '0' + m : m) + ':'\n\n // Check if leading zero is need for seconds\n s = toNumber(s) < 10 ? '0' + s : s\n\n return h + m + s\n}\n","export type InterpolateArgs = {\n from: number\n to: number\n duration: number\n easing?: (t: number) => number\n callback: (result: number) => void\n}\n\nexport function interpolate(args: InterpolateArgs) {\n const { from, to, duration, callback, easing = (t) => t * (2 - t) } = args\n\n let startTime: number\n\n function animate(timestamp: number) {\n if (!startTime) startTime = timestamp\n\n const progress = Math.min(1, (timestamp - startTime) / duration)\n const easedProgress = easing(progress)\n const value = from + (to - from) * easedProgress\n\n callback(value)\n\n if (progress < 1) {\n requestAnimationFrame(animate)\n }\n }\n\n requestAnimationFrame(animate)\n}\n","export function isIOS() {\n if (typeof window === 'undefined') return false\n return /iPad|iPhone|iPod/.test(navigator?.userAgent)\n}\n","interface isWithinRangeArgs {\n input: number\n base: number\n threshold: number\n}\n\nexport function isWithinRange(args: isWithinRangeArgs): boolean {\n const { input, base, threshold } = args\n return input >= base - threshold && input <= base + threshold\n}\n","export function mapValue(\n value: number,\n inMin: number,\n inMax: number,\n outMin: number,\n outMax: number\n) {\n return ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin\n}\n","export function matchClass(el: Element, regex: RegExp) {\n return Array.from(el.classList).some((className) => regex.test(className))\n}\n","interface GuardedSetPointerCaptureArgs {\n event: PointerEvent\n element?: Element | null\n debug?: boolean\n}\n\ninterface GuardedReleasePointerCaptureArgs {\n event: PointerEvent\n element?: Element | null\n}\n\nexport function guardedSetPointerCapture(\n args: GuardedSetPointerCaptureArgs\n): void {\n const { event, element, debug } = args\n if (element && event.isPrimary && event.pointerType !== 'mouse') {\n try {\n const coalescedEvents: PointerEvent[] =\n 'getCoalescedEvents' in event ? event.getCoalescedEvents() : [event]\n\n if (coalescedEvents.length > 0) {\n element?.setPointerCapture(event.pointerId)\n }\n } catch (error) {\n if (debug) {\n console.warn('Failed to set pointer capture:', error)\n }\n }\n }\n}\n\nexport function guardedReleasePointerCapture(\n args: GuardedReleasePointerCaptureArgs\n): void {\n const { event, element } = args\n if (element?.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId)\n }\n}\n","export interface SlugifyOptions {\n separator?: string\n trim?: boolean\n remove?: RegExp\n strict?: boolean\n lowercase?: boolean\n}\n\nconst defaultOptions: SlugifyOptions = {\n separator: '-',\n trim: true,\n remove: undefined,\n strict: true,\n lowercase: true,\n}\n\nexport function slugify(string: string, options?: SlugifyOptions): string {\n if (typeof string !== 'string') {\n throw new Error('slugify: string argument expected')\n }\n\n // Merge provided options with default options\n const _options = { ...defaultOptions, ...options }\n\n const charMap: { [key: string]: string } = {}\n\n let slug = string\n .normalize()\n .split('')\n .reduce(function (result, ch) {\n let appendChar = charMap[ch]\n if (appendChar === undefined) appendChar = ch\n if (appendChar === _options?.separator) appendChar = ' '\n return (\n result +\n appendChar.replace(_options?.remove || /[^\\w\\s$*_+~.()'\"!\\-:@]+/g, '')\n )\n }, '')\n\n if (_options.strict) {\n slug = slug.replace(/[^A-Za-z0-9\\s]/g, '')\n }\n\n if (_options.trim) {\n slug = slug.trim()\n }\n\n if (_options.separator) {\n slug = slug.replace(/ +/g, _options.separator)\n }\n\n if (_options.lowercase) {\n slug = slug.toLocaleLowerCase()\n }\n\n return slug\n}\n","export function uniq<T extends unknown[]>(a: T) {\n return Array.from(new Set(a))\n}\n"],"mappings":";AAAO,SAAS,WAAW,OAAe,KAAa,KAAa;AAClE,SAAO,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM;AACnD;;;ACFO,SAAS,OAAO,GAAW;AAChC,SAAO;AACT;AACO,SAAS,WAAW,GAAW;AACpC,SAAO,IAAI;AACb;AACO,SAAS,YAAY,GAAW;AACrC,SAAO,KAAK,IAAI;AAClB;AACO,SAAS,cAAc,GAAW;AACvC,SAAO,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,KAAK;AAClD;AACO,SAAS,YAAY,GAAW,IAAY,MAAM;AACvD,SAAO,KAAK,IAAI,MAAM,IAAI,OAAO,IAAI,MAAM,IAAI,KAAK;AACtD;AACO,SAAS,YAAY,GAAW;AACrC,SAAO,IAAI,IAAI;AACjB;AACO,SAAS,aAAa,GAAW;AACtC,SAAO,EAAE,IAA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,CAAC,CAAC;AAC9B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../packages/utils/src/functions/clampValue.ts","../../packages/utils/src/functions/easings.ts","../../packages/utils/src/functions/toNumber.ts","../../packages/utils/src/functions/formatTime.ts","../../packages/utils/src/functions/interpolate.ts","../../packages/utils/src/functions/isIOS.ts","../../packages/utils/src/functions/isWithinRange.ts","../../packages/utils/src/functions/mapValue.ts","../../packages/utils/src/functions/matchClass.ts","../../packages/utils/src/functions/pointerCapture.ts","../../packages/utils/src/functions/scrollbarGutterSupport.ts","../../packages/utils/src/functions/scrollbarWidth.ts","../../packages/utils/src/functions/slugify.ts","../../packages/utils/src/functions/uniq.ts"],"sourcesContent":["export function clampValue(value: number, min: number, max: number) {\n return value <= min ? min : value >= max ? max : value\n}\n","export function linear(t: number) {\n return t\n}\nexport function easeInQuad(t: number) {\n return t * t\n}\nexport function easeOutQuad(t: number) {\n return t * (2 - t)\n}\nexport function easeInOutQuad(t: number) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t\n}\nexport function easeOutBack(t: number, o: number = 1.25) {\n return 1 + (t - 1) * (t - 1) * ((o + 1) * (t - 1) + o)\n}\nexport function easeInCubic(t: number) {\n return t * t * t\n}\nexport function easeOutCubic(t: number) {\n return --t * t * t + 1\n}\nexport function easeInOutCubic(t: number) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1\n}\nexport function easeInQuart(t: number) {\n return t * t * t * t\n}\nexport function easeOutQuart(t: number) {\n return 1 - --t * t * t * t\n}\nexport function easeInOutQuart(t: number) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t\n}\nexport function easeInQuint(t: number) {\n return t * t * t * t * t\n}\nexport function easeOutQuint(t: number) {\n return 1 + --t * t * t * t * t\n}\nexport function easeInOutQuint(t: number) {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t\n}\n","export function toNumber(value: string | number): number {\n return typeof value === 'string' ? parseFloat(value) : Number(value)\n}\n","import { toNumber } from './toNumber'\n\nexport function formatTime(seconds: number, guide: number) {\n seconds = seconds < 0 ? 0 : seconds\n let s: string | number = Math.floor(seconds % 60)\n let m: string | number = Math.floor((seconds / 60) % 60)\n let h: string | number = Math.floor(seconds / 3600)\n const gm = Math.floor((guide / 60) % 60)\n const gh = Math.floor(guide / 3600)\n\n // handle invalid times\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-'\n }\n\n // Check if we need to show hours\n h = toNumber(h) > 0 || gh > 0 ? h + ':' : ''\n\n // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n m = ((h || gm >= 10) && toNumber(m) < 10 ? '0' + m : m) + ':'\n\n // Check if leading zero is need for seconds\n s = toNumber(s) < 10 ? '0' + s : s\n\n return h + m + s\n}\n","export type InterpolateArgs = {\n from: number\n to: number\n duration: number\n easing?: (t: number) => number\n callback: (result: number) => void\n}\n\nexport function interpolate(args: InterpolateArgs) {\n const { from, to, duration, callback, easing = (t) => t * (2 - t) } = args\n\n let startTime: number\n\n function animate(timestamp: number) {\n if (!startTime) startTime = timestamp\n\n const progress = Math.min(1, (timestamp - startTime) / duration)\n const easedProgress = easing(progress)\n const value = from + (to - from) * easedProgress\n\n callback(value)\n\n if (progress < 1) {\n requestAnimationFrame(animate)\n }\n }\n\n requestAnimationFrame(animate)\n}\n","export function isIOS() {\n if (typeof window === 'undefined') return false\n return /iPad|iPhone|iPod/.test(navigator?.userAgent)\n}\n","interface isWithinRangeArgs {\n input: number\n base: number\n threshold: number\n}\n\nexport function isWithinRange(args: isWithinRangeArgs): boolean {\n const { input, base, threshold } = args\n return input >= base - threshold && input <= base + threshold\n}\n","export function mapValue(\n value: number,\n inMin: number,\n inMax: number,\n outMin: number,\n outMax: number\n) {\n return ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin\n}\n","export function matchClass(el: Element, regex: RegExp) {\n return Array.from(el.classList).some((className) => regex.test(className))\n}\n","interface GuardedSetPointerCaptureArgs {\n event: PointerEvent\n element?: Element | null\n debug?: boolean\n}\n\ninterface GuardedReleasePointerCaptureArgs {\n event: PointerEvent\n element?: Element | null\n}\n\nexport function guardedSetPointerCapture(\n args: GuardedSetPointerCaptureArgs\n): void {\n const { event, element, debug } = args\n if (element && event.isPrimary && event.pointerType !== 'mouse') {\n try {\n const coalescedEvents: PointerEvent[] =\n 'getCoalescedEvents' in event ? event.getCoalescedEvents() : [event]\n\n if (coalescedEvents.length > 0) {\n element?.setPointerCapture(event.pointerId)\n }\n } catch (error) {\n if (debug) {\n console.warn('Failed to set pointer capture:', error)\n }\n }\n }\n}\n\nexport function guardedReleasePointerCapture(\n args: GuardedReleasePointerCaptureArgs\n): void {\n const { event, element } = args\n if (element?.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId)\n }\n}\n","export function scrollbarGutterSupport() {\n return CSS.supports('scrollbar-gutter', 'stable')\n}\n","export function scrollbarWidth() {\n const wrapper = document.createElement('div')\n wrapper.style.position = 'absolute'\n wrapper.style.visibility = 'hidden'\n wrapper.style.overflow = 'hidden'\n wrapper.style.width = '100px'\n wrapper.style.height = '100px'\n wrapper.style.top = '-9999px'\n\n wrapper.innerHTML = '<div style=\"width: 200px; height: 200px;\"></div>'\n document.body.appendChild(wrapper)\n\n // Get the scrollbar width\n const withoutScrollbar = wrapper.clientWidth\n wrapper.style.overflow = 'scroll'\n const withScrollbar = wrapper.clientWidth\n\n // Clean up\n document.body.removeChild(wrapper)\n\n return Math.round(withoutScrollbar - withScrollbar)\n}\n","export interface SlugifyOptions {\n separator?: string\n trim?: boolean\n remove?: RegExp\n strict?: boolean\n lowercase?: boolean\n}\n\nconst defaultOptions: SlugifyOptions = {\n separator: '-',\n trim: true,\n remove: undefined,\n strict: true,\n lowercase: true,\n}\n\nexport function slugify(string: string, options?: SlugifyOptions): string {\n if (typeof string !== 'string') {\n throw new Error('slugify: string argument expected')\n }\n\n // Merge provided options with default options\n const _options = { ...defaultOptions, ...options }\n\n const charMap: { [key: string]: string } = {}\n\n let slug = string\n .normalize()\n .split('')\n .reduce(function (result, ch) {\n let appendChar = charMap[ch]\n if (appendChar === undefined) appendChar = ch\n if (appendChar === _options?.separator) appendChar = ' '\n return (\n result +\n appendChar.replace(_options?.remove || /[^\\w\\s$*_+~.()'\"!\\-:@]+/g, '')\n )\n }, '')\n\n if (_options.strict) {\n slug = slug.replace(/[^A-Za-z0-9\\s]/g, '')\n }\n\n if (_options.trim) {\n slug = slug.trim()\n }\n\n if (_options.separator) {\n slug = slug.replace(/ +/g, _options.separator)\n }\n\n if (_options.lowercase) {\n slug = slug.toLocaleLowerCase()\n }\n\n return slug\n}\n","export function uniq<T extends unknown[]>(a: T) {\n return Array.from(new Set(a))\n}\n"],"mappings":";AAAO,SAAS,WAAW,OAAe,KAAa,KAAa;AAClE,SAAO,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM;AACnD;;;ACFO,SAAS,OAAO,GAAW;AAChC,SAAO;AACT;AACO,SAAS,WAAW,GAAW;AACpC,SAAO,IAAI;AACb;AACO,SAAS,YAAY,GAAW;AACrC,SAAO,KAAK,IAAI;AAClB;AACO,SAAS,cAAc,GAAW;AACvC,SAAO,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,KAAK;AAClD;AACO,SAAS,YAAY,GAAW,IAAY,MAAM;AACvD,SAAO,KAAK,IAAI,MAAM,IAAI,OAAO,IAAI,MAAM,IAAI,KAAK;AACtD;AACO,SAAS,YAAY,GAAW;AACrC,SAAO,IAAI,IAAI;AACjB;AACO,SAAS,aAAa,GAAW;AACtC,SAAO,EAAE,IAAI,IAAI,IAAI;AACvB;AACO,SAAS,eAAe,GAAW;AACxC,SAAO,IAAI,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,IAAI,KAAK;AACzE;AACO,SA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