@jupyterlab/fileeditor 4.0.0-alpha.19 → 4.0.0-alpha.20
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/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/searchprovider.d.ts +19 -4
- package/lib/searchprovider.js +28 -5
- package/lib/searchprovider.js.map +1 -1
- package/lib/syntaxstatus.d.ts +74 -0
- package/lib/syntaxstatus.js +151 -0
- package/lib/syntaxstatus.js.map +1 -0
- package/lib/tabspacestatus.d.ts +8 -12
- package/lib/tabspacestatus.js +20 -24
- package/lib/tabspacestatus.js.map +1 -1
- package/lib/widget.d.ts +4 -0
- package/lib/widget.js +18 -2
- package/lib/widget.js.map +1 -1
- package/package.json +21 -18
- package/src/fileeditorlspadapter.ts +225 -0
- package/src/index.ts +14 -0
- package/src/searchprovider.ts +106 -0
- package/src/syntaxstatus.tsx +217 -0
- package/src/tabspacestatus.tsx +166 -0
- package/src/toc/factory.ts +72 -0
- package/src/toc/index.ts +7 -0
- package/src/toc/latex.ts +145 -0
- package/src/toc/markdown.ts +90 -0
- package/src/toc/python.ts +143 -0
- package/src/tokens.ts +20 -0
- package/src/widget.ts +267 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAC3D;;;GAGG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAC3D;;;GAGG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
package/lib/searchprovider.d.ts
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { MainAreaWidget } from '@jupyterlab/apputils';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { CodeMirrorEditor, EditorSearchProvider } from '@jupyterlab/codemirror';
|
|
3
|
+
import { CodeEditor } from '@jupyterlab/codeeditor';
|
|
4
|
+
import { IReplaceOptionsSupport, ISearchProvider } from '@jupyterlab/documentsearch';
|
|
4
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
5
6
|
import { Widget } from '@lumino/widgets';
|
|
6
7
|
import { FileEditor } from './widget';
|
|
7
8
|
/**
|
|
8
9
|
* Helper type
|
|
9
10
|
*/
|
|
10
|
-
export
|
|
11
|
+
export type FileEditorPanel = MainAreaWidget<FileEditor>;
|
|
11
12
|
/**
|
|
12
13
|
* File editor search provider
|
|
13
14
|
*/
|
|
14
|
-
export declare class FileEditorSearchProvider extends
|
|
15
|
+
export declare class FileEditorSearchProvider extends EditorSearchProvider<CodeEditor.IModel> implements ISearchProvider {
|
|
16
|
+
protected widget: FileEditorPanel;
|
|
15
17
|
/**
|
|
16
18
|
* Constructor
|
|
17
19
|
* @param widget File editor panel
|
|
18
20
|
*/
|
|
19
21
|
constructor(widget: FileEditorPanel);
|
|
22
|
+
get isReadOnly(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Support for options adjusting replacement behavior.
|
|
25
|
+
*/
|
|
26
|
+
get replaceOptionsSupport(): IReplaceOptionsSupport;
|
|
27
|
+
/**
|
|
28
|
+
* Text editor
|
|
29
|
+
*/
|
|
30
|
+
get editor(): CodeMirrorEditor;
|
|
31
|
+
/**
|
|
32
|
+
* Editor content model
|
|
33
|
+
*/
|
|
34
|
+
get model(): CodeEditor.IModel;
|
|
20
35
|
/**
|
|
21
36
|
* Instantiate a search provider for the widget.
|
|
22
37
|
*
|
package/lib/searchprovider.js
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { MainAreaWidget } from '@jupyterlab/apputils';
|
|
4
|
-
import { CodeMirrorEditor,
|
|
4
|
+
import { CodeMirrorEditor, EditorSearchProvider } from '@jupyterlab/codemirror';
|
|
5
5
|
import { FileEditor } from './widget';
|
|
6
6
|
/**
|
|
7
7
|
* File editor search provider
|
|
8
8
|
*/
|
|
9
|
-
export class FileEditorSearchProvider extends
|
|
9
|
+
export class FileEditorSearchProvider extends EditorSearchProvider {
|
|
10
10
|
/**
|
|
11
11
|
* Constructor
|
|
12
12
|
* @param widget File editor panel
|
|
13
13
|
*/
|
|
14
14
|
constructor(widget) {
|
|
15
|
-
super(
|
|
15
|
+
super();
|
|
16
|
+
this.widget = widget;
|
|
17
|
+
}
|
|
18
|
+
get isReadOnly() {
|
|
19
|
+
return this.editor.getOption('readOnly');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Support for options adjusting replacement behavior.
|
|
23
|
+
*/
|
|
24
|
+
get replaceOptionsSupport() {
|
|
25
|
+
return {
|
|
26
|
+
preserveCase: true
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Text editor
|
|
31
|
+
*/
|
|
32
|
+
get editor() {
|
|
33
|
+
return this.widget.content.editor;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Editor content model
|
|
37
|
+
*/
|
|
38
|
+
get model() {
|
|
39
|
+
return this.widget.content.model;
|
|
16
40
|
}
|
|
17
41
|
/**
|
|
18
42
|
* Instantiate a search provider for the widget.
|
|
@@ -46,8 +70,7 @@ export class FileEditorSearchProvider extends CodeMirrorSearchProvider {
|
|
|
46
70
|
getInitialQuery() {
|
|
47
71
|
const cm = this.editor;
|
|
48
72
|
const selection = cm.state.sliceDoc(cm.state.selection.main.from, cm.state.selection.main.to);
|
|
49
|
-
|
|
50
|
-
return selection.search(/\r?\n|\r/g) === -1 ? selection : '';
|
|
73
|
+
return selection;
|
|
51
74
|
}
|
|
52
75
|
}
|
|
53
76
|
//# sourceMappingURL=searchprovider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchprovider.js","sourceRoot":"","sources":["../src/searchprovider.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"searchprovider.js","sourceRoot":"","sources":["../src/searchprovider.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAQhF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC;;GAEG;AACH,MAAM,OAAO,wBACX,SAAQ,oBAAuC;IAG/C;;;OAGG;IACH,YAAsB,MAAuB;QAC3C,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAiB;IAE7C,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAY,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,IAAI,qBAAqB;QACvB,OAAO;YACL,YAAY,EAAE,IAAI;SACnB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAA0B,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAS,CACd,MAAuB,EACvB,UAAwB;QAExB,OAAO,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,MAAc;QAChC,OAAO,CACL,MAAM,YAAY,cAAc;YAChC,MAAM,CAAC,OAAO,YAAY,UAAU;YACpC,MAAM,CAAC,OAAO,CAAC,MAAM,YAAY,gBAAgB,CAClD,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,eAAe;QACb,MAAM,EAAE,GAAG,IAAI,CAAC,MAA0B,CAAC;QAC3C,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CACjC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAC5B,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAC3B,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CodeEditor } from '@jupyterlab/codeeditor';
|
|
2
|
+
import { IEditorLanguageRegistry } from '@jupyterlab/codemirror';
|
|
3
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
4
|
+
import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
|
|
5
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
6
|
+
/**
|
|
7
|
+
* StatusBar item to change the language syntax highlighting of the file editor.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EditorSyntaxStatus extends VDomRenderer<EditorSyntaxStatus.Model> {
|
|
10
|
+
/**
|
|
11
|
+
* Construct a new VDomRenderer for the status item.
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: EditorSyntaxStatus.IOptions);
|
|
14
|
+
/**
|
|
15
|
+
* Render the status item.
|
|
16
|
+
*/
|
|
17
|
+
render(): JSX.Element | null;
|
|
18
|
+
/**
|
|
19
|
+
* Create a menu for selecting the language of the editor.
|
|
20
|
+
*/
|
|
21
|
+
private _handleClick;
|
|
22
|
+
protected translator: ITranslator;
|
|
23
|
+
private _commands;
|
|
24
|
+
private _popup;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A namespace for EditorSyntax statics.
|
|
28
|
+
*/
|
|
29
|
+
export declare namespace EditorSyntaxStatus {
|
|
30
|
+
/**
|
|
31
|
+
* A VDomModel for the current editor/mode combination.
|
|
32
|
+
*/
|
|
33
|
+
class Model extends VDomModel {
|
|
34
|
+
languages: IEditorLanguageRegistry;
|
|
35
|
+
constructor(languages: IEditorLanguageRegistry);
|
|
36
|
+
/**
|
|
37
|
+
* The current editor language. If no editor is present,
|
|
38
|
+
* returns the empty string.
|
|
39
|
+
*/
|
|
40
|
+
get language(): string;
|
|
41
|
+
/**
|
|
42
|
+
* The current editor for the application editor tracker.
|
|
43
|
+
*/
|
|
44
|
+
get editor(): CodeEditor.IEditor | null;
|
|
45
|
+
set editor(editor: CodeEditor.IEditor | null);
|
|
46
|
+
/**
|
|
47
|
+
* If the editor mode changes, update the model.
|
|
48
|
+
*/
|
|
49
|
+
private _onMIMETypeChange;
|
|
50
|
+
/**
|
|
51
|
+
* Trigger a rerender of the model.
|
|
52
|
+
*/
|
|
53
|
+
private _triggerChange;
|
|
54
|
+
private _language;
|
|
55
|
+
private _editor;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Options for the EditorSyntax status item.
|
|
59
|
+
*/
|
|
60
|
+
interface IOptions {
|
|
61
|
+
/**
|
|
62
|
+
* The application command registry.
|
|
63
|
+
*/
|
|
64
|
+
commands: CommandRegistry;
|
|
65
|
+
/**
|
|
66
|
+
* Editor languages.
|
|
67
|
+
*/
|
|
68
|
+
languages: IEditorLanguageRegistry;
|
|
69
|
+
/**
|
|
70
|
+
* The language translator.
|
|
71
|
+
*/
|
|
72
|
+
translator?: ITranslator;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
|
|
6
|
+
import { showPopup, TextItem } from '@jupyterlab/statusbar';
|
|
7
|
+
import { nullTranslator } from '@jupyterlab/translation';
|
|
8
|
+
import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
|
|
9
|
+
import { Menu } from '@lumino/widgets';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* A pure function that returns a tsx component for an editor syntax item.
|
|
13
|
+
*
|
|
14
|
+
* @param props: the props for the component.
|
|
15
|
+
*
|
|
16
|
+
* @returns an editor syntax component.
|
|
17
|
+
*/
|
|
18
|
+
function EditorSyntaxComponent(props) {
|
|
19
|
+
return React.createElement(TextItem, { source: props.language, onClick: props.handleClick });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* StatusBar item to change the language syntax highlighting of the file editor.
|
|
23
|
+
*/
|
|
24
|
+
export class EditorSyntaxStatus extends VDomRenderer {
|
|
25
|
+
/**
|
|
26
|
+
* Construct a new VDomRenderer for the status item.
|
|
27
|
+
*/
|
|
28
|
+
constructor(options) {
|
|
29
|
+
var _a;
|
|
30
|
+
super(new EditorSyntaxStatus.Model(options.languages));
|
|
31
|
+
/**
|
|
32
|
+
* Create a menu for selecting the language of the editor.
|
|
33
|
+
*/
|
|
34
|
+
this._handleClick = () => {
|
|
35
|
+
const languageMenu = new Menu({ commands: this._commands });
|
|
36
|
+
const command = 'fileeditor:change-language';
|
|
37
|
+
if (this._popup) {
|
|
38
|
+
this._popup.dispose();
|
|
39
|
+
}
|
|
40
|
+
this.model.languages
|
|
41
|
+
.getLanguages()
|
|
42
|
+
.sort((a, b) => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
const aName = (_a = a.displayName) !== null && _a !== void 0 ? _a : a.name;
|
|
45
|
+
const bName = (_b = b.displayName) !== null && _b !== void 0 ? _b : b.name;
|
|
46
|
+
return aName.localeCompare(bName);
|
|
47
|
+
})
|
|
48
|
+
.forEach(spec => {
|
|
49
|
+
var _a;
|
|
50
|
+
if (spec.name.toLowerCase().indexOf('brainf') === 0) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const args = {
|
|
54
|
+
name: spec.name,
|
|
55
|
+
displayName: (_a = spec.displayName) !== null && _a !== void 0 ? _a : spec.name
|
|
56
|
+
};
|
|
57
|
+
languageMenu.addItem({
|
|
58
|
+
command,
|
|
59
|
+
args
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
this._popup = showPopup({
|
|
63
|
+
body: languageMenu,
|
|
64
|
+
anchor: this,
|
|
65
|
+
align: 'left'
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
this._popup = null;
|
|
69
|
+
this._commands = options.commands;
|
|
70
|
+
this.translator = (_a = options.translator) !== null && _a !== void 0 ? _a : nullTranslator;
|
|
71
|
+
const trans = this.translator.load('jupyterlab');
|
|
72
|
+
this.addClass('jp-mod-highlighted');
|
|
73
|
+
this.title.caption = trans.__('Change text editor syntax highlighting');
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Render the status item.
|
|
77
|
+
*/
|
|
78
|
+
render() {
|
|
79
|
+
if (!this.model) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return (React.createElement(EditorSyntaxComponent, { language: this.model.language, handleClick: this._handleClick }));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A namespace for EditorSyntax statics.
|
|
87
|
+
*/
|
|
88
|
+
(function (EditorSyntaxStatus) {
|
|
89
|
+
/**
|
|
90
|
+
* A VDomModel for the current editor/mode combination.
|
|
91
|
+
*/
|
|
92
|
+
class Model extends VDomModel {
|
|
93
|
+
constructor(languages) {
|
|
94
|
+
super();
|
|
95
|
+
this.languages = languages;
|
|
96
|
+
/**
|
|
97
|
+
* If the editor mode changes, update the model.
|
|
98
|
+
*/
|
|
99
|
+
this._onMIMETypeChange = (mode, change) => {
|
|
100
|
+
var _a;
|
|
101
|
+
const oldLanguage = this._language;
|
|
102
|
+
const spec = this.languages.findByMIME(change.newValue);
|
|
103
|
+
this._language = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : IEditorMimeTypeService.defaultMimeType;
|
|
104
|
+
this._triggerChange(oldLanguage, this._language);
|
|
105
|
+
};
|
|
106
|
+
this._language = '';
|
|
107
|
+
this._editor = null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The current editor language. If no editor is present,
|
|
111
|
+
* returns the empty string.
|
|
112
|
+
*/
|
|
113
|
+
get language() {
|
|
114
|
+
return this._language;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The current editor for the application editor tracker.
|
|
118
|
+
*/
|
|
119
|
+
get editor() {
|
|
120
|
+
return this._editor;
|
|
121
|
+
}
|
|
122
|
+
set editor(editor) {
|
|
123
|
+
var _a;
|
|
124
|
+
const oldEditor = this._editor;
|
|
125
|
+
if (oldEditor !== null) {
|
|
126
|
+
oldEditor.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);
|
|
127
|
+
}
|
|
128
|
+
const oldLanguage = this._language;
|
|
129
|
+
this._editor = editor;
|
|
130
|
+
if (this._editor === null) {
|
|
131
|
+
this._language = '';
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const spec = this.languages.findByMIME(this._editor.model.mimeType);
|
|
135
|
+
this._language = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : IEditorMimeTypeService.defaultMimeType;
|
|
136
|
+
this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange);
|
|
137
|
+
}
|
|
138
|
+
this._triggerChange(oldLanguage, this._language);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Trigger a rerender of the model.
|
|
142
|
+
*/
|
|
143
|
+
_triggerChange(oldState, newState) {
|
|
144
|
+
if (oldState !== newState) {
|
|
145
|
+
this.stateChanged.emit(void 0);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
EditorSyntaxStatus.Model = Model;
|
|
150
|
+
})(EditorSyntaxStatus || (EditorSyntaxStatus = {}));
|
|
151
|
+
//# sourceMappingURL=syntaxstatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntaxstatus.js","sourceRoot":"","sources":["../src/syntaxstatus.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EAAS,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B;;;;;;GAMG;AACH,SAAS,qBAAqB,CAC5B,KAAmC;IAEnC,OAAO,oBAAC,QAAQ,IAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,GAAI,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAsC;IAC5E;;OAEG;IACH,YAAY,OAAoC;;QAC9C,KAAK,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QAwBzD;;WAEG;QACK,iBAAY,GAAG,GAAG,EAAE;YAC1B,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,EAAE,QAAQ,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eeditor';
|
|
2
1
|
import { ITranslator } from '@jupyterlab/translation';
|
|
3
2
|
import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
|
|
4
3
|
import { Menu } from '@lumino/widgets';
|
|
@@ -12,13 +11,11 @@ declare namespace TabSpaceComponent {
|
|
|
12
11
|
*/
|
|
13
12
|
interface IProps {
|
|
14
13
|
/**
|
|
15
|
-
* The number of spaces
|
|
14
|
+
* The number of spaces for indentation.
|
|
15
|
+
*
|
|
16
|
+
* `null` means use tab character for indentation.
|
|
16
17
|
*/
|
|
17
|
-
tabSpace: number;
|
|
18
|
-
/**
|
|
19
|
-
* Whether to use spaces or tabs.
|
|
20
|
-
*/
|
|
21
|
-
isSpaces: boolean;
|
|
18
|
+
tabSpace: number | null;
|
|
22
19
|
/**
|
|
23
20
|
* The application language translator.
|
|
24
21
|
*/
|
|
@@ -64,12 +61,11 @@ export declare namespace TabSpaceStatus {
|
|
|
64
61
|
*/
|
|
65
62
|
class Model extends VDomModel {
|
|
66
63
|
/**
|
|
67
|
-
*
|
|
64
|
+
* Code editor indentation unit
|
|
68
65
|
*/
|
|
69
|
-
get
|
|
70
|
-
set
|
|
71
|
-
private
|
|
72
|
-
private _config;
|
|
66
|
+
get indentUnit(): string | null;
|
|
67
|
+
set indentUnit(v: string | null);
|
|
68
|
+
private _indentUnit;
|
|
73
69
|
}
|
|
74
70
|
/**
|
|
75
71
|
* Options for creating a TabSpace status item.
|
package/lib/tabspacestatus.js
CHANGED
|
@@ -10,10 +10,12 @@ import React from 'react';
|
|
|
10
10
|
function TabSpaceComponent(props) {
|
|
11
11
|
const translator = props.translator || nullTranslator;
|
|
12
12
|
const trans = translator.load('jupyterlab');
|
|
13
|
-
const description = props.
|
|
13
|
+
const description = typeof props.tabSpace === 'number'
|
|
14
14
|
? trans.__('Spaces')
|
|
15
|
-
: trans.__('Tab
|
|
16
|
-
return (React.createElement(TextItem, { onClick: props.handleClick, source:
|
|
15
|
+
: trans.__('Tab Indent');
|
|
16
|
+
return (React.createElement(TextItem, { onClick: props.handleClick, source: typeof props.tabSpace === 'number'
|
|
17
|
+
? `${description}: ${props.tabSpace}`
|
|
18
|
+
: description, title: trans.__('Change the indentation…') }));
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* A VDomRenderer for a tabs vs. spaces status item.
|
|
@@ -33,11 +35,15 @@ export class TabSpaceStatus extends VDomRenderer {
|
|
|
33
35
|
* Render the TabSpace status item.
|
|
34
36
|
*/
|
|
35
37
|
render() {
|
|
36
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.indentUnit)) {
|
|
37
40
|
return null;
|
|
38
41
|
}
|
|
39
42
|
else {
|
|
40
|
-
|
|
43
|
+
const tabSpace = this.model.indentUnit === 'Tab'
|
|
44
|
+
? null
|
|
45
|
+
: parseInt(this.model.indentUnit, 10);
|
|
46
|
+
return (React.createElement(TabSpaceComponent, { tabSpace: tabSpace, handleClick: () => this._handleClick(), translator: this.translator }));
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
/**
|
|
@@ -54,6 +60,8 @@ export class TabSpaceStatus extends VDomRenderer {
|
|
|
54
60
|
anchor: this,
|
|
55
61
|
align: 'right'
|
|
56
62
|
});
|
|
63
|
+
// Update the menu items
|
|
64
|
+
menu.update();
|
|
57
65
|
}
|
|
58
66
|
_menuClosed() {
|
|
59
67
|
this.removeClass('jp-mod-clicked');
|
|
@@ -67,28 +75,16 @@ export class TabSpaceStatus extends VDomRenderer {
|
|
|
67
75
|
* A VDomModel for the TabSpace status item.
|
|
68
76
|
*/
|
|
69
77
|
class Model extends VDomModel {
|
|
70
|
-
constructor() {
|
|
71
|
-
super(...arguments);
|
|
72
|
-
this._config = null;
|
|
73
|
-
}
|
|
74
78
|
/**
|
|
75
|
-
*
|
|
79
|
+
* Code editor indentation unit
|
|
76
80
|
*/
|
|
77
|
-
get
|
|
78
|
-
return this.
|
|
79
|
-
}
|
|
80
|
-
set config(val) {
|
|
81
|
-
const oldConfig = this._config;
|
|
82
|
-
this._config = val;
|
|
83
|
-
this._triggerChange(oldConfig, this._config);
|
|
81
|
+
get indentUnit() {
|
|
82
|
+
return this._indentUnit;
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const newSize = newValue && newValue.tabSize;
|
|
90
|
-
if (oldSpaces !== newSpaces || oldSize !== newSize) {
|
|
91
|
-
this.stateChanged.emit(void 0);
|
|
84
|
+
set indentUnit(v) {
|
|
85
|
+
if (v !== this._indentUnit) {
|
|
86
|
+
this._indentUnit = v;
|
|
87
|
+
this.stateChanged.emit();
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabspacestatus.js","sourceRoot":"","sources":["../src/tabspacestatus.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;
|
|
1
|
+
{"version":3,"file":"tabspacestatus.js","sourceRoot":"","sources":["../src/tabspacestatus.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAS,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,MAAM,OAAO,CAAC;AA8B1B;;GAEG;AACH,SAAS,iBAAiB,CACxB,KAA+B;IAE/B,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,cAAc,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,WAAW,GACf,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAChC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpB,CAAC,C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QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SACvB;QAED,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;YACtB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QACH,wBAAwB;QACxB,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACrC,CAAC;CAKF;AAED;;GAEG;AACH,WAAiB,cAAc;IAC7B;;OAEG;IACH,MAAa,KAAM,SAAQ,SAAS;QAClC;;WAEG;QACH,IAAI,UAAU;YACZ,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QACD,IAAI,UAAU,CAAC,CAAgB;YAC7B,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE;gBAC1B,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;gBACrB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;aAC1B;QACH,CAAC;KAGF;IAfY,oBAAK,QAejB,CAAA;AAiBH,CAAC,EApCgB,cAAc,KAAd,cAAc,QAoC9B"}
|
package/lib/widget.d.ts
CHANGED
package/lib/widget.js
CHANGED
|
@@ -28,7 +28,10 @@ export class FileEditor extends Widget {
|
|
|
28
28
|
this._mimeTypeService = options.mimeTypeService;
|
|
29
29
|
const editorWidget = (this._editorWidget = new CodeEditorWrapper({
|
|
30
30
|
factory: options.factory,
|
|
31
|
-
model: context.model
|
|
31
|
+
model: context.model,
|
|
32
|
+
editorOptions: {
|
|
33
|
+
config: FileEditor.defaultEditorConfig
|
|
34
|
+
}
|
|
32
35
|
}));
|
|
33
36
|
this._editorWidget.addClass('jp-FileEditorCodeWrapper');
|
|
34
37
|
this._editorWidget.node.dataset[CODE_RUNNER] = 'true';
|
|
@@ -39,8 +42,8 @@ export class FileEditor extends Widget {
|
|
|
39
42
|
this._onContextReady();
|
|
40
43
|
});
|
|
41
44
|
// Listen for changes to the path.
|
|
42
|
-
context.pathChanged.connect(this._onPathChanged, this);
|
|
43
45
|
this._onPathChanged();
|
|
46
|
+
context.pathChanged.connect(this._onPathChanged, this);
|
|
44
47
|
const layout = (this.layout = new StackedLayout());
|
|
45
48
|
layout.addWidget(editorWidget);
|
|
46
49
|
}
|
|
@@ -129,6 +132,18 @@ export class FileEditor extends Widget {
|
|
|
129
132
|
this._mimeTypeService.getMimeTypeByFilePath(localPath);
|
|
130
133
|
}
|
|
131
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* The namespace for editor widget statics.
|
|
137
|
+
*/
|
|
138
|
+
(function (FileEditor) {
|
|
139
|
+
/**
|
|
140
|
+
* File editor default configuration.
|
|
141
|
+
*/
|
|
142
|
+
FileEditor.defaultEditorConfig = {
|
|
143
|
+
lineNumbers: true,
|
|
144
|
+
scrollPastEnd: true
|
|
145
|
+
};
|
|
146
|
+
})(FileEditor || (FileEditor = {}));
|
|
132
147
|
/**
|
|
133
148
|
* A widget factory for editors.
|
|
134
149
|
*/
|
|
@@ -146,6 +161,7 @@ export class FileEditorFactory extends ABCWidgetFactory {
|
|
|
146
161
|
createNewWidget(context) {
|
|
147
162
|
const func = this._services.factoryService.newDocumentEditor;
|
|
148
163
|
const factory = options => {
|
|
164
|
+
// Use same id as document factory
|
|
149
165
|
return func(options);
|
|
150
166
|
};
|
|
151
167
|
const content = new FileEditor({
|
package/lib/widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAEL,iBAAiB,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AAgB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;CAQF;AAED;;GAEG;AACH,WAAiB,UAAU;IAqBzB;;OAEG;IACU,8BAAmB,GAAwB;QACtD,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,IAAI;KACpB,CAAC;AACJ,CAAC,EA5BgB,UAAU,KAAV,UAAU,QA4B1B;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAGtC;IACC;;OAEG;IACH,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC;IAC1C,CAAC;IAED;;OAEG;IACO,eAAe,CACvB,OAAqC;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC;QAC7D,MAAM,OAAO,GAAuB,OAAO,CAAC,EAAE;YAC5C,kCAAkC;YAClC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC;YAC7B,OAAO;YACP,OAAO;YACP,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe;SAChD,CAAC,CAAC;QAEH,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,cAAc,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;CAGF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/fileeditor",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.20",
|
|
4
4
|
"description": "JupyterLab - Editor Widget",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"lib/**/*.{d.ts,js,js.map}",
|
|
27
27
|
"style/*.css",
|
|
28
|
-
"style/index.js"
|
|
28
|
+
"style/index.js",
|
|
29
|
+
"src/**/*.{ts,tsx}"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsc -b",
|
|
@@ -39,28 +40,30 @@
|
|
|
39
40
|
"watch": "tsc -b --watch"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@jupyterlab/apputils": "^4.0.0-alpha.
|
|
43
|
-
"@jupyterlab/codeeditor": "^4.0.0-alpha.
|
|
44
|
-
"@jupyterlab/codemirror": "^4.0.0-alpha.
|
|
45
|
-
"@jupyterlab/
|
|
46
|
-
"@jupyterlab/
|
|
47
|
-
"@jupyterlab/
|
|
48
|
-
"@jupyterlab/
|
|
49
|
-
"@jupyterlab/
|
|
50
|
-
"@jupyterlab/
|
|
51
|
-
"@jupyterlab/
|
|
52
|
-
"@
|
|
53
|
-
"@lumino/
|
|
54
|
-
"@lumino/
|
|
43
|
+
"@jupyterlab/apputils": "^4.0.0-alpha.20",
|
|
44
|
+
"@jupyterlab/codeeditor": "^4.0.0-alpha.20",
|
|
45
|
+
"@jupyterlab/codemirror": "^4.0.0-alpha.20",
|
|
46
|
+
"@jupyterlab/coreutils": "^6.0.0-alpha.20",
|
|
47
|
+
"@jupyterlab/docregistry": "^4.0.0-alpha.20",
|
|
48
|
+
"@jupyterlab/documentsearch": "^4.0.0-alpha.20",
|
|
49
|
+
"@jupyterlab/lsp": "^4.0.0-alpha.20",
|
|
50
|
+
"@jupyterlab/statusbar": "^4.0.0-alpha.20",
|
|
51
|
+
"@jupyterlab/toc": "^6.0.0-alpha.20",
|
|
52
|
+
"@jupyterlab/translation": "^4.0.0-alpha.20",
|
|
53
|
+
"@jupyterlab/ui-components": "^4.0.0-alpha.35",
|
|
54
|
+
"@lumino/commands": "^2.0.0-rc.0",
|
|
55
|
+
"@lumino/coreutils": "^2.0.0-rc.0",
|
|
56
|
+
"@lumino/messaging": "^2.0.0-rc.0",
|
|
57
|
+
"@lumino/widgets": "^2.0.0-rc.0",
|
|
55
58
|
"react": "^18.2.0",
|
|
56
59
|
"regexp-match-indices": "^1.0.2"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
|
-
"@jupyterlab/testing": "^4.0.0-alpha.
|
|
62
|
+
"@jupyterlab/testing": "^4.0.0-alpha.20",
|
|
60
63
|
"@types/jest": "^29.2.0",
|
|
61
64
|
"rimraf": "~3.0.0",
|
|
62
|
-
"typedoc": "~0.
|
|
63
|
-
"typescript": "~
|
|
65
|
+
"typedoc": "~0.23.25",
|
|
66
|
+
"typescript": "~5.0.0-beta"
|
|
64
67
|
},
|
|
65
68
|
"publishConfig": {
|
|
66
69
|
"access": "public"
|