@theia/core 1.31.0-next.7 → 1.31.0
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/README.md +6 -6
- package/i18n/nls.cs.json +2 -1
- package/i18n/nls.de.json +2 -1
- package/i18n/nls.es.json +2 -1
- package/i18n/nls.fr.json +19 -18
- package/i18n/nls.hu.json +2 -1
- package/i18n/nls.it.json +2 -1
- package/i18n/nls.ja.json +2 -1
- package/i18n/nls.json +2 -1
- package/i18n/nls.pl.json +2 -1
- package/i18n/nls.pt-br.json +2 -1
- package/i18n/nls.pt-pt.json +2 -1
- package/i18n/nls.ru.json +2 -1
- package/i18n/nls.zh-cn.json +2 -1
- package/lib/browser/color-application-contribution.d.ts +4 -1
- package/lib/browser/color-application-contribution.d.ts.map +1 -1
- package/lib/browser/color-application-contribution.js +15 -7
- package/lib/browser/color-application-contribution.js.map +1 -1
- package/lib/browser/frontend-application.d.ts +0 -5
- package/lib/browser/frontend-application.d.ts.map +1 -1
- package/lib/browser/frontend-application.js +1 -24
- package/lib/browser/frontend-application.js.map +1 -1
- package/lib/browser/keybinding.d.ts +1 -0
- package/lib/browser/keybinding.d.ts.map +1 -1
- package/lib/browser/keybinding.js +27 -0
- package/lib/browser/keybinding.js.map +1 -1
- package/lib/browser/secondary-window-handler.d.ts +4 -0
- package/lib/browser/secondary-window-handler.d.ts.map +1 -1
- package/lib/browser/secondary-window-handler.js +22 -2
- package/lib/browser/secondary-window-handler.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +2 -1
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/common/menu/composite-menu-node.d.ts.map +1 -1
- package/lib/common/menu/composite-menu-node.js +3 -6
- package/lib/common/menu/composite-menu-node.js.map +1 -1
- package/lib/common/message-rpc/rpc-message-encoder.spec.js +1 -1
- package/package.json +6 -6
- package/src/browser/color-application-contribution.ts +19 -7
- package/src/browser/frontend-application.ts +3 -25
- package/src/browser/keybinding.ts +30 -0
- package/src/browser/secondary-window-handler.ts +20 -2
- package/src/browser/shell/application-shell.ts +2 -1
- package/src/common/menu/composite-menu-node.ts +3 -6
- package/src/common/message-rpc/rpc-message-encoder.spec.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composite-menu-node.d.ts","sourceRoot":"","sources":["../../../src/common/menu/composite-menu-node.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1H;;GAEG;AACH,qBAAa,iBAAkB,YAAW,QAAQ,EAAE,gBAAgB,EAAE,wBAAwB;aAQtE,EAAE,EAAE,MAAM;IACnB,KAAK,CAAC;IAEb,QAAQ,CAAC,MAAM,CAAC;IAVpB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAM;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC;gBAGlB,EAAE,EAAE,MAAM,EACnB,KAAK,CAAC,oBAAQ,EACrB,OAAO,CAAC,EAAE,cAAc,EACf,MAAM,CAAC,2CAA6B;IAUjD,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,CAEtC;IAED,IAAI,IAAI,IAAI,oBAAoB,CAAmG;IAEnI;;;;OAIG;IACI,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU;IAa1C;;;;OAIG;IACI,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"compos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BAAiB,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,gBAAgB;IAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAA/G,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAW,MAAM,EAAE,QAAQ,GAAG,gBAAgB,EAAqB,OAAO,CAAC,4BAAgB;IAE9J,IAAI,EAAE,IAAI,MAAM,CAA4B;IAE5C,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAA+B;IAE9D,IAAI,UAAU,IAAI,MAAM,CAAkC;IAE1D,IAAI,SAAS,IAAI,OAAO,CAAgC;IAExD,IAAI,IAAI,IAAI,oBAAoB,CAAoD;IAEpF,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAA2B;IAEzD,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAA8D;IAEjG,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAAsD;IAErF,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAAoD;IAElF,IAAI,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAkC;CAC5E"}
|
|
@@ -63,12 +63,9 @@ class CompositeMenuNode {
|
|
|
63
63
|
* @param id node id.
|
|
64
64
|
*/
|
|
65
65
|
removeNode(id) {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
if (idx >= 0) {
|
|
70
|
-
this._children.splice(idx, 1);
|
|
71
|
-
}
|
|
66
|
+
const idx = this._children.findIndex(n => n.id === id);
|
|
67
|
+
if (idx >= 0) {
|
|
68
|
+
this._children.splice(idx, 1);
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
get sortString() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composite-menu-node.js","sourceRoot":"","sources":["../../../src/common/menu/composite-menu-node.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEA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AAC;gBACzC,IAAI,GAAG,IAAI,CAAC,EAAE;oBACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;iBACjC;YACL,CAAC;SACJ,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,EAAU;QACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"composite-menu-node.js","sourceRoot":"","sources":["../../../src/common/menu/composite-menu-node.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,6CAA0H;AAE1H;;GAEG;AACH,MAAa,iBAAiB;IAO1B,YACoB,EAAU,EACnB,KAAc,EACrB,OAAwB,EACf,MAAoC;QAH7B,OAAE,GAAF,EAAE,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAS;QAEZ,WAAM,GAAN,MAAM,CAA8B;QAV9B,cAAS,GAAe,EAAE,CAAC;QAY1C,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YACzB,IAAI,CAAC,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;SAC9B;IACL,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI,aAA2B,OAAO,MAAA,IAAI,CAAC,KAAK,mCAAI,CAAC,IA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AC;IAEnK,IAAI,EAAE,KAAa,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5C,IAAI,KAAK,KAAyB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9D,IAAI,UAAU,KAAa,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1D,IAAI,SAAS,KAAc,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAExD,IAAI,IAAI,iBAA2B,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,mCAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpF,IAAI,IAAI,KAAyB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEzD,IAAI,SAAS,iBAAyB,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,mCAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAEjG,IAAI,KAAK,iBAAyB,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,mCAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAErF,IAAI,IAAI,iBAAyB,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,mCAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAElF,IAAI,QAAQ,KAA8B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC5E;AAtBD,4DAsBC"}
|
|
@@ -19,7 +19,7 @@ const chai_1 = require("chai");
|
|
|
19
19
|
const rpc_message_encoder_1 = require("./rpc-message-encoder");
|
|
20
20
|
const uint8_array_message_buffer_1 = require("./uint8-array-message-buffer");
|
|
21
21
|
describe('PPC Message Encoder & Decoder', () => {
|
|
22
|
-
describe('
|
|
22
|
+
describe('MsgPack Encoder & Decoder', () => {
|
|
23
23
|
it('should encode object into binary message and decode the message back into the original object', () => {
|
|
24
24
|
const buffer = new Uint8Array(1024);
|
|
25
25
|
const writer = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer(buffer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/core",
|
|
3
|
-
"version": "1.31.0
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@phosphor/signaling": "1",
|
|
17
17
|
"@phosphor/virtualdom": "1",
|
|
18
18
|
"@phosphor/widgets": "1",
|
|
19
|
-
"@theia/application-package": "1.31.0
|
|
20
|
-
"@theia/request": "1.31.0
|
|
19
|
+
"@theia/application-package": "1.31.0",
|
|
20
|
+
"@theia/request": "1.31.0",
|
|
21
21
|
"@types/body-parser": "^1.16.4",
|
|
22
22
|
"@types/cookie": "^0.3.3",
|
|
23
23
|
"@types/dompurify": "^2.2.2",
|
|
@@ -195,12 +195,12 @@
|
|
|
195
195
|
"watch": "theiaext watch"
|
|
196
196
|
},
|
|
197
197
|
"devDependencies": {
|
|
198
|
-
"@theia/ext-scripts": "1.
|
|
199
|
-
"@theia/re-exports": "1.
|
|
198
|
+
"@theia/ext-scripts": "1.31.0",
|
|
199
|
+
"@theia/re-exports": "1.31.0",
|
|
200
200
|
"minimist": "^1.2.0"
|
|
201
201
|
},
|
|
202
202
|
"nyc": {
|
|
203
203
|
"extends": "../../configs/nyc.json"
|
|
204
204
|
},
|
|
205
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "861dbb5999f27955d88d16c5073a031a29a78988"
|
|
206
206
|
}
|
|
@@ -33,6 +33,7 @@ export class ColorApplicationContribution implements FrontendApplicationContribu
|
|
|
33
33
|
|
|
34
34
|
protected readonly onDidChangeEmitter = new Emitter<void>();
|
|
35
35
|
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
36
|
+
private readonly windows: Set<Window> = new Set();
|
|
36
37
|
|
|
37
38
|
@inject(ColorRegistry)
|
|
38
39
|
protected readonly colors: ColorRegistry;
|
|
@@ -52,19 +53,31 @@ export class ColorApplicationContribution implements FrontendApplicationContribu
|
|
|
52
53
|
this.updateThemeBackground();
|
|
53
54
|
});
|
|
54
55
|
this.colors.onDidChange(() => this.update());
|
|
56
|
+
|
|
57
|
+
this.registerWindow(window);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
registerWindow(win: Window): Disposable {
|
|
61
|
+
this.windows.add(win);
|
|
62
|
+
this.updateWindow(win);
|
|
63
|
+
this.onDidChangeEmitter.fire();
|
|
64
|
+
return Disposable.create(() => this.windows.delete(win));
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
protected readonly toUpdate = new DisposableCollection();
|
|
58
68
|
protected update(): void {
|
|
59
|
-
if (!document) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
69
|
this.toUpdate.dispose();
|
|
70
|
+
this.windows.forEach(win => this.updateWindow(win));
|
|
71
|
+
this.onDidChangeEmitter.fire();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
protected updateWindow(win: Window): void {
|
|
63
75
|
const theme = 'theia-' + this.themeService.getCurrentTheme().type;
|
|
64
|
-
document.body.classList.add(theme);
|
|
65
|
-
this.toUpdate.push(Disposable.create(() => document.body.classList.remove(theme)));
|
|
66
76
|
|
|
67
|
-
|
|
77
|
+
win.document.body.classList.add(theme);
|
|
78
|
+
this.toUpdate.push(Disposable.create(() => win.document.body.classList.remove(theme)));
|
|
79
|
+
|
|
80
|
+
const documentElement = win.document.documentElement;
|
|
68
81
|
if (documentElement) {
|
|
69
82
|
for (const id of this.colors.getColors()) {
|
|
70
83
|
const variable = this.colors.getCurrentCssVariable(id);
|
|
@@ -75,7 +88,6 @@ export class ColorApplicationContribution implements FrontendApplicationContribu
|
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
|
-
this.onDidChangeEmitter.fire(undefined);
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
protected updateThemeBackground(): void {
|
|
@@ -205,41 +205,19 @@ export class FrontendApplication {
|
|
|
205
205
|
return startupElements.length === 0 ? undefined : startupElements[0] as HTMLElement;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
/* vvv HOTFIX begin vvv
|
|
209
|
-
*
|
|
210
|
-
* This is a hotfix against issues eclipse/theia#6459 and gitpod-io/gitpod#875 .
|
|
211
|
-
* It should be reverted after Theia was updated to the newer Monaco.
|
|
212
|
-
*/
|
|
213
|
-
protected inComposition = false;
|
|
214
|
-
/**
|
|
215
|
-
* Register composition related event listeners.
|
|
216
|
-
*/
|
|
217
|
-
protected registerCompositionEventListeners(): void {
|
|
218
|
-
window.document.addEventListener('compositionstart', event => {
|
|
219
|
-
this.inComposition = true;
|
|
220
|
-
});
|
|
221
|
-
window.document.addEventListener('compositionend', event => {
|
|
222
|
-
this.inComposition = false;
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
/* ^^^ HOTFIX end ^^^ */
|
|
226
|
-
|
|
227
208
|
/**
|
|
228
209
|
* Register global event listeners.
|
|
229
210
|
*/
|
|
230
211
|
protected registerEventListeners(): void {
|
|
231
|
-
this.registerCompositionEventListeners(); /* Hotfix. See above. */
|
|
232
212
|
this.windowsService.onUnload(() => {
|
|
233
213
|
this.stateService.state = 'closing_window';
|
|
234
214
|
this.layoutRestorer.storeLayout(this);
|
|
235
215
|
this.stopContributions();
|
|
236
216
|
});
|
|
237
217
|
window.addEventListener('resize', () => this.shell.update());
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
}, true);
|
|
218
|
+
|
|
219
|
+
this.keybindings.registerEventListeners(window);
|
|
220
|
+
|
|
243
221
|
document.addEventListener('touchmove', event => { event.preventDefault(); }, { passive: false });
|
|
244
222
|
// Prevent forward/back navigation by scrolling in OS X
|
|
245
223
|
if (isOSX) {
|
|
@@ -533,6 +533,36 @@ export class KeybindingRegistry {
|
|
|
533
533
|
return input;
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
+
registerEventListeners(win: Window): Disposable {
|
|
537
|
+
/* vvv HOTFIX begin vvv
|
|
538
|
+
*
|
|
539
|
+
* This is a hotfix against issues eclipse/theia#6459 and gitpod-io/gitpod#875 .
|
|
540
|
+
* It should be reverted after Theia was updated to the newer Monaco.
|
|
541
|
+
*/
|
|
542
|
+
let inComposition = false;
|
|
543
|
+
const compositionStart = () => {
|
|
544
|
+
inComposition = true;
|
|
545
|
+
};
|
|
546
|
+
win.document.addEventListener('compositionstart', compositionStart);
|
|
547
|
+
|
|
548
|
+
const compositionEnd = () => {
|
|
549
|
+
inComposition = false;
|
|
550
|
+
};
|
|
551
|
+
win.document.addEventListener('compositionend', compositionEnd);
|
|
552
|
+
|
|
553
|
+
const keydown = (event: KeyboardEvent) => {
|
|
554
|
+
if (inComposition !== true) {
|
|
555
|
+
this.run(event);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
win.document.addEventListener('keydown', keydown, true);
|
|
559
|
+
|
|
560
|
+
return Disposable.create(() => {
|
|
561
|
+
win.document.removeEventListener('compositionstart', compositionStart);
|
|
562
|
+
win.document.removeEventListener('compositionend', compositionEnd);
|
|
563
|
+
win.document.removeEventListener('keydown', keydown);
|
|
564
|
+
});
|
|
565
|
+
}
|
|
536
566
|
/**
|
|
537
567
|
* Run the command matching to the given keyboard event.
|
|
538
568
|
*/
|
|
@@ -21,6 +21,8 @@ import { MessageService } from '../common/message-service';
|
|
|
21
21
|
import { ApplicationShell } from './shell/application-shell';
|
|
22
22
|
import { Emitter } from '../common/event';
|
|
23
23
|
import { SecondaryWindowService } from './window/secondary-window-service';
|
|
24
|
+
import { KeybindingRegistry } from './keybinding';
|
|
25
|
+
import { ColorApplicationContribution } from './color-application-contribution';
|
|
24
26
|
|
|
25
27
|
/** Widget to be contained directly in a secondary window. */
|
|
26
28
|
class SecondaryWindowRootWidget extends Widget {
|
|
@@ -55,6 +57,12 @@ export class SecondaryWindowHandler {
|
|
|
55
57
|
|
|
56
58
|
protected applicationShell: ApplicationShell;
|
|
57
59
|
|
|
60
|
+
@inject(KeybindingRegistry)
|
|
61
|
+
protected keybindings: KeybindingRegistry;
|
|
62
|
+
|
|
63
|
+
@inject(ColorApplicationContribution)
|
|
64
|
+
protected colorAppContribution: ColorApplicationContribution;
|
|
65
|
+
|
|
58
66
|
protected readonly onDidAddWidgetEmitter = new Emitter<Widget>();
|
|
59
67
|
/** Subscribe to get notified when a widget is added to this handler, i.e. the widget was moved to an secondary window . */
|
|
60
68
|
readonly onDidAddWidget = this.onDidAddWidgetEmitter.event;
|
|
@@ -148,6 +156,7 @@ export class SecondaryWindowHandler {
|
|
|
148
156
|
|
|
149
157
|
const mainWindowTitle = document.title;
|
|
150
158
|
newWindow.onload = () => {
|
|
159
|
+
this.keybindings.registerEventListeners(newWindow);
|
|
151
160
|
// Use the widget's title as the window title
|
|
152
161
|
// Even if the widget's label were malicious, this should be safe against XSS because the HTML standard defines this is inserted via a text node.
|
|
153
162
|
// See https://html.spec.whatwg.org/multipage/dom.html#document.title
|
|
@@ -158,17 +167,21 @@ export class SecondaryWindowHandler {
|
|
|
158
167
|
console.error('Could not find dom element to attach to in secondary window');
|
|
159
168
|
return;
|
|
160
169
|
}
|
|
170
|
+
const unregisterWithColorContribution = this.colorAppContribution.registerWindow(newWindow);
|
|
161
171
|
|
|
162
172
|
widget.secondaryWindow = newWindow;
|
|
163
173
|
const rootWidget = new SecondaryWindowRootWidget();
|
|
174
|
+
rootWidget.addClass('secondary-widget-root');
|
|
164
175
|
Widget.attach(rootWidget, element);
|
|
165
176
|
rootWidget.addWidget(widget);
|
|
177
|
+
widget.show();
|
|
166
178
|
widget.update();
|
|
167
179
|
|
|
168
180
|
this.addWidget(widget);
|
|
169
181
|
|
|
170
182
|
// Close the window if the widget is disposed, e.g. by a command closing all widgets.
|
|
171
183
|
widget.disposed.connect(() => {
|
|
184
|
+
unregisterWithColorContribution.dispose();
|
|
172
185
|
this.removeWidget(widget);
|
|
173
186
|
if (!newWindow.closed) {
|
|
174
187
|
newWindow.close();
|
|
@@ -176,8 +189,13 @@ export class SecondaryWindowHandler {
|
|
|
176
189
|
});
|
|
177
190
|
|
|
178
191
|
// debounce to avoid rapid updates while resizing the secondary window
|
|
179
|
-
const updateWidget = debounce(
|
|
180
|
-
|
|
192
|
+
const updateWidget = debounce(() => {
|
|
193
|
+
rootWidget.update();
|
|
194
|
+
}, 100);
|
|
195
|
+
newWindow.addEventListener('resize', () => {
|
|
196
|
+
updateWidget();
|
|
197
|
+
});
|
|
198
|
+
widget.activate();
|
|
181
199
|
};
|
|
182
200
|
}
|
|
183
201
|
|
|
@@ -1240,7 +1240,8 @@ export class ApplicationShell extends Widget {
|
|
|
1240
1240
|
|
|
1241
1241
|
let start = 0;
|
|
1242
1242
|
const step: FrameRequestCallback = timestamp => {
|
|
1243
|
-
|
|
1243
|
+
const activeElement = widget.node.ownerDocument.activeElement;
|
|
1244
|
+
if (activeElement && widget.node.contains(activeElement)) {
|
|
1244
1245
|
return;
|
|
1245
1246
|
}
|
|
1246
1247
|
if (!start) {
|
|
@@ -75,12 +75,9 @@ export class CompositeMenuNode implements MenuNode, CompoundMenuNode, CompoundMe
|
|
|
75
75
|
* @param id node id.
|
|
76
76
|
*/
|
|
77
77
|
public removeNode(id: string): void {
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
if (idx >= 0) {
|
|
82
|
-
this._children.splice(idx, 1);
|
|
83
|
-
}
|
|
78
|
+
const idx = this._children.findIndex(n => n.id === id);
|
|
79
|
+
if (idx >= 0) {
|
|
80
|
+
this._children.splice(idx, 1);
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import { Uint8ArrayReadBuffer, Uint8ArrayWriteBuffer } from './uint8-array-message-buffer';
|
|
22
22
|
|
|
23
23
|
describe('PPC Message Encoder & Decoder', () => {
|
|
24
|
-
describe('
|
|
24
|
+
describe('MsgPack Encoder & Decoder', () => {
|
|
25
25
|
it('should encode object into binary message and decode the message back into the original object', () => {
|
|
26
26
|
const buffer = new Uint8Array(1024);
|
|
27
27
|
const writer = new Uint8ArrayWriteBuffer(buffer);
|