@lostgradient/cinder 0.8.0 → 0.9.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 (271) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/components.json +59 -15
  4. package/dist/components/_internal/command-list-context.d.ts +3 -3
  5. package/dist/components/_internal/create-command-list-state.svelte.d.ts +11 -11
  6. package/dist/components/access-gate/index.js +201 -126
  7. package/dist/components/approval-card/approval-card-actions.svelte.d.ts +16 -0
  8. package/dist/components/approval-card/approval-card-state.d.ts +65 -0
  9. package/dist/components/approval-card/approval-card.css +269 -92
  10. package/dist/components/approval-card/approval-card.schema.js +10 -31
  11. package/dist/components/approval-card/approval-card.svelte.d.ts +3 -3
  12. package/dist/components/approval-card/approval-card.types.d.ts +14 -28
  13. package/dist/components/approval-card/index.d.ts +1 -1
  14. package/dist/components/approval-card/index.js +4268 -2884
  15. package/dist/components/card/card.css +5 -0
  16. package/dist/components/card/card.schema.js +2 -2
  17. package/dist/components/card/card.types.d.ts +2 -2
  18. package/dist/components/card/index.js +2 -1
  19. package/dist/components/chat/chat.schema.js +44 -2
  20. package/dist/components/chat/chat.svelte.d.ts +4 -2
  21. package/dist/components/chat/chat.types.d.ts +34 -3
  22. package/dist/components/chat/container/chat.svelte.d.ts +4 -2
  23. package/dist/components/chat/index.d.ts +3 -3
  24. package/dist/components/chat/index.js +2485 -6279
  25. package/dist/components/chat/input/chat-attachment-serialization.d.ts +9 -0
  26. package/dist/components/chat/input/chat-input.svelte.d.ts +22 -1
  27. package/dist/components/chat/input/index.d.ts +1 -0
  28. package/dist/components/chat-composer-popover/chat-composer-popover-filter.d.ts +11 -0
  29. package/dist/components/chat-composer-popover/chat-composer-popover.css +7 -0
  30. package/dist/components/chat-composer-popover/chat-composer-popover.css.d.ts +1 -0
  31. package/dist/components/chat-composer-popover/chat-composer-popover.schema.d.ts +3 -0
  32. package/dist/components/chat-composer-popover/chat-composer-popover.schema.js +150 -0
  33. package/dist/components/chat-composer-popover/chat-composer-popover.svelte.d.ts +46 -0
  34. package/dist/components/chat-composer-popover/chat-composer-popover.types.d.ts +77 -0
  35. package/dist/components/chat-composer-popover/chat-composer-popover.variables.d.ts +2 -0
  36. package/dist/components/chat-composer-popover/chat-composer-popover.variables.js +61 -0
  37. package/dist/components/chat-composer-popover/index.d.ts +6 -0
  38. package/dist/components/chat-composer-popover/index.js +3285 -0
  39. package/dist/components/chat-conversation-header/index.js +1627 -5600
  40. package/dist/components/chat-conversation-list/index.js +15 -3988
  41. package/dist/components/code-block/code-block.schema.js +5 -1
  42. package/dist/components/code-block/code-block.types.d.ts +6 -0
  43. package/dist/components/code-block/index.js +4 -4
  44. package/dist/components/command-item/index.js +7 -6
  45. package/dist/components/command-menu/command-menu.schema.js +5 -1
  46. package/dist/components/command-menu/command-menu.types.d.ts +2 -0
  47. package/dist/components/command-menu/index.js +48 -19
  48. package/dist/components/command-palette/index.js +40 -14
  49. package/dist/components/event-stream-viewer/index.js +44 -44
  50. package/dist/components/experimental/json-viewer/index.js +44 -44
  51. package/dist/components/json-schema-editor/index.js +5 -2
  52. package/dist/components/json-viewer/index.js +44 -44
  53. package/dist/components/json-viewer/json-viewer.css +10 -6
  54. package/dist/components/payload-inspector/index.d.ts +1 -1
  55. package/dist/components/payload-inspector/index.js +306 -1422
  56. package/dist/components/payload-inspector/payload-inspector.css +15 -75
  57. package/dist/components/payload-inspector/payload-inspector.schema.js +5 -41
  58. package/dist/components/payload-inspector/payload-inspector.svelte.d.ts +5 -5
  59. package/dist/components/payload-inspector/payload-inspector.types.d.ts +10 -56
  60. package/dist/components/tab/index.js +5 -2
  61. package/dist/components/tab/tab.schema.js +7 -3
  62. package/dist/components/tab/tab.svelte.d.ts +2 -1
  63. package/dist/components/tab/tab.types.d.ts +8 -2
  64. package/dist/components/tabs/index.js +5 -2
  65. package/dist/components/team-section/index.js +2 -1
  66. package/dist/components/testimonial-section/index.js +2 -1
  67. package/dist/index.d.ts +4 -2
  68. package/dist/index.js +23711 -27432
  69. package/dist/server/components/access-gate/index.js +2 -1
  70. package/dist/server/components/accordion/index.js +2 -2
  71. package/dist/server/components/alert-dialog/index.js +2 -2
  72. package/dist/server/components/approval-card/index.js +15 -19
  73. package/dist/server/components/autocomplete/index.js +7 -7
  74. package/dist/server/components/avatar-group/index.js +5 -5
  75. package/dist/server/components/button-group/index.js +3 -5
  76. package/dist/server/components/card/index.js +2 -2
  77. package/dist/server/components/chat/index.js +14 -11
  78. package/dist/server/components/chat-composer-popover/index.js +26 -0
  79. package/dist/server/components/chat-conversation-header/index.js +9 -10
  80. package/dist/server/components/chat-conversation-list/index.js +4 -5
  81. package/dist/server/components/checkbox/index.js +3 -3
  82. package/dist/server/components/choice-grid/index.js +2 -2
  83. package/dist/server/components/code-block/index.js +2 -2
  84. package/dist/server/components/color-field/index.js +3 -3
  85. package/dist/server/components/combobox/index.js +6 -6
  86. package/dist/server/components/command-item/index.js +5 -3
  87. package/dist/server/components/command-menu/index.js +6 -4
  88. package/dist/server/components/command-palette/index.js +2 -2
  89. package/dist/server/components/confirm-dialog/index.js +2 -2
  90. package/dist/server/components/context-menu/index.js +5 -5
  91. package/dist/server/components/data-table/index.js +5 -5
  92. package/dist/server/components/date-picker/index.js +6 -6
  93. package/dist/server/components/date-range-field/index.js +7 -7
  94. package/dist/server/components/description-list/index.js +3 -5
  95. package/dist/server/components/diff-viewer/index.js +7 -7
  96. package/dist/server/components/drawer/index.js +3 -3
  97. package/dist/server/components/dropdown/index.js +4 -4
  98. package/dist/server/components/event-stream-viewer/index.js +2 -2
  99. package/dist/server/components/experimental/json-viewer/index.js +2 -2
  100. package/dist/server/components/faceted-filter-bar/index.js +1 -1
  101. package/dist/server/components/hover-card/index.js +1 -1
  102. package/dist/server/components/input/index.js +3 -3
  103. package/dist/server/components/json-schema-editor/index.js +22 -22
  104. package/dist/server/components/json-viewer/index.js +2 -2
  105. package/dist/server/components/markdown-editor/index.js +13 -13
  106. package/dist/server/components/modal/index.js +1 -1
  107. package/dist/server/components/multi-select/index.js +1 -1
  108. package/dist/server/components/newsletter-section/index.js +3 -3
  109. package/dist/server/components/payload-inspector/index.js +4 -16
  110. package/dist/server/components/popover/index.js +5 -5
  111. package/dist/server/components/review-editor/index.js +25 -25
  112. package/dist/server/components/run-step-timeline/index.js +2 -2
  113. package/dist/server/components/schema-form/index.js +4 -4
  114. package/dist/server/components/secret-value-field/index.js +3 -5
  115. package/dist/server/components/segment/index.js +3 -3
  116. package/dist/server/components/segmented-control/index.js +4 -4
  117. package/dist/server/components/selection-popover/index.js +4 -4
  118. package/dist/server/components/sheet/index.js +2 -2
  119. package/dist/server/components/sidebar/index.js +3 -3
  120. package/dist/server/components/tab/index.js +2 -2
  121. package/dist/server/components/table/index.js +3 -3
  122. package/dist/server/components/tabs/index.js +4 -4
  123. package/dist/server/components/tag-input/index.js +3 -3
  124. package/dist/server/components/team-section/index.js +8 -8
  125. package/dist/server/components/testimonial-section/index.js +2 -2
  126. package/dist/server/components/toggle/index.js +2 -2
  127. package/dist/server/components/tooltip/index.js +1 -1
  128. package/dist/server/index.js +159 -148
  129. package/dist/server/{index.server-cbtg8rq5.js → index.server-0atyznp7.js} +5 -5
  130. package/dist/server/{index.server-20y4mdhm.js → index.server-0chhpkg7.js} +40 -14
  131. package/dist/server/{index.server-ecm1vs3g.js → index.server-1nq7z1qw.js} +1 -1
  132. package/dist/server/{index.server-jync915v.js → index.server-2dga5yzr.js} +25 -25
  133. package/dist/server/index.server-2hqrv7ca.js +9 -0
  134. package/dist/server/{index.server-69epaape.js → index.server-2qj6s2mh.js} +1 -1
  135. package/dist/server/{index.server-pt8b65mt.js → index.server-38aywdk1.js} +1 -1
  136. package/dist/server/{index.server-rermas0k.js → index.server-47v2fhp4.js} +4 -4
  137. package/dist/server/{index.server-9j5sym59.js → index.server-4x91gzy1.js} +2 -2
  138. package/dist/server/{index.server-q48q15g7.js → index.server-4y2jtvv1.js} +4 -2
  139. package/dist/server/index.server-67qgdypc.js +9 -0
  140. package/dist/server/{index.server-9jete4xx.js → index.server-6sh11ap6.js} +4 -4
  141. package/dist/server/{index.server-4ztq565m.js → index.server-85p4ydph.js} +1 -1
  142. package/dist/server/{index.server-4nk7gy0q.js → index.server-894t97kv.js} +1 -1
  143. package/dist/server/{index.server-1vscnped.js → index.server-8dt36sdm.js} +2 -1
  144. package/dist/server/{index.server-bfsbp9dz.js → index.server-8xvc73zh.js} +4 -4
  145. package/dist/server/{index.server-cvnw3hw9.js → index.server-9kz37z89.js} +1 -1
  146. package/dist/server/{index.server-kc1k02tk.js → index.server-9ykk1kbg.js} +1 -1
  147. package/dist/server/{index.server-g789yep6.js → index.server-aqethy0w.js} +2 -2
  148. package/dist/server/{index.server-wc9aggfz.js → index.server-bmxbsk4y.js} +7 -7
  149. package/dist/server/{index.server-j3ddzcaa.js → index.server-c6pe4kaf.js} +6 -6
  150. package/dist/server/{index.server-q89dz8h1.js → index.server-d3pqthtp.js} +4 -3
  151. package/dist/server/{index.server-qfa2rxzx.js → index.server-dg83ke3k.js} +3 -5
  152. package/dist/server/{index.server-jk4rx4aa.js → index.server-dmmvwy6p.js} +1 -1
  153. package/dist/server/{index.server-hcfnae5y.js → index.server-dwwqssey.js} +4 -4
  154. package/dist/server/{index.server-e8x1hgw6.js → index.server-dz1r9xw5.js} +4 -4
  155. package/dist/server/{index.server-wm7mk5kw.js → index.server-ez5hp0ya.js} +1 -1
  156. package/dist/server/{index.server-ejyf7e48.js → index.server-fy068yne.js} +1 -1
  157. package/dist/server/{index.server-wc8dbm5e.js → index.server-g95bk8rc.js} +4 -2
  158. package/dist/server/index.server-gkazv439.js +576 -0
  159. package/dist/server/{index.server-dp9j2kkr.js → index.server-h0cvwvhy.js} +1 -1
  160. package/dist/server/{index.server-pacrqvyz.js → index.server-h90pjrez.js} +1 -1
  161. package/dist/server/{index.server-p8d04em5.js → index.server-hcsd5gdb.js} +6 -2
  162. package/dist/server/{index.server-n39drzes.js → index.server-hpeavvnq.js} +1 -1
  163. package/dist/server/{index.server-1p3patnj.js → index.server-hx91ng7z.js} +1 -1
  164. package/dist/server/{index.server-jtj3r53y.js → index.server-jgb8yh5k.js} +1 -1
  165. package/dist/server/{index.server-w1g5q9j9.js → index.server-jtgw9d23.js} +4 -2
  166. package/dist/server/{index.server-mehav5vs.js → index.server-jxg42jpz.js} +4 -4
  167. package/dist/server/{index.server-hd8gpehd.js → index.server-jxseyx33.js} +1 -1
  168. package/dist/server/{index.server-kg2sepsr.js → index.server-krqvnt6p.js} +14 -15
  169. package/dist/server/{index.server-0e1m3agz.js → index.server-ks49bprh.js} +1 -1
  170. package/dist/server/{index.server-f0hma3jp.js → index.server-kt0ncrqs.js} +1 -1
  171. package/dist/server/index.server-m0ezemav.js +170 -0
  172. package/dist/server/index.server-m191rm44.js +79 -0
  173. package/dist/server/{index.server-f23vtaw4.js → index.server-marjz8ps.js} +6 -6
  174. package/dist/server/index.server-mqt1ngqw.js +250 -0
  175. package/dist/server/{index.server-s9khh4ry.js → index.server-mzzb7dnm.js} +3 -5
  176. package/dist/server/{index.server-z721a5gp.js → index.server-n82rcv0m.js} +4 -4
  177. package/dist/server/{index.server-rhhmdxtz.js → index.server-np3c7kx0.js} +4 -4
  178. package/dist/server/{index.server-hpcs7tmh.js → index.server-p56xxef1.js} +1 -1
  179. package/dist/server/{index.server-w83kmcrx.js → index.server-pag862vz.js} +10 -10
  180. package/dist/server/{index.server-gxf0d1p5.js → index.server-q7w4jw89.js} +2 -2
  181. package/dist/server/{index.server-v4zabrsx.js → index.server-qh9qzd5t.js} +163 -25
  182. package/dist/server/{index.server-pxg74pyp.js → index.server-qk1h0n02.js} +4 -4
  183. package/dist/server/{index.server-sh2rxejg.js → index.server-qke3ekjt.js} +1 -1
  184. package/dist/server/{index.server-73x2d3j3.js → index.server-rbpvcrr3.js} +1 -1
  185. package/dist/server/{index.server-8cxs4kya.js → index.server-rga8sc7j.js} +41 -44
  186. package/dist/server/{index.server-e3fnv1g6.js → index.server-sedjxt36.js} +5 -5
  187. package/dist/server/{index.server-pen9pxt6.js → index.server-sf3nk3j2.js} +2 -2
  188. package/dist/server/{index.server-7fp0epev.js → index.server-veastatv.js} +4 -4
  189. package/dist/server/{index.server-jeqg2d22.js → index.server-xeqtpv61.js} +1 -1
  190. package/dist/server/{index.server-9s4na701.js → index.server-xjnge1yw.js} +4 -4
  191. package/dist/server/index.server-xtjjmsyq.js +315 -0
  192. package/dist/server/{index.server-hhxjaeen.js → index.server-xz99aed4.js} +4 -4
  193. package/dist/server/{index.server-vne4rzfa.js → index.server-y4n8vc08.js} +1 -1
  194. package/dist/server/{index.server-5d01cn4f.js → index.server-y83kqayt.js} +4 -4
  195. package/dist/server/{index.server-1nh09ck7.js → index.server-yhzydqxe.js} +5 -5
  196. package/dist/server/{index.server-atjc1qcq.js → index.server-yz4k36cw.js} +1 -1
  197. package/dist/server/{index.server-w6k62afr.js → index.server-ze1ymmbw.js} +2 -2
  198. package/dist/server/{index.server-914v805w.js → index.server-zgd1g8mk.js} +1 -1
  199. package/dist/server/{index.server-aeexcxdp.js → index.server-zh3r8vfd.js} +1 -1
  200. package/dist/server/{index.server-10jb2jzm.js → index.server-zsjf8enc.js} +4 -4
  201. package/package.json +40 -6
  202. package/src/components/_internal/command-list-context.ts +3 -3
  203. package/src/components/_internal/create-command-list-state.svelte.ts +39 -13
  204. package/src/components/approval-card/approval-card-actions.svelte +168 -0
  205. package/src/components/approval-card/approval-card-state.ts +152 -1
  206. package/src/components/approval-card/approval-card.css +269 -92
  207. package/src/components/approval-card/approval-card.examples.json +3 -3
  208. package/src/components/approval-card/approval-card.schema.json +9 -30
  209. package/src/components/approval-card/approval-card.schema.ts +13 -31
  210. package/src/components/approval-card/approval-card.svelte +176 -470
  211. package/src/components/approval-card/approval-card.types.ts +15 -28
  212. package/src/components/approval-card/index.ts +1 -0
  213. package/src/components/card/card.css +5 -0
  214. package/src/components/card/card.schema.json +1 -1
  215. package/src/components/card/card.schema.ts +1 -1
  216. package/src/components/card/card.svelte +1 -0
  217. package/src/components/card/card.types.ts +2 -2
  218. package/src/components/chat/chat.schema.json +36 -1
  219. package/src/components/chat/chat.schema.ts +44 -1
  220. package/src/components/chat/chat.svelte +12 -0
  221. package/src/components/chat/chat.types.ts +35 -3
  222. package/src/components/chat/container/chat.svelte +73 -3
  223. package/src/components/chat/index.ts +15 -3
  224. package/src/components/chat/input/chat-attachment-serialization.ts +63 -0
  225. package/src/components/chat/input/chat-input.svelte +22 -5
  226. package/src/components/chat/input/index.ts +5 -0
  227. package/src/components/chat-composer-popover/chat-composer-popover-filter.ts +68 -0
  228. package/src/components/chat-composer-popover/chat-composer-popover.css +7 -0
  229. package/src/components/chat-composer-popover/chat-composer-popover.examples.json +13 -0
  230. package/src/components/chat-composer-popover/chat-composer-popover.schema.json +90 -0
  231. package/src/components/chat-composer-popover/chat-composer-popover.schema.ts +95 -0
  232. package/src/components/chat-composer-popover/chat-composer-popover.svelte +234 -0
  233. package/src/components/chat-composer-popover/chat-composer-popover.types.ts +88 -0
  234. package/src/components/chat-composer-popover/chat-composer-popover.variables.json +1 -0
  235. package/src/components/chat-composer-popover/chat-composer-popover.variables.ts +3 -0
  236. package/src/components/chat-composer-popover/index.ts +19 -0
  237. package/src/components/code-block/code-block.schema.json +4 -0
  238. package/src/components/code-block/code-block.schema.ts +5 -0
  239. package/src/components/code-block/code-block.svelte +3 -3
  240. package/src/components/code-block/code-block.types.ts +6 -0
  241. package/src/components/command-item/command-item.svelte +7 -6
  242. package/src/components/command-menu/command-menu.schema.json +4 -0
  243. package/src/components/command-menu/command-menu.schema.ts +4 -0
  244. package/src/components/command-menu/command-menu.svelte +16 -5
  245. package/src/components/command-menu/command-menu.types.ts +2 -0
  246. package/src/components/json-viewer/_json-viewer-node.svelte +15 -1
  247. package/src/components/json-viewer/json-viewer.css +10 -6
  248. package/src/components/payload-inspector/index.ts +0 -2
  249. package/src/components/payload-inspector/payload-inspector.css +15 -75
  250. package/src/components/payload-inspector/payload-inspector.examples.json +5 -5
  251. package/src/components/payload-inspector/payload-inspector.schema.json +3 -31
  252. package/src/components/payload-inspector/payload-inspector.schema.ts +3 -36
  253. package/src/components/payload-inspector/payload-inspector.svelte +46 -239
  254. package/src/components/payload-inspector/payload-inspector.types.ts +10 -58
  255. package/src/components/tab/tab.schema.json +6 -2
  256. package/src/components/tab/tab.schema.ts +8 -2
  257. package/src/components/tab/tab.svelte +9 -5
  258. package/src/components/tab/tab.types.ts +8 -2
  259. package/src/index.ts +18 -5
  260. package/src/styles/components.css +1 -0
  261. package/dist/server/index-49we2xfs.js +0 -344
  262. package/dist/server/index-8fhvxk30.js +0 -265
  263. package/dist/server/index-x2ysg8ds.js +0 -388
  264. package/dist/server/index.server-20j0jh30.js +0 -9
  265. package/dist/server/index.server-dc35kh7d.js +0 -1835
  266. package/dist/server/index.server-kd4b0342.js +0 -607
  267. package/dist/server/index.server-n5cdmsz4.js +0 -30
  268. package/dist/server/index.server-rjap4k7y.js +0 -1389
  269. package/dist/server/index.server-vt6sn9y4.js +0 -447
  270. package/dist/server/index.server-w63n618v.js +0 -9
  271. package/dist/server/index.server-y2pa1k46.js +0 -9
