@jupyterlab/codeeditor 4.1.0-alpha.2 → 4.1.0-alpha.3

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 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): void;
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 = 'text/plain';
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 = (_b = options.mimeType) !== null && _b !== void 0 ? _b : 'text/plain';
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":"A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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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/codeeditor",
3
- "version": "4.1.0-alpha.2",
3
+ "version": "4.1.0-alpha.3",
4
4
  "description": "JupyterLab - Abstract Code Editor",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -44,12 +44,12 @@
44
44
  "dependencies": {
45
45
  "@codemirror/state": "^6.2.0",
46
46
  "@jupyter/ydoc": "^1.1.1",
47
- "@jupyterlab/coreutils": "^6.1.0-alpha.2",
48
- "@jupyterlab/nbformat": "^4.1.0-alpha.2",
49
- "@jupyterlab/observables": "^5.1.0-alpha.2",
50
- "@jupyterlab/statusbar": "^4.1.0-alpha.2",
51
- "@jupyterlab/translation": "^4.1.0-alpha.2",
52
- "@jupyterlab/ui-components": "^4.1.0-alpha.2",
47
+ "@jupyterlab/coreutils": "^6.1.0-alpha.3",
48
+ "@jupyterlab/nbformat": "^4.1.0-alpha.3",
49
+ "@jupyterlab/observables": "^5.1.0-alpha.3",
50
+ "@jupyterlab/statusbar": "^4.1.0-alpha.3",
51
+ "@jupyterlab/translation": "^4.1.0-alpha.3",
52
+ "@jupyterlab/ui-components": "^4.1.0-alpha.3",
53
53
  "@lumino/coreutils": "^2.1.2",
54
54
  "@lumino/disposable": "^2.1.2",
55
55
  "@lumino/dragdrop": "^2.1.3",
@@ -59,12 +59,12 @@
59
59
  "react": "^18.2.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@jupyterlab/testing": "^4.1.0-alpha.2",
62
+ "@jupyterlab/testing": "^4.1.0-alpha.3",
63
63
  "@types/jest": "^29.2.0",
64
64
  "jest": "^29.2.0",
65
- "rimraf": "~3.0.0",
65
+ "rimraf": "~5.0.5",
66
66
  "typedoc": "~0.24.7",
67
- "typescript": "~5.0.4"
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 = options.mimeType ?? 'text/plain';
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 = 'text/plain';
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(position: IPosition): void;
265
+ setCursorPosition(
266
+ position: IPosition,
267
+ options?: { scroll?: boolean }
268
+ ): void;
263
269
 
264
270
  /**
265
271
  * Returns the primary selection, never `null`.