likec4 1.59.1 → 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 +12 -11
  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 +47 -7
  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 +76 -39
  53. package/package.json +41 -41
  54. package/react/index.d.mts +76 -1
  55. package/react/index.mjs +7310 -6785
  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,2 +1,8 @@
1
+ import { i as __name } from "../chunks/rolldown-runtime.mjs";
1
2
  import { _ as isLikeC4JsonConfig, a as LikeC4ProjectConfig, c as LikeC4ProjectJsonConfig, d as defineConfig, f as defineGenerators, g as isLikeC4Config, h as defineThemeColor, l as LikeC4StylesConfig, m as defineTheme, n as GeneratorFnContext, o as LikeC4ProjectConfigInput, p as defineStyle, r as GeneratorFnParams, s as LikeC4ProjectConfigOps, t as GeneratorFn, u as LikeC4StylesConfigInput, v as isLikeC4NonJsonConfig } from "../chunks/index.mjs";
2
- export { type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
3
+ //#region ../config/dist/chunks/webapp-export-formats.d.mts
4
+ //#region src/webapp-export-formats.d.ts
5
+ declare const WebappExportFormats: readonly ["png", "jpg", "dot", "d2", "mmd", "puml", "drawio"];
6
+ type WebappExportFormat = typeof WebappExportFormats[number];
7
+ //#endregion
8
+ export { type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type WebappExportFormat, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
@@ -1 +1 @@
1
- import"../chunks/rolldown-runtime.mjs";import{a as e,d as t,i as n,l as r,n as i,o as a,r as o,t as s,u as c}from"../chunks/filenames.mjs";function defineConfig(e){return a.parse(e)}function defineGenerators(e){return n.parse(e)}function defineThemeColor(e){return t.parse(e)}function defineTheme(e){return r.parse(e)}function defineStyle(e){return c.parse(e)}export{e as LikeC4ProjectConfigOps,defineConfig,defineGenerators,defineStyle,defineTheme,defineThemeColor,s as isLikeC4Config,i as isLikeC4JsonConfig,o as isLikeC4NonJsonConfig};
1
+ import"../chunks/rolldown-runtime.mjs";import{a as e,d as t,f as n,i as r,n as i,o as a,r as o,t as s,u as c}from"../chunks/filenames.mjs";function defineConfig(e){return a.parse(e)}function defineGenerators(e){return r.parse(e)}function defineThemeColor(e){return n.parse(e)}function defineTheme(e){return c.parse(e)}function defineStyle(e){return t.parse(e)}export{e as LikeC4ProjectConfigOps,defineConfig,defineGenerators,defineStyle,defineTheme,defineThemeColor,s as isLikeC4Config,i as isLikeC4JsonConfig,o as isLikeC4NonJsonConfig};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{i as e}from"./chunks/rolldown-runtime.mjs";import{n as t}from"./chunks/sequence-view.mjs";import{n,r,t as i}from"./chunks/node.mjs";import{exact as a}from"@likec4/core";let o;(function(r){async function fromSource$1(e,n){let{logger:r,watch:o,...s}=n??{};return i(e,t(a({...s,configureLogger:r}),{configureLogger:`console`}))}e(fromSource$1,`fromSource`),r.fromSource=fromSource$1;async function fromWorkspace$1(e=``,r){let{logger:i,watch:o,...s}=r??{};return n(e,t(a({...s,configureLogger:i}),{configureLogger:`console`}))}e(fromWorkspace$1,`fromWorkspace`),r.fromWorkspace=fromWorkspace$1})(o||={});export{o as LikeC4,r as writeDSL};
1
+ import{i as e}from"./chunks/rolldown-runtime.mjs";import{i as t,r as n,t as r}from"./chunks/node.mjs";import{n as i}from"./chunks/sequence-view.mjs";import{exact as a}from"@likec4/core";let o;(function(t){async function fromSource$1(e,t){let{logger:n,watch:o,...s}=t??{};return r(e,i(a({...s,configureLogger:n}),{configureLogger:`console`}))}e(fromSource$1,`fromSource`),t.fromSource=fromSource$1;async function fromWorkspace$1(e=``,t){let{logger:r,watch:o,...s}=t??{};return n(e,i(a({...s,configureLogger:r}),{configureLogger:`console`}))}e(fromWorkspace$1,`fromWorkspace`),t.fromWorkspace=fromWorkspace$1})(o||={});export{o as LikeC4,t as writeDSL};
@@ -3,7 +3,7 @@ import { DependencyList } from "react";
3
3
  import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
4
4
  import { AdhocViewPredicate } from "@likec4/core/compute-view";
5
5
  //#region ../vite-plugin/dist/internal/index.d.mts
6
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/atom/index.d.ts
6
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/atom/index.d.ts
7
7
  type AllKeys<T> = T extends any ? keyof T : never;
8
8
  type Primitive = boolean | number | string;
9
9
  type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
@@ -11,6 +11,23 @@ type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends (
11
11
  * Store object.
12
12
  */
13
13
  interface ReadableAtom<Value = any> {
14
+ /**
15
+ * Compares the previous and next values on every `set`.
16
+ *
17
+ * Returning `true` means the values are the same, so the store keeps the old
18
+ * value and no listener is called.
19
+ *
20
+ * @remarks
21
+ * Called only by the store's own writes, so a store that never writes never
22
+ * calls it. `Map#setKey` uses {@link MapStore#eqKey} instead.
23
+ *
24
+ * Before the first write, `oldValue` can be `undefined`, for instance on the
25
+ * first run of a computed store.
26
+ *
27
+ * @default Object.is
28
+ * @returns `true` if the values are equal, `false` otherwise.
29
+ */
30
+ eq(oldValue: ReadonlyIfObject<Value> | undefined, newValue: ReadonlyIfObject<Value>): boolean;
14
31
  /**
15
32
  * Get store value.
16
33
  *
@@ -41,7 +58,7 @@ interface ReadableAtom<Value = any> {
41
58
  * @param listener Callback with store value and old value.
42
59
  * @returns Function to remove listener.
43
60
  */
44
- listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value>) => void): () => void;
61
+ listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined) => void): () => void;
45
62
  /**
46
63
  * Low-level method to notify listeners about changes in the store.
47
64
  *
@@ -126,21 +143,36 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
126
143
  */
