@eclipse-lyra/core 0.7.5 → 0.7.7

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.
Files changed (69) hide show
  1. package/dist/api/index.js +28 -29
  2. package/dist/api/services.d.ts +0 -4
  3. package/dist/api/services.d.ts.map +1 -1
  4. package/dist/api/types.d.ts +1 -1
  5. package/dist/api/types.d.ts.map +1 -1
  6. package/dist/components/fastviews.d.ts +1 -1
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/{app-switcher.d.ts → layout-switcher.d.ts} +5 -4
  9. package/dist/components/layout-switcher.d.ts.map +1 -0
  10. package/dist/{standard-layout-BSGa06lP.js → config-BiRvaEoO.js} +251 -462
  11. package/dist/config-BiRvaEoO.js.map +1 -0
  12. package/dist/contributions/default-layout-contributions.d.ts +1 -0
  13. package/dist/contributions/default-layout-contributions.d.ts.map +1 -0
  14. package/dist/contributions/index.d.ts.map +1 -1
  15. package/dist/core/apploader.d.ts +40 -30
  16. package/dist/core/apploader.d.ts.map +1 -1
  17. package/dist/core/constants.d.ts +1 -0
  18. package/dist/core/constants.d.ts.map +1 -1
  19. package/dist/core/contributionregistry.d.ts +10 -9
  20. package/dist/core/contributionregistry.d.ts.map +1 -1
  21. package/dist/core/editorregistry.d.ts +1 -1
  22. package/dist/core/editorregistry.d.ts.map +1 -1
  23. package/dist/core/index.d.ts.map +1 -1
  24. package/dist/icon-DN6fp0dg.js.map +1 -1
  25. package/dist/index.js +28 -29
  26. package/dist/parts/contextmenu.d.ts +1 -1
  27. package/dist/parts/index.js +1 -1
  28. package/dist/parts/resizable-grid.d.ts +1 -1
  29. package/dist/{resizable-grid-BRH3MyZK.js → resizable-grid-oWYRVx30.js} +322 -101
  30. package/dist/resizable-grid-oWYRVx30.js.map +1 -0
  31. package/dist/vite-plugin-resolve-deps.d.ts +18 -0
  32. package/dist/vite-plugin-resolve-deps.d.ts.map +1 -0
  33. package/dist/widgets/icon.d.ts +1 -1
  34. package/package.json +8 -1
  35. package/src/api/services.ts +0 -4
  36. package/src/api/types.ts +1 -1
  37. package/src/commands/global.ts +1 -1
  38. package/src/commands/version-info.ts +24 -10
  39. package/src/components/command.ts +2 -2
  40. package/src/components/index.ts +1 -1
  41. package/src/components/layout-switcher.ts +83 -0
  42. package/src/components/part-name.ts +1 -1
  43. package/src/components/tasks.ts +1 -1
  44. package/src/contributions/default-layout-contributions.ts +10 -0
  45. package/src/contributions/default-ui-contributions.ts +3 -3
  46. package/src/contributions/index.ts +1 -0
  47. package/src/contributions/marketplace-catalog-contributions.ts +1 -1
  48. package/src/core/apploader.ts +182 -99
  49. package/src/core/constants.ts +1 -0
  50. package/src/core/contributionregistry.ts +8 -10
  51. package/src/core/editorregistry.ts +4 -4
  52. package/src/core/index.ts +0 -1
  53. package/src/parts/contextmenu.ts +2 -2
  54. package/src/parts/toolbar.ts +3 -3
  55. package/src/vite-env.d.ts +9 -0
  56. package/src/vite-plugin-resolve-deps.ts +112 -0
  57. package/dist/components/app-selector.d.ts +0 -17
  58. package/dist/components/app-selector.d.ts.map +0 -1
  59. package/dist/components/app-switcher.d.ts.map +0 -1
  60. package/dist/core/app-host-config.d.ts +0 -7
  61. package/dist/core/app-host-config.d.ts.map +0 -1
  62. package/dist/core/packageinfoservice.d.ts +0 -16
  63. package/dist/core/packageinfoservice.d.ts.map +0 -1
  64. package/dist/resizable-grid-BRH3MyZK.js.map +0 -1
  65. package/dist/standard-layout-BSGa06lP.js.map +0 -1
  66. package/src/components/app-selector.ts +0 -233
  67. package/src/components/app-switcher.ts +0 -126
  68. package/src/core/app-host-config.ts +0 -23
  69. package/src/core/packageinfoservice.ts +0 -56
