@elastic/eui 113.2.1 → 114.0.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 (142) hide show
  1. package/es/components/basic_table/collapsed_item_actions.js +2 -0
  2. package/es/components/button/split_button/split_button.js +13 -0
  3. package/es/components/button/split_button/split_button_actions.js +15 -0
  4. package/es/components/collapsible_nav/collapsible_nav.js +5 -0
  5. package/es/components/color_picker/color_picker.js +31 -8
  6. package/es/components/context_menu/context_menu_item.js +9 -3
  7. package/es/components/context_menu/context_menu_item.styles.js +6 -2
  8. package/es/components/datagrid/utils/scrolling.js +39 -10
  9. package/es/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
  10. package/es/components/flyout/_flyout_overlay.js +34 -4
  11. package/es/components/flyout/const.js +10 -0
  12. package/es/components/flyout/flyout.component.js +49 -57
  13. package/es/components/flyout/flyout.js +10 -2
  14. package/es/components/flyout/flyout.styles.js +2 -2
  15. package/es/components/flyout/flyout_menu.js +19 -5
  16. package/es/components/flyout/flyout_resizable.js +5 -0
  17. package/es/components/flyout/manager/actions.js +12 -5
  18. package/es/components/flyout/manager/flyout_child.js +9 -2
  19. package/es/components/flyout/manager/flyout_managed.js +27 -14
  20. package/es/components/flyout/manager/reducer.js +251 -54
  21. package/es/components/flyout/manager/store.js +74 -12
  22. package/es/components/flyout/use_flyout_menu.js +70 -0
  23. package/es/components/form/file_picker/file_picker.js +46 -18
  24. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  25. package/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  26. package/es/components/overlay_mask/overlay_mask.js +10 -3
  27. package/es/components/tree_view/tree_view_item.styles.js +1 -1
  28. package/es/services/hooks/index.js +8 -8
  29. package/es/services/hooks/useIsPointerDown.js +6 -15
  30. package/es/services/index.js +1 -1
  31. package/eui.d.ts +477 -63
  32. package/i18ntokens.json +661 -643
  33. package/lib/components/basic_table/collapsed_item_actions.js +2 -0
  34. package/lib/components/button/split_button/split_button.js +13 -0
  35. package/lib/components/button/split_button/split_button_actions.js +15 -0
  36. package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
  37. package/lib/components/color_picker/color_picker.js +30 -7
  38. package/lib/components/context_menu/context_menu_item.js +9 -3
  39. package/lib/components/context_menu/context_menu_item.styles.js +5 -1
  40. package/lib/components/datagrid/utils/scrolling.js +37 -8
  41. package/lib/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
  42. package/lib/components/flyout/_flyout_overlay.js +33 -3
  43. package/lib/components/flyout/const.js +11 -1
  44. package/lib/components/flyout/flyout.component.js +48 -56
  45. package/lib/components/flyout/flyout.js +15 -1
  46. package/lib/components/flyout/flyout.styles.js +2 -2
  47. package/lib/components/flyout/flyout_menu.js +19 -5
  48. package/lib/components/flyout/flyout_resizable.js +5 -0
  49. package/lib/components/flyout/manager/actions.js +12 -5
  50. package/lib/components/flyout/manager/flyout_child.js +9 -2
  51. package/lib/components/flyout/manager/flyout_managed.js +19 -12
  52. package/lib/components/flyout/manager/reducer.js +250 -53
  53. package/lib/components/flyout/manager/store.js +74 -14
  54. package/lib/components/flyout/use_flyout_menu.js +75 -0
  55. package/lib/components/form/file_picker/file_picker.js +46 -18
  56. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  57. package/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  58. package/lib/components/overlay_mask/overlay_mask.js +10 -3
  59. package/lib/components/tree_view/tree_view_item.styles.js +1 -1
  60. package/lib/services/hooks/index.js +60 -91
  61. package/lib/services/hooks/useIsPointerDown.js +7 -14
  62. package/lib/services/index.js +70 -11
  63. package/optimize/es/components/basic_table/collapsed_item_actions.js +2 -0
  64. package/optimize/es/components/color_picker/color_picker.js +31 -8
  65. package/optimize/es/components/context_menu/context_menu_item.js +3 -2
  66. package/optimize/es/components/context_menu/context_menu_item.styles.js +6 -2
  67. package/optimize/es/components/datagrid/utils/scrolling.js +39 -10
  68. package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
  69. package/optimize/es/components/flyout/_flyout_overlay.js +34 -4
  70. package/optimize/es/components/flyout/const.js +10 -0
  71. package/optimize/es/components/flyout/flyout.component.js +49 -57
  72. package/optimize/es/components/flyout/flyout.js +5 -2
  73. package/optimize/es/components/flyout/flyout.styles.js +2 -2
  74. package/optimize/es/components/flyout/flyout_menu.js +7 -3
  75. package/optimize/es/components/flyout/manager/actions.js +12 -5
  76. package/optimize/es/components/flyout/manager/flyout_managed.js +18 -12
  77. package/optimize/es/components/flyout/manager/reducer.js +251 -54
  78. package/optimize/es/components/flyout/manager/store.js +69 -12
  79. package/optimize/es/components/flyout/use_flyout_menu.js +69 -0
  80. package/optimize/es/components/form/file_picker/file_picker.js +35 -18
  81. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  82. package/optimize/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  83. package/optimize/es/components/overlay_mask/overlay_mask.js +4 -2
  84. package/optimize/es/components/tree_view/tree_view_item.styles.js +1 -1
  85. package/optimize/es/services/hooks/index.js +8 -8
  86. package/optimize/es/services/hooks/useIsPointerDown.js +6 -10
  87. package/optimize/es/services/index.js +1 -1
  88. package/optimize/lib/components/basic_table/collapsed_item_actions.js +2 -0
  89. package/optimize/lib/components/color_picker/color_picker.js +30 -7
  90. package/optimize/lib/components/context_menu/context_menu_item.js +3 -2
  91. package/optimize/lib/components/context_menu/context_menu_item.styles.js +5 -1
  92. package/optimize/lib/components/datagrid/utils/scrolling.js +37 -8
  93. package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
  94. package/optimize/lib/components/flyout/_flyout_overlay.js +33 -3
  95. package/optimize/lib/components/flyout/const.js +11 -1
  96. package/optimize/lib/components/flyout/flyout.component.js +48 -56
  97. package/optimize/lib/components/flyout/flyout.js +10 -1
  98. package/optimize/lib/components/flyout/flyout.styles.js +2 -2
  99. package/optimize/lib/components/flyout/flyout_menu.js +7 -3
  100. package/optimize/lib/components/flyout/manager/actions.js +12 -5
  101. package/optimize/lib/components/flyout/manager/flyout_managed.js +18 -12
  102. package/optimize/lib/components/flyout/manager/reducer.js +250 -53
  103. package/optimize/lib/components/flyout/manager/store.js +70 -12
  104. package/optimize/lib/components/flyout/use_flyout_menu.js +74 -0
  105. package/optimize/lib/components/form/file_picker/file_picker.js +35 -18
  106. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  107. package/optimize/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  108. package/optimize/lib/components/overlay_mask/overlay_mask.js +4 -2
  109. package/optimize/lib/components/tree_view/tree_view_item.styles.js +1 -1
  110. package/optimize/lib/services/hooks/index.js +60 -91
  111. package/optimize/lib/services/hooks/useIsPointerDown.js +5 -10
  112. package/optimize/lib/services/index.js +70 -11
  113. package/package.json +4 -4
  114. package/test-env/components/basic_table/collapsed_item_actions.js +2 -0
  115. package/test-env/components/button/split_button/split_button.js +13 -0
  116. package/test-env/components/button/split_button/split_button_actions.js +15 -0
  117. package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
  118. package/test-env/components/color_picker/color_picker.js +30 -7
  119. package/test-env/components/context_menu/context_menu_item.js +9 -3
  120. package/test-env/components/context_menu/context_menu_item.styles.js +5 -1
  121. package/test-env/components/datagrid/utils/scrolling.js +37 -8
  122. package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
  123. package/test-env/components/flyout/_flyout_overlay.js +33 -3
  124. package/test-env/components/flyout/const.js +11 -1
  125. package/test-env/components/flyout/flyout.component.js +48 -56
  126. package/test-env/components/flyout/flyout.styles.js +2 -2
  127. package/test-env/components/flyout/flyout_menu.js +19 -5
  128. package/test-env/components/flyout/flyout_resizable.js +5 -0
  129. package/test-env/components/flyout/manager/actions.js +12 -5
  130. package/test-env/components/flyout/manager/flyout_child.js +9 -2
  131. package/test-env/components/flyout/manager/flyout_managed.js +19 -12
  132. package/test-env/components/flyout/manager/reducer.js +250 -53
  133. package/test-env/components/flyout/manager/store.js +70 -12
  134. package/test-env/components/flyout/use_flyout_menu.js +74 -0
  135. package/test-env/components/form/file_picker/file_picker.js +46 -18
  136. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  137. package/test-env/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  138. package/test-env/components/overlay_mask/overlay_mask.js +10 -3
  139. package/test-env/components/tree_view/tree_view_item.styles.js +1 -1
  140. package/test-env/services/hooks/index.js +60 -91
  141. package/test-env/services/hooks/useIsPointerDown.js +5 -10
  142. package/test-env/services/index.js +70 -11
