@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,33 +1,25 @@
|
|
|
1
|
-
import { jsxs, jsx } from
|
|
2
|
-
import { Popover, PopoverTarget, PopoverDropdown, Stack, ScrollAreaAutosize, Text, CloseButton, Group, Button } from
|
|
3
|
-
import { useDebouncedEffect } from
|
|
4
|
-
import { useState } from
|
|
5
|
-
import { isTruthy, isNonNull } from
|
|
6
|
-
import { useDiagramContext, useDiagram } from
|
|
7
|
-
import { edgeNoteText, edgeNoteCloseButton } from
|
|
8
|
-
import { useMantinePortalProps } from
|
|
9
|
-
import { stopPropagation } from
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Popover, PopoverTarget, PopoverDropdown, Stack, ScrollAreaAutosize, Text, CloseButton, Group, Button } from '@mantine/core';
|
|
3
|
+
import { useDebouncedEffect } from '@react-hookz/web';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { isTruthy, isNonNull } from 'remeda';
|
|
6
|
+
import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
7
|
+
import { edgeNoteText, edgeNoteCloseButton } from './NotePopover.css.js';
|
|
8
|
+
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
9
|
+
import { stopPropagation } from '../../../utils/xyflow.js';
|
|
10
|
+
|
|
10
11
|
const NotePopover = ({ notes, children }) => {
|
|
11
12
|
const {
|
|
12
13
|
isActive,
|
|
13
14
|
isParallel,
|
|
14
15
|
hasNext,
|
|
15
16
|
hasPrevious
|
|
16
|
-
} = useDiagramContext((s) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _a2;
|
|
23
|
-
return e.id === ((_a2 = s.activeWalkthrough) == null ? void 0 : _a2.stepId);
|
|
24
|
-
}) < s.xyedges.length - 1,
|
|
25
|
-
hasPrevious: s.xyedges.findIndex((e) => {
|
|
26
|
-
var _a2;
|
|
27
|
-
return e.id === ((_a2 = s.activeWalkthrough) == null ? void 0 : _a2.stepId);
|
|
28
|
-
}) > 0
|
|
29
|
-
};
|
|
30
|
-
});
|
|
17
|
+
} = useDiagramContext((s) => ({
|
|
18
|
+
isActive: isNonNull(s.activeWalkthrough),
|
|
19
|
+
isParallel: isTruthy(s.activeWalkthrough?.parallelPrefix),
|
|
20
|
+
hasNext: s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) < s.xyedges.length - 1,
|
|
21
|
+
hasPrevious: s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) > 0
|
|
22
|
+
}));
|
|
31
23
|
const diagram = useDiagram();
|
|
32
24
|
const [isOpened, setIsOpened] = useState(false);
|
|
33
25
|
const portalProps = useMantinePortalProps();
|
|
@@ -95,6 +87,5 @@ const NotePopover = ({ notes, children }) => {
|
|
|
95
87
|
}
|
|
96
88
|
);
|
|
97
89
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
};
|
|
90
|
+
|
|
91
|
+
export { NotePopover };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { EdgeId, NonEmptyArray, Point, Color,
|
|
1
|
+
import { EdgeId, NonEmptyArray, Point, Color, BBox, RelationshipLineType, RelationshipArrowType, ViewId } from '@likec4/core';
|
|
2
2
|
import { XYPosition } from '@xyflow/react';
|
|
3
3
|
import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { Position } from '@xyflow/system';
|
|
5
5
|
export declare const RelationshipEdge: NamedExoticComponent<{
|
|
6
|
-
source: string;
|
|
7
|
-
target: string;
|
|
8
|
-
style?: CSSProperties;
|
|
9
6
|
id: string;
|
|
10
7
|
selected?: boolean;
|
|
11
|
-
animated?: boolean;
|
|
12
|
-
deletable?: boolean;
|
|
13
8
|
selectable?: boolean;
|
|
9
|
+
deletable?: boolean;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
source: string;
|
|
12
|
+
target: string;
|
|
13
|
+
animated?: boolean;
|
|
14
14
|
sourceX: number;
|
|
15
15
|
sourceY: number;
|
|
16
16
|
targetX: number;
|
|
@@ -39,13 +39,13 @@ export declare const RelationshipEdge: NamedExoticComponent<{
|
|
|
39
39
|
points: NonEmptyArray<Point>;
|
|
40
40
|
technology: string | undefined;
|
|
41
41
|
color: Color | undefined;
|
|
42
|
-
|
|
42
|
+
labelBBox: BBox | null | undefined;
|
|
43
43
|
dir: "forward" | "back" | "both" | undefined;
|
|
44
|
+
line: RelationshipLineType | undefined;
|
|
44
45
|
head: RelationshipArrowType | undefined;
|
|
45
46
|
tail: RelationshipArrowType | undefined;
|
|
46
|
-
|
|
47
|
+
navigateTo: ViewId<string> | undefined;
|
|
47
48
|
notes: string | undefined;
|
|
48
|
-
labelBBox: BBox | null | undefined;
|
|
49
49
|
labelXY: XYPosition | null;
|
|
50
50
|
controlPoints: XYPosition[] | undefined | null;
|
|
51
51
|
hovered?: boolean;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs,
|
|
2
|
-
import { nonNullable
|
|
3
|
-
import { useDebouncedEffect } from
|
|
4
|
-
import { EdgeLabelRenderer } from
|
|
5
|
-
import clsx from
|
|
6
|
-
import { line, curveCatmullRomOpen } from
|
|
7
|
-
import { useState, useRef, useEffect } from
|
|
8
|
-
import { isTruthy, first, last } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { nonNullable } from '@likec4/core';
|
|
3
|
+
import { useDebouncedEffect } from '@react-hookz/web';
|
|
4
|
+
import { EdgeLabelRenderer } from '@xyflow/react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { line, curveCatmullRomOpen } from 'd3-shape';
|
|
7
|
+
import { useState, useRef, useEffect } from 'react';
|
|
8
|
+
import { isTruthy, first, last } from 'remeda';
|
|
9
|
+
import { ZIndexes } from '../../../base/const.js';
|
|
10
|
+
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
11
|
+
import { useDiagram, useDiagramActorSnapshot } from '../../../hooks/useDiagram.js';
|
|
12
|
+
import { useXYStoreApi, useXYFlow, useXYInternalNode } from '../../../hooks/useXYFlow.js';
|
|
13
|
+
import { VectorImpl, vector } from '../../../utils/vector.js';
|
|
14
|
+
import { isSamePoint, bezierControlPoints, bezierPath } from '../../../utils/xyflow.js';
|
|
15
|
+
import { controlDragging, controlPointsContainer, controlPoint } from './edges.css.js';
|
|
16
|
+
import { NotePopover } from './NotePopover.js';
|
|
17
|
+
import { RelationshipsDropdownMenu } from './RelationshipsDropdownMenu.js';
|
|
18
|
+
import { getNodeIntersectionFromCenterToPoint } from './utils.js';
|
|
19
|
+
import { customEdge } from '../../../base/primitives/customEdge.js';
|
|
20
|
+
import { useIsPanning } from '../../../context/ReduceGraphics.js';
|
|
21
|
+
import { EdgeLabel } from '../../../base/primitives/edge/EdgeLabel.js';
|
|
22
|
+
import { EdgeActionButton } from '../../../base/primitives/edge/EdgeActionButton.js';
|
|
23
|
+
import { EdgeContainer } from '../../../base/primitives/edge/EdgeContainer.js';
|
|
24
|
+
import { EdgePath } from '../../../base/primitives/edge/EdgePath.js';
|
|
25
|
+
import { EdgeLabelContainer } from '../../../base/primitives/edge/EdgeLabelContainer.js';
|
|
26
|
+
|
|
24
27
|
const curve = line().curve(curveCatmullRomOpen).x((d) => d.x).y((d) => d.y);
|
|
28
|
+
const selectActiveStepId = (s) => s.context.activeWalkthrough?.stepId ?? null;
|
|
25
29
|
const RelationshipEdge = customEdge((props) => {
|
|
26
|
-
|
|
27
|
-
const isReducedGraphicsMode = useLooseReducedGraphics();
|
|
30
|
+
const isPanning = useIsPanning();
|
|
28
31
|
const [isControlPointDragging, setIsControlPointDragging] = useState(false);
|
|
29
32
|
const xyflowStore = useXYStoreApi();
|
|
30
33
|
const xyflow = useXYFlow();
|
|
31
34
|
const diagram = useDiagram();
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
"EdgeEditing",
|
|
35
|
-
"RelationshipDetails"
|
|
36
|
-
);
|
|
35
|
+
const activeWalkthroughStep = useDiagramActorSnapshot(selectActiveStepId);
|
|
36
|
+
const { enableNavigateTo, enableEdgeEditing, enableRelationshipDetails } = useEnabledFeatures();
|
|
37
37
|
const {
|
|
38
38
|
id,
|
|
39
39
|
source,
|
|
@@ -52,7 +52,8 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
52
52
|
labelBBox,
|
|
53
53
|
labelXY,
|
|
54
54
|
...data
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
style = {}
|
|
56
57
|
} = props;
|
|
57
58
|
const navigateTo = enableNavigateTo ? data.navigateTo : void 0;
|
|
58
59
|
const sourceNode = nonNullable(useXYInternalNode(source), `source node ${source} not found`);
|
|
@@ -81,10 +82,10 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
81
82
|
} else {
|
|
82
83
|
edgePath = bezierPath(points);
|
|
83
84
|
}
|
|
84
|
-
let labelX =
|
|
85
|
+
let labelX = labelBBox?.x ?? 0, labelY = labelBBox?.y ?? 0;
|
|
85
86
|
const [labelPos, setLabelPos] = useState({
|
|
86
|
-
x:
|
|
87
|
-
y:
|
|
87
|
+
x: labelXY?.x ?? labelX,
|
|
88
|
+
y: labelXY?.y ?? labelY
|
|
88
89
|
});
|
|
89
90
|
const svgPathRef = useRef(null);
|
|
90
91
|
useEffect(() => {
|
|
@@ -102,7 +103,7 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
102
103
|
if (!labelBBox || labelBBox.x === labelPos.x && labelBBox.y === labelPos.y) {
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
+
diagram.updateEdgeData(id, {
|
|
106
107
|
labelXY: {
|
|
107
108
|
x: labelPos.x,
|
|
108
109
|
y: labelPos.y
|
|
@@ -134,15 +135,13 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
134
135
|
hasMoved = true;
|
|
135
136
|
pointer = clientPoint;
|
|
136
137
|
const { x, y } = xyflow.screenToFlowPosition(pointer, { snapToGrid: false });
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
controlPoints: cp
|
|
145
|
-
};
|
|
138
|
+
const cp = controlPoints.slice();
|
|
139
|
+
cp[index] = {
|
|
140
|
+
x: Math.round(x),
|
|
141
|
+
y: Math.round(y)
|
|
142
|
+
};
|
|
143
|
+
diagram.updateEdgeData(id, {
|
|
144
|
+
controlPoints: cp
|
|
146
145
|
});
|
|
147
146
|
}
|
|
148
147
|
e2.stopPropagation();
|
|
@@ -176,13 +175,9 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
176
175
|
newControlPoints.splice(index, 1);
|
|
177
176
|
e2.stopPropagation();
|
|
178
177
|
setTimeout(() => {
|
|
179
|
-
|
|
178
|
+
diagram.updateEdgeData(id, { controlPoints: newControlPoints });
|
|
180
179
|
diagram.scheduleSaveManualLayout();
|
|
181
180
|
}, 10);
|
|
182
|
-
domNode.removeEventListener("pointerup", onPointerUp, {
|
|
183
|
-
capture: true
|
|
184
|
-
});
|
|
185
|
-
e2.stopPropagation();
|
|
186
181
|
};
|
|
187
182
|
domNode.addEventListener("pointerup", onPointerUp, {
|
|
188
183
|
once: true,
|
|
@@ -212,101 +207,111 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
212
207
|
if (e.button !== 2) {
|
|
213
208
|
return;
|
|
214
209
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (fromCurrentToNext.dot(fromCurrentToNew) * fromCurrentToNext.dot(fromNextToNew) < 0) {
|
|
232
|
-
const distanceToEdge = Math.abs(fromCurrentToNext.cross(fromCurrentToNew).abs() / fromCurrentToNext.abs());
|
|
233
|
-
if (distanceToEdge < minDistance) {
|
|
234
|
-
minDistance = distanceToEdge;
|
|
235
|
-
insertionIndex = i;
|
|
236
|
-
}
|
|
210
|
+
const points2 = [
|
|
211
|
+
new VectorImpl(sourceX, sourceY),
|
|
212
|
+
...controlPoints.map(vector) || [],
|
|
213
|
+
new VectorImpl(targetX, targetY)
|
|
214
|
+
];
|
|
215
|
+
let pointer = { x: e.clientX, y: e.clientY };
|
|
216
|
+
const newPoint = vector(xyflow.screenToFlowPosition(pointer, { snapToGrid: false }));
|
|
217
|
+
let insertionIndex = 0;
|
|
218
|
+
let minDistance = Infinity;
|
|
219
|
+
for (let i = 0; i < points2.length - 1; i++) {
|
|
220
|
+
const a = points2[i], b = points2[i + 1], fromCurrentToNext = b.sub(a), fromCurrentToNew = newPoint.sub(a), fromNextToNew = newPoint.sub(b);
|
|
221
|
+
if (fromCurrentToNext.dot(fromCurrentToNew) * fromCurrentToNext.dot(fromNextToNew) < 0) {
|
|
222
|
+
const distanceToEdge = Math.abs(fromCurrentToNext.cross(fromCurrentToNew).abs() / fromCurrentToNext.abs());
|
|
223
|
+
if (distanceToEdge < minDistance) {
|
|
224
|
+
minDistance = distanceToEdge;
|
|
225
|
+
insertionIndex = i;
|
|
237
226
|
}
|
|
238
227
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
});
|
|
228
|
+
}
|
|
229
|
+
const newControlPoints = controlPoints.slice() || [];
|
|
230
|
+
newControlPoints.splice(insertionIndex, 0, newPoint);
|
|
231
|
+
diagram.updateEdgeData(id, { controlPoints: newControlPoints });
|
|
243
232
|
diagram.scheduleSaveManualLayout();
|
|
244
233
|
e.stopPropagation();
|
|
245
234
|
};
|
|
246
|
-
let
|
|
247
|
-
if (
|
|
235
|
+
let zIndex = ZIndexes.Edge;
|
|
236
|
+
if (hovered || active) {
|
|
237
|
+
zIndex = ZIndexes.Element + 1;
|
|
238
|
+
}
|
|
239
|
+
let edgeLabel = /* @__PURE__ */ jsx(EdgeLabel, { edgeProps: props, children: !isControlPointDragging && navigateTo && /* @__PURE__ */ jsx(
|
|
240
|
+
EdgeActionButton,
|
|
241
|
+
{
|
|
242
|
+
...props,
|
|
243
|
+
onClick: (e) => {
|
|
244
|
+
e.stopPropagation();
|
|
245
|
+
diagram.navigateTo(navigateTo);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
) });
|
|
249
|
+
if (!isControlPointDragging && !isPanning) {
|
|
248
250
|
const notes = props.data.notes;
|
|
249
|
-
if (notes &&
|
|
250
|
-
|
|
251
|
-
} else if (enableRelationshipDetails
|
|
252
|
-
|
|
251
|
+
if (notes && activeWalkthroughStep === props.id) {
|
|
252
|
+
edgeLabel = /* @__PURE__ */ jsx(NotePopover, { notes, children: edgeLabel });
|
|
253
|
+
} else if (enableRelationshipDetails) {
|
|
254
|
+
edgeLabel = /* @__PURE__ */ jsx(
|
|
253
255
|
RelationshipsDropdownMenu,
|
|
254
256
|
{
|
|
255
257
|
disabled: !!dimmed,
|
|
256
258
|
source,
|
|
257
259
|
target,
|
|
258
260
|
edgeId,
|
|
259
|
-
children:
|
|
261
|
+
children: edgeLabel
|
|
260
262
|
}
|
|
261
263
|
);
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
|
-
return /* @__PURE__ */ jsxs(
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
267
|
+
/* @__PURE__ */ jsxs(EdgeContainer, { ...props, className: clsx(isControlPointDragging && controlDragging), children: [
|
|
268
|
+
/* @__PURE__ */ jsx(EdgePath, { ...props, svgPath: edgePath, ref: svgPathRef, onEdgePointerDown }),
|
|
269
|
+
/* @__PURE__ */ jsx(
|
|
270
|
+
EdgeLabelContainer,
|
|
271
|
+
{
|
|
272
|
+
edgeProps: props,
|
|
273
|
+
labelPosition: {
|
|
274
|
+
x: labelX,
|
|
275
|
+
y: labelY,
|
|
276
|
+
translate: isModified ? "translate(-50%, 0)" : void 0
|
|
277
|
+
},
|
|
278
|
+
children: edgeLabel
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
] }),
|
|
282
|
+
enableEdgeEditing && controlPoints.length > 0 && (selected || hovered || isControlPointDragging) && /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(
|
|
283
|
+
EdgeContainer,
|
|
268
284
|
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
285
|
+
component: "svg",
|
|
286
|
+
className: controlPointsContainer,
|
|
287
|
+
...props,
|
|
288
|
+
style: {
|
|
289
|
+
...style,
|
|
290
|
+
zIndex
|
|
274
291
|
},
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
EdgeActionButton,
|
|
292
|
+
children: /* @__PURE__ */ jsx(
|
|
293
|
+
"g",
|
|
278
294
|
{
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
onContextMenu: (e) => {
|
|
296
|
+
e.preventDefault();
|
|
281
297
|
e.stopPropagation();
|
|
282
|
-
|
|
283
|
-
|
|
298
|
+
},
|
|
299
|
+
children: controlPoints.map((p, i) => /* @__PURE__ */ jsx(
|
|
300
|
+
"circle",
|
|
301
|
+
{
|
|
302
|
+
onPointerDown: (e) => onControlPointerDown(i, e),
|
|
303
|
+
className: clsx("nodrag nopan", controlPoint),
|
|
304
|
+
cx: Math.round(p.x),
|
|
305
|
+
cy: Math.round(p.y),
|
|
306
|
+
r: 3
|
|
307
|
+
},
|
|
308
|
+
i
|
|
309
|
+
))
|
|
284
310
|
}
|
|
285
311
|
)
|
|
286
312
|
}
|
|
287
|
-
)
|
|
288
|
-
enableEdgeEditing && controlPoints.length > 0 && /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(EdgeContainer, { component: "svg", className: controlPointsContainer, ...props, children: /* @__PURE__ */ jsx(
|
|
289
|
-
"g",
|
|
290
|
-
{
|
|
291
|
-
onContextMenu: (e) => {
|
|
292
|
-
e.preventDefault();
|
|
293
|
-
e.stopPropagation();
|
|
294
|
-
},
|
|
295
|
-
children: controlPoints.map((p, i) => /* @__PURE__ */ jsx(
|
|
296
|
-
"circle",
|
|
297
|
-
{
|
|
298
|
-
onPointerDown: (e) => onControlPointerDown(i, e),
|
|
299
|
-
className: clsx("nodrag nopan", controlPoint),
|
|
300
|
-
cx: Math.round(p.x),
|
|
301
|
-
cy: Math.round(p.y),
|
|
302
|
-
r: 3
|
|
303
|
-
},
|
|
304
|
-
i
|
|
305
|
-
))
|
|
306
|
-
}
|
|
307
|
-
) }) })
|
|
313
|
+
) })
|
|
308
314
|
] });
|
|
309
315
|
});
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
};
|
|
316
|
+
|
|
317
|
+
export { RelationshipEdge };
|
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { css } from '@likec4/styles/css';
|
|
2
|
+
|
|
3
|
+
const menuDropdown = css({
|
|
4
|
+
overflowY: "scroll",
|
|
5
|
+
minWidth: "250px",
|
|
6
|
+
maxWidth: "min(90vw, 500px)"
|
|
7
|
+
});
|
|
8
|
+
const menuItemRelationship = css({
|
|
9
|
+
gap: 4
|
|
10
|
+
});
|
|
11
|
+
const endpoint = css({
|
|
12
|
+
display: "block",
|
|
13
|
+
fontSize: "xxs",
|
|
14
|
+
fontWeight: 500,
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
padding: "2px 4px",
|
|
17
|
+
borderRadius: 2,
|
|
18
|
+
background: `likec4.palette.fill/30`,
|
|
19
|
+
lineHeight: "[1.11]",
|
|
20
|
+
mixBlendMode: "hard-light",
|
|
21
|
+
color: {
|
|
22
|
+
_light: `[color-mix(in srgb, {colors.likec4.palette.stroke}, {colors.likec4.mixColor} 60%)]`,
|
|
23
|
+
_dark: "likec4.palette.loContrast"
|
|
24
|
+
}
|
|
25
|
+
// _dark: {
|
|
26
|
+
// background: `likec4.palette.fill/60`,
|
|
27
|
+
// },
|
|
28
|
+
});
|
|
29
|
+
const title = css({
|
|
30
|
+
whiteSpaceCollapse: "preserve-breaks",
|
|
31
|
+
fontSize: "xs"
|
|
32
|
+
});
|
|
33
|
+
css({
|
|
34
|
+
whiteSpaceCollapse: "preserve-breaks",
|
|
35
|
+
fontSize: "xs"
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { endpoint, menuDropdown, menuItemRelationship, title };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EdgeId } from '@likec4/core';
|
|
2
|
-
import { PropsWithChildren, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import { PropsWithChildren, ForwardRefExoticComponent, RefAttributes, MemoExoticComponent } from 'react';
|
|
3
3
|
import { TooltipProps } from '@mantine/core';
|
|
4
4
|
export declare const Tooltip: ForwardRefExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & {
|
|
5
5
|
component?: any;
|
|
6
6
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
7
7
|
}>;
|
|
8
|
-
export declare
|
|
8
|
+
export declare const RelationshipsDropdownMenu: MemoExoticComponent<({ edgeId, source, target, disabled, children, }: PropsWithChildren<{
|
|
9
9
|
edgeId: EdgeId;
|
|
10
10
|
source: string;
|
|
11
11
|
target: string;
|
|
12
12
|
disabled?: boolean | undefined;
|
|
13
|
-
}>)
|
|
13
|
+
}>) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx, Fragment, jsxs } from
|
|
2
|
-
import { DiagramNode, nameFromFqn } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { useCallback, Fragment as Fragment$1, forwardRef } from
|
|
7
|
-
import { pipe, map, filter, isTruthy, partition } from
|
|
8
|
-
import { Link } from
|
|
9
|
-
import { useDiagramContext, useDiagram } from
|
|
10
|
-
import { findDiagramNode, findDiagramEdge } from
|
|
11
|
-
import { menuDropdown, endpoint, title, menuItemRelationship } from
|
|
12
|
-
import { useLikeC4Model } from
|
|
13
|
-
import { useMantinePortalProps } from
|
|
14
|
-
import { useEnabledFeature, IfEnabled } from
|
|
15
|
-
import { useDiagramEventHandlers } from
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { DiagramNode, nameFromFqn } from '@likec4/core';
|
|
3
|
+
import { cx, css } from '@likec4/styles/css';
|
|
4
|
+
import { Menu, MenuTarget, MenuDropdown, MenuLabel, MenuDivider, Box, ActionIcon, MenuItem, Stack, Group, Text, TooltipGroup, Space, Tooltip as Tooltip$1 } from '@mantine/core';
|
|
5
|
+
import { IconInfoCircle, IconArrowRight, IconZoomScan, IconFileSymlink } from '@tabler/icons-react';
|
|
6
|
+
import { memo, useCallback, Fragment as Fragment$1, forwardRef } from 'react';
|
|
7
|
+
import { pipe, map, filter, isTruthy, partition } from 'remeda';
|
|
8
|
+
import { Link } from '../../../components/Link.js';
|
|
9
|
+
import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
10
|
+
import { findDiagramNode, findDiagramEdge } from '../../../state/utils.js';
|
|
11
|
+
import { menuDropdown, endpoint, title, menuItemRelationship } from './RelationshipsDropdownMenu.css.js';
|
|
12
|
+
import { useLikeC4Model } from '../../../likec4model/useLikeC4Model.js';
|
|
13
|
+
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
14
|
+
import { useEnabledFeature, IfEnabled } from '../../../context/DiagramFeatures.js';
|
|
15
|
+
import { useDiagramEventHandlers } from '../../../context/DiagramEventHandlers.js';
|
|
16
|
+
|
|
16
17
|
const stopPropagation = (e) => e.stopPropagation();
|
|
17
18
|
const Tooltip = Tooltip$1.withProps({
|
|
18
19
|
color: "gray",
|
|
@@ -24,13 +25,13 @@ const Tooltip = Tooltip$1.withProps({
|
|
|
24
25
|
offset: 8,
|
|
25
26
|
withinPortal: false
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
const RelationshipsDropdownMenu = memo(({
|
|
28
29
|
edgeId,
|
|
29
30
|
source,
|
|
30
31
|
target,
|
|
31
32
|
disabled = false,
|
|
32
33
|
children
|
|
33
|
-
}) {
|
|
34
|
+
}) => {
|
|
34
35
|
const { diagramEdge, sourceNode, targetNode } = useDiagramContext((ctx) => ({
|
|
35
36
|
diagramEdge: findDiagramEdge(ctx, edgeId),
|
|
36
37
|
sourceNode: findDiagramNode(ctx, source),
|
|
@@ -128,7 +129,7 @@ function RelationshipsDropdownMenu({
|
|
|
128
129
|
]
|
|
129
130
|
}
|
|
130
131
|
);
|
|
131
|
-
}
|
|
132
|
+
});
|
|
132
133
|
const Relationship = forwardRef(({
|
|
133
134
|
className,
|
|
134
135
|
relationship: r,
|
|
@@ -137,26 +138,25 @@ const Relationship = forwardRef(({
|
|
|
137
138
|
targetNode,
|
|
138
139
|
...props
|
|
139
140
|
}, ref) => {
|
|
140
|
-
var _a, _b;
|
|
141
141
|
const diagram = useDiagram();
|
|
142
142
|
const { enableNavigateTo } = useEnabledFeature("NavigateTo");
|
|
143
143
|
const { onOpenSource } = useDiagramEventHandlers();
|
|
144
144
|
const viewId = diagram.currentView.id;
|
|
145
145
|
const sourceId = getShortId(r, r.source.id, sourceNode);
|
|
146
146
|
const targetId = getShortId(r, r.target.id, targetNode);
|
|
147
|
-
const navigateTo = enableNavigateTo &&
|
|
147
|
+
const navigateTo = enableNavigateTo && r.navigateTo?.id !== viewId ? r.navigateTo?.id : void 0;
|
|
148
148
|
const links = r.links;
|
|
149
|
-
return /* @__PURE__ */ jsxs(Stack, { ref, className:
|
|
149
|
+
return /* @__PURE__ */ jsxs(Stack, { ref, className: cx(menuItemRelationship, className), ...props, children: [
|
|
150
150
|
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
151
|
-
/* @__PURE__ */ jsx(Text, { component: "div", className:
|
|
152
|
-
/* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size:
|
|
153
|
-
/* @__PURE__ */ jsx(Text, { component: "div", className:
|
|
151
|
+
/* @__PURE__ */ jsx(Text, { component: "div", className: cx(css({ likec4Palette: sourceNode.color }), endpoint), children: sourceId }),
|
|
152
|
+
/* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size: "11px", opacity: 0.65 }),
|
|
153
|
+
/* @__PURE__ */ jsx(Text, { component: "div", className: cx(css({ likec4Palette: targetNode.color }), endpoint), children: targetId }),
|
|
154
154
|
(navigateTo || !!onOpenSource) && /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 100, children: [
|
|
155
155
|
/* @__PURE__ */ jsx(Space, { w: "xs" }),
|
|
156
156
|
navigateTo && /* @__PURE__ */ jsx(Tooltip, { label: "Open dynamic view", children: /* @__PURE__ */ jsx(
|
|
157
157
|
ActionIcon,
|
|
158
158
|
{
|
|
159
|
-
className:
|
|
159
|
+
className: cx("nodrag nopan"),
|
|
160
160
|
size: "sm",
|
|
161
161
|
radius: "sm",
|
|
162
162
|
variant: "default",
|
|
@@ -172,7 +172,7 @@ const Relationship = forwardRef(({
|
|
|
172
172
|
/* @__PURE__ */ jsx(IfEnabled, { feature: "Vscode", children: /* @__PURE__ */ jsx(Tooltip, { label: "Open source", children: /* @__PURE__ */ jsx(
|
|
173
173
|
ActionIcon,
|
|
174
174
|
{
|
|
175
|
-
className:
|
|
175
|
+
className: cx("nodrag nopan"),
|
|
176
176
|
size: "sm",
|
|
177
177
|
radius: "sm",
|
|
178
178
|
variant: "default",
|
|
@@ -204,7 +204,5 @@ function getShortId(r, actualEndpointId, diagramNode) {
|
|
|
204
204
|
const diagramNodeId = r.isDeploymentRelation() ? diagramNode.id : DiagramNode.modelRef(diagramNode) || "";
|
|
205
205
|
return nameFromFqn(diagramNodeId) + actualEndpointId.slice(diagramNodeId.length);
|
|
206
206
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
Tooltip
|
|
210
|
-
};
|
|
207
|
+
|
|
208
|
+
export { RelationshipsDropdownMenu, Tooltip };
|