127
144
  declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
128
145
  //#endregion
129
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/map/index.d.ts
146
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/map/index.d.ts
130
147
  type KeyofBase = keyof any;
131
- type Get<T, K extends KeyofBase> = Extract<T, { [K1 in K]: any; }>[K];
148
+ type Get<T, K extends KeyofBase> = T extends any ? K extends keyof T ? T[K] : never : never;
132
149
  type HasIndexSignature<T> = string extends keyof T ? true : false;
133
- type ValueWithUndefinedForIndexSignatures<Value, Key extends keyof Value> = HasIndexSignature<Value> extends true ? undefined | Value[Key] : Value[Key];
150
+ type ValueWithUndefinedForIndexSignatures<Value, Key extends KeyofBase> = Value extends any ? HasIndexSignature<Value> extends true ? undefined | Get<Value, Key> : Get<Value, Key> : never;
134
151
  type WritableStore<Value = any> = (Value extends object ? MapStore<Value> : never) | WritableAtom<Value>;
135
152
  type Store<Value = any> = ReadableAtom<Value> | WritableStore<Value>;
136
- type AnyStore<Value = any> = {
153
+ type Gettable<Value = any> = {
137
154
  get(): Value;
138
- readonly value: undefined | Value;
139
155
  };
140
- type StoreValue<SomeStore> = SomeStore extends {
141
- get(): infer Value;
142
- } ? Value : any;
156
+ type StoreValue<SomeStore> = SomeStore extends Gettable<infer Value> ? Value : any;
143
157
  interface MapStore<Value extends object = any> extends WritableAtom<Value> {
158
+ /**
159
+ * Compares the previous and next values for a key on `setKey`.
160
+ *
161
+ * Returning `true` means the values are the same, so the store keeps the old
162
+ * value and no listener is called.
163
+ *
164
+ * One function serves every key of the map, so the key name comes as the
165
+ * third argument. The old value is `undefined` when the key is not in the map
166
+ * yet.
167
+ *
168
+ * @remarks
169
+ * Deleting an existing key skips the comparison and notifies either way.
170
+ * Whole-value writes use {@link ReadableAtom#eq} instead.
171
+ *
172
+ * @default Object.is
173
+ * @returns `true` if the values are equal, `false` otherwise.
174
+ */
175
+ eqKey<Key extends AllKeys<Value>>(oldValue: Get<Value, Key> | undefined, newValue: Get<Value, Key> | undefined, key: Key): boolean;
144
176
  /**
145
177
  * Subscribe to store changes.
146
178
  *
@@ -148,11 +180,10 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
148
180
  * immediately.
149
181
  *
150
182
  * @param listener Callback with store value and old value.
151
- * @param changedKey Key that was changed. Will present only if `setKey`
152
- * has been used to change a store.
183
+ * @param changedKey Key that changed, when the notification carries one.
153
184
  * @returns Function to remove listener.
154
185
  */
155
- listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value>, changedKey: AllKeys<Value>) => void): () => void;
186
+ listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined, changedKey: AllKeys<Value> | undefined) => void): () => void;
156
187
  /**
157
188
  * Low-level method to notify listeners about changes in the store.
158
189
  *
@@ -189,7 +220,7 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
189
220
  * @param key The key name.
190
221
  * @param value New value.
191
222
  */
