@likec4/diagram 1.28.0 → 1.29.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.
Files changed (162) hide show
  1. package/bundle/index.js +1040 -1190
  2. package/dist/LikeC4CustomColors.js +2 -2
  3. package/dist/LikeC4Diagram.js +2 -2
  4. package/dist/LikeC4ModelProvider.js +1 -1
  5. package/dist/_virtual/index.js +5 -0
  6. package/dist/_virtual/index2.js +3 -0
  7. package/dist/_virtual/react.production.js +3 -0
  8. package/dist/base/BaseXYFlow.js +5 -5
  9. package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
  10. package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
  11. package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
  12. package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
  13. package/dist/base/primitives/customEdge.d.ts +1 -1
  14. package/dist/base/primitives/customEdge.js +3 -3
  15. package/dist/base/primitives/customNode.js +2 -2
  16. package/dist/base/primitives/edge/EdgeContainer.js +1 -1
  17. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +3 -0
  18. package/dist/base/primitives/edge/EdgeLabel.css.js +3 -0
  19. package/dist/base/primitives/edge/EdgeLabel.d.ts +1 -1
  20. package/dist/base/primitives/edge/EdgeLabel.js +3 -2
  21. package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
  22. package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
  23. package/dist/base/primitives/edge/EdgePath.js +23 -16
  24. package/dist/base/primitives/edge/edge.css.js +1 -1
  25. package/dist/base/primitives/element/ElementActionButtons.js +1 -2
  26. package/dist/base/primitives/element/ElementDetailsButton.js +1 -2
  27. package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
  28. package/dist/base/updateEdges.js +7 -2
  29. package/dist/base/updateNodes.js +11 -3
  30. package/dist/bundle/LikeC4View.js +3 -3
  31. package/dist/bundle/ReactLikeC4.js +1 -1
  32. package/dist/bundle/ShadowRoot.js +3 -3
  33. package/dist/bundle/styles.css.js +3 -3
  34. package/dist/context/ControlsCustomLayout.js +1 -1
  35. package/dist/context/DiagramEventHandlers.js +5 -5
  36. package/dist/context/DiagramFeatures.js +7 -7
  37. package/dist/context/EnsureMantine.js +2 -2
  38. package/dist/context/FramerMotionConfig.js +2 -2
  39. package/dist/context/IconRenderer.js +4 -4
  40. package/dist/context/ReduceGraphics.js +2 -2
  41. package/dist/context/RootContainer.js +5 -9
  42. package/dist/hooks/safeContext.d.ts +2 -5
  43. package/dist/hooks/safeContext.js +5 -4
  44. package/dist/hooks/useCurrentViewId.js +1 -1
  45. package/dist/hooks/useDiagram.d.ts +715 -150
  46. package/dist/hooks/useDiagram.js +2 -2
  47. package/dist/hooks/useMantinePortalProps.js +2 -2
  48. package/dist/hooks/useSetState.js +3 -3
  49. package/dist/hooks/useUpdateEffect.js +1 -1
  50. package/dist/hooks/useXYFlow.d.ts +2 -2
  51. package/dist/likec4diagram/DiagramUI.js +2 -2
  52. package/dist/likec4diagram/DiagramXYFlow.js +2 -2
  53. package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
  54. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  55. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +7 -7
  56. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
  57. package/dist/likec4diagram/custom/index.d.ts +1 -2
  58. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
  59. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
  60. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  61. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
  62. package/dist/likec4diagram/ui/controls/Controls.js +9 -9
  63. package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
  64. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
  65. package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -4
  66. package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
  67. package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
  68. package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
  69. package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
  70. package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
  71. package/dist/likec4diagram/ui/search/state.js +11 -9
  72. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
  73. package/dist/likec4diagram/useLayoutConstraints.js +3 -3
  74. package/dist/likec4model/LikeC4ModelContext.js +2 -2
  75. package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
  76. package/dist/likec4model/useLikeC4Model.js +2 -2
  77. package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
  78. package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
  79. package/dist/overlays/Overlays.js +6 -6
  80. package/dist/overlays/element-details/ElementDetails.js +1 -1
  81. package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
  82. package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
  83. package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
  84. package/dist/overlays/element-details/TabPanelStructure.js +6 -3
  85. package/dist/overlays/element-details/actor.d.ts +2 -2
  86. package/dist/overlays/element-details/actorContext.js +3 -3
  87. package/dist/overlays/overlay/Overlay.js +8 -7
  88. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
  89. package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
  90. package/dist/overlays/relationship-details/SelectEdge.js +3 -6
  91. package/dist/overlays/relationship-details/actor.d.ts +4 -1
  92. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
  93. package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
  94. package/dist/overlays/relationship-details/hooks.d.ts +4 -1
  95. package/dist/overlays/relationship-details/hooks.js +4 -4
  96. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
  97. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
  98. package/dist/overlays/relationships-browser/SelectElement.js +8 -5
  99. package/dist/overlays/relationships-browser/actor.d.ts +2 -1
  100. package/dist/overlays/relationships-browser/actor.js +6 -12
  101. package/dist/overlays/relationships-browser/const.d.ts +2 -1
  102. package/dist/overlays/relationships-browser/const.js +6 -1
  103. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
  104. package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
  105. package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
  106. package/dist/overlays/relationships-browser/hooks.d.ts +2 -1
  107. package/dist/overlays/relationships-browser/hooks.js +4 -4
  108. package/dist/overlays/relationships-browser/layout.js +2 -2
  109. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
  110. package/dist/state/DiagramActorProvider.js +7 -5
  111. package/dist/state/diagram-machine.d.ts +719 -146
  112. package/dist/state/diagram-machine.js +51 -10
  113. package/dist/styles.css.js +1 -1
  114. package/package.json +20 -16
  115. package/src/LikeC4Diagram.tsx +0 -1
  116. package/src/base/BaseXYFlow.tsx +2 -2
  117. package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
  118. package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
  119. package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
  120. package/src/base/primitives/customEdge.ts +1 -0
  121. package/src/base/primitives/edge/EdgeLabel.css.ts +3 -0
  122. package/src/base/primitives/edge/EdgeLabel.tsx +2 -1
  123. package/src/base/primitives/edge/EdgePath.tsx +22 -14
  124. package/src/base/primitives/edge/edge.css.ts +1 -1
  125. package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
  126. package/src/base/primitives/element/ElementDetailsButton.tsx +2 -2
  127. package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
  128. package/src/base/updateEdges.ts +6 -9
  129. package/src/base/updateNodes.ts +10 -14
  130. package/src/context/FramerMotionConfig.tsx +1 -1
  131. package/src/context/RootContainer.tsx +0 -4
  132. package/src/hooks/safeContext.tsx +3 -1
  133. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +2 -2
  134. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
  135. package/src/likec4diagram/ui/controls/Controls.tsx +56 -58
  136. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
  137. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
  138. package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -1
  139. package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
  140. package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
  141. package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
  142. package/src/likec4diagram/ui/search/state.ts +8 -6
  143. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
  144. package/src/overlays/Overlays.tsx +2 -2
  145. package/src/overlays/element-details/ElementDetails.tsx +2 -2
  146. package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
  147. package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
  148. package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
  149. package/src/overlays/overlay/Overlay.tsx +2 -1
  150. package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
  151. package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
  152. package/src/overlays/relationship-details/actor.ts +2 -1
  153. package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
  154. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
  155. package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
  156. package/src/overlays/relationships-browser/actor.ts +8 -13
  157. package/src/overlays/relationships-browser/const.ts +8 -1
  158. package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
  159. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
  160. package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
  161. package/src/state/DiagramActorProvider.tsx +7 -4
  162. package/src/state/diagram-machine.ts +50 -8
