@jupyterlab/apputils 4.5.0-alpha.2 → 4.5.0-alpha.3
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/lib/runningSessions.js +7 -3
- package/lib/runningSessions.js.map +1 -1
- package/package.json +11 -11
- package/src/runningSessions.tsx +17 -6
package/lib/runningSessions.js
CHANGED
|
@@ -17,9 +17,9 @@ const HALF_SPACING = 4;
|
|
|
17
17
|
*/
|
|
18
18
|
function RunningSessionsComponent(props) {
|
|
19
19
|
return (React.createElement(GroupItem, { tabIndex: 0, spacing: HALF_SPACING, onClick: props.handleClick, onKeyDown: props.handleKeyDown, style: { cursor: 'pointer' } },
|
|
20
|
-
React.createElement(GroupItem, { spacing: HALF_SPACING },
|
|
20
|
+
props.terminals > 0 ? (React.createElement(GroupItem, { spacing: HALF_SPACING },
|
|
21
21
|
React.createElement(TextItem, { source: props.terminals }),
|
|
22
|
-
React.createElement(terminalIcon.react, { verticalAlign: "middle", stylesheet: "statusBar" })),
|
|
22
|
+
React.createElement(terminalIcon.react, { verticalAlign: "middle", stylesheet: "statusBar" }))) : (React.createElement("div", null)),
|
|
23
23
|
React.createElement(GroupItem, { spacing: HALF_SPACING },
|
|
24
24
|
React.createElement(TextItem, { source: props.sessions }),
|
|
25
25
|
React.createElement(kernelIcon.react, { verticalAlign: "middle", stylesheet: "statusBar" }))));
|
|
@@ -51,7 +51,11 @@ export class RunningSessions extends VDomRenderer {
|
|
|
51
51
|
}
|
|
52
52
|
// TODO-TRANS: Should probably be handled differently.
|
|
53
53
|
// This is more localizable friendly: "Terminals: %1 | Kernels: %2"
|
|
54
|
-
|
|
54
|
+
// Generate a localized caption for the tooltip
|
|
55
|
+
const caption = this._trans.__('%1 Terminals, %2 Kernel sessions', this.model.terminals, this.model.sessions);
|
|
56
|
+
// Explicitly synchronize the title attribute with the Lumino widget's DOM
|
|
57
|
+
// This ensures the tooltip displays correctly when hovering over the widget
|
|
58
|
+
this.node.title = caption;
|
|
55
59
|
return (React.createElement(RunningSessionsComponent, { sessions: this.model.sessions, terminals: this.model.terminals, handleClick: this._handleClick, handleKeyDown: this._handleKeyDown }));
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runningSessions.js","sourceRoot":"","sources":["../src/runningSessions.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAS3D,OAAO,EAEL,cAAc,EAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB;;;;;;GAMG;AACH,SAAS,wBAAwB,CAC/B,KAAsC;IAEtC,OAAO,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,KAAK,CAAC,WAAW,EAC1B,SAAS,EAAE,KAAK,CAAC,aAAa,EAC9B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"runningSessions.js","sourceRoot":"","sources":["../src/runningSessions.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAS3D,OAAO,EAEL,cAAc,EAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB;;;;;;GAMG;AACH,SA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-alpha.
|
|
3
|
+
"version": "4.5.0-alpha.3",
|
|
4
4
|
"description": "JupyterLab - Application Utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"watch": "tsc -b --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@jupyterlab/coreutils": "^6.4.0-alpha.
|
|
48
|
-
"@jupyterlab/observables": "^5.4.0-alpha.
|
|
49
|
-
"@jupyterlab/rendermime-interfaces": "^3.12.0-alpha.
|
|
50
|
-
"@jupyterlab/services": "^7.4.0-alpha.
|
|
51
|
-
"@jupyterlab/settingregistry": "^4.4.0-alpha.
|
|
52
|
-
"@jupyterlab/statedb": "^4.4.0-alpha.
|
|
53
|
-
"@jupyterlab/statusbar": "^4.4.0-alpha.
|
|
54
|
-
"@jupyterlab/translation": "^4.4.0-alpha.
|
|
55
|
-
"@jupyterlab/ui-components": "^4.4.0-alpha.
|
|
47
|
+
"@jupyterlab/coreutils": "^6.4.0-alpha.3",
|
|
48
|
+
"@jupyterlab/observables": "^5.4.0-alpha.3",
|
|
49
|
+
"@jupyterlab/rendermime-interfaces": "^3.12.0-alpha.3",
|
|
50
|
+
"@jupyterlab/services": "^7.4.0-alpha.3",
|
|
51
|
+
"@jupyterlab/settingregistry": "^4.4.0-alpha.3",
|
|
52
|
+
"@jupyterlab/statedb": "^4.4.0-alpha.3",
|
|
53
|
+
"@jupyterlab/statusbar": "^4.4.0-alpha.3",
|
|
54
|
+
"@jupyterlab/translation": "^4.4.0-alpha.3",
|
|
55
|
+
"@jupyterlab/ui-components": "^4.4.0-alpha.3",
|
|
56
56
|
"@lumino/algorithm": "^2.0.2",
|
|
57
57
|
"@lumino/commands": "^2.3.1",
|
|
58
58
|
"@lumino/coreutils": "^2.2.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"sanitize-html": "~2.12.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@jupyterlab/testing": "^4.4.0-alpha.
|
|
70
|
+
"@jupyterlab/testing": "^4.4.0-alpha.3",
|
|
71
71
|
"@types/jest": "^29.2.0",
|
|
72
72
|
"@types/sanitize-html": "^2.11.0",
|
|
73
73
|
"jest": "^29.2.0",
|
package/src/runningSessions.tsx
CHANGED
|
@@ -45,10 +45,14 @@ function RunningSessionsComponent(
|
|
|
45
45
|
onKeyDown={props.handleKeyDown}
|
|
46
46
|
style={{ cursor: 'pointer' }}
|
|
47
47
|
>
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
{props.terminals > 0 ? (
|
|
49
|
+
<GroupItem spacing={HALF_SPACING}>
|
|
50
|
+
<TextItem source={props.terminals} />
|
|
51
|
+
<terminalIcon.react verticalAlign="middle" stylesheet="statusBar" />
|
|
52
|
+
</GroupItem>
|
|
53
|
+
) : (
|
|
54
|
+
<div></div>
|
|
55
|
+
)}
|
|
52
56
|
<GroupItem spacing={HALF_SPACING}>
|
|
53
57
|
<TextItem source={props.sessions} />
|
|
54
58
|
<kernelIcon.react verticalAlign="middle" stylesheet="statusBar" />
|
|
@@ -124,11 +128,18 @@ export class RunningSessions extends VDomRenderer<RunningSessions.Model> {
|
|
|
124
128
|
}
|
|
125
129
|
// TODO-TRANS: Should probably be handled differently.
|
|
126
130
|
// This is more localizable friendly: "Terminals: %1 | Kernels: %2"
|
|
127
|
-
|
|
131
|
+
|
|
132
|
+
// Generate a localized caption for the tooltip
|
|
133
|
+
const caption = this._trans.__(
|
|
128
134
|
'%1 Terminals, %2 Kernel sessions',
|
|
129
135
|
this.model.terminals,
|
|
130
|
-
this.model
|
|
136
|
+
this.model.sessions
|
|
131
137
|
);
|
|
138
|
+
|
|
139
|
+
// Explicitly synchronize the title attribute with the Lumino widget's DOM
|
|
140
|
+
// This ensures the tooltip displays correctly when hovering over the widget
|
|
141
|
+
this.node.title = caption;
|
|
142
|
+
|
|
132
143
|
return (
|
|
133
144
|
<RunningSessionsComponent
|
|
134
145
|
sessions={this.model.sessions}
|