@likec4/diagram 1.35.0 → 1.36.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 (224) hide show
  1. package/bundle/{chunk-C0Eg81Gj.js → chunk-DHvr-RGh.js} +323 -311
  2. package/bundle/custom.js +52 -52
  3. package/bundle/index.js +1594 -749
  4. package/dist/LikeC4Diagram.js +6 -6
  5. package/dist/LikeC4Diagram.props.d.ts +2 -3
  6. package/dist/LikeC4ModelProvider.d.ts +3 -3
  7. package/dist/LikeC4ProjectsProvider.d.ts +17 -0
  8. package/dist/LikeC4ProjectsProvider.js +22 -0
  9. package/dist/LikeC4Styles.d.ts +1 -0
  10. package/dist/LikeC4Styles.js +94 -0
  11. package/dist/StaticLikeC4Diagram.d.ts +3 -3
  12. package/dist/base/BaseXYFlow.js +23 -26
  13. package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
  14. package/dist/base/primitives/MarkdownBlock.js +1 -1
  15. package/dist/base/primitives/compound/CompoundActionButton.js +2 -2
  16. package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -2
  17. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
  18. package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
  19. package/dist/base/primitives/compound/CompoundTitle.js +9 -8
  20. package/dist/base/primitives/compound/actionbtns.css.js +6 -6
  21. package/dist/base/primitives/edge/EdgeActionButton.js +2 -2
  22. package/dist/base/primitives/edge/EdgeContainer.js +4 -7
  23. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
  24. package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
  25. package/dist/base/primitives/edge/EdgeLabel.js +16 -6
  26. package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
  27. package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
  28. package/dist/base/primitives/edge/edge.css.d.ts +0 -2
  29. package/dist/base/primitives/edge/edge.css.js +1 -55
  30. package/dist/base/primitives/element/ElementActionButtons.js +2 -2
  31. package/dist/base/primitives/element/ElementDetailsButton.js +8 -7
  32. package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
  33. package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
  34. package/dist/base/primitives/element/ElementShape.css.js +11 -11
  35. package/dist/base/primitives/element/ElementTags.d.ts +1 -0
  36. package/dist/base/primitives/element/ElementTags.js +17 -14
  37. package/dist/bundle/LikeC4View.d.ts +1 -1
  38. package/dist/bundle/LikeC4View.js +7 -1
  39. package/dist/bundle/LikeC4View.props.d.ts +1 -2
  40. package/dist/bundle/ReactLikeC4.d.ts +1 -1
  41. package/dist/bundle/ViewNotFound.js +1 -1
  42. package/dist/bundle/index.d.ts +2 -1
  43. package/dist/bundle/index.js +1 -0
  44. package/dist/bundle/styles.css.js +1 -1
  45. package/dist/components/ErrorFallback.js +1 -1
  46. package/dist/components/GithubIcon.d.ts +2 -0
  47. package/dist/components/GithubIcon.js +17 -0
  48. package/dist/components/Link.d.ts +4 -3
  49. package/dist/components/Link.js +84 -87
  50. package/dist/components/NavigationLink.d.ts +2 -2
  51. package/dist/components/SearchControl.css.js +6 -5
  52. package/dist/context/DiagramEventHandlers.d.ts +6 -6
  53. package/dist/context/DiagramEventHandlers.js +4 -7
  54. package/dist/globals.css.js +3 -0
  55. package/dist/hooks/useXYFlow.d.ts +10 -10
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/likec4diagram/DiagramUI.js +2 -1
  59. package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
  60. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  61. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
  62. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
  63. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -3
  64. package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
  65. package/dist/likec4diagram/custom/index.d.ts +2 -2
  66. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
  67. package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
  68. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +4 -4
  69. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
  70. package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -5
  71. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
  72. package/dist/likec4model/LikeC4ModelContext.d.ts +2 -1
  73. package/dist/likec4model/LikeC4ModelContext.js +10 -2
  74. package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
  75. package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
  76. package/dist/likec4model/index.d.ts +1 -0
  77. package/dist/likec4model/useCurrentViewModel.d.ts +1 -0
  78. package/dist/likec4model/useCurrentViewModel.js +4 -1
  79. package/dist/likec4model/useLikeC4Project.d.ts +22 -0
  80. package/dist/likec4model/useLikeC4Project.js +23 -0
  81. package/dist/navigationpanel/NavigationPanel.js +15 -17
  82. package/dist/navigationpanel/NavigationPanelControls.js +34 -21
  83. package/dist/navigationpanel/NavigationPanelDropdown.js +33 -17
  84. package/dist/navigationpanel/_common.js +4 -1
  85. package/dist/navigationpanel/actor.d.ts +11 -15
  86. package/dist/navigationpanel/actor.js +14 -15
  87. package/dist/navigationpanel/controls/BurgerButton.js +5 -7
  88. package/dist/navigationpanel/controls/NavigationButtons.js +37 -24
  89. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  90. package/dist/navigationpanel/controls/SearchControl.js +6 -4
  91. package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
  92. package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
  93. package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
  94. package/dist/navigationpanel/controls/index.d.ts +1 -0
  95. package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
  96. package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
  97. package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
  98. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -20
  99. package/dist/navigationpanel/editorpanel/styles.js +5 -5
  100. package/dist/navigationpanel/hooks.d.ts +2 -2
  101. package/dist/navigationpanel/styles.css.js +0 -2
  102. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +12 -7
  103. 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
  104. 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
  105. package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
  106. package/dist/overlays/element-details/ElementDetailsCard.js +8 -13
  107. package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
  108. package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
  109. package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
  110. package/dist/overlays/overlay/Overlay.css.js +8 -7
  111. package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
  112. package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
  113. package/dist/search/Search.js +6 -6
  114. package/dist/search/components/ElementsColumn.css.js +5 -5
  115. package/dist/search/components/SearchByTags.js +3 -2
  116. package/dist/search/components/ViewsColum.js +1 -1
  117. package/dist/search/components/ViewsColumn.css.js +1 -1
  118. package/dist/search/components/_shared.css.js +3 -3
  119. package/dist/search/components/styles.css.js +5 -5
  120. package/dist/state/DiagramActorProvider.js +43 -25
  121. package/dist/state/diagram-machine.d.ts +29 -247
  122. package/dist/state/diagram-machine.js +16 -16
  123. package/dist/styles-min.css +1 -1
  124. package/dist/styles.css +1 -1
  125. package/dist/styles.css2.js +1 -1
  126. package/package.json +10 -8
  127. package/panda.buildinfo.json +254 -326
  128. package/src/LikeC4Diagram.props.ts +2 -2
  129. package/src/LikeC4Diagram.tsx +2 -2
  130. package/src/LikeC4ModelProvider.tsx +4 -4
  131. package/src/LikeC4ProjectsProvider.tsx +41 -0
  132. package/src/LikeC4Styles.tsx +107 -0
  133. package/src/StaticLikeC4Diagram.tsx +3 -3
  134. package/src/base/BaseXYFlow.tsx +24 -29
  135. package/src/base/primitives/MarkdownBlock.tsx +11 -3
  136. package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
  137. package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
  138. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
  139. package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
  140. package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
  141. package/src/base/primitives/compound/actionbtns.css.ts +6 -6
  142. package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
  143. package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
  144. package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
  145. package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
  146. package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
  147. package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
  148. package/src/base/primitives/edge/edge.css.ts +0 -60
  149. package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
  150. package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
  151. package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
  152. package/src/base/primitives/element/ElementNodeContainer.tsx +0 -3
  153. package/src/base/primitives/element/ElementShape.css.ts +11 -11
  154. package/src/base/primitives/element/ElementTags.tsx +17 -14
  155. package/src/bundle/LikeC4View.props.ts +1 -2
  156. package/src/bundle/LikeC4View.tsx +10 -3
  157. package/src/bundle/ReactLikeC4.tsx +1 -2
  158. package/src/bundle/ViewNotFound.tsx +1 -1
  159. package/src/bundle/index.ts +2 -1
  160. package/src/bundle/styles.css.ts +1 -1
  161. package/src/components/ErrorFallback.tsx +1 -1
  162. package/src/components/GithubIcon.tsx +16 -0
  163. package/src/components/Link.tsx +102 -113
  164. package/src/components/NavigationLink.tsx +2 -1
  165. package/src/components/SearchControl.css.ts +5 -5
  166. package/src/context/DiagramEventHandlers.tsx +12 -12
  167. package/src/globals.css +71 -0
  168. package/src/index.ts +5 -0
  169. package/src/likec4diagram/DiagramUI.tsx +8 -2
  170. package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
  171. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
  172. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
  173. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
  174. package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
  175. package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
  176. package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
  177. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +4 -5
  178. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
  179. package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
  180. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
  181. package/src/likec4model/{LikeC4ModelContext.ts → LikeC4ModelContext.tsx} +9 -1
  182. package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
  183. package/src/likec4model/index.ts +8 -0
  184. package/src/likec4model/useCurrentViewModel.ts +4 -0
  185. package/src/likec4model/useLikeC4Project.ts +61 -0
  186. package/src/navigationpanel/NavigationPanel.tsx +16 -17
  187. package/src/navigationpanel/NavigationPanelControls.tsx +24 -46
  188. package/src/navigationpanel/NavigationPanelDropdown.tsx +32 -16
  189. package/src/navigationpanel/_common.tsx +4 -1
  190. package/src/navigationpanel/actor.ts +14 -15
  191. package/src/navigationpanel/controls/BurgerButton.tsx +5 -7
  192. package/src/navigationpanel/controls/NavigationButtons.tsx +9 -1
  193. package/src/navigationpanel/controls/OpenSource.tsx +1 -1
  194. package/src/navigationpanel/controls/SearchControl.tsx +6 -4
  195. package/src/navigationpanel/controls/ToggleReadonly.tsx +3 -3
  196. package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
  197. package/src/navigationpanel/controls/index.ts +1 -0
  198. package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
  199. package/src/navigationpanel/editorpanel/EditorPanel.tsx +3 -3
  200. package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +19 -22
  201. package/src/navigationpanel/editorpanel/styles.ts +5 -5
  202. package/src/navigationpanel/hooks.tsx +2 -2
  203. package/src/navigationpanel/styles.css.ts +0 -2
  204. package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +9 -4
  205. package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
  206. package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
  207. package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
  208. package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
  209. package/src/overlays/overlay/Overlay.css.ts +7 -7
  210. package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
  211. package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
  212. package/src/search/Search.tsx +6 -6
  213. package/src/search/components/ElementsColumn.css.ts +5 -5
  214. package/src/search/components/SearchByTags.tsx +2 -2
  215. package/src/search/components/ViewsColum.tsx +1 -1
  216. package/src/search/components/ViewsColumn.css.ts +1 -1
  217. package/src/search/components/_shared.css.ts +3 -3
  218. package/src/search/components/styles.css.ts +5 -5
  219. package/src/state/DiagramActorProvider.tsx +56 -30
  220. package/src/state/diagram-machine.ts +22 -16
  221. package/dist/LikeC4CustomColors.d.ts +0 -2
  222. package/dist/LikeC4CustomColors.js +0 -45
  223. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
  224. package/src/LikeC4CustomColors.tsx +0 -85
