glassbrain 0.2.0-alpha.7 → 0.2.0-alpha.8
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/README.md +6 -7
- package/dist/chunks/{chunk-GZSWZSSE.js → chunk-3CNHFYHG.js} +1317 -1650
- package/dist/chunks/chunk-7PWRJEZT.js +35 -0
- package/dist/chunks/chunk-CHOCJIOD.js +1340 -0
- package/dist/chunks/chunk-DHYIMBHU.js +960 -0
- package/dist/chunks/{chunk-FNTYI7VP.js → chunk-NDUF3CBQ.js} +340 -996
- package/dist/cli/glassbrain.js +338 -142
- package/dist/cli/viewer.js +218 -213
- package/dist/core.d.ts +1 -0
- package/dist/core.js +50 -30
- package/dist/diff.d.ts +9 -1
- package/dist/edit.d.ts +10 -0
- package/dist/index.js +57 -37
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +98 -76
- package/dist/layers.d.ts +3 -1
- package/dist/lint-report.d.ts +70 -0
- package/dist/profile.d.ts +10 -2
- package/dist/react/DetailPanel.d.ts +31 -1
- package/dist/react/DetailPanel.js +8 -4
- package/dist/react/EdgeMark.d.ts +22 -0
- package/dist/react/EditPanel.d.ts +6 -6
- package/dist/react/GraphCanvas.d.ts +17 -6
- package/dist/react/GraphCanvas.js +4 -4
- package/dist/react/Inspector.d.ts +72 -0
- package/dist/react/ObjectRef.d.ts +12 -0
- package/dist/react/Toolbar.d.ts +10 -3
- package/dist/react/ZoomBoundary.d.ts +4 -0
- package/dist/react/camera.d.ts +7 -0
- package/dist/react/i18n.d.ts +2 -2
- package/dist/react/icons.d.ts +7 -3
- package/dist/react/input.d.ts +5 -3
- package/dist/react/useSubgraph.d.ts +15 -0
- package/dist/shell.d.ts +1 -0
- package/dist/strings.d.ts +23 -2
- package/dist/style.d.ts +2 -0
- package/dist/subgraph.d.ts +13 -0
- package/dist/tree.d.ts +1 -0
- package/dist/view.d.ts +3 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-3KUNYSJE.js +0 -246
- package/dist/chunks/chunk-LK77SYCN.js +0 -100
- package/dist/chunks/chunk-Q35ZKWKF.js +0 -99
- package/dist/react/GlassPlanes.d.ts +0 -11
package/dist/layers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GraphModel, type GraphNode } from './model.js';
|
|
2
2
|
import type { LayerSpec } from './profile.js';
|
|
3
3
|
export interface DerivedLayers {
|
|
4
4
|
/** Empty when the graph has no ordered siblings at the top of a single root. */
|
|
@@ -15,4 +15,6 @@ export declare function childrenMap(model: GraphModel): Gy;
|
|
|
15
15
|
export declare function deriveLayers(model: GraphModel, colors?: string[], force?: boolean): DerivedLayers;
|
|
16
16
|
/** Layers in reading order for a node id, for messages and the outline. */
|
|
17
17
|
export declare function layerIndexOf(derived: DerivedLayers, id: string): number;
|
|
18
|
+
/** Hide the floor anchor only in the drawing, leaving detail, diff and edit models intact. */
|
|
19
|
+
export declare function layerView(model: GraphModel, anchor?: string): GraphModel;
|
|
18
20
|
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { GraphChecks } from './profile.js';
|
|
2
|
+
export interface PaletteTarget {
|
|
3
|
+
file: string;
|
|
4
|
+
field: 'nodePalette' | 'profile.nodePalette';
|
|
5
|
+
}
|
|
6
|
+
export type DiagnosticFacts = {
|
|
7
|
+
type: 'duplicate';
|
|
8
|
+
source: string;
|
|
9
|
+
target: string;
|
|
10
|
+
kind?: string;
|
|
11
|
+
count: number;
|
|
12
|
+
files: string[];
|
|
13
|
+
differing: boolean;
|
|
14
|
+
differences?: {
|
|
15
|
+
field: string;
|
|
16
|
+
copies: {
|
|
17
|
+
file?: string;
|
|
18
|
+
value?: string;
|
|
19
|
+
}[];
|
|
20
|
+
}[];
|
|
21
|
+
} | {
|
|
22
|
+
type: 'dangling';
|
|
23
|
+
source: string;
|
|
24
|
+
target: string;
|
|
25
|
+
kind?: string;
|
|
26
|
+
missing: string[];
|
|
27
|
+
} | {
|
|
28
|
+
type: 'wide';
|
|
29
|
+
count: number;
|
|
30
|
+
layers: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'uneven';
|
|
33
|
+
closest?: {
|
|
34
|
+
a: string;
|
|
35
|
+
b: string;
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
type: 'palette';
|
|
39
|
+
kinds: string[];
|
|
40
|
+
target?: PaletteTarget;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'vocabulary';
|
|
43
|
+
space: 'node' | 'edge';
|
|
44
|
+
kinds: string[];
|
|
45
|
+
} | {
|
|
46
|
+
type: 'coverage';
|
|
47
|
+
leaves: string[];
|
|
48
|
+
} | {
|
|
49
|
+
type: 'colors';
|
|
50
|
+
kinds: string[];
|
|
51
|
+
target?: PaletteTarget;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'misplaced';
|
|
54
|
+
fields: string[];
|
|
55
|
+
};
|
|
56
|
+
export interface ReportFinding {
|
|
57
|
+
level: 'error' | 'warn' | 'info';
|
|
58
|
+
code: string;
|
|
59
|
+
where?: string;
|
|
60
|
+
/** Graph-wide findings use a snapshot name in where. All other locations identify files. */
|
|
61
|
+
scope?: 'graph' | 'version';
|
|
62
|
+
node?: string;
|
|
63
|
+
message: string;
|
|
64
|
+
fix?: string;
|
|
65
|
+
facts?: DiagnosticFacts;
|
|
66
|
+
}
|
|
67
|
+
/** The CLI prints this Markdown source and the viewer renders it verbatim. */
|
|
68
|
+
export declare function reportText(found: ReportFinding[], input: string, versions?: number): string;
|
|
69
|
+
/** Keep domain findings independent of CLI lint policy, even when rule codes coincide. */
|
|
70
|
+
export declare function checksText({ lint, review }: GraphChecks, lintReport?: string): string;
|
package/dist/profile.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface GraphIssue {
|
|
|
33
33
|
level: 'error' | 'warn' | 'info';
|
|
34
34
|
where?: string;
|
|
35
35
|
fix?: string;
|
|
36
|
-
/**
|
|
36
|
+
/** Optional display name for the rule identified by kind. */
|
|
37
37
|
group?: string;
|
|
38
38
|
message: string;
|
|
39
39
|
nodeId?: string;
|
|
@@ -49,6 +49,8 @@ export interface GraphProfile {
|
|
|
49
49
|
/** Slices → model. Default mergeSlices (native declarations compose by id). */
|
|
50
50
|
merge(slices: GraphSlice[]): GraphModel;
|
|
51
51
|
layers: LayerSpec[];
|
|
52
|
+
/** Derive subgraph floors from local containment. Explicit host layers retain their assignments. */
|
|
53
|
+
structuralLayers?: boolean;
|
|
52
54
|
/** Which layer a node belongs to. Defaults to node.layer, then to the first layer. */
|
|
53
55
|
layerOf(node: GraphNode): string;
|
|
54
56
|
/**
|
|
@@ -141,5 +143,11 @@ export interface RawSource {
|
|
|
141
143
|
* remember to fill them in: this is the foundation that "subgraph filtering / write-back location" stands on (filling them yourself always misses some).
|
|
142
144
|
*/
|
|
143
145
|
export declare function parseSources(sources: RawSource[], profile?: GraphProfile): GraphModel;
|
|
144
|
-
/**
|
|
146
|
+
/** An absent review means no domain rules ran. An empty review means they passed. */
|
|
147
|
+
export interface GraphChecks {
|
|
148
|
+
lint: GraphIssue[];
|
|
149
|
+
review?: GraphIssue[];
|
|
150
|
+
}
|
|
151
|
+
export declare function validateModelBySource(model: GraphModel, profile: GraphProfile, lint?: GraphIssue[]): GraphChecks;
|
|
152
|
+
/** All findings in their original order for consumers of the flat validation API. */
|
|
145
153
|
export declare function validateModel(model: GraphModel, profile: GraphProfile): GraphIssue[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { DetailSpec } from '../profile.js';
|
|
3
|
+
import { type GraphModel, type GraphNode } from '../model.js';
|
|
4
|
+
import { type GraphDelta } from '../diff.js';
|
|
5
|
+
import { type ColorOf, type InspectTarget } from './Inspector.js';
|
|
3
6
|
import { type MarkdownOptions } from './markdown.js';
|
|
4
7
|
export interface SelectedNode {
|
|
5
8
|
id: string;
|
|
@@ -28,4 +31,31 @@ export interface DetailPanelProps {
|
|
|
28
31
|
/** Its color on the graph: the dot before the kind in the title, the same mark as on the graph and in the search dropdown. */
|
|
29
32
|
color?: string;
|
|
30
33
|
}
|
|
31
|
-
export
|
|
34
|
+
export declare function inspect(model: GraphModel, target: InspectTarget | undefined, originalNode?: GraphNode): {
|
|
35
|
+
model: GraphModel;
|
|
36
|
+
node: GraphNode | undefined;
|
|
37
|
+
originalNode: GraphNode | undefined;
|
|
38
|
+
edge: import("..").GraphEdge | undefined;
|
|
39
|
+
children: GraphNode[];
|
|
40
|
+
edges: import("..").GraphEdge[];
|
|
41
|
+
} | undefined;
|
|
42
|
+
type Subject = NonNullable<ReturnType<typeof inspect>>;
|
|
43
|
+
type InspectorProps = Pick<DetailPanelProps, 'spec' | 'kindLabels' | 'onClose' | 'onEdit' | 'renderText'> & {
|
|
44
|
+
scope?: {
|
|
45
|
+
subtree?: string | null;
|
|
46
|
+
change: (id: string | null) => void;
|
|
47
|
+
};
|
|
48
|
+
membership?: string;
|
|
49
|
+
before?: Subject;
|
|
50
|
+
after?: Subject;
|
|
51
|
+
delta?: GraphDelta | null;
|
|
52
|
+
colorOf: ColorOf;
|
|
53
|
+
onPick?: (target: InspectTarget) => void;
|
|
54
|
+
onBack?: () => void;
|
|
55
|
+
markdownFor?: (side: Subject) => MarkdownOptions;
|
|
56
|
+
nodeClass?: (node: GraphNode) => string;
|
|
57
|
+
};
|
|
58
|
+
export declare function ObjectDetails({ before, after, delta, spec, kindLabels, onClose, onEdit, scope, membership, onBack, renderText, markdownFor, onPick, colorOf, nodeClass }: InspectorProps): import("react").JSX.Element | null;
|
|
59
|
+
/** Standalone API for hosts that only have a selected-node snapshot. */
|
|
60
|
+
export default function DetailPanel({ node, color, markdown, ...props }: DetailPanelProps): import("react").JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
|
-
DetailPanel
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
DetailPanel,
|
|
5
|
+
ObjectDetails,
|
|
6
|
+
inspect
|
|
7
|
+
} from "../chunks/chunk-CHOCJIOD.js";
|
|
8
|
+
import "../chunks/chunk-NDUF3CBQ.js";
|
|
7
9
|
import "../chunks/chunk-ZA47FP7C.js";
|
|
8
10
|
export {
|
|
9
|
-
|
|
11
|
+
ObjectDetails,
|
|
12
|
+
DetailPanel as default,
|
|
13
|
+
inspect
|
|
10
14
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Arrow } from '../paint.js';
|
|
2
|
+
import type { GraphProfile } from '../profile.js';
|
|
3
|
+
import { type GraphTheme } from '../style.js';
|
|
4
|
+
interface Stroke {
|
|
5
|
+
dash: string;
|
|
6
|
+
head: Arrow;
|
|
7
|
+
tail: Arrow;
|
|
8
|
+
}
|
|
9
|
+
type MarkOf = (kind?: string) => {
|
|
10
|
+
stroke: Stroke;
|
|
11
|
+
color: string;
|
|
12
|
+
scale: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const EdgeMarks: import("react").Context<MarkOf>;
|
|
15
|
+
/** Resolve the same mark for every reference to an edge kind, including removed edges in the comparison pane. */
|
|
16
|
+
export declare function edgeMarksFor(profile: GraphProfile, theme: GraphTheme, cy: any, mirror: () => any): MarkOf;
|
|
17
|
+
export declare function EdgeMark({ kind, off, reverse }: {
|
|
18
|
+
kind?: string;
|
|
19
|
+
off?: boolean;
|
|
20
|
+
reverse?: boolean;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type EditError, type EditOp } from '../edit.js';
|
|
2
|
+
import { type EdgeRef, type EditError, type EditOp } from '../edit.js';
|
|
3
3
|
import { type GraphModel } from '../model.js';
|
|
4
|
+
import { type ColorOf } from './Inspector.js';
|
|
4
5
|
/** Slot for the free content editor. Defaults to a monospaced textarea. */
|
|
5
6
|
export type RenderEditor = (p: {
|
|
6
7
|
value: string;
|
|
@@ -13,18 +14,17 @@ export type EditTarget = {
|
|
|
13
14
|
} | {
|
|
14
15
|
what: 'edge';
|
|
15
16
|
source?: string;
|
|
17
|
+
target?: string;
|
|
18
|
+
edge?: EdgeRef;
|
|
16
19
|
};
|
|
17
|
-
|
|
18
|
-
export default function EditPanel({ target, model, onSubmit, onCancel, onRetarget, renderEditor, colorOf }: {
|
|
20
|
+
export default function EditPanel({ target, model, onSubmit, onCancel, kindLabels, renderEditor, colorOf }: {
|
|
19
21
|
target: EditTarget;
|
|
20
22
|
model: GraphModel;
|
|
21
23
|
/** Hand over one op. Returns null = done; otherwise the reason it could not be applied. */
|
|
22
24
|
onSubmit: (op: EditOp) => EditError | null;
|
|
23
25
|
onCancel: () => void;
|
|
24
|
-
|
|
25
|
-
onRetarget: (t: EditTarget) => void;
|
|
26
|
+
kindLabels?: Record<string, string>;
|
|
26
27
|
renderEditor?: RenderEditor;
|
|
27
28
|
/** A node's color on the graph (the dot in dropdowns, the selection and edge lists). */
|
|
28
29
|
colorOf?: ColorOf;
|
|
29
30
|
}): import("react").JSX.Element;
|
|
30
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* glassbrain · GraphCanvas — the one graph canvas component
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scopes project immutable versions before they enter the same canvas pipeline.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* node subtree / source files → local layout, pass animation and comparison
|
|
7
7
|
* which layer / stack as 2.5D → one affine map over the same coordinates, animated
|
|
8
8
|
* search → visibility unchanged; dims the rest and flies there
|
|
9
9
|
*
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
17
17
|
import { type GraphModel } from '../model.js';
|
|
18
|
-
import { type GraphIssue, type GraphProfile } from '../profile.js';
|
|
18
|
+
import { type GraphChecks, type GraphIssue, type GraphProfile } from '../profile.js';
|
|
19
19
|
import { type GraphView } from '../view.js';
|
|
20
20
|
import { type GraphTheme } from '../style.js';
|
|
21
21
|
import { type Positions } from '../layout/engine.js';
|
|
22
22
|
import type { LayoutRunnerPool } from '../layout/run-job.js';
|
|
23
23
|
import { type AnimateSpec, type TransitionReport } from '../animate.js';
|
|
24
|
-
import { type GraphDelta } from '../diff.js';
|
|
24
|
+
import { type DiffOptions, type GraphDelta } from '../diff.js';
|
|
25
25
|
import { type DiffLayoutSpec } from '../layout/diff-layout.js';
|
|
26
26
|
import type { GraphNode } from '../model.js';
|
|
27
27
|
import { type ControlId } from './Toolbar.js';
|
|
@@ -88,8 +88,12 @@ export interface GraphCanvasProps {
|
|
|
88
88
|
onSelect?: (node: SelectedNode | null) => void;
|
|
89
89
|
/** Receives the cytoscape instance (for debugging / custom interaction). Called again when the instance is rebuilt. */
|
|
90
90
|
onReady?: (cy: any) => void;
|
|
91
|
-
/**
|
|
91
|
+
/** Flat host diagnostics, shown as graph lint when checks is omitted. */
|
|
92
92
|
issues?: GraphIssue[];
|
|
93
|
+
/** Complete results supplied by the host, independent of view filtering. */
|
|
94
|
+
checks?: GraphChecks;
|
|
95
|
+
/** Verbatim CLI lint report for the displayed graph. */
|
|
96
|
+
issueReport?: string;
|
|
93
97
|
/** Validation results go out; turn showIssues off when the host shows them itself. */
|
|
94
98
|
onIssues?: (issues: GraphIssue[]) => void;
|
|
95
99
|
showIssues?: boolean;
|
|
@@ -154,6 +158,13 @@ export interface GraphCanvasProps {
|
|
|
154
158
|
* marks, and changed nodes get a breathing halo. **model must still be delta.model** (the union graph).
|
|
155
159
|
*/
|
|
156
160
|
diff?: GraphDelta | null;
|
|
161
|
+
/** Available files across passes, including those absent in the active pass. */
|
|
162
|
+
sourceFiles?: string[];
|
|
163
|
+
/** Compare raw versions after applying the current scope. An alternative to a precomputed diff. */
|
|
164
|
+
compareWith?: {
|
|
165
|
+
model: GraphModel;
|
|
166
|
+
options?: DiffOptions;
|
|
167
|
+
};
|
|
157
168
|
/** Only mark changes on these ids; pair with `changedSubset()` for "changes only". */
|
|
158
169
|
diffOnly?: Set<string> | null;
|
|
159
170
|
/**
|
|
@@ -180,7 +191,7 @@ export interface GraphCanvasProps {
|
|
|
180
191
|
layoutMs: number;
|
|
181
192
|
}) => void;
|
|
182
193
|
/** Top-left caption (title / stats). */
|
|
183
|
-
note?: ReactNode;
|
|
194
|
+
note?: ReactNode | ((model: GraphModel, diff: GraphDelta | null) => ReactNode);
|
|
184
195
|
emptyMessage?: ReactNode;
|
|
185
196
|
/** UI strings. The library ships English only; other languages come from the host (partial is fine). `examples/strings-zh.ts` is a ready Chinese sample. */
|
|
186
197
|
strings?: Partial<GraphStrings>;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
GraphCanvas
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
-
import "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-3CNHFYHG.js";
|
|
6
|
+
import "../chunks/chunk-DHYIMBHU.js";
|
|
7
|
+
import "../chunks/chunk-CHOCJIOD.js";
|
|
8
|
+
import "../chunks/chunk-NDUF3CBQ.js";
|
|
9
9
|
import "../chunks/chunk-OE5IRKWZ.js";
|
|
10
10
|
import "../chunks/chunk-ZA47FP7C.js";
|
|
11
11
|
export {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { GraphModel, GraphEdge, GraphNode } from '../model.js';
|
|
3
|
+
export declare function childrenOf(model: GraphModel, parent?: string | null): GraphNode[];
|
|
4
|
+
export type ColorOf = (id: string, past?: boolean) => string | undefined;
|
|
5
|
+
export type InspectTarget = ({
|
|
6
|
+
node: string;
|
|
7
|
+
} | {
|
|
8
|
+
edge: Pick<GraphEdge, 'source' | 'target' | 'kind'>;
|
|
9
|
+
}) & {
|
|
10
|
+
past?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function HeaderAction({ icon, label, hint, onClick }: {
|
|
13
|
+
icon: string;
|
|
14
|
+
label: string;
|
|
15
|
+
hint?: string;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function Inspector({ title, kind, mark, status, objectId, onClose, onBack, onEdit, scopeAction, onSubmit, foot, error, children }: {
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
kind?: ReactNode;
|
|
21
|
+
mark?: ReactNode;
|
|
22
|
+
status?: ReactNode;
|
|
23
|
+
objectId?: ReactNode;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
onBack?: () => void;
|
|
26
|
+
onEdit?: () => void;
|
|
27
|
+
scopeAction?: ReactNode;
|
|
28
|
+
onSubmit?: () => void;
|
|
29
|
+
foot?: ReactNode;
|
|
30
|
+
error?: string | null;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
export declare function NodeRef({ id, model, colorOf, sub, onPick }: {
|
|
34
|
+
id: string;
|
|
35
|
+
model?: GraphModel;
|
|
36
|
+
colorOf: ColorOf;
|
|
37
|
+
sub?: string;
|
|
38
|
+
onPick?: (target: InspectTarget) => void;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
export declare function edgeName(edge: GraphEdge, labels: Record<string, string> | undefined, fallback: string): string;
|
|
41
|
+
export declare function DiffValue({ old, now, block }: {
|
|
42
|
+
old?: ReactNode;
|
|
43
|
+
now?: ReactNode;
|
|
44
|
+
block?: boolean;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
export declare function InspectorField({ label, htmlFor, children }: {
|
|
47
|
+
label?: ReactNode;
|
|
48
|
+
htmlFor?: string;
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
export declare function pairItems<T>(before: T[], after: T[], key: (item: T) => string): {
|
|
52
|
+
key: string;
|
|
53
|
+
old: T | undefined;
|
|
54
|
+
now: T | undefined;
|
|
55
|
+
}[];
|
|
56
|
+
export type RelationSide = {
|
|
57
|
+
model: GraphModel;
|
|
58
|
+
children: GraphNode[];
|
|
59
|
+
edges: GraphEdge[];
|
|
60
|
+
colorOf: ColorOf;
|
|
61
|
+
onPick?: (target: InspectTarget) => void;
|
|
62
|
+
};
|
|
63
|
+
export declare function NodeRelations({ id, current, previous, kindLabels, movedChild, ignore, onAdd, onEditEdge }: {
|
|
64
|
+
id: string;
|
|
65
|
+
current: RelationSide;
|
|
66
|
+
previous?: RelationSide;
|
|
67
|
+
kindLabels?: Record<string, string>;
|
|
68
|
+
movedChild?: (id: string) => boolean;
|
|
69
|
+
ignore?: Set<string>;
|
|
70
|
+
onAdd?: (group: 'child' | 'in' | 'out') => void;
|
|
71
|
+
onEditEdge?: (edge: GraphEdge) => void;
|
|
72
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function NodeDot({ color }: {
|
|
3
|
+
color?: string;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
/** One object reference, interactive when a destination is available. */
|
|
6
|
+
export declare function ObjectRef({ mark, name, sub, onPick, title }: {
|
|
7
|
+
mark: ReactNode;
|
|
8
|
+
name: ReactNode;
|
|
9
|
+
sub?: string;
|
|
10
|
+
onPick?: () => void;
|
|
11
|
+
title?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
package/dist/react/Toolbar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GraphChecks, LayerSpec } from '../profile.js';
|
|
3
3
|
import { type GraphView } from '../view.js';
|
|
4
4
|
export type ControlId = 'search' | 'origins' | 'layers' | 'relayout' | 'zoom';
|
|
5
5
|
export declare const ALL_CONTROLS: ControlId[];
|
|
@@ -14,6 +14,13 @@ export interface ToolbarProps {
|
|
|
14
14
|
setView: (patch: Partial<GraphView>) => void;
|
|
15
15
|
layers: LayerSpec[];
|
|
16
16
|
origins: string[];
|
|
17
|
+
scope: {
|
|
18
|
+
active: boolean;
|
|
19
|
+
subtree?: string | null;
|
|
20
|
+
origins?: string[] | null;
|
|
21
|
+
label: string;
|
|
22
|
+
change: (subtree: string | null, origins?: string[]) => void;
|
|
23
|
+
};
|
|
17
24
|
stats: {
|
|
18
25
|
nodes: number;
|
|
19
26
|
edges: number;
|
|
@@ -49,6 +56,6 @@ export declare function ZoomDock(p: {
|
|
|
49
56
|
zoom: boolean;
|
|
50
57
|
onZoom: (dir: 1 | -1) => void;
|
|
51
58
|
onFit: () => void;
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
checks?: GraphChecks;
|
|
60
|
+
report?: string;
|
|
54
61
|
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/** The canvas handles graph zoom. Elsewhere in the viewer, keep pinch from
|
|
3
|
+
* magnifying the page while leaving ordinary scrolling and keyboard zoom alone. */
|
|
4
|
+
export declare function ZoomBoundary(props: ComponentPropsWithoutRef<'div'>): import("react").JSX.Element;
|
package/dist/react/camera.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { Positions } from '../layout/planes.js';
|
|
2
|
+
/** Express the previous frame in the target layout's coordinates. The mean displacement
|
|
3
|
+
* minimizes squared travel for surviving anchors. Disjoint scenes share their box centers. */
|
|
4
|
+
export declare function frameTranslation(before: Positions, after: Positions): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
1
8
|
export interface Viewport {
|
|
2
9
|
zoom: number;
|
|
3
10
|
pan: {
|
package/dist/react/i18n.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type GraphStrings } from '../strings.js';
|
|
2
|
-
export declare const StringsContext: import("react").Context<GraphStrings
|
|
3
|
-
export declare const useStrings: () => GraphStrings
|
|
2
|
+
export declare const StringsContext: import("react").Context<Required<GraphStrings>>;
|
|
3
|
+
export declare const useStrings: () => Required<GraphStrings>;
|
package/dist/react/icons.d.ts
CHANGED
|
@@ -3,15 +3,19 @@ export declare const Icon: ({ d, size }: {
|
|
|
3
3
|
size?: number;
|
|
4
4
|
}) => import("react").JSX.Element;
|
|
5
5
|
export declare const I: {
|
|
6
|
+
id: string;
|
|
7
|
+
enter: string;
|
|
8
|
+
exit: string;
|
|
9
|
+
tree: string;
|
|
6
10
|
search: string;
|
|
7
11
|
x: string;
|
|
12
|
+
trash: string;
|
|
13
|
+
clear: string;
|
|
8
14
|
plus: string;
|
|
9
15
|
minus: string;
|
|
10
16
|
fit: string;
|
|
11
17
|
more: string;
|
|
12
|
-
|
|
13
|
-
error: string;
|
|
14
|
-
info: string;
|
|
18
|
+
checks: string;
|
|
15
19
|
arrow: string;
|
|
16
20
|
stack: string;
|
|
17
21
|
edit: string;
|
package/dist/react/input.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { NodeSingular, EdgeSingular } from 'cytoscape';
|
|
2
|
+
/** A graph element, or the id of a layer. */
|
|
3
|
+
export type PreviewTarget = NodeSingular | EdgeSingular | string;
|
|
1
4
|
interface InputActions {
|
|
2
5
|
interact(): void;
|
|
3
6
|
cancelFly(): void;
|
|
4
7
|
select(target: any | null): void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
preview(target: any | null): void;
|
|
8
|
+
hover?(target: PreviewTarget | null): void;
|
|
9
|
+
preview(target: PreviewTarget | null): void;
|
|
8
10
|
focus?(id: string): void;
|
|
9
11
|
}
|
|
10
12
|
export declare function installGraphInput(cy: any, el: HTMLElement, actions: InputActions): () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GraphView } from '../view.js';
|
|
2
|
+
import type { GraphCanvasProps } from './GraphCanvas.js';
|
|
3
|
+
/** Both sides cross the same boundary independently. The original models stay
|
|
4
|
+
* available for navigation, validation and editing, including cross-boundary edges. */
|
|
5
|
+
export declare function useSubgraph(props: GraphCanvasProps, view: GraphView, force: boolean): {
|
|
6
|
+
active: boolean;
|
|
7
|
+
before: import("..").GraphModel | undefined;
|
|
8
|
+
after: import("..").GraphModel;
|
|
9
|
+
current: import("..").GraphModel;
|
|
10
|
+
model: import("..").GraphModel;
|
|
11
|
+
delta: import("..").GraphDelta | null;
|
|
12
|
+
profile: import("..").GraphProfile;
|
|
13
|
+
origins: string[];
|
|
14
|
+
canForce: boolean;
|
|
15
|
+
};
|
package/dist/shell.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shellArg: (s: string) => string;
|
package/dist/strings.d.ts
CHANGED
|
@@ -30,8 +30,18 @@ export interface GraphStrings {
|
|
|
30
30
|
more: string;
|
|
31
31
|
origins: string;
|
|
32
32
|
allOrigins: string;
|
|
33
|
+
viewSubtree?: string;
|
|
34
|
+
viewSubtreeTip?: string;
|
|
35
|
+
exitScopeLabel?: string;
|
|
36
|
+
exitScope?: string;
|
|
37
|
+
absentNode?: string;
|
|
38
|
+
absentSource?: string;
|
|
39
|
+
enteredScope?: string;
|
|
40
|
+
leftScope?: string;
|
|
41
|
+
noLocalFloors?: string;
|
|
42
|
+
issuesBySource?: (review: number, lint: number) => string;
|
|
33
43
|
issuesTip: (errors: number, warns: number, infos?: number) => string;
|
|
34
|
-
issuesTitle: (errors: number, warns: number, infos?: number) => string;
|
|
44
|
+
issuesTitle: (errors: number, warns: number, infos?: number, groups?: number) => string;
|
|
35
45
|
moreItems: (n: number) => string;
|
|
36
46
|
cameraTip: string;
|
|
37
47
|
zoomIn: string;
|
|
@@ -53,6 +63,14 @@ export interface GraphStrings {
|
|
|
53
63
|
legendSize: string;
|
|
54
64
|
legendReset: string;
|
|
55
65
|
node: string;
|
|
66
|
+
edge?: string;
|
|
67
|
+
back?: string;
|
|
68
|
+
showLess?: string;
|
|
69
|
+
position?: string;
|
|
70
|
+
inEdges?: string;
|
|
71
|
+
outEdges?: string;
|
|
72
|
+
beforeSibling?: string;
|
|
73
|
+
lastSibling?: string;
|
|
56
74
|
/** A selected node with nothing to show beyond its name. */
|
|
57
75
|
noDetails: string;
|
|
58
76
|
close: string;
|
|
@@ -61,10 +79,13 @@ export interface GraphStrings {
|
|
|
61
79
|
/** The canvas ⋯ menu: lay out the same data again. */
|
|
62
80
|
relayout: string;
|
|
63
81
|
restructure: string;
|
|
82
|
+
restructureFull?: string;
|
|
64
83
|
edit: string;
|
|
65
84
|
editNode: string;
|
|
66
85
|
newNode: string;
|
|
67
86
|
newEdge: string;
|
|
87
|
+
editEdge?: string;
|
|
88
|
+
clearField?: string;
|
|
68
89
|
id: string;
|
|
69
90
|
idHint: string;
|
|
70
91
|
parent: string;
|
|
@@ -86,4 +107,4 @@ export interface GraphStrings {
|
|
|
86
107
|
confirmRemove: (edges: number) => string;
|
|
87
108
|
error: Record<EditError, string>;
|
|
88
109
|
}
|
|
89
|
-
export declare const EN: GraphStrings
|
|
110
|
+
export declare const EN: Required<GraphStrings>;
|
package/dist/style.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ export declare function diffStyle(theme?: GraphTheme): any[];
|
|
|
138
138
|
export declare function chromeStyle(theme: GraphTheme): {
|
|
139
139
|
colorScheme: string;
|
|
140
140
|
};
|
|
141
|
+
/** Shared by canvas focus dimming and SVG plate highlights. */
|
|
142
|
+
export declare const HOVER_FADE_MS = 160;
|
|
141
143
|
/** Styles for host UI (toolbar / detail panel). CSS variables the host can override, with defaults,
|
|
142
144
|
* so an offline single-file page looks good without configuring any. */
|
|
143
145
|
export declare const GK_CSS: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type GraphModel } from './model.js';
|
|
2
|
+
import type { GraphView } from './view.js';
|
|
3
|
+
/** Resolve against one version, before layout or diff. Parent pointers beyond the
|
|
4
|
+
* boundary belong to the full detail/edit model, never to the local layout. */
|
|
5
|
+
export declare function projectSubgraph(model: GraphModel, view: Pick<GraphView, 'subtree' | 'origins'>): GraphModel;
|
|
6
|
+
/** Derive floors inside the boundary. Suppressing the anchor is a presentation
|
|
7
|
+
* decision and never removes it from a comparison or from the source graph. */
|
|
8
|
+
export declare function subgraphFloors(model: GraphModel, colors: string[], force: boolean): {
|
|
9
|
+
model: GraphModel;
|
|
10
|
+
layers: import("./profile.js").LayerSpec[];
|
|
11
|
+
layerOf: Map<string, string>;
|
|
12
|
+
anchor?: string;
|
|
13
|
+
};
|
package/dist/tree.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Native ordered tree fragments. Collect facts by id before materializing a forest. */
|
|
2
2
|
import { type GraphModel, type GraphNode, type GraphSlice, type NodeDeclaration } from './model.js';
|
|
3
|
+
export declare const stableJson: (x: unknown) => string;
|
|
3
4
|
export declare function treeDeclarations(raw: unknown, origin: string): Pick<GraphSlice, 'declarations' | 'rootIds' | 'error'>;
|
|
4
5
|
/** Own fields only: descendants must never be copied into an ancestor's diff payload. */
|
|
5
6
|
export declare function treeNodes(declarations?: NodeDeclaration[]): GraphNode[];
|
package/dist/view.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type GraphModel } from './model.js';
|
|
2
2
|
import { type CyElement } from './elements.js';
|
|
3
3
|
export interface GraphView {
|
|
4
|
+
/** Follow this node and its descendants across passes. Takes precedence over origins. */
|
|
5
|
+
subtree?: string | null;
|
|
4
6
|
/** Visible layer ids; null/omitted = all. In a multi-layer graph (see `planeView`): exactly one layer when not stacked;
|
|
5
7
|
* when stacked (`planes`) any number of layers, in declaration order; all selected is null. */
|
|
6
8
|
layers?: string[] | null;
|
|
@@ -33,7 +35,7 @@ export declare function planeView(v: GraphView, layers: {
|
|
|
33
35
|
}[]): GraphView;
|
|
34
36
|
/** Whether the view filters anything (decides whether to take the "everything visible" fast path). */
|
|
35
37
|
export declare function isFiltering(v: GraphView): boolean;
|
|
36
|
-
/** Whether a "piece cut out" of the graph is being viewed (by source). Only such subviews
|
|
38
|
+
/** Whether a "piece cut out" of the graph is being viewed (by source). Only such subviews have independent layouts; viewing one layer does not count:
|
|
37
39
|
* a layer is another way of looking at the same coordinates, and tightening would not match when switching back. */
|
|
38
40
|
export declare function isNarrowing(v: GraphView): boolean;
|
|
39
41
|
/** Keep only sources that really exist in this data; none left means no filter (null). Unchanged returns as is (same reference,
|
package/package.json
CHANGED