diff --git a/package.json b/package.json index 875352da6fa..967915a3e86 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,8 @@ "react-is": "~16.3.0", "react-virtualized": "^9.21.2", "resize-observer-polyfill": "^1.5.0", + "showdown": "^1.9.1", + "showdown-htmlescape": "^0.1.9", "tabbable": "^3.0.0", "uuid": "^3.1.0" }, diff --git a/src-docs/src/i18ntokens.json b/src-docs/src/i18ntokens.json index 446a147032f..c754f85d36c 100644 --- a/src-docs/src/i18ntokens.json +++ b/src-docs/src/i18ntokens.json @@ -1407,6 +1407,86 @@ }, "filepath": "src/components/link/link.tsx" }, + { + "token": "euiMarkdownEditor.boldStyles", + "defString": "Bold and italic styles", + "highlighting": "string", + "loc": { + "start": { + "line": 136, + "column": 16 + }, + "end": { + "line": 138, + "column": 51 + } + }, + "filepath": "src/components/markdown_editor/markdown_editor.tsx" + }, + { + "token": "euiMarkdownEditor.quoteStyles", + "defString": "Quote, code and link styles", + "highlighting": "string", + "loc": { + "start": { + "line": 155, + "column": 16 + }, + "end": { + "line": 157, + "column": 56 + } + }, + "filepath": "src/components/markdown_editor/markdown_editor.tsx" + }, + { + "token": "euiMarkdownEditor.listStyles", + "defString": "Unordered and ordered list styles", + "highlighting": "string", + "loc": { + "start": { + "line": 174, + "column": 16 + }, + "end": { + "line": 176, + "column": 62 + } + }, + "filepath": "src/components/markdown_editor/markdown_editor.tsx" + }, + { + "token": "euiMarkdownEditor.edit", + "defString": "Edit", + "highlighting": "string", + "loc": { + "start": { + "line": 202, + "column": 20 + }, + "end": { + "line": 202, + "column": 77 + } + }, + "filepath": "src/components/markdown_editor/markdown_editor.tsx" + }, + { + "token": "euiMarkdownEditor.previewMarkdown", + "defString": "Preview markdown", + "highlighting": "string", + "loc": { + "start": { + "line": 204, + "column": 20 + }, + "end": { + "line": 207, + "column": 22 + } + }, + "filepath": "src/components/markdown_editor/markdown_editor.tsx" + }, { "token": "euiModal.closeModal", "defString": "Closes this modal window", diff --git a/src-docs/src/views/form_controls/form_controls_example.js b/src-docs/src/views/form_controls/form_controls_example.js index 4c61e9ea9f4..1f69ee3dde1 100644 --- a/src-docs/src/views/form_controls/form_controls_example.js +++ b/src-docs/src/views/form_controls/form_controls_example.js @@ -20,6 +20,7 @@ import { EuiFormControlLayout, EuiFormControlLayoutDelimited, EuiLink, + EuiMarkdownEditor, EuiRadio, EuiRadioGroup, EuiSelect, @@ -47,6 +48,10 @@ import TextArea from './text_area'; const textAreaSource = require('!!raw-loader!./text_area'); const textAreaHtml = renderToHtml(TextArea); +import MarkdownEditor from './markdown_editor'; +const markdownEditorSource = require('!!raw-loader!./markdown_editor'); +const markdownEditorHtml = renderToHtml(MarkdownEditor); + import { FilePicker } from './file_picker'; const filePickerSource = require('!!raw-loader!./file_picker'); const filePickerHtml = renderToHtml(FilePicker); @@ -203,6 +208,29 @@ export const FormControlsExample = { }, demo: