@likec4/diagram 1.58.0 → 1.59.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 (229) hide show
  1. package/dist/LikeC4Diagram.js +1 -1
  2. package/dist/LikeC4Diagram.props.d.ts +1 -1
  3. package/dist/LikeC4Styles.js +1 -1
  4. package/dist/LikeC4View.js +2 -2
  5. package/dist/ReactLikeC4.d.ts +1 -1
  6. package/dist/base/Base.d.ts +3 -2
  7. package/dist/base/Base.js +14 -26
  8. package/dist/base/BaseXYFlow.d.ts +2 -1
  9. package/dist/base/BaseXYFlow.js +63 -4
  10. package/dist/base/keyboardZoom.d.ts +3 -0
  11. package/dist/base/keyboardZoom.js +20 -0
  12. package/dist/base/updateEdges.js +7 -16
  13. package/dist/base/updateNodes.js +3 -9
  14. package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
  15. package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
  16. package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
  17. package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
  18. package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
  19. package/dist/base-primitives/compound/CompoundTitle.js +2 -1
  20. package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
  21. package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
  22. package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
  23. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  24. package/dist/base-primitives/edge/EdgeContainer.js +4 -2
  25. package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
  26. package/dist/base-primitives/edge/EdgeLabel.js +2 -5
  27. package/dist/base-primitives/element/ElementActionButtons.d.ts +1 -0
  28. package/dist/base-primitives/element/ElementActionButtons.js +4 -1
  29. package/dist/base-primitives/element/ElementData.d.ts +3 -1
  30. package/dist/base-primitives/element/ElementData.js +2 -1
  31. package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
  32. package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
  33. package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
  34. package/dist/base-primitives/element/ElementShape.js +3 -0
  35. package/dist/components/ErrorFallback.js +3 -5
  36. package/dist/components/Link.js +6 -6
  37. package/dist/components/NavigationPanel.js +1 -1
  38. package/dist/components/SearchControl.css.js +11 -11
  39. package/dist/context/TagStylesContext.d.ts +3 -3
  40. package/dist/context/TagStylesContext.js +16 -16
  41. package/dist/custom/index.d.ts +1 -0
  42. package/dist/custom/index.js +3 -2
  43. package/dist/editor/actor/actions.js +1 -1
  44. package/dist/editor/actor/machine.d.ts +4 -6
  45. package/dist/editor/actor/setup.d.ts +16 -2
  46. package/dist/editor/actor/setup.js +5 -4
  47. package/dist/hooks/index.d.ts +1 -1
  48. package/dist/hooks/safeContext.d.ts +156 -3
  49. package/dist/hooks/safeContext.js +60 -12
  50. package/dist/hooks/useCurrentViewModel.js +1 -1
  51. package/dist/hooks/useDiagram.d.ts +8 -0
  52. package/dist/hooks/useDiagram.js +9 -2
  53. package/dist/hooks/useEditorActor.js +1 -1
  54. package/dist/hooks/useLikeC4ElementsTree.js +1 -1
  55. package/dist/hooks/useLikeC4Model.js +1 -1
  56. package/dist/hooks/useXYFlow.d.ts +1 -0
  57. package/dist/hooks/useXYFlow.js +5 -3
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +2 -2
  60. package/dist/likec4diagram/DiagramUI.js +19 -6
  61. package/dist/likec4diagram/DiagramXYFlow.js +39 -14
  62. package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
  63. package/dist/likec4diagram/convert-to-xyflow.js +29 -10
  64. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -4
  65. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
  66. package/dist/likec4diagram/custom/edges/edges.css.js +1 -1
  67. package/dist/likec4diagram/custom/index.d.ts +2 -1
  68. package/dist/likec4diagram/custom/index.js +5 -3
  69. package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
  70. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -2
  71. package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
  72. package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
  73. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
  74. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
  75. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
  76. package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
  77. package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
  78. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
  79. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
  80. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
  81. package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
  82. package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
  83. package/dist/likec4diagram/state/aligners.js +1 -1
  84. package/dist/likec4diagram/state/assign.d.ts +1 -1
  85. package/dist/likec4diagram/state/assign.js +1 -1
  86. package/dist/likec4diagram/state/createViewChange.js +1 -1
  87. package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
  88. package/dist/likec4diagram/state/diagram-api.js +333 -229
  89. package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
  90. package/dist/likec4diagram/state/machine.actions.js +115 -44
  91. package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
  92. package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
  93. package/dist/likec4diagram/state/machine.d.ts +154 -16
  94. package/dist/likec4diagram/state/machine.js +5 -41
  95. package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
  96. package/dist/likec4diagram/state/machine.setup.js +65 -12
  97. package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
  98. package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
  99. package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
  100. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
  101. package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
  102. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
  103. package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
  104. package/dist/likec4diagram/state/machine.state.ready.js +22 -16
  105. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
  106. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
  107. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
  108. package/dist/likec4diagram/state/types.d.ts +4 -2
  109. package/dist/likec4diagram/state/utils.d.ts +7 -0
  110. package/dist/likec4diagram/state/utils.js +36 -34
  111. package/dist/likec4diagram/types.d.ts +47 -3
  112. package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
  113. package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
  114. package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
  115. package/dist/likec4diagram/ui/index.d.ts +2 -0
  116. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
  117. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
  118. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +540 -0
  119. package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
  120. package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
  121. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
  122. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +112 -60
  123. package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
  124. package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
  125. package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
  126. package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
  127. package/dist/likec4diagram/xyflow-sequence/layouter.js +566 -0
  128. package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
  129. package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +111 -14
  130. package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
  131. package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
  132. package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
  133. package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
  134. package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
  135. package/dist/navigationpanel/NavigationPanel.js +58 -59
  136. package/dist/navigationpanel/NavigationPanelDropdown.js +45 -38
  137. package/dist/navigationpanel/_common.js +2 -2
  138. package/dist/navigationpanel/actor.actions.d.ts +19 -0
  139. package/dist/navigationpanel/actor.actions.js +45 -0
  140. package/dist/navigationpanel/actor.d.ts +34 -96
  141. package/dist/navigationpanel/actor.js +21 -84
  142. package/dist/navigationpanel/actor.setup.d.ts +98 -0
  143. package/dist/navigationpanel/actor.setup.js +31 -0
  144. package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
  145. package/dist/navigationpanel/controls/DetailsControls.js +7 -8
  146. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  147. package/dist/navigationpanel/editorpanel/styles.js +8 -8
  148. package/dist/navigationpanel/hooks.d.ts +20 -5
  149. package/dist/navigationpanel/hooks.js +4 -18
  150. package/dist/navigationpanel/styles.css.d.ts +1 -1
  151. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
  152. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +4 -4
  153. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
  154. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
  155. package/dist/overlays/Overlays.d.ts +4 -2
  156. package/dist/overlays/Overlays.js +10 -10
  157. package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
  158. package/dist/overlays/element-details/MetadataValue.js +15 -15
  159. package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
  160. package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
  161. package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
  162. package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
  163. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  164. package/dist/overlays/element-details/actor.d.ts +2 -3
  165. package/dist/overlays/hooks.d.ts +28 -0
  166. package/dist/overlays/hooks.js +5 -0
  167. package/dist/overlays/overlay/Overlay.js +34 -25
  168. package/dist/overlays/overlaysActor.js +0 -1
  169. package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
  170. package/dist/overlays/relationship-details/layout.js +1 -1
  171. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
  172. package/dist/overlays/relationships-browser/actor.js +79 -78
  173. package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
  174. package/dist/overlays/relationships-browser/hooks.js +1 -1
  175. package/dist/overlays/relationships-browser/layout.js +2 -2
  176. package/dist/projects-overview/actor.js +4 -4
  177. package/dist/search/Search.js +1 -1
  178. package/dist/search/components/ElementsColumn.css.js +2 -2
  179. package/dist/search/components/ViewsColum.js +1 -1
  180. package/dist/search/components/_shared.css.d.ts +1 -1
  181. package/dist/search/components/_shared.css.js +23 -23
  182. package/dist/search/components/styles.css.js +4 -4
  183. package/dist/shadowroot/ShadowRoot.d.ts +1 -1
  184. package/dist/shadowroot/ShadowRoot.js +76 -28
  185. package/dist/styles2.js +1 -1
  186. package/dist/utils/defineActors.d.ts +21 -0
  187. package/dist/utils/defineActors.js +13 -0
  188. package/dist/utils/index.d.ts +1 -0
  189. package/dist/utils/index.js +5 -4
  190. package/dist/utils/readableText.d.ts +11 -0
  191. package/dist/utils/readableText.js +18 -0
  192. package/package.json +18 -30
  193. package/panda.buildinfo.json +270 -288
  194. package/styles-min.css +1 -1
  195. package/styles.css +1 -1
  196. package/adhoc-editor/package.json +0 -4
  197. package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
  198. package/dist/adhoc-editor/EditorPanel.js +0 -106
  199. package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
  200. package/dist/adhoc-editor/ElementsTree.js +0 -112
  201. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
  202. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
  203. package/dist/adhoc-editor/components/Tree.d.ts +0 -48
  204. package/dist/adhoc-editor/components/Tree.js +0 -213
  205. package/dist/adhoc-editor/hooks.d.ts +0 -14
  206. package/dist/adhoc-editor/hooks.js +0 -34
  207. package/dist/adhoc-editor/index.d.ts +0 -2
  208. package/dist/adhoc-editor/index.js +0 -2
  209. package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
  210. package/dist/adhoc-editor/state/ActorProvider.js +0 -37
  211. package/dist/adhoc-editor/state/actor.d.ts +0 -13
  212. package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
  213. package/dist/adhoc-editor/state/actor.editor.js +0 -167
  214. package/dist/adhoc-editor/state/actor.js +0 -14
  215. package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
  216. package/dist/adhoc-editor/state/actor.layouter.js +0 -54
  217. package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
  218. package/dist/adhoc-editor/state/actor.types.js +0 -25
  219. package/dist/adhoc-editor/state/panel.d.ts +0 -95
  220. package/dist/adhoc-editor/state/panel.js +0 -124
  221. package/dist/adhoc-editor/state/utils.d.ts +0 -17
  222. package/dist/adhoc-editor/state/utils.js +0 -25
  223. package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
  224. package/dist/adhoc-editor/useElementsTree.js +0 -98
  225. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
  226. package/dist/context/ShadowRootContext.d.ts +0 -3
  227. package/dist/context/ShadowRootContext.js +0 -5
  228. package/dist/shadowroot/styles.d.ts +0 -13
  229. package/dist/shadowroot/styles.js +0 -60
