@icen.ai/ui 0.10.0 → 0.11.0

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 (355) hide show
  1. package/AGENTS.md +79 -309
  2. package/LICENSE +21 -0
  3. package/README.md +43 -54
  4. package/dist/base.css +57 -16
  5. package/dist/behaviors/accordion.mjs +1 -1
  6. package/dist/behaviors/ai-branch.mjs +1 -0
  7. package/dist/behaviors/ai-chat.d.mts +2 -2
  8. package/dist/behaviors/ai-chat.mjs +53 -10
  9. package/dist/behaviors/ai-composer.d.mts +5 -5
  10. package/dist/behaviors/ai-composer.mjs +21 -10
  11. package/dist/behaviors/ai-core.mjs +1 -0
  12. package/dist/behaviors/ai-diff.mjs +1 -0
  13. package/dist/behaviors/ai-feedback.mjs +1 -0
  14. package/dist/behaviors/ai-panel.d.mts +2 -2
  15. package/dist/behaviors/ai-panel.mjs +1 -0
  16. package/dist/behaviors/ai-provider.d.mts +1 -1
  17. package/dist/behaviors/ai-provider.mjs +1 -0
  18. package/dist/behaviors/ai-threads.mjs +1 -0
  19. package/dist/behaviors/ai-tool.d.mts +1 -1
  20. package/dist/behaviors/ai-tool.mjs +57 -24
  21. package/dist/behaviors/ai-tools.mjs +937 -28
  22. package/dist/behaviors/autocomplete.d.mts +1 -1
  23. package/dist/behaviors/autocomplete.mjs +1 -0
  24. package/dist/behaviors/back-top.mjs +1 -0
  25. package/dist/behaviors/carousel.mjs +8 -1
  26. package/dist/behaviors/cascader.mjs +14 -0
  27. package/dist/behaviors/charts.mjs +56 -20
  28. package/dist/behaviors/code-block.mjs +9 -1
  29. package/dist/behaviors/command-palette.mjs +3 -3
  30. package/dist/behaviors/context-menu.d.mts +2 -2
  31. package/dist/behaviors/context-menu.mjs +1 -0
  32. package/dist/behaviors/controls.d.mts +8 -8
  33. package/dist/behaviors/controls.mjs +37 -6
  34. package/dist/behaviors/copy.mjs +1 -0
  35. package/dist/behaviors/datatable.d.mts +3 -3
  36. package/dist/behaviors/datatable.mjs +76 -11
  37. package/dist/behaviors/date-picker.mjs +1 -0
  38. package/dist/behaviors/events.d.mts +10 -10
  39. package/dist/behaviors/events.mjs +11 -1
  40. package/dist/behaviors/form-validate.d.mts +10 -1
  41. package/dist/behaviors/form-validate.mjs +266 -4611
  42. package/dist/behaviors/i18n.d.mts +1 -0
  43. package/dist/behaviors/i18n.mjs +2 -0
  44. package/dist/behaviors/input.mjs +3 -0
  45. package/dist/behaviors/kb-access.d.mts +2 -2
  46. package/dist/behaviors/kb-access.mjs +8 -2
  47. package/dist/behaviors/kb-acl.d.mts +2 -2
  48. package/dist/behaviors/kb-acl.mjs +1 -0
  49. package/dist/behaviors/kb-answer.d.mts +2 -2
  50. package/dist/behaviors/kb-answer.mjs +56 -23
  51. package/dist/behaviors/kb-audit.d.mts +2 -2
  52. package/dist/behaviors/kb-audit.mjs +1 -0
  53. package/dist/behaviors/kb-canvas.d.mts +3 -3
  54. package/dist/behaviors/kb-canvas.mjs +1 -0
  55. package/dist/behaviors/kb-chain.d.mts +2 -2
  56. package/dist/behaviors/kb-chain.mjs +1 -0
  57. package/dist/behaviors/kb-checkpoint.d.mts +2 -2
  58. package/dist/behaviors/kb-checkpoint.mjs +1 -0
  59. package/dist/behaviors/kb-chunks.d.mts +2 -2
  60. package/dist/behaviors/kb-chunks.mjs +1 -0
  61. package/dist/behaviors/kb-citation.d.mts +2 -2
  62. package/dist/behaviors/kb-citation.mjs +20 -6
  63. package/dist/behaviors/kb-clarify.d.mts +2 -2
  64. package/dist/behaviors/kb-clarify.mjs +1 -0
  65. package/dist/behaviors/kb-conflict.d.mts +2 -2
  66. package/dist/behaviors/kb-conflict.mjs +1 -0
  67. package/dist/behaviors/kb-connector.d.mts +2 -2
  68. package/dist/behaviors/kb-connector.mjs +1 -0
  69. package/dist/behaviors/kb-core.d.mts +1 -1
  70. package/dist/behaviors/kb-core.mjs +1 -0
  71. package/dist/behaviors/kb-eval.d.mts +2 -2
  72. package/dist/behaviors/kb-eval.mjs +8 -2
  73. package/dist/behaviors/kb-explain.d.mts +2 -2
  74. package/dist/behaviors/kb-explain.mjs +13 -2
  75. package/dist/behaviors/kb-filter.d.mts +2 -2
  76. package/dist/behaviors/kb-filter.mjs +8 -2
  77. package/dist/behaviors/kb-gap.d.mts +2 -2
  78. package/dist/behaviors/kb-gap.mjs +1 -0
  79. package/dist/behaviors/kb-hittest.d.mts +2 -2
  80. package/dist/behaviors/kb-hittest.mjs +2 -1
  81. package/dist/behaviors/kb-metadata.mjs +6 -0
  82. package/dist/behaviors/kb-passage.d.mts +2 -2
  83. package/dist/behaviors/kb-passage.mjs +1 -0
  84. package/dist/behaviors/kb-pipeline.d.mts +2 -2
  85. package/dist/behaviors/kb-pipeline.mjs +1 -0
  86. package/dist/behaviors/kb-qa.mjs +1 -0
  87. package/dist/behaviors/kb-rerank.d.mts +2 -2
  88. package/dist/behaviors/kb-rerank.mjs +1 -0
  89. package/dist/behaviors/kb-retrieval.d.mts +2 -2
  90. package/dist/behaviors/kb-retrieval.mjs +18 -4
  91. package/dist/behaviors/kb-review.d.mts +2 -2
  92. package/dist/behaviors/kb-review.mjs +8 -2
  93. package/dist/behaviors/kb-sandbox.d.mts +2 -2
  94. package/dist/behaviors/kb-sandbox.mjs +7 -1
  95. package/dist/behaviors/kb-segment.d.mts +2 -2
  96. package/dist/behaviors/kb-segment.mjs +2 -1
  97. package/dist/behaviors/kb-select.mjs +8 -2
  98. package/dist/behaviors/kb-sources.d.mts +2 -2
  99. package/dist/behaviors/kb-sources.mjs +1 -0
  100. package/dist/behaviors/kb-sql.d.mts +2 -2
  101. package/dist/behaviors/kb-sql.mjs +1 -0
  102. package/dist/behaviors/kb-trace.d.mts +2 -2
  103. package/dist/behaviors/kb-trace.mjs +9 -3
  104. package/dist/behaviors/kb-visibility.d.mts +2 -2
  105. package/dist/behaviors/kb-visibility.mjs +1 -0
  106. package/dist/behaviors/kb-who-can.d.mts +2 -2
  107. package/dist/behaviors/kb-who-can.mjs +8 -2
  108. package/dist/behaviors/mentions.d.mts +1 -1
  109. package/dist/behaviors/mentions.mjs +1 -0
  110. package/dist/behaviors/modal.d.mts +1 -1
  111. package/dist/behaviors/modal.mjs +1 -0
  112. package/dist/behaviors/notification.d.mts +2 -2
  113. package/dist/behaviors/notification.mjs +14 -3
  114. package/dist/behaviors/panel.mjs +1 -0
  115. package/dist/behaviors/scroll-area.d.mts +17 -0
  116. package/dist/behaviors/scroll-area.mjs +59 -0
  117. package/dist/behaviors/select.mjs +8 -2
  118. package/dist/behaviors/slider.mjs +3 -3
  119. package/dist/behaviors/split-pane.mjs +2 -0
  120. package/dist/behaviors/suggestions.mjs +1 -0
  121. package/dist/behaviors/tabs.mjs +10 -0
  122. package/dist/behaviors/tag-input.mjs +1 -0
  123. package/dist/behaviors/theme-switcher.d.mts +2 -2
  124. package/dist/behaviors/theme-switcher.mjs +17 -2
  125. package/dist/behaviors/theme.mjs +16 -2
  126. package/dist/behaviors/toast.d.mts +2 -2
  127. package/dist/behaviors/toast.mjs +1 -0
  128. package/dist/behaviors/tree-select.mjs +14 -0
  129. package/dist/behaviors/tree.mjs +4 -4
  130. package/dist/behaviors/upload.mjs +1 -0
  131. package/dist/behaviors/url-safety.d.mts +8 -0
  132. package/dist/behaviors/url-safety.mjs +11 -0
  133. package/dist/components/accordion.d.mts +2 -0
  134. package/dist/components/ai-branch.d.mts +2 -0
  135. package/dist/components/ai-chat.css +40 -33
  136. package/dist/components/ai-chat.d.mts +2 -0
  137. package/dist/components/ai-composer.d.mts +2 -0
  138. package/dist/components/ai-context.d.mts +2 -0
  139. package/dist/components/ai-context.mjs +1 -0
  140. package/dist/components/ai-diff.css +6 -6
  141. package/dist/components/ai-diff.d.mts +2 -0
  142. package/dist/components/ai-feedback.d.mts +2 -0
  143. package/dist/components/ai-files.d.mts +2 -0
  144. package/dist/components/ai-message.d.mts +2 -0
  145. package/dist/components/ai-panel.css +12 -10
  146. package/dist/components/ai-reasoning.d.mts +2 -0
  147. package/dist/components/ai-subagent.d.mts +2 -0
  148. package/dist/components/ai-subagent.mjs +1 -0
  149. package/dist/components/ai-threads.d.mts +2 -0
  150. package/dist/components/ai-todo.d.mts +2 -0
  151. package/dist/components/ai-todo.mjs +1 -0
  152. package/dist/components/ai-tool-call.d.mts +2 -0
  153. package/dist/components/ai-tool-call.mjs +1 -0
  154. package/dist/components/ai-tool.css +16 -16
  155. package/dist/components/ai-usage.d.mts +2 -0
  156. package/dist/components/alert.d.mts +2 -0
  157. package/dist/components/autocomplete.css +12 -12
  158. package/dist/components/autocomplete.d.mts +2 -0
  159. package/dist/components/avatar.d.mts +2 -0
  160. package/dist/components/back-top.css +47 -16
  161. package/dist/components/back-top.d.mts +2 -0
  162. package/dist/components/badge.css +1 -1
  163. package/dist/components/badge.d.mts +2 -0
  164. package/dist/components/breadcrumb.css +26 -8
  165. package/dist/components/breadcrumb.d.mts +2 -0
  166. package/dist/components/btn.css +67 -62
  167. package/dist/components/btn.d.mts +2 -0
  168. package/dist/components/card.css +22 -22
  169. package/dist/components/card.d.mts +2 -0
  170. package/dist/components/carousel.d.mts +2 -0
  171. package/dist/components/cascader.css +56 -35
  172. package/dist/components/cascader.d.mts +2 -0
  173. package/dist/components/chart-area.css +46 -0
  174. package/dist/components/chart-area.d.mts +2 -0
  175. package/dist/components/chart-bar.css +66 -19
  176. package/dist/components/chart-bar.d.mts +2 -0
  177. package/dist/components/chart-calendar.d.mts +2 -0
  178. package/dist/components/chart-gauge.css +23 -3
  179. package/dist/components/chart-gauge.d.mts +2 -0
  180. package/dist/components/chart-graph.css +15 -3
  181. package/dist/components/chart-graph.d.mts +2 -0
  182. package/dist/components/chart-heatmap.css +117 -95
  183. package/dist/components/chart-heatmap.d.mts +2 -0
  184. package/dist/components/chart-line.css +54 -0
  185. package/dist/components/chart-line.d.mts +2 -0
  186. package/dist/components/chart-map.d.mts +2 -0
  187. package/dist/components/chart-pie.css +29 -0
  188. package/dist/components/chart-pie.d.mts +2 -0
  189. package/dist/components/chart-radar.css +50 -1
  190. package/dist/components/chart-radar.d.mts +2 -0
  191. package/dist/components/chart-scatter.css +39 -2
  192. package/dist/components/chart-scatter.d.mts +2 -0
  193. package/dist/components/chart-sparkline.css +20 -0
  194. package/dist/components/chart-sparkline.d.mts +2 -0
  195. package/dist/components/chart-stack.css +16 -5
  196. package/dist/components/chart-stack.d.mts +2 -0
  197. package/dist/components/charts.css +80 -35
  198. package/dist/components/charts.d.mts +2 -0
  199. package/dist/components/code-block.css +10 -8
  200. package/dist/components/code-block.d.mts +2 -0
  201. package/dist/components/command-palette.css +45 -38
  202. package/dist/components/command-palette.d.mts +2 -0
  203. package/dist/components/content.css +62 -57
  204. package/dist/components/context-menu.d.mts +2 -0
  205. package/dist/components/copy.css +10 -10
  206. package/dist/components/copy.d.mts +2 -0
  207. package/dist/components/datatable.css +72 -59
  208. package/dist/components/datatable.d.mts +2 -0
  209. package/dist/components/date-picker.css +26 -26
  210. package/dist/components/date-picker.d.mts +2 -0
  211. package/dist/components/desc.d.mts +2 -0
  212. package/dist/components/dropdown.d.mts +2 -0
  213. package/dist/components/empty.css +16 -16
  214. package/dist/components/empty.d.mts +2 -0
  215. package/dist/components/feedback.css +31 -29
  216. package/dist/components/form-validate.css +20 -6
  217. package/dist/components/form-validate.d.mts +2 -0
  218. package/dist/components/form.css +17 -14
  219. package/dist/components/form.d.mts +2 -0
  220. package/dist/components/icon.css +21 -10
  221. package/dist/components/icon.d.mts +2 -0
  222. package/dist/components/input.css +22 -22
  223. package/dist/components/input.d.mts +2 -0
  224. package/dist/components/kb-access.d.mts +2 -0
  225. package/dist/components/kb-acl.d.mts +2 -0
  226. package/dist/components/kb-agent.css +134 -55
  227. package/dist/components/kb-answer.d.mts +2 -0
  228. package/dist/components/kb-audit.d.mts +2 -0
  229. package/dist/components/kb-canvas.d.mts +2 -0
  230. package/dist/components/kb-chain.d.mts +2 -0
  231. package/dist/components/kb-checkpoint.d.mts +2 -0
  232. package/dist/components/kb-chunks.d.mts +2 -0
  233. package/dist/components/kb-citation.d.mts +2 -0
  234. package/dist/components/kb-clarify.d.mts +2 -0
  235. package/dist/components/kb-conflict.d.mts +2 -0
  236. package/dist/components/kb-connector.d.mts +2 -0
  237. package/dist/components/kb-data.css +192 -80
  238. package/dist/components/kb-eval.d.mts +2 -0
  239. package/dist/components/kb-explain.d.mts +2 -0
  240. package/dist/components/kb-filter.d.mts +2 -0
  241. package/dist/components/kb-gap.d.mts +2 -0
  242. package/dist/components/kb-ground.css +165 -73
  243. package/dist/components/kb-hittest.d.mts +2 -0
  244. package/dist/components/kb-ingest.css +308 -113
  245. package/dist/components/kb-metadata.d.mts +2 -0
  246. package/dist/components/kb-ops.css +189 -75
  247. package/dist/components/kb-passage.d.mts +2 -0
  248. package/dist/components/kb-perm.css +158 -87
  249. package/dist/components/kb-pipeline.d.mts +2 -0
  250. package/dist/components/kb-qa.d.mts +2 -0
  251. package/dist/components/kb-rerank.d.mts +2 -0
  252. package/dist/components/kb-retrieval.d.mts +2 -0
  253. package/dist/components/kb-review.d.mts +2 -0
  254. package/dist/components/kb-sandbox.d.mts +2 -0
  255. package/dist/components/kb-search.css +353 -116
  256. package/dist/components/kb-segment.d.mts +2 -0
  257. package/dist/components/kb-sources.d.mts +2 -0
  258. package/dist/components/kb-sql.d.mts +2 -0
  259. package/dist/components/kb-trace.d.mts +2 -0
  260. package/dist/components/kb-visibility.d.mts +2 -0
  261. package/dist/components/kb-who-can.d.mts +2 -0
  262. package/dist/components/kb.css +60 -36
  263. package/dist/components/kb.d.mts +2 -0
  264. package/dist/components/kbd.d.mts +2 -0
  265. package/dist/components/layout.css +10 -10
  266. package/dist/components/layout.d.mts +2 -0
  267. package/dist/components/list.d.mts +2 -0
  268. package/dist/components/material-chinese.css +10 -0
  269. package/dist/components/material-soviet.css +10 -0
  270. package/dist/components/material.css +61 -18
  271. package/dist/components/media-card.d.mts +2 -0
  272. package/dist/components/media.css +22 -27
  273. package/dist/components/mentions.css +18 -17
  274. package/dist/components/mentions.d.mts +2 -0
  275. package/dist/components/menu.css +32 -28
  276. package/dist/components/modal.css +30 -27
  277. package/dist/components/modal.d.mts +2 -0
  278. package/dist/components/nav.css +48 -44
  279. package/dist/components/nav.d.mts +2 -0
  280. package/dist/components/notification.css +31 -25
  281. package/dist/components/notification.d.mts +2 -0
  282. package/dist/components/pagination.css +15 -13
  283. package/dist/components/pagination.d.mts +2 -0
  284. package/dist/components/panel.css +19 -20
  285. package/dist/components/panel.d.mts +2 -0
  286. package/dist/components/pill.css +8 -7
  287. package/dist/components/pill.d.mts +2 -0
  288. package/dist/components/popover.css +32 -23
  289. package/dist/components/popover.d.mts +2 -0
  290. package/dist/components/progress.d.mts +2 -0
  291. package/dist/components/rating.d.mts +2 -0
  292. package/dist/components/result.d.mts +2 -0
  293. package/dist/components/scroll-area.css +84 -112
  294. package/dist/components/scroll-area.d.mts +2 -0
  295. package/dist/components/scroll-area.mjs +1 -0
  296. package/dist/components/segmented.css +47 -29
  297. package/dist/components/segmented.d.mts +2 -0
  298. package/dist/components/select.css +80 -41
  299. package/dist/components/select.d.mts +2 -0
  300. package/dist/components/sidebar.css +42 -38
  301. package/dist/components/sidebar.d.mts +2 -0
  302. package/dist/components/skeleton.d.mts +2 -0
  303. package/dist/components/slider.css +26 -22
  304. package/dist/components/slider.d.mts +2 -0
  305. package/dist/components/spinner.d.mts +2 -0
  306. package/dist/components/split-pane.css +16 -7
  307. package/dist/components/split-pane.d.mts +2 -0
  308. package/dist/components/stat.css +17 -16
  309. package/dist/components/stat.d.mts +2 -0
  310. package/dist/components/steps.css +26 -26
  311. package/dist/components/steps.d.mts +2 -0
  312. package/dist/components/switch.css +78 -39
  313. package/dist/components/switch.d.mts +2 -0
  314. package/dist/components/table.css +54 -32
  315. package/dist/components/table.d.mts +2 -0
  316. package/dist/components/tabs.css +53 -32
  317. package/dist/components/tabs.d.mts +2 -0
  318. package/dist/components/tag-input.css +12 -8
  319. package/dist/components/tag-input.d.mts +2 -0
  320. package/dist/components/tag.css +20 -12
  321. package/dist/components/tag.d.mts +2 -0
  322. package/dist/components/theme-switcher.css +7 -7
  323. package/dist/components/theme-switcher.d.mts +2 -0
  324. package/dist/components/timeline.d.mts +2 -0
  325. package/dist/components/toast.css +34 -30
  326. package/dist/components/toast.d.mts +2 -0
  327. package/dist/components/toolbar.css +19 -18
  328. package/dist/components/toolbar.d.mts +2 -0
  329. package/dist/components/tooltip.css +9 -8
  330. package/dist/components/tooltip.d.mts +2 -0
  331. package/dist/components/tree-select.css +63 -40
  332. package/dist/components/tree-select.d.mts +2 -0
  333. package/dist/components/tree.d.mts +2 -0
  334. package/dist/components/upload.css +9 -11
  335. package/dist/components/upload.d.mts +2 -0
  336. package/dist/index.d.mts +85 -84
  337. package/dist/index.mjs +14764 -14311
  338. package/dist/react.d.mts +18 -18
  339. package/dist/react.mjs +135 -36
  340. package/dist/registry.json +795 -64
  341. package/dist/tokens/colors.css +6 -0
  342. package/dist/tokens/design.css +130 -30
  343. package/dist/tokens/dtcg.json +6189 -1461
  344. package/dist/tokens/figma.variables.json +4107 -345
  345. package/dist/tokens/pixel.css +3 -0
  346. package/dist/tokens/scrollbars.css +40 -0
  347. package/dist/tokens/tokens-studio.json +5191 -271
  348. package/dist/tokens.css +304 -81
  349. package/dist/ui.css +4050 -2148
  350. package/dist/vue.d.mts +17 -17
  351. package/dist/vue.mjs +129 -34
  352. package/docs/spec/design-philosophy.md +5 -5
  353. package/docs/spec/design-primitives.md +10 -10
  354. package/docs/spec/scrollbars.md +46 -0
  355. package/package.json +16 -3