192
- setKey<Key extends AllKeys<Value>>(key: Key, value: Get<Value, Key> | ValueWithUndefinedForIndexSignatures<Value, Key>): void;
223
+ setKey<Key extends AllKeys<Value>>(key: Key, value: ValueWithUndefinedForIndexSignatures<Value, Key>): void;
193
224
  /**
194
225
  * Subscribe to store changes and call listener immediately.
195
226
  *
@@ -202,8 +233,7 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
202
233
  * ```
203
234
  *
204
235
  * @param listener Callback with store value and old value.
205
- * @param changedKey Key that was changed. Will present only
206
- * if `setKey` has been used to change a store.
236
+ * @param changedKey Key that changed, when the notification carries one.
207
237
  * @returns Function to remove listener.
208
238
  */
209
239
  subscribe(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined, changedKey: AllKeys<Value> | undefined) => void): () => void;
@@ -212,21 +242,28 @@ interface PreinitializedMapStore<Value extends object = any> extends MapStore<Va
212
242
  readonly value: Value;
213
243
  }
214
244
  /**
215
- * Create map store. Map store is a store with key-value object
216
- * as a store value.
245
+ * Create map store with an initial value. Map store is a store with
246
+ * key-value object as a store value.
247
+ *
248
+ * @param value Initial store value.
249
+ * @returns The store object with methods to subscribe.
250
+ */
251
+ declare function map<Value extends object, StoreExt extends object = object>(value: Value): PreinitializedMapStore<Value> & StoreExt;
252
+ /**
253
+ * Create map store with no initial value, or one that may be missing.
217
254
  *
218
- * @param init Initialize store and return store destructor.
255
+ * @param value Initial store value, if there is one.
219
256
  * @returns The store object with methods to subscribe.
220
257
  */
221
- declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Value> & StoreExt;
258
+ declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Partial<Value>> & StoreExt;
222
259
  //#endregion
223
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/task/index.d.ts
260
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/task/index.d.ts
224
261
  interface Task<Value> extends Promise<Value> {
225
262
  t: true;
226
263
  }
227
264
  //#endregion
228
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/computed/index.d.ts
229
- type StoreValues<Stores extends AnyStore[]> = { [Index in keyof Stores]: StoreValue<Stores[Index]>; };
265
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/computed/index.d.ts
266
+ type StoreValues<Stores extends readonly Gettable[]> = { -readonly [Index in keyof Stores]: StoreValue<Stores[Index]>; };
230
267
  interface Computed {
231
268
  /**
232
269
  * @deprecated Use `@nanostores/async`.
@@ -235,7 +272,7 @@ interface Computed {
235
272
  /**
236
273
  * @deprecated Use `@nanostores/async`.
237
274
  */
238
- <Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value>): ReadableAtom<undefined | Value>;
275
+ <Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value>): ReadableAtom<undefined | Value>;
239
276
  <Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Value): ReadableAtom<Value>;
240
277
  /**
241
278
  * Create derived store, which use generates value from another stores.
@@ -252,7 +289,7 @@ interface Computed {
252
289
  *
253
290
  * Use `@nanostores/async` for async function.
254
291
  */
