@shwfed/nuxt 0.10.13 → 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.
Files changed (60) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -0
  3. package/dist/runtime/components/app.d.vue.ts +2 -1
  4. package/dist/runtime/components/app.vue.d.ts +2 -1
  5. package/dist/runtime/components/button.d.vue.ts +63 -4
  6. package/dist/runtime/components/button.vue +12 -2
  7. package/dist/runtime/components/button.vue.d.ts +63 -4
  8. package/dist/runtime/components/modal.d.vue.ts +53 -0
  9. package/dist/runtime/components/modal.vue +141 -0
  10. package/dist/runtime/components/modal.vue.d.ts +53 -0
  11. package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
  12. package/dist/runtime/components/ui/app/App.vue +23 -8
  13. package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
  14. package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
  15. package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
  16. package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
  17. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +52 -0
  18. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +52 -0
  19. package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +54 -2
  20. package/dist/runtime/components/ui/buttons/Buttons.vue +56 -3
  21. package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +54 -2
  22. package/dist/runtime/components/ui/buttons/schema.d.ts +307 -0
  23. package/dist/runtime/components/ui/buttons/schema.js +11 -2
  24. package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +31 -0
  25. package/dist/runtime/components/ui/drawer/Drawer.vue +38 -0
  26. package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +31 -0
  27. package/dist/runtime/components/ui/drawer/DrawerClose.d.vue.ts +14 -0
  28. package/dist/runtime/components/ui/drawer/DrawerClose.vue +19 -0
  29. package/dist/runtime/components/ui/drawer/DrawerClose.vue.d.ts +14 -0
  30. package/dist/runtime/components/ui/drawer/DrawerContent.d.vue.ts +20 -0
  31. package/dist/runtime/components/ui/drawer/DrawerContent.vue +50 -0
  32. package/dist/runtime/components/ui/drawer/DrawerContent.vue.d.ts +20 -0
  33. package/dist/runtime/components/ui/drawer/DrawerDescription.d.vue.ts +18 -0
  34. package/dist/runtime/components/ui/drawer/DrawerDescription.vue +26 -0
  35. package/dist/runtime/components/ui/drawer/DrawerDescription.vue.d.ts +18 -0
  36. package/dist/runtime/components/ui/drawer/DrawerFooter.d.vue.ts +17 -0
  37. package/dist/runtime/components/ui/drawer/DrawerFooter.vue +15 -0
  38. package/dist/runtime/components/ui/drawer/DrawerFooter.vue.d.ts +17 -0
  39. package/dist/runtime/components/ui/drawer/DrawerHeader.d.vue.ts +17 -0
  40. package/dist/runtime/components/ui/drawer/DrawerHeader.vue +15 -0
  41. package/dist/runtime/components/ui/drawer/DrawerHeader.vue.d.ts +17 -0
  42. package/dist/runtime/components/ui/drawer/DrawerOverlay.d.vue.ts +7 -0
  43. package/dist/runtime/components/ui/drawer/DrawerOverlay.vue +19 -0
  44. package/dist/runtime/components/ui/drawer/DrawerOverlay.vue.d.ts +7 -0
  45. package/dist/runtime/components/ui/drawer/DrawerTitle.d.vue.ts +18 -0
  46. package/dist/runtime/components/ui/drawer/DrawerTitle.vue +26 -0
  47. package/dist/runtime/components/ui/drawer/DrawerTitle.vue.d.ts +18 -0
  48. package/dist/runtime/components/ui/drawer/DrawerTrigger.d.vue.ts +14 -0
  49. package/dist/runtime/components/ui/drawer/DrawerTrigger.vue +19 -0
  50. package/dist/runtime/components/ui/drawer/DrawerTrigger.vue.d.ts +14 -0
  51. package/dist/runtime/components/ui/drawer/index.d.ts +8 -0
  52. package/dist/runtime/components/ui/drawer/index.js +8 -0
  53. package/dist/runtime/composables/useOverlay.d.ts +86 -0
  54. package/dist/runtime/composables/useOverlay.js +201 -0
  55. package/dist/runtime/layouts/default.d.vue.ts +2 -1
  56. package/dist/runtime/layouts/default.vue.d.ts +2 -1
  57. package/dist/runtime/plugins/overlay/index.d.ts +6 -0
  58. package/dist/runtime/plugins/overlay/index.js +12 -0
  59. package/dist/runtime/plugins/toast/index.d.ts +2 -2
  60. package/package.json +2 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.10.13",
