@likec4/diagram 1.0.0-next.2 → 1.0.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.
Files changed (124) hide show
  1. package/dist/LikeC4Diagram.css.d.ts +0 -1
  2. package/dist/LikeC4Diagram.d.ts +1 -2
  3. package/dist/LikeC4Diagram.props.d.ts +24 -25
  4. package/dist/StaticLikeC4Diagram.d.ts +1 -2
  5. package/dist/globals.css.d.ts +1 -0
  6. package/dist/hooks/index.d.ts +2 -3
  7. package/dist/hooks/useSetState.d.ts +3 -0
  8. package/dist/hooks/useUpdateEffect.d.ts +4 -0
  9. package/dist/icons/Clipboard.d.ts +0 -1
  10. package/dist/icons/Link.d.ts +0 -1
  11. package/dist/icons/ZoomIn.d.ts +0 -1
  12. package/dist/icons/index.d.ts +0 -1
  13. package/dist/index.d.ts +1 -4
  14. package/dist/index.mjs +9388 -0
  15. package/dist/mantine/EnsureMantine.d.ts +2 -4
  16. package/dist/mantine/theme.d.ts +3 -0
  17. package/dist/mantine.css.d.ts +1 -0
  18. package/dist/state/DiagramContext.d.ts +386 -0
  19. package/dist/state/WhenInitialized.d.ts +3 -0
  20. package/dist/state/diagramStore.d.ts +428 -0
  21. package/dist/state/index.d.ts +4 -2
  22. package/dist/state/useDiagramStore.d.ts +387 -0
  23. package/dist/style.css +1212 -1
  24. package/dist/theme.css.d.ts +16 -2
  25. package/dist/ui/Camera.d.ts +0 -1
  26. package/dist/ui/KeepAspectRatio.css.d.ts +0 -1
  27. package/dist/ui/KeepAspectRatio.d.ts +0 -1
  28. package/dist/ui/OptionsPanel.css.d.ts +0 -1
  29. package/dist/ui/OptionsPanel.d.ts +0 -1
  30. package/dist/ui/index.d.ts +0 -1
  31. package/dist/ui/options/NodeOptions.d.ts +0 -1
  32. package/dist/xyflow/FitviewOnDiagramChange.d.ts +1 -5
  33. package/dist/xyflow/SyncWithDiagram.d.ts +5 -0
  34. package/dist/xyflow/XYFlowBackground.d.ts +0 -1
  35. package/dist/xyflow/XYFlowEvents.d.ts +5 -15
  36. package/dist/xyflow/XYFlowWrapper.d.ts +4 -5
  37. package/dist/xyflow/const.d.ts +1 -2
  38. package/dist/xyflow/diagram-to-xyflow.d.ts +4 -2
  39. package/dist/xyflow/edges/RelationshipEdge.d.ts +7 -7
  40. package/dist/xyflow/edges/edges.css.d.ts +2 -1
  41. package/dist/xyflow/edges/utils.d.ts +3 -4
  42. package/dist/xyflow/hooks/index.d.ts +2 -37
  43. package/dist/xyflow/hooks/{use-layout-/321/201onstraints.d.ts → useLayoutConstraints.d.ts} +2 -4
  44. package/dist/xyflow/hooks/useXYFlow.d.ts +266 -0
  45. package/dist/xyflow/nodes/compound/CompoundNode.css.d.ts +0 -1
  46. package/dist/xyflow/nodes/compound/CompoundNode.d.ts +0 -1
  47. package/dist/xyflow/nodes/compound/index.d.ts +0 -1
  48. package/dist/xyflow/nodes/element/ElementIcon.d.ts +1 -2
  49. package/dist/xyflow/nodes/element/ElementLink.css.d.ts +0 -1
  50. package/dist/xyflow/nodes/element/ElementLink.d.ts +1 -2
  51. package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -3
  52. package/dist/xyflow/nodes/element/ElementShapeSvg.d.ts +2 -3
  53. package/dist/xyflow/nodes/element/element.css.d.ts +0 -1
  54. package/dist/xyflow/nodes/element/index.d.ts +1 -2
  55. package/dist/xyflow/nodes/shared/NavigateToBtn.d.ts +0 -1
  56. package/dist/xyflow/types.d.ts +20 -8
  57. package/dist/xyflow/utils.d.ts +0 -1
  58. package/package.json +36 -34
  59. package/src/LikeC4Diagram.css.ts +31 -0
  60. package/src/LikeC4Diagram.props.ts +154 -0
  61. package/src/LikeC4Diagram.tsx +119 -0
  62. package/src/StaticLikeC4Diagram.tsx +39 -0
  63. package/src/globals.css.ts +128 -0
  64. package/src/hooks/index.ts +2 -0
  65. package/src/hooks/useSetState.ts +19 -0
  66. package/src/hooks/useUpdateEffect.ts +28 -0
  67. package/src/icons/Clipboard.tsx +24 -0
  68. package/src/icons/Link.tsx +23 -0
  69. package/src/icons/ZoomIn.tsx +25 -0
  70. package/src/icons/index.ts +3 -0
  71. package/src/index.ts +11 -0
  72. package/src/mantine/EnsureMantine.tsx +14 -0
  73. package/src/mantine/theme.ts +19 -0
  74. package/src/mantine.css.ts +4 -0
  75. package/src/reset.d.ts +2 -0
  76. package/src/state/DiagramContext.tsx +42 -0
  77. package/src/state/WhenInitialized.tsx +24 -0
  78. package/src/state/diagramStore.ts +358 -0
  79. package/src/state/index.ts +4 -0
  80. package/src/state/useDiagramStore.ts +39 -0
  81. package/src/theme.css.ts +64 -0
  82. package/src/ui/Camera.tsx +174 -0
  83. package/src/ui/KeepAspectRatio.css.ts +7 -0
  84. package/src/ui/KeepAspectRatio.tsx +35 -0
  85. package/src/ui/OptionsPanel.css.ts +10 -0
  86. package/src/ui/OptionsPanel.tsx +65 -0
  87. package/src/ui/index.ts +3 -0
  88. package/src/ui/options/NodeOptions.tsx +253 -0
  89. package/src/xyflow/FitviewOnDiagramChange.tsx +93 -0
  90. package/src/xyflow/SyncWithDiagram.tsx +113 -0
  91. package/src/xyflow/XYFlowBackground.tsx +33 -0
  92. package/src/xyflow/XYFlowEvents.tsx +100 -0
  93. package/src/xyflow/XYFlowWrapper.tsx +166 -0
  94. package/src/xyflow/const.ts +7 -0
  95. package/src/xyflow/diagram-to-xyflow.ts +197 -0
  96. package/src/xyflow/edges/RelationshipEdge.tsx +288 -0
  97. package/src/xyflow/edges/edges.css.ts +124 -0
  98. package/src/xyflow/edges/utils.ts +110 -0
  99. package/src/xyflow/hooks/index.ts +2 -0
  100. package/src/xyflow/hooks/useLayoutConstraints.ts +289 -0
  101. package/src/xyflow/hooks/useXYFlow.ts +20 -0
  102. package/src/xyflow/nodes/compound/CompoundNode.css.ts +191 -0
  103. package/src/xyflow/nodes/compound/CompoundNode.tsx +105 -0
  104. package/src/xyflow/nodes/compound/index.ts +1 -0
  105. package/src/xyflow/nodes/element/ElementIcon.tsx +44 -0
  106. package/src/xyflow/nodes/element/ElementLink.css.ts +67 -0
  107. package/src/xyflow/nodes/element/ElementLink.tsx +94 -0
  108. package/src/xyflow/nodes/element/ElementNode.tsx +225 -0
  109. package/src/xyflow/nodes/element/ElementShapeSvg.tsx +181 -0
  110. package/src/xyflow/nodes/element/element.css.ts +261 -0
  111. package/src/xyflow/nodes/element/index.ts +1 -0
  112. package/src/xyflow/nodes/shared/NavigateToBtn.tsx +25 -0
  113. package/src/xyflow/types.ts +100 -0
  114. package/src/xyflow/utils.ts +12 -0
  115. package/dist/EmbeddedLikeC4Diagram.css.d.ts +0 -6
  116. package/dist/EmbeddedLikeC4Diagram.d.ts +0 -18
  117. package/dist/bundle.d.ts +0 -3
  118. package/dist/hooks/use-set-state.d.ts +0 -2
  119. package/dist/hooks/use-update-effect.d.ts +0 -4
  120. package/dist/index.css.d.ts +0 -2
  121. package/dist/index.js +0 -13043
  122. package/dist/mantine/index.d.ts +0 -3
  123. package/dist/state/DiagramState.d.ts +0 -162
  124. package/dist/xyflow/UpdateOnDiagramChange.d.ts +0 -10
