@open-feishu-card/schema 0.1.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/card.d.ts +2761 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +41 -0
- package/dist/card.js.map +1 -0
- package/dist/common/behavior.d.ts +49 -0
- package/dist/common/behavior.d.ts.map +1 -0
- package/dist/common/behavior.js +39 -0
- package/dist/common/behavior.js.map +1 -0
- package/dist/common/behaviors-context.d.ts +19 -0
- package/dist/common/behaviors-context.d.ts.map +1 -0
- package/dist/common/behaviors-context.js +88 -0
- package/dist/common/behaviors-context.js.map +1 -0
- package/dist/common/confirm.d.ts +18 -0
- package/dist/common/confirm.d.ts.map +1 -0
- package/dist/common/confirm.js +12 -0
- package/dist/common/confirm.js.map +1 -0
- package/dist/common/enums.d.ts +115 -0
- package/dist/common/enums.d.ts.map +1 -0
- package/dist/common/enums.js +131 -0
- package/dist/common/enums.js.map +1 -0
- package/dist/common/fallback.d.ts +17 -0
- package/dist/common/fallback.d.ts.map +1 -0
- package/dist/common/fallback.js +22 -0
- package/dist/common/fallback.js.map +1 -0
- package/dist/common/icon-tokens.d.ts +1162 -0
- package/dist/common/icon-tokens.d.ts.map +1 -0
- package/dist/common/icon-tokens.js +1163 -0
- package/dist/common/icon-tokens.js.map +1 -0
- package/dist/common/icon.d.ts +3506 -0
- package/dist/common/icon.d.ts.map +1 -0
- package/dist/common/icon.js +49 -0
- package/dist/common/icon.js.map +1 -0
- package/dist/common/index.d.ts +9 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +9 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/text.d.ts +107 -0
- package/dist/common/text.d.ts.map +1 -0
- package/dist/common/text.js +80 -0
- package/dist/common/text.js.map +1 -0
- package/dist/common/url.d.ts +22 -0
- package/dist/common/url.d.ts.map +1 -0
- package/dist/common/url.js +30 -0
- package/dist/common/url.js.map +1 -0
- package/dist/config.d.ts +226 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +123 -0
- package/dist/config.js.map +1 -0
- package/dist/containers/index.d.ts +1421 -0
- package/dist/containers/index.d.ts.map +1 -0
- package/dist/containers/index.js +205 -0
- package/dist/containers/index.js.map +1 -0
- package/dist/content/index.d.ts +3801 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +426 -0
- package/dist/content/index.js.map +1 -0
- package/dist/element-ref.d.ts +6 -0
- package/dist/element-ref.d.ts.map +1 -0
- package/dist/element-ref.js +17 -0
- package/dist/element-ref.js.map +1 -0
- package/dist/element.d.ts +11614 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +46 -0
- package/dist/element.js.map +1 -0
- package/dist/header.d.ts +1253 -0
- package/dist/header.d.ts.map +1 -0
- package/dist/header.js +27 -0
- package/dist/header.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive/index.d.ts +5371 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +533 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/markdown/builders.d.ts +59 -0
- package/dist/markdown/builders.d.ts.map +1 -0
- package/dist/markdown/builders.js +140 -0
- package/dist/markdown/builders.js.map +1 -0
- package/dist/markdown/code-language.d.ts +78 -0
- package/dist/markdown/code-language.d.ts.map +1 -0
- package/dist/markdown/code-language.js +79 -0
- package/dist/markdown/code-language.js.map +1 -0
- package/dist/markdown/component.d.ts +1224 -0
- package/dist/markdown/component.d.ts.map +1 -0
- package/dist/markdown/component.js +38 -0
- package/dist/markdown/component.js.map +1 -0
- package/dist/markdown/emoji-tokens.d.ts +192 -0
- package/dist/markdown/emoji-tokens.d.ts.map +1 -0
- package/dist/markdown/emoji-tokens.js +193 -0
- package/dist/markdown/emoji-tokens.js.map +1 -0
- package/dist/markdown/enums.d.ts +51 -0
- package/dist/markdown/enums.d.ts.map +1 -0
- package/dist/markdown/enums.js +49 -0
- package/dist/markdown/enums.js.map +1 -0
- package/dist/markdown/escape.d.ts +8 -0
- package/dist/markdown/escape.d.ts.map +1 -0
- package/dist/markdown/escape.js +42 -0
- package/dist/markdown/escape.js.map +1 -0
- package/dist/markdown/index.d.ts +16 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +16 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/tags.d.ts +1293 -0
- package/dist/markdown/tags.d.ts.map +1 -0
- package/dist/markdown/tags.js +238 -0
- package/dist/markdown/tags.js.map +1 -0
- package/dist/markdown/text-size.d.ts +60 -0
- package/dist/markdown/text-size.d.ts.map +1 -0
- package/dist/markdown/text-size.js +58 -0
- package/dist/markdown/text-size.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/common/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc;AACd,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU+B,CAAC;AAEzD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ColorSchema } from './enums.js';
|
|
3
|
+
import { IconTokenSchema } from './icon-tokens.js';
|
|
4
|
+
export { IconTokenSchema } from './icon-tokens.js';
|
|
5
|
+
/** 标准图标库图标 */
|
|
6
|
+
export const StandardIconSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
tag: z.literal('standard_icon').describe('图标类型,固定为 standard_icon'),
|
|
9
|
+
token: IconTokenSchema.optional().describe('图标库 token 枚举(必须命中枚举值)。常用:member_outlined(人员,无 user_outlined)、safe_outlined(安全)、info_outlined、warning_outlined、done_outlined;图表相关可用 insert-chart_outlined / sheet-line_outlined / sheet-histogram_outlined / sheet-pie_outlined / data-sheet_outlined / score_outlined / report_outlined / hot_outlined。禁止臆造 token'),
|
|
10
|
+
color: ColorSchema.optional().describe('图标颜色;对 outlined/filled 图标生效。应与描述的状态文字颜色一致'),
|
|
11
|
+
size: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('图标尺寸,如 "10px 10px"(部分组件支持)'),
|
|
15
|
+
})
|
|
16
|
+
.describe('标准图标库图标');
|
|
17
|
+
/** 自定义图片图标 */
|
|
18
|
+
export const CustomIconSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
tag: z.literal('custom_icon').describe('图标类型,固定为 custom_icon'),
|
|
21
|
+
img_key: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('自定义图标的图片 key(上传图片接口返回)'),
|
|
25
|
+
size: z.string().optional().describe('图标尺寸,如 "10px 10px"'),
|
|
26
|
+
})
|
|
27
|
+
.describe('自定义图片图标');
|
|
28
|
+
/**
|
|
29
|
+
* 前缀图标。使用 tag 判别标准图标与自定义图标。
|
|
30
|
+
*/
|
|
31
|
+
export const IconSchema = z
|
|
32
|
+
.discriminatedUnion('tag', [StandardIconSchema, CustomIconSchema])
|
|
33
|
+
.describe('前缀图标:standard_icon(图标库)或 custom_icon(自定义图片)');
|
|
34
|
+
/**
|
|
35
|
+
* 历史人员列表前缀图标(ud_icon)。
|
|
36
|
+
* 与 icon 同时存在时以 icon 为准。
|
|
37
|
+
*/
|
|
38
|
+
export const UdIconSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
token: IconTokenSchema.optional().describe('图标库 token 枚举'),
|
|
41
|
+
style: z
|
|
42
|
+
.object({
|
|
43
|
+
color: ColorSchema.optional().describe('图标颜色'),
|
|
44
|
+
})
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('图标样式'),
|
|
47
|
+
})
|
|
48
|
+
.describe('历史人员列表前缀图标(ud_icon);与 icon 同时存在时以 icon 为准');
|
|
49
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/common/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EA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AAC,cAAc,CAAC;IAC1D,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC/C,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,CAAC,MAAM,CAAC;CACpB,CAAC;KACD,QAAQ,CAAC,2CAA2C,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './enums.js';
|
|
2
|
+
export * from './text.js';
|
|
3
|
+
export * from './icon.js';
|
|
4
|
+
export * from './url.js';
|
|
5
|
+
export * from './behavior.js';
|
|
6
|
+
export * from './behaviors-context.js';
|
|
7
|
+
export * from './confirm.js';
|
|
8
|
+
export * from './fallback.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './enums.js';
|
|
2
|
+
export * from './text.js';
|
|
3
|
+
export * from './icon.js';
|
|
4
|
+
export * from './url.js';
|
|
5
|
+
export * from './behavior.js';
|
|
6
|
+
export * from './behaviors-context.js';
|
|
7
|
+
export * from './confirm.js';
|
|
8
|
+
export * from './fallback.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* 纯文本对象(plain_text)。
|
|
4
|
+
* 多用于按钮文案、占位符、二次确认等。
|
|
5
|
+
*/
|
|
6
|
+
export declare const PlainTextObjectSchema: z.ZodObject<{
|
|
7
|
+
tag: z.ZodLiteral<"plain_text">;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
element_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PlainTextObject = z.infer<typeof PlainTextObjectSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* 支持 plain_text / lark_md 的文本对象。
|
|
14
|
+
* 常用于标题、普通文本组件内嵌文本等。
|
|
15
|
+
*/
|
|
16
|
+
export declare const TextObjectSchema: z.ZodObject<{
|
|
17
|
+
tag: z.ZodEnum<{
|
|
18
|
+
lark_md: "lark_md";
|
|
19
|
+
plain_text: "plain_text";
|
|
20
|
+
}>;
|
|
21
|
+
content: z.ZodOptional<z.ZodString>;
|
|
22
|
+
element_id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type TextObject = z.infer<typeof TextObjectSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* 折叠面板标题等场景支持的 markdown 文本对象。
|
|
27
|
+
*/
|
|
28
|
+
export declare const MarkdownTextObjectSchema: z.ZodObject<{
|
|
29
|
+
tag: z.ZodEnum<{
|
|
30
|
+
markdown: "markdown";
|
|
31
|
+
plain_text: "plain_text";
|
|
32
|
+
}>;
|
|
33
|
+
content: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type MarkdownTextObject = z.infer<typeof MarkdownTextObjectSchema>;
|
|
36
|
+
/**
|
|
37
|
+
* 带样式的文本块(普通文本组件 text 字段)。
|
|
38
|
+
*/
|
|
39
|
+
export declare const StyledTextObjectSchema: z.ZodObject<{
|
|
40
|
+
tag: z.ZodEnum<{
|
|
41
|
+
lark_md: "lark_md";
|
|
42
|
+
plain_text: "plain_text";
|
|
43
|
+
}>;
|
|
44
|
+
content: z.ZodString;
|
|
45
|
+
element_id: z.ZodOptional<z.ZodString>;
|
|
46
|
+
text_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
47
|
+
heading: "heading";
|
|
48
|
+
"heading-0": "heading-0";
|
|
49
|
+
"heading-1": "heading-1";
|
|
50
|
+
"heading-2": "heading-2";
|
|
51
|
+
"heading-3": "heading-3";
|
|
52
|
+
"heading-4": "heading-4";
|
|
53
|
+
large: "large";
|
|
54
|
+
medium: "medium";
|
|
55
|
+
normal: "normal";
|
|
56
|
+
notation: "notation";
|
|
57
|
+
small: "small";
|
|
58
|
+
"x-large": "x-large";
|
|
59
|
+
"x-small": "x-small";
|
|
60
|
+
"xx-large": "xx-large";
|
|
61
|
+
"xxx-large": "xxx-large";
|
|
62
|
+
"xxxx-large": "xxxx-large";
|
|
63
|
+
}>, z.ZodString, z.ZodString]>>;
|
|
64
|
+
text_color: z.ZodOptional<z.ZodString>;
|
|
65
|
+
text_align: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
center: "center";
|
|
67
|
+
left: "left";
|
|
68
|
+
right: "right";
|
|
69
|
+
}>>;
|
|
70
|
+
lines: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type StyledTextObject = z.infer<typeof StyledTextObjectSchema>;
|
|
73
|
+
/**
|
|
74
|
+
* 标题后缀标签 text_tag。
|
|
75
|
+
*/
|
|
76
|
+
export declare const TextTagSchema: z.ZodObject<{
|
|
77
|
+
tag: z.ZodLiteral<"text_tag">;
|
|
78
|
+
element_id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
tag: z.ZodLiteral<"plain_text">;
|
|
81
|
+
content: z.ZodString;
|
|
82
|
+
element_id: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
blue: "blue";
|
|
86
|
+
carmine: "carmine";
|
|
87
|
+
green: "green";
|
|
88
|
+
indigo: "indigo";
|
|
89
|
+
lime: "lime";
|
|
90
|
+
neutral: "neutral";
|
|
91
|
+
orange: "orange";
|
|
92
|
+
purple: "purple";
|
|
93
|
+
red: "red";
|
|
94
|
+
turquoise: "turquoise";
|
|
95
|
+
violet: "violet";
|
|
96
|
+
wathet: "wathet";
|
|
97
|
+
yellow: "yellow";
|
|
98
|
+
}>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type TextTag = z.infer<typeof TextTagSchema>;
|
|
101
|
+
/** tips / hover / disabled 提示文案 */
|
|
102
|
+
export declare const TipsTextSchema: z.ZodObject<{
|
|
103
|
+
tag: z.ZodLiteral<"plain_text">;
|
|
104
|
+
content: z.ZodString;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type TipsText = z.infer<typeof TipsTextSchema>;
|
|
107
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/common/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;iBAQI,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;iBAQY,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;iBAOR,CAAC;AAE9B,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBI,CAAC;AAExC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;iBAOK,CAAC;AAEhC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,mCAAmC;AACnC,eAAO,MAAM,cAAc;;;iBAKC,CAAC;AAE7B,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ColorSchema, ElementIdSchema, TextSizeSchema, TextTagColorSchema } from './enums.js';
|
|
3
|
+
/**
|
|
4
|
+
* 纯文本对象(plain_text)。
|
|
5
|
+
* 多用于按钮文案、占位符、二次确认等。
|
|
6
|
+
*/
|
|
7
|
+
export const PlainTextObjectSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
tag: z.literal('plain_text').describe('文本类型标签,固定为 plain_text'),
|
|
10
|
+
content: z.string().describe('文本内容'),
|
|
11
|
+
element_id: ElementIdSchema.optional().describe('元素唯一标识,流式更新等场景用于定位该文本元素'),
|
|
12
|
+
})
|
|
13
|
+
.describe('纯文本对象(tag = plain_text)');
|
|
14
|
+
/**
|
|
15
|
+
* 支持 plain_text / lark_md 的文本对象。
|
|
16
|
+
* 常用于标题、普通文本组件内嵌文本等。
|
|
17
|
+
*/
|
|
18
|
+
export const TextObjectSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
tag: z
|
|
21
|
+
.enum(['plain_text', 'lark_md'])
|
|
22
|
+
.describe('文本类型:plain_text(纯文本)或 lark_md(有限 Markdown)'),
|
|
23
|
+
content: z.string().optional().describe('文本内容'),
|
|
24
|
+
element_id: ElementIdSchema.optional().describe('元素唯一标识'),
|
|
25
|
+
})
|
|
26
|
+
.describe('文本对象(plain_text / lark_md)');
|
|
27
|
+
/**
|
|
28
|
+
* 折叠面板标题等场景支持的 markdown 文本对象。
|
|
29
|
+
*/
|
|
30
|
+
export const MarkdownTextObjectSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
tag: z
|
|
33
|
+
.enum(['plain_text', 'markdown'])
|
|
34
|
+
.describe('文本类型:plain_text 或 markdown'),
|
|
35
|
+
content: z.string().optional().describe('文本内容'),
|
|
36
|
+
})
|
|
37
|
+
.describe('折叠面板等场景的标题文本对象');
|
|
38
|
+
/**
|
|
39
|
+
* 带样式的文本块(普通文本组件 text 字段)。
|
|
40
|
+
*/
|
|
41
|
+
export const StyledTextObjectSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
tag: z
|
|
44
|
+
.enum(['plain_text', 'lark_md'])
|
|
45
|
+
.describe('文本类型:plain_text 或 lark_md'),
|
|
46
|
+
content: z.string().describe('文本内容'),
|
|
47
|
+
element_id: ElementIdSchema.optional().describe('元素唯一标识'),
|
|
48
|
+
text_size: TextSizeSchema.optional().describe('字号,默认 normal;官方枚举、10px–40px 或自定义 text_size key'),
|
|
49
|
+
text_color: ColorSchema.optional().describe('文本颜色,默认 default;仅 plain_text 生效'),
|
|
50
|
+
text_align: z
|
|
51
|
+
.enum(['left', 'center', 'right'])
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('文本对齐方式,默认 left'),
|
|
54
|
+
lines: z
|
|
55
|
+
.number()
|
|
56
|
+
.int()
|
|
57
|
+
.positive()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('最大显示行数,超出省略'),
|
|
60
|
+
})
|
|
61
|
+
.describe('带样式的文本块(普通文本组件的 text 字段)');
|
|
62
|
+
/**
|
|
63
|
+
* 标题后缀标签 text_tag。
|
|
64
|
+
*/
|
|
65
|
+
export const TextTagSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
tag: z.literal('text_tag').describe('后缀标签标识,固定为 text_tag'),
|
|
68
|
+
element_id: ElementIdSchema.optional().describe('元素唯一标识'),
|
|
69
|
+
text: PlainTextObjectSchema.optional().describe('标签文案'),
|
|
70
|
+
color: TextTagColorSchema.optional().describe('标签颜色,默认 blue'),
|
|
71
|
+
})
|
|
72
|
+
.describe('标题后缀标签(最多展示 3 个)');
|
|
73
|
+
/** tips / hover / disabled 提示文案 */
|
|
74
|
+
export const TipsTextSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
tag: z.literal('plain_text').describe('提示文案类型,固定为 plain_text'),
|
|
77
|
+
content: z.string().describe('提示文案内容'),
|
|
78
|
+
})
|
|
79
|
+
.describe('悬浮/禁用等场景的提示文案');
|
|
80
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/common/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC7C,yBAAyB,CAC1B;CACF,CAAC;KACD,QAAQ,CAA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5
|
+
* 禁用某端可配置为 `lark://msgcard/unsupported_action`。
|
|
6
|
+
*/
|
|
7
|
+
export declare const MultiUrlSchema: z.ZodObject<{
|
|
8
|
+
url: z.ZodOptional<z.ZodString>;
|
|
9
|
+
pc_url: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ios_url: z.ZodOptional<z.ZodString>;
|
|
11
|
+
android_url: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type MultiUrl = z.infer<typeof MultiUrlSchema>;
|
|
14
|
+
/** 卡片整体点击跳转链接(结构同 MultiUrl) */
|
|
15
|
+
export declare const CardLinkSchema: z.ZodObject<{
|
|
16
|
+
url: z.ZodOptional<z.ZodString>;
|
|
17
|
+
pc_url: z.ZodOptional<z.ZodString>;
|
|
18
|
+
ios_url: z.ZodOptional<z.ZodString>;
|
|
19
|
+
android_url: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type CardLink = z.infer<typeof CardLinkSchema>;
|
|
22
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/common/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;iBAwBxB,CAAC;AAEJ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,+BAA+B;AAC/B,eAAO,MAAM,cAAc;;;;;iBAE1B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* 多端跳转链接。
|
|
4
|
+
* url 与三端链接至少配置一类;若不填 url,则 android_url / ios_url / pc_url 均需填写。
|
|
5
|
+
* 禁用某端可配置为 `lark://msgcard/unsupported_action`。
|
|
6
|
+
*/
|
|
7
|
+
export const MultiUrlSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
url: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('默认跳转链接;若同时配置各端链接,优先使用 url'),
|
|
13
|
+
pc_url: z.string().optional().describe('PC 端跳转链接'),
|
|
14
|
+
ios_url: z.string().optional().describe('iOS 端跳转链接'),
|
|
15
|
+
android_url: z.string().optional().describe('Android 端跳转链接'),
|
|
16
|
+
})
|
|
17
|
+
.superRefine((data, ctx) => {
|
|
18
|
+
const hasUrl = Boolean(data.url);
|
|
19
|
+
const hasAllPlatform = Boolean(data.pc_url) && Boolean(data.ios_url) && Boolean(data.android_url);
|
|
20
|
+
if (!hasUrl && !hasAllPlatform) {
|
|
21
|
+
ctx.addIssue({
|
|
22
|
+
code: 'custom',
|
|
23
|
+
message: 'url 与各端链接至少填一类;若不填 url,则必须完整填写 android_url、ios_url、pc_url',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
.describe('多端跳转链接。url 与三端链接至少填一类;禁用某端可设为 lark://msgcard/unsupported_action');
|
|
28
|
+
/** 卡片整体点击跳转链接(结构同 MultiUrl) */
|
|
29
|
+
export const CardLinkSchema = MultiUrlSchema.describe('卡片整体点击跳转链接(card_link)');
|
|
30
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/common/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,2BAA2B,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;CAC7D,CAAC;KACD,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACzB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7E,IAAI,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC/B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EACL,2DAA2D;SAC9D,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,QAAQ,CACP,iEAAiE,CAClE,CAAC;AAIJ,+BAA+B;AAC/B,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,QAAQ,CACnD,uBAAuB,CACxB,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* 流式更新配置。
|
|
4
|
+
*/
|
|
5
|
+
export declare const StreamingConfigSchema: z.ZodObject<{
|
|
6
|
+
print_frequency_ms: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
android: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
ios: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
pc: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
print_step: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
android: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
ios: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
pc: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
print_strategy: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
delay: "delay";
|
|
20
|
+
fast: "fast";
|
|
21
|
+
}>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type StreamingConfig = z.infer<typeof StreamingConfigSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* 卡片摘要(聊天栏预览文案)。
|
|
26
|
+
*/
|
|
27
|
+
export declare const SummarySchema: z.ZodObject<{
|
|
28
|
+
content: z.ZodOptional<z.ZodString>;
|
|
29
|
+
i18n_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type Summary = z.infer<typeof SummarySchema>;
|
|
32
|
+
/**
|
|
33
|
+
* 自定义字号(分别配置 PC / Mobile,并可选 default 兜底)。
|
|
34
|
+
* 各端取值可为官方枚举或 10px–40px。
|
|
35
|
+
*/
|
|
36
|
+
export declare const CustomTextSizeSchema: z.ZodObject<{
|
|
37
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
38
|
+
heading: "heading";
|
|
39
|
+
"heading-0": "heading-0";
|
|
40
|
+
"heading-1": "heading-1";
|
|
41
|
+
"heading-2": "heading-2";
|
|
42
|
+
"heading-3": "heading-3";
|
|
43
|
+
"heading-4": "heading-4";
|
|
44
|
+
large: "large";
|
|
45
|
+
medium: "medium";
|
|
46
|
+
normal: "normal";
|
|
47
|
+
notation: "notation";
|
|
48
|
+
small: "small";
|
|
49
|
+
"x-large": "x-large";
|
|
50
|
+
"x-small": "x-small";
|
|
51
|
+
"xx-large": "xx-large";
|
|
52
|
+
"xxx-large": "xxx-large";
|
|
53
|
+
"xxxx-large": "xxxx-large";
|
|
54
|
+
}>, z.ZodString, z.ZodString]>>;
|
|
55
|
+
pc: z.ZodUnion<readonly [z.ZodEnum<{
|
|
56
|
+
heading: "heading";
|
|
57
|
+
"heading-0": "heading-0";
|
|
58
|
+
"heading-1": "heading-1";
|
|
59
|
+
"heading-2": "heading-2";
|
|
60
|
+
"heading-3": "heading-3";
|
|
61
|
+
"heading-4": "heading-4";
|
|
62
|
+
large: "large";
|
|
63
|
+
medium: "medium";
|
|
64
|
+
normal: "normal";
|
|
65
|
+
notation: "notation";
|
|
66
|
+
small: "small";
|
|
67
|
+
"x-large": "x-large";
|
|
68
|
+
"x-small": "x-small";
|
|
69
|
+
"xx-large": "xx-large";
|
|
70
|
+
"xxx-large": "xxx-large";
|
|
71
|
+
"xxxx-large": "xxxx-large";
|
|
72
|
+
}>, z.ZodString, z.ZodString]>;
|
|
73
|
+
mobile: z.ZodUnion<readonly [z.ZodEnum<{
|
|
74
|
+
heading: "heading";
|
|
75
|
+
"heading-0": "heading-0";
|
|
76
|
+
"heading-1": "heading-1";
|
|
77
|
+
"heading-2": "heading-2";
|
|
78
|
+
"heading-3": "heading-3";
|
|
79
|
+
"heading-4": "heading-4";
|
|
80
|
+
large: "large";
|
|
81
|
+
medium: "medium";
|
|
82
|
+
normal: "normal";
|
|
83
|
+
notation: "notation";
|
|
84
|
+
small: "small";
|
|
85
|
+
"x-large": "x-large";
|
|
86
|
+
"x-small": "x-small";
|
|
87
|
+
"xx-large": "xx-large";
|
|
88
|
+
"xxx-large": "xxx-large";
|
|
89
|
+
"xxxx-large": "xxxx-large";
|
|
90
|
+
}>, z.ZodString, z.ZodString]>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type CustomTextSize = z.infer<typeof CustomTextSizeSchema>;
|
|
93
|
+
/**
|
|
94
|
+
* 自定义颜色(浅色/深色主题 RGBA)。
|
|
95
|
+
*/
|
|
96
|
+
export declare const CustomColorSchema: z.ZodObject<{
|
|
97
|
+
light_mode: z.ZodString;
|
|
98
|
+
dark_mode: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type CustomColor = z.infer<typeof CustomColorSchema>;
|
|
101
|
+
/**
|
|
102
|
+
* 卡片全局行为配置(config)。
|
|
103
|
+
*/
|
|
104
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
105
|
+
streaming_mode: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
streaming_config: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
print_frequency_ms: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
android: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
ios: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
pc: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
print_step: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
android: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
ios: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
pc: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
print_strategy: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
delay: "delay";
|
|
121
|
+
fast: "fast";
|
|
122
|
+
}>>;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
content: z.ZodOptional<z.ZodString>;
|
|
126
|
+
i18n_content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
enable_forward: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
update_multi: z.ZodOptional<z.ZodBoolean>;
|
|
131
|
+
width_mode: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
compact: "compact";
|
|
133
|
+
default: "default";
|
|
134
|
+
fill: "fill";
|
|
135
|
+
}>>;
|
|
136
|
+
use_custom_translation: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
enable_forward_interaction: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
text_size: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
140
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
141
|
+
heading: "heading";
|
|
142
|
+
"heading-0": "heading-0";
|
|
143
|
+
"heading-1": "heading-1";
|
|
144
|
+
"heading-2": "heading-2";
|
|
145
|
+
"heading-3": "heading-3";
|
|
146
|
+
"heading-4": "heading-4";
|
|
147
|
+
large: "large";
|
|
148
|
+
medium: "medium";
|
|
149
|
+
normal: "normal";
|
|
150
|
+
notation: "notation";
|
|
151
|
+
small: "small";
|
|
152
|
+
"x-large": "x-large";
|
|
153
|
+
"x-small": "x-small";
|
|
154
|
+
"xx-large": "xx-large";
|
|
155
|
+
"xxx-large": "xxx-large";
|
|
156
|
+
"xxxx-large": "xxxx-large";
|
|
157
|
+
}>, z.ZodString, z.ZodString]>>;
|
|
158
|
+
pc: z.ZodUnion<readonly [z.ZodEnum<{
|
|
159
|
+
heading: "heading";
|
|
160
|
+
"heading-0": "heading-0";
|
|
161
|
+
"heading-1": "heading-1";
|
|
162
|
+
"heading-2": "heading-2";
|
|
163
|
+
"heading-3": "heading-3";
|
|
164
|
+
"heading-4": "heading-4";
|
|
165
|
+
large: "large";
|
|
166
|
+
medium: "medium";
|
|
167
|
+
normal: "normal";
|
|
168
|
+
notation: "notation";
|
|
169
|
+
small: "small";
|
|
170
|
+
"x-large": "x-large";
|
|
171
|
+
"x-small": "x-small";
|
|
172
|
+
"xx-large": "xx-large";
|
|
173
|
+
"xxx-large": "xxx-large";
|
|
174
|
+
"xxxx-large": "xxxx-large";
|
|
175
|
+
}>, z.ZodString, z.ZodString]>;
|
|
176
|
+
mobile: z.ZodUnion<readonly [z.ZodEnum<{
|
|
177
|
+
heading: "heading";
|
|
178
|
+
"heading-0": "heading-0";
|
|
179
|
+
"heading-1": "heading-1";
|
|
180
|
+
"heading-2": "heading-2";
|
|
181
|
+
"heading-3": "heading-3";
|
|
182
|
+
"heading-4": "heading-4";
|
|
183
|
+
large: "large";
|
|
184
|
+
medium: "medium";
|
|
185
|
+
normal: "normal";
|
|
186
|
+
notation: "notation";
|
|
187
|
+
small: "small";
|
|
188
|
+
"x-large": "x-large";
|
|
189
|
+
"x-small": "x-small";
|
|
190
|
+
"xx-large": "xx-large";
|
|
191
|
+
"xxx-large": "xxx-large";
|
|
192
|
+
"xxxx-large": "xxxx-large";
|
|
193
|
+
}>, z.ZodString, z.ZodString]>;
|
|
194
|
+
}, z.core.$strip>>>;
|
|
195
|
+
color: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
196
|
+
light_mode: z.ZodString;
|
|
197
|
+
dark_mode: z.ZodString;
|
|
198
|
+
}, z.core.$strip>>>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export type Config = z.infer<typeof ConfigSchema>;
|
|
202
|
+
/**
|
|
203
|
+
* 卡片正文(body)。
|
|
204
|
+
*/
|
|
205
|
+
export declare const BodySchema: z.ZodObject<{
|
|
206
|
+
elements: z.ZodLazy<z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
207
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
horizontal: "horizontal";
|
|
209
|
+
vertical: "vertical";
|
|
210
|
+
}>>;
|
|
211
|
+
padding: z.ZodOptional<z.ZodString>;
|
|
212
|
+
horizontal_spacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"small">, z.ZodLiteral<"medium">, z.ZodLiteral<"large">, z.ZodLiteral<"extra_large">, z.ZodString]>>;
|
|
213
|
+
horizontal_align: z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
center: "center";
|
|
215
|
+
left: "left";
|
|
216
|
+
right: "right";
|
|
217
|
+
}>>;
|
|
218
|
+
vertical_spacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"small">, z.ZodLiteral<"medium">, z.ZodLiteral<"large">, z.ZodLiteral<"extra_large">, z.ZodString]>>;
|
|
219
|
+
vertical_align: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
bottom: "bottom";
|
|
221
|
+
center: "center";
|
|
222
|
+
top: "top";
|
|
223
|
+
}>>;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
export type Body = z.infer<typeof BodySchema>;
|
|
226
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;iBAaO,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,aAAa;;;iBAQU,CAAC;AAErC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQa,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;iBAKC,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CM,CAAC;AAEhC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;iBAsBpB,CAAC;AAEJ,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|