@likec4/diagram 1.26.2 → 1.27.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 +1 -1
- package/bundle/index.js +48891 -0
- package/dist/LikeC4CustomColors.js +27 -23
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +37 -36
- 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 +133 -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 +17 -29
- package/dist/base/primitives/edge/edge.css.d.ts +2 -2
- package/dist/base/primitives/edge/edge.css.js +123 -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 +50 -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 +118 -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 +195 -19
- package/dist/base/primitives/element/ElementTitle.js +25 -24
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/base/types.js +4 -4
- 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 +61 -12
- 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 +5020 -4373
- 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 +81 -36
- 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 +99 -83
- 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 +10 -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 +8 -9
- 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.js +39 -46
- 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 +21 -21
- 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 +57 -98
- package/dist/overlays/overlay/Overlay.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.js +96 -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 +16 -18
- 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.js +26 -27
- package/dist/state/aligners.js +22 -31
- package/dist/state/assign.js +11 -21
- package/dist/state/diagram-machine.d.ts +5155 -4470
- package/dist/state/diagram-machine.js +407 -337
- 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 +16 -14
- 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 +113 -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 +31 -37
- package/src/base/primitives/edge/edge.css.ts +105 -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 +43 -70
- package/src/base/primitives/element/ElementNodeContainer.tsx +18 -8
- package/src/base/primitives/element/ElementShape.css.ts +80 -113
- package/src/base/primitives/element/ElementShape.tsx +0 -1
- package/src/base/primitives/element/ElementTitle.css.ts +168 -124
- package/src/base/primitives/element/ElementTitle.tsx +16 -16
- package/src/base/primitives/index.ts +1 -0
- package/src/base/types.ts +5 -0
- 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 +56 -5
- 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 +80 -26
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +7 -13
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +69 -42
- 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 +9 -5
- package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +3 -4
- package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +2 -2
- 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/useViewToNodesEdges.ts +2 -1
- package/src/overlays/Overlays.tsx +6 -4
- 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 +34 -46
- package/src/overlays/overlay/Overlay.tsx +95 -97
- 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/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 +17 -16
- package/src/state/diagram-machine.ts +395 -315
- 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
|
@@ -2,43 +2,43 @@ import { NodeProps } from '../../../base';
|
|
|
2
2
|
import { RelationshipsBrowserTypes } from '../_types';
|
|
3
3
|
import { NamedExoticComponent } from 'react';
|
|
4
4
|
import { ElementStyle, Color, ViewId, Fqn, IconUrl } from '@likec4/core';
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
5
|
+
export declare const ElementNode: NamedExoticComponent<NodeProps<{
|
|
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: RelationshipsBrowserTypes.Column;
|
|
16
|
+
fqn: Fqn;
|
|
17
|
+
icon: string | null;
|
|
18
|
+
ports: RelationshipsBrowserTypes.Ports;
|
|
19
|
+
existsInCurrentView: boolean;
|
|
20
|
+
hovered?: boolean;
|
|
21
|
+
dimmed?: import("../../../base").Base.Dimmed;
|
|
22
|
+
}>>;
|
|
23
|
+
export declare const CompoundNode: NamedExoticComponent<NodeProps<{
|
|
24
|
+
style: ElementStyle;
|
|
25
|
+
title: string;
|
|
26
|
+
color: Color;
|
|
27
|
+
shape: "rectangle" | "person" | "browser" | "mobile" | "cylinder" | "storage" | "queue";
|
|
28
|
+
column: RelationshipsBrowserTypes.Column;
|
|
29
|
+
fqn: Fqn;
|
|
30
|
+
depth: number;
|
|
31
|
+
icon: IconUrl;
|
|
32
|
+
ports: RelationshipsBrowserTypes.Ports;
|
|
33
|
+
existsInCurrentView: boolean;
|
|
34
|
+
hovered?: boolean;
|
|
35
|
+
dimmed?: import("../../../base").Base.Dimmed;
|
|
36
|
+
}>>;
|
|
37
|
+
export declare const EmptyNode: NamedExoticComponent<NodeProps<{
|
|
38
|
+
column: RelationshipsBrowserTypes.Column;
|
|
39
|
+
hovered?: boolean;
|
|
40
|
+
dimmed?: import("../../../base").Base.Dimmed;
|
|
41
|
+
}>>;
|
|
42
42
|
type ElementPortsProps = NodeProps<Pick<RelationshipsBrowserTypes.ElementNodeData, 'ports' | 'height'>>;
|
|
43
43
|
export declare const ElementPorts: ({ data: { ports, height: h } }: ElementPortsProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
type CompoundPortsProps = NodeProps<Pick<RelationshipsBrowserTypes.CompoundNodeData, 'ports'>>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from
|
|
2
|
-
import { Handle } from
|
|
3
|
-
import { Position } from
|
|
4
|
-
import { m } from
|
|
5
|
-
import { useDiagram } from
|
|
6
|
-
import { ElementActions } from
|
|
7
|
-
import { EmptyNode } from
|
|
8
|
-
import { customNode } from
|
|
9
|
-
import { CompoundNodeContainer } from
|
|
10
|
-
import { CompoundTitle } from
|
|
11
|
-
import { ElementNodeContainer } from
|
|
12
|
-
import { ElementShape } from
|
|
13
|
-
import { ElementTitle } from
|
|
14
|
-
import { ElementDetailsButton } from
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Handle } from '@xyflow/react';
|
|
3
|
+
import { Position } from '@xyflow/system';
|
|
4
|
+
import { m } from 'framer-motion';
|
|
5
|
+
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
6
|
+
import { ElementActions } from './ElementActions.js';
|
|
7
|
+
import { EmptyNode as EmptyNode$1 } from './EmptyNode.js';
|
|
8
|
+
import { customNode } from '../../../base/primitives/customNode.js';
|
|
9
|
+
import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
|
|
10
|
+
import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.js';
|
|
11
|
+
import { ElementNodeContainer } from '../../../base/primitives/element/ElementNodeContainer.js';
|
|
12
|
+
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
13
|
+
import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
|
|
14
|
+
import { ElementDetailsButton } from '../../../base/primitives/element/ElementDetailsButton.js';
|
|
15
|
+
|
|
15
16
|
const ElementDetailsButtonWithHandler = (props) => {
|
|
16
17
|
const diagram = useDiagram();
|
|
17
18
|
return /* @__PURE__ */ jsx(
|
|
@@ -25,27 +26,25 @@ const ElementDetailsButtonWithHandler = (props) => {
|
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
};
|
|
29
|
+
const ElementNode = customNode((props) => {
|
|
30
|
+
return /* @__PURE__ */ jsxs(ElementNodeContainer, { component: m.div, layoutId: props.id, nodeProps: props, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
32
|
+
/* @__PURE__ */ jsx(ElementTitle, { ...props, iconSize: 40 }),
|
|
33
|
+
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
34
|
+
/* @__PURE__ */ jsx(ElementActions, { ...props }),
|
|
35
|
+
/* @__PURE__ */ jsx(ElementPorts, { ...props })
|
|
36
|
+
] }, props.id);
|
|
37
|
+
});
|
|
38
|
+
const CompoundNode = customNode((props) => {
|
|
39
|
+
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { layoutId: props.id, nodeProps: props, children: [
|
|
40
|
+
/* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
|
|
41
|
+
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
42
|
+
/* @__PURE__ */ jsx(CompoundPorts, { ...props })
|
|
43
|
+
] }, props.id);
|
|
44
|
+
});
|
|
45
|
+
const EmptyNode = customNode((props) => {
|
|
46
|
+
return /* @__PURE__ */ jsx(EmptyNode$1, { ...props });
|
|
47
|
+
});
|
|
49
48
|
const ElementPorts = ({ data: { ports, height: h } }) => {
|
|
50
49
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
50
|
ports.in.map((id, i) => /* @__PURE__ */ jsx(
|
|
@@ -104,8 +103,5 @@ const CompoundPorts = ({ data }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
104
103
|
id
|
|
105
104
|
))
|
|
106
105
|
] });
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
ElementPorts,
|
|
110
|
-
nodeTypes
|
|
111
|
-
};
|
|
106
|
+
|
|
107
|
+
export { CompoundNode, CompoundPorts, ElementNode, ElementPorts, EmptyNode };
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { css } from '@likec4/styles/css';
|
|
2
|
+
|
|
3
|
+
const emptyNode = css({
|
|
4
|
+
width: "100%",
|
|
5
|
+
height: "100%",
|
|
6
|
+
border: `3px dashed`,
|
|
7
|
+
borderColor: `mantine.colors.defaultBorder`,
|
|
8
|
+
borderRadius: "md",
|
|
9
|
+
display: "flex",
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
alignItems: "center"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { emptyNode };
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { Fqn, NonEmptyArray, RelationId, Color,
|
|
2
|
-
import {
|
|
1
|
+
import { Fqn, ViewId, NonEmptyArray, RelationId, Color, RelationshipLineType } from '@likec4/core';
|
|
2
|
+
import { LayoutRelationshipsViewResult } from './-useRelationshipsView';
|
|
3
|
+
import { RelationshipsBrowserActorRef, RelationshipsBrowserSnapshot, XYStoreApi, Events } from './actor';
|
|
3
4
|
import { Context, ReactNode, CSSProperties } from 'react';
|
|
4
5
|
import { GeneralHelpers, ViewportHelperFunctions } from '@xyflow/react';
|
|
5
6
|
import { EdgeMarkerType, HandleType } from '@xyflow/system';
|
|
6
|
-
import { LayoutRelationshipsViewResult } from './-useRelationshipsView';
|
|
7
7
|
export declare const RelationshipsBrowserActorContext: Context<RelationshipsBrowserActorRef | null>;
|
|
8
8
|
export declare function useRelationshipsBrowserActor(): RelationshipsBrowserActorRef;
|
|
9
9
|
export declare function useRelationshipsBrowserState<T>(selector: (state: RelationshipsBrowserSnapshot) => T, compare?: (a: T, b: T) => boolean): T;
|
|
10
10
|
export declare function useRelationshipsBrowser(): {
|
|
11
11
|
actor: RelationshipsBrowserActorRef;
|
|
12
|
-
|
|
12
|
+
readonly rootElementId: string;
|
|
13
|
+
getState: () => Readonly<{
|
|
14
|
+
subject: Fqn;
|
|
15
|
+
viewId: ViewId | null;
|
|
16
|
+
scope: "global" | "view";
|
|
13
17
|
closeable: boolean;
|
|
14
|
-
|
|
18
|
+
enableSelectSubject: boolean;
|
|
19
|
+
enableChangeScope: boolean;
|
|
15
20
|
xyflow: ( GeneralHelpers<import("./_types").RelationshipsBrowserTypes.Node, {
|
|
16
21
|
id: string;
|
|
17
22
|
source: string;
|
|
@@ -38,13 +43,14 @@ export declare function useRelationshipsBrowser(): {
|
|
|
38
43
|
className?: string;
|
|
39
44
|
reconnectable?: boolean | HandleType;
|
|
40
45
|
focusable?: boolean;
|
|
41
|
-
type: "
|
|
46
|
+
type: "relationship";
|
|
42
47
|
data: {
|
|
43
48
|
relations: NonEmptyArray<RelationId>;
|
|
44
49
|
color: Color | undefined;
|
|
45
50
|
label: string | null;
|
|
46
51
|
navigateTo: ViewId | null;
|
|
47
52
|
line: RelationshipLineType;
|
|
53
|
+
existsInCurrentView: boolean;
|
|
48
54
|
hovered?: boolean;
|
|
49
55
|
active?: boolean;
|
|
50
56
|
dimmed?: import("../../base").Base.Dimmed;
|
|
@@ -59,6 +65,8 @@ export declare function useRelationshipsBrowser(): {
|
|
|
59
65
|
xyedges: import("./_types").RelationshipsBrowserTypes.Edge[];
|
|
60
66
|
}>;
|
|
61
67
|
send: (event: Events) => void;
|
|
68
|
+
updateView: (layouted: LayoutRelationshipsViewResult) => void;
|
|
69
|
+
changeScope: (scope: "global" | "view") => void;
|
|
62
70
|
navigateTo: (subject: Fqn, fromNode?: string) => void;
|
|
63
71
|
fitDiagram: () => void;
|
|
64
72
|
close: () => void;
|
|
@@ -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 RelationshipsBrowserActorContext = createContext(null);
|
|
7
8
|
function useRelationshipsBrowserActor() {
|
|
8
9
|
return nonNullable(useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
|
|
@@ -16,8 +17,23 @@ function useRelationshipsBrowser() {
|
|
|
16
17
|
const [, startTransition] = useTransition();
|
|
17
18
|
return useMemo(() => ({
|
|
18
19
|
actor,
|
|
20
|
+
get rootElementId() {
|
|
21
|
+
return `relationships-browser-${actor.sessionId}`;
|
|
22
|
+
},
|
|
19
23
|
getState: () => actor.getSnapshot().context,
|
|
20
24
|
send: actor.send,
|
|
25
|
+
updateView: (layouted) => {
|
|
26
|
+
actor.send({
|
|
27
|
+
type: "update.view",
|
|
28
|
+
layouted
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
changeScope: (scope) => {
|
|
32
|
+
actor.send({
|
|
33
|
+
type: "change.scope",
|
|
34
|
+
scope
|
|
35
|
+
});
|
|
36
|
+
},
|
|
21
37
|
navigateTo: (subject, fromNode) => {
|
|
22
38
|
startTransition(() => {
|
|
23
39
|
actor.send({
|
|
@@ -28,23 +44,16 @@ function useRelationshipsBrowser() {
|
|
|
28
44
|
});
|
|
29
45
|
},
|
|
30
46
|
fitDiagram: () => {
|
|
31
|
-
|
|
32
|
-
actor.send({ type: "fitDiagram" });
|
|
33
|
-
});
|
|
47
|
+
actor.send({ type: "fitDiagram" });
|
|
34
48
|
},
|
|
35
49
|
close: () => {
|
|
36
|
-
var _a;
|
|
37
50
|
if (actor._parent) {
|
|
38
|
-
|
|
51
|
+
actor._parent?.send({ type: "close", actorId: actor.id });
|
|
39
52
|
} else {
|
|
40
53
|
actor.send({ type: "close" });
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
}), [actor]);
|
|
44
57
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
useRelationshipsBrowser,
|
|
48
|
-
useRelationshipsBrowserActor,
|
|
49
|
-
useRelationshipsBrowserState
|
|
50
|
-
};
|
|
58
|
+
|
|
59
|
+
export { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserActor, useRelationshipsBrowserState };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Queue, ElementKind, nonNullable, DiagramNode, invariant } from
|
|
2
|
-
import
|
|
3
|
-
import { hasAtLeast } from
|
|
4
|
-
import { ZIndexes } from
|
|
5
|
-
import { LayoutRelationshipsViewResult } from
|
|
1
|
+
import { Queue, ElementKind, nonNullable, DiagramNode, invariant } from '@likec4/core';
|
|
2
|
+
import '@react-hookz/web';
|
|
3
|
+
import { hasAtLeast } from 'remeda';
|
|
4
|
+
import { ZIndexes } from '../../base/const.js';
|
|
5
|
+
import { LayoutRelationshipsViewResult } from './-useRelationshipsView.js';
|
|
6
|
+
|
|
6
7
|
function viewToNodesEdge(view) {
|
|
7
8
|
const xynodes = [], xyedges = [], nodeLookup = /* @__PURE__ */ new Map();
|
|
8
9
|
const queue = Queue.from(view.nodes.reduce(
|
|
@@ -82,6 +83,7 @@ function viewToNodesEdge(view) {
|
|
|
82
83
|
depth: node.depth ?? 0,
|
|
83
84
|
icon: node.icon ?? "none",
|
|
84
85
|
ports: node.ports,
|
|
86
|
+
existsInCurrentView: node.existsInCurrentView,
|
|
85
87
|
fqn,
|
|
86
88
|
...navigateTo
|
|
87
89
|
}
|
|
@@ -108,6 +110,7 @@ function viewToNodesEdge(view) {
|
|
|
108
110
|
icon: node.icon ?? "none",
|
|
109
111
|
ports: node.ports,
|
|
110
112
|
style: node.style,
|
|
113
|
+
existsInCurrentView: node.existsInCurrentView,
|
|
111
114
|
...navigateTo
|
|
112
115
|
}
|
|
113
116
|
}
|
|
@@ -129,7 +132,7 @@ function viewToNodesEdge(view) {
|
|
|
129
132
|
}
|
|
130
133
|
xyedges.push({
|
|
131
134
|
id,
|
|
132
|
-
type: "
|
|
135
|
+
type: "relationship",
|
|
133
136
|
source: ns + source,
|
|
134
137
|
target: ns + target,
|
|
135
138
|
sourceHandle: edge.sourceHandle,
|
|
@@ -143,15 +146,8 @@ function viewToNodesEdge(view) {
|
|
|
143
146
|
color: edge.color ?? "gray",
|
|
144
147
|
label: edge.label,
|
|
145
148
|
navigateTo: edge.navigateTo ?? null,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// labelBBox: edge.labelBBox ?? null,
|
|
149
|
-
// points: edge.points,
|
|
150
|
-
// color: edge.color ?? 'gray',
|
|
151
|
-
line: edge.line ?? "dashed"
|
|
152
|
-
// dir: edge.dir ?? 'forward',
|
|
153
|
-
// head: edge.head ?? 'normal',
|
|
154
|
-
// tail: edge.tail ?? 'none',
|
|
149
|
+
line: edge.line ?? "dashed",
|
|
150
|
+
existsInCurrentView: edge.existsInCurrentView
|
|
155
151
|
},
|
|
156
152
|
interactionWidth: 20
|
|
157
153
|
});
|
|
@@ -161,6 +157,5 @@ function viewToNodesEdge(view) {
|
|
|
161
157
|
xyedges
|
|
162
158
|
};
|
|
163
159
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
};
|
|
160
|
+
|
|
161
|
+
export { viewToNodesEdge };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { pipe } from 'remeda';
|
|
2
|
+
import { invariant } from '../../errors/index.js';
|
|
3
|
+
import { sortParentsFirst, isDescendantOf } from '../../utils/fqn.js';
|
|
4
|
+
import { treeFromElements } from './utils.js';
|
|
5
|
+
import { toSet, toArray } from '../../utils/iterable/to.js';
|
|
6
|
+
import { ifilter } from '../../utils/iterable/filter.js';
|
|
7
|
+
import { imap } from '../../utils/iterable/map.js';
|
|
8
|
+
|
|
9
|
+
const finalize = (elements, explicits) => {
|
|
10
|
+
if (elements.size > 2 && explicits.size !== elements.size) {
|
|
11
|
+
return new Set(sortParentsFirst([
|
|
12
|
+
...treeFromElements(elements).flatten(),
|
|
13
|
+
...explicits
|
|
14
|
+
]));
|
|
15
|
+
}
|
|
16
|
+
if (elements.size > 1) {
|
|
17
|
+
return new Set(sortParentsFirst([...elements]));
|
|
18
|
+
}
|
|
19
|
+
return elements;
|
|
20
|
+
};
|
|
21
|
+
function computeRelationships(subject, others, relationships) {
|
|
22
|
+
const isOther = (e) => others.has(e);
|
|
23
|
+
let subjects = /* @__PURE__ */ new Set([subject]);
|
|
24
|
+
const explicits = {
|
|
25
|
+
incomers: /* @__PURE__ */ new Set(),
|
|
26
|
+
subjects: /* @__PURE__ */ new Set([subject]),
|
|
27
|
+
outgoers: /* @__PURE__ */ new Set()
|
|
28
|
+
};
|
|
29
|
+
let incomers = new Set(relationships.incoming.flatMap((r) => {
|
|
30
|
+
explicits.subjects.add(r.target);
|
|
31
|
+
explicits.incomers.add(r.source);
|
|
32
|
+
subjects.add(r.target);
|
|
33
|
+
if (r.target !== subject) {
|
|
34
|
+
let target = r.target.parent;
|
|
35
|
+
while (target && target !== subject) {
|
|
36
|
+
subjects.add(target);
|
|
37
|
+
target = target.parent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let source = r.source;
|
|
41
|
+
const incomerBranch = [];
|
|
42
|
+
while (true) {
|
|
43
|
+
incomerBranch.push(source);
|
|
44
|
+
if (isOther(source) || !source.parent) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
source = source.parent;
|
|
48
|
+
}
|
|
49
|
+
return incomerBranch;
|
|
50
|
+
}));
|
|
51
|
+
let outgoers = new Set(relationships.outgoing.flatMap((r) => {
|
|
52
|
+
explicits.subjects.add(r.source);
|
|
53
|
+
explicits.outgoers.add(r.target);
|
|
54
|
+
subjects.add(r.source);
|
|
55
|
+
if (r.source !== subject) {
|
|
56
|
+
let source = r.source.parent;
|
|
57
|
+
while (source && source !== subject) {
|
|
58
|
+
subjects.add(source);
|
|
59
|
+
source = source.parent;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
let target = r.target;
|
|
63
|
+
const outgoerBranch = [];
|
|
64
|
+
while (true) {
|
|
65
|
+
outgoerBranch.push(target);
|
|
66
|
+
if (isOther(target) || !target.parent) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
target = target.parent;
|
|
70
|
+
}
|
|
71
|
+
return outgoerBranch;
|
|
72
|
+
}));
|
|
73
|
+
return {
|
|
74
|
+
incomers: finalize(incomers, explicits.incomers),
|
|
75
|
+
incoming: new Set(relationships.incoming),
|
|
76
|
+
subjects: finalize(subjects, explicits.subjects),
|
|
77
|
+
outgoing: new Set(relationships.outgoing),
|
|
78
|
+
outgoers: finalize(outgoers, explicits.outgoers)
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function computeRelationshipsView(subjectId, likec4model, scopeViewId, scope = "global") {
|
|
82
|
+
const view = scopeViewId ? likec4model.findView(scopeViewId) : null;
|
|
83
|
+
if (scope === "view") {
|
|
84
|
+
invariant(
|
|
85
|
+
view,
|
|
86
|
+
'Scope view id is required when scope is "view"'
|
|
87
|
+
);
|
|
88
|
+
return computeScopedRelationshipsView(subjectId, view, likec4model);
|
|
89
|
+
}
|
|
90
|
+
const subject = likec4model.element(subjectId);
|
|
91
|
+
const subjectSiblings = toSet(subject.ascendingSiblings());
|
|
92
|
+
return computeRelationships(
|
|
93
|
+
subject,
|
|
94
|
+
subjectSiblings,
|
|
95
|
+
{
|
|
96
|
+
incoming: [...subject.incoming()],
|
|
97
|
+
outgoing: [...subject.outgoing()]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
function computeScopedRelationshipsView(subjectId, view, likec4model) {
|
|
102
|
+
const subject = likec4model.element(subjectId);
|
|
103
|
+
let relationships = {
|
|
104
|
+
incoming: toArray(ifilter(subject.incoming(), (r) => view.includesRelation(r.id))),
|
|
105
|
+
outgoing: toArray(ifilter(subject.outgoing(), (r) => view.includesRelation(r.id)))
|
|
106
|
+
};
|
|
107
|
+
const isDescendant = isDescendantOf(subject);
|
|
108
|
+
const others = /* @__PURE__ */ new Set([
|
|
109
|
+
...subject.ascendingSiblings(),
|
|
110
|
+
...pipe(
|
|
111
|
+
view.elements(),
|
|
112
|
+
imap((e) => e.element),
|
|
113
|
+
ifilter((e) => e !== subject && isDescendant(e))
|
|
114
|
+
)
|
|
115
|
+
]);
|
|
116
|
+
return computeRelationships(
|
|
117
|
+
subject,
|
|
118
|
+
others,
|
|
119
|
+
relationships
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { computeRelationshipsView };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { nonNullable } from '../../errors/index.js';
|
|
2
|
+
import { sortParentsFirst, isDescendantOf, isAncestor } from '../../utils/fqn.js';
|
|
3
|
+
import DefaultMap from '../../../../../_virtual/default-map.js';
|
|
4
|
+
|
|
5
|
+
function treeFromElements(elements) {
|
|
6
|
+
const sorted = sortParentsFirst([...elements]);
|
|
7
|
+
const root = new Set(sorted);
|
|
8
|
+
const map = new Map(sorted.map((e) => [e._literalId, e]));
|
|
9
|
+
const parents = new DefaultMap(() => null);
|
|
10
|
+
const children = sorted.reduce((acc, parent, index, all) => {
|
|
11
|
+
acc.set(
|
|
12
|
+
parent,
|
|
13
|
+
all.slice(index + 1).filter(isDescendantOf(parent)).map((e) => {
|
|
14
|
+
root.delete(e);
|
|
15
|
+
return e;
|
|
16
|
+
}).reduce((acc2, el) => {
|
|
17
|
+
if (!acc2.some(isAncestor(el))) {
|
|
18
|
+
acc2.push(el);
|
|
19
|
+
parents.set(el, parent);
|
|
20
|
+
}
|
|
21
|
+
return acc2;
|
|
22
|
+
}, [])
|
|
23
|
+
);
|
|
24
|
+
return acc;
|
|
25
|
+
}, new DefaultMap(() => []));
|
|
26
|
+
return {
|
|
27
|
+
sorted,
|
|
28
|
+
byId: (id) => nonNullable(map.get(id), `Element not found by id: ${id}`),
|
|
29
|
+
root,
|
|
30
|
+
parent: (el) => parents.get(el),
|
|
31
|
+
children: (el) => children.get(el),
|
|
32
|
+
/**
|
|
33
|
+
* Flattens the tree structure by removing redundant hierarchy levels.
|
|
34
|
+
* @example
|
|
35
|
+
* A
|
|
36
|
+
* └── B
|
|
37
|
+
* ├── C
|
|
38
|
+
* │ └── D
|
|
39
|
+
* │ └── E
|
|
40
|
+
* └── F
|
|
41
|
+
* └── G
|
|
42
|
+
* becomes
|
|
43
|
+
* A
|
|
44
|
+
* ├── C
|
|
45
|
+
* │ └── E
|
|
46
|
+
* └── F
|
|
47
|
+
* └── G
|
|
48
|
+
*/
|
|
49
|
+
flatten: () => {
|
|
50
|
+
return /* @__PURE__ */ new Set([
|
|
51
|
+
...root,
|
|
52
|
+
...sorted.reduce((acc, el) => {
|
|
53
|
+
const _children = children.get(el);
|
|
54
|
+
if (_children.length === 0) {
|
|
55
|
+
acc.push(el);
|
|
56
|
+
return acc;
|
|
57
|
+
}
|
|
58
|
+
if (_children.length > 1) {
|
|
59
|
+
acc.push(..._children);
|
|
60
|
+
}
|
|
61
|
+
return acc;
|
|
62
|
+
}, [])
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { treeFromElements };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function nonNullable(value, message) {
|
|
2
|
+
if (typeof value === "undefined" || value == null) {
|
|
3
|
+
const msg = typeof message === "function" ? message() : message;
|
|
4
|
+
throw new Error(msg ?? `Expected defined value, but received ${value}`);
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
function invariant(condition, message) {
|
|
9
|
+
if (condition) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
throw new Error(message ?? "Invariant failed");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { invariant, nonNullable };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isString } from './guards.js';
|
|
2
|
+
|
|
3
|
+
const asString = (e) => isString(e) ? e : e.id;
|
|
4
|
+
function isAncestor(arg1, arg2) {
|
|
5
|
+
const arg1Id = asString(arg1);
|
|
6
|
+
if (arg2) {
|
|
7
|
+
const arg2Id = asString(arg2);
|
|
8
|
+
return arg2Id.startsWith(arg1Id + ".");
|
|
9
|
+
}
|
|
10
|
+
return (ancestor) => {
|
|
11
|
+
const ancestorId = asString(ancestor);
|
|
12
|
+
return arg1Id.startsWith(ancestorId + ".");
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function isDescendantOf(descedant, ancestor) {
|
|
16
|
+
{
|
|
17
|
+
return (d) => isAncestor(descedant, d);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function findTopAncestor(items, item) {
|
|
21
|
+
let parent = item;
|
|
22
|
+
for (const e of items) {
|
|
23
|
+
if (isAncestor(e, parent)) {
|
|
24
|
+
parent = e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return parent !== item ? parent : null;
|
|
28
|
+
}
|
|
29
|
+
function sortParentsFirst(array) {
|
|
30
|
+
const result = [];
|
|
31
|
+
const items = [...array];
|
|
32
|
+
let item;
|
|
33
|
+
while (item = items.shift()) {
|
|
34
|
+
let parent;
|
|
35
|
+
while (parent = findTopAncestor(items, item)) {
|
|
36
|
+
result.push(items.splice(items.indexOf(parent), 1)[0]);
|
|
37
|
+
}
|
|
38
|
+
result.push(item);
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { isAncestor, isDescendantOf, sortParentsFirst };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isFunction } from 'remeda';
|
|
2
|
+
import { invariant } from '../../errors/index.js';
|
|
3
|
+
|
|
4
|
+
function ifilter(arg1, arg2) {
|
|
5
|
+
const pred = arg2 ?? arg1;
|
|
6
|
+
invariant(isFunction(pred));
|
|
7
|
+
function* _filter(iter) {
|
|
8
|
+
for (const value of iter) {
|
|
9
|
+
if (pred(value)) {
|
|
10
|
+
yield value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!arg2) {
|
|
16
|
+
return _filter;
|
|
17
|
+
}
|
|
18
|
+
return _filter(arg1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { ifilter };
|