@seljs/editor 1.1.0-beta.1 → 1.1.0-beta.2
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.
|
@@ -54,6 +54,7 @@ const buildExtensions = (config) => {
|
|
|
54
54
|
if (config.readOnly) extensions.push(_codemirror_state.EditorState.readOnly.of(true));
|
|
55
55
|
if (config.placeholder) extensions.push((0, _codemirror_view.placeholder)(config.placeholder));
|
|
56
56
|
if (resolved.typeDisplay) extensions.push(require_type_display.createTypeDisplay(checker, config.dark ?? false));
|
|
57
|
+
if (config.features?.tooltip) extensions.push((0, _codemirror_view.tooltips)(config.features.tooltip));
|
|
57
58
|
return extensions;
|
|
58
59
|
};
|
|
59
60
|
//#endregion
|
|
@@ -10,7 +10,7 @@ import { closeBrackets, closeBracketsKeymap } from "@codemirror/autocomplete";
|
|
|
10
10
|
import { SELChecker } from "@seljs/checker";
|
|
11
11
|
import { bracketMatching } from "@codemirror/language";
|
|
12
12
|
import { EditorState } from "@codemirror/state";
|
|
13
|
-
import { EditorView, keymap, placeholder } from "@codemirror/view";
|
|
13
|
+
import { EditorView, keymap, placeholder, tooltips } from "@codemirror/view";
|
|
14
14
|
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
|
15
15
|
import { celLanguageSupport } from "@seljs/cel-lezer";
|
|
16
16
|
//#region src/editor/editor-config.ts
|
|
@@ -54,6 +54,7 @@ const buildExtensions = (config) => {
|
|
|
54
54
|
if (config.readOnly) extensions.push(EditorState.readOnly.of(true));
|
|
55
55
|
if (config.placeholder) extensions.push(placeholder(config.placeholder));
|
|
56
56
|
if (resolved.typeDisplay) extensions.push(createTypeDisplay(checker, config.dark ?? false));
|
|
57
|
+
if (config.features?.tooltip) extensions.push(tooltips(config.features.tooltip));
|
|
57
58
|
return extensions;
|
|
58
59
|
};
|
|
59
60
|
//#endregion
|
package/dist/editor/types.d.cts
CHANGED
|
@@ -27,6 +27,22 @@ interface SELEditorFeatures {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
typeDisplay?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Tooltip rendering configuration (always enabled)
|
|
32
|
+
*/
|
|
33
|
+
tooltip?: {
|
|
34
|
+
/**
|
|
35
|
+
* CSS positioning strategy for tooltips
|
|
36
|
+
*
|
|
37
|
+
* @default "fixed"
|
|
38
|
+
*/
|
|
39
|
+
position?: "fixed" | "absolute";
|
|
40
|
+
/**
|
|
41
|
+
* Custom parent element for tooltip rendering.
|
|
42
|
+
* Useful when the editor is inside a modal or overflow container.
|
|
43
|
+
*/
|
|
44
|
+
parent?: HTMLElement;
|
|
45
|
+
};
|
|
30
46
|
}
|
|
31
47
|
interface SELEditorConfig {
|
|
32
48
|
/**
|
package/dist/editor/types.d.mts
CHANGED
|
@@ -27,6 +27,22 @@ interface SELEditorFeatures {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
typeDisplay?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Tooltip rendering configuration (always enabled)
|
|
32
|
+
*/
|
|
33
|
+
tooltip?: {
|
|
34
|
+
/**
|
|
35
|
+
* CSS positioning strategy for tooltips
|
|
36
|
+
*
|
|
37
|
+
* @default "fixed"
|
|
38
|
+
*/
|
|
39
|
+
position?: "fixed" | "absolute";
|
|
40
|
+
/**
|
|
41
|
+
* Custom parent element for tooltip rendering.
|
|
42
|
+
* Useful when the editor is inside a modal or overflow container.
|
|
43
|
+
*/
|
|
44
|
+
parent?: HTMLElement;
|
|
45
|
+
};
|
|
30
46
|
}
|
|
31
47
|
interface SELEditorConfig {
|
|
32
48
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seljs/editor",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/abinnovision/seljs"
|
|
6
6
|
},
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@codemirror/view": "^6.40.0",
|
|
57
57
|
"@lezer/common": "^1.5.1",
|
|
58
58
|
"@lezer/highlight": "^1.2.3",
|
|
59
|
-
"@seljs/cel-lezer": "1.1.0-beta.
|
|
60
|
-
"@seljs/checker": "1.1.0-beta.
|
|
59
|
+
"@seljs/cel-lezer": "1.1.0-beta.2",
|
|
60
|
+
"@seljs/checker": "1.1.0-beta.2",
|
|
61
61
|
"@seljs/schema": "1.0.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|