@ember-eui/core 6.5.14 → 6.5.17

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: ['euiMarkdownFormat', 'euiText', 'euiText--medium']
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": "6.5.14",
3
+ "version": "6.5.17",
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": "5b741af3a5d0c58c8a67455e75756049e57e91b6"
189
+ "gitHead": "955bac361128c2d0d8e2892ac9f27bcd6b37a03f"
190
190
  }