@shwfed/nuxt 0.10.15 → 0.11.1
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 +8 -2
- package/dist/runtime/components/button.vue +19 -3
- package/dist/runtime/components/button.vue.d.ts +8 -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 +11 -4
- package/dist/runtime/components/ui/buttons/Buttons.vue +74 -8
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +11 -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/composables/useButtonAction.d.ts +21 -0
- package/dist/runtime/composables/useButtonAction.js +6 -0
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
+
import { createComponentConfig, createComponentConfigMetadataShape } from "../../component-config.js";
|
|
2
3
|
import { dotPropC, expressionC, localeC } from "../../../utils/coders.js";
|
|
3
4
|
const fieldIdC = z.uuid().describe("\u5B57\u6BB5\u552F\u4E00\u6807\u8BC6\uFF0C\u5FC5\u987B\u662F UUID");
|
|
5
|
+
export const KIND = "shwfed.component.fields";
|
|
6
|
+
export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
7
|
+
export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
|
|
4
8
|
export const ValidationRuleC = z.object({
|
|
5
9
|
expression: expressionC("bool", { value: "dyn", form: "map<string, dyn>" }).describe("\u8FD4\u56DE\u5E03\u5C14\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 value \u548C form \u53D8\u91CF"),
|
|
6
10
|
message: z.string().describe("\u6821\u9A8C\u5931\u8D25\u65F6\u5C55\u793A\u7684 Markdown \u6D88\u606F\uFF0C\u53EF\u5728 {{ expression }} \u4E2D\u4F7F\u7528 value \u548C form \u53D8\u91CF")
|
|
@@ -109,8 +113,17 @@ export const FieldsOrientationC = z.enum(["horizontal", "vertical", "floating"])
|
|
|
109
113
|
export const FieldsStyleC = expressionC(/^map/, {
|
|
110
114
|
form: "map<string, dyn>"
|
|
111
115
|
}).optional().describe("\u8FD4\u56DE\u5B57\u6BB5\u96C6\u5408\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF\u3002");
|
|
112
|
-
|
|
116
|
+
const FieldsBodyObjectC = z.object({
|
|
113
117
|
orientation: FieldsOrientationC.optional().describe("\u5B57\u6BB5\u5E03\u5C40\u65B9\u5411\uFF0C\u53EF\u9009 horizontal\u3001vertical \u6216 floating\uFF1B\u7559\u7A7A\u65F6\u9ED8\u8BA4 horizontal"),
|
|
114
118
|
style: FieldsStyleC,
|
|
115
119
|
fields: z.array(FieldC).readonly().describe("\u5B57\u6BB5\u5217\u8868")
|
|
116
|
-
})
|
|
120
|
+
});
|
|
121
|
+
export const FieldsBodyC = FieldsBodyObjectC.readonly();
|
|
122
|
+
export const FieldsBodyInputC = FieldsBodyC;
|
|
123
|
+
export const FieldsConfigC = FieldsBodyObjectC.extend(
|
|
124
|
+
createComponentConfigMetadataShape(KIND, SUPPORTED_COMPATIBILITY_DATES)
|
|
125
|
+
).readonly();
|
|
126
|
+
export const FieldsConfigInputC = FieldsConfigC;
|
|
127
|
+
export function createFieldsConfig(body) {
|
|
128
|
+
return createComponentConfig(KIND, CURRENT_COMPATIBILITY_DATE, body);
|
|
129
|
+
}
|
|
@@ -123,6 +123,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
123
123
|
type: "empty";
|
|
124
124
|
style?: string | undefined;
|
|
125
125
|
})[];
|
|
126
|
+
kind: string;
|
|
127
|
+
compatibilityDate: string;
|
|
126
128
|
orientation?: "vertical" | "horizontal" | "floating" | undefined;
|
|
127
129
|
style?: string | undefined;
|
|
128
130
|
}>) => any;
|
|
@@ -243,6 +245,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
243
245
|
type: "empty";
|
|
244
246
|
style?: string | undefined;
|
|
245
247
|
})[];
|
|
248
|
+
kind: string;
|
|
249
|
+
compatibilityDate: string;
|
|
246
250
|
orientation?: "vertical" | "horizontal" | "floating" | undefined;
|
|
247
251
|
style?: string | undefined;
|
|
248
252
|
}>) => any) | undefined;
|
|
@@ -8,6 +8,7 @@ import { useI18n } from "vue-i18n";
|
|
|
8
8
|
import {
|
|
9
9
|
CalendarFieldC,
|
|
10
10
|
EmptyFieldC,
|
|
11
|
+
FieldsBodyC,
|
|
11
12
|
FieldsConfigC,
|
|
12
13
|
FieldsStyleC,
|
|
13
14
|
NumberFieldC,
|
|
@@ -1015,17 +1016,22 @@ function buildDraftConfig() {
|
|
|
1015
1016
|
selectedItemId.value = "general";
|
|
1016
1017
|
return void 0;
|
|
1017
1018
|
}
|
|
1018
|
-
const
|
|
1019
|
+
const nextBody = {
|
|
1019
1020
|
fields: normalizedFields.map((item) => item.field)
|
|
1020
1021
|
};
|
|
1021
1022
|
if (draftOrientation.value !== "horizontal") {
|
|
1022
|
-
|
|
1023
|
+
nextBody.orientation = draftOrientation.value;
|
|
1023
1024
|
}
|
|
1024
1025
|
if (generalStyleResult.data) {
|
|
1025
|
-
|
|
1026
|
+
nextBody.style = generalStyleResult.data;
|
|
1026
1027
|
}
|
|
1028
|
+
const body = FieldsBodyC.parse(nextBody);
|
|
1027
1029
|
return {
|
|
1028
|
-
config:
|
|
1030
|
+
config: FieldsConfigC.parse({
|
|
1031
|
+
...body,
|
|
1032
|
+
kind: props.config.kind,
|
|
1033
|
+
compatibilityDate: props.config.compatibilityDate
|
|
1034
|
+
}),
|
|
1029
1035
|
normalizedFields
|
|
1030
1036
|
};
|
|
1031
1037
|
}
|
|
@@ -123,6 +123,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
123
123
|
type: "empty";
|
|
124
124
|
style?: string | undefined;
|
|
125
125
|
})[];
|
|
126
|
+
kind: string;
|
|
127
|
+
compatibilityDate: string;
|
|
126
128
|
orientation?: "vertical" | "horizontal" | "floating" | undefined;
|
|
127
129
|
style?: string | undefined;
|
|
128
130
|
}>) => any;
|
|
@@ -243,6 +245,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
243
245
|
type: "empty";
|
|
244
246
|
style?: string | undefined;
|
|
245
247
|
})[];
|
|
248
|
+
kind: string;
|
|
249
|
+
compatibilityDate: string;
|
|
246
250
|
orientation?: "vertical" | "horizontal" | "floating" | undefined;
|
|
247
251
|
style?: string | undefined;
|
|
248
252
|
}>) => any) | undefined;
|
|
@@ -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;
|