@yh-ui/components 0.1.21 → 0.1.22

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 (484) hide show
  1. package/README.md +2 -0
  2. package/dist/form/index.cjs +1 -1
  3. package/dist/form/index.d.ts +1 -1
  4. package/dist/form/index.mjs +1 -1
  5. package/dist/icon/index.cjs +1 -1
  6. package/dist/icon/index.d.ts +1 -1
  7. package/dist/icon/index.mjs +1 -1
  8. package/dist/loading/index.cjs +1 -1
  9. package/dist/loading/index.d.ts +1 -1
  10. package/dist/loading/index.mjs +1 -1
  11. package/dist/message/src/method.cjs +1 -1
  12. package/dist/message/src/method.d.ts +1 -1
  13. package/dist/message/src/method.mjs +1 -1
  14. package/dist/message-box/index.cjs +1 -1
  15. package/dist/message-box/index.d.ts +1 -1
  16. package/dist/message-box/index.mjs +1 -1
  17. package/dist/notification/src/method.cjs +1 -1
  18. package/dist/notification/src/method.d.ts +1 -1
  19. package/dist/notification/src/method.mjs +1 -1
  20. package/dist/resolver.cjs +1 -1
  21. package/dist/resolver.d.ts +7 -5
  22. package/dist/resolver.mjs +1 -1
  23. package/dist/style.css +584 -0
  24. package/package.json +6 -6
  25. package/dist/affix/__tests__/affix.bottom.test.cjs +0 -101
  26. package/dist/affix/__tests__/affix.bottom.test.mjs +0 -88
  27. package/dist/affix/__tests__/affix.ssr.test.cjs +0 -38
  28. package/dist/affix/__tests__/affix.ssr.test.mjs +0 -51
  29. package/dist/affix/__tests__/affix.test.cjs +0 -185
  30. package/dist/affix/__tests__/affix.test.mjs +0 -180
  31. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +0 -55
  32. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +0 -39
  33. package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +0 -235
  34. package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +0 -157
  35. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +0 -61
  36. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +0 -65
  37. package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +0 -205
  38. package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +0 -133
  39. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +0 -73
  40. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +0 -68
  41. package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +0 -128
  42. package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +0 -109
  43. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +0 -50
  44. package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +0 -33
  45. package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +0 -113
  46. package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +0 -81
  47. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +0 -95
  48. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +0 -66
  49. package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +0 -624
  50. package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +0 -393
  51. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +0 -51
  52. package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +0 -51
  53. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +0 -138
  54. package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +0 -112
  55. package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +0 -90
  56. package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +0 -77
  57. package/dist/ai-chat/__tests__/ai-chat.test.cjs +0 -177
  58. package/dist/ai-chat/__tests__/ai-chat.test.mjs +0 -129
  59. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +0 -75
  60. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +0 -57
  61. package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +0 -174
  62. package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +0 -108
  63. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +0 -46
  64. package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +0 -39
  65. package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +0 -90
  66. package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +0 -78
  67. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +0 -28
  68. package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +0 -26
  69. package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +0 -69
  70. package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +0 -66
  71. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +0 -50
  72. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +0 -42
  73. package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +0 -67
  74. package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +0 -51
  75. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +0 -62
  76. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +0 -50
  77. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +0 -315
  78. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +0 -226
  79. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +0 -45
  80. package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +0 -29
  81. package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +0 -160
  82. package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +0 -109
  83. package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +0 -38
  84. package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +0 -37
  85. package/dist/ai-mention/__tests__/ai-mention.test.cjs +0 -113
  86. package/dist/ai-mention/__tests__/ai-mention.test.mjs +0 -84
  87. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +0 -43
  88. package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +0 -33
  89. package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +0 -113
  90. package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +0 -92
  91. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +0 -49
  92. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +0 -41
  93. package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +0 -54
  94. package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +0 -38
  95. package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +0 -33
  96. package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +0 -34
  97. package/dist/ai-provider/__tests__/ai-provider.test.cjs +0 -38
  98. package/dist/ai-provider/__tests__/ai-provider.test.mjs +0 -33
  99. package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +0 -46
  100. package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +0 -37
  101. package/dist/ai-sender/__tests__/ai-sender.test.cjs +0 -511
  102. package/dist/ai-sender/__tests__/ai-sender.test.mjs +0 -322
  103. package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +0 -72
  104. package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +0 -82
  105. package/dist/ai-sources/__tests__/ai-sources.test.cjs +0 -200
  106. package/dist/ai-sources/__tests__/ai-sources.test.mjs +0 -160
  107. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +0 -56
  108. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +0 -42
  109. package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +0 -151
  110. package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +0 -96
  111. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +0 -88
  112. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +0 -55
  113. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +0 -344
  114. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +0 -237
  115. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +0 -32
  116. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +0 -25
  117. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +0 -130
  118. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +0 -103
  119. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +0 -57
  120. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +0 -39
  121. package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +0 -169
  122. package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +0 -113
  123. package/dist/alert/__tests__/alert.ssr.test.cjs +0 -28
  124. package/dist/alert/__tests__/alert.ssr.test.mjs +0 -29
  125. package/dist/alert/__tests__/alert.test.cjs +0 -123
  126. package/dist/alert/__tests__/alert.test.mjs +0 -110
  127. package/dist/autocomplete/__tests__/autocomplete.ssr.test.cjs +0 -54
  128. package/dist/autocomplete/__tests__/autocomplete.ssr.test.mjs +0 -47
  129. package/dist/autocomplete/__tests__/autocomplete.test.cjs +0 -299
  130. package/dist/autocomplete/__tests__/autocomplete.test.mjs +0 -263
  131. package/dist/avatar/__tests__/avatar.ssr.test.cjs +0 -103
  132. package/dist/avatar/__tests__/avatar.ssr.test.mjs +0 -108
  133. package/dist/avatar/__tests__/avatar.test.cjs +0 -146
  134. package/dist/avatar/__tests__/avatar.test.mjs +0 -125
  135. package/dist/back-top/__tests__/back-top.ssr.test.cjs +0 -13
  136. package/dist/back-top/__tests__/back-top.ssr.test.mjs +0 -10
  137. package/dist/back-top/__tests__/back-top.test.cjs +0 -88
  138. package/dist/back-top/__tests__/back-top.test.mjs +0 -76
  139. package/dist/badge/__tests__/badge.ssr.test.cjs +0 -36
  140. package/dist/badge/__tests__/badge.ssr.test.mjs +0 -33
  141. package/dist/badge/__tests__/badge.test.cjs +0 -115
  142. package/dist/badge/__tests__/badge.test.mjs +0 -112
  143. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.cjs +0 -22
  144. package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.mjs +0 -20
  145. package/dist/breadcrumb/__tests__/breadcrumb.test.cjs +0 -64
  146. package/dist/breadcrumb/__tests__/breadcrumb.test.mjs +0 -51
  147. package/dist/button/__tests__/button.ssr.test.cjs +0 -52
  148. package/dist/button/__tests__/button.ssr.test.mjs +0 -55
  149. package/dist/button/__tests__/button.test.cjs +0 -207
  150. package/dist/button/__tests__/button.test.mjs +0 -141
  151. package/dist/calendar/__tests__/calendar.ssr.test.cjs +0 -65
  152. package/dist/calendar/__tests__/calendar.ssr.test.mjs +0 -63
  153. package/dist/calendar/__tests__/calendar.test.cjs +0 -263
  154. package/dist/calendar/__tests__/calendar.test.mjs +0 -255
  155. package/dist/card/__tests__/card.ssr.test.cjs +0 -37
  156. package/dist/card/__tests__/card.ssr.test.mjs +0 -40
  157. package/dist/card/__tests__/card.test.cjs +0 -131
  158. package/dist/card/__tests__/card.test.mjs +0 -124
  159. package/dist/carousel/__tests__/carousel.ssr.test.cjs +0 -27
  160. package/dist/carousel/__tests__/carousel.ssr.test.mjs +0 -27
  161. package/dist/carousel/__tests__/carousel.test.cjs +0 -115
  162. package/dist/carousel/__tests__/carousel.test.mjs +0 -98
  163. package/dist/cascader/__tests__/cascader-panel.test.cjs +0 -162
  164. package/dist/cascader/__tests__/cascader-panel.test.mjs +0 -151
  165. package/dist/cascader/__tests__/cascader.ssr.test.cjs +0 -61
  166. package/dist/cascader/__tests__/cascader.ssr.test.mjs +0 -55
  167. package/dist/cascader/__tests__/cascader.test.cjs +0 -342
  168. package/dist/cascader/__tests__/cascader.test.mjs +0 -316
  169. package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +0 -35
  170. package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +0 -21
  171. package/dist/category-nav/__tests__/category-nav.test.cjs +0 -53
  172. package/dist/category-nav/__tests__/category-nav.test.mjs +0 -33
  173. package/dist/checkbox/__tests__/checkbox.ssr.test.cjs +0 -52
  174. package/dist/checkbox/__tests__/checkbox.ssr.test.mjs +0 -57
  175. package/dist/checkbox/__tests__/checkbox.test.cjs +0 -173
  176. package/dist/checkbox/__tests__/checkbox.test.mjs +0 -133
  177. package/dist/col/__tests__/col.ssr.test.cjs +0 -44
  178. package/dist/col/__tests__/col.ssr.test.mjs +0 -42
  179. package/dist/col/__tests__/col.test.cjs +0 -128
  180. package/dist/col/__tests__/col.test.mjs +0 -116
  181. package/dist/color-picker/__tests__/color-picker.ssr.test.cjs +0 -34
  182. package/dist/color-picker/__tests__/color-picker.ssr.test.mjs +0 -39
  183. package/dist/color-picker/__tests__/color-picker.test.cjs +0 -227
  184. package/dist/color-picker/__tests__/color-picker.test.mjs +0 -176
  185. package/dist/config-provider/__tests__/config-provider.ssr.test.cjs +0 -43
  186. package/dist/config-provider/__tests__/config-provider.ssr.test.mjs +0 -42
  187. package/dist/config-provider/__tests__/config-provider.test.cjs +0 -75
  188. package/dist/config-provider/__tests__/config-provider.test.mjs +0 -64
  189. package/dist/container/__tests__/container.ssr.test.cjs +0 -71
  190. package/dist/container/__tests__/container.ssr.test.mjs +0 -50
  191. package/dist/container/__tests__/container.test.cjs +0 -111
  192. package/dist/container/__tests__/container.test.mjs +0 -84
  193. package/dist/countdown/__tests__/countdown.ssr.test.cjs +0 -86
  194. package/dist/countdown/__tests__/countdown.ssr.test.mjs +0 -78
  195. package/dist/countdown/__tests__/countdown.test.cjs +0 -767
  196. package/dist/countdown/__tests__/countdown.test.mjs +0 -722
  197. package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +0 -21
  198. package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +0 -18
  199. package/dist/coupon-card/__tests__/coupon-card.test.cjs +0 -67
  200. package/dist/coupon-card/__tests__/coupon-card.test.mjs +0 -64
  201. package/dist/date-picker/__tests__/date-picker-extended.test.cjs +0 -581
  202. package/dist/date-picker/__tests__/date-picker-extended.test.mjs +0 -455
  203. package/dist/date-picker/__tests__/date-picker.ssr.test.cjs +0 -26
  204. package/dist/date-picker/__tests__/date-picker.ssr.test.mjs +0 -23
  205. package/dist/date-picker/__tests__/date-picker.test.cjs +0 -170
  206. package/dist/date-picker/__tests__/date-picker.test.mjs +0 -136
  207. package/dist/descriptions/__tests__/descriptions.ssr.test.cjs +0 -67
  208. package/dist/descriptions/__tests__/descriptions.ssr.test.mjs +0 -72
  209. package/dist/descriptions/__tests__/descriptions.test.cjs +0 -150
  210. package/dist/descriptions/__tests__/descriptions.test.mjs +0 -130
  211. package/dist/dialog/__tests__/dialog.functional.test.cjs +0 -49
  212. package/dist/dialog/__tests__/dialog.functional.test.mjs +0 -49
  213. package/dist/dialog/__tests__/dialog.ssr.test.cjs +0 -31
  214. package/dist/dialog/__tests__/dialog.ssr.test.mjs +0 -29
  215. package/dist/dialog/__tests__/dialog.test.cjs +0 -561
  216. package/dist/dialog/__tests__/dialog.test.mjs +0 -388
  217. package/dist/divider/__tests__/divider.ssr.test.cjs +0 -41
  218. package/dist/divider/__tests__/divider.ssr.test.mjs +0 -44
  219. package/dist/divider/__tests__/divider.test.cjs +0 -71
  220. package/dist/divider/__tests__/divider.test.mjs +0 -68
  221. package/dist/drawer/__tests__/drawer.ssr.test.cjs +0 -25
  222. package/dist/drawer/__tests__/drawer.ssr.test.mjs +0 -23
  223. package/dist/drawer/__tests__/drawer.test.cjs +0 -145
  224. package/dist/drawer/__tests__/drawer.test.mjs +0 -122
  225. package/dist/dropdown/__tests__/dropdown.ssr.test.cjs +0 -49
  226. package/dist/dropdown/__tests__/dropdown.ssr.test.mjs +0 -64
  227. package/dist/dropdown/__tests__/dropdown.test.cjs +0 -310
  228. package/dist/dropdown/__tests__/dropdown.test.mjs +0 -269
  229. package/dist/empty/__tests__/empty.ssr.test.cjs +0 -96
  230. package/dist/empty/__tests__/empty.ssr.test.mjs +0 -99
  231. package/dist/empty/__tests__/empty.test.cjs +0 -110
  232. package/dist/empty/__tests__/empty.test.mjs +0 -101
  233. package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +0 -29
  234. package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +0 -16
  235. package/dist/filter-bar/__tests__/filter-bar.test.cjs +0 -51
  236. package/dist/filter-bar/__tests__/filter-bar.test.mjs +0 -29
  237. package/dist/form/__tests__/form-schema.test.cjs +0 -636
  238. package/dist/form/__tests__/form-schema.test.mjs +0 -366
  239. package/dist/form/__tests__/form.ssr.test.cjs +0 -74
  240. package/dist/form/__tests__/form.ssr.test.mjs +0 -73
  241. package/dist/form/__tests__/form.test.cjs +0 -208
  242. package/dist/form/__tests__/form.test.mjs +0 -128
  243. package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +0 -51
  244. package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +0 -37
  245. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +0 -95
  246. package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +0 -94
  247. package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +0 -86
  248. package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +0 -79
  249. package/dist/grid/__tests__/grid.ssr.test.cjs +0 -81
  250. package/dist/grid/__tests__/grid.ssr.test.mjs +0 -63
  251. package/dist/grid/__tests__/grid.test.cjs +0 -142
  252. package/dist/grid/__tests__/grid.test.mjs +0 -89
  253. package/dist/icon/__tests__/icon.ssr.test.cjs +0 -35
  254. package/dist/icon/__tests__/icon.ssr.test.mjs +0 -26
  255. package/dist/icon/__tests__/icon.test.cjs +0 -144
  256. package/dist/icon/__tests__/icon.test.mjs +0 -123
  257. package/dist/image/__tests__/image-viewer.test.cjs +0 -101
  258. package/dist/image/__tests__/image-viewer.test.mjs +0 -94
  259. package/dist/image/__tests__/image.ssr.test.cjs +0 -73
  260. package/dist/image/__tests__/image.ssr.test.mjs +0 -72
  261. package/dist/image/__tests__/image.test.cjs +0 -171
  262. package/dist/image/__tests__/image.test.mjs +0 -159
  263. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +0 -54
  264. package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +0 -35
  265. package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +0 -257
  266. package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +0 -177
  267. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.cjs +0 -59
  268. package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.mjs +0 -84
  269. package/dist/infinite-scroll/__tests__/infinite-scroll.test.cjs +0 -255
  270. package/dist/infinite-scroll/__tests__/infinite-scroll.test.mjs +0 -187
  271. package/dist/input/__tests__/input-utils.test.cjs +0 -77
  272. package/dist/input/__tests__/input-utils.test.mjs +0 -75
  273. package/dist/input/__tests__/input.ssr.test.cjs +0 -100
  274. package/dist/input/__tests__/input.ssr.test.mjs +0 -85
  275. package/dist/input/__tests__/input.test.cjs +0 -127
  276. package/dist/input/__tests__/input.test.mjs +0 -112
  277. package/dist/input-number/__tests__/input-number.hydration.test.cjs +0 -24
  278. package/dist/input-number/__tests__/input-number.hydration.test.mjs +0 -21
  279. package/dist/input-number/__tests__/input-number.ssr.test.cjs +0 -95
  280. package/dist/input-number/__tests__/input-number.ssr.test.mjs +0 -92
  281. package/dist/input-number/__tests__/input-number.test.cjs +0 -199
  282. package/dist/input-number/__tests__/input-number.test.mjs +0 -173
  283. package/dist/input-tag/__tests__/input-tag.ssr.test.cjs +0 -47
  284. package/dist/input-tag/__tests__/input-tag.ssr.test.mjs +0 -41
  285. package/dist/input-tag/__tests__/input-tag.test.cjs +0 -268
  286. package/dist/input-tag/__tests__/input-tag.test.mjs +0 -201
  287. package/dist/loading/__tests__/loading.ssr.test.cjs +0 -37
  288. package/dist/loading/__tests__/loading.ssr.test.mjs +0 -27
  289. package/dist/loading/__tests__/loading.test.cjs +0 -91
  290. package/dist/loading/__tests__/loading.test.mjs +0 -75
  291. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +0 -33
  292. package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +0 -31
  293. package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +0 -56
  294. package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +0 -48
  295. package/dist/marquee/__tests__/marquee.ssr.test.cjs +0 -59
  296. package/dist/marquee/__tests__/marquee.ssr.test.mjs +0 -60
  297. package/dist/marquee/__tests__/marquee.test.cjs +0 -94
  298. package/dist/marquee/__tests__/marquee.test.mjs +0 -92
  299. package/dist/mention/__tests__/mention.ssr.test.cjs +0 -92
  300. package/dist/mention/__tests__/mention.ssr.test.mjs +0 -70
  301. package/dist/mention/__tests__/mention.test.cjs +0 -650
  302. package/dist/mention/__tests__/mention.test.mjs +0 -523
  303. package/dist/menu/__tests__/menu.ssr.test.cjs +0 -92
  304. package/dist/menu/__tests__/menu.ssr.test.mjs +0 -124
  305. package/dist/menu/__tests__/menu.test.cjs +0 -209
  306. package/dist/menu/__tests__/menu.test.mjs +0 -182
  307. package/dist/message/__tests__/message.ssr.test.cjs +0 -29
  308. package/dist/message/__tests__/message.ssr.test.mjs +0 -23
  309. package/dist/message/__tests__/message.test.cjs +0 -170
  310. package/dist/message/__tests__/message.test.mjs +0 -154
  311. package/dist/message-box/__tests__/message-box.ssr.test.cjs +0 -33
  312. package/dist/message-box/__tests__/message-box.ssr.test.mjs +0 -30
  313. package/dist/message-box/__tests__/message-box.test.cjs +0 -100
  314. package/dist/message-box/__tests__/message-box.test.mjs +0 -95
  315. package/dist/notification/__tests__/notification.ssr.test.cjs +0 -31
  316. package/dist/notification/__tests__/notification.ssr.test.mjs +0 -25
  317. package/dist/notification/__tests__/notification.test.cjs +0 -248
  318. package/dist/notification/__tests__/notification.test.mjs +0 -206
  319. package/dist/pagination/__tests__/pagination.ssr.test.cjs +0 -61
  320. package/dist/pagination/__tests__/pagination.ssr.test.mjs +0 -59
  321. package/dist/pagination/__tests__/pagination.test.cjs +0 -135
  322. package/dist/pagination/__tests__/pagination.test.mjs +0 -131
  323. package/dist/popconfirm/__tests__/popconfirm.ssr.test.cjs +0 -48
  324. package/dist/popconfirm/__tests__/popconfirm.ssr.test.mjs +0 -63
  325. package/dist/popconfirm/__tests__/popconfirm.test.cjs +0 -62
  326. package/dist/popconfirm/__tests__/popconfirm.test.mjs +0 -56
  327. package/dist/popover/__tests__/popover.ssr.test.cjs +0 -48
  328. package/dist/popover/__tests__/popover.ssr.test.mjs +0 -63
  329. package/dist/popover/__tests__/popover.test.cjs +0 -107
  330. package/dist/popover/__tests__/popover.test.mjs +0 -93
  331. package/dist/price/__tests__/price.ssr.test.cjs +0 -20
  332. package/dist/price/__tests__/price.ssr.test.mjs +0 -19
  333. package/dist/price/__tests__/price.test.cjs +0 -45
  334. package/dist/price/__tests__/price.test.mjs +0 -42
  335. package/dist/product-card/__tests__/product-card.ssr.test.cjs +0 -21
  336. package/dist/product-card/__tests__/product-card.ssr.test.mjs +0 -18
  337. package/dist/product-card/__tests__/product-card.test.cjs +0 -54
  338. package/dist/product-card/__tests__/product-card.test.mjs +0 -53
  339. package/dist/progress/__tests__/progress.ssr.test.cjs +0 -31
  340. package/dist/progress/__tests__/progress.ssr.test.mjs +0 -29
  341. package/dist/progress/__tests__/progress.test.cjs +0 -119
  342. package/dist/progress/__tests__/progress.test.mjs +0 -77
  343. package/dist/radio/__tests__/radio-button.test.cjs +0 -99
  344. package/dist/radio/__tests__/radio-button.test.mjs +0 -83
  345. package/dist/radio/__tests__/radio.ssr.test.cjs +0 -132
  346. package/dist/radio/__tests__/radio.ssr.test.mjs +0 -165
  347. package/dist/radio/__tests__/radio.test.cjs +0 -170
  348. package/dist/radio/__tests__/radio.test.mjs +0 -143
  349. package/dist/rate/__tests__/rate.ssr.test.cjs +0 -106
  350. package/dist/rate/__tests__/rate.ssr.test.mjs +0 -103
  351. package/dist/rate/__tests__/rate.test.cjs +0 -88
  352. package/dist/rate/__tests__/rate.test.mjs +0 -85
  353. package/dist/result/__tests__/result.ssr.test.cjs +0 -62
  354. package/dist/result/__tests__/result.ssr.test.mjs +0 -51
  355. package/dist/result/__tests__/result.test.cjs +0 -135
  356. package/dist/result/__tests__/result.test.mjs +0 -92
  357. package/dist/row/__tests__/row.ssr.test.cjs +0 -29
  358. package/dist/row/__tests__/row.ssr.test.mjs +0 -30
  359. package/dist/row/__tests__/row.test.cjs +0 -89
  360. package/dist/row/__tests__/row.test.mjs +0 -86
  361. package/dist/row/__tests__/row_ts.test.cjs +0 -31
  362. package/dist/row/__tests__/row_ts.test.mjs +0 -28
  363. package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +0 -49
  364. package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +0 -54
  365. package/dist/scrollbar/__tests__/scrollbar.test.cjs +0 -43
  366. package/dist/scrollbar/__tests__/scrollbar.test.mjs +0 -40
  367. package/dist/select/__tests__/select.perf.test.cjs +0 -191
  368. package/dist/select/__tests__/select.perf.test.mjs +0 -185
  369. package/dist/select/__tests__/select.ssr.test.cjs +0 -58
  370. package/dist/select/__tests__/select.ssr.test.mjs +0 -52
  371. package/dist/select/__tests__/select.test.cjs +0 -414
  372. package/dist/select/__tests__/select.test.mjs +0 -345
  373. package/dist/skeleton/__tests__/skeleton.ssr.test.cjs +0 -81
  374. package/dist/skeleton/__tests__/skeleton.ssr.test.mjs +0 -83
  375. package/dist/skeleton/__tests__/skeleton.test.cjs +0 -72
  376. package/dist/skeleton/__tests__/skeleton.test.mjs +0 -65
  377. package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +0 -32
  378. package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +0 -19
  379. package/dist/sku-selector/__tests__/sku-selector.test.cjs +0 -64
  380. package/dist/sku-selector/__tests__/sku-selector.test.mjs +0 -53
  381. package/dist/slider/__tests__/repro.test.cjs +0 -25
  382. package/dist/slider/__tests__/repro.test.mjs +0 -22
  383. package/dist/slider/__tests__/slider.ssr.test.cjs +0 -118
  384. package/dist/slider/__tests__/slider.ssr.test.mjs +0 -115
  385. package/dist/slider/__tests__/slider.test.cjs +0 -155
  386. package/dist/slider/__tests__/slider.test.mjs +0 -120
  387. package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +0 -28
  388. package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +0 -25
  389. package/dist/smart-address/__tests__/smart-address.test.cjs +0 -68
  390. package/dist/smart-address/__tests__/smart-address.test.mjs +0 -56
  391. package/dist/space/__tests__/space.ssr.test.cjs +0 -115
  392. package/dist/space/__tests__/space.ssr.test.mjs +0 -150
  393. package/dist/space/__tests__/space.test.cjs +0 -227
  394. package/dist/space/__tests__/space.test.mjs +0 -187
  395. package/dist/spin/__tests__/spin.ssr.test.cjs +0 -46
  396. package/dist/spin/__tests__/spin.ssr.test.mjs +0 -43
  397. package/dist/spin/__tests__/spin.test.cjs +0 -65
  398. package/dist/spin/__tests__/spin.test.mjs +0 -63
  399. package/dist/steps/__tests__/steps.ssr.test.cjs +0 -73
  400. package/dist/steps/__tests__/steps.ssr.test.mjs +0 -55
  401. package/dist/steps/__tests__/steps.test.cjs +0 -152
  402. package/dist/steps/__tests__/steps.test.mjs +0 -123
  403. package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +0 -21
  404. package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +0 -18
  405. package/dist/submit-bar/__tests__/submit-bar.test.cjs +0 -50
  406. package/dist/submit-bar/__tests__/submit-bar.test.mjs +0 -36
  407. package/dist/switch/__tests__/switch.ssr.test.cjs +0 -105
  408. package/dist/switch/__tests__/switch.ssr.test.mjs +0 -102
  409. package/dist/switch/__tests__/switch.test.cjs +0 -251
  410. package/dist/switch/__tests__/switch.test.mjs +0 -193
  411. package/dist/table/__tests__/table-advance.test.cjs +0 -180
  412. package/dist/table/__tests__/table-advance.test.mjs +0 -118
  413. package/dist/table/__tests__/table-interaction.test.cjs +0 -236
  414. package/dist/table/__tests__/table-interaction.test.mjs +0 -162
  415. package/dist/table/__tests__/table-utils.test.cjs +0 -690
  416. package/dist/table/__tests__/table-utils.test.mjs +0 -485
  417. package/dist/table/__tests__/table.perf.test.cjs +0 -231
  418. package/dist/table/__tests__/table.perf.test.mjs +0 -225
  419. package/dist/table/__tests__/table.ssr.test.cjs +0 -296
  420. package/dist/table/__tests__/table.ssr.test.mjs +0 -265
  421. package/dist/table/__tests__/table.test.cjs +0 -682
  422. package/dist/table/__tests__/table.test.mjs +0 -617
  423. package/dist/table/__tests__/use-column-drag.test.cjs +0 -238
  424. package/dist/table/__tests__/use-column-drag.test.mjs +0 -150
  425. package/dist/table/__tests__/use-table-export.test.cjs +0 -179
  426. package/dist/table/__tests__/use-table-export.test.mjs +0 -105
  427. package/dist/table/__tests__/use-table-import.test.cjs +0 -206
  428. package/dist/table/__tests__/use-table-import.test.mjs +0 -144
  429. package/dist/table/__tests__/use-table-print.test.cjs +0 -190
  430. package/dist/table/__tests__/use-table-print.test.mjs +0 -134
  431. package/dist/table/__tests__/use-virtual-scroll.test.cjs +0 -286
  432. package/dist/table/__tests__/use-virtual-scroll.test.mjs +0 -196
  433. package/dist/tabs/__tests__/tabs.ssr.test.cjs +0 -57
  434. package/dist/tabs/__tests__/tabs.ssr.test.mjs +0 -41
  435. package/dist/tabs/__tests__/tabs.test.cjs +0 -171
  436. package/dist/tabs/__tests__/tabs.test.mjs +0 -134
  437. package/dist/tag/__tests__/tag.ssr.test.cjs +0 -45
  438. package/dist/tag/__tests__/tag.ssr.test.mjs +0 -48
  439. package/dist/tag/__tests__/tag.test.cjs +0 -194
  440. package/dist/tag/__tests__/tag.test.mjs +0 -167
  441. package/dist/time-picker/__tests__/time-picker.ssr.test.cjs +0 -46
  442. package/dist/time-picker/__tests__/time-picker.ssr.test.mjs +0 -43
  443. package/dist/time-picker/__tests__/time-picker.test.cjs +0 -228
  444. package/dist/time-picker/__tests__/time-picker.test.mjs +0 -218
  445. package/dist/time-picker/__tests__/time-spinner.test.cjs +0 -196
  446. package/dist/time-picker/__tests__/time-spinner.test.mjs +0 -162
  447. package/dist/time-select/__tests__/time-select.ssr.test.cjs +0 -42
  448. package/dist/time-select/__tests__/time-select.ssr.test.mjs +0 -37
  449. package/dist/time-select/__tests__/time-select.test.cjs +0 -390
  450. package/dist/time-select/__tests__/time-select.test.mjs +0 -374
  451. package/dist/tooltip/__tests__/tooltip.ssr.test.cjs +0 -55
  452. package/dist/tooltip/__tests__/tooltip.ssr.test.mjs +0 -76
  453. package/dist/tooltip/__tests__/tooltip.test.cjs +0 -132
  454. package/dist/tooltip/__tests__/tooltip.test.mjs +0 -121
  455. package/dist/transfer/__tests__/transfer.ssr.test.cjs +0 -47
  456. package/dist/transfer/__tests__/transfer.ssr.test.mjs +0 -44
  457. package/dist/transfer/__tests__/transfer.test.cjs +0 -422
  458. package/dist/transfer/__tests__/transfer.test.mjs +0 -405
  459. package/dist/tree/__tests__/tree.perf.test.cjs +0 -182
  460. package/dist/tree/__tests__/tree.perf.test.mjs +0 -198
  461. package/dist/tree/__tests__/tree.ssr.test.cjs +0 -56
  462. package/dist/tree/__tests__/tree.ssr.test.mjs +0 -45
  463. package/dist/tree/__tests__/tree.test.cjs +0 -488
  464. package/dist/tree/__tests__/tree.test.mjs +0 -333
  465. package/dist/tree-select/__tests__/tree-select.ssr.test.cjs +0 -52
  466. package/dist/tree-select/__tests__/tree-select.ssr.test.mjs +0 -55
  467. package/dist/tree-select/__tests__/tree-select.test.cjs +0 -231
  468. package/dist/tree-select/__tests__/tree-select.test.mjs +0 -189
  469. package/dist/typography/__tests__/typography.ssr.test.cjs +0 -85
  470. package/dist/typography/__tests__/typography.ssr.test.mjs +0 -63
  471. package/dist/typography/__tests__/typography.test.cjs +0 -362
  472. package/dist/typography/__tests__/typography.test.mjs +0 -161
  473. package/dist/upload/__tests__/upload.ssr.test.cjs +0 -28
  474. package/dist/upload/__tests__/upload.ssr.test.mjs +0 -26
  475. package/dist/upload/__tests__/upload.test.cjs +0 -467
  476. package/dist/upload/__tests__/upload.test.mjs +0 -336
  477. package/dist/waterfall/__tests__/waterfall.ssr.test.cjs +0 -38
  478. package/dist/waterfall/__tests__/waterfall.ssr.test.mjs +0 -39
  479. package/dist/waterfall/__tests__/waterfall.test.cjs +0 -122
  480. package/dist/waterfall/__tests__/waterfall.test.mjs +0 -85
  481. package/dist/watermark/__tests__/watermark.ssr.test.cjs +0 -32
  482. package/dist/watermark/__tests__/watermark.ssr.test.mjs +0 -30
  483. package/dist/watermark/__tests__/watermark.test.cjs +0 -127
  484. package/dist/watermark/__tests__/watermark.test.mjs +0 -124
