@eclipse-docks/core 0.7.79 → 0.7.81

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.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Human-readable label for the focused part (same logic as docks-part-name).
3
+ */
4
+ export declare function getActivePartDisplayName(): string;
5
+ //# sourceMappingURL=document-title.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-title.d.ts","sourceRoot":"","sources":["../../src/components/document-title.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAMjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AACtB,OAAO,SAAS,CAAA;AAChB,OAAO,aAAa,CAAA;AACpB,OAAO,cAAc,CAAA;AACrB,OAAO,gBAAgB,CAAA;AACvB,OAAO,WAAW,CAAA;AAClB,OAAO,aAAa,CAAA;AACpB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AACtB,OAAO,SAAS,CAAA;AAChB,OAAO,kBAAkB,CAAA;AACzB,OAAO,aAAa,CAAA;AACpB,OAAO,cAAc,CAAA;AACrB,OAAO,gBAAgB,CAAA;AACvB,OAAO,WAAW,CAAA;AAClB,OAAO,aAAa,CAAA;AACpB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mBAAmB,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { DocksElement } from '../parts/element';
2
2
  export declare class DocksPartName extends DocksElement {
3
3
  protected doBeforeUI(): void;
4
- private getPartName;
5
4
  protected render(): import('lit-html').TemplateResult<1>;
6
5
  }
