deploy: current vibn theia state
Made-with: Cursor
This commit is contained in:
10
packages/secondary-window/.eslintrc.js
Normal file
10
packages/secondary-window/.eslintrc.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
extends: [
|
||||
'../../configs/build.eslintrc.json'
|
||||
],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: 'tsconfig.json'
|
||||
}
|
||||
};
|
||||
42
packages/secondary-window/README.md
Normal file
42
packages/secondary-window/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
<div align='center'>
|
||||
|
||||
<br />
|
||||
|
||||
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
||||
|
||||
<h2>ECLIPSE THEIA - SECONDARY WINDOW EXTENSION</h2>
|
||||
|
||||
<hr />
|
||||
|
||||
</div>
|
||||
|
||||
## Description
|
||||
|
||||
The `@theia/secondary-window` extension contributes the extract command and toolbar item to move extractable widgets to secondary windows.
|
||||
|
||||
To mark a widget to be extractable, implement the `ExtractableWidget` interface from `@theia/core`.
|
||||
|
||||
### Limitations
|
||||
|
||||
For the extraction to work we require changes in upstream libraries.
|
||||
Theia offers the `theia-patch` CLI command to apply these patches.
|
||||
|
||||
Recommendation: Execute `theia-patch` in the `postinstall` script of your root npm package to automatically apply the patches.
|
||||
|
||||
If the patches are not applied, the secondary window will show empty.
|
||||
|
||||
## Additional Information
|
||||
|
||||
- [API documentation for `@theia/secondary-window`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_secondary-window.html)
|
||||
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
||||
- [Theia - Website](https://theia-ide.org/)
|
||||
|
||||
## License
|
||||
|
||||
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
||||
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
||||
|
||||
## Trademark
|
||||
|
||||
"Theia" is a trademark of the Eclipse Foundation
|
||||
<https://www.eclipse.org/theia>
|
||||
45
packages/secondary-window/package.json
Normal file
45
packages/secondary-window/package.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@theia/secondary-window",
|
||||
"version": "1.68.0",
|
||||
"description": "Theia - Secondary Window Extension",
|
||||
"dependencies": {
|
||||
"@theia/core": "1.68.0",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"theiaExtensions": [
|
||||
{
|
||||
"frontend": "lib/browser/secondary-window-frontend-module"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
"theia-extension"
|
||||
],
|
||||
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/eclipse-theia/theia.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/eclipse-theia/theia/issues"
|
||||
},
|
||||
"homepage": "https://github.com/eclipse-theia/theia",
|
||||
"files": [
|
||||
"lib",
|
||||
"src"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "theiaext build",
|
||||
"clean": "theiaext clean",
|
||||
"compile": "theiaext compile",
|
||||
"lint": "theiaext lint",
|
||||
"test": "theiaext test",
|
||||
"watch": "theiaext watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@theia/ext-scripts": "1.68.0"
|
||||
},
|
||||
"gitHead": "21358137e41342742707f660b8e222f940a27652"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2022 STMicroelectronics, Ericsson, ARM, EclipseSource and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { CommandRegistry, CommandContribution, Command } from '@theia/core/lib/common/command';
|
||||
import { codicon, ExtractableWidget } from '@theia/core/lib/browser/widgets';
|
||||
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
||||
import { SecondaryWindowHandler } from '@theia/core/lib/browser/secondary-window-handler';
|
||||
|
||||
export const EXTRACT_WIDGET = Command.toLocalizedCommand({
|
||||
id: 'extract-widget',
|
||||
label: 'Move View to Secondary Window'
|
||||
}, 'theia/secondary-window/extract-widget');
|
||||
|
||||
/** Contributes the widget extraction command and registers it in the toolbar of extractable widgets. */
|
||||
@injectable()
|
||||
export class SecondaryWindowContribution implements CommandContribution, TabBarToolbarContribution {
|
||||
|
||||
@inject(SecondaryWindowHandler)
|
||||
protected readonly secondaryWindowHandler: SecondaryWindowHandler;
|
||||
|
||||
registerCommands(commands: CommandRegistry): void {
|
||||
commands.registerCommand(EXTRACT_WIDGET, {
|
||||
execute: async widget => this.secondaryWindowHandler.moveWidgetToSecondaryWindow(widget),
|
||||
isVisible: widget => ExtractableWidget.is(widget) && widget.secondaryWindow === undefined,
|
||||
isEnabled: widget => ExtractableWidget.is(widget) && widget.secondaryWindow === undefined,
|
||||
});
|
||||
}
|
||||
|
||||
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
||||
registry.registerItem({
|
||||
id: EXTRACT_WIDGET.id,
|
||||
command: EXTRACT_WIDGET.id,
|
||||
icon: codicon('window'),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2022 STMicroelectronics, Ericsson, ARM, EclipseSource and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
import { ContainerModule } from '@theia/core/shared/inversify';
|
||||
import { SecondaryWindowContribution } from './secondary-window-frontend-contribution';
|
||||
import { CommandContribution } from '@theia/core/lib/common/command';
|
||||
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
||||
|
||||
export default new ContainerModule(bind => {
|
||||
bind(SecondaryWindowContribution).toSelf().inSingletonScope();
|
||||
bind(CommandContribution).toService(SecondaryWindowContribution);
|
||||
bind(TabBarToolbarContribution).toService(SecondaryWindowContribution);
|
||||
});
|
||||
|
||||
19
packages/secondary-window/src/package.spec.ts
Normal file
19
packages/secondary-window/src/package.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2022 STMicroelectronics, Ericsson, ARM, EclipseSource and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
describe('secondary-window package', () => {
|
||||
it('supports code coverage statistics', () => true);
|
||||
});
|
||||
16
packages/secondary-window/tsconfig.json
Normal file
16
packages/secondary-window/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../configs/base.tsconfig",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"rootDir": "src",
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../core"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user