@@ -12,6 +12,7 @@ interface IcenLocale {
12
12
  'aiChat.roleTool': string;
13
13
  'aiChat.roleUser': string;
14
14
  'aiChat.thinking': string;
15
+ 'aiChat.thinkingNow': string;
15
16
  'aiComposer.attachAgent': string;
16
17
  'aiComposer.library': string;
17
18
  'aiComposer.searchLibrary': string;
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -856,6 +857,7 @@ var ICEN_LOCALE_EN_US = {
856
857
  "aiChat.roleTool": "Tool",
857
858
  "aiChat.roleUser": "Me",
858
859
  "aiChat.thinking": "Thinking {p0}",
860
+ "aiChat.thinkingNow": "Thinking\u2026",
859
861
  /* ── aiComposer ── */
860
862
  "aiComposer.attachAgent": "Agent",
861
863
  "aiComposer.library": "Add context and commands",
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1034,6 +1035,7 @@ function setupClear(wrap) {
1034
1035
  const field = wrap.querySelector("input.icen-input, textarea.icen-textarea");
1035
1036
  if (!btn || !field) return;
1036
1037
  btn.addEventListener("click", () => {
1038
+ if (field.disabled || field.readOnly) return;
1037
1039
  field.value = "";
1038
1040
  field.dispatchEvent(new Event("input", { bubbles: true }));
1039
1041
  field.focus();
@@ -1242,6 +1244,7 @@ function setupOtp(group) {
1242
1244
  syncFilled(target);
1243
1245
  }
1244
1246
  cells[Math.min(i + text.length, cells.length - 1)].focus();
1247
+ fireComplete();
1245
1248
  });
1246
1249
  });
1247
1250
  const fireComplete = () => {
@@ -1,5 +1,5 @@
1
- import { KbAccessRequest, KbAccessState, KbRole } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbAccessRequest, KbAccessState, KbRole } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** createKbAccess 入参(spec §9.3;request 宽进——素对象经 normalizeAccessRequest 归一) */
5
5
  interface KbAccessOpts {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1448,8 +1449,13 @@ function setup(container) {
1448
1449
  el.__icenSelectInit = true;
1449
1450
  const trigger = triggerEl;
1450
1451
  const panel = panelEl;
1451
- const arrow = trigger.querySelector(".icen-select-chevron");
1452
- arrow?.remove();
1452
+ if (!trigger.querySelector(".icen-select-chevron")) {
1453
+ const chevron = createIcon("chevron-down", { size: 12, className: "icen-select-chevron" });
1454
+ if (chevron) {
1455
+ chevron.setAttribute("aria-hidden", "true");
1456
+ trigger.append(chevron);
1457
+ }
1458
+ }
1453
1459
  const isMultiple = container.hasAttribute("data-icen-select-multiple");
1454
1460
  const isSearchable = container.hasAttribute("data-icen-select-search");
1455
1461
  if (isMultiple && !trigger.hasAttribute("aria-label") && !trigger.hasAttribute("aria-labelledby")) trigger.setAttribute("aria-label", container.getAttribute("data-icen-select-label") ?? t("select.fieldLabel"));
@@ -1,5 +1,5 @@
1
- import { KbAclEntry, KbSubject } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbAclEntry, KbSubject } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** kb-acl 面板数据快照(renderKbAcl 入参;normalizeAclModel 宽进严出) */
5
5
  interface KbAclModel {
@@ -122,6 +122,7 @@ var ICEN_LOCALE_ZH_CN = {
122
122
  "aiChat.roleTool": "\u5DE5",
123
123
  "aiChat.roleUser": "\u6211",
124
124
  "aiChat.thinking": "\u601D\u8003 {p0}",
125
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
125
126
  /* ── aiComposer ── */
126
127
  "aiComposer.attachAgent": "\u4EE3\u7406",
127
128
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbAnswerKind, KbVerifiedVia, KbCitation, KbClarification, KbExplainFact, KbPermissionNotice, KbQueryResult } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbAnswerKind, KbVerifiedVia, KbCitation, KbClarification, KbExplainFact, KbPermissionNotice, KbQueryResult } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** 问数答案的组合模型(各槽位有才渲;共享类型一律 import 自 kb-core) */
5
5
  interface KbAnswerModel {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1216,6 +1217,15 @@ function renderKbClarify(el, c, opts) {
1216
1217
  return el;
1217
1218
  }
1218
1219
 
1220
+ // src/behaviors/url-safety.ts
1221
+ function safeUrl(uri) {
1222
+ const s = uri.replace(/[\t\n\r\0-\x1f\x7f]/g, "").trim().toLowerCase();
1223
+ if (!s) return void 0;
1224
+ if (s.startsWith("javascript:") || s.startsWith("vbscript:")) return void 0;
1225
+ if (/^data:\s*text\/html/.test(s)) return void 0;
1226
+ return uri;
1227
+ }
1228
+
1219
1229
  // src/behaviors/kb-explain.ts
1220
1230
  function toExplainFact(raw) {
1221
1231
  const r = raw ?? {};
@@ -1276,9 +1286,10 @@ function renderKbExplain(el, fact) {
1276
1286
  const row = h("div", "icen-kb-explain-metric");
1277
1287
  row.appendChild(h("span", "icen-kb-explain-metric-name", m.name));
1278
1288
  if (m.ref) {
1279
- if (!/^\s*(javascript|data|vbscript)\s*:/i.test(m.ref)) {
1289
+ const href = safeUrl(m.ref);
1290
+ if (href) {
1280
1291
  const a = h("a", "icen-kb-explain-metric-ref", t("kbExplain.viewDefinition"));
1281
- a.href = m.ref;
1292
+ a.href = href;
1282
1293
  a.rel = "noopener";
1283
1294
  row.appendChild(a);
1284
1295
  }
@@ -1521,7 +1532,8 @@ function withChrome(el, opts, hasLegend, paint, state, extras) {
1521
1532
  emitIcen(el, "icen:chart-legend-visibility", { visible: hidden ? false : true });
1522
1533
  });
1523
1534
  syncEye();
1524
- head.append(title, eye);
1535
+ if (hasLegend) head.append(title, eye);
1536
+ else head.append(title);
1525
1537
  el.append(head, body);
1526
1538
  paint(body);
1527
1539
  }
@@ -1622,7 +1634,7 @@ function renderVBar(el, opts) {
1622
1634
  wrap.appendChild(track);
1623
1635
  }
1624
1636
  body.append(wrap, labelsRow(labelsUsed));
1625
- if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: s.name, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
1637
+ if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: `${si}:${s.name}`, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
1626
1638
  });
1627
1639
  attachChartInteraction(el, "vbar");
1628
1640
  return el;
@@ -1717,8 +1729,10 @@ function renderDonut(el, opts) {
1717
1729
  "stroke-width": "14"
1718
1730
  }));
1719
1731
  let offset = 0;
1732
+ const gap = opts.segments.length > 1 ? 2.5 : 0;
1720
1733
  opts.segments.forEach((seg, segIndex) => {
1721
- const dash = seg.value / total * circumference;
1734
+ const arcLength = Math.max(0, seg.value / total * circumference);
1735
+ const dash = arcLength - Math.min(gap, arcLength * 0.1);
1722
1736
  const arc = svgEl("circle", {
1723
1737
  cx: "60",
1724
1738
  cy: "60",
@@ -1732,7 +1746,7 @@ function renderDonut(el, opts) {
1732
1746
  });
1733
1747
  setMarkData(arc, { index: segIndex, label: seg.label, value: seg.value });
1734
1748
  svg.appendChild(arc);
1735
- offset += dash;
1749
+ offset += arcLength;
1736
1750
  });
1737
1751
  const legend = document.createElement("div");
1738
1752
  legend.className = "icen-chart-legend";
@@ -1767,8 +1781,9 @@ function renderLine(el, opts) {
1767
1781
  const svg = svgEl("svg", { viewBox: `0 0 ${width} ${height}`, role: "img", "aria-label": chartAriaLabel(opts.title, t("charts.type.line")) });
1768
1782
  const defs = svgEl("defs", {});
1769
1783
  for (let i = 0; i < 4; i++) {
1770
- const y = pad + i * (height - pad * 2) / 3;
1784
+ const y = Math.round(pad + i * (height - pad * 2) / 3) + 0.5;
1771
1785
  svg.appendChild(svgEl("line", {
1786
+ class: i === 3 ? "icen-chart-grid icen-chart-baseline" : "icen-chart-grid",
1772
1787
  x1: String(pad),
1773
1788
  x2: String(width - pad),
1774
1789
  y1: String(y),
@@ -1852,7 +1867,7 @@ function renderLine(el, opts) {
1852
1867
  if (defs.firstChild) svg.insertBefore(defs, svg.firstChild);
1853
1868
  wrap.append(svg, pointLabelsRow(labelsUsed, width, pad));
1854
1869
  body.appendChild(wrap);
1855
- if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: s.name, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
1870
+ if (seriesList.length > 1) body.appendChild(toggleLegend(seriesList.map((s, si) => ({ key: `${si}:${s.name}`, label: s.name, tone: s.tone ?? (si === 0 ? opts.tone : void 0), si })), wrap));
1856
1871
  });
1857
1872
  if (el.dataset.icenChartBody == null) observeFluidWidth(el, () => renderLine(el, opts));
1858
1873
  attachChartInteraction(el, "line");
@@ -1959,7 +1974,7 @@ function renderRadar(el, opts) {
1959
1974
  setMarkData(dot, { index: i, seriesIndex: si, seriesName: s.name || void 0, label: axes[i] ?? "", value: s.values[i] ?? 0 });
1960
1975
  svg.appendChild(dot);
1961
1976
  }
1962
- legendItems.push({ key: s.name || t("charts.seriesName", { p0: si + 1 }), label: s.name || t("charts.seriesName", { p0: si + 1 }), tone: s.tone, si });
1977
+ legendItems.push({ key: `${si}:${s.name || t("charts.seriesName", { p0: si + 1 })}`, label: s.name || t("charts.seriesName", { p0: si + 1 }), tone: s.tone, si });
1963
1978
  });
1964
1979
  wrap.appendChild(svg);
1965
1980
  body.appendChild(wrap);
@@ -1981,6 +1996,11 @@ function niceCeil(v) {
1981
1996
  else nice = 10;
1982
1997
  return nice * base;
1983
1998
  }
1999
+ function tickPrecision(min, max, steps) {
2000
+ const span = Math.abs(max - min);
2001
+ if (!Number.isFinite(span) || span <= 0) return 0;
2002
+ return Math.max(0, Math.ceil(-Math.log10(span / steps)));
2003
+ }
1984
2004
  function isoDate(d) {
1985
2005
  const m = String(d.getMonth() + 1).padStart(2, "0");
1986
2006
  const day = String(d.getDate()).padStart(2, "0");
@@ -2076,7 +2096,8 @@ function renderSparkline(el, opts) {
2076
2096
  const tone = toneVar(opts.tone);
2077
2097
  const points = values.map((value, i) => ({
2078
2098
  x: values.length <= 1 ? width / 2 : pad + i / (values.length - 1) * (width - pad * 2),
2079
- y: height - pad - value / max * (height - pad * 2),
2099
+ /* 负值钳到基线(与折线图同口径):viewBox 仅 28 高,反向射出更刺眼 */
2100
+ y: height - pad - Math.max(0, value) / max * (height - pad * 2),
2080
2101
  value
2081
2102
  }));
2082
2103
  const line = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(" ");
@@ -2201,6 +2222,7 @@ function renderCalendar(el, opts) {
2201
2222
  weekdayRow.appendChild(s);
2202
2223
  });
2203
2224
  const max = maxOf(entries.map((e) => e.value));
2225
+ entries.sort((a, b) => a.date.localeCompare(b.date));
2204
2226
  const pad = padFirstWeek(grid, entries[0].date, weekStart);
2205
2227
  let lastMonth = -1;
2206
2228
  entries.forEach((entry, i) => {
@@ -2259,8 +2281,9 @@ function renderScatter(el, opts) {
2259
2281
  const xAt = (x) => pad + (x - xMin) / (xMax - xMin) * (width - pad * 2);
2260
2282
  const yAt = (y) => height - pad - (y - yMin) / (yMax - yMin) * (height - pad * 2);
2261
2283
  for (let i = 0; i <= 3; i++) {
2262
- const y = pad + i * (height - pad * 2) / 3;
2284
+ const y = Math.round(pad + i * (height - pad * 2) / 3) + 0.5;
2263
2285
  svg.appendChild(svgEl("line", {
2286
+ class: i === 3 ? "icen-chart-grid icen-chart-baseline" : "icen-chart-grid",
2264
2287
  x1: String(pad),
2265
2288
  x2: String(width - pad),
2266
2289
  y1: String(y),
@@ -2276,12 +2299,13 @@ function renderScatter(el, opts) {
2276
2299
  "font-size": "8",
2277
2300
  fill: "var(--icen-token-text-faint)"
2278
2301
  });
2279
- txt.textContent = fmt(opts, Math.round(tv * 10) / 10);
2302
+ txt.textContent = fmt(opts, +tv.toFixed(tickPrecision(yMin, yMax, 3)));
2280
2303
  svg.appendChild(txt);
2281
2304
  }
2282
2305
  for (let i = 0; i <= 4; i++) {
2283
- const x = pad + i * (width - pad * 2) / 4;
2306
+ const x = Math.round(pad + i * (width - pad * 2) / 4) + 0.5;
2284
2307
  svg.appendChild(svgEl("line", {
2308
+ class: i === 0 ? "icen-chart-grid icen-chart-grid--v icen-chart-axis" : "icen-chart-grid icen-chart-grid--v",
2285
2309
  x1: String(x),
2286
2310
  x2: String(x),
2287
2311
  y1: String(pad),
@@ -2298,7 +2322,7 @@ function renderScatter(el, opts) {
2298
2322
  "font-size": "8",
2299
2323
  fill: "var(--icen-token-text-faint)"
2300
2324
  });
2301
- txt.textContent = fmt(opts, Math.round(tv * 10) / 10);
2325
+ txt.textContent = fmt(opts, +tv.toFixed(tickPrecision(xMin, xMax, 4)));
2302
2326
  svg.appendChild(txt);
2303
2327
  }
2304
2328
  if (opts.yLabel) {
@@ -2662,6 +2686,7 @@ function renderChartSkeleton(body) {
2662
2686
  body.appendChild(box);
2663
2687
  }
2664
2688
  var CHART_MARK_ACCENT = "var(--icen-token-accent)";
2689
+ var CHART_MARK_ACCENT_TEXT = "var(--icen-token-accent-text)";
2665
2690
  function markToneVar(tone) {
2666
2691
  switch (tone) {
2667
2692
  case "success":
@@ -2797,7 +2822,7 @@ function paintSvgChartMarks(root, view, marks, formatValue, warned) {
2797
2822
  y: String(clampNum(y - 10, 8, CHART_LINE_H - 4)),
2798
2823
  "text-anchor": "middle",
2799
2824
  "font-size": "8",
2800
- fill: CHART_MARK_ACCENT
2825
+ fill: CHART_MARK_ACCENT_TEXT
2801
2826
  });
2802
2827
  label.textContent = mark.text ?? mark.label;
2803
2828
  g.appendChild(label);
@@ -3355,6 +3380,12 @@ function renderChart(el, raw) {
3355
3380
  const graphic = root.querySelector('[role="img"]');
3356
3381
  if (graphic && !graphic.getAttribute("aria-label")) {
3357
3382
  graphic.setAttribute("aria-label", spec.title ? `${spec.title}\uFF08${type}\uFF09` : type);
3383
+ } else if (!graphic) {
3384
+ const dom = root.querySelector(".icen-chart-vbar, .icen-chart-hbar");
3385
+ if (dom) {
3386
+ dom.setAttribute("role", "img");
3387
+ dom.setAttribute("aria-label", spec.title ? `${spec.title}\uFF08${type}\uFF09` : type);
3388
+ }
3358
3389
  }
3359
3390
  }
3360
3391
  if (loading) return;
@@ -3507,15 +3538,17 @@ function renderPermissionNotice(p) {
3507
3538
  function renderBody(text, citations) {
3508
3539
  const box = h("div", "icen-kb-answer-body");
3509
3540
  for (const seg of parseInlineCitations(text)) {
3510
- if (typeof seg.n === "number" && citations && seg.n >= 1 && seg.n <= citations.length) {
3511
- const sup = h("sup", "icen-kb-citation", `[${seg.n}]`);
3512
- sup.dataset.icenCite = String(seg.n);
3513
- const c = citations[seg.n - 1];
3514
- if (c?.title) sup.title = c.title;
3515
- box.appendChild(sup);
3516
- } else {
3517
- box.appendChild(document.createTextNode(seg.text));
3541
+ if (typeof seg.n === "number" && citations) {
3542
+ const c = citations.find((x) => x.index === seg.n) ?? (seg.n >= 1 && seg.n <= citations.length ? citations[seg.n - 1] : void 0);
3543
+ if (c) {
3544
+ const sup = h("sup", "icen-kb-citation", `[${seg.n}]`);
3545
+ sup.dataset.icenCite = String(seg.n);
3546
+ if (c.title) sup.title = c.title;
3547
+ box.appendChild(sup);
3548
+ continue;
3549
+ }
3518
3550
  }
3551
+ box.appendChild(document.createTextNode(seg.text));
3519
3552
  }
3520
3553
  return box;
3521
3554
  }
@@ -1,5 +1,5 @@
1
- import { KbAuditEntry, KbHygieneIssue } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbAuditEntry, KbHygieneIssue } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** renderKbAudit 入参(宽进:契约对象或素对象皆可,内部 normalize) */
5
5
  interface KbAuditOptions {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,6 +1,6 @@
1
- import { KbCanvasVersion } from './kb-core.js';
2
- import { renderAiDiff } from './ai-diff.js';
3
- import './ai-core.js';
1
+ import { KbCanvasVersion } from './kb-core.mjs';
2
+ import { renderAiDiff } from './ai-diff.mjs';
3
+ import './ai-core.mjs';
4
4
 
5
5
  interface KbCanvasOptions {
6
6
  /** 左栏最小占比(同时约束右栏 1-minRatio);默认 0.2,钳制到 [0.05, 0.5] */
@@ -57,6 +57,7 @@ var ICEN_LOCALE_ZH_CN = {
57
57
  "aiChat.roleTool": "\u5DE5",
58
58
  "aiChat.roleUser": "\u6211",
59
59
  "aiChat.thinking": "\u601D\u8003 {p0}",
60
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
60
61
  /* ── aiComposer ── */
61
62
  "aiComposer.attachAgent": "\u4EE3\u7406",
62
63
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbChainStep } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbChainStep } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /**
5
5
  * 渲染工具链条横向摘要条(与 ai-tool-call 单卡互补的「一屏看完整个链」视角)。
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbCheckpoint } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbCheckpoint } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /**
5
5
  * 渲染检查点时间轴(时钟 icon + relativeTime + label/reason,reason 缺 label 时顶替)。
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbChunk } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbChunk } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** 搜索输入契约 */
5
5
  type KbChunkSearchMode = 'text' | 'vector';
@@ -122,6 +122,7 @@ var ICEN_LOCALE_ZH_CN = {
122
122
  "aiChat.roleTool": "\u5DE5",
123
123
  "aiChat.roleUser": "\u6211",
124
124
  "aiChat.thinking": "\u601D\u8003 {p0}",
125
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
125
126
  /* ── aiComposer ── */
126
127
  "aiComposer.attachAgent": "\u4EE3\u7406",
127
128
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbCitation } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbCitation } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** 来源新鲜度阈值:date 距今超过 90 天视为 stale(来源列表/引用卡/冲突组共用) */
5
5
  declare const KB_STALE_DAYS = 90;
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1505,6 +1506,7 @@ function kbDomainOf(url) {
1505
1506
  }
1506
1507
  }
1507
1508
  var registrySources = [];
1509
+ var rootPools = /* @__PURE__ */ new WeakMap();
1508
1510
  function setKbCitationSources(sources) {
1509
1511
  registrySources = Array.isArray(sources) ? sources.map(normalizeCitation) : [];
1510
1512
  }
@@ -1543,7 +1545,10 @@ function citationMark(n, pool) {
1543
1545
  function renderCitationText(el, text, sources) {
1544
1546
  if (typeof document === "undefined") return el;
1545
1547
  const pool = sources && sources.length ? sources.map(normalizeCitation) : void 0;
1546
- if (pool) setKbCitationSources(pool);
1548
+ if (pool) {
1549
+ setKbCitationSources(pool);
1550
+ rootPools.set(el, pool);
1551
+ }
1547
1552
  el.textContent = "";
1548
1553
  for (const seg of parseInlineCitations(text ?? "")) {
1549
1554
  if (typeof seg.n === "number") el.appendChild(citationMark(seg.n, pool));
@@ -1620,9 +1625,18 @@ function initKbCitation(root, opts) {
1620
1625
  if (initedScopes.has(key)) return () => void 0;
1621
1626
  initedScopes.add(key);
1622
1627
  const target = scope;
1623
- const poolOf = () => opts?.sources && opts.sources.length ? opts.sources : registrySources;
1624
- const cardDataFor = (n) => {
1625
- const found = lookupCitation(poolOf(), n) ?? null;
1628
+ const poolFor = (mark) => {
1629
+ if (opts?.sources && opts.sources.length) return opts.sources;
1630
+ let cur = mark;
1631
+ while (cur) {
1632
+ const pool = rootPools.get(cur);
1633
+ if (pool && pool.length) return pool;
1634
+ cur = cur.parentElement;
1635
+ }
1636
+ return registrySources;
1637
+ };
1638
+ const cardDataFor = (mark, n) => {
1639
+ const found = lookupCitation(poolFor(mark), n) ?? null;
1626
1640
  if (opts?.getCard) return opts.getCard(found ?? syntheticCitation(n)) ?? found;
1627
1641
  return found;
1628
1642
  };
@@ -1633,7 +1647,7 @@ function initKbCitation(root, opts) {
1633
1647
  const showCard = (mark) => {
1634
1648
  const n = citeNum(mark);
1635
1649
  if (n < 1) return;
1636
- const data = cardDataFor(n);
1650
+ const data = cardDataFor(mark, n);
1637
1651
  if (!data) return;
1638
1652
  const panel = buildCitationCard(data, /* @__PURE__ */ new Date());
1639
1653
  hover.panel = panel;
@@ -1655,7 +1669,7 @@ function initKbCitation(root, opts) {
1655
1669
  const n = citeNum(mark);
1656
1670
  if (n < 1) return;
1657
1671
  closeHoverCard();
1658
- const citation = cardDataFor(n) ?? lookupCitation(poolOf(), n) ?? syntheticCitation(n);
1672
+ const citation = cardDataFor(mark, n) ?? lookupCitation(poolFor(mark), n) ?? syntheticCitation(n);
1659
1673
  emitIcen(mark, "icen:kb-citation-open", { citation });
1660
1674
  };
1661
1675
  const onPointerOver = (e) => {
@@ -1,5 +1,5 @@
1
- import { KbClarification } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbClarification } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** renderKbClarify 选项:handle 回调通道(事件通道恒开) */
5
5
  interface KbClarifyOptions {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbCitation } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbCitation } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** 冲突组:一条共享主张 + 相互矛盾的多个来源版本 */
5
5
  interface KbConflictGroup {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbConnector } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbConnector } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /**
5
5
  * 渲染连接器卡网格(快照:整树重建后返回挂载容器 el)。
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,4 +1,4 @@
1
- export { h, svgIcon } from './ai-core.js';
1
+ export { h, svgIcon } from './ai-core.mjs';
2
2
 
3
3
  /** 来源类型(内置 10 种;registerKbSourceType 开放扩展,镜像 ai-core 的 kind 注册表) */
4
4
  type KbSourceKind = 'doc' | 'web' | 'wiki' | 'sheet' | 'db' | 'ticket' | 'code' | 'api' | 'image' | 'mail';
@@ -14,6 +14,7 @@ var ICEN_LOCALE_ZH_CN = {
14
14
  "aiChat.roleTool": "\u5DE5",
15
15
  "aiChat.roleUser": "\u6211",
16
16
  "aiChat.thinking": "\u601D\u8003 {p0}",
17
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
17
18
  /* ── aiComposer ── */
18
19
  "aiComposer.attachAgent": "\u4EE3\u7406",
19
20
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1,5 +1,5 @@
1
- import { KbEvalRow } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbEvalRow } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /** 可选 run(下拉项) */
5
5
  interface KbEvalRunRef {
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
21
21
  "aiChat.roleTool": "\u5DE5",
22
22
  "aiChat.roleUser": "\u6211",
23
23
  "aiChat.thinking": "\u601D\u8003 {p0}",
24
+ "aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
24
25
  /* ── aiComposer ── */
25
26
  "aiComposer.attachAgent": "\u4EE3\u7406",
26
27
  "aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
@@ -1379,8 +1380,13 @@ function setup(container) {
1379
1380
  el.__icenSelectInit = true;
1380
1381
  const trigger = triggerEl;
1381
1382
  const panel = panelEl;
1382
- const arrow = trigger.querySelector(".icen-select-chevron");
1383
- arrow?.remove();
1383
+ if (!trigger.querySelector(".icen-select-chevron")) {
1384
+ const chevron = createIcon("chevron-down", { size: 12, className: "icen-select-chevron" });
1385
+ if (chevron) {
1386
+ chevron.setAttribute("aria-hidden", "true");
1387
+ trigger.append(chevron);
1388
+ }
1389
+ }
1384
1390
  const isMultiple = container.hasAttribute("data-icen-select-multiple");
1385
1391
  const isSearchable = container.hasAttribute("data-icen-select-search");
1386
1392
  if (isMultiple && !trigger.hasAttribute("aria-label") && !trigger.hasAttribute("aria-labelledby")) trigger.setAttribute("aria-label", container.getAttribute("data-icen-select-label") ?? t("select.fieldLabel"));
@@ -1,5 +1,5 @@
1
- import { KbExplainFact } from './kb-core.js';
2
- import './ai-core.js';
1
+ import { KbExplainFact } from './kb-core.mjs';
2
+ import './ai-core.mjs';
3
3
 
4
4
  /**
5
5
  * 渲染口径解释折叠面板(快照式:重复调用整段重建,默认折叠),返回挂载元素 el