@buoy-gg/redux 2.1.12 → 2.1.13

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 (62) hide show
  1. package/lib/commonjs/index.js +1 -179
  2. package/lib/commonjs/preset.js +1 -98
  3. package/lib/commonjs/redux/components/ReduxActionButton.js +1 -129
  4. package/lib/commonjs/redux/components/ReduxActionDetailContent.js +1 -380
  5. package/lib/commonjs/redux/components/ReduxActionDetailView.js +1 -401
  6. package/lib/commonjs/redux/components/ReduxActionInfoView.js +1 -838
  7. package/lib/commonjs/redux/components/ReduxActionItem.js +1 -366
  8. package/lib/commonjs/redux/components/ReduxDetailViewToggle.js +1 -134
  9. package/lib/commonjs/redux/components/ReduxIcon.js +1 -18
  10. package/lib/commonjs/redux/components/ReduxModal.js +1 -530
  11. package/lib/commonjs/redux/components/index.js +1 -52
  12. package/lib/commonjs/redux/hooks/index.js +1 -25
  13. package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +1 -197
  14. package/lib/commonjs/redux/hooks/useReduxActions.js +1 -75
  15. package/lib/commonjs/redux/index.js +1 -49
  16. package/lib/commonjs/redux/utils/autoInstrument.js +1 -270
  17. package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +1 -166
  18. package/lib/commonjs/redux/utils/createReduxHistoryAdapter.js +1 -146
  19. package/lib/commonjs/redux/utils/index.js +1 -111
  20. package/lib/commonjs/redux/utils/reduxActionStore.js +1 -358
  21. package/lib/module/index.js +1 -87
  22. package/lib/module/preset.js +1 -94
  23. package/lib/module/redux/components/ReduxActionButton.js +1 -126
  24. package/lib/module/redux/components/ReduxActionDetailContent.js +1 -376
  25. package/lib/module/redux/components/ReduxActionDetailView.js +1 -397
  26. package/lib/module/redux/components/ReduxActionInfoView.js +1 -833
  27. package/lib/module/redux/components/ReduxActionItem.js +1 -362
  28. package/lib/module/redux/components/ReduxDetailViewToggle.js +1 -129
  29. package/lib/module/redux/components/ReduxIcon.js +1 -8
  30. package/lib/module/redux/components/ReduxModal.js +1 -525
  31. package/lib/module/redux/components/index.js +1 -7
  32. package/lib/module/redux/hooks/index.js +1 -4
  33. package/lib/module/redux/hooks/useAutoInstrumentRedux.js +1 -193
  34. package/lib/module/redux/hooks/useReduxActions.js +1 -71
  35. package/lib/module/redux/index.js +1 -13
  36. package/lib/module/redux/utils/autoInstrument.js +1 -260
  37. package/lib/module/redux/utils/buoyReduxMiddleware.js +1 -157
  38. package/lib/module/redux/utils/createReduxHistoryAdapter.js +1 -142
  39. package/lib/module/redux/utils/index.js +1 -8
  40. package/lib/module/redux/utils/reduxActionStore.js +1 -354
  41. package/package.json +4 -4
  42. package/lib/typescript/index.d.ts.map +0 -1
  43. package/lib/typescript/preset.d.ts.map +0 -1
  44. package/lib/typescript/redux/components/ReduxActionButton.d.ts.map +0 -1
  45. package/lib/typescript/redux/components/ReduxActionDetailContent.d.ts.map +0 -1
  46. package/lib/typescript/redux/components/ReduxActionDetailView.d.ts.map +0 -1
  47. package/lib/typescript/redux/components/ReduxActionInfoView.d.ts.map +0 -1
  48. package/lib/typescript/redux/components/ReduxActionItem.d.ts.map +0 -1
  49. package/lib/typescript/redux/components/ReduxDetailViewToggle.d.ts.map +0 -1
  50. package/lib/typescript/redux/components/ReduxIcon.d.ts.map +0 -1
  51. package/lib/typescript/redux/components/ReduxModal.d.ts.map +0 -1
  52. package/lib/typescript/redux/components/index.d.ts.map +0 -1
  53. package/lib/typescript/redux/hooks/index.d.ts.map +0 -1
  54. package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts.map +0 -1
  55. package/lib/typescript/redux/hooks/useReduxActions.d.ts.map +0 -1
  56. package/lib/typescript/redux/index.d.ts.map +0 -1
  57. package/lib/typescript/redux/types/index.d.ts.map +0 -1
  58. package/lib/typescript/redux/utils/autoInstrument.d.ts.map +0 -1
  59. package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts.map +0 -1
  60. package/lib/typescript/redux/utils/createReduxHistoryAdapter.d.ts.map +0 -1
  61. package/lib/typescript/redux/utils/index.d.ts.map +0 -1
  62. package/lib/typescript/redux/utils/reduxActionStore.d.ts.map +0 -1
