@maas/vue-equipment 0.26.1 → 0.26.2

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/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.26.0"
4
+ "version": "0.26.1"
5
5
  }
@@ -4,7 +4,7 @@ const functions$1 = [
4
4
  {
5
5
  name: "MagicCommand",
6
6
  "package": "plugins",
7
- lastUpdated: 1708958249000,
7
+ lastUpdated: 1713883907000,
8
8
  docs: "https://maas.egineering/vue-equipment/plugins/MagicCommand/",
9
9
  description: "command"
10
10
  },
@@ -53,7 +53,7 @@ const functions$1 = [
53
53
  {
54
54
  name: "MagicScroll",
55
55
  "package": "plugins",
56
- lastUpdated: 1707310473000,
56
+ lastUpdated: 1713883907000,
57
57
  docs: "https://maas.egineering/vue-equipment/plugins/MagicScroll/",
58
58
  description: "scroll"
59
59
  },
@@ -4,6 +4,7 @@ interface Props {
4
4
  }
5
5
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
6
6
  export default _default;
7
+
7
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
9
  type __VLS_TypePropsToOption<T> = {
9
10
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1,6 +1,6 @@
1
1
  import { useCommandApi } from './src/composables/useCommandApi.js';
2
2
  import { useCommandEmitter } from './src/composables/useCommandEmitter.js';
3
- import { CommandInstanceId, CommandOptionsKey } from './src/symbols.js';
3
+ import { CommandInstanceId, CommandOptionsKey } from './src/symbols/index.js';
4
4
  import type { Plugin } from 'vue';
5
5
  import type { CommandEvents } from './src/types/index.js';
6
6
  declare const MagicCommandPlugin: Plugin;
@@ -8,8 +8,9 @@ export default defineNuxtModule({
8
8
  meta: {
9
9
  name: "@maas/vue-equipment/nuxt/MagicDrawer"
10
10
  },
11
- setup() {
11
+ setup(_options, nuxt) {
12
12
  const resolver = createResolver(import.meta.url);
13
+ nuxt.options.build.transpile.push("wheel-gestures");
13
14
  addComponentsDir({
14
15
  path: resolver.resolve("src/components"),
15
16
  global: true,
@@ -17,6 +17,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
17
17
  speed: number;
18
18
  }, {}>, {
19
19
  default?(_: {}): any;
20
+ default?(_: {}): any;
20
21
  }>;
21
22
  export default _default;
22
23
  type __VLS_WithDefaults<P, D> = {
@@ -6,9 +6,9 @@ import MagicScrollCollision from './src/components/MagicScrollCollision.vue.js';
6
6
  import { useCollisionEmitter } from './src/composables/useCollisionEmitter.js';
7
7
  import { useScrollApi } from './src/composables/useScrollApi.js';
8
8
  import { useCollisionDetect } from './src/composables/useCollisionDetect.js';
9
- import { ScrollParentKey, ScrollPositionKey, ScrollProgressKey } from './src/symbols.js';
9
+ import { ScrollParentKey, ScrollPositionKey, ScrollProgressKey } from './src/symbols/index.js';
10
10
  import type { Plugin } from 'vue';
11
11
  declare const MagicScrollPlugin: Plugin;
12
12
  export { MagicScrollPlugin, MagicScrollProvider, MagicScrollScene, MagicScrollTransform, MagicScrollMotion, MagicScrollCollision, useCollisionEmitter, useScrollApi, useCollisionDetect, ScrollParentKey, ScrollPositionKey, ScrollProgressKey, };
13
- export * from './src/symbols.js';
13
+ export * from './src/symbols/index.js';
14
14
  export type * from './src/types/index';
@@ -43,10 +43,17 @@
43
43
  </template>
44
44
 
45
45
  <script setup lang="ts">
46
- import { uuid } from '@maas/vue-equipment/utils'
46
+ import {
47
+ toValue,
48
+ ref,
49
+ watch,
50
+ onBeforeMount,
51
+ onUnmounted,
52
+ type MaybeRef,
53
+ } from 'vue'
47
54
  import { defu } from 'defu'
48
- import { toValue, ref, watch, type MaybeRef } from 'vue'
49
55
  import { onClickOutside, type MaybeElement } from '@vueuse/core'
56
+ import { uuid } from '@maas/vue-equipment/utils'
50
57
  import { defaultOptions } from './../utils/defaultOptions'
51
58
  import { useToastApi } from './../composables/useToastApi'
52
59
  import { useToastCallback } from './../composables/private/useToastCallback'
@@ -69,7 +76,7 @@ interface MagicToastProps {
69
76
 
70
77
  const props = defineProps<MagicToastProps>()
71
78
 
72
- const { toasts, count, oldest } = useToastApi(props.id)
79
+ const { toasts, count, oldest, initialize, destroy } = useToastApi(props.id)
73
80
 
74
81
  const mappedOptions = defu(props.options, defaultOptions)
75
82
  const isExpanded = ref(mappedOptions.layout?.expand === true)
@@ -111,10 +118,20 @@ function outsideClickCallback() {
111
118
  }
112
119
 
113
120
  onClickOutside(listRef, outsideClickCallback)
121
+
122
+ // Lifecycle hooks and listeners
114
123
  watch(
115
124
  () => props.id,
116
125
  () => (teleportKey.value = uuid())
117
126
  )
127
+
128
+ onBeforeMount(() => {
129
+ initialize()
130
+ })
131
+
132
+ onUnmounted(() => {
133
+ destroy(toValue(props.id))
134
+ })
118
135
  </script>
119
136
 
120
137
  <style>
@@ -7,5 +7,7 @@ export declare function useToastApi(id?: MaybeRef<string>): {
7
7
  add: (options: AddArgs) => Promise<string | undefined>;
8
8
  remove: (id: string) => void;
9
9
  clear: () => void;
10
+ initialize: () => import("./../types").ToastInstance | undefined;
11
+ destroy: (id: string) => void;
10
12
  };
11
13
  export type UseToastApiReturn = ReturnType<typeof useToastApi>;
@@ -1,11 +1,5 @@
1
1
  import { uuid } from "@maas/vue-equipment/utils";
2
- import {
3
- computed,
4
- onUnmounted,
5
- onBeforeMount,
6
- toValue,
7
- markRaw
8
- } from "vue";
2
+ import { computed, toValue, markRaw } from "vue";
9
3
  import { useToastStore } from "./private/useToastStore.mjs";
10
4
  export function useToastApi(id) {
11
5
  const { findInstance, addInstance, removeInstance } = useToastStore();
@@ -43,18 +37,14 @@ export function useToastApi(id) {
43
37
  return;
44
38
  instance.value.toasts = [];
45
39
  }
46
- onBeforeMount(() => {
47
- initialize();
48
- });
49
- onUnmounted(() => {
50
- destroy(toValue(mappedId));
51
- });
52
40
  return {
53
41
  toasts,
54
42
  count,
55
43
  oldest,
56
44
  add,
57
45
  remove,
58
- clear
46
+ clear,
47
+ initialize,
48
+ destroy
59
49
  };
60
50
  }
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.26.1",
4
+ "version": "0.26.2",
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",