@likec4/diagram 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/bundle/{chunk-C0Eg81Gj.js → chunk-7MPUJFHj.js} +315 -311
  2. package/bundle/custom.js +52 -52
  3. package/bundle/index.js +1583 -739
  4. package/dist/LikeC4Diagram.js +6 -6
  5. package/dist/LikeC4Diagram.props.d.ts +2 -3
  6. package/dist/LikeC4ModelProvider.d.ts +3 -3
  7. package/dist/LikeC4ProjectsProvider.d.ts +17 -0
  8. package/dist/LikeC4ProjectsProvider.js +22 -0
  9. package/dist/LikeC4Styles.d.ts +1 -0
  10. package/dist/LikeC4Styles.js +94 -0
  11. package/dist/StaticLikeC4Diagram.d.ts +3 -3
  12. package/dist/base/BaseXYFlow.js +23 -26
  13. package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
  14. package/dist/base/primitives/MarkdownBlock.js +1 -1
  15. package/dist/base/primitives/compound/CompoundActionButton.js +2 -2
  16. package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -2
  17. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
  18. package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
  19. package/dist/base/primitives/compound/CompoundTitle.js +9 -8
  20. package/dist/base/primitives/compound/actionbtns.css.js +6 -6
  21. package/dist/base/primitives/edge/EdgeActionButton.js +2 -2
  22. package/dist/base/primitives/edge/EdgeContainer.js +4 -7
  23. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
  24. package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
  25. package/dist/base/primitives/edge/EdgeLabel.js +16 -6
  26. package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
  27. package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
  28. package/dist/base/primitives/edge/edge.css.d.ts +0 -2
  29. package/dist/base/primitives/edge/edge.css.js +1 -55
  30. package/dist/base/primitives/element/ElementActionButtons.js +2 -2
  31. package/dist/base/primitives/element/ElementDetailsButton.js +8 -7
  32. package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
  33. package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
  34. package/dist/base/primitives/element/ElementShape.css.js +11 -11
  35. package/dist/base/primitives/element/ElementTags.d.ts +1 -0
  36. package/dist/base/primitives/element/ElementTags.js +17 -14
  37. package/dist/bundle/LikeC4View.d.ts +1 -1
  38. package/dist/bundle/LikeC4View.js +7 -1
  39. package/dist/bundle/LikeC4View.props.d.ts +1 -2
  40. package/dist/bundle/ReactLikeC4.d.ts +1 -1
  41. package/dist/bundle/ViewNotFound.js +1 -1
  42. package/dist/bundle/index.d.ts +2 -1
  43. package/dist/bundle/index.js +1 -0
  44. package/dist/bundle/styles.css.js +1 -1
  45. package/dist/components/ErrorFallback.js +1 -1
  46. package/dist/components/GithubIcon.d.ts +2 -0
  47. package/dist/components/GithubIcon.js +17 -0
  48. package/dist/components/Link.d.ts +4 -3
  49. package/dist/components/Link.js +84 -87
  50. package/dist/components/NavigationLink.d.ts +2 -2
  51. package/dist/components/SearchControl.css.js +6 -5
  52. package/dist/context/DiagramEventHandlers.d.ts +6 -6
  53. package/dist/context/DiagramEventHandlers.js +4 -7
  54. package/dist/globals.css.js +3 -0
  55. package/dist/hooks/useXYFlow.d.ts +10 -10
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
  59. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  60. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
  61. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
  62. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -3
  63. package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
  64. package/dist/likec4diagram/custom/index.d.ts +2 -2
  65. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
  66. package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
  67. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
  68. package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -5
  69. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
  70. package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
  71. package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
  72. package/dist/likec4model/index.d.ts +1 -0
  73. package/dist/likec4model/useLikeC4Project.d.ts +22 -0
  74. package/dist/likec4model/useLikeC4Project.js +23 -0
  75. package/dist/navigationpanel/NavigationPanel.js +15 -17
  76. package/dist/navigationpanel/NavigationPanelControls.js +34 -21
  77. package/dist/navigationpanel/NavigationPanelDropdown.js +33 -17
  78. package/dist/navigationpanel/_common.js +4 -1
  79. package/dist/navigationpanel/actor.d.ts +11 -15
  80. package/dist/navigationpanel/actor.js +14 -15
  81. package/dist/navigationpanel/controls/BurgerButton.js +5 -7
  82. package/dist/navigationpanel/controls/NavigationButtons.js +37 -24
  83. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  84. package/dist/navigationpanel/controls/SearchControl.js +6 -4
  85. package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
  86. package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
  87. package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
  88. package/dist/navigationpanel/controls/index.d.ts +1 -0
  89. package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
  90. package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
  91. package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
  92. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -20
  93. package/dist/navigationpanel/editorpanel/styles.js +5 -5
  94. package/dist/navigationpanel/hooks.d.ts +2 -2
  95. package/dist/navigationpanel/styles.css.js +0 -2
  96. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +12 -7
  97. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +14 -0
  98. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +14 -0
  99. package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
  100. package/dist/overlays/element-details/ElementDetailsCard.js +8 -13
  101. package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
  102. package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
  103. package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
  104. package/dist/overlays/overlay/Overlay.css.js +8 -7
  105. package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
  106. package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
  107. package/dist/search/Search.js +6 -6
  108. package/dist/search/components/ElementsColumn.css.js +5 -5
  109. package/dist/search/components/SearchByTags.js +3 -2
  110. package/dist/search/components/ViewsColum.js +1 -1
  111. package/dist/search/components/ViewsColumn.css.js +1 -1
  112. package/dist/search/components/_shared.css.js +3 -3
  113. package/dist/search/components/styles.css.js +5 -5
  114. package/dist/state/DiagramActorProvider.js +34 -15
  115. package/dist/state/diagram-machine.d.ts +29 -247
  116. package/dist/state/diagram-machine.js +16 -16
  117. package/dist/styles-min.css +1 -1
  118. package/dist/styles.css +1 -1
  119. package/dist/styles.css2.js +1 -1
  120. package/package.json +10 -8
  121. package/panda.buildinfo.json +254 -326
  122. package/src/LikeC4Diagram.props.ts +2 -2
  123. package/src/LikeC4Diagram.tsx +2 -2
  124. package/src/LikeC4ModelProvider.tsx +4 -4
  125. package/src/LikeC4ProjectsProvider.tsx +41 -0
  126. package/src/LikeC4Styles.tsx +107 -0
  127. package/src/StaticLikeC4Diagram.tsx +3 -3
  128. package/src/base/BaseXYFlow.tsx +24 -29
  129. package/src/base/primitives/MarkdownBlock.tsx +11 -3
  130. package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
  131. package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
  132. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
  133. package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
  134. package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
  135. package/src/base/primitives/compound/actionbtns.css.ts +6 -6
  136. package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
  137. package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
  138. package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
  139. package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
  140. package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
  141. package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
  142. package/src/base/primitives/edge/edge.css.ts +0 -60
  143. package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
  144. package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
  145. package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
  146. package/src/base/primitives/element/ElementNodeContainer.tsx +0 -3
  147. package/src/base/primitives/element/ElementShape.css.ts +11 -11
  148. package/src/base/primitives/element/ElementTags.tsx +17 -14
  149. package/src/bundle/LikeC4View.props.ts +1 -2
  150. package/src/bundle/LikeC4View.tsx +10 -3
  151. package/src/bundle/ReactLikeC4.tsx +1 -2
  152. package/src/bundle/ViewNotFound.tsx +1 -1
  153. package/src/bundle/index.ts +2 -1
  154. package/src/bundle/styles.css.ts +1 -1
  155. package/src/components/ErrorFallback.tsx +1 -1
  156. package/src/components/GithubIcon.tsx +16 -0
  157. package/src/components/Link.tsx +102 -113
  158. package/src/components/NavigationLink.tsx +2 -1
  159. package/src/components/SearchControl.css.ts +5 -5
  160. package/src/context/DiagramEventHandlers.tsx +12 -12
  161. package/src/globals.css +71 -0
  162. package/src/index.ts +5 -0
  163. package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
  164. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
  165. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
  166. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
  167. package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
  168. package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
  169. package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
  170. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
  171. package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
  172. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
  173. package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
  174. package/src/likec4model/index.ts +8 -0
  175. package/src/likec4model/useLikeC4Project.ts +61 -0
  176. package/src/navigationpanel/NavigationPanel.tsx +16 -17
  177. package/src/navigationpanel/NavigationPanelControls.tsx +24 -46
  178. package/src/navigationpanel/NavigationPanelDropdown.tsx +32 -16
  179. package/src/navigationpanel/_common.tsx +4 -1
  180. package/src/navigationpanel/actor.ts +14 -15
  181. package/src/navigationpanel/controls/BurgerButton.tsx +5 -7
  182. package/src/navigationpanel/controls/NavigationButtons.tsx +9 -1
  183. package/src/navigationpanel/controls/OpenSource.tsx +1 -1
  184. package/src/navigationpanel/controls/SearchControl.tsx +6 -4
  185. package/src/navigationpanel/controls/ToggleReadonly.tsx +3 -3
  186. package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
  187. package/src/navigationpanel/controls/index.ts +1 -0
  188. package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
  189. package/src/navigationpanel/editorpanel/EditorPanel.tsx +3 -3
  190. package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +19 -22
  191. package/src/navigationpanel/editorpanel/styles.ts +5 -5
  192. package/src/navigationpanel/hooks.tsx +2 -2
  193. package/src/navigationpanel/styles.css.ts +0 -2
  194. package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +9 -4
  195. package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
  196. package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
  197. package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
  198. package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
  199. package/src/overlays/overlay/Overlay.css.ts +7 -7
  200. package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
  201. package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
  202. package/src/search/Search.tsx +6 -6
  203. package/src/search/components/ElementsColumn.css.ts +5 -5
  204. package/src/search/components/SearchByTags.tsx +2 -2
  205. package/src/search/components/ViewsColum.tsx +1 -1
  206. package/src/search/components/ViewsColumn.css.ts +1 -1
  207. package/src/search/components/_shared.css.ts +3 -3
  208. package/src/search/components/styles.css.ts +5 -5
  209. package/src/state/DiagramActorProvider.tsx +45 -20
  210. package/src/state/diagram-machine.ts +22 -16
  211. package/dist/LikeC4CustomColors.d.ts +0 -2
  212. package/dist/LikeC4CustomColors.js +0 -45
  213. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
  214. package/src/LikeC4CustomColors.tsx +0 -85
