@@ -9,7 +9,7 @@ import { getBase16Theme } from 'react-base16-styling';
99import { reducer , updateMonitorState } from './redux' ;
1010import { ActionCreators } from 'redux-devtools' ;
1111
12- const { commit, sweep, toggleAction, jumpToAction, jumpToState } = ActionCreators ;
12+ const { commit, sweep, toggleAction, jumpToAction, jumpToState, reorderAction } = ActionCreators ;
1313
1414function getLastActionId ( props ) {
1515 return props . stagedActionIds [ props . stagedActionIds . length - 1 ] ;
@@ -86,6 +86,7 @@ export default class DevtoolsInspector extends Component {
8686 initialScrollTop : PropTypes . number
8787 } ) ,
8888 preserveScrollTop : PropTypes . bool ,
89+ draggableActions : PropTypes . bool ,
8990 stagedActions : PropTypes . array ,
9091 select : PropTypes . func . isRequired ,
9192 theme : PropTypes . oneOfType ( [
@@ -100,6 +101,7 @@ export default class DevtoolsInspector extends Component {
100101 static defaultProps = {
101102 select : ( state ) => state ,
102103 supportImmutable : false ,
104+ draggableActions : true ,
103105 theme : 'inspector' ,
104106 invertTheme : true
105107 } ;
@@ -136,7 +138,9 @@ export default class DevtoolsInspector extends Component {
136138 getCurrentActionId ( nextProps , nextMonitorState ) ||
137139 monitorState . startActionId !== nextMonitorState . startActionId ||
138140 monitorState . inspectedStatePath !== nextMonitorState . inspectedStatePath ||
139- monitorState . inspectedActionPath !== nextMonitorState . inspectedActionPath
141+ monitorState . inspectedActionPath !== nextMonitorState . inspectedActionPath ||
142+ this . props . computedStates !== nextProps . computedStates ||
143+ this . props . stagedActionIds !== nextProps . stagedActionIds
140144 ) {
141145 this . setState ( createIntermediateState ( nextProps , nextMonitorState ) ) ;
142146 }
@@ -148,7 +152,7 @@ export default class DevtoolsInspector extends Component {
148152 }
149153
150154 render ( ) {
151- const { stagedActionIds : actionIds , actionsById : actions , computedStates,
155+ const { stagedActionIds : actionIds , actionsById : actions , computedStates, draggableActions ,
152156 tabs, invertTheme, skippedActionIds, currentStateIndex, monitorState } = this . props ;
153157 const { selectedActionId, startActionId, searchValue, tabName } = monitorState ;
154158 const inspectedPathType = tabName === 'Action' ? 'inspectedActionPath' : 'inspectedStatePath' ;
@@ -162,16 +166,16 @@ export default class DevtoolsInspector extends Component {
162166 ref = 'inspector'
163167 { ...styling ( [ 'inspector' , isWideLayout && 'inspectorWide' ] , isWideLayout ) } >
164168 < ActionList { ...{
165- actions, actionIds, isWideLayout, searchValue, selectedActionId, startActionId
169+ actions, actionIds, isWideLayout, searchValue, selectedActionId, startActionId,
170+ skippedActionIds, draggableActions, styling
166171 } }
167- styling = { styling }
168172 onSearch = { this . handleSearch }
169173 onSelect = { this . handleSelectAction }
170174 onToggleAction = { this . handleToggleAction }
171175 onJumpToState = { this . handleJumpToState }
172176 onCommit = { this . handleCommit }
173177 onSweep = { this . handleSweep }
174- skippedActionIds = { skippedActionIds }
178+ onReorderAction = { this . handleReorderAction }
175179 currentActionId = { actionIds [ currentStateIndex ] }
176180 lastActionId = { getLastActionId ( this . props ) } />
177181 < ActionPreview { ...{
@@ -199,6 +203,10 @@ export default class DevtoolsInspector extends Component {
199203 }
200204 } ;
201205
206+ handleReorderAction = ( actionId , beforeActionId ) => {
207+ if ( reorderAction ) this . props . dispatch ( reorderAction ( actionId , beforeActionId ) ) ;
208+ } ;
209+
202210 handleCommit = ( ) => {
203211 this . props . dispatch ( commit ( ) ) ;
204212 } ;
0 commit comments