@elastic/eui 113.3.0 → 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 (107) hide show
  1. package/es/components/button/split_button/split_button.js +13 -0
  2. package/es/components/button/split_button/split_button_actions.js +15 -0
  3. package/es/components/collapsible_nav/collapsible_nav.js +5 -0
  4. package/es/components/color_picker/color_picker.js +31 -8
  5. package/es/components/datagrid/utils/scrolling.js +39 -10
  6. package/es/components/flyout/_flyout_overlay.js +34 -4
  7. package/es/components/flyout/flyout.component.js +13 -9
  8. package/es/components/flyout/flyout.js +9 -1
  9. package/es/components/flyout/flyout.styles.js +2 -2
  10. package/es/components/flyout/flyout_menu.js +2 -1
  11. package/es/components/flyout/flyout_resizable.js +5 -0
  12. package/es/components/flyout/manager/actions.js +5 -2
  13. package/es/components/flyout/manager/flyout_child.js +1 -0
  14. package/es/components/flyout/manager/flyout_managed.js +5 -3
  15. package/es/components/flyout/manager/reducer.js +116 -57
  16. package/es/components/flyout/manager/store.js +13 -6
  17. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  18. package/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  19. package/es/components/overlay_mask/overlay_mask.js +10 -3
  20. package/es/components/tree_view/tree_view_item.styles.js +1 -1
  21. package/es/services/hooks/index.js +8 -8
  22. package/es/services/hooks/useIsPointerDown.js +6 -15
  23. package/es/services/index.js +1 -1
  24. package/eui.d.ts +83 -51
  25. package/i18ntokens.json +661 -643
  26. package/lib/components/button/split_button/split_button.js +13 -0
  27. package/lib/components/button/split_button/split_button_actions.js +15 -0
  28. package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
  29. package/lib/components/color_picker/color_picker.js +30 -7
  30. package/lib/components/datagrid/utils/scrolling.js +37 -8
  31. package/lib/components/flyout/_flyout_overlay.js +33 -3
  32. package/lib/components/flyout/flyout.component.js +13 -9
  33. package/lib/components/flyout/flyout.js +9 -1
  34. package/lib/components/flyout/flyout.styles.js +2 -2
  35. package/lib/components/flyout/flyout_menu.js +2 -1
  36. package/lib/components/flyout/flyout_resizable.js +5 -0
  37. package/lib/components/flyout/manager/actions.js +5 -2
  38. package/lib/components/flyout/manager/flyout_child.js +1 -0
  39. package/lib/components/flyout/manager/flyout_managed.js +5 -3
  40. package/lib/components/flyout/manager/reducer.js +116 -57
  41. package/lib/components/flyout/manager/store.js +13 -6
  42. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  43. package/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  44. package/lib/components/overlay_mask/overlay_mask.js +10 -3
  45. package/lib/components/tree_view/tree_view_item.styles.js +1 -1
  46. package/lib/services/hooks/index.js +60 -91
  47. package/lib/services/hooks/useIsPointerDown.js +7 -14
  48. package/lib/services/index.js +70 -11
  49. package/optimize/es/components/color_picker/color_picker.js +31 -8
  50. package/optimize/es/components/datagrid/utils/scrolling.js +39 -10
  51. package/optimize/es/components/flyout/_flyout_overlay.js +34 -4
  52. package/optimize/es/components/flyout/flyout.component.js +13 -9
  53. package/optimize/es/components/flyout/flyout.js +4 -1
  54. package/optimize/es/components/flyout/flyout.styles.js +2 -2
  55. package/optimize/es/components/flyout/flyout_menu.js +2 -1
  56. package/optimize/es/components/flyout/manager/actions.js +5 -2
  57. package/optimize/es/components/flyout/manager/flyout_managed.js +4 -3
  58. package/optimize/es/components/flyout/manager/reducer.js +116 -57
  59. package/optimize/es/components/flyout/manager/store.js +13 -6
  60. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  61. package/optimize/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  62. package/optimize/es/components/overlay_mask/overlay_mask.js +4 -2
  63. package/optimize/es/components/tree_view/tree_view_item.styles.js +1 -1
  64. package/optimize/es/services/hooks/index.js +8 -8
  65. package/optimize/es/services/hooks/useIsPointerDown.js +6 -10
  66. package/optimize/es/services/index.js +1 -1
  67. package/optimize/lib/components/color_picker/color_picker.js +30 -7
  68. package/optimize/lib/components/datagrid/utils/scrolling.js +37 -8
  69. package/optimize/lib/components/flyout/_flyout_overlay.js +33 -3
  70. package/optimize/lib/components/flyout/flyout.component.js +13 -9
  71. package/optimize/lib/components/flyout/flyout.js +4 -1
  72. package/optimize/lib/components/flyout/flyout.styles.js +2 -2
  73. package/optimize/lib/components/flyout/flyout_menu.js +2 -1
  74. package/optimize/lib/components/flyout/manager/actions.js +5 -2
  75. package/optimize/lib/components/flyout/manager/flyout_managed.js +4 -3
  76. package/optimize/lib/components/flyout/manager/reducer.js +116 -57
  77. package/optimize/lib/components/flyout/manager/store.js +13 -6
  78. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  79. package/optimize/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  80. package/optimize/lib/components/overlay_mask/overlay_mask.js +4 -2
  81. package/optimize/lib/components/tree_view/tree_view_item.styles.js +1 -1
  82. package/optimize/lib/services/hooks/index.js +60 -91
  83. package/optimize/lib/services/hooks/useIsPointerDown.js +5 -10
  84. package/optimize/lib/services/index.js +70 -11
  85. package/package.json +4 -4
  86. package/test-env/components/button/split_button/split_button.js +13 -0
  87. package/test-env/components/button/split_button/split_button_actions.js +15 -0
  88. package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
  89. package/test-env/components/color_picker/color_picker.js +30 -7
  90. package/test-env/components/datagrid/utils/scrolling.js +37 -8
  91. package/test-env/components/flyout/_flyout_overlay.js +33 -3
  92. package/test-env/components/flyout/flyout.component.js +13 -9
  93. package/test-env/components/flyout/flyout.styles.js +2 -2
  94. package/test-env/components/flyout/flyout_menu.js +2 -1
  95. package/test-env/components/flyout/flyout_resizable.js +5 -0
  96. package/test-env/components/flyout/manager/actions.js +5 -2
  97. package/test-env/components/flyout/manager/flyout_child.js +1 -0
  98. package/test-env/components/flyout/manager/flyout_managed.js +5 -3
  99. package/test-env/components/flyout/manager/reducer.js +116 -57
  100. package/test-env/components/flyout/manager/store.js +13 -6
  101. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  102. package/test-env/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  103. package/test-env/components/overlay_mask/overlay_mask.js +10 -3
  104. package/test-env/components/tree_view/tree_view_item.styles.js +1 -1
  105. package/test-env/services/hooks/index.js +60 -91
  106. package/test-env/services/hooks/useIsPointerDown.js +5 -10
  107. package/test-env/services/index.js +70 -11
