@maz-ui/nuxt 4.9.1-beta.1 → 4.9.1-beta.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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "4.9.1-beta.1",
7
+ "version": "4.9.1-beta.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,4 +1,4 @@
1
- import { AosHandler } from 'maz-ui/plugins/aos';
1
+ import type { AosHandler } from 'maz-ui/plugins/aos';
2
2
  declare const _default: import("nuxt/app").Plugin<{
3
3
  mazAos: AosHandler;
4
4
  }> & import("nuxt/app").ObjectPlugin<{
@@ -1,6 +1,6 @@
1
- import { AosHandler, AosPlugin } from "maz-ui/plugins/aos";
2
1
  import { defineNuxtPlugin, useRouter } from "nuxt/app";
3
- export default defineNuxtPlugin(({ $config, vueApp }) => {
2
+ export default defineNuxtPlugin(async ({ $config, vueApp }) => {
3
+ const { AosHandler, AosPlugin } = await import("maz-ui/plugins/aos");
4
4
  const aosOptions = $config.public.mazUi?.plugins?.aos;
5
5
  const options = typeof aosOptions === "object" ? { ...aosOptions, router: aosOptions.router ? useRouter() : void 0 } : {};
6
6
  vueApp.use(AosPlugin, options);
@@ -1,4 +1,4 @@
1
- import { DialogHandler } from 'maz-ui/plugins/dialog';
1
+ import type { DialogHandler } from 'maz-ui/plugins/dialog';
2
2
  declare const _default: import("nuxt/app").Plugin<{
3
3
  mazDialog: DialogHandler;
4
4
  }> & import("nuxt/app").ObjectPlugin<{
@@ -1,23 +1,29 @@
1
- import { DialogHandler } from "maz-ui/plugins/dialog";
2
1
  import { defineNuxtPlugin } from "nuxt/app";
3
- export default defineNuxtPlugin(({ vueApp, $config }) => {
2
+ const dialogServer = {
3
+ open: () => {
4
+ return {
5
+ promise: Promise.resolve(),
6
+ destroy: () => {
7
+ },
8
+ close: () => {
9
+ }
10
+ };
11
+ }
12
+ };
13
+ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
14
+ if (import.meta.server) {
15
+ return {
16
+ provide: {
17
+ mazDialog: dialogServer
18
+ }
19
+ };
20
+ }
21
+ const { DialogHandler } = await import("maz-ui/plugins/dialog");
4
22
  const dialogOptions = $config.public.mazUi?.plugins?.dialog;
5
23
  const options = typeof dialogOptions === "object" ? dialogOptions : void 0;
6
- const instance = new DialogHandler(vueApp, options);
7
- const dialogServer = {
8
- open: () => {
9
- return {
10
- promise: Promise.resolve(),
11
- destroy: () => {
12
- },
13
- close: () => {
14
- }
15
- };
16
- }
17
- };
18
24
  return {
19
25
  provide: {
20
- mazDialog: import.meta.server ? dialogServer : instance
26
+ mazDialog: new DialogHandler(vueApp, options)
21
27
  }
22
28
  };
23
29
  });
@@ -1,4 +1,4 @@
1
- import { ToastHandler } from 'maz-ui/plugins/toast';
1
+ import type { ToastHandler } from 'maz-ui/plugins/toast';
2
2
  declare const _default: import("nuxt/app").Plugin<{
3
3
  mazToast: ToastHandler;
4
4
  }> & import("nuxt/app").ObjectPlugin<{
@@ -1,26 +1,32 @@
1
- import { ToastHandler } from "maz-ui/plugins/toast";
2
1
  import { defineNuxtPlugin } from "nuxt/app";
3
- export default defineNuxtPlugin(({ vueApp, $config }) => {
2
+ const toastServer = {
3
+ show: (_message) => {
4
+ },
5
+ success: (_message) => {
6
+ },
7
+ error: (_message) => {
8
+ },
9
+ warning: (_message) => {
10
+ },
11
+ info: (_message) => {
12
+ },
13
+ message: (_message) => {
14
+ }
15
+ };
16
+ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
17
+ if (import.meta.server) {
18
+ return {
19
+ provide: {
20
+ mazToast: toastServer
21
+ }
22
+ };
23
+ }
24
+ const { ToastHandler } = await import("maz-ui/plugins/toast");
4
25
  const toastOptions = $config.public.mazUi?.plugins?.toast;
5
26
  const options = typeof toastOptions === "object" ? toastOptions : void 0;
6
- const instance = new ToastHandler(vueApp, options);
7
- const toastServer = {
8
- show: (_message) => {
9
- },
10
- success: (_message) => {
11
- },
12
- error: (_message) => {
13
- },
14
- warning: (_message) => {
15
- },
16
- info: (_message) => {
17
- },
18
- message: (_message) => {
19
- }
20
- };
21
27
  return {
22
28
  provide: {
23
- mazToast: import.meta.server ? toastServer : instance
29
+ mazToast: new ToastHandler(vueApp, options)
24
30
  }
25
31
  };
26
32
  });
@@ -1,4 +1,4 @@
1
- import { WaitHandler } from 'maz-ui/plugins/wait';
1
+ import type { WaitHandler } from 'maz-ui/plugins/wait';
2
2
  declare const _default: import("nuxt/app").Plugin<{
3
3
  mazWait: WaitHandler;
4
4
  }> & import("nuxt/app").ObjectPlugin<{
@@ -1,18 +1,25 @@
1
- import { WaitHandler } from "maz-ui/plugins/wait";
2
1
  import { defineNuxtPlugin } from "nuxt/app";
3
- export default defineNuxtPlugin(() => {
4
- const waitServer = {
5
- loaders: { value: [] },
6
- anyLoading: { value: false },
7
- isLoading: () => false,
8
- stop: () => {
9
- },
10
- start: () => {
11
- }
12
- };
2
+ const waitServer = {
3
+ loaders: { value: [] },
4
+ anyLoading: { value: false },
5
+ isLoading: () => false,
6
+ stop: () => {
7
+ },
8
+ start: () => {
9
+ }
10
+ };
11
+ export default defineNuxtPlugin(async () => {
12
+ if (import.meta.server) {
13
+ return {
14
+ provide: {
15
+ mazWait: waitServer
16
+ }
17
+ };
18
+ }
19
+ const { WaitHandler } = await import("maz-ui/plugins/wait");
13
20
  return {
14
21
  provide: {
15
- mazWait: import.meta.server ? waitServer : new WaitHandler()
22
+ mazWait: new WaitHandler()
16
23
  }
17
24
  };
18
25
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maz-ui/nuxt",
3
3
  "type": "module",
4
- "version": "4.9.1-beta.1",
4
+ "version": "4.9.1-beta.3",
5
5
  "description": "Nuxt module for Maz-UI",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -51,9 +51,9 @@
51
51
  "@nuxt/kit": "^4.4.2",
52
52
  "defu": "^6.1.4",
53
53
  "@maz-ui/themes": "4.9.0",
54
- "@maz-ui/translations": "4.8.0",
54
+ "maz-ui": "4.9.1-beta.2",
55
55
  "@maz-ui/utils": "4.7.6",
56
- "maz-ui": "4.9.1-beta.1"
56
+ "@maz-ui/translations": "4.8.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@nuxt/devtools": "^3.2.3",