@shwfed/nuxt 0.10.14 → 0.11.0

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 (80) 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 +67 -4
  6. package/dist/runtime/components/button.vue +29 -4
  7. package/dist/runtime/components/button.vue.d.ts +67 -4
  8. package/dist/runtime/components/component-config.d.ts +12 -0
  9. package/dist/runtime/components/component-config.js +22 -0
  10. package/dist/runtime/components/fields.d.vue.ts +9 -5
  11. package/dist/runtime/components/fields.vue +14 -5
  12. package/dist/runtime/components/fields.vue.d.ts +9 -5
  13. package/dist/runtime/components/markdown.d.vue.ts +19 -9
  14. package/dist/runtime/components/markdown.vue +15 -3
  15. package/dist/runtime/components/markdown.vue.d.ts +19 -9
  16. package/dist/runtime/components/menu-tabs.d.vue.ts +14 -4
  17. package/dist/runtime/components/menu-tabs.vue +15 -3
  18. package/dist/runtime/components/menu-tabs.vue.d.ts +14 -4
  19. package/dist/runtime/components/modal.d.vue.ts +3 -1
  20. package/dist/runtime/components/modal.vue +3 -1
  21. package/dist/runtime/components/modal.vue.d.ts +3 -1
  22. package/dist/runtime/components/table.d.vue.ts +8 -3
  23. package/dist/runtime/components/table.vue +28 -2
  24. package/dist/runtime/components/table.vue.d.ts +8 -3
  25. package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
  26. package/dist/runtime/components/ui/app/App.vue +23 -8
  27. package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
  28. package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
  29. package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
  30. package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
  31. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +56 -0
  32. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +12 -4
  33. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +56 -0
  34. package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +62 -5
  35. package/dist/runtime/components/ui/buttons/Buttons.vue +71 -7
  36. package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +62 -5
  37. package/dist/runtime/components/ui/buttons/schema.d.ts +562 -2
  38. package/dist/runtime/components/ui/buttons/schema.js +24 -23
  39. package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +4 -4
  40. package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +4 -4
  41. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +10 -2
  42. package/dist/runtime/components/ui/fields/Fields.vue +12 -3
  43. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +10 -2
  44. package/dist/runtime/components/ui/fields/schema.d.ts +464 -0
  45. package/dist/runtime/components/ui/fields/schema.js +15 -2
  46. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +4 -0
  47. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +10 -4
  48. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +4 -0
  49. package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +18 -8
  50. package/dist/runtime/components/ui/markdown/Markdown.vue +13 -3
  51. package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +18 -8
  52. package/dist/runtime/components/ui/markdown/schema.d.ts +51 -6
  53. package/dist/runtime/components/ui/markdown/schema.js +15 -2
  54. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +16 -7
  55. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue +12 -7
  56. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +16 -7
  57. package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +14 -4
  58. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue +16 -5
  59. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +14 -4
  60. package/dist/runtime/components/ui/menu-tabs/schema.d.ts +42 -5
  61. package/dist/runtime/components/ui/menu-tabs/schema.js +13 -12
  62. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +12 -3
  63. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +9 -5
  64. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +12 -3
  65. package/dist/runtime/components/ui/table/Table.d.vue.ts +6 -2
  66. package/dist/runtime/components/ui/table/Table.vue +18 -2
  67. package/dist/runtime/components/ui/table/Table.vue.d.ts +6 -2
  68. package/dist/runtime/components/ui/table/schema.d.ts +239 -2
  69. package/dist/runtime/components/ui/table/schema.js +15 -6
  70. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +4 -0
  71. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2 -1
  72. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +4 -0
  73. package/dist/runtime/composables/useOverlay.d.ts +86 -0
  74. package/dist/runtime/composables/useOverlay.js +201 -0
  75. package/dist/runtime/layouts/default.d.vue.ts +2 -1
  76. package/dist/runtime/layouts/default.vue.d.ts +2 -1
  77. package/dist/runtime/plugins/overlay/index.d.ts +6 -0
  78. package/dist/runtime/plugins/overlay/index.js +12 -0
  79. package/dist/runtime/plugins/toast/index.d.ts +4 -4
  80. package/package.json +1 -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.14",
4
+ "version": "0.11.0",
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, ButtonBodyC, ButtonBodyInputC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './ui/buttons/schema.js';
4
+ export type { ButtonAction, ButtonBody, ButtonBodyInput, 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,10 +54,25 @@ 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
  }>)[];