@@ -97,6 +97,19 @@ _EuiSplitButton.propTypes = {
97
97
  "aria-label": PropTypes.string,
98
98
  "data-test-subj": PropTypes.string,
99
99
  css: PropTypes.any,
100
+ /**
101
+ * Controls the disabled behavior via the native `disabled` attribute.
102
+ */
103
+ isDisabled: PropTypes.bool,
104
+ /**
105
+ * NOTE: Beta feature, may be changed or removed in the future
106
+ *
107
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
108
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
109
+ *
110
+ * Use e.g. when a disabled button should have a tooltip.
111
+ */
112
+ hasAriaDisabled: PropTypes.bool,
100
113
  size: PropTypes.any,
101
114
  color: PropTypes.any,
102
115
  fill: PropTypes.bool,
@@ -61,6 +61,19 @@ export var EuiSplitButtonActionPrimary = function EuiSplitButtonActionPrimary(_r
61
61
  return tooltipProps ? ___EmotionJSX(EuiToolTip, tooltipProps, button) : button;
62
62
  };
63
63
  EuiSplitButtonActionPrimary.propTypes = {
64
+ /**
65
+ * Controls the disabled behavior via the native `disabled` attribute.
66
+ */
67
+ isDisabled: PropTypes.bool,
68
+ /**
69
+ * NOTE: Beta feature, may be changed or removed in the future
70
+ *
71
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
72
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
73
+ *
74
+ * Use e.g. when a disabled button should have a tooltip.
75
+ */
76
+ hasAriaDisabled: PropTypes.bool,
64
77
  /**
65
78
  * Enables rendering an `EuiToolTip` with the passed props.
66
79
  */
@@ -103,6 +116,8 @@ export var EuiSplitButtonActionSecondary = function EuiSplitButtonActionSecondar
103
116
  })) : action;
