@buoy-gg/redux 0.1.1 → 2.1.2

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 (32) hide show
  1. package/lib/commonjs/index.js +1 -1
  2. package/lib/commonjs/redux/components/ReduxActionInfoView.js +1 -1
  3. package/lib/commonjs/redux/components/ReduxActionItem.js +1 -1
  4. package/lib/commonjs/redux/components/ReduxModal.js +1 -1
  5. package/lib/commonjs/redux/components/index.js +1 -1
  6. package/lib/commonjs/redux/hooks/index.js +1 -1
  7. package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +1 -0
  8. package/lib/commonjs/redux/utils/autoInstrument.js +1 -0
  9. package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +1 -1
  10. package/lib/commonjs/redux/utils/index.js +1 -1
  11. package/lib/commonjs/redux/utils/reduxActionStore.js +1 -1
  12. package/lib/module/index.js +1 -1
  13. package/lib/module/redux/components/ReduxActionInfoView.js +1 -1
  14. package/lib/module/redux/components/ReduxActionItem.js +1 -1
  15. package/lib/module/redux/components/ReduxModal.js +1 -1
  16. package/lib/module/redux/components/index.js +1 -1
  17. package/lib/module/redux/hooks/index.js +1 -1
  18. package/lib/module/redux/hooks/useAutoInstrumentRedux.js +1 -0
  19. package/lib/module/redux/utils/autoInstrument.js +1 -0
  20. package/lib/module/redux/utils/buoyReduxMiddleware.js +1 -1
  21. package/lib/module/redux/utils/index.js +1 -1
  22. package/lib/module/redux/utils/reduxActionStore.js +1 -1
  23. package/lib/typescript/index.d.ts +44 -13
  24. package/lib/typescript/preset.d.ts +23 -8
  25. package/lib/typescript/redux/components/ReduxModal.d.ts +3 -0
  26. package/lib/typescript/redux/components/index.d.ts +1 -0
  27. package/lib/typescript/redux/hooks/index.d.ts +2 -0
  28. package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts +64 -0
  29. package/lib/typescript/redux/utils/autoInstrument.d.ts +62 -0
  30. package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts +5 -0
  31. package/lib/typescript/redux/utils/index.d.ts +2 -0
  32. package/package.json +18 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={reduxToolPreset:!0,createReduxTool:!0,buoyReduxMiddleware:!0,createBuoyReduxMiddleware:!0,createReduxHistoryAdapter:!0,reduxHistoryAdapter:!0};Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:!0,get:function(){return _utils.buoyReduxMiddleware}}),Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:!0,get:function(){return _utils.createBuoyReduxMiddleware}}),Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:!0,get:function(){return _utils.createReduxHistoryAdapter}}),Object.defineProperty(exports,"createReduxTool",{enumerable:!0,get:function(){return _preset.createReduxTool}}),Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:!0,get:function(){return _utils.reduxHistoryAdapter}}),Object.defineProperty(exports,"reduxToolPreset",{enumerable:!0,get:function(){return _preset.reduxToolPreset}});var _preset=require("./preset"),_utils=require("./redux/utils"),_redux=require("./redux");Object.keys(_redux).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_redux[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _redux[e]}}))});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BUOY_JUMP_TO_STATE",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_JUMP_TO_STATE}}),Object.defineProperty(exports,"BUOY_REPLAY_ACTION",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_REPLAY_ACTION}}),Object.defineProperty(exports,"FREE_TIER_ACTION_LIMIT",{enumerable:!0,get:function(){return _ReduxModal.FREE_TIER_ACTION_LIMIT}}),Object.defineProperty(exports,"ReduxActionDetailContent",{enumerable:!0,get:function(){return _ReduxActionDetailContent.ReduxActionDetailContent}}),Object.defineProperty(exports,"ReduxActionDetailFooter",{enumerable:!0,get:function(){return _ReduxActionDetailContent.ReduxActionDetailFooter}}),Object.defineProperty(exports,"ReduxActionDetailView",{enumerable:!0,get:function(){return _ReduxActionDetailView.ReduxActionDetailView}}),Object.defineProperty(exports,"ReduxActionItem",{enumerable:!0,get:function(){return _ReduxActionItem.ReduxActionItem}}),Object.defineProperty(exports,"ReduxIcon",{enumerable:!0,get:function(){return _ReduxIcon.ReduxIcon}}),Object.defineProperty(exports,"ReduxModal",{enumerable:!0,get:function(){return _ReduxModal.ReduxModal}}),Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.buoyReduxMiddleware}}),Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.createBuoyReduxMiddleware}}),Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.createReduxHistoryAdapter}}),Object.defineProperty(exports,"createReduxTool",{enumerable:!0,get:function(){return _preset.createReduxTool}}),Object.defineProperty(exports,"getActiveStore",{enumerable:!0,get:function(){return _autoInstrument.getActiveStore}}),Object.defineProperty(exports,"instrumentStore",{enumerable:!0,get:function(){return _autoInstrument.instrumentStore}}),Object.defineProperty(exports,"isAutoInstrumentActive",{enumerable:!0,get:function(){return _autoInstrument.isAutoInstrumentActive}}),Object.defineProperty(exports,"isStoreInstrumented",{enumerable:!0,get:function(){return _autoInstrument.isStoreInstrumented}}),Object.defineProperty(exports,"jumpToState",{enumerable:!0,get:function(){return _buoyReduxMiddleware.jumpToState}}),Object.defineProperty(exports,"reduxActionStore",{enumerable:!0,get:function(){return _reduxActionStore.reduxActionStore}}),Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.reduxHistoryAdapter}}),Object.defineProperty(exports,"reduxToolPreset",{enumerable:!0,get:function(){return _preset.reduxToolPreset}}),Object.defineProperty(exports,"replayAction",{enumerable:!0,get:function(){return _buoyReduxMiddleware.replayAction}}),Object.defineProperty(exports,"uninstrumentStore",{enumerable:!0,get:function(){return _autoInstrument.uninstrumentStore}}),Object.defineProperty(exports,"useAutoInstrumentRedux",{enumerable:!0,get:function(){return _useAutoInstrumentRedux.useAutoInstrumentRedux}}),Object.defineProperty(exports,"useReduxActions",{enumerable:!0,get:function(){return _useReduxActions.useReduxActions}}),Object.defineProperty(exports,"useReduxAvailability",{enumerable:!0,get:function(){return _useAutoInstrumentRedux.useReduxAvailability}}),Object.defineProperty(exports,"withBuoyDevTools",{enumerable:!0,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});var _preset=require("./preset"),_buoyReduxMiddleware=require("./redux/utils/buoyReduxMiddleware"),_autoInstrument=require("./redux/utils/autoInstrument"),_createReduxHistoryAdapter=require("./redux/utils/createReduxHistoryAdapter"),_useReduxActions=require("./redux/hooks/useReduxActions"),_useAutoInstrumentRedux=require("./redux/hooks/useAutoInstrumentRedux"),_ReduxModal=require("./redux/components/ReduxModal"),_ReduxActionItem=require("./redux/components/ReduxActionItem"),_ReduxActionDetailView=require("./redux/components/ReduxActionDetailView"),_ReduxActionDetailContent=require("./redux/components/ReduxActionDetailContent"),_ReduxIcon=require("./redux/components/ReduxIcon"),_reduxActionStore=require("./redux/utils/reduxActionStore");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReduxActionInfoView=void 0;var _react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),Clipboard=_interopRequireWildcard(require("expo-clipboard")),_sharedUi=require("@buoy-gg/shared-ui"),_license=require("@buoy-gg/license"),_dataViewer=require("@buoy-gg/shared-ui/dataViewer"),_reduxActionStore=require("../utils/reduxActionStore"),_buoyReduxMiddleware=require("../utils/buoyReduxMiddleware"),_ReduxActionButton=require("./ReduxActionButton"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var o=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(i=t?r:o){if(i.has(e))return i.get(e);i.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(s,t,a):s[t]=e[t]);return s})(e,t)}function getCategoryInfo(e){switch(e){case"pending":return{label:"PENDING",color:_sharedUi.buoyColors.warning,bgColor:_sharedUi.buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:_sharedUi.buoyColors.success,bgColor:_sharedUi.buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:_sharedUi.buoyColors.error,bgColor:_sharedUi.buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:_sharedUi.buoyColors.textMuted,bgColor:_sharedUi.buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};default:return{label:"ACTION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"}}}function formatDuration(e){return void 0===e?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function SectionHeader({icon:e,title:t,badge:o}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeaderLeft,children:[(0,_jsxRuntime.jsx)(e,{size:14,color:_sharedUi.buoyColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t})]}),o]})}function InfoRow({label:e,value:t,valueColor:o,mono:r=!1}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.infoRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.infoLabel,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.infoValue,r&&styles.infoValueMono,o&&{color:o}],numberOfLines:1,ellipsizeMode:"middle",children:t})]})}function formatTime(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`}const ReduxActionInfoView=exports.ReduxActionInfoView=(0,_react.memo)(function({action:e,onNavigateToAction:t}){const o=(0,_license.useIsPro)(),[r,i]=(0,_react.useState)(!1);(0,_react.useEffect)(()=>{r&&o&&i(!1)},[r,o]);const a=getCategoryInfo(e.category),s=void 0!==e.payload,n=e.meta&&Object.keys(e.meta).length>0,l=void 0!==e.error,d=(0,_react.useMemo)(()=>_reduxActionStore.reduxActionStore.getLinkedActions(e),[e]),c=d.length>1,u=c?_reduxActionStore.reduxActionStore.getBaseActionType(e.type):null,y=e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null,x=(0,_react.useCallback)(async()=>{if(o)try{const t=JSON.stringify(e.action,null,2);await Clipboard.setStringAsync(t)}catch(e){console.warn("Failed to copy action:",e)}else i(!0)},[e,o]),_=(0,_react.useCallback)(async()=>{if(o)try{const t=JSON.stringify(e.payload,null,2);await Clipboard.setStringAsync(t)}catch(e){console.warn("Failed to copy payload:",e)}else i(!0)},[e.payload,o]),g=(0,_react.useCallback)(()=>{e.action&&"object"==typeof e.action&&"type"in e.action&&(0,_buoyReduxMiddleware.replayAction)(e.action)},[e]),m=(0,_react.useCallback)(()=>{void 0!==e.nextState&&(0,_buoyReduxMiddleware.jumpToState)(e.nextState)},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:!1,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Info,title:"ACTION INFO"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(InfoRow,{label:"Type",value:e.type,mono:!0}),e.sliceName&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Slice",value:e.sliceName,mono:!0}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Action",value:e.actionName,mono:!0}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:a.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:a.color}],children:a.label})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:e.isSlowAction?_sharedUi.buoyColors.error:_sharedUi.buoyColors.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],children:formatDuration(e.duration)}),e.isSlowAction&&(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:10,color:_sharedUi.buoyColors.error})]}),e.hasStateChange?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.changesBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:10,color:_sharedUi.buoyColors.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changesText,children:e.diffSummary||"changed"})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangesBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangesText,children:"no change"})})]})]})]}),c&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC FLOW",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.asyncBadge,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.asyncBadgeText,children:[d.length," ACTIONS"]})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.baseActionType,children:u}),null!==y&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.totalDurationRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.totalDurationLabel,children:"Total Duration"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.totalDurationValue,children:[y,"ms"]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timeline,children:d.map((o,r)=>{const i=getCategoryInfo(o.category),a=o.id===e.id;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.timelineItem,a&&styles.timelineItemCurrent],onPress:()=>t?.(o),disabled:a||!t,activeOpacity:.7,children:[r<d.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineConnector}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineDot,{backgroundColor:i.color}]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineStatusBadge,{backgroundColor:i.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.timelineStatusText,{color:i.color}],children:i.label})}),a&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.currentBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineTime,children:formatTime(o.timestamp)})]})]},o.id)})})]})]}),s&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Box,title:"PAYLOAD",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.typeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":"object"==typeof e.payload?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.payload),showTypeFilter:!1})})]}),n&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC METADATA",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:a.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:a.color}],children:"RTK THUNK"})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[e.meta?.requestId&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Request ID",value:e.meta.requestId,mono:!0}),e.meta?.requestStatus&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:a.color}),void 0!==e.meta?.arg&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.argSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argLabel,children:"Original Argument"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.argValueContainer,children:"object"==typeof e.meta.arg?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.meta.arg),showTypeFilter:!1}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Rejected With Value",value:"true",valueColor:_sharedUi.buoyColors.error}),e.meta?.aborted&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Aborted",value:"true",valueColor:_sharedUi.buoyColors.warning}),e.meta?.condition&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Condition",value:"true",valueColor:_sharedUi.buoyColors.textMuted})]})]}),l&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.card,styles.errorCard],children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.AlertCircle,title:"ERROR",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorBadgeText,children:"REJECTED"})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:"object"==typeof e.error?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.error),showTypeFilter:!1}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:String(e.error)})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.FileText,title:"FULL ACTION OBJECT"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.action),showTypeFilter:!1})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionFooter,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsGrid,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"replay",text:"REPLAY",onPress:g}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Dispatch again"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"jump",text:"JUMP",onPress:m}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Restore this state"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:x}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy to clipboard":"Pro feature"})]}),s&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:_}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy payload only":"Pro feature"})]})]})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:r,onClose:()=>i(!1),featureName:"Copy"})]})}),styles=_reactNative.StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:_sharedUi.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"4D",overflow:"hidden",shadowColor:_sharedUi.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:_sharedUi.buoyColors.error+"4D",shadowColor:_sharedUi.buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.primary+"33",backgroundColor:_sharedUi.buoyColors.primary+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:_sharedUi.buoyColors.primary,fontFamily:"monospace"},cardContent:{padding:14,gap:10},infoRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},infoLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500"},infoValue:{fontSize:11,color:_sharedUi.buoyColors.text,fontWeight:"500",flex:1,textAlign:"right",marginLeft:12},infoValueMono:{fontFamily:"monospace"},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.input},durationBadgeSlow:{backgroundColor:_sharedUi.buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.textSecondary,fontFamily:"monospace"},durationTextSlow:{color:_sharedUi.buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.input},noChangesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.textMuted},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:_sharedUi.buoyColors.input},typeText:{fontSize:8,fontWeight:"600",color:_sharedUi.buoyColors.textMuted,fontFamily:"monospace"},dataViewerContainer:{backgroundColor:_sharedUi.buoyColors.base,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:_sharedUi.buoyColors.base,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.border,overflow:"hidden"},argValue:{fontSize:11,color:_sharedUi.buoyColors.text,fontFamily:"monospace",padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:_sharedUi.buoyColors.error,fontFamily:"monospace",padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.primary+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.primary,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:_sharedUi.buoyColors.text,fontFamily:"monospace",marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.border},totalDurationLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:_sharedUi.buoyColors.success,fontFamily:"monospace"},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:_sharedUi.buoyColors.primary+"15"},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:_sharedUi.buoyColors.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:_sharedUi.buoyColors.primary},currentBadgeText:{fontSize:8,fontWeight:"700",color:"#fff",letterSpacing:.3},timelineTime:{fontSize:10,color:_sharedUi.buoyColors.textMuted,fontFamily:"monospace"},actionFooter:{backgroundColor:_sharedUi.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:_sharedUi.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:_sharedUi.buoyColors.textMuted,textAlign:"center"}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReduxActionInfoView=void 0;var _react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_license=require("@buoy-gg/license"),_dataViewer=require("@buoy-gg/shared-ui/dataViewer"),_reduxActionStore=require("../utils/reduxActionStore"),_buoyReduxMiddleware=require("../utils/buoyReduxMiddleware"),_ReduxActionButton=require("./ReduxActionButton"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var o=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(i=t?r:o){if(i.has(e))return i.get(e);i.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(s,t,a):s[t]=e[t]);return s})(e,t)}function getCategoryInfo(e){switch(e){case"pending":return{label:"PENDING",color:_sharedUi.buoyColors.warning,bgColor:_sharedUi.buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:_sharedUi.buoyColors.success,bgColor:_sharedUi.buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:_sharedUi.buoyColors.error,bgColor:_sharedUi.buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:_sharedUi.buoyColors.textMuted,bgColor:_sharedUi.buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};default:return{label:"ACTION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"}}}function formatDuration(e){return void 0===e?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function SectionHeader({icon:e,title:t,badge:o}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeaderLeft,children:[(0,_jsxRuntime.jsx)(e,{size:14,color:_sharedUi.buoyColors.primary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:t})]}),o]})}function InfoRow({label:e,value:t,valueColor:o,mono:r=!1}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.infoRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.infoLabel,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.infoValue,r&&styles.infoValueMono,o&&{color:o}],numberOfLines:1,ellipsizeMode:"middle",children:t})]})}function formatTime(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`}const ReduxActionInfoView=exports.ReduxActionInfoView=(0,_react.memo)(function({action:e,onNavigateToAction:t}){const o=(0,_license.useIsPro)(),[r,i]=(0,_react.useState)(!1);(0,_react.useEffect)(()=>{r&&o&&i(!1)},[r,o]);const a=getCategoryInfo(e.category),s=void 0!==e.payload,n=e.meta&&Object.keys(e.meta).length>0,l=void 0!==e.error,d=(0,_react.useMemo)(()=>_reduxActionStore.reduxActionStore.getLinkedActions(e),[e]),c=d.length>1,u=c?_reduxActionStore.reduxActionStore.getBaseActionType(e.type):null,y=e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null,x=(0,_react.useCallback)(async()=>{o?await(0,_sharedUi.copyToClipboard)(e.action):i(!0)},[e,o]),_=(0,_react.useCallback)(async()=>{o?await(0,_sharedUi.copyToClipboard)(e.payload):i(!0)},[e.payload,o]),m=(0,_react.useCallback)(()=>{e.action&&"object"==typeof e.action&&"type"in e.action&&(0,_buoyReduxMiddleware.replayAction)(e.action)},[e]),g=(0,_react.useCallback)(()=>{void 0!==e.nextState&&(0,_buoyReduxMiddleware.jumpToState)(e.nextState)},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:!1,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Info,title:"ACTION INFO"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(InfoRow,{label:"Type",value:e.type,mono:!0}),e.sliceName&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Slice",value:e.sliceName,mono:!0}),(0,_jsxRuntime.jsx)(InfoRow,{label:"Action",value:e.actionName,mono:!0}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:a.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:a.color}],children:a.label})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:e.isSlowAction?_sharedUi.buoyColors.error:_sharedUi.buoyColors.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],children:formatDuration(e.duration)}),e.isSlowAction&&(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:10,color:_sharedUi.buoyColors.error})]}),e.hasStateChange?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.changesBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:10,color:_sharedUi.buoyColors.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changesText,children:e.diffSummary||"changed"})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangesBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangesText,children:"no change"})})]})]})]}),c&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC FLOW",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.asyncBadge,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.asyncBadgeText,children:[d.length," ACTIONS"]})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.baseActionType,children:u}),null!==y&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.totalDurationRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.totalDurationLabel,children:"Total Duration"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.totalDurationValue,children:[y,"ms"]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timeline,children:d.map((o,r)=>{const i=getCategoryInfo(o.category),a=o.id===e.id;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.timelineItem,a&&styles.timelineItemCurrent],onPress:()=>t?.(o),disabled:a||!t,activeOpacity:.7,children:[r<d.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineConnector}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineDot,{backgroundColor:i.color}]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineStatusBadge,{backgroundColor:i.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.timelineStatusText,{color:i.color}],children:i.label})}),a&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.currentBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineTime,children:formatTime(o.timestamp)})]})]},o.id)})})]})]}),s&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Box,title:"PAYLOAD",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.typeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":"object"==typeof e.payload?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.payload),showTypeFilter:!1})})]}),n&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC METADATA",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:a.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:a.color}],children:"RTK THUNK"})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[e.meta?.requestId&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Request ID",value:e.meta.requestId,mono:!0}),e.meta?.requestStatus&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:a.color}),void 0!==e.meta?.arg&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.argSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argLabel,children:"Original Argument"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.argValueContainer,children:"object"==typeof e.meta.arg?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.meta.arg),showTypeFilter:!1}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Rejected With Value",value:"true",valueColor:_sharedUi.buoyColors.error}),e.meta?.aborted&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Aborted",value:"true",valueColor:_sharedUi.buoyColors.warning}),e.meta?.condition&&(0,_jsxRuntime.jsx)(InfoRow,{label:"Condition",value:"true",valueColor:_sharedUi.buoyColors.textMuted})]})]}),l&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.card,styles.errorCard],children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.AlertCircle,title:"ERROR",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorBadgeText,children:"REJECTED"})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:"object"==typeof e.error?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.error),showTypeFilter:!1}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:String(e.error)})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.FileText,title:"FULL ACTION OBJECT"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.action),showTypeFilter:!1})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionFooter,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsGrid,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"replay",text:"REPLAY",onPress:m}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Dispatch again"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"jump",text:"JUMP",onPress:g}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Restore this state"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:x}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy to clipboard":"Pro feature"})]}),s&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:_}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy payload only":"Pro feature"})]})]})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:r,onClose:()=>i(!1),featureName:"Copy"})]})}),styles=_reactNative.StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:_sharedUi.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"4D",overflow:"hidden",shadowColor:_sharedUi.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:_sharedUi.buoyColors.error+"4D",shadowColor:_sharedUi.buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.primary+"33",backgroundColor:_sharedUi.buoyColors.primary+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:_sharedUi.buoyColors.primary,fontFamily:"monospace"},cardContent:{padding:14,gap:10},infoRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},infoLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500"},infoValue:{fontSize:11,color:_sharedUi.buoyColors.text,fontWeight:"500",flex:1,textAlign:"right",marginLeft:12},infoValueMono:{fontFamily:"monospace"},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.input},durationBadgeSlow:{backgroundColor:_sharedUi.buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.textSecondary,fontFamily:"monospace"},durationTextSlow:{color:_sharedUi.buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.input},noChangesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.textMuted},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:_sharedUi.buoyColors.input},typeText:{fontSize:8,fontWeight:"600",color:_sharedUi.buoyColors.textMuted,fontFamily:"monospace"},dataViewerContainer:{backgroundColor:_sharedUi.buoyColors.base,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:_sharedUi.buoyColors.base,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.border,overflow:"hidden"},argValue:{fontSize:11,color:_sharedUi.buoyColors.text,fontFamily:"monospace",padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:_sharedUi.buoyColors.error,fontFamily:"monospace",padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.primary+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.primary,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:_sharedUi.buoyColors.text,fontFamily:"monospace",marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.border},totalDurationLabel:{fontSize:11,color:_sharedUi.buoyColors.textMuted,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:_sharedUi.buoyColors.success,fontFamily:"monospace"},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:_sharedUi.buoyColors.primary+"15"},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:_sharedUi.buoyColors.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:_sharedUi.buoyColors.primary},currentBadgeText:{fontSize:8,fontWeight:"700",color:"#fff",letterSpacing:.3},timelineTime:{fontSize:10,color:_sharedUi.buoyColors.textMuted,fontFamily:"monospace"},actionFooter:{backgroundColor:_sharedUi.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:_sharedUi.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:_sharedUi.buoyColors.textMuted,textAlign:"center"}});