47
73
  }>[];
74
+ kind: string;
75
+ compatibilityDate: string;
48
76
  gap?: number | undefined;
49
77
  style?: string | undefined;
50
78
  }>) => any;
@@ -67,6 +95,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
67
95
  icon?: string | undefined;
68
96
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
69
97
  hideTitle?: boolean | undefined;
98
+ modal?: Readonly<{
99
+ title?: readonly {
100
+ locale: "zh" | "ja" | "en" | "ko";
101
+ message: string;
102
+ }[] | undefined;
103
+ description?: readonly {
104
+ locale: "zh" | "ja" | "en" | "ko";
105
+ message: string;
106
+ }[] | undefined;
107
+ showCloseButton?: boolean | undefined;
108
+ breakpoint?: string | undefined;
109
+ dismissible?: boolean | undefined;
110
+ }> | undefined;
70
111
  }> | Readonly<{
71
112
  id: string;
72
113
  title: readonly {
@@ -85,11 +126,33 @@ declare const __VLS_export: import("vue").DefineComponent<{
85
126
  }[] | undefined;
86
127
  icon?: string | undefined;
87
128
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
129
+ modal?: Readonly<{
130
+ title?: readonly {
131
+ locale: "zh" | "ja" | "en" | "ko";
132
+ message: string;
133
+ }[] | undefined;
134
+ description?: readonly {
135
+ locale: "zh" | "ja" | "en" | "ko";
136
+ message: string;
137
+ }[] | undefined;
138
+ showCloseButton?: boolean | undefined;
139
+ breakpoint?: string | undefined;
140
+ dismissible?: boolean | undefined;
141
+ }> | undefined;
88
142
  }>[];
89
143
  icon?: string | undefined;
90
144
  }>)[];
91
145
  }>[];
146
+ kind: string;
147
+ compatibilityDate: string;
92
148
  gap?: number | undefined;
93
149
  style?: string | undefined;
94
150
  }>) => any) | undefined;
95
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
151
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
152
+ [x: string]: ((props: any) => any) | undefined;
153
+ }>;
154
+ type __VLS_WithSlots<T, S> = T & {
155
+ new (): {
156
+ $slots: S;
157
+ };
158
+ };
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { Effect } from "effect";
3
+ import { createButtonConfig } from "./ui/buttons/schema";
3
4
  import UiButtons from "./ui/buttons/Buttons.vue";
4
5
  defineOptions({
5
6
  inheritAttrs: false
@@ -8,10 +9,10 @@ const props = defineProps({
8
9
  config: { type: null, required: false }
9
10
  });
10
11
  const emit = defineEmits(["update:config"]);
11
- const defaultConfig = {
12
+ const defaultConfig = createButtonConfig({
12
13
  gap: 12,
13
14
  groups: []
14
- };
15
+ });
15
16
  function isEffectConfig(value) {
16
17
  return typeof value === "object" && value !== null && "pipe" in value && typeof Reflect.get(value, "pipe") === "function";
17
18
  }
@@ -27,7 +28,21 @@ function handleConfigUpdate(config) {
27
28
  </script>
28
29
 
29
30
  <script>
30
- export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonsStyleC } from "./ui/buttons/schema";
31
+ export {
32
+ ButtonActionC,
33
+ ButtonBodyC,
34
+ ButtonBodyInputC,
35
+ ButtonConfigC,
36
+ ButtonConfigInputC,
37
+ ButtonDropdownC,
38
+ ButtonGroupC,
39
+ ButtonModalC,
40
+ ButtonsStyleC,
41
+ CURRENT_COMPATIBILITY_DATE,
42
+ KIND,
43
+ SUPPORTED_COMPATIBILITY_DATES,
44
+ createButtonConfig
45
+ } from "./ui/buttons/schema";
31
46
  </script>
32
47
 
33
48
  <template>
@@ -35,5 +50,15 @@ export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, Butt
35
50
  v-bind="$attrs"
36
51
  :config="resolveConfig()"
37
52
  @update:config="handleConfigUpdate"
38
- />
53
+ >
54
+ <template
55
+ v-for="(_, slotName) in $slots"
56
+ #[slotName]="slotProps"
57
+ >
58
+ <slot
59
+ :name="slotName"
60
+ v-bind="slotProps ?? {}"
61
+ />
62
+ </template>
63
+ </UiButtons>
39
64
  </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, ButtonBodyC, ButtonBodyInputC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './ui/buttons/schema.js';
4
+ export type { ButtonAction, ButtonBody, ButtonBodyInput, 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,10 +54,25 @@ 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
  }>)[];
47
73
  }>[];
