@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
@@ -15,7 +15,7 @@ var _reactDatepicker = require("./react-datepicker");
15
15
  var _react_date_picker = require("./react_date_picker.styles");
16
16
  var _date_picker = require("./date_picker.styles");
17
17
  var _react2 = require("@emotion/react");
18
- 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"];
18
+ 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"];
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
@@ -73,6 +73,7 @@ var unsupportedProps = [
73
73
  var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
74
74
  var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
75
75
  adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
76
+ append = _ref.append,
76
77
  calendarClassName = _ref.calendarClassName,
77
78
  className = _ref.className,
78
79
  compressed = _ref.compressed,
@@ -104,6 +105,7 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
104
105
  popperClassName = _ref.popperClassName,
105
106
  _ref$popoverPlacement = _ref.popoverPlacement,
106
107
  popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
108
+ prepend = _ref.prepend,
107
109
  readOnly = _ref.readOnly,
108
110
  selected = _ref.selected,
109
111
  _ref$shadow = _ref.shadow,
@@ -205,21 +207,25 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
205
207
  return (0, _react2.jsx)("span", {
206
208
  css: cssStyles,
207
209
  className: classes
208
- }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
210
+ }, (0, _react2.jsx)(_form.EuiFormControlLayout, _extends({
209
211
  icon: optionalIcon,
210
- fullWidth: !inline && fullWidth,
211
- compressed: !inline && compressed,
212
212
  clear: selected && onClear ? {
213
213
  onClick: onClear
214
214
  } : undefined,
215
215
  isLoading: isLoading,
216
216
  isInvalid: isInvalid,
217
217
  isDisabled: disabled,
218
- readOnly: readOnly,
219
- isDelimited: inline // Styling shortcut for inline calendars
220
- ,
221
- iconsPosition: inline ? 'static' : undefined
222
- }, control));
218
+ readOnly: readOnly
219
+ }, inline ? {
220
+ isDelimited: true,
221
+ iconsPosition: 'static'
222
+ } : {
223
+ fullWidth: fullWidth,
224
+ compressed: compressed,
225
+ append: append,
226
+ prepend: prepend,
227
+ css: (append || prepend) && styles.inGroup
228
+ }), control));
223
229
  };
224
230
  EuiDatePicker.propTypes = {
225
231
  className: _propTypes.default.string,
@@ -290,9 +296,25 @@ EuiDatePicker.propTypes = {
290
296
  * **Use [EuiPopover](/#/layout/popover) values**: 'upCenter', 'upLeft', 'upRight', downCenter', 'downLeft', 'downRight', 'leftCenter', 'leftUp', 'leftDown', 'rightCenter', 'rightUp', 'rightDown'.
291
297
  */
292
298
  popoverPlacement: _propTypes.default.any,
299
+ /**
300
+ * Creates an input group with element(s) coming before the input.
301
+ * `string` | `ReactElement` or an array of these
302
+ *
303
+ * Ignored if `inline` or `controlOnly` are true.
304
+ */
305
+ append: _propTypes.default.any,
306
+ /**
307
+ * Creates an input group with element(s) coming before the input.
308
+ * `string` | `ReactElement` or an array of these
309
+ *
310
+ * Ignored if `inline` or `controlOnly` are true.
311
+ */
312
+ prepend: _propTypes.default.any,
293
313
  /**
294
314
  * Completely removes form control layout wrapper and ignores
295
- * iconType. Best used inside EuiFormControlLayoutDelimited.
315
+ * `iconType`, `prepend`, and `append`.
316
+ *
317
+ * Best used inside EuiFormControlLayoutDelimited.
296
318
  */
297
319
  controlOnly: _propTypes.default.bool
298
320
  };
@@ -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
  };
@@ -12,46 +12,55 @@ var _remark_prismjs = _interopRequireDefault(require("../remark/remark_prismjs")
12
12
  var MarkdownTooltip = _interopRequireWildcard(require("../markdown_tooltip"));
13
13
  var MarkdownCheckbox = _interopRequireWildcard(require("../markdown_checkbox"));
14
14
  var _markdown_link_validator = require("../markdown_link_validator");
15
- 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); }
16
- 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; }
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
21
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
23
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
15
+ var _excluded = ["exclude"];
16
+ /*
24
17
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
25
18
  * or more contributor license agreements. Licensed under the Elastic License
26
19
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
27
20
  * in compliance with, at your election, the Elastic License 2.0 or the Server
28
21
  * Side Public License, v 1.
29
- */ // Importing seemingly unused types from `unified` because the definitions
22
+ */
23
+ // Importing seemingly unused types from `unified` because the definitions
30
24
  // are exported for two versions of TypeScript (3.4, 4.0) and implicit
