@likec4/diagram 1.21.1 → 1.22.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/dist/LikeC4Diagram.js +9 -13
- package/dist/base/index.d.ts +0 -1
- package/dist/base/primitives/element/styles.css.js +1 -1
- package/dist/{base → components}/Link.css.js +3 -3
- package/dist/components/SearchControl.css.d.ts +2 -0
- package/dist/components/SearchControl.css.js +7 -0
- package/dist/components/SearchControl.d.ts +5 -0
- package/dist/components/SearchControl.js +17 -0
- package/dist/context/DiagramFeatures.d.ts +1 -1
- package/dist/context/IconRenderer.d.ts +10 -0
- package/dist/context/IconRenderer.js +34 -0
- package/dist/hooks/useCurrentViewId.js +8 -0
- package/dist/hooks/useDiagram.d.ts +108 -72
- package/dist/hooks/useDiagram.js +3 -0
- package/dist/likec4diagram/DiagramActor.js +13 -2
- package/dist/likec4diagram/DiagramUI.js +0 -2
- package/dist/likec4diagram/XYFlow.d.ts +6 -1
- package/dist/likec4diagram/XYFlow.js +37 -31
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +2 -1
- package/dist/likec4diagram/state/actorContext.d.ts +620 -468
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/machine.d.ts +120 -74
- package/dist/likec4diagram/state/machine.js +32 -12
- package/dist/likec4diagram/state/syncManualLayoutActor.js +4 -8
- package/dist/likec4diagram/ui/controls/Controls.js +65 -48
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +44 -69
- package/dist/likec4diagram/ui/controls/ToggleReadonly.d.ts +1 -0
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +29 -0
- package/dist/likec4diagram/ui/controls/_shared.js +1 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
- package/dist/likec4diagram/ui/search/ElementsColumn.css.d.ts +15 -0
- package/dist/likec4diagram/ui/search/ElementsColumn.css.js +30 -0
- package/dist/likec4diagram/ui/search/ElementsColumn.d.ts +1 -0
- package/dist/likec4diagram/ui/search/ElementsColumn.js +243 -0
- package/dist/likec4diagram/ui/search/LikeC4Search.css.d.ts +8 -0
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +20 -0
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +1 -0
- package/dist/likec4diagram/ui/search/LikeC4Search.js +265 -0
- package/dist/likec4diagram/ui/search/SearchInput.d.ts +1 -0
- package/dist/likec4diagram/ui/search/SearchInput.js +196 -0
- package/dist/likec4diagram/ui/search/ViewsColum.d.ts +9 -0
- package/dist/likec4diagram/ui/search/ViewsColum.js +130 -0
- package/dist/likec4diagram/ui/search/ViewsColumn.css.d.ts +5 -0
- package/dist/likec4diagram/ui/search/ViewsColumn.css.js +12 -0
- package/dist/likec4diagram/ui/search/_shared.css.d.ts +16 -0
- package/dist/likec4diagram/ui/search/_shared.css.js +5 -0
- package/dist/likec4diagram/ui/search/state.d.ts +19 -0
- package/dist/likec4diagram/ui/search/state.js +72 -0
- package/dist/likec4diagram/ui/search/utils.d.ts +3 -0
- package/dist/likec4diagram/ui/search/utils.js +23 -0
- package/dist/likec4diagram/useLayoutConstraints.js +4 -5
- package/dist/likec4model/useLikeC4ElementsTree.d.ts +1 -0
- package/dist/likec4model/useLikeC4ElementsTree.js +1 -0
- package/dist/overlays/Overlays.js +9 -9
- package/dist/overlays/element-details/ElementDetailsCard.js +20 -13
- package/dist/overlays/overlay/Overlay.d.ts +6 -2
- package/dist/overlays/overlay/Overlay.js +18 -29
- package/dist/overlays/relationship-details/SelectEdge.js +1 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -5
- package/dist/overlays/relationships-browser/SelectElement.js +10 -6
- package/dist/overlays/relationships-browser/actor.d.ts +2 -2
- package/dist/overlays/relationships-browser/actor.js +8 -8
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +13 -13
- package/src/LikeC4Diagram.tsx +0 -1
- package/src/base/index.ts +0 -2
- package/src/base/primitives/element/styles.css.ts +2 -2
- package/src/{base → components}/Link.css.ts +3 -3
- package/src/components/SearchControl.css.ts +69 -0
- package/src/components/SearchControl.tsx +33 -0
- package/src/context/DiagramFeatures.tsx +1 -1
- package/src/context/IconRenderer.tsx +54 -1
- package/src/globals.css.ts +0 -2
- package/src/hooks/useDiagram.ts +5 -0
- package/src/likec4diagram/DiagramActor.tsx +15 -2
- package/src/likec4diagram/DiagramUI.tsx +0 -4
- package/src/likec4diagram/XYFlow.tsx +39 -31
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +2 -1
- package/src/likec4diagram/state/assign.ts +1 -1
- package/src/likec4diagram/state/machine.ts +40 -14
- package/src/likec4diagram/state/syncManualLayoutActor.ts +6 -9
- package/src/likec4diagram/ui/controls/Controls.tsx +37 -25
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +36 -58
- package/src/likec4diagram/ui/controls/ToggleReadonly.tsx +31 -0
- package/src/likec4diagram/ui/controls/styles.css.ts +3 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/search/ElementsColumn.css.ts +119 -0
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +291 -0
- package/src/likec4diagram/ui/search/LikeC4Search.css.ts +117 -0
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +312 -0
- package/src/likec4diagram/ui/search/SearchInput.tsx +235 -0
- package/src/likec4diagram/ui/search/ViewsColum.tsx +158 -0
- package/src/likec4diagram/ui/search/ViewsColumn.css.ts +37 -0
- package/src/likec4diagram/ui/search/_shared.css.ts +104 -0
- package/src/likec4diagram/ui/search/state.ts +76 -0
- package/src/likec4diagram/ui/search/utils.ts +20 -0
- package/src/likec4diagram/useLayoutConstraints.ts +4 -5
- package/src/likec4model/useLikeC4ElementsTree.ts +4 -4
- package/src/overlays/Overlays.tsx +31 -25
- package/src/overlays/element-details/ElementDetailsCard.css.ts +4 -4
- package/src/overlays/element-details/ElementDetailsCard.tsx +245 -240
- package/src/overlays/overlay/Overlay.css.ts +10 -9
- package/src/overlays/overlay/Overlay.tsx +38 -26
- package/src/overlays/relationship-details/SelectEdge.css.ts +1 -0
- package/src/overlays/relationship-details/SelectEdge.tsx +2 -4
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +10 -5
- package/src/overlays/relationships-browser/SelectElement.tsx +88 -82
- package/src/overlays/relationships-browser/actor.ts +10 -10
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +2 -2
- package/dist/LikeC4Search.css.d.ts +0 -1
- package/dist/LikeC4Search.css.js +0 -5
- package/dist/LikeC4Search.d.ts +0 -2
- package/dist/LikeC4Search.js +0 -88
- package/src/LikeC4Search.css.ts +0 -12
- package/src/LikeC4Search.tsx +0 -91
- /package/dist/{base → components}/Link.css.d.ts +0 -0
- /package/dist/{base → components}/Link.d.ts +0 -0
- /package/dist/{base → components}/Link.js +0 -0
- /package/src/{base → components}/Link.tsx +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { fallbackVar, globalStyle, style } from '@vanilla-extract/css'
|
|
2
|
+
import { mantine } from '../../../theme-vars'
|
|
3
|
+
import { button, description, descriptionColor, iconColor, title } from './_shared.css'
|
|
4
|
+
|
|
5
|
+
export { focusable } from './_shared.css'
|
|
6
|
+
|
|
7
|
+
export const viewButton = style([button, {
|
|
8
|
+
flexWrap: 'nowrap',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
}])
|
|
11
|
+
|
|
12
|
+
globalStyle(`${viewButton} .mantine-ThemeIcon-root`, {
|
|
13
|
+
// transition: transitions.fast,
|
|
14
|
+
color: fallbackVar(iconColor, mantine.colors.dark[2]),
|
|
15
|
+
vars: {
|
|
16
|
+
'--ti-size': '24px',
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
globalStyle(`${viewButton}[data-disabled] .mantine-ThemeIcon-root`, {
|
|
20
|
+
opacity: 0.45,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
export const viewTitle = style([title])
|
|
24
|
+
export const viewDescription = style([description])
|
|
25
|
+
|
|
26
|
+
export const viewButtonDescription = style({
|
|
27
|
+
marginTop: 4,
|
|
28
|
+
// transition: transitions.fast,
|
|
29
|
+
color: fallbackVar(descriptionColor, mantine.colors.dimmed),
|
|
30
|
+
fontSize: 13,
|
|
31
|
+
lineHeight: 1.4,
|
|
32
|
+
selectors: {
|
|
33
|
+
[`:where(${viewButton}[data-disabled]) &`]: {
|
|
34
|
+
opacity: 0.85,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
})
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type StyleRule, createVar, fallbackVar, globalStyle, style } from '@vanilla-extract/css'
|
|
2
|
+
import { mantine } from '../../../theme-vars'
|
|
3
|
+
import { whereDark, whereLight } from '../../../theme-vars.css'
|
|
4
|
+
|
|
5
|
+
export const titleColor = createVar('title-color')
|
|
6
|
+
export const descriptionColor = createVar('description-color')
|
|
7
|
+
export const iconColor = createVar('icon-color')
|
|
8
|
+
|
|
9
|
+
export const buttonFocused = {
|
|
10
|
+
outline: 'none',
|
|
11
|
+
backgroundColor: mantine.colors.primaryColors[8],
|
|
12
|
+
borderColor: mantine.colors.primaryColors[9],
|
|
13
|
+
vars: {
|
|
14
|
+
[iconColor]: mantine.colors.primaryColors[2],
|
|
15
|
+
[titleColor]: mantine.colors.primaryColors[0],
|
|
16
|
+
[descriptionColor]: mantine.colors.primaryColors[1],
|
|
17
|
+
},
|
|
18
|
+
} satisfies StyleRule
|
|
19
|
+
|
|
20
|
+
export const button = style({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
width: '100%',
|
|
23
|
+
background: mantine.colors.body,
|
|
24
|
+
borderRadius: mantine.radius.sm,
|
|
25
|
+
padding: `12px 8px 12px 14px`,
|
|
26
|
+
minHeight: 60,
|
|
27
|
+
gap: 10,
|
|
28
|
+
// alignItems: 'flex-start',
|
|
29
|
+
// transition: `all 50ms ${easings.inOut}`,
|
|
30
|
+
border: `1px solid ${mantine.colors.defaultBorder}`,
|
|
31
|
+
vars: {
|
|
32
|
+
[titleColor]: mantine.colors.dark[1],
|
|
33
|
+
[iconColor]: mantine.colors.dimmed,
|
|
34
|
+
[descriptionColor]: mantine.colors.dimmed,
|
|
35
|
+
},
|
|
36
|
+
':hover': {
|
|
37
|
+
...buttonFocused,
|
|
38
|
+
borderColor: mantine.colors.primaryColors[9],
|
|
39
|
+
backgroundColor: `color-mix(in srgb, ${buttonFocused.backgroundColor}, transparent 40%)`,
|
|
40
|
+
},
|
|
41
|
+
':focus': buttonFocused,
|
|
42
|
+
selectors: {
|
|
43
|
+
[`${whereDark} &`]: {
|
|
44
|
+
borderColor: 'transparent',
|
|
45
|
+
backgroundColor: `color-mix(in srgb, ${mantine.colors.dark[6]}, transparent 20%)`,
|
|
46
|
+
// background: mantine.colors.dark[6],
|
|
47
|
+
},
|
|
48
|
+
[`${whereLight} &`]: {
|
|
49
|
+
backgroundColor: `color-mix(in srgb, ${mantine.colors.white}, transparent 10%)`,
|
|
50
|
+
vars: {
|
|
51
|
+
[iconColor]: mantine.colors.gray[6],
|
|
52
|
+
[titleColor]: mantine.colors.gray[7],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
[`${whereLight} &:hover`]: {
|
|
56
|
+
borderColor: mantine.colors.primaryColors[6],
|
|
57
|
+
backgroundColor: mantine.colors.primaryColors[5],
|
|
58
|
+
vars: {
|
|
59
|
+
[iconColor]: mantine.colors.primaryColors[3],
|
|
60
|
+
[titleColor]: mantine.colors.primaryColors[0],
|
|
61
|
+
[descriptionColor]: mantine.colors.primaryColors[1],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
export const focusable = style({})
|
|
68
|
+
|
|
69
|
+
export const title = style({
|
|
70
|
+
color: fallbackVar(titleColor, mantine.colors.gray[7]),
|
|
71
|
+
fontSize: 16,
|
|
72
|
+
fontWeight: 500,
|
|
73
|
+
lineHeight: 1.1,
|
|
74
|
+
selectors: {
|
|
75
|
+
[`:where([data-disabled]) &`]: {
|
|
76
|
+
opacity: 0.4,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
export const description = style({
|
|
81
|
+
marginTop: 4,
|
|
82
|
+
color: fallbackVar(descriptionColor, mantine.colors.dimmed),
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
lineHeight: 1.4,
|
|
85
|
+
selectors: {
|
|
86
|
+
[`:where([data-disabled]) &`]: {
|
|
87
|
+
opacity: 0.85,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
export const emptyBoX = style({
|
|
93
|
+
width: '100%',
|
|
94
|
+
height: '100%',
|
|
95
|
+
border: `2px dashed ${mantine.colors.defaultBorder}`,
|
|
96
|
+
borderRadius: mantine.radius.md,
|
|
97
|
+
display: 'flex',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
fontSize: mantine.fontSizes.md,
|
|
101
|
+
color: mantine.colors.dimmed,
|
|
102
|
+
padding: mantine.spacing.md,
|
|
103
|
+
paddingBlock: mantine.spacing.xl,
|
|
104
|
+
})
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type Fqn, type LikeC4Model, type ViewId, DiagramNode } from '@likec4/core'
|
|
2
|
+
import { createSafeContext } from '@mantine/core'
|
|
3
|
+
import { useCallbackRef } from '@mantine/hooks'
|
|
4
|
+
import { useStore } from '@nanostores/react'
|
|
5
|
+
import { atom, computed, onMount } from 'nanostores'
|
|
6
|
+
import { useDeferredValue } from 'react'
|
|
7
|
+
import { useDiagram } from '../../../hooks/useDiagram'
|
|
8
|
+
|
|
9
|
+
const $search = atom('')
|
|
10
|
+
|
|
11
|
+
export function setSearch(term: string) {
|
|
12
|
+
$search.set(term)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function useSearch() {
|
|
16
|
+
return useStore($search)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const $normalizedSearch = computed($search, search => {
|
|
20
|
+
const v = search.trim().toLowerCase()
|
|
21
|
+
return v.length > 1 ? v : ''
|
|
22
|
+
})
|
|
23
|
+
export function useNormalizedSearch() {
|
|
24
|
+
return useDeferredValue(useStore($normalizedSearch))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const [LikeC4SearchContext, useCloseSearch] = createSafeContext<(cb?: () => void) => void>('LikeC4Search')
|
|
28
|
+
|
|
29
|
+
type PickView = {
|
|
30
|
+
elementFqn: Fqn
|
|
31
|
+
scoped: LikeC4Model.View[]
|
|
32
|
+
others: LikeC4Model.View[]
|
|
33
|
+
}
|
|
34
|
+
const $pickView = atom<PickView | null>(null)
|
|
35
|
+
onMount($search, () => {
|
|
36
|
+
// reset search on mount
|
|
37
|
+
$pickView.set(null)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
export function usePickView() {
|
|
41
|
+
return useStore($pickView)
|
|
42
|
+
}
|
|
43
|
+
export function setPickView(data: PickView | null) {
|
|
44
|
+
$pickView.set(data)
|
|
45
|
+
}
|
|
46
|
+
export function wasResetPickView() {
|
|
47
|
+
if ($pickView.get() !== null) {
|
|
48
|
+
$pickView.set(null)
|
|
49
|
+
return true
|
|
50
|
+
}
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const $pickViewActive = computed($pickView, pickView => pickView !== null)
|
|
55
|
+
export function useIsPickViewActive() {
|
|
56
|
+
return useStore($pickViewActive)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function useCloseSearchAndNavigateTo() {
|
|
60
|
+
const diagram = useDiagram()
|
|
61
|
+
const close = useCloseSearch()
|
|
62
|
+
return useCallbackRef((viewId: ViewId, fromElementFqn?: Fqn) => {
|
|
63
|
+
close(() => {
|
|
64
|
+
fromElementFqn ??= $pickView.get()?.elementFqn
|
|
65
|
+
setPickView(null)
|
|
66
|
+
const fromNode = fromElementFqn
|
|
67
|
+
? diagram.getContext().view.nodes.find(n => DiagramNode.modelRef(n) === fromElementFqn)?.id
|
|
68
|
+
: undefined
|
|
69
|
+
if (diagram.currentView().id === viewId && fromNode) {
|
|
70
|
+
diagram.focusNode(fromNode)
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
diagram.navigateTo(viewId, fromNode)
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function stopAndPrevent(e: React.KeyboardEvent | KeyboardEvent) {
|
|
2
|
+
e.stopPropagation()
|
|
3
|
+
e.preventDefault()
|
|
4
|
+
return
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function centerY(element: HTMLElement) {
|
|
8
|
+
const rect = element.getBoundingClientRect()
|
|
9
|
+
const y = rect.y + Math.floor(rect.height / 2)
|
|
10
|
+
return y
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function moveFocusToSearchInput() {
|
|
14
|
+
const input = document.getElementById('likec4searchinput') as HTMLInputElement | null
|
|
15
|
+
if (input) {
|
|
16
|
+
const length = input.value.length
|
|
17
|
+
input.focus()
|
|
18
|
+
input.setSelectionRange(length, length)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -5,7 +5,6 @@ import { useMemo, useRef } from 'react'
|
|
|
5
5
|
import { filter, hasAtLeast, isNullish, map, pipe } from 'remeda'
|
|
6
6
|
import { type XYStoreApi, useXYStoreApi } from '../hooks'
|
|
7
7
|
// import { type XYStoreApi } from '../hooks/useXYFlow'
|
|
8
|
-
import { useSyncedRef } from '@react-hookz/web'
|
|
9
8
|
import { useDiagram } from '../hooks/useDiagram'
|
|
10
9
|
import type { Types } from './types'
|
|
11
10
|
|
|
@@ -255,11 +254,11 @@ type LayoutConstraints = {
|
|
|
255
254
|
*/
|
|
256
255
|
export function useLayoutConstraints(): LayoutConstraints {
|
|
257
256
|
const xystore = useXYStoreApi()
|
|
258
|
-
const diagram =
|
|
257
|
+
const diagram = useDiagram()
|
|
259
258
|
const solverRef = useRef<ReturnType<typeof createLayoutConstraints>>(undefined)
|
|
260
259
|
return useMemo((): LayoutConstraints => ({
|
|
261
260
|
onNodeDragStart: (_event, xynode) => {
|
|
262
|
-
diagram.
|
|
261
|
+
diagram.cancelSaveManualLayout()
|
|
263
262
|
const { nodeLookup } = xystore.getState()
|
|
264
263
|
const draggingNodes = pipe(
|
|
265
264
|
Array.from(nodeLookup.values()),
|
|
@@ -280,9 +279,9 @@ export function useLayoutConstraints(): LayoutConstraints {
|
|
|
280
279
|
},
|
|
281
280
|
onNodeDragStop: () => {
|
|
282
281
|
solverRef.current?.updateXYFlowNodes()
|
|
283
|
-
diagram.
|
|
282
|
+
diagram.scheduleSaveManualLayout()
|
|
284
283
|
// diagramApi.getState().scheduleSaveManualLayout()
|
|
285
284
|
solverRef.current = undefined
|
|
286
285
|
},
|
|
287
|
-
}), [xystore])
|
|
286
|
+
}), [xystore, diagram])
|
|
288
287
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Fqn, type LikeC4Model, type ViewId, compareNatural } from '@likec4/core'
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { useLikeC4Model } from './useLikeC4Model'
|
|
4
4
|
|
|
@@ -8,15 +8,15 @@ interface LikeC4ModelTreeNodeData {
|
|
|
8
8
|
children: LikeC4ModelTreeNodeData[]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const sortByLabel = (a: LikeC4ModelTreeNodeData, b: LikeC4ModelTreeNodeData) => compareNatural(a.label, b.label)
|
|
11
|
+
export const sortByLabel = (a: LikeC4ModelTreeNodeData, b: LikeC4ModelTreeNodeData) => compareNatural(a.label, b.label)
|
|
12
12
|
|
|
13
13
|
function buildNode(
|
|
14
|
-
element: LikeC4Model.Node | LikeC4Model.Element
|
|
14
|
+
element: LikeC4Model.Node | LikeC4Model.Element,
|
|
15
15
|
): LikeC4ModelTreeNodeData {
|
|
16
16
|
return {
|
|
17
17
|
label: element.title,
|
|
18
18
|
value: element.id,
|
|
19
|
-
children: [...element.children()].map(buildNode).sort(sortByLabel)
|
|
19
|
+
children: [...element.children()].map(buildNode).sort(sortByLabel),
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -2,7 +2,7 @@ import { Box, Button, Code, Group, Notification } from '@mantine/core'
|
|
|
2
2
|
import { useCallbackRef } from '@mantine/hooks'
|
|
3
3
|
import { IconX } from '@tabler/icons-react'
|
|
4
4
|
import { deepEqual } from 'fast-equals'
|
|
5
|
-
import { useReducedMotion } from 'framer-motion'
|
|
5
|
+
import { AnimatePresence, useReducedMotion } 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'
|
|
@@ -96,32 +96,38 @@ export const Overlays = memo(() => {
|
|
|
96
96
|
return (
|
|
97
97
|
<DiagramFeatures.Overlays>
|
|
98
98
|
<ErrorBoundary FallbackComponent={Fallback} onReset={onClose}>
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
<AnimatePresence onExitComplete={onClose}>
|
|
100
|
+
{relationshipsBrowserActor && (
|
|
101
|
+
<Overlay
|
|
102
|
+
key={'relationships-browser'}
|
|
103
|
+
onClose={() => relationshipsBrowserActor.send({ type: 'close' })}>
|
|
104
|
+
<RelationshipsBrowser actorRef={relationshipsBrowserActor} />
|
|
105
|
+
</Overlay>
|
|
106
|
+
)}
|
|
107
|
+
</AnimatePresence>
|
|
108
|
+
<AnimatePresence onExitComplete={onClose}>
|
|
109
|
+
{relationshipDetailsActor && (
|
|
110
|
+
<Overlay
|
|
111
|
+
key={'relationship-details'}
|
|
112
|
+
onClose={() => relationshipDetailsActor.send({ type: 'close' })}>
|
|
113
|
+
<RelationshipDetails actorRef={relationshipDetailsActor} />
|
|
114
|
+
</Overlay>
|
|
115
|
+
)}
|
|
116
|
+
</AnimatePresence>
|
|
113
117
|
|
|
114
118
|
{/* TODO: Somehow ElementDetailsCard does not work properly inside AnimatePresence} */}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
<AnimatePresence>
|
|
120
|
+
{!!activeElementDetailsOf && (
|
|
121
|
+
<ElementDetailsCard
|
|
122
|
+
key={'element-details'}
|
|
123
|
+
fqn={activeElementDetailsOf}
|
|
124
|
+
viewId={viewId}
|
|
125
|
+
fromNode={fromNode}
|
|
126
|
+
rectFromNode={rectFromNode}
|
|
127
|
+
onClose={onClose}
|
|
128
|
+
/>
|
|
129
|
+
)}
|
|
130
|
+
</AnimatePresence>
|
|
125
131
|
</ErrorBoundary>
|
|
126
132
|
</DiagramFeatures.Overlays>
|
|
127
133
|
)
|
|
@@ -11,10 +11,10 @@ export const dialog = style({
|
|
|
11
11
|
padding: 0,
|
|
12
12
|
position: 'fixed',
|
|
13
13
|
inset: 0,
|
|
14
|
-
width: '
|
|
15
|
-
height: '
|
|
16
|
-
maxWidth: '
|
|
17
|
-
maxHeight: '
|
|
14
|
+
width: '100vw',
|
|
15
|
+
height: '100vh',
|
|
16
|
+
maxWidth: '100vw',
|
|
17
|
+
maxHeight: '100vh',
|
|
18
18
|
background: 'transparent',
|
|
19
19
|
border: '0 solid transparent',
|
|
20
20
|
vars: {
|