@alifd/chat 0.3.39 → 0.3.40-beta.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.
Files changed (241) hide show
  1. package/es/ai-loading/types.d.ts +1 -0
  2. package/es/button/button.d.ts +1 -2
  3. package/es/button/button.js +13 -19
  4. package/es/button/group.js +5 -42
  5. package/es/button/main.scss +36 -77
  6. package/es/card/main.scss +1 -1
  7. package/es/checkbox-group/main.scss +6 -7
  8. package/es/checkbox-group/types.d.ts +6 -0
  9. package/es/code-view/index.d.ts +11 -0
  10. package/es/code-view/index.js +63 -0
  11. package/es/code-view/main.scss +54 -0
  12. package/es/code-view/style.d.ts +4 -0
  13. package/es/code-view/style.js +4 -0
  14. package/es/code-view/types.d.ts +27 -0
  15. package/es/code-view/types.js +1 -0
  16. package/es/collapse/index.d.ts +157 -0
  17. package/es/collapse/index.js +20 -0
  18. package/es/collapse/main.scss +95 -0
  19. package/es/collapse/style.d.ts +2 -0
  20. package/es/collapse/style.js +2 -0
  21. package/es/collapse/types.d.ts +82 -0
  22. package/es/collapse/types.js +2 -0
  23. package/es/core/variables.scss +27 -12
  24. package/es/date-picker/DatePicker.d.ts +5 -0
  25. package/es/date-picker/DatePicker.js +15 -0
  26. package/es/date-picker/MonthPicker.d.ts +4 -0
  27. package/es/date-picker/MonthPicker.js +15 -0
  28. package/es/date-picker/RangePicker.d.ts +4 -0
  29. package/es/date-picker/RangePicker.js +17 -0
  30. package/es/date-picker/YearPicker.d.ts +4 -0
  31. package/es/date-picker/YearPicker.js +15 -0
  32. package/es/date-picker/index.d.ts +5 -23
  33. package/es/date-picker/index.js +11 -29
  34. package/es/date-picker/main.scss +23 -1
  35. package/es/date-picker/style.d.ts +1 -0
  36. package/es/date-picker/style.js +1 -0
  37. package/es/date-picker/types.d.ts +161 -81
  38. package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
  39. package/es/form/style.d.ts +0 -1
  40. package/es/form/style.js +2 -1
  41. package/es/form/types.d.ts +3 -517
  42. package/es/form/types.js +5 -1
  43. package/es/html-render/index.d.ts +1 -1
  44. package/es/html-render/index.js +204 -99
  45. package/es/html-render/main.scss +27 -8
  46. package/es/html-render/style.d.ts +1 -0
  47. package/es/html-render/style.js +1 -0
  48. package/es/icon/index.d.ts +1 -1
  49. package/es/index.d.ts +3 -0
  50. package/es/index.js +4 -1
  51. package/es/input/index.d.ts +1 -1
  52. package/es/input/index.js +16 -6
  53. package/es/input/main.scss +25 -0
  54. package/es/input/style.d.ts +1 -0
  55. package/es/input/style.js +1 -0
  56. package/es/input/types.d.ts +58 -15
  57. package/es/markdown/index.d.ts +1 -2
  58. package/es/markdown/index.js +26 -15
  59. package/es/markdown/main.scss +4 -3
  60. package/es/markdown/style.d.ts +2 -1
  61. package/es/markdown/style.js +2 -1
  62. package/es/markdown/types.d.ts +20 -9
  63. package/es/message/index.d.ts +4 -4
  64. package/es/person-picker/index.d.ts +3 -190
  65. package/es/person-picker/index.js +23 -21
  66. package/es/person-picker/main.scss +15 -1
  67. package/es/person-picker/types.d.ts +53 -11
  68. package/es/radio-group/index.d.ts +1 -1
  69. package/es/radio-group/index.js +9 -3
  70. package/es/radio-group/main.scss +13 -5
  71. package/es/radio-group/types.d.ts +5 -3
  72. package/es/reference/index.d.ts +1 -1
  73. package/es/reference/index.js +14 -15
  74. package/es/reference/main.scss +1 -1
  75. package/es/reference/types.d.ts +1 -0
  76. package/es/select/button.d.ts +3 -0
  77. package/es/select/button.js +70 -0
  78. package/es/select/index.d.ts +79 -79
  79. package/es/select/index.js +13 -57
  80. package/es/select/main.scss +22 -4
  81. package/es/select/types.d.ts +108 -1
  82. package/es/step/index.js +2 -2
  83. package/es/step/main.scss +115 -66
  84. package/es/step/types.d.ts +13 -2
  85. package/es/table/index.d.ts +12 -0
  86. package/es/table/index.js +23 -0
  87. package/es/table/main.scss +30 -0
  88. package/es/table/style.d.ts +2 -0
  89. package/es/table/style.js +2 -0
  90. package/es/table/types.d.ts +98 -0
  91. package/es/table/types.js +1 -0
  92. package/es/tag/index.d.ts +5 -3
  93. package/es/tag/index.js +18 -2
  94. package/es/tag/main.scss +20 -4
  95. package/es/tag/types.d.ts +55 -0
  96. package/es/text/index.js +67 -22
  97. package/es/text/main.scss +4 -1
  98. package/es/text/types.d.ts +8 -0
  99. package/es/time-picker/index.d.ts +6 -15
  100. package/es/time-picker/index.js +71 -24
  101. package/es/time-picker/main.scss +19 -1
  102. package/es/time-picker/style.d.ts +1 -0
  103. package/es/time-picker/style.js +1 -0
  104. package/es/time-picker/types.d.ts +133 -8
  105. package/es/tool-status/index.d.ts +1 -1
  106. package/es/tool-status/index.js +1 -1
  107. package/es/tool-status/main.scss +2 -1
  108. package/es/tool-status/types.d.ts +7 -2
  109. package/es/utils/func.d.ts +1 -0
  110. package/es/utils/func.js +13 -0
  111. package/es/utils/github-dark.scss +137 -0
  112. package/es/utils/github.scss +137 -0
  113. package/es/utils/hoc/main.scss +166 -0
  114. package/es/utils/hoc/withLabel.d.ts +94 -0
  115. package/es/utils/hoc/withLabel.js +57 -0
  116. package/es/utils/index.d.ts +1 -0
  117. package/es/utils/index.js +1 -0
  118. package/lib/ai-loading/types.d.ts +1 -0
  119. package/lib/button/button.d.ts +1 -2
  120. package/lib/button/button.js +13 -19
  121. package/lib/button/group.js +4 -41
  122. package/lib/button/main.scss +36 -77
  123. package/lib/card/main.scss +1 -1
  124. package/lib/checkbox-group/main.scss +6 -7
  125. package/lib/checkbox-group/types.d.ts +6 -0
  126. package/lib/code-view/index.d.ts +11 -0
  127. package/lib/code-view/index.js +66 -0
  128. package/lib/code-view/main.scss +54 -0
  129. package/lib/code-view/style.d.ts +4 -0
  130. package/lib/code-view/style.js +6 -0
  131. package/lib/code-view/types.d.ts +27 -0
  132. package/lib/code-view/types.js +2 -0
  133. package/lib/collapse/index.d.ts +157 -0
  134. package/lib/collapse/index.js +22 -0
  135. package/lib/collapse/main.scss +95 -0
  136. package/lib/collapse/style.d.ts +2 -0
  137. package/lib/collapse/style.js +4 -0
  138. package/lib/collapse/types.d.ts +82 -0
  139. package/lib/collapse/types.js +3 -0
  140. package/lib/core/variables.scss +27 -12
  141. package/lib/date-picker/DatePicker.d.ts +5 -0
  142. package/lib/date-picker/DatePicker.js +17 -0
  143. package/lib/date-picker/MonthPicker.d.ts +4 -0
  144. package/lib/date-picker/MonthPicker.js +17 -0
  145. package/lib/date-picker/RangePicker.d.ts +4 -0
  146. package/lib/date-picker/RangePicker.js +19 -0
  147. package/lib/date-picker/YearPicker.d.ts +4 -0
  148. package/lib/date-picker/YearPicker.js +17 -0
  149. package/lib/date-picker/index.d.ts +5 -23
  150. package/lib/date-picker/index.js +10 -27
  151. package/lib/date-picker/main.scss +23 -1
  152. package/lib/date-picker/style.d.ts +1 -0
  153. package/lib/date-picker/style.js +1 -0
  154. package/lib/date-picker/types.d.ts +161 -81
  155. package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
  156. package/lib/form/style.d.ts +0 -1
  157. package/lib/form/style.js +1 -2
  158. package/lib/form/types.d.ts +3 -517
  159. package/lib/form/types.js +4 -1
  160. package/lib/html-render/index.d.ts +1 -1
  161. package/lib/html-render/index.js +203 -98
  162. package/lib/html-render/main.scss +27 -8
  163. package/lib/html-render/style.d.ts +1 -0
  164. package/lib/html-render/style.js +1 -0
  165. package/lib/icon/index.d.ts +1 -1
  166. package/lib/index.d.ts +3 -0
  167. package/lib/index.js +8 -2
  168. package/lib/input/index.d.ts +1 -1
  169. package/lib/input/index.js +16 -6
  170. package/lib/input/main.scss +25 -0
  171. package/lib/input/style.d.ts +1 -0
  172. package/lib/input/style.js +1 -0
  173. package/lib/input/types.d.ts +58 -15
  174. package/lib/markdown/index.d.ts +1 -2
  175. package/lib/markdown/index.js +26 -15
  176. package/lib/markdown/main.scss +4 -3
  177. package/lib/markdown/style.d.ts +2 -1
  178. package/lib/markdown/style.js +2 -1
  179. package/lib/markdown/types.d.ts +20 -9
  180. package/lib/message/index.d.ts +4 -4
  181. package/lib/person-picker/index.d.ts +3 -190
  182. package/lib/person-picker/index.js +22 -20
  183. package/lib/person-picker/main.scss +15 -1
  184. package/lib/person-picker/types.d.ts +53 -11
  185. package/lib/radio-group/index.d.ts +1 -1
  186. package/lib/radio-group/index.js +8 -2
  187. package/lib/radio-group/main.scss +13 -5
  188. package/lib/radio-group/types.d.ts +5 -3
  189. package/lib/reference/index.d.ts +1 -1
  190. package/lib/reference/index.js +17 -18
  191. package/lib/reference/main.scss +1 -1
  192. package/lib/reference/types.d.ts +1 -0
  193. package/lib/select/button.d.ts +3 -0
  194. package/lib/select/button.js +74 -0
  195. package/lib/select/index.d.ts +79 -79
  196. package/lib/select/index.js +11 -55
  197. package/lib/select/main.scss +22 -4
  198. package/lib/select/types.d.ts +108 -1
  199. package/lib/step/index.js +2 -2
  200. package/lib/step/main.scss +115 -66
  201. package/lib/step/types.d.ts +13 -2
  202. package/lib/table/index.d.ts +12 -0
  203. package/lib/table/index.js +25 -0
  204. package/lib/table/main.scss +30 -0
  205. package/lib/table/style.d.ts +2 -0
  206. package/lib/table/style.js +4 -0
  207. package/lib/table/types.d.ts +98 -0
  208. package/lib/table/types.js +2 -0
  209. package/lib/tag/index.d.ts +5 -3
  210. package/lib/tag/index.js +17 -1
  211. package/lib/tag/main.scss +20 -4
  212. package/lib/tag/types.d.ts +55 -0
  213. package/lib/text/index.js +66 -21
  214. package/lib/text/main.scss +4 -1
  215. package/lib/text/types.d.ts +8 -0
  216. package/lib/time-picker/index.d.ts +6 -15
  217. package/lib/time-picker/index.js +71 -23
  218. package/lib/time-picker/main.scss +19 -1
  219. package/lib/time-picker/style.d.ts +1 -0
  220. package/lib/time-picker/style.js +1 -0
  221. package/lib/time-picker/types.d.ts +133 -8
  222. package/lib/tool-status/index.d.ts +1 -1
  223. package/lib/tool-status/index.js +1 -1
  224. package/lib/tool-status/main.scss +2 -1
  225. package/lib/tool-status/types.d.ts +7 -2
  226. package/lib/utils/func.d.ts +1 -0
  227. package/lib/utils/func.js +15 -0
  228. package/lib/utils/github-dark.scss +137 -0
  229. package/lib/utils/github.scss +137 -0
  230. package/lib/utils/hoc/main.scss +166 -0
  231. package/lib/utils/hoc/withLabel.d.ts +94 -0
  232. package/lib/utils/hoc/withLabel.js +60 -0
  233. package/lib/utils/index.d.ts +1 -0
  234. package/lib/utils/index.js +1 -0
  235. package/package.json +49 -4
  236. package/es/form/index.d.ts +0 -23
  237. package/es/form/index.js +0 -33
  238. package/es/form/main.scss +0 -5
  239. package/lib/form/index.d.ts +0 -23
  240. package/lib/form/index.js +0 -35
  241. package/lib/form/main.scss +0 -5
