@likec4/diagram 1.46.0 → 1.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/bundle/index.js +369 -322
  2. package/dist/LikeC4View.js +1 -1
  3. package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
  4. package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
  5. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  6. package/dist/base-primitives/element/ElementActionButtons.js +1 -1
  7. package/dist/base-primitives/element/ElementDetailsButton.js +1 -1
  8. package/dist/base-primitives/memoNode.js +1 -1
  9. package/dist/components/ErrorFallback.js +1 -1
  10. package/dist/components/Link.js +2 -2
  11. package/dist/context/IconRenderer.js +6 -6
  12. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  13. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
  14. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  15. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +4 -4
  16. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  17. package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
  18. package/dist/navigationpanel/_common.js +1 -1
  19. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
  20. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
  21. package/dist/navigationpanel/controls/DetailsControls.js +2 -2
  22. package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
  23. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  24. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  25. package/dist/navigationpanel/controls/SearchControl.js +1 -1
  26. package/dist/navigationpanel/controls/ToggleReadonly.js +2 -2
  27. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  28. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  29. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  30. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  31. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  32. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
  33. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  34. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  35. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  36. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
  37. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  38. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  39. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  40. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
  41. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
  42. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  43. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  44. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  45. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  46. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
  47. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
  48. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
  49. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
  50. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  51. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  52. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
  53. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  54. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  55. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
  56. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  57. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
  58. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
  59. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
  60. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
  61. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
  62. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
  63. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
  64. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
  65. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  66. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  67. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
  68. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
  69. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  70. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  71. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  72. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  73. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
  74. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
  75. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
  76. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
  77. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  78. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  79. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  80. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
  81. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  82. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  83. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  84. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.1 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  85. package/dist/overlays/Overlays.js +2 -2
  86. package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -11
  87. package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
  88. package/dist/overlays/element-details/MetadataValue.js +2 -2
  89. package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
  90. package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
  91. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  92. package/dist/overlays/overlaysActor.js +0 -2
  93. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  94. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  95. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  96. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
  97. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  98. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  99. package/dist/search/components/ElementsColumn.js +16 -15
  100. package/dist/search/components/PickView.js +1 -1
  101. package/dist/search/components/SearchByTags.js +1 -1
  102. package/dist/search/components/SearchInput.js +1 -1
  103. package/dist/search/components/ViewsColum.js +11 -12
  104. package/dist/search/components/utils.d.ts +6 -0
  105. package/dist/search/components/utils.js +4 -1
  106. package/dist/styles.css2.js +1 -1
  107. package/package.json +17 -17
  108. package/panda.buildinfo.json +3 -4
  109. package/styles-min.css +1 -1
  110. package/styles.css +1 -1
@@ -15,9 +15,9 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
15
15
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
16
16
  import { focusable, buttonsva } from './_shared.css.js';
17
17
  import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
