@knime/kds-code-editor 2.6.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.
- package/LICENSE +710 -0
- package/README.md +133 -0
- package/dist/assets/editor.worker-CLAZlRUj.js.map +1 -0
- package/dist/assets/json.worker-CWsWF5cb.js.map +1 -0
- package/dist/editor.worker-CtYtPH8e.js +21 -0
- package/dist/editor.worker-CtYtPH8e.js.map +1 -0
- package/dist/index.css +80 -0
- package/dist/index.js +1185 -0
- package/dist/index.js.map +1 -0
- package/dist/json.worker-B5MqtfsC.js +21 -0
- package/dist/json.worker-B5MqtfsC.js.map +1 -0
- package/dist/src/CodeEditor/KdsCodeEditor.vue.d.ts +18 -0
- package/dist/src/CodeEditor/KdsCodeEditor.vue.d.ts.map +1 -0
- package/dist/src/CodeEditor/enums.d.ts +7 -0
- package/dist/src/CodeEditor/enums.d.ts.map +1 -0
- package/dist/src/CodeEditor/index.d.ts +5 -0
- package/dist/src/CodeEditor/index.d.ts.map +1 -0
- package/dist/src/CodeEditor/monacoEnvironment.d.ts +2 -0
- package/dist/src/CodeEditor/monacoEnvironment.d.ts.map +1 -0
- package/dist/src/CodeEditor/tomlLanguage.d.ts +2 -0
- package/dist/src/CodeEditor/tomlLanguage.d.ts.map +1 -0
- package/dist/src/CodeEditor/types.d.ts +101 -0
- package/dist/src/CodeEditor/types.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +57 -0
- package/patches/monaco-editor@0.55.1.patch +85 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.worker-B5MqtfsC.js","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { editor } from 'monaco-editor';
|
|
2
|
+
import { KdsCodeEditorProps } from './types';
|
|
3
|
+
type __VLS_Props = KdsCodeEditorProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
9
|
+
/** The underlying Monaco editor instance, available after mount. */
|
|
10
|
+
getEditor: () => editor.IStandaloneCodeEditor | undefined;
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: string) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=KdsCodeEditor.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KdsCodeEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/KdsCodeEditor.vue"],"names":[],"mappings":"AAqbA,OAAO,EAAW,MAAM,EAAE,MAAM,eAAe,CAAC;AAchD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIlD,KAAK,WAAW,GAAG,kBAAkB,CAAC;AAkQtC,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAyNxD,QAAA,MAAM,YAAY;IAzOhB,oEAAoE;;;;;;kFA6OpE,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/enums.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAEX,eAAO,MAAM,mBAAmB,qCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,cAAc,SAAS,CAAC;AACxB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monacoEnvironment.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/monacoEnvironment.ts"],"names":[],"mappings":"AAGA,OAAO,gBAAgB,CAAC;AAexB,eAAO,MAAM,sBAAsB,YAgBlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tomlLanguage.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/tomlLanguage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { KdsButtonProps, KdsMenuButtonProps, KdsToggleButtonProps } from '@knime/kds-components';
|
|
2
|
+
import { kdsCodeEditorState } from './enums';
|
|
3
|
+
export type KdsCodeEditorState = (typeof kdsCodeEditorState)[keyof typeof kdsCodeEditorState];
|
|
4
|
+
/**
|
|
5
|
+
* Distributive `Omit` that preserves discriminated unions when removing a key.
|
|
6
|
+
*/
|
|
7
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
8
|
+
/**
|
|
9
|
+
* Renders a `KdsButton`. Provide `onClick` to react to clicks.
|
|
10
|
+
*/
|
|
11
|
+
export type KdsCodeEditorButtonAction = {
|
|
12
|
+
type: "button";
|
|
13
|
+
props: DistributiveOmit<KdsButtonProps, "size">;
|
|
14
|
+
onClick?: (event: MouseEvent) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders a `KdsToggleButton`. Provide `onUpdateModelValue` to react to
|
|
18
|
+
* toggle changes.
|
|
19
|
+
*/
|
|
20
|
+
export type KdsCodeEditorToggleButtonAction = {
|
|
21
|
+
type: "toggleButton";
|
|
22
|
+
props: DistributiveOmit<KdsToggleButtonProps, "size"> & {
|
|
23
|
+
modelValue?: boolean;
|
|
24
|
+
};
|
|
25
|
+
onUpdateModelValue?: (value: boolean) => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Renders a `KdsMenuButton`. Provide `onItemClick` to react to menu item
|
|
29
|
+
* selection.
|
|
30
|
+
*/
|
|
31
|
+
export type KdsCodeEditorMenuButtonAction = {
|
|
32
|
+
type: "menuButton";
|
|
33
|
+
props: DistributiveOmit<KdsMenuButtonProps, "size">;
|
|
34
|
+
onItemClick?: (id: string) => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A header action button. Rendered at a fixed `small` size.
|
|
38
|
+
*/
|
|
39
|
+
export type KdsCodeEditorAction = KdsCodeEditorButtonAction | KdsCodeEditorToggleButtonAction | KdsCodeEditorMenuButtonAction;
|
|
40
|
+
export type KdsCodeEditorProps = {
|
|
41
|
+
/**
|
|
42
|
+
* The Monaco language id used for syntax highlighting (e.g. `python`,
|
|
43
|
+
* `json`, `sql`). In addition to Monaco's built-in languages, `toml` is
|
|
44
|
+
* supported via a bundled custom grammar. Defaults to `plaintext`.
|
|
45
|
+
*/
|
|
46
|
+
language?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The label shown on the left of the header. Defaults to the uppercased
|
|
49
|
+
* `language` value.
|
|
50
|
+
*/
|
|
51
|
+
languageLabel?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Hides the entire header (language label, read-only hint, action buttons,
|
|
54
|
+
* copy button), leaving the bare code editor. The editor's accessible name
|
|
55
|
+
* still announces the language. Defaults to `false`.
|
|
56
|
+
*/
|
|
57
|
+
hideHeader?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Visual state of the editor. `error` and `warning` tint the header and the
|
|
60
|
+
* sub-text below the editor.
|
|
61
|
+
*/
|
|
62
|
+
state?: KdsCodeEditorState;
|
|
63
|
+
/**
|
|
64
|
+
* Shows the overview ruler — the coloured error / warning / selection
|
|
65
|
+
* markers painted on the scrollbar. Defaults to `false`.
|
|
66
|
+
*/
|
|
67
|
+
overviewRuler?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the editor read-only (still focusable, selectable and copyable)
|
|
70
|
+
* and greys out its content.
|
|
71
|
+
*/
|
|
72
|
+
readOnly?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Optional helper / validation message shown below the editor. Its colour
|
|
75
|
+
* follows the `state`.
|
|
76
|
+
*/
|
|
77
|
+
subText?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Shows the built-in copy-to-clipboard action button in the header.
|
|
80
|
+
*/
|
|
81
|
+
copyable?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Header action buttons, rendered right-aligned before the built-in copy
|
|
84
|
+
* button. Rendered at a fixed `small` size.
|
|
85
|
+
*/
|
|
86
|
+
editorActions?: KdsCodeEditorAction[];
|
|
87
|
+
/**
|
|
88
|
+
* Minimum number of visible rows the editor grows from. When neither
|
|
89
|
+
* `minRows` nor `maxRows` is set, the editor fills its container's height
|
|
90
|
+
* instead.
|
|
91
|
+
*/
|
|
92
|
+
minRows?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Maximum number of visible rows. When set, the editor caps at this height
|
|
95
|
+
* and scrolls past it. When unset (but `minRows` is set), the editor grows
|
|
96
|
+
* with its content to avoid nested scrollbars.
|
|
97
|
+
*/
|
|
98
|
+
maxRows?: number;
|
|
99
|
+
};
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/CodeEditor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AAKH,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,OAAO,GAC/D,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,gBAAgB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,gBAAgB,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;QACtD,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,yBAAyB,GACzB,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,mBAAmB,cAAc,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@knime/kds-code-editor",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.6.3",
|
|
5
|
+
"description": "Package containing the code editor component of the KNIME Design System",
|
|
6
|
+
"license": "See LICENSE file",
|
|
7
|
+
"author": "KNIME AG, Zurich, Switzerland",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@knime/kds-components": "^2.6.3",
|
|
10
|
+
"@knime/kds-styles": "^2.6.3"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@storybook/vue3-vite": "^10.4.6",
|
|
14
|
+
"@tsconfig/node24": "^24.0.4",
|
|
15
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
16
|
+
"@vue/test-utils": "^2.4.11",
|
|
17
|
+
"@vueuse/core": "~14.3.0",
|
|
18
|
+
"monaco-editor": "^0.55.1",
|
|
19
|
+
"storybook": "^10.4.6",
|
|
20
|
+
"typescript": "^6.0.3",
|
|
21
|
+
"vite": "^8.1.3",
|
|
22
|
+
"vite-plugin-dts": "^5.0.3",
|
|
23
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
24
|
+
"vite-svg-loader": "^5.1.1",
|
|
25
|
+
"vue": "3.5.39"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@vueuse/core": "~13.8.0",
|
|
29
|
+
"monaco-editor": "^0.55.1",
|
|
30
|
+
"vue": "~3.5.0"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"patches",
|
|
35
|
+
"CHANGELOG.md"
|
|
36
|
+
],
|
|
37
|
+
"main": "./dist/index.js",
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"types": "./dist/src/index.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./dist/src/index.d.ts",
|
|
43
|
+
"import": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": "24.10.0",
|
|
48
|
+
"npm": "please-use-pnpm"
|
|
49
|
+
},
|
|
50
|
+
"sideEffects": [
|
|
51
|
+
"dist/*.css"
|
|
52
|
+
],
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "pnpm run type-check && vite build",
|
|
55
|
+
"type-check": "vue-tsc --build"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
diff --git a/esm/vs/editor/browser/controller/mouseHandler.js b/esm/vs/editor/browser/controller/mouseHandler.js
|
|
2
|
+
index be17f497db57379c0e5f5fc4d87b3a38ffe55a44..8092c6b4d2b5e988fc66ac82a178443761bb3c3a 100644
|
|
3
|
+
--- a/esm/vs/editor/browser/controller/mouseHandler.js
|
|
4
|
+
+++ b/esm/vs/editor/browser/controller/mouseHandler.js
|
|
5
|
+
@@ -38,7 +38,7 @@ class MouseHandler extends ViewEventHandler {
|
|
6
|
+
// remove this listener
|
|
7
|
+
if (!this._mouseLeaveMonitor) {
|
|
8
|
+
this._mouseLeaveMonitor = addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {
|
|
9
|
+
- if (!this.viewHelper.viewDomNode.contains(e.target)) {
|
|
10
|
+
+ if (!this.viewHelper.viewDomNode.contains(e.composedPath()[0] ?? e.target)) {
|
|
11
|
+
// went outside the editor!
|
|
12
|
+
this._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));
|
|
13
|
+
}
|
|
14
|
+
diff --git a/esm/vs/editor/contrib/suggest/browser/suggestWidget.js b/esm/vs/editor/contrib/suggest/browser/suggestWidget.js
|
|
15
|
+
index 7ff8f73fee8c7f5643ca75879553e024f765db28..76f74d535944cce983036f90b7729b0e190b01d7 100644
|
|
16
|
+
--- a/esm/vs/editor/contrib/suggest/browser/suggestWidget.js
|
|
17
|
+
+++ b/esm/vs/editor/contrib/suggest/browser/suggestWidget.js
|
|
18
|
+
@@ -1,4 +1,4 @@
|
|
19
|
+
-import { Dimension, append, $, addStandardDisposableListener, hide, show, runAtThisOrScheduleAtNextAnimationFrame, getWindow, getClientArea, getDomNodePagePosition } from '../../../../base/browser/dom.js';
|
|
20
|
+
+import { Dimension, append, $, addStandardDisposableListener, hide, show, runAtThisOrScheduleAtNextAnimationFrame, getWindow, getClientArea, getDomNodePagePosition, getShadowRoot } from '../../../../base/browser/dom.js';
|
|
21
|
+
import '../../../../base/browser/ui/codicons/codicon/codicon.css';
|
|
22
|
+
import '../../../../base/browser/ui/codicons/codicon/codicon-modifiers.css';
|
|
23
|
+
import { List } from '../../../../base/browser/ui/list/listWidget.js';
|
|
24
|
+
@@ -692,7 +692,16 @@ let SuggestWidget = class SuggestWidget {
|
|
25
|
+
// happens when running tests
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
- const bodyBox = getClientArea(this.element.domNode.ownerDocument.body);
|
|
29
|
+
+ const shadowRoot = getShadowRoot(this.element.domNode);
|
|
30
|
+
+ let bodyBox;
|
|
31
|
+
+ let containerTop = 0;
|
|
32
|
+
+ if (shadowRoot) {
|
|
33
|
+
+ const hostRect = shadowRoot.host.getBoundingClientRect();
|
|
34
|
+
+ bodyBox = new Dimension(hostRect.width, hostRect.bottom);
|
|
35
|
+
+ containerTop = hostRect.top;
|
|
36
|
+
+ } else {
|
|
37
|
+
+ bodyBox = getClientArea(this.element.domNode.ownerDocument.body);
|
|
38
|
+
+ }
|
|
39
|
+
const info = this.getLayoutInfo();
|
|
40
|
+
if (!size) {
|
|
41
|
+
size = info.defaultSize;
|
|
42
|
+
@@ -724,7 +733,7 @@ let SuggestWidget = class SuggestWidget {
|
|
43
|
+
const cursorBox = this.editor.getScrolledVisiblePosition(this.editor.getPosition());
|
|
44
|
+
const cursorBottom = editorBox.top + cursorBox.top + cursorBox.height;
|
|
45
|
+
const maxHeightBelow = Math.min(bodyBox.height - cursorBottom - info.verticalPadding, fullHeight);
|
|
46
|
+
- const availableSpaceAbove = editorBox.top + cursorBox.top - info.verticalPadding;
|
|
47
|
+
+ const availableSpaceAbove = editorBox.top + cursorBox.top - containerTop - info.verticalPadding;
|
|
48
|
+
const maxHeightAbove = Math.min(availableSpaceAbove, fullHeight);
|
|
49
|
+
let maxHeight = Math.min(Math.max(maxHeightAbove, maxHeightBelow) + info.borderHeight, fullHeight);
|
|
50
|
+
if (height === this._cappedHeight?.capped) {
|
|
51
|
+
diff --git a/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js b/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js
|
|
52
|
+
index ed1335210aceda06699ef061a8c23934222b5806..7519e203e37de4eaab8bdcd0afe1bc297c00bf6d 100644
|
|
53
|
+
--- a/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js
|
|
54
|
+
+++ b/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js
|
|
55
|
+
@@ -1,4 +1,4 @@
|
|
56
|
+
-import { Dimension, $, append, show, clearNode, hide, size, getClientArea } from '../../../../base/browser/dom.js';
|
|
57
|
+
+import { Dimension, $, append, show, clearNode, hide, size, getClientArea, getShadowRoot } from '../../../../base/browser/dom.js';
|
|
58
|
+
import { ResizableHTMLElement } from '../../../../base/browser/ui/resizable/resizable.js';
|
|
59
|
+
import { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';
|
|
60
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
61
|
+
@@ -307,7 +307,10 @@ class SuggestDetailsOverlay {
|
|
62
|
+
this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, preferAlignAtTop);
|
|
63
|
+
}
|
|
64
|
+
_placeAtAnchor(anchorBox, size, preferAlignAtTop) {
|
|
65
|
+
- const bodyBox = getClientArea(this.getDomNode().ownerDocument.body);
|
|
66
|
+
+ const shadowRoot = getShadowRoot(this.getDomNode());
|
|
67
|
+
+ const bodyBox = shadowRoot
|
|
68
|
+
+ ? (() => { const r = shadowRoot.host.getBoundingClientRect(); return new Dimension(r.right, r.bottom); })()
|
|
69
|
+
+ : getClientArea(this.getDomNode().ownerDocument.body);
|
|
70
|
+
const info = this.widget.getLayoutInfo();
|
|
71
|
+
const defaultMinSize = new Dimension(220, 2 * info.lineHeight);
|
|
72
|
+
const defaultTop = anchorBox.top;
|
|
73
|
+
diff --git a/esm/vs/platform/actionWidget/browser/actionList.js b/esm/vs/platform/actionWidget/browser/actionList.js
|
|
74
|
+
index 414405319ded9b3671a070b7405b7150afaa8321..cd2b620945f5ac6a2fb4594e9394277296051018 100644
|
|
75
|
+
--- a/esm/vs/platform/actionWidget/browser/actionList.js
|
|
76
|
+
+++ b/esm/vs/platform/actionWidget/browser/actionList.js
|
|
77
|
+
@@ -254,7 +254,7 @@ let ActionList = class ActionList extends Disposable {
|
|
78
|
+
// For finding width dynamically (not using resize observer)
|
|
79
|
+
const itemWidths = this._allMenuItems.map((_, index) => {
|
|
80
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
81
|
+
- const element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index));
|
|
82
|
+
+ const element = this.domNode.getRootNode().getElementById(this._list.getElementID(index));
|
|
83
|
+
if (element) {
|
|
84
|
+
element.style.width = 'auto';
|
|
85
|
+
const width = element.getBoundingClientRect().width;
|