@@ -1 +1 @@
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]}function formatRelativeTime(e){const t=Date.now()-e;return t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:`${Math.floor(t/36e5)}h ago`}function getStatusLabel(e){switch(e){case"pending":return"Pending";case"fulfilled":return"Fulfilled";case"rejected":return"Rejected";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return"Action"}}function getStatusColor(e,t){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 t?_sharedUi.buoyColors.success:_sharedUi.buoyColors.textSecondary}}function getSublabel(e){const t=[];return void 0!==e.duration&&e.duration>0&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?t.push(e.diffSummary||"changed"):t.push("no change"),t.join(" · ")}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=getStatusColor(e.category,e.hasStateChange),a=getStatusLabel(e.category),s=getSublabel(e),n=getPrimaryText(e),o=_reduxActionStore.reduxActionStore.getLinkedActions(e),i=o.length,c=i>1,u=c?o.findIndex(t=>t.id===e.id)+1:0,l=c&&e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0,d=getOperationColor(l);let g;return e.isSlowAction?g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[c&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:d.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:d.text}],children:[u,"/",i," #",l]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.slowBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.buoyColors.error})})]}):"rejected"===e.category?g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[c&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:d.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:d.text}],children:[u,"/",i," #",l]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.buoyColors.error})})]}):c?g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:d.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:d.text}],children:[u,"/",i," #",l]})}),e.hasStateChange&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.buoyColors.warning})})]}):e.hasStateChange&&(g=(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:r,statusLabel:a,statusSublabel:s,primaryText:n,bottomRightText:formatRelativeTime(e.timestamp),customBadge:g,showChevron:!0,onPress:()=>t(e)})}const styles=_reactNative.StyleSheet.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},changeBadge:{paddingHorizontal:4},slowBadge:{paddingHorizontal:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:"monospace"}});
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]}function formatRelativeTime(e){const t=Date.now()-e;return t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:`${Math.floor(t/36e5)}h ago`}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=e.sliceName??void 0,a=getStatusColor(e.category,e.hasStateChange,r),s=getStatusLabel(e.category,r),n=getSublabel(e),o=getPrimaryText(e),i=getActionBadge(e),c=_reduxActionStore.reduxActionStore.getLinkedActions(e),u=c.length,l=u>1,d=l?c.findIndex(t=>t.id===e.id)+1:0,g=l&&e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0,x=getOperationColor(g);let y;return e.isSlowAction?y=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[l&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:x.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:x.text}],children:[d,"/",u," #",g]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.slowBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.buoyColors.error})})]}):"rejected"===e.category?y=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[l&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:x.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:x.text}],children:[d,"/",u," #",g]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.buoyColors.error})})]}):l?y=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.asyncSequenceBadge,{backgroundColor:x.bg}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.asyncSequenceText,{color:x.text}],children:[d,"/",u," #",g]})}),e.hasStateChange&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.buoyColors.warning})})]}):e.hasStateChange&&(y=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.actionBadgeText,{color:a}],children:i}),(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:s,statusSublabel:n,primaryText:o,bottomRightText:formatRelativeTime(e.timestamp),customBadge:y,badgeText:y?void 0:i,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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FREE_TIER_ACTION_LIMIT=void 0,exports.ReduxModal=ReduxModal;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_license=require("@buoy-gg/license"),_useReduxActions=require("../hooks/useReduxActions"),_ReduxActionItem=require("./ReduxActionItem"),_ReduxActionDetailContent=require("./ReduxActionDetailContent"),_jsxRuntime=require("react/jsx-runtime");const FREE_TIER_ACTION_LIMIT=exports.FREE_TIER_ACTION_LIMIT=25;function EmptyState({isEnabled:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:32,color:_sharedUi.macOSColors.text.muted}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyTitle,children:"No Redux actions"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:e?"Actions will appear here as they are dispatched":"Enable capture to start recording actions"})]})}function ReduxModal({visible:e,onClose:t,onBack:a,onMinimize:r,enableSharedModalDimensions:s=!1}){const i=(0,_license.useIsPro)(),[o,n]=(0,_react.useState)(!1),{filteredActions:l,filter:c,setFilter:d,stats:h,clearActions:u,isEnabled:_,toggleCapture:x}=(0,_useReduxActions.useReduxActions)(),m=(0,_react.useMemo)(()=>i?l:l.slice(0,FREE_TIER_ACTION_LIMIT),[l,i]),C=(0,_react.useMemo)(()=>i?0:Math.max(0,l.length-FREE_TIER_ACTION_LIMIT),[l.length,i]),y=C>0,[g,p]=(0,_react.useState)(null),j=(0,_react.useRef)([]);j.current=m;const R=null!==g?m[g]:null,[b,S]=(0,_react.useState)(""),[U,T]=(0,_react.useState)(!1),f=(0,_react.useRef)(null),O=(0,_react.useRef)(null),v=(0,_react.useCallback)(e=>{},[]),I=e=>{S(e),d(t=>({...t,searchText:e}))},A=(0,_react.useCallback)(e=>{const t=j.current.findIndex(t=>t.id===e.id);p(t>=0?t:0)},[]),N=(0,_react.useCallback)(()=>{n(!0)},[]),k=(0,_react.useCallback)(()=>{p(null)},[]),B=(0,_react.useCallback)(e=>{p(e)},[]),w=(0,_react.useCallback)(e=>e.id,[]),z=(0,_react.useCallback)(({item:e})=>(0,_jsxRuntime.jsx)(_ReduxActionItem.ReduxActionItem,{action:e,onPress:A}),[A]),E=s?_sharedUi.devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!e)return null;const M=R&&null!==g?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailFooter,{action:R,actions:m,selectedIndex:g,onIndexChange:B}):null,P=R&&m.length>1?68:0;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:e,onClose:t,onMinimize:r,persistenceKey:E,header:{showToggleButton:!0,customContent:R?(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:k}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:R.type,centered:!0})]}):(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[a&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:a}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"",children:U?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerSearchContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:_sharedUi.macOSColors.text.secondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:f,style:styles.headerSearchInput,placeholder:"Search action types...",placeholderTextColor:_sharedUi.macOSColors.text.muted,value:b,onChangeText:I,onSubmitEditing:()=>T(!1),onBlur:()=>T(!1),autoCapitalize:"none",autoCorrect:!1,returnKeyType:"search"}),b.length>0&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>{I(""),T(!1)},style:styles.headerSearchClear,children:(0,_jsxRuntime.jsx)(_sharedUi.X,{size:14,color:_sharedUi.macOSColors.text.secondary})})]}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChipRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,!c.onlyWithChanges&&styles.headerChipActive],onPress:()=>d(e=>({...e,onlyWithChanges:!1})),children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerChipLabel,children:"ALL"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.text.primary}],children:h.totalActions})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,c.onlyWithChanges&&styles.headerChipActive],onPress:()=>d(e=>({...e,onlyWithChanges:!0})),children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.warning}],children:h.actionsWithChanges})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChip,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle,{size:12,color:_sharedUi.macOSColors.semantic.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.success}],children:h.uniqueActionTypes})]})]})}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>T(!0),style:styles.headerActionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:_sharedUi.macOSColors.text.secondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:async()=>{if(!i)return void n(!0);const e=l.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(0,_sharedUi.copyToClipboard)(e)},style:[styles.headerActionButton,0===l.length&&styles.headerActionButtonDisabled],disabled:0===l.length,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:l.length>0?_sharedUi.macOSColors.text.secondary:_sharedUi.macOSColors.text.disabled})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:x,style:[styles.headerActionButton,_?styles.startButton:styles.stopButton],children:(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_?_sharedUi.macOSColors.semantic.success:_sharedUi.macOSColors.semantic.error})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:u,style:[styles.headerActionButton,0===l.length&&styles.headerActionButtonDisabled],disabled:0===l.length,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:l.length>0?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.text.disabled})})]})]})},onModeChange:v,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:M,footerHeight:P,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:R&&null!==g?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailContent,{action:R,actions:m,selectedIndex:g,onIndexChange:B,disableInternalFooter:!0}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[!_&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),y&&(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.lockedBanner,onPress:N,activeOpacity:.8,children:[(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:14,color:_sharedUi.buoyColors.primary}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.lockedText,children:[C," older ",1===C?"action":"actions"," locked"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.upgradeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),m.length>0?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{ref:O,data:m,renderItem:z,keyExtractor:w,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:!0,removeClippedSubviews:!0,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1}):(0,_jsxRuntime.jsx)(EmptyState,{isEnabled:_})]})})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:o,onClose:()=>n(!1),featureName:"Full Action History"})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:_sharedUi.macOSColors.background.base},headerSearchContainer:{flexDirection:"row",alignItems:"center",backgroundColor:_sharedUi.macOSColors.background.input,borderRadius:10,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,paddingHorizontal:12,paddingVertical:5},headerSearchInput:{flex:1,color:_sharedUi.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:_sharedUi.macOSColors.background.hover,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default},headerChipActive:{backgroundColor:_sharedUi.macOSColors.semantic.infoBackground,borderColor:_sharedUi.macOSColors.semantic.info+"50"},headerChipLabel:{fontSize:10,fontWeight:"700",color:_sharedUi.macOSColors.text.muted},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:"monospace"},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.macOSColors.background.hover,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},startButton:{backgroundColor:_sharedUi.macOSColors.semantic.successBackground,borderColor:_sharedUi.macOSColors.semantic.success+"40"},stopButton:{backgroundColor:_sharedUi.macOSColors.semantic.errorBackground,borderColor:_sharedUi.macOSColors.semantic.error+"40"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},emptyState:{alignItems:"center",paddingVertical:40},emptyTitle:{color:_sharedUi.macOSColors.text.primary,fontSize:14,fontWeight:"600",marginTop:12,marginBottom:6},emptyText:{color:_sharedUi.macOSColors.text.muted,fontSize:12,textAlign:"center"},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.buoyColors.primary+"15",borderRadius:8,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"33"},lockedText:{color:_sharedUi.buoyColors.primary,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:_sharedUi.buoyColors.primary,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:"#fff",fontSize:9,fontWeight:"700",letterSpacing:.5}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FREE_TIER_ACTION_LIMIT=void 0,exports.ReduxModal=ReduxModal;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_license=require("@buoy-gg/license"),_useReduxActions=require("../hooks/useReduxActions"),_useAutoInstrumentRedux=require("../hooks/useAutoInstrumentRedux"),_ReduxActionItem=require("./ReduxActionItem"),_ReduxActionDetailContent=require("./ReduxActionDetailContent"),_jsxRuntime=require("react/jsx-runtime");const FREE_TIER_ACTION_LIMIT=exports.FREE_TIER_ACTION_LIMIT=25;function EmptyState({isEnabled:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:32,color:_sharedUi.macOSColors.text.muted}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyTitle,children:"No Redux actions"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:e?"Actions will appear here as they are dispatched":"Enable capture to start recording actions"})]})}function ReduxModal({visible:e,onClose:t,onBack:r,onMinimize:a,enableSharedModalDimensions:s=!1}){const i=(0,_license.useIsPro)(),[o,n]=(0,_react.useState)(!1),{isInstrumented:l,isLoading:d,error:c,isReactReduxAvailable:u}=(0,_useAutoInstrumentRedux.useAutoInstrumentRedux)(),{filteredActions:h,filter:x,setFilter:_,stats:m,clearActions:C,isEnabled:g,toggleCapture:y}=(0,_useReduxActions.useReduxActions)(),p=(0,_react.useMemo)(()=>i?h:h.slice(0,FREE_TIER_ACTION_LIMIT),[h,i]),j=(0,_react.useMemo)(()=>i?0:Math.max(0,h.length-FREE_TIER_ACTION_LIMIT),[h.length,i]),R=j>0,[b,S]=(0,_react.useState)(null),U=(0,_react.useRef)([]);U.current=p;const T=null!==b?p[b]:null,[f,v]=(0,_react.useState)(""),[O,I]=(0,_react.useState)(!1),A=(0,_react.useRef)(null),k=(0,_react.useRef)(null),N=(0,_react.useCallback)(e=>{},[]),w=e=>{v(e),_(t=>({...t,searchText:e}))},B=(0,_react.useCallback)(e=>{const t=U.current.findIndex(t=>t.id===e.id);S(t>=0?t:0)},[]),z=(0,_react.useCallback)(()=>{n(!0)},[]),E=(0,_react.useCallback)(()=>{S(null)},[]),M=(0,_react.useCallback)(e=>{S(e)},[]),P=(0,_react.useCallback)(e=>e.id,[]),V=(0,_react.useCallback)(({item:e})=>(0,_jsxRuntime.jsx)(_ReduxActionItem.ReduxActionItem,{action:e,onPress:B}),[B]),D=s?_sharedUi.devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!e)return null;const W=T&&null!==b?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailFooter,{action:T,actions:p,selectedIndex:b,onIndexChange:M}):null,H=T&&p.length>1?68:0;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:e,onClose:t,onMinimize:a,persistenceKey:D,header:{showToggleButton:!0,customContent:T?(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:E}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:T.type,centered:!0})]}):(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[r&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:r}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"",children:O?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerSearchContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:_sharedUi.macOSColors.text.secondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{ref:A,style:styles.headerSearchInput,placeholder:"Search action types...",placeholderTextColor:_sharedUi.macOSColors.text.muted,value:f,onChangeText:w,onSubmitEditing:()=>I(!1),onBlur:()=>I(!1),autoCapitalize:"none",autoCorrect:!1,returnKeyType:"search"}),f.length>0&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>{w(""),I(!1)},style:styles.headerSearchClear,children:(0,_jsxRuntime.jsx)(_sharedUi.X,{size:14,color:_sharedUi.macOSColors.text.secondary})})]}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChipRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,!x.onlyWithChanges&&styles.headerChipActive],onPress:()=>_(e=>({...e,onlyWithChanges:!1})),children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerChipLabel,children:"ALL"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.text.primary}],children:m.totalActions})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,x.onlyWithChanges&&styles.headerChipActive],onPress:()=>_(e=>({...e,onlyWithChanges:!0})),children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.warning}],children:m.actionsWithChanges})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChip,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle,{size:12,color:_sharedUi.macOSColors.semantic.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.success}],children:m.uniqueActionTypes})]})]})}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>I(!0),style:styles.headerActionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:_sharedUi.macOSColors.text.secondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:async()=>{if(!i)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(0,_sharedUi.copyToClipboard)(e)},style:[styles.headerActionButton,0===h.length&&styles.headerActionButtonDisabled],disabled:0===h.length,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:h.length>0?_sharedUi.macOSColors.text.secondary:_sharedUi.macOSColors.text.disabled})}),(0,_jsxRuntime.jsx)(_sharedUi.PowerToggleButton,{isEnabled:g,onToggle:y,accessibilityLabel:"Toggle Redux action capture"}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:C,style:[styles.headerActionButton,0===h.length&&styles.headerActionButtonDisabled],disabled:0===h.length,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:h.length>0?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.text.disabled})})]})]})},onModeChange:N,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:W,footerHeight:H,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:T&&null!==b?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailContent,{action:T,actions:p,selectedIndex:b,onIndexChange:M,disableInternalFooter:!0}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[c&&!l&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.macOSColors.semantic.error}),(0,_jsxRuntime.jsx)(_reactNative.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"})]}),!g&&l&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),R&&(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.lockedBanner,onPress:z,activeOpacity:.8,children:[(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:14,color:_sharedUi.buoyColors.primary}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.lockedText,children:[j," older ",1===j?"action":"actions"," locked"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.upgradeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),p.length>0?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{ref:k,data:p,renderItem:V,keyExtractor:P,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:!0,removeClippedSubviews:!0,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1}):(0,_jsxRuntime.jsx)(EmptyState,{isEnabled:g})]})})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:o,onClose:()=>n(!1),featureName:"Full Action History"})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:_sharedUi.macOSColors.background.base},headerSearchContainer:{flexDirection:"row",alignItems:"center",backgroundColor:_sharedUi.macOSColors.background.input,borderRadius:10,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,paddingHorizontal:12,paddingVertical:5},headerSearchInput:{flex:1,color:_sharedUi.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:_sharedUi.macOSColors.background.hover,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default},headerChipActive:{backgroundColor:_sharedUi.macOSColors.semantic.infoBackground,borderColor:_sharedUi.macOSColors.semantic.info+"50"},headerChipLabel:{fontSize:10,fontWeight:"700",color:_sharedUi.macOSColors.text.muted},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:"monospace"},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.macOSColors.background.hover,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},startButton:{backgroundColor:_sharedUi.macOSColors.semantic.successBackground,borderColor:_sharedUi.macOSColors.semantic.success+"40"},stopButton:{backgroundColor:_sharedUi.macOSColors.semantic.errorBackground,borderColor:_sharedUi.macOSColors.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.errorBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.error+"20"},errorText:{color:_sharedUi.macOSColors.semantic.error,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},emptyState:{alignItems:"center",paddingVertical:40},emptyTitle:{color:_sharedUi.macOSColors.text.primary,fontSize:14,fontWeight:"600",marginTop:12,marginBottom:6},emptyText:{color:_sharedUi.macOSColors.text.muted,fontSize:12,textAlign:"center"},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.buoyColors.primary+"15",borderRadius:8,borderWidth:1,borderColor:_sharedUi.buoyColors.primary+"33"},lockedText:{color:_sharedUi.buoyColors.primary,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:_sharedUi.buoyColors.primary,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:"#fff",fontSize:9,fontWeight:"700",letterSpacing:.5}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FREE_TIER_ACTION_LIMIT",{enumerable:!0,get:function(){return _ReduxModal.FREE_TIER_ACTION_LIMIT}}),Object.defineProperty(exports,"ReduxActionDetailView",{enumerable:!0,get:function(){return _ReduxActionDetailView.ReduxActionDetailView}}),Object.defineProperty(exports,"ReduxActionItem",{enumerable:!0,get:function(){return _ReduxActionItem.ReduxActionItem}}),Object.defineProperty(exports,"ReduxIcon",{enumerable:!0,get:function(){return _ReduxIcon.ReduxIcon}}),Object.defineProperty(exports,"ReduxModal",{enumerable:!0,get:function(){return _ReduxModal.ReduxModal}});var _ReduxModal=require("./ReduxModal"),_ReduxActionItem=require("./ReduxActionItem"),_ReduxActionDetailView=require("./ReduxActionDetailView"),_ReduxIcon=require("./ReduxIcon");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FREE_TIER_ACTION_LIMIT",{enumerable:!0,get:function(){return _ReduxModal.FREE_TIER_ACTION_LIMIT}}),Object.defineProperty(exports,"ReduxActionDetailContent",{enumerable:!0,get:function(){return _ReduxActionDetailContent.ReduxActionDetailContent}}),Object.defineProperty(exports,"ReduxActionDetailFooter",{enumerable:!0,get:function(){return _ReduxActionDetailContent.ReduxActionDetailFooter}}),Object.defineProperty(exports,"ReduxActionDetailView",{enumerable:!0,get:function(){return _ReduxActionDetailView.ReduxActionDetailView}}),Object.defineProperty(exports,"ReduxActionItem",{enumerable:!0,get:function(){return _ReduxActionItem.ReduxActionItem}}),Object.defineProperty(exports,"ReduxIcon",{enumerable:!0,get:function(){return _ReduxIcon.ReduxIcon}}),Object.defineProperty(exports,"ReduxModal",{enumerable:!0,get:function(){return _ReduxModal.ReduxModal}});var _ReduxModal=require("./ReduxModal"),_ReduxActionItem=require("./ReduxActionItem"),_ReduxActionDetailView=require("./ReduxActionDetailView"),_ReduxActionDetailContent=require("./ReduxActionDetailContent"),_ReduxIcon=require("./ReduxIcon");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useReduxActions",{enumerable:!0,get:function(){return _useReduxActions.useReduxActions}});var _useReduxActions=require("./useReduxActions");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useAutoInstrumentRedux",{enumerable:!0,get:function(){return _useAutoInstrumentRedux.useAutoInstrumentRedux}}),Object.defineProperty(exports,"useReduxActions",{enumerable:!0,get:function(){return _useReduxActions.useReduxActions}}),Object.defineProperty(exports,"useReduxAvailability",{enumerable:!0,get:function(){return _useAutoInstrumentRedux.useReduxAvailability}});var _useReduxActions=require("./useReduxActions"),_useAutoInstrumentRedux=require("./useAutoInstrumentRedux");
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useAutoInstrumentRedux=useAutoInstrumentRedux,exports.useReduxAvailability=useReduxAvailability;var _react=require("react"),_autoInstrument=require("../utils/autoInstrument");function getReactReduxUseStore(){try{return require("react-redux").useStore}catch{return null}}function useAutoInstrumentRedux(e={}){const{autoStart:t=!0,...r}=e,[u,n]=(0,_react.useState)(!1),[a,s]=(0,_react.useState)(!0),[l,i]=(0,_react.useState)(null),[o,c]=(0,_react.useState)(null),d=(0,_react.useRef)(null),x=getReactReduxUseStore(),R=null!==x;let m=null,f=null;if(x)try{m=x()}catch(e){f=e instanceof Error?e.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else f="react-redux is not installed or not available";const v=(0,_react.useCallback)(()=>{if(!m)return i(f||"No Redux store available"),void s(!1);if((0,_autoInstrument.isStoreInstrumented)(m))return n(!0),c(m),s(!1),void i(null);try{const e=(0,_autoInstrument.instrumentStore)(m,r);d.current=e,n(!0),c(m),i(null)}catch(e){i(e instanceof Error?e.message:"Failed to instrument Redux store"),n(!1)}finally{s(!1)}},[m,f,r]),_=(0,_react.useCallback)(()=>{d.current&&(d.current(),d.current=null),o&&(0,_autoInstrument.uninstrumentStore)(o),n(!1),c(null)},[o]);return(0,_react.useEffect)(()=>(t?v():s(!1),()=>{}),[t,v]),{isInstrumented:u,isLoading:a,error:l,isReactReduxAvailable:R,startInstrumentation:v,stopInstrumentation:_,store:o}}function useReduxAvailability(){const e=getReactReduxUseStore();if(!e)return{isAvailable:!1,error:"react-redux is not installed"};try{return{isAvailable:null!=e(),error:null}}catch(e){return{isAvailable:!1,error:e instanceof Error?e.message:"Not inside a Redux Provider"}}}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getActiveStore=getActiveStore,exports.instrumentStore=instrumentStore,exports.isAutoInstrumentActive=isAutoInstrumentActive,exports.isStoreInstrumented=isStoreInstrumented,exports.isTimeTravelEnabled=isTimeTravelEnabled,exports.jumpToState=jumpToState,exports.replayAction=replayAction,exports.uninstrumentStore=uninstrumentStore;var _reduxActionStore=require("./reduxActionStore"),_buoyReduxMiddleware=require("./buoyReduxMiddleware");const INSTRUMENTED_SYMBOL=Symbol.for("@@buoy/instrumented"),ORIGINAL_DISPATCH_SYMBOL=Symbol.for("@@buoy/originalDispatch"),ORIGINAL_REDUCER_SYMBOL=Symbol.for("@@buoy/originalReducer");let activeStore=null,timeTravelEnabled=!1;function isStoreInstrumented(e){return!0===e[INSTRUMENTED_SYMBOL]}function instrumentStore(e,t={}){const r=e;if((0,_buoyReduxMiddleware.isMiddlewareActive)())return activeStore=e,()=>{};if(r[INSTRUMENTED_SYMBOL])return activeStore=e,()=>{};const{enableTimeTravel:n=!1,maxActions:o=200,ignoreActions:i=[]}=t;_reduxActionStore.reduxActionStore.setMaxActions(o);const u=e.dispatch.bind(e);return r[ORIGINAL_DISPATCH_SYMBOL]=u,e.dispatch=t=>{if("object"!=typeof t||null===t||"string"!=typeof t.type)return u(t);const r=t.type;if(r.startsWith("@@buoy/"))return u(t);if(r.startsWith("@@redux/"))return u(t);if(i.includes(r))return u(t);const n=performance.now(),o=e.getState(),a=u(t),c=e.getState(),s=performance.now()-n;return _reduxActionStore.reduxActionStore.addAction(t,o,c,s),a},r[INSTRUMENTED_SYMBOL]=!0,activeStore=e,n&&"function"==typeof e.replaceReducer&&enableTimeTravelSupport(e),()=>{uninstrumentStore(e)}}function uninstrumentStore(e){const t=e;if(!t[INSTRUMENTED_SYMBOL])return;const r=t[ORIGINAL_DISPATCH_SYMBOL];r&&(e.dispatch=r);const n=t[ORIGINAL_REDUCER_SYMBOL];n&&"function"==typeof e.replaceReducer&&(e.replaceReducer(n),timeTravelEnabled=!1),delete t[INSTRUMENTED_SYMBOL],delete t[ORIGINAL_DISPATCH_SYMBOL],delete t[ORIGINAL_REDUCER_SYMBOL],activeStore===e&&(activeStore=null)}function enableTimeTravelSupport(e){const t=e,r=e.getState();t[ORIGINAL_REDUCER_SYMBOL]=(e=r,t)=>t.type===_buoyReduxMiddleware.BUOY_JUMP_TO_STATE?t.payload:e,timeTravelEnabled=!0}function jumpToState(e){activeStore?activeStore.dispatch({type:_buoyReduxMiddleware.BUOY_JUMP_TO_STATE,payload:e}):console.warn("[BuoyRedux] Cannot jump to state - no store instrumented")}function replayAction(e){activeStore?activeStore.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function getActiveStore(){return activeStore}function isAutoInstrumentActive(){return null!==activeStore&&isStoreInstrumented(activeStore)}function isTimeTravelEnabled(){return timeTravelEnabled}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buoyReduxMiddleware=exports.BUOY_REPLAY_ACTION=exports.BUOY_JUMP_TO_STATE=void 0,exports.createBuoyReduxMiddleware=createBuoyReduxMiddleware,exports.jumpToState=jumpToState,exports.replayAction=replayAction,exports.withBuoyDevTools=withBuoyDevTools;var _reduxActionStore=require("./reduxActionStore");const BUOY_JUMP_TO_STATE=exports.BUOY_JUMP_TO_STATE="@@buoy/JUMP_TO_STATE",BUOY_REPLAY_ACTION=exports.BUOY_REPLAY_ACTION="@@buoy/REPLAY_ACTION";let storeDispatch=null;function jumpToState(e){storeDispatch?storeDispatch({type:BUOY_JUMP_TO_STATE,payload:e}):console.warn("[BuoyRedux] Cannot jump to state - middleware not initialized")}function replayAction(e){storeDispatch?storeDispatch(e):console.warn("[BuoyRedux] Cannot replay action - middleware not initialized")}function withBuoyDevTools(e){return(t,o)=>o.type===BUOY_JUMP_TO_STATE?o.payload:e(t,o)}const buoyReduxMiddleware=e=>(storeDispatch=e.dispatch,t=>o=>{const r=o,n=r.type;if(n?.startsWith("@@buoy/"))return t(o);const i=performance.now(),a=e.getState(),u=t(o),s=e.getState(),c=performance.now()-i;return _reduxActionStore.reduxActionStore.addAction(r,a,s,c),u});function createBuoyReduxMiddleware(e={}){const{maxActions:t=200,ignoreActions:o=[]}=e;return _reduxActionStore.reduxActionStore.setMaxActions(t),e=>(storeDispatch=e.dispatch,t=>r=>{const n=r,i=n.type||"";if(i?.startsWith("@@buoy/"))return t(r);if(o.includes(i))return t(r);const a=performance.now(),u=e.getState(),s=t(r),c=e.getState(),d=performance.now()-a;return _reduxActionStore.reduxActionStore.addAction(n,u,c,d),s})}exports.buoyReduxMiddleware=buoyReduxMiddleware;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buoyReduxMiddleware=exports.BUOY_REPLAY_ACTION=exports.BUOY_JUMP_TO_STATE=void 0,exports.createBuoyReduxMiddleware=createBuoyReduxMiddleware,exports.isMiddlewareActive=isMiddlewareActive,exports.jumpToState=jumpToState,exports.replayAction=replayAction,exports.withBuoyDevTools=withBuoyDevTools;var _reduxActionStore=require("./reduxActionStore");let middlewareActive=!1;function isMiddlewareActive(){return middlewareActive}const BUOY_JUMP_TO_STATE=exports.BUOY_JUMP_TO_STATE="@@buoy/JUMP_TO_STATE",BUOY_REPLAY_ACTION=exports.BUOY_REPLAY_ACTION="@@buoy/REPLAY_ACTION";let storeDispatch=null;function jumpToState(e){storeDispatch?storeDispatch({type:BUOY_JUMP_TO_STATE,payload:e}):console.warn("[BuoyRedux] Cannot jump to state - middleware not initialized")}function replayAction(e){storeDispatch?storeDispatch(e):console.warn("[BuoyRedux] Cannot replay action - middleware not initialized")}function withBuoyDevTools(e){return(t,o)=>o.type===BUOY_JUMP_TO_STATE?o.payload:e(t,o)}const buoyReduxMiddleware=e=>(middlewareActive=!0,storeDispatch=e.dispatch,t=>o=>{const r=o,i=r.type;if(i?.startsWith("@@buoy/"))return t(o);const n=performance.now(),a=e.getState(),d=t(o),c=e.getState(),s=performance.now()-n;return _reduxActionStore.reduxActionStore.addAction(r,a,c,s),d});function createBuoyReduxMiddleware(e={}){const{maxActions:t=200,ignoreActions:o=[]}=e;return _reduxActionStore.reduxActionStore.setMaxActions(t),e=>(middlewareActive=!0,storeDispatch=e.dispatch,t=>r=>{const i=r,n=i.type||"";if(n?.startsWith("@@buoy/"))return t(r);if(o.includes(n))return t(r);const a=performance.now(),d=e.getState(),c=t(r),s=e.getState(),u=performance.now()-a;return _reduxActionStore.reduxActionStore.addAction(i,d,s,u),c})}exports.buoyReduxMiddleware=buoyReduxMiddleware;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BUOY_JUMP_TO_STATE",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_JUMP_TO_STATE}}),Object.defineProperty(exports,"BUOY_REPLAY_ACTION",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_REPLAY_ACTION}}),Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.buoyReduxMiddleware}}),Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.createBuoyReduxMiddleware}}),Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.createReduxHistoryAdapter}}),Object.defineProperty(exports,"jumpToState",{enumerable:!0,get:function(){return _buoyReduxMiddleware.jumpToState}}),Object.defineProperty(exports,"reduxActionStore",{enumerable:!0,get:function(){return _reduxActionStore.reduxActionStore}}),Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.reduxHistoryAdapter}}),Object.defineProperty(exports,"replayAction",{enumerable:!0,get:function(){return _buoyReduxMiddleware.replayAction}}),Object.defineProperty(exports,"withBuoyDevTools",{enumerable:!0,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});var _reduxActionStore=require("./reduxActionStore"),_buoyReduxMiddleware=require("./buoyReduxMiddleware"),_createReduxHistoryAdapter=require("./createReduxHistoryAdapter");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BUOY_JUMP_TO_STATE",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_JUMP_TO_STATE}}),Object.defineProperty(exports,"BUOY_REPLAY_ACTION",{enumerable:!0,get:function(){return _buoyReduxMiddleware.BUOY_REPLAY_ACTION}}),Object.defineProperty(exports,"autoJumpToState",{enumerable:!0,get:function(){return _autoInstrument.jumpToState}}),Object.defineProperty(exports,"autoReplayAction",{enumerable:!0,get:function(){return _autoInstrument.replayAction}}),Object.defineProperty(exports,"buoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.buoyReduxMiddleware}}),Object.defineProperty(exports,"createBuoyReduxMiddleware",{enumerable:!0,get:function(){return _buoyReduxMiddleware.createBuoyReduxMiddleware}}),Object.defineProperty(exports,"createReduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.createReduxHistoryAdapter}}),Object.defineProperty(exports,"getActiveStore",{enumerable:!0,get:function(){return _autoInstrument.getActiveStore}}),Object.defineProperty(exports,"instrumentStore",{enumerable:!0,get:function(){return _autoInstrument.instrumentStore}}),Object.defineProperty(exports,"isAutoInstrumentActive",{enumerable:!0,get:function(){return _autoInstrument.isAutoInstrumentActive}}),Object.defineProperty(exports,"isStoreInstrumented",{enumerable:!0,get:function(){return _autoInstrument.isStoreInstrumented}}),Object.defineProperty(exports,"jumpToState",{enumerable:!0,get:function(){return _buoyReduxMiddleware.jumpToState}}),Object.defineProperty(exports,"reduxActionStore",{enumerable:!0,get:function(){return _reduxActionStore.reduxActionStore}}),Object.defineProperty(exports,"reduxHistoryAdapter",{enumerable:!0,get:function(){return _createReduxHistoryAdapter.reduxHistoryAdapter}}),Object.defineProperty(exports,"replayAction",{enumerable:!0,get:function(){return _buoyReduxMiddleware.replayAction}}),Object.defineProperty(exports,"uninstrumentStore",{enumerable:!0,get:function(){return _autoInstrument.uninstrumentStore}}),Object.defineProperty(exports,"withBuoyDevTools",{enumerable:!0,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});var _reduxActionStore=require("./reduxActionStore"),_buoyReduxMiddleware=require("./buoyReduxMiddleware"),_createReduxHistoryAdapter=require("./createReduxHistoryAdapter"),_autoInstrument=require("./autoInstrument");
@@ -1 +1 @@
1
- "use strict";function getActionCategory(t){return t.startsWith("@@")?"internal":t.includes("/pending")?"pending":t.includes("/fulfilled")?"fulfilled":t.includes("/rejected")?"rejected":t.includes("/executeQuery")?"query":t.includes("/executeMutation")?"mutation":"action"}function parseActionType(t){if(t.startsWith("@@")){const e=t.split("/");return{sliceName:null,actionName:e[e.length-1]||t}}const e=t.split("/");if(e.length>=2){const t=e[0];let n=e[1];return e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])&&(n=e.slice(1,-1).join("/")),{sliceName:t,actionName:n.toUpperCase()}}return{sliceName:null,actionName:t.toUpperCase()}}function formatPayloadPreview(t,e=40){if(void 0===t)return"";if(null===t)return"null";try{if("string"==typeof t)return t.length>e?`"${t.slice(0,e-3)}..."`:`"${t}"`;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t)){if(0===t.length)return"[]";const n=JSON.stringify(t);return n.length>e?`[${t.length} items]`:n}if("object"==typeof t){const n=Object.keys(t);if(0===n.length)return"{}";const i=JSON.stringify(t);return i.length<=e?i:`{ ${n.length} keys }`}return String(t).slice(0,e)}catch{return"[complex]"}}function getStateDiffSummary(t,e){if(t===e)return{summary:"no change",changedCount:0};if("object"!=typeof t||"object"!=typeof e||null===t||null===e)return{summary:"changed",changedCount:1};const n=Object.keys(t),i=Object.keys(e),s=i.filter(t=>!n.includes(t)).length,r=n.filter(t=>!i.includes(t)).length;let o=0;for(const s of n)i.includes(s)&&t[s]!==e[s]&&o++;const a=[];s>0&&a.push(`+${s}`),r>0&&a.push(`-${r}`),o>0&&a.push(`~${o}`);const c=s+r+o;return 0===a.length?{summary:"nested change",changedCount:1}:{summary:`${a.join(" ")} ${1===c?"key":"keys"}`,changedCount:c}}function extractMeta(t){const e=t.meta;if(e)return{requestId:e.requestId,requestStatus:e.requestStatus,arg:e.arg,rejectedWithValue:e.rejectedWithValue,aborted:e.aborted,condition:e.condition}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.reduxActionStore=void 0;class ReduxActionStore{actions=[];listeners=new Set;maxActions=200;idCounter=0;isEnabled=!0;addAction(t,e,n,i){if(!this.isEnabled)return;const s=e!==n,r=t.type||"UNKNOWN_ACTION",o=getActionCategory(r),{sliceName:a,actionName:c}=parseActionType(r),u=extractMeta(t),l=formatPayloadPreview(t.payload),{summary:d,changedCount:h}=getStateDiffSummary(e,n),g=(i??0)>16,f={id:`${Date.now()}-${++this.idCounter}`,type:r,payload:t.payload,action:t,timestamp:Date.now(),prevState:e,nextState:n,duration:i,hasStateChange:s,category:o,sliceName:a,actionName:c,meta:u,error:t.error,payloadPreview:l,diffSummary:d,changedKeysCount:h,isSlowAction:g};this.actions=[f,...this.actions].slice(0,this.maxActions),this.notifyListeners()}getActions(){return[...this.actions]}getActionById(t){return this.actions.find(e=>e.id===t)}clearActions(){this.actions=[],this.notifyListeners()}setEnabled(t){this.isEnabled=t}getEnabled(){return this.isEnabled}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(){const t=this.getActions();this.listeners.forEach(e=>e(t))}setMaxActions(t){this.maxActions=t,this.actions.length>t&&(this.actions=this.actions.slice(0,t),this.notifyListeners())}getStats(){const t=this.actions.length,e=this.actions.filter(t=>t.hasStateChange).length,n=new Set(this.actions.map(t=>t.type)),i=this.actions.filter(t=>void 0!==t.duration).map(t=>t.duration),s=i.length>0?i.reduce((t,e)=>t+e,0)/i.length:0;return{totalActions:t,actionsWithChanges:e,actionsWithoutChanges:t-e,uniqueActionTypes:n.size,averageDuration:Math.round(100*s)/100}}filterActions(t){let e=[...this.actions];if(t.searchText){const n=t.searchText.toLowerCase();e=e.filter(t=>t.type.toLowerCase().includes(n))}return t.actionTypes&&t.actionTypes.length>0&&(e=e.filter(e=>t.actionTypes.includes(e.type))),t.onlyWithChanges&&(e=e.filter(t=>t.hasStateChange)),e}getUniqueActionTypes(){return Array.from(new Set(this.actions.map(t=>t.type))).sort()}getRelatedActions(t){return this.actions.filter(e=>e.meta?.requestId===t).sort((t,e)=>t.timestamp-e.timestamp)}getLinkedActions(t){return t.meta?.requestId?this.getRelatedActions(t.meta.requestId):[]}getLinkedActionsCount(t){return t.meta?.requestId?this.actions.filter(e=>e.meta?.requestId===t.meta?.requestId).length:0}getAsyncOperationDuration(t){const e=this.getRelatedActions(t);if(e.length<2)return null;const n=e.find(t=>"pending"===t.category),i=e.find(t=>"fulfilled"===t.category||"rejected"===t.category);return n&&i?i.timestamp-n.timestamp:null}getBaseActionType(t){const e=t.split("/");if(e.length>=2){const t=e[e.length-1];if(["pending","fulfilled","rejected"].includes(t))return e.slice(0,-1).join("/")}return t}getAsyncOperationIndex(t){const e=new Map;for(const t of this.actions)t.meta?.requestId&&!e.has(t.meta.requestId)&&e.set(t.meta.requestId,t.timestamp);const n=Array.from(e.entries()).sort((t,e)=>t[1]-e[1]).map(([t])=>t).indexOf(t);return n>=0?n+1:0}}const reduxActionStore=exports.reduxActionStore=new ReduxActionStore;
1
+ "use strict";function getActionCategory(t){return t.startsWith("@@")?"internal":t.includes("/pending")?"pending":t.includes("/fulfilled")?"fulfilled":t.includes("/rejected")?"rejected":t.includes("/executeQuery")?"query":t.includes("/executeMutation")?"mutation":"action"}function parseActionType(t){if(t.startsWith("@@")){const e=t.split("/");return{sliceName:null,actionName:e[e.length-1]||t}}const e=t.split("/");if(e.length>=2){const t=e[0];let n=e[1];return e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])&&(n=e.slice(1,-1).join("/")),{sliceName:t,actionName:n.toUpperCase()}}return{sliceName:null,actionName:t.toUpperCase()}}function formatPayloadPreview(t,e=40){if(void 0===t)return"";if(null===t)return"null";try{if("string"==typeof t)return t.length>e?`"${t.slice(0,e-3)}..."`:`"${t}"`;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t)){if(0===t.length)return"[]";const n=JSON.stringify(t);return n.length>e?`[${t.length} items]`:n}if("object"==typeof t){const n=Object.keys(t);if(0===n.length)return"{}";const i=JSON.stringify(t);return i.length<=e?i:`{ ${n.length} keys }`}return String(t).slice(0,e)}catch{return"[complex]"}}function getStateDiffSummary(t,e){if(t===e)return{summary:"no change",changedCount:0};if("object"!=typeof t||"object"!=typeof e||null===t||null===e)return{summary:"changed",changedCount:1};const n=Object.keys(t),i=Object.keys(e),s=i.filter(t=>!n.includes(t)).length,r=n.filter(t=>!i.includes(t)).length;let o=0;for(const s of n)i.includes(s)&&t[s]!==e[s]&&o++;const a=[];s>0&&a.push(`+${s}`),r>0&&a.push(`-${r}`),o>0&&a.push(`~${o}`);const c=s+r+o;return 0===a.length?{summary:"nested change",changedCount:1}:{summary:`${a.join(" ")} ${1===c?"key":"keys"}`,changedCount:c}}function extractMeta(t){const e=t.meta;if(e)return{requestId:e.requestId,requestStatus:e.requestStatus,arg:e.arg,rejectedWithValue:e.rejectedWithValue,aborted:e.aborted,condition:e.condition}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.reduxActionStore=void 0;class ReduxActionStore{actions=[];listeners=new Set;maxActions=200;idCounter=0;isEnabled=!0;addAction(t,e,n,i){if(!this.isEnabled)return;const s=t.type||"";if(!s)return;const r=e!==n,o=getActionCategory(s),{sliceName:a,actionName:c}=parseActionType(s),u=extractMeta(t),l=formatPayloadPreview(t.payload),{summary:d,changedCount:h}=getStateDiffSummary(e,n),f=(i??0)>16,g={id:`${Date.now()}-${++this.idCounter}`,type:s,payload:t.payload,action:t,timestamp:Date.now(),prevState:e,nextState:n,duration:i,hasStateChange:r,category:o,sliceName:a,actionName:c,meta:u,error:t.error,payloadPreview:l,diffSummary:d,changedKeysCount:h,isSlowAction:f};this.actions=[g,...this.actions].slice(0,this.maxActions),this.notifyListeners()}getActions(){return[...this.actions]}getActionById(t){return this.actions.find(e=>e.id===t)}clearActions(){this.actions=[],this.notifyListeners()}setEnabled(t){this.isEnabled=t}getEnabled(){return this.isEnabled}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(){const t=this.getActions();this.listeners.forEach(e=>e(t))}setMaxActions(t){this.maxActions=t,this.actions.length>t&&(this.actions=this.actions.slice(0,t),this.notifyListeners())}getStats(){const t=this.actions.length,e=this.actions.filter(t=>t.hasStateChange).length,n=new Set(this.actions.map(t=>t.type)),i=this.actions.filter(t=>void 0!==t.duration).map(t=>t.duration),s=i.length>0?i.reduce((t,e)=>t+e,0)/i.length:0;return{totalActions:t,actionsWithChanges:e,actionsWithoutChanges:t-e,uniqueActionTypes:n.size,averageDuration:Math.round(100*s)/100}}filterActions(t){let e=[...this.actions];if(t.searchText){const n=t.searchText.toLowerCase();e=e.filter(t=>t.type.toLowerCase().includes(n))}return t.actionTypes&&t.actionTypes.length>0&&(e=e.filter(e=>t.actionTypes.includes(e.type))),t.onlyWithChanges&&(e=e.filter(t=>t.hasStateChange)),e}getUniqueActionTypes(){return Array.from(new Set(this.actions.map(t=>t.type))).sort()}getRelatedActions(t){return this.actions.filter(e=>e.meta?.requestId===t).sort((t,e)=>t.timestamp-e.timestamp)}getLinkedActions(t){return t.meta?.requestId?this.getRelatedActions(t.meta.requestId):[]}getLinkedActionsCount(t){return t.meta?.requestId?this.actions.filter(e=>e.meta?.requestId===t.meta?.requestId).length:0}getAsyncOperationDuration(t){const e=this.getRelatedActions(t);if(e.length<2)return null;const n=e.find(t=>"pending"===t.category),i=e.find(t=>"fulfilled"===t.category||"rejected"===t.category);return n&&i?i.timestamp-n.timestamp:null}getBaseActionType(t){const e=t.split("/");if(e.length>=2){const t=e[e.length-1];if(["pending","fulfilled","rejected"].includes(t))return e.slice(0,-1).join("/")}return t}getAsyncOperationIndex(t){const e=new Map;for(const t of this.actions)t.meta?.requestId&&!e.has(t.meta.requestId)&&e.set(t.meta.requestId,t.timestamp);const n=Array.from(e.entries()).sort((t,e)=>t[1]-e[1]).map(([t])=>t).indexOf(t);return n>=0?n+1:0}}const reduxActionStore=exports.reduxActionStore=new ReduxActionStore;
@@ -1 +1 @@
1
- "use strict";export{reduxToolPreset,createReduxTool}from"./preset";export{buoyReduxMiddleware,createBuoyReduxMiddleware}from"./redux/utils";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils";export*from"./redux";
1
+ "use strict";export{reduxToolPreset,createReduxTool}from"./preset";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./redux/utils/buoyReduxMiddleware";export{instrumentStore,uninstrumentStore,isStoreInstrumented,isAutoInstrumentActive,getActiveStore}from"./redux/utils/autoInstrument";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils/createReduxHistoryAdapter";export{useReduxActions}from"./redux/hooks/useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./redux/hooks/useAutoInstrumentRedux";export{ReduxModal,FREE_TIER_ACTION_LIMIT}from"./redux/components/ReduxModal";export{ReduxActionItem}from"./redux/components/ReduxActionItem";export{ReduxActionDetailView}from"./redux/components/ReduxActionDetailView";export{ReduxActionDetailContent,ReduxActionDetailFooter}from"./redux/components/ReduxActionDetailContent";export{ReduxIcon}from"./redux/components/ReduxIcon";export{reduxActionStore}from"./redux/utils/reduxActionStore";
@@ -1 +1 @@
1
- "use strict";import React,{memo,useMemo,useCallback,useState,useEffect}from"react";import{View,Text,StyleSheet,ScrollView,TouchableOpacity}from"react-native";import*as Clipboard from"expo-clipboard";import{buoyColors,Clock,AlertTriangle,Zap,Hash,Info,Box,AlertCircle,FileText,parseValue,ProUpgradeModal}from"@buoy-gg/shared-ui";import{useIsPro}from"@buoy-gg/license";import{DataViewer}from"@buoy-gg/shared-ui/dataViewer";import{reduxActionStore}from"../utils/reduxActionStore";import{jumpToState,replayAction}from"../utils/buoyReduxMiddleware";import{ReduxActionButton}from"./ReduxActionButton";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function getCategoryInfo(e){switch(e){case"pending":return{label:"PENDING",color:buoyColors.warning,bgColor:buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:buoyColors.success,bgColor:buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:buoyColors.error,bgColor:buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:buoyColors.textMuted,bgColor:buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:buoyColors.info,bgColor:buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:buoyColors.info,bgColor:buoyColors.info+"26"};default:return{label:"ACTION",color:buoyColors.info,bgColor:buoyColors.info+"26"}}}function formatDuration(e){return void 0===e?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function SectionHeader({icon:e,title:o,badge:t}){return _jsxs(View,{style:styles.sectionHeader,children:[_jsxs(View,{style:styles.sectionHeaderLeft,children:[_jsx(e,{size:14,color:buoyColors.primary}),_jsx(Text,{style:styles.sectionTitle,children:o})]}),t]})}function InfoRow({label:e,value:o,valueColor:t,mono:r=!1}){return _jsxs(View,{style:styles.infoRow,children:[_jsx(Text,{style:styles.infoLabel,children:e}),_jsx(Text,{style:[styles.infoValue,r&&styles.infoValueMono,t&&{color:t}],numberOfLines:1,ellipsizeMode:"middle",children:o})]})}function formatTime(e){const o=new Date(e);return`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}.${o.getMilliseconds().toString().padStart(3,"0")}`}export const ReduxActionInfoView=memo(function({action:e,onNavigateToAction:o}){const t=useIsPro(),[r,l]=useState(!1);useEffect(()=>{r&&t&&l(!1)},[r,t]);const s=getCategoryInfo(e.category),i=void 0!==e.payload,a=e.meta&&Object.keys(e.meta).length>0,n=void 0!==e.error,c=useMemo(()=>reduxActionStore.getLinkedActions(e),[e]),d=c.length>1,y=d?reduxActionStore.getBaseActionType(e.type):null,u=e.meta?.requestId?reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null,g=useCallback(async()=>{if(t)try{const o=JSON.stringify(e.action,null,2);await Clipboard.setStringAsync(o)}catch(e){console.warn("Failed to copy action:",e)}else l(!0)},[e,t]),x=useCallback(async()=>{if(t)try{const o=JSON.stringify(e.payload,null,2);await Clipboard.setStringAsync(o)}catch(e){console.warn("Failed to copy payload:",e)}else l(!0)},[e.payload,t]),p=useCallback(()=>{e.action&&"object"==typeof e.action&&"type"in e.action&&replayAction(e.action)},[e]),b=useCallback(()=>{void 0!==e.nextState&&jumpToState(e.nextState)},[e]);return _jsxs(ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:!1,children:[_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Info,title:"ACTION INFO"}),_jsxs(View,{style:styles.cardContent,children:[_jsx(InfoRow,{label:"Type",value:e.type,mono:!0}),e.sliceName&&_jsx(InfoRow,{label:"Slice",value:e.sliceName,mono:!0}),_jsx(InfoRow,{label:"Action",value:e.actionName,mono:!0}),_jsxs(View,{style:styles.badgeRow,children:[_jsx(View,{style:[styles.categoryBadge,{backgroundColor:s.bgColor}],children:_jsx(Text,{style:[styles.categoryText,{color:s.color}],children:s.label})}),_jsxs(View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[_jsx(Clock,{size:10,color:e.isSlowAction?buoyColors.error:buoyColors.textSecondary}),_jsx(Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],children:formatDuration(e.duration)}),e.isSlowAction&&_jsx(AlertTriangle,{size:10,color:buoyColors.error})]}),e.hasStateChange?_jsxs(View,{style:styles.changesBadge,children:[_jsx(Zap,{size:10,color:buoyColors.success}),_jsx(Text,{style:styles.changesText,children:e.diffSummary||"changed"})]}):_jsx(View,{style:styles.noChangesBadge,children:_jsx(Text,{style:styles.noChangesText,children:"no change"})})]})]})]}),d&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Hash,title:"ASYNC FLOW",badge:_jsx(View,{style:styles.asyncBadge,children:_jsxs(Text,{style:styles.asyncBadgeText,children:[c.length," ACTIONS"]})})}),_jsxs(View,{style:styles.cardContent,children:[_jsx(Text,{style:styles.baseActionType,children:y}),null!==u&&_jsxs(View,{style:styles.totalDurationRow,children:[_jsx(Text,{style:styles.totalDurationLabel,children:"Total Duration"}),_jsxs(Text,{style:styles.totalDurationValue,children:[u,"ms"]})]}),_jsx(View,{style:styles.timeline,children:c.map((t,r)=>{const l=getCategoryInfo(t.category),s=t.id===e.id;return _jsxs(TouchableOpacity,{style:[styles.timelineItem,s&&styles.timelineItemCurrent],onPress:()=>o?.(t),disabled:s||!o,activeOpacity:.7,children:[r<c.length-1&&_jsx(View,{style:styles.timelineConnector}),_jsx(View,{style:[styles.timelineDot,{backgroundColor:l.color}]}),_jsxs(View,{style:styles.timelineContent,children:[_jsxs(View,{style:styles.timelineHeader,children:[_jsx(View,{style:[styles.timelineStatusBadge,{backgroundColor:l.bgColor}],children:_jsx(Text,{style:[styles.timelineStatusText,{color:l.color}],children:l.label})}),s&&_jsx(View,{style:styles.currentBadge,children:_jsx(Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),_jsx(Text,{style:styles.timelineTime,children:formatTime(t.timestamp)})]})]},t.id)})})]})]}),i&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Box,title:"PAYLOAD",badge:_jsx(View,{style:styles.typeBadge,children:_jsx(Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":"object"==typeof e.payload?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),_jsx(View,{style:styles.dataViewerContainer,children:_jsx(DataViewer,{title:"",data:parseValue(e.payload),showTypeFilter:!1})})]}),a&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Hash,title:"ASYNC METADATA",badge:_jsx(View,{style:[styles.categoryBadge,{backgroundColor:s.bgColor}],children:_jsx(Text,{style:[styles.categoryText,{color:s.color}],children:"RTK THUNK"})})}),_jsxs(View,{style:styles.cardContent,children:[e.meta?.requestId&&_jsx(InfoRow,{label:"Request ID",value:e.meta.requestId,mono:!0}),e.meta?.requestStatus&&_jsx(InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:s.color}),void 0!==e.meta?.arg&&_jsxs(View,{style:styles.argSection,children:[_jsx(Text,{style:styles.argLabel,children:"Original Argument"}),_jsx(View,{style:styles.argValueContainer,children:"object"==typeof e.meta.arg?_jsx(DataViewer,{title:"",data:parseValue(e.meta.arg),showTypeFilter:!1}):_jsx(Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&_jsx(InfoRow,{label:"Rejected With Value",value:"true",valueColor:buoyColors.error}),e.meta?.aborted&&_jsx(InfoRow,{label:"Aborted",value:"true",valueColor:buoyColors.warning}),e.meta?.condition&&_jsx(InfoRow,{label:"Condition",value:"true",valueColor:buoyColors.textMuted})]})]}),n&&_jsxs(View,{style:[styles.card,styles.errorCard],children:[_jsx(SectionHeader,{icon:AlertCircle,title:"ERROR",badge:_jsx(View,{style:styles.errorBadge,children:_jsx(Text,{style:styles.errorBadgeText,children:"REJECTED"})})}),_jsx(View,{style:styles.dataViewerContainer,children:"object"==typeof e.error?_jsx(DataViewer,{title:"",data:parseValue(e.error),showTypeFilter:!1}):_jsx(Text,{style:styles.errorText,children:String(e.error)})})]}),_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:FileText,title:"FULL ACTION OBJECT"}),_jsx(View,{style:styles.dataViewerContainer,children:_jsx(DataViewer,{title:"",data:parseValue(e.action),showTypeFilter:!1})})]}),_jsx(View,{style:styles.actionFooter,children:_jsxs(View,{style:styles.actionsGrid,children:[_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"replay",text:"REPLAY",onPress:p}),_jsx(Text,{style:styles.actionDescription,children:"Dispatch again"})]}),_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"jump",text:"JUMP",onPress:b}),_jsx(Text,{style:styles.actionDescription,children:"Restore this state"})]}),_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:g}),_jsx(Text,{style:styles.actionDescription,children:t?"Copy to clipboard":"Pro feature"})]}),i&&_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:x}),_jsx(Text,{style:styles.actionDescription,children:t?"Copy payload only":"Pro feature"})]})]})}),_jsx(ProUpgradeModal,{visible:r,onClose:()=>l(!1),featureName:"Copy"})]})});const styles=StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:buoyColors.card,borderRadius:6,borderWidth:1,borderColor:buoyColors.primary+"4D",overflow:"hidden",shadowColor:buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:buoyColors.error+"4D",shadowColor:buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:buoyColors.primary+"33",backgroundColor:buoyColors.primary+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:buoyColors.primary,fontFamily:"monospace"},cardContent:{padding:14,gap:10},infoRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},infoLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500"},infoValue:{fontSize:11,color:buoyColors.text,fontWeight:"500",flex:1,textAlign:"right",marginLeft:12},infoValueMono:{fontFamily:"monospace"},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.input},durationBadgeSlow:{backgroundColor:buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:buoyColors.textSecondary,fontFamily:"monospace"},durationTextSlow:{color:buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.input},noChangesText:{fontSize:9,fontWeight:"600",color:buoyColors.textMuted},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:buoyColors.input},typeText:{fontSize:8,fontWeight:"600",color:buoyColors.textMuted,fontFamily:"monospace"},dataViewerContainer:{backgroundColor:buoyColors.base,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:buoyColors.base,borderRadius:6,borderWidth:1,borderColor:buoyColors.border,overflow:"hidden"},argValue:{fontSize:11,color:buoyColors.text,fontFamily:"monospace",padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:buoyColors.error,fontFamily:"monospace",padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.primary+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:buoyColors.primary,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:buoyColors.text,fontFamily:"monospace",marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:buoyColors.border},totalDurationLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:buoyColors.success,fontFamily:"monospace"},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:buoyColors.primary+"15"},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:buoyColors.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:buoyColors.primary},currentBadgeText:{fontSize:8,fontWeight:"700",color:"#fff",letterSpacing:.3},timelineTime:{fontSize:10,color:buoyColors.textMuted,fontFamily:"monospace"},actionFooter:{backgroundColor:buoyColors.card,borderRadius:6,borderWidth:1,borderColor:buoyColors.primary+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:buoyColors.textMuted,textAlign:"center"}});
1
+ "use strict";import React,{memo,useMemo,useCallback,useState,useEffect}from"react";import{View,Text,StyleSheet,ScrollView,TouchableOpacity}from"react-native";import{buoyColors,Clock,AlertTriangle,Zap,Hash,Info,Box,AlertCircle,FileText,parseValue,ProUpgradeModal,copyToClipboard}from"@buoy-gg/shared-ui";import{useIsPro}from"@buoy-gg/license";import{DataViewer}from"@buoy-gg/shared-ui/dataViewer";import{reduxActionStore}from"../utils/reduxActionStore";import{jumpToState,replayAction}from"../utils/buoyReduxMiddleware";import{ReduxActionButton}from"./ReduxActionButton";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function getCategoryInfo(e){switch(e){case"pending":return{label:"PENDING",color:buoyColors.warning,bgColor:buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:buoyColors.success,bgColor:buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:buoyColors.error,bgColor:buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:buoyColors.textMuted,bgColor:buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:buoyColors.info,bgColor:buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:buoyColors.info,bgColor:buoyColors.info+"26"};default:return{label:"ACTION",color:buoyColors.info,bgColor:buoyColors.info+"26"}}}function formatDuration(e){return void 0===e?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function SectionHeader({icon:e,title:o,badge:t}){return _jsxs(View,{style:styles.sectionHeader,children:[_jsxs(View,{style:styles.sectionHeaderLeft,children:[_jsx(e,{size:14,color:buoyColors.primary}),_jsx(Text,{style:styles.sectionTitle,children:o})]}),t]})}function InfoRow({label:e,value:o,valueColor:t,mono:r=!1}){return _jsxs(View,{style:styles.infoRow,children:[_jsx(Text,{style:styles.infoLabel,children:e}),_jsx(Text,{style:[styles.infoValue,r&&styles.infoValueMono,t&&{color:t}],numberOfLines:1,ellipsizeMode:"middle",children:o})]})}function formatTime(e){const o=new Date(e);return`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}.${o.getMilliseconds().toString().padStart(3,"0")}`}export const ReduxActionInfoView=memo(function({action:e,onNavigateToAction:o}){const t=useIsPro(),[r,l]=useState(!1);useEffect(()=>{r&&t&&l(!1)},[r,t]);const s=getCategoryInfo(e.category),i=void 0!==e.payload,a=e.meta&&Object.keys(e.meta).length>0,n=void 0!==e.error,c=useMemo(()=>reduxActionStore.getLinkedActions(e),[e]),d=c.length>1,y=d?reduxActionStore.getBaseActionType(e.type):null,u=e.meta?.requestId?reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null,g=useCallback(async()=>{t?await copyToClipboard(e.action):l(!0)},[e,t]),x=useCallback(async()=>{t?await copyToClipboard(e.payload):l(!0)},[e.payload,t]),b=useCallback(()=>{e.action&&"object"==typeof e.action&&"type"in e.action&&replayAction(e.action)},[e]),p=useCallback(()=>{void 0!==e.nextState&&jumpToState(e.nextState)},[e]);return _jsxs(ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:!1,children:[_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Info,title:"ACTION INFO"}),_jsxs(View,{style:styles.cardContent,children:[_jsx(InfoRow,{label:"Type",value:e.type,mono:!0}),e.sliceName&&_jsx(InfoRow,{label:"Slice",value:e.sliceName,mono:!0}),_jsx(InfoRow,{label:"Action",value:e.actionName,mono:!0}),_jsxs(View,{style:styles.badgeRow,children:[_jsx(View,{style:[styles.categoryBadge,{backgroundColor:s.bgColor}],children:_jsx(Text,{style:[styles.categoryText,{color:s.color}],children:s.label})}),_jsxs(View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[_jsx(Clock,{size:10,color:e.isSlowAction?buoyColors.error:buoyColors.textSecondary}),_jsx(Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],children:formatDuration(e.duration)}),e.isSlowAction&&_jsx(AlertTriangle,{size:10,color:buoyColors.error})]}),e.hasStateChange?_jsxs(View,{style:styles.changesBadge,children:[_jsx(Zap,{size:10,color:buoyColors.success}),_jsx(Text,{style:styles.changesText,children:e.diffSummary||"changed"})]}):_jsx(View,{style:styles.noChangesBadge,children:_jsx(Text,{style:styles.noChangesText,children:"no change"})})]})]})]}),d&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Hash,title:"ASYNC FLOW",badge:_jsx(View,{style:styles.asyncBadge,children:_jsxs(Text,{style:styles.asyncBadgeText,children:[c.length," ACTIONS"]})})}),_jsxs(View,{style:styles.cardContent,children:[_jsx(Text,{style:styles.baseActionType,children:y}),null!==u&&_jsxs(View,{style:styles.totalDurationRow,children:[_jsx(Text,{style:styles.totalDurationLabel,children:"Total Duration"}),_jsxs(Text,{style:styles.totalDurationValue,children:[u,"ms"]})]}),_jsx(View,{style:styles.timeline,children:c.map((t,r)=>{const l=getCategoryInfo(t.category),s=t.id===e.id;return _jsxs(TouchableOpacity,{style:[styles.timelineItem,s&&styles.timelineItemCurrent],onPress:()=>o?.(t),disabled:s||!o,activeOpacity:.7,children:[r<c.length-1&&_jsx(View,{style:styles.timelineConnector}),_jsx(View,{style:[styles.timelineDot,{backgroundColor:l.color}]}),_jsxs(View,{style:styles.timelineContent,children:[_jsxs(View,{style:styles.timelineHeader,children:[_jsx(View,{style:[styles.timelineStatusBadge,{backgroundColor:l.bgColor}],children:_jsx(Text,{style:[styles.timelineStatusText,{color:l.color}],children:l.label})}),s&&_jsx(View,{style:styles.currentBadge,children:_jsx(Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),_jsx(Text,{style:styles.timelineTime,children:formatTime(t.timestamp)})]})]},t.id)})})]})]}),i&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Box,title:"PAYLOAD",badge:_jsx(View,{style:styles.typeBadge,children:_jsx(Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":"object"==typeof e.payload?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),_jsx(View,{style:styles.dataViewerContainer,children:_jsx(DataViewer,{title:"",data:parseValue(e.payload),showTypeFilter:!1})})]}),a&&_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:Hash,title:"ASYNC METADATA",badge:_jsx(View,{style:[styles.categoryBadge,{backgroundColor:s.bgColor}],children:_jsx(Text,{style:[styles.categoryText,{color:s.color}],children:"RTK THUNK"})})}),_jsxs(View,{style:styles.cardContent,children:[e.meta?.requestId&&_jsx(InfoRow,{label:"Request ID",value:e.meta.requestId,mono:!0}),e.meta?.requestStatus&&_jsx(InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:s.color}),void 0!==e.meta?.arg&&_jsxs(View,{style:styles.argSection,children:[_jsx(Text,{style:styles.argLabel,children:"Original Argument"}),_jsx(View,{style:styles.argValueContainer,children:"object"==typeof e.meta.arg?_jsx(DataViewer,{title:"",data:parseValue(e.meta.arg),showTypeFilter:!1}):_jsx(Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&_jsx(InfoRow,{label:"Rejected With Value",value:"true",valueColor:buoyColors.error}),e.meta?.aborted&&_jsx(InfoRow,{label:"Aborted",value:"true",valueColor:buoyColors.warning}),e.meta?.condition&&_jsx(InfoRow,{label:"Condition",value:"true",valueColor:buoyColors.textMuted})]})]}),n&&_jsxs(View,{style:[styles.card,styles.errorCard],children:[_jsx(SectionHeader,{icon:AlertCircle,title:"ERROR",badge:_jsx(View,{style:styles.errorBadge,children:_jsx(Text,{style:styles.errorBadgeText,children:"REJECTED"})})}),_jsx(View,{style:styles.dataViewerContainer,children:"object"==typeof e.error?_jsx(DataViewer,{title:"",data:parseValue(e.error),showTypeFilter:!1}):_jsx(Text,{style:styles.errorText,children:String(e.error)})})]}),_jsxs(View,{style:styles.card,children:[_jsx(SectionHeader,{icon:FileText,title:"FULL ACTION OBJECT"}),_jsx(View,{style:styles.dataViewerContainer,children:_jsx(DataViewer,{title:"",data:parseValue(e.action),showTypeFilter:!1})})]}),_jsx(View,{style:styles.actionFooter,children:_jsxs(View,{style:styles.actionsGrid,children:[_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"replay",text:"REPLAY",onPress:b}),_jsx(Text,{style:styles.actionDescription,children:"Dispatch again"})]}),_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"jump",text:"JUMP",onPress:p}),_jsx(Text,{style:styles.actionDescription,children:"Restore this state"})]}),_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:g}),_jsx(Text,{style:styles.actionDescription,children:t?"Copy to clipboard":"Pro feature"})]}),i&&_jsxs(View,{style:styles.actionButtonWrapper,children:[_jsx(ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:x}),_jsx(Text,{style:styles.actionDescription,children:t?"Copy payload only":"Pro feature"})]})]})}),_jsx(ProUpgradeModal,{visible:r,onClose:()=>l(!1),featureName:"Copy"})]})});const styles=StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:buoyColors.card,borderRadius:6,borderWidth:1,borderColor:buoyColors.primary+"4D",overflow:"hidden",shadowColor:buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:buoyColors.error+"4D",shadowColor:buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:buoyColors.primary+"33",backgroundColor:buoyColors.primary+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:buoyColors.primary,fontFamily:"monospace"},cardContent:{padding:14,gap:10},infoRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},infoLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500"},infoValue:{fontSize:11,color:buoyColors.text,fontWeight:"500",flex:1,textAlign:"right",marginLeft:12},infoValueMono:{fontFamily:"monospace"},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.input},durationBadgeSlow:{backgroundColor:buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:buoyColors.textSecondary,fontFamily:"monospace"},durationTextSlow:{color:buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.input},noChangesText:{fontSize:9,fontWeight:"600",color:buoyColors.textMuted},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:buoyColors.input},typeText:{fontSize:8,fontWeight:"600",color:buoyColors.textMuted,fontFamily:"monospace"},dataViewerContainer:{backgroundColor:buoyColors.base,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:buoyColors.base,borderRadius:6,borderWidth:1,borderColor:buoyColors.border,overflow:"hidden"},argValue:{fontSize:11,color:buoyColors.text,fontFamily:"monospace",padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:buoyColors.error,fontFamily:"monospace",padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.primary+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:buoyColors.primary,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:buoyColors.text,fontFamily:"monospace",marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:buoyColors.border},totalDurationLabel:{fontSize:11,color:buoyColors.textMuted,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:buoyColors.success,fontFamily:"monospace"},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:buoyColors.primary+"15"},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:buoyColors.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:buoyColors.primary},currentBadgeText:{fontSize:8,fontWeight:"700",color:"#fff",letterSpacing:.3},timelineTime:{fontSize:10,color:buoyColors.textMuted,fontFamily:"monospace"},actionFooter:{backgroundColor:buoyColors.card,borderRadius:6,borderWidth:1,borderColor:buoyColors.primary+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:buoyColors.textMuted,textAlign:"center"}});
@@ -1 +1 @@
1
- "use strict";import{View,Text,StyleSheet}from"react-native";import{CompactRow,buoyColors,Zap,AlertCircle,Clock}from"@buoy-gg/shared-ui";import{reduxActionStore}from"../utils/reduxActionStore";import{jsxs as _jsxs,jsx as _jsx}from"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:buoyColors.textSecondary}:OPERATION_COLORS[(e-1)%OPERATION_COLORS.length]}function formatRelativeTime(e){const t=Date.now()-e;return t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:`${Math.floor(t/36e5)}h ago`}function getStatusLabel(e){switch(e){case"pending":return"Pending";case"fulfilled":return"Fulfilled";case"rejected":return"Rejected";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return"Action"}}function getStatusColor(e,t){switch(e){case"pending":return buoyColors.warning;case"fulfilled":return buoyColors.success;case"rejected":return buoyColors.error;case"internal":return buoyColors.textMuted;case"query":case"mutation":return buoyColors.info;default:return t?buoyColors.success:buoyColors.textSecondary}}function getSublabel(e){const t=[];return void 0!==e.duration&&e.duration>0&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?t.push(e.diffSummary||"changed"):t.push("no change"),t.join(" · ")}function getPrimaryText(e){return"internal"===e.category?e.type:e.sliceName?`${e.sliceName}/${e.actionName.toLowerCase()}`:e.type}export function ReduxActionItem({action:e,onPress:t}){const r=getStatusColor(e.category,e.hasStateChange),o=getStatusLabel(e.category),s=getSublabel(e),n=getPrimaryText(e),a=reduxActionStore.getLinkedActions(e),l=a.length,i=l>1,c=i?a.findIndex(t=>t.id===e.id)+1:0,u=i&&e.meta?.requestId?reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0,g=getOperationColor(u);let d;return e.isSlowAction?d=_jsxs(View,{style:styles.badgeContainer,children:[i&&_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:g.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:g.text}],children:[c,"/",l," #",u]})}),_jsx(View,{style:styles.slowBadge,children:_jsx(Clock,{size:12,color:buoyColors.error})})]}):"rejected"===e.category?d=_jsxs(View,{style:styles.badgeContainer,children:[i&&_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:g.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:g.text}],children:[c,"/",l," #",u]})}),_jsx(View,{style:styles.errorBadge,children:_jsx(AlertCircle,{size:12,color:buoyColors.error})})]}):i?d=_jsxs(View,{style:styles.badgeContainer,children:[_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:g.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:g.text}],children:[c,"/",l," #",u]})}),e.hasStateChange&&_jsx(View,{style:styles.changeBadge,children:_jsx(Zap,{size:12,color:buoyColors.warning})})]}):e.hasStateChange&&(d=_jsx(View,{style:styles.changeBadge,children:_jsx(Zap,{size:12,color:buoyColors.warning})})),_jsx(CompactRow,{statusDotColor:r,statusLabel:o,statusSublabel:s,primaryText:n,bottomRightText:formatRelativeTime(e.timestamp),customBadge:d,showChevron:!0,onPress:()=>t(e)})}const styles=StyleSheet.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},changeBadge:{paddingHorizontal:4},slowBadge:{paddingHorizontal:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:"monospace"}});
1
+ "use strict";import{View,Text,StyleSheet}from"react-native";import{CompactRow,buoyColors,Zap,AlertCircle,Clock}from"@buoy-gg/shared-ui";import{reduxActionStore}from"../utils/reduxActionStore";import{jsxs as _jsxs,jsx as _jsx}from"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:buoyColors.textSecondary}:OPERATION_COLORS[(e-1)%OPERATION_COLORS.length]}function formatRelativeTime(e){const t=Date.now()-e;return t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:`${Math.floor(t/36e5)}h ago`}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,o]of Object.entries(SLICE_COLORS))if(t.includes(e))return o;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,o){switch(e){case"pending":return buoyColors.warning;case"fulfilled":return buoyColors.success;case"rejected":return buoyColors.error;case"internal":return buoyColors.textMuted;case"query":case"mutation":return buoyColors.info;default:return getSliceColor(o)}}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}export function ReduxActionItem({action:e,onPress:t}){const o=e.sliceName??void 0,r=getStatusColor(e.category,e.hasStateChange,o),s=getStatusLabel(e.category,o),n=getSublabel(e),a=getPrimaryText(e),i=getActionBadge(e),c=reduxActionStore.getLinkedActions(e),l=c.length,u=l>1,g=u?c.findIndex(t=>t.id===e.id)+1:0,d=u&&e.meta?.requestId?reduxActionStore.getAsyncOperationIndex(e.meta.requestId):0,y=getOperationColor(d);let x;return e.isSlowAction?x=_jsxs(View,{style:styles.badgeContainer,children:[u&&_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",d]})}),_jsx(View,{style:styles.slowBadge,children:_jsx(Clock,{size:12,color:buoyColors.error})})]}):"rejected"===e.category?x=_jsxs(View,{style:styles.badgeContainer,children:[u&&_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",d]})}),_jsx(View,{style:styles.errorBadge,children:_jsx(AlertCircle,{size:12,color:buoyColors.error})})]}):u?x=_jsxs(View,{style:styles.badgeContainer,children:[_jsx(View,{style:[styles.asyncSequenceBadge,{backgroundColor:y.bg}],children:_jsxs(Text,{style:[styles.asyncSequenceText,{color:y.text}],children:[g,"/",l," #",d]})}),e.hasStateChange&&_jsx(View,{style:styles.changeBadge,children:_jsx(Zap,{size:12,color:buoyColors.warning})})]}):e.hasStateChange&&(x=_jsxs(View,{style:styles.badgeContainer,children:[_jsx(Text,{style:[styles.actionBadgeText,{color:r}],children:i}),_jsx(View,{style:styles.changeBadge,children:_jsx(Zap,{size:12,color:buoyColors.warning})})]})),_jsx(CompactRow,{statusDotColor:r,statusLabel:s,statusSublabel:n,primaryText:a,bottomRightText:formatRelativeTime(e.timestamp),customBadge:x,badgeText:x?void 0:i,badgeColor:r,showChevron:!0,onPress:()=>t(e)})}const styles=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 +1 @@
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,devToolsStorageKeys,copyToClipboard,ProUpgradeModal}from"@buoy-gg/shared-ui";import{useIsPro}from"@buoy-gg/license";import{useReduxActions}from"../hooks/useReduxActions";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:s=!1}){const a=useIsPro(),[l,n]=useState(!1),{filteredActions:i,filter:c,setFilter:d,stats:h,clearActions:u,isEnabled:m,toggleCapture:y}=useReduxActions(),x=useMemo(()=>a?i:i.slice(0,25),[i,a]),C=useMemo(()=>a?0:Math.max(0,i.length-25),[i.length,a]),p=C>0,[g,b]=useState(null),S=useRef([]);S.current=x;const f=null!==g?x[g]:null,[_,j]=useState(""),[T,O]=useState(!1),k=useRef(null),A=useRef(null),B=useCallback(e=>{},[]),w=e=>{j(e),d(o=>({...o,searchText:e}))},R=useCallback(e=>{const o=S.current.findIndex(o=>o.id===e.id);b(o>=0?o:0)},[]),z=useCallback(()=>{n(!0)},[]),I=useCallback(()=>{b(null)},[]),M=useCallback(e=>{b(e)},[]),v=useCallback(e=>e.id,[]),P=useCallback(({item:e})=>_jsx(ReduxActionItem,{action:e,onPress:R}),[R]),V=s?devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!e)return null;const D=f&&null!==g?_jsx(ReduxActionDetailFooter,{action:f,actions:x,selectedIndex:g,onIndexChange:M}):null,W=f&&x.length>1?68:0;return _jsxs(_Fragment,{children:[_jsx(JsModal,{visible:e,onClose:o,onMinimize:r,persistenceKey:V,header:{showToggleButton:!0,customContent:_jsxs(ModalHeader,f?{children:[_jsx(ModalHeader.Navigation,{onBack:I}),_jsx(ModalHeader.Content,{title:f.type,centered:!0})]}:{children:[t&&_jsx(ModalHeader.Navigation,{onBack:t}),_jsx(ModalHeader.Content,{title:"",children:_jsxs(View,T?{style:styles.headerSearchContainer,children:[_jsx(Search,{size:14,color:macOSColors.text.secondary}),_jsx(TextInput,{ref:k,style:styles.headerSearchInput,placeholder:"Search action types...",placeholderTextColor:macOSColors.text.muted,value:_,onChangeText:w,onSubmitEditing:()=>O(!1),onBlur:()=>O(!1),autoCapitalize:"none",autoCorrect:!1,returnKeyType:"search"}),_.length>0&&_jsx(TouchableOpacity,{onPress:()=>{w(""),O(!1)},style:styles.headerSearchClear,children:_jsx(X,{size:14,color:macOSColors.text.secondary})})]}:{style:styles.headerChipRow,children:[_jsxs(TouchableOpacity,{style:[styles.headerChip,!c.onlyWithChanges&&styles.headerChipActive],onPress:()=>d(e=>({...e,onlyWithChanges:!1})),children:[_jsx(Text,{style:styles.headerChipLabel,children:"ALL"}),_jsx(Text,{style:[styles.headerChipValue,{color:macOSColors.text.primary}],children:h.totalActions})]}),_jsxs(TouchableOpacity,{style:[styles.headerChip,c.onlyWithChanges&&styles.headerChipActive],onPress:()=>d(e=>({...e,onlyWithChanges:!0})),children:[_jsx(Zap,{size:12,color:macOSColors.semantic.warning}),_jsx(Text,{style:[styles.headerChipValue,{color:macOSColors.semantic.warning}],children:h.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:h.uniqueActionTypes})]})]})}),_jsxs(ModalHeader.Actions,{children:[_jsx(TouchableOpacity,{onPress:()=>O(!0),style:styles.headerActionButton,children:_jsx(Search,{size:14,color:macOSColors.text.secondary})}),_jsx(TouchableOpacity,{onPress:async()=>{if(!a)return void n(!0);const e=i.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===i.length&&styles.headerActionButtonDisabled],disabled:0===i.length,children:_jsx(Copy,{size:14,color:i.length>0?macOSColors.text.secondary:macOSColors.text.disabled})}),_jsx(TouchableOpacity,{onPress:y,style:[styles.headerActionButton,m?styles.startButton:styles.stopButton],children:_jsx(Power,{size:14,color:m?macOSColors.semantic.success:macOSColors.semantic.error})}),_jsx(TouchableOpacity,{onPress:u,style:[styles.headerActionButton,0===i.length&&styles.headerActionButtonDisabled],disabled:0===i.length,children:_jsx(Trash2,{size:14,color:i.length>0?macOSColors.text.muted:macOSColors.text.disabled})})]})]})},onModeChange:B,enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:D,footerHeight:W,children:_jsx(View,{style:styles.container,children:f&&null!==g?_jsx(ReduxActionDetailContent,{action:f,actions:x,selectedIndex:g,onIndexChange:M,disableInternalFooter:!0}):_jsxs(_Fragment,{children:[!m&&_jsxs(View,{style:styles.disabledBanner,children:[_jsx(Power,{size:14,color:macOSColors.semantic.warning}),_jsx(Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),p&&_jsxs(TouchableOpacity,{style:styles.lockedBanner,onPress:z,activeOpacity:.8,children:[_jsx(Lock,{size:14,color:buoyColors.primary}),_jsxs(Text,{style:styles.lockedText,children:[C," older ",1===C?"action":"actions"," locked"]}),_jsx(View,{style:styles.upgradeBadge,children:_jsx(Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),x.length>0?_jsx(FlatList,{ref:A,data:x,renderItem:P,keyExtractor:v,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:!0,removeClippedSubviews:!0,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1}):_jsx(EmptyState,{isEnabled:m})]})})}),_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"},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";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}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}))},M=useCallback(e=>{const o=j.current.findIndex(o=>o.id===e.id);_(o>=0?o:0)},[]),P=useCallback(()=>{n(!0)},[]),V=useCallback(()=>{_(null)},[]),W=useCallback(e=>{_(e)},[]),D=useCallback(e=>e.id,[]),E=useCallback(({item:e})=>_jsx(ReduxActionItem,{action:e,onPress:M}),[M]),H=a?devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!e)return null;const F=O&&null!==T?_jsx(ReduxActionDetailFooter,{action:O,actions:b,selectedIndex:T,onIndexChange:W}):null,L=O&&b.length>1?68:0;return _jsxs(_Fragment,{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:F,footerHeight:L,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:P,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 +1 @@
1
- "use strict";export{ReduxModal,FREE_TIER_ACTION_LIMIT}from"./ReduxModal";export{ReduxActionItem}from"./ReduxActionItem";export{ReduxActionDetailView}from"./ReduxActionDetailView";export{ReduxIcon}from"./ReduxIcon";
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 +1 @@
1
- "use strict";export{useReduxActions}from"./useReduxActions";
1
+ "use strict";export{useReduxActions}from"./useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./useAutoInstrumentRedux";
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect,useState,useRef,useCallback}from"react";import{instrumentStore,uninstrumentStore,isStoreInstrumented}from"../utils/autoInstrument";function getReactReduxUseStore(){try{return require("react-redux").useStore}catch{return null}}export function useAutoInstrumentRedux(e={}){const{autoStart:t=!0,...r}=e,[u,n]=useState(!1),[s,a]=useState(!0),[l,o]=useState(null),[i,c]=useState(null),d=useRef(null),f=getReactReduxUseStore(),m=null!==f;let R=null,x=null;if(f)try{R=f()}catch(e){x=e instanceof Error?e.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else x="react-redux is not installed or not available";const S=useCallback(()=>{if(!R)return o(x||"No Redux store available"),void a(!1);if(isStoreInstrumented(R))return n(!0),c(R),a(!1),void o(null);try{const e=instrumentStore(R,r);d.current=e,n(!0),c(R),o(null)}catch(e){o(e instanceof Error?e.message:"Failed to instrument Redux store"),n(!1)}finally{a(!1)}},[R,x,r]),v=useCallback(()=>{d.current&&(d.current(),d.current=null),i&&uninstrumentStore(i),n(!1),c(null)},[i]);return useEffect(()=>(t?S():a(!1),()=>{}),[t,S]),{isInstrumented:u,isLoading:s,error:l,isReactReduxAvailable:m,startInstrumentation:S,stopInstrumentation:v,store:i}}export function useReduxAvailability(){const e=getReactReduxUseStore();if(!e)return{isAvailable:!1,error:"react-redux is not installed"};try{return{isAvailable:null!=e(),error:null}}catch(e){return{isAvailable:!1,error:e instanceof Error?e.message:"Not inside a Redux Provider"}}}
@@ -0,0 +1 @@
1
+ "use strict";import{reduxActionStore}from"./reduxActionStore";import{BUOY_JUMP_TO_STATE,isMiddlewareActive}from"./buoyReduxMiddleware";const INSTRUMENTED_SYMBOL=Symbol.for("@@buoy/instrumented"),ORIGINAL_DISPATCH_SYMBOL=Symbol.for("@@buoy/originalDispatch"),ORIGINAL_REDUCER_SYMBOL=Symbol.for("@@buoy/originalReducer");let activeStore=null,timeTravelEnabled=!1;export function isStoreInstrumented(e){return!0===e[INSTRUMENTED_SYMBOL]}export function instrumentStore(e,t={}){const r=e;if(isMiddlewareActive())return activeStore=e,()=>{};if(r[INSTRUMENTED_SYMBOL])return activeStore=e,()=>{};const{enableTimeTravel:o=!1,maxActions:n=200,ignoreActions:i=[]}=t;reduxActionStore.setMaxActions(n);const c=e.dispatch.bind(e);return r[ORIGINAL_DISPATCH_SYMBOL]=c,e.dispatch=t=>{if("object"!=typeof t||null===t||"string"!=typeof t.type)return c(t);const r=t.type;if(r.startsWith("@@buoy/"))return c(t);if(r.startsWith("@@redux/"))return c(t);if(i.includes(r))return c(t);const o=performance.now(),n=e.getState(),a=c(t),u=e.getState(),S=performance.now()-o;return reduxActionStore.addAction(t,n,u,S),a},r[INSTRUMENTED_SYMBOL]=!0,activeStore=e,o&&"function"==typeof e.replaceReducer&&enableTimeTravelSupport(e),()=>{uninstrumentStore(e)}}export function uninstrumentStore(e){const t=e;if(!t[INSTRUMENTED_SYMBOL])return;const r=t[ORIGINAL_DISPATCH_SYMBOL];r&&(e.dispatch=r);const o=t[ORIGINAL_REDUCER_SYMBOL];o&&"function"==typeof e.replaceReducer&&(e.replaceReducer(o),timeTravelEnabled=!1),delete t[INSTRUMENTED_SYMBOL],delete t[ORIGINAL_DISPATCH_SYMBOL],delete t[ORIGINAL_REDUCER_SYMBOL],activeStore===e&&(activeStore=null)}function enableTimeTravelSupport(e){const t=e,r=e.getState();t[ORIGINAL_REDUCER_SYMBOL]=(e=r,t)=>t.type===BUOY_JUMP_TO_STATE?t.payload:e,timeTravelEnabled=!0}export function jumpToState(e){activeStore?activeStore.dispatch({type:BUOY_JUMP_TO_STATE,payload:e}):console.warn("[BuoyRedux] Cannot jump to state - no store instrumented")}export function replayAction(e){activeStore?activeStore.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}export function getActiveStore(){return activeStore}export function isAutoInstrumentActive(){return null!==activeStore&&isStoreInstrumented(activeStore)}export function isTimeTravelEnabled(){return timeTravelEnabled}
@@ -1 +1 @@
1
- "use strict";import{reduxActionStore}from"./reduxActionStore";export const BUOY_JUMP_TO_STATE="@@buoy/JUMP_TO_STATE";export const BUOY_REPLAY_ACTION="@@buoy/REPLAY_ACTION";let storeDispatch=null;export function jumpToState(t){storeDispatch?storeDispatch({type:BUOY_JUMP_TO_STATE,payload:t}):console.warn("[BuoyRedux] Cannot jump to state - middleware not initialized")}export function replayAction(t){storeDispatch?storeDispatch(t):console.warn("[BuoyRedux] Cannot replay action - middleware not initialized")}export function withBuoyDevTools(t){return(e,o)=>o.type===BUOY_JUMP_TO_STATE?o.payload:t(e,o)}export const buoyReduxMiddleware=t=>(storeDispatch=t.dispatch,e=>o=>{const r=o,n=r.type;if(n?.startsWith("@@buoy/"))return e(o);const i=performance.now(),a=t.getState(),c=e(o),s=t.getState(),u=performance.now()-i;return reduxActionStore.addAction(r,a,s,u),c});export function createBuoyReduxMiddleware(t={}){const{maxActions:e=200,ignoreActions:o=[]}=t;return reduxActionStore.setMaxActions(e),t=>(storeDispatch=t.dispatch,e=>r=>{const n=r,i=n.type||"";if(i?.startsWith("@@buoy/"))return e(r);if(o.includes(i))return e(r);const a=performance.now(),c=t.getState(),s=e(r),u=t.getState(),p=performance.now()-a;return reduxActionStore.addAction(n,c,u,p),s})}
1
+ "use strict";import{reduxActionStore}from"./reduxActionStore";let middlewareActive=!1;export function isMiddlewareActive(){return middlewareActive}export const BUOY_JUMP_TO_STATE="@@buoy/JUMP_TO_STATE";export const BUOY_REPLAY_ACTION="@@buoy/REPLAY_ACTION";let storeDispatch=null;export function jumpToState(t){storeDispatch?storeDispatch({type:BUOY_JUMP_TO_STATE,payload:t}):console.warn("[BuoyRedux] Cannot jump to state - middleware not initialized")}export function replayAction(t){storeDispatch?storeDispatch(t):console.warn("[BuoyRedux] Cannot replay action - middleware not initialized")}export function withBuoyDevTools(t){return(e,o)=>o.type===BUOY_JUMP_TO_STATE?o.payload:t(e,o)}export const buoyReduxMiddleware=t=>(middlewareActive=!0,storeDispatch=t.dispatch,e=>o=>{const r=o,n=r.type;if(n?.startsWith("@@buoy/"))return e(o);const i=performance.now(),a=t.getState(),c=e(o),s=t.getState(),d=performance.now()-i;return reduxActionStore.addAction(r,a,s,d),c});export function createBuoyReduxMiddleware(t={}){const{maxActions:e=200,ignoreActions:o=[]}=t;return reduxActionStore.setMaxActions(e),t=>(middlewareActive=!0,storeDispatch=t.dispatch,e=>r=>{const n=r,i=n.type||"";if(i?.startsWith("@@buoy/"))return e(r);if(o.includes(i))return e(r);const a=performance.now(),c=t.getState(),s=e(r),d=t.getState(),u=performance.now()-a;return reduxActionStore.addAction(n,c,d,u),s})}
@@ -1 +1 @@
1
- "use strict";export{reduxActionStore}from"./reduxActionStore";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./buoyReduxMiddleware";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./createReduxHistoryAdapter";
1
+ "use strict";export{reduxActionStore}from"./reduxActionStore";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./buoyReduxMiddleware";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./createReduxHistoryAdapter";export{instrumentStore,uninstrumentStore,isStoreInstrumented,isAutoInstrumentActive,getActiveStore,jumpToState as autoJumpToState,replayAction as autoReplayAction}from"./autoInstrument";
@@ -1 +1 @@
1
- "use strict";function getActionCategory(t){return t.startsWith("@@")?"internal":t.includes("/pending")?"pending":t.includes("/fulfilled")?"fulfilled":t.includes("/rejected")?"rejected":t.includes("/executeQuery")?"query":t.includes("/executeMutation")?"mutation":"action"}function parseActionType(t){if(t.startsWith("@@")){const e=t.split("/");return{sliceName:null,actionName:e[e.length-1]||t}}const e=t.split("/");if(e.length>=2){const t=e[0];let n=e[1];return e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])&&(n=e.slice(1,-1).join("/")),{sliceName:t,actionName:n.toUpperCase()}}return{sliceName:null,actionName:t.toUpperCase()}}function formatPayloadPreview(t,e=40){if(void 0===t)return"";if(null===t)return"null";try{if("string"==typeof t)return t.length>e?`"${t.slice(0,e-3)}..."`:`"${t}"`;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t)){if(0===t.length)return"[]";const n=JSON.stringify(t);return n.length>e?`[${t.length} items]`:n}if("object"==typeof t){const n=Object.keys(t);if(0===n.length)return"{}";const i=JSON.stringify(t);return i.length<=e?i:`{ ${n.length} keys }`}return String(t).slice(0,e)}catch{return"[complex]"}}function getStateDiffSummary(t,e){if(t===e)return{summary:"no change",changedCount:0};if("object"!=typeof t||"object"!=typeof e||null===t||null===e)return{summary:"changed",changedCount:1};const n=Object.keys(t),i=Object.keys(e),s=i.filter(t=>!n.includes(t)).length,r=n.filter(t=>!i.includes(t)).length;let a=0;for(const s of n)i.includes(s)&&t[s]!==e[s]&&a++;const o=[];s>0&&o.push(`+${s}`),r>0&&o.push(`-${r}`),a>0&&o.push(`~${a}`);const c=s+r+a;return 0===o.length?{summary:"nested change",changedCount:1}:{summary:`${o.join(" ")} ${1===c?"key":"keys"}`,changedCount:c}}function extractMeta(t){const e=t.meta;if(e)return{requestId:e.requestId,requestStatus:e.requestStatus,arg:e.arg,rejectedWithValue:e.rejectedWithValue,aborted:e.aborted,condition:e.condition}}class ReduxActionStore{actions=[];listeners=new Set;maxActions=200;idCounter=0;isEnabled=!0;addAction(t,e,n,i){if(!this.isEnabled)return;const s=e!==n,r=t.type||"UNKNOWN_ACTION",a=getActionCategory(r),{sliceName:o,actionName:c}=parseActionType(r),l=extractMeta(t),u=formatPayloadPreview(t.payload),{summary:d,changedCount:h}=getStateDiffSummary(e,n),g=(i??0)>16,f={id:`${Date.now()}-${++this.idCounter}`,type:r,payload:t.payload,action:t,timestamp:Date.now(),prevState:e,nextState:n,duration:i,hasStateChange:s,category:a,sliceName:o,actionName:c,meta:l,error:t.error,payloadPreview:u,diffSummary:d,changedKeysCount:h,isSlowAction:g};this.actions=[f,...this.actions].slice(0,this.maxActions),this.notifyListeners()}getActions(){return[...this.actions]}getActionById(t){return this.actions.find(e=>e.id===t)}clearActions(){this.actions=[],this.notifyListeners()}setEnabled(t){this.isEnabled=t}getEnabled(){return this.isEnabled}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(){const t=this.getActions();this.listeners.forEach(e=>e(t))}setMaxActions(t){this.maxActions=t,this.actions.length>t&&(this.actions=this.actions.slice(0,t),this.notifyListeners())}getStats(){const t=this.actions.length,e=this.actions.filter(t=>t.hasStateChange).length,n=new Set(this.actions.map(t=>t.type)),i=this.actions.filter(t=>void 0!==t.duration).map(t=>t.duration),s=i.length>0?i.reduce((t,e)=>t+e,0)/i.length:0;return{totalActions:t,actionsWithChanges:e,actionsWithoutChanges:t-e,uniqueActionTypes:n.size,averageDuration:Math.round(100*s)/100}}filterActions(t){let e=[...this.actions];if(t.searchText){const n=t.searchText.toLowerCase();e=e.filter(t=>t.type.toLowerCase().includes(n))}return t.actionTypes&&t.actionTypes.length>0&&(e=e.filter(e=>t.actionTypes.includes(e.type))),t.onlyWithChanges&&(e=e.filter(t=>t.hasStateChange)),e}getUniqueActionTypes(){return Array.from(new Set(this.actions.map(t=>t.type))).sort()}getRelatedActions(t){return this.actions.filter(e=>e.meta?.requestId===t).sort((t,e)=>t.timestamp-e.timestamp)}getLinkedActions(t){return t.meta?.requestId?this.getRelatedActions(t.meta.requestId):[]}getLinkedActionsCount(t){return t.meta?.requestId?this.actions.filter(e=>e.meta?.requestId===t.meta?.requestId).length:0}getAsyncOperationDuration(t){const e=this.getRelatedActions(t);if(e.length<2)return null;const n=e.find(t=>"pending"===t.category),i=e.find(t=>"fulfilled"===t.category||"rejected"===t.category);return n&&i?i.timestamp-n.timestamp:null}getBaseActionType(t){const e=t.split("/");if(e.length>=2){const t=e[e.length-1];if(["pending","fulfilled","rejected"].includes(t))return e.slice(0,-1).join("/")}return t}getAsyncOperationIndex(t){const e=new Map;for(const t of this.actions)t.meta?.requestId&&!e.has(t.meta.requestId)&&e.set(t.meta.requestId,t.timestamp);const n=Array.from(e.entries()).sort((t,e)=>t[1]-e[1]).map(([t])=>t).indexOf(t);return n>=0?n+1:0}}export const reduxActionStore=new ReduxActionStore;
1
+ "use strict";function getActionCategory(t){return t.startsWith("@@")?"internal":t.includes("/pending")?"pending":t.includes("/fulfilled")?"fulfilled":t.includes("/rejected")?"rejected":t.includes("/executeQuery")?"query":t.includes("/executeMutation")?"mutation":"action"}function parseActionType(t){if(t.startsWith("@@")){const e=t.split("/");return{sliceName:null,actionName:e[e.length-1]||t}}const e=t.split("/");if(e.length>=2){const t=e[0];let n=e[1];return e.length>=3&&["pending","fulfilled","rejected"].includes(e[e.length-1])&&(n=e.slice(1,-1).join("/")),{sliceName:t,actionName:n.toUpperCase()}}return{sliceName:null,actionName:t.toUpperCase()}}function formatPayloadPreview(t,e=40){if(void 0===t)return"";if(null===t)return"null";try{if("string"==typeof t)return t.length>e?`"${t.slice(0,e-3)}..."`:`"${t}"`;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t)){if(0===t.length)return"[]";const n=JSON.stringify(t);return n.length>e?`[${t.length} items]`:n}if("object"==typeof t){const n=Object.keys(t);if(0===n.length)return"{}";const i=JSON.stringify(t);return i.length<=e?i:`{ ${n.length} keys }`}return String(t).slice(0,e)}catch{return"[complex]"}}function getStateDiffSummary(t,e){if(t===e)return{summary:"no change",changedCount:0};if("object"!=typeof t||"object"!=typeof e||null===t||null===e)return{summary:"changed",changedCount:1};const n=Object.keys(t),i=Object.keys(e),s=i.filter(t=>!n.includes(t)).length,r=n.filter(t=>!i.includes(t)).length;let a=0;for(const s of n)i.includes(s)&&t[s]!==e[s]&&a++;const o=[];s>0&&o.push(`+${s}`),r>0&&o.push(`-${r}`),a>0&&o.push(`~${a}`);const c=s+r+a;return 0===o.length?{summary:"nested change",changedCount:1}:{summary:`${o.join(" ")} ${1===c?"key":"keys"}`,changedCount:c}}function extractMeta(t){const e=t.meta;if(e)return{requestId:e.requestId,requestStatus:e.requestStatus,arg:e.arg,rejectedWithValue:e.rejectedWithValue,aborted:e.aborted,condition:e.condition}}class ReduxActionStore{actions=[];listeners=new Set;maxActions=200;idCounter=0;isEnabled=!0;addAction(t,e,n,i){if(!this.isEnabled)return;const s=t.type||"";if(!s)return;const r=e!==n,a=getActionCategory(s),{sliceName:o,actionName:c}=parseActionType(s),u=extractMeta(t),l=formatPayloadPreview(t.payload),{summary:d,changedCount:h}=getStateDiffSummary(e,n),g=(i??0)>16,f={id:`${Date.now()}-${++this.idCounter}`,type:s,payload:t.payload,action:t,timestamp:Date.now(),prevState:e,nextState:n,duration:i,hasStateChange:r,category:a,sliceName:o,actionName:c,meta:u,error:t.error,payloadPreview:l,diffSummary:d,changedKeysCount:h,isSlowAction:g};this.actions=[f,...this.actions].slice(0,this.maxActions),this.notifyListeners()}getActions(){return[...this.actions]}getActionById(t){return this.actions.find(e=>e.id===t)}clearActions(){this.actions=[],this.notifyListeners()}setEnabled(t){this.isEnabled=t}getEnabled(){return this.isEnabled}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(){const t=this.getActions();this.listeners.forEach(e=>e(t))}setMaxActions(t){this.maxActions=t,this.actions.length>t&&(this.actions=this.actions.slice(0,t),this.notifyListeners())}getStats(){const t=this.actions.length,e=this.actions.filter(t=>t.hasStateChange).length,n=new Set(this.actions.map(t=>t.type)),i=this.actions.filter(t=>void 0!==t.duration).map(t=>t.duration),s=i.length>0?i.reduce((t,e)=>t+e,0)/i.length:0;return{totalActions:t,actionsWithChanges:e,actionsWithoutChanges:t-e,uniqueActionTypes:n.size,averageDuration:Math.round(100*s)/100}}filterActions(t){let e=[...this.actions];if(t.searchText){const n=t.searchText.toLowerCase();e=e.filter(t=>t.type.toLowerCase().includes(n))}return t.actionTypes&&t.actionTypes.length>0&&(e=e.filter(e=>t.actionTypes.includes(e.type))),t.onlyWithChanges&&(e=e.filter(t=>t.hasStateChange)),e}getUniqueActionTypes(){return Array.from(new Set(this.actions.map(t=>t.type))).sort()}getRelatedActions(t){return this.actions.filter(e=>e.meta?.requestId===t).sort((t,e)=>t.timestamp-e.timestamp)}getLinkedActions(t){return t.meta?.requestId?this.getRelatedActions(t.meta.requestId):[]}getLinkedActionsCount(t){return t.meta?.requestId?this.actions.filter(e=>e.meta?.requestId===t.meta?.requestId).length:0}getAsyncOperationDuration(t){const e=this.getRelatedActions(t);if(e.length<2)return null;const n=e.find(t=>"pending"===t.category),i=e.find(t=>"fulfilled"===t.category||"rejected"===t.category);return n&&i?i.timestamp-n.timestamp:null}getBaseActionType(t){const e=t.split("/");if(e.length>=2){const t=e[e.length-1];if(["pending","fulfilled","rejected"].includes(t))return e.slice(0,-1).join("/")}return t}getAsyncOperationIndex(t){const e=new Map;for(const t of this.actions)t.meta?.requestId&&!e.has(t.meta.requestId)&&e.set(t.meta.requestId,t.timestamp);const n=Array.from(e.entries()).sort((t,e)=>t[1]-e[1]).map(([t])=>t).indexOf(t);return n>=0?n+1:0}}export const reduxActionStore=new ReduxActionStore;
@@ -3,26 +3,57 @@
3
3
  *
4
4
  * Redux Toolkit DevTools for React Native
5
5
  *
6
- * @example
6
+ * PUBLIC API - Only these exports are supported for external use.
7
+ * Internal stores are not exported to prevent bypassing the tool's
8
+ * intended usage patterns.
9
+ *
10
+ * ZERO-CONFIG: Just install this package - that's it!
11
+ * The Redux DevTools automatically instruments your store when
12
+ * FloatingDevTools mounts. No middleware, no configuration needed.
13
+ *
14
+ * @example Zero-config setup (just install and use!)
15
+ * ```tsx
16
+ * // 1. Install: npm install @buoy-gg/redux
17
+ *
18
+ * // 2. Your existing Redux setup (NO CHANGES NEEDED!)
19
+ * const store = configureStore({ reducer: rootReducer });
20
+ *
21
+ * // 3. Your app with FloatingDevTools (Redux tool auto-detected!)
22
+ * <Provider store={store}>
23
+ * <App />
24
+ * <FloatingDevTools /> // Redux tool appears automatically!
25
+ * </Provider>
26
+ * ```
27
+ *
28
+ * That's it! The Redux tool will auto-detect your store and capture actions.
29
+ *
30
+ * @example Advanced: Manual middleware (only if you need more control)
7
31
  * ```tsx
8
- * // 1. Add middleware to your Redux Toolkit store
9
- * import { configureStore } from '@reduxjs/toolkit';
10
- * import { buoyReduxMiddleware } from '@buoy-gg/redux';
32
+ * // For time-travel or custom options, you can optionally use middleware:
33
+ * import { buoyReduxMiddleware, withBuoyDevTools } from '@buoy-gg/redux';
11
34
  *
12
35
  * const store = configureStore({
13
- * reducer: rootReducer,
36
+ * reducer: withBuoyDevTools(rootReducer), // Enables time-travel
14
37
  * middleware: (getDefaultMiddleware) =>
15
38
  * getDefaultMiddleware().concat(buoyReduxMiddleware),
16
39
  * });
17
- *
18
- * // 2. Add the preset to FloatingDevTools
19
- * import { reduxToolPreset } from '@buoy-gg/redux';
20
- *
21
- * <FloatingDevTools apps={[reduxToolPreset]} />
22
40
  * ```
23
41
  */
24
42
  export { reduxToolPreset, createReduxTool } from "./preset";
25
- export { buoyReduxMiddleware, createBuoyReduxMiddleware } from "./redux/utils";
26
- export { createReduxHistoryAdapter, reduxHistoryAdapter, type ReduxHistoryAdapterOptions, } from "./redux/utils";
27
- export * from "./redux";
43
+ export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpToState, replayAction, BUOY_JUMP_TO_STATE, BUOY_REPLAY_ACTION, } from "./redux/utils/buoyReduxMiddleware";
44
+ export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, } from "./redux/utils/autoInstrument";
45
+ export type { AutoInstrumentOptions } from "./redux/utils/autoInstrument";
46
+ export { createReduxHistoryAdapter, reduxHistoryAdapter, type ReduxHistoryAdapterOptions, } from "./redux/utils/createReduxHistoryAdapter";
47
+ export { useReduxActions } from "./redux/hooks/useReduxActions";
48
+ export type { UseReduxActionsResult } from "./redux/hooks/useReduxActions";
49
+ export { useAutoInstrumentRedux, useReduxAvailability, } from "./redux/hooks/useAutoInstrumentRedux";
50
+ export type { UseAutoInstrumentReduxOptions, UseAutoInstrumentReduxResult, } from "./redux/hooks/useAutoInstrumentRedux";
51
+ export { ReduxModal, FREE_TIER_ACTION_LIMIT } from "./redux/components/ReduxModal";
52
+ export { ReduxActionItem } from "./redux/components/ReduxActionItem";
53
+ export { ReduxActionDetailView } from "./redux/components/ReduxActionDetailView";
54
+ export { ReduxActionDetailContent, ReduxActionDetailFooter, } from "./redux/components/ReduxActionDetailContent";
55
+ export { ReduxIcon } from "./redux/components/ReduxIcon";
56
+ export type { ActionCategory, ActionMeta, ReduxAction, ReduxFilter, ReduxConnectorOptions, ReduxStoreMinimal, BuoyReduxMiddlewareOptions, } from "./redux/types";
57
+ /** @internal */
58
+ export { reduxActionStore } from "./redux/utils/reduxActionStore";
28
59
  //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,32 @@
