<commit_before>'use strict';

var Toolbar = require('../../ui/Toolbar');
var Icon = require('../../ui/FontAwesomeIcon');
var clone = require('lodash/clone');
var UndoTool = require('../../ui/UndoTool');
var RedoTool = require('../../ui/RedoTool');
var SwitchTextTypeTool = require('../../packages/text/SwitchTextTypeTool');
var StrongTool = require('../../packages/strong/StrongTool');
var EmphasisTool = require('../../packages/emphasis/EmphasisTool');
var LinkTool = require('../../packages/link/LinkTool');
var EditLinkTool = require('../../packages/link/EditLinkTool');

function ProseEditorTools() {
  Toolbar.apply(this, arguments);
}

ProseEditorTools.Prototype = function() {

  this.render = function($$) {
    var el = $$("div").addClass('sc-example-toolbar');
    var commandStates = this.props.commandStates;

    // TODO: Remove clone hack once #577 is fixed
    var tools = [
      $$(SwitchTextTypeTool, clone(commandStates['switch-text-type'])),
      $$(UndoTool, clone(commandStates.undo)).append($$(Icon, {icon: 'fa-undo'})),
      $$(RedoTool, clone(commandStates.redo)).append($$(Icon, {icon: 'fa-repeat'})),
      $$(StrongTool, clone(commandStates.strong)).append($$(Icon, {icon: 'fa-bold'})),
      $$(EmphasisTool, clone(commandStates.emphasis)).append($$(Icon, {icon: 'fa-italic'})),
      $$(LinkTool, clone(commandStates.link)).append($$(Icon, {icon: 'fa-link'}))
    ];

    if (this.props.tools) {
      this.props.tools.forEach(function(tool) {
        tools.push(
          $$(tool.component, clone(commandStates[tool.commandName])).append(
            $$(Icon, {icon: tool.icon})
          )
        );
      });
    }

    if (commandStates['link'].mode === 'edit') {
      tools.push(
        $$(EditLinkTool, clone(commandStates.link))
      );
    }

    if (this.props.tools) {<commit_msg>Consider custom tool configuration in ProseEditor.<commit_after>'use strict';

var Toolbar = require('../../ui/Toolbar');
var Icon = require('../../ui/FontAwesomeIcon');
var clone = require('lodash/clone');
var UndoTool = require('../../ui/UndoTool');
var RedoTool = require('../../ui/RedoTool');
var SwitchTextTypeTool = require('../../packages/text/SwitchTextTypeTool');
var StrongTool = require('../../packages/strong/StrongTool');
var EmphasisTool = require('../../packages/emphasis/EmphasisTool');
var LinkTool = require('../../packages/link/LinkTool');
var EditLinkTool = require('../../packages/link/EditLinkTool');

function ProseEditorTools() {
  Toolbar.apply(this, arguments);
}

ProseEditorTools.Prototype = function() {

  this.render = function($$) {
    var el = $$("div").addClass('sc-example-toolbar');
    var commandStates = this.props.commandStates;
    var config = this.context.config;

    // TODO: Remove clone hack once #577 is fixed
    var tools = [
      $$(SwitchTextTypeTool, clone(commandStates['switch-text-type'])),
      $$(UndoTool, clone(commandStates.undo)).append($$(Icon, {icon: 'fa-undo'})),
      $$(RedoTool, clone(commandStates.redo)).append($$(Icon, {icon: 'fa-repeat'})),
      $$(StrongTool, clone(commandStates.strong)).append($$(Icon, {icon: 'fa-bold'})),
      $$(EmphasisTool, clone(commandStates.emphasis)).append($$(Icon, {icon: 'fa-italic'})),
      $$(LinkTool, clone(commandStates.link)).append($$(Icon, {icon: 'fa-link'}))
    ];

    if (config.tools) {
      config.tools.forEach(function(tool) {
        tools.push(
          $$(tool.component, clone(commandStates[tool.commandName])).append(
            $$(Icon, {icon: tool.icon})
          )
        );
      });
    }

    if (commandStates['link'].mode === 'edit') {
      tools.push(
        $$(EditLinkTool, clone(commandStates.link))
      );
    }

    if (this.props.tools) {
{'fraction_non_alphanumeric': 0.20773985487772104, 'fraction_numerical': 0.0016124697661918839, 'mean_word_length': 3.500604594921403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300798', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1144, 'n_words': 198}