@hpcc-js/codemirror 2.64.0 → 3.2.0
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/README.md +10 -4
- package/dist/index.js +11964 -17754
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +33 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +31 -33
- package/src/CSSEditor.ts +1 -1
- package/src/DOTEditor.ts +2 -2
- package/src/ECLEditor.ts +1 -1
- package/src/Editor.css +8 -3
- package/src/Editor.ts +1 -1
- package/src/HTMLEditor.ts +1 -1
- package/src/JSEditor.ts +1 -1
- package/src/JSONEditor.ts +1 -1
- package/src/MarkdownEditor.ts +1 -1
- package/src/ObservableMarkdownEditor.ts +1 -1
- package/src/SQLEditor.ts +1 -1
- package/src/XMLEditor.ts +1 -1
- package/src/__package__.ts +2 -2
- package/src/codemirror-shim.ts +32 -0
- package/src/index.ts +13 -12
- package/src/mode/dot/dot.ts +94 -0
- package/src/mode/markdown/markdown.ts +879 -0
- package/types/CSSEditor.d.ts +1 -2
- package/types/DOTEditor.d.ts +1 -2
- package/types/ECLEditor.d.ts +1 -2
- package/types/Editor.d.ts +0 -1
- package/types/HTMLEditor.d.ts +1 -2
- package/types/JSEditor.d.ts +1 -2
- package/types/JSONEditor.d.ts +1 -2
- package/types/MarkdownEditor.d.ts +1 -2
- package/types/ObservableMarkdownEditor.d.ts +1 -2
- package/types/SQLEditor.d.ts +1 -2
- package/types/XMLEditor.d.ts +1 -2
- package/types/__package__.d.ts +2 -3
- package/types/codemirror-shim.d.ts +26 -0
- package/types/index.d.ts +12 -13
- package/types/mode/dot/dot.d.ts +1 -0
- package/types/mode/markdown/markdown.d.ts +1 -0
- package/dist/index.es6.js +0 -17860
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/types/CSSEditor.d.ts.map +0 -1
- package/types/DOTEditor.d.ts.map +0 -1
- package/types/ECLEditor.d.ts.map +0 -1
- package/types/Editor.d.ts.map +0 -1
- package/types/HTMLEditor.d.ts.map +0 -1
- package/types/JSEditor.d.ts.map +0 -1
- package/types/JSONEditor.d.ts.map +0 -1
- package/types/MarkdownEditor.d.ts.map +0 -1
- package/types/ObservableMarkdownEditor.d.ts.map +0 -1
- package/types/SQLEditor.d.ts.map +0 -1
- package/types/XMLEditor.d.ts.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types-3.4/CSSEditor.d.ts +0 -7
- package/types-3.4/DOTEditor.d.ts +0 -7
- package/types-3.4/ECLEditor.d.ts +0 -8
- package/types-3.4/Editor.d.ts +0 -57
- package/types-3.4/HTMLEditor.d.ts +0 -7
- package/types-3.4/JSEditor.d.ts +0 -7
- package/types-3.4/JSONEditor.d.ts +0 -7
- package/types-3.4/MarkdownEditor.d.ts +0 -7
- package/types-3.4/ObservableMarkdownEditor.d.ts +0 -5
- package/types-3.4/SQLEditor.d.ts +0 -7
- package/types-3.4/XMLEditor.d.ts +0 -7
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/index.d.ts +0 -13
package/package.json
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/codemirror",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "hpcc-js - Viz Code Mirror",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.umd.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.umd.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./dist/*": "./dist/*"
|
|
16
15
|
},
|
|
16
|
+
"browser": "./dist/index.umd.cjs",
|
|
17
|
+
"types": "./types/index.d.ts",
|
|
17
18
|
"files": [
|
|
18
19
|
"dist/*",
|
|
19
|
-
"
|
|
20
|
-
"types
|
|
21
|
-
"src/*"
|
|
20
|
+
"src/*",
|
|
21
|
+
"types/*"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"clean": "rimraf --glob lib* types dist *.tsbuildinfo",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"bundle-watch": "npm run bundle -- -w",
|
|
31
|
-
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
|
|
32
|
-
"gen-legacy-types": "downlevel-dts ./types ./types-3.4",
|
|
33
|
-
"build": "npm run compile-es6 && npm run bundle",
|
|
34
|
-
"watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
|
|
35
|
-
"stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
|
|
24
|
+
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
|
|
25
|
+
"bundle": "vite build",
|
|
26
|
+
"bundle-watch": "vite --port 5501",
|
|
27
|
+
"gen-types": "tsc --project tsconfig.json",
|
|
28
|
+
"gen-types-watch": "npm run gen-types -- --watch",
|
|
29
|
+
"build": "run-p gen-types bundle",
|
|
36
30
|
"lint": "eslint ./src",
|
|
31
|
+
"lint-fix": "eslint --fix src/**/*.ts",
|
|
37
32
|
"docs": "typedoc --options tdoptions.json .",
|
|
38
|
-
"
|
|
33
|
+
"test-browser": "vitest run --project browser",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"coverage": "vitest run --coverage",
|
|
36
|
+
"update": "npx --yes npm-check-updates -u -t minor",
|
|
37
|
+
"update-major": "npx --yes npm-check-updates -u"
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@hpcc-js/common": "^
|
|
40
|
+
"@hpcc-js/common": "^3.3.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@hpcc-js/
|
|
45
|
-
"
|
|
46
|
-
"tslib": "2.7.0"
|
|
43
|
+
"@hpcc-js/esbuild-plugins": "^1.4.0",
|
|
44
|
+
"codemirror": "5.65.18"
|
|
47
45
|
},
|
|
48
46
|
"repository": {
|
|
49
47
|
"type": "git",
|
|
@@ -56,5 +54,5 @@
|
|
|
56
54
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
57
55
|
},
|
|
58
56
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
59
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "145a4d4c8189c70f08e9804e63959d6dd398bd9f"
|
|
60
58
|
}
|
package/src/CSSEditor.ts
CHANGED
package/src/DOTEditor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Editor } from "./Editor";
|
|
1
|
+
import { Editor } from "./Editor.ts";
|
|
2
2
|
|
|
3
3
|
export class DOTEditor extends Editor {
|
|
4
4
|
options(): any {
|
|
@@ -17,4 +17,4 @@ export class DOTEditor extends Editor {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
}
|
|
20
|
-
DOTEditor.prototype._class += "
|
|
20
|
+
DOTEditor.prototype._class += " codemirror_DOTEditor";
|
package/src/ECLEditor.ts
CHANGED
package/src/Editor.css
CHANGED
|
@@ -3,23 +3,28 @@
|
|
|
3
3
|
border-width: 1px;
|
|
4
4
|
border-color: lightgray;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
.codemirror_Editor .cm-marked-text {
|
|
7
8
|
background-color: yellow;
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
.codemirror_Editor .cm-marked-info,
|
|
10
12
|
.codemirror_Editor .cm-marked-error,
|
|
11
|
-
.codemirror_Editor .cm-marked-warning{
|
|
13
|
+
.codemirror_Editor .cm-marked-warning {
|
|
12
14
|
display: inline-block;
|
|
13
15
|
position: relative;
|
|
14
16
|
background-position: left bottom;
|
|
15
17
|
background-repeat: repeat-x;
|
|
16
18
|
}
|
|
19
|
+
|
|
17
20
|
.codemirror_Editor .cm-marked-info {
|
|
18
21
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHElEQVQYV2NkgIP//xkYGBkZIXwIB0SDCQgHAgDEXAgCKU2DPwAAAABJRU5ErkJggg==");
|
|
19
22
|
}
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
.codemirror_Editor .cm-marked-error {
|
|
21
25
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/DAz/GRkYGBlBfBgHTMM4MJUAzFoIAuwf4BEAAAAASUVORK5CYII=");
|
|
22
26
|
}
|
|
27
|
+
|
|
23
28
|
.codemirror_Editor .cm-marked-warning {
|
|
24
29
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/Sxn+M0YzMDKC+DAOmIZxYCoBKQkLp8ga+UwAAAAASUVORK5CYII=");
|
|
25
30
|
}
|
package/src/Editor.ts
CHANGED
package/src/HTMLEditor.ts
CHANGED
package/src/JSEditor.ts
CHANGED
package/src/JSONEditor.ts
CHANGED
package/src/MarkdownEditor.ts
CHANGED
package/src/SQLEditor.ts
CHANGED
package/src/XMLEditor.ts
CHANGED
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/codemirror";
|
|
2
|
-
export const PKG_VERSION = "
|
|
3
|
-
export const BUILD_VERSION = "2.
|
|
2
|
+
export const PKG_VERSION = "3.1.0";
|
|
3
|
+
export const BUILD_VERSION = "3.2.1";
|
|
@@ -0,0 +1,32 @@
|
|
|
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 "./mode/dot/dot.ts";
|
|
9
|
+
import "./mode/markdown/markdown.ts";
|
|
10
|
+
|
|
11
|
+
import "codemirror/lib/codemirror.css";
|
|
12
|
+
|
|
13
|
+
import "codemirror/addon/fold/brace-fold.js";
|
|
14
|
+
import "codemirror/addon/fold/comment-fold.js";
|
|
15
|
+
import "codemirror/addon/fold/foldcode.js";
|
|
16
|
+
import "codemirror/addon/fold/foldgutter.js";
|
|
17
|
+
import "codemirror/addon/fold/indent-fold.js";
|
|
18
|
+
import "codemirror/addon/fold/xml-fold.js";
|
|
19
|
+
|
|
20
|
+
import "codemirror/addon/fold/foldgutter.css";
|
|
21
|
+
|
|
22
|
+
import "codemirror/addon/dialog/dialog.js";
|
|
23
|
+
import "codemirror/addon/search/jump-to-line.js";
|
|
24
|
+
import "codemirror/addon/search/search.js";
|
|
25
|
+
import "codemirror/addon/search/searchcursor.js";
|
|
26
|
+
import "codemirror/addon/hint/show-hint.js";
|
|
27
|
+
|
|
28
|
+
import "codemirror/addon/dialog/dialog.css";
|
|
29
|
+
import "codemirror/addon/hint/show-hint.css";
|
|
30
|
+
|
|
31
|
+
import CodeMirror from "codemirror";
|
|
32
|
+
export { CodeMirror };
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from "./__package__";
|
|
2
|
-
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
|
|
3
|
+
export * from "./CSSEditor.ts";
|
|
4
|
+
export * from "./DOTEditor.ts";
|
|
5
|
+
export * from "./ECLEditor.ts";
|
|
6
|
+
export * from "./Editor.ts";
|
|
7
|
+
export * from "./HTMLEditor.ts";
|
|
8
|
+
export * from "./JSEditor.ts";
|
|
9
|
+
export * from "./JSONEditor.ts";
|
|
10
|
+
export * from "./MarkdownEditor.ts";
|
|
11
|
+
export * from "./ObservableMarkdownEditor.ts";
|
|
12
|
+
export * from "./XMLEditor.ts";
|
|
13
|
+
export * from "./SQLEditor.ts";
|
|
@@ -0,0 +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");
|