@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.
Files changed (116) hide show
  1. package/dist/LikeC4Diagram.css.d.ts +5 -0
  2. package/dist/LikeC4Diagram.css.js +1 -0
  3. package/dist/LikeC4Diagram.d.ts +1 -1
  4. package/dist/LikeC4Diagram.js +6 -2
  5. package/dist/LikeC4Diagram.props.d.ts +6 -0
  6. package/dist/base/BaseXYFlow.d.ts +1 -1
  7. package/dist/base/BaseXYFlow.js +12 -3
  8. package/dist/base/const.d.ts +1 -1
  9. package/dist/base/const.js +1 -1
  10. package/dist/base/primitives/compound/CompoundActionButton.css.js +2 -0
  11. package/dist/base/primitives/compound/CompoundDetailsButton.css.js +2 -0
  12. package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +0 -1
  13. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
  14. package/dist/base/primitives/compound/CompoundNodeContainer.js +35 -22
  15. package/dist/base/primitives/compound/CompoundTitle.css.js +3 -1
  16. package/dist/base/primitives/customNode.js +1 -1
  17. package/dist/base/primitives/edge/EdgeContainer.js +5 -4
  18. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -1
  19. package/dist/base/primitives/edge/EdgeLabel.css.js +2 -5
  20. package/dist/base/primitives/edge/EdgeLabel.js +5 -5
  21. package/dist/base/primitives/edge/edge.css.d.ts +1 -1
  22. package/dist/base/primitives/edge/edge.css.js +4 -5
  23. package/dist/base/primitives/element/ElementActionButtons.css.js +2 -0
  24. package/dist/base/primitives/element/ElementActionButtons.js +4 -3
  25. package/dist/base/primitives/element/ElementDetailsButton.css.js +2 -0
  26. package/dist/base/primitives/element/ElementNodeContainer.css.js +2 -0
  27. package/dist/base/primitives/element/ElementNodeContainer.js +3 -1
  28. package/dist/base/primitives/element/ElementShape.css.js +4 -2
  29. package/dist/base/primitives/element/ElementShape.js +2 -3
  30. package/dist/base/primitives/element/ElementTitle.css.js +2 -0
  31. package/dist/base/primitives/element/styles.css.js +2 -0
  32. package/dist/components/SearchControl.css.js +2 -0
  33. package/dist/context/FramerMotionConfig.d.ts +9 -1
  34. package/dist/context/FramerMotionConfig.js +5 -2
  35. package/dist/context/RootContainer.js +13 -1
  36. package/dist/diagram.css +1 -1
  37. package/dist/globals.css.d.ts +2 -0
  38. package/dist/hooks/safeContext.js +1 -0
  39. package/dist/hooks/useDiagram.d.ts +554 -864
  40. package/dist/hooks/useDiagram.js +1 -0
  41. package/dist/hooks/useIsReducedGraphics.d.ts +4 -0
  42. package/dist/hooks/useIsReducedGraphics.js +8 -0
  43. package/dist/hooks/useXYFlow.js +1 -1
  44. package/dist/likec4diagram/DiagramUI.d.ts +2 -1
  45. package/dist/likec4diagram/DiagramUI.js +5 -3
  46. package/dist/likec4diagram/custom/nodes/nodeTypes.js +2 -2
  47. package/dist/likec4diagram/ui/controls/styles.css.js +2 -0
  48. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +2 -0
  49. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +3 -4
  50. package/dist/likec4diagram/ui/search/LikeC4Search.css.js +2 -0
  51. package/dist/overlays/element-details/ElementDetailsCard.js +12 -8
  52. package/dist/overlays/element-details/actor.d.ts +9084 -2569
  53. package/dist/overlays/overlay/Overlay.js +6 -3
  54. package/dist/overlays/relationship-details/RelationshipDetails.js +31 -17
  55. package/dist/overlays/relationship-details/actor.d.ts +228 -3
  56. package/dist/overlays/relationship-details/actor.js +86 -14
  57. package/dist/overlays/relationship-details/hooks.d.ts +3 -0
  58. package/dist/overlays/relationship-details/hooks.js +6 -2
  59. package/dist/overlays/relationships-browser/-useRelationshipsView.js +12 -3
  60. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +12 -3
  61. package/dist/overlays/relationships-browser/actor.d.ts +271 -54
  62. package/dist/overlays/relationships-browser/actor.js +86 -23
  63. package/dist/state/DiagramActorProvider.js +12 -2
  64. package/dist/state/diagram-machine.d.ts +563 -867
  65. package/dist/state/diagram-machine.js +82 -81
  66. package/dist/state/persistence.d.ts +5 -0
  67. package/dist/state/persistence.js +23 -0
  68. package/package.json +9 -9
  69. package/src/LikeC4Diagram.css.ts +13 -5
  70. package/src/LikeC4Diagram.props.ts +7 -0
  71. package/src/LikeC4Diagram.tsx +33 -24
  72. package/src/base/BaseXYFlow.tsx +14 -9
  73. package/src/base/const.ts +1 -1
  74. package/src/base/primitives/compound/CompoundActionButton.css.ts +6 -0
  75. package/src/base/primitives/compound/CompoundDetailsButton.css.ts +4 -0
  76. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +41 -59
  77. package/src/base/primitives/compound/CompoundNodeContainer.tsx +42 -22
  78. package/src/base/primitives/compound/CompoundTitle.css.ts +14 -13
  79. package/src/base/primitives/customNode.ts +3 -2
  80. package/src/base/primitives/edge/EdgeContainer.tsx +4 -3
  81. package/src/base/primitives/edge/EdgeLabel.css.ts +17 -11
  82. package/src/base/primitives/edge/EdgeLabel.tsx +4 -4
  83. package/src/base/primitives/edge/edge.css.ts +47 -27
  84. package/src/base/primitives/element/ElementActionButtons.css.ts +4 -0
  85. package/src/base/primitives/element/ElementActionButtons.tsx +4 -2
  86. package/src/base/primitives/element/ElementDetailsButton.css.ts +6 -8
  87. package/src/base/primitives/element/ElementNodeContainer.css.ts +18 -21
  88. package/src/base/primitives/element/ElementNodeContainer.tsx +3 -1
  89. package/src/base/primitives/element/ElementShape.css.ts +10 -6
  90. package/src/base/primitives/element/ElementShape.tsx +2 -2
  91. package/src/components/SearchControl.css.ts +11 -4
  92. package/src/context/FramerMotionConfig.tsx +13 -2
  93. package/src/context/RootContainer.tsx +9 -2
  94. package/src/globals.css.ts +3 -0
  95. package/src/hooks/safeContext.tsx +2 -1
  96. package/src/hooks/useDiagram.ts +1 -0
  97. package/src/hooks/useIsReducedGraphics.ts +5 -0
  98. package/src/hooks/useXYFlow.ts +1 -1
  99. package/src/likec4diagram/DiagramUI.tsx +5 -3
  100. package/src/likec4diagram/custom/nodes/nodeTypes.tsx +2 -2
  101. package/src/likec4diagram/ui/controls/styles.css.ts +11 -1
  102. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +10 -3
  103. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +6 -3
  104. package/src/likec4diagram/ui/search/LikeC4Search.css.ts +1 -0
  105. package/src/overlays/element-details/ElementDetailsCard.tsx +238 -231
  106. package/src/overlays/overlay/Overlay.css.ts +1 -9
  107. package/src/overlays/overlay/Overlay.tsx +6 -3
  108. package/src/overlays/relationship-details/RelationshipDetails.tsx +83 -66
  109. package/src/overlays/relationship-details/actor.ts +106 -13
  110. package/src/overlays/relationship-details/hooks.ts +6 -2
  111. package/src/overlays/relationships-browser/-useRelationshipsView.ts +10 -0
  112. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +16 -8
  113. package/src/overlays/relationships-browser/actor.ts +92 -22
  114. package/src/state/DiagramActorProvider.tsx +13 -2
  115. package/src/state/diagram-machine.ts +80 -79
  116. package/src/state/persistence.ts +22 -0
