@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/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@eclipse-lyra/core",
3
- "version": "0.0.0",
4
- "description": "Appspace platform core: registries, services, parts, widgets, and API",
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
@@ -19,7 +19,6 @@ export type {
19
19
  CommandContribution,
20
20
  HTMLContribution,
21
21
  TabContribution,
22
- PaneContribution,
23
22
  ContributionChangeEvent
24
23
  } from '../core/contributionregistry';
25
24
  export type {
@@ -123,7 +123,7 @@ registerAll({
123
123
  icon: "puzzle-piece",
124
124
  state: {},
125
125
  noOverflow: true,
126
- widgetFactory: () => html`<lyra-extensions></lyra-extensions>`,
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 ('html' in contribution) {
126
+ if ('component' in contribution) {
127
127
  const htmlContribution = contribution as HTMLContribution
128
- const contents = htmlContribution.html
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
- html: "<lyra-part-name></lyra-part-name>"
13
+ component: "<lyra-part-name></lyra-part-name>"
14
14
  } as HTMLContribution)
15
15
 
16
16
  @customElement('lyra-part-name')
@@ -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
- html: "<lyra-tasks></lyra-tasks>"
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
- html: `<lyra-fastviews target="system.fastviews-bottomend" icon="bolt" title="Fast Views"></lyra-fastviews>`
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
- html: () => html`<lyra-language-selector></lyra-language-selector>`
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
- html: () => html`<lyra-app-switcher></lyra-app-switcher>`
42
+ component: () => html`<lyra-app-switcher></lyra-app-switcher>`
43
43
  } as HTMLContribution);
44
44
 
@@ -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
- render?: string | RenderDescriptor | (() => TemplateResult);
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.render;
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
- html: string | (() => TemplateResult)
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
- widgetFactory: (container: any, tab: HTMLElement) => any;
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 (!("widgetFactory" in editorInput)) {
249
+ if (!("component" in editorInput)) {
250
250
  editorInput = await this.handleInput(editorInput, preferredEditorId)
251
251
  }
252
252
 
253
- if (!editorInput || !("widgetFactory" in 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.widgetFactory
267
+ component: editorInput.component
268
268
  } as TabContribution)
269
269
  }
270
270
 
@@ -198,8 +198,8 @@ export class LyraContextMenu extends LyraElement {
198
198
  ${commandContribution.label}
199
199
  </lyra-command>
200
200
  `;
201
- } else if ("html" in contribution) {
202
- const contents = (contribution as HTMLContribution).html;
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
  }
@@ -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 || "html" 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 ("html" in contribution) {
207
- const contents = (contribution as HTMLContribution).html
206
+ if ("component" in contribution) {
207
+ const contents = (contribution as HTMLContribution).component
208
208
  if (contents instanceof Function) {
209
209
  return contents()
210
210
  }