@likec4/diagram 1.35.0 → 1.36.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.
- package/bundle/{chunk-C0Eg81Gj.js → chunk-7MPUJFHj.js} +315 -311
- package/bundle/custom.js +52 -52
- package/bundle/index.js +1583 -739
- package/dist/LikeC4Diagram.js +6 -6
- package/dist/LikeC4Diagram.props.d.ts +2 -3
- package/dist/LikeC4ModelProvider.d.ts +3 -3
- package/dist/LikeC4ProjectsProvider.d.ts +17 -0
- package/dist/LikeC4ProjectsProvider.js +22 -0
- package/dist/LikeC4Styles.d.ts +1 -0
- package/dist/LikeC4Styles.js +94 -0
- package/dist/StaticLikeC4Diagram.d.ts +3 -3
- package/dist/base/BaseXYFlow.js +23 -26
- package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
- package/dist/base/primitives/MarkdownBlock.js +1 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +2 -2
- package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -2
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
- package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
- package/dist/base/primitives/compound/CompoundTitle.js +9 -8
- package/dist/base/primitives/compound/actionbtns.css.js +6 -6
- package/dist/base/primitives/edge/EdgeActionButton.js +2 -2
- package/dist/base/primitives/edge/EdgeContainer.js +4 -7
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
- package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
- package/dist/base/primitives/edge/EdgeLabel.js +16 -6
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
- package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
- package/dist/base/primitives/edge/edge.css.d.ts +0 -2
- package/dist/base/primitives/edge/edge.css.js +1 -55
- package/dist/base/primitives/element/ElementActionButtons.js +2 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +8 -7
- package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
- package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
- package/dist/base/primitives/element/ElementShape.css.js +11 -11
- package/dist/base/primitives/element/ElementTags.d.ts +1 -0
- package/dist/base/primitives/element/ElementTags.js +17 -14
- package/dist/bundle/LikeC4View.d.ts +1 -1
- package/dist/bundle/LikeC4View.js +7 -1
- package/dist/bundle/LikeC4View.props.d.ts +1 -2
- package/dist/bundle/ReactLikeC4.d.ts +1 -1
- package/dist/bundle/ViewNotFound.js +1 -1
- package/dist/bundle/index.d.ts +2 -1
- package/dist/bundle/index.js +1 -0
- package/dist/bundle/styles.css.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/GithubIcon.d.ts +2 -0
- package/dist/components/GithubIcon.js +17 -0
- package/dist/components/Link.d.ts +4 -3
- package/dist/components/Link.js +84 -87
- package/dist/components/NavigationLink.d.ts +2 -2
- package/dist/components/SearchControl.css.js +6 -5
- package/dist/context/DiagramEventHandlers.d.ts +6 -6
- package/dist/context/DiagramEventHandlers.js +4 -7
- package/dist/globals.css.js +3 -0
- package/dist/hooks/useXYFlow.d.ts +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -3
- package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
- package/dist/likec4diagram/custom/index.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
- package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
- package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -5
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
- package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
- package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
- package/dist/likec4model/index.d.ts +1 -0
- package/dist/likec4model/useLikeC4Project.d.ts +22 -0
- package/dist/likec4model/useLikeC4Project.js +23 -0
- package/dist/navigationpanel/NavigationPanel.js +15 -17
- package/dist/navigationpanel/NavigationPanelControls.js +34 -21
- package/dist/navigationpanel/NavigationPanelDropdown.js +33 -17
- package/dist/navigationpanel/_common.js +4 -1
- package/dist/navigationpanel/actor.d.ts +11 -15
- package/dist/navigationpanel/actor.js +14 -15
- package/dist/navigationpanel/controls/BurgerButton.js +5 -7
- package/dist/navigationpanel/controls/NavigationButtons.js +37 -24
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +6 -4
- package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
- package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
- package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
- package/dist/navigationpanel/controls/index.d.ts +1 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -20
- package/dist/navigationpanel/editorpanel/styles.js +5 -5
- package/dist/navigationpanel/hooks.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +0 -2
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +12 -7
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +14 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
- package/dist/overlays/element-details/ElementDetailsCard.js +8 -13
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
- package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
- package/dist/overlays/overlay/Overlay.css.js +8 -7
- package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
- package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
- package/dist/search/Search.js +6 -6
- package/dist/search/components/ElementsColumn.css.js +5 -5
- package/dist/search/components/SearchByTags.js +3 -2
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +3 -3
- package/dist/search/components/styles.css.js +5 -5
- package/dist/state/DiagramActorProvider.js +34 -15
- package/dist/state/diagram-machine.d.ts +29 -247
- package/dist/state/diagram-machine.js +16 -16
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +10 -8
- package/panda.buildinfo.json +254 -326
- package/src/LikeC4Diagram.props.ts +2 -2
- package/src/LikeC4Diagram.tsx +2 -2
- package/src/LikeC4ModelProvider.tsx +4 -4
- package/src/LikeC4ProjectsProvider.tsx +41 -0
- package/src/LikeC4Styles.tsx +107 -0
- package/src/StaticLikeC4Diagram.tsx +3 -3
- package/src/base/BaseXYFlow.tsx +24 -29
- package/src/base/primitives/MarkdownBlock.tsx +11 -3
- package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
- package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
- package/src/base/primitives/compound/actionbtns.css.ts +6 -6
- package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
- package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
- package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
- package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
- package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
- package/src/base/primitives/edge/edge.css.ts +0 -60
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
- package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
- package/src/base/primitives/element/ElementNodeContainer.tsx +0 -3
- package/src/base/primitives/element/ElementShape.css.ts +11 -11
- package/src/base/primitives/element/ElementTags.tsx +17 -14
- package/src/bundle/LikeC4View.props.ts +1 -2
- package/src/bundle/LikeC4View.tsx +10 -3
- package/src/bundle/ReactLikeC4.tsx +1 -2
- package/src/bundle/ViewNotFound.tsx +1 -1
- package/src/bundle/index.ts +2 -1
- package/src/bundle/styles.css.ts +1 -1
- package/src/components/ErrorFallback.tsx +1 -1
- package/src/components/GithubIcon.tsx +16 -0
- package/src/components/Link.tsx +102 -113
- package/src/components/NavigationLink.tsx +2 -1
- package/src/components/SearchControl.css.ts +5 -5
- package/src/context/DiagramEventHandlers.tsx +12 -12
- package/src/globals.css +71 -0
- package/src/index.ts +5 -0
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
- package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
- package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
- package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
- package/src/likec4model/index.ts +8 -0
- package/src/likec4model/useLikeC4Project.ts +61 -0
- package/src/navigationpanel/NavigationPanel.tsx +16 -17
- package/src/navigationpanel/NavigationPanelControls.tsx +24 -46
- package/src/navigationpanel/NavigationPanelDropdown.tsx +32 -16
- package/src/navigationpanel/_common.tsx +4 -1
- package/src/navigationpanel/actor.ts +14 -15
- package/src/navigationpanel/controls/BurgerButton.tsx +5 -7
- package/src/navigationpanel/controls/NavigationButtons.tsx +9 -1
- package/src/navigationpanel/controls/OpenSource.tsx +1 -1
- package/src/navigationpanel/controls/SearchControl.tsx +6 -4
- package/src/navigationpanel/controls/ToggleReadonly.tsx +3 -3
- package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
- package/src/navigationpanel/controls/index.ts +1 -0
- package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
- package/src/navigationpanel/editorpanel/EditorPanel.tsx +3 -3
- package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +19 -22
- package/src/navigationpanel/editorpanel/styles.ts +5 -5
- package/src/navigationpanel/hooks.tsx +2 -2
- package/src/navigationpanel/styles.css.ts +0 -2
- package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +9 -4
- package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
- package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
- package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
- package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
- package/src/overlays/overlay/Overlay.css.ts +7 -7
- package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
- package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
- package/src/search/Search.tsx +6 -6
- package/src/search/components/ElementsColumn.css.ts +5 -5
- package/src/search/components/SearchByTags.tsx +2 -2
- package/src/search/components/ViewsColum.tsx +1 -1
- package/src/search/components/ViewsColumn.css.ts +1 -1
- package/src/search/components/_shared.css.ts +3 -3
- package/src/search/components/styles.css.ts +5 -5
- package/src/state/DiagramActorProvider.tsx +45 -20
- package/src/state/diagram-machine.ts +22 -16
- package/dist/LikeC4CustomColors.d.ts +0 -2
- package/dist/LikeC4CustomColors.js +0 -45
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
- package/src/LikeC4CustomColors.tsx +0 -85
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { extractStep, isStepEdgeId } from '@likec4/core'
|
|
2
2
|
import type { DiagramEdge } from '@likec4/core/types'
|
|
3
|
-
import { cx } from '@likec4/styles/css'
|
|
3
|
+
import { css, cx } from '@likec4/styles/css'
|
|
4
4
|
import { type BoxProps, Box } from '@likec4/styles/jsx'
|
|
5
|
+
import { edgeLabel } from '@likec4/styles/recipes'
|
|
5
6
|
import { Text } from '@mantine/core'
|
|
6
7
|
import { type PropsWithChildren, forwardRef } from 'react'
|
|
7
8
|
import { isTruthy } from 'remeda'
|
|
8
9
|
import type { UndefinedOnPartialDeep } from 'type-fest'
|
|
9
10
|
import type { EdgeProps } from '../../types'
|
|
10
|
-
import { labelsva } from './EdgeLabel.css'
|
|
11
11
|
|
|
12
12
|
type Data = UndefinedOnPartialDeep<
|
|
13
13
|
Pick<
|
|
@@ -40,27 +40,33 @@ export const EdgeLabel = forwardRef<HTMLDivElement, EdgeLabelProps>((
|
|
|
40
40
|
ref,
|
|
41
41
|
) => {
|
|
42
42
|
const stepNum = isStepEdgeId(id) ? extractStep(id) : null
|
|
43
|
-
const classes =
|
|
43
|
+
const classes = edgeLabel({
|
|
44
44
|
isStepEdge: stepNum !== null,
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<Box ref={ref} className={cx(classes.root
|
|
48
|
+
<Box ref={ref} className={cx(classes.root, className)} {...rest}>
|
|
49
49
|
{stepNum !== null && (
|
|
50
|
-
<Box className={classes.stepNumber
|
|
50
|
+
<Box className={classes.stepNumber}>
|
|
51
51
|
{stepNum}
|
|
52
52
|
</Box>
|
|
53
53
|
)}
|
|
54
|
-
<Box className={classes.labelContents
|
|
54
|
+
<Box className={classes.labelContents}>
|
|
55
55
|
{isTruthy(label) && (
|
|
56
|
-
<
|
|
56
|
+
<Box
|
|
57
|
+
className={cx(
|
|
58
|
+
classes.labelText,
|
|
59
|
+
css({
|
|
60
|
+
lineClamp: 5,
|
|
61
|
+
}),
|
|
62
|
+
)}>
|
|
57
63
|
{label}
|
|
58
|
-
</
|
|
64
|
+
</Box>
|
|
59
65
|
)}
|
|
60
66
|
{isTruthy(technology) && (
|
|
61
|
-
<
|
|
67
|
+
<Box className={classes.labelTechnology}>
|
|
62
68
|
{'[ ' + technology + ' ]'}
|
|
63
|
-
</
|
|
69
|
+
</Box>
|
|
64
70
|
)}
|
|
65
71
|
{children}
|
|
66
72
|
</Box>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { DiagramEdge } from '@likec4/core/types'
|
|
2
|
-
import {
|
|
2
|
+
import { cx } from '@likec4/styles/css'
|
|
3
3
|
import { EdgeLabelRenderer } from '@xyflow/react'
|
|
4
4
|
import { type HTMLAttributes } from 'react'
|
|
5
5
|
import { isNumber } from 'remeda'
|
|
6
6
|
import type { UndefinedOnPartialDeep } from 'type-fest'
|
|
7
7
|
import { ZIndexes } from '../../const'
|
|
8
8
|
import type { EdgeProps } from '../../types'
|
|
9
|
-
import { edgeVars } from './edge.css'
|
|
10
9
|
import { edgeLabelContainer, translate as _translate } from './EdgeLabel.css'
|
|
11
10
|
|
|
12
11
|
type Data = UndefinedOnPartialDeep<
|
|
@@ -71,10 +70,6 @@ export function EdgeLabelContainer({
|
|
|
71
70
|
<div
|
|
72
71
|
key={id}
|
|
73
72
|
className={cx(
|
|
74
|
-
css({
|
|
75
|
-
likec4RelationPalette: color,
|
|
76
|
-
}),
|
|
77
|
-
edgeVars,
|
|
78
73
|
edgeLabelContainer,
|
|
79
74
|
'nodrag nopan',
|
|
80
75
|
'likec4-edge-label-container',
|
|
@@ -72,7 +72,7 @@ const OArrow = (props: SVGProps<SVGMarkerElement>) => (
|
|
|
72
72
|
<path
|
|
73
73
|
d="M 0 0 L 8 3 L 0 6 L 1 3 z"
|
|
74
74
|
stroke="context-stroke"
|
|
75
|
-
fill="
|
|
75
|
+
fill="context-stroke"
|
|
76
76
|
strokeWidth={1.25}
|
|
77
77
|
strokeLinejoin="miter"
|
|
78
78
|
strokeLinecap={'square'}
|
|
@@ -113,7 +113,7 @@ const ODiamond = (props: SVGProps<SVGMarkerElement>) => (
|
|
|
113
113
|
<path
|
|
114
114
|
d="M5,0 L10,4 L5,8 L0,4 Z"
|
|
115
115
|
stroke="context-stroke"
|
|
116
|
-
fill="
|
|
116
|
+
fill="context-stroke"
|
|
117
117
|
strokeWidth={1.25}
|
|
118
118
|
strokeLinecap={'round'}
|
|
119
119
|
/>
|
|
@@ -149,7 +149,7 @@ const ODot = (props: SVGProps<SVGMarkerElement>) => (
|
|
|
149
149
|
<circle
|
|
150
150
|
strokeWidth={1.25}
|
|
151
151
|
stroke="context-stroke"
|
|
152
|
-
fill="
|
|
152
|
+
fill="context-stroke"
|
|
153
153
|
cx={4}
|
|
154
154
|
cy={4}
|
|
155
155
|
r={3}
|
|
@@ -2,31 +2,6 @@ import { css } from '@likec4/styles/css'
|
|
|
2
2
|
|
|
3
3
|
const isSelected = '.react-flow__edge.selected'
|
|
4
4
|
|
|
5
|
-
const edgeStroke = '--xy-edge-stroke'
|
|
6
|
-
const edgeStrokeSelected = '--xy-edge-stroke-selected'
|
|
7
|
-
const labelColor = '--xy-edge-label-color'
|
|
8
|
-
const labelBg = '--xy-edge-label-background-color'
|
|
9
|
-
|
|
10
|
-
export const edgeVars = css({
|
|
11
|
-
[edgeStroke]: '{colors.likec4.relation.stroke}',
|
|
12
|
-
[edgeStrokeSelected]: '{colors.likec4.relation.stroke.selected}',
|
|
13
|
-
[labelColor]: {
|
|
14
|
-
base: '{colors.likec4.relation.label}',
|
|
15
|
-
_light: `color-mix(in srgb, {colors.likec4.relation.label}, rgba(255 255 255 / 0.85) 40%)`,
|
|
16
|
-
},
|
|
17
|
-
[labelBg]: {
|
|
18
|
-
_light: `{colors.likec4.relation.label.bg/60}`,
|
|
19
|
-
_dark: `{colors.likec4.relation.label.bg/50}`,
|
|
20
|
-
},
|
|
21
|
-
['--xy-edge-stroke-width']: '3',
|
|
22
|
-
'&:is([data-likec4-hovered=\'true\'],[data-edge-active=\'true\'])': {
|
|
23
|
-
[edgeStroke]: '{colors.likec4.relation.stroke.selected}',
|
|
24
|
-
_whenSelected: {
|
|
25
|
-
['--xy-edge-stroke-width']: '4',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
})
|
|
29
|
-
|
|
30
5
|
export const edgeContainer = css({
|
|
31
6
|
_reduceGraphics: {
|
|
32
7
|
transition: 'none',
|
|
@@ -98,38 +73,3 @@ export const cssEdgePath = css({
|
|
|
98
73
|
animationName: 'none',
|
|
99
74
|
},
|
|
100
75
|
})
|
|
101
|
-
|
|
102
|
-
const aiBg = {
|
|
103
|
-
var: '--ai-bg',
|
|
104
|
-
ref: 'var(--ai-bg)',
|
|
105
|
-
} as const
|
|
106
|
-
|
|
107
|
-
export const actionBtn = css({
|
|
108
|
-
// zIndex: 'calc(var(--layer-overlays, 1) + 1)',
|
|
109
|
-
pointerEvents: 'all',
|
|
110
|
-
// color: `xyedge.label`,
|
|
111
|
-
cursor: 'pointer',
|
|
112
|
-
opacity: 0.75,
|
|
113
|
-
transition: 'fast',
|
|
114
|
-
// backgroundColor: aiBg.ref,
|
|
115
|
-
[aiBg.var]: 'var(--xy-edge-label-background-color)',
|
|
116
|
-
'--ai-hover': `color-mix(in srgb , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
|
|
117
|
-
'--ai-size': `var(--ai-size-sm)`,
|
|
118
|
-
'--ai-radius': `var(--mantine-radius-sm)`,
|
|
119
|
-
_hover: {
|
|
120
|
-
translateY: '1px',
|
|
121
|
-
scale: 1.15,
|
|
122
|
-
},
|
|
123
|
-
_active: {
|
|
124
|
-
translateY: '-1px',
|
|
125
|
-
scale: '0.9',
|
|
126
|
-
},
|
|
127
|
-
_whenHovered: {
|
|
128
|
-
opacity: 1,
|
|
129
|
-
},
|
|
130
|
-
'& .tabler-icon': {
|
|
131
|
-
width: '80%',
|
|
132
|
-
height: '80%',
|
|
133
|
-
strokeWidth: '2',
|
|
134
|
-
},
|
|
135
|
-
})
|
|
@@ -15,9 +15,9 @@ type ElementActionButtonsProps = NodeProps & {
|
|
|
15
15
|
const container = css({
|
|
16
16
|
position: 'absolute',
|
|
17
17
|
zIndex: 1,
|
|
18
|
-
top: `calc(100% - 30px)`,
|
|
18
|
+
top: `[calc(100% - 30px)]`,
|
|
19
19
|
transform: 'translateX(-50%)',
|
|
20
|
-
left: `50
|
|
20
|
+
left: `[50%]`,
|
|
21
21
|
width: 'auto',
|
|
22
22
|
minHeight: '30px',
|
|
23
23
|
display: 'flex',
|
|
@@ -15,20 +15,20 @@ type ElementDetailsButtonProps = NodeProps & {
|
|
|
15
15
|
|
|
16
16
|
const container = css({
|
|
17
17
|
position: 'absolute',
|
|
18
|
-
top:
|
|
19
|
-
right:
|
|
18
|
+
top: '0.5',
|
|
19
|
+
right: '0.5',
|
|
20
20
|
_shapeBrowser: {
|
|
21
|
-
right: '5px',
|
|
21
|
+
right: '[5px]',
|
|
22
22
|
},
|
|
23
23
|
_shapeCylinder: {
|
|
24
|
-
top: '14px',
|
|
24
|
+
top: '[14px]',
|
|
25
25
|
},
|
|
26
26
|
_shapeStorage: {
|
|
27
|
-
top: '14px',
|
|
27
|
+
top: '[14px]',
|
|
28
28
|
},
|
|
29
29
|
_shapeQueue: {
|
|
30
|
-
top: '1px',
|
|
31
|
-
right: '
|
|
30
|
+
top: '[1px]',
|
|
31
|
+
right: '3', // 12px
|
|
32
32
|
},
|
|
33
33
|
_smallZoom: {
|
|
34
34
|
display: 'none',
|
|
@@ -4,8 +4,8 @@ export const container = style({
|
|
|
4
4
|
position: 'relative',
|
|
5
5
|
width: '100%',
|
|
6
6
|
height: '100%',
|
|
7
|
-
padding: 0,
|
|
8
|
-
margin: 0,
|
|
7
|
+
padding: '0',
|
|
8
|
+
margin: '0',
|
|
9
9
|
display: 'flex',
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
justifyContent: 'center',
|
|
@@ -13,8 +13,8 @@ export const container = style({
|
|
|
13
13
|
_before: {
|
|
14
14
|
content: '" "',
|
|
15
15
|
position: 'absolute',
|
|
16
|
-
top: 'calc(100% - 4px)',
|
|
17
|
-
left: 0,
|
|
16
|
+
top: '[calc(100% - 4px)]',
|
|
17
|
+
left: '0',
|
|
18
18
|
width: '100%',
|
|
19
19
|
height: '24px',
|
|
20
20
|
background: '[transparent]',
|
|
@@ -4,7 +4,7 @@ export const indicator = css({
|
|
|
4
4
|
_smallZoom: {
|
|
5
5
|
visibility: 'hidden',
|
|
6
6
|
},
|
|
7
|
-
stroke: 'likec4
|
|
7
|
+
stroke: 'var(--likec4-palette-loContrast)',
|
|
8
8
|
fill: '[none]',
|
|
9
9
|
|
|
10
10
|
strokeWidth: 8,
|
|
@@ -12,7 +12,7 @@ export const indicator = css({
|
|
|
12
12
|
visibility: 'hidden',
|
|
13
13
|
pointerEvents: 'none',
|
|
14
14
|
_light: {
|
|
15
|
-
stroke: `[color-mix(in srgb,
|
|
15
|
+
stroke: `[color-mix(in srgb, var(--likec4-palette-fill) 50%,rgb(121, 121, 121))]`,
|
|
16
16
|
},
|
|
17
17
|
_whenFocused: {
|
|
18
18
|
visibility: 'visible',
|
|
@@ -27,29 +27,29 @@ export const indicator = css({
|
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
export const fillElementFill = css({
|
|
30
|
-
fill: 'likec4
|
|
30
|
+
fill: 'var(--likec4-palette-fill)',
|
|
31
31
|
})
|
|
32
32
|
|
|
33
33
|
export const fillElementStroke = css({
|
|
34
|
-
fill: 'likec4
|
|
34
|
+
fill: 'var(--likec4-palette-stroke)',
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
export const fillMixStroke = css({
|
|
38
|
-
fill: '[color-mix(in srgb,
|
|
38
|
+
fill: '[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]',
|
|
39
39
|
'.shape-svg-multiple &': {
|
|
40
|
-
fill: 'likec4
|
|
40
|
+
fill: 'var(--likec4-palette-fill)',
|
|
41
41
|
},
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
const shapeBase = css.raw({
|
|
45
|
-
top: 0,
|
|
46
|
-
left: 0,
|
|
45
|
+
top: '0',
|
|
46
|
+
left: '0',
|
|
47
47
|
position: 'absolute',
|
|
48
48
|
width: '100%',
|
|
49
49
|
height: '100%',
|
|
50
50
|
pointerEvents: 'none',
|
|
51
|
-
fill: 'likec4
|
|
52
|
-
stroke: 'likec4
|
|
51
|
+
fill: 'var(--likec4-palette-fill)',
|
|
52
|
+
stroke: 'var(--likec4-palette-stroke)',
|
|
53
53
|
overflow: 'visible',
|
|
54
54
|
// zIndex is removed to improve rendering performance
|
|
55
55
|
// this forces to keep shape in the same layer as the node
|
|
@@ -82,7 +82,7 @@ export const shapeSvg = css(shapeBase, {
|
|
|
82
82
|
transitionDelay: '0ms',
|
|
83
83
|
filter: `
|
|
84
84
|
drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
|
|
85
|
-
drop-shadow(0 1px 1px color-mix(in srgb,
|
|
85
|
+
drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))
|
|
86
86
|
drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
|
|
87
87
|
`,
|
|
88
88
|
_whenHovered: {
|
|
@@ -15,10 +15,11 @@ import type { NodeProps } from '../../types'
|
|
|
15
15
|
|
|
16
16
|
export type ElementTagProps = {
|
|
17
17
|
tag: string
|
|
18
|
+
cursor?: 'pointer' | 'default'
|
|
18
19
|
} & Omit<BoxProps, 'children'>
|
|
19
20
|
|
|
20
21
|
export const ElementTag = forwardRef<HTMLDivElement, ElementTagProps>(
|
|
21
|
-
({ tag, className, ...props }, ref) => {
|
|
22
|
+
({ tag, cursor = 'default', className, ...props }, ref) => {
|
|
22
23
|
const spec = useTagSpecification(tag)
|
|
23
24
|
return (
|
|
24
25
|
<Box
|
|
@@ -31,8 +32,9 @@ export const ElementTag = forwardRef<HTMLDivElement, ElementTagProps>(
|
|
|
31
32
|
className,
|
|
32
33
|
)}
|
|
33
34
|
{...props}
|
|
35
|
+
style={{ cursor }}
|
|
34
36
|
>
|
|
35
|
-
<span
|
|
37
|
+
<span>#</span>
|
|
36
38
|
<span>{tag}</span>
|
|
37
39
|
</Box>
|
|
38
40
|
)
|
|
@@ -99,23 +101,23 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
|
|
|
99
101
|
'likec4-element-tags',
|
|
100
102
|
hstack({
|
|
101
103
|
pointerEvents: 'all',
|
|
102
|
-
gap:
|
|
104
|
+
gap: '1',
|
|
103
105
|
alignItems: 'flex-end',
|
|
104
106
|
justifyItems: 'stretch',
|
|
105
107
|
position: 'absolute',
|
|
106
108
|
width: '100%',
|
|
107
|
-
bottom: 0,
|
|
108
|
-
left: 0,
|
|
109
|
-
padding:
|
|
109
|
+
bottom: '0',
|
|
110
|
+
left: '0',
|
|
111
|
+
padding: '1',
|
|
110
112
|
_shapeCylinder: {
|
|
111
|
-
bottom:
|
|
113
|
+
bottom: '[5px]',
|
|
112
114
|
},
|
|
113
115
|
_shapeStorage: {
|
|
114
|
-
bottom:
|
|
116
|
+
bottom: '[5px]',
|
|
115
117
|
},
|
|
116
118
|
_shapeQueue: {
|
|
117
|
-
bottom: 0,
|
|
118
|
-
paddingLeft:
|
|
119
|
+
bottom: '0',
|
|
120
|
+
paddingLeft: '[14px]',
|
|
119
121
|
},
|
|
120
122
|
}),
|
|
121
123
|
)}
|
|
@@ -147,11 +149,12 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
|
|
|
147
149
|
<HStack
|
|
148
150
|
ref={tagsToolbarRef}
|
|
149
151
|
css={{
|
|
150
|
-
gap:
|
|
152
|
+
gap: '0.5',
|
|
153
|
+
alignItems: 'baseline',
|
|
151
154
|
flexWrap: 'wrap',
|
|
152
155
|
pb: 'sm',
|
|
153
156
|
translate: 'auto',
|
|
154
|
-
x: -
|
|
157
|
+
x: '[-8px]',
|
|
155
158
|
maxWidth,
|
|
156
159
|
}}
|
|
157
160
|
>
|
|
@@ -164,8 +167,8 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
|
|
|
164
167
|
cursor: 'pointer',
|
|
165
168
|
...(zoomIsLargeEnough && {
|
|
166
169
|
fontSize: 'lg',
|
|
167
|
-
borderRadius:
|
|
168
|
-
px:
|
|
170
|
+
borderRadius: '[4px]',
|
|
171
|
+
px: '1.5', // 6px
|
|
169
172
|
}),
|
|
170
173
|
})}
|
|
171
174
|
onClick={e => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Any, DiagramView } from '@likec4/core/types'
|
|
2
|
-
import type * as aux from '@likec4/core/types/_aux'
|
|
1
|
+
import type { Any, aux, DiagramView } from '@likec4/core/types'
|
|
3
2
|
import { cx } from '@likec4/styles/css'
|
|
4
3
|
import { ActionIcon, Box } from '@mantine/core'
|
|
5
4
|
import { shallowEqual } from '@mantine/hooks'
|
|
@@ -8,6 +7,7 @@ import { memo, useState } from 'react'
|
|
|
8
7
|
import { isBoolean } from 'remeda'
|
|
9
8
|
import { FramerMotionConfig } from '../context/FramerMotionConfig'
|
|
10
9
|
import { LikeC4Diagram } from '../LikeC4Diagram'
|
|
10
|
+
import type { ViewPadding } from '../LikeC4Diagram.props'
|
|
11
11
|
import { useLikeC4Model } from '../likec4model/useLikeC4Model'
|
|
12
12
|
import { Overlay } from '../overlays/overlay/Overlay'
|
|
13
13
|
import type { LikeC4ViewProps } from './LikeC4View.props'
|
|
@@ -37,6 +37,13 @@ export function LikeC4View<A extends aux.Any = aux.UnknownLayouted>({
|
|
|
37
37
|
return <LikeC4ViewInner view={view.$view} {...props} />
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
const DEFAULT_BROWSER_PADDING: ViewPadding = {
|
|
41
|
+
top: '50px',
|
|
42
|
+
bottom: '16px',
|
|
43
|
+
left: '16px',
|
|
44
|
+
right: '16px',
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
type LikeC4ViewInnerProps<A extends aux.Any> = Omit<LikeC4ViewProps<A>, 'viewId'> & {
|
|
41
48
|
view: DiagramView<A>
|
|
42
49
|
}
|
|
@@ -162,7 +169,7 @@ const LikeC4ViewInner = memo<LikeC4ViewInnerProps<aux.Any>>(({
|
|
|
162
169
|
controls="next"
|
|
163
170
|
readonly
|
|
164
171
|
fitView
|
|
165
|
-
fitViewPadding={
|
|
172
|
+
fitViewPadding={DEFAULT_BROWSER_PADDING}
|
|
166
173
|
{...props}
|
|
167
174
|
{...browserProps}
|
|
168
175
|
showNotations={(browserProps.showNotations ?? true) &&
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Any, DiagramView } from '@likec4/core/types'
|
|
2
|
-
import type * as aux from '@likec4/core/types/_aux'
|
|
1
|
+
import type { Any, aux, DiagramView } from '@likec4/core/types'
|
|
3
2
|
import { cx } from '@likec4/styles/css'
|
|
4
3
|
import { type CSSProperties } from 'react'
|
|
5
4
|
import { isFunction, isString } from 'remeda'
|
package/src/bundle/index.ts
CHANGED
|
@@ -19,7 +19,8 @@ export { LikeC4View } from './LikeC4View'
|
|
|
19
19
|
export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props'
|
|
20
20
|
export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4'
|
|
21
21
|
|
|
22
|
-
export {
|
|
22
|
+
export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider'
|
|
23
|
+
export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider'
|
|
23
24
|
|
|
24
25
|
export { ViewNotFound } from './ViewNotFound'
|
|
25
26
|
|
package/src/bundle/styles.css.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const DefaultTheme = createTheme({
|
|
|
18
18
|
primaryColor: 'indigo',
|
|
19
19
|
cursorType: 'pointer',
|
|
20
20
|
defaultRadius: 'sm',
|
|
21
|
-
fontFamily: 'var(--
|
|
21
|
+
fontFamily: 'var(--likec4-app-font, var(--likec4-app-font-default))',
|
|
22
22
|
headings: {
|
|
23
23
|
fontWeight: '500',
|
|
24
24
|
sizes: {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
|
11
11
|
const errorString = error instanceof Error ? error.message : 'Unknown error'
|
|
12
12
|
return (
|
|
13
|
-
<Box pos={'fixed'} top={0} left={0} w={'100%'} p={0} style={{ zIndex: 1000 }}>
|
|
13
|
+
<Box pos={'fixed'} top={'0'} left={'0'} w={'100%'} p={'0'} style={{ zIndex: 1000 }}>
|
|
14
14
|
<Notification
|
|
15
15
|
icon={<IconX style={{ width: 16, height: 16 }} />}
|
|
16
16
|
styles={{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SVGProps } from 'react'
|
|
2
|
+
import { forwardRef } from 'react'
|
|
3
|
+
|
|
4
|
+
export const GithubIcon = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((props, ref) => (
|
|
5
|
+
<svg
|
|
6
|
+
height="24"
|
|
7
|
+
width="24"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
{...props}
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
ref={ref}
|
|
12
|
+
>
|
|
13
|
+
<path d="M12 1C5.923 1 1 5.923 1 12c0 4.867 3.149 8.979 7.521 10.436.55.096.756-.233.756-.522 0-.262-.013-1.128-.013-2.049-2.764.509-3.479-.674-3.699-1.292-.124-.317-.66-1.293-1.127-1.554-.385-.207-.936-.715-.014-.729.866-.014 1.485.797 1.691 1.128.99 1.663 2.571 1.196 3.204.907.096-.715.385-1.196.701-1.471-2.448-.275-5.005-1.224-5.005-5.432 0-1.196.426-2.186 1.128-2.956-.111-.275-.496-1.402.11-2.915 0 0 .921-.288 3.024 1.128a10.193 10.193 0 0 1 2.75-.371c.936 0 1.871.123 2.75.371 2.104-1.43 3.025-1.128 3.025-1.128.605 1.513.221 2.64.111 2.915.701.77 1.127 1.747 1.127 2.956 0 4.222-2.571 5.157-5.019 5.432.399.344.743 1.004.743 2.035 0 1.471-.014 2.654-.014 3.025 0 .289.206.632.756.522C19.851 20.979 23 16.854 23 12c0-6.077-4.922-11-11-11Z">
|
|
14
|
+
</path>
|
|
15
|
+
</svg>
|
|
16
|
+
))
|