104
117
  };
105
118
  EuiSplitButtonActionSecondary.propTypes = {
119
+ isDisabled: PropTypes.bool,
120
+ hasAriaDisabled: PropTypes.bool,
106
121
  /**
107
122
  * Enables rendering an `EuiToolTip` with the passed props.
108
123
  */
@@ -130,6 +130,11 @@ EuiCollapsibleNav.propTypes = {
130
130
  * @default undefined (auto-inherit when nested, otherwise 'never')
131
131
  */
132
132
  session: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired, PropTypes.any.isRequired]),
133
+ /**
134
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
135
+ * @default undefined (each session gets a unique key and does not share history)
136
+ */
137
+ historyKey: PropTypes.any,
133
138
  /**
134
139
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
135
140
  */
@@ -21,7 +21,7 @@ import PropTypes from "prop-types";
21
21
  import React, { cloneElement, useEffect, useMemo, useRef, useState } from 'react';
22
22
  import classNames from 'classnames';
23
23
  import chroma from 'chroma-js';
24
- import { useEuiMemoizedStyles, keys, useEuiPaletteColorBlind } from '../../services';
24
+ import { useEuiMemoizedStyles, keys, useEuiPaletteColorBlind, useGeneratedHtmlId } from '../../services';
25
25
  import { EuiFieldText, EuiFormControlLayout, EuiFormRow, EuiRange } from '../form';
26
26
  import { useEuiI18n } from '../i18n';
27
27
  import { EuiPopover } from '../popover';
@@ -94,9 +94,12 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
94
94
  _ref$isClearable = _ref.isClearable,
95
95
  isClearable = _ref$isClearable === void 0 ? false : _ref$isClearable,
96
96
  placeholder = _ref.placeholder,
97
- dataTestSubj = _ref['data-test-subj'];
98
- var _useEuiI18n = useEuiI18n(['euiColorPicker.popoverLabel', 'euiColorPicker.colorLabel', 'euiColorPicker.selectedColorLabel', 'euiColorPicker.colorErrorMessage', 'euiColorPicker.transparent', 'euiColorPicker.alphaLabel', 'euiColorPicker.openLabel', 'euiColorPicker.closeLabel'], ['Color selection dialog', 'Color value', 'Selected color', 'Invalid color value', 'Transparent', 'Alpha channel (opacity) value', 'Press the escape key to close the popover', 'Press the down key to open a popover containing color options']),
99
- _useEuiI18n2 = _slicedToArray(_useEuiI18n, 8),
97
+ dataTestSubj = _ref['data-test-subj'],
98
+ _ariaLabel = _ref['aria-label'],
99
+ ariaLabelledby = _ref['aria-labelledby'],
100
+ ariaDescribedby = _ref['aria-describedby'];
101
+ var _useEuiI18n = useEuiI18n(['euiColorPicker.popoverLabel', 'euiColorPicker.colorLabel', 'euiColorPicker.selectedColorLabel', 'euiColorPicker.colorErrorMessage', 'euiColorPicker.transparent', 'euiColorPicker.alphaLabel', 'euiColorPicker.openLabel', 'euiColorPicker.closeLabel', 'euiColorPicker.ariaLabel'], ['Color selection dialog', 'Color value', 'Selected color', 'Invalid color value', 'Transparent', 'Alpha channel (opacity) value', 'Press the escape key to close the popover', 'Press the down key to open a popover containing color options', 'Select a color']),
102
+ _useEuiI18n2 = _slicedToArray(_useEuiI18n, 9),
100
103
  popoverLabel = _useEuiI18n2[0],
101
104
  colorLabel = _useEuiI18n2[1],
102
105
  selectedColorLabel = _useEuiI18n2[2],
