old_contents: export const updateElementInWorkspace = (workspace, payload) => {
    const { selectionState } = workspace
  
    if(!selectionState.dragStarted) {
      return workspace
    }
  
    const { currentMousePosition } = payload
    const {
      elementId,
      startElementPosition,
      startMousePosition
    } = selectionState
    const element = workspace.entities[elementId]
  
    return Object.assign({}, workspace, {
      ...workspace,
      entities: {
        ...workspace.entities,
        [elementId]: {
          ...element,
          position: {
            x: startElementPosition.x + currentMousePosition.x - startMousePosition.x,
            y: startElementPosition.y + currentMousePosition.y - startMousePosition.y,
          }
        }
      }
    })
  }
  
  export const addDragStartedToWorkspace = (workspace, payload) => {
    const  {
      elementId,
      elementPosition,
      mousePosition
    } = payload
  
    return setDragStateToWorkspace(
      workspace,
      {
        dragStarted: true,
        elementId: elementId,
        startElementPosition: elementPosition,
        startMousePosition: mousePosition
      }
    )
  }
  
  export const addDragStoppedToWorkspace = (workspace, payload) => {
    return setDragStateToWorkspace(
      workspace,
      {
        dragStarted: false
      }
    )
  }
  
  export const setDragStateToWorkspace = (workspace, dragState) => {
    return Object.assign({}, workspace, {
      ...workspace,
      selectionState: {
        ...workspace.selectionState,
        ...dragState
      }
    })
  }
  
new_contents: export const updateElementInWorkspace = (workspace, payload) => {
    const { selectionState } = workspace
  
    if(!selectionState.dragStarted) {
      return workspace
    }
  
    const { currentMousePosition } = payload
    const { element } = selectionState
    const originalElement = workspace.entities[element.id]
  
    return Object.assign({}, workspace, {
      ...workspace,
      entities: {
        ...workspace.entities,
        [element.id]: {
          ...originalElement,
          position: {
            x: element.startPosition.x + currentMousePosition.x - element.mouseDownPosition.x,
            y: element.startPosition.y + currentMousePosition.y - element.mouseDownPosition.y,
          }
        }
      }
    })
  }
  
  export const addDragStartedToWorkspace = (workspace, payload) => {
    const  {
      elementId,
      elementPosition,
      mousePosition
    } = payload
  
    return setDragStateToWorkspace(
      workspace,
      {
        dragStarted: true,
        element: {
          id: elementId,
          mouseDownPosition: mousePosition,
          startPosition: elementPosition
        }
      }
    )
  }
  
  export const addDragStoppedToWorkspace = (workspace, payload) => {
    return setDragStateToWorkspace(
      workspace,
      {
        dragStarted: false
      }
    )
  }
  
  export const setDragStateToWorkspace = (workspace, dragState) => {
    return Object.assign({}, workspace, {
      ...workspace,
      selectionState: {
        ...workspace.selectionState,
        ...dragState
      }
    })
  }
  
subject: Save in the same place inside 'state', 'selected' & 'dragging' element