4
+ "version": "0.10.15",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
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
+ };
@@ -0,0 +1,53 @@
1
+ type __VLS_Props = {
2
+ open?: boolean;
3
+ defaultOpen?: boolean;
4
+ breakpoint?: string;
5
+ showCloseButton?: boolean;
6
+ dismissible?: boolean;
7
+ };
8
+ declare function close(): void;
9
+ declare var __VLS_14: {
10
+ close: typeof close;
11
+ isDesktop: boolean;
12
+ }, __VLS_34: {
13
+ close: typeof close;
14
+ isDesktop: boolean;
15
+ }, __VLS_42: {
16
+ close: typeof close;
17
+ isDesktop: boolean;
18
+ }, __VLS_44: {
19
+ close: typeof close;
20
+ isDesktop: boolean;
21
+ }, __VLS_52: {
22
+ close: typeof close;
23
+ isDesktop: boolean;
24
+ };
25
+ type __VLS_Slots = {} & {
26
+ trigger?: (props: typeof __VLS_14) => any;
27
+ } & {
28
+ title?: (props: typeof __VLS_34) => any;
29
+ } & {
30
+ description?: (props: typeof __VLS_42) => any;
31
+ } & {
32
+ default?: (props: typeof __VLS_44) => any;
33
+ } & {
34
+ footer?: (props: typeof __VLS_52) => any;
35
+ };
36
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ "update:open": (open: boolean) => any;
38
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
39
+ "onUpdate:open"?: ((open: boolean) => any) | undefined;
40
+ }>, {
41
+ showCloseButton: boolean;
42
+ breakpoint: string;
43
+ dismissible: boolean;
44
+ defaultOpen: boolean;
45
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
46
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
47
+ declare const _default: typeof __VLS_export;
48
+ export default _default;
49
+ type __VLS_WithSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };
@@ -0,0 +1,141 @@
1
+ <script setup>
2
+ import { useMediaQuery } from "@vueuse/core";
3
+ import { computed, ref, useAttrs, useSlots } from "vue";
4
+ import {
5
+ Dialog,
6
+ DialogClose,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogFooter,
10
+ DialogHeader,
11
+ DialogTitle,
12
+ DialogTrigger
13
+ } from "./ui/dialog";
14
+ import {
15
+ Drawer,
16
+ DrawerClose,
17
+ DrawerContent,
18
+ DrawerDescription,
19
+ DrawerFooter,
20
+ DrawerHeader,
21
+ DrawerTitle,
22
+ DrawerTrigger
23
+ } from "./ui/drawer";
24
+ defineOptions({
25
+ inheritAttrs: false
26
+ });
27
+ const props = defineProps({
28
+ open: { type: Boolean, required: false },
29
+ defaultOpen: { type: Boolean, required: false, default: false },
30
+ breakpoint: { type: String, required: false, default: "(min-width: 640px)" },
31
+ showCloseButton: { type: Boolean, required: false, default: true },
32
+ dismissible: { type: Boolean, required: false, default: true }
33
+ });
34
+ const emit = defineEmits(["update:open"]);
35
+ const attrs = useAttrs();
36
+ const slots = useSlots();
37
+ const uncontrolledOpen = ref(props.defaultOpen);
38
+ const isDesktop = useMediaQuery(props.breakpoint);
39
+ const desktopComponents = {
40
+ Root: Dialog,
41
+ Trigger: DialogTrigger,
42
+ Content: DialogContent,
43
+ Header: DialogHeader,
44
+ Title: DialogTitle,
45
+ Description: DialogDescription,
46
+ Footer: DialogFooter,
47
+ Close: DialogClose
48
+ };
49
+ const mobileComponents = {
50
+ Root: Drawer,
51
+ Trigger: DrawerTrigger,
52
+ Content: DrawerContent,
53
+ Header: DrawerHeader,
54
+ Title: DrawerTitle,
55
+ Description: DrawerDescription,
56
+ Footer: DrawerFooter,
57
+ Close: DrawerClose
58
+ };
59
+ const modalComponents = computed(() => isDesktop.value ? desktopComponents : mobileComponents);
60
+ const hasTrigger = computed(() => slots.trigger !== void 0);
61
+ const hasTitle = computed(() => slots.title !== void 0);
62
+ const hasDescription = computed(() => slots.description !== void 0);
63
+ const hasHeader = computed(() => hasTitle.value || hasDescription.value);
64
+ const hasFooter = computed(() => slots.footer !== void 0);
65
+ const open = computed({
66
+ get() {
67
+ return props.open ?? uncontrolledOpen.value;
68
+ },
69
+ set(value) {
70
+ if (props.open === void 0) {
71
+ uncontrolledOpen.value = value;
72
+ }
73
+ emit("update:open", value);
74
+ }
75
+ });
76
+ function close() {
77
+ open.value = false;
78
+ }
79
+ </script>
80
+
81
+ <template>
82
+ <component
83
+ :is="modalComponents.Root"
84
+ v-model:open="open"
85
+ :dismissible="props.dismissible"
86
+ >
87
+ <component
88
+ :is="modalComponents.Trigger"
89
+ v-if="hasTrigger"
90
+ as-child
91
+ >
92
+ <slot
93
+ name="trigger"
94
+ v-bind="{ close, isDesktop }"
95
+ />
96
+ </component>
97
+
98
+ <component
99
+ :is="modalComponents.Content"
100
+ v-bind="attrs"
101
+ :show-close-button="props.showCloseButton"
102
+ >
103
+ <component
104
+ :is="modalComponents.Header"
105
+ v-if="hasHeader"
106
+ >
107
+ <component
108
+ :is="modalComponents.Title"
109
+ v-if="hasTitle"
110
+ >
111
+ <slot
112
+ name="title"
113
+ v-bind="{ close, isDesktop }"
114
+ />
115
+ </component>
116
+
117
+ <component
118
+ :is="modalComponents.Description"
119
+ v-if="hasDescription"
120
+ >
121
+ <slot
122
+ name="description"
123
+ v-bind="{ close, isDesktop }"
124
+ />
125
+ </component>
126
+ </component>
127
+
128
+ <slot v-bind="{ close, isDesktop }" />
129
+
130
+ <component
131
+ :is="modalComponents.Footer"
132
+ v-if="hasFooter"
133
+ >
134
+ <slot
135
+ name="footer"
136
+ v-bind="{ close, isDesktop }"
137
+ />
138
+ </component>
139
+ </component>
140
+ </component>
141
+ </template>
@@ -0,0 +1,53 @@
1
+ type __VLS_Props = {
2
+ open?: boolean;
3
+ defaultOpen?: boolean;
4
+ breakpoint?: string;
5
+ showCloseButton?: boolean;
6
+ dismissible?: boolean;
7
+ };
8
+ declare function close(): void;
9
+ declare var __VLS_14: {
10
+ close: typeof close;
11
+ isDesktop: boolean;
12
+ }, __VLS_34: {
13
+ close: typeof close;
14
+ isDesktop: boolean;
15
+ }, __VLS_42: {
16
+ close: typeof close;
17
+ isDesktop: boolean;
18
+ }, __VLS_44: {
19
+ close: typeof close;
20
+ isDesktop: boolean;
21
+ }, __VLS_52: {
22
+ close: typeof close;
23
+ isDesktop: boolean;
24
+ };
25
+ type __VLS_Slots = {} & {
26
+ trigger?: (props: typeof __VLS_14) => any;
27
+ } & {
28
+ title?: (props: typeof __VLS_34) => any;
29
+ } & {
30
+ description?: (props: typeof __VLS_42) => any;
31
+ } & {
32
+ default?: (props: typeof __VLS_44) => any;
33
+ } & {
34
+ footer?: (props: typeof __VLS_52) => any;
35
+ };
36
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ "update:open": (open: boolean) => any;
38
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
39
+ "onUpdate:open"?: ((open: boolean) => any) | undefined;
40
+ }>, {
41
+ showCloseButton: boolean;
42
+ breakpoint: string;
43
+ dismissible: boolean;
44
+ defaultOpen: boolean;
45
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
46
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
47
+ declare const _default: typeof __VLS_export;
48
+ export default _default;
49
+ type __VLS_WithSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };
@@ -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?: Effect.Effect<void>;
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 __VLS_108: {}, __VLS_124: {}, __VLS_347: {};
72
+ declare var __VLS_113: {}, __VLS_129: {}, __VLS_352: {};
71
73
  type __VLS_Slots = {} & {
72
- menu?: (props: typeof __VLS_108) => any;
74
+ menu?: (props: typeof __VLS_113) => any;
73
75
  } & {
74
- profile?: (props: typeof __VLS_124) => any;
76
+ profile?: (props: typeof __VLS_129) => any;
75
77
  } & {
76
- default?: (props: typeof __VLS_347) => any;
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?.pipe(Effect.tap(() => {
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?.pipe(Effect.tap(() => {
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?.pipe(Effect.runPromise)"
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?.pipe(Effect.runPromise)"
231
+ @select="void runUiEffect(command.effect)"
217
232
  >
218
233
  <Icon
219
234
  v-if="command.icon"