@elastic/eui 88.5.0 → 88.5.2

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 (107) hide show
  1. package/dist/eui_theme_dark.css +8 -21
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +8 -21
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
  6. package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
  7. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +57 -0
  8. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
  9. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +156 -0
  10. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
  11. package/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
  12. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
  13. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
  14. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
  15. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +16 -63
  16. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
  17. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -41
  18. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
  19. package/es/components/combo_box/combo_box.js +12 -25
  20. package/es/components/combo_box/combo_box_input/combo_box_input.js +61 -54
  21. package/es/components/text_truncate/index.js +1 -1
  22. package/es/components/text_truncate/utils.js +88 -138
  23. package/es/services/canvas/canvas_text_utils.js +64 -0
  24. package/es/services/canvas/index.js +9 -0
  25. package/es/services/index.js +1 -0
  26. package/eui.d.ts +186 -105
  27. package/i18ntokens.json +8 -8
  28. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
  29. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
  30. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +67 -0
  31. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
  32. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +166 -0
  33. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
  34. package/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
  35. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
  36. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
  37. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
  38. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
  39. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
  40. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
  41. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
  42. package/lib/components/combo_box/combo_box.js +12 -25
  43. package/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -53
  44. package/lib/components/text_truncate/index.js +0 -6
  45. package/lib/components/text_truncate/utils.js +97 -148
  46. package/lib/services/canvas/canvas_text_utils.js +70 -0
  47. package/lib/services/canvas/index.js +12 -0
  48. package/lib/services/index.js +8 -0
  49. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +17 -3
  50. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
  51. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +56 -0
  52. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
  53. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +48 -0
  54. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
  55. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
  56. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -33
  57. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
  58. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -21
  59. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
  60. package/optimize/es/components/combo_box/combo_box.js +12 -25
  61. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +61 -53
  62. package/optimize/es/components/text_truncate/index.js +1 -1
  63. package/optimize/es/components/text_truncate/utils.js +87 -137
  64. package/optimize/es/services/canvas/canvas_text_utils.js +60 -0
  65. package/optimize/es/services/canvas/index.js +9 -0
  66. package/optimize/es/services/index.js +1 -0
  67. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +15 -1
  68. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
  69. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
  70. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
  71. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +58 -0
  72. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
  73. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
  74. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +5 -31
  75. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
  76. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -20
  77. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
  78. package/optimize/lib/components/combo_box/combo_box.js +12 -25
  79. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -52
  80. package/optimize/lib/components/text_truncate/index.js +0 -6
  81. package/optimize/lib/components/text_truncate/utils.js +96 -147
  82. package/optimize/lib/services/canvas/canvas_text_utils.js +67 -0
  83. package/optimize/lib/services/canvas/index.js +12 -0
  84. package/optimize/lib/services/index.js +8 -0
  85. package/package.json +2 -5
  86. package/src/components/combo_box/_combo_box.scss +12 -19
  87. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
  88. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
  89. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
  90. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
  91. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +165 -0
  92. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
  93. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
  94. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
  95. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
  96. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
  97. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
  98. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
  99. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
  100. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
  101. package/test-env/components/combo_box/combo_box.js +12 -25
  102. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +60 -53
  103. package/test-env/components/text_truncate/index.js +0 -6
  104. package/test-env/components/text_truncate/utils.js +96 -147
  105. package/test-env/services/canvas/canvas_text_utils.js +30 -0
  106. package/test-env/services/canvas/index.js +12 -0
  107. package/test-env/services/index.js +8 -0
@@ -27,8 +27,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
27
27
  import React, { Component } from 'react';
28
28
  import PropTypes from "prop-types";
29
29
  import classNames from 'classnames';
30
- import AutosizeInput from 'react-input-autosize';
31
- import { keys } from '../../../services';
30
+ import { keys, CanvasTextUtils } from '../../../services';
32
31
  import { EuiScreenReaderOnly } from '../../accessibility';
33
32
  import { EuiFormControlLayout } from '../../form/form_control_layout';
34
33
  import { getFormControlClassNameForIconCount } from '../../form/form_control_layout/_num_icons';
@@ -45,8 +44,27 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
45
44
  }
46
45
  _this = _super.call.apply(_super, [this].concat(args));
47
46
  _defineProperty(_assertThisInitialized(_this), "state", {
47
+ inputWidth: 2,
48
48
  hasFocus: false
49
49
  });
