likec4 1.59.2 → 1.59.3

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 (58) hide show
  1. package/__app__/src/chunks/AIChat.mjs +21 -26
  2. package/__app__/src/chunks/LikeC4Styles.mjs +257 -263
  3. package/__app__/src/chunks/ProjectsOverview.mjs +58 -58
  4. package/__app__/src/chunks/hooks.mjs +106 -80
  5. package/__app__/src/chunks/libs/@floating-ui.mjs +646 -332
  6. package/__app__/src/chunks/libs/@mantine.mjs +1911 -1734
  7. package/__app__/src/chunks/libs/@tanstack-ai.mjs +26 -26
  8. package/__app__/src/chunks/libs/@tanstack.mjs +42 -41
  9. package/__app__/src/chunks/libs/@xstate/react.mjs +59 -40
  10. package/__app__/src/chunks/libs/@xyflow/react.mjs +532 -445
  11. package/__app__/src/chunks/libs/bezier-js.mjs +10 -9
  12. package/__app__/src/chunks/libs/d3.mjs +16 -36
  13. package/__app__/src/chunks/libs/fast-equals.mjs +1 -1
  14. package/__app__/src/chunks/libs/framer.mjs +294 -273
  15. package/__app__/src/chunks/libs/zod.mjs +17 -14
  16. package/__app__/src/chunks/rolldown-runtime.mjs +2 -2
  17. package/__app__/src/chunks/styled-system.mjs +9 -15
  18. package/__app__/src/main.mjs +15994 -15936
  19. package/__app__/src/style.css +1 -1
  20. package/config/schema.json +35 -0
  21. package/dist/app/render-view-client.css +1 -0
  22. package/dist/app/render-view-client.js +745 -0
  23. package/dist/chunks/enableServer.mjs +1 -1
  24. package/dist/chunks/filenames.mjs +7 -6
  25. package/dist/chunks/index.d.mts +11 -0
  26. package/dist/chunks/index2.d.mts +41 -5
  27. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  28. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +5 -5
  29. package/dist/chunks/libs/@logtape/logtape.mjs +1 -1
  30. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  31. package/dist/chunks/libs/birpc.mjs +1 -1
  32. package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
  33. package/dist/chunks/libs/chevrotain.mjs +16 -16
  34. package/dist/chunks/libs/json5.mjs +3 -3
  35. package/dist/chunks/libs/langium.mjs +11 -11
  36. package/dist/chunks/libs/merge-error-cause.mjs +2 -2
  37. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  38. package/dist/chunks/libs/pako.mjs +1 -1
  39. package/dist/chunks/libs/picomatch.mjs +1 -1
  40. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  41. package/dist/chunks/libs/remeda.mjs +1 -1
  42. package/dist/chunks/libs/zod.mjs +4 -4
  43. package/dist/chunks/node.mjs +69 -57
  44. package/dist/chunks/rolldown-runtime.mjs +1 -1
  45. package/dist/chunks/sequence-view.mjs +1 -1
  46. package/dist/chunks/vite-plugin.mjs +161 -50
  47. package/dist/cli/index.mjs +272 -162
  48. package/dist/config/index.d.mts +7 -1
  49. package/dist/config/index.mjs +1 -1
  50. package/dist/index.mjs +1 -1
  51. package/dist/vite-plugin/internal/index.d.mts +64 -27
  52. package/dist/vite-plugin/internal/index.mjs +65 -29
  53. package/package.json +39 -39
  54. package/react/index.d.mts +76 -1
  55. package/react/index.mjs +7302 -6778
  56. package/vite-plugin-modules.d.ts +18 -0
  57. package/dist/chunks/dist.mjs +0 -10
  58. package/dist/chunks/logger.mjs +0 -1
@@ -1,6 +1,6 @@
1
1
  import "./rolldown-runtime.mjs";
2
2
  import { D as e, j as t } from "./hooks.mjs";
