@likec4/diagram 1.48.0 → 1.50.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/README.md +7 -9
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +77 -79
- package/dist/LikeC4Diagram.props.d.ts +9 -1
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +4 -4
- package/dist/LikeC4Styles.d.ts +2 -1
- package/dist/LikeC4View.d.ts +14 -1
- package/dist/LikeC4View.js +31 -18
- package/dist/ReactLikeC4.d.ts +2 -1
- package/dist/ReactLikeC4.js +3 -1
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +3 -3
- package/dist/adhoc-editor/hooks.js +5 -23
- package/dist/adhoc-editor/index.d.ts +1 -1
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
- package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
- package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
- package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
- package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
- package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
- package/dist/base/const.d.ts +1 -0
- package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
- package/dist/base-primitives/edge/EdgeMarkers.js +3 -3
- package/dist/base-primitives/element/ElementActionButtons.js +35 -10
- package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
- package/dist/base-primitives/element/ElementShape.d.ts +4 -4
- package/dist/base-primitives/element/ElementShape.js +71 -8
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.js +2 -4
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -16
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.js +10 -1
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +5 -3
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +5 -4
- package/dist/context/IconRenderer.js +51 -24
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorProvider.js +1 -1
- package/dist/editor/applyChangesToManualLayout.js +7 -7
- package/dist/editor/editorActor.actions.js +20 -20
- package/dist/editor/editorActor.setup.js +1 -1
- package/dist/editor/editorActor.states.js +0 -9
- package/dist/editor/useEditorActorLogic.d.ts +1 -2
- package/dist/editor/useEditorActorLogic.js +8 -11
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +2 -6
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +8 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +5 -7
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
- package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
- package/dist/likec4diagram/state/machine.actions.js +78 -21
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
- package/dist/likec4diagram/state/machine.js +4 -1
- package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
- package/dist/likec4diagram/state/machine.state.ready.js +11 -3
- package/dist/likec4diagram/state/utils.d.ts +2 -1
- package/dist/likec4diagram/state/utils.js +1 -1
- package/dist/likec4diagram/types.d.ts +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +6 -29
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +125 -86
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
- package/dist/navigationpanel/NavigationPanel.js +2 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/controls/DetailsControls.js +4 -4
- package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
- package/dist/navigationpanel/controls/LogoButton.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 +3 -3
- 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 +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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.0_react@19.2.4 → @tabler_icons-react@3.36.1_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 +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +44 -45
- package/dist/overlays/element-details/MetadataValue.js +7 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actorContext.d.ts +1 -1
- package/dist/overlays/overlaysActor.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
- 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.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/search/Search.d.ts +2 -1
- package/dist/search/Search.js +108 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +93 -59
- package/dist/search/components/PickView.js +8 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +11 -11
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.js +4 -1
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +3 -2
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +1 -1
- package/dist/utils/xyflow.d.ts +10 -5
- package/dist/utils/xyflow.js +24 -22
- package/package.json +33 -32
- package/panda.buildinfo.json +176 -87
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -52554
- package/bundle/package.json +0 -4
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
- package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
- package/dist/adhoc-editor/actor.d.ts +0 -131
- package/dist/adhoc-editor/actor.editor.js +0 -96
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
|
@@ -1,80 +1,110 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { ifilter,
|
|
2
|
+
import { ifilter, imap, toArray, isAncestor, stringHash, nameFromFqn } from '@likec4/core/utils';
|
|
3
3
|
import { cx } from '@likec4/styles/css';
|
|
4
|
-
import {
|
|
4
|
+
import { Txt } from '@likec4/styles/jsx';
|
|
5
|
+
import { useTree, Tree, ActionIcon, UnstyledButton, Box, Group, Highlight, Tooltip } from '@mantine/core';
|
|
5
6
|
import * as m from 'motion/react-m';
|
|
6
7
|
import { memo, useMemo, useEffect } from 'react';
|
|
7
|
-
import {
|
|
8
|
+
import { pipe, filter, hasAtLeast, reduce, only, first, last } from 'remeda';
|
|
8
9
|
import { IconOrShapeRenderer } from '../../context/IconRenderer.js';
|
|
9
10
|
import { useCallbackRef } from '../../hooks/useCallbackRef.js';
|
|
10
|
-
import '@xstate/react';
|
|
11
|
-
import 'fast-equals';
|
|
12
|
-
import { useDiagram } from '../../hooks/safeContext.js';
|
|
13
|
-
import { sortByLabel } from '../../hooks/useLikeC4ElementsTree.js';
|
|
14
11
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
15
12
|
import { useNormalizedSearch, useSearchActor } from '../hooks.js';
|
|
16
13
|
import { focusable, buttonsva } from './_shared.css.js';
|
|
17
14
|
import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
|
|
18
|
-
import {
|
|
15
|
+
import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
19
16
|
import { NothingFound } from './ViewsColum.js';
|
|
20
|
-
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
17
|
+
import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
const ElementsColumn = memo(() => {
|
|
19
|
+
function useElementsColumnData() {
|
|
24
20
|
const model = useLikeC4Model();
|
|
21
|
+
const allElements = useMemo(() => pipe(
|
|
22
|
+
model.elements(),
|
|
23
|
+
ifilter((i) => !i.imported),
|
|
24
|
+
imap((element) => ({
|
|
25
|
+
label: element.title,
|
|
26
|
+
value: element.id,
|
|
27
|
+
element,
|
|
28
|
+
// searchTerms,
|
|
29
|
+
viewsCount: [...element.views()].length,
|
|
30
|
+
children: []
|
|
31
|
+
})),
|
|
32
|
+
toArray()
|
|
33
|
+
), [model]);
|
|
25
34
|
const search = useNormalizedSearch();
|
|
26
|
-
|
|
35
|
+
return useMemo(() => {
|
|
27
36
|
const searchTerms = search.split(".");
|
|
28
37
|
let elements;
|
|
29
|
-
if (
|
|
30
|
-
elements =
|
|
31
|
-
} else {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
if (search === "" || search === "kind:") {
|
|
39
|
+
elements = allElements;
|
|
40
|
+
} else if (search.startsWith("kind:")) {
|
|
41
|
+
const searchKind = search.slice(5);
|
|
42
|
+
elements = filter(allElements, ({ element }) => {
|
|
43
|
+
return element.kind.toLocaleLowerCase()[searchKind.length > 4 ? "startsWith" : "includes"](searchKind);
|
|
44
|
+
});
|
|
45
|
+
} else if (search.startsWith("#")) {
|
|
46
|
+
const searchTag = search.slice(1);
|
|
47
|
+
elements = filter(allElements, ({ element }) => {
|
|
48
|
+
return element.tags.some((tag) => tag.toLocaleLowerCase().includes(searchTag));
|
|
49
|
+
});
|
|
50
|
+
} else if (hasAtLeast(searchTerms, 2)) {
|
|
51
|
+
const satisfies = (element) => {
|
|
52
|
+
const fqnParts = element.id.toLocaleLowerCase().split(".");
|
|
53
|
+
if (fqnParts.length < searchTerms.length) {
|
|
54
|
+
return false;
|
|
35
55
|
}
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
let lastMatchIndex = 0;
|
|
57
|
+
for (let i = 0; i < fqnParts.length; i++) {
|
|
58
|
+
if (fqnParts[i].includes(searchTerms[lastMatchIndex])) {
|
|
59
|
+
lastMatchIndex++;
|
|
60
|
+
if (lastMatchIndex === searchTerms.length) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
38
65
|
}
|
|
39
|
-
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
elements = filter(allElements, ({ element }) => satisfies(element));
|
|
69
|
+
} else {
|
|
70
|
+
elements = filter(allElements, ({ element }) => {
|
|
71
|
+
const value = element.title + " " + element.name + " " + (element.summary.md || "");
|
|
40
72
|
return value.toLocaleLowerCase().includes(search);
|
|
41
73
|
});
|
|
42
74
|
}
|
|
43
75
|
const byid = {};
|
|
44
|
-
const { all, roots } = pipe(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const treeItem = {
|
|
49
|
-
label: element.title,
|
|
50
|
-
value: element.id,
|
|
51
|
-
element,
|
|
52
|
-
searchTerms,
|
|
53
|
-
children: []
|
|
54
|
-
};
|
|
76
|
+
const { hash, all, roots } = pipe(
|
|
77
|
+
elements,
|
|
78
|
+
reduce((acc, treeItem) => {
|
|
79
|
+
treeItem.children = [];
|
|
55
80
|
byid[treeItem.value] = treeItem;
|
|
56
81
|
const parent = acc.all.findLast((root) => isAncestor(root.value, treeItem.value));
|
|
57
82
|
if (parent) {
|
|
58
83
|
parent.children.push(treeItem);
|
|
59
|
-
if (parent.children.length > 1) {
|
|
60
|
-
parent.children.sort(sortByLabel);
|
|
61
|
-
}
|
|
62
84
|
} else {
|
|
63
85
|
acc.roots.push(treeItem);
|
|
64
86
|
}
|
|
65
87
|
acc.all.push(treeItem);
|
|
88
|
+
acc.hash = stringHash(acc.hash + treeItem.value);
|
|
66
89
|
return acc;
|
|
67
90
|
}, {
|
|
91
|
+
hash: "empty",
|
|
68
92
|
all: [],
|
|
69
93
|
roots: []
|
|
70
94
|
})
|
|
71
95
|
);
|
|
72
96
|
return {
|
|
97
|
+
hash,
|
|
73
98
|
all,
|
|
74
99
|
byid,
|
|
75
|
-
roots
|
|
100
|
+
roots,
|
|
101
|
+
searchTerms: hasAtLeast(searchTerms, 1) ? searchTerms : [search]
|
|
76
102
|
};
|
|
77
|
-
}, [
|
|
103
|
+
}, [allElements, search]);
|
|
104
|
+
}
|
|
105
|
+
const btn = buttonsva();
|
|
106
|
+
const ElementsColumn = memo(() => {
|
|
107
|
+
const data = useElementsColumnData();
|
|
78
108
|
const handleClick = useHandleElementSelection();
|
|
79
109
|
if (data.all.length === 0) {
|
|
80
110
|
return /* @__PURE__ */ jsx(NothingFound, {});
|
|
@@ -85,8 +115,10 @@ const setHoveredNode = () => {
|
|
|
85
115
|
};
|
|
86
116
|
function ElementsTree({
|
|
87
117
|
data: {
|
|
118
|
+
searchTerms,
|
|
88
119
|
all,
|
|
89
120
|
byid,
|
|
121
|
+
hash,
|
|
90
122
|
roots
|
|
91
123
|
},
|
|
92
124
|
handleClick
|
|
@@ -102,7 +134,7 @@ function ElementsTree({
|
|
|
102
134
|
tree.expand(nd.value);
|
|
103
135
|
}
|
|
104
136
|
}
|
|
105
|
-
}, [
|
|
137
|
+
}, [hash]);
|
|
106
138
|
const onKeyDownCapture = useCallbackRef((e) => {
|
|
107
139
|
const target = e.target;
|
|
108
140
|
const id = target.getAttribute("data-value");
|
|
@@ -154,12 +186,12 @@ function ElementsTree({
|
|
|
154
186
|
subtree: treeSubtree
|
|
155
187
|
},
|
|
156
188
|
onKeyDownCapture,
|
|
157
|
-
renderNode: (p) => /* @__PURE__ */ jsx(ElementTreeNode, { ...p, handleClick })
|
|
189
|
+
renderNode: (p) => /* @__PURE__ */ jsx(ElementTreeNode, { ...p, searchTerms, handleClick })
|
|
158
190
|
}
|
|
159
191
|
);
|
|
160
192
|
}
|
|
161
|
-
function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClick }) {
|
|
162
|
-
const { element,
|
|
193
|
+
function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClick, searchTerms }) {
|
|
194
|
+
const { label, element, viewsCount } = node;
|
|
163
195
|
const elementIcon$1 = IconOrShapeRenderer({
|
|
164
196
|
element: {
|
|
165
197
|
id: element.id,
|
|
@@ -169,7 +201,6 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
|
|
|
169
201
|
},
|
|
170
202
|
className: cx(btn.icon, elementIcon)
|
|
171
203
|
});
|
|
172
|
-
const views = [...element.views()];
|
|
173
204
|
const key = `@tree.${node.value}`;
|
|
174
205
|
return /* @__PURE__ */ jsxs(m.div, { layoutId: key, ...elementProps, children: [
|
|
175
206
|
/* @__PURE__ */ jsx(
|
|
@@ -203,7 +234,7 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
|
|
|
203
234
|
tabIndex: -1,
|
|
204
235
|
"data-value": element.id,
|
|
205
236
|
className: cx(btn.root, "group", "likec4-element-button"),
|
|
206
|
-
...
|
|
237
|
+
...viewsCount > 0 && {
|
|
207
238
|
onClick: (e) => {
|
|
208
239
|
if (!hasChildren || expanded) {
|
|
209
240
|
e.stopPropagation();
|
|
@@ -215,23 +246,32 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
|
|
|
215
246
|
elementIcon$1,
|
|
216
247
|
/* @__PURE__ */ jsxs(Box, { style: { flexGrow: 1 }, children: [
|
|
217
248
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", className: elementTitleAndId, children: [
|
|
218
|
-
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: searchTerms, className: btn.title, children:
|
|
249
|
+
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: searchTerms, className: btn.title, children: label }),
|
|
219
250
|
/* @__PURE__ */ jsx(Tooltip, { label: element.id, withinPortal: false, fz: "xs", disabled: !element.id.includes("."), children: /* @__PURE__ */ jsx(
|
|
220
251
|
Highlight,
|
|
221
252
|
{
|
|
222
253
|
component: "div",
|
|
223
|
-
highlight: searchTerms,
|
|
254
|
+
highlight: last(searchTerms),
|
|
224
255
|
className: cx(elementId, btn.descriptionColor),
|
|
225
256
|
children: nameFromFqn(element.id)
|
|
226
257
|
}
|
|
227
258
|
) })
|
|
228
259
|
] }),
|
|
229
|
-
/* @__PURE__ */ jsx(
|
|
260
|
+
/* @__PURE__ */ jsx(
|
|
261
|
+
Highlight,
|
|
262
|
+
{
|
|
263
|
+
component: "div",
|
|
264
|
+
highlight: element.summary.nonEmpty ? searchTerms : [],
|
|
265
|
+
className: btn.description,
|
|
266
|
+
lineClamp: 1,
|
|
267
|
+
children: element.summary.nonEmpty ? element.summary.text : "No description"
|
|
268
|
+
}
|
|
269
|
+
)
|
|
230
270
|
] }),
|
|
231
|
-
/* @__PURE__ */ jsx(
|
|
232
|
-
|
|
271
|
+
/* @__PURE__ */ jsx(Txt, { as: "div", className: cx(elementViewsCount, btn.descriptionColor), size: "xs", children: viewsCount === 0 ? "No views" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
272
|
+
viewsCount,
|
|
233
273
|
" view",
|
|
234
|
-
|
|
274
|
+
viewsCount > 1 ? "s" : ""
|
|
235
275
|
] }) })
|
|
236
276
|
]
|
|
237
277
|
}
|
|
@@ -239,7 +279,6 @@ function ElementTreeNode({ node, elementProps, hasChildren, expanded, handleClic
|
|
|
239
279
|
] });
|
|
240
280
|
}
|
|
241
281
|
function useHandleElementSelection() {
|
|
242
|
-
const diagram = useDiagram();
|
|
243
282
|
const searchActorRef = useSearchActor();
|
|
244
283
|
return useCallbackRef((element) => {
|
|
245
284
|
const views = [...element.views()];
|
|
@@ -252,16 +291,11 @@ function useHandleElementSelection() {
|
|
|
252
291
|
searchActorRef.send({ type: "pickview.open", elementFqn });
|
|
253
292
|
return;
|
|
254
293
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
diagram.focusOnElement(elementFqn);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
diagram.navigateTo(onlyOneViewId, void 0, elementFqn);
|
|
294
|
+
searchActorRef.send({
|
|
295
|
+
type: "navigate.to",
|
|
296
|
+
viewId: onlyOneViewId,
|
|
297
|
+
focusOnElement: elementFqn
|
|
263
298
|
});
|
|
264
|
-
return;
|
|
265
299
|
});
|
|
266
300
|
}
|
|
267
301
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { FocusTrap, Group, Title, ActionIcon, ScrollAreaAutosize, Stack } from '@mantine/core';
|
|
3
|
-
import { useWindowEvent } from '@mantine/hooks';
|
|
3
|
+
import { useWindowEvent, useCallbackRef } from '@mantine/hooks';
|
|
4
4
|
import * as m from 'motion/react-m';
|
|
5
|
+
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
5
6
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
6
7
|
import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
|
|
7
8
|
import { ViewButton } from './ViewsColum.js';
|
|
8
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
9
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
9
10
|
|
|
10
11
|
function PickView({
|
|
11
12
|
searchActorRef,
|
|
12
13
|
elementFqn
|
|
13
14
|
}) {
|
|
15
|
+
const currentViewId = useCurrentViewId();
|
|
14
16
|
const element = useLikeC4Model().element(elementFqn);
|
|
15
17
|
const scoped = [];
|
|
16
18
|
const others = [];
|
|
@@ -26,7 +28,7 @@ function PickView({
|
|
|
26
28
|
};
|
|
27
29
|
useWindowEvent(
|
|
28
30
|
"keydown",
|
|
29
|
-
(event) => {
|
|
31
|
+
useCallbackRef((event) => {
|
|
30
32
|
try {
|
|
31
33
|
if (event.key === "Escape") {
|
|
32
34
|
event.stopPropagation();
|
|
@@ -36,7 +38,7 @@ function PickView({
|
|
|
36
38
|
} catch (e) {
|
|
37
39
|
console.warn(e);
|
|
38
40
|
}
|
|
39
|
-
},
|
|
41
|
+
}),
|
|
40
42
|
{
|
|
41
43
|
capture: true
|
|
42
44
|
}
|
|
@@ -101,6 +103,7 @@ function PickView({
|
|
|
101
103
|
ViewButton,
|
|
102
104
|
{
|
|
103
105
|
view,
|
|
106
|
+
currentViewId,
|
|
104
107
|
search: "",
|
|
105
108
|
loop: true,
|
|
106
109
|
focusOnElement: elementFqn,
|
|
@@ -117,6 +120,7 @@ function PickView({
|
|
|
117
120
|
ViewButton,
|
|
118
121
|
{
|
|
119
122
|
view,
|
|
123
|
+
currentViewId,
|
|
120
124
|
search: "",
|
|
121
125
|
loop: true,
|
|
122
126
|
focusOnElement: elementFqn,
|
|
@@ -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.36.
|
|
10
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_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);
|
|
@@ -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.36.
|
|
10
|
+
import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_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;
|
|
@@ -56,7 +56,7 @@ const LikeC4SearchInput = memo(() => {
|
|
|
56
56
|
/* @__PURE__ */ jsx(ComboboxEmpty, { children: "No tags found" }, "empty-tags")
|
|
57
57
|
];
|
|
58
58
|
} else {
|
|
59
|
-
isExactMatch =
|
|
59
|
+
isExactMatch = alloptions.some((tag) => tag.toLocaleLowerCase() === searchTag);
|
|
60
60
|
options = alloptions.map((tag) => /* @__PURE__ */ jsxs(ComboboxOption, { value: `#${tag}`, children: [
|
|
61
61
|
/* @__PURE__ */ jsx(Text, { component: "span", opacity: 0.5, mr: 1, fz: "sm", children: "#" }),
|
|
62
62
|
tag
|
|
@@ -4,8 +4,9 @@ import { ElementProps, UnstyledButtonProps } from '@mantine/core';
|
|
|
4
4
|
import { MemoExoticComponent } from 'react';
|
|
5
5
|
export declare const NothingFound: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const ViewsColumn: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
-
export declare function ViewButton({ className, view, loop, search, focusOnElement, ...props }: {
|
|
7
|
+
export declare function ViewButton({ className, view, loop, search, focusOnElement, currentViewId, ...props }: {
|
|
8
8
|
view: LikeC4Model.View;
|
|
9
|
+
currentViewId: string;
|
|
9
10
|
search: string;
|
|
10
11
|
loop?: boolean;
|
|
11
12
|
focusOnElement?: Fqn;
|
|
@@ -1,39 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { preferSummary } from '@likec4/core/types';
|
|
2
3
|
import { cx } from '@likec4/styles/css';
|
|
3
4
|
import { Box } from '@likec4/styles/jsx';
|
|
4
|
-
import { Stack, VisuallyHidden, UnstyledButton,
|
|
5
|
+
import { Stack, VisuallyHidden, UnstyledButton, ThemeIcon, Group, Highlight, Badge, createScopedKeydownHandler } from '@mantine/core';
|
|
5
6
|
import * as m from 'motion/react-m';
|
|
6
|
-
import { memo, useRef } from 'react';
|
|
7
|
+
import { memo, useRef, useMemo } from 'react';
|
|
7
8
|
import { first } from 'remeda';
|
|
8
9
|
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
9
|
-
import '@xstate/react';
|
|
10
|
-
import 'fast-equals';
|
|
11
|
-
import { useDiagram } from '../../hooks/safeContext.js';
|
|
12
10
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
13
11
|
import { useNormalizedSearch, useSearchActor } from '../hooks.js';
|
|
14
|
-
import { emptyBoX,
|
|
15
|
-
import { moveFocusToSearchInput, queryAllFocusable, centerY
|
|
12
|
+
import { emptyBoX, focusable, buttonsva } from './_shared.css.js';
|
|
13
|
+
import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
16
14
|
import { viewButton } from './ViewsColumn.css.js';
|
|
17
|
-
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
18
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
15
|
+
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_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.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
19
17
|
|
|
20
18
|
const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
|
|
19
|
+
const useFoundViews = () => {
|
|
20
|
+
const currentViewId = useCurrentViewId();
|
|
21
|
+
const likec4model = useLikeC4Model();
|
|
22
|
+
const search = useNormalizedSearch();
|
|
23
|
+
return useMemo(() => {
|
|
24
|
+
let views = [...likec4model.views()];
|
|
25
|
+
if (search) {
|
|
26
|
+
if (search.startsWith("kind:")) {
|
|
27
|
+
views = [];
|
|
28
|
+
} else {
|
|
29
|
+
const searchTag = search.startsWith("#") ? search.slice(1) : null;
|
|
30
|
+
views = views.filter((view) => {
|
|
31
|
+
if (searchTag) {
|
|
32
|
+
return view.tags.some((tag) => tag.toLocaleLowerCase().includes(searchTag));
|
|
33
|
+
}
|
|
34
|
+
const desc = preferSummary(view.$view)?.md || " ";
|
|
35
|
+
return `${view.id} ${view.title} ${desc}`.toLocaleLowerCase().includes(search);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [views, search, currentViewId];
|
|
40
|
+
}, [likec4model, search, currentViewId]);
|
|
41
|
+
};
|
|
21
42
|
const ViewsColumn = memo(() => {
|
|
22
43
|
const ref = useRef(null);
|
|
23
|
-
|
|
24
|
-
let search = useNormalizedSearch();
|
|
25
|
-
if (search) {
|
|
26
|
-
if (search.startsWith("kind:")) {
|
|
27
|
-
views = [];
|
|
28
|
-
} else {
|
|
29
|
-
views = views.filter((view) => {
|
|
30
|
-
if (search.startsWith("#")) {
|
|
31
|
-
return view.tags.some((tag) => tag.toLocaleLowerCase().includes(search.slice(1)));
|
|
32
|
-
}
|
|
33
|
-
return `${view.id} ${view.title} ${view.description.text}`.toLocaleLowerCase().includes(search);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
44
|
+
const [views, search, currentViewId] = useFoundViews();
|
|
37
45
|
return /* @__PURE__ */ jsxs(
|
|
38
46
|
Stack,
|
|
39
47
|
{
|
|
@@ -71,6 +79,7 @@ const ViewsColumn = memo(() => {
|
|
|
71
79
|
ViewButton,
|
|
72
80
|
{
|
|
73
81
|
view,
|
|
82
|
+
currentViewId,
|
|
74
83
|
search,
|
|
75
84
|
tabIndex: i === 0 ? 0 : -1
|
|
76
85
|
}
|
|
@@ -80,20 +89,15 @@ const ViewsColumn = memo(() => {
|
|
|
80
89
|
);
|
|
81
90
|
});
|
|
82
91
|
const btn = buttonsva();
|
|
83
|
-
function ViewButton({ className, view, loop = false, search, focusOnElement, ...props }) {
|
|
92
|
+
function ViewButton({ className, view, loop = false, search, focusOnElement, currentViewId, ...props }) {
|
|
84
93
|
const searchActorRef = useSearchActor();
|
|
85
|
-
const diagram = useDiagram();
|
|
86
94
|
const nextViewId = view.id;
|
|
87
|
-
const currentViewId = useCurrentViewId();
|
|
88
95
|
const isCurrentView = nextViewId === currentViewId;
|
|
89
96
|
const navigate = () => {
|
|
90
|
-
searchActorRef.send({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
diagram.navigateTo(nextViewId, void 0, focusOnElement);
|
|
97
|
+
searchActorRef.send({
|
|
98
|
+
type: "navigate.to",
|
|
99
|
+
viewId: nextViewId,
|
|
100
|
+
focusOnElement
|
|
97
101
|
});
|
|
98
102
|
};
|
|
99
103
|
return /* @__PURE__ */ jsxs(
|
|
@@ -124,7 +128,7 @@ function ViewButton({ className, view, loop = false, search, focusOnElement, ...
|
|
|
124
128
|
/* @__PURE__ */ jsx(ThemeIcon, { variant: "transparent", className: btn.icon, children: view.isDeploymentView() ? /* @__PURE__ */ jsx(IconStack2, { stroke: 1.8 }) : /* @__PURE__ */ jsx(IconZoomScan, { stroke: 1.8 }) }),
|
|
125
129
|
/* @__PURE__ */ jsxs(Box, { style: { flexGrow: 1 }, children: [
|
|
126
130
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
|
|
127
|
-
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.
|
|
131
|
+
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.titleOrUntitled }),
|
|
128
132
|
isCurrentView && /* @__PURE__ */ jsx(Badge, { size: "xs", fz: 9, radius: "sm", children: "current" })
|
|
129
133
|
] }),
|
|
130
134
|
/* @__PURE__ */ jsx(
|
|
@@ -18,7 +18,7 @@ const viewButton = cx(
|
|
|
18
18
|
css({
|
|
19
19
|
marginTop: "1",
|
|
20
20
|
// transition: transitions.fast,
|
|
21
|
-
// color: `[var(${descriptionColor}, {colors.
|
|
21
|
+
// color: `[var(${descriptionColor}, {colors.text.dimmed})]`,
|
|
22
22
|
fontSize: "13px",
|
|
23
23
|
lineHeight: "1.4",
|
|
24
24
|
[`:where(.likec4-view-btn[data-disabled]) &`]: {
|
|
@@ -9,7 +9,7 @@ const _treenodefocus = ".mantine-Tree-node:focus > .mantine-Tree-label &";
|
|
|
9
9
|
const button = css.raw({
|
|
10
10
|
display: "flex",
|
|
11
11
|
width: "100%",
|
|
12
|
-
background: "
|
|
12
|
+
background: "body",
|
|
13
13
|
rounded: "sm",
|
|
14
14
|
padding: `[12px 8px 12px 14px]`,
|
|
15
15
|
minHeight: "60px",
|
|
@@ -17,10 +17,10 @@ const button = css.raw({
|
|
|
17
17
|
// alignItems: 'flex-start',
|
|
18
18
|
// transition: `all 50ms ${easings.inOut}`,
|
|
19
19
|
border: `1px solid`,
|
|
20
|
-
borderColor: "
|
|
20
|
+
borderColor: "default.border",
|
|
21
21
|
// [titleColor]: '{colors.mantine.colors.dark[1]}',
|
|
22
|
-
// [iconColor]: '{colors.
|
|
23
|
-
// [descriptionColor]: '{colors.
|
|
22
|
+
// [iconColor]: '{colors.text.dimmed}',
|
|
23
|
+
// [descriptionColor]: '{colors.text.dimmed}',
|
|
24
24
|
_hover: {
|
|
25
25
|
...buttonFocused,
|
|
26
26
|
borderColor: "mantine.colors.primary[9]",
|
|
@@ -52,7 +52,7 @@ const iconSize = {
|
|
|
52
52
|
};
|
|
53
53
|
const icon = css.raw({
|
|
54
54
|
color: {
|
|
55
|
-
base: "
|
|
55
|
+
base: "text.dimmed",
|
|
56
56
|
_light: "mantine.colors.gray[5]",
|
|
57
57
|
_groupHover: "mantine.colors.primary[0]",
|
|
58
58
|
_groupFocus: "mantine.colors.primary[0]"
|
|
@@ -98,23 +98,23 @@ const title = css.raw({
|
|
|
98
98
|
_light: "mantine.colors.gray[7]",
|
|
99
99
|
_groupHover: {
|
|
100
100
|
base: "mantine.colors.primary[1]",
|
|
101
|
-
_light: "
|
|
101
|
+
_light: "white"
|
|
102
102
|
},
|
|
103
103
|
_groupFocus: {
|
|
104
104
|
base: "mantine.colors.primary[1]",
|
|
105
|
-
_light: "
|
|
105
|
+
_light: "white"
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
[_treenodefocus]: {
|
|
109
109
|
color: {
|
|
110
110
|
base: "mantine.colors.primary[1]",
|
|
111
|
-
_light: "
|
|
111
|
+
_light: "white"
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
const descriptionColor = css.raw({
|
|
116
116
|
color: {
|
|
117
|
-
base: "
|
|
117
|
+
base: "text.dimmed",
|
|
118
118
|
_groupHover: {
|
|
119
119
|
base: "mantine.colors.primary[1]",
|
|
120
120
|
_light: "mantine.colors.primary[0]"
|
|
@@ -137,13 +137,13 @@ const emptyBoX = css({
|
|
|
137
137
|
width: "100%",
|
|
138
138
|
height: "100%",
|
|
139
139
|
border: `2px dashed`,
|
|
140
|
-
borderColor: "
|
|
140
|
+
borderColor: "default.border",
|
|
141
141
|
rounded: "md",
|
|
142
142
|
display: "flex",
|
|
143
143
|
justifyContent: "center",
|
|
144
144
|
alignItems: "center",
|
|
145
145
|
fontSize: "md",
|
|
146
|
-
color: "
|
|
146
|
+
color: "text.dimmed",
|
|
147
147
|
padding: "md",
|
|
148
148
|
paddingBlock: "xl"
|
|
149
149
|
});
|
|
@@ -54,8 +54,5 @@ 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, 400);
|
|
59
|
-
}
|
|
60
57
|
|
|
61
|
-
export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent
|
|
58
|
+
export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent };
|
package/dist/search/hooks.js
CHANGED
|
@@ -20,8 +20,11 @@ function useSearch() {
|
|
|
20
20
|
}
|
|
21
21
|
const selectNormalizedSearchValue = (s) => {
|
|
22
22
|
let v = selectSearchValue(s);
|
|
23
|
-
if (v === "") return
|
|
23
|
+
if (v === "") return v;
|
|
24
24
|
v = v.trim().toLowerCase();
|
|
25
|
+
if (v.startsWith("#") && v.length <= 2) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
25
28
|
return v.length > 1 ? v : "";
|
|
26
29
|
};
|
|
27
30
|
function useNormalizedSearch() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fqn } from '@likec4/core/types';
|
|
1
|
+
import { Fqn, ViewId } from '@likec4/core/types';
|
|
2
2
|
import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
|
|
3
3
|
export type SearchActorEvent = {
|
|
4
4
|
type: 'open';
|
|
@@ -11,6 +11,12 @@ export type SearchActorEvent = {
|
|
|
11
11
|
} | {
|
|
12
12
|
type: 'pickview.open';
|
|
13
13
|
elementFqn: Fqn;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'navigate.to';
|
|
16
|
+
viewId: ViewId;
|
|
17
|
+
focusOnElement?: Fqn | undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'animation.presence.end';
|
|
14
20
|
} | {
|
|
15
21
|
type: 'pickview.close';
|
|
16
22
|
};
|
|
@@ -18,8 +24,12 @@ export interface SearchContext {
|
|
|
18
24
|
openedWithSearch: string | null;
|
|
19
25
|
searchValue: string;
|
|
20
26
|
pickViewFor: Fqn | null;
|
|
27
|
+
navigateTo: {
|
|
28
|
+
viewId: ViewId;
|
|
29
|
+
focusOnElement?: Fqn | undefined;
|
|
30
|
+
} | null;
|
|
21
31
|
}
|
|
22
|
-
export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, 'inactive' | 'opened' | 'pickView', never, never, any, any, any, any> {
|
|
32
|
+
export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, 'inactive' | 'opened' | 'pickView' | 'waitAnimationEnd', never, never, any, any, any, any> {
|
|
23
33
|
}
|
|
24
34
|
export declare const searchActorLogic: SearchActorLogic;
|
|
25
35
|
export type SearchActorSnapshot = SnapshotFrom<SearchActorLogic>;
|