@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
@@ -2,11 +2,11 @@ import { nonNullable } from '@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 { createContext, useMemo, useContext } from 'react';
5
+ import { r as reactExports } from '../../_virtual/index.js';
6
6
 
7
- const RelationshipsBrowserActorContext = createContext(null);
7
+ const RelationshipsBrowserActorContext = reactExports.createContext(null);
8
8
  function useRelationshipsBrowserActor() {
9
- return nonNullable(useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
9
+ return nonNullable(reactExports.useContext(RelationshipsBrowserActorContext), "No RelationshipsBrowserActorContext");
10
10
  }
11
11
  function useRelationshipsBrowserState(selector, compare = shallowEqual) {
12
12
  const actor = useRelationshipsBrowserActor();
@@ -14,7 +14,7 @@ function useRelationshipsBrowserState(selector, compare = shallowEqual) {
14
14
  }
15
15
  function useRelationshipsBrowser() {
16
16
  const actor = useRelationshipsBrowserActor();
17
- return useMemo(() => ({
17
+ return reactExports.useMemo(() => ({
18
18
  actor,
19
19
  get rootElementId() {
20
20
  return `relationships-browser-${actor.sessionId.replaceAll(":", "_")}`;
@@ -1,4 +1,4 @@
1
- import { useMemo } from 'react';
1
+ import { r as reactExports } from '../../_virtual/index.js';
2
2
  import dagre from '@dagrejs/dagre';
3
3
  import { toArray, invariant, ifind, DefaultMap } from '@likec4/core';
4
4
  import { pipe, concat, map, groupBy, prop, forEachObj, filter, mapToObj, find, only, unique, tap, reduce, sortBy } from 'remeda';
@@ -454,7 +454,7 @@ function layoutRelationshipsView(data, scope) {
454
454
  }
455
455
  function useRelationshipsView(subject, viewId, scope) {
456
456
  const model = useLikeC4Model(true);
457
- return useMemo(() => {
457
+ return reactExports.useMemo(() => {
458
458
  const view = viewId ? model.findView(viewId) : null;
459
459
  const data = layoutRelationshipsView(
460
460
  computeRelationshipsView(subject, model, viewId, scope),
@@ -41,7 +41,6 @@ function viewToNodesEdge(view) {
41
41
  draggable: false,
42
42
  selectable: true,
43
43
  focusable: true,
44
- deletable: false,
45
44
  position,
46
45
  zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
47
46
  style: {
@@ -140,7 +139,7 @@ function viewToNodesEdge(view) {
140
139
  zIndex: ZIndexes.Edge,
141
140
  // selectable: selectable,
142
141
  // hidden: !visiblePredicate(edge),
143
- deletable: false,
142
+ // deletable: false,
144
143
  data: {
145
144
  sourceFqn: edge.sourceFqn,
146
145
  targetFqn: edge.targetFqn,
@@ -3,7 +3,7 @@ import { useDeepCompareEffect } from '@react-hookz/web';
3
3
  import { useActorRef, useSelector } from '@xstate/react';
4
4
  import { useStoreApi } from '@xyflow/react';
5
5
  import { shallowEqual } from 'fast-equals';
6
- import { useEffect } from 'react';
6
+ import { r as reactExports } from '../_virtual/index.js';
7
7
  import { useDiagramEventHandlersRef } from '../context/DiagramEventHandlers.js';
8
8
  import { useEnabledFeatures, DiagramFeatures } from '../context/DiagramFeatures.js';
9
9
  import { DiagramActorSafeContext } from '../hooks/safeContext.js';
@@ -27,7 +27,9 @@ function DiagramActorProvider({
27
27
  diagramMachine.provide({
28
28
  actions: {
29
29
  "trigger:NavigateTo": (_, { viewId }) => {
30
- handlersRef.current.onNavigateTo?.(viewId);
30
+ setTimeout(() => {
31
+ handlersRef.current.onNavigateTo?.(viewId);
32
+ }, 30);
31
33
  },
32
34
  "trigger:OnChange": (_, params) => {
33
35
  handlersRef.current.onChange?.(params);
@@ -61,7 +63,7 @@ function DiagramActorProvider({
61
63
  useUpdateEffect(() => {
62
64
  actorRef.send({ type: "update.inputs", inputs });
63
65
  }, [inputs]);
64
- useEffect(() => {
66
+ reactExports.useEffect(() => {
65
67
  actorRef.send({ type: "update.features", features });
66
68
  }, [features]);
67
69
  const { xyedges, xynodes } = useViewToNodesEdges({
@@ -1,6 +1,6 @@
1
1
  import { BBox, DiagramView, EdgeId, ElementNotation, Fqn, NodeId, StepEdgeId, ViewChange, ViewId, XYPoint, NonEmptyArray, Point, Color, RelationshipLineType, RelationshipArrowType } from '@likec4/core';
2
- import { ReactFlowInstance, useStoreApi, EdgeMarkerType, HandleType } from '@xyflow/react';
3
- import { EdgeChange, NodeChange, Rect, Viewport, XYPosition } from '@xyflow/system';
2
+ import { ReactFlowInstance, useStoreApi } from '@xyflow/react';
3
+ import { EdgeChange, NodeChange, Rect, Viewport, EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
4
4
  import { ActorLogicFrom, ActorRef, AnyEventObject, Snapshot, StateMachine, ActorRefFromLogic, NonReducibleUnknown, EventObject, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, MachineSnapshot, AnyActorRef, StateValue, ActionFunction, CallbackActorLogic, Values, RequiredActorOptions, GetConcreteByKey, CancelAction, StopAction } from 'xstate';
5
5
  import { Base } from '../base/types';
6
6
  import { EnabledFeatures, FeatureName } from '../context/DiagramFeatures';
@@ -2210,7 +2210,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
2210
2210
  readonly params: {
2211
2211
  readonly duration: 0;
2212
2212
  };
2213
- }, "startSyncLayout", ActionFunction<Context, Events, Events, undefined, Values<{
2213
+ }, ActionFunction<Context, Events, Events, undefined, Values<{
2214
2214
  syncManualLayoutActorLogic: {
2215
2215
  src: "syncManualLayoutActorLogic";
2216
2216
  logic: StateMachine<Readonly< Input>, SyncLayoutEvents, {}, never, {
@@ -2463,7 +2463,7 @@ export declare const diagramMachine: StateMachine<Context, Events, {
2463
2463
  }>;
2464
2464
  id: "overlays";
2465
2465
  };
2466
- }>, never, never, never, never>];
2466
+ }>, never, never, never, never>, "startSyncLayout"];
2467
2467
  readonly target: "ready";
2468
2468
  }, {
2469
2469
  readonly target: "initializing";
@@ -332,7 +332,6 @@ const diagramMachine = setup({
332
332
  type: "xyflow:fitDiagram",
333
333
  params: { duration: 0 }
334
334
  },
335
- "startSyncLayout",
336
335
  assign(({ context }) => ({
337
336
  navigationHistory: {
338
337
  currentIndex: 0,
@@ -342,7 +341,8 @@ const diagramMachine = setup({
342
341
  viewport: { ...context.xyflow.getViewport() }
343
342
  }]
344
343
  }
345
- }))
344
+ })),
345
+ "startSyncLayout"
346
346
  ],
347
347
  target: "ready"
348
348
  }, {
@@ -743,13 +743,11 @@ const diagramMachine = setup({
743
743
  }
744
744
  }
745
745
  });
746
- enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 80 });
747
746
  } else {
748
747
  enqueue({
749
748
  type: "xyflow:setViewportCenter",
750
749
  params: getBBoxCenter(event.view.bounds)
751
750
  });
752
- enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
753
751
  }
754
752
  enqueue.assign(updateNavigationHistory);
755
753
  enqueue.assign({
@@ -757,6 +755,7 @@ const diagramMachine = setup({
757
755
  lastOnNavigate: null
758
756
  });
759
757
  enqueue("startSyncLayout");
758
+ enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 25 });
760
759
  }),
761
760
  target: "#idle"
762
761
  }