@@ -1,4 +1,4 @@
1
- var _excluded = ["stylesMemoizer", "id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display"];
1
+ var _excluded = ["stylesMemoizer", "id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display", "files"];
2
2
  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); }
3
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
4
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
@@ -52,36 +52,41 @@ export var EuiFilePickerClass = /*#__PURE__*/function (_Component) {
52
52
  args[_key] = arguments[_key];
53
53
  }
54
54
  _this = _callSuper(this, EuiFilePickerClass, [].concat(args));
55
+ _defineProperty(_this, "fileInput", null);
56
+ _defineProperty(_this, "generatedId", htmlIdGenerator()());
57
+ _defineProperty(_this, "getPromptTextFromFileList", function (files) {
58
+ if (!files || files.length === 0) {
59
+ return null;
60
+ }
61
+ if (files.length > 1) {
62
+ return ___EmotionJSX(EuiI18n, {
63
+ token: "euiFilePicker.filesSelected",
64
+ default: "{fileCount} files selected",
65
+ values: {
66
+ fileCount: files.length
67
+ }
68
+ });
69
+ }
70
+ return files[0].name;
71
+ });
55
72
  _defineProperty(_this, "state", {
56
- promptText: null,
73
+ promptText: _this.props.files ? _this.getPromptTextFromFileList(_this.props.files) : null,
57
74
  isHoveringDrop: false
58
75
  });
