@maas/vue-equipment 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/nuxt/module.json +1 -1
  2. package/dist/nuxt/module.mjs +15 -28
  3. package/dist/plugins/MagicConsent/src/composables/private/defineConsentApi.mjs +1 -1
  4. package/dist/plugins/MagicModal/src/components/MagicModal.vue +2 -2
  5. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +4 -4
  6. package/dist/plugins/MagicModal/src/composables/useModalApi.mjs +1 -1
  7. package/dist/plugins/MagicModal/src/utils/defaultOptions.d.ts +1 -1
  8. package/dist/plugins/MagicNoise/src/utils/defaultOptions.d.ts +1 -1
  9. package/dist/plugins/MagicPlayer/src/composables/private/useControlsApi.mjs +1 -1
  10. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerInternalApi.mjs +1 -1
  11. package/dist/plugins/MagicPlayer/src/composables/usePlayerApi.mjs +1 -1
  12. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +1 -1
  13. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +1 -1
  14. package/dist/plugins/MagicScroll/src/composables/useScrollApi.mjs +1 -1
  15. package/dist/plugins/MagicToast/src/components/MagicToast.vue +6 -6
  16. package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +5 -5
  17. package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +1 -1
  18. package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +2 -2
  19. package/dist/plugins/MagicToast/src/composables/useToastApi.mjs +1 -1
  20. package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
  21. package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +1 -1
  22. package/dist/utils/{index.d.cts → index.d.mts} +9 -1
  23. package/dist/utils/index.d.ts +9 -1
  24. package/dist/utils/index.js +34 -2
  25. package/dist/utils/index.js.map +1 -1
  26. package/dist/utils/{index.cjs → index.mjs} +3 -35
  27. package/dist/utils/index.mjs.map +1 -0
  28. package/package.json +2 -4
  29. package/dist/utils/index.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.12.1"
4
+ "version": "0.13.0"
5
5
  }
@@ -1,20 +1,6 @@
1
1
  import { defineNuxtModule, createResolver, extendViteConfig, installModule, addImportsSources } from '@nuxt/kit';
2
2
 
