@sit-onyx/nuxt 1.0.0-beta.20 → 1.0.0-beta.201
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/README.md +1 -5
- package/dist/module.d.mts +3 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +4 -6
- package/dist/runtime/plugins/onyx.js +15 -12
- package/dist/types.d.mts +3 -1
- package/package.json +14 -15
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -37
- package/dist/types.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<div align="center" style="text-align: center">
|
|
2
|
-
<
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" type="image/svg+xml" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-light.svg">
|
|
4
|
-
<source media="(prefers-color-scheme: light)" type="image/svg+xml" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg">
|
|
5
|
-
<img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg" width="160px">
|
|
6
|
-
</picture>
|
|
2
|
+
<img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo.svg" height="96px">
|
|
7
3
|
</div>
|
|
8
4
|
|
|
9
5
|
<br>
|
package/dist/module.d.mts
CHANGED
|
@@ -32,6 +32,7 @@ interface ModuleOptions {
|
|
|
32
32
|
registerLocales?: Record<string, "en-US" | "de-DE" | "ko-KR">;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
35
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
36
36
|
|
|
37
|
-
export {
|
|
37
|
+
export { _default as default };
|
|
38
|
+
export type { ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -12,10 +12,10 @@ const module = defineNuxtModule({
|
|
|
12
12
|
setup(options, nuxt) {
|
|
13
13
|
const logger = useLogger("@sit-onyx/nuxt");
|
|
14
14
|
const { resolve } = createResolver(import.meta.url);
|
|
15
|
-
nuxt.options.postcss.plugins.cssnano = { preset: ["default", { calc: false }] };
|
|
16
15
|
nuxt.options.css.push("sit-onyx/style.css");
|
|
17
16
|
if (options.theme !== "onyx") {
|
|
18
|
-
nuxt.options.css.push(`sit-onyx/themes/${options.theme}.css`);
|
|
17
|
+
nuxt.options.css.push(`sit-onyx/themes/${options.theme}-light.css`);
|
|
18
|
+
nuxt.options.css.push(`sit-onyx/themes/${options.theme}-dark.css`);
|
|
19
19
|
}
|
|
20
20
|
if (!options.disableGlobalStyles) {
|
|
21
21
|
nuxt.options.css.push("sit-onyx/global.css");
|
|
@@ -58,10 +58,8 @@ const module = defineNuxtModule({
|
|
|
58
58
|
function getModuleIndex(modules, ...moduleNames) {
|
|
59
59
|
for (let i = 0; i < modules.length; i++) {
|
|
60
60
|
const module = modules[i];
|
|
61
|
-
if (typeof module === "string" && moduleNames.includes(module))
|
|
62
|
-
|
|
63
|
-
if (Array.isArray(module) && moduleNames.includes(module[0]))
|
|
64
|
-
return i;
|
|
61
|
+
if (typeof module === "string" && moduleNames.includes(module)) return i;
|
|
62
|
+
if (Array.isArray(module) && moduleNames.includes(module[0])) return i;
|
|
65
63
|
}
|
|
66
64
|
return -1;
|
|
67
65
|
}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { computed
|
|
2
|
-
import { defineNuxtPlugin, useNuxtApp } from "nuxt/app";
|
|
3
|
-
import {
|
|
1
|
+
import { computed } from "#imports";
|
|
2
|
+
import { defineNuxtPlugin, useNuxtApp, useRouter } from "nuxt/app";
|
|
3
|
+
import { createOnyx } from "sit-onyx";
|
|
4
4
|
export default defineNuxtPlugin({
|
|
5
5
|
name: "onyx:plugin",
|
|
6
6
|
// @ts-ignore: dependency comes from @nuxtjs/i18n
|
|
7
7
|
dependsOn: ["i18n:plugin"],
|
|
8
8
|
setup: (app) => {
|
|
9
9
|
const { t: translate, localeProperties } = useNuxtApp().$i18n;
|
|
10
|
+
const router = useRouter();
|
|
10
11
|
const t = computed(() => {
|
|
11
12
|
return (key, placeholders) => {
|
|
12
13
|
return translate(`onyx.${key}`, placeholders?.n ?? 1, { named: placeholders });
|
|
13
14
|
};
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
app.vueApp.use(
|
|
17
|
+
createOnyx({
|
|
18
|
+
i18n: {
|
|
19
|
+
locale: computed(
|
|
20
|
+
() => localeProperties.value.language ?? localeProperties.value.iso ?? "en-US"
|
|
21
|
+
),
|
|
22
|
+
t
|
|
23
|
+
},
|
|
24
|
+
router
|
|
25
|
+
})
|
|
26
|
+
);
|
|
24
27
|
}
|
|
25
28
|
});
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/nuxt",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.201",
|
|
4
4
|
"description": "A Nuxt module to easily integrate onyx into Nuxt projects",
|
|
5
5
|
"author": "Schwarz IT KG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -16,29 +16,28 @@
|
|
|
16
16
|
"type": "module",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
-
"types": "./dist/types.d.
|
|
19
|
+
"types": "./dist/types.d.mts",
|
|
20
20
|
"import": "./dist/module.mjs",
|
|
21
|
-
"require": "./dist/module.
|
|
21
|
+
"require": "./dist/module.mjs"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"types": "./dist/types.d.ts",
|
|
25
24
|
"files": [
|
|
26
25
|
"dist"
|
|
27
26
|
],
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@nuxt/kit": "^3.12.4"
|
|
30
|
-
},
|
|
31
27
|
"devDependencies": {
|
|
32
|
-
"@nuxt/devtools": "^
|
|
33
|
-
"@nuxt/
|
|
34
|
-
"@nuxt/
|
|
35
|
-
"@nuxt/
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"@nuxt/devtools": "^2.4.0",
|
|
29
|
+
"@nuxt/kit": "^3.16.2",
|
|
30
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
31
|
+
"@nuxt/schema": "^3.16.2",
|
|
32
|
+
"@nuxt/test-utils": "^3.17.2",
|
|
33
|
+
"@nuxtjs/i18n": "^9.5.3",
|
|
34
|
+
"nuxt": "^3.16.2",
|
|
35
|
+
"typescript": "5.8.3",
|
|
36
|
+
"vue-i18n": "^11.1.3",
|
|
37
|
+
"sit-onyx": "^1.0.0-beta.199"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
|
-
"sit-onyx": "^1.0.0-beta.
|
|
40
|
+
"sit-onyx": "^1.0.0-beta.199"
|
|
42
41
|
},
|
|
43
42
|
"scripts": {
|
|
44
43
|
"dev": "nuxi dev playground",
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { OnyxTheme } from 'sit-onyx';
|
|
3
|
-
|
|
4
|
-
interface ModuleOptions {
|
|
5
|
-
/**
|
|
6
|
-
* The onyx theme to use. See: [https://onyx.schwarz/development/theming.html](https://onyx.schwarz/development/theming.html)
|
|
7
|
-
* @default "onyx"
|
|
8
|
-
*/
|
|
9
|
-
theme: OnyxTheme;
|
|
10
|
-
/**
|
|
11
|
-
* By default, the global onyx styles (`global.css` file) will be included
|
|
12
|
-
* which applies some global styles like background color and font styles.
|
|
13
|
-
* This is recommended when building a whole application with onyx.
|
|
14
|
-
*
|
|
15
|
-
* You can set this option to `true` to disable this.
|
|
16
|
-
*
|
|
17
|
-
* @see https://onyx.schwarz/development/#installation
|
|
18
|
-
*/
|
|
19
|
-
disableGlobalStyles?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Settings related to the integration with @nuxtjs/i18n
|
|
22
|
-
*/
|
|
23
|
-
i18n?: {
|
|
24
|
-
/**
|
|
25
|
-
* Mapping for registering the translations from onyx with @nuxtjs/i18n.
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* registerLocales: { "en_US": "en-US" }
|
|
29
|
-
* ```
|
|
30
|
-
* This would register the onyx translations for the language "en-US" to the code "en_US" of your projects locales.
|
|
31
|
-
*/
|
|
32
|
-
registerLocales?: Record<string, "en-US" | "de-DE" | "ko-KR">;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
36
|
-
|
|
37
|
-
export { type ModuleOptions, _default as default };
|
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|