@@ -1,4 +1,5 @@
1
- import { createVar, fallbackVar, globalStyle, style } from '@vanilla-extract/css'
1
+ import { createVar, fallbackVar, style } from '@vanilla-extract/css'
2
+ import { reactFlowReducedGraphics } from '../../../LikeC4Diagram.css'
2
3
  import { easings, vars } from '../../../theme-vars'
3
4
 
4
5
  export const stokeFillMix = createVar('stroke-fill-mix')
@@ -15,12 +16,6 @@ export const container = style({
15
16
  vars: {
16
17
  [stokeFillMix]: `color-mix(in srgb, ${vars.element.stroke} 90%, ${vars.element.fill})`,
17
18
  },
18
- // selectors: {
19
- // ':where(.react-flow__node.selected) &': {
20
- // willChange: 'transform',
21
- // },
22
- // },
23
- // Catch pointer below the element
24
19
  ':after': {
25
20
  content: ' ',
26
21
  position: 'absolute',
@@ -31,19 +26,21 @@ export const container = style({
31
26
  background: 'transparent',
32
27
  pointerEvents: 'all',
33
28
  },
34
- })
35
-
36
- globalStyle(`.react-flow__node:has(${container}[data-likec4-dimmed="true"])`, {
37
- opacity: 0.25,
38
- transition: `opacity 400ms ${easings.inOut}, filter 500ms ${easings.inOut}`,
39
- transitionDelay: '50ms',
40
- filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
41
- willChange: 'opacity, filter',
42
- })
43
29
 
44
- globalStyle(`.react-flow__node:has(${container}[data-likec4-dimmed="immediate"])`, {
45
- opacity: 0.25,
46
- transition: `opacity 100ms ${easings.inOut}, filter 100ms ${easings.inOut}`,
47
- filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
48
- willChange: 'opacity, filter',
30
+ selectors: {
31
+ [`&:is([data-likec4-dimmed="true"])`]: {
32
+ opacity: 0.25,
33
+ transition: `opacity 400ms ${easings.inOut}, filter 500ms ${easings.inOut}`,
34
+ transitionDelay: '50ms',
35
+ filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
36
+ },
37
+ [`&:is([data-likec4-dimmed="immediate"])`]: {
38
+ opacity: 0.25,
39
+ transition: `opacity 100ms ${easings.inOut}, filter 100ms ${easings.inOut}`,
40
+ filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
41
+ },
42
+ [`${reactFlowReducedGraphics} &:after`]: {
43
+ display: 'none',
44
+ },
45
+ },
49
46
  })
@@ -9,6 +9,7 @@ import { type BoxProps, Box, createPolymorphicComponent } from '@mantine/core'
9
9
  import clsx from 'clsx'
10
10
  import { m } from 'framer-motion'
11
11
  import { type PropsWithChildren, forwardRef } from 'react'
12
+ import { useIsReducedGraphics } from '../../../hooks/useIsReducedGraphics'
12
13
  import type { NodeProps } from '../../types'
13
14
  import * as css from './ElementNodeContainer.css'
14
15
 
@@ -63,6 +64,7 @@ export const ElementNodeContainer = createPolymorphicComponent<'div', ElementNod
63
64
  children,
64
65
  ...rest
65
66
  }, ref) => {
67
+ const nonReducedGraphics = !useIsReducedGraphics()
66
68
  let scale = 1
67
69
  switch (true) {
68
70
  case isHovered:
@@ -88,7 +90,7 @@ export const ElementNodeContainer = createPolymorphicComponent<'div', ElementNod
88
90
  'likec4-element-node',
89
91
  ])}
