@likec4/diagram 1.28.0 → 1.28.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/index.js +967 -1150
- package/dist/LikeC4CustomColors.js +2 -2
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4ModelProvider.js +1 -1
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/react.production.js +3 -0
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/customEdge.js +2 -2
- package/dist/base/primitives/customNode.js +2 -2
- package/dist/base/primitives/edge/EdgeContainer.js +1 -1
- package/dist/base/primitives/edge/EdgeLabel.js +1 -1
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
- package/dist/base/primitives/edge/EdgePath.js +23 -16
- package/dist/base/primitives/edge/edge.css.js +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +1 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +1 -2
- package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
- package/dist/base/updateEdges.js +7 -2
- package/dist/base/updateNodes.js +11 -3
- package/dist/bundle/LikeC4View.js +3 -3
- package/dist/bundle/ReactLikeC4.js +1 -1
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/styles.css.js +3 -3
- package/dist/context/ControlsCustomLayout.js +1 -1
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.js +7 -7
- package/dist/context/EnsureMantine.js +2 -2
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.js +4 -4
- package/dist/context/ReduceGraphics.js +2 -2
- package/dist/context/RootContainer.js +5 -9
- package/dist/hooks/safeContext.js +3 -3
- package/dist/hooks/useCurrentViewId.js +1 -1
- package/dist/hooks/useDiagram.d.ts +4 -4
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramUI.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +2 -2
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
- package/dist/likec4diagram/custom/index.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +6 -6
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -4
- package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
- package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
- package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
- package/dist/likec4diagram/ui/search/state.js +11 -9
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
- package/dist/likec4diagram/useLayoutConstraints.js +3 -3
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
- package/dist/likec4model/useLikeC4Model.js +2 -2
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
- package/dist/overlays/Overlays.js +6 -6
- package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +6 -3
- package/dist/overlays/element-details/actor.d.ts +2 -2
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.js +8 -7
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
- package/dist/overlays/relationship-details/SelectEdge.js +3 -6
- package/dist/overlays/relationship-details/actor.d.ts +4 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationship-details/hooks.d.ts +4 -1
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
- package/dist/overlays/relationships-browser/SelectElement.js +8 -5
- package/dist/overlays/relationships-browser/actor.d.ts +2 -1
- package/dist/overlays/relationships-browser/actor.js +6 -12
- package/dist/overlays/relationships-browser/const.d.ts +2 -1
- package/dist/overlays/relationships-browser/const.js +6 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.d.ts +2 -1
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
- package/dist/state/DiagramActorProvider.js +5 -3
- package/dist/state/diagram-machine.d.ts +4 -4
- package/dist/state/diagram-machine.js +3 -4
- package/dist/styles.css.js +1 -1
- package/package.json +17 -13
- package/src/base/BaseXYFlow.tsx +2 -2
- package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgePath.tsx +22 -14
- package/src/base/primitives/edge/edge.css.ts +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +2 -2
- package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
- package/src/base/updateEdges.ts +6 -9
- package/src/base/updateNodes.ts +10 -14
- package/src/context/FramerMotionConfig.tsx +1 -1
- package/src/context/RootContainer.tsx +0 -4
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +2 -2
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
- package/src/likec4diagram/ui/controls/Controls.tsx +53 -55
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -1
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
- package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
- package/src/likec4diagram/ui/search/state.ts +8 -6
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/overlays/Overlays.tsx +2 -2
- package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
- package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
- package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
- package/src/overlays/overlay/Overlay.tsx +2 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
- package/src/overlays/relationship-details/actor.ts +2 -1
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
- package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
- package/src/overlays/relationships-browser/actor.ts +8 -13
- package/src/overlays/relationships-browser/const.ts +8 -1
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
- package/src/state/DiagramActorProvider.tsx +4 -1
- package/src/state/diagram-machine.ts +2 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DiagramEdge, type DiagramView,
|
|
1
|
+
import { type DiagramEdge, type DiagramView, invariant, isAncestor, nonNullable } from '@likec4/core'
|
|
2
2
|
import { ActionIcon, Group } from '@mantine/core'
|
|
3
3
|
import { useCallbackRef, useStateHistory } from '@mantine/hooks'
|
|
4
4
|
import { IconChevronLeft, IconChevronRight, IconX } from '@tabler/icons-react'
|
|
@@ -6,9 +6,9 @@ import { useSelector } from '@xstate/react'
|
|
|
6
6
|
import { Panel, ReactFlowProvider, useReactFlow, useStoreApi } from '@xyflow/react'
|
|
7
7
|
import clsx from 'clsx'
|
|
8
8
|
import { deepEqual } from 'fast-equals'
|
|
9
|
-
import { AnimatePresence, LayoutGroup, m } from '
|
|
9
|
+
import { AnimatePresence, LayoutGroup, m } from 'motion/react'
|
|
10
10
|
import { memo, useEffect, useMemo, useRef } from 'react'
|
|
11
|
-
import {
|
|
11
|
+
import { find, isTruthy } from 'remeda'
|
|
12
12
|
import { BaseXYFlow } from '../../base/BaseXYFlow'
|
|
13
13
|
import { useLikeC4Model } from '../../likec4model/useLikeC4Model'
|
|
14
14
|
import type { RelationshipDetailsTypes, RelationshipDetailsTypes as Types } from './_types'
|
|
@@ -66,10 +66,10 @@ export function RelationshipDetails({ actorRef }: RelationshipDetailsProps) {
|
|
|
66
66
|
<ReactFlowProvider {...initialRef.current}>
|
|
67
67
|
<LayoutGroup id={actorRef.sessionId} inherit={false}>
|
|
68
68
|
<AnimatePresence>
|
|
69
|
-
<RelationshipDetailsInner />
|
|
69
|
+
<RelationshipDetailsInner key="xyflow" />
|
|
70
|
+
<SyncRelationshipDetailsXYFlow key="sync" />
|
|
70
71
|
</AnimatePresence>
|
|
71
72
|
</LayoutGroup>
|
|
72
|
-
<SyncRelationshipDetailsXYFlow />
|
|
73
73
|
</ReactFlowProvider>
|
|
74
74
|
</RelationshipDetailsActorContext.Provider>
|
|
75
75
|
)
|
|
@@ -80,22 +80,24 @@ const selectSubject = (state: RelationshipDetailsSnapshot) => ({
|
|
|
80
80
|
viewId: state.context.viewId,
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
const SyncRelationshipDetailsXYFlow = memo(() => {
|
|
84
84
|
const actor = useRelationshipDetailsActor()
|
|
85
85
|
const subject = useSelector(actor, selectSubject, deepEqual)
|
|
86
86
|
const likec4model = useLikeC4Model(true)
|
|
87
87
|
const view = likec4model.findView(subject.viewId) ?? null
|
|
88
88
|
const data = useMemo(() => {
|
|
89
89
|
let data: RelationshipDetailsViewData
|
|
90
|
-
if ('edgeId' in subject) {
|
|
90
|
+
if ('edgeId' in subject && isTruthy(subject.edgeId)) {
|
|
91
91
|
invariant(view, `view ${subject.viewId} not found`)
|
|
92
92
|
const edge = nonNullable(view.findEdge(subject.edgeId), `edge ${subject.edgeId} not found in ${subject.viewId}`)
|
|
93
93
|
data = computeEdgeDetailsViewData([edge.id], view)
|
|
94
|
-
} else {
|
|
94
|
+
} else if (!!subject.source && !!subject.target) {
|
|
95
95
|
data = computeRelationshipDetailsViewData({
|
|
96
96
|
source: likec4model.element(subject.source),
|
|
97
97
|
target: likec4model.element(subject.target),
|
|
98
98
|
})
|
|
99
|
+
} else {
|
|
100
|
+
return null
|
|
99
101
|
}
|
|
100
102
|
return layoutRelationshipDetails(data, view)
|
|
101
103
|
}, [
|
|
@@ -114,11 +116,13 @@ function SyncRelationshipDetailsXYFlow() {
|
|
|
114
116
|
}, [store, instance.viewportInitialized, actor])
|
|
115
117
|
|
|
116
118
|
useEffect(() => {
|
|
117
|
-
|
|
119
|
+
if (data !== null) {
|
|
120
|
+
actor.send({ type: 'update.layoutData', data })
|
|
121
|
+
}
|
|
118
122
|
}, [data, actor])
|
|
119
123
|
|
|
120
124
|
return null
|
|
121
|
-
}
|
|
125
|
+
})
|
|
122
126
|
|
|
123
127
|
const selector = ({ context }: RelationshipDetailsSnapshot) => ({
|
|
124
128
|
// subject: context.subject,
|
|
@@ -227,13 +231,18 @@ const TopLeftPanel = memo(() => {
|
|
|
227
231
|
return null
|
|
228
232
|
}
|
|
229
233
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
const edges = [...view.edges()]
|
|
235
|
+
|
|
236
|
+
let edge = ('edgeId' in subject && isTruthy(subject.edgeId))
|
|
237
|
+
? edges.find(e => e.id === subject.edgeId)
|
|
238
|
+
: (
|
|
239
|
+
find(edges, (e) => e.source.element?.id === subject.source && e.target.element?.id === subject.target)
|
|
240
|
+
|| find(edges, (e) => {
|
|
241
|
+
return (e.source.element?.id === subject.source ||
|
|
242
|
+
isAncestor(e.source.element?.id ?? '--', subject.source ?? '__')) &&
|
|
243
|
+
(e.target.element?.id === subject.target || isAncestor(e.target.element?.id ?? '', subject.target ?? '__'))
|
|
236
244
|
})
|
|
245
|
+
)
|
|
237
246
|
if (!edge) {
|
|
238
247
|
return null
|
|
239
248
|
}
|
|
@@ -26,20 +26,6 @@ export const SelectEdge = ({
|
|
|
26
26
|
}) => {
|
|
27
27
|
const browser = useRelationshipDetails()
|
|
28
28
|
const viewport = useRef<HTMLDivElement>(null)
|
|
29
|
-
const portalProps = useMantinePortalProps()
|
|
30
|
-
// const data = useLikeC4ElementsTree(scope === 'view' ? viewId : undefined)
|
|
31
|
-
// const tree = useTree({
|
|
32
|
-
// multiple: false
|
|
33
|
-
// })
|
|
34
|
-
|
|
35
|
-
// useEffect(() => {
|
|
36
|
-
// ancestorsFqn(subject.id).reverse().forEach(id => {
|
|
37
|
-
// tree.expand(id)
|
|
38
|
-
// })
|
|
39
|
-
// tree.select(subject.id)
|
|
40
|
-
// }, [subject.id])
|
|
41
|
-
|
|
42
|
-
const theme = useComputedColorScheme()
|
|
43
29
|
|
|
44
30
|
const edgeSource = view.nodes.find(n => n.id === edge.source)
|
|
45
31
|
const edgeTarget = view.nodes.find(n => n.id === edge.target)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type BBox,
|
|
3
|
-
type DiagramView,
|
|
4
3
|
type EdgeId,
|
|
5
4
|
type ExclusiveUnion,
|
|
6
5
|
type Fqn,
|
|
@@ -55,6 +54,8 @@ export type Input = ExclusiveUnion<{
|
|
|
55
54
|
|
|
56
55
|
type Subject = {
|
|
57
56
|
edgeId: EdgeId
|
|
57
|
+
source?: never
|
|
58
|
+
target?: never
|
|
58
59
|
// relationships: null
|
|
59
60
|
} | {
|
|
60
61
|
source: Fqn
|
|
@@ -22,7 +22,7 @@ export const RelationshipEdge = customEdge<RelationshipDetailsTypes.EdgeData>((p
|
|
|
22
22
|
const diagram = useDiagram()
|
|
23
23
|
return (
|
|
24
24
|
<EdgeContainer {...props}>
|
|
25
|
-
<EdgePath {
|
|
25
|
+
<EdgePath edgeProps={props} svgPath={svgPath} />
|
|
26
26
|
<EdgeLabelContainer
|
|
27
27
|
edgeProps={props}
|
|
28
28
|
labelPosition={{
|
|
@@ -4,13 +4,12 @@ import { useCallbackRef, useStateHistory } from '@mantine/hooks'
|
|
|
4
4
|
import { IconChevronLeft, IconChevronRight, IconX } from '@tabler/icons-react'
|
|
5
5
|
import { Panel, ReactFlowProvider, useReactFlow, useStoreApi } from '@xyflow/react'
|
|
6
6
|
import { shallowEqual } from 'fast-equals'
|
|
7
|
-
import { AnimatePresence, LayoutGroup, m } from '
|
|
7
|
+
import { AnimatePresence, LayoutGroup, m } from 'motion/react'
|
|
8
8
|
import { memo, useEffect, useRef } from 'react'
|
|
9
9
|
import type { SnapshotFrom } from 'xstate'
|
|
10
10
|
import { BaseXYFlow } from '../../base/BaseXYFlow'
|
|
11
11
|
import type { RelationshipsBrowserTypes, RelationshipsBrowserTypes as Types } from './_types'
|
|
12
12
|
import type { RelationshipsBrowserActorRef } from './actor'
|
|
13
|
-
import { ViewPadding } from './const'
|
|
14
13
|
import { CompoundNode, ElementNode, EmptyNode, RelationshipEdge } from './custom'
|
|
15
14
|
import {
|
|
16
15
|
RelationshipsBrowserActorContext,
|
|
@@ -101,7 +100,6 @@ const RelationshipsBrowserXYFlow = memo(() => {
|
|
|
101
100
|
nodeTypes={nodeTypes}
|
|
102
101
|
edgeTypes={edgeTypes}
|
|
103
102
|
fitView={false}
|
|
104
|
-
fitViewPadding={ViewPadding}
|
|
105
103
|
onNodeClick={useCallbackRef((e, node) => {
|
|
106
104
|
browser.send({ type: 'xyflow.nodeClick', node })
|
|
107
105
|
})}
|
|
@@ -33,6 +33,7 @@ const selector2 = (state: RelationshipsBrowserSnapshot) => {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
const setHoveredNode = () => {}
|
|
36
37
|
export const SelectElement = memo(() => {
|
|
37
38
|
const browser = useRelationshipsBrowser()
|
|
38
39
|
const {
|
|
@@ -52,6 +53,7 @@ export const SelectElement = memo(() => {
|
|
|
52
53
|
const tree = useTree({
|
|
53
54
|
multiple: false,
|
|
54
55
|
})
|
|
56
|
+
tree.setHoveredNode = setHoveredNode
|
|
55
57
|
|
|
56
58
|
useEffect(() => {
|
|
57
59
|
ancestorsFqn(subjectId).reverse().forEach(id => {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
applyNodeChanges,
|
|
8
8
|
useStoreApi,
|
|
9
9
|
} from '@xyflow/react'
|
|
10
|
-
import { type InternalNodeUpdate,
|
|
10
|
+
import { type InternalNodeUpdate, getViewportForBounds } from '@xyflow/system'
|
|
11
11
|
import { isNullish, omit, prop } from 'remeda'
|
|
12
12
|
import {
|
|
13
13
|
type ActorLogicFrom,
|
|
@@ -109,8 +109,8 @@ export const layouter = fromPromise<{
|
|
|
109
109
|
const currentSubjectCenter = centerXYInternalNode(currentSubjectInternalNode)
|
|
110
110
|
|
|
111
111
|
// Move to center of existing node
|
|
112
|
-
const existingInternalNode = xyflow.getInternalNode(existingNode.id)!
|
|
113
|
-
const existingDimensions = getNodeDimensions(existingInternalNode)
|
|
112
|
+
// const existingInternalNode = xyflow.getInternalNode(existingNode.id)!
|
|
113
|
+
// const existingDimensions = getNodeDimensions(existingInternalNode)
|
|
114
114
|
|
|
115
115
|
// Dim all nodes except the existing node
|
|
116
116
|
// Hide nested nodes
|
|
@@ -146,8 +146,8 @@ export const layouter = fromPromise<{
|
|
|
146
146
|
return {
|
|
147
147
|
...omit(n, ['parentId']),
|
|
148
148
|
position: {
|
|
149
|
-
x: currentSubjectCenter.x -
|
|
150
|
-
y: currentSubjectCenter.y -
|
|
149
|
+
x: currentSubjectCenter.x - n.initialWidth / 2,
|
|
150
|
+
y: currentSubjectCenter.y - n.initialHeight / 2,
|
|
151
151
|
},
|
|
152
152
|
zIndex: ZIndexes.Max,
|
|
153
153
|
hidden: false,
|
|
@@ -164,19 +164,14 @@ export const layouter = fromPromise<{
|
|
|
164
164
|
xyedges: [],
|
|
165
165
|
})
|
|
166
166
|
|
|
167
|
-
// Pick the smaller zoom level
|
|
168
|
-
zoom = Math.min(
|
|
169
|
-
zoom,
|
|
170
|
-
nextviewport.zoom,
|
|
171
|
-
)
|
|
172
167
|
// allow framer to render
|
|
173
|
-
await delay(
|
|
168
|
+
await delay(120)
|
|
174
169
|
next.xynodes = next.xynodes.map(Base.setDimmed(false))
|
|
175
170
|
|
|
176
171
|
if (signal.aborted) {
|
|
177
172
|
return updateXYData()
|
|
178
173
|
}
|
|
179
|
-
await xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, { zoom, duration:
|
|
174
|
+
await xyflow.setCenter(currentSubjectCenter.x, currentSubjectCenter.y, { zoom, duration: 300 })
|
|
180
175
|
await xyflow.setCenter(nextSubjectCenter.x, nextSubjectCenter.y, { zoom })
|
|
181
176
|
return updateXYData()
|
|
182
177
|
})
|
|
@@ -551,7 +546,7 @@ export const relationshipsBrowserLogic = setup({
|
|
|
551
546
|
xyedges: event.output.xyedges,
|
|
552
547
|
navigateFromNode: null,
|
|
553
548
|
})
|
|
554
|
-
enqueue.raise({ type: 'fitDiagram' }, { id: 'fitDiagram', delay: 50 })
|
|
549
|
+
enqueue.raise({ type: 'fitDiagram', duration: 200 }, { id: 'fitDiagram', delay: 50 })
|
|
555
550
|
for (let i = 0; i < 6; i++) {
|
|
556
551
|
enqueue.raise({ type: 'xyflow.updateNodeInternals' }, { delay: 100 + i * 100 })
|
|
557
552
|
}
|
|
@@ -77,10 +77,9 @@ export const RelationshipEdge = customEdge<RelationshipsBrowserTypes.EdgeData>((
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
<EdgeContainer
|
|
80
|
+
<EdgeContainer {...edgeProps}>
|
|
81
81
|
<EdgePath
|
|
82
|
-
|
|
83
|
-
{...edgeProps}
|
|
82
|
+
edgeProps={edgeProps}
|
|
84
83
|
svgPath={svgPath}
|
|
85
84
|
{...markOrange && {
|
|
86
85
|
strokeWidth: 5,
|
|
@@ -70,7 +70,6 @@ export function viewToNodesEdge(
|
|
|
70
70
|
draggable: false,
|
|
71
71
|
selectable: true,
|
|
72
72
|
focusable: true,
|
|
73
|
-
deletable: false,
|
|
74
73
|
position,
|
|
75
74
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
76
75
|
style: {
|
|
@@ -181,7 +180,7 @@ export function viewToNodesEdge(
|
|
|
181
180
|
zIndex: ZIndexes.Edge,
|
|
182
181
|
// selectable: selectable,
|
|
183
182
|
// hidden: !visiblePredicate(edge),
|
|
184
|
-
deletable: false,
|
|
183
|
+
// deletable: false,
|
|
185
184
|
data: {
|
|
186
185
|
sourceFqn: edge.sourceFqn,
|
|
187
186
|
targetFqn: edge.targetFqn,
|
|
@@ -34,7 +34,10 @@ export function DiagramActorProvider({
|
|
|
34
34
|
diagramMachine.provide({
|
|
35
35
|
actions: {
|
|
36
36
|
'trigger:NavigateTo': ((_, { viewId }) => {
|
|
37
|
-
|
|
37
|
+
// this delay allows tap animations to finish
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
handlersRef.current.onNavigateTo?.(viewId as ViewId)
|
|
40
|
+
}, 30)
|
|
38
41
|
}),
|
|
39
42
|
|
|
40
43
|
'trigger:OnChange': ((_, params) => {
|
|
@@ -529,7 +529,6 @@ export const diagramMachine = setup({
|
|
|
529
529
|
type: 'xyflow:fitDiagram',
|
|
530
530
|
params: { duration: 0 },
|
|
531
531
|
},
|
|
532
|
-
'startSyncLayout',
|
|
533
532
|
assign(({ context }) => ({
|
|
534
533
|
navigationHistory: {
|
|
535
534
|
currentIndex: 0,
|
|
@@ -540,6 +539,7 @@ export const diagramMachine = setup({
|
|
|
540
539
|
}],
|
|
541
540
|
},
|
|
542
541
|
})),
|
|
542
|
+
'startSyncLayout',
|
|
543
543
|
],
|
|
544
544
|
target: 'ready',
|
|
545
545
|
}, {
|
|
@@ -947,13 +947,11 @@ export const diagramMachine = setup({
|
|
|
947
947
|
},
|
|
948
948
|
},
|
|
949
949
|
})
|
|
950
|
-
enqueue.raise({ type: 'fitDiagram' }, { id: 'fitDiagram', delay: 80 })
|
|
951
950
|
} else {
|
|
952
951
|
enqueue({
|
|
953
952
|
type: 'xyflow:setViewportCenter',
|
|
954
953
|
params: getBBoxCenter(event.view.bounds),
|
|
955
954
|
})
|
|
956
|
-
enqueue.raise({ type: 'fitDiagram', duration: 200 }, { id: 'fitDiagram', delay: 25 })
|
|
957
955
|
}
|
|
958
956
|
enqueue.assign(updateNavigationHistory)
|
|
959
957
|
enqueue.assign({
|
|
@@ -961,6 +959,7 @@ export const diagramMachine = setup({
|
|
|
961
959
|
lastOnNavigate: null,
|
|
962
960
|
})
|
|
963
961
|
enqueue('startSyncLayout')
|
|
962
|
+
enqueue.raise({ type: 'fitDiagram' }, { id: 'fitDiagram', delay: 25 })
|
|
964
963
|
}),
|
|
965
964
|
target: '#idle',
|
|
966
965
|
},
|