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
package/react/index.d.mts CHANGED
@@ -1240,6 +1240,33 @@ export declare class DiagramApi<A extends Any_3 = Unknown_2> {
1240
1240
  toggleSequenceFlow(flowId: t.StepPath): void;
1241
1241
  }
1242
1242
 
1243
+ /**
1244
+ * Manual-layout actions exposed by {@link useDiagramCompareLayout}.
1245
+ */
1246
+ export declare type DiagramCompareLayoutOps = {
1247
+ /**
1248
+ * Toggles the compare mode on or off.
1249
+ */
1250
+ toggleCompare: (force?: 'on' | 'off') => void;
1251
+ /**
1252
+ * Switches the layout type between 'auto' and 'manual'.
1253
+ */
1254
+ switchLayout: (layoutType: t.LayoutType) => void;
1255
+ /**
1256
+ * Merges the latest layout into the manual layout.
1257
+ */
1258
+ applyLatestToManual: () => void;
1259
+ /**
1260
+ * Resets the manual layout to its default state.
1261
+ */
1262
+ resetManualLayout: () => void;
1263
+ };
1264
+
1265
+ /**
1266
+ * Current manual-layout comparison state exposed by {@link useDiagramCompareLayout}.
1267
+ */
1268
+ export declare type DiagramCompareLayoutState = ReturnType<typeof selectCompareLayoutState>;
1269
+
1243
1270
  export declare function DiagramContext({ input }: {
1244
1271
  input: Input_4;
1245
1272
  }): DiagramContext;
@@ -1835,6 +1862,7 @@ declare namespace EditorCalls {
1835
1862
  type Output = {
1836
1863
  requested: t.ViewChange[];
1837
1864
  applied: t.ViewChange[];
1865
+ waitForViewSync: boolean;
1838
1866
  };
1839
1867
  }
1840
1868
  }
@@ -3044,8 +3072,27 @@ export declare interface LikeC4EditorCallbacks {
3044
3072
  fetchView(viewId: t.ViewId, layout?: t.LayoutType): t.LayoutedView | Promise<t.LayoutedView>;
3045
3073
  /**
3046
3074
  * Callback invoked when the view changes.
3075
+ *
3076
+ * Return `{ waitForViewSync: false }` when the integration applies the
3077
+ * change locally and will not publish a refreshed view. When changes are
3078
+ * batched, the editor waits if any callback invocation expects a refresh.
3079
+ */
3080
+ handleChange(viewId: t.ViewId, change: t.ViewChange): void | LikeC4EditorChangeResult | Promise<void | LikeC4EditorChangeResult>;
3081
+ }
3082
+
3083
+ /**
3084
+ * Result of applying a change from the LikeC4 Editor.
3085
+ */
3086
+ export declare interface LikeC4EditorChangeResult {
3087
+ /**
3088
+ * Whether applying the change will publish a refreshed view to the diagram
3089
+ * that the editor should wait for.
3090
+ *
3091
+ * Returning no result from `handleChange` defaults this to `true`,
3092
+ * preserving the existing behavior for integrations that persist changes
3093
+ * through an external model service.
3047
3094
  */
3048
- handleChange(viewId: t.ViewId, change: t.ViewChange): void | Promise<void>;
3095
+ waitForViewSync: boolean;
3049
3096
  }
3050
3097
 
3051
3098
  /**
@@ -4173,6 +4220,24 @@ selector: (snapshot: A) => B,
4173
4220
  compare: (a: B, b: B) => boolean
4174
4221
  ];
4175
4222
 
4223
+ declare const selectCompareLayoutState: ({ context }: DiagramActorSnapshot) => {
4224
+ isEnabled: false;
4225
+ hasEditor: false;
4226
+ isEditable: false;
4227
+ isActive: false;
4228
+ drifts: null;
4229
+ canApplyLatest: boolean;
4230
+ layout: t.LayoutType;
4231
+ } | {
4232
+ isEnabled: true;
4233
+ hasEditor: boolean;
4234
+ isEditable: boolean;
4235
+ isActive: boolean;
4236
+ drifts: readonly [t.LayoutedViewDriftReason, ...t.LayoutedViewDriftReason[]];
4237
+ canApplyLatest: boolean;
4238
+ layout: t.LayoutType;
4239
+ };
4240
+
4176
4241
  export declare const selectDiagramContext: <T>(select: (state: DiagramContext) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => SelectAndCompare< MachineSnapshot<DiagramContext, DiagramEvents, {
4177
4242
  overlays: OverlaysActorRef | undefined;
4178
4243
  search: SearchActorRef | undefined;
@@ -5038,6 +5103,16 @@ export declare function useDiagram(): DiagramApi;
5038
5103
 
5039
5104
  export declare const useDiagramActorRef: () => DiagramActorRef;
5040
5105
 
5106
+ /**
5107
+ * Controls LikeC4's manual-layout comparison from custom diagram children.
5108
+ *
5109
+ * The hook must be called by a component rendered inside {@link LikeC4Diagram}.
5110
+ */
5111
+ export declare function useDiagramCompareLayout(): [
5112
+ DiagramCompareLayoutState,
5113
+ DiagramCompareLayoutOps
5114
+ ];
5115
+
5041
5116
  /**
5042
5117
  * Read diagram context
5043
5118
  * @deprecated use {@link useDiagramSelector}