@buoy-gg/ask-buoy 7.0.36 → 7.0.38

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 (312) hide show
  1. package/README.md +58 -27
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -262
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -781
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1860
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -156
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -586
  9. package/lib/commonjs/blocks/blockText.js +1 -60
  10. package/lib/commonjs/blocks/blockText.test.js +1 -53
  11. package/lib/commonjs/blocks/context.js +1 -42
  12. package/lib/commonjs/blocks/icons.js +1 -96
  13. package/lib/commonjs/blocks/index.js +1 -95
  14. package/lib/commonjs/blocks/listRow.test.js +1 -55
  15. package/lib/commonjs/blocks/pageState.js +1 -34
  16. package/lib/commonjs/blocks/pageState.test.js +1 -57
  17. package/lib/commonjs/blocks/primitives.js +1 -457
  18. package/lib/commonjs/blocks/primitivesIndex.js +1 -62
  19. package/lib/commonjs/components/ApprovalCard.js +1 -244
  20. package/lib/commonjs/components/AskBuoyHeader.js +1 -196
  21. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  22. package/lib/commonjs/components/AskBuoyModal.js +1 -479
  23. package/lib/commonjs/components/AskBuoySettings.js +1 -119
  24. package/lib/commonjs/components/ChangesBar.js +1 -211
  25. package/lib/commonjs/components/Composer.js +1 -255
  26. package/lib/commonjs/components/EmptyState.js +1 -161
  27. package/lib/commonjs/components/KeyboardPad.js +1 -80
  28. package/lib/commonjs/components/Markdown.js +1 -310
  29. package/lib/commonjs/components/MessageList.js +1 -930
  30. package/lib/commonjs/components/QueuedMessages.js +1 -145
  31. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  32. package/lib/commonjs/components/TypingDots.js +1 -63
  33. package/lib/commonjs/components/markdownParse.js +1 -131
  34. package/lib/commonjs/components/markdownParse.test.js +1 -99
  35. package/lib/commonjs/components/useCopyAction.js +1 -50
  36. package/lib/commonjs/index.js +1 -252
  37. package/lib/commonjs/preset.js +1 -90
  38. package/lib/commonjs/store/activityGroups.js +1 -110
  39. package/lib/commonjs/store/activityGroups.test.js +1 -78
  40. package/lib/commonjs/store/askBuoySettings.js +1 -72
  41. package/lib/commonjs/store/askBuoyStore.js +1 -547
  42. package/lib/commonjs/store/blockPlacement.js +1 -64
  43. package/lib/commonjs/store/blockPlacement.test.js +1 -123
  44. package/lib/commonjs/store/queue.test.js +1 -150
  45. package/lib/commonjs/store/resetConversation.js +1 -77
  46. package/lib/commonjs/store/restorePending.test.js +1 -63
  47. package/lib/commonjs/store/restoredIds.test.js +1 -47
  48. package/lib/commonjs/store/suggestions.js +1 -54
  49. package/lib/commonjs/store/suggestions.test.js +1 -58
  50. package/lib/commonjs/store/systemLine.test.js +1 -77
  51. package/lib/commonjs/store/ticketPrompt.js +1 -17
  52. package/lib/commonjs/store/traceText.js +1 -81
  53. package/lib/commonjs/store/traceText.test.js +1 -112
  54. package/lib/commonjs/store/transcriptPersistence.js +1 -297
  55. package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
  56. package/lib/commonjs/store/turnRendering.test.js +1 -151
  57. package/lib/commonjs/store/useAskBuoy.js +1 -622
  58. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  59. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -140
  60. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  61. package/lib/commonjs/sync/wire.js +1 -58
  62. package/lib/commonjs/types.js +1 -6
  63. package/lib/module/blocks/AskBlocks.js +1 -331
  64. package/lib/module/blocks/BlockRenderer.js +1 -257
  65. package/lib/module/blocks/ChromePrototypes.js +1 -503
  66. package/lib/module/blocks/DataBlocks.js +1 -767
  67. package/lib/module/blocks/ExtraBlocks.js +1 -1833
  68. package/lib/module/blocks/MediaBlocks.js +1 -151
  69. package/lib/module/blocks/ReceiptBlocks.js +1 -574
  70. package/lib/module/blocks/blockText.js +1 -55
  71. package/lib/module/blocks/blockText.test.js +1 -53
  72. package/lib/module/blocks/context.js +1 -35
  73. package/lib/module/blocks/icons.js +1 -91
  74. package/lib/module/blocks/index.js +1 -8
  75. package/lib/module/blocks/listRow.test.js +1 -56
  76. package/lib/module/blocks/pageState.js +1 -30
  77. package/lib/module/blocks/pageState.test.js +1 -56
  78. package/lib/module/blocks/primitives.js +1 -445
  79. package/lib/module/blocks/primitivesIndex.js +1 -5
  80. package/lib/module/components/ApprovalCard.js +1 -239
  81. package/lib/module/components/AskBuoyHeader.js +1 -193
  82. package/lib/module/components/AskBuoyIcon.js +1 -8
  83. package/lib/module/components/AskBuoyModal.js +1 -474
  84. package/lib/module/components/AskBuoySettings.js +1 -114
  85. package/lib/module/components/ChangesBar.js +1 -206
  86. package/lib/module/components/Composer.js +1 -250
  87. package/lib/module/components/EmptyState.js +1 -156
  88. package/lib/module/components/KeyboardPad.js +1 -75
  89. package/lib/module/components/Markdown.js +1 -305
  90. package/lib/module/components/MessageList.js +1 -924
  91. package/lib/module/components/QueuedMessages.js +1 -140
  92. package/lib/module/components/ThinkingStrip.js +1 -218
  93. package/lib/module/components/TypingDots.js +1 -58
  94. package/lib/module/components/markdownParse.js +1 -125
  95. package/lib/module/components/markdownParse.test.js +1 -98
  96. package/lib/module/components/useCopyAction.js +1 -46
  97. package/lib/module/index.js +1 -34
  98. package/lib/module/preset.js +1 -73
  99. package/lib/module/store/activityGroups.js +1 -103
  100. package/lib/module/store/activityGroups.test.js +1 -77
  101. package/lib/module/store/askBuoySettings.js +1 -67
  102. package/lib/module/store/askBuoyStore.js +1 -541
  103. package/lib/module/store/blockPlacement.js +1 -59
  104. package/lib/module/store/blockPlacement.test.js +1 -122
  105. package/lib/module/store/queue.test.js +1 -149
  106. package/lib/module/store/resetConversation.js +1 -72
  107. package/lib/module/store/restorePending.test.js +1 -62
  108. package/lib/module/store/restoredIds.test.js +1 -46
  109. package/lib/module/store/suggestions.js +1 -49
  110. package/lib/module/store/suggestions.test.js +1 -57
  111. package/lib/module/store/systemLine.test.js +1 -76
  112. package/lib/module/store/ticketPrompt.js +1 -13
  113. package/lib/module/store/traceText.js +1 -75
  114. package/lib/module/store/traceText.test.js +1 -111
  115. package/lib/module/store/transcriptPersistence.js +1 -287
  116. package/lib/module/store/transcriptPersistence.test.js +1 -332
  117. package/lib/module/store/turnRendering.test.js +1 -150
  118. package/lib/module/store/useAskBuoy.js +1 -616
  119. package/lib/module/store/useAskBuoySettings.js +1 -9
  120. package/lib/module/sync/askBuoySyncAdapter.js +1 -135
  121. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  122. package/lib/module/sync/wire.js +1 -47
  123. package/lib/module/types.js +1 -4
  124. package/lib/typescript/components/ApprovalCard.d.ts +9 -1
  125. package/lib/typescript/preset.d.ts +4 -2
  126. package/lib/typescript/store/askBuoyStore.d.ts +32 -4
  127. package/lib/typescript/store/useAskBuoy.d.ts +3 -2
  128. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +3 -0
  129. package/package.json +9 -9
  130. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  131. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  132. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  133. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  134. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  135. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  136. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  137. package/lib/commonjs/blocks/blockText.js.map +0 -1
  138. package/lib/commonjs/blocks/blockText.test.js.map +0 -1
  139. package/lib/commonjs/blocks/context.js.map +0 -1
  140. package/lib/commonjs/blocks/icons.js.map +0 -1
  141. package/lib/commonjs/blocks/index.js.map +0 -1
  142. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  143. package/lib/commonjs/blocks/pageState.js.map +0 -1
  144. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  145. package/lib/commonjs/blocks/primitives.js.map +0 -1
  146. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  147. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  148. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  149. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  150. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  151. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  152. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  153. package/lib/commonjs/components/Composer.js.map +0 -1
  154. package/lib/commonjs/components/EmptyState.js.map +0 -1
  155. package/lib/commonjs/components/KeyboardPad.js.map +0 -1
  156. package/lib/commonjs/components/Markdown.js.map +0 -1
  157. package/lib/commonjs/components/MessageList.js.map +0 -1
  158. package/lib/commonjs/components/QueuedMessages.js.map +0 -1
  159. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  160. package/lib/commonjs/components/TypingDots.js.map +0 -1
  161. package/lib/commonjs/components/markdownParse.js.map +0 -1
  162. package/lib/commonjs/components/markdownParse.test.js.map +0 -1
  163. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  164. package/lib/commonjs/index.js.map +0 -1
  165. package/lib/commonjs/preset.js.map +0 -1
  166. package/lib/commonjs/store/activityGroups.js.map +0 -1
  167. package/lib/commonjs/store/activityGroups.test.js.map +0 -1
  168. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  169. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  170. package/lib/commonjs/store/blockPlacement.js.map +0 -1
  171. package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
  172. package/lib/commonjs/store/queue.test.js.map +0 -1
  173. package/lib/commonjs/store/resetConversation.js.map +0 -1
  174. package/lib/commonjs/store/restorePending.test.js.map +0 -1
  175. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  176. package/lib/commonjs/store/suggestions.js.map +0 -1
  177. package/lib/commonjs/store/suggestions.test.js.map +0 -1
  178. package/lib/commonjs/store/systemLine.test.js.map +0 -1
  179. package/lib/commonjs/store/ticketPrompt.js.map +0 -1
  180. package/lib/commonjs/store/traceText.js.map +0 -1
  181. package/lib/commonjs/store/traceText.test.js.map +0 -1
  182. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  183. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  184. package/lib/commonjs/store/turnRendering.test.js.map +0 -1
  185. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  186. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  187. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  188. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  189. package/lib/commonjs/sync/wire.js.map +0 -1
  190. package/lib/commonjs/types.js.map +0 -1
  191. package/lib/module/blocks/AskBlocks.js.map +0 -1
  192. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  193. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  194. package/lib/module/blocks/DataBlocks.js.map +0 -1
  195. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  196. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  197. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  198. package/lib/module/blocks/blockText.js.map +0 -1
  199. package/lib/module/blocks/blockText.test.js.map +0 -1
  200. package/lib/module/blocks/context.js.map +0 -1
  201. package/lib/module/blocks/icons.js.map +0 -1
  202. package/lib/module/blocks/index.js.map +0 -1
  203. package/lib/module/blocks/listRow.test.js.map +0 -1
  204. package/lib/module/blocks/pageState.js.map +0 -1
  205. package/lib/module/blocks/pageState.test.js.map +0 -1
  206. package/lib/module/blocks/primitives.js.map +0 -1
  207. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  208. package/lib/module/components/ApprovalCard.js.map +0 -1
  209. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  210. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  211. package/lib/module/components/AskBuoyModal.js.map +0 -1
  212. package/lib/module/components/AskBuoySettings.js.map +0 -1
  213. package/lib/module/components/ChangesBar.js.map +0 -1
  214. package/lib/module/components/Composer.js.map +0 -1
  215. package/lib/module/components/EmptyState.js.map +0 -1
  216. package/lib/module/components/KeyboardPad.js.map +0 -1
  217. package/lib/module/components/Markdown.js.map +0 -1
  218. package/lib/module/components/MessageList.js.map +0 -1
  219. package/lib/module/components/QueuedMessages.js.map +0 -1
  220. package/lib/module/components/ThinkingStrip.js.map +0 -1
  221. package/lib/module/components/TypingDots.js.map +0 -1
  222. package/lib/module/components/markdownParse.js.map +0 -1
  223. package/lib/module/components/markdownParse.test.js.map +0 -1
  224. package/lib/module/components/useCopyAction.js.map +0 -1
  225. package/lib/module/index.js.map +0 -1
  226. package/lib/module/preset.js.map +0 -1
  227. package/lib/module/store/activityGroups.js.map +0 -1
  228. package/lib/module/store/activityGroups.test.js.map +0 -1
  229. package/lib/module/store/askBuoySettings.js.map +0 -1
  230. package/lib/module/store/askBuoyStore.js.map +0 -1
  231. package/lib/module/store/blockPlacement.js.map +0 -1
  232. package/lib/module/store/blockPlacement.test.js.map +0 -1
  233. package/lib/module/store/queue.test.js.map +0 -1
  234. package/lib/module/store/resetConversation.js.map +0 -1
  235. package/lib/module/store/restorePending.test.js.map +0 -1
  236. package/lib/module/store/restoredIds.test.js.map +0 -1
  237. package/lib/module/store/suggestions.js.map +0 -1
  238. package/lib/module/store/suggestions.test.js.map +0 -1
  239. package/lib/module/store/systemLine.test.js.map +0 -1
  240. package/lib/module/store/ticketPrompt.js.map +0 -1
  241. package/lib/module/store/traceText.js.map +0 -1
  242. package/lib/module/store/traceText.test.js.map +0 -1
  243. package/lib/module/store/transcriptPersistence.js.map +0 -1
  244. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  245. package/lib/module/store/turnRendering.test.js.map +0 -1
  246. package/lib/module/store/useAskBuoy.js.map +0 -1
  247. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  248. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  249. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  250. package/lib/module/sync/wire.js.map +0 -1
  251. package/lib/module/types.js.map +0 -1
  252. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  253. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  254. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  255. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  256. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  257. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  258. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  259. package/lib/typescript/blocks/blockText.d.ts.map +0 -1
  260. package/lib/typescript/blocks/blockText.test.d.ts.map +0 -1
  261. package/lib/typescript/blocks/context.d.ts.map +0 -1
  262. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  263. package/lib/typescript/blocks/index.d.ts.map +0 -1
  264. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  265. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  266. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  267. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  268. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  269. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  270. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  271. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  272. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  273. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  274. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  275. package/lib/typescript/components/Composer.d.ts.map +0 -1
  276. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  277. package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
  278. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  279. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  280. package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
  281. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  282. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  283. package/lib/typescript/components/markdownParse.d.ts.map +0 -1
  284. package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
  285. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  286. package/lib/typescript/index.d.ts.map +0 -1
  287. package/lib/typescript/preset.d.ts.map +0 -1
  288. package/lib/typescript/store/activityGroups.d.ts.map +0 -1
  289. package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
  290. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  291. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  292. package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
  293. package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
  294. package/lib/typescript/store/queue.test.d.ts.map +0 -1
  295. package/lib/typescript/store/resetConversation.d.ts.map +0 -1
  296. package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
  297. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  298. package/lib/typescript/store/suggestions.d.ts.map +0 -1
  299. package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
  300. package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
  301. package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
  302. package/lib/typescript/store/traceText.d.ts.map +0 -1
  303. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  304. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  305. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  306. package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
  307. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  308. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  309. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  310. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  311. package/lib/typescript/sync/wire.d.ts.map +0 -1
  312. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,53 +1 @@
