@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
@@ -39,6 +39,28 @@ var initialState = exports.initialState = {
39
39
  currentZIndex: 0,
40
40
  unmanagedFlyouts: []
41
41
  };
42
+ var addSessionFlyoutsToRemove = function addSessionFlyoutsToRemove(session, flyoutsToRemove) {
43
+ var _session$childHistory;
44
+ flyoutsToRemove.add(session.mainFlyoutId);
45
+ if (session.childFlyoutId) {
46
+ flyoutsToRemove.add(session.childFlyoutId);
47
+ }
48
+ ((_session$childHistory = session.childHistory) !== null && _session$childHistory !== void 0 ? _session$childHistory : []).forEach(function (e) {
49
+ return flyoutsToRemove.add(e.flyoutId);
50
+ });
51
+ };
52
+ var moveHistoryGroupToTop = function moveHistoryGroupToTop(sessions, historyKey) {
53
+ var groupSessions = [];
54
+ var otherSessions = [];
55
+ sessions.forEach(function (session) {
56
+ if (session.historyKey === historyKey) {
57
+ groupSessions.push(session);
58
+ } else {
59
+ otherSessions.push(session);
60
+ }
61
+ });
62
+ return [].concat(otherSessions, groupSessions);
63
+ };
42
64
 
43
65
  /**
44
66
  * Reducer handling all flyout manager actions and state transitions.
@@ -87,6 +109,7 @@ function flyoutManagerReducer() {
87
109
  title = action.title,
88
110
  level = action.level,
89
111
  size = action.size,
112
+ historyKey = action.historyKey,
90
113
  iconType = action.iconType,
91
114
  minWidth = action.minWidth;
92
115
  var isDuplicate = state.flyouts.some(function (f) {
@@ -113,7 +136,8 @@ function flyoutManagerReducer() {
113
136
  iconType: iconType,
114
137
  childFlyoutId: null,
115
138
  childHistory: [],
116
- zIndex: state.currentZIndex
139
+ zIndex: state.currentZIndex,
140
+ historyKey: historyKey !== null && historyKey !== void 0 ? historyKey : Symbol()
117
141
  };
118
142
  return _objectSpread(_objectSpread({}, state), {}, {
119
143
  sessions: [].concat(_toConsumableArray(state.sessions), [newSession]),
@@ -240,8 +264,8 @@ function flyoutManagerReducer() {
240
264
  });
241
265
  }
242
266
  var owningSessionIndex = state.sessions.findIndex(function (session) {
243
- var _session$childHistory;
244
- return session.childFlyoutId === action.flyoutId || ((_session$childHistory = session.childHistory) !== null && _session$childHistory !== void 0 ? _session$childHistory : []).some(function (entry) {
267
+ var _session$childHistory2;
268
+ return session.childFlyoutId === action.flyoutId || ((_session$childHistory2 = session.childHistory) !== null && _session$childHistory2 !== void 0 ? _session$childHistory2 : []).some(function (entry) {
245
269
  return entry.flyoutId === action.flyoutId;
246
270
  });
247
271
  });
@@ -273,21 +297,37 @@ function flyoutManagerReducer() {
273
297
  });
274
298
  }
275
299
 
276
- // Unregister all flyouts.
300
+ // Unregister all flyouts (within the current history group only).
277
301
  case _actions.ACTION_CLOSE_ALL:
278
302
  {
279
303
  if (state.sessions.length === 0) {
280
304
  return state;
281
305
  }
306
+ var _currentSessionIndex = state.sessions.length - 1;
307
+ var _currentSession = state.sessions[_currentSessionIndex];
308
+ var currentKey = _currentSession.historyKey;
282
309
 
283
- // Reset current z-index to 0 only if no unmanaged flyouts remain.
310
+ // Remove all sessions that have the current historyKey (entire group)
311
+ var _newSessions = state.sessions.filter(function (s) {
312
+ return s.historyKey !== currentKey;
313
+ });
314
+ var _flyoutsToRemove = new Set();
315
+ state.sessions.forEach(function (session) {
316
+ if (session.historyKey === currentKey) {
317
+ addSessionFlyoutsToRemove(session, _flyoutsToRemove);
318
+ }
319
+ });
320
+ var _newFlyouts3 = state.flyouts.filter(function (f) {
321
+ return !_flyoutsToRemove.has(f.flyoutId);
322
+ });
284
323
  var _newCurrentZIndex2 = state.currentZIndex;
285
- if (state.unmanagedFlyouts.length === 0) {
324
+ if (_newSessions.length === 0 && state.unmanagedFlyouts.length === 0) {
286
325
  _newCurrentZIndex2 = 0;
287
326
  }
288
- return _objectSpread(_objectSpread({}, initialState), {}, {
289
- currentZIndex: _newCurrentZIndex2,
290
- unmanagedFlyouts: state.unmanagedFlyouts
327
+ return _objectSpread(_objectSpread({}, state), {}, {
328
+ sessions: _newSessions,
329
+ flyouts: _newFlyouts3,
330
+ currentZIndex: _newCurrentZIndex2
291
331
  });
292
332
  }
293
333
 
@@ -299,8 +339,8 @@ function flyoutManagerReducer() {
299
339
  return state;
300
340
  }
301
341
  var _updatedSessions2 = _toConsumableArray(state.sessions);
302
- var _currentSessionIndex = _updatedSessions2.length - 1;
303
- _updatedSessions2[_currentSessionIndex] = _objectSpread(_objectSpread({}, _updatedSessions2[_currentSessionIndex]), {}, {
342
+ var _currentSessionIndex2 = _updatedSessions2.length - 1;
343
+ _updatedSessions2[_currentSessionIndex2] = _objectSpread(_objectSpread({}, _updatedSessions2[_currentSessionIndex2]), {}, {
304
344
  childFlyoutId: action.flyoutId
305
345
  });
306
346
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -346,51 +386,50 @@ function flyoutManagerReducer() {
346
386
  });
347
387
  }
348
388
 
349
- // Go back: pop child history when any, else pop current session
389
+ // Go back: pop child history when any, else pop current session (only within same historyKey).
350
390
  case _actions.ACTION_GO_BACK:
351
391
  {
352
- var _currentSession$child3, _currentSession$child4;
392
+ var _currentSession2$chil;
353
393
  if (state.sessions.length === 0) {
354
394
  return state;
355
395
  }
356
- var _currentSessionIndex2 = state.sessions.length - 1;
357
- var _currentSession = state.sessions[_currentSessionIndex2];
358
- var _childHistory = (_currentSession$child3 = _currentSession.childHistory) !== null && _currentSession$child3 !== void 0 ? _currentSession$child3 : [];
396
+ var _currentSessionIndex3 = state.sessions.length - 1;
397
+ var _currentSession2 = state.sessions[_currentSessionIndex3];
398
+ var _childHistory = (_currentSession2$chil = _currentSession2.childHistory) !== null && _currentSession2$chil !== void 0 ? _currentSession2$chil : [];
359
399
  if (_childHistory.length > 0) {
360
400
  // Pop one child: set current child to the last entry in history, remove the current child flyout
361
401
  var popped = _childHistory[_childHistory.length - 1];
362
402
  var newChildHistory = _childHistory.slice(0, -1);
363
403
  var _updatedSessions3 = _toConsumableArray(state.sessions);
364
- _updatedSessions3[_currentSessionIndex2] = _objectSpread(_objectSpread({}, _currentSession), {}, {
404
+ _updatedSessions3[_currentSessionIndex3] = _objectSpread(_objectSpread({}, _currentSession2), {}, {
365
405
  childHistory: newChildHistory,
366
406
  childFlyoutId: popped.flyoutId,
367
407
  childTitle: popped.title,
368
408
  childIconType: popped.iconType
369
409
  });
370
- var _newFlyouts3 = state.flyouts.filter(function (f) {
371
- return f.flyoutId !== _currentSession.childFlyoutId;
410
+ var _newFlyouts4 = state.flyouts.filter(function (f) {
411
+ return f.flyoutId !== _currentSession2.childFlyoutId;
372
412
  });
373
413
  return _objectSpread(_objectSpread({}, state), {}, {
374
414
  sessions: _updatedSessions3,
375
- flyouts: _newFlyouts3
415
+ flyouts: _newFlyouts4
376
416
  });
377
417
  }
378
418
 
379
419
  // No child history: pop current session (main + all its children)
380
- var _flyoutsToRemove = new Set([_currentSession.mainFlyoutId]);
381
- if (_currentSession.childFlyoutId) {
382
- _flyoutsToRemove.add(_currentSession.childFlyoutId);
383
- }
384
- ((_currentSession$child4 = _currentSession.childHistory) !== null && _currentSession$child4 !== void 0 ? _currentSession$child4 : []).forEach(function (e) {
385
- return _flyoutsToRemove.add(e.flyoutId);
420
+ var _flyoutsToRemove2 = new Set();
421
+ addSessionFlyoutsToRemove(_currentSession2, _flyoutsToRemove2);
422
+ var sessionsWithoutCurrent = state.sessions.slice(0, _currentSessionIndex3);
423
+ var hasRemainingInCurrentGroup = sessionsWithoutCurrent.some(function (s) {
424
+ return s.historyKey === _currentSession2.historyKey;
386
425
  });
387
- var _newFlyouts4 = state.flyouts.filter(function (f) {
388
- return !_flyoutsToRemove.has(f.flyoutId);
426
+ var _newSessions2 = hasRemainingInCurrentGroup ? moveHistoryGroupToTop(sessionsWithoutCurrent, _currentSession2.historyKey) : sessionsWithoutCurrent;
427
+ var _newFlyouts5 = state.flyouts.filter(function (f) {
428
+ return !_flyoutsToRemove2.has(f.flyoutId);
389
429
  });
390
- var _newSessions = state.sessions.slice(0, _currentSessionIndex2);
391
430
  return _objectSpread(_objectSpread({}, state), {}, {
392
- sessions: _newSessions,
393
- flyouts: _newFlyouts4
431
+ sessions: _newSessions2,
432
+ flyouts: _newFlyouts5
394
433
  });
395
434
  }
396
435
 
@@ -399,11 +438,11 @@ function flyoutManagerReducer() {
399
438
  {
400
439
  var _flyoutId3 = action.flyoutId,
401
440
  _level = action.level;
402
- var _currentSessionIndex3 = state.sessions.length - 1;
441
+ var _currentSessionIndex4 = state.sessions.length - 1;
403
442
  if (_level === _const.LEVEL_CHILD && state.sessions.length > 0) {
404
- var _currentSession2$chil;
405
- var _currentSession2 = state.sessions[_currentSessionIndex3];
406
- var _childHistory2 = (_currentSession2$chil = _currentSession2.childHistory) !== null && _currentSession2$chil !== void 0 ? _currentSession2$chil : [];
443
+ var _currentSession3$chil;
444
+ var _currentSession3 = state.sessions[_currentSessionIndex4];
445
+ var _childHistory2 = (_currentSession3$chil = _currentSession3.childHistory) !== null && _currentSession3$chil !== void 0 ? _currentSession3$chil : [];
407
446
  var targetIndex = _childHistory2.findIndex(function (entry) {
408
447
  return entry.flyoutId === _flyoutId3;
409
448
  });
@@ -412,18 +451,18 @@ function flyoutManagerReducer() {
412
451
  }
413
452
  var targetEntry = _childHistory2[targetIndex];
414
453
  var _newChildHistory = _childHistory2.slice(0, targetIndex);
415
- var _flyoutsToRemove2 = new Set();
416
- if (_currentSession2.childFlyoutId) {
417
- _flyoutsToRemove2.add(_currentSession2.childFlyoutId);
454
+ var _flyoutsToRemove3 = new Set();
455
+ if (_currentSession3.childFlyoutId) {
456
+ _flyoutsToRemove3.add(_currentSession3.childFlyoutId);
418
457
  }
419
458
  _childHistory2.slice(targetIndex + 1).forEach(function (e) {
420
- _flyoutsToRemove2.add(e.flyoutId);
459
+ _flyoutsToRemove3.add(e.flyoutId);
421
460
  });
422
- var _newFlyouts5 = state.flyouts.filter(function (f) {
423
- return !_flyoutsToRemove2.has(f.flyoutId);
461
+ var _newFlyouts6 = state.flyouts.filter(function (f) {
462
+ return !_flyoutsToRemove3.has(f.flyoutId);
424
463
  });
425
464
  var _updatedSessions4 = _toConsumableArray(state.sessions);
426
- _updatedSessions4[_currentSessionIndex3] = _objectSpread(_objectSpread({}, _currentSession2), {}, {
465
+ _updatedSessions4[_currentSessionIndex4] = _objectSpread(_objectSpread({}, _currentSession3), {}, {
427
466
  childHistory: _newChildHistory,
428
467
  childFlyoutId: targetEntry.flyoutId,
429
468
  childTitle: targetEntry.title,
@@ -431,7 +470,7 @@ function flyoutManagerReducer() {
431
470
  });
432
471
  return _objectSpread(_objectSpread({}, state), {}, {
433
472
  sessions: _updatedSessions4,
434
- flyouts: _newFlyouts5
473
+ flyouts: _newFlyouts6
435
474
  });
436
475
  }
437
476
 
@@ -442,25 +481,45 @@ function flyoutManagerReducer() {
442
481
  if (targetSessionIndex === -1) {
443
482
  return state; // Target flyout not found
444
483
  }
484
+ var _currentSession4 = state.sessions[_currentSessionIndex4];
485
+ var targetSession = state.sessions[targetSessionIndex];
486
+
487
+ // Group-local navigation: keep other history groups, remove only newer sessions in target's group,
488
+ // then bring that group to the top.
489
+ if (targetSession.historyKey === _currentSession4.historyKey) {
490
+ var _flyoutsToRemove4 = new Set();
491
+ var sessionsAfterTargetInGroup = state.sessions.filter(function (session, index) {
492
+ return index > targetSessionIndex && session.historyKey === targetSession.historyKey;
493
+ });
494
+ sessionsAfterTargetInGroup.forEach(function (session) {
495
+ addSessionFlyoutsToRemove(session, _flyoutsToRemove4);
496
+ });
497
+ var sessionsWithoutRemoved = state.sessions.filter(function (session) {
498
+ return !sessionsAfterTargetInGroup.some(function (removed) {
499
+ return removed.mainFlyoutId === session.mainFlyoutId;
500
+ });
501
+ });
502
+ var reorderedSessions = moveHistoryGroupToTop(sessionsWithoutRemoved, targetSession.historyKey);
503
+ var _newFlyouts7 = state.flyouts.filter(function (f) {
504
+ return !_flyoutsToRemove4.has(f.flyoutId);
505
+ });
506
+ return _objectSpread(_objectSpread({}, state), {}, {
507
+ sessions: reorderedSessions,
508
+ flyouts: _newFlyouts7
509
+ });
510
+ }
445
511
  var sessionsToClose = state.sessions.slice(targetSessionIndex + 1);
446
- var _flyoutsToRemove3 = new Set();
512
+ var _flyoutsToRemove5 = new Set();
447
513
  sessionsToClose.forEach(function (session) {
448
- var _session$childHistory2;
449
- _flyoutsToRemove3.add(session.mainFlyoutId);
450
- if (session.childFlyoutId) {
451
- _flyoutsToRemove3.add(session.childFlyoutId);
452
- }
453
- ((_session$childHistory2 = session.childHistory) !== null && _session$childHistory2 !== void 0 ? _session$childHistory2 : []).forEach(function (e) {
454
- return _flyoutsToRemove3.add(e.flyoutId);
455
- });
514
+ addSessionFlyoutsToRemove(session, _flyoutsToRemove5);
456
515
  });
457
- var _newFlyouts6 = state.flyouts.filter(function (f) {
458
- return !_flyoutsToRemove3.has(f.flyoutId);
516
+ var _newFlyouts8 = state.flyouts.filter(function (f) {
517
+ return !_flyoutsToRemove5.has(f.flyoutId);
459
518
  });
460
- var _newSessions2 = state.sessions.slice(0, targetSessionIndex + 1);
519
+ var _newSessions3 = state.sessions.slice(0, targetSessionIndex + 1);
461
520
  return _objectSpread(_objectSpread({}, state), {}, {
462
- sessions: _newSessions2,
463
- flyouts: _newFlyouts6
521
+ sessions: _newSessions3,
522
+ flyouts: _newFlyouts8
464
523
  });
465
524
  }
466
525
 
@@ -56,8 +56,15 @@ function createStore() {
56
56
  var _currentSession$child;
57
57
  var currentSessionIndex = currentState.sessions.length - 1;
58
58
  var currentSession = currentSessionIndex >= 0 ? currentState.sessions[currentSessionIndex] : null;
59
+ if (!currentSession) {
60
+ return [];
61
+ }
59
62
  var previousSessions = currentState.sessions.slice(0, currentSessionIndex);
60
- var childHistory = (_currentSession$child = currentSession === null || currentSession === void 0 ? void 0 : currentSession.childHistory) !== null && _currentSession$child !== void 0 ? _currentSession$child : [];
63
+ // Only include sessions in the same history group (same historyKey reference)
64
+ var previousSessionsInGroup = previousSessions.filter(function (session) {
65
+ return session.historyKey === currentSession.historyKey;
66
+ });
67
+ var childHistory = (_currentSession$child = currentSession.childHistory) !== null && _currentSession$child !== void 0 ? _currentSession$child : [];
61
68
  var childItems = _toConsumableArray(childHistory).reverse().map(function (entry) {
62
69
  return {
63
70
  title: entry.title,
@@ -68,11 +75,11 @@ function createStore() {
68
75
  };
69
76
  });
70
77
 
71
- // Previous sessions: list each session's current child then its child history (so all travelled entries appear)
78
+ // Previous sessions (same group): list each session's current child then its child history
72
79
  var previousSessionItems = [];
73
80
  var _loop = function _loop() {
74
81
  var _session$childHistory;
75
- var session = previousSessions[i];
82
+ var session = previousSessionsInGroup[i];
76
83
  var mainTitle = session.title;
77
84
  var mainFlyoutId = session.mainFlyoutId;
78
85
  var history = (_session$childHistory = session.childHistory) !== null && _session$childHistory !== void 0 ? _session$childHistory : [];
@@ -110,7 +117,7 @@ function createStore() {
110
117
  });
111
118
  }
112
119
  };
113
- for (var i = previousSessions.length - 1; i >= 0; i--) {
120
+ for (var i = previousSessionsInGroup.length - 1; i >= 0; i--) {
114
121
  _loop();
115
122
  }
116
123
  return [].concat(_toConsumableArray(childItems), previousSessionItems);
@@ -149,8 +156,8 @@ function createStore() {
149
156
  subscribe: subscribe,
150
157
  subscribeToEvents: subscribeToEvents,
151
158
  dispatch: dispatch,
152
- addFlyout: function addFlyout(flyoutId, title, level, size, iconType, minWidth) {
153
- return dispatch((0, _actions.addFlyout)(flyoutId, title, level, size, iconType, minWidth));
159
+ addFlyout: function addFlyout(flyoutId, title, level, size, historyKey, iconType, minWidth) {
160
+ return dispatch((0, _actions.addFlyout)(flyoutId, title, level, size, historyKey, iconType, minWidth));
154
161
  },
155
162
  closeFlyout: function closeFlyout(flyoutId) {
156
163
  return dispatch((0, _actions.closeFlyout)(flyoutId));
@@ -9,6 +9,7 @@ var _remarkParseNoTrim = _interopRequireDefault(require("remark-parse-no-trim"))
9
9
  var _remarkEmoji = _interopRequireDefault(require("remark-emoji"));
10
10
  var _remarkBreaks = _interopRequireDefault(require("remark-breaks"));
11
11
  var _remark_prismjs = _interopRequireDefault(require("../remark/remark_prismjs"));
12
+ var _remark_intraword_underscore = _interopRequireDefault(require("../remark/remark_intraword_underscore"));
12
13
  var MarkdownTooltip = _interopRequireWildcard(require("../markdown_tooltip"));
13
14
  var MarkdownCheckbox = _interopRequireWildcard(require("../markdown_checkbox"));
14
15
  var _markdown_link_validator = require("../markdown_link_validator");
@@ -48,7 +49,7 @@ var getDefaultEuiMarkdownParsingPlugins = exports.getDefaultEuiMarkdownParsingPl
48
49
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
49
50
  var exclude = _ref.exclude,
50
51
  parsingConfig = _objectWithoutProperties(_ref, _excluded);
51
- var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}]];
52
+ var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}], [_remark_intraword_underscore.default, {}]];
52
53
  Object.entries(DEFAULT_PARSING_PLUGINS).forEach(function (_ref2) {
53
54
  var _ref3 = _slicedToArray(_ref2, 2),
54
55
  pluginName = _ref3[0],
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ 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; } } }; }
8
+ 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; } }
9
+ 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; }
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+
18
+ // Temporary workaround for https://github.com/elastic/eui/issues/9404
19
+ // remark-parse v8 doesn't implement the CommonMark rule that underscore
20
+ // emphasis delimiters flanked by alphanumerics on both sides (intraword)
21
+ // cannot open or close emphasis. This causes identifiers like
22
+ // `ABCD__PineappleCherry__e` to render with bold formatting.
23
+ // This plugin walks the parsed AST and reverses incorrectly applied
24
+ // emphasis/strong nodes when both sides are alphanumeric characters.
25
+
26
+ // eslint-disable-next-line import/no-unresolved
27
+
28
+ var isTextNode = function isTextNode(node) {
29
+ return node.type === 'text';
30
+ };
31
+ var isEmphasisOrStrong = function isEmphasisOrStrong(node) {
32
+ return node.type === 'emphasis' || node.type === 'strong';
33
+ };
34
+ var isAlphanumeric = function isAlphanumeric(ch) {
35
+ return /[a-zA-Z0-9]/.test(ch);
36
+ };
37
+
38
+ /**
39
+ * Recursively converts an emphasis/strong node back into plain text
40
+ * with underscore delimiters restored.
41
+ */
42
+ function flattenToText(node) {
43
+ var delimiter = node.type === 'emphasis' ? '_' : '__';
44
+ var inner = '';
45
+ var _iterator = _createForOfIteratorHelper(node.children),
46
+ _step;
47
+ try {
48
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
49
+ var child = _step.value;
50
+ if (isTextNode(child)) {
51
+ inner += child.value;
52
+ } else if (isEmphasisOrStrong(child)) {
53
+ inner += flattenToText(child);
54
+ } else {
55
+ // Contains non-text children (links, images, etc.) — leave emphasis intact
56
+ return delimiter + collectText(node) + delimiter;
57
+ }
58
+ }
59
+ } catch (err) {
60
+ _iterator.e(err);
61
+ } finally {
62
+ _iterator.f();
63
+ }
64
+ return delimiter + inner + delimiter;
65
+ }
66
+ function collectText(node) {
67
+ if (isTextNode(node)) return node.value;
68
+ if ('children' in node) {
69
+ return node.children.map(collectText).join('');
70
+ }
71
+ return '';
72
+ }
73
+ function processParent(parent, source) {
74
+ var modified = false;
75
+ var i = 0;
76
+ while (i < parent.children.length) {
77
+ var child = parent.children[i];
78
+ if (isEmphasisOrStrong(child) && isIntraword(parent, i, source)) {
79
+ var textValue = flattenToText(child);
80
+ var replacement = {
81
+ type: 'text',
82
+ value: textValue
83
+ };
84
+ parent.children.splice(i, 1, replacement);
85
+ modified = true;
86
+ // Don't advance — the replaced node may need to merge with neighbors
87
+ } else {
88
+ if ('children' in child) {
89
+ processParent(child, source);
90
+ }
91
+ i++;
92
+ }
93
+ if (modified) {
94
+ mergeAdjacentText(parent);
95
+ modified = false;
96
+ // After merging, restart scan since indices shifted
97
+ i = 0;
98
+ }
99
+ }
100
+ }
101
+ function getInnerText(node) {
102
+ if (isTextNode(node)) return node.value;
103
+ if ('children' in node) {
104
+ var children = node.children;
105
+ if (children.length > 0) return getInnerText(children[0]);
106
+ }
107
+ return '';
108
+ }
109
+ function getInnerTextEnd(node) {
110
+ if (isTextNode(node)) return node.value;
111
+ if ('children' in node) {
112
+ var children = node.children;
113
+ if (children.length > 0) return getInnerTextEnd(children[children.length - 1]);
114
+ }
115
+ return '';
116
+ }
117
+
118
+ /**
119
+ * Checks whether the emphasis/strong node at `index` within `parent`
120
+ * is an intraword usage of underscore delimiters.
121
+ *
122
+ * A node is intraword when at least one side has an alphanumeric text
123
+ * neighbor AND the inner content on the corresponding delimiter side
124
+ * also touches word characters — proving the underscores are embedded
125
+ * in a word rather than used as formatting.
126
+ */
127
+ function isIntraword(parent, index, source) {
128
+ var _node$position;
129
+ var node = parent.children[index];
130
+
131
+ // Verify the delimiter is `_` (not `*`) by inspecting the source
132
+ 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) {
133
+ var ch = source[node.position.start.offset];
134
+ if (ch !== '_') return false;
135
+ }
136
+ var prev = index > 0 ? parent.children[index - 1] : null;
137
+ var next = index < parent.children.length - 1 ? parent.children[index + 1] : null;
138
+ var prevChar = prev != null && isTextNode(prev) && prev.value.length > 0 ? prev.value[prev.value.length - 1] : null;
139
+ var nextChar = next != null && isTextNode(next) && next.value.length > 0 ? next.value[0] : null;
140
+ var prevIsAlpha = prevChar != null && isAlphanumeric(prevChar);
141
+ var nextIsAlpha = nextChar != null && isAlphanumeric(nextChar);
142
+
143
+ // Both sides flanked by alphanumeric — classic intraword (e.g. `foo__bar__baz`)
144
+ if (prevIsAlpha && nextIsAlpha) return true;
145
+
146
+ // One-sided: prev is alpha or underscore, no alpha next — check inner text
147
+ // starts with alpha (e.g. `Lorem__ipsum__` or `Lorem__ipsum_`)
148
+ if (prevIsAlpha || prevChar === '_') {
149
+ var inner = getInnerText(node);
150
+ if (inner.length > 0 && isAlphanumeric(inner[0])) return true;
151
+ }
152
+
153
+ // One-sided: next is alpha or underscore, no alpha prev — check inner text
154
+ // ends with alpha (e.g. `__Lorem__ipsum` or `_Lorem__ipsum`)
155
+ if (nextIsAlpha || nextChar === '_') {
156
+ var _inner = getInnerTextEnd(node);
157
+ if (_inner.length > 0 && isAlphanumeric(_inner[_inner.length - 1])) return true;
158
+ }
159
+ return false;
160
+ }
161
+ function mergeAdjacentText(parent) {
162
+ var i = 0;
163
+ while (i < parent.children.length - 1) {
164
+ if (isTextNode(parent.children[i]) && isTextNode(parent.children[i + 1])) {
165
+ parent.children[i].value += parent.children[i + 1].value;
166
+ parent.children.splice(i + 1, 1);
167
+ } else {
168
+ i++;
169
+ }
170
+ }
171
+ }
172
+ var attacher = function remarkIntrawordUnderscore() {
173
+ return function (tree, file) {
174
+ var source = String(file);
175
+ processParent(tree, source);
176
+ };
177
+ };
178
+ var _default = exports.default = attacher;
179
+ module.exports = exports.default;
@@ -14,7 +14,7 @@ var _services = require("../../services");
14
14
  var _portal = require("../portal");
