@buoy-gg/ask-buoy 7.0.33 → 7.0.34

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 (153) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -250
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -545
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1821
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -140
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -596
  9. package/lib/commonjs/blocks/context.js +1 -42
  10. package/lib/commonjs/blocks/icons.js +1 -96
  11. package/lib/commonjs/blocks/index.js +1 -95
  12. package/lib/commonjs/blocks/primitives.js +1 -312
  13. package/lib/commonjs/blocks/primitivesIndex.js +1 -56
  14. package/lib/commonjs/components/ApprovalCard.js +1 -140
  15. package/lib/commonjs/components/AskBuoyHeader.js +1 -127
  16. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  17. package/lib/commonjs/components/AskBuoyModal.js +1 -322
  18. package/lib/commonjs/components/ChangesBar.js +1 -211
  19. package/lib/commonjs/components/Composer.js +1 -175
  20. package/lib/commonjs/components/EmptyState.js +1 -154
  21. package/lib/commonjs/components/Markdown.js +1 -252
  22. package/lib/commonjs/components/MessageList.js +1 -648
  23. package/lib/commonjs/components/TypingDots.js +1 -63
  24. package/lib/commonjs/index.js +1 -205
  25. package/lib/commonjs/preset.js +1 -90
  26. package/lib/commonjs/store/askBuoyStore.js +1 -279
  27. package/lib/commonjs/store/useAskBuoy.js +1 -299
  28. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -119
  29. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -136
  30. package/lib/commonjs/sync/wire.js +1 -58
  31. package/lib/commonjs/types.js +1 -6
  32. package/lib/module/blocks/AskBlocks.js +1 -331
  33. package/lib/module/blocks/BlockRenderer.js +1 -245
  34. package/lib/module/blocks/ChromePrototypes.js +1 -503
  35. package/lib/module/blocks/DataBlocks.js +1 -532
  36. package/lib/module/blocks/ExtraBlocks.js +1 -1794
  37. package/lib/module/blocks/MediaBlocks.js +1 -135
  38. package/lib/module/blocks/ReceiptBlocks.js +1 -584
  39. package/lib/module/blocks/context.js +1 -35
  40. package/lib/module/blocks/icons.js +1 -91
  41. package/lib/module/blocks/index.js +1 -8
  42. package/lib/module/blocks/primitives.js +1 -301
  43. package/lib/module/blocks/primitivesIndex.js +1 -5
  44. package/lib/module/components/ApprovalCard.js +1 -135
  45. package/lib/module/components/AskBuoyHeader.js +1 -124
  46. package/lib/module/components/AskBuoyIcon.js +1 -8
  47. package/lib/module/components/AskBuoyModal.js +1 -317
  48. package/lib/module/components/ChangesBar.js +1 -206
  49. package/lib/module/components/Composer.js +1 -170
  50. package/lib/module/components/EmptyState.js +1 -149
  51. package/lib/module/components/Markdown.js +1 -246
  52. package/lib/module/components/MessageList.js +1 -642
  53. package/lib/module/components/TypingDots.js +1 -58
  54. package/lib/module/index.js +1 -29
  55. package/lib/module/preset.js +1 -73
  56. package/lib/module/store/askBuoyStore.js +1 -275
  57. package/lib/module/store/useAskBuoy.js +1 -293
  58. package/lib/module/sync/askBuoySyncAdapter.js +1 -114
  59. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -135
  60. package/lib/module/sync/wire.js +1 -47
  61. package/lib/module/types.js +1 -4
  62. package/lib/typescript/preset.d.ts +1 -1
  63. package/package.json +8 -8
  64. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  65. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  66. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  67. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  68. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  69. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  70. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  71. package/lib/commonjs/blocks/context.js.map +0 -1
  72. package/lib/commonjs/blocks/icons.js.map +0 -1
  73. package/lib/commonjs/blocks/index.js.map +0 -1
  74. package/lib/commonjs/blocks/primitives.js.map +0 -1
  75. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  76. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  77. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  78. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  79. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  80. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  81. package/lib/commonjs/components/Composer.js.map +0 -1
  82. package/lib/commonjs/components/EmptyState.js.map +0 -1
  83. package/lib/commonjs/components/Markdown.js.map +0 -1
  84. package/lib/commonjs/components/MessageList.js.map +0 -1
  85. package/lib/commonjs/components/TypingDots.js.map +0 -1
  86. package/lib/commonjs/index.js.map +0 -1
  87. package/lib/commonjs/preset.js.map +0 -1
  88. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  89. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  90. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  91. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  92. package/lib/commonjs/sync/wire.js.map +0 -1
  93. package/lib/commonjs/types.js.map +0 -1
  94. package/lib/module/blocks/AskBlocks.js.map +0 -1
  95. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  96. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  97. package/lib/module/blocks/DataBlocks.js.map +0 -1
  98. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  99. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  100. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  101. package/lib/module/blocks/context.js.map +0 -1
  102. package/lib/module/blocks/icons.js.map +0 -1
  103. package/lib/module/blocks/index.js.map +0 -1
  104. package/lib/module/blocks/primitives.js.map +0 -1
  105. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  106. package/lib/module/components/ApprovalCard.js.map +0 -1
  107. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  108. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  109. package/lib/module/components/AskBuoyModal.js.map +0 -1
  110. package/lib/module/components/ChangesBar.js.map +0 -1
  111. package/lib/module/components/Composer.js.map +0 -1
  112. package/lib/module/components/EmptyState.js.map +0 -1
  113. package/lib/module/components/Markdown.js.map +0 -1
  114. package/lib/module/components/MessageList.js.map +0 -1
  115. package/lib/module/components/TypingDots.js.map +0 -1
  116. package/lib/module/index.js.map +0 -1
  117. package/lib/module/preset.js.map +0 -1
  118. package/lib/module/store/askBuoyStore.js.map +0 -1
  119. package/lib/module/store/useAskBuoy.js.map +0 -1
  120. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  121. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  122. package/lib/module/sync/wire.js.map +0 -1
  123. package/lib/module/types.js.map +0 -1
  124. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  125. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  126. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  127. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  128. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  129. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  130. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  131. package/lib/typescript/blocks/context.d.ts.map +0 -1
  132. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  133. package/lib/typescript/blocks/index.d.ts.map +0 -1
  134. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  135. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  136. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  137. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  138. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  139. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  140. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  141. package/lib/typescript/components/Composer.d.ts.map +0 -1
  142. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  143. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  144. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  145. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  146. package/lib/typescript/index.d.ts.map +0 -1
  147. package/lib/typescript/preset.d.ts.map +0 -1
  148. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  149. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  150. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  151. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  152. package/lib/typescript/sync/wire.d.ts.map +0 -1
  153. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,96 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BlockIcon = BlockIcon;
