@eclipse-docks/core 0.7.113 → 0.7.114

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 (63) hide show
  1. package/dist/api/index.js +4 -4
  2. package/dist/api/services.d.ts +1 -1
  3. package/dist/api/services.d.ts.map +1 -1
  4. package/dist/{api-BWhUdgQ_.js → api-N5AbUtyH.js} +299 -190
  5. package/dist/api-N5AbUtyH.js.map +1 -0
  6. package/dist/components/attribution.d.ts +14 -0
  7. package/dist/components/attribution.d.ts.map +1 -0
  8. package/dist/components/index.d.ts.map +1 -1
  9. package/dist/components/npm-packages.d.ts +11 -0
  10. package/dist/components/npm-packages.d.ts.map +1 -0
  11. package/dist/components/release-history.d.ts +19 -0
  12. package/dist/components/release-history.d.ts.map +1 -0
  13. package/dist/core/constants.d.ts +1 -15
  14. package/dist/core/constants.d.ts.map +1 -1
  15. package/dist/core/contribution-names.d.ts +28 -0
  16. package/dist/core/contribution-names.d.ts.map +1 -0
  17. package/dist/core/contribution-targets.d.ts +20 -0
  18. package/dist/core/contribution-targets.d.ts.map +1 -0
  19. package/dist/core/contributionregistry.d.ts +5 -0
  20. package/dist/core/contributionregistry.d.ts.map +1 -1
  21. package/dist/core/ui-ids.d.ts +1 -23
  22. package/dist/core/ui-ids.d.ts.map +1 -1
  23. package/dist/dialogs/index.d.ts +1 -0
  24. package/dist/dialogs/index.d.ts.map +1 -1
  25. package/dist/dialogs/version-info-dialog.d.ts +14 -0
  26. package/dist/dialogs/version-info-dialog.d.ts.map +1 -0
  27. package/dist/index.js +4 -4
  28. package/dist/parts/index.js +1 -1
  29. package/dist/parts/tabs.d.ts.map +1 -1
  30. package/dist/{parts-D1n2XZVE.js → parts-BvITdiV3.js} +83 -18
  31. package/dist/parts-BvITdiV3.js.map +1 -0
  32. package/dist/{widget-DbolQH0C.js → widget-DFbJNLqB.js} +2 -1
  33. package/dist/widget-DFbJNLqB.js.map +1 -0
  34. package/dist/widgets/index.js +1 -1
  35. package/dist/{widgets-SScpQQr9.js → widgets-CuO5lmjL.js} +2 -2
  36. package/dist/{widgets-SScpQQr9.js.map → widgets-CuO5lmjL.js.map} +1 -1
  37. package/package.json +1 -1
  38. package/src/api/services.ts +1 -0
  39. package/src/commands/global.ts +2 -2
  40. package/src/commands/open-view-as-editor.ts +1 -1
  41. package/src/commands/version-info.ts +10 -219
  42. package/src/components/attribution.ts +93 -0
  43. package/src/components/index.ts +4 -1
  44. package/src/components/npm-packages.ts +53 -0
  45. package/src/components/part-name.ts +2 -2
  46. package/src/components/release-history.ts +177 -0
  47. package/src/components/tasks.ts +2 -2
  48. package/src/contributions/default-layout-contributions.ts +1 -1
  49. package/src/contributions/default-ui-contributions.ts +49 -2
  50. package/src/core/apploader.ts +1 -1
  51. package/src/core/constants.ts +2 -22
  52. package/src/core/contribution-names.ts +34 -0
  53. package/src/core/contribution-targets.ts +24 -0
  54. package/src/core/contributionregistry.ts +6 -0
  55. package/src/core/editorregistry.ts +1 -1
  56. package/src/core/ui-ids.ts +1 -29
  57. package/src/dialogs/index.ts +2 -1
  58. package/src/dialogs/version-info-dialog.ts +82 -0
  59. package/src/layouts/standard-layout.ts +1 -1
  60. package/src/parts/tabs.ts +2 -1
  61. package/dist/api-BWhUdgQ_.js.map +0 -1
  62. package/dist/parts-D1n2XZVE.js.map +0 -1
  63. package/dist/widget-DbolQH0C.js.map +0 -1
