@hpcc-js/codemirror 3.7.4 → 3.7.5
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 +43 -43
- package/README.md +66 -66
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/CSSEditor.ts +22 -22
- package/src/DOTEditor.ts +20 -20
- package/src/ECLEditor.css +49 -49
- package/src/ECLEditor.ts +24 -24
- package/src/Editor.css +29 -29
- package/src/Editor.ts +232 -232
- package/src/HTMLEditor.ts +22 -22
- package/src/JSEditor.ts +22 -22
- package/src/JSONEditor.ts +22 -22
- package/src/SQLEditor.ts +22 -22
- package/src/XMLEditor.ts +22 -22
- package/src/YAMLEditor.ts +22 -22
- package/src/__package__.ts +3 -3
- package/src/codemirror-shim.ts +33 -33
- package/src/mode/dot/dot.ts +94 -94
- package/src/mode/markdown/markdown.ts +879 -879
package/src/XMLEditor.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Editor } from "./Editor.ts";
|
|
2
|
-
|
|
3
|
-
export class XMLEditor extends Editor {
|
|
4
|
-
options(): any {
|
|
5
|
-
return {
|
|
6
|
-
...super.options(),
|
|
7
|
-
mode: "application/xml",
|
|
8
|
-
foldGutter: true,
|
|
9
|
-
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
xml(): string;
|
|
14
|
-
xml(_: string): this;
|
|
15
|
-
xml(_?: string): string | this {
|
|
16
|
-
if (!arguments.length) return this.text();
|
|
17
|
-
this.text(_);
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
XMLEditor.prototype._class += " codemirror_XMLEditor";
|
|
1
|
+
import { Editor } from "./Editor.ts";
|
|
2
|
+
|
|
3
|
+
export class XMLEditor extends Editor {
|
|
4
|
+
options(): any {
|
|
5
|
+
return {
|
|
6
|
+
...super.options(),
|
|
7
|
+
mode: "application/xml",
|
|
8
|
+
foldGutter: true,
|
|
9
|
+
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
xml(): string;
|
|
14
|
+
xml(_: string): this;
|
|
15
|
+
xml(_?: string): string | this {
|
|
16
|
+
if (!arguments.length) return this.text();
|
|
17
|
+
this.text(_);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
XMLEditor.prototype._class += " codemirror_XMLEditor";
|
package/src/YAMLEditor.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Editor } from "./Editor.ts";
|
|
2
|
-
|
|
3
|
-
export class YAMLEditor extends Editor {
|
|
4
|
-
options(): any {
|
|
5
|
-
return {
|
|
6
|
-
...super.options(),
|
|
7
|
-
mode: "text/x-yaml",
|
|
8
|
-
foldGutter: true,
|
|
9
|
-
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
yaml(): string;
|
|
14
|
-
yaml(_: string): this;
|
|
15
|
-
yaml(_?: string): string | this {
|
|
16
|
-
if (!arguments.length) return this.text();
|
|
17
|
-
this.text(_);
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
YAMLEditor.prototype._class += " codemirror_YAMLEditor";
|
|
1
|
+
import { Editor } from "./Editor.ts";
|
|
2
|
+
|
|
3
|
+
export class YAMLEditor extends Editor {
|
|
4
|
+
options(): any {
|
|
5
|
+
return {
|
|
6
|
+
...super.options(),
|
|
7
|
+
mode: "text/x-yaml",
|
|
8
|
+
foldGutter: true,
|
|
9
|
+
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
yaml(): string;
|
|
14
|
+
yaml(_: string): this;
|
|
15
|
+
yaml(_?: string): string | this {
|
|
16
|
+
if (!arguments.length) return this.text();
|
|
17
|
+
this.text(_);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
YAMLEditor.prototype._class += " codemirror_YAMLEditor";
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
-
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
-
export const BUILD_VERSION = "__BUILD_VERSION__";
|
|
1
|
+
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
+
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
+
export const BUILD_VERSION = "__BUILD_VERSION__";
|
package/src/codemirror-shim.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import "codemirror/mode/css/css.js";
|
|
2
|
-
import "codemirror/mode/ecl/ecl.js";
|
|
3
|
-
import "codemirror/mode/gfm/gfm.js";
|
|
4
|
-
import "codemirror/mode/htmlmixed/htmlmixed.js";
|
|
5
|
-
import "codemirror/mode/javascript/javascript.js";
|
|
6
|
-
import "codemirror/mode/xml/xml.js";
|
|
7
|
-
import "codemirror/mode/sql/sql.js";
|
|
8
|
-
import "codemirror/mode/yaml/yaml.js";
|
|
9
|
-
import "./mode/dot/dot.ts";
|
|
10
|
-
import "./mode/markdown/markdown.ts";
|
|
11
|
-
|
|
12
|
-
import "codemirror/lib/codemirror.css";
|
|
13
|
-
|
|
14
|
-
import "codemirror/addon/fold/brace-fold.js";
|
|
15
|
-
import "codemirror/addon/fold/comment-fold.js";
|
|
16
|
-
import "codemirror/addon/fold/foldcode.js";
|
|
17
|
-
import "codemirror/addon/fold/foldgutter.js";
|
|
18
|
-
import "codemirror/addon/fold/indent-fold.js";
|
|
19
|
-
import "codemirror/addon/fold/xml-fold.js";
|
|
20
|
-
|
|
21
|
-
import "codemirror/addon/fold/foldgutter.css";
|
|
22
|
-
|
|
23
|
-
import "codemirror/addon/dialog/dialog.js";
|
|
24
|
-
import "codemirror/addon/search/jump-to-line.js";
|
|
25
|
-
import "codemirror/addon/search/search.js";
|
|
26
|
-
import "codemirror/addon/search/searchcursor.js";
|
|
27
|
-
import "codemirror/addon/hint/show-hint.js";
|
|
28
|
-
|
|
29
|
-
import "codemirror/addon/dialog/dialog.css";
|
|
30
|
-
import "codemirror/addon/hint/show-hint.css";
|
|
31
|
-
|
|
32
|
-
import CodeMirror from "codemirror";
|
|
33
|
-
export { CodeMirror };
|
|
1
|
+
import "codemirror/mode/css/css.js";
|
|
2
|
+
import "codemirror/mode/ecl/ecl.js";
|
|
3
|
+
import "codemirror/mode/gfm/gfm.js";
|
|
4
|
+
import "codemirror/mode/htmlmixed/htmlmixed.js";
|
|
5
|
+
import "codemirror/mode/javascript/javascript.js";
|
|
6
|
+
import "codemirror/mode/xml/xml.js";
|
|
7
|
+
import "codemirror/mode/sql/sql.js";
|
|
8
|
+
import "codemirror/mode/yaml/yaml.js";
|
|
9
|
+
import "./mode/dot/dot.ts";
|
|
10
|
+
import "./mode/markdown/markdown.ts";
|
|
11
|
+
|
|
12
|
+
import "codemirror/lib/codemirror.css";
|
|
13
|
+
|
|
14
|
+
import "codemirror/addon/fold/brace-fold.js";
|
|
15
|
+
import "codemirror/addon/fold/comment-fold.js";
|
|
16
|
+
import "codemirror/addon/fold/foldcode.js";
|
|
17
|
+
import "codemirror/addon/fold/foldgutter.js";
|
|
18
|
+
import "codemirror/addon/fold/indent-fold.js";
|
|
19
|
+
import "codemirror/addon/fold/xml-fold.js";
|
|
20
|
+
|
|
21
|
+
import "codemirror/addon/fold/foldgutter.css";
|
|
22
|
+
|
|
23
|
+
import "codemirror/addon/dialog/dialog.js";
|
|
24
|
+
import "codemirror/addon/search/jump-to-line.js";
|
|
25
|
+
import "codemirror/addon/search/search.js";
|
|
26
|
+
import "codemirror/addon/search/searchcursor.js";
|
|
27
|
+
import "codemirror/addon/hint/show-hint.js";
|
|
28
|
+
|
|
29
|
+
import "codemirror/addon/dialog/dialog.css";
|
|
30
|
+
import "codemirror/addon/hint/show-hint.css";
|
|
31
|
+
|
|
32
|
+
import CodeMirror from "codemirror";
|
|
33
|
+
export { CodeMirror };
|
package/src/mode/dot/dot.ts
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
3
|
-
// Orig source from: https://raw.githubusercontent.com/inaimathi/CodeMirror/dot-mode/mode/dot/dot.js
|
|
4
|
-
|
|
5
|
-
/* eslint-disable */
|
|
6
|
-
|
|
7
|
-
import CodeMirror from "codemirror";
|
|
8
|
-
|
|
9
|
-
CodeMirror.defineMode("dot", function (config) {
|
|
10
|
-
const ops = /--|->|=|;/;
|
|
11
|
-
const brackets = /[\[\]{}]/;
|
|
12
|
-
return {
|
|
13
|
-
startState() {
|
|
14
|
-
return { indent_level: 0 };
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
token(stream, state) {
|
|
18
|
-
stream.eatSpace();
|
|
19
|
-
|
|
20
|
-
switch (state.looking_for) {
|
|
21
|
-
case "multiline-comment":
|
|
22
|
-
if (stream.match(/.*\*\//)) {
|
|
23
|
-
state.looking_for = null;
|
|
24
|
-
} else {
|
|
25
|
-
stream.skipToEnd();
|
|
26
|
-
}
|
|
27
|
-
return "comment";
|
|
28
|
-
case "property":
|
|
29
|
-
if (stream.match("=")) {
|
|
30
|
-
return "variable-3";
|
|
31
|
-
} else {
|
|
32
|
-
stream.match(/\w+/);
|
|
33
|
-
state.looking_for = null;
|
|
34
|
-
return "string-2";
|
|
35
|
-
}
|
|
36
|
-
case "graphname":
|
|
37
|
-
state.looking_for = null;
|
|
38
|
-
if (stream.match(/{\W*$/)) {
|
|
39
|
-
state.indent_level += 1;
|
|
40
|
-
return "bracket";
|
|
41
|
-
} else if (stream.match("{")) {
|
|
42
|
-
return "bracket";
|
|
43
|
-
} else if (stream.match(/[^\W]+/)) {
|
|
44
|
-
return "variable-2";
|
|
45
|
-
}
|
|
46
|
-
default:
|
|
47
|
-
if (stream.match(/{\W*$/)) {
|
|
48
|
-
state.indent_level += 1;
|
|
49
|
-
return "bracket";
|
|
50
|
-
} else if (stream.match(/}\W*$/)) {
|
|
51
|
-
state.indent_level -= 1;
|
|
52
|
-
return "bracket";
|
|
53
|
-
} else if (stream.match(brackets)) {
|
|
54
|
-
return "bracket";
|
|
55
|
-
} else if (stream.match(/".*"/)) {
|
|
56
|
-
return "string";
|
|
57
|
-
} else if (stream.match(/\w+=[\"\w]+/, false)) {
|
|
58
|
-
state.looking_for = "property";
|
|
59
|
-
stream.match(/[^=]+/);
|
|
60
|
-
return "attribute";
|
|
61
|
-
} else if (stream.match(ops)) {
|
|
62
|
-
return "variable-3";
|
|
63
|
-
} else if (stream.match(/(di)?graph[^{\w]+/)) {
|
|
64
|
-
state.looking_for = "graphname";
|
|
65
|
-
return "keyword";
|
|
66
|
-
} else if (stream.match(/\/\/|#/)) {
|
|
67
|
-
stream.skipToEnd();
|
|
68
|
-
return "comment";
|
|
69
|
-
} else if (stream.match(/\/\*.*\*\//)) {
|
|
70
|
-
return "comment";
|
|
71
|
-
} else if (stream.match("/*")) {
|
|
72
|
-
state.looking_for = "multiline-comment";
|
|
73
|
-
return "comment";
|
|
74
|
-
} else if (stream.match(/\w+/)) {
|
|
75
|
-
return "variable";
|
|
76
|
-
} else {
|
|
77
|
-
stream.skipToEnd();
|
|
78
|
-
return "variable";
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
indent(state, _textAfter) {
|
|
84
|
-
return state.indent_level * (config.indentUnit || 2);
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
closeBrackets: { pairs: "[]{}\"\"" },
|
|
88
|
-
lineComment: /(\/\/|#)/,
|
|
89
|
-
blockCommentStart: "/*",
|
|
90
|
-
blockCommentEnd: "*/"
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
CodeMirror.defineMIME("text/x-dot", "dot");
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
3
|
+
// Orig source from: https://raw.githubusercontent.com/inaimathi/CodeMirror/dot-mode/mode/dot/dot.js
|
|
4
|
+
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
import CodeMirror from "codemirror";
|
|
8
|
+
|
|
9
|
+
CodeMirror.defineMode("dot", function (config) {
|
|
10
|
+
const ops = /--|->|=|;/;
|
|
11
|
+
const brackets = /[\[\]{}]/;
|
|
12
|
+
return {
|
|
13
|
+
startState() {
|
|
14
|
+
return { indent_level: 0 };
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
token(stream, state) {
|
|
18
|
+
stream.eatSpace();
|
|
19
|
+
|
|
20
|
+
switch (state.looking_for) {
|
|
21
|
+
case "multiline-comment":
|
|
22
|
+
if (stream.match(/.*\*\//)) {
|
|
23
|
+
state.looking_for = null;
|
|
24
|
+
} else {
|
|
25
|
+
stream.skipToEnd();
|
|
26
|
+
}
|
|
27
|
+
return "comment";
|
|
28
|
+
case "property":
|
|
29
|
+
if (stream.match("=")) {
|
|
30
|
+
return "variable-3";
|
|
31
|
+
} else {
|
|
32
|
+
stream.match(/\w+/);
|
|
33
|
+
state.looking_for = null;
|
|
34
|
+
return "string-2";
|
|
35
|
+
}
|
|
36
|
+
case "graphname":
|
|
37
|
+
state.looking_for = null;
|
|
38
|
+
if (stream.match(/{\W*$/)) {
|
|
39
|
+
state.indent_level += 1;
|
|
40
|
+
return "bracket";
|
|
41
|
+
} else if (stream.match("{")) {
|
|
42
|
+
return "bracket";
|
|
43
|
+
} else if (stream.match(/[^\W]+/)) {
|
|
44
|
+
return "variable-2";
|
|
45
|
+
}
|
|
46
|
+
default:
|
|
47
|
+
if (stream.match(/{\W*$/)) {
|
|
48
|
+
state.indent_level += 1;
|
|
49
|
+
return "bracket";
|
|
50
|
+
} else if (stream.match(/}\W*$/)) {
|
|
51
|
+
state.indent_level -= 1;
|
|
52
|
+
return "bracket";
|
|
53
|
+
} else if (stream.match(brackets)) {
|
|
54
|
+
return "bracket";
|
|
55
|
+
} else if (stream.match(/".*"/)) {
|
|
56
|
+
return "string";
|
|
57
|
+
} else if (stream.match(/\w+=[\"\w]+/, false)) {
|
|
58
|
+
state.looking_for = "property";
|
|
59
|
+
stream.match(/[^=]+/);
|
|
60
|
+
return "attribute";
|
|
61
|
+
} else if (stream.match(ops)) {
|
|
62
|
+
return "variable-3";
|
|
63
|
+
} else if (stream.match(/(di)?graph[^{\w]+/)) {
|
|
64
|
+
state.looking_for = "graphname";
|
|
65
|
+
return "keyword";
|
|
66
|
+
} else if (stream.match(/\/\/|#/)) {
|
|
67
|
+
stream.skipToEnd();
|
|
68
|
+
return "comment";
|
|
69
|
+
} else if (stream.match(/\/\*.*\*\//)) {
|
|
70
|
+
return "comment";
|
|
71
|
+
} else if (stream.match("/*")) {
|
|
72
|
+
state.looking_for = "multiline-comment";
|
|
73
|
+
return "comment";
|
|
74
|
+
} else if (stream.match(/\w+/)) {
|
|
75
|
+
return "variable";
|
|
76
|
+
} else {
|
|
77
|
+
stream.skipToEnd();
|
|
78
|
+
return "variable";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
indent(state, _textAfter) {
|
|
84
|
+
return state.indent_level * (config.indentUnit || 2);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
closeBrackets: { pairs: "[]{}\"\"" },
|
|
88
|
+
lineComment: /(\/\/|#)/,
|
|
89
|
+
blockCommentStart: "/*",
|
|
90
|
+
blockCommentEnd: "*/"
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
CodeMirror.defineMIME("text/x-dot", "dot");
|