@theia/core 1.59.0-next.72 → 1.60.0-next.43
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 +16 -16
- package/i18n/nls.cs.json +344 -23
- package/i18n/nls.de.json +344 -23
- package/i18n/nls.es.json +344 -23
- package/i18n/nls.fr.json +344 -23
- package/i18n/nls.hu.json +344 -23
- package/i18n/nls.it.json +344 -23
- package/i18n/nls.ja.json +344 -23
- package/i18n/nls.json +344 -23
- package/i18n/nls.ko.json +344 -23
- package/i18n/nls.pl.json +344 -23
- package/i18n/nls.pt-br.json +344 -23
- package/i18n/nls.ru.json +344 -23
- package/i18n/nls.tr.json +344 -23
- package/i18n/nls.zh-cn.json +344 -23
- package/i18n/nls.zh-tw.json +344 -23
- package/lib/browser/about-dialog.d.ts.map +1 -1
- package/lib/browser/about-dialog.js +3 -2
- package/lib/browser/about-dialog.js.map +1 -1
- package/lib/browser/browser.d.ts +2 -0
- package/lib/browser/browser.d.ts.map +1 -1
- package/lib/browser/browser.js +6 -1
- package/lib/browser/browser.js.map +1 -1
- package/lib/browser/catalog.json +207 -14
- package/lib/browser/common-frontend-contribution.d.ts +2 -0
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +56 -22
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/common-styling-participants.js +25 -25
- package/lib/browser/context-menu-renderer.d.ts +3 -3
- package/lib/browser/context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/core-preferences.js +5 -5
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/menu/browser-context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/menu/browser-context-menu-renderer.js +1 -2
- package/lib/browser/menu/browser-context-menu-renderer.js.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.d.ts +5 -5
- package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.js +23 -13
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/preferences/injectable-preference-proxy.d.ts +1 -1
- package/lib/browser/preferences/injectable-preference-proxy.d.ts.map +1 -1
- package/lib/browser/preferences/preference-contribution.d.ts +1 -1
- package/lib/browser/preferences/preference-contribution.d.ts.map +1 -1
- package/lib/browser/preferences/preference-provider.d.ts +1 -1
- package/lib/browser/preferences/preference-provider.d.ts.map +1 -1
- package/lib/browser/preferences/preference-provider.js +1 -1
- package/lib/browser/preferences/preference-provider.js.map +1 -1
- package/lib/browser/preferences/preference-service.d.ts +1 -1
- package/lib/browser/preferences/preference-service.d.ts.map +1 -1
- package/lib/browser/preferences/preference-service.js +3 -3
- package/lib/browser/preferences/preference-service.js.map +1 -1
- package/lib/browser/preferences/preference-validation-service.d.ts +1 -1
- package/lib/browser/preferences/preference-validation-service.d.ts.map +1 -1
- package/lib/browser/preload/i18n-preload-contribution.d.ts +4 -0
- package/lib/browser/preload/i18n-preload-contribution.d.ts.map +1 -1
- package/lib/browser/preload/i18n-preload-contribution.js +23 -1
- package/lib/browser/preload/i18n-preload-contribution.js.map +1 -1
- package/lib/browser/preload/preload-module.d.ts.map +1 -1
- package/lib/browser/preload/preload-module.js +5 -3
- package/lib/browser/preload/preload-module.js.map +1 -1
- package/lib/browser/preload/text-replacement-contribution.d.ts +37 -0
- package/lib/browser/preload/text-replacement-contribution.d.ts.map +1 -0
- package/lib/browser/preload/text-replacement-contribution.js +20 -0
- package/lib/browser/preload/text-replacement-contribution.js.map +1 -0
- package/lib/browser/saveable.d.ts +11 -3
- package/lib/browser/saveable.d.ts.map +1 -1
- package/lib/browser/saveable.js +2 -1
- package/lib/browser/saveable.js.map +1 -1
- package/lib/browser/shell/application-shell-mouse-tracker.d.ts +1 -1
- package/lib/browser/shell/application-shell-mouse-tracker.d.ts.map +1 -1
- package/lib/browser/shell/application-shell-mouse-tracker.js +3 -3
- package/lib/browser/shell/application-shell-mouse-tracker.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts +10 -7
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +24 -21
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-handler.d.ts +2 -2
- package/lib/browser/shell/side-panel-handler.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-handler.js +13 -12
- package/lib/browser/shell/side-panel-handler.js.map +1 -1
- package/lib/browser/shell/side-panel-toolbar.d.ts +2 -2
- package/lib/browser/shell/side-panel-toolbar.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-toolbar.js +1 -1
- package/lib/browser/shell/side-panel-toolbar.js.map +1 -1
- package/lib/browser/shell/sidebar-bottom-menu-widget.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-bottom-menu-widget.js +2 -1
- package/lib/browser/shell/sidebar-bottom-menu-widget.js.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js +1 -0
- package/lib/browser/shell/sidebar-menu-widget.js.map +1 -1
- package/lib/browser/shell/split-panels.d.ts +1 -1
- package/lib/browser/shell/split-panels.d.ts.map +1 -1
- package/lib/browser/shell/split-panels.js +1 -1
- package/lib/browser/shell/split-panels.js.map +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.d.ts +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js +3 -3
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +18 -12
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +80 -51
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/shell/tab-bars.spec.js +1 -1
- package/lib/browser/shell/tab-bars.spec.js.map +1 -1
- package/lib/browser/shell/theia-dock-panel.d.ts +2 -2
- package/lib/browser/shell/theia-dock-panel.d.ts.map +1 -1
- package/lib/browser/shell/theia-dock-panel.js +3 -3
- package/lib/browser/shell/theia-dock-panel.js.map +1 -1
- package/lib/browser/shell/view-column-service.d.ts +1 -1
- package/lib/browser/shell/view-column-service.d.ts.map +1 -1
- package/lib/browser/shell/view-column-service.js +1 -1
- package/lib/browser/shell/view-column-service.js.map +1 -1
- package/lib/browser/shell/view-contribution.d.ts +1 -1
- package/lib/browser/shell/view-contribution.d.ts.map +1 -1
- package/lib/browser/source-tree/source-tree.d.ts.map +1 -1
- package/lib/browser/source-tree/source-tree.js +3 -2
- package/lib/browser/source-tree/source-tree.js.map +1 -1
- package/lib/browser/source-tree/tree-source.d.ts +1 -0
- package/lib/browser/source-tree/tree-source.d.ts.map +1 -1
- package/lib/browser/source-tree/tree-source.js.map +1 -1
- package/lib/browser/tree/tree-widget.d.ts +1 -1
- package/lib/browser/tree/tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +2 -1
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser/view-container.d.ts +6 -7
- package/lib/browser/view-container.d.ts.map +1 -1
- package/lib/browser/view-container.js +31 -27
- package/lib/browser/view-container.js.map +1 -1
- package/lib/browser/widget-manager.d.ts +1 -1
- package/lib/browser/widget-manager.d.ts.map +1 -1
- package/lib/browser/widget-manager.js +1 -1
- package/lib/browser/widget-manager.js.map +1 -1
- package/lib/browser/widget-manager.spec.js +1 -1
- package/lib/browser/widget-manager.spec.js.map +1 -1
- package/lib/browser/widgets/react-widget.d.ts +1 -1
- package/lib/browser/widgets/react-widget.d.ts.map +1 -1
- package/lib/browser/widgets/react-widget.js +1 -1
- package/lib/browser/widgets/react-widget.js.map +1 -1
- package/lib/browser/widgets/widget.d.ts +6 -6
- package/lib/browser/widgets/widget.d.ts.map +1 -1
- package/lib/browser/widgets/widget.js +10 -8
- package/lib/browser/widgets/widget.js.map +1 -1
- package/lib/common/i18n/localization.d.ts +2 -3
- package/lib/common/i18n/localization.d.ts.map +1 -1
- package/lib/common/i18n/localization.js +10 -3
- package/lib/common/i18n/localization.js.map +1 -1
- package/lib/common/json-schema.d.ts +1 -1
- package/lib/common/json-schema.d.ts.map +1 -1
- package/lib/common/preferences/preference-schema.d.ts +4 -1
- package/lib/common/preferences/preference-schema.d.ts.map +1 -1
- package/lib/common/preferences/preference-schema.js.map +1 -1
- package/lib/common/theme.d.ts +2 -0
- package/lib/common/theme.d.ts.map +1 -1
- package/lib/common/theme.js +5 -1
- package/lib/common/theme.js.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.js +3 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +6 -4
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/preload.d.ts.map +1 -1
- package/lib/electron-browser/preload.js +3 -0
- package/lib/electron-browser/preload.js.map +1 -1
- package/lib/electron-common/electron-api.d.ts +3 -0
- package/lib/electron-common/electron-api.d.ts.map +1 -1
- package/lib/electron-common/electron-api.js +2 -1
- package/lib/electron-common/electron-api.js.map +1 -1
- package/lib/electron-main/electron-api-main.d.ts.map +1 -1
- package/lib/electron-main/electron-api-main.js +1 -0
- package/lib/electron-main/electron-api-main.js.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts +2 -0
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +3 -0
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/node/messaging/websocket-frontend-connection-service.js +1 -1
- package/package.json +26 -26
- package/shared/@lumino/algorithm/index.d.ts +1 -0
- package/shared/@lumino/algorithm/index.js +1 -0
- package/shared/@lumino/commands/index.d.ts +1 -0
- package/shared/@lumino/commands/index.js +1 -0
- package/shared/@lumino/coreutils/index.d.ts +1 -0
- package/shared/@lumino/coreutils/index.js +1 -0
- package/shared/@lumino/domutils/index.d.ts +1 -0
- package/shared/@lumino/domutils/index.js +1 -0
- package/shared/@lumino/dragdrop/index.d.ts +1 -0
- package/shared/@lumino/dragdrop/index.js +1 -0
- package/shared/@lumino/messaging/index.d.ts +1 -0
- package/shared/@lumino/messaging/index.js +1 -0
- package/shared/@lumino/properties/index.d.ts +1 -0
- package/shared/@lumino/properties/index.js +1 -0
- package/shared/@lumino/signaling/index.d.ts +1 -0
- package/shared/@lumino/signaling/index.js +1 -0
- package/shared/@lumino/virtualdom/index.d.ts +1 -0
- package/shared/@lumino/virtualdom/index.js +1 -0
- package/shared/@lumino/widgets/index.d.ts +1 -0
- package/shared/@lumino/widgets/index.js +1 -0
- package/src/browser/about-dialog.tsx +3 -2
- package/src/browser/browser.ts +6 -1
- package/src/browser/common-frontend-contribution.ts +54 -22
- package/src/browser/common-styling-participants.ts +25 -25
- package/src/browser/context-menu-renderer.ts +3 -3
- package/src/browser/core-preferences.ts +5 -5
- package/src/browser/menu/browser-context-menu-renderer.ts +1 -2
- package/src/browser/menu/browser-menu-plugin.ts +24 -14
- package/src/browser/preferences/injectable-preference-proxy.ts +1 -1
- package/src/browser/preferences/preference-contribution.ts +1 -1
- package/src/browser/preferences/preference-provider.ts +1 -1
- package/src/browser/preferences/preference-service.ts +1 -1
- package/src/browser/preferences/preference-validation-service.spec.ts +1 -1
- package/src/browser/preferences/preference-validation-service.ts +1 -1
- package/src/browser/preload/i18n-preload-contribution.ts +22 -2
- package/src/browser/preload/preload-module.ts +5 -3
- package/src/browser/preload/text-replacement-contribution.ts +53 -0
- package/src/browser/saveable.ts +13 -3
- package/src/browser/shell/application-shell-mouse-tracker.ts +3 -3
- package/src/browser/shell/application-shell.ts +36 -32
- package/src/browser/shell/shell-layout-restorer.ts +1 -1
- package/src/browser/shell/side-panel-handler.ts +13 -12
- package/src/browser/shell/side-panel-toolbar.ts +2 -2
- package/src/browser/shell/sidebar-bottom-menu-widget.tsx +2 -1
- package/src/browser/shell/sidebar-menu-widget.tsx +1 -0
- package/src/browser/shell/split-panels.ts +1 -1
- package/src/browser/shell/tab-bar-decorator.ts +1 -1
- package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx +3 -3
- package/src/browser/shell/tab-bars.spec.ts +1 -1
- package/src/browser/shell/tab-bars.ts +93 -57
- package/src/browser/shell/theia-dock-panel.ts +3 -3
- package/src/browser/shell/view-column-service.ts +2 -2
- package/src/browser/shell/view-contribution.ts +1 -1
- package/src/browser/source-tree/source-tree.ts +3 -2
- package/src/browser/source-tree/tree-source.ts +1 -0
- package/src/browser/style/dialog.css +12 -12
- package/src/browser/style/dockpanel.css +19 -19
- package/src/browser/style/hover-service.css +1 -0
- package/src/browser/style/index.css +3 -3
- package/src/browser/style/menus.css +34 -31
- package/src/browser/style/sidepanel.css +52 -48
- package/src/browser/style/split-widget.css +5 -5
- package/src/browser/style/tabs.css +91 -97
- package/src/browser/style/view-container.css +14 -14
- package/src/browser/tree/tree-widget.tsx +3 -2
- package/src/browser/view-container.ts +40 -36
- package/src/browser/widget-manager.spec.ts +1 -1
- package/src/browser/widget-manager.ts +1 -1
- package/src/browser/widgets/react-widget.tsx +1 -1
- package/src/browser/widgets/widget.ts +11 -9
- package/src/common/i18n/localization.ts +10 -4
- package/src/common/i18n/nls.metadata.json +34921 -32708
- package/src/common/json-schema.ts +1 -1
- package/src/common/preferences/preference-schema.ts +4 -1
- package/src/common/theme.ts +6 -0
- package/src/electron-browser/menu/electron-context-menu-renderer.ts +3 -1
- package/src/electron-browser/menu/electron-menu-contribution.ts +6 -5
- package/src/electron-browser/preload.ts +6 -3
- package/src/electron-common/electron-api.ts +3 -0
- package/src/electron-main/electron-api-main.ts +4 -1
- package/src/electron-main/electron-main-application.ts +5 -0
- package/src/node/messaging/websocket-frontend-connection-service.ts +1 -2
- package/shared/@phosphor/algorithm/index.d.ts +0 -1
- package/shared/@phosphor/algorithm/index.js +0 -1
- package/shared/@phosphor/commands/index.d.ts +0 -1
- package/shared/@phosphor/commands/index.js +0 -1
- package/shared/@phosphor/coreutils/index.d.ts +0 -1
- package/shared/@phosphor/coreutils/index.js +0 -1
- package/shared/@phosphor/domutils/index.d.ts +0 -1
- package/shared/@phosphor/domutils/index.js +0 -1
- package/shared/@phosphor/dragdrop/index.d.ts +0 -1
- package/shared/@phosphor/dragdrop/index.js +0 -1
- package/shared/@phosphor/messaging/index.d.ts +0 -1
- package/shared/@phosphor/messaging/index.js +0 -1
- package/shared/@phosphor/properties/index.d.ts +0 -1
- package/shared/@phosphor/properties/index.js +0 -1
- package/shared/@phosphor/signaling/index.d.ts +0 -1
- package/shared/@phosphor/signaling/index.js +0 -1
- package/shared/@phosphor/virtualdom/index.d.ts +0 -1
- package/shared/@phosphor/virtualdom/index.js +0 -1
- package/shared/@phosphor/widgets/index.d.ts +0 -1
- package/shared/@phosphor/widgets/index.js +0 -1
|
@@ -138,14 +138,14 @@ export class MenuStylingParticipant implements StylingParticipant {
|
|
|
138
138
|
if (isHighContrast(theme.type) && focusBorder) {
|
|
139
139
|
// Menu items
|
|
140
140
|
collector.addRule(`
|
|
141
|
-
.
|
|
141
|
+
.lm-Menu .lm-Menu-item.lm-mod-active {
|
|
142
142
|
outline: 1px solid ${focusBorder};
|
|
143
143
|
outline-offset: -1px;
|
|
144
144
|
}
|
|
145
|
-
.
|
|
145
|
+
.lm-MenuBar .lm-MenuBar-item.lm-mod-active {
|
|
146
146
|
outline: 1px dashed ${focusBorder};
|
|
147
147
|
}
|
|
148
|
-
.
|
|
148
|
+
.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {
|
|
149
149
|
outline: 1px solid ${focusBorder};
|
|
150
150
|
}
|
|
151
151
|
`);
|
|
@@ -166,7 +166,7 @@ export class BadgeStylingParticipant implements StylingParticipant {
|
|
|
166
166
|
const contrastBorder = theme.getColor('contrastBorder');
|
|
167
167
|
|
|
168
168
|
if (isHighContrast(theme.type) && contrastBorder) {
|
|
169
|
-
collector.addRule(`.
|
|
169
|
+
collector.addRule(`.lm-TabBar .theia-badge-decorator-sidebar {
|
|
170
170
|
outline: 1px solid ${contrastBorder};
|
|
171
171
|
}`);
|
|
172
172
|
}
|
|
@@ -182,20 +182,20 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
182
182
|
|
|
183
183
|
if (highContrast && focusBorder) {
|
|
184
184
|
collector.addRule(`
|
|
185
|
-
#theia-bottom-content-panel .
|
|
186
|
-
#theia-main-content-panel .
|
|
185
|
+
#theia-bottom-content-panel .lm-TabBar .lm-TabBar-tab,
|
|
186
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab {
|
|
187
187
|
outline-offset: -4px;
|
|
188
188
|
}
|
|
189
|
-
#theia-bottom-content-panel .
|
|
190
|
-
#theia-main-content-panel .
|
|
189
|
+
#theia-bottom-content-panel .lm-TabBar .lm-TabBar-tab.lm-mod-current,
|
|
190
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab.lm-mod-current {
|
|
191
191
|
outline: 1px solid ${focusBorder};
|
|
192
192
|
}
|
|
193
|
-
#theia-bottom-content-panel .
|
|
194
|
-
#theia-main-content-panel .
|
|
193
|
+
#theia-bottom-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab.lm-mod-current,
|
|
194
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab.lm-mod-current {
|
|
195
195
|
outline: 1px dotted ${focusBorder};
|
|
196
196
|
}
|
|
197
|
-
#theia-bottom-content-panel .
|
|
198
|
-
#theia-main-content-panel .
|
|
197
|
+
#theia-bottom-content-panel .lm-TabBar .lm-TabBar-tab:not(.lm-mod-current):hover,
|
|
198
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab:not(.lm-mod-current):hover {
|
|
199
199
|
outline: 1px dashed ${focusBorder};
|
|
200
200
|
}
|
|
201
201
|
`);
|
|
@@ -206,13 +206,13 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
206
206
|
const tabActiveBorder = theme.getColor('tab.activeBorder') || (highContrast && contrastBorder) || 'transparent';
|
|
207
207
|
const tabUnfocusedActiveBorder = theme.getColor('tab.unfocusedActiveBorder') || (highContrast && contrastBorder) || 'transparent';
|
|
208
208
|
collector.addRule(`
|
|
209
|
-
#theia-main-content-panel .
|
|
209
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab.lm-mod-current {
|
|
210
210
|
color: var(--theia-tab-activeForeground);
|
|
211
211
|
${tabActiveBackground ? `background: ${tabActiveBackground};` : ''}
|
|
212
212
|
${tabActiveBorderTop ? `border-top: 1px solid ${tabActiveBorderTop};` : ''}
|
|
213
213
|
border-bottom: 1px solid ${tabActiveBorder};
|
|
214
214
|
}
|
|
215
|
-
#theia-main-content-panel .
|
|
215
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab.lm-mod-current {
|
|
216
216
|
background: var(--theia-tab-unfocusedActiveBackground);
|
|
217
217
|
color: var(--theia-tab-unfocusedActiveForeground);
|
|
218
218
|
${tabUnfocusedActiveBorderTop ? `border-top: 1px solid ${tabUnfocusedActiveBorderTop};` : ''}
|
|
@@ -227,18 +227,18 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
227
227
|
if (tabActiveModifiedBorder || tabInactiveModifiedBorder) {
|
|
228
228
|
collector.addRule(`
|
|
229
229
|
body.theia-editor-highlightModifiedTabs
|
|
230
|
-
#theia-main-content-panel .
|
|
230
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab.theia-mod-dirty {
|
|
231
231
|
border-top: 2px solid ${tabInactiveModifiedBorder};
|
|
232
232
|
padding-bottom: 1px;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
body.theia-editor-highlightModifiedTabs
|
|
236
|
-
#theia-main-content-panel .
|
|
236
|
+
#theia-main-content-panel .lm-TabBar.theia-tabBar-active .lm-TabBar-tab.theia-mod-dirty.lm-mod-current {
|
|
237
237
|
border-top: 2px solid ${tabActiveModifiedBorder};
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
body.theia-editor-highlightModifiedTabs
|
|
241
|
-
#theia-main-content-panel .
|
|
241
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab.theia-mod-dirty:not(.lm-mod-current) {
|
|
242
242
|
border-top: 2px solid ${tabUnfocusedInactiveModifiedBorder};
|
|
243
243
|
}
|
|
244
244
|
`);
|
|
@@ -247,12 +247,12 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
247
247
|
// Activity Bar Active Border
|
|
248
248
|
const activityBarActiveBorder = theme.getColor('activityBar.activeBorder') || 'var(--theia-activityBar-foreground)';
|
|
249
249
|
collector.addRule(`
|
|
250
|
-
.
|
|
250
|
+
.lm-TabBar.theia-app-left .lm-TabBar-tab.lm-mod-current {
|
|
251
251
|
border-top-color: transparent;
|
|
252
252
|
box-shadow: 2px 0 0 ${activityBarActiveBorder} inset;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
.
|
|
255
|
+
.lm-TabBar.theia-app-right .lm-TabBar-tab.lm-mod-current {
|
|
256
256
|
border-top-color: transparent;
|
|
257
257
|
box-shadow: -2px 0 0 ${activityBarActiveBorder} inset;
|
|
258
258
|
}
|
|
@@ -261,7 +261,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
261
261
|
const tabHoverBackground = theme.getColor('tab.hoverBackground');
|
|
262
262
|
if (tabHoverBackground) {
|
|
263
263
|
collector.addRule(`
|
|
264
|
-
#theia-main-content-panel .
|
|
264
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab:hover {
|
|
265
265
|
background-color: ${tabHoverBackground};
|
|
266
266
|
}
|
|
267
267
|
`);
|
|
@@ -270,7 +270,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
270
270
|
const tabUnfocusedHoverBackground = theme.getColor('tab.unfocusedHoverBackground');
|
|
271
271
|
if (tabUnfocusedHoverBackground) {
|
|
272
272
|
collector.addRule(`
|
|
273
|
-
#theia-main-content-panel .
|
|
273
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab:hover {
|
|
274
274
|
background-color: ${tabUnfocusedHoverBackground};
|
|
275
275
|
}
|
|
276
276
|
`);
|
|
@@ -280,7 +280,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
280
280
|
const tabHoverForeground = theme.getColor('tab.hoverForeground');
|
|
281
281
|
if (tabHoverForeground) {
|
|
282
282
|
collector.addRule(`
|
|
283
|
-
#theia-main-content-panel .
|
|
283
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab:hover {
|
|
284
284
|
color: ${tabHoverForeground};
|
|
285
285
|
}
|
|
286
286
|
`);
|
|
@@ -289,7 +289,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
289
289
|
const tabUnfocusedHoverForeground = theme.getColor('tab.unfocusedHoverForeground');
|
|
290
290
|
if (tabUnfocusedHoverForeground) {
|
|
291
291
|
collector.addRule(`
|
|
292
|
-
#theia-main-content-panel .
|
|
292
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab:hover {
|
|
293
293
|
color: ${tabUnfocusedHoverForeground};
|
|
294
294
|
}
|
|
295
295
|
`);
|
|
@@ -299,7 +299,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
299
299
|
const tabHoverBorder = theme.getColor('tab.hoverBorder');
|
|
300
300
|
if (tabHoverBorder) {
|
|
301
301
|
collector.addRule(`
|
|
302
|
-
#theia-main-content-panel .
|
|
302
|
+
#theia-main-content-panel .lm-TabBar .lm-TabBar-tab:hover {
|
|
303
303
|
box-shadow: 0 1px 0 ${tabHoverBorder} inset;
|
|
304
304
|
}
|
|
305
305
|
`);
|
|
@@ -308,7 +308,7 @@ export class TabbarStylingParticipant implements StylingParticipant {
|
|
|
308
308
|
const tabUnfocusedHoverBorder = theme.getColor('tab.unfocusedHoverBorder');
|
|
309
309
|
if (tabUnfocusedHoverBorder) {
|
|
310
310
|
collector.addRule(`
|
|
311
|
-
#theia-main-content-panel .
|
|
311
|
+
#theia-main-content-panel .lm-TabBar:not(.theia-tabBar-active) .lm-TabBar-tab:hover {
|
|
312
312
|
box-shadow: 0 1px 0 ${tabUnfocusedHoverBorder} inset;
|
|
313
313
|
}
|
|
314
314
|
`);
|
|
@@ -110,10 +110,10 @@ export interface RenderContextMenuOptions {
|
|
|
110
110
|
*/
|
|
111
111
|
includeAnchorArg?: boolean;
|
|
112
112
|
/**
|
|
113
|
-
* A DOM context
|
|
114
|
-
*
|
|
113
|
+
* A DOM context for the menu to be shown
|
|
114
|
+
* Will be used to attach the menu to a window and to evaluate enablement ("when"-clauses)
|
|
115
115
|
*/
|
|
116
|
-
context
|
|
116
|
+
context: HTMLElement;
|
|
117
117
|
contextKeyService?: ContextMatcher;
|
|
118
118
|
onHide?: () => void;
|
|
119
119
|
/**
|
|
@@ -140,18 +140,18 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
140
140
|
'http.proxy': {
|
|
141
141
|
type: 'string',
|
|
142
142
|
pattern: '^https?://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$',
|
|
143
|
-
markdownDescription: nls.localizeByDefault('The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables.'),
|
|
143
|
+
markdownDescription: nls.localizeByDefault('The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.'),
|
|
144
144
|
scope: 'application'
|
|
145
145
|
},
|
|
146
146
|
'http.proxyStrictSSL': {
|
|
147
147
|
type: 'boolean',
|
|
148
148
|
default: true,
|
|
149
|
-
description: nls.localizeByDefault('Controls whether the proxy server certificate should be verified against the list of supplied CAs.'),
|
|
149
|
+
description: nls.localizeByDefault('Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.'),
|
|
150
150
|
scope: 'application'
|
|
151
151
|
},
|
|
152
152
|
'http.proxyAuthorization': {
|
|
153
153
|
type: 'string',
|
|
154
|
-
markdownDescription: nls.localizeByDefault('The value to send as the `Proxy-Authorization` header for every network request.'),
|
|
154
|
+
markdownDescription: nls.localizeByDefault('The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.'),
|
|
155
155
|
scope: 'application'
|
|
156
156
|
},
|
|
157
157
|
'http.proxySupport': {
|
|
@@ -164,13 +164,13 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
164
164
|
nls.localizeByDefault('Enable proxy support for extensions, override request options.'),
|
|
165
165
|
],
|
|
166
166
|
default: 'override',
|
|
167
|
-
description: nls.localizeByDefault('Use the proxy support for extensions.'),
|
|
167
|
+
description: nls.localizeByDefault('Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.'),
|
|
168
168
|
scope: 'application'
|
|
169
169
|
},
|
|
170
170
|
'http.systemCertificates': {
|
|
171
171
|
type: 'boolean',
|
|
172
172
|
default: true,
|
|
173
|
-
description: nls.localizeByDefault('Controls whether CA certificates should be loaded from the OS.
|
|
173
|
+
description: nls.localizeByDefault('Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.'),
|
|
174
174
|
scope: 'application'
|
|
175
175
|
},
|
|
176
176
|
'workbench.list.openMode': {
|
|
@@ -40,8 +40,7 @@ export class BrowserContextMenuRenderer extends ContextMenuRenderer {
|
|
|
40
40
|
if (onHide) {
|
|
41
41
|
contextMenu.aboutToClose.connect(() => onHide!());
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
contextMenu.open(x, y, undefined, context);
|
|
43
|
+
contextMenu.open(x, y, { host: context?.ownerDocument.body});
|
|
45
44
|
return new BrowserContextMenuAccess(contextMenu);
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject } from 'inversify';
|
|
18
|
-
import { Menu, MenuBar, Menu as MenuWidget, Widget } from '@
|
|
19
|
-
import { CommandRegistry as
|
|
20
|
-
import { ElementExt } from '@phosphor/domutils';
|
|
18
|
+
import { Menu, MenuBar, Menu as MenuWidget, Widget } from '@lumino/widgets';
|
|
19
|
+
import { CommandRegistry as LuminoCommandRegistry } from '@lumino/commands';
|
|
21
20
|
import {
|
|
22
21
|
CommandRegistry, environment, DisposableCollection, Disposable,
|
|
23
22
|
MenuModelRegistry, MAIN_MENU_BAR, MenuPath, MenuNode, MenuCommandExecutor, CompoundMenuNode, CompoundMenuNodeRole, CommandMenuNode,
|
|
@@ -32,6 +31,7 @@ import { Message, waitForRevealed } from '../widgets';
|
|
|
32
31
|
import { ApplicationShell } from '../shell';
|
|
33
32
|
import { CorePreferences } from '../core-preferences';
|
|
34
33
|
import { PreferenceService } from '../preferences/preference-service';
|
|
34
|
+
import { ElementExt } from '@lumino/domutils';
|
|
35
35
|
|
|
36
36
|
export abstract class MenuBarWidget extends MenuBar {
|
|
37
37
|
abstract activateMenu(label: string, ...labels: string[]): Promise<MenuWidget>;
|
|
@@ -161,7 +161,7 @@ export class BrowserMainMenuFactory implements MenuWidgetFactory {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export function isMenuElement(element: HTMLElement | null): boolean {
|
|
164
|
-
return !!element && element.className.includes('
|
|
164
|
+
return !!element && element.className.includes('lm-Menu');
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export class DynamicMenuBarWidget extends MenuBarWidget {
|
|
@@ -181,7 +181,8 @@ export class DynamicMenuBarWidget extends MenuBarWidget {
|
|
|
181
181
|
// We want to save the focus object for the former case only.
|
|
182
182
|
if (!this.childMenu) {
|
|
183
183
|
const { activeElement } = document;
|
|
184
|
-
|
|
184
|
+
// we do not want to restore focus to menus
|
|
185
|
+
if (activeElement instanceof HTMLElement && !isMenuElement(activeElement)) {
|
|
185
186
|
this.previousFocusedElement = activeElement;
|
|
186
187
|
}
|
|
187
188
|
}
|
|
@@ -322,14 +323,14 @@ export class DynamicMenuWidget extends MenuWidget {
|
|
|
322
323
|
});
|
|
323
324
|
}
|
|
324
325
|
|
|
325
|
-
public override open(x: number, y: number, options?: MenuWidget.IOpenOptions
|
|
326
|
+
public override open(x: number, y: number, options?: MenuWidget.IOpenOptions): void {
|
|
326
327
|
const cb = () => {
|
|
327
328
|
this.restoreFocusedElement();
|
|
328
329
|
this.aboutToClose.disconnect(cb);
|
|
329
330
|
};
|
|
330
331
|
this.aboutToClose.connect(cb);
|
|
331
332
|
this.preserveFocusedElement();
|
|
332
|
-
super.open(x, y, options
|
|
333
|
+
super.open(x, y, options);
|
|
333
334
|
}
|
|
334
335
|
|
|
335
336
|
protected updateSubMenus(parent: MenuWidget, menu: CompoundMenuNode, commands: MenuCommandRegistry): void {
|
|
@@ -337,6 +338,13 @@ export class DynamicMenuWidget extends MenuWidget {
|
|
|
337
338
|
while (items[items.length - 1]?.type === 'separator') {
|
|
338
339
|
items.pop();
|
|
339
340
|
}
|
|
341
|
+
// Add at least one entry to avoid empty menus.
|
|
342
|
+
// This is needed as Lumino does all kind of checks whether a menu is empty and for example prevents activating it
|
|
343
|
+
// This item will be cleared once the menu is opened via the next update as we don't have empty main menus
|
|
344
|
+
// See https://github.com/jupyterlab/lumino/issues/729
|
|
345
|
+
if (items.length === 0) {
|
|
346
|
+
items.push({ type: 'separator' });
|
|
347
|
+
}
|
|
340
348
|
for (const item of items) {
|
|
341
349
|
parent.addItem(item);
|
|
342
350
|
}
|
|
@@ -382,7 +390,7 @@ export class DynamicMenuWidget extends MenuWidget {
|
|
|
382
390
|
}
|
|
383
391
|
|
|
384
392
|
protected preserveFocusedElement(previousFocusedElement: Element | null = document.activeElement): boolean {
|
|
385
|
-
if (!this.previousFocusedElement && previousFocusedElement instanceof HTMLElement) {
|
|
393
|
+
if (!this.previousFocusedElement && previousFocusedElement instanceof HTMLElement && !isMenuElement(previousFocusedElement)) {
|
|
386
394
|
this.previousFocusedElement = previousFocusedElement;
|
|
387
395
|
return true;
|
|
388
396
|
}
|
|
@@ -401,14 +409,16 @@ export class DynamicMenuWidget extends MenuWidget {
|
|
|
401
409
|
protected runWithPreservedFocusContext(what: () => void): void {
|
|
402
410
|
let focusToRestore: HTMLElement | undefined = undefined;
|
|
403
411
|
const { activeElement } = document;
|
|
404
|
-
if (this.previousFocusedElement &&
|
|
412
|
+
if (this.previousFocusedElement &&
|
|
413
|
+
activeElement instanceof HTMLElement &&
|
|
414
|
+
this.previousFocusedElement !== activeElement) {
|
|
405
415
|
focusToRestore = activeElement;
|
|
406
416
|
this.previousFocusedElement.focus({ preventScroll: true });
|
|
407
417
|
}
|
|
408
418
|
try {
|
|
409
419
|
what();
|
|
410
420
|
} finally {
|
|
411
|
-
if (focusToRestore) {
|
|
421
|
+
if (focusToRestore && !isMenuElement(focusToRestore)) {
|
|
412
422
|
focusToRestore.focus({ preventScroll: true });
|
|
413
423
|
}
|
|
414
424
|
}
|
|
@@ -465,9 +475,9 @@ export class BrowserMenuBarContribution implements FrontendApplicationContributi
|
|
|
465
475
|
}
|
|
466
476
|
|
|
467
477
|
/**
|
|
468
|
-
* Stores Theia-specific action menu nodes instead of
|
|
478
|
+
* Stores Theia-specific action menu nodes instead of Lumino commands with their handlers.
|
|
469
479
|
*/
|
|
470
|
-
export class MenuCommandRegistry extends
|
|
480
|
+
export class MenuCommandRegistry extends LuminoCommandRegistry {
|
|
471
481
|
|
|
472
482
|
protected actions = new Map<string, [MenuNode & CommandMenuNode, unknown[]]>();
|
|
473
483
|
protected toDispose = new DisposableCollection();
|
|
@@ -516,7 +526,7 @@ export class MenuCommandRegistry extends PhosphorCommandRegistry {
|
|
|
516
526
|
const unregisterCommand = this.addCommand(id, {
|
|
517
527
|
execute: () => commandExecutor.executeCommand(menuPath, id, ...args),
|
|
518
528
|
label: menu.label,
|
|
519
|
-
|
|
529
|
+
iconClass: menu.icon,
|
|
520
530
|
isEnabled: () => enabled,
|
|
521
531
|
isVisible: () => visible,
|
|
522
532
|
isToggled: () => toggled
|
|
@@ -532,7 +542,7 @@ export class MenuCommandRegistry extends PhosphorCommandRegistry {
|
|
|
532
542
|
this.addKeyBinding({
|
|
533
543
|
command: id,
|
|
534
544
|
keys,
|
|
535
|
-
selector: '.
|
|
545
|
+
selector: '.lm-Widget' // We have the Lumino dependency anyway.
|
|
536
546
|
});
|
|
537
547
|
}
|
|
538
548
|
return Disposable.create(() => unregisterCommand.dispose());
|
|
@@ -19,7 +19,7 @@ import { PreferenceSchema } from '../../common/preferences/preference-schema';
|
|
|
19
19
|
import { Disposable, DisposableCollection, Emitter, Event, isObject, MaybePromise } from '../../common';
|
|
20
20
|
import { PreferenceChangeEvent, PreferenceEventEmitter, PreferenceProxy, PreferenceProxyOptions, PreferenceRetrieval } from './preference-proxy';
|
|
21
21
|
import { PreferenceChange, PreferenceChangeImpl, PreferenceChanges, PreferenceScope, PreferenceService } from './preference-service';
|
|
22
|
-
import { JSONValue } from '@
|
|
22
|
+
import { JSONValue } from '@lumino/coreutils';
|
|
23
23
|
import { PreferenceProviderDataChange } from './preference-provider';
|
|
24
24
|
import { OverridePreferenceName } from './preference-language-override-service';
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ import { bindPreferenceConfigurations, PreferenceConfigurations } from './prefer
|
|
|
28
28
|
export { PreferenceSchema, PreferenceSchemaProperties, PreferenceDataSchema, PreferenceItem, PreferenceSchemaProperty, PreferenceDataProperty };
|
|
29
29
|
import { isObject, Mutable } from '../../common/types';
|
|
30
30
|
import { PreferenceLanguageOverrideService } from './preference-language-override-service';
|
|
31
|
-
import { JSONValue } from '@
|
|
31
|
+
import { JSONValue } from '@lumino/coreutils';
|
|
32
32
|
|
|
33
33
|
/* eslint-disable guard-for-in, @typescript-eslint/no-explicit-any */
|
|
34
34
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import debounce = require('p-debounce');
|
|
20
20
|
import { injectable, inject } from 'inversify';
|
|
21
|
-
import { JSONExt, JSONValue } from '@
|
|
21
|
+
import { JSONExt, JSONValue } from '@lumino/coreutils';
|
|
22
22
|
import URI from '../../common/uri';
|
|
23
23
|
import { Disposable, DisposableCollection, Emitter, Event, isObject } from '../../common';
|
|
24
24
|
import { Deferred } from '../../common/promise-util';
|
|
@@ -24,7 +24,7 @@ import { PreferenceSchemaProvider } from './preference-contribution';
|
|
|
24
24
|
import URI from '../../common/uri';
|
|
25
25
|
import { PreferenceScope } from './preference-scope';
|
|
26
26
|
import { PreferenceConfigurations } from './preference-configurations';
|
|
27
|
-
import { JSONExt, JSONValue } from '@
|
|
27
|
+
import { JSONExt, JSONValue } from '@lumino/coreutils';
|
|
28
28
|
import { OverridePreferenceName, PreferenceLanguageOverrideService } from './preference-language-override-service';
|
|
29
29
|
|
|
30
30
|
export { PreferenceScope };
|
|
@@ -19,7 +19,7 @@ import { PreferenceValidationService } from './preference-validation-service';
|
|
|
19
19
|
import { PreferenceItem, PreferenceSchemaProvider } from './preference-contribution';
|
|
20
20
|
import { PreferenceLanguageOverrideService } from './preference-language-override-service';
|
|
21
21
|
import * as assert from 'assert';
|
|
22
|
-
import { JSONValue } from '@
|
|
22
|
+
import { JSONValue } from '@lumino/coreutils';
|
|
23
23
|
import { IJSONSchema, JsonType } from '../../common/json-schema';
|
|
24
24
|
|
|
25
25
|
/* eslint-disable no-null/no-null */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { PreferenceItem } from '../../common/preferences/preference-schema';
|
|
18
|
-
import { JSONObject, JSONValue } from '../../../shared/@
|
|
18
|
+
import { JSONObject, JSONValue } from '../../../shared/@lumino/coreutils';
|
|
19
19
|
import { PreferenceSchemaProvider } from './preference-contribution';
|
|
20
20
|
import { PreferenceLanguageOverrideService } from './preference-language-override-service';
|
|
21
21
|
import { inject, injectable } from '../../../shared/inversify';
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
import { PreloadContribution } from './preloader';
|
|
18
18
|
import { FrontendApplicationConfigProvider } from '../frontend-application-config-provider';
|
|
19
19
|
import { nls } from '../../common/nls';
|
|
20
|
-
import { inject, injectable } from 'inversify';
|
|
20
|
+
import { inject, injectable, named } from 'inversify';
|
|
21
21
|
import { LocalizationServer } from '../../common/i18n/localization-server';
|
|
22
|
+
import { ContributionProvider } from '../../common';
|
|
23
|
+
import { TextReplacementContribution } from './text-replacement-contribution';
|
|
22
24
|
|
|
23
25
|
@injectable()
|
|
24
26
|
export class I18nPreloadContribution implements PreloadContribution {
|
|
@@ -26,6 +28,9 @@ export class I18nPreloadContribution implements PreloadContribution {
|
|
|
26
28
|
@inject(LocalizationServer)
|
|
27
29
|
protected readonly localizationServer: LocalizationServer;
|
|
28
30
|
|
|
31
|
+
@inject(ContributionProvider) @named(TextReplacementContribution)
|
|
32
|
+
protected readonly replacementContributions: ContributionProvider<TextReplacementContribution>;
|
|
33
|
+
|
|
29
34
|
async initialize(): Promise<void> {
|
|
30
35
|
const defaultLocale = FrontendApplicationConfigProvider.get().defaultLocale;
|
|
31
36
|
if (defaultLocale && !nls.locale) {
|
|
@@ -33,8 +38,9 @@ export class I18nPreloadContribution implements PreloadContribution {
|
|
|
33
38
|
locale: defaultLocale
|
|
34
39
|
});
|
|
35
40
|
}
|
|
41
|
+
let locale = nls.locale ?? nls.defaultLocale;
|
|
36
42
|
if (nls.locale && nls.locale !== nls.defaultLocale) {
|
|
37
|
-
const localization = await this.localizationServer.loadLocalization(
|
|
43
|
+
const localization = await this.localizationServer.loadLocalization(locale);
|
|
38
44
|
if (localization.languagePack) {
|
|
39
45
|
nls.localization = localization;
|
|
40
46
|
} else {
|
|
@@ -43,8 +49,22 @@ export class I18nPreloadContribution implements PreloadContribution {
|
|
|
43
49
|
Object.assign(nls, {
|
|
44
50
|
locale: defaultLocale || undefined
|
|
45
51
|
});
|
|
52
|
+
locale = defaultLocale;
|
|
46
53
|
}
|
|
47
54
|
}
|
|
55
|
+
const replacements = this.getReplacements(locale);
|
|
56
|
+
if (Object.keys(replacements).length > 0) {
|
|
57
|
+
nls.localization ??= { translations: {}, languageId: locale };
|
|
58
|
+
nls.localization.replacements = replacements;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected getReplacements(locale: string): Record<string, string> {
|
|
63
|
+
const replacements: Record<string, string> = {};
|
|
64
|
+
for (const contribution of this.replacementContributions.getContributions()) {
|
|
65
|
+
Object.assign(replacements, contribution.getReplacement(locale));
|
|
66
|
+
}
|
|
67
|
+
return replacements;
|
|
48
68
|
}
|
|
49
69
|
|
|
50
70
|
}
|
|
@@ -21,19 +21,21 @@ import { I18nPreloadContribution } from './i18n-preload-contribution';
|
|
|
21
21
|
import { OSPreloadContribution } from './os-preload-contribution';
|
|
22
22
|
import { ThemePreloadContribution } from './theme-preload-contribution';
|
|
23
23
|
import { LocalizationServer, LocalizationServerPath } from '../../common/i18n/localization-server';
|
|
24
|
-
import {
|
|
24
|
+
import { ServiceConnectionProvider } from '../messaging/service-connection-provider';
|
|
25
25
|
import { OSBackendProvider, OSBackendProviderPath } from '../../common/os';
|
|
26
|
+
import { TextReplacementContribution } from './text-replacement-contribution';
|
|
26
27
|
|
|
27
28
|
export default new ContainerModule(bind => {
|
|
28
29
|
bind(Preloader).toSelf().inSingletonScope();
|
|
29
30
|
bindContributionProvider(bind, PreloadContribution);
|
|
31
|
+
bindContributionProvider(bind, TextReplacementContribution);
|
|
30
32
|
|
|
31
33
|
bind(LocalizationServer).toDynamicValue(ctx =>
|
|
32
|
-
|
|
34
|
+
ServiceConnectionProvider.createProxy<LocalizationServer>(ctx.container, LocalizationServerPath)
|
|
33
35
|
).inSingletonScope();
|
|
34
36
|
|
|
35
37
|
bind(OSBackendProvider).toDynamicValue(ctx =>
|
|
36
|
-
|
|
38
|
+
ServiceConnectionProvider.createProxy<OSBackendProvider>(ctx.container, OSBackendProviderPath)
|
|
37
39
|
).inSingletonScope();
|
|
38
40
|
|
|
39
41
|
bind(I18nPreloadContribution).toSelf().inSingletonScope();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2025 TypeFox 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
|
+
export const TextReplacementContribution = Symbol('TextReplacementContribution');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Enables adopters to override text in the application. All `TextReplacementContribution`s need to be bound in the `frontendPreload` scope of the package.json.
|
|
21
|
+
*
|
|
22
|
+
* @example Create a text replacement contribution
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { TextReplacementContribution } from '@theia/core/lib/browser/preload/text-replacement-contribution';
|
|
25
|
+
* export class TextSampleReplacementContribution implements TextReplacementContribution {
|
|
26
|
+
* getReplacement(locale: string): Record<string, string> {
|
|
27
|
+
* switch (locale) {
|
|
28
|
+
* case 'en': {
|
|
29
|
+
* return {
|
|
30
|
+
* 'About': 'About Theia',
|
|
31
|
+
* };
|
|
32
|
+
* }
|
|
33
|
+
* case 'de': {
|
|
34
|
+
* return {
|
|
35
|
+
* 'About': 'Über Theia',
|
|
36
|
+
* };
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* return {};
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export interface TextReplacementContribution {
|
|
45
|
+
/**
|
|
46
|
+
* This method returns a map of **default values** and their replacement values for the specified locale.
|
|
47
|
+
* **Do not** use the keys of the `nls.localization` call, but the English default values.
|
|
48
|
+
*
|
|
49
|
+
* @param locale The locale for which the replacement should be returned.
|
|
50
|
+
* @returns A map of default values and their replacement values.
|
|
51
|
+
*/
|
|
52
|
+
getReplacement(locale: string): Record<string, string>;
|
|
53
|
+
}
|
package/src/browser/saveable.ts
CHANGED
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { Widget } from '@
|
|
18
|
-
import { Message } from '@
|
|
17
|
+
import { Widget } from '@lumino/widgets';
|
|
18
|
+
import { Message } from '@lumino/messaging';
|
|
19
19
|
import { Emitter, Event } from '../common/event';
|
|
20
20
|
import { MaybePromise } from '../common/types';
|
|
21
21
|
import { Key } from './keyboard/keys';
|
|
22
22
|
import { AbstractDialog } from './dialogs';
|
|
23
23
|
import { nls } from '../common/nls';
|
|
24
|
-
import { Disposable, DisposableCollection, isObject } from '../common';
|
|
24
|
+
import { Disposable, DisposableCollection, isObject, URI } from '../common';
|
|
25
25
|
import { BinaryBuffer } from '../common/buffer';
|
|
26
26
|
|
|
27
27
|
export type AutoSaveMode = 'off' | 'afterDelay' | 'onFocusChange' | 'onWindowChange';
|
|
@@ -44,6 +44,10 @@ export interface Saveable {
|
|
|
44
44
|
* Saves dirty changes.
|
|
45
45
|
*/
|
|
46
46
|
save(options?: SaveOptions): MaybePromise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Performs the save operation with a new file name.
|
|
49
|
+
*/
|
|
50
|
+
saveAs?(options: SaveAsOptions): MaybePromise<void>;
|
|
47
51
|
/**
|
|
48
52
|
* Reverts dirty changes.
|
|
49
53
|
*/
|
|
@@ -87,6 +91,7 @@ export class DelegatingSaveable implements Saveable {
|
|
|
87
91
|
createSnapshot?(): Saveable.Snapshot;
|
|
88
92
|
applySnapshot?(snapshot: object): void;
|
|
89
93
|
serialize?(): Promise<BinaryBuffer>;
|
|
94
|
+
saveAs?(options: SaveAsOptions): MaybePromise<void>;
|
|
90
95
|
|
|
91
96
|
protected _delegate?: Saveable;
|
|
92
97
|
protected toDispose = new DisposableCollection();
|
|
@@ -110,6 +115,7 @@ export class DelegatingSaveable implements Saveable {
|
|
|
110
115
|
this.createSnapshot = delegate.createSnapshot?.bind(delegate);
|
|
111
116
|
this.applySnapshot = delegate.applySnapshot?.bind(delegate);
|
|
112
117
|
this.serialize = delegate.serialize?.bind(delegate);
|
|
118
|
+
this.saveAs = delegate.saveAs?.bind(delegate);
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
}
|
|
@@ -341,6 +347,10 @@ export interface SaveOptions {
|
|
|
341
347
|
readonly saveReason?: SaveReason;
|
|
342
348
|
}
|
|
343
349
|
|
|
350
|
+
export interface SaveAsOptions extends SaveOptions {
|
|
351
|
+
readonly target: URI;
|
|
352
|
+
}
|
|
353
|
+
|
|
344
354
|
/**
|
|
345
355
|
* The class name added to the dirty widget's title.
|
|
346
356
|
*/
|
|
@@ -19,7 +19,7 @@ import { ApplicationShell } from './application-shell';
|
|
|
19
19
|
import { injectable, inject } from 'inversify';
|
|
20
20
|
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
21
21
|
import { Emitter, Event } from '../../common/event';
|
|
22
|
-
import { FocusTracker, PanelLayout, SplitPanel } from '@
|
|
22
|
+
import { FocusTracker, PanelLayout, SplitPanel } from '@lumino/widgets';
|
|
23
23
|
import { addEventListener, Widget } from '../widgets';
|
|
24
24
|
/**
|
|
25
25
|
* Contribution that tracks `mouseup` and `mousedown` events.
|
|
@@ -44,7 +44,7 @@ export class ApplicationShellMouseTracker implements FrontendApplicationContribu
|
|
|
44
44
|
protected readonly mousedownListener: (e: MouseEvent) => void = e => this.mousedownEmitter.fire(e);
|
|
45
45
|
|
|
46
46
|
onStart(): void {
|
|
47
|
-
// Here we need to attach a `mousedown` listener to the `TabBar`s, `DockPanel`s and the `SidePanel`s. Otherwise,
|
|
47
|
+
// Here we need to attach a `mousedown` listener to the `TabBar`s, `DockPanel`s and the `SidePanel`s. Otherwise, Lumino handles the event and stops the propagation.
|
|
48
48
|
// Track the `mousedown` on the `TabBar` for the currently active widget.
|
|
49
49
|
this.applicationShell.onDidChangeActiveWidget((args: FocusTracker.IChangedArgs<Widget>) => {
|
|
50
50
|
this.toDisposeOnActiveChange.dispose();
|
|
@@ -68,7 +68,7 @@ export class ApplicationShellMouseTracker implements FrontendApplicationContribu
|
|
|
68
68
|
this.toDispose.pushAll([mainPanel, bottomPanel, leftPanelHandler.dockPanel, rightPanelHandler.dockPanel]
|
|
69
69
|
.map(panel => addEventListener(panel.node, 'mousedown', this.mousedownListener, true)));
|
|
70
70
|
|
|
71
|
-
// The `mouseup` event has to be tracked on the `document`.
|
|
71
|
+
// The `mouseup` event has to be tracked on the `document`. Lumino attaches to there.
|
|
72
72
|
document.addEventListener('mouseup', this.mouseupListener, true);
|
|
73
73
|
|
|
74
74
|
// Make sure it is disposed in the end.
|