@elastic/eui 95.9.0 → 95.10.0

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.
Files changed (101) hide show
  1. package/dist/eui_theme_dark.css +35 -6
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +35 -6
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/in_memory_table.js +2 -1
  6. package/es/components/datagrid/body/cell/data_grid_cell.js +2 -0
  7. package/es/components/datagrid/body/cell/focus_utils.js +57 -11
  8. package/es/components/datagrid/body/data_grid_body.js +1 -0
  9. package/es/components/datagrid/body/data_grid_body_custom.js +1 -0
  10. package/es/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  11. package/es/components/datagrid/body/header/data_grid_header_cell.js +92 -83
  12. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +37 -22
  13. package/es/components/datagrid/controls/column_sorting.js +1 -0
  14. package/es/components/datagrid/data_grid.a11y.js +2 -0
  15. package/es/components/datagrid/utils/in_memory.js +1 -0
  16. package/es/components/date_picker/date_picker.js +32 -10
  17. package/es/components/date_picker/date_picker.styles.js +3 -2
  18. package/es/components/date_picker/date_picker_range.styles.js +1 -1
  19. package/es/components/form/super_select/super_select.styles.js +1 -1
  20. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -8
  21. package/es/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +21 -4
  22. package/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  23. package/es/components/markdown_editor/plugins/markdown_link_validator.js +8 -2
  24. package/es/components/search_bar/filters/field_value_selection_filter.js +171 -152
  25. package/es/components/search_bar/search_bar.js +2 -1
  26. package/es/components/search_bar/search_filters.js +2 -1
  27. package/eui.d.ts +138 -69
  28. package/i18ntokens.json +78 -42
  29. package/lib/components/basic_table/in_memory_table.js +2 -1
  30. package/lib/components/datagrid/body/cell/data_grid_cell.js +2 -0
  31. package/lib/components/datagrid/body/cell/focus_utils.js +58 -12
  32. package/lib/components/datagrid/body/data_grid_body.js +1 -0
  33. package/lib/components/datagrid/body/data_grid_body_custom.js +1 -0
  34. package/lib/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  35. package/lib/components/datagrid/body/header/data_grid_header_cell.js +98 -88
  36. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +38 -23
  37. package/lib/components/datagrid/controls/column_sorting.js +1 -0
  38. package/lib/components/datagrid/data_grid.a11y.js +2 -0
  39. package/lib/components/datagrid/utils/in_memory.js +1 -0
  40. package/lib/components/date_picker/date_picker.js +32 -10
  41. package/lib/components/date_picker/date_picker.styles.js +3 -2
  42. package/lib/components/date_picker/date_picker_range.styles.js +1 -1
  43. package/lib/components/form/super_select/super_select.styles.js +1 -1
  44. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +26 -17
  45. package/lib/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +21 -6
  46. package/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  47. package/lib/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  48. package/lib/components/search_bar/filters/field_value_selection_filter.js +170 -151
  49. package/lib/components/search_bar/search_bar.js +2 -1
  50. package/lib/components/search_bar/search_filters.js +2 -1
  51. package/optimize/es/components/datagrid/body/cell/focus_utils.js +55 -10
  52. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +90 -83
  53. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +33 -19
  54. package/optimize/es/components/datagrid/data_grid.a11y.js +2 -0
  55. package/optimize/es/components/date_picker/date_picker.js +15 -9
  56. package/optimize/es/components/date_picker/date_picker.styles.js +3 -2
  57. package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
  58. package/optimize/es/components/form/super_select/super_select.styles.js +1 -1
  59. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +14 -8
  60. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +18 -4
  61. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  62. package/optimize/es/components/markdown_editor/plugins/markdown_link_validator.js +8 -2
  63. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +168 -151
  64. package/optimize/lib/components/datagrid/body/cell/focus_utils.js +56 -11
  65. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +92 -84
  66. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +33 -19
  67. package/optimize/lib/components/datagrid/data_grid.a11y.js +2 -0
  68. package/optimize/lib/components/date_picker/date_picker.js +15 -9
  69. package/optimize/lib/components/date_picker/date_picker.styles.js +3 -2
  70. package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
  71. package/optimize/lib/components/form/super_select/super_select.styles.js +1 -1
  72. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -11
  73. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +19 -6
  74. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  75. package/optimize/lib/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  76. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +167 -150
  77. package/package.json +1 -1
  78. package/src/components/datagrid/_data_grid_data_row.scss +5 -0
  79. package/src/components/datagrid/body/header/_data_grid_header_row.scss +27 -5
  80. package/test-env/components/basic_table/in_memory_table.js +2 -1
  81. package/test-env/components/datagrid/body/cell/data_grid_cell.js +2 -0
  82. package/test-env/components/datagrid/body/cell/focus_utils.js +58 -12
  83. package/test-env/components/datagrid/body/data_grid_body.js +1 -0
  84. package/test-env/components/datagrid/body/data_grid_body_custom.js +1 -0
  85. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  86. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +93 -84
  87. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +37 -22
  88. package/test-env/components/datagrid/controls/column_sorting.js +1 -0
  89. package/test-env/components/datagrid/data_grid.a11y.js +2 -0
  90. package/test-env/components/datagrid/utils/in_memory.js +1 -0
  91. package/test-env/components/date_picker/date_picker.js +32 -10
  92. package/test-env/components/date_picker/date_picker.styles.js +3 -2
  93. package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
  94. package/test-env/components/form/super_select/super_select.styles.js +1 -1
  95. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -11
  96. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +19 -6
  97. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  98. package/test-env/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  99. package/test-env/components/search_bar/filters/field_value_selection_filter.js +169 -151
  100. package/test-env/components/search_bar/search_bar.js +2 -1
  101. package/test-env/components/search_bar/search_filters.js +2 -1