@@ -6,9 +6,6 @@ interface InputCommonHTMLAttributes extends Omit<React.InputHTMLAttributes<HTMLE
6
6
  }
7
7
  interface CommonPropsWithoutLocale extends Omit<CommonProps, 'locale'> {
8
8
  }
9
- /**
10
- * @api
11
- */
12
9
  export interface OnKeyDownOpts {
13
10
  /**
14
11
  * 输入的空格被清理
@@ -23,7 +20,7 @@ export interface OnKeyDownOpts {
23
20
  }
24
21
  /**
25
22
  * @api Input.TextArea
26
- * @order 2
23
+ * @order 1
27
24
  */
28
25
  export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWithoutLocale {
29
26
  /**
@@ -44,6 +41,7 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
44
41
  /**
45
42
  * 键盘按下的时候触发的回调
46
43
  * @en Callback when key down
44
+ * @skip
47
45
  */
48
46
  onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>, opts: OnKeyDownOpts) => void;
49
47
  /**
@@ -55,6 +53,7 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
55
53
  /**
56
54
  * 最大长度
57
55
  * @en Max length
56
+ * @skip
58
57
  */
59
58
  maxLength?: number;
60
59
  /**
@@ -62,18 +61,21 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
62
61
  * @en Show limit hint
63
62
  * @deprecated use hasLimitHint, will be removed in 2.x
64
63
  * @defaultValue false
64
+ * @skip
65
65
  */
66
66
  hasLimitHint?: boolean;
67
67
  /**
68
68
  * 是否展现最大长度样式
69
69
  * @en Show limit hint
70
70
  * @defaultValue false
71
+ * @skip
71
72
  */
72
73
  showLimitHint?: boolean;
73
74
  /**
74
75
  * 当设置了 maxLength 时,是否截断超出的字符串
75
76
  * @en Cut string when maxLength is exceeded
76
77
  * @defaultValue true
78
+ * @skip
77
79
  */
78
80
  cutString?: boolean;
79
81
  /**
@@ -86,6 +88,7 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
86
88
  * onChange 返回会自动去除头尾空字符
87
89
  * @en onChange return will automatically remove head and tail empty characters
88
90
  * @defaultValue false
91
+ * @skip
89
92
  */
90
93
  trim?: boolean;
91
94
  /**
@@ -96,31 +99,37 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
96
99
  /**
97
100
  * 获取焦点时候触发的回调
98
101
  * @en Callback when focus
102
+ * @skip
99
103
  */
100
104
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
101
105
  /**
102
106
  * 失去焦点时候触发的回调
103
107
  * @en Callback when blur
108
+ * @skip
104
109
  */
105
110
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
106
111
  /**
107
112
  * 自定义字符串计算长度方式
108
113
  * @en Custom calculation method of string length
114
+ * @skip
109
115
  */
110
116
  getValueLength?: (value: string) => number | void;
111
117
  /**
112
118
  * 自定义 class
113
119
  * @en Custom className
120
+ * @skip
114
121
  */
115
122
  className?: string;
116
123
  /**
117
124
  * 自定义内联样式
118
125
  * @en Custom inline style
126
+ * @skip
119
127
  */
120
128
  style?: React.CSSProperties;
121
129
  /**
122
130
  * 原生 type
123
131
  * @en Native type
132
+ * @skip
124
133
  */
125
134
  htmlType?: string;
126
135
  /**
@@ -137,12 +146,14 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
137
146
  * 是否有边框
138
147
  * @en Show border
139
148
  * @defaultValue true
149
+ * @skip
140
150
  */
141
151
  hasBorder?: boolean;
142
152
  /**
143
153
  * 根据内容自动改变高度
144
154
  * @en Auto height
145
155
  * @defaultValue false
156
+ * @skip
146
157
  */
147
158
  autoHeight?: boolean | {
148
159
  minRows?: number | string;
@@ -158,11 +169,13 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
158
169
  * 是否为预览态
159
170
  * @en Is preview
160
171
  * @defaultValue false
172
+ * @skip
161
173
  */
162
174
  isPreview?: boolean;
163
175
  /**
164
176
  * 自定义预览态内容
165
177
  * @en Custom preview content
178
+ * @skip
166
179
  */
167
180
  renderPreview?: (value: string | number | undefined | null, props: TextAreaProps) => React.ReactNode;
168
181
  /**
@@ -170,11 +183,14 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
170
183
  * @en Will filter the input method middle letter status, and only trigger onChange after the text input is completed
171
184
  * @version 1.23
172
185
  * @defaultValue false
186
+ * @skip
173
187
  */
174
188
  composition?: boolean;
175
189
  /**
176
190
  * 是否出现 clear 按钮
177
191
  * @en Show clear button
192
+ * @defaultValue false
193
+ * @skip
178
194
  */
179
195
  hasClear?: boolean;
180
196
  /**
@@ -188,12 +204,8 @@ export interface TextAreaProps extends InputCommonHTMLAttributes, CommonPropsWit
188
204
  * @en Size
189
205
  * @defaultValue 'medium'
190
206
  */
191
- size?: 'small' | 'medium' | 'large';
207
+ size?: 'medium';
192
208
  }
193
- /**
194
- * @api Input.Group
195
- * @order 3
196
- */
197
209
  export interface GroupProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
198
210
  /**
199
211
  * 输入框前附加内容
@@ -229,7 +241,7 @@ export interface GroupProps extends React.HTMLAttributes<HTMLElement>, CommonPro
229
241
  }
230
242
  /**
231
243
  * @api Input
232
- * @order 1
244
+ * @order 0
233
245
  */
234
246
  export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithoutLocale {
235
247
  /**
@@ -250,6 +262,7 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
250
262
  /**
251
263
  * 键盘按下的时候触发的回调
252
264
  * @en Callback when key down
265
+ * @skip
253
266
  */
254
267
  onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, opts: OnKeyDownOpts) => void;
255
268
  /**
@@ -261,6 +274,7 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
261
274
  /**
262
275
  * 最大长度
263
276
  * @en Max length
277
+ * @skip
264
278
  */
265
279
  maxLength?: number;
266
280
  /**
@@ -268,18 +282,21 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
268
282
  * @en Show limit hint
269
283
  * @deprecated use hasLimitHint, will be removed in 2.x
270
284
  * @defaultValue false
285
+ * @skip
271
286
  */
272
287
  hasLimitHint?: boolean;
273
288
  /**
274
289
  * 是否展现最大长度样式
275
290
  * @en Show limit hint
276
291
  * @defaultValue false
292
+ * @skip
277
293
  */
278
294
  showLimitHint?: boolean;
279
295
  /**
280
296
  * 当设置了 maxLength 时,是否截断超出的字符串
281
297
  * @en Cut string when maxLength is exceeded
282
298
  * @defaultValue true
299
+ * @skip
283
300
  */
284
301
  cutString?: boolean;
285
302
  /**
@@ -292,6 +309,7 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
292
309
  * onChange 返回会自动去除头尾空字符
293
310
  * @en onChange return will automatically remove head and tail empty characters
294
311
  * @defaultValue false
312
+ * @skip
295
313
  */
296
314
  trim?: boolean;
297
315
  /**
@@ -302,31 +320,37 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
302
320
  /**
303
321
  * 获取焦点时候触发的回调
304
322
  * @en Callback when focus
323
+ * @skip
305
324
  */
306
325
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
307
326
  /**
308
327
  * 失去焦点时候触发的回调
309
328
  * @en Callback when blur
329
+ * @skip
310
330
  */
311
331
  onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
312
332
  /**
313
333
  * 自定义字符串计算长度方式
314
334
  * @en Custom calculation method of string length
335
+ * @skip
315
336
  */
316
337
  getValueLength?: (value: string) => number | void;
317
338
  /**
318
339
  * 自定义 class
319
340
  * @en Custom className
341
+ * @skip
320
342
  */
321
343
  className?: string;
322
344
  /**
323
345
  * 自定义内联样式
324
346
  * @en Custom inline style
347
+ * @skip
325
348
  */
326
349
  style?: React.CSSProperties;
327
350
  /**
328
351
  * 原生 type
329
352
  * @en Native type
353
+ * @skip
330
354
  */
331
355
  htmlType?: string;
332
356
  /**
@@ -347,12 +371,14 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
347
371
  /**
348
372
  * 是否出现 clear 按钮
349
373
  * @en Show clear button
374
+ * @skip
350
375
  */
351
376
  hasClear?: boolean;
352
377
  /**
353
378
  * 是否有边框
354
379
  * @en Show border
355
380
  * @defaultValue true
381
+ * @skip
356
382
  */
357
383
  hasBorder?: boolean;
358
384
  /**
@@ -364,63 +390,75 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
364
390
  /**
365
391
  * 按下回车的回调
366
392
  * @en Callback when press enter
393
+ * @skip
367
394
  */
368
395
  onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
369
396
  /**
370
397
  * 水印 (Icon 的 type 类型,和清除按钮占用同一个地方)
371
398
  * @en Hint (Icon type, occupy the same place as clear button)
399
+ * @skip
372
400
  */
373
401
  hint?: string | React.ReactNode;
374
402
  /**
375
403
  * 文字前附加内容
376
404
  * @en Content before text
405
+ * @skip
377
406
  */
378
407
  innerBefore?: React.ReactNode;
379
408
  /**
380
409
  * 文字后附加内容
381
410
  * @en Content after text
411
+ * @skip
382
412
  */
383
413
  innerAfter?: React.ReactNode;
384
414
  /**
385
415
  * 输入框前附加内容
386
416
  * @en Addon Content before input
417
+ * @skip
387
418
  */
388
419
  addonBefore?: React.ReactNode;
389
420
  /**
390
421
  * 输入框后附加内容
391
422
  * @en Addon Content after input
423
+ * @skip
392
424
  */
393
425
  addonAfter?: React.ReactNode;
394
426
  /**
395
427
  * 输入框前附加文字
396
428
  * @en Addon Text before input
429
+ * @skip
397
430
  */
398
431
  addonTextBefore?: React.ReactNode;
399
432
  /**
400
433
  * 输入框后附加文字
401
434
  * @en Addon Text after input
435
+ * @skip
402
436
  */
403
437
  addonTextAfter?: React.ReactNode;
404
438
  /**
405
439
  * 自动补全 (原生 input 支持)
406
440
  * @en Auto complete
407
441
  * @defaultValue 'off'
442
+ * @skip
408
443
  */
409
444
  autoComplete?: string;
410
445
  /**
411
446
  * 自动聚焦 (原生 input 支持)
412
447
  * @en Auto focus
448
+ * @skip
413
449
  */
414
450
  autoFocus?: boolean;
415
451
  /**
416
452
  * 是否为预览态
417
453
  * @en Is preview
418
454
  * @defaultValue false
455
+ * @skip
419
456
  */
420
457
  isPreview?: boolean;
421
458
  /**
422
459
  * 自定义预览态内容
423
460
  * @en Custom preview content
461
+ * @skip
424
462
  */
425
463
  renderPreview?: (value: string | number | undefined | null, props: InputProps) => React.ReactNode;
426
464
  /**
@@ -428,6 +466,7 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
428
466
  * @en Will filter the input method middle letter status, and only trigger onChange after the text input is completed
429
467
  * @version 1.23
430
468
  * @defaultValue false
469
+ * @skip
431
470
  */
432
471
  composition?: boolean;
433
472
  /**
@@ -435,55 +474,59 @@ export interface InputProps extends InputCommonHTMLAttributes, CommonPropsWithou
435
474
  * @en Hover to show clear
436
475
  * @version 1.24
437
476
  * @defaultValue false
477
+ * @skip
438
478
  */
439
479
  hoverShowClear?: boolean;
440
480
  /**
441
481
  * 额外内容
442
482
  * @en Extra content
483
+ * @skip
443
484
  */
444
485
  extra?: React.ReactNode;
445
486
  /**
446
487
  * 原生 input 的 size 属性
447
488
  * @en Native input size
489
+ * @skip
448
490
  */
449
491
  htmlSize?: string;
450
492
  /**
451
493
  * 自定义 input 样式
452
494
  * @en Custom input style
495
+ * @skip
453
496
  */
454
497
  inputRender?: (input: React.ReactElement) => React.ReactNode;
455
498
  /**
456
499
  * 自定义 input 样式
457
500
  * @en Custom input style
501
+ * @skip
458
502
  */
459
503
  inputStyle?: React.CSSProperties;
460
504
  /**
461
505
  * 自定义 input 类名
462
506
  * @en Custom input className
507
+ * @skip
463
508
  */
464
509
  inputClassName?: string;
465
510
  /**
466
511
  * 多语言文案
467
512
  * @en Locale
468
513
  * @skip
514
+ * @skip
469
515
  */
470
516
  locale?: Locale['Input'];
471
517
  /**
472
518
  * 文字前附加内容类名
473
519
  * @en Content className before text
520
+ * @skip
474
521
  */
475
522
  innerBeforeClassName?: string;
476
523
  /**
477
524
  * 文字后附加内容类名
478
525
  * @en Content className after text
526
+ * @skip
479
527
  */
480
528
  innerAfterClassName?: string;
481
529
  }
