@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,401 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionRow=ActionRow,exports.Card=Card,exports.More=More,exports.ProvenanceBadge=ProvenanceBadge,exports.blockStyles=void 0,exports.toneColor=toneColor,exports.useExpand=useExpand;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_context=require("./context"),_jsxRuntime=require("react/jsx-runtime");function toneColor(e){switch(e){case"accent":return _sharedUi.night.color.accent;case"warning":return _sharedUi.night.color.warning;case"danger":return _sharedUi.night.color.danger;case"info":return _sharedUi.night.color.info;case"muted":return _sharedUi.night.color.textTertiary;default:return _sharedUi.night.color.text}}function ProvenanceBadge({source:e}){if(!e||"live"===e)return null;const t="changed"===e?"CHANGED BY ASK BUOY":"mocked"===e?"MOCKED":"FROM THE MODEL",r="changed"===e?_sharedUi.night.color.warning:"mocked"===e?_sharedUi.night.color.danger:_sharedUi.night.color.textTertiary;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,{borderColor:r}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.badgeText,{color:r}],children:t})})}function Card({title:e,source:t,children:r,testID:o,tone:i}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.card,"warning"===i&&styles.cardWarning,"danger"===i&&styles.cardDanger,"info"===i&&styles.cardInfo],testID:o,children:[(e||t&&"live"!==t)&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.titleRow,children:[e?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,numberOfLines:2,children:e}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.flex}),(0,_jsxRuntime.jsx)(ProvenanceBadge,{source:t})]}),r]})}function More({shown:e,total:t,onExpand:r,expanded:o}){return!t||t<=e?null:(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:r,disabled:!r,style:styles.more,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.moreText,children:o?"Show fewer":`+${t-e} more`}),r?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary}):null]})}function useExpand(e,t){const[r,o]=(0,_react.useState)(!1);return{visible:r?e:e.slice(0,t),expanded:r,toggle:()=>o(e=>!e)}}function ActionRow({actions:e,blockId:t,align:r="left"}){const o=(0,_context.useBlockHandlers)();if(!e?.length)return null;const i=e.filter(e=>e.openTool?!1!==o.supports?.openTool:e.minimize?!1!==o.supports?.minimize:!e.dispatch||!1!==o.supports?.dispatch);return 0===i.length?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actions,"right"===r&&styles.actionsRight],children:i.slice(0,2).map(e=>{const r=o.actionState?.[(0,_context.actionKey)(t,e)],i=!!o.busy||"running"===r||"done"===r;return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:e.label,testID:`buoy-block-action-${e.label.toLowerCase().replace(/\s+/g,"-")}`,disabled:i,onPress:()=>{o.runAction(e,t)},style:({pressed:t})=>[styles.button,e.primary?styles.buttonPrimary:styles.buttonPlate,i&&styles.buttonDisabled,t&&!i&&styles.pressed],children:["running"===r?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:e.primary?_sharedUi.night.color.onAccent:_sharedUi.night.color.text}):"done"===r?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:12,color:e.primary?_sharedUi.night.color.onAccent:_sharedUi.night.color.accent}):"failed"===r?(0,_jsxRuntime.jsx)(_sharedUi.X,{size:12,color:_sharedUi.night.color.danger}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.buttonText,e.primary?styles.buttonTextPrimary:styles.buttonTextPlate],children:e.label})]},e.label)})})}const blockStyles=exports.blockStyles=_reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:9},rowDivider:{borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},rowTitle:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,lineHeight:19},rowSub:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:17},rowTrailing:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,maxWidth:120,textAlign:"right"},mono:{fontFamily:"Menlo",fontSize:12,color:_sharedUi.night.color.text},pill:{paddingHorizontal:7,paddingVertical:2,borderRadius:_sharedUi.night.radius.badge,backgroundColor:_sharedUi.night.color.fill},pillText:{fontSize:_sharedUi.night.font.micro,fontWeight:"700",letterSpacing:.4,color:_sharedUi.night.color.textSecondary}}),styles=_reactNative.StyleSheet.create({card:{borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface,overflow:"hidden"},cardWarning:{borderColor:_sharedUi.night.color.warning,backgroundColor:_sharedUi.night.color.warningSoft},cardDanger:{borderColor:_sharedUi.night.color.danger,backgroundColor:_sharedUi.night.color.dangerSoft},cardInfo:{borderColor:_sharedUi.night.color.accentBorderStrong,backgroundColor:_sharedUi.night.color.accentSoft},titleRow:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingTop:10,paddingBottom:6},flex:{flex:1},title:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},badge:{borderWidth:_reactNative.StyleSheet.hairlineWidth,borderRadius:_sharedUi.night.radius.badge,paddingHorizontal:6,paddingVertical:2},badgeText:{fontSize:9,fontWeight:"700",letterSpacing:.6},more:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:9,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},moreText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},actions:{flexDirection:"row",gap:8,paddingHorizontal:12,paddingVertical:10,flexWrap:"wrap"},actionsRight:{justifyContent:"flex-end"},button:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:14,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},buttonPrimary:{backgroundColor:_sharedUi.night.color.accent},buttonPlate:{backgroundColor:_sharedUi.night.color.button},buttonDisabled:{opacity:.55},buttonText:{fontSize:_sharedUi.night.font.caption,fontWeight:"600"},buttonTextPrimary:{color:_sharedUi.night.color.onAccent},buttonTextPlate:{color:_sharedUi.night.color.text},pressed:{opacity:.7}});
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ActionRow = ActionRow;
7
+ exports.Card = Card;
8
+ exports.More = More;
9
+ exports.MoreNote = MoreNote;
10
+ exports.ProvenanceBadge = ProvenanceBadge;
11
+ exports.blockStyles = void 0;
12
+ exports.toneColor = toneColor;
13
+ exports.usePaged = usePaged;
14
+ var _react = require("react");
15
+ var _reactNative = require("react-native");
16
+ var _sharedUi = require("@buoy-gg/shared-ui");
17
+ var _context = require("./context");
18
+ var _pageState = require("./pageState");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ /**
21
+ * The few visual pieces every block shares: the card, its title row with the
22
+ * provenance badge, a "+N more" expander, and the two-button action row.
23
+ * Night tokens only — a block must look like every other Buoy surface.
24
+ */
25
+
26
+ function toneColor(tone) {
27
+ switch (tone) {
28
+ case "accent":
29
+ return _sharedUi.night.color.accent;
30
+ case "warning":
31
+ return _sharedUi.night.color.warning;
32
+ case "danger":
33
+ return _sharedUi.night.color.danger;
34
+ case "info":
35
+ return _sharedUi.night.color.info;
36
+ case "muted":
37
+ return _sharedUi.night.color.textTertiary;
38
+ default:
39
+ return _sharedUi.night.color.text;
40
+ }
41
+ }
42
+
43
+ /** Quiet when live; loud when the data was changed, mocked, or invented. */
44
+ function ProvenanceBadge({
45
+ source
46
+ }) {
47
+ if (!source || source === "live") return null;
48
+ const label = source === "changed" ? "CHANGED BY ASK BUOY" : source === "mocked" ? "MOCKED" : "FROM THE MODEL";
49
+ const color = source === "changed" ? _sharedUi.night.color.warning : source === "mocked" ? _sharedUi.night.color.danger : _sharedUi.night.color.textTertiary;
50
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
51
+ style: [styles.badge, {
52
+ borderColor: color
53
+ }],
54
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
55
+ style: [styles.badgeText, {
56
+ color
57
+ }],
58
+ children: label
59
+ })
60
+ });
61
+ }
62
+ function Card({
63
+ title,
64
+ source,
65
+ children,
66
+ testID,
67
+ tone
68
+ }) {
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
70
+ style: [styles.card, tone === "warning" && styles.cardWarning, tone === "danger" && styles.cardDanger, tone === "info" && styles.cardInfo],
71
+ testID: testID,
72
+ children: [(title || source && source !== "live") && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
73
+ style: styles.titleRow,
74
+ children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
75
+ style: styles.title,
76
+ numberOfLines: 2,
77
+ children: title
78
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
79
+ style: styles.flex
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ProvenanceBadge, {
81
+ source: source
82
+ })]
83
+ }), children]
84
+ });
85
+ }
86
+
87
+ /**
88
+ * How many rows one tap of "Show N more" reveals.
89
+ *
90
+ * Deliberately smaller than any block's initial cap. Expanding used to be
91
+ * all-or-nothing, so a hundred-row list arrived in one tap and buried the
92
+ * answer it was attached to under a scroll the reader had to fight back up.
93
+ * A page at a time keeps the conversation the thing you are reading.
94
+ */
95
+ const PAGE_STEP = 5;
96
+ /**
97
+ * A capped list that grows a page at a time.
98
+ *
99
+ * The callers used to spell the expander's enabled-ness out themselves
100
+ * (`items.length > visible.length || expanded ? toggle : undefined`) at seven
101
+ * call sites, and getting it wrong rendered a "+N more" that did nothing when
102
+ * tapped. Both halves live here now so a call site cannot express that state.
103
+ */
104
+ function usePaged(items, cap, step = PAGE_STEP) {
105
+ const [limit, setLimit] = (0, _react.useState)(cap);
106
+ const {
107
+ hidden,
108
+ next,
109
+ expanded,
110
+ canExpand,
111
+ canCollapse
112
+ } = (0, _pageState.pageState)(items.length, cap, limit, step);
113
+ return {
114
+ visible: items.slice(0, limit),
115
+ hidden,
116
+ next,
117
+ expanded,
118
+ showMore: canExpand ? () => setLimit(n => n + step) : undefined,
119
+ showLess: canCollapse ? () => setLimit(cap) : undefined
120
+ };
121
+ }
122
+
123
+ /**
124
+ * The footer of a paged list: reveal one more page, or fold back to the cap.
125
+ *
126
+ * It knows nothing about any `total` the source reported, and that is the
127
+ * point. The old version drew its count from that number while drawing its tap
128
+ * target from the array actually in hand — so a block holding five items and
129
+ * claiming six rendered "+1 more" with nothing behind it. The engine hands the
130
+ * whole list over now (see agent-core's receipts), so what this can show and
131
+ * what it can reveal are the same thing by construction.
132
+ */
133
+ function More({
134
+ paged
135
+ }) {
136
+ const {
137
+ next,
138
+ showMore,
139
+ showLess
140
+ } = paged;
141
+ if (!showMore && !showLess) return null;
142
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
143
+ style: styles.moreRow,
144
+ children: [showMore ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
145
+ testID: "buoy-block-show-more",
146
+ onPress: showMore,
147
+ style: [styles.more, styles.moreCell],
148
+ accessibilityRole: "button",
149
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
150
+ style: styles.moreText,
151
+ children: ["Show ", next, " more"]
152
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
153
+ size: 12,
154
+ color: _sharedUi.night.color.textTertiary
155
+ })]
156
+ }) : null, showLess ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
157
+ testID: "buoy-block-show-fewer",
158
+ onPress: showLess,
159
+ style: [styles.more, styles.moreCell],
160
+ accessibilityRole: "button",
161
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
162
+ style: styles.moreText,
163
+ children: "Show fewer"
164
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronUp, {
165
+ size: 12,
166
+ color: _sharedUi.night.color.textTertiary
167
+ })]
168
+ }) : null]
169
+ });
170
+ }
171
+
172
+ /**
173
+ * A list that CANNOT grow: the cap was applied where the block was built, so
174
+ * the rest was never sent. Stated, never offered as a tap.
175
+ */
176
+ function MoreNote({
177
+ shown,
178
+ total
179
+ }) {
180
+ if (!total || total <= shown) return null;
181
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
182
+ style: styles.more,
183
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
184
+ style: styles.moreNote,
185
+ children: [shown, " of ", total, " shown"]
186
+ })
187
+ });
188
+ }
189
+
190
+ /** Up to two buttons. One primary (accent, dark ink), one plate. */
191
+ function ActionRow({
192
+ actions,
193
+ blockId,
194
+ align = "left"
195
+ }) {
196
+ const h = (0, _context.useBlockHandlers)();
197
+ if (!actions?.length) return null;
198
+ const supported = actions.filter(a => {
199
+ if (a.openTool) return h.supports?.openTool !== false;
200
+ if (a.minimize) return h.supports?.minimize !== false;
201
+ if (a.dispatch) return h.supports?.dispatch !== false;
202
+ return true;
203
+ });
204
+ if (supported.length === 0) return null;
205
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
206
+ style: [styles.actions, align === "right" && styles.actionsRight],
207
+ children: supported.slice(0, 2).map(a => {
208
+ const state = h.actionState?.[(0, _context.actionKey)(blockId, a)];
209
+ const disabled = !!h.busy || state === "running" || state === "done";
210
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
211
+ accessibilityRole: "button",
212
+ accessibilityLabel: a.label,
213
+ testID: `buoy-block-action-${a.label.toLowerCase().replace(/\s+/g, "-")}`,
214
+ disabled: disabled,
215
+ onPress: () => void h.runAction(a, blockId),
216
+ style: ({
217
+ pressed
218
+ }) => [styles.button, a.primary ? styles.buttonPrimary : styles.buttonPlate, disabled && styles.buttonDisabled, pressed && !disabled && styles.pressed],
219
+ children: [state === "running" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
220
+ size: "small",
221
+ color: a.primary ? _sharedUi.night.color.onAccent : _sharedUi.night.color.text
222
+ }) : state === "done" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
223
+ size: 12,
224
+ color: a.primary ? _sharedUi.night.color.onAccent : _sharedUi.night.color.accent
225
+ }) : state === "failed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
226
+ size: 12,
227
+ color: _sharedUi.night.color.danger
228
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
229
+ style: [styles.buttonText, a.primary ? styles.buttonTextPrimary : styles.buttonTextPlate],
230
+ children: a.label
231
+ })]
232
+ }, a.label);
233
+ })
234
+ });
235
+ }
236
+ const blockStyles = exports.blockStyles = _reactNative.StyleSheet.create({
237
+ row: {
238
+ flexDirection: "row",
239
+ alignItems: "center",
240
+ gap: 10,
241
+ paddingHorizontal: 12,
242
+ paddingVertical: 9
243
+ },
244
+ rowDivider: {
245
+ borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
246
+ borderTopColor: _sharedUi.night.color.separator
247
+ },
248
+ rowTitle: {
249
+ flex: 1,
250
+ color: _sharedUi.night.color.text,
251
+ fontSize: _sharedUi.night.font.body,
252
+ lineHeight: 19
253
+ },
254
+ rowSub: {
255
+ color: _sharedUi.night.color.textSecondary,
256
+ fontSize: _sharedUi.night.font.caption,
257
+ lineHeight: 17
258
+ },
259
+ rowTrailing: {
260
+ color: _sharedUi.night.color.textTertiary,
261
+ fontSize: _sharedUi.night.font.caption,
262
+ maxWidth: 120,
263
+ textAlign: "right"
264
+ },
265
+ mono: {
266
+ fontFamily: "Menlo",
267
+ fontSize: 12,
268
+ color: _sharedUi.night.color.text
269
+ },
270
+ pill: {
271
+ paddingHorizontal: 7,
272
+ paddingVertical: 2,
273
+ borderRadius: _sharedUi.night.radius.badge,
274
+ backgroundColor: _sharedUi.night.color.fill
275
+ },
276
+ pillText: {
277
+ fontSize: _sharedUi.night.font.micro,
278
+ fontWeight: "700",
279
+ letterSpacing: 0.4,
280
+ color: _sharedUi.night.color.textSecondary
281
+ }
282
+ });
283
+ const styles = _reactNative.StyleSheet.create({
284
+ card: {
285
+ borderRadius: _sharedUi.night.radius.card,
286
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
287
+ borderColor: _sharedUi.night.color.border,
288
+ backgroundColor: _sharedUi.night.color.surface,
289
+ overflow: "hidden"
290
+ },
291
+ cardWarning: {
292
+ borderColor: _sharedUi.night.color.warning,
293
+ backgroundColor: _sharedUi.night.color.warningSoft
294
+ },
295
+ cardDanger: {
296
+ borderColor: _sharedUi.night.color.danger,
297
+ backgroundColor: _sharedUi.night.color.dangerSoft
298
+ },
299
+ cardInfo: {
300
+ borderColor: _sharedUi.night.color.accentBorderStrong,
301
+ backgroundColor: _sharedUi.night.color.accentSoft
302
+ },
303
+ titleRow: {
304
+ flexDirection: "row",
305
+ alignItems: "center",
306
+ gap: 8,
307
+ paddingHorizontal: 12,
308
+ paddingTop: 10,
309
+ paddingBottom: 6
310
+ },
311
+ flex: {
312
+ flex: 1
313
+ },
314
+ title: {
315
+ flex: 1,
316
+ color: _sharedUi.night.color.text,
317
+ fontSize: _sharedUi.night.font.caption,
318
+ fontWeight: "600"
319
+ },
320
+ badge: {
321
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
322
+ borderRadius: _sharedUi.night.radius.badge,
323
+ paddingHorizontal: 6,
324
+ paddingVertical: 2
325
+ },
326
+ badgeText: {
327
+ fontSize: 9,
328
+ fontWeight: "700",
329
+ letterSpacing: 0.6
330
+ },
331
+ // The footer splits into up to three cells; each keeps the full-width rule
332
+ // above it so the list still reads as ending at a line.
333
+ moreRow: {
334
+ flexDirection: "row"
335
+ },
336
+ more: {
337
+ flexDirection: "row",
338
+ alignItems: "center",
339
+ justifyContent: "center",
340
+ gap: 4,
341
+ paddingVertical: 9,
342
+ paddingHorizontal: 8,
343
+ borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
344
+ borderTopColor: _sharedUi.night.color.separator
345
+ },
346
+ // Only inside `moreRow` — a bare `MoreNote` sits in the Card's column,
347
+ // where flex:1 means "grow vertically".
348
+ moreCell: {
349
+ flex: 1
350
+ },
351
+ moreText: {
352
+ color: _sharedUi.night.color.textSecondary,
353
+ fontSize: _sharedUi.night.font.caption,
354
+ fontWeight: "600"
355
+ },
356
+ moreNote: {
357
+ color: _sharedUi.night.color.textTertiary,
358
+ fontSize: _sharedUi.night.font.caption
359
+ },
360
+ actions: {
361
+ flexDirection: "row",
362
+ gap: 8,
363
+ paddingHorizontal: 12,
364
+ paddingVertical: 10,
365
+ flexWrap: "wrap"
366
+ },
367
+ actionsRight: {
368
+ justifyContent: "flex-end"
369
+ },
370
+ button: {
371
+ flexDirection: "row",
372
+ alignItems: "center",
373
+ gap: 6,
374
+ paddingHorizontal: 14,
375
+ paddingVertical: 9,
376
+ borderRadius: _sharedUi.night.radius.row
377
+ },
378
+ buttonPrimary: {
379
+ backgroundColor: _sharedUi.night.color.accent
380
+ },
381
+ buttonPlate: {
382
+ backgroundColor: _sharedUi.night.color.button
383
+ },
384
+ buttonDisabled: {
385
+ opacity: 0.55
386
+ },
387
+ buttonText: {
388
+ fontSize: _sharedUi.night.font.caption,
389
+ fontWeight: "600"
390
+ },
391
+ buttonTextPrimary: {
392
+ color: _sharedUi.night.color.onAccent
393
+ },
394
+ buttonTextPlate: {
395
+ color: _sharedUi.night.color.text
396
+ },
397
+ pressed: {
398
+ opacity: 0.7
399
+ }
400
+ });
401
+ //# sourceMappingURL=primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_sharedUi","_context","_pageState","_jsxRuntime","toneColor","tone","night","color","accent","warning","danger","info","textTertiary","text","ProvenanceBadge","source","label","jsx","View","style","styles","badge","borderColor","children","Text","badgeText","Card","title","testID","jsxs","card","cardWarning","cardDanger","cardInfo","titleRow","numberOfLines","flex","PAGE_STEP","usePaged","items","cap","step","limit","setLimit","useState","hidden","next","expanded","canExpand","canCollapse","pageState","length","visible","slice","showMore","n","undefined","showLess","More","paged","moreRow","Pressable","onPress","more","moreCell","accessibilityRole","moreText","ChevronDown","size","ChevronUp","MoreNote","shown","total","moreNote","ActionRow","actions","blockId","align","h","useBlockHandlers","supported","filter","a","openTool","supports","minimize","dispatch","actionsRight","map","state","actionState","actionKey","disabled","busy","accessibilityLabel","toLowerCase","replace","runAction","pressed","button","primary","buttonPrimary","buttonPlate","buttonDisabled","ActivityIndicator","onAccent","Check","X","buttonText","buttonTextPrimary","buttonTextPlate","blockStyles","exports","StyleSheet","create","row","flexDirection","alignItems","gap","paddingHorizontal","paddingVertical","rowDivider","borderTopWidth","hairlineWidth","borderTopColor","separator","rowTitle","fontSize","font","body","lineHeight","rowSub","textSecondary","caption","rowTrailing","maxWidth","textAlign","mono","fontFamily","pill","borderRadius","radius","backgroundColor","fill","pillText","micro","fontWeight","letterSpacing","borderWidth","border","surface","overflow","warningSoft","dangerSoft","accentBorderStrong","accentSoft","paddingTop","paddingBottom","justifyContent","flexWrap","opacity"],"sourceRoot":"../../../src","sources":["blocks/primitives.tsx"],"mappings":";;;;;;;;;;;;;AAKA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAGA,IAAAG,QAAA,GAAAH,OAAA;AAC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AAK,EAAED,eAAK,CAACC,KAAK,CAACM;EAAK,CAAC;EAC5CqF,OAAO,EAAE;IAAE8D,OAAO,EAAE;EAAI;AAC1B,CAAC,CAAC","ignoreList":[]}
@@ -1 +1,62 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ActionRow",{enumerable:!0,get:function(){return _primitives.ActionRow}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return _primitives.Card}}),Object.defineProperty(exports,"More",{enumerable:!0,get:function(){return _primitives.More}}),Object.defineProperty(exports,"ProvenanceBadge",{enumerable:!0,get:function(){return _primitives.ProvenanceBadge}}),Object.defineProperty(exports,"blockStyles",{enumerable:!0,get:function(){return _primitives.blockStyles}}),Object.defineProperty(exports,"toneColor",{enumerable:!0,get:function(){return _primitives.toneColor}}),Object.defineProperty(exports,"useBlockHandlers",{enumerable:!0,get:function(){return _context.useBlockHandlers}}),Object.defineProperty(exports,"useExpand",{enumerable:!0,get:function(){return _primitives.useExpand}});var _primitives=require("./primitives"),_context=require("./context");
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ActionRow", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _primitives.ActionRow;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Card", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _primitives.Card;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "More", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _primitives.More;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "MoreNote", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _primitives.MoreNote;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "ProvenanceBadge", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _primitives.ProvenanceBadge;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "blockStyles", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _primitives.blockStyles;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "toneColor", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _primitives.toneColor;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "useBlockHandlers", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _context.useBlockHandlers;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "usePaged", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _primitives.usePaged;
58
+ }
59
+ });
60
+ var _primitives = require("./primitives");
61
+ var _context = require("./context");
62
+ //# sourceMappingURL=primitivesIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_primitives","require","_context"],"sourceRoot":"../../../src","sources":["blocks/primitivesIndex.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1 +1,140 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApprovalCard=ApprovalCard;var _reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");function ApprovalCard({pending:e,onAnswer:t}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:"buoy-ask-buoy-approval",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.titleRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:"Allow this change?"})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:e.label}),e.description?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,children:e.description}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reason,children:e.reason}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actions,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approve",accessibilityRole:"button",onPress:()=>t(!0),style:({pressed:e})=>[styles.button,styles.approve,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.approveText,children:"Allow"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-reject",accessibilityRole:"button",onPress:()=>t(!1),style:({pressed:e})=>[styles.button,styles.reject,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rejectText,children:"Not now"})})]})]})}const styles=_reactNative.StyleSheet.create({card:{marginHorizontal:_sharedUi.night.gutter,marginBottom:10,padding:_sharedUi.night.cardPad,borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.accentBorderStrong,backgroundColor:_sharedUi.night.color.surface,gap:6},titleRow:{flexDirection:"row",alignItems:"center",gap:6},title:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},label:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",lineHeight:20},description:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:18},reason:{color:_sharedUi.night.color.warning,fontSize:_sharedUi.night.font.caption,lineHeight:18},actions:{flexDirection:"row",gap:8,marginTop:6},button:{paddingHorizontal:16,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},approve:{backgroundColor:_sharedUi.night.color.accent},approveText:{color:_sharedUi.night.color.onAccent,fontWeight:"600",fontSize:_sharedUi.night.font.caption},reject:{backgroundColor:_sharedUi.night.color.button},rejectText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},pressed:{opacity:.7}});
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ApprovalCard = ApprovalCard;
7
+ var _reactNative = require("react-native");
8
+ var _sharedUi = require("@buoy-gg/shared-ui");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * The approval prompt, shown only when the app opted into `requireApproval`.
12
+ *
13
+ * It renders the EFFECT, not the payload. That is the whole design constraint:
14
+ * every other agent product assumes a developer is reading the proposed
15
+ * command before approving it, and the people this tool is for cannot evaluate
16
+ * `redux_dispatch({type:'SET_ENTITLEMENTS', payload:{…}})`. An approval prompt
17
+ * nobody can read is not oversight — it is a rubber stamp that looks like
18
+ * oversight, which is worse than having no prompt at all.
19
+ */
20
+
21
+ function ApprovalCard({
22
+ pending,
23
+ onAnswer
24
+ }) {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
26
+ style: styles.card,
27
+ testID: "buoy-ask-buoy-approval",
28
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
29
+ style: styles.titleRow,
30
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
31
+ size: 14,
32
+ color: _sharedUi.night.color.warning
33
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
34
+ style: styles.title,
35
+ children: "Allow this change?"
36
+ })]
37
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
38
+ style: styles.label,
39
+ children: pending.label
40
+ }), pending.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
41
+ style: styles.description,
42
+ children: pending.description
43
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
44
+ style: styles.reason,
45
+ children: pending.reason
46
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
47
+ style: styles.actions,
48
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
49
+ testID: "buoy-ask-buoy-approve",
50
+ accessibilityRole: "button",
51
+ onPress: () => onAnswer(true),
52
+ style: ({
53
+ pressed
54
+ }) => [styles.button, styles.approve, pressed && styles.pressed],
55
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
56
+ style: styles.approveText,
57
+ children: "Allow"
58
+ })
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
60
+ testID: "buoy-ask-buoy-reject",
61
+ accessibilityRole: "button",
62
+ onPress: () => onAnswer(false),
63
+ style: ({
64
+ pressed
65
+ }) => [styles.button, styles.reject, pressed && styles.pressed],
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
67
+ style: styles.rejectText,
68
+ children: "Not now"
69
+ })
70
+ })]
71
+ })]
72
+ });
73
+ }
74
+ const styles = _reactNative.StyleSheet.create({
75
+ card: {
76
+ marginHorizontal: _sharedUi.night.gutter,
77
+ marginBottom: 10,
78
+ padding: _sharedUi.night.cardPad,
79
+ borderRadius: _sharedUi.night.radius.card,
80
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
81
+ borderColor: _sharedUi.night.color.accentBorderStrong,
82
+ backgroundColor: _sharedUi.night.color.surface,
83
+ gap: 6
84
+ },
85
+ titleRow: {
86
+ flexDirection: "row",
87
+ alignItems: "center",
88
+ gap: 6
89
+ },
90
+ title: {
91
+ color: _sharedUi.night.color.text,
92
+ fontSize: _sharedUi.night.font.caption,
93
+ fontWeight: "600"
94
+ },
95
+ label: {
96
+ color: _sharedUi.night.color.text,
97
+ fontSize: _sharedUi.night.font.row,
98
+ fontWeight: "600",
99
+ lineHeight: 20
100
+ },
101
+ description: {
102
+ color: _sharedUi.night.color.textSecondary,
103
+ fontSize: _sharedUi.night.font.caption,
104
+ lineHeight: 18
105
+ },
106
+ reason: {
107
+ color: _sharedUi.night.color.warning,
108
+ fontSize: _sharedUi.night.font.caption,
109
+ lineHeight: 18
110
+ },
111
+ actions: {
112
+ flexDirection: "row",
113
+ gap: 8,
114
+ marginTop: 6
115
+ },
116
+ button: {
117
+ paddingHorizontal: 16,
118
+ paddingVertical: 9,
119
+ borderRadius: _sharedUi.night.radius.row
120
+ },
121
+ approve: {
122
+ backgroundColor: _sharedUi.night.color.accent
123
+ },
124
+ approveText: {
125
+ color: _sharedUi.night.color.onAccent,
126
+ fontWeight: "600",
127
+ fontSize: _sharedUi.night.font.caption
128
+ },
129
+ reject: {
130
+ backgroundColor: _sharedUi.night.color.button
131
+ },
132
+ rejectText: {
133
+ color: _sharedUi.night.color.text,
134
+ fontSize: _sharedUi.night.font.caption
135
+ },
136
+ pressed: {
137
+ opacity: 0.7
138
+ }
139
+ });
140
+ //# sourceMappingURL=ApprovalCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_sharedUi","_jsxRuntime","ApprovalCard","pending","onAnswer","jsxs","View","style","styles","card","testID","children","titleRow","jsx","AlertTriangle","size","color","night","warning","Text","title","label","description","reason","actions","Pressable","accessibilityRole","onPress","pressed","button","approve","approveText","reject","rejectText","StyleSheet","create","marginHorizontal","gutter","marginBottom","padding","cardPad","borderRadius","radius","borderWidth","hairlineWidth","borderColor","accentBorderStrong","backgroundColor","surface","gap","flexDirection","alignItems","text","fontSize","font","caption","fontWeight","row","lineHeight","textSecondary","marginTop","paddingHorizontal","paddingVertical","accent","onAccent","opacity"],"sourceRoot":"../../../src","sources":["components/ApprovalCard.tsx"],"mappings":";;;;;;AAUA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAA0D,IAAAE,WAAA,GAAAF,OAAA;AAX1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,SAASG,YAAYA,CAAC;EAAEC,OAAO;EAAEC;AAA4B,CAAC,EAAE;EACrE,oBACE,IAAAH,WAAA,CAAAI,IAAA,EAACP,YAAA,CAAAQ,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,IAAK;IAACC,MAAM,EAAC,wBAAwB;IAAAC,QAAA,gBACvD,IAAAV,WAAA,CAAAI,IAAA,EAACP,YAAA,CAAAQ,IAAI;MA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