Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
721d094
Added popover to display help syntax text when no plugins are available
elizabetdev Sep 6, 2021
0d7fd8e
New title for the example
elizabetdev Sep 6, 2021
39e77e2
Adding CL
elizabetdev Sep 7, 2021
90a669a
Made opting out of the tooltip markdown plugin much easier
chandlerprall Sep 7, 2021
34ba51d
Merge pull request #23 from chandlerprall/md-editor-syntax-help-no-pl…
elizabetdev Sep 8, 2021
d6b1585
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 8, 2021
c20910f
Improving text and example
elizabetdev Sep 8, 2021
50d84b5
Example text
elizabetdev Sep 8, 2021
2aecd82
Added CL line
elizabetdev Sep 8, 2021
54e7a76
CL again
elizabetdev Sep 8, 2021
51aabb2
Adding tests
elizabetdev Sep 8, 2021
fbd09a8
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 8, 2021
b80b9d5
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 9, 2021
973fcf0
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 10, 2021
a1b3e0a
unified types
thompsongl Sep 10, 2021
339d9d4
Merge pull request #24 from thompsongl/md-editor-syntax-help-no-plugi…
elizabetdev Sep 10, 2021
e66ca53
No more HTML tabs
elizabetdev Sep 13, 2021
b39ffb7
Update src-docs/src/views/markdown_editor/mardown_editor_example.js
elizabetdev Sep 13, 2021
5bc410b
Update src-docs/src/views/markdown_editor/mardown_editor_example.js
elizabetdev Sep 13, 2021
60d6780
Merge branch 'md-editor-syntax-help-no-plugins-ui' of https://github.…
elizabetdev Sep 13, 2021
6e6fc3f
Code review
elizabetdev Sep 14, 2021
7b5d5cc
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 14, 2021
5cabc57
No more help syntax tooltip
elizabetdev Sep 14, 2021
14099c5
No plugins with just a tooltip
elizabetdev Sep 14, 2021
32aa812
CL
elizabetdev Sep 14, 2021
d82b9a7
Removed unnecessary styles
elizabetdev Sep 14, 2021
42107e3
CL
elizabetdev Sep 14, 2021
92dadbc
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 16, 2021
96492da
Merge remote-tracking branch 'upstream/master' into md-editor-syntax-…
elizabetdev Sep 22, 2021
6d94f22
Popover and new github link
elizabetdev Sep 22, 2021
b418a88
Only show modal for `hasUiPluginsWithHelpText`
elizabetdev Sep 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Fixed the `title` prop `EuiButtonGroup` to automatically display the `label` provided ([#5199](https://github.com/elastic/eui/pull/5199))
- Updated `barSeriesStyle.displayValue` of the elastic-charts `Theme` for better default styles ([#4845](https://github.com/elastic/eui/pull/4845))
- Added a configuration parameter to the `EuiMarkdownEditor` plugin functions to exclude custom plugins ([#5147](https://github.com/elastic/eui/pull/5147))
- Added `auto` as value for `defaultHeight` in prop `rowHeightsOptions` in `EuiDataGrid` that allows to content auto-fit to row ([#4958](https://github.com/elastic/eui/pull/4958))
- Updated `titleProps` and `descriptionProps` on `EuiDescriptionList` to extend `CommonProps` ([#5166](https://github.com/elastic/eui/pull/5166))
- Added the ability to return `visibleOptions` from `EuiSelectable` by using `onSearch` ([#5178](https://github.com/elastic/eui/pull/5178))
Expand All @@ -10,6 +11,7 @@

- Fixed `EuiDataGrid` focus ring to be contained in the cell ([#5194](https://github.com/elastic/eui/pull/5194))
- Fixed `EuiDataGrid` cells when focused getting a higher `z-index` which was causing long content to overlap surrounding cells ([#5194](https://github.com/elastic/eui/pull/5194))
- Replaced the `EuiMarkdownEditor` help syntax modal with a popover when no custom plugins are available ([#5147](https://github.com/elastic/eui/pull/5147))
- Fixed multiple components unnecessarily rerendering generated IDs on every update ([#5195](https://github.com/elastic/eui/pull/5195), [#5196](https://github.com/elastic/eui/pull/5196), [#5197](https://github.com/elastic/eui/pull/5197), [#5200](https://github.com/elastic/eui/pull/#5200), [#5201](https://github.com/elastic/eui/pull/#5201))

**Theme: Amsterdam**
Expand Down
64 changes: 45 additions & 19 deletions src-docs/src/views/markdown_editor/mardown_editor_example.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
import React, { Fragment } from 'react';

import { renderToHtml } from '../../services';

import { GuideSectionTypes } from '../../components';

import {
EuiMarkdownEditor,
EuiText,
EuiCode,
} from '../../../../src/components';

import { Link } from 'react-router-dom';

import MarkdownEditor from './markdown_editor';
const markdownEditorSource = require('!!raw-loader!./markdown_editor');
const markdownEditorHtml = renderToHtml(MarkdownEditor);
const markdownEditorSnippet = `<EuiMarkdownEditor
value={value}
onChange={setValue}
/>`;

import MarkdownEditorErrors from './markdown_editor_errors';
const markdownEditorErrorsSource = require('!!raw-loader!./markdown_editor_errors');
const markdownEditorErrorsHtml = renderToHtml(MarkdownEditorErrors);
const markdownEditorErrorsSnippet = `<EuiMarkdownEditor
value={value}
onChange={setValue}
Expand All @@ -32,7 +25,6 @@ const markdownEditorErrorsSnippet = `<EuiMarkdownEditor

import MarkdownEditorHeight from './markdown_editor_height';
const markdownEditorHeightSource = require('!!raw-loader!./markdown_editor_height');
const markdownEditorHeightHtml = renderToHtml(MarkdownEditorHeight);
const markdownEditorHeightSnippet = [
`// Custom height with auto-expanding preview
<EuiMarkdownEditor
Expand Down Expand Up @@ -62,6 +54,23 @@ const markdownEditorHeightSnippet = [
/>`,
];

import MarkdownEditorNoPlugins from './markdown_editor_no_plugins';
const markdownEditorNoPluginsSource = require('!!raw-loader!./markdown_editor_no_plugins');
const markdownEditorNoPluginsSnippet = `const {
parsingPlugins,
processingPlugins,
uiPlugins,
} = getDefaultEuiMarkdownPlugins({ exclude: ['tooltip'] });

<EuiMarkdownEditor
value={value}
onChange={setValue}
parsingPluginList={parsingPlugins}
processingPluginList={processingPlugins}
uiPlugins={uiPlugins}
/>
`;

export const MarkdownEditorExample = {
title: 'Markdown editor',
beta: true,
Expand Down Expand Up @@ -90,10 +99,6 @@ export const MarkdownEditorExample = {
type: GuideSectionTypes.JS,
code: markdownEditorSource,
},
{
type: GuideSectionTypes.HTML,
code: markdownEditorHtml,
},
],
title: 'Base editor',
text: (
Expand All @@ -112,11 +117,36 @@ export const MarkdownEditorExample = {
source: [
{
type: GuideSectionTypes.JS,
code: markdownEditorErrorsSource,
code: markdownEditorNoPluginsSource,
},
],
title: 'Unregistering plugins',
text: (
<p>
The <strong>EuiMarkdownEditor</strong> comes with a default plugin for{' '}
<EuiCode>tooltip</EuiCode> support. However, this may be unfamiliar or
unnecessary in some contexts, and you can unregister this plugin by
excluding it from the
<EuiCode>parsingPlugins</EuiCode>,{' '}
<EuiCode>processingPlugins</EuiCode> and <EuiCode>uiPlugins</EuiCode>{' '}
options with a single <EuiCode>exclude</EuiCode> parameter passed to{' '}
<EuiCode>getDefaultEuiMarkdownPlugins()</EuiCode>. This will ensure
the syntax won&apos;t be identified or rendered and no additional UI,
like the button and help syntax, will be displayed.
</p>
),
props: {
EuiMarkdownEditor,
},
snippet: markdownEditorNoPluginsSnippet,
demo: <MarkdownEditorNoPlugins />,
},

{
source: [
{
type: GuideSectionTypes.HTML,
code: markdownEditorErrorsHtml,
type: GuideSectionTypes.JS,
code: markdownEditorErrorsSource,
},
],
title: 'Error handling and feedback',
Expand All @@ -142,10 +172,6 @@ export const MarkdownEditorExample = {
type: GuideSectionTypes.JS,
code: markdownEditorHeightSource,
},
{
type: GuideSectionTypes.HTML,
code: markdownEditorHeightHtml,
},
],
title: 'Controlling the height',
text: (
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/markdown_editor/markdown_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

const initialContent = `## Hello world!

Basic "github flavored" markdown will work as you'd expect.
Basic "GitHub flavored" markdown will work as you'd expect.

The editor also ships with some built in plugins. For example it can handle checkboxes. Notice how they toggle state even in the preview mode.

Expand Down
38 changes: 38 additions & 0 deletions src-docs/src/views/markdown_editor/markdown_editor_no_plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useState } from 'react';

import {
EuiMarkdownEditor,
getDefaultEuiMarkdownPlugins,
} from '../../../../src/components';

const initialContent = `## This is how we do it :smile:

In this example, we unregistered the built in **tooltip** plugin. So the button in the toolbar and the help syntax won't be displayed.

And the following syntax no longer works.

!{tooltip[anchor text](Tooltip content)}
`;

const {
parsingPlugins,
processingPlugins,
uiPlugins,
} = getDefaultEuiMarkdownPlugins({ exclude: ['tooltip'] });

export default () => {
const [value, setValue] = useState(initialContent);

return (
<>
<EuiMarkdownEditor
aria-label="EUI markdown editor with no default plugins demo"
value={value}
onChange={setValue}
parsingPluginList={parsingPlugins}
processingPluginList={processingPlugins}
uiPlugins={uiPlugins}
/>
</>
);
};
Loading