482
- /**
483
- * @api Input.Password
484
- * @remarks 继承 Input 的属性 - Inherit Input's properties
485
- * @order 4
486
- */
487
530
  export interface PasswordProps extends InputProps {
488
531
  /**
489
532
  * 是否展示切换按钮
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { MarkdownProps } from './types';
3
- import 'highlight.js/styles/github.css';
2
+ import type { MarkdownProps } from './types';
4
3
  export * from './types';
5
4
  declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<MarkdownProps & React.RefAttributes<HTMLDivElement>, "key" | keyof MarkdownProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
6
5
  export default _default;
@@ -4,12 +4,11 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
6
6
  const markdown_it_1 = tslib_1.__importDefault(require("markdown-it"));
7
- const html_render_1 = tslib_1.__importDefault(require("../html-render"));
8
7
  const next_1 = require("@alifd/next");
9
- const utils_1 = require("../utils");
10
8
  const dingtalk_im_emoji_1 = require("@ali/dingtalk-im-emoji");
11
- const highlight_js_1 = tslib_1.__importDefault(require("highlight.js")); // 引入 highlight.js
12
- require("highlight.js/styles/github.css"); // 引入代码高亮样式
9
+ const highlight_js_1 = tslib_1.__importDefault(require("highlight.js"));
10
+ const utils_1 = require("../utils");
11
+ const html_render_1 = tslib_1.__importDefault(require("../html-render"));
13
12
  let displayedContentCache = '';
14
13
  const DEFAULT_LOADING_ICON = 'https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif';
15
14
  // 默认白名单标签
@@ -21,17 +20,13 @@ const DEFAULT_WHITELIST_TAGS = ['img', 'code', 'pre', 'link-reference'];
21
20
  * @remarks Markdown 组件用于解析和渲染 Markdown 文本内容。 - Markdown component used to parse and render Markdown text content.
22
21
  * @when 需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content.
23
22
  */
24
- const Markdown = (0, react_1.forwardRef)((_a, ref) => {
25
- var { className, onReady, content, needCodeHeader = true } = _a, others = tslib_1.__rest(_a, ["className", "onReady", "content", "needCodeHeader"]);
23
+ const Markdown = (0, react_1.forwardRef)((_a) => {
24
+ var { className, onReady, content, needCodeHeader = true, theme = 'light' } = _a, others = tslib_1.__rest(_a, ["className", "onReady", "content", "needCodeHeader", "theme"]);
26
25
  (0, react_1.useEffect)(() => {
27
26
  // 初始化表情库
28
27
  (0, dingtalk_im_emoji_1.init)();
29
28
  onReady === null || onReady === void 0 ? void 0 : onReady();
30
29
  }, [onReady]);
31
- const containerRef = (0, react_1.useRef)(null);
32
- const [displayedContent, setDisplayedContent] = (0, react_1.useState)(() => (others === null || others === void 0 ? void 0 : others.typewriterEffect) ? displayedContentCache : content);
33
- const [contentQueue, setContentQueue] = (0, react_1.useState)(() => (others === null || others === void 0 ? void 0 : others.typewriterEffect) ? createContentQueue(content, others.whitelistTags) : []);
34
- const typeTimeoutRef = (0, react_1.useRef)(null);
35
30
  // 创建打字机内容队列,处理白名单标签
36
31
  function createContentQueue(text, customWhitelist) {
37
32
  if (!text)
@@ -82,6 +77,10 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
82
77
  }
83
78
  return parts;
84
79
  }
80
+ const containerRef = (0, react_1.useRef)(null);
81
+ const [displayedContent, setDisplayedContent] = (0, react_1.useState)(() => (others === null || others === void 0 ? void 0 : others.typewriterEffect) ? displayedContentCache : content);
82
+ const [contentQueue, setContentQueue] = (0, react_1.useState)(() => (others === null || others === void 0 ? void 0 : others.typewriterEffect) ? createContentQueue(content, others.whitelistTags) : []);
83
+ const typeTimeoutRef = (0, react_1.useRef)(null);
85
84
  // 清理定时器函数
86
85
  const clearTypeTimer = () => {
87
86
  if (typeTimeoutRef.current) {
@@ -161,15 +160,25 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
161
160
  // 缓存displayedContent
162
161
  displayedContentCache = displayedContent;
163
162
  // 使用 Record 类型来定义映射关系
163
+ // eslint-disable-next-line camelcase
164
164
  const sizeTokenToTagMap = {
165
+ // eslint-disable-next-line camelcase
165
166
  common_hypertitle_text_style__font_size: 'h1',
167
+ // eslint-disable-next-line camelcase
166
168
  common_largetitle_text_style__font_size: 'h1',
169
+ // eslint-disable-next-line camelcase
167
170
  common_h1_text_style__font_size: 'h1',
171
+ // eslint-disable-next-line camelcase
168
172
  common_h2_text_style__font_size: 'h2',
173
+ // eslint-disable-next-line camelcase
169
174
  common_h3_text_style__font_size: 'h3',
175
+ // eslint-disable-next-line camelcase
170
176
  common_h4_text_style__font_size: 'h4',
177
+ // eslint-disable-next-line camelcase
171
178
  common_h5_text_style__font_size: 'h5',
179
+ // eslint-disable-next-line camelcase
172
180
  common_body_text_style__font_size: 'span',
181
+ // eslint-disable-next-line camelcase
173
182
  common_footnote_text_style__font_size: 'span'
174
183
  };
175
184
  const regex = /<font\s+([^>]+)>([^<]+)<\/font>/g;
@@ -217,8 +226,8 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
217
226
  draggable: 'false',
218
227
  style: 'vertical-align: text-center; display: inline-block; pointer-events: none;', // 使用相对单位和 inline-block 显示
219
228
  class: 'emoji',
220
- title: '[' + name + ']',
221
- src: url.url || url.staticURL,
229
+ title: `[${name}]`,
230
+ src: url.url || url.staticURL || '',
222
231
  alt: name,
223
232
  },
224
233
  };
@@ -245,7 +254,9 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
245
254
  try {
246
255
  return highlight_js_1.default === null || highlight_js_1.default === void 0 ? void 0 : highlight_js_1.default.highlight(lang, str, true).value;
247
256
  }
248
- catch (__) { }
257
+ catch (__) {
258
+ // 忽略高亮错误,使用默认渲染
259
+ }
249
260
  }
250
261
  return '';
251
262
  }
@@ -333,10 +344,10 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
333
344
  if (!generating || html) {
334
345
  return null;
335
346
  }
336
- return react_1.default.createElement("img", { width: 20, height: 10, src: DEFAULT_LOADING_ICON });
347
+ return react_1.default.createElement("img", { width: 20, height: 10, src: DEFAULT_LOADING_ICON, alt: "" });
337
348
  };
338
349
  const csName = (others === null || others === void 0 ? void 0 : others.generating) ? `${utils_1.PREFIX_DEFAULT}markdown generating` : `${utils_1.PREFIX_DEFAULT}markdown`;
339
- return (react_1.default.createElement("div", { ref: containerRef, className: (0, classnames_1.default)(csName, className) },
350
+ return (react_1.default.createElement("div", { ref: containerRef, className: (0, classnames_1.default)(csName, `${utils_1.PREFIX_DEFAULT}hljs-${theme}`, className) },
340
351
  react_1.default.createElement(html_render_1.default, Object.assign({}, others), html),
341
352
  renderGenerating()));
342
353
  });
@@ -63,7 +63,7 @@ $mistPrimaryColor: $color-brand1-1;
63
63
  }
