@likec4/diagram 1.27.2 → 1.28.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/index.js +715 -616
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeActionButton.d.ts +1 -2
- package/dist/base/primitives/edge/EdgeLabelContainer.js +3 -2
- package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
- package/dist/base/primitives/element/ElementActionButtons.d.ts +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +11 -7
- package/dist/base/primitives/element/ElementDetailsButton.js +5 -1
- package/dist/bundle/styles.css.js +2 -2
- package/dist/hooks/useDiagram.d.ts +2 -2
- package/dist/hooks/useDiagram.js +9 -20
- package/dist/hooks/useXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +6 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +11 -1
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +0 -1
- package/dist/overlays/Overlays.js +2 -2
- package/dist/overlays/element-details/actor.d.ts +303 -303
- package/dist/overlays/overlay/Overlay.css.d.ts +2 -25
- package/dist/overlays/overlay/Overlay.css.js +3 -43
- package/dist/overlays/overlay/Overlay.d.ts +1 -1
- package/dist/overlays/overlay/Overlay.js +97 -90
- package/dist/overlays/overlaysActor.js +4 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/actor.d.ts +16 -7
- package/dist/overlays/relationship-details/actor.js +1 -6
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/hooks.d.ts +2 -3
- package/dist/overlays/relationship-details/hooks.js +2 -5
- package/dist/overlays/relationship-details/layout-to-xyflow.js +0 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.d.ts +2 -3
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.d.ts +2 -3
- package/dist/overlays/relationships-browser/hooks.js +5 -8
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -6
- package/dist/state/diagram-machine.d.ts +2 -2
- package/dist/state/hotkeyActor.js +12 -3
- package/dist/styles.css.js +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/package.json +10 -10
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -3
- package/src/base/primitives/edge/EdgeActionButton.tsx +1 -2
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +7 -5
- package/src/base/primitives/element/ElementActionButtons.tsx +11 -9
- package/src/base/primitives/element/ElementDetailsButton.tsx +4 -0
- package/src/base/primitives/element/ElementNodeContainer.css.ts +0 -18
- package/src/bundle/styles.css.ts +7 -2
- package/src/components/SearchControl.css.ts +4 -8
- package/src/hooks/useDiagram.ts +9 -20
- package/src/likec4diagram/DiagramXYFlow.tsx +6 -6
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +7 -1
- package/src/likec4diagram/custom/edges/edges.css.ts +0 -2
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +0 -4
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +0 -1
- package/src/likec4diagram/ui/search/ViewsColumn.css.ts +0 -4
- package/src/overlays/Overlays.tsx +3 -3
- package/src/overlays/overlay/Overlay.css.ts +3 -43
- package/src/overlays/overlay/Overlay.tsx +108 -101
- package/src/overlays/overlaysActor.ts +5 -1
- package/src/overlays/relationship-details/actor.ts +1 -6
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationship-details/hooks.ts +2 -5
- package/src/overlays/relationship-details/layout-to-xyflow.ts +2 -25
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/hooks.ts +5 -8
- package/src/overlays/relationships-browser/layout.ts +3 -20
- package/src/state/hotkeyActor.ts +13 -3
- package/src/utils/index.ts +0 -1
- package/dist/utils/types.d.ts +0 -8
- package/src/utils/types.ts +0 -6
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { AddEdgeData, AddNodeData } from './types';
|
|
2
1
|
export { vector, VectorImpl } from './vector';
|
|
3
2
|
export type { Vector } from './vector';
|
|
4
3
|
export { bezierControlPoints, bezierPath, centerXYInternalNode, distance, distanceBetweenPoints, isInside, isSamePoint, nodeToRect, stopPropagation, toDomPrecision, } from './xyflow';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/diagram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -48,23 +48,23 @@
|
|
|
48
48
|
"@react-hookz/web": "^25.1.0",
|
|
49
49
|
"@tabler/icons-react": "3.31.0",
|
|
50
50
|
"@xstate/react": "^5.0.3",
|
|
51
|
-
"@xyflow/react": "^12.5.
|
|
51
|
+
"@xyflow/react": "^12.5.3",
|
|
52
52
|
"@xyflow/system": "^0.0.53",
|
|
53
53
|
"bezier-js": "^6.1.4",
|
|
54
54
|
"clsx": "^2.1.1",
|
|
55
55
|
"d3-shape": "^3.2.0",
|
|
56
56
|
"fast-equals": "^5.2.2",
|
|
57
|
-
"framer-motion": "^12.6.
|
|
57
|
+
"framer-motion": "^12.6.3",
|
|
58
58
|
"nanostores": "0.11.4",
|
|
59
59
|
"react": "^19.0.0",
|
|
60
60
|
"react-dom": "^19.0.0",
|
|
61
61
|
"react-error-boundary": "^5.0.0",
|
|
62
62
|
"react-shadow": "^20.6.0",
|
|
63
63
|
"remeda": "^2.21.2",
|
|
64
|
-
"type-fest": "^4.
|
|
64
|
+
"type-fest": "^4.39.1",
|
|
65
65
|
"xstate": "^5.19.2",
|
|
66
|
-
"@likec4/core": "1.
|
|
67
|
-
"@likec4/styles": "1.
|
|
66
|
+
"@likec4/core": "1.28.0",
|
|
67
|
+
"@likec4/styles": "1.28.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@pandacss/dev": "^0.53.3",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"@types/node": "^20.17.28",
|
|
77
77
|
"@vitejs/plugin-react": "^4.3.4",
|
|
78
78
|
"postcss": "^8.5.3",
|
|
79
|
-
"typescript": "^5.8.
|
|
80
|
-
"vite": "^6.2.
|
|
79
|
+
"typescript": "^5.8.3",
|
|
80
|
+
"vite": "^6.2.5",
|
|
81
81
|
"vite-plugin-dts": "^4.5.3",
|
|
82
|
-
"vitest": "^3.
|
|
82
|
+
"vitest": "^3.1.1",
|
|
83
83
|
"wireit": "^0.14.11",
|
|
84
|
-
"@likec4/tsconfig": "1.
|
|
84
|
+
"@likec4/tsconfig": "1.28.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"generate": "panda codegen",
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { css, sva } from '@likec4/styles/css'
|
|
2
|
-
// import { createVar, fallbackVar, globalStyle, keyframes, style } from '@vanilla-extract/css'
|
|
3
|
-
// import { calc } from '@vanilla-extract/css-utils'
|
|
4
|
-
// import { easings, vars, whereLight, whereNotReducedGraphics } from '../../../theme-vars'
|
|
5
2
|
|
|
6
3
|
// export const _compoundOpacity = '--_compound-opacity'
|
|
7
4
|
// const compoundOpacity = `var(${_compoundOpacity})`
|
|
@@ -2,10 +2,9 @@ import { cx } from '@likec4/styles/css'
|
|
|
2
2
|
import { ActionIcon } from '@mantine/core'
|
|
3
3
|
import { IconZoomScan } from '@tabler/icons-react'
|
|
4
4
|
import { stopPropagation } from '../../../utils/xyflow'
|
|
5
|
-
import type { EdgeProps } from '../../types'
|
|
6
5
|
import { actionBtn } from './edge.css'
|
|
7
6
|
|
|
8
|
-
type EdgeActionBtnProps =
|
|
7
|
+
type EdgeActionBtnProps = {
|
|
9
8
|
icon?: React.ReactNode
|
|
10
9
|
onClick: (e: React.MouseEvent) => void
|
|
11
10
|
}
|
|
@@ -101,14 +101,16 @@ export function EdgeLabelContainer({
|
|
|
101
101
|
}}
|
|
102
102
|
{...rest}
|
|
103
103
|
>
|
|
104
|
-
{/* Work around to keep same global selector data-likec4-dimmed */}
|
|
105
104
|
<div
|
|
106
|
-
|
|
105
|
+
style={{
|
|
107
106
|
display: 'contents',
|
|
108
|
-
})}
|
|
109
|
-
{...isDimmed !== false && {
|
|
110
|
-
'data-likec4-dimmed': isDimmed,
|
|
111
107
|
}}
|
|
108
|
+
{
|
|
109
|
+
// Work around to keep same global selector data-likec4-dimmed
|
|
110
|
+
...isDimmed !== false && {
|
|
111
|
+
'data-likec4-dimmed': isDimmed,
|
|
112
|
+
}
|
|
113
|
+
}
|
|
112
114
|
>
|
|
113
115
|
{children}
|
|
114
116
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css, cx } from '@likec4/styles/css'
|
|
2
2
|
import { actionBtn } from '@likec4/styles/recipes'
|
|
3
3
|
import { ActionIcon, Box } from '@mantine/core'
|
|
4
|
+
import { useId } from '@mantine/hooks'
|
|
4
5
|
import { m } from 'framer-motion'
|
|
5
6
|
import { useIsZoomTooSmall } from '../../../hooks/useXYFlow'
|
|
6
7
|
import { stopPropagation } from '../../../utils/xyflow'
|
|
@@ -33,13 +34,13 @@ const actionButtons = css({
|
|
|
33
34
|
})
|
|
34
35
|
|
|
35
36
|
export function ElementActionButtons({
|
|
36
|
-
id,
|
|
37
37
|
selected = false,
|
|
38
38
|
data: {
|
|
39
39
|
hovered: isHovered = false,
|
|
40
40
|
},
|
|
41
41
|
buttons,
|
|
42
42
|
}: ElementActionButtonsProps) {
|
|
43
|
+
const id = useId()
|
|
43
44
|
const zoomTooSmall = useIsZoomTooSmall()
|
|
44
45
|
if (!buttons.length || zoomTooSmall) {
|
|
45
46
|
return null
|
|
@@ -49,6 +50,7 @@ export function ElementActionButtons({
|
|
|
49
50
|
<Box
|
|
50
51
|
component={m.div}
|
|
51
52
|
layoutRoot
|
|
53
|
+
key={`${id}-action-buttons`}
|
|
52
54
|
initial={false}
|
|
53
55
|
style={{
|
|
54
56
|
originY: 0,
|
|
@@ -63,22 +65,22 @@ export function ElementActionButtons({
|
|
|
63
65
|
className={cx('nodrag nopan', actionButtons)}
|
|
64
66
|
>
|
|
65
67
|
{buttons.map((button, index) => (
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
+
<ActionIcon
|
|
69
|
+
component={m.button}
|
|
70
|
+
layout
|
|
71
|
+
className={actionBtn({})}
|
|
72
|
+
key={`${id}-${button.key ?? index}`}
|
|
68
73
|
initial={false}
|
|
69
74
|
whileTap={{ scale: 1 }}
|
|
70
75
|
whileHover={{
|
|
71
76
|
scale: 1.3,
|
|
72
77
|
}}
|
|
73
|
-
|
|
78
|
+
onClick={button.onClick}
|
|
74
79
|
// Otherwise node receives click event and is selected
|
|
75
|
-
onClick={stopPropagation}
|
|
76
80
|
onDoubleClick={stopPropagation}
|
|
77
81
|
>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</ActionIcon>
|
|
81
|
-
</m.div>
|
|
82
|
+
{button.icon}
|
|
83
|
+
</ActionIcon>
|
|
82
84
|
))}
|
|
83
85
|
</Box>
|
|
84
86
|
</Box>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css, cx } from '@likec4/styles/css'
|
|
2
2
|
import { actionBtn } from '@likec4/styles/recipes'
|
|
3
3
|
import { ActionIcon, Box } from '@mantine/core'
|
|
4
|
+
import { useId } from '@mantine/hooks'
|
|
4
5
|
import { IconId } from '@tabler/icons-react'
|
|
5
6
|
import { m } from 'framer-motion'
|
|
6
7
|
import { stopPropagation } from '../../../utils/xyflow'
|
|
@@ -41,11 +42,14 @@ export function ElementDetailsButton({
|
|
|
41
42
|
icon,
|
|
42
43
|
onClick,
|
|
43
44
|
}: ElementDetailsButtonProps) {
|
|
45
|
+
const id = useId()
|
|
44
46
|
return (
|
|
45
47
|
<Box className={cx(container, 'details-button')}>
|
|
46
48
|
<ActionIcon
|
|
49
|
+
key={id}
|
|
47
50
|
className={cx('nodrag nopan', actionBtn({ variant: 'transparent' }))}
|
|
48
51
|
component={m.button}
|
|
52
|
+
layout
|
|
49
53
|
initial={false}
|
|
50
54
|
style={{
|
|
51
55
|
originX: 0.45,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { css as style } from '@likec4/styles/css'
|
|
2
|
-
// import { createVar, fallbackVar, globalStyle, style } from '@vanilla-extract/css'
|
|
3
|
-
// import { easings, vars, whereReducedGraphics } from '../../../theme-vars'
|
|
4
|
-
// import { iconSize, paddingSize, textSize } from './vars.css'
|
|
5
2
|
|
|
6
3
|
export const container = style({
|
|
7
4
|
position: 'relative',
|
|
@@ -52,18 +49,3 @@ export const container = style({
|
|
|
52
49
|
cursor: 'pointer',
|
|
53
50
|
},
|
|
54
51
|
})
|
|
55
|
-
|
|
56
|
-
// const sizes = ['xs', 'sm', 'lg', 'xl'] as const
|
|
57
|
-
// sizes.forEach((size) => {
|
|
58
|
-
// globalStyle(`${container}[data-likec4-text-size="${size}"]`, {
|
|
59
|
-
// vars: {
|
|
60
|
-
// [textSize]: rem(defaultTheme.textSizes[size]),
|
|
61
|
-
// },
|
|
62
|
-
// })
|
|
63
|
-
|
|
64
|
-
// globalStyle(`${container}[data-likec4-padding="${size}"]`, {
|
|
65
|
-
// vars: {
|
|
66
|
-
// [paddingSize]: rem(defaultTheme.spacing[size]),
|
|
67
|
-
// },
|
|
68
|
-
// })
|
|
69
|
-
// })
|
package/src/bundle/styles.css.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { DiagramView } from '@likec4/core'
|
|
2
2
|
import { css } from '@likec4/styles/css'
|
|
3
3
|
import { type MantineThemeOverride, createTheme, Portal } from '@mantine/core'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useColorScheme as usePreferredColorScheme,
|
|
6
|
+
useDebouncedCallback,
|
|
7
|
+
useId,
|
|
8
|
+
useMutationObserver,
|
|
9
|
+
} from '@mantine/hooks'
|
|
5
10
|
import { useIsomorphicLayoutEffect } from '@react-hookz/web'
|
|
6
|
-
import {
|
|
11
|
+
import { useState } from 'react'
|
|
7
12
|
import { first, isFunction, isString } from 'remeda'
|
|
8
13
|
import inlinedStyles from '../styles.css?inline'
|
|
9
14
|
import fontsCss from './font.css?inline'
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { css
|
|
2
|
-
// import { createVar, fallbackVar, globalStyle, style } from '@vanilla-extract/css'
|
|
3
|
-
// import { mantine, transitions, vars, whereDark, whereLight, whereNotReducedGraphics } from '../theme-vars'
|
|
1
|
+
import { css } from '@likec4/styles/css'
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
// const bgColor = createVar('bgcolor')
|
|
7
|
-
export const root = style({
|
|
3
|
+
export const root = css({
|
|
8
4
|
height: '30px',
|
|
9
5
|
paddingLeft: 'sm',
|
|
10
6
|
paddingRight: '4px',
|
|
@@ -42,7 +38,7 @@ export const root = style({
|
|
|
42
38
|
},
|
|
43
39
|
})
|
|
44
40
|
|
|
45
|
-
export const placeholder =
|
|
41
|
+
export const placeholder = css({
|
|
46
42
|
fontSize: 'sm', // mantine.fontSizes.sm,
|
|
47
43
|
fontWeight: 500,
|
|
48
44
|
paddingRight: '50px',
|
|
@@ -50,7 +46,7 @@ export const placeholder = style({
|
|
|
50
46
|
flex: '1',
|
|
51
47
|
})
|
|
52
48
|
|
|
53
|
-
export const shortcut =
|
|
49
|
+
export const shortcut = css({
|
|
54
50
|
fontSize: '11px',
|
|
55
51
|
fontWeight: 600,
|
|
56
52
|
lineHeight: 1,
|
package/src/hooks/useDiagram.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type DiagramView, type EdgeId, type ElementNotation, type Fqn, type Nod
|
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks'
|
|
3
3
|
import { useSelector as useXstateSelector } from '@xstate/react'
|
|
4
4
|
import { shallowEqual } from 'fast-equals'
|
|
5
|
-
import { useMemo
|
|
5
|
+
import { useMemo } from 'react'
|
|
6
6
|
import type { PartialDeep } from 'type-fest'
|
|
7
7
|
import type { FeatureName } from '../context/DiagramFeatures'
|
|
8
8
|
import type { OpenSourceParams } from '../LikeC4Diagram.props'
|
|
@@ -16,38 +16,27 @@ export { useDiagramActorRef }
|
|
|
16
16
|
|
|
17
17
|
export function useDiagram() {
|
|
18
18
|
const actor = useDiagramActorRef()
|
|
19
|
-
const [, startTransition] = useTransition()
|
|
20
19
|
return useMemo(() => ({
|
|
21
20
|
actor,
|
|
22
21
|
send: actor.send,
|
|
23
22
|
navigateTo: (viewId: ViewId, fromNode?: NodeId) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...(fromNode && { fromNode }),
|
|
29
|
-
})
|
|
23
|
+
actor.send({
|
|
24
|
+
type: 'navigate.to',
|
|
25
|
+
viewId,
|
|
26
|
+
...(fromNode && { fromNode }),
|
|
30
27
|
})
|
|
31
28
|
},
|
|
32
29
|
navigate: (direction: 'back' | 'forward') => {
|
|
33
|
-
|
|
34
|
-
actor.send({ type: `navigate.${direction}` })
|
|
35
|
-
})
|
|
30
|
+
actor.send({ type: `navigate.${direction}` })
|
|
36
31
|
},
|
|
37
32
|
fitDiagram: (duration = 350) => {
|
|
38
|
-
|
|
39
|
-
actor.send({ type: 'fitDiagram', duration })
|
|
40
|
-
})
|
|
33
|
+
actor.send({ type: 'fitDiagram', duration })
|
|
41
34
|
},
|
|
42
35
|
openRelationshipsBrowser: (fqn: Fqn) => {
|
|
43
|
-
|
|
44
|
-
actor.send({ type: 'open.relationshipsBrowser', fqn })
|
|
45
|
-
})
|
|
36
|
+
actor.send({ type: 'open.relationshipsBrowser', fqn })
|
|
46
37
|
},
|
|
47
38
|
openSource: (params: OpenSourceParams) => {
|
|
48
|
-
|
|
49
|
-
actor.send({ type: 'open.source', ...params })
|
|
50
|
-
})
|
|
39
|
+
actor.send({ type: 'open.source', ...params })
|
|
51
40
|
},
|
|
52
41
|
openElementDetails: (fqn: Fqn, fromNode?: NodeId) => {
|
|
53
42
|
actor.send({ type: 'open.elementDetails', fqn, fromNode })
|
|
@@ -91,16 +91,14 @@ export const LikeC4DiagramXYFlow = memo<LikeC4DiagramXYFlowProps>(({
|
|
|
91
91
|
layoutConstraints = useLayoutConstraints(),
|
|
92
92
|
$isPanning = usePanningAtom(),
|
|
93
93
|
isPanning = useTimeout(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
}, isReducedGraphics ? 150 : 350),
|
|
94
|
+
$isPanning.set(true)
|
|
95
|
+
}, isReducedGraphics ? 100 : 200),
|
|
98
96
|
notPanning = useDebouncedCallback(() => {
|
|
99
97
|
isPanning.clear()
|
|
100
98
|
if ($isPanning.get()) {
|
|
101
99
|
$isPanning.set(false)
|
|
102
100
|
}
|
|
103
|
-
},
|
|
101
|
+
}, 200),
|
|
104
102
|
onMove: OnMove = useCallbackRef((event) => {
|
|
105
103
|
if (!event) {
|
|
106
104
|
return
|
|
@@ -111,7 +109,9 @@ export const LikeC4DiagramXYFlow = memo<LikeC4DiagramXYFlowProps>(({
|
|
|
111
109
|
notPanning()
|
|
112
110
|
}),
|
|
113
111
|
onMoveEnd: OnMoveEnd = useCallbackRef((event, viewport) => {
|
|
114
|
-
|
|
112
|
+
if (!!event) {
|
|
113
|
+
notPanning.flush()
|
|
114
|
+
}
|
|
115
115
|
diagram.send({ type: 'xyflow.viewportMoved', viewport, manually: !!event })
|
|
116
116
|
}),
|
|
117
117
|
onViewportResize = useCallbackRef(() => {
|
|
@@ -335,7 +335,13 @@ export const RelationshipEdge = customEdge<Types.RelationshipEdgeData>((props) =
|
|
|
335
335
|
return (
|
|
336
336
|
<>
|
|
337
337
|
<EdgeContainer {...props} className={clsx(isControlPointDragging && edgesCss.controlDragging)}>
|
|
338
|
-
<EdgePath
|
|
338
|
+
<EdgePath
|
|
339
|
+
{...props}
|
|
340
|
+
svgPath={edgePath}
|
|
341
|
+
ref={svgPathRef}
|
|
342
|
+
{...enableEdgeEditing && {
|
|
343
|
+
onEdgePointerDown,
|
|
344
|
+
}} />
|
|
339
345
|
<EdgeLabelContainer
|
|
340
346
|
edgeProps={props}
|
|
341
347
|
labelPosition={{
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { css } from '@likec4/styles/css'
|
|
2
|
-
// import { fallbackVar, style } from '@vanilla-extract/css'
|
|
3
|
-
// import { calc } from '@vanilla-extract/css-utils'
|
|
4
|
-
// import { mantine, vars, whereDark, whereNotReducedGraphics } from '../../../theme-vars'
|
|
5
|
-
// import { stokeFillMix } from '../../xyflow/nodes/element/element.css'
|
|
6
2
|
|
|
7
3
|
export const container = css({
|
|
8
4
|
bottom: 0,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { css, cx } from '@likec4/styles/css'
|
|
2
2
|
|
|
3
|
-
// import { fallbackVar, globalStyle, style } from '@vanilla-extract/css'
|
|
4
|
-
// import { mantine } from '../../../theme-vars'
|
|
5
|
-
// import { button, description, descriptionColor, iconColor, title } from './_shared.css'
|
|
6
|
-
|
|
7
3
|
export { emptyBoX, focusable } from './_shared.css'
|
|
8
4
|
|
|
9
5
|
const _viewBtn = 'likec4-view-btn'
|
|
@@ -2,7 +2,7 @@ import { nonexhaustive } from '@likec4/core'
|
|
|
2
2
|
import { Box, Button, Code, Group, Notification, ScrollAreaAutosize } from '@mantine/core'
|
|
3
3
|
import { IconX } from '@tabler/icons-react'
|
|
4
4
|
import { useSelector } from '@xstate/react'
|
|
5
|
-
import { AnimatePresence, LayoutGroup,
|
|
5
|
+
import { AnimatePresence, LayoutGroup, useReducedMotionConfig } from 'framer-motion'
|
|
6
6
|
import { animate } from 'framer-motion/dom'
|
|
7
7
|
import { memo, useEffect, useMemo } from 'react'
|
|
8
8
|
import { type FallbackProps, ErrorBoundary } from 'react-error-boundary'
|
|
@@ -108,7 +108,7 @@ export const Overlays = memo(({ overlaysActorRef }: { overlaysActorRef: Overlays
|
|
|
108
108
|
return (
|
|
109
109
|
<Overlay
|
|
110
110
|
key={overlay.actorRef.sessionId}
|
|
111
|
-
overlayLevel={
|
|
111
|
+
overlayLevel={index}
|
|
112
112
|
onClose={() => close(overlay.actorRef)}>
|
|
113
113
|
<RelationshipsBrowser actorRef={overlay.actorRef} />
|
|
114
114
|
</Overlay>
|
|
@@ -116,7 +116,7 @@ export const Overlays = memo(({ overlaysActorRef }: { overlaysActorRef: Overlays
|
|
|
116
116
|
case 'relationshipDetails':
|
|
117
117
|
return (
|
|
118
118
|
<Overlay
|
|
119
|
-
overlayLevel={
|
|
119
|
+
overlayLevel={index}
|
|
120
120
|
key={overlay.actorRef.sessionId}
|
|
121
121
|
onClose={() => close(overlay.actorRef)}>
|
|
122
122
|
<RelationshipDetails actorRef={overlay.actorRef} />
|
|
@@ -24,7 +24,7 @@ const dialog = css.raw({
|
|
|
24
24
|
[backdropBlur]: '0px',
|
|
25
25
|
[level]: '0',
|
|
26
26
|
[offset]: '0px',
|
|
27
|
-
[inset]: 'calc((1 + var(--_level) * 0.
|
|
27
|
+
[inset]: 'calc((1 + var(--_level) * 0.75) * var(--_offset))',
|
|
28
28
|
[backdropOpacity]: '0%',
|
|
29
29
|
_backdrop: {
|
|
30
30
|
cursor: 'zoom-out',
|
|
@@ -45,8 +45,8 @@ const dialog = css.raw({
|
|
|
45
45
|
height: '100vh',
|
|
46
46
|
},
|
|
47
47
|
sm: {
|
|
48
|
-
inset: '[var(--_inset) var(--
|
|
49
|
-
width: 'calc(100vw -
|
|
48
|
+
inset: '[var(--_inset) var(--_inset) var(--_offset) var(--_inset)]',
|
|
49
|
+
width: 'calc(100vw - 2 * var(--_inset))',
|
|
50
50
|
height: 'calc(100vh - var(--_offset) - var(--_inset))',
|
|
51
51
|
[borderRadius]: '6px',
|
|
52
52
|
padding: '6px',
|
|
@@ -61,22 +61,6 @@ const dialog = css.raw({
|
|
|
61
61
|
xl: {
|
|
62
62
|
[offset]: '4rem',
|
|
63
63
|
},
|
|
64
|
-
// inset: '[calc(2rem + var(--_level, 0) * 1rem), 2rem, 2rem, 2rem]',
|
|
65
|
-
// width: 'calc(100vw - 4rem)',
|
|
66
|
-
// height: 'calc(100vh - 4rem - var(--_level, 0) * 1rem)',
|
|
67
|
-
// },
|
|
68
|
-
// lg: {
|
|
69
|
-
// inset: '[calc(4rem + var(--_level, 0) * 1rem), 4rem, 4rem, 4rem]',
|
|
70
|
-
// width: 'calc(100vw - 8rem)',
|
|
71
|
-
// height: 'calc(100vh - 8rem)',
|
|
72
|
-
// },
|
|
73
|
-
// xl: {
|
|
74
|
-
// [borderRadius]: '8px',
|
|
75
|
-
// padding: '8px',
|
|
76
|
-
// inset: '[calc(5rem + var(--_level, 0) * 1rem), 5rem, 5rem, 5rem]',
|
|
77
|
-
// width: 'calc(100vw - 10rem)',
|
|
78
|
-
// height: 'calc(100vh - 10rem - var(--_level, 0) * 1rem)',
|
|
79
|
-
// },
|
|
80
64
|
})
|
|
81
65
|
|
|
82
66
|
const body = css.raw({
|
|
@@ -99,28 +83,4 @@ export const overlay = sva({
|
|
|
99
83
|
dialog: dialog,
|
|
100
84
|
body: body,
|
|
101
85
|
},
|
|
102
|
-
variants: {
|
|
103
|
-
level: {
|
|
104
|
-
0: {
|
|
105
|
-
dialog: {
|
|
106
|
-
[level]: '0',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
1: {
|
|
110
|
-
dialog: {
|
|
111
|
-
[level]: '1',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
2: {
|
|
115
|
-
dialog: {
|
|
116
|
-
[level]: '2',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
3: {
|
|
120
|
-
dialog: {
|
|
121
|
-
[level]: '3',
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
86
|
})
|