@likec4/diagram 1.28.0 → 1.28.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.
Files changed (151) hide show
  1. package/bundle/index.js +967 -1150
  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 +2 -2
  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.js +1 -1
  18. package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
  19. package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
  20. package/dist/base/primitives/edge/EdgePath.js +23 -16
  21. package/dist/base/primitives/edge/edge.css.js +1 -1
  22. package/dist/base/primitives/element/ElementActionButtons.js +1 -2
  23. package/dist/base/primitives/element/ElementDetailsButton.js +1 -2
  24. package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
  25. package/dist/base/updateEdges.js +7 -2
  26. package/dist/base/updateNodes.js +11 -3
  27. package/dist/bundle/LikeC4View.js +3 -3
  28. package/dist/bundle/ReactLikeC4.js +1 -1
  29. package/dist/bundle/ShadowRoot.js +3 -3
  30. package/dist/bundle/styles.css.js +3 -3
  31. package/dist/context/ControlsCustomLayout.js +1 -1
  32. package/dist/context/DiagramEventHandlers.js +5 -5
  33. package/dist/context/DiagramFeatures.js +7 -7
  34. package/dist/context/EnsureMantine.js +2 -2
  35. package/dist/context/FramerMotionConfig.js +2 -2
  36. package/dist/context/IconRenderer.js +4 -4
  37. package/dist/context/ReduceGraphics.js +2 -2
  38. package/dist/context/RootContainer.js +5 -9
  39. package/dist/hooks/safeContext.js +3 -3
  40. package/dist/hooks/useCurrentViewId.js +1 -1
  41. package/dist/hooks/useDiagram.d.ts +4 -4
  42. package/dist/hooks/useDiagram.js +2 -2
  43. package/dist/hooks/useMantinePortalProps.js +2 -2
  44. package/dist/hooks/useSetState.js +3 -3
  45. package/dist/hooks/useUpdateEffect.js +1 -1
  46. package/dist/hooks/useXYFlow.d.ts +2 -2
  47. package/dist/likec4diagram/DiagramUI.js +2 -2
  48. package/dist/likec4diagram/DiagramXYFlow.js +2 -2
  49. package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
  50. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  51. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +7 -7
  52. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
  53. package/dist/likec4diagram/custom/index.d.ts +1 -2
  54. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
  55. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
  56. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  57. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
  58. package/dist/likec4diagram/ui/controls/Controls.js +6 -6
  59. package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
  60. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
  61. package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -4
  62. package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
  63. package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
  64. package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
  65. package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
  66. package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
  67. package/dist/likec4diagram/ui/search/state.js +11 -9
  68. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
  69. package/dist/likec4diagram/useLayoutConstraints.js +3 -3
  70. package/dist/likec4model/LikeC4ModelContext.js +2 -2
  71. package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
  72. package/dist/likec4model/useLikeC4Model.js +2 -2
  73. package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
  74. package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
  75. package/dist/overlays/Overlays.js +6 -6
  76. package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
  77. package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
  78. package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
  79. package/dist/overlays/element-details/TabPanelStructure.js +6 -3
  80. package/dist/overlays/element-details/actor.d.ts +2 -2
  81. package/dist/overlays/element-details/actorContext.js +3 -3
  82. package/dist/overlays/overlay/Overlay.js +8 -7
  83. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
  84. package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
  85. package/dist/overlays/relationship-details/SelectEdge.js +3 -6
  86. package/dist/overlays/relationship-details/actor.d.ts +4 -1
  87. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
  88. package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
  89. package/dist/overlays/relationship-details/hooks.d.ts +4 -1
  90. package/dist/overlays/relationship-details/hooks.js +4 -4
  91. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
  92. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
  93. package/dist/overlays/relationships-browser/SelectElement.js +8 -5
  94. package/dist/overlays/relationships-browser/actor.d.ts +2 -1
  95. package/dist/overlays/relationships-browser/actor.js +6 -12
  96. package/dist/overlays/relationships-browser/const.d.ts +2 -1
  97. package/dist/overlays/relationships-browser/const.js +6 -1
  98. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
  99. package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
  100. package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
  101. package/dist/overlays/relationships-browser/hooks.d.ts +2 -1
  102. package/dist/overlays/relationships-browser/hooks.js +4 -4
  103. package/dist/overlays/relationships-browser/layout.js +2 -2
  104. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
  105. package/dist/state/DiagramActorProvider.js +5 -3
  106. package/dist/state/diagram-machine.d.ts +4 -4
  107. package/dist/state/diagram-machine.js +3 -4
  108. package/dist/styles.css.js +1 -1
  109. package/package.json +17 -13
  110. package/src/base/BaseXYFlow.tsx +2 -2
  111. package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
  112. package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
  113. package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
  114. package/src/base/primitives/edge/EdgePath.tsx +22 -14
  115. package/src/base/primitives/edge/edge.css.ts +1 -1
  116. package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
  117. package/src/base/primitives/element/ElementDetailsButton.tsx +2 -2
  118. package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
  119. package/src/base/updateEdges.ts +6 -9
  120. package/src/base/updateNodes.ts +10 -14
  121. package/src/context/FramerMotionConfig.tsx +1 -1
  122. package/src/context/RootContainer.tsx +0 -4
  123. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +2 -2
  124. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
  125. package/src/likec4diagram/ui/controls/Controls.tsx +53 -55
  126. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
  127. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
  128. package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -1
  129. package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
  130. package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
  131. package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
  132. package/src/likec4diagram/ui/search/state.ts +8 -6
  133. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
  134. package/src/overlays/Overlays.tsx +2 -2
  135. package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
  136. package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
  137. package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
  138. package/src/overlays/overlay/Overlay.tsx +2 -1
  139. package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
  140. package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
  141. package/src/overlays/relationship-details/actor.ts +2 -1
  142. package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
  143. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
  144. package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
  145. package/src/overlays/relationships-browser/actor.ts +8 -13
  146. package/src/overlays/relationships-browser/const.ts +8 -1
  147. package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
  148. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
  149. package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
  150. package/src/state/DiagramActorProvider.tsx +4 -1
  151. package/src/state/diagram-machine.ts +2 -3
