Example #1
0
const clearReducer = () => state => {
    const focusedNodePath = nodes.focusedNodePathSelector(state);
    return $all(
        $set('ui.inspector.shouldPromptToHandleUnappliedChanges', false),
        $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath]),
        state
    );
};
Example #2
0
    [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);
    },
Example #3
0
    [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);
    },
Example #4
0
 [REMOVE]: contextPath => $drop(['cr', 'nodes', 'byContextPath', contextPath]),
Example #5
0
const clearReducer = () => state => {
    const focusedNodePath = nodes.focusedNodePathSelector(state);
    return $drop(['ui', 'inspector', 'valuesByNodePath', focusedNodePath], state);
};