@inzombieland/nuxt-common 1.19.18 → 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.
Files changed (107) hide show
  1. package/dist/module.d.mts +2 -2
  2. package/dist/module.json +3 -3
  3. package/dist/module.mjs +3 -3
  4. package/dist/runtime/SidebarProvider.d.vue.ts +14 -0
  5. package/dist/runtime/SidebarProvider.vue +91 -102
  6. package/dist/runtime/SidebarProvider.vue.d.ts +14 -0
  7. package/dist/runtime/api/index.d.ts +7 -7
  8. package/dist/runtime/api/{index.mjs → index.js} +1 -1
  9. package/dist/runtime/api/user-actions.d.ts +1 -1
  10. package/dist/runtime/api/user-actions.js +2 -0
  11. package/dist/runtime/composables/index.d.ts +1 -1
  12. package/dist/runtime/composables/index.js +1 -0
  13. package/dist/runtime/composables/use-api-fetch.d.ts +1 -1
  14. package/dist/runtime/composables/{use-api-fetch.mjs → use-api-fetch.js} +1 -1
  15. package/dist/runtime/composables/use-layer-manager.d.ts +1 -1
  16. package/dist/runtime/composables/{use-layer-manager.mjs → use-layer-manager.js} +1 -1
  17. package/dist/runtime/composables/use-user-actions.d.ts +4 -4
  18. package/dist/runtime/composables/{use-user-actions.mjs → use-user-actions.js} +1 -1
  19. package/dist/runtime/middleware/{auth.mjs → auth.js} +1 -1
  20. package/dist/runtime/middleware/{guest.mjs → guest.js} +1 -1
  21. package/dist/runtime/middleware/index.d.ts +3 -3
  22. package/dist/runtime/middleware/index.js +4 -0
  23. package/dist/runtime/middleware/{locale.global.mjs → locale.global.js} +1 -1
  24. package/dist/runtime/packages/core/AppProvider.d.vue.ts +14 -0
  25. package/dist/runtime/packages/core/AppProvider.vue +13 -16
  26. package/dist/runtime/packages/core/AppProvider.vue.d.ts +14 -0
  27. package/dist/runtime/packages/core/api-client.d.ts +1 -1
  28. package/dist/runtime/packages/core/{api-client.mjs → api-client.js} +3 -3
  29. package/dist/runtime/packages/core/comet-client.d.ts +1 -1
  30. package/dist/runtime/packages/core/{comet-client.mjs → comet-client.js} +4 -4
  31. package/dist/runtime/packages/core/composables/index.d.ts +10 -10
  32. package/dist/runtime/packages/core/composables/index.js +10 -0
  33. package/dist/runtime/packages/core/composables/use-active-sessions.d.ts +1 -1
  34. package/dist/runtime/packages/core/composables/{use-active-sessions.mjs → use-active-sessions.js} +1 -1
  35. package/dist/runtime/packages/core/composables/use-app-locale.d.ts +1 -1
  36. package/dist/runtime/packages/core/composables/{use-subscribe.mjs → use-subscribe.js} +1 -1
  37. package/dist/runtime/packages/core/composables/use-theme-mode.d.ts +1 -1
  38. package/dist/runtime/packages/core/composables/use-user.d.ts +1 -1
  39. package/dist/runtime/packages/core/composables/use-visitor.d.ts +1 -1
  40. package/dist/runtime/packages/core/{define-vue-plugins.mjs → define-vue-plugins.js} +1 -1
  41. package/dist/runtime/packages/core/get-user.d.ts +1 -1
  42. package/dist/runtime/packages/core/{get-user.mjs → get-user.js} +3 -3
  43. package/dist/runtime/packages/core/get-visitor.d.ts +1 -1
  44. package/dist/runtime/packages/core/{get-visitor.mjs → get-visitor.js} +3 -10
  45. package/dist/runtime/packages/core/helpers/composables.d.ts +4 -4
  46. package/dist/runtime/packages/core/helpers/composables.js +4 -0
  47. package/dist/runtime/packages/core/helpers/{device-helper.mjs → device-helper.js} +1 -1
  48. package/dist/runtime/packages/core/helpers/index.d.ts +5 -5
  49. package/dist/runtime/packages/core/helpers/{index.mjs → index.js} +5 -5
  50. package/dist/runtime/packages/core/index.d.ts +18 -18
  51. package/dist/runtime/packages/core/{index.mjs → index.js} +11 -11
  52. package/dist/runtime/packages/core/{init-application.mjs → init-application.js} +3 -3
  53. package/dist/runtime/packages/core/package.json +1 -1
  54. package/dist/runtime/packages/core/plugins/index.d.ts +2 -2
  55. package/dist/runtime/packages/core/plugins/index.js +2 -0
  56. package/dist/runtime/packages/core/plugins/{sanitize-url.mjs → sanitize-url.js} +1 -1
  57. package/dist/runtime/packages/core/refresh-token.d.ts +1 -1
  58. package/dist/runtime/packages/core/{refresh-token.mjs → refresh-token.js} +2 -2
  59. package/dist/runtime/packages/core/user-actions.d.ts +1 -1
  60. package/dist/runtime/packages/core/{user-actions.mjs → user-actions.js} +3 -3
  61. package/dist/runtime/packages/layer-manager/LayerComponent.d.vue.ts +6 -0
  62. package/dist/runtime/packages/layer-manager/LayerComponent.vue +23 -28
  63. package/dist/runtime/packages/layer-manager/LayerComponent.vue.d.ts +6 -0
  64. package/dist/runtime/packages/layer-manager/LayersProvider.d.vue.ts +10 -0
  65. package/dist/runtime/packages/layer-manager/LayersProvider.vue +142 -164
  66. package/dist/runtime/packages/layer-manager/LayersProvider.vue.d.ts +10 -0
  67. package/dist/runtime/packages/layer-manager/index.d.ts +1 -1
  68. package/dist/runtime/packages/layer-manager/use-layer-actions.d.ts +1 -1
  69. package/dist/runtime/{plugin.mjs → plugin.js} +4 -4
  70. package/dist/runtime/plugins/{device.mjs → device.js} +1 -1
  71. package/dist/types.d.mts +2 -7
  72. package/package.json +24 -17
  73. package/dist/module.cjs +0 -5
  74. package/dist/module.d.ts +0 -8
  75. package/dist/runtime/api/user-actions.mjs +0 -2
  76. package/dist/runtime/composables/index.mjs +0 -1
  77. package/dist/runtime/middleware/index.mjs +0 -4
  78. package/dist/runtime/packages/core/composables/index.mjs +0 -10
  79. package/dist/runtime/packages/core/helpers/composables.mjs +0 -4
  80. package/dist/runtime/packages/core/plugins/index.mjs +0 -2
  81. package/dist/types.d.ts +0 -8
  82. /package/dist/runtime/api/account/{account.get.mjs → account.get.js} +0 -0
  83. /package/dist/runtime/api/account/{authcheck.get.mjs → authcheck.get.js} +0 -0
  84. /package/dist/runtime/api/account/{default-handler.mjs → default-handler.js} +0 -0
  85. /package/dist/runtime/api/account/{middleware.mjs → middleware.js} +0 -0
  86. /package/dist/runtime/api/account/{token.get.mjs → token.get.js} +0 -0
  87. /package/dist/runtime/composables/{use-toggle-sidebar.mjs → use-toggle-sidebar.js} +0 -0
  88. /package/dist/runtime/packages/core/{bus.mjs → bus.js} +0 -0
  89. /package/dist/runtime/packages/core/composables/{use-api-actions.mjs → use-api-actions.js} +0 -0
  90. /package/dist/runtime/packages/core/composables/{use-app-locale.mjs → use-app-locale.js} +0 -0
  91. /package/dist/runtime/packages/core/composables/{use-cookies.mjs → use-cookies.js} +0 -0
  92. /package/dist/runtime/packages/core/composables/{use-theme-mode.mjs → use-theme-mode.js} +0 -0
  93. /package/dist/runtime/packages/core/composables/{use-user.mjs → use-user.js} +0 -0
  94. /package/dist/runtime/packages/core/composables/{use-validators.mjs → use-validators.js} +0 -0
  95. /package/dist/runtime/packages/core/composables/{use-visitor.mjs → use-visitor.js} +0 -0
  96. /package/dist/runtime/packages/core/helpers/{api-helper.mjs → api-helper.js} +0 -0
  97. /package/dist/runtime/packages/core/helpers/{current-device.mjs → current-device.js} +0 -0
  98. /package/dist/runtime/packages/core/helpers/{phone-helper.mjs → phone-helper.js} +0 -0
  99. /package/dist/runtime/packages/core/helpers/{string-helper.mjs → string-helper.js} +0 -0
  100. /package/dist/runtime/packages/core/plugins/{sanitize-html.mjs → sanitize-html.js} +0 -0
  101. /package/dist/runtime/packages/core/thirdparty/sanitize-url/{index.mjs → index.js} +0 -0
  102. /package/dist/runtime/packages/core/{types.mjs → types.js} +0 -0
  103. /package/dist/runtime/packages/layer-manager/{index.mjs → index.js} +0 -0
  104. /package/dist/runtime/packages/layer-manager/{types.mjs → types.js} +0 -0
  105. /package/dist/runtime/packages/layer-manager/{use-layer-actions.mjs → use-layer-actions.js} +0 -0
  106. /package/dist/runtime/server/middleware/{basic-auth.mjs → basic-auth.js} +0 -0
  107. /package/dist/runtime/thirdparty/helpers/{index.mjs → index.js} +0 -0