1
1
  /**
2
2
  * Pre-configured Redux DevTools preset for FloatingDevTools
3
3
  *
4
- * This preset provides a zero-config way to add Redux action monitoring to your dev tools.
5
- * Just import and add it to your apps array!
4
+ * ZERO-CONFIG: This preset is auto-discovered by FloatingDevTools!
5
+ * You do NOT need to import or configure anything - just install @buoy-gg/redux
6
+ * and the Redux tool will appear automatically in your FloatingDevTools.
6
7
  *
7
- * @example
8
+ * @example Automatic (recommended - no code needed!)
9
+ * ```tsx
10
+ * // Just install: npm install @buoy-gg/redux
11
+ * // The Redux tool appears automatically in FloatingDevTools!
12
+ *
13
+ * <Provider store={store}>
14
+ * <App />
15
+ * <FloatingDevTools /> // Redux tool is auto-detected
16
+ * </Provider>
17
+ * ```
18
+ *
19
+ * @example Manual (only for custom configuration)
8
20
  * ```tsx
9
- * import { reduxToolPreset } from '@buoy-gg/redux';
21
+ * import { createReduxTool } from '@buoy-gg/redux';
22
+ *
23
+ * // Only use this if you need to customize the tool
24
+ * const customReduxTool = createReduxTool({
25
+ * name: "STATE",
26
+ * iconColor: "#9945FF",
27
+ * });
10
28
  *
11
- * const installedApps = [
12
- * reduxToolPreset, // That's it!
13
- * // ...other tools
14
- * ];
29
+ * <FloatingDevTools apps={[customReduxTool]} />
15
30
  * ```
16
31
  */