7
6
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"part-name.d.ts","sourceRoot":"","sources":["../../src/components/part-name.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAc9C,qBACa,aAAc,SAAQ,YAAY;IAC3C,SAAS,CAAC,UAAU;IAMpB,OAAO,CAAC,WAAW;IASnB,SAAS,CAAC,MAAM;CAcnB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,aAAa,CAAA;KACnC;CACJ"}
1
+ {"version":3,"file":"part-name.d.ts","sourceRoot":"","sources":["../../src/components/part-name.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAe9C,qBACa,aAAc,SAAQ,YAAY;IAC3C,SAAS,CAAC,UAAU;IAMpB,SAAS,CAAC,MAAM;CAcnB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,aAAa,CAAA;KACnC;CACJ"}
package/dist/index.js CHANGED
@@ -3,5 +3,5 @@ import { i as setLogLevel, n as defaultLogger, o as rootContext, s as uiContext,
3
3
  import { C as toastWarning, S as toastInfo, _ as applyConfigNameRemaps, a as TOPIC_COMMAND_REGISTERED, b as overrideContributionTargets, c as EMPTY_SIGNALPORT, d as activeSelectionSignal, f as activeTasksSignal, g as contributionRegistry, h as TOPIC_CONTRIBUTEIONS_CHANGED, i as CommandStack, l as activeEditorSignal, m as perspectiveSwitchedSignal, n as watchSignal, o as commandRegistry, p as partDirtySignal, r as CommandRegistry, s as registerAll, t as DocksWidget, u as activePartSignal, v as contributionTargetMappingRegistry, x as toastError, y as listContributionNameRemaps } from "./widget-BgBerzhp.js";
4
4
  import { n as subscribe, r as unsubscribe, t as publish } from "./events-B_ZxkU_G.js";
5
5
  import { a as File, c as TOPIC_WORKSPACE_CHANGED, d as WorkspaceService, f as workspaceService, i as Directory, l as TOPIC_WORKSPACE_CONNECTED, o as FileContentType, p as persistenceService, r as CompositeDirectory, s as StringFile, t as FileSysDirHandleResource } from "./fs-access-D-fDaJ8V.js";
6
- import { a as DocksStandardLayout, c as createLazyLabel, i as createJsRuntime, l as i18n, n as getFrameworkConfig, o as treeNodeComparator, r as runJavaScriptCode, s as editorRegistry, t as configureFramework } from "./api-CRqV4LEn.js";
6
+ import { a as DocksStandardLayout, c as createLazyLabel, i as createJsRuntime, l as i18n, n as getFrameworkConfig, o as treeNodeComparator, r as runJavaScriptCode, s as editorRegistry, t as configureFramework } from "./api-C8Vh88fr.js";
7
7
  export { COMMAND_SAVE, CommandRegistry, CommandStack, CompositeDirectory, Directory, DocksContainer, DocksDialogContent, DocksElement, DocksPart, DocksStandardLayout, DocksWidget, EDITOR_AREA_MAIN, EMPTY_SIGNALPORT, File, FileContentType, FileSysDirHandleResource, HIDE_DOT_RESOURCE, MouseButton, PANEL_BOTTOM, SIDEBAR_AUXILIARY, SIDEBAR_MAIN, SIDEBAR_MAIN_BOTTOM, SYSTEM_LAYOUTS, SYSTEM_VIEWS, StringFile, TOOLBAR_BOTTOM, TOOLBAR_BOTTOM_CENTER, TOOLBAR_BOTTOM_END, TOOLBAR_MAIN, TOOLBAR_MAIN_CENTER, TOOLBAR_MAIN_RIGHT, TOPIC_COMMAND_REGISTERED, TOPIC_CONTRIBUTEIONS_CHANGED, TOPIC_SETTINGS_CHANGED, TOPIC_WORKSPACE_CHANGED, TOPIC_WORKSPACE_CONNECTED, WorkspaceService, activeEditorSignal, activePartSignal, activeSelectionSignal, activeTasksSignal, appLoaderService, appSettings, applyConfigNameRemaps, commandRegistry, configureFramework, confirmDialog, contributionRegistry, contributionTargetMappingRegistry, createJsRuntime, createLazyLabel, createLogger, dialogService, editorRegistry, esmShService, extensionRegistry, filebrowserDialog, getFrameworkConfig, i18n, icon, infoDialog, listContributionNameRemaps, defaultLogger as logger, navigableInfoDialog, overrideContributionTargets, parseIconSpec, partDirtySignal, persistenceService, perspectiveSwitchedSignal, promptDialog, publish, registerAll, rootContext, runJavaScriptCode, setLogLevel, subscribe, taskService, toastError, toastInfo, toastWarning, treeNodeComparator, uiContext, unsubscribe, watchSignal, workspaceService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-docks/core",
3
- "version": "0.7.79",
3
+ "version": "0.7.81",
4
4
  "description": "Eclipse Docks platform core: registries, services, parts, widgets, and API",
5
5
  "type": "module",
6
6
  "license": "EPL-2.0",
@@ -0,0 +1,59 @@
1
+ import { appLoaderService } from '../core/apploader';
2
+ import { activePartSignal } from '../core/appstate';
3
+ import { i18n } from '../core/i18n';
4
+ import { watchSignal } from '../core/signals';
5
+
6
+ const t = await i18n(import.meta.glob('./partname*.json'));
7
+
8
+ /**
9
+ * Human-readable label for the focused part (same logic as docks-part-name).
10
+ */
11
+ export function getActivePartDisplayName(): string {
12
+ const activePart = activePartSignal.get();
13
+ if (!activePart) {
14
+ return t.NO_PART;
15
+ }
16
+ return activePart.tabContribution?.label || activePart.getAttribute('id') || t.NO_PART;
17
+ }
18
+
19
+ /** Wait after the last active-part change before updating `document.title` (rapid tab switches). */
20
+ const TITLE_DEBOUNCE_MS = 250;
21
+
22
+ let titleDebounceTimer: ReturnType<typeof setTimeout> | null = null;
23
+
24
+ function applyDocumentTitle(): void {
25
+ const appName = appLoaderService.getCurrentApp()?.name ?? '';
26
+ const activePart = activePartSignal.get();
27
+ if (!activePart) {
28
+ document.title = appName;
29
+ return;
30
+ }
31
+ const part =
32
+ activePart.tabContribution?.label || activePart.getAttribute('id') || t.NO_PART;
33
+
34
+ if (appName) {
35
+ document.title = `${appName} | ${part}`;
36
+ } else {
37
+ document.title = part;
38
+ }
39
+ }
40
+
41
+ function scheduleApplyDocumentTitle(): void {
42
+ if (titleDebounceTimer !== null) {
43
+ clearTimeout(titleDebounceTimer);
44
+ }
45
+ titleDebounceTimer = setTimeout(() => {
46
+ titleDebounceTimer = null;
47
+ applyDocumentTitle();
48
+ }, TITLE_DEBOUNCE_MS);
49
+ }
50
+
51
+ watchSignal(activePartSignal, () => scheduleApplyDocumentTitle());
52
+
53
+ window.addEventListener('app-loaded', () => {
54
+ if (titleDebounceTimer !== null) {
55
+ clearTimeout(titleDebounceTimer);
56
+ titleDebounceTimer = null;
57
+ }
58
+ applyDocumentTitle();
59
+ });
@@ -1,5 +1,6 @@
1
1
  import "./filebrowser"
2
2
  import "./tasks"
3
+ import "./document-title"
3
4
  import "./part-name"
4
5
  import "./extensions"
5
6
  import "./log-terminal"
@@ -2,10 +2,11 @@ import {customElement} from "lit/decorators.js";
2
2
  import {DocksElement} from "../parts/element";
3
3
  import {html} from "lit";
4
4
  import {activePartSignal} from "../core/appstate";
5
+ import {getActivePartDisplayName} from "./document-title";
5
6
  import {contributionRegistry, HTMLContribution} from "../core/contributionregistry";
6
7
  import {TOOLBAR_BOTTOM_CENTER} from "../core/constants";
7
8
  import { icon } from '../core/icon-utils';
8
- import {i18n} from "../core/i18n";
9
+ import { i18n } from '../core/i18n';
9
10
 
10
11
  const t = await i18n(import.meta.glob('./partname*.json'));
11
12
 
@@ -21,15 +22,6 @@ export class DocksPartName extends DocksElement {
21
22
  });
22
23
  }
23
24
 
24
- private getPartName(): string {
25
- const activePart = activePartSignal.get();
26
- if (!activePart) {
27
- return t.NO_PART;
28
- }
29
-
30
- return activePart.tabContribution?.label || activePart.getAttribute('id') || t.NO_PART;
31
- }
32
-
33
25
  protected render() {
34
26
  const activePart = activePartSignal.get();
35
27
  const partIcon = activePart?.tabContribution?.icon || "box";
@@ -40,7 +32,7 @@ export class DocksPartName extends DocksElement {
40
32
  size="small"
41
33
  title="${t.ACTIVE_PART}">
42
34
  ${icon(partIcon, { label: 'Part', slot: 'start' })}
43
- ${this.getPartName()}
35
+ ${getActivePartDisplayName()}
44
36
  </wa-button>
45
37
  `;
46
38
  }