@jlab-enhanced/favorites 3.2.1 → 3.2.2
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/README.md +2 -2
- package/lib/manager.js +6 -2
- package/lib/utils.d.ts +1 -0
- package/package.json +1 -1
- package/schema/favorites.json +3 -2
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://jupyterlab-contrib.github.io/)
|
|
4
4
|
[](https://github.com/jupyterlab-contrib/jupyterlab-favorites/actions?query=workflow%3ABuild)
|
|
5
|
-
[](https://mybinder.org/v2/gh/jupyterlab-contrib/jupyterlab-favorites/
|
|
5
|
+
[](https://mybinder.org/v2/gh/jupyterlab-contrib/jupyterlab-favorites/main?urlpath=lab)
|
|
6
6
|
[](https://www.npmjs.com/package/@jlab-enhanced/favorites)
|
|
7
7
|
[](https://pypi.org/project/jupyterlab-favorites)
|
|
8
8
|
[](https://anaconda.org/conda-forge/jupyterlab-favorites)
|
|
9
9
|
|
|
10
10
|
Add the ability to save favorite folders to JupyterLab for quicker browsing.
|
|
11
11
|
|
|
12
|
-

|
|
13
13
|
|
|
14
14
|
## Requirements
|
|
15
15
|
|
package/lib/manager.js
CHANGED
|
@@ -149,8 +149,12 @@ export class FavoritesManager {
|
|
|
149
149
|
}
|
|
150
150
|
async loadFavorites() {
|
|
151
151
|
var _a;
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const setting = await this._settingsRegistry.get(SettingIDs.favorites, 'favorites');
|
|
153
|
+
const favorites = ((_a = setting.composite) !== null && _a !== void 0 ? _a : []);
|
|
154
|
+
this.favorites = favorites.map(favorite => {
|
|
155
|
+
var _a;
|
|
156
|
+
return { ...favorite, root: (_a = favorite.root) !== null && _a !== void 0 ? _a : this.serverRoot };
|
|
157
|
+
});
|
|
154
158
|
}
|
|
155
159
|
async loadShowWidget() {
|
|
156
160
|
var _a;
|
package/lib/utils.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export declare function getFavoritesIcon(filled: boolean): LabIcon;
|
|
|
8
8
|
export declare function getName(path: string): [string, string];
|
|
9
9
|
export declare function getPinnerActionDescription(showRemove: boolean): string;
|
|
10
10
|
export declare function mergePaths(root: string, path: string): string;
|
|
11
|
+
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
package/package.json
CHANGED
package/schema/favorites.json
CHANGED
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
"type": "string"
|
|
23
23
|
},
|
|
24
24
|
"root": {
|
|
25
|
-
"type": "string"
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Root path used for filtering out favourites from instances of JupyterLab launched in a different root directory. If not given the favourite will be shown if the associated file exists."
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
|
-
"required": ["
|
|
29
|
+
"required": ["path"],
|
|
29
30
|
"type": "object"
|
|
30
31
|
}
|
|
31
32
|
},
|