How to use the megadraft.insertDataBlock function in megadraft

To help you get started, we’ve selected a few megadraft 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 globocom / generator-megadraft-plugin / generators / app / templates / src / Button.js View on Github external
onClick(e) {
    const data = {
      type: constants.PLUGIN_TYPE,
      caption: "Initial plugin text",
    };

    this.props.onChange(insertDataBlock(this.props.editorState, data));
  }
github globocom / megadraft-table-plugin / src / Button.js View on Github external
onSave(tableConfig) {
    this.setState({isEditing: false});
    const data = {
      type: constants.PLUGIN_TYPE,
      ...tableConfig
    };

    this.props.onChange(insertDataBlock(this.props.editorState, data));
  }
github globocom / megadraft-related-articles-plugin / src / Button.js View on Github external
onClick(e) {
    const data = {articles: [{key: DraftJS.genKey()}], type: constants.PLUGIN_TYPE};
    this.props.onChange(insertDataBlock(this.props.editorState, data));
  }