74
+ kind: string;
75
+ compatibilityDate: string;
48
76
  gap?: number | undefined;
49
77
  style?: string | undefined;
50
78
  }>) => any;
@@ -67,6 +95,19 @@ declare const __VLS_export: import("vue").DefineComponent<{
67
95
  icon?: string | undefined;
68
96
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
69
97
  hideTitle?: boolean | undefined;
98
+ modal?: Readonly<{
99
+ title?: readonly {
100
+ locale: "zh" | "ja" | "en" | "ko";
101
+ message: string;
102
+ }[] | undefined;
103
+ description?: readonly {
104
+ locale: "zh" | "ja" | "en" | "ko";
105
+ message: string;
106
+ }[] | undefined;
107
+ showCloseButton?: boolean | undefined;
108
+ breakpoint?: string | undefined;
109
+ dismissible?: boolean | undefined;
110
+ }> | undefined;
70
111
  }> | Readonly<{
71
112
  id: string;
72
113
  title: readonly {
@@ -85,11 +126,33 @@ declare const __VLS_export: import("vue").DefineComponent<{
85
126
  }[] | undefined;
86
127
  icon?: string | undefined;
87
128
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
129
+ modal?: Readonly<{
130
+ title?: readonly {
131
+ locale: "zh" | "ja" | "en" | "ko";
132
+ message: string;
133
+ }[] | undefined;
134
+ description?: readonly {
135
+ locale: "zh" | "ja" | "en" | "ko";
136
+ message: string;
137
+ }[] | undefined;
138
+ showCloseButton?: boolean | undefined;
139
+ breakpoint?: string | undefined;
140
+ dismissible?: boolean | undefined;
141
+ }> | undefined;
88
142
  }>[];
89
143
  icon?: string | undefined;
90
144
  }>)[];
91
145
  }>[];
146
+ kind: string;
147
+ compatibilityDate: string;
92
148
  gap?: number | undefined;
93
149
  style?: string | undefined;
94
150
  }>) => any) | undefined;
95
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
151
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
152
+ [x: string]: ((props: any) => any) | undefined;
153
+ }>;
154
+ type __VLS_WithSlots<T, S> = T & {
155
+ new (): {
156
+ $slots: S;
157
+ };
158
+ };
@@ -0,0 +1,12 @@
1
+ import z from 'zod';
2
+ export declare const CompatibilityDateC: z.ZodString;
3
+ export type ComponentConfigMetadata<Kind extends string> = Readonly<{
4
+ kind: Kind;
5
+ compatibilityDate: string;
6
+ }>;
7
+ export declare function createCompatibilityDateC(supportedCompatibilityDates: ReadonlyArray<string>): z.ZodString;
8
+ export declare function createComponentConfigMetadataShape(kind: string, supportedCompatibilityDates: ReadonlyArray<string>): {
9
+ kind: z.ZodLiteral<string>;
10
+ compatibilityDate: z.ZodString;
11
+ };
12
+ export declare function createComponentConfig<Body extends Record<string, unknown>, Kind extends string>(kind: Kind, compatibilityDate: string, body: Body): Body & ComponentConfigMetadata<Kind>;
@@ -0,0 +1,22 @@
1
+ import z from "zod";
2
+ const COMPATIBILITY_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
3
+ export const CompatibilityDateC = z.string().regex(COMPATIBILITY_DATE_PATTERN, "compatibilityDate must use yyyy-MM-DD format").describe("\u914D\u7F6E\u517C\u5BB9\u534F\u8BAE\u65E5\u671F\uFF0C\u683C\u5F0F\u5FC5\u987B\u4E3A yyyy-MM-DD");
4
+ export function createCompatibilityDateC(supportedCompatibilityDates) {
5
+ return CompatibilityDateC.refine(
6
+ (value) => supportedCompatibilityDates.includes(value),
7
+ `compatibilityDate must be one of: ${supportedCompatibilityDates.join(", ")}`
8
+ );
9
+ }
10
+ export function createComponentConfigMetadataShape(kind, supportedCompatibilityDates) {
11
+ return {
12
+ kind: z.literal(kind).describe("\u7EC4\u4EF6\u914D\u7F6E\u534F\u8BAE\u6807\u8BC6"),
13
+ compatibilityDate: createCompatibilityDateC(supportedCompatibilityDates)
14
+ };
15
+ }
16
+ export function createComponentConfig(kind, compatibilityDate, body) {
17
+ return {
18
+ kind,
19
+ compatibilityDate,
20
+ ...body
21
+ };
22
+ }
@@ -1,11 +1,11 @@
1
1
  import { Effect } from 'effect';