@@ -4,16 +4,10 @@ export {};
4
4
 
5
5
  <script lang="ts">
6
6
  import Badge from '../badge/badge.svelte';
7
- import CodeBlock from '../code-block/code-block.svelte';
8
7
  import CopyButton from '../copy-button/copy-button.svelte';
9
- import DescriptionList from '../description-list/description-list.svelte';
10
8
  import JsonViewer from '../json-viewer/json-viewer.svelte';
11
- import Tabs from '../tabs/tabs.svelte';
12
- import TabList from '../tab-list/tab-list.svelte';
13
- import Tab from '../tab/tab.svelte';
14
- import TabPanel from '../tab-panel/tab-panel.svelte';
15
9
  import { classNames } from '../../utilities/class-names.ts';
16
- let { value, truncated = false, maxBytes = 1_048_576, meta, format, parse, activeView = $bindable('summary'), label = 'Payload inspector', class: className, ...rest } = $props();
10
+ let { value, truncated = false, maxBytes = 1_048_576, parse, label = 'Payload inspector', class: className, ...rest } = $props();
17
11
  function shouldParseString(raw) {
18
12
  const trimmed = raw.trim();
19
13
  if (/^[{\["]/.test(trimmed))
@@ -66,27 +60,6 @@ const byteLabel = $derived.by(() => {
66
60
  return `${(bytes / 1024).toFixed(1)} KB`;
67
61
  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
68
62
  });
69
- // --------------------------------------------------------------------------
70
- // Formatted raw text for the raw view.
71
- //
72
- // `format` controls how the raw view *displays* the payload — it is a
73
- // serializer (e.g. sorted keys, custom indentation) not a redaction hook.
74
- // Redaction should happen upstream: pass the already-redacted object as
75
- // `value` so every view (Summary, Tree, Raw) sees the redacted form.
76
- // --------------------------------------------------------------------------
77
- const rawText = $derived.by(() => {
78
- if (!parseResult.ok) {
79
- // Show the original string if we have one (so the user can see what failed to parse).
80
- return typeof value === 'string' ? value : '';
81
- }
82
- try {
83
- const formatter = format ?? ((v) => JSON.stringify(v, null, 2));
84
- return formatter(parsedValue) ?? '';
85
- }
86
- catch {
87
- return typeof value === 'string' ? value : '';
88
- }
89
- });
90
63
  // True when the in-memory value cannot be round-tripped through JSON.stringify
91
64
  // (e.g. circular references, BigInt). Only fires for non-string values that
92
65
  // parsed successfully — string parse errors are handled by parseResult.ok.
@@ -101,115 +74,33 @@ const unserializable = $derived.by(() => {
101
74
  return true;
102
75
  }
103
76
  });
104
- // --------------------------------------------------------------------------
105
- // Summary metadata items for DescriptionList.
106
- // --------------------------------------------------------------------------
107
- const summaryItems = $derived.by(() => {
108
- const items = [];
109
- items.push({ term: 'Size', definition: byteLabel });
110
- if (meta?.contentType) {
111
- items.push({ term: 'Content type', definition: meta.contentType });
112
- }
113
- if (meta?.source) {
114
- items.push({ term: 'Source', definition: meta.source });
115
- }
116
- if (meta?.timestamp) {
117
- // Attempt to format as a locale string; fall back to raw string.
118
- let displayTime = meta.timestamp;
119
- try {
120
- displayTime = new Date(meta.timestamp).toLocaleString();
121
- }
122
- catch {
123
- // leave as-is
124
- }
125
- items.push({ term: 'Timestamp', definition: displayTime });
126
- }
127
- return items;
128
- });
129
- const valueKind = $derived.by(() => {
130
- if (!parseResult.ok)
131
- return 'invalid';
132
- const v = parsedValue;
133
- if (v === null)
134
- return 'null';
135
- if (v === undefined)
136
- return 'undefined';
137
- if (typeof v === 'boolean')
138
- return 'boolean';
139
- if (typeof v === 'number')
140
- return 'number';
141
- if (typeof v === 'string')
142
- return 'string';
143
- if (Array.isArray(v))
144
- return 'array';
145
- return 'object';
146
- });
147
- // --------------------------------------------------------------------------
148
- // Whether the value is a primitive (shown inline in the summary).
149
- // --------------------------------------------------------------------------
150
- const isPrimitive = $derived(valueKind === 'null' ||
151
- valueKind === 'undefined' ||
152
- valueKind === 'boolean' ||
153
- valueKind === 'number' ||
154
- valueKind === 'string');
155
77
  const isEmpty = $derived(parsedValue === undefined && value === undefined);
156
- // --------------------------------------------------------------------------
157
- // Copy targets for the header copy buttons.
158
- //
159
- // copy-raw → "payload as received": the original string verbatim if value
160
- // was a string, otherwise compact JSON (one-liner, no spaces).
161
- // This is what you would paste into a message bus or log query.
162
- //
163
- // copy-formatted pretty-printed JSON of the parsed value (2-space indent).
164
- // Ignores the `format` prop so it is always valid JSON.
165
- // This is what you would read or diff in an editor.
166
- // --------------------------------------------------------------------------
167
- const copyRawText = $derived.by(() => {
78
+ const isPrimitive = $derived(parsedValue === null ||
79
+ typeof parsedValue === 'boolean' ||
80
+ typeof parsedValue === 'number' ||
81
+ typeof parsedValue === 'string');
82
+ // Copy target: the original string verbatim whenever the payload itself was
83
+ // a string including a JSON-encoded string primitive like '"hello"',
84
+ // which parses to the bare string `hello` but should still copy as the
85
+ // original input, not the unquoted parsed result. Everything else copies
86
+ // as pretty-printed JSON of the parsed value.
87
+ const copyText = $derived.by(() => {
88
+ if (!parseResult.ok)
89
+ return typeof value === 'string' ? value : '';
168
90
  if (typeof value === 'string')
169
91
  return value;
170
- if (!parseResult.ok)
171
- return '';
172
- try {
173
- return JSON.stringify(parsedValue) ?? '';
174
- }
175
- catch {
176
- return '';
177
- }
178
- });
179
- const copyFormattedText = $derived.by(() => {
180
- if (!parseResult.ok)
181
- return rawText;
182
92
  try {
183
93
  return JSON.stringify(parsedValue, null, 2) ?? '';
184
94
  }
185
95
  catch {
186
- return rawText;
96
+ return '';
187
97
  }
188
98
  });
189
- const canCopyFormatted = $derived(!isEmpty && parseResult.ok && !unserializable);
190
- const canCopyRaw = $derived(!isEmpty && (typeof value === 'string' || canCopyFormatted));
191
- // --------------------------------------------------------------------------
192
- // Helper: badge variant for the type tag.
193
- // --------------------------------------------------------------------------
194
- function kindVariant(kind) {
195
- if (kind === 'invalid')
196
- return 'danger';
197
- if (kind === 'null' || kind === 'undefined')
198
- return 'warning';
199
- if (kind === 'object' || kind === 'array')
200
- return 'info';
201
- return 'neutral';
202
- }
203
- // --------------------------------------------------------------------------
204
- // Computed active view binding — keep activeView in sync with $bindable.
205
- // Because Tabs uses bind:value internally, we forward the $bindable to it
206
- // directly. The Tabs bind creates a two-way link that keeps activeView
207
- // updated when the user switches tabs, and respects external changes too.
208
- // --------------------------------------------------------------------------
99
+ const canCopy = $derived(!isEmpty && copyText !== '');
209
100
  </script>
210
101
 
211
- <section {...rest} class={classNames('cinder-payload-inspector', className)} aria-label={label}>
212
- <!-- Header bar: label, size, copy actions -->
102
+ <div {...rest} class={classNames('cinder-payload-inspector', className)}>
103
+ <!-- Header bar: label, size, copy action -->
213
104
  <div class="cinder-payload-inspector__header">
214
105
  <span class="cinder-payload-inspector__label">{label}</span>
215
106
  <div class="cinder-payload-inspector__header-actions">
@@ -221,124 +112,40 @@ function kindVariant(kind) {
221
112
  {#if truncated}
222
113
  <Badge variant="warning" size="xs">Truncated</Badge>
223
114
  {/if}
224
- {#if canCopyFormatted}
115
+ {#if canCopy}
225
116
  <CopyButton
226
- value={copyFormattedText}
227
- label="Copy formatted"
228
- copiedLabel="Formatted copied"
229
- title="Copy formatted payload"
230
- iconOnly
231
- />
232
- {/if}
233
- {#if canCopyRaw}
234
- <CopyButton
235
- value={copyRawText}
236
- label="Copy raw"
237
- copiedLabel="Raw copied"
238
- title="Copy raw payload"
117
+ value={copyText}
118
+ label={`Copy ${label}`}
119
+ copiedLabel="Copied"
120
+ title={`Copy ${label}`}
239
121
  iconOnly
240
122
  />
241
123
  {/if}
242
124
  </div>
243
125
  </div>
244
126
 
245
- <!-- Tab switcher: Summary / Tree / Raw -->
246
- <div class="cinder-payload-inspector__tabs">
247
- <Tabs bind:value={activeView}>
248
- <TabList label="Inspector views">
249
- <Tab value="summary">Summary</Tab>
250
- <Tab value="tree">Tree</Tab>
251
- <Tab value="raw">Raw</Tab>
252
- </TabList>
253
-
254
- <!-- Summary panel -->
255
- <TabPanel value="summary">
256
- <div class="cinder-payload-inspector__panel">
257
- {#if isEmpty}
258
- <div class="cinder-payload-inspector__empty" role="status">No payload</div>
259
- {/if}
260
- {#if !isEmpty}
261
- <div class="cinder-payload-inspector__summary">
262
- <div class="cinder-payload-inspector__summary-badges">
263
- <Badge variant={kindVariant(valueKind)} size="xs" mono>{valueKind}</Badge>
264
- {#if truncated}
265
- <Badge variant="warning" size="xs">Truncated</Badge>
266
- {/if}
267
- </div>
268
- {#if summaryItems.length > 0}
269
- <DescriptionList items={summaryItems} variant="two-column" />
270
- {/if}
271
- {#if !parseResult.ok}
272
- <div
273
- class="cinder-payload-inspector__notice cinder-payload-inspector__notice--warning"
274
- role="alert"
275
- >
276
- Parse error: {parseResult.error}
277
- </div>
278
- {/if}
279
- {#if parseResult.ok && isPrimitive}
280
- <div class="cinder-payload-inspector__summary-value">
281
- <span class="cinder-payload-inspector__summary-value-label">Value</span>
282
- <span class="cinder-payload-inspector__primitive">{String(parsedValue)}</span>
283
- </div>
284
- {/if}
285
- </div>
286
- {/if}
287
- </div>
288
- </TabPanel>
289
-
290
- <!-- Tree panel -->
291
- <TabPanel value="tree">
292
- <div class="cinder-payload-inspector__panel">
293
- {#if isEmpty}
294
- <div class="cinder-payload-inspector__empty" role="status">No payload</div>
295
- {/if}
296
- {#if !isEmpty && !parseResult.ok}
297
- <div
298
- class="cinder-payload-inspector__notice cinder-payload-inspector__notice--warning"
299
- role="alert"
300
- >
301
- Cannot render tree: {parseResult.error}
302
- </div>
303
- {/if}
304
- {#if !isEmpty && parseResult.ok && unserializable}
305
- <div class="cinder-payload-inspector__notice" role="status">
306
- This value can't be serialized as JSON (it may contain circular references or BigInt
307
- values).
308
- </div>
309
- {/if}
310
- {#if !isEmpty && parseResult.ok && !unserializable}
311
- <JsonViewer value={parsedValue} {maxBytes} />
312
- {/if}
313
- </div>
314
- </TabPanel>
315
-
316
- <!-- Raw panel -->
317
- <TabPanel value="raw">
318
- <div class="cinder-payload-inspector__panel cinder-payload-inspector__panel--code">
319
- {#if isEmpty}
320
- <div class="cinder-payload-inspector__empty" role="status">No payload</div>
321
- {/if}
322
- {#if !isEmpty && truncated}
323
- <div class="cinder-payload-inspector__notice cinder-payload-inspector__notice--warning">
324
- This payload has been truncated by the producer. The raw view shows only the received
325
- portion.
326
- </div>
327
- {/if}
328
- {#if !isEmpty && unserializable}
329
- <div class="cinder-payload-inspector__notice" role="status">
330
- This value can't be serialized as JSON (it may contain circular references or BigInt
331
- values).
332
- </div>
333
- {/if}
334
- {#if !isEmpty && !unserializable}
335
- <!-- highlight={false} is an absolute off-switch: no Shiki import,
336
- guaranteed-escaped plaintext. Consumers who want highlighting can
337
- pass a `format` function and swap in a custom view. -->
338
- <CodeBlock code={rawText} highlight={false} class="cinder-payload-inspector__raw" />
339
- {/if}
340
- </div>
341
- </TabPanel>
342
- </Tabs>
127
+ <div class="cinder-payload-inspector__panel">
128
+ {#if isEmpty}
129
+ <div class="cinder-payload-inspector__empty" role="status">No payload</div>
130
+ {:else if !parseResult.ok}
131
+ <div
132
+ class="cinder-payload-inspector__notice cinder-payload-inspector__notice--warning"
133
+ role="alert"
134
+ >
135
+ Parse error: {parseResult.error}
136
+ </div>
137
+ {#if typeof value === 'string'}
138
+ <pre class="cinder-payload-inspector__primitive">{value}</pre>
139
+ {/if}
140
+ {:else if unserializable}
141
+ <div class="cinder-payload-inspector__notice" role="status">
142
+ This value can't be serialized as JSON (it may contain circular references or BigInt
143
+ values).
144
+ </div>
145
+ {:else if isPrimitive}
146
+ <pre class="cinder-payload-inspector__primitive">{String(parsedValue)}</pre>
147
+ {:else}
148
+ <JsonViewer value={parsedValue} {maxBytes} />
149
+ {/if}
343
150
  </div>
344
- </section>
151
+ </div>
@@ -1,22 +1,5 @@
1
1
  import type { HTMLAttributes } from 'svelte/elements';
2
2
 
3
- /** Active view tab for the inspector. */
4
- export type PayloadInspectorView = 'summary' | 'tree' | 'raw';
5
-
6
- /**
7
- * Structured metadata about the payload shown in the summary view.
8
- *
9
- * @schemaObject
10
- */
11
- export type PayloadInspectorMeta = {
12
- /** Content type or serializer label, e.g. "application/json" or "Protobuf". */
13
- contentType?: string;
14
- /** Optional source label, e.g. a workflow name, activity name, or endpoint path. */
15
- source?: string;
16
- /** Optional ISO 8601 timestamp string rendered in the summary. */
17
- timestamp?: string;
18
- };
19
-
20
3
  /** Schema-facing payload value. Kept permissive to match the runtime `unknown` prop. */
21
4
  export type PayloadInspectorSchemaValue = unknown;
22
5
 
@@ -33,29 +16,15 @@ export type PayloadInspectorProps = Omit<HTMLAttributes<HTMLElement>, 'class' |
33
16
  value?: unknown;
34
17
  /**
35
18
  * When true, the payload has been truncated by the producer (e.g. because it
36
- * exceeded a wire size limit). The inspector renders a truncation badge in the
37
- * summary and a notice above the raw view.
19
+ * exceeded a wire size limit). The inspector renders a truncation badge in
20
+ * the header.
38
21
  */
39
22
  truncated?: boolean;
40
23
  /**
41
24
  * Maximum byte size before the tree view is replaced with an oversize
42
- * placeholder. Defaults to 1,048,576 (1 MB). Does not affect the raw view.
25
+ * placeholder. Defaults to 1,048,576 (1 MB).
43
26
  */
44
27
  maxBytes?: number;
45
- /**
46
- * Structured metadata shown in the summary panel. Pass contentType, source,
47
- * and/or timestamp to populate the description list rows.
48
- */
49
- meta?: PayloadInspectorMeta;
50
- /**
51
- * Custom serializer for the Raw view display text. Receives the parsed value
52
- * and must return a string. Defaults to JSON.stringify with 2-space
53
- * indentation. Use this to customize key ordering, indentation, or
54
- * alternative serialization formats. Does not affect the Summary or Tree
55
- * views, or the copy buttons. For redaction, transform the value upstream and
56
- * pass the already-redacted value as `value`.
57
- */
58
- format?: (value: unknown) => string;
59
28
  /**
60
29
  * Custom parser applied when `value` is a string. Receives the raw string
61
30
  * and must return a parsed value or throw. Defaults to JSON.parse. Use this
@@ -63,13 +32,7 @@ export type PayloadInspectorProps = Omit<HTMLAttributes<HTMLElement>, 'class' |
63
32
  */
64
33
  parse?: (raw: string) => unknown;
65
34
  /**
66
- * Initially active view tab. Defaults to "summary". Bind to control
67
- * the active tab from outside.
68
- */
69
- activeView?: PayloadInspectorView;
70
- /**
71
- * Label for the inspector region, used as the accessible name for the
72
- * containing section. Defaults to "Payload inspector".
35
+ * Visible header label for the inspector. Defaults to "Payload inspector".
73
36
  */
74
37
  label?: string;
75
38
  /** Additional CSS classes applied to the root element. */
@@ -79,8 +42,8 @@ export type PayloadInspectorProps = Omit<HTMLAttributes<HTMLElement>, 'class' |
79
42
  /**
80
43
  * Cinder-specific schema surface for PayloadInspector.
81
44
  *
82
- * Parser and formatter callbacks are documented but marked unsupported because
83
- * functions cannot be represented as JSON Schema controls.
45
+ * The parser callback is documented but marked unsupported because functions
46
+ * cannot be represented as JSON Schema controls.
84
47
  */
85
48
  export type PayloadInspectorSchemaProps = {
86
49
  /**
@@ -94,28 +57,17 @@ export type PayloadInspectorSchemaProps = {
94
57
  value?: PayloadInspectorSchemaValue;
95
58
  /**
96
59
  * When true, the payload has been truncated by the producer (e.g. because it
97
- * exceeded a wire size limit). The inspector renders a truncation badge in the
98
- * summary and a notice above the raw view.
60
+ * exceeded a wire size limit). The inspector renders a truncation badge in
61
+ * the header.
99
62
  */
100
63
  truncated?: boolean;
101
64
  /**
102
65
  * Maximum byte size before the tree view is replaced with an oversize
103
- * placeholder. Defaults to 1,048,576 (1 MB). Does not affect the raw view.
66
+ * placeholder. Defaults to 1,048,576 (1 MB).
104
67
  */
105
68
  maxBytes?: number;
106
69
  /**
107
- * Structured metadata shown in the summary panel. Pass contentType, source,
108
- * and/or timestamp to populate the description list rows.
109
- */
110
- meta?: PayloadInspectorMeta;
111
- /**
112
- * Initially active view tab. Defaults to "summary". Bind to control
113
- * the active tab from outside.
114
- */
115
- activeView?: PayloadInspectorView;
116
- /**
117
- * Label for the inspector region, used as the accessible name for the
118
- * containing section. Defaults to "Payload inspector".
70
+ * Visible header label for the inspector. Defaults to "Payload inspector".
119
71
  */
120
72
  label?: string;
121
73
  /** Additional CSS classes applied to the root element. */
@@ -4,15 +4,19 @@
4
4
  "properties": {
5
5
  "value": {
6
6
  "type": "string",
7
- "description": "Identifier matches the value of the corresponding TabPanel."
7
+ "description": "Stable identifier used for tab selection; matches TabPanel in the default pattern."
8
8
  },
9
9
  "id": {
10
10
  "type": "string",
11
11
  "description": "Optional explicit id override; auto-generated otherwise for ARIA wiring."
12
12
  },
13
+ "controls": {
14
+ "type": "string",
15
+ "description": "Optional non-empty `aria-controls` target for caller-owned panels. Empty or\nwhitespace-only strings are treated as omitted. By default, Cinder points\nat the matching TabPanel id (`${baseId}-panel-${value}`)."
16
+ },
13
17
  "disabled": {
14
18
  "type": "boolean",
15
- "description": "Disables this single tab. The panel content is hidden but its DOM stays."
19
+ "description": "Disables this single tab and removes it from keyboard activation."
16
20
  },
17
21
  "class": {
18
22
  "type": "string",
@@ -6,15 +6,21 @@ const schema = {
6
6
  properties: {
7
7
  value: {
8
8
  type: 'string',
9
- description: 'Identifier — matches the value of the corresponding TabPanel.',
9
+ description:
10
+ 'Stable identifier used for tab selection; matches TabPanel in the default pattern.',
10
11
  },
11
12
  id: {
12
13
  type: 'string',
13
14
  description: 'Optional explicit id override; auto-generated otherwise for ARIA wiring.',
14
15
  },
16
+ controls: {
17
+ type: 'string',
18
+ description:
19
+ 'Optional non-empty `aria-controls` target for caller-owned panels. Empty or\nwhitespace-only strings are treated as omitted. By default, Cinder points\nat the matching TabPanel id (`${baseId}-panel-${value}`).',
20
+ },
15
21
  disabled: {
16
22
  type: 'boolean',
17
- description: 'Disables this single tab. The panel content is hidden but its DOM stays.',
23
+ description: 'Disables this single tab and removes it from keyboard activation.',
18
24
  },
19
25
  class: {
20
26
  type: 'string',
@@ -7,12 +7,12 @@ import { untrack } from 'svelte';
7
7
  import { rovingTabIndex } from '../../_internal/collection.ts';
8
8
  import { getTabsContext } from '../tabs/tabs-context.ts';
9
9
  import { classNames } from '../../utilities/class-names.ts';
10
- let { value, id, disabled = false, class: className, children, trailing } = $props();
10
+ let { value, id, controls, disabled = false, class: className, children, trailing, } = $props();
11
11
  const tabs = getTabsContext();
12
12
  // Derive both ids from the root's baseId and the tab's value so that two
13
- // Tabs instances sharing the same value produce distinct DOM ids. The panel
14
- // id is always computed from baseId and value; it does not track a custom
15
- // `id` prop on this Tab.
13
+ // Tabs instances sharing the same value produce distinct DOM ids. The default
14
+ // panel id does not track a custom `id` prop on this Tab. `controls` can
15
+ // intentionally override the controlled panel id for caller-owned panels.
16
16
  //
17
17
  // ⚠️ Custom-id wiring: if you supply a custom `id` prop to override this
18
18
  // Tab's element id, the paired TabPanel's default `aria-labelledby` still
@@ -21,7 +21,11 @@ const tabs = getTabsContext();
21
21
  // to the paired TabPanel's `ariaLabelledby` prop. Removing the custom `id`
22
22
  // override restores fully automatic wiring.
23
23
  const tabId = $derived(id ?? `${tabs.baseId}-tab-${value}`);
24
- const panelId = $derived(`${tabs.baseId}-panel-${value}`);
24
+ const panelId = $derived.by(() => {
25
+ // Caller-owned panels can provide a non-empty aria-controls override.
26
+ const controlsId = controls?.trim();
27
+ return controlsId ? controlsId : `${tabs.baseId}-panel-${value}`;
28
+ });
25
29
  const isActive = $derived(tabs.isActive(value));
26
30
  const isFocusable = $derived(tabs.isFocusable(value));
27
31
  let buttonElement = $state();
@@ -1,10 +1,16 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  export type TabProps = {
3
- /** Identifier matches the value of the corresponding TabPanel. */
3
+ /** Stable identifier used for tab selection; matches TabPanel in the default pattern. */
4
4
  value: string;
5
5
  /** Optional explicit id override; auto-generated otherwise for ARIA wiring. */
6
6
  id?: string;
7
- /** Disables this single tab. The panel content is hidden but its DOM stays. */
7
+ /**
8
+ * Optional non-empty `aria-controls` target for caller-owned panels. Empty or
9
+ * whitespace-only strings are treated as omitted. By default, Cinder points
10
+ * at the matching TabPanel id (`${baseId}-panel-${value}`).
11
+ */
12
+ controls?: string;
13
+ /** Disables this single tab and removes it from keyboard activation. */
8
14
  disabled?: boolean;
9
15
  /** Additional class names merged with `.cinder-tab`. */
10
16
  class?: string;
package/src/index.ts CHANGED
@@ -24,6 +24,7 @@ export type { AlertDialogProps } from './components/alert-dialog/index.ts';
24
24
  export { default as ApprovalCard } from './components/approval-card/index.ts';
25
25
  export type {
26
26
  ApprovalCardCallbacks,
27
+ ApprovalCardHeadingLevel,
27
28
  ApprovalCardProps,
28
29
  ApprovalCardSchemaProps,
29
30
  ApprovalOperation,
@@ -155,6 +156,22 @@ export type {
155
156
  export { default as Chat } from './components/chat/index.ts';
156
157
  export type { ChatProps } from './components/chat/index.ts';
157
158
 
159
+ export {
160
+ default as ChatComposerPopover,
161
+ filterFuzzySubsequence,
162
+ fuzzySubsequenceScore,
163
+ } from './components/chat-composer-popover/index.ts';
164
+ export type {
165
+ ChatComposerPopoverComposerProps,
166
+ ChatComposerPopoverItem,
167
+ ChatComposerPopoverItemSnippetContext,
168
+ ChatComposerPopoverProps,
169
+ ChatComposerPopoverSelection,
170
+ ChatComposerPopoverTriggerMatch,
171
+ FuzzyFilterItem,
172
+ FuzzyFilterResult,
173
+ } from './components/chat-composer-popover/index.ts';
174
+
158
175
  export { default as ChatConversationHeader } from './components/chat-conversation-header/index.ts';
159
176
  export type {
160
177
  ChatConversationHeaderHeadingLevel,
@@ -629,11 +646,7 @@ export { default as PageHeader } from './components/page-header/index.ts';
629
646
  export type { PageHeaderProps } from './components/page-header/index.ts';
630
647
 
631
648
  export { default as PayloadInspector } from './components/payload-inspector/index.ts';
632
- export type {
633
- PayloadInspectorMeta,
634
- PayloadInspectorProps,
635
- PayloadInspectorView,
636
- } from './components/payload-inspector/index.ts';
649
+ export type { PayloadInspectorProps } from './components/payload-inspector/index.ts';
637
650
 
638
651
  export { default as PermissionMatrix } from './components/permission-matrix/index.ts';
639
652
  export type {
@@ -38,6 +38,7 @@
38
38
  @import '../components/capability-gate/capability-gate.css';
39
39
  @import '../components/chat-conversation-header/chat-conversation-header.css';
40
40
  @import '../components/chat-conversation-list/chat-conversation-list.css';
41
+ @import '../components/chat-composer-popover/chat-composer-popover.css';
41
42
  @import '../components/chat/chat.css';
42
43
  @import '../components/chip/chip.css';
43
44
  @import '../components/choice-grid/choice-grid.css';