@jupyterlab/codeeditor 4.1.0-alpha.2 → 4.1.0-alpha.4
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/editor.d.ts +4 -1
- package/lib/editor.js +4 -2
- package/lib/editor.js.map +1 -1
- package/lib/tokens.d.ts +8 -0
- package/lib/tokens.js +8 -0
- package/lib/tokens.js.map +1 -1
- package/package.json +12 -12
- package/src/editor.ts +9 -3
- package/src/tokens.ts +10 -0
package/lib/editor.d.ts
CHANGED
|
@@ -191,11 +191,14 @@ export declare namespace CodeEditor {
|
|
|
191
191
|
* Set the primary position of the cursor.
|
|
192
192
|
*
|
|
193
193
|
* @param position - The new primary position.
|
|
194
|
+
* @param options - Adjustment options allowing to disable scrolling.
|
|
194
195
|
*
|
|
195
196
|
* #### Notes
|
|
196
197
|
* This will remove any secondary cursors.
|
|
197
198
|
*/
|
|
198
|
-
setCursorPosition(position: IPosition
|
|
199
|
+
setCursorPosition(position: IPosition, options?: {
|
|
200
|
+
scroll?: boolean;
|
|
201
|
+
}): void;
|
|
199
202
|
/**
|
|
200
203
|
* Returns the primary selection, never `null`.
|
|
201
204
|
*/
|
package/lib/editor.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { YFile } from '@jupyter/ydoc';
|
|
4
4
|
import { ObservableMap } from '@jupyterlab/observables';
|
|
5
5
|
import { Signal } from '@lumino/signaling';
|
|
6
|
+
import { IEditorMimeTypeService } from './mimetype';
|
|
6
7
|
/**
|
|
7
8
|
* A namespace for code editors.
|
|
8
9
|
*
|
|
@@ -28,12 +29,13 @@ export var CodeEditor;
|
|
|
28
29
|
this.standaloneModel = false;
|
|
29
30
|
this._isDisposed = false;
|
|
30
31
|
this._selections = new ObservableMap();
|
|
31
|
-
this._mimeType =
|
|
32
|
+
this._mimeType = IEditorMimeTypeService.defaultMimeType;
|
|
32
33
|
this._mimeTypeChanged = new Signal(this);
|
|
33
34
|
// Track if we need to dispose the model or not.
|
|
34
35
|
this.standaloneModel = typeof options.sharedModel === 'undefined';
|
|
35
36
|
this.sharedModel = (_a = options.sharedModel) !== null && _a !== void 0 ? _a : new YFile();
|
|
36
|
-
this._mimeType =
|
|
37
|
+
this._mimeType =
|
|
38
|
+
(_b = options.mimeType) !== null && _b !== void 0 ? _b : IEditorMimeTypeService.defaultMimeType;
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* A signal emitted when a mimetype changes.
|
package/lib/editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAe,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAkB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxE,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,KAAW,UAAU,
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAe,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAkB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxE,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,KAAW,UAAU,CAgiB1B;AAhiBD,WAAiB,UAAU;IAsIzB;;OAEG;IACH,MAAa,KAAK;QAChB;;WAEG;QACH,YAAY,UAA0B,EAAE;;YAoExC;;eAEG;YACO,oBAAe,GAAG,KAAK,CAAC;YAE1B,gBAAW,GAAG,KAAK,CAAC;YACpB,gBAAW,GAAG,IAAI,aAAa,EAAoB,CAAC;YACpD,cAAS,GAAG,sB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C,WAAW,CAAC,OAAO,EAAE,CAAC;aAC5B;YACD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;KAWF;IAjFY,gBAAK,QAiFjB,CAAA;AAsUH,CAAC,EAhiBgB,UAAU,KAAV,UAAU,QAgiB1B"}
|
package/lib/tokens.d.ts
CHANGED
|
@@ -3,6 +3,14 @@ import { Widget } from '@lumino/widgets';
|
|
|
3
3
|
import { CodeEditor } from './editor';
|
|
4
4
|
import { IEditorFactoryService } from './factory';
|
|
5
5
|
import { IEditorMimeTypeService } from './mimetype';
|
|
6
|
+
/**
|
|
7
|
+
* A class added to editors that can host a completer.
|
|
8
|
+
*/
|
|
9
|
+
export declare const COMPLETER_ENABLED_CLASS: string;
|
|
10
|
+
/**
|
|
11
|
+
* A class added to editors that have an active completer.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COMPLETER_ACTIVE_CLASS: string;
|
|
6
14
|
/**
|
|
7
15
|
* Code editor services token.
|
|
8
16
|
*/
|
package/lib/tokens.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
3
|
import { Token } from '@lumino/coreutils';
|
|
4
|
+
/**
|
|
5
|
+
* A class added to editors that can host a completer.
|
|
6
|
+
*/
|
|
7
|
+
export const COMPLETER_ENABLED_CLASS = 'jp-mod-completer-enabled';
|
|
8
|
+
/**
|
|
9
|
+
* A class added to editors that have an active completer.
|
|
10
|
+
*/
|
|
11
|
+
export const COMPLETER_ACTIVE_CLASS = 'jp-mod-completer-active';
|
|
4
12
|
/**
|
|
5
13
|
* Code editor services token.
|
|
6
14
|
*/
|
package/lib/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,wCAAwC,EACxC;;eAEa,CACd,CAAC;AAiBF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,KAAK,CACrC,uCAAuC,EACvC,qDAAqD,CACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAW,0BAA0B,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW,yBAAyB,CAAC;AAExE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,wCAAwC,EACxC;;eAEa,CACd,CAAC;AAiBF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,KAAK,CACrC,uCAAuC,EACvC,qDAAqD,CACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/codeeditor",
|
|
3
|
-
"version": "4.1.0-alpha.
|
|
3
|
+
"version": "4.1.0-alpha.4",
|
|
4
4
|
"description": "JupyterLab - Abstract Code Editor",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -44,27 +44,27 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@codemirror/state": "^6.2.0",
|
|
46
46
|
"@jupyter/ydoc": "^1.1.1",
|
|
47
|
-
"@jupyterlab/coreutils": "^6.1.0-alpha.
|
|
48
|
-
"@jupyterlab/nbformat": "^4.1.0-alpha.
|
|
49
|
-
"@jupyterlab/observables": "^5.1.0-alpha.
|
|
50
|
-
"@jupyterlab/statusbar": "^4.1.0-alpha.
|
|
51
|
-
"@jupyterlab/translation": "^4.1.0-alpha.
|
|
52
|
-
"@jupyterlab/ui-components": "^4.1.0-alpha.
|
|
47
|
+
"@jupyterlab/coreutils": "^6.1.0-alpha.4",
|
|
48
|
+
"@jupyterlab/nbformat": "^4.1.0-alpha.4",
|
|
49
|
+
"@jupyterlab/observables": "^5.1.0-alpha.4",
|
|
50
|
+
"@jupyterlab/statusbar": "^4.1.0-alpha.4",
|
|
51
|
+
"@jupyterlab/translation": "^4.1.0-alpha.4",
|
|
52
|
+
"@jupyterlab/ui-components": "^4.1.0-alpha.4",
|
|
53
53
|
"@lumino/coreutils": "^2.1.2",
|
|
54
54
|
"@lumino/disposable": "^2.1.2",
|
|
55
|
-
"@lumino/dragdrop": "^2.1.
|
|
55
|
+
"@lumino/dragdrop": "^2.1.4",
|
|
56
56
|
"@lumino/messaging": "^2.0.1",
|
|
57
57
|
"@lumino/signaling": "^2.1.2",
|
|
58
|
-
"@lumino/widgets": "^2.3.1
|
|
58
|
+
"@lumino/widgets": "^2.3.1",
|
|
59
59
|
"react": "^18.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@jupyterlab/testing": "^4.1.0-alpha.
|
|
62
|
+
"@jupyterlab/testing": "^4.1.0-alpha.4",
|
|
63
63
|
"@types/jest": "^29.2.0",
|
|
64
64
|
"jest": "^29.2.0",
|
|
65
|
-
"rimraf": "~
|
|
65
|
+
"rimraf": "~5.0.5",
|
|
66
66
|
"typedoc": "~0.24.7",
|
|
67
|
-
"typescript": "~5.
|
|
67
|
+
"typescript": "~5.1.6"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
package/src/editor.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ITranslator } from '@jupyterlab/translation';
|
|
|
9
9
|
import { JSONObject } from '@lumino/coreutils';
|
|
10
10
|
import { IDisposable } from '@lumino/disposable';
|
|
11
11
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
12
|
+
import { IEditorMimeTypeService } from './mimetype';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* A namespace for code editors.
|
|
@@ -163,7 +164,8 @@ export namespace CodeEditor {
|
|
|
163
164
|
// Track if we need to dispose the model or not.
|
|
164
165
|
this.standaloneModel = typeof options.sharedModel === 'undefined';
|
|
165
166
|
this.sharedModel = options.sharedModel ?? new YFile();
|
|
166
|
-
this._mimeType =
|
|
167
|
+
this._mimeType =
|
|
168
|
+
options.mimeType ?? IEditorMimeTypeService.defaultMimeType;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
/**
|
|
@@ -233,7 +235,7 @@ export namespace CodeEditor {
|
|
|
233
235
|
|
|
234
236
|
private _isDisposed = false;
|
|
235
237
|
private _selections = new ObservableMap<ITextSelection[]>();
|
|
236
|
-
private _mimeType =
|
|
238
|
+
private _mimeType = IEditorMimeTypeService.defaultMimeType;
|
|
237
239
|
private _mimeTypeChanged = new Signal<this, IChangedArgs<string>>(this);
|
|
238
240
|
}
|
|
239
241
|
|
|
@@ -255,11 +257,15 @@ export namespace CodeEditor {
|
|
|
255
257
|
* Set the primary position of the cursor.
|
|
256
258
|
*
|
|
257
259
|
* @param position - The new primary position.
|
|
260
|
+
* @param options - Adjustment options allowing to disable scrolling.
|
|
258
261
|
*
|
|
259
262
|
* #### Notes
|
|
260
263
|
* This will remove any secondary cursors.
|
|
261
264
|
*/
|
|
262
|
-
setCursorPosition(
|
|
265
|
+
setCursorPosition(
|
|
266
|
+
position: IPosition,
|
|
267
|
+
options?: { scroll?: boolean }
|
|
268
|
+
): void;
|
|
263
269
|
|
|
264
270
|
/**
|
|
265
271
|
* Returns the primary selection, never `null`.
|
package/src/tokens.ts
CHANGED
|
@@ -7,6 +7,16 @@ import { CodeEditor } from './editor';
|
|
|
7
7
|
import { IEditorFactoryService } from './factory';
|
|
8
8
|
import { IEditorMimeTypeService } from './mimetype';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* A class added to editors that can host a completer.
|
|
12
|
+
*/
|
|
13
|
+
export const COMPLETER_ENABLED_CLASS: string = 'jp-mod-completer-enabled';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A class added to editors that have an active completer.
|
|
17
|
+
*/
|
|
18
|
+
export const COMPLETER_ACTIVE_CLASS: string = 'jp-mod-completer-active';
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* Code editor services token.
|
|
12
22
|
*/
|