@@ -1,4 +1,4 @@
1
- import type { User } from "../types";
1
+ import type { User } from "../types.js";
2
2
  export declare function useUser(): import("vue").Ref<{
3
3
  id: string;
4
4
  firstName: string;
@@ -1,4 +1,4 @@
1
- import type { Visitor } from "../types";
1
+ import type { Visitor } from "../types.js";
2
2
  export declare function useVisitor(): import("vue").Ref<{
3
3
  id?: string | undefined;
4
4
  ip?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { defineSanitizeHtmlPlugin, defineSanitizeUrlPlugin } from "./plugins/index.mjs";
1
+ import { defineSanitizeHtmlPlugin, defineSanitizeUrlPlugin } from "./plugins/index.js";
2
2
  export function defineVuePlugins(app) {
3
3
  defineSanitizeHtmlPlugin(app);
4
4
  defineSanitizeUrlPlugin(app);
@@ -1,2 +1,2 @@
1
- import type { Fetch, FetchConfig, GetUserResponse } from "./types";
1
+ import type { Fetch, FetchConfig, GetUserResponse } from "./types.js";
2
2
  export declare const createApiGetUser: (fetch: Fetch, config: FetchConfig) => () => Promise<GetUserResponse>;
@@ -1,7 +1,7 @@
1
1
  import { useLocalStorage } from "@vueuse/core";
2
- import { flush, getSecretKey, getToken, setUser } from "./api-client.mjs";
3
- import { useApiActions, useUser } from "./composables/index.mjs";
4
- import { createSingletonAsync, once } from "./helpers/index.mjs";
2
+ import { flush, getSecretKey, getToken, setUser } from "./api-client.js";
3
+ import { useApiActions, useUser } from "./composables/index.js";
4
+ import { createSingletonAsync, once } from "./helpers/index.js";
5
5
  async function getUserRequest(fetch, config) {
6
6
  const token = getToken();
7
7
  const user = useUser();
@@ -1,2 +1,2 @@
1
- import type { FetchConfig } from "./types";
1
+ import type { FetchConfig } from "./types.js";
2
2
  export declare const createApiGetVisitorIdentifier: (config: FetchConfig) => () => Promise<void>;
@@ -1,7 +1,6 @@
1
1
  import { hashComponents, load } from "@fingerprintjs/fingerprintjs";
2
- import { ofetch } from "ofetch";
3
- import { useVisitor } from "./composables/index.mjs";
4
- import { createSingletonAsync, once } from "./helpers/index.mjs";
2
+ import { useVisitor } from "./composables/index.js";
3
+ import { createSingletonAsync, once } from "./helpers/index.js";
5
4
  const setVisitor = (newVisitor) => {
6
5
  const visitor = useVisitor();
7
6
  visitor.value = !visitor.value ? newVisitor : { ...visitor.value, ...newVisitor };
@@ -15,13 +14,7 @@ const getVisitorRequest = async (config) => {
15
14
  const result = await fp.get();
16
15
  const { canvas, colorDepth, hdr, languages, screenFrame, screenResolution, ...components } = result.components;
17
16
  const id = hashComponents(components);
18
- let ip;
19
- try {
20
- const data = await ofetch("https://api.ipify.org?format=json", { timeout: 3e3 });
21
- ip = data?.ip ?? "unknown";
22
- } catch {
23
- ip = "unknown";
24
- }
17
+ const ip = "unknown";
25
18
  const device = await config.getDevice() || "unknown";
26
19
  const appName = config.appName || "unknown";
27
20
  setVisitor({ id, ip, device, appName });
@@ -1,4 +1,4 @@
1
- export { useApiHelper } from "./api-helper";
2
- export { useDevice } from "./device-helper";
3
- export { usePhoneHelper } from "./phone-helper";
4
- export { useStringHelper } from "./string-helper";
1
+ export { useApiHelper } from "./api-helper.js";
2
+ export { useDevice } from "./device-helper.js";
3
+ export { usePhoneHelper } from "./phone-helper.js";
4
+ export { useStringHelper } from "./string-helper.js";
@@ -0,0 +1,4 @@
1
+ export { useApiHelper } from "./api-helper.js";
2
+ export { useDevice } from "./device-helper.js";
3
+ export { usePhoneHelper } from "./phone-helper.js";
4
+ export { useStringHelper } from "./string-helper.js";
@@ -1,4 +1,4 @@
1
- import { device as currentDevice } from "./current-device.mjs";
1
+ import { device as currentDevice } from "./current-device.js";
2
2
  export const deviceHelper = () => {
3
3
  const device = currentDevice;
4
4
  const isMobileApp = import.meta.env.VITE_IS_MOBILE_APP === "true" || import.meta.env.VITE_IS_MOBILE_APP === true;
@@ -1,7 +1,7 @@
1
- export { apiHelper } from "./api-helper";
2
- export { deviceHelper, type Device } from "./device-helper";
3
- export { phoneHelper } from "./phone-helper";
4
- export { stringHelper } from "./string-helper";
5
- export * from "./composables";
1
+ export { apiHelper } from "./api-helper.js";
2
+ export { deviceHelper, type Device } from "./device-helper.js";
3
+ export { phoneHelper } from "./phone-helper.js";
4
+ export { stringHelper } from "./string-helper.js";
5
+ export * from "./composables.js";
6
6
  export declare function once<T extends (...args: any[]) => any>(fn: T): T;
7
7
  export declare function createSingletonAsync<T, Args extends unknown[]>(fn: (...args: Args) => Promise<T>): (...args: Args) => Promise<T>;
@@ -1,8 +1,8 @@
1
- export { apiHelper } from "./api-helper.mjs";
2
- export { deviceHelper } from "./device-helper.mjs";
3
- export { phoneHelper } from "./phone-helper.mjs";
4
- export { stringHelper } from "./string-helper.mjs";
5
- export * from "./composables.mjs";
1
+ export { apiHelper } from "./api-helper.js";
2
+ export { deviceHelper } from "./device-helper.js";
3
+ export { phoneHelper } from "./phone-helper.js";
4
+ export { stringHelper } from "./string-helper.js";
5
+ export * from "./composables.js";
6
6
  export function once(fn) {
7
7
  let executed = false;
8
8
  let result;
@@ -1,22 +1,22 @@
1
1
  import { type Ref } from "vue";
2
- import type { Fetch, FetchConfig } from "./types";
3
- export { defineVuePlugins } from "./define-vue-plugins";
4
- export { default as AppProvider, useBus } from "./AppProvider.vue";
5
- export * from "./composables";
6
- export * from "./types";
2
+ import type { Fetch, FetchConfig } from "./types.js";
3
+ export { defineVuePlugins } from "./define-vue-plugins.js";
4
+ export { default as AppProvider, useBus } from "./AppProvider.vue.js";
5
+ export * from "./composables/index.js";
6
+ export * from "./types.js";
7
7
  export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
8
8
  fetch: Fetch;
9
- getUser: () => Promise<import("./types").GetUserResponse>;
9
+ getUser: () => Promise<import("./types.js").GetUserResponse>;
10
10
  useApiFetch: () => Fetch;
11
11
  userActions: {
12
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
12
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
13
13
  key: string;
14
14
  }>;
15
15
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
16
16
  key: string;
17
17
  }>;
18
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
19
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
18
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
19
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
20
20
  signUp: (body: Record<string, any>) => Promise<{
21
21
  key: string;
22
22
  }>;
@@ -91,7 +91,7 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
91
91
  changeAvatar: (body: FormData) => Promise<void>;
92
92
  deleteAvatar: () => Promise<void>;
93
93
  fetchActiveSessions: () => Promise<{
94
- sessions: import("./types").ActiveSession[];
94
+ sessions: import("./types.js").ActiveSession[];
95
95
  }>;
96
96
  logoutActiveSession: (body: {
97
97
  sessionId: string;
@@ -108,14 +108,14 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
108
108
  };
109
109
  };
110
110
  export declare const useUserActions: () => Ref<{
111
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
111
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
112
112
  key: string;
113
113
  }>;
114
114
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
115
115
  key: string;
116
116
  }>;
117
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
118
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
117
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
118
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
119
119
  signUp: (body: Record<string, any>) => Promise<{
120
120
  key: string;
121
121
  }>;
@@ -190,7 +190,7 @@ export declare const useUserActions: () => Ref<{
190
190
  changeAvatar: (body: FormData) => Promise<void>;
191
191
  deleteAvatar: () => Promise<void>;
192
192
  fetchActiveSessions: () => Promise<{
193
- sessions: import("./types").ActiveSession[];
193
+ sessions: import("./types.js").ActiveSession[];
194
194
  }>;
195
195
  logoutActiveSession: (body: {
196
196
  sessionId: string;
@@ -205,14 +205,14 @@ export declare const useUserActions: () => Ref<{
205
205
  code: string;
206
206
  }) => Promise<void>;
207
207
  }, {
208
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
208
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
209
209
  key: string;
210
210
  }>;
211
211
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
212
212
  key: string;
213
213
  }>;
214
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
215
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
214
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
215
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
216
216
  signUp: (body: Record<string, any>) => Promise<{
217
217
  key: string;
218
218
  }>;
@@ -287,7 +287,7 @@ export declare const useUserActions: () => Ref<{
287
287
  changeAvatar: (body: FormData) => Promise<void>;
288
288
  deleteAvatar: () => Promise<void>;
289
289
  fetchActiveSessions: () => Promise<{
290
- sessions: import("./types").ActiveSession[];
290
+ sessions: import("./types.js").ActiveSession[];
291
291
  }>;
292
292
  logoutActiveSession: (body: {
293
293
  sessionId: string;
@@ -1,18 +1,18 @@
1
1
  import { useLocalStorage } from "@vueuse/core";
2
2
  import { ref } from "vue";
3
- import { createApiFetch } from "./api-client.mjs";
3
+ import { createApiFetch } from "./api-client.js";
4
4
  import { useBus } from "./AppProvider.vue";
5
- import { newCometClient } from "./comet-client.mjs";
6
- import { useApiActions } from "./composables/index.mjs";
7
- import { createApiGetUser } from "./get-user.mjs";
8
- import { createApiGetVisitorIdentifier } from "./get-visitor.mjs";
9
- import { createInitApplication } from "./init-application.mjs";
10
- import { createApiRefreshToken } from "./refresh-token.mjs";
11
- import { createApiUserActions } from "./user-actions.mjs";
12
- export { defineVuePlugins } from "./define-vue-plugins.mjs";
5
+ import { newCometClient } from "./comet-client.js";
6
+ import { useApiActions } from "./composables/index.js";
7
+ import { createApiGetUser } from "./get-user.js";
8
+ import { createApiGetVisitorIdentifier } from "./get-visitor.js";
9
+ import { createInitApplication } from "./init-application.js";
10
+ import { createApiRefreshToken } from "./refresh-token.js";
11
+ import { createApiUserActions } from "./user-actions.js";
12
+ export { defineVuePlugins } from "./define-vue-plugins.js";
13
13
  export { default as AppProvider, useBus } from "./AppProvider.vue";
14
- export * from "./composables/index.mjs";
15
- export * from "./types.mjs";
14
+ export * from "./composables/index.js";
15
+ export * from "./types.js";
16
16
  const apiActions = useApiActions();
17
17
  let userActions;
18
18
  export function initApiFetch($fetch, config) {
@@ -1,9 +1,9 @@
1
1
  import { watch } from "vue";
2
2
  import { useI18n } from "vue-i18n";
3
3
  import { useRouter } from "vue-router";
4
- import { useActiveSessions, useCookies, useSubscribe, useUser } from "./composables/index.mjs";
5
- import { once } from "./helpers/index.mjs";
6
- import { useAppLocale, useThemeMode, useUserActions, useVisitor } from "./index.mjs";
4
+ import { useActiveSessions, useCookies, useSubscribe, useUser } from "./composables/index.js";
5
+ import { once } from "./helpers/index.js";
6
+ import { useAppLocale, useThemeMode, useUserActions, useVisitor } from "./index.js";
7
7
  function initApplication() {
8
8
  const router = useRouter();
9
9
  const user = useUser();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.19.18",
3
+ "version": "1.19.19",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
@@ -1,2 +1,2 @@
1
- export * from "./sanitize-html";
2
- export * from "./sanitize-url";
1
+ export * from "./sanitize-html.js";
2
+ export * from "./sanitize-url.js";
@@ -0,0 +1,2 @@
1
+ export * from "./sanitize-html.js";
2
+ export * from "./sanitize-url.js";
@@ -1,4 +1,4 @@
1
- import { sanitizeUrl } from "../thirdparty/sanitize-url/index.mjs";
1
+ import { sanitizeUrl } from "../thirdparty/sanitize-url/index.js";
2
2
  export function defineSanitizeUrlPlugin(app) {
3
3
  app.directive("sanitize-url", (el, binding) => {
4
4
  if (binding.value !== binding.oldValue) {
@@ -1,2 +1,2 @@
1
- import type { Fetch, FetchConfig } from "./types";
1
+ import type { Fetch, FetchConfig } from "./types.js";
2
2
  export declare const createApiRefreshToken: (fetch: Fetch, config: FetchConfig) => () => Promise<string>;
@@ -1,5 +1,5 @@
1
- import { flush, setToken } from "./api-client.mjs";
2
- import { createSingletonAsync, once } from "./helpers/index.mjs";
1
+ import { flush, setToken } from "./api-client.js";
2
+ import { createSingletonAsync, once } from "./helpers/index.js";
3
3
  async function refreshTokenRequest(fetch, config) {
4
4
  setToken(null);
5
5
  try {
@@ -1,4 +1,4 @@
1
- import type { ActiveSession, Fetch, FetchConfig, GetUserResponse } from "./types";
1
+ import type { ActiveSession, Fetch, FetchConfig, GetUserResponse } from "./types.js";
2
2
  export type UserActions = ReturnType<typeof createApiUserActions>;
3
3
  export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, getUser: () => Promise<GetUserResponse>) => {
4
4
  signIn: (body: Record<string, any>) => Promise<GetUserResponse | {
@@ -1,6 +1,6 @@
1
- import { flush, setSecretKey, setToken, updateUser } from "./api-client.mjs";
2
- import { useUser } from "./composables/index.mjs";
3
- import { once } from "./helpers/index.mjs";
1
+ import { flush, setSecretKey, setToken, updateUser } from "./api-client.js";
2
+ import { useUser } from "./composables/index.js";
3
+ import { once } from "./helpers/index.js";
4
4
  export const createApiUserActions = once(
5
5
  (fetch, config, getUser) => {
6
6
  return {
@@ -0,0 +1,6 @@
1
+ import type { ActiveLayer } from "./types.js";
2
+ type __VLS_Props = {
3
+ layer: ActiveLayer;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -1,33 +1,28 @@
1
- <script setup lang="ts">
2
- import { onMounted, ref, resolveComponent } from "vue"
3
- import type { ActiveLayer } from "./types"
4
-
5
- const props = defineProps<{ layer: ActiveLayer }>()
6
- const emit = defineEmits(["closeLayer", "closeAllLayers"])
7
- const layerRef = ref<HTMLElement | null>(null)
8
-
9
- const closeLayer = () => emit("closeLayer", props.layer.layerId)
10
- const closeAllLayers = () => emit("closeAllLayers")
11
-
1
+ <script setup>
2
+ import { onMounted, ref, resolveComponent } from "vue";
3
+ const props = defineProps({
4
+ layer: { type: Object, required: true }
5
+ });
6
+ const emit = defineEmits(["closeLayer", "closeAllLayers"]);
7
+ const layerRef = ref(null);
8
+ const closeLayer = () => emit("closeLayer", props.layer.layerId);
9
+ const closeAllLayers = () => emit("closeAllLayers");
12
10
  onMounted(() => {
13
- // eslint-disable-next-line vue/no-mutating-props
14
- props.layer.closeLayer = () => closeLayer()
15
-
16
- setTimeout(() => {
17
- layerRef.value?.classList.add("open")
18
- const layoutElement = document.querySelector("#layout")
19
- if (layoutElement) {
20
- layoutElement.classList.remove("layer-hide")
21
- layoutElement.classList.add("layer-open")
22
- document.documentElement.style.overflow = "hidden auto"
23
- document.body.style.overflow = "hidden auto"
24
- }
25
- }, 50)
26
- })
27
-
28
- const component = resolveComponent(props.layer.component)
11
+ props.layer.closeLayer = () => closeLayer();
12
+ setTimeout(() => {
13
+ layerRef.value?.classList.add("open");
14
+ const layoutElement = document.querySelector("#layout");
15
+ if (layoutElement) {
16
+ layoutElement.classList.remove("layer-hide");
17
+ layoutElement.classList.add("layer-open");
18
+ document.documentElement.style.overflow = "hidden auto";
19
+ document.body.style.overflow = "hidden auto";
20
+ }
21
+ }, 50);
22
+ });
23
+ const component = resolveComponent(props.layer.component);
29
24
  if (typeof component === "string") {
30
- closeLayer()
25
+ closeLayer();
31
26
  }
32
27
  </script>
33
28
 
@@ -0,0 +1,6 @@
1
+ import type { ActiveLayer } from "./types.js";
2
+ type __VLS_Props = {
3
+ layer: ActiveLayer;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { ActiveLayer } from "./types.js";
2
+ export declare const useLayerManager: () => {
3
+ open: (layerName: string, params?: {
4
+ [p: string]: any;
5
+ }) => void | undefined;
6
+ getLayer: (layerName: string) => ActiveLayer | undefined;
7
+ closeAllLayers: () => void | undefined;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
+ export default _default;