@shwfed/nuxt 0.11.0 → 0.11.2
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/runtime/components/button.d.vue.ts +20 -18
- package/dist/runtime/components/button.vue +1 -0
- package/dist/runtime/components/button.vue.d.ts +20 -18
- package/dist/runtime/components/fields.d.vue.ts +10 -10
- package/dist/runtime/components/fields.vue.d.ts +10 -10
- package/dist/runtime/components/markdown.d.vue.ts +2 -2
- package/dist/runtime/components/markdown.vue.d.ts +2 -2
- package/dist/runtime/components/menu-tabs.d.vue.ts +2 -2
- package/dist/runtime/components/menu-tabs.vue.d.ts +2 -2
- package/dist/runtime/components/ui/app/OverlayHost.vue +17 -2
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +18 -18
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +18 -18
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +20 -18
- package/dist/runtime/components/ui/buttons/Buttons.vue +59 -4
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +20 -18
- package/dist/runtime/components/ui/buttons/schema.d.ts +138 -138
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +20 -20
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +20 -20
- package/dist/runtime/components/ui/fields/schema.d.ts +60 -60
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +10 -10
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +10 -10
- package/dist/runtime/components/ui/locale/Locale.d.vue.ts +2 -2
- package/dist/runtime/components/ui/locale/Locale.vue.d.ts +2 -2
- package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +2 -2
- package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +2 -2
- package/dist/runtime/components/ui/markdown/schema.d.ts +8 -8
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +2 -2
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +2 -2
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +2 -2
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +2 -2
- package/dist/runtime/components/ui/menu-tabs/schema.d.ts +10 -10
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +2 -2
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +2 -2
- package/dist/runtime/composables/useButtonAction.d.ts +21 -0
- package/dist/runtime/composables/useButtonAction.js +6 -0
- package/dist/runtime/composables/useOverlay.d.ts +4 -1
- package/dist/runtime/composables/useOverlay.js +38 -4
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/dist/runtime/utils/coders.d.ts +7 -7
- package/package.json +1 -1
|
@@ -14,11 +14,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
items: readonly (Readonly<{
|
|
15
15
|
id: string;
|
|
16
16
|
title: readonly {
|
|
17
|
-
locale: "
|
|
17
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
18
18
|
message: string;
|
|
19
19
|
}[];
|
|
20
20
|
tooltip?: readonly {
|
|
21
|
-
locale: "
|
|
21
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
22
22
|
message: string;
|
|
23
23
|
}[] | undefined;
|
|
24
24
|
icon?: string | undefined;
|
|
@@ -26,11 +26,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
hideTitle?: boolean | undefined;
|
|
27
27
|
modal?: Readonly<{
|
|
28
28
|
title?: readonly {
|
|
29
|
-
locale: "
|
|
29
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
30
|
message: string;
|
|
31
31
|
}[] | undefined;
|
|
32
32
|
description?: readonly {
|
|
33
|
-
locale: "
|
|
33
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
34
34
|
message: string;
|
|
35
35
|
}[] | undefined;
|
|
36
36
|
showCloseButton?: boolean | undefined;
|
|
@@ -40,28 +40,28 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
40
40
|
}> | Readonly<{
|
|
41
41
|
id: string;
|
|
42
42
|
title: readonly {
|
|
43
|
-
locale: "
|
|
43
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
44
44
|
message: string;
|
|
45
45
|
}[];
|
|
46
46
|
items: readonly Readonly<{
|
|
47
47
|
id: string;
|
|
48
48
|
title: readonly {
|
|
49
|
-
locale: "
|
|
49
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
50
50
|
message: string;
|
|
51
51
|
}[];
|
|
52
52
|
tooltip?: readonly {
|
|
53
|
-
locale: "
|
|
53
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
54
54
|
message: string;
|
|
55
55
|
}[] | undefined;
|
|
56
56
|
icon?: string | undefined;
|
|
57
57
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
58
58
|
modal?: Readonly<{
|
|
59
59
|
title?: readonly {
|
|
60
|
-
locale: "
|
|
60
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
61
61
|
message: string;
|
|
62
62
|
}[] | undefined;
|
|
63
63
|
description?: readonly {
|
|
64
|
-
locale: "
|
|
64
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
65
65
|
message: string;
|
|
66
66
|
}[] | undefined;
|
|
67
67
|
showCloseButton?: boolean | undefined;
|
|
@@ -85,11 +85,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
85
85
|
items: readonly (Readonly<{
|
|
86
86
|
id: string;
|
|
87
87
|
title: readonly {
|
|
88
|
-
locale: "
|
|
88
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
89
89
|
message: string;
|
|
90
90
|
}[];
|
|
91
91
|
tooltip?: readonly {
|
|
92
|
-
locale: "
|
|
92
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
93
93
|
message: string;
|
|
94
94
|
}[] | undefined;
|
|
95
95
|
icon?: string | undefined;
|
|
@@ -97,11 +97,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
97
97
|
hideTitle?: boolean | undefined;
|
|
98
98
|
modal?: Readonly<{
|
|
99
99
|
title?: readonly {
|
|
100
|
-
locale: "
|
|
100
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
101
101
|
message: string;
|
|
102
102
|
}[] | undefined;
|
|
103
103
|
description?: readonly {
|
|
104
|
-
locale: "
|
|
104
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
105
105
|
message: string;
|
|
106
106
|
}[] | undefined;
|
|
107
107
|
showCloseButton?: boolean | undefined;
|
|
@@ -111,28 +111,28 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
111
111
|
}> | Readonly<{
|
|
112
112
|
id: string;
|
|
113
113
|
title: readonly {
|
|
114
|
-
locale: "
|
|
114
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
115
115
|
message: string;
|
|
116
116
|
}[];
|
|
117
117
|
items: readonly Readonly<{
|
|
118
118
|
id: string;
|
|
119
119
|
title: readonly {
|
|
120
|
-
locale: "
|
|
120
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
121
121
|
message: string;
|
|
122
122
|
}[];
|
|
123
123
|
tooltip?: readonly {
|
|
124
|
-
locale: "
|
|
124
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
125
125
|
message: string;
|
|
126
126
|
}[] | undefined;
|
|
127
127
|
icon?: string | undefined;
|
|
128
128
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
129
129
|
modal?: Readonly<{
|
|
130
130
|
title?: readonly {
|
|
131
|
-
locale: "
|
|
131
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
132
132
|
message: string;
|
|
133
133
|
}[] | undefined;
|
|
134
134
|
description?: readonly {
|
|
135
|
-
locale: "
|
|
135
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
136
136
|
message: string;
|
|
137
137
|
}[] | undefined;
|
|
138
138
|
showCloseButton?: boolean | undefined;
|
|
@@ -14,11 +14,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
items: readonly (Readonly<{
|
|
15
15
|
id: string;
|
|
16
16
|
title: readonly {
|
|
17
|
-
locale: "
|
|
17
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
18
18
|
message: string;
|
|
19
19
|
}[];
|
|
20
20
|
tooltip?: readonly {
|
|
21
|
-
locale: "
|
|
21
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
22
22
|
message: string;
|
|
23
23
|
}[] | undefined;
|
|
24
24
|
icon?: string | undefined;
|
|
@@ -26,11 +26,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
hideTitle?: boolean | undefined;
|
|
27
27
|
modal?: Readonly<{
|
|
28
28
|
title?: readonly {
|
|
29
|
-
locale: "
|
|
29
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
30
|
message: string;
|
|
31
31
|
}[] | undefined;
|
|
32
32
|
description?: readonly {
|
|
33
|
-
locale: "
|
|
33
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
34
34
|
message: string;
|
|
35
35
|
}[] | undefined;
|
|
36
36
|
showCloseButton?: boolean | undefined;
|
|
@@ -40,28 +40,28 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
40
40
|
}> | Readonly<{
|
|
41
41
|
id: string;
|
|
42
42
|
title: readonly {
|
|
43
|
-
locale: "
|
|
43
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
44
44
|
message: string;
|
|
45
45
|
}[];
|
|
46
46
|
items: readonly Readonly<{
|
|
47
47
|
id: string;
|
|
48
48
|
title: readonly {
|
|
49
|
-
locale: "
|
|
49
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
50
50
|
message: string;
|
|
51
51
|
}[];
|
|
52
52
|
tooltip?: readonly {
|
|
53
|
-
locale: "
|
|
53
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
54
54
|
message: string;
|
|
55
55
|
}[] | undefined;
|
|
56
56
|
icon?: string | undefined;
|
|
57
57
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
58
58
|
modal?: Readonly<{
|
|
59
59
|
title?: readonly {
|
|
60
|
-
locale: "
|
|
60
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
61
61
|
message: string;
|
|
62
62
|
}[] | undefined;
|
|
63
63
|
description?: readonly {
|
|
64
|
-
locale: "
|
|
64
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
65
65
|
message: string;
|
|
66
66
|
}[] | undefined;
|
|
67
67
|
showCloseButton?: boolean | undefined;
|
|
@@ -85,11 +85,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
85
85
|
items: readonly (Readonly<{
|
|
86
86
|
id: string;
|
|
87
87
|
title: readonly {
|
|
88
|
-
locale: "
|
|
88
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
89
89
|
message: string;
|
|
90
90
|
}[];
|
|
91
91
|
tooltip?: readonly {
|
|
92
|
-
locale: "
|
|
92
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
93
93
|
message: string;
|
|
94
94
|
}[] | undefined;
|
|
95
95
|
icon?: string | undefined;
|
|
@@ -97,11 +97,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
97
97
|
hideTitle?: boolean | undefined;
|
|
98
98
|
modal?: Readonly<{
|
|
99
99
|
title?: readonly {
|
|
100
|
-
locale: "
|
|
100
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
101
101
|
message: string;
|
|
102
102
|
}[] | undefined;
|
|
103
103
|
description?: readonly {
|
|
104
|
-
locale: "
|
|
104
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
105
105
|
message: string;
|
|
106
106
|
}[] | undefined;
|
|
107
107
|
showCloseButton?: boolean | undefined;
|
|
@@ -111,28 +111,28 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
111
111
|
}> | Readonly<{
|
|
112
112
|
id: string;
|
|
113
113
|
title: readonly {
|
|
114
|
-
locale: "
|
|
114
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
115
115
|
message: string;
|
|
116
116
|
}[];
|
|
117
117
|
items: readonly Readonly<{
|
|
118
118
|
id: string;
|
|
119
119
|
title: readonly {
|
|
120
|
-
locale: "
|
|
120
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
121
121
|
message: string;
|
|
122
122
|
}[];
|
|
123
123
|
tooltip?: readonly {
|
|
124
|
-
locale: "
|
|
124
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
125
125
|
message: string;
|
|
126
126
|
}[] | undefined;
|
|
127
127
|
icon?: string | undefined;
|
|
128
128
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
129
129
|
modal?: Readonly<{
|
|
130
130
|
title?: readonly {
|
|
131
|
-
locale: "
|
|
131
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
132
132
|
message: string;
|
|
133
133
|
}[] | undefined;
|
|
134
134
|
description?: readonly {
|
|
135
|
-
locale: "
|
|
135
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
136
136
|
message: string;
|
|
137
137
|
}[] | undefined;
|
|
138
138
|
showCloseButton?: boolean | undefined;
|
|
@@ -2,7 +2,9 @@ import { Effect } from 'effect';
|
|
|
2
2
|
import { type ButtonConfigInput } from './schema.js';
|
|
3
3
|
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './schema.js';
|
|
4
4
|
export { ButtonBodyC, ButtonBodyInputC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './schema.js';
|
|
5
|
+
export { ButtonActionService, currentButtonAction } from '../../../composables/useButtonAction.js';
|
|
5
6
|
export type { ButtonAction, ButtonBody, ButtonBodyInput, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal, } from './schema.js';
|
|
7
|
+
export type { ButtonActionEffect, ButtonActionEffectFactory, ButtonActionRuntime } from '../../../composables/useButtonAction.js';
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
8
10
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
@@ -14,11 +16,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
14
16
|
items: readonly (Readonly<{
|
|
15
17
|
id: string;
|
|
16
18
|
title: readonly {
|
|
17
|
-
locale: "
|
|
19
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
18
20
|
message: string;
|
|
19
21
|
}[];
|
|
20
22
|
tooltip?: readonly {
|
|
21
|
-
locale: "
|
|
23
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
22
24
|
message: string;
|
|
23
25
|
}[] | undefined;
|
|
24
26
|
icon?: string | undefined;
|
|
@@ -26,11 +28,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
26
28
|
hideTitle?: boolean | undefined;
|
|
27
29
|
modal?: Readonly<{
|
|
28
30
|
title?: readonly {
|
|
29
|
-
locale: "
|
|
31
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
32
|
message: string;
|
|
31
33
|
}[] | undefined;
|
|
32
34
|
description?: readonly {
|
|
33
|
-
locale: "
|
|
35
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
34
36
|
message: string;
|
|
35
37
|
}[] | undefined;
|
|
36
38
|
showCloseButton?: boolean | undefined;
|
|
@@ -40,28 +42,28 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
40
42
|
}> | Readonly<{
|
|
41
43
|
id: string;
|
|
42
44
|
title: readonly {
|
|
43
|
-
locale: "
|
|
45
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
44
46
|
message: string;
|
|
45
47
|
}[];
|
|
46
48
|
items: readonly Readonly<{
|
|
47
49
|
id: string;
|
|
48
50
|
title: readonly {
|
|
49
|
-
locale: "
|
|
51
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
50
52
|
message: string;
|
|
51
53
|
}[];
|
|
52
54
|
tooltip?: readonly {
|
|
53
|
-
locale: "
|
|
55
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
54
56
|
message: string;
|
|
55
57
|
}[] | undefined;
|
|
56
58
|
icon?: string | undefined;
|
|
57
59
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
58
60
|
modal?: Readonly<{
|
|
59
61
|
title?: readonly {
|
|
60
|
-
locale: "
|
|
62
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
61
63
|
message: string;
|
|
62
64
|
}[] | undefined;
|
|
63
65
|
description?: readonly {
|
|
64
|
-
locale: "
|
|
66
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
65
67
|
message: string;
|
|
66
68
|
}[] | undefined;
|
|
67
69
|
showCloseButton?: boolean | undefined;
|
|
@@ -86,11 +88,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
86
88
|
items: readonly (Readonly<{
|
|
87
89
|
id: string;
|
|
88
90
|
title: readonly {
|
|
89
|
-
locale: "
|
|
91
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
90
92
|
message: string;
|
|
91
93
|
}[];
|
|
92
94
|
tooltip?: readonly {
|
|
93
|
-
locale: "
|
|
95
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
94
96
|
message: string;
|
|
95
97
|
}[] | undefined;
|
|
96
98
|
icon?: string | undefined;
|
|
@@ -98,11 +100,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
98
100
|
hideTitle?: boolean | undefined;
|
|
99
101
|
modal?: Readonly<{
|
|
100
102
|
title?: readonly {
|
|
101
|
-
locale: "
|
|
103
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
102
104
|
message: string;
|
|
103
105
|
}[] | undefined;
|
|
104
106
|
description?: readonly {
|
|
105
|
-
locale: "
|
|
107
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
106
108
|
message: string;
|
|
107
109
|
}[] | undefined;
|
|
108
110
|
showCloseButton?: boolean | undefined;
|
|
@@ -112,28 +114,28 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
112
114
|
}> | Readonly<{
|
|
113
115
|
id: string;
|
|
114
116
|
title: readonly {
|
|
115
|
-
locale: "
|
|
117
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
116
118
|
message: string;
|
|
117
119
|
}[];
|
|
118
120
|
items: readonly Readonly<{
|
|
119
121
|
id: string;
|
|
120
122
|
title: readonly {
|
|
121
|
-
locale: "
|
|
123
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
122
124
|
message: string;
|
|
123
125
|
}[];
|
|
124
126
|
tooltip?: readonly {
|
|
125
|
-
locale: "
|
|
127
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
126
128
|
message: string;
|
|
127
129
|
}[] | undefined;
|
|
128
130
|
icon?: string | undefined;
|
|
129
131
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
130
132
|
modal?: Readonly<{
|
|
131
133
|
title?: readonly {
|
|
132
|
-
locale: "
|
|
134
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
133
135
|
message: string;
|
|
134
136
|
}[] | undefined;
|
|
135
137
|
description?: readonly {
|
|
136
|
-
locale: "
|
|
138
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
137
139
|
message: string;
|
|
138
140
|
}[] | undefined;
|
|
139
141
|
showCloseButton?: boolean | undefined;
|
|
@@ -6,6 +6,9 @@ import { Icon } from "@iconify/vue";
|
|
|
6
6
|
import { Effect } from "effect";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
8
|
import { useCheating } from "#imports";
|
|
9
|
+
import {
|
|
10
|
+
ButtonActionService
|
|
11
|
+
} from "../../../composables/useButtonAction";
|
|
9
12
|
import { provideOverlay, useOverlay } from "../../../composables/useOverlay";
|
|
10
13
|
import { getLocalizedText, hasVisibleLocaleValue } from "../../../utils/coders";
|
|
11
14
|
import { cn } from "../../../utils/cn";
|
|
@@ -154,11 +157,14 @@ function getButtonEffect(buttonId) {
|
|
|
154
157
|
function isEffectValue(value) {
|
|
155
158
|
return typeof value === "object" && value !== null && "_op" in value;
|
|
156
159
|
}
|
|
160
|
+
function isEffectFactory(value) {
|
|
161
|
+
return typeof value === "function";
|
|
162
|
+
}
|
|
157
163
|
function isPending(buttonId) {
|
|
158
164
|
return pendingIds.value.includes(buttonId);
|
|
159
165
|
}
|
|
160
166
|
function isButtonDisabled(buttonId) {
|
|
161
|
-
return isPending(buttonId) || !isEffectValue(getButtonEffect(buttonId));
|
|
167
|
+
return isPending(buttonId) || !(isEffectValue(getButtonEffect(buttonId)) || isEffectFactory(getButtonEffect(buttonId)));
|
|
162
168
|
}
|
|
163
169
|
function isDropdownPending(dropdown) {
|
|
164
170
|
return dropdown.items.some((item) => isPending(item.id));
|
|
@@ -166,17 +172,65 @@ function isDropdownPending(dropdown) {
|
|
|
166
172
|
function hasButtonTooltip(button) {
|
|
167
173
|
return hasVisibleLocaleValue(button.tooltip);
|
|
168
174
|
}
|
|
175
|
+
function findButtonAction(buttonId) {
|
|
176
|
+
for (const group of displayConfig.value.groups) {
|
|
177
|
+
for (const item of group.items) {
|
|
178
|
+
if (isDropdownItem(item)) {
|
|
179
|
+
const child = item.items.find((candidate) => candidate.id === buttonId);
|
|
180
|
+
if (child) {
|
|
181
|
+
return child;
|
|
182
|
+
}
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (item.id === buttonId) {
|
|
186
|
+
return item;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return void 0;
|
|
191
|
+
}
|
|
192
|
+
function createButtonActionRuntime(button) {
|
|
193
|
+
const tooltip = getButtonTooltip(button);
|
|
194
|
+
return {
|
|
195
|
+
id: button.id,
|
|
196
|
+
locale: locale.value,
|
|
197
|
+
title: getButtonLabel(button),
|
|
198
|
+
description: tooltip,
|
|
199
|
+
tooltip
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function resolveButtonEffect(button) {
|
|
203
|
+
const value = getButtonEffect(button.id);
|
|
204
|
+
if (isEffectValue(value)) {
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
if (!isEffectFactory(value)) {
|
|
208
|
+
return void 0;
|
|
209
|
+
}
|
|
210
|
+
const effect = value(createButtonActionRuntime(button));
|
|
211
|
+
return isEffectValue(effect) ? effect : void 0;
|
|
212
|
+
}
|
|
169
213
|
async function runButton(buttonId) {
|
|
170
214
|
if (isPending(buttonId)) {
|
|
171
215
|
return;
|
|
172
216
|
}
|
|
173
|
-
const
|
|
174
|
-
if (!
|
|
217
|
+
const button = findButtonAction(buttonId);
|
|
218
|
+
if (!button) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const effect = resolveButtonEffect(button);
|
|
222
|
+
if (!effect) {
|
|
175
223
|
return;
|
|
176
224
|
}
|
|
225
|
+
const action = createButtonActionRuntime(button);
|
|
177
226
|
pendingIds.value = [...pendingIds.value, buttonId];
|
|
178
227
|
try {
|
|
179
|
-
await Effect.runPromise(
|
|
228
|
+
await Effect.runPromise(
|
|
229
|
+
provideOverlay(
|
|
230
|
+
Effect.scoped(effect).pipe(Effect.provideService(ButtonActionService, action)),
|
|
231
|
+
overlay
|
|
232
|
+
)
|
|
233
|
+
);
|
|
180
234
|
} finally {
|
|
181
235
|
pendingIds.value = pendingIds.value.filter((id) => id !== buttonId);
|
|
182
236
|
}
|
|
@@ -211,6 +265,7 @@ export {
|
|
|
211
265
|
SUPPORTED_COMPATIBILITY_DATES,
|
|
212
266
|
createButtonConfig
|
|
213
267
|
} from "./schema";
|
|
268
|
+
export { ButtonActionService, currentButtonAction } from "../../../composables/useButtonAction";
|
|
214
269
|
</script>
|
|
215
270
|
|
|
216
271
|
<template>
|
|
@@ -2,7 +2,9 @@ import { Effect } from 'effect';
|
|
|
2
2
|
import { type ButtonConfigInput } from './schema.js';
|
|
3
3
|
export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './schema.js';
|
|
4
4
|
export { ButtonBodyC, ButtonBodyInputC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './schema.js';
|
|
5
|
+
export { ButtonActionService, currentButtonAction } from '../../../composables/useButtonAction.js';
|
|
5
6
|
export type { ButtonAction, ButtonBody, ButtonBodyInput, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal, } from './schema.js';
|
|
7
|
+
export type { ButtonActionEffect, ButtonActionEffectFactory, ButtonActionRuntime } from '../../../composables/useButtonAction.js';
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
8
10
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
@@ -14,11 +16,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
14
16
|
items: readonly (Readonly<{
|
|
15
17
|
id: string;
|
|
16
18
|
title: readonly {
|
|
17
|
-
locale: "
|
|
19
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
18
20
|
message: string;
|
|
19
21
|
}[];
|
|
20
22
|
tooltip?: readonly {
|
|
21
|
-
locale: "
|
|
23
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
22
24
|
message: string;
|
|
23
25
|
}[] | undefined;
|
|
24
26
|
icon?: string | undefined;
|
|
@@ -26,11 +28,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
26
28
|
hideTitle?: boolean | undefined;
|
|
27
29
|
modal?: Readonly<{
|
|
28
30
|
title?: readonly {
|
|
29
|
-
locale: "
|
|
31
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
32
|
message: string;
|
|
31
33
|
}[] | undefined;
|
|
32
34
|
description?: readonly {
|
|
33
|
-
locale: "
|
|
35
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
34
36
|
message: string;
|
|
35
37
|
}[] | undefined;
|
|
36
38
|
showCloseButton?: boolean | undefined;
|
|
@@ -40,28 +42,28 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
40
42
|
}> | Readonly<{
|
|
41
43
|
id: string;
|
|
42
44
|
title: readonly {
|
|
43
|
-
locale: "
|
|
45
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
44
46
|
message: string;
|
|
45
47
|
}[];
|
|
46
48
|
items: readonly Readonly<{
|
|
47
49
|
id: string;
|
|
48
50
|
title: readonly {
|
|
49
|
-
locale: "
|
|
51
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
50
52
|
message: string;
|
|
51
53
|
}[];
|
|
52
54
|
tooltip?: readonly {
|
|
53
|
-
locale: "
|
|
55
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
54
56
|
message: string;
|
|
55
57
|
}[] | undefined;
|
|
56
58
|
icon?: string | undefined;
|
|
57
59
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
58
60
|
modal?: Readonly<{
|
|
59
61
|
title?: readonly {
|
|
60
|
-
locale: "
|
|
62
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
61
63
|
message: string;
|
|
62
64
|
}[] | undefined;
|
|
63
65
|
description?: readonly {
|
|
64
|
-
locale: "
|
|
66
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
65
67
|
message: string;
|
|
66
68
|
}[] | undefined;
|
|
67
69
|
showCloseButton?: boolean | undefined;
|
|
@@ -86,11 +88,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
86
88
|
items: readonly (Readonly<{
|
|
87
89
|
id: string;
|
|
88
90
|
title: readonly {
|
|
89
|
-
locale: "
|
|
91
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
90
92
|
message: string;
|
|
91
93
|
}[];
|
|
92
94
|
tooltip?: readonly {
|
|
93
|
-
locale: "
|
|
95
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
94
96
|
message: string;
|
|
95
97
|
}[] | undefined;
|
|
96
98
|
icon?: string | undefined;
|
|
@@ -98,11 +100,11 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
98
100
|
hideTitle?: boolean | undefined;
|
|
99
101
|
modal?: Readonly<{
|
|
100
102
|
title?: readonly {
|
|
101
|
-
locale: "
|
|
103
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
102
104
|
message: string;
|
|
103
105
|
}[] | undefined;
|
|
104
106
|
description?: readonly {
|
|
105
|
-
locale: "
|
|
107
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
106
108
|
message: string;
|
|
107
109
|
}[] | undefined;
|
|
108
110
|
showCloseButton?: boolean | undefined;
|
|
@@ -112,28 +114,28 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
112
114
|
}> | Readonly<{
|
|
113
115
|
id: string;
|
|
114
116
|
title: readonly {
|
|
115
|
-
locale: "
|
|
117
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
116
118
|
message: string;
|
|
117
119
|
}[];
|
|
118
120
|
items: readonly Readonly<{
|
|
119
121
|
id: string;
|
|
120
122
|
title: readonly {
|
|
121
|
-
locale: "
|
|
123
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
122
124
|
message: string;
|
|
123
125
|
}[];
|
|
124
126
|
tooltip?: readonly {
|
|
125
|
-
locale: "
|
|
127
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
126
128
|
message: string;
|
|
127
129
|
}[] | undefined;
|
|
128
130
|
icon?: string | undefined;
|
|
129
131
|
variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
|
|
130
132
|
modal?: Readonly<{
|
|
131
133
|
title?: readonly {
|
|
132
|
-
locale: "
|
|
134
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
133
135
|
message: string;
|
|
134
136
|
}[] | undefined;
|
|
135
137
|
description?: readonly {
|
|
136
|
-
locale: "
|
|
138
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
137
139
|
message: string;
|
|
138
140
|
}[] | undefined;
|
|
139
141
|
showCloseButton?: boolean | undefined;
|