likec4 0.44.0 → 0.44.2

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/README.md CHANGED
@@ -80,7 +80,7 @@ This recursively searchs for `*.c4`, `*.likec4` files in current folder, parses
80
80
  Any changes in the sources trigger a super-fast hot update and you see changes in the browser immediately.
81
81
 
82
82
  > **Tip:**
83
- > You can use `likec4 serve [path]` in a separate terminal window and keep it running while you're editing diagrams in editor, or even serve multiple projects at once.
83
+ > You can use `likec4 start [path]` in a separate terminal window and keep it running while you're editing diagrams in editor, or even serve multiple projects at once.
84
84
 
85
85
  ### Build static website
86
86
 
@@ -8,13 +8,13 @@ const sky = {
8
8
  fill: "#0284c7",
9
9
  stroke: "#0369a1",
10
10
  hiContrast: "#f0f9ff",
11
- loContrast: "#e0f2fe"
11
+ loContrast: "#B6ECF7"
12
12
  };
13
13
  const slate = {
14
14
  fill: "#64748b",
15
15
  stroke: "#475569",
16
16
  hiContrast: "#f8fafc",
17
- loContrast: "#e2e8f0"
17
+ loContrast: "#cbd5e1"
18
18
  };
19
19
  export const ElementColors = {
20
20
  primary: blue,
@@ -31,23 +31,24 @@ export const ElementColors = {
31
31
  fill: "#737373",
32
32
  stroke: "#525252",
33
33
  hiContrast: "#fafafa",
34
- loContrast: "#e5e5e5"
34
+ loContrast: "#d4d4d4"
35
35
  },
36
36
  red: {
37
37
  // fill: colors.red[500],
38
38
  // stroke: colors.red[600],
39
39
  // hiContrast: colors.red[50],
40
40
  // loContrast: colors.red[200],
41
- fill: "#b54548",
42
- stroke: "#8c333a",
41
+ fill: "#AC4D39",
42
+ // fill: '#b54548',
43
+ stroke: "#853A2D",
43
44
  // hiContrast: '#fef2f2',
44
45
  // loContrast: '#fecaca',
45
46
  // hiContrast: '#191111', // colors.gray[900],
46
47
  // loContrast: '#3b1219' // colors.gray[800],
47
- hiContrast: "#f8fafc",
48
+ hiContrast: "#FBD3CB",
48
49
  // hiContrast: '#f8fafc',
49
50
  // loContrast: '#fdd8d8' // radix black red 12
50
- loContrast: "#F9C6C6"
51
+ loContrast: "#FF977D"
51
52
  },
52
53
  green: {
53
54
  fill: "#428a4f",
@@ -56,18 +57,10 @@ export const ElementColors = {
56
57
  loContrast: "#c2f0c2"
57
58
  },
58
59
  amber: {
59
- // fill: colors.amber[600],
60
- // stroke: colors.amber[700],
61
- // hiContrast: colors.amber[50],
62
- // loContrast: colors.amber[200],
63
- fill: "#d97706",
64
- stroke: "#b45309",
65
- // hiContrast: '#fffbeb',
66
- // loContrast: '#fde68a',
67
- hiContrast: "#f8fafc",
68
- // colors.gray[900],
69
- loContrast: "#ffe0c2"
70
- // colors.gray[800],
60
+ fill: "#A35829",
61
+ stroke: "#7E451D",
62
+ hiContrast: "#FFE0C2",
63
+ loContrast: "#FFA057"
71
64
  },
72
65
  indigo: {
73
66
  // fill: colors.indigo[500],
@@ -31,7 +31,7 @@ export const RelationshipColors = {
31
31
  amber: {
32
32
  lineColor: "#b45309",
33
33
  labelBgColor: "#78350f",
34
- labelColor: "#f59e0b"
34
+ labelColor: "#FFE0C2"
35
35
  },
36
36
  blue,
37
37
  gray,
@@ -54,9 +54,9 @@ export const RelationshipColors = {
54
54
  muted: slate,
55
55
  primary: blue,
56
56
  red: {
57
- lineColor: "#b91c1c",
57
+ lineColor: "#AC4D39",
58
58
  labelBgColor: "#b91c1c",
59
- labelColor: "#dc2626"
59
+ labelColor: "#FF977D"
60
60
  },
61
61
  secondary: sky,
62
62
  sky,
@@ -147,16 +147,18 @@ function NodeSnape({
147
147
  {
148
148
  name: node.id,
149
149
  visible: expired !== true,
150
- onPointerEnter: (e) => {
151
- if (animate) {
150
+ ...animate && {
151
+ onPointerEnter: (e) => {
152
152
  setHoveredNode(node);
153
- onNodeClick && mousePointer(e);
153
+ if (isNavigatable) {
154
+ mousePointer(e);
155
+ }
156
+ },
157
+ onPointerLeave: (e) => {
158
+ setHoveredNode(null);
159
+ mouseDefault(e);
154
160
  }
155
161
  },
156
- onPointerLeave: (e) => {
157
- setHoveredNode(null);
158
- mouseDefault(e);
159
- },
160
162
  ...onNodeClick && {
161
163
  onPointerClick: (e) => {
162
164
  if (DiagramGesture.isDragging || e.evt.button !== 0) {
@@ -186,7 +188,7 @@ function NodeSnape({
186
188
  labelOffsetX: isNavigatable ? -12 : 4
187
189
  }
188
190
  ),
189
- isNavigatable && /* @__PURE__ */ jsx(ZoomInIcon, { fill: "#BABABA", opacity: 0.9, size: 16, x: 16, y: 18 })
191
+ isNavigatable && /* @__PURE__ */ jsx(ZoomInIcon, { fill: "#BABABA", opacity: 0.9, size: 16, x: 16, y: 17 })
190
192
  ] }),
191
193
  !_isCompound && /* @__PURE__ */ jsxs(Fragment, { children: [
192
194
  /* @__PURE__ */ jsx(Shape, { node, theme, springs, isHovered }),
@@ -1,4 +1,4 @@
1
- export * from "./useDarkMode.js";
1
+ export * from "./usePrefersLightMode.js";
2
2
  export * from "./useDiagramApi.js";
3
3
  export * from "./useImageLoader.js";
4
4
  export * from "./useViewIdFromHash.js";
@@ -0,0 +1,5 @@
1
+ import { useMediaQuery } from "@react-hookz/web/esm";
2
+ const COLOR_SCHEME_QUERY = "(prefers-color-scheme: light)";
3
+ export function usePrefersLightMode() {
4
+ return useMediaQuery(COLOR_SCHEME_QUERY);
5
+ }