@likec4/diagram 1.46.0 → 1.46.3
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.
- package/bundle/index.js +454 -384
- package/dist/LikeC4View.js +1 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/context/IconRenderer.js +6 -6
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +4 -4
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/controls/DetailsControls.js +2 -2
- package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/overlays/Overlays.js +2 -2
- package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlaysActor.js +0 -2
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/search/components/ElementsColumn.js +16 -15
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +11 -12
- package/dist/search/components/utils.d.ts +6 -0
- package/dist/search/components/utils.js +4 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +19 -19
- package/panda.buildinfo.json +3 -4
- package/styles-min.css +1 -1
- 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.
|
|
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
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
18
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
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 =
|
|
88
|
+
const isCurrentView = nextViewId === currentViewId;
|
|
88
89
|
const navigate = () => {
|
|
89
90
|
searchActorRef.send({ type: "close" });
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
whenSearchAnimationEnds(() => {
|
|
92
|
+
if (isCurrentView && focusOnElement) {
|
|
92
93
|
diagram.focusOnElement(focusOnElement);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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 };
|