one-design-next 0.0.4-alpha.99 → 0.0.5

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 (415) hide show
  1. package/README.md +154 -84
  2. package/dist/_genui-types.d.ts +106 -0
  3. package/dist/_genui-types.js +1 -0
  4. package/dist/action-bar/index.d.ts +17 -0
  5. package/dist/action-bar/index.js +164 -0
  6. package/dist/action-bar/style/index.css +97 -0
  7. package/dist/action-bar/style/index.d.ts +2 -0
  8. package/dist/action-bar/style/index.js +2 -0
  9. package/dist/agent-step/index.d.ts +38 -0
  10. package/dist/agent-step/index.js +321 -0
  11. package/dist/agent-step/style/index.css +301 -0
  12. package/dist/agent-step/style/index.d.ts +2 -0
  13. package/dist/agent-step/style/index.js +2 -0
  14. package/dist/agent-think/CircleIcon.d.ts +7 -0
  15. package/dist/agent-think/CircleIcon.js +35 -0
  16. package/dist/agent-think/JellyTriangleIcon.d.ts +7 -0
  17. package/dist/agent-think/JellyTriangleIcon.js +42 -0
  18. package/dist/agent-think/ThinkingDoneIcon.d.ts +7 -0
  19. package/dist/agent-think/ThinkingDoneIcon.js +59 -0
  20. package/dist/agent-think/ThinkingIcon.d.ts +7 -0
  21. package/dist/agent-think/ThinkingIcon.js +67 -0
  22. package/dist/agent-think/index.d.ts +16 -0
  23. package/dist/agent-think/index.js +176 -0
  24. package/dist/agent-think/style/index.css +469 -0
  25. package/dist/agent-think/style/index.d.ts +2 -0
  26. package/dist/agent-think/style/index.js +2 -0
  27. package/dist/alert/style/index.css +155 -140
  28. package/dist/attachments/index.d.ts +16 -0
  29. package/dist/attachments/index.js +303 -0
  30. package/dist/attachments/style/index.css +335 -0
  31. package/dist/attachments/style/index.d.ts +2 -0
  32. package/dist/attachments/style/index.js +2 -0
  33. package/dist/avatar/index.d.ts +6 -3
  34. package/dist/avatar/primitive.d.ts +2 -2
  35. package/dist/avatar/primitive.js +1 -1
  36. package/dist/avatar/style/index.css +74 -69
  37. package/dist/button/style/index.css +250 -241
  38. package/dist/calendar/style/index.css +2 -4
  39. package/dist/card/style/index.css +142 -118
  40. package/dist/cascader/style/index.css +463 -398
  41. package/dist/chart/style/index.css +0 -1
  42. package/dist/chat-item/index.d.ts +21 -0
  43. package/dist/chat-item/index.js +163 -0
  44. package/dist/chat-item/style/index.css +192 -0
  45. package/dist/chat-item/style/index.d.ts +2 -0
  46. package/dist/chat-item/style/index.js +2 -0
  47. package/dist/checkbox/Checkbox.d.ts +2 -2
  48. package/dist/checkbox/Context.d.ts +2 -2
  49. package/dist/checkbox/Group.d.ts +2 -2
  50. package/dist/checkbox/style/index.css +282 -266
  51. package/dist/code-block/index.d.ts +8 -0
  52. package/dist/code-block/index.js +73 -0
  53. package/dist/code-block/style/index.css +66 -0
  54. package/dist/code-block/style/index.d.ts +2 -0
  55. package/dist/code-block/style/index.js +2 -0
  56. package/dist/collapse/primitive.d.ts +17 -6
  57. package/dist/collapse/primitive.js +89 -36
  58. package/dist/collapse/style/index.css +68 -53
  59. package/dist/color-picker/style/index.css +148 -130
  60. package/dist/composer/index.d.ts +67 -0
  61. package/dist/composer/index.js +462 -0
  62. package/dist/composer/style/index.css +274 -0
  63. package/dist/composer/style/index.d.ts +2 -0
  64. package/dist/composer/style/index.js +2 -0
  65. package/dist/config-provider/index.d.ts +2 -2
  66. package/dist/date-picker/style/index.css +538 -470
  67. package/dist/dialog/index.js +4 -11
  68. package/dist/dialog/style/index.css +238 -204
  69. package/dist/drawer/index.js +3 -10
  70. package/dist/drawer/style/index.css +271 -229
  71. package/dist/dropdown/index.d.ts +33 -16
  72. package/dist/dropdown/index.js +168 -91
  73. package/dist/dropdown/style/index.css +233 -204
  74. package/dist/ellipsis-text/style/index.css +0 -1
  75. package/dist/empty/style/index.css +67 -61
  76. package/dist/error-block/index.d.ts +12 -0
  77. package/dist/error-block/index.js +24 -0
  78. package/dist/error-block/style/index.css +39 -0
  79. package/dist/error-block/style/index.d.ts +2 -0
  80. package/dist/error-block/style/index.js +2 -0
  81. package/dist/fab/index.d.ts +16 -0
  82. package/dist/fab/index.js +154 -0
  83. package/dist/fab/style/index.css +66 -0
  84. package/dist/fab/style/index.d.ts +2 -0
  85. package/dist/fab/style/index.js +2 -0
  86. package/dist/form/style/index.css +83 -75
  87. package/dist/hover-fill/index.js +39 -15
  88. package/dist/hover-fill/style/index.css +29 -28
  89. package/dist/icon/index.d.ts +8 -3
  90. package/dist/icon/index.js +14 -7
  91. package/dist/icon/style/index.css +13 -13
  92. package/dist/icon/svg/od/business/biz-cancel.svg +5 -0
  93. package/dist/icon/svg/od/business/biz-magic.svg +3 -0
  94. package/dist/icon/svg/od/business/biz-send.svg +12 -0
  95. package/dist/icon/svg/od/business/biz-stop.svg +10 -0
  96. package/dist/icon/svg/od/business/biz-time.svg +3 -0
  97. package/dist/icon/svg-data.d.ts +522 -336
  98. package/dist/icon/svg-data.js +531 -337
  99. package/dist/icon/types.d.ts +2 -2
  100. package/dist/icon/types.js +2 -3
  101. package/dist/index.d.ts +21 -3
  102. package/dist/index.js +22 -2
  103. package/dist/input/style/index.css +201 -189
  104. package/dist/input-number/style/index.css +64 -59
  105. package/dist/input-otp/index.d.ts +1 -1
  106. package/dist/input-otp/index.js +31 -15
  107. package/dist/input-otp/style/index.css +73 -69
  108. package/dist/layout/layout.d.ts +7 -4
  109. package/dist/layout/layout.js +9 -8
  110. package/dist/layout/style/index.css +512 -438
  111. package/dist/link/index.d.ts +3 -3
  112. package/dist/link/style/index.css +29 -31
  113. package/dist/loading/index.d.ts +1 -1
  114. package/dist/loading/index.js +16 -2
  115. package/dist/loading/style/index.css +97 -59
  116. package/dist/message/style/index.css +102 -90
  117. package/dist/modal-base/index.d.ts +15 -8
  118. package/dist/modal-base/index.js +45 -25
  119. package/dist/number-flow/style/index.css +0 -1
  120. package/dist/overlay-vertical-scrollbar/index.d.ts +19 -0
  121. package/dist/overlay-vertical-scrollbar/index.js +152 -0
  122. package/dist/pagination/style/index.css +132 -119
  123. package/dist/pop-base/style/index.css +150 -122
  124. package/dist/preview-panel/index.d.ts +34 -0
  125. package/dist/preview-panel/index.js +138 -0
  126. package/dist/preview-panel/style/index.css +223 -0
  127. package/dist/preview-panel/style/index.d.ts +2 -0
  128. package/dist/preview-panel/style/index.js +2 -0
  129. package/dist/provenance/index.d.ts +16 -0
  130. package/dist/provenance/index.js +14 -0
  131. package/dist/provenance/style/index.css +13 -0
  132. package/dist/provenance/style/index.d.ts +2 -0
  133. package/dist/provenance/style/index.js +2 -0
  134. package/dist/radio/index.d.ts +2 -2
  135. package/dist/radio/index.js +3 -1
  136. package/dist/radio/primitive.d.ts +4 -3
  137. package/dist/radio/primitive.js +13 -8
  138. package/dist/radio/style/index.css +186 -169
  139. package/dist/scroll-area/index.d.ts +18 -4
  140. package/dist/scroll-area/index.js +133 -17
  141. package/dist/scroll-area/style/index.css +112 -98
  142. package/dist/select/index.d.ts +1 -0
  143. package/dist/select/index.js +3 -1
  144. package/dist/select/style/index.css +1702 -1436
  145. package/dist/skill-slot/index.d.ts +16 -0
  146. package/dist/skill-slot/index.js +101 -0
  147. package/dist/skill-slot/style/index.css +155 -0
  148. package/dist/skill-slot/style/index.d.ts +2 -0
  149. package/dist/skill-slot/style/index.js +2 -0
  150. package/dist/slider/style/index.css +218 -191
  151. package/dist/sources/index.d.ts +13 -0
  152. package/dist/sources/index.js +83 -0
  153. package/dist/sources/style/index.css +91 -0
  154. package/dist/sources/style/index.d.ts +2 -0
  155. package/dist/sources/style/index.js +2 -0
  156. package/dist/stream-text/index.d.ts +18 -0
  157. package/dist/stream-text/index.js +363 -0
  158. package/dist/stream-text/style/index.css +106 -0
  159. package/dist/stream-text/style/index.d.ts +2 -0
  160. package/dist/stream-text/style/index.js +2 -0
  161. package/dist/style/base.css +101 -79
  162. package/dist/suggestions/index.d.ts +11 -0
  163. package/dist/suggestions/index.js +23 -0
  164. package/dist/suggestions/style/index.css +31 -0
  165. package/dist/suggestions/style/index.d.ts +2 -0
  166. package/dist/suggestions/style/index.js +2 -0
  167. package/dist/switch/index.d.ts +6 -3
  168. package/dist/switch/index.js +4 -2
  169. package/dist/switch/style/index.css +113 -110
  170. package/dist/table/index.d.ts +4 -3
  171. package/dist/table/index.js +76 -10
  172. package/dist/table/style/index.css +318 -278
  173. package/dist/table/useSelection.js +2 -0
  174. package/dist/tabs/index.d.ts +2 -3
  175. package/dist/tabs/index.js +194 -451
  176. package/dist/tabs/style/index.css +269 -238
  177. package/dist/text-swap/style/index.css +31 -28
  178. package/dist/time-picker/style/index.css +150 -137
  179. package/dist/tree-select/style/index.css +199 -175
  180. package/dist/user-bubble/index.d.ts +12 -0
  181. package/dist/user-bubble/index.js +23 -0
  182. package/dist/user-bubble/style/index.css +31 -0
  183. package/dist/user-bubble/style/index.d.ts +2 -0
  184. package/dist/user-bubble/style/index.js +2 -0
  185. package/dist/virtual-list/style/index.css +2 -4
  186. package/dist/welcome/index.d.ts +18 -0
  187. package/dist/welcome/index.js +24 -0
  188. package/dist/welcome/style/index.css +37 -0
  189. package/dist/welcome/style/index.d.ts +2 -0
  190. package/dist/welcome/style/index.js +2 -0
  191. package/package.json +22 -17
  192. package/dist/icon/svg/alert/alert-circle-filled.svg +0 -1
  193. package/dist/icon/svg/alert/alert-circle.svg +0 -1
  194. package/dist/icon/svg/alert/help-circle-filled.svg +0 -1
  195. package/dist/icon/svg/alert/help-circle.svg +0 -1
  196. package/dist/icon/svg/alert/info-circle-filled.svg +0 -1
  197. package/dist/icon/svg/alert/info-circle.svg +0 -1
  198. package/dist/icon/svg/alert/stop.svg +0 -1
  199. package/dist/icon/svg/alert/warning-filled.svg +0 -1
  200. package/dist/icon/svg/alert/warning.svg +0 -1
  201. package/dist/icon/svg/content/QRcode.svg +0 -1
  202. package/dist/icon/svg/content/bell-filled.svg +0 -1
  203. package/dist/icon/svg/content/bell.svg +0 -1
  204. package/dist/icon/svg/content/bidding.svg +0 -1
  205. package/dist/icon/svg/content/calendar.svg +0 -1
  206. package/dist/icon/svg/content/code.svg +0 -1
  207. package/dist/icon/svg/content/customColumn.svg +0 -1
  208. package/dist/icon/svg/content/data.svg +0 -1
  209. package/dist/icon/svg/content/dataReport-filled.svg +0 -1
  210. package/dist/icon/svg/content/dataReport.svg +0 -1
  211. package/dist/icon/svg/content/download-1.svg +0 -1
  212. package/dist/icon/svg/content/download-filled.svg +0 -1
  213. package/dist/icon/svg/content/download.svg +0 -1
  214. package/dist/icon/svg/content/exchange.svg +0 -1
  215. package/dist/icon/svg/content/filter-filled.svg +0 -1
  216. package/dist/icon/svg/content/filter.svg +0 -1
  217. package/dist/icon/svg/content/hot-filled.svg +0 -1
  218. package/dist/icon/svg/content/hot.svg +0 -1
  219. package/dist/icon/svg/content/link.svg +0 -1
  220. package/dist/icon/svg/content/location.svg +0 -1
  221. package/dist/icon/svg/content/maxSize.svg +0 -1
  222. package/dist/icon/svg/content/mobile-filled.svg +0 -1
  223. package/dist/icon/svg/content/mobile.svg +0 -1
  224. package/dist/icon/svg/content/mute.svg +0 -1
  225. package/dist/icon/svg/content/mutiImage-filled.svg +0 -1
  226. package/dist/icon/svg/content/mutiImage.svg +0 -1
  227. package/dist/icon/svg/content/refresh.svg +0 -1
  228. package/dist/icon/svg/content/report.svg +0 -1
  229. package/dist/icon/svg/content/save.svg +0 -1
  230. package/dist/icon/svg/content/search-bold.svg +0 -1
  231. package/dist/icon/svg/content/search-filled.svg +0 -1
  232. package/dist/icon/svg/content/search.svg +0 -1
  233. package/dist/icon/svg/content/setting.svg +0 -1
  234. package/dist/icon/svg/content/share.svg +0 -1
  235. package/dist/icon/svg/content/sort.svg +0 -1
  236. package/dist/icon/svg/content/sound.svg +0 -1
  237. package/dist/icon/svg/content/sticker-filled.svg +0 -1
  238. package/dist/icon/svg/content/sticker.svg +0 -1
  239. package/dist/icon/svg/content/tag-filled.svg +0 -1
  240. package/dist/icon/svg/content/tag.svg +0 -1
  241. package/dist/icon/svg/content/thumbDown-filled.svg +0 -1
  242. package/dist/icon/svg/content/thumbDown.svg +0 -1
  243. package/dist/icon/svg/content/thumbUp-filled.svg +0 -1
  244. package/dist/icon/svg/content/thumbUp.svg +0 -1
  245. package/dist/icon/svg/content/time-bold.svg +0 -1
  246. package/dist/icon/svg/content/time.svg +0 -1
  247. package/dist/icon/svg/content/verify.svg +0 -1
  248. package/dist/icon/svg/content/video.svg +0 -1
  249. package/dist/icon/svg/content/videoScreenshot.svg +0 -1
  250. package/dist/icon/svg/content/zoomIn.svg +0 -1
  251. package/dist/icon/svg/content/zoomOut.svg +0 -1
  252. package/dist/icon/svg/data/compare.svg +0 -1
  253. package/dist/icon/svg/data/histogram.svg +0 -1
  254. package/dist/icon/svg/editor/cancel-circle-filled.svg +0 -1
  255. package/dist/icon/svg/editor/cancel-circle.svg +0 -1
  256. package/dist/icon/svg/editor/cancel.svg +0 -1
  257. package/dist/icon/svg/editor/check-circle-filled.svg +0 -1
  258. package/dist/icon/svg/editor/check-circle.svg +0 -1
  259. package/dist/icon/svg/editor/check.svg +0 -1
  260. package/dist/icon/svg/editor/copy.svg +0 -1
  261. package/dist/icon/svg/editor/custom-filled.svg +0 -1
  262. package/dist/icon/svg/editor/custom.svg +0 -1
  263. package/dist/icon/svg/editor/delete.svg +0 -1
  264. package/dist/icon/svg/editor/deleteAD-filled.svg +0 -1
  265. package/dist/icon/svg/editor/draggable.svg +0 -1
  266. package/dist/icon/svg/editor/edit.svg +0 -1
  267. package/dist/icon/svg/editor/import.svg +0 -1
  268. package/dist/icon/svg/editor/minus-circle-filled.svg +0 -1
  269. package/dist/icon/svg/editor/minus-circle.svg +0 -1
  270. package/dist/icon/svg/editor/minus.svg +0 -1
  271. package/dist/icon/svg/editor/modify-bold.svg +0 -1
  272. package/dist/icon/svg/editor/modify.svg +0 -1
  273. package/dist/icon/svg/editor/multiCreate.svg +0 -1
  274. package/dist/icon/svg/editor/mutiSelect-filled.svg +0 -1
  275. package/dist/icon/svg/editor/mutiSelect.svg +0 -1
  276. package/dist/icon/svg/editor/pause-filled.svg +0 -1
  277. package/dist/icon/svg/editor/play-filled.svg +0 -1
  278. package/dist/icon/svg/editor/plus-circle-filled.svg +0 -1
  279. package/dist/icon/svg/editor/plus-circle.svg +0 -1
  280. package/dist/icon/svg/editor/plus.svg +0 -1
  281. package/dist/icon/svg/editor/send.svg +0 -1
  282. package/dist/icon/svg/editor/subdivide.svg +0 -1
  283. package/dist/icon/svg/navigation/arrowDown-filled.svg +0 -1
  284. package/dist/icon/svg/navigation/arrowDown.svg +0 -1
  285. package/dist/icon/svg/navigation/arrowLeft-filled.svg +0 -1
  286. package/dist/icon/svg/navigation/arrowLeft.svg +0 -1
  287. package/dist/icon/svg/navigation/arrowRight-filled.svg +0 -1
  288. package/dist/icon/svg/navigation/arrowRight.svg +0 -1
  289. package/dist/icon/svg/navigation/arrowUp-filled.svg +0 -1
  290. package/dist/icon/svg/navigation/arrowUp.svg +0 -1
  291. package/dist/icon/svg/navigation/bottom-filled.svg +0 -1
  292. package/dist/icon/svg/navigation/bottom.svg +0 -1
  293. package/dist/icon/svg/navigation/doubleLeft-filled.svg +0 -1
  294. package/dist/icon/svg/navigation/doubleLeft.svg +0 -1
  295. package/dist/icon/svg/navigation/doubleRight-filled.svg +0 -1
  296. package/dist/icon/svg/navigation/doubleRight.svg +0 -1
  297. package/dist/icon/svg/navigation/down-bold.svg +0 -1
  298. package/dist/icon/svg/navigation/down-filled.svg +0 -1
  299. package/dist/icon/svg/navigation/down.svg +0 -1
  300. package/dist/icon/svg/navigation/fall-filled.svg +0 -1
  301. package/dist/icon/svg/navigation/fold.svg +0 -1
  302. package/dist/icon/svg/navigation/fullScreen.svg +0 -1
  303. package/dist/icon/svg/navigation/left-bold.svg +0 -1
  304. package/dist/icon/svg/navigation/left-filled.svg +0 -1
  305. package/dist/icon/svg/navigation/left.svg +0 -1
  306. package/dist/icon/svg/navigation/leftFirst-filled.svg +0 -1
  307. package/dist/icon/svg/navigation/leftFirst.svg +0 -1
  308. package/dist/icon/svg/navigation/logout.svg +0 -1
  309. package/dist/icon/svg/navigation/menu.svg +0 -1
  310. package/dist/icon/svg/navigation/menuLeft-bold.svg +0 -1
  311. package/dist/icon/svg/navigation/menuLeft.svg +0 -1
  312. package/dist/icon/svg/navigation/menuRight-bold.svg +0 -1
  313. package/dist/icon/svg/navigation/menuRight.svg +0 -1
  314. package/dist/icon/svg/navigation/more-vertical.svg +0 -1
  315. package/dist/icon/svg/navigation/more.svg +0 -1
  316. package/dist/icon/svg/navigation/pointerLeft-filled.svg +0 -1
  317. package/dist/icon/svg/navigation/pointerRight-filled.svg +0 -1
  318. package/dist/icon/svg/navigation/right-bold.svg +0 -1
  319. package/dist/icon/svg/navigation/right-filled.svg +0 -1
  320. package/dist/icon/svg/navigation/right.svg +0 -1
  321. package/dist/icon/svg/navigation/rightLast-filled.svg +0 -1
  322. package/dist/icon/svg/navigation/rightLast.svg +0 -1
  323. package/dist/icon/svg/navigation/rise-filled.svg +0 -1
  324. package/dist/icon/svg/navigation/top-filled.svg +0 -1
  325. package/dist/icon/svg/navigation/top.svg +0 -1
  326. package/dist/icon/svg/navigation/unfold-filled.svg +0 -1
  327. package/dist/icon/svg/navigation/unfold.svg +0 -1
  328. package/dist/icon/svg/navigation/up-bold.svg +0 -1
  329. package/dist/icon/svg/navigation/up-filled.svg +0 -1
  330. package/dist/icon/svg/navigation/up.svg +0 -1
  331. package/dist/icon/svg/product/AIFile.svg +0 -1
  332. package/dist/icon/svg/product/LandingPage.svg +0 -1
  333. package/dist/icon/svg/product/addressBook.svg +0 -1
  334. package/dist/icon/svg/product/alarmClock.svg +0 -1
  335. package/dist/icon/svg/product/asset-square.svg +0 -1
  336. package/dist/icon/svg/product/assetProtecting.svg +0 -1
  337. package/dist/icon/svg/product/autoAD-square-filled.svg +0 -1
  338. package/dist/icon/svg/product/card-distribute.svg +0 -1
  339. package/dist/icon/svg/product/channels-square-filled.svg +0 -1
  340. package/dist/icon/svg/product/channels.svg +0 -1
  341. package/dist/icon/svg/product/chart.svg +0 -3
  342. package/dist/icon/svg/product/chatBubble-filled.svg +0 -1
  343. package/dist/icon/svg/product/checkBadge.svg +0 -1
  344. package/dist/icon/svg/product/comments.svg +0 -1
  345. package/dist/icon/svg/product/container.svg +0 -1
  346. package/dist/icon/svg/product/dataAuth.svg +0 -1
  347. package/dist/icon/svg/product/dataBoard.svg +0 -1
  348. package/dist/icon/svg/product/dataBox.svg +0 -1
  349. package/dist/icon/svg/product/dataFolder.svg +0 -1
  350. package/dist/icon/svg/product/dataRising.svg +0 -1
  351. package/dist/icon/svg/product/detect.svg +0 -1
  352. package/dist/icon/svg/product/exposure-filled.svg +0 -1
  353. package/dist/icon/svg/product/extendedConfig.svg +0 -1
  354. package/dist/icon/svg/product/file-filled.svg +0 -1
  355. package/dist/icon/svg/product/flag.svg +0 -1
  356. package/dist/icon/svg/product/flame.svg +0 -1
  357. package/dist/icon/svg/product/folderZip.svg +0 -1
  358. package/dist/icon/svg/product/folderzip-bold.svg +0 -1
  359. package/dist/icon/svg/product/guideBook.svg +0 -1
  360. package/dist/icon/svg/product/hosting.svg +0 -1
  361. package/dist/icon/svg/product/icon-outlined.svg +0 -1
  362. package/dist/icon/svg/product/idea-bold.svg +0 -1
  363. package/dist/icon/svg/product/idea.svg +0 -1
  364. package/dist/icon/svg/product/image-bold.svg +0 -1
  365. package/dist/icon/svg/product/image-filled.svg +0 -1
  366. package/dist/icon/svg/product/image.svg +0 -1
  367. package/dist/icon/svg/product/images.svg +0 -1
  368. package/dist/icon/svg/product/keyword.svg +0 -1
  369. package/dist/icon/svg/product/linkSquare.svg +0 -1
  370. package/dist/icon/svg/product/lock.svg +0 -1
  371. package/dist/icon/svg/product/magic-filled.svg +0 -1
  372. package/dist/icon/svg/product/magic.svg +0 -1
  373. package/dist/icon/svg/product/miniProgram.svg +0 -1
  374. package/dist/icon/svg/product/minigame-filled.svg +0 -1
  375. package/dist/icon/svg/product/mobilePage.svg +0 -1
  376. package/dist/icon/svg/product/moments-filled.svg +0 -1
  377. package/dist/icon/svg/product/notepad-bold.svg +0 -1
  378. package/dist/icon/svg/product/notepad.svg +0 -1
  379. package/dist/icon/svg/product/offiaccount-filled.svg +0 -1
  380. package/dist/icon/svg/product/playing.svg +0 -1
  381. package/dist/icon/svg/product/qualification.svg +0 -1
  382. package/dist/icon/svg/product/quickFile.svg +0 -1
  383. package/dist/icon/svg/product/ringStruckture.svg +0 -1
  384. package/dist/icon/svg/product/searchAD-filled.svg +0 -1
  385. package/dist/icon/svg/product/searchAD.svg +0 -1
  386. package/dist/icon/svg/product/shield-filled.svg +0 -1
  387. package/dist/icon/svg/product/shield.svg +0 -1
  388. package/dist/icon/svg/product/shop.svg +0 -1
  389. package/dist/icon/svg/product/shopping.svg +0 -1
  390. package/dist/icon/svg/product/star-filled.svg +0 -1
  391. package/dist/icon/svg/product/star.svg +0 -1
  392. package/dist/icon/svg/product/support-bold.svg +0 -1
  393. package/dist/icon/svg/product/target.svg +0 -1
  394. package/dist/icon/svg/product/targeting.svg +0 -1
  395. package/dist/icon/svg/product/task-filled.svg +0 -1
  396. package/dist/icon/svg/product/task.svg +0 -1
  397. package/dist/icon/svg/product/template.svg +0 -1
  398. package/dist/icon/svg/product/templateBag.svg +0 -1
  399. package/dist/icon/svg/product/text.svg +0 -1
  400. package/dist/icon/svg/product/treeStructure.svg +0 -1
  401. package/dist/icon/svg/product/user-add.svg +0 -3
  402. package/dist/icon/svg/product/user-circle.svg +0 -1
  403. package/dist/icon/svg/product/user-edit.svg +0 -1
  404. package/dist/icon/svg/product/user-pack.svg +0 -1
  405. package/dist/icon/svg/product/userList.svg +0 -1
  406. package/dist/icon/svg/product/userPack.svg +0 -1
  407. package/dist/icon/svg/product/users-bold.svg +0 -1
  408. package/dist/icon/svg/product/users.svg +0 -1
  409. package/dist/icon/svg/product/videoBag-filled.svg +0 -1
  410. package/dist/icon/svg/product/viewMask.svg +0 -1
  411. package/dist/icon/svg/product/wallet.svg +0 -1
  412. package/dist/icon/svg/product/wechatBubble-filled.svg +0 -1
  413. package/dist/icon/svg/product/wechatBubble.svg +0 -1
  414. package/dist/icon/svg/product/wechatSearch.svg +0 -1
  415. package/dist/icon/svg/product/writing.svg +0 -1
