@shwfed/nuxt 0.1.58 → 0.1.59
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
CHANGED
|
@@ -316,12 +316,11 @@ const activeTab = useSessionStorage("navigation-active-tab", void 0, {
|
|
|
316
316
|
onMounted(() => {
|
|
317
317
|
const baseRaw = app.baseURL ?? "/";
|
|
318
318
|
const base = baseRaw === "" || baseRaw === "/" ? "/" : baseRaw.replace(/\/*$/, "") + "/";
|
|
319
|
-
const pathOnly = route.fullPath.replace(/\?.*$/, "").replace(/#.*$/, "");
|
|
320
319
|
let pathToMatch;
|
|
321
320
|
if (base === "/") {
|
|
322
|
-
pathToMatch =
|
|
323
|
-
} else if (
|
|
324
|
-
const remainder =
|
|
321
|
+
pathToMatch = route.path;
|
|
322
|
+
} else if (route.fullPath.startsWith(base)) {
|
|
323
|
+
const remainder = route.fullPath.slice(base.length) || "/";
|
|
325
324
|
pathToMatch = remainder.startsWith("/") ? remainder : `/${remainder}`;
|
|
326
325
|
} else {
|
|
327
326
|
pathToMatch = route.path;
|
|
@@ -680,7 +679,7 @@ useHead({
|
|
|
680
679
|
</Sidebar>
|
|
681
680
|
</SidebarProvider>
|
|
682
681
|
<main class="flex-1 flex flex-col bg-zinc-100 overflow-hidden">
|
|
683
|
-
<nav class="bg-white p-1 border-b border-zinc-100 h-10 flex items-center justify-start gap-1 overflow-x-hidden
|
|
682
|
+
<nav class="bg-white p-1 border-b border-zinc-100 h-10 flex items-center justify-start gap-1 overflow-x-hidden min-w-0">
|
|
684
683
|
<div
|
|
685
684
|
v-for="tab in tabs"
|
|
686
685
|
:key="tab"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { defineNuxtPlugin, navigateTo, useNuxtApp, useRuntimeConfig } from "#app";
|
|
2
|
+
import { useNavigatorLanguage } from "@vueuse/core";
|
|
2
3
|
import z from "zod";
|
|
3
4
|
export default defineNuxtPlugin({
|
|
4
5
|
name: "shwfed-nuxt:api",
|
|
5
6
|
dependsOn: ["shwfed-nuxt:cel"],
|
|
6
7
|
setup: (nuxt) => {
|
|
8
|
+
const locale = useNavigatorLanguage();
|
|
7
9
|
const config = useRuntimeConfig().public.shwfed;
|
|
8
10
|
const { $dsl } = useNuxtApp();
|
|
9
11
|
const api = $fetch.create({
|
|
@@ -26,6 +28,9 @@ export default defineNuxtPlugin({
|
|
|
26
28
|
} catch {
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
if (locale.isSupported && locale.language.value) {
|
|
32
|
+
options.headers.set("Accept-Language", locale.language.value);
|
|
33
|
+
}
|
|
29
34
|
},
|
|
30
35
|
onResponse: ({ response }) => {
|
|
31
36
|
const authorizeUri = config.apis.authorizeUri;
|