@@ -104,7 +107,16 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
104
107
  transparent = _useEuiI18n2[4],
105
108
  alphaLabel = _useEuiI18n2[5],
106
109
  openLabel = _useEuiI18n2[6],
107
- closeLabel = _useEuiI18n2[7];
110
+ closeLabel = _useEuiI18n2[7],
111
+ ariaLabel = _useEuiI18n2[8];
112
+ var openLabelId = useGeneratedHtmlId({
113
+ prefix: 'colorPicker',
114
+ suffix: 'openLabel'
115
+ });
116
+ var closeLabelId = useGeneratedHtmlId({
117
+ prefix: 'colorPicker',
118
+ suffix: 'closeLabel'
119
+ });
108
120
  var defaultSwatches = useEuiPaletteColorBlind();
109
121
  var swatches = _swatches !== null && _swatches !== void 0 ? _swatches : defaultSwatches;
110
122
  var preferredFormat = useMemo(function () {
@@ -433,10 +445,21 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
433
445
  readOnly: readOnly,
434
446
  fullWidth: fullWidth,
435
447
  autoComplete: "off",
436
- "data-test-subj": testSubjAnchor,
437
- "aria-label": isColorSelectorShown ? openLabel : closeLabel,
448
+ "data-test-subj": testSubjAnchor
449
+ // if an id is provided it might be used in combination with `htmlFor` on a label,
450
+ // so we don't want to override it with a fallback `aria-label`
451
+ ,
452
+ "aria-label": _ariaLabel ? _ariaLabel : id || ariaLabelledby ? undefined : ariaLabel,
453
+ "aria-labelledby": ariaLabelledby,
454
+ "aria-describedby": classNames(isColorSelectorShown ? openLabelId : closeLabelId, ariaDescribedby),
438
455
  controlOnly: true // Don't need two EuiFormControlwrappers
439
- }));
456
+ }), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX("span", {
457
+ id: openLabelId,
458
+ "aria-hidden": !isColorSelectorShown
459
+ }, openLabel), ___EmotionJSX("span", {
460
+ id: closeLabelId,
461
+ "aria-hidden": isColorSelectorShown
462
+ }, closeLabel))));
440
463
  }