@@ -0,0 +1,105 @@
1
+ import { defaultTheme } from '@likec4/core'
2
+ import { Box, Text } from '@mantine/core'
3
+ import { assignInlineVars } from '@vanilla-extract/dynamic'
4
+ import { Handle, type NodeProps, Position } from '@xyflow/react'
5
+ import clsx from 'clsx'
6
+ import { deepEqual as eq } from 'fast-equals'
7
+ import { scale, toHex } from 'khroma'
8
+ import { memo, useMemo } from 'react'
9
+ import { useDiagramState } from '../../../state'
10
+ import { vars } from '../../../theme.css'
11
+ import type { CompoundXYFlowNode } from '../../types'
12
+ import { NavigateToBtn } from '../shared/NavigateToBtn'
13
+ import { cssCompound, cssContainer, cssIndicator, cssNavigateBtn, cssTitle } from './CompoundNode.css'
14
+
15
+ type CompoundNodeProps = Pick<
16
+ NodeProps<CompoundXYFlowNode>,
17
+ 'id' | 'data' | 'width' | 'height' | 'selected'
18
+ >
19
+
20
+ // @ts-ignore
21
+ const isEqualProps = (prev: CompoundNodeProps, next: CompoundNodeProps) => (
22
+ prev.id === next.id
23
+ && prev.selected === next.selected
24
+ && prev.width === next.width
25
+ && prev.height === next.height
26
+ && eq(prev.data, next.data)
27
+ )
28
+
29
+ const compoundColor = (color: string, depth: number) =>
30
+ toHex(
31
+ scale(color, {
32
+ l: -35 - 5 * depth,
33
+ s: -15 - 5 * depth
34
+ })
35
+ )
36
+
37
+ export const CompoundNodeMemo = /* @__PURE__ */ memo<CompoundNodeProps>(function CompoundNode({
38
+ id,
39
+ data: {
40
+ element
41
+ }
42
+ }) {
43
+ // useTilg()
44
+ const { color, depth = 0, ...compound } = element
45
+ const colors = useMemo(() => {
46
+ const colors = defaultTheme.elements[color]
47
+ return {
48
+ fill: compoundColor(colors.fill, depth),
49
+ stroke: compoundColor(colors.stroke, depth)
50
+ }
51
+ }, [color, depth])
52
+
53
+ // const w = toDomPrecision(width ?? compound.width)
54
+ // const h = toDomPrecision(height ?? compound.height)
55
+
56
+ const { isHovered, hasOnNavigateTo } = useDiagramState(s => ({
57
+ isHovered: s.hoveredNodeId === id,
58
+ hasOnNavigateTo: !!s.onNavigateTo
59
+ }))
60
+ const isnavigable = !!compound.navigateTo && hasOnNavigateTo
61
+
62
+ return (
63
+ <Box
64
+ className={clsx(cssContainer, 'likec4-compound-node')}
65
+ style={assignInlineVars({ fill: vars.element.fill, stroke: vars.element.stroke }, {
66
+ fill: colors.fill,
67
+ stroke: colors.stroke
68
+ })}
69
+ mod={{
70
+ 'likec4-color': color,
71
+ 'likec4-shape': compound.shape,
72
+ 'likec4-navigable': isnavigable,
73
+ hovered: isHovered
74
+ }}
75
+ >
76
+ <Handle
77
+ type="target"
78
+ position={Position.Top}
79
+ style={{ visibility: 'hidden' }}
80
+ />
81
+ <svg className={cssIndicator}>
82
+ <rect
83
+ x={0}
84
+ y={0}
85
+ width={'100%'}
86
+ height={'100%'}
87
+ rx={6}
88
+ />
89
+ </svg>
90
+ <div className={clsx(cssCompound, 'likec4-compound')}>
91
+ <Text
92
+ component="div"
93
+ className={clsx(cssTitle, 'likec4-compound-title')}>
94
+ {compound.title}
95
+ </Text>
96
+ </div>
97
+ {isnavigable && <NavigateToBtn xynodeId={id} className={cssNavigateBtn} />}
98
+ <Handle
99
+ type="source"
100
+ position={Position.Bottom}
101
+ style={{ visibility: 'hidden' }}
102
+ />
103
+ </Box>
104
+ )
105
+ })
@@ -0,0 +1 @@
1
+ export { CompoundNodeMemo as CompoundNode } from './CompoundNode'
@@ -0,0 +1,44 @@
1
+ import { assignInlineVars } from '@vanilla-extract/dynamic'
2
+ import clsx from 'clsx'
3
+ import type { XYFlowNode } from '../../types'
4
+ import { elementIcon, iconMaxH } from './element.css'
5
+
6
+ type ElementIconProps = {
7
+ node: XYFlowNode['data']['element']
8
+ maxWidth?: number | undefined
9
+ paddingX?: number | undefined
10
+ paddingY?: number | undefined
11
+ }
12
+
13
+ export function ElementIcon({
14
+ node,
15
+ paddingY = 32
16
+ }: ElementIconProps) {
17
+ if (!node.icon) {
18
+ return null
19
+ }
20
+ const firstLabel = node.labels[0]
21
+ if (!firstLabel) {
22
+ return null
23
+ }
24
+
25
+ const firstLabelY = Math.floor(firstLabel.pt[1] - firstLabel.fontSize * 1.25)
26
+ const maxIconHeight = Math.floor(firstLabelY - paddingY - 16)
27
+ // const maxIconWidth = maxWidth ?? node.width - paddingX * 2
28
+
29
+ // const centerY = paddingY + Math.floor(maxIconHeight / 2)
30
+ // const centerX = Math.floor(node.width / 2)
31
+
32
+ return (
33
+ <div
34
+ className={clsx(elementIcon, 'likec4-element-icon')}
35
+ style={assignInlineVars({ iconMaxH }, {
36
+ iconMaxH: maxIconHeight + 'px'
37
+ })}>
38
+ <img
39
+ src={node.icon!}
40
+ alt={node.title}
41
+ />
42
+ </div>
43
+ )
44
+ }
@@ -0,0 +1,67 @@
1
+ import { globalStyle, style } from '@vanilla-extract/css'
2
+ import { vars } from '../../../theme.css'
3
+
4
+ export const elementLink = style({
5
+ position: 'absolute',
6
+ left: 0,
7
+ bottom: 0,
8
+ paddingLeft: 6,
9
+ paddingBottom: 6,
10
+ pointerEvents: 'all',
11
+ selectors: {
12
+ ':where([data-likec4-shape="cylinder"], [data-likec4-shape="storage"]) &': {
13
+ bottom: 6
14
+ },
15
+ ':where([data-likec4-shape="queue"]) &': {
16
+ left: 12,
17
+ bottom: -3
18
+ }
19
+ }
20
+ // fontSize: rem(10),
21
+ // height: 12,
22
+ // width: '100%',
23
+ // height: '100%',
24
+ // vars: {
25
+ // [stokeFillMix]: `color-mix(in srgb, ${vars.element.stroke} 90%, ${vars.element.fill})`
26
+ // }
27
+ })
28
+
29
+ export const trigger = style({
30
+ display: 'flex',
31
+ lineHeight: 0.75,
32
+ fontSize: 11,
33
+ fontWeight: 500,
34
+ alignItems: 'center',
35
+ justifyContent: 'center',
36
+ color: vars.element.loContrast,
37
+ paddingTop: 2,
38
+ paddingBottom: 2,
39
+ paddingLeft: 4,
40
+ paddingRight: 5,
41
+ borderRadius: 3,
42
+ backgroundColor: `color-mix(in srgb, ${vars.element.stroke}, transparent 20%)`,
43
+ transition: 'all 180ms ease-out',
44
+ opacity: 0.85,
45
+ ':hover': {
46
+ color: vars.element.hiContrast,
47
+ backgroundColor: vars.element.stroke,
48
+ opacity: 1
49
+ }
50
+ })
51
+
52
+ globalStyle(`${trigger} .icon`, {
53
+ display: 'inline-block',
54
+ lineHeight: 1,
55
+ width: 10,
56
+ height: 10,
57
+ opacity: 0.6
58
+ })
59
+ globalStyle(`${trigger} span`, {
60
+ display: 'inline-block',
61
+ lineHeight: 1,
62
+ marginLeft: 3
63
+ })
64
+
65
+ export const linkButton = style({
66
+ textAlign: 'left'
67
+ })
@@ -0,0 +1,94 @@
1
+ import { invariant } from '@likec4/core'
2
+ import {
3
+ Anchor,
4
+ Box,
5
+ Button,
6
+ CopyButton,
7
+ Group,
8
+ HoverCard,
9
+ HoverCardDropdown,
10
+ HoverCardTarget,
11
+ Stack,
12
+ UnstyledButton
13
+ } from '@mantine/core'
14
+ import clsx from 'clsx'
15
+ import { useId } from 'react'
16
+ import { clamp } from 'remeda'
17
+ import { Link } from '../../../icons'
18
+ import type { XYFlowNode } from '../../types'
19
+ import { elementLink, trigger } from './ElementLink.css'
20
+
21
+ type ElementLinkProps = {
22
+ element: XYFlowNode['data']['element']
23
+ }
24
+
25
+ export function ElementLink({
26
+ element
27
+ }: ElementLinkProps) {
28
+ invariant(element.links, 'ElementLink: links are required')
29
+ const id = useId()
30
+ // const mantineCtx = useMantineContext()
31
+ // const root = mantineCtx.getRootElement()
32
+
33
+ // const targetSelector = `.react-flow:has([data-likec4-linkid="${id}"])`
34
+ // // const target = root?.querySelector<HTMLDivElement>(targetSelector) ?? targetSelector
35
+
36
+ // const portalProps = useMemo(() => ({
37
+ // get target(): HTMLElement | string {
38
+ // const root = mantineCtx.getRootElement()
39
+ // return root?.querySelector<HTMLDivElement>(targetSelector) ?? targetSelector
40
+ // }
41
+ // }), [targetSelector])
42
+ return (
43
+ <div className={elementLink} data-likec4-linkid={id}>
44
+ <HoverCard
45
+ position="bottom-start"
46
+ shadow="lg"
47
+ radius="sm"
48
+ classNames={{
49
+ dropdown: clsx('nodrag', 'nopan')
50
+ }}
51
+ transitionProps={{
52
+ transition: 'pop'
53
+ }}
54
+ // portalProps={portalProps}
55
+ withinPortal={false}
56
+ floatingStrategy={'fixed'}
57
+ openDelay={350}
58
+ closeDelay={800}
59
+ offset={{
60
+ mainAxis: 5,
61
+ crossAxis: -10
62
+ }}>
63
+ <HoverCardTarget>
64
+ <UnstyledButton
65
+ className={clsx('nodrag nopan', trigger)}
66
+ autoFocus={false}>
67
+ <Link />
68
+ <span>links</span>
69
+ </UnstyledButton>
70
+ </HoverCardTarget>
71
+ <HoverCardDropdown onClick={e => e.stopPropagation()} p={'xs'}>
72
+ <Stack gap={'xs'}>
73
+ {element.links.map((link) => (
74
+ <Group key={link} wrap="nowrap" gap={'sm'}>
75
+ <Box flex={'1'} style={{ overflow: 'clip', maxWidth: clamp(element.width, { min: 200, max: 400 }) }}>
76
+ <Anchor href={link} target="_blank" fz="13" truncate="end">
77
+ {link}
78
+ </Anchor>
79
+ </Box>
80
+ <CopyButton value={link}>
81
+ {({ copied, copy }) => (
82
+ <Button size="compact-xs" fz={'12'} onClick={copy} color={copied ? 'teal' : 'gray'}>
83
+ {copied ? 'Copied' : 'Copy'}
84
+ </Button>
85
+ )}
86
+ </CopyButton>
87
+ </Group>
88
+ ))}
89
+ </Stack>
90
+ </HoverCardDropdown>
91
+ </HoverCard>
92
+ </div>
93
+ )
94
+ }
@@ -0,0 +1,225 @@
1
+ import { Text } from '@mantine/core'
2
+ import { Handle, type NodeProps, Position } from '@xyflow/react'
3
+ import clsx from 'clsx'
4
+ import { motion, type Variants } from 'framer-motion'
5
+ import { isNumber } from 'remeda'
6
+ import { useDiagramState } from '../../../state'
7
+ import type { ElementXYFlowNode } from '../../types'
8
+ import { toDomPrecision } from '../../utils'
9
+ import { NavigateToBtn } from '../shared/NavigateToBtn'
10
+ import {
11
+ container,
12
+ cssElement,
13
+ cssNavigateBtn,
14
+ cssShapeSvg,
15
+ description as cssdescription,
16
+ indicator,
17
+ technology as csstechnology,
18
+ title as cssTitle
19
+ } from './element.css'
20
+ import { ElementIcon } from './ElementIcon'
21
+ import { ElementLink } from './ElementLink'
22
+ import { ElementShapeSvg, SelectedIndicator } from './ElementShapeSvg'
23
+
24
+ type ElementNodeProps = NodeProps<ElementXYFlowNode>
25
+
26
+ const selectedScale = 1.015
27
+ // Frame-motion variants
28
+ const variants = {
29
+ idle: (_, { scale }) => ({
30
+ scale: 1,
31
+ transition: {
32
+ delay: isNumber(scale) && scale > selectedScale ? 0.075 : 0
33
+ }
34
+ }),
35
+ selected: (_, { scale }) => ({
36
+ scale: selectedScale,
37
+ transition: {
38
+ delay: isNumber(scale) && scale > selectedScale ? 0.075 : 0
39
+ }
40
+ }),
41
+ // dragging: {
42
+ // scale: selectedScale
43
+ // },
44
+ // hovered: {
45
+ // scale: 1.08
46
+ // },
47
+ // hover: (_, {scale}) => isNumber(scale) && scale < 1.02 ? ({
48
+ // scale: 1.08,
49
+ // }) : ({
50
+ // scale: 1.08,
51
+ // transition: {
52
+ // delay: 1
53
+ // }
54
+ // }),
55
+ hovered: (_, { scale }) => ({
56
+ scale: 1.06,
57
+ transition: {
58
+ delay: isNumber(scale) && scale !== 1 && scale !== selectedScale ? 0 : 0.15
59
+ }
60
+ }),
61
+ tap: {
62
+ scale: 0.975
63
+ }
64
+ // tap: {
65
+ // scale: 0.9
66
+ // }
67
+ } satisfies Variants
68
+
69
+ export function ElementNode({
70
+ id,
71
+ data: {
72
+ element
73
+ },
74
+ dragging,
75
+ selected = false,
76
+ width,
77
+ height
78
+ }: ElementNodeProps) {
79
+ const { isHovered, hasOnNavigateTo, isHovercards, isInteractive } = useDiagramState(s => ({
80
+ isHovered: s.hoveredNodeId === id,
81
+ isInteractive: s.nodesDraggable || s.nodesSelectable,
82
+ isHovercards: s.showElementLinks,
83
+ hasOnNavigateTo: !!s.onNavigateTo
84
+ }))
85
+ // const diagramState = useDiagramState()
86
+ // const isNodeInteractive = diagramState.isNodeInteractive
87
+ // const isHovercards = diagramState.disableHovercards !== true
88
+ // const isNavigable = diagramState.hasOnNavigateTo && !!element.navigateTo
89
+ const isNavigable = hasOnNavigateTo && !!element.navigateTo
90
+
91
+ const w = toDomPrecision(width ?? element.width)
92
+ const h = toDomPrecision(height ?? element.height)
93
+
94
+ let animate: keyof typeof variants = 'idle'
95
+ switch (true) {
96
+ case dragging && selected:
97
+ animate = 'selected'
98
+ break
99
+ case dragging:
100
+ animate = 'idle'
101
+ break
102
+ case (isInteractive || hasOnNavigateTo) && isHovered:
103
+ animate = 'hovered'
104
+ break
105
+ case selected:
106
+ animate = 'selected'
107
+ break
108
+ }
109
+
110
+ // useTilg(animate, isHovered, isInteractive)
111
+
112
+ return (
113
+ <motion.div
114
+ id={id}
115
+ className={clsx(container, 'likec4-element-node')}
116
+ data-likec4-color={element.color}
117
+ data-likec4-shape={element.shape}
118
+ variants={variants}
119
+ initial={false}
120
+ animate={animate}
121
+ {...(isInteractive && {
122
+ whileTap: dragging ? animate : 'tap'
123
+ })}
124
+ >
125
+ {
126
+ /* <NodeToolbar
127
+ position={Position.Bottom}
128
+ align={'start'}
129
+ offset={-10}
130
+ isVisible={selected || isHovered}>
131
+ <Button>editggg</Button>
132
+ </NodeToolbar> */
133
+ }
134
+ {
135
+ /* <NodeResizer minWidth={100} minHeight={30} />
136
+ <NodeToolbar
137
+ position={Position.Right}
138
+ align={'start'}
139
+ style={{
140
+ background: 'blue'
141
+ }}>
142
+ <Stack>
143
+ <Button>edit</Button>
144
+
145
+ </Stack>
146
+ </NodeToolbar>*/
147
+ }
148
+ {
149
+ /* {element.inEdges.map((edge) => (
150
+ <Handle
151
+ key={edge}
152
+ id={edge}
153
+ type="target"
154
+ position={Position.Top}
155
+ style={{ visibility: 'hidden' }}
156
+ />
157
+ ))} */
158
+ }
159
+ <Handle
160
+ type="target"
161
+ position={Position.Top}
162
+ style={{ visibility: 'hidden' }}
163
+ />
164
+ <svg
165
+ className={cssShapeSvg}
166
+ viewBox={`0 0 ${w} ${h}`}
167
+ width={w}
168
+ height={h}
169
+ >
170
+ <g className={indicator}>
171
+ <SelectedIndicator
172
+ shape={element.shape}
173
+ w={w}
174
+ h={h}
175
+ />
176
+ </g>
177
+ <ElementShapeSvg
178
+ shape={element.shape}
179
+ w={w}
180
+ h={h}
181
+ />
182
+ </svg>
183
+ <div className={clsx(cssElement, 'likec4-element')}>
184
+ {element.icon && <ElementIcon node={element} />}
185
+ <Text
186
+ component="div"
187
+ className={clsx(cssTitle, 'likec4-element-title')}>
188
+ {element.title}
189
+ </Text>
190
+ {element.technology && (
191
+ <Text
192
+ component="div"
193
+ className={clsx(csstechnology, 'likec4-element-technology')}>
194
+ {element.technology}
195
+ </Text>
196
+ )}
197
+ {element.description && (
198
+ <Text
199
+ component="div"
200
+ className={clsx(cssdescription, 'likec4-element-description')}>
201
+ {element.description}
202
+ </Text>
203
+ )}
204
+ </div>
205
+ <Handle
206
+ type="source"
207
+ position={Position.Bottom}
208
+ style={{ visibility: 'hidden' }}
209
+ />
210
+ {
211
+ /* {element.outEdges.map((edge) => (
212
+ <Handle
213
+ key={edge}
214
+ id={edge}
215
+ type="source"
216
+ position={Position.Bottom}
217
+ style={{ visibility: 'hidden' }}
218
+ />
219
+ ))} */
220
+ }
221
+ {isHovercards && element.links && <ElementLink element={element} />}
222
+ {isNavigable && <NavigateToBtn xynodeId={id} className={cssNavigateBtn} />}
223
+ </motion.div>
224
+ )
225
+ }