hunk.code_window: import { Editor, getEventRange, getEventTransfer } from 'slate-react'
   import { Block, Value } from 'slate'
   import React from 'react'
   import initialValueAsJson from './value.json'
   import imageExtensions from 'image-extensions'
  
hunk.labels: replace keep keep keep keep keep
hunk.after_edit: import { Editor, getEventTransfer } from 'slate-react'
  
hunk.file_path: examples/images/index.js
hunk.type: replace
file: export default function CollapseOnEscape(options = {}) {
    return {
      onKeyDown(event, editor, next) {
        const { value } = editor
        const { selection } = value
  
        if (event.key === 'Escape' && selection.isExpanded) {
          editor.moveToEnd()
        } else {
          return next()
        }
      },
    }
  }
  