15
15
  var _overlay_mask = require("./overlay_mask.styles");
16
16
  var _overlay_mask_body = require("./overlay_mask_body.styles");
17
- var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
17
+ var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "hasAnimation"];
18
18
  /*
19
19
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
20
  * or more contributor license agreements. Licensed under the Elastic License
@@ -43,6 +43,8 @@ var EuiOverlayMask = exports.EuiOverlayMask = function EuiOverlayMask(_ref) {
43
43
  _ref$headerZindexLoca = _ref.headerZindexLocation,
44
44
  headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
45
45
  maskRef = _ref.maskRef,
46
+ _ref$hasAnimation = _ref.hasAnimation,
47
+ hasAnimation = _ref$hasAnimation === void 0 ? true : _ref$hasAnimation,
46
48
  rest = _objectWithoutProperties(_ref, _excluded);
47
49
  var hasRendered = (0, _react.useRef)(false);
48
50
  var _useState = (0, _react.useState)(null),
@@ -54,7 +56,7 @@ var EuiOverlayMask = exports.EuiOverlayMask = function EuiOverlayMask(_ref) {
54
56
  hasRendered.current = true;
55
57
  }, []);
56
58
  var styles = (0, _services.useEuiMemoizedStyles)(_overlay_mask.euiOverlayMaskStyles);
57
- var cssStyles = (0, _css.cx)([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")], hasRendered.current && styles.noAnimation]);
59
+ var cssStyles = (0, _css.cx)([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")], (hasRendered.current || !hasAnimation) && styles.noAnimation]);
58
60
  (0, _react.useEffect)(function () {
59
61
  if (!overlayMaskNode) return;
60
62
  (0, _common.keysOf)(rest).forEach(function (key) {
@@ -113,5 +115,10 @@ EuiOverlayMask.propTypes = {
113
115
  /**
114
116
  * React ref to be passed to the wrapping container
115
117
  */
116
- maskRef: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired])
118
+ maskRef: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
119
+ /**
120
+ * If enabled, the mask will have a fade in animation.
121
+ * @default true
122
+ */
123
+ hasAnimation: _propTypes.default.bool
117
124
  };
@@ -30,7 +30,7 @@ var euiTreeViewItemStyles = exports.euiTreeViewItemStyles = function euiTreeView
30
30
  euiTreeView__node: _ref,
31
31
  default: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', defaultSize), " line-height:", defaultSize, ";;label:default;"),
32
32
  compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', compressedSize), " line-height:", compressedSize, ";;label:compressed;"),
33
- expanded: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '100vh'), ";;label:expanded;")
33
+ expanded: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', 'none'), ";;label:expanded;")
34
34
  },
35
35
  button: {
36
36
  euiTreeView__nodeInner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xxs), " display:flex;align-items:center;&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";}&:hover,&:active,&:focus{background-color:", euiTheme.components.treeViewItemBackgroundHover, ";};label:euiTreeView__nodeInner;"),