@likec4/diagram 1.35.0 → 1.36.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.
- package/bundle/{chunk-C0Eg81Gj.js → chunk-DHvr-RGh.js} +323 -311
- package/bundle/custom.js +52 -52
- package/bundle/index.js +1594 -749
- 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/DiagramUI.js +2 -1
- 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/diagram-title/DiagramTitlePanel.js +4 -4
- 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/LikeC4ModelContext.d.ts +2 -1
- package/dist/likec4model/LikeC4ModelContext.js +10 -2
- 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/useCurrentViewModel.d.ts +1 -0
- package/dist/likec4model/useCurrentViewModel.js +4 -1
- 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 +43 -25
- 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/DiagramUI.tsx +8 -2
- 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/diagram-title/DiagramTitlePanel.tsx +4 -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/{LikeC4ModelContext.ts → LikeC4ModelContext.tsx} +9 -1
- package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
- package/src/likec4model/index.ts +8 -0
- package/src/likec4model/useCurrentViewModel.ts +4 -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 +56 -30
- 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
package/dist/components/Link.js
CHANGED
|
@@ -1,108 +1,105 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { css, cx } from '@likec4/styles/css';
|
|
3
|
+
import { Badge, CopyButton, ActionIcon } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { GithubIcon } from './GithubIcon.js';
|
|
5
6
|
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
6
7
|
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: "mantine.colors.dark[1]"
|
|
24
|
-
},
|
|
25
|
-
_hover: {
|
|
26
|
-
transitionTimingFunction: "out",
|
|
27
|
-
color: "mantine.colors.defaultColor",
|
|
28
|
-
background: "mantine.colors.defaultHover"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
variants: {
|
|
32
|
-
size: {
|
|
33
|
-
sm: {
|
|
34
|
-
minHeight: "22px",
|
|
35
|
-
padding: "2px 8px 2px 2px"
|
|
36
|
-
},
|
|
37
|
-
md: {
|
|
38
|
-
minHeight: "30px",
|
|
39
|
-
padding: "3px 16px 3px 3px"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const titleBox = css({
|
|
45
|
-
flex: "1 1 100%",
|
|
46
|
-
transition: `transform 100ms {easings.inOut}`,
|
|
47
|
-
_groupHover: {
|
|
48
|
-
transitionTimingFunction: "out",
|
|
49
|
-
transitionDelay: "50ms",
|
|
50
|
-
transform: "translateX(1px)"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function Link({
|
|
54
|
-
value,
|
|
55
|
-
size = "md"
|
|
56
|
-
}) {
|
|
57
|
-
const isNormalSize = size === "md";
|
|
58
|
-
const url = value.url.includes("://") ? value.url : new window.URL(value.url, window.location.href).toString();
|
|
59
|
-
return /* @__PURE__ */ jsx(CopyButton, { value: url, children: ({ copied, copy }) => /* @__PURE__ */ jsxs(
|
|
60
|
-
Anchor,
|
|
61
|
-
{
|
|
62
|
-
href: url,
|
|
63
|
-
target: "_blank",
|
|
64
|
-
underline: "never",
|
|
65
|
-
className: cx(
|
|
66
|
-
"group",
|
|
67
|
-
link({ size })
|
|
68
|
-
),
|
|
69
|
-
onClick: stopPropagation,
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
9
|
+
const GITHUB_PREFIX = "https://github.com/";
|
|
10
|
+
const Link = forwardRef(
|
|
11
|
+
({ value, className, ...props }, ref) => {
|
|
12
|
+
const url = value.url.includes("://") ? value.url : new window.URL(value.url, window.location.href).toString();
|
|
13
|
+
let isGithub = url.startsWith(GITHUB_PREFIX);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Badge,
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
variant: "default",
|
|
19
|
+
radius: "sm",
|
|
20
|
+
size: "sm",
|
|
21
|
+
tt: "none",
|
|
22
|
+
leftSection: value.title ? /* @__PURE__ */ jsx(Fragment, { children: value.title }) : null,
|
|
23
|
+
rightSection: /* @__PURE__ */ jsx(CopyButton, { value: url, timeout: 1500, children: ({ copy, copied }) => /* @__PURE__ */ jsx(
|
|
72
24
|
ActionIcon,
|
|
73
25
|
{
|
|
74
26
|
className: css({
|
|
75
|
-
|
|
27
|
+
opacity: copied ? 1 : 0.45,
|
|
28
|
+
transition: "fast",
|
|
29
|
+
_hover: {
|
|
30
|
+
opacity: 1
|
|
31
|
+
}
|
|
76
32
|
}),
|
|
77
33
|
tabIndex: -1,
|
|
78
|
-
size:
|
|
79
|
-
variant: copied ? "light" : "
|
|
34
|
+
size: "20",
|
|
35
|
+
variant: copied ? "light" : "transparent",
|
|
80
36
|
color: copied ? "teal" : "gray",
|
|
37
|
+
"data-active": copied,
|
|
81
38
|
onClick: (e) => {
|
|
82
39
|
e.stopPropagation();
|
|
83
40
|
e.preventDefault();
|
|
84
41
|
copy();
|
|
85
42
|
},
|
|
86
|
-
children: copied ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx(IconCopy, {
|
|
43
|
+
children: copied ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx(IconCopy, { stroke: 2.5 })
|
|
87
44
|
}
|
|
88
|
-
),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
45
|
+
) }),
|
|
46
|
+
...props,
|
|
47
|
+
className: cx(className, "group"),
|
|
48
|
+
classNames: {
|
|
49
|
+
root: css({
|
|
50
|
+
flexWrap: "nowrap",
|
|
51
|
+
minHeight: 24,
|
|
52
|
+
maxWidth: 500,
|
|
53
|
+
userSelect: "all",
|
|
54
|
+
pr: "0",
|
|
55
|
+
_hover: {
|
|
56
|
+
backgroundColor: {
|
|
57
|
+
base: "mantine.colors.gray[1]",
|
|
58
|
+
_dark: "mantine.colors.dark[5]"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
section: css({
|
|
63
|
+
'&:is([data-position="left"])': {
|
|
64
|
+
color: "mantine.colors.dimmed",
|
|
65
|
+
userSelect: "none",
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
_groupHover: {
|
|
68
|
+
color: "[inherit]",
|
|
69
|
+
opacity: 0.7
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
label: css({
|
|
74
|
+
"& > a": {
|
|
75
|
+
color: "[inherit]",
|
|
76
|
+
cursor: "pointer",
|
|
77
|
+
transition: "fast",
|
|
78
|
+
opacity: {
|
|
79
|
+
base: 0.7,
|
|
80
|
+
_hover: 1
|
|
81
|
+
},
|
|
82
|
+
textDecoration: {
|
|
83
|
+
base: "none",
|
|
84
|
+
_hover: "underline"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */ jsxs("a", { href: url, target: "_blank", children: [
|
|
90
|
+
isGithub && /* @__PURE__ */ jsx(
|
|
91
|
+
GithubIcon,
|
|
92
92
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
lh: isNormalSize ? 1.3 : 1.2,
|
|
97
|
-
fw: value.title ? 500 : 400,
|
|
98
|
-
children: value.title || url
|
|
93
|
+
height: "12",
|
|
94
|
+
width: "12",
|
|
95
|
+
style: { verticalAlign: "middle", marginRight: "4px" }
|
|
99
96
|
}
|
|
100
97
|
),
|
|
101
|
-
|
|
98
|
+
isGithub ? url.replace(GITHUB_PREFIX, "") : url
|
|
102
99
|
] })
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
107
104
|
|
|
108
105
|
export { Link };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NavLinkProps } from '@mantine/core';
|
|
2
|
-
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
-
export interface NavigationLinkProps extends NavLinkProps, Omit<
|
|
2
|
+
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface NavigationLinkProps extends Omit<NavLinkProps, 'classNames'>, Omit<ComponentPropsWithoutRef<'button'>, keyof NavLinkProps> {
|
|
4
4
|
truncateLabel?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const NavigationLink: ForwardRefExoticComponent<NavigationLinkProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -3,7 +3,7 @@ import { css } from '@likec4/styles/css';
|
|
|
3
3
|
const root = css({
|
|
4
4
|
height: "30px",
|
|
5
5
|
paddingLeft: "sm",
|
|
6
|
-
paddingRight: "
|
|
6
|
+
paddingRight: "1",
|
|
7
7
|
borderRadius: "sm",
|
|
8
8
|
// TODO
|
|
9
9
|
// color: fallbackVar('var(--search-color)', 'mantine.colors.placeholder)',
|
|
@@ -39,21 +39,22 @@ const placeholder = css({
|
|
|
39
39
|
fontSize: "sm",
|
|
40
40
|
// mantine.fontSizes.sm,
|
|
41
41
|
fontWeight: 500,
|
|
42
|
-
paddingRight: "
|
|
42
|
+
paddingRight: "2.5",
|
|
43
|
+
// 10px
|
|
43
44
|
color: "mantine.colors.placeholder",
|
|
44
45
|
flex: "1",
|
|
45
46
|
sm: {
|
|
46
|
-
paddingRight: "30px"
|
|
47
|
+
paddingRight: "[30px]"
|
|
47
48
|
},
|
|
48
49
|
md: {
|
|
49
|
-
paddingRight: "50px"
|
|
50
|
+
paddingRight: "[50px]"
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
const shortcut = css({
|
|
53
54
|
fontSize: "11px",
|
|
54
55
|
fontWeight: 600,
|
|
55
56
|
lineHeight: 1,
|
|
56
|
-
padding: "4px 7px",
|
|
57
|
+
padding: "[4px 7px]",
|
|
57
58
|
borderRadius: "sm",
|
|
58
59
|
border: "1px solid",
|
|
59
60
|
transition: "fast",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aux } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren, RefObject } from 'react';
|
|
3
3
|
import { LikeC4DiagramEventHandlers } from '../LikeC4Diagram.props';
|
|
4
4
|
type RequiredOrNull<T> = {
|
|
5
5
|
[P in keyof T]-?: NonNullable<T[P]> | null;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
8
|
-
handlersRef: RefObject<LikeC4DiagramEventHandlers<Any>>;
|
|
7
|
+
export type DiagramEventHandlersContext = RequiredOrNull<LikeC4DiagramEventHandlers<aux.Any>> & {
|
|
8
|
+
handlersRef: RefObject<LikeC4DiagramEventHandlers<aux.Any>>;
|
|
9
9
|
};
|
|
10
|
-
export declare function DiagramEventHandlers<A extends Any>({ handlers, children, }: PropsWithChildren<{
|
|
10
|
+
export declare function DiagramEventHandlers<A extends aux.Any>({ handlers, children, }: PropsWithChildren<{
|
|
11
11
|
handlers: LikeC4DiagramEventHandlers<A>;
|
|
12
12
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function useDiagramEventHandlers():
|
|
14
|
-
export declare function useDiagramEventHandlersRef(): RefObject<LikeC4DiagramEventHandlers<
|
|
13
|
+
export declare function useDiagramEventHandlers(): DiagramEventHandlersContext;
|
|
14
|
+
export declare function useDiagramEventHandlersRef<A extends aux.Any = aux.Any>(): RefObject<LikeC4DiagramEventHandlers<A>>;
|
|
15
15
|
export {};
|
|
@@ -16,7 +16,7 @@ const HandlerNames = [
|
|
|
16
16
|
"onChange",
|
|
17
17
|
"onCanvasDblClick"
|
|
18
18
|
];
|
|
19
|
-
const
|
|
19
|
+
const DiagramEventHandlersReactContext = createContext({
|
|
20
20
|
...mapToObj(HandlerNames, (name) => [name, null]),
|
|
21
21
|
handlersRef: {
|
|
22
22
|
current: {}
|
|
@@ -37,13 +37,10 @@ function DiagramEventHandlers({
|
|
|
37
37
|
}),
|
|
38
38
|
handlersRef
|
|
39
39
|
}), [handlersRef, ...deps]);
|
|
40
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
+
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children });
|
|
41
41
|
}
|
|
42
42
|
function useDiagramEventHandlers() {
|
|
43
|
-
return useContext(
|
|
44
|
-
}
|
|
45
|
-
function useDiagramEventHandlersRef() {
|
|
46
|
-
return useContext(DiagramEventHandlersContext).handlersRef;
|
|
43
|
+
return useContext(DiagramEventHandlersReactContext);
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
export { DiagramEventHandlers, useDiagramEventHandlers
|
|
46
|
+
export { DiagramEventHandlers, useDiagramEventHandlers };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const globalsCss = ".likec4-root{overflow:hidden;position:relative;padding:0;margin:0;width:100%;height:100%;border:0px solid transparent;container-name:likec4-root;container-type:size}.likec4-root .react-flow:is(.not-initialized){opacity:0}:where(.likec4-root .mantine-ActionIcon-icon) .tabler-icon{width:75%;height:75%}.likec4-root :where(.react-flow__node,.react-flow__edge,.likec4-edge-label-container):has([data-likec4-dimmed]){opacity:.25}.likec4-root:not([data-likec4-reduced-graphics]) :where(.react-flow__node,.react-flow__edge,.likec4-edge-label-container):has([data-likec4-dimmed]){filter:grayscale(85%) blur(3px)}.likec4-root:not([data-likec4-reduced-graphics]) :where(.react-flow__node,.react-flow__edge,.likec4-edge-label-container):has([data-likec4-dimmed=true]){transition-property:opacity,filter;transition-timing-function:cubic-bezier(.5,0,.2,1);transition-duration:.6s}[data-mantine-color-scheme=dark] .likec4-root:not([data-likec4-reduced-graphics]) :where(.react-flow__edges,.react-flow__edgelabel-renderer)>svg{mix-blend-mode:plus-lighter}[data-mantine-color-scheme=light] .likec4-root:not([data-likec4-reduced-graphics]) :where(.react-flow__edges,.react-flow__edgelabel-renderer)>svg{mix-blend-mode:screen}.likec4-root :where(.likec4-edge-container,.likec4-edge-label-container){--xy-edge-stroke-width: 3;--xy-edge-stroke: var(--likec4-palette-relation-stroke);--xy-edge-stroke-selected: var(--likec4-palette-relation-stroke-selected);--xy-edge-label-color: var(--likec4-palette-relation-label);--xy-edge-label-background-color: var(--likec4-palette-relation-label-bg)}.likec4-root :where(.likec4-edge-container,.likec4-edge-label-container):is([data-likec4-hovered=true],[data-edge-active=true]){--xy-edge-stroke-width: 4;--xy-edge-stroke: var(--likec4-palette-relation-stroke-selected)}[data-mantine-color-scheme=dark] .likec4-root :where(.likec4-edge-container,.likec4-edge-label-container){--xy-edge-label-background-color: color-mix(in srgb, var(--likec4-palette-relation-label-bg) 50%, transparent)}[data-mantine-color-scheme=light] .likec4-root :where(.likec4-edge-container,.likec4-edge-label-container){--xy-edge-label-color: color-mix(in srgb, var(--likec4-palette-relation-label), rgba(255 255 255 / .85) 40%);--xy-edge-label-background-color: color-mix(in srgb, var(--likec4-palette-relation-label-bg) 60%, transparent)}";
|
|
2
|
+
|
|
3
|
+
export { globalsCss as default };
|
|
@@ -3,7 +3,7 @@ import { Types } from '../likec4diagram/types';
|
|
|
3
3
|
import { EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
|
|
4
4
|
import { ReactNode, CSSProperties } from 'react';
|
|
5
5
|
import { Dimmed } from '../base/types.Base';
|
|
6
|
-
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId } from '@likec4/core';
|
|
6
|
+
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId, MarkdownOrString } from '@likec4/core';
|
|
7
7
|
export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
|
|
8
8
|
id: string;
|
|
9
9
|
source: string;
|
|
@@ -46,7 +46,7 @@ export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
|
|
|
46
46
|
tail: RelationshipArrowType | undefined;
|
|
47
47
|
labelBBox: BBox | null | undefined;
|
|
48
48
|
navigateTo: ViewId<string> | null | undefined;
|
|
49
|
-
notes:
|
|
49
|
+
notes: MarkdownOrString | undefined;
|
|
50
50
|
labelXY: XYPosition | null;
|
|
51
51
|
controlPoints: XYPosition[] | undefined | null;
|
|
52
52
|
};
|
|
@@ -96,7 +96,7 @@ export declare const useXYStoreApi: () => {
|
|
|
96
96
|
tail: RelationshipArrowType | undefined;
|
|
97
97
|
labelBBox: BBox | null | undefined;
|
|
98
98
|
navigateTo: ViewId<string> | null | undefined;
|
|
99
|
-
notes:
|
|
99
|
+
notes: MarkdownOrString | undefined;
|
|
100
100
|
labelXY: XYPosition | null;
|
|
101
101
|
controlPoints: XYPosition[] | undefined | null;
|
|
102
102
|
};
|
|
@@ -143,7 +143,7 @@ export declare const useXYStoreApi: () => {
|
|
|
143
143
|
tail: RelationshipArrowType | undefined;
|
|
144
144
|
labelBBox: BBox | null | undefined;
|
|
145
145
|
navigateTo: ViewId<string> | null | undefined;
|
|
146
|
-
notes:
|
|
146
|
+
notes: MarkdownOrString | undefined;
|
|
147
147
|
labelXY: XYPosition | null;
|
|
148
148
|
controlPoints: XYPosition[] | undefined | null;
|
|
149
149
|
};
|
|
@@ -189,7 +189,7 @@ export declare const useXYStoreApi: () => {
|
|
|
189
189
|
tail: RelationshipArrowType | undefined;
|
|
190
190
|
labelBBox: BBox | null | undefined;
|
|
191
191
|
navigateTo: ViewId<string> | null | undefined;
|
|
192
|
-
notes:
|
|
192
|
+
notes: MarkdownOrString | undefined;
|
|
193
193
|
labelXY: XYPosition | null;
|
|
194
194
|
controlPoints: XYPosition[] | undefined | null;
|
|
195
195
|
};
|
|
@@ -235,7 +235,7 @@ export declare const useXYStoreApi: () => {
|
|
|
235
235
|
tail: RelationshipArrowType | undefined;
|
|
236
236
|
labelBBox: BBox | null | undefined;
|
|
237
237
|
navigateTo: ViewId<string> | null | undefined;
|
|
238
|
-
notes:
|
|
238
|
+
notes: MarkdownOrString | undefined;
|
|
239
239
|
labelXY: XYPosition | null;
|
|
240
240
|
controlPoints: XYPosition[] | undefined | null;
|
|
241
241
|
};
|
|
@@ -281,7 +281,7 @@ export declare const useXYStoreApi: () => {
|
|
|
281
281
|
tail: RelationshipArrowType | undefined;
|
|
282
282
|
labelBBox: BBox | null | undefined;
|
|
283
283
|
navigateTo: ViewId<string> | null | undefined;
|
|
284
|
-
notes:
|
|
284
|
+
notes: MarkdownOrString | undefined;
|
|
285
285
|
labelXY: XYPosition | null;
|
|
286
286
|
controlPoints: XYPosition[] | undefined | null;
|
|
287
287
|
};
|
|
@@ -327,7 +327,7 @@ export declare const useXYStoreApi: () => {
|
|
|
327
327
|
tail: RelationshipArrowType | undefined;
|
|
328
328
|
labelBBox: BBox | null | undefined;
|
|
329
329
|
navigateTo: ViewId<string> | null | undefined;
|
|
330
|
-
notes:
|
|
330
|
+
notes: MarkdownOrString | undefined;
|
|
331
331
|
labelXY: XYPosition | null;
|
|
332
332
|
controlPoints: XYPosition[] | undefined | null;
|
|
333
333
|
};
|
|
@@ -374,7 +374,7 @@ export declare const useXYStoreApi: () => {
|
|
|
374
374
|
tail: RelationshipArrowType | undefined;
|
|
375
375
|
labelBBox: BBox | null | undefined;
|
|
376
376
|
navigateTo: ViewId<string> | null | undefined;
|
|
377
|
-
notes:
|
|
377
|
+
notes: MarkdownOrString | undefined;
|
|
378
378
|
labelXY: XYPosition | null;
|
|
379
379
|
controlPoints: XYPosition[] | undefined | null;
|
|
380
380
|
};
|
|
@@ -420,7 +420,7 @@ export declare const useXYStoreApi: () => {
|
|
|
420
420
|
tail: RelationshipArrowType | undefined;
|
|
421
421
|
labelBBox: BBox | null | undefined;
|
|
422
422
|
navigateTo: ViewId<string> | null | undefined;
|
|
423
|
-
notes:
|
|
423
|
+
notes: MarkdownOrString | undefined;
|
|
424
424
|
labelXY: XYPosition | null;
|
|
425
425
|
controlPoints: XYPosition[] | undefined | null;
|
|
426
426
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { IconRendererProvider } from './context/IconRenderer';
|
|
|
4
4
|
export { LikeC4Diagram, type LikeC4DiagramProps, } from './LikeC4Diagram';
|
|
5
5
|
export { Overlay, type OverlayProps, } from './overlays/overlay/Overlay';
|
|
6
6
|
export { LikeC4ModelProvider, type LikeC4ModelProviderProps, } from './LikeC4ModelProvider';
|
|
7
|
+
export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps, } from './LikeC4ProjectsProvider';
|
|
7
8
|
export * from './custom/hooks';
|
|
8
9
|
export type { ChangeEvent, CustomNodes, DiagramNodeWithNavigate, ElementIconRenderer, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, OnCanvasClick, OnChange, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, PaddingUnit, PaddingWithUnit, WhereOperator, } from './LikeC4Diagram.props';
|
|
9
10
|
export { StaticLikeC4Diagram, type StaticLikeC4DiagramProps, } from './StaticLikeC4Diagram';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { IconRendererProvider } from './context/IconRenderer.js';
|
|
|
3
3
|
export { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
4
4
|
export { Overlay } from './overlays/overlay/Overlay.js';
|
|
5
5
|
export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
|
|
6
|
+
export { LikeC4ProjectsProvider } from './LikeC4ProjectsProvider.js';
|
|
6
7
|
export { StaticLikeC4Diagram } from './StaticLikeC4Diagram.js';
|
|
7
8
|
export { useDiagramEventHandlers } from './context/DiagramEventHandlers.js';
|
|
8
9
|
export { useEnabledFeatures } from './context/DiagramFeatures.js';
|
|
@@ -2,6 +2,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { useOverlaysActorRef } from '../hooks/useOverlaysActor.js';
|
|
4
4
|
import { useSearchActorRef } from '../hooks/useSearchActor.js';
|
|
5
|
+
import { EnsureCurrentViewModel } from '../likec4model/LikeC4ModelContext.js';
|
|
5
6
|
import { Overlays } from '../overlays/Overlays.js';
|
|
6
7
|
import { Search } from '../search/Search.js';
|
|
7
8
|
import { useEnabledFeatures } from '../context/DiagramFeatures.js';
|
|
@@ -22,7 +23,7 @@ const DiagramUI = memo(() => {
|
|
|
22
23
|
const overlaysActorRef = useOverlaysActorRef();
|
|
23
24
|
const searchActorRef = useSearchActorRef();
|
|
24
25
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
enableControls === "next" ? /* @__PURE__ */ jsx(NavigationPanel, {}) : /* @__PURE__ */ jsx(Controls, {}),
|
|
26
|
+
enableControls === "next" ? /* @__PURE__ */ jsx(EnsureCurrentViewModel, { children: /* @__PURE__ */ jsx(NavigationPanel, {}) }) : /* @__PURE__ */ jsx(Controls, {}),
|
|
26
27
|
overlaysActorRef && /* @__PURE__ */ jsx(Overlays, { overlaysActorRef }),
|
|
27
28
|
enableNotations && /* @__PURE__ */ jsx(NotationPanel, {}),
|
|
28
29
|
enableControls !== "next" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId } from '@likec4/core';
|
|
1
|
+
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId, MarkdownOrString } from '@likec4/core';
|
|
2
2
|
import { XYPosition } from '@xyflow/react';
|
|
3
3
|
import { FunctionComponent, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { Position } from '@xyflow/system';
|
|
@@ -45,7 +45,7 @@ export declare const RelationshipEdge: FunctionComponent<{
|
|
|
45
45
|
tail: RelationshipArrowType | undefined;
|
|
46
46
|
labelBBox: BBox | null | undefined;
|
|
47
47
|
navigateTo: ViewId<string> | null | undefined;
|
|
48
|
-
notes:
|
|
48
|
+
notes: MarkdownOrString | undefined;
|
|
49
49
|
labelXY: XYPosition | null;
|
|
50
50
|
controlPoints: XYPosition[] | undefined | null;
|
|
51
51
|
};
|
|
@@ -257,7 +257,7 @@ const RelationshipEdge = customEdge((props) => {
|
|
|
257
257
|
if (!isControlPointDragging && !isPanning) {
|
|
258
258
|
const notes = props.data.notes;
|
|
259
259
|
if (notes && activeWalkthroughStep === props.id) {
|
|
260
|
-
edgeLabel = /* @__PURE__ */ jsx(NotePopover, { notes, children: edgeLabel });
|
|
260
|
+
edgeLabel = /* @__PURE__ */ jsx(NotePopover, { notes: notes.txt ?? notes.md, children: edgeLabel });
|
|
261
261
|
} else if (enableRelationshipDetails) {
|
|
262
262
|
edgeLabel = /* @__PURE__ */ jsx(
|
|
263
263
|
RelationshipsDropdownMenu,
|
|
@@ -6,24 +6,24 @@ const menuDropdown = css({
|
|
|
6
6
|
maxWidth: "min(90vw, 500px)"
|
|
7
7
|
});
|
|
8
8
|
const menuItemRelationship = css({
|
|
9
|
-
gap:
|
|
9
|
+
gap: "1"
|
|
10
10
|
});
|
|
11
11
|
const endpoint = css({
|
|
12
12
|
display: "block",
|
|
13
13
|
fontSize: "xxs",
|
|
14
14
|
fontWeight: 500,
|
|
15
15
|
whiteSpace: "nowrap",
|
|
16
|
-
padding: "2px 4px",
|
|
17
|
-
borderRadius:
|
|
18
|
-
background: `likec4
|
|
16
|
+
padding: "[2px 4px]",
|
|
17
|
+
borderRadius: "[2px]",
|
|
18
|
+
background: `var(--likec4-palette-fill)/30`,
|
|
19
19
|
lineHeight: "[1.11]",
|
|
20
20
|
mixBlendMode: "hard-light",
|
|
21
21
|
color: {
|
|
22
|
-
_light: `[color-mix(in srgb,
|
|
23
|
-
_dark: "likec4
|
|
22
|
+
_light: `[color-mix(in srgb, var(--likec4-palette-stroke), {colors.likec4.mixColor} 60%)]`,
|
|
23
|
+
_dark: "var(--likec4-palette-loContrast)"
|
|
24
24
|
}
|
|
25
25
|
// _dark: {
|
|
26
|
-
// background: `likec4
|
|
26
|
+
// background: `var(--likec4-palette-fill)/60`,
|
|
27
27
|
// },
|
|
28
28
|
});
|
|
29
29
|
const title = css({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { nameFromFqn } from '@likec4/core';
|
|
3
|
-
import { cx
|
|
3
|
+
import { cx } from '@likec4/styles/css';
|
|
4
4
|
import { Menu, MenuTarget, MenuDropdown, MenuLabel, MenuDivider, Box, ActionIcon, MenuItem, Stack, Group, Text, TooltipGroup, Space, Tooltip as Tooltip$1 } from '@mantine/core';
|
|
5
5
|
import { memo, useCallback, Fragment as Fragment$1, forwardRef } from 'react';
|
|
6
6
|
import { pipe, map, filter, isTruthy, partition } from 'remeda';
|
|
@@ -155,9 +155,9 @@ const Relationship = forwardRef(({
|
|
|
155
155
|
const links = r.links;
|
|
156
156
|
return /* @__PURE__ */ jsxs(Stack, { ref, className: cx(menuItemRelationship, className), ...props, children: [
|
|
157
157
|
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
158
|
-
/* @__PURE__ */ jsx(Text, { component: "div",
|
|
158
|
+
/* @__PURE__ */ jsx(Text, { component: "div", "data-likec4-color": sourceNode.color, className: endpoint, children: sourceId }),
|
|
159
159
|
/* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size: "11px", opacity: 0.65 }),
|
|
160
|
-
/* @__PURE__ */ jsx(Text, { component: "div",
|
|
160
|
+
/* @__PURE__ */ jsx(Text, { component: "div", "data-likec4-color": targetNode.color, className: endpoint, children: targetId }),
|
|
161
161
|
(navigateTo || !!onOpenSource) && /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 100, children: [
|
|
162
162
|
/* @__PURE__ */ jsx(Space, { w: "xs" }),
|
|
163
163
|
navigateTo && /* @__PURE__ */ jsx(Tooltip, { label: "Open dynamic view", children: /* @__PURE__ */ jsx(
|
|
@@ -5,13 +5,13 @@ const controlPointsContainer = css({
|
|
|
5
5
|
overflow: "visible",
|
|
6
6
|
position: "absolute",
|
|
7
7
|
pointerEvents: "none",
|
|
8
|
-
top: 0,
|
|
9
|
-
left: 0,
|
|
8
|
+
top: "0",
|
|
9
|
+
left: "0",
|
|
10
10
|
mixBlendMode: "normal"
|
|
11
11
|
});
|
|
12
12
|
const controlPoint = css({
|
|
13
|
-
fill: `likec4
|
|
14
|
-
stroke: `likec4
|
|
13
|
+
fill: `var(--likec4-palette-relation-stroke)`,
|
|
14
|
+
stroke: `var(--likec4-palette-relation-stroke)`,
|
|
15
15
|
fillOpacity: 0.75,
|
|
16
16
|
strokeWidth: 1,
|
|
17
17
|
cursor: "grab",
|
|
@@ -3,7 +3,7 @@ import { MemoExoticComponent, FunctionComponent, CSSProperties, ReactNode } from
|
|
|
3
3
|
import { NodeProps } from '../../base';
|
|
4
4
|
import { Position, XYPosition } from '@xyflow/system';
|
|
5
5
|
import { EdgeData, Dimmed } from '../../base/types.Base';
|
|
6
|
-
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId } from '@likec4/core';
|
|
6
|
+
import { EdgeId, NonEmptyArray, Point, Color, RelationshipArrowType, RelationshipLineType, BBox, ViewId, MarkdownOrString } from '@likec4/core';
|
|
7
7
|
export declare const BuiltinNodes: {
|
|
8
8
|
element: MemoExoticComponent<(props: NodeProps<Types.ElementNodeData, "element">) => import("react/jsx-runtime").JSX.Element>;
|
|
9
9
|
deployment: MemoExoticComponent<(props: NodeProps<Types.DeploymentElementNodeData, "deployment">) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -54,7 +54,7 @@ export declare const edgeTypes: {
|
|
|
54
54
|
tail: RelationshipArrowType | undefined;
|
|
55
55
|
labelBBox: BBox | null | undefined;
|
|
56
56
|
navigateTo: ViewId<string> | null | undefined;
|
|
57
|
-
notes:
|
|
57
|
+
notes: MarkdownOrString | undefined;
|
|
58
58
|
labelXY: XYPosition | null;
|
|
59
59
|
controlPoints: XYPosition[] | undefined | null;
|
|
60
60
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css';
|
|
2
2
|
|
|
3
3
|
const navigationButtons = css({
|
|
4
|
-
gap: "
|
|
4
|
+
gap: "xxs",
|
|
5
5
|
_empty: {
|
|
6
6
|
display: "none"
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
const panel = css({
|
|
10
|
-
top: "
|
|
11
|
-
left: "
|
|
12
|
-
margin: 0,
|
|
10
|
+
top: "md",
|
|
11
|
+
left: "md",
|
|
12
|
+
margin: "0",
|
|
13
13
|
pointerEvents: "none",
|
|
14
14
|
"& :where(button, .action-icon, [role='dialog'])": {
|
|
15
15
|
pointerEvents: "all"
|
|
@@ -43,7 +43,7 @@ const autolayoutButton = css({
|
|
|
43
43
|
flex: "1 1 40%",
|
|
44
44
|
textAlign: "center",
|
|
45
45
|
fontWeight: 500,
|
|
46
|
-
padding: "4px 6px",
|
|
46
|
+
padding: "[4px 6px]",
|
|
47
47
|
fontSize: "11px",
|
|
48
48
|
zIndex: 1
|
|
49
49
|
});
|
|
@@ -5,8 +5,8 @@ import { useLocalStorage } from '@mantine/hooks';
|
|
|
5
5
|
import { AnimatePresence, m } from 'motion/react';
|
|
6
6
|
import { Link } from '../../../components/Link.js';
|
|
7
7
|
import { useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
8
|
+
import { useOptionalCurrentViewModel } from '../../../likec4model/useCurrentViewModel.js';
|
|
8
9
|
import { card, title, description } from './DiagramTitlePanel.css.js';
|
|
9
|
-
import { useCurrentViewModel } from '../../../likec4model/useCurrentViewModel.js';
|
|
10
10
|
import IconMenu from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js';
|
|
11
11
|
import { MarkdownBlock } from '../../../base/primitives/MarkdownBlock.js';
|
|
12
12
|
|
|
@@ -20,15 +20,15 @@ function selector(context) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function DiagramTitlePanel() {
|
|
23
|
-
const view =
|
|
23
|
+
const view = useOptionalCurrentViewModel();
|
|
24
24
|
const { isNotActiveWalkthrough } = useDiagramContext(selector);
|
|
25
25
|
const [isCollapsed, setCollapsed] = useLocalStorage({
|
|
26
26
|
key: "diagram-title-webview-collapsed",
|
|
27
27
|
defaultValue: false
|
|
28
28
|
});
|
|
29
|
-
const title$1 = view
|
|
29
|
+
const title$1 = view?.title ?? "untitled";
|
|
30
30
|
const toggle = () => setCollapsed((v) => !v);
|
|
31
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isNotActiveWalkthrough && /* @__PURE__ */ jsx(
|
|
31
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: view && isNotActiveWalkthrough && /* @__PURE__ */ jsx(
|
|
32
32
|
m.div,
|
|
33
33
|
{
|
|
34
34
|
initial: { opacity: 0.05, scale: 0.7 },
|