2
- import type { FieldsConfig } from './ui/fields/Fields.vue.js';
3
- export { CalendarFieldC, EmptyFieldC, FieldC, FieldsConfigC, NumberFieldC, SelectFieldC, SlotFieldC, StringFieldC, } from './ui/fields/Fields.vue.js';
4
- export type { EmptyField, Field, FieldsConfig, SlotField } from './ui/fields/Fields.vue.js';
2
+ import { type FieldsConfigInput } from './ui/fields/Fields.vue.js';
3
+ export { CalendarFieldC, EmptyFieldC, FieldC, FieldsBodyC, FieldsBodyInputC, FieldsConfigC, FieldsConfigInputC, NumberFieldC, SelectFieldC, SlotFieldC, StringFieldC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createFieldsConfig, } from './ui/fields/Fields.vue.js';
4
+ export type { EmptyField, Field, FieldsBody, FieldsBodyInput, FieldsConfig, FieldsConfigInput, SlotField, } from './ui/fields/Fields.vue.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
- config?: Effect.Effect<FieldsConfig | undefined>;
8
+ config?: FieldsConfigInput | Effect.Effect<FieldsConfigInput | undefined>;
9
9
  } & {
10
10
  modelValue?: Record<string, unknown>;
11
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -125,12 +125,14 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
125
125
  type: "empty";
126
126
  style?: string | undefined;
127
127
  })[];
128
+ kind: string;
129
+ compatibilityDate: string;
128
130
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
129
131
  style?: string | undefined;
130
132
  }>) => any;
131
133
  "initial-value-ready": () => any;
132
134
  }, string, import("vue").PublicProps, Readonly<{
133
- config?: Effect.Effect<FieldsConfig | undefined>;
135
+ config?: FieldsConfigInput | Effect.Effect<FieldsConfigInput | undefined>;
134
136
  } & {
135
137
  modelValue?: Record<string, unknown>;
136
138
  }> & Readonly<{
@@ -250,6 +252,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
250
252
  type: "empty";
251
253
  style?: string | undefined;
252
254
  })[];
255
+ kind: string;
256
+ compatibilityDate: string;
253
257
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
254
258
  style?: string | undefined;
255
259
  }>) => any) | undefined;
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
2
  import { Effect } from "effect";
3
- import UiFields from "./ui/fields/Fields.vue";
3
+ import UiFields, {
4
+ createFieldsConfig
5
+ } from "./ui/fields/Fields.vue";
4
6
  defineOptions({
5
7
  inheritAttrs: false
6
8
  });
@@ -11,10 +13,10 @@ const emit = defineEmits(["update:config", "initial-value-ready"]);
11
13
  const modelValue = defineModel("modelValue", { type: Object, ...{
12
14
  default: () => ({})
13
15
  } });
14
- const defaultConfig = {
16
+ const defaultConfig = createFieldsConfig({
15
17
  fields: []
16
- };
17
- const config = props.config ? props.config.pipe(Effect.map((config2) => config2 ?? defaultConfig)) : Effect.succeed(defaultConfig);
18
+ });
19
+ const config = !props.config ? Effect.succeed(defaultConfig) : "pipe" in props.config ? props.config.pipe(Effect.map((config2) => config2 ?? defaultConfig)) : Effect.succeed(props.config);
18
20
  function handleConfigUpdate(config2) {
19
21
  emit("update:config", config2);
20
22
  }
@@ -28,11 +30,18 @@ export {
28
30
  CalendarFieldC,
29
31
  EmptyFieldC,
30
32
  FieldC,
33
+ FieldsBodyC,
34
+ FieldsBodyInputC,
31
35
  FieldsConfigC,
36
+ FieldsConfigInputC,
32
37
  NumberFieldC,
33
38
  SelectFieldC,
34
39
  SlotFieldC,
35
- StringFieldC
40
+ StringFieldC,
41
+ CURRENT_COMPATIBILITY_DATE,
42
+ KIND,
43
+ SUPPORTED_COMPATIBILITY_DATES,
44
+ createFieldsConfig
36
45
  } from "./ui/fields/Fields.vue";