@@ -2,17 +2,17 @@ import { css } from '@likec4/styles/css';
2
2
 
3
3
  const container = css({
4
4
  position: "absolute",
5
- bottom: "0.5rem",
6
- left: "50%",
5
+ bottom: "xxs",
6
+ left: "[50%]",
7
7
  transform: "translateX(-50%)",
8
- padding: 0,
9
- margin: 0,
8
+ padding: "[0px]",
9
+ margin: "[0px]",
10
10
  display: "flex",
11
11
  flexDirection: "column",
12
- gap: "0.4rem",
12
+ gap: "[0.4rem]",
13
13
  alignItems: "center",
14
14
  md: {
15
- gap: "0.6rem"
15
+ gap: "[0.6rem]"
16
16
  }
17
17
  });
18
18
  const tablerIcons = {
@@ -50,10 +50,10 @@ const btn = css({
50
50
  });
51
51
  const parallelStateFrame = css({
52
52
  position: "absolute",
53
- margin: 0,
54
- padding: 0,
55
- top: 0,
56
- left: 0,
53
+ margin: "0",
54
+ padding: "0",
55
+ top: "0",
56
+ left: "0",
57
57
  width: "100%",
58
58
  height: "100%",
59
59
  border: `2px solid`,
@@ -0,0 +1,7 @@
1
+ import { LikeC4Project, ProjectId } from '@likec4/core/types';
2
+ import { Context } from 'react';
3
+ export type LikeC4ProjectsContext = {
4
+ projects: ReadonlyArray<LikeC4Project>;
5
+ onProjectChange: (id: ProjectId) => void;
6
+ };
7
+ export declare const LikeC4ProjectsContext: Context<LikeC4ProjectsContext | null>;
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+
3
+ const LikeC4ProjectsContext = createContext(null);
4
+
5
+ export { LikeC4ProjectsContext };
@@ -1,3 +1,4 @@
1
1
  export { useCurrentViewModel, } from './useCurrentViewModel';
2
2
  export { useLikeC4ElementsTree, } from './useLikeC4ElementsTree';
3
3
  export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from './useLikeC4Model';
4
+ export { useChangeLikeC4Project, useHasProjects, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, } from './useLikeC4Project';
@@ -0,0 +1,22 @@
1
+ import { LikeC4Project, ProjectId } from '@likec4/core/types';
2
+ import { LikeC4ProjectsContext } from './LikeC4ProjectsContext';
3
+ /**
4
+ * @returns The list of available projects, or empty array if no projects are available.
5
+ */
6
+ export declare function useLikeC4Projects(): ReadonlyArray<LikeC4Project>;
7
+ /**
8
+ * @returns The callback to change current project.
9
+ */
10
+ export declare function useChangeLikeC4Project(): (id: ProjectId) => void;
11
+ /**
12
+ * @returns The callback to change current project.
13
+ */
14
+ export declare function useLikeC4ProjectsContext(): LikeC4ProjectsContext;
15
+ /**
16
+ * @returns True if there are more than one project available in the context.
17
+ */
18
+ export declare function useHasProjects(): boolean;
19
+ /**
20
+ * @returns The current project id.
21
+ */
22
+ export declare function useLikeC4ProjectId(): ProjectId;
@@ -0,0 +1,23 @@
1
+ import { useContext } from 'react';
2
+ import { LikeC4ModelContext } from './LikeC4ModelContext.js';
3
+ import { LikeC4ProjectsContext } from './LikeC4ProjectsContext.js';
4
+
5
+ const emptyProjects = [];
6
+ const emptyOnProjectChange = () => {
7
+ };
8
+ const emptyContext = {
9
+ projects: emptyProjects,
10
+ onProjectChange: emptyOnProjectChange
11
+ };
12
+ function useLikeC4ProjectsContext() {
13
+ return useContext(LikeC4ProjectsContext) ?? emptyContext;
14
+ }
15
+ function useLikeC4ProjectId() {
16
+ const ctx = useContext(LikeC4ModelContext);
17
+ if (!ctx) {
18
+ throw new Error("No LikeC4ModelContext found");
19
+ }
20
+ return ctx.projectId;
21
+ }
22
+
23
+ export { useLikeC4ProjectId, useLikeC4ProjectsContext };
@@ -31,7 +31,7 @@ const NavigationPanel = memo(() => {
31
31
  }
32
32
  );
33
33
  useEffect(() => {
34
- const subscription = actorRef.on("trigger.navigateTo", (event) => {
34
+ const subscription = actorRef.on("navigateTo", (event) => {
35
35
  if (diagramActor.getSnapshot().context.view.id !== event.viewId) {
36
36
  diagramActor.send({ type: "navigate.to", viewId: event.viewId });
37
37
  }
@@ -46,25 +46,24 @@ const NavigationPanel = memo(() => {
46
46
  {
47
47
  className: "react-flow__panel",
48
48
  css: {
49
- gap: "sm",
50
- margin: "sm",
51
49
  alignItems: "flex-start",
52
50
  pointerEvents: "none",
53
- top: 0,
54
- left: 0,
51
+ top: "0",
52
+ left: "0",
53
+ margin: "0",
54
+ width: "100%",
55
+ gap: "xxs",
55
56
  maxWidth: [
56
- "calc(100vw - 2 * {spacing.sm})",
57
- "calc(100cqw - 2 * {spacing.sm})"
57
+ "calc(100vw)",
58
+ "calc(100cqw)"
58
59
  ],
59
- width: "max-content",
60
- overflow: "hidden",
61
- smDown: {
62
- margin: 0,
63
- width: "100%",
64
- gap: "2xs",
60
+ "@/sm": {
61
+ margin: "xs",
62
+ gap: "xs",
63
+ width: "max-content",
65
64
  maxWidth: [
66
- "calc(100vw)",
67
- "calc(100cqw)"
65
+ "calc(100vw - 2 * {spacing.md})",
66
+ "calc(100cqw - 2 * {spacing.md})"
68
67
  ]
69
68
  }
70
69
  },
@@ -83,11 +82,10 @@ const NavigationPanelImpl = ({ actor }) => {
83
82
  Popover,
84
83
  {
85
84
  offset: {
86
- mainAxis: 4
85
+ mainAxis: 2
87
86
  },
88
87
  middlewares: { flip: false },
89
88
  opened,
90
- shadow: "md",
91
89
  position: "bottom-start",
92
90
  trapFocus: true,
93
91
  ...portalProps,
@@ -8,13 +8,14 @@ import { AnimatePresence } from 'motion/react';
8
8
  import * as m from 'motion/react-m';
9
9
  import { useEnabledFeatures } from '../context/DiagramFeatures.js';
10
10
  import { BreadcrumbsSeparator } from './_common.js';
11
- import { useNavigationActorRef } from './hooks.js';
11
+ import { useNavigationActor } from './hooks.js';
12
12
  import { breadcrumbTitle } from './styles.css.js';
13
13
  import { BurgerButton } from './controls/BurgerButton.js';
14
14
  import { NavigationButtons } from './controls/NavigationButtons.js';
15
- import { StartWalkthroughButton } from './walkthrough/ActiveWalkthroughControls.js';
15
+ import { ViewDetailsCard } from './controls/ViewDetailsCard.js';
16
16
  import { OpenSource } from './controls/OpenSource.js';
17
17
  import { ToggleReadonly } from './controls/ToggleReadonly.js';
18
+ import { StartWalkthroughButton } from './walkthrough/ActiveWalkthroughControls.js';
18
19
  import { SearchControl } from './controls/SearchControl.js';
19
20
 
20
21
  const selectBreadcrumbs = ({ context }) => {
@@ -26,12 +27,11 @@ const selectBreadcrumbs = ({ context }) => {
26
27
  })),
27
28
  viewId: context.viewModel.id,
28
29
  viewTitle: context.viewModel.titleOrUntitled,
29
- isDynamicView: context.viewModel.isDynamicView(),
30
- hasLinks: context.viewModel.links.length > 0
30
+ isDynamicView: context.viewModel.isDynamicView()
31
31
  };
32
32
  };
33
33
  const NavigationPanelControls = () => {
34
- const actor = useNavigationActorRef();
34
+ const actor = useNavigationActor();
35
35
  const {
36
36
  enableSearch,
37
37
  enableNavigationButtons,
@@ -42,7 +42,7 @@ const NavigationPanelControls = () => {
42
42
  folders,
43
43
  viewTitle,
44
44
  isDynamicView
45
- } = useSelector(actor, selectBreadcrumbs, deepEqual);
45
+ } = useSelector(actor.actorRef, selectBreadcrumbs, deepEqual);
46
46
  const folderBreadcrumbs = folders.flatMap(({ folderPath, title }, i) => [
47
47
  /* @__PURE__ */ jsx(
48
48
  UnstyledButton,
@@ -52,10 +52,14 @@ const NavigationPanelControls = () => {
52
52
  breadcrumbTitle({ dimmed: true, truncate: true }),
53
53
  "mantine-active",
54
54
  css({
55
- maxWidth: "200px"
55
+ userSelect: "none",
56
+ maxWidth: "200px",
57
+ display: {
58
+ base: "none",
59
+ "@/md": "block"
60
+ }
56
61
  })
57
62
  ),
58
- visibleFrom: "sm",
59
63
  title,
60
64
  onMouseEnter: () => actor.send({ type: "breadcrumbs.mouseEnter.folder", folderPath }),
61
65
  onMouseLeave: () => actor.send({ type: "breadcrumbs.mouseLeave.folder", folderPath }),
@@ -75,7 +79,10 @@ const NavigationPanelControls = () => {
75
79
  component: m.button,
76
80
  className: cx(
77
81
  "mantine-active",
78
- breadcrumbTitle({ truncate: true })
82
+ breadcrumbTitle({ truncate: true }),
83
+ css({
84
+ userSelect: "none"
85
+ })
79
86
  ),
80
87
  title: viewTitle,
81
88
  onMouseEnter: () => actor.send({ type: "breadcrumbs.mouseEnter.viewtitle" }),
@@ -89,45 +96,51 @@ const NavigationPanelControls = () => {
89
96
  "view-title"
90
97
  );
91
98
  return /* @__PURE__ */ jsxs(AnimatePresence, { propagate: true, children: [
92
- /* @__PURE__ */ jsx(BurgerButton, {}),
93
- enableNavigationButtons && /* @__PURE__ */ jsx(NavigationButtons, {}),
99
+ /* @__PURE__ */ jsx(BurgerButton, {}, "burger-button"),
100
+ enableNavigationButtons && /* @__PURE__ */ jsx(NavigationButtons, {}, "nav-buttons"),
94
101
  /* @__PURE__ */ jsxs(
95
102
  m.div,
96
103
  {
97
104
  layout: "position",
98
105
  className: hstack({
99
- gap: 3,
106
+ gap: "[3px]",
100
107
  flexShrink: 1,
101
108
  flexGrow: 1,
102
- overflow: "hidden",
103
- md: {
104
- marginRight: "md"
105
- }
109
+ overflow: "hidden"
106
110
  }),
107
111
  children: [
108
112
  folderBreadcrumbs,
109
113
  viewBreadcrumb
110
114
  ]
111
- }
115
+ },
116
+ "breadcrumbs"
112
117
  ),
113
- enableDynamicViewWalkthrough && isDynamicView && /* @__PURE__ */ jsx(StartWalkthroughButton, {}),
114
118
  /* @__PURE__ */ jsxs(
115
119
  m.div,
116
120
  {
117
121
  layout: "position",
118
122
  className: hstack({
119
- gap: 1,
123
+ gap: "[1px]",
124
+ flexGrow: 0,
120
125
  _empty: {
121
126
  display: "none"
122
127
  }
123
128
  }),
124
129
  children: [
130
+ /* @__PURE__ */ jsx(
131
+ ViewDetailsCard,
132
+ {
133
+ onOpen: () => actor.closeDropdown()
134
+ }
135
+ ),
125
136
  /* @__PURE__ */ jsx(OpenSource, {}),
126
137
  /* @__PURE__ */ jsx(ToggleReadonly, {})
127
138
  ]
128
- }
139
+ },
140
+ "actions"
129
141
  ),
130
- enableSearch && /* @__PURE__ */ jsx(SearchControl, {})
142
+ enableDynamicViewWalkthrough && isDynamicView && /* @__PURE__ */ jsx(StartWalkthroughButton, {}, "walkthrough-button"),
143
+ enableSearch && /* @__PURE__ */ jsx(SearchControl, {}, "search-control")
131
144
  ] });
132
145
  };
133
146
 
@@ -11,6 +11,7 @@ import { deepEqual } from 'fast-equals';
11
11
  import { isEmpty, pipe, sort, isArray } from 'remeda';
12
12
  import { NavigationLink } from '../components/NavigationLink.js';
13
13
  import { useLikeC4Model } from '../likec4model/useLikeC4Model.js';
14
+ import { ProjectsMenu } from './dropdown/ProjectsMenu.js';
14
15
  import { useNavigationActor, useNavigationActorContext, useNavigationActorRef } from './hooks.js';
15
16
  import { breadcrumbTitle } from './styles.css.js';
16
17
  import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
@@ -41,7 +42,7 @@ function NavigationPanelDropdown() {
41
42
  "nowheel",
42
43
  vstack({
43
44
  layerStyle: "likec4.dropdown",
44
- gap: "sm",
45
+ gap: "xs",
45
46
  pointerEvents: "all"
46
47
  })
47
48
  ),
@@ -49,6 +50,7 @@ function NavigationPanelDropdown() {
49
50
  onMouseLeave: () => actor.send({ type: "dropdown.mouseLeave" }),
50
51
  onMouseEnter: () => actor.send({ type: "dropdown.mouseEnter" }),
51
52
  children: [
53
+ /* @__PURE__ */ jsx(ProjectsMenu, {}),
52
54
  /* @__PURE__ */ jsx(HStack, { gap: "xs", children: /* @__PURE__ */ jsx(
53
55
  SearchInput,
54
56
  {
@@ -67,8 +69,8 @@ function NavigationPanelDropdown() {
67
69
  classNames: {
68
70
  root: css({
69
71
  maxWidth: [
70
- "calc(100vw - 20px)",
71
- "calc(100cqw - 20px)"
72
+ "calc(100vw - 50px)",
73
+ "calc(100cqw - 50px)"
72
74
  ]
73
75
  })
74
76
  },
@@ -106,15 +108,15 @@ function SearchResults({ searchQuery }) {
106
108
  className: css({
107
109
  width: "100%",
108
110
  maxWidth: [
109
- "70vw",
111
+ "calc(100vw - 250px)",
110
112
  "calc(100cqw - 250px)"
111
113
  ],
112
114
  maxHeight: [
113
- "70vh",
114
- "calc(100cqh - 250px)"
115
+ "calc(100vh - 200px)",
116
+ "calc(100cqh - 200px)"
115
117
  ]
116
118
  }),
117
- children: /* @__PURE__ */ jsx(VStack, { gap: 1, children: found.map((v) => /* @__PURE__ */ jsx(
119
+ children: /* @__PURE__ */ jsx(VStack, { gap: "[1px]", children: found.map((v) => /* @__PURE__ */ jsx(
118
120
  FoundedView,
119
121
  {
120
122
  view: v,
@@ -133,10 +135,10 @@ function SearchResults({ searchQuery }) {
133
135
  );
134
136
  }
135
137
  const foundedViewClass = hstack({
136
- gap: "2xs",
138
+ gap: "xxs",
137
139
  rounded: "sm",
138
140
  px: "xs",
139
- py: "2xs",
141
+ py: "xxs",
140
142
  _hover: {
141
143
  backgroundColor: {
142
144
  base: "mantine.colors.gray[1]",
@@ -164,7 +166,19 @@ function FoundedView({ view, highlight, ...props }) {
164
166
  component: "div",
165
167
  className: cx(
166
168
  inheritColor,
167
- breadcrumbTitle({ truncate: true })
169
+ breadcrumbTitle({ truncate: true }),
170
+ css({
171
+ "& > mark": {
172
+ backgroundColor: {
173
+ base: "mantine.colors.yellow[2]/90",
174
+ _dark: "mantine.colors.yellow[5]/80",
175
+ _groupFocus: "[transparent]"
176
+ },
177
+ color: {
178
+ _groupFocus: "[inherit!]"
179
+ }
180
+ }
181
+ })
168
182
  ),
169
183
  maw: 350,
170
184
  highlight,
@@ -210,7 +224,7 @@ function FoundedView({ view, highlight, ...props }) {
210
224
  b.path
211
225
  ));
212
226
  breadcrumbs.push(
213
- /* @__PURE__ */ jsxs(HStack, { gap: 4, children: [
227
+ /* @__PURE__ */ jsxs(HStack, { gap: "[4px]", children: [
214
228
  viewIcon,
215
229
  viewLabel
216
230
  ] })
@@ -236,7 +250,8 @@ const folderIcon = /* @__PURE__ */ jsx(
236
250
  opacity: {
237
251
  base: 0.3,
238
252
  _groupHover: 0.5,
239
- _groupActive: 0.5
253
+ _groupActive: 0.5,
254
+ _groupFocus: 0.5
240
255
  }
241
256
  })
242
257
  }
@@ -245,8 +260,9 @@ const viewTypeIconCss = css({
245
260
  opacity: {
246
261
  base: 0.3,
247
262
  _dark: 0.5,
248
- _groupHover: 0.7,
249
- _groupActive: 0.7
263
+ _groupHover: 0.8,
264
+ _groupActive: 0.8,
265
+ _groupFocus: 0.8
250
266
  }
251
267
  });
252
268
  const ViewTypeIcon = {
@@ -266,8 +282,8 @@ const ColumnScrollArea = ScrollAreaAutosize.withProps({
266
282
  scrollbars: "y",
267
283
  className: css({
268
284
  maxHeight: [
269
- "calc(100vh - 50px)",
270
- "calc(100cqh - 50px)"
285
+ "calc(100vh - 160px)",
286
+ "calc(100cqh - 160px)"
271
287
  ]
272
288
  })
273
289
  });
@@ -323,7 +339,7 @@ function FolderColumn({ data }) {
323
339
  actor.send({ type: "select.view", viewId: item.viewId });
324
340
  }
325
341
  };
326
- return /* @__PURE__ */ jsx(Box, { pb: "4", children: /* @__PURE__ */ jsx(ColumnScrollArea, { children: /* @__PURE__ */ jsx(VStack, { gap: 1, children: data.items.map((item, i) => /* @__PURE__ */ jsx(
342
+ return /* @__PURE__ */ jsx(Box, { mb: "1", children: /* @__PURE__ */ jsx(ColumnScrollArea, { children: /* @__PURE__ */ jsx(VStack, { gap: "[1px]", children: data.items.map((item, i) => /* @__PURE__ */ jsx(
327
343
  FolderColumnItem,
328
344
  {
329
345
  columnItem: item,
@@ -19,10 +19,13 @@ const Tooltip = Tooltip$1.withProps({
19
19
  const BreadcrumbsSeparator = () => /* @__PURE__ */ jsx(
20
20
  ThemeIcon,
21
21
  {
22
- visibleFrom: "sm",
23
22
  variant: "transparent",
24
23
  size: 16,
25
24
  className: css({
25
+ display: {
26
+ base: "none",
27
+ "@/md": "flex"
28
+ },
26
29
  color: {
27
30
  base: "mantine.colors.gray[5]",
28
31
  _dark: "mantine.colors.dark[3]"
@@ -49,7 +49,7 @@ export type NavigationPanelActorEvent = {
49
49
  type: 'dropdown.dismiss';
50
50
  };
51
51
  export type NavigationPanelActorEmitted = {
52
- type: 'trigger.navigateTo';
52
+ type: 'navigateTo';
53
53
  viewId: ViewId;
54
54
  };
55
55
  export type BreadcrumbItem = {
@@ -117,8 +117,8 @@ declare const _actorLogic: StateMachine<NavigationPanelActorContext, NavigationP
117
117
  type: "update search query";
118
118
  params: NonReducibleUnknown;
119
119
  };
120
- "emit trigger.navigateTo": {
121
- type: "emit trigger.navigateTo";
120
+ "emit navigateTo": {
121
+ type: "emit navigateTo";
122
122
  params: NonReducibleUnknown;
123
123
  };
124
124
  }>, Values<{
@@ -239,36 +239,32 @@ declare const _actorLogic: StateMachine<NavigationPanelActorContext, NavigationP
239
239
  readonly actions: "keep dropdown open";
240
240
  readonly target: "search";
241
241
  };
242
- readonly 'breadcrumbs.click.folder': {
243
- readonly actions: "update selected folder";
244
- readonly target: "opened";
245
- readonly reenter: true;
246
- };
247
242
  readonly 'breadcrumbs.click.viewtitle': {
248
243
  readonly actions: "reset selected folder";
249
- readonly reenter: true;
250
- readonly target: "opened";
244
+ };
245
+ readonly 'breadcrumbs.click.*': {
246
+ readonly actions: "update selected folder";
251
247
  };
252
248
  readonly 'select.folder': {
253
249
  readonly actions: readonly ["keep dropdown open", "update selected folder"];
254
250
  };
255
251
  readonly 'select.view': {
256
- readonly actions: readonly ["emit trigger.navigateTo"];
252
+ readonly actions: readonly ["emit navigateTo"];
257
253
  };
258
254
  };
259
255
  };
260
256
  readonly search: {
261
257
  readonly on: {
262
- readonly 'breadcrumbs.click.folder': {
263
- readonly actions: readonly ["reset search query", "update selected folder"];
258
+ readonly 'breadcrumbs.click.viewtitle': {
259
+ readonly actions: readonly ["reset search query", "reset selected folder"];
264
260
  readonly target: "opened";
265
261
  };
266
262
  readonly 'breadcrumbs.click.*': {
267
- readonly actions: readonly ["reset search query", "reset selected folder"];
263
+ readonly actions: readonly ["reset search query", "update selected folder"];
268
264
  readonly target: "opened";
269
265
  };
270
266
  readonly 'select.view': {
271
- readonly actions: readonly ["emit trigger.navigateTo"];
267
+ readonly actions: readonly ["emit navigateTo"];
272
268
  };
273
269
  };
274
270
  };
@@ -31,6 +31,9 @@ const _actorLogic = setup({
31
31
  activatedBy: "click"
32
32
  }),
33
33
  "update selected folder": assign(({ event }) => {
34
+ if (event.type === "breadcrumbs.click.root") {
35
+ return { selectedFolder: "" };
36
+ }
34
37
  assertEvent(event, ["breadcrumbs.click.folder", "select.folder"]);
35
38
  return { selectedFolder: event.folderPath };
36
39
  }),
@@ -58,10 +61,10 @@ const _actorLogic = setup({
58
61
  assertEvent(event, "searchQuery.change");
59
62
  return { searchQuery: event.value ?? "" };
60
63
  }),
61
- "emit trigger.navigateTo": emit(({ event }) => {
64
+ "emit navigateTo": emit(({ event }) => {
62
65
  assertEvent(event, "select.view");
63
66
  return {
64
- type: "trigger.navigateTo",
67
+ type: "navigateTo",
65
68
  viewId: ViewId(event.viewId)
66
69
  };
67
70
  })
@@ -170,15 +173,11 @@ const _actorLogic = setup({
170
173
  actions: "keep dropdown open",
171
174
  target: "search"
172
175
  },
173
- "breadcrumbs.click.folder": {
174
- actions: "update selected folder",
175
- target: "opened",
176
- reenter: true
177
- },
178
176
  "breadcrumbs.click.viewtitle": {
179
- actions: "reset selected folder",
180
- reenter: true,
181
- target: "opened"
177
+ actions: "reset selected folder"
178
+ },
179
+ "breadcrumbs.click.*": {
180
+ actions: "update selected folder"
182
181
  },
183
182
  "select.folder": {
184
183
  actions: [
@@ -188,30 +187,30 @@ const _actorLogic = setup({
188
187
  },
189
188
  "select.view": {
190
189
  actions: [
191
- "emit trigger.navigateTo"
190
+ "emit navigateTo"
192
191
  ]
193
192
  }
194
193
  }
195
194
  },
196
195
  search: {
197
196
  on: {
198
- "breadcrumbs.click.folder": {
197
+ "breadcrumbs.click.viewtitle": {
199
198
  actions: [
200
199
  "reset search query",
201
- "update selected folder"
200
+ "reset selected folder"
202
201
  ],
203
202
  target: "opened"
204
203
  },
205
204
  "breadcrumbs.click.*": {
206
205
  actions: [
207
206
  "reset search query",
208
- "reset selected folder"
207
+ "update selected folder"
209
208
  ],
210
209
  target: "opened"
211
210
  },
212
211
  "select.view": {
213
212
  actions: [
214
- "emit trigger.navigateTo"
213
+ "emit navigateTo"
215
214
  ]
216
215
  }
217
216
  }
@@ -1,11 +1,11 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { PanelActionIcon } from '../_common.js';
3
- import { useNavigationActorRef } from '../hooks.js';
4
2
  import { useDiagramEventHandlers } from '../../context/DiagramEventHandlers.js';
3
+ import { PanelActionIcon } from '../_common.js';
4
+ import { useNavigationActor } from '../hooks.js';
5
5
  import IconMenu2 from '../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js';
6
6
 
7
7
  const BurgerButton = () => {
8
- const actor = useNavigationActorRef();
8
+ const actor = useNavigationActor();
9
9
  const { onBurgerMenuClick } = useDiagramEventHandlers();
10
10
  return /* @__PURE__ */ jsx(
11
11
  PanelActionIcon,
@@ -19,14 +19,12 @@ const BurgerButton = () => {
19
19
  },
20
20
  onClick: (e) => {
21
21
  e.stopPropagation();
22
- if (onBurgerMenuClick) {
23
- actor.send({ type: "breadcrumbs.mouseLeave.root" });
22
+ if (onBurgerMenuClick && actor.isOpened()) {
24
23
  setTimeout(() => {
25
24
  onBurgerMenuClick();
26
25
  }, 100);
27
- } else {
28
- actor.send({ type: "breadcrumbs.click.root" });
29
26
  }
27
+ actor.send({ type: "breadcrumbs.click.root" });
30
28
  },
31
29
  children: /* @__PURE__ */ jsx(IconMenu2, { style: { width: "80%", height: "80%" } })
32
30
  }