@@ -0,0 +1,18 @@
1
+ import { Plugin } from 'vite';
2
+ export interface ResolvedPackageInfo {
3
+ name: string;
4
+ version: string;
5
+ description?: string;
6
+ dependencies: Record<string, string>;
7
+ marketplaceCatalogUrls?: string[];
8
+ }
9
+ export declare function resolvePackageInfo(appRoot: string, options?: {
10
+ includeDevDependencies?: boolean;
11
+ }): ResolvedPackageInfo | null;
12
+ export declare function resolveDepVersions(appRoot: string, options?: {
13
+ includeDevDependencies?: boolean;
14
+ }): Record<string, string>;
15
+ export declare function resolveDepVersionsPlugin(options?: {
16
+ includeDevDependencies?: boolean;
17
+ }): Plugin;
18
+ //# sourceMappingURL=vite-plugin-resolve-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin-resolve-deps.d.ts","sourceRoot":"","sources":["../src/vite-plugin-resolve-deps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAoDD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7C,mBAAmB,GAAG,IAAI,CAkB5B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGxB;AAID,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACjD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,GAAG,MAAM,CAcT"}
@@ -4,7 +4,7 @@ export declare class LyraIcon extends LyraWidget {
4
4
  family?: string;
5
5
  variant?: string;
6
6
  label?: string;
7
- render(): import('lit-html').TemplateResult<1> | "";
7
+ render(): "" | import('lit-html').TemplateResult<1>;
8
8
  static styles: import('lit').CSSResult;
9
9
  }
10
10
  //# sourceMappingURL=icon.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-lyra/core",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Eclipse Lyra platform core: registries, services, parts, widgets, and API",
5
5
  "type": "module",
6
6
  "license": "EPL-2.0",
@@ -51,8 +51,15 @@
51
51
  "./core/events": {
52
52
  "types": "./dist/core/events.d.ts",
53
53
  "import": "./dist/core/events.js"
54
+ },
55
+ "./vite-plugin-resolve-deps": {
56
+ "types": "./src/vite-plugin-resolve-deps.ts",
57
+ "import": "./src/vite-plugin-resolve-deps.ts"
54
58
  }
55
59
  },
60
+ "peerDependencies": {
61
+ "vite": ">=5"
62
+ },
56
63
  "files": [
57
64
  "dist",
58
65
  "src"
@@ -42,15 +42,11 @@ export {
42
42
  toastWarning
43
43
  } from '../core/toast';
44
44
  export { taskService } from '../core/taskservice';
45
- export { applyAppHostConfig } from '../core/app-host-config';
46
- export type { AppHostConfig } from '../core/app-host-config';
47
45
  export { publish, subscribe, unsubscribe } from '../core/events';
48
46
  export { configureFramework, getFrameworkConfig } from '../core/config';
49
47
  export { treeNodeComparator } from '../core/tree-utils';
50
48
  export type { TreeContribution, TreeNode } from '../core/tree-utils';
51
49
  export { watchSignal } from '../core/signals';
52
- export { packageInfoService } from '../core/packageinfoservice';
53
- export type { PackageInfo } from '../core/packageinfoservice';
54
50
  export { persistenceService } from '../core/persistenceservice';
55
51
  export { esmShService } from '../core/esmsh-service';
56
52
  export type { EsmShSource, EsmShOptions } from '../core/esmsh-service';
package/src/api/types.ts CHANGED
@@ -19,7 +19,7 @@ export type {
19
19
  CommandContribution,
20
20
  HTMLContribution,
21
21
  TabContribution,
22
- PaneContribution,
22
+ LayoutContribution,
23
23
  ContributionChangeEvent
24
24
  } from '../core/contributionregistry';
25
25
  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
  }
@@ -1,10 +1,9 @@
1
1
  import { registerAll } from "../core/commandregistry";
