@shwfed/nuxt 0.11.1 → 0.11.3
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 +18 -18
- package/dist/runtime/components/button.vue.d.ts +18 -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 +51 -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 +18 -18
- package/dist/runtime/components/ui/buttons/Buttons.vue +9 -25
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +18 -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/useOverlay.d.ts +14 -1
- package/dist/runtime/composables/useOverlay.js +59 -4
- package/dist/runtime/utils/coders.d.ts +7 -7
- package/package.json +1 -1
package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
13
13
|
kind: string;
|
|
14
14
|
compatibilityDate: string;
|
|
15
15
|
locale?: readonly {
|
|
16
|
-
locale: "
|
|
16
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
17
17
|
message: string;
|
|
18
18
|
}[] | undefined;
|
|
19
19
|
inline?: boolean | undefined;
|
|
@@ -25,7 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
kind: string;
|
|
26
26
|
compatibilityDate: string;
|
|
27
27
|
locale?: readonly {
|
|
28
|
-
locale: "
|
|
28
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
29
29
|
message: string;
|
|
30
30
|
}[] | undefined;
|
|
31
31
|
inline?: boolean | undefined;
|
package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
13
13
|
kind: string;
|
|
14
14
|
compatibilityDate: string;
|
|
15
15
|
locale?: readonly {
|
|
16
|
-
locale: "
|
|
16
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
17
17
|
message: string;
|
|
18
18
|
}[] | undefined;
|
|
19
19
|
inline?: boolean | undefined;
|
|
@@ -25,7 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
25
25
|
kind: string;
|
|
26
26
|
compatibilityDate: string;
|
|
27
27
|
locale?: readonly {
|
|
28
|
-
locale: "
|
|
28
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
29
29
|
message: string;
|
|
30
30
|
}[] | undefined;
|
|
31
31
|
inline?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
14
|
title: readonly {
|
|
15
|
-
locale: "
|
|
15
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
16
16
|
message: string;
|
|
17
17
|
}[];
|
|
18
18
|
to: string;
|
|
@@ -28,7 +28,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
28
28
|
menus: readonly Readonly<{
|
|
29
29
|
id: string;
|
|
30
30
|
title: readonly {
|
|
31
|
-
locale: "
|
|
31
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
32
32
|
message: string;
|
|
33
33
|
}[];
|
|
34
34
|
to: string;
|
|
@@ -12,7 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
14
|
title: readonly {
|
|
15
|
-
locale: "
|
|
15
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
16
16
|
message: string;
|
|
17
17
|
}[];
|
|
18
18
|
to: string;
|
|
@@ -28,7 +28,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
28
28
|
menus: readonly Readonly<{
|
|
29
29
|
id: string;
|
|
30
30
|
title: readonly {
|
|
31
|
-
locale: "
|
|
31
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
32
32
|
message: string;
|
|
33
33
|
}[];
|
|
34
34
|
to: string;
|
|
@@ -8,10 +8,10 @@ export declare const MenuTabsItemC: z.ZodReadonly<z.ZodObject<{
|
|
|
8
8
|
id: z.ZodUUID;
|
|
9
9
|
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
10
10
|
locale: z.ZodEnum<{
|
|
11
|
-
zh: "zh";
|
|
12
|
-
ja: "ja";
|
|
13
11
|
en: "en";
|
|
12
|
+
ja: "ja";
|
|
14
13
|
ko: "ko";
|
|
14
|
+
zh: "zh";
|
|
15
15
|
}>;
|
|
16
16
|
message: z.ZodString;
|
|
17
17
|
}, z.core.$strip>>>;
|
|
@@ -22,10 +22,10 @@ export declare const MenuTabsBodyC: z.ZodReadonly<z.ZodObject<{
|
|
|
22
22
|
id: z.ZodUUID;
|
|
23
23
|
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
24
24
|
locale: z.ZodEnum<{
|
|
25
|
-
zh: "zh";
|
|
26
|
-
ja: "ja";
|
|
27
25
|
en: "en";
|
|
26
|
+
ja: "ja";
|
|
28
27
|
ko: "ko";
|
|
28
|
+
zh: "zh";
|
|
29
29
|
}>;
|
|
30
30
|
message: z.ZodString;
|
|
31
31
|
}, z.core.$strip>>>;
|
|
@@ -37,10 +37,10 @@ export declare const MenuTabsBodyInputC: z.ZodReadonly<z.ZodObject<{
|
|
|
37
37
|
id: z.ZodUUID;
|
|
38
38
|
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
39
39
|
locale: z.ZodEnum<{
|
|
40
|
-
zh: "zh";
|
|
41
|
-
ja: "ja";
|
|
42
40
|
en: "en";
|
|
41
|
+
ja: "ja";
|
|
43
42
|
ko: "ko";
|
|
43
|
+
zh: "zh";
|
|
44
44
|
}>;
|
|
45
45
|
message: z.ZodString;
|
|
46
46
|
}, z.core.$strip>>>;
|
|
@@ -52,10 +52,10 @@ export declare const MenuTabsConfigC: z.ZodReadonly<z.ZodObject<{
|
|
|
52
52
|
id: z.ZodUUID;
|
|
53
53
|
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
54
54
|
locale: z.ZodEnum<{
|
|
55
|
-
zh: "zh";
|
|
56
|
-
ja: "ja";
|
|
57
55
|
en: "en";
|
|
56
|
+
ja: "ja";
|
|
58
57
|
ko: "ko";
|
|
58
|
+
zh: "zh";
|
|
59
59
|
}>;
|
|
60
60
|
message: z.ZodString;
|
|
61
61
|
}, z.core.$strip>>>;
|
|
@@ -69,10 +69,10 @@ export declare const MenuTabsConfigInputC: z.ZodReadonly<z.ZodObject<{
|
|
|
69
69
|
id: z.ZodUUID;
|
|
70
70
|
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
71
71
|
locale: z.ZodEnum<{
|
|
72
|
-
zh: "zh";
|
|
73
|
-
ja: "ja";
|
|
74
72
|
en: "en";
|
|
73
|
+
ja: "ja";
|
|
75
74
|
ko: "ko";
|
|
75
|
+
zh: "zh";
|
|
76
76
|
}>;
|
|
77
77
|
message: z.ZodString;
|
|
78
78
|
}, z.core.$strip>>>;
|
package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
14
|
title: readonly {
|
|
15
|
-
locale: "
|
|
15
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
16
16
|
message: string;
|
|
17
17
|
}[];
|
|
18
18
|
to: string;
|
|
@@ -26,7 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
menus: readonly Readonly<{
|
|
27
27
|
id: string;
|
|
28
28
|
title: readonly {
|
|
29
|
-
locale: "
|
|
29
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
30
|
message: string;
|
|
31
31
|
}[];
|
|
32
32
|
to: string;
|
package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
14
|
title: readonly {
|
|
15
|
-
locale: "
|
|
15
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
16
16
|
message: string;
|
|
17
17
|
}[];
|
|
18
18
|
to: string;
|
|
@@ -26,7 +26,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
menus: readonly Readonly<{
|
|
27
27
|
id: string;
|
|
28
28
|
title: readonly {
|
|
29
|
-
locale: "
|
|
29
|
+
locale: "en" | "ja" | "ko" | "zh";
|
|
30
30
|
message: string;
|
|
31
31
|
}[];
|
|
32
32
|
to: string;
|
|
@@ -14,13 +14,19 @@ export type OverlayShellProps = Readonly<{
|
|
|
14
14
|
dismissible?: boolean;
|
|
15
15
|
}>;
|
|
16
16
|
export type OverlayBodyProps = Readonly<Record<string, unknown>>;
|
|
17
|
+
export type OverlaySectionReferenceInput = Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
props?: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
17
21
|
export type OverlaySessionInput = Readonly<{
|
|
18
22
|
shell?: Partial<OverlayShellProps>;
|
|
19
23
|
props?: Record<string, unknown>;
|
|
24
|
+
footer?: OverlaySectionReferenceInput;
|
|
20
25
|
}>;
|
|
21
26
|
export type OverlaySessionPatch = Readonly<{
|
|
22
27
|
shell?: Partial<OverlayShellProps>;
|
|
23
28
|
props?: Record<string, unknown>;
|
|
29
|
+
footer?: OverlaySectionReferenceInput | null;
|
|
24
30
|
}>;
|
|
25
31
|
export type OverlaySlotProps = Readonly<{
|
|
26
32
|
props: OverlayBodyProps;
|
|
@@ -37,11 +43,18 @@ export type OverlayDefinition = Readonly<{
|
|
|
37
43
|
render: OverlayBodyRender;
|
|
38
44
|
shell?: OverlayShellProps;
|
|
39
45
|
}>;
|
|
46
|
+
type OverlayShellState = OverlayShellProps & {
|
|
47
|
+
descriptionSrOnly?: boolean;
|
|
48
|
+
};
|
|
40
49
|
type OverlaySession = {
|
|
41
50
|
sessionId: string;
|
|
42
51
|
definitionId: string;
|
|
43
|
-
shell:
|
|
52
|
+
shell: OverlayShellState;
|
|
44
53
|
props: Record<string, unknown>;
|
|
54
|
+
footer?: {
|
|
55
|
+
id: string;
|
|
56
|
+
props: Record<string, unknown>;
|
|
57
|
+
};
|
|
45
58
|
deferred: Deferred.Deferred<OverlayResult, never>;
|
|
46
59
|
};
|
|
47
60
|
export type OverlayHandle = Readonly<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Context, Deferred, Effect } from "effect";
|
|
1
|
+
import { Context, Deferred, Effect, Option } from "effect";
|
|
2
2
|
import { reactive, ref } from "vue";
|
|
3
|
+
import { ButtonActionService } from "./useButtonAction.js";
|
|
3
4
|
export class OverlayService extends Context.Tag("shwfed/OverlayService")() {
|
|
4
5
|
}
|
|
5
6
|
function createAborted(reason) {
|
|
@@ -14,6 +15,21 @@ function createDefinitionNotFoundError(definitionId) {
|
|
|
14
15
|
definitionId
|
|
15
16
|
};
|
|
16
17
|
}
|
|
18
|
+
function hasVisibleText(value) {
|
|
19
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
20
|
+
}
|
|
21
|
+
function getDefaultOverlayDescription(locale) {
|
|
22
|
+
switch (locale) {
|
|
23
|
+
case "en":
|
|
24
|
+
return "Opened dialog";
|
|
25
|
+
case "ja":
|
|
26
|
+
return "\u958B\u3044\u3066\u3044\u308B\u30C0\u30A4\u30A2\u30ED\u30B0";
|
|
27
|
+
case "ko":
|
|
28
|
+
return "\uC5F4\uB9B0 \uB300\uD654\uC0C1\uC790";
|
|
29
|
+
default:
|
|
30
|
+
return "\u6253\u5F00\u7684\u5F39\u7A97";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
17
33
|
export function isOverlayAborted(value) {
|
|
18
34
|
return typeof value === "object" && value !== null && Reflect.get(value, "_tag") === "OverlayAborted" && typeof Reflect.get(value, "reason") === "string";
|
|
19
35
|
}
|
|
@@ -86,7 +102,8 @@ function createOverlayRuntime() {
|
|
|
86
102
|
if (patch.shell) {
|
|
87
103
|
session.shell = {
|
|
88
104
|
...session.shell,
|
|
89
|
-
...patch.shell
|
|
105
|
+
...patch.shell,
|
|
106
|
+
descriptionSrOnly: Reflect.has(patch.shell, "description") ? false : session.shell.descriptionSrOnly
|
|
90
107
|
};
|
|
91
108
|
}
|
|
92
109
|
if (patch.props) {
|
|
@@ -95,6 +112,18 @@ function createOverlayRuntime() {
|
|
|
95
112
|
...patch.props
|
|
96
113
|
};
|
|
97
114
|
}
|
|
115
|
+
if (Reflect.has(patch, "footer")) {
|
|
116
|
+
if (patch.footer === null || patch.footer === void 0) {
|
|
117
|
+
session.footer = void 0;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
session.footer = {
|
|
121
|
+
id: patch.footer.id,
|
|
122
|
+
props: {
|
|
123
|
+
...patch.footer.props
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
98
127
|
}
|
|
99
128
|
function closeSync(sessionId, value) {
|
|
100
129
|
void Effect.runPromise(closeInternal(sessionId, value));
|
|
@@ -146,17 +175,43 @@ function createOverlayRuntime() {
|
|
|
146
175
|
if (!definition) {
|
|
147
176
|
return yield* Effect.fail(createDefinitionNotFoundError(definitionId));
|
|
148
177
|
}
|
|
178
|
+
if (options?.footer && !getDefinition(options.footer.id)) {
|
|
179
|
+
return yield* Effect.fail(createDefinitionNotFoundError(options.footer.id));
|
|
180
|
+
}
|
|
181
|
+
const buttonActionOption = yield* Effect.serviceOption(ButtonActionService);
|
|
182
|
+
const buttonAction = Option.match(buttonActionOption, {
|
|
183
|
+
onNone: () => void 0,
|
|
184
|
+
onSome: (action) => action
|
|
185
|
+
});
|
|
186
|
+
const definitionShell = definition.shell;
|
|
187
|
+
const explicitTitle = hasVisibleText(options?.shell?.title) ? options.shell.title : void 0;
|
|
188
|
+
const buttonTitle = hasVisibleText(buttonAction?.title) ? buttonAction.title : void 0;
|
|
189
|
+
const definitionTitle = hasVisibleText(definitionShell?.title) ? definitionShell.title : void 0;
|
|
190
|
+
const explicitDescription = hasVisibleText(options?.shell?.description) ? options.shell.description : void 0;
|
|
191
|
+
const buttonDescription = hasVisibleText(buttonAction?.tooltip) ? buttonAction.tooltip : void 0;
|
|
192
|
+
const definitionDescription = hasVisibleText(definitionShell?.description) ? definitionShell.description : void 0;
|
|
193
|
+
const descriptionSrOnly = explicitDescription === void 0 && buttonDescription === void 0 && definitionDescription === void 0;
|
|
149
194
|
const deferred = yield* Deferred.make();
|
|
150
195
|
const session = {
|
|
151
196
|
sessionId: crypto.randomUUID(),
|
|
152
197
|
definitionId,
|
|
153
198
|
shell: {
|
|
154
|
-
|
|
155
|
-
|
|
199
|
+
title: explicitTitle ?? buttonTitle ?? definitionTitle,
|
|
200
|
+
description: explicitDescription ?? buttonDescription ?? definitionDescription ?? getDefaultOverlayDescription(buttonAction?.locale ?? "zh"),
|
|
201
|
+
descriptionSrOnly,
|
|
202
|
+
showCloseButton: options?.shell?.showCloseButton ?? definitionShell?.showCloseButton,
|
|
203
|
+
breakpoint: options?.shell?.breakpoint ?? definitionShell?.breakpoint,
|
|
204
|
+
dismissible: options?.shell?.dismissible ?? definitionShell?.dismissible
|
|
156
205
|
},
|
|
157
206
|
props: {
|
|
158
207
|
...options?.props
|
|
159
208
|
},
|
|
209
|
+
footer: options?.footer ? {
|
|
210
|
+
id: options.footer.id,
|
|
211
|
+
props: {
|
|
212
|
+
...options.footer.props
|
|
213
|
+
}
|
|
214
|
+
} : void 0,
|
|
160
215
|
deferred
|
|
161
216
|
};
|
|
162
217
|
sessions.value.push(session);
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
declare const localeCodeC: z.ZodEnum<{
|
|
3
|
-
zh: "zh";
|
|
4
|
-
ja: "ja";
|
|
5
3
|
en: "en";
|
|
4
|
+
ja: "ja";
|
|
6
5
|
ko: "ko";
|
|
6
|
+
zh: "zh";
|
|
7
7
|
}>;
|
|
8
|
-
export declare const supportedLocales: ("
|
|
8
|
+
export declare const supportedLocales: ("en" | "ja" | "ko" | "zh")[];
|
|
9
9
|
export declare const localeItemC: z.ZodObject<{
|
|
10
10
|
locale: z.ZodEnum<{
|
|
11
|
-
zh: "zh";
|
|
12
|
-
ja: "ja";
|
|
13
11
|
en: "en";
|
|
12
|
+
ja: "ja";
|
|
14
13
|
ko: "ko";
|
|
14
|
+
zh: "zh";
|
|
15
15
|
}>;
|
|
16
16
|
message: z.ZodString;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
export declare const localeC: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
19
19
|
locale: z.ZodEnum<{
|
|
20
|
-
zh: "zh";
|
|
21
|
-
ja: "ja";
|
|
22
20
|
en: "en";
|
|
21
|
+
ja: "ja";
|
|
23
22
|
ko: "ko";
|
|
23
|
+
zh: "zh";
|
|
24
24
|
}>;
|
|
25
25
|
message: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>>;
|