17
32
  import { ReduxModal } from "./redux/components/ReduxModal";
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * Main Redux DevTools modal
3
+ *
4
+ * This component auto-instruments the Redux store when it mounts,
5
+ * providing zero-config action capture for the DevTools.
3
6
  */
4
7
  /** Free tier limit for action history */
5
8
  export declare const FREE_TIER_ACTION_LIMIT = 25;
@@ -1,5 +1,6 @@
1
1
  export { ReduxModal, FREE_TIER_ACTION_LIMIT } from "./ReduxModal";
2
2
  export { ReduxActionItem } from "./ReduxActionItem";
3
3
  export { ReduxActionDetailView } from "./ReduxActionDetailView";
4
+ export { ReduxActionDetailContent, ReduxActionDetailFooter, } from "./ReduxActionDetailContent";
4
5
  export { ReduxIcon } from "./ReduxIcon";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,5 @@
1
1
  export { useReduxActions } from "./useReduxActions";
2
2
  export type { UseReduxActionsResult } from "./useReduxActions";
3
+ export { useAutoInstrumentRedux, useReduxAvailability, } from "./useAutoInstrumentRedux";
4
+ export type { UseAutoInstrumentReduxOptions, UseAutoInstrumentReduxResult, } from "./useAutoInstrumentRedux";
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,64 @@
1
+ /**
2
+ * React hook for auto-instrumenting Redux stores
3
+ *
4
+ * This hook automatically patches the Redux store when the component mounts,
5
+ * providing zero-config action capture for the Redux DevTools.
6
+ *
7
+ * Usage:
8
+ * - The hook attempts to use react-redux's useStore() to get the store
9
+ * - If successful, it instruments the store automatically
10
+ * - If react-redux is not available or not in a Provider, it fails gracefully
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function ReduxDevTools() {
15
+ * const { isInstrumented, error } = useAutoInstrumentRedux();
16
+ *
17
+ * if (error) {
18
+ * return <Text>Redux not available: {error}</Text>;
19
+ * }
20
+ *
21
+ * return <ReduxActionList />;
22
+ * }
23
+ * ```
24
+ */
25
+ import type { Store } from "@reduxjs/toolkit";
26
+ import { type AutoInstrumentOptions } from "../utils/autoInstrument";
27
+ export interface UseAutoInstrumentReduxOptions extends AutoInstrumentOptions {
28
+ /** Whether to auto-start instrumentation (default: true) */
29
+ autoStart?: boolean;
30
+ }
31
+ export interface UseAutoInstrumentReduxResult {
32
+ /** Whether the store is currently instrumented */
33
+ isInstrumented: boolean;
34
+ /** Whether instrumentation is in progress */
35
+ isLoading: boolean;
36
+ /** Error message if instrumentation failed */
37
+ error: string | null;
38
+ /** Whether react-redux is available */
39
+ isReactReduxAvailable: boolean;
40
+ /** Manually start instrumentation */
41
+ startInstrumentation: () => void;
42
+ /** Manually stop instrumentation */
43
+ stopInstrumentation: () => void;
44
+ /** Reference to the instrumented store */
45
+ store: Store | null;
46
+ }
47
+ /**
48
+ * Hook to automatically instrument Redux store for DevTools
49
+ *
50
+ * This provides zero-config Redux action capture by:
51
+ * 1. Using react-redux's useStore() to get the Redux store
52
+ * 2. Automatically patching store.dispatch to capture actions
53
+ * 3. Cleaning up when the component unmounts
54
+ */
55
+ export declare function useAutoInstrumentRedux(options?: UseAutoInstrumentReduxOptions): UseAutoInstrumentReduxResult;
56
+ /**
57
+ * Lightweight hook to just check if Redux is available
58
+ * without auto-instrumenting
59
+ */
60
+ export declare function useReduxAvailability(): {
61
+ isAvailable: boolean;
62
+ error: string | null;
63
+ };
64
+ //# sourceMappingURL=useAutoInstrumentRedux.d.ts.map
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Auto-instrumentation for Redux stores
3
+ *
4
+ * This module provides zero-config Redux DevTools integration by automatically
5
+ * patching the store's dispatch method when the DevTools component mounts.
6
+ *
7
+ * Similar to how @buoy-gg/network patches globalThis.fetch, this patches
8
+ * store.dispatch to capture all Redux actions without requiring manual
9
+ * middleware configuration.
10
+ */
11
+ import type { Store, UnknownAction } from "@reduxjs/toolkit";
12
+ export interface AutoInstrumentOptions {
13
+ /** Enable time-travel support (requires replaceReducer) */
14
+ enableTimeTravel?: boolean;
15
+ /** Maximum number of actions to store */
16
+ maxActions?: number;
17
+ /** Action types to ignore */
18
+ ignoreActions?: string[];
19
+ }
20
+ /**
21
+ * Check if a store has already been instrumented
22
+ */
23
+ export declare function isStoreInstrumented(store: Store): boolean;
24
+ /**
25
+ * Instrument a Redux store for action capture
26
+ *
27
+ * This function patches store.dispatch to capture all actions without
28
+ * requiring the user to configure middleware manually.
29
+ *
30
+ * @param store - The Redux store to instrument
31
+ * @param options - Configuration options
32
+ * @returns Cleanup function to restore original dispatch
33
+ */
34
+ export declare function instrumentStore(store: Store, options?: AutoInstrumentOptions): () => void;
35
+ /**
36
+ * Remove instrumentation from a store
37
+ */
38
+ export declare function uninstrumentStore(store: Store): void;
39
+ /**
40
+ * Jump to a specific state (time-travel)
41
+ *
42
+ * For full time-travel support, users should use withBuoyDevTools.
43
+ * This limited version attempts to work with auto-instrumentation.
44
+ */
45
+ export declare function jumpToState(state: unknown): void;
46
+ /**
47
+ * Replay an action (dispatch it again)
48
+ */
49
+ export declare function replayAction(action: UnknownAction): void;
50
+ /**
51
+ * Get the currently active (instrumented) store
52
+ */
53
+ export declare function getActiveStore(): Store | null;
54
+ /**
55
+ * Check if auto-instrumentation is active
56
+ */
57
+ export declare function isAutoInstrumentActive(): boolean;
58
+ /**
59
+ * Check if time-travel support is enabled
60
+ */
61
+ export declare function isTimeTravelEnabled(): boolean;
62
+ //# sourceMappingURL=autoInstrument.d.ts.map
@@ -15,6 +15,11 @@
15
15
  */
