@theia/core 1.72.0-next.0 → 1.72.0-next.16

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.
Files changed (36) hide show
  1. package/README.md +3 -3
  2. package/lib/browser/catalog.json +27 -3
  3. package/lib/browser/frontend-application-module.d.ts +3 -0
  4. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  5. package/lib/browser/frontend-application-module.js +3 -1
  6. package/lib/browser/frontend-application-module.js.map +1 -1
  7. package/lib/browser/keybinding.d.ts +3 -1
  8. package/lib/browser/keybinding.d.ts.map +1 -1
  9. package/lib/browser/keybinding.js +5 -2
  10. package/lib/browser/keybinding.js.map +1 -1
  11. package/lib/browser/keybinding.spec.js +19 -0
  12. package/lib/browser/keybinding.spec.js.map +1 -1
  13. package/lib/browser/tree/tree-widget.d.ts.map +1 -1
  14. package/lib/browser/tree/tree-widget.js +1 -1
  15. package/lib/browser/tree/tree-widget.js.map +1 -1
  16. package/lib/browser/widgets/select-component.d.ts.map +1 -1
  17. package/lib/browser/widgets/select-component.js.map +1 -1
  18. package/lib/common/markdown-rendering/markdown-string.d.ts +1 -0
  19. package/lib/common/markdown-rendering/markdown-string.d.ts.map +1 -1
  20. package/lib/common/markdown-rendering/markdown-string.js +24 -2
  21. package/lib/common/markdown-rendering/markdown-string.js.map +1 -1
  22. package/lib/common/markdown-rendering/markdown-string.spec.d.ts +2 -0
  23. package/lib/common/markdown-rendering/markdown-string.spec.d.ts.map +1 -0
  24. package/lib/common/markdown-rendering/markdown-string.spec.js +47 -0
  25. package/lib/common/markdown-rendering/markdown-string.spec.js.map +1 -0
  26. package/package.json +15 -15
  27. package/src/browser/frontend-application-module.ts +3 -1
  28. package/src/browser/keybinding.spec.ts +24 -0
  29. package/src/browser/keybinding.ts +5 -2
  30. package/src/browser/style/index.css +31 -32
  31. package/src/browser/style/scrollbars.css +0 -2
  32. package/src/browser/style/select-component.css +6 -3
  33. package/src/browser/tree/tree-widget.tsx +2 -1
  34. package/src/browser/widgets/select-component.tsx +1 -1
  35. package/src/common/markdown-rendering/markdown-string.spec.ts +50 -0
  36. package/src/common/markdown-rendering/markdown-string.ts +24 -2
@@ -14,8 +14,36 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- @import url("~@lumino/widgets/style/index.css");
18
- @import url("~font-awesome/css/font-awesome.min.css");
17
+ /*-----------------------------------------------------------------------------
18
+ | Import children style files
19
+ |----------------------------------------------------------------------------*/
20
+
21
+ @import "./os.css";
22
+ @import "./dockpanel.css";
23
+ @import "./dialog.css";
24
+ @import "./menus.css";
25
+ @import "./sidepanel.css";
26
+ @import "./tabs.css";
27
+ @import "./scrollbars.css";
28
+ @import "./tree.css";
29
+ @import "./status-bar.css";
30
+ @import "./tree-decorators.css";
31
+ @import "./about.css";
32
+ @import "./search-box.css";
33
+ @import "./ansi.css";
34
+ @import "./view-container.css";
35
+ @import "./notification.css";
36
+ @import "./alert-messages.css";
37
+ @import "./icons.css";
38
+ @import "./widget.css";
39
+ @import "./quick-title-bar.css";
40
+ @import "./progress-bar.css";
41
+ @import "./breadcrumbs.css";
42
+ @import "./tooltip.css";
43
+ @import "./split-widget.css";
44
+ @import "./symbol-icon.css";
45
+ @import "./card.css";
46
+
19
47
 