37
46
  </script>
38
47
 
@@ -1,11 +1,11 @@
1
1
  import { Effect } from 'effect';
2
- import type { FieldsConfig } from './ui/fields/Fields.vue.js';
3
- export { CalendarFieldC, EmptyFieldC, FieldC, FieldsConfigC, NumberFieldC, SelectFieldC, SlotFieldC, StringFieldC, } from './ui/fields/Fields.vue.js';
4
- export type { EmptyField, Field, FieldsConfig, SlotField } from './ui/fields/Fields.vue.js';
2
+ import { type FieldsConfigInput } from './ui/fields/Fields.vue.js';
3
+ export { CalendarFieldC, EmptyFieldC, FieldC, FieldsBodyC, FieldsBodyInputC, FieldsConfigC, FieldsConfigInputC, NumberFieldC, SelectFieldC, SlotFieldC, StringFieldC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createFieldsConfig, } from './ui/fields/Fields.vue.js';
4
+ export type { EmptyField, Field, FieldsBody, FieldsBodyInput, FieldsConfig, FieldsConfigInput, SlotField, } from './ui/fields/Fields.vue.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
- config?: Effect.Effect<FieldsConfig | undefined>;
8
+ config?: FieldsConfigInput | Effect.Effect<FieldsConfigInput | undefined>;
9
9
  } & {
10
10
  modelValue?: Record<string, unknown>;
11
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -125,12 +125,14 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
125
125
  type: "empty";
126
126
  style?: string | undefined;
127
127
  })[];
128
+ kind: string;
129
+ compatibilityDate: string;
128
130
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
129
131
  style?: string | undefined;
130
132
  }>) => any;
131
133
  "initial-value-ready": () => any;
132
134
  }, string, import("vue").PublicProps, Readonly<{
133
- config?: Effect.Effect<FieldsConfig | undefined>;
135
+ config?: FieldsConfigInput | Effect.Effect<FieldsConfigInput | undefined>;
134
136
  } & {
135
137
  modelValue?: Record<string, unknown>;
136
138
  }> & Readonly<{
@@ -250,6 +252,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
250
252
  type: "empty";
251
253
  style?: string | undefined;
252
254
  })[];
255
+ kind: string;
256
+ compatibilityDate: string;
253
257
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
254
258
  style?: string | undefined;
255
259
  }>) => any) | undefined;
@@ -1,7 +1,7 @@
1
1
  import { Effect } from 'effect';