59
- _defineProperty(_this, "fileInput", null);
60
- _defineProperty(_this, "generatedId", htmlIdGenerator()());
61
76
  _defineProperty(_this, "handleChange", function () {
62
77
  if (!_this.fileInput) return;
63
- if (_this.fileInput.files && _this.fileInput.files.length > 1) {
78
+ if (_this.fileInput.files && _this.fileInput.files.length === 1) {
64
79
  _this.setState({
65
- promptText: ___EmotionJSX(EuiI18n, {
66
- token: "euiFilePicker.filesSelected",
67
- default: "{fileCount} files selected",
68
- values: {
69
- fileCount: _this.fileInput.files.length
70
- }
71
- })
72
- });
73
- } else if (_this.fileInput.files && _this.fileInput.files.length === 0) {
74
- _this.setState({
75
- promptText: null
80
+ promptText: _this.fileInput.value.split('\\').pop()
76
81
  });
77
82
  } else {
78
83
  _this.setState({
79
- promptText: _this.fileInput.value.split('\\').pop()
84
+ promptText: _this.getPromptTextFromFileList(_this.fileInput.files ? Array.from(_this.fileInput.files) : null)
80
85
  });
81
86
  }
82
87
  var onChange = _this.props.onChange;
83
88
  if (onChange) {
84
- onChange(_this.fileInput.files);
89
+ onChange(_this.fileInput.files && _this.fileInput.files.length > 0 ? _this.fileInput.files : null);
85
90
  }
86
91
  });
87
92
  _defineProperty(_this, "removeFiles", function (e) {
@@ -109,6 +114,17 @@ export var EuiFilePickerClass = /*#__PURE__*/function (_Component) {
109
114
  }
110
115
  _inherits(EuiFilePickerClass, _Component);
111
116
  return _createClass(EuiFilePickerClass, [{
117
+ key: "componentDidUpdate",
118
+ value: function componentDidUpdate(prevProps) {
119
+ // Update prompt text when files prop changes
120
+ if (this.props.files !== prevProps.files) {
121
+ var _this$props$files;
122
+ this.setState({
123
+ promptText: this.getPromptTextFromFileList((_this$props$files = this.props.files) !== null && _this$props$files !== void 0 ? _this$props$files : null)
124
+ });
125
+ }
126
+ }
127
+ }, {
112
128
  key: "render",
113
129
  value: function render() {
114
130
  var _this2 = this;
@@ -132,6 +148,7 @@ export var EuiFilePickerClass = /*#__PURE__*/function (_Component) {
132
148
  fullWidth = _this2$props$fullWidt === void 0 ? defaultFullWidth : _this2$props$fullWidt,
133
149
  isLoading = _this2$props.isLoading,
134
150
  display = _this2$props.display,
151
+ files = _this2$props.files,
135
152
  rest = _objectWithoutProperties(_this2$props, _excluded);
136
153
  var promptId = "".concat(id || _this2.generatedId, "-filePicker__prompt");
137
154
  var isOverridingInitialPrompt = _this2.state.promptText != null;
@@ -246,6 +263,17 @@ EuiFilePickerClass.propTypes = {
246
263
  * Use as a callback to access the HTML FileList API
247
264
  */
248
265
  onChange: PropTypes.func,
266
+ /**
267
+ * Optionally pass a `File[]` array to maintain the file picker's displayed
268
+ * state between re-renders. Useful for multi-step forms where the component
269
+ * may unmount and remount while the file data is still stored in context.
270
+ *
271
+ * Note: Due to browser security restrictions, the actual file input
272
+ * cannot be programmatically set with files. This prop only controls
273
+ * the displayed state (file names in the prompt). The actual file data
274
+ * should be stored and managed separately in your application state.
275
+ */
276
+ files: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.any.isRequired).isRequired, PropTypes.oneOf([null])]),
249
277
  /**
250
278
  * Reduces the size to a typical (compressed) input
251
279
  * @default false
@@ -24,6 +24,7 @@ import markdown from 'remark-parse-no-trim';
24
24
  import emoji from 'remark-emoji';
25
25
  import breaks from 'remark-breaks';
26
26
  import highlight from '../remark/remark_prismjs';
27
+ import intrawordUnderscore from '../remark/remark_intraword_underscore';
27
28
  import * as MarkdownTooltip from '../markdown_tooltip';
28
29
  import * as MarkdownCheckbox from '../markdown_checkbox';
29
30
  import { euiMarkdownLinkValidator, DEFAULT_OPTIONS as LINK_VALIDATOR_DEFAULTS } from '../markdown_link_validator';
@@ -40,7 +41,7 @@ export var getDefaultEuiMarkdownParsingPlugins = function getDefaultEuiMarkdownP
40
41
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
41
42
  var exclude = _ref.exclude,
42
43
  parsingConfig = _objectWithoutProperties(_ref, _excluded);
43
- var parsingPlugins = [[markdown, {}], [highlight, {}]];
44
+ var parsingPlugins = [[markdown, {}], [highlight, {}], [intrawordUnderscore, {}]];
44
45
  Object.entries(DEFAULT_PARSING_PLUGINS).forEach(function (_ref2) {
45
46
  var _ref3 = _slicedToArray(_ref2, 2),
46
47
  pluginName = _ref3[0],
@@ -0,0 +1,172 @@
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2
+ 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; } }
3
+ 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; }
4
+ /*
5
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
+ * or more contributor license agreements. Licensed under the Elastic License
7
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
8
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
9
+ * Side Public License, v 1.
10
+ */
11
+
12
+ // Temporary workaround for https://github.com/elastic/eui/issues/9404
13
+ // remark-parse v8 doesn't implement the CommonMark rule that underscore
14
+ // emphasis delimiters flanked by alphanumerics on both sides (intraword)
15
+ // cannot open or close emphasis. This causes identifiers like
16
+ // `ABCD__PineappleCherry__e` to render with bold formatting.
17
+ // This plugin walks the parsed AST and reverses incorrectly applied
18
+ // emphasis/strong nodes when both sides are alphanumeric characters.
19
+
20
+ // eslint-disable-next-line import/no-unresolved
21
+
22
+ var isTextNode = function isTextNode(node) {
23
+ return node.type === 'text';
24
+ };
25
+ var isEmphasisOrStrong = function isEmphasisOrStrong(node) {
26
+ return node.type === 'emphasis' || node.type === 'strong';
27
+ };
28
+ var isAlphanumeric = function isAlphanumeric(ch) {
29
+ return /[a-zA-Z0-9]/.test(ch);
30
+ };
31
+
32
+ /**
33
+ * Recursively converts an emphasis/strong node back into plain text
34
+ * with underscore delimiters restored.
35
+ */
36
+ function flattenToText(node) {
37
+ var delimiter = node.type === 'emphasis' ? '_' : '__';
38
+ var inner = '';
39
+ var _iterator = _createForOfIteratorHelper(node.children),
40
+ _step;
41
+ try {
42
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
43
+ var child = _step.value;
44
+ if (isTextNode(child)) {
45
+ inner += child.value;
46
+ } else if (isEmphasisOrStrong(child)) {
47
+ inner += flattenToText(child);
48
+ } else {
49
+ // Contains non-text children (links, images, etc.) — leave emphasis intact
50
+ return delimiter + collectText(node) + delimiter;
51
+ }
52
+ }
53
+ } catch (err) {
54
+ _iterator.e(err);
55
+ } finally {
56
+ _iterator.f();
57
+ }
58
+ return delimiter + inner + delimiter;
59
+ }
60
+ function collectText(node) {
61
+ if (isTextNode(node)) return node.value;
62
+ if ('children' in node) {
63
+ return node.children.map(collectText).join('');
64
+ }
65
+ return '';
66
+ }
67
+ function processParent(parent, source) {
68
+ var modified = false;
69
+ var i = 0;
70
+ while (i < parent.children.length) {
71
+ var child = parent.children[i];
72
+ if (isEmphasisOrStrong(child) && isIntraword(parent, i, source)) {
73
+ var textValue = flattenToText(child);
74
+ var replacement = {
75
+ type: 'text',
76
+ value: textValue
77
+ };
78
+ parent.children.splice(i, 1, replacement);
79
+ modified = true;
80
+ // Don't advance — the replaced node may need to merge with neighbors
81
+ } else {
82
+ if ('children' in child) {
83
+ processParent(child, source);
84
+ }
85
+ i++;
86
+ }
87
+ if (modified) {
88
+ mergeAdjacentText(parent);
89
+ modified = false;
90
+ // After merging, restart scan since indices shifted
91
+ i = 0;
92
+ }
93
+ }
94
+ }
95
+ function getInnerText(node) {
96
+ if (isTextNode(node)) return node.value;
97
+ if ('children' in node) {
98
+ var children = node.children;
99
+ if (children.length > 0) return getInnerText(children[0]);
100
+ }
101
+ return '';
102
+ }
103
+ function getInnerTextEnd(node) {
104
+ if (isTextNode(node)) return node.value;
105
+ if ('children' in node) {
106
+ var children = node.children;
107
+ if (children.length > 0) return getInnerTextEnd(children[children.length - 1]);
108
+ }
109
+ return '';
110
+ }
111
+
112
+ /**
113
+ * Checks whether the emphasis/strong node at `index` within `parent`
114
+ * is an intraword usage of underscore delimiters.
115
+ *
116
+ * A node is intraword when at least one side has an alphanumeric text
117
+ * neighbor AND the inner content on the corresponding delimiter side
118
+ * also touches word characters — proving the underscores are embedded
119
+ * in a word rather than used as formatting.
120
+ */
121
+ function isIntraword(parent, index, source) {
122
+ var _node$position;
123
+ var node = parent.children[index];
124
+
125
+ // Verify the delimiter is `_` (not `*`) by inspecting the source
126
+ if (((_node$position = node.position) === null || _node$position === void 0 || (_node$position = _node$position.start) === null || _node$position === void 0 ? void 0 : _node$position.offset) != null) {
127
+ var ch = source[node.position.start.offset];
128
+ if (ch !== '_') return false;
129
+ }
130
+ var prev = index > 0 ? parent.children[index - 1] : null;
131
+ var next = index < parent.children.length - 1 ? parent.children[index + 1] : null;
132
+ var prevChar = prev != null && isTextNode(prev) && prev.value.length > 0 ? prev.value[prev.value.length - 1] : null;
133
+ var nextChar = next != null && isTextNode(next) && next.value.length > 0 ? next.value[0] : null;
134
+ var prevIsAlpha = prevChar != null && isAlphanumeric(prevChar);
135
+ var nextIsAlpha = nextChar != null && isAlphanumeric(nextChar);
136
+
137
+ // Both sides flanked by alphanumeric — classic intraword (e.g. `foo__bar__baz`)
138
+ if (prevIsAlpha && nextIsAlpha) return true;
139
+
140
+ // One-sided: prev is alpha or underscore, no alpha next — check inner text
141
+ // starts with alpha (e.g. `Lorem__ipsum__` or `Lorem__ipsum_`)
142
+ if (prevIsAlpha || prevChar === '_') {
143
+ var inner = getInnerText(node);
144
+ if (inner.length > 0 && isAlphanumeric(inner[0])) return true;
145
+ }
146
+
147
+ // One-sided: next is alpha or underscore, no alpha prev — check inner text
148
+ // ends with alpha (e.g. `__Lorem__ipsum` or `_Lorem__ipsum`)
149
+ if (nextIsAlpha || nextChar === '_') {
150
+ var _inner = getInnerTextEnd(node);
151
+ if (_inner.length > 0 && isAlphanumeric(_inner[_inner.length - 1])) return true;
152
+ }
153
+ return false;
154
+ }
155
+ function mergeAdjacentText(parent) {
156
+ var i = 0;
157
+ while (i < parent.children.length - 1) {
158
+ if (isTextNode(parent.children[i]) && isTextNode(parent.children[i + 1])) {
159
+ parent.children[i].value += parent.children[i + 1].value;
160
+ parent.children.splice(i + 1, 1);
161
+ } else {
162
+ i++;
163
+ }
164
+ }
165
+ }
166
+ var attacher = function remarkIntrawordUnderscore() {
167
+ return function (tree, file) {
168
+ var source = String(file);
169
+ processParent(tree, source);
170
+ };
171
+ };
172
+ export default attacher;
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
1
+ var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "hasAnimation"];
2
2
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
@@ -35,6 +35,8 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
35
35
  _ref$headerZindexLoca = _ref.headerZindexLocation,
36
36
  headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
37
37
  maskRef = _ref.maskRef,
38
+ _ref$hasAnimation = _ref.hasAnimation,
39
+ hasAnimation = _ref$hasAnimation === void 0 ? true : _ref$hasAnimation,
38
40
  rest = _objectWithoutProperties(_ref, _excluded);
39
41
  var hasRendered = useRef(false);
40
42
  var _useState = useState(null),
@@ -46,7 +48,7 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
46
48
  hasRendered.current = true;
47
49
  }, []);
48
50
  var styles = useEuiMemoizedStyles(euiOverlayMaskStyles);
49
- var cssStyles = cx([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")], hasRendered.current && styles.noAnimation]);
51
+ var cssStyles = cx([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")], (hasRendered.current || !hasAnimation) && styles.noAnimation]);
50
52
  useEffect(function () {
51
53
  if (!overlayMaskNode) return;
52
54
  keysOf(rest).forEach(function (key) {
@@ -105,5 +107,10 @@ EuiOverlayMask.propTypes = {
105
107
  /**
106
108
  * React ref to be passed to the wrapping container
107
109
  */
108
- maskRef: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired])
110
+ maskRef: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired]),
111
+ /**
112
+ * If enabled, the mask will have a fade in animation.
113
+ * @default true
114
+ */
115
+ hasAnimation: PropTypes.bool
109
116
  };
@@ -26,7 +26,7 @@ export var euiTreeViewItemStyles = function euiTreeViewItemStyles(euiThemeContex
26
26
  euiTreeView__node: _ref,
27
27
  default: /*#__PURE__*/css(logicalCSS('max-height', defaultSize), " line-height:", defaultSize, ";;label:default;"),
28
28
  compressed: /*#__PURE__*/css(logicalCSS('max-height', compressedSize), " line-height:", compressedSize, ";;label:compressed;"),
29
- expanded: /*#__PURE__*/css(logicalCSS('max-height', '100vh'), ";;label:expanded;")
29
+ expanded: /*#__PURE__*/css(logicalCSS('max-height', 'none'), ";;label:expanded;")
30
30
  },
31
31
  button: {
32
32
  euiTreeView__nodeInner: /*#__PURE__*/css(logicalCSS('width', '100%'), " ", logicalCSS('padding-left', euiTheme.size.s), " ", logicalCSS('padding-right', euiTheme.size.xxs), " display:flex;align-items:center;&:focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:hover,&:active,&:focus{background-color:", euiTheme.components.treeViewItemBackgroundHover, ";};label:euiTreeView__nodeInner;"),
@@ -6,12 +6,12 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export * from './useDependentState';
10
- export * from './useCombinedRefs';
11
- export * from './useForceRender';
12
- export * from './useLatest';
13
- export * from './useDeepEqual';
14
- export * from './useMouseMove';
15
- export * from './useIsPointerDown';
16
- export * from './useUpdateEffect';
9
+ export { useDependentState } from './useDependentState';
10
+ export { useCombinedRefs, setMultipleRefs } from './useCombinedRefs';
11
+ export { useForceRender } from './useForceRender';
12
+ export { useLatest } from './useLatest';
13
+ export { useDeepEqual } from './useDeepEqual';
14
+ export { isMouseEvent, useMouseMove } from './useMouseMove';
15
+ export { useIsPointerDown } from './useIsPointerDown';
16
+ export { useUpdateEffect } from './useUpdateEffect';
17
17
  export { useEuiDisabledElement } from './useEuiDisabledElement';
@@ -1,9 +1,3 @@
1
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
- 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."); }
3
- 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; } }
4
- 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; }
5
- 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; } }
6
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
1
  /*
8
2
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
3
  * or more contributor license agreements. Licensed under the Elastic License
@@ -12,30 +6,27 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
12
6
  * Side Public License, v 1.
13
7
  */
14
8
 
15
- import { useState, useEffect } from 'react';
9
+ import { useRef, useEffect } from 'react';
16
10
 
17
11
  /**
18
12
  * A hook that tracks whether the pointer is currently down/pressed.
19
13
  * Useful for detecting text selection in progress.
20
14
  */
21
15
  export function useIsPointerDown(container) {
22
- var _useState = useState(false),
23
- _useState2 = _slicedToArray(_useState, 2),
24
- isPointerDown = _useState2[0],
25
- setIsPointerDown = _useState2[1];
16
+ var isPointerDownRef = useRef(false);
26
17
  useEffect(function () {
27
18
  var handlePointerDown = function handlePointerDown(event) {
28
19
  if (container !== null && container !== void 0 && container.current && !container.current.contains(event.target)) {
29
20
  return;
30
21
  }
31
- setIsPointerDown(true);
22
+ isPointerDownRef.current = true;
32
23
  };
33
24
  var handlePointerUpOrCancel = function handlePointerUpOrCancel() {
34
- setIsPointerDown(false);
25
+ isPointerDownRef.current = false;
35
26
  };
36
27
  var handleVisibilityChange = function handleVisibilityChange() {
37
28
  if (document.visibilityState === 'hidden') {
38
- setIsPointerDown(false);
29
+ isPointerDownRef.current = false;
39
30
  }
40
31
  };
41
32
  var controller = new AbortController();
@@ -53,5 +44,5 @@ export function useIsPointerDown(container) {
53
44
  controller.abort();
54
45
  };
55
46
  }, [container]);
56
- return isPointerDown;
47
+ return isPointerDownRef;
57
48
  }
@@ -22,7 +22,7 @@ export * from './emotion';
22
22
  export * from './findElement';
23
23
  export { focusTrapPubSub } from './focus_trap';
24
24
  export { dateFormatAliases, formatAuto, formatBoolean, formatDate, formatNumber, formatText } from './format';
25
- export * from './hooks';
25
+ export { useDependentState, useCombinedRefs, setMultipleRefs, useForceRender, useLatest, useDeepEqual, isMouseEvent, useMouseMove, useUpdateEffect, useEuiDisabledElement } from './hooks';
26
26
  export { isEvenlyDivisibleBy, isWithinRange } from './number';
27
27
  export { Pager } from './paging';
28
28
  export { calculatePopoverPosition, findPopoverPosition } from './popover';