Skip to content

Commit

Permalink
Merge branch 'main' into storybook/7646-v8-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mgadewoll authored Apr 16, 2024
2 parents da8a53b + 26af247 commit 2a8f82a
Show file tree
Hide file tree
Showing 26 changed files with 575 additions and 249 deletions.
3 changes: 3 additions & 0 deletions changelogs/upcoming/7601.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Dependency updates**

- Updated `remark-rehype` to v8.1.0
3 changes: 3 additions & 0 deletions changelogs/upcoming/7672.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Accessibility**

- Improved `EuiBasicTable` and `EuiInMemoryTable`'s selection checkboxes to have unique aria-labels per row
5 changes: 5 additions & 0 deletions changelogs/upcoming/7676.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Updated `getDefaultEuiMarkdownPlugins()` to allow excluding the following plugins in addition to `tooltip`:
- `checkbox`
- `linkValidator`
- `lineBreaks`
- `emoji`
5 changes: 5 additions & 0 deletions changelogs/upcoming/7678.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**Bug fixes**

- Visual fixes for `EuiRange`s with `showInput`:
- Longer `append`/`prepend` labels no longer cause a background bug
- Inputs can no longer overwhelm the actual range in width
3 changes: 3 additions & 0 deletions changelogs/upcoming/7681.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed a visual text alignment regression in `EuiTableRowCell`s with the `row` header scope
1 change: 1 addition & 0 deletions changelogs/upcoming/7683.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated `EuiSelectable`'s `isPreFiltered` prop to allow passing a configuration object, which allows disabling search highlighting in addition to search filtering
20 changes: 10 additions & 10 deletions i18ntokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,18 @@
},
{
"token": "euiBasicTable.selectThisRow",
"defString": "Select this row",
"defString": "Select row {index}",
"highlighting": "string",
"loc": {
"start": {
"line": 1103,
"line": 1109,
"column": 8,
"index": 30673
"index": 30781
},
"end": {
"line": 1103,
"column": 79,
"index": 30744
"line": 1113,
"column": 9,
"index": 30936
}
},
"filepath": "src/components/basic_table/basic_table.tsx"
Expand All @@ -149,14 +149,14 @@
"highlighting": "string",
"loc": {
"start": {
"line": 1329,
"line": 1339,
"column": 8,
"index": 37489
"index": 37663
},
"end": {
"line": 1333,
"line": 1343,
"column": 9,
"index": 37648
"index": 37822
}
},
"filepath": "src/components/basic_table/basic_table.tsx"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"remark-breaks": "^2.0.2",
"remark-emoji": "^2.1.0",
"remark-parse-no-trim": "^8.0.4",
"remark-rehype": "^8.0.0",
"remark-rehype": "^8.1.0",
"tabbable": "^5.3.3",
"text-diff": "^1.0.1",
"unified": "^9.2.2",
Expand Down Expand Up @@ -152,7 +152,7 @@
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"assert": "^2.0.0",
"autoprefixer": "^9.8.6",
"axe-core": "^4.8.2",
"axe-core": "^4.9.0",
"babel-jest": "^24.1.0",
"babel-loader": "^9.1.2",
"babel-plugin-add-module-exports": "^1.0.4",
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/markdown_editor/markdown_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ The editor also ships with some built in plugins. For example it can handle chec
- [ ] Or empty
It can also handle emojis! :smile:
And it can render !{tooltip[tooltips like this](Look! I'm a very helpful tooltip content!)}
`;

Expand Down
24 changes: 16 additions & 8 deletions src-docs/src/views/markdown_editor/markdown_editor_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ const markdownEditorNoPluginsSnippet = `const {
parsingPlugins,
processingPlugins,
uiPlugins,
} = getDefaultEuiMarkdownPlugins({ exclude: ['tooltip'] });
} = getDefaultEuiMarkdownPlugins({
exclude: [
'tooltip',
'checkbox',
'linkValidator',
'lineBreaks',
'emoji',
],
});
<EuiMarkdownEditor
value={value}
Expand Down Expand Up @@ -133,16 +141,16 @@ export const MarkdownEditorExample = {
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>,{' '}
The <strong>EuiMarkdownEditor</strong> comes with several default
plugins, demo'd below. If these defaults are unnecessary for your
use-case or context, you can unregister these plugins by excluding
them 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.
the syntax won't be identified or rendered, and no additional UI (like
toolbar buttons or help syntax) will be displayed by the unregistered
plugins.
</p>
),
props: {
Expand Down
109 changes: 93 additions & 16 deletions src-docs/src/views/markdown_editor/markdown_editor_no_plugins.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,112 @@
import React, { useState } from 'react';
import React, { useState, useMemo } from 'react';

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

const initialContent = `## This is how we do it :smile:
const initialContent = `
### tooltip
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.
When disabled, the button in the toolbar and the help syntax won't be displayed, and the following syntax will no longer works.
!{tooltip[anchor text](Tooltip content)}
`;
const { parsingPlugins, processingPlugins, uiPlugins } =
getDefaultEuiMarkdownPlugins({ exclude: ['tooltip'] });
### checkbox
When disabled, a EuiCheckbox will no longer render.
- [ ] TODO: Disable some default plugins
### emoji
When disabled, text will render instead of an emoji.
:smile:
### linkValidator
When disabled, all links will render as links instead of as text.
[This is a sus link](file://)
### lineBreaks
When disabled, these sentence will be in the same line.
When enabled, these sentences will be separated by a line break.
Two blank lines in a row will create a new paragraph as usual.
`;

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

const [tooltip, excludeTooltips] = useState(false);
const [checkbox, excludeCheckboxes] = useState(true);
const [emoji, excludeEmojis] = useState(true);
const [linkValidator, excludeLinkValidator] = useState(true);
const [lineBreaks, excludeLineBreaks] = useState(false);

const { parsingPlugins, processingPlugins, uiPlugins } = useMemo(() => {
const excludedPlugins = [];
if (!tooltip) excludedPlugins.push('tooltip');
if (!checkbox) excludedPlugins.push('checkbox');
if (!emoji) excludedPlugins.push('emoji');
if (!linkValidator) excludedPlugins.push('linkValidator');
if (!lineBreaks) excludedPlugins.push('lineBreaks');

return getDefaultEuiMarkdownPlugins({
exclude: excludedPlugins,
});
}, [tooltip, checkbox, emoji, linkValidator, lineBreaks]);

return (
<>
<EuiMarkdownEditor
aria-label="EUI markdown editor with no default plugins demo"
value={value}
onChange={setValue}
parsingPluginList={parsingPlugins}
processingPluginList={processingPlugins}
uiPlugins={uiPlugins}
/>
<EuiFlexGroup>
<EuiFlexItem grow={false} css={{ gap: 20 }}>
<EuiSwitch
label="tooltip"
checked={tooltip}
onChange={() => excludeTooltips(!tooltip)}
/>
<EuiSwitch
label="checkbox"
checked={checkbox}
onChange={() => excludeCheckboxes(!checkbox)}
/>
<EuiSwitch
label="emoji"
checked={emoji}
onChange={() => excludeEmojis(!emoji)}
/>
<EuiSwitch
label="linkValidator"
checked={linkValidator}
onChange={() => excludeLinkValidator(!linkValidator)}
/>
<EuiSwitch
label="lineBreaks"
checked={lineBreaks}
onChange={() => excludeLineBreaks(!lineBreaks)}
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiMarkdownEditor
aria-label="Demo with excluded default plugins"
value={value}
onChange={setValue}
parsingPluginList={parsingPlugins}
processingPluginList={processingPlugins}
uiPlugins={uiPlugins}
initialViewMode="viewing"
autoExpandPreview={false}
height={400}
/>
</EuiFlexItem>
</EuiFlexGroup>
</>
);
};
Loading

0 comments on commit 2a8f82a

Please sign in to comment.