90
92
  initial={false}
91
- {...selectable && {
93
+ {...selectable && nonReducedGraphics && {
92
94
  animate: {
93
95
  scale,
94
96
  },
@@ -1,4 +1,5 @@
1
1
  import { createVar, fallbackVar, globalStyle, keyframes, style } from '@vanilla-extract/css'
2
+ import { hiddenIfZoomTooSmall, reactFlowReducedGraphics, whereNotReducedGraphics } from '../../../LikeC4Diagram.css'
2
3
  import { easings, mantine, vars } from '../../../theme-vars'
3
4
  import { container, stokeFillMix } from './ElementNodeContainer.css'
4
5
 
@@ -19,7 +20,7 @@ const outlineColor = fallbackVar(
19
20
 
20
21
  const indicatorStroke = createVar('indicator-stroke')
21
22
 
22
- export const indicator = style({
23
+ export const indicator = style([hiddenIfZoomTooSmall, {
23
24
  stroke: indicatorStroke,
24
25
  fill: 'none',
25
26
  transformOrigin: 'center center',
@@ -36,6 +37,8 @@ export const indicator = style({
36
37
  selectors: {
37
38
  ':where(.react-flow__node.selected) &': {
38
39
  visibility: 'visible',
40
+ },
41
+ [`${whereNotReducedGraphics} :where(.react-flow__node.selected) &`]: {
39
42
  animationName: fallbackVar(vars.safariAnimationHook, indicatorKeyframes),
40
43
  },
41
44
  [`:where(.react-flow__node:focus-visible, ${container}:focus-visible) &`]: {
@@ -52,7 +55,7 @@ export const indicator = style({
52
55
  },
53
56
  },
54
57
  },
55
- })
58
+ }])
56
59
 
57
60
  export const fillElementFill = style({
58
61
  fill: vars.element.fill,
@@ -81,7 +84,7 @@ const shapeBase = style({
81
84
  zIndex: -1,
82
85
  })
83
86
 
84
- export const shapeSvgMultiple = style([shapeBase, {
87
+ export const shapeSvgMultiple = style([shapeBase, hiddenIfZoomTooSmall, {
85
88
  transformOrigin: '50% 25%',
86
89
  transform: 'translate(14px, 14px) perspective(300px) translateZ(-8px)',
87
90
  filter: ' brightness(0.65) saturate(0.8)',
@@ -131,9 +134,10 @@ export const shapeSvg = style([shapeBase, {
131
134
  },
132
135
  },
133
136
  [`:where([data-likec4-zoom-small="true"]) &`]: {
134
- vars: {
135
- [filterShadow]: `none`,
136
- },
137
+ filter: 'none',
138
+ },
139
+ [`${reactFlowReducedGraphics} &`]: {
140
+ filter: 'none',
137
141
  },
138
142
  },
139
143
  }])
@@ -185,7 +185,7 @@ export function ElementShape(
185
185
  return (
186
186
  <>
187
187
  {isMultiple && (
188
- <svg className={clsx(css.shapeSvgMultiple, hiddenIfZoomTooSmall)} viewBox={`0 0 ${w} ${h}`}>
188
+ <svg className={clsx(css.shapeSvgMultiple)} viewBox={`0 0 ${w} ${h}`}>
189
189
  <ElementShapeSvg shape={data.shape} w={w} h={h} />
190
190
  </svg>
191
191
  )}
@@ -223,5 +223,5 @@ export function SelectedIndicator({ shape, w, h }: ElementShapeProps) {
223
223
  break
224
224
  }
225
225
  }
226
- return <g className={clsx(css.indicator, hiddenIfZoomTooSmall)}>{svg}</g>
226
+ return <g className={css.indicator}>{svg}</g>
227
227
  }
@@ -1,4 +1,5 @@
1
1
  import { createVar, fallbackVar, globalStyle, style } from '@vanilla-extract/css'
2
+ import { whereNotReducedGraphics } from '../LikeC4Diagram.css'
2
3
  import { mantine, transitions, vars, whereDark, whereLight } from '../theme-vars'
3
4
 
4
5
  const transparent = createVar('transparent')
@@ -9,13 +10,10 @@ export const root = style({
9
10
  paddingRight: '4px',
10
11
  borderRadius: mantine.radius.sm,
11
12
  color: mantine.colors.placeholder,
12
- boxShadow: mantine.shadows.xs,
13
13
  border: '1px solid',
14
14
  cursor: 'pointer',
15
15
  transition: transitions.fast,
16
- WebkitBackdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
17
- backdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
18
- backgroundColor: `color-mix(in srgb, ${bgColor}, transparent ${transparent})`,
16
+ backgroundColor: bgColor,
19
17
  vars: {
20
18
  [transparent]: '20%',
21
19
  [bgColor]: mantine.colors.default,
@@ -33,6 +31,12 @@ export const root = style({
33
31
  [bgColor]: mantine.colors.dark[6],
34
32
  },
35
33
  },
34
+ [`${whereNotReducedGraphics} &`]: {
35
+ backgroundColor: `color-mix(in srgb, ${bgColor}, transparent ${transparent})`,
36
+ boxShadow: mantine.shadows.xs,
37
+ WebkitBackdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
38
+ backdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
39
+ },
36
40
  },
37
41
  ':hover': {
38
42
  borderColor: mantine.colors.defaultBorder,
@@ -58,6 +62,9 @@ export const shortcut = style({
58
62
  [`${whereLight} &`]: {
59
63
  color: mantine.colors.gray[7],
60
64
  borderColor: mantine.colors.gray[2],
65
+ backgroundColor: mantine.colors.gray[2],
66
+ },
67
+ [`${whereLight} ${whereNotReducedGraphics} &`]: {
61
68
  backgroundColor: `color-mix(in srgb, ${mantine.colors.gray[2]}, transparent 20%)`,
62
69
  },
63
70
  [`${whereDark} &`]: {
@@ -2,11 +2,22 @@ import { useMantineStyleNonce } from '@mantine/core'
2
2
  import { domMax, LazyMotion, MotionConfig } from 'framer-motion'
3
3
  import { type PropsWithChildren } from 'react'
4
4
 
5
- export const FramerMotionConfig = ({ children }: PropsWithChildren) => {
5
+ export const FramerMotionConfig = ({
6
+ reducedMotion = 'user',
7
+ children,
8
+ }: PropsWithChildren<{
9
+ /**
10
+ * If true, will respect the device prefersReducedMotion setting by switching
11
+ * transform animations off.
12
+ *
13
+ * @public
14
+ */
15
+ reducedMotion?: 'always' | 'never' | 'user'
16
+ }>) => {
6
17
  const nonce = useMantineStyleNonce()?.()
7
18
  return (
8
19
  <LazyMotion features={domMax} strict>
9
- <MotionConfig {...nonce && { nonce }}>
20
+ <MotionConfig reducedMotion={reducedMotion} {...nonce && { nonce }}>
10
21
  {children}
11
22
  </MotionConfig>
12
23
  </LazyMotion>
@@ -1,7 +1,8 @@
1
1
  import { Box } from '@mantine/core'
2
2
  import clsx from 'clsx'
3
- import { type PropsWithChildren, type RefObject, createContext, createRef, useContext, useRef } from 'react'
3
+ import { type PropsWithChildren, createContext, createRef, useContext, useRef } from 'react'
4
4
  import { rootClassName } from '../globals.css'
5
+ import { useIsReducedGraphics } from '../hooks/useIsReducedGraphics'
5
6
 
6
7
  const RootContainerContext = createContext(createRef<HTMLDivElement>())
7
8
 
@@ -10,8 +11,14 @@ export function RootContainer({
10
11
  children,
11
12
  }: PropsWithChildren<{ className?: string | undefined }>) {
12
13
  const ref = useRef<HTMLDivElement>(null)
14
+ const reduceGraphics = useIsReducedGraphics()
13
15
  return (
14
- <Box className={clsx(rootClassName, className)} ref={ref}>
16
+ <Box
17
+ className={clsx(rootClassName, className)}
18
+ ref={ref}
19
+ {...reduceGraphics && {
20
+ ['data-likec4-reduced-graphics']: true,
21
+ }}>
15
22
  <RootContainerContext.Provider value={ref}>
16
23
  {children}
17
24
  </RootContainerContext.Provider>
@@ -6,6 +6,9 @@ import { mantine, vars, whereDark } from './theme-vars'
6
6
 
7
7
  export const rootClassName = 'likec4-diagram-root'
8
8
 
9
+ export const whereReducedGraphics = `:where(.${rootClassName}:is([data-likec4-reduced-graphics="true"]))`
10
+ export const whereNotReducedGraphics = `:where(.${rootClassName}:not([data-likec4-reduced-graphics]))`
11
+
9
12
  globalStyle(`.${rootClassName}`, {
10
13
  overflow: 'hidden',
11
14
  position: 'relative',
@@ -1,4 +1,5 @@
1
- import { createContext, use } from 'react'
1
+ import { createSafeContext } from '@mantine/core'
2
+ import { createContext, use, useContext } from 'react'
2
3
  import type { DiagramActorRef } from '../state/types'
3
4
 
4
5
  /**
@@ -18,6 +18,7 @@ export function useDiagram() {
18
18
  const actor = useDiagramActorRef()
19
19
  const [, startTransition] = useTransition()
20
20
  return useMemo(() => ({
21
+ actor,
21
22
  send: actor.send,
22
23
  navigateTo: (viewId: ViewId, fromNode?: NodeId) => {
23
24
  startTransition(() => {
@@ -0,0 +1,5 @@
1
+ import { createSafeContext } from '@mantine/core'
2
+
3
+ export const [ReducedGraphicsContext, useIsReducedGraphics] = createSafeContext<boolean>(
4
+ 'ReducedGraphicsContext is not provided',
5
+ )
@@ -20,7 +20,7 @@ export type XYStoreApi = ReturnType<typeof useXYStoreApi>
20
20
 
21
21
  export const useXYInternalNode = useInternalNode<Types.Node>
22
22
 
23
- const selectZoom = (state: ReactFlowState) => state.transform[2] < 0.2
23
+ const selectZoom = (state: ReactFlowState) => state.transform[2] < 0.25
24
24
  export function useIsZoomTooSmall() {
25
25
  return useStore(selectZoom)
26
26
  }
@@ -1,16 +1,17 @@
1
+ import { memo } from 'react'
1
2
  import { useEnabledFeatures } from '../context'
2
3
  import { useDiagramActorSnapshot } from '../hooks/useDiagram'
3
4
  import { Overlays } from '../overlays/Overlays'
4
5
  import { Controls, DiagramTitlePanel, DynamicViewWalkthrough, NotationPanel } from './ui'
5
6
 
6
- export function DiagramUI() {
7
+ export const DiagramUI = memo(() => {
7
8
  const {
8
9
  enableViewTitle,
9
10
  enableNotations,
10
11
  enableDynamicViewWalkthrough,
11
12
  } = useEnabledFeatures()
12
13
 
13
- const overlaysActorRef = useDiagramActorSnapshot(s => s.children.overlays)
14
+ const overlaysActorRef = useDiagramActorSnapshot(s => s.children.overlays, Object.is)
14
15
 
15
16
  return (
16
17
  <>
@@ -21,4 +22,5 @@ export function DiagramUI() {
21
22
  {enableDynamicViewWalkthrough && <DynamicViewWalkthrough />}
22
23
  </>
23
24
  )
24
- }
25
+ })
26
+ DiagramUI.displayName = 'DiagramUI'
@@ -39,7 +39,7 @@ const ElementDetailsButtonWithHandler = ({ fqn, ...props }: NodeProps<Types.Node
39
39
  export const nodeTypes = {
40
40
  element: customNode<Types.ElementNodeData>((props) => (
41
41
  <ElementNodeContainer nodeProps={props}>
42
- <ElementShape {...props} isMultiple={props.data.isMultiple} />
42
+ <ElementShape {...props} isMultiple={props.data.isMultiple} withSelectedIndicator={props.selected} />
43
43
  <ElementTitle {...props} />
44
44
  <ElementActions {...props} />
45
45
  <ElementDetailsButtonWithHandler
@@ -53,7 +53,7 @@ export const nodeTypes = {
53
53
  )),
54
54
  deployment: customNode<Types.DeploymentElementNodeData>((props) => (
55
55
  <ElementNodeContainer nodeProps={props}>
56
- <ElementShape {...props} isMultiple={props.data.isMultiple} />
56
+ <ElementShape {...props} isMultiple={props.data.isMultiple} withSelectedIndicator={props.selected} />
57
57
  <ElementTitle {...props} />
58
58
  <DeploymentElementActions {...props} />
59
59
  {!!props.data.modelFqn && (
@@ -1,6 +1,7 @@
1
1
  import { rem } from '@mantine/core'
2
2
  import { fallbackVar, globalStyle, style } from '@vanilla-extract/css'
3
3
  import { calc } from '@vanilla-extract/css-utils'
4
+ import { whereNotReducedGraphics } from '../../../LikeC4Diagram.css'
4
5
  import { mantine, vars } from '../../../theme-vars'
5
6
 
6
7
  export const navigationButtons = style({
@@ -14,6 +15,11 @@ export const panel = style({
14
15
  top: fallbackVar(vars.navigationPanel.top, '1rem'),
15
16
  left: fallbackVar(vars.navigationPanel.left, '1rem'),
16
17
  margin: 0,
18
+ pointerEvents: 'none',
19
+ })
20
+
21
+ globalStyle(`${panel} :where(button, .action-icon)`, {
22
+ pointerEvents: 'all',
17
23
  })
18
24
 
19
25
  globalStyle(`.likec4-top-left-panel .action-icon`, {
@@ -27,7 +33,11 @@ globalStyle(`.likec4-top-left-panel .action-icon .tabler-icon`, {
27
33
  })
28
34
 
29
35
  export const actionIconGroup = style({
30
- boxShadow: mantine.shadows.md,
36
+ selectors: {
37
+ [`${whereNotReducedGraphics} &`]: {
38
+ boxShadow: mantine.shadows.md,
39
+ },
40
+ },
31
41
  })
32
42
 
33
43
  export const autolayoutIcon = style({})
@@ -1,4 +1,5 @@
1
1
  import { fallbackVar, style } from '@vanilla-extract/css'
2
+ import { whereNotReducedGraphics } from '../../../LikeC4Diagram.css'
2
3
  import { mantine, vars, whereDark } from '../../../theme-vars'
3
4
 
4
5
  export const container = style({
@@ -12,9 +13,7 @@ export const card = style({
12
13
  cursor: 'default',
13
14
  minWidth: 200,
14
15
  maxWidth: 'calc(100vw - 16px)',
15
- backgroundColor: `color-mix(in srgb, ${mantine.colors.body}, transparent 20%)`,
16
- WebkitBackdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
17
- backdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
16
+ backgroundColor: mantine.colors.body,
18
17
  '@media': {
19
18
  [mantine.largerThan('sm')]: {
20
19
  minWidth: 250,
@@ -27,6 +26,14 @@ export const card = style({
27
26
  },
28
27
  selectors: {
29
28
  [`${whereDark} &`]: {
29
+ backgroundColor: mantine.colors.dark[6],
30
+ },
31
+ [`${whereNotReducedGraphics} &`]: {
32
+ backgroundColor: `color-mix(in srgb, ${mantine.colors.body}, transparent 20%)`,
33
+ WebkitBackdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
34
+ backdropFilter: fallbackVar(vars.safariAnimationHook, 'blur(8px)'),
35
+ },
36
+ [`${whereDark} ${whereNotReducedGraphics} &`]: {
30
37
  backgroundColor: `color-mix(in srgb, ${mantine.colors.dark[6]}, transparent 20%)`,
31
38
  },
32
39
  },
@@ -41,7 +41,6 @@ export function DiagramTitlePanel() {
41
41
  }
42
42
  {isNotActiveWalkthrough && (
43
43
  <m.div
44
- key={id}
45
44
  initial={{ opacity: 0.05, scale: 0.7 }}
46
45
  animate={{ opacity: 1, scale: 1 }}
47
46
  exit={{
@@ -126,10 +125,14 @@ export function DiagramTitlePanel() {
126
125
  <Spoiler
127
126
  maxHeight={42}
128
127
  showLabel={
129
- <Button color="gray" variant="light" fz={'10'} size="compact-xs" tabIndex={-1}>show more</Button>
128
+ <Button component={'div'} color="gray" variant="light" fz={'10'} size="compact-xs" tabIndex={-1}>
129
+ show more
130
+ </Button>
130
131
  }
131
132
  hideLabel={
132
- <Button color="gray" variant="light" fz={'10'} size="compact-xs" tabIndex={-1}>hide</Button>
133
+ <Button component={'div'} color="gray" variant="light" fz={'10'} size="compact-xs" tabIndex={-1}>
134
+ hide
135
+ </Button>
133
136
  }>
134
137
  <Text
135
138
  component={'div'}
@@ -1,5 +1,6 @@
1
1
  import { rem } from '@mantine/core'
2
2
  import { fallbackVar, globalStyle, style } from '@vanilla-extract/css'
3
+ import { reactFlow } from '../../../LikeC4Diagram.css'
3
4
  import { mantine } from '../../../theme-vars'
4
5
  import { vars, whereDark, whereLight } from '../../../theme-vars.css'
5
6
  import { button, buttonFocused } from './_shared.css'