@shwfed/nuxt 0.10.15 → 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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/button.d.vue.ts +6 -2
- package/dist/runtime/components/button.vue +18 -3
- package/dist/runtime/components/button.vue.d.ts +6 -2
- package/dist/runtime/components/component-config.d.ts +12 -0
- package/dist/runtime/components/component-config.js +22 -0
- package/dist/runtime/components/fields.d.vue.ts +9 -5
- package/dist/runtime/components/fields.vue +14 -5
- package/dist/runtime/components/fields.vue.d.ts +9 -5
- package/dist/runtime/components/markdown.d.vue.ts +19 -9
- package/dist/runtime/components/markdown.vue +15 -3
- package/dist/runtime/components/markdown.vue.d.ts +19 -9
- package/dist/runtime/components/menu-tabs.d.vue.ts +14 -4
- package/dist/runtime/components/menu-tabs.vue +15 -3
- package/dist/runtime/components/menu-tabs.vue.d.ts +14 -4
- package/dist/runtime/components/table.d.vue.ts +8 -3
- package/dist/runtime/components/table.vue +28 -2
- package/dist/runtime/components/table.vue.d.ts +8 -3
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +4 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +12 -4
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +4 -0
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +9 -4
- package/dist/runtime/components/ui/buttons/Buttons.vue +15 -4
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +9 -4
- package/dist/runtime/components/ui/buttons/schema.d.ts +255 -2
- package/dist/runtime/components/ui/buttons/schema.js +13 -21
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +10 -2
- package/dist/runtime/components/ui/fields/Fields.vue +12 -3
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +10 -2
- package/dist/runtime/components/ui/fields/schema.d.ts +464 -0
- package/dist/runtime/components/ui/fields/schema.js +15 -2
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +4 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +10 -4
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +4 -0
- package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +18 -8
- package/dist/runtime/components/ui/markdown/Markdown.vue +13 -3
- package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +18 -8
- package/dist/runtime/components/ui/markdown/schema.d.ts +51 -6
- package/dist/runtime/components/ui/markdown/schema.js +15 -2
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +16 -7
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue +12 -7
- package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +16 -7
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +14 -4
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue +16 -5
- package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +14 -4
- package/dist/runtime/components/ui/menu-tabs/schema.d.ts +42 -5
- package/dist/runtime/components/ui/menu-tabs/schema.js +13 -12
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +12 -3
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +9 -5
- package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +12 -3
- package/dist/runtime/components/ui/table/Table.d.vue.ts +6 -2
- package/dist/runtime/components/ui/table/Table.vue +18 -2
- package/dist/runtime/components/ui/table/Table.vue.d.ts +6 -2
- package/dist/runtime/components/ui/table/schema.d.ts +239 -2
- package/dist/runtime/components/ui/table/schema.js +15 -6
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +4 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2 -1
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +4 -0
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { type MarkdownConfigInput } from './schema.js';
|
|
3
|
-
export { MarkdownConfigC, MarkdownStyleC } from './schema.js';
|
|
4
|
-
export type { MarkdownConfig, MarkdownConfigInput } from './schema.js';
|
|
3
|
+
export { CURRENT_COMPATIBILITY_DATE, KIND, MarkdownBodyC, MarkdownBodyInputC, MarkdownConfigC, MarkdownConfigInputC, MarkdownStyleC, SUPPORTED_COMPATIBILITY_DATES, createMarkdownConfig, } from './schema.js';
|
|
4
|
+
export type { MarkdownBody, MarkdownBodyInput, MarkdownConfig, MarkdownConfigInput, } from './schema.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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: Effect.Effect<MarkdownConfigInput | undefined>;
|
|
18
23
|
context?: Record<string, unknown>;
|
|
19
24
|
}> & Readonly<{
|
|
20
25
|
"onUpdate:config"?: ((args_0: Readonly<{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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>;
|
|
@@ -10,8 +10,8 @@ import { getLocalizedText } from "../../../utils/coders";
|
|
|
10
10
|
import { Button } from "../button";
|
|
11
11
|
import { Skeleton } from "../skeleton";
|
|
12
12
|
import MarkdownConfiguratorDialog from "../markdown-configurator/MarkdownConfiguratorDialog.vue";
|
|
13
|
-
import { MarkdownConfigC } from "./schema";
|
|
14
|
-
const defaultConfig = {};
|
|
13
|
+
import { MarkdownConfigC, createMarkdownConfig } from "./schema";
|
|
14
|
+
const defaultConfig = createMarkdownConfig({});
|
|
15
15
|
const props = defineProps({
|
|
16
16
|
config: { type: null, required: true },
|
|
17
17
|
context: { type: Object, required: false }
|
|
@@ -68,7 +68,17 @@ watch(resolvedConfig, (value) => {
|
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
70
|
<script>
|
|
71
|
-
export {
|
|
71
|
+
export {
|
|
72
|
+
CURRENT_COMPATIBILITY_DATE,
|
|
73
|
+
KIND,
|
|
74
|
+
MarkdownBodyC,
|
|
75
|
+
MarkdownBodyInputC,
|
|
76
|
+
MarkdownConfigC,
|
|
77
|
+
MarkdownConfigInputC,
|
|
78
|
+
MarkdownStyleC,
|
|
79
|
+
SUPPORTED_COMPATIBILITY_DATES,
|
|
80
|
+
createMarkdownConfig
|
|
81
|
+
} from "./schema";
|
|
72
82
|
</script>
|
|
73
83
|
|
|
74
84
|
<template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { type MarkdownConfigInput } from './schema.js';
|
|
3
|
-
export { MarkdownConfigC, MarkdownStyleC } from './schema.js';
|
|
4
|
-
export type { MarkdownConfig, MarkdownConfigInput } from './schema.js';
|
|
3
|
+
export { CURRENT_COMPATIBILITY_DATE, KIND, MarkdownBodyC, MarkdownBodyInputC, MarkdownConfigC, MarkdownConfigInputC, MarkdownStyleC, SUPPORTED_COMPATIBILITY_DATES, createMarkdownConfig, } from './schema.js';
|
|
4
|
+
export type { MarkdownBody, MarkdownBodyInput, MarkdownConfig, MarkdownConfigInput, } from './schema.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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: Effect.Effect<MarkdownConfigInput | undefined>;
|
|
18
23
|
context?: Record<string, unknown>;
|
|
19
24
|
}> & Readonly<{
|
|
20
25
|
"onUpdate:config"?: ((args_0: Readonly<{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,6 +1,35 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import type { LocaleValue } from '../../../utils/coders.js';
|
|
3
|
+
export declare const KIND = "shwfed.component.markdown";
|
|
4
|
+
export declare const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
5
|
+
export declare const SUPPORTED_COMPATIBILITY_DATES: string[];
|
|
3
6
|
export declare const MarkdownStyleC: z.ZodOptional<z.ZodString>;
|
|
7
|
+
export declare const MarkdownBodyC: z.ZodReadonly<z.ZodObject<{
|
|
8
|
+
locale: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
9
|
+
locale: z.ZodEnum<{
|
|
10
|
+
zh: "zh";
|
|
11
|
+
ja: "ja";
|
|
12
|
+
en: "en";
|
|
13
|
+
ko: "ko";
|
|
14
|
+
}>;
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>>>;
|
|
17
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
style: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>>;
|
|
20
|
+
export declare const MarkdownBodyInputC: z.ZodReadonly<z.ZodObject<{
|
|
21
|
+
locale: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
22
|
+
locale: z.ZodEnum<{
|
|
23
|
+
zh: "zh";
|
|
24
|
+
ja: "ja";
|
|
25
|
+
en: "en";
|
|
26
|
+
ko: "ko";
|
|
27
|
+
}>;
|
|
28
|
+
message: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>>>;
|
|
30
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
style: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>>;
|
|
4
33
|
export declare const MarkdownConfigC: z.ZodReadonly<z.ZodObject<{
|
|
5
34
|
locale: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
6
35
|
locale: z.ZodEnum<{
|
|
@@ -13,14 +42,30 @@ export declare const MarkdownConfigC: z.ZodReadonly<z.ZodObject<{
|
|
|
13
42
|
}, z.core.$strip>>>>;
|
|
14
43
|
inline: z.ZodOptional<z.ZodBoolean>;
|
|
15
44
|
style: z.ZodOptional<z.ZodString>;
|
|
45
|
+
kind: z.ZodLiteral<string>;
|
|
46
|
+
compatibilityDate: z.ZodString;
|
|
16
47
|
}, z.core.$strict>>;
|
|
17
|
-
export
|
|
18
|
-
locale
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
48
|
+
export declare const MarkdownConfigInputC: z.ZodReadonly<z.ZodObject<{
|
|
49
|
+
locale: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
50
|
+
locale: z.ZodEnum<{
|
|
51
|
+
zh: "zh";
|
|
52
|
+
ja: "ja";
|
|
53
|
+
en: "en";
|
|
54
|
+
ko: "ko";
|
|
55
|
+
}>;
|
|
56
|
+
message: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>>>;
|
|
58
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
style: z.ZodOptional<z.ZodString>;
|
|
60
|
+
kind: z.ZodLiteral<string>;
|
|
61
|
+
compatibilityDate: z.ZodString;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
export type MarkdownBody = Readonly<{
|
|
23
64
|
locale?: LocaleValue;
|
|
24
65
|
inline?: boolean;
|
|
25
66
|
style?: string;
|
|
26
67
|
}>;
|
|
68
|
+
export type MarkdownBodyInput = z.input<typeof MarkdownBodyInputC>;
|
|
69
|
+
export type MarkdownConfig = z.infer<typeof MarkdownConfigC>;
|
|
70
|
+
export type MarkdownConfigInput = z.input<typeof MarkdownConfigInputC>;
|
|
71
|
+
export declare function createMarkdownConfig(body: MarkdownBody): MarkdownConfig;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
+
import { createComponentConfig, createComponentConfigMetadataShape } from "../../component-config.js";
|
|
2
3
|
import { localeC } from "../../../utils/coders.js";
|
|
4
|
+
export const KIND = "shwfed.component.markdown";
|
|
5
|
+
export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
6
|
+
export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
|
|
3
7
|
export const MarkdownStyleC = z.string().optional().describe("\u8FD4\u56DE Markdown \u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u76F4\u63A5\u8BBF\u95EE\u5F53\u524D\u6E32\u67D3\u4E0A\u4E0B\u6587\u53D8\u91CF\u3002");
|
|
4
|
-
|
|
8
|
+
const MarkdownBodyObjectC = z.object({
|
|
5
9
|
locale: localeC.optional().describe("Markdown \u5185\u5BB9\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u6E32\u67D3\u4E0E {{ expression }} \u8BED\u6CD5\u3002"),
|
|
6
10
|
inline: z.boolean().optional().describe("\u4E3A true \u65F6\u4EE5\u5185\u8054\u6A21\u5F0F\u6E32\u67D3\uFF1B\u7559\u7A7A\u6216 false \u65F6\u6309\u5757\u7EA7\u6A21\u5F0F\u6E32\u67D3\u3002"),
|
|
7
11
|
style: MarkdownStyleC
|
|
8
|
-
}).strict()
|
|
12
|
+
}).strict();
|
|
13
|
+
export const MarkdownBodyC = MarkdownBodyObjectC.readonly();
|
|
14
|
+
export const MarkdownBodyInputC = MarkdownBodyC;
|
|
15
|
+
export const MarkdownConfigC = MarkdownBodyObjectC.extend(
|
|
16
|
+
createComponentConfigMetadataShape(KIND, SUPPORTED_COMPATIBILITY_DATES)
|
|
17
|
+
).readonly();
|
|
18
|
+
export const MarkdownConfigInputC = MarkdownConfigC;
|
|
19
|
+
export function createMarkdownConfig(body) {
|
|
20
|
+
return createComponentConfig(KIND, CURRENT_COMPATIBILITY_DATE, body);
|
|
21
|
+
}
|
package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type LocaleValue } from '../../../utils/coders.js';
|
|
2
1
|
import { type MarkdownConfig } from '../markdown/schema.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
3
|
config: MarkdownConfig;
|
|
@@ -11,16 +10,26 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
11
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
11
|
"update:open": (value: boolean) => any;
|
|
13
12
|
confirm: (args_0: Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
kind: string;
|
|
14
|
+
compatibilityDate: string;
|
|
15
|
+
locale?: readonly {
|
|
16
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
17
|
+
message: string;
|
|
18
|
+
}[] | undefined;
|
|
19
|
+
inline?: boolean | undefined;
|
|
20
|
+
style?: string | undefined;
|
|
17
21
|
}>) => any;
|
|
18
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
23
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
24
|
onConfirm?: ((args_0: Readonly<{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
kind: string;
|
|
26
|
+
compatibilityDate: string;
|
|
27
|
+
locale?: readonly {
|
|
28
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
29
|
+
message: string;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
inline?: boolean | undefined;
|
|
32
|
+
style?: string | undefined;
|
|
24
33
|
}>) => any) | undefined;
|
|
25
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
35
|
declare const _default: typeof __VLS_export;
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
import Locale from "../locale/Locale.vue";
|
|
18
18
|
import { Switch } from "../switch";
|
|
19
19
|
import { Textarea } from "../textarea";
|
|
20
|
-
import { MarkdownConfigC } from "../markdown/schema";
|
|
20
|
+
import { MarkdownBodyC, MarkdownConfigC } from "../markdown/schema";
|
|
21
21
|
const MARKDOWN_EXPRESSION_EXAMPLE = "{{ expression }}";
|
|
22
22
|
const STYLE_EXAMPLE = '{"display": "grid", "gap": "8px"}';
|
|
23
23
|
const props = defineProps({
|
|
24
|
-
config: { type:
|
|
24
|
+
config: { type: null, required: true },
|
|
25
25
|
context: { type: Object, required: false }
|
|
26
26
|
});
|
|
27
27
|
const emit = defineEmits(["confirm"]);
|
|
@@ -103,18 +103,23 @@ function buildDraftConfig() {
|
|
|
103
103
|
if (!validateStyle(normalizedStyle)) {
|
|
104
104
|
return void 0;
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const nextBody = {};
|
|
107
107
|
const localeValue = normalizeLocale(draftLocale.value);
|
|
108
108
|
if (localeValue) {
|
|
109
|
-
|
|
109
|
+
nextBody.locale = localeValue;
|
|
110
110
|
}
|
|
111
111
|
if (draftInline.value) {
|
|
112
|
-
|
|
112
|
+
nextBody.inline = true;
|
|
113
113
|
}
|
|
114
114
|
if (normalizedStyle) {
|
|
115
|
-
|
|
115
|
+
nextBody.style = normalizedStyle;
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
const body = MarkdownBodyC.parse(nextBody);
|
|
118
|
+
return MarkdownConfigC.parse({
|
|
119
|
+
...body,
|
|
120
|
+
kind: props.config.kind,
|
|
121
|
+
compatibilityDate: props.config.compatibilityDate
|
|
122
|
+
});
|
|
118
123
|
}
|
|
119
124
|
function getValidDraftConfig(errorMessage) {
|
|
120
125
|
const config = buildDraftConfig();
|
package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type LocaleValue } from '../../../utils/coders.js';
|
|
2
1
|
import { type MarkdownConfig } from '../markdown/schema.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
3
|
config: MarkdownConfig;
|
|
@@ -11,16 +10,26 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
11
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
11
|
"update:open": (value: boolean) => any;
|
|
13
12
|
confirm: (args_0: Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
kind: string;
|
|
14
|
+
compatibilityDate: string;
|
|
15
|
+
locale?: readonly {
|
|
16
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
17
|
+
message: string;
|
|
18
|
+
}[] | undefined;
|
|
19
|
+
inline?: boolean | undefined;
|
|
20
|
+
style?: string | undefined;
|
|
17
21
|
}>) => any;
|
|
18
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
23
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
24
|
onConfirm?: ((args_0: Readonly<{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
kind: string;
|
|
26
|
+
compatibilityDate: string;
|
|
27
|
+
locale?: readonly {
|
|
28
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
29
|
+
message: string;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
inline?: boolean | undefined;
|
|
32
|
+
style?: string | undefined;
|
|
24
33
|
}>) => any) | undefined;
|
|
25
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
35
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { type MenuTabsConfigInput } from './schema.js';
|
|
3
|
-
export { MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC } from './schema.js';
|
|
4
|
-
export type { MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem } from './schema.js';
|
|
3
|
+
export { CURRENT_COMPATIBILITY_DATE, KIND, MenuTabsBodyC, MenuTabsBodyInputC, MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC, SUPPORTED_COMPATIBILITY_DATES, createMenuTabsConfig, } from './schema.js';
|
|
4
|
+
export type { MenuTabsBody, MenuTabsBodyInput, MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem, } from './schema.js';
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
@@ -11,9 +11,14 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
11
11
|
"update:config": (args_0: Readonly<{
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
|
-
title:
|
|
14
|
+
title: readonly {
|
|
15
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
15
18
|
to: string;
|
|
16
19
|
}>[];
|
|
20
|
+
kind: string;
|
|
21
|
+
compatibilityDate: string;
|
|
17
22
|
}>) => any;
|
|
18
23
|
}, string, import("vue").PublicProps, Readonly<{
|
|
19
24
|
config: Effect.Effect<MenuTabsConfigInput | undefined>;
|
|
@@ -22,8 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
22
27
|
"onUpdate:config"?: ((args_0: Readonly<{
|
|
23
28
|
menus: readonly Readonly<{
|
|
24
29
|
id: string;
|
|
25
|
-
title:
|
|
30
|
+
title: readonly {
|
|
31
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
32
|
+
message: string;
|
|
33
|
+
}[];
|
|
26
34
|
to: string;
|
|
27
35
|
}>[];
|
|
36
|
+
kind: string;
|
|
37
|
+
compatibilityDate: string;
|
|
28
38
|
}>) => any) | undefined;
|
|
29
39
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -10,13 +10,13 @@ import { getLocalizedText } from "../../../utils/coders";
|
|
|
10
10
|
import { Button } from "../button";
|
|
11
11
|
import MenuTabsConfiguratorDialog from "../menu-tabs-configurator/MenuTabsConfiguratorDialog.vue";
|
|
12
12
|
import { Skeleton } from "../skeleton";
|
|
13
|
-
import { MenuTabsConfigC,
|
|
13
|
+
import { MenuTabsConfigC, createMenuTabsConfig } from "./schema";
|
|
14
14
|
defineOptions({
|
|
15
15
|
inheritAttrs: false
|
|
16
16
|
});
|
|
17
|
-
const defaultConfig = {
|
|
17
|
+
const defaultConfig = createMenuTabsConfig({
|
|
18
18
|
menus: []
|
|
19
|
-
};
|
|
19
|
+
});
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
config: { type: null, required: true },
|
|
22
22
|
context: { type: Object, required: false }
|
|
@@ -28,7 +28,7 @@ const router = useRouter();
|
|
|
28
28
|
const { locale, t } = useI18n();
|
|
29
29
|
const isCheating = useCheating();
|
|
30
30
|
const resolvedConfig = computedAsync(
|
|
31
|
-
async () => MenuTabsConfigC.parse(
|
|
31
|
+
async () => MenuTabsConfigC.parse(await props.config.pipe(Effect.runPromise) ?? defaultConfig)
|
|
32
32
|
);
|
|
33
33
|
const displayConfig = ref(defaultConfig);
|
|
34
34
|
const isConfiguratorOpen = ref(false);
|
|
@@ -181,7 +181,18 @@ onUnmounted(() => {
|
|
|
181
181
|
</script>
|
|
182
182
|
|
|
183
183
|
<script>
|
|
184
|
-
export {
|
|
184
|
+
export {
|
|
185
|
+
CURRENT_COMPATIBILITY_DATE,
|
|
186
|
+
KIND,
|
|
187
|
+
MenuTabsBodyC,
|
|
188
|
+
MenuTabsBodyInputC,
|
|
189
|
+
MenuTabsConfigC,
|
|
190
|
+
MenuTabsConfigInputC,
|
|
191
|
+
MenuTabsItemC,
|
|
192
|
+
MenuTabsItemToC,
|
|
193
|
+
SUPPORTED_COMPATIBILITY_DATES,
|
|
194
|
+
createMenuTabsConfig
|
|
195
|
+
} from "./schema";
|
|
185
196
|
</script>
|
|
186
197
|
|
|
187
198
|
<template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { type MenuTabsConfigInput } from './schema.js';
|
|
3
|
-
export { MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC } from './schema.js';
|
|
4
|
-
export type { MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem } from './schema.js';
|
|
3
|
+
export { CURRENT_COMPATIBILITY_DATE, KIND, MenuTabsBodyC, MenuTabsBodyInputC, MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC, SUPPORTED_COMPATIBILITY_DATES, createMenuTabsConfig, } from './schema.js';
|
|
4
|
+
export type { MenuTabsBody, MenuTabsBodyInput, MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem, } from './schema.js';
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
@@ -11,9 +11,14 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
11
11
|
"update:config": (args_0: Readonly<{
|
|
12
12
|
menus: readonly Readonly<{
|
|
13
13
|
id: string;
|
|
14
|
-
title:
|
|
14
|
+
title: readonly {
|
|
15
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
15
18
|
to: string;
|
|
16
19
|
}>[];
|
|
20
|
+
kind: string;
|
|
21
|
+
compatibilityDate: string;
|
|
17
22
|
}>) => any;
|
|
18
23
|
}, string, import("vue").PublicProps, Readonly<{
|
|
19
24
|
config: Effect.Effect<MenuTabsConfigInput | undefined>;
|
|
@@ -22,8 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
22
27
|
"onUpdate:config"?: ((args_0: Readonly<{
|
|
23
28
|
menus: readonly Readonly<{
|
|
24
29
|
id: string;
|
|
25
|
-
title:
|
|
30
|
+
title: readonly {
|
|
31
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
32
|
+
message: string;
|
|
33
|
+
}[];
|
|
26
34
|
to: string;
|
|
27
35
|
}>[];
|
|
36
|
+
kind: string;
|
|
37
|
+
compatibilityDate: string;
|
|
28
38
|
}>) => any) | undefined;
|
|
29
39
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import type { LocaleValue } from '../../../utils/coders.js';
|
|
3
|
+
export declare const KIND = "shwfed.component.menu-tabs";
|
|
4
|
+
export declare const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
5
|
+
export declare const SUPPORTED_COMPATIBILITY_DATES: string[];
|
|
3
6
|
export declare const MenuTabsItemToC: z.ZodString;
|
|
4
7
|
export declare const MenuTabsItemC: z.ZodReadonly<z.ZodObject<{
|
|
5
8
|
id: z.ZodUUID;
|
|
@@ -14,6 +17,36 @@ export declare const MenuTabsItemC: z.ZodReadonly<z.ZodObject<{
|
|
|
14
17
|
}, z.core.$strip>>>;
|
|
15
18
|
to: z.ZodString;
|
|
16
19
|
}, z.core.$strict>>;
|
|
20
|
+
export declare const MenuTabsBodyC: z.ZodReadonly<z.ZodObject<{
|
|
21
|
+
menus: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
22
|
+
id: z.ZodUUID;
|
|
23
|
+
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
24
|
+
locale: z.ZodEnum<{
|
|
25
|
+
zh: "zh";
|
|
26
|
+
ja: "ja";
|
|
27
|
+
en: "en";
|
|
28
|
+
ko: "ko";
|
|
29
|
+
}>;
|
|
30
|
+
message: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
to: z.ZodString;
|
|
33
|
+
}, z.core.$strict>>>>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
export declare const MenuTabsBodyInputC: z.ZodReadonly<z.ZodObject<{
|
|
36
|
+
menus: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
37
|
+
id: z.ZodUUID;
|
|
38
|
+
title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
39
|
+
locale: z.ZodEnum<{
|
|
40
|
+
zh: "zh";
|
|
41
|
+
ja: "ja";
|
|
42
|
+
en: "en";
|
|
43
|
+
ko: "ko";
|
|
44
|
+
}>;
|
|
45
|
+
message: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
to: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>>>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
17
50
|
export declare const MenuTabsConfigC: z.ZodReadonly<z.ZodObject<{
|
|
18
51
|
menus: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
19
52
|
id: z.ZodUUID;
|
|
@@ -28,6 +61,8 @@ export declare const MenuTabsConfigC: z.ZodReadonly<z.ZodObject<{
|
|
|
28
61
|
}, z.core.$strip>>>;
|
|
29
62
|
to: z.ZodString;
|
|
30
63
|
}, z.core.$strict>>>>;
|
|
64
|
+
kind: z.ZodLiteral<string>;
|
|
65
|
+
compatibilityDate: z.ZodString;
|
|
31
66
|
}, z.core.$strict>>;
|
|
32
67
|
export declare const MenuTabsConfigInputC: z.ZodReadonly<z.ZodObject<{
|
|
33
68
|
menus: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
@@ -43,16 +78,18 @@ export declare const MenuTabsConfigInputC: z.ZodReadonly<z.ZodObject<{
|
|
|
43
78
|
}, z.core.$strip>>>;
|
|
44
79
|
to: z.ZodString;
|
|
45
80
|
}, z.core.$strict>>>>;
|
|
81
|
+
kind: z.ZodLiteral<string>;
|
|
82
|
+
compatibilityDate: z.ZodString;
|
|
46
83
|
}, z.core.$strict>>;
|
|
47
84
|
export type MenuTabsItem = Readonly<{
|
|
48
85
|
id: string;
|
|
49
86
|
title: LocaleValue;
|
|
50
87
|
to: string;
|
|
51
88
|
}>;
|
|
52
|
-
export type
|
|
89
|
+
export type MenuTabsBody = Readonly<{
|
|
53
90
|
menus: ReadonlyArray<MenuTabsItem>;
|
|
54
91
|
}>;
|
|
55
|
-
export type
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare function
|
|
92
|
+
export type MenuTabsBodyInput = z.input<typeof MenuTabsBodyInputC>;
|
|
93
|
+
export type MenuTabsConfig = z.infer<typeof MenuTabsConfigC>;
|
|
94
|
+
export type MenuTabsConfigInput = z.input<typeof MenuTabsConfigInputC>;
|
|
95
|
+
export declare function createMenuTabsConfig(body: MenuTabsBody): MenuTabsConfig;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
+
import { createComponentConfig, createComponentConfigMetadataShape } from "../../component-config.js";
|
|
2
3
|
import { expressionC, localeC } from "../../../utils/coders.js";
|
|
3
4
|
const menuTabsItemIdC = z.uuid().describe("\u83DC\u5355\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u5FC5\u987B\u662F UUID");
|
|
5
|
+
export const KIND = "shwfed.component.menu-tabs";
|
|
6
|
+
export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
7
|
+
export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
|
|
4
8
|
export const MenuTabsItemToC = expressionC("string", { context: "dyn" }).describe("\u8FD4\u56DE\u76EE\u6807\u8DEF\u5F84\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u53EF\u7528\u53D8\u91CF\uFF1Acontext\u3002\u5FC5\u987B\u8FD4\u56DE string\u3002");
|
|
5
9
|
export const MenuTabsItemC = z.strictObject({
|
|
6
10
|
id: menuTabsItemIdC,
|
|
7
11
|
title: localeC.describe("\u83DC\u5355\u540D\u79F0\u7684\u672C\u5730\u5316\u663E\u793A\u6587\u672C"),
|
|
8
12
|
to: MenuTabsItemToC
|
|
9
13
|
}).readonly();
|
|
10
|
-
|
|
14
|
+
const MenuTabsBodyObjectC = z.strictObject({
|
|
11
15
|
menus: z.array(MenuTabsItemC).readonly().describe("\u9876\u90E8\u83DC\u5355\u5217\u8868")
|
|
12
|
-
})
|
|
16
|
+
});
|
|
17
|
+
export const MenuTabsBodyC = MenuTabsBodyObjectC.readonly();
|
|
18
|
+
export const MenuTabsBodyInputC = MenuTabsBodyC;
|
|
19
|
+
export const MenuTabsConfigC = MenuTabsBodyObjectC.extend(
|
|
20
|
+
createComponentConfigMetadataShape(KIND, SUPPORTED_COMPATIBILITY_DATES)
|
|
21
|
+
).readonly();
|
|
13
22
|
export const MenuTabsConfigInputC = MenuTabsConfigC;
|
|
14
|
-
export function
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
menus: []
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const menus = Reflect.get(value, "menus");
|
|
21
|
-
return {
|
|
22
|
-
menus: Array.isArray(menus) ? menus : []
|
|
23
|
-
};
|
|
23
|
+
export function createMenuTabsConfig(body) {
|
|
24
|
+
return createComponentConfig(KIND, CURRENT_COMPATIBILITY_DATE, body);
|
|
24
25
|
}
|
package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { LocaleValue } from '../../../utils/coders.js';
|
|
2
1
|
import { type MenuTabsConfig } from '../menu-tabs/schema.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
3
|
config: MenuTabsConfig;
|
|
@@ -12,18 +11,28 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
11
|
confirm: (args_0: Readonly<{
|
|
13
12
|
menus: readonly Readonly<{
|
|
14
13
|
id: string;
|
|
15
|
-
title:
|
|
14
|
+
title: readonly {
|
|
15
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
16
18
|
to: string;
|
|
17
19
|
}>[];
|
|
20
|
+
kind: string;
|
|
21
|
+
compatibilityDate: string;
|
|
18
22
|
}>) => any;
|
|
19
23
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
24
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
21
25
|
onConfirm?: ((args_0: Readonly<{
|
|
22
26
|
menus: readonly Readonly<{
|
|
23
27
|
id: string;
|
|
24
|
-
title:
|
|
28
|
+
title: readonly {
|
|
29
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
30
|
+
message: string;
|
|
31
|
+
}[];
|
|
25
32
|
to: string;
|
|
26
33
|
}>[];
|
|
34
|
+
kind: string;
|
|
35
|
+
compatibilityDate: string;
|
|
27
36
|
}>) => any) | undefined;
|
|
28
37
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
38
|
declare const _default: typeof __VLS_export;
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
import { ExpressionEditor } from "../expression-editor";
|
|
17
17
|
import { Input } from "../input";
|
|
18
18
|
import Locale from "../locale/Locale.vue";
|
|
19
|
-
import { MenuTabsConfigC, MenuTabsItemToC } from "../menu-tabs/schema";
|
|
19
|
+
import { MenuTabsBodyC, MenuTabsConfigC, MenuTabsItemToC } from "../menu-tabs/schema";
|
|
20
20
|
defineOptions({
|
|
21
21
|
inheritAttrs: false
|
|
22
22
|
});
|
|
23
23
|
const props = defineProps({
|
|
24
|
-
config: { type:
|
|
24
|
+
config: { type: null, required: true }
|
|
25
25
|
});
|
|
26
26
|
const emit = defineEmits(["confirm"]);
|
|
27
27
|
const open = defineModel("open", { type: Boolean, ...{
|
|
@@ -188,13 +188,17 @@ function deleteMenu(draftId) {
|
|
|
188
188
|
selectedItemId.value = fallbackMenu?.draftId ?? "";
|
|
189
189
|
}
|
|
190
190
|
function buildDraftConfig() {
|
|
191
|
-
const
|
|
191
|
+
const bodyResult = MenuTabsBodyC.safeParse({
|
|
192
192
|
menus: draftMenus.value.map((item) => item.menu)
|
|
193
193
|
});
|
|
194
|
-
if (!
|
|
194
|
+
if (!bodyResult.success) {
|
|
195
195
|
return void 0;
|
|
196
196
|
}
|
|
197
|
-
return
|
|
197
|
+
return MenuTabsConfigC.parse({
|
|
198
|
+
...bodyResult.data,
|
|
199
|
+
kind: props.config.kind,
|
|
200
|
+
compatibilityDate: props.config.compatibilityDate
|
|
201
|
+
});
|
|
198
202
|
}
|
|
199
203
|
function handleConfirm() {
|
|
200
204
|
if (selectedMenu.value && !(toEditor.value?.validate() ?? true)) {
|