@maas/vue-equipment 0.6.1 → 0.7.0

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.6.0"
4
+ "version": "0.6.1"
5
5
  }
@@ -5,7 +5,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}
5
5
  seekedTime: import("vue").Ref<number>;
6
6
  seekedPercentage: import("vue").Ref<number>;
7
7
  scrubbedPercentage: import("vue").Ref<number>;
8
- bufferedPercentage: import("vue").ComputedRef<number>;
8
+ bufferedPercentage: import("vue").ComputedRef<any>;
9
9
  thumbPercentage: import("vue").Ref<number>;
10
10
  popoverOffsetX: import("vue").Ref<number>;
11
11
  onMouseEnter: () => void;
@@ -5,7 +5,7 @@ export declare function useControlsApi(args: UseControlsArgs): {
5
5
  seekedTime: import("vue").Ref<number>;
6
6
  seekedPercentage: import("vue").Ref<number>;
7
7
  scrubbedPercentage: import("vue").Ref<number>;
8
- bufferedPercentage: import("vue").ComputedRef<number>;
8
+ bufferedPercentage: import("vue").ComputedRef<any>;
9
9
  thumbPercentage: import("vue").Ref<number>;
10
10
  popoverOffsetX: import("vue").Ref<number>;
11
11
  onMouseEnter: () => void;
@@ -4,7 +4,7 @@ import {
4
4
  useEventListener,
5
5
  defaultWindow
6
6
  } from "@vueuse/core";
7
- import { clampValue, mapValue } from "./../utils/index.mjs";
7
+ import { clampValue, mapValue } from "@maas/vue-equipment/utils";
8
8
  import { useInjectPlayer } from "./usePlayer.mjs";
9
9
  export function useControlsApi(args) {
10
10
  const { mediaApi, playerApi } = useInjectPlayer();
@@ -33,7 +33,7 @@ declare const ControlsApiInjectionKey: InjectionKey<{
33
33
  seekedTime: import("vue").Ref<number>;
34
34
  seekedPercentage: import("vue").Ref<number>;
35
35
  scrubbedPercentage: import("vue").Ref<number>;
36
- bufferedPercentage: import("vue").ComputedRef<number>;
36
+ bufferedPercentage: import("vue").ComputedRef<any>;
37
37
  thumbPercentage: import("vue").Ref<number>;
38
38
  popoverOffsetX: import("vue").Ref<number>;
39
39
  onMouseEnter: () => void;
@@ -1,4 +1 @@
1
1
  export declare function formatTime(s: number): string;
2
- export declare function clampValue(value: number, min: number, max: number): number;
3
- export declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
4
- export declare function isIOS(): boolean;
@@ -6,14 +6,3 @@ export function formatTime(s) {
6
6
  const secondsString = seconds < 10 ? `0${seconds}` : `${seconds}`;
7
7
  return `${hours > 0 ? `${hours}:` : ""}${minutesString}:${secondsString}`;
8
8
  }
9
- export function clampValue(value, min, max) {
10
- return value <= min ? min : value >= max ? max : value;
11
- }
12
- export function mapValue(value, inMin, inMax, outMin, outMax) {
13
- return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
14
- }
15
- export function isIOS() {
16
- if (typeof window === "undefined")
17
- return false;
18
- return /iPad|iPhone|iPod/.test(navigator?.userAgent);
19
- }
@@ -16,7 +16,7 @@ import {
16
16
  readonly,
17
17
  } from 'vue'
18
18
  import { useIntersectionObserver } from '@vueuse/core'
19
- import { mapValue } from '../utils'
19
+ import { mapValue } from '@maas/vue-equipment/utils'
20
20
  import { useScrollApi } from '../composables/useScrollApi'
21
21
  import { ScrollPositionKey, ScrollParentKey, ScrollProgressKey } from '../types'
22
22
 
@@ -1,4 +1,4 @@
1
- import { mapValue } from '../utils';
1
+ import { mapValue } from '@maas/vue-equipment/utils';
2
2
  import type { FromTo } from '../types';
3
3
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
4
  to: {
@@ -8,7 +8,7 @@ type UseScrollApiParams = {
8
8
  };
9
9
  export declare function useScrollApi(params: UseScrollApiParams): {
10
10
  getCalculations: () => void;
11
- getProgress: () => number;
11
+ getProgress: () => any;
12
12
  };
13
13
  export type UseScrollApiReturn = ReturnType<typeof useScrollApi>;
14
14
  export {};
@@ -1,7 +1,7 @@
1
1
  import { ref, inject, toValue } from "vue";
2
2
  import { useElementBounding, useWindowSize } from "@vueuse/core";
3
3
  import { ScrollPositionKey } from "../types/index.mjs";
4
- import { clampValue } from "../utils/index.mjs";
4
+ import { clampValue } from "@maas/vue-equipment/utils";
5
5
  export function useScrollApi(params) {
6
6
  const { child, parent, from, to } = params;
7
7
  const scrollPosition = inject(ScrollPositionKey, void 0);
@@ -1,4 +1,4 @@
1
- import type { ToastInstance, AddArgs } from '../../types.js';
1
+ import type { ToastInstance } from '../../types.js';
2
2
  export declare function useToastStore(): {
3
3
  toastStore: import("vue").Ref<{
4
4
  id: string;
@@ -8,7 +8,7 @@ export declare function useToastStore(): {
8
8
  props?: Record<string, any> | undefined;
9
9
  remove: Function;
10
10
  }[];
11
- add: (args: AddArgs) => string;
11
+ add: (args: any) => string;
12
12
  remove: (id: string) => void;
13
13
  }[]>;
14
14
  findInstance: (id: string) => ToastInstance | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { MaybeRef } from 'vue';
2
+ import type { PickPartial } from '@maas/vue-equipment/utils/types/PickPartial';
2
3
  type Toast = {
3
4
  id: string;
4
5
  component: Object;
@@ -36,7 +37,7 @@ type ToastEvents = {
36
37
  leave: string;
37
38
  afterLeave: string;
38
39
  };
39
- type AddArgs = Pick<Toast, 'component' | 'props'> & {
40
+ type AddArgs = Pick<Toast, 'component'> & PickPartial<Toast, 'props'> & {
40
41
  duration?: number;
41
42
  };
42
43
  export type { Toast, ToastInstance, Options, ActiveElement, ToastEvents, AddArgs, };
@@ -0,0 +1,7 @@
1
+ declare function clampValue(value: number, min: number, max: number): number;
2
+
3
+ declare function isIOS(): boolean;
4
+
5
+ declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
6
+
7
+ export { clampValue, isIOS, mapValue };
@@ -0,0 +1,7 @@
1
+ declare function clampValue(value: number, min: number, max: number): number;
2
+
3
+ declare function isIOS(): boolean;
4
+
5
+ declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
6
+
7
+ export { clampValue, isIOS, mapValue };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ clampValue: () => clampValue,
24
+ isIOS: () => isIOS,
25
+ mapValue: () => mapValue
26
+ });
27
+ module.exports = __toCommonJS(utils_exports);
28
+
29
+ // src/functions/clampValue.ts
30
+ function clampValue(value, min, max) {
31
+ return value <= min ? min : value >= max ? max : value;
32
+ }
33
+
34
+ // src/functions/isIOS.ts
35
+ function isIOS() {
36
+ if (typeof window === "undefined")
37
+ return false;
38
+ return /iPad|iPhone|iPod/.test(navigator?.userAgent);
39
+ }
40
+
41
+ // src/functions/mapValue.ts
42
+ function mapValue(value, inMin, inMax, outMin, outMax) {
43
+ return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
44
+ }
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ clampValue,
48
+ isIOS,
49
+ mapValue
50
+ });
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../packages/utils/index.ts","../../packages/utils/src/functions/clampValue.ts","../../packages/utils/src/functions/isIOS.ts","../../packages/utils/src/functions/mapValue.ts"],"sourcesContent":["export * from './src/functions/clampValue'\nexport * from './src/functions/isIOS'\nexport * from './src/functions/mapValue'\n","export function clampValue(value: number, min: number, max: number) {\n return value <= min ? min : value >= max ? max : value\n}\n","export function isIOS() {\n if (typeof window === 'undefined') return false\n return /iPad|iPhone|iPod/.test(navigator?.userAgent)\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,WAAW,OAAe,KAAa,KAAa;AAClE,SAAO,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM;AACnD;;;ACFO,SAAS,QAAQ;AACtB,MAAI,OAAO,WAAW;AAAa,WAAO;AAC1C,SAAO,mBAAmB,KAAK,WAAW,SAAS;AACrD;;;ACHO,SAAS,SACd,OACA,OACA,OACA,QACA,QACA;AACA,UAAS,QAAQ,UAAU,SAAS,WAAY,QAAQ,SAAS;AACnE;","names":[]}
@@ -0,0 +1,22 @@
1
+ // src/functions/clampValue.ts
2
+ function clampValue(value, min, max) {
3
+ return value <= min ? min : value >= max ? max : value;
4
+ }
5
+
6
+ // src/functions/isIOS.ts
7
+ function isIOS() {
8
+ if (typeof window === "undefined")
9
+ return false;
10
+ return /iPad|iPhone|iPod/.test(navigator?.userAgent);
11
+ }
12
+
13
+ // src/functions/mapValue.ts
14
+ function mapValue(value, inMin, inMax, outMin, outMax) {
15
+ return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
16
+ }
17
+ export {
18
+ clampValue,
19
+ isIOS,
20
+ mapValue
21
+ };
22
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../packages/utils/src/functions/clampValue.ts","../../packages/utils/src/functions/isIOS.ts","../../packages/utils/src/functions/mapValue.ts"],"sourcesContent":["export function clampValue(value: number, min: number, max: number) {\n return value <= min ? min : value >= max ? max : value\n}\n","export function isIOS() {\n if (typeof window === 'undefined') return false\n return /iPad|iPhone|iPod/.test(navigator?.userAgent)\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"],"mappings":";AAAO,SAAS,WAAW,OAAe,KAAa,KAAa;AAClE,SAAO,SAAS,MAAM,MAAM,SAAS,MAAM,MAAM;AACnD;;;ACFO,SAAS,QAAQ;AACtB,MAAI,OAAO,WAAW;AAAa,WAAO;AAC1C,SAAO,mBAAmB,KAAK,WAAW,SAAS;AACrD;;;ACHO,SAAS,SACd,OACA,OACA,OACA,QACA,QACA;AACA,UAAS,QAAQ,UAAU,SAAS,WAAY,QAAQ,SAAS;AACnE;","names":[]}
@@ -0,0 +1,4 @@
1
+ type PickPartial<T, K extends keyof T> = {
2
+ [P in K]: Partial<T[P]>;
3
+ };
4
+ export type { PickPartial };
@@ -0,0 +1,3 @@
1
+ type PickPartial<T, K extends keyof T> = { [P in K]: Partial<T[P]> }
2
+
3
+ export type { PickPartial }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "A magic collection of Vue composables, plugins, components and directives",
4
- "version": "0.6.1",
4
+ "version": "0.7.0",
5
5
  "author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
6
6
  "devDependencies": {
7
7
  "@antfu/ni": "^0.21.5",
@@ -45,6 +45,11 @@
45
45
  "./plugins": {
46
46
  "types": "./dist/plugins/index.d.ts",
47
47
  "import": "./dist/plugins/index.mjs"
48
+ },
49
+ "./utils": {
50
+ "types": "./dist/utils/index.d.ts",
51
+ "require": "./dist/utils/index.js",
52
+ "import": "./dist/utils/index.mjs"
48
53
  }
49
54
  },
50
55
  "files": [
@@ -1,2 +0,0 @@
1
- export declare function clampValue(value: number, min: number, max: number): number;
2
- export declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
@@ -1,6 +0,0 @@
1
- export function clampValue(value, min, max) {
2
- return value <= min ? min : value >= max ? max : value;
3
- }
4
- export function mapValue(value, inMin, inMax, outMin, outMax) {
5
- return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
6
- }