@jupyterlab/codemirror 4.0.0-alpha.1 → 4.0.0-alpha.12

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.
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
1
5
  import { interactiveItem, showPopup, TextItem } from '@jupyterlab/statusbar';
2
6
  import { nullTranslator } from '@jupyterlab/translation';
3
7
  import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
@@ -39,7 +43,7 @@ export class EditorSyntaxStatus extends VDomRenderer {
39
43
  return aName.localeCompare(bName);
40
44
  })
41
45
  .forEach(spec => {
42
- if (spec.mode.indexOf('brainf') === 0) {
46
+ if (spec.name.toLowerCase().indexOf('brainf') === 0) {
43
47
  return;
44
48
  }
45
49
  const args = {
@@ -88,9 +92,10 @@ export class EditorSyntaxStatus extends VDomRenderer {
88
92
  * If the editor mode changes, update the model.
89
93
  */
90
94
  this._onMIMETypeChange = (mode, change) => {
95
+ var _a;
91
96
  const oldMode = this._mode;
92
97
  const spec = Mode.findByMIME(change.newValue);
93
- this._mode = spec.name || spec.mode;
98
+ this._mode = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : 'text/plain';
94
99
  this._triggerChange(oldMode, this._mode);
95
100
  };
96
101
  this._mode = '';
@@ -110,6 +115,7 @@ export class EditorSyntaxStatus extends VDomRenderer {
110
115
  return this._editor;
111
116
  }
112
117
  set editor(editor) {
118
+ var _a;
113
119
  const oldEditor = this._editor;
114
120
  if (oldEditor !== null) {
115
121
  oldEditor.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);
@@ -121,7 +127,7 @@ export class EditorSyntaxStatus extends VDomRenderer {
121
127
  }
122
128
  else {
123
129
  const spec = Mode.findByMIME(this._editor.model.mimeType);
124
- this._mode = spec.name || spec.mode;
130
+ this._mode = (_a = spec === null || spec === void 0 ? void 0 : spec.name) !== null && _a !== void 0 ? _a : 'text/plain';
125
131
  this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange);
126
132
  }
127
133
  this._triggerChange(oldMode, this._mode);
@@ -1 +1 @@
1
- {"version":3,"file":"syntaxstatus.js","sourceRoot":"","sources":["../src/syntaxstatus.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAEf,SAAS,EACT,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAC/B,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;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAwBzB;;;;;;GAMG;AACH,SAAS,qBAAqB,CAC5B,KAAmC;IAEnC,OAAO,oBAAC,QAAQ,IAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,GAAI,CAAC;AACtE,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAsC;IAC5E;;OAEG;IACH,YAAY,IAAiC;QAC3C,KAAK,CAAC,IAAI,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC;QAwBxC;;WAEG;QACK,iBAAY,GAAG,GAAG,EAAE;YAC1B,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YACxD,MAAM,OAAO,GAAG,wBAAwB,CAAC;YACzC,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;aACvB;YACD,IAAI,CAAC,WAAW,EAAE;iBACf,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACb,MAAM,KAAK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provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "build": "tsc -b",
32
- "build:test": "tsc --build tsconfig.test.json",
32
+ "build:test": "lezer-generator test/foo.grammar -o test/foo.js && tsc --build tsconfig.test.json",
33
33
  "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
34
34
  "docs": "typedoc src",
35
35
  "test": "jest",
@@ -39,47 +39,64 @@
39
39
  "watch": "tsc -b --watch"
40
40
  },
41
41
  "dependencies": {
42
- "@jupyterlab/apputils": "^4.0.0-alpha.1",
43
- "@jupyterlab/codeeditor": "^4.0.0-alpha.1",
44
- "@jupyterlab/coreutils": "^6.0.0-alpha.1",
45
- "@jupyterlab/nbformat": "^4.0.0-alpha.1",
46
- "@jupyterlab/observables": "^5.0.0-alpha.1",
47
- "@jupyterlab/shared-models": "^4.0.0-alpha.1",
48
- "@jupyterlab/statusbar": "^4.0.0-alpha.1",
49
- "@jupyterlab/translation": "^4.0.0-alpha.1",
50
- "@jupyterlab/ui-components": "^4.0.0-alpha.16",
42
+ "@codemirror/autocomplete": "^6.0.0",
43
+ "@codemirror/commands": "^6.0.0",
44
+ "@codemirror/lang-cpp": "^6.0.0",
45
+ "@codemirror/lang-css": "^6.0.0",
46
+ "@codemirror/lang-html": "^6.0.0",
47
+ "@codemirror/lang-java": "^6.0.0",
48
+ "@codemirror/lang-javascript": "^6.0.0",
49
+ "@codemirror/lang-json": "^6.0.0",
50
+ "@codemirror/lang-markdown": "^6.0.0",
51
+ "@codemirror/lang-php": "^6.0.0",
52
+ "@codemirror/lang-python": "^6.0.0",
53
+ "@codemirror/lang-rust": "^6.0.0",
54
+ "@codemirror/lang-sql": "^6.0.0",
55
+ "@codemirror/lang-wast": "^6.0.0",
56
+ "@codemirror/lang-xml": "^6.0.0",
57
+ "@codemirror/language": "^6.0.0",
58
+ "@codemirror/legacy-modes": "^6.0.0",
59
+ "@codemirror/search": "^6.0.0",
60
+ "@codemirror/state": "^6.0.0",
61
+ "@codemirror/view": "^6.0.0",
62
+ "@jupyterlab/apputils": "^4.0.0-alpha.12",
63
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.12",
64
+ "@jupyterlab/coreutils": "^6.0.0-alpha.12",
65
+ "@jupyterlab/documentsearch": "^4.0.0-alpha.12",
66
+ "@jupyterlab/nbformat": "^4.0.0-alpha.12",
67
+ "@jupyterlab/observables": "^5.0.0-alpha.12",
68
+ "@jupyterlab/shared-models": "^4.0.0-alpha.12",
69
+ "@jupyterlab/statusbar": "^4.0.0-alpha.12",
70
+ "@jupyterlab/translation": "^4.0.0-alpha.12",
71
+ "@jupyterlab/ui-components": "^4.0.0-alpha.27",
72
+ "@lezer/common": "^1.0.0",
73
+ "@lezer/highlight": "^1.0.0",
51
74
  "@lumino/algorithm": "^1.9.1",
52
- "@lumino/commands": "^1.19.0",
53
- "@lumino/coreutils": "^1.11.1",
75
+ "@lumino/commands": "^1.20.0",
76
+ "@lumino/coreutils": "^1.12.0",
54
77
  "@lumino/disposable": "^1.10.1",
55
- "@lumino/polling": "^1.9.1",
78
+ "@lumino/polling": "^1.10.0",
56
79
  "@lumino/signaling": "^1.10.1",
57
- "@lumino/widgets": "^1.30.0",
58
- "codemirror": "~5.61.0",
80
+ "@lumino/widgets": "^1.33.0",
59
81
  "react": "^17.0.1",
60
- "y-codemirror": "^3.0.1"
82
+ "style-mod": "^4.0.0",
83
+ "y-codemirror.next": "~0.3.2",
84
+ "y-protocols": "^1.0.5",
85
+ "yjs": "^13.5.34"
61
86
  },
62
87
  "devDependencies": {
63
- "@jupyterlab/testutils": "^4.0.0-alpha.1",
64
- "@types/codemirror": "^0.0.109",
88
+ "@jupyterlab/testutils": "^4.0.0-alpha.12",
89
+ "@lezer/generator": "^1.0.0",
90
+ "@lezer/lr": "^1.0.0",
65
91
  "@types/jest": "^26.0.10",
66
92
  "jest": "^26.4.2",
67
93
  "rimraf": "~3.0.0",
68
94
  "ts-jest": "^26.3.0",
69
- "typedoc": "~0.21.2",
70
- "typescript": "~4.1.3"
95
+ "typedoc": "~0.22.10",
96
+ "typescript": "~4.7.3"
71
97
  },
72
98
  "publishConfig": {
73
99
  "access": "public"
74
100
  },
75
- "jupyterlab": {
76
- "extraStyles": {
77
- "codemirror": [
78
- "lib/codemirror.css",
79
- "addon/dialog/dialog.css",
80
- "addon/fold/foldgutter.css"
81
- ]
82
- }
83
- },
84
101
  "styleModule": "style/index.js"
85
102
  }
package/style/base.css CHANGED
@@ -3,46 +3,33 @@
3
3
  | Distributed under the terms of the Modified BSD License.
4
4
  |----------------------------------------------------------------------------*/
5
5
 
6
- .CodeMirror {
6
+ .cm-editor {
7
7
  line-height: var(--jp-code-line-height);
8
8
  font-size: var(--jp-code-font-size);
9
9
  font-family: var(--jp-code-font-family);
10
10
  border: 0;
11
11
  border-radius: 0;
12
12
  height: auto;
13
+
13
14
  /* Changed to auto to autogrow */
14
15
  }
15
16
 
16
- .CodeMirror pre {
17
+ .cm-editor pre {
17
18
  padding: 0 var(--jp-code-padding);
18
19
  }
19
20
 
20
- .jp-CodeMirrorEditor[data-type='inline'] .CodeMirror-dialog {
21
+ .jp-CodeMirrorEditor[data-type='inline'] .cm-dialog {
21
22
  background-color: var(--jp-layout-color0);
22
23
  color: var(--jp-content-font-color1);
23
24
  }
24
25
 
25
- /* This causes https://github.com/jupyter/jupyterlab/issues/522 */
26
- /* May not cause it not because we changed it! */
27
- .CodeMirror-lines {
28
- padding: var(--jp-code-padding) 0;
29
- }
30
-
31
- .CodeMirror-linenumber {
32
- padding: 0 8px;
33
- }
34
-
35
26
  .jp-CodeMirrorEditor {
36
27
  cursor: text;
37
28
  }
38
29
 
39
- .jp-CodeMirrorEditor[data-type='inline'] .CodeMirror-cursor {
40
- border-left: var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color);
41
- }
42
-
43
30
  /* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */
44
31
  @media screen and (min-width: 2138px) and (max-width: 4319px) {
45
- .jp-CodeMirrorEditor[data-type='inline'] .CodeMirror-cursor {
32
+ .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {
46
33
  border-left: var(--jp-code-cursor-width1) solid
47
34
  var(--jp-editor-cursor-color);
48
35
  }
@@ -50,21 +37,16 @@
50
37
 
51
38
  /* When zoomed out less than 33% */
52
39
  @media screen and (min-width: 4320px) {
53
- .jp-CodeMirrorEditor[data-type='inline'] .CodeMirror-cursor {
40
+ .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {
54
41
  border-left: var(--jp-code-cursor-width2) solid
55
42
  var(--jp-editor-cursor-color);
56
43
  }
57
44
  }
58
45
 
59
- .CodeMirror.jp-mod-readOnly .CodeMirror-cursor {
46
+ .cm-editor.jp-mod-readOnly .cm-cursor {
60
47
  display: none;
61
48
  }
62
49
 
63
- .CodeMirror-gutters {
64
- border-right: 1px solid var(--jp-border-color2);
65
- background-color: var(--jp-layout-color0);
66
- }
67
-
68
50
  .jp-CollaboratorCursor {
69
51
  border-left: 5px solid transparent;
70
52
  border-right: 5px solid transparent;
@@ -75,16 +57,15 @@
75
57
  margin-right: -5px;
76
58
  }
77
59
 
78
- .CodeMirror-selectedtext.cm-searching {
79
- background-color: var(--jp-search-selected-match-background-color) !important;
80
- color: var(--jp-search-selected-match-color) !important;
60
+ .cm-searching,
61
+ .cm-searching span {
62
+ background-color: var(--jp-search-unselected-match-background-color);
63
+ color: var(--jp-search-unselected-match-color);
81
64
  }
82
65
 
83
- .cm-searching {
84
- background-color: var(
85
- --jp-search-unselected-match-background-color
86
- ) !important;
87
- color: var(--jp-search-unselected-match-color) !important;
66
+ .cm-searching span::selection {
67
+ background-color: var(--jp-search-selected-match-background-color) !important;
68
+ color: var(--jp-search-selected-match-color) !important;
88
69
  }
89
70
 
90
71
  .cm-trailingspace {
@@ -93,14 +74,6 @@
93
74
  background-repeat: repeat-x;
94
75
  }
95
76
 
96
- .CodeMirror-focused .CodeMirror-selected {
97
- background-color: var(--jp-editor-selected-focused-background);
98
- }
99
-
100
- .CodeMirror-selected {
101
- background-color: var(--jp-editor-selected-background);
102
- }
103
-
104
77
  .jp-CollaboratorCursor-hover {
105
78
  position: absolute;
106
79
  z-index: 1;
@@ -120,119 +93,6 @@
120
93
  border-left: 1px dashed var(--jp-border-color2);
121
94
  }
122
95
 
123
- /**
124
- * Here is our jupyter theme for CodeMirror syntax highlighting
125
- * This is used in our marked.js syntax highlighting and CodeMirror itself
126
- * The string "jupyter" is set in ../codemirror/widget.DEFAULT_CODEMIRROR_THEME
127
- * This came from the classic notebook, which came form highlight.js/GitHub
128
- */
129
-
130
- /**
131
- * CodeMirror themes are handling the background/color in this way. This works
132
- * fine for CodeMirror editors outside the notebook, but the notebook styles
133
- * these things differently.
134
- */
135
- .CodeMirror.cm-s-jupyter {
136
- background: var(--jp-layout-color0);
137
- color: var(--jp-content-font-color1);
138
- }
139
-
140
- /* In the notebook, we want this styling to be handled by its container */
141
- .jp-CodeConsole .CodeMirror.cm-s-jupyter,
142
- .jp-Notebook .CodeMirror.cm-s-jupyter {
143
- background: transparent;
144
- }
145
-
146
- .cm-s-jupyter .CodeMirror-cursor {
147
- border-left: var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color);
148
- }
149
- .cm-s-jupyter span.cm-keyword {
150
- color: var(--jp-mirror-editor-keyword-color);
151
- font-weight: bold;
152
- }
153
- .cm-s-jupyter span.cm-atom {
154
- color: var(--jp-mirror-editor-atom-color);
155
- }
156
- .cm-s-jupyter span.cm-number {
157
- color: var(--jp-mirror-editor-number-color);
158
- }
159
- .cm-s-jupyter span.cm-def {
160
- color: var(--jp-mirror-editor-def-color);
161
- }
162
- .cm-s-jupyter span.cm-variable {
163
- color: var(--jp-mirror-editor-variable-color);
164
- }
165
- .cm-s-jupyter span.cm-variable-2 {
166
- color: var(--jp-mirror-editor-variable-2-color);
167
- }
168
- .cm-s-jupyter span.cm-variable-3 {
169
- color: var(--jp-mirror-editor-variable-3-color);
170
- }
171
- .cm-s-jupyter span.cm-punctuation {
172
- color: var(--jp-mirror-editor-punctuation-color);
173
- }
174
- .cm-s-jupyter span.cm-property {
175
- color: var(--jp-mirror-editor-property-color);
176
- }
177
- .cm-s-jupyter span.cm-operator {
178
- color: var(--jp-mirror-editor-operator-color);
179
- font-weight: bold;
180
- }
181
- .cm-s-jupyter span.cm-comment {
182
- color: var(--jp-mirror-editor-comment-color);
183
- font-style: italic;
184
- }
185
- .cm-s-jupyter span.cm-string {
186
- color: var(--jp-mirror-editor-string-color);
187
- }
188
- .cm-s-jupyter span.cm-string-2 {
189
- color: var(--jp-mirror-editor-string-2-color);
190
- }
191
- .cm-s-jupyter span.cm-meta {
192
- color: var(--jp-mirror-editor-meta-color);
193
- }
194
- .cm-s-jupyter span.cm-qualifier {
195
- color: var(--jp-mirror-editor-qualifier-color);
196
- }
197
- .cm-s-jupyter span.cm-builtin {
198
- color: var(--jp-mirror-editor-builtin-color);
199
- }
200
- .cm-s-jupyter span.cm-bracket {
201
- color: var(--jp-mirror-editor-bracket-color);
202
- }
203
- .cm-s-jupyter span.cm-tag {
204
- color: var(--jp-mirror-editor-tag-color);
205
- }
206
- .cm-s-jupyter span.cm-attribute {
207
- color: var(--jp-mirror-editor-attribute-color);
208
- }
209
- .cm-s-jupyter span.cm-header {
210
- color: var(--jp-mirror-editor-header-color);
211
- }
212
- .cm-s-jupyter span.cm-quote {
213
- color: var(--jp-mirror-editor-quote-color);
214
- }
215
- .cm-s-jupyter span.cm-link {
216
- color: var(--jp-mirror-editor-link-color);
217
- }
218
- .cm-s-jupyter span.cm-error {
219
- color: var(--jp-mirror-editor-error-color);
220
- }
221
- .cm-s-jupyter span.cm-hr {
222
- color: #999;
223
- }
224
-
225
- .cm-s-jupyter span.cm-tab {
226
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);
227
- background-position: right;
228
- background-repeat: no-repeat;
229
- }
230
-
231
- .cm-s-jupyter .CodeMirror-activeline-background,
232
- .cm-s-jupyter .CodeMirror-gutter {
233
- background-color: var(--jp-layout-color2);
234
- }
235
-
236
96
  /* Styles for shared cursors (remote cursor locations and selected ranges) */
237
97
  .jp-CodeMirrorEditor .remote-caret {
238
98
  position: relative;
package/style/index.css CHANGED
@@ -6,11 +6,9 @@
6
6
  /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
7
7
  @import url('~@lumino/widgets/style/index.css');
8
8
  @import url('~@jupyterlab/ui-components/style/index.css');
9
+ @import url('~@jupyterlab/statusbar/style/index.css');
9
10
  @import url('~@jupyterlab/apputils/style/index.css');
10
11
  @import url('~@jupyterlab/codeeditor/style/index.css');
11
- @import url('~@jupyterlab/statusbar/style/index.css');
12
- @import url('~codemirror/lib/codemirror.css');
13
- @import url('~codemirror/addon/dialog/dialog.css');
14
- @import url('~codemirror/addon/fold/foldgutter.css');
12
+ @import url('~@jupyterlab/documentsearch/style/index.css');
15
13
 
16
14
  @import url('./base.css');
package/style/index.js CHANGED
@@ -6,11 +6,9 @@
6
6
  /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
7
7
  import '@lumino/widgets/style/index.js';
8
8
  import '@jupyterlab/ui-components/style/index.js';
9
+ import '@jupyterlab/statusbar/style/index.js';
9
10
  import '@jupyterlab/apputils/style/index.js';
10
11
  import '@jupyterlab/codeeditor/style/index.js';
11
- import '@jupyterlab/statusbar/style/index.js';
12
- import 'codemirror/lib/codemirror.css';
13
- import 'codemirror/addon/dialog/dialog.css';
14
- import 'codemirror/addon/fold/foldgutter.css';
12
+ import '@jupyterlab/documentsearch/style/index.js';
15
13
 
16
14
  import './base.css';
package/lib/tokens.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { Token } from '@lumino/coreutils';
2
- import CodeMirror from 'codemirror';
3
- /**
4
- * The CodeMirror token.
5
- */
6
- export declare const ICodeMirror: Token<ICodeMirror>;
7
- /** The CodeMirror interface. */
8
- export interface ICodeMirror {
9
- /**
10
- * A singleton CodeMirror module, rexported.
11
- */
12
- CodeMirror: typeof CodeMirror;
13
- /**
14
- * A function to allow extensions to ensure that
15
- * the vim keymap has been imported
16
- */
17
- ensureVimKeymap: () => Promise<void>;
18
- }
package/lib/tokens.js DELETED
@@ -1,9 +0,0 @@
1
- // Copyright (c) Jupyter Development Team.
2
- // Distributed under the terms of the Modified BSD License.
3
- import { Token } from '@lumino/coreutils';
4
- /* tslint:disable */
5
- /**
6
- * The CodeMirror token.
7
- */
8
- export const ICodeMirror = new Token('@jupyterlab/codemirror:ICodeMirror');
9
- //# sourceMappingURL=tokens.js.map
package/lib/tokens.js.map DELETED
@@ -1 +0,0 @@
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;AAG1C,oBAAoB;AACpB;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,KAAK,CAClC,oCAAoC,CACrC,CAAC"}