@buoy-gg/ask-buoy 7.0.34 → 7.0.35

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