@@ -20,7 +20,7 @@ var _reactDatepicker = require("./react-datepicker");
20
20
  var _react_date_picker = require("./react_date_picker.styles");
21
21
  var _date_picker = require("./date_picker.styles");
22
22
  var _react2 = require("@emotion/react");
23
- var _excluded = ["adjustDateOnChange", "calendarClassName", "className", "compressed", "controlOnly", "customInput", "dateFormat", "dayClassName", "disabled", "excludeDates", "filterDate", "fullWidth", "iconType", "injectTimes", "inline", "inputRef", "isInvalid", "isLoading", "locale", "maxDate", "maxTime", "minDate", "minTime", "onChange", "onClear", "openToDate", "placeholder", "popperClassName", "popoverPlacement", "readOnly", "selected", "shadow", "shouldCloseOnSelect", "showIcon", "showTimeSelect", "showTimeSelectOnly", "timeFormat", "utcOffset"];
23
+ var _excluded = ["adjustDateOnChange", "append", "calendarClassName", "className", "compressed", "controlOnly", "customInput", "dateFormat", "dayClassName", "disabled", "excludeDates", "filterDate", "fullWidth", "iconType", "injectTimes", "inline", "inputRef", "isInvalid", "isLoading", "locale", "maxDate", "maxTime", "minDate", "minTime", "onChange", "onClear", "openToDate", "placeholder", "popperClassName", "popoverPlacement", "prepend", "readOnly", "selected", "shadow", "shouldCloseOnSelect", "showIcon", "showTimeSelect", "showTimeSelectOnly", "timeFormat", "utcOffset"];
24
24
  /*
25
25
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
26
26
  * or more contributor license agreements. Licensed under the Elastic License
@@ -64,6 +64,7 @@ var unsupportedProps = [
64
64
  var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
65
65
  var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
66
66
  adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
67
+ append = _ref.append,
67
68
  calendarClassName = _ref.calendarClassName,
68
69
  className = _ref.className,
69
70
  compressed = _ref.compressed,
@@ -95,6 +96,7 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
95
96
  popperClassName = _ref.popperClassName,
96
97
  _ref$popoverPlacement = _ref.popoverPlacement,
97
98
  popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
99
+ prepend = _ref.prepend,
98
100
  readOnly = _ref.readOnly,
99
101
  selected = _ref.selected,
100
102
  _ref$shadow = _ref.shadow,
@@ -196,21 +198,25 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
196
198
  return (0, _react2.jsx)("span", {
197
199
  css: cssStyles,
198
200
  className: classes
199
- }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
201
+ }, (0, _react2.jsx)(_form.EuiFormControlLayout, (0, _extends2.default)({
200
202
  icon: optionalIcon,
201
- fullWidth: !inline && fullWidth,
202
- compressed: !inline && compressed,
203
203
  clear: selected && onClear ? {
204
204
  onClick: onClear
205
205
  } : undefined,
206
206
  isLoading: isLoading,
207
207
  isInvalid: isInvalid,
208
208
  isDisabled: disabled,
209
- readOnly: readOnly,
210
- isDelimited: inline // Styling shortcut for inline calendars
211
- ,
212
- iconsPosition: inline ? 'static' : undefined
213
- }, control));
209
+ readOnly: readOnly
210
+ }, inline ? {
211
+ isDelimited: true,
212
+ iconsPosition: 'static'
213
+ } : {
214
+ fullWidth: fullWidth,
215
+ compressed: compressed,
216
+ append: append,
217
+ prepend: prepend,
218
+ css: (append || prepend) && styles.inGroup
219
+ }), control));
214
220
  };
215
221
  EuiDatePicker.propTypes = {
216
222
  className: _propTypes.default.string,
@@ -281,9 +287,25 @@ EuiDatePicker.propTypes = {
281
287
  * **Use [EuiPopover](/#/layout/popover) values**: 'upCenter', 'upLeft', 'upRight', downCenter', 'downLeft', 'downRight', 'leftCenter', 'leftUp', 'leftDown', 'rightCenter', 'rightUp', 'rightDown'.
282
288
  */
