@inzombieland/nuxt-common 1.19.19 → 1.19.20
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.d.mts +2 -2
- package/dist/module.json +3 -3
- package/dist/module.mjs +3 -3
- package/dist/runtime/SidebarProvider.d.vue.ts +14 -0
- package/dist/runtime/SidebarProvider.vue +91 -102
- package/dist/runtime/SidebarProvider.vue.d.ts +14 -0
- package/dist/runtime/api/index.d.ts +7 -7
- package/dist/runtime/api/{index.mjs → index.js} +1 -1
- package/dist/runtime/api/user-actions.d.ts +1 -1
- package/dist/runtime/api/user-actions.js +2 -0
- package/dist/runtime/composables/index.d.ts +1 -1
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/use-api-fetch.d.ts +1 -1
- package/dist/runtime/composables/{use-api-fetch.mjs → use-api-fetch.js} +1 -1
- package/dist/runtime/composables/use-layer-manager.d.ts +1 -1
- package/dist/runtime/composables/{use-layer-manager.mjs → use-layer-manager.js} +1 -1
- package/dist/runtime/composables/use-user-actions.d.ts +4 -4
- package/dist/runtime/composables/{use-user-actions.mjs → use-user-actions.js} +1 -1
- package/dist/runtime/middleware/{auth.mjs → auth.js} +1 -1
- package/dist/runtime/middleware/{guest.mjs → guest.js} +1 -1
- package/dist/runtime/middleware/index.d.ts +3 -3
- package/dist/runtime/middleware/index.js +4 -0
- package/dist/runtime/middleware/{locale.global.mjs → locale.global.js} +1 -1
- package/dist/runtime/packages/core/AppProvider.d.vue.ts +14 -0
- package/dist/runtime/packages/core/AppProvider.vue +13 -16
- package/dist/runtime/packages/core/AppProvider.vue.d.ts +14 -0
- package/dist/runtime/packages/core/api-client.d.ts +1 -1
- package/dist/runtime/packages/core/{api-client.mjs → api-client.js} +3 -3
- package/dist/runtime/packages/core/comet-client.d.ts +1 -1
- package/dist/runtime/packages/core/{comet-client.mjs → comet-client.js} +4 -4
- package/dist/runtime/packages/core/composables/index.d.ts +10 -10
- package/dist/runtime/packages/core/composables/index.js +10 -0
- package/dist/runtime/packages/core/composables/use-active-sessions.d.ts +1 -1
- package/dist/runtime/packages/core/composables/{use-active-sessions.mjs → use-active-sessions.js} +1 -1
- package/dist/runtime/packages/core/composables/use-app-locale.d.ts +1 -1
- package/dist/runtime/packages/core/composables/{use-subscribe.mjs → use-subscribe.js} +1 -1
- package/dist/runtime/packages/core/composables/use-theme-mode.d.ts +1 -1
- package/dist/runtime/packages/core/composables/use-user.d.ts +1 -1
- package/dist/runtime/packages/core/composables/use-visitor.d.ts +1 -1
- package/dist/runtime/packages/core/{define-vue-plugins.mjs → define-vue-plugins.js} +1 -1
- package/dist/runtime/packages/core/get-user.d.ts +1 -1
- package/dist/runtime/packages/core/{get-user.mjs → get-user.js} +3 -3
- package/dist/runtime/packages/core/get-visitor.d.ts +1 -1
- package/dist/runtime/packages/core/{get-visitor.mjs → get-visitor.js} +2 -2
- package/dist/runtime/packages/core/helpers/composables.d.ts +4 -4
- package/dist/runtime/packages/core/helpers/composables.js +4 -0
- package/dist/runtime/packages/core/helpers/{device-helper.mjs → device-helper.js} +1 -1
- package/dist/runtime/packages/core/helpers/index.d.ts +5 -5
- package/dist/runtime/packages/core/helpers/{index.mjs → index.js} +5 -5
- package/dist/runtime/packages/core/index.d.ts +18 -18
- package/dist/runtime/packages/core/{index.mjs → index.js} +11 -11
- package/dist/runtime/packages/core/{init-application.mjs → init-application.js} +3 -3
- package/dist/runtime/packages/core/plugins/index.d.ts +2 -2
- package/dist/runtime/packages/core/plugins/index.js +2 -0
- package/dist/runtime/packages/core/plugins/{sanitize-url.mjs → sanitize-url.js} +1 -1
- package/dist/runtime/packages/core/refresh-token.d.ts +1 -1
- package/dist/runtime/packages/core/{refresh-token.mjs → refresh-token.js} +2 -2
- package/dist/runtime/packages/core/user-actions.d.ts +1 -1
- package/dist/runtime/packages/core/{user-actions.mjs → user-actions.js} +3 -3
- package/dist/runtime/packages/layer-manager/LayerComponent.d.vue.ts +6 -0
- package/dist/runtime/packages/layer-manager/LayerComponent.vue +23 -28
- package/dist/runtime/packages/layer-manager/LayerComponent.vue.d.ts +6 -0
- package/dist/runtime/packages/layer-manager/LayersProvider.d.vue.ts +10 -0
- package/dist/runtime/packages/layer-manager/LayersProvider.vue +142 -164
- package/dist/runtime/packages/layer-manager/LayersProvider.vue.d.ts +10 -0
- package/dist/runtime/packages/layer-manager/index.d.ts +1 -1
- package/dist/runtime/packages/layer-manager/use-layer-actions.d.ts +1 -1
- package/dist/runtime/{plugin.mjs → plugin.js} +4 -4
- package/dist/runtime/plugins/{device.mjs → device.js} +1 -1
- package/dist/types.d.mts +2 -7
- package/package.json +24 -17
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/runtime/api/user-actions.mjs +0 -2
- package/dist/runtime/composables/index.mjs +0 -1
- package/dist/runtime/middleware/index.mjs +0 -4
- package/dist/runtime/packages/core/composables/index.mjs +0 -10
- package/dist/runtime/packages/core/helpers/composables.mjs +0 -4
- package/dist/runtime/packages/core/plugins/index.mjs +0 -2
- package/dist/types.d.ts +0 -8
- /package/dist/runtime/api/account/{account.get.mjs → account.get.js} +0 -0
- /package/dist/runtime/api/account/{authcheck.get.mjs → authcheck.get.js} +0 -0
- /package/dist/runtime/api/account/{default-handler.mjs → default-handler.js} +0 -0
- /package/dist/runtime/api/account/{middleware.mjs → middleware.js} +0 -0
- /package/dist/runtime/api/account/{token.get.mjs → token.get.js} +0 -0
- /package/dist/runtime/composables/{use-toggle-sidebar.mjs → use-toggle-sidebar.js} +0 -0
- /package/dist/runtime/packages/core/{bus.mjs → bus.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-api-actions.mjs → use-api-actions.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-app-locale.mjs → use-app-locale.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-cookies.mjs → use-cookies.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-theme-mode.mjs → use-theme-mode.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-user.mjs → use-user.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-validators.mjs → use-validators.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-visitor.mjs → use-visitor.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{api-helper.mjs → api-helper.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{current-device.mjs → current-device.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{phone-helper.mjs → phone-helper.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{string-helper.mjs → string-helper.js} +0 -0
- /package/dist/runtime/packages/core/plugins/{sanitize-html.mjs → sanitize-html.js} +0 -0
- /package/dist/runtime/packages/core/thirdparty/sanitize-url/{index.mjs → index.js} +0 -0
- /package/dist/runtime/packages/core/{types.mjs → types.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{index.mjs → index.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{types.mjs → types.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{use-layer-actions.mjs → use-layer-actions.js} +0 -0
- /package/dist/runtime/server/middleware/{basic-auth.mjs → basic-auth.js} +0 -0
- /package/dist/runtime/thirdparty/helpers/{index.mjs → index.js} +0 -0
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
|
|
3
3
|
interface ModuleOptions {
|
|
4
4
|
}
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
6
|
|
|
7
7
|
export { _default as default };
|
|
8
8
|
export type { ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.19.
|
|
5
|
+
const version = "1.19.20";
|
|
6
6
|
|
|
7
|
-
const module = defineNuxtModule({
|
|
7
|
+
const module$1 = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
9
9
|
name,
|
|
10
10
|
version,
|
|
@@ -59,4 +59,4 @@ const module = defineNuxtModule({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
export { module as default };
|
|
62
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
sidebar?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
content?: (props: typeof __VLS_3) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,110 +1,99 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { useSwipe
|
|
3
|
-
import { onMounted, ref, watch } from "vue"
|
|
4
|
-
import { useDevice } from "./composables"
|
|
5
|
-
import { useToggleSidebar } from "./composables/use-toggle-sidebar"
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const toggleSidebar = useToggleSidebar()
|
|
13
|
-
const $device = useDevice()
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useSwipe } from "@vueuse/core";
|
|
3
|
+
import { onMounted, ref, watch } from "vue";
|
|
4
|
+
import { useDevice } from "./composables";
|
|
5
|
+
import { useToggleSidebar } from "./composables/use-toggle-sidebar";
|
|
6
|
+
const sidebarRef = ref(null);
|
|
7
|
+
const contentRef = ref(null);
|
|
8
|
+
const sidebarBackdropRef = ref(null);
|
|
9
|
+
const sidebar = ref("hidden");
|
|
10
|
+
const toggleSidebar = useToggleSidebar();
|
|
11
|
+
const $device = useDevice();
|
|
14
12
|
const sidebarClass = ref({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
13
|
+
sidebar: true,
|
|
14
|
+
"sidebar-open": sidebar.value === "open",
|
|
15
|
+
"sidebar-hidden": sidebar.value === "hidden"
|
|
16
|
+
});
|
|
19
17
|
const contentClass = ref({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
18
|
+
content: true,
|
|
19
|
+
"sidebar-open": sidebar.value === "open",
|
|
20
|
+
"sidebar-hidden": sidebar.value === "hidden"
|
|
21
|
+
});
|
|
24
22
|
const sidebarBackdropClass = ref({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
23
|
+
sidebarBackdrop: true,
|
|
24
|
+
"sidebar-open": sidebar.value === "open",
|
|
25
|
+
"sidebar-hidden": sidebar.value === "hidden"
|
|
26
|
+
});
|
|
27
|
+
watch(sidebar, (value) => {
|
|
28
|
+
sidebarClass.value["sidebar-open"] = value === "open";
|
|
29
|
+
sidebarClass.value["sidebar-hidden"] = value === "hidden";
|
|
30
|
+
contentClass.value["sidebar-open"] = value === "open";
|
|
31
|
+
contentClass.value["sidebar-hidden"] = value === "hidden";
|
|
32
|
+
sidebarBackdropClass.value["sidebar-open"] = value === "open";
|
|
33
|
+
sidebarBackdropClass.value["sidebar-hidden"] = value === "hidden";
|
|
34
|
+
});
|
|
39
35
|
onMounted(() => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
sidebarRef.value.style.transition = "width 0.25s ease"
|
|
100
|
-
}
|
|
101
|
-
if (contentRef.value) {
|
|
102
|
-
contentRef.value.style.transition = "left 0.25s ease"
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
|
|
36
|
+
toggleSidebar.value = () => {
|
|
37
|
+
if (localStorage.sidebar === "hidden" || sidebarRef.value?.clientWidth === 0) {
|
|
38
|
+
localStorage.sidebar = "open";
|
|
39
|
+
sidebar.value = "open";
|
|
40
|
+
} else {
|
|
41
|
+
localStorage.sidebar = "hidden";
|
|
42
|
+
sidebar.value = "hidden";
|
|
43
|
+
}
|
|
44
|
+
return sidebar.value;
|
|
45
|
+
};
|
|
46
|
+
useSwipe(sidebarRef, {
|
|
47
|
+
onSwipeEnd(e, direction) {
|
|
48
|
+
if (direction === "left") {
|
|
49
|
+
localStorage.sidebar = "hidden";
|
|
50
|
+
sidebar.value = "hidden";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
sidebarBackdropRef.value?.addEventListener(
|
|
55
|
+
"click",
|
|
56
|
+
() => {
|
|
57
|
+
sidebar.value = "hidden";
|
|
58
|
+
},
|
|
59
|
+
false
|
|
60
|
+
);
|
|
61
|
+
if ($device.desktop()) {
|
|
62
|
+
let timer;
|
|
63
|
+
sidebarRef.value?.addEventListener(
|
|
64
|
+
"mouseover",
|
|
65
|
+
() => {
|
|
66
|
+
if (localStorage.sidebar === "hidden") {
|
|
67
|
+
clearTimeout(timer);
|
|
68
|
+
timer = setTimeout(function() {
|
|
69
|
+
sidebar.value = "open";
|
|
70
|
+
}, 200);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
false
|
|
74
|
+
);
|
|
75
|
+
sidebarRef.value?.addEventListener(
|
|
76
|
+
"mouseleave",
|
|
77
|
+
() => {
|
|
78
|
+
if (localStorage.sidebar === "hidden") {
|
|
79
|
+
clearTimeout(timer);
|
|
80
|
+
timer = setTimeout(function() {
|
|
81
|
+
sidebar.value = "hidden";
|
|
82
|
+
}, 100);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
false
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
if (sidebarRef.value) {
|
|
89
|
+
sidebarRef.value.style.transition = "width 0.25s ease";
|
|
90
|
+
}
|
|
91
|
+
if (contentRef.value) {
|
|
92
|
+
contentRef.value.style.transition = "left 0.25s ease";
|
|
93
|
+
}
|
|
94
|
+
});
|
|
106
95
|
if (typeof window !== "undefined" && $device.desktop()) {
|
|
107
|
-
|
|
96
|
+
sidebar.value = localStorage.sidebar === "hidden" ? "hidden" : "open";
|
|
108
97
|
}
|
|
109
98
|
</script>
|
|
110
99
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
sidebar?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
content?: (props: typeof __VLS_3) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Fetch } from "../packages/core";
|
|
1
|
+
import { type Fetch } from "../packages/core/index.js";
|
|
2
2
|
export declare const config: {
|
|
3
3
|
apiBaseURL: any;
|
|
4
4
|
cometServerURL: any;
|
|
@@ -8,7 +8,7 @@ export declare const config: {
|
|
|
8
8
|
isDesktopApp: any;
|
|
9
9
|
appName: any;
|
|
10
10
|
getHostname: () => string;
|
|
11
|
-
getDevice: () => Promise<
|
|
11
|
+
getDevice: () => Promise<any>;
|
|
12
12
|
useRequestHeaders: (include?: string[]) => {
|
|
13
13
|
baseURL: string;
|
|
14
14
|
headers: {
|
|
@@ -16,15 +16,15 @@ export declare const config: {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
declare const fetch: Fetch, getUser: () => Promise<import("
|
|
20
|
-
signIn: (body: Record<string, any>) => Promise<import("
|
|
19
|
+
declare const fetch: Fetch, getUser: () => Promise<import("../packages/core/index.js").GetUserResponse>, useApiFetch: () => Fetch, userActions: {
|
|
20
|
+
signIn: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse | {
|
|
21
21
|
key: string;
|
|
22
22
|
}>;
|
|
23
23
|
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
24
24
|
key: string;
|
|
25
25
|
}>;
|
|
26
|
-
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("
|
|
27
|
-
getToken: (body: Record<string, any>) => Promise<import("
|
|
26
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse>;
|
|
27
|
+
getToken: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse>;
|
|
28
28
|
signUp: (body: Record<string, any>) => Promise<{
|
|
29
29
|
key: string;
|
|
30
30
|
}>;
|
|
@@ -99,7 +99,7 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
|
|
|
99
99
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
100
100
|
deleteAvatar: () => Promise<void>;
|
|
101
101
|
fetchActiveSessions: () => Promise<{
|
|
102
|
-
sessions: import("
|
|
102
|
+
sessions: import("../packages/core/index.js").ActiveSession[];
|
|
103
103
|
}>;
|
|
104
104
|
logoutActiveSession: (body: {
|
|
105
105
|
sessionId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useNuxtApp, useRequestHeaders, useRequestURL } from "#imports";
|
|
2
|
-
import { initApiFetch } from "../packages/core/index.
|
|
2
|
+
import { initApiFetch } from "../packages/core/index.js";
|
|
3
3
|
export const config = {
|
|
4
4
|
apiBaseURL: import.meta.env.VITE_API_BASE_URL,
|
|
5
5
|
cometServerURL: import.meta.env.VITE_COMET_SERVER_URL,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { userActions } from "./index";
|
|
1
|
+
import { userActions } from "./index.js";
|
|
2
2
|
export default userActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../packages/core/composables";
|
|
1
|
+
export * from "../packages/core/composables/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../packages/core/composables/index.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const useUserActions: () => {
|
|
2
|
-
signIn: (body: Record<string, any>) => Promise<import("
|
|
2
|
+
signIn: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse | {
|
|
3
3
|
key: string;
|
|
4
4
|
}>;
|
|
5
5
|
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
6
6
|
key: string;
|
|
7
7
|
}>;
|
|
8
|
-
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("
|
|
9
|
-
getToken: (body: Record<string, any>) => Promise<import("
|
|
8
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse>;
|
|
9
|
+
getToken: (body: Record<string, any>) => Promise<import("../packages/core/index.js").GetUserResponse>;
|
|
10
10
|
signUp: (body: Record<string, any>) => Promise<{
|
|
11
11
|
key: string;
|
|
12
12
|
}>;
|
|
@@ -81,7 +81,7 @@ export declare const useUserActions: () => {
|
|
|
81
81
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
82
82
|
deleteAvatar: () => Promise<void>;
|
|
83
83
|
fetchActiveSessions: () => Promise<{
|
|
84
|
-
sessions: import("
|
|
84
|
+
sessions: import("../packages/core/index.js").ActiveSession[];
|
|
85
85
|
}>;
|
|
86
86
|
logoutActiveSession: (body: {
|
|
87
87
|
sessionId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtRouteMiddleware, navigateTo } from "#app";
|
|
2
2
|
import { useLocalePath } from "#i18n";
|
|
3
|
-
import { useUser } from "../packages/core/index.
|
|
3
|
+
import { useUser } from "../packages/core/index.js";
|
|
4
4
|
export default defineNuxtRouteMiddleware(() => {
|
|
5
5
|
const user = useUser();
|
|
6
6
|
if (!user.value) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtRouteMiddleware, navigateTo } from "#app";
|
|
2
2
|
import { useLocalePath } from "#i18n";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
|
-
import { useUser } from "../packages/core/index.
|
|
4
|
+
import { useUser } from "../packages/core/index.js";
|
|
5
5
|
export default defineNuxtRouteMiddleware(() => {
|
|
6
6
|
const user = useUser();
|
|
7
7
|
if (user.value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import authMiddleware from "./auth";
|
|
2
|
-
import guestMiddleware from "./guest";
|
|
3
|
-
import localeMiddleware from "./locale.global";
|
|
1
|
+
import authMiddleware from "./auth.js";
|
|
2
|
+
import guestMiddleware from "./guest.js";
|
|
3
|
+
import localeMiddleware from "./locale.global.js";
|
|
4
4
|
export { authMiddleware, guestMiddleware, localeMiddleware };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtRouteMiddleware, navigateTo } from "#app";
|
|
2
2
|
import { useCookie, useRuntimeConfig } from "#imports";
|
|
3
|
-
import { useUser } from "../packages/core/index.
|
|
3
|
+
import { useUser } from "../packages/core/index.js";
|
|
4
4
|
export default defineNuxtRouteMiddleware((to) => {
|
|
5
5
|
if (import.meta.server) return;
|
|
6
6
|
const user = useUser();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const useBus: () => {
|
|
2
|
+
publish<T>(eventName: string, data: T): void;
|
|
3
|
+
subscribe<T>(eventName: string, func: (data: T) => void): import("rxjs").Subscription;
|
|
4
|
+
unsubscribeAll(): void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
7
|
+
default?: (props: {}) => any;
|
|
8
|
+
}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { onBeforeMount, onMounted, ref } from "vue"
|
|
3
|
-
import bus from "./bus"
|
|
4
|
-
import { useUser } from "./index"
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const appLoading = ref(Boolean(user.value))
|
|
8
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onBeforeMount, onMounted, ref } from "vue";
|
|
3
|
+
import bus from "./bus";
|
|
4
|
+
import { useUser } from "./index";
|
|
5
|
+
const user = useUser();
|
|
6
|
+
const appLoading = ref(Boolean(user.value));
|
|
9
7
|
onBeforeMount(() => {
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
|
|
8
|
+
bus.publish("app:beforeMount", true);
|
|
9
|
+
});
|
|
13
10
|
onMounted(() => {
|
|
14
|
-
|
|
15
|
-
})
|
|
11
|
+
appLoading.value = false;
|
|
12
|
+
});
|
|
16
13
|
</script>
|
|
17
14
|
|
|
18
|
-
<script
|
|
15
|
+
<script>
|
|
19
16
|
export const useBus = () => {
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
return bus;
|
|
18
|
+
};
|
|
22
19
|
</script>
|
|
23
20
|
|
|
24
21
|
<template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const useBus: () => {
|
|
2
|
+
publish<T>(eventName: string, data: T): void;
|
|
3
|
+
subscribe<T>(eventName: string, func: (data: T) => void): import("rxjs").Subscription;
|
|
4
|
+
unsubscribeAll(): void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
7
|
+
default?: (props: {}) => any;
|
|
8
|
+
}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fetch, FetchConfig, FetchExtraOptions as FetchOptions, User } from "./types";
|
|
1
|
+
import type { Fetch, FetchConfig, FetchExtraOptions as FetchOptions, User } from "./types.js";
|
|
2
2
|
export declare const setUser: (newUser?: User | null) => void;
|
|
3
3
|
export declare const updateUser: (newUser: Partial<User>) => void;
|
|
4
4
|
export declare const getToken: () => string | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useApiActions, useUser, useVisitor } from "./composables/index.
|
|
2
|
-
import { apiHelper, once } from "./helpers/index.
|
|
3
|
-
import { useBus } from "./index.
|
|
1
|
+
import { useApiActions, useUser, useVisitor } from "./composables/index.js";
|
|
2
|
+
import { apiHelper, once } from "./helpers/index.js";
|
|
3
|
+
import { useBus } from "./index.js";
|
|
4
4
|
let token = null;
|
|
5
5
|
let secretKey;
|
|
6
6
|
export const setUser = (newUser) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Centrifuge } from "centrifuge";
|
|
2
|
-
import { getToken } from "./api-client.
|
|
3
|
-
import { useApiActions } from "./composables/index.
|
|
4
|
-
import { apiHelper } from "./helpers/index.
|
|
5
|
-
import { useBus } from "./index.
|
|
2
|
+
import { getToken } from "./api-client.js";
|
|
3
|
+
import { useApiActions } from "./composables/index.js";
|
|
4
|
+
import { apiHelper } from "./helpers/index.js";
|
|
5
|
+
import { useBus } from "./index.js";
|
|
6
6
|
if (typeof window !== "undefined" && import.meta.env.VITE_MODE !== "production") {
|
|
7
7
|
window.wsPublish = (eventName, data) => {
|
|
8
8
|
const bus = useBus();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "../helpers/composables";
|
|
2
|
-
export * from "./use-active-sessions";
|
|
3
|
-
export { useApiActions } from "./use-api-actions";
|
|
4
|
-
export { useAppLocale } from "./use-app-locale";
|
|
5
|
-
export { useCookies } from "./use-cookies";
|
|
6
|
-
export { useSubscribe } from "./use-subscribe";
|
|
7
|
-
export { useThemeMode } from "./use-theme-mode";
|
|
8
|
-
export { useUser } from "./use-user";
|
|
9
|
-
export { useValidators } from "./use-validators";
|
|
10
|
-
export { useVisitor } from "./use-visitor";
|
|
1
|
+
export * from "../helpers/composables.js";
|
|
2
|
+
export * from "./use-active-sessions.js";
|
|
3
|
+
export { useApiActions } from "./use-api-actions.js";
|
|
4
|
+
export { useAppLocale } from "./use-app-locale.js";
|
|
5
|
+
export { useCookies } from "./use-cookies.js";
|
|
6
|
+
export { useSubscribe } from "./use-subscribe.js";
|
|
7
|
+
export { useThemeMode } from "./use-theme-mode.js";
|
|
8
|
+
export { useUser } from "./use-user.js";
|
|
9
|
+
export { useValidators } from "./use-validators.js";
|
|
10
|
+
export { useVisitor } from "./use-visitor.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "../helpers/composables.js";
|
|
2
|
+
export * from "./use-active-sessions.js";
|
|
3
|
+
export { useApiActions } from "./use-api-actions.js";
|
|
4
|
+
export { useAppLocale } from "./use-app-locale.js";
|
|
5
|
+
export { useCookies } from "./use-cookies.js";
|
|
6
|
+
export { useSubscribe } from "./use-subscribe.js";
|
|
7
|
+
export { useThemeMode } from "./use-theme-mode.js";
|
|
8
|
+
export { useUser } from "./use-user.js";
|
|
9
|
+
export { useValidators } from "./use-validators.js";
|
|
10
|
+
export { useVisitor } from "./use-visitor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useAppLocale: () =>
|
|
1
|
+
export declare const useAppLocale: () => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { onMounted, onUnmounted } from "vue";
|
|
2
|
-
import { useBus } from "../index.
|
|
2
|
+
import { useBus } from "../index.js";
|
|
3
3
|
export const useSubscribe = (eventName, func, options = { once: false, unsubscribeOnUnmount: true }) => {
|
|
4
4
|
const bus = useBus();
|
|
5
5
|
let subscription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useThemeMode: () =>
|
|
1
|
+
export declare const useThemeMode: () => any;
|