@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
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isStepEdgeId, extractStep } from '@likec4/core';
|
|
3
|
-
import { cx } from '@likec4/styles/css';
|
|
3
|
+
import { cx, css } from '@likec4/styles/css';
|
|
4
4
|
import { Box } from '@likec4/styles/jsx';
|
|
5
|
-
import {
|
|
5
|
+
import { edgeLabel } from '@likec4/styles/recipes';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
import { isTruthy } from 'remeda';
|
|
8
|
-
import { labelsva } from './EdgeLabel.css.js';
|
|
9
8
|
|
|
10
9
|
const EdgeLabel = forwardRef(({
|
|
11
10
|
edgeProps: {
|
|
@@ -21,14 +20,25 @@ const EdgeLabel = forwardRef(({
|
|
|
21
20
|
...rest
|
|
22
21
|
}, ref) => {
|
|
23
22
|
const stepNum = isStepEdgeId(id) ? extractStep(id) : null;
|
|
24
|
-
const classes =
|
|
23
|
+
const classes = edgeLabel({
|
|
25
24
|
isStepEdge: stepNum !== null
|
|
26
25
|
});
|
|
27
26
|
return /* @__PURE__ */ jsxs(Box, { ref, className: cx(classes.root, className), ...rest, children: [
|
|
28
27
|
stepNum !== null && /* @__PURE__ */ jsx(Box, { className: classes.stepNumber, children: stepNum }),
|
|
29
28
|
/* @__PURE__ */ jsxs(Box, { className: classes.labelContents, children: [
|
|
30
|
-
isTruthy(label) && /* @__PURE__ */ jsx(
|
|
31
|
-
|
|
29
|
+
isTruthy(label) && /* @__PURE__ */ jsx(
|
|
30
|
+
Box,
|
|
31
|
+
{
|
|
32
|
+
className: cx(
|
|
33
|
+
classes.labelText,
|
|
34
|
+
css({
|
|
35
|
+
lineClamp: 5
|
|
36
|
+
})
|
|
37
|
+
),
|
|
38
|
+
children: label
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
isTruthy(technology) && /* @__PURE__ */ jsx(Box, { className: classes.labelTechnology, children: "[ " + technology + " ]" }),
|
|
32
42
|
children
|
|
33
43
|
] })
|
|
34
44
|
] });
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { cx
|
|
2
|
+
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { EdgeLabelRenderer } from '@xyflow/react';
|
|
4
4
|
import { isNumber } from 'remeda';
|
|
5
5
|
import { ZIndexes } from '../../const.js';
|
|
6
|
-
import { edgeVars } from './edge.css.js';
|
|
7
6
|
import { translate, edgeLabelContainer } from './EdgeLabel.css.js';
|
|
8
7
|
|
|
9
8
|
const toCssVarValue = (value) => {
|
|
@@ -40,10 +39,6 @@ function EdgeLabelContainer({
|
|
|
40
39
|
"div",
|
|
41
40
|
{
|
|
42
41
|
className: cx(
|
|
43
|
-
css({
|
|
44
|
-
likec4RelationPalette: color
|
|
45
|
-
}),
|
|
46
|
-
edgeVars,
|
|
47
42
|
edgeLabelContainer,
|
|
48
43
|
"nodrag nopan",
|
|
49
44
|
"likec4-edge-label-container",
|
|
@@ -83,7 +83,7 @@ const OArrow = (props) => /* @__PURE__ */ jsx(
|
|
|
83
83
|
{
|
|
84
84
|
d: "M 0 0 L 8 3 L 0 6 L 1 3 z",
|
|
85
85
|
stroke: "context-stroke",
|
|
86
|
-
fill: "
|
|
86
|
+
fill: "context-stroke",
|
|
87
87
|
strokeWidth: 1.25,
|
|
88
88
|
strokeLinejoin: "miter",
|
|
89
89
|
strokeLinecap: "square"
|
|
@@ -129,7 +129,7 @@ const ODiamond = (props) => /* @__PURE__ */ jsx(
|
|
|
129
129
|
{
|
|
130
130
|
d: "M5,0 L10,4 L5,8 L0,4 Z",
|
|
131
131
|
stroke: "context-stroke",
|
|
132
|
-
fill: "
|
|
132
|
+
fill: "context-stroke",
|
|
133
133
|
strokeWidth: 1.25,
|
|
134
134
|
strokeLinecap: "round"
|
|
135
135
|
}
|
|
@@ -171,7 +171,7 @@ const ODot = (props) => /* @__PURE__ */ jsx(
|
|
|
171
171
|
{
|
|
172
172
|
strokeWidth: 1.25,
|
|
173
173
|
stroke: "context-stroke",
|
|
174
|
-
fill: "
|
|
174
|
+
fill: "context-stroke",
|
|
175
175
|
cx: 4,
|
|
176
176
|
cy: 4,
|
|
177
177
|
r: 3
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare const edgeVars: string;
|
|
2
1
|
export declare const edgeContainer: string;
|
|
3
2
|
export declare const hideOnReducedGraphics: string;
|
|
4
3
|
export declare const edgePathBg: string;
|
|
5
4
|
export declare const markerContext: string;
|
|
6
5
|
export declare const cssEdgePath: string;
|
|
7
|
-
export declare const actionBtn: string;
|
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css';
|
|
2
2
|
|
|
3
3
|
const isSelected = ".react-flow__edge.selected";
|
|
4
|
-
const edgeStroke = "--xy-edge-stroke";
|
|
5
|
-
const edgeStrokeSelected = "--xy-edge-stroke-selected";
|
|
6
|
-
const labelColor = "--xy-edge-label-color";
|
|
7
|
-
const labelBg = "--xy-edge-label-background-color";
|
|
8
|
-
const edgeVars = css({
|
|
9
|
-
[edgeStroke]: "{colors.likec4.relation.stroke}",
|
|
10
|
-
[edgeStrokeSelected]: "{colors.likec4.relation.stroke.selected}",
|
|
11
|
-
[labelColor]: {
|
|
12
|
-
base: "{colors.likec4.relation.label}",
|
|
13
|
-
_light: `color-mix(in srgb, {colors.likec4.relation.label}, rgba(255 255 255 / 0.85) 40%)`
|
|
14
|
-
},
|
|
15
|
-
[labelBg]: {
|
|
16
|
-
_light: `{colors.likec4.relation.label.bg/60}`,
|
|
17
|
-
_dark: `{colors.likec4.relation.label.bg/50}`
|
|
18
|
-
},
|
|
19
|
-
["--xy-edge-stroke-width"]: "3",
|
|
20
|
-
"&:is([data-likec4-hovered='true'],[data-edge-active='true'])": {
|
|
21
|
-
[edgeStroke]: "{colors.likec4.relation.stroke.selected}",
|
|
22
|
-
_whenSelected: {
|
|
23
|
-
["--xy-edge-stroke-width"]: "4"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
4
|
const edgeContainer = css({
|
|
28
5
|
_reduceGraphics: {
|
|
29
6
|
transition: "none"
|
|
@@ -90,36 +67,5 @@ const cssEdgePath = css({
|
|
|
90
67
|
animationName: "none"
|
|
91
68
|
}
|
|
92
69
|
});
|
|
93
|
-
const aiBg = {
|
|
94
|
-
var: "--ai-bg"};
|
|
95
|
-
const actionBtn = css({
|
|
96
|
-
// zIndex: 'calc(var(--layer-overlays, 1) + 1)',
|
|
97
|
-
pointerEvents: "all",
|
|
98
|
-
// color: `xyedge.label`,
|
|
99
|
-
cursor: "pointer",
|
|
100
|
-
opacity: 0.75,
|
|
101
|
-
transition: "fast",
|
|
102
|
-
// backgroundColor: aiBg.ref,
|
|
103
|
-
[aiBg.var]: "var(--xy-edge-label-background-color)",
|
|
104
|
-
"--ai-hover": `color-mix(in srgb , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
|
|
105
|
-
"--ai-size": `var(--ai-size-sm)`,
|
|
106
|
-
"--ai-radius": `var(--mantine-radius-sm)`,
|
|
107
|
-
_hover: {
|
|
108
|
-
translateY: "1px",
|
|
109
|
-
scale: 1.15
|
|
110
|
-
},
|
|
111
|
-
_active: {
|
|
112
|
-
translateY: "-1px",
|
|
113
|
-
scale: "0.9"
|
|
114
|
-
},
|
|
115
|
-
_whenHovered: {
|
|
116
|
-
opacity: 1
|
|
117
|
-
},
|
|
118
|
-
"& .tabler-icon": {
|
|
119
|
-
width: "80%",
|
|
120
|
-
height: "80%",
|
|
121
|
-
strokeWidth: "2"
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
70
|
|
|
125
|
-
export {
|
|
71
|
+
export { cssEdgePath, edgeContainer, edgePathBg, hideOnReducedGraphics, markerContext };
|
|
@@ -11,9 +11,9 @@ import { stopPropagation } from '../../../utils/xyflow.js';
|
|
|
11
11
|
const container = css({
|
|
12
12
|
position: "absolute",
|
|
13
13
|
zIndex: 1,
|
|
14
|
-
top: `calc(100% - 30px)`,
|
|
14
|
+
top: `[calc(100% - 30px)]`,
|
|
15
15
|
transform: "translateX(-50%)",
|
|
16
|
-
left: `50
|
|
16
|
+
left: `[50%]`,
|
|
17
17
|
width: "auto",
|
|
18
18
|
minHeight: "30px",
|
|
19
19
|
display: "flex",
|
|
@@ -10,20 +10,21 @@ import IconId from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react
|
|
|
10
10
|
|
|
11
11
|
const container = css({
|
|
12
12
|
position: "absolute",
|
|
13
|
-
top:
|
|
14
|
-
right:
|
|
13
|
+
top: "0.5",
|
|
14
|
+
right: "0.5",
|
|
15
15
|
_shapeBrowser: {
|
|
16
|
-
right: "5px"
|
|
16
|
+
right: "[5px]"
|
|
17
17
|
},
|
|
18
18
|
_shapeCylinder: {
|
|
19
|
-
top: "14px"
|
|
19
|
+
top: "[14px]"
|
|
20
20
|
},
|
|
21
21
|
_shapeStorage: {
|
|
22
|
-
top: "14px"
|
|
22
|
+
top: "[14px]"
|
|
23
23
|
},
|
|
24
24
|
_shapeQueue: {
|
|
25
|
-
top: "1px",
|
|
26
|
-
right: "
|
|
25
|
+
top: "[1px]",
|
|
26
|
+
right: "3"
|
|
27
|
+
// 12px
|
|
27
28
|
},
|
|
28
29
|
_smallZoom: {
|
|
29
30
|
display: "none"
|
|
@@ -4,8 +4,8 @@ const container = css({
|
|
|
4
4
|
position: "relative",
|
|
5
5
|
width: "100%",
|
|
6
6
|
height: "100%",
|
|
7
|
-
padding: 0,
|
|
8
|
-
margin: 0,
|
|
7
|
+
padding: "0",
|
|
8
|
+
margin: "0",
|
|
9
9
|
display: "flex",
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
justifyContent: "center",
|
|
@@ -13,8 +13,8 @@ const container = css({
|
|
|
13
13
|
_before: {
|
|
14
14
|
content: '" "',
|
|
15
15
|
position: "absolute",
|
|
16
|
-
top: "calc(100% - 4px)",
|
|
17
|
-
left: 0,
|
|
16
|
+
top: "[calc(100% - 4px)]",
|
|
17
|
+
left: "0",
|
|
18
18
|
width: "100%",
|
|
19
19
|
height: "24px",
|
|
20
20
|
background: "[transparent]",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { DefaultShapeSize, DefaultTextSize, DefaultPaddingSize } from '@likec4/core/types';
|
|
3
|
-
import { cx
|
|
3
|
+
import { cx } from '@likec4/styles/css';
|
|
4
4
|
import * as m from 'motion/react-m';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { container } from './ElementNodeContainer.css.js';
|
|
@@ -62,9 +62,6 @@ const ElementNodeContainer = forwardRef(({
|
|
|
62
62
|
{
|
|
63
63
|
ref,
|
|
64
64
|
className: cx(
|
|
65
|
-
css({
|
|
66
|
-
likec4Palette: data.color
|
|
67
|
-
}),
|
|
68
65
|
container,
|
|
69
66
|
"group",
|
|
70
67
|
"likec4-element-node",
|
|
@@ -4,14 +4,14 @@ const indicator = css({
|
|
|
4
4
|
_smallZoom: {
|
|
5
5
|
visibility: "hidden"
|
|
6
6
|
},
|
|
7
|
-
stroke: "likec4
|
|
7
|
+
stroke: "var(--likec4-palette-loContrast)",
|
|
8
8
|
fill: "[none]",
|
|
9
9
|
strokeWidth: 8,
|
|
10
10
|
strokeOpacity: 0.8,
|
|
11
11
|
visibility: "hidden",
|
|
12
12
|
pointerEvents: "none",
|
|
13
13
|
_light: {
|
|
14
|
-
stroke: `[color-mix(in srgb,
|
|
14
|
+
stroke: `[color-mix(in srgb, var(--likec4-palette-fill) 50%,rgb(121, 121, 121))]`
|
|
15
15
|
},
|
|
16
16
|
_whenFocused: {
|
|
17
17
|
visibility: "visible"
|
|
@@ -25,26 +25,26 @@ const indicator = css({
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
const fillElementFill = css({
|
|
28
|
-
fill: "likec4
|
|
28
|
+
fill: "var(--likec4-palette-fill)"
|
|
29
29
|
});
|
|
30
30
|
css({
|
|
31
|
-
fill: "likec4
|
|
31
|
+
fill: "var(--likec4-palette-stroke)"
|
|
32
32
|
});
|
|
33
33
|
const fillMixStroke = css({
|
|
34
|
-
fill: "[color-mix(in srgb,
|
|
34
|
+
fill: "[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]",
|
|
35
35
|
".shape-svg-multiple &": {
|
|
36
|
-
fill: "likec4
|
|
36
|
+
fill: "var(--likec4-palette-fill)"
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const shapeBase = css.raw({
|
|
40
|
-
top: 0,
|
|
41
|
-
left: 0,
|
|
40
|
+
top: "0",
|
|
41
|
+
left: "0",
|
|
42
42
|
position: "absolute",
|
|
43
43
|
width: "100%",
|
|
44
44
|
height: "100%",
|
|
45
45
|
pointerEvents: "none",
|
|
46
|
-
fill: "likec4
|
|
47
|
-
stroke: "likec4
|
|
46
|
+
fill: "var(--likec4-palette-fill)",
|
|
47
|
+
stroke: "var(--likec4-palette-stroke)",
|
|
48
48
|
overflow: "visible"
|
|
49
49
|
// zIndex is removed to improve rendering performance
|
|
50
50
|
// this forces to keep shape in the same layer as the node
|
|
@@ -75,7 +75,7 @@ const shapeSvg = css(shapeBase, {
|
|
|
75
75
|
transitionDelay: "0ms",
|
|
76
76
|
filter: `
|
|
77
77
|
drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
|
|
78
|
-
drop-shadow(0 1px 1px color-mix(in srgb,
|
|
78
|
+
drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))
|
|
79
79
|
drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
|
|
80
80
|
`,
|
|
81
81
|
_whenHovered: {
|
|
@@ -3,6 +3,7 @@ import { NodeProps } from '../../types';
|
|
|
3
3
|
import { ForwardRefExoticComponent, RefAttributes, MemoExoticComponent } from 'react';
|
|
4
4
|
export type ElementTagProps = {
|
|
5
5
|
tag: string;
|
|
6
|
+
cursor?: 'pointer' | 'default';
|
|
6
7
|
} & Omit<BoxProps, 'children'>;
|
|
7
8
|
export declare const ElementTag: ForwardRefExoticComponent<Omit<ElementTagProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
8
9
|
type Data = {
|
|
@@ -14,7 +14,7 @@ import { useCurrentZoom } from '../../../hooks/useXYFlow.js';
|
|
|
14
14
|
import { stopPropagation } from '../../../utils/xyflow.js';
|
|
15
15
|
|
|
16
16
|
const ElementTag = forwardRef(
|
|
17
|
-
({ tag, className, ...props }, ref) => {
|
|
17
|
+
({ tag, cursor = "default", className, ...props }, ref) => {
|
|
18
18
|
const spec = useTagSpecification(tag);
|
|
19
19
|
return /* @__PURE__ */ jsxs(
|
|
20
20
|
Box,
|
|
@@ -28,8 +28,9 @@ const ElementTag = forwardRef(
|
|
|
28
28
|
className
|
|
29
29
|
),
|
|
30
30
|
...props,
|
|
31
|
+
style: { cursor },
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */ jsx("span", {
|
|
33
|
+
/* @__PURE__ */ jsx("span", { children: "#" }),
|
|
33
34
|
/* @__PURE__ */ jsx("span", { children: tag })
|
|
34
35
|
]
|
|
35
36
|
}
|
|
@@ -79,23 +80,23 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
79
80
|
"likec4-element-tags",
|
|
80
81
|
hstack({
|
|
81
82
|
pointerEvents: "all",
|
|
82
|
-
gap:
|
|
83
|
+
gap: "1",
|
|
83
84
|
alignItems: "flex-end",
|
|
84
85
|
justifyItems: "stretch",
|
|
85
86
|
position: "absolute",
|
|
86
87
|
width: "100%",
|
|
87
|
-
bottom: 0,
|
|
88
|
-
left: 0,
|
|
89
|
-
padding:
|
|
88
|
+
bottom: "0",
|
|
89
|
+
left: "0",
|
|
90
|
+
padding: "1",
|
|
90
91
|
_shapeCylinder: {
|
|
91
|
-
bottom:
|
|
92
|
+
bottom: "[5px]"
|
|
92
93
|
},
|
|
93
94
|
_shapeStorage: {
|
|
94
|
-
bottom:
|
|
95
|
+
bottom: "[5px]"
|
|
95
96
|
},
|
|
96
97
|
_shapeQueue: {
|
|
97
|
-
bottom: 0,
|
|
98
|
-
paddingLeft:
|
|
98
|
+
bottom: "0",
|
|
99
|
+
paddingLeft: "[14px]"
|
|
99
100
|
}
|
|
100
101
|
})
|
|
101
102
|
),
|
|
@@ -129,11 +130,12 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
129
130
|
{
|
|
130
131
|
ref: tagsToolbarRef,
|
|
131
132
|
css: {
|
|
132
|
-
gap:
|
|
133
|
+
gap: "0.5",
|
|
134
|
+
alignItems: "baseline",
|
|
133
135
|
flexWrap: "wrap",
|
|
134
136
|
pb: "sm",
|
|
135
137
|
translate: "auto",
|
|
136
|
-
x: -
|
|
138
|
+
x: "[-8px]",
|
|
137
139
|
maxWidth
|
|
138
140
|
},
|
|
139
141
|
children: tags.map((tag) => /* @__PURE__ */ jsx(
|
|
@@ -145,8 +147,9 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
|
|
|
145
147
|
cursor: "pointer",
|
|
146
148
|
...zoomIsLargeEnough && {
|
|
147
149
|
fontSize: "lg",
|
|
148
|
-
borderRadius:
|
|
149
|
-
px:
|
|
150
|
+
borderRadius: "[4px]",
|
|
151
|
+
px: "1.5"
|
|
152
|
+
// 6px
|
|
150
153
|
}
|
|
151
154
|
}),
|
|
152
155
|
onClick: (e) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import { aux } from '@likec4/core/types';
|
|
1
2
|
import { LikeC4ViewProps } from './LikeC4View.props';
|
|
2
|
-
import type * as aux from '@likec4/core/types/_aux';
|
|
3
3
|
export declare function LikeC4View<A extends aux.Any = aux.UnknownLayouted>({ viewId, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,6 +31,12 @@ function LikeC4View({
|
|
|
31
31
|
}
|
|
32
32
|
return /* @__PURE__ */ jsx(LikeC4ViewInner, { view: view.$view, ...props });
|
|
33
33
|
}
|
|
34
|
+
const DEFAULT_BROWSER_PADDING = {
|
|
35
|
+
top: "50px",
|
|
36
|
+
bottom: "16px",
|
|
37
|
+
left: "16px",
|
|
38
|
+
right: "16px"
|
|
39
|
+
};
|
|
34
40
|
const LikeC4ViewInner = memo(({
|
|
35
41
|
view,
|
|
36
42
|
className,
|
|
@@ -152,7 +158,7 @@ const LikeC4ViewInner = memo(({
|
|
|
152
158
|
controls: "next",
|
|
153
159
|
readonly: true,
|
|
154
160
|
fitView: true,
|
|
155
|
-
fitViewPadding:
|
|
161
|
+
fitViewPadding: DEFAULT_BROWSER_PADDING,
|
|
156
162
|
...props,
|
|
157
163
|
...browserProps,
|
|
158
164
|
showNotations: (browserProps.showNotations ?? true) && (browserView.notation?.nodes.length ?? 0) > 0,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { WhereOperator } from '@likec4/core/types';
|
|
1
|
+
import { aux, WhereOperator } from '@likec4/core/types';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
3
|
import { CustomNodes, ElementIconRenderer, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from '../LikeC4Diagram.props';
|
|
4
|
-
import type * as aux from '@likec4/core/types/_aux';
|
|
5
4
|
export interface LikeC4ViewProps<A extends aux.Any> {
|
|
6
5
|
/**
|
|
7
6
|
* View to display.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { aux } from '@likec4/core/types';
|
|
1
2
|
import { CSSProperties } from 'react';
|
|
2
3
|
import { LikeC4DiagramProps } from '../LikeC4Diagram';
|
|
3
|
-
import type * as aux from '@likec4/core/types/_aux';
|
|
4
4
|
export type ReactLikeC4Props<A extends aux.Any> = Omit<LikeC4DiagramProps<A>, 'view'> & {
|
|
5
5
|
viewId: aux.ViewId<A>;
|
|
6
6
|
/**
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type { ChangeEvent, CustomNodes, DiagramNodeWithNavigate, ElementIconRend
|
|
|
2
2
|
export { LikeC4View } from './LikeC4View';
|
|
3
3
|
export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props';
|
|
4
4
|
export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4';
|
|
5
|
-
export {
|
|
5
|
+
export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider';
|
|
6
|
+
export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider';
|
|
6
7
|
export { ViewNotFound } from './ViewNotFound';
|
|
7
8
|
export * from '../custom/hooks';
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { LikeC4View } from './LikeC4View.js';
|
|
2
2
|
export { ReactLikeC4 } from './ReactLikeC4.js';
|
|
3
|
+
export { LikeC4ProjectsProvider } from '../LikeC4ProjectsProvider.js';
|
|
3
4
|
export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
|
|
4
5
|
export { ViewNotFound } from './ViewNotFound.js';
|
|
5
6
|
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
@@ -12,7 +12,7 @@ const DefaultTheme = createTheme({
|
|
|
12
12
|
primaryColor: "indigo",
|
|
13
13
|
cursorType: "pointer",
|
|
14
14
|
defaultRadius: "sm",
|
|
15
|
-
fontFamily: "var(--
|
|
15
|
+
fontFamily: "var(--likec4-app-font, var(--likec4-app-font-default))",
|
|
16
16
|
headings: {
|
|
17
17
|
fontWeight: "500",
|
|
18
18
|
sizes: {
|
|
@@ -6,7 +6,7 @@ import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1
|
|
|
6
6
|
|
|
7
7
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
8
8
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
9
|
-
return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: 0, left: 0, w: "100%", p: 0, style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
|
|
9
|
+
return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: "0", left: "0", w: "100%", p: "0", style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
|
|
10
10
|
Notification,
|
|
11
11
|
{
|
|
12
12
|
icon: /* @__PURE__ */ jsx(IconX, { style: { width: 16, height: 16 } }),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
const GithubIcon = forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
height: "24",
|
|
8
|
+
width: "24",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
...props,
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
ref,
|
|
13
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 1C5.923 1 1 5.923 1 12c0 4.867 3.149 8.979 7.521 10.436.55.096.756-.233.756-.522 0-.262-.013-1.128-.013-2.049-2.764.509-3.479-.674-3.699-1.292-.124-.317-.66-1.293-1.127-1.554-.385-.207-.936-.715-.014-.729.866-.014 1.485.797 1.691 1.128.99 1.663 2.571 1.196 3.204.907.096-.715.385-1.196.701-1.471-2.448-.275-5.005-1.224-5.005-5.432 0-1.196.426-2.186 1.128-2.956-.111-.275-.496-1.402.11-2.915 0 0 .921-.288 3.024 1.128a10.193 10.193 0 0 1 2.75-.371c.936 0 1.871.123 2.75.371 2.104-1.43 3.025-1.128 3.025-1.128.605 1.513.221 2.64.111 2.915.701.77 1.127 1.747 1.127 2.956 0 4.222-2.571 5.157-5.019 5.432.399.344.743 1.004.743 2.035 0 1.471-.014 2.654-.014 3.025 0 .289.206.632.756.522C19.851 20.979 23 16.854 23 12c0-6.077-4.922-11-11-11Z" })
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
export { GithubIcon };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Link as LinkData } from '@likec4/core';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { BadgeProps } from '@mantine/core';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export declare const Link: ForwardRefExoticComponent<Omit<BadgeProps, "children" | "classNames"> & {
|
|
4
5
|
value: LinkData;
|
|
5
|
-
}
|
|
6
|
+
} & RefAttributes<HTMLDivElement>>;
|