likec4 1.57.0 → 1.59.0
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/__app__/codegen/react.mjs +7 -8
- package/__app__/codegen/webcomponent.mjs +78 -889
- package/__app__/src/aichat/index.mjs +8 -1
- package/__app__/src/chunks/AIChat.mjs +956 -0
- package/__app__/src/chunks/LikeC4Styles.mjs +2164 -0
- package/__app__/src/chunks/ProjectsOverview.mjs +537 -0
- package/__app__/src/chunks/es.mjs +439 -0
- package/__app__/src/chunks/hooks.mjs +458 -0
- package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
- package/__app__/src/chunks/libs/@mantine.mjs +12974 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
- package/__app__/src/chunks/libs/@tanstack.mjs +2693 -0
- package/__app__/src/chunks/libs/@xstate/react.mjs +1996 -0
- package/__app__/src/chunks/libs/@xyflow/react.mjs +5280 -0
- package/__app__/src/chunks/libs/bezier-js.mjs +1006 -0
- package/__app__/src/chunks/libs/d3.mjs +2842 -0
- package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
- package/__app__/src/chunks/libs/framer.mjs +5905 -0
- package/__app__/src/chunks/libs/zod.mjs +3173 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +30 -0
- package/__app__/src/chunks/styled-system.mjs +1047 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +27659 -14
- package/__app__/src/style.css +1 -1
- package/dist/chunks/dist.mjs +10 -0
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +2 -2
- package/dist/chunks/index.d.mts +9 -9
- package/dist/chunks/index2.d.mts +2167 -867
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +1 -2
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +25 -25
- package/dist/chunks/libs/json5.mjs +1 -1
- package/dist/chunks/libs/langium.d.mts +2940 -2914
- package/dist/chunks/libs/langium.mjs +9 -9
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +1 -1
- package/dist/chunks/libs/picomatch.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.d.mts +1 -0
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +48 -36
- package/dist/chunks/libs/zod.mjs +65 -0
- package/dist/chunks/logger.mjs +1 -0
- package/dist/chunks/node.mjs +65 -63
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/{plugin.mjs → vite-plugin.mjs} +41 -41
- package/dist/cli/index.mjs +186 -144
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +6 -5
- package/dist/vite-plugin/index.d.mts +6 -9
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/index.d.mts +64 -64
- package/dist/vite-plugin/internal/index.mjs +946 -1
- package/package.json +51 -52
- package/react/index.d.mts +853 -134
- package/react/index.mjs +49718 -44030
- package/__app__/chunks/AIChat2.mjs +0 -2
- package/__app__/chunks/DiagramActorProvider.mjs +0 -10
- package/__app__/chunks/EmbedPage.mjs +0 -1
- package/__app__/chunks/ExportPage.mjs +0 -2
- package/__app__/chunks/LikeC4Diagram.mjs +0 -19
- package/__app__/chunks/LikeC4Styles.mjs +0 -48
- package/__app__/chunks/Markdown.mjs +0 -1
- package/__app__/chunks/NavigationPanel.mjs +0 -1
- package/__app__/chunks/ViewReact.mjs +0 -1
- package/__app__/chunks/adhoc-editor.mjs +0 -1
- package/__app__/chunks/aichat.mjs +0 -1
- package/__app__/chunks/box.mjs +0 -1
- package/__app__/chunks/create-style-context.mjs +0 -1
- package/__app__/chunks/css.mjs +0 -1
- package/__app__/chunks/factory.mjs +0 -1
- package/__app__/chunks/hooks.mjs +0 -1
- package/__app__/chunks/hstack.mjs +0 -1
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
- package/__app__/chunks/libs/@mantine/core.mjs +0 -41
- package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
- package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
- package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
- package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -358
- package/__app__/chunks/libs/@tanstack/ai-client.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai-react.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/ai.mjs +0 -2
- package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
- package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
- package/__app__/chunks/libs/@xstate/react.mjs +0 -1
- package/__app__/chunks/libs/@xstate/store.mjs +0 -1
- package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
- package/__app__/chunks/libs/bezier-js.mjs +0 -1
- package/__app__/chunks/libs/copy-anything.mjs +0 -1
- package/__app__/chunks/libs/d3-path.mjs +0 -1
- package/__app__/chunks/libs/d3-shape.mjs +0 -1
- package/__app__/chunks/libs/fast-equals.mjs +0 -1
- package/__app__/chunks/libs/framer-motion.mjs +0 -9
- package/__app__/chunks/libs/html-to-image.mjs +0 -2
- package/__app__/chunks/libs/motion-dom.mjs +0 -1
- package/__app__/chunks/libs/nanostores.mjs +0 -1
- package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
- package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
- package/__app__/chunks/libs/remeda.mjs +0 -1
- package/__app__/chunks/libs/superjson.mjs +0 -1
- package/__app__/chunks/libs/zod.mjs +0 -64
- package/__app__/chunks/rolldown-runtime.mjs +0 -1
- package/__app__/chunks/styles.css.mjs +0 -1
- package/__app__/chunks/txt.mjs +0 -1
- package/__app__/chunks/useLikeC4Project.mjs +0 -1
- package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
- package/__app__/src/pages/EmbedPage.mjs +0 -1
- package/__app__/src/pages/ExportPage.mjs +0 -1
- package/__app__/src/pages/ProjectsOverview.mjs +0 -1
- package/__app__/src/pages/ViewAsD2.mjs +0 -1
- package/__app__/src/pages/ViewAsDot.mjs +0 -1
- package/__app__/src/pages/ViewAsMmd.mjs +0 -1
- package/__app__/src/pages/ViewAsPuml.mjs +0 -1
- package/__app__/src/pages/ViewEditor.mjs +0 -1
- package/__app__/src/pages/ViewReact.mjs +0 -1
- package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/chunks/libs/@hono/mcp.mjs +0 -70
- package/dist/chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/chunks/libs/ajv.mjs +0 -1
- package/dist/chunks/libs/ansi-align.mjs +0 -2
- package/dist/chunks/libs/ansi-regex.mjs +0 -1
- package/dist/chunks/libs/ansi-styles.mjs +0 -1
- package/dist/chunks/libs/atomically.mjs +0 -1
- package/dist/chunks/libs/boxen.mjs +0 -22
- package/dist/chunks/libs/conf.mjs +0 -1
- package/dist/chunks/libs/defu.mjs +0 -1
- package/dist/chunks/libs/destr.mjs +0 -1
- package/dist/chunks/libs/find-up-simple.mjs +0 -1
- package/dist/chunks/libs/get-port.mjs +0 -1
- package/dist/chunks/libs/hono.mjs +0 -1
- package/dist/chunks/libs/is-docker.mjs +0 -1
- package/dist/chunks/libs/is-error-instance.mjs +0 -1
- package/dist/chunks/libs/is-inside-container.mjs +0 -1
- package/dist/chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/chunks/libs/isexe.mjs +0 -1
- package/dist/chunks/libs/ky.mjs +0 -3
- package/dist/chunks/libs/p-debounce.mjs +0 -1
- package/dist/chunks/libs/p-limit.mjs +0 -1
- package/dist/chunks/libs/p-timeout.mjs +0 -1
- package/dist/chunks/libs/package-up.mjs +0 -1
- package/dist/chunks/libs/parse-ms.mjs +0 -1
- package/dist/chunks/libs/safe-stringify.mjs +0 -1
- package/dist/chunks/libs/strip-indent.mjs +0 -1
- package/dist/chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/chunks/libs/ts-graphviz.mjs +0 -1
- package/dist/chunks/libs/unctx.mjs +0 -1
- package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
- package/dist/chunks/libs/word-wrap.mjs +0 -12
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { i as __name } from "./chunks/rolldown-runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
export * from "@likec4/core/types";
|
|
4
|
-
|
|
2
|
+
import { n as writeDSL, r as LikeC4$1, t as WriteDSLOptions } from "./chunks/index2.mjs";
|
|
3
|
+
export type * from "@likec4/core/types";
|
|
5
4
|
//#region src/LikeC4.d.ts
|
|
6
5
|
type LikeC4Options = {
|
|
7
6
|
/**
|
|
@@ -49,4 +48,4 @@ declare namespace LikeC4 {
|
|
|
49
48
|
function fromWorkspace(path?: string, _opts?: LikeC4Options): Promise<LikeC4>;
|
|
50
49
|
}
|
|
51
50
|
//#endregion
|
|
52
|
-
export { LikeC4, type LikeC4Options };
|
|
51
|
+
export { LikeC4, type LikeC4Options, type WriteDSLOptions, writeDSL };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunks/rolldown-runtime.mjs";import{n as t
|
|
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};
|
package/dist/model/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { i as __name } from "../chunks/rolldown-runtime.mjs";
|
|
2
2
|
import * as types from "@likec4/core/types";
|
|
3
|
-
import { BBox,
|
|
3
|
+
import { BBox, LayoutedDynamicView, NodeId, ViewId } from "@likec4/core/types";
|
|
4
4
|
import { Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4Model as LikeC4Model$1, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from "@likec4/core/model";
|
|
5
5
|
import { ComputedProjectEdge, ComputedProjectNode, ComputedProjectsView, LayoutedProjectEdge, LayoutedProjectNode, LayoutedProjectsView } from "@likec4/core/compute-view";
|
|
6
|
-
export * from "@likec4/core/types";
|
|
7
|
-
|
|
6
|
+
export type * from "@likec4/core/types";
|
|
8
7
|
//#region ../layouts/dist/sequence/index.d.mts
|
|
9
8
|
//#region src/sequence/_types.d.ts
|
|
10
9
|
interface SequenceActorStepPort {
|
|
@@ -14,6 +13,7 @@ interface SequenceActorStepPort {
|
|
|
14
13
|
height: number;
|
|
15
14
|
type: 'target' | 'source';
|
|
16
15
|
position: 'left' | 'right' | 'top' | 'bottom';
|
|
16
|
+
hidden?: boolean;
|
|
17
17
|
}
|
|
18
18
|
interface SequenceActor {
|
|
19
19
|
id: NodeId;
|
|
@@ -45,9 +45,10 @@ interface SequenceViewLayout {
|
|
|
45
45
|
compounds: Array<SequenceCompound>;
|
|
46
46
|
parallelAreas: Array<SequenceParallelArea>;
|
|
47
47
|
bounds: BBox;
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
49
50
|
//#region src/sequence/sequence-view.d.ts
|
|
50
|
-
declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
|
|
51
|
+
declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
|
|
51
52
|
//#endregion
|
|
52
53
|
//#region src/model/index.d.ts
|
|
53
54
|
type UnknownLayouted = types.UnknownLayouted;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { i as __name } from "../chunks/rolldown-runtime.mjs";
|
|
2
|
-
import
|
|
2
|
+
import "../chunks/index.mjs";
|
|
3
|
+
import { i as LikeC4LanguageServices } from "../chunks/index2.mjs";
|
|
4
|
+
import "@likec4/core";
|
|
3
5
|
import { PluginOption } from "vite";
|
|
4
6
|
import { AnyTextAdapter } from "@tanstack/ai";
|
|
5
|
-
|
|
6
7
|
//#region ../vite-plugin/dist/index.d.mts
|
|
7
8
|
//#region src/virtuals/app-config.d.ts
|
|
8
9
|
interface AppConfig {
|
|
@@ -26,7 +27,8 @@ interface AppConfig {
|
|
|
26
27
|
* @default 'auto'
|
|
27
28
|
*/
|
|
28
29
|
theme?: 'light' | 'dark' | undefined;
|
|
29
|
-
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
30
32
|
//#region src/plugin.d.ts
|
|
31
33
|
interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
|
|
32
34
|
/**
|
|
@@ -136,11 +138,6 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
136
138
|
watch?: never;
|
|
137
139
|
logLevel?: never;
|
|
138
140
|
});
|
|
139
|
-
declare function LikeC4VitePlugin({
|
|
140
|
-
environments,
|
|
141
|
-
appConfig,
|
|
142
|
-
ai: _ai,
|
|
143
|
-
...pluginOpts
|
|
144
|
-
}: LikeC4VitePluginOptions): PluginOption; //#endregion
|
|
141
|
+
declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
|
|
145
142
|
//#endregion
|
|
146
143
|
export { LikeC4VitePlugin, type LikeC4VitePluginOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../chunks/plugin.mjs";export{e as LikeC4VitePlugin};
|
|
1
|
+
import{t as e}from"../chunks/vite-plugin.mjs";export{e as LikeC4VitePlugin};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { t as __name } from "./chunks/rolldown-runtime.mjs";
|
|
2
1
|
import { LikeC4Model } from "@likec4/core/model";
|
|
3
2
|
import { DependencyList } from "react";
|
|
4
3
|
import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
|
|
5
4
|
import { AdhocViewPredicate } from "@likec4/core/compute-view";
|
|
6
|
-
|
|
7
|
-
//#region
|
|
8
|
-
//#region ../../node_modules/.pnpm/nanostores@1.2.0/node_modules/nanostores/atom/index.d.ts
|
|
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
|
|
9
7
|
type AllKeys<T> = T extends any ? keyof T : never;
|
|
10
8
|
type Primitive = boolean | number | string;
|
|
11
9
|
type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
|
|
@@ -126,10 +124,11 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
|
|
|
126
124
|
* @param initialValue Initial value of the store.
|
|
127
125
|
* @returns The store object with methods to subscribe.
|
|
128
126
|
*/
|
|
129
|
-
declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
|
|
130
|
-
//#
|
|
127
|
+
declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/map/index.d.ts
|
|
131
130
|
type KeyofBase = keyof any;
|
|
132
|
-
type Get<T, K extends KeyofBase> = Extract<T, { [K1 in K]: any }>[K];
|
|
131
|
+
type Get<T, K extends KeyofBase> = Extract<T, { [K1 in K]: any; }>[K];
|
|
133
132
|
type HasIndexSignature<T> = string extends keyof T ? true : false;
|
|
134
133
|
type ValueWithUndefinedForIndexSignatures<Value, Key extends keyof Value> = HasIndexSignature<Value> extends true ? undefined | Value[Key] : Value[Key];
|
|
135
134
|
type WritableStore<Value = any> = (Value extends object ? MapStore<Value> : never) | WritableAtom<Value>;
|
|
@@ -219,62 +218,15 @@ interface PreinitializedMapStore<Value extends object = any> extends MapStore<Va
|
|
|
219
218
|
* @param init Initialize store and return store destructor.
|
|
220
219
|
* @returns The store object with methods to subscribe.
|
|
221
220
|
*/
|
|
222
|
-
declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Value> & StoreExt;
|
|
223
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.2.0_react@19.2.6/node_modules/@nanostores/react/index.d.ts
|
|
224
|
-
type StoreKeys<T> = T extends {
|
|
225
|
-
setKey: (k: infer K, v: any) => unknown;
|
|
226
|
-
} ? K : never;
|
|
227
|
-
interface UseStoreOptions<SomeStore> {
|
|
228
|
-
/**
|
|
229
|
-
* @default
|
|
230
|
-
* ```ts
|
|
231
|
-
* [store, options.keys]
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
deps?: DependencyList;
|
|
235
|
-
/**
|
|
236
|
-
* Will re-render components only on specific key changes.
|
|
237
|
-
*/
|
|
238
|
-
keys?: StoreKeys<SomeStore>[];
|
|
239
|
-
/**
|
|
240
|
-
* Enable SSR support. Set `initial` when store's initial value is the same on
|
|
241
|
-
* server and client, or provide a function to return the server store state
|
|
242
|
-
* for advanced cases (per useSyncExternalStore's getServerSnapshot).
|
|
243
|
-
*/
|
|
244
|
-
ssr?: (() => StoreValue<SomeStore>) | 'initial' | false;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Subscribe to store changes and get store’s value.
|
|
248
|
-
*
|
|
249
|
-
* Can be user with store builder too.
|
|
250
|
-
*
|
|
251
|
-
* ```js
|
|
252
|
-
* import { useStore } from 'nanostores/react'
|
|
253
|
-
*
|
|
254
|
-
* import { router } from '../store/router'
|
|
255
|
-
*
|
|
256
|
-
* export const Layout = () => {
|
|
257
|
-
* let page = useStore(router)
|
|
258
|
-
* if (page.route === 'home') {
|
|
259
|
-
* return <HomePage />
|
|
260
|
-
* } else {
|
|
261
|
-
* return <Error404 />
|
|
262
|
-
* }
|
|
263
|
-
* }
|
|
264
|
-
* ```
|
|
265
|
-
*
|
|
266
|
-
* @param store Store instance.
|
|
267
|
-
* @returns Store value.
|
|
268
|
-
*/
|
|
269
|
-
declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>; //#endregion
|
|
221
|
+
declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Value> & StoreExt;
|
|
270
222
|
//#endregion
|
|
271
|
-
//#region
|
|
272
|
-
//#region ../../node_modules/.pnpm/nanostores@1.2.0/node_modules/nanostores/task/index.d.ts
|
|
223
|
+
//#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/task/index.d.ts
|
|
273
224
|
interface Task<Value> extends Promise<Value> {
|
|
274
225
|
t: true;
|
|
275
|
-
}
|
|
276
|
-
//#
|
|
277
|
-
|
|
226
|
+
}
|
|
227
|
+
//#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]>; };
|
|
278
230
|
interface Computed {
|
|
279
231
|
/**
|
|
280
232
|
* @deprecated Use `@nanostores/async`.
|
|
@@ -321,9 +273,8 @@ interface Batched {
|
|
|
321
273
|
*/
|
|
322
274
|
<Value, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
323
275
|
}
|
|
324
|
-
declare const batched: Batched;
|
|
276
|
+
declare const batched: Batched;
|
|
325
277
|
//#endregion
|
|
326
|
-
//#region ../vite-plugin/dist/internal/index.d.mts
|
|
327
278
|
//#region src/rpc/protocol.d.ts
|
|
328
279
|
interface LikeC4VitePluginRpc {
|
|
329
280
|
/**
|
|
@@ -353,7 +304,56 @@ interface LikeC4VitePluginRpc {
|
|
|
353
304
|
projectId: ProjectId;
|
|
354
305
|
predicates: AdhocViewPredicate[];
|
|
355
306
|
}): Promise<LayoutedElementView>;
|
|
356
|
-
}
|
|
307
|
+
}
|
|
308
|
+
//#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
|
|
310
|
+
type StoreKeys<T> = T extends {
|
|
311
|
+
setKey: (k: infer K, v: any) => unknown;
|
|
312
|
+
} ? K : never;
|
|
313
|
+
interface UseStoreOptions<SomeStore> {
|
|
314
|
+
/**
|
|
315
|
+
* @default
|
|
316
|
+
* ```ts
|
|
317
|
+
* [store, options.keys]
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
deps?: DependencyList;
|
|
321
|
+
/**
|
|
322
|
+
* Will re-render components only on specific key changes.
|
|
323
|
+
*/
|
|
324
|
+
keys?: StoreKeys<SomeStore>[];
|
|
325
|
+
/**
|
|
326
|
+
* Enable SSR support. Set `initial` when store's initial value is the same on
|
|
327
|
+
* server and client, or provide a function to return the server store state
|
|
328
|
+
* for advanced cases (per useSyncExternalStore's getServerSnapshot).
|
|
329
|
+
*/
|
|
330
|
+
ssr?: (() => StoreValue<SomeStore>) | 'initial' | false;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Subscribe to store changes and get store’s value.
|
|
334
|
+
*
|
|
335
|
+
* Can be user with store builder too.
|
|
336
|
+
*
|
|
337
|
+
* ```js
|
|
338
|
+
* import { useStore } from 'nanostores/react'
|
|
339
|
+
*
|
|
340
|
+
* import { router } from '../store/router'
|
|
341
|
+
*
|
|
342
|
+
* export const Layout = () => {
|
|
343
|
+
* let page = useStore(router)
|
|
344
|
+
* if (page.route === 'home') {
|
|
345
|
+
* return <HomePage />
|
|
346
|
+
* } else {
|
|
347
|
+
* return <Error404 />
|
|
348
|
+
* }
|
|
349
|
+
* }
|
|
350
|
+
* ```
|
|
351
|
+
*
|
|
352
|
+
* @param store Store instance.
|
|
353
|
+
* @returns Store value.
|
|
354
|
+
*/
|
|
355
|
+
declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
|
|
356
|
+
//#endregion
|
|
357
357
|
//#region src/internal.d.ts
|
|
358
358
|
interface LikeC4VitePluginRpcOptions {
|
|
359
359
|
/**
|
|
@@ -376,6 +376,6 @@ declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4ModelData
|
|
|
376
376
|
useLikeC4Model: () => LikeC4Model.Layouted;
|
|
377
377
|
useLikeC4Views: () => ReadonlyArray<LayoutedView>;
|
|
378
378
|
useLikeC4View: (viewId: string) => LayoutedView | null;
|
|
379
|
-
};
|
|
379
|
+
};
|
|
380
380
|
//#endregion
|
|
381
381
|
export { type Atom, type LikeC4VitePluginRpc, LikeC4VitePluginRpcOptions, type ReadableAtom, type WritableAtom, atom, batched, computed, createHooksForModel, createRpc, map, useStore };
|