@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.
- package/bundle/{chunk-C0Eg81Gj.js → chunk-7MPUJFHj.js} +315 -311
- package/bundle/custom.js +52 -52
- package/bundle/index.js +1583 -739
- package/dist/LikeC4Diagram.js +6 -6
- package/dist/LikeC4Diagram.props.d.ts +2 -3
- package/dist/LikeC4ModelProvider.d.ts +3 -3
- package/dist/LikeC4ProjectsProvider.d.ts +17 -0
- package/dist/LikeC4ProjectsProvider.js +22 -0
- package/dist/LikeC4Styles.d.ts +1 -0
- package/dist/LikeC4Styles.js +94 -0
- package/dist/StaticLikeC4Diagram.d.ts +3 -3
- package/dist/base/BaseXYFlow.js +23 -26
- package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
- package/dist/base/primitives/MarkdownBlock.js +1 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +2 -2
- package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -2
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
- package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
- package/dist/base/primitives/compound/CompoundTitle.js +9 -8
- package/dist/base/primitives/compound/actionbtns.css.js +6 -6
- package/dist/base/primitives/edge/EdgeActionButton.js +2 -2
- package/dist/base/primitives/edge/EdgeContainer.js +4 -7
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
- package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
- package/dist/base/primitives/edge/EdgeLabel.js +16 -6
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
- package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
- package/dist/base/primitives/edge/edge.css.d.ts +0 -2
- package/dist/base/primitives/edge/edge.css.js +1 -55
- package/dist/base/primitives/element/ElementActionButtons.js +2 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +8 -7
- package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
- package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
- package/dist/base/primitives/element/ElementShape.css.js +11 -11
- package/dist/base/primitives/element/ElementTags.d.ts +1 -0
- package/dist/base/primitives/element/ElementTags.js +17 -14
- package/dist/bundle/LikeC4View.d.ts +1 -1
- package/dist/bundle/LikeC4View.js +7 -1
- package/dist/bundle/LikeC4View.props.d.ts +1 -2
- package/dist/bundle/ReactLikeC4.d.ts +1 -1
- package/dist/bundle/ViewNotFound.js +1 -1
- package/dist/bundle/index.d.ts +2 -1
- package/dist/bundle/index.js +1 -0
- package/dist/bundle/styles.css.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/GithubIcon.d.ts +2 -0
- package/dist/components/GithubIcon.js +17 -0
- package/dist/components/Link.d.ts +4 -3
- package/dist/components/Link.js +84 -87
- package/dist/components/NavigationLink.d.ts +2 -2
- package/dist/components/SearchControl.css.js +6 -5
- package/dist/context/DiagramEventHandlers.d.ts +6 -6
- package/dist/context/DiagramEventHandlers.js +4 -7
- package/dist/globals.css.js +3 -0
- package/dist/hooks/useXYFlow.d.ts +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -3
- package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
- package/dist/likec4diagram/custom/index.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
- package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
- package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -5
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
- package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
- package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
- package/dist/likec4model/index.d.ts +1 -0
- package/dist/likec4model/useLikeC4Project.d.ts +22 -0
- package/dist/likec4model/useLikeC4Project.js +23 -0
- package/dist/navigationpanel/NavigationPanel.js +15 -17
- package/dist/navigationpanel/NavigationPanelControls.js +34 -21
- package/dist/navigationpanel/NavigationPanelDropdown.js +33 -17
- package/dist/navigationpanel/_common.js +4 -1
- package/dist/navigationpanel/actor.d.ts +11 -15
- package/dist/navigationpanel/actor.js +14 -15
- package/dist/navigationpanel/controls/BurgerButton.js +5 -7
- package/dist/navigationpanel/controls/NavigationButtons.js +37 -24
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +6 -4
- package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
- package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
- package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
- package/dist/navigationpanel/controls/index.d.ts +1 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -20
- package/dist/navigationpanel/editorpanel/styles.js +5 -5
- package/dist/navigationpanel/hooks.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +0 -2
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +12 -7
- 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
- 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
- package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
- package/dist/overlays/element-details/ElementDetailsCard.js +8 -13
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
- package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
- package/dist/overlays/overlay/Overlay.css.js +8 -7
- package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
- package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
- package/dist/search/Search.js +6 -6
- package/dist/search/components/ElementsColumn.css.js +5 -5
- package/dist/search/components/SearchByTags.js +3 -2
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +3 -3
- package/dist/search/components/styles.css.js +5 -5
- package/dist/state/DiagramActorProvider.js +34 -15
- package/dist/state/diagram-machine.d.ts +29 -247
- package/dist/state/diagram-machine.js +16 -16
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +10 -8
- package/panda.buildinfo.json +254 -326
- package/src/LikeC4Diagram.props.ts +2 -2
- package/src/LikeC4Diagram.tsx +2 -2
- package/src/LikeC4ModelProvider.tsx +4 -4
- package/src/LikeC4ProjectsProvider.tsx +41 -0
- package/src/LikeC4Styles.tsx +107 -0
- package/src/StaticLikeC4Diagram.tsx +3 -3
- package/src/base/BaseXYFlow.tsx +24 -29
- package/src/base/primitives/MarkdownBlock.tsx +11 -3
- package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
- package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
- package/src/base/primitives/compound/actionbtns.css.ts +6 -6
- package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
- package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
- package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
- package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
- package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
- package/src/base/primitives/edge/edge.css.ts +0 -60
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
- package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
- package/src/base/primitives/element/ElementNodeContainer.tsx +0 -3
- package/src/base/primitives/element/ElementShape.css.ts +11 -11
- package/src/base/primitives/element/ElementTags.tsx +17 -14
- package/src/bundle/LikeC4View.props.ts +1 -2
- package/src/bundle/LikeC4View.tsx +10 -3
- package/src/bundle/ReactLikeC4.tsx +1 -2
- package/src/bundle/ViewNotFound.tsx +1 -1
- package/src/bundle/index.ts +2 -1
- package/src/bundle/styles.css.ts +1 -1
- package/src/components/ErrorFallback.tsx +1 -1
- package/src/components/GithubIcon.tsx +16 -0
- package/src/components/Link.tsx +102 -113
- package/src/components/NavigationLink.tsx +2 -1
- package/src/components/SearchControl.css.ts +5 -5
- package/src/context/DiagramEventHandlers.tsx +12 -12
- package/src/globals.css +71 -0
- package/src/index.ts +5 -0
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
- package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
- package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
- package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
- package/src/likec4model/index.ts +8 -0
- package/src/likec4model/useLikeC4Project.ts +61 -0
- package/src/navigationpanel/NavigationPanel.tsx +16 -17
- package/src/navigationpanel/NavigationPanelControls.tsx +24 -46
- package/src/navigationpanel/NavigationPanelDropdown.tsx +32 -16
- package/src/navigationpanel/_common.tsx +4 -1
- package/src/navigationpanel/actor.ts +14 -15
- package/src/navigationpanel/controls/BurgerButton.tsx +5 -7
- package/src/navigationpanel/controls/NavigationButtons.tsx +9 -1
- package/src/navigationpanel/controls/OpenSource.tsx +1 -1
- package/src/navigationpanel/controls/SearchControl.tsx +6 -4
- package/src/navigationpanel/controls/ToggleReadonly.tsx +3 -3
- package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
- package/src/navigationpanel/controls/index.ts +1 -0
- package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
- package/src/navigationpanel/editorpanel/EditorPanel.tsx +3 -3
- package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +19 -22
- package/src/navigationpanel/editorpanel/styles.ts +5 -5
- package/src/navigationpanel/hooks.tsx +2 -2
- package/src/navigationpanel/styles.css.ts +0 -2
- package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +9 -4
- package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
- package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
- package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
- package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
- package/src/overlays/overlay/Overlay.css.ts +7 -7
- package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
- package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
- package/src/search/Search.tsx +6 -6
- package/src/search/components/ElementsColumn.css.ts +5 -5
- package/src/search/components/SearchByTags.tsx +2 -2
- package/src/search/components/ViewsColum.tsx +1 -1
- package/src/search/components/ViewsColumn.css.ts +1 -1
- package/src/search/components/_shared.css.ts +3 -3
- package/src/search/components/styles.css.ts +5 -5
- package/src/state/DiagramActorProvider.tsx +45 -20
- package/src/state/diagram-machine.ts +22 -16
- package/dist/LikeC4CustomColors.d.ts +0 -2
- package/dist/LikeC4CustomColors.js +0 -45
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
- 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: "
|
|
6
|
-
left: "50%",
|
|
5
|
+
bottom: "xxs",
|
|
6
|
+
left: "[50%]",
|
|
7
7
|
transform: "translateX(-50%)",
|
|
8
|
-
padding:
|
|
9
|
-
margin:
|
|
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>;
|
|
@@ -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("
|
|
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
|
|
57
|
-
"calc(100cqw
|
|
57
|
+
"calc(100vw)",
|
|
58
|
+
"calc(100cqw)"
|
|
58
59
|
],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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:
|
|
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 {
|
|
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 {
|
|
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 =
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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: "
|
|
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 -
|
|
71
|
-
"calc(100cqw -
|
|
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
|
-
"
|
|
111
|
+
"calc(100vw - 250px)",
|
|
110
112
|
"calc(100cqw - 250px)"
|
|
111
113
|
],
|
|
112
114
|
maxHeight: [
|
|
113
|
-
"
|
|
114
|
-
"calc(100cqh -
|
|
115
|
+
"calc(100vh - 200px)",
|
|
116
|
+
"calc(100cqh - 200px)"
|
|
115
117
|
]
|
|
116
118
|
}),
|
|
117
|
-
children: /* @__PURE__ */ jsx(VStack, { gap:
|
|
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: "
|
|
138
|
+
gap: "xxs",
|
|
137
139
|
rounded: "sm",
|
|
138
140
|
px: "xs",
|
|
139
|
-
py: "
|
|
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:
|
|
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.
|
|
249
|
-
_groupActive: 0.
|
|
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 -
|
|
270
|
-
"calc(100cqh -
|
|
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, {
|
|
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: '
|
|
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
|
|
121
|
-
type: "emit
|
|
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
|
-
|
|
250
|
-
|
|
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
|
|
252
|
+
readonly actions: readonly ["emit navigateTo"];
|
|
257
253
|
};
|
|
258
254
|
};
|
|
259
255
|
};
|
|
260
256
|
readonly search: {
|
|
261
257
|
readonly on: {
|
|
262
|
-
readonly 'breadcrumbs.click.
|
|
263
|
-
readonly actions: readonly ["reset search query", "
|
|
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", "
|
|
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
|
|
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
|
|
64
|
+
"emit navigateTo": emit(({ event }) => {
|
|
62
65
|
assertEvent(event, "select.view");
|
|
63
66
|
return {
|
|
64
|
-
type: "
|
|
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
|
-
|
|
181
|
-
|
|
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
|
|
190
|
+
"emit navigateTo"
|
|
192
191
|
]
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
194
|
},
|
|
196
195
|
search: {
|
|
197
196
|
on: {
|
|
198
|
-
"breadcrumbs.click.
|
|
197
|
+
"breadcrumbs.click.viewtitle": {
|
|
199
198
|
actions: [
|
|
200
199
|
"reset search query",
|
|
201
|
-
"
|
|
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
|
-
"
|
|
207
|
+
"update selected folder"
|
|
209
208
|
],
|
|
210
209
|
target: "opened"
|
|
211
210
|
},
|
|
212
211
|
"select.view": {
|
|
213
212
|
actions: [
|
|
214
|
-
"emit
|
|
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 =
|
|
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
|
}
|