441
464
  return display === 'inline' ? ___EmotionJSX("div", {
442
465
  css: styles.euiColorPicker,
@@ -10,8 +10,9 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
10
10
  * Side Public License, v 1.
11
11
  */
12
12
 
13
- import React, { useContext, useEffect, useCallback, useMemo } from 'react';
14
- import { useEuiMemoizedStyles, useIsPointerDown } from '../../../services';
13
+ import React, { useContext, useEffect, useCallback, useMemo, useRef } from 'react';
14
+ import { useEuiMemoizedStyles } from '../../../services';
15
+ import { useIsPointerDown } from '../../../services/hooks';
15
16
  import { logicalStyles } from '../../../global_styling';
16
17
  import { DataGridCellPopoverContext } from '../body/cell';
17
18
  import { DataGridFocusContext } from './focus';
@@ -29,20 +30,48 @@ export var useScroll = function useScroll(args) {
29
30
  scrollCellIntoView = _useScrollCellIntoVie.scrollCellIntoView;
30
31
  var _useContext = useContext(DataGridFocusContext),
31
32
  focusedCell = _useContext.focusedCell;
32
- var isPointerDown = useIsPointerDown(args.outerGridRef);
33
+ var isPointerDownRef = useIsPointerDown(args.outerGridRef);
34
+
35
+ /**
36
+ * Set when `focusedCell` changes while the pointer is held down (e.g. clicking a cell).
37
+ * Allows the `pointerup` listener below to scroll on release without
38
+ * causing snap-back when the user scrolls the grid without changing focus.
39
+ */
40
+ var pendingScrollRef = useRef(false);
41
+ useEffect(function () {
42
+ if (!focusedCell) return;
43
+ if (isPointerDownRef.current) {
44
+ // Pointer is down - defer scroll decision to the pointerup listener
45
+ pendingScrollRef.current = true;
46
+ return;
47
+ }
48
+ scrollCellIntoView({
49
+ rowIndex: focusedCell[1],
50
+ colIndex: focusedCell[0]
51
+ });
52
+ }, [focusedCell, scrollCellIntoView, isPointerDownRef]);
33
53
  useEffect(function () {
34
- if (focusedCell) {
54
+ var handlePointerUp = function handlePointerUp() {
35
55
  var _window;
36
- // do not scroll if text is being selected
37
- if (isPointerDown || ((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') {
38
- return;
39
- }
56
+ if (!pendingScrollRef.current || !focusedCell) return;
57
+ pendingScrollRef.current = false;
58
+
59
+ // Skip if the interaction resulted in text being selected
60
+ if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
40
61
  scrollCellIntoView({
41
62
  rowIndex: focusedCell[1],
42
63
  colIndex: focusedCell[0]
43
64
  });
44
- }
45
- }, [focusedCell, isPointerDown, scrollCellIntoView]);
65
+ };
66
+ document.addEventListener('pointerup', handlePointerUp, {
67
+ capture: true
68
+ });
69
+ return function () {
70
+ return document.removeEventListener('pointerup', handlePointerUp, {
71
+ capture: true
72
+ });
73
+ };
74
+ }, [focusedCell, scrollCellIntoView]);
46
75
  var _useContext2 = useContext(DataGridCellPopoverContext),
47
76
  popoverIsOpen = _useContext2.popoverIsOpen,
48
77
  cellLocation = _useContext2.cellLocation;
@@ -7,8 +7,9 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
7
7
  * Side Public License, v 1.
8
8
  */
9
9
 
10
- import React, { useMemo } from 'react';
10
+ import React, { useEffect, useMemo, useRef } from 'react';
11
11
  import { css, cx } from '@emotion/css';
12
+ import { useCombinedRefs } from '../../services';
12
13
  import { EuiOverlayMask } from '../overlay_mask';
13
14
  import { EuiPortal } from '../portal';
14
15
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -16,8 +17,7 @@ var getEuiFlyoutOverlayStyles = function getEuiFlyoutOverlayStyles(zIndex) {
16
17
  /*
17
18
  This needs to have !important to override the default EuiOverlayMask
18
19
  z-index based on the headerZindexLocation prop. Using the style attribute
19
- doesn't work since EuiOverlayMask requires a string style prop that
20
- causes React errors in the test environment.
20
+ doesn't work since EuiOverlayMask requires the styles to be provided via className
21
21
  */
22
22
  return /*#__PURE__*/css("z-index:", zIndex, "!important;;label:getEuiFlyoutOverlayStyles;");
23
23
  };
@@ -38,10 +38,39 @@ export var EuiFlyoutOverlay = function EuiFlyoutOverlay(_ref) {
38
38
  hasOverlayMask = _ref.hasOverlayMask,
39
39
  maskZIndex = _ref.maskZIndex,
40
40
  _ref$headerZindexLoca = _ref.headerZindexLocation,
41
- headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'below' : _ref$headerZindexLoca;
41
+ headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'below' : _ref$headerZindexLoca,
42
+ containerRect = _ref.containerRect;
42
43
  var styles = useMemo(function () {
43
44
  return getEuiFlyoutOverlayStyles(maskZIndex);
44
45
  }, [maskZIndex]);
46
+
47
+ // Internal ref so we can apply containerRect positioning directly on the DOM
48
+ // node, avoiding new Emotion CSS class generation on every scroll/resize.
49
+ var internalMaskRef = useRef(null);
50
+ var combinedMaskRef = useCombinedRefs([internalMaskRef, maskProps === null || maskProps === void 0 ? void 0 : maskProps.maskRef]);
51
+ useEffect(function () {
52
+ var node = internalMaskRef.current;
53
+ if (!node) return;
54
+
55
+ // containerRect positioning must be applied via node.style.setProperty rather than
56
+ // through the style prop - EuiOverlayMask requires styles to be passed via className
57
+ if (containerRect) {
58
+ node.style.setProperty('inset-block-start', "".concat(containerRect.top, "px"));
59
+ node.style.setProperty('inset-inline-start', "".concat(containerRect.left, "px"));
60
+ node.style.setProperty('inline-size', "".concat(containerRect.width, "px"));
61
+ node.style.setProperty('block-size', "".concat(containerRect.height, "px"));
62
+ node.style.setProperty('inset-inline-end', 'auto');
63
+ node.style.setProperty('inset-block-end', 'auto');
64
+ } else {
65
+ node.style.removeProperty('inset-block-start');
66
+ node.style.removeProperty('inset-inline-start');
67
+ node.style.removeProperty('inline-size');
68
+ node.style.removeProperty('block-size');
69
+ node.style.removeProperty('inset-inline-end');
70
+ node.style.removeProperty('inset-block-end');
71
+ }
72
+ }, [containerRect, hasOverlayMask]); // toggling ownFocus while the flyout is already open should cause re-render
73
+
45
74
  var content = children;
46
75
  if (!isPushed || hasOverlayMask) {
47
76
  content = ___EmotionJSX(EuiPortal, null, content);
@@ -50,6 +79,7 @@ export var EuiFlyoutOverlay = function EuiFlyoutOverlay(_ref) {
50
79
  return ___EmotionJSX(React.Fragment, null, hasOverlayMask && ___EmotionJSX(EuiOverlayMask, _extends({
51
80
  headerZindexLocation: (_maskProps$headerZind = maskProps === null || maskProps === void 0 ? void 0 : maskProps.headerZindexLocation) !== null && _maskProps$headerZind !== void 0 ? _maskProps$headerZind : headerZindexLocation
52
81
  }, maskProps, {
82
+ maskRef: combinedMaskRef,
53
83
  className: classes
54
84
  })), content);
55
85
  };
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "flyoutMenuDisplayMode", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"];
2
+ var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "flyoutMenuDisplayMode", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "hasAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"];
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(); }
5
5
  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."); }
@@ -100,23 +100,25 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
100
100
  outsideClickCloses = _usePropsWithComponen.outsideClickCloses,
101
101
  _usePropsWithComponen12 = _usePropsWithComponen.pushMinBreakpoint,
102
102
  pushMinBreakpoint = _usePropsWithComponen12 === void 0 ? DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen12,
103
- _usePropsWithComponen13 = _usePropsWithComponen.pushAnimation,
104
- pushAnimation = _usePropsWithComponen13 === void 0 ? false : _usePropsWithComponen13,
103
+ _pushAnimation = _usePropsWithComponen.pushAnimation,
104
+ _hasAnimation = _usePropsWithComponen.hasAnimation,
105
105
  _focusTrapProps = _usePropsWithComponen.focusTrapProps,
106
- _usePropsWithComponen14 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
107
- includeFixedHeadersInFocusTrap = _usePropsWithComponen14 === void 0 ? true : _usePropsWithComponen14,
106
+ _usePropsWithComponen13 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
107
+ includeFixedHeadersInFocusTrap = _usePropsWithComponen13 === void 0 ? true : _usePropsWithComponen13,
108
108
  includeSelectorInFocusTrap = _usePropsWithComponen.includeSelectorInFocusTrap,
109
109
  _ariaDescribedBy = _usePropsWithComponen['aria-describedby'],
110
110
  _ariaLabelledBy = _usePropsWithComponen['aria-labelledby'],
111
111
  id = _usePropsWithComponen.id,
112
- _usePropsWithComponen15 = _usePropsWithComponen.resizable,
113
- resizable = _usePropsWithComponen15 === void 0 ? false : _usePropsWithComponen15,
112
+ _usePropsWithComponen14 = _usePropsWithComponen.resizable,
113
+ resizable = _usePropsWithComponen14 === void 0 ? false : _usePropsWithComponen14,
114
114
  minWidth = _usePropsWithComponen.minWidth,
115
115
  onResize = _usePropsWithComponen.onResize,
116
116
  onAnimationEnd = _usePropsWithComponen.onAnimationEnd,
117
117
  containerProp = _usePropsWithComponen.container,
118
118
  rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
119
119
  var container = resolveContainer(containerProp);
120
+ var hasAnimationDefault = type === 'overlay';
121
+ var hasAnimation = _hasAnimation !== null && _hasAnimation !== void 0 ? _hasAnimation : hasAnimationDefault;
120
122
  var _useEuiThemeCSSVariab = useEuiThemeCSSVariables(),
121
123
  setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
122
124
  var Element = as || defaultElement;
@@ -537,7 +539,7 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
537
539
  return _objectSpread(_objectSpread(_objectSpread({}, style), composedStyles), containerPositionStyles);
538
540
  }, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex, containerRect, side, isChildFlyout]);
