@kgdiff/viewer 0.4.0 → 0.6.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/README.md +43 -16
- package/custom-elements.json +2347 -0
- package/dist/bind.d.ts +41 -0
- package/dist/bind.d.ts.map +1 -0
- package/dist/bind.js +47 -0
- package/dist/bind.js.map +1 -0
- package/dist/context.d.ts +42 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +87 -0
- package/dist/context.js.map +1 -0
- package/dist/controller.d.ts +26 -237
- package/dist/controller.d.ts.map +1 -1
- package/dist/controller.js +33 -1484
- package/dist/controller.js.map +1 -1
- package/dist/dom.d.ts +10 -0
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +29 -0
- package/dist/dom.js.map +1 -1
- package/dist/element.d.ts +51 -42
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +381 -602
- package/dist/element.js.map +1 -1
- package/dist/elements/actions.d.ts +27 -0
- package/dist/elements/actions.d.ts.map +1 -0
- package/dist/elements/actions.js +81 -0
- package/dist/elements/actions.js.map +1 -0
- package/dist/elements/bound.d.ts +63 -0
- package/dist/elements/bound.d.ts.map +1 -0
- package/dist/elements/bound.js +213 -0
- package/dist/elements/bound.js.map +1 -0
- package/dist/elements/change-detail.d.ts +25 -0
- package/dist/elements/change-detail.d.ts.map +1 -0
- package/dist/elements/change-detail.js +19 -0
- package/dist/elements/change-detail.js.map +1 -0
- package/dist/elements/change-list.d.ts +27 -0
- package/dist/elements/change-list.d.ts.map +1 -0
- package/dist/elements/change-list.js +29 -0
- package/dist/elements/change-list.js.map +1 -0
- package/dist/elements/filters.d.ts +25 -0
- package/dist/elements/filters.d.ts.map +1 -0
- package/dist/elements/filters.js +19 -0
- package/dist/elements/filters.js.map +1 -0
- package/dist/elements/legend.d.ts +40 -0
- package/dist/elements/legend.d.ts.map +1 -0
- package/dist/elements/legend.js +87 -0
- package/dist/elements/legend.js.map +1 -0
- package/dist/elements/minimap.d.ts +38 -0
- package/dist/elements/minimap.d.ts.map +1 -0
- package/dist/elements/minimap.js +59 -0
- package/dist/elements/minimap.js.map +1 -0
- package/dist/elements/root.d.ts +40 -0
- package/dist/elements/root.d.ts.map +1 -0
- package/dist/elements/root.js +67 -0
- package/dist/elements/root.js.map +1 -0
- package/dist/elements/search.d.ts +29 -0
- package/dist/elements/search.d.ts.map +1 -0
- package/dist/elements/search.js +23 -0
- package/dist/elements/search.js.map +1 -0
- package/dist/elements/stage-context.d.ts +31 -0
- package/dist/elements/stage-context.d.ts.map +1 -0
- package/dist/elements/stage-context.js +4 -0
- package/dist/elements/stage-context.js.map +1 -0
- package/dist/elements/stage.d.ts +65 -0
- package/dist/elements/stage.d.ts.map +1 -0
- package/dist/elements/stage.js +259 -0
- package/dist/elements/stage.js.map +1 -0
- package/dist/elements/title.d.ts +25 -0
- package/dist/elements/title.d.ts.map +1 -0
- package/dist/elements/title.js +19 -0
- package/dist/elements/title.js.map +1 -0
- package/dist/elements/transport.d.ts +29 -0
- package/dist/elements/transport.d.ts.map +1 -0
- package/dist/elements/transport.js +24 -0
- package/dist/elements/transport.js.map +1 -0
- package/dist/elements/view-bound.d.ts +39 -0
- package/dist/elements/view-bound.d.ts.map +1 -0
- package/dist/elements/view-bound.js +88 -0
- package/dist/elements/view-bound.js.map +1 -0
- package/dist/elements/view-dock.d.ts +28 -0
- package/dist/elements/view-dock.d.ts.map +1 -0
- package/dist/elements/view-dock.js +28 -0
- package/dist/elements/view-dock.js.map +1 -0
- package/dist/elements/zoom.d.ts +28 -0
- package/dist/elements/zoom.d.ts.map +1 -0
- package/dist/elements/zoom.js +22 -0
- package/dist/elements/zoom.js.map +1 -0
- package/dist/i18n.d.ts +10 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +20 -0
- package/dist/i18n.js.map +1 -1
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +331 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/keyboard.d.ts +39 -2
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/keyboard.js +145 -62
- package/dist/keyboard.js.map +1 -1
- package/dist/layout-store.d.ts +26 -0
- package/dist/layout-store.d.ts.map +1 -0
- package/dist/layout-store.js +46 -0
- package/dist/layout-store.js.map +1 -0
- package/dist/panel-levels.d.ts +18 -0
- package/dist/panel-levels.d.ts.map +1 -0
- package/dist/panel-levels.js +41 -0
- package/dist/panel-levels.js.map +1 -0
- package/dist/panels.d.ts +28 -0
- package/dist/panels.d.ts.map +1 -0
- package/dist/panels.js +73 -0
- package/dist/panels.js.map +1 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +3 -2
- package/dist/pipeline.js.map +1 -1
- package/dist/prefs.d.ts +5 -2
- package/dist/prefs.d.ts.map +1 -1
- package/dist/prefs.js +12 -3
- package/dist/prefs.js.map +1 -1
- package/dist/react.d.ts +460 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +2 -0
- package/dist/react.js.map +1 -0
- package/dist/root-element.d.ts +122 -0
- package/dist/root-element.d.ts.map +1 -0
- package/dist/root-element.js +541 -0
- package/dist/root-element.js.map +1 -0
- package/dist/root.d.ts +54 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +288 -0
- package/dist/root.js.map +1 -0
- package/dist/schedule.d.ts +22 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/schedule.js +41 -0
- package/dist/schedule.js.map +1 -0
- package/dist/session.d.ts +269 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +1237 -0
- package/dist/session.js.map +1 -0
- package/dist/standalone/kgdiff-viewer-compute.js +1 -1
- package/dist/standalone/kgdiff-viewer.js +4 -4
- package/dist/styles.d.ts +17 -6
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +367 -258
- package/dist/styles.js.map +1 -1
- package/dist/theme.d.ts +32 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +152 -0
- package/dist/theme.js.map +1 -0
- package/dist/topics.d.ts +8 -0
- package/dist/topics.d.ts.map +1 -0
- package/dist/topics.js +18 -0
- package/dist/topics.js.map +1 -0
- package/dist/ui/change-list.d.ts +18 -0
- package/dist/ui/change-list.d.ts.map +1 -0
- package/dist/ui/change-list.js +331 -0
- package/dist/ui/change-list.js.map +1 -0
- package/dist/ui/context.d.ts +34 -7
- package/dist/ui/context.d.ts.map +1 -1
- package/dist/ui/context.js.map +1 -1
- package/dist/ui/filters.d.ts +9 -0
- package/dist/ui/filters.d.ts.map +1 -0
- package/dist/ui/filters.js +68 -0
- package/dist/ui/filters.js.map +1 -0
- package/dist/ui/header.d.ts +41 -3
- package/dist/ui/header.d.ts.map +1 -1
- package/dist/ui/header.js +101 -36
- package/dist/ui/header.js.map +1 -1
- package/dist/ui/legend.d.ts +15 -0
- package/dist/ui/legend.d.ts.map +1 -0
- package/dist/ui/legend.js +68 -0
- package/dist/ui/legend.js.map +1 -0
- package/dist/ui/popovers.d.ts +3 -1
- package/dist/ui/popovers.d.ts.map +1 -1
- package/dist/ui/popovers.js +62 -23
- package/dist/ui/popovers.js.map +1 -1
- package/dist/ui/search.d.ts +13 -0
- package/dist/ui/search.d.ts.map +1 -0
- package/dist/ui/search.js +192 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/sidebar.d.ts +32 -17
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +327 -519
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/stage.d.ts +56 -1
- package/dist/ui/stage.d.ts.map +1 -1
- package/dist/ui/stage.js +244 -256
- package/dist/ui/stage.js.map +1 -1
- package/dist/ui/swatch.js +1 -1
- package/dist/ui/swatch.js.map +1 -1
- package/dist/ui/transport.d.ts +12 -0
- package/dist/ui/transport.d.ts.map +1 -0
- package/dist/ui/transport.js +198 -0
- package/dist/ui/transport.js.map +1 -0
- package/dist/ui/zoom.d.ts +15 -0
- package/dist/ui/zoom.d.ts.map +1 -0
- package/dist/ui/zoom.js +30 -0
- package/dist/ui/zoom.js.map +1 -0
- package/dist/view.d.ts +94 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +441 -0
- package/dist/view.js.map +1 -0
- package/package.json +95 -12
- package/src/bind.ts +80 -0
- package/src/context.ts +106 -0
- package/src/controller.ts +52 -1630
- package/src/dom.ts +30 -0
- package/src/element.ts +386 -619
- package/src/elements/actions.ts +94 -0
- package/src/elements/bound.ts +247 -0
- package/src/elements/change-detail.ts +34 -0
- package/src/elements/change-list.ts +51 -0
- package/src/elements/filters.ts +34 -0
- package/src/elements/legend.ts +103 -0
- package/src/elements/minimap.ts +75 -0
- package/src/elements/root.ts +86 -0
- package/src/elements/search.ts +38 -0
- package/src/elements/stage-context.ts +34 -0
- package/src/elements/stage.ts +285 -0
- package/src/elements/title.ts +34 -0
- package/src/elements/transport.ts +39 -0
- package/src/elements/view-bound.ts +118 -0
- package/src/elements/view-dock.ts +43 -0
- package/src/elements/zoom.ts +38 -0
- package/src/i18n.ts +20 -0
- package/src/icons.ts +1 -0
- package/src/index.ts +350 -35
- package/src/keyboard.ts +188 -61
- package/src/layout-store.ts +71 -0
- package/src/panel-levels.ts +53 -0
- package/src/panels.ts +81 -0
- package/src/pipeline.ts +4 -1
- package/src/prefs.ts +12 -4
- package/src/react.ts +459 -0
- package/src/root-element.ts +624 -0
- package/src/root.ts +335 -0
- package/src/schedule.ts +43 -0
- package/src/session.ts +1375 -0
- package/src/styles.ts +396 -263
- package/src/theme.ts +170 -0
- package/src/topics.ts +37 -0
- package/src/ui/change-list.ts +405 -0
- package/src/ui/context.ts +36 -7
- package/src/ui/filters.ts +79 -0
- package/src/ui/header.ts +129 -58
- package/src/ui/legend.ts +112 -0
- package/src/ui/popovers.ts +68 -25
- package/src/ui/search.ts +225 -0
- package/src/ui/sidebar.ts +362 -639
- package/src/ui/stage.ts +267 -331
- package/src/ui/swatch.ts +1 -1
- package/src/ui/transport.ts +240 -0
- package/src/ui/zoom.ts +45 -0
- package/src/view.ts +516 -0
- package/vscode.html-custom-data.json +726 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The diff session (RFC 0001 §1): everything about one loaded diff that does not depend on how
|
|
3
|
+
* it is drawn.
|
|
4
|
+
*
|
|
5
|
+
* - load pipeline with progress steps (sources or a precomputed report);
|
|
6
|
+
* - view (mode × scope), selection (with an animated spotlight `emphasis`), hover, family
|
|
7
|
+
* filters, the node search query and its hits, review progress;
|
|
8
|
+
* - the `changes` scope's focus with expandable collapsed groups (`extendLayout` + scene rebuild);
|
|
9
|
+
* - replay clock and loop, swipe position, theme / palette / locale (rebuilding the scene when
|
|
10
|
+
* they change), and the events reported to the host.
|
|
11
|
+
*
|
|
12
|
+
* No DOM, no renderer: the views that draw the session (`SessionView`: the canvas with its
|
|
13
|
+
* camera, framing and minimap) are told what to draw and what to bring into view. One frame loop
|
|
14
|
+
* advances the replay clock and the emphasis and lets the views draw; it sleeps when idle.
|
|
15
|
+
* Listeners subscribe to topic notifications (batched per microtask) and read public fields.
|
|
16
|
+
*/
|
|
17
|
+
import type { DiffResult, DiffStats, Locale, Rect, UnionId } from '@kgdiff/core';
|
|
18
|
+
import type { LayoutResult } from '@kgdiff/layout';
|
|
19
|
+
import { type ChangeFamily, type FocusState, type Layer, type PaletteName, type Scene, type Theme, type ThemeName, type ViewState, type VisualResolver } from '@kgdiff/scene';
|
|
20
|
+
import type { LoadOptions, ReportPayload, ReviewState, ThemePreference, ViewerMode, ViewerScope } from './index.js';
|
|
21
|
+
import { type ListModel } from './list-model.js';
|
|
22
|
+
import { type LoadedDiff, type LoadStep } from './pipeline.js';
|
|
23
|
+
import { LEGACY_CHANGES_MODE } from './prefs.js';
|
|
24
|
+
import { ReplayClock } from './replay.js';
|
|
25
|
+
import { type StorageLike } from './review-store.js';
|
|
26
|
+
import { type SearchHit } from './search.js';
|
|
27
|
+
import { type Topic } from './topics.js';
|
|
28
|
+
export type Status = 'idle' | 'loading' | 'ready' | 'error';
|
|
29
|
+
export type { Topic } from './topics.js';
|
|
30
|
+
export { ALL_TOPICS } from './topics.js';
|
|
31
|
+
/** What the session reports (`<kgdiff-viewer>` turns these into events and announcements). */
|
|
32
|
+
export interface SessionHost {
|
|
33
|
+
ready(stats: DiffStats): void;
|
|
34
|
+
select(hunk: string | null, node: string | null): void;
|
|
35
|
+
mode(mode: ViewerMode, scope: ViewerScope): void;
|
|
36
|
+
review(hunk: string, reviewed: boolean, progress: ReviewState): void;
|
|
37
|
+
error(error: Error): void;
|
|
38
|
+
announce(text: string): void;
|
|
39
|
+
/** Playback reached the end of the replay; `loop`: it starts again after the loop delay. */
|
|
40
|
+
replayEnd(loop: boolean): void;
|
|
41
|
+
}
|
|
42
|
+
export interface SessionDeps {
|
|
43
|
+
readonly now: () => number;
|
|
44
|
+
readonly requestFrame: (cb: (time: number) => void) => number;
|
|
45
|
+
readonly cancelFrame: (id: number) => void;
|
|
46
|
+
/** Resolves once the browser had a chance to paint (between loading steps). */
|
|
47
|
+
readonly yieldToPaint: () => Promise<void>;
|
|
48
|
+
readonly storage: StorageLike | null;
|
|
49
|
+
/**
|
|
50
|
+
* The theme to draw with, given the built-in one for the current theme and palette. A root
|
|
51
|
+
* builds it from its computed CSS tokens (the theme's source of truth); without it the
|
|
52
|
+
* built-in theme is used as it is.
|
|
53
|
+
*/
|
|
54
|
+
readonly theme?: (base: Theme) => Theme;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A view of the session: something that draws it (the canvas, with its camera, framing and
|
|
58
|
+
* minimap). The session tells its views what changed and what to bring into view; how they
|
|
59
|
+
* draw and frame it is theirs.
|
|
60
|
+
*/
|
|
61
|
+
export interface SessionView {
|
|
62
|
+
/** Draw the session's current state (from the frame loop, when something changed). */
|
|
63
|
+
draw(now: number): void;
|
|
64
|
+
/** The scene was rebuilt, or the theme changed without a scene. */
|
|
65
|
+
sceneChanged(): void;
|
|
66
|
+
/** A new diff was installed: frame it once laid out. */
|
|
67
|
+
installed(): void;
|
|
68
|
+
/** What is drawn changed (mode, scope, focus, filters). */
|
|
69
|
+
drawnChanged(): void;
|
|
70
|
+
/** Bring `bounds` (world coordinates) into view. */
|
|
71
|
+
show(bounds: Rect): void;
|
|
72
|
+
/** Replay follows `bounds`: bring it into view unless it mostly is, or the user steered. */
|
|
73
|
+
follow(bounds: Rect): void;
|
|
74
|
+
/** A looping replay started again. */
|
|
75
|
+
looped(): void;
|
|
76
|
+
/** The world region in view, or null before layout. */
|
|
77
|
+
viewport(): Rect | null;
|
|
78
|
+
/** Fit everything visible into view (labels included); views without a camera need none. */
|
|
79
|
+
fit?(options?: {
|
|
80
|
+
readonly animate?: boolean;
|
|
81
|
+
readonly padding?: number;
|
|
82
|
+
}): Promise<void>;
|
|
83
|
+
/** Zoom in (1) or out (-1) one step. */
|
|
84
|
+
zoom?(direction: 1 | -1): void;
|
|
85
|
+
}
|
|
86
|
+
export type Preference = 'mode' | 'scope' | 'theme' | 'palette' | 'locale';
|
|
87
|
+
/** Search hits kept for a query. */
|
|
88
|
+
export declare const SEARCH_LIMIT = 50;
|
|
89
|
+
export declare class DiffSession {
|
|
90
|
+
#private;
|
|
91
|
+
status: Status;
|
|
92
|
+
/** Steps of the current load, in order; `step` is the running one. */
|
|
93
|
+
steps: LoadStep[];
|
|
94
|
+
step: LoadStep | null;
|
|
95
|
+
error: Error | null;
|
|
96
|
+
data: LoadedDiff | null;
|
|
97
|
+
layout: LayoutResult | null;
|
|
98
|
+
scene: Scene | null;
|
|
99
|
+
resolver: VisualResolver | null;
|
|
100
|
+
list: ListModel;
|
|
101
|
+
mode: ViewerMode;
|
|
102
|
+
scope: ViewerScope;
|
|
103
|
+
themePreference: ThemePreference;
|
|
104
|
+
palette: PaletteName;
|
|
105
|
+
locale: Locale;
|
|
106
|
+
systemDark: boolean;
|
|
107
|
+
reducedMotion: boolean;
|
|
108
|
+
/** Preferences set explicitly by the embedder (a report's `view` does not override them). */
|
|
109
|
+
readonly explicit: Set<Preference>;
|
|
110
|
+
selectedHunk: number;
|
|
111
|
+
selectedNode: number;
|
|
112
|
+
/** An edge emphasized from the detail panel (drawn as hovered). */
|
|
113
|
+
pinnedEdge: number;
|
|
114
|
+
hoverNode: number;
|
|
115
|
+
hoverEdge: number;
|
|
116
|
+
hoverGroup: number;
|
|
117
|
+
readonly families: Set<ChangeFamily>;
|
|
118
|
+
/** The node search as typed; while it is not blank, `hits` replace the change list. */
|
|
119
|
+
query: string;
|
|
120
|
+
hits: readonly SearchHit[];
|
|
121
|
+
hops: number;
|
|
122
|
+
readonly expanded: Set<string>;
|
|
123
|
+
focus: FocusState | null;
|
|
124
|
+
clock: ReplayClock | null;
|
|
125
|
+
split: number;
|
|
126
|
+
emphasis: number;
|
|
127
|
+
constructor(host: SessionHost, deps: SessionDeps);
|
|
128
|
+
subscribe(listener: (topics: ReadonlySet<Topic>) => void): () => void;
|
|
129
|
+
/** @internal Queue a notification (views report what they derive, e.g. `overview`). */
|
|
130
|
+
notify(...topics: Topic[]): void;
|
|
131
|
+
/** Deliver pending notifications now (also used by tests). */
|
|
132
|
+
flush(): void;
|
|
133
|
+
/** Draw on `view` from now on; returns the function that stops it. */
|
|
134
|
+
addView(view: SessionView): () => void;
|
|
135
|
+
/** @internal The session's clock (`SessionDeps.now`), for its views. */
|
|
136
|
+
now(): number;
|
|
137
|
+
/** Fit what is drawn into every view (each frames it on its own canvas). */
|
|
138
|
+
fit(options?: {
|
|
139
|
+
readonly animate?: boolean;
|
|
140
|
+
readonly padding?: number;
|
|
141
|
+
}): Promise<void>;
|
|
142
|
+
/** Zoom every view one step in (1) or out (-1): the keyboard's `+` / `−`. */
|
|
143
|
+
zoom(direction: 1 | -1): void;
|
|
144
|
+
get themeName(): ThemeName;
|
|
145
|
+
/** The theme to draw with: the built-in one for theme and palette, as the root's CSS says. */
|
|
146
|
+
get theme(): Theme;
|
|
147
|
+
get diff(): DiffResult | null;
|
|
148
|
+
get hunkCount(): number;
|
|
149
|
+
isReviewed(hunkId: string): boolean;
|
|
150
|
+
reviewState(): ReviewState;
|
|
151
|
+
search(query: string, limit?: number): SearchHit[];
|
|
152
|
+
/** Search the nodes for `query`; delivered at once, so the results follow every keystroke. */
|
|
153
|
+
setQuery(query: string): void;
|
|
154
|
+
load(options: LoadOptions): Promise<void>;
|
|
155
|
+
loadPayload(payload: ReportPayload): Promise<void>;
|
|
156
|
+
/** Show an error state (bad payload, failed load). */
|
|
157
|
+
fail(error: Error): void;
|
|
158
|
+
destroy(): void;
|
|
159
|
+
/** Redraw on the next frame. */
|
|
160
|
+
invalidate(): void;
|
|
161
|
+
/** @internal Drop the pending frame (the views are gone); `invalidate` wakes the loop. */
|
|
162
|
+
sleep(): void;
|
|
163
|
+
/** What a view draws for `layer` now. */
|
|
164
|
+
viewState(layer: Layer): ViewState;
|
|
165
|
+
/** Whether the scope is fixed to `changes` (the layout covers only the changes). */
|
|
166
|
+
get scopeLocked(): boolean;
|
|
167
|
+
/** Switch how the versions are compared. The legacy `changes` means overlay + `changes` scope. */
|
|
168
|
+
setMode(value: ViewerMode | typeof LEGACY_CHANGES_MODE): void;
|
|
169
|
+
/** Show the whole graph or only the changes, in any mode. */
|
|
170
|
+
setScope(value: ViewerScope): void;
|
|
171
|
+
/** Toggle the `changes` scope (key `4`); says why when the scope is locked. */
|
|
172
|
+
toggleScope(): void;
|
|
173
|
+
/** Set mode and scope together (one notification, one `kgdiff-mode` event). */
|
|
174
|
+
setView(mode: ViewerMode, scope: ViewerScope): void;
|
|
175
|
+
selectHunkById(id: string | null, options?: {
|
|
176
|
+
fly?: boolean;
|
|
177
|
+
}): void;
|
|
178
|
+
/**
|
|
179
|
+
* Select hunk `h` (scene index; -1 clears). `node` focuses one of its nodes in the detail
|
|
180
|
+
* panel. `fly` (default true) brings it into view. In replay, seeks to the end of its window.
|
|
181
|
+
*/
|
|
182
|
+
selectHunk(h: number, options?: {
|
|
183
|
+
fly?: boolean;
|
|
184
|
+
node?: number;
|
|
185
|
+
}): void;
|
|
186
|
+
/** Select a node: its hunk when it has one, else the node itself. */
|
|
187
|
+
selectNode(i: number, options?: {
|
|
188
|
+
fly?: boolean;
|
|
189
|
+
}): void;
|
|
190
|
+
clearSelection(): void;
|
|
191
|
+
next(): void;
|
|
192
|
+
prev(): void;
|
|
193
|
+
first(): void;
|
|
194
|
+
last(): void;
|
|
195
|
+
/** Emphasize an edge (from the detail panel) and fly to it. */
|
|
196
|
+
pinEdge(j: number): void;
|
|
197
|
+
setHover(node: number, edge: number, group: number): void;
|
|
198
|
+
/** Clear hover state (pointer left the canvas). */
|
|
199
|
+
clearHover(): void;
|
|
200
|
+
/** Where the current selection is (world coordinates), or null. */
|
|
201
|
+
selectionBounds(): Rect | null;
|
|
202
|
+
flyToHunk(h: number): void;
|
|
203
|
+
flyToNode(i: number): void;
|
|
204
|
+
flyToSelection(): void;
|
|
205
|
+
toggleFamily(family: ChangeFamily): void;
|
|
206
|
+
/** Replace the family filter (empty = all). Setting the current set again clears it. */
|
|
207
|
+
setFamilies(families: readonly ChangeFamily[]): void;
|
|
208
|
+
setHops(hops: number): void;
|
|
209
|
+
/**
|
|
210
|
+
* Expand collapsed group `index` of the current focus: its in-scene members become visible
|
|
211
|
+
* and, for a `changes`-scoped layout, the neighbours left out of the layout are placed with
|
|
212
|
+
* `extendLayout` (nothing already placed moves) and the scene is rebuilt.
|
|
213
|
+
*/
|
|
214
|
+
expandGroup(index: number): void;
|
|
215
|
+
/**
|
|
216
|
+
* The collapsed group nearest the selection (else the view center), or -1. Groups that can
|
|
217
|
+
* be expanded at least partly come first.
|
|
218
|
+
*/
|
|
219
|
+
nearestGroup(): number;
|
|
220
|
+
/** Expand the group nearest the selection (keyboard `e`); announces what happened. */
|
|
221
|
+
expandNearest(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Whether collapsed group `index` can be expanded completely: always, unless some members lie
|
|
224
|
+
* outside a `changes`-scoped layout and the layout engine is known to be unavailable
|
|
225
|
+
* (standalone report without the compute add-on).
|
|
226
|
+
*/
|
|
227
|
+
canExpand(index: number): boolean;
|
|
228
|
+
/** Bring a union node into the scene and the focus (search results), then select it. */
|
|
229
|
+
revealNode(id: UnionId): Promise<void>;
|
|
230
|
+
play(): void;
|
|
231
|
+
/** Pause; a looping replay stays paused (until `play`, a new diff or loop turned on again). */
|
|
232
|
+
pause(): void;
|
|
233
|
+
togglePlay(): void;
|
|
234
|
+
/**
|
|
235
|
+
* Play the replay over and over: `delay` ms after it ends it starts again; null plays it
|
|
236
|
+
* once. Turning the loop on starts a replay that is shown but not playing.
|
|
237
|
+
*/
|
|
238
|
+
setLoop(delay: number | null): void;
|
|
239
|
+
get loopDelay(): number | null;
|
|
240
|
+
/**
|
|
241
|
+
* Hold playback while the pointer rests on the graph (`pause-on-hover`): a playing replay
|
|
242
|
+
* pauses and continues on release; a pending loop restart waits for the release, then the
|
|
243
|
+
* full loop delay.
|
|
244
|
+
*/
|
|
245
|
+
hold(held: boolean): void;
|
|
246
|
+
seek(t: number): void;
|
|
247
|
+
stepReplay(direction: 1 | -1): void;
|
|
248
|
+
restart(): void;
|
|
249
|
+
cycleSpeed(): void;
|
|
250
|
+
setSpeed(speed: number): void;
|
|
251
|
+
setSplit(split: number): void;
|
|
252
|
+
setReviewed(hunkId: string, reviewed: boolean): void;
|
|
253
|
+
/** Another tab changed review progress (`storage` event): re-read it. */
|
|
254
|
+
syncReview(key: string | null): void;
|
|
255
|
+
toggleReviewed(hunkId?: string): void;
|
|
256
|
+
/**
|
|
257
|
+
* @internal Read the theme again (`SessionDeps.theme`: the root's CSS tokens changed, e.g.
|
|
258
|
+
* the host overrode one); redraws only when the result changed.
|
|
259
|
+
*/
|
|
260
|
+
refreshTheme(): void;
|
|
261
|
+
setThemePreference(pref: ThemePreference): void;
|
|
262
|
+
setPalette(palette: PaletteName): void;
|
|
263
|
+
setLocale(locale: Locale): void;
|
|
264
|
+
setSystemDark(dark: boolean): void;
|
|
265
|
+
setReducedMotion(reduced: boolean): void;
|
|
266
|
+
}
|
|
267
|
+
/** Pad a small rect so a node is shown with its neighbourhood. */
|
|
268
|
+
export declare function padRect(r: Rect, min?: number, ratio?: number): Rect;
|
|
269
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAEL,KAAK,YAAY,EAIjB,KAAK,UAAU,EAGf,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAyB,KAAK,SAAS,EAAY,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAwB,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAiD,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS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