@@ -2,13 +2,13 @@ import '@likec4/core';
2
2
  import { useCallbackRef } from '@mantine/hooks';
3
3
  import { useSelector } from '@xstate/react';
4
4
  import { shallowEqual } from 'fast-equals';
5
- import { useMemo } from 'react';
5
+ import { r as reactExports } from '../_virtual/index.js';
6
6
  import { findDiagramEdge, findDiagramNode } from '../state/utils.js';
7
7
  import { useDiagramActorRef } from './safeContext.js';
8
8
 
9
9
  function useDiagram() {
10
10
  const actor = useDiagramActorRef();
11
- return useMemo(() => ({
11
+ return reactExports.useMemo(() => ({
12
12
  actor,
13
13
  send: actor.send,
14
14
  navigateTo: (viewId, fromNode) => {
@@ -1,9 +1,9 @@
1
- import { useMemo } from 'react';
1
+ import { r as reactExports } from '../_virtual/index.js';
2
2
  import { useRootContainer } from '../context/RootContainer.js';
3
3
 
4
4
  function useMantinePortalProps() {
5
5
  const target = useRootContainer();
6
- return useMemo(() => target ? { portalProps: { target }, withinPortal: true } : { withinPortal: false }, [target]);
6
+ return reactExports.useMemo(() => target ? { portalProps: { target }, withinPortal: true } : { withinPortal: false }, [target]);
7
7
  }
8
8
 
9
9
  export { useMantinePortalProps };
@@ -1,9 +1,9 @@
1
1
  import { shallowEqual } from 'fast-equals';
2
- import { useState, useCallback } from 'react';
2
+ import { r as reactExports } from '../_virtual/index.js';
3
3
 
4
4
  function useSetState(initialState) {
5
- const [state, _setState] = useState(initialState);
6
- const setState = useCallback(
5
+ const [state, _setState] = reactExports.useState(initialState);
6
+ const setState = reactExports.useCallback(
7
7
  (statePartial) => _setState((current) => {
8
8
  const next = {
9
9
  ...current,
@@ -1,6 +1,6 @@
1
1
  import { useFirstMountState, useCustomCompareEffect } from '@react-hookz/web';
2
2
  import { shallowEqual } from 'fast-equals';
3
- import 'react';
3
+ import '../_virtual/index.js';
4
4
 
5
5
  const noop = () => {
6
6
  };
@@ -1,8 +1,8 @@
1
- import { ReactFlowState, ReactFlowInstance, EdgeMarkerType, HandleType, InternalNode } from '@xyflow/react';
1
+ import { ReactFlowState, ReactFlowInstance, InternalNode } from '@xyflow/react';
2
2
  import { Types } from '../likec4diagram/types';
3
+ import { EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
3
4
  import { ReactNode, CSSProperties } from 'react';
4
5
  import { EdgeId, NonEmptyArray, Point, Color, BBox, RelationshipLineType, RelationshipArrowType, ViewId } from '@likec4/core';
5
- import { XYPosition } from '@xyflow/system';
6
6
  export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
7
7
  id: string;
8
8
  source: string;
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { memo } from 'react';
2
+ import { r as reactExports } from '../_virtual/index.js';
3
3
  import { useOverlaysActorRef } from '../hooks/useOverlaysActor.js';
4
4
  import { Overlays } from '../overlays/Overlays.js';
5
5
  import { useEnabledFeatures } from '../context/DiagramFeatures.js';
@@ -8,7 +8,7 @@ import { DiagramTitlePanel } from './ui/diagram-title/DiagramTitlePanel.js';
8
8
  import { NotationPanel } from './ui/notation/NotationPanel.js';
9
9
  import { DynamicViewWalkthrough } from './ui/walkthrough/DynamicViewWalkthrough.js';
10
10
 
11
- const DiagramUI = memo(() => {
11
+ const DiagramUI = reactExports.memo(() => {
12
12
  const {
13
13
  enableViewTitle,
14
14
  enableNotations,
@@ -3,7 +3,7 @@ import { nonNullable } from '@likec4/core';
3
3
  import { cx } from '@likec4/styles/css';
4
4
  import { useTimeout, useDebouncedCallback, useCallbackRef } from '@mantine/hooks';
5
5
  import { deepEqual, shallowEqual } from 'fast-equals';
6
- import { memo } from 'react';
6
+ import { r as reactExports } from '../_virtual/index.js';
7
7
  import { BaseXYFlow } from '../base/BaseXYFlow.js';
8
8
  import { useIsReducedGraphics, usePanningAtom } from '../context/ReduceGraphics.js';
9
9
  import { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
@@ -31,7 +31,7 @@ const selectXYProps = (ctx) => ({
31
31
  });
32
32
  const equalsXYProps = (a, b) => a.initialized === b.initialized && a.pannable === b.pannable && a.zoomable === b.zoomable && a.fitViewPadding === b.fitViewPadding && a.enableFitView === b.enableFitView && a.enableReadOnly === b.enableReadOnly && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges) && shallowEqual(a.viewport ?? null, b.viewport ?? null);
33
33
  const compareProps = (a, b) => a.nodesDraggable === b.nodesDraggable && a.nodesSelectable === b.nodesSelectable && deepEqual(a.background, b.background) && deepEqual(a.reactFlowProps ?? {}, b.reactFlowProps ?? {});
34
- const LikeC4DiagramXYFlow = memo(({
34
+ const LikeC4DiagramXYFlow = reactExports.memo(({
35
35
  background = "dots",
36
36
  nodesDraggable = false,
37
37
  nodesSelectable = false,
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Popover, PopoverTarget, PopoverDropdown, Stack, ScrollAreaAutosize, Text, CloseButton, Group, Button } from '@mantine/core';
3
3
  import { useDebouncedEffect } from '@react-hookz/web';
4
- import { useState } from 'react';
4
+ import { r as reactExports } from '../../../_virtual/index.js';
5
5
  import { isTruthy, isNonNull } from 'remeda';
6
6
  import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
7
7
  import { edgeNoteText, edgeNoteCloseButton } from './NotePopover.css.js';
@@ -21,7 +21,7 @@ const NotePopover = ({ notes, children }) => {
21
21
  hasPrevious: s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) > 0
22
22
  }));
23
23
  const diagram = useDiagram();
24
- const [isOpened, setIsOpened] = useState(false);
24
+ const [isOpened, setIsOpened] = reactExports.useState(false);
25
25
  const portalProps = useMantinePortalProps();
26
26
  useDebouncedEffect(
27
27
  () => {
@@ -1,7 +1,7 @@
1
1
  import { EdgeId, NonEmptyArray, Point, Color, BBox, RelationshipLineType, RelationshipArrowType, ViewId } from '@likec4/core';
2
+ import { XYPosition } from '@xyflow/react';
2
3
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
3
- import { Position } from '@xyflow/react';
4
- import { XYPosition } from '@xyflow/system';
4
+ import { Position } from '@xyflow/system';
5
5
  export declare const RelationshipEdge: NamedExoticComponent<{
6
6
  id: string;
7
7
  selected?: boolean;
@@ -4,7 +4,7 @@ import { useDebouncedEffect } from '@react-hookz/web';
4
4
  import { EdgeLabelRenderer } from '@xyflow/react';
5
5
  import clsx from 'clsx';
6
6
  import { line, curveCatmullRomOpen } from 'd3-shape';
7
- import { useState, useRef, useEffect } from 'react';
7
+ import { r as reactExports } from '../../../_virtual/index.js';
8
8
  import { isTruthy, first, last } from 'remeda';
9
9
  import { ZIndexes } from '../../../base/const.js';
10
10
  import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
@@ -28,7 +28,7 @@ const curve = line().curve(curveCatmullRomOpen).x((d) => d.x).y((d) => d.y);
28
28
  const selectActiveStepId = (s) => s.context.activeWalkthrough?.stepId ?? null;
29
29
  const RelationshipEdge = customEdge((props) => {
30
30
  const isPanning = useIsPanning();
31
- const [isControlPointDragging, setIsControlPointDragging] = useState(false);
31
+ const [isControlPointDragging, setIsControlPointDragging] = reactExports.useState(false);
32
32
  const xyflowStore = useXYStoreApi();
33
33
  const xyflow = useXYFlow();
34
34
  const diagram = useDiagram();
@@ -83,12 +83,12 @@ const RelationshipEdge = customEdge((props) => {
83
83
  edgePath = bezierPath(points);
84
84
  }
85
85
  let labelX = labelBBox?.x ?? 0, labelY = labelBBox?.y ?? 0;
86
- const [labelPos, setLabelPos] = useState({
86
+ const [labelPos, setLabelPos] = reactExports.useState({
87
87
  x: labelXY?.x ?? labelX,
88
88
  y: labelXY?.y ?? labelY
89
89
  });
90
- const svgPathRef = useRef(null);
91
- useEffect(() => {
90
+ const svgPathRef = reactExports.useRef(null);
91
+ reactExports.useEffect(() => {
92
92
  const path = svgPathRef.current;
93
93
  if (!path) return;
94
94
  const dompoint = path.getPointAtLength(path.getTotalLength() * 0.5);
@@ -268,7 +268,7 @@ const RelationshipEdge = customEdge((props) => {
268
268
  /* @__PURE__ */ jsx(
269
269
  EdgePath,
270
270
  {
271
- ...props,
271
+ edgeProps: props,
272
272
  svgPath: edgePath,
273
273
  ref: svgPathRef,
274
274
  ...enableEdgeEditing && {
@@ -315,7 +315,7 @@ const RelationshipEdge = customEdge((props) => {
315
315
  cy: Math.round(p.y),
316
316
  r: 3
317
317
  },
318
- i
318
+ "controlPoints" + edgeId + "#" + i
319
319
  ))
320
320
  }
321
321
  )
@@ -3,7 +3,7 @@ import { DiagramNode, nameFromFqn } from '@likec4/core';
3
3
  import { cx, css } from '@likec4/styles/css';
4
4
  import { Menu, MenuTarget, MenuDropdown, MenuLabel, MenuDivider, Box, ActionIcon, MenuItem, Stack, Group, Text, TooltipGroup, Space, Tooltip as Tooltip$1 } from '@mantine/core';
5
5
  import { IconInfoCircle, IconArrowRight, IconZoomScan, IconFileSymlink } from '@tabler/icons-react';
6
- import { memo, useCallback, Fragment as Fragment$1, forwardRef } from 'react';
6
+ import { r as reactExports } from '../../../_virtual/index.js';
7
7
  import { pipe, map, filter, isTruthy, partition } from 'remeda';
8
8
  import { Link } from '../../../components/Link.js';
9
9
  import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
@@ -25,7 +25,7 @@ const Tooltip = Tooltip$1.withProps({
25
25
  offset: 8,
26
26
  withinPortal: false
27
27
  });
28
- const RelationshipsDropdownMenu = memo(({
28
+ const RelationshipsDropdownMenu = reactExports.memo(({
29
29
  edgeId,
30
30
  source,
31
31
  target,
@@ -40,7 +40,7 @@ const RelationshipsDropdownMenu = memo(({
40
40
  const likec4model = useLikeC4Model(true);
41
41
  const diagram = useDiagram();
42
42
  const portalProps = useMantinePortalProps();
43
- const onClickOpenOverlay = useCallback((e) => {
43
+ const onClickOpenOverlay = reactExports.useCallback((e) => {
44
44
  e.stopPropagation();
45
45
  diagram.openRelationshipDetails(edgeId);
46
46
  }, [edgeId]);
@@ -51,7 +51,7 @@ const RelationshipsDropdownMenu = memo(({
51
51
  diagramEdge.relations,
52
52
  map((id) => {
53
53
  try {
54
- return likec4model.relationship(id);
54
+ return likec4model.findRelationship(id);
55
55
  } catch (e) {
56
56
  console.error(
57
57
  `View is cached and likec4model missing relationship ${id} from ${sourceNode.id} -> ${targetNode.id}`,
@@ -63,7 +63,7 @@ const RelationshipsDropdownMenu = memo(({
63
63
  filter(isTruthy),
64
64
  partition((r) => r.source.id === sourceNode.id && r.target.id === targetNode.id)
65
65
  );
66
- const renderRelationship = (relationship, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
66
+ const renderRelationship = (relationship, index) => /* @__PURE__ */ jsxs(reactExports.Fragment, { children: [
67
67
  index > 0 && /* @__PURE__ */ jsx(MenuDivider, { opacity: 0.65 }),
68
68
  /* @__PURE__ */ jsx(
69
69
  MenuItem,
@@ -130,7 +130,7 @@ const RelationshipsDropdownMenu = memo(({
130
130
  }
131
131
  );
132
132
  });
133
- const Relationship = forwardRef(({
133
+ const Relationship = reactExports.forwardRef(({
134
134
  className,
135
135
  relationship: r,
136
136
  edge,
@@ -1,9 +1,8 @@
1
1
  import { Types } from '../types';
2
2
  import { NamedExoticComponent, CSSProperties, ReactNode } from 'react';
3
3
  import { NodeProps } from '../../base';
4
- import { Position } from '@xyflow/react';
4
+ import { Position, XYPosition } from '@xyflow/system';
5
5
  import { EdgeId, NonEmptyArray, Point, Color, BBox, RelationshipLineType, RelationshipArrowType, ViewId } from '@likec4/core';
6
- import { XYPosition } from '@xyflow/system';
7
6
  export declare const nodeTypes: {
8
7
  element: NamedExoticComponent<NodeProps<Types.ElementNodeData>>;
9
8
  deployment: NamedExoticComponent<NodeProps<Types.DeploymentElementNodeData>>;
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { defaultTheme } from '@likec4/core';
3
3
  import { Popover, PopoverTarget, Button, ColorSwatch, PopoverDropdown, Space, Divider, Stack, TooltipGroup, Flex, Tooltip, CheckIcon, rem, Slider } from '@mantine/core';
4
4
  import { useUpdateEffect } from '@react-hookz/web';
5
- import { useState } from 'react';
5
+ import { r as reactExports } from '../../../../_virtual/index.js';
6
6
  import { themedColors, colors } from './_shared.js';
7
7
 
8
8
  function ColorButton({
@@ -137,7 +137,7 @@ function OpacityOption({
137
137
  elementOpacity = 100,
138
138
  onOpacityChange
139
139
  }) {
140
- const [value, setValue] = useState(elementOpacity);
140
+ const [value, setValue] = reactExports.useState(elementOpacity);
141
141
  useUpdateEffect(() => {
142
142
  setValue(elementOpacity);
143
143
  }, [elementOpacity]);
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import '@likec4/core';
3
3
  import { Box, SegmentedControl } from '@mantine/core';
4
- import { useState, useEffect } from 'react';
4
+ import { r as reactExports } from '../../../../_virtual/index.js';
5
5
  import { useHandlers, GoToSourceButton, BrowseRelationshipsButton } from './_shared.js';
6
6
  import { ColorButton } from './ColorButton.js';
7
7
  import { Toolbar } from './Toolbar.js';
@@ -92,8 +92,8 @@ function BorderStyleOption({
92
92
  elementBorderStyle = "dashed",
93
93
  onChange
94
94
  }) {
95
- const [value, setValue] = useState(elementBorderStyle);
96
- useEffect(() => {
95
+ const [value, setValue] = reactExports.useState(elementBorderStyle);
96
+ reactExports.useEffect(() => {
97
97
  setValue(elementBorderStyle);
98
98
  }, [elementBorderStyle]);
99
99
  return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
@@ -3,7 +3,7 @@ import { invariant, defaultTheme } from '@likec4/core';
3
3
  import { Tooltip as Tooltip$1, ActionIcon } from '@mantine/core';
4
4
  import { useCallbackRef } from '@mantine/hooks';
5
5
  import { IconFileSymlink, IconTransform } from '@tabler/icons-react';
6
- import { useState } from 'react';
6
+ import { r as reactExports } from '../../../../_virtual/index.js';
7
7
  import { keys } from 'remeda';
8
8
  import { useDiagram } from '../../../../hooks/useDiagram.js';
9
9
  import { useDiagramEventHandlers } from '../../../../context/DiagramEventHandlers.js';
@@ -36,7 +36,7 @@ const Tooltip = Tooltip$1.withProps({
36
36
  function useHandlers(target, props) {
37
37
  const { onChange: triggerOnChange } = useDiagramEventHandlers();
38
38
  const diagram = useDiagram();
39
- const [originalColor, setOriginalColor] = useState(null);
39
+ const [originalColor, setOriginalColor] = reactExports.useState(null);
40
40
  const onColorPreview = useCallbackRef((color) => {
41
41
  if (color === null) {
42
42
  invariant(originalColor, "originalColor is null");
@@ -3,7 +3,7 @@ import { Popover, PopoverTarget, PopoverDropdown, Box, FloatingIndicator, Text,
3
3
  import { useHover, useUncontrolled, clampUseMovePosition, useMove, useMergedRef } from '@mantine/hooks';
4
4
  import { useDebouncedCallback } from '@react-hookz/web';
5
5
  import { IconLayoutDashboard } from '@tabler/icons-react';
6
- import { useState, forwardRef } from 'react';
6
+ import { r as reactExports } from '../../../_virtual/index.js';
7
7
  import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram.js';
8
8
  import { Tooltip, ActionIcon } from './_shared.js';
9
9
  import { autolayoutIndicator, autolayoutButton, spacingSliderBody, spacingSliderThumb } from './styles.css.js';
@@ -18,8 +18,8 @@ const ChangeAutoLayoutButton = (props) => {
18
18
  onChange
19
19
  } = useDiagramEventHandlers();
20
20
  const diagram = useDiagram();
21
- const [rootRef, setRootRef] = useState(null);
22
- const [controlsRefs, setControlsRefs] = useState({});
21
+ const [rootRef, setRootRef] = reactExports.useState(null);
22
+ const [controlsRefs, setControlsRefs] = reactExports.useState({});
23
23
  const {
24
24
  autoLayout,
25
25
  viewId
@@ -103,7 +103,7 @@ const ChangeAutoLayoutButton = (props) => {
103
103
  );
104
104
  };
105
105
  const MAX_SPACING = 400;
106
- const SpacingSliders = forwardRef(({
106
+ const SpacingSliders = reactExports.forwardRef(({
107
107
  isVertical,
108
108
  nodeSep,
109
109
  rankSep,
@@ -1,9 +1,9 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { cx } from '@likec4/styles/css';
2
3
  import { ActionIconGroup, Group, Stack, Box, Badge, Loader } from '@mantine/core';
3
4
  import { IconFileSymlink, IconFocusCentered, IconMenu2 } from '@tabler/icons-react';
4
- import { clsx } from 'clsx';
5
- import { LayoutGroup, AnimatePresence, m } from 'framer-motion';
6
- import { memo } from 'react';
5
+ import { m, LayoutGroup } from 'motion/react';
6
+ import { r as reactExports } from '../../../_virtual/index.js';
7
7
  import { useControlsCustomLayout } from '../../../context/ControlsCustomLayout.js';
8
8
  import { useDiagramContext, useDiagram, useDiagramSyncLayoutState } from '../../../hooks/useDiagram.js';
9
9
  import { LikeC4Search } from '../search/LikeC4Search.js';
@@ -44,7 +44,7 @@ const ControlsDefaultLayout = ({
44
44
  translateY: -10
45
45
  },
46
46
  align: "flex-start",
47
- className: clsx(
47
+ className: cx(
48
48
  "react-flow__panel",
49
49
  panel,
50
50
  "likec4-top-left-panel"
@@ -56,7 +56,7 @@ const ControlsDefaultLayout = ({
56
56
  /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsxs(
57
57
  Group,
58
58
  {
59
- className: clsx(navigationButtons, "likec4-navigation-webview"),
59
+ className: cx(navigationButtons, "likec4-navigation-webview"),
60
60
  gap: "xs",
61
61
  children: [
62
62
  burgerMenu,
@@ -70,7 +70,7 @@ const ControlsDefaultLayout = ({
70
70
  ]
71
71
  }
72
72
  );
73
- const Controls = memo(() => {
73
+ const Controls = reactExports.memo(() => {
74
74
  const { viewId, hasLayoutDrift, viewportChanged, isNotActiveWalkthrough } = useDiagramContext((c) => ({
75
75
  viewId: c.view.id,
76
76
  hasLayoutDrift: c.view.hasLayoutDrift ?? false,
@@ -92,7 +92,7 @@ const Controls = memo(() => {
92
92
  const notReadOnly = !enableReadOnly;
93
93
  const portalProps = useMantinePortalProps();
94
94
  const ControlsLayout = useControlsCustomLayout() ?? ControlsDefaultLayout;
95
- return /* @__PURE__ */ jsx(LayoutGroup, { inherit: false, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: isNotActiveWalkthrough && /* @__PURE__ */ jsx(
95
+ return /* @__PURE__ */ jsx(Fragment, { children: isNotActiveWalkthrough && /* @__PURE__ */ jsx(
96
96
  ControlsLayout,
97
97
  {
98
98
  burgerMenu: onBurgerMenuClick && /* @__PURE__ */ jsx(
@@ -137,7 +137,7 @@ const Controls = memo(() => {
137
137
  ) })
138
138
  ] })
139
139
  }
140
- ) }) });
140
+ ) });
141
141
  });
142
142
  const SyncLayoutBadge = () => {
143
143
  const isPending = useDiagramSyncLayoutState((s) => s.hasTag("pending"));
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
3
- import { AnimatePresence, m } from 'framer-motion';
3
+ import { AnimatePresence, m } from 'motion/react';
4
4
  import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram.js';
5
5
  import { ActionIcon } from './_shared.js';
6
6
 
@@ -3,7 +3,7 @@ import { Card, CardSection, Button, Group, Text, Spoiler, Stack } from '@mantine
3
3
  import { useLocalStorage } from '@mantine/hooks';
4
4
  import { IconMenu } from '@tabler/icons-react';
5
5
  import clsx from 'clsx';
6
- import { AnimatePresence, m } from 'framer-motion';
6
+ import { AnimatePresence, m } from 'motion/react';
7
7
  import { Link } from '../../../components/Link.js';
8
8
  import { useDiagramContext } from '../../../hooks/useDiagram.js';
9
9
  import { card, title, description } from './DiagramTitlePanel.css.js';
@@ -5,8 +5,8 @@ import { Tooltip, ThemeIcon, ActionIcon, Paper, Tabs, TabsList, TabsTab, TabsPan
5
5
  import { useLocalStorage } from '@mantine/hooks';
6
6
  import { IconAlertTriangle, IconHelpCircle, IconArrowDownRight } from '@tabler/icons-react';
7
7
  import clsx from 'clsx';
8
- import { AnimatePresence, m } from 'framer-motion';
9
- import { memo, useState } from 'react';
8
+ import { AnimatePresence, m } from 'motion/react';
9
+ import { r as reactExports } from '../../../_virtual/index.js';
10
10
  import { ceil, isNonNullish } from 'remeda';
11
11
  import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
12
12
  import { useXYStore } from '../../../hooks/useXYFlow.js';
@@ -20,7 +20,7 @@ const ElementNotation = ({ value }) => {
20
20
  color = "primary",
21
21
  shape = "rectangle"
22
22
  } = value;
23
- const [onlyKind, setOnlyKind] = useState(null);
23
+ const [onlyKind, setOnlyKind] = reactExports.useState(null);
24
24
  const diagram = useDiagram();
25
25
  const w = 300;
26
26
  const h = 200;
@@ -119,7 +119,7 @@ const selector = (s) => ({
119
119
  isVisible: true
120
120
  // isVisible: isNullish(s.focusedNodeId ?? s.activeWalkthrough),
121
121
  });
122
- const NotationPanel = memo(() => {
122
+ const NotationPanel = reactExports.memo(() => {
123
123
  const height = useXYStore((s) => s.height);
124
124
  const {
125
125
  id,