@sit-onyx/nuxt 1.0.0-beta.284 → 1.0.0-beta.286
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 +1 -1
- package/dist/runtime/plugins/onyx.js +17 -13
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -45,8 +45,8 @@ const module = defineNuxtModule({
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
nuxt.hook("i18n:registerModule", registerOnyxLocales);
|
|
48
|
-
addPlugin({ src: resolve("./runtime/plugins/onyx") });
|
|
49
48
|
}
|
|
49
|
+
addPlugin({ src: resolve("./runtime/plugins/onyx") });
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
function getModuleIndex(modules, ...moduleNames) {
|
|
@@ -3,23 +3,27 @@ import { defineNuxtPlugin, useNuxtApp, useRouter } from "nuxt/app";
|
|
|
3
3
|
import { createOnyx } from "sit-onyx";
|
|
4
4
|
export default defineNuxtPlugin({
|
|
5
5
|
name: "onyx:plugin",
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
dependsOn: [],
|
|
7
|
+
// "parallel: false" is the current default but to be resistant for future changes, we explicitly set it to false here
|
|
8
|
+
// see: https://github.com/SchwarzIT/onyx/pull/3832#discussion_r2244487744
|
|
9
|
+
parallel: false,
|
|
8
10
|
setup: (app) => {
|
|
9
|
-
const
|
|
11
|
+
const i18n = useNuxtApp().$i18n;
|
|
10
12
|
const router = useRouter();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const getI18nOptions = () => {
|
|
14
|
+
if (!i18n) return;
|
|
15
|
+
const t = computed(() => {
|
|
16
|
+
return (key, placeholders) => {
|
|
17
|
+
return i18n.t(`onyx.${key}`, placeholders?.n ?? 1, { named: placeholders });
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const locale = computed(() => i18n.localeProperties.value.language ?? "en-US");
|
|
21
|
+
return { t, locale };
|
|
22
|
+
};
|
|
16
23
|
app.vueApp.use(
|
|
17
24
|
createOnyx({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
t
|
|
21
|
-
},
|
|
22
|
-
router
|
|
25
|
+
router,
|
|
26
|
+
i18n: getI18nOptions()
|
|
23
27
|
})
|
|
24
28
|
);
|
|
25
29
|
}
|
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.286",
|
|
4
4
|
"description": "A Nuxt module to easily integrate onyx into Nuxt projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Schwarz IT KG",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"nuxt": "^4.0.1",
|
|
38
38
|
"typescript": "5.8.3",
|
|
39
39
|
"vue-i18n": "^11.1.11",
|
|
40
|
-
"sit-onyx": "^1.0.0-beta.
|
|
40
|
+
"sit-onyx": "^1.0.0-beta.285"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"sit-onyx": "^1.0.0-beta.
|
|
43
|
+
"sit-onyx": "^1.0.0-beta.285"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev": "nuxi dev playground",
|