package/README.md CHANGED
@@ -1,134 +1,204 @@
1
- # one-design-next
1
+ <div align="center">
2
2
 
3
- One Design Next from TAD
3
+ # One Design Next
4
4
 
5
- 目标:
5
+ 基于 **TAD One Design & WXAD AD UI** 设计语言的 React 组件库
6
6
 
7
- 1. One Design 设计语言来说,提供高质量高保真的再实现;
8
- 2. 对其他 AMS 业务来说,提供高质量高自由度的基础库。
7
+ 通用业务控件 / 平台布局 / GenUI 对话组件 / AI Skill 工程化流水线
9
8
 
10
- ## 组件选型
9
+ [![npm](https://img.shields.io/badge/npm-one--design--next-blue)](http://mirrors.tencent.com/npm/package/one-design-next)
10
+ [![React](https://img.shields.io/badge/React-16.14%20%7C%2017%20%7C%2018%20%7C%2019-61dafb)](https://react.dev)
11
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
11
12
 
12
- ## 自定义组件:ConfigProvider 及 CSS Variables
13
+ </div>
13
14
 
14
- 自定义组件的能力通过 ConfigProvider 及 CSS Variables 实现。
15
+ ---
15
16
 
16
- CSS Variables 当然也可以由 ConfigProvider 替代,但 CSS Variables 更方便,而且可以绕过 Message 组件不在 context 的问题,同时也方便未来的 Figma 资产生成。
17
+ ## 概览
17
18
 
18
- CSS Variables 分为 base.css 中的基础变量,及组件级别的组件变量。后者引用前者。如需大范围的样式用前者,更细粒度的样式用后者。
19
+ One Design Next 是腾讯 TAD / WXAD 团队维护的 React 组件库,提供 **60+** 组件,涵盖:
19
20
 
20
- ConfigProvider 则负责更复杂的自定义,如 Icon 的自定义添加,以及增加组件行为,比如 Button 的点击行为定义。
21
+ - **基础 UI** 按钮、表单、表格、对话框、导航等通用控件
22
+ - **平台布局** — 如翼(RuyiLayout)、MP(MpLayout)等业务平台专用布局
23
+ - **GenUI** — AI 对话场景组件(Composer、StreamText、ChatItem、AgentStep 等)
24
+ - **AI Skill 系统** — 配套 Cursor Skill 流水线,支撑需求分析到页面落地的全流程
21
25
 
22
- ## react-day-picker-for-od
26
+ 配有 **Dumi 文档站**,支持组件预览、区块示例与设计 Token 文档。
23
27
 
24
- **20260106 由于 dmp 已升级 node,因此废除,直接使用 react-day-picker@9 即可。**
28
+ ## 快速开始
25
29
 
26
- ---
30
+ ### 安装
27
31
 
28
- https://github.com/aragakey/react-day-picker
32
+ ```bash
33
+ # 腾讯内部 npm 源
34
+ npm install one-design-next --registry http://mirrors.tencent.com/npm/
29
35
 
30
- fork react-day-picker@9,保持 @9 的版本更新。
36
+ # 或使用 pnpm
37
+ pnpm add one-design-next --registry http://mirrors.tencent.com/npm/
38
+ ```
31
39
 
32
- fork 只修改了对 node>18 的依赖,以兼容有一些业务必须使用 16 或更低的 node 版本。
40
+ ### 使用
33
41
 
34
- ## 2025-05-20 TODO
42
+ ```tsx
43
+ // 1. 引入全局基础样式(入口文件中引入一次即可)
44
+ import 'one-design-next/dist/styles/base.css';
35
45
 
36
- - [] https://ant.design/components/config-provider-cn#config-provider-demo-wave
46
+ // 2. 按需导入组件
47
+ import { Button, Table, Dialog, Composer } from 'one-design-next';
48
+ ```
37
49
 
38
- ---
50
+ > 构建产物位于 `dist/` 目录(由 [father](https://github.com/umijs/father) 生成)。除 `base.css` 外,可按需引入更细粒度样式,详见文档站说明。
39
51
 
40
- ## 发布流程 SOP(给 AI 助手读取用)
52
+ ## 组件一览
41
53
 
42
- > 每次发布 alpha 版本,直接按以下步骤执行,无需人工确认每一步。
54
+ 完整导出清单以 [`components/index.ts`](components/index.ts) 为准,分类说明与 Props 索引见 [component-list.md](.cursor/skills/p2-one-design/references/component-list.md)。
43
55
 
44
- ### 环境准备(首次或环境重置后)
56
+ | 分类 | 组件 |
57
+ |:-----|:-----|
58
+ | **通用** | `Button` `Icon` `Link` `Avatar` `HoverFill` `ConfigProvider` |
59
+ | **布局** | `Card` `Collapse` `ScrollArea` `RuyiLayout` `MpLayout` |
60
+ | **导航** | `Tabs` `Dropdown` `Pagination` `Cascader` `TreeSelect` |
61
+ | **数据录入** | `Form` `Input` `InputNumber` `InputOtp` `Select` `AutoComplete` `Checkbox` `Radio` `Switch` `Slider` `ColorPicker` `DatePicker` `DateRangePicker` `TimePicker` `Calendar` |
62
+ | **数据展示** | `Table` `Chart` `VirtualList` `NumberFlow` `EllipsisText` `TextSwap` `Empty` |
63
+ | **反馈** | `Dialog` `Drawer` `Message` `Alert` `Tooltip` `Popover` `Loading` |
64
+ | **GenUI** | `Composer` `StreamText` `ChatItem` `AgentStep` `AgentThink` `CodeBlock` `PreviewPanel` `ActionBar` `Attachments` `Sources` `Suggestions` `SkillSlot` `UserBubble` `Welcome` `ErrorBlock` `Fab` |
65
+ | **底层** | `ModalBase` 系列 `PopBase` 系列 `Collapsible` 日期 / 时间工具函数 |
45
66
 
46
- ```bash
47
- # 设置 npm registry
48
- npm config set registry http://mirrors.tencent.com/npm/
49
- pnpm config set registry http://mirrors.tencent.com/npm/
67
+ > GenUI 共享类型(`ToolCall`、`ChatMessage`、`Conversation` 等)通过 `_genui-types` 统一导出。
50
68
 
51
- # 配置 npm auth token(每次 token 失效时更新)
52
- # 格式写入 ~/.npmrc:
53
- # //mirrors.tencent.com/npm/:_authToken="<base64-token>"
54
- ```
69
+ ## 主题定制
55
70
 
56
- ### Step 1:更新 one-design-next 版本号并发布
71
+ One Design Next 提供两种主题定制方式:
57
72
 
58
- ```bash
59
- # 1. 进入仓库,切到 master,拉最新
60
- cd /root/.openclaw/workspace/one-design-next
61
- git checkout master && git pull origin master
73
+ | 方式 | 适用场景 | 说明 |
74
+ |:-----|:---------|:-----|
75
+ | **CSS Variables** | 全局主题、脱离 React 树的场景(如 `Message`) | `base.css` 提供基础 token,组件级变量可覆盖 |
76
+ | **ConfigProvider** | 需要 React 上下文的定制(图标解析、按钮行为等) | 通过 Provider 注入配置 |
62
77
 
63
- # 2. 读取当前版本,计算下一个 alpha 版本
64
- # 当前版本格式:0.0.4-alpha.N → 下一个:0.0.4-alpha.(N+1)
65
- # 用工蜂 MCP 直接修改 package.json 并 commit 到 master(见下方 AI 操作说明)
78
+ ## 本地开发
66
79
 
67
- # 3. 拉取最新(含刚提交的版本号变更)
68
- git pull origin master
80
+ > 推荐使用 **pnpm**,与仓库脚本一致。
69
81
 
70
- # 4. 安装依赖(注意:npm install 在 node v22 有 bug,必须用 pnpm)
82
+ ```bash
83
+ # 安装依赖
71
84
  pnpm install
72
85
 
73
- # 5. 构建(prepublishOnly 会自动 build,但提前 build 可提前发现错误)
86
+ # 启动开发(构建 variables / benchmark / feedback 数据后启动 Dumi 文档站)
87
+ pnpm run dev
88
+
89
+ # 组件库构建(father 构建 + 样式管线)
74
90
  pnpm run build
75
91
 
76
- # 6. 发布
77
- npm publish --registry http://mirrors.tencent.com/npm/
92
+ # 文档站静态构建
93
+ pnpm run docs:build
78
94
  ```
79
95
 
80
- > ⚠️ **已知问题:npm install 在 node v22 报错**
81
- > 错误:`Cannot read properties of null (reading 'matches')`
82
- > 原因:npm v10 arborist 的 bug
83
- > **解决:始终用 `pnpm install`,不要用 `npm install`**
96
+ ### 常用脚本
84
97
 
85
- ### Step 2:更新 tad-universal-components
98
+ | 命令 | 说明 |
99
+ |:-----|:-----|
100
+ | `pnpm run dev` | 启动本地开发文档站 |
101
+ | `pnpm run build` | 构建组件库(father + 样式) |
102
+ | `pnpm run docs:build` | 静态构建文档站(含 LLM 知识生成) |
103
+ | `pnpm run create-component` | 创建新组件脚手架 |
104
+ | `pnpm run create-skill` | 创建新 AI Skill |
105
+ | `pnpm run benchmark` | 运行性能基准测试 |
106
+ | `pnpm run benchmark:compare` | 对比性能基准 |
107
+ | `pnpm run lint` | ESLint + Stylelint 代码检查 |
108
+ | `pnpm run release` | 版本发布 |
86
109
 
87
- ```bash
88
- # 1. 进入仓库(如不存在则 clone)
89
- cd /root/.openclaw/workspace/tad-universal-components
90
- # 或:git clone https://git.woa.com/tad-ag/tad-universal-components.git
110
+ ## 仓库结构
91
111
 
92
- # 2. 切到 odn-update 分支,合入最新 main
93
- git checkout odn-update
94
- git fetch origin
95
- git merge origin/main --no-edit
112
+ ```
113
+ one-design-next/
114
+ ├── components/ # 组件源码与样式(60+ 组件)
115
+ │ ├── button/
116
+ │ ├── composer/
117
+ │ ├── stream-text/
118
+ │ ├── _genui-types.ts # GenUI 共享类型
119
+ │ ├── _util/ # 内部工具函数(日期、时间等)
120
+ │ └── index.ts # 统一导出入口
121
+ ├── docs-pages/ # 文档与示例
122
+ │ ├── doc/ # 设计 Token 等文档页
123
+ │ ├── block/ # 区块级 demo(与 block-catalog 知识对应)
124
+ │ ├── workshop/ # 页面级 / 评测向用例
125
+ │ ├── draft/ # 草稿区(对话场景 demo / 团队内部 vibe coding)
126
+ │ ├── dev-diary/ # 设计系统演进笔记
127
+ │ └── feedback/ # 反馈文档入口
128
+ ├── .cursor/skills/ # AI Skill 知识包与流程(SKILL.md 为总入口)
129
+ ├── .dumi/ # Dumi 配置与构建数据
130
+ ├── scripts/ # 构建、benchmark、反馈等工具脚本
131
+ ├── skills/ # 对外摘要型 Skill 文档
132
+ ├── dist/ # 构建产物
133
+ └── public/ # 静态资源
134
+ ```
96
135
 
97
- # 3. 更新 packages/lib-od/package.json 中的版本号
98
- # 将 "one-design-next": "^0.0.4-alpha.N" 改为新版本
136
+ ## AI Skill 系统
99
137
 
100
- # 4. pnpm install 更新 lock 文件
101
- pnpm install
138
+ 项目配套完整的 AI Skill 流水线,总入口为 [`.cursor/skills/SKILL.md`](.cursor/skills/SKILL.md)。
102
139
 
103
- # 5. 提交(注意 commitlint scope 规则)
104
- git add packages/lib-od/package.json pnpm-lock.yaml
105
- git commit -m "chore(od): update one-design-next to <新版本号>"
106
- git push origin odn-update
140
+ ### 工作流
141
+
142
+ ```
143
+ 需求分析 设计规格 → 区块 / 页面实现 → 质量审查 → 精修发布 → 反馈采集
107
144
  ```
108
145
 
109
- > ⚠️ **已知问题:commitlint scope 校验**
110
- > 错误:`scope may not be empty` 或 `无效 scope`
111
- > **允许的 scope 值**:`common`, `od`, `adui`, `antdm`, `td-vue`, `ots`, `base`, `biz-mx`, `biz-mb`, `biz-ms`, `biz-mw`, `*`, `release`
112
- > **正确写法**:`chore(od): update one-design-next to 0.0.4-alpha.83`
146
+ ### 阶段说明
113
147
 
114
- ### Step 3:创建 MR
148
+ | 阶段 | Skill | 职责 |
149
+ |:-----|:------|:-----|
150
+ | **P1** 需求 | `p1-design-analyst` · `p1-design-spec` | 需求结构化分析、组件级设计说明 |
151
+ | **P2** 知识 | `p2-one-design` · `p2-block-catalog` · `p2-business-knowledge` | 组件库知识、区块目录、业务页面知识 |
152
+ | **P3** 质量 | `p3-audit` · `p3-polish` | 代码质量审查、发布前精修 |
153
+ | **P4** 转化 | `p4-figma-to-block` · `p4-component-update-process` | 设计稿转区块、组件更新流程 |
154
+ | **P5** 落地 | `p5-figma-to-page` · `p5-feedback` | 整页拼装、上下文与反馈采集 |
155
+ | **辅助** | `ten-questions` · `philosophy-talks` | 方法论讨论与设计哲学 |
115
156
 
116
- 通过工蜂 MCP 创建:
157
+ > **外部只读模式**:外部平台(如 Workbuddy)仅消费知识生成代码与建议,不修改本仓库的组件、区块与知识文件。
117
158
 
159
+ ## 发布
160
+
161
+ ### 环境准备
162
+
163
+ ```bash
164
+ npm config set registry http://mirrors.tencent.com/npm/
165
+ pnpm config set registry http://mirrors.tencent.com/npm/
166
+ # 在 ~/.npmrc 配置 mirrors 的 _authToken(发布权限)
118
167
  ```
119
- project_id: tad-ag/tad-universal-components
120
- source_branch: odn-update
121
- target_branch: main
122
- title: chore(od): update one-design-next to <新版本号>
168
+
169
+ ### 发布流程
170
+
171
+ ```bash
172
+ git checkout master && git pull origin master
173
+
174
+ # 更新 package.json 版本号后:
175
+ pnpm install
176
+ pnpm run build
177
+ npm publish --registry http://mirrors.tencent.com/npm/
123
178
  ```
124
179
 
125
- MR 链接格式:`https://git.woa.com/tad-ag/tad-universal-components/-/merge_requests/<iid>`
180
+ 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范(通过 `commitlint` + `husky` 钩子校验)。
181
+
182
+ ### 同步到 tad-universal-components
183
+
184
+ ```bash
185
+ cd tad-universal-components
186
+ git checkout odn-update && git merge origin/main --no-edit
187
+
188
+ # 更新 packages/lib-od/package.json 中的 one-design-next 版本
189
+ pnpm install
190
+ git add packages/lib-od/package.json pnpm-lock.yaml
191
+ git commit -m "chore(od): update one-design-next to <版本号>"
192
+ git push origin odn-update
193
+ # 在工蜂创建 MR:odn-update → main
194
+ ```
195
+
196
+ ## 相关链接
197
+
198
+ - **源码仓库** — https://git.woa.com/wxad-design/one-design-next
199
+ - **tad-universal-components** — https://git.woa.com/tad-ag/tad-universal-components
200
+ - **npm 包** — `one-design-next` @ [mirrors.tencent.com/npm](http://mirrors.tencent.com/npm/)
126
201
 
127
- ### 完整版本信息
202
+ ## 协议
128
203
 
129
- | 仓库 | 地址 |
130
- | ------------------------ | --------------------------------------------------- |
131
- | one-design-next | https://git.woa.com/wxad-design/one-design-next |
132
- | tad-universal-components | https://git.woa.com/tad-ag/tad-universal-components |
133
- | npm registry | http://mirrors.tencent.com/npm/ |
134
- | npm 包名 | one-design-next |
204
+ [MIT License](./LICENSE) &copy; TAD / WXAD Design
@@ -0,0 +1,106 @@
1
+ export interface PropDef {
2
+ name: string;
3
+ type: string;
4
+ default?: string;
5
+ description: string;
6
+ }
7
+ export type ToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
8
+ export interface ToolCall {
9
+ id: string;
10
+ name: string;
11
+ description?: string;
12
+ params?: Record<string, unknown>;
13
+ result?: string;
14
+ error?: string;
15
+ status: ToolStatus;
16
+ }
17
+ export interface Source {
18
+ title: string;
19
+ url: string;
20
+ description?: string;
21
+ favicon?: string;
22
+ }
23
+ export interface Attachment {
24
+ name: string;
25
+ type: string;
26
+ url?: string;
27
+ size?: number;
28
+ /** 特殊变体:'report' 渲染为 AI 生成报告的大卡片(含创建时间 + 右侧预览缩略图);未传走普通文件卡片/chip。 */
29
+ variant?: 'report';
30
+ /** variant='report' 时展示在标题下的创建时间,例如 "03-09 15:46"。 */
31
+ createdAt?: string;
32
+ /** variant='report' 时右侧预览缩略图地址。未传时渲染为浅色占位层。 */
33
+ thumbnailUrl?: string;
34
+ }
35
+ export type PreviewTarget = {
36
+ kind: 'file';
37
+ attachment: Attachment;
38
+ } | {
39
+ kind: 'url';
40
+ url: string;
41
+ title?: string;
42
+ };
43
+ export interface PreviewTab {
44
+ id: string;
45
+ name: string;
46
+ content: string;
47
+ type: string;
48
+ }
49
+ export interface SkillItem {
50
+ id: string;
51
+ label: string;
52
+ icon: string;
53
+ description?: string;
54
+ }
55
+ export interface SendMeta {
56
+ attachments?: Attachment[];
57
+ webSearch?: boolean;
58
+ skill?: string;
59
+ }
60
+ export type AgentEvent = {
61
+ kind: 'thinking';
62
+ content: string;
63
+ duration?: number;
64
+ } | {
65
+ kind: 'tool';
66
+ tool: ToolCall;
67
+ };
68
+ export interface Conversation {
69
+ id: string;
70
+ title: string;
71
+ preview?: string;
72
+ timestamp?: number;
73
+ status?: 'generating' | 'unread';
74
+ }
75
+ export interface MessageSnapshot {
76
+ content: string;
77
+ thinking?: string;
78
+ toolCalls?: ToolCall[];
79
+ steps?: AgentEvent[];
80
+ sources?: Source[];
81
+ error?: {
82
+ message: string;
83
+ retryable?: boolean;
84
+ };
85
+ }
86
+ export interface ChatMessage {
87
+ id: string;
88
+ role: 'user' | 'assistant' | 'system';
89
+ content: string;
90
+ timestamp: number;
91
+ isStreaming?: boolean;
92
+ toolCalls?: ToolCall[];
93
+ steps?: AgentEvent[];
94
+ attachments?: Attachment[];
95
+ thinking?: string;
96
+ sources?: Source[];
97
+ error?: {
98
+ message: string;
99
+ retryable?: boolean;
100
+ };
101
+ regenerations?: MessageSnapshot[];
102
+ /**
103
+ * 助手消息可选的快捷回复(如意图澄清)。由上层在正文下渲染为可点选项,点击语义等同用户发送该句。
104
+ */
105
+ suggestionChips?: string[];
106
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import './style';
3
+ export interface ActionBarProps {
4
+ content: string;
5
+ onRegenerate?: () => void;
6
+ /** 当前反馈状态(受控),传入后按钮回显为已点赞/已点踩 */
7
+ feedback?: 'positive' | 'negative' | null;
8
+ onFeedback?: (type: 'positive' | 'negative' | null) => void;
9
+ versionCount?: number;
10
+ currentVersion?: number;
11
+ onVersionChange?: (index: number) => void;
12
+ }
13
+ export declare function ActionBar({ content, onRegenerate, feedback: feedbackProp, onFeedback, versionCount, currentVersion, onVersionChange, }: ActionBarProps): import("react").JSX.Element;
14
+ export declare namespace ActionBar {
15
+ var displayName: string;
16
+ }
17
+ export default ActionBar;
@@ -0,0 +1,164 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { useCallback, useRef, useState } from 'react';
12
+ import Button from "../button";
13
+ import Icon from "../icon";
14
+ import Tooltip from "../tooltip";
15
+ import "./style";
16
+ export function ActionBar(_ref) {
17
+ var content = _ref.content,
18
+ onRegenerate = _ref.onRegenerate,
19
+ feedbackProp = _ref.feedback,
20
+ onFeedback = _ref.onFeedback,
21
+ _ref$versionCount = _ref.versionCount,
22
+ versionCount = _ref$versionCount === void 0 ? 1 : _ref$versionCount,
23
+ _ref$currentVersion = _ref.currentVersion,
24
+ currentVersion = _ref$currentVersion === void 0 ? 0 : _ref$currentVersion,
25
+ onVersionChange = _ref.onVersionChange;
26
+ var _useState = useState(false),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ copied = _useState2[0],
29
+ setCopied = _useState2[1];
30
+ var copyTimer = useRef(undefined);
31
+ var copy = useCallback( /*#__PURE__*/function () {
32
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(text) {
33
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34
+ while (1) switch (_context.prev = _context.next) {
35
+ case 0:
36
+ _context.next = 2;
37
+ return navigator.clipboard.writeText(text);
38
+ case 2:
39
+ setCopied(true);
40
+ clearTimeout(copyTimer.current);
41
+ copyTimer.current = setTimeout(function () {
42
+ return setCopied(false);
43
+ }, 2000);
44
+ case 5:
45
+ case "end":
46
+ return _context.stop();
47
+ }
48
+ }, _callee);
49
+ }));
50
+ return function (_x) {
51
+ return _ref2.apply(this, arguments);
52
+ };
53
+ }(), []);
54
+
55
+ // 受控/非受控:外部传了 feedback 就用外部的,否则用内部 state
56
+ var isControlled = feedbackProp !== undefined;
57
+ var _useState3 = useState(null),
58
+ _useState4 = _slicedToArray(_useState3, 2),
59
+ internalFeedback = _useState4[0],
60
+ setInternalFeedback = _useState4[1];
61
+ var feedback = isControlled ? feedbackProp : internalFeedback;
62
+ var handleToggle = function handleToggle(type) {
63
+ var next = feedback === type ? null : type;
64
+ if (!isControlled) setInternalFeedback(next);
65
+ onFeedback === null || onFeedback === void 0 || onFeedback(next);
66
+ };
67
+ var showPager = versionCount > 1;
68
+ return /*#__PURE__*/React.createElement("div", {
69
+ "data-odn-action-bar": true
70
+ }, /*#__PURE__*/React.createElement("span", {
71
+ "data-odn-action-bar-toolbar-btn": true,
72
+ "data-odn-action-bar-copy-wrap": true,
73
+ "data-copied": copied ? 'true' : undefined
74
+ }, /*#__PURE__*/React.createElement(Tooltip, {
75
+ popup: "\u590D\u5236",
76
+ placement: "top",
77
+ offset: 6
78
+ }, /*#__PURE__*/React.createElement(Button, {
79
+ light: true,
80
+ type: "button",
81
+ size: "medium",
82
+ intent: "normal",
83
+ icon: copied ? 'check' : 'copy',
84
+ "aria-label": "\u590D\u5236",
85
+ onClick: function onClick() {
86
+ return copy(content);
87
+ },
88
+ style: {
89
+ // ""
90
+ }
91
+ }))), onRegenerate && /*#__PURE__*/React.createElement("span", {
92
+ "data-odn-action-bar-toolbar-btn": true
93
+ }, /*#__PURE__*/React.createElement(Tooltip, {
94
+ popup: "\u91CD\u65B0\u751F\u6210",
95
+ placement: "top",
96
+ offset: 6
97
+ }, /*#__PURE__*/React.createElement(Button, {
98
+ light: true,
99
+ type: "button",
100
+ size: "medium",
101
+ intent: "normal",
102
+ icon: "refresh",
103
+ "aria-label": "\u91CD\u65B0\u751F\u6210",
104
+ onClick: onRegenerate
105
+ }))), /*#__PURE__*/React.createElement("span", {
106
+ "data-odn-action-bar-separator": true
107
+ }), /*#__PURE__*/React.createElement("span", {
108
+ "data-odn-action-bar-toolbar-btn": true
109
+ }, /*#__PURE__*/React.createElement(Button, {
110
+ light: true,
111
+ type: "button",
112
+ size: "medium",
113
+ intent: "normal",
114
+ icon: "thumbs-up",
115
+ "data-odn-action-bar-feedback": "positive",
116
+ "aria-pressed": feedback === 'positive',
117
+ "aria-label": "\u6709\u5E2E\u52A9",
118
+ onClick: function onClick() {
119
+ return handleToggle('positive');
120
+ }
121
+ })), /*#__PURE__*/React.createElement("span", {
122
+ "data-odn-action-bar-toolbar-btn": true
123
+ }, /*#__PURE__*/React.createElement(Button, {
124
+ light: true,
125
+ type: "button",
126
+ size: "medium",
127
+ intent: "normal",
128
+ icon: "thumbs-down",
129
+ "data-odn-action-bar-feedback": "negative",
130
+ "aria-pressed": feedback === 'negative',
131
+ "aria-label": "\u6CA1\u5E2E\u52A9",
132
+ onClick: function onClick() {
133
+ return handleToggle('negative');
134
+ }
135
+ })), showPager && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
136
+ "data-odn-action-bar-separator": true
137
+ }), /*#__PURE__*/React.createElement("div", {
138
+ "data-odn-action-bar-pager": true
139
+ }, /*#__PURE__*/React.createElement("button", {
140
+ onClick: function onClick() {
141
+ return onVersionChange === null || onVersionChange === void 0 ? void 0 : onVersionChange(currentVersion - 1);
142
+ },
143
+ disabled: currentVersion <= 0,
144
+ "data-odn-action-bar-pager-btn": true,
145
+ "aria-label": "\u4E0A\u4E00\u4E2A\u7248\u672C"
146
+ }, /*#__PURE__*/React.createElement(Icon, {
147
+ name: "chevron-left",
148
+ size: 14
149
+ })), /*#__PURE__*/React.createElement("span", {
150
+ "data-odn-action-bar-pager-text": true
151
+ }, currentVersion + 1, "/", versionCount), /*#__PURE__*/React.createElement("button", {
152
+ onClick: function onClick() {
153
+ return onVersionChange === null || onVersionChange === void 0 ? void 0 : onVersionChange(currentVersion + 1);
154
+ },
155
+ disabled: currentVersion >= versionCount - 1,
156
+ "data-odn-action-bar-pager-btn": true,
157
+ "aria-label": "\u4E0B\u4E00\u4E2A\u7248\u672C"
158
+ }, /*#__PURE__*/React.createElement(Icon, {
159
+ name: "chevron-right",
160
+ size: 14
161
+ })))));
162
+ }
163
+ ActionBar.displayName = 'ActionBar';
164
+ export default ActionBar;