@eclipse-lyra/core 0.0.0 → 0.7.6
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/dist/api/index.js +2 -2
- package/dist/api/types.d.ts +1 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/core/apploader.d.ts +1 -1
- package/dist/core/apploader.d.ts.map +1 -1
- package/dist/core/contributionregistry.d.ts +1 -9
- package/dist/core/contributionregistry.d.ts.map +1 -1
- package/dist/core/editorregistry.d.ts +1 -1
- package/dist/core/editorregistry.d.ts.map +1 -1
- package/dist/icon-DN6fp0dg.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/parts/index.js +1 -1
- package/dist/{resizable-grid-BRH3MyZK.js → resizable-grid-BP9wOk_x.js} +9 -9
- package/dist/resizable-grid-BP9wOk_x.js.map +1 -0
- package/dist/{standard-layout-BSGa06lP.js → standard-layout-Efok-voU.js} +11 -11
- package/dist/standard-layout-Efok-voU.js.map +1 -0
- package/package.json +6 -2
- package/src/api/types.ts +0 -1
- package/src/commands/global.ts +1 -1
- package/src/components/command.ts +2 -2
- package/src/components/part-name.ts +1 -1
- package/src/components/tasks.ts +1 -1
- package/src/contributions/default-ui-contributions.ts +3 -3
- package/src/core/apploader.ts +2 -2
- package/src/core/contributionregistry.ts +1 -10
- package/src/core/editorregistry.ts +4 -4
- package/src/parts/contextmenu.ts +2 -2
- package/src/parts/toolbar.ts +3 -3
- package/dist/resizable-grid-BRH3MyZK.js.map +0 -1
- package/dist/standard-layout-BSGa06lP.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-lyra/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.6",
|
|
4
|
+
"description": "Eclipse Lyra platform core: registries, services, parts, widgets, and API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "EPL-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/eclipse-lyra/core"
|
|
10
|
+
},
|
|
7
11
|
"main": "./dist/index.js",
|
|
8
12
|
"module": "./dist/index.js",
|
|
9
13
|
"types": "./dist/index.d.ts",
|
package/src/api/types.ts
CHANGED
package/src/commands/global.ts
CHANGED
|
@@ -123,7 +123,7 @@ registerAll({
|
|
|
123
123
|
icon: "puzzle-piece",
|
|
124
124
|
state: {},
|
|
125
125
|
noOverflow: true,
|
|
126
|
-
|
|
126
|
+
component: () => html`<lyra-extensions></lyra-extensions>`,
|
|
127
127
|
}
|
|
128
128
|
editorRegistry.loadEditor(editorInput, "extensions-editor").then()
|
|
129
129
|
}
|
|
@@ -123,9 +123,9 @@ export class LyraCommand extends LyraWidget {
|
|
|
123
123
|
`
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
if ('
|
|
126
|
+
if ('component' in contribution) {
|
|
127
127
|
const htmlContribution = contribution as HTMLContribution
|
|
128
|
-
const contents = htmlContribution.
|
|
128
|
+
const contents = htmlContribution.component
|
|
129
129
|
if (contents instanceof Function) {
|
|
130
130
|
return contents()
|
|
131
131
|
}
|
|
@@ -10,7 +10,7 @@ import {i18n} from "../core/i18n";
|
|
|
10
10
|
const t = i18n('partname');
|
|
11
11
|
|
|
12
12
|
contributionRegistry.registerContribution(TOOLBAR_BOTTOM_CENTER, {
|
|
13
|
-
|
|
13
|
+
component: "<lyra-part-name></lyra-part-name>"
|
|
14
14
|
} as HTMLContribution)
|
|
15
15
|
|
|
16
16
|
@customElement('lyra-part-name')
|
package/src/components/tasks.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {i18n} from "../core/i18n";
|
|
|
10
10
|
const t = i18n('tasks');
|
|
11
11
|
|
|
12
12
|
contributionRegistry.registerContribution(TOOLBAR_BOTTOM_CENTER, {
|
|
13
|
-
|
|
13
|
+
component: "<lyra-tasks></lyra-tasks>"
|
|
14
14
|
} as HTMLContribution)
|
|
15
15
|
|
|
16
16
|
// Singleton dialog container for progress dialog
|
|
@@ -29,16 +29,16 @@ contributionRegistry.registerContribution(TOOLBAR_BOTTOM_END, {
|
|
|
29
29
|
|
|
30
30
|
contributionRegistry.registerContribution(TOOLBAR_BOTTOM_END, {
|
|
31
31
|
label: `Fast Views`,
|
|
32
|
-
|
|
32
|
+
component: `<lyra-fastviews target="system.fastviews-bottomend" icon="bolt" title="Fast Views"></lyra-fastviews>`
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
contributionRegistry.registerContribution(TOOLBAR_BOTTOM_END, {
|
|
36
36
|
label: "Language",
|
|
37
|
-
|
|
37
|
+
component: () => html`<lyra-language-selector></lyra-language-selector>`
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
contributionRegistry.registerContribution(TOOLBAR_MAIN_RIGHT, {
|
|
41
41
|
label: "App Switcher",
|
|
42
|
-
|
|
42
|
+
component: () => html`<lyra-app-switcher></lyra-app-switcher>`
|
|
43
43
|
} as HTMLContribution);
|
|
44
44
|
|
package/src/core/apploader.ts
CHANGED
|
@@ -176,7 +176,7 @@ export interface AppDefinition {
|
|
|
176
176
|
* - A function returning a Lit TemplateResult for custom templates (requires lit in the app).
|
|
177
177
|
* If not provided, defaults to lyra-standard-layout.
|
|
178
178
|
*/
|
|
179
|
-
|
|
179
|
+
component?: string | RenderDescriptor | (() => TemplateResult);
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
182
|
* Optional cleanup function.
|
|
@@ -486,7 +486,7 @@ class AppLoaderService {
|
|
|
486
486
|
throw new Error('No app loaded. Call loadApp() first.');
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
const r = this.currentApp.
|
|
489
|
+
const r = this.currentApp.component;
|
|
490
490
|
if (typeof r === 'string') {
|
|
491
491
|
const el = document.createElement(r);
|
|
492
492
|
container.innerHTML = '';
|
|
@@ -25,7 +25,7 @@ export interface CommandContribution extends Contribution {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface HTMLContribution extends Contribution {
|
|
28
|
-
|
|
28
|
+
component: string | (() => TemplateResult)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface TabContribution extends Contribution {
|
|
@@ -40,15 +40,6 @@ export interface TabContribution extends Contribution {
|
|
|
40
40
|
component?: (id: string) => TemplateResult;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export interface PaneContribution extends Contribution {
|
|
44
|
-
name: string;
|
|
45
|
-
size?: number;
|
|
46
|
-
minSize?: number;
|
|
47
|
-
maxSize?: number;
|
|
48
|
-
order?: number;
|
|
49
|
-
component: () => TemplateResult;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
43
|
export interface IconContribution extends Contribution {
|
|
53
44
|
mappings: Record<string, string>;
|
|
54
45
|
priority?: number;
|
|
@@ -16,7 +16,7 @@ export interface EditorInput {
|
|
|
16
16
|
icon?: string;
|
|
17
17
|
data: any;
|
|
18
18
|
noOverflow?: boolean;
|
|
19
|
-
|
|
19
|
+
component: (container: any, tab: HTMLElement) => any;
|
|
20
20
|
state: { [key: string]: any };
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -246,11 +246,11 @@ class EditorRegistry {
|
|
|
246
246
|
return
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
if (!("
|
|
249
|
+
if (!("component" in editorInput)) {
|
|
250
250
|
editorInput = await this.handleInput(editorInput, preferredEditorId)
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
if (!editorInput || !("
|
|
253
|
+
if (!editorInput || !("component" in editorInput)) {
|
|
254
254
|
return
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -264,7 +264,7 @@ class EditorRegistry {
|
|
|
264
264
|
icon: editorInput.icon,
|
|
265
265
|
closable: true,
|
|
266
266
|
noOverflow: editorInput.noOverflow,
|
|
267
|
-
component: editorInput.
|
|
267
|
+
component: editorInput.component
|
|
268
268
|
} as TabContribution)
|
|
269
269
|
}
|
|
270
270
|
|
package/src/parts/contextmenu.ts
CHANGED
|
@@ -198,8 +198,8 @@ export class LyraContextMenu extends LyraElement {
|
|
|
198
198
|
${commandContribution.label}
|
|
199
199
|
</lyra-command>
|
|
200
200
|
`;
|
|
201
|
-
} else if ("
|
|
202
|
-
const contents = (contribution as HTMLContribution).
|
|
201
|
+
} else if ("component" in contribution) {
|
|
202
|
+
const contents = (contribution as HTMLContribution).component;
|
|
203
203
|
if (contents instanceof Function) {
|
|
204
204
|
return contents();
|
|
205
205
|
}
|
package/src/parts/toolbar.ts
CHANGED
|
@@ -186,7 +186,7 @@ export class LyraToolbar extends LyraElement {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
private isToolbarItem(contribution: Contribution): boolean {
|
|
189
|
-
return "command" in contribution || "
|
|
189
|
+
return "command" in contribution || "component" in contribution;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
contributionCreator(contribution: Contribution) {
|
|
@@ -203,8 +203,8 @@ export class LyraToolbar extends LyraElement {
|
|
|
203
203
|
</wa-button>
|
|
204
204
|
`;
|
|
205
205
|
}
|
|
206
|
-
if ("
|
|
207
|
-
const contents = (contribution as HTMLContribution).
|
|
206
|
+
if ("component" in contribution) {
|
|
207
|
+
const contents = (contribution as HTMLContribution).component
|
|
208
208
|
if (contents instanceof Function) {
|
|
209
209
|
return contents()
|
|
210
210
|
}
|