@buoy-gg/ask-buoy 7.0.34 → 7.0.36

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 (352) hide show
  1. package/README.md +35 -8
  2. package/lib/commonjs/blocks/AskBlocks.js +338 -1
  3. package/lib/commonjs/blocks/AskBlocks.js.map +1 -0
  4. package/lib/commonjs/blocks/BlockRenderer.js +262 -1
  5. package/lib/commonjs/blocks/BlockRenderer.js.map +1 -0
  6. package/lib/commonjs/blocks/ChromePrototypes.js +514 -1
  7. package/lib/commonjs/blocks/ChromePrototypes.js.map +1 -0
  8. package/lib/commonjs/blocks/DataBlocks.js +781 -1
  9. package/lib/commonjs/blocks/DataBlocks.js.map +1 -0
  10. package/lib/commonjs/blocks/ExtraBlocks.js +1860 -1
  11. package/lib/commonjs/blocks/ExtraBlocks.js.map +1 -0
  12. package/lib/commonjs/blocks/MediaBlocks.js +156 -1
  13. package/lib/commonjs/blocks/MediaBlocks.js.map +1 -0
  14. package/lib/commonjs/blocks/ReceiptBlocks.js +586 -1
  15. package/lib/commonjs/blocks/ReceiptBlocks.js.map +1 -0
  16. package/lib/commonjs/blocks/blockText.js +60 -0
  17. package/lib/commonjs/blocks/blockText.js.map +1 -0
  18. package/lib/commonjs/blocks/blockText.test.js +53 -0
  19. package/lib/commonjs/blocks/blockText.test.js.map +1 -0
  20. package/lib/commonjs/blocks/context.js +42 -1
  21. package/lib/commonjs/blocks/context.js.map +1 -0
  22. package/lib/commonjs/blocks/icons.js +96 -1
  23. package/lib/commonjs/blocks/icons.js.map +1 -0
  24. package/lib/commonjs/blocks/index.js +95 -1
  25. package/lib/commonjs/blocks/index.js.map +1 -0
  26. package/lib/commonjs/blocks/listRow.test.js +55 -0
  27. package/lib/commonjs/blocks/listRow.test.js.map +1 -0
  28. package/lib/commonjs/blocks/pageState.js +34 -0
  29. package/lib/commonjs/blocks/pageState.js.map +1 -0
  30. package/lib/commonjs/blocks/pageState.test.js +57 -0
  31. package/lib/commonjs/blocks/pageState.test.js.map +1 -0
  32. package/lib/commonjs/blocks/primitives.js +457 -1
  33. package/lib/commonjs/blocks/primitives.js.map +1 -0
  34. package/lib/commonjs/blocks/primitivesIndex.js +62 -1
  35. package/lib/commonjs/blocks/primitivesIndex.js.map +1 -0
  36. package/lib/commonjs/components/ApprovalCard.js +244 -1
  37. package/lib/commonjs/components/ApprovalCard.js.map +1 -0
  38. package/lib/commonjs/components/AskBuoyHeader.js +196 -1
  39. package/lib/commonjs/components/AskBuoyHeader.js.map +1 -0
  40. package/lib/commonjs/components/AskBuoyIcon.js +19 -1
  41. package/lib/commonjs/components/AskBuoyIcon.js.map +1 -0
  42. package/lib/commonjs/components/AskBuoyModal.js +479 -1
  43. package/lib/commonjs/components/AskBuoyModal.js.map +1 -0
  44. package/lib/commonjs/components/AskBuoySettings.js +119 -0
  45. package/lib/commonjs/components/AskBuoySettings.js.map +1 -0
  46. package/lib/commonjs/components/ChangesBar.js +211 -1
  47. package/lib/commonjs/components/ChangesBar.js.map +1 -0
  48. package/lib/commonjs/components/Composer.js +255 -1
  49. package/lib/commonjs/components/Composer.js.map +1 -0
  50. package/lib/commonjs/components/EmptyState.js +161 -1
  51. package/lib/commonjs/components/EmptyState.js.map +1 -0
  52. package/lib/commonjs/components/KeyboardPad.js +80 -0
  53. package/lib/commonjs/components/KeyboardPad.js.map +1 -0
  54. package/lib/commonjs/components/Markdown.js +310 -1
  55. package/lib/commonjs/components/Markdown.js.map +1 -0
  56. package/lib/commonjs/components/MessageList.js +930 -1
  57. package/lib/commonjs/components/MessageList.js.map +1 -0
  58. package/lib/commonjs/components/QueuedMessages.js +145 -0
  59. package/lib/commonjs/components/QueuedMessages.js.map +1 -0
  60. package/lib/commonjs/components/ThinkingStrip.js +223 -0
  61. package/lib/commonjs/components/ThinkingStrip.js.map +1 -0
  62. package/lib/commonjs/components/TypingDots.js +63 -1
  63. package/lib/commonjs/components/TypingDots.js.map +1 -0
  64. package/lib/commonjs/components/markdownParse.js +131 -0
  65. package/lib/commonjs/components/markdownParse.js.map +1 -0
  66. package/lib/commonjs/components/markdownParse.test.js +99 -0
  67. package/lib/commonjs/components/markdownParse.test.js.map +1 -0
  68. package/lib/commonjs/components/useCopyAction.js +50 -0
  69. package/lib/commonjs/components/useCopyAction.js.map +1 -0
  70. package/lib/commonjs/index.js +252 -1
  71. package/lib/commonjs/index.js.map +1 -0
  72. package/lib/commonjs/preset.js +90 -1
  73. package/lib/commonjs/preset.js.map +1 -0
  74. package/lib/commonjs/store/activityGroups.js +110 -0
  75. package/lib/commonjs/store/activityGroups.js.map +1 -0
  76. package/lib/commonjs/store/activityGroups.test.js +78 -0
  77. package/lib/commonjs/store/activityGroups.test.js.map +1 -0
  78. package/lib/commonjs/store/askBuoySettings.js +72 -0
  79. package/lib/commonjs/store/askBuoySettings.js.map +1 -0
  80. package/lib/commonjs/store/askBuoyStore.js +547 -1
  81. package/lib/commonjs/store/askBuoyStore.js.map +1 -0
  82. package/lib/commonjs/store/blockPlacement.js +64 -0
  83. package/lib/commonjs/store/blockPlacement.js.map +1 -0
  84. package/lib/commonjs/store/blockPlacement.test.js +123 -0
  85. package/lib/commonjs/store/blockPlacement.test.js.map +1 -0
  86. package/lib/commonjs/store/queue.test.js +150 -0
  87. package/lib/commonjs/store/queue.test.js.map +1 -0
  88. package/lib/commonjs/store/resetConversation.js +77 -0
  89. package/lib/commonjs/store/resetConversation.js.map +1 -0
  90. package/lib/commonjs/store/restorePending.test.js +63 -0
  91. package/lib/commonjs/store/restorePending.test.js.map +1 -0
  92. package/lib/commonjs/store/restoredIds.test.js +47 -0
  93. package/lib/commonjs/store/restoredIds.test.js.map +1 -0
  94. package/lib/commonjs/store/suggestions.js +54 -0
  95. package/lib/commonjs/store/suggestions.js.map +1 -0
  96. package/lib/commonjs/store/suggestions.test.js +58 -0
  97. package/lib/commonjs/store/suggestions.test.js.map +1 -0
  98. package/lib/commonjs/store/systemLine.test.js +77 -0
  99. package/lib/commonjs/store/systemLine.test.js.map +1 -0
  100. package/lib/commonjs/store/ticketPrompt.js +17 -0
  101. package/lib/commonjs/store/ticketPrompt.js.map +1 -0
  102. package/lib/commonjs/store/traceText.js +81 -0
  103. package/lib/commonjs/store/traceText.js.map +1 -0
  104. package/lib/commonjs/store/traceText.test.js +112 -0
  105. package/lib/commonjs/store/traceText.test.js.map +1 -0
  106. package/lib/commonjs/store/transcriptPersistence.js +297 -0
  107. package/lib/commonjs/store/transcriptPersistence.js.map +1 -0
  108. package/lib/commonjs/store/transcriptPersistence.test.js +333 -0
  109. package/lib/commonjs/store/transcriptPersistence.test.js.map +1 -0
  110. package/lib/commonjs/store/turnRendering.test.js +151 -0
  111. package/lib/commonjs/store/turnRendering.test.js.map +1 -0
  112. package/lib/commonjs/store/useAskBuoy.js +622 -1
  113. package/lib/commonjs/store/useAskBuoy.js.map +1 -0
  114. package/lib/commonjs/store/useAskBuoySettings.js +14 -0
  115. package/lib/commonjs/store/useAskBuoySettings.js.map +1 -0
  116. package/lib/commonjs/sync/askBuoySyncAdapter.js +140 -1
  117. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +1 -0
  118. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +141 -1
  119. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +1 -0
  120. package/lib/commonjs/sync/wire.js +58 -1
  121. package/lib/commonjs/sync/wire.js.map +1 -0
  122. package/lib/commonjs/types.js +6 -1
  123. package/lib/commonjs/types.js.map +1 -0
  124. package/lib/module/blocks/AskBlocks.js +331 -1
  125. package/lib/module/blocks/AskBlocks.js.map +1 -0
  126. package/lib/module/blocks/BlockRenderer.js +257 -1
  127. package/lib/module/blocks/BlockRenderer.js.map +1 -0
  128. package/lib/module/blocks/ChromePrototypes.js +503 -1
  129. package/lib/module/blocks/ChromePrototypes.js.map +1 -0
  130. package/lib/module/blocks/DataBlocks.js +767 -1
  131. package/lib/module/blocks/DataBlocks.js.map +1 -0
  132. package/lib/module/blocks/ExtraBlocks.js +1833 -1
  133. package/lib/module/blocks/ExtraBlocks.js.map +1 -0
  134. package/lib/module/blocks/MediaBlocks.js +151 -1
  135. package/lib/module/blocks/MediaBlocks.js.map +1 -0
  136. package/lib/module/blocks/ReceiptBlocks.js +574 -1
  137. package/lib/module/blocks/ReceiptBlocks.js.map +1 -0
  138. package/lib/module/blocks/blockText.js +55 -0
  139. package/lib/module/blocks/blockText.js.map +1 -0
  140. package/lib/module/blocks/blockText.test.js +53 -0
  141. package/lib/module/blocks/blockText.test.js.map +1 -0
  142. package/lib/module/blocks/context.js +35 -1
  143. package/lib/module/blocks/context.js.map +1 -0
  144. package/lib/module/blocks/icons.js +91 -1
  145. package/lib/module/blocks/icons.js.map +1 -0
  146. package/lib/module/blocks/index.js +8 -1
  147. package/lib/module/blocks/index.js.map +1 -0
  148. package/lib/module/blocks/listRow.test.js +56 -0
  149. package/lib/module/blocks/listRow.test.js.map +1 -0
  150. package/lib/module/blocks/pageState.js +30 -0
  151. package/lib/module/blocks/pageState.js.map +1 -0
  152. package/lib/module/blocks/pageState.test.js +56 -0
  153. package/lib/module/blocks/pageState.test.js.map +1 -0
  154. package/lib/module/blocks/primitives.js +445 -1
  155. package/lib/module/blocks/primitives.js.map +1 -0
  156. package/lib/module/blocks/primitivesIndex.js +5 -1
  157. package/lib/module/blocks/primitivesIndex.js.map +1 -0
  158. package/lib/module/components/ApprovalCard.js +239 -1
  159. package/lib/module/components/ApprovalCard.js.map +1 -0
  160. package/lib/module/components/AskBuoyHeader.js +193 -1
  161. package/lib/module/components/AskBuoyHeader.js.map +1 -0
  162. package/lib/module/components/AskBuoyIcon.js +8 -1
  163. package/lib/module/components/AskBuoyIcon.js.map +1 -0
  164. package/lib/module/components/AskBuoyModal.js +474 -1
  165. package/lib/module/components/AskBuoyModal.js.map +1 -0
  166. package/lib/module/components/AskBuoySettings.js +114 -0
  167. package/lib/module/components/AskBuoySettings.js.map +1 -0
  168. package/lib/module/components/ChangesBar.js +206 -1
  169. package/lib/module/components/ChangesBar.js.map +1 -0
  170. package/lib/module/components/Composer.js +250 -1
  171. package/lib/module/components/Composer.js.map +1 -0
  172. package/lib/module/components/EmptyState.js +156 -1
  173. package/lib/module/components/EmptyState.js.map +1 -0
  174. package/lib/module/components/KeyboardPad.js +75 -0
  175. package/lib/module/components/KeyboardPad.js.map +1 -0
  176. package/lib/module/components/Markdown.js +305 -1
  177. package/lib/module/components/Markdown.js.map +1 -0
  178. package/lib/module/components/MessageList.js +924 -1
  179. package/lib/module/components/MessageList.js.map +1 -0
  180. package/lib/module/components/QueuedMessages.js +140 -0
  181. package/lib/module/components/QueuedMessages.js.map +1 -0
  182. package/lib/module/components/ThinkingStrip.js +218 -0
  183. package/lib/module/components/ThinkingStrip.js.map +1 -0
  184. package/lib/module/components/TypingDots.js +58 -1
  185. package/lib/module/components/TypingDots.js.map +1 -0
  186. package/lib/module/components/markdownParse.js +125 -0
  187. package/lib/module/components/markdownParse.js.map +1 -0
  188. package/lib/module/components/markdownParse.test.js +98 -0
  189. package/lib/module/components/markdownParse.test.js.map +1 -0
  190. package/lib/module/components/useCopyAction.js +46 -0
  191. package/lib/module/components/useCopyAction.js.map +1 -0
  192. package/lib/module/index.js +34 -1
  193. package/lib/module/index.js.map +1 -0
  194. package/lib/module/preset.js +73 -1
  195. package/lib/module/preset.js.map +1 -0
  196. package/lib/module/store/activityGroups.js +103 -0
  197. package/lib/module/store/activityGroups.js.map +1 -0
  198. package/lib/module/store/activityGroups.test.js +77 -0
  199. package/lib/module/store/activityGroups.test.js.map +1 -0
  200. package/lib/module/store/askBuoySettings.js +67 -0
  201. package/lib/module/store/askBuoySettings.js.map +1 -0
  202. package/lib/module/store/askBuoyStore.js +541 -1
  203. package/lib/module/store/askBuoyStore.js.map +1 -0
  204. package/lib/module/store/blockPlacement.js +59 -0
  205. package/lib/module/store/blockPlacement.js.map +1 -0
  206. package/lib/module/store/blockPlacement.test.js +122 -0
  207. package/lib/module/store/blockPlacement.test.js.map +1 -0
  208. package/lib/module/store/queue.test.js +149 -0
  209. package/lib/module/store/queue.test.js.map +1 -0
  210. package/lib/module/store/resetConversation.js +72 -0
  211. package/lib/module/store/resetConversation.js.map +1 -0
  212. package/lib/module/store/restorePending.test.js +62 -0
  213. package/lib/module/store/restorePending.test.js.map +1 -0
  214. package/lib/module/store/restoredIds.test.js +46 -0
  215. package/lib/module/store/restoredIds.test.js.map +1 -0
  216. package/lib/module/store/suggestions.js +49 -0
  217. package/lib/module/store/suggestions.js.map +1 -0
  218. package/lib/module/store/suggestions.test.js +57 -0
  219. package/lib/module/store/suggestions.test.js.map +1 -0
  220. package/lib/module/store/systemLine.test.js +76 -0
  221. package/lib/module/store/systemLine.test.js.map +1 -0
  222. package/lib/module/store/ticketPrompt.js +13 -0
  223. package/lib/module/store/ticketPrompt.js.map +1 -0
  224. package/lib/module/store/traceText.js +75 -0
  225. package/lib/module/store/traceText.js.map +1 -0
  226. package/lib/module/store/traceText.test.js +111 -0
  227. package/lib/module/store/traceText.test.js.map +1 -0
  228. package/lib/module/store/transcriptPersistence.js +287 -0
  229. package/lib/module/store/transcriptPersistence.js.map +1 -0
  230. package/lib/module/store/transcriptPersistence.test.js +332 -0
  231. package/lib/module/store/transcriptPersistence.test.js.map +1 -0
  232. package/lib/module/store/turnRendering.test.js +150 -0
  233. package/lib/module/store/turnRendering.test.js.map +1 -0
  234. package/lib/module/store/useAskBuoy.js +616 -1
  235. package/lib/module/store/useAskBuoy.js.map +1 -0
  236. package/lib/module/store/useAskBuoySettings.js +9 -0
  237. package/lib/module/store/useAskBuoySettings.js.map +1 -0
  238. package/lib/module/sync/askBuoySyncAdapter.js +135 -1
  239. package/lib/module/sync/askBuoySyncAdapter.js.map +1 -0
  240. package/lib/module/sync/askBuoySyncAdapter.test.js +140 -1
  241. package/lib/module/sync/askBuoySyncAdapter.test.js.map +1 -0
  242. package/lib/module/sync/wire.js +47 -1
  243. package/lib/module/sync/wire.js.map +1 -0
  244. package/lib/module/types.js +4 -1
  245. package/lib/module/types.js.map +1 -0
  246. package/lib/typescript/blocks/AskBlocks.d.ts.map +1 -0
  247. package/lib/typescript/blocks/BlockRenderer.d.ts.map +1 -0
  248. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +1 -0
  249. package/lib/typescript/blocks/DataBlocks.d.ts +42 -0
  250. package/lib/typescript/blocks/DataBlocks.d.ts.map +1 -0
  251. package/lib/typescript/blocks/ExtraBlocks.d.ts +29 -2
  252. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +1 -0
  253. package/lib/typescript/blocks/MediaBlocks.d.ts.map +1 -0
  254. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +1 -0
  255. package/lib/typescript/blocks/blockText.d.ts +14 -0
  256. package/lib/typescript/blocks/blockText.d.ts.map +1 -0
  257. package/lib/typescript/blocks/blockText.test.d.ts +2 -0
  258. package/lib/typescript/blocks/blockText.test.d.ts.map +1 -0
  259. package/lib/typescript/blocks/context.d.ts.map +1 -0
  260. package/lib/typescript/blocks/icons.d.ts.map +1 -0
  261. package/lib/typescript/blocks/index.d.ts.map +1 -0
  262. package/lib/typescript/blocks/listRow.test.d.ts +2 -0
  263. package/lib/typescript/blocks/listRow.test.d.ts.map +1 -0
  264. package/lib/typescript/blocks/pageState.d.ts +23 -0
  265. package/lib/typescript/blocks/pageState.d.ts.map +1 -0
  266. package/lib/typescript/blocks/pageState.test.d.ts +2 -0
  267. package/lib/typescript/blocks/pageState.test.d.ts.map +1 -0
  268. package/lib/typescript/blocks/primitives.d.ts +55 -10
  269. package/lib/typescript/blocks/primitives.d.ts.map +1 -0
  270. package/lib/typescript/blocks/primitivesIndex.d.ts +2 -1
  271. package/lib/typescript/blocks/primitivesIndex.d.ts.map +1 -0
  272. package/lib/typescript/components/ApprovalCard.d.ts.map +1 -0
  273. package/lib/typescript/components/AskBuoyHeader.d.ts +41 -1
  274. package/lib/typescript/components/AskBuoyHeader.d.ts.map +1 -0
  275. package/lib/typescript/components/AskBuoyIcon.d.ts.map +1 -0
  276. package/lib/typescript/components/AskBuoyModal.d.ts.map +1 -0
  277. package/lib/typescript/components/AskBuoySettings.d.ts +2 -0
  278. package/lib/typescript/components/AskBuoySettings.d.ts.map +1 -0
  279. package/lib/typescript/components/ChangesBar.d.ts.map +1 -0
  280. package/lib/typescript/components/Composer.d.ts +16 -1
  281. package/lib/typescript/components/Composer.d.ts.map +1 -0
  282. package/lib/typescript/components/EmptyState.d.ts +5 -1
  283. package/lib/typescript/components/EmptyState.d.ts.map +1 -0
  284. package/lib/typescript/components/KeyboardPad.d.ts +33 -0
  285. package/lib/typescript/components/KeyboardPad.d.ts.map +1 -0
  286. package/lib/typescript/components/Markdown.d.ts +0 -10
  287. package/lib/typescript/components/Markdown.d.ts.map +1 -0
  288. package/lib/typescript/components/MessageList.d.ts +19 -7
  289. package/lib/typescript/components/MessageList.d.ts.map +1 -0
  290. package/lib/typescript/components/QueuedMessages.d.ts +10 -0
  291. package/lib/typescript/components/QueuedMessages.d.ts.map +1 -0
  292. package/lib/typescript/components/ThinkingStrip.d.ts +5 -0
  293. package/lib/typescript/components/ThinkingStrip.d.ts.map +1 -0
  294. package/lib/typescript/components/TypingDots.d.ts.map +1 -0
  295. package/lib/typescript/components/markdownParse.d.ts +49 -0
  296. package/lib/typescript/components/markdownParse.d.ts.map +1 -0
  297. package/lib/typescript/components/markdownParse.test.d.ts +2 -0
  298. package/lib/typescript/components/markdownParse.test.d.ts.map +1 -0
  299. package/lib/typescript/components/useCopyAction.d.ts +5 -0
  300. package/lib/typescript/components/useCopyAction.d.ts.map +1 -0
  301. package/lib/typescript/index.d.ts +5 -0
  302. package/lib/typescript/index.d.ts.map +1 -0
  303. package/lib/typescript/preset.d.ts.map +1 -0
  304. package/lib/typescript/store/activityGroups.d.ts +29 -0
  305. package/lib/typescript/store/activityGroups.d.ts.map +1 -0
  306. package/lib/typescript/store/activityGroups.test.d.ts +2 -0
  307. package/lib/typescript/store/activityGroups.test.d.ts.map +1 -0
  308. package/lib/typescript/store/askBuoySettings.d.ts +44 -0
  309. package/lib/typescript/store/askBuoySettings.d.ts.map +1 -0
  310. package/lib/typescript/store/askBuoyStore.d.ts +216 -18
  311. package/lib/typescript/store/askBuoyStore.d.ts.map +1 -0
  312. package/lib/typescript/store/blockPlacement.d.ts +30 -0
  313. package/lib/typescript/store/blockPlacement.d.ts.map +1 -0
  314. package/lib/typescript/store/blockPlacement.test.d.ts +2 -0
  315. package/lib/typescript/store/blockPlacement.test.d.ts.map +1 -0
  316. package/lib/typescript/store/queue.test.d.ts +2 -0
  317. package/lib/typescript/store/queue.test.d.ts.map +1 -0
  318. package/lib/typescript/store/resetConversation.d.ts +38 -0
  319. package/lib/typescript/store/resetConversation.d.ts.map +1 -0
  320. package/lib/typescript/store/restorePending.test.d.ts +2 -0
  321. package/lib/typescript/store/restorePending.test.d.ts.map +1 -0
  322. package/lib/typescript/store/restoredIds.test.d.ts +2 -0
  323. package/lib/typescript/store/restoredIds.test.d.ts.map +1 -0
  324. package/lib/typescript/store/suggestions.d.ts +32 -0
  325. package/lib/typescript/store/suggestions.d.ts.map +1 -0
  326. package/lib/typescript/store/suggestions.test.d.ts +2 -0
  327. package/lib/typescript/store/suggestions.test.d.ts.map +1 -0
  328. package/lib/typescript/store/systemLine.test.d.ts +2 -0
  329. package/lib/typescript/store/systemLine.test.d.ts.map +1 -0
  330. package/lib/typescript/store/ticketPrompt.d.ts +11 -0
  331. package/lib/typescript/store/ticketPrompt.d.ts.map +1 -0
  332. package/lib/typescript/store/traceText.d.ts +33 -0
  333. package/lib/typescript/store/traceText.d.ts.map +1 -0
  334. package/lib/typescript/store/traceText.test.d.ts +2 -0
  335. package/lib/typescript/store/traceText.test.d.ts.map +1 -0
  336. package/lib/typescript/store/transcriptPersistence.d.ts +79 -0
  337. package/lib/typescript/store/transcriptPersistence.d.ts.map +1 -0
  338. package/lib/typescript/store/transcriptPersistence.test.d.ts +2 -0
  339. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +1 -0
  340. package/lib/typescript/store/turnRendering.test.d.ts +2 -0
  341. package/lib/typescript/store/turnRendering.test.d.ts.map +1 -0
  342. package/lib/typescript/store/useAskBuoy.d.ts +23 -1
  343. package/lib/typescript/store/useAskBuoy.d.ts.map +1 -0
  344. package/lib/typescript/store/useAskBuoySettings.d.ts +3 -0
  345. package/lib/typescript/store/useAskBuoySettings.d.ts.map +1 -0
  346. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +26 -6
  347. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +1 -0
  348. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +1 -0
  349. package/lib/typescript/sync/wire.d.ts.map +1 -0
  350. package/lib/typescript/types.d.ts +24 -1
  351. package/lib/typescript/types.d.ts.map +1 -0
  352. package/package.json +9 -9