@@ -13,14 +13,14 @@ var fqn = css({
13
13
  });
14
14
  var relationshipStat = css({
15
15
  _light: {
16
- background: "mantine.colors.gray[1]",
16
+ background: "mantine.gray[1]",
17
17
  "&[data-missing": {}
18
18
  },
19
19
  [`&[data-missing]`]: {
20
- color: "mantine.colors.orange[4]",
21
- background: `mantine.colors.orange[8]/15`,
22
- borderColor: `mantine.colors.orange[5]/20`,
23
- _light: { color: "mantine.colors.orange[8]" }
20
+ color: "mantine.orange[4]",
21
+ background: `mantine.orange[8]/15`,
22
+ borderColor: `mantine.orange[5]/20`,
23
+ _light: { color: "mantine.orange[8]" }
24
24
  }
25
25
  });
26
26
  var xyflow = css({
@@ -32,8 +32,8 @@ var xyflow = css({
32
32
  border: "default",
33
33
  borderRadius: "sm",
34
34
  _light: {
35
- borderColor: "mantine.colors.gray[3]",
36
- background: "mantine.colors.gray[1]"
35
+ borderColor: "mantine.gray[3]",
36
+ background: "mantine.gray[1]"
37
37
  }
38
38
  });
39
39
  css({
@@ -49,7 +49,7 @@ css({
49
49
  opacity: .85,
50
50
  transform: "translateY(-100%) translateY(-2px)"
51
51
  },
52
- _light: { "& .mantine-SegmentedControl-root": { background: "mantine.colors.gray[3]" } }
52
+ _light: { "& .mantine-SegmentedControl-root": { background: "mantine.gray[3]" } }
53
53
  });
54
54
  css({
55
55
  display: "inline-block",
@@ -59,12 +59,12 @@ css({
59
59
  minWidth: "24px",
60
60
  textAlign: "center",
61
61
  borderRadius: "sm",
62
- background: "mantine.colors.dark[7]",
62
+ background: "mantine.dark[7]",
63
63
  color: "default.color",
64
64
  [`&[data-zero]`]: { color: "text.dimmed" },
65
65
  [`&[data-missing]`]: {
66
- color: "mantine.colors.orange[4]",
67
- background: `mantine.colors.orange[8]/20`
66
+ color: "mantine.orange[4]",
67
+ background: `mantine.orange[8]/20`
68
68
  }
69
69
  });
70
70
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { useDiagram } from "../../hooks/safeContext.js";
3
+ import { fqn, relationshipStat, xyflow } from "./TabPanelRelationships.css.js";
3
4
  import { useElementDetailsActorRef } from "./actorContext.js";
4
5
  import { RelationshipsBrowser } from "../relationships-browser/RelationshipsBrowser.js";
5
- import { fqn, relationshipStat, xyflow } from "./TabPanelRelationships.css.js";
6
6
  import { IconArrowRight, IconExternalLink, IconInfoCircle } from "@tabler/icons-react";
7
7
  import { useCallback } from "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -14,8 +14,8 @@ var elementLabel = css({
14
14
  py: "xs",
15
15
  alignItems: "center",
16
16
  cursor: "pointer",
17
- color: "mantine.colors.gray[7]",
18
- _dark: { color: "mantine.colors.dark[1]" },
17
+ color: "mantine.gray[7]",
18
+ _dark: { color: "mantine.dark[1]" },
19
19
  "& > *": { transition: "fast" },
20
20
  _hover: {
21
21
  transitionTimingFunction: "out",
@@ -91,4 +91,4 @@ function TabPanelStructure({ element }) {
91
91
  })] });
92
92
  }
93
93
  //#endregion
94
- export { TabPanelStructure };
94
+ export { ElementLabel, TabPanelStructure };
@@ -2,7 +2,7 @@ import { DiagramView, Fqn, NodeId } from '@likec4/core/types';
2
2
  import { Rect } from '@xyflow/system';
3
3
  import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
4
4
  import { RelationshipsBrowserActorRef } from '../relationships-browser/actor';
5
- export type Input = {
5
+ export type ElementDetailsInput = {
6
6
  subject: Fqn;
7
7
  currentView: DiagramView;
8
8
  initiatedFrom?: {
@@ -26,10 +26,9 @@ export type Events = {
26
26
  };
27
27
  export interface ElementDetailsLogic extends StateMachine<Context, Events, {
28
28
  [key: `${string}-relationships`]: RelationshipsBrowserActorRef | undefined;
29
- }, any, any, any, any, any, never, Input, any, any, any, any> {
29
+ }, any, any, any, any, any, never, ElementDetailsInput, any, any, any, any> {
30
30
  }
31
31
  export declare const elementDetailsLogic: ElementDetailsLogic;
32
32
  export type ElementDetailsSnapshot = SnapshotFrom<ElementDetailsLogic>;
33
33
  export interface ElementDetailsActorRef extends ActorRef<ElementDetailsSnapshot, Events> {
34
34
  }
35
- export type { Input as ElementDetailsInput, };
@@ -0,0 +1,28 @@
1
+ import { OverlaysActorRef, OverlaysContext, OverlayActorEvent } from './overlaysActor';
2
+ import { Provider } from 'react';
3
+ import { MachineSnapshot } from 'xstate';
4
+ export declare const OverlaysActorContext: Provider<OverlaysActorRef>, selectOverlaysSnapshot: <T>(select: (state: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
5
+ [key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
6
+ [key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
7
+ [key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
8
+ }, any, never, any, any, any>) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => [selector: (snapshot: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
9
+ [key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
10
+ [key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
11
+ [key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
12
+ }, any, never, any, any, any>) => T, compare: (a: T, b: T) => boolean], useSelectOverlaysActor: {
13
+ <T>(select: (state: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
14
+ [key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
15
+ [key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
16
+ [key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
17
+ }, any, never, any, any, any>) => T): T;
18
+ <T>(selectorCompare: [selector: (snapshot: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
19
+ [key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
20
+ [key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
21
+ [key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
22
+ }, any, never, any, any, any>) => T, compare: (a: T, b: T) => boolean]): T;
23
+ <T>(selector: (snapshot: MachineSnapshot<OverlaysContext, OverlayActorEvent, {
24
+ [key: `elementDetails-${number}`]: import("./types").Overlays.ElementDetails.ActorRef | undefined;
25
+ [key: `relationshipDetails-${number}`]: import("./types").Overlays.RelationshipDetails.ActorRef | undefined;
26
+ [key: `relationshipsBrowser-${number}`]: import("./types").Overlays.RelationshipsBrowser.ActorRef | undefined;
27
+ }, any, never, any, any, any>) => T, compare: (a: T, b: T) => boolean): T;
28
+ };
@@ -0,0 +1,5 @@
1
+ import { createSafeContextForActor } from "../hooks/safeContext.js";
2
+ //#region src/overlays/hooks.ts
3
+ var { ContextProvider: OverlaysActorContext, selectSnapshot: selectOverlaysSnapshot, useActorSelector: useSelectOverlaysActor } = createSafeContextForActor("Overlays");
4
+ //#endregion
5
+ export { OverlaysActorContext, selectOverlaysSnapshot, useSelectOverlaysActor };
@@ -12,35 +12,37 @@ import { overlay } from "@likec4/styles/recipes";
12
12
  var backdropBlur = "--_blur";
13
13
  var backdropOpacity = "--_opacity";
14
14
  var cssVarLevel = "--_level";
15
- var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, children, fullscreen = false, withBackdrop = true, backdrop, openDelay = 130, ...rest }, ref) => {
15
+ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, children, fullscreen = false, withBackdrop = true, backdrop, openDelay = 120, ...rest }, ref) => {
16
16
  const [opened, setOpened] = useState(false);
17
17
  const focusTrapRef = useFocusTrap(opened);
18
18
  const dialogRef = useRef(null);
19
- const onCloseRef = useRef(null);
19
+ const onCloseCalledRef = useRef(false);
20
20
  const motionNotReduced = useReducedMotionConfig() !== true;
21
21
  /**
22
- * Close the overlay and call the onClose callback
22
+ * This function is called when the overlay is closed by outside click or escape key.
23
+ * It ensures that the onClose callback is only called once.
23
24
  */
24
- const cancelMe = () => {
25
- onCloseRef.current = onClose;
26
- dialogRef.current?.close();
25
+ const closeMe = () => {
26
+ if (!onCloseCalledRef.current) {
27
+ onCloseCalledRef.current = true;
28
+ onClose();
29
+ }
27
30
  };
28
31
  const isPresent = useIsPresent();
29
32
  useEffect(() => {
30
33
  if (isPresent) return;
31
- if (dialogRef.current?.open) {
32
- onCloseRef.current = null;
33
- dialogRef.current.close();
34
- }
34
+ const dialog = dialogRef.current;
35
+ return () => {
36
+ onCloseCalledRef.current = true;
37
+ if (dialog?.open) dialog.close();
38
+ };
35
39
  }, [isPresent]);
36
40
  useLayoutEffect(() => {
37
41
  const dialog = dialogRef.current;
38
42
  if (dialog && !dialog.open) dialog.showModal();
39
43
  if (openDelay === 0) setOpened(true);
40
44
  }, []);
41
- useTimeoutEffect(() => {
42
- setOpened(true);
43
- }, openDelay > 0 ? openDelay : void 0);
45
+ useTimeoutEffect(() => setOpened(true), openDelay > 0 ? openDelay : void 0);
44
46
  const overlayRecipe = overlay({
45
47
  fullscreen,
46
48
  withBackdrop
@@ -49,22 +51,31 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
49
51
  if (backdrop?.opacity !== void 0) targetBackdropOpacity = `${backdrop.opacity * 100}%`;
50
52
  const motionProps = useMemo(() => ({
51
53
  initial: {
52
- [backdropBlur]: "1px",
53
- [backdropOpacity]: "10%",
54
- scale: .95,
54
+ [backdropBlur]: "2px",
55
+ [backdropOpacity]: "20%",
56
+ scaleX: .95,
57
+ scaleY: .85,
58
+ originY: 0,
59
+ translateY: -8,
55
60
  opacity: 0
56
61
  },
57
62
  animate: {
58
63
  [backdropBlur]: overlayLevel > 0 ? "4px" : "8px",
59
64
  [backdropOpacity]: targetBackdropOpacity,
60
- scale: 1,
65
+ scaleX: 1,
66
+ scaleY: 1,
67
+ originY: 0,
68
+ translateY: 0,
61
69
  opacity: 1
62
70
  },
63
71
  exit: {
72
+ scaleX: .9,
73
+ scaleY: .8,
74
+ originY: 0,
75
+ translateY: -10,
64
76
  opacity: 0,
65
- scale: .97,
66
- [backdropBlur]: "0px",
67
- [backdropOpacity]: "0%"
77
+ [backdropBlur]: "2px",
78
+ [backdropOpacity]: "20%"
68
79
  }
69
80
  }), [overlayLevel, targetBackdropOpacity]);
70
81
  return /* @__PURE__ */ jsx(m.dialog, {
@@ -81,16 +92,14 @@ var Overlay = forwardRef(({ onClose, className, classes, overlayLevel = 0, child
81
92
  ...rest,
82
93
  onClick: (e) => {
83
94
  e.stopPropagation();
84
- if (e.target === e.currentTarget) cancelMe();
95
+ if (e.target === e.currentTarget) closeMe();
85
96
  },
86
97
  onCancel: (e) => {
87
98
  e.preventDefault();
88
99
  e.stopPropagation();
89
- cancelMe();
90
- },
91
- onClose: () => {
92
- onCloseRef.current?.();
100
+ closeMe();
93
101
  },
102
+ onClose: closeMe,
94
103
  children: /* @__PURE__ */ jsx(RemoveScroll, {
95
104
  forwardProps: true,
96
105
  children: /* @__PURE__ */ jsx("div", {
@@ -5,7 +5,6 @@ import { relationshipDetailsLogic } from "./relationship-details/actor.js";
5
5
  import { isString, last, reverse } from "remeda";
6
6
  import { getHotkeyHandler } from "@mantine/hooks";
7
7
  import { assertEvent, fromCallback, setup } from "xstate";
8
- import "xstate/guards";
9
8
  //#region src/overlays/overlaysActor.ts
10
9
  var machine = setup({
11
10
  types: {
@@ -96,4 +96,4 @@ function CompoundPorts({ data }) {
96
96
  }, id))] });
97
97
  }
98
98
  //#endregion
99
- export { CompoundNode, ElementNode };
99
+ export { CompoundNode, CompoundPorts, ElementNode, ElementPorts };
@@ -1,9 +1,9 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { filter, find, map, mapToObj, omit, pipe, prop, reduce, sortBy, tap } from "remeda";
3
3
  import { DefaultMap, ifind, invariant } from "@likec4/core/utils";
4
+ import { exact, preferSummary } from "@likec4/core/types";
4
5
  import { treeFromElements } from "@likec4/core/compute-view";
5
6
  import dagre from "@dagrejs/dagre";
6
- import { exact, preferSummary } from "@likec4/core/types";
7
7
  //#region src/overlays/relationship-details/layout.ts
8
8
  /**
9
9
  * All constants related to the layout
@@ -8,7 +8,7 @@ var SelectElement_css_exports = /* @__PURE__ */ __exportAll({
8
8
  });
9
9
  var node = css({ margin: "0" });
10
10
  var label = css({ _hover: {
11
- backgroundColor: "mantine.colors.gray[0]",
11
+ backgroundColor: "mantine.gray[0]",
12
12
  _dark: {
13
13
  backgroundColor: "default.hover",
14
14
  color: "white"
@@ -16,4 +16,4 @@ var label = css({ _hover: {
16
16
  } });
17
17
  var scrollArea = css({ maxHeight: ["70vh", "calc(100cqh - 70px)"] });
18
18
  //#endregion
19
- export { SelectElement_css_exports, scrollArea };
19
+ export { SelectElement_css_exports, label, node, scrollArea };
@@ -17,6 +17,83 @@ import { assertEvent, assign, cancel, enqueueActions, fromPromise, raise, setup
17
17
  * Root node in 'subjects' column
18
18
  */
19
19
  var findRootSubject = (nodes) => nodes.find((n) => n.data.column === "subjects" && isNullish(n.parentId));
20
+ var layouter = fromPromise(async ({ input, self, signal }) => {
21
+ const { subjectId, navigateFromNode, xyflow, xystore, update } = input;
22
+ let { nodes: currentNodes, width, height } = xystore.getState();
23
+ const next = viewToNodesEdge(update);
24
+ const updateXYData = () => {
25
+ const { nodes, edges } = xystore.getState();
26
+ return {
27
+ xynodes: updateNodes(nodes, next.xynodes),
28
+ xyedges: updateEdges(edges, next.xyedges)
29
+ };
30
+ };
31
+ const parent = nonNullable(self._parent);
32
+ let zoom = xyflow.getZoom();
33
+ const maxZoom = Math.max(zoom, 1);
34
+ const nextviewport = getViewportForBounds$1(update.bounds, width, height, MinZoom, maxZoom, ViewPadding);
35
+ const nextSubjectNode = next.xynodes.find((n) => n.type !== "empty" && n.data.column === "subjects" && n.data.fqn === subjectId) ?? findRootSubject(next.xynodes);
36
+ const currentSubjectNode = findRootSubject(currentNodes);
37
+ const existingNode = navigateFromNode ? currentNodes.find((n) => n.id === navigateFromNode) : currentNodes.find((n) => n.type !== "empty" && n.data.column !== "subjects" && n.data.fqn === subjectId);
38
+ if (!nextSubjectNode || !existingNode || nextSubjectNode.type === "empty" || !currentSubjectNode || nextSubjectNode.data.fqn === currentSubjectNode.data.fqn) {
39
+ await xyflow.setViewport(nextviewport);
40
+ return updateXYData();
41
+ }
42
+ const nextSubjectCenter = {
43
+ x: nextSubjectNode.position.x + (nextSubjectNode.initialWidth ?? 0) / 2,
44
+ y: nextSubjectNode.position.y + (nextSubjectNode.initialHeight ?? 0) / 2
45
+ };
46
+ const currentSubjectCenter = getNodeCenter(xyflow.getInternalNode(currentSubjectNode.id));
47
+ const nested = /* @__PURE__ */ new Set();
48
+ currentNodes.forEach((n) => {
49
+ if (n.id === existingNode.id) return;
50
+ if (n.data.column === "subjects") {
51
+ nested.add(n.id);
52
+ return;
53
+ }
54
+ if (n.parentId && (n.parentId === existingNode.id || nested.has(n.parentId))) nested.add(n.id);
55
+ });
56
+ currentNodes = updateNodes(currentNodes, currentNodes.flatMap((n) => {
57
+ if (nested.has(n.id)) return [];
58
+ if (n.id !== existingNode.id) return {
59
+ ...n,
60
+ data: {
61
+ ...n.data,
62
+ dimmed: n.data.column === "subjects" ? "immediate" : true
63
+ }
64
+ };
65
+ return {
66
+ ...omit(n, ["parentId"]),
67
+ position: {
68
+ x: currentSubjectCenter.x - n.initialWidth / 2,
69
+ y: currentSubjectCenter.y - n.initialHeight / 2
70
+ },
71
+ zIndex: ZIndexes.Max,
72
+ hidden: false,
73
+ data: {
74
+ ...n.data,
75
+ dimmed: false
76
+ }
77
+ };
78
+ }));
79
+ parent.send({
80
+ type: "update.xydata",
81
+ xynodes: currentNodes,
82
+ xyedges: []
83
+ });
84
+ await delay(120);
85
+ next.xynodes = next.xynodes.map(Base.setDimmed(false));
86
+ if (signal.aborted) return updateXYData();
87
+ const duration = 300;
88
+ xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, {
89
+ zoom,
90
+ duration,
91
+ interpolate: "smooth"
92
+ });
93
+ await delay(duration);
94
+ await xyflow.setCenter(nextSubjectCenter.x, nextSubjectCenter.y, { zoom });
95
+ return updateXYData();
96
+ });
20
97
  var machine = setup({
21
98
  types: {
22
99
  context: {},
@@ -25,83 +102,7 @@ var machine = setup({
25
102
  input: {},
26
103
  events: {}
27
104
  },
28
- actors: { layouter: fromPromise(async ({ input, self, signal }) => {
29
- const { subjectId, navigateFromNode, xyflow, xystore, update } = input;
30
- let { nodes: currentNodes, width, height } = xystore.getState();
31
- const next = viewToNodesEdge(update);
32
- const updateXYData = () => {
33
- const { nodes, edges } = xystore.getState();
34
- return {
35
- xynodes: updateNodes(nodes, next.xynodes),
36
- xyedges: updateEdges(edges, next.xyedges)
37
- };
38
- };
39
- const parent = nonNullable(self._parent);
40
- let zoom = xyflow.getZoom();
41
- const maxZoom = Math.max(zoom, 1);
42
- const nextviewport = getViewportForBounds$1(update.bounds, width, height, MinZoom, maxZoom, ViewPadding);
43
- const nextSubjectNode = next.xynodes.find((n) => n.type !== "empty" && n.data.column === "subjects" && n.data.fqn === subjectId) ?? findRootSubject(next.xynodes);
44
- const currentSubjectNode = findRootSubject(currentNodes);
45
- const existingNode = navigateFromNode ? currentNodes.find((n) => n.id === navigateFromNode) : currentNodes.find((n) => n.type !== "empty" && n.data.column !== "subjects" && n.data.fqn === subjectId);
46
- if (!nextSubjectNode || !existingNode || nextSubjectNode.type === "empty" || !currentSubjectNode || nextSubjectNode.data.fqn === currentSubjectNode.data.fqn) {
47
- await xyflow.setViewport(nextviewport);
48
- return updateXYData();
49
- }
50
- const nextSubjectCenter = {
51
- x: nextSubjectNode.position.x + (nextSubjectNode.initialWidth ?? 0) / 2,
52
- y: nextSubjectNode.position.y + (nextSubjectNode.initialHeight ?? 0) / 2
53
- };
54
- const currentSubjectCenter = getNodeCenter(xyflow.getInternalNode(currentSubjectNode.id));
55
- const nested = /* @__PURE__ */ new Set();
56
- currentNodes.forEach((n) => {
57
- if (n.id === existingNode.id) return;
58
- if (n.data.column === "subjects") {
59
- nested.add(n.id);
60
- return;
61
- }
62
- if (n.parentId && (n.parentId === existingNode.id || nested.has(n.parentId))) nested.add(n.id);
63
- });
64
- currentNodes = updateNodes(currentNodes, currentNodes.flatMap((n) => {
65
- if (nested.has(n.id)) return [];
66
- if (n.id !== existingNode.id) return {
67
- ...n,
68
- data: {
69
- ...n.data,
70
- dimmed: n.data.column === "subjects" ? "immediate" : true
71
- }
72
- };
73
- return {
74
- ...omit(n, ["parentId"]),
75
- position: {
76
- x: currentSubjectCenter.x - n.initialWidth / 2,
77
- y: currentSubjectCenter.y - n.initialHeight / 2
78
- },
79
- zIndex: ZIndexes.Max,
80
- hidden: false,
81
- data: {
82
- ...n.data,
83
- dimmed: false
84
- }
85
- };
86
- }));
87
- parent.send({
88
- type: "update.xydata",
89
- xynodes: currentNodes,
90
- xyedges: []
91
- });
92
- await delay(120);
93
- next.xynodes = next.xynodes.map(Base.setDimmed(false));
94
- if (signal.aborted) return updateXYData();
95
- const duration = 300;
96
- xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, {
97
- zoom,
98
- duration,
99
- interpolate: "smooth"
100
- });
101
- await delay(duration);
102
- await xyflow.setCenter(nextSubjectCenter.x, nextSubjectCenter.y, { zoom });
103
- return updateXYData();
104
- }) },
105
+ actors: { layouter },
105
106
  guards: {
106
107
  hasViewId: ({ context }) => context.viewId !== null,
107
108
  isReady: ({ context }) => context.xyflow !== null && context.xystore !== null && context.layouted !== null,
@@ -371,4 +372,4 @@ var relationshipsBrowserLogic = machine.createMachine({
371
372
  exit: dispose()
372
373
  });
373
374
  //#endregion
374
- export { relationshipsBrowserLogic };
375
+ export { layouter, relationshipsBrowserLogic };
@@ -103,4 +103,4 @@ var CompoundPorts = ({ data }) => /* @__PURE__ */ jsxs(Fragment, { children: [da
103
103
  }
104
104
  }, id))] });
105
105
  //#endregion
106
- export { CompoundNode, ElementNode };
106
+ export { CompoundNode, CompoundPorts, ElementNode, ElementPorts };
@@ -52,4 +52,4 @@ function useRelationshipsBrowser() {
52
52
  }), [actor]);
53
53
  }
54
54
  //#endregion
55
- export { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserState };
55
+ export { RelationshipsBrowserActorContext, useRelationshipsBrowser, useRelationshipsBrowserActor, useRelationshipsBrowserState };
@@ -3,9 +3,9 @@ import { useLikeC4Model } from "../../hooks/useLikeC4Model.js";
3
3
  import { useMemo } from "react";
4
4
  import { concat, filter, find, forEachObj, groupBy, map, mapToObj, omit, only, pipe, prop, reduce, sortBy, tap, unique } from "remeda";
5
5
  import { DefaultMap, ifind, invariant, nonNullable, toArray } from "@likec4/core/utils";
6
+ import { exact, preferSummary } from "@likec4/core/types";
6
7
  import { computeRelationshipsView, treeFromElements } from "@likec4/core/compute-view";
7
8
  import dagre from "@dagrejs/dagre";
8
- import { exact, preferSummary } from "@likec4/core/types";
9
9
  //#region src/overlays/relationships-browser/layout.ts
10
10
  /**
11
11
  * All constants related to the layout
@@ -423,4 +423,4 @@ function useRelationshipsView(subject, viewId, scope) {
423
423
  ]);
424
424
  }
425
425
  //#endregion
426
- export { LayoutRelationshipsViewResult, useRelationshipsView };
426
+ export { LayoutRelationshipsViewResult, layoutRelationshipsView, useRelationshipsView };
@@ -6,9 +6,9 @@ import { ProjectsOverviewViewportPersistence } from "./persistence.js";
6
6
  import { applyEdgeChanges, applyNodeChanges, getViewportForBounds } from "@xyflow/react";
7
7
  import { clamp } from "remeda";
8
8
  import { invariant, nonNullable, nonexhaustive } from "@likec4/core";
9
- import { assertEvent, setup } from "xstate";
10
9
  import { animate, mapValue, motionValue, stagger, styleEffect } from "motion";
11
- import { assign as assign$1, emit as emit$1 } from "xstate/actions";
10
+ import { assertEvent, setup } from "xstate";
11
+ import { assign as assign$1, emit } from "xstate/actions";
12
12
  //#region src/projects-overview/actor.ts
13
13
  var machine = setup({
14
14
  types: {
@@ -247,7 +247,7 @@ var projectOverviewLogic = machine.createMachine({
247
247
  });
248
248
  }
249
249
  ],
250
- on: { "emit.navigate.to": { actions: emit$1(({ event }) => ({
250
+ on: { "emit.navigate.to": { actions: emit(({ event }) => ({
251
251
  ...event,
252
252
  type: "navigate.to"
253
253
  })) } }
@@ -263,4 +263,4 @@ function sleep(ms) {
263
263
  return new Promise((resolve) => setTimeout(resolve, ms));
264
264
  }
265
265
  //#endregion
266
- export { projectOverviewLogic };
266
+ export { fitDiagram, onMouseEnterOrLeave, projectOverviewLogic, restoreViewport };
@@ -194,4 +194,4 @@ var SearchPanelContent = forwardRef((_, ref) => {
194
194
  });
195
195
  SearchPanelContent.displayName = "SearchPanelContent";
196
196
  //#endregion
197
- export { Search, SearchPanelContent, bodyCss, dialogCss };
197
+ export { Search, SearchPanelContent, bodyCss, dialogCss, scrollAreaCss };
@@ -32,8 +32,8 @@ var elementId = css({
32
32
  whiteSpace: "nowrap",
33
33
  padding: "[1px 5px]",
34
34
  borderRadius: "sm",
35
- background: `mantine.colors.dark[9]/30`,
36
- _light: { background: `mantine.colors.gray[3]/20` }
35
+ background: `mantine.dark[9]/30`,
36
+ _light: { background: `mantine.gray[3]/20` }
37
37
  });
38
38
  var elementIcon = css({
39
39
  ["--likec4-icon-size"]: "24px",
@@ -12,8 +12,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { first } from "remeda";
13
13
  import { Badge, Group, Highlight, Stack, ThemeIcon, UnstyledButton, VisuallyHidden, createScopedKeydownHandler } from "@mantine/core";
14
14
  import { Box as Box$1 } from "@likec4/styles/jsx";
15
- import * as m from "motion/react-m";
16
15
  import { preferSummary } from "@likec4/core/types";
16
+ import * as m from "motion/react-m";
17
17
  //#region src/search/components/ViewsColum.tsx
18
18
  var NothingFound = () => /* @__PURE__ */ jsx(Box$1, {
19
19
  className: emptyBoX,
@@ -1,4 +1,4 @@
1
- import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '../../../styled-system';
1
+ import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '../../../styled-system/types';
2
2
  export declare const focusable = "likec4-focusable";
3
3
  export declare const emptyBoX: string;
4
4
  export declare const buttonsva: SlotRecipeRuntimeFn<"title" | "description" | "icon" | "root" | "descriptionColor", SlotRecipeVariantRecord<"title" | "description" | "icon" | "root" | "descriptionColor">>;