@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 CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  [![Extension status](https://img.shields.io/badge/status-ready-success 'ready to be used')](https://jupyterlab-contrib.github.io/)
4
4
  [![Github Actions Status](https://github.com/jupyterlab-contrib/jupyterlab-favorites/workflows/Build/badge.svg)](https://github.com/jupyterlab-contrib/jupyterlab-favorites/actions?query=workflow%3ABuild)
5
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab-contrib/jupyterlab-favorites/master?urlpath=lab)
5
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab-contrib/jupyterlab-favorites/main?urlpath=lab)
6
6
  [![npm](https://img.shields.io/npm/v/@jlab-enhanced/favorites)](https://www.npmjs.com/package/@jlab-enhanced/favorites)
7
7
  [![PyPI](https://img.shields.io/pypi/v/jupyterlab-favorites)](https://pypi.org/project/jupyterlab-favorites)
8
8
  [![conda-forge](https://img.shields.io/conda/vn/conda-forge/jupyterlab-favorites)](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
- ![JupyterLab Favorites extension demonstration](https://raw.githubusercontent.com/jupyterlab-contrib/jupyterlab-favorites/master/jupyterlab-favorites.gif)
12
+ ![JupyterLab Favorites extension demonstration](https://raw.githubusercontent.com/jupyterlab-contrib/jupyterlab-favorites/main/jupyterlab-favorites.gif)
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 favorites = await this._settingsRegistry.get(SettingIDs.favorites, 'favorites');
153
- this.favorites = ((_a = favorites.composite) !== null && _a !== void 0 ? _a : []);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jlab-enhanced/favorites",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Add the ability to save favorite folders to JupyterLab for quicker browsing",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -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": ["root", "path"],
29
+ "required": ["path"],
29
30
  "type": "object"
30
31
  }
31
32
  },