@likec4/diagram 1.51.0 → 1.53.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.
- package/dist/LikeC4View.js +1 -1
- package/dist/_virtual/assign-6b5249c3.cjs.js +3 -0
- package/dist/_virtual/log-b8ad8428.cjs.js +3 -0
- package/dist/_virtual/raise-f23ccfcb.cjs.js +3 -0
- package/dist/_virtual/store-803b8f7d.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +1 -1
- package/dist/_virtual/xstate-guards.cjs.js +1 -1
- package/dist/_virtual/xstate-store-react.cjs.js +1 -1
- package/dist/adhoc-editor/EditorPanel.js +1 -1
- package/dist/adhoc-editor/components/Tree.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/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/components/NavigationPanel.js +4 -2
- package/dist/components/SearchControl.css.js +79 -0
- package/dist/components/SearchControl.js +17 -0
- package/dist/context/IconRenderer.js +7 -7
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +1 -0
- package/dist/editor/editorActor.actions.d.ts +142 -190
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- 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/relationship-popover/actor.d.ts +28 -130
- package/dist/likec4diagram/state/machine.actions.d.ts +1819 -2407
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +472 -628
- package/dist/likec4diagram/state/machine.setup.js +2 -2
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +148 -196
- package/dist/likec4diagram/state/machine.state.ready.d.ts +2921 -3807
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +413 -537
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +352 -413
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +91 -121
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +583 -775
- package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -2
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +1 -2
- 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.d.ts +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +31 -45
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.1_react@19.2.4 → @tabler_icons-react@3.40.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/{@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js → @xstate_store@3.17.0_react@19.2.4/node_modules/@xstate/store/dist/store-803b8f7d.cjs.js} +151 -132
- package/dist/node_modules/.pnpm/{@xstate_store@3.14.0_react@19.2.4 → @xstate_store@3.17.0_react@19.2.4}/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +7 -2
- package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c → xstate@5.28.0}/node_modules/xstate/actions/dist/xstate-actions.cjs.js +6 -6
- package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js → xstate@5.28.0/node_modules/xstate/dist/assign-6b5249c3.cjs.js} +10 -10
- package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js → xstate@5.28.0/node_modules/xstate/dist/log-b8ad8428.cjs.js} +18 -18
- package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js → xstate@5.28.0/node_modules/xstate/dist/raise-f23ccfcb.cjs.js} +223 -126
- package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c → xstate@5.28.0}/node_modules/xstate/guards/dist/xstate-guards.cjs.js +2 -2
- 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/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 +6 -6
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/projects-overview/actor.d.ts +15 -21
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/search/Search.d.ts +8 -0
- package/dist/search/Search.js +40 -47
- package/dist/search/SearchContext.d.ts +21 -0
- package/dist/search/SearchContext.js +20 -0
- package/dist/search/XStateSearchAdapter.d.ts +5 -0
- package/dist/search/XStateSearchAdapter.js +64 -0
- package/dist/search/components/ElementsColumn.js +6 -9
- package/dist/search/components/PickView.d.ts +1 -3
- package/dist/search/components/PickView.js +5 -5
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +6 -7
- package/dist/search/components/ViewsColum.js +8 -12
- package/dist/search/hooks.d.ts +0 -2
- package/dist/search/hooks.js +7 -33
- package/dist/styles.css2.js +1 -1
- package/package.json +23 -23
- package/panda.buildinfo.json +2 -3
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/_virtual/assign-dea9f7c8.cjs.js +0 -3
- package/dist/_virtual/log-ec8d4df4.cjs.js +0 -3
- package/dist/_virtual/raise-da5b247f.cjs.js +0 -3
- package/dist/_virtual/store-1b2fbb72.cjs.js +0 -3
- /package/dist/node_modules/.pnpm/{xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c → xstate@5.28.0}/node_modules/xstate/dev/dist/xstate-dev.cjs.js +0 -0
|
@@ -3,8 +3,8 @@ import { Popover, PopoverTarget, Button, Box, Text, ThemeIcon, PopoverDropdown,
|
|
|
3
3
|
import { useRef } from 'react';
|
|
4
4
|
import { useRelationshipDetails } from './hooks.js';
|
|
5
5
|
import { edgeSource, edgeTarget, scrollArea, edgeGrid, edgeRow, edgeArrow, edgeLabel } from './SelectEdge.css.js';
|
|
6
|
-
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
7
|
-
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
6
|
+
import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
|
|
7
|
+
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
8
8
|
|
|
9
9
|
const SelectEdge = ({
|
|
10
10
|
edge,
|
|
@@ -6,9 +6,9 @@ import 'fast-equals';
|
|
|
6
6
|
import 'react';
|
|
7
7
|
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
8
8
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
9
|
-
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
10
|
-
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
11
|
-
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
10
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
11
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
12
12
|
|
|
13
13
|
const ElementActions = (props) => {
|
|
14
14
|
const { enableNavigateTo, enableVscode } = useEnabledFeatures();
|
|
@@ -14,12 +14,12 @@ import { SelectElement } from './SelectElement.js';
|
|
|
14
14
|
import { RelationshipEdge } from './custom/edgeTypes.js';
|
|
15
15
|
import { EmptyNode } from './custom/EmptyNode.js';
|
|
16
16
|
import { CompoundNode, ElementNode } from './custom/nodeTypes.js';
|
|
17
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
18
|
-
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
19
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
20
|
-
import IconCheck from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
21
|
-
import IconAlertTriangle from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
22
|
-
import IconLink from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
17
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
18
|
+
import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
|
|
19
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
20
|
+
import IconCheck from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
21
|
+
import IconAlertTriangle from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js';
|
|
22
|
+
import IconLink from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js';
|
|
23
23
|
|
|
24
24
|
const nodeTypes = {
|
|
25
25
|
element: ElementNode,
|
|
@@ -7,8 +7,8 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
|
7
7
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
8
8
|
import * as SelectElement_css from './SelectElement.css.js';
|
|
9
9
|
import { scrollArea } from './SelectElement.css.js';
|
|
10
|
-
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
11
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
10
|
+
import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
11
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
12
12
|
|
|
13
13
|
const selector2 = (state) => {
|
|
14
14
|
const subjectExistsInScope = state.context.layouted?.subjectExistsInScope ?? false;
|
|
@@ -6,9 +6,9 @@ import '@xstate/react';
|
|
|
6
6
|
import 'fast-equals';
|
|
7
7
|
import { useDiagram } from '../../../hooks/safeContext.js';
|
|
8
8
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from '../hooks.js';
|
|
9
|
-
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
10
|
-
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
11
|
-
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
9
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
10
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
11
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
12
12
|
import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
|
|
13
13
|
|
|
14
14
|
const selectSubject = (state) => state.context.subject;
|
|
@@ -3,7 +3,7 @@ import { LayoutedProjectsView } from '@likec4/core/compute-view';
|
|
|
3
3
|
import { EdgeChange, NodeChange } from '@xyflow/system';
|
|
4
4
|
import { MouseEvent } from 'react';
|
|
5
5
|
import { Simplify } from 'type-fest';
|
|
6
|
-
import { ActorRef, SnapshotFrom, StateMachine, ActionFunction
|
|
6
|
+
import { ActorRef, SnapshotFrom, StateMachine, ActionFunction } from 'xstate';
|
|
7
7
|
import { ViewPadding } from '../LikeC4Diagram.props';
|
|
8
8
|
import { ProjectsOverviewTypes, ProjectsOverviewXYFLowInstance, ProjectsOverviewXYStoreApi } from './_types';
|
|
9
9
|
export type Input = {
|
|
@@ -92,26 +92,20 @@ export declare const onMouseEnterOrLeave: () => ActionFunction<Context, Events,
|
|
|
92
92
|
export declare const fitDiagram: (params?: {
|
|
93
93
|
duration?: number;
|
|
94
94
|
bounds?: BBox;
|
|
95
|
-
}) => ActionFunction<Context, Events, Events, undefined, never, never,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
"click: selected node": {
|
|
111
|
-
type: "click: selected node";
|
|
112
|
-
params: unknown;
|
|
113
|
-
};
|
|
114
|
-
}>, never, EmittedEvents>;
|
|
95
|
+
}) => ActionFunction<Context, Events, Events, undefined, never, never, {
|
|
96
|
+
type: "isReady";
|
|
97
|
+
params: unknown;
|
|
98
|
+
} | {
|
|
99
|
+
type: "click: selected node";
|
|
100
|
+
params: unknown;
|
|
101
|
+
}, never, EmittedEvents>;
|
|
102
|
+
export declare const restoreViewport: () => ActionFunction<Context, Events, Events, undefined, never, never, {
|
|
103
|
+
type: "isReady";
|
|
104
|
+
params: unknown;
|
|
105
|
+
} | {
|
|
106
|
+
type: "click: selected node";
|
|
107
|
+
params: unknown;
|
|
108
|
+
}, never, EmittedEvents>;
|
|
115
109
|
export interface ProjectsOverviewLogic extends StateMachine<Context, Events, {}, any, any, any, any, any, Tags, Input, any, EmittedEvents, any, any> {
|
|
116
110
|
}
|
|
117
111
|
export declare const projectOverviewLogic: ProjectsOverviewLogic;
|
|
@@ -5,7 +5,7 @@ import { ElementNodeContainer } from '../../base-primitives/element/ElementNodeC
|
|
|
5
5
|
import { ElementShape } from '../../base-primitives/element/ElementShape.js';
|
|
6
6
|
import { ElementData } from '../../base-primitives/element/ElementData.js';
|
|
7
7
|
import { ElementActionButtons } from '../../base-primitives/element/ElementActionButtons.js';
|
|
8
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
8
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
9
9
|
import { DefaultHandles } from '../../base-primitives/NodeHandles.js';
|
|
10
10
|
|
|
11
11
|
function ProjectNode(props) {
|
package/dist/search/Search.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
+
export declare const dialogCss: string;
|
|
3
|
+
export declare const bodyCss: string;
|
|
4
|
+
export declare const scrollAreaCss: string;
|
|
2
5
|
export declare const Search: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
6
|
+
/**
|
|
7
|
+
* The shared search panel content used by both diagram and overview search.
|
|
8
|
+
* Must be rendered inside a SearchContext.Provider.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SearchPanelContent: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
package/dist/search/Search.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { css } from '@likec4/styles/css';
|
|
3
3
|
import { Box, VStack } from '@likec4/styles/jsx';
|
|
4
4
|
import { Group, Grid, GridCol, Title, ScrollArea } from '@mantine/core';
|
|
5
5
|
import { useHotkeys } from '@mantine/hooks';
|
|
6
6
|
import { useTimeoutEffect } from '@react-hookz/web';
|
|
7
7
|
import { useSelector } from '@xstate/react';
|
|
8
|
-
import { AnimatePresence, usePresence
|
|
9
|
-
import { memo, useRef, useMemo, useEffect
|
|
8
|
+
import { LayoutGroup, AnimatePresence, usePresence } from 'motion/react';
|
|
9
|
+
import { memo, useRef, Suspense, useMemo, useEffect } from 'react';
|
|
10
10
|
import { isTruthy } from 'remeda';
|
|
11
11
|
import { createEmptyActor } from 'xstate';
|
|
12
12
|
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
@@ -16,27 +16,20 @@ import { ElementsColumn } from './components/ElementsColumn.js';
|
|
|
16
16
|
import { PickView } from './components/PickView.js';
|
|
17
17
|
import { SearchByTags } from './components/SearchByTags.js';
|
|
18
18
|
import { LikeC4SearchInput } from './components/SearchInput.js';
|
|
19
|
-
import {
|
|
19
|
+
import { moveFocusToSearchInput, focusToFirstFoundElement } from './components/utils.js';
|
|
20
20
|
import { ViewsColumn } from './components/ViewsColum.js';
|
|
21
|
+
import { useSearchContext } from './SearchContext.js';
|
|
22
|
+
import { XStateSearchAdapter } from './XStateSearchAdapter.js';
|
|
21
23
|
|
|
22
|
-
const
|
|
24
|
+
const dialogCss = css({
|
|
23
25
|
backgroundColor: `[rgb(34 34 34 / var(--_opacity, 95%))]`,
|
|
24
26
|
_light: {
|
|
25
27
|
backgroundColor: `[rgb(250 250 250 / var(--_opacity, 95%))]`
|
|
26
28
|
},
|
|
27
29
|
backdropFilter: "auto",
|
|
28
30
|
backdropBlur: "var(--_blur, 10px)"
|
|
29
|
-
// base: `[rgb(34 34 34 / var(${backdropOpacity}))]`,
|
|
30
|
-
// _light: `[rgb(255 255 255/ var(${backdropOpacity}))]`,
|
|
31
|
-
// },
|
|
32
31
|
});
|
|
33
|
-
const
|
|
34
|
-
// containerName: 'likec4-search',
|
|
35
|
-
// containerType: 'size',
|
|
36
|
-
// position: 'fixed',
|
|
37
|
-
// zIndex: 901,
|
|
38
|
-
// top: '0',
|
|
39
|
-
// left: '0',
|
|
32
|
+
const bodyCss = css({
|
|
40
33
|
width: "100%",
|
|
41
34
|
height: "100%",
|
|
42
35
|
maxHeight: "100vh",
|
|
@@ -50,12 +43,8 @@ const body = css({
|
|
|
50
43
|
paddingRight: "md",
|
|
51
44
|
paddingBottom: "sm",
|
|
52
45
|
background: "transparent"
|
|
53
|
-
// backgroundColor: {
|
|
54
|
-
// _dark: `[rgb(34 34 34 / 0.95)]`,
|
|
55
|
-
// _light: `[rgb(255 255 255/ 0.95)]`,
|
|
56
|
-
// },
|
|
57
46
|
});
|
|
58
|
-
const
|
|
47
|
+
const scrollAreaCss = css({
|
|
59
48
|
height: [
|
|
60
49
|
"100%",
|
|
61
50
|
"100cqh"
|
|
@@ -105,38 +94,20 @@ const Search = memo(() => {
|
|
|
105
94
|
opacity: 0.9
|
|
106
95
|
},
|
|
107
96
|
classes: {
|
|
108
|
-
dialog,
|
|
109
|
-
body
|
|
97
|
+
dialog: dialogCss,
|
|
98
|
+
body: bodyCss
|
|
110
99
|
},
|
|
111
100
|
openDelay: 0,
|
|
112
101
|
onClose: close,
|
|
113
102
|
"data-likec4-search": "true",
|
|
114
|
-
children: /* @__PURE__ */ jsx(SearchOverlayBody, { searchActorRef })
|
|
103
|
+
children: /* @__PURE__ */ jsx(XStateSearchAdapter, { searchActorRef, children: /* @__PURE__ */ jsx(SearchOverlayBody, { searchActorRef }) })
|
|
115
104
|
}
|
|
116
105
|
) });
|
|
117
106
|
});
|
|
118
107
|
Search.displayName = "Search";
|
|
119
|
-
const
|
|
120
|
-
const SearchOverlayBody = memo(({ searchActorRef }) => {
|
|
108
|
+
const SearchPanelContent = memo(() => {
|
|
121
109
|
const ref = useRef(null);
|
|
122
|
-
const pickViewFor =
|
|
123
|
-
useTimeoutEffect(() => {
|
|
124
|
-
if (isTruthy(searchActorRef.getSnapshot().context.openedWithSearch)) {
|
|
125
|
-
focusToFirstFoundElement(ref.current);
|
|
126
|
-
}
|
|
127
|
-
}, 150);
|
|
128
|
-
const [isPresent, safeToRemove] = usePresence();
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
if (isPresent) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
safeToRemove();
|
|
134
|
-
try {
|
|
135
|
-
searchActorRef.send({ type: "animation.presence.end" });
|
|
136
|
-
} catch (e) {
|
|
137
|
-
console.debug("SearchOverlayBody: animation.presence.end failed", e);
|
|
138
|
-
}
|
|
139
|
-
}, [isPresent, searchActorRef, safeToRemove]);
|
|
110
|
+
const { pickViewFor } = useSearchContext();
|
|
140
111
|
return /* @__PURE__ */ jsxs(Box, { ref, display: "contents", children: [
|
|
141
112
|
/* @__PURE__ */ jsx(
|
|
142
113
|
Group,
|
|
@@ -171,7 +142,7 @@ const SearchOverlayBody = memo(({ searchActorRef }) => {
|
|
|
171
142
|
ScrollArea,
|
|
172
143
|
{
|
|
173
144
|
type: "scroll",
|
|
174
|
-
className:
|
|
145
|
+
className: scrollAreaCss,
|
|
175
146
|
pr: "xs",
|
|
176
147
|
scrollbars: "y",
|
|
177
148
|
children: /* @__PURE__ */ jsx(LayoutGroup, { id: "likec4-search-elements", children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(ElementsColumn, {}) }) })
|
|
@@ -181,7 +152,7 @@ const SearchOverlayBody = memo(({ searchActorRef }) => {
|
|
|
181
152
|
ScrollArea,
|
|
182
153
|
{
|
|
183
154
|
type: "scroll",
|
|
184
|
-
className:
|
|
155
|
+
className: scrollAreaCss,
|
|
185
156
|
pr: "xs",
|
|
186
157
|
scrollbars: "y",
|
|
187
158
|
children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LayoutGroup, { id: "likec4-search-views", children: /* @__PURE__ */ jsx(ViewsColumn, {}) }) })
|
|
@@ -190,8 +161,30 @@ const SearchOverlayBody = memo(({ searchActorRef }) => {
|
|
|
190
161
|
]
|
|
191
162
|
}
|
|
192
163
|
),
|
|
193
|
-
pickViewFor && /* @__PURE__ */ jsx(PickView, {
|
|
164
|
+
pickViewFor && /* @__PURE__ */ jsx(PickView, { elementFqn: pickViewFor })
|
|
194
165
|
] });
|
|
195
166
|
});
|
|
167
|
+
SearchPanelContent.displayName = "SearchPanelContent";
|
|
168
|
+
const SearchOverlayBody = memo(function SearchOverlayBody2({ searchActorRef }) {
|
|
169
|
+
const ref = useRef(null);
|
|
170
|
+
useTimeoutEffect(() => {
|
|
171
|
+
if (isTruthy(searchActorRef.getSnapshot().context.openedWithSearch)) {
|
|
172
|
+
focusToFirstFoundElement(ref.current);
|
|
173
|
+
}
|
|
174
|
+
}, 150);
|
|
175
|
+
const [isPresent, safeToRemove] = usePresence();
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
if (isPresent) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
safeToRemove();
|
|
181
|
+
try {
|
|
182
|
+
searchActorRef.send({ type: "animation.presence.end" });
|
|
183
|
+
} catch (e) {
|
|
184
|
+
console.debug("SearchOverlayBody: animation.presence.end failed", e);
|
|
185
|
+
}
|
|
186
|
+
}, [isPresent, searchActorRef, safeToRemove]);
|
|
187
|
+
return /* @__PURE__ */ jsx(Box, { ref, display: "contents", children: /* @__PURE__ */ jsx(SearchPanelContent, {}) });
|
|
188
|
+
});
|
|
196
189
|
|
|
197
|
-
export { Search };
|
|
190
|
+
export { Search, SearchPanelContent, bodyCss, dialogCss, scrollAreaCss };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Fqn, ViewId } from '@likec4/core/types';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
export interface SearchContextValue {
|
|
4
|
+
searchValue: string;
|
|
5
|
+
setSearchValue: (value: string) => void;
|
|
6
|
+
normalizedSearch: string;
|
|
7
|
+
navigateTo: (viewId: ViewId, focusOnElement?: Fqn) => void;
|
|
8
|
+
openPickView: (elementFqn: Fqn) => void;
|
|
9
|
+
closePickView: () => void;
|
|
10
|
+
pickViewFor: Fqn | null;
|
|
11
|
+
close: () => void;
|
|
12
|
+
currentViewId: string | null;
|
|
13
|
+
openedWithSearch: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const SearchContext: Context<SearchContextValue | null>;
|
|
16
|
+
export declare function useSearchContext(): SearchContextValue;
|
|
17
|
+
/**
|
|
18
|
+
* Normalize a raw search string for comparison.
|
|
19
|
+
* Extracted as a pure function so both XState and standalone adapters can reuse it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeSearch(value: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const SearchContext = createContext(null);
|
|
4
|
+
function useSearchContext() {
|
|
5
|
+
const ctx = useContext(SearchContext);
|
|
6
|
+
if (!ctx) {
|
|
7
|
+
throw new Error("useSearchContext must be used within a SearchContext.Provider");
|
|
8
|
+
}
|
|
9
|
+
return ctx;
|
|
10
|
+
}
|
|
11
|
+
function normalizeSearch(value) {
|
|
12
|
+
if (value === "") return value;
|
|
13
|
+
const v = value.trim().toLowerCase();
|
|
14
|
+
if (v.startsWith("#") && v.length <= 2) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
return v.length > 1 ? v : "";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { SearchContext, normalizeSearch, useSearchContext };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useSelector } from '@xstate/react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
5
|
+
import { useCurrentViewId } from '../hooks/useCurrentView.js';
|
|
6
|
+
import { normalizeSearch, SearchContext } from './SearchContext.js';
|
|
7
|
+
|
|
8
|
+
const selectSearchValue = (s) => s.context.searchValue;
|
|
9
|
+
const selectPickViewFor = (s) => s.context.pickViewFor;
|
|
10
|
+
const selectOpenedWithSearch = (s) => s.context.openedWithSearch;
|
|
11
|
+
function XStateSearchAdapter({
|
|
12
|
+
searchActorRef,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
const searchValue = useSelector(searchActorRef, selectSearchValue);
|
|
16
|
+
const pickViewFor = useSelector(searchActorRef, selectPickViewFor);
|
|
17
|
+
const openedWithSearch = useSelector(searchActorRef, selectOpenedWithSearch);
|
|
18
|
+
const currentViewId = useCurrentViewId();
|
|
19
|
+
const setSearchValue = useCallbackRef((search) => {
|
|
20
|
+
searchActorRef.send({ type: "change.search", search });
|
|
21
|
+
});
|
|
22
|
+
const navigateTo = useCallbackRef((viewId, focusOnElement) => {
|
|
23
|
+
searchActorRef.send({
|
|
24
|
+
type: "navigate.to",
|
|
25
|
+
viewId,
|
|
26
|
+
focusOnElement
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const openPickView = useCallbackRef((elementFqn) => {
|
|
30
|
+
searchActorRef.send({ type: "pickview.open", elementFqn });
|
|
31
|
+
});
|
|
32
|
+
const closePickView = useCallbackRef(() => {
|
|
33
|
+
searchActorRef.send({ type: "pickview.close" });
|
|
34
|
+
});
|
|
35
|
+
const close = useCallbackRef(() => {
|
|
36
|
+
searchActorRef.send({ type: "close" });
|
|
37
|
+
});
|
|
38
|
+
const value = useMemo(() => ({
|
|
39
|
+
searchValue,
|
|
40
|
+
setSearchValue,
|
|
41
|
+
normalizedSearch: normalizeSearch(searchValue),
|
|
42
|
+
navigateTo,
|
|
43
|
+
openPickView,
|
|
44
|
+
closePickView,
|
|
45
|
+
pickViewFor,
|
|
46
|
+
close,
|
|
47
|
+
currentViewId,
|
|
48
|
+
openedWithSearch
|
|
49
|
+
}), [
|
|
50
|
+
searchValue,
|
|
51
|
+
pickViewFor,
|
|
52
|
+
currentViewId,
|
|
53
|
+
openedWithSearch,
|
|
54
|
+
// stable refs from useCallbackRef — listed for exhaustive-deps lint rule
|
|
55
|
+
setSearchValue,
|
|
56
|
+
navigateTo,
|
|
57
|
+
openPickView,
|
|
58
|
+
closePickView,
|
|
59
|
+
close
|
|
60
|
+
]);
|
|
61
|
+
return /* @__PURE__ */ jsx(SearchContext.Provider, { value, children });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { XStateSearchAdapter };
|
|
@@ -9,12 +9,13 @@ import { pipe, filter, hasAtLeast, reduce, only, first, last } from 'remeda';
|
|
|
9
9
|
import { IconOrShapeRenderer } from '../../context/IconRenderer.js';
|
|
10
10
|
import { useCallbackRef } from '../../hooks/useCallbackRef.js';
|
|
11
11
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
12
|
-
import { useNormalizedSearch
|
|
12
|
+
import { useNormalizedSearch } from '../hooks.js';
|
|
13
|
+
import { useSearchContext } from '../SearchContext.js';
|
|
13
14
|
import { focusable, buttonsva } from './_shared.css.js';
|
|
14
15
|
import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
|
|
15
16
|
import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
16
17
|
import { NothingFound } from './ViewsColum.js';
|
|
17
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
18
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
18
19
|
|
|
19
20
|
function useElementsColumnData() {
|
|
20
21
|
const model = useLikeC4Model();
|
|
@@ -279,7 +280,7 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
|
|
|
279
280
|
] });
|
|
280
281
|
}
|
|
281
282
|
function useHandleElementSelection() {
|
|
282
|
-
const
|
|
283
|
+
const ctx = useSearchContext();
|
|
283
284
|
return useCallbackRef((element) => {
|
|
284
285
|
const views = [...element.views()];
|
|
285
286
|
if (views.length === 0) {
|
|
@@ -288,14 +289,10 @@ function useHandleElementSelection() {
|
|
|
288
289
|
const elementFqn = element.id;
|
|
289
290
|
const onlyOneViewId = only(views)?.id;
|
|
290
291
|
if (!onlyOneViewId) {
|
|
291
|
-
|
|
292
|
+
ctx.openPickView(elementFqn);
|
|
292
293
|
return;
|
|
293
294
|
}
|
|
294
|
-
|
|
295
|
-
type: "navigate.to",
|
|
296
|
-
viewId: onlyOneViewId,
|
|
297
|
-
focusOnElement: elementFqn
|
|
298
|
-
});
|
|
295
|
+
ctx.navigateTo(onlyOneViewId, elementFqn);
|
|
299
296
|
});
|
|
300
297
|
}
|
|
301
298
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Fqn } from '@likec4/core/types';
|
|
2
|
-
|
|
3
|
-
export declare function PickView({ searchActorRef, elementFqn, }: {
|
|
4
|
-
searchActorRef: SearchActorRef;
|
|
2
|
+
export declare function PickView({ elementFqn, }: {
|
|
5
3
|
elementFqn: Fqn;
|
|
6
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,17 +2,17 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { FocusTrap, Group, Title, ActionIcon, ScrollAreaAutosize, Stack } from '@mantine/core';
|
|
3
3
|
import { useWindowEvent, useCallbackRef } from '@mantine/hooks';
|
|
4
4
|
import * as m from 'motion/react-m';
|
|
5
|
-
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
6
5
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
6
|
+
import { useSearchContext } from '../SearchContext.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.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
10
10
|
|
|
11
11
|
function PickView({
|
|
12
|
-
searchActorRef,
|
|
13
12
|
elementFqn
|
|
14
13
|
}) {
|
|
15
|
-
const
|
|
14
|
+
const ctx = useSearchContext();
|
|
15
|
+
const currentViewId = ctx.currentViewId ?? "";
|
|
16
16
|
const element = useLikeC4Model().element(elementFqn);
|
|
17
17
|
const scoped = [];
|
|
18
18
|
const others = [];
|
|
@@ -24,7 +24,7 @@ function PickView({
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const closePickView = () => {
|
|
27
|
-
|
|
27
|
+
ctx.closePickView();
|
|
28
28
|
};
|
|
29
29
|
useWindowEvent(
|
|
30
30
|
"keydown",
|
|
@@ -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.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
11
11
|
|
|
12
12
|
function SearchByTags() {
|
|
13
13
|
const ref = useRef(null);
|
|
@@ -4,21 +4,21 @@ import { useFocusWithin, useWindowEvent, useMergedRef } from '@mantine/hooks';
|
|
|
4
4
|
import { memo, useRef } from 'react';
|
|
5
5
|
import { keys } from 'remeda';
|
|
6
6
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
7
|
-
import {
|
|
7
|
+
import { useSearchContext } from '../SearchContext.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.40.0_react@19.2.4/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;
|
|
14
14
|
}
|
|
15
15
|
const SEARCH_PREFIXES = ["#", "kind:"];
|
|
16
16
|
const LikeC4SearchInput = memo(() => {
|
|
17
|
-
const
|
|
17
|
+
const searchCtx = useSearchContext();
|
|
18
18
|
const likec4model = useLikeC4Model();
|
|
19
19
|
const inputRef = useRef(null);
|
|
20
20
|
const { ref, focused } = useFocusWithin();
|
|
21
|
-
const
|
|
21
|
+
const { searchValue: search, setSearchValue: setSearch } = searchCtx;
|
|
22
22
|
const combobox = useCombobox({
|
|
23
23
|
scrollBehavior: "smooth",
|
|
24
24
|
loop: false
|
|
@@ -129,9 +129,8 @@ const LikeC4SearchInput = memo(() => {
|
|
|
129
129
|
{
|
|
130
130
|
onClick: (e) => {
|
|
131
131
|
e.stopPropagation();
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
searchActorRef.send({ type: "close" });
|
|
132
|
+
if (search === "" || search === searchCtx.openedWithSearch) {
|
|
133
|
+
searchCtx.close();
|
|
135
134
|
} else {
|
|
136
135
|
setSearch("");
|
|
137
136
|
}
|
|
@@ -6,18 +6,18 @@ import { Stack, VisuallyHidden, UnstyledButton, ThemeIcon, Group, Highlight, Bad
|
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { memo, useRef, useMemo } from 'react';
|
|
8
8
|
import { first } from 'remeda';
|
|
9
|
-
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
10
9
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
11
|
-
import { useNormalizedSearch
|
|
10
|
+
import { useNormalizedSearch } from '../hooks.js';
|
|
11
|
+
import { useSearchContext } from '../SearchContext.js';
|
|
12
12
|
import { emptyBoX, focusable, buttonsva } from './_shared.css.js';
|
|
13
13
|
import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
14
14
|
import { viewButton } from './ViewsColumn.css.js';
|
|
15
|
-
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
16
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.
|
|
15
|
+
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
|
|
16
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
17
17
|
|
|
18
18
|
const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
|
|
19
19
|
const useFoundViews = () => {
|
|
20
|
-
const currentViewId =
|
|
20
|
+
const { currentViewId } = useSearchContext();
|
|
21
21
|
const likec4model = useLikeC4Model();
|
|
22
22
|
const search = useNormalizedSearch();
|
|
23
23
|
return useMemo(() => {
|
|
@@ -79,7 +79,7 @@ const ViewsColumn = memo(() => {
|
|
|
79
79
|
ViewButton,
|
|
80
80
|
{
|
|
81
81
|
view,
|
|
82
|
-
currentViewId,
|
|
82
|
+
currentViewId: currentViewId ?? "",
|
|
83
83
|
search,
|
|
84
84
|
tabIndex: i === 0 ? 0 : -1
|
|
85
85
|
}
|
|
@@ -90,15 +90,11 @@ const ViewsColumn = memo(() => {
|
|
|
90
90
|
});
|
|
91
91
|
const btn = buttonsva();
|
|
92
92
|
function ViewButton({ className, view, loop = false, search, focusOnElement, currentViewId, ...props }) {
|
|
93
|
-
const
|
|
93
|
+
const ctx = useSearchContext();
|
|
94
94
|
const nextViewId = view.id;
|
|
95
95
|
const isCurrentView = nextViewId === currentViewId;
|
|
96
96
|
const navigate = () => {
|
|
97
|
-
|
|
98
|
-
type: "navigate.to",
|
|
99
|
-
viewId: nextViewId,
|
|
100
|
-
focusOnElement
|
|
101
|
-
});
|
|
97
|
+
ctx.navigateTo(nextViewId, focusOnElement);
|
|
102
98
|
};
|
|
103
99
|
return /* @__PURE__ */ jsxs(
|
|
104
100
|
UnstyledButton,
|
package/dist/search/hooks.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { SearchActorRef } from './searchActor';
|
|
2
|
-
export declare function useSearchActor(): SearchActorRef;
|
|
3
1
|
export declare function useSearch(): [string, (search: string) => void];
|
|
4
2
|
export declare function useNormalizedSearch(): string;
|
|
5
3
|
export declare function useUpdateSearch(): (search: string) => void;
|