@@ -0,0 +1,177 @@
1
+ import { html, css } from "lit";
2
+ import { customElement, state } from "lit/decorators.js";
3
+ import { unsafeHTML } from "lit/directives/unsafe-html.js";
4
+ import { marked } from "marked";
5
+ import { DocksPart } from "../parts/part";
6
+ import { appLoaderService, type ReleaseEntry } from "../core/apploader";
7
+ import { createLogger } from "../core/logger";
8
+
9
+ const logger = createLogger("ReleaseHistory");
10
+
11
+ async function loadReleases(
12
+ releaseHistory?: ReleaseEntry[] | (() => ReleaseEntry[] | Promise<ReleaseEntry[]>),
13
+ ): Promise<ReleaseEntry[]> {
14
+ if (!releaseHistory) return [];
15
+ if (typeof releaseHistory !== "function") return releaseHistory;
16
+
17
+ try {
18
+ return await releaseHistory();
19
+ } catch (error) {
20
+ logger.error(
21
+ `Failed to load release history from app: ${error instanceof Error ? error.message : String(error)}`,
22
+ );
23
+ return [];
24
+ }
25
+ }
26
+
27
+ function semverEqual(a: string, b: string): boolean {
28
+ return a.replace(/^v/i, "") === b.replace(/^v/i, "");
29
+ }
30
+
31
+ function isNewerThan(releaseTag: string, currentVersion: string): boolean {
32
+ const currentParts = currentVersion.replace(/^v/i, "").split(".").map(Number);
33
+ const releaseParts = releaseTag.replace(/^v/i, "").split(".").map(Number);
34
+ for (let i = 0; i < Math.max(currentParts.length, releaseParts.length); i++) {
35
+ const current = currentParts[i] || 0;
36
+ const releasePart = releaseParts[i] || 0;
37
+ if (releasePart > current) return true;
38
+ if (releasePart < current) return false;
39
+ }
40
+ return false;
41
+ }
42
+
43
+ @customElement("docks-release-history")
44
+ export class DocksReleaseHistory extends DocksPart {
45
+ protected scrollMode: "scroller" | "native" | "none" = "none";
46
+
47
+ @state()
48
+ private appVersion = "0.0.0";
49
+
50
+ @state()
51
+ private releases: ReleaseEntry[] = [];
52
+
53
+ @state()
54
+ private currentReleaseIndex = 0;
55
+
56
+ static styles = [
57
+ css`
58
+ .release-panel {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 0.5rem;
62
+ height: 100%;
63
+ padding: 0.75rem;
64
+ box-sizing: border-box;
65
+ }
66
+
67
+ .release-panel wa-scroller {
68
+ flex: 1;
69
+ min-height: 0;
70
+ }
71
+
72
+ .release-nav {
73
+ display: flex;
74
+ gap: 0.5rem;
75
+ }
76
+ `,
77
+ ];
78
+
79
+ protected doInitUI() {
80
+ void this.load();
81
+ }
82
+
83
+ private async load() {
84
+ const app = appLoaderService.getCurrentApp();
85
+ this.appVersion = app?.version ?? "0.0.0";
86
+ this.releases = await loadReleases(app?.releaseHistory);
87
+ const currentIndex = this.releases.findIndex((release) =>
88
+ semverEqual(release.tag_name, this.appVersion),
89
+ );
90
+ this.currentReleaseIndex = currentIndex >= 0 ? currentIndex : 0;
91
+ }
92
+
93
+ private showOlder() {
94
+ if (this.currentReleaseIndex < this.releases.length - 1) {
95
+ this.currentReleaseIndex += 1;
96
+ }
97
+ }
98
+
99
+ private showNewer() {
100
+ if (this.currentReleaseIndex > 0) {
101
+ this.currentReleaseIndex -= 1;
102
+ }
103
+ }
104
+
105
+ protected renderContent() {
106
+ const release = this.releases[this.currentReleaseIndex];
107
+ if (!release) {
108
+ return html`<div class="release-panel">No release history available.</div>`;
109
+ }
110
+
111
+ const isCurrent = semverEqual(release.tag_name, this.appVersion);
112
+ const showUpdateHint = !isCurrent && isNewerThan(release.tag_name, this.appVersion);
113
+ const atOldest = this.currentReleaseIndex === this.releases.length - 1;
114
+ const atNewest = this.currentReleaseIndex === 0;
115
+ const bodyHtml = release.body
116
+ ? (marked.parse(release.body, { async: false }) as string)
117
+ : "";
118
+
119
+ return html`
120
+ <div class="release-panel">
121
+ <p>
122
+ <strong>Version:</strong> ${release.tag_name}${isCurrent ? " (Current)" : ""}
123
+ </p>
124
+ <p>
125
+ <strong>Released:</strong>
126
+ <wa-format-date
127
+ .date=${release.published_at}
128
+ month="short"
129
+ day="numeric"
130
+ year="numeric"
131
+ ></wa-format-date>
132
+ </p>
133
+ ${showUpdateHint
134
+ ? html`
135
+ <wa-callout variant="warning">
136
+ <wa-icon slot="icon" name="triangle-exclamation"></wa-icon>
137
+ Update available — reload the page to update
138
+ </wa-callout>
139
+ `
140
+ : ""}
141
+ <wa-scroller orientation="vertical">
142
+ ${bodyHtml
143
+ ? html`<div style="white-space: normal;">${unsafeHTML(bodyHtml)}</div>`
144
+ : ""}
145
+ </wa-scroller>
146
+ ${this.releases.length > 1
147
+ ? html`
148
+ <div class="release-nav">
149
+ <wa-button-group>
150
+ <wa-button
151
+ variant="default"
152
+ ?disabled=${atOldest}
153
+ @click=${() => this.showOlder()}
154
+ >
155
+ ← Previous
156
+ </wa-button>
157
+ <wa-button
158
+ variant="default"
159
+ ?disabled=${atNewest}
160
+ @click=${() => this.showNewer()}
161
+ >
162
+ Next →
163
+ </wa-button>
164
+ </wa-button-group>
165
+ </div>
166
+ `
167
+ : ""}
168
+ </div>
169
+ `;
170
+ }
171
+ }
172
+
173
+ declare global {
174
+ interface HTMLElementTagNameMap {
175
+ "docks-release-history": DocksReleaseHistory;
176
+ }
177
+ }
@@ -1,6 +1,6 @@
1
1
  import {contributionRegistry} from "../core/contributionregistry";