539
541
  var styles = useEuiMemoizedStyles(euiFlyoutStyles);
540
- var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
542
+ var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], !hasAnimation && styles.noAnimation, styles[side]];
541
543
  var classes = classnames('euiFlyout', isChildFlyout && hasChildBackground && 'euiFlyout--hasChildBackground', className);
542
544
  var flyoutToggle = useRef(document.activeElement);
543
545
  var _useState5 = useState([]),
@@ -673,8 +675,10 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
673
675
  isPushed: isPushed,
674
676
  maskZIndex: maskZIndex,
675
677
  headerZindexLocation: effectiveHeaderZindexLocation,
678
+ containerRect: containerRect,
676
679
  maskProps: _objectSpread(_objectSpread({}, maskProps), {}, {
677
- maskRef: maskCombinedRefs
680
+ maskRef: maskCombinedRefs,
681
+ hasAnimation: hasAnimation
678
682
  })
679
683
  }, ___EmotionJSX(EuiWindowEvent, {
680
684
  event: "keydown",
@@ -1,4 +1,4 @@
1
- var _excluded = ["as", "onClose", "onActive", "session"];
1
+ var _excluded = ["as", "onClose", "onActive", "session", "historyKey"];
2
2
  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); }
3
3
  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; }
4
4
  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; }
