@alifd/chat 0.3.37-beta.0 → 0.3.37-beta.10

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 (180) hide show
  1. package/es/form/index.d.ts +23 -0
  2. package/es/form/index.js +33 -0
  3. package/es/form/main.scss +5 -0
  4. package/es/form/style.d.ts +1 -0
  5. package/es/form/style.js +1 -0
  6. package/es/form/types.d.ts +518 -0
  7. package/es/html-render/github-markdown-css.css +1168 -0
  8. package/es/html-render/index.js +1 -3
  9. package/es/html-render/main.scss +21 -1
  10. package/es/html-render/utils.d.ts +2 -0
  11. package/es/html-render/utils.js +2 -0
  12. package/es/icon/icon.css +363 -0
  13. package/es/index.js +1 -1
  14. package/es/markdown/index.js +4 -1
  15. package/es/markdown/types.d.ts +5 -0
  16. package/es/reference/index.js +4 -1
  17. package/es/tool-status/index.js +6 -3
  18. package/es/tool-status/main.scss +17 -8
  19. package/es/tool-status/types.d.ts +8 -0
  20. package/lib/form/index.d.ts +23 -0
  21. package/lib/form/index.js +35 -0
  22. package/lib/form/main.scss +5 -0
  23. package/lib/form/style.d.ts +1 -0
  24. package/lib/form/style.js +3 -0
  25. package/lib/form/types.d.ts +518 -0
  26. package/lib/form/types.js +2 -0
  27. package/lib/html-render/github-markdown-css.css +1168 -0
  28. package/lib/html-render/index.js +1 -3
  29. package/lib/html-render/main.scss +21 -1
  30. package/lib/html-render/utils.d.ts +2 -0
  31. package/lib/html-render/utils.js +5 -0
  32. package/lib/icon/icon.css +363 -0
  33. package/lib/index.js +1 -1
  34. package/lib/markdown/index.js +4 -1
  35. package/lib/markdown/types.d.ts +5 -0
  36. package/lib/reference/index.js +4 -1
  37. package/lib/tool-status/index.js +6 -3
  38. package/lib/tool-status/main.scss +17 -8
  39. package/lib/tool-status/types.d.ts +8 -0
  40. package/package.json +3 -2
  41. package/es/ai-loading/__docs__/demo/basic/index.d.ts +0 -8
  42. package/es/ai-loading/__docs__/demo/basic/index.js +0 -16
  43. package/es/balloon/__docs__/demo/basic/index.d.ts +0 -9
  44. package/es/balloon/__docs__/demo/basic/index.js +0 -16
  45. package/es/button/__docs__/demo/size/index.d.ts +0 -8
  46. package/es/button/__docs__/demo/size/index.js +0 -115
  47. package/es/card/__docs__/demo/basic/index.d.ts +0 -11
  48. package/es/card/__docs__/demo/basic/index.js +0 -39
  49. package/es/card/__docs__/demo/demo-legal-affairs/index.d.ts +0 -13
  50. package/es/card/__docs__/demo/demo-legal-affairs/index.js +0 -130
  51. package/es/card-loading/__docs__/demo/basic/index.d.ts +0 -8
  52. package/es/card-loading/__docs__/demo/basic/index.js +0 -13
  53. package/es/checkbox-group/__docs__/demo/basic/index.d.ts +0 -6
  54. package/es/checkbox-group/__docs__/demo/basic/index.js +0 -26
  55. package/es/date-picker/__docs__/demo/basic/index.d.ts +0 -8
  56. package/es/date-picker/__docs__/demo/basic/index.js +0 -13
  57. package/es/drawer/__docs__/demo/basic/index.d.ts +0 -9
  58. package/es/drawer/__docs__/demo/basic/index.js +0 -30
  59. package/es/feedback/__docs__/demo/basic/index.d.ts +0 -8
  60. package/es/feedback/__docs__/demo/basic/index.js +0 -12
  61. package/es/feedback/__docs__/demo/size/index.d.ts +0 -8
  62. package/es/feedback/__docs__/demo/size/index.js +0 -25
  63. package/es/flip/__docs__/demo/basic/index.d.ts +0 -8
  64. package/es/flip/__docs__/demo/basic/index.js +0 -23
  65. package/es/float-button/__docs__/demo/basic/index.d.ts +0 -7
  66. package/es/float-button/__docs__/demo/basic/index.js +0 -104
  67. package/es/html-render/__docs__/demo/basic/index.js +0 -95
  68. package/es/icon/__docs__/demo/basic/index.d.ts +0 -8
  69. package/es/icon/__docs__/demo/basic/index.js +0 -17
  70. package/es/image-preview/__docs__/demo/basic/index.d.ts +0 -8
  71. package/es/image-preview/__docs__/demo/basic/index.js +0 -14
  72. package/es/img/__docs__/demo/basic/index.d.ts +0 -8
  73. package/es/img/__docs__/demo/basic/index.js +0 -44
  74. package/es/input/__docs__/demo/basic/index.d.ts +0 -1
  75. package/es/input/__docs__/demo/basic/index.js +0 -12
  76. package/es/list/__docs__/demo/basic/index.d.ts +0 -8
  77. package/es/list/__docs__/demo/basic/index.js +0 -37
  78. package/es/loading/__docs__/demo/basic/index.d.ts +0 -8
  79. package/es/loading/__docs__/demo/basic/index.js +0 -34
  80. package/es/markdown/__docs__/demo/baisc/index.d.ts +0 -1
  81. package/es/markdown/__docs__/demo/baisc/index.js +0 -243
  82. package/es/message/__docs__/demo/basic/index.d.ts +0 -9
  83. package/es/message/__docs__/demo/basic/index.js +0 -25
  84. package/es/origin/__docs__/demo/basic/index.d.ts +0 -8
  85. package/es/origin/__docs__/demo/basic/index.js +0 -13
  86. package/es/person-picker/__docs__/demo/basic/index.d.ts +0 -8
  87. package/es/person-picker/__docs__/demo/basic/index.js +0 -13
  88. package/es/radio-group/__docs__/demo/basic/index.d.ts +0 -6
  89. package/es/radio-group/__docs__/demo/basic/index.js +0 -26
  90. package/es/recommend/__docs__/demo/basic/index.d.ts +0 -8
  91. package/es/recommend/__docs__/demo/basic/index.js +0 -51
  92. package/es/reference/__docs__/demo/basic/index.d.ts +0 -8
  93. package/es/reference/__docs__/demo/basic/index.js +0 -83
  94. package/es/rich-text-input/__docs__/demo/basic/index.d.ts +0 -8
  95. package/es/rich-text-input/__docs__/demo/basic/index.js +0 -19
  96. package/es/select/__docs__/demo/basic/index.d.ts +0 -1
  97. package/es/select/__docs__/demo/basic/index.js +0 -22
  98. package/es/step/__docs__/demo/basic/index.d.ts +0 -8
  99. package/es/step/__docs__/demo/basic/index.js +0 -29
  100. package/es/stop-generate/__docs__/demo/basic/index.d.ts +0 -8
  101. package/es/stop-generate/__docs__/demo/basic/index.js +0 -53
  102. package/es/tag/__docs__/demo/basic/index.d.ts +0 -8
  103. package/es/tag/__docs__/demo/basic/index.js +0 -16
  104. package/es/text/__docs__/demo/basic/index.d.ts +0 -21
  105. package/es/text/__docs__/demo/basic/index.js +0 -44
  106. package/es/time-picker/__docs__/demo/basic/index.d.ts +0 -8
  107. package/es/time-picker/__docs__/demo/basic/index.js +0 -13
  108. package/es/tool-status/__docs__/demo/basic/index.d.ts +0 -8
  109. package/es/tool-status/__docs__/demo/basic/index.js +0 -53
  110. package/lib/ai-loading/__docs__/demo/basic/index.d.ts +0 -8
  111. package/lib/ai-loading/__docs__/demo/basic/index.js +0 -19
  112. package/lib/balloon/__docs__/demo/basic/index.d.ts +0 -9
  113. package/lib/balloon/__docs__/demo/basic/index.js +0 -19
  114. package/lib/button/__docs__/demo/size/index.d.ts +0 -8
  115. package/lib/button/__docs__/demo/size/index.js +0 -118
  116. package/lib/card/__docs__/demo/basic/index.d.ts +0 -11
  117. package/lib/card/__docs__/demo/basic/index.js +0 -42
  118. package/lib/card/__docs__/demo/demo-legal-affairs/index.d.ts +0 -13
  119. package/lib/card/__docs__/demo/demo-legal-affairs/index.js +0 -133
  120. package/lib/card-loading/__docs__/demo/basic/index.d.ts +0 -8
  121. package/lib/card-loading/__docs__/demo/basic/index.js +0 -16
  122. package/lib/checkbox-group/__docs__/demo/basic/index.d.ts +0 -6
  123. package/lib/checkbox-group/__docs__/demo/basic/index.js +0 -29
  124. package/lib/date-picker/__docs__/demo/basic/index.d.ts +0 -8
  125. package/lib/date-picker/__docs__/demo/basic/index.js +0 -16
  126. package/lib/drawer/__docs__/demo/basic/index.d.ts +0 -9
  127. package/lib/drawer/__docs__/demo/basic/index.js +0 -33
  128. package/lib/feedback/__docs__/demo/basic/index.d.ts +0 -8
  129. package/lib/feedback/__docs__/demo/basic/index.js +0 -15
  130. package/lib/feedback/__docs__/demo/size/index.d.ts +0 -8
  131. package/lib/feedback/__docs__/demo/size/index.js +0 -28
  132. package/lib/flip/__docs__/demo/basic/index.d.ts +0 -8
  133. package/lib/flip/__docs__/demo/basic/index.js +0 -26
  134. package/lib/float-button/__docs__/demo/basic/index.d.ts +0 -7
  135. package/lib/float-button/__docs__/demo/basic/index.js +0 -107
  136. package/lib/html-render/__docs__/demo/basic/index.d.ts +0 -1
  137. package/lib/html-render/__docs__/demo/basic/index.js +0 -98
  138. package/lib/icon/__docs__/demo/basic/index.d.ts +0 -8
  139. package/lib/icon/__docs__/demo/basic/index.js +0 -20
  140. package/lib/image-preview/__docs__/demo/basic/index.d.ts +0 -8
  141. package/lib/image-preview/__docs__/demo/basic/index.js +0 -17
  142. package/lib/img/__docs__/demo/basic/index.d.ts +0 -8
  143. package/lib/img/__docs__/demo/basic/index.js +0 -47
  144. package/lib/input/__docs__/demo/basic/index.d.ts +0 -1
  145. package/lib/input/__docs__/demo/basic/index.js +0 -15
  146. package/lib/list/__docs__/demo/basic/index.d.ts +0 -8
  147. package/lib/list/__docs__/demo/basic/index.js +0 -40
  148. package/lib/loading/__docs__/demo/basic/index.d.ts +0 -8
  149. package/lib/loading/__docs__/demo/basic/index.js +0 -37
  150. package/lib/markdown/__docs__/demo/baisc/index.d.ts +0 -1
  151. package/lib/markdown/__docs__/demo/baisc/index.js +0 -246
  152. package/lib/message/__docs__/demo/basic/index.d.ts +0 -9
  153. package/lib/message/__docs__/demo/basic/index.js +0 -28
  154. package/lib/origin/__docs__/demo/basic/index.d.ts +0 -8
  155. package/lib/origin/__docs__/demo/basic/index.js +0 -16
  156. package/lib/person-picker/__docs__/demo/basic/index.d.ts +0 -8
  157. package/lib/person-picker/__docs__/demo/basic/index.js +0 -16
  158. package/lib/radio-group/__docs__/demo/basic/index.d.ts +0 -6
  159. package/lib/radio-group/__docs__/demo/basic/index.js +0 -29
  160. package/lib/recommend/__docs__/demo/basic/index.d.ts +0 -8
  161. package/lib/recommend/__docs__/demo/basic/index.js +0 -54
  162. package/lib/reference/__docs__/demo/basic/index.d.ts +0 -8
  163. package/lib/reference/__docs__/demo/basic/index.js +0 -86
  164. package/lib/rich-text-input/__docs__/demo/basic/index.d.ts +0 -8
  165. package/lib/rich-text-input/__docs__/demo/basic/index.js +0 -22
  166. package/lib/select/__docs__/demo/basic/index.d.ts +0 -1
  167. package/lib/select/__docs__/demo/basic/index.js +0 -25
  168. package/lib/step/__docs__/demo/basic/index.d.ts +0 -8
  169. package/lib/step/__docs__/demo/basic/index.js +0 -32
  170. package/lib/stop-generate/__docs__/demo/basic/index.d.ts +0 -8
  171. package/lib/stop-generate/__docs__/demo/basic/index.js +0 -56
  172. package/lib/tag/__docs__/demo/basic/index.d.ts +0 -8
  173. package/lib/tag/__docs__/demo/basic/index.js +0 -19
  174. package/lib/text/__docs__/demo/basic/index.d.ts +0 -21
  175. package/lib/text/__docs__/demo/basic/index.js +0 -47
  176. package/lib/time-picker/__docs__/demo/basic/index.d.ts +0 -8
  177. package/lib/time-picker/__docs__/demo/basic/index.js +0 -16
  178. package/lib/tool-status/__docs__/demo/basic/index.d.ts +0 -8
  179. package/lib/tool-status/__docs__/demo/basic/index.js +0 -56
  180. /package/es/{html-render/__docs__/demo/basic/index.d.ts → form/types.js} +0 -0
