xtralab 0.15.0 → 0.15.2
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 +65 -30
- 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.js +15 -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 +29 -19
- package/lib/fileBrowser/commands.js +83 -97
- package/lib/fileBrowser/contents.d.ts +3 -0
- package/lib/fileBrowser/dragAndDrop.d.ts +17 -4
- package/lib/fileBrowser/dragAndDrop.js +2 -7
- package/lib/fileBrowser/fileBrowser.d.ts +19 -9
- package/lib/fileBrowser/fileBrowser.js +70 -222
- package/lib/fileBrowser/gitStatus.d.ts +16 -10
- package/lib/fileBrowser/gitStatus.js +31 -30
- 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 +2 -4
- package/lib/fileBrowser/widget.d.ts +141 -48
- package/lib/fileBrowser/widget.js +102 -4
- 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 +45 -5
- package/lib/git/commands.js +20 -13
- package/lib/git/diffModel.js +4 -0
- package/lib/git/diffPreferences.d.ts +90 -0
- package/lib/git/diffPreferences.js +107 -0
- package/lib/git/diffProvider.js +10 -2
- package/lib/git/diffSurface.d.ts +64 -63
- package/lib/git/diffSurface.js +72 -213
- package/lib/git/diffTheme.d.ts +7 -0
- package/lib/git/diffTheme.js +23 -0
- package/lib/git/diffWidget.d.ts +70 -14
- package/lib/git/diffWidget.js +100 -94
- package/lib/git/imageDiff.d.ts +14 -6
- package/lib/git/imageDiff.js +19 -75
- package/lib/git/index.d.ts +0 -3
- package/lib/git/index.js +44 -10
- package/lib/git/notebookDiff.d.ts +110 -33
- package/lib/git/notebookDiff.js +55 -197
- 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 +0 -9
- package/lib/launcher/agents.d.ts +55 -51
- package/lib/launcher/agents.js +15 -57
- 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 +5 -39
- 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/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 -7
- package/lib/sidebar/index.js +5 -12
- 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 -35
- package/lib/terminals/index.js +12 -101
- 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 +43 -13
- package/lib/terminals/widget.js +33 -18
- 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 +5 -3
- package/schema/git-diff-preferences.json +42 -0
- 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 +15 -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 +119 -96
- package/src/fileBrowser/contents.ts +3 -0
- package/src/fileBrowser/dragAndDrop.ts +17 -7
- package/src/fileBrowser/fileBrowser.tsx +86 -230
- package/src/fileBrowser/gitStatus.ts +36 -33
- package/src/fileBrowser/gitignore.ts +4 -25
- package/src/fileBrowser/icons.ts +25 -80
- package/src/fileBrowser/index.ts +2 -4
- package/src/fileBrowser/widget.tsx +171 -50
- 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 +83 -11
- package/src/git/diffModel.ts +25 -0
- package/src/git/diffPreferences.ts +192 -0
- package/src/git/diffProvider.tsx +11 -2
- package/src/git/diffSurface.tsx +165 -286
- package/src/git/diffTheme.ts +24 -0
- package/src/git/diffWidget.tsx +194 -134
- package/src/git/imageDiff.tsx +56 -84
- package/src/git/index.ts +54 -10
- package/src/git/notebookDiff.tsx +214 -240
- package/src/git/tokens.ts +73 -31
- package/src/highlight/index.ts +10 -41
- package/src/index.ts +0 -9
- package/src/launcher/agents.ts +64 -95
- 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 +5 -39
- package/src/launcher/index.ts +12 -55
- package/src/launcher/invocation.ts +7 -22
- package/src/launcher/registry.ts +9 -7
- 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 +20 -12
- 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 +12 -101
- package/src/terminals/model.ts +130 -246
- package/src/terminals/tokens.ts +11 -22
- package/src/terminals/widget.tsx +48 -31
- 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 +9 -45
- package/style/chrome.css +108 -308
- package/style/commandBar.css +4 -20
- package/style/customPanel.css +1 -4
- package/style/git.css +26 -186
- package/style/highlight.css +1 -3
- 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 +6 -53
- package/style/topBar.css +2 -22
- package/style/walkthrough.css +0 -8
package/lib/git/index.js
CHANGED
|
@@ -1,25 +1,60 @@
|
|
|
1
1
|
import { IThemeManager, WidgetTracker } from '@jupyterlab/apputils';
|
|
2
2
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
3
|
+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
4
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
3
5
|
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
|
|
4
6
|
import { IAskAgent } from '../askAgent/tokens';
|
|
5
7
|
import { CommandIDs, PREVIEW_DIFF_WIDGET_ID, pinnedDiffWidgetId, registerGitCommands } from './commands';
|
|
8
|
+
import { DiffPreferences, IDiffPreferences } from './diffPreferences';
|
|
6
9
|
import diffProviderPlugin from './diffProvider';
|
|
7
10
|
const GIT_DIFF_COMMAND_PLUGIN_ID = 'xtralab:git-diff-command';
|
|
11
|
+
const GIT_DIFF_PREFERENCES_PLUGIN_ID = 'xtralab:git-diff-preferences';
|
|
8
12
|
const GIT_DIFF_TRACKER_NAMESPACE = 'xtralab-git-diff';
|
|
9
13
|
/**
|
|
10
|
-
* The launcher
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
* The display choices shared by the launcher diff and the Git panel diff.
|
|
15
|
+
*/
|
|
16
|
+
const diffPreferencesPlugin = {
|
|
17
|
+
id: GIT_DIFF_PREFERENCES_PLUGIN_ID,
|
|
18
|
+
description: 'Keeps the git diff display choices in the settings and the state database.',
|
|
19
|
+
autoStart: true,
|
|
20
|
+
provides: IDiffPreferences,
|
|
21
|
+
optional: [ISettingRegistry, IStateDB],
|
|
22
|
+
activate: (app, settingRegistry, state) => {
|
|
23
|
+
const preferences = new DiffPreferences();
|
|
24
|
+
if (settingRegistry !== null) {
|
|
25
|
+
settingRegistry
|
|
26
|
+
.load(GIT_DIFF_PREFERENCES_PLUGIN_ID)
|
|
27
|
+
.then(settings => preferences.connectSettings(settings))
|
|
28
|
+
.catch(reason => {
|
|
29
|
+
console.error(`xtralab: failed to load settings for ${GIT_DIFF_PREFERENCES_PLUGIN_ID}`, reason);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (state !== null) {
|
|
33
|
+
preferences.connectState(state).catch(reason => {
|
|
34
|
+
console.error('xtralab: failed to restore the diff split', reason);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return preferences;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The launcher's git diff command plugin. The upstream git panel stays
|
|
42
|
+
* enabled; this only adds `xtralab:git:open-diff` and preview/pinned-tab
|
|
43
|
+
* tracking.
|
|
14
44
|
*/
|
|
15
45
|
const diffCommandPlugin = {
|
|
16
46
|
id: GIT_DIFF_COMMAND_PLUGIN_ID,
|
|
17
47
|
description: "The launcher dashboard's side-by-side git diff command, powered by @pierre/diffs.",
|
|
18
48
|
autoStart: true,
|
|
19
|
-
optional: [
|
|
20
|
-
|
|
49
|
+
optional: [
|
|
50
|
+
IThemeManager,
|
|
51
|
+
IRenderMimeRegistry,
|
|
52
|
+
ITranslator,
|
|
53
|
+
IAskAgent,
|
|
54
|
+
IDiffPreferences
|
|
55
|
+
],
|
|
56
|
+
activate: (app, themeManager, rendermime, translator, askAgent, preferences) => {
|
|
21
57
|
const trans = (translator !== null && translator !== void 0 ? translator : nullTranslator).load('jupyterlab');
|
|
22
|
-
// Track open diffs so repeated opens reveal the existing tab.
|
|
23
58
|
const tracker = new WidgetTracker({
|
|
24
59
|
namespace: GIT_DIFF_TRACKER_NAMESPACE
|
|
25
60
|
});
|
|
@@ -34,6 +69,7 @@ const diffCommandPlugin = {
|
|
|
34
69
|
contentsManager: app.serviceManager.contents,
|
|
35
70
|
rendermime,
|
|
36
71
|
askAgent,
|
|
72
|
+
preferences: preferences !== null && preferences !== void 0 ? preferences : new DiffPreferences(),
|
|
37
73
|
trans,
|
|
38
74
|
trackDiff: widget => tracker.add(widget),
|
|
39
75
|
onPinned: current => {
|
|
@@ -53,10 +89,8 @@ const diffCommandPlugin = {
|
|
|
53
89
|
});
|
|
54
90
|
}
|
|
55
91
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Plugins contributed by xtralab's git integration.
|
|
58
|
-
*/
|
|
59
92
|
const plugins = [
|
|
93
|
+
diffPreferencesPlugin,
|
|
60
94
|
diffCommandPlugin,
|
|
61
95
|
diffProviderPlugin
|
|
62
96
|
];
|
|
@@ -3,42 +3,103 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
|
3
3
|
import type { TranslationBundle } from '@jupyterlab/translation';
|
|
4
4
|
import { type FileDiffMetadata } from '@pierre/diffs';
|
|
5
5
|
/**
|
|
6
|
-
* Minimal slice of nbformat 4.x that the diff inspects.
|
|
7
|
-
* read (attachments, e.g.) are intentionally not narrowed — we still pass
|
|
8
|
-
* them around as part of the cell, but we never project them into the diff.
|
|
6
|
+
* Minimal slice of nbformat 4.x that the diff inspects.
|
|
9
7
|
*/
|
|
10
8
|
interface INotebookCell {
|
|
9
|
+
/**
|
|
10
|
+
* The cell type ('code', 'markdown', or 'raw').
|
|
11
|
+
*/
|
|
11
12
|
cell_type: string;
|
|
13
|
+
/**
|
|
14
|
+
* Stable cell id (nbformat >= 4.5); absent in older notebooks.
|
|
15
|
+
*/
|
|
12
16
|
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The cell source, as a single string or an array of lines.
|
|
19
|
+
*/
|
|
13
20
|
source: string | string[];
|
|
21
|
+
/**
|
|
22
|
+
* Execution outputs; present on code cells only.
|
|
23
|
+
*/
|
|
14
24
|
outputs?: INotebookOutput[];
|
|
25
|
+
/**
|
|
26
|
+
* The cell-level metadata.
|
|
27
|
+
*/
|
|
15
28
|
metadata?: Record<string, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* Execution count of a code cell; `null` when the cell has not run.
|
|
31
|
+
*/
|
|
16
32
|
execution_count?: number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Media attachments keyed by name (markdown and raw cells).
|
|
35
|
+
*/
|
|
17
36
|
attachments?: Record<string, unknown>;
|
|
18
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Minimal slice of an nbformat 4.x cell output that the diff inspects.
|
|
40
|
+
*/
|
|
19
41
|
interface INotebookOutput {
|
|
42
|
+
/**
|
|
43
|
+
* The output type ('stream', 'execute_result', 'display_data', or 'error').
|
|
44
|
+
*/
|
|
20
45
|
output_type: string;
|
|
46
|
+
/**
|
|
47
|
+
* The mime bundle of an `execute_result` or `display_data` output.
|
|
48
|
+
*/
|
|
21
49
|
data?: Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* The text of a `stream` output.
|
|
52
|
+
*/
|
|
22
53
|
text?: string | string[];
|
|
54
|
+
/**
|
|
55
|
+
* The stream name ('stdout' or 'stderr') of a `stream` output.
|
|
56
|
+
*/
|
|
23
57
|
name?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The exception name of an `error` output.
|
|
60
|
+
*/
|
|
24
61
|
ename?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The exception message of an `error` output.
|
|
64
|
+
*/
|
|
25
65
|
evalue?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The traceback lines of an `error` output; may contain ANSI escapes.
|
|
68
|
+
*/
|
|
26
69
|
traceback?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* The execution count of an `execute_result` output.
|
|
72
|
+
*/
|
|
27
73
|
execution_count?: number | null;
|
|
74
|
+
/**
|
|
75
|
+
* The output-level metadata.
|
|
76
|
+
*/
|
|
28
77
|
metadata?: Record<string, unknown>;
|
|
29
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Minimal slice of an nbformat 4.x notebook that the diff inspects.
|
|
81
|
+
*/
|
|
30
82
|
interface INotebook {
|
|
83
|
+
/**
|
|
84
|
+
* The notebook cells.
|
|
85
|
+
*/
|
|
31
86
|
cells: INotebookCell[];
|
|
87
|
+
/**
|
|
88
|
+
* The notebook-level metadata.
|
|
89
|
+
*/
|
|
32
90
|
metadata: Record<string, unknown>;
|
|
91
|
+
/**
|
|
92
|
+
* The nbformat major version.
|
|
93
|
+
*/
|
|
33
94
|
nbformat: number;
|
|
95
|
+
/**
|
|
96
|
+
* The nbformat minor version.
|
|
97
|
+
*/
|
|
34
98
|
nbformat_minor: number;
|
|
35
99
|
}
|
|
36
100
|
/**
|
|
37
|
-
* One entry in the per-cell diff. `
|
|
38
|
-
*
|
|
39
|
-
* metadata via {@link FileDiff}. The `modified` and `unchanged` branches
|
|
40
|
-
* carry the same payload but live on separate union members so `Extract`
|
|
41
|
-
* narrowing works on `kind` literals downstream.
|
|
101
|
+
* One entry in the per-cell diff. `modified` and `unchanged` carry the same
|
|
102
|
+
* payload on separate union members so `Extract` narrowing on `kind` works.
|
|
42
103
|
*/
|
|
43
104
|
type NotebookCellDiff = {
|
|
44
105
|
kind: 'modified';
|
|
@@ -62,48 +123,69 @@ type NotebookCellDiff = {
|
|
|
62
123
|
oldIndex: number;
|
|
63
124
|
};
|
|
64
125
|
/**
|
|
65
|
-
* Notebook-level diff result returned by {@link buildNotebookDiff}.
|
|
66
|
-
* `null` from the builder when either side fails to parse — the caller then
|
|
67
|
-
* falls back to a raw JSON file diff.
|
|
126
|
+
* Notebook-level diff result returned by {@link buildNotebookDiff}.
|
|
68
127
|
*/
|
|
69
128
|
export interface INotebookDiffResult {
|
|
129
|
+
/**
|
|
130
|
+
* The parsed old revision of the notebook.
|
|
131
|
+
*/
|
|
70
132
|
oldNotebook: INotebook;
|
|
133
|
+
/**
|
|
134
|
+
* The parsed new revision of the notebook.
|
|
135
|
+
*/
|
|
71
136
|
newNotebook: INotebook;
|
|
137
|
+
/**
|
|
138
|
+
* Per-cell diff entries, in new-notebook order with removed cells appended.
|
|
139
|
+
*/
|
|
72
140
|
cells: NotebookCellDiff[];
|
|
73
141
|
/**
|
|
74
|
-
* Kernel language
|
|
75
|
-
* a syntax-highlighting filename for code cells.
|
|
142
|
+
* Kernel language from `metadata.language_info.name`; picks the highlighting filename.
|
|
76
143
|
*/
|
|
77
144
|
language: string | undefined;
|
|
78
145
|
/**
|
|
79
|
-
*
|
|
80
|
-
* nbformat) when it differs between revisions; `null` otherwise so the
|
|
81
|
-
* section can be hidden without further checks.
|
|
146
|
+
* Diff of notebook-level metadata when it differs between revisions; `null` otherwise.
|
|
82
147
|
*/
|
|
83
148
|
notebookMetadataDiff: FileDiffMetadata | null;
|
|
84
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Options for {@link buildNotebookDiff}.
|
|
152
|
+
*/
|
|
85
153
|
interface IBuildNotebookDiffOptions {
|
|
154
|
+
/**
|
|
155
|
+
* The raw text of the old notebook revision.
|
|
156
|
+
*/
|
|
86
157
|
oldText: string;
|
|
158
|
+
/**
|
|
159
|
+
* The raw text of the new notebook revision.
|
|
160
|
+
*/
|
|
87
161
|
newText: string;
|
|
88
162
|
}
|
|
89
163
|
/**
|
|
90
|
-
* Build a
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* An empty string on either side is treated as an empty notebook (no
|
|
95
|
-
* cells, default metadata) so a freshly-added or deleted notebook still
|
|
96
|
-
* produces a sensible cell-by-cell diff.
|
|
164
|
+
* Build a notebook diff from the text of two revisions. Returns `null` when
|
|
165
|
+
* either side fails to parse (caller falls back to a raw text diff); an
|
|
166
|
+
* empty string counts as an empty notebook so added/deleted notebooks still
|
|
167
|
+
* diff cell by cell.
|
|
97
168
|
*/
|
|
98
169
|
export declare function buildNotebookDiff(options: IBuildNotebookDiffOptions): INotebookDiffResult | null;
|
|
170
|
+
/**
|
|
171
|
+
* Props for {@link NotebookDiffView}.
|
|
172
|
+
*/
|
|
99
173
|
interface INotebookDiffViewProps {
|
|
174
|
+
/**
|
|
175
|
+
* The notebook diff to render.
|
|
176
|
+
*/
|
|
100
177
|
diff: INotebookDiffResult;
|
|
178
|
+
/**
|
|
179
|
+
* Whether the active JupyterLab theme is dark.
|
|
180
|
+
*/
|
|
101
181
|
dark: boolean;
|
|
102
182
|
/**
|
|
103
|
-
* Whether a Pierre JupyterLab theme is active; selects Pierre
|
|
104
|
-
* highlighting vs the CSS-variable theme (see {@link resolveDiffTheme}).
|
|
183
|
+
* Whether a Pierre JupyterLab theme is active; selects Pierre highlighting vs the CSS-variable theme.
|
|
105
184
|
*/
|
|
106
185
|
pierreTheme: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Registry rendering markdown and output previews; `null` falls back to plain text.
|
|
188
|
+
*/
|
|
107
189
|
rendermime: IRenderMimeRegistry | null;
|
|
108
190
|
/**
|
|
109
191
|
* Translation bundle for user-facing strings.
|
|
@@ -111,14 +193,9 @@ interface INotebookDiffViewProps {
|
|
|
111
193
|
trans: TranslationBundle;
|
|
112
194
|
}
|
|
113
195
|
/**
|
|
114
|
-
*
|
|
115
|
-
* the
|
|
116
|
-
*
|
|
117
|
-
* internal split-mode FileDiff aligns with the outer columns), added
|
|
118
|
-
* cells live in the right column with an empty placeholder on the left,
|
|
119
|
-
* and removed cells live in the left column with an empty placeholder on
|
|
120
|
-
* the right. The diff library's red/green tint within each cell makes
|
|
121
|
-
* the orientation clear without a separate column header.
|
|
196
|
+
* Notebook-level diff view: a 2-column grid where the left column tracks
|
|
197
|
+
* the old notebook and the right the new one — modified/unchanged cells
|
|
198
|
+
* span both, added cells sit right, removed cells sit left.
|
|
122
199
|
*/
|
|
123
200
|
export declare function NotebookDiffView(props: INotebookDiffViewProps): React.ReactElement;
|
|
124
201
|
export {};
|