2
- import {TOOLBAR_BOTTOM_CENTER} from "../core/constants";
3
- import {TOOLBAR_TASKS} from "../core/ui-ids";
2
+ import {TOOLBAR_BOTTOM_CENTER} from "../core/contribution-targets";
3
+ import {TOOLBAR_TASKS} from "../core/contribution-names";
4
4
  import {customElement} from "lit/decorators.js";
5
5
  import { DocksElement } from "../parts/element";
6
6
  import {css, html, render} from "lit";
@@ -1,6 +1,6 @@
1
1
  import "../layouts/standard-layout";
2
2
  import { contributionRegistry } from "../core/contributionregistry";
3
- import { SYSTEM_LAYOUTS } from "../core/constants";
3
+ import { SYSTEM_LAYOUTS } from "../core/contribution-targets";
4
4
 
5
5
  const standardLayouts: Array<{
6
6
  id: string;
@@ -1,13 +1,19 @@
1
1
  import { html } from "lit";
2
2
  import { contributionRegistry, type HTMLContribution } from "../core/contributionregistry";
3
3
  import {
4
+ ABOUT_TABS,
4
5
  PANEL_BOTTOM,
5
6
  SIDEBAR_MAIN,
6
7
  SIDEBAR_MAIN_TOOLBAR,
8
+ SYSTEM_ATTRIBUTIONS,
7
9
  TOOLBAR_BOTTOM_END,
8
10
  TOOLBAR_MAIN_RIGHT
9
- } from "../core/constants";
11
+ } from "../core/contribution-targets";
10
12
  import {
13
+ ABOUT_TAB_ATTRIBUTIONS,
14
+ ABOUT_TAB_PACKAGES,
15
+ ABOUT_TAB_RELEASE,
16
+ ATTRIBUTION_ECLIPSE_DOCKS,
11
17
  VIEW_FILEBROWSER,
12
18
  VIEW_LOG_TERMINAL,
13
19
  TOOLBAR_LAYOUT_SWITCHER,
@@ -15,7 +21,7 @@ import {
15
21
  TOOLBAR_INFO,
16
22
  TOOLBAR_LANGUAGE_SELECTOR,
17
23
  SIDEBAR_TOOLBAR_EXTENSIONS
18
- } from "../core/ui-ids";
24
+ } from "../core/contribution-names";
19
25
 
