@ember-eui/core 7.0.6 → 7.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,11 +8,15 @@ import unified, { Processor } from 'unified';
|
|
|
8
8
|
import { toDOM } from '../../utils/markdown/plugins/to-dom';
|
|
9
9
|
import type { RehypeNode } from '../../utils/markdown/markdown-types';
|
|
10
10
|
import type EuiMarkdownEditorComponent from '../eui-markdown-editor';
|
|
11
|
+
import { isArray } from '@ember/array';
|
|
12
|
+
|
|
11
13
|
export interface EuiMarkdownEditorToolbarArgs {
|
|
12
14
|
parsingPluginList?: typeof defaultParsingPlugins;
|
|
13
15
|
processingPluginList?: typeof defaultProcessingPlugins;
|
|
14
16
|
replaceNode?: EuiMarkdownEditorComponent['replaceNode'];
|
|
15
17
|
value: string;
|
|
18
|
+
//you can pass in a string or an array of strings to be added to the root element
|
|
19
|
+
rootClasses?: string | string[];
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMarkdownEditorToolbarArgs> {
|
|
@@ -40,12 +44,24 @@ export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMark
|
|
|
40
44
|
.use(identityCompiler);
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
get rootClasses(): string[] {
|
|
48
|
+
let baseClasses = ['euiMarkdownFormat', 'euiText', 'euiText--medium'];
|
|
49
|
+
if (this.args.rootClasses) {
|
|
50
|
+
let rootClasses = isArray(this.args.rootClasses)
|
|
51
|
+
? this.args.rootClasses
|
|
52
|
+
: (this.args.rootClasses as string)?.split(' ') || [];
|
|
53
|
+
|
|
54
|
+
baseClasses = baseClasses.concat(rootClasses);
|
|
55
|
+
}
|
|
56
|
+
return baseClasses;
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
@cached
|
|
44
60
|
get result() {
|
|
45
61
|
try {
|
|
46
62
|
const processed = this.processor.processSync(this.args.value);
|
|
47
63
|
return toDOM(processed.result as RehypeNode, {
|
|
48
|
-
rootClasses:
|
|
64
|
+
rootClasses: this.rootClasses
|
|
49
65
|
});
|
|
50
66
|
//eslint-disable-next-line
|
|
51
67
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-eui/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.10",
|
|
4
4
|
"description": "Ember Components for Elastic UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -186,5 +186,5 @@
|
|
|
186
186
|
"volta": {
|
|
187
187
|
"extends": "../../package.json"
|
|
188
188
|
},
|
|
189
|
-
"gitHead": "
|
|
189
|
+
"gitHead": "9e59f7fbc0b7b95d81d2d7f87eb52a709f2137f0"
|
|
190
190
|
}
|