2
- import type { MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
3
- export { MarkdownConfigC, MarkdownStyleC } from './ui/markdown/Markdown.vue.js';
4
- export type { MarkdownConfig, MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
2
+ import { type MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
3
+ export { CURRENT_COMPATIBILITY_DATE, KIND, MarkdownBodyC, MarkdownBodyInputC, MarkdownConfigC, MarkdownConfigInputC, MarkdownStyleC, SUPPORTED_COMPATIBILITY_DATES, createMarkdownConfig, } from './ui/markdown/Markdown.vue.js';
4
+ export type { MarkdownBody, MarkdownBodyInput, MarkdownConfig, MarkdownConfigInput, } from './ui/markdown/Markdown.vue.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: import("vue").DefineComponent<{
@@ -9,17 +9,27 @@ declare const __VLS_export: import("vue").DefineComponent<{
9
9
  context?: Record<string, unknown>;
10
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  "update:config": (args_0: Readonly<{
12
- locale?: import("../utils/coders.js").LocaleValue;
13
- inline?: boolean;
14
- style?: string;
12
+ kind: string;
13
+ compatibilityDate: string;
14
+ locale?: readonly {
15
+ locale: "zh" | "ja" | "en" | "ko";
16
+ message: string;
17
+ }[] | undefined;
18
+ inline?: boolean | undefined;
19
+ style?: string | undefined;
15
20
  }>) => any;
16
21
  }, string, import("vue").PublicProps, Readonly<{
17
22
  config?: MarkdownConfigInput | Effect.Effect<MarkdownConfigInput | undefined>;
18
23
  context?: Record<string, unknown>;
19
24
  }> & Readonly<{
20
25
  "onUpdate:config"?: ((args_0: Readonly<{
21
- locale?: import("../utils/coders.js").LocaleValue;
22
- inline?: boolean;
23
- style?: string;
26
+ kind: string;
27
+ compatibilityDate: string;
28
+ locale?: readonly {
29
+ locale: "zh" | "ja" | "en" | "ko";
30
+ message: string;
31
+ }[] | undefined;
32
+ inline?: boolean | undefined;
33
+ style?: string | undefined;
24
34
  }>) => any) | undefined;
25
35
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,7 +1,9 @@
1
1
  <script setup>
2
2
  import { Effect } from "effect";
3
3
  import { computed } from "vue";
4
- import UiMarkdown from "./ui/markdown/Markdown.vue";
4
+ import UiMarkdown, {
5
+ createMarkdownConfig
6
+ } from "./ui/markdown/Markdown.vue";
5
7
  defineOptions({
6
8
  inheritAttrs: false
7
9
  });
@@ -10,7 +12,7 @@ const props = defineProps({
10
12
  context: { type: Object, required: false }
11
13
  });
12
14
  const emit = defineEmits(["update:config"]);
13
- const defaultConfig = {};
15
+ const defaultConfig = createMarkdownConfig({});
14
16
  function isMarkdownConfigEffect(value) {
15
17
  return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
16
18
  }
@@ -29,7 +31,17 @@ function handleConfigUpdate(config2) {
29
31
  </script>
30
32
 
31
33
  <script>
32
- export { MarkdownConfigC, MarkdownStyleC } from "./ui/markdown/Markdown.vue";
34
+ export {
35
+ CURRENT_COMPATIBILITY_DATE,
36
+ KIND,
37
+ MarkdownBodyC,
38
+ MarkdownBodyInputC,
39
+ MarkdownConfigC,
40
+ MarkdownConfigInputC,
41
+ MarkdownStyleC,
42
+ SUPPORTED_COMPATIBILITY_DATES,
43
+ createMarkdownConfig
44
+ } from "./ui/markdown/Markdown.vue";
33
45
  </script>
34
46
 
35
47
  <template>
@@ -1,7 +1,7 @@
1
1
  import { Effect } from 'effect';
2
- import type { MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
3
- export { MarkdownConfigC, MarkdownStyleC } from './ui/markdown/Markdown.vue.js';
4
- export type { MarkdownConfig, MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
2
+ import { type MarkdownConfigInput } from './ui/markdown/Markdown.vue.js';
3
+ export { CURRENT_COMPATIBILITY_DATE, KIND, MarkdownBodyC, MarkdownBodyInputC, MarkdownConfigC, MarkdownConfigInputC, MarkdownStyleC, SUPPORTED_COMPATIBILITY_DATES, createMarkdownConfig, } from './ui/markdown/Markdown.vue.js';
4
+ export type { MarkdownBody, MarkdownBodyInput, MarkdownConfig, MarkdownConfigInput, } from './ui/markdown/Markdown.vue.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: import("vue").DefineComponent<{
@@ -9,17 +9,27 @@ declare const __VLS_export: import("vue").DefineComponent<{
9
9
  context?: Record<string, unknown>;
10
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  "update:config": (args_0: Readonly<{
12
- locale?: import("../utils/coders.js").LocaleValue;
13
- inline?: boolean;
14
- style?: string;
12
+ kind: string;
13
+ compatibilityDate: string;
14
+ locale?: readonly {
15
+ locale: "zh" | "ja" | "en" | "ko";
16
+ message: string;
17
+ }[] | undefined;
18
+ inline?: boolean | undefined;
19
+ style?: string | undefined;
15
20
  }>) => any;
16
21
  }, string, import("vue").PublicProps, Readonly<{
17
22
  config?: MarkdownConfigInput | Effect.Effect<MarkdownConfigInput | undefined>;
18
23
  context?: Record<string, unknown>;
19
24
  }> & Readonly<{
20
25
  "onUpdate:config"?: ((args_0: Readonly<{
21
- locale?: import("../utils/coders.js").LocaleValue;
22
- inline?: boolean;
23
- style?: string;
26
+ kind: string;
27
+ compatibilityDate: string;
28
+ locale?: readonly {
29
+ locale: "zh" | "ja" | "en" | "ko";
30
+ message: string;
31
+ }[] | undefined;
32
+ inline?: boolean | undefined;
33
+ style?: string | undefined;
24
34
  }>) => any) | undefined;
25
35
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;