50
+ _defineProperty(_assertThisInitialized(_this), "widthUtils", void 0);
51
+ _defineProperty(_assertThisInitialized(_this), "inputRefCallback", function (el) {
52
+ var _this$props$inputRef, _this$props;
53
+ _this.widthUtils = new CanvasTextUtils({
54
+ container: el
55
+ });
56
+ (_this$props$inputRef = (_this$props = _this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, el);
57
+ });
58
+ _defineProperty(_assertThisInitialized(_this), "updateInputSize", function (inputValue) {
59
+ if (!_this.widthUtils) return;
60
+ _this.widthUtils.setTextToCheck(inputValue);
61
+ // Canvas has minute subpixel differences in rendering compared to DOM
62
+ // We'll buffer the input by ~2px just to ensure sufficient width
63
+ var inputWidth = Math.ceil(_this.widthUtils.textWidth) + 2;
64
+ _this.setState({
65
+ inputWidth: inputWidth
66
+ });
67
+ });
50
68
  _defineProperty(_assertThisInitialized(_this), "updatePosition", function () {
51
69
  // Wait a beat for the DOM to update, since we depend on DOM elements' bounds.
52
70
  requestAnimationFrame(function () {
@@ -68,13 +86,13 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
68
86
  });
69
87
  });
70
88
  _defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
71
- var _this$props = _this.props,
72
- searchValue = _this$props.searchValue,
73
- selectedOptions = _this$props.selectedOptions,
74
- onRemoveOption = _this$props.onRemoveOption,
75
- singleSelection = _this$props.singleSelection,
76
- isListOpen = _this$props.isListOpen,
77
- onOpenListClick = _this$props.onOpenListClick;
89
+ var _this$props2 = _this.props,
90
+ searchValue = _this$props2.searchValue,
91
+ selectedOptions = _this$props2.selectedOptions,
92
+ onRemoveOption = _this$props2.onRemoveOption,
93
+ singleSelection = _this$props2.singleSelection,
94
+ isListOpen = _this$props2.isListOpen,
95
+ onOpenListClick = _this$props2.onOpenListClick;
78
96
 
79
97
  // When backspacing from an empty input, delete the last pill option in the list
80
98
  var searchIsEmpty = !searchValue.length;
@@ -87,18 +105,10 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
87
105
  }
88
106
  });
89
107
  _defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
90
- var _this$props2 = _this.props,
91
- onChange = _this$props2.onChange,
92
- searchValue = _this$props2.searchValue;
93
- if (onChange) {
94
- onChange(event.target.value);
95
- }
96
- });
97
- _defineProperty(_assertThisInitialized(_this), "inputRefCallback", function (ref) {
98
- var autoSizeInputRef = _this.props.autoSizeInputRef;
99
- if (autoSizeInputRef) {
100
- autoSizeInputRef(ref);
101
- }
108
+ var _this$props$onChange, _this$props3;
109
+ var value = event.target.value;
110
+ _this.updateInputSize(value);
111
+ (_this$props$onChange = (_this$props3 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props3, value);
102
112
  });
103
113
  return _this;
104
114
  }