20
26
  contributionRegistry.registerContribution(SIDEBAR_MAIN, {
21
27
  name: VIEW_FILEBROWSER,
@@ -31,6 +37,47 @@ contributionRegistry.registerContribution(PANEL_BOTTOM, {
31
37
  component: (id: string) => html`<docks-log-terminal id="${id}"></docks-log-terminal>`
32
38
  });
33
39
 
40
+ contributionRegistry.registerContribution(ABOUT_TABS, {
41
+ name: ABOUT_TAB_ATTRIBUTIONS,
42
+ label: "Attributions",
43
+ icon: "copyright",
44
+ ranking: 100,
45
+ toolbar: false,
46
+ contextMenu: false,
47
+ component: (id: string) => html`<docks-attribution id="${id}"></docks-attribution>`
48
+ });
49
+
50
+ contributionRegistry.registerContribution(ABOUT_TABS, {
51
+ name: ABOUT_TAB_RELEASE,
52
+ label: "Release History",
53
+ icon: "clock-rotate-left",
54
+ ranking: 50,
55
+ toolbar: false,
56
+ contextMenu: false,
57
+ component: (id: string) => html`<docks-release-history id="${id}"></docks-release-history>`
58
+ });
59
+
60
+ contributionRegistry.registerContribution(ABOUT_TABS, {
61
+ name: ABOUT_TAB_PACKAGES,
62
+ label: "NPM Packages",
63
+ icon: "cubes",
64
+ ranking: 0,
65
+ toolbar: false,
66
+ contextMenu: false,
67
+ component: (id: string) => html`<docks-npm-packages id="${id}"></docks-npm-packages>`
68
+ });
69
+
70
+ contributionRegistry.registerContribution(SYSTEM_ATTRIBUTIONS, {
71
+ name: ATTRIBUTION_ECLIPSE_DOCKS,
72
+ label: "Eclipse Docks",
73
+ component: () => html`
74
+ <p>
75
+ Eclipse Docks is made available under the
76
+ <a href="https://www.eclipse.org/legal/epl-2.0" target="_blank" rel="noopener noreferrer">Eclipse Public License 2.0</a>.
77
+ </p>
78
+ `
79
+ } as HTMLContribution);
80
+
34
81
  contributionRegistry.registerContribution(TOOLBAR_BOTTOM_END, {
35
82
  name: TOOLBAR_INFO,
36
83
  label: "Info",
@@ -17,7 +17,7 @@ import { rootContext } from "./di";
17
17
  import { createLogger } from "./logger";
18
18
  import { extensionRegistry, Extension } from "./extensionregistry";
19
19
  import { contributionRegistry, Contribution, LayoutContribution, TOPIC_CONTRIBUTEIONS_CHANGED } from "./contributionregistry";
20
- import { SYSTEM_LAYOUTS } from "./constants";
20
+ import { SYSTEM_LAYOUTS } from "./contribution-targets";
21
21
  import { appSettings } from "./settingsservice";
22
22
  import { marketplaceRegistry } from "./marketplaceregistry";
23
23
  import { contributionTargetMappingRegistry, type ContributionNameRemap } from "./contribution-mapping";
@@ -1,33 +1,13 @@
1
- // Toolbars
2
- export const TOOLBAR_MAIN = "app-toolbars-main"
3
- export const TOOLBAR_MAIN_RIGHT = "app-toolbars-main-right"
4
- export const TOOLBAR_MAIN_CENTER = "app-toolbars-main-center"
5
- export const TOOLBAR_BOTTOM = "app-toolbars-bottom"
6
- export const TOOLBAR_BOTTOM_CENTER = "app-toolbars-bottom-center"
7
- export const TOOLBAR_BOTTOM_END = "app-toolbars-bottom-end"
8
-
9
- /** Commands/HTML at the end of the main sidebar activity rail (wa-tab-group nav slot). */
10
- export const SIDEBAR_MAIN_TOOLBAR = "sidebar-main-toolbar"
11
-
12
- export const SYSTEM_VIEWS = "system-views"
13
- export const SYSTEM_LAYOUTS = "system.layouts"
14
-
15
- // VS Code-style layout containers
16
- export const EDITOR_AREA_MAIN = "editor-area-main"
17
- export const SIDEBAR_MAIN = "sidebar-main"
18
- export const SIDEBAR_MAIN_BOTTOM = "sidebar-main-bottom"
19
- export const SIDEBAR_AUXILIARY = "sidebar-auxiliary"
20
- export const PANEL_BOTTOM = "panel-bottom"
1
+ export * from './contribution-targets';
21
2
 
22
3
  export const COMMAND_SAVE = "command-save"
23
4
 
24
5
  export const HIDE_DOT_RESOURCE = false
25
6
 
26
- // Mouse button constants
27
7
  export enum MouseButton {
28
8
  LEFT = 0,
29
9
  MIDDLE = 1,
30
10
  RIGHT = 2,
31
11
  BACK = 3,
32
12
  FORWARD = 4
33
- }
13
+ }
@@ -0,0 +1,34 @@
1
+ export const VIEW_FILEBROWSER = "view.filebrowser";
2
+ export const VIEW_LOG_TERMINAL = "view.logTerminal";
3
+
4
+ export const TOOLBAR_INFO = "toolbar.info";
5
+ export const TOOLBAR_FAST_VIEWS = "toolbar.fastViews";
6
+ export const TOOLBAR_LANGUAGE_SELECTOR = "toolbar.languageSelector";
7
+ /** Main toolbar (right): layout picker (`docks-layout-switcher`). */
8
+ export const TOOLBAR_LAYOUT_SWITCHER = "toolbar.layoutSwitcher";
9
+ /** Main toolbar (right): dark/light theme toggle (`switch_theme`). */
10
+ export const TOOLBAR_THEME_SWITCHER = "toolbar.themeSwitcher";
11
+ /** Main toolbar (right): document fullscreen toggle (`fullscreen`). */
12
+ export const TOOLBAR_FULLSCREEN = "toolbar.fullscreen";
13
+ /** Bottom-center toolbar: focused part title / active part indicator (`docks-part-name`). */
14
+ export const TOOLBAR_ACTIVE_PART_NAME = "toolbar.activePartName";
15
+ /** Bottom-center toolbar: background tasks / progress (`docks-tasks`). */
16
+ export const TOOLBAR_TASKS = "toolbar.tasks";
17
+
18
+ /** Main sidebar header toolbar: open extensions (`open_extensions` command). */
19
+ export const SIDEBAR_TOOLBAR_EXTENSIONS = "sidebar.toolbar.extensions";
20
+
21
+ /** Default file-type → icon mappings on `system.icons`. */
22
+ export const SYSTEM_DEFAULT_FILE_ICONS = "system.icons.default";
23
+
24
+ export const ABOUT_TAB_RELEASE = "about.tab.release";
25
+ export const ABOUT_TAB_PACKAGES = "about.tab.packages";
26
+ export const ABOUT_TAB_ATTRIBUTIONS = "about.tab.attributions";
27
+
28
+ export const ATTRIBUTION_ECLIPSE_DOCKS = "attribution.eclipse-docks";
29
+
30
+ export const TOOLBAR_FILEBROWSER_RENAME = "toolbar.filebrowser.rename";
31
+ export const TOOLBAR_FILEBROWSER_DELETE = "toolbar.filebrowser.delete";
32
+
33
+ export const CTXMENU_FILEBROWSER_RENAME = "contextmenu.filebrowser.rename";
34
+ export const CTXMENU_FILEBROWSER_DELETE = "contextmenu.filebrowser.delete";
@@ -0,0 +1,24 @@
1
+ export const TOOLBAR_MAIN = "app-toolbars-main"
2
+ export const TOOLBAR_MAIN_RIGHT = "app-toolbars-main-right"
3
+ export const TOOLBAR_MAIN_CENTER = "app-toolbars-main-center"
4
+ export const TOOLBAR_BOTTOM = "app-toolbars-bottom"
5
+ export const TOOLBAR_BOTTOM_CENTER = "app-toolbars-bottom-center"
6
+ export const TOOLBAR_BOTTOM_END = "app-toolbars-bottom-end"
7
+
8
+ /** Commands/HTML at the end of the main sidebar activity rail (wa-tab-group nav slot). */
9
+ export const SIDEBAR_MAIN_TOOLBAR = "sidebar-main-toolbar"
10
+
11
+ export const SYSTEM_VIEWS = "system-views"
12
+ export const SYSTEM_LAYOUTS = "system.layouts"
13
+
14
+ /** HTML attributions collected by `docks-attribution`. */
15
+ export const SYSTEM_ATTRIBUTIONS = "system.attributions"
16
+
17
+ /** About dialog tabs (`TabContribution` collected by `docks-tabs`). */
18
+ export const ABOUT_TABS = "about.tabs"
19
+
20
+ export const EDITOR_AREA_MAIN = "editor-area-main"
21
+ export const SIDEBAR_MAIN = "sidebar-main"
22
+ export const SIDEBAR_MAIN_BOTTOM = "sidebar-main-bottom"
23
+ export const SIDEBAR_AUXILIARY = "sidebar-auxiliary"
24
+ export const PANEL_BOTTOM = "panel-bottom"
@@ -20,6 +20,11 @@ export interface Contribution {
20
20
  showLabel?: boolean;
21
21
  icon?: string;
22
22
  slot?: string;
23
+ /**
24
+ * Higher ranking appears first in `getContributions`. Defaults to 0.
25
+ * Equal ranks keep registration order.
26
+ */
27
+ ranking?: number;
23
28
  disabled?: (() => boolean) | Signal.Computed<boolean>;
24
29
  /** When false, the contribution is not rendered (default: shown). Honored where supported in UI. */
25
30
  visible?: (() => boolean) | Signal.Computed<boolean>;
@@ -135,6 +140,7 @@ class ContributionRegistry {
135
140
  }
136
141
  }
137
142
  }
143
+ results.sort((a, b) => (b.ranking ?? 0) - (a.ranking ?? 0));
138
144
  if (results.length === 0) {
139
145
  this.getOrCreateSlot(target);
140
146
  }
@@ -1,4 +1,4 @@
1
- import { EDITOR_AREA_MAIN } from "./constants";
1
+ import { EDITOR_AREA_MAIN } from "./contribution-targets";
2
2
  import { subscribe } from "./events";
3
3
  import { File, TOPIC_WORKSPACE_CONNECTED } from "./filesys";
4
4
  import { DocksTabs } from "../parts/tabs";
@@ -1,29 +1 @@
1
- export const VIEW_FILEBROWSER = "view.filebrowser";
2
- export const VIEW_LOG_TERMINAL = "view.logTerminal";
3
-
4
- export const TOOLBAR_INFO = "toolbar.info";
5
- export const TOOLBAR_FAST_VIEWS = "toolbar.fastViews";
6
- export const TOOLBAR_LANGUAGE_SELECTOR = "toolbar.languageSelector";
7
- /** Main toolbar (right): layout picker (`docks-layout-switcher`). */
8
- export const TOOLBAR_LAYOUT_SWITCHER = "toolbar.layoutSwitcher";
9
- /** Main toolbar (right): dark/light theme toggle (`switch_theme`). */
10
- export const TOOLBAR_THEME_SWITCHER = "toolbar.themeSwitcher";
11
- /** Main toolbar (right): document fullscreen toggle (`fullscreen`). */
12
- export const TOOLBAR_FULLSCREEN = "toolbar.fullscreen";
13
- /** Bottom-center toolbar: focused part title / active part indicator (`docks-part-name`). */
14
- export const TOOLBAR_ACTIVE_PART_NAME = "toolbar.activePartName";
15
- /** Bottom-center toolbar: background tasks / progress (`docks-tasks`). */
16
- export const TOOLBAR_TASKS = "toolbar.tasks";
17
-
18
- /** Main sidebar header toolbar: open extensions (`open_extensions` command). */
19
- export const SIDEBAR_TOOLBAR_EXTENSIONS = "sidebar.toolbar.extensions";
20
-
21
- /** Default file-type → icon mappings on `system.icons`. */
22
- export const SYSTEM_DEFAULT_FILE_ICONS = "system.icons.default";
23
-
24
- export const TOOLBAR_FILEBROWSER_RENAME = "toolbar.filebrowser.rename";
25
- export const TOOLBAR_FILEBROWSER_DELETE = "toolbar.filebrowser.delete";
26
-
27
- export const CTXMENU_FILEBROWSER_RENAME = "contextmenu.filebrowser.rename";
28
- export const CTXMENU_FILEBROWSER_DELETE = "contextmenu.filebrowser.delete";
29
-
1
+ export * from './contribution-names';
@@ -14,4 +14,5 @@ export {
14
14
  filebrowserDialog,
15
15
  type FilebrowserDialogMode,
16
16
  type FilebrowserDialogState,
17
- } from './filebrowser-dialog';
17
+ } from './filebrowser-dialog';
18
+ export { versionInfoDialog } from './version-info-dialog';
@@ -0,0 +1,82 @@
1
+ import { html, css } from "lit";
2
+ import { customElement } from "lit/decorators.js";
3
+ import type { PropertyValues } from "lit";
4
+ import { DocksDialogContent } from "../parts/dialog-content";
5
+ import { contributionRegistry } from "../core/contributionregistry";
6
+ import {
7
+ DIALOG_CONTRIBUTION_TARGET,
8
+ CLOSE_BUTTON,
9
+ type DialogContribution,
10
+ type DialogButton,
11
+ dialogService,
12
+ } from "../core/dialogservice";
13
+ import { ABOUT_TABS } from "../core/contribution-targets";
14
+ import { appLoaderService } from "../core/apploader";
15
+
16
+ const CLOSE_PRIMARY: DialogButton = { ...CLOSE_BUTTON, variant: "primary" };
17
+
18
+ @customElement("docks-version-info-dialog-content")
19
+ export class DocksVersionInfoDialogContent extends DocksDialogContent {
20
+ static styles = [
21
+ ...DocksDialogContent.styles,
22
+ css`
23
+ :host {
24
+ display: block;
25
+ }
26
+
27
+ .dialog-body {
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 0.75rem;
31
+ min-width: 32rem;
32
+ height: 600px;
33
+ }
34
+
35
+ .dialog-body docks-tabs {
36
+ flex: 1;
37
+ min-height: 0;
38
+ }
39
+ `,
40
+ ];
41
+
42
+ protected firstUpdated(changed: PropertyValues) {
43
+ super.firstUpdated(changed);
44
+ const dialog = this.closest("wa-dialog");
45
+ if (dialog) {
46
+ dialog.style.setProperty("--width", "600px");
47
+ dialog.setAttribute("light-dismiss", "");
48
+ }
49
+ }
50
+
51
+ render() {
52
+ const app = appLoaderService.getCurrentApp();
53
+
54
+ return html`
55
+ <div class="dialog-body">
56
+ ${app?.description ? html`<small>${app.description}</small>` : ""}
57
+ <docks-tabs id=${ABOUT_TABS}></docks-tabs>
58
+ </div>
59
+ `;
60
+ }
61
+ }
62
+
63
+ declare global {
64
+ interface HTMLElementTagNameMap {
65
+ "docks-version-info-dialog-content": DocksVersionInfoDialogContent;
66
+ }
67
+ }
68
+
69
+ contributionRegistry.registerContribution<DialogContribution>(DIALOG_CONTRIBUTION_TARGET, {
70
+ id: "version-info",
71
+ label: "About",
72
+ buttons: [CLOSE_PRIMARY],
73
+ component: () => html`<docks-version-info-dialog-content></docks-version-info-dialog-content>`,
74
+ onButton: async () => true,
75
+ });
76
+
77
+ export function versionInfoDialog(): Promise<void> {
78
+ const app = appLoaderService.getCurrentApp();
79
+ return dialogService.open("version-info", {
80
+ label: `About ${app?.name ?? ""} - ${app?.version ?? "0.0.0"}`,
81
+ });
82
+ }
@@ -13,7 +13,7 @@ import {
13
13
  TOOLBAR_BOTTOM,
14
14
  TOOLBAR_BOTTOM_CENTER,
15
15
  TOOLBAR_BOTTOM_END
16
- } from "../core/constants";
16
+ } from "../core/contribution-targets";
17
17
  import {DocksContainer} from "../parts/container";
18
18
 
19
19
  @customElement('docks-standard-layout')
package/src/parts/tabs.ts CHANGED
@@ -9,7 +9,8 @@ import {createRef, ref} from "lit/directives/ref.js";
9
9
  import { icon } from "../core/icon-utils";
10
10
  import {subscribe} from "../core/events";
11
11
  import { DocksPart } from "./part";
12
- import {MouseButton, EDITOR_AREA_MAIN} from "../core/constants";
12
+ import { EDITOR_AREA_MAIN } from "../core/contribution-targets";
13
+ import { MouseButton } from "../core/constants";
13
14
  import {activePartSignal, activeEditorSignal, partDirtySignal} from "../core/appstate";
14
15
  import {watchSignal} from "../core/signals";
15
16
  import {confirmDialog} from "../dialogs";