@jupyterlab/statusbar
Advanced tools
Comparing version 4.1.0-alpha.4 to 4.1.0-beta.0
@@ -22,2 +22,3 @@ import { IDisposable } from '@lumino/disposable'; | ||
dispose(): void; | ||
private _isWindowNarrow; | ||
/** | ||
@@ -24,0 +25,0 @@ * Handle an 'update-request' message to the status bar. |
@@ -12,2 +12,9 @@ // Copyright (c) Jupyter Development Team. | ||
super(); | ||
this._isWindowNarrow = () => { | ||
// The value for 630px was chosen by trial and error. | ||
// When the screen width drops below 630px, there is no | ||
// longer enough space for all the items in the status bar | ||
// (with notebook open), and items become clipped. | ||
return window.innerWidth <= 630; | ||
}; | ||
this._leftRankItems = []; | ||
@@ -45,3 +52,3 @@ this._rightRankItems = []; | ||
}; | ||
const { align, item, rank } = fullStatusItem; | ||
const { align, item, rank, priority } = fullStatusItem; | ||
// Connect the activeStateChanged signal to refreshing the status item, | ||
@@ -55,3 +62,3 @@ // if the signal was provided. | ||
} | ||
const rankItem = { id, rank }; | ||
const rankItem = { id, rank, priority }; | ||
fullStatusItem.item.addClass('jp-StatusBar-Item'); | ||
@@ -117,3 +124,4 @@ this._statusItems[id] = fullStatusItem; | ||
const statusItem = this._statusItems[id]; | ||
if (statusItem.isActive()) { | ||
if (statusItem.isActive() && | ||
!(statusItem.priority === 0 && this._isWindowNarrow())) { | ||
statusItem.item.show(); | ||
@@ -143,2 +151,3 @@ statusItem.item.update(); | ||
rank: 0, | ||
priority: 0, | ||
isActive: () => true, | ||
@@ -145,0 +154,0 @@ activeStateChanged: undefined |
@@ -45,2 +45,6 @@ import { Token } from '@lumino/coreutils'; | ||
/** | ||
* Displaying Items based on zoom priority -- higher zoom priority gets prioritised when zoom levels increase | ||
*/ | ||
priority?: number; | ||
/** | ||
* Whether the item is shown or hidden. | ||
@@ -47,0 +51,0 @@ */ |
{ | ||
"name": "@jupyterlab/statusbar", | ||
"version": "4.1.0-alpha.4", | ||
"version": "4.1.0-beta.0", | ||
"description": "JupyterLab statusbar package.", | ||
@@ -40,3 +40,3 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/ui-components": "^4.1.0-alpha.4", | ||
"@jupyterlab/ui-components": "^4.1.0-beta.0", | ||
"@lumino/algorithm": "^2.0.1", | ||
@@ -51,3 +51,3 @@ "@lumino/coreutils": "^2.1.2", | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.1.0-alpha.4", | ||
"@jupyterlab/testing": "^4.1.0-beta.0", | ||
"@types/jest": "^29.2.0", | ||
@@ -54,0 +54,0 @@ "jest": "^29.2.0", |
@@ -54,3 +54,3 @@ // Copyright (c) Jupyter Development Team. | ||
} as Private.IFullItem; | ||
const { align, item, rank } = fullStatusItem; | ||
const { align, item, rank, priority } = fullStatusItem; | ||
@@ -66,3 +66,3 @@ // Connect the activeStateChanged signal to refreshing the status item, | ||
const rankItem = { id, rank }; | ||
const rankItem = { id, rank, priority }; | ||
@@ -117,2 +117,10 @@ fullStatusItem.item.addClass('jp-StatusBar-Item'); | ||
private _isWindowNarrow = () => { | ||
// The value for 630px was chosen by trial and error. | ||
// When the screen width drops below 630px, there is no | ||
// longer enough space for all the items in the status bar | ||
// (with notebook open), and items become clipped. | ||
return window.innerWidth <= 630; | ||
}; | ||
/** | ||
@@ -135,3 +143,6 @@ * Handle an 'update-request' message to the status bar. | ||
const statusItem = this._statusItems[id]; | ||
if (statusItem.isActive()) { | ||
if ( | ||
statusItem.isActive() && | ||
!(statusItem.priority === 0 && this._isWindowNarrow()) | ||
) { | ||
statusItem.item.show(); | ||
@@ -170,2 +181,3 @@ statusItem.item.update(); | ||
rank: 0, | ||
priority: 0, | ||
isActive: () => true, | ||
@@ -181,5 +193,6 @@ activeStateChanged: undefined | ||
rank: number; | ||
priority?: number; | ||
} | ||
export type DefaultKeys = 'align' | 'rank' | 'isActive'; | ||
export type DefaultKeys = 'align' | 'rank' | 'isActive' | 'priority'; | ||
@@ -186,0 +199,0 @@ /** |
@@ -59,2 +59,7 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Displaying Items based on zoom priority -- higher zoom priority gets prioritised when zoom levels increase | ||
*/ | ||
priority?: number; | ||
/** | ||
* Whether the item is shown or hidden. | ||
@@ -61,0 +66,0 @@ */ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59074
1510