@@ -1,11 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { isStepEdgeId, extractStep } from '@likec4/core';
3
- import { cx } from '@likec4/styles/css';
3
+ import { cx, css } from '@likec4/styles/css';
4
4
  import { Box } from '@likec4/styles/jsx';
5
- import { Text } from '@mantine/core';
5
+ import { edgeLabel } from '@likec4/styles/recipes';
6
6
  import { forwardRef } from 'react';
7
7
  import { isTruthy } from 'remeda';
8
- import { labelsva } from './EdgeLabel.css.js';
9
8
 
10
9
  const EdgeLabel = forwardRef(({
11
10
  edgeProps: {
@@ -21,14 +20,25 @@ const EdgeLabel = forwardRef(({
21
20
  ...rest
22
21
  }, ref) => {
23
22
  const stepNum = isStepEdgeId(id) ? extractStep(id) : null;
24
- const classes = labelsva({
23
+ const classes = edgeLabel({
25
24
  isStepEdge: stepNum !== null
26
25
  });
27
26
  return /* @__PURE__ */ jsxs(Box, { ref, className: cx(classes.root, className), ...rest, children: [
28
27
  stepNum !== null && /* @__PURE__ */ jsx(Box, { className: classes.stepNumber, children: stepNum }),
29
28
  /* @__PURE__ */ jsxs(Box, { className: classes.labelContents, children: [
30
- isTruthy(label) && /* @__PURE__ */ jsx(Text, { component: "div", className: classes.labelText, lineClamp: 5, children: label }),
31
- isTruthy(technology) && /* @__PURE__ */ jsx(Text, { component: "div", className: classes.labelTechnology, children: "[ " + technology + " ]" }),
29
+ isTruthy(label) && /* @__PURE__ */ jsx(
30
+ Box,
31
+ {
32
+ className: cx(
33
+ classes.labelText,
34
+ css({
35
+ lineClamp: 5
36
+ })
37
+ ),
38
+ children: label
39
+ }
40
+ ),
41
+ isTruthy(technology) && /* @__PURE__ */ jsx(Box, { className: classes.labelTechnology, children: "[ " + technology + " ]" }),
32
42
  children
33
43
  ] })
34
44
  ] });
@@ -1,9 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { cx, css } from '@likec4/styles/css';
2
+ import { cx } from '@likec4/styles/css';
3
3
  import { EdgeLabelRenderer } from '@xyflow/react';
4
4
  import { isNumber } from 'remeda';
5
5
  import { ZIndexes } from '../../const.js';
6
- import { edgeVars } from './edge.css.js';
7
6
  import { translate, edgeLabelContainer } from './EdgeLabel.css.js';
8
7
 
9
8
  const toCssVarValue = (value) => {
@@ -40,10 +39,6 @@ function EdgeLabelContainer({
40
39
  "div",
41
40
  {
42
41
  className: cx(
43
- css({
44
- likec4RelationPalette: color
45
- }),
46
- edgeVars,
47
42
  edgeLabelContainer,
48
43
  "nodrag nopan",
49
44
  "likec4-edge-label-container",
@@ -83,7 +83,7 @@ const OArrow = (props) => /* @__PURE__ */ jsx(
83
83
  {
84
84
  d: "M 0 0 L 8 3 L 0 6 L 1 3 z",
85
85
  stroke: "context-stroke",
86
- fill: "var(--likec4-background-color)",
86
+ fill: "context-stroke",
87
87
  strokeWidth: 1.25,
88
88
  strokeLinejoin: "miter",
89
89
  strokeLinecap: "square"
@@ -129,7 +129,7 @@ const ODiamond = (props) => /* @__PURE__ */ jsx(
129
129
  {
130
130
  d: "M5,0 L10,4 L5,8 L0,4 Z",
131
131
  stroke: "context-stroke",
132
- fill: "var(--likec4-background-color)",
132
+ fill: "context-stroke",
133
133
  strokeWidth: 1.25,
134
134
  strokeLinecap: "round"
135
135
  }
@@ -171,7 +171,7 @@ const ODot = (props) => /* @__PURE__ */ jsx(
171
171
  {
172
172
  strokeWidth: 1.25,
173
173
  stroke: "context-stroke",
174
- fill: "var(--likec4-background-color)",
174
+ fill: "context-stroke",
175
175
  cx: 4,
176
176
  cy: 4,
177
177
  r: 3
@@ -1,7 +1,5 @@
1
- export declare const edgeVars: string;
2
1
  export declare const edgeContainer: string;
3
2
  export declare const hideOnReducedGraphics: string;
4
3
  export declare const edgePathBg: string;
5
4
  export declare const markerContext: string;
6
5
  export declare const cssEdgePath: string;
7
- export declare const actionBtn: string;
@@ -1,29 +1,6 @@
1
1
  import { css } from '@likec4/styles/css';
2
2
 
3
3
  const isSelected = ".react-flow__edge.selected";
4
- const edgeStroke = "--xy-edge-stroke";
5
- const edgeStrokeSelected = "--xy-edge-stroke-selected";
6
- const labelColor = "--xy-edge-label-color";
7
- const labelBg = "--xy-edge-label-background-color";
8
- const edgeVars = css({
9
- [edgeStroke]: "{colors.likec4.relation.stroke}",
10
- [edgeStrokeSelected]: "{colors.likec4.relation.stroke.selected}",
11
- [labelColor]: {
12
- base: "{colors.likec4.relation.label}",
13
- _light: `color-mix(in srgb, {colors.likec4.relation.label}, rgba(255 255 255 / 0.85) 40%)`
14
- },
15
- [labelBg]: {
16
- _light: `{colors.likec4.relation.label.bg/60}`,
17
- _dark: `{colors.likec4.relation.label.bg/50}`
18
- },
19
- ["--xy-edge-stroke-width"]: "3",
20
- "&:is([data-likec4-hovered='true'],[data-edge-active='true'])": {
21
- [edgeStroke]: "{colors.likec4.relation.stroke.selected}",
22
- _whenSelected: {
23
- ["--xy-edge-stroke-width"]: "4"
24
- }
25
- }
26
- });
27
4
  const edgeContainer = css({
28
5
  _reduceGraphics: {
29
6
  transition: "none"
@@ -90,36 +67,5 @@ const cssEdgePath = css({
90
67
  animationName: "none"
91
68
  }
92
69
  });
93
- const aiBg = {
94
- var: "--ai-bg"};
95
- const actionBtn = css({
96
- // zIndex: 'calc(var(--layer-overlays, 1) + 1)',
97
- pointerEvents: "all",
98
- // color: `xyedge.label`,
99
- cursor: "pointer",
100
- opacity: 0.75,
101
- transition: "fast",
102
- // backgroundColor: aiBg.ref,
103
- [aiBg.var]: "var(--xy-edge-label-background-color)",
104
- "--ai-hover": `color-mix(in srgb , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
105
- "--ai-size": `var(--ai-size-sm)`,
106
- "--ai-radius": `var(--mantine-radius-sm)`,
107
- _hover: {
108
- translateY: "1px",
109
- scale: 1.15
110
- },
111
- _active: {
112
- translateY: "-1px",
113
- scale: "0.9"
114
- },
115
- _whenHovered: {
116
- opacity: 1
117
- },
118
- "& .tabler-icon": {
119
- width: "80%",
120
- height: "80%",
121
- strokeWidth: "2"
122
- }
123
- });
124
70
 
125
- export { actionBtn, cssEdgePath, edgeContainer, edgePathBg, edgeVars, hideOnReducedGraphics, markerContext };
71
+ export { cssEdgePath, edgeContainer, edgePathBg, hideOnReducedGraphics, markerContext };
@@ -11,9 +11,9 @@ import { stopPropagation } from '../../../utils/xyflow.js';
11
11
  const container = css({
12
12
  position: "absolute",
13
13
  zIndex: 1,
14
- top: `calc(100% - 30px)`,
14
+ top: `[calc(100% - 30px)]`,
15
15
  transform: "translateX(-50%)",
16
- left: `50%`,
16
+ left: `[50%]`,
17
17
  width: "auto",
18
18
  minHeight: "30px",
19
19
  display: "flex",
@@ -10,20 +10,21 @@ import IconId from '../../../node_modules/.pnpm/@tabler_icons-react@3.34.1_react
10
10
 
11
11
  const container = css({
12
12
  position: "absolute",
13
- top: 2,
14
- right: 2,
13
+ top: "0.5",
14
+ right: "0.5",
15
15
  _shapeBrowser: {
16
- right: "5px"
16
+ right: "[5px]"
17
17
  },
18
18
  _shapeCylinder: {
19
- top: "14px"
19
+ top: "[14px]"
20
20
  },
21
21
  _shapeStorage: {
22
- top: "14px"
22
+ top: "[14px]"
23
23
  },
24
24
  _shapeQueue: {
25
- top: "1px",
26
- right: "12px"
25
+ top: "[1px]",
26
+ right: "3"
27
+ // 12px
27
28
  },
28
29
  _smallZoom: {
29
30
  display: "none"
@@ -4,8 +4,8 @@ const container = css({
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 @@ const container = css({
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]",
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { DefaultShapeSize, DefaultTextSize, DefaultPaddingSize } from '@likec4/core/types';
3
- import { cx, css } from '@likec4/styles/css';
3
+ import { cx } from '@likec4/styles/css';
4
4
  import * as m from 'motion/react-m';
5
5
  import { forwardRef } from 'react';
6
6
  import { container } from './ElementNodeContainer.css.js';
@@ -62,9 +62,6 @@ const ElementNodeContainer = forwardRef(({
62
62
  {
63
63
  ref,
64
64
  className: cx(
65
- css({
66
- likec4Palette: data.color
67
- }),
68
65
  container,
69
66
  "group",
70
67
  "likec4-element-node",
@@ -4,14 +4,14 @@ const indicator = css({
4
4
  _smallZoom: {
5
5
  visibility: "hidden"
6
6
  },
7
- stroke: "likec4.palette.loContrast",
7
+ stroke: "var(--likec4-palette-loContrast)",
8
8
  fill: "[none]",
9
9
  strokeWidth: 8,
10
10
  strokeOpacity: 0.8,
11
11
  visibility: "hidden",
12
12
  pointerEvents: "none",
13
13
  _light: {
14
- stroke: `[color-mix(in srgb, {colors.likec4.palette.fill} 50%,rgb(121, 121, 121))]`
14
+ stroke: `[color-mix(in srgb, var(--likec4-palette-fill) 50%,rgb(121, 121, 121))]`
15
15
  },
16
16
  _whenFocused: {
17
17
  visibility: "visible"
@@ -25,26 +25,26 @@ const indicator = css({
25
25
  }
26
26
  });
27
27
  const fillElementFill = css({
28
- fill: "likec4.palette.fill"
28
+ fill: "var(--likec4-palette-fill)"
29
29
  });
30
30
  css({
31
- fill: "likec4.palette.stroke"
31
+ fill: "var(--likec4-palette-stroke)"
32
32
  });
33
33
  const fillMixStroke = css({
34
- fill: "[color-mix(in srgb, {colors.likec4.palette.stroke} 90%, {colors.likec4.palette.fill})]",
34
+ fill: "[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]",
35
35
  ".shape-svg-multiple &": {
36
- fill: "likec4.palette.fill"
36
+ fill: "var(--likec4-palette-fill)"
37
37
  }
38
38
  });
39
39
  const shapeBase = css.raw({
40
- top: 0,
41
- left: 0,
40
+ top: "0",
41
+ left: "0",
42
42
  position: "absolute",
43
43
  width: "100%",
44
44
  height: "100%",
45
45
  pointerEvents: "none",
46
- fill: "likec4.palette.fill",
47
- stroke: "likec4.palette.stroke",
46
+ fill: "var(--likec4-palette-fill)",
47
+ stroke: "var(--likec4-palette-stroke)",
48
48
  overflow: "visible"
49
49
  // zIndex is removed to improve rendering performance
50
50
  // this forces to keep shape in the same layer as the node
@@ -75,7 +75,7 @@ const shapeSvg = css(shapeBase, {
75
75
  transitionDelay: "0ms",
76
76
  filter: `
77
77
  drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
78
- drop-shadow(0 1px 1px color-mix(in srgb, {colors.likec4.palette.stroke} 40%, transparent))
78
+ drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))
79
79
  drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
80
80
  `,
81
81
  _whenHovered: {
@@ -3,6 +3,7 @@ import { NodeProps } from '../../types';
3
3
  import { ForwardRefExoticComponent, RefAttributes, MemoExoticComponent } from 'react';
4
4
  export type ElementTagProps = {
5
5
  tag: string;
6
+ cursor?: 'pointer' | 'default';
6
7
  } & Omit<BoxProps, 'children'>;
7
8
  export declare const ElementTag: ForwardRefExoticComponent<Omit<ElementTagProps, "ref"> & RefAttributes<HTMLDivElement>>;
8
9
  type Data = {
@@ -14,7 +14,7 @@ import { useCurrentZoom } from '../../../hooks/useXYFlow.js';
14
14
  import { stopPropagation } from '../../../utils/xyflow.js';
15
15
 
16
16
  const ElementTag = forwardRef(
17
- ({ tag, className, ...props }, ref) => {
17
+ ({ tag, cursor = "default", className, ...props }, ref) => {
18
18
  const spec = useTagSpecification(tag);
19
19
  return /* @__PURE__ */ jsxs(
20
20
  Box,
@@ -28,8 +28,9 @@ const ElementTag = forwardRef(
28
28
  className
29
29
  ),
30
30
  ...props,
31
+ style: { cursor },
31
32
  children: [
32
- /* @__PURE__ */ jsx("span", { style: { opacity: 0.7, fontSize: "1.05em" }, children: "#" }),
33
+ /* @__PURE__ */ jsx("span", { children: "#" }),
33
34
  /* @__PURE__ */ jsx("span", { children: tag })
34
35
  ]
35
36
  }
@@ -79,23 +80,23 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
79
80
  "likec4-element-tags",
80
81
  hstack({
81
82
  pointerEvents: "all",
82
- gap: 4,
83
+ gap: "1",
83
84
  alignItems: "flex-end",
84
85
  justifyItems: "stretch",
85
86
  position: "absolute",
86
87
  width: "100%",
87
- bottom: 0,
88
- left: 0,
89
- padding: 4,
88
+ bottom: "0",
89
+ left: "0",
90
+ padding: "1",
90
91
  _shapeCylinder: {
91
- bottom: 5
92
+ bottom: "[5px]"
92
93
  },
93
94
  _shapeStorage: {
94
- bottom: 5
95
+ bottom: "[5px]"
95
96
  },
96
97
  _shapeQueue: {
97
- bottom: 0,
98
- paddingLeft: 14
98
+ bottom: "0",
99
+ paddingLeft: "[14px]"
99
100
  }
100
101
  })
101
102
  ),
@@ -129,11 +130,12 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
129
130
  {
130
131
  ref: tagsToolbarRef,
131
132
  css: {
132
- gap: 4,
133
+ gap: "0.5",
134
+ alignItems: "baseline",
133
135
  flexWrap: "wrap",
134
136
  pb: "sm",
135
137
  translate: "auto",
136
- x: -8,
138
+ x: "[-8px]",
137
139
  maxWidth
138
140
  },
139
141
  children: tags.map((tag) => /* @__PURE__ */ jsx(
@@ -145,8 +147,9 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
145
147
  cursor: "pointer",
146
148
  ...zoomIsLargeEnough && {
147
149
  fontSize: "lg",
148
- borderRadius: 4,
149
- px: 6
150
+ borderRadius: "[4px]",
151
+ px: "1.5"
152
+ // 6px
150
153
  }
151
154
  }),
152
155
  onClick: (e) => {
@@ -1,3 +1,3 @@
1
+ import { aux } from '@likec4/core/types';
1
2
  import { LikeC4ViewProps } from './LikeC4View.props';
2
- import type * as aux from '@likec4/core/types/_aux';
3
3
  export declare function LikeC4View<A extends aux.Any = aux.UnknownLayouted>({ viewId, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
@@ -31,6 +31,12 @@ function LikeC4View({
31
31
  }
32
32
  return /* @__PURE__ */ jsx(LikeC4ViewInner, { view: view.$view, ...props });
33
33
  }
34
+ const DEFAULT_BROWSER_PADDING = {
35
+ top: "50px",
36
+ bottom: "16px",
37
+ left: "16px",
38
+ right: "16px"
39
+ };
34
40
  const LikeC4ViewInner = memo(({
35
41
  view,
36
42
  className,
@@ -152,7 +158,7 @@ const LikeC4ViewInner = memo(({
152
158
  controls: "next",
153
159
  readonly: true,
154
160
  fitView: true,
155
- fitViewPadding: "32px",
161
+ fitViewPadding: DEFAULT_BROWSER_PADDING,
156
162
  ...props,
157
163
  ...browserProps,
158
164
  showNotations: (browserProps.showNotations ?? true) && (browserView.notation?.nodes.length ?? 0) > 0,
@@ -1,7 +1,6 @@
1
- import { WhereOperator } from '@likec4/core/types';
1
+ import { aux, WhereOperator } from '@likec4/core/types';
2
2
  import { CSSProperties } from 'react';
3
3
  import { CustomNodes, ElementIconRenderer, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from '../LikeC4Diagram.props';
4
- import type * as aux from '@likec4/core/types/_aux';
5
4
  export interface LikeC4ViewProps<A extends aux.Any> {
6
5
  /**
7
6
  * View to display.
@@ -1,6 +1,6 @@
1
+ import { aux } from '@likec4/core/types';
1
2
  import { CSSProperties } from 'react';
2
3
  import { LikeC4DiagramProps } from '../LikeC4Diagram';
3
- import type * as aux from '@likec4/core/types/_aux';
4
4
  export type ReactLikeC4Props<A extends aux.Any> = Omit<LikeC4DiagramProps<A>, 'view'> & {
5
5
  viewId: aux.ViewId<A>;
6
6
  /**
@@ -4,7 +4,7 @@ const ErrorMessage = ({ children }) => /* @__PURE__ */ jsx(
4
4
  "div",
5
5
  {
6
6
  style: {
7
- margin: "1rem 0"
7
+ margin: "[1rem 0]"
8
8
  },
9
9
  children: /* @__PURE__ */ jsx(
10
10
  "div",
@@ -2,6 +2,7 @@ export type { ChangeEvent, CustomNodes, DiagramNodeWithNavigate, ElementIconRend
2
2
  export { LikeC4View } from './LikeC4View';
3
3
  export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props';
4
4
  export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4';
5
- export { LikeC4ModelProvider } from './LikeC4ModelProvider';
5
+ export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider';
6
+ export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider';
6
7
  export { ViewNotFound } from './ViewNotFound';
7
8
  export * from '../custom/hooks';
@@ -1,5 +1,6 @@
1
1
  export { LikeC4View } from './LikeC4View.js';
2
2
  export { ReactLikeC4 } from './ReactLikeC4.js';
3
+ export { LikeC4ProjectsProvider } from '../LikeC4ProjectsProvider.js';
3
4
  export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
4
5
  export { ViewNotFound } from './ViewNotFound.js';
5
6
  export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
@@ -12,7 +12,7 @@ const DefaultTheme = createTheme({
12
12
  primaryColor: "indigo",
13
13
  cursorType: "pointer",
14
14
  defaultRadius: "sm",
15
- fontFamily: "var(--fonts-likec4)",
15
+ fontFamily: "var(--likec4-app-font, var(--likec4-app-font-default))",
16
16
  headings: {
17
17
  fontWeight: "500",
18
18
  sizes: {
@@ -6,7 +6,7 @@ import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1
6
6
 
7
7
  function ErrorFallback({ error, resetErrorBoundary }) {
8
8
  const errorString = error instanceof Error ? error.message : "Unknown error";
9
- return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: 0, left: 0, w: "100%", p: 0, style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
9
+ return /* @__PURE__ */ jsx(Box, { pos: "fixed", top: "0", left: "0", w: "100%", p: "0", style: { zIndex: 1e3 }, children: /* @__PURE__ */ jsxs(
10
10
  Notification,
11
11
  {
12
12
  icon: /* @__PURE__ */ jsx(IconX, { style: { width: 16, height: 16 } }),
@@ -0,0 +1,2 @@
1
+ import { SVGProps, ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ export declare const GithubIcon: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,17 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+
4
+ const GithubIcon = forwardRef((props, ref) => /* @__PURE__ */ jsx(
5
+ "svg",
6
+ {
7
+ height: "24",
8
+ width: "24",
9
+ fill: "currentColor",
10
+ ...props,
11
+ viewBox: "0 0 24 24",
12
+ ref,
13
+ children: /* @__PURE__ */ jsx("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
+ }
15
+ ));
16
+
17
+ export { GithubIcon };
@@ -1,5 +1,6 @@
1
1
  import { Link as LinkData } from '@likec4/core';
2
- export declare function Link({ value, size, }: {
3
- size?: 'sm' | 'md';
2
+ import { BadgeProps } from '@mantine/core';
3
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ export declare const Link: ForwardRefExoticComponent<Omit<BadgeProps, "children" | "classNames"> & {
4
5
  value: LinkData;
5
- }): import("react/jsx-runtime").JSX.Element;
6
+ } & RefAttributes<HTMLDivElement>>;