16
16
  import type { Middleware, Reducer, UnknownAction } from "@reduxjs/toolkit";
17
17
  import type { BuoyReduxMiddlewareOptions } from "../types";
18
+ /**
19
+ * Check if the explicit middleware is active
20
+ * Used by auto-instrument to avoid duplicate capture
21
+ */
22
+ export declare function isMiddlewareActive(): boolean;
18
23
  export declare const BUOY_JUMP_TO_STATE = "@@buoy/JUMP_TO_STATE";
19
24
  export declare const BUOY_REPLAY_ACTION = "@@buoy/REPLAY_ACTION";
20
25
  /**
@@ -1,4 +1,6 @@
1
1
  export { reduxActionStore } from "./reduxActionStore";
2
2
  export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpToState, replayAction, BUOY_JUMP_TO_STATE, BUOY_REPLAY_ACTION, } from "./buoyReduxMiddleware";
3
3
  export { createReduxHistoryAdapter, reduxHistoryAdapter, type ReduxHistoryAdapterOptions, } from "./createReduxHistoryAdapter";
4
+ export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, jumpToState as autoJumpToState, replayAction as autoReplayAction, } from "./autoInstrument";
5
+ export type { AutoInstrumentOptions } from "./autoInstrument";
4
6
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,20 +1,34 @@
1
1
  {
2
2
  "name": "@buoy-gg/redux",
3
- "version": "0.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Redux Toolkit DevTools for React Native",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
7
7
  "types": "lib/typescript/index.d.ts",
8
8
  "react-native": "lib/module/index.js",
9
9
  "source": "src/index.tsx",
10
+ "exports": {
11
+ ".": {
12
+ "react-native": "./lib/module/index.js",
13
+ "import": {
14
+ "default": "./lib/module/index.js",
15
+ "types": "./lib/typescript/index.d.ts"
16
+ },
17
+ "require": {
18
+ "default": "./lib/commonjs/index.js",
19
+ "types": "./lib/typescript/index.d.ts"
20
+ }
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
10
24
  "files": [
11
25
  "lib"
12
26
  ],
13
27
  "sideEffects": false,
14
28
  "dependencies": {
15
- "@buoy-gg/shared-ui": "1.7.8",
16
- "@buoy-gg/floating-tools-core": "1.7.8",
17
- "@buoy-gg/license": "1.7.8"
29
+ "@buoy-gg/shared-ui": "2.1.2",
30
+ "@buoy-gg/floating-tools-core": "2.1.2",
31
+ "@buoy-gg/license": "2.1.2"
18
32
  },
19
33
  "peerDependencies": {
20
34
  "@reduxjs/toolkit": ">=2.0.0",