@likec4/diagram 1.24.0 → 1.24.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.css.d.ts +5 -0
- package/dist/LikeC4Diagram.css.js +1 -0
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +6 -2
- package/dist/LikeC4Diagram.props.d.ts +6 -0
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +12 -3
- package/dist/base/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/primitives/compound/CompoundActionButton.css.js +2 -0
- package/dist/base/primitives/compound/CompoundDetailsButton.css.js +2 -0
- package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +0 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
- package/dist/base/primitives/compound/CompoundNodeContainer.js +35 -22
- package/dist/base/primitives/compound/CompoundTitle.css.js +3 -1
- package/dist/base/primitives/customNode.js +1 -1
- package/dist/base/primitives/edge/EdgeContainer.js +5 -4
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -1
- package/dist/base/primitives/edge/EdgeLabel.css.js +2 -5
- package/dist/base/primitives/edge/EdgeLabel.js +5 -5
- package/dist/base/primitives/edge/edge.css.d.ts +1 -1
- package/dist/base/primitives/edge/edge.css.js +4 -5
- package/dist/base/primitives/element/ElementActionButtons.css.js +2 -0
- package/dist/base/primitives/element/ElementActionButtons.js +4 -3
- package/dist/base/primitives/element/ElementDetailsButton.css.js +2 -0
- package/dist/base/primitives/element/ElementNodeContainer.css.js +2 -0
- package/dist/base/primitives/element/ElementNodeContainer.js +3 -1
- package/dist/base/primitives/element/ElementShape.css.js +4 -2
- package/dist/base/primitives/element/ElementShape.js +2 -3
- package/dist/base/primitives/element/ElementTitle.css.js +2 -0
- package/dist/base/primitives/element/styles.css.js +2 -0
- package/dist/components/SearchControl.css.js +2 -0
- package/dist/context/FramerMotionConfig.d.ts +9 -1
- package/dist/context/FramerMotionConfig.js +5 -2
- package/dist/context/RootContainer.js +13 -1
- package/dist/diagram.css +1 -1
- package/dist/globals.css.d.ts +2 -0
- package/dist/hooks/safeContext.js +1 -0
- package/dist/hooks/useDiagram.d.ts +554 -864
- package/dist/hooks/useDiagram.js +1 -0
- package/dist/hooks/useIsReducedGraphics.d.ts +4 -0
- package/dist/hooks/useIsReducedGraphics.js +8 -0
- package/dist/hooks/useXYFlow.js +1 -1
- package/dist/likec4diagram/DiagramUI.d.ts +2 -1
- package/dist/likec4diagram/DiagramUI.js +5 -3
- package/dist/likec4diagram/custom/nodes/nodeTypes.js +2 -2
- package/dist/likec4diagram/ui/controls/styles.css.js +2 -0
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +2 -0
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +3 -4
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +2 -0
- package/dist/overlays/element-details/ElementDetailsCard.js +12 -8
- package/dist/overlays/element-details/actor.d.ts +9084 -2569
- package/dist/overlays/overlay/Overlay.js +6 -3
- package/dist/overlays/relationship-details/RelationshipDetails.js +31 -17
- package/dist/overlays/relationship-details/actor.d.ts +228 -3
- package/dist/overlays/relationship-details/actor.js +86 -14
- package/dist/overlays/relationship-details/hooks.d.ts +3 -0
- package/dist/overlays/relationship-details/hooks.js +6 -2
- package/dist/overlays/relationships-browser/-useRelationshipsView.js +12 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +12 -3
- package/dist/overlays/relationships-browser/actor.d.ts +271 -54
- package/dist/overlays/relationships-browser/actor.js +86 -23
- package/dist/state/DiagramActorProvider.js +12 -2
- package/dist/state/diagram-machine.d.ts +563 -867
- package/dist/state/diagram-machine.js +82 -81
- package/dist/state/persistence.d.ts +5 -0
- package/dist/state/persistence.js +23 -0
- package/package.json +9 -9
- package/src/LikeC4Diagram.css.ts +13 -5
- package/src/LikeC4Diagram.props.ts +7 -0
- package/src/LikeC4Diagram.tsx +33 -24
- package/src/base/BaseXYFlow.tsx +14 -9
- package/src/base/const.ts +1 -1
- package/src/base/primitives/compound/CompoundActionButton.css.ts +6 -0
- package/src/base/primitives/compound/CompoundDetailsButton.css.ts +4 -0
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +41 -59
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +42 -22
- package/src/base/primitives/compound/CompoundTitle.css.ts +14 -13
- package/src/base/primitives/customNode.ts +3 -2
- package/src/base/primitives/edge/EdgeContainer.tsx +4 -3
- package/src/base/primitives/edge/EdgeLabel.css.ts +17 -11
- package/src/base/primitives/edge/EdgeLabel.tsx +4 -4
- package/src/base/primitives/edge/edge.css.ts +47 -27
- package/src/base/primitives/element/ElementActionButtons.css.ts +4 -0
- package/src/base/primitives/element/ElementActionButtons.tsx +4 -2
- package/src/base/primitives/element/ElementDetailsButton.css.ts +6 -8
- package/src/base/primitives/element/ElementNodeContainer.css.ts +18 -21
- package/src/base/primitives/element/ElementNodeContainer.tsx +3 -1
- package/src/base/primitives/element/ElementShape.css.ts +10 -6
- package/src/base/primitives/element/ElementShape.tsx +2 -2
- package/src/components/SearchControl.css.ts +11 -4
- package/src/context/FramerMotionConfig.tsx +13 -2
- package/src/context/RootContainer.tsx +9 -2
- package/src/globals.css.ts +3 -0
- package/src/hooks/safeContext.tsx +2 -1
- package/src/hooks/useDiagram.ts +1 -0
- package/src/hooks/useIsReducedGraphics.ts +5 -0
- package/src/hooks/useXYFlow.ts +1 -1
- package/src/likec4diagram/DiagramUI.tsx +5 -3
- package/src/likec4diagram/custom/nodes/nodeTypes.tsx +2 -2
- package/src/likec4diagram/ui/controls/styles.css.ts +11 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +10 -3
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +6 -3
- package/src/likec4diagram/ui/search/LikeC4Search.css.ts +1 -0
- package/src/overlays/element-details/ElementDetailsCard.tsx +238 -231
- package/src/overlays/overlay/Overlay.css.ts +1 -9
- package/src/overlays/overlay/Overlay.tsx +6 -3
- package/src/overlays/relationship-details/RelationshipDetails.tsx +83 -66
- package/src/overlays/relationship-details/actor.ts +106 -13
- package/src/overlays/relationship-details/hooks.ts +6 -2
- package/src/overlays/relationships-browser/-useRelationshipsView.ts +10 -0
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +16 -8
- package/src/overlays/relationships-browser/actor.ts +92 -22
- package/src/state/DiagramActorProvider.tsx +13 -2
- package/src/state/diagram-machine.ts +80 -79
- package/src/state/persistence.ts +22 -0
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
Divider as MantineDivider,
|
|
22
22
|
Flex,
|
|
23
23
|
Group,
|
|
24
|
+
RemoveScroll,
|
|
24
25
|
ScrollArea,
|
|
25
26
|
Stack,
|
|
26
27
|
Tabs,
|
|
@@ -36,15 +37,17 @@ import { useSessionStorage, useViewportSize } from '@mantine/hooks'
|
|
|
36
37
|
import { useDebouncedCallback, useSyncedRef, useTimeoutEffect } from '@react-hookz/web'
|
|
37
38
|
import { IconExternalLink, IconFileSymlink, IconStack2, IconZoomScan } from '@tabler/icons-react'
|
|
38
39
|
import type { Rect } from '@xyflow/system'
|
|
40
|
+
import clsx from 'clsx'
|
|
39
41
|
import { type PanInfo, m, useDragControls, useMotionValue } from 'framer-motion'
|
|
40
42
|
import { type PropsWithChildren, useCallback, useRef, useState } from 'react'
|
|
41
43
|
import { clamp, isNullish, map, only, partition, pipe } from 'remeda'
|
|
42
44
|
import { Link } from '../../components/Link'
|
|
43
45
|
import { DiagramFeatures, IconRenderer, IfEnabled } from '../../context'
|
|
44
46
|
import { useUpdateEffect } from '../../hooks'
|
|
45
|
-
import { useDiagram
|
|
47
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
46
48
|
import type { OnNavigateTo } from '../../LikeC4Diagram.props'
|
|
47
49
|
import { useLikeC4Model } from '../../likec4model'
|
|
50
|
+
import { stopPropagation } from '../../utils'
|
|
48
51
|
import * as css from './ElementDetailsCard.css'
|
|
49
52
|
import { TabPanelDeployments } from './TabPanelDeployments'
|
|
50
53
|
import { TabPanelRelationships } from './TabPanelRelationships'
|
|
@@ -210,16 +213,16 @@ export function ElementDetailsCard({
|
|
|
210
213
|
if (!ref.current?.open) {
|
|
211
214
|
ref.current?.showModal()
|
|
212
215
|
}
|
|
213
|
-
},
|
|
216
|
+
}, 20)
|
|
214
217
|
|
|
215
218
|
useTimeoutEffect(() => {
|
|
216
219
|
setOpened(true)
|
|
217
|
-
},
|
|
220
|
+
}, 150)
|
|
218
221
|
|
|
219
222
|
return (
|
|
220
223
|
<m.dialog
|
|
221
224
|
ref={ref}
|
|
222
|
-
className={css.dialog}
|
|
225
|
+
className={clsx(css.dialog, RemoveScroll.classNames.fullWidth)}
|
|
223
226
|
layout
|
|
224
227
|
layoutRoot
|
|
225
228
|
initial={{
|
|
@@ -238,252 +241,256 @@ export function ElementDetailsCard({
|
|
|
238
241
|
},
|
|
239
242
|
}}
|
|
240
243
|
onClick={e => {
|
|
244
|
+
e.stopPropagation()
|
|
241
245
|
if ((e.target as any)?.nodeName?.toUpperCase() === 'DIALOG') {
|
|
242
|
-
e.stopPropagation()
|
|
243
246
|
ref.current?.close()
|
|
244
247
|
}
|
|
245
248
|
}}
|
|
249
|
+
onDoubleClick={stopPropagation}
|
|
250
|
+
onPointerDown={stopPropagation}
|
|
246
251
|
onClose={e => {
|
|
247
252
|
e.stopPropagation()
|
|
248
253
|
close()
|
|
249
254
|
}}
|
|
250
255
|
>
|
|
251
|
-
<
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
<Group align="start" gap={'sm'}
|
|
294
|
-
{
|
|
295
|
-
|
|
296
|
-
<
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
{notation && (
|
|
302
|
-
<Text component="div" c={'dimmed'} fz={'sm'} fw={500} lh={1.3} lineClamp={1}>
|
|
303
|
-
{notation}
|
|
256
|
+
<RemoveScroll forwardProps removeScrollBar={false}>
|
|
257
|
+
<Card
|
|
258
|
+
drag
|
|
259
|
+
dragElastic={0}
|
|
260
|
+
dragMomentum={false}
|
|
261
|
+
dragListener={false}
|
|
262
|
+
dragControls={controls}
|
|
263
|
+
withBorder
|
|
264
|
+
shadow="md"
|
|
265
|
+
component={m.div}
|
|
266
|
+
className={css.card}
|
|
267
|
+
initial={{
|
|
268
|
+
top,
|
|
269
|
+
left,
|
|
270
|
+
width: _width,
|
|
271
|
+
height: _height,
|
|
272
|
+
opacity: 0,
|
|
273
|
+
originX,
|
|
274
|
+
originY,
|
|
275
|
+
scale: Math.max(fromScale, 0.7),
|
|
276
|
+
}}
|
|
277
|
+
animate={{
|
|
278
|
+
opacity: 1,
|
|
279
|
+
scale: 1,
|
|
280
|
+
}}
|
|
281
|
+
exit={{
|
|
282
|
+
opacity: 0,
|
|
283
|
+
scale: 0.9,
|
|
284
|
+
translateY: -10,
|
|
285
|
+
transition: {
|
|
286
|
+
duration: 0.1,
|
|
287
|
+
},
|
|
288
|
+
}}
|
|
289
|
+
style={{
|
|
290
|
+
// `style` prop in Mantine doesn't accept motion values
|
|
291
|
+
width: width as any,
|
|
292
|
+
height: height as any,
|
|
293
|
+
}}
|
|
294
|
+
data-likec4-color={nodeModel?.color ?? elementModel.color}>
|
|
295
|
+
<Box
|
|
296
|
+
className={css.cardHeader}
|
|
297
|
+
onPointerDown={e => controls.start(e)}>
|
|
298
|
+
<Group align="start" justify="space-between" gap={'sm'} mb={'sm'} wrap="nowrap">
|
|
299
|
+
<Group align="start" gap={'sm'} style={{ cursor: 'default' }} wrap="nowrap">
|
|
300
|
+
{elementIcon}
|
|
301
|
+
<Box>
|
|
302
|
+
<Text
|
|
303
|
+
component={'div'}
|
|
304
|
+
className={css.title}>
|
|
305
|
+
{elementModel.title}
|
|
304
306
|
</Text>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
{notation && (
|
|
308
|
+
<Text component="div" c={'dimmed'} fz={'sm'} fw={500} lh={1.3} lineClamp={1}>
|
|
309
|
+
{notation}
|
|
310
|
+
</Text>
|
|
311
|
+
)}
|
|
312
|
+
</Box>
|
|
313
|
+
</Group>
|
|
314
|
+
<CloseButton
|
|
315
|
+
size={'lg'}
|
|
316
|
+
onClick={e => {
|
|
317
|
+
e.stopPropagation()
|
|
318
|
+
close()
|
|
319
|
+
}} />
|
|
307
320
|
</Group>
|
|
308
|
-
<
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
<
|
|
323
|
-
{
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
{
|
|
327
|
-
</Flex>
|
|
328
|
-
</Box>
|
|
329
|
-
<ActionIconGroup
|
|
330
|
-
style={{
|
|
331
|
-
alignSelf: 'flex-end',
|
|
332
|
-
}}>
|
|
333
|
-
{defaultLink && (
|
|
334
|
-
<ActionIcon
|
|
335
|
-
component="a"
|
|
336
|
-
href={defaultLink.url}
|
|
337
|
-
target="_blank"
|
|
338
|
-
size="lg"
|
|
339
|
-
variant="default"
|
|
340
|
-
radius="sm"
|
|
341
|
-
>
|
|
342
|
-
<IconExternalLink stroke={1.6} style={{ width: '65%' }} />
|
|
343
|
-
</ActionIcon>
|
|
344
|
-
)}
|
|
345
|
-
<IfEnabled feature="Vscode">
|
|
346
|
-
<Tooltip label="Open source">
|
|
347
|
-
<ActionIcon
|
|
348
|
-
size="lg"
|
|
349
|
-
variant="default"
|
|
350
|
-
radius="sm"
|
|
351
|
-
onClick={e => {
|
|
352
|
-
e.stopPropagation()
|
|
353
|
-
// diagram.openSource({
|
|
354
|
-
// element: elementModel.id,
|
|
355
|
-
// })
|
|
356
|
-
}}>
|
|
357
|
-
<IconFileSymlink stroke={1.8} style={{ width: '62%' }} />
|
|
358
|
-
</ActionIcon>
|
|
359
|
-
</Tooltip>
|
|
360
|
-
</IfEnabled>
|
|
361
|
-
{defaultView && (
|
|
362
|
-
<Tooltip label="Open default view">
|
|
321
|
+
<Group align="baseline" gap={'sm'} wrap="nowrap">
|
|
322
|
+
<Box>
|
|
323
|
+
<SmallLabel>kind</SmallLabel>
|
|
324
|
+
<Badge radius={'sm'} size="sm" fw={600} color="gray">{elementModel.kind}</Badge>
|
|
325
|
+
</Box>
|
|
326
|
+
<Box flex={1}>
|
|
327
|
+
<SmallLabel>tags</SmallLabel>
|
|
328
|
+
<Flex gap={4} flex={1} mt={6}>
|
|
329
|
+
{elementModel.tags.map((tag) => (
|
|
330
|
+
<Badge key={tag} radius={'sm'} size="sm" fw={600} variant="gradient">#{tag}</Badge>
|
|
331
|
+
))}
|
|
332
|
+
{elementModel.tags.length === 0 && <Badge radius={'sm'} size="sm" fw={600} color="gray">—</Badge>}
|
|
333
|
+
</Flex>
|
|
334
|
+
</Box>
|
|
335
|
+
<ActionIconGroup
|
|
336
|
+
style={{
|
|
337
|
+
alignSelf: 'flex-end',
|
|
338
|
+
}}>
|
|
339
|
+
{defaultLink && (
|
|
363
340
|
<ActionIcon
|
|
341
|
+
component="a"
|
|
342
|
+
href={defaultLink.url}
|
|
343
|
+
target="_blank"
|
|
364
344
|
size="lg"
|
|
365
345
|
variant="default"
|
|
366
346
|
radius="sm"
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
diagram.navigateTo(defaultView.id, fromNode ?? undefined)
|
|
370
|
-
}}>
|
|
371
|
-
<IconZoomScan style={{ width: '70%' }} />
|
|
347
|
+
>
|
|
348
|
+
<IconExternalLink stroke={1.6} style={{ width: '65%' }} />
|
|
372
349
|
</ActionIcon>
|
|
373
|
-
</Tooltip>
|
|
374
|
-
)}
|
|
375
|
-
</ActionIconGroup>
|
|
376
|
-
</Group>
|
|
377
|
-
</Box>
|
|
378
|
-
<Tabs
|
|
379
|
-
value={activeTab}
|
|
380
|
-
onChange={v => setActiveTab(v as any)}
|
|
381
|
-
variant="none"
|
|
382
|
-
classNames={{
|
|
383
|
-
root: css.tabsRoot,
|
|
384
|
-
list: css.tabsList,
|
|
385
|
-
tab: css.tabsTab,
|
|
386
|
-
panel: css.tabsPanel,
|
|
387
|
-
}}>
|
|
388
|
-
<TabsList>
|
|
389
|
-
{TABS.map(tab => (
|
|
390
|
-
<TabsTab key={tab} value={tab}>
|
|
391
|
-
{tab}
|
|
392
|
-
</TabsTab>
|
|
393
|
-
))}
|
|
394
|
-
</TabsList>
|
|
395
|
-
|
|
396
|
-
<TabsPanel value="Properties">
|
|
397
|
-
<ScrollArea scrollbars="y" type="auto">
|
|
398
|
-
<Box className={css.propertiesGrid} pt={'xs'}>
|
|
399
|
-
<ElementProperty title="description" emptyValue="no description">
|
|
400
|
-
{elementModel.description}
|
|
401
|
-
</ElementProperty>
|
|
402
|
-
{elementModel.technology && (
|
|
403
|
-
<ElementProperty title="technology">
|
|
404
|
-
{elementModel.technology}
|
|
405
|
-
</ElementProperty>
|
|
406
350
|
)}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
351
|
+
<IfEnabled feature="Vscode">
|
|
352
|
+
<Tooltip label="Open source">
|
|
353
|
+
<ActionIcon
|
|
354
|
+
size="lg"
|
|
355
|
+
variant="default"
|
|
356
|
+
radius="sm"
|
|
357
|
+
onClick={e => {
|
|
358
|
+
e.stopPropagation()
|
|
359
|
+
// diagram.openSource({
|
|
360
|
+
// element: elementModel.id,
|
|
361
|
+
// })
|
|
362
|
+
}}>
|
|
363
|
+
<IconFileSymlink stroke={1.8} style={{ width: '62%' }} />
|
|
364
|
+
</ActionIcon>
|
|
365
|
+
</Tooltip>
|
|
366
|
+
</IfEnabled>
|
|
367
|
+
{defaultView && (
|
|
368
|
+
<Tooltip label="Open default view">
|
|
369
|
+
<ActionIcon
|
|
370
|
+
size="lg"
|
|
371
|
+
variant="default"
|
|
372
|
+
radius="sm"
|
|
373
|
+
onClick={e => {
|
|
374
|
+
e.stopPropagation()
|
|
375
|
+
diagram.navigateTo(defaultView.id, fromNode ?? undefined)
|
|
376
|
+
}}>
|
|
377
|
+
<IconZoomScan style={{ width: '70%' }} />
|
|
378
|
+
</ActionIcon>
|
|
379
|
+
</Tooltip>
|
|
414
380
|
)}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
381
|
+
</ActionIconGroup>
|
|
382
|
+
</Group>
|
|
383
|
+
</Box>
|
|
384
|
+
<Tabs
|
|
385
|
+
value={activeTab}
|
|
386
|
+
onChange={v => setActiveTab(v as any)}
|
|
387
|
+
variant="none"
|
|
388
|
+
classNames={{
|
|
389
|
+
root: css.tabsRoot,
|
|
390
|
+
list: css.tabsList,
|
|
391
|
+
tab: css.tabsTab,
|
|
392
|
+
panel: css.tabsPanel,
|
|
393
|
+
}}>
|
|
394
|
+
<TabsList>
|
|
395
|
+
{TABS.map(tab => (
|
|
396
|
+
<TabsTab key={tab} value={tab}>
|
|
397
|
+
{tab}
|
|
398
|
+
</TabsTab>
|
|
399
|
+
))}
|
|
400
|
+
</TabsList>
|
|
401
|
+
|
|
402
|
+
<TabsPanel value="Properties">
|
|
403
|
+
<ScrollArea scrollbars="y" type="auto">
|
|
404
|
+
<Box className={css.propertiesGrid} pt={'xs'}>
|
|
405
|
+
<ElementProperty title="description" emptyValue="no description">
|
|
406
|
+
{elementModel.description}
|
|
407
|
+
</ElementProperty>
|
|
408
|
+
{elementModel.technology && (
|
|
409
|
+
<ElementProperty title="technology">
|
|
410
|
+
{elementModel.technology}
|
|
411
|
+
</ElementProperty>
|
|
412
|
+
)}
|
|
413
|
+
{elementModel.links.length > 0 && (
|
|
414
|
+
<>
|
|
415
|
+
<PropertyLabel>links</PropertyLabel>
|
|
416
|
+
<Stack gap={'xs'} align="flex-start">
|
|
417
|
+
{elementModel.links.map((link, i) => <Link key={i} value={link} />)}
|
|
418
|
+
</Stack>
|
|
419
|
+
</>
|
|
420
|
+
)}
|
|
421
|
+
{elementModel.$element.metadata && <ElementMetata value={elementModel.$element.metadata} />}
|
|
422
|
+
</Box>
|
|
423
|
+
</ScrollArea>
|
|
424
|
+
</TabsPanel>
|
|
425
|
+
|
|
426
|
+
<TabsPanel value="Relationships">
|
|
427
|
+
<DiagramFeatures
|
|
428
|
+
overrides={{
|
|
429
|
+
enableRelationshipBrowser: false,
|
|
430
|
+
enableNavigateTo: false,
|
|
431
|
+
}}>
|
|
432
|
+
{opened && activeTab === 'Relationships' && (
|
|
433
|
+
<TabPanelRelationships
|
|
434
|
+
element={elementModel}
|
|
435
|
+
node={nodeModel ?? null} />
|
|
462
436
|
)}
|
|
463
|
-
</
|
|
464
|
-
</
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
437
|
+
</DiagramFeatures>
|
|
438
|
+
</TabsPanel>
|
|
439
|
+
|
|
440
|
+
<TabsPanel value="Views">
|
|
441
|
+
<ScrollArea scrollbars="y" type="auto">
|
|
442
|
+
<Stack gap={'lg'}>
|
|
443
|
+
{viewsOf.length > 0 && (
|
|
444
|
+
<Box>
|
|
445
|
+
<Divider label="views of the element (scoped)" />
|
|
446
|
+
<Stack gap={'sm'}>
|
|
447
|
+
{viewsOf.map((view) => (
|
|
448
|
+
<ViewButton
|
|
449
|
+
key={view.id}
|
|
450
|
+
view={view}
|
|
451
|
+
onNavigateTo={to => diagram.navigateTo(to, fromNode ?? undefined)} />
|
|
452
|
+
))}
|
|
453
|
+
</Stack>
|
|
454
|
+
</Box>
|
|
455
|
+
)}
|
|
456
|
+
{otherViews.length > 0 && (
|
|
457
|
+
<Box>
|
|
458
|
+
<Divider label="views including this element" />
|
|
459
|
+
<Stack gap={'sm'}>
|
|
460
|
+
{otherViews.map((view) => (
|
|
461
|
+
<ViewButton
|
|
462
|
+
key={view.id}
|
|
463
|
+
view={view}
|
|
464
|
+
onNavigateTo={to => diagram.navigateTo(to, fromNode ?? undefined)} />
|
|
465
|
+
))}
|
|
466
|
+
</Stack>
|
|
467
|
+
</Box>
|
|
468
|
+
)}
|
|
469
|
+
</Stack>
|
|
470
|
+
</ScrollArea>
|
|
471
|
+
</TabsPanel>
|
|
472
|
+
|
|
473
|
+
<TabsPanel value="Structure">
|
|
474
|
+
<ScrollArea scrollbars="y" type="auto">
|
|
475
|
+
<TabPanelStructure element={elementModel} />
|
|
476
|
+
</ScrollArea>
|
|
477
|
+
</TabsPanel>
|
|
478
|
+
|
|
479
|
+
<TabsPanel value="Deployments">
|
|
480
|
+
<ScrollArea scrollbars="y" type="auto">
|
|
481
|
+
<TabPanelDeployments elementFqn={elementModel.id} />
|
|
482
|
+
</ScrollArea>
|
|
483
|
+
</TabsPanel>
|
|
484
|
+
</Tabs>
|
|
485
|
+
<m.div
|
|
486
|
+
className={css.resizeHandle}
|
|
487
|
+
drag
|
|
488
|
+
dragElastic={0}
|
|
489
|
+
dragMomentum={false}
|
|
490
|
+
onDrag={handleDrag}
|
|
491
|
+
dragConstraints={{ top: 0, left: 0, right: 0, bottom: 0 }} />
|
|
492
|
+
</Card>
|
|
493
|
+
</RemoveScroll>
|
|
487
494
|
</m.dialog>
|
|
488
495
|
)
|
|
489
496
|
}
|
|
@@ -42,7 +42,7 @@ export const dialog = style({
|
|
|
42
42
|
borderRadius: mantine.radius.sm,
|
|
43
43
|
inset: '2rem',
|
|
44
44
|
width: 'calc(100vw - 4rem)',
|
|
45
|
-
|
|
45
|
+
height: 'calc(100vh - 4rem)',
|
|
46
46
|
},
|
|
47
47
|
[mantine.smallerThan('sm')]: {
|
|
48
48
|
border: 'none',
|
|
@@ -59,16 +59,8 @@ export const body = style({
|
|
|
59
59
|
containerType: 'size',
|
|
60
60
|
border: `0 solid transparent`,
|
|
61
61
|
borderRadius: calc(borderRadius).subtract('2px').toString(),
|
|
62
|
-
// borderRadius: borderRadius,
|
|
63
62
|
backgroundColor: mantine.colors.body,
|
|
64
63
|
overflow: 'hidden',
|
|
65
64
|
width: '100%',
|
|
66
65
|
height: '100%',
|
|
67
|
-
// visibility: 'hidden',
|
|
68
|
-
// selectors: {
|
|
69
|
-
// [`${dialog}[open] &`]: {
|
|
70
|
-
// visibility: 'visible',
|
|
71
|
-
// },
|
|
72
|
-
// },
|
|
73
|
-
// backgroundColor: 'red',
|
|
74
66
|
})
|
|
@@ -6,6 +6,7 @@ import { useDebouncedCallback, useSyncedRef, useTimeoutEffect } from '@react-hoo
|
|
|
6
6
|
import clsx from 'clsx'
|
|
7
7
|
import { type HTMLMotionProps, m } from 'framer-motion'
|
|
8
8
|
import { type PropsWithChildren, useLayoutEffect, useRef, useState } from 'react'
|
|
9
|
+
import { stopPropagation } from '../../utils'
|
|
9
10
|
import * as css from './Overlay.css'
|
|
10
11
|
|
|
11
12
|
type OverlayProps = PropsWithChildren<
|
|
@@ -65,7 +66,7 @@ export function Overlay({ children, onClose, className, classes, ...rest }: Over
|
|
|
65
66
|
return (
|
|
66
67
|
<m.dialog
|
|
67
68
|
ref={dialogRef}
|
|
68
|
-
className={clsx(css.dialog, classes?.dialog, className)}
|
|
69
|
+
className={clsx(css.dialog, classes?.dialog, className, RemoveScroll.classNames.fullWidth)}
|
|
69
70
|
initial={{
|
|
70
71
|
'--backdrop-blur': '0px',
|
|
71
72
|
'--backdrop-opacity': '5%',
|
|
@@ -92,19 +93,21 @@ export function Overlay({ children, onClose, className, classes, ...rest }: Over
|
|
|
92
93
|
},
|
|
93
94
|
}}
|
|
94
95
|
onClick={e => {
|
|
96
|
+
e.stopPropagation()
|
|
95
97
|
if ((e.target as any)?.nodeName?.toUpperCase() === 'DIALOG') {
|
|
96
|
-
e.stopPropagation()
|
|
97
98
|
dialogRef.current?.close()
|
|
98
99
|
return
|
|
99
100
|
}
|
|
100
101
|
}}
|
|
102
|
+
onDoubleClick={stopPropagation}
|
|
103
|
+
onPointerDown={stopPropagation}
|
|
101
104
|
onClose={e => {
|
|
102
105
|
e.stopPropagation()
|
|
103
106
|
close()
|
|
104
107
|
}}
|
|
105
108
|
{...rest}
|
|
106
109
|
>
|
|
107
|
-
<RemoveScroll forwardProps>
|
|
110
|
+
<RemoveScroll forwardProps removeScrollBar={false}>
|
|
108
111
|
<Box className={clsx(css.body, classes?.body)}>
|
|
109
112
|
{opened && <>{children}</>}
|
|
110
113
|
</Box>
|