@buoy-gg/redux 2.1.15 → 3.0.0

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 (68) hide show
  1. package/lib/commonjs/index.js +186 -1
  2. package/lib/commonjs/preset.js +98 -1
  3. package/lib/commonjs/redux/components/ReduxActionButton.js +129 -1
  4. package/lib/commonjs/redux/components/ReduxActionDetailContent.js +380 -1
  5. package/lib/commonjs/redux/components/ReduxActionDetailView.js +401 -1
  6. package/lib/commonjs/redux/components/ReduxActionInfoView.js +838 -1
  7. package/lib/commonjs/redux/components/ReduxActionItem.js +366 -1
  8. package/lib/commonjs/redux/components/ReduxDetailViewToggle.js +134 -1
  9. package/lib/commonjs/redux/components/ReduxIcon.js +18 -1
  10. package/lib/commonjs/redux/components/ReduxModal.js +531 -1
  11. package/lib/commonjs/redux/components/index.js +52 -1
  12. package/lib/commonjs/redux/hooks/index.js +25 -1
  13. package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +197 -1
  14. package/lib/commonjs/redux/hooks/useReduxActions.js +75 -1
  15. package/lib/commonjs/redux/index.js +49 -1
  16. package/lib/commonjs/redux/sync/reduxSyncAdapter.js +26 -0
  17. package/lib/commonjs/redux/utils/autoInstrument.js +270 -1
  18. package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +166 -1
  19. package/lib/commonjs/redux/utils/createReduxHistoryAdapter.js +146 -1
  20. package/lib/commonjs/redux/utils/index.js +111 -1
  21. package/lib/commonjs/redux/utils/reduxActionStore.js +413 -1
  22. package/lib/module/index.js +92 -1
  23. package/lib/module/preset.js +94 -1
  24. package/lib/module/redux/components/ReduxActionButton.js +126 -1
  25. package/lib/module/redux/components/ReduxActionDetailContent.js +376 -1
  26. package/lib/module/redux/components/ReduxActionDetailView.js +397 -1
  27. package/lib/module/redux/components/ReduxActionInfoView.js +833 -1
  28. package/lib/module/redux/components/ReduxActionItem.js +362 -1
  29. package/lib/module/redux/components/ReduxDetailViewToggle.js +129 -1
  30. package/lib/module/redux/components/ReduxIcon.js +8 -1
  31. package/lib/module/redux/components/ReduxModal.js +526 -1
  32. package/lib/module/redux/components/index.js +7 -1
  33. package/lib/module/redux/hooks/index.js +4 -1
  34. package/lib/module/redux/hooks/useAutoInstrumentRedux.js +193 -1
  35. package/lib/module/redux/hooks/useReduxActions.js +71 -1
  36. package/lib/module/redux/index.js +13 -1
  37. package/lib/module/redux/sync/reduxSyncAdapter.js +23 -0
  38. package/lib/module/redux/utils/autoInstrument.js +260 -1
  39. package/lib/module/redux/utils/buoyReduxMiddleware.js +157 -1
  40. package/lib/module/redux/utils/createReduxHistoryAdapter.js +142 -1
  41. package/lib/module/redux/utils/index.js +8 -1
  42. package/lib/module/redux/utils/reduxActionStore.js +409 -1
  43. package/lib/typescript/index.d.ts +1 -0
  44. package/lib/typescript/index.d.ts.map +1 -0
  45. package/lib/typescript/preset.d.ts.map +1 -0
  46. package/lib/typescript/redux/components/ReduxActionButton.d.ts.map +1 -0
  47. package/lib/typescript/redux/components/ReduxActionDetailContent.d.ts.map +1 -0
  48. package/lib/typescript/redux/components/ReduxActionDetailView.d.ts.map +1 -0
  49. package/lib/typescript/redux/components/ReduxActionInfoView.d.ts.map +1 -0
  50. package/lib/typescript/redux/components/ReduxActionItem.d.ts.map +1 -0
  51. package/lib/typescript/redux/components/ReduxDetailViewToggle.d.ts.map +1 -0
  52. package/lib/typescript/redux/components/ReduxIcon.d.ts.map +1 -0
  53. package/lib/typescript/redux/components/ReduxModal.d.ts.map +1 -0
  54. package/lib/typescript/redux/components/index.d.ts.map +1 -0
  55. package/lib/typescript/redux/hooks/index.d.ts.map +1 -0
  56. package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts.map +1 -0
  57. package/lib/typescript/redux/hooks/useReduxActions.d.ts.map +1 -0
  58. package/lib/typescript/redux/index.d.ts.map +1 -0
  59. package/lib/typescript/redux/sync/reduxSyncAdapter.d.ts +18 -0
  60. package/lib/typescript/redux/sync/reduxSyncAdapter.d.ts.map +1 -0
  61. package/lib/typescript/redux/types/index.d.ts.map +1 -0
  62. package/lib/typescript/redux/utils/autoInstrument.d.ts.map +1 -0
  63. package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts.map +1 -0
  64. package/lib/typescript/redux/utils/createReduxHistoryAdapter.d.ts.map +1 -0
  65. package/lib/typescript/redux/utils/index.d.ts.map +1 -0
  66. package/lib/typescript/redux/utils/reduxActionStore.d.ts +25 -0
  67. package/lib/typescript/redux/utils/reduxActionStore.d.ts.map +1 -0
  68. package/package.json +4 -4
