draft-js-plugins-utils

Plugin utilities for draft js

Usage no npm install needed!

<script type="module">
  import draftJsPluginsUtils from 'https://cdn.skypack.dev/draft-js-plugins-utils';
</script>

README

Draft js plugin utilities

Available methods

createLinkAtSelection

createLinkAtSelection(
  editorState: EditorState,
  url: string
) => EditorState

removeLinkAtSelection

removeLinkAtSelection(
  editorState: EditorState,
) => EditorState

getCurrentEntityKey

getCurrentEntityKey(
  editorState: EditorState,
) => DraftEntityKey

getCurrentEntity

getCurrentEntity(
  editorState: EditorState,
) => DraftEntity

hasEntity

hasEntity(
  editorState: EditorState,
  entityType: DraftEntityType
) => boolean