@@ -1 +1,767 @@
1
- "use strict";import{useState}from"react";import{Image,Pressable,StyleSheet,Text,View}from"react-native";import{AlertTriangle,Check,Info,night,X}from"@buoy-gg/shared-ui";import{CAPS}from"@buoy-gg/agent-core";import{ActionRow,blockStyles as b,Card,More,toneColor,useBlockHandlers,useExpand}from"./primitivesIndex";import{renderInline}from"../components/Markdown";import{BlockIcon}from"./icons";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function fmt(e){if(void 0===e)return"—";if(null===e)return"null";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);try{const t=JSON.stringify(e);return t.length>120?`${t.slice(0,117)}…`:t}catch{return String(e)}}export function Table({block:e}){const{visible:t,expanded:o,toggle:n}=useExpand(e.rows,CAPS.tableRows),i=e.columns.slice(0,4);return _jsxs(Card,{title:e.title,source:e.source,testID:`buoy-block-table-${e.id}`,children:[_jsx(View,{style:styles.tableHead,children:i.map((e,t)=>_jsx(Text,{style:[styles.th,0===t&&styles.firstCol],numberOfLines:1,children:e},e))}),t.map((e,t)=>_jsx(View,{style:[styles.tr,t>0&&b.rowDivider],children:i.map((t,o)=>{const n=e[o],i="string"==typeof n?n:n?.text??"",l="string"==typeof n?void 0:n?.tone;return _jsx(Text,{style:[styles.td,0===o&&styles.firstCol,0===o&&styles.tdFirst,l&&{color:toneColor(l)}],numberOfLines:2,children:renderInline(i,styles.td)},o)})},t)),_jsx(More,{shown:t.length,total:e.total??e.rows.length,onExpand:e.rows.length>t.length||o?n:void 0,expanded:o})]})}export function KeyValue({block:e}){const{visible:t,expanded:o,toggle:n}=useExpand(e.pairs,CAPS.keyValuePairs),[i,l]=useState(null);return _jsxs(Card,{title:e.title,source:e.source,testID:`buoy-block-keyvalue-${e.id}`,children:[t.map((e,t)=>{const o="object"==typeof e.value&&null!==e.value,n=i===e.key;return _jsxs(Pressable,{onPress:o?()=>l(n?null:e.key):void 0,style:[styles.kvRow,t>0&&b.rowDivider],children:[_jsx(Text,{style:styles.kvKey,numberOfLines:1,children:e.key}),_jsx(Text,{style:[styles.kvValue,n&&b.mono],numberOfLines:n?void 0:2,selectable:!0,children:n?JSON.stringify(e.value,null,2):fmt(e.value)})]},e.key)}),_jsx(More,{shown:t.length,total:e.pairs.length,onExpand:e.pairs.length>CAPS.keyValuePairs?n:void 0,expanded:o})]})}export function List({block:e}){const t=useBlockHandlers(),{visible:o,expanded:n,toggle:i}=useExpand(e.items,CAPS.listItems);return _jsxs(Card,{title:e.title,source:e.source,testID:`buoy-block-list-${e.id}`,children:[o.map((o,n)=>{const i=o.action?Pressable:View;return _jsxs(i,{...o.action?{onPress:()=>{t.runAction(o.action,e.id)},accessibilityRole:"button"}:{},style:[b.row,n>0&&b.rowDivider],children:[o.image?_jsx(Image,{source:{uri:o.image},style:styles.thumb,accessibilityLabel:o.title}):o.icon?_jsx(BlockIcon,{name:o.icon}):null,_jsxs(View,{style:styles.flex,children:[_jsx(Text,{style:[b.rowTitle,o.tone&&{color:toneColor(o.tone)}],numberOfLines:2,children:renderInline(o.title,b.rowTitle)}),o.subtitle?_jsx(Text,{style:b.rowSub,numberOfLines:2,children:renderInline(o.subtitle,b.rowSub)}):null]}),o.trailing?_jsx(Text,{style:[b.rowTrailing,o.tone&&{color:toneColor(o.tone)}],numberOfLines:1,children:o.trailing}):null,o.action?_jsx(Text,{style:styles.rowAction,children:o.action.label}):null]},o.id??`${o.title}-${n}`)}),_jsx(More,{shown:o.length,total:e.total??e.items.length,onExpand:e.items.length>o.length||n?i:void 0,expanded:n})]})}export function Diff({block:e}){return _jsxs(Card,{title:e.title??"What changed",source:e.source,testID:`buoy-block-diff-${e.id}`,children:[e.changes.slice(0,CAPS.keyValuePairs).map((e,t)=>{const o=void 0===e.before&&void 0!==e.after,n=void 0===e.after&&void 0!==e.before;return _jsxs(View,{style:[styles.diffRow,t>0&&b.rowDivider],children:[_jsx(Text,{style:styles.diffPath,numberOfLines:1,children:e.path}),o?null:_jsxs(View,{style:styles.diffLine,children:[_jsx(Text,{style:[styles.diffMark,{color:night.color.danger}],children:"−"}),_jsx(Text,{style:[styles.diffValue,{color:night.color.danger}],numberOfLines:3,selectable:!0,children:fmt(e.before)})]}),n?null:_jsxs(View,{style:styles.diffLine,children:[_jsx(Text,{style:[styles.diffMark,{color:night.color.accent}],children:"+"}),_jsx(Text,{style:[styles.diffValue,{color:night.color.accent}],numberOfLines:3,selectable:!0,children:fmt(e.after)})]})]},`${e.path}-${t}`)}),_jsx(More,{shown:Math.min(e.changes.length,CAPS.keyValuePairs),total:e.changes.length})]})}export function Chart({block:e}){const t=e.bars.slice(0,CAPS.chartBars),o=e.max??Math.max(1,...t.map(e=>e.value));return _jsx(Card,{title:e.title,source:e.source,testID:`buoy-block-chart-${e.id}`,children:_jsx(View,{style:styles.chart,children:t.map(e=>_jsxs(View,{style:styles.barRow,children:[_jsx(Text,{style:styles.barLabel,numberOfLines:1,children:e.label}),_jsx(View,{style:styles.barTrack,children:_jsx(View,{style:[styles.bar,{width:`${Math.max(2,Math.round(e.value/o*100))}%`,backgroundColor:toneColor(e.tone??"accent")}]})}),_jsxs(Text,{style:styles.barValue,numberOfLines:1,children:[e.value,e.unit?` ${e.unit}`:""]})]},e.label))})})}export function Steps({block:e}){return _jsx(Card,{title:e.title,testID:`buoy-block-steps-${e.id}`,children:e.steps.map((e,t)=>_jsxs(View,{style:[styles.step,t>0&&b.rowDivider],children:[_jsx(View,{style:[styles.stepMark,"done"===e.state&&styles.stepDone,"failed"===e.state&&styles.stepFailed],children:"done"===e.state?_jsx(Check,{size:10,color:night.color.onAccent}):"failed"===e.state?_jsx(X,{size:10,color:night.color.text}):_jsx(Text,{style:styles.stepNum,children:t+1})}),_jsx(Text,{style:[b.rowTitle,"done"===e.state&&styles.stepTextDone],children:e.text})]},t))})}export function Code({block:e}){const t="json"===e.language?tryPretty(e.text):e.text;return _jsx(Card,{title:e.title,testID:`buoy-block-code-${e.id}`,children:_jsx(Text,{style:[b.mono,styles.code],selectable:!0,children:t})})}function tryPretty(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}export function Notice({block:e}){const t="danger"===e.tone?night.color.danger:"warning"===e.tone?night.color.warning:night.color.info,o="info"===e.tone?Info:AlertTriangle;return _jsxs(Card,{tone:e.tone,testID:`buoy-block-notice-${e.id}`,children:[_jsxs(View,{style:styles.noticeRow,children:[_jsx(o,{size:14,color:t}),_jsx(Text,{style:styles.noticeText,children:e.text})]}),_jsx(ActionRow,{actions:e.actions,blockId:e.id})]})}export function Finding({block:e}){return _jsxs(Card,{title:e.title,source:e.source,testID:`buoy-block-finding-${e.id}`,tone:"warning",children:[e.evidence.map((e,t)=>_jsxs(View,{style:[styles.kvRow,t>0&&b.rowDivider],children:[_jsx(Text,{style:styles.kvKey,numberOfLines:1,children:e.label}),_jsx(Text,{style:[styles.kvValue,e.tone&&{color:toneColor(e.tone)}],numberOfLines:3,children:e.value})]},`${e.label}-${t}`)),_jsx(ActionRow,{actions:e.actions,blockId:e.id})]})}const styles=StyleSheet.create({flex:{flex:1},tableHead:{flexDirection:"row",paddingHorizontal:12,paddingVertical:6,gap:8,backgroundColor:night.color.fill},th:{flex:1,color:night.color.textTertiary,fontSize:night.font.micro,fontWeight:"700",letterSpacing:.6,textTransform:"uppercase"},tr:{flexDirection:"row",paddingHorizontal:12,paddingVertical:8,gap:8,alignItems:"center"},td:{flex:1,color:night.color.textSecondary,fontSize:night.font.caption,lineHeight:17},tdFirst:{color:night.color.text,fontWeight:"500"},firstCol:{flex:1.4},kvRow:{flexDirection:"row",gap:12,paddingHorizontal:12,paddingVertical:8,alignItems:"flex-start"},kvKey:{width:110,color:night.color.textSecondary,fontSize:night.font.caption,paddingTop:1},kvValue:{flex:1,color:night.color.text,fontSize:night.font.caption,lineHeight:17},thumb:{width:40,height:40,borderRadius:8,backgroundColor:night.color.fill},rowAction:{color:night.color.accent,fontSize:night.font.caption,fontWeight:"600"},diffRow:{paddingHorizontal:12,paddingVertical:8,gap:3},diffPath:{color:night.color.textSecondary,fontSize:night.font.micro,fontWeight:"600",letterSpacing:.3},diffLine:{flexDirection:"row",gap:8,alignItems:"flex-start"},diffMark:{fontFamily:"Menlo",fontSize:12,width:10},diffValue:{flex:1,fontFamily:"Menlo",fontSize:12,lineHeight:16},chart:{paddingHorizontal:12,paddingVertical:10,gap:8},barRow:{flexDirection:"row",alignItems:"center",gap:8},barLabel:{width:96,color:night.color.textSecondary,fontSize:night.font.caption},barTrack:{flex:1,height:10,borderRadius:5,backgroundColor:night.color.fill,overflow:"hidden"},bar:{height:10,borderRadius:5},barValue:{width:72,textAlign:"right",color:night.color.text,fontSize:night.font.caption,fontWeight:"600"},step:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:9},stepMark:{width:20,height:20,borderRadius:10,backgroundColor:night.color.fillTertiary,alignItems:"center",justifyContent:"center"},stepDone:{backgroundColor:night.color.accent},stepFailed:{backgroundColor:night.color.danger},stepNum:{color:night.color.text,fontSize:night.font.micro,fontWeight:"700"},stepTextDone:{color:night.color.textSecondary},code:{paddingHorizontal:12,paddingVertical:10,lineHeight:17},noticeRow:{flexDirection:"row",alignItems:"flex-start",gap:8,paddingHorizontal:12,paddingTop:10,paddingBottom:4},noticeText:{flex:1,color:night.color.text,fontSize:night.font.caption,lineHeight:18}});
1
+ "use strict";
2
+
3
+ /**
4
+ * Show blocks — data the user should see rather than read.
5
+ * Every one honours a cap and says "+N more" rather than growing the page.
6
+ */
7
+ import { useState } from "react";
8
+ import { Image, Pressable, StyleSheet, Text, View } from "react-native";
9
+ import { AlertTriangle, Check, Info, night, X } from "@buoy-gg/shared-ui";
10
+ import { DataViewer, TreeDiffViewer } from "@buoy-gg/shared-ui/dataViewer";
11
+ import { CAPS } from "@buoy-gg/agent-core";
12
+ import { ActionRow, blockStyles as b, Card, More, toneColor, useBlockHandlers, usePaged } from "./primitivesIndex";
13
+ import { renderInline } from "../components/Markdown";
14
+ import { useCopyAction } from "../components/useCopyAction";
15
+ import { blockToText } from "./blockText";
16
+ import { BlockIcon } from "./icons";
17
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ function fmt(v) {
19
+ if (v === undefined) return "—";
20
+ if (v === null) return "null";
21
+ if (typeof v === "string") return v;
22
+ if (typeof v === "number" || typeof v === "boolean") return String(v);
23
+ try {
24
+ const s = JSON.stringify(v);
25
+ return s.length > 120 ? `${s.slice(0, 117)}…` : s;
26
+ } catch {
27
+ return String(v);
28
+ }
29
+ }
30
+ export function Table({
31
+ block
32
+ }) {
33
+ const paged = usePaged(block.rows, CAPS.tableRows);
34
+ const {
35
+ visible
36
+ } = paged;
37
+ const cols = block.columns.slice(0, 4);
38
+ return /*#__PURE__*/_jsxs(Card, {
39
+ title: block.title,
40
+ source: block.source,
41
+ testID: `buoy-block-table-${block.id}`,
42
+ children: [/*#__PURE__*/_jsx(View, {
43
+ style: styles.tableHead,
44
+ children: cols.map((c, i) => /*#__PURE__*/_jsx(Text, {
45
+ style: [styles.th, i === 0 && styles.firstCol],
46
+ numberOfLines: 1,
47
+ children: c
48
+ }, c))
49
+ }), visible.map((row, r) => /*#__PURE__*/_jsx(View, {
50
+ style: [styles.tr, r > 0 && b.rowDivider],
51
+ children: cols.map((_, i) => {
52
+ const cell = row[i];
53
+ const text = typeof cell === "string" ? cell : cell?.text ?? "";
54
+ const tone = typeof cell === "string" ? undefined : cell?.tone;
55
+ return /*#__PURE__*/_jsx(Text, {
56
+ style: [styles.td, i === 0 && styles.firstCol, i === 0 && styles.tdFirst, tone && {
57
+ color: toneColor(tone)
58
+ }],
59
+ numberOfLines: 2,
60
+ children: renderInline(text, styles.td)
61
+ }, i);
62
+ })
63
+ }, r)), /*#__PURE__*/_jsx(More, {
64
+ paged: paged
65
+ })]
66
+ });
67
+ }
68
+ export function KeyValue({
69
+ block
70
+ }) {
71
+ const paged = usePaged(block.pairs, CAPS.keyValuePairs);
72
+ const {
73
+ visible
74
+ } = paged;
75
+ const [open, setOpen] = useState(null);
76
+ return /*#__PURE__*/_jsxs(Card, {
77
+ title: block.title,
78
+ source: block.source,
79
+ testID: `buoy-block-keyvalue-${block.id}`,
80
+ children: [visible.map((p, i) => {
81
+ const long = typeof p.value === "object" && p.value !== null;
82
+ const isOpen = open === p.key;
83
+ return /*#__PURE__*/_jsxs(Pressable, {
84
+ onPress: long ? () => setOpen(isOpen ? null : p.key) : undefined,
85
+ style: [styles.kvRow, i > 0 && b.rowDivider],
86
+ children: [/*#__PURE__*/_jsx(Text, {
87
+ style: styles.kvKey,
88
+ numberOfLines: 1,
89
+ children: p.key
90
+ }), /*#__PURE__*/_jsx(Text, {
91
+ style: [styles.kvValue, isOpen && b.mono],
92
+ numberOfLines: isOpen ? undefined : 2,
93
+ selectable: true,
94
+ children: isOpen ? JSON.stringify(p.value, null, 2) : fmt(p.value)
95
+ })]
96
+ }, p.key);
97
+ }), /*#__PURE__*/_jsx(More, {
98
+ paged: paged
99
+ })]
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Keys carry the index as well as the id.
105
+ *
106
+ * The ids in here come from the app's own data, and app data is not required
107
+ * to be unique — a Poké Mart bag in this repo holds two lines sharing one
108
+ * `lineId`, which is a bug in that app but must not be one in a devtool
109
+ * rendering it. Paging made it visible: the duplicate sat past the initial cap,
110
+ * so React only saw the collision on the first "Show more".
111
+ */
112
+ /**
113
+ * What a tapped list row does.
114
+ *
115
+ * A row can carry a picture and an action, and they want the same gesture. The
116
+ * picture wins the row body — looking at a thing must not fire it — and the
117
+ * action keeps its label as its own control. A row with no picture is
118
+ * unchanged: the whole row runs the action, which is what it did before rows
119
+ * could open.
120
+ */
121
+ export function listRowBehaviour(item) {
122
+ const canExpand = Boolean(item.image);
123
+ return {
124
+ canExpand,
125
+ rowRunsAction: Boolean(item.action) && !canExpand,
126
+ actionIsOwnControl: Boolean(item.action) && canExpand
127
+ };
128
+ }
129
+ export function List({
130
+ block
131
+ }) {
132
+ const h = useBlockHandlers();
133
+ const paged = usePaged(block.items, CAPS.listItems);
134
+ const {
135
+ visible
136
+ } = paged;
137
+ // One row open at a time, keyed the same way the row is — the list can hold
138
+ // duplicate ids (see the note above), so the index is part of the key.
139
+ const [open, setOpen] = useState(null);
140
+ return /*#__PURE__*/_jsxs(Card, {
141
+ title: block.title,
142
+ source: block.source,
143
+ testID: `buoy-block-list-${block.id}`,
144
+ children: [visible.map((it, i) => {
145
+ const key = `${it.id ?? it.title}-${i}`;
146
+ const expanded = open === key;
147
+ // A row with a picture opens it; a row without one keeps the old
148
+ // behaviour, where the whole row runs its action. When an item has
149
+ // BOTH, the body toggles the image and the action label becomes its
150
+ // own control — otherwise the two gestures would sit on one target and
151
+ // looking at a thing would fire it.
152
+ const {
153
+ canExpand,
154
+ rowRunsAction,
155
+ actionIsOwnControl
156
+ } = listRowBehaviour(it);
157
+ const Row = canExpand || rowRunsAction ? Pressable : View;
158
+ const rowProps = canExpand ? {
159
+ onPress: () => setOpen(expanded ? null : key),
160
+ accessibilityRole: "button",
161
+ accessibilityState: {
162
+ expanded
163
+ },
164
+ accessibilityLabel: `${it.title}, ${expanded ? "hide" : "show"} picture`,
165
+ testID: `buoy-block-list-row-${key}`
166
+ } : rowRunsAction ? {
167
+ onPress: () => void h.runAction(it.action, block.id),
168
+ accessibilityRole: "button"
169
+ } : {};
170
+ return /*#__PURE__*/_jsxs(View, {
171
+ style: i > 0 ? b.rowDivider : undefined,
172
+ children: [expanded && it.image ? /*#__PURE__*/_jsx(Pressable, {
173
+ onPress: () => setOpen(null),
174
+ accessibilityRole: "button",
175
+ accessibilityLabel: `Hide ${it.title}`,
176
+ testID: `buoy-block-list-hero-${key}`,
177
+ style: styles.listHero,
178
+ children: /*#__PURE__*/_jsx(Image, {
179
+ source: {
180
+ uri: it.image
181
+ },
182
+ style: styles.listHeroImage,
183
+ resizeMode: "contain",
184
+ accessibilityLabel: it.title
185
+ })
186
+ }) : null, /*#__PURE__*/_jsxs(Row, {
187
+ ...rowProps,
188
+ style: b.row,
189
+ children: [it.image && !expanded ? /*#__PURE__*/_jsx(Image, {
190
+ source: {
191
+ uri: it.image
192
+ },
193
+ style: styles.thumb,
194
+ resizeMode: "contain",
195
+ accessibilityLabel: it.title
196
+ }) : it.icon ? /*#__PURE__*/_jsx(BlockIcon, {
197
+ name: it.icon
198
+ }) : null, /*#__PURE__*/_jsxs(View, {
199
+ style: styles.flex,
200
+ children: [/*#__PURE__*/_jsx(Text, {
201
+ style: [b.rowTitle, it.tone && {
202
+ color: toneColor(it.tone)
203
+ }],
204
+ numberOfLines: expanded ? undefined : 2,
205
+ children: renderInline(it.title, b.rowTitle)
206
+ }), it.subtitle ? /*#__PURE__*/_jsx(Text, {
207
+ style: b.rowSub,
208
+ numberOfLines: expanded ? undefined : 2,
209
+ children: renderInline(it.subtitle, b.rowSub)
210
+ }) : null]
211
+ }), it.trailing ? /*#__PURE__*/_jsx(Text, {
212
+ style: [b.rowTrailing, it.tone && {
213
+ color: toneColor(it.tone)
214
+ }],
215
+ numberOfLines: 1,
216
+ children: it.trailing
217
+ }) : null, it.action ? actionIsOwnControl ? /*#__PURE__*/_jsx(Pressable, {
218
+ onPress: () => void h.runAction(it.action, block.id),
219
+ accessibilityRole: "button",
220
+ accessibilityLabel: it.action.label,
221
+ hitSlop: 8,
222
+ children: /*#__PURE__*/_jsx(Text, {
223
+ style: styles.rowAction,
224
+ children: it.action.label
225
+ })
226
+ }) : /*#__PURE__*/_jsx(Text, {
227
+ style: styles.rowAction,
228
+ children: it.action.label
229
+ }) : null]
230
+ })]
231
+ }, key);
232
+ }), /*#__PURE__*/_jsx(More, {
233
+ paged: paged
234
+ })]
235
+ });
236
+ }
237
+
238
+ /** An object or an array — something the tree viewer can drill into. */
239
+ function isStructured(v) {
240
+ return v !== null && typeof v === "object";
241
+ }
242
+
243
+ /**
244
+ * The line that stands in for a folded diff: how many fields, and which.
245
+ * Names beat a bare count — "1 field · lines" tells you whether to open it.
246
+ */
247
+ function diffSummary(changes) {
248
+ const names = changes.map(c => c.path);
249
+ const shown = names.slice(0, 3).join(", ");
250
+ const rest = names.length - 3;
251
+ const noun = names.length === 1 ? "1 field" : `${names.length} fields`;
252
+ return `${noun} · ${shown}${rest > 0 ? `, +${rest}` : ""}`;
253
+ }
254
+
255
+ /**
256
+ * What a write changed. Folded by default (see `Card`), and drilled into
257
+ * rather than dumped.
258
+ *
259
+ * A changed field is rendered by the same tree diff viewer the Zustand and
260
+ * Storage tools use, with unchanged branches hidden — so editing one line of a
261
+ * bag shows `qty 4 => 14` and not both copies of a fifty-key array serialised
262
+ * to JSON, which is what the reader was given before and could not read. Only
263
+ * a scalar keeps the plain −/+ pair: a tree of one root node says less than
264
+ * the two values side by side.
265
+ */
266
+ export function Diff({
267
+ block
268
+ }) {
269
+ const paged = usePaged(block.changes, CAPS.keyValuePairs);
270
+ return /*#__PURE__*/_jsxs(Card, {
271
+ title: block.title ?? "What changed",
272
+ source: block.source,
273
+ testID: `buoy-block-diff-${block.id}`,
274
+ collapsible: true,
275
+ summary: diffSummary(block.changes),
276
+ children: [paged.visible.map((c, i) => {
277
+ const added = c.before === undefined && c.after !== undefined;
278
+ const removed = c.after === undefined && c.before !== undefined;
279
+ return /*#__PURE__*/_jsxs(View, {
280
+ style: [styles.diffRow, i > 0 && b.rowDivider],
281
+ children: [/*#__PURE__*/_jsx(Text, {
282
+ style: styles.diffPath,
283
+ numberOfLines: 1,
284
+ children: c.path
285
+ }), isStructured(c.before) || isStructured(c.after) ? /*#__PURE__*/_jsx(View, {
286
+ style: styles.diffTree,
287
+ children: /*#__PURE__*/_jsx(TreeDiffViewer, {
288
+ oldValue: c.before,
289
+ newValue: c.after,
290
+ showUnchanged: false,
291
+ scrollEnabled: false
292
+ })
293
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
294
+ children: [!added ? /*#__PURE__*/_jsxs(View, {
295
+ style: styles.diffLine,
296
+ children: [/*#__PURE__*/_jsx(Text, {
297
+ style: [styles.diffMark, {
298
+ color: night.color.danger
299
+ }],
300
+ children: "\u2212"
301
+ }), /*#__PURE__*/_jsx(Text, {
302
+ style: [styles.diffValue, {
303
+ color: night.color.danger
304
+ }],
305
+ numberOfLines: 3,
306
+ selectable: true,
307
+ children: fmt(c.before)
308
+ })]
309
+ }) : null, !removed ? /*#__PURE__*/_jsxs(View, {
310
+ style: styles.diffLine,
311
+ children: [/*#__PURE__*/_jsx(Text, {
312
+ style: [styles.diffMark, {
313
+ color: night.color.accent
314
+ }],
315
+ children: "+"
316
+ }), /*#__PURE__*/_jsx(Text, {
317
+ style: [styles.diffValue, {
318
+ color: night.color.accent
319
+ }],
320
+ numberOfLines: 3,
321
+ selectable: true,
322
+ children: fmt(c.after)
323
+ })]
324
+ }) : null]
325
+ })]
326
+ }, `${c.path}-${i}`);
327
+ }), /*#__PURE__*/_jsx(More, {
328
+ paged: paged
329
+ })]
330
+ });
331
+ }
332
+ export function Chart({
333
+ block
334
+ }) {
335
+ const bars = block.bars.slice(0, CAPS.chartBars);
336
+ const max = block.max ?? Math.max(1, ...bars.map(x => x.value));
337
+ return /*#__PURE__*/_jsx(Card, {
338
+ title: block.title,
339
+ source: block.source,
340
+ testID: `buoy-block-chart-${block.id}`,
341
+ children: /*#__PURE__*/_jsx(View, {
342
+ style: styles.chart,
343
+ children: bars.map((x, i) => /*#__PURE__*/_jsxs(View, {
344
+ style: styles.barRow,
345
+ children: [/*#__PURE__*/_jsx(Text, {
346
+ style: styles.barLabel,
347
+ numberOfLines: 1,
348
+ children: x.label
349
+ }), /*#__PURE__*/_jsx(View, {
350
+ style: styles.barTrack,
351
+ children: /*#__PURE__*/_jsx(View, {
352
+ style: [styles.bar, {
353
+ width: `${Math.max(2, Math.round(x.value / max * 100))}%`,
354
+ backgroundColor: toneColor(x.tone ?? "accent")
355
+ }]
356
+ })
357
+ }), /*#__PURE__*/_jsxs(Text, {
358
+ style: styles.barValue,
359
+ numberOfLines: 1,
360
+ children: [x.value, x.unit ? ` ${x.unit}` : ""]
361
+ })]
362
+ }, `${x.label}-${i}`))
363
+ })
364
+ });
365
+ }
366
+ export function Steps({
367
+ block
368
+ }) {
369
+ return /*#__PURE__*/_jsx(Card, {
370
+ title: block.title,
371
+ testID: `buoy-block-steps-${block.id}`,
372
+ children: block.steps.map((s, i) => /*#__PURE__*/_jsxs(View, {
373
+ style: [styles.step, i > 0 && b.rowDivider],
374
+ children: [/*#__PURE__*/_jsx(View, {
375
+ style: [styles.stepMark, s.state === "done" && styles.stepDone, s.state === "failed" && styles.stepFailed],
376
+ children: s.state === "done" ? /*#__PURE__*/_jsx(Check, {
377
+ size: 10,
378
+ color: night.color.onAccent
379
+ }) : s.state === "failed" ? /*#__PURE__*/_jsx(X, {
380
+ size: 10,
381
+ color: night.color.text
382
+ }) : /*#__PURE__*/_jsx(Text, {
383
+ style: styles.stepNum,
384
+ children: i + 1
385
+ })
386
+ }), /*#__PURE__*/_jsx(Text, {
387
+ style: [b.rowTitle, s.state === "done" && styles.stepTextDone],
388
+ children: s.text
389
+ })]
390
+ }, i))
391
+ });
392
+ }
393
+
394
+ /**
395
+ * Parsed JSON, or `undefined` when the payload is not JSON at all.
396
+ *
397
+ * A bare string, number or boolean parses fine and is deliberately rejected:
398
+ * `"hello"` is valid JSON and a tree of one leaf is a worse way to read it
399
+ * than the line itself.
400
+ */
401
+ function parseJson(text) {
402
+ try {
403
+ const value = JSON.parse(text);
404
+ return value !== null && typeof value === "object" ? value : undefined;
405
+ } catch {
406
+ return undefined;
407
+ }
408
+ }
409
+
410
+ /**
411
+ * A JSON payload, in the same explorer Storage and Network use.
412
+ *
413
+ * Worth the weight over a pretty-printed string: it collapses, it types its
414
+ * values, and the thing you are usually hunting — one wrong field deep in a
415
+ * response body — is findable instead of buried in forty lines of monospace.
416
+ * The explorer's own lists run `scrollEnabled={false}` and grow to their
417
+ * content, so nothing nests a scroller inside the transcript.
418
+ */
419
+ function JsonCode({
420
+ block,
421
+ value
422
+ }) {
423
+ return /*#__PURE__*/_jsx(Card, {
424
+ title: block.title,
425
+ testID: `buoy-block-code-${block.id}`,
426
+ children: /*#__PURE__*/_jsx(View, {
427
+ style: styles.viewer,
428
+ children: /*#__PURE__*/_jsx(DataViewer, {
429
+ title: block.title ?? "Payload",
430
+ data: value,
431
+ initialExpanded: true,
432
+ showTypeFilter: false,
433
+ testIDPrefix: `buoy-block-code-${block.id}`
434
+ })
435
+ })
436
+ });
437
+ }
438
+
439
+ /** Anything that is not a JSON object: a log line, a stack, a snippet. */
440
+ function TextCode({
441
+ block
442
+ }) {
443
+ return /*#__PURE__*/_jsx(Card, {
444
+ title: block.title,
445
+ testID: `buoy-block-code-${block.id}`,
446
+ children: /*#__PURE__*/_jsx(Text, {
447
+ style: [b.mono, styles.code],
448
+ selectable: true,
449
+ children: block.text
450
+ })
451
+ });
452
+ }
453
+
454
+ /**
455
+ * Router, per rule4: two specialised components rather than one that changes
456
+ * shape. A `cond ? <A/> : <B/>` inside a single component is the Fabric
457
+ * view-index hazard, and these two subtrees have nothing in common.
458
+ */
459
+ export function Code({
460
+ block
461
+ }) {
462
+ const value = parseJson(block.text);
463
+ if (value === undefined) return /*#__PURE__*/_jsx(TextCode, {
464
+ block: block
465
+ });
466
+ return /*#__PURE__*/_jsx(JsonCode, {
467
+ block: block,
468
+ value: value
469
+ });
470
+ }
471
+ export function Notice({
472
+ block
473
+ }) {
474
+ const color = block.tone === "danger" ? night.color.danger : block.tone === "warning" ? night.color.warning : night.color.info;
475
+ const Icon = block.tone === "info" ? Info : AlertTriangle;
476
+ return /*#__PURE__*/_jsxs(Card, {
477
+ tone: block.tone,
478
+ testID: `buoy-block-notice-${block.id}`,
479
+ children: [/*#__PURE__*/_jsxs(View, {
480
+ style: styles.noticeRow,
481
+ children: [/*#__PURE__*/_jsx(Icon, {
482
+ size: 14,
483
+ color: color
484
+ }), /*#__PURE__*/_jsx(Text, {
485
+ style: styles.noticeText,
486
+ children: block.text
487
+ })]
488
+ }), /*#__PURE__*/_jsx(ActionRow, {
489
+ actions: block.actions,
490
+ blockId: block.id
491
+ })]
492
+ });
493
+ }
494
+ export function Finding({
495
+ block
496
+ }) {
497
+ // A finding exists to leave the phone. Its own Copy, with the title and
498
+ // every evidence row — the conversation-wide Copy includes it too, but a
499
+ // ticket wants just this.
500
+ const {
501
+ copied,
502
+ copy
503
+ } = useCopyAction(() => blockToText(block) ?? block.title);
504
+ return /*#__PURE__*/_jsxs(Card, {
505
+ title: block.title,
506
+ source: block.source,
507
+ testID: `buoy-block-finding-${block.id}`,
508
+ tone: "warning",
509
+ children: [block.evidence.map((e, i) => /*#__PURE__*/_jsxs(View, {
510
+ style: [styles.kvRow, i > 0 && b.rowDivider],
511
+ children: [/*#__PURE__*/_jsx(Text, {
512
+ style: styles.kvKey,
513
+ numberOfLines: 1,
514
+ children: e.label
515
+ }), /*#__PURE__*/_jsx(Text, {
516
+ style: [styles.kvValue, e.tone && {
517
+ color: toneColor(e.tone)
518
+ }],
519
+ selectable: true,
520
+ children: e.value
521
+ })]
522
+ }, `${e.label}-${i}`)), /*#__PURE__*/_jsx(View, {
523
+ style: styles.findingFoot,
524
+ children: /*#__PURE__*/_jsx(Pressable, {
525
+ testID: `buoy-block-finding-copy-${block.id}`,
526
+ accessibilityRole: "button",
527
+ accessibilityLabel: copied ? "Copied" : "Copy this finding",
528
+ onPress: copy,
529
+ style: ({
530
+ pressed
531
+ }) => [styles.findingCopy, pressed && {
532
+ opacity: 0.7
533
+ }],
534
+ children: /*#__PURE__*/_jsx(Text, {
535
+ style: [styles.findingCopyText, copied && {
536
+ color: night.color.accent
537
+ }],
538
+ children: copied ? "Copied" : "Copy finding"
539
+ })
540
+ })
541
+ }), /*#__PURE__*/_jsx(ActionRow, {
542
+ actions: block.actions,
543
+ blockId: block.id
544
+ })]
545
+ });
546
+ }
547
+ const styles = StyleSheet.create({
548
+ flex: {
549
+ flex: 1
550
+ },
551
+ tableHead: {
552
+ flexDirection: "row",
553
+ paddingHorizontal: 12,
554
+ paddingVertical: 6,
555
+ gap: 8,
556
+ backgroundColor: night.color.fill
557
+ },
558
+ th: {
559
+ flex: 1,
560
+ color: night.color.textTertiary,
561
+ fontSize: night.font.micro,
562
+ fontWeight: "700",
563
+ letterSpacing: 0.6,
564
+ textTransform: "uppercase"
565
+ },
566
+ tr: {
567
+ flexDirection: "row",
568
+ paddingHorizontal: 12,
569
+ paddingVertical: 8,
570
+ gap: 8,
571
+ alignItems: "center"
572
+ },
573
+ td: {
574
+ flex: 1,
575
+ color: night.color.textSecondary,
576
+ fontSize: night.font.caption,
577
+ lineHeight: 17
578
+ },
579
+ tdFirst: {
580
+ color: night.color.text,
581
+ fontWeight: "500"
582
+ },
583
+ firstCol: {
584
+ flex: 1.4
585
+ },
586
+ kvRow: {
587
+ flexDirection: "row",
588
+ gap: 12,
589
+ paddingHorizontal: 12,
590
+ paddingVertical: 8,
591
+ alignItems: "flex-start"
592
+ },
593
+ kvKey: {
594
+ width: 110,
595
+ color: night.color.textSecondary,
596
+ fontSize: night.font.caption,
597
+ paddingTop: 1
598
+ },
599
+ kvValue: {
600
+ flex: 1,
601
+ color: night.color.text,
602
+ fontSize: night.font.caption,
603
+ lineHeight: 17
604
+ },
605
+ findingFoot: {
606
+ flexDirection: "row",
607
+ paddingHorizontal: 12,
608
+ paddingVertical: 8,
609
+ borderTopWidth: StyleSheet.hairlineWidth,
610
+ borderTopColor: night.color.separator
611
+ },
612
+ findingCopy: {
613
+ paddingHorizontal: 10,
614
+ paddingVertical: 5,
615
+ borderRadius: night.radius.badge,
616
+ backgroundColor: night.color.fill
617
+ },
618
+ findingCopyText: {
619
+ color: night.color.textSecondary,
620
+ fontSize: night.font.micro,
621
+ fontWeight: "600"
622
+ },
623
+ thumb: {
624
+ width: 40,
625
+ height: 40,
626
+ borderRadius: 8,
627
+ backgroundColor: night.color.fill
628
+ },
629
+ // The enlarged picture, sitting above the row it belongs to. Same height and
630
+ // fitting as `imageGrid`'s hero so the two blocks enlarge alike.
631
+ listHero: {
632
+ paddingHorizontal: 12,
633
+ paddingTop: 12
634
+ },
635
+ listHeroImage: {
636
+ width: "100%",
637
+ height: 240,
638
+ borderRadius: night.radius.row,
639
+ backgroundColor: night.color.fill
640
+ },
641
+ rowAction: {
642
+ color: night.color.accent,
643
+ fontSize: night.font.caption,
644
+ fontWeight: "600"
645
+ },
646
+ diffRow: {
647
+ paddingHorizontal: 12,
648
+ paddingVertical: 8,
649
+ gap: 3
650
+ },
651
+ diffPath: {
652
+ color: night.color.textSecondary,
653
+ fontSize: night.font.micro,
654
+ fontWeight: "600",
655
+ letterSpacing: 0.3
656
+ },
657
+ diffLine: {
658
+ flexDirection: "row",
659
+ gap: 8,
660
+ alignItems: "flex-start"
661
+ },
662
+ diffMark: {
663
+ fontFamily: "Menlo",
664
+ fontSize: 12,
665
+ width: 10
666
+ },
667
+ diffValue: {
668
+ flex: 1,
669
+ fontFamily: "Menlo",
670
+ fontSize: 12,
671
+ lineHeight: 16
672
+ },
673
+ // The tree viewer paints its own ground; round it so it reads as a well
674
+ // inside the card rather than a second card butted against the first.
675
+ diffTree: {
676
+ borderRadius: night.radius.row,
677
+ overflow: "hidden"
678
+ },
679
+ chart: {
680
+ paddingHorizontal: 12,
681
+ paddingVertical: 10,
682
+ gap: 8
683
+ },
684
+ barRow: {
685
+ flexDirection: "row",
686
+ alignItems: "center",
687
+ gap: 8
688
+ },
689
+ barLabel: {
690
+ width: 96,
691
+ color: night.color.textSecondary,
692
+ fontSize: night.font.caption
693
+ },
694
+ barTrack: {
695
+ flex: 1,
696
+ height: 10,
697
+ borderRadius: 5,
698
+ backgroundColor: night.color.fill,
699
+ overflow: "hidden"
700
+ },
701
+ bar: {
702
+ height: 10,
703
+ borderRadius: 5
704
+ },
705
+ barValue: {
706
+ width: 72,
707
+ textAlign: "right",
708
+ color: night.color.text,
709
+ fontSize: night.font.caption,
710
+ fontWeight: "600"
711
+ },
712
+ step: {
713
+ flexDirection: "row",
714
+ alignItems: "center",
715
+ gap: 10,
716
+ paddingHorizontal: 12,
717
+ paddingVertical: 9
718
+ },
719
+ stepMark: {
720
+ width: 20,
721
+ height: 20,
722
+ borderRadius: 10,
723
+ backgroundColor: night.color.fillTertiary,
724
+ alignItems: "center",
725
+ justifyContent: "center"
726
+ },
727
+ stepDone: {
728
+ backgroundColor: night.color.accent
729
+ },
730
+ stepFailed: {
731
+ backgroundColor: night.color.danger
732
+ },
733
+ stepNum: {
734
+ color: night.color.text,
735
+ fontSize: night.font.micro,
736
+ fontWeight: "700"
737
+ },
738
+ stepTextDone: {
739
+ color: night.color.textSecondary
740
+ },
741
+ // The explorer draws its own rows; this is only the inset that keeps them
742
+ // off the card's edge, matching every other block's 12pt gutter.
743
+ viewer: {
744
+ paddingHorizontal: 4,
745
+ paddingBottom: 8
746
+ },
747
+ code: {
748
+ paddingHorizontal: 12,
749
+ paddingVertical: 10,
750
+ lineHeight: 17
751
+ },
752
+ noticeRow: {
753
+ flexDirection: "row",
754
+ alignItems: "flex-start",
755
+ gap: 8,
756
+ paddingHorizontal: 12,
757
+ paddingTop: 10,
758
+ paddingBottom: 4
759
+ },
760
+ noticeText: {
761
+ flex: 1,
762
+ color: night.color.text,
763
+ fontSize: night.font.caption,
764
+ lineHeight: 18
765
+ }
766
+ });
767
+ //# sourceMappingURL=DataBlocks.js.map