@jupyterlab/codemirror 0.19.1-alpha.0 → 0.19.1
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/LICENSE +34 -0
- package/lib/codemirror-ipython.d.ts +2 -2
- package/lib/codemirror-ipython.js +34 -34
- package/lib/codemirror-ipythongfm.d.ts +3 -3
- package/lib/codemirror-ipythongfm.js +61 -61
- package/lib/editor.d.ts +442 -442
- package/lib/editor.js +1021 -1021
- package/lib/factory.d.ts +21 -21
- package/lib/factory.js +48 -48
- package/lib/index.d.ts +10 -10
- package/lib/index.js +21 -21
- package/lib/mimetype.d.ts +21 -21
- package/lib/mimetype.js +43 -43
- package/lib/mode.d.ts +71 -71
- package/lib/mode.js +118 -118
- package/package.json +11 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Copyright (c) 2015 Project Jupyter Contributors
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
Semver File License
|
|
30
|
+
===================
|
|
31
|
+
|
|
32
|
+
The semver.py file is from https://github.com/podhmo/python-semver
|
|
33
|
+
which is licensed under the "MIT" license. See the semver.py file for details.
|
|
34
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'codemirror/mode/meta';
|
|
2
|
-
import 'codemirror/mode/python/python';
|
|
1
|
+
import 'codemirror/mode/meta';
|
|
2
|
+
import 'codemirror/mode/python/python';
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Jupyter Development Team.
|
|
3
|
-
// Distributed under the terms of the Modified BSD License.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const codemirror_1 = __importDefault(require("codemirror"));
|
|
9
|
-
require("codemirror/mode/meta");
|
|
10
|
-
require("codemirror/mode/python/python");
|
|
11
|
-
/**
|
|
12
|
-
* Define an IPython codemirror mode.
|
|
13
|
-
*
|
|
14
|
-
* It is a slightly altered Python Mode with a `?` operator.
|
|
15
|
-
*/
|
|
16
|
-
codemirror_1.default.defineMode('ipython', (config, modeOptions) => {
|
|
17
|
-
let pythonConf = {};
|
|
18
|
-
for (let prop in modeOptions) {
|
|
19
|
-
if (modeOptions.hasOwnProperty(prop)) {
|
|
20
|
-
pythonConf[prop] = modeOptions[prop];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
pythonConf.name = 'python';
|
|
24
|
-
pythonConf.singleOperators = new RegExp('^[\\+\\-\\*/%&|@\\^~<>!\\?]');
|
|
25
|
-
pythonConf.identifiers = new RegExp('^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*');
|
|
26
|
-
return codemirror_1.default.getMode(config, pythonConf);
|
|
27
|
-
}, 'python');
|
|
28
|
-
codemirror_1.default.defineMIME('text/x-ipython', 'ipython');
|
|
29
|
-
codemirror_1.default.modeInfo.push({
|
|
30
|
-
ext: [],
|
|
31
|
-
mime: 'text/x-ipython',
|
|
32
|
-
mode: 'ipython',
|
|
33
|
-
name: 'ipython'
|
|
34
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Jupyter Development Team.
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const codemirror_1 = __importDefault(require("codemirror"));
|
|
9
|
+
require("codemirror/mode/meta");
|
|
10
|
+
require("codemirror/mode/python/python");
|
|
11
|
+
/**
|
|
12
|
+
* Define an IPython codemirror mode.
|
|
13
|
+
*
|
|
14
|
+
* It is a slightly altered Python Mode with a `?` operator.
|
|
15
|
+
*/
|
|
16
|
+
codemirror_1.default.defineMode('ipython', (config, modeOptions) => {
|
|
17
|
+
let pythonConf = {};
|
|
18
|
+
for (let prop in modeOptions) {
|
|
19
|
+
if (modeOptions.hasOwnProperty(prop)) {
|
|
20
|
+
pythonConf[prop] = modeOptions[prop];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
pythonConf.name = 'python';
|
|
24
|
+
pythonConf.singleOperators = new RegExp('^[\\+\\-\\*/%&|@\\^~<>!\\?]');
|
|
25
|
+
pythonConf.identifiers = new RegExp('^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*');
|
|
26
|
+
return codemirror_1.default.getMode(config, pythonConf);
|
|
27
|
+
}, 'python');
|
|
28
|
+
codemirror_1.default.defineMIME('text/x-ipython', 'ipython');
|
|
29
|
+
codemirror_1.default.modeInfo.push({
|
|
30
|
+
ext: [],
|
|
31
|
+
mime: 'text/x-ipython',
|
|
32
|
+
mode: 'ipython',
|
|
33
|
+
name: 'ipython'
|
|
34
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import 'codemirror/mode/stex/stex';
|
|
2
|
-
import 'codemirror/mode/gfm/gfm';
|
|
3
|
-
import 'codemirror/addon/mode/multiplex';
|
|
1
|
+
import 'codemirror/mode/stex/stex';
|
|
2
|
+
import 'codemirror/mode/gfm/gfm';
|
|
3
|
+
import 'codemirror/addon/mode/multiplex';
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Jupyter Development Team.
|
|
3
|
-
// Distributed under the terms of the Modified BSD License.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const codemirror_1 = __importDefault(require("codemirror"));
|
|
9
|
-
require("codemirror/mode/stex/stex");
|
|
10
|
-
require("codemirror/mode/gfm/gfm");
|
|
11
|
-
require("codemirror/addon/mode/multiplex");
|
|
12
|
-
/**
|
|
13
|
-
* Define an IPython GFM (GitHub Flavored Markdown) mode.
|
|
14
|
-
*
|
|
15
|
-
* Is just a slightly altered GFM Mode with support for LaTeX.
|
|
16
|
-
* LaTeX support was supported by Codemirror GFM as of
|
|
17
|
-
* https://github.com/codemirror/CodeMirror/pull/567
|
|
18
|
-
* But was later removed in
|
|
19
|
-
* https://github.com/codemirror/CodeMirror/commit/d9c9f1b1ffe984aee41307f3e927f80d1f23590c
|
|
20
|
-
*/
|
|
21
|
-
codemirror_1.default.defineMode('ipythongfm', (config, modeOptions) => {
|
|
22
|
-
let gfmMode = codemirror_1.default.getMode(config, {
|
|
23
|
-
name: 'gfm',
|
|
24
|
-
// Override list3 with an under-used token, rather than `keyword`
|
|
25
|
-
tokenTypeOverrides: { list3: 'string-2' }
|
|
26
|
-
});
|
|
27
|
-
let texMode = codemirror_1.default.getMode(config, {
|
|
28
|
-
name: 'stex',
|
|
29
|
-
inMathMode: true
|
|
30
|
-
});
|
|
31
|
-
return codemirror_1.default.multiplexingMode(gfmMode, {
|
|
32
|
-
open: '$$',
|
|
33
|
-
close: '$$',
|
|
34
|
-
mode: texMode,
|
|
35
|
-
delimStyle: 'delimit'
|
|
36
|
-
}, {
|
|
37
|
-
open: '$',
|
|
38
|
-
close: '$',
|
|
39
|
-
mode: texMode,
|
|
40
|
-
delimStyle: 'delimit'
|
|
41
|
-
}, {
|
|
42
|
-
open: '\\(',
|
|
43
|
-
close: '\\)',
|
|
44
|
-
mode: texMode,
|
|
45
|
-
delimStyle: 'delimit'
|
|
46
|
-
}, {
|
|
47
|
-
open: '\\[',
|
|
48
|
-
close: '\\]',
|
|
49
|
-
mode: texMode,
|
|
50
|
-
delimStyle: 'delimit'
|
|
51
|
-
}
|
|
52
|
-
// .. more multiplexed styles can follow here
|
|
53
|
-
);
|
|
54
|
-
}, 'gfm');
|
|
55
|
-
codemirror_1.default.defineMIME('text/x-ipythongfm', 'ipythongfm');
|
|
56
|
-
codemirror_1.default.modeInfo.push({
|
|
57
|
-
ext: [],
|
|
58
|
-
mime: 'text/x-ipythongfm',
|
|
59
|
-
mode: 'ipythongfm',
|
|
60
|
-
name: 'ipythongfm'
|
|
61
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Jupyter Development Team.
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const codemirror_1 = __importDefault(require("codemirror"));
|
|
9
|
+
require("codemirror/mode/stex/stex");
|
|
10
|
+
require("codemirror/mode/gfm/gfm");
|
|
11
|
+
require("codemirror/addon/mode/multiplex");
|
|
12
|
+
/**
|
|
13
|
+
* Define an IPython GFM (GitHub Flavored Markdown) mode.
|
|
14
|
+
*
|
|
15
|
+
* Is just a slightly altered GFM Mode with support for LaTeX.
|
|
16
|
+
* LaTeX support was supported by Codemirror GFM as of
|
|
17
|
+
* https://github.com/codemirror/CodeMirror/pull/567
|
|
18
|
+
* But was later removed in
|
|
19
|
+
* https://github.com/codemirror/CodeMirror/commit/d9c9f1b1ffe984aee41307f3e927f80d1f23590c
|
|
20
|
+
*/
|
|
21
|
+
codemirror_1.default.defineMode('ipythongfm', (config, modeOptions) => {
|
|
22
|
+
let gfmMode = codemirror_1.default.getMode(config, {
|
|
23
|
+
name: 'gfm',
|
|
24
|
+
// Override list3 with an under-used token, rather than `keyword`
|
|
25
|
+
tokenTypeOverrides: { list3: 'string-2' }
|
|
26
|
+
});
|
|
27
|
+
let texMode = codemirror_1.default.getMode(config, {
|
|
28
|
+
name: 'stex',
|
|
29
|
+
inMathMode: true
|
|
30
|
+
});
|
|
31
|
+
return codemirror_1.default.multiplexingMode(gfmMode, {
|
|
32
|
+
open: '$$',
|
|
33
|
+
close: '$$',
|
|
34
|
+
mode: texMode,
|
|
35
|
+
delimStyle: 'delimit'
|
|
36
|
+
}, {
|
|
37
|
+
open: '$',
|
|
38
|
+
close: '$',
|
|
39
|
+
mode: texMode,
|
|
40
|
+
delimStyle: 'delimit'
|
|
41
|
+
}, {
|
|
42
|
+
open: '\\(',
|
|
43
|
+
close: '\\)',
|
|
44
|
+
mode: texMode,
|
|
45
|
+
delimStyle: 'delimit'
|
|
46
|
+
}, {
|
|
47
|
+
open: '\\[',
|
|
48
|
+
close: '\\]',
|
|
49
|
+
mode: texMode,
|
|
50
|
+
delimStyle: 'delimit'
|
|
51
|
+
}
|
|
52
|
+
// .. more multiplexed styles can follow here
|
|
53
|
+
);
|
|
54
|
+
}, 'gfm');
|
|
55
|
+
codemirror_1.default.defineMIME('text/x-ipythongfm', 'ipythongfm');
|
|
56
|
+
codemirror_1.default.modeInfo.push({
|
|
57
|
+
ext: [],
|
|
58
|
+
mime: 'text/x-ipythongfm',
|
|
59
|
+
mode: 'ipythongfm',
|
|
60
|
+
name: 'ipythongfm'
|
|
61
|
+
});
|