@likec4/diagram 1.26.2 → 1.27.1
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 +1 -1
- package/bundle/index.js +48937 -0
- package/dist/LikeC4CustomColors.js +27 -23
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +38 -43
- package/dist/LikeC4Diagram.props.d.ts +6 -0
- package/dist/LikeC4ModelProvider.js +6 -6
- package/dist/StaticLikeC4Diagram.js +5 -5
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/default-map.js +7 -0
- package/dist/base/Background.js +6 -6
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +75 -46
- package/dist/base/const.js +2 -5
- package/dist/base/primitives/NodeHandles.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +60 -33
- package/dist/base/primitives/compound/CompoundDetailsButton.js +66 -35
- package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +35 -7
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +131 -12
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +4 -20
- package/dist/base/primitives/compound/CompoundNodeContainer.js +99 -97
- package/dist/base/primitives/compound/CompoundTitle.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundTitle.js +74 -12
- package/dist/base/primitives/compound/actionbtns.css.d.ts +11 -0
- package/dist/base/primitives/compound/actionbtns.css.js +32 -0
- package/dist/base/primitives/customEdge.d.ts +5 -5
- package/dist/base/primitives/customEdge.js +6 -7
- package/dist/base/primitives/customNode.js +5 -6
- package/dist/base/primitives/edge/EdgeActionButton.js +10 -12
- package/dist/base/primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeContainer.js +21 -15
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +24 -10
- package/dist/base/primitives/edge/EdgeLabel.css.js +130 -20
- package/dist/base/primitives/edge/EdgeLabel.d.ts +4 -44
- package/dist/base/primitives/edge/EdgeLabel.js +35 -88
- package/dist/base/primitives/edge/EdgeLabelContainer.d.ts +18 -0
- package/dist/base/primitives/edge/EdgeLabelContainer.js +91 -0
- package/dist/base/primitives/edge/EdgeMarkers.js +5 -6
- package/dist/base/primitives/edge/EdgePath.d.ts +7 -7
- package/dist/base/primitives/edge/EdgePath.js +14 -29
- package/dist/base/primitives/edge/edge.css.d.ts +2 -2
- package/dist/base/primitives/edge/edge.css.js +125 -12
- package/dist/base/primitives/edge/xyvars.d.ts +24 -0
- package/dist/base/primitives/element/ElementActionButtons.js +35 -17
- package/dist/base/primitives/element/ElementDetailsButton.js +34 -16
- package/dist/base/primitives/element/ElementNodeContainer.css.d.ts +0 -1
- package/dist/base/primitives/element/ElementNodeContainer.css.js +51 -5
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +1 -1
- package/dist/base/primitives/element/ElementNodeContainer.js +28 -19
- package/dist/base/primitives/element/ElementShape.css.js +107 -16
- package/dist/base/primitives/element/ElementShape.js +8 -10
- package/dist/base/primitives/element/ElementTitle.css.d.ts +33 -8
- package/dist/base/primitives/element/ElementTitle.css.js +196 -19
- package/dist/base/primitives/element/ElementTitle.js +25 -24
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/base/types.js +6 -6
- package/dist/base/updateEdges.js +5 -5
- package/dist/base/updateNodes.js +6 -6
- package/dist/bundle/LikeC4ModelProvider.d.ts +9 -0
- package/dist/bundle/LikeC4ModelProvider.js +5 -0
- package/dist/bundle/LikeC4View.d.ts +2 -0
- package/dist/bundle/LikeC4View.js +176 -0
- package/dist/bundle/LikeC4View.props.d.ts +207 -0
- package/dist/bundle/ReactLikeC4.d.ts +36 -0
- package/dist/bundle/ReactLikeC4.js +90 -0
- package/dist/bundle/ShadowRoot.d.ts +12 -0
- package/dist/bundle/ShadowRoot.js +52 -0
- package/dist/bundle/ViewNotFound.d.ts +5 -0
- package/dist/bundle/ViewNotFound.js +30 -0
- package/dist/bundle/font.css.js +3 -0
- package/dist/bundle/index.d.ts +5 -0
- package/dist/bundle/index.js +4 -0
- package/dist/bundle/styles.css.d.ts +10 -0
- package/dist/bundle/styles.css.js +145 -0
- package/dist/components/Link.js +62 -13
- package/dist/components/SearchControl.css.js +72 -9
- package/dist/components/SearchControl.js +11 -11
- package/dist/context/ControlsCustomLayout.js +5 -6
- package/dist/context/DiagramEventHandlers.js +8 -13
- package/dist/context/DiagramFeatures.js +7 -12
- package/dist/context/EnsureMantine.js +6 -6
- package/dist/context/FramerMotionConfig.js +8 -9
- package/dist/context/IconRenderer.js +7 -9
- package/dist/context/ReduceGraphics.d.ts +4 -5
- package/dist/context/ReduceGraphics.js +11 -43
- package/dist/context/RootContainer.js +23 -10
- package/dist/hooks/safeContext.js +5 -7
- package/dist/hooks/useCurrentViewId.js +6 -6
- package/dist/hooks/useDiagram.d.ts +5763 -5286
- package/dist/hooks/useDiagram.js +13 -17
- package/dist/hooks/useMantinePortalProps.js +5 -5
- package/dist/hooks/useOverlaysActor.d.ts +2 -0
- package/dist/hooks/useOverlaysActor.js +10 -0
- package/dist/hooks/useReducedGraphics.d.ts +1 -1
- package/dist/hooks/useSetState.js +5 -5
- package/dist/hooks/useUpdateEffect.js +6 -7
- package/dist/hooks/useXYFlow.d.ts +28 -28
- package/dist/hooks/useXYFlow.js +7 -11
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -26
- package/dist/likec4diagram/DiagramUI.js +13 -13
- package/dist/likec4diagram/DiagramXYFlow.d.ts +1 -4
- package/dist/likec4diagram/DiagramXYFlow.js +83 -37
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +21 -7
- package/dist/likec4diagram/custom/edges/NotePopover.js +18 -27
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +9 -9
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +127 -122
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +38 -11
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +3 -3
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +28 -30
- package/dist/likec4diagram/custom/edges/edges.css.js +44 -9
- package/dist/likec4diagram/custom/edges/utils.js +6 -7
- package/dist/likec4diagram/custom/index.d.ts +9 -9
- package/dist/likec4diagram/custom/index.js +5 -6
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +7 -7
- package/dist/likec4diagram/custom/nodes/ElementActions.js +8 -9
- package/dist/likec4diagram/custom/nodes/nodeTypes.js +22 -26
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +10 -13
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +15 -16
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -13
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +17 -14
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +15 -20
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +15 -5
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +15 -15
- package/dist/likec4diagram/ui/controls/Controls.js +24 -24
- package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +19 -12
- package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +8 -8
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +8 -8
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +7 -7
- package/dist/likec4diagram/ui/controls/_shared.js +4 -5
- package/dist/likec4diagram/ui/controls/styles.css.js +79 -17
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +49 -9
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +12 -12
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +85 -15
- package/dist/likec4diagram/ui/notation/NotationPanel.js +32 -32
- package/dist/likec4diagram/ui/search/ElementsColumn.css.d.ts +0 -5
- package/dist/likec4diagram/ui/search/ElementsColumn.css.js +70 -30
- package/dist/likec4diagram/ui/search/ElementsColumn.js +40 -33
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +87 -20
- package/dist/likec4diagram/ui/search/LikeC4Search.js +18 -17
- package/dist/likec4diagram/ui/search/SearchInput.js +22 -24
- package/dist/likec4diagram/ui/search/ViewsColum.js +22 -22
- package/dist/likec4diagram/ui/search/ViewsColumn.css.d.ts +0 -2
- package/dist/likec4diagram/ui/search/ViewsColumn.css.js +29 -14
- package/dist/likec4diagram/ui/search/_shared.css.d.ts +3 -17
- package/dist/likec4diagram/ui/search/_shared.css.js +171 -0
- package/dist/likec4diagram/ui/search/state.js +12 -22
- package/dist/likec4diagram/ui/search/utils.js +2 -5
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +66 -10
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +18 -27
- package/dist/likec4diagram/useLayoutConstraints.d.ts +11 -10
- package/dist/likec4diagram/useLayoutConstraints.js +100 -104
- package/dist/likec4diagram/useViewToNodesEdges.js +12 -13
- package/dist/likec4model/LikeC4ModelContext.js +4 -4
- package/dist/likec4model/useLikeC4ElementsTree.js +6 -7
- package/dist/likec4model/useLikeC4Model.js +6 -6
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/default-map.js +172 -0
- package/dist/overlays/Overlays.js +22 -22
- package/dist/overlays/element-details/ElementDetails.js +9 -9
- package/dist/overlays/element-details/ElementDetailsCard.css.d.ts +2 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.js +237 -35
- package/dist/overlays/element-details/ElementDetailsCard.js +44 -46
- package/dist/overlays/element-details/TabPanelDeployments.css.js +62 -11
- package/dist/overlays/element-details/TabPanelDeployments.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.css.js +99 -9
- package/dist/overlays/element-details/TabPanelRelationships.js +41 -14
- package/dist/overlays/element-details/TabPanelStructure.css.js +36 -7
- package/dist/overlays/element-details/TabPanelStructure.js +8 -9
- package/dist/overlays/element-details/actor.d.ts +21892 -22686
- package/dist/overlays/element-details/actor.js +18 -19
- package/dist/overlays/element-details/actorContext.js +4 -5
- package/dist/overlays/overlay/Overlay.css.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.css.js +76 -98
- package/dist/overlays/overlay/Overlay.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.js +99 -94
- package/dist/overlays/overlaysActor.d.ts +6 -6
- package/dist/overlays/overlaysActor.js +17 -18
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +49 -0
- package/dist/overlays/relationship-details/RelationshipDetails.js +24 -17
- package/dist/overlays/relationship-details/SelectEdge.css.js +82 -17
- package/dist/overlays/relationship-details/SelectEdge.js +15 -17
- package/dist/overlays/relationship-details/actor.js +9 -9
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -8
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +44 -46
- package/dist/overlays/relationship-details/custom/edgeTypes.js +49 -50
- package/dist/overlays/relationship-details/custom/index.d.ts +2 -2
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +28 -30
- package/dist/overlays/relationship-details/custom/nodeTypes.js +31 -35
- package/dist/overlays/relationship-details/hooks.js +9 -13
- package/dist/overlays/relationship-details/useLayoutedDetails.js +17 -19
- package/dist/overlays/relationships-browser/-useRelationshipsView.d.ts +8 -24
- package/dist/overlays/relationships-browser/-useRelationshipsView.js +50 -85
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +48 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +101 -101
- package/dist/overlays/relationships-browser/SelectElement.css.js +22 -9
- package/dist/overlays/relationships-browser/SelectElement.d.ts +2 -7
- package/dist/overlays/relationships-browser/SelectElement.js +196 -112
- package/dist/overlays/relationships-browser/_types.d.ts +4 -1
- package/dist/overlays/relationships-browser/actor.d.ts +478 -351
- package/dist/overlays/relationships-browser/actor.js +108 -94
- package/dist/overlays/relationships-browser/const.d.ts +1 -1
- package/dist/overlays/relationships-browser/const.js +3 -4
- package/dist/overlays/relationships-browser/custom/ElementActions.js +9 -9
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +6 -6
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +43 -44
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +97 -65
- package/dist/overlays/relationships-browser/custom/index.d.ts +2 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +37 -37
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +36 -40
- package/dist/overlays/relationships-browser/custom/styles.css.js +14 -5
- package/dist/overlays/relationships-browser/hooks.d.ts +14 -6
- package/dist/overlays/relationships-browser/hooks.js +25 -16
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +13 -18
- package/dist/packages/core/src/compute-view/relationships-view/compute.js +123 -0
- package/dist/packages/core/src/compute-view/relationships-view/utils.js +68 -0
- package/dist/packages/core/src/errors/index.js +15 -0
- package/dist/packages/core/src/utils/fqn.js +43 -0
- package/dist/packages/core/src/utils/guards.js +7 -0
- package/dist/packages/core/src/utils/iterable/filter.js +21 -0
- package/dist/packages/core/src/utils/iterable/map.js +18 -0
- package/dist/packages/core/src/utils/iterable/to.js +14 -0
- package/dist/src/index.ts.d.ts +2 -0
- package/dist/state/DiagramActorProvider.d.ts +4 -2
- package/dist/state/DiagramActorProvider.js +44 -52
- package/dist/state/aligners.js +22 -31
- package/dist/state/assign.js +13 -23
- package/dist/state/diagram-machine.d.ts +5988 -5461
- package/dist/state/diagram-machine.js +476 -376
- package/dist/state/hotkeyActor.js +5 -5
- package/dist/state/inspector.d.ts +1 -1
- package/dist/state/persistence.js +4 -4
- package/dist/state/syncManualLayoutActor.d.ts +1 -1
- package/dist/state/syncManualLayoutActor.js +10 -10
- package/dist/state/utils.js +4 -9
- package/dist/styles.css.js +3 -0
- package/dist/utils/vector.js +2 -4
- package/dist/utils/xyflow.js +7 -12
- package/package.json +43 -42
- package/src/LikeC4CustomColors.tsx +44 -20
- package/src/LikeC4Diagram.props.ts +32 -0
- package/src/LikeC4Diagram.tsx +17 -21
- package/src/base/BaseXYFlow.tsx +67 -43
- package/src/base/primitives/compound/CompoundActionButton.tsx +41 -20
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +48 -25
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +111 -111
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +92 -92
- package/src/base/primitives/compound/CompoundTitle.tsx +73 -7
- package/src/base/primitives/compound/actionbtns.css.ts +30 -0
- package/src/base/primitives/customEdge.ts +2 -3
- package/src/base/primitives/edge/EdgeActionButton.tsx +3 -5
- package/src/base/primitives/edge/EdgeContainer.tsx +17 -9
- package/src/base/primitives/edge/EdgeLabel.css.ts +110 -177
- package/src/base/primitives/edge/EdgeLabel.tsx +43 -114
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +118 -0
- package/src/base/primitives/edge/EdgePath.tsx +28 -37
- package/src/base/primitives/edge/edge.css.ts +107 -132
- package/src/base/primitives/edge/xyvars.ts +31 -0
- package/src/base/primitives/element/ElementActionButtons.tsx +30 -10
- package/src/base/primitives/element/ElementDetailsButton.tsx +27 -8
- package/src/base/primitives/element/ElementNodeContainer.css.ts +44 -70
- package/src/base/primitives/element/ElementNodeContainer.tsx +18 -8
- package/src/base/primitives/element/ElementShape.css.ts +70 -114
- package/src/base/primitives/element/ElementShape.tsx +0 -1
- package/src/base/primitives/element/ElementTitle.css.ts +169 -124
- package/src/base/primitives/element/ElementTitle.tsx +16 -16
- package/src/base/primitives/index.ts +1 -0
- package/src/base/types.ts +2 -2
- package/src/bundle/LikeC4ModelProvider.tsx +12 -0
- package/src/bundle/LikeC4View.props.ts +249 -0
- package/src/bundle/LikeC4View.tsx +196 -0
- package/src/bundle/ReactLikeC4.tsx +148 -0
- package/src/bundle/ShadowRoot.tsx +60 -0
- package/src/bundle/ViewNotFound.tsx +25 -0
- package/src/bundle/font.css +251 -0
- package/src/bundle/index.ts +7 -0
- package/src/bundle/react-dom-server-mock.ts +3 -0
- package/src/bundle/styles.css.ts +168 -0
- package/src/components/Link.tsx +59 -6
- package/src/components/SearchControl.css.ts +52 -59
- package/src/components/SearchControl.tsx +2 -5
- package/src/context/ReduceGraphics.tsx +9 -47
- package/src/context/RootContainer.tsx +21 -5
- package/src/hooks/safeContext.tsx +2 -3
- package/src/hooks/useCurrentViewId.ts +4 -4
- package/src/hooks/useDiagram.ts +4 -3
- package/src/hooks/useOverlaysActor.ts +11 -0
- package/src/hooks/useReducedGraphics.ts +8 -1
- package/src/hooks/useXYFlow.ts +2 -2
- package/src/index.ts +1 -3
- package/src/likec4diagram/DiagramUI.tsx +2 -2
- package/src/likec4diagram/DiagramXYFlow.tsx +83 -27
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +7 -13
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +108 -90
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +23 -44
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +26 -24
- package/src/likec4diagram/custom/edges/edges.css.ts +25 -32
- package/src/likec4diagram/custom/nodes/nodeTypes.tsx +2 -2
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +10 -6
- package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +8 -4
- package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +8 -4
- package/src/likec4diagram/ui/controls/styles.css.ts +46 -57
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +38 -34
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +4 -4
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +44 -56
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +17 -14
- package/src/likec4diagram/ui/search/ElementsColumn.css.ts +80 -85
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +21 -14
- package/src/likec4diagram/ui/search/LikeC4Search.css.ts +50 -67
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +1 -2
- package/src/likec4diagram/ui/search/SearchInput.tsx +2 -2
- package/src/likec4diagram/ui/search/ViewsColum.tsx +10 -7
- package/src/likec4diagram/ui/search/ViewsColumn.css.ts +29 -28
- package/src/likec4diagram/ui/search/_shared.css.ts +158 -74
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +31 -34
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +6 -6
- package/src/likec4diagram/useLayoutConstraints.ts +84 -89
- package/src/likec4diagram/useViewToNodesEdges.ts +2 -1
- package/src/overlays/Overlays.tsx +7 -5
- package/src/overlays/element-details/ElementDetailsCard.css.ts +143 -177
- package/src/overlays/element-details/ElementDetailsCard.tsx +29 -29
- package/src/overlays/element-details/TabPanelDeployments.css.ts +49 -54
- package/src/overlays/element-details/TabPanelRelationships.css.ts +62 -66
- package/src/overlays/element-details/TabPanelRelationships.tsx +32 -3
- package/src/overlays/element-details/TabPanelStructure.css.ts +26 -26
- package/src/overlays/element-details/actor.ts +4 -2
- package/src/overlays/overlay/Overlay.css.ts +53 -47
- package/src/overlays/overlay/Overlay.tsx +102 -98
- package/src/overlays/overlaysActor.ts +1 -0
- package/src/overlays/relationship-details/RelationshipDetails.tsx +15 -3
- package/src/overlays/relationship-details/SelectEdge.css.ts +52 -71
- package/src/overlays/relationship-details/SelectEdge.tsx +1 -2
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +35 -30
- package/src/overlays/relationship-details/custom/index.ts +2 -0
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +20 -24
- package/src/overlays/relationship-details/custom/styles.css.ts +8 -8
- package/src/overlays/relationship-details/useLayoutedDetails.ts +1 -1
- package/src/overlays/relationships-browser/-useRelationshipsView.ts +55 -82
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +39 -36
- package/src/overlays/relationships-browser/SelectElement.css.ts +9 -12
- package/src/overlays/relationships-browser/SelectElement.tsx +192 -105
- package/src/overlays/relationships-browser/_types.ts +4 -9
- package/src/overlays/relationships-browser/actor.ts +144 -123
- package/src/overlays/relationships-browser/const.ts +1 -1
- package/src/overlays/relationships-browser/custom/EmptyNode.tsx +2 -2
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +95 -59
- package/src/overlays/relationships-browser/custom/index.ts +2 -0
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +25 -26
- package/src/overlays/relationships-browser/custom/styles.css.ts +5 -6
- package/src/overlays/relationships-browser/hooks.ts +17 -3
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +4 -10
- package/src/state/DiagramActorProvider.tsx +37 -46
- package/src/state/assign.ts +2 -2
- package/src/state/diagram-machine.ts +477 -366
- package/src/state/inspector.ts +1 -1
- package/src/styles.css +3 -0
- package/dist/LikeC4Diagram.css.d.ts +0 -8
- package/dist/LikeC4Diagram.css.js +0 -11
- package/dist/base/example/RelationshipsBrowser.d.ts +0 -6
- package/dist/base/example/_types.d.ts +0 -20
- package/dist/base/example/custom.d.ts +0 -72
- package/dist/base/example/useViewToNodesEdges.d.ts +0 -6
- package/dist/base/primitives/compound/CompoundActionButton.css.d.ts +0 -2
- package/dist/base/primitives/compound/CompoundActionButton.css.js +0 -8
- package/dist/base/primitives/compound/CompoundDetailsButton.css.d.ts +0 -3
- package/dist/base/primitives/compound/CompoundDetailsButton.css.js +0 -8
- package/dist/base/primitives/compound/CompoundTitle.css.d.ts +0 -3
- package/dist/base/primitives/compound/CompoundTitle.css.js +0 -10
- package/dist/base/primitives/element/ElementActionButtons.css.d.ts +0 -3
- package/dist/base/primitives/element/ElementActionButtons.css.js +0 -10
- package/dist/base/primitives/element/ElementDetailsButton.css.d.ts +0 -3
- package/dist/base/primitives/element/ElementDetailsButton.css.js +0 -8
- package/dist/base/primitives/element/vars.css.d.ts +0 -3
- package/dist/base/primitives/element/vars.css.ts.vanilla.css.js +0 -1
- package/dist/components/Link.css.d.ts +0 -3
- package/dist/components/Link.css.js +0 -9
- package/dist/diagram.css +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Accordion/Accordion.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Affix/Affix.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Alert/Alert.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Anchor/Anchor.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AngleSlider/AngleSlider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AppShell/AppShell.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AspectRatio/AspectRatio.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Avatar/Avatar.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/BackgroundImage/BackgroundImage.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Badge/Badge.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Blockquote/Blockquote.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Breadcrumbs/Breadcrumbs.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Burger/Burger.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Button/Button.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Card/Card.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Center/Center.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Chip/Chip.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/CloseButton/CloseButton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Code/Code.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorInput/ColorInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorPicker/ColorPicker.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorSwatch/ColorSwatch.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Combobox/Combobox.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Container/Container.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Dialog/Dialog.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Divider/Divider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Drawer/Drawer.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Fieldset/Fieldset.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Flex/Flex.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/FloatingIndicator/FloatingIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Grid/Grid.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Group/Group.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Image/Image.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Indicator/Indicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/InlineInput/InlineInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Input/Input.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Kbd/Kbd.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/List/List.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Loader/Loader.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/LoadingOverlay/LoadingOverlay.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Mark/Mark.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Menu/Menu.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Modal/Modal.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ModalBase/ModalBase.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/NavLink/NavLink.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Notification/Notification.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/NumberInput/NumberInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Overlay/Overlay.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Pagination/Pagination.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Paper/Paper.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PasswordInput/PasswordInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Pill/Pill.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PillsInput/PillsInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PinInput/PinInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Popover/Popover.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Progress/Progress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/Radio.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/RadioCard/RadioCard.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Rating/Rating.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/RingProgress/RingProgress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SegmentedControl/SegmentedControl.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SemiCircleProgress/SemiCircleProgress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SimpleGrid/SimpleGrid.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Skeleton/Skeleton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Slider/Slider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Spoiler/Spoiler.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Stack/Stack.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Stepper/Stepper.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Switch/Switch.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Table/Table.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/TableOfContents/TableOfContents.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tabs/Tabs.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Timeline/Timeline.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Title/Title.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tree/Tree.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/VisuallyHidden/VisuallyHidden.module.css.mjs.vanilla.css.js +0 -1
- package/dist/theme-vars.css.d.ts +0 -63
- package/dist/theme-vars.css.js +0 -7
- package/dist/theme-vars.css.ts.vanilla.css.js +0 -1
- package/dist/theme-vars.d.ts +0 -16
- package/dist/theme-vars.js +0 -7
- package/dist/utils/css.js +0 -10
- package/src/LikeC4Diagram.css.ts +0 -198
- package/src/base/example/RelationshipsBrowser.tsx +0 -62
- package/src/base/example/_types.ts +0 -72
- package/src/base/example/custom.tsx +0 -58
- package/src/base/example/useViewToNodesEdges.ts +0 -194
- package/src/base/primitives/compound/CompoundActionButton.css.ts +0 -52
- package/src/base/primitives/compound/CompoundDetailsButton.css.ts +0 -58
- package/src/base/primitives/compound/CompoundTitle.css.ts +0 -65
- package/src/base/primitives/element/ElementActionButtons.css.ts +0 -52
- package/src/base/primitives/element/ElementDetailsButton.css.ts +0 -50
- package/src/base/primitives/element/vars.css.ts +0 -5
- package/src/components/Link.css.ts +0 -49
- package/src/overlays/relationship-details/custom/index.tsx +0 -2
- package/src/overlays/relationships-browser/custom/index.tsx +0 -2
- package/src/theme-vars.css.ts +0 -69
- package/src/theme-vars.ts +0 -25
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from
|
|
2
|
-
import { ElementActions } from
|
|
3
|
-
import { Handle } from
|
|
4
|
-
import { Position } from
|
|
5
|
-
import { useDiagram } from
|
|
6
|
-
import { customNode } from
|
|
7
|
-
import { CompoundNodeContainer } from
|
|
8
|
-
import { CompoundTitle } from
|
|
9
|
-
import { ElementNodeContainer } from
|
|
10
|
-
import { ElementShape } from
|
|
11
|
-
import { ElementTitle } from
|
|
12
|
-
import { ElementDetailsButton } from
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ElementActions } from './ElementActions.js';
|
|
3
|
+
import { Handle } from '@xyflow/react';
|
|
4
|
+
import { Position } from '@xyflow/system';
|
|
5
|
+
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
6
|
+
import { customNode } from '../../../base/primitives/customNode.js';
|
|
7
|
+
import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
|
|
8
|
+
import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.js';
|
|
9
|
+
import { ElementNodeContainer } from '../../../base/primitives/element/ElementNodeContainer.js';
|
|
10
|
+
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
11
|
+
import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
|
|
12
|
+
import { ElementDetailsButton } from '../../../base/primitives/element/ElementDetailsButton.js';
|
|
13
|
+
|
|
13
14
|
const ElementDetailsButtonWithHandler = (props) => {
|
|
14
15
|
const diagram = useDiagram();
|
|
15
16
|
return /* @__PURE__ */ jsx(
|
|
@@ -23,24 +24,22 @@ const ElementDetailsButtonWithHandler = (props) => {
|
|
|
23
24
|
}
|
|
24
25
|
);
|
|
25
26
|
};
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
};
|
|
27
|
+
const ElementNode = customNode((props) => {
|
|
28
|
+
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
30
|
+
/* @__PURE__ */ jsx(ElementTitle, { ...props, iconSize: 40 }),
|
|
31
|
+
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
32
|
+
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
33
|
+
/* @__PURE__ */ jsx(ElementPorts, { ...props })
|
|
34
|
+
] });
|
|
35
|
+
});
|
|
36
|
+
const CompoundNode = customNode((props) => {
|
|
37
|
+
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
39
|
+
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
40
|
+
/* @__PURE__ */ jsx(CompoundPorts, { ...props })
|
|
41
|
+
] });
|
|
42
|
+
});
|
|
44
43
|
const ElementPorts = ({ data: { ports, height: h } }) => {
|
|
45
44
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
45
|
ports.in.map((id, i) => /* @__PURE__ */ jsx(
|
|
@@ -99,8 +98,5 @@ const CompoundPorts = ({ data }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
99
98
|
id
|
|
100
99
|
))
|
|
101
100
|
] });
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ElementPorts,
|
|
105
|
-
nodeTypes
|
|
106
|
-
};
|
|
101
|
+
|
|
102
|
+
export { CompoundNode, CompoundPorts, ElementNode, ElementPorts };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { nonNullable } from
|
|
2
|
-
import { useCallbackRef } from
|
|
3
|
-
import { useSelector } from
|
|
4
|
-
import { shallowEqual } from
|
|
5
|
-
import { createContext, useTransition, useMemo, useContext } from
|
|
1
|
+
import { nonNullable } from '@likec4/core';
|
|
2
|
+
import { useCallbackRef } from '@mantine/hooks';
|
|
3
|
+
import { useSelector } from '@xstate/react';
|
|
4
|
+
import { shallowEqual } from 'fast-equals';
|
|
5
|
+
import { createContext, useTransition, useMemo, useContext } from 'react';
|
|
6
|
+
|
|
6
7
|
const RelationshipDetailsActorContext = createContext(null);
|
|
7
8
|
function useRelationshipDetailsActor() {
|
|
8
9
|
return nonNullable(useContext(RelationshipDetailsActorContext), "No RelationshipDetailsActorContext");
|
|
@@ -33,18 +34,13 @@ function useRelationshipDetails() {
|
|
|
33
34
|
});
|
|
34
35
|
},
|
|
35
36
|
close: () => {
|
|
36
|
-
var _a;
|
|
37
37
|
if (actor._parent) {
|
|
38
|
-
|
|
38
|
+
actor._parent?.send({ type: "close", actorId: actor.id });
|
|
39
39
|
} else {
|
|
40
40
|
actor.send({ type: "close" });
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}), [actor]);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
useRelationshipDetails,
|
|
48
|
-
useRelationshipDetailsActor,
|
|
49
|
-
useRelationshipDetailsState
|
|
50
|
-
};
|
|
45
|
+
|
|
46
|
+
export { RelationshipDetailsActorContext, useRelationshipDetails, useRelationshipDetailsActor, useRelationshipDetailsState };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import dagre from
|
|
2
|
-
import { invariant, compareRelations, compareFqnHierarchically, isAncestor } from
|
|
3
|
-
import { useMemo } from
|
|
4
|
-
import { pipe, sort, reverse, forEach, takeWhile, first, map, sortBy, prop, filter, isTruthy } from
|
|
5
|
-
import { useLikeC4Model } from
|
|
1
|
+
import dagre from '@dagrejs/dagre';
|
|
2
|
+
import { invariant, compareRelations, compareFqnHierarchically, isAncestor } from '@likec4/core';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { pipe, sort, reverse, forEach, takeWhile, first, map, sortBy, prop, filter, isTruthy } from 'remeda';
|
|
5
|
+
import { useLikeC4Model } from '../../likec4model/useLikeC4Model.js';
|
|
6
|
+
|
|
6
7
|
const Sizes = {
|
|
7
8
|
dagre: {
|
|
8
9
|
ranksep: 60,
|
|
@@ -47,24 +48,23 @@ const graphId = (node) => ({
|
|
|
47
48
|
port: node.type === "compound" ? `${node.id}::port` : node.id
|
|
48
49
|
});
|
|
49
50
|
function nodeData(element, ctx) {
|
|
50
|
-
var _a;
|
|
51
51
|
let diagramNode = ctx.diagramNodes.get(element.id);
|
|
52
52
|
const ancestor = diagramNode ?? pipe(
|
|
53
|
-
element.ancestors()
|
|
53
|
+
[...element.ancestors()],
|
|
54
54
|
map((ancestor2) => ctx.diagramNodes.get(ancestor2.id)),
|
|
55
55
|
filter(isTruthy),
|
|
56
56
|
first()
|
|
57
57
|
);
|
|
58
58
|
return {
|
|
59
59
|
fqn: element.id,
|
|
60
|
-
title:
|
|
61
|
-
technology:
|
|
62
|
-
description:
|
|
63
|
-
color:
|
|
64
|
-
shape:
|
|
65
|
-
icon:
|
|
66
|
-
style:
|
|
67
|
-
navigateTo:
|
|
60
|
+
title: diagramNode?.title ?? element.title,
|
|
61
|
+
technology: diagramNode?.technology ?? element.technology,
|
|
62
|
+
description: diagramNode?.description ?? element.description,
|
|
63
|
+
color: diagramNode?.color ?? ancestor?.color ?? element.color,
|
|
64
|
+
shape: diagramNode?.shape ?? element.shape,
|
|
65
|
+
icon: diagramNode?.icon ?? element.icon ?? "none",
|
|
66
|
+
style: diagramNode?.style ?? element.$element.style ?? {},
|
|
67
|
+
navigateTo: diagramNode?.navigateTo ?? first(element.scopedViews().take(1).toArray())?.id ?? null,
|
|
68
68
|
width: 0,
|
|
69
69
|
height: 0,
|
|
70
70
|
depth: 1,
|
|
@@ -263,7 +263,5 @@ function useLayoutedDetails(edgeId, view) {
|
|
|
263
263
|
layout
|
|
264
264
|
]);
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
useLayoutedDetails
|
|
269
|
-
};
|
|
266
|
+
|
|
267
|
+
export { ZIndexes, useLayoutedDetails };
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { RelationshipsViewData } from '@likec4/core/compute-view/relationships';
|
|
1
2
|
import { DiagramEdge, DiagramNode, DiagramView, ElementKind, Fqn, ViewId } from '@likec4/core/types';
|
|
2
|
-
import {
|
|
3
|
+
import { AnyAux, LikeC4ViewModel } from '@likec4/core/model';
|
|
3
4
|
import { RelationshipsBrowserTypes } from './_types';
|
|
4
|
-
export type RelationshipsViewData = {
|
|
5
|
-
incomers: ReadonlySet<ElementModel>;
|
|
6
|
-
incoming: ReadonlySet<RelationshipModel>;
|
|
7
|
-
subjects: ReadonlySet<ElementModel>;
|
|
8
|
-
outgoing: ReadonlySet<RelationshipModel>;
|
|
9
|
-
outgoers: ReadonlySet<ElementModel>;
|
|
10
|
-
};
|
|
11
5
|
export type LayoutRelationshipsViewResult = {
|
|
6
|
+
subject: Fqn;
|
|
7
|
+
subjectExistsInScope: boolean;
|
|
12
8
|
nodes: LayoutRelationshipsViewResult.Node[];
|
|
13
9
|
edges: LayoutRelationshipsViewResult.Edge[];
|
|
14
10
|
bounds: DiagramView['bounds'];
|
|
@@ -18,25 +14,13 @@ export declare namespace LayoutRelationshipsViewResult {
|
|
|
18
14
|
type Node = DiagramNode & {
|
|
19
15
|
column: RelationshipsBrowserTypes.Column;
|
|
20
16
|
ports: RelationshipsBrowserTypes.Ports;
|
|
17
|
+
existsInCurrentView: boolean;
|
|
21
18
|
};
|
|
22
19
|
type Edge = DiagramEdge & {
|
|
23
20
|
sourceHandle: string;
|
|
24
21
|
targetHandle: string;
|
|
22
|
+
existsInCurrentView: boolean;
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
|
-
export declare function layoutRelationshipsView(data: RelationshipsViewData): LayoutRelationshipsViewResult
|
|
28
|
-
export declare function useRelationshipsView(
|
|
29
|
-
nodes: LayoutRelationshipsViewResult.Node[];
|
|
30
|
-
edges: LayoutRelationshipsViewResult.Edge[];
|
|
31
|
-
bounds: DiagramView["bounds"];
|
|
32
|
-
id: ViewId;
|
|
33
|
-
title: string;
|
|
34
|
-
description: null;
|
|
35
|
-
autoLayout: {
|
|
36
|
-
direction: string;
|
|
37
|
-
};
|
|
38
|
-
tags: null;
|
|
39
|
-
links: null;
|
|
40
|
-
hash: string;
|
|
41
|
-
customColorDefinitions: {};
|
|
42
|
-
};
|
|
25
|
+
export declare function layoutRelationshipsView(data: RelationshipsViewData, scope: LikeC4ViewModel<AnyAux> | null): Omit<LayoutRelationshipsViewResult, 'subject'>;
|
|
26
|
+
export declare function useRelationshipsView(subject: Fqn, viewId: ViewId | null, scope: 'global' | 'view'): LayoutRelationshipsViewResult;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, find, only,
|
|
5
|
-
import { useLikeC4Model } from
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import dagre from '@dagrejs/dagre';
|
|
3
|
+
import { toArray, invariant, ifind, DefaultMap } from '@likec4/core';
|
|
4
|
+
import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, find, only, unique, tap, reduce, sortBy } from 'remeda';
|
|
5
|
+
import { useLikeC4Model } from '../../likec4model/useLikeC4Model.js';
|
|
6
|
+
import { computeRelationshipsView } from '../../packages/core/src/compute-view/relationships-view/compute.js';
|
|
7
|
+
import { treeFromElements } from '../../packages/core/src/compute-view/relationships-view/utils.js';
|
|
8
|
+
|
|
6
9
|
const Sizes = {
|
|
7
10
|
dagre: {
|
|
8
11
|
ranksep: 60,
|
|
@@ -39,35 +42,6 @@ function createGraph() {
|
|
|
39
42
|
return g;
|
|
40
43
|
}
|
|
41
44
|
const PortSuffix = "-port";
|
|
42
|
-
function treeFromElements(elements) {
|
|
43
|
-
const sorted = sortParentsFirst([...elements]);
|
|
44
|
-
const root = new Set(sorted);
|
|
45
|
-
const map2 = new Map(sorted.map((e) => [e.id, e]));
|
|
46
|
-
const parents = new DefaultMap(() => null);
|
|
47
|
-
const children = sorted.reduce((acc, parent, index, all) => {
|
|
48
|
-
acc.set(
|
|
49
|
-
parent,
|
|
50
|
-
all.slice(index + 1).filter(isDescendantOf(parent)).map((e) => {
|
|
51
|
-
root.delete(e);
|
|
52
|
-
return e;
|
|
53
|
-
}).reduce((acc2, el) => {
|
|
54
|
-
if (!acc2.some(isAncestor(el))) {
|
|
55
|
-
acc2.push(el);
|
|
56
|
-
parents.set(el, parent);
|
|
57
|
-
}
|
|
58
|
-
return acc2;
|
|
59
|
-
}, [])
|
|
60
|
-
);
|
|
61
|
-
return acc;
|
|
62
|
-
}, new DefaultMap(() => []));
|
|
63
|
-
return {
|
|
64
|
-
sorted,
|
|
65
|
-
byId: (id) => nonNullable(map2.get(id), `Element not found by id: ${id}`),
|
|
66
|
-
root,
|
|
67
|
-
parent: (el) => parents.get(el),
|
|
68
|
-
children: (el) => children.get(el)
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
45
|
function createNodes(column, elements, g) {
|
|
72
46
|
const graphNodes = new DefaultMap((key) => ({
|
|
73
47
|
id: `${column}-${key}`,
|
|
@@ -144,8 +118,7 @@ var LayoutRelationshipsViewResult;
|
|
|
144
118
|
((LayoutRelationshipsViewResult2) => {
|
|
145
119
|
LayoutRelationshipsViewResult2.Empty = "@empty";
|
|
146
120
|
})(LayoutRelationshipsViewResult || (LayoutRelationshipsViewResult = {}));
|
|
147
|
-
function layoutRelationshipsView(data) {
|
|
148
|
-
var _a, _b;
|
|
121
|
+
function layoutRelationshipsView(data, scope) {
|
|
149
122
|
const g = createGraph();
|
|
150
123
|
const incomers = createNodes("incomers", data.incomers, g), subjects = createNodes("subjects", data.subjects, g), outgoers = createNodes("outgoers", data.outgoers, g);
|
|
151
124
|
const edges = [];
|
|
@@ -158,9 +131,7 @@ function layoutRelationshipsView(data) {
|
|
|
158
131
|
source: incomers.byId(r.source.id).graph,
|
|
159
132
|
target: subjects.byId(r.target.id).graph,
|
|
160
133
|
relation: r
|
|
161
|
-
}))
|
|
162
|
-
// Sort by source
|
|
163
|
-
sortParentsFirst
|
|
134
|
+
}))
|
|
164
135
|
),
|
|
165
136
|
pipe(
|
|
166
137
|
toArray(data.outgoing),
|
|
@@ -169,9 +140,7 @@ function layoutRelationshipsView(data) {
|
|
|
169
140
|
source: subjects.byId(r.source.id).graph,
|
|
170
141
|
target: outgoers.byId(r.target.id).graph,
|
|
171
142
|
relation: r
|
|
172
|
-
}))
|
|
173
|
-
// Sort by target
|
|
174
|
-
sortParentsFirst
|
|
143
|
+
}))
|
|
175
144
|
)
|
|
176
145
|
),
|
|
177
146
|
map((r) => ({
|
|
@@ -205,7 +174,7 @@ function layoutRelationshipsView(data) {
|
|
|
205
174
|
if (node.isCompound) {
|
|
206
175
|
continue;
|
|
207
176
|
}
|
|
208
|
-
const edgeCount2 = Math.max(
|
|
177
|
+
const edgeCount2 = Math.max(g.inEdges(nodeId)?.length ?? 0, g.outEdges(nodeId)?.length ?? 0);
|
|
209
178
|
if (edgeCount2 > 2) {
|
|
210
179
|
node.height = node.height + (edgeCount2 - 3) * 14;
|
|
211
180
|
}
|
|
@@ -272,7 +241,7 @@ function layoutRelationshipsView(data) {
|
|
|
272
241
|
mapToObj((n) => [n.id, dagreBounds(n.id)])
|
|
273
242
|
);
|
|
274
243
|
function nodeBounds(nodeId) {
|
|
275
|
-
return _calculatedNodeBounds[nodeId]
|
|
244
|
+
return _calculatedNodeBounds[nodeId] ??= pipe(
|
|
276
245
|
g.children(nodeId) ?? [],
|
|
277
246
|
filter((id) => !id.endsWith(PortSuffix)),
|
|
278
247
|
map((id) => nodeBounds(id)),
|
|
@@ -301,7 +270,7 @@ function layoutRelationshipsView(data) {
|
|
|
301
270
|
height: maxY - minY2
|
|
302
271
|
};
|
|
303
272
|
}
|
|
304
|
-
)
|
|
273
|
+
);
|
|
305
274
|
}
|
|
306
275
|
function nodeLevel(nodeId) {
|
|
307
276
|
const parent = g.parent(nodeId);
|
|
@@ -336,7 +305,6 @@ function layoutRelationshipsView(data) {
|
|
|
336
305
|
invariant(subject, "Subjects should not be empty");
|
|
337
306
|
let subjectBounds = nodeBounds(subjects.graphNodes.get(subject.id).id);
|
|
338
307
|
const nodes = nodeIds.map(({ id }) => {
|
|
339
|
-
var _a2;
|
|
340
308
|
const { element, inPorts, outPorts, column } = g.node(id);
|
|
341
309
|
let { position, width, height } = nodeBounds(id);
|
|
342
310
|
if (!element) {
|
|
@@ -381,14 +349,18 @@ function layoutRelationshipsView(data) {
|
|
|
381
349
|
ports: {
|
|
382
350
|
in: [],
|
|
383
351
|
out: []
|
|
384
|
-
}
|
|
352
|
+
},
|
|
353
|
+
existsInCurrentView: false
|
|
385
354
|
};
|
|
386
355
|
}
|
|
387
356
|
const parentId = g.parent(id);
|
|
388
357
|
const children = (g.children(id) ?? []).filter((c) => !c.endsWith(PortSuffix));
|
|
389
358
|
minX = Math.min(minX, position.x);
|
|
390
359
|
minY = Math.min(minY, position.y);
|
|
391
|
-
const navigateTo =
|
|
360
|
+
const navigateTo = element.defaultView?.id ?? null;
|
|
361
|
+
const inheritFromNode = scope?.findNodeWithElement(element.id);
|
|
362
|
+
const scopedAncestor = scope && !inheritFromNode ? ifind(element.ancestors(), (a) => !!scope.findNodeWithElement(a.id))?.id : null;
|
|
363
|
+
const inheritFromNodeOrAncestor = inheritFromNode ?? (scopedAncestor && scope?.findNodeWithElement(scopedAncestor));
|
|
392
364
|
return {
|
|
393
365
|
id,
|
|
394
366
|
parent: parentId ?? null,
|
|
@@ -398,9 +370,9 @@ function layoutRelationshipsView(data) {
|
|
|
398
370
|
technology: element.technology,
|
|
399
371
|
tags: null,
|
|
400
372
|
links: null,
|
|
401
|
-
color: element.color,
|
|
402
|
-
shape: element.shape,
|
|
403
|
-
icon: element.icon ?? "none",
|
|
373
|
+
color: inheritFromNodeOrAncestor?.color ?? element.color,
|
|
374
|
+
shape: inheritFromNode?.shape ?? element.shape,
|
|
375
|
+
icon: inheritFromNode?.icon ?? element.icon ?? "none",
|
|
404
376
|
modelRef: element.id,
|
|
405
377
|
kind: element.kind,
|
|
406
378
|
level: nodeLevel(id),
|
|
@@ -411,6 +383,7 @@ function layoutRelationshipsView(data) {
|
|
|
411
383
|
height
|
|
412
384
|
},
|
|
413
385
|
style: {
|
|
386
|
+
...(inheritFromNode ?? inheritFromNodeOrAncestor)?.style,
|
|
414
387
|
...element.$element.style
|
|
415
388
|
},
|
|
416
389
|
navigateTo,
|
|
@@ -424,10 +397,12 @@ function layoutRelationshipsView(data) {
|
|
|
424
397
|
ports: {
|
|
425
398
|
in: sortedPorts(id, "in", inPorts),
|
|
426
399
|
out: sortedPorts(id, "out", outPorts)
|
|
427
|
-
}
|
|
400
|
+
},
|
|
401
|
+
existsInCurrentView: !!inheritFromNode
|
|
428
402
|
};
|
|
429
403
|
});
|
|
430
404
|
return {
|
|
405
|
+
subjectExistsInScope: !scope || scope.includesElement(subject.id),
|
|
431
406
|
bounds: {
|
|
432
407
|
x: Math.min(minX, 0),
|
|
433
408
|
y: Math.min(minY, 0),
|
|
@@ -436,7 +411,6 @@ function layoutRelationshipsView(data) {
|
|
|
436
411
|
},
|
|
437
412
|
nodes,
|
|
438
413
|
edges: g.edges().reduce((acc, e) => {
|
|
439
|
-
var _a2;
|
|
440
414
|
const edge = g.edge(e);
|
|
441
415
|
const ename = e.name;
|
|
442
416
|
if (!ename) {
|
|
@@ -444,13 +418,9 @@ function layoutRelationshipsView(data) {
|
|
|
444
418
|
}
|
|
445
419
|
const { name, source, target, relations, sourceHandle, targetHandle } = find(edges, (e2) => e2.name === ename);
|
|
446
420
|
const onlyRelation = only(relations);
|
|
447
|
-
const label =
|
|
421
|
+
const label = onlyRelation?.title ?? "untitled";
|
|
448
422
|
const isMultiple = relations.length > 1;
|
|
449
|
-
const
|
|
450
|
-
if (!hasAtLeast(points, 1)) {
|
|
451
|
-
return acc;
|
|
452
|
-
}
|
|
453
|
-
const navigateTo = ((_a2 = onlyRelation == null ? void 0 : onlyRelation.navigateTo) == null ? void 0 : _a2.id) ?? null;
|
|
423
|
+
const navigateTo = only(unique(relations.flatMap((r) => r.navigateTo?.id ? r.navigateTo.id : [])));
|
|
454
424
|
acc.push({
|
|
455
425
|
id: name,
|
|
456
426
|
source,
|
|
@@ -458,38 +428,33 @@ function layoutRelationshipsView(data) {
|
|
|
458
428
|
target,
|
|
459
429
|
targetHandle,
|
|
460
430
|
label: isMultiple ? `${relations.length} relationships` : label,
|
|
461
|
-
relations: relations.map((r) => r.id),
|
|
462
|
-
parent: null,
|
|
463
|
-
points,
|
|
464
431
|
...navigateTo && { navigateTo },
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
line:
|
|
432
|
+
existsInCurrentView: !scope || relations.every((r) => scope.includesRelation(r.id)),
|
|
433
|
+
points: edge.points.map((p) => [p.x, p.y]),
|
|
434
|
+
line: onlyRelation?.$relationship.line ?? "dashed",
|
|
435
|
+
relations: relations.map((r) => r.id),
|
|
436
|
+
parent: null
|
|
468
437
|
});
|
|
469
438
|
return acc;
|
|
470
439
|
}, [])
|
|
471
440
|
};
|
|
472
441
|
}
|
|
473
|
-
function useRelationshipsView(
|
|
442
|
+
function useRelationshipsView(subject, viewId, scope) {
|
|
474
443
|
const model = useLikeC4Model(true);
|
|
475
444
|
return useMemo(() => {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}, [model, fqn, computeRelationshipsView]);
|
|
445
|
+
const view = viewId ? model.findView(viewId) : null;
|
|
446
|
+
const data = layoutRelationshipsView(
|
|
447
|
+
computeRelationshipsView(subject, model, viewId, scope),
|
|
448
|
+
scope === "view" ? view : null
|
|
449
|
+
);
|
|
450
|
+
if (view && (scope === "global" || !data.subjectExistsInScope)) {
|
|
451
|
+
data.edges = data.edges.map((edge) => {
|
|
452
|
+
edge.existsInCurrentView = edge.relations.every((r) => view.includesRelation(r));
|
|
453
|
+
return edge;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
return Object.assign(data, { subject });
|
|
457
|
+
}, [model, subject, viewId, scope, computeRelationshipsView]);
|
|
490
458
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
layoutRelationshipsView,
|
|
494
|
-
useRelationshipsView
|
|
495
|
-
};
|
|
459
|
+
|
|
460
|
+
export { LayoutRelationshipsViewResult, layoutRelationshipsView, useRelationshipsView };
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
import { RelationshipsBrowserActorRef } from './actor';
|
|
2
|
+
import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { Position } from '@xyflow/system';
|
|
4
|
+
import { NonEmptyArray, RelationId, Color, ViewId, RelationshipLineType } from '@likec4/core';
|
|
5
|
+
export declare const edgeTypes: {
|
|
6
|
+
relationship: NamedExoticComponent<{
|
|
7
|
+
id: string;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
selectable?: boolean;
|
|
10
|
+
deletable?: boolean;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
sourceX: number;
|
|
16
|
+
sourceY: number;
|
|
17
|
+
targetX: number;
|
|
18
|
+
targetY: number;
|
|
19
|
+
sourcePosition: Position;
|
|
20
|
+
targetPosition: Position;
|
|
21
|
+
label?: ReactNode;
|
|
22
|
+
labelStyle?: CSSProperties;
|
|
23
|
+
labelShowBg?: boolean;
|
|
24
|
+
labelBgStyle?: CSSProperties;
|
|
25
|
+
labelBgPadding?: [number, number];
|
|
26
|
+
labelBgBorderRadius?: number;
|
|
27
|
+
sourceHandleId?: string | null;
|
|
28
|
+
targetHandleId?: string | null;
|
|
29
|
+
markerStart?: string;
|
|
30
|
+
markerEnd?: string;
|
|
31
|
+
pathOptions?: any;
|
|
32
|
+
interactionWidth?: number;
|
|
33
|
+
data: {
|
|
34
|
+
hovered?: boolean;
|
|
35
|
+
active?: boolean;
|
|
36
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
37
|
+
} & {
|
|
38
|
+
relations: NonEmptyArray<RelationId>;
|
|
39
|
+
color: Color | undefined;
|
|
40
|
+
label: string | null;
|
|
41
|
+
navigateTo: ViewId | null;
|
|
42
|
+
line: RelationshipLineType;
|
|
43
|
+
existsInCurrentView: boolean;
|
|
44
|
+
hovered?: boolean;
|
|
45
|
+
active?: boolean;
|
|
46
|
+
dimmed?: import("../../base").Base.Dimmed;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
2
50
|
export type RelationshipsBrowserProps = {
|
|
3
51
|
actorRef: RelationshipsBrowserActorRef;
|
|
4
52
|
};
|