@pierre/diffs 1.1.20 → 1.2.0-beta.1
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/dist/components/CodeView.d.ts +325 -0
- package/dist/components/CodeView.d.ts.map +1 -0
- package/dist/components/CodeView.js +1252 -0
- package/dist/components/CodeView.js.map +1 -0
- package/dist/components/File.d.ts +13 -12
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +68 -28
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +9 -10
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +57 -30
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/FileStream.js +9 -3
- package/dist/components/FileStream.js.map +1 -1
- package/dist/components/VirtualizedFile.d.ts +28 -5
- package/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/dist/components/VirtualizedFile.js +225 -45
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.d.ts +28 -5
- package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +285 -49
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/components/Virtualizer.d.ts +6 -3
- package/dist/components/Virtualizer.d.ts.map +1 -1
- package/dist/components/Virtualizer.js +4 -6
- package/dist/components/Virtualizer.js.map +1 -1
- package/dist/components/VirtulizerDevelopment.d.ts +2 -2
- package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/dist/constants.d.ts +6 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +17 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +11 -10
- package/dist/managers/InteractionManager.d.ts +11 -7
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/InteractionManager.js +38 -25
- package/dist/managers/InteractionManager.js.map +1 -1
- package/dist/managers/ResizeManager.d.ts +4 -4
- package/dist/managers/ResizeManager.d.ts.map +1 -1
- package/dist/managers/ResizeManager.js +89 -54
- package/dist/managers/ResizeManager.js.map +1 -1
- package/dist/managers/UniversalRenderingManager.d.ts +2 -1
- package/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
- package/dist/managers/UniversalRenderingManager.js +13 -16
- package/dist/managers/UniversalRenderingManager.js.map +1 -1
- package/dist/react/CodeView.d.ts +45 -0
- package/dist/react/CodeView.d.ts.map +1 -0
- package/dist/react/CodeView.js +241 -0
- package/dist/react/CodeView.js.map +1 -0
- package/dist/react/File.d.ts +0 -1
- package/dist/react/File.d.ts.map +1 -1
- package/dist/react/File.js +2 -3
- package/dist/react/File.js.map +1 -1
- package/dist/react/FileDiff.d.ts +0 -1
- package/dist/react/FileDiff.d.ts.map +1 -1
- package/dist/react/FileDiff.js +3 -4
- package/dist/react/FileDiff.js.map +1 -1
- package/dist/react/MultiFileDiff.d.ts +0 -1
- package/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js +3 -4
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/PatchDiff.d.ts +0 -1
- package/dist/react/PatchDiff.d.ts.map +1 -1
- package/dist/react/PatchDiff.js +3 -4
- package/dist/react/PatchDiff.js.map +1 -1
- package/dist/react/UnresolvedFile.d.ts +0 -1
- package/dist/react/UnresolvedFile.d.ts.map +1 -1
- package/dist/react/UnresolvedFile.js +3 -4
- package/dist/react/UnresolvedFile.js.map +1 -1
- package/dist/react/constants.d.ts.map +1 -1
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +5 -4
- package/dist/react/jsx.d.ts.map +1 -1
- package/dist/react/types.d.ts +0 -8
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.d.ts +0 -2
- package/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
- package/dist/react/utils/renderDiffChildren.js +3 -4
- package/dist/react/utils/renderDiffChildren.js.map +1 -1
- package/dist/react/utils/renderFileChildren.d.ts +0 -2
- package/dist/react/utils/renderFileChildren.d.ts.map +1 -1
- package/dist/react/utils/renderFileChildren.js +3 -4
- package/dist/react/utils/renderFileChildren.js.map +1 -1
- package/dist/react/utils/useFileDiffInstance.js +12 -7
- package/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/dist/react/utils/useFileInstance.js +12 -7
- package/dist/react/utils/useFileInstance.js.map +1 -1
- package/dist/react/utils/useUnresolvedFileInstance.js +6 -2
- package/dist/react/utils/useUnresolvedFileInstance.js.map +1 -1
- package/dist/renderers/DiffHunksRenderer.d.ts +2 -1
- package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +35 -20
- package/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/dist/renderers/FileRenderer.d.ts +2 -1
- package/dist/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/renderers/FileRenderer.js +34 -20
- package/dist/renderers/FileRenderer.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/preloadDiffs.js +1 -1
- package/dist/style.js +1 -1
- package/dist/style.js.map +1 -1
- package/dist/types.d.ts +98 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/areManagedSnapshotsEqual.d.ts +7 -0
- package/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -0
- package/dist/utils/areManagedSnapshotsEqual.js +15 -0
- package/dist/utils/areManagedSnapshotsEqual.js.map +1 -0
- package/dist/utils/areOptionsEqual.d.ts +2 -1
- package/dist/utils/areOptionsEqual.d.ts.map +1 -1
- package/dist/utils/areOptionsEqual.js +1 -1
- package/dist/utils/areOptionsEqual.js.map +1 -1
- package/dist/utils/createFileHeaderElement.d.ts +3 -1
- package/dist/utils/createFileHeaderElement.d.ts.map +1 -1
- package/dist/utils/createFileHeaderElement.js +3 -2
- package/dist/utils/createFileHeaderElement.js.map +1 -1
- package/dist/utils/createWindowFromScrollPosition.d.ts +3 -3
- package/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
- package/dist/utils/createWindowFromScrollPosition.js +6 -6
- package/dist/utils/createWindowFromScrollPosition.js.map +1 -1
- package/dist/utils/iterateOverDiff.d.ts +2 -1
- package/dist/utils/iterateOverDiff.d.ts.map +1 -1
- package/dist/utils/iterateOverDiff.js +135 -7
- package/dist/utils/iterateOverDiff.js.map +1 -1
- package/dist/utils/renderFileWithHighlighter.js +1 -1
- package/dist/utils/resolveVirtualFileMetrics.d.ts +4 -1
- package/dist/utils/resolveVirtualFileMetrics.d.ts.map +1 -1
- package/dist/utils/resolveVirtualFileMetrics.js +11 -1
- package/dist/utils/resolveVirtualFileMetrics.js.map +1 -1
- package/dist/utils/roundToDevicePixel.d.ts +14 -0
- package/dist/utils/roundToDevicePixel.d.ts.map +1 -0
- package/dist/utils/roundToDevicePixel.js +18 -0
- package/dist/utils/roundToDevicePixel.js.map +1 -0
- package/dist/worker/worker-portable.js +195 -14
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +146 -7
- package/dist/worker/worker.js.map +1 -1
- package/package.json +7 -1
- package/dist/components/AdvancedVirtualizedFileDiff.d.ts +0 -40
- package/dist/components/AdvancedVirtualizedFileDiff.d.ts.map +0 -1
- package/dist/components/AdvancedVirtualizedFileDiff.js +0 -140
- package/dist/components/AdvancedVirtualizedFileDiff.js.map +0 -1
- package/dist/components/AdvancedVirtualizer.d.ts +0 -38
- package/dist/components/AdvancedVirtualizer.d.ts.map +0 -1
- package/dist/components/AdvancedVirtualizer.js +0 -201
- package/dist/components/AdvancedVirtualizer.js.map +0 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemVersion, CodeViewMetrics, CodeViewScrollTarget, HunkSeparators, SmoothScrollSettings, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
|
|
2
|
+
import { SelectedLineRange, SelectionWriteOptions } from "../managers/InteractionManager.js";
|
|
3
|
+
import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
|
|
4
|
+
import "../worker/index.js";
|
|
5
|
+
import { FileOptions } from "./File.js";
|
|
6
|
+
import { VirtualizerConfig } from "./Virtualizer.js";
|
|
7
|
+
import { VirtualizedFile } from "./VirtualizedFile.js";
|
|
8
|
+
import { VirtualizedFileDiff } from "./VirtualizedFileDiff.js";
|
|
9
|
+
import { FileDiffOptions } from "./FileDiff.js";
|
|
10
|
+
|
|
11
|
+
//#region src/components/CodeView.d.ts
|
|
12
|
+
interface AdvancedVirtualizedBaseItem {
|
|
13
|
+
/** Current index of this record in the ordered items array. */
|
|
14
|
+
index: number;
|
|
15
|
+
/** Absolute top offset of this item inside the scroll content. */
|
|
16
|
+
top: number;
|
|
17
|
+
/** Total measured height reserved for this item. */
|
|
18
|
+
height: number;
|
|
19
|
+
/** Root <diffs-container> node currently mounted for this item, only exists
|
|
20
|
+
* when rendered. */
|
|
21
|
+
element: HTMLElement | undefined;
|
|
22
|
+
/** Last controlled version observed for this record. */
|
|
23
|
+
version: CodeViewItemVersion | undefined;
|
|
24
|
+
}
|
|
25
|
+
interface CodeViewDiffItemContext<LAnnotation> extends AdvancedVirtualizedBaseItem {
|
|
26
|
+
type: 'diff';
|
|
27
|
+
/** Latest item snapshot for this record. Controlled updates can replace it. */
|
|
28
|
+
item: CodeViewDiffItem<LAnnotation>;
|
|
29
|
+
/** Virtualized diff instance responsible for rendering this item. */
|
|
30
|
+
instance: VirtualizedFileDiff<LAnnotation>;
|
|
31
|
+
}
|
|
32
|
+
interface CodeViewFileItemContext<LAnnotation> extends AdvancedVirtualizedBaseItem {
|
|
33
|
+
type: 'file';
|
|
34
|
+
/** Latest item snapshot for this record. Controlled updates can replace it. */
|
|
35
|
+
item: CodeViewFileItem<LAnnotation>;
|
|
36
|
+
/** Virtualized file instance responsible for rendering this item. */
|
|
37
|
+
instance: VirtualizedFile<LAnnotation>;
|
|
38
|
+
}
|
|
39
|
+
interface CodeViewRenderedDiffItem<LAnnotation> {
|
|
40
|
+
id: string;
|
|
41
|
+
type: 'diff';
|
|
42
|
+
item: CodeViewDiffItem<LAnnotation>;
|
|
43
|
+
version: CodeViewItemVersion | undefined;
|
|
44
|
+
element: HTMLElement;
|
|
45
|
+
instance: VirtualizedFileDiff<LAnnotation>;
|
|
46
|
+
}
|
|
47
|
+
interface CodeViewRenderedFileItem<LAnnotation> {
|
|
48
|
+
id: string;
|
|
49
|
+
type: 'file';
|
|
50
|
+
item: CodeViewFileItem<LAnnotation>;
|
|
51
|
+
version: CodeViewItemVersion | undefined;
|
|
52
|
+
element: HTMLElement;
|
|
53
|
+
instance: VirtualizedFile<LAnnotation>;
|
|
54
|
+
}
|
|
55
|
+
type CodeViewRenderedItem<LAnnotation> = CodeViewRenderedDiffItem<LAnnotation> | CodeViewRenderedFileItem<LAnnotation>;
|
|
56
|
+
interface CodeViewLineSelection {
|
|
57
|
+
id: string;
|
|
58
|
+
range: SelectedLineRange;
|
|
59
|
+
}
|
|
60
|
+
interface CodeViewCoordinator<LAnnotation> {
|
|
61
|
+
hasHeaderRenderers: boolean;
|
|
62
|
+
hasAnnotationRenderer: boolean;
|
|
63
|
+
hasGutterRenderer: boolean;
|
|
64
|
+
onSnapshotChange(snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined): void;
|
|
65
|
+
}
|
|
66
|
+
type CodeViewScrollListener<LAnnotation> = (scrollTop: number, viewer: CodeView<LAnnotation>) => void;
|
|
67
|
+
type OverloadCallbackArgs<TCallback> = TCallback extends ((...args: infer TArgs) => unknown) ? TArgs : never;
|
|
68
|
+
type CallbackReturn<TCallback> = TCallback extends ((...args: never[]) => infer TReturn) ? TReturn : never;
|
|
69
|
+
type OverloadFileCallbackArgs<LAnnotation, TKey$1 extends keyof FileOptions<LAnnotation>> = OverloadCallbackArgs<NonNullable<FileOptions<LAnnotation>[TKey$1]>>;
|
|
70
|
+
type OverloadDiffCallbackArgs<LAnnotation, TKey$1 extends keyof FileDiffOptions<LAnnotation>> = OverloadCallbackArgs<NonNullable<FileDiffOptions<LAnnotation>[TKey$1]>>;
|
|
71
|
+
type CodeViewOptionCallback<LAnnotation, TKey$1 extends keyof FileOptions<LAnnotation> & keyof FileDiffOptions<LAnnotation>> = {
|
|
72
|
+
(...args: [...OverloadFileCallbackArgs<LAnnotation, TKey$1>, context: CodeViewFileItemContext<LAnnotation>]): CallbackReturn<NonNullable<FileOptions<LAnnotation>[TKey$1]>>;
|
|
73
|
+
(...args: [...OverloadDiffCallbackArgs<LAnnotation, TKey$1>, context: CodeViewDiffItemContext<LAnnotation>]): CallbackReturn<NonNullable<FileDiffOptions<LAnnotation>[TKey$1]>>;
|
|
74
|
+
};
|
|
75
|
+
declare const CODE_VIEW_DIFF_OPTION_KEYS: readonly ["theme", "disableLineNumbers", "overflow", "themeType", "disableFileHeader", "disableVirtualizationBuffers", "preferredHighlighter", "useCSSClasses", "useTokenTransformer", "tokenizeMaxLineLength", "tokenizeMaxLength", "unsafeCSS", "diffStyle", "diffIndicators", "disableBackground", "expandUnchanged", "collapsedContextThreshold", "lineDiffType", "maxLineDiffLength", "expansionLineCount", "lineHoverHighlight", "enableTokenInteractionsOnWhitespace", "enableGutterUtility", "__debugPointerEvents", "enableLineSelection", "controlledSelection", "disableErrorHandling"];
|
|
76
|
+
type CodeViewDiffOptionKeys = (typeof CODE_VIEW_DIFF_OPTION_KEYS)[number];
|
|
77
|
+
type CodeViewPassThroughOptions<LAnnotation> = Pick<FileDiffOptions<LAnnotation>, CodeViewDiffOptionKeys>;
|
|
78
|
+
declare const CODE_VIEW_SHARED_CALLBACK_KEYS: readonly ["renderCustomHeader", "renderHeaderPrefix", "renderHeaderMetadata", "renderAnnotation", "renderGutterUtility", "onPostRender", "onGutterUtilityClick", "onLineClick", "onLineNumberClick", "onLineEnter", "onLineLeave", "onTokenClick", "onTokenEnter", "onTokenLeave"];
|
|
79
|
+
declare const CODE_VIEW_SELECTION_CALLBACK_KEYS: readonly ["onLineSelected", "onLineSelectionStart", "onLineSelectionChange", "onLineSelectionEnd"];
|
|
80
|
+
type CodeViewSharedCallbackKeys = (typeof CODE_VIEW_SHARED_CALLBACK_KEYS)[number];
|
|
81
|
+
type CodeViewSelectionCallbackKeys = (typeof CODE_VIEW_SELECTION_CALLBACK_KEYS)[number];
|
|
82
|
+
type CodeViewSharedCallbackOptions<LAnnotation> = { [TKey in CodeViewSharedCallbackKeys]?: CodeViewOptionCallback<LAnnotation, TKey> };
|
|
83
|
+
type CodeViewSelectionCallbackOptions<LAnnotation> = { [TKey in CodeViewSelectionCallbackKeys]?: CodeViewOptionCallback<LAnnotation, TKey> };
|
|
84
|
+
interface CodeViewOptions<LAnnotation> extends CodeViewPassThroughOptions<LAnnotation>, CodeViewSharedCallbackOptions<LAnnotation>, CodeViewSelectionCallbackOptions<LAnnotation> {
|
|
85
|
+
hunkSeparators?: Exclude<HunkSeparators, 'custom'>;
|
|
86
|
+
itemMetrics?: VirtualFileMetrics;
|
|
87
|
+
pointerEventsOnScroll?: boolean;
|
|
88
|
+
smoothScrollSettings?: SmoothScrollSettings;
|
|
89
|
+
stickyHeaders?: boolean;
|
|
90
|
+
controlledSelection?: boolean;
|
|
91
|
+
onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;
|
|
92
|
+
viewerMetrics?: CodeViewMetrics;
|
|
93
|
+
}
|
|
94
|
+
declare class CodeView<LAnnotation = undefined> {
|
|
95
|
+
static __STOP: boolean;
|
|
96
|
+
static __lastScrollPosition: number;
|
|
97
|
+
type: "advanced";
|
|
98
|
+
readonly config: VirtualizerConfig;
|
|
99
|
+
private items;
|
|
100
|
+
private idToItem;
|
|
101
|
+
private selectedLines;
|
|
102
|
+
private instanceToItem;
|
|
103
|
+
private layoutDirtyIndex;
|
|
104
|
+
private slotCoordinator;
|
|
105
|
+
private slotSnapshot;
|
|
106
|
+
private scrollListeners;
|
|
107
|
+
private scrollHeight;
|
|
108
|
+
private containerHeight;
|
|
109
|
+
private scrollTop;
|
|
110
|
+
private scrollDirty;
|
|
111
|
+
private pointerEventsRestoreTimer;
|
|
112
|
+
private pointerEventsDisabled;
|
|
113
|
+
private height;
|
|
114
|
+
private heightDirty;
|
|
115
|
+
private windowSpecs;
|
|
116
|
+
private renderState;
|
|
117
|
+
private pendingScrollTarget;
|
|
118
|
+
private pendingLayoutAnchor;
|
|
119
|
+
private scrollAnimation;
|
|
120
|
+
private root;
|
|
121
|
+
private resizeObserver;
|
|
122
|
+
private container;
|
|
123
|
+
private stickyContainer;
|
|
124
|
+
private stickyOffset;
|
|
125
|
+
private options;
|
|
126
|
+
private workerManager;
|
|
127
|
+
private isContainerManaged;
|
|
128
|
+
constructor(options?: CodeViewOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);
|
|
129
|
+
private getViewerMetrics;
|
|
130
|
+
private getItemMetrics;
|
|
131
|
+
private getSmoothScrollSettings;
|
|
132
|
+
private shouldDisablePointerEvents;
|
|
133
|
+
private clearPointerEventsTimer;
|
|
134
|
+
private suspendPointerEvents;
|
|
135
|
+
private restorePointerEvents;
|
|
136
|
+
private syncViewerMetrics;
|
|
137
|
+
setup(root: HTMLElement): void;
|
|
138
|
+
reset(): void;
|
|
139
|
+
cleanUp(): void;
|
|
140
|
+
private cleanAllRenderedItems;
|
|
141
|
+
private resolveEffectiveScrollBehavior;
|
|
142
|
+
scrollTo(target: CodeViewScrollTarget): void;
|
|
143
|
+
setSelectedLines(selection: CodeViewLineSelection | null, options?: SelectionWriteOptions): void;
|
|
144
|
+
getSelectedLines(): CodeViewLineSelection | null;
|
|
145
|
+
clearSelectedLines(options?: SelectionWriteOptions): void;
|
|
146
|
+
addItem(input: CodeViewItem<LAnnotation>): void;
|
|
147
|
+
addItems(inputs: readonly CodeViewItem<LAnnotation>[]): void;
|
|
148
|
+
setItems(items: readonly CodeViewItem<LAnnotation>[]): void;
|
|
149
|
+
/**
|
|
150
|
+
* Append new records to the viewer while preserving existing layout state.
|
|
151
|
+
* This is the shared path for imperative adds and the append-only reconcile
|
|
152
|
+
* fast path, so it measures new items immediately and only triggers render
|
|
153
|
+
* once at the end.
|
|
154
|
+
*/
|
|
155
|
+
private appendItemsInternal;
|
|
156
|
+
setOptions(options: CodeViewOptions<LAnnotation> | undefined): void;
|
|
157
|
+
private capturePendingLayoutAnchor;
|
|
158
|
+
render(immediate?: boolean): void;
|
|
159
|
+
instanceChanged(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>, layoutDirty: boolean): void;
|
|
160
|
+
getWindowSpecs(): VirtualWindowSpecs;
|
|
161
|
+
getContainerElement(): HTMLElement | undefined;
|
|
162
|
+
getRenderedItems(): CodeViewRenderedItem<LAnnotation>[];
|
|
163
|
+
setSlotCoordinator(coordinator?: CodeViewCoordinator<LAnnotation>): boolean;
|
|
164
|
+
getSlotSnapshot(coordinator: CodeViewCoordinator<LAnnotation>): CodeViewRenderedItem<LAnnotation>[] | undefined;
|
|
165
|
+
subscribeToScroll(listener: CodeViewScrollListener<LAnnotation>): () => void;
|
|
166
|
+
getTopForInstance(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>): number;
|
|
167
|
+
getTopForItem(id: string): number | undefined;
|
|
168
|
+
private createItem;
|
|
169
|
+
private getItemById;
|
|
170
|
+
private getItemByMode;
|
|
171
|
+
private applySelectedLines;
|
|
172
|
+
private syncSelection;
|
|
173
|
+
private wrapCallbackWithContext;
|
|
174
|
+
private getWrappedOptionCallback;
|
|
175
|
+
private getWrappedSelectionOptionCallback;
|
|
176
|
+
private createOptions;
|
|
177
|
+
/**
|
|
178
|
+
* Track the earliest index whose measured layout may now be stale. Later
|
|
179
|
+
* render passes relayout from this point forward so we do not have to rebuild
|
|
180
|
+
* positions for the whole list after every change.
|
|
181
|
+
*/
|
|
182
|
+
private markLayoutDirtyFromIndex;
|
|
183
|
+
/**
|
|
184
|
+
* Mark the earliest affected item as layout-dirty after an imperative change.
|
|
185
|
+
* Each record carries its current array index so this stays O(1) even when
|
|
186
|
+
* the viewer holds a very large number of items.
|
|
187
|
+
*/
|
|
188
|
+
private markItemLayoutDirty;
|
|
189
|
+
/**
|
|
190
|
+
* Detect the common controlled-update case where the new list simply extends
|
|
191
|
+
* the existing ordered prefix. When that happens we can reuse every current
|
|
192
|
+
* record in place, sync any versioned payload changes, and append only the new
|
|
193
|
+
* tail instead of rebuilding the whole list.
|
|
194
|
+
*/
|
|
195
|
+
private tryAppendItems;
|
|
196
|
+
/**
|
|
197
|
+
* Reconcile a new controlled item list against the existing records by id.
|
|
198
|
+
* This reuses records and instances when type matches, cleans up removed
|
|
199
|
+
* records, rebuilds the lookup maps, and marks layout dirty whenever order,
|
|
200
|
+
* membership, or versioned item data changes.
|
|
201
|
+
*/
|
|
202
|
+
private reconcileItems;
|
|
203
|
+
/**
|
|
204
|
+
* Update a reused record from the latest controlled item only when its item
|
|
205
|
+
* version changes. Matching versions mean CodeView keeps the current record
|
|
206
|
+
* snapshot, which lets imperative updates remain in place until the caller
|
|
207
|
+
* intentionally publishes a newer version.
|
|
208
|
+
*/
|
|
209
|
+
private syncItemRecord;
|
|
210
|
+
/**
|
|
211
|
+
* Clamps a scroll position to the min/max allowable scroll range based on
|
|
212
|
+
* the computed total height
|
|
213
|
+
*/
|
|
214
|
+
private clampScrollTop;
|
|
215
|
+
private getStickyHeaderOffset;
|
|
216
|
+
private getScrollTargetRect;
|
|
217
|
+
private normalizeScrollTarget;
|
|
218
|
+
/**
|
|
219
|
+
* Resolve a target's scroll position
|
|
220
|
+
* Returns `undefined` when we can't resolve a target for whatever reason
|
|
221
|
+
*/
|
|
222
|
+
private resolveScrollTargetTop;
|
|
223
|
+
/**
|
|
224
|
+
* Given an existing scroll target (scroll top and height), figure out the
|
|
225
|
+
* correct scroll position to target based on the desired alignment, offset
|
|
226
|
+
* and stickyOffset if necessary
|
|
227
|
+
*/
|
|
228
|
+
private resolveAlignedScrollPosition;
|
|
229
|
+
private getLineScrollPosition;
|
|
230
|
+
/**
|
|
231
|
+
* Determine target scroll position for current frame.
|
|
232
|
+
*
|
|
233
|
+
* If there's no pendingScrollTarget then we just return the current scroll
|
|
234
|
+
* position
|
|
235
|
+
*
|
|
236
|
+
* If there's a pendingScrollTarget then we depend on whether there's a
|
|
237
|
+
* smooth scroll animation or not. If not just return the destination, or
|
|
238
|
+
* compute next position given the smooth scroll spring physics
|
|
239
|
+
*/
|
|
240
|
+
private computeFrameScrollTop;
|
|
241
|
+
/**
|
|
242
|
+
* Closed-form critical-damped ODE step.
|
|
243
|
+
*
|
|
244
|
+
* Stable at any dt (Euler would blow up once ω·dt ≳ 1), so this survives
|
|
245
|
+
* big RAF gaps (tab-wake, offscreen frames) and resize-driven ticks that
|
|
246
|
+
* fire outside the normal RAF cadence.
|
|
247
|
+
*/
|
|
248
|
+
private computeSpringStep;
|
|
249
|
+
/**
|
|
250
|
+
* For any given pendingScrollTarget, updates any in flight smooth scroll
|
|
251
|
+
* animations and returns the target scrollTop to move towards
|
|
252
|
+
*
|
|
253
|
+
* Resolves the animation based on frame time and adopts any necessary scroll
|
|
254
|
+
* anchoring corrections if necessary
|
|
255
|
+
*/
|
|
256
|
+
private advanceScrollAnimation;
|
|
257
|
+
private computeRenderRangeAndEmit;
|
|
258
|
+
private flushManagers;
|
|
259
|
+
private syncContainerHeight;
|
|
260
|
+
private reconcileRenderedItems;
|
|
261
|
+
private updateStickyPositioning;
|
|
262
|
+
private handleScroll;
|
|
263
|
+
private clearPendingScroll;
|
|
264
|
+
private handleResize;
|
|
265
|
+
/**
|
|
266
|
+
* Figure out scrollTop accounting for sticky header if enabled and
|
|
267
|
+
* necessary
|
|
268
|
+
*/
|
|
269
|
+
private getScrollAnchorViewportTop;
|
|
270
|
+
/**
|
|
271
|
+
* Attempt to find a scroll anchor based on build in metrics of the existing
|
|
272
|
+
* rendered files/diff.
|
|
273
|
+
*
|
|
274
|
+
* A scroll anchor represents the first fully visible element (in other
|
|
275
|
+
* words, the first file or first line who's top is fully in the viewport).
|
|
276
|
+
*/
|
|
277
|
+
private getScrollAnchor;
|
|
278
|
+
/**
|
|
279
|
+
* Given a scroll anchor, attempt to resolve a newly updated (and clamped)
|
|
280
|
+
* scroll position to keep the anchored element in place.
|
|
281
|
+
*
|
|
282
|
+
* If we can't resolve a position for whatever reason, we'll return
|
|
283
|
+
* undefined.
|
|
284
|
+
*/
|
|
285
|
+
private resolveAnchoredScrollTop;
|
|
286
|
+
/**
|
|
287
|
+
* Apply a device-pixel-rounded scroll position if it differs from the last
|
|
288
|
+
* rendered/applied scrollTop we've already recorded in renderState.
|
|
289
|
+
*/
|
|
290
|
+
private applyScrollFix;
|
|
291
|
+
/**
|
|
292
|
+
* Decide whether a pending programmatic scroll has reached its
|
|
293
|
+
* destination and should be cleared.
|
|
294
|
+
*/
|
|
295
|
+
private isPendingTargetSettled;
|
|
296
|
+
getScrollTop(): number;
|
|
297
|
+
getHeight(): number;
|
|
298
|
+
getScrollHeight(): number;
|
|
299
|
+
private flushSlotCoordinator;
|
|
300
|
+
private notifyScroll;
|
|
301
|
+
/**
|
|
302
|
+
* Find the first item whose bottom edge crosses into the viewport window.
|
|
303
|
+
* This lets scroll-time rendering jump directly near the visible range instead
|
|
304
|
+
* of linearly scanning from the start of very large item lists.
|
|
305
|
+
*/
|
|
306
|
+
private findFirstVisibleIndex;
|
|
307
|
+
/**
|
|
308
|
+
* Find the last item whose top edge is still within the viewport window.
|
|
309
|
+
* Paired with findFirstVisibleIndex, this bounds the render loop to only the
|
|
310
|
+
* slice of items that can actually intersect the current scroll range.
|
|
311
|
+
*/
|
|
312
|
+
private findLastVisibleIndex;
|
|
313
|
+
/**
|
|
314
|
+
* Recompute measured tops and heights starting from the earliest dirty item.
|
|
315
|
+
* Earlier items keep their existing layout, while everything from startIndex
|
|
316
|
+
* onward is remeasured so downstream positions and total scroll height stay
|
|
317
|
+
* consistent after inserts, removals, or versioned item updates.
|
|
318
|
+
*/
|
|
319
|
+
private recomputeLayout;
|
|
320
|
+
private resetRenderState;
|
|
321
|
+
private getFitPerfectlyOverscroll;
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
export { CodeView, CodeViewCoordinator, CodeViewLineSelection, CodeViewOptions, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollListener };
|
|
325
|
+
//# sourceMappingURL=CodeView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeView.d.ts","names":["SelectedLineRange","SelectionWriteOptions","CodeViewDiffItem","CodeViewFileItem","CodeViewItem","CodeViewItemVersion","CodeViewMetrics","CodeViewScrollTarget","HunkSeparators","SmoothScrollSettings","VirtualFileMetrics","VirtualWindowSpecs","WorkerPoolManager","FileOptions","FileDiffOptions","VirtualizedFile","VirtualizedFileDiff","VirtualizerConfig","AdvancedVirtualizedBaseItem","HTMLElement","CodeViewDiffItemContext","LAnnotation","CodeViewFileItemContext","CodeViewRenderedDiffItem","CodeViewRenderedFileItem","CodeViewRenderedItem","CodeViewLineSelection","CodeViewCoordinator","CodeViewScrollListener","CodeView","OverloadCallbackArgs","TCallback","TArgs","CallbackReturn","TReturn","OverloadFileCallbackArgs","TKey","NonNullable","OverloadDiffCallbackArgs","CodeViewOptionCallback","CODE_VIEW_DIFF_OPTION_KEYS","CodeViewDiffOptionKeys","CodeViewPassThroughOptions","Pick","CODE_VIEW_SHARED_CALLBACK_KEYS","CODE_VIEW_SELECTION_CALLBACK_KEYS","CodeViewSharedCallbackKeys","CodeViewSelectionCallbackKeys","CodeViewSharedCallbackOptions","CodeViewSelectionCallbackOptions","CodeViewOptions","Exclude"],"sources":["../../src/components/CodeView.d.ts"],"sourcesContent":["import type { SelectedLineRange, SelectionWriteOptions } from '../managers/InteractionManager';\nimport type { CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewItemVersion, CodeViewMetrics, CodeViewScrollTarget, HunkSeparators, SmoothScrollSettings, VirtualFileMetrics, VirtualWindowSpecs } from '../types';\nimport type { WorkerPoolManager } from '../worker';\nimport type { FileOptions } from './File';\nimport type { FileDiffOptions } from './FileDiff';\nimport { VirtualizedFile } from './VirtualizedFile';\nimport { VirtualizedFileDiff } from './VirtualizedFileDiff';\nimport type { VirtualizerConfig } from './Virtualizer';\ninterface AdvancedVirtualizedBaseItem {\n /** Current index of this record in the ordered items array. */\n index: number;\n /** Absolute top offset of this item inside the scroll content. */\n top: number;\n /** Total measured height reserved for this item. */\n height: number;\n /** Root <diffs-container> node currently mounted for this item, only exists\n * when rendered. */\n element: HTMLElement | undefined;\n /** Last controlled version observed for this record. */\n version: CodeViewItemVersion | undefined;\n}\ninterface CodeViewDiffItemContext<LAnnotation> extends AdvancedVirtualizedBaseItem {\n type: 'diff';\n /** Latest item snapshot for this record. Controlled updates can replace it. */\n item: CodeViewDiffItem<LAnnotation>;\n /** Virtualized diff instance responsible for rendering this item. */\n instance: VirtualizedFileDiff<LAnnotation>;\n}\ninterface CodeViewFileItemContext<LAnnotation> extends AdvancedVirtualizedBaseItem {\n type: 'file';\n /** Latest item snapshot for this record. Controlled updates can replace it. */\n item: CodeViewFileItem<LAnnotation>;\n /** Virtualized file instance responsible for rendering this item. */\n instance: VirtualizedFile<LAnnotation>;\n}\nexport interface CodeViewRenderedDiffItem<LAnnotation> {\n id: string;\n type: 'diff';\n item: CodeViewDiffItem<LAnnotation>;\n version: CodeViewItemVersion | undefined;\n element: HTMLElement;\n instance: VirtualizedFileDiff<LAnnotation>;\n}\nexport interface CodeViewRenderedFileItem<LAnnotation> {\n id: string;\n type: 'file';\n item: CodeViewFileItem<LAnnotation>;\n version: CodeViewItemVersion | undefined;\n element: HTMLElement;\n instance: VirtualizedFile<LAnnotation>;\n}\nexport type CodeViewRenderedItem<LAnnotation> = CodeViewRenderedDiffItem<LAnnotation> | CodeViewRenderedFileItem<LAnnotation>;\nexport interface CodeViewLineSelection {\n id: string;\n range: SelectedLineRange;\n}\nexport interface CodeViewCoordinator<LAnnotation> {\n hasHeaderRenderers: boolean;\n hasAnnotationRenderer: boolean;\n hasGutterRenderer: boolean;\n onSnapshotChange(snapshot: CodeViewRenderedItem<LAnnotation>[] | undefined): void;\n}\nexport type CodeViewScrollListener<LAnnotation> = (scrollTop: number, viewer: CodeView<LAnnotation>) => void;\ntype OverloadCallbackArgs<TCallback> = TCallback extends (...args: infer TArgs) => unknown ? TArgs : never;\ntype CallbackReturn<TCallback> = TCallback extends (...args: never[]) => infer TReturn ? TReturn : never;\ntype OverloadFileCallbackArgs<LAnnotation, TKey extends keyof FileOptions<LAnnotation>> = OverloadCallbackArgs<NonNullable<FileOptions<LAnnotation>[TKey]>>;\ntype OverloadDiffCallbackArgs<LAnnotation, TKey extends keyof FileDiffOptions<LAnnotation>> = OverloadCallbackArgs<NonNullable<FileDiffOptions<LAnnotation>[TKey]>>;\ntype CodeViewOptionCallback<LAnnotation, TKey extends keyof FileOptions<LAnnotation> & keyof FileDiffOptions<LAnnotation>> = {\n (...args: [\n ...OverloadFileCallbackArgs<LAnnotation, TKey>,\n context: CodeViewFileItemContext<LAnnotation>\n ]): CallbackReturn<NonNullable<FileOptions<LAnnotation>[TKey]>>;\n (...args: [\n ...OverloadDiffCallbackArgs<LAnnotation, TKey>,\n context: CodeViewDiffItemContext<LAnnotation>\n ]): CallbackReturn<NonNullable<FileDiffOptions<LAnnotation>[TKey]>>;\n};\ndeclare const CODE_VIEW_DIFF_OPTION_KEYS: readonly [\"theme\", \"disableLineNumbers\", \"overflow\", \"themeType\", \"disableFileHeader\", \"disableVirtualizationBuffers\", \"preferredHighlighter\", \"useCSSClasses\", \"useTokenTransformer\", \"tokenizeMaxLineLength\", \"tokenizeMaxLength\", \"unsafeCSS\", \"diffStyle\", \"diffIndicators\", \"disableBackground\", \"expandUnchanged\", \"collapsedContextThreshold\", \"lineDiffType\", \"maxLineDiffLength\", \"expansionLineCount\", \"lineHoverHighlight\", \"enableTokenInteractionsOnWhitespace\", \"enableGutterUtility\", \"__debugPointerEvents\", \"enableLineSelection\", \"controlledSelection\", \"disableErrorHandling\"];\ntype CodeViewDiffOptionKeys = (typeof CODE_VIEW_DIFF_OPTION_KEYS)[number];\ntype CodeViewPassThroughOptions<LAnnotation> = Pick<FileDiffOptions<LAnnotation>, CodeViewDiffOptionKeys>;\ndeclare const CODE_VIEW_SHARED_CALLBACK_KEYS: readonly [\"renderCustomHeader\", \"renderHeaderPrefix\", \"renderHeaderMetadata\", \"renderAnnotation\", \"renderGutterUtility\", \"onPostRender\", \"onGutterUtilityClick\", \"onLineClick\", \"onLineNumberClick\", \"onLineEnter\", \"onLineLeave\", \"onTokenClick\", \"onTokenEnter\", \"onTokenLeave\"];\ndeclare const CODE_VIEW_SELECTION_CALLBACK_KEYS: readonly [\"onLineSelected\", \"onLineSelectionStart\", \"onLineSelectionChange\", \"onLineSelectionEnd\"];\ntype CodeViewSharedCallbackKeys = (typeof CODE_VIEW_SHARED_CALLBACK_KEYS)[number];\ntype CodeViewSelectionCallbackKeys = (typeof CODE_VIEW_SELECTION_CALLBACK_KEYS)[number];\ntype CodeViewSharedCallbackOptions<LAnnotation> = {\n [TKey in CodeViewSharedCallbackKeys]?: CodeViewOptionCallback<LAnnotation, TKey>;\n};\ntype CodeViewSelectionCallbackOptions<LAnnotation> = {\n [TKey in CodeViewSelectionCallbackKeys]?: CodeViewOptionCallback<LAnnotation, TKey>;\n};\nexport interface CodeViewOptions<LAnnotation> extends CodeViewPassThroughOptions<LAnnotation>, CodeViewSharedCallbackOptions<LAnnotation>, CodeViewSelectionCallbackOptions<LAnnotation> {\n hunkSeparators?: Exclude<HunkSeparators, 'custom'>;\n itemMetrics?: VirtualFileMetrics;\n pointerEventsOnScroll?: boolean;\n smoothScrollSettings?: SmoothScrollSettings;\n stickyHeaders?: boolean;\n controlledSelection?: boolean;\n onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;\n viewerMetrics?: CodeViewMetrics;\n}\nexport declare class CodeView<LAnnotation = undefined> {\n static __STOP: boolean;\n static __lastScrollPosition: number;\n type: \"advanced\";\n readonly config: VirtualizerConfig;\n private items;\n private idToItem;\n private selectedLines;\n private instanceToItem;\n private layoutDirtyIndex;\n private slotCoordinator;\n private slotSnapshot;\n private scrollListeners;\n private scrollHeight;\n private containerHeight;\n private scrollTop;\n private scrollDirty;\n private pointerEventsRestoreTimer;\n private pointerEventsDisabled;\n private height;\n private heightDirty;\n private windowSpecs;\n private renderState;\n private pendingScrollTarget;\n private pendingLayoutAnchor;\n private scrollAnimation;\n private root;\n private resizeObserver;\n private container;\n private stickyContainer;\n private stickyOffset;\n private options;\n private workerManager;\n private isContainerManaged;\n constructor(options?: CodeViewOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);\n private getViewerMetrics;\n private getItemMetrics;\n private getSmoothScrollSettings;\n private shouldDisablePointerEvents;\n private clearPointerEventsTimer;\n private suspendPointerEvents;\n private restorePointerEvents;\n private syncViewerMetrics;\n setup(root: HTMLElement): void;\n reset(): void;\n cleanUp(): void;\n private cleanAllRenderedItems;\n private resolveEffectiveScrollBehavior;\n scrollTo(target: CodeViewScrollTarget): void;\n setSelectedLines(selection: CodeViewLineSelection | null, options?: SelectionWriteOptions): void;\n getSelectedLines(): CodeViewLineSelection | null;\n clearSelectedLines(options?: SelectionWriteOptions): void;\n addItem(input: CodeViewItem<LAnnotation>): void;\n addItems(inputs: readonly CodeViewItem<LAnnotation>[]): void;\n setItems(items: readonly CodeViewItem<LAnnotation>[]): void;\n /**\n * Append new records to the viewer while preserving existing layout state.\n * This is the shared path for imperative adds and the append-only reconcile\n * fast path, so it measures new items immediately and only triggers render\n * once at the end.\n */\n private appendItemsInternal;\n setOptions(options: CodeViewOptions<LAnnotation> | undefined): void;\n private capturePendingLayoutAnchor;\n render(immediate?: boolean): void;\n instanceChanged(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>, layoutDirty: boolean): void;\n getWindowSpecs(): VirtualWindowSpecs;\n getContainerElement(): HTMLElement | undefined;\n getRenderedItems(): CodeViewRenderedItem<LAnnotation>[];\n setSlotCoordinator(coordinator?: CodeViewCoordinator<LAnnotation>): boolean;\n getSlotSnapshot(coordinator: CodeViewCoordinator<LAnnotation>): CodeViewRenderedItem<LAnnotation>[] | undefined;\n subscribeToScroll(listener: CodeViewScrollListener<LAnnotation>): () => void;\n getTopForInstance(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>): number;\n getTopForItem(id: string): number | undefined;\n private createItem;\n private getItemById;\n private getItemByMode;\n private applySelectedLines;\n private syncSelection;\n private wrapCallbackWithContext;\n private getWrappedOptionCallback;\n private getWrappedSelectionOptionCallback;\n private createOptions;\n /**\n * Track the earliest index whose measured layout may now be stale. Later\n * render passes relayout from this point forward so we do not have to rebuild\n * positions for the whole list after every change.\n */\n private markLayoutDirtyFromIndex;\n /**\n * Mark the earliest affected item as layout-dirty after an imperative change.\n * Each record carries its current array index so this stays O(1) even when\n * the viewer holds a very large number of items.\n */\n private markItemLayoutDirty;\n /**\n * Detect the common controlled-update case where the new list simply extends\n * the existing ordered prefix. When that happens we can reuse every current\n * record in place, sync any versioned payload changes, and append only the new\n * tail instead of rebuilding the whole list.\n */\n private tryAppendItems;\n /**\n * Reconcile a new controlled item list against the existing records by id.\n * This reuses records and instances when type matches, cleans up removed\n * records, rebuilds the lookup maps, and marks layout dirty whenever order,\n * membership, or versioned item data changes.\n */\n private reconcileItems;\n /**\n * Update a reused record from the latest controlled item only when its item\n * version changes. Matching versions mean CodeView keeps the current record\n * snapshot, which lets imperative updates remain in place until the caller\n * intentionally publishes a newer version.\n */\n private syncItemRecord;\n /**\n * Clamps a scroll position to the min/max allowable scroll range based on\n * the computed total height\n */\n private clampScrollTop;\n private getStickyHeaderOffset;\n private getScrollTargetRect;\n private normalizeScrollTarget;\n /**\n * Resolve a target's scroll position\n \n * Returns `undefined` when we can't resolve a target for whatever reason\n */\n private resolveScrollTargetTop;\n /**\n * Given an existing scroll target (scroll top and height), figure out the\n * correct scroll position to target based on the desired alignment, offset\n * and stickyOffset if necessary\n */\n private resolveAlignedScrollPosition;\n private getLineScrollPosition;\n /**\n * Determine target scroll position for current frame.\n *\n * If there's no pendingScrollTarget then we just return the current scroll\n * position\n *\n * If there's a pendingScrollTarget then we depend on whether there's a\n * smooth scroll animation or not. If not just return the destination, or\n * compute next position given the smooth scroll spring physics\n */\n private computeFrameScrollTop;\n /**\n * Closed-form critical-damped ODE step.\n *\n * Stable at any dt (Euler would blow up once ω·dt ≳ 1), so this survives\n * big RAF gaps (tab-wake, offscreen frames) and resize-driven ticks that\n * fire outside the normal RAF cadence.\n */\n private computeSpringStep;\n /**\n * For any given pendingScrollTarget, updates any in flight smooth scroll\n * animations and returns the target scrollTop to move towards\n *\n * Resolves the animation based on frame time and adopts any necessary scroll\n * anchoring corrections if necessary\n */\n private advanceScrollAnimation;\n private computeRenderRangeAndEmit;\n private flushManagers;\n private syncContainerHeight;\n private reconcileRenderedItems;\n private updateStickyPositioning;\n private handleScroll;\n private clearPendingScroll;\n private handleResize;\n /**\n * Figure out scrollTop accounting for sticky header if enabled and\n * necessary\n */\n private getScrollAnchorViewportTop;\n /**\n * Attempt to find a scroll anchor based on build in metrics of the existing\n * rendered files/diff.\n *\n * A scroll anchor represents the first fully visible element (in other\n * words, the first file or first line who's top is fully in the viewport).\n */\n private getScrollAnchor;\n /**\n * Given a scroll anchor, attempt to resolve a newly updated (and clamped)\n * scroll position to keep the anchored element in place.\n *\n * If we can't resolve a position for whatever reason, we'll return\n * undefined.\n */\n private resolveAnchoredScrollTop;\n /**\n * Apply a device-pixel-rounded scroll position if it differs from the last\n * rendered/applied scrollTop we've already recorded in renderState.\n */\n private applyScrollFix;\n /**\n * Decide whether a pending programmatic scroll has reached its\n * destination and should be cleared.\n */\n private isPendingTargetSettled;\n getScrollTop(): number;\n getHeight(): number;\n getScrollHeight(): number;\n private flushSlotCoordinator;\n private notifyScroll;\n /**\n * Find the first item whose bottom edge crosses into the viewport window.\n * This lets scroll-time rendering jump directly near the visible range instead\n * of linearly scanning from the start of very large item lists.\n */\n private findFirstVisibleIndex;\n /**\n * Find the last item whose top edge is still within the viewport window.\n * Paired with findFirstVisibleIndex, this bounds the render loop to only the\n * slice of items that can actually intersect the current scroll range.\n */\n private findLastVisibleIndex;\n /**\n * Recompute measured tops and heights starting from the earliest dirty item.\n * Earlier items keep their existing layout, while everything from startIndex\n * onward is remeasured so downstream positions and total scroll height stay\n * consistent after inserts, removals, or versioned item updates.\n */\n private recomputeLayout;\n private resetRenderState;\n private getFitPerfectlyOverscroll;\n}\nexport {};\n//# sourceMappingURL=CodeView.d.ts.map"],"mappings":";;;;;;;;;;;UAQUkB,2BAAAA;;;EAAAA;EAaAE,GAAAA,EAAAA,MAAAA;EAGiBC;EAAjBnB,MAAAA,EAAAA,MAAAA;EAEwBmB;;EALqBH,OAAAA,EAJ1CC,WAI0CD,GAAAA,SAAAA;EAA2B;EAOxEI,OAAAA,EATGjB,mBASoB,GAAA,SAAAgB;;UAPvBD,uBAUAjB,CAAAA,WAAAA,CAAAA,SAV6Ce,2BAU7Cf,CAAAA;EAEoBkB,IAAAA,EAAAA,MAAAA;EAAhBN;EALyCG,IAAAA,EAJ7ChB,gBAI6CgB,CAJ5BG,WAI4BH,CAAAA;EAA2B;EAOjEK,QAAAA,EATHP,mBAS2B,CATPK,WASOA,CAAAA;;UAP/BC,uBAUApB,CAAAA,WAAAA,CAAAA,SAV6CgB,2BAU7ChB,CAAAA;EACGG,IAAAA,EAAAA,MAAAA;EACAc;EACqBE,IAAAA,EAVxBlB,gBAUwBkB,CAVPA,WAUOA,CAAAA;EAApBL;EAAmB,QAAA,EARnBD,eAQmB,CARHM,WAQG,CAAA;AAEjC;AAG2BA,UAXVE,wBAWUF,CAAAA,WAAAA,CAAAA,CAAAA;EAAjBlB,EAAAA,EAAAA,MAAAA;EACGE,IAAAA,EAAAA,MAAAA;EACAc,IAAAA,EAVHjB,gBAUGiB,CAVcE,WAUdF,CAAAA;EACiBE,OAAAA,EAVjBhB,mBAUiBgB,GAAAA,SAAAA;EAAhBN,OAAAA,EATDI,WASCJ;EAAe,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