@harborclient/sdk 1.2.3 → 1.2.4
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/components/CodeEditor/hostDiagnostics.d.ts.map +1 -1
- package/dist/components/CodeEditor/hostDiagnostics.js +2 -1
- package/dist/components/CodeEditor/lintTooltipHideOn.d.ts +18 -0
- package/dist/components/CodeEditor/lintTooltipHideOn.d.ts.map +1 -0
- package/dist/components/CodeEditor/lintTooltipHideOn.js +18 -0
- package/dist/components/CodeEditor/syntaxLinters.d.ts.map +1 -1
- package/dist/components/CodeEditor/syntaxLinters.js +3 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostDiagnostics.d.ts","sourceRoot":"","sources":["../../../src/components/CodeEditor/hostDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hostDiagnostics.d.ts","sourceRoot":"","sources":["../../../src/components/CodeEditor/hostDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAExC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,oBAAoB,EAAE,GAC3C,UAAU,EAAE,CA4Bd;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,SAAS,oBAAoB,EAAE,GACpD,SAAS,CAOX"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { linter } from '@codemirror/lint';
|
|
2
|
+
import { lintTooltipHideOn } from './lintTooltipHideOn.js';
|
|
2
3
|
/**
|
|
3
4
|
* Clamps and filters host diagnostics into CodeMirror {@link Diagnostic} values.
|
|
4
5
|
*
|
|
@@ -45,5 +46,5 @@ export function normalizeHostDiagnostics(docLength, diagnostics) {
|
|
|
45
46
|
export function createHostDiagnosticsLinter(getDiagnostics) {
|
|
46
47
|
return linter((view) => {
|
|
47
48
|
return normalizeHostDiagnostics(view.state.doc.length, getDiagnostics());
|
|
48
|
-
});
|
|
49
|
+
}, { hideOn: lintTooltipHideOn });
|
|
49
50
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Transaction } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Keeps lint hover tooltips open across diagnostic refreshes; only hides when
|
|
4
|
+
* the document changes under the hovered diagnostic range.
|
|
5
|
+
*
|
|
6
|
+
* CodeMirror's default lint `hideOn` closes tooltips whenever
|
|
7
|
+
* `setDiagnosticsEffect` fires — including deferred syntax-linter passes that
|
|
8
|
+
* leave the hovered diagnostic unchanged. Returning a boolean (not `null`)
|
|
9
|
+
* skips that default and keeps the tooltip readable while the pointer stays
|
|
10
|
+
* over the squiggle.
|
|
11
|
+
*
|
|
12
|
+
* @param tr - Transaction that may hide an open lint tooltip.
|
|
13
|
+
* @param from - Start of the hovered diagnostic range.
|
|
14
|
+
* @param to - End of the hovered diagnostic range.
|
|
15
|
+
* @returns `true` when the tooltip should hide because the range was edited.
|
|
16
|
+
*/
|
|
17
|
+
export declare function lintTooltipHideOn(tr: Transaction, from: number, to: number): boolean;
|
|
18
|
+
//# sourceMappingURL=lintTooltipHideOn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lintTooltipHideOn.d.ts","sourceRoot":"","sources":["../../../src/components/CodeEditor/lintTooltipHideOn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps lint hover tooltips open across diagnostic refreshes; only hides when
|
|
3
|
+
* the document changes under the hovered diagnostic range.
|
|
4
|
+
*
|
|
5
|
+
* CodeMirror's default lint `hideOn` closes tooltips whenever
|
|
6
|
+
* `setDiagnosticsEffect` fires — including deferred syntax-linter passes that
|
|
7
|
+
* leave the hovered diagnostic unchanged. Returning a boolean (not `null`)
|
|
8
|
+
* skips that default and keeps the tooltip readable while the pointer stays
|
|
9
|
+
* over the squiggle.
|
|
10
|
+
*
|
|
11
|
+
* @param tr - Transaction that may hide an open lint tooltip.
|
|
12
|
+
* @param from - Start of the hovered diagnostic range.
|
|
13
|
+
* @param to - End of the hovered diagnostic range.
|
|
14
|
+
* @returns `true` when the tooltip should hide because the range was edited.
|
|
15
|
+
*/
|
|
16
|
+
export function lintTooltipHideOn(tr, from, to) {
|
|
17
|
+
return !!tr.changes.touchesRange(from, to);
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntaxLinters.d.ts","sourceRoot":"","sources":["../../../src/components/CodeEditor/syntaxLinters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"syntaxLinters.d.ts","sourceRoot":"","sources":["../../../src/components/CodeEditor/syntaxLinters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA6CnD;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,SAAS,CAexD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,CAElD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsonParseLinter } from '@codemirror/lang-json';
|
|
2
2
|
import { syntaxTree } from '@codemirror/language';
|
|
3
3
|
import { linter } from '@codemirror/lint';
|
|
4
|
+
import { lintTooltipHideOn } from './lintTooltipHideOn.js';
|
|
4
5
|
/** Maximum wait before running deferred lint when the browser stays busy. */
|
|
5
6
|
const LINT_IDLE_TIMEOUT_MS = 500;
|
|
6
7
|
/**
|
|
@@ -55,11 +56,11 @@ export function createJavascriptSyntaxLinter() {
|
|
|
55
56
|
resolve(collectJavascriptSyntaxErrors(view));
|
|
56
57
|
}, LINT_IDLE_TIMEOUT_MS);
|
|
57
58
|
});
|
|
58
|
-
});
|
|
59
|
+
}, { hideOn: lintTooltipHideOn });
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* Returns a lint extension that underlines JSON parse errors.
|
|
62
63
|
*/
|
|
63
64
|
export function createJsonSyntaxLinter() {
|
|
64
|
-
return linter(jsonParseLinter());
|
|
65
|
+
return linter(jsonParseLinter(), { hideOn: lintTooltipHideOn });
|
|
65
66
|
}
|