1
- "use strict";
2
-
3
- import { describe, expect, it } from "vitest";
4
- import { blockToText, blocksToText } from "./blockText";
5
- describe("blockToText", () => {
6
- it("writes a finding as title and evidence rows", () => {
7
- expect(blockToText({
8
- id: "f1",
9
- kind: "finding",
10
- title: "Bag screen empty after /api/bag 500",
11
- evidence: [{
12
- label: "Steps",
13
- value: "Open Bag as user 4412"
14
- }, {
15
- label: "Observed",
16
- value: "empty state, no error shown",
17
- tone: "danger"
18
- }]
19
- })).toBe("Bag screen empty after /api/bag 500\nSteps: Open Bag as user 4412\nObserved: empty state, no error shown");
20
- });
21
- it("writes a table with its cut noted", () => {
22
- expect(blockToText({
23
- id: "t1",
24
- kind: "table",
25
- columns: ["Item", "Qty"],
26
- rows: [["Charizard", {
27
- text: "14"
28
- }]],
29
- total: 30
30
- })).toBe("Item | Qty\nCharizard | 14\n… 29 more rows");
31
- });
32
- it("names a card it cannot flatten instead of skipping it", () => {
33
- expect(blockToText({
34
- id: "d1",
35
- kind: "diff",
36
- title: "Bag store",
37
- before: {},
38
- after: {}
39
- })).toBe("[diff card: Bag store]");
40
- });
41
- it("drops blocks with nothing to say", () => {
42
- expect(blocksToText([{
43
- id: "p",
44
- kind: "peek"
45
- }, {
46
- id: "n",
47
- kind: "notice",
48
- tone: "info",
49
- text: "hi"
50
- }])).toEqual(["hi"]);
51
- });
52
- });
53
- //# sourceMappingURL=blockText.test.js.map
1
+ "use strict";import{describe,expect,it}from"vitest";import{blockToText,blocksToText}from"./blockText";describe("blockToText",()=>{it("writes a finding as title and evidence rows",()=>{expect(blockToText({id:"f1",kind:"finding",title:"Bag screen empty after /api/bag 500",evidence:[{label:"Steps",value:"Open Bag as user 4412"},{label:"Observed",value:"empty state, no error shown",tone:"danger"}]})).toBe("Bag screen empty after /api/bag 500\nSteps: Open Bag as user 4412\nObserved: empty state, no error shown")}),it("writes a table with its cut noted",()=>{expect(blockToText({id:"t1",kind:"table",columns:["Item","Qty"],rows:[["Charizard",{text:"14"}]],total:30})).toBe("Item | Qty\nCharizard | 14\n… 29 more rows")}),it("names a card it cannot flatten instead of skipping it",()=>{expect(blockToText({id:"d1",kind:"diff",title:"Bag store",before:{},after:{}})).toBe("[diff card: Bag store]")}),it("drops blocks with nothing to say",()=>{expect(blocksToText([{id:"p",kind:"peek"},{id:"n",kind:"notice",tone:"info",text:"hi"}])).toEqual(["hi"])})});
@@ -1,35 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * How a block talks back to the sheet.
5
- *
6
- * Blocks are pure data; everything that happens when one is tapped goes
7
- * through this context so the same renderers work inside the real transcript,
8
- * on the example app's review page, and (later) on the desktop with a
9
- * different set of handlers behind them.
10
- */
11
- import { createContext, useContext } from "react";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- const noop = {
14
- answer: () => {},
15
- runAction: () => {},
16
- answered: {},
17
- supports: {}
18
- };
19
- const Ctx = /*#__PURE__*/createContext(noop);
20
- export function BlockHandlersProvider({
21
- value,
22
- children
23
- }) {
24
- return /*#__PURE__*/_jsx(Ctx.Provider, {
25
- value: value,
26
- children: children
27
- });
28
- }
29
- export function useBlockHandlers() {
30
- return useContext(Ctx);
31
- }
32
- export function actionKey(blockId, action) {
33
- return `${blockId}:${action.label}`;
34
- }
35
- //# sourceMappingURL=context.js.map
1
+ "use strict";import{createContext,useContext}from"react";import{jsx as _jsx}from"react/jsx-runtime";const noop={answer:()=>{},runAction:()=>{},answered:{},supports:{}},Ctx=createContext(noop);export function BlockHandlersProvider({value:e,children:t}){return _jsx(Ctx.Provider,{value:e,children:t})}export function useBlockHandlers(){return useContext(Ctx)}export function actionKey(e,t){return`${e}:${t.label}`}
@@ -1,91 +1 @@
1
- "use strict";
2
-
3
- /** The small named icons a block may ask for. One place, one size. */
4
- import { View, StyleSheet } from "react-native";
5
- import { AlertTriangle, Check, Clock, Database, Eye, Globe, Image as ImageIcon, Info, Layers, Navigation, night, User } from "@buoy-gg/shared-ui";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- export function BlockIcon({
8
- name,
9
- size = 14
10
- }) {
11
- const c = night.color.textSecondary;
12
- const icon = (() => {
13
- switch (name) {
14
- case "network":
15
- return /*#__PURE__*/_jsx(Globe, {
16
- size: size,
17
- color: c
18
- });
19
- case "storage":
20
- return /*#__PURE__*/_jsx(Database, {
21
- size: size,
22
- color: c
23
- });
24
- case "route":
25
- return /*#__PURE__*/_jsx(Navigation, {
26
- size: size,
27
- color: c
28
- });
29
- case "screen":
30
- return /*#__PURE__*/_jsx(Eye, {
31
- size: size,
32
- color: c
33
- });
34
- case "user":
35
- return /*#__PURE__*/_jsx(User, {
36
- size: size,
37
- color: c
38
- });
39
- case "image":
40
- return /*#__PURE__*/_jsx(ImageIcon, {
41
- size: size,
42
- color: c
43
- });
44
- case "check":
45
- return /*#__PURE__*/_jsx(Check, {
46
- size: size,
47
- color: night.color.accent
48
- });
49
- case "warn":
50
- return /*#__PURE__*/_jsx(AlertTriangle, {
51
- size: size,
52
- color: night.color.warning
53
- });
54
- case "info":
55
- return /*#__PURE__*/_jsx(Info, {
56
- size: size,
57
- color: night.color.info
58
- });
59
- case "store":
60
- return /*#__PURE__*/_jsx(Layers, {
61
- size: size,
62
- color: c
63
- });
64
- case "query":
65
- return /*#__PURE__*/_jsx(Layers, {
66
- size: size,
67
- color: c
68
- });
69
- case "clock":
70
- return /*#__PURE__*/_jsx(Clock, {
71
- size: size,
72
- color: c
73
- });
74
- }
75
- })();
76
- return /*#__PURE__*/_jsx(View, {
77
- style: styles.wrap,
78
- children: icon
79
- });
80
- }
81
- const styles = StyleSheet.create({
82
- wrap: {
83
- width: 24,
84
- height: 24,
85
- borderRadius: 6,
86
- backgroundColor: night.color.fill,
87
- alignItems: "center",
88
- justifyContent: "center"
89
- }
90
- });
91
- //# sourceMappingURL=icons.js.map
1
+ "use strict";import{View,StyleSheet}from"react-native";import{AlertTriangle,Check,Clock,Database,Eye,Globe,Image as ImageIcon,Info,Layers,Navigation,night,User}from"@buoy-gg/shared-ui";import{jsx as _jsx}from"react/jsx-runtime";export function BlockIcon({name:e,size:r=14}){const o=night.color.textSecondary,s=(()=>{switch(e){case"network":return _jsx(Globe,{size:r,color:o});case"storage":return _jsx(Database,{size:r,color:o});case"route":return _jsx(Navigation,{size:r,color:o});case"screen":return _jsx(Eye,{size:r,color:o});case"user":return _jsx(User,{size:r,color:o});case"image":return _jsx(ImageIcon,{size:r,color:o});case"check":return _jsx(Check,{size:r,color:night.color.accent});case"warn":return _jsx(AlertTriangle,{size:r,color:night.color.warning});case"info":return _jsx(Info,{size:r,color:night.color.info});case"store":case"query":return _jsx(Layers,{size:r,color:o});case"clock":return _jsx(Clock,{size:r,color:o})}})();return _jsx(View,{style:styles.wrap,children:s})}const styles=StyleSheet.create({wrap:{width:24,height:24,borderRadius:6,backgroundColor:night.color.fill,alignItems:"center",justifyContent:"center"}});
@@ -1,8 +1 @@
1
- "use strict";
2
-
3
- export { BlockRenderer } from "./BlockRenderer";
4
- export { BlockHandlersProvider, useBlockHandlers } from "./context";
5
- export { Card, ActionRow, ProvenanceBadge } from "./primitives";
6
- export { MessageActions, ReasoningStrip, ElapsedRow, QueuedComposer, ReloadDivider, Timestamp, EditableUserBubble } from "./ChromePrototypes";
7
- export { LivePill } from "./ExtraBlocks";
8
- //# sourceMappingURL=index.js.map
1
+ "use strict";export{BlockRenderer}from"./BlockRenderer";export{BlockHandlersProvider,useBlockHandlers}from"./context";export{Card,ActionRow,ProvenanceBadge}from"./primitives";export{MessageActions,ReasoningStrip,ElapsedRow,QueuedComposer,ReloadDivider,Timestamp,EditableUserBubble}from"./ChromePrototypes";export{LivePill}from"./ExtraBlocks";
@@ -1,56 +1 @@
1
- "use strict";
2
-
3
- import { describe, expect, it } from "vitest";
4
- import { listRowBehaviour } from "./DataBlocks";
5
-
6
- /**
7
- * A list row can carry a picture AND an action, and both want the tap. These
8
- * are the rules that keep them apart — see `listRowBehaviour`.
9
- */
10
- describe("listRowBehaviour", () => {
11
- it("a plain row does nothing on tap", () => {
12
- expect(listRowBehaviour({})).toEqual({
13
- canExpand: false,
14
- rowRunsAction: false,
15
- actionIsOwnControl: false
16
- });
17
- });
18
- it("a row with a picture opens it", () => {
19
- expect(listRowBehaviour({
20
- image: "https://x/1.png"
21
- })).toEqual({
22
- canExpand: true,
23
- rowRunsAction: false,
24
- actionIsOwnControl: false
25
- });
26
- });
27
- it("a row with only an action keeps running it from the whole row", () => {
28
- expect(listRowBehaviour({
29
- action: {
30
- label: "Retry",
31
- send: "retry"
32
- }
33
- })).toEqual({
34
- canExpand: false,
35
- rowRunsAction: true,
36
- actionIsOwnControl: false
37
- });
38
- });
39
- it("with BOTH, the body opens the picture and the action gets its own control", () => {
40
- const b = listRowBehaviour({
41
- image: "https://x/1.png",
42
- action: {
43
- label: "Retry",
44
- send: "retry"
45
- }
46
- });
47
- expect(b).toEqual({
48
- canExpand: true,
49
- rowRunsAction: false,
50
- actionIsOwnControl: true
51
- });
52
- // The row body must never be the action's target — that is the whole point.
53
- expect(b.rowRunsAction).toBe(false);
54
- });
55
- });
56
- //# sourceMappingURL=listRow.test.js.map
1
+ "use strict";import{describe,expect,it}from"vitest";import{listRowBehaviour}from"./DataBlocks";describe("listRowBehaviour",()=>{it("a plain row does nothing on tap",()=>{expect(listRowBehaviour({})).toEqual({canExpand:!1,rowRunsAction:!1,actionIsOwnControl:!1})}),it("a row with a picture opens it",()=>{expect(listRowBehaviour({image:"https://x/1.png"})).toEqual({canExpand:!0,rowRunsAction:!1,actionIsOwnControl:!1})}),it("a row with only an action keeps running it from the whole row",()=>{expect(listRowBehaviour({action:{label:"Retry",send:"retry"}})).toEqual({canExpand:!1,rowRunsAction:!0,actionIsOwnControl:!1})}),it("with BOTH, the body opens the picture and the action gets its own control",()=>{const t=listRowBehaviour({image:"https://x/1.png",action:{label:"Retry",send:"retry"}});expect(t).toEqual({canExpand:!0,rowRunsAction:!1,actionIsOwnControl:!0}),expect(t.rowRunsAction).toBe(!1)})});
@@ -1,30 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The arithmetic behind a block's "+N more" footer, separated from the hook so
5
- * it can be tested without a renderer.
6
- *
7
- * The rule that matters: a control is offered ONLY when it changes what is on
8
- * screen. The previous version derived "+N more" from a `total` the source
9
- * reported while deriving the tap target from the array actually in hand, so a
10
- * block holding five items and claiming six rendered a "+1 more" with nothing
11
- * to reveal — a button that did nothing when tapped. This takes a count and a
12
- * limit and nothing else, so `canExpand` is the same fact as `hidden > 0`.
13
- */
14
-
15
- export function pageState(count, cap, limit, step) {
16
- const shown = Math.min(limit, count);
17
- const hidden = Math.max(0, count - shown);
18
- // A block can be re-rendered in place with a shorter list than the one the
19
- // limit was raised for; collapsing back to a cap nothing exceeds would move
20
- // nothing, so it is not offered.
21
- const expanded = limit > cap && count > cap;
22
- return {
23
- hidden,
24
- next: Math.min(hidden, step),
25
- expanded,
26
- canExpand: hidden > 0,
27
- canCollapse: expanded
28
- };
29
- }
30
- //# sourceMappingURL=pageState.js.map
1
+ "use strict";export function pageState(n,t,a,e){const c=Math.min(a,n),d=Math.max(0,n-c),i=a>t&&n>t;return{hidden:d,next:Math.min(d,e),expanded:i,canExpand:d>0,canCollapse:i}}
@@ -1,56 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The "+N more" footer's arithmetic.
5
- *
6
- * The bug this covers: a list block showed "+1 more" that did nothing when
7
- * tapped. The count came from the `total` the model reported, the tap target
8
- * came from the array actually in hand, and the two disagreed — so the footer
9
- * advertised a row that was never sent. Every case below is about a control
10
- * being offered if and only if it changes the screen.
11
- */
12
- import { describe, expect, it } from "vitest";
13
- import { pageState } from "./pageState";
14
- const CAP = 10;
15
- const STEP = 5;
16
- const at = (count, limit) => pageState(count, CAP, limit, STEP);
17
- describe("what the footer offers", () => {
18
- it("offers nothing when everything already fits", () => {
19
- const s = at(4, CAP);
20
- expect(s.hidden).toBe(0);
21
- expect(s.canExpand).toBe(false);
22
- expect(s.canCollapse).toBe(false);
23
- });
24
- it("never offers an expand that reveals nothing", () => {
25
- // The dead "+1 more" this replaced: the label was drawn from a `total` the
26
- // source reported, the tap target from the array in hand. `pageState` is
27
- // given only the array, so a control it offers always moves something.
28
- expect(at(5, CAP).canExpand).toBe(false);
29
- });
30
- it("reveals a page at a time rather than the whole list", () => {
31
- // 100 items, cap 10: 10 → 15 → 20 → 25, exactly one step per tap.
32
- expect(at(100, 10).next).toBe(5);
33
- expect(at(100, 15).next).toBe(5);
34
- expect(at(100, 20).hidden).toBe(80);
35
- });
36
- it("offers only the remainder on the last page", () => {
37
- // 12 items shown to 10: two left, so the label promises two, not five.
38
- expect(at(12, 10).next).toBe(2);
39
- expect(at(12, 12).canExpand).toBe(false);
40
- });
41
- it("offers the way back only once something is expanded", () => {
42
- expect(at(100, 10).canCollapse).toBe(false);
43
- expect(at(100, 15).canCollapse).toBe(true);
44
- expect(at(100, 15).expanded).toBe(true);
45
- });
46
- it("does not offer a collapse that moves nothing", () => {
47
- // A block re-rendered in place with a shorter list than the limit was
48
- // raised for: 3 items under a limit of 20. Folding back to 10 would look
49
- // identical, so it is not offered.
50
- const s = at(3, 20);
51
- expect(s.canCollapse).toBe(false);
52
- expect(s.expanded).toBe(false);
53
- expect(s.hidden).toBe(0);
54
- });
55
- });
56
- //# sourceMappingURL=pageState.test.js.map
1
+ "use strict";import{describe,expect,it}from"vitest";import{pageState}from"./pageState";const CAP=10,STEP=5,at=(e,t)=>pageState(e,10,t,5);describe("what the footer offers",()=>{it("offers nothing when everything already fits",()=>{const e=at(4,10);expect(e.hidden).toBe(0),expect(e.canExpand).toBe(!1),expect(e.canCollapse).toBe(!1)}),it("never offers an expand that reveals nothing",()=>{expect(at(5,10).canExpand).toBe(!1)}),it("reveals a page at a time rather than the whole list",()=>{expect(at(100,10).next).toBe(5),expect(at(100,15).next).toBe(5),expect(at(100,20).hidden).toBe(80)}),it("offers only the remainder on the last page",()=>{expect(at(12,10).next).toBe(2),expect(at(12,12).canExpand).toBe(!1)}),it("offers the way back only once something is expanded",()=>{expect(at(100,10).canCollapse).toBe(!1),expect(at(100,15).canCollapse).toBe(!0),expect(at(100,15).expanded).toBe(!0)}),it("does not offer a collapse that moves nothing",()=>{const e=at(3,20);expect(e.canCollapse).toBe(!1),expect(e.expanded).toBe(!1),expect(e.hidden).toBe(0)})});