@vueless/nuxt 1.0.1-beta.7 → 1.0.1-beta.9
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 +2 -2
- package/dist/module.mjs +3 -4
- package/dist/package.json +2 -2
- package/dist/runtime/plugin.js +26 -15
- package/package.json +2 -2
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { createRequire } from 'node:module';
|
|
|
6
6
|
import { defineNuxtModule, createResolver, hasNuxtModule, addPlugin, addComponent, addImportsDir } from '@nuxt/kit';
|
|
7
7
|
import { TailwindCSS, Vueless } from 'vueless/plugin-vite';
|
|
8
8
|
import { autoImportUserConfigs, cacheMergedConfigs } from 'vueless/utils/node/helper.js';
|
|
9
|
-
import { NUXT_MODULE_ENV, VUELESS_PACKAGE_DIR, COMPONENTS, VUELESS_CONFIG_FILE_NAME } from 'vueless/constants
|
|
9
|
+
import { NUXT_MODULE_ENV, VUELESS_PACKAGE_DIR, COMPONENTS, VUELESS_CONFIG_FILE_NAME } from 'vueless/constants';
|
|
10
10
|
|
|
11
11
|
const require = createRequire(import.meta.url);
|
|
12
12
|
const module = defineNuxtModule({
|
|
@@ -29,7 +29,6 @@ const module = defineNuxtModule({
|
|
|
29
29
|
await autoImportUserConfigs();
|
|
30
30
|
const { vuelessConfig, dependencies } = await getVuelessConfig();
|
|
31
31
|
_nuxt.options.runtimeConfig.public.vueless = vuelessConfig;
|
|
32
|
-
_nuxt.options.build.transpile.push("vueless");
|
|
33
32
|
if (hasNuxtModule("@nuxtjs/i18n")) {
|
|
34
33
|
_nuxt.hook("i18n:registerModule", (register) => {
|
|
35
34
|
register({
|
|
@@ -60,10 +59,10 @@ const module = defineNuxtModule({
|
|
|
60
59
|
}
|
|
61
60
|
await cacheMergedConfigs(VUELESS_PACKAGE_DIR);
|
|
62
61
|
addPlugin(resolve("./runtime/plugin"));
|
|
63
|
-
for (const componentName
|
|
62
|
+
for (const [componentName, componentPath] of Object.entries(COMPONENTS)) {
|
|
64
63
|
addComponent({
|
|
65
64
|
name: componentName,
|
|
66
|
-
filePath: `vueless/${
|
|
65
|
+
filePath: `vueless/${componentPath}/${componentName}.vue`
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
addImportsDir("vueless/composables");
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueless/nuxt",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.9",
|
|
4
4
|
"description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"vueless": "^1.1.1-beta.
|
|
41
|
+
"vueless": "^1.1.1-beta.47"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@material-symbols/svg-500": "^0.34.1",
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVueless, createVueI18nAdapter, setTheme, vClickOutside, vTooltip, vuelessConfig } from "vueless";
|
|
1
|
+
import { createVueless, createVueI18nAdapter, setTheme, ColorMode, vClickOutside, vTooltip, vuelessConfig } from "vueless";
|
|
2
2
|
import {
|
|
3
3
|
TEXT,
|
|
4
4
|
OUTLINE,
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
DARK_MODE_CLASS,
|
|
11
11
|
LIGHT_MODE_CLASS,
|
|
12
12
|
DISABLED_OPACITY
|
|
13
|
-
} from "vueless/constants
|
|
14
|
-
import { ColorMode } from "vueless/types";
|
|
13
|
+
} from "vueless/constants";
|
|
15
14
|
import { useRuntimeConfig } from "#imports";
|
|
16
15
|
import { defineNuxtPlugin } from "#app";
|
|
17
16
|
function parseCookies(cookieHeader) {
|
|
@@ -41,25 +40,37 @@ export default defineNuxtPlugin((_nuxtApp) => {
|
|
|
41
40
|
const cookies = parseCookies(event?.node.req.headers.cookie);
|
|
42
41
|
const primary = cookies?.[`vl-${PRIMARY_COLOR}`];
|
|
43
42
|
const neutral = cookies?.[`vl-${NEUTRAL_COLOR}`];
|
|
43
|
+
const textXs = Number(cookies?.[`vl-${TEXT}-xs`]);
|
|
44
|
+
const textSm = Number(cookies?.[`vl-${TEXT}-sm`]);
|
|
45
|
+
const textMd = Number(cookies?.[`vl-${TEXT}-md`]);
|
|
46
|
+
const textLg = Number(cookies?.[`vl-${TEXT}-lg`]);
|
|
44
47
|
const text = {
|
|
45
|
-
xs:
|
|
46
|
-
sm:
|
|
47
|
-
md:
|
|
48
|
-
lg:
|
|
48
|
+
xs: !Number.isNaN(textXs) ? textXs : void 0,
|
|
49
|
+
sm: !Number.isNaN(textSm) ? textSm : void 0,
|
|
50
|
+
md: !Number.isNaN(textMd) ? textMd : void 0,
|
|
51
|
+
lg: !Number.isNaN(textLg) ? textLg : void 0
|
|
49
52
|
};
|
|
53
|
+
const outlineSm = Number(cookies?.[`vl-${OUTLINE}-sm`]);
|
|
54
|
+
const outlineMd = Number(cookies?.[`vl-${OUTLINE}-md`]);
|
|
55
|
+
const outlineLg = Number(cookies?.[`vl-${OUTLINE}-lg`]);
|
|
50
56
|
const outline = {
|
|
51
|
-
sm:
|
|
52
|
-
md:
|
|
53
|
-
lg:
|
|
57
|
+
sm: !Number.isNaN(outlineSm) ? outlineSm : void 0,
|
|
58
|
+
md: !Number.isNaN(outlineMd) ? outlineMd : void 0,
|
|
59
|
+
lg: !Number.isNaN(outlineLg) ? outlineLg : void 0
|
|
54
60
|
};
|
|
61
|
+
const roundingSm = Number(cookies?.[`vl-${ROUNDING}-sm`]);
|
|
62
|
+
const roundingMd = Number(cookies?.[`vl-${ROUNDING}-md`]);
|
|
63
|
+
const roundingLg = Number(cookies?.[`vl-${ROUNDING}-lg`]);
|
|
55
64
|
const rounding = {
|
|
56
|
-
sm:
|
|
57
|
-
md:
|
|
58
|
-
lg:
|
|
65
|
+
sm: !Number.isNaN(roundingSm) ? roundingSm : void 0,
|
|
66
|
+
md: !Number.isNaN(roundingMd) ? roundingMd : void 0,
|
|
67
|
+
lg: !Number.isNaN(roundingLg) ? roundingLg : void 0
|
|
59
68
|
};
|
|
60
|
-
const
|
|
69
|
+
const disabledOpacityValue = Number(cookies?.[`vl-${DISABLED_OPACITY}`]);
|
|
70
|
+
const disabledOpacity = !Number.isNaN(disabledOpacityValue) ? disabledOpacityValue : void 0;
|
|
61
71
|
const colorMode = cookies?.[COLOR_MODE_KEY] || vuelessConfig.colorMode || ColorMode.Light;
|
|
62
|
-
const
|
|
72
|
+
const autoModeValue = Number(cookies?.[AUTO_MODE_KEY]);
|
|
73
|
+
const isCachedAutoMode = Boolean(!Number.isNaN(autoModeValue) ? autoModeValue : void 0);
|
|
63
74
|
const themeRootVariables = setTheme({ primary, neutral, text, outline, rounding, disabledOpacity, colorMode }, isCachedAutoMode);
|
|
64
75
|
const colorModeClass = colorMode === ColorMode.Dark ? DARK_MODE_CLASS : LIGHT_MODE_CLASS;
|
|
65
76
|
_nuxtApp.ssrContext?.head.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueless/nuxt",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.9",
|
|
4
4
|
"description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"vueless": "^1.1.1-beta.
|
|
41
|
+
"vueless": "^1.1.1-beta.47"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@material-symbols/svg-500": "^0.34.1",
|