7
- var _reactNative = require("react-native");
8
- var _sharedUi = require("@buoy-gg/shared-ui");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- /** The small named icons a block may ask for. One place, one size. */
11
-
12
- function BlockIcon({
13
- name,
14
- size = 14
15
- }) {
16
- const c = _sharedUi.night.color.textSecondary;
17
- const icon = (() => {
18
- switch (name) {
19
- case "network":
20
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Globe, {
21
- size: size,
22
- color: c
23
- });
24
- case "storage":
25
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Database, {
26
- size: size,
27
- color: c
28
- });
29
- case "route":
30
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Navigation, {
31
- size: size,
32
- color: c
33
- });
34
- case "screen":
35
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Eye, {
36
- size: size,
37
- color: c
38
- });
39
- case "user":
40
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.User, {
41
- size: size,
42
- color: c
43
- });
44
- case "image":
45
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Image, {
46
- size: size,
47
- color: c
48
- });
49
- case "check":
50
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
51
- size: size,
52
- color: _sharedUi.night.color.accent
53
- });
54
- case "warn":
55
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
56
- size: size,
57
- color: _sharedUi.night.color.warning
58
- });
59
- case "info":
60
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Info, {
61
- size: size,
62
- color: _sharedUi.night.color.info
63
- });
64
- case "store":
65
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Layers, {
66
- size: size,
67
- color: c
68
- });
69
- case "query":
70
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Layers, {
71
- size: size,
72
- color: c
73
- });
74
- case "clock":
75
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Clock, {
76
- size: size,
77
- color: c
78
- });
79
- }
80
- })();
81
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
82
- style: styles.wrap,
83
- children: icon
84
- });
85
- }
86
- const styles = _reactNative.StyleSheet.create({
87
- wrap: {
88
- width: 24,
89
- height: 24,
90
- borderRadius: 6,
91
- backgroundColor: _sharedUi.night.color.fill,
92
- alignItems: "center",
93
- justifyContent: "center"
94
- }
95
- });
96
- //# sourceMappingURL=icons.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BlockIcon=BlockIcon;var _reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");function BlockIcon({name:e,size:r=14}){const s=_sharedUi.night.color.textSecondary,i=(()=>{switch(e){case"network":return(0,_jsxRuntime.jsx)(_sharedUi.Globe,{size:r,color:s});case"storage":return(0,_jsxRuntime.jsx)(_sharedUi.Database,{size:r,color:s});case"route":return(0,_jsxRuntime.jsx)(_sharedUi.Navigation,{size:r,color:s});case"screen":return(0,_jsxRuntime.jsx)(_sharedUi.Eye,{size:r,color:s});case"user":return(0,_jsxRuntime.jsx)(_sharedUi.User,{size:r,color:s});case"image":return(0,_jsxRuntime.jsx)(_sharedUi.Image,{size:r,color:s});case"check":return(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:r,color:_sharedUi.night.color.accent});case"warn":return(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:r,color:_sharedUi.night.color.warning});case"info":return(0,_jsxRuntime.jsx)(_sharedUi.Info,{size:r,color:_sharedUi.night.color.info});case"store":case"query":return(0,_jsxRuntime.jsx)(_sharedUi.Layers,{size:r,color:s});case"clock":return(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:r,color:s})}})();return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.wrap,children:i})}const styles=_reactNative.StyleSheet.create({wrap:{width:24,height:24,borderRadius:6,backgroundColor:_sharedUi.night.color.fill,alignItems:"center",justifyContent:"center"}});
@@ -1,95 +1 @@
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, "BlockHandlersProvider", {
13
- enumerable: true,
14
- get: function () {
15
- return _context.BlockHandlersProvider;
16
- }
17
- });
18
- Object.defineProperty(exports, "BlockRenderer", {
19
- enumerable: true,
20
- get: function () {
21
- return _BlockRenderer.BlockRenderer;
22
- }
23
- });
24
- Object.defineProperty(exports, "Card", {
25
- enumerable: true,
26
- get: function () {
27
- return _primitives.Card;
28
- }
29
- });
30
- Object.defineProperty(exports, "EditableUserBubble", {
31
- enumerable: true,
32
- get: function () {
33
- return _ChromePrototypes.EditableUserBubble;
34
- }
35
- });
36
- Object.defineProperty(exports, "ElapsedRow", {
37
- enumerable: true,
38
- get: function () {
39
- return _ChromePrototypes.ElapsedRow;
40
- }
41
- });
42
- Object.defineProperty(exports, "LivePill", {
43
- enumerable: true,
44
- get: function () {
45
- return _ExtraBlocks.LivePill;
46
- }
47
- });
48
- Object.defineProperty(exports, "MessageActions", {
49
- enumerable: true,
50
- get: function () {
51
- return _ChromePrototypes.MessageActions;
52
- }
53
- });
54
- Object.defineProperty(exports, "ProvenanceBadge", {
55
- enumerable: true,
56
- get: function () {
57
- return _primitives.ProvenanceBadge;
58
- }
59
- });
60
- Object.defineProperty(exports, "QueuedComposer", {
61
- enumerable: true,
62
- get: function () {
63
- return _ChromePrototypes.QueuedComposer;
64
- }
65
- });
66
- Object.defineProperty(exports, "ReasoningStrip", {
67
- enumerable: true,
68
- get: function () {
69
- return _ChromePrototypes.ReasoningStrip;
70
- }
71
- });
72
- Object.defineProperty(exports, "ReloadDivider", {
73
- enumerable: true,
74
- get: function () {
75
- return _ChromePrototypes.ReloadDivider;
76
- }
77
- });
78
- Object.defineProperty(exports, "Timestamp", {
79
- enumerable: true,
80
- get: function () {
81
- return _ChromePrototypes.Timestamp;
82
- }
83
- });
84
- Object.defineProperty(exports, "useBlockHandlers", {
85
- enumerable: true,
86
- get: function () {
87
- return _context.useBlockHandlers;
88
- }
89
- });
90
- var _BlockRenderer = require("./BlockRenderer");
91
- var _context = require("./context");
92
- var _primitives = require("./primitives");
93
- var _ChromePrototypes = require("./ChromePrototypes");
94
- var _ExtraBlocks = require("./ExtraBlocks");
95
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ActionRow",{enumerable:!0,get:function(){return _primitives.ActionRow}}),Object.defineProperty(exports,"BlockHandlersProvider",{enumerable:!0,get:function(){return _context.BlockHandlersProvider}}),Object.defineProperty(exports,"BlockRenderer",{enumerable:!0,get:function(){return _BlockRenderer.BlockRenderer}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return _primitives.Card}}),Object.defineProperty(exports,"EditableUserBubble",{enumerable:!0,get:function(){return _ChromePrototypes.EditableUserBubble}}),Object.defineProperty(exports,"ElapsedRow",{enumerable:!0,get:function(){return _ChromePrototypes.ElapsedRow}}),Object.defineProperty(exports,"LivePill",{enumerable:!0,get:function(){return _ExtraBlocks.LivePill}}),Object.defineProperty(exports,"MessageActions",{enumerable:!0,get:function(){return _ChromePrototypes.MessageActions}}),Object.defineProperty(exports,"ProvenanceBadge",{enumerable:!0,get:function(){return _primitives.ProvenanceBadge}}),Object.defineProperty(exports,"QueuedComposer",{enumerable:!0,get:function(){return _ChromePrototypes.QueuedComposer}}),Object.defineProperty(exports,"ReasoningStrip",{enumerable:!0,get:function(){return _ChromePrototypes.ReasoningStrip}}),Object.defineProperty(exports,"ReloadDivider",{enumerable:!0,get:function(){return _ChromePrototypes.ReloadDivider}}),Object.defineProperty(exports,"Timestamp",{enumerable:!0,get:function(){return _ChromePrototypes.Timestamp}}),Object.defineProperty(exports,"useBlockHandlers",{enumerable:!0,get:function(){return _context.useBlockHandlers}});var _BlockRenderer=require("./BlockRenderer"),_context=require("./context"),_primitives=require("./primitives"),_ChromePrototypes=require("./ChromePrototypes"),_ExtraBlocks=require("./ExtraBlocks");
@@ -1,312 +1 @@
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.ProvenanceBadge = ProvenanceBadge;
10
- exports.blockStyles = void 0;
11
- exports.toneColor = toneColor;
12
- exports.useExpand = useExpand;
13
- var _react = require("react");
14
- var _reactNative = require("react-native");
15
- var _sharedUi = require("@buoy-gg/shared-ui");
16
- var _context = require("./context");
17
- var _jsxRuntime = require("react/jsx-runtime");
18
- /**
19
- * The few visual pieces every block shares: the card, its title row with the
20
- * provenance badge, a "+N more" expander, and the two-button action row.
21
- * Night tokens only — a block must look like every other Buoy surface.
22
- */
23
-
24
- function toneColor(tone) {
25
- switch (tone) {
26
- case "accent":
27
- return _sharedUi.night.color.accent;
28
- case "warning":
29
- return _sharedUi.night.color.warning;
30
- case "danger":
31
- return _sharedUi.night.color.danger;
32
- case "info":
33
- return _sharedUi.night.color.info;
34
- case "muted":
35
- return _sharedUi.night.color.textTertiary;
36
- default:
37
- return _sharedUi.night.color.text;
38
- }
39
- }
40
-
41
- /** Quiet when live; loud when the data was changed, mocked, or invented. */
42
- function ProvenanceBadge({
43
- source
44
- }) {
45
- if (!source || source === "live") return null;
46
- const label = source === "changed" ? "CHANGED BY ASK BUOY" : source === "mocked" ? "MOCKED" : "FROM THE MODEL";
47
- const color = source === "changed" ? _sharedUi.night.color.warning : source === "mocked" ? _sharedUi.night.color.danger : _sharedUi.night.color.textTertiary;
48
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
49
- style: [styles.badge, {
50
- borderColor: color
51
- }],
52
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
53
- style: [styles.badgeText, {
54
- color
55
- }],
56
- children: label
57
- })
58
- });
59
- }
60
- function Card({
61
- title,
62
- source,
63
- children,
64
- testID,
65
- tone
66
- }) {
67
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
68
- style: [styles.card, tone === "warning" && styles.cardWarning, tone === "danger" && styles.cardDanger, tone === "info" && styles.cardInfo],
69
- testID: testID,
70
- children: [(title || source && source !== "live") && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
71
- style: styles.titleRow,
72
- children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
73
- style: styles.title,
74
- numberOfLines: 2,
75
- children: title
76
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
77
- style: styles.flex
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ProvenanceBadge, {
79
- source: source
80
- })]
81
- }), children]
82
- });
83
- }
84
-
85
- /** "+N more" — renders the hidden rows when tapped. Never a nested scroller. */
86
- function More({
87
- shown,
88
- total,
89
- onExpand,
90
- expanded
91
- }) {
92
- if (!total || total <= shown) return null;
93
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
94
- onPress: onExpand,
95
- disabled: !onExpand,
96
- style: styles.more,
97
- accessibilityRole: "button",
98
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
99
- style: styles.moreText,
100
- children: expanded ? "Show fewer" : `+${total - shown} more`
101
- }), onExpand ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
102
- size: 12,
103
- color: _sharedUi.night.color.textTertiary
104
- }) : null]
105
- });
106
- }
107
- function useExpand(items, cap) {
108
- const [expanded, setExpanded] = (0, _react.useState)(false);
109
- return {
110
- visible: expanded ? items : items.slice(0, cap),
111
- expanded,
112
- toggle: () => setExpanded(v => !v)
113
- };
114
- }
115
-
116
- /** Up to two buttons. One primary (accent, dark ink), one plate. */
117
- function ActionRow({
118
- actions,
119
- blockId,
120
- align = "left"
121
- }) {
122
- const h = (0, _context.useBlockHandlers)();
123
- if (!actions?.length) return null;
124
- const supported = actions.filter(a => {
125
- if (a.openTool) return h.supports?.openTool !== false;
126
- if (a.minimize) return h.supports?.minimize !== false;
127
- if (a.dispatch) return h.supports?.dispatch !== false;
128
- return true;
129
- });
130
- if (supported.length === 0) return null;
131
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
132
- style: [styles.actions, align === "right" && styles.actionsRight],
133
- children: supported.slice(0, 2).map(a => {
134
- const state = h.actionState?.[(0, _context.actionKey)(blockId, a)];
135
- const disabled = !!h.busy || state === "running" || state === "done";
136
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
137
- accessibilityRole: "button",
138
- accessibilityLabel: a.label,
139
- testID: `buoy-block-action-${a.label.toLowerCase().replace(/\s+/g, "-")}`,
140
- disabled: disabled,
141
- onPress: () => void h.runAction(a, blockId),
142
- style: ({
143
- pressed
144
- }) => [styles.button, a.primary ? styles.buttonPrimary : styles.buttonPlate, disabled && styles.buttonDisabled, pressed && !disabled && styles.pressed],
145
- children: [state === "running" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
146
- size: "small",
147
- color: a.primary ? _sharedUi.night.color.onAccent : _sharedUi.night.color.text
148
- }) : state === "done" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
149
- size: 12,
150
- color: a.primary ? _sharedUi.night.color.onAccent : _sharedUi.night.color.accent
151
- }) : state === "failed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
152
- size: 12,
153
- color: _sharedUi.night.color.danger
154
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
155
- style: [styles.buttonText, a.primary ? styles.buttonTextPrimary : styles.buttonTextPlate],
156
- children: a.label
157
- })]
158
- }, a.label);
159
- })
160
- });
161
- }
162
- const blockStyles = exports.blockStyles = _reactNative.StyleSheet.create({
163
- row: {
164
- flexDirection: "row",
165
- alignItems: "center",
166
- gap: 10,
167
- paddingHorizontal: 12,
168
- paddingVertical: 9
169
- },
170
- rowDivider: {
171
- borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
172
- borderTopColor: _sharedUi.night.color.separator
173
- },
174
- rowTitle: {
175
- flex: 1,
176
- color: _sharedUi.night.color.text,
177
- fontSize: _sharedUi.night.font.body,
178
- lineHeight: 19
179
- },
180
- rowSub: {
181
- color: _sharedUi.night.color.textSecondary,
182
- fontSize: _sharedUi.night.font.caption,
183
- lineHeight: 17
184
- },
185
- rowTrailing: {
186
- color: _sharedUi.night.color.textTertiary,
187
- fontSize: _sharedUi.night.font.caption,
188
- maxWidth: 120,
189
- textAlign: "right"
190
- },
191
- mono: {
192
- fontFamily: "Menlo",
193
- fontSize: 12,
194
- color: _sharedUi.night.color.text
195
- },
196
- pill: {
197
- paddingHorizontal: 7,
198
- paddingVertical: 2,
199
- borderRadius: _sharedUi.night.radius.badge,
200
- backgroundColor: _sharedUi.night.color.fill
201
- },
202
- pillText: {
203
- fontSize: _sharedUi.night.font.micro,
204
- fontWeight: "700",
205
- letterSpacing: 0.4,
206
- color: _sharedUi.night.color.textSecondary
207
- }
208
- });
209
- const styles = _reactNative.StyleSheet.create({
210
- card: {
211
- borderRadius: _sharedUi.night.radius.card,
212
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
213
- borderColor: _sharedUi.night.color.border,
214
- backgroundColor: _sharedUi.night.color.surface,
215
- overflow: "hidden"
216
- },
217
- cardWarning: {
218
- borderColor: _sharedUi.night.color.warning,
219
- backgroundColor: _sharedUi.night.color.warningSoft
220
- },
221
- cardDanger: {
222
- borderColor: _sharedUi.night.color.danger,
223
- backgroundColor: _sharedUi.night.color.dangerSoft
224
- },
225
- cardInfo: {
226
- borderColor: _sharedUi.night.color.accentBorderStrong,
227
- backgroundColor: _sharedUi.night.color.accentSoft
228
- },
229
- titleRow: {
230
- flexDirection: "row",
231
- alignItems: "center",
232
- gap: 8,
233
- paddingHorizontal: 12,
234
- paddingTop: 10,
235
- paddingBottom: 6
236
- },
237
- flex: {
238
- flex: 1
239
- },
240
- title: {
241
- flex: 1,
242
- color: _sharedUi.night.color.text,
243
- fontSize: _sharedUi.night.font.caption,
244
- fontWeight: "600"
245
- },
246
- badge: {
247
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
248
- borderRadius: _sharedUi.night.radius.badge,
249
- paddingHorizontal: 6,
250
- paddingVertical: 2
251
- },
252
- badgeText: {
253
- fontSize: 9,
254
- fontWeight: "700",
255
- letterSpacing: 0.6
256
- },
257
- more: {
258
- flexDirection: "row",
259
- alignItems: "center",
260
- justifyContent: "center",
261
- gap: 4,
262
- paddingVertical: 9,
263
- borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
264
- borderTopColor: _sharedUi.night.color.separator
265
- },
266
- moreText: {
267
- color: _sharedUi.night.color.textSecondary,
268
- fontSize: _sharedUi.night.font.caption,
269
- fontWeight: "600"
270
- },
271
- actions: {
272
- flexDirection: "row",
273
- gap: 8,
274
- paddingHorizontal: 12,
275
- paddingVertical: 10,
276
- flexWrap: "wrap"
277
- },
278
- actionsRight: {
279
- justifyContent: "flex-end"
280
- },
281
- button: {
282
- flexDirection: "row",
283
- alignItems: "center",
284
- gap: 6,
285
- paddingHorizontal: 14,
286
- paddingVertical: 9,
287
- borderRadius: _sharedUi.night.radius.row
288
- },
289
- buttonPrimary: {
290
- backgroundColor: _sharedUi.night.color.accent
291
- },
292
- buttonPlate: {
293
- backgroundColor: _sharedUi.night.color.button
294
- },
295
- buttonDisabled: {
296
- opacity: 0.55
297
- },
298
- buttonText: {
299
- fontSize: _sharedUi.night.font.caption,
300
- fontWeight: "600"
301
- },
302
- buttonTextPrimary: {
303
- color: _sharedUi.night.color.onAccent
304
- },
305
- buttonTextPlate: {
306
- color: _sharedUi.night.color.text
307
- },
308
- pressed: {
309
- opacity: 0.7
310
- }
311
- });
312
- //# sourceMappingURL=primitives.js.map
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,56 +1 @@
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, "ProvenanceBadge", {
25
- enumerable: true,
26
- get: function () {
27
- return _primitives.ProvenanceBadge;
28
- }
29
- });
30
- Object.defineProperty(exports, "blockStyles", {
31
- enumerable: true,
32
- get: function () {
33
- return _primitives.blockStyles;
34
- }
35
- });
36
- Object.defineProperty(exports, "toneColor", {
37
- enumerable: true,
38
- get: function () {
39
- return _primitives.toneColor;
40
- }
41
- });
42
- Object.defineProperty(exports, "useBlockHandlers", {
43
- enumerable: true,
44
- get: function () {
45
- return _context.useBlockHandlers;
46
- }
47
- });
48
- Object.defineProperty(exports, "useExpand", {
49
- enumerable: true,
50
- get: function () {
51
- return _primitives.useExpand;
52
- }
53
- });
54
- var _primitives = require("./primitives");
55
- var _context = require("./context");
56
- //# sourceMappingURL=primitivesIndex.js.map
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");