@hpcc-js/codemirror 3.3.7 → 3.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/codemirror",
3
- "version": "3.3.7",
3
+ "version": "3.4.0",
4
4
  "description": "hpcc-js - Viz Code Mirror",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -37,10 +37,10 @@
37
37
  "update-major": "npx --yes npm-check-updates -u"
38
38
  },
39
39
  "dependencies": {
40
- "@hpcc-js/common": "^3.3.7"
40
+ "@hpcc-js/common": "^3.3.8"
41
41
  },
42
42
  "devDependencies": {
43
- "@hpcc-js/esbuild-plugins": "^1.4.7",
43
+ "@hpcc-js/esbuild-plugins": "^1.4.8",
44
44
  "codemirror": "5.65.19"
45
45
  },
46
46
  "repository": {
@@ -54,5 +54,5 @@
54
54
  "url": "https://github.com/hpcc-systems/Visualization/issues"
55
55
  },
56
56
  "homepage": "https://github.com/hpcc-systems/Visualization",
57
- "gitHead": "44cd47dfe0d954df395002c2d5ce222a73d73f2a"
57
+ "gitHead": "4fdf6c27fbc81d22b07c7462b638993d41fc1abe"
58
58
  }
package/src/Editor.ts CHANGED
@@ -124,6 +124,16 @@ export class Editor extends HTMLWidget {
124
124
  return this;
125
125
  }
126
126
 
127
+ addLineClass(options: { lineNum: number, where?: "text" | "background" | "gutter", cssClass: string }): this {
128
+ this._codemirror.addLineClass(this._codemirror.getLineHandle(options.lineNum), options.where ?? "background", options.cssClass);
129
+ return this;
130
+ }
131
+
132
+ removeLineClass(options: { lineNum: number, where?: "text" | "background" | "gutter", cssClass: string }): this {
133
+ this._codemirror.removeLineClass(this._codemirror.getLineHandle(options.lineNum), options.where ?? "background", options.cssClass);
134
+ return this;
135
+ }
136
+
127
137
  removeAllHighlight(): this {
128
138
  for (const marked of this._markedText) {
129
139
  marked.clear();
package/types/Editor.d.ts CHANGED
@@ -30,6 +30,16 @@ export declare class Editor extends HTMLWidget {
30
30
  highlightInfo(start: IPosition | number, end: IPosition | number): this;
31
31
  highlightWarning(start: IPosition | number, end: IPosition | number): this;
32
32
  highlightError(start: IPosition | number, end: IPosition | number): this;
33
+ addLineClass(options: {
34
+ lineNum: number;
35
+ where?: "text" | "background" | "gutter";
36
+ cssClass: string;
37
+ }): this;
38
+ removeLineClass(options: {
39
+ lineNum: number;
40
+ where?: "text" | "background" | "gutter";
41
+ cssClass: string;
42
+ }): this;
33
43
  removeAllHighlight(): this;
34
44
  positionAt(i: number): IPosition;
35
45
  getLineLength(lineNumber: number): number;