3
- import { B as n, D as r, F as i, H as a, M as o, N as s, U as c, W as l, a as u, c as d, d as f, f as p, l as m, m as h, n as g, o as _, ot as v, p as y, q as b, s as x, t as S, u as C, ut as w, vt as T, x as E } from "./LikeC4Styles.mjs";
3
+ import { A as n, D as r, F as i, H as a, L as o, O as s, R as c, a as l, at as u, c as d, d as f, f as p, h as m, l as h, m as g, n as _, o as v, p as y, pt as b, s as x, t as S, tt as C, u as w, x as T, z as E } from "./LikeC4Styles.mjs";
4
4
  import { on as ee } from "./libs/@mantine.mjs";
5
5
  import { M as te } from "./styled-system.mjs";
6
6
  import { C as ne, c as re, d as ie, g as ae, u as oe } from "./libs/@xyflow/react.mjs";
@@ -110,12 +110,12 @@ var Y = "likec4:projects-overview:lastViewport", X = {
110
110
  case "xyflow.mouse.enter.edge":
111
111
  case "xyflow.mouse.leave.edge": {
112
112
  let r = t.edge.id;
113
- return { xyedges: e.xyedges.map((e) => e.id === r ? l.setHovered(e, n) : e) };
113
+ return { xyedges: e.xyedges.map((e) => e.id === r ? E.setHovered(e, n) : e) };
114
114
  }
115
115
  case "xyflow.mouse.enter.node":
116
116
  case "xyflow.mouse.leave.node": {
117
117
  let r = t.node.id;
118
- return { xynodes: e.xynodes.map((e) => e.id === r ? l.setHovered(e, n) : e) };
118
+ return { xynodes: e.xynodes.map((e) => e.id === r ? E.setHovered(e, n) : e) };
119
119
  }
120
120
  default: ce(t);
121
121
  }
