@seljs/editor 1.1.0-beta.2 → 1.1.0-beta.3
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,14 @@ 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
|
+
const minLines = config.features?.view?.minLines;
|
|
58
|
+
if (minLines && minLines > 1) {
|
|
59
|
+
const minHeight = `${String(Math.max(1, minLines) * 1.4)}em`;
|
|
60
|
+
extensions.push(_codemirror_view.EditorView.theme({
|
|
61
|
+
"&": { minHeight },
|
|
62
|
+
".cm-content": { minHeight }
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
57
65
|
if (config.features?.tooltip) extensions.push((0, _codemirror_view.tooltips)(config.features.tooltip));
|
|
58
66
|
return extensions;
|
|
59
67
|
};
|
|
@@ -54,6 +54,14 @@ 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
|
+
const minLines = config.features?.view?.minLines;
|
|
58
|
+
if (minLines && minLines > 1) {
|
|
59
|
+
const minHeight = `${String(Math.max(1, minLines) * 1.4)}em`;
|
|
60
|
+
extensions.push(EditorView.theme({
|
|
61
|
+
"&": { minHeight },
|
|
62
|
+
".cm-content": { minHeight }
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
57
65
|
if (config.features?.tooltip) extensions.push(tooltips(config.features.tooltip));
|
|
58
66
|
return extensions;
|
|
59
67
|
};
|
package/dist/editor/types.d.cts
CHANGED
|
@@ -27,6 +27,17 @@ interface SELEditorFeatures {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
typeDisplay?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Editor view configuration (always enabled)
|
|
32
|
+
*/
|
|
33
|
+
view?: {
|
|
34
|
+
/**
|
|
35
|
+
* Minimum number of visible lines
|
|
36
|
+
*
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
minLines?: number;
|
|
40
|
+
};
|
|
30
41
|
/**
|
|
31
42
|
* Tooltip rendering configuration (always enabled)
|
|
32
43
|
*/
|
package/dist/editor/types.d.mts
CHANGED
|
@@ -27,6 +27,17 @@ interface SELEditorFeatures {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
typeDisplay?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Editor view configuration (always enabled)
|
|
32
|
+
*/
|
|
33
|
+
view?: {
|
|
34
|
+
/**
|
|
35
|
+
* Minimum number of visible lines
|
|
36
|
+
*
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
minLines?: number;
|
|
40
|
+
};
|
|
30
41
|
/**
|
|
31
42
|
* Tooltip rendering configuration (always enabled)
|
|
32
43
|
*/
|
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.3",
|
|
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.3",
|
|
60
|
+
"@seljs/checker": "1.1.0-beta.3",
|
|
61
61
|
"@seljs/schema": "1.0.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|