@@ -116,35 +126,34 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
116
126
  }, {
117
127
  key: "render",
118
128
  value: function render() {
119
- var _this$props3 = this.props,
120
- compressed = _this$props3.compressed,
121
- focusedOptionId = _this$props3.focusedOptionId,
122
- fullWidth = _this$props3.fullWidth,
123
- hasSelectedOptions = _this$props3.hasSelectedOptions,
124
- id = _this$props3.id,
125
- inputRef = _this$props3.inputRef,
126
- isDisabled = _this$props3.isDisabled,
127
- isListOpen = _this$props3.isListOpen,
128
- noIcon = _this$props3.noIcon,
129
- onClear = _this$props3.onClear,
130
- onClick = _this$props3.onClick,
131
- onCloseListClick = _this$props3.onCloseListClick,
132
- onOpenListClick = _this$props3.onOpenListClick,
133
- onRemoveOption = _this$props3.onRemoveOption,
134
- placeholder = _this$props3.placeholder,
135
- rootId = _this$props3.rootId,
136
- searchValue = _this$props3.searchValue,
137
- selectedOptions = _this$props3.selectedOptions,
138
- singleSelectionProp = _this$props3.singleSelection,
139
- toggleButtonRef = _this$props3.toggleButtonRef,
140
- value = _this$props3.value,
141
- prepend = _this$props3.prepend,
142
- append = _this$props3.append,
143
- isLoading = _this$props3.isLoading,
144
- isInvalid = _this$props3.isInvalid,
145
- autoFocus = _this$props3.autoFocus,
146
- ariaLabel = _this$props3['aria-label'],
147
- ariaLabelledby = _this$props3['aria-labelledby'];
129
+ var _this$props4 = this.props,
130
+ compressed = _this$props4.compressed,
131
+ focusedOptionId = _this$props4.focusedOptionId,
132
+ fullWidth = _this$props4.fullWidth,
133
+ hasSelectedOptions = _this$props4.hasSelectedOptions,
134
+ id = _this$props4.id,
135
+ isDisabled = _this$props4.isDisabled,
136
+ isListOpen = _this$props4.isListOpen,
137
+ noIcon = _this$props4.noIcon,
138
+ onClear = _this$props4.onClear,
139
+ onClick = _this$props4.onClick,
140
+ onCloseListClick = _this$props4.onCloseListClick,
141
+ onOpenListClick = _this$props4.onOpenListClick,
142
+ onRemoveOption = _this$props4.onRemoveOption,
143
+ placeholder = _this$props4.placeholder,
144
+ rootId = _this$props4.rootId,
145
+ searchValue = _this$props4.searchValue,
146
+ selectedOptions = _this$props4.selectedOptions,
147
+ singleSelectionProp = _this$props4.singleSelection,
148
+ toggleButtonRef = _this$props4.toggleButtonRef,
149
+ value = _this$props4.value,
150
+ prepend = _this$props4.prepend,
151
+ append = _this$props4.append,
152
+ isLoading = _this$props4.isLoading,
153
+ isInvalid = _this$props4.isInvalid,
154
+ autoFocus = _this$props4.autoFocus,
155
+ ariaLabel = _this$props4['aria-label'],
156
+ ariaLabelledby = _this$props4['aria-labelledby'];
148
157
  var singleSelection = Boolean(singleSelectionProp);
149
158
  var asPlainText = singleSelectionProp && _typeof(singleSelectionProp) === 'object' && singleSelectionProp.asPlainText || false;
150
159
  var pills = selectedOptions ? selectedOptions.map(function (option) {
@@ -236,7 +245,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
236
245
  "data-test-subj": "comboBoxInput",
237
246
  onClick: onClick,
238
247
  tabIndex: -1 // becomes onBlur event's relatedTarget, otherwise relatedTarget is null when clicking on this div
239
- }, !singleSelection || !searchValue ? pills : null, placeholderMessage, ___EmotionJSX(AutosizeInput, {
248
+ }, !singleSelection || !searchValue ? pills : null, placeholderMessage, ___EmotionJSX("input", {
240
249
  "aria-activedescendant": focusedOptionId,
241
250
  "aria-autocomplete": "list",
242
251
  "aria-controls": isListOpen ? rootId('listbox') : '',
@@ -248,7 +257,6 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
248
257
  "data-test-subj": "comboBoxSearchInput",
249
258
  disabled: isDisabled,
250
259
  id: id,
251
- inputRef: inputRef,
252
260
  onBlur: this.onBlur,
253
261
  onChange: this.inputOnChange,
254
262
  onFocus: this.onFocus,
@@ -256,7 +264,7 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
256
264
  ref: this.inputRefCallback,
257
265
  role: "combobox",
258
266
  style: {
259
- fontSize: 14
267
+ inlineSize: this.state.inputWidth
260
268
  },
261
269
  value: searchValue,
262
270
  autoFocus: autoFocus
@@ -266,7 +274,6 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
266
274
  return EuiComboBoxInput;
267
275
  }(Component);
268
276
  EuiComboBoxInput.propTypes = {
269
- autoSizeInputRef: PropTypes.any,
270
277
  compressed: PropTypes.bool.isRequired,
271
278
  focusedOptionId: PropTypes.string,
272
279
  fullWidth: PropTypes.bool,
@@ -7,4 +7,4 @@
7
7
  */
8
8
 
9
9
  export { EuiTextTruncate } from './text_truncate';
10
- export { CanvasTextUtils, TruncationUtils } from './utils';
10
+ export { TruncationUtils } from './utils';
@@ -8,6 +8,9 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
8
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
14
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
12
15
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
13
16
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -17,9 +20,6 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
17
20
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
21
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
22
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
23
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
24
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
25
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
@@ -31,57 +31,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
31
31
  * Side Public License, v 1.
32
32
  */
33
33
 
34
- /**
35
- * Under the hood, a temporary Canvas element is created for manipulating text
36
- * & determining text width.
37
- *
38
- * To accurately measure text, canvas rendering requires either a container to
39
- * compute/derive font styles from, or a static font string (useful for usage
40
- * outside the DOM). Particular care should be applied when fallback fonts are
41
- * used, as more fallback fonts can lead to less precision.
42
- *
43
- * Please note that while canvas is more significantly more performant than DOM
44
- * measurement, there are subpixel to single digit pixel differences between
45
- * DOM and canvas measurement due to the different rendering engines used.
46
- */
47
- export var CanvasTextUtils = /*#__PURE__*/function () {
48
- function CanvasTextUtils(_ref) {
49
- var _this = this;
50
- var font = _ref.font,
51
- container = _ref.container;
52
- _classCallCheck(this, CanvasTextUtils);
53
- _defineProperty(this, "context", void 0);
54
- _defineProperty(this, "currentText", '');
55
- _defineProperty(this, "computeFontFromElement", function (element) {
56
- var computedStyles = window.getComputedStyle(element);
57
- // TODO: font-stretch is not included even though it potentially should be
58
- // @see https://developer.mozilla.org/en-US/docs/Web/CSS/font#constituent_properties
59
- // It appears to be unsupported and/or breaks font computation in canvas
60
- return ['font-style', 'font-variant', 'font-weight', 'font-size', 'font-family'].map(function (prop) {
61
- return computedStyles.getPropertyValue(prop);
62
- }).join(' ').trim();
63
- });
64
- _defineProperty(this, "setTextToCheck", function (text) {
65
- _this.currentText = text;
66
- });
67
- this.context = document.createElement('canvas').getContext('2d');
68
-
69
- // Set the canvas font to ensure text width calculations are correct
70
- if (font) {
71
- this.context.font = font;
72
- } else if (container) {
73
- this.context.font = this.computeFontFromElement(container);
74
- }
75
- }
76
- _createClass(CanvasTextUtils, [{
77
- key: "textWidth",
78
- get: function get() {
79
- return this.context.measureText(this.currentText).width;
80
- }
81
- }]);
82
- return CanvasTextUtils;
83
- }();
84
-
34
+ import { CanvasTextUtils } from '../../services/canvas';
85
35
  /**
86
36
  * Utilities for truncating types at various positions, as well as
87
37
  * determining whether truncation is possible or even necessary.
@@ -89,22 +39,22 @@ export var CanvasTextUtils = /*#__PURE__*/function () {
89
39
  export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
90
40
  _inherits(TruncationUtils, _CanvasTextUtils);
91
41
  var _super = _createSuper(TruncationUtils);
92
- function TruncationUtils(_ref2) {
93
- var _this2;
94
- var fullText = _ref2.fullText,
95
- ellipsis = _ref2.ellipsis,
96
- _availableWidth = _ref2.availableWidth,
97
- rest = _objectWithoutProperties(_ref2, _excluded);
42
+ function TruncationUtils(_ref) {
43
+ var _this;
44
+ var fullText = _ref.fullText,
45
+ ellipsis = _ref.ellipsis,
46
+ _availableWidth = _ref.availableWidth,
47
+ rest = _objectWithoutProperties(_ref, _excluded);
98
48
  _classCallCheck(this, TruncationUtils);
99
- _this2 = _super.call(this, rest);
100
- _defineProperty(_assertThisInitialized(_this2), "fullText", void 0);
101
- _defineProperty(_assertThisInitialized(_this2), "ellipsis", void 0);
102
- _defineProperty(_assertThisInitialized(_this2), "availableWidth", void 0);
49
+ _this = _super.call(this, rest);
50
+ _defineProperty(_assertThisInitialized(_this), "fullText", void 0);
51
+ _defineProperty(_assertThisInitialized(_this), "ellipsis", void 0);
52
+ _defineProperty(_assertThisInitialized(_this), "availableWidth", void 0);
103
53
  /**
104
54
  * Performance utilities
105
55
  */
106
- _defineProperty(_assertThisInitialized(_this2), "debugPerformance", false);
107
- _defineProperty(_assertThisInitialized(_this2), "debugCounter", 0);
56
+ _defineProperty(_assertThisInitialized(_this), "debugPerformance", false);
57
+ _defineProperty(_assertThisInitialized(_this), "debugCounter", 0);
108
58
  /**
109
59
  * Internal utils for calculating a ratio based on the passed available width
110
60
  * vs the full text width.
@@ -112,21 +62,21 @@ export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
112
62
  * be slightly over the available width, which we can then remove from
113
63
  * character-by-character until the text just fits within the available width.
114
64
  */
115
- _defineProperty(_assertThisInitialized(_this2), "widthRatio", 0);
116
- _defineProperty(_assertThisInitialized(_this2), "setTextWidthRatio", function () {
117
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this2.fullText;
65
+ _defineProperty(_assertThisInitialized(_this), "widthRatio", 0);
66
+ _defineProperty(_assertThisInitialized(_this), "setTextWidthRatio", function () {
67
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.fullText;
118
68
  var textToOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
119
69
  // Account for reduced available width due to (e.g.) truncation offset
120
- var availableWidth = _this2.availableWidth;
70
+ var availableWidth = _this.availableWidth;
121
71
  if (textToOffset) {
122
- _this2.setTextToCheck(textToOffset);
123
- availableWidth = availableWidth - _this2.textWidth;
72
+ _this.setTextToCheck(textToOffset);
73
+ availableWidth = availableWidth - _this.textWidth;
124
74
  }
125
- _this2.setTextToCheck(text);
126
- _this2.widthRatio = availableWidth / _this2.textWidth;
75
+ _this.setTextToCheck(text);
76
+ _this.widthRatio = availableWidth / _this.textWidth;
127
77
  });
128
- _defineProperty(_assertThisInitialized(_this2), "getTextFromRatio", function (text, type) {
129
- var characterRatio = Math.ceil(text.length * _this2.widthRatio);
78
+ _defineProperty(_assertThisInitialized(_this), "getTextFromRatio", function (text, type) {
79
+ var characterRatio = Math.ceil(text.length * _this.widthRatio);
130
80
  var index = type === 'start' ? text.length - characterRatio : characterRatio;
131
81
  var _splitText$at = splitText(text).at(index),
132
82
  _splitText$at2 = _slicedToArray(_splitText$at, 2),
@@ -137,24 +87,24 @@ export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
137
87
  /**
138
88
  * Early return checks
139
89
  */
140
- _defineProperty(_assertThisInitialized(_this2), "checkIfTruncationIsNeeded", function () {
141
- _this2.setTextToCheck(_this2.fullText);
142
- if (_this2.availableWidth >= _this2.textWidth) {
90
+ _defineProperty(_assertThisInitialized(_this), "checkIfTruncationIsNeeded", function () {
91
+ _this.setTextToCheck(_this.fullText);
92
+ if (_this.availableWidth >= _this.textWidth) {
143
93
  return false;
144
94
  }
145
95
  });
146
- _defineProperty(_assertThisInitialized(_this2), "checkSufficientEllipsisWidth", function (truncation) {
147
- var textToCheck = truncation === 'startEnd' ? "".concat(_this2.ellipsis, " ").concat(_this2.ellipsis) // startEnd needs a little more space
148
- : _this2.ellipsis;
149
- _this2.setTextToCheck(textToCheck);
150
- if (_this2.textWidth >= _this2.availableWidth * 0.9) {
96
+ _defineProperty(_assertThisInitialized(_this), "checkSufficientEllipsisWidth", function (truncation) {
97
+ var textToCheck = truncation === 'startEnd' ? "".concat(_this.ellipsis, " ").concat(_this.ellipsis) // startEnd needs a little more space
98
+ : _this.ellipsis;
99
+ _this.setTextToCheck(textToCheck);
100
+ if (_this.textWidth >= _this.availableWidth * 0.9) {
151
101
  console.error('The truncation ellipsis is larger than the available width. No text can be rendered.');
152
102
  return false;
153
103
  }
154
104
  });
155
- _defineProperty(_assertThisInitialized(_this2), "checkTruncationOffsetWidth", function (text) {
156
- _this2.setTextToCheck(text);
157
- if (_this2.textWidth > _this2.availableWidth) {
105
+ _defineProperty(_assertThisInitialized(_this), "checkTruncationOffsetWidth", function (text) {
106
+ _this.setTextToCheck(text);
107
+ if (_this.textWidth > _this.availableWidth) {
158
108
  console.error('The passed truncationOffset is too large for the available width. Truncating the offset instead.');
159
109
  return false;
160
110
  }
@@ -162,19 +112,19 @@ export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
162
112
  /**
163
113
  * Truncation types logic. This is where the magic happens
164
114
  */
165
- _defineProperty(_assertThisInitialized(_this2), "truncateStart", function (truncationOffset) {
166
- var truncatedText = _this2.fullText;
115
+ _defineProperty(_assertThisInitialized(_this), "truncateStart", function (truncationOffset) {
116
+ var truncatedText = _this.fullText;
167
117
  var leadingText = '';
168
118
  var combinedText = function combinedText() {
169
119
  return leadingText + truncatedText;
170
120
  };
171
121
  if (truncationOffset) {
172
- var _splitText$at3 = splitText(_this2.fullText).at(truncationOffset);
122
+ var _splitText$at3 = splitText(_this.fullText).at(truncationOffset);
173
123
  var _splitText$at4 = _slicedToArray(_splitText$at3, 2);
174
124
  leadingText = _splitText$at4[0];
175
125
  truncatedText = _splitText$at4[1];
176
- var widthCheck = leadingText + _this2.ellipsis;
177
- if (_this2.checkTruncationOffsetWidth(widthCheck) === false) {
126
+ var widthCheck = leadingText + _this.ellipsis;
127
+ if (_this.checkTruncationOffsetWidth(widthCheck) === false) {
178
128
  truncatedText = leadingText;
179
129
  leadingText = '';
180
130
  }
@@ -182,30 +132,30 @@ export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
182
132
 
183
133
  // Get text width ratio width accounting for any truncation offset text,
184
134
  // and guesstimate an initial truncated string
185
- _this2.setTextWidthRatio(truncatedText, leadingText);
186
- truncatedText = _this2.getTextFromRatio(truncatedText, 'start');
187
- leadingText += _this2.ellipsis;
188
- _this2.setTextToCheck(combinedText());
189
- while (_this2.textWidth > _this2.availableWidth) {
135
+ _this.setTextWidthRatio(truncatedText, leadingText);
136
+ truncatedText = _this.getTextFromRatio(truncatedText, 'start');
137
+ leadingText += _this.ellipsis;
138
+ _this.setTextToCheck(combinedText());
139
+ while (_this.textWidth > _this.availableWidth) {
190
140
  truncatedText = removeFirstCharacter(truncatedText);
191
- _this2.setTextToCheck(combinedText());
141
+ _this.setTextToCheck(combinedText());
192
142
  }
193
143
  return combinedText();
194
144
  });
195
- _defineProperty(_assertThisInitialized(_this2), "truncateEnd", function (truncationOffset) {
196
- var truncatedText = _this2.fullText;
145
+ _defineProperty(_assertThisInitialized(_this), "truncateEnd", function (truncationOffset) {
146
+ var truncatedText = _this.fullText;
197
147
  var trailingText = '';
198
148
  var combinedText = function combinedText() {
199
149
  return truncatedText + trailingText;
200
150
  };
201
151
  if (truncationOffset) {
202
- var index = _this2.fullText.length - truncationOffset;
203
- var _splitText$at5 = splitText(_this2.fullText).at(index);
152
+ var index = _this.fullText.length - truncationOffset;
153
+ var _splitText$at5 = splitText(_this.fullText).at(index);
204
154
  var _splitText$at6 = _slicedToArray(_splitText$at5, 2);
205
155
  truncatedText = _splitText$at6[0];
206
156
  trailingText = _splitText$at6[1];
207
- var widthCheck = _this2.ellipsis + trailingText;
208
- if (_this2.checkTruncationOffsetWidth(widthCheck) === false) {
157
+ var widthCheck = _this.ellipsis + trailingText;
158
+ if (_this.checkTruncationOffsetWidth(widthCheck) === false) {
209
159
  truncatedText = trailingText;
210
160
  trailingText = '';
211
161
  }
@@ -213,78 +163,78 @@ export var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
213
163
 
214
164
  // Get text width ratio width accounting for any truncation offset text,
215
165
  // and guesstimate an initial truncated string
216
- _this2.setTextWidthRatio(truncatedText, trailingText);
217
- truncatedText = _this2.getTextFromRatio(truncatedText, 'end');
218
- trailingText = _this2.ellipsis + trailingText;
219
- _this2.setTextToCheck(combinedText());
220
- while (_this2.textWidth > _this2.availableWidth) {
166
+ _this.setTextWidthRatio(truncatedText, trailingText);
167
+ truncatedText = _this.getTextFromRatio(truncatedText, 'end');
168
+ trailingText = _this.ellipsis + trailingText;
169
+ _this.setTextToCheck(combinedText());
170
+ while (_this.textWidth > _this.availableWidth) {
221
171
  truncatedText = removeLastCharacter(truncatedText);
222
- _this2.setTextToCheck(combinedText());
172
+ _this.setTextToCheck(combinedText());
223
173
  }
224
174
  return combinedText();
225
175
  });
226
- _defineProperty(_assertThisInitialized(_this2), "truncateStartEndAtPosition", function (truncationPosition) {
176
+ _defineProperty(_assertThisInitialized(_this), "truncateStartEndAtPosition", function (truncationPosition) {
227
177
  // Split the text from the anchor position, using the width ratio
228
178
  // to get the starting and ending indices from the position
229
- _this2.setTextWidthRatio();
230
- var characterRatio = Math.floor(_this2.fullText.length * _this2.widthRatio / 2);
179
+ _this.setTextWidthRatio();
180
+ var characterRatio = Math.floor(_this.fullText.length * _this.widthRatio / 2);
231
181
  var truncateStart = truncationPosition - characterRatio;
232
182
  var truncateEnd = truncationPosition + characterRatio;
233
183
 
234
184
  // If either of the approximate start/end truncation indices go beyond the
235
185
  // bounds of the actual text, we can simply use end or start truncation instead
236
186
  if (truncateStart < 0) {
237
- return _this2.truncateEnd();
187
+ return _this.truncateEnd();
238
188
  }
239
- if (truncateEnd >= _this2.fullText.length) {
240
- return _this2.truncateStart();
189
+ if (truncateEnd >= _this.fullText.length) {
190
+ return _this.truncateStart();
241
191
  }
242
- var truncatedText = _this2.fullText.substring(truncateStart, truncateEnd);
192
+ var truncatedText = _this.fullText.substring(truncateStart, truncateEnd);
243
193
  var combinedText = function combinedText() {
244
- return _this2.ellipsis + truncatedText + _this2.ellipsis;
194
+ return _this.ellipsis + truncatedText + _this.ellipsis;
245
195
  };
246
- _this2.setTextToCheck(combinedText());
196
+ _this.setTextToCheck(combinedText());
247
197
  var alternating;
248
- while (_this2.textWidth > _this2.availableWidth) {
198
+ while (_this.textWidth > _this.availableWidth) {
249
199
  truncatedText = alternating ? removeLastCharacter(truncatedText) : removeFirstCharacter(truncatedText);
250
200
  alternating = !alternating;
251
- _this2.setTextToCheck(combinedText());
201
+ _this.setTextToCheck(combinedText());
252
202
  }
253
203
  return combinedText();
254
204
  });
255
- _defineProperty(_assertThisInitialized(_this2), "truncateStartEndAtMiddle", function () {
256
- var middlePosition = Math.floor(_this2.fullText.length / 2);
257
- return _this2.truncateStartEndAtPosition(middlePosition);
205
+ _defineProperty(_assertThisInitialized(_this), "truncateStartEndAtMiddle", function () {
206
+ var middlePosition = Math.floor(_this.fullText.length / 2);
207
+ return _this.truncateStartEndAtPosition(middlePosition);
258
208
  });
259
- _defineProperty(_assertThisInitialized(_this2), "truncateMiddle", function () {
260
- var middlePosition = Math.floor(_this2.fullText.length / 2);
261
- var _splitText$at7 = splitText(_this2.fullText).at(middlePosition),
209
+ _defineProperty(_assertThisInitialized(_this), "truncateMiddle", function () {
210
+ var middlePosition = Math.floor(_this.fullText.length / 2);
211
+ var _splitText$at7 = splitText(_this.fullText).at(middlePosition),
262
212
  _splitText$at8 = _slicedToArray(_splitText$at7, 2),
263
213
  firstHalf = _splitText$at8[0],
264
214
  secondHalf = _splitText$at8[1];
265
- _this2.setTextWidthRatio();
266
- firstHalf = _this2.getTextFromRatio(firstHalf, 'end');
267
- secondHalf = _this2.getTextFromRatio(secondHalf, 'start');
215
+ _this.setTextWidthRatio();
216
+ firstHalf = _this.getTextFromRatio(firstHalf, 'end');
217
+ secondHalf = _this.getTextFromRatio(secondHalf, 'start');
268
218
  var combinedText = function combinedText() {
269
- return firstHalf + _this2.ellipsis + secondHalf;
219
+ return firstHalf + _this.ellipsis + secondHalf;
270
220
  };
271
- _this2.setTextToCheck(combinedText());
221
+ _this.setTextToCheck(combinedText());
272
222
  var alternating;
273
- while (_this2.textWidth > _this2.availableWidth) {
223
+ while (_this.textWidth > _this.availableWidth) {
274
224
  alternating = !alternating;
275
225
  if (alternating) {
276
226
  firstHalf = removeLastCharacter(firstHalf);
277
227
  } else {
278
228
  secondHalf = removeFirstCharacter(secondHalf);
279
229
  }
280
- _this2.setTextToCheck(combinedText());
230
+ _this.setTextToCheck(combinedText());
281
231
  }
282
232
  return combinedText();
283
233
  });
284
- _this2.fullText = fullText;
285
- _this2.ellipsis = ellipsis;
286
- _this2.availableWidth = _availableWidth;
287
- return _this2;
234
+ _this.fullText = fullText;
235
+ _this.ellipsis = ellipsis;
236
+ _this.availableWidth = _availableWidth;
237
+ return _this;
288
238
  }
289
239
  _createClass(TruncationUtils, [{
290
240
  key: "textWidth",
@@ -0,0 +1,64 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+
16
+ /**
17
+ * Creates a temporary Canvas element for manipulating text & determining text width.
18
+ *
19
+ * To accurately measure text, canvas rendering requires either a container to
20
+ * compute/derive font styles from, or a static font string (useful for usage
21
+ * outside the DOM). Particular care should be applied when fallback fonts are
22
+ * used, as more fallback fonts can lead to less precision.
23
+ *
24
+ * Please note that while canvas is more significantly more performant than DOM
25
+ * measurement, there are subpixel to single digit pixel differences between
26
+ * DOM and canvas measurement due to the different rendering engines used.
27
+ */
28
+ export var CanvasTextUtils = /*#__PURE__*/function () {
29
+ function CanvasTextUtils(_ref) {
30
+ var _this = this;
31
+ var font = _ref.font,
32
+ container = _ref.container;
33
+ _classCallCheck(this, CanvasTextUtils);
34
+ _defineProperty(this, "context", void 0);
35
+ _defineProperty(this, "currentText", '');
36
+ _defineProperty(this, "computeFontFromElement", function (element) {
37
+ var computedStyles = window.getComputedStyle(element);
38
+ // TODO: font-stretch is not included even though it potentially should be
39
+ // @see https://developer.mozilla.org/en-US/docs/Web/CSS/font#constituent_properties
40
+ // It appears to be unsupported and/or breaks font computation in canvas
41
+ return ['font-style', 'font-variant', 'font-weight', 'font-size', 'font-family'].map(function (prop) {
42
+ return computedStyles.getPropertyValue(prop);
43
+ }).join(' ').trim();
44
+ });
45
+ _defineProperty(this, "setTextToCheck", function (text) {
46
+ _this.currentText = text;
47
+ });
48
+ this.context = document.createElement('canvas').getContext('2d');
49
+
50
+ // Set the canvas font to ensure text width calculations are correct
51
+ if (font) {
52
+ this.context.font = font;
53
+ } else if (container) {
54
+ this.context.font = this.computeFontFromElement(container);
55
+ }
56
+ }
57
+ _createClass(CanvasTextUtils, [{
58
+ key: "textWidth",
59
+ get: function get() {
60
+ return this.context.measureText(this.currentText).width;
61
+ }
62
+ }]);
63
+ return CanvasTextUtils;
64
+ }();
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ export { CanvasTextUtils } from './canvas_text_utils';
@@ -11,6 +11,7 @@ import * as keys from './keys';
11
11
  export { accessibleClickKeys, cascadingMenuKeys, comboBoxKeys, htmlIdGenerator, useGeneratedHtmlId } from './accessibility';
12
12
  export { CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from './alignment';
13
13
  export { CurrentEuiBreakpointContext, CurrentEuiBreakpointProvider, useCurrentEuiBreakpoint, useIsWithinBreakpoints, useIsWithinMaxBreakpoint, useIsWithinMinBreakpoint } from './breakpoint';
14
+ export { CanvasTextUtils } from './canvas';
14
15
  export { brighten, calculateContrast, calculateLuminance, colorPalette, darken, DEFAULT_VISUALIZATION_COLOR, desaturate, euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteComplimentary, euiPaletteComplementary, euiPaletteCool, euiPaletteForDarkBackground, euiPaletteForLightBackground, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteGray, euiPaletteNegative, euiPalettePositive, euiPaletteWarm, getSteppedGradient, hexToHsv, hexToRgb, hsvToHex, hsvToRgb, isColorDark, isValidHex, lightness, makeDisabledContrastColor, makeHighContrastColor, rgbToHex, rgbToHsv, saturate, shade, shadeOrTint, tint, tintOrShade, transparentize, VISUALIZATION_COLORS, wcagContrastMin } from './color';
15
16
  export { useColorPickerState, useColorStopsState } from './color_picker';
16
17
  export * from './console';