@eclipse-lyra/core 0.7.6 → 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.
- package/dist/api/index.js +28 -29
- package/dist/api/services.d.ts +0 -4
- package/dist/api/services.d.ts.map +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/components/fastviews.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/{app-switcher.d.ts → layout-switcher.d.ts} +5 -4
- package/dist/components/layout-switcher.d.ts.map +1 -0
- package/dist/{standard-layout-Efok-voU.js → config-BiRvaEoO.js} +243 -454
- package/dist/config-BiRvaEoO.js.map +1 -0
- package/dist/contributions/default-layout-contributions.d.ts +1 -0
- package/dist/contributions/default-layout-contributions.d.ts.map +1 -0
- package/dist/contributions/index.d.ts.map +1 -1
- package/dist/core/apploader.d.ts +40 -30
- package/dist/core/apploader.d.ts.map +1 -1
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/contributionregistry.d.ts +9 -0
- package/dist/core/contributionregistry.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/icon-DN6fp0dg.js.map +1 -1
- package/dist/index.js +28 -29
- package/dist/parts/contextmenu.d.ts +1 -1
- package/dist/parts/index.js +1 -1
- package/dist/parts/resizable-grid.d.ts +1 -1
- package/dist/{resizable-grid-BP9wOk_x.js → resizable-grid-oWYRVx30.js} +315 -94
- package/dist/resizable-grid-oWYRVx30.js.map +1 -0
- package/dist/vite-plugin-resolve-deps.d.ts +18 -0
- package/dist/vite-plugin-resolve-deps.d.ts.map +1 -0
- package/dist/widgets/icon.d.ts +1 -1
- package/package.json +8 -1
- package/src/api/services.ts +0 -4
- package/src/api/types.ts +1 -0
- package/src/commands/version-info.ts +24 -10
- package/src/components/index.ts +1 -1
- package/src/components/layout-switcher.ts +83 -0
- package/src/contributions/default-layout-contributions.ts +10 -0
- package/src/contributions/default-ui-contributions.ts +1 -1
- package/src/contributions/index.ts +1 -0
- package/src/contributions/marketplace-catalog-contributions.ts +1 -1
- package/src/core/apploader.ts +182 -99
- package/src/core/constants.ts +1 -0
- package/src/core/contributionregistry.ts +7 -0
- package/src/core/index.ts +0 -1
- package/src/vite-env.d.ts +9 -0
- package/src/vite-plugin-resolve-deps.ts +112 -0
- package/dist/components/app-selector.d.ts +0 -17
- package/dist/components/app-selector.d.ts.map +0 -1
- package/dist/components/app-switcher.d.ts.map +0 -1
- package/dist/core/app-host-config.d.ts +0 -7
- package/dist/core/app-host-config.d.ts.map +0 -1
- package/dist/core/packageinfoservice.d.ts +0 -16
- package/dist/core/packageinfoservice.d.ts.map +0 -1
- package/dist/resizable-grid-BP9wOk_x.js.map +0 -1
- package/dist/standard-layout-Efok-voU.js.map +0 -1
- package/src/components/app-selector.ts +0 -233
- package/src/components/app-switcher.ts +0 -126
- package/src/core/app-host-config.ts +0 -23
- 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"}
|
package/dist/widgets/icon.d.ts
CHANGED
|
@@ -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.
|
|
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"
|
package/src/api/services.ts
CHANGED
|
@@ -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
|
@@ -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
|
|
25
|
-
const
|
|
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
|
|
65
|
-
const
|
|
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 ===
|
|
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 =
|
|
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`
|
package/src/components/index.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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
|
+
});
|
|
@@ -39,6 +39,6 @@ contributionRegistry.registerContribution(TOOLBAR_BOTTOM_END, {
|
|
|
39
39
|
|
|
40
40
|
contributionRegistry.registerContribution(TOOLBAR_MAIN_RIGHT, {
|
|
41
41
|
label: "App Switcher",
|
|
42
|
-
component: () => html`<lyra-
|
|
42
|
+
component: () => html`<lyra-layout-switcher></lyra-layout-switcher>`
|
|
43
43
|
} as HTMLContribution);
|
|
44
44
|
|
|
@@ -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
|
|
5
|
+
logger.debug('Marketplace catalog URLs are set per app via AppDefinition.marketplaceCatalogUrls');
|
|
6
6
|
|