283
289
  popoverPlacement: _propTypes.default.any,
290
+ /**
291
+ * Creates an input group with element(s) coming before the input.
292
+ * `string` | `ReactElement` or an array of these
293
+ *
294
+ * Ignored if `inline` or `controlOnly` are true.
295
+ */
296
+ append: _propTypes.default.any,
297
+ /**
298
+ * Creates an input group with element(s) coming before the input.
299
+ * `string` | `ReactElement` or an array of these
300
+ *
301
+ * Ignored if `inline` or `controlOnly` are true.
302
+ */
303
+ prepend: _propTypes.default.any,
284
304
  /**
285
305
  * Completely removes form control layout wrapper and ignores
286
- * iconType. Best used inside EuiFormControlLayoutDelimited.
306
+ * `iconType`, `prepend`, and `append`.
307
+ *
308
+ * Best used inside EuiFormControlLayoutDelimited.
287
309
  */
288
310
  controlOnly: _propTypes.default.bool
289
311
  };
@@ -28,7 +28,7 @@ var euiDatePickerStyles = exports.euiDatePickerStyles = function euiDatePickerSt
28
28
  return {
29
29
  euiDatePicker: _ref,
30
30
  inline: {
31
- inline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " box-shadow:none;padding:0;}.euiFormControlLayout__childrenWrapper{flex-direction:column;}.euiFormControlLayoutIcons{justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";};label:inline;"),
31
+ inline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " border:none;padding:0;}.euiFormControlLayout__childrenWrapper{flex-direction:column;}.euiFormControlLayoutIcons{justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";};label:inline;"),
32
32
  // Skip css`` to avoid generating an Emotion className
33
33
  noShadow: "\n .euiFormControlLayout {\n background-color: transparent;\n }\n ",
34
34
  shadow: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{background-color:", euiTheme.colors.emptyShade, ";", (0, _mixins.euiShadowMedium)(euiThemeContext), ";};label:shadow;"),
@@ -39,6 +39,7 @@ var euiDatePickerStyles = exports.euiDatePickerStyles = function euiDatePickerSt
39
39
  // Should come after shadow CSS to override their background-colors
40
40
  disabled: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _form.euiFormControlDisabledStyles)(euiThemeContext), ";};label:disabled;"),
41
41
  readOnly: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _form.euiFormControlReadOnlyStyles)(euiThemeContext), ";};label:readOnly;")
42
- }
42
+ },
43
+ inGroup: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{.euiPopover,.react-datepicker__input-container{", (0, _global_styling.logicalCSS)('height', '100%'), ";}};label:inGroup;")
43
44
  };
44
45
  };
@@ -36,7 +36,7 @@ var euiDatePickerRangeInlineStyles = exports.euiDatePickerRangeInlineStyles = fu
36
36
  return "\n display: block;\n container-type: inline-size;\n\n .euiFormControlLayout__childrenWrapper {\n /* Use static px widths for now, since render behavior comes from a third party library */\n @container (max-width: ".concat(datePickerWidth * 2 + delimiterWidth, "px) {\n /* Unset grid display */\n display: block !important;\n\n /* Center and point the default delimiter arrow downwards */\n .euiFormControlLayoutDelimited__delimiter .euiIcon {\n transform: rotate(90deg);\n margin-inline: auto;\n }\n }\n }");
