maz-ui 3.23.2 → 3.23.3

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/nuxt/index.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "3.23.2"
7
+ "version": "3.23.3"
8
8
  }
package/nuxt/index.mjs CHANGED
@@ -117,7 +117,7 @@ const module = defineNuxtModule({
117
117
  if (moduleOptions.injectAos) {
118
118
  addPlugin(resolve(_dirname, "./runtime/plugins/aos"));
119
119
  addImports({
120
- from: "maz-ui",
120
+ from: resolve(_dirname, "./runtime/composables/use-aos"),
121
121
  name: "useAos",
122
122
  as: "useAos"
123
123
  });
@@ -131,7 +131,7 @@ const module = defineNuxtModule({
131
131
  if (moduleOptions.injectUseToast) {
132
132
  addPlugin(resolve(_dirname, "./runtime/plugins/toaster"));
133
133
  addImports({
134
- from: "maz-ui",
134
+ from: resolve(_dirname, "./runtime/composables/use-toast"),
135
135
  name: "useToast",
136
136
  as: "useToast"
137
137
  });
@@ -139,7 +139,7 @@ const module = defineNuxtModule({
139
139
  if (moduleOptions.injectUseWait) {
140
140
  addPlugin(resolve(_dirname, "./runtime/plugins/wait"));
141
141
  addImports({
142
- from: "maz-ui",
142
+ from: resolve(_dirname, "./runtime/composables/use-wait"),
143
143
  name: "useWait",
144
144
  as: "useWait"
145
145
  });
@@ -0,0 +1,2 @@
1
+ import { type AosHandler } from 'maz-ui';
2
+ export declare function useAos(): AosHandler;
@@ -0,0 +1,5 @@
1
+ import { useNuxtApp } from "#imports";
2
+ export function useAos() {
3
+ const { $aos } = useNuxtApp();
4
+ return $aos;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { type ToasterHandler } from 'maz-ui';
2
+ export declare function useToast(): ToasterHandler;
@@ -0,0 +1,5 @@
1
+ import { useNuxtApp } from "#imports";
2
+ export function useToast() {
3
+ const { $toast } = useNuxtApp();
4
+ return $toast;
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { WaitHandler } from 'maz-ui';
2
+ export declare function useWait(): WaitHandler;
@@ -0,0 +1,5 @@
1
+ import { useNuxtApp } from "#imports";
2
+ export function useWait() {
3
+ const { $wait } = useNuxtApp();
4
+ return $wait;
5
+ }
@@ -1,2 +1,8 @@
1
+ import { AosHandler } from 'maz-ui';
1
2
  declare const _default: any;
2
3
  export default _default;
4
+ declare module '#app' {
5
+ interface NuxtApp {
6
+ $aos: AosHandler;
7
+ }
8
+ }
@@ -1,8 +1,11 @@
1
1
  import { defineNuxtPlugin, useRouter } from "#imports";
2
- import { installAos } from "maz-ui";
3
- export default defineNuxtPlugin(({ vueApp, $config }) => {
2
+ import { AosHandler } from "maz-ui";
3
+ export default defineNuxtPlugin(({ $config }) => {
4
4
  const aosOptions = $config.public.mazUi?.injectAos;
5
- const router = useRouter();
6
- const options = typeof aosOptions === "object" ? { ...aosOptions, router: aosOptions.router ? router : void 0 } : {};
7
- vueApp.use(installAos, options);
5
+ const options = typeof aosOptions === "object" ? { ...aosOptions, router: aosOptions.router ? useRouter() : void 0 } : {};
6
+ return {
7
+ provide: {
8
+ aos: new AosHandler(options)
9
+ }
10
+ };
8
11
  });
@@ -1,2 +1,7 @@
1
1
  declare const _default: any;
2
2
  export default _default;
3
+ declare module '#app' {
4
+ interface NuxtApp {
5
+ $mazIconPath: string;
6
+ }
7
+ }
@@ -1,5 +1,9 @@
1
1
  import { defineNuxtPlugin } from "#imports";
2
- export default defineNuxtPlugin(({ $config, vueApp }) => {
2
+ export default defineNuxtPlugin(({ $config }) => {
3
3
  const defaultMazIconPath = $config.public.mazUi?.defaultMazIconPath;
4
- vueApp.provide("mazIconPath", defaultMazIconPath);
4
+ return {
5
+ provide: {
6
+ mazIconPath: defaultMazIconPath
7
+ }
8
+ };
5
9
  });
@@ -1,2 +1,8 @@
1
+ import { ToasterHandler } from 'maz-ui';
1
2
  declare const _default: any;
2
3
  export default _default;
4
+ declare module '#app' {
5
+ interface NuxtApp {
6
+ $toast: ToasterHandler;
7
+ }
8
+ }
@@ -1,7 +1,24 @@
1
1
  import { defineNuxtPlugin } from "#imports";
2
- import { installToaster } from "maz-ui";
2
+ import { ToasterHandler } from "maz-ui";
3
3
  export default defineNuxtPlugin(({ vueApp, $config }) => {
4
4
  const toasterOptions = $config.public.mazUi?.injectUseToast;
5
5
  const options = typeof toasterOptions === "object" ? toasterOptions : void 0;
6
- vueApp.use(installToaster, options);
6
+ const instance = new ToasterHandler(vueApp, options);
7
+ const toasterServer = {
8
+ show: () => {
9
+ },
10
+ success: () => {
11
+ },
12
+ error: () => {
13
+ },
14
+ warning: () => {
15
+ },
16
+ info: () => {
17
+ }
18
+ };
19
+ return {
20
+ provide: {
21
+ toast: process.server ? toasterServer : instance
22
+ }
23
+ };
7
24
  });
@@ -1,2 +1,8 @@
1
+ import { WaitHandler } from 'maz-ui';
1
2
  declare const _default: any;
2
3
  export default _default;
4
+ declare module '#app' {
5
+ interface NuxtApp {
6
+ $wait: WaitHandler;
7
+ }
8
+ }
@@ -1,5 +1,18 @@
1
1
  import { defineNuxtPlugin } from "#imports";
2
- import { installWait } from "maz-ui";
3
- export default defineNuxtPlugin(({ vueApp }) => {
4
- vueApp.use(installWait);
2
+ import { WaitHandler } from "maz-ui";
3
+ export default defineNuxtPlugin(() => {
4
+ const waitServer = {
5
+ loaders: { value: [] },
6
+ anyLoading: { value: false },
7
+ isLoading: () => false,
8
+ stop: () => {
9
+ },
10
+ start: () => {
11
+ }
12
+ };
13
+ return {
14
+ provide: {
15
+ wait: process.server ? waitServer : new WaitHandler()
16
+ }
17
+ };
5
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.23.2",
3
+ "version": "3.23.3",
4
4
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
5
5
  "author": "Louis Mazel <me@loicmazuel.com>",
6
6
  "main": "./modules/index.cjs",
@@ -116,7 +116,7 @@
116
116
  "@vue/compiler-sfc": "^3.3.8",
117
117
  "@vue/eslint-config-prettier": "^8.0.0",
118
118
  "@vue/eslint-config-typescript": "^12.0.0",
119
- "@vue/test-utils": "^2.4.1",
119
+ "@vue/test-utils": "^2.4.2",
120
120
  "@vue/tsconfig": "^0.4.0",
121
121
  "autoprefixer": "^10.4.16",
122
122
  "c8": "^8.0.1",