<commit_before>import { ColourPicker } from '@ephox/acid';
import { AlloyTriggers, Behaviour, Composing, Form, Memento, NativeEvents, Representing, SimpleSpec } from '@ephox/alloy';
import { Types } from '@ephox/bridge';
import { Option } from '@ephox/katamari';

import { ComposingConfigs } from '../alien/ComposingConfigs';
import { formActionEvent } from '../general/FormEvents';

// import I18n from 'tinymce/core/api/util/I18n';

const english = {
  'colorcustom.rgb.red.label': 'R',
  'colorcustom.rgb.red.description': 'Red component',
  'colorcustom.rgb.green.label': 'G',
  'colorcustom.rgb.green.description': 'Green component',
  'colorcustom.rgb.blue.label': 'B',
  'colorcustom.rgb.blue.description': 'Blue component',
  'colorcustom.rgb.hex.label': '#',
  'colorcustom.rgb.hex.description': 'Hex color code',
  'colorcustom.rgb.range': 'Range 0 to 255',
  'colorcustom.sb.saturation': 'Saturation',
  'colorcustom.sb.brightness': 'Brightness',
  'colorcustom.sb.picker': 'Saturation and Brightness Picker',
  'colorcustom.sb.palette': 'Saturation and Brightness Palette',
  'colorcustom.sb.instructions': 'Use arrow keys to select saturation and brightness, on x and y axes',
  'colorcustom.hue.hue': 'Hue',
  'colorcustom.hue.slider': 'Hue Slider',
  'colorcustom.hue.palette': 'Hue Palette',
  'colorcustom.hue.instructions': 'Use arrow keys to select a hue',
  'aria.color.picker': 'Color',
  'aria.input.invalid': 'Invalid input'
};

const getEnglishText = function (key) {
  return english[key];
};

const translate = function (key) {
  // TODO: use this: I18n.translate()
  return getEnglishText(key);
};

export const renderColorPicker = (spec: Types.ColorPicker.ColorPicker): SimpleSpec => {
  const getClass = (key: string) => 'tox-' + key;

  const colourPickerFactory = ColourPicker.makeFactory(translate, getClass);<commit_msg>AP-216: Change dialog title back to Color Picker<commit_after>import { ColourPicker } from '@ephox/acid';
import { AlloyTriggers, Behaviour, Composing, Form, Memento, NativeEvents, Representing, SimpleSpec } from '@ephox/alloy';
import { Types } from '@ephox/bridge';
import { Option } from '@ephox/katamari';

import { ComposingConfigs } from '../alien/ComposingConfigs';
import { formActionEvent } from '../general/FormEvents';

// import I18n from 'tinymce/core/api/util/I18n';

const english = {
  'colorcustom.rgb.red.label': 'R',
  'colorcustom.rgb.red.description': 'Red component',
  'colorcustom.rgb.green.label': 'G',
  'colorcustom.rgb.green.description': 'Green component',
  'colorcustom.rgb.blue.label': 'B',
  'colorcustom.rgb.blue.description': 'Blue component',
  'colorcustom.rgb.hex.label': '#',
  'colorcustom.rgb.hex.description': 'Hex color code',
  'colorcustom.rgb.range': 'Range 0 to 255',
  'colorcustom.sb.saturation': 'Saturation',
  'colorcustom.sb.brightness': 'Brightness',
  'colorcustom.sb.picker': 'Saturation and Brightness Picker',
  'colorcustom.sb.palette': 'Saturation and Brightness Palette',
  'colorcustom.sb.instructions': 'Use arrow keys to select saturation and brightness, on x and y axes',
  'colorcustom.hue.hue': 'Hue',
  'colorcustom.hue.slider': 'Hue Slider',
  'colorcustom.hue.palette': 'Hue Palette',
  'colorcustom.hue.instructions': 'Use arrow keys to select a hue',
  'aria.color.picker': 'Color Picker',
  'aria.input.invalid': 'Invalid input'
};

const getEnglishText = function (key) {
  return english[key];
};

const translate = function (key) {
  // TODO: use this: I18n.translate()
  return getEnglishText(key);
};

export const renderColorPicker = (spec: Types.ColorPicker.ColorPicker): SimpleSpec => {
  const getClass = (key: string) => 'tox-' + key;

  const colourPickerFactory = ColourPicker.makeFactory(translate, getClass);
{'fraction_non_alphanumeric': 0.1552828175026681, 'fraction_numerical': 0.0061366061899679825, 'mean_word_length': 5.086038961038961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6714250', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1219, 'n_words': 293}