@shwfed/nuxt 0.11.12 → 0.11.14
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
|
@@ -42,7 +42,7 @@ type OverlaySession = {
|
|
|
42
42
|
props: Record<string, unknown>;
|
|
43
43
|
deferred: Deferred.Deferred<OverlayResult, never>;
|
|
44
44
|
};
|
|
45
|
-
export type OverlayHandle<T = unknown
|
|
45
|
+
export type OverlayHandle<T = Record<string, unknown>> = Readonly<{
|
|
46
46
|
sessionId: string;
|
|
47
47
|
patch: (patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
48
48
|
close: (...args: [value?: unknown]) => Effect.Effect<void>;
|
|
@@ -64,7 +64,7 @@ export interface OverlayRuntime {
|
|
|
64
64
|
closeSync: (sessionId: string, ...args: [value?: unknown]) => void;
|
|
65
65
|
closeTopSync: () => void;
|
|
66
66
|
closeAllSync: () => void;
|
|
67
|
-
open: <T
|
|
67
|
+
open: <T = Record<string, unknown>>(definitionId: string, options?: OverlaySessionInput) => Effect.Effect<OverlayHandle<T>, OverlayDefinitionNotFoundError, Scope.Scope>;
|
|
68
68
|
patch: (sessionId: string, patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
69
69
|
close: (sessionId: string, ...args: [value?: unknown]) => Effect.Effect<void>;
|
|
70
70
|
closeTop: () => Effect.Effect<void>;
|
|
@@ -75,7 +75,7 @@ export declare class OverlayService extends OverlayService_base {
|
|
|
75
75
|
}
|
|
76
76
|
export declare function useOverlay(): OverlayRuntime;
|
|
77
77
|
export declare function provideOverlay<A, E, R>(effect: Effect.Effect<A, E, R>, runtime?: OverlayRuntime): Effect.Effect<A, E, Exclude<R, OverlayService>>;
|
|
78
|
-
export declare function openOverlay<T
|
|
78
|
+
export declare function openOverlay<T = Record<string, unknown>>(definitionId: string, options?: OverlaySessionInput): Effect.Effect<OverlayHandle<T>, OverlayDefinitionNotFoundError, OverlayService | Scope.Scope>;
|
|
79
79
|
export declare function patchOverlay(sessionId: string, patch: OverlaySessionPatch): Effect.Effect<void, never, OverlayService>;
|
|
80
80
|
export declare function closeOverlay(sessionId: string, ...args: [value?: unknown]): Effect.Effect<void, never, OverlayService>;
|
|
81
81
|
export declare function closeTopOverlay(): Effect.Effect<void, never, OverlayService>;
|
|
@@ -57,8 +57,20 @@ export default defineNuxtPlugin({
|
|
|
57
57
|
const name = config.headers.token || "Authorization";
|
|
58
58
|
headers.set(name, sessionStorage.getItem("token") ?? "");
|
|
59
59
|
}
|
|
60
|
+
function joinBaseUrl(base, input) {
|
|
61
|
+
return `${base.replace(/\/+$/, "")}/${input.replace(/^\/+/, "")}`;
|
|
62
|
+
}
|
|
60
63
|
function createRequestUrl(input, query) {
|
|
61
|
-
const url =
|
|
64
|
+
const url = (() => {
|
|
65
|
+
try {
|
|
66
|
+
return new URL(input);
|
|
67
|
+
} catch {
|
|
68
|
+
if (config.api.host) {
|
|
69
|
+
return new URL(joinBaseUrl(config.api.host, input));
|
|
70
|
+
}
|
|
71
|
+
return new URL(input, window.location.href);
|
|
72
|
+
}
|
|
73
|
+
})();
|
|
62
74
|
if (!query) {
|
|
63
75
|
return url.toString();
|
|
64
76
|
}
|
|
@@ -10,7 +10,6 @@ declare const _default: import("#app").Plugin<{
|
|
|
10
10
|
id?: number | string | undefined;
|
|
11
11
|
icon?: import("vue").Component | undefined;
|
|
12
12
|
dismissible?: boolean | undefined;
|
|
13
|
-
duration?: number | undefined;
|
|
14
13
|
class?: string | undefined;
|
|
15
14
|
style?: import("vue").CSSProperties | undefined;
|
|
16
15
|
cancel?: (import("vue-sonner").Action | import("vue").Component) | undefined;
|
|
@@ -20,6 +19,7 @@ declare const _default: import("#app").Plugin<{
|
|
|
20
19
|
richColors?: boolean | undefined;
|
|
21
20
|
invert?: boolean | undefined;
|
|
22
21
|
closeButton?: boolean | undefined;
|
|
22
|
+
duration?: number | undefined;
|
|
23
23
|
important?: boolean | undefined;
|
|
24
24
|
action?: (import("vue-sonner").Action | import("vue").Component) | undefined;
|
|
25
25
|
onDismiss?: ((toast: import("vue-sonner").ToastT) => void) | undefined;
|
|
@@ -63,7 +63,6 @@ declare const _default: import("#app").Plugin<{
|
|
|
63
63
|
id?: number | string | undefined;
|
|
64
64
|
icon?: import("vue").Component | undefined;
|
|
65
65
|
dismissible?: boolean | undefined;
|
|
66
|
-
duration?: number | undefined;
|
|
67
66
|
class?: string | undefined;
|
|
68
67
|
style?: import("vue").CSSProperties | undefined;
|
|
69
68
|
cancel?: (import("vue-sonner").Action | import("vue").Component) | undefined;
|
|
@@ -73,6 +72,7 @@ declare const _default: import("#app").Plugin<{
|
|
|
73
72
|
richColors?: boolean | undefined;
|
|
74
73
|
invert?: boolean | undefined;
|
|
75
74
|
closeButton?: boolean | undefined;
|
|
75
|
+
duration?: number | undefined;
|
|
76
76
|
important?: boolean | undefined;
|
|
77
77
|
action?: (import("vue-sonner").Action | import("vue").Component) | undefined;
|
|
78
78
|
onDismiss?: ((toast: import("vue-sonner").ToastT) => void) | undefined;
|