37
37
  };
38
38
  return {
39
- euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " box-shadow:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
39
+ euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " border:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
40
40
  responsive: /*#__PURE__*/(0, _react.css)(containerQuery(268), ";;label:responsive;"),
41
41
  responsiveWithTimeSelect: /*#__PURE__*/(0, _react.css)(containerQuery(374), ";;label:responsiveWithTimeSelect;"),
42
42
  shadow: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _mixins.euiShadowMedium)(euiThemeContext), ";};label:shadow;"),
@@ -46,6 +46,6 @@ var euiSuperSelectControlStyles = exports.euiSuperSelectControlStyles = function
46
46
  // Layout modifiers
47
47
  inGroup: /*#__PURE__*/(0, _react.css)(formStyles.inGroup, ";label:inGroup;"),
48
48
  // Children
49
- euiSuperSelect__placeholder: /*#__PURE__*/(0, _react.css)("color:", formVariables.controlDisabledColor, ";;label:euiSuperSelect__placeholder;")
49
+ euiSuperSelect__placeholder: /*#__PURE__*/(0, _react.css)("color:", formVariables.controlPlaceholderText, ";;label:euiSuperSelect__placeholder;")
50
50
  };
51
51
  };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.getDefaultEuiMarkdownParsingPlugins = exports.defaultParsingPlugins = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _remarkParseNoTrim = _interopRequireDefault(require("remark-parse-no-trim"));
11
12
  var _remarkEmoji = _interopRequireDefault(require("remark-emoji"));
12
13
  var _remarkBreaks = _interopRequireDefault(require("remark-breaks"));
@@ -14,8 +15,7 @@ var _remark_prismjs = _interopRequireDefault(require("../remark/remark_prismjs")
14
15
  var MarkdownTooltip = _interopRequireWildcard(require("../markdown_tooltip"));
15
16
  var MarkdownCheckbox = _interopRequireWildcard(require("../markdown_checkbox"));
16
17
  var _markdown_link_validator = require("../markdown_link_validator");
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ var _excluded = ["exclude"];
19
19
  /*
20
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
21
21
  * or more contributor license agreements. Licensed under the Elastic License
@@ -23,34 +23,38 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
23
23
  * in compliance with, at your election, the Elastic License 2.0 or the Server
24
24
  * Side Public License, v 1.
25
25
  */
26
-
27
26
  // Importing seemingly unused types from `unified` because the definitions
28
27
  // are exported for two versions of TypeScript (3.4, 4.0) and implicit
29
28
  // imports during eui.d.ts generation default to the incorrect version (3.4).
30
29
  // Explicit imports here resolve the version mismatch.
31
-
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
32
  var DEFAULT_PARSING_PLUGINS = {
33
33
  emoji: [_remarkEmoji.default, {
34
34
  emoticon: false
35
35
  }],
36
36
  lineBreaks: [_remarkBreaks.default, {}],
37
- linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, {
38
- allowRelative: true,
39
- allowProtocols: ['https:', 'http:', 'mailto:']
40
- }],
37
+ linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, _markdown_link_validator.DEFAULT_OPTIONS],
41
38
  checkbox: [MarkdownCheckbox.parser, {}],
42
39
  tooltip: [MarkdownTooltip.parser, {}]
43
40
  };
44
41
  var getDefaultEuiMarkdownParsingPlugins = exports.getDefaultEuiMarkdownParsingPlugins = function getDefaultEuiMarkdownParsingPlugins() {
45
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
46
- exclude = _ref.exclude;
42
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
+ var exclude = _ref.exclude,
44
+ parsingConfig = (0, _objectWithoutProperties2.default)(_ref, _excluded);
47
45
  var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}]];
