@buoy-gg/redux 0.1.1 → 2.1.1

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.
@@ -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,"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,"useReduxActions",{enumerable:!0,get:function(){return _useReduxActions.useReduxActions}}),Object.defineProperty(exports,"withBuoyDevTools",{enumerable:!0,get:function(){return _buoyReduxMiddleware.withBuoyDevTools}});var _preset=require("./preset"),_buoyReduxMiddleware=require("./redux/utils/buoyReduxMiddleware"),_createReduxHistoryAdapter=require("./redux/utils/createReduxHistoryAdapter"),_useReduxActions=require("./redux/hooks/useReduxActions"),_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}),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";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{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils/createReduxHistoryAdapter";export{useReduxActions}from"./redux/hooks/useReduxActions";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";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";
@@ -3,6 +3,10 @@
3
3
  *
4
4
  * Redux Toolkit DevTools for React Native
5
5
  *
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
+ *
6
10
  * @example
7
11
  * ```tsx
8
12
  * // 1. Add middleware to your Redux Toolkit store
@@ -22,7 +26,16 @@
22
26
  * ```
23
27
  */
24
28
  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";
29
+ export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpToState, replayAction, BUOY_JUMP_TO_STATE, BUOY_REPLAY_ACTION, } from "./redux/utils/buoyReduxMiddleware";
30
+ export { createReduxHistoryAdapter, reduxHistoryAdapter, type ReduxHistoryAdapterOptions, } from "./redux/utils/createReduxHistoryAdapter";
31
+ export { useReduxActions } from "./redux/hooks/useReduxActions";
32
+ export type { UseReduxActionsResult } from "./redux/hooks/useReduxActions";
33
+ export { ReduxModal, FREE_TIER_ACTION_LIMIT } from "./redux/components/ReduxModal";
34
+ export { ReduxActionItem } from "./redux/components/ReduxActionItem";
35
+ export { ReduxActionDetailView } from "./redux/components/ReduxActionDetailView";
36
+ export { ReduxActionDetailContent, ReduxActionDetailFooter, } from "./redux/components/ReduxActionDetailContent";
37
+ export { ReduxIcon } from "./redux/components/ReduxIcon";
38
+ export type { ActionCategory, ActionMeta, ReduxAction, ReduxFilter, ReduxConnectorOptions, ReduxStoreMinimal, BuoyReduxMiddlewareOptions, } from "./redux/types";
39
+ /** @internal */
40
+ export { reduxActionStore } from "./redux/utils/reduxActionStore";
28
41
  //# sourceMappingURL=index.d.ts.map
@@ -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
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.1",
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.1",
30
+ "@buoy-gg/floating-tools-core": "2.1.1",
31
+ "@buoy-gg/license": "2.1.1"
18
32
  },
19
33
  "peerDependencies": {
20
34
  "@reduxjs/toolkit": ">=2.0.0",