@@ -1,366 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ReduxActionItem = ReduxActionItem;
7
- var _reactNative = require("react-native");
8
- var _sharedUi = require("@buoy-gg/shared-ui");
9
- var _reduxActionStore = require("../utils/reduxActionStore");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * Compact list item for displaying a Redux action
13
- * Uses shared CompactRow for consistent styling with React Query devtools
14
- */
15
-
16
- /**
17
- * Color palette for async operation badges
18
- * Each operation gets a distinct color to make matching easy
19
- */
20
- const OPERATION_COLORS = [{
21
- bg: "rgba(99, 102, 241, 0.25)",
22
- text: "#818CF8"
23
- },
24
- // indigo
25
- {
26
- bg: "rgba(236, 72, 153, 0.25)",
27
- text: "#F472B6"
28
- },
29
- // pink
30
- {
31
- bg: "rgba(14, 165, 233, 0.25)",
32
- text: "#38BDF8"
33
- },
34
- // sky
35
- {
36
- bg: "rgba(245, 158, 11, 0.25)",
37
- text: "#FBBF24"
38
- },
39
- // amber
40
- {
41
- bg: "rgba(16, 185, 129, 0.25)",
42
- text: "#34D399"
43
- },
44
- // emerald
45
- {
46
- bg: "rgba(168, 85, 247, 0.25)",
47
- text: "#C084FC"
48
- },
49
- // purple
50
- {
51
- bg: "rgba(239, 68, 68, 0.25)",
52
- text: "#F87171"
53
- },
54
- // red
55
- {
56
- bg: "rgba(20, 184, 166, 0.25)",
57
- text: "#2DD4BF"
58
- } // teal
59
- ];
60
- function getOperationColor(index) {
61
- if (index <= 0) return {
62
- bg: "rgba(142, 142, 147, 0.2)",
63
- text: _sharedUi.buoyColors.textSecondary
64
- };
65
- return OPERATION_COLORS[(index - 1) % OPERATION_COLORS.length];
66
- }
67
-
68
- /**
69
- * Slice color palette - consistent colors per slice name
70
- * Makes it easy to visually track actions from the same slice
71
- */
72
- const SLICE_COLORS = {
73
- cart: "#10B981",
74
- // emerald - shopping/commerce
75
- user: "#3B82F6",
76
- // blue - user related
77
- auth: "#8B5CF6",
78
- // purple - authentication
79
- app: "#6366F1",
80
- // indigo - app-wide
81
- ui: "#EC4899",
82
- // pink - UI state
83
- settings: "#F59E0B",
84
- // amber - settings
85
- api: "#14B8A6",
86
- // teal - API calls
87
- data: "#06B6D4" // cyan - data management
88
- };
89
-
90
- /**
91
- * Get consistent color for a slice based on its name
92
- */
93
- function getSliceColor(sliceName) {
94
- if (!sliceName) return "#6B7280"; // gray for unknown
95
-
96
- const lowerSlice = sliceName.toLowerCase();
97
-
98
- // Check for exact match first
99
- if (SLICE_COLORS[lowerSlice]) {
100
- return SLICE_COLORS[lowerSlice];
101
- }
102
-
103
- // Check for partial matches
104
- for (const [key, color] of Object.entries(SLICE_COLORS)) {
105
- if (lowerSlice.includes(key)) {
106
- return color;
107
- }
108
- }
109
-
110
- // Generate consistent color from slice name hash
111
- const hash = sliceName.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
112
- const hue = hash * 137 % 360;
113
- return `hsl(${hue}, 70%, 60%)`;
114
- }
115
-
116
- /**
117
- * Get status label based on category and slice
118
- */
119
- function getStatusLabel(category, sliceName) {
120
- switch (category) {
121
- case "pending":
122
- return "Pending";
123
- case "fulfilled":
124
- return "Success";
125
- case "rejected":
126
- return "Error";
127
- case "internal":
128
- return "Internal";
129
- case "query":
130
- return "Query";
131
- case "mutation":
132
- return "Mutation";
133
- default:
134
- // For regular actions, show slice name if available
135
- return sliceName ? sliceName.charAt(0).toUpperCase() + sliceName.slice(1) : "Action";
136
- }
137
- }
138
-
139
- /**
140
- * Get color for action category
141
- */
142
- function getStatusColor(category, hasStateChange, sliceName) {
143
- switch (category) {
144
- case "pending":
145
- return _sharedUi.buoyColors.warning;
146
- case "fulfilled":
147
- return _sharedUi.buoyColors.success;
148
- case "rejected":
149
- return _sharedUi.buoyColors.error;
150
- case "internal":
151
- return _sharedUi.buoyColors.textMuted;
152
- case "query":
153
- return _sharedUi.buoyColors.info;
154
- case "mutation":
155
- return _sharedUi.buoyColors.info;
156
- default:
157
- // For regular actions, use slice-based color
158
- return getSliceColor(sliceName);
159
- }
160
- }
161
-
162
- /**
163
- * Get sublabel with duration and diff info
164
- */
165
- function getSublabel(action) {
166
- const parts = [];
167
-
168
- // Add duration if available and meaningful
169
- if (action.duration !== undefined && action.duration >= 0.1) {
170
- parts.push(`${action.duration.toFixed(1)}ms`);
171
- }
172
-
173
- // Add diff summary - be more descriptive
174
- if (action.hasStateChange) {
175
- if (action.changedKeysCount && action.changedKeysCount > 0) {
176
- parts.push(`${action.changedKeysCount} key${action.changedKeysCount > 1 ? 's' : ''} changed`);
177
- } else {
178
- parts.push(action.diffSummary || "state changed");
179
- }
180
- } else {
181
- parts.push("no state change");
182
- }
183
- return parts.join(" · ");
184
- }
185
-
186
- /**
187
- * Get action name badge text
188
- */
189
- function getActionBadge(action) {
190
- // Show the action name in uppercase (e.g., ADDITEM, ORDERCOMPLETED)
191
- return action.actionName?.toUpperCase() || action.type.split('/').pop()?.toUpperCase() || "";
192
- }
193
-
194
- /**
195
- * Get primary text - use action name for cleaner display
196
- */
197
- function getPrimaryText(action) {
198
- // For internal actions, show the full type
199
- if (action.category === "internal") {
200
- return action.type;
201
- }
202
-
203
- // For others, show slice/actionName format
204
- if (action.sliceName) {
205
- return `${action.sliceName}/${action.actionName.toLowerCase()}`;
206
- }
207
- return action.type;
208
- }
209
- function ReduxActionItem({
210
- action,
211
- onPress
212
- }) {
213
- const relativeTime = (0, _sharedUi.useRelativeTime)(action.timestamp);
214
- const sliceName = action.sliceName ?? undefined;
215
- const statusColor = getStatusColor(action.category, action.hasStateChange, sliceName);
216
- const statusLabel = getStatusLabel(action.category, sliceName);
217
- const sublabel = getSublabel(action);
218
- const primaryText = getPrimaryText(action);
219
- const actionBadge = getActionBadge(action);
220
-
221
- // Check for linked async actions
222
- const linkedActions = _reduxActionStore.reduxActionStore.getLinkedActions(action);
223
- const linkedCount = linkedActions.length;
224
- const hasLinkedActions = linkedCount > 1;
225
-
226
- // Get position in async sequence (1/2, 2/2, etc.)
227
- const asyncPosition = hasLinkedActions ? linkedActions.findIndex(a => a.id === action.id) + 1 : 0;
228
-
229
- // Get sequential operation index to distinguish concurrent requests (#1, #2, etc.)
230
- const operationIndex = hasLinkedActions && action.meta?.requestId ? _reduxActionStore.reduxActionStore.getAsyncOperationIndex(action.meta.requestId) : 0;
231
-
232
- // Get color for this operation's badge
233
- const opColor = getOperationColor(operationIndex);
234
-
235
- // Custom badge showing state change, slow action, or linked indicator
236
- let customBadge = undefined;
237
- if (action.isSlowAction) {
238
- // Show slow action warning
239
- customBadge = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
240
- style: styles.badgeContainer,
241
- children: [hasLinkedActions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
242
- style: [styles.asyncSequenceBadge, {
243
- backgroundColor: opColor.bg
244
- }],
245
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
246
- style: [styles.asyncSequenceText, {
247
- color: opColor.text
248
- }],
249
- children: [asyncPosition, "/", linkedCount, " #", operationIndex]
250
- })
251
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
252
- style: styles.slowBadge,
253
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Clock, {
254
- size: 12,
255
- color: _sharedUi.buoyColors.error
256
- })
257
- })]
258
- });
259
- } else if (action.category === "rejected") {
260
- // Show error badge for rejected actions
261
- customBadge = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
262
- style: styles.badgeContainer,
263
- children: [hasLinkedActions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
264
- style: [styles.asyncSequenceBadge, {
265
- backgroundColor: opColor.bg
266
- }],
267
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
268
- style: [styles.asyncSequenceText, {
269
- color: opColor.text
270
- }],
271
- children: [asyncPosition, "/", linkedCount, " #", operationIndex]
272
- })
273
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
274
- style: styles.errorBadge,
275
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertCircle, {
276
- size: 12,
277
- color: _sharedUi.buoyColors.error
278
- })
279
- })]
280
- });
281
- } else if (hasLinkedActions) {
282
- // Show linked indicator for async actions
283
- customBadge = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
284
- style: styles.badgeContainer,
285
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
286
- style: [styles.asyncSequenceBadge, {
287
- backgroundColor: opColor.bg
288
- }],
289
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
290
- style: [styles.asyncSequenceText, {
291
- color: opColor.text
292
- }],
293
- children: [asyncPosition, "/", linkedCount, " #", operationIndex]
294
- })
295
- }), action.hasStateChange && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
296
- style: styles.changeBadge,
297
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Zap, {
298
- size: 12,
299
- color: _sharedUi.buoyColors.warning
300
- })
301
- })]
302
- });
303
- } else if (action.hasStateChange) {
304
- // Show state change indicator with action badge
305
- customBadge = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
306
- style: styles.badgeContainer,
307
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
308
- style: [styles.actionBadgeText, {
309
- color: statusColor
310
- }],
311
- children: actionBadge
312
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
313
- style: styles.changeBadge,
314
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Zap, {
315
- size: 12,
316
- color: _sharedUi.buoyColors.warning
317
- })
318
- })]
319
- });
320
- }
321
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CompactRow, {
322
- statusDotColor: statusColor,
323
- statusLabel: statusLabel,
324
- statusSublabel: sublabel,
325
- primaryText: primaryText,
326
- bottomRightText: relativeTime
327
- // Use customBadge if we have special indicators, otherwise show action badge as text
328
- ,
329
- customBadge: customBadge,
330
- badgeText: customBadge ? undefined : actionBadge,
331
- badgeColor: statusColor,
332
- showChevron: true,
333
- onPress: () => onPress(action)
334
- });
335
- }
336
- const styles = _reactNative.StyleSheet.create({
337
- badgeContainer: {
338
- flexDirection: "row",
339
- alignItems: "center",
340
- gap: 4
341
- },
342
- actionBadgeText: {
343
- fontSize: 11,
344
- fontWeight: "600",
345
- fontFamily: "monospace"
346
- },
347
- changeBadge: {
348
- paddingHorizontal: 4
349
- },
350
- slowBadge: {
351
- paddingHorizontal: 4
352
- },
353
- errorBadge: {
354
- paddingHorizontal: 4
355
- },
356
- asyncSequenceBadge: {
357
- paddingHorizontal: 6,
358
- paddingVertical: 2,
359
- borderRadius: 4
360
- },
361
- asyncSequenceText: {
362
- fontSize: 10,
363
- fontWeight: "600",
364
- fontFamily: "monospace"
365
- }
366
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReduxActionItem=ReduxActionItem;var _reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_reduxActionStore=require("../utils/reduxActionStore"),_jsxRuntime=require("react/jsx-runtime");const OPERATION_COLORS=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function getOperationColor(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:_sharedUi.buoyColors.textSecondary}:OPERATION_COLORS[(e-1)%OPERATION_COLORS.length]}const SLICE_COLORS={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function getSliceColor(e){if(!e)return"#6B7280";const t=e.toLowerCase();if(SLICE_COLORS[t])return SLICE_COLORS[t];for(const[e,r]of Object.entries(SLICE_COLORS))if(t.includes(e))return r;return`hsl(${137*e.split("").reduce((e,t)=>e+t.charCodeAt(0),0)%360}, 70%, 60%)`}function getStatusLabel(e,t){switch(e){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Action"}}function getStatusColor(e,t,r){switch(e){case"pending":return _sharedUi.buoyColors.warning;case"fulfilled":return _sharedUi.buoyColors.success;case"rejected":return _sharedUi.buoyColors.error;case"internal":return _sharedUi.buoyColors.textMuted;case"query":case"mutation":return _sharedUi.buoyColors.info;default:return getSliceColor(r)}}function getSublabel(e){const t=[];return void 0!==e.duration&&e.duration>=.1&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?e.changedKeysCount&&e.changedKeysCount>0?t.push(`${e.changedKeysCount} key${e.changedKeysCount>1?"s":""} changed`):t.push(e.diffSummary||"state changed"):t.push("no state change"),t.join(" · ")}function getActionBadge(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function getPrimaryText(e){return"internal"===e.category?e.type:e.sliceName?`${e.sliceName}/${e.actionName.toLowerCase()}`:e.type}function ReduxActionItem({action:e,onPress:t}){const r=(0,_sharedUi.useRelativeTime)(e.timestamp),s=e.sliceName??void 0,a=getStatusColor(e.category,e.hasStateChange,s),n=getStatusLabel(e.category,s),i=getSublabel(e),o=getPrimaryText(e),c=getActionBadge(e),u=_reduxActionStore.reduxActionStore.getLinkedActions(e),l=u.length,d=l>1,g=d?u.findIndex(t=>t.id===e.id)+1:0,x=d&&e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0,y=getOperationColor(x);let h;return e.isSlowAction?h=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[d&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",x]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.slowBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.buoyColors.error})})]}):"rejected"===e.category?h=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[d&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",x]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.buoyColors.error})})]}):d?h=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",x]})}),e.hasStateChange&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.buoyColors.warning})})]}):e.hasStateChange&&(h=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.actionBadgeText,{color:a}],children:c}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.buoyColors.warning})})]})),(0,_jsxRuntime.jsx)(_sharedUi.CompactRow,{statusDotColor:a,statusLabel:n,statusSublabel:i,primaryText:o,bottomRightText:r,customBadge:h,badgeText:h?void 0:c,badgeColor:a,showChevron:!0,onPress:()=>t(e)})}const styles=_reactNative.StyleSheet.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},actionBadgeText:{fontSize:11,fontWeight:"600",fontFamily:"monospace"},changeBadge:{paddingHorizontal:4},slowBadge:{paddingHorizontal:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:"monospace"}});
@@ -1,134 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ReduxDetailViewToggle = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
- /**
13
- * ReduxDetailViewToggle
14
- *
15
- * Three-card toggle for switching between Action, State, and Diff views.
16
- * Redux-specific component for the enhanced detail view.
17
- */
18
-
19
- const VIEW_CONFIGS = [{
20
- key: "action",
21
- label: "ACTION",
22
- description: "View action details",
23
- icon: _sharedUi.FileText,
24
- activeColor: _sharedUi.macOSColors.semantic.warning
25
- }, {
26
- key: "state",
27
- label: "STATE",
28
- description: "View current state",
29
- icon: _sharedUi.Database,
30
- activeColor: _sharedUi.macOSColors.semantic.info
31
- }, {
32
- key: "diff",
33
- label: "DIFF",
34
- description: "Compare changes",
35
- icon: _sharedUi.GitBranch,
36
- activeColor: _sharedUi.macOSColors.semantic.success
37
- }];
38
- const ReduxDetailViewToggle = exports.ReduxDetailViewToggle = /*#__PURE__*/(0, _react.memo)(function ReduxDetailViewToggle({
39
- activeView,
40
- onViewChange,
41
- diffDisabled = false
42
- }) {
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
44
- style: styles.container,
45
- children: VIEW_CONFIGS.map(config => {
46
- const isActive = activeView === config.key;
47
- const isDisabled = config.key === "diff" && diffDisabled;
48
- const IconComponent = config.icon;
49
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
50
- style: [styles.card, isActive && [styles.cardActive, {
51
- borderColor: config.activeColor
52
- }], isDisabled && styles.cardDisabled],
53
- onPress: () => !isDisabled && onViewChange(config.key),
54
- activeOpacity: isDisabled ? 1 : 0.8,
55
- disabled: isDisabled,
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
57
- style: styles.cardContent,
58
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
59
- size: 14,
60
- color: isActive ? config.activeColor : isDisabled ? _sharedUi.macOSColors.text.muted : _sharedUi.macOSColors.text.secondary
61
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
62
- style: [styles.cardLabel, isActive && [styles.cardLabelActive, {
63
- color: config.activeColor
64
- }], isDisabled && styles.cardLabelDisabled],
65
- children: config.label
66
- })]
67
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
68
- style: [styles.cardDescription, isActive && styles.cardDescriptionActive, isDisabled && styles.cardDescriptionDisabled],
69
- children: config.description
70
- })]
71
- }, config.key);
72
- })
73
- });
74
- });
75
- const styles = _reactNative.StyleSheet.create({
76
- container: {
77
- flexDirection: "row",
78
- gap: 8,
79
- padding: 14,
80
- backgroundColor: _sharedUi.macOSColors.background.base
81
- },
82
- card: {
83
- flex: 1,
84
- backgroundColor: _sharedUi.macOSColors.background.card,
85
- borderRadius: 12,
86
- borderWidth: 1,
87
- borderColor: _sharedUi.macOSColors.border.default,
88
- padding: 10,
89
- gap: 4
90
- },
91
- cardActive: {
92
- borderWidth: 1.5,
93
- backgroundColor: "rgba(0, 184, 230, 0.05)",
94
- shadowColor: _sharedUi.macOSColors.semantic.info,
95
- shadowOffset: {
96
- width: 0,
97
- height: 2
98
- },
99
- shadowOpacity: 0.1,
100
- shadowRadius: 8,
101
- elevation: 3
102
- },
103
- cardDisabled: {
104
- opacity: 0.5
105
- },
106
- cardContent: {
107
- flexDirection: "row",
108
- alignItems: "center",
109
- gap: 6
110
- },
111
- cardLabel: {
112
- fontSize: 10,
113
- fontWeight: "700",
114
- letterSpacing: 0.5,
115
- color: _sharedUi.macOSColors.text.secondary
116
- },
117
- cardLabelActive: {
118
- color: _sharedUi.macOSColors.text.primary
119
- },
120
- cardLabelDisabled: {
121
- color: _sharedUi.macOSColors.text.muted
122
- },
123
- cardDescription: {
124
- fontSize: 9,
125
- color: _sharedUi.macOSColors.text.muted,
126
- lineHeight: 12
127
- },
128
- cardDescriptionActive: {
129
- color: _sharedUi.macOSColors.text.secondary
130
- },
131
- cardDescriptionDisabled: {
132
- color: _sharedUi.macOSColors.text.muted
133
- }
134
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReduxDetailViewToggle=void 0;var _react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var t=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(e,r){if(!r&&e&&e.__esModule)return e;var i,o,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(i=r?a:t){if(i.has(e))return i.get(e);i.set(e,s)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(o.get||o.set)?i(s,r,o):s[r]=e[r]);return s})(e,r)}const VIEW_CONFIGS=[{key:"action",label:"ACTION",description:"View action details",icon:_sharedUi.FileText,activeColor:_sharedUi.macOSColors.semantic.warning},{key:"state",label:"STATE",description:"View current state",icon:_sharedUi.Database,activeColor:_sharedUi.macOSColors.semantic.info},{key:"diff",label:"DIFF",description:"Compare changes",icon:_sharedUi.GitBranch,activeColor:_sharedUi.macOSColors.semantic.success}],ReduxDetailViewToggle=exports.ReduxDetailViewToggle=(0,_react.memo)(function({activeView:e,onViewChange:r,diffDisabled:t=!1}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:VIEW_CONFIGS.map(a=>{const i=e===a.key,o="diff"===a.key&&t,s=a.icon;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.card,i&&[styles.cardActive,{borderColor:a.activeColor}],o&&styles.cardDisabled],onPress:()=>!o&&r(a.key),activeOpacity:o?1:.8,disabled:o,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(s,{size:14,color:i?a.activeColor:o?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.text.secondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cardLabel,i&&[styles.cardLabelActive,{color:a.activeColor}],o&&styles.cardLabelDisabled],children:a.label})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cardDescription,i&&styles.cardDescriptionActive,o&&styles.cardDescriptionDisabled],children:a.description})]},a.key)})})}),styles=_reactNative.StyleSheet.create({container:{flexDirection:"row",gap:8,padding:14,backgroundColor:_sharedUi.macOSColors.background.base},card:{flex:1,backgroundColor:_sharedUi.macOSColors.background.card,borderRadius:12,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,padding:10,gap:4},cardActive:{borderWidth:1.5,backgroundColor:"rgba(0, 184, 230, 0.05)",shadowColor:_sharedUi.macOSColors.semantic.info,shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:8,elevation:3},cardDisabled:{opacity:.5},cardContent:{flexDirection:"row",alignItems:"center",gap:6},cardLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5,color:_sharedUi.macOSColors.text.secondary},cardLabelActive:{color:_sharedUi.macOSColors.text.primary},cardLabelDisabled:{color:_sharedUi.macOSColors.text.muted},cardDescription:{fontSize:9,color:_sharedUi.macOSColors.text.muted,lineHeight:12},cardDescriptionActive:{color:_sharedUi.macOSColors.text.secondary},cardDescriptionDisabled:{color:_sharedUi.macOSColors.text.muted}});
@@ -1,18 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "REDUX_ICON_COLOR", {
7
- enumerable: true,
8
- get: function () {
9
- return _floatingToolsCore.REDUX_ICON_COLOR;
10
- }
11
- });
12
- Object.defineProperty(exports, "ReduxIcon", {
13
- enumerable: true,
14
- get: function () {
15
- return _floatingToolsCore.ReduxIcon;
16
- }
17
- });
18
- var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"REDUX_ICON_COLOR",{enumerable:!0,get:function(){return _floatingToolsCore.REDUX_ICON_COLOR}}),Object.defineProperty(exports,"ReduxIcon",{enumerable:!0,get:function(){return _floatingToolsCore.ReduxIcon}});var _floatingToolsCore=require("@buoy-gg/floating-tools-core");