@shwfed/nuxt 0.10.14 → 0.10.15
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 +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/app.d.vue.ts +2 -1
- package/dist/runtime/components/app.vue.d.ts +2 -1
- package/dist/runtime/components/button.d.vue.ts +63 -4
- package/dist/runtime/components/button.vue +12 -2
- package/dist/runtime/components/button.vue.d.ts +63 -4
- package/dist/runtime/components/modal.d.vue.ts +3 -1
- package/dist/runtime/components/modal.vue +3 -1
- package/dist/runtime/components/modal.vue.d.ts +3 -1
- package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
- package/dist/runtime/components/ui/app/App.vue +23 -8
- package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
- package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +52 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +52 -0
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +54 -2
- package/dist/runtime/components/ui/buttons/Buttons.vue +56 -3
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +54 -2
- package/dist/runtime/components/ui/buttons/schema.d.ts +307 -0
- package/dist/runtime/components/ui/buttons/schema.js +11 -2
- package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +4 -4
- package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +4 -4
- package/dist/runtime/composables/useOverlay.d.ts +86 -0
- package/dist/runtime/composables/useOverlay.js +201 -0
- package/dist/runtime/layouts/default.d.vue.ts +2 -1
- package/dist/runtime/layouts/default.vue.d.ts +2 -1
- package/dist/runtime/plugins/overlay/index.d.ts +6 -0
- package/dist/runtime/plugins/overlay/index.js +12 -0
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -57,6 +57,7 @@ const module$1 = defineNuxtModule({
|
|
|
57
57
|
addVitePlugin(TailwindCSS());
|
|
58
58
|
addPlugin(resolver.resolve("runtime/plugins/i18n/index"));
|
|
59
59
|
addPlugin(resolver.resolve("runtime/plugins/cel/index"));
|
|
60
|
+
addPlugin(resolver.resolve("runtime/plugins/overlay/index"));
|
|
60
61
|
addPlugin(resolver.resolve("runtime/plugins/markdown/index"));
|
|
61
62
|
addPlugin(resolver.resolve("runtime/plugins/api/index"));
|
|
62
63
|
addPlugin({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
|
+
import type { OverlayService as OverlayRuntimeService } from '../composables/useOverlay.js';
|
|
2
3
|
import type { Sidebar as SidebarType } from '../composables/useNavigationTabs.js';
|
|
3
|
-
type CommandEffect = import('effect').Effect.Effect<void>;
|
|
4
|
+
type CommandEffect = import('effect').Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
5
|
type DslEffect = import('effect').Effect.Effect<Record<string, unknown>, never, Scope.Scope>;
|
|
5
6
|
type ProfileCommandInputItem = Readonly<{
|
|
6
7
|
id: string | number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
|
+
import type { OverlayService as OverlayRuntimeService } from '../composables/useOverlay.js';
|
|
2
3
|
import type { Sidebar as SidebarType } from '../composables/useNavigationTabs.js';
|
|
3
|
-
type CommandEffect = import('effect').Effect.Effect<void>;
|
|
4
|
+
type CommandEffect = import('effect').Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
5
|
type DslEffect = import('effect').Effect.Effect<Record<string, unknown>, never, Scope.Scope>;
|
|
5
6
|
type ProfileCommandInputItem = Readonly<{
|
|
6
7
|
id: string | number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import type { ButtonConfigInput } from './ui/buttons/schema.js';
|
|
3
|
-
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonsStyleC } from './ui/buttons/schema.js';
|
|
4
|
-
export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonGroup, ButtonGroupItem } from './ui/buttons/schema.js';
|
|
3
|
+
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './ui/buttons/schema.js';
|
|
4
|
+
export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal } from './ui/buttons/schema.js';
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<{
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
config?: ButtonConfigInput | Effect.Effect<ButtonConfigInput | undefined>;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
"update:config": (args_0: Readonly<{
|
|
@@ -23,6 +23,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
23
23
|
icon?: string | undefined;
|
|
24
24
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
25
25
|
hideTitle?: boolean | undefined;
|
|
26
|
+
modal?: Readonly<{
|
|
27
|
+
title?: readonly {
|
|
28
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
29
|
+
message: string;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
description?: readonly {
|
|
32
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
33
|
+
message: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
showCloseButton?: boolean | undefined;
|
|
36
|
+
breakpoint?: string | undefined;
|
|
37
|
+
dismissible?: boolean | undefined;
|
|
38
|
+
}> | undefined;
|
|
26
39
|
}> | Readonly<{
|
|
27
40
|
id: string;
|
|
28
41
|
title: readonly {
|
|
@@ -41,6 +54,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
41
54
|
}[] | undefined;
|
|
42
55
|
icon?: string | undefined;
|
|
43
56
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
57
|
+
modal?: Readonly<{
|
|
58
|
+
title?: readonly {
|
|
59
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
60
|
+
message: string;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
description?: readonly {
|
|
63
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
64
|
+
message: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
showCloseButton?: boolean | undefined;
|
|
67
|
+
breakpoint?: string | undefined;
|
|
68
|
+
dismissible?: boolean | undefined;
|
|
69
|
+
}> | undefined;
|
|
44
70
|
}>[];
|
|
45
71
|
icon?: string | undefined;
|
|
46
72
|
}>)[];
|
|
@@ -67,6 +93,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
67
93
|
icon?: string | undefined;
|
|
68
94
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
69
95
|
hideTitle?: boolean | undefined;
|
|
96
|
+
modal?: Readonly<{
|
|
97
|
+
title?: readonly {
|
|
98
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
99
|
+
message: string;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
description?: readonly {
|
|
102
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
103
|
+
message: string;
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
showCloseButton?: boolean | undefined;
|
|
106
|
+
breakpoint?: string | undefined;
|
|
107
|
+
dismissible?: boolean | undefined;
|
|
108
|
+
}> | undefined;
|
|
70
109
|
}> | Readonly<{
|
|
71
110
|
id: string;
|
|
72
111
|
title: readonly {
|
|
@@ -85,6 +124,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
85
124
|
}[] | undefined;
|
|
86
125
|
icon?: string | undefined;
|
|
87
126
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
127
|
+
modal?: Readonly<{
|
|
128
|
+
title?: readonly {
|
|
129
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
130
|
+
message: string;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
description?: readonly {
|
|
133
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
134
|
+
message: string;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
showCloseButton?: boolean | undefined;
|
|
137
|
+
breakpoint?: string | undefined;
|
|
138
|
+
dismissible?: boolean | undefined;
|
|
139
|
+
}> | undefined;
|
|
88
140
|
}>[];
|
|
89
141
|
icon?: string | undefined;
|
|
90
142
|
}>)[];
|
|
@@ -92,4 +144,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
92
144
|
gap?: number | undefined;
|
|
93
145
|
style?: string | undefined;
|
|
94
146
|
}>) => any) | undefined;
|
|
95
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
147
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
148
|
+
[x: string]: ((props: any) => any) | undefined;
|
|
149
|
+
}>;
|
|
150
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
151
|
+
new (): {
|
|
152
|
+
$slots: S;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
@@ -27,7 +27,7 @@ function handleConfigUpdate(config) {
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<script>
|
|
30
|
-
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonsStyleC } from "./ui/buttons/schema";
|
|
30
|
+
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from "./ui/buttons/schema";
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<template>
|
|
@@ -35,5 +35,15 @@ export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, Butt
|
|
|
35
35
|
v-bind="$attrs"
|
|
36
36
|
:config="resolveConfig()"
|
|
37
37
|
@update:config="handleConfigUpdate"
|
|
38
|
-
|
|
38
|
+
>
|
|
39
|
+
<template
|
|
40
|
+
v-for="(_, slotName) in $slots"
|
|
41
|
+
#[slotName]="slotProps"
|
|
42
|
+
>
|
|
43
|
+
<slot
|
|
44
|
+
:name="slotName"
|
|
45
|
+
v-bind="slotProps ?? {}"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
</UiButtons>
|
|
39
49
|
</template>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import type { ButtonConfigInput } from './ui/buttons/schema.js';
|
|
3
|
-
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonsStyleC } from './ui/buttons/schema.js';
|
|
4
|
-
export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonGroup, ButtonGroupItem } from './ui/buttons/schema.js';
|
|
3
|
+
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './ui/buttons/schema.js';
|
|
4
|
+
export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal } from './ui/buttons/schema.js';
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
7
|
-
declare const __VLS_export: import("vue").DefineComponent<{
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
config?: ButtonConfigInput | Effect.Effect<ButtonConfigInput | undefined>;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
"update:config": (args_0: Readonly<{
|
|
@@ -23,6 +23,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
23
23
|
icon?: string | undefined;
|
|
24
24
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
25
25
|
hideTitle?: boolean | undefined;
|
|
26
|
+
modal?: Readonly<{
|
|
27
|
+
title?: readonly {
|
|
28
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
29
|
+
message: string;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
description?: readonly {
|
|
32
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
33
|
+
message: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
showCloseButton?: boolean | undefined;
|
|
36
|
+
breakpoint?: string | undefined;
|
|
37
|
+
dismissible?: boolean | undefined;
|
|
38
|
+
}> | undefined;
|
|
26
39
|
}> | Readonly<{
|
|
27
40
|
id: string;
|
|
28
41
|
title: readonly {
|
|
@@ -41,6 +54,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
41
54
|
}[] | undefined;
|
|
42
55
|
icon?: string | undefined;
|
|
43
56
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
57
|
+
modal?: Readonly<{
|
|
58
|
+
title?: readonly {
|
|
59
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
60
|
+
message: string;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
description?: readonly {
|
|
63
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
64
|
+
message: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
showCloseButton?: boolean | undefined;
|
|
67
|
+
breakpoint?: string | undefined;
|
|
68
|
+
dismissible?: boolean | undefined;
|
|
69
|
+
}> | undefined;
|
|
44
70
|
}>[];
|
|
45
71
|
icon?: string | undefined;
|
|
46
72
|
}>)[];
|
|
@@ -67,6 +93,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
67
93
|
icon?: string | undefined;
|
|
68
94
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
69
95
|
hideTitle?: boolean | undefined;
|
|
96
|
+
modal?: Readonly<{
|
|
97
|
+
title?: readonly {
|
|
98
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
99
|
+
message: string;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
description?: readonly {
|
|
102
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
103
|
+
message: string;
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
showCloseButton?: boolean | undefined;
|
|
106
|
+
breakpoint?: string | undefined;
|
|
107
|
+
dismissible?: boolean | undefined;
|
|
108
|
+
}> | undefined;
|
|
70
109
|
}> | Readonly<{
|
|
71
110
|
id: string;
|
|
72
111
|
title: readonly {
|
|
@@ -85,6 +124,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
85
124
|
}[] | undefined;
|
|
86
125
|
icon?: string | undefined;
|
|
87
126
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
127
|
+
modal?: Readonly<{
|
|
128
|
+
title?: readonly {
|
|
129
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
130
|
+
message: string;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
description?: readonly {
|
|
133
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
134
|
+
message: string;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
showCloseButton?: boolean | undefined;
|
|
137
|
+
breakpoint?: string | undefined;
|
|
138
|
+
dismissible?: boolean | undefined;
|
|
139
|
+
}> | undefined;
|
|
88
140
|
}>[];
|
|
89
141
|
icon?: string | undefined;
|
|
90
142
|
}>)[];
|
|
@@ -92,4 +144,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
92
144
|
gap?: number | undefined;
|
|
93
145
|
style?: string | undefined;
|
|
94
146
|
}>) => any) | undefined;
|
|
95
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
147
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
148
|
+
[x: string]: ((props: any) => any) | undefined;
|
|
149
|
+
}>;
|
|
150
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
151
|
+
new (): {
|
|
152
|
+
$slots: S;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
defaultOpen?: boolean;
|
|
4
4
|
breakpoint?: string;
|
|
5
5
|
showCloseButton?: boolean;
|
|
6
|
+
dismissible?: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare function close(): void;
|
|
8
9
|
declare var __VLS_14: {
|
|
@@ -37,9 +38,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
37
38
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
39
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
39
40
|
}>, {
|
|
40
|
-
defaultOpen: boolean;
|
|
41
41
|
showCloseButton: boolean;
|
|
42
42
|
breakpoint: string;
|
|
43
|
+
dismissible: boolean;
|
|
44
|
+
defaultOpen: boolean;
|
|
43
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -28,7 +28,8 @@ const props = defineProps({
|
|
|
28
28
|
open: { type: Boolean, required: false },
|
|
29
29
|
defaultOpen: { type: Boolean, required: false, default: false },
|
|
30
30
|
breakpoint: { type: String, required: false, default: "(min-width: 640px)" },
|
|
31
|
-
showCloseButton: { type: Boolean, required: false, default: true }
|
|
31
|
+
showCloseButton: { type: Boolean, required: false, default: true },
|
|
32
|
+
dismissible: { type: Boolean, required: false, default: true }
|
|
32
33
|
});
|
|
33
34
|
const emit = defineEmits(["update:open"]);
|
|
34
35
|
const attrs = useAttrs();
|
|
@@ -81,6 +82,7 @@ function close() {
|
|
|
81
82
|
<component
|
|
82
83
|
:is="modalComponents.Root"
|
|
83
84
|
v-model:open="open"
|
|
85
|
+
:dismissible="props.dismissible"
|
|
84
86
|
>
|
|
85
87
|
<component
|
|
86
88
|
:is="modalComponents.Trigger"
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
defaultOpen?: boolean;
|
|
4
4
|
breakpoint?: string;
|
|
5
5
|
showCloseButton?: boolean;
|
|
6
|
+
dismissible?: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare function close(): void;
|
|
8
9
|
declare var __VLS_14: {
|
|
@@ -37,9 +38,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
37
38
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
39
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
39
40
|
}>, {
|
|
40
|
-
defaultOpen: boolean;
|
|
41
41
|
showCloseButton: boolean;
|
|
42
42
|
breakpoint: string;
|
|
43
|
+
dismissible: boolean;
|
|
44
|
+
defaultOpen: boolean;
|
|
43
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
+
import { type OverlayService as OverlayRuntimeService } from '../../../composables/useOverlay.js';
|
|
3
4
|
import { type Sidebar as SidebarType } from '../../../composables/useNavigationTabs.js';
|
|
5
|
+
type UiCommandEffect = Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
6
|
type ProfileCommandInputItem = Readonly<{
|
|
5
7
|
id: string | number;
|
|
6
8
|
title: string;
|
|
7
9
|
icon?: string;
|
|
8
10
|
hidden?: boolean;
|
|
9
11
|
disabled?: boolean;
|
|
10
|
-
effect?:
|
|
12
|
+
effect?: UiCommandEffect;
|
|
11
13
|
keywords?: Array<string>;
|
|
12
14
|
}>;
|
|
13
15
|
type ProfileCommandInputGroup = Readonly<{
|
|
@@ -67,13 +69,13 @@ type __VLS_Props = {
|
|
|
67
69
|
*/
|
|
68
70
|
commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
|
|
69
71
|
};
|
|
70
|
-
declare var
|
|
72
|
+
declare var __VLS_113: {}, __VLS_129: {}, __VLS_352: {};
|
|
71
73
|
type __VLS_Slots = {} & {
|
|
72
|
-
menu?: (props: typeof
|
|
74
|
+
menu?: (props: typeof __VLS_113) => any;
|
|
73
75
|
} & {
|
|
74
|
-
profile?: (props: typeof
|
|
76
|
+
profile?: (props: typeof __VLS_129) => any;
|
|
75
77
|
} & {
|
|
76
|
-
default?: (props: typeof
|
|
78
|
+
default?: (props: typeof __VLS_352) => any;
|
|
77
79
|
};
|
|
78
80
|
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
81
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -8,6 +8,8 @@ import { useMagicKeys, useTimeoutFn, whenever } from "@vueuse/core";
|
|
|
8
8
|
import { useI18n } from "vue-i18n";
|
|
9
9
|
import { Icon } from "@iconify/vue";
|
|
10
10
|
import { Effect } from "effect";
|
|
11
|
+
import OverlayHost from "./OverlayHost.vue";
|
|
12
|
+
import { provideOverlay, useOverlay } from "../../../composables/useOverlay";
|
|
11
13
|
import { setGlobalDslContext } from "../../../plugins/cel/context";
|
|
12
14
|
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, SidebarProvider } from "../sidebar";
|
|
13
15
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../collapsible";
|
|
@@ -22,6 +24,7 @@ const {
|
|
|
22
24
|
} = useRuntimeConfig();
|
|
23
25
|
const { $dsl } = useNuxtApp();
|
|
24
26
|
const { t } = useI18n();
|
|
27
|
+
const overlay = useOverlay();
|
|
25
28
|
const props = defineProps({
|
|
26
29
|
dsl: { type: null, required: false },
|
|
27
30
|
sidebar: { type: Array, required: false },
|
|
@@ -59,12 +62,28 @@ const logout = () => {
|
|
|
59
62
|
}
|
|
60
63
|
return Effect.void;
|
|
61
64
|
};
|
|
65
|
+
function runUiEffect(effect) {
|
|
66
|
+
if (!effect) {
|
|
67
|
+
return Promise.resolve();
|
|
68
|
+
}
|
|
69
|
+
return Effect.runPromise(Effect.scoped(provideOverlay(effect, overlay)));
|
|
70
|
+
}
|
|
71
|
+
function runPaletteEffect(effect) {
|
|
72
|
+
if (!effect) {
|
|
73
|
+
return Promise.resolve();
|
|
74
|
+
}
|
|
75
|
+
const effectWithClose = effect.pipe(Effect.tap(() => {
|
|
76
|
+
ui.isCommandPaletteOpen = false;
|
|
77
|
+
}));
|
|
78
|
+
return Effect.runPromise(Effect.scoped(provideOverlay(effectWithClose, overlay)));
|
|
79
|
+
}
|
|
62
80
|
</script>
|
|
63
81
|
|
|
64
82
|
<template>
|
|
65
83
|
<TooltipProvider>
|
|
66
84
|
<ClientOnly>
|
|
67
85
|
<Toaster />
|
|
86
|
+
<OverlayHost />
|
|
68
87
|
<CommandDialog
|
|
69
88
|
v-model:open="ui.isCommandPaletteOpen"
|
|
70
89
|
>
|
|
@@ -95,9 +114,7 @@ const logout = () => {
|
|
|
95
114
|
:key="child.id"
|
|
96
115
|
:value="child.id"
|
|
97
116
|
:disabled="child.disabled"
|
|
98
|
-
@select="child.effect
|
|
99
|
-
ui.isCommandPaletteOpen = false;
|
|
100
|
-
})).pipe(Effect.runPromise)"
|
|
117
|
+
@select="void runPaletteEffect(child.effect)"
|
|
101
118
|
>
|
|
102
119
|
<span>{{ child.title }}</span>
|
|
103
120
|
<span class="sr-only">
|
|
@@ -109,9 +126,7 @@ const logout = () => {
|
|
|
109
126
|
<CommandItem
|
|
110
127
|
:value="command.id"
|
|
111
128
|
:disabled="command.disabled"
|
|
112
|
-
@select="command.effect
|
|
113
|
-
ui.isCommandPaletteOpen = false;
|
|
114
|
-
})).pipe(Effect.runPromise)"
|
|
129
|
+
@select="void runPaletteEffect(command.effect)"
|
|
115
130
|
>
|
|
116
131
|
<span>{{ command.title }}</span>
|
|
117
132
|
<span class="sr-only">
|
|
@@ -198,7 +213,7 @@ const logout = () => {
|
|
|
198
213
|
<DropdownMenuItem
|
|
199
214
|
v-if="!child.hidden"
|
|
200
215
|
:disabled="child.disabled"
|
|
201
|
-
@select="child.effect
|
|
216
|
+
@select="void runUiEffect(child.effect)"
|
|
202
217
|
>
|
|
203
218
|
<Icon
|
|
204
219
|
v-if="child.icon"
|
|
@@ -213,7 +228,7 @@ const logout = () => {
|
|
|
213
228
|
<DropdownMenuItem
|
|
214
229
|
v-else-if="!('children' in command) && !command.hidden"
|
|
215
230
|
:disabled="command.disabled"
|
|
216
|
-
@select="command.effect
|
|
231
|
+
@select="void runUiEffect(command.effect)"
|
|
217
232
|
>
|
|
218
233
|
<Icon
|
|
219
234
|
v-if="command.icon"
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
|
+
import { type OverlayService as OverlayRuntimeService } from '../../../composables/useOverlay.js';
|
|
3
4
|
import { type Sidebar as SidebarType } from '../../../composables/useNavigationTabs.js';
|
|
5
|
+
type UiCommandEffect = Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
6
|
type ProfileCommandInputItem = Readonly<{
|
|
5
7
|
id: string | number;
|
|
6
8
|
title: string;
|
|
7
9
|
icon?: string;
|
|
8
10
|
hidden?: boolean;
|
|
9
11
|
disabled?: boolean;
|
|
10
|
-
effect?:
|
|
12
|
+
effect?: UiCommandEffect;
|
|
11
13
|
keywords?: Array<string>;
|
|
12
14
|
}>;
|
|
13
15
|
type ProfileCommandInputGroup = Readonly<{
|
|
@@ -67,13 +69,13 @@ type __VLS_Props = {
|
|
|
67
69
|
*/
|
|
68
70
|
commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
|
|
69
71
|
};
|
|
70
|
-
declare var
|
|
72
|
+
declare var __VLS_113: {}, __VLS_129: {}, __VLS_352: {};
|
|
71
73
|
type __VLS_Slots = {} & {
|
|
72
|
-
menu?: (props: typeof
|
|
74
|
+
menu?: (props: typeof __VLS_113) => any;
|
|
73
75
|
} & {
|
|
74
|
-
profile?: (props: typeof
|
|
76
|
+
profile?: (props: typeof __VLS_129) => any;
|
|
75
77
|
} & {
|
|
76
|
-
default?: (props: typeof
|
|
78
|
+
default?: (props: typeof __VLS_352) => any;
|
|
77
79
|
};
|
|
78
80
|
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
81
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, defineComponent } from "vue";
|
|
3
|
+
import ShwfedModal from "../../modal.vue";
|
|
4
|
+
import { useOverlay } from "../../../composables/useOverlay";
|
|
5
|
+
const overlay = useOverlay();
|
|
6
|
+
const OverlayBody = defineComponent({
|
|
7
|
+
name: "OverlayBody",
|
|
8
|
+
props: {
|
|
9
|
+
render: {
|
|
10
|
+
type: Function,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
slotProps: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(props) {
|
|
19
|
+
return () => props.render(props.slotProps);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function handleOpenUpdate(sessionId, open) {
|
|
23
|
+
if (open) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
overlay.closeSync(sessionId, {
|
|
27
|
+
_tag: "OverlayAborted",
|
|
28
|
+
reason: "dismiss"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const renderedSessions = computed(() => {
|
|
32
|
+
const nextSessions = [];
|
|
33
|
+
for (const session of overlay.sessions) {
|
|
34
|
+
const definition = overlay.definitions[session.definitionId];
|
|
35
|
+
if (!definition) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
nextSessions.push({
|
|
39
|
+
sessionId: session.sessionId,
|
|
40
|
+
definitionId: session.definitionId,
|
|
41
|
+
shell: session.shell,
|
|
42
|
+
props: session.props,
|
|
43
|
+
definition
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return nextSessions;
|
|
47
|
+
});
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<template
|
|
52
|
+
v-for="session in renderedSessions"
|
|
53
|
+
:key="session.sessionId"
|
|
54
|
+
>
|
|
55
|
+
<ShwfedModal
|
|
56
|
+
:open="true"
|
|
57
|
+
:breakpoint="session.shell.breakpoint"
|
|
58
|
+
:show-close-button="session.shell.showCloseButton"
|
|
59
|
+
:dismissible="session.shell.dismissible"
|
|
60
|
+
@update:open="handleOpenUpdate(session.sessionId, $event)"
|
|
61
|
+
>
|
|
62
|
+
<template
|
|
63
|
+
v-if="session.shell.title"
|
|
64
|
+
#title
|
|
65
|
+
>
|
|
66
|
+
{{ session.shell.title }}
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<template
|
|
70
|
+
v-if="session.shell.description"
|
|
71
|
+
#description
|
|
72
|
+
>
|
|
73
|
+
{{ session.shell.description }}
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<template #default="modalSlotProps">
|
|
77
|
+
<OverlayBody
|
|
78
|
+
:render="session.definition.render"
|
|
79
|
+
:slot-props="{
|
|
80
|
+
props: session.props,
|
|
81
|
+
shell: session.shell,
|
|
82
|
+
sessionId: session.sessionId,
|
|
83
|
+
close: (value) => overlay.closeSync(session.sessionId, value),
|
|
84
|
+
patch: (nextProps) => overlay.patchSync(session.sessionId, { props: nextProps }),
|
|
85
|
+
isDesktop: modalSlotProps.isDesktop
|
|
86
|
+
}"
|
|
87
|
+
/>
|
|
88
|
+
</template>
|
|
89
|
+
</ShwfedModal>
|
|
90
|
+
</template>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|