@@ -26,6 +26,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
26
26
  onClose = _usePropsWithComponen.onClose,
27
27
  onActive = _usePropsWithComponen.onActive,
28
28
  session = _usePropsWithComponen.session,
29
+ historyKey = _usePropsWithComponen.historyKey,
29
30
  rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
30
31
  var hasActiveSession = useHasActiveSession();
31
32
  var isInsideParentFlyout = useIsInsideParentFlyout();
@@ -52,6 +53,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
52
53
  return null;
53
54
  }
54
55
  return ___EmotionJSX(EuiFlyoutMain, _extends({}, rest, {
56
+ historyKey: historyKey,
55
57
  onClose: onClose,
56
58
  onActive: onActive,
57
59
  as: "div",
@@ -62,6 +64,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
62
64
  // session=inherit: auto-join existing session as child
63
65
  if (hasActiveSession && effectiveSession === SESSION_INHERIT) {
64
66
  return ___EmotionJSX(EuiFlyoutChild, _extends({}, rest, {
67
+ historyKey: historyKey,
65
68
  onClose: onClose,
66
69
  onActive: onActive,
67
70
  as: "div",
@@ -95,6 +98,11 @@ EuiFlyout.propTypes = {
95
98
  * @default undefined (auto-inherit when nested, otherwise 'never')
96
99
  */
97
100
  session: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired, PropTypes.any.isRequired]),
101
+ /**
102
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
103
+ * @default undefined (each session gets a unique key and does not share history)
104
+ */
105
+ historyKey: PropTypes.any,
98
106
  /**
99
107
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
100
108
  */
@@ -72,9 +72,9 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
72
72
  push: {
73
73
  push: /*#__PURE__*/css("clip-path:none;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
74
74
  right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thick), ";;label:right;"),
75
- left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;"),
76
- noAnimation: _ref
75
+ left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;")
77
76
  },
77
+ noAnimation: _ref,
78
78
  // Padding
79
79
  paddingSizes: {
80
80
  none: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions"];
1
+ var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType"];
2
2
  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; }
3
3
  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; }
4
4
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
@@ -114,6 +114,7 @@ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
114
114
  showBackButton = _ref2.showBackButton,
115
115
  backButtonProps = _ref2.backButtonProps,
116
116
  customActions = _ref2.customActions,
117
+ _iconType = _ref2.iconType,
117
118
  rest = _objectWithoutProperties(_ref2, _excluded);
118
119
  var _useContext = useContext(EuiFlyoutMenuContext),
119
120
  onClose = _useContext.onClose;
@@ -36,6 +36,11 @@ EuiFlyoutResizable.propTypes = {
36
36
  * @default undefined (auto-inherit when nested, otherwise 'never')
37
37
  */
38
38
  session: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired, PropTypes.any.isRequired]),
39
+ /**
40
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
41
+ * @default undefined (each session gets a unique key and does not share history)
42
+ */
43
+ historyKey: PropTypes.any,
39
44
  /**
40
45
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
41
46
  */
@@ -69,19 +69,22 @@ export var ACTION_CLOSE_UNMANAGED_FLYOUT = "".concat(PREFIX, "/closeUnmanagedFly
69
69
  * - `title` is used for the flyout menu.
70
70
  * - `level` determines whether the flyout is `main` or `child`.
71
71
  * - Optional `size` is the named EUI size (e.g. `s`, `m`, `l`).
72
+ * - Optional `historyKey` (Symbol) scopes history; only flyouts with the same reference share Back/history. Omit for a unique group per session.
72
73
  * - Optional `iconType` is shown next to the session title in the history menu.
73
74
  */
74
75
  export var addFlyout = function addFlyout(flyoutId, title) {
75
76
  var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : LEVEL_MAIN;
76
77
  var size = arguments.length > 3 ? arguments[3] : undefined;
77
- var iconType = arguments.length > 4 ? arguments[4] : undefined;
78
- var minWidth = arguments.length > 5 ? arguments[5] : undefined;
78
+ var historyKey = arguments.length > 4 ? arguments[4] : undefined;
79
+ var iconType = arguments.length > 5 ? arguments[5] : undefined;
80
+ var minWidth = arguments.length > 6 ? arguments[6] : undefined;
79
81
  return {
80
82
  type: ACTION_ADD,
81
83
  flyoutId: flyoutId,
82
84
  title: title,
83
85
  level: level,
84
86
  size: size,
87
+ historyKey: historyKey,
85
88
  iconType: iconType,
86
89
  minWidth: minWidth
87
90
  };
@@ -89,6 +89,7 @@ export var EuiFlyoutChild = /*#__PURE__*/forwardRef(function (_ref, ref) {
89
89
  }));
90
90
  });
91
91
  EuiFlyoutChild.propTypes = {
92
+ historyKey: PropTypes.any,
92
93
  flyoutMenuProps: PropTypes.shape({
93
94
  className: PropTypes.string,
94
95
  "aria-label": PropTypes.string,
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "css", "flyoutMenuProps"];
2
+ var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "historyKey", "css", "flyoutMenuProps"];
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 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; }
5
5
  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; }
@@ -68,6 +68,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
68
68
  level = _ref.level,
69
69
  sizeProp = _ref.size,
70
70
  minWidth = _ref.minWidth,
71
+ historyKey = _ref.historyKey,
71
72
  customCss = _ref.css,
72
73
  _flyoutMenuProps = _ref.flyoutMenuProps,
73
74
  props = _objectWithoutProperties(_ref, _excluded);
@@ -166,7 +167,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
166
167
  // Register with flyout manager context when open, remove when closed
167
168
  // Using useLayoutEffect to run synchronously before DOM updates
168
169
  useLayoutEffect(function () {
169
- addFlyout(flyoutId, title, level, size, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
170
+ addFlyout(flyoutId, title, level, size, level === LEVEL_MAIN ? historyKey : undefined, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
170
171
  return function () {
171
172
  var currentStoreState = getFlyoutManagerStore().getState();
172
173
  var stillInStore = currentStoreState.flyouts.some(function (f) {
@@ -182,7 +183,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
182
183
  }
183
184
  wasRegisteredRef.current = false;
184
185
  };
185
- }, [flyoutId, title, level, size, minWidth, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, addFlyout, closeFlyout, closeAllFlyouts]);
186
+ }, [flyoutId, title, level, size, minWidth, historyKey, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, addFlyout, closeFlyout, closeAllFlyouts]);
186
187
 
187
188
  // Detect when flyout has been removed from manager state (e.g., via Back button)
188
189
  // and trigger onClose callback to notify the parent component
@@ -284,6 +285,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
284
285
  });
285
286
  EuiManagedFlyout.propTypes = {
286
287
  level: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired]).isRequired,
288
+ historyKey: PropTypes.any,
287
289
  flyoutMenuProps: PropTypes.shape({
288
290
  className: PropTypes.string,
289
291
  "aria-label": PropTypes.string,