How to use the draft-js-plugins-utils.hasEntity function in draft-js-plugins-utils

To help you get started, we’ve selected a few draft-js-plugins-utils 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 LessWrong2 / Lesswrong2 / packages / lesswrong / components / async / editor-plugins / sidenote-plugin / SidenoteButton.jsx View on Github external
isSidenoteEntityActive = () => {
    return EditorUtils.hasEntity(this.props.getEditorState(), 'SIDENOTE');
  }
github draft-js-plugins / draft-js-plugins / draft-js-anchor-plugin / src / components / LinkButton / index.js View on Github external
render() {
    const { theme, onRemoveLinkAtSelection } = this.props;
    const hasLinkSelected = EditorUtils.hasEntity(
      this.props.store.getEditorState(),
      'LINK'
    );
    const className = hasLinkSelected
      ? clsx(theme.button, theme.active)
      : theme.button;

    return (
      <div>
        <button type="button"></button></div>
github LessWrong2 / Lesswrong2 / packages / lesswrong / components / async / editor-plugins / LinkButton / index.js View on Github external
render() {
    const { theme } = this.props;
    const hasLinkSelected = EditorUtils.hasEntity(
      this.props.getEditorState(),
      'LINK'
    );
    const className = hasLinkSelected
      ? unionClassNames(theme.button, theme.active)
      : theme.button;

    return (
      <div>
        </div>
github LessWrong2 / Lesswrong2 / packages / lesswrong / components / async / editor-plugins / sidenote-plugin / index.js View on Github external
const isSidenoteSelected = (editorState) => {
  return EditorUtils.hasEntity(editorState, 'SIDENOTE');
}
github plone / volto / src / components / manage / AnchorPlugin / components / LinkButton / index.jsx View on Github external
render() {
    const { theme, onRemoveLinkAtSelection } = this.props;
    const hasLinkSelected = EditorUtils.hasEntity(
      this.props.store.getEditorState(),
      'LINK',
    );
    const className = hasLinkSelected
      ? unionClassNames(theme.button, theme.active)
      : theme.button;

    return (
      <div role="presentation">
        </div>

draft-js-plugins-utils

Plugin utilities for draft js

MIT
Latest version published 6 years ago

Package Health Score

69 / 100
Full package analysis