MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / makeMockNodeModel

Function makeMockNodeModel

frontend/preview/mock/mock-node-model.ts:15–45  ·  view source on GitHub ↗
(opts: MockNodeModelOpts)

Source from the content-addressed store, hash-verified

13};
14
15export function makeMockNodeModel(opts: MockNodeModelOpts): NodeModel {
16 const isFocusedAtom = atom(true);
17 const isMagnifiedAtom = atom(false);
18
19 return {
20 additionalProps: atom({} as any),
21 innerRect: atom(opts.innerRect ?? { width: "1000px", height: "640px" }),
22 blockNum: atom(1),
23 numLeafs: atom(opts.numLeafs ?? 1),
24 nodeId: opts.nodeId,
25 blockId: opts.blockId,
26 addEphemeralNodeToLayout: () => {},
27 animationTimeS: atom(0),
28 isResizing: atom(false),
29 isFocused: isFocusedAtom,
30 isMagnified: isMagnifiedAtom,
31 anyMagnified: atom((get) => get(isMagnifiedAtom)),
32 isEphemeral: atom(false),
33 ready: atom(true),
34 disablePointerEvents: atom(false),
35 toggleMagnify: () => {
36 globalStore.set(isMagnifiedAtom, !globalStore.get(isMagnifiedAtom));
37 },
38 focusNode: () => {
39 globalStore.set(isFocusedAtom, true);
40 },
41 onClose: () => {},
42 dragHandleRef: { current: null },
43 displayContainerRef: { current: null },
44 };
45}

Callers 5

ProcessViewerPreviewFunction · 0.90
WebPreviewFunction · 0.90
SysinfoPreviewFunction · 0.90
WaveAIPreviewFunction · 0.90
AiFileDiffPreviewFunction · 0.90

Calls 2

setMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected