@yh-ui/components 0.1.10 → 0.1.12

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 (386) hide show
  1. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +55 -0
  2. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.d.ts +1 -0
  3. package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +39 -0
  4. package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +149 -0
  5. package/dist/ai-action-group/__tests__/ai-action-group.test.d.ts +1 -0
  6. package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +104 -0
  7. package/dist/ai-action-group/index.cjs +26 -0
  8. package/dist/ai-action-group/index.d.ts +3 -0
  9. package/dist/ai-action-group/index.mjs +5 -0
  10. package/dist/ai-action-group/src/ai-action-group.cjs +50 -0
  11. package/dist/ai-action-group/src/ai-action-group.css +517 -0
  12. package/dist/ai-action-group/src/ai-action-group.d.ts +55 -0
  13. package/dist/ai-action-group/src/ai-action-group.d.vue.ts +40 -0
  14. package/dist/ai-action-group/src/ai-action-group.mjs +44 -0
  15. package/dist/ai-action-group/src/ai-action-group.vue +602 -0
  16. package/dist/ai-action-group/src/ai-action-group.vue.d.ts +40 -0
  17. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +61 -0
  18. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.d.ts +1 -0
  19. package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +65 -0
  20. package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +70 -0
  21. package/dist/ai-agent-card/__tests__/ai-agent-card.test.d.ts +1 -0
  22. package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +64 -0
  23. package/dist/ai-agent-card/index.cjs +26 -0
  24. package/dist/ai-agent-card/index.d.ts +3 -0
  25. package/dist/ai-agent-card/index.mjs +5 -0
  26. package/dist/ai-agent-card/src/ai-agent-card.cjs +74 -0
  27. package/dist/ai-agent-card/src/ai-agent-card.css +859 -0
  28. package/dist/ai-agent-card/src/ai-agent-card.d.ts +122 -0
  29. package/dist/ai-agent-card/src/ai-agent-card.d.vue.ts +62 -0
  30. package/dist/ai-agent-card/src/ai-agent-card.mjs +68 -0
  31. package/dist/ai-agent-card/src/ai-agent-card.vue +1029 -0
  32. package/dist/ai-agent-card/src/ai-agent-card.vue.d.ts +62 -0
  33. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +73 -0
  34. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.d.ts +1 -0
  35. package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +68 -0
  36. package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +128 -0
  37. package/dist/ai-artifacts/__tests__/ai-artifacts.test.d.ts +1 -0
  38. package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +109 -0
  39. package/dist/ai-artifacts/index.cjs +26 -0
  40. package/dist/ai-artifacts/index.d.ts +3 -0
  41. package/dist/ai-artifacts/index.mjs +5 -0
  42. package/dist/ai-artifacts/src/ai-artifacts.cjs +55 -0
  43. package/dist/ai-artifacts/src/ai-artifacts.css +633 -0
  44. package/dist/ai-artifacts/src/ai-artifacts.d.ts +93 -0
  45. package/dist/ai-artifacts/src/ai-artifacts.d.vue.ts +33 -0
  46. package/dist/ai-artifacts/src/ai-artifacts.mjs +49 -0
  47. package/dist/ai-artifacts/src/ai-artifacts.vue +803 -0
  48. package/dist/ai-artifacts/src/ai-artifacts.vue.d.ts +33 -0
  49. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +87 -0
  50. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.d.ts +1 -0
  51. package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +58 -0
  52. package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +227 -0
  53. package/dist/ai-bubble/__tests__/ai-bubble.test.d.ts +1 -0
  54. package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +123 -0
  55. package/dist/ai-bubble/index.cjs +26 -0
  56. package/dist/ai-bubble/index.d.ts +3 -0
  57. package/dist/ai-bubble/index.mjs +5 -0
  58. package/dist/ai-bubble/src/ai-bubble.cjs +86 -0
  59. package/dist/ai-bubble/src/ai-bubble.css +932 -0
  60. package/dist/ai-bubble/src/ai-bubble.d.ts +126 -0
  61. package/dist/ai-bubble/src/ai-bubble.d.vue.ts +110 -0
  62. package/dist/ai-bubble/src/ai-bubble.mjs +80 -0
  63. package/dist/ai-bubble/src/ai-bubble.vue +1300 -0
  64. package/dist/ai-bubble/src/ai-bubble.vue.d.ts +110 -0
  65. package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +82 -0
  66. package/dist/ai-chat/__tests__/ai-chat.ssr.test.d.ts +1 -0
  67. package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +69 -0
  68. package/dist/ai-chat/__tests__/ai-chat.test.cjs +169 -0
  69. package/dist/ai-chat/__tests__/ai-chat.test.d.ts +1 -0
  70. package/dist/ai-chat/__tests__/ai-chat.test.mjs +121 -0
  71. package/dist/ai-chat/index.cjs +26 -0
  72. package/dist/ai-chat/index.d.ts +3 -0
  73. package/dist/ai-chat/index.mjs +5 -0
  74. package/dist/ai-chat/src/ai-chat.cjs +41 -0
  75. package/dist/ai-chat/src/ai-chat.css +503 -0
  76. package/dist/ai-chat/src/ai-chat.d.ts +57 -0
  77. package/dist/ai-chat/src/ai-chat.d.vue.ts +43 -0
  78. package/dist/ai-chat/src/ai-chat.mjs +35 -0
  79. package/dist/ai-chat/src/ai-chat.vue +606 -0
  80. package/dist/ai-chat/src/ai-chat.vue.d.ts +43 -0
  81. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +66 -0
  82. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.d.ts +1 -0
  83. package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +48 -0
  84. package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +174 -0
  85. package/dist/ai-code-block/__tests__/ai-code-block.test.d.ts +1 -0
  86. package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +108 -0
  87. package/dist/ai-code-block/index.cjs +26 -0
  88. package/dist/ai-code-block/index.d.ts +3 -0
  89. package/dist/ai-code-block/index.mjs +5 -0
  90. package/dist/ai-code-block/src/ai-code-block.cjs +79 -0
  91. package/dist/ai-code-block/src/ai-code-block.css +589 -0
  92. package/dist/ai-code-block/src/ai-code-block.d.ts +76 -0
  93. package/dist/ai-code-block/src/ai-code-block.d.vue.ts +63 -0
  94. package/dist/ai-code-block/src/ai-code-block.mjs +73 -0
  95. package/dist/ai-code-block/src/ai-code-block.vue +706 -0
  96. package/dist/ai-code-block/src/ai-code-block.vue.d.ts +63 -0
  97. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +50 -0
  98. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.d.ts +1 -0
  99. package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +42 -0
  100. package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +67 -0
  101. package/dist/ai-conversations/__tests__/ai-conversations.test.d.ts +1 -0
  102. package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +51 -0
  103. package/dist/ai-conversations/index.cjs +26 -0
  104. package/dist/ai-conversations/index.d.ts +3 -0
  105. package/dist/ai-conversations/index.mjs +5 -0
  106. package/dist/ai-conversations/src/ai-conversations.cjs +69 -0
  107. package/dist/ai-conversations/src/ai-conversations.css +679 -0
  108. package/dist/ai-conversations/src/ai-conversations.d.ts +67 -0
  109. package/dist/ai-conversations/src/ai-conversations.d.vue.ts +52 -0
  110. package/dist/ai-conversations/src/ai-conversations.mjs +63 -0
  111. package/dist/ai-conversations/src/ai-conversations.vue +949 -0
  112. package/dist/ai-conversations/src/ai-conversations.vue.d.ts +52 -0
  113. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +62 -0
  114. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.d.ts +1 -0
  115. package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +50 -0
  116. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +315 -0
  117. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.d.ts +1 -0
  118. package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +226 -0
  119. package/dist/ai-editor-sender/index.cjs +26 -0
  120. package/dist/ai-editor-sender/index.d.ts +3 -0
  121. package/dist/ai-editor-sender/index.mjs +5 -0
  122. package/dist/ai-editor-sender/src/ai-editor-sender.cjs +66 -0
  123. package/dist/ai-editor-sender/src/ai-editor-sender.css +566 -0
  124. package/dist/ai-editor-sender/src/ai-editor-sender.d.ts +70 -0
  125. package/dist/ai-editor-sender/src/ai-editor-sender.d.vue.ts +70 -0
  126. package/dist/ai-editor-sender/src/ai-editor-sender.mjs +60 -0
  127. package/dist/ai-editor-sender/src/ai-editor-sender.vue +713 -0
  128. package/dist/ai-editor-sender/src/ai-editor-sender.vue.d.ts +70 -0
  129. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +49 -0
  130. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.d.ts +1 -0
  131. package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +41 -0
  132. package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +54 -0
  133. package/dist/ai-prompts/__tests__/ai-prompts.test.d.ts +1 -0
  134. package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +38 -0
  135. package/dist/ai-prompts/index.cjs +26 -0
  136. package/dist/ai-prompts/index.d.ts +3 -0
  137. package/dist/ai-prompts/index.mjs +5 -0
  138. package/dist/ai-prompts/src/ai-prompts.cjs +42 -0
  139. package/dist/ai-prompts/src/ai-prompts.css +572 -0
  140. package/dist/ai-prompts/src/ai-prompts.d.ts +45 -0
  141. package/dist/ai-prompts/src/ai-prompts.d.vue.ts +44 -0
  142. package/dist/ai-prompts/src/ai-prompts.mjs +36 -0
  143. package/dist/ai-prompts/src/ai-prompts.vue +646 -0
  144. package/dist/ai-prompts/src/ai-prompts.vue.d.ts +44 -0
  145. package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +33 -0
  146. package/dist/ai-provider/__tests__/ai-provider.ssr.test.d.ts +1 -0
  147. package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +34 -0
  148. package/dist/ai-provider/__tests__/ai-provider.test.cjs +38 -0
  149. package/dist/ai-provider/__tests__/ai-provider.test.d.ts +1 -0
  150. package/dist/ai-provider/__tests__/ai-provider.test.mjs +33 -0
  151. package/dist/ai-provider/index.cjs +38 -0
  152. package/dist/ai-provider/index.d.ts +4 -0
  153. package/dist/ai-provider/index.mjs +6 -0
  154. package/dist/ai-provider/src/ai-provider.cjs +7 -0
  155. package/dist/ai-provider/src/ai-provider.d.ts +88 -0
  156. package/dist/ai-provider/src/ai-provider.d.vue.ts +48 -0
  157. package/dist/ai-provider/src/ai-provider.mjs +1 -0
  158. package/dist/ai-provider/src/ai-provider.vue +24 -0
  159. package/dist/ai-provider/src/ai-provider.vue.d.ts +48 -0
  160. package/dist/ai-provider/src/use-ai-provider.cjs +11 -0
  161. package/dist/ai-provider/src/use-ai-provider.d.ts +10 -0
  162. package/dist/ai-provider/src/use-ai-provider.mjs +5 -0
  163. package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +46 -0
  164. package/dist/ai-sender/__tests__/ai-sender.ssr.test.d.ts +1 -0
  165. package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +37 -0
  166. package/dist/ai-sender/__tests__/ai-sender.test.cjs +388 -0
  167. package/dist/ai-sender/__tests__/ai-sender.test.d.ts +1 -0
  168. package/dist/ai-sender/__tests__/ai-sender.test.mjs +248 -0
  169. package/dist/ai-sender/index.cjs +26 -0
  170. package/dist/ai-sender/index.d.ts +3 -0
  171. package/dist/ai-sender/index.mjs +5 -0
  172. package/dist/ai-sender/src/ai-sender.cjs +91 -0
  173. package/dist/ai-sender/src/ai-sender.css +754 -0
  174. package/dist/ai-sender/src/ai-sender.d.ts +140 -0
  175. package/dist/ai-sender/src/ai-sender.d.vue.ts +69 -0
  176. package/dist/ai-sender/src/ai-sender.mjs +85 -0
  177. package/dist/ai-sender/src/ai-sender.vue +1032 -0
  178. package/dist/ai-sender/src/ai-sender.vue.d.ts +69 -0
  179. package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +72 -0
  180. package/dist/ai-sources/__tests__/ai-sources.ssr.test.d.ts +1 -0
  181. package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +82 -0
  182. package/dist/ai-sources/__tests__/ai-sources.test.cjs +93 -0
  183. package/dist/ai-sources/__tests__/ai-sources.test.d.ts +1 -0
  184. package/dist/ai-sources/__tests__/ai-sources.test.mjs +89 -0
  185. package/dist/ai-sources/index.cjs +26 -0
  186. package/dist/ai-sources/index.d.ts +3 -0
  187. package/dist/ai-sources/index.mjs +5 -0
  188. package/dist/ai-sources/src/ai-sources.cjs +59 -0
  189. package/dist/ai-sources/src/ai-sources.css +830 -0
  190. package/dist/ai-sources/src/ai-sources.d.ts +79 -0
  191. package/dist/ai-sources/src/ai-sources.d.vue.ts +45 -0
  192. package/dist/ai-sources/src/ai-sources.mjs +53 -0
  193. package/dist/ai-sources/src/ai-sources.vue +1109 -0
  194. package/dist/ai-sources/src/ai-sources.vue.d.ts +45 -0
  195. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +56 -0
  196. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.d.ts +1 -0
  197. package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +42 -0
  198. package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +151 -0
  199. package/dist/ai-thinking/__tests__/ai-thinking.test.d.ts +1 -0
  200. package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +96 -0
  201. package/dist/ai-thinking/index.cjs +26 -0
  202. package/dist/ai-thinking/index.d.ts +3 -0
  203. package/dist/ai-thinking/index.mjs +5 -0
  204. package/dist/ai-thinking/src/ai-thinking.cjs +44 -0
  205. package/dist/ai-thinking/src/ai-thinking.css +543 -0
  206. package/dist/ai-thinking/src/ai-thinking.d.ts +42 -0
  207. package/dist/ai-thinking/src/ai-thinking.d.vue.ts +33 -0
  208. package/dist/ai-thinking/src/ai-thinking.mjs +38 -0
  209. package/dist/ai-thinking/src/ai-thinking.vue +631 -0
  210. package/dist/ai-thinking/src/ai-thinking.vue.d.ts +33 -0
  211. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +83 -0
  212. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.d.ts +1 -0
  213. package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +52 -0
  214. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +204 -0
  215. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.d.ts +1 -0
  216. package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +134 -0
  217. package/dist/ai-thought-chain/index.cjs +26 -0
  218. package/dist/ai-thought-chain/index.d.ts +3 -0
  219. package/dist/ai-thought-chain/index.mjs +5 -0
  220. package/dist/ai-thought-chain/src/ai-thought-chain.cjs +68 -0
  221. package/dist/ai-thought-chain/src/ai-thought-chain.css +668 -0
  222. package/dist/ai-thought-chain/src/ai-thought-chain.d.ts +82 -0
  223. package/dist/ai-thought-chain/src/ai-thought-chain.d.vue.ts +83 -0
  224. package/dist/ai-thought-chain/src/ai-thought-chain.mjs +62 -0
  225. package/dist/ai-thought-chain/src/ai-thought-chain.vue +813 -0
  226. package/dist/ai-thought-chain/src/ai-thought-chain.vue.d.ts +83 -0
  227. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +32 -0
  228. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.d.ts +1 -0
  229. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +25 -0
  230. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +113 -0
  231. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.d.ts +1 -0
  232. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +93 -0
  233. package/dist/ai-voice-trigger/index.cjs +26 -0
  234. package/dist/ai-voice-trigger/index.d.ts +3 -0
  235. package/dist/ai-voice-trigger/index.mjs +5 -0
  236. package/dist/ai-voice-trigger/src/ai-voice-trigger.cjs +35 -0
  237. package/dist/ai-voice-trigger/src/ai-voice-trigger.css +603 -0
  238. package/dist/ai-voice-trigger/src/ai-voice-trigger.d.ts +37 -0
  239. package/dist/ai-voice-trigger/src/ai-voice-trigger.d.vue.ts +29 -0
  240. package/dist/ai-voice-trigger/src/ai-voice-trigger.mjs +29 -0
  241. package/dist/ai-voice-trigger/src/ai-voice-trigger.vue +708 -0
  242. package/dist/ai-voice-trigger/src/ai-voice-trigger.vue.d.ts +29 -0
  243. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +57 -0
  244. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.d.ts +1 -0
  245. package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +39 -0
  246. package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +169 -0
  247. package/dist/ai-welcome/__tests__/ai-welcome.test.d.ts +1 -0
  248. package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +113 -0
  249. package/dist/ai-welcome/index.cjs +26 -0
  250. package/dist/ai-welcome/index.d.ts +3 -0
  251. package/dist/ai-welcome/index.mjs +5 -0
  252. package/dist/ai-welcome/src/ai-welcome.cjs +56 -0
  253. package/dist/ai-welcome/src/ai-welcome.css +591 -0
  254. package/dist/ai-welcome/src/ai-welcome.d.ts +59 -0
  255. package/dist/ai-welcome/src/ai-welcome.d.vue.ts +51 -0
  256. package/dist/ai-welcome/src/ai-welcome.mjs +50 -0
  257. package/dist/ai-welcome/src/ai-welcome.vue +655 -0
  258. package/dist/ai-welcome/src/ai-welcome.vue.d.ts +51 -0
  259. package/dist/alert/src/alert.d.vue.ts +5 -5
  260. package/dist/alert/src/alert.vue.d.ts +5 -5
  261. package/dist/autocomplete/src/autocomplete.d.vue.ts +2 -2
  262. package/dist/autocomplete/src/autocomplete.vue.d.ts +2 -2
  263. package/dist/avatar/index.d.ts +39 -1
  264. package/dist/back-top/src/back-top.d.vue.ts +1 -1
  265. package/dist/back-top/src/back-top.vue.d.ts +1 -1
  266. package/dist/button/index.d.ts +3 -3
  267. package/dist/button/src/button.css +3 -3
  268. package/dist/button/src/button.d.vue.ts +1 -1
  269. package/dist/button/src/button.vue +3 -3
  270. package/dist/button/src/button.vue.d.ts +1 -1
  271. package/dist/calendar/src/calendar.d.vue.ts +2 -2
  272. package/dist/calendar/src/calendar.vue.d.ts +2 -2
  273. package/dist/cascader/src/cascader-panel.d.vue.ts +2 -2
  274. package/dist/cascader/src/cascader-panel.vue.d.ts +2 -2
  275. package/dist/checkbox/index.d.ts +3 -3
  276. package/dist/checkbox/src/checkbox-group.d.vue.ts +1 -1
  277. package/dist/checkbox/src/checkbox-group.vue +13 -1
  278. package/dist/checkbox/src/checkbox-group.vue.d.ts +1 -1
  279. package/dist/checkbox/src/checkbox.d.ts +12 -0
  280. package/dist/col/src/col.d.vue.ts +4 -4
  281. package/dist/col/src/col.vue.d.ts +4 -4
  282. package/dist/color-picker/src/color-picker.d.vue.ts +1 -1
  283. package/dist/color-picker/src/color-picker.vue.d.ts +1 -1
  284. package/dist/component.d.ts +63 -0
  285. package/dist/date-picker/src/date-picker.d.vue.ts +4 -4
  286. package/dist/date-picker/src/date-picker.vue.d.ts +4 -4
  287. package/dist/descriptions/src/description-item.d.vue.ts +1 -1
  288. package/dist/descriptions/src/description-item.vue.d.ts +1 -1
  289. package/dist/dialog/src/dialog.d.vue.ts +6 -6
  290. package/dist/dialog/src/dialog.vue.d.ts +6 -6
  291. package/dist/drawer/src/drawer.d.vue.ts +3 -3
  292. package/dist/drawer/src/drawer.vue.d.ts +3 -3
  293. package/dist/dropdown/src/dropdown-item.d.vue.ts +1 -1
  294. package/dist/dropdown/src/dropdown-item.vue.d.ts +1 -1
  295. package/dist/dropdown/src/dropdown.d.vue.ts +8 -8
  296. package/dist/dropdown/src/dropdown.vue.d.ts +8 -8
  297. package/dist/form/__tests__/form-schema.test.cjs +477 -24
  298. package/dist/form/__tests__/form-schema.test.mjs +277 -57
  299. package/dist/form/index.cjs +12 -0
  300. package/dist/form/index.d.ts +1 -2
  301. package/dist/form/index.mjs +1 -0
  302. package/dist/form/src/form-item.d.vue.ts +2 -1
  303. package/dist/form/src/form-item.vue +3 -1
  304. package/dist/form/src/form-item.vue.d.ts +2 -1
  305. package/dist/form/src/form-schema.cjs +2 -1
  306. package/dist/form/src/form-schema.d.ts +124 -19
  307. package/dist/form/src/form-schema.d.vue.ts +69 -19
  308. package/dist/form/src/form-schema.mjs +2 -1
  309. package/dist/form/src/form-schema.vue +522 -160
  310. package/dist/form/src/form-schema.vue.d.ts +69 -19
  311. package/dist/form/src/form.cjs +7 -0
  312. package/dist/form/src/form.d.ts +20 -0
  313. package/dist/form/src/form.d.vue.ts +10 -1
  314. package/dist/form/src/form.mjs +7 -0
  315. package/dist/form/src/form.vue +22 -10
  316. package/dist/form/src/form.vue.d.ts +10 -1
  317. package/dist/grid/src/grid.d.vue.ts +1 -1
  318. package/dist/grid/src/grid.vue.d.ts +1 -1
  319. package/dist/icon/src/icons/index.cjs +122 -2
  320. package/dist/icon/src/icons/index.d.ts +24 -0
  321. package/dist/icon/src/icons/index.mjs +145 -1
  322. package/dist/image/index.d.ts +356 -2
  323. package/dist/image/src/image-viewer.d.vue.ts +3 -3
  324. package/dist/image/src/image-viewer.vue.d.ts +3 -3
  325. package/dist/image/src/image.d.vue.ts +4 -4
  326. package/dist/image/src/image.vue.d.ts +4 -4
  327. package/dist/index.cjs +193 -1
  328. package/dist/index.d.ts +16 -0
  329. package/dist/index.mjs +49 -1
  330. package/dist/input/index.d.ts +18 -18
  331. package/dist/input/src/input.d.vue.ts +6 -6
  332. package/dist/input/src/input.vue.d.ts +6 -6
  333. package/dist/input-tag/src/input-tag.d.vue.ts +2 -2
  334. package/dist/input-tag/src/input-tag.vue.d.ts +2 -2
  335. package/dist/mention/src/mention.d.vue.ts +8 -8
  336. package/dist/mention/src/mention.vue.d.ts +8 -8
  337. package/dist/menu/src/menu.d.vue.ts +4 -4
  338. package/dist/menu/src/menu.vue.d.ts +4 -4
  339. package/dist/message/src/message.d.vue.ts +1 -1
  340. package/dist/message/src/message.vue.d.ts +1 -1
  341. package/dist/popconfirm/src/popconfirm.d.vue.ts +5 -5
  342. package/dist/popconfirm/src/popconfirm.vue.d.ts +5 -5
  343. package/dist/popover/src/popover.d.vue.ts +4 -4
  344. package/dist/popover/src/popover.vue.d.ts +4 -4
  345. package/dist/progress/src/progress.d.vue.ts +1 -1
  346. package/dist/progress/src/progress.vue.d.ts +1 -1
  347. package/dist/radio/src/radio-group.d.vue.ts +1 -1
  348. package/dist/radio/src/radio-group.vue +25 -4
  349. package/dist/radio/src/radio-group.vue.d.ts +1 -1
  350. package/dist/radio/src/radio.d.ts +12 -0
  351. package/dist/rate/src/rate.d.vue.ts +1 -1
  352. package/dist/rate/src/rate.vue.d.ts +1 -1
  353. package/dist/select/src/select.d.vue.ts +1 -1
  354. package/dist/select/src/select.vue.d.ts +1 -1
  355. package/dist/skeleton/src/skeleton.d.vue.ts +1 -1
  356. package/dist/skeleton/src/skeleton.vue.d.ts +1 -1
  357. package/dist/slider/src/slider.d.vue.ts +1 -1
  358. package/dist/slider/src/slider.vue.d.ts +1 -1
  359. package/dist/steps/src/step.d.vue.ts +1 -1
  360. package/dist/steps/src/step.vue.d.ts +1 -1
  361. package/dist/switch/src/switch.d.vue.ts +2 -2
  362. package/dist/switch/src/switch.vue.d.ts +2 -2
  363. package/dist/table/__tests__/table.perf.test.cjs +2 -2
  364. package/dist/table/__tests__/table.perf.test.mjs +2 -2
  365. package/dist/table/__tests__/table.test.cjs +18 -0
  366. package/dist/table/__tests__/table.test.mjs +18 -0
  367. package/dist/table/__tests__/use-table-import.test.cjs +6 -0
  368. package/dist/table/__tests__/use-table-import.test.mjs +8 -1
  369. package/dist/table/src/table-column.d.vue.ts +1 -1
  370. package/dist/table/src/table-column.vue.d.ts +1 -1
  371. package/dist/table/src/table.d.vue.ts +1 -1
  372. package/dist/table/src/table.vue.d.ts +1 -1
  373. package/dist/tabs/src/tab-pane.d.vue.ts +1 -1
  374. package/dist/tabs/src/tab-pane.vue.d.ts +1 -1
  375. package/dist/tabs/src/tabs.d.vue.ts +2 -2
  376. package/dist/tabs/src/tabs.vue.d.ts +2 -2
  377. package/dist/tooltip/index.d.ts +7 -7
  378. package/dist/tooltip/src/tooltip.d.vue.ts +7 -7
  379. package/dist/tooltip/src/tooltip.vue.d.ts +7 -7
  380. package/dist/tree/src/tree.d.vue.ts +1 -1
  381. package/dist/tree/src/tree.vue.d.ts +1 -1
  382. package/dist/tree-select/src/tree-select.d.vue.ts +3 -3
  383. package/dist/tree-select/src/tree-select.vue.d.ts +3 -3
  384. package/dist/upload/src/upload.d.vue.ts +1 -1
  385. package/dist/upload/src/upload.vue.d.ts +1 -1
  386. package/package.json +8 -5
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ var _vitest = require("vitest");
4
+ var _serverRenderer = require("@vue/server-renderer");
5
+ var _vue = require("vue");
6
+ _vitest.vi.mock("highlight.js", () => ({
7
+ default: {
8
+ getLanguage: lang => lang === "typescript",
9
+ highlight: _vitest.vi.fn(() => ({
10
+ value: "highlighted"
11
+ })),
12
+ highlightAuto: _vitest.vi.fn(() => ({
13
+ value: "auto"
14
+ }))
15
+ }
16
+ }));
17
+ _vitest.vi.mock("highlight.js/styles/atom-one-dark.css", () => ({}));
18
+ const {
19
+ default: AiCodeBlock
20
+ } = await Promise.resolve().then(() => require("../src/ai-code-block.vue"));
21
+ (0, _vitest.describe)("YhAiCodeBlock SSR", () => {
22
+ (0, _vitest.it)("should render to string on server", async () => {
23
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
24
+ code: "const x = 1",
25
+ language: "typescript"
26
+ }));
27
+ (0, _vitest.expect)(html).toContain("yh-ai-code-block");
28
+ });
29
+ (0, _vitest.it)("should render filename in header on server", async () => {
30
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
31
+ code: "const x = 1",
32
+ filename: "utils.ts"
33
+ }));
34
+ (0, _vitest.expect)(html).toContain("utils.ts");
35
+ (0, _vitest.expect)(html).toContain("yh-ai-code-block__lang");
36
+ });
37
+ (0, _vitest.it)("should render language in header when no filename on server", async () => {
38
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
39
+ code: "const x = 1",
40
+ language: "typescript"
41
+ }));
42
+ (0, _vitest.expect)(html).toContain("typescript");
43
+ });
44
+ (0, _vitest.it)("should render language class in code element on server", async () => {
45
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
46
+ code: "const x = 1",
47
+ language: "typescript"
48
+ }));
49
+ (0, _vitest.expect)(html).toContain("language-typescript");
50
+ });
51
+ (0, _vitest.it)("should render code body on server", async () => {
52
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
53
+ code: "sample code",
54
+ language: "text",
55
+ highlight: false
56
+ }));
57
+ (0, _vitest.expect)(html).toContain("sample code");
58
+ (0, _vitest.expect)(html).toContain("yh-ai-code-block__body");
59
+ });
60
+ (0, _vitest.it)("should render copy button on server", async () => {
61
+ const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(AiCodeBlock, {
62
+ code: "code"
63
+ }));
64
+ (0, _vitest.expect)(html).toContain("yh-ai-code-block__actions");
65
+ });
66
+ });
@@ -0,0 +1,48 @@
1
+ import { describe, it, expect, vi } from "vitest";
2
+ import { renderToString } from "@vue/server-renderer";
3
+ import { h } from "vue";
4
+ vi.mock("highlight.js", () => ({
5
+ default: {
6
+ getLanguage: (lang) => lang === "typescript",
7
+ highlight: vi.fn(() => ({ value: "highlighted" })),
8
+ highlightAuto: vi.fn(() => ({ value: "auto" }))
9
+ }
10
+ }));
11
+ vi.mock("highlight.js/styles/atom-one-dark.css", () => ({}));
12
+ const { default: AiCodeBlock } = await import("../src/ai-code-block.vue");
13
+ describe("YhAiCodeBlock SSR", () => {
14
+ it("should render to string on server", async () => {
15
+ const html = await renderToString(
16
+ h(AiCodeBlock, { code: "const x = 1", language: "typescript" })
17
+ );
18
+ expect(html).toContain("yh-ai-code-block");
19
+ });
20
+ it("should render filename in header on server", async () => {
21
+ const html = await renderToString(h(AiCodeBlock, { code: "const x = 1", filename: "utils.ts" }));
22
+ expect(html).toContain("utils.ts");
23
+ expect(html).toContain("yh-ai-code-block__lang");
24
+ });
25
+ it("should render language in header when no filename on server", async () => {
26
+ const html = await renderToString(
27
+ h(AiCodeBlock, { code: "const x = 1", language: "typescript" })
28
+ );
29
+ expect(html).toContain("typescript");
30
+ });
31
+ it("should render language class in code element on server", async () => {
32
+ const html = await renderToString(
33
+ h(AiCodeBlock, { code: "const x = 1", language: "typescript" })
34
+ );
35
+ expect(html).toContain("language-typescript");
36
+ });
37
+ it("should render code body on server", async () => {
38
+ const html = await renderToString(
39
+ h(AiCodeBlock, { code: "sample code", language: "text", highlight: false })
40
+ );
41
+ expect(html).toContain("sample code");
42
+ expect(html).toContain("yh-ai-code-block__body");
43
+ });
44
+ it("should render copy button on server", async () => {
45
+ const html = await renderToString(h(AiCodeBlock, { code: "code" }));
46
+ expect(html).toContain("yh-ai-code-block__actions");
47
+ });
48
+ });
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+
3
+ var _vitest = require("vitest");
4
+ var _testUtils = require("@vue/test-utils");
5
+ _vitest.vi.mock("highlight.js", () => ({
6
+ default: {
7
+ getLanguage: lang => lang === "typescript" || lang === "javascript" || lang === "python",
8
+ highlight: _vitest.vi.fn((_code, _opts) => ({
9
+ value: '<span class="hljs-keyword">const</span>'
10
+ })),
11
+ highlightAuto: _vitest.vi.fn(() => ({
12
+ value: "<span>auto</span>"
13
+ }))
14
+ }
15
+ }));
16
+ _vitest.vi.mock("highlight.js/styles/atom-one-dark.css", () => ({}));
17
+ const {
18
+ default: AiCodeBlock
19
+ } = await Promise.resolve().then(() => require("../src/ai-code-block.vue"));
20
+ (0, _vitest.describe)("YhAiCodeBlock", () => {
21
+ (0, _vitest.beforeEach)(() => {
22
+ const mockClipboard = {
23
+ writeText: _vitest.vi.fn().mockResolvedValue(void 0)
24
+ };
25
+ Object.defineProperty(navigator, "clipboard", {
26
+ value: mockClipboard,
27
+ writable: true,
28
+ configurable: true
29
+ });
30
+ });
31
+ (0, _vitest.it)("should render with base class", () => {
32
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
33
+ props: {
34
+ code: "const x = 1"
35
+ }
36
+ });
37
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block").exists()).toBe(true);
38
+ });
39
+ (0, _vitest.it)("should render header and body", () => {
40
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
41
+ props: {
42
+ code: "const x = 1"
43
+ }
44
+ });
45
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__header").exists()).toBe(true);
46
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__body").exists()).toBe(true);
47
+ });
48
+ (0, _vitest.it)("should show filename in lang label when filename provided", () => {
49
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
50
+ props: {
51
+ code: "const x = 1",
52
+ language: "typescript",
53
+ filename: "utils.ts"
54
+ }
55
+ });
56
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__lang").text()).toBe("utils.ts");
57
+ });
58
+ (0, _vitest.it)("should show language in lang label when filename not provided", () => {
59
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
60
+ props: {
61
+ code: "const x = 1",
62
+ language: "typescript"
63
+ }
64
+ });
65
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__lang").text()).toBe("typescript");
66
+ });
67
+ (0, _vitest.it)("should show text as default language", () => {
68
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
69
+ props: {
70
+ code: "plain text"
71
+ }
72
+ });
73
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__lang").text()).toBe("text");
74
+ });
75
+ (0, _vitest.it)("should render code element with language class", () => {
76
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
77
+ props: {
78
+ code: "const x = 1",
79
+ language: "typescript"
80
+ }
81
+ });
82
+ const code = wrapper.find("code");
83
+ (0, _vitest.expect)(code.classes()).toContain("language-typescript");
84
+ });
85
+ (0, _vitest.it)("should render code content", () => {
86
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
87
+ props: {
88
+ code: "hello world",
89
+ language: "text",
90
+ highlight: false
91
+ }
92
+ });
93
+ (0, _vitest.expect)(wrapper.html()).toContain("hello world");
94
+ });
95
+ (0, _vitest.it)("should apply hljs class to code element", () => {
96
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
97
+ props: {
98
+ code: "const x = 1"
99
+ }
100
+ });
101
+ (0, _vitest.expect)(wrapper.find("code").classes()).toContain("hljs");
102
+ });
103
+ (0, _vitest.it)("should render highlighted code when highlight=true and language recognized", () => {
104
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
105
+ props: {
106
+ code: "const x = 1",
107
+ language: "typescript",
108
+ highlight: true
109
+ }
110
+ });
111
+ (0, _vitest.expect)(wrapper.find("code").html()).toContain("hljs-keyword");
112
+ });
113
+ (0, _vitest.it)("should render raw code when highlight=false", () => {
114
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
115
+ props: {
116
+ code: "raw code here",
117
+ language: "typescript",
118
+ highlight: false
119
+ }
120
+ });
121
+ (0, _vitest.expect)(wrapper.find("code").html()).toContain("raw code here");
122
+ });
123
+ (0, _vitest.it)("should show copy button", () => {
124
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
125
+ props: {
126
+ code: "const x = 1"
127
+ }
128
+ });
129
+ (0, _vitest.expect)(wrapper.find(".yh-ai-code-block__actions .yh-button").exists()).toBe(true);
130
+ });
131
+ (0, _vitest.it)("should emit copy event and call clipboard on copy click", async () => {
132
+ const code = "const x = 1";
133
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
134
+ props: {
135
+ code
136
+ }
137
+ });
138
+ await wrapper.find(".yh-ai-code-block__actions .yh-button").trigger("click");
139
+ (0, _vitest.expect)(navigator.clipboard.writeText).toHaveBeenCalledWith(code);
140
+ (0, _vitest.expect)(wrapper.emitted("copy")).toBeTruthy();
141
+ (0, _vitest.expect)(wrapper.emitted("copy")[0][0]).toBe(code);
142
+ });
143
+ (0, _vitest.it)("should NOT emit copy when code is empty", async () => {
144
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
145
+ props: {
146
+ code: ""
147
+ }
148
+ });
149
+ await wrapper.find(".yh-ai-code-block__actions .yh-button").trigger("click");
150
+ (0, _vitest.expect)(wrapper.emitted("copy")).toBeFalsy();
151
+ });
152
+ (0, _vitest.it)("should render default slot instead of code when slot provided", () => {
153
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
154
+ props: {
155
+ code: "ignored code"
156
+ },
157
+ slots: {
158
+ default: '<em class="custom-code">custom</em>'
159
+ }
160
+ });
161
+ (0, _vitest.expect)(wrapper.find(".custom-code").exists()).toBe(true);
162
+ });
163
+ (0, _vitest.it)("should render actions slot", () => {
164
+ const wrapper = (0, _testUtils.mount)(AiCodeBlock, {
165
+ props: {
166
+ code: "code"
167
+ },
168
+ slots: {
169
+ actions: '<button class="extra-action">Run</button>'
170
+ }
171
+ });
172
+ (0, _vitest.expect)(wrapper.find(".extra-action").exists()).toBe(true);
173
+ });
174
+ });
@@ -0,0 +1,108 @@
1
+ import { describe, it, expect, vi, beforeEach } from "vitest";
2
+ import { mount } from "@vue/test-utils";
3
+ vi.mock("highlight.js", () => ({
4
+ default: {
5
+ getLanguage: (lang) => lang === "typescript" || lang === "javascript" || lang === "python",
6
+ highlight: vi.fn((_code, _opts) => ({
7
+ value: '<span class="hljs-keyword">const</span>'
8
+ })),
9
+ highlightAuto: vi.fn(() => ({ value: "<span>auto</span>" }))
10
+ }
11
+ }));
12
+ vi.mock("highlight.js/styles/atom-one-dark.css", () => ({}));
13
+ const { default: AiCodeBlock } = await import("../src/ai-code-block.vue");
14
+ describe("YhAiCodeBlock", () => {
15
+ beforeEach(() => {
16
+ const mockClipboard = { writeText: vi.fn().mockResolvedValue(void 0) };
17
+ Object.defineProperty(navigator, "clipboard", {
18
+ value: mockClipboard,
19
+ writable: true,
20
+ configurable: true
21
+ });
22
+ });
23
+ it("should render with base class", () => {
24
+ const wrapper = mount(AiCodeBlock, { props: { code: "const x = 1" } });
25
+ expect(wrapper.find(".yh-ai-code-block").exists()).toBe(true);
26
+ });
27
+ it("should render header and body", () => {
28
+ const wrapper = mount(AiCodeBlock, { props: { code: "const x = 1" } });
29
+ expect(wrapper.find(".yh-ai-code-block__header").exists()).toBe(true);
30
+ expect(wrapper.find(".yh-ai-code-block__body").exists()).toBe(true);
31
+ });
32
+ it("should show filename in lang label when filename provided", () => {
33
+ const wrapper = mount(AiCodeBlock, {
34
+ props: { code: "const x = 1", language: "typescript", filename: "utils.ts" }
35
+ });
36
+ expect(wrapper.find(".yh-ai-code-block__lang").text()).toBe("utils.ts");
37
+ });
38
+ it("should show language in lang label when filename not provided", () => {
39
+ const wrapper = mount(AiCodeBlock, {
40
+ props: { code: "const x = 1", language: "typescript" }
41
+ });
42
+ expect(wrapper.find(".yh-ai-code-block__lang").text()).toBe("typescript");
43
+ });
44
+ it("should show text as default language", () => {
45
+ const wrapper = mount(AiCodeBlock, { props: { code: "plain text" } });
46
+ expect(wrapper.find(".yh-ai-code-block__lang").text()).toBe("text");
47
+ });
48
+ it("should render code element with language class", () => {
49
+ const wrapper = mount(AiCodeBlock, {
50
+ props: { code: "const x = 1", language: "typescript" }
51
+ });
52
+ const code = wrapper.find("code");
53
+ expect(code.classes()).toContain("language-typescript");
54
+ });
55
+ it("should render code content", () => {
56
+ const wrapper = mount(AiCodeBlock, {
57
+ props: { code: "hello world", language: "text", highlight: false }
58
+ });
59
+ expect(wrapper.html()).toContain("hello world");
60
+ });
61
+ it("should apply hljs class to code element", () => {
62
+ const wrapper = mount(AiCodeBlock, { props: { code: "const x = 1" } });
63
+ expect(wrapper.find("code").classes()).toContain("hljs");
64
+ });
65
+ it("should render highlighted code when highlight=true and language recognized", () => {
66
+ const wrapper = mount(AiCodeBlock, {
67
+ props: { code: "const x = 1", language: "typescript", highlight: true }
68
+ });
69
+ expect(wrapper.find("code").html()).toContain("hljs-keyword");
70
+ });
71
+ it("should render raw code when highlight=false", () => {
72
+ const wrapper = mount(AiCodeBlock, {
73
+ props: { code: "raw code here", language: "typescript", highlight: false }
74
+ });
75
+ expect(wrapper.find("code").html()).toContain("raw code here");
76
+ });
77
+ it("should show copy button", () => {
78
+ const wrapper = mount(AiCodeBlock, { props: { code: "const x = 1" } });
79
+ expect(wrapper.find(".yh-ai-code-block__actions .yh-button").exists()).toBe(true);
80
+ });
81
+ it("should emit copy event and call clipboard on copy click", async () => {
82
+ const code = "const x = 1";
83
+ const wrapper = mount(AiCodeBlock, { props: { code } });
84
+ await wrapper.find(".yh-ai-code-block__actions .yh-button").trigger("click");
85
+ expect(navigator.clipboard.writeText).toHaveBeenCalledWith(code);
86
+ expect(wrapper.emitted("copy")).toBeTruthy();
87
+ expect(wrapper.emitted("copy")[0][0]).toBe(code);
88
+ });
89
+ it("should NOT emit copy when code is empty", async () => {
90
+ const wrapper = mount(AiCodeBlock, { props: { code: "" } });
91
+ await wrapper.find(".yh-ai-code-block__actions .yh-button").trigger("click");
92
+ expect(wrapper.emitted("copy")).toBeFalsy();
93
+ });
94
+ it("should render default slot instead of code when slot provided", () => {
95
+ const wrapper = mount(AiCodeBlock, {
96
+ props: { code: "ignored code" },
97
+ slots: { default: '<em class="custom-code">custom</em>' }
98
+ });
99
+ expect(wrapper.find(".custom-code").exists()).toBe(true);
100
+ });
101
+ it("should render actions slot", () => {
102
+ const wrapper = mount(AiCodeBlock, {
103
+ props: { code: "code" },
104
+ slots: { actions: '<button class="extra-action">Run</button>' }
105
+ });
106
+ expect(wrapper.find(".extra-action").exists()).toBe(true);
107
+ });
108
+ });
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ YhAiCodeBlock: true
8
+ };
9
+ module.exports = exports.YhAiCodeBlock = void 0;
10
+ var _utils = require("@yh-ui/utils");
11
+ var _aiCodeBlock = _interopRequireDefault(require("./src/ai-code-block.vue"));
12
+ var _aiCodeBlock2 = require("./src/ai-code-block.cjs");
13
+ Object.keys(_aiCodeBlock2).forEach(function (key) {
14
+ if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
+ if (key in exports && exports[key] === _aiCodeBlock2[key]) return;
17
+ Object.defineProperty(exports, key, {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _aiCodeBlock2[key];
21
+ }
22
+ });
23
+ });
24
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
25
+ const YhAiCodeBlock = exports.YhAiCodeBlock = (0, _utils.withInstall)(_aiCodeBlock.default);
26
+ module.exports = YhAiCodeBlock;
@@ -0,0 +1,3 @@
1
+ export declare const YhAiCodeBlock: any;
2
+ export default YhAiCodeBlock;
3
+ export * from './src/ai-code-block';
@@ -0,0 +1,5 @@
1
+ import { withInstall } from "@yh-ui/utils";
2
+ import AiCodeBlock from "./src/ai-code-block.vue";
3
+ export const YhAiCodeBlock = withInstall(AiCodeBlock);
4
+ export default YhAiCodeBlock;
5
+ export * from "./src/ai-code-block.mjs";
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.aiCodeBlockProps = exports.aiCodeBlockEmits = void 0;
7
+ const aiCodeBlockProps = exports.aiCodeBlockProps = {
8
+ /**
9
+ * @description 代码语言
10
+ */
11
+ language: {
12
+ type: String,
13
+ default: "text"
14
+ },
15
+ /**
16
+ * @description 代码内容
17
+ */
18
+ code: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ /**
23
+ * @description 文件名称
24
+ */
25
+ filename: String,
26
+ /**
27
+ * @description 是否显示行号
28
+ */
29
+ showLineNumbers: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+ /**
34
+ * @description 高亮行号列表
35
+ */
36
+ highlightLines: {
37
+ type: Array,
38
+ default: () => []
39
+ },
40
+ /**
41
+ * @description 是否可折叠
42
+ */
43
+ collapsible: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ /**
48
+ * @description 默认是否折叠
49
+ */
50
+ defaultCollapsed: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ /**
55
+ * @description 是否显示运行按钮
56
+ */
57
+ showRun: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ /**
62
+ * @description 是否高亮语法
63
+ */
64
+ highlight: {
65
+ type: Boolean,
66
+ default: true
67
+ },
68
+ /**
69
+ * @description 主题覆盖变量
70
+ */
71
+ themeOverrides: {
72
+ type: Object,
73
+ default: void 0
74
+ }
75
+ };
76
+ const aiCodeBlockEmits = exports.aiCodeBlockEmits = {
77
+ copy: code => typeof code === "string",
78
+ run: code => typeof code === "string"
79
+ };