@@ -20,8 +20,6 @@ const copy_to_clipboard_1 = tslib_1.__importDefault(require("copy-to-clipboard")
20
20
  const next_2 = require("@alifd/next");
21
21
  const balloon_1 = tslib_1.__importDefault(require("../balloon"));
22
22
  require("../balloon/style");
23
- const IMAGE_MAX_HEIGHT = 222;
24
- const IMAGE_MAX_WIDTH = 372;
25
23
  const sanitizeHtmlOptions = {
26
24
  allowedTags: sanitize_html_1.default.defaults.allowedTags.concat([
27
25
  'acronym', 'audio', 'big', 'center', 'del', 'dir', 'font',
@@ -199,7 +197,7 @@ const HTMLRenderer = (0, react_1.memo)(function HTMLRenderer({ className, childr
199
197
  indexRef.current = 0;
200
198
  return (0, html_react_parser_1.default)((0, sanitize_html_1.default)(children || '', sanitizeHtmlOptions), parserOptions);
201
199
  }, [children, typewriterEffect]);
202
- return (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}html`, className, {
200
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(`markdown-body ${utils_1.PREFIX_DEFAULT}html`, className, {
203
201
  'loose': loose,
204
202
  }) }, imagePreview ?
205
203
  react_1.default.createElement(react_photo_view_1.PhotoProvider, null, element)
@@ -1,4 +1,6 @@
1
1
  @import "../core/variables.scss";
2
+ // @import "./github-markdown-css.css";
3
+ // @import "github-markdown-css/github-markdown-light.css";
2
4
 
3
5
  .#{$prefix}html {
4
6
  font-size: 14px;
@@ -27,6 +29,7 @@
27
29
  }
28
30
  }
29
31
 
32
+
30
33
  img {
31
34
  body.global-dark & {
32
35
  background: $color-bg-1;
@@ -57,6 +60,7 @@
57
60
  h1 {
58
61
  font-size: 18px;
59
62
  line-height: 1.8;
63
+ margin: 0.5rem 0;
60
64
 
61
65
  &.loose {
62
66
  font-size: 28px;
@@ -66,6 +70,7 @@
66
70
  h2 {
67
71
  font-size: 16px;
68
72
  line-height: 1.8;
73
+ margin: 0.5rem 0;
69
74
 
70
75
  &.loose {
71
76
  font-size: 24px;
@@ -74,7 +79,7 @@
74
79
 
75
80
  h3, h4, h5, h6 {
76
81
  font-size: 14px;
77
- line-height: 1.9;
82
+ line-height: 2;
78
83
  }
79
84
 
80
85
  h3 {
@@ -202,6 +207,21 @@
202
207
 
203
208
  li {
204
209
  list-style: revert;
210
+ line-height: 1.8;
211
+ }
212
+
213
+ li>p {
214
+ margin: 0.3rem 0;
215
+ }
216
+
217
+ p {
218
+ margin: 0.3rem 0;
219
+ line-height: 1.8;
220
+ }
221
+
222
+ span {
223
+ line-height: 1.8;
224
+ margin: 0.3rem 0;
205
225
  }
206
226
 
207
227
  blockquote {
@@ -0,0 +1,2 @@
1
+ export declare const isDingTalk: boolean;
2
+ export declare const isMobile: boolean;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isMobile = exports.isDingTalk = void 0;
4
+ exports.isDingTalk = !!navigator.userAgent.match(/DingTalk/i);
5
+ exports.isMobile = /HarmonyOS|ArkWeb|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent);
@@ -0,0 +1,363 @@
1
+ .next-sr-only {
2
+ position: absolute;
3
+ width: 1px;
4
+ height: 1px;
5
+ padding: 0;
6
+ overflow: hidden;
7
+ clip: rect(0, 0, 0, 0);
8
+ white-space: nowrap;
9
+ border: 0;
10
+ top: 0;
11
+ margin: -1px;
12
+ }
13
+
14
+ .next-icon[dir=rtl]::before {
15
+ transform: rotateY(180deg);
16
+ }
17
+
18
+ @font-face {
19
+ font-family: ChatNextIcon;
20
+ src: url("//at.alicdn.com/t/font_515771_xjdbujl2iu.eot");
21
+ src: url("//at.alicdn.com/t/font_515771_xjdbujl2iu.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.woff2") format("woff2"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.woff") format("woff"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.ttf") format("truetype"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.svg#NextIcon") format("svg");
22
+ font-display: swap;
23
+ }
24
+
25
+ .ct-icon {
26
+ font-family: ChatNextIcon !important;
27
+ }
28
+
29
+ .next-icon {
30
+ display: inline-block;
31
+ font-family: NextIcon;
32
+ font-style: normal;
33
+ font-weight: normal;
34
+ text-transform: none;
35
+ -webkit-font-smoothing: antialiased;
36
+ -moz-osx-font-smoothing: grayscale;
37
+ }
38
+
39
+ .next-icon:before {
40
+ display: inline-block;
41
+ vertical-align: middle;
42
+ text-align: center;
43
+ }
44
+ .next-icon-smile:before {
45
+ content: "\e65f";
46
+ content: var(--icon-content-smile, "\e65f");
47
+ }
48
+ .next-icon-cry:before {
49
+ content: "\e65d";
50
+ content: var(--icon-content-cry, "\e65d");
51
+ }
52
+ .next-icon-success:before {
53
+ content: "\e60a";
54
+ content: var(--icon-content-success, "\e60a");
55
+ }
56
+ .next-icon-warning:before {
57
+ content: "\e60b";
58
+ content: var(--icon-content-warning, "\e60b");
59
+ }
60
+ .next-icon-prompt:before {
61
+ content: "\e60c";
62
+ content: var(--icon-content-prompt, "\e60c");
63
+ }
64
+ .next-icon-error:before {
65
+ content: "\e60d";
66
+ content: var(--icon-content-error, "\e60d");
67
+ }
68
+ .next-icon-help:before {
69
+ content: "\e673";
70
+ content: var(--icon-content-help, "\e673");
71
+ }
72
+ .next-icon-clock:before {
73
+ content: "\e621";
74
+ content: var(--icon-content-clock, "\e621");
75
+ }
76
+ .next-icon-success-filling:before {
77
+ content: "\e63a";
78
+ content: var(--icon-content-success-filling, "\e63a");
79
+ }
80
+ .next-icon-delete-filling:before {
81
+ content: "\e623";
82
+ content: var(--icon-content-delete-filling, "\e623");
83
+ }
84
+ .next-icon-favorites-filling:before {
85
+ content: "\e60e";
86
+ content: var(--icon-content-favorites-filling, "\e60e");
87
+ }
88
+ .next-icon-add:before {
89
+ content: "\e655";
90
+ content: var(--icon-content-add, "\e655");
91
+ }
92
+ .next-icon-minus:before {
93
+ content: "\e601";
94
+ content: var(--icon-content-minus, "\e601");
95
+ }
96
+ .next-icon-arrow-up:before {
97
+ content: "\e625";
98
+ content: var(--icon-content-arrow-up, "\e625");
99
+ }
100
+ .next-icon-arrow-down:before {
101
+ content: "\e63d";
102
+ content: var(--icon-content-arrow-down, "\e63d");
103
+ }
104
+ .next-icon-arrow-left:before {
105
+ content: "\e61d";
106
+ content: var(--icon-content-arrow-left, "\e61d");
107
+ }
108
+ .next-icon-arrow-right:before {
109
+ content: "\e619";
110
+ content: var(--icon-content-arrow-right, "\e619");
111
+ }
112
+ .next-icon-arrow-double-left:before {
113
+ content: "\e659";
114
+ content: var(--icon-content-arrow-double-left, "\e659");
115
+ }
116
+ .next-icon-arrow-double-right:before {
117
+ content: "\e65e";
118
+ content: var(--icon-content-arrow-double-right, "\e65e");
119
+ }
120
+ .next-icon-switch:before {
121
+ content: "\e6b3";
122
+ content: var(--icon-content-switch, "\e6b3");
123
+ }
124
+ .next-icon-sorting:before {
125
+ content: "\e634";
126
+ content: var(--icon-content-sorting, "\e634");
127
+ }
128
+ .next-icon-descending:before {
129
+ content: "\e61f";
130
+ content: var(--icon-content-descending, "\e61f");
131
+ }
132
+ .next-icon-ascending:before {
133
+ content: "\e61e";
134
+ content: var(--icon-content-ascending, "\e61e");
135
+ }
136
+ .next-icon-select:before {
137
+ content: "\e632";
138
+ content: var(--icon-content-select, "\e632");
139
+ }
140
+ .next-icon-semi-select:before {
141
+ content: "\e633";
142
+ content: var(--icon-content-semi-select, "\e633");
143
+ }
144
+ .next-icon-search:before {
145
+ content: "\e656";
146
+ content: var(--icon-content-search, "\e656");
147
+ }
148
+ .next-icon-close:before {
149
+ content: "\e626";
150
+ content: var(--icon-content-close, "\e626");
151
+ }
152
+ .next-icon-ellipsis:before {
153
+ content: "\e654";
154
+ content: var(--icon-content-ellipsis, "\e654");
155
+ }
156
+ .next-icon-picture:before {
157
+ content: "\e631";
158
+ content: var(--icon-content-picture, "\e631");
159
+ }
160
+ .next-icon-calendar:before {
161
+ content: "\e607";
162
+ content: var(--icon-content-calendar, "\e607");
163
+ }
164
+ .next-icon-ashbin:before {
165
+ content: "\e639";
166
+ content: var(--icon-content-ashbin, "\e639");
167
+ }
168
+ .next-icon-upload:before {
169
+ content: "\e7ee";
170
+ content: var(--icon-content-upload, "\e7ee");
171
+ }
172
+ .next-icon-download:before {
173
+ content: "\e628";
174
+ content: var(--icon-content-download, "\e628");
175
+ }
176
+ .next-icon-set:before {
177
+ content: "\e683";
178
+ content: var(--icon-content-set, "\e683");
179
+ }
180
+ .next-icon-edit:before {
181
+ content: "\e63b";
182
+ content: var(--icon-content-edit, "\e63b");
183
+ }
184
+ .next-icon-refresh:before {
185
+ content: "\e677";
186
+ content: var(--icon-content-refresh, "\e677");
187
+ }
188
+ .next-icon-filter:before {
189
+ content: "\e627";
190
+ content: var(--icon-content-filter, "\e627");
191
+ }
192
+ .next-icon-attachment:before {
193
+ content: "\e665";
194
+ content: var(--icon-content-attachment, "\e665");
195
+ }
196
+ .next-icon-account:before {
197
+ content: "\e608";
198
+ content: var(--icon-content-account, "\e608");
199
+ }
200
+ .next-icon-email:before {
201
+ content: "\e605";
202
+ content: var(--icon-content-email, "\e605");
203
+ }
204
+ .next-icon-atm:before {
205
+ content: "\e606";
206
+ content: var(--icon-content-atm, "\e606");
207
+ }
208
+ .next-icon-loading:before {
209
+ content: "\e646";
210
+ content: var(--icon-content-loading, "\e646");
211
+ animation: loadingCircle 1s infinite linear;
212
+ }
213
+ .next-icon-eye:before {
214
+ content: "\e611";
215
+ content: var(--icon-content-eye, "\e611");
216
+ }
217
+ .next-icon-copy:before {
218
+ content: "\e60f";
219
+ content: var(--icon-content-copy, "\e60f");
220
+ }
221
+ .next-icon-toggle-left:before {
222
+ content: "\e602";
223
+ content: var(--icon-content-toggle-left, "\e602");
224
+ }
225
+ .next-icon-toggle-right:before {
226
+ content: "\e603";
227
+ content: var(--icon-content-toggle-right, "\e603");
228
+ }
229
+ .next-icon-eye-close:before {
230
+ content: "\e600";
231
+ content: var(--icon-content-eye-close, "\e600");
232
+ }
233
+ .next-icon-unlock:before {
234
+ content: "\e615";
235
+ content: var(--icon-content-unlock, "\e615");
236
+ }
237
+ .next-icon-lock:before {
238
+ content: "\e617";
239
+ content: var(--icon-content-lock, "\e617");
240
+ }
241
+ .next-icon-exit:before {
242
+ content: "\e616";
243
+ content: var(--icon-content-exit, "\e616");
244
+ }
245
+ .next-icon-chart-bar:before {
246
+ content: "\e612";
247
+ content: var(--icon-content-chart-bar, "\e612");
248
+ }
249
+ .next-icon-chart-pie:before {
250
+ content: "\e613";
251
+ content: var(--icon-content-chart-pie, "\e613");
252
+ }
253
+ .next-icon-form:before {
254
+ content: "\e7fb";
255
+ content: var(--icon-content-form, "\e7fb");
256
+ }
257
+ .next-icon-detail:before {
258
+ content: "\e7f8";
259
+ content: var(--icon-content-detail, "\e7f8");
260
+ }
261
+ .next-icon-list:before {
262
+ content: "\e7f9";
263
+ content: var(--icon-content-list, "\e7f9");
264
+ }
265
+ .next-icon-dashboard:before {
266
+ content: "\e7fa";
267
+ content: var(--icon-content-dashboard, "\e7fa");
268
+ }
269
+
270
+ @keyframes loadingCircle {
271
+ 0% {
272
+ transform-origin: 50% 50%;
273
+ transform: rotate(0deg);
274
+ }
275
+ 100% {
276
+ transform-origin: 50% 50%;
277
+ transform: rotate(360deg);
278
+ }
279
+ }
280
+ .next-icon.next-xxs:before, .next-icon.next-xxs .next-icon-remote {
281
+ width: 8px;
282
+ width: var(--icon-xxs, 8px);
283
+ font-size: 8px;
284
+ font-size: var(--icon-xxs, 8px);
285
+ line-height: inherit;
286
+ }
287
+ @media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
288
+ .next-icon.next-xxs {
289
+ transform: scale(0.5);
290
+ margin-left: -4px;
291
+ margin-left: calc(0px - var(--icon-s, 16px)/2 + var(--icon-xxs, 8px)/2);
292
+ margin-right: -4px;
293
+ margin-right: calc(0px - var(--icon-s, 16px)/2 + var(--icon-xxs, 8px)/2);
294
+ }
295
+ .next-icon.next-xxs:before {
296
+ width: 16px;
297
+ width: var(--icon-s, 16px);
298
+ font-size: 16px;
299
+ font-size: var(--icon-s, 16px);
300
+ }
301
+ }
302
+ .next-icon.next-xs:before, .next-icon.next-xs .next-icon-remote {
303
+ width: 12px;
304
+ width: var(--icon-xs, 12px);
305
+ font-size: 12px;
306
+ font-size: var(--icon-xs, 12px);
307
+ line-height: inherit;
308
+ }
309
+ .next-icon.next-small:before, .next-icon.next-small .next-icon-remote {
310
+ width: 16px;
311
+ width: var(--icon-s, 16px);
312
+ font-size: 16px;
313
+ font-size: var(--icon-s, 16px);
314
+ line-height: inherit;
315
+ }
316
+ .next-icon.next-medium:before, .next-icon.next-medium .next-icon-remote {
317
+ width: 20px;
318
+ width: var(--icon-m, 20px);
319
+ font-size: 20px;
320
+ font-size: var(--icon-m, 20px);
321
+ line-height: inherit;
322
+ }
323
+ .next-icon.next-large:before, .next-icon.next-large .next-icon-remote {
324
+ width: 24px;
325
+ width: var(--icon-l, 24px);
326
+ font-size: 24px;
327
+ font-size: var(--icon-l, 24px);
328
+ line-height: inherit;
329
+ }
330
+ .next-icon.next-xl:before, .next-icon.next-xl .next-icon-remote {
331
+ width: 32px;
332
+ width: var(--icon-xl, 32px);
333
+ font-size: 32px;
334
+ font-size: var(--icon-xl, 32px);
335
+ line-height: inherit;
336
+ }
337
+ .next-icon.next-xxl:before, .next-icon.next-xxl .next-icon-remote {
338
+ width: 48px;
339
+ width: var(--icon-xxl, 48px);
340
+ font-size: 48px;
341
+ font-size: var(--icon-xxl, 48px);
342
+ line-height: inherit;
343
+ }
344
+ .next-icon.next-xxxl:before, .next-icon.next-xxxl .next-icon-remote {
345
+ width: 64px;
346
+ width: var(--icon-xxxl, 64px);
347
+ font-size: 64px;
348
+ font-size: var(--icon-xxxl, 64px);
349
+ line-height: inherit;
350
+ }
351
+ .next-icon.next-inherit:before, .next-icon.next-inherit .next-icon-remote {
352
+ width: inherit;
353
+ font-size: inherit;
354
+ line-height: inherit;
355
+ }
356
+
357
+ .next-icon.next-inherit .next-icon-remote,
358
+ .next-icon .next-icon-remote {
359
+ width: 1em;
360
+ height: 1em;
361
+ vertical-align: middle;
362
+ fill: currentColor;
363
+ }
package/lib/index.js CHANGED
@@ -70,4 +70,4 @@ var flip_1 = require("./flip");
70
70
  Object.defineProperty(exports, "Flip", { enumerable: true, get: function () { return tslib_1.__importDefault(flip_1).default; } });
71
71
  var tool_status_1 = require("./tool-status");
72
72
  Object.defineProperty(exports, "ToolStatus", { enumerable: true, get: function () { return tslib_1.__importDefault(tool_status_1).default; } });
73
- exports.version = '0.3.37-beta.0';
73
+ exports.version = '0.3.37-beta.10';
@@ -22,7 +22,7 @@ const DEFAULT_WHITELIST_TAGS = ['img', 'code', 'pre', 'link-reference'];
22
22
  * @when 需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content.
23
23
  */
24
24
  const Markdown = (0, react_1.forwardRef)((_a, ref) => {
25
- var { className, onReady, content } = _a, others = tslib_1.__rest(_a, ["className", "onReady", "content"]);
25
+ var { className, onReady, content, needCodeHeader = true } = _a, others = tslib_1.__rest(_a, ["className", "onReady", "content", "needCodeHeader"]);
26
26
  (0, react_1.useEffect)(() => {
27
27
  // 初始化表情库
28
28
  (0, dingtalk_im_emoji_1.init)();
@@ -228,6 +228,9 @@ const Markdown = (0, react_1.forwardRef)((_a, ref) => {
228
228
  return md.render(transformedContent);
229
229
  }, [transformedContent]);
230
230
  (0, react_1.useEffect)(() => {
231
+ if (!needCodeHeader) {
232
+ return;
233
+ }
231
234
  if (containerRef.current) {
232
235
  // 清除现有的 .code-block-header 元素
233
236
  const existingHeaders = containerRef.current.querySelectorAll('.code-block-header');
@@ -76,4 +76,9 @@ export interface MarkdownProps extends React.HTMLAttributes<HTMLElement> {
76
76
  * @en Whitelist tags that will be put into typewriter queue as a whole
77
77
  */
78
78
  whitelistTags?: string[];
79
+ /**
80
+ * 是不是需要头部的代码复制区域
81
+ * @en Tags that will not be put into typewriter queue
82
+ */
83
+ needCodeHeader?: boolean;
79
84
  }
@@ -77,7 +77,10 @@ const Reference = (0, react_1.forwardRef)(({ className, defaultExpanded = false,
77
77
  };
78
78
  const handleReferenceClick = (item, index, event) => {
79
79
  event.stopPropagation();
80
- onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, index);
80
+ if (onItemClick) {
81
+ onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, index);
82
+ return;
83
+ }
81
84
  (item === null || item === void 0 ? void 0 : item.url) && window.open(item === null || item === void 0 ? void 0 : item.url, '_blank');
82
85
  };
83
86
  const renderDetailList = () => {
@@ -16,7 +16,7 @@ const SUCCESS_ICON = 'icon-check'; //'success'
16
16
  const ERROR_ICON = 'icon-cross1'; //'error'
17
17
  const LOADING_ICON = 'loading';
18
18
  const ToolStatus = (0, react_1.forwardRef)((props, ref) => {
19
- const { useText = '使用', name, className, selected = false, status, onToolClick, authInfo, fullWidth } = props;
19
+ const { useText = '使用', name, className, selected = false, status, onToolClick, authInfo, fullWidth, param, groupName } = props;
20
20
  const handleClick = (event) => {
21
21
  event.stopPropagation();
22
22
  onToolClick === null || onToolClick === void 0 ? void 0 : onToolClick(props);
@@ -33,8 +33,11 @@ const ToolStatus = (0, react_1.forwardRef)((props, ref) => {
33
33
  event.stopPropagation();
34
34
  (_a = authInfo === null || authInfo === void 0 ? void 0 : authInfo.onAuthClick) === null || _a === void 0 ? void 0 : _a.call(authInfo, props);
35
35
  } }, authInfo === null || authInfo === void 0 ? void 0 : authInfo.content),
36
- react_1.default.createElement("div", { className: 'content-use-tips' }, useText),
37
- react_1.default.createElement("div", { className: 'content-name' }, name)));
36
+ react_1.default.createElement("div", { className: 'content-container' },
37
+ react_1.default.createElement("div", { className: 'content-use-tips' }, useText),
38
+ groupName && react_1.default.createElement("div", { className: 'content-group' }, groupName),
39
+ name && react_1.default.createElement("div", { className: 'content-name' }, name),
40
+ param && react_1.default.createElement("div", { className: 'content-detail' }, param))));
38
41
  });
39
42
  tslib_1.__exportStar(require("./types"), exports);
40
43
  exports.default = next_1.ConfigProvider.config(ToolStatus);
@@ -54,22 +54,31 @@
54
54
  line-height: $s-4;
55
55
  font-size: $font-size-caption;
56
56
  cursor: pointer;
57
- margin-right: $s-1;
57
+ min-width: 52px;
58
58
  }
59
59
 
60
- .content-use-tips {
61
- color: $color-text1-3;
62
- margin-right: $s-1;
63
- line-height: $s-4;
60
+ .content-container {
61
+ flex: 1;
62
+ display: flex;
63
+ overflow: hidden;
64
64
  }
65
65
 
66
- .content-name {
67
- color: $color-text1-4;
66
+ .content-use-tips, .content-group, .content-name, .content-detail {
67
+ color: $color-text1-3;
68
68
  line-height: $s-4;
69
+ margin-right: $s-1;
69
70
  overflow: hidden;
70
71
  white-space: nowrap;
71
72
  text-overflow: ellipsis;
72
- flex: 1;
73
73
  }
74
74
 
75
+
76
+ .content-group {
77
+ color: $color-text1-4;
78
+ }
79
+
80
+ .content-detail {
81
+ flex: 1;
82
+ color: $color-text1-4;
83
+ }
75
84
  }
@@ -33,10 +33,18 @@ export interface ToolStatusProps extends React.HTMLAttributes<HTMLElement>, Comm
33
33
  * 工具名称
34
34
  */
35
35
  name?: string;
36
+ /**
37
+ * 工具集名称
38
+ */
39
+ groupName?: string;
36
40
  /**
37
41
  * 工具详情链接
38
42
  */
39
43
  useText?: string;
44
+ /**
45
+ * 当前的具体使用说明
46
+ */
47
+ param?: string;
40
48
  /**
41
49
  * 是否100%的宽度
42
50
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.3.37-beta.0",
3
+ "version": "0.3.37-beta.10",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -564,7 +564,8 @@
564
564
  "react-copy-to-clipboard": "^5.1.0",
565
565
  "react-photo-view": "^1.2.6",
566
566
  "sanitize-html": "~2.7.3",
567
- "tslib": "^2.6.2"
567
+ "tslib": "^2.6.2",
568
+ "github-markdown-css": "^5.0.1"
568
569
  },
569
570
  "sideEffects": [
570
571
  "es/**/style.js",
@@ -1,8 +0,0 @@
1
- /**
2
- * @demo 基本使用
3
- * @en Basic
4
- * @order 1
5
- * @remarks ai-loading 加载动画组件的基本用法。
6
- * - Basic usage of `ai-loading`
7
- */
8
- import '@alifd/chat/es/ai-loading/style';
@@ -1,16 +0,0 @@
1
- /**
2
- * @demo 基本使用
3
- * @en Basic
4
- * @order 1
5
- * @remarks ai-loading 加载动画组件的基本用法。
6
- * - Basic usage of `ai-loading`
7
- */
8
- import React from 'react';
9
- import ReactDOM from 'react-dom';
10
- import { AILoading } from '@alifd/chat';
11
- import '@alifd/chat/es/ai-loading/style';
12
- ReactDOM.render(React.createElement("div", { className: "origin-basic-demo" },
13
- React.createElement("div", { style: {
14
- width: '500px',
15
- } },
16
- React.createElement(AILoading, null))), mountNode);
@@ -1,9 +0,0 @@
1
- /**
2
- * @demo 类型
3
- * @en Style Type
4
- * @order 0
5
- * @remarks 常见气泡使用类型
6
- * - Common types of Balloon.
7
- */
8
- import '@alifd/chat/es/button/style';
9
- import '@alifd/chat/es/balloon/style';
@@ -1,16 +0,0 @@
1
- /**
2
- * @demo 类型
3
- * @en Style Type
4
- * @order 0
5
- * @remarks 常见气泡使用类型
6
- * - Common types of Balloon.
7
- */
8
- import React from 'react';
9
- import ReactDOM from 'react-dom';
10
- import { Button, Balloon } from '@alifd/chat';
11
- import '@alifd/chat/es/button/style';
12
- import '@alifd/chat/es/balloon/style';
13
- const Demo = () => (React.createElement("div", { className: "balloon-container" },
14
- React.createElement(Balloon, { v2: true, triggerType: "click", title: "Balloon Title", trigger: React.createElement(Button, { type: "secondary", size: "medium" }, "Default"), align: "br" }, "First performed around 1600, Hamlet tells the story of a prince whose duty to revenge his father's death entangles him in philosophical problems he can't solve."),
15
- React.createElement(Balloon, { v2: true, type: "primary", triggerType: "click", title: "Balloon Title", trigger: React.createElement(Button, { type: "primary", size: "medium" }, "Primary"), align: "br", closable: false }, "First performed around 1600, Hamlet tells the story of a prince whose duty to revenge his father's death entangles him in philosophical problems he can't solve.")));
16
- ReactDOM.render(React.createElement(Demo, null), mountNode);
@@ -1,8 +0,0 @@
1
- /**
2
- * @demo 按钮尺寸
3
- * @en Size
4
- * @order 1
5
- * @remarks 可以通过设置 `size` 属性控制按钮的尺寸,可选值为 `large` `medium` `small`,其中默认值为 `medium`。
6
- * - The size of a Button is controlled by a `size` attribute, supporting `large`, `medium`, `small`, the default value is `medium`.
7
- */
8
- import '@alifd/chat/es/button/style';