@likec4/diagram 1.30.0 → 1.32.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 +324 -5
- package/bundle/chunk-BvTQaUYl.js +21851 -0
- package/bundle/custom.js +65 -0
- package/bundle/index.js +19910 -40570
- package/dist/LikeC4CustomColors.d.ts +2 -7
- package/dist/LikeC4CustomColors.js +17 -6
- package/dist/LikeC4Diagram.d.ts +3 -2
- package/dist/LikeC4Diagram.js +14 -16
- package/dist/LikeC4Diagram.props.d.ts +34 -23
- package/dist/LikeC4ModelProvider.d.ts +5 -4
- package/dist/LikeC4ModelProvider.js +0 -1
- package/dist/StaticLikeC4Diagram.d.ts +3 -2
- package/dist/StaticLikeC4Diagram.js +2 -2
- package/dist/base/BaseXYFlow.js +8 -8
- package/dist/base/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +2 -1
- package/dist/base/primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base/primitives/compound/CompoundActionButton.js +2 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +7 -3
- package/dist/base/primitives/compound/CompoundNodeContainer.js +3 -2
- package/dist/base/primitives/compound/CompoundTitle.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundTitle.js +2 -1
- package/dist/base/primitives/customEdge.d.ts +2 -35
- package/dist/base/primitives/customEdge.js +2 -2
- package/dist/base/primitives/customNode.d.ts +2 -2
- package/dist/base/primitives/customNode.js +9 -2
- package/dist/base/primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeContainer.js +0 -1
- package/dist/base/primitives/edge/EdgeLabel.css.js +1 -0
- package/dist/base/primitives/edge/EdgeLabel.d.ts +3 -3
- package/dist/base/primitives/edge/EdgeLabel.js +6 -5
- package/dist/base/primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeLabelContainer.js +0 -2
- package/dist/base/primitives/edge/EdgeMarkers.d.ts +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
- package/dist/base/primitives/edge/EdgePath.js +2 -2
- package/dist/base/primitives/element/ElementActionButtons.js +10 -9
- package/dist/base/primitives/element/ElementDetailsButton.js +2 -1
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +24 -22
- package/dist/base/primitives/element/ElementNodeContainer.js +66 -68
- package/dist/base/primitives/element/ElementShape.d.ts +8 -4
- package/dist/base/primitives/element/ElementShape.js +4 -3
- package/dist/base/primitives/element/ElementTags.d.ts +14 -0
- package/dist/base/primitives/element/ElementTags.js +176 -0
- package/dist/base/primitives/element/ElementTitle.css.d.ts +1 -1
- package/dist/base/primitives/element/ElementTitle.d.ts +5 -4
- package/dist/base/primitives/element/ElementTitle.js +6 -7
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/base/types.Base.d.ts +54 -0
- package/dist/base/types.Base.js +48 -0
- package/dist/base/types.d.ts +3 -53
- package/dist/bundle/LikeC4View.d.ts +2 -1
- package/dist/bundle/LikeC4View.js +13 -8
- package/dist/bundle/LikeC4View.props.d.ts +20 -5
- package/dist/bundle/ReactLikeC4.d.ts +4 -7
- package/dist/bundle/ReactLikeC4.js +4 -4
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/custom.d.ts +1 -0
- package/dist/bundle/index.d.ts +3 -1
- package/dist/bundle/index.js +9 -0
- package/dist/bundle/styles.css.js +5 -5
- package/dist/components/ErrorFallback.d.ts +2 -0
- package/dist/components/ErrorFallback.js +29 -0
- package/dist/components/SearchControl.js +2 -2
- package/dist/context/ControlsCustomLayout.js +0 -1
- package/dist/context/DiagramEventHandlers.d.ts +6 -5
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.d.ts +3 -5
- package/dist/context/DiagramFeatures.js +11 -40
- package/dist/context/EnsureMantine.js +9 -4
- package/dist/context/FramerMotionConfig.js +0 -1
- package/dist/context/IconRenderer.js +8 -11
- package/dist/context/ReduceGraphics.js +6 -6
- package/dist/context/RootContainer.js +10 -6
- package/dist/context/TagStylesContext.d.ts +7 -0
- package/dist/context/TagStylesContext.js +85 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/components.d.ts +5 -0
- package/dist/custom/customNodes.d.ts +228 -0
- package/dist/custom/hooks.d.ts +10 -0
- package/dist/custom/index.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.js +3 -3
- package/dist/hooks/useCurrentViewId.d.ts +5 -1
- package/dist/hooks/useCurrentViewId.js +1 -2
- package/dist/hooks/useDiagram.d.ts +77 -12572
- package/dist/hooks/useDiagram.js +9 -7
- package/dist/hooks/useMantinePortalProps.d.ts +2 -2
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSearchActor.d.ts +2 -0
- package/dist/hooks/useSearchActor.js +10 -0
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +3 -1
- package/dist/hooks/useXYFlow.d.ts +75 -73
- package/dist/hooks/useXYFlow.js +7 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.js +8 -3
- package/dist/likec4diagram/DiagramUI.js +9 -4
- package/dist/likec4diagram/DiagramXYFlow.d.ts +4 -3
- package/dist/likec4diagram/DiagramXYFlow.js +124 -109
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +12 -15
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +16 -8
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +19 -15
- package/dist/likec4diagram/custom/index.d.ts +18 -21
- package/dist/likec4diagram/custom/index.js +3 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +27 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +67 -53
- package/dist/likec4diagram/custom/nodes/index.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +10 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +105 -0
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +6 -7
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +3 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +5 -5
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/types.d.ts +18 -10
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +14 -6
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +7 -9
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +4 -4
- package/dist/likec4diagram/useLayoutConstraints.js +3 -4
- package/dist/likec4diagram/useViewToNodesEdges.d.ts +5 -3
- package/dist/likec4diagram/useViewToNodesEdges.js +22 -30
- package/dist/likec4model/LikeC4ModelContext.d.ts +2 -2
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/likec4model/useLikeC4ElementsTree.js +4 -4
- package/dist/likec4model/useLikeC4Model.d.ts +22 -10
- package/dist/likec4model/useLikeC4Model.js +13 -9
- package/dist/overlays/Overlays.d.ts +2 -3
- package/dist/overlays/Overlays.js +9 -33
- package/dist/overlays/element-details/ElementDetailsCard.css.js +13 -9
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.js +110 -110
- package/dist/overlays/element-details/TabPanelDeployments.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelDeployments.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelStructure.js +3 -3
- package/dist/overlays/element-details/actor.d.ts +5482 -18265
- package/dist/overlays/element-details/actor.js +0 -2
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.css.d.ts +57 -2
- package/dist/overlays/overlay/Overlay.css.js +76 -39
- package/dist/overlays/overlay/Overlay.d.ts +23 -1
- package/dist/overlays/overlay/Overlay.js +40 -29
- package/dist/overlays/overlaysActor.d.ts +5 -3
- package/dist/overlays/overlaysActor.js +2 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +6 -9
- package/dist/overlays/relationship-details/RelationshipDetails.js +15 -15
- package/dist/overlays/relationship-details/SelectEdge.js +2 -3
- package/dist/overlays/relationship-details/_types.d.ts +7 -6
- package/dist/overlays/relationship-details/actor.d.ts +3 -3
- package/dist/overlays/relationship-details/actor.js +7 -7
- package/dist/overlays/relationship-details/compute.js +3 -3
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +6 -9
- package/dist/overlays/relationship-details/custom/edgeTypes.js +2 -2
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +3 -31
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -0
- package/dist/overlays/relationship-details/hooks.d.ts +28 -27
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationship-details/layout-to-xyflow.js +1 -0
- package/dist/overlays/relationship-details/layout.js +5 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -9
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +8 -8
- package/dist/overlays/relationships-browser/SelectElement.js +6 -6
- package/dist/overlays/relationships-browser/_types.d.ts +7 -6
- package/dist/overlays/relationships-browser/actor.d.ts +64 -429
- package/dist/overlays/relationships-browser/actor.js +7 -7
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +6 -9
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +2 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +17 -18
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +5 -2
- package/dist/overlays/relationships-browser/hooks.d.ts +4 -61
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +13 -10
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +4 -3
- package/dist/search/Search.d.ts +5 -0
- package/dist/search/Search.js +192 -0
- package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.css.js +0 -1
- package/dist/search/components/ElementsColumn.d.ts +2 -0
- package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.js +26 -25
- package/dist/search/components/PickView.d.ts +4 -0
- package/dist/search/components/PickView.js +135 -0
- package/dist/search/components/SearchByTags.d.ts +1 -0
- package/dist/search/components/SearchByTags.js +116 -0
- package/dist/search/components/SearchInput.d.ts +2 -0
- package/dist/{likec4diagram/ui/search → search/components}/SearchInput.js +53 -35
- package/dist/{likec4diagram/ui/search → search/components}/ViewsColum.d.ts +3 -2
- package/dist/{likec4diagram/ui/search → search/components}/ViewsColum.js +14 -13
- package/dist/search/components/_shared.css.d.ts +4 -0
- package/dist/{likec4diagram/ui/search → search/components}/_shared.css.js +26 -35
- package/dist/{likec4diagram/ui/search/LikeC4Search.css.d.ts → search/components/styles.css.d.ts} +0 -2
- package/dist/search/components/styles.css.js +60 -0
- package/dist/{likec4diagram/ui/search → search/components}/utils.d.ts +1 -0
- package/dist/{likec4diagram/ui/search → search/components}/utils.js +7 -1
- package/dist/search/hooks.d.ts +16 -0
- package/dist/search/hooks.js +35 -0
- package/dist/search/searchActor.d.ts +90 -0
- package/dist/search/searchActor.js +75 -0
- package/dist/state/DiagramActorProvider.d.ts +9 -7
- package/dist/state/DiagramActorProvider.js +24 -18
- package/dist/state/assign.d.ts +0 -1
- package/dist/state/assign.js +9 -19
- package/dist/state/diagram-machine.d.ts +749 -10678
- package/dist/state/diagram-machine.js +121 -55
- package/dist/state/hotkeyActor.d.ts +4 -2
- package/dist/state/syncManualLayoutActor.d.ts +15 -4
- package/dist/state/syncManualLayoutActor.js +2 -1
- package/dist/state/types.d.ts +7 -4
- package/dist/state/utils.d.ts +3 -1
- package/dist/state/utils.js +3 -0
- package/dist/styles-font.css +1 -0
- package/dist/styles-min.css +1 -0
- package/dist/styles-xyflow.css +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css2.js +3 -0
- package/package.json +50 -25
- package/panda.buildinfo.json +1002 -0
- package/src/LikeC4CustomColors.tsx +21 -6
- package/src/LikeC4Diagram.props.ts +42 -31
- package/src/LikeC4Diagram.tsx +21 -20
- package/src/LikeC4ModelProvider.tsx +7 -6
- package/src/StaticLikeC4Diagram.tsx +9 -6
- package/src/base/Background.tsx +0 -4
- package/src/base/const.ts +1 -1
- package/src/base/index.ts +2 -1
- package/src/base/primitives/compound/CompoundActionButton.tsx +9 -5
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +9 -5
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +8 -7
- package/src/base/primitives/compound/CompoundTitle.tsx +3 -2
- package/src/base/primitives/customEdge.ts +1 -1
- package/src/base/primitives/{customNode.ts → customNode.tsx} +11 -3
- package/src/base/primitives/edge/EdgeContainer.tsx +2 -1
- package/src/base/primitives/edge/EdgeLabel.css.ts +1 -0
- package/src/base/primitives/edge/EdgeLabel.tsx +20 -15
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgeMarkers.tsx +2 -1
- package/src/base/primitives/edge/EdgePath.tsx +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +11 -10
- package/src/base/primitives/element/ElementDetailsButton.tsx +2 -1
- package/src/base/primitives/element/ElementNodeContainer.tsx +87 -80
- package/src/base/primitives/element/ElementShape.tsx +12 -10
- package/src/base/primitives/element/ElementTags.tsx +182 -0
- package/src/base/primitives/element/ElementTitle.tsx +21 -15
- package/src/base/primitives/index.ts +1 -0
- package/src/base/types.Base.ts +104 -0
- package/src/base/types.ts +4 -106
- package/src/bundle/LikeC4View.props.ts +23 -5
- package/src/bundle/LikeC4View.tsx +20 -19
- package/src/bundle/ReactLikeC4.tsx +15 -27
- package/src/bundle/custom.ts +1 -0
- package/src/bundle/index.ts +20 -1
- package/src/bundle/styles.css.ts +1 -1
- package/src/components/ErrorFallback.tsx +30 -0
- package/src/components/SearchControl.tsx +1 -1
- package/src/context/DiagramEventHandlers.tsx +5 -4
- package/src/context/DiagramFeatures.tsx +15 -30
- package/src/context/EnsureMantine.tsx +13 -3
- package/src/context/IconRenderer.tsx +2 -5
- package/src/context/ReduceGraphics.tsx +6 -6
- package/src/context/RootContainer.tsx +9 -3
- package/src/context/TagStylesContext.tsx +96 -0
- package/src/context/index.ts +0 -1
- package/src/custom/components.ts +49 -0
- package/src/custom/customNodes.tsx +254 -0
- package/src/custom/hooks.ts +36 -0
- package/src/custom/index.ts +5 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useCurrentViewId.ts +6 -1
- package/src/hooks/useDiagram.ts +131 -18
- package/src/hooks/useMantinePortalProps.ts +10 -1
- package/src/hooks/useSearchActor.ts +11 -0
- package/src/hooks/useUpdateEffect.ts +7 -4
- package/src/hooks/useXYFlow.ts +5 -0
- package/src/index.ts +4 -8
- package/src/likec4diagram/DiagramUI.tsx +5 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +135 -115
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +10 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +17 -14
- package/src/likec4diagram/custom/{index.tsx → index.ts} +2 -2
- package/src/likec4diagram/custom/nodes/CompoundActions.tsx +2 -2
- package/src/likec4diagram/custom/nodes/ElementActions.tsx +100 -57
- package/src/likec4diagram/custom/nodes/index.ts +17 -0
- package/src/likec4diagram/custom/nodes/nodes.tsx +127 -0
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +3 -4
- package/src/likec4diagram/custom/nodes/toolbar/ElementToolbar.tsx +3 -3
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +5 -4
- package/src/likec4diagram/custom/nodes/toolbar/_shared.tsx +11 -3
- package/src/likec4diagram/types.ts +24 -12
- package/src/likec4diagram/ui/controls/Controls.tsx +11 -4
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +3 -4
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/likec4diagram/useViewToNodesEdges.ts +36 -36
- package/src/likec4model/LikeC4ModelContext.ts +2 -2
- package/src/likec4model/useLikeC4ElementsTree.ts +4 -2
- package/src/likec4model/useLikeC4Model.ts +18 -16
- package/src/overlays/Overlays.tsx +7 -35
- package/src/overlays/element-details/ElementDetailsCard.css.ts +14 -22
- package/src/overlays/element-details/ElementDetailsCard.tsx +43 -34
- package/src/overlays/element-details/TabPanelDeployments.tsx +3 -2
- package/src/overlays/element-details/TabPanelRelationships.tsx +2 -1
- package/src/overlays/element-details/TabPanelStructure.tsx +1 -1
- package/src/overlays/element-details/actor.ts +2 -2
- package/src/overlays/overlay/Overlay.css.ts +75 -38
- package/src/overlays/overlay/Overlay.tsx +45 -29
- package/src/overlays/overlaysActor.ts +5 -4
- package/src/overlays/relationship-details/RelationshipDetails.tsx +5 -5
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -2
- package/src/overlays/relationship-details/_types.ts +18 -14
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +2 -2
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +4 -0
- package/src/overlays/relationship-details/layout-to-xyflow.ts +1 -0
- package/src/overlays/relationship-details/layout.ts +3 -1
- package/src/overlays/relationships-browser/SelectElement.tsx +1 -1
- package/src/overlays/relationships-browser/_types.ts +20 -16
- package/src/overlays/relationships-browser/actor.ts +2 -2
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -2
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +5 -2
- package/src/overlays/relationships-browser/layout.ts +12 -7
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +4 -4
- package/src/search/Search.tsx +237 -0
- package/src/{likec4diagram/ui/search → search/components}/ElementsColumn.css.ts +0 -29
- package/src/{likec4diagram/ui/search → search/components}/ElementsColumn.tsx +25 -25
- package/src/search/components/PickView.tsx +140 -0
- package/src/search/components/SearchByTags.tsx +109 -0
- package/src/{likec4diagram/ui/search → search/components}/SearchInput.tsx +63 -36
- package/src/{likec4diagram/ui/search → search/components}/ViewsColum.tsx +17 -18
- package/src/{likec4diagram/ui/search → search/components}/_shared.css.ts +26 -37
- package/src/{likec4diagram/ui/search/LikeC4Search.css.ts → search/components/styles.css.ts} +9 -36
- package/src/{likec4diagram/ui/search → search/components}/utils.ts +7 -0
- package/src/search/hooks.ts +41 -0
- package/src/search/searchActor.ts +99 -0
- package/src/state/DiagramActorProvider.tsx +36 -25
- package/src/state/assign.ts +10 -10
- package/src/state/diagram-machine.ts +128 -60
- package/src/state/hotkeyActor.ts +4 -2
- package/src/state/syncManualLayoutActor.ts +10 -4
- package/src/state/types.ts +11 -3
- package/src/state/utils.ts +7 -3
- package/src/styles-min.css +2 -0
- package/src/styles-xyflow.css +1 -0
- package/dist/_virtual/_commonjsHelpers.js +0 -5
- package/dist/_virtual/default-map.js +0 -7
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/react.production.js +0 -3
- package/dist/_virtual/set.js +0 -5
- package/dist/_virtual/set2.js +0 -3
- package/dist/base/types.js +0 -54
- package/dist/base/xyflowMachine.d.ts +0 -212
- package/dist/likec4diagram/custom/nodes/nodeTypes.d.ts +0 -8
- package/dist/likec4diagram/custom/nodes/nodeTypes.js +0 -92
- package/dist/likec4diagram/ui/search/ElementsColumn.d.ts +0 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +0 -87
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +0 -2
- package/dist/likec4diagram/ui/search/LikeC4Search.js +0 -267
- package/dist/likec4diagram/ui/search/SearchInput.d.ts +0 -1
- package/dist/likec4diagram/ui/search/_shared.css.d.ts +0 -4
- package/dist/likec4diagram/ui/search/state.d.ts +0 -19
- package/dist/likec4diagram/ui/search/state.js +0 -64
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/default-map.js +0 -172
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/set.js +0 -369
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js +0 -556
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/index.js +0 -15
- package/dist/packages/core/src/compute-view/relationships-view/compute.js +0 -123
- package/dist/packages/core/src/compute-view/relationships-view/utils.js +0 -68
- package/dist/packages/core/src/errors/index.js +0 -15
- package/dist/packages/core/src/model/connection/model/ConnectionModel.js +0 -121
- package/dist/packages/core/src/model/connection/model/find.js +0 -39
- package/dist/packages/core/src/model/connection/ops.js +0 -7
- package/dist/packages/core/src/utils/const.js +0 -3
- package/dist/packages/core/src/utils/fqn.js +0 -51
- package/dist/packages/core/src/utils/guards.js +0 -7
- package/dist/packages/core/src/utils/iterable/filter.js +0 -21
- package/dist/packages/core/src/utils/iterable/find.js +0 -21
- package/dist/packages/core/src/utils/iterable/map.js +0 -18
- package/dist/packages/core/src/utils/iterable/some.js +0 -21
- package/dist/packages/core/src/utils/iterable/to.js +0 -14
- package/dist/packages/core/src/utils/set.js +0 -48
- package/dist/packages/core/src/utils/string-hash.js +0 -13
- package/dist/styles.css.js +0 -3
- package/src/base/xyflowMachine.ts +0 -75
- package/src/likec4diagram/custom/nodes/nodeTypes.tsx +0 -109
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +0 -301
- package/src/likec4diagram/ui/search/state.ts +0 -78
- /package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.css.d.ts +0 -0
- /package/dist/{likec4diagram/ui/search → search/components}/ViewsColumn.css.d.ts +0 -0
- /package/dist/{likec4diagram/ui/search → search/components}/ViewsColumn.css.js +0 -0
- /package/dist/{bundle/font.css.js → styles-font.css2.js} +0 -0
- /package/src/{likec4diagram/ui/search → search/components}/ViewsColumn.css.ts +0 -0
- /package/src/{bundle/font.css → styles-font.css} +0 -0
|
@@ -621,6 +621,9 @@ export declare const relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
621
621
|
focusable?: boolean;
|
|
622
622
|
type: "relationship";
|
|
623
623
|
data: {
|
|
624
|
+
hovered?: boolean;
|
|
625
|
+
active?: boolean;
|
|
626
|
+
dimmed?: Base.Dimmed;
|
|
624
627
|
relationId: RelationId;
|
|
625
628
|
color: Color | undefined;
|
|
626
629
|
label: string | null;
|
|
@@ -628,9 +631,6 @@ export declare const relationshipDetailsLogic: StateMachine<Readonly<{
|
|
|
628
631
|
description?: string | undefined | undefined;
|
|
629
632
|
navigateTo: ViewId | null;
|
|
630
633
|
line: RelationshipLineType;
|
|
631
|
-
hovered?: boolean;
|
|
632
|
-
active?: boolean;
|
|
633
|
-
dimmed?: Base.Dimmed;
|
|
634
634
|
};
|
|
635
635
|
}[];
|
|
636
636
|
bounds: BBox;
|
|
@@ -7,7 +7,7 @@ import { MinZoom } from '../../base/const.js';
|
|
|
7
7
|
import { updateEdges } from '../../base/updateEdges.js';
|
|
8
8
|
import { updateNodes } from '../../base/updateNodes.js';
|
|
9
9
|
import { layoutResultToXYFlow } from './layout-to-xyflow.js';
|
|
10
|
-
import {
|
|
10
|
+
import { setDimmed, setHovered, setData } from '../../base/types.Base.js';
|
|
11
11
|
|
|
12
12
|
function inputToSubject(input) {
|
|
13
13
|
if ("edgeId" in input) {
|
|
@@ -161,12 +161,12 @@ const relationshipDetailsLogic = setup({
|
|
|
161
161
|
);
|
|
162
162
|
return context.xyedges.map((edge) => {
|
|
163
163
|
if (edge.id === event.edge.id) {
|
|
164
|
-
return
|
|
164
|
+
return setData(edge, {
|
|
165
165
|
hovered: true,
|
|
166
166
|
dimmed: false
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
return hasDimmed && !edge.selected ?
|
|
169
|
+
return hasDimmed && !edge.selected ? setDimmed(edge, "immediate") : edge;
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
}),
|
|
@@ -180,7 +180,7 @@ const relationshipDetailsLogic = setup({
|
|
|
180
180
|
assign({
|
|
181
181
|
xyedges: ({ context, event }) => context.xyedges.map((edge) => {
|
|
182
182
|
if (edge.id === event.edge.id) {
|
|
183
|
-
return
|
|
183
|
+
return setHovered(edge, false);
|
|
184
184
|
}
|
|
185
185
|
return edge;
|
|
186
186
|
})
|
|
@@ -191,7 +191,7 @@ const relationshipDetailsLogic = setup({
|
|
|
191
191
|
},
|
|
192
192
|
"dim.nonhovered.edges": {
|
|
193
193
|
actions: assign({
|
|
194
|
-
xyedges: ({ context }) => context.xyedges.map((edge) =>
|
|
194
|
+
xyedges: ({ context }) => context.xyedges.map((edge) => setDimmed(edge, edge.data.hovered !== true))
|
|
195
195
|
})
|
|
196
196
|
},
|
|
197
197
|
"undim.edges": {
|
|
@@ -200,10 +200,10 @@ const relationshipDetailsLogic = setup({
|
|
|
200
200
|
const hasSelected = context.xyedges.some((edge) => edge.selected === true);
|
|
201
201
|
if (hasSelected) {
|
|
202
202
|
return context.xyedges.map(
|
|
203
|
-
(edge) =>
|
|
203
|
+
(edge) => setDimmed(edge, edge.selected !== true ? edge.data.dimmed || "immediate" : false)
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
|
-
return context.xyedges.map(
|
|
206
|
+
return context.xyedges.map(setDimmed(false));
|
|
207
207
|
}
|
|
208
208
|
})
|
|
209
209
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasAtLeast, invariant, isAncestor, sortParentsFirst } from '@likec4/core';
|
|
2
|
-
import { treeFromElements } from '
|
|
3
|
-
import {
|
|
2
|
+
import { treeFromElements } from '@likec4/core/compute-view/relationships';
|
|
3
|
+
import { modelConnection } from '@likec4/core/model';
|
|
4
4
|
|
|
5
5
|
const finalize = (elements, explicits) => {
|
|
6
6
|
if (elements.size > 2 && explicits.size !== elements.size) {
|
|
@@ -96,7 +96,7 @@ function computeRelationshipDetailsViewData({
|
|
|
96
96
|
if (target) {
|
|
97
97
|
addExplicit(target, "target");
|
|
98
98
|
}
|
|
99
|
-
const [connection] = findConnection(source, target, "directed");
|
|
99
|
+
const [connection] = modelConnection.findConnection(source, target, "directed");
|
|
100
100
|
if (!connection) {
|
|
101
101
|
return {
|
|
102
102
|
sources,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionComponent, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Position } from '@xyflow/system';
|
|
3
|
+
import { EdgeData, Dimmed } from '../../../base/types.Base';
|
|
3
4
|
import { RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
|
|
4
|
-
export declare const RelationshipEdge:
|
|
5
|
+
export declare const RelationshipEdge: FunctionComponent<{
|
|
5
6
|
id: string;
|
|
6
7
|
selected?: boolean;
|
|
7
8
|
selectable?: boolean;
|
|
8
9
|
deletable?: boolean;
|
|
9
10
|
style?: CSSProperties;
|
|
11
|
+
animated?: boolean;
|
|
10
12
|
source: string;
|
|
11
13
|
target: string;
|
|
12
|
-
animated?: boolean;
|
|
13
14
|
sourceX: number;
|
|
14
15
|
sourceY: number;
|
|
15
16
|
targetX: number;
|
|
@@ -28,11 +29,10 @@ export declare const RelationshipEdge: NamedExoticComponent<{
|
|
|
28
29
|
markerEnd?: string;
|
|
29
30
|
pathOptions?: any;
|
|
30
31
|
interactionWidth?: number;
|
|
31
|
-
data: {
|
|
32
|
+
data: EdgeData & {
|
|
32
33
|
hovered?: boolean;
|
|
33
34
|
active?: boolean;
|
|
34
|
-
dimmed?:
|
|
35
|
-
} & {
|
|
35
|
+
dimmed?: Dimmed;
|
|
36
36
|
relationId: RelationId;
|
|
37
37
|
color: Color | undefined;
|
|
38
38
|
label: string | null;
|
|
@@ -40,8 +40,5 @@ export declare const RelationshipEdge: NamedExoticComponent<{
|
|
|
40
40
|
description?: string | undefined | undefined;
|
|
41
41
|
navigateTo: ViewId | null;
|
|
42
42
|
line: RelationshipLineType;
|
|
43
|
-
hovered?: boolean;
|
|
44
|
-
active?: boolean;
|
|
45
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
46
43
|
};
|
|
47
44
|
}>;
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { getBezierPath } from '@xyflow/system';
|
|
3
3
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
4
4
|
import { customEdge } from '../../../base/primitives/customEdge.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
6
|
import { EdgeContainer } from '../../../base/primitives/edge/EdgeContainer.js';
|
|
7
7
|
import { EdgePath } from '../../../base/primitives/edge/EdgePath.js';
|
|
8
8
|
import { EdgeLabelContainer } from '../../../base/primitives/edge/EdgeLabelContainer.js';
|
|
@@ -10,7 +10,7 @@ import { EdgeLabel } from '../../../base/primitives/edge/EdgeLabel.js';
|
|
|
10
10
|
import { EdgeActionButton } from '../../../base/primitives/edge/EdgeActionButton.js';
|
|
11
11
|
|
|
12
12
|
const RelationshipEdge = customEdge((props) => {
|
|
13
|
-
const { enableNavigateTo } =
|
|
13
|
+
const { enableNavigateTo } = useEnabledFeatures();
|
|
14
14
|
const {
|
|
15
15
|
sourceX,
|
|
16
16
|
targetY,
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
import { NodeProps } from '../../../base';
|
|
2
2
|
import { RelationshipDetailsTypes } from '../_types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
style: ElementStyle;
|
|
9
|
-
title: string;
|
|
10
|
-
technology: string | null;
|
|
11
|
-
description: string | null;
|
|
12
|
-
color: Color;
|
|
13
|
-
shape: "rectangle" | "person" | "browser" | "mobile" | "cylinder" | "storage" | "queue";
|
|
14
|
-
navigateTo: ViewId<string> | null | undefined;
|
|
15
|
-
column: RelationshipDetailsTypes.Column;
|
|
16
|
-
fqn: Fqn;
|
|
17
|
-
icon: IconUrl;
|
|
18
|
-
ports: RelationshipDetailsTypes.Ports;
|
|
19
|
-
hovered?: boolean;
|
|
20
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
21
|
-
}>>;
|
|
22
|
-
export declare const CompoundNode: NamedExoticComponent<NodeProps<{
|
|
23
|
-
style: ElementStyle;
|
|
24
|
-
title: string;
|
|
25
|
-
color: Color;
|
|
26
|
-
column: RelationshipDetailsTypes.Column;
|
|
27
|
-
fqn: Fqn;
|
|
28
|
-
depth: number;
|
|
29
|
-
icon?: IconUrl;
|
|
30
|
-
ports: RelationshipDetailsTypes.Ports;
|
|
31
|
-
hovered?: boolean;
|
|
32
|
-
dimmed?: import("../../../base").Base.Dimmed;
|
|
33
|
-
}>>;
|
|
3
|
+
import { MemoExoticComponent } from 'react';
|
|
4
|
+
export declare const ElementNode: MemoExoticComponent<(props: NodeProps<RelationshipDetailsTypes.ElementNodeData, string>) => import("react/jsx-runtime").JSX.Element>;
|
|
5
|
+
export declare const CompoundNode: MemoExoticComponent<(props: NodeProps<RelationshipDetailsTypes.CompoundNodeData, string>) => import("react/jsx-runtime").JSX.Element>;
|
|
34
6
|
type ElementPortsProps = NodeProps<Pick<RelationshipDetailsTypes.ElementNodeData, 'ports' | 'height'>>;
|
|
35
7
|
export declare const ElementPorts: ({ data: { ports, height: h } }: ElementPortsProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
8
|
type CompoundPortsProps = NodeProps<Pick<RelationshipDetailsTypes.CompoundNodeData, 'ports'>>;
|
|
@@ -2,6 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { ElementActions } from './ElementActions.js';
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import { Position } from '@xyflow/system';
|
|
5
|
+
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
5
6
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
6
7
|
import { customNode } from '../../../base/primitives/customNode.js';
|
|
7
8
|
import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
|
|
@@ -9,6 +10,7 @@ import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.j
|
|
|
9
10
|
import { ElementNodeContainer } from '../../../base/primitives/element/ElementNodeContainer.js';
|
|
10
11
|
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
11
12
|
import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
|
|
13
|
+
import { ElementTags } from '../../../base/primitives/element/ElementTags.js';
|
|
12
14
|
import { ElementDetailsButton } from '../../../base/primitives/element/ElementDetailsButton.js';
|
|
13
15
|
|
|
14
16
|
const ElementDetailsButtonWithHandler = (props) => {
|
|
@@ -25,9 +27,11 @@ const ElementDetailsButtonWithHandler = (props) => {
|
|
|
25
27
|
);
|
|
26
28
|
};
|
|
27
29
|
const ElementNode = customNode((props) => {
|
|
30
|
+
const { enableElementTags } = useEnabledFeatures();
|
|
28
31
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
29
32
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
30
33
|
/* @__PURE__ */ jsx(ElementTitle, { ...props }),
|
|
34
|
+
enableElementTags && /* @__PURE__ */ jsx(ElementTags, { ...props }),
|
|
31
35
|
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
32
36
|
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
33
37
|
/* @__PURE__ */ jsx(ElementPorts, { ...props })
|
|
@@ -3,6 +3,7 @@ import { RelationshipDetailsActorRef, RelationshipDetailsSnapshot, Events } from
|
|
|
3
3
|
import { Context, ReactNode, CSSProperties } from 'react';
|
|
4
4
|
import { GeneralHelpers, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
|
|
5
5
|
import { EdgeMarkerType, HandleType } from '@xyflow/system';
|
|
6
|
+
import { Dimmed } from '../../base/types.Base';
|
|
6
7
|
export declare const RelationshipDetailsActorContext: Context<RelationshipDetailsActorRef | null>;
|
|
7
8
|
export declare function useRelationshipDetailsActor(): RelationshipDetailsActorRef;
|
|
8
9
|
export declare function useRelationshipDetailsState<T = unknown>(selector: (state: RelationshipDetailsSnapshot) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean): T;
|
|
@@ -48,6 +49,9 @@ export declare function useRelationshipDetails(): {
|
|
|
48
49
|
focusable?: boolean;
|
|
49
50
|
type: "relationship";
|
|
50
51
|
data: {
|
|
52
|
+
hovered?: boolean;
|
|
53
|
+
active?: boolean;
|
|
54
|
+
dimmed?: Dimmed;
|
|
51
55
|
relationId: RelationId;
|
|
52
56
|
color: Color | undefined;
|
|
53
57
|
label: string | null;
|
|
@@ -55,9 +59,6 @@ export declare function useRelationshipDetails(): {
|
|
|
55
59
|
description?: string | undefined | undefined;
|
|
56
60
|
navigateTo: ViewId | null;
|
|
57
61
|
line: RelationshipLineType;
|
|
58
|
-
hovered?: boolean;
|
|
59
|
-
active?: boolean;
|
|
60
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
61
62
|
};
|
|
62
63
|
}> & ViewportHelperFunctions & {
|
|
63
64
|
viewportInitialized: boolean;
|
|
@@ -91,6 +92,9 @@ export declare function useRelationshipDetails(): {
|
|
|
91
92
|
focusable?: boolean;
|
|
92
93
|
type: "relationship";
|
|
93
94
|
data: {
|
|
95
|
+
hovered?: boolean;
|
|
96
|
+
active?: boolean;
|
|
97
|
+
dimmed?: Dimmed;
|
|
94
98
|
relationId: RelationId;
|
|
95
99
|
color: Color | undefined;
|
|
96
100
|
label: string | null;
|
|
@@ -98,9 +102,6 @@ export declare function useRelationshipDetails(): {
|
|
|
98
102
|
description?: string | undefined | undefined;
|
|
99
103
|
navigateTo: ViewId | null;
|
|
100
104
|
line: RelationshipLineType;
|
|
101
|
-
hovered?: boolean;
|
|
102
|
-
active?: boolean;
|
|
103
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
104
105
|
};
|
|
105
106
|
}>;
|
|
106
107
|
setState: (partial: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
@@ -131,6 +132,9 @@ export declare function useRelationshipDetails(): {
|
|
|
131
132
|
focusable?: boolean;
|
|
132
133
|
type: "relationship";
|
|
133
134
|
data: {
|
|
135
|
+
hovered?: boolean;
|
|
136
|
+
active?: boolean;
|
|
137
|
+
dimmed?: Dimmed;
|
|
134
138
|
relationId: RelationId;
|
|
135
139
|
color: Color | undefined;
|
|
136
140
|
label: string | null;
|
|
@@ -138,9 +142,6 @@ export declare function useRelationshipDetails(): {
|
|
|
138
142
|
description?: string | undefined | undefined;
|
|
139
143
|
navigateTo: ViewId | null;
|
|
140
144
|
line: RelationshipLineType;
|
|
141
|
-
hovered?: boolean;
|
|
142
|
-
active?: boolean;
|
|
143
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
144
145
|
};
|
|
145
146
|
}> | Partial< ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
146
147
|
id: string;
|
|
@@ -170,6 +171,9 @@ export declare function useRelationshipDetails(): {
|
|
|
170
171
|
focusable?: boolean;
|
|
171
172
|
type: "relationship";
|
|
172
173
|
data: {
|
|
174
|
+
hovered?: boolean;
|
|
175
|
+
active?: boolean;
|
|
176
|
+
dimmed?: Dimmed;
|
|
173
177
|
relationId: RelationId;
|
|
174
178
|
color: Color | undefined;
|
|
175
179
|
label: string | null;
|
|
@@ -177,9 +181,6 @@ export declare function useRelationshipDetails(): {
|
|
|
177
181
|
description?: string | undefined | undefined;
|
|
178
182
|
navigateTo: ViewId | null;
|
|
179
183
|
line: RelationshipLineType;
|
|
180
|
-
hovered?: boolean;
|
|
181
|
-
active?: boolean;
|
|
182
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
183
184
|
};
|
|
184
185
|
}>> | ((state: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
185
186
|
id: string;
|
|
@@ -209,6 +210,9 @@ export declare function useRelationshipDetails(): {
|
|
|
209
210
|
focusable?: boolean;
|
|
210
211
|
type: "relationship";
|
|
211
212
|
data: {
|
|
213
|
+
hovered?: boolean;
|
|
214
|
+
active?: boolean;
|
|
215
|
+
dimmed?: Dimmed;
|
|
212
216
|
relationId: RelationId;
|
|
213
217
|
color: Color | undefined;
|
|
214
218
|
label: string | null;
|
|
@@ -216,9 +220,6 @@ export declare function useRelationshipDetails(): {
|
|
|
216
220
|
description?: string | undefined | undefined;
|
|
217
221
|
navigateTo: ViewId | null;
|
|
218
222
|
line: RelationshipLineType;
|
|
219
|
-
hovered?: boolean;
|
|
220
|
-
active?: boolean;
|
|
221
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
222
223
|
};
|
|
223
224
|
}>) => ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
224
225
|
id: string;
|
|
@@ -248,6 +249,9 @@ export declare function useRelationshipDetails(): {
|
|
|
248
249
|
focusable?: boolean;
|
|
249
250
|
type: "relationship";
|
|
250
251
|
data: {
|
|
252
|
+
hovered?: boolean;
|
|
253
|
+
active?: boolean;
|
|
254
|
+
dimmed?: Dimmed;
|
|
251
255
|
relationId: RelationId;
|
|
252
256
|
color: Color | undefined;
|
|
253
257
|
label: string | null;
|
|
@@ -255,9 +259,6 @@ export declare function useRelationshipDetails(): {
|
|
|
255
259
|
description?: string | undefined | undefined;
|
|
256
260
|
navigateTo: ViewId | null;
|
|
257
261
|
line: RelationshipLineType;
|
|
258
|
-
hovered?: boolean;
|
|
259
|
-
active?: boolean;
|
|
260
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
261
262
|
};
|
|
262
263
|
}> | Partial< ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
263
264
|
id: string;
|
|
@@ -287,6 +288,9 @@ export declare function useRelationshipDetails(): {
|
|
|
287
288
|
focusable?: boolean;
|
|
288
289
|
type: "relationship";
|
|
289
290
|
data: {
|
|
291
|
+
hovered?: boolean;
|
|
292
|
+
active?: boolean;
|
|
293
|
+
dimmed?: Dimmed;
|
|
290
294
|
relationId: RelationId;
|
|
291
295
|
color: Color | undefined;
|
|
292
296
|
label: string | null;
|
|
@@ -294,9 +298,6 @@ export declare function useRelationshipDetails(): {
|
|
|
294
298
|
description?: string | undefined | undefined;
|
|
295
299
|
navigateTo: ViewId | null;
|
|
296
300
|
line: RelationshipLineType;
|
|
297
|
-
hovered?: boolean;
|
|
298
|
-
active?: boolean;
|
|
299
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
300
301
|
};
|
|
301
302
|
}>>), replace?: boolean | undefined) => void;
|
|
302
303
|
subscribe: (listener: (state: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
@@ -327,6 +328,9 @@ export declare function useRelationshipDetails(): {
|
|
|
327
328
|
focusable?: boolean;
|
|
328
329
|
type: "relationship";
|
|
329
330
|
data: {
|
|
331
|
+
hovered?: boolean;
|
|
332
|
+
active?: boolean;
|
|
333
|
+
dimmed?: Dimmed;
|
|
330
334
|
relationId: RelationId;
|
|
331
335
|
color: Color | undefined;
|
|
332
336
|
label: string | null;
|
|
@@ -334,9 +338,6 @@ export declare function useRelationshipDetails(): {
|
|
|
334
338
|
description?: string | undefined | undefined;
|
|
335
339
|
navigateTo: ViewId | null;
|
|
336
340
|
line: RelationshipLineType;
|
|
337
|
-
hovered?: boolean;
|
|
338
|
-
active?: boolean;
|
|
339
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
340
341
|
};
|
|
341
342
|
}>, prevState: ReactFlowState<import("./_types").RelationshipDetailsTypes.Node, {
|
|
342
343
|
id: string;
|
|
@@ -366,6 +367,9 @@ export declare function useRelationshipDetails(): {
|
|
|
366
367
|
focusable?: boolean;
|
|
367
368
|
type: "relationship";
|
|
368
369
|
data: {
|
|
370
|
+
hovered?: boolean;
|
|
371
|
+
active?: boolean;
|
|
372
|
+
dimmed?: Dimmed;
|
|
369
373
|
relationId: RelationId;
|
|
370
374
|
color: Color | undefined;
|
|
371
375
|
label: string | null;
|
|
@@ -373,9 +377,6 @@ export declare function useRelationshipDetails(): {
|
|
|
373
377
|
description?: string | undefined | undefined;
|
|
374
378
|
navigateTo: ViewId | null;
|
|
375
379
|
line: RelationshipLineType;
|
|
376
|
-
hovered?: boolean;
|
|
377
|
-
active?: boolean;
|
|
378
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
379
380
|
};
|
|
380
381
|
}>) => void) => () => void;
|
|
381
382
|
} | null;
|
|
@@ -2,11 +2,11 @@ import { nonNullable } from '@likec4/core';
|
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks';
|
|
3
3
|
import { useSelector } from '@xstate/react';
|
|
4
4
|
import { shallowEqual } from 'fast-equals';
|
|
5
|
-
import {
|
|
5
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
6
6
|
|
|
7
|
-
const RelationshipDetailsActorContext =
|
|
7
|
+
const RelationshipDetailsActorContext = createContext(null);
|
|
8
8
|
function useRelationshipDetailsActor() {
|
|
9
|
-
return nonNullable(
|
|
9
|
+
return nonNullable(useContext(RelationshipDetailsActorContext), "No RelationshipDetailsActorContext");
|
|
10
10
|
}
|
|
11
11
|
function useRelationshipDetailsState(selector, compare = shallowEqual) {
|
|
12
12
|
const select = useCallbackRef(selector);
|
|
@@ -15,7 +15,7 @@ function useRelationshipDetailsState(selector, compare = shallowEqual) {
|
|
|
15
15
|
}
|
|
16
16
|
function useRelationshipDetails() {
|
|
17
17
|
const actor = useRelationshipDetailsActor();
|
|
18
|
-
return
|
|
18
|
+
return useMemo(() => ({
|
|
19
19
|
actor,
|
|
20
20
|
get rootElementId() {
|
|
21
21
|
return `relationship-details-${actor.sessionId.replaceAll(":", "_")}`;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { treeFromElements } from '@likec4/core/compute-view/relationships';
|
|
1
2
|
import dagre from '@dagrejs/dagre';
|
|
2
3
|
import { invariant } from '@likec4/core';
|
|
4
|
+
import { ifind, DefaultMap } from '@likec4/core/utils';
|
|
3
5
|
import { pipe, filter, mapToObj, find, map, tap, reduce, sortBy, prop } from 'remeda';
|
|
4
|
-
import { ifind } from '../../packages/core/src/utils/iterable/find.js';
|
|
5
|
-
import DefaultMap from '../../_virtual/default-map.js';
|
|
6
|
-
import { treeFromElements } from '../../packages/core/src/compute-view/relationships-view/utils.js';
|
|
7
6
|
|
|
8
7
|
const Sizes = {
|
|
9
8
|
dagre: {
|
|
@@ -237,11 +236,13 @@ function layoutRelationshipDetails(data, scope) {
|
|
|
237
236
|
return {
|
|
238
237
|
id,
|
|
239
238
|
parent: parentId ?? null,
|
|
239
|
+
x: position.x,
|
|
240
|
+
y: position.y,
|
|
240
241
|
position: [position.x, position.y],
|
|
241
242
|
title: element.title,
|
|
242
243
|
description: element.description,
|
|
243
244
|
technology: element.technology,
|
|
244
|
-
tags:
|
|
245
|
+
tags: [...element.tags],
|
|
245
246
|
links: null,
|
|
246
247
|
color: inheritFromNodeOrAncestor?.color ?? element.color,
|
|
247
248
|
shape: inheritFromNode?.shape ?? element.shape,
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { RelationshipsBrowserActorRef } from './actor';
|
|
2
|
-
import {
|
|
2
|
+
import { FunctionComponent, CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { Position } from '@xyflow/system';
|
|
4
|
+
import { EdgeData, Dimmed } from '../../base/types.Base';
|
|
4
5
|
import { Fqn, NonEmptyArray, RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
|
|
5
6
|
export declare const edgeTypes: {
|
|
6
|
-
relationship:
|
|
7
|
+
relationship: FunctionComponent<{
|
|
7
8
|
id: string;
|
|
8
9
|
selected?: boolean;
|
|
9
10
|
selectable?: boolean;
|
|
10
11
|
deletable?: boolean;
|
|
11
12
|
style?: CSSProperties;
|
|
13
|
+
animated?: boolean;
|
|
12
14
|
source: string;
|
|
13
15
|
target: string;
|
|
14
|
-
animated?: boolean;
|
|
15
16
|
sourceX: number;
|
|
16
17
|
sourceY: number;
|
|
17
18
|
targetX: number;
|
|
@@ -30,11 +31,10 @@ export declare const edgeTypes: {
|
|
|
30
31
|
markerEnd?: string;
|
|
31
32
|
pathOptions?: any;
|
|
32
33
|
interactionWidth?: number;
|
|
33
|
-
data: {
|
|
34
|
+
data: EdgeData & {
|
|
34
35
|
hovered?: boolean;
|
|
35
36
|
active?: boolean;
|
|
36
|
-
dimmed?:
|
|
37
|
-
} & {
|
|
37
|
+
dimmed?: Dimmed;
|
|
38
38
|
sourceFqn: Fqn;
|
|
39
39
|
targetFqn: Fqn;
|
|
40
40
|
relations: NonEmptyArray<RelationId>;
|
|
@@ -43,9 +43,6 @@ export declare const edgeTypes: {
|
|
|
43
43
|
navigateTo: ViewId | null;
|
|
44
44
|
line: RelationshipLineType;
|
|
45
45
|
existsInCurrentView: boolean;
|
|
46
|
-
hovered?: boolean;
|
|
47
|
-
active?: boolean;
|
|
48
|
-
dimmed?: import("../../base").Base.Dimmed;
|
|
49
46
|
};
|
|
50
47
|
}>;
|
|
51
48
|
};
|
|
@@ -6,7 +6,7 @@ import { IconX, IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
|
|
|
6
6
|
import { ReactFlowProvider, useStoreApi, useReactFlow, Panel } from '@xyflow/react';
|
|
7
7
|
import { shallowEqual } from 'fast-equals';
|
|
8
8
|
import { LayoutGroup, AnimatePresence, m } from 'motion/react';
|
|
9
|
-
import {
|
|
9
|
+
import { useRef, memo, useEffect } from 'react';
|
|
10
10
|
import { BaseXYFlow } from '../../base/BaseXYFlow.js';
|
|
11
11
|
import { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
12
12
|
import { useRelationshipsView } from './layout.js';
|
|
@@ -23,7 +23,7 @@ const edgeTypes = {
|
|
|
23
23
|
relationship: RelationshipEdge
|
|
24
24
|
};
|
|
25
25
|
function RelationshipsBrowser({ actorRef }) {
|
|
26
|
-
const initialRef =
|
|
26
|
+
const initialRef = useRef(null);
|
|
27
27
|
if (initialRef.current == null) {
|
|
28
28
|
initialRef.current = {
|
|
29
29
|
initialNodes: [],
|
|
@@ -38,7 +38,7 @@ const selector = (state) => ({
|
|
|
38
38
|
edges: state.context.xyedges
|
|
39
39
|
});
|
|
40
40
|
const selectorEq = (a, b) => a.isActive === b.isActive && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges);
|
|
41
|
-
const RelationshipsBrowserXYFlow =
|
|
41
|
+
const RelationshipsBrowserXYFlow = memo(() => {
|
|
42
42
|
const browser = useRelationshipsBrowser();
|
|
43
43
|
const {
|
|
44
44
|
isActive,
|
|
@@ -108,7 +108,7 @@ const selector2 = (state) => ({
|
|
|
108
108
|
scope: state.context.scope,
|
|
109
109
|
closeable: state.context.closeable
|
|
110
110
|
});
|
|
111
|
-
const RelationshipsBrowserInner =
|
|
111
|
+
const RelationshipsBrowserInner = memo(() => {
|
|
112
112
|
const browser = useRelationshipsBrowser();
|
|
113
113
|
const {
|
|
114
114
|
subjectId,
|
|
@@ -118,24 +118,24 @@ const RelationshipsBrowserInner = reactExports.memo(() => {
|
|
|
118
118
|
} = useRelationshipsBrowserState(selector2);
|
|
119
119
|
const store = useStoreApi();
|
|
120
120
|
const instance = useReactFlow();
|
|
121
|
-
|
|
121
|
+
useEffect(() => {
|
|
122
122
|
if (instance.viewportInitialized) {
|
|
123
123
|
browser.send({ type: "xyflow.init", instance, store });
|
|
124
124
|
}
|
|
125
125
|
}, [store, instance.viewportInitialized, browser]);
|
|
126
126
|
const layouted = useRelationshipsView(subjectId, viewId, scope);
|
|
127
127
|
const [historySubjectId, historyOps, { history, current }] = useStateHistory(subjectId);
|
|
128
|
-
|
|
128
|
+
useEffect(() => {
|
|
129
129
|
if (historySubjectId !== subjectId) {
|
|
130
130
|
historyOps.set(subjectId);
|
|
131
131
|
}
|
|
132
132
|
}, [subjectId]);
|
|
133
|
-
|
|
133
|
+
useEffect(() => {
|
|
134
134
|
if (historySubjectId !== subjectId) {
|
|
135
135
|
browser.navigateTo(historySubjectId);
|
|
136
136
|
}
|
|
137
137
|
}, [historySubjectId, browser]);
|
|
138
|
-
|
|
138
|
+
useEffect(() => {
|
|
139
139
|
browser.updateView(layouted);
|
|
140
140
|
}, [layouted, browser]);
|
|
141
141
|
const hasStepBack = current > 0;
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { ancestorsFqn } from '@likec4/core';
|
|
3
3
|
import { useTree, Group, Box, Popover, PopoverTarget, Button, Text, PopoverDropdown, ScrollAreaAutosize, Tree, ActionIcon, Tooltip, SegmentedControl } from '@mantine/core';
|
|
4
4
|
import { IconSelector, IconChevronRight } from '@tabler/icons-react';
|
|
5
|
-
import {
|
|
5
|
+
import { memo, useRef, useEffect } from 'react';
|
|
6
6
|
import { useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
|
|
7
7
|
import * as SelectElement_css from './SelectElement.css.js';
|
|
8
8
|
import { scrollArea } from './SelectElement.css.js';
|
|
@@ -22,7 +22,7 @@ const selector2 = (state) => {
|
|
|
22
22
|
};
|
|
23
23
|
const setHoveredNode = () => {
|
|
24
24
|
};
|
|
25
|
-
const SelectElement =
|
|
25
|
+
const SelectElement = memo(() => {
|
|
26
26
|
const browser = useRelationshipsBrowser();
|
|
27
27
|
const {
|
|
28
28
|
subjectId,
|
|
@@ -32,16 +32,16 @@ const SelectElement = reactExports.memo(() => {
|
|
|
32
32
|
enableSelectSubject,
|
|
33
33
|
enableChangeScope
|
|
34
34
|
} = useRelationshipsBrowserState(selector2);
|
|
35
|
-
const root =
|
|
36
|
-
const viewport =
|
|
37
|
-
const model = useLikeC4Model(
|
|
35
|
+
const root = useRef(null);
|
|
36
|
+
const viewport = useRef(null);
|
|
37
|
+
const model = useLikeC4Model();
|
|
38
38
|
const subject = model.findElement(subjectId);
|
|
39
39
|
const data = useLikeC4ElementsTree(scope === "view" && viewId ? viewId : void 0);
|
|
40
40
|
const tree = useTree({
|
|
41
41
|
multiple: false
|
|
42
42
|
});
|
|
43
43
|
tree.setHoveredNode = setHoveredNode;
|
|
44
|
-
|
|
44
|
+
useEffect(() => {
|
|
45
45
|
ancestorsFqn(subjectId).reverse().forEach((id) => {
|
|
46
46
|
tree.expand(id);
|
|
47
47
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Color, DiagramNode, Fqn, IconUrl, NonEmptyArray, RelationId, RelationshipLineType, ViewId } from '@likec4/core';
|
|
1
|
+
import { Color, DiagramNode, Fqn, IconUrl, NonEmptyArray, RelationId, RelationshipLineType, ViewId } from '@likec4/core/types';
|
|
2
|
+
import { Simplify } from 'type-fest';
|
|
2
3
|
import { Base, NonOptional, ReactFlowEdge, ReactFlowNode } from '../../base/types';
|
|
3
4
|
export declare namespace RelationshipsBrowserTypes {
|
|
4
5
|
type Column = 'incomers' | 'subjects' | 'outgoers';
|
|
@@ -9,14 +10,14 @@ export declare namespace RelationshipsBrowserTypes {
|
|
|
9
10
|
in: string[];
|
|
10
11
|
out: string[];
|
|
11
12
|
};
|
|
12
|
-
type ElementNodeData = Base.NodeData
|
|
13
|
+
type ElementNodeData = Simplify<Base.NodeData & NonOptional<Pick<DiagramNode, 'title' | 'technology' | 'description' | 'color' | 'shape' | 'style' | 'width' | 'height' | 'tags' | 'navigateTo'>> & {
|
|
13
14
|
column: Column;
|
|
14
15
|
fqn: Fqn;
|
|
15
16
|
icon: string | null;
|
|
16
17
|
ports: Ports;
|
|
17
18
|
existsInCurrentView: boolean;
|
|
18
19
|
}>;
|
|
19
|
-
type CompoundNodeData = Base.NodeData
|
|
20
|
+
type CompoundNodeData = Simplify<Base.NodeData & NonOptional<Pick<DiagramNode, 'title' | 'color' | 'shape' | 'style'>> & {
|
|
20
21
|
column: Column;
|
|
21
22
|
fqn: Fqn;
|
|
22
23
|
depth: number;
|
|
@@ -26,13 +27,13 @@ export declare namespace RelationshipsBrowserTypes {
|
|
|
26
27
|
}>;
|
|
27
28
|
type ElementNode = ReactFlowNode<ElementNodeData, 'element'>;
|
|
28
29
|
type CompoundNode = ReactFlowNode<CompoundNodeData, 'compound'>;
|
|
29
|
-
type EmptyNodeData = Base.NodeData
|
|
30
|
+
type EmptyNodeData = Base.NodeData & {
|
|
30
31
|
column: Column;
|
|
31
|
-
}
|
|
32
|
+
};
|
|
32
33
|
type EmptyNode = ReactFlowNode<EmptyNodeData, 'empty'>;
|
|
33
34
|
type Node = ElementNode | CompoundNode | EmptyNode;
|
|
34
35
|
type NodeData = Node['data'];
|
|
35
|
-
type EdgeData = Base.EdgeData
|
|
36
|
+
type EdgeData = Simplify<Base.EdgeData & {
|
|
36
37
|
sourceFqn: Fqn;
|
|
37
38
|
targetFqn: Fqn;
|
|
38
39
|
relations: NonEmptyArray<RelationId>;
|