@@ -1,393 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
2
- import { mount } from "@vue/test-utils";
3
- import AiBubble from "../src/ai-bubble.vue";
4
- describe("YhAiBubble", () => {
5
- beforeEach(() => {
6
- vi.clearAllMocks();
7
- });
8
- afterEach(() => {
9
- vi.restoreAllMocks();
10
- });
11
- it("should render with base class", () => {
12
- const wrapper = mount(AiBubble, { props: { content: "hello", role: "assistant" } });
13
- expect(wrapper.find(".yh-ai-bubble").exists()).toBe(true);
14
- });
15
- it("should apply role class for user", () => {
16
- const wrapper = mount(AiBubble, { props: { content: "hi", role: "user" } });
17
- expect(wrapper.classes()).toContain("yh-ai-bubble--user");
18
- });
19
- it("should apply role class for assistant", () => {
20
- const wrapper = mount(AiBubble, { props: { content: "hi", role: "assistant" } });
21
- expect(wrapper.classes()).toContain("yh-ai-bubble--assistant");
22
- });
23
- it("should not render avatar for system role", () => {
24
- const wrapper = mount(AiBubble, { props: { content: "sys msg", role: "system" } });
25
- expect(wrapper.find(".yh-ai-bubble__avatar").exists()).toBe(false);
26
- });
27
- it("should default placement to end for user role", () => {
28
- const wrapper = mount(AiBubble, { props: { content: "hi", role: "user" } });
29
- expect(wrapper.classes()).toContain("yh-ai-bubble--placement-end");
30
- });
31
- it("should default placement to start for assistant role", () => {
32
- const wrapper = mount(AiBubble, { props: { content: "hi", role: "assistant" } });
33
- expect(wrapper.classes()).toContain("yh-ai-bubble--placement-start");
34
- });
35
- it("should override placement via prop", () => {
36
- const wrapper = mount(AiBubble, { props: { content: "hi", role: "user", placement: "start" } });
37
- expect(wrapper.classes()).toContain("yh-ai-bubble--placement-start");
38
- });
39
- it("should apply shape class", () => {
40
- const wrapper = mount(AiBubble, { props: { content: "hi", shape: "round" } });
41
- expect(wrapper.classes()).toContain("yh-ai-bubble--shape-round");
42
- });
43
- it("should apply variant class", () => {
44
- const wrapper = mount(AiBubble, { props: { content: "hi", variant: "borderless" } });
45
- expect(wrapper.classes()).toContain("yh-ai-bubble--variant-borderless");
46
- });
47
- it("should show loading indicator when loading=true and content is empty", () => {
48
- const wrapper = mount(AiBubble, { props: { loading: true, content: "" } });
49
- expect(wrapper.classes()).toContain("is-loading");
50
- expect(wrapper.find(".yh-ai-bubble__typing-indicator").exists()).toBe(true);
51
- });
52
- it("should not show typing indicator when content exists even if loading=true", () => {
53
- const wrapper = mount(AiBubble, { props: { loading: true, content: "some text" } });
54
- expect(wrapper.find(".yh-ai-bubble__typing-indicator").exists()).toBe(false);
55
- });
56
- it("should render plain text when markdown=false", () => {
57
- const wrapper = mount(AiBubble, { props: { content: "plain text", markdown: false } });
58
- expect(wrapper.find(".yh-ai-bubble__text").text()).toBe("plain text");
59
- expect(wrapper.find(".yh-ai-bubble__markdown").exists()).toBe(false);
60
- });
61
- it("should render markdown container when markdown=true", () => {
62
- const wrapper = mount(AiBubble, { props: { content: "hello", markdown: true } });
63
- expect(wrapper.find(".yh-ai-bubble__markdown").exists()).toBe(true);
64
- });
65
- it("should render time when provided", () => {
66
- const wrapper = mount(AiBubble, { props: { content: "hi", time: "10:00" } });
67
- expect(wrapper.find(".yh-ai-bubble__time").text()).toBe("10:00");
68
- });
69
- it("should not render header without time and header slot", () => {
70
- const wrapper = mount(AiBubble, { props: { content: "hi" } });
71
- expect(wrapper.find(".yh-ai-bubble__header").exists()).toBe(false);
72
- });
73
- it("should apply is-typing class when typing=true", () => {
74
- const wrapper = mount(AiBubble, { props: { content: "hi", typing: true } });
75
- expect(wrapper.classes()).toContain("is-typing");
76
- });
77
- it("should render content via default slot", () => {
78
- const wrapper = mount(AiBubble, {
79
- slots: { default: '<span class="custom-content">Custom</span>' }
80
- });
81
- expect(wrapper.find(".custom-content").exists()).toBe(true);
82
- });
83
- it("should render footer slot when provided", () => {
84
- const wrapper = mount(AiBubble, {
85
- props: { content: "hi" },
86
- slots: { footer: '<div class="custom-footer">Actions</div>' }
87
- });
88
- expect(wrapper.find(".yh-ai-bubble__footer").exists()).toBe(true);
89
- expect(wrapper.find(".custom-footer").exists()).toBe(true);
90
- });
91
- it("should render header slot when provided", () => {
92
- const wrapper = mount(AiBubble, {
93
- props: { content: "hi" },
94
- slots: { header: '<span class="custom-header">Header</span>' }
95
- });
96
- expect(wrapper.find(".yh-ai-bubble__header").exists()).toBe(true);
97
- expect(wrapper.find(".custom-header").exists()).toBe(true);
98
- });
99
- it("should render avatar slot when provided", () => {
100
- const wrapper = mount(AiBubble, {
101
- props: { content: "hi", role: "user" },
102
- slots: { avatar: '<img class="custom-avatar" src="test.png" />' }
103
- });
104
- expect(wrapper.find(".custom-avatar").exists()).toBe(true);
105
- });
106
- it("should render multimodal content - image", () => {
107
- const multimodal = [{ type: "image", url: "img.png", title: "test image" }];
108
- const wrapper = mount(AiBubble, { props: { content: "", multimodal } });
109
- expect(wrapper.find(".yh-ai-bubble__image-grid").exists()).toBe(true);
110
- });
111
- it("should render multimodal content - audio", async () => {
112
- const multimodal = [{ type: "audio", url: "audio.mp3", title: "test audio" }];
113
- const wrapper = mount(AiBubble, { props: { content: "", multimodal } });
114
- expect(wrapper.find(".yh-ai-bubble__audio-player").exists()).toBe(true);
115
- const playMock = vi.fn().mockResolvedValue(void 0);
116
- const pauseMock = vi.fn();
117
- class MockAudio {
118
- play = playMock;
119
- pause = pauseMock;
120
- onended = null;
121
- }
122
- vi.stubGlobal("Audio", MockAudio);
123
- await wrapper.find(".yh-ai-bubble__audio-player button").trigger("click");
124
- expect(playMock).toHaveBeenCalled();
125
- await wrapper.find(".yh-ai-bubble__audio-player button").trigger("click");
126
- expect(pauseMock).toHaveBeenCalled();
127
- });
128
- it("should render multimodal content - file", () => {
129
- const multimodal = [{ type: "file", url: "test.pdf", title: "test.pdf", size: "10KB" }];
130
- const wrapper = mount(AiBubble, { props: { content: "", multimodal } });
131
- expect(wrapper.find(".yh-ai-bubble__file-card").exists()).toBe(true);
132
- expect(wrapper.html()).toContain("10KB");
133
- });
134
- it("should render JSON structured data", () => {
135
- const structuredData = { type: "json", data: { name: "test" } };
136
- const wrapper = mount(AiBubble, { props: { content: "", structuredData } });
137
- expect(wrapper.find(".yh-ai-bubble__json-viewer").exists()).toBe(true);
138
- });
139
- it("should render thought-chain structured data", () => {
140
- const structuredData = { type: "thought-chain", data: [] };
141
- const wrapper = mount(AiBubble, { props: { content: "", structuredData } });
142
- expect(wrapper.findComponent({ name: "YhAiThoughtChain" }).exists()).toBe(true);
143
- });
144
- it("should handle citation click", async () => {
145
- const onCitationClick = vi.fn();
146
- const cita = { id: 1, title: "link", url: "http://x.com" };
147
- const wrapper = mount(AiBubble, {
148
- props: { content: "test [1]", citations: [cita], onCitationClick }
149
- });
150
- await wrapper.find(".yh-ai-bubble__citation-item").trigger("click");
151
- expect(onCitationClick).toHaveBeenCalledWith(cita);
152
- const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
153
- const wrapper2 = mount(AiBubble, {
154
- props: { content: "test", citations: [cita] }
155
- });
156
- await wrapper2.find(".yh-ai-bubble__citation-item").trigger("click");
157
- expect(openSpy).toHaveBeenCalledWith("http://x.com", "_blank");
158
- });
159
- it("should show citation tooltip on hover", async () => {
160
- vi.useFakeTimers();
161
- const cita = { id: "1", title: "ref 1", content: "detailed info" };
162
- const wrapper = mount(AiBubble, {
163
- props: { content: "test", citations: [cita] }
164
- });
165
- const mockEvent = {
166
- target: {
167
- classList: { contains: (c) => c === "yh-ai-citation" },
168
- getAttribute: (a) => a === "data-id" ? "1" : null,
169
- getBoundingClientRect: () => ({ top: 100, left: 100, width: 20 })
170
- }
171
- };
172
- wrapper.vm.handleCitationHover(mockEvent);
173
- expect(wrapper.vm.hoveredCitation).toEqual(cita);
174
- wrapper.vm.handleCitationLeave(mockEvent);
175
- vi.advanceTimersByTime(300);
176
- expect(wrapper.vm.hoveredCitation).toBeNull();
177
- vi.useRealTimers();
178
- });
179
- it("should handle code block actions - collapse", async () => {
180
- const wrapper = mount(AiBubble);
181
- const mockEvent = {
182
- target: {
183
- classList: { contains: (c) => c === "collapse-btn" || c === "code-action-btn" },
184
- getAttribute: (a) => a === "data-id" ? "cb-1" : null
185
- }
186
- };
187
- await wrapper.vm.handleCodeBlockAction(mockEvent);
188
- expect(wrapper.vm.expandedCodeBlocks.has("cb-1")).toBe(true);
189
- });
190
- it("should trigger download on button click", async () => {
191
- const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
192
- const multimodal = [{ type: "file", url: "test.zip", title: "test" }];
193
- const wrapper = mount(AiBubble, { props: { content: "", multimodal } });
194
- await wrapper.find(".yh-ai-bubble__file-card button").trigger("click");
195
- expect(openSpy).toHaveBeenCalledWith("test.zip", "_blank");
196
- });
197
- it("getFileIcon should return correct icons", () => {
198
- const wrapper = mount(AiBubble);
199
- const getFileIcon = wrapper.vm.getFileIcon;
200
- expect(getFileIcon("test.pdf")).toBe("file-pdf");
201
- expect(getFileIcon("test.xlsx")).toBe("file-excel");
202
- expect(getFileIcon("test.docx")).toBe("file-word");
203
- expect(getFileIcon("test.mp4")).toBe("file-video");
204
- expect(getFileIcon("test.mp3")).toBe("file-audio");
205
- expect(getFileIcon("test.txt")).toBe("file-txt");
206
- expect(getFileIcon("unknown")).toBe("document");
207
- });
208
- it("should handle code block actions - copy", async () => {
209
- const wrapper = mount(AiBubble, { props: { content: "```js\nconsole.log(1)\n```" } });
210
- const copySpy = vi.spyOn(navigator.clipboard, "writeText").mockResolvedValue(void 0);
211
- const mockEvent = {
212
- target: {
213
- classList: { contains: (c) => c === "code-action-btn" || c === "copy-btn" },
214
- getAttribute: (a) => {
215
- if (a === "data-code") return encodeURIComponent("console.log(1)");
216
- if (a === "data-id") return "cb-1";
217
- return null;
218
- }
219
- }
220
- };
221
- await wrapper.vm.handleCodeBlockAction(mockEvent);
222
- expect(copySpy).toHaveBeenCalledWith("console.log(1)");
223
- });
224
- it("should handle code block actions - run", async () => {
225
- const onRunCode = vi.fn().mockResolvedValue({ output: "done" });
226
- const wrapper = mount(AiBubble, { props: { content: "```js\n1+1\n```", onRunCode } });
227
- const mockEvent = {
228
- target: {
229
- classList: { contains: (c) => c === "code-action-btn" || c === "run-btn" },
230
- getAttribute: (a) => {
231
- if (a === "data-code") return encodeURIComponent("1+1");
232
- if (a === "data-lang") return "js";
233
- if (a === "data-id") return "cb-1";
234
- return null;
235
- }
236
- }
237
- };
238
- await wrapper.vm.handleCodeBlockAction(mockEvent);
239
- expect(onRunCode).toHaveBeenCalled();
240
- });
241
- it("should toggle code block expansion", () => {
242
- const wrapper = mount(AiBubble);
243
- wrapper.vm.toggleCodeBlock("cb-1");
244
- expect(wrapper.vm.expandedCodeBlocks.has("cb-1")).toBe(true);
245
- wrapper.vm.toggleCodeBlock("cb-1");
246
- expect(wrapper.vm.expandedCodeBlocks.has("cb-1")).toBe(false);
247
- });
248
- it("should handle explain code block", async () => {
249
- const onExplainCode = vi.fn().mockResolvedValue("explanation");
250
- const wrapper = mount(AiBubble, { props: { onExplainCode } });
251
- const mockEvent = {
252
- target: {
253
- classList: { contains: (c) => c === "explain-btn" || c === "code-action-btn" },
254
- getAttribute: (a) => {
255
- if (a === "data-code") return "code";
256
- if (a === "data-lang") return "js";
257
- if (a === "data-id") return "cb-1";
258
- return null;
259
- }
260
- }
261
- };
262
- await wrapper.vm.handleCodeBlockAction(mockEvent);
263
- expect(onExplainCode).toHaveBeenCalled();
264
- expect(wrapper.vm.codeOutput["cb-1"]).toEqual(["explanation"]);
265
- });
266
- it("should handle code block actions - edit", async () => {
267
- const mockEditor = {
268
- dispose: vi.fn(),
269
- getValue: vi.fn().mockReturnValue("edited code")
270
- };
271
- const mockMonaco = {
272
- editor: {
273
- create: vi.fn().mockReturnValue(mockEditor)
274
- }
275
- };
276
- const wrapper = mount(AiBubble);
277
- wrapper.vm.monaco = mockMonaco;
278
- const mockEvent = {
279
- target: {
280
- classList: { contains: (c) => c === "code-action-btn" || c === "edit-btn" },
281
- getAttribute: (a) => {
282
- if (a === "data-code") return encodeURIComponent("raw context");
283
- if (a === "data-lang") return "javascript";
284
- if (a === "data-id") return "cb-1";
285
- return null;
286
- }
287
- }
288
- };
289
- await wrapper.vm.handleCodeBlockAction(mockEvent);
290
- expect(wrapper.vm.editingCodeBlock).toBe("cb-1");
291
- await wrapper.vm.saveEditCode("cb-1");
292
- expect(wrapper.vm.editingCodeBlock).toBeNull();
293
- });
294
- it("should handle onRunCode with async iterator", async () => {
295
- const mockGenerator = async function* () {
296
- yield { output: "chunk 1" };
297
- yield { output: "chunk 2" };
298
- };
299
- const onRunCode = vi.fn().mockResolvedValue(mockGenerator());
300
- const wrapper = mount(AiBubble, { props: { onRunCode } });
301
- const mockEvent = {
302
- target: {
303
- classList: { contains: (c) => c === "run-btn" || c === "code-action-btn" },
304
- getAttribute: (a) => {
305
- if (a === "data-code") return "code";
306
- if (a === "data-lang") return "js";
307
- if (a === "data-id") return "cb-1";
308
- return null;
309
- }
310
- }
311
- };
312
- await wrapper.vm.handleCodeBlockAction(mockEvent);
313
- expect(onRunCode).toHaveBeenCalled();
314
- });
315
- it("should support streaming increments", async () => {
316
- vi.useFakeTimers();
317
- const onStreamComplete = vi.fn();
318
- const wrapper = mount(AiBubble, {
319
- props: {
320
- content: "hello world",
321
- typing: true,
322
- streaming: true,
323
- streamSpeed: 2,
324
- streamInterval: 10,
325
- onStreamComplete
326
- }
327
- });
328
- vi.advanceTimersByTime(100);
329
- await wrapper.vm.$nextTick();
330
- expect(onStreamComplete).toHaveBeenCalled();
331
- vi.useRealTimers();
332
- });
333
- it("should render table structured data", () => {
334
- const structuredData = {
335
- type: "table",
336
- data: { headers: ["A", "B"], rows: [["1", "2"]] }
337
- };
338
- const wrapper = mount(AiBubble, { props: { content: "", structuredData } });
339
- expect(wrapper.find("table").exists()).toBe(true);
340
- expect(wrapper.find("th").text()).toBe("A");
341
- });
342
- it("should handle markdown=true but no mdi initialized", async () => {
343
- const wrapper = mount(AiBubble, { props: { content: "hi", markdown: true } });
344
- expect(wrapper.find(".yh-ai-bubble__markdown").exists()).toBe(true);
345
- });
346
- it("should handle multimodal download", async () => {
347
- const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
348
- const wrapper = mount(AiBubble);
349
- wrapper.vm.handleDownload("test.zip");
350
- expect(openSpy).toHaveBeenCalledWith("test.zip", "_blank");
351
- });
352
- it("should hit onBeforeUnmount", () => {
353
- const wrapper = mount(AiBubble, { props: { content: "test" } });
354
- wrapper.unmount();
355
- });
356
- it("should test escapeHtml utility", () => {
357
- const wrapper = mount(AiBubble);
358
- const escapeHtml = wrapper.vm.escapeHtml;
359
- expect(escapeHtml(`<div>&"'</div>`)).toBe("&lt;div&gt;&amp;&quot;&#39;&lt;/div&gt;");
360
- });
361
- it("should support sentence stream mode", async () => {
362
- vi.useFakeTimers();
363
- const onStreamComplete = vi.fn();
364
- mount(AiBubble, {
365
- props: {
366
- content: "Sentence one. Sentence two!",
367
- typing: true,
368
- streaming: true,
369
- streamMode: "sentence",
370
- onStreamComplete
371
- }
372
- });
373
- vi.advanceTimersByTime(1e3);
374
- expect(onStreamComplete).toHaveBeenCalled();
375
- vi.useRealTimers();
376
- });
377
- it("should support paragraph stream mode", async () => {
378
- vi.useFakeTimers();
379
- const onStreamComplete = vi.fn();
380
- mount(AiBubble, {
381
- props: {
382
- content: "Para one\n\nPara two",
383
- typing: true,
384
- streaming: true,
385
- streamMode: "paragraph",
386
- onStreamComplete
387
- }
388
- });
389
- vi.advanceTimersByTime(1e3);
390
- expect(onStreamComplete).toHaveBeenCalled();
391
- vi.useRealTimers();
392
- });
393
- });
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- var _vitest = require("vitest");
4
- var _serverRenderer = require("@vue/server-renderer");
5
- var _vue = require("vue");
6
- var _aiBubbleList = _interopRequireDefault(require("../src/ai-bubble-list.vue"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- (0, _vitest.describe)("YhAiBubbleList SSR", () => {
9
- const mockItems = [{
10
- id: 1,
11
- content: "Hello",
12
- role: "user"
13
- }, {
14
- id: 2,
15
- content: "Hi there!",
16
- role: "assistant"
17
- }];
18
- (0, _vitest.it)("should render to string on server", async () => {
19
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiBubbleList.default, {
20
- items: mockItems
21
- }));
22
- (0, _vitest.expect)(html).toContain("yh-ai-bubble-list");
23
- (0, _vitest.expect)(html).toContain("yh-ai-bubble");
24
- (0, _vitest.expect)(html).toContain("Hello");
25
- (0, _vitest.expect)(html).toContain("Hi there!");
26
- });
27
- (0, _vitest.it)("should render custom height on server", async () => {
28
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiBubbleList.default, {
29
- items: mockItems,
30
- height: "600px"
31
- }));
32
- (0, _vitest.expect)(html).toContain('style="height:600px;"');
33
- });
34
- (0, _vitest.it)("should render loading state on server", async () => {
35
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiBubbleList.default, {
36
- items: [],
37
- loading: true
38
- }));
39
- (0, _vitest.expect)(html).toContain("yh-ai-bubble-list__loading");
40
- });
41
- (0, _vitest.it)("should render virtual scroll skeleton on server", async () => {
42
- const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_aiBubbleList.default, {
43
- items: mockItems,
44
- virtualScroll: true,
45
- height: 400
46
- }));
47
- (0, _vitest.expect)(html).toContain("is-virtual");
48
- (0, _vitest.expect)(html).toContain("yh-ai-bubble-list__virtual-phantom");
49
- (0, _vitest.expect)(html).toContain("yh-ai-bubble-list__virtual-content");
50
- });
51
- });
@@ -1,51 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { renderToString } from "@vue/server-renderer";
3
- import { h } from "vue";
4
- import AiBubbleList from "../src/ai-bubble-list.vue";
5
- describe("YhAiBubbleList SSR", () => {
6
- const mockItems = [
7
- { id: 1, content: "Hello", role: "user" },
8
- { id: 2, content: "Hi there!", role: "assistant" }
9
- ];
10
- it("should render to string on server", async () => {
11
- const html = await renderToString(
12
- h(AiBubbleList, {
13
- items: mockItems
14
- })
15
- );
16
- expect(html).toContain("yh-ai-bubble-list");
17
- expect(html).toContain("yh-ai-bubble");
18
- expect(html).toContain("Hello");
19
- expect(html).toContain("Hi there!");
20
- });
21
- it("should render custom height on server", async () => {
22
- const html = await renderToString(
23
- h(AiBubbleList, {
24
- items: mockItems,
25
- height: "600px"
26
- })
27
- );
28
- expect(html).toContain('style="height:600px;"');
29
- });
30
- it("should render loading state on server", async () => {
31
- const html = await renderToString(
32
- h(AiBubbleList, {
33
- items: [],
34
- loading: true
35
- })
36
- );
37
- expect(html).toContain("yh-ai-bubble-list__loading");
38
- });
39
- it("should render virtual scroll skeleton on server", async () => {
40
- const html = await renderToString(
41
- h(AiBubbleList, {
42
- items: mockItems,
43
- virtualScroll: true,
44
- height: 400
45
- })
46
- );
47
- expect(html).toContain("is-virtual");
48
- expect(html).toContain("yh-ai-bubble-list__virtual-phantom");
49
- expect(html).toContain("yh-ai-bubble-list__virtual-content");
50
- });
51
- });
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- var _vitest = require("vitest");
4
- var _testUtils = require("@vue/test-utils");
5
- var _aiBubbleList = _interopRequireDefault(require("../src/ai-bubble-list.vue"));
6
- var _aiBubble = _interopRequireDefault(require("../../ai-bubble/src/ai-bubble.vue"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- (0, _vitest.describe)("YhAiBubbleList", () => {
9
- (0, _vitest.beforeEach)(() => {
10
- _vitest.vi.clearAllMocks();
11
- });
12
- (0, _vitest.afterEach)(() => {
13
- _vitest.vi.restoreAllMocks();
14
- });
15
- const mockItems = [{
16
- id: 1,
17
- content: "Hello",
18
- role: "user"
19
- }, {
20
- id: 2,
21
- content: "Hi there!",
22
- role: "assistant"
23
- }, {
24
- id: 3,
25
- content: "How can I help you?",
26
- role: "assistant"
27
- }];
28
- (0, _vitest.it)("should render correct number of items", () => {
29
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
30
- props: {
31
- items: mockItems
32
- }
33
- });
34
- (0, _vitest.expect)(wrapper.findAll(".yh-ai-bubble-list__item")).toHaveLength(3);
35
- (0, _vitest.expect)(wrapper.findAllComponents(_aiBubble.default)).toHaveLength(3);
36
- });
37
- (0, _vitest.it)("should apply custom height", () => {
38
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
39
- props: {
40
- items: mockItems,
41
- height: 500
42
- }
43
- });
44
- const el = wrapper.element;
45
- (0, _vitest.expect)(el.style.height).toBe("500px");
46
- });
47
- (0, _vitest.it)("should render loading state", () => {
48
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
49
- props: {
50
- items: mockItems,
51
- loading: true
52
- }
53
- });
54
- (0, _vitest.expect)(wrapper.find(".yh-ai-bubble-list__loading").exists()).toBe(true);
55
- });
56
- (0, _vitest.it)("should use virtual scroll when virtualScroll=true", () => {
57
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
58
- props: {
59
- items: Array.from({
60
- length: 100
61
- }).map((_, i) => ({
62
- id: i,
63
- content: `msg ${i}`,
64
- role: "user"
65
- })),
66
- virtualScroll: true,
67
- height: 400,
68
- itemHeight: 50
69
- }
70
- });
71
- (0, _vitest.expect)(wrapper.classes()).toContain("is-virtual");
72
- (0, _vitest.expect)(wrapper.find(".yh-ai-bubble-list__virtual-phantom").exists()).toBe(true);
73
- (0, _vitest.expect)(wrapper.findAll(".yh-ai-bubble-list__item").length).toBeLessThan(100);
74
- });
75
- (0, _vitest.it)("should support custom bubble slot", () => {
76
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
77
- props: {
78
- items: [{
79
- id: 1,
80
- content: "test",
81
- role: "user"
82
- }]
83
- },
84
- slots: {
85
- bubble: `
86
- <template #bubble="{ item }">
87
- <div class="custom-bubble">{{ item.content }}</div>
88
- </template>
89
- `
90
- }
91
- });
92
- (0, _vitest.expect)(wrapper.find(".custom-bubble").exists()).toBe(true);
93
- (0, _vitest.expect)(wrapper.find(".custom-bubble").text()).toBe("test");
94
- });
95
- (0, _vitest.it)("should support custom loading slot", () => {
96
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
97
- props: {
98
- items: [],
99
- loading: true
100
- },
101
- slots: {
102
- loading: '<div class="custom-loading">Loading...</div>'
103
- }
104
- });
105
- (0, _vitest.expect)(wrapper.find(".custom-loading").exists()).toBe(true);
106
- });
107
- (0, _vitest.it)("should expose scrollToBottom method", async () => {
108
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
109
- props: {
110
- items: mockItems
111
- }
112
- });
113
- (0, _vitest.expect)(typeof wrapper.vm.scrollToBottom).toBe("function");
114
- });
115
- (0, _vitest.it)("should automatically scroll to bottom when items change", async () => {
116
- const wrapper = (0, _testUtils.mount)(_aiBubbleList.default, {
117
- props: {
118
- items: mockItems,
119
- autoScroll: true
120
- }
121
- });
122
- const scrollRef = {
123
- value: {
124
- scrollTop: 0,
125
- scrollHeight: 1e3
126
- }
127
- };
128
- wrapper.vm.scrollRef = scrollRef;
129
- await wrapper.setProps({
130
- items: [...mockItems, {
131
- id: 4,
132
- content: "new msg",
133
- role: "user"
134
- }]
135
- });
136
- await new Promise(resolve => setTimeout(resolve, 0));
137
- });
138
- });