@@ -1 +1,526 @@
1
- "use strict";import{useState,useMemo,useRef,useCallback}from"react";import{View,Text,StyleSheet,FlatList,TextInput,TouchableOpacity}from"react-native";import{JsModal,ModalHeader,macOSColors,buoyColors,Search,Trash2,Power,X,Zap,CheckCircle,Copy,Lock,AlertTriangle,devToolsStorageKeys,copyToClipboard,ProUpgradeModal,PowerToggleButton,TickProvider}from"@buoy-gg/shared-ui";import{useIsPro}from"@buoy-gg/license";import{useReduxActions}from"../hooks/useReduxActions";import{useAutoInstrumentRedux}from"../hooks/useAutoInstrumentRedux";import{ReduxActionItem}from"./ReduxActionItem";import{ReduxActionDetailContent,ReduxActionDetailFooter}from"./ReduxActionDetailContent";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const FREE_TIER_ACTION_LIMIT=25;function EmptyState({isEnabled:e}){return _jsxs(View,{style:styles.emptyState,children:[_jsx(Zap,{size:32,color:macOSColors.text.muted}),_jsx(Text,{style:styles.emptyTitle,children:"No Redux actions"}),_jsx(Text,{style:styles.emptyText,children:e?"Actions will appear here as they are dispatched":"Enable capture to start recording actions"})]})}export function ReduxModal({visible:e,onClose:o,onBack:t,onMinimize:r,enableSharedModalDimensions:a=!1}){const s=useIsPro(),[l,n]=useState(!1),{isInstrumented:i,isLoading:c,error:d,isReactReduxAvailable:u}=useAutoInstrumentRedux(),{filteredActions:h,filter:m,setFilter:x,stats:g,clearActions:C,isEnabled:p,toggleCapture:y}=useReduxActions(),b=useMemo(()=>s?h:h.slice(0,25),[h,s]),S=useMemo(()=>s?0:Math.max(0,h.length-25),[h.length,s]),f=S>0,[T,_]=useState(null),j=useRef([]);j.current=b;const O=null!==T?b[T]:null,[k,A]=useState(""),[R,w]=useState(!1),B=useRef(null),I=useRef(null),z=useCallback(e=>{},[]),v=e=>{A(e),x(o=>({...o,searchText:e}))},P=useCallback(e=>{const o=j.current.findIndex(o=>o.id===e.id);_(o>=0?o:0)},[]),M=useCallback(()=>{n(!0)},[]),V=useCallback(()=>{_(null)},[]),W=useCallback(e=>{_(e)},[]),D=useCallback(e=>e.id,[]),E=useCallback(({item:e})=>_jsx(ReduxActionItem,{action:e,onPress:P}),[P]),H=a?devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!e)return null;const L=O&&null!==T?_jsx(ReduxActionDetailFooter,{action:O,actions:b,selectedIndex:T,onIndexChange:W}):null,F=O&&b.length>1?68:0;return _jsxs(TickProvider,{children:[_jsx(JsModal,{visible:e,onClose:o,onMinimize:r,persistenceKey:H,header:{showToggleButton:!0,customContent:_jsxs(ModalHeader,O?{children:[_jsx(ModalHeader.Navigation,{onBack:V}),_jsx(ModalHeader.Content,{title:O.type,centered:!0})]}:{children:[t&&_jsx(ModalHeader.Navigation,{onBack:t}),_jsx(ModalHeader.Content,{title:"",children:_jsxs(View,R?{style:styles.headerSearchContainer,children:[_jsx(Search,{size:14,color:macOSColors.text.secondary}),_jsx(TextInput,{ref:B,style:styles.headerSearchInput,placeholder:"Search action types...",placeholderTextColor:macOSColors.text.muted,value:k,onChangeText:v,onSubmitEditing:()=>w(!1),onBlur:()=>w(!1),autoCapitalize:"none",autoCorrect:!1,returnKeyType:"search"}),k.length>0&&_jsx(TouchableOpacity,{onPress:()=>{v(""),w(!1)},style:styles.headerSearchClear,children:_jsx(X,{size:14,color:macOSColors.text.secondary})})]}:{style:styles.headerChipRow,children:[_jsxs(TouchableOpacity,{style:[styles.headerChip,!m.onlyWithChanges&&styles.headerChipActive],onPress:()=>x(e=>({...e,onlyWithChanges:!1})),children:[_jsx(Text,{style:styles.headerChipLabel,children:"ALL"}),_jsx(Text,{style:[styles.headerChipValue,{color:macOSColors.text.primary}],children:g.totalActions})]}),_jsxs(TouchableOpacity,{style:[styles.headerChip,m.onlyWithChanges&&styles.headerChipActive],onPress:()=>x(e=>({...e,onlyWithChanges:!0})),children:[_jsx(Zap,{size:12,color:macOSColors.semantic.warning}),_jsx(Text,{style:[styles.headerChipValue,{color:macOSColors.semantic.warning}],children:g.actionsWithChanges})]}),_jsxs(View,{style:styles.headerChip,children:[_jsx(CheckCircle,{size:12,color:macOSColors.semantic.success}),_jsx(Text,{style:[styles.headerChipValue,{color:macOSColors.semantic.success}],children:g.uniqueActionTypes})]})]})}),_jsxs(ModalHeader.Actions,{children:[_jsx(TouchableOpacity,{onPress:()=>w(!0),style:styles.headerActionButton,children:_jsx(Search,{size:14,color:macOSColors.text.secondary})}),_jsx(TouchableOpacity,{onPress:async()=>{if(!s)return void n(!0);const e=h.map(e=>({id:e.id,type:e.type,...void 0!==e.payload&&{payload:e.payload},timestamp:e.timestamp,prevState:e.prevState,nextState:e.nextState,hasStateChange:e.hasStateChange}));await copyToClipboard(e)},style:[styles.headerActionButton,0===h.length&&styles.headerActionButtonDisabled],disabled:0===h.length,children:_jsx(Copy,{size:14,color:h.length>0?macOSColors.text.secondary:macOSColors.text.disabled})}),_jsx(PowerToggleButton,{isEnabled:p,onToggle:y,accessibilityLabel:"Toggle Redux action capture"}),_jsx(TouchableOpacity,{onPress:C,style:[styles.headerActionButton,0===h.length&&styles.headerActionButtonDisabled],disabled:0===h.length,children:_jsx(Trash2,{size:14,color:h.length>0?macOSColors.text.muted:macOSColors.text.disabled})})]})]})},onModeChange:z,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:L,footerHeight:F,children:_jsx(View,{style:styles.container,children:O&&null!==T?_jsx(ReduxActionDetailContent,{action:O,actions:b,selectedIndex:T,onIndexChange:W,disableInternalFooter:!0}):_jsxs(_Fragment,{children:[d&&!i&&_jsxs(View,{style:styles.errorBanner,children:[_jsx(AlertTriangle,{size:14,color:macOSColors.semantic.error}),_jsx(Text,{style:styles.errorText,children:u?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!p&&i&&_jsxs(View,{style:styles.disabledBanner,children:[_jsx(Power,{size:14,color:macOSColors.semantic.warning}),_jsx(Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),f&&_jsxs(TouchableOpacity,{style:styles.lockedBanner,onPress:M,activeOpacity:.8,children:[_jsx(Lock,{size:14,color:buoyColors.primary}),_jsxs(Text,{style:styles.lockedText,children:[S," older ",1===S?"action":"actions"," locked"]}),_jsx(View,{style:styles.upgradeBadge,children:_jsx(Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),b.length>0?_jsx(FlatList,{ref:I,data:b,renderItem:E,keyExtractor:D,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:!0,removeClippedSubviews:!0,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1}):_jsx(EmptyState,{isEnabled:p})]})})}),_jsx(ProUpgradeModal,{visible:l,onClose:()=>n(!1),featureName:"Full Action History"})]})}const styles=StyleSheet.create({container:{flex:1,backgroundColor:macOSColors.background.base},headerSearchContainer:{flexDirection:"row",alignItems:"center",backgroundColor:macOSColors.background.input,borderRadius:10,borderWidth:1,borderColor:macOSColors.border.default,paddingHorizontal:12,paddingVertical:5},headerSearchInput:{flex:1,color:macOSColors.text.primary,fontSize:13,marginLeft:6,paddingVertical:2},headerSearchClear:{marginLeft:6,padding:4},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:macOSColors.background.hover,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:macOSColors.border.default},headerChipActive:{backgroundColor:macOSColors.semantic.infoBackground,borderColor:macOSColors.semantic.info+"50"},headerChipLabel:{fontSize:10,fontWeight:"700",color:macOSColors.text.muted},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:"monospace"},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:macOSColors.background.hover,borderWidth:1,borderColor:macOSColors.border.default,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},startButton:{backgroundColor:macOSColors.semantic.successBackground,borderColor:macOSColors.semantic.success+"40"},stopButton:{backgroundColor:macOSColors.semantic.errorBackground,borderColor:macOSColors.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:macOSColors.semantic.errorBackground,borderRadius:8,borderWidth:1,borderColor:macOSColors.semantic.error+"20"},errorText:{color:macOSColors.semantic.error,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:macOSColors.semantic.warning+"20"},disabledText:{color:macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},emptyState:{alignItems:"center",paddingVertical:40},emptyTitle:{color:macOSColors.text.primary,fontSize:14,fontWeight:"600",marginTop:12,marginBottom:6},emptyText:{color:macOSColors.text.muted,fontSize:12,textAlign:"center"},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:buoyColors.primary+"15",borderRadius:8,borderWidth:1,borderColor:buoyColors.primary+"33"},lockedText:{color:buoyColors.primary,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:buoyColors.primary,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:"#fff",fontSize:9,fontWeight:"700",letterSpacing:.5}});
1
+ "use strict";
2
+
3
+ /**
4
+ * Main Redux DevTools modal
5
+ *
6
+ * This component auto-instruments the Redux store when it mounts,
7
+ * providing zero-config action capture for the DevTools.
8
+ */
9
+
10
+ import { useState, useMemo, useRef, useCallback } from "react";
11
+ import { View, Text, StyleSheet, FlatList, TextInput, TouchableOpacity } from "react-native";
12
+ import { JsModal, ModalHeader, macOSColors, buoyColors, Search, Trash2, Power, X, Zap, CheckCircle, Copy, Lock, AlertTriangle, devToolsStorageKeys, copyToClipboard, ProUpgradeModal, PowerToggleButton, TickProvider } from "@buoy-gg/shared-ui";
13
+ import { useIsPro } from "@buoy-gg/license";
14
+ import { useReduxActions } from "../hooks/useReduxActions";
15
+ import { reduxActionStore } from "../utils/reduxActionStore";
16
+ import { useAutoInstrumentRedux } from "../hooks/useAutoInstrumentRedux";
17
+ import { ReduxActionItem } from "./ReduxActionItem";
18
+ import { ReduxActionDetailContent, ReduxActionDetailFooter } from "./ReduxActionDetailContent";
19
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
20
+ /** Free tier limit for action history */
21
+ export const FREE_TIER_ACTION_LIMIT = 25;
22
+ function EmptyState({
23
+ isEnabled
24
+ }) {
25
+ return /*#__PURE__*/_jsxs(View, {
26
+ style: styles.emptyState,
27
+ children: [/*#__PURE__*/_jsx(Zap, {
28
+ size: 32,
29
+ color: macOSColors.text.muted
30
+ }), /*#__PURE__*/_jsx(Text, {
31
+ style: styles.emptyTitle,
32
+ children: "No Redux actions"
33
+ }), /*#__PURE__*/_jsx(Text, {
34
+ style: styles.emptyText,
35
+ children: isEnabled ? "Actions will appear here as they are dispatched" : "Enable capture to start recording actions"
36
+ })]
37
+ });
38
+ }
39
+ export function ReduxModal({
40
+ visible,
41
+ onClose,
42
+ onBack,
43
+ onMinimize,
44
+ enableSharedModalDimensions = false
45
+ }) {
46
+ const isPro = useIsPro();
47
+ const [showProModal, setShowProModal] = useState(false);
48
+
49
+ // Auto-instrument the Redux store (zero-config)
50
+ const {
51
+ isInstrumented,
52
+ isLoading: isInstrumentLoading,
53
+ error: instrumentError,
54
+ isReactReduxAvailable
55
+ } = useAutoInstrumentRedux();
56
+ const {
57
+ filteredActions,
58
+ filter,
59
+ setFilter,
60
+ stats,
61
+ clearActions,
62
+ isEnabled,
63
+ toggleCapture
64
+ } = useReduxActions();
65
+
66
+ // For free users, limit visible actions to FREE_TIER_ACTION_LIMIT
67
+ const visibleActions = useMemo(() => {
68
+ if (isPro) return filteredActions;
69
+ return filteredActions.slice(0, FREE_TIER_ACTION_LIMIT);
70
+ }, [filteredActions, isPro]);
71
+
72
+ // Calculate how many actions are locked
73
+ const lockedActionCount = useMemo(() => {
74
+ if (isPro) return 0;
75
+ return Math.max(0, filteredActions.length - FREE_TIER_ACTION_LIMIT);
76
+ }, [filteredActions.length, isPro]);
77
+ const hasLockedActions = lockedActionCount > 0;
78
+
79
+ // Selection state - track index for navigation
80
+ const [selectedActionIndex, setSelectedActionIndex] = useState(null);
81
+ const actionsRef = useRef([]);
82
+
83
+ // Keep actions ref in sync (using visible actions for navigation)
84
+ actionsRef.current = visibleActions;
85
+
86
+ // Get selected action from index
87
+ const selectedAction = selectedActionIndex !== null ? visibleActions[selectedActionIndex] : null;
88
+ const [searchText, setSearchText] = useState("");
89
+ const [isSearchActive, setIsSearchActive] = useState(false);
90
+ const searchInputRef = useRef(null);
91
+ const flatListRef = useRef(null);
92
+ const handleModeChange = useCallback(_mode => {
93
+ // Mode changes handled by JsModal
94
+ }, []);
95
+ const handleSearch = text => {
96
+ setSearchText(text);
97
+ setFilter(prev => ({
98
+ ...prev,
99
+ searchText: text
100
+ }));
101
+ };
102
+ const handleActionPress = useCallback(action => {
103
+ const index = actionsRef.current.findIndex(a => a.id === action.id);
104
+ setSelectedActionIndex(index >= 0 ? index : 0);
105
+ }, []);
106
+ const handleUpgradePress = useCallback(() => {
107
+ setShowProModal(true);
108
+ }, []);
109
+ const handleBack = useCallback(() => {
110
+ setSelectedActionIndex(null);
111
+ }, []);
112
+ const handleIndexChange = useCallback(newIndex => {
113
+ setSelectedActionIndex(newIndex);
114
+ }, []);
115
+ const handleCopyAll = async () => {
116
+ if (!isPro) {
117
+ setShowProModal(true);
118
+ return;
119
+ }
120
+ const actionsData = filteredActions.map(action => ({
121
+ id: action.id,
122
+ type: action.type,
123
+ ...(action.payload !== undefined && {
124
+ payload: action.payload
125
+ }),
126
+ timestamp: action.timestamp,
127
+ prevState: action.prevState,
128
+ nextState: action.nextState,
129
+ hasStateChange: action.hasStateChange
130
+ }));
131
+ await copyToClipboard(actionsData);
132
+ };
133
+
134
+ // FlatList optimization
135
+ const keyExtractor = useCallback(item => item.id, []);
136
+ const renderItem = useCallback(({
137
+ item
138
+ }) => {
139
+ return /*#__PURE__*/_jsx(ReduxActionItem, {
140
+ action: item,
141
+ onPress: handleActionPress
142
+ });
143
+ }, [handleActionPress]);
144
+ const renderHeaderContent = () => {
145
+ // Detail view header - show action type
146
+ if (selectedAction) {
147
+ return /*#__PURE__*/_jsxs(ModalHeader, {
148
+ children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
149
+ onBack: handleBack
150
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
151
+ title: selectedAction.type,
152
+ centered: true
153
+ })]
154
+ });
155
+ }
156
+
157
+ // Main list view header
158
+ return /*#__PURE__*/_jsxs(ModalHeader, {
159
+ children: [onBack && /*#__PURE__*/_jsx(ModalHeader.Navigation, {
160
+ onBack: onBack
161
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
162
+ title: "",
163
+ children: isSearchActive ? /*#__PURE__*/_jsxs(View, {
164
+ style: styles.headerSearchContainer,
165
+ children: [/*#__PURE__*/_jsx(Search, {
166
+ size: 14,
167
+ color: macOSColors.text.secondary
168
+ }), /*#__PURE__*/_jsx(TextInput, {
169
+ ref: searchInputRef,
170
+ style: styles.headerSearchInput,
171
+ placeholder: "Search action types...",
172
+ placeholderTextColor: macOSColors.text.muted,
173
+ value: searchText,
174
+ onChangeText: handleSearch,
175
+ onSubmitEditing: () => setIsSearchActive(false),
176
+ onBlur: () => setIsSearchActive(false),
177
+ autoCapitalize: "none",
178
+ autoCorrect: false,
179
+ returnKeyType: "search"
180
+ }), searchText.length > 0 && /*#__PURE__*/_jsx(TouchableOpacity, {
181
+ onPress: () => {
182
+ handleSearch("");
183
+ setIsSearchActive(false);
184
+ },
185
+ style: styles.headerSearchClear,
186
+ children: /*#__PURE__*/_jsx(X, {
187
+ size: 14,
188
+ color: macOSColors.text.secondary
189
+ })
190
+ })]
191
+ }) : /*#__PURE__*/_jsxs(View, {
192
+ style: styles.headerChipRow,
193
+ children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
194
+ style: [styles.headerChip, !filter.onlyWithChanges && styles.headerChipActive],
195
+ onPress: () => setFilter(prev => ({
196
+ ...prev,
197
+ onlyWithChanges: false
198
+ })),
199
+ children: [/*#__PURE__*/_jsx(Text, {
200
+ style: styles.headerChipLabel,
201
+ children: "ALL"
202
+ }), /*#__PURE__*/_jsx(Text, {
203
+ style: [styles.headerChipValue, {
204
+ color: macOSColors.text.primary
205
+ }],
206
+ children: stats.totalActions
207
+ })]
208
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
209
+ style: [styles.headerChip, filter.onlyWithChanges && styles.headerChipActive],
210
+ onPress: () => setFilter(prev => ({
211
+ ...prev,
212
+ onlyWithChanges: true
213
+ })),
214
+ children: [/*#__PURE__*/_jsx(Zap, {
215
+ size: 12,
216
+ color: macOSColors.semantic.warning
217
+ }), /*#__PURE__*/_jsx(Text, {
218
+ style: [styles.headerChipValue, {
219
+ color: macOSColors.semantic.warning
220
+ }],
221
+ children: stats.actionsWithChanges
222
+ })]
223
+ }), /*#__PURE__*/_jsxs(View, {
224
+ style: styles.headerChip,
225
+ children: [/*#__PURE__*/_jsx(CheckCircle, {
226
+ size: 12,
227
+ color: macOSColors.semantic.success
228
+ }), /*#__PURE__*/_jsx(Text, {
229
+ style: [styles.headerChipValue, {
230
+ color: macOSColors.semantic.success
231
+ }],
232
+ children: stats.uniqueActionTypes
233
+ })]
234
+ })]
235
+ })
236
+ }), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
237
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
238
+ onPress: () => setIsSearchActive(true),
239
+ style: styles.headerActionButton,
240
+ children: /*#__PURE__*/_jsx(Search, {
241
+ size: 14,
242
+ color: macOSColors.text.secondary
243
+ })
244
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
245
+ onPress: handleCopyAll,
246
+ style: [styles.headerActionButton, filteredActions.length === 0 && styles.headerActionButtonDisabled],
247
+ disabled: filteredActions.length === 0,
248
+ children: /*#__PURE__*/_jsx(Copy, {
249
+ size: 14,
250
+ color: filteredActions.length > 0 ? macOSColors.text.secondary : macOSColors.text.disabled
251
+ })
252
+ }), /*#__PURE__*/_jsx(PowerToggleButton, {
253
+ isEnabled: isEnabled,
254
+ onToggle: toggleCapture,
255
+ accessibilityLabel: "Toggle Redux action capture"
256
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
257
+ onPress: clearActions,
258
+ style: [styles.headerActionButton, filteredActions.length === 0 && styles.headerActionButtonDisabled],
259
+ disabled: filteredActions.length === 0,
260
+ children: /*#__PURE__*/_jsx(Trash2, {
261
+ size: 14,
262
+ color: filteredActions.length > 0 ? macOSColors.text.muted : macOSColors.text.disabled
263
+ })
264
+ })]
265
+ })]
266
+ });
267
+ };
268
+ const persistenceKey = enableSharedModalDimensions ? devToolsStorageKeys.modal.root() : "buoy-redux-modal";
269
+ if (!visible) return null;
270
+
271
+ // Footer for detail view navigation
272
+ const footerNode = selectedAction && selectedActionIndex !== null ? /*#__PURE__*/_jsx(ReduxActionDetailFooter, {
273
+ action: selectedAction,
274
+ actions: visibleActions,
275
+ selectedIndex: selectedActionIndex,
276
+ onIndexChange: handleIndexChange
277
+ }) : null;
278
+ const footerHeight = selectedAction && visibleActions.length > 1 ? 68 : 0;
279
+ return /*#__PURE__*/_jsxs(TickProvider, {
280
+ children: [/*#__PURE__*/_jsx(JsModal, {
281
+ visible: visible,
282
+ onClose: onClose,
283
+ onMinimize: onMinimize,
284
+ persistenceKey: persistenceKey,
285
+ header: {
286
+ showToggleButton: true,
287
+ customContent: renderHeaderContent()
288
+ },
289
+ onModeChange: handleModeChange,
290
+ enablePersistence: true,
291
+ initialMode: "bottomSheet",
292
+ enableGlitchEffects: true,
293
+ styles: {},
294
+ footer: footerNode,
295
+ footerHeight: footerHeight,
296
+ children: /*#__PURE__*/_jsx(View, {
297
+ style: styles.container,
298
+ children: selectedAction && selectedActionIndex !== null ? /*#__PURE__*/_jsx(ReduxActionDetailContent, {
299
+ action: selectedAction,
300
+ actions: visibleActions,
301
+ selectedIndex: selectedActionIndex,
302
+ onIndexChange: handleIndexChange,
303
+ disableInternalFooter: true
304
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
305
+ children: [instrumentError && !isInstrumented && !reduxActionStore.isCaptureSuppressed() && /*#__PURE__*/_jsxs(View, {
306
+ style: styles.errorBanner,
307
+ children: [/*#__PURE__*/_jsx(AlertTriangle, {
308
+ size: 14,
309
+ color: macOSColors.semantic.error
310
+ }), /*#__PURE__*/_jsx(Text, {
311
+ style: styles.errorText,
312
+ children: isReactReduxAvailable ? "Not inside a Redux Provider. Wrap your app with <Provider store={store}>." : "react-redux not installed. Run: npm install react-redux"
313
+ })]
314
+ }), !isEnabled && isInstrumented && /*#__PURE__*/_jsxs(View, {
315
+ style: styles.disabledBanner,
316
+ children: [/*#__PURE__*/_jsx(Power, {
317
+ size: 14,
318
+ color: macOSColors.semantic.warning
319
+ }), /*#__PURE__*/_jsx(Text, {
320
+ style: styles.disabledText,
321
+ children: "Action capture is disabled"
322
+ })]
323
+ }), hasLockedActions && /*#__PURE__*/_jsxs(TouchableOpacity, {
324
+ style: styles.lockedBanner,
325
+ onPress: handleUpgradePress,
326
+ activeOpacity: 0.8,
327
+ children: [/*#__PURE__*/_jsx(Lock, {
328
+ size: 14,
329
+ color: buoyColors.primary
330
+ }), /*#__PURE__*/_jsxs(Text, {
331
+ style: styles.lockedText,
332
+ children: [lockedActionCount, " older ", lockedActionCount === 1 ? "action" : "actions", " locked"]
333
+ }), /*#__PURE__*/_jsx(View, {
334
+ style: styles.upgradeBadge,
335
+ children: /*#__PURE__*/_jsx(Text, {
336
+ style: styles.upgradeBadgeText,
337
+ children: "UPGRADE"
338
+ })
339
+ })]
340
+ }), visibleActions.length > 0 ? /*#__PURE__*/_jsx(FlatList, {
341
+ ref: flatListRef,
342
+ data: visibleActions,
343
+ renderItem: renderItem,
344
+ keyExtractor: keyExtractor,
345
+ contentContainerStyle: styles.listContent,
346
+ showsVerticalScrollIndicator: true,
347
+ removeClippedSubviews: true,
348
+ initialNumToRender: 15,
349
+ maxToRenderPerBatch: 10,
350
+ windowSize: 10,
351
+ scrollEnabled: false
352
+ }) : /*#__PURE__*/_jsx(EmptyState, {
353
+ isEnabled: isEnabled
354
+ })]
355
+ })
356
+ })
357
+ }), /*#__PURE__*/_jsx(ProUpgradeModal, {
358
+ visible: showProModal,
359
+ onClose: () => setShowProModal(false),
360
+ featureName: "Full Action History"
361
+ })]
362
+ });
363
+ }
364
+ const styles = StyleSheet.create({
365
+ container: {
366
+ flex: 1,
367
+ backgroundColor: macOSColors.background.base
368
+ },
369
+ headerSearchContainer: {
370
+ flexDirection: "row",
371
+ alignItems: "center",
372
+ backgroundColor: macOSColors.background.input,
373
+ borderRadius: 10,
374
+ borderWidth: 1,
375
+ borderColor: macOSColors.border.default,
376
+ paddingHorizontal: 12,
377
+ paddingVertical: 5
378
+ },
379
+ headerSearchInput: {
380
+ flex: 1,
381
+ color: macOSColors.text.primary,
382
+ fontSize: 13,
383
+ marginLeft: 6,
384
+ paddingVertical: 2
385
+ },
386
+ headerSearchClear: {
387
+ marginLeft: 6,
388
+ padding: 4
389
+ },
390
+ headerChipRow: {
391
+ flexDirection: "row",
392
+ alignItems: "center",
393
+ gap: 8
394
+ },
395
+ headerChip: {
396
+ flexDirection: "row",
397
+ alignItems: "center",
398
+ gap: 4,
399
+ backgroundColor: macOSColors.background.hover,
400
+ paddingHorizontal: 10,
401
+ paddingVertical: 5,
402
+ borderRadius: 12,
403
+ borderWidth: 1,
404
+ borderColor: macOSColors.border.default
405
+ },
406
+ headerChipActive: {
407
+ backgroundColor: macOSColors.semantic.infoBackground,
408
+ borderColor: macOSColors.semantic.info + "50"
409
+ },
410
+ headerChipLabel: {
411
+ fontSize: 10,
412
+ fontWeight: "700",
413
+ color: macOSColors.text.muted
414
+ },
415
+ headerChipValue: {
416
+ fontSize: 12,
417
+ fontWeight: "600",
418
+ fontFamily: "monospace"
419
+ },
420
+ headerActionButton: {
421
+ width: 32,
422
+ height: 32,
423
+ borderRadius: 8,
424
+ backgroundColor: macOSColors.background.hover,
425
+ borderWidth: 1,
426
+ borderColor: macOSColors.border.default,
427
+ alignItems: "center",
428
+ justifyContent: "center"
429
+ },
430
+ headerActionButtonDisabled: {
431
+ opacity: 0.55
432
+ },
433
+ startButton: {
434
+ backgroundColor: macOSColors.semantic.successBackground,
435
+ borderColor: macOSColors.semantic.success + "40"
436
+ },
437
+ stopButton: {
438
+ backgroundColor: macOSColors.semantic.errorBackground,
439
+ borderColor: macOSColors.semantic.error + "40"
440
+ },
441
+ errorBanner: {
442
+ flexDirection: "row",
443
+ alignItems: "center",
444
+ gap: 8,
445
+ padding: 10,
446
+ marginHorizontal: 12,
447
+ marginTop: 8,
448
+ backgroundColor: macOSColors.semantic.errorBackground,
449
+ borderRadius: 8,
450
+ borderWidth: 1,
451
+ borderColor: macOSColors.semantic.error + "20"
452
+ },
453
+ errorText: {
454
+ color: macOSColors.semantic.error,
455
+ fontSize: 11,
456
+ flex: 1
457
+ },
458
+ disabledBanner: {
459
+ flexDirection: "row",
460
+ alignItems: "center",
461
+ gap: 8,
462
+ padding: 10,
463
+ marginHorizontal: 12,
464
+ marginTop: 8,
465
+ backgroundColor: macOSColors.semantic.warningBackground,
466
+ borderRadius: 8,
467
+ borderWidth: 1,
468
+ borderColor: macOSColors.semantic.warning + "20"
469
+ },
470
+ disabledText: {
471
+ color: macOSColors.semantic.warning,
472
+ fontSize: 11,
473
+ flex: 1
474
+ },
475
+ listContent: {
476
+ paddingTop: 8,
477
+ paddingBottom: 20
478
+ },
479
+ emptyState: {
480
+ alignItems: "center",
481
+ paddingVertical: 40
482
+ },
483
+ emptyTitle: {
484
+ color: macOSColors.text.primary,
485
+ fontSize: 14,
486
+ fontWeight: "600",
487
+ marginTop: 12,
488
+ marginBottom: 6
489
+ },
490
+ emptyText: {
491
+ color: macOSColors.text.muted,
492
+ fontSize: 12,
493
+ textAlign: "center"
494
+ },
495
+ // Locked actions banner styles
496
+ lockedBanner: {
497
+ flexDirection: "row",
498
+ alignItems: "center",
499
+ gap: 8,
500
+ padding: 10,
501
+ marginHorizontal: 12,
502
+ marginTop: 8,
503
+ backgroundColor: buoyColors.primary + "15",
504
+ borderRadius: 8,
505
+ borderWidth: 1,
506
+ borderColor: buoyColors.primary + "33"
507
+ },
508
+ lockedText: {
509
+ color: buoyColors.primary,
510
+ fontSize: 11,
511
+ fontWeight: "500",
512
+ flex: 1
513
+ },
514
+ upgradeBadge: {
515
+ backgroundColor: buoyColors.primary,
516
+ paddingHorizontal: 8,
517
+ paddingVertical: 3,
518
+ borderRadius: 4
519
+ },
520
+ upgradeBadgeText: {
521
+ color: "#fff",
522
+ fontSize: 9,
523
+ fontWeight: "700",
524
+ letterSpacing: 0.5
525
+ }
526
+ });
@@ -1 +1,7 @@
1
- "use strict";export{ReduxModal,FREE_TIER_ACTION_LIMIT}from"./ReduxModal";export{ReduxActionItem}from"./ReduxActionItem";export{ReduxActionDetailView}from"./ReduxActionDetailView";export{ReduxActionDetailContent,ReduxActionDetailFooter}from"./ReduxActionDetailContent";export{ReduxIcon}from"./ReduxIcon";
1
+ "use strict";
2
+
3
+ export { ReduxModal, FREE_TIER_ACTION_LIMIT } from "./ReduxModal";
4
+ export { ReduxActionItem } from "./ReduxActionItem";
5
+ export { ReduxActionDetailView } from "./ReduxActionDetailView";
6
+ export { ReduxActionDetailContent, ReduxActionDetailFooter } from "./ReduxActionDetailContent";
7
+ export { ReduxIcon } from "./ReduxIcon";
@@ -1 +1,4 @@
1
- "use strict";export{useReduxActions}from"./useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./useAutoInstrumentRedux";
1
+ "use strict";
2
+
3
+ export { useReduxActions } from "./useReduxActions";
4
+ export { useAutoInstrumentRedux, useReduxAvailability } from "./useAutoInstrumentRedux";