@shwfed/nuxt 0.1.76 → 0.1.77

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "@shwfed/nuxt",
4
- "version": "0.1.76",
4
+ "version": "0.1.77",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -67,13 +67,13 @@ type __VLS_Props = {
67
67
  */
68
68
  commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
69
69
  };
70
- declare var __VLS_108: {}, __VLS_124: {}, __VLS_334: {};
70
+ declare var __VLS_108: {}, __VLS_124: {}, __VLS_347: {};
71
71
  type __VLS_Slots = {} & {
72
72
  menu?: (props: typeof __VLS_108) => any;
73
73
  } & {
74
74
  profile?: (props: typeof __VLS_124) => any;
75
75
  } & {
76
- default?: (props: typeof __VLS_334) => any;
76
+ default?: (props: typeof __VLS_347) => any;
77
77
  };
78
78
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
79
79
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { useHead, useNuxtApp } from "#app";
2
+ import { useHead, useNuxtApp, useRuntimeConfig } from "#app";
3
3
  import { reactive } from "vue";
4
4
  import { CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "./ui/command";
5
5
  import { TooltipProvider } from "./ui/tooltip";
@@ -15,6 +15,11 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem,
15
15
  import Logo from "./logo.vue";
16
16
  import { useFavorite } from "../composables/useFavorite";
17
17
  import { useNavigationTabs } from "../composables/useNavigationTabs";
18
+ const {
19
+ public: {
20
+ shwfed
21
+ }
22
+ } = useRuntimeConfig();
18
23
  const { $dsl } = useNuxtApp();
19
24
  const { t } = useI18n();
20
25
  const props = defineProps({
@@ -48,6 +53,11 @@ const {
48
53
  toggle: toggleNavigationFavorite,
49
54
  withFavorites: navigations
50
55
  } = useFavorite("navigation", () => props.sidebar ?? []);
56
+ const logout = () => {
57
+ if (shwfed.api.logout)
58
+ window.location.href = shwfed.api.logout;
59
+ return Effect.void;
60
+ };
51
61
  </script>
52
62
 
53
63
  <template>
@@ -211,6 +221,14 @@ const {
211
221
  {{ command.title }}
212
222
  </DropdownMenuItem>
213
223
  </template>
224
+ <DropdownMenuItem
225
+ @select="logout"
226
+ >
227
+ <Icon
228
+ icon="fluent:sign-out-20-regular"
229
+ />
230
+ {{ t("logout") }}
231
+ </DropdownMenuItem>
214
232
  <DropdownMenuSeparator v-if="props.commands?.some((command2) => 'children' in command2 ? command2.children.some((child2) => !child2.hidden) : !command2.hidden)" />
215
233
  <DropdownMenuItem disabled>
216
234
  <Icon icon="fluent:history-20-regular" />
@@ -67,13 +67,13 @@ type __VLS_Props = {
67
67
  */
68
68
  commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
69
69
  };
70
- declare var __VLS_108: {}, __VLS_124: {}, __VLS_334: {};
70
+ declare var __VLS_108: {}, __VLS_124: {}, __VLS_347: {};
71
71
  type __VLS_Slots = {} & {
72
72
  menu?: (props: typeof __VLS_108) => any;
73
73
  } & {
74
74
  profile?: (props: typeof __VLS_124) => any;
75
75
  } & {
76
- default?: (props: typeof __VLS_334) => any;
76
+ default?: (props: typeof __VLS_347) => any;
77
77
  };
78
78
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
79
79
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",