48
46
  Object.entries(DEFAULT_PARSING_PLUGINS).forEach(function (_ref2) {
49
47
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
50
48
  pluginName = _ref3[0],
51
49
  plugin = _ref3[1];
50
+ // Check for plugin exclusions
52
51
  if (!(exclude !== null && exclude !== void 0 && exclude.includes(pluginName))) {
53
- parsingPlugins.push(plugin);
52
+ // Check for plugin configuration overrides
53
+ if (pluginName in parsingConfig) {
54
+ parsingPlugins.push([plugin[0], parsingConfig[pluginName]]);
55
+ } else {
56
+ parsingPlugins.push(plugin);
57
+ }
54
58
  }
55
59
  });
56
60
  return parsingPlugins;
@@ -1,24 +1,37 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.getDefaultEuiMarkdownPlugins = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _ui_plugins = require("./ui_plugins");
8
10
  var _parsing_plugins = require("./parsing_plugins");
9
11
  var _processing_plugins = require("./processing_plugins");
10
- /*
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /*
11
14
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
15
  * or more contributor license agreements. Licensed under the Elastic License
13
16
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
17
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
18
  * Side Public License, v 1.
16
19
  */
17
-
18
- var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins(config) {
20
+ var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins() {
21
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22
+ var exclude = config.exclude,
23
+ processingConfig = config.processingConfig,
24
+ parsingConfig = config.parsingConfig,
25
+ uiConfig = config.uiConfig;
19
26
  return {
20
- parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(config),
21
- processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(config),
22
- uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(config)
27
+ parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(_objectSpread({
28
+ exclude: exclude
29
+ }, parsingConfig)),
30
+ processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(_objectSpread({
31
+ exclude: exclude
32
+ }, processingConfig)),
33
+ uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(_objectSpread({
34
+ exclude: exclude
35
+ }, uiConfig))
23
36
  };
24
37
  };
@@ -42,7 +42,8 @@ var DEFAULT_COMPONENT_RENDERERS = {
42
42
  };
43
43
  var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProcessingPlugins = function getDefaultEuiMarkdownProcessingPlugins() {
44
44
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
45
- exclude = _ref.exclude;
45
+ exclude = _ref.exclude,
46
+ linkProps = _ref.linkProps;
46
47
  var componentPluginsWithExclusions = {};
47
48
  Object.entries(DEFAULT_COMPONENT_RENDERERS).forEach(function (_ref2) {
48
49
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
@@ -61,7 +62,9 @@ var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProces
61
62
  createElement: _react.createElement,
62
63
  Fragment: _react.Fragment,
63
64
  components: _objectSpread({
64
- a: _link.EuiLink,
65
+ a: function a(props) {
66
+ return (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({}, props, linkProps));
67
+ },
65
68
  code: function code(props) {
66
69
  return (
67
70
  // If there are linebreaks use codeblock, otherwise code
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.DEFAULT_OPTIONS = void 0;
7
8
  exports.euiMarkdownLinkValidator = euiMarkdownLinkValidator;
8
9
  exports.mutateLinkToText = mutateLinkToText;
9
10
  exports.validateUrl = validateUrl;
@@ -16,6 +17,10 @@ var _unistUtilVisit = _interopRequireDefault(require("unist-util-visit"));
16
17
  * Side Public License, v 1.
17
18
  */
18
19
 
20
+ var DEFAULT_OPTIONS = exports.DEFAULT_OPTIONS = {
21
+ allowRelative: true,
22
+ allowProtocols: ['https:', 'http:', 'mailto:']
23
+ };
19
24
  function euiMarkdownLinkValidator(options) {
20
25
  return function (ast) {
21
26
  (0, _unistUtilVisit.default)(ast, 'link', function (_node) {
@@ -46,8 +51,10 @@ function mutateLinkToText(node) {
46
51
  return node;
47
52
  }
48
53
  function validateUrl(url, _ref) {
49
- var allowRelative = _ref.allowRelative,
50
- allowProtocols = _ref.allowProtocols;
54
+ var _ref$allowRelative = _ref.allowRelative,
55
+ allowRelative = _ref$allowRelative === void 0 ? DEFAULT_OPTIONS.allowRelative : _ref$allowRelative,
56
+ _ref$allowProtocols = _ref.allowProtocols,
57
+ allowProtocols = _ref$allowProtocols === void 0 ? DEFAULT_OPTIONS.allowProtocols : _ref$allowProtocols;
51
58
  // relative captures both relative paths `/` and protocols `//`
52
59
  var isRelative = url.startsWith('/');
53
60
  if (isRelative) {