const clearReducer = () => state => { const focusedNodePath = nodes.focusedNodePathSelector(state); return $all( $set('ui.inspector.shouldPromptToHandleUnappliedChanges', false), $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath]), state ); };
[COMMIT]: ({propertyId, value, hooks}) => state => { const focusedNodePath = nodes.focusedNodePathSelector(state); const setValueForProperty = (data, state) => $set(['ui', 'inspector', 'valuesByNodePath', focusedNodePath, propertyId], data, state); if (value !== null && hooks) { return setValueForProperty(Immutable.fromJS({value, hooks}), state); } if (value !== null) { return setValueForProperty(Immutable.fromJS({value}), state); } return $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath, propertyId], state); },
[COMMIT]: ({propertyId, value, hooks}) => state => { const focusedNode = nodes.focusedSelector(state); const focusedNodePath = $get('contextPath', focusedNode); const currentPropertyValue = $get(['properties', propertyId], focusedNode); const setValueForProperty = (data, state) => $set(['ui', 'inspector', 'valuesByNodePath', focusedNodePath, propertyId], data, state); const transientValueDiffers = (value !== null) && (value !== currentPropertyValue); if (transientValueDiffers && hooks) { return setValueForProperty(fromJSOrdered({value, hooks}), state); } if (transientValueDiffers) { return setValueForProperty(fromJSOrdered({value}), state); } return $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath, propertyId], state); },
[REMOVE]: contextPath => $drop(['cr', 'nodes', 'byContextPath', contextPath]),
const clearReducer = () => state => { const focusedNodePath = nodes.focusedNodePathSelector(state); return $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath], state); };