@shwfed/nuxt 0.11.1 → 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.
Files changed (37) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/button.d.vue.ts +18 -18
  3. package/dist/runtime/components/button.vue.d.ts +18 -18
  4. package/dist/runtime/components/fields.d.vue.ts +10 -10
  5. package/dist/runtime/components/fields.vue.d.ts +10 -10
  6. package/dist/runtime/components/markdown.d.vue.ts +2 -2
  7. package/dist/runtime/components/markdown.vue.d.ts +2 -2
  8. package/dist/runtime/components/menu-tabs.d.vue.ts +2 -2
  9. package/dist/runtime/components/menu-tabs.vue.d.ts +2 -2
  10. package/dist/runtime/components/ui/app/OverlayHost.vue +17 -2
  11. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +18 -18
  12. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +18 -18
  13. package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +18 -18
  14. package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +18 -18
  15. package/dist/runtime/components/ui/buttons/schema.d.ts +138 -138
  16. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +20 -20
  17. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +20 -20
  18. package/dist/runtime/components/ui/fields/schema.d.ts +60 -60
  19. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +10 -10
  20. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +10 -10
  21. package/dist/runtime/components/ui/locale/Locale.d.vue.ts +2 -2
  22. package/dist/runtime/components/ui/locale/Locale.vue.d.ts +2 -2
  23. package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +2 -2
  24. package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +2 -2
  25. package/dist/runtime/components/ui/markdown/schema.d.ts +8 -8
  26. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +2 -2
  27. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +2 -2
  28. package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +2 -2
  29. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +2 -2
  30. package/dist/runtime/components/ui/menu-tabs/schema.d.ts +10 -10
  31. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +2 -2
  32. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +2 -2
  33. package/dist/runtime/composables/useOverlay.d.ts +4 -1
  34. package/dist/runtime/composables/useOverlay.js +38 -4
  35. package/dist/runtime/plugins/toast/index.d.ts +2 -2
  36. package/dist/runtime/utils/coders.d.ts +7 -7
  37. package/package.json +1 -1
@@ -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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
28
+ locale: "en" | "ja" | "ko" | "zh";
29
29
  message: string;
30
30
  }[] | undefined;
31
31
  inline?: boolean | undefined;
@@ -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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
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>>>;
@@ -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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
29
+ locale: "en" | "ja" | "ko" | "zh";
30
30
  message: string;
31
31
  }[];
32
32
  to: string;
@@ -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: "zh" | "ja" | "en" | "ko";
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: "zh" | "ja" | "en" | "ko";
29
+ locale: "en" | "ja" | "ko" | "zh";
30
30
  message: string;
31
31
  }[];
32
32
  to: string;
@@ -37,10 +37,13 @@ export type OverlayDefinition = Readonly<{
37
37
  render: OverlayBodyRender;
38
38
  shell?: OverlayShellProps;
39
39
  }>;
40
+ type OverlayShellState = OverlayShellProps & {
41
+ descriptionSrOnly?: boolean;
42
+ };
40
43
  type OverlaySession = {
41
44
  sessionId: string;
42
45
  definitionId: string;
43
- shell: OverlayShellProps;
46
+ shell: OverlayShellState;
44
47
  props: Record<string, unknown>;
45
48
  deferred: Deferred.Deferred<OverlayResult, never>;
46
49
  };
@@ -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) {
@@ -146,13 +163,30 @@ function createOverlayRuntime() {
146
163
  if (!definition) {
147
164
  return yield* Effect.fail(createDefinitionNotFoundError(definitionId));
148
165
  }
166
+ const buttonActionOption = yield* Effect.serviceOption(ButtonActionService);
167
+ const buttonAction = Option.match(buttonActionOption, {
168
+ onNone: () => void 0,
169
+ onSome: (action) => action
170
+ });
171
+ const definitionShell = definition.shell;
172
+ const explicitTitle = hasVisibleText(options?.shell?.title) ? options.shell.title : void 0;
173
+ const buttonTitle = hasVisibleText(buttonAction?.title) ? buttonAction.title : void 0;
174
+ const definitionTitle = hasVisibleText(definitionShell?.title) ? definitionShell.title : void 0;
175
+ const explicitDescription = hasVisibleText(options?.shell?.description) ? options.shell.description : void 0;
176
+ const buttonDescription = hasVisibleText(buttonAction?.tooltip) ? buttonAction.tooltip : void 0;
177
+ const definitionDescription = hasVisibleText(definitionShell?.description) ? definitionShell.description : void 0;
178
+ const descriptionSrOnly = explicitDescription === void 0 && buttonDescription === void 0 && definitionDescription === void 0;
149
179
  const deferred = yield* Deferred.make();
150
180
  const session = {
151
181
  sessionId: crypto.randomUUID(),
152
182
  definitionId,
153
183
  shell: {
154
- ...definition.shell,
155
- ...options?.shell
184
+ title: explicitTitle ?? buttonTitle ?? definitionTitle,
185
+ description: explicitDescription ?? buttonDescription ?? definitionDescription ?? getDefaultOverlayDescription(buttonAction?.locale ?? "zh"),
186
+ descriptionSrOnly,
187
+ showCloseButton: options?.shell?.showCloseButton ?? definitionShell?.showCloseButton,
188
+ breakpoint: options?.shell?.breakpoint ?? definitionShell?.breakpoint,
189
+ dismissible: options?.shell?.dismissible ?? definitionShell?.dismissible
156
190
  },
157
191
  props: {
158
192
  ...options?.props
@@ -10,7 +10,6 @@ declare const _default: import("#app").Plugin<{
10
10
  id?: number | string | undefined;
11
11
  icon?: import("vue").Component | undefined;
12
12
  dismissible?: boolean | undefined;
13
- duration?: number | undefined;
14
13
  class?: string | undefined;
15
14
  style?: import("vue").CSSProperties | undefined;
16
15
  cancel?: (import("vue-sonner").Action | import("vue").Component) | undefined;
@@ -20,6 +19,7 @@ declare const _default: import("#app").Plugin<{
20
19
  richColors?: boolean | undefined;
21
20
  invert?: boolean | undefined;
22
21
  closeButton?: boolean | undefined;
22
+ duration?: number | undefined;
23
23
  important?: boolean | undefined;
24
24
  action?: (import("vue-sonner").Action | import("vue").Component) | undefined;
25
25
  onDismiss?: ((toast: import("vue-sonner").ToastT) => void) | undefined;
@@ -63,7 +63,6 @@ declare const _default: import("#app").Plugin<{
63
63
  id?: number | string | undefined;
64
64
  icon?: import("vue").Component | undefined;
65
65
  dismissible?: boolean | undefined;
66
- duration?: number | undefined;
67
66
  class?: string | undefined;
68
67
  style?: import("vue").CSSProperties | undefined;
69
68
  cancel?: (import("vue-sonner").Action | import("vue").Component) | undefined;
@@ -73,6 +72,7 @@ declare const _default: import("#app").Plugin<{
73
72
  richColors?: boolean | undefined;
74
73
  invert?: boolean | undefined;
75
74
  closeButton?: boolean | undefined;
75
+ duration?: number | undefined;
76
76
  important?: boolean | undefined;
77
77
  action?: (import("vue-sonner").Action | import("vue").Component) | undefined;
78
78
  onDismiss?: ((toast: import("vue-sonner").ToastT) => void) | undefined;
@@ -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: ("zh" | "ja" | "en" | "ko")[];
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>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",