How to use the @sanity/block-tools.EDITOR_DEFAULT_BLOCK_TYPE.type function in @sanity/block-tools

To help you get started, we’ve selected a few @sanity/block-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / form-builder / src / inputs / BlockEditor / Editor.tsx View on Github external
constructor(props: Props) {
    super(props)
    this.editorSchema = buildEditorSchema(props.blockContentFeatures)
    this.plugins = [
      QueryPlugin(),
      ListItemOnEnterKeyPlugin({defaultBlock: EDITOR_DEFAULT_BLOCK_TYPE}),
      ListItemOnTabKeyPlugin(),
      ToggleListItemPlugin(),
      TextBlockOnEnterKeyPlugin({defaultBlock: EDITOR_DEFAULT_BLOCK_TYPE}),
      SetMarksOnKeyComboPlugin({
        decorators: props.blockContentFeatures.decorators.map(item => item.value)
      }),
      SoftBreakPlugin({
        onlyIn: [EDITOR_DEFAULT_BLOCK_TYPE.type],
        shift: true
      }),
      PastePlugin({
        controller: this.editor,
        blockContentType: props.type,
        blockContentFeatures: props.blockContentFeatures,
        onChange: props.onChange,
        onProgress: this.handlePasteProgress
      }),
      insertBlockOnEnter(EDITOR_DEFAULT_BLOCK_TYPE),
      OnDropPlugin(),
      OnFocusPlugin(),
      TogglePlaceHolderPlugin(),
      SetBlockStylePlugin(),
      ToggleAnnotationPlugin(),
      ExpandToWordPlugin(),