createSelectionFormatState = formats => {
  // NOTE: Normally only one format can be selected but the selection is
  // given as array by Muya.
  const state = {}
  for (const item of formats) {
    state[item.type] = true
  }
  return state
}
Creates a object that contains the formats selection state.

@param {*} selection The selection.
@returns A object that represents the formats menu state.