@@ -1,14 +1,14 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { IconCylinder, IconRectangularPrism, IconReorder, IconUser, IconDeviceMobile, IconBrowser } from '@tabler/icons-react';
3
3
  import clsx from 'clsx';
4
- import { useContext, createContext } from 'react';
4
+ import { r as reactExports } from '../_virtual/index.js';
5
5
 
6
- const IconRendererContext = createContext(null);
6
+ const IconRendererContext = reactExports.createContext(null);
7
7
  function IconRendererProvider({
8
8
  value,
9
9
  children
10
10
  }) {
11
- const outerScope = useContext(IconRendererContext);
11
+ const outerScope = reactExports.useContext(IconRendererContext);
12
12
  if (outerScope) {
13
13
  return /* @__PURE__ */ jsx(Fragment, { children });
14
14
  }
@@ -18,7 +18,7 @@ function IconRenderer({
18
18
  element,
19
19
  className
20
20
  }) {
21
- const RenderIcon = useContext(IconRendererContext);
21
+ const RenderIcon = reactExports.useContext(IconRendererContext);
22
22
  if (!element || !element.icon || element.icon === "none") {
23
23
  return null;
24
24
  }
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { createSafeContext, createOptionalContext } from '@mantine/core';
3
3
  import { useStore } from '@nanostores/react';
4
4
  import { atom } from 'nanostores';
5
- import { useRef } from 'react';
5
+ import { r as reactExports } from '../_virtual/index.js';
6
6
 
7
7
  const [ReduceGraphicsModeCtx, useReducedGraphics] = createOptionalContext();
8
8
  function useIsReducedGraphics() {
@@ -16,7 +16,7 @@ const [PanningAtomSafeCtx, usePanningAtom] = createSafeContext(
16
16
  "PanningAtomSafeCtx is not provided"
17
17
  );
18
18
  function ReduceGraphicsContext({ reduceGraphics, children }) {
19
- const $isPanningRef = useRef(null);
19
+ const $isPanningRef = reactExports.useRef(null);
20
20
  if (!$isPanningRef.current) {
21
21
  $isPanningRef.current = atom(reduceGraphics);
22
22
  }
@@ -1,18 +1,18 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { cx } from '@likec4/styles/css';
3
3
  import { Box } from '@likec4/styles/jsx';
4
- import { useRef, useEffect, createContext, createRef, useContext } from 'react';
4
+ import { r as reactExports } from '../_virtual/index.js';
5
5
  import { usePanningAtom } from './ReduceGraphics.js';
6
6
 
7
- const RootContainerContext = createContext(createRef());
7
+ const RootContainerContext = reactExports.createContext(reactExports.createRef());
8
8
  function RootContainer({
9
9
  className,
10
10
  reduceGraphics = false,
11
11
  children
12
12
  }) {
13
- const ref = useRef(null);
13
+ const ref = reactExports.useRef(null);
14
14
  const $isPanning = usePanningAtom();
15
- useEffect(() => {
15
+ reactExports.useEffect(() => {
16
16
  return $isPanning.listen((isPanning) => {
17
17
  if (isPanning) {
18
18
  ref.current?.setAttribute("data-likec4-diagram-panning", "true");
@@ -25,10 +25,6 @@ function RootContainer({
25
25
  Box,
26
26
  {
27
27
  className: cx("likec4-root", className),
28
- css: {
29
- // '--likec4-background-color': 'mantine.colors.body',
30
- // '--colors-likec4-background': 'var(--mantine-color-body)',
31
- },
32
28
  ref,
33
29
  ...reduceGraphics && {
34
30
  ["data-likec4-reduced-graphics"]: true
@@ -38,7 +34,7 @@ function RootContainer({
38
34
  );
39
35
  }
40
36
  function useRootContainer() {
41
- return useContext(RootContainerContext).current;
37
+ return reactExports.useContext(RootContainerContext).current;
42
38
  }
43
39
 
44
40
  export { RootContainer, useRootContainer };
@@ -1,9 +1,9 @@
1
- import { createContext, useContext } from 'react';
1
+ import { r as reactExports } from '../_virtual/index.js';
2
2
 
3
- const DiagramActorSafeContext = createContext(null);
3
+ const DiagramActorSafeContext = reactExports.createContext(null);
4
4
  DiagramActorSafeContext.displayName = "DiagramActorSafeContext";
5
5
  const useDiagramActorRef = () => {
6
- const ctx = useContext(DiagramActorSafeContext);
6
+ const ctx = reactExports.useContext(DiagramActorSafeContext);
7
7
  if (ctx === null) {
8
8
  throw new Error("DiagramActorRef is not provided");
9
9
  }
@@ -2,7 +2,7 @@ import { useSelector } from '@xstate/react';
2
2
  import '@likec4/core';
3
3
  import '@mantine/hooks';
4
4
  import 'fast-equals';
5
- import 'react';
5
+ import '../_virtual/index.js';
6
6
  import { useDiagramActorRef } from './safeContext.js';
7
7
 
8
8
  const selectViewId = (s) => s.context.view.id;
@@ -13,9 +13,9 @@ import { HotKeyEvent } from '../state/hotkeyActor';
13
13
  import { OverlaysContext, OverlayActorEvent, OverlayActorEmitedEvent } from '../overlays/overlaysActor';
14
14
  import { ElementDetailsLogic } from '../overlays/element-details/actor';
15
15
  import { EnabledFeatures } from '../context';
16
- import { ReactFlowState, EdgeMarkerType, HandleType, ReactFlowInstance } from '@xyflow/react';
16
+ import { ReactFlowState, ReactFlowInstance } from '@xyflow/react';
17
+ import { EdgeMarkerType, HandleType, XYPosition, Viewport, NodeChange, EdgeChange } from '@xyflow/system';
17
18
  import { ReactNode, CSSProperties } from 'react';
18
- import { XYPosition, Viewport, NodeChange, EdgeChange } from '@xyflow/system';
19
19
  export { useDiagramActorRef };
20
20
  export declare function useDiagram(): {
21
21
  actor: DiagramActorRef;
@@ -2031,7 +2031,7 @@ export declare function useDiagram(): {
2031
2031
  readonly params: {
2032
2032
  readonly duration: 0;
2033
2033
  };
2034
- }, "startSyncLayout", ActionFunction<DiagramContext, Events, Events, undefined, Values<{
2034
+ }, ActionFunction<DiagramContext, Events, Events, undefined, Values<{
2035
2035
  syncManualLayoutActorLogic: {
2036
2036
  src: "syncManualLayoutActorLogic";
2037
2037
  logic: StateMachine<Readonly< Input>, Events, {}, never, {
@@ -2284,7 +2284,7 @@ export declare function useDiagram(): {
2284
2284
  }>;
2285
2285
  id: "overlays";
2286
2286
  };
2287
- }>, never, never, never, never>];
2287
+ }>, never, never, never, never>, "startSyncLayout"];
2288
2288
  readonly target: "ready";
2289
2289
  }, {
2290
2290
  readonly target: "initializing";
@@ -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
2
  import { ActionIconGroup, Group, Stack, Box, Badge, Loader } from '@mantine/core';
3
3
  import { IconFileSymlink, IconFocusCentered, IconMenu2 } from '@tabler/icons-react';
4
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';
@@ -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,