@@ -130,7 +130,7 @@ var Y = "likec4:projects-overview:lastViewport", X = {
130
130
  }), fitDiagram = (e) => Z.enqueueActions(({ context: t, event: n }) => {
131
131
  let r = t.view.bounds, i;
132
132
  e ? (r = e.bounds ?? t.view.bounds, i = e.duration) : n.type === "xyflow.fitDiagram" && (r = n.bounds ?? t.view.bounds, i = n.duration), i ??= 450;
133
- let { width: o, height: s, panZoom: c, transform: l } = J(t.xystore).getState(), u = Math.max(1, l[2]), d = ne(r, o, s, a, u, t.fitViewPadding);
133
+ let { width: a, height: s, panZoom: c, transform: l } = J(t.xystore).getState(), u = Math.max(1, l[2]), d = ne(r, a, s, o, u, t.fitViewPadding);
134
134
  d.x = Math.round(d.x), d.y = Math.round(d.y);
135
135
  let f = i > 0 ? {
136
136
  duration: i,
@@ -234,19 +234,19 @@ var Y = "likec4:projects-overview:lastViewport", X = {
234
234
  I({ xyedges: [] }),
235
235
  ({ context: { navigateTo: e, xyflow: t, xystore: n }, self: r }) => {
236
236
  se(t && e, "Invalid state, xyflow is undefined");
237
- let { width: i, domNode: o } = J(n).getState(), s = T(Math.min(i * 7 / 9 / e.data.width), {
238
- min: a,
237
+ let { width: i, domNode: a } = J(n).getState(), s = b(Math.min(i * 7 / 9 / e.data.width), {
238
+ min: o,
239
239
  max: 2.5
240
240
  }), c = {
241
241
  x: Math.round(-s * e.position.x + (i - s * e.data.width) / 2),
242
242
  y: Math.round(-s * e.position.y) + 50
243
- }, l = t.getViewport(), u = o.querySelectorAll(`.react-flow__node-project:not([data-id="${e.id}"]) > *`), d = A(u, {
243
+ }, l = t.getViewport(), u = a.querySelectorAll(`.react-flow__node-project:not([data-id="${e.id}"]) > *`), d = A(u, {
244
244
  opacity: 0,
245
245
  scale: .9
246
246
  }, {
247
247
  visualDuration: .25,
248
248
  delay: O(.08, { from: "center" })
249
- }), f = N(1), p = k(f, [1, 0], [`translate(${l.x}px, ${l.y}px) scale(${l.zoom})`, `translate(${c.x}px, ${c.y}px) scale(${s})`]), m = M(o.querySelector(".xyflow__viewport"), { transform: p }), h = M(o.querySelector(`.react-flow__node-project:is([data-id="${e.id}"]) > *`), { opacity: f }), g = A(f, 0, {
249
+ }), f = N(1), p = k(f, [1, 0], [`translate(${l.x}px, ${l.y}px) scale(${l.zoom})`, `translate(${c.x}px, ${c.y}px) scale(${s})`]), m = M(a.querySelector(".xyflow__viewport"), { transform: p }), h = M(a.querySelector(`.react-flow__node-project:is([data-id="${e.id}"]) > *`), { opacity: f }), g = A(f, 0, {
250
250
  delay: u.length > 3 ? .25 : 0,
251
251
  type: "spring",
252
252
  stiffness: 350,
@@ -288,10 +288,10 @@ function useProjectsOverviewActor() {
288
288
  //#region ../diagram/src/projects-overview/panel/ProjectsOverviewPanel.tsx
289
289
  var ProjectsOverviewPanel = () => {
290
290
  let e = G(1), t;
291
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K(g.Root, { children: /* @__PURE__ */ q(g.Body, { children: [/* @__PURE__ */ K(g.Logo, {}), /* @__PURE__ */ K(g.Label, { children: "Projects Overview" })] }) }), e[0] = t) : t = e[0], t;
292
- }, fe = _((e) => {
293
- let t = b(e.data.points);
294
- return /* @__PURE__ */ q(h, {
291
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K(_.Root, { children: /* @__PURE__ */ q(_.Body, { children: [/* @__PURE__ */ K(_.Logo, {}), /* @__PURE__ */ K(_.Label, { children: "Projects Overview" })] }) }), e[0] = t) : t = e[0], t;
292
+ }, fe = v((e) => {
293
+ let t = a(e.data.points);
294
+ return /* @__PURE__ */ q(g, {
295
295
  ...e,
296
296
  children: [/* @__PURE__ */ K(f, {
297
297
  edgeProps: e,
@@ -314,9 +314,9 @@ function ProjectNode(e) {
314
314
  });
315
315
  }, t[0] = n, t[1] = e.data.id, t[2] = e.data.projectId, t[3] = t0) : t0 = t[3];
316
316
  let r = ee(t0), i, a;
317
- t[4] === e ? (i = t[5], a = t[6]) : (i = /* @__PURE__ */ K(x, { ...e }), a = /* @__PURE__ */ K(m, { ...e }), t[4] = e, t[5] = i, t[6] = a);
317
+ t[4] === e ? (i = t[5], a = t[6]) : (i = /* @__PURE__ */ K(x, { ...e }), a = /* @__PURE__ */ K(h, { ...e }), t[4] = e, t[5] = i, t[6] = a);
318
318
  let o;
319
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ K(w, {}), t[7] = o) : o = t[7];
319
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ K(u, {}), t[7] = o) : o = t[7];
320
320
  let s;
321
321
  t[8] === r ? s = t[9] : (s = [{
322
322
  key: "navigate",
@@ -324,29 +324,29 @@ function ProjectNode(e) {
324
324
  onClick: r
325
325
  }], t[8] = r, t[9] = s);
326
326
  let c;
327
- t[10] !== e || t[11] !== s ? (c = /* @__PURE__ */ K(C, {
327
+ t[10] !== e || t[11] !== s ? (c = /* @__PURE__ */ K(w, {
328
328
  ...e,
329
329
  buttons: s
330
330
  }), t[10] = e, t[11] = s, t[12] = c) : c = t[12];
331
- let l;
332
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ K(u, {}), t[13] = l) : l = t[13];
333
331
  let f;
334
- return t[14] !== e || t[15] !== i || t[16] !== a || t[17] !== c ? (f = /* @__PURE__ */ q(d, {
332
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ K(l, {}), t[13] = f) : f = t[13];
333
+ let p;
334
+ return t[14] !== e || t[15] !== i || t[16] !== a || t[17] !== c ? (p = /* @__PURE__ */ q(d, {
335
335
  layout: !0,
336
336
  nodeProps: e,
337
337
  children: [
338
338
  i,
339
339
  a,
340
340
  c,
341
- l
341
+ f
342
342
  ]
343
- }, e.id), t[14] = e, t[15] = i, t[16] = a, t[17] = c, t[18] = f) : f = t[18], f;
343
+ }, e.id), t[14] = e, t[15] = i, t[16] = a, t[17] = c, t[18] = p) : p = t[18], p;
344
344
  }
345
345
  //#endregion
346
346
  //#region ../diagram/src/projects-overview/hooks.ts
347
347
  function useProjectsOverviewState(e, t) {
348
- let n = t === void 0 ? D : t;
349
- return L(useProjectsOverviewActor(), e, n);
348
+ let n = t === void 0 ? D : t, r = useProjectsOverviewActor();
349
+ return L(r, e, n);
350
350
  }
351
351
  function useProjectsOverviewXYStoreApi() {
352
352
  return ae();
@@ -358,9 +358,9 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
358
358
  nodes: e.context.xynodes,
359
359
  edges: e.context.xyedges
360
360
  }), selectorEq = (e, t) => e.isActive === t.isActive && D(e.nodes, t.nodes) && D(e.edges, t.edges), $ = V((e) => {
361
- let t = G(45), r, i;
362
- t[0] === e ? (r = t[1], i = t[2]) : ({background: i, ...r} = e, t[0] = e, t[1] = r, t[2] = i);
363
- let a = i === void 0 ? "dots" : i, o = useProjectsOverviewActor(), { isActive: s, nodes: c, edges: l } = useProjectsOverviewState(selector, selectorEq), u = useProjectsOverviewXYStoreApi(), d = s ? "initialized" : "not-initialized", f;
361
+ let t = G(45), n, r;
362
+ t[0] === e ? (n = t[1], r = t[2]) : ({background: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
363
+ let a = r === void 0 ? "dots" : r, o = useProjectsOverviewActor(), { isActive: s, nodes: c, edges: l } = useProjectsOverviewState(selector, selectorEq), u = useProjectsOverviewXYStoreApi(), d = s ? "initialized" : "not-initialized", f;
364
364
  t[3] === d ? f = t[4] : (f = te(d, "projects-overview"), t[3] = d, t[4] = f);
365
365
  let t4;
366
366
  t[5] === o ? t4 = t[6] : (t4 = (e, t) => {
@@ -369,36 +369,36 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
369
369
  node: t
370
370
  });
371
371
  }, t[5] = o, t[6] = t4);
372
- let p = v(t4), t6;
372
+ let p = C(t4), t6;
373
373
  t[7] === o ? t6 = t[8] : (t6 = (e, t) => {
374
374
  e.stopPropagation(), o.send({
375
375
  type: "xyflow.click.edge",
376
376
  edge: t
377
377
  });
378
378
  }, t[7] = o, t[8] = t6);
379
- let m = v(t6), t8;
379
+ let m = C(t6), t8;
380
380
  t[9] === o ? t8 = t[10] : (t8 = (e) => {
381
381
  e.stopPropagation(), o.send({ type: "xyflow.click.pane" });
382
382
  }, t[9] = o, t[10] = t8);
383
- let h = v(t8), t10;
383
+ let h = C(t8), t10;
384
384
  t[11] === o ? t10 = t[12] : (t10 = (e) => {
385
385
  e.stopPropagation(), o.send({ type: "xyflow.click.double" });
386
386
  }, t[11] = o, t[12] = t10);
387
- let g = v(t10), t12;
387
+ let g = C(t10), t12;
388
388
  t[13] === o ? t12 = t[14] : (t12 = (e) => {
389
389
  o.send({
390
390
  type: "xyflow.applyNodeChanges",
391
391
  changes: e
392
392
  });
393
393
  }, t[13] = o, t[14] = t12);
394
- let _ = v(t12), t14;
394
+ let _ = C(t12), t14;
395
395
  t[15] === o ? t14 = t[16] : (t14 = (e) => {
396
396
  o.send({
397
397
  type: "xyflow.applyEdgeChanges",
398
398
  changes: e
399
399
  });
400
400
  }, t[15] = o, t[16] = t14);
401
- let y = v(t14), t16;
401
+ let v = C(t14), t16;
402
402
  t[17] === o ? t16 = t[18] : (t16 = (e, t) => {
403
403
  o.send({
404
404
  type: "xyflow.mouse.enter.edge",
@@ -406,7 +406,7 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
406
406
  event: e
407
407
  });
408
408
  }, t[17] = o, t[18] = t16);
409
- let b = v(t16), t18;
409
+ let y = C(t16), t18;
410
410
  t[19] === o ? t18 = t[20] : (t18 = (e, t) => {
411
411
  o.send({
412
412
  type: "xyflow.mouse.leave.edge",
@@ -414,21 +414,21 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
414
414
  event: e
415
415
  });
416
416
  }, t[19] = o, t[20] = t18);
417
- let x = v(t18), t20;
417
+ let b = C(t18), t20;
418
418
  t[21] === o ? t20 = t[22] : (t20 = (e, t) => {
419
419
  o.send({
420
420
  type: "xyflow.mouse.enter.node",
421
421
  node: t
422
422
  });
423
423
  }, t[21] = o, t[22] = t20);
424
- let S = v(t20), t22;
424
+ let x = C(t20), t22;
425
425
  t[23] === o ? t22 = t[24] : (t22 = (e, t) => {
426
426
  o.send({
427
427
  type: "xyflow.mouse.leave.node",
428
428
  node: t
429
429
  });
430
430
  }, t[23] = o, t[24] = t22);
431
- let C = v(t22), t24;
431
+ let S = C(t22), t24;
432
432
  t[25] !== o || t[26] !== u ? (t24 = (e) => {
433
433
  o.send({
434
434
  type: "xyflow.init",
@@ -436,8 +436,8 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
436
436
  xystore: u
437
437
  });
438
438
  }, t[25] = o, t[26] = u, t[27] = t24) : t24 = t[27];
439
- let w = v(t24), T;
440
- return t[28] !== a || t[29] !== l || t[30] !== c || t[31] !== r || t[32] !== g || t[33] !== _ || t[34] !== y || t[35] !== b || t[36] !== x || t[37] !== S || t[38] !== C || t[39] !== w || t[40] !== f || t[41] !== p || t[42] !== m || t[43] !== h ? (T = /* @__PURE__ */ K(n, {
439
+ let w = C(t24), T;
440
+ return t[28] !== a || t[29] !== l || t[30] !== c || t[31] !== n || t[32] !== g || t[33] !== _ || t[34] !== v || t[35] !== y || t[36] !== b || t[37] !== x || t[38] !== S || t[39] !== w || t[40] !== f || t[41] !== p || t[42] !== m || t[43] !== h ? (T = /* @__PURE__ */ K(i, {
441
441
  nodes: c,
442
442
  edges: l,
443
443
  className: f,
@@ -449,19 +449,19 @@ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) =>
449
449
  onPaneClick: h,
450
450
  onDoubleClick: g,
451
451
  onNodesChange: _,
452
- onEdgesChange: y,
453
- onEdgeMouseEnter: b,
454
- onEdgeMouseLeave: x,
455
- onNodeMouseEnter: S,
456
- onNodeMouseLeave: C,
452
+ onEdgesChange: v,
453
+ onEdgeMouseEnter: y,
454
+ onEdgeMouseLeave: b,
455
+ onNodeMouseEnter: x,
456
+ onNodeMouseLeave: S,
457
457
  onInit: w,
458
458
  nodesDraggable: !1,
459
459
  nodesSelectable: !0,
460
460
  pannable: !0,
461
461
  zoomable: !0,
462
462
  background: a,
463
- ...r
464
- }), t[28] = a, t[29] = l, t[30] = c, t[31] = r, t[32] = g, t[33] = _, t[34] = y, t[35] = b, t[36] = x, t[37] = S, t[38] = C, t[39] = w, t[40] = f, t[41] = p, t[42] = m, t[43] = h, t[44] = T) : T = t[44], T;
463
+ ...n
464
+ }), t[28] = a, t[29] = l, t[30] = c, t[31] = n, t[32] = g, t[33] = _, t[34] = v, t[35] = y, t[36] = b, t[37] = x, t[38] = S, t[39] = w, t[40] = f, t[41] = p, t[42] = m, t[43] = h, t[44] = T) : T = t[44], T;
465
465
  });
466
466
  $.displayName = "ProjectsOverviewXY";
467
467
  //#endregion
@@ -491,17 +491,17 @@ function ProjectsOverview({ view: t, onNavigateToProject: n, fitViewPadding: r =
491
491
  e.forEach((e) => e.unsubscribe());
492
492
  };
493
493
  }, [a]);
494
- let s = t.bounds;
494
+ let s = t.bounds, c = W({
495
+ initialNodes: [],
496
+ initialEdges: [],
497
+ initialWidth: s.width,
498
+ initialHeight: s.height,
499
+ fitView: !1
500
+ });
495
501
  return /* @__PURE__ */ K(de, {
496
502
  value: a,
497
503
  children: /* @__PURE__ */ q(re, {
498
- ...W({
499
- initialNodes: [],
500
- initialEdges: [],
501
- initialWidth: s.width,
502
- initialHeight: s.height,
503
- fitView: !1
504
- }).current,
504
+ ...c.current,
505
505
  children: [/* @__PURE__ */ K(j, {
506
506
  id: a.sessionId,
507
507
  inherit: !1,
@@ -512,14 +512,14 @@ function ProjectsOverview({ view: t, onNavigateToProject: n, fitViewPadding: r =
512
512
  }
513
513
  //#endregion
514
514
  //#region ../diagram/src/LikeC4ProjectsOverview.tsx
515
- function LikeC4ProjectsOverview({ view: e, className: t, onNavigateToProject: n, ...a }) {
516
- let c = E(), l = r();
517
- return n ??= c, /* @__PURE__ */ K(s, { children: /* @__PURE__ */ q(o, { children: [/* @__PURE__ */ K(S, { id: l }), /* @__PURE__ */ K(i, {
518
- id: l,
515
+ function LikeC4ProjectsOverview({ view: e, className: t, onNavigateToProject: i, ...a }) {
516
+ let o = m(), c = T();
517
+ return i ??= o, /* @__PURE__ */ K(s, { children: /* @__PURE__ */ q(r, { children: [/* @__PURE__ */ K(S, { id: c }), /* @__PURE__ */ K(n, {
518
+ id: c,
519
519
  className: t,
520
520
  children: /* @__PURE__ */ K(ProjectsOverview, {
521
521
  view: e,
522
- onNavigateToProject: n,
522
+ onNavigateToProject: i,
523
523
  ...a
524
524
  })
525
525
  })] }) });
@@ -527,7 +527,7 @@ function LikeC4ProjectsOverview({ view: e, className: t, onNavigateToProject: n,
527
527
  //#endregion
528
528
  //#region src/pages/ProjectsOverview.tsx
529
529
  function ProjectsOverviewPage() {
530
- let e = G(3), t = E(), n = le(), r;
530
+ let e = G(3), t = m(), n = le(), r;
531
531
  return e[0] !== t || e[1] !== n ? (r = /* @__PURE__ */ K(LikeC4ProjectsOverview, {
532
532
  view: n,
533
533
  onNavigateToProject: t