18
- import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
18
+ import { whenSearchAnimationEnds, stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
19
19
  import { NothingFound } from './ViewsColum.js';
20
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
20
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
21
21
 
22
22
  const btn = buttonsva();
23
23
  const ElementsColumn = memo(() => {
@@ -247,21 +247,22 @@ function useHandleElementSelection() {
247
247
  if (views.length === 0) {
248
248
  return;
249
249
  }
250
- const singleView = only(views);
251
- if (singleView) {
252
- searchActorRef.send({ type: "close" });
253
- if (singleView.id === diagram.currentView.id) {
254
- setTimeout(() => {
255
- diagram.focusOnElement(element.id);
256
- }, 100);
257
- } else {
258
- setTimeout(() => {
259
- diagram.navigateTo(singleView.id, void 0, element.id);
260
- }, 100);
261
- }
250
+ const elementFqn = element.id;
251
+ const onlyOneViewId = only(views)?.id;
252
+ if (!onlyOneViewId) {
253
+ searchActorRef.send({ type: "pickview.open", elementFqn });
262
254
  return;
263
255
  }
264
- searchActorRef.send({ type: "pickview.open", elementFqn: element.id });
256
+ const isSameView = onlyOneViewId === diagram.currentView.id;
257
+ searchActorRef.send({ type: "close" });
258
+ whenSearchAnimationEnds(() => {
259
+ if (isSameView) {
260
+ diagram.focusOnElement(elementFqn);
261
+ return;
262
+ }
263
+ diagram.navigateTo(onlyOneViewId, void 0, elementFqn);
264
+ });
265
+ return;
265
266
  });
266
267
  }
267
268
 
@@ -6,7 +6,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
6
6
  import { useSearchActor } from '../hooks.js';
7
7
  import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
8
8
  import { ViewButton } from './ViewsColum.js';
9
- import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
9
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
10
10
 
11
11
  function PickView({ elementFqn }) {
12
12
  const searchActorRef = useSearchActor();
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useUpdateSearch, useNormalizedSearch } from '../hooks.js';
8
8
  import { focusToFirstFoundElement, moveFocusToSearchInput } from './utils.js';
9
9
  import { ElementTag } from '../../base-primitives/element/ElementTags.js';
10
- import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
10
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
11
11
 
12
12
  function SearchByTags() {
13
13
  const ref = useRef(null);
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useSearchActor, useSearch } from '../hooks.js';
8
8
  import { input } from './styles.css.js';
9
9
  import { moveFocusToSearchInput, stopAndPrevent, focusToFirstFoundElement } from './utils.js';
10
- import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
10
+ import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
11
11
 
12
12
  function startingWithKind(search) {
13
13
  return search.match(/^(k|ki|kin|kind|kind:)$/) != null;
@@ -12,10 +12,10 @@ import { useDiagram } from '../../hooks/safeContext.js';
12
12
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
13
13
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
14
14
  import { emptyBoX, buttonsva, focusable } from './_shared.css.js';
15
- import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
15
+ import { moveFocusToSearchInput, queryAllFocusable, centerY, whenSearchAnimationEnds } from './utils.js';
16
16
  import { viewButton } from './ViewsColumn.css.js';
17
- import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
18
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.1/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
17
+ import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
18
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
19
19
 
20
20
  const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
21
21
  const ViewsColumn = memo(() => {
@@ -83,19 +83,18 @@ const btn = buttonsva();
83
83
  function ViewButton({ className, view, loop = false, search, focusOnElement, ...props }) {
84
84
  const searchActorRef = useSearchActor();
85
85
  const diagram = useDiagram();
86
+ const nextViewId = view.id;
86
87
  const currentViewId = useCurrentViewId();
87
- const isCurrentView = view.id === currentViewId;
88
+ const isCurrentView = nextViewId === currentViewId;
88
89
  const navigate = () => {
89
90
  searchActorRef.send({ type: "close" });
90
- if (isCurrentView && focusOnElement) {
91
- setTimeout(() => {
91
+ whenSearchAnimationEnds(() => {
92
+ if (isCurrentView && focusOnElement) {
92
93
  diagram.focusOnElement(focusOnElement);
93
- }, 100);
94
- } else {
95
- setTimeout(() => {
96
- diagram.navigateTo(view.id, void 0, focusOnElement);
97
- }, 100);
98
- }
94
+ return;
95
+ }
96
+ diagram.navigateTo(nextViewId, void 0, focusOnElement);
97
+ });
99
98
  };
100
99
  return /* @__PURE__ */ jsxs(
101
100
  UnstyledButton,
@@ -3,3 +3,9 @@ export declare function centerY(element: HTMLElement): number;
3
3
  export declare function moveFocusToSearchInput(from: HTMLElement | null | undefined): void;
4
4
  export declare function focusToFirstFoundElement(from: HTMLElement | null | undefined): void;
5
5
  export declare function queryAllFocusable(from: HTMLElement | null | undefined, where: 'elements' | 'views', selector?: string): HTMLButtonElement[];
6
+ /**
7
+ * Workaround: defers execution of the callback, to finish search panel close animation.
8
+ * Otherwise, there could be weird artifacts when navigating to large diagrams.
9
+ * @todo Find a better way to handle this, possibly with animationend event.
10
+ */
11
+ export declare function whenSearchAnimationEnds(callback: () => void): void;
@@ -54,5 +54,8 @@ function queryAllFocusable(from, where, selector = `.${focusable}`) {
54
54
  const elements = root.querySelectorAll(`[data-likec4-search-${where}] ${selector}`);
55
55
  return [...elements];
56
56
  }
57
+ function whenSearchAnimationEnds(callback) {
58
+ setTimeout(callback, 300);
59
+ }
57
60
 
58
- export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent };
61
+ export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent, whenSearchAnimationEnds };