@sit-onyx/nuxt 1.0.0-beta.27 → 1.0.0-beta.271

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 CHANGED
@@ -1,9 +1,5 @@
1
1
  <div align="center" style="text-align: center">
2
- <picture>
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 { type ModuleOptions, _default as default };
37
+ export { _default as default };
38
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
3
  "configKey": "onyx",
4
- "version": "1.0.0-beta.26",
4
+ "version": "1.0.0-beta.270",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.1",
6
+ "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -12,7 +12,6 @@ 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
17
  nuxt.options.css.push(`sit-onyx/themes/${options.theme}.css`);
@@ -58,10 +57,8 @@ const module = defineNuxtModule({
58
57
  function getModuleIndex(modules, ...moduleNames) {
59
58
  for (let i = 0; i < modules.length; i++) {
60
59
  const module = modules[i];
61
- if (typeof module === "string" && moduleNames.includes(module))
62
- return i;
63
- if (Array.isArray(module) && moduleNames.includes(module[0]))
64
- return i;
60
+ if (typeof module === "string" && moduleNames.includes(module)) return i;
61
+ if (Array.isArray(module) && moduleNames.includes(module[0])) return i;
65
62
  }
66
63
  return -1;
67
64
  }
@@ -1,25 +1,28 @@
1
- import { computed, watchEffect } from "#imports";
2
- import { defineNuxtPlugin, useNuxtApp } from "nuxt/app";
3
- import { provideI18n, syncGlobalOptionalText } from "sit-onyx";
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
- provideI18n(app.vueApp, {
16
- locale: computed(() => localeProperties.value.iso ?? "en-US"),
17
- t
18
- });
19
- app.hook("app:beforeMount", () => {
20
- watchEffect(() => {
21
- syncGlobalOptionalText(translate(`onyx.optional`));
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
@@ -1 +1,3 @@
1
- export { type ModuleOptions, default } from './module.js'
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
- "version": "1.0.0-beta.27",
3
+ "version": "1.0.0-beta.271",
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.ts",
19
+ "types": "./dist/types.d.mts",
20
20
  "import": "./dist/module.mjs",
21
- "require": "./dist/module.cjs"
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": "^1.3.9",
33
- "@nuxt/module-builder": "~0.8.1",
34
- "@nuxt/schema": "^3.12.4",
35
- "@nuxt/test-utils": "^3.14.0",
36
- "@nuxtjs/i18n": "^8.3.3",
37
- "nuxt": "^3.12.4",
38
- "vue-i18n": "^9.13.1"
28
+ "@nuxt/devtools": "^2.5.0",
29
+ "@nuxt/kit": "^3.17.5",
30
+ "@nuxt/module-builder": "^1.0.1",
31
+ "@nuxt/schema": "^3.17.5",
32
+ "@nuxt/test-utils": "^3.19.1",
33
+ "@nuxtjs/i18n": "^9.5.5",
34
+ "nuxt": "^3.17.5",
35
+ "typescript": "5.8.3",
36
+ "vue-i18n": "^11.1.6",
37
+ "sit-onyx": "^1.0.0-beta.269"
39
38
  },
40
39
  "peerDependencies": {
41
- "sit-onyx": "^1.0.0-beta.26"
40
+ "sit-onyx": "^1.0.0-beta.269"
42
41
  },
43
42
  "scripts": {
44
43
  "dev": "nuxi dev playground",
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
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'