@pierre/diffs 1.3.0-beta.6 → 1.3.0-beta.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/dist/components/CodeView.d.ts +90 -5
- package/dist/components/CodeView.d.ts.map +1 -1
- package/dist/components/CodeView.js +291 -38
- package/dist/components/CodeView.js.map +1 -1
- package/dist/components/File.d.ts +1 -0
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +20 -6
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +38 -23
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +144 -61
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/UnresolvedFile.d.ts +3 -2
- package/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/dist/components/UnresolvedFile.js +4 -2
- package/dist/components/UnresolvedFile.js.map +1 -1
- package/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/dist/components/VirtualizedFile.js +6 -8
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.d.ts +13 -5
- package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +192 -55
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/components/Virtualizer.d.ts +2 -0
- package/dist/components/Virtualizer.d.ts.map +1 -1
- package/dist/components/Virtualizer.js +16 -3
- package/dist/components/Virtualizer.js.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/editor/command.d.ts +1 -1
- package/dist/editor/command.d.ts.map +1 -1
- package/dist/editor/command.js +8 -0
- package/dist/editor/command.js.map +1 -1
- package/dist/editor/editor.d.ts +10 -3
- package/dist/editor/editor.d.ts.map +1 -1
- package/dist/editor/editor.js +325 -135
- package/dist/editor/editor.js.map +1 -1
- package/dist/editor/editor2.js +1 -1
- package/dist/editor/lineAnnotations.d.ts.map +1 -1
- package/dist/editor/lineAnnotations.js +84 -12
- package/dist/editor/lineAnnotations.js.map +1 -1
- package/dist/editor/marker.d.ts +5 -3
- package/dist/editor/marker.d.ts.map +1 -1
- package/dist/editor/marker.js +35 -12
- package/dist/editor/marker.js.map +1 -1
- package/dist/editor/matchBrackets.d.ts +8 -0
- package/dist/editor/matchBrackets.d.ts.map +1 -0
- package/dist/editor/matchBrackets.js +146 -0
- package/dist/editor/matchBrackets.js.map +1 -0
- package/dist/editor/popover.d.ts +45 -0
- package/dist/editor/popover.d.ts.map +1 -0
- package/dist/editor/popover.js +145 -0
- package/dist/editor/popover.js.map +1 -0
- package/dist/editor/selection.d.ts +14 -2
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/selection.js +142 -41
- package/dist/editor/selection.js.map +1 -1
- package/dist/editor/selectionAction.d.ts +20 -3
- package/dist/editor/selectionAction.d.ts.map +1 -1
- package/dist/editor/selectionAction.js +41 -10
- package/dist/editor/selectionAction.js.map +1 -1
- package/dist/editor/textDocument.d.ts +2 -0
- package/dist/editor/textDocument.d.ts.map +1 -1
- package/dist/editor/textDocument.js +22 -6
- package/dist/editor/textDocument.js.map +1 -1
- package/dist/editor/textMeasure.d.ts.map +1 -1
- package/dist/editor/textMeasure.js +25 -7
- package/dist/editor/textMeasure.js.map +1 -1
- package/dist/editor/tokenzier.d.ts +6 -7
- package/dist/editor/tokenzier.d.ts.map +1 -1
- package/dist/editor/tokenzier.js +83 -34
- package/dist/editor/tokenzier.js.map +1 -1
- package/dist/editor/utils.d.ts +3 -1
- package/dist/editor/utils.d.ts.map +1 -1
- package/dist/editor/utils.js +14 -1
- package/dist/editor/utils.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.js +6 -4
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/InteractionManager.js +0 -1
- package/dist/managers/InteractionManager.js.map +1 -1
- package/dist/managers/ResizeManager.d.ts +10 -2
- package/dist/managers/ResizeManager.d.ts.map +1 -1
- package/dist/managers/ResizeManager.js +33 -13
- package/dist/managers/ResizeManager.js.map +1 -1
- package/dist/react/CodeView.d.ts +25 -1
- package/dist/react/CodeView.d.ts.map +1 -1
- package/dist/react/CodeView.js +76 -17
- package/dist/react/CodeView.js.map +1 -1
- package/dist/react/EditorContext.d.ts +2 -2
- package/dist/react/EditorContext.d.ts.map +1 -1
- package/dist/react/EditorContext.js.map +1 -1
- package/dist/react/MultiFileDiff.d.ts +3 -4
- package/dist/react/MultiFileDiff.d.ts.map +1 -1
- package/dist/react/MultiFileDiff.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/utils/useFileDiffInstance.js +14 -15
- package/dist/react/utils/useFileDiffInstance.js.map +1 -1
- package/dist/renderers/DiffHunksRenderer.d.ts +2 -2
- package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +45 -23
- 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 +58 -38
- package/dist/renderers/FileRenderer.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/preloadDiffs.d.ts +11 -10
- package/dist/ssr/preloadDiffs.d.ts.map +1 -1
- package/dist/ssr/preloadDiffs.js +14 -6
- package/dist/ssr/preloadDiffs.js.map +1 -1
- package/dist/types.d.ts +100 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/applyLineTextWithNewline.d.ts +5 -0
- package/dist/utils/applyLineTextWithNewline.d.ts.map +1 -0
- package/dist/utils/applyLineTextWithNewline.js +11 -0
- package/dist/utils/applyLineTextWithNewline.js.map +1 -0
- package/dist/utils/areHunkDataEqual.js +1 -1
- package/dist/utils/areHunkDataEqual.js.map +1 -1
- package/dist/utils/areManagedSnapshotsEqual.d.ts +2 -2
- package/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
- package/dist/utils/areManagedSnapshotsEqual.js +5 -0
- package/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
- package/dist/utils/awaitWithTimeout.d.ts +5 -0
- package/dist/utils/awaitWithTimeout.d.ts.map +1 -0
- package/dist/utils/awaitWithTimeout.js +15 -0
- package/dist/utils/awaitWithTimeout.js.map +1 -0
- package/dist/utils/cloneFileDiffMetadata.d.ts +7 -0
- package/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -0
- package/dist/utils/cloneFileDiffMetadata.js +16 -0
- package/dist/utils/cloneFileDiffMetadata.js.map +1 -0
- package/dist/utils/computeEstimatedDiffHeights.d.ts +3 -1
- package/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
- package/dist/utils/computeEstimatedDiffHeights.js +8 -1
- package/dist/utils/computeEstimatedDiffHeights.js.map +1 -1
- package/dist/utils/createCodeViewHeaderFooterHostElement.d.ts +5 -0
- package/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -0
- package/dist/utils/createCodeViewHeaderFooterHostElement.js +19 -0
- package/dist/utils/createCodeViewHeaderFooterHostElement.js.map +1 -0
- package/dist/utils/createPreElement.js +0 -1
- package/dist/utils/createPreElement.js.map +1 -1
- package/dist/utils/getDiffFileInput.d.ts +14 -0
- package/dist/utils/getDiffFileInput.d.ts.map +1 -0
- package/dist/utils/getDiffFileInput.js +24 -0
- package/dist/utils/getDiffFileInput.js.map +1 -0
- package/dist/utils/getDiffHunksRendererOptions.js +1 -0
- package/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
- package/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
- package/dist/utils/getFiletypeFromFileName.js +2 -0
- package/dist/utils/getFiletypeFromFileName.js.map +1 -1
- package/dist/utils/hydratePartialDiff.d.ts +10 -0
- package/dist/utils/hydratePartialDiff.d.ts.map +1 -0
- package/dist/utils/hydratePartialDiff.js +140 -0
- package/dist/utils/hydratePartialDiff.js.map +1 -0
- package/dist/utils/iterateOverDiff.js +3 -3
- package/dist/utils/iterateOverDiff.js.map +1 -1
- package/dist/utils/parseDiffFromFile.d.ts +1 -1
- package/dist/utils/parseDiffFromFile.d.ts.map +1 -1
- package/dist/utils/parseDiffFromFile.js +26 -5
- package/dist/utils/parseDiffFromFile.js.map +1 -1
- package/dist/utils/setWrapperNodeProps.js +0 -1
- package/dist/utils/setWrapperNodeProps.js.map +1 -1
- package/dist/utils/updateDiffHunks.d.ts +5 -1
- package/dist/utils/updateDiffHunks.d.ts.map +1 -1
- package/dist/utils/updateDiffHunks.js +48 -4
- package/dist/utils/updateDiffHunks.js.map +1 -1
- package/dist/worker/WorkerPoolManager.d.ts +7 -2
- package/dist/worker/WorkerPoolManager.d.ts.map +1 -1
- package/dist/worker/WorkerPoolManager.js +78 -15
- package/dist/worker/WorkerPoolManager.js.map +1 -1
- package/dist/worker/index.d.ts +2 -2
- package/dist/worker/types.d.ts +7 -1
- package/dist/worker/types.d.ts.map +1 -1
- package/dist/worker/worker-portable.js +5 -3
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +5 -3
- package/dist/worker/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewLayout, CodeViewScrollTarget, HunkSeparators, SelectedLineRange, SmoothScrollSettings, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
|
|
1
|
+
import { CodeViewCreateEditorOptions, CodeViewDiffItem, CodeViewFileItem, CodeViewItem, CodeViewLayout, CodeViewScrollTarget, DiffLineAnnotation, DiffsEditorHost, FileContents, HunkSeparators, SelectedLineRange, SmoothScrollSettings, VirtualFileMetrics, VirtualWindowSpecs } from "../types.js";
|
|
2
2
|
import { SelectionWriteOptions } from "../managers/InteractionManager.js";
|
|
3
3
|
import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
|
|
4
4
|
import { FileOptions } from "./File.js";
|
|
@@ -54,6 +54,11 @@ interface CodeViewRenderedFileItem<LAnnotation> {
|
|
|
54
54
|
instance: VirtualizedFile<LAnnotation>;
|
|
55
55
|
}
|
|
56
56
|
type CodeViewRenderedItem<LAnnotation> = CodeViewRenderedDiffItem<LAnnotation> | CodeViewRenderedFileItem<LAnnotation>;
|
|
57
|
+
interface CodeViewSlotSnapshot<LAnnotation> {
|
|
58
|
+
items: CodeViewRenderedItem<LAnnotation>[] | undefined;
|
|
59
|
+
header: HTMLElement | undefined;
|
|
60
|
+
footer: HTMLElement | undefined;
|
|
61
|
+
}
|
|
57
62
|
interface CodeViewLineSelection {
|
|
58
63
|
id: string;
|
|
59
64
|
range: SelectedLineRange;
|
|
@@ -62,7 +67,7 @@ interface CodeViewCoordinator<LAnnotation> {
|
|
|
62
67
|
hasHeaderRenderers: boolean;
|
|
63
68
|
hasAnnotationRenderer: boolean;
|
|
64
69
|
hasGutterRenderer: boolean;
|
|
65
|
-
onSnapshotChange(snapshot:
|
|
70
|
+
onSnapshotChange(snapshot: CodeViewSlotSnapshot<LAnnotation> | undefined): void;
|
|
66
71
|
}
|
|
67
72
|
type CodeViewScrollListener<LAnnotation> = (scrollTop: number, viewer: CodeView<LAnnotation>) => void;
|
|
68
73
|
type OverloadCallbackArgs<TCallback> = TCallback extends ((...args: infer TArgs) => unknown) ? TArgs : never;
|
|
@@ -73,8 +78,9 @@ type CodeViewOptionCallback<LAnnotation, TKey extends keyof FileOptions<LAnnotat
|
|
|
73
78
|
(...args: [...OverloadFileCallbackArgs<LAnnotation, TKey>, context: CodeViewFileItemContext<LAnnotation>]): CallbackReturn<NonNullable<FileOptions<LAnnotation>[TKey]>>;
|
|
74
79
|
(...args: [...OverloadDiffCallbackArgs<LAnnotation, TKey>, context: CodeViewDiffItemContext<LAnnotation>]): CallbackReturn<NonNullable<FileDiffOptions<LAnnotation>[TKey]>>;
|
|
75
80
|
};
|
|
76
|
-
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'];
|
|
81
|
+
declare const CODE_VIEW_DIFF_OPTION_KEYS: readonly ['theme', 'disableLineNumbers', 'overflow', 'themeType', 'disableFileHeader', 'disableVirtualizationBuffers', 'preferredHighlighter', 'useCSSClasses', 'useTokenTransformer', 'tokenizeMaxLineLength', 'tokenizeMaxLength', 'unsafeCSS', 'diffStyle', 'diffIndicators', 'disableBackground', 'expandUnchanged', 'loadDiffFiles', 'collapsedContextThreshold', 'lineDiffType', 'maxLineDiffLength', 'expansionLineCount', 'lineHoverHighlight', 'enableTokenInteractionsOnWhitespace', 'enableGutterUtility', '__debugPointerEvents', 'enableLineSelection', 'controlledSelection', 'disableErrorHandling'];
|
|
77
82
|
type CodeViewDiffOptionKeys = (typeof CODE_VIEW_DIFF_OPTION_KEYS)[number];
|
|
83
|
+
declare const CODE_VIEW_FILE_OPTION_KEYS: readonly ['theme', 'disableLineNumbers', 'overflow', 'themeType', 'disableFileHeader', 'disableVirtualizationBuffers', 'preferredHighlighter', 'useCSSClasses', 'useTokenTransformer', 'tokenizeMaxLineLength', 'tokenizeMaxLength', 'unsafeCSS', 'lineHoverHighlight', 'enableTokenInteractionsOnWhitespace', 'enableGutterUtility', '__debugPointerEvents', 'enableLineSelection', 'controlledSelection', 'disableErrorHandling'];
|
|
78
84
|
type CodeViewPassThroughOptions<LAnnotation> = Pick<FileDiffOptions<LAnnotation>, CodeViewDiffOptionKeys>;
|
|
79
85
|
declare const CODE_VIEW_SHARED_CALLBACK_KEYS: readonly ['renderCustomHeader', 'renderHeaderPrefix', 'renderHeaderFilenameSuffix', 'renderHeaderMetadata', 'renderAnnotation', 'renderGutterUtility', 'onPostRender', 'onGutterUtilityClick', 'onLineClick', 'onLineNumberClick', 'onLineEnter', 'onLineLeave', 'onTokenClick', 'onTokenEnter', 'onTokenLeave'];
|
|
80
86
|
declare const CODE_VIEW_SELECTION_CALLBACK_KEYS: readonly ['onLineSelected', 'onLineSelectionStart', 'onLineSelectionChange', 'onLineSelectionEnd'];
|
|
@@ -91,6 +97,45 @@ interface CodeViewOptions<LAnnotation> extends CodeViewPassThroughOptions<LAnnot
|
|
|
91
97
|
controlledSelection?: boolean;
|
|
92
98
|
onSelectedLinesChange?(selection: CodeViewLineSelection | null): void;
|
|
93
99
|
layout?: CodeViewLayout;
|
|
100
|
+
/**
|
|
101
|
+
* Create an editor for an item entering edit mode (`edit: true`). Providing
|
|
102
|
+
* this option is what enables item editing. Pass the given options into the
|
|
103
|
+
* editor constructor — `new Editor(options)` — so CodeView can route
|
|
104
|
+
* document changes to `onItemEditChange`. CodeView owns the returned
|
|
105
|
+
* editor's lifecycle: it attaches when the edited item mounts, re-attaches
|
|
106
|
+
* across virtualization unmounts, and cleans the editor up once the item
|
|
107
|
+
* stops being editable (edit off, collapsed, or removed). Returning
|
|
108
|
+
* undefined declines the attach; CodeView retries on later render passes.
|
|
109
|
+
*/
|
|
110
|
+
createEditor?(options: CodeViewCreateEditorOptions<LAnnotation>): DiffsEditorHost<LAnnotation> | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Called when an edited item's document changes, with the owning item
|
|
113
|
+
* resolved by CodeView.
|
|
114
|
+
*/
|
|
115
|
+
onItemEditChange?(item: CodeViewItem<LAnnotation>, file: FileContents, lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): void;
|
|
116
|
+
/**
|
|
117
|
+
* Called once when an item's edit session ends — edit turned off, item
|
|
118
|
+
* removed (including a controlled `setItems([])` that empties the list),
|
|
119
|
+
* item collapsed, or `createEditor` unset — with the final contents from
|
|
120
|
+
* the session's last document change. Not called when the session produced
|
|
121
|
+
* no changes, nor on a direct `reset()`/`cleanUp()` teardown.
|
|
122
|
+
*
|
|
123
|
+
* Committing is user-space: CodeView never writes item data itself. The
|
|
124
|
+
* recommended handler makes one combined item write (`updateItem` with a
|
|
125
|
+
* `version` bump) carrying the new file/fileDiff — with a fresh `cacheKey`,
|
|
126
|
+
* since the delivered contents differ from what the old key cached — along
|
|
127
|
+
* with `edit: false`.
|
|
128
|
+
*/
|
|
129
|
+
onItemEditComplete?(item: CodeViewItem<LAnnotation>, file: FileContents, lineAnnotations?: DiffLineAnnotation<LAnnotation>[]): void;
|
|
130
|
+
/** Render a non-virtualized element at the very start of the scroll content,
|
|
131
|
+
* before the first item. It is always rendered and scrolls with the content.
|
|
132
|
+
* Return the same element across calls and mutate it in place to update;
|
|
133
|
+
* height changes are measured automatically. */
|
|
134
|
+
renderCodeViewHeader?(): HTMLElement | undefined;
|
|
135
|
+
/** Render a non-virtualized element at the very end of the scroll content,
|
|
136
|
+
* after the last item. Always rendered; height changes are measured
|
|
137
|
+
* automatically. */
|
|
138
|
+
renderCodeViewFooter?(): HTMLElement | undefined;
|
|
94
139
|
/** Internal dev-only check to ensure your `itemMetrics` are correct. Its
|
|
95
140
|
* automatically disabled in a production build because it will hurt
|
|
96
141
|
* performance fairly significantly */
|
|
@@ -104,6 +149,8 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
104
149
|
private items;
|
|
105
150
|
private idToItem;
|
|
106
151
|
private selectedLines;
|
|
152
|
+
private itemEditors;
|
|
153
|
+
private attachedEditors;
|
|
107
154
|
private instanceToItem;
|
|
108
155
|
private layoutDirtyIndex;
|
|
109
156
|
private pendingLayoutReset;
|
|
@@ -135,15 +182,19 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
135
182
|
private container;
|
|
136
183
|
private stickyContainer;
|
|
137
184
|
private stickyOffset;
|
|
185
|
+
private header;
|
|
186
|
+
private footer;
|
|
138
187
|
private elementPool;
|
|
139
188
|
private elementPoolVersion;
|
|
140
189
|
private elementPoolTracker;
|
|
141
190
|
private pendingElementPool;
|
|
142
191
|
private options;
|
|
143
192
|
private workerManager;
|
|
193
|
+
private isReadySubscription;
|
|
144
194
|
private isContainerManaged;
|
|
145
195
|
constructor(options?: CodeViewOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);
|
|
146
196
|
private getLayout;
|
|
197
|
+
private getItemTopOffset;
|
|
147
198
|
private computeMetricsCache;
|
|
148
199
|
private getSmoothScrollSettings;
|
|
149
200
|
private shouldDisablePointerEvents;
|
|
@@ -154,6 +205,10 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
154
205
|
private suspendScrollInteractions;
|
|
155
206
|
private restoreScrollInteractions;
|
|
156
207
|
private syncLayout;
|
|
208
|
+
private reconcileHeaderFooterHosts;
|
|
209
|
+
private reconcileHost;
|
|
210
|
+
private setHostHeight;
|
|
211
|
+
private measureMountedHosts;
|
|
157
212
|
setup(root: HTMLElement): void;
|
|
158
213
|
reset(): void;
|
|
159
214
|
cleanUp(): void;
|
|
@@ -179,6 +234,12 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
179
234
|
getSelectedLines(): CodeViewLineSelection | null;
|
|
180
235
|
clearSelectedLines(options?: SelectionWriteOptions): void;
|
|
181
236
|
getItem(itemId: string): CodeViewItem<LAnnotation> | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Get the live editor for an item currently in edit mode. Use this to drive
|
|
239
|
+
* editor APIs CodeView does not wrap (applyEdits, undo, setMarkers, …).
|
|
240
|
+
* Returns undefined once the item leaves edit mode.
|
|
241
|
+
*/
|
|
242
|
+
getEditor(itemId: string): DiffsEditorHost<LAnnotation> | undefined;
|
|
182
243
|
updateItem(input: CodeViewItem<LAnnotation>): boolean;
|
|
183
244
|
updateItemId(oldId: string, newId: string): boolean;
|
|
184
245
|
addItem(input: CodeViewItem<LAnnotation>): void;
|
|
@@ -196,18 +257,42 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
196
257
|
setOptions(options: CodeViewOptions<LAnnotation> | undefined): void;
|
|
197
258
|
private capturePendingLayoutAnchor;
|
|
198
259
|
render(immediate?: boolean): void;
|
|
260
|
+
private isReady;
|
|
261
|
+
private clearReadySubscription;
|
|
199
262
|
instanceChanged(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>, layoutDirty: boolean): void;
|
|
200
263
|
getWindowSpecs(): VirtualWindowSpecs;
|
|
201
264
|
getContainerElement(): HTMLElement | undefined;
|
|
265
|
+
getHeaderElement(): HTMLElement | undefined;
|
|
266
|
+
getFooterElement(): HTMLElement | undefined;
|
|
202
267
|
getRenderedItems(): CodeViewRenderedItem<LAnnotation>[];
|
|
203
268
|
setSlotCoordinator(coordinator?: CodeViewCoordinator<LAnnotation>): boolean;
|
|
204
|
-
getSlotSnapshot(coordinator: CodeViewCoordinator<LAnnotation>):
|
|
269
|
+
getSlotSnapshot(coordinator: CodeViewCoordinator<LAnnotation>): CodeViewSlotSnapshot<LAnnotation> | undefined;
|
|
270
|
+
private buildSlotSnapshot;
|
|
205
271
|
subscribeToScroll(listener: CodeViewScrollListener<LAnnotation>): () => void;
|
|
206
272
|
getLocalTopForInstance(instance: VirtualizedFile<LAnnotation> | VirtualizedFileDiff<LAnnotation>): number;
|
|
207
273
|
getTopForItem(id: string): number | undefined;
|
|
208
274
|
private createItem;
|
|
209
275
|
private applySelectedLines;
|
|
210
276
|
private syncSelection;
|
|
277
|
+
private isItemInEditMode;
|
|
278
|
+
private isReceiverEdited;
|
|
279
|
+
/**
|
|
280
|
+
* Attach (or lazily create) the editor for a mounted edit-mode item. Called
|
|
281
|
+
* from the render loop so every mounted item passes through it: fresh
|
|
282
|
+
* mounts, remounts after virtualization released the item, and items whose
|
|
283
|
+
* edit flag was just turned on. Editors persist across unmounts, so a
|
|
284
|
+
* remounted item re-attaches its existing editor and resumes the retained
|
|
285
|
+
* document; the renderers keep the host's file/diff data in sync with the
|
|
286
|
+
* session so the remount paints the edited text.
|
|
287
|
+
*/
|
|
288
|
+
private attachItemEditor;
|
|
289
|
+
/**
|
|
290
|
+
* Drop editors for items that can no longer be edited: removed, edit turned
|
|
291
|
+
* off, collapsed, or the createEditor option was unset. Attachment happens
|
|
292
|
+
* in the render loop via attachItemEditor, so this only reconciles editors
|
|
293
|
+
* CodeView is already holding.
|
|
294
|
+
*/
|
|
295
|
+
private syncItemEditors;
|
|
211
296
|
private renamePendingScrollTarget;
|
|
212
297
|
private renamePendingLayoutAnchor;
|
|
213
298
|
private createFileOptionsPrototype;
|
|
@@ -385,5 +470,5 @@ declare class CodeView<LAnnotation = undefined> {
|
|
|
385
470
|
private getFitPerfectlyOverscroll;
|
|
386
471
|
}
|
|
387
472
|
//#endregion
|
|
388
|
-
export { CodeView, CodeViewCoordinator, CodeViewLineSelection, CodeViewOptions, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollListener };
|
|
473
|
+
export { CODE_VIEW_DIFF_OPTION_KEYS, CODE_VIEW_FILE_OPTION_KEYS, CodeView, CodeViewCoordinator, CodeViewLineSelection, CodeViewOptions, CodeViewRenderedDiffItem, CodeViewRenderedFileItem, CodeViewRenderedItem, CodeViewScrollListener, CodeViewSlotSnapshot };
|
|
389
474
|
//# sourceMappingURL=CodeView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeView.d.ts","names":[],"sources":["../../src/components/CodeView.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CodeView.d.ts","names":[],"sources":["../../src/components/CodeView.ts"],"mappings":";;;;;;;;;;UA4GU,2BAAA;;EAER,KAAA;EAFQ;EAIR,GAAA;;EAEA,MAAA;EAJA;;EAOA,OAAA,EAAS,WAAW;EAApB;EAEA,OAAA;EAAA;EAEA,uBAAA;AAAA;AAAA,UAGQ,uBAAA,sBAEA,2BAAA;EACR,IAAA;EAH+B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