31
25
  // imports during eui.d.ts generation default to the incorrect version (3.4).
32
26
  // Explicit imports here resolve the version mismatch.
27
+ 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); }
28
+ 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; }
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
31
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
32
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
33
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
34
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
35
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
36
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
37
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
33
38
  var DEFAULT_PARSING_PLUGINS = {
34
39
  emoji: [_remarkEmoji.default, {
35
40
  emoticon: false
36
41
  }],
37
42
  lineBreaks: [_remarkBreaks.default, {}],
38
- linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, {
39
- allowRelative: true,
40
- allowProtocols: ['https:', 'http:', 'mailto:']
41
- }],
43
+ linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, _markdown_link_validator.DEFAULT_OPTIONS],
42
44
  checkbox: [MarkdownCheckbox.parser, {}],
43
45
  tooltip: [MarkdownTooltip.parser, {}]
44
46
  };
45
47
  var getDefaultEuiMarkdownParsingPlugins = exports.getDefaultEuiMarkdownParsingPlugins = function getDefaultEuiMarkdownParsingPlugins() {
46
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
47
- exclude = _ref.exclude;
48
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
49
+ var exclude = _ref.exclude,
50
+ parsingConfig = _objectWithoutProperties(_ref, _excluded);
48
51
  var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}]];
49
52
  Object.entries(DEFAULT_PARSING_PLUGINS).forEach(function (_ref2) {
50
53
  var _ref3 = _slicedToArray(_ref2, 2),
51
54
  pluginName = _ref3[0],
52
55
  plugin = _ref3[1];
56
+ // Check for plugin exclusions
53
57
  if (!(exclude !== null && exclude !== void 0 && exclude.includes(pluginName))) {
54
- parsingPlugins.push(plugin);
58
+ // Check for plugin configuration overrides
59
+ if (pluginName in parsingConfig) {
60
+ parsingPlugins.push([plugin[0], parsingConfig[pluginName]]);
61
+ } else {
62
+ parsingPlugins.push(plugin);
63
+ }
55
64
  }
56
65
  });
57
66
  return parsingPlugins;
@@ -7,18 +7,33 @@ exports.getDefaultEuiMarkdownPlugins = void 0;
7
7
  var _ui_plugins = require("./ui_plugins");
8
8
  var _parsing_plugins = require("./parsing_plugins");
9
9
  var _processing_plugins = require("./processing_plugins");
10
- /*
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ 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; }
12
+ 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) { _defineProperty(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; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
11
16
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
17
  * or more contributor license agreements. Licensed under the Elastic License
13
18
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
19
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
20
  * Side Public License, v 1.
16
21
  */
17
-
18
- var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins(config) {
22
+ var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins() {
23
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
+ var exclude = config.exclude,
25
+ processingConfig = config.processingConfig,
26
+ parsingConfig = config.parsingConfig,
27
+ uiConfig = config.uiConfig;
19
28
  return {
20
- parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(config),
21
- processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(config),
22
- uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(config)
29
+ parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(_objectSpread({
30
+ exclude: exclude
31
+ }, parsingConfig)),
32
+ processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(_objectSpread({
33
+ exclude: exclude
34
+ }, processingConfig)),
35
+ uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(_objectSpread({
36
+ exclude: exclude
37
+ }, uiConfig))
23
38
  };
24
39
  };
@@ -49,7 +49,8 @@ var DEFAULT_COMPONENT_RENDERERS = {
49
49
  };
50
50
  var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProcessingPlugins = function getDefaultEuiMarkdownProcessingPlugins() {
51
51
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
52
- exclude = _ref.exclude;
52
+ exclude = _ref.exclude,
53
+ linkProps = _ref.linkProps;
53
54
  var componentPluginsWithExclusions = {};
54
55
  Object.entries(DEFAULT_COMPONENT_RENDERERS).forEach(function (_ref2) {
55
56
  var _ref3 = _slicedToArray(_ref2, 2),
@@ -68,7 +69,9 @@ var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProces
68
69
  createElement: _react.createElement,
69
70
  Fragment: _react.Fragment,
70
71
  components: _objectSpread({
71
- a: _link.EuiLink,
72
+ a: function a(props) {
73
+ return (0, _react2.jsx)(_link.EuiLink, _extends({}, props, linkProps));
74
+ },
72
75
  code: function code(props) {
73
76
  return (
74
77
  // If there are linebreaks use codeblock, otherwise code
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.DEFAULT_OPTIONS = void 0;
6
7
  exports.euiMarkdownLinkValidator = euiMarkdownLinkValidator;
7
8
  exports.mutateLinkToText = mutateLinkToText;
8
9
  exports.validateUrl = validateUrl;
@@ -16,6 +17,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
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) {