@hpcc-js/codemirror 2.60.13 → 2.61.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/dist/index.es6.js +66 -36
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +66 -36
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/Editor.ts +30 -7
- package/src/__package__.ts +2 -2
- package/types/Editor.d.ts +6 -0
- package/types/Editor.d.ts.map +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/Editor.d.ts +6 -0
- package/types-3.4/__package__.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/codemirror",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.1",
|
|
4
4
|
"description": "hpcc-js - Viz Code Mirror",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es6",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"update": "npx --yes npm-check-updates -u -t minor"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@hpcc-js/common": "^2.71.
|
|
41
|
+
"@hpcc-js/common": "^2.71.14"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@hpcc-js/bundle": "^2.11.5",
|
|
45
|
-
"@hpcc-js/codemirror-shim": "^2.34.
|
|
45
|
+
"@hpcc-js/codemirror-shim": "^2.34.7",
|
|
46
46
|
"tslib": "2.6.2"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "afae5cc2bcc06ab57b23af729d18b8b4db0b70db"
|
|
60
60
|
}
|
package/src/Editor.ts
CHANGED
|
@@ -22,28 +22,45 @@ export class Editor extends HTMLWidget {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
private _options = new Map<string, string | number>();
|
|
26
|
+
option(option: string): string | number;
|
|
27
|
+
option(option: string, value: string | number): this;
|
|
28
|
+
option(option: string, value?: string | number): string | number | this {
|
|
29
|
+
if (this._codemirror) {
|
|
30
|
+
if (arguments.length < 2) {
|
|
31
|
+
return this._codemirror.getOption(option);
|
|
32
|
+
}
|
|
33
|
+
this._codemirror.setOption(option, value);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
if (arguments.length < 2) {
|
|
37
|
+
return this._options.get(option);
|
|
38
|
+
}
|
|
39
|
+
this._options.set(option, value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
guttersOption(): (string | { className: string, style: string })[] {
|
|
43
|
+
const gutters: (string | { className: string, style: string })[] = ["CodeMirror-linenumbers"];
|
|
27
44
|
if (this.gutterMarkerWidth() > 0) {
|
|
28
45
|
gutters.unshift({
|
|
29
|
-
className:"CodeMirror-guttermarker",
|
|
46
|
+
className: "CodeMirror-guttermarker",
|
|
30
47
|
style: `width:${this.gutterMarkerWidth()}px;`
|
|
31
48
|
});
|
|
32
49
|
}
|
|
33
50
|
return gutters;
|
|
34
51
|
}
|
|
35
52
|
|
|
36
|
-
addGutterMarker(lineNumber: number, commentText: string, backgroundColor: string = null, fontFamily: string = null, fontSize: string = null, onmouseenter = () => {}, onmouseleave = () => {}, onclick = (event: MouseEvent) => {}) {
|
|
53
|
+
addGutterMarker(lineNumber: number, commentText: string, backgroundColor: string = null, fontFamily: string = null, fontSize: string = null, onmouseenter = () => { }, onmouseleave = () => { }, onclick = (event: MouseEvent) => { }) {
|
|
37
54
|
const line = this._codemirror.getLineHandle(lineNumber);
|
|
38
55
|
const marker = document.createElement("div");
|
|
39
56
|
marker.textContent = commentText;
|
|
40
57
|
marker.style.paddingLeft = "3px";
|
|
41
58
|
marker.style.paddingRight = "3px";
|
|
42
59
|
marker.style.color = Palette.textColor(backgroundColor);
|
|
43
|
-
if(fontFamily !== null) {
|
|
60
|
+
if (fontFamily !== null) {
|
|
44
61
|
marker.style.fontFamily = fontFamily;
|
|
45
62
|
}
|
|
46
|
-
if(fontSize !== null) {
|
|
63
|
+
if (fontSize !== null) {
|
|
47
64
|
marker.style.fontSize = fontSize;
|
|
48
65
|
}
|
|
49
66
|
marker.style.backgroundColor = backgroundColor;
|
|
@@ -54,7 +71,7 @@ export class Editor extends HTMLWidget {
|
|
|
54
71
|
marker.onclick = onclick;
|
|
55
72
|
}
|
|
56
73
|
|
|
57
|
-
removeGutterMarker(lineNumber: number){
|
|
74
|
+
removeGutterMarker(lineNumber: number) {
|
|
58
75
|
const line = this._codemirror.getLineHandle(lineNumber);
|
|
59
76
|
this._codemirror.setGutterMarker(line, "CodeMirror-guttermarker", null);
|
|
60
77
|
}
|
|
@@ -145,6 +162,9 @@ export class Editor extends HTMLWidget {
|
|
|
145
162
|
this._codemirror.on("changes", (cm: CodeMirror.EditorFromTextArea, changes: object[]) => {
|
|
146
163
|
this.changes(changes);
|
|
147
164
|
});
|
|
165
|
+
this._options.forEach((value, key) => {
|
|
166
|
+
this._codemirror.setOption(key, value);
|
|
167
|
+
});
|
|
148
168
|
this.text(this._initialText);
|
|
149
169
|
}
|
|
150
170
|
|
|
@@ -160,6 +180,9 @@ export class Editor extends HTMLWidget {
|
|
|
160
180
|
changes(changes: object[]) {
|
|
161
181
|
}
|
|
162
182
|
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated Replaced with `option`
|
|
185
|
+
*/
|
|
163
186
|
setOption(option: string, value: any): void {
|
|
164
187
|
this._codemirror.setOption(option, value);
|
|
165
188
|
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/codemirror";
|
|
2
|
-
export const PKG_VERSION = "2.
|
|
3
|
-
export const BUILD_VERSION = "2.104.
|
|
2
|
+
export const PKG_VERSION = "2.61.1";
|
|
3
|
+
export const BUILD_VERSION = "2.104.35";
|
package/types/Editor.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare class Editor extends HTMLWidget {
|
|
|
9
9
|
private _markedText;
|
|
10
10
|
protected _initialText: string;
|
|
11
11
|
options(): any;
|
|
12
|
+
private _options;
|
|
13
|
+
option(option: string): string | number;
|
|
14
|
+
option(option: string, value: string | number): this;
|
|
12
15
|
guttersOption(): (string | {
|
|
13
16
|
className: string;
|
|
14
17
|
style: string;
|
|
@@ -30,6 +33,9 @@ export declare class Editor extends HTMLWidget {
|
|
|
30
33
|
enter(domNode: any, element: any): void;
|
|
31
34
|
update(domNode: any, Element: any): void;
|
|
32
35
|
changes(changes: object[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Replaced with `option`
|
|
38
|
+
*/
|
|
33
39
|
setOption(option: string, value: any): void;
|
|
34
40
|
}
|
|
35
41
|
export interface Editor {
|
package/types/Editor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../src/Editor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAW,MAAM,iBAAiB,CAAC;AAEtD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,MAAO,SAAQ,UAAU;IAClC,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,WAAW,CAAM;IACzB,SAAS,CAAC,YAAY,EAAE,MAAM,CAAM;IAEpC,OAAO,IAAI,GAAG;IASd,aAAa,IAAI,CAAC,MAAM,GAAG;
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"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E,SAAS,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAK1E,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAKxE,kBAAkB,IAAI,IAAI;IAQ1B,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS;IAIhC,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIzC,kBAAkB,CAAC,GAAG,EAAE,MAAM;IAa9B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,UAAO;IAShD,KAAK,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;IAYtB,MAAM,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;IASvB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE;IAGzB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAG9C;AAGD,MAAM,WAAW,MAAM;IACnB,QAAQ,IAAI,OAAO,CAAC;IACpB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,iBAAiB,IAAI,MAAM,CAAC;IAC5B,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,IAAI,MAAM,CAAC;IAC1B,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC"}
|
package/types/__package__.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/codemirror";
|
|
2
|
-
export declare const PKG_VERSION = "2.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "2.61.1";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.35";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAC9C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAC9C,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,aAAa,CAAC"}
|
package/types-3.4/Editor.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare class Editor extends HTMLWidget {
|
|
|
9
9
|
private _markedText;
|
|
10
10
|
protected _initialText: string;
|
|
11
11
|
options(): any;
|
|
12
|
+
private _options;
|
|
13
|
+
option(option: string): string | number;
|
|
14
|
+
option(option: string, value: string | number): this;
|
|
12
15
|
guttersOption(): (string | {
|
|
13
16
|
className: string;
|
|
14
17
|
style: string;
|
|
@@ -30,6 +33,9 @@ export declare class Editor extends HTMLWidget {
|
|
|
30
33
|
enter(domNode: any, element: any): void;
|
|
31
34
|
update(domNode: any, Element: any): void;
|
|
32
35
|
changes(changes: object[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Replaced with `option`
|
|
38
|
+
*/
|
|
33
39
|
setOption(option: string, value: any): void;
|
|
34
40
|
}
|
|
35
41
|
export interface Editor {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/codemirror";
|
|
2
|
-
export declare const PKG_VERSION = "2.
|
|
3
|
-
export declare const BUILD_VERSION = "2.104.
|
|
2
|
+
export declare const PKG_VERSION = "2.61.1";
|
|
3
|
+
export declare const BUILD_VERSION = "2.104.35";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|