3
- const packages = {
4
- composables: {
5
- name: "composables",
6
- display: "Vue Equipment Composables",
7
- description: "A magic collection of Vue composables",
8
- dir: "packages/composables"
9
- },
10
- plugins: {
11
- name: "plugins",
12
- display: "Vue Equipment Plugins",
13
- description: "A magic collection of Vue plugins",
14
- dir: "packages/plugins"
15
- }
16
- };
17
- const functions = [
3
+ const functions$1 = [
18
4
  {
19
5
  name: "MagicConsent",
20
6
  "package": "plugins",
@@ -100,10 +86,11 @@ const functions = [
100
86
  description: "attach viewport dimensions as css variables to the document"
101
87
  }
102
88
  ];
103
- const metadata = {
104
- packages: packages,
105
- functions: functions
106
- };
89
+
90
+ const functions = functions$1;
91
+ functions.map((f) => f.name);
92
+ const plugins = functions.filter((p) => p.package === "plugins");
93
+ const composables = functions.filter((p) => p.package === "composables");
107
94
 
108
95
  const module = defineNuxtModule({
109
96
  meta: {
@@ -115,8 +102,8 @@ const module = defineNuxtModule({
115
102
  composables: true
116
103
  },
117
104
  async setup(options, nuxt) {
118
- let plugins;
119
- let composables;
105
+ let mappedPlugins;
106
+ let mappedComposables;
120
107
  const resolver = createResolver(import.meta.url);
121
108
  nuxt.options.build.transpile.push("@maas/vue-equipment");
122
109
  extendViteConfig((config) => {
@@ -130,24 +117,24 @@ const module = defineNuxtModule({
130
117
  nuxt.options.alias[`@maas/vue-equipment/${pkg}`] = nuxt.options.alias[`@maas/vue-equipment/${pkg}`] || resolver.resolve(`../${pkg}`);
131
118
  });
132
119
  if (options.plugins === true) {
133
- plugins = metadata.functions.filter((fn) => fn.package === "plugins").map((fn) => fn.name);
120
+ mappedPlugins = plugins.map((fn) => fn.name);
134
121
  } else {
135
- plugins = options.plugins || [];
122
+ mappedPlugins = options.plugins || [];
136
123
  }
137
- for (const plugin of plugins) {
124
+ for (const plugin of mappedPlugins) {
138
125
  const nuxtPlugin = await resolver.resolvePath(
139
126
  `@maas/vue-equipment/plugins/${plugin}/nuxt`
140
127
  );
141
128
  await installModule(nuxtPlugin);
142
129
  }
143
130
  if (options.composables === true) {
144
- composables = metadata.functions.filter((fn) => fn.package === "composables").map((fn) => fn.name);
131
+ mappedComposables = composables.map((fn) => fn.name);
145
132
  } else {
146
- composables = options.composables || [];
133
+ mappedComposables = options.composables || [];
147
134
  }
148
135
  addImportsSources({
149
- from: "composables",
150
- imports: composables
136
+ from: "@maas/vue-equipment/composables",
137
+ imports: mappedComposables
151
138
  });
152
139
  }
153
140
  });
@@ -1,5 +1,5 @@
1
1
  import { ref } from "vue";
2
- import { slugify } from "utils";
2
+ import { slugify } from "@maas/vue-equipment/utils";
3
3
  export const globalApiState = ref({
4
4
  cookies: {},
5
5
  maxAge: void 0
@@ -71,8 +71,8 @@ import { useModalCallback } from '../composables/private/useModalCallback'
71
71
 
72
72
  import type { ModalOptions } from './../types/index'
73
73
 
74
- import 'utils/css/animations/fade-in.css'
75
- import 'utils/css/animations/fade-out.css'
74
+ import '@maas/vue-equipment/utils/css/animations/fade-in.css'
75
+ import '@maas/vue-equipment/utils/css/animations/fade-out.css'
76
76
 
77
77
  // Prevent keys array from being merged with default
78
78
  const customDefu = createDefu((obj, key, value) => {
@@ -1,7 +1,7 @@
1
1
  import { type Component, type MaybeRef } from 'vue';
2
2
  import type { ModalOptions } from './../types/index';
3
- import 'utils/css/animations/fade-in.css';
4
- import 'utils/css/animations/fade-out.css';
3
+ import '@maas/vue-equipment/utils/css/animations/fade-in.css';
4
+ import '@maas/vue-equipment/utils/css/animations/fade-out.css';
5
5
  interface MagicModalProps {
6
6
  id: MaybeRef<string>;
7
7
  class?: MaybeRef<string>;
@@ -10,9 +10,9 @@ interface MagicModalProps {
10
10
  options?: ModalOptions;
11
11
  }
12
12
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicModalProps>, {
13
- options: () => RequireAll<ModalOptions>;
13
+ options: () => import("../../../../../packages/utils").RequireAll<ModalOptions>;
14
14
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MagicModalProps>, {
15
- options: () => RequireAll<ModalOptions>;
15
+ options: () => import("../../../../../packages/utils").RequireAll<ModalOptions>;
16
16
  }>>>, {
17
17
  options: ModalOptions;
18
18
  }, {}>, {
@@ -1,4 +1,4 @@
1
- import { uuid } from "utils";
1
+ import { uuid } from "@maas/vue-equipment/utils";
2
2
  import { ref, computed, toValue } from "vue";
3
3
  import { defu } from "defu";
4
4
  import { useScrollLock } from "@vueuse/core";
@@ -1,4 +1,4 @@
1
1
  import type { ModalOptions } from '../types/index.js';
2
- import type { RequireAll } from 'utils';
2
+ import type { RequireAll } from '@maas/vue-equipment/utils';
3
3
  declare const defaultOptions: RequireAll<ModalOptions>;
4
4
  export { defaultOptions };
@@ -1,4 +1,4 @@
1
1
  import type { NoiseOptions } from '../types/index.js';
2
- import type { RequireAll } from 'utils';
2
+ import type { RequireAll } from '@maas/vue-equipment/utils';
3
3
  declare const defaultOptions: RequireAll<NoiseOptions>;
4
4
  export { defaultOptions };
@@ -4,7 +4,7 @@ import {
4
4
  useEventListener,
5
5
  defaultWindow
6
6
  } from "@vueuse/core";
7
- import { clampValue, mapValue } from "utils";
7
+ import { clampValue, mapValue } from "@maas/vue-equipment/utils";
8
8
  import { usePlayerStore } from "./usePlayerStore.mjs";
9
9
  export function useControlsApi(args) {
10
10
  const { findInstance } = usePlayerStore();
@@ -1,6 +1,6 @@
1
1
  import { ref, watch, toValue } from "vue";
2
2
  import { useFullscreen } from "@vueuse/core";
3
- import { isIOS } from "utils";
3
+ import { isIOS } from "@maas/vue-equipment/utils";
4
4
  import { usePlayerStore } from "./usePlayerStore.mjs";
5
5
  export function usePlayerInternalApi(args) {
6
6
  const touched = ref(false);
@@ -1,4 +1,4 @@
1
- import { uuid } from "utils";
1
+ import { uuid } from "@maas/vue-equipment/utils";
2
2
  import { computed, onUnmounted, toValue } from "vue";
3
3
  import { usePlayerStore } from "./private/usePlayerStore.mjs";
4
4
  import { usePlayerInternalApi } from "./private/usePlayerInternalApi.mjs";
@@ -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 {
22
22
  ScrollPositionKey,
@@ -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
  interface Props {
4
4
  from?: FromTo;
@@ -1,7 +1,7 @@
1
1
  import { ref, inject, toValue } from "vue";
2
2
  import { useWindowSize } from "@vueuse/core";
3
3
  import { ScrollPositionKey } from "../symbols/index.mjs";
4
- import { clampValue } from "utils";
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);
@@ -43,7 +43,7 @@
43
43
  </template>
44
44
 
45
45
  <script setup lang="ts">
46
- import { uuid } from 'utils'
46
+ import { uuid } from '@maas/vue-equipment/utils'
47
47
  import { defu } from 'defu'
48
48
  import { toValue, ref, watch, type MaybeRef } from 'vue'
49
49
  import { onClickOutside, type MaybeElement } from '@vueuse/core'
@@ -55,11 +55,11 @@ import MagicToastComponent from './MagicToastComponent.vue'
55
55
 
56
56
  import type { ToastOptions } from './../types/index'
57
57
 
58
- import 'utils/css/animations/fade-out.css'
59
- import 'utils/css/animations/slide-ltr-in.css'
60
- import 'utils/css/animations/slide-rtl-in.css'
61
- import 'utils/css/animations/slide-ttb-in.css'
62
- import 'utils/css/animations/slide-btt-in.css'
58
+ import '@maas/vue-equipment/utils/css/animations/fade-out.css'
59
+ import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css'
60
+ import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css'
61
+ import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css'
62
+ import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css'
63
63
 
64
64
  interface MagicToastProps {
65
65
  id: MaybeRef<string>
@@ -1,10 +1,10 @@
1
1
  import { type MaybeRef } from 'vue';
2
2
  import type { ToastOptions } from './../types/index';
3
- import 'utils/css/animations/fade-out.css';
4
- import 'utils/css/animations/slide-ltr-in.css';
5
- import 'utils/css/animations/slide-rtl-in.css';
6
- import 'utils/css/animations/slide-ttb-in.css';
7
- import 'utils/css/animations/slide-btt-in.css';
3
+ import '@maas/vue-equipment/utils/css/animations/fade-out.css';
4
+ import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
5
+ import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css';
6
+ import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css';
7
+ import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css';
8
8
  interface MagicToastProps {
9
9
  id: MaybeRef<string>;
10
10
  class: MaybeRef<string>;
@@ -1,4 +1,4 @@
1
- import { uuid } from "utils";
1
+ import { uuid } from "@maas/vue-equipment/utils";
2
2
  export function useToastInternalApi() {
3
3
  function removeToastAfterTimeout(id, duration, ctx) {
4
4
  if (duration > 0) {
@@ -1,4 +1,4 @@
1
- import type { ToastInstance } from '../../types.js';
1
+ import type { ToastInstance, AddArgs } 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: any) => string;
11
+ add: (args: AddArgs) => string;
12
12
  remove: (id: string) => void;
13
13
  }[]>;
14
14
  findInstance: (id: string) => ToastInstance | undefined;
@@ -1,4 +1,4 @@
1
- import { uuid } from "utils";
1
+ import { uuid } from "@maas/vue-equipment/utils";
2
2
  import {
3
3
  computed,
4
4
  onUnmounted,
@@ -1,5 +1,5 @@
1
1
  import type { MaybeRef } from 'vue';
2
- import type { PickPartial } from 'utils';
2
+ import type { PickPartial } from '@maas/vue-equipment/utils';
3
3
  type Toast = {
4
4
  id: string;
5
5
  component: Object;
@@ -1,4 +1,4 @@
1
1
  import type { ToastOptions } from '../types/index.js';
2
- import type { RequireAll } from 'utils';
2
+ import type { RequireAll } from '@maas/vue-equipment/utils';
3
3
  declare const defaultOptions: RequireAll<ToastOptions>;
4
4
  export { defaultOptions };
@@ -17,4 +17,12 @@ interface SlugifyOptions {
17
17
  }
18
18
  declare function slugify(string: string, options?: SlugifyOptions): string;
19
19
 
20
- export { type SlugifyOptions, clampValue, isIOS, mapValue, slugify, uniq, uuid };
20
+ type PickPartial<T, K extends keyof T> = {
21
+ [P in K]: Partial<T[P]>;
22
+ };
23
+
24
+ type RequireAll<T> = {
25
+ [P in keyof T]-?: T[P];
26
+ };
27
+
28
+ export { type PickPartial, type RequireAll, type SlugifyOptions, clampValue, isIOS, mapValue, slugify, uniq, uuid };
@@ -17,4 +17,12 @@ interface SlugifyOptions {
17
17
  }
18
18
  declare function slugify(string: string, options?: SlugifyOptions): string;
19
19
 
20
- export { type SlugifyOptions, clampValue, isIOS, mapValue, slugify, uniq, uuid };
20
+ type PickPartial<T, K extends keyof T> = {
21
+ [P in K]: Partial<T[P]>;
22
+ };
23
+
24
+ type RequireAll<T> = {
25
+ [P in keyof T]-?: T[P];
26
+ };
27
+
28
+ export { type PickPartial, type RequireAll, type SlugifyOptions, clampValue, isIOS, mapValue, slugify, uniq, uuid };
@@ -1,3 +1,34 @@
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
+ slugify: () => slugify,
27
+ uniq: () => uniq,
28
+ uuid: () => uuid
29
+ });
30
+ module.exports = __toCommonJS(utils_exports);
31
+
1
32
  // src/functions/clampValue.ts
2
33
  function clampValue(value, min, max) {
3
34
  return value <= min ? min : value >= max ? max : value;
@@ -64,12 +95,13 @@ function slugify(string, options) {
64
95
  }
65
96
  return slug;
66
97
  }
67
- export {
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
68
100
  clampValue,
69
101
  isIOS,
70
102
  mapValue,
71
103
  slugify,
72
104
  uniq,
73
105
  uuid
74
- };
106
+ });
75
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../packages/utils/src/functions/clampValue.ts","../../packages/utils/src/functions/isIOS.ts","../../packages/utils/src/functions/mapValue.ts","../../packages/utils/src/functions/uuid.ts","../../packages/utils/src/functions/uniq.ts","../../packages/utils/src/functions/slugify.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","// This implementation is meant for internal use only.\n// It is only used to generate a unique IDs for the `key` props.\n// It should not replace crypto.randomUUID() or window.crypto.randomUUID().\n\nexport function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'\n .split('')\n .reduce(\n (c, i) =>\n c +\n (i === 'x'\n ? Math.floor(Math.random() * 0xf).toString(16)\n : i === 'y'\n ? Math.floor(Math.random() * 4 + 8).toString(16)\n : i),\n '',\n )\n}\n","export function uniq<T extends any[]>(a: T) {\n return Array.from(new Set(a))\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"],"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,uCAAW,SAAS;AACrD;;;ACHO,SAAS,SACd,OACA,OACA,OACA,QACA,QACA;AACA,UAAS,QAAQ,UAAU,SAAS,WAAY,QAAQ,SAAS;AACnE;;;ACJO,SAAS,OAAO;AACrB,SAAO,uCACJ,MAAM,EAAE,EACR;AAAA,IACC,CAAC,GAAG,MACF,KACC,MAAM,MACH,KAAK,MAAM,KAAK,OAAO,IAAI,EAAG,EAAE,SAAS,EAAE,IAC3C,MAAM,MACN,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC,EAAE,SAAS,EAAE,IAC7C;AAAA,IACN;AAAA,EACF;AACJ;;;ACjBO,SAAS,KAAsB,GAAM;AAC1C,SAAO,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;AAC9B;;;ACMA,IAAM,iBAAiC;AAAA,EACrC,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AACb;AAEO,SAAS,QAAQ,QAAgB,SAAkC;AACxE,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAGA,QAAM,WAAW,EAAE,GAAG,gBAAgB,GAAG,QAAQ;AAEjD,QAAM,UAAqC,CAAC;AAE5C,MAAI,OAAO,OACR,UAAU,EACV,MAAM,EAAE,EACR,OAAO,SAAU,QAAQ,IAAI;AAC5B,QAAI,aAAa,QAAQ,EAAE;AAC3B,QAAI,eAAe;AAAW,mBAAa;AAC3C,QAAI,gBAAe,qCAAU;AAAW,mBAAa;AACrD,WACE,SACA,WAAW,SAAQ,qCAAU,WAAU,4BAA4B,EAAE;AAAA,EAEzE,GAAG,EAAE;AAEP,MAAI,SAAS,QAAQ;AACnB,WAAO,KAAK,QAAQ,mBAAmB,EAAE;AAAA,EAC3C;AAEA,MAAI,SAAS,MAAM;AACjB,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,MAAI,SAAS,WAAW;AACtB,WAAO,KAAK,QAAQ,OAAO,SAAS,SAAS;AAAA,EAC/C;AAEA,MAAI,SAAS,WAAW;AACtB,WAAO,KAAK,kBAAkB;AAAA,EAChC;AAEA,SAAO;AACT;","names":[]}
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","../../packages/utils/src/functions/uuid.ts","../../packages/utils/src/functions/uniq.ts","../../packages/utils/src/functions/slugify.ts"],"sourcesContent":["export * from './src/functions/clampValue'\nexport * from './src/functions/isIOS'\nexport * from './src/functions/mapValue'\nexport * from './src/functions/uuid'\nexport * from './src/functions/uniq'\nexport * from './src/functions/slugify'\n\nexport type * from './src/types'\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","// This implementation is meant for internal use only.\n// It is only used to generate a unique IDs for the `key` props.\n// It should not replace crypto.randomUUID() or window.crypto.randomUUID().\n\nexport function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'\n .split('')\n .reduce(\n (c, i) =>\n c +\n (i === 'x'\n ? Math.floor(Math.random() * 0xf).toString(16)\n : i === 'y'\n ? Math.floor(Math.random() * 4 + 8).toString(16)\n : i),\n '',\n )\n}\n","export function uniq<T extends any[]>(a: T) {\n return Array.from(new Set(a))\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,uCAAW,SAAS;AACrD;;;ACHO,SAAS,SACd,OACA,OACA,OACA,QACA,QACA;AACA,UAAS,QAAQ,UAAU,SAAS,WAAY,QAAQ,SAAS;AACnE;;;ACJO,SAAS,OAAO;AACrB,SAAO,uCACJ,MAAM,EAAE,EACR;AAAA,IACC,CAAC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wnPropertyDescriptor;
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
- slugify: () => slugify,
27
- uniq: () => uniq,
28
- uuid: () => uuid
29
- });
30
- module.exports = __toCommonJS(utils_exports);
31
-
32
1
  // src/functions/clampValue.ts
33
2
  function clampValue(value, min, max) {
34
3
  return value <= min ? min : value >= max ? max : value;
@@ -95,13 +64,12 @@ function slugify(string, options) {
95
64
  }
96
65
  return slug;
97
66
  }
98
- // Annotate the CommonJS export names for ESM import in node:
99
- 0 && (module.exports = {
67
+ export {
100
68
  clampValue,
101
69
  isIOS,
102
70
  mapValue,
103
71
  slugify,
104
72
  uniq,
105
73
  uuid
106
- });
107
- //# sourceMappingURL=index.cjs.map
74
+ };
75
+ //# 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","../../packages/utils/src/functions/uuid.ts","../../packages/utils/src/functions/uniq.ts","../../packages/utils/src/functions/slugify.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","// This implementation is meant for internal use only.\n// It is only used to generate a unique IDs for the `key` props.\n// It should not replace crypto.randomUUID() or window.crypto.randomUUID().\n\nexport function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'\n .split('')\n .reduce(\n (c, i) =>\n c +\n (i === 'x'\n ? Math.floor(Math.random() * 0xf).toString(16)\n : i === 'y'\n ? Math.floor(Math.random() * 4 + 8).toString(16)\n : i),\n '',\n )\n}\n","export function uniq<T extends any[]>(a: T) {\n return Array.from(new Set(a))\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"],"mappings":";AAAO,SAAS,WAAW,OAAe,KAAa,KAAa;AAClE,SAAO,SAA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,EAC3C;AAEA,MAAI,SAAS,MAAM;AACjB,WAAO,KAAK,KAAK;AAAA,EACnB;AAEA,MAAI,SAAS,WAAW;AACtB,WAAO,KAAK,QAAQ,OAAO,SAAS,SAAS;AAAA,EAC/C;AAEA,MAAI,SAAS,WAAW;AACtB,WAAO,KAAK,kBAAkB;AAAA,EAChC;AAEA,SAAO;AACT;","names":[]}
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.13.0",
4
+ "version": "0.13.1",
5
5
  "author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
6
6
  "devDependencies": {
7
7
  "@antfu/ni": "^0.21.12",
@@ -40,7 +40,6 @@
40
40
  ],
41
41
  "keywords": [],
42
42
  "license": "MIT",
43
- "main": "./dist/nuxt/module.cjs",
44
43
  "peerDependencies": {
45
44
  "@maas/magic-timer": "^1.0.0",
46
45
  "@vueuse/core": "^10.3.0",
@@ -51,7 +50,7 @@
51
50
  "mitt": "^3.0.1",
52
51
  "motion": "^10.16.2",
53
52
  "nuxt": "^3.5.1",
54
- "universal-cookie": "^6.1.1"
53
+ "universal-cookie": "4.0.4"
55
54
  },
56
55
  "peerDependenciesMeta": {
57
56
  "@maas/magic-timer": {
@@ -96,7 +95,6 @@
96
95
  "uninstall": "nlx rimraf --glob ./**/node_modules --glob ./**/pnpm-lock.yaml",
97
96
  "release": "turbo run t:release && release-it"
98
97
  },
99
- "types": "./dist/nuxt/types.d.ts",
100
98
  "volta": {
101
99
  "node": "18.16.1"
102
100
  },
@@ -1 +0,0 @@
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","../../packages/utils/src/functions/uuid.ts","../../packages/utils/src/functions/uniq.ts","../../packages/utils/src/functions/slugify.ts"],"sourcesContent":["export * from './src/functions/clampValue'\nexport * from './src/functions/isIOS'\nexport * from './src/functions/mapValue'\nexport * from './src/functions/uuid'\nexport * from './src/functions/uniq'\nexport * from './src/functions/slugify'\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","// This implementation is meant for internal use only.\n// It is only used to generate a unique IDs for the `key` props.\n// It should not replace crypto.randomUUID() or window.crypto.randomUUID().\n\nexport function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'\n .split('')\n .reduce(\n (c, i) =>\n c +\n (i === 'x'\n ? Math.floor(Math.random() * 0xf).toString(16)\n : i === 'y'\n ? Math.floor(Math.random() * 4 + 8).toString(16)\n : i),\n '',\n )\n}\n","export function uniq<T extends any[]>(a: T) {\n return Array.from(new Set(a))\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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,uCAAW,SAAS;AACrD;;;ACHO,SAAS,SACd,OACA,OACA,OACA,QACA,QACA;AACA,UAAS,QAAQ,UAAU,SAAS,WAAY,QAAQ,SAAS;AACnE;;;ACJO,SAAS,OAAO;AACrB,SAAO,uCACJ,MAAM,EAAE,EACR;AAAA,IACC,CAAC,GAAG,MACF,KACC,MAAM,MACH,KAAK,MAAM,KAAK,OAAO,IAAI,EAAG,EAAE,SAAS,EAAE,IAC3C,MAAM,MACN,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC,EAAE,SAAS,EAAE,IAC7C;AAAA,IACN;AAAA,EACF;AACJ;;;ACjBO,SAAS,KAAsB,GAAM;AAC1C,SAAO,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;AAC9B;;;ACMA,IAAM,iBAAiC;AAAA,EACrC,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AACb;AAEO,SAAS,QAAQ,QAAgB,SAAkC;AACxE,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAGA,QAAM,WAAW,EAAE,GAAG,gBAAgB,GAAG,QAAQ;AAEjD,QAAM,UAAqC,CAAC;AAE5C,MAAI,OAAO,OACR,UAAU,EAC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