@maz-ui/nuxt 4.0.0-beta.5 → 4.0.0-beta.7
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.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -5
- package/dist/runtime/composables/useAos.d.ts +0 -2
- package/dist/runtime/composables/useDialog.d.ts +0 -2
- package/dist/runtime/composables/useToast.d.ts +0 -2
- package/dist/runtime/composables/useWait.d.ts +0 -2
- package/dist/runtime/plugins/aos.d.ts +0 -12
- package/dist/runtime/plugins/aos.js +1 -1
- package/dist/runtime/plugins/dialog.d.ts +0 -12
- package/dist/runtime/plugins/dialog.js +1 -1
- package/dist/runtime/plugins/maz-icon-path.d.ts +0 -11
- package/dist/runtime/plugins/theme.d.ts +0 -8
- package/dist/runtime/plugins/theme.js +1 -2
- package/dist/runtime/plugins/toast.d.ts +0 -12
- package/dist/runtime/plugins/toast.js +1 -1
- package/dist/runtime/plugins/translations.d.ts +0 -8
- package/dist/runtime/plugins/translations.js +18 -3
- package/dist/runtime/plugins/v-click-outside.d.ts +0 -8
- package/dist/runtime/plugins/v-fullscreen-img.d.ts +0 -8
- package/dist/runtime/plugins/v-lazy-img.d.ts +0 -8
- package/dist/runtime/plugins/v-tooltip.d.ts +0 -8
- package/dist/runtime/plugins/v-zoom-img.d.ts +0 -8
- package/dist/runtime/plugins/wait.d.ts +0 -12
- package/package.json +6 -6
package/dist/module.d.mts
CHANGED
|
@@ -272,7 +272,7 @@ declare module '@nuxt/schema' {
|
|
|
272
272
|
mazUi: MazUiNuxtOptions;
|
|
273
273
|
}
|
|
274
274
|
interface PublicRuntimeConfig {
|
|
275
|
-
mazUi: MazUiNuxtOptions
|
|
275
|
+
mazUi: Required<MazUiNuxtOptions>;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
declare const _default: _nuxt_schema.NuxtModule<MazUiNuxtOptions, MazUiNuxtOptions, false>;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -22,7 +22,7 @@ const COMPONENT_NAMES = {
|
|
|
22
22
|
MazChecklist: true,
|
|
23
23
|
MazCircularProgressBar: true,
|
|
24
24
|
MazDialog: true,
|
|
25
|
-
|
|
25
|
+
MazDialogConfirm: true,
|
|
26
26
|
MazDrawer: true,
|
|
27
27
|
MazDropdown: true,
|
|
28
28
|
MazDropzone: true,
|
|
@@ -76,11 +76,12 @@ const defaults = {
|
|
|
76
76
|
preset: "maz-ui",
|
|
77
77
|
strategy: "hybrid",
|
|
78
78
|
darkModeStrategy: "class",
|
|
79
|
-
prefix: "maz",
|
|
80
79
|
colorMode: "auto"
|
|
81
80
|
},
|
|
82
81
|
translations: {
|
|
83
|
-
locale: "en"
|
|
82
|
+
locale: "en",
|
|
83
|
+
fallbackLocale: "en",
|
|
84
|
+
preloadFallback: true
|
|
84
85
|
},
|
|
85
86
|
components: {
|
|
86
87
|
autoImport: true
|
|
@@ -143,8 +144,16 @@ const module = defineNuxtModule({
|
|
|
143
144
|
/* eslint-disable complexity, sonarjs/cognitive-complexity */
|
|
144
145
|
setup(options, nuxt) {
|
|
145
146
|
const { resolve } = createResolver(import.meta.url);
|
|
146
|
-
nuxt.options.build.transpile = [
|
|
147
|
-
|
|
147
|
+
nuxt.options.build.transpile = [
|
|
148
|
+
"maz-ui",
|
|
149
|
+
"@maz-ui/themes",
|
|
150
|
+
...nuxt.options.build.transpile
|
|
151
|
+
];
|
|
152
|
+
const moduleOptions = defu(
|
|
153
|
+
nuxt.options.runtimeConfig.public.mazUi,
|
|
154
|
+
options,
|
|
155
|
+
defaults
|
|
156
|
+
);
|
|
148
157
|
nuxt.options.runtimeConfig.public.mazUi = moduleOptions;
|
|
149
158
|
if (moduleOptions.css.injectMainCss) {
|
|
150
159
|
nuxt.options.css = ["maz-ui/dist/css/main.css", ...nuxt.options.css];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AosHandler } from 'maz-ui/plugins/aos';
|
|
2
|
-
declare const _default: import("#app").Plugin<{
|
|
3
|
-
mazAos: AosHandler;
|
|
4
|
-
}> & import("#app").ObjectPlugin<{
|
|
5
|
-
mazAos: AosHandler;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
8
|
-
declare module '#app' {
|
|
9
|
-
interface NuxtApp {
|
|
10
|
-
$mazAos: AosHandler;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AosHandler, AosPlugin } from "maz-ui/plugins/aos";
|
|
2
2
|
import { defineNuxtPlugin, useRouter } from "nuxt/app";
|
|
3
3
|
export default defineNuxtPlugin(({ $config, vueApp }) => {
|
|
4
|
-
const aosOptions = $config.public.mazUi?.
|
|
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);
|
|
7
7
|
return {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DialogHandler } from 'maz-ui/plugins/dialog';
|
|
2
|
-
declare const _default: import("#app").Plugin<{
|
|
3
|
-
mazDialog: DialogHandler;
|
|
4
|
-
}> & import("#app").ObjectPlugin<{
|
|
5
|
-
mazDialog: DialogHandler;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
8
|
-
declare module '#app' {
|
|
9
|
-
interface NuxtApp {
|
|
10
|
-
$mazDialog: DialogHandler;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DialogHandler } from "maz-ui/plugins/dialog";
|
|
2
2
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
3
|
export default defineNuxtPlugin(({ vueApp, $config }) => {
|
|
4
|
-
const dialogOptions = $config.public.mazUi?.
|
|
4
|
+
const dialogOptions = $config.public.mazUi?.plugins?.dialog;
|
|
5
5
|
const options = typeof dialogOptions === "object" ? dialogOptions : void 0;
|
|
6
6
|
const instance = new DialogHandler(vueApp, options);
|
|
7
7
|
const dialogServer = {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ThemeState } from '@maz-ui/themes';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module '#app' {
|
|
5
|
-
interface NuxtApp {
|
|
6
|
-
$mazThemeState: ThemeState;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -35,7 +35,6 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
|
35
35
|
const config = {
|
|
36
36
|
strategy: "hybrid",
|
|
37
37
|
darkModeStrategy: "class",
|
|
38
|
-
prefix: "maz",
|
|
39
38
|
colorMode: "auto",
|
|
40
39
|
injectFullCSSOnServer: true,
|
|
41
40
|
...themeConfig,
|
|
@@ -55,7 +54,7 @@ export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
|
55
54
|
const cssOptions = {
|
|
56
55
|
mode: config.colorMode === "auto" ? "both" : config.colorMode,
|
|
57
56
|
darkSelectorStrategy: config.darkModeStrategy ?? "class",
|
|
58
|
-
prefix:
|
|
57
|
+
prefix: "maz"
|
|
59
58
|
};
|
|
60
59
|
const criticalCSS = generateCriticalCSS(themeState.currentPreset, cssOptions);
|
|
61
60
|
useHead({
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ToastHandler } from 'maz-ui/plugins/toast';
|
|
2
|
-
declare const _default: import("#app").Plugin<{
|
|
3
|
-
mazToast: ToastHandler;
|
|
4
|
-
}> & import("#app").ObjectPlugin<{
|
|
5
|
-
mazToast: ToastHandler;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
8
|
-
declare module '#app' {
|
|
9
|
-
interface NuxtApp {
|
|
10
|
-
$mazToast: ToastHandler;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToastHandler } from "maz-ui/plugins/toast";
|
|
2
2
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
3
|
export default defineNuxtPlugin(({ vueApp, $config }) => {
|
|
4
|
-
const toastOptions = $config.public.mazUi?.
|
|
4
|
+
const toastOptions = $config.public.mazUi?.plugins?.toast;
|
|
5
5
|
const options = typeof toastOptions === "object" ? toastOptions : void 0;
|
|
6
6
|
const instance = new ToastHandler(vueApp, options);
|
|
7
7
|
const toastServer = {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type MazTranslationsInstance } from '@maz-ui/translations';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module '#app' {
|
|
5
|
-
interface NuxtApp {
|
|
6
|
-
$mazTranslations: MazTranslationsInstance;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
MazTranslations
|
|
3
|
+
} from "@maz-ui/translations";
|
|
2
4
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
5
|
export default defineNuxtPlugin(async ({ vueApp, $config }) => {
|
|
4
|
-
const translationsOptions = $config.public.mazUi
|
|
5
|
-
|
|
6
|
+
const translationsOptions = $config.public.mazUi.translations || {};
|
|
7
|
+
const i18n = MazTranslations.install(vueApp, translationsOptions);
|
|
8
|
+
if (process.server) {
|
|
9
|
+
const locale = translationsOptions.locale || "en";
|
|
10
|
+
const fallbackLocale = translationsOptions.fallbackLocale || "en";
|
|
11
|
+
try {
|
|
12
|
+
await i18n.setLocale(locale);
|
|
13
|
+
if (locale !== fallbackLocale && translationsOptions.preloadFallback !== false) {
|
|
14
|
+
await i18n.setLocale(fallbackLocale);
|
|
15
|
+
await i18n.setLocale(locale);
|
|
16
|
+
}
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.warn("Failed to preload locale:", error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
6
21
|
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type VClickOutsideDirective } from 'maz-ui/directives/vClickOutside';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface GlobalDirectives {
|
|
6
|
-
vClickOutside: VClickOutsideDirective;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type VFullscreenImgDirective } from 'maz-ui/directives/vFullscreenImg';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface GlobalDirectives {
|
|
6
|
-
vFullscreenImg: VFullscreenImgDirective;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type VLazyImgDirective } from 'maz-ui/directives/vLazyImg';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface GlobalDirectives {
|
|
6
|
-
vLazyImg: VLazyImgDirective;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type VTooltipDirective } from 'maz-ui/directives/vTooltip';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface GlobalDirectives {
|
|
6
|
-
vTooltip: VTooltipDirective;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type VZoomImgDirective } from 'maz-ui/directives/vZoomImg';
|
|
2
|
-
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface GlobalDirectives {
|
|
6
|
-
vZoomImg: VZoomImgDirective;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WaitHandler } from 'maz-ui/plugins/wait';
|
|
2
|
-
declare const _default: import("#app").Plugin<{
|
|
3
|
-
mazWait: WaitHandler;
|
|
4
|
-
}> & import("#app").ObjectPlugin<{
|
|
5
|
-
mazWait: WaitHandler;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
|
8
|
-
declare module '#app' {
|
|
9
|
-
interface NuxtApp {
|
|
10
|
-
$mazWait: WaitHandler;
|
|
11
|
-
}
|
|
12
|
-
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.7",
|
|
5
5
|
"description": "Nuxt module for Maz-UI",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"lint": "cross-env NODE_ENV=production eslint .",
|
|
53
53
|
"lint:fix": "pnpm lint --fix",
|
|
54
54
|
"format": "prettier --ignore-path .gitignore . --write",
|
|
55
|
-
"typecheck": "vue-tsc --noEmit --skipLibCheck
|
|
55
|
+
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
|
56
56
|
"release": "npm run lint && npm run prepack && changelogen --release && npm publish && git push --follow-tags"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@maz-ui/themes": "4.0.0-beta.
|
|
60
|
-
"@maz-ui/translations": "4.0.0-beta.
|
|
59
|
+
"@maz-ui/themes": "4.0.0-beta.7",
|
|
60
|
+
"@maz-ui/translations": "4.0.0-beta.7",
|
|
61
61
|
"@nuxt/kit": "^3.17.4",
|
|
62
62
|
"defu": "^6.1.4",
|
|
63
|
-
"maz-ui": "4.0.0-beta.
|
|
63
|
+
"maz-ui": "4.0.0-beta.7"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@nuxt/devtools": "^2.4.1",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"*": "prettier -w -u",
|
|
77
77
|
"*.{js,ts,mjs,mts,cjs,md}": "cross-env NODE_ENV=production eslint --fix"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "b64fa54fbf3c645a1f2009f44c50da350bd8461e"
|
|
80
80
|
}
|