xtralab 0.14.1 → 0.15.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/README.md +10 -0
- package/lib/about/icons.d.ts +0 -5
- package/lib/about/icons.js +0 -5
- package/lib/about/index.d.ts +4 -8
- package/lib/about/index.js +6 -17
- package/lib/agentSessions.d.ts +9 -29
- package/lib/agentSessions.js +2 -7
- package/lib/askAgent/editorSelection.d.ts +20 -26
- package/lib/askAgent/editorSelection.js +11 -26
- package/lib/askAgent/icons.d.ts +2 -3
- package/lib/askAgent/icons.js +2 -3
- package/lib/askAgent/index.d.ts +4 -26
- package/lib/askAgent/index.js +54 -158
- package/lib/askAgent/popup.d.ts +12 -16
- package/lib/askAgent/popup.js +18 -37
- package/lib/askAgent/prompt.d.ts +3 -5
- package/lib/askAgent/prompt.js +6 -19
- package/lib/askAgent/queue.d.ts +11 -21
- package/lib/askAgent/queue.js +9 -19
- package/lib/askAgent/queuePanel.d.ts +13 -18
- package/lib/askAgent/queuePanel.js +15 -37
- package/lib/askAgent/targetPicker.d.ts +2 -9
- package/lib/askAgent/targetPicker.js +6 -11
- package/lib/askAgent/tokens.d.ts +32 -46
- package/lib/askAgent/tokens.js +4 -6
- package/lib/commandBar/index.d.ts +4 -13
- package/lib/commandBar/index.js +21 -39
- package/lib/customPanel/index.d.ts +7 -0
- package/lib/customPanel/index.js +89 -0
- package/lib/editorBreadcrumbs/index.d.ts +3 -6
- package/lib/editorBreadcrumbs/index.js +10 -6
- package/lib/editorBreadcrumbs/widget.d.ts +17 -4
- package/lib/editorBreadcrumbs/widget.js +11 -17
- package/lib/editorIndent/index.d.ts +4 -12
- package/lib/editorIndent/index.js +8 -23
- package/lib/fileBrowser/commands.d.ts +28 -19
- package/lib/fileBrowser/commands.js +51 -98
- package/lib/fileBrowser/contents.d.ts +14 -0
- package/lib/fileBrowser/contents.js +28 -0
- package/lib/fileBrowser/dragAndDrop.d.ts +79 -0
- package/lib/fileBrowser/dragAndDrop.js +110 -0
- package/lib/fileBrowser/fileBrowser.d.ts +21 -9
- package/lib/fileBrowser/fileBrowser.js +211 -405
- package/lib/fileBrowser/gitStatus.d.ts +4 -9
- package/lib/fileBrowser/gitStatus.js +7 -17
- package/lib/fileBrowser/gitignore.d.ts +4 -17
- package/lib/fileBrowser/gitignore.js +4 -25
- package/lib/fileBrowser/icons.d.ts +7 -17
- package/lib/fileBrowser/icons.js +25 -80
- package/lib/fileBrowser/index.js +41 -10
- package/lib/fileBrowser/widget.d.ts +170 -53
- package/lib/fileBrowser/widget.js +242 -18
- package/lib/fileTypeIcons/index.js +0 -10
- package/lib/git/api.d.ts +5 -13
- package/lib/git/api.js +10 -36
- package/lib/git/askRequest.d.ts +4 -8
- package/lib/git/askRequest.js +6 -20
- package/lib/git/commands.d.ts +40 -5
- package/lib/git/commands.js +16 -10
- package/lib/git/diffModel.js +4 -0
- package/lib/git/diffSurface.d.ts +41 -55
- package/lib/git/diffSurface.js +42 -117
- package/lib/git/diffWidget.d.ts +81 -2
- package/lib/git/diffWidget.js +62 -12
- package/lib/git/imageDiff.d.ts +5 -6
- package/lib/git/imageDiff.js +18 -48
- package/lib/git/index.d.ts +0 -3
- package/lib/git/index.js +3 -8
- package/lib/git/notebookDiff.d.ts +110 -33
- package/lib/git/notebookDiff.js +52 -195
- package/lib/git/tokens.d.ts +73 -31
- package/lib/git/tokens.js +2 -3
- package/lib/highlight/index.d.ts +4 -10
- package/lib/highlight/index.js +10 -41
- package/lib/index.d.ts +0 -9
- package/lib/index.js +2 -9
- package/lib/launcher/agents.d.ts +55 -51
- package/lib/launcher/agents.js +25 -54
- package/lib/launcher/availability.d.ts +3 -9
- package/lib/launcher/availability.js +3 -9
- package/lib/launcher/commands.d.ts +7 -32
- package/lib/launcher/commands.js +14 -45
- package/lib/launcher/dashboard.d.ts +19 -24
- package/lib/launcher/dashboard.js +21 -67
- package/lib/launcher/editorRegistry.d.ts +10 -22
- package/lib/launcher/editorRegistry.js +14 -18
- package/lib/launcher/editors.d.ts +39 -45
- package/lib/launcher/editors.js +8 -34
- package/lib/launcher/icons.d.ts +0 -12
- package/lib/launcher/icons.js +14 -37
- package/lib/launcher/index.js +12 -55
- package/lib/launcher/invocation.d.ts +4 -10
- package/lib/launcher/invocation.js +7 -22
- package/lib/launcher/registry.d.ts +9 -7
- package/lib/launcher/registry.js +9 -7
- package/lib/launcher/schemaDefaults.d.ts +2 -9
- package/lib/launcher/schemaDefaults.js +37 -13
- package/lib/launcher/tokens.d.ts +10 -22
- package/lib/launcher/tokens.js +5 -8
- package/lib/menuBar/index.d.ts +3 -10
- package/lib/menuBar/index.js +11 -28
- package/lib/menus/index.d.ts +3 -9
- package/lib/menus/index.js +14 -30
- package/lib/omnibox/files.d.ts +2 -4
- package/lib/omnibox/files.js +5 -11
- package/lib/omnibox/index.d.ts +4 -14
- package/lib/omnibox/index.js +9 -27
- package/lib/omnibox/model.d.ts +38 -10
- package/lib/omnibox/model.js +15 -33
- package/lib/omnibox/recents.d.ts +15 -17
- package/lib/omnibox/recents.js +12 -17
- package/lib/omnibox/tokens.d.ts +5 -10
- package/lib/omnibox/tokens.js +2 -6
- package/lib/omnibox/widget.d.ts +11 -7
- package/lib/omnibox/widget.js +8 -16
- package/lib/searchReplace/index.d.ts +4 -20
- package/lib/searchReplace/index.js +7 -27
- package/lib/showOutput/index.d.ts +3 -12
- package/lib/showOutput/index.js +6 -22
- package/lib/sidebar/index.d.ts +4 -13
- package/lib/sidebar/index.js +73 -46
- package/lib/terminalNotifications/index.d.ts +4 -10
- package/lib/terminalNotifications/index.js +6 -20
- package/lib/terminals/agentTerminals.d.ts +12 -5
- package/lib/terminals/agentTerminals.js +25 -44
- package/lib/terminals/detection.d.ts +4 -8
- package/lib/terminals/detection.js +4 -8
- package/lib/terminals/index.d.ts +0 -33
- package/lib/terminals/index.js +24 -102
- package/lib/terminals/model.d.ts +64 -139
- package/lib/terminals/model.js +80 -220
- package/lib/terminals/tokens.d.ts +11 -22
- package/lib/terminals/tokens.js +2 -2
- package/lib/terminals/widget.d.ts +72 -38
- package/lib/terminals/widget.js +173 -73
- package/lib/topBar/icons.d.ts +3 -8
- package/lib/topBar/icons.js +3 -8
- package/lib/topBar/index.d.ts +4 -11
- package/lib/topBar/index.js +10 -38
- package/lib/walkthrough/index.d.ts +4 -9
- package/lib/walkthrough/index.js +6 -20
- package/lib/walkthrough/panel.d.ts +40 -9
- package/lib/walkthrough/panel.js +4 -10
- package/package.json +2 -2
- package/schema/launcher.json +2 -2
- package/schema/sidebar.json +47 -7
- package/src/about/icons.ts +0 -5
- package/src/about/index.tsx +6 -17
- package/src/agentSessions.ts +9 -29
- package/src/askAgent/editorSelection.ts +22 -29
- package/src/askAgent/icons.ts +2 -3
- package/src/askAgent/index.ts +54 -158
- package/src/askAgent/popup.tsx +23 -45
- package/src/askAgent/prompt.ts +6 -19
- package/src/askAgent/queue.ts +13 -24
- package/src/askAgent/queuePanel.tsx +21 -46
- package/src/askAgent/targetPicker.tsx +5 -15
- package/src/askAgent/tokens.ts +32 -46
- package/src/commandBar/index.ts +24 -39
- package/src/customPanel/index.ts +119 -0
- package/src/editorBreadcrumbs/index.ts +10 -6
- package/src/editorBreadcrumbs/widget.ts +23 -17
- package/src/editorIndent/index.ts +17 -23
- package/src/fileBrowser/commands.ts +70 -98
- package/src/fileBrowser/contents.ts +33 -0
- package/src/fileBrowser/dragAndDrop.ts +188 -0
- package/src/fileBrowser/fileBrowser.tsx +259 -440
- package/src/fileBrowser/gitStatus.ts +7 -17
- package/src/fileBrowser/gitignore.ts +4 -25
- package/src/fileBrowser/icons.ts +25 -80
- package/src/fileBrowser/index.ts +43 -10
- package/src/fileBrowser/widget.tsx +344 -64
- package/src/fileTypeIcons/index.ts +0 -10
- package/src/git/api.ts +10 -36
- package/src/git/askRequest.ts +6 -20
- package/src/git/commands.ts +70 -10
- package/src/git/diffModel.ts +25 -0
- package/src/git/diffSurface.tsx +71 -159
- package/src/git/diffWidget.tsx +104 -14
- package/src/git/imageDiff.tsx +45 -51
- package/src/git/index.ts +3 -8
- package/src/git/notebookDiff.tsx +211 -238
- package/src/git/tokens.ts +73 -31
- package/src/highlight/index.ts +10 -41
- package/src/index.ts +2 -9
- package/src/launcher/agents.ts +74 -92
- package/src/launcher/availability.ts +3 -9
- package/src/launcher/commands.ts +14 -51
- package/src/launcher/dashboard.tsx +49 -88
- package/src/launcher/editorRegistry.ts +21 -29
- package/src/launcher/editors.ts +39 -58
- package/src/launcher/icons.ts +15 -37
- package/src/launcher/index.ts +12 -55
- package/src/launcher/invocation.ts +7 -22
- package/src/launcher/registry.ts +9 -7
- package/src/launcher/schemaDefaults.ts +43 -13
- package/src/launcher/tokens.ts +10 -22
- package/src/menuBar/index.ts +11 -28
- package/src/menus/index.ts +14 -30
- package/src/omnibox/files.ts +10 -14
- package/src/omnibox/index.ts +9 -27
- package/src/omnibox/model.ts +50 -38
- package/src/omnibox/recents.ts +17 -22
- package/src/omnibox/tokens.ts +5 -10
- package/src/omnibox/widget.tsx +14 -19
- package/src/searchReplace/index.ts +7 -27
- package/src/showOutput/index.ts +6 -22
- package/src/sidebar/index.ts +103 -52
- package/src/terminalNotifications/index.ts +42 -25
- package/src/terminals/agentTerminals.ts +25 -49
- package/src/terminals/detection.ts +4 -8
- package/src/terminals/index.ts +31 -102
- package/src/terminals/model.ts +130 -246
- package/src/terminals/tokens.ts +11 -22
- package/src/terminals/widget.tsx +229 -113
- package/src/topBar/icons.ts +3 -8
- package/src/topBar/index.ts +21 -44
- package/src/walkthrough/index.ts +6 -20
- package/src/walkthrough/panel.ts +40 -10
- package/style/about.css +2 -7
- package/style/askAgent.css +8 -40
- package/style/base.css +25 -73
- package/style/chrome.css +108 -308
- package/style/commandBar.css +4 -20
- package/style/customPanel.css +6 -0
- package/style/git.css +22 -184
- package/style/highlight.css +1 -3
- package/style/index.js +1 -0
- package/style/launcher.css +6 -70
- package/style/omnibox.css +2 -14
- package/style/showOutput.css +0 -6
- package/style/sidebar.css +29 -9
- package/style/tabs.css +5 -13
- package/style/terminals.css +18 -123
- package/style/topBar.css +2 -22
- package/style/walkthrough.css +0 -8
package/lib/git/commands.d.ts
CHANGED
|
@@ -17,15 +17,24 @@ export declare namespace CommandIDs {
|
|
|
17
17
|
* Argument shapes used by {@link CommandIDs.openDiff}.
|
|
18
18
|
*/
|
|
19
19
|
export declare namespace CommandArguments {
|
|
20
|
+
/**
|
|
21
|
+
* The arguments for the open-diff command.
|
|
22
|
+
*/
|
|
20
23
|
interface IOpenDiff {
|
|
24
|
+
/**
|
|
25
|
+
* The server-relative path of the repository containing the change.
|
|
26
|
+
*/
|
|
21
27
|
repoPath: string;
|
|
28
|
+
/**
|
|
29
|
+
* The file change to show.
|
|
30
|
+
*/
|
|
22
31
|
change: IFileChange;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to open the diff as a pinned tab instead of the shared preview.
|
|
34
|
+
*/
|
|
23
35
|
pin?: boolean;
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Widget id of the single, reused preview diff tab.
|
|
28
|
-
*/
|
|
29
38
|
export declare const PREVIEW_DIFF_WIDGET_ID = "xtralab:diff:preview";
|
|
30
39
|
/**
|
|
31
40
|
* Deterministic widget id for a pinned file/group pair.
|
|
@@ -36,18 +45,42 @@ export declare function pinnedDiffWidgetId(change: IFileChange): string;
|
|
|
36
45
|
*/
|
|
37
46
|
export declare class DiffMainAreaWidget extends MainAreaWidget<XtralabDiffWidget> {
|
|
38
47
|
constructor(options: MainAreaWidget.IOptions<XtralabDiffWidget>, change: IFileChange, pinned: boolean, trans: TranslationBundle);
|
|
48
|
+
/**
|
|
49
|
+
* The file change currently displayed.
|
|
50
|
+
*/
|
|
39
51
|
get change(): IFileChange;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the widget is pinned rather than the shared preview.
|
|
54
|
+
*/
|
|
40
55
|
get pinned(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Pin the widget; a no-op when already pinned.
|
|
58
|
+
*/
|
|
41
59
|
pin(): void;
|
|
60
|
+
/**
|
|
61
|
+
* A signal emitted when the widget becomes pinned.
|
|
62
|
+
*/
|
|
42
63
|
get pinnedChanged(): ISignal<this, boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Display a new file change and update the tab title, caption, and icon.
|
|
66
|
+
*/
|
|
43
67
|
setChange(repoPath: string, change: IFileChange): void;
|
|
44
68
|
private _change;
|
|
45
69
|
private _pinned;
|
|
46
70
|
private _trans;
|
|
47
71
|
private _pinnedChanged;
|
|
48
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The options for {@link registerGitCommands}.
|
|
75
|
+
*/
|
|
49
76
|
interface IRegisterGitCommandsOptions {
|
|
77
|
+
/**
|
|
78
|
+
* The JupyterLab application, providing the commands registry and shell.
|
|
79
|
+
*/
|
|
50
80
|
app: JupyterFrontEnd;
|
|
81
|
+
/**
|
|
82
|
+
* Theme manager the diff views follow; may be `null`.
|
|
83
|
+
*/
|
|
51
84
|
themeManager: IThemeManager | null;
|
|
52
85
|
/**
|
|
53
86
|
* Contents manager used to write hunk-discard results.
|
|
@@ -73,11 +106,13 @@ interface IRegisterGitCommandsOptions {
|
|
|
73
106
|
* Look up an already-open diff widget for a file change.
|
|
74
107
|
*/
|
|
75
108
|
findDiff(change: IFileChange, pin?: boolean): DiffMainAreaWidget | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Callback invoked when a preview diff widget becomes pinned.
|
|
111
|
+
*/
|
|
76
112
|
onPinned(widget: DiffMainAreaWidget): void;
|
|
77
113
|
}
|
|
78
114
|
/**
|
|
79
|
-
* Register the launcher's git diff command
|
|
80
|
-
* registry.
|
|
115
|
+
* Register the launcher's git diff command.
|
|
81
116
|
*/
|
|
82
117
|
export declare function registerGitCommands(options: IRegisterGitCommandsOptions): void;
|
|
83
118
|
export {};
|
package/lib/git/commands.js
CHANGED
|
@@ -11,9 +11,6 @@ export var CommandIDs;
|
|
|
11
11
|
(function (CommandIDs) {
|
|
12
12
|
CommandIDs.openDiff = 'xtralab:git:open-diff';
|
|
13
13
|
})(CommandIDs || (CommandIDs = {}));
|
|
14
|
-
/**
|
|
15
|
-
* Widget id of the single, reused preview diff tab.
|
|
16
|
-
*/
|
|
17
14
|
export const PREVIEW_DIFF_WIDGET_ID = 'xtralab:diff:preview';
|
|
18
15
|
/**
|
|
19
16
|
* Deterministic widget id for a pinned file/group pair.
|
|
@@ -38,12 +35,21 @@ export class DiffMainAreaWidget extends MainAreaWidget {
|
|
|
38
35
|
this._pinned = pinned;
|
|
39
36
|
this._trans = trans;
|
|
40
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The file change currently displayed.
|
|
40
|
+
*/
|
|
41
41
|
get change() {
|
|
42
42
|
return this._change;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether the widget is pinned rather than the shared preview.
|
|
46
|
+
*/
|
|
44
47
|
get pinned() {
|
|
45
48
|
return this._pinned;
|
|
46
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Pin the widget; a no-op when already pinned.
|
|
52
|
+
*/
|
|
47
53
|
pin() {
|
|
48
54
|
if (this._pinned) {
|
|
49
55
|
return;
|
|
@@ -51,9 +57,15 @@ export class DiffMainAreaWidget extends MainAreaWidget {
|
|
|
51
57
|
this._pinned = true;
|
|
52
58
|
this._pinnedChanged.emit(true);
|
|
53
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* A signal emitted when the widget becomes pinned.
|
|
62
|
+
*/
|
|
54
63
|
get pinnedChanged() {
|
|
55
64
|
return this._pinnedChanged;
|
|
56
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Display a new file change and update the tab title, caption, and icon.
|
|
68
|
+
*/
|
|
57
69
|
setChange(repoPath, change) {
|
|
58
70
|
this._change = change;
|
|
59
71
|
this.content.setModel(fileChangeToDiffModel(repoPath, change));
|
|
@@ -62,9 +74,6 @@ export class DiffMainAreaWidget extends MainAreaWidget {
|
|
|
62
74
|
this.title.icon = getTreeIcon(change.path);
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Build the launcher's diff tab around the shared diff widget.
|
|
67
|
-
*/
|
|
68
77
|
function createDiffWidget(options) {
|
|
69
78
|
var _a;
|
|
70
79
|
const { repoPath, change, themeManager, contentsManager, rendermime, askAgent, trans } = options;
|
|
@@ -89,7 +98,6 @@ function createDiffWidget(options) {
|
|
|
89
98
|
}
|
|
90
99
|
widget.toolbar.addItem('pin', pinButton);
|
|
91
100
|
addDiffToolbarItems(widget.toolbar, content);
|
|
92
|
-
// Keep chrome visible only while there is a relevant toolbar control.
|
|
93
101
|
const syncToolbarVisibility = () => {
|
|
94
102
|
if (widget.isDisposed) {
|
|
95
103
|
return;
|
|
@@ -115,7 +123,6 @@ function createDiffWidget(options) {
|
|
|
115
123
|
}
|
|
116
124
|
syncToolbarVisibility();
|
|
117
125
|
};
|
|
118
|
-
// Auto-close once a discard leaves nothing to show.
|
|
119
126
|
const onEmptied = () => {
|
|
120
127
|
if (!widget.isDisposed) {
|
|
121
128
|
widget.close();
|
|
@@ -135,8 +142,7 @@ function createDiffWidget(options) {
|
|
|
135
142
|
return widget;
|
|
136
143
|
}
|
|
137
144
|
/**
|
|
138
|
-
* Register the launcher's git diff command
|
|
139
|
-
* registry.
|
|
145
|
+
* Register the launcher's git diff command.
|
|
140
146
|
*/
|
|
141
147
|
export function registerGitCommands(options) {
|
|
142
148
|
const { app, themeManager, contentsManager, rendermime, askAgent, trans, trackDiff, findDiff, onPinned } = options;
|
package/lib/git/diffModel.js
CHANGED
|
@@ -40,6 +40,10 @@ function referenceSource(ref) {
|
|
|
40
40
|
class FileChangeDiffModel {
|
|
41
41
|
constructor(repoPath, change) {
|
|
42
42
|
var _a;
|
|
43
|
+
/**
|
|
44
|
+
* A signal emitted when the reference or challenger changes; this static
|
|
45
|
+
* model never emits it.
|
|
46
|
+
*/
|
|
43
47
|
this.changed = new Signal(this);
|
|
44
48
|
const { oldRef, newRef } = resolveReferences(change);
|
|
45
49
|
// Renames compare the new path against the old path's previous content.
|
package/lib/git/diffSurface.d.ts
CHANGED
|
@@ -3,33 +3,28 @@ import { IThemeManager } from '@jupyterlab/apputils';
|
|
|
3
3
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
4
4
|
import type { TranslationBundle } from '@jupyterlab/translation';
|
|
5
5
|
import { type SelectedLineRange } from '@pierre/diffs';
|
|
6
|
-
/**
|
|
7
|
-
* The CSS class added to the diff main-area widget. The selectors that
|
|
8
|
-
* style the embedded `@pierre/diffs` viewer hang off this class.
|
|
9
|
-
*/
|
|
10
6
|
export declare const DIFF_WIDGET_CSS_CLASS = "jp-xtralab-DiffWidget";
|
|
7
|
+
export type DiffStyle = 'split' | 'unified';
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
* `diffStyle` option. `split` is the side-by-side old|new view; `unified`
|
|
14
|
-
* is the single-column inline view (what diffs.com calls "stacked").
|
|
9
|
+
* Read the persisted diff style, defaulting to `'split'`.
|
|
15
10
|
*/
|
|
16
|
-
export type DiffStyle = 'split' | 'unified';
|
|
17
11
|
export declare function readStoredDiffStyle(): DiffStyle;
|
|
18
|
-
export declare function writeStoredDiffStyle(style: DiffStyle): void;
|
|
19
12
|
/**
|
|
20
|
-
*
|
|
21
|
-
* rendered view; `json` is the raw nbformat JSON file diff, for inspecting
|
|
22
|
-
* exactly which bytes changed.
|
|
13
|
+
* Persist the diff style to local storage (best-effort).
|
|
23
14
|
*/
|
|
15
|
+
export declare function writeStoredDiffStyle(style: DiffStyle): void;
|
|
24
16
|
export type NotebookDiffViewMode = 'notebook' | 'json';
|
|
17
|
+
/**
|
|
18
|
+
* Read the persisted notebook view mode, defaulting to `'notebook'`.
|
|
19
|
+
*/
|
|
25
20
|
export declare function readStoredNotebookViewMode(): NotebookDiffViewMode;
|
|
21
|
+
/**
|
|
22
|
+
* Persist the notebook view mode to local storage (best-effort).
|
|
23
|
+
*/
|
|
26
24
|
export declare function writeStoredNotebookViewMode(mode: NotebookDiffViewMode): void;
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
29
|
-
* `
|
|
30
|
-
* `data-jp-theme-light` attribute that JupyterLab sets on `<body>` so the
|
|
31
|
-
* component still works in stripped-down hosts where the token isn't
|
|
32
|
-
* provided (lite, certain notebook configurations, …).
|
|
26
|
+
* Dark-theme check via `IThemeManager`, falling back to the
|
|
27
|
+
* `data-jp-theme-light` body attribute for hosts without the token.
|
|
33
28
|
*/
|
|
34
29
|
export declare function isDarkTheme(themeManager: IThemeManager | null): boolean;
|
|
35
30
|
/**
|
|
@@ -37,18 +32,26 @@ export declare function isDarkTheme(themeManager: IThemeManager | null): boolean
|
|
|
37
32
|
*/
|
|
38
33
|
export declare function isPierreTheme(themeManager: IThemeManager | null): boolean;
|
|
39
34
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* reverts that hunk and hands the rebuilt full-file text back to the host
|
|
43
|
-
* via {@link IHunkDiscard.save}. The host owns the actual write (it knows
|
|
44
|
-
* the on-disk path) and triggers any follow-up refresh in
|
|
45
|
-
* {@link IHunkDiscard.onAfterSave}.
|
|
35
|
+
* Per-hunk discard wiring: discarding rebuilds the full file text and the
|
|
36
|
+
* host owns the write via `save`, then refreshes in `onAfterSave`.
|
|
46
37
|
*/
|
|
47
38
|
interface IHunkDiscard {
|
|
39
|
+
/**
|
|
40
|
+
* Whether hunk discarding is available.
|
|
41
|
+
*/
|
|
48
42
|
enabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Persist the full post-discard file text.
|
|
45
|
+
*/
|
|
49
46
|
save: (fullText: string) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Called after a successful save so the host can refresh the diff.
|
|
49
|
+
*/
|
|
50
50
|
onAfterSave: () => void;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The props for the {@link DiffSurface} component.
|
|
54
|
+
*/
|
|
52
55
|
interface IDiffSurfaceProps {
|
|
53
56
|
/**
|
|
54
57
|
* Whether the host is still resolving the file contents.
|
|
@@ -71,13 +74,11 @@ interface IDiffSurfaceProps {
|
|
|
71
74
|
*/
|
|
72
75
|
newText: string;
|
|
73
76
|
/**
|
|
74
|
-
* New-side path
|
|
75
|
-
* name on the additions side.
|
|
77
|
+
* New-side path; drives notebook detection and the highlighting filename.
|
|
76
78
|
*/
|
|
77
79
|
newName: string;
|
|
78
80
|
/**
|
|
79
|
-
* Old-side path
|
|
80
|
-
* to {@link newName} when the host does not track a previous path.
|
|
81
|
+
* Old-side path; differs from {@link newName} only for renames.
|
|
81
82
|
*/
|
|
82
83
|
oldName?: string;
|
|
83
84
|
/**
|
|
@@ -89,35 +90,28 @@ interface IDiffSurfaceProps {
|
|
|
89
90
|
*/
|
|
90
91
|
pierreTheme: boolean;
|
|
91
92
|
/**
|
|
92
|
-
*
|
|
93
|
-
* markdown cells. May be `null` in stripped-down hosts; the notebook
|
|
94
|
-
* diff falls back to a textual representation in that case.
|
|
93
|
+
* Used by the notebook view; `null` in stripped-down hosts, which forces a textual fallback.
|
|
95
94
|
*/
|
|
96
95
|
rendermime: IRenderMimeRegistry | null;
|
|
97
96
|
/**
|
|
98
|
-
*
|
|
97
|
+
* Rendered-vs-JSON choice for notebook diffs (host-controlled).
|
|
99
98
|
*/
|
|
100
99
|
notebookViewMode: NotebookDiffViewMode;
|
|
101
100
|
/**
|
|
102
|
-
* Split vs unified layout for the textual
|
|
101
|
+
* Split vs unified layout for the textual file diff (host-controlled).
|
|
103
102
|
*/
|
|
104
103
|
diffStyle: DiffStyle;
|
|
105
104
|
/**
|
|
106
|
-
*
|
|
107
|
-
* so the host can show/hide its Notebook/JSON toolbar toggle.
|
|
105
|
+
* Fires when rendered-notebook availability changes so the host can toggle its Notebook/JSON control.
|
|
108
106
|
*/
|
|
109
107
|
onNotebookAvailabilityChange?: (available: boolean) => void;
|
|
110
108
|
/**
|
|
111
|
-
*
|
|
112
|
-
* unified choice affects) becomes the active view, so the host can
|
|
113
|
-
* show/hide its Split/Unified toolbar toggle. False for image, binary,
|
|
114
|
-
* rendered-notebook, loading and error states.
|
|
109
|
+
* Fires when the textual file diff becomes (in)active — the only view the split/unified choice affects.
|
|
115
110
|
*/
|
|
116
111
|
onFileDiffActiveChange?: (active: boolean) => void;
|
|
117
112
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* post-discard behaviors such as auto-closing an emptied diff.
|
|
113
|
+
* Fires after each diff computation with the hunk count (`null` when no
|
|
114
|
+
* textual diff); hosts use it to auto-close emptied diffs.
|
|
121
115
|
*/
|
|
122
116
|
onMetadataChange?: (info: {
|
|
123
117
|
hunkCount: number | null;
|
|
@@ -127,11 +121,8 @@ interface IDiffSurfaceProps {
|
|
|
127
121
|
*/
|
|
128
122
|
hunkDiscard?: IHunkDiscard;
|
|
129
123
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* button appears on the hovered/selected lines. Clicking that button
|
|
133
|
-
* invokes this callback with the selected range and the button's viewport
|
|
134
|
-
* rectangle (to anchor a popup to), `null` when it cannot be measured.
|
|
124
|
+
* Enables line selection and the gutter "+" button; called with the
|
|
125
|
+
* selected range and the button's viewport rect (`null` when unmeasurable).
|
|
135
126
|
*/
|
|
136
127
|
onLineAsk?: (range: SelectedLineRange, anchor: DOMRect | null) => void;
|
|
137
128
|
/**
|
|
@@ -144,10 +135,8 @@ interface IDiffSurfaceProps {
|
|
|
144
135
|
*/
|
|
145
136
|
export declare function DiffSurface(props: IDiffSurfaceProps): React.ReactElement;
|
|
146
137
|
/**
|
|
147
|
-
* Segmented Notebook/JSON selector. Hosts mount
|
|
148
|
-
*
|
|
149
|
-
* `jupyterlab-git`-provided diff toolbar) and drive its value/visibility
|
|
150
|
-
* from the same state they pass to {@link DiffSurface}.
|
|
138
|
+
* Segmented Notebook/JSON selector. Hosts mount it into their own toolbar
|
|
139
|
+
* and drive value/visibility from the state they pass to {@link DiffSurface}.
|
|
151
140
|
*/
|
|
152
141
|
export declare function NotebookViewModeControl(props: {
|
|
153
142
|
mode: NotebookDiffViewMode;
|
|
@@ -156,11 +145,8 @@ export declare function NotebookViewModeControl(props: {
|
|
|
156
145
|
trans: TranslationBundle;
|
|
157
146
|
}): React.ReactElement;
|
|
158
147
|
/**
|
|
159
|
-
* Segmented Split/Unified selector
|
|
160
|
-
*
|
|
161
|
-
* the same state they pass to {@link DiffSurface}. Only meaningful while the
|
|
162
|
-
* textual/code file diff is the active view, so `available` mirrors the
|
|
163
|
-
* surface's `onFileDiffActiveChange`.
|
|
148
|
+
* Segmented Split/Unified selector; mirrors {@link NotebookViewModeControl}.
|
|
149
|
+
* `available` mirrors the surface's `onFileDiffActiveChange`.
|
|
164
150
|
*/
|
|
165
151
|
export declare function DiffStyleControl(props: {
|
|
166
152
|
diffStyle: DiffStyle;
|