@maz-ui/nuxt 4.0.0-beta.7 → 4.0.0-beta.8
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 +1 -1
- package/dist/module.mjs +46 -143
- package/package.json +8 -12
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -63,6 +63,27 @@ const COMPONENT_NAMES = {
|
|
|
63
63
|
MazPopover: true
|
|
64
64
|
};
|
|
65
65
|
const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
66
|
+
const pluginComposables = {
|
|
67
|
+
useTheme: true,
|
|
68
|
+
useTranslations: true
|
|
69
|
+
};
|
|
70
|
+
const mazUiComposables = {
|
|
71
|
+
useIdleTimeout: true,
|
|
72
|
+
useReadingTime: true,
|
|
73
|
+
useFormField: true,
|
|
74
|
+
useWindowSize: true,
|
|
75
|
+
useBreakpoints: true,
|
|
76
|
+
useUserVisibility: true,
|
|
77
|
+
useStringMatching: true,
|
|
78
|
+
useTimer: true,
|
|
79
|
+
useFormValidator: true,
|
|
80
|
+
useDisplayNames: true,
|
|
81
|
+
useFreezeValue: true,
|
|
82
|
+
useInjectStrict: true,
|
|
83
|
+
useInstanceUniqId: true,
|
|
84
|
+
useMountComponent: true,
|
|
85
|
+
useSwipe: true
|
|
86
|
+
};
|
|
66
87
|
const defaults = {
|
|
67
88
|
general: {
|
|
68
89
|
autoImportPrefix: "",
|
|
@@ -93,23 +114,8 @@ const defaults = {
|
|
|
93
114
|
wait: false
|
|
94
115
|
},
|
|
95
116
|
composables: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
useReadingTime: true,
|
|
99
|
-
useTranslations: true,
|
|
100
|
-
useFormField: true,
|
|
101
|
-
useWindowSize: true,
|
|
102
|
-
useBreakpoints: true,
|
|
103
|
-
useUserVisibility: true,
|
|
104
|
-
useStringMatching: true,
|
|
105
|
-
useTimer: true,
|
|
106
|
-
useFormValidator: true,
|
|
107
|
-
useDisplayNames: true,
|
|
108
|
-
useFreezeValue: true,
|
|
109
|
-
useInjectStrict: true,
|
|
110
|
-
useInstanceUniqId: true,
|
|
111
|
-
useMountComponent: true,
|
|
112
|
-
useSwipe: true
|
|
117
|
+
...pluginComposables,
|
|
118
|
+
...mazUiComposables
|
|
113
119
|
},
|
|
114
120
|
directives: {
|
|
115
121
|
vZoomImg: false,
|
|
@@ -119,16 +125,15 @@ const defaults = {
|
|
|
119
125
|
vTooltip: false
|
|
120
126
|
}
|
|
121
127
|
};
|
|
122
|
-
function
|
|
128
|
+
function addMazUiComposableImport({
|
|
123
129
|
name,
|
|
124
130
|
from,
|
|
125
|
-
prefix = ""
|
|
126
|
-
typed = true
|
|
131
|
+
prefix = ""
|
|
127
132
|
}) {
|
|
128
133
|
addImports({
|
|
129
134
|
from,
|
|
130
135
|
name,
|
|
131
|
-
typeFrom:
|
|
136
|
+
typeFrom: "maz-ui/dist/types/composables/index.d.ts",
|
|
132
137
|
as: `use${capitalize(prefix)}${name.replace("use", "")}`
|
|
133
138
|
});
|
|
134
139
|
}
|
|
@@ -168,13 +173,13 @@ const module = defineNuxtModule({
|
|
|
168
173
|
});
|
|
169
174
|
}
|
|
170
175
|
}
|
|
176
|
+
const autoImportPrefix = moduleOptions.general.autoImportPrefix;
|
|
171
177
|
if (moduleOptions.plugins.aos) {
|
|
172
178
|
addPlugin(resolve(_dirname, "./runtime/plugins/aos"));
|
|
173
|
-
|
|
179
|
+
addMazUiComposableImport({
|
|
174
180
|
name: "useAos",
|
|
175
|
-
typed: false,
|
|
176
181
|
from: resolve(_dirname, "./runtime/composables/useAos"),
|
|
177
|
-
prefix:
|
|
182
|
+
prefix: autoImportPrefix
|
|
178
183
|
});
|
|
179
184
|
const injectAosCSS = typeof moduleOptions.plugins.aos === "object" && typeof moduleOptions.plugins.aos.injectCss === "boolean" ? moduleOptions.plugins.aos.injectCss : true;
|
|
180
185
|
if (injectAosCSS) {
|
|
@@ -183,29 +188,26 @@ const module = defineNuxtModule({
|
|
|
183
188
|
}
|
|
184
189
|
if (moduleOptions.plugins.toast) {
|
|
185
190
|
addPlugin(resolve(_dirname, "./runtime/plugins/toast"));
|
|
186
|
-
|
|
191
|
+
addMazUiComposableImport({
|
|
187
192
|
name: "useToast",
|
|
188
|
-
typed: false,
|
|
189
193
|
from: resolve(_dirname, "./runtime/composables/useToast"),
|
|
190
|
-
prefix:
|
|
194
|
+
prefix: autoImportPrefix
|
|
191
195
|
});
|
|
192
196
|
}
|
|
193
197
|
if (moduleOptions.plugins.dialog) {
|
|
194
198
|
addPlugin(resolve(_dirname, "./runtime/plugins/dialog"));
|
|
195
|
-
|
|
199
|
+
addMazUiComposableImport({
|
|
196
200
|
name: "useDialog",
|
|
197
|
-
typed: false,
|
|
198
201
|
from: resolve(_dirname, "./runtime/composables/useDialog"),
|
|
199
|
-
prefix:
|
|
202
|
+
prefix: autoImportPrefix
|
|
200
203
|
});
|
|
201
204
|
}
|
|
202
205
|
if (moduleOptions.plugins.wait) {
|
|
203
206
|
addPlugin(resolve(_dirname, "./runtime/plugins/wait"));
|
|
204
|
-
|
|
207
|
+
addMazUiComposableImport({
|
|
205
208
|
name: "useWait",
|
|
206
|
-
typed: false,
|
|
207
209
|
from: resolve(_dirname, "./runtime/composables/useWait"),
|
|
208
|
-
prefix:
|
|
210
|
+
prefix: autoImportPrefix
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
if (moduleOptions.directives.vZoomImg) {
|
|
@@ -223,125 +225,26 @@ const module = defineNuxtModule({
|
|
|
223
225
|
if (moduleOptions.directives.vTooltip) {
|
|
224
226
|
addPlugin(resolve(_dirname, "./runtime/plugins/v-tooltip"));
|
|
225
227
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
if (moduleOptions.composables.useReadingTime) {
|
|
234
|
-
addComposableImport({
|
|
235
|
-
name: "useReadingTime",
|
|
236
|
-
from: "maz-ui/composables/useReadingTime",
|
|
237
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
if (moduleOptions.composables.useWindowSize) {
|
|
241
|
-
addComposableImport({
|
|
242
|
-
name: "useWindowSize",
|
|
243
|
-
from: "maz-ui/composables/useWindowSize",
|
|
244
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
if (moduleOptions.composables.useBreakpoints) {
|
|
248
|
-
addImports({
|
|
249
|
-
from: "maz-ui/composables/useBreakpoints",
|
|
250
|
-
name: "useBreakpoints",
|
|
251
|
-
as: "useBreakpoints"
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
if (moduleOptions.composables.useUserVisibility) {
|
|
255
|
-
addComposableImport({
|
|
256
|
-
name: "useUserVisibility",
|
|
257
|
-
from: "maz-ui/composables/useUserVisibility",
|
|
258
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
if (moduleOptions.composables.useStringMatching) {
|
|
262
|
-
addComposableImport({
|
|
263
|
-
name: "useStringMatching",
|
|
264
|
-
from: "maz-ui/composables/useStringMatching",
|
|
265
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
if (moduleOptions.composables.useTimer) {
|
|
269
|
-
addComposableImport({
|
|
270
|
-
name: "useTimer",
|
|
271
|
-
from: "maz-ui/composables/useTimer",
|
|
272
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
if (moduleOptions.composables.useFreezeValue) {
|
|
276
|
-
addComposableImport({
|
|
277
|
-
name: "useFreezeValue",
|
|
278
|
-
from: "maz-ui/composables/useFreezeValue",
|
|
279
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
if (moduleOptions.composables.useInjectStrict) {
|
|
283
|
-
addComposableImport({
|
|
284
|
-
name: "useInjectStrict",
|
|
285
|
-
from: "maz-ui/composables/useInjectStrict",
|
|
286
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
if (moduleOptions.composables.useInstanceUniqId) {
|
|
290
|
-
addComposableImport({
|
|
291
|
-
name: "useInstanceUniqId",
|
|
292
|
-
from: "maz-ui/composables/useInstanceUniqId",
|
|
293
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
if (moduleOptions.composables.useMountComponent) {
|
|
297
|
-
addComposableImport({
|
|
298
|
-
name: "useMountComponent",
|
|
299
|
-
from: "maz-ui/composables/useMountComponent",
|
|
300
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
if (moduleOptions.composables.useSwipe) {
|
|
304
|
-
addComposableImport({
|
|
305
|
-
name: "useSwipe",
|
|
306
|
-
from: "maz-ui/composables/useSwipe",
|
|
307
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
if (moduleOptions.composables.useFormValidator) {
|
|
311
|
-
addComposableImport({
|
|
312
|
-
name: "useFormValidator",
|
|
313
|
-
from: "maz-ui/composables/useFormValidator",
|
|
314
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
if (moduleOptions.composables.useFormField) {
|
|
318
|
-
addComposableImport({
|
|
319
|
-
name: "useFormField",
|
|
320
|
-
from: "maz-ui/composables/useFormField",
|
|
321
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
if (moduleOptions.composables.useDisplayNames) {
|
|
325
|
-
addComposableImport({
|
|
326
|
-
name: "useDisplayNames",
|
|
327
|
-
from: "maz-ui/composables/useDisplayNames",
|
|
328
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
228
|
+
const allowedMazUiComposables = Object.keys(moduleOptions.composables).filter((composable) => mazUiComposables[composable]);
|
|
229
|
+
for (const composable of allowedMazUiComposables) {
|
|
230
|
+
addMazUiComposableImport({
|
|
231
|
+
name: composable,
|
|
232
|
+
from: `maz-ui/composables`,
|
|
233
|
+
prefix: autoImportPrefix
|
|
329
234
|
});
|
|
330
235
|
}
|
|
331
236
|
if (moduleOptions.composables.useTheme) {
|
|
332
|
-
|
|
237
|
+
addImports({
|
|
333
238
|
name: "useTheme",
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
prefix: moduleOptions.general?.autoImportPrefix
|
|
239
|
+
from: "@maz-ui/themes",
|
|
240
|
+
as: `use${capitalize(autoImportPrefix)}Theme`
|
|
337
241
|
});
|
|
338
242
|
}
|
|
339
243
|
if (moduleOptions.composables.useTranslations) {
|
|
340
|
-
|
|
244
|
+
addImports({
|
|
341
245
|
name: "useTranslations",
|
|
342
|
-
typed: false,
|
|
343
246
|
from: "@maz-ui/translations",
|
|
344
|
-
|
|
247
|
+
as: `use${capitalize(autoImportPrefix)}Translations`
|
|
345
248
|
});
|
|
346
249
|
}
|
|
347
250
|
if (moduleOptions.general.defaultMazIconPath) {
|
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.8",
|
|
5
5
|
"description": "Nuxt module for Maz-UI",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,21 +46,18 @@
|
|
|
46
46
|
],
|
|
47
47
|
"scripts": {
|
|
48
48
|
"prepack": "nuxt-module-build build",
|
|
49
|
-
"build": "pnpm
|
|
50
|
-
"
|
|
51
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare",
|
|
49
|
+
"build": "pnpm dev && nuxt-module-build build",
|
|
50
|
+
"dev": "nuxt-module-build build --stub && nuxt-module-build prepare",
|
|
52
51
|
"lint": "cross-env NODE_ENV=production eslint .",
|
|
53
52
|
"lint:fix": "pnpm lint --fix",
|
|
54
|
-
"
|
|
55
|
-
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
|
56
|
-
"release": "npm run lint && npm run prepack && changelogen --release && npm publish && git push --follow-tags"
|
|
53
|
+
"typecheck": "vue-tsc --noEmit --skipLibCheck"
|
|
57
54
|
},
|
|
58
55
|
"dependencies": {
|
|
59
|
-
"@maz-ui/themes": "4.0.0-beta.
|
|
60
|
-
"@maz-ui/translations": "4.0.0-beta.
|
|
56
|
+
"@maz-ui/themes": "4.0.0-beta.8",
|
|
57
|
+
"@maz-ui/translations": "4.0.0-beta.8",
|
|
61
58
|
"@nuxt/kit": "^3.17.4",
|
|
62
59
|
"defu": "^6.1.4",
|
|
63
|
-
"maz-ui": "4.0.0-beta.
|
|
60
|
+
"maz-ui": "4.0.0-beta.8"
|
|
64
61
|
},
|
|
65
62
|
"devDependencies": {
|
|
66
63
|
"@nuxt/devtools": "^2.4.1",
|
|
@@ -73,8 +70,7 @@
|
|
|
73
70
|
"vitest": "^3.2.4"
|
|
74
71
|
},
|
|
75
72
|
"lint-staged": {
|
|
76
|
-
"*": "prettier -w -u",
|
|
77
73
|
"*.{js,ts,mjs,mts,cjs,md}": "cross-env NODE_ENV=production eslint --fix"
|
|
78
74
|
},
|
|
79
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "fef4d097f7e992f20980cc628216f070a516644e"
|
|
80
76
|
}
|