255
- <Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
292
+ <Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
256
293
  }
257
294
  declare const computed: Computed;
258
295
  interface Batched {
@@ -271,7 +308,7 @@ interface Batched {
271
308
  * })
272
309
  * ```
273
310
  */
274
- <Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
311
+ <Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
275
312
  }
276
313
  declare const batched: Batched;
277
314
  //#endregion
@@ -306,7 +343,7 @@ interface LikeC4VitePluginRpc {
306
343
  }): Promise<LayoutedElementView>;
307
344
  }
308
345
  //#endregion
309
- //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.3.0_react@19.2.7/node_modules/@nanostores/react/index.d.ts
346
+ //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.2_react@19.2.8/node_modules/@nanostores/react/index.d.ts
310
347
  type StoreKeys<T> = T extends {
311
348
  setKey: (k: infer K, v: any) => unknown;
312
349
  } ? K : never;
@@ -1,14 +1,26 @@
1
1
  import { LikeC4Model } from "@likec4/core/model";
2
2
  import { useCallback, useMemo, useRef, useSyncExternalStore } from "react";
3
3
 
4
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/atom/index.js
4
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/atom/index.js
5
5
  let listenerQueue = [];
6
6
  let lqIndex = 0;
7
+ let batchSeen = null;
7
8
  const QUEUE_ITEMS_PER_LISTENER = 4;
8
9
  const nanostoresGlobal = globalThis.nanostoresGlobal ||= { epoch: 0 };
10
+ let drainQueue = () => {
11
+ let thrown;
12
+ for (lqIndex = 0; lqIndex < listenerQueue.length; lqIndex += QUEUE_ITEMS_PER_LISTENER) try {
13
+ listenerQueue[lqIndex](listenerQueue[lqIndex + 1].value, listenerQueue[lqIndex + 2], listenerQueue[lqIndex + 3]);
14
+ } catch (e) {
15
+ thrown = e;
16
+ }
17
+ listenerQueue.length = 0;
18
+ if (thrown) throw thrown;
19
+ };
9
20
  const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
10
21
  let listeners = [];
11
22
  let $atom = {
23
+ eq: Object.is,
12
24
  get() {
13
25
  if (!$atom.lc) $atom.listen(() => {})();
14
26
  return $atom.value;
@@ -29,17 +41,18 @@ const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
29
41
  },
30
42
  notify(oldValue, changedKey) {
31
43
  nanostoresGlobal.epoch++;
32
- let runListenerQueue = !listenerQueue.length;
33
- for (let listener of listeners) listenerQueue.push(listener, $atom.value, oldValue, changedKey);
34
- if (runListenerQueue) {
35
- for (lqIndex = 0; lqIndex < listenerQueue.length; lqIndex += QUEUE_ITEMS_PER_LISTENER) listenerQueue[lqIndex](listenerQueue[lqIndex + 1], listenerQueue[lqIndex + 2], listenerQueue[lqIndex + 3]);
36
- listenerQueue.length = 0;
44
+ let runListenerQueue = !listenerQueue.length && !batchSeen;
45
+ for (let listener of listeners) {
46
+ if (batchSeen?.has(listener)) continue;
47
+ batchSeen?.add(listener);
48
+ listenerQueue.push(listener, $atom, oldValue, batchSeen ? void 0 : changedKey);
37
49
  }
50
+ if (runListenerQueue) drainQueue();
38
51
  },
39
52
  off() {},
40
53
  set(newValue) {
41
54
  let oldValue = $atom.value;
42
- if (oldValue !== newValue) {
55
+ if (!$atom.eq(oldValue, newValue)) {
43
56
  $atom.value = newValue;
44
57
  $atom.notify(oldValue);
45
58
  }
@@ -55,7 +68,7 @@ const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
55
68
  };
56
69
 
57
70
  //#endregion
58
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/lifecycle/index.js
71
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/lifecycle/index.js
59
72
  const MOUNT = 5;
60
73
  const UNMOUNT = 6;
61
74
  const REVERT_MUTATION = 10;
@@ -115,7 +128,7 @@ let onMount = ($store, initialize) => {
115
128
  };
116
129
 
117
130
  //#endregion
118
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/computed/index.js
131
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/computed/index.js
119
132
  let computedStore = (stores, cb, batched) => {
120
133
  if (!Array.isArray(stores)) stores = [stores];
121
134
  let previousArgs;
@@ -160,25 +173,49 @@ const computed = /* @__NO_SIDE_EFFECTS__ */ (stores, fn) => computedStore(stores
160
173
  const batched = /* @__NO_SIDE_EFFECTS__ */ (stores, fn) => computedStore(stores, fn, true);
161
174
 
162
175
  //#endregion
163
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/listen-keys/index.js
176
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/deep-map/path.js
177
+ function getPath(obj, path) {
178
+ let allKeys = getAllKeysFromPath(path);
179
+ let res = obj;
180
+ for (let key of allKeys) {
181
+ if (res == null) return;
182
+ res = res[key];
183
+ }
184
+ return res;
185
+ }
186
+ const ARRAY_INDEX = /(.*)\[(\d+)\]/;
187
+ function getAllKeysFromPath(path) {
188
+ return path.split(".").flatMap((key) => getKeyAndIndicesFromKey(key));
189
+ }
190
+ function getKeyAndIndicesFromKey(key) {
191
+ if (ARRAY_INDEX.test(key)) {
192
+ let [, keyPart, index] = key.match(ARRAY_INDEX);
193
+ return [...getKeyAndIndicesFromKey(keyPart), index];
194
+ }
195
+ return [key];
196
+ }
197
+
198
+ //#endregion
199
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/listen-keys/index.js
164
200
  function listenKeys($store, keys, listener) {
165
- let keysSet = new Set(keys).add(void 0);
201
+ let keysSet = new Set(keys);
166
202
  return $store.listen((value, oldValue, changed) => {
167
- if (keysSet.has(changed)) listener(value, oldValue, changed);
203
+ if (changed === void 0 ? keys.some((key) => oldValue === void 0 || value[key] !== oldValue[key] || getPath(value, key) !== getPath(oldValue, key)) : keysSet.has(changed) || keysSet.has(changed.split(/\.|\[/)[0])) listener(value, oldValue, changed);
168
204
  });
169
205
  }
170
206
 
171
207
  //#endregion
172
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/map/index.js
208
+ //#region ../../node_modules/.pnpm/nanostores@1.5.2/node_modules/nanostores/map/index.js
173
209
  const map = /* @__NO_SIDE_EFFECTS__ */ (initial = {}) => {
174
210
  let $map = /* @__PURE__ */ atom(initial);
211
+ $map.eqKey = Object.is;
175
212
  $map.setKey = function(key, value) {
176
213
  let oldMap = $map.value;
177
214
  if (typeof value === "undefined" && key in $map.value) {
178
215
  $map.value = { ...$map.value };
179
216
  delete $map.value[key];
180
217
  $map.notify(oldMap, key);
181
- } else if ($map.value[key] !== value) {
218
+ } else if (!$map.eqKey($map.value[key], value, key)) {
182
219
  $map.value = {
183
220
  ...$map.value,
184
221
  [key]: value
@@ -190,7 +227,7 @@ const map = /* @__NO_SIDE_EFFECTS__ */ (initial = {}) => {
190
227
  };
191
228
 
192
229
  //#endregion
193
- //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.3.0_react@19.2.7/node_modules/@nanostores/react/index.js
230
+ //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.2_react@19.2.8/node_modules/@nanostores/react/index.js
194
231
  let emit = (snapshotRef, onChange) => (value) => {
195
232
  if (snapshotRef.current === value) return;
196
233
  snapshotRef.current = value;
@@ -210,9 +247,7 @@ function useStore(store, { keys, deps = [store, keys], ssr } = {}) {
210
247
  }
211
248
 
212
249
  //#endregion
213
- //#region ../../node_modules/.pnpm/birpc@4.0.0/node_modules/birpc/dist/index.mjs
214
- const TYPE_REQUEST = "q";
215
- const TYPE_RESPONSE = "s";
250
+ //#region ../../node_modules/.pnpm/birpc@4.2.0/node_modules/birpc/dist/index.mjs
216
251
  function createPromiseWithResolvers() {
217
252
  let resolve;
218
253
  let reject;
@@ -248,7 +283,7 @@ function createBirpc($functions, options) {
248
283
  const req = {
249
284
  m: method,
250
285
  a: args,
251
- t: TYPE_REQUEST
286
+ t: "q"
252
287
  };
253
288
  if (optional) req.o = true;
254
289
  const send = async (_req) => post(serialize(_req));
@@ -302,7 +337,7 @@ function createBirpc($functions, options) {
302
337
  $call: (method, ...args) => _call(method, args, false),
303
338
  $callOptional: (method, ...args) => _call(method, args, false, true),
304
339
  $callEvent: (method, ...args) => _call(method, args, true),
305
- $callRaw: (options$1) => _call(options$1.method, options$1.args, options$1.event, options$1.optional),
340
+ $callRaw: (options) => _call(options.method, options.args, options.event, options.optional),
306
341
  $rejectPendingCalls,
307
342
  get $closed() {
308
343
  return $closed;
@@ -314,7 +349,7 @@ function createBirpc($functions, options) {
314
349
  $functions
315
350
  };
316
351
  if (proxify) rpc = new Proxy({}, { get(_, method) {
317
- if (Object.prototype.hasOwnProperty.call(builtinMethods, method)) return builtinMethods[method];
352
+ if (Object.hasOwn(builtinMethods, method)) return builtinMethods[method];
318
353
  if (method === "then" && !eventNames.includes("then") && !("then" in $functions)) return void 0;
319
354
  const sendEvent = (...args) => _call(method, args, true);
320
355
  if (eventNames.includes(method)) {
@@ -358,7 +393,7 @@ function createBirpc($functions, options) {
358
393
  if (options.onGeneralError?.call(rpc, e) !== true) throw e;
359
394
  return;
360
395
  }
361
- if (msg.t === TYPE_REQUEST) {
396
+ if (msg.t === "q") {
362
397
  const { m: method, a: args, o: optional } = msg;
363
398
  let result, error;
364
399
  let fn = await (resolver ? resolver.call(rpc, method, $functions[method]) : $functions[method]);
@@ -375,7 +410,7 @@ function createBirpc($functions, options) {
375
410
  }
376
411
  if (!error) try {
377
412
  await post(serialize({
378
- t: TYPE_RESPONSE,
413
+ t: "s",
379
414
  i: msg.i,
380
415
  r: result
381
416
  }), ...extra);
@@ -386,7 +421,7 @@ function createBirpc($functions, options) {
386
421
  }
387
422
  try {
388
423
  await post(serialize({
389
- t: TYPE_RESPONSE,
424
+ t: "s",
390
425
  i: msg.i,
391
426
  e: error
392
427
  }), ...extra);
@@ -410,7 +445,7 @@ function createBirpc($functions, options) {
410
445
  }
411
446
 
412
447
  //#endregion
413
- //#region ../../node_modules/.pnpm/fast-equals@6.0.0/node_modules/fast-equals/dist/es/index.mjs
448
+ //#region ../../node_modules/.pnpm/fast-equals@6.0.2/node_modules/fast-equals/dist/es/index.mjs
414
449
  const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
415
450
  const { hasOwnProperty } = Object.prototype;
416
451
  /**
@@ -446,7 +481,8 @@ function createIsCircular(areItemsEqual) {
446
481
  * not enumerable and symbol properties.
447
482
  */
448
483
  function getStrictProperties(object) {
449
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
484
+ const symbols = getOwnPropertySymbols(object);
485
+ return symbols.length ? getOwnPropertyNames(object).concat(symbols) : getOwnPropertyNames(object);
450
486
  }
451
487
  /**
452
488
  * Whether the object contains the property passed as an own property.
@@ -519,7 +555,7 @@ function areMapsEqual(a, b, state) {
519
555
  const size = a.size;
520
556
  if (size !== b.size) return false;
521
557
  if (!size) return true;
522
- const matchedIndices = new Array(size);
558
+ const matchedIndices = new Uint8Array(size);
523
559
  const aIterable = a.entries();
524
560
  let aResult;
525
561
  let bResult;
@@ -527,7 +563,7 @@ function areMapsEqual(a, b, state) {
527
563
  while (aResult = aIterable.next()) {
528
564
  if (aResult.done) break;
529
565
  const bIterable = b.entries();
530
- let hasMatch = false;
566
+ let hasMatch = 0;
531
567
  let matchIndex = 0;
532
568
  while (bResult = bIterable.next()) {
533
569
  if (bResult.done) break;
@@ -538,7 +574,7 @@ function areMapsEqual(a, b, state) {
538
574
  const aEntry = aResult.value;
539
575
  const bEntry = bResult.value;
540
576
  if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
541
- hasMatch = matchedIndices[matchIndex] = true;
577
+ hasMatch = matchedIndices[matchIndex] = 1;
542
578
  break;
543
579
  }
544
580
  matchIndex++;
@@ -596,19 +632,19 @@ function areSetsEqual(a, b, state) {
596
632
  const size = a.size;
597
633
  if (size !== b.size) return false;
598
634
  if (!size) return true;
599
- const matchedIndices = new Array(size);
635
+ const matchedIndices = new Uint8Array(size);
600
636
  const aIterable = a.values();
601
637
  let aResult;
602
638
  let bResult;
603
639
  while (aResult = aIterable.next()) {
604
640
  if (aResult.done) break;
605
641
  const bIterable = b.values();
606
- let hasMatch = false;
642
+ let hasMatch = 0;
607
643
  let matchIndex = 0;
608
644
  while (bResult = bIterable.next()) {
609
645
  if (bResult.done) break;
610
646
  if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
611
- hasMatch = matchedIndices[matchIndex] = true;
647
+ hasMatch = matchedIndices[matchIndex] = 1;
612
648
  break;
613
649
  }
614
650
  matchIndex++;
@@ -621,8 +657,8 @@ function areSetsEqual(a, b, state) {
621
657
  * Whether the TypedArray instances are equal in value.
622
658
  */
623
659
  function areTypedArraysEqual(a, b) {
624
- let index = a.byteLength;
625
- if (b.byteLength !== index || a.byteOffset !== b.byteOffset) return false;
660
+ let index = a.length;
661
+ if (b.length !== index || a.byteOffset !== b.byteOffset) return false;
626
662
  while (index-- > 0) if (a[index] !== b[index]) return false;
627
663
  return true;
628
664
  }
@@ -855,7 +891,7 @@ function createCustomEqual(options = {}) {
855
891
  }
856
892
 
857
893
  //#endregion
858
- //#region ../../node_modules/.pnpm/remeda@2.37.0/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
894
+ //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/lazyDataLastImpl--3B10z3s.js
859
895
  function e(e, t, n) {
860
896
  let r = (n) => e(n, ...t);
861
897
  return n === void 0 ? r : Object.assign(r, {
@@ -865,7 +901,7 @@ function e(e, t, n) {
865
901
  }
866
902
 
867
903
  //#endregion
868
- //#region ../../node_modules/.pnpm/remeda@2.37.0/node_modules/remeda/dist/purry.js
904
+ //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/purry.js
869
905
  function t$1(t, n, r) {
870
906
  let i = t.length - n.length;
871
907
  if (i === 0) return t(...n);
@@ -874,7 +910,7 @@ function t$1(t, n, r) {
874
910
  }
875
911
 
876
912
  //#endregion
877
- //#region ../../node_modules/.pnpm/remeda@2.37.0/node_modules/remeda/dist/mapValues.js
913
+ //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/mapValues.js
878
914
  function t(...t) {
879
915
  return t$1(n, t);
880
916
  }
@@ -895,7 +931,7 @@ function n(e, t) {
895
931
  */
896
932
  function createRpc(options) {
897
933
  return createBirpc({}, {
898
- timeout: 120 * 1e3,
934
+ timeout: 12e4,
899
935
  post: (data) => options.send("likec4:rpc", data),
900
936
  on: (fn) => options.on("likec4:rpc", fn),
901
937
  onTimeoutError(functionName) {
@@ -931,7 +967,8 @@ function createHooksForModel($atom) {
931
967
  return useStore($likec4views);
932
968
  }
933
969
  function useLikeC4View(viewId) {
934
- return useStore(useMemo(() => /* @__PURE__ */ computed($likec4model, (model) => model.findView(viewId)?.$layouted ?? null), [viewId]));
970
+ const $view = useMemo(() => /* @__PURE__ */ computed($likec4model, (model) => model.findView(viewId)?.$layouted ?? null), [viewId]);
971
+ return useStore($view);
935
972
  }
936
973
  return {
937
974
  updateModel,