20
48
  /*-----------------------------------------------------------------------------
21
49
  | General
@@ -160,6 +188,7 @@ blockquote {
160
188
  right: 0;
161
189
  bottom: 0;
162
190
  background: var(--theia-editor-background);
191
+ height: 100%;
163
192
  }
164
193
 
165
194
  .theia-preload {
@@ -324,33 +353,3 @@ button.secondary[disabled],
324
353
  .theia-cursor-no-drop:active {
325
354
  cursor: no-drop;
326
355
  }
327
-
328
- /*-----------------------------------------------------------------------------
329
- | Import children style files
330
- |----------------------------------------------------------------------------*/
331
-
332
- @import "./os.css";
333
- @import "./dockpanel.css";
334
- @import "./dialog.css";
335
- @import "./menus.css";
336
- @import "./sidepanel.css";
337
- @import "./tabs.css";
338
- @import "./scrollbars.css";
339
- @import "./tree.css";
340
- @import "./status-bar.css";
341
- @import "./tree-decorators.css";
342
- @import "./about.css";
343
- @import "./search-box.css";
344
- @import "./ansi.css";
345
- @import "./view-container.css";
346
- @import "./notification.css";
347
- @import "./alert-messages.css";
348
- @import "./icons.css";
349
- @import "./widget.css";
350
- @import "./quick-title-bar.css";
351
- @import "./progress-bar.css";
352
- @import "./breadcrumbs.css";
353
- @import "./tooltip.css";
354
- @import "./split-widget.css";
355
- @import "./symbol-icon.css";
356
- @import "./card.css";
@@ -14,8 +14,6 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- @import url("~perfect-scrollbar/css/perfect-scrollbar.css");
18
-
19
17
  ::-webkit-scrollbar {
20
18
  height: var(--theia-scrollbar-width);
21
19
  width: var(--theia-scrollbar-width);
@@ -15,9 +15,12 @@
15
15
  ********************************************************************************/
16
16
 
17
17
  .theia-select-component-container {
18
- /* required to set z-index */
19
- position: fixed;
20
- /* dialog overlay has a z-index of 5000 */
18
+ /* position is required for z-index to take effect; top/left at 0 anchors
19
+ the container so the absolutely-positioned dropdown resolves its
20
+ viewport-relative coordinates correctly. */
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
21
24
  z-index: 6000;
22
25
  }
23
26
 
@@ -671,7 +671,8 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
671
671
  aria-label={node.checkboxInfo.accessibilityInformation?.label}
672
672
  role={node.checkboxInfo.accessibilityInformation?.role}
673
673
  className='theia-input'
674
- onClick={event => this.toggleChecked(event)} />;
674
+ onClick={event => this.toggleChecked(event)}
675
+ onDoubleClick={event => event.stopPropagation()} />;
675
676
  }
676
677
 
677
678
  protected toggleChecked(event: React.MouseEvent<HTMLElement>): void {
@@ -149,7 +149,7 @@ export class SelectComponent extends React.Component<SelectComponentProps, Selec
149
149
  return optimal + 20; // Just to be safe, add another 20 pixels here
150
150
  }
151
151
 
152
- protected attachListeners(): void {
152
+ protected attachListeners(): void {
153
153
  const hide = (event: Event) => {
154
154
  if (!this.dropdownRef.current?.contains(event.target as Node)) {
155
155
  this.hide();
@@ -0,0 +1,50 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { expect } from 'chai';
18
+ import { MarkdownStringImpl } from './markdown-string';
19
+
20
+ describe('MarkdownStringImpl#appendCodeblock', () => {
21
+
22
+ it('uses a triple-backtick fence for code without backticks', () => {
23
+ const md = new MarkdownStringImpl();
24
+ md.appendCodeblock('json', '{ "type": "adaptive" }');
25
+ expect(md.value).to.equal('\n```json\n{ "type": "adaptive" }\n```\n');
26
+ });
27
+
28
+ it('uses a longer fence when the code contains a triple-backtick run', () => {
29
+ const md = new MarkdownStringImpl();
30
+ const code = 'before\n```json\n{ "x": 1 }\n```\nafter';
31
+ md.appendCodeblock('', code);
32
+ // The fence must be at least 4 backticks so the inner ``` cannot close it.
33
+ expect(md.value).to.equal('\n````\n' + code + '\n````\n');
34
+ });
35
+
36
+ it('grows the fence to be longer than the longest backtick run inside the code', () => {
37
+ const md = new MarkdownStringImpl();
38
+ const code = 'a ```` b ``` c';
39
+ md.appendCodeblock('', code);
40
+ // Longest run is 4, so fence must be 5.
41
+ expect(md.value).to.equal('\n`````\n' + code + '\n`````\n');
42
+ });
43
+
44
+ it('still uses a triple-backtick fence when only single/double backticks appear', () => {
45
+ const md = new MarkdownStringImpl();
46
+ const code = 'inline `code` and ``double`` only';
47
+ md.appendCodeblock('', code);
48
+ expect(md.value).to.equal('\n```\n' + code + '\n```\n');
49
+ });
50
+ });
@@ -90,14 +90,36 @@ export class MarkdownStringImpl implements MarkdownString {
90
90
  }
91
91
 
92
92
  appendCodeblock(langId: string, code: string): MarkdownStringImpl {
93
- this.value += '\n```';
93
+ // Use a fence longer than any run of backticks in the code so that triple-backtick
94
+ // sequences inside `code` cannot prematurely close the surrounding fenced block.
95
+ const fence = '`'.repeat(Math.max(3, MarkdownStringImpl.longestBacktickRun(code) + 1));
96
+ this.value += '\n';
97
+ this.value += fence;
94
98
  this.value += langId;
95
99
  this.value += '\n';
96
100
  this.value += code;
97
- this.value += '\n```\n';
101
+ this.value += '\n';
102
+ this.value += fence;
103
+ this.value += '\n';
98
104
  return this;
99
105
  }
100
106
 
107
+ private static longestBacktickRun(value: string): number {
108
+ let longest = 0;
109
+ let current = 0;
110
+ for (let i = 0; i < value.length; i++) {
111
+ if (value.charCodeAt(i) === 96 /* ` */) {
112
+ current++;
113
+ if (current > longest) {
114
+ longest = current;
115
+ }
116
+ } else {
117
+ current = 0;
118
+ }
119
+ }
120
+ return longest;
121
+ }
122
+
101
123
  appendLink(target: UriComponents | string, label: string, title?: string): MarkdownStringImpl {
102
124
  this.value += '[';
103
125
  this.value += this._escape(label, ']');