64
64
 
65
65
  .reference {
66
- margin-top: 6px;
66
+ margin-top: var(--s-2, 8px);
67
67
  font-size: 12px;
68
68
 
69
69
  &-tip {
@@ -88,7 +88,7 @@ $mistPrimaryColor: $color-brand1-1;
88
88
  font-size: 12px;
89
89
  line-height: 18px;
90
90
  color: $color-text1-2;
91
- margin-bottom: 8px;
91
+ margin-bottom: var(--s-2, 8px);
92
92
  }
93
93
  .code-block-header {
94
94
  display: flex;
@@ -101,6 +101,7 @@ $mistPrimaryColor: $color-brand1-1;
101
101
  border-top-left-radius: 4px;
102
102
  border-top-right-radius: 4px;
103
103
  border-bottom: 1px solid $color-line1-2;
104
+ margin-top: var(--s-2, 8px);
104
105
  }
105
106
 
106
107
  .code-block-language {
@@ -124,7 +125,7 @@ $mistPrimaryColor: $color-brand1-1;
124
125
  border-top-left-radius: 0;
125
126
  border-top-right-radius: 0px;
126
127
  padding: 10px;
127
- margin-bottom: 10px;
128
+ margin-bottom: var(--s-2, 8px);
128
129
  }
129
130
 
130
131
  .code-block-copy:hover {
@@ -1,3 +1,4 @@
1
1
  import '../html-render/style';
2
2
  import './main.scss';
3
- import 'highlight.js/styles/github.css';
3
+ import '../utils/github.scss';
4
+ import '../utils/github-dark.scss';
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  require("../html-render/style");
4
4
  require("./main.scss");
5
- require("highlight.js/styles/github.css");
5
+ require("../utils/github.scss");
6
+ require("../utils/github-dark.scss");
@@ -6,11 +6,13 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
6
6
  /**
7
7
  * 自定义类名
8
8
  * @en Custom class name
9
+ * @skip
9
10
  */
10
11
  className?: string;
11
12
  /**
12
13
  * 组件准备就绪的回调函数
13
14
  * @en Callback function when the component is ready
15
+ * @skip
14
16
  */
15
17
  onReady?: () => void;
16
18
  /**
@@ -26,11 +28,13 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
26
28
  /**
27
29
  * 处理打开链接的函数
28
30
  * @en Function to handle open link
31
+ * @skip
29
32
  */
30
33
  handleOpenLink?: (href: string) => void;
31
34
  /**
32
35
  * 发送文本消息的函数
33
36
  * @en Function to send text message
37
+ * @skip
34
38
  */
35
39
  sendTextMessage?: (message: string) => void;
36
40
  /**
@@ -41,14 +45,16 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
41
45
  /**
42
46
  * 国际化函数
43
47
  * @en Internationalization function
48
+ * @skip
44
49
  */
45
50
  i18n?: (key: string) => string;
46
51
  /**
47
- *
48
- * @param src 图片地址
49
- * @param width 图片宽度
50
- * @param height 图片高度
52
+ * 处理图片点击事件
53
+ * @param src - 图片地址
54
+ * @param width - 图片宽度
55
+ * @param height - 图片高度
51
56
  * @returns
57
+ * @skip
52
58
  */
53
59
  handleImageClick?: (src: string, width?: number, height?: number) => void;
54
60
  /**
@@ -61,12 +67,11 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
61
67
  copyLabel?: string;
62
68
  /**
63
69
  * 是否需要自定义图片节点
64
- * @param src 图片地址
65
- * @param width 图片宽度
66
- * @param height 图片高度
67
- * @returns
70
+ * @param imageProps - 图片属性对象
71
+ * @returns React 节点或元素
72
+ * @skip
68
73
  */
69
- renderImage?: (imageProps: any) => React.ReactNode | Element;
74
+ renderImage?: (imageProps: React.ImgHTMLAttributes<HTMLImageElement>) => React.ReactNode | Element;
70
75
  /**
71
76
  * 是否启用打字机效果
72
77
  */
@@ -74,8 +79,14 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
74
79
  /**
75
80
  * 白名单标签列表,这些标签及其内容会作为整体放入打字机队列
76
81
  * @en Whitelist tags that will be put into typewriter queue as a whole
82
+ * @skip
77
83
  */
78
84
  whitelistTags?: string[];
85
+ /**
86
+ * 主题模式
87
+ * @en Theme mode
88
+ */
89
+ theme?: 'light' | 'dark';
79
90
  /**
80
91
  * 是不是需要头部的代码复制区域
81
92
  * @en Tags that will not be put into typewriter queue
@@ -63,13 +63,13 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
63
63
  componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/message").MessageProps>, nextState: Readonly<{}>, nextContext: any): void;
64
64
  UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/message").MessageProps>, nextState: Readonly<{}>, nextContext: any): void;
65
65
  }>>, {}> & {
66
- loading: (config: import("@alifd/next/types/message/types").OpenProps) => void;
66
+ success: (config: import("@alifd/next/types/message/types").OpenProps) => void;
67
67
  warning: (config: import("@alifd/next/types/message/types").OpenProps) => void;
68
68
  error: (config: import("@alifd/next/types/message/types").OpenProps) => void;
69
+ notice: (config: import("@alifd/next/types/message/types").OpenProps) => void;
69
70
  help: (config: import("@alifd/next/types/message/types").OpenProps) => void;
70
- hide: () => void;
71
+ loading: (config: import("@alifd/next/types/message/types").OpenProps) => void;
71
72
  show: (config: import("@alifd/next/types/message/types").OpenProps) => void;
72
- success: (config: import("@alifd/next/types/message/types").OpenProps) => void;
73
- notice: (config: import("@alifd/next/types/message/types").OpenProps) => void;
73
+ hide: () => void;
74
74
  };
75
75
  export default _default;