@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/lib/mode.js CHANGED
@@ -1,118 +1,118 @@
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 codeeditor_1 = require("@jupyterlab/codeeditor");
9
- const codemirror_1 = __importDefault(require("codemirror"));
10
- require("codemirror/mode/meta");
11
- require("codemirror/addon/runmode/runmode");
12
- require("./codemirror-ipython");
13
- require("./codemirror-ipythongfm");
14
- // Bundle other common modes
15
- require("codemirror/mode/javascript/javascript");
16
- require("codemirror/mode/css/css");
17
- require("codemirror/mode/julia/julia");
18
- require("codemirror/mode/r/r");
19
- require("codemirror/mode/markdown/markdown");
20
- require("codemirror/mode/clike/clike");
21
- require("codemirror/mode/shell/shell");
22
- require("codemirror/mode/sql/sql");
23
- const coreutils_1 = require("@jupyterlab/coreutils");
24
- /**
25
- * The namespace for CodeMirror Mode functionality.
26
- */
27
- var Mode;
28
- (function (Mode) {
29
- /**
30
- * Get the raw list of available modes specs.
31
- */
32
- function getModeInfo() {
33
- return codemirror_1.default.modeInfo;
34
- }
35
- Mode.getModeInfo = getModeInfo;
36
- /**
37
- * Running a CodeMirror mode outside of an editor.
38
- */
39
- function run(code, mode, el) {
40
- codemirror_1.default.runMode(code, mode, el);
41
- }
42
- Mode.run = run;
43
- /**
44
- * Ensure a codemirror mode is available by name or Codemirror spec.
45
- *
46
- * @param mode - The mode to ensure. If it is a string, uses [findBest]
47
- * to get the appropriate spec.
48
- *
49
- * @returns A promise that resolves when the mode is available.
50
- */
51
- function ensure(mode) {
52
- let spec = findBest(mode);
53
- // Simplest, cheapest check by mode name.
54
- if (codemirror_1.default.modes.hasOwnProperty(spec.mode)) {
55
- return Promise.resolve(spec);
56
- }
57
- // Fetch the mode asynchronously.
58
- return new Promise((resolve, reject) => {
59
- // An arrow function below seems to miscompile in our current webpack to
60
- // invalid js.
61
- require([`codemirror/mode/${spec.mode}/${spec.mode}.js`], function () {
62
- resolve(spec);
63
- });
64
- });
65
- }
66
- Mode.ensure = ensure;
67
- /**
68
- * Find a codemirror mode by name or CodeMirror spec.
69
- */
70
- function findBest(mode) {
71
- let modename = typeof mode === 'string' ? mode : mode.mode || mode.name;
72
- let mimetype = typeof mode !== 'string' ? mode.mime : modename;
73
- let ext = typeof mode !== 'string' ? mode.ext : [];
74
- return (codemirror_1.default.findModeByName(modename || '') ||
75
- codemirror_1.default.findModeByMIME(mimetype || '') ||
76
- findByExtension(ext) ||
77
- codemirror_1.default.findModeByMIME(codeeditor_1.IEditorMimeTypeService.defaultMimeType) ||
78
- codemirror_1.default.findModeByMIME('text/plain'));
79
- }
80
- Mode.findBest = findBest;
81
- /**
82
- * Find a codemirror mode by MIME.
83
- */
84
- function findByMIME(mime) {
85
- return codemirror_1.default.findModeByMIME(mime);
86
- }
87
- Mode.findByMIME = findByMIME;
88
- /**
89
- * Find a codemirror mode by name.
90
- */
91
- function findByName(name) {
92
- return codemirror_1.default.findModeByName(name);
93
- }
94
- Mode.findByName = findByName;
95
- /**
96
- * Find a codemirror mode by filename.
97
- */
98
- function findByFileName(name) {
99
- let basename = coreutils_1.PathExt.basename(name);
100
- return codemirror_1.default.findModeByFileName(basename);
101
- }
102
- Mode.findByFileName = findByFileName;
103
- /**
104
- * Find a codemirror mode by extension.
105
- */
106
- function findByExtension(ext) {
107
- if (typeof ext === 'string') {
108
- return codemirror_1.default.findModeByExtension(name);
109
- }
110
- for (let i = 0; i < ext.length; i++) {
111
- let mode = codemirror_1.default.findModeByExtension(ext[i]);
112
- if (mode) {
113
- return mode;
114
- }
115
- }
116
- }
117
- Mode.findByExtension = findByExtension;
118
- })(Mode = exports.Mode || (exports.Mode = {}));
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 codeeditor_1 = require("@jupyterlab/codeeditor");
9
+ const codemirror_1 = __importDefault(require("codemirror"));
10
+ require("codemirror/mode/meta");
11
+ require("codemirror/addon/runmode/runmode");
12
+ require("./codemirror-ipython");
13
+ require("./codemirror-ipythongfm");
14
+ // Bundle other common modes
15
+ require("codemirror/mode/javascript/javascript");
16
+ require("codemirror/mode/css/css");
17
+ require("codemirror/mode/julia/julia");
18
+ require("codemirror/mode/r/r");
19
+ require("codemirror/mode/markdown/markdown");
20
+ require("codemirror/mode/clike/clike");
21
+ require("codemirror/mode/shell/shell");
22
+ require("codemirror/mode/sql/sql");
23
+ const coreutils_1 = require("@jupyterlab/coreutils");
24
+ /**
25
+ * The namespace for CodeMirror Mode functionality.
26
+ */
27
+ var Mode;
28
+ (function (Mode) {
29
+ /**
30
+ * Get the raw list of available modes specs.
31
+ */
32
+ function getModeInfo() {
33
+ return codemirror_1.default.modeInfo;
34
+ }
35
+ Mode.getModeInfo = getModeInfo;
36
+ /**
37
+ * Running a CodeMirror mode outside of an editor.
38
+ */
39
+ function run(code, mode, el) {
40
+ codemirror_1.default.runMode(code, mode, el);
41
+ }
42
+ Mode.run = run;
43
+ /**
44
+ * Ensure a codemirror mode is available by name or Codemirror spec.
45
+ *
46
+ * @param mode - The mode to ensure. If it is a string, uses [findBest]
47
+ * to get the appropriate spec.
48
+ *
49
+ * @returns A promise that resolves when the mode is available.
50
+ */
51
+ function ensure(mode) {
52
+ let spec = findBest(mode);
53
+ // Simplest, cheapest check by mode name.
54
+ if (codemirror_1.default.modes.hasOwnProperty(spec.mode)) {
55
+ return Promise.resolve(spec);
56
+ }
57
+ // Fetch the mode asynchronously.
58
+ return new Promise((resolve, reject) => {
59
+ // An arrow function below seems to miscompile in our current webpack to
60
+ // invalid js.
61
+ require([`codemirror/mode/${spec.mode}/${spec.mode}.js`], function () {
62
+ resolve(spec);
63
+ });
64
+ });
65
+ }
66
+ Mode.ensure = ensure;
67
+ /**
68
+ * Find a codemirror mode by name or CodeMirror spec.
69
+ */
70
+ function findBest(mode) {
71
+ let modename = typeof mode === 'string' ? mode : mode.mode || mode.name;
72
+ let mimetype = typeof mode !== 'string' ? mode.mime : modename;
73
+ let ext = typeof mode !== 'string' ? mode.ext : [];
74
+ return (codemirror_1.default.findModeByName(modename || '') ||
75
+ codemirror_1.default.findModeByMIME(mimetype || '') ||
76
+ findByExtension(ext) ||
77
+ codemirror_1.default.findModeByMIME(codeeditor_1.IEditorMimeTypeService.defaultMimeType) ||
78
+ codemirror_1.default.findModeByMIME('text/plain'));
79
+ }
80
+ Mode.findBest = findBest;
81
+ /**
82
+ * Find a codemirror mode by MIME.
83
+ */
84
+ function findByMIME(mime) {
85
+ return codemirror_1.default.findModeByMIME(mime);
86
+ }
87
+ Mode.findByMIME = findByMIME;
88
+ /**
89
+ * Find a codemirror mode by name.
90
+ */
91
+ function findByName(name) {
92
+ return codemirror_1.default.findModeByName(name);
93
+ }
94
+ Mode.findByName = findByName;
95
+ /**
96
+ * Find a codemirror mode by filename.
97
+ */
98
+ function findByFileName(name) {
99
+ let basename = coreutils_1.PathExt.basename(name);
100
+ return codemirror_1.default.findModeByFileName(basename);
101
+ }
102
+ Mode.findByFileName = findByFileName;
103
+ /**
104
+ * Find a codemirror mode by extension.
105
+ */
106
+ function findByExtension(ext) {
107
+ if (typeof ext === 'string') {
108
+ return codemirror_1.default.findModeByExtension(name);
109
+ }
110
+ for (let i = 0; i < ext.length; i++) {
111
+ let mode = codemirror_1.default.findModeByExtension(ext[i]);
112
+ if (mode) {
113
+ return mode;
114
+ }
115
+ }
116
+ }
117
+ Mode.findByExtension = findByExtension;
118
+ })(Mode = exports.Mode || (exports.Mode = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/codemirror",
3
- "version": "0.19.1-alpha.0",
3
+ "version": "0.19.1",
4
4
  "description": "JupyterLab - CodeMirror Editor Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -24,17 +24,17 @@
24
24
  "url": "https://github.com/jupyterlab/jupyterlab.git"
25
25
  },
26
26
  "scripts": {
27
- "build": "tsc -b src",
27
+ "build": "tsc -b",
28
28
  "clean": "rimraf lib",
29
29
  "docs": "typedoc --options tdoptions.json --theme ../../typedoc-theme src",
30
30
  "prepublishOnly": "npm run build",
31
- "watch": "tsc -b src --watch"
31
+ "watch": "tsc -b --watch"
32
32
  },
33
33
  "dependencies": {
34
- "@jupyterlab/apputils": "^0.19.1-alpha.0",
35
- "@jupyterlab/codeeditor": "^0.19.1-alpha.0",
36
- "@jupyterlab/coreutils": "^2.2.1-alpha.0",
37
- "@jupyterlab/observables": "^2.1.1-alpha.0",
34
+ "@jupyterlab/apputils": "^0.19.1",
35
+ "@jupyterlab/codeeditor": "^0.19.1",
36
+ "@jupyterlab/coreutils": "^2.2.1",
37
+ "@jupyterlab/observables": "^2.1.1",
38
38
  "@phosphor/algorithm": "^1.1.2",
39
39
  "@phosphor/coreutils": "^1.3.0",
40
40
  "@phosphor/disposable": "^1.1.2",
@@ -47,5 +47,8 @@
47
47
  "typedoc": "~0.12.0",
48
48
  "typescript": "~3.1.1"
49
49
  },
50
- "gitHead": "9d6193d318872a4a3600ee96fe6f3996312ffe07"
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "gitHead": "7fc900168981e58051253ecc66a18015a052cd2f"
51
54
  }