2
- import { html, render } from "lit";
2
+ import { html, render, type TemplateResult } from "lit";
3
3
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
4
4
  import { marked } from "marked";
5
5
  import { toastError } from "../core/toast";
6
6
  import { appLoaderService, type ReleaseEntry } from "../core/apploader";
7
- import { packageInfoService } from "../core/packageinfoservice";
8
7
 
9
8
  registerAll({
10
9
  command: {
@@ -21,8 +20,22 @@ registerAll({
21
20
  return;
22
21
  }
23
22
 
24
- const hasPackages = packageInfoService.hasPackages();
25
- const packagesTree = packageInfoService.renderTree();
23
+ const deps = app.dependencies ?? {};
24
+ const hasPackages = Object.keys(deps).length > 0;
25
+ const packagesTree: TemplateResult = hasPackages
26
+ ? html`
27
+ <wa-tree style="--indent-guide-width: 1px;">
28
+ <wa-tree-item expanded>
29
+ <span>${app.name ?? ''}</span>
30
+ ${Object.entries(deps).map(([name, version]) => html`
31
+ <wa-tree-item>
32
+ <span>${name} <small>${version}</small></span>
33
+ </wa-tree-item>
34
+ `)}
35
+ </wa-tree-item>
36
+ </wa-tree>
37
+ `
38
+ : html``;
26
39
 
27
40
  let dialogContainer: HTMLElement | null = null;
28
41
  const getDialogContainer = (): HTMLElement => {
@@ -61,8 +74,9 @@ registerAll({
61
74
  }
62
75
  }
63
76
 
64
- const isDev = app.version === '0.0.0';
65
- const currentIndex = releases.length > 0 ? releases.findIndex(r => r.tag_name === app.version) : -1;
77
+ const appVersion = app.version ?? '0.0.0';
78
+ const isDev = appVersion === '0.0.0';
79
+ const currentIndex = releases.length > 0 ? releases.findIndex(r => r.tag_name === appVersion) : -1;
66
80
  const startIndex = currentIndex >= 0 ? currentIndex : 0;
67
81
  let currentReleaseIndex = startIndex;
68
82
 
@@ -72,7 +86,7 @@ registerAll({
72
86
  }
73
87
 
74
88
  const release = releases[index];
75
- const isCurrentVersion = release.tag_name === app.version;
89
+ const isCurrentVersion = release.tag_name === appVersion;
76
90
 
77
91
  let message = `**Version:** ${release.tag_name}`;
78
92
  if (isCurrentVersion) {
@@ -84,7 +98,7 @@ registerAll({
84
98
  message += `**Released:** ${publishDate}\n\n`;
85
99
 
86
100
  if (!isCurrentVersion) {
87
- const cleanCurrent = app.version.replace(/^v/, '');
101
+ const cleanCurrent = appVersion.replace(/^v/, '');
88
102
  const cleanRelease = release.tag_name.replace(/^v/, '');
89
103
  const currentParts = cleanCurrent.split('.').map(Number);
90
104
  const releaseParts = cleanRelease.split('.').map(Number);
@@ -126,7 +140,7 @@ registerAll({
126
140
 
127
141
  const template = html`
128
142
  <wa-dialog
129
- label="About ${app.name} - ${app.version}"
143
+ label="About ${app.name ?? ''} - ${app.version ?? '0.0.0'}"
130
144
  open
131
145
  light-dismiss
132
146
  style="--width: 600px;"
@@ -144,7 +158,7 @@ registerAll({
144
158
  margin-left: 0.5rem;
145
159
  }
146
160
  </style>
147
- <small>${app.description}</small>
161
+ <small>${app.description ?? ''}</small>
148
162
  <div class="dialog-content">
149
163
  <wa-tab-group>
150
164
  ${releases.length > 0 ? html`
@@ -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
  }
@@ -6,4 +6,4 @@ import "./log-terminal"
6
6
  import "./command"
7
7
  import "./fastviews"
8
8
  import "./language-selector"
9
- import "./app-switcher"
9
+ import "./layout-switcher"
@@ -0,0 +1,83 @@
1
+ import { html, css } from "lit";
2
+ import { customElement, state } from "lit/decorators.js";
3
+ import { LyraElement } from "../parts/element";
4
+ import { appLoaderService } from "../core/apploader";
5
+
6
+ @customElement('lyra-layout-switcher')
7
+ export class LyraLayoutSwitcher extends LyraElement {
8
+ @state()
9
+ private currentLayoutId = 'standard';
10
+
11
+ protected doBeforeUI() {
12
+ this.currentLayoutId = appLoaderService.getCurrentLayoutId();
13
+ const updateLayout = () => {
14
+ this.currentLayoutId = appLoaderService.getCurrentLayoutId();
15
+ this.requestUpdate();
16
+ };
17
+ window.addEventListener('app-loaded', updateLayout);
18
+ window.addEventListener('layout-changed', updateLayout);
19
+ return () => {
20
+ window.removeEventListener('app-loaded', updateLayout);
21
+ window.removeEventListener('layout-changed', updateLayout);
22
+ };
23
+ }
24
+
25
+ private async handleSelect(e: CustomEvent) {
26
+ const layoutId = e.detail?.item?.value;
27
+ if (!layoutId || layoutId === this.currentLayoutId) return;
28
+ try {
29
+ await appLoaderService.setPreferredLayoutId(layoutId);
30
+ } catch (err) {
31
+ console.error('Failed to switch layout:', err);
32
+ }
33
+ }
34
+
35
+ protected render() {
36
+ const layouts = appLoaderService.getRegisteredLayouts();
37
+ if (layouts.length <= 1) {
38
+ return html``;
39
+ }
40
+
41
+ const currentLayout = layouts.find((l) => l.id === this.currentLayoutId);
42
+ const layoutName = currentLayout?.name ?? this.currentLayoutId;
43
+
44
+ return html`
45
+ <wa-dropdown
46
+ placement="bottom-end"
47
+ distance="4"
48
+ size="small"
49
+ @wa-select=${this.handleSelect}>
50
+ <wa-button
51
+ slot="trigger"
52
+ appearance="plain"
53
+ size="small"
54
+ with-caret
55
+ title="Switch layout (current: ${layoutName})">
56
+ <wa-icon name="table-cells" label="Layout"></wa-icon>
57
+ </wa-button>
58
+ ${layouts.map(
59
+ (layout) => html`
60
+ <wa-dropdown-item
61
+ value="${layout.id}"
62
+ type="checkbox"
63
+ ?checked=${layout.id === this.currentLayoutId}>
64
+ ${layout.name}
65
+ </wa-dropdown-item>
66
+ `
67
+ )}
68
+ </wa-dropdown>
69
+ `;
70
+ }
71
+
72
+ static styles = css`
73
+ :host {
74
+ display: inline-block;
75
+ }
76
+ `;
77
+ }
78
+
79
+ declare global {
80
+ interface HTMLElementTagNameMap {
81
+ 'lyra-layout-switcher': LyraLayoutSwitcher;
82
+ }
83
+ }
@@ -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
@@ -0,0 +1,10 @@
1
+ import "../layouts/standard-layout";
2
+ import { contributionRegistry } from "../core/contributionregistry";
3
+ import { SYSTEM_LAYOUTS } from "../core/constants";
4
+
5
+ contributionRegistry.registerContribution(SYSTEM_LAYOUTS, {
6
+ id: "standard",
7
+ name: "Standard",
8
+ label: "Standard",
9
+ component: "lyra-standard-layout",
10
+ });
@@ -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-layout-switcher></lyra-layout-switcher>`
43
43
  } as HTMLContribution);
44
44
 
@@ -1,3 +1,4 @@
1
1
  import "./default-ui-contributions";
2
+ import "./default-layout-contributions";
2
3
  import "./marketplace-catalog-contributions";
3
4
 
@@ -2,5 +2,5 @@ import {createLogger} from "../core/logger";
2
2
 
3
3
  const logger = createLogger('MarketplaceCatalogContributions');
4
4
 
5
- logger.debug('Marketplace catalog URLs are set by the app host via applyAppHostConfig()');
5
+ logger.debug('Marketplace catalog URLs are set per app via AppDefinition.marketplaceCatalogUrls');
6
6