@likec4/diagram 1.15.0 → 1.15.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/diagram",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dagrejs/dagre": "^1.1.4",
|
|
34
|
-
"@likec4/core": "1.15.
|
|
34
|
+
"@likec4/core": "1.15.1",
|
|
35
35
|
"@mantine/vanilla-extract": "7.13.4",
|
|
36
36
|
"@react-hookz/web": "^24.0.4",
|
|
37
37
|
"@tabler/icons-react": "3.17.0",
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
"fast-equals": "^5.0.1",
|
|
48
48
|
"framer-motion": "^11.11.9",
|
|
49
49
|
"khroma": "^2.1.0",
|
|
50
|
-
"remeda": "^2.
|
|
50
|
+
"remeda": "^2.16.0",
|
|
51
51
|
"type-fest": "4.26.1",
|
|
52
52
|
"zustand": "^4.5.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@mantine/core": "^7.13.
|
|
56
|
-
"@mantine/hooks": "^7.13.
|
|
55
|
+
"@mantine/core": "^7.13.4",
|
|
56
|
+
"@mantine/hooks": "^7.13.4",
|
|
57
57
|
"react": "^18.3.1",
|
|
58
58
|
"react-dom": "^18.3.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@likec4/tsconfig": "1.15.
|
|
61
|
+
"@likec4/tsconfig": "1.15.1",
|
|
62
62
|
"@mantine/core": "7.13.4",
|
|
63
63
|
"@mantine/hooks": "7.13.4",
|
|
64
64
|
"@types/bezier-js": "^4.1.3",
|
|
@@ -47,6 +47,13 @@ globalStyle(`:where(${container}) .react-flow__node-compound`, {
|
|
|
47
47
|
mixBlendMode: 'hard-light'
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
+
globalStyle(`${container} .react-flow__edges > svg`, {
|
|
51
|
+
mixBlendMode: 'plus-lighter'
|
|
52
|
+
})
|
|
53
|
+
globalStyle(`:where([data-mantine-color-scheme="light"]) ${container} .react-flow__edges > svg`, {
|
|
54
|
+
mixBlendMode: 'screen'
|
|
55
|
+
})
|
|
56
|
+
|
|
50
57
|
// const dialogFadeIn = keyframes({
|
|
51
58
|
// '0%': {
|
|
52
59
|
// opacity: 0,
|
|
@@ -51,7 +51,7 @@ const Sizes = {
|
|
|
51
51
|
edgesep: 20
|
|
52
52
|
} satisfies GraphLabel,
|
|
53
53
|
edgeLabel: {
|
|
54
|
-
width:
|
|
54
|
+
width: 65
|
|
55
55
|
} satisfies Label,
|
|
56
56
|
|
|
57
57
|
emptyNodeOffset: 150,
|
|
@@ -465,9 +465,10 @@ function layout(
|
|
|
465
465
|
|
|
466
466
|
forEachIncoming(sourceId, relations) {
|
|
467
467
|
const source = createNode('incomers', 'element', likec4model.element(sourceId), ctx)
|
|
468
|
-
g.setEdge(graphId(source).port, subject.id
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
g.setEdge(graphId(source).port, subject.id, {
|
|
469
|
+
width: Sizes.edgeLabel.width,
|
|
470
|
+
weight: source.type === 'compound' ? 0 : 1
|
|
471
|
+
})
|
|
471
472
|
|
|
472
473
|
subject.data.ports.left.push({
|
|
473
474
|
id: source.id,
|
|
@@ -486,9 +487,11 @@ function layout(
|
|
|
486
487
|
|
|
487
488
|
forEachOutgoing(targetId, relations) {
|
|
488
489
|
const target = createNode('outgoers', 'element', likec4model.element(targetId), ctx)
|
|
489
|
-
g.setEdge(subjectElement.id, graphId(target).port
|
|
490
|
+
g.setEdge(subjectElement.id, graphId(target).port, {
|
|
491
|
+
width: Sizes.edgeLabel.width,
|
|
492
|
+
weight: target.type === 'compound' ? 1 : 2
|
|
493
|
+
})
|
|
490
494
|
|
|
491
|
-
// const op = target.type === 'compound' ? 'unshift' : 'push'
|
|
492
495
|
subject.data.ports.right.push({
|
|
493
496
|
id: target.id,
|
|
494
497
|
type: 'out'
|
|
@@ -515,8 +518,8 @@ function layout(
|
|
|
515
518
|
}
|
|
516
519
|
|
|
517
520
|
const subjectPortsCount = Math.max(subject.data.ports.left.length, subject.data.ports.right.length)
|
|
518
|
-
if (subjectPortsCount >
|
|
519
|
-
g.node(subjectElement.id).height = Sizes.hodeHeight + (subjectPortsCount -
|
|
521
|
+
if (subjectPortsCount > 3) {
|
|
522
|
+
g.node(subjectElement.id).height = Sizes.hodeHeight + (subjectPortsCount - 3) * 5
|
|
520
523
|
}
|
|
521
524
|
|
|
522
525
|
const nodebounds = applyDagreLayout(ctx.g)
|