@internetarchive/bookreader 5.0.0-73-alpha1 → 5.0.0-74-alpha

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/bookreader",
3
- "version": "5.0.0-73-alpha1",
3
+ "version": "5.0.0-74-alpha",
4
4
  "description": "The Internet Archive BookReader.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "private": false,
27
27
  "dependencies": {
28
28
  "@internetarchive/ia-activity-indicator": "^0.0.4",
29
- "@internetarchive/ia-item-navigator": "^2.0.3-alpha2",
29
+ "@internetarchive/ia-item-navigator": "^2.0.3",
30
30
  "@internetarchive/icon-bookmark": "^1.3.4",
31
31
  "@internetarchive/icon-dl": "^1.3.4",
32
32
  "@internetarchive/icon-edit-pencil": "^1.3.4",
@@ -67,6 +67,7 @@ export class BookNavigator extends LitElement {
67
67
  * sets exit FS button (`this.fullscreenBranding1)
68
68
  * when `br.options.enableFSLogoShortcut`
69
69
  */
70
+ 'chapters',
70
71
  'fullscreen',
71
72
  'volumes',
72
73
  'search',
@@ -359,7 +360,6 @@ export class BookNavigator extends LitElement {
359
360
  }
360
361
 
361
362
  this.menuShortcuts.push(this.menuProviders[menuId]);
362
-
363
363
  this.sortMenuShortcuts();
364
364
  this.emitMenuShortcutsUpdated();
365
365
  }
@@ -76,6 +76,7 @@ BookReader.prototype._chaptersRender = function() {
76
76
  }}"
77
77
  />`,
78
78
  };
79
+ shell.addMenuShortcut('chapters');
79
80
  shell.updateMenuContents();
80
81
  this._tocEntries.forEach((tocEntry, i) => this._chaptersRenderMarker(tocEntry, i));
81
82
  };
@@ -320,10 +320,11 @@ describe('<book-navigator>', () => {
320
320
  describe('Shortcuts', () => {
321
321
  test('has specific order of menu shortcuts to show', () => {
322
322
  const el = fixtureSync(container());
323
- expect(el.shortcutOrder[0]).toEqual('fullscreen');
324
- expect(el.shortcutOrder[1]).toEqual('volumes');
325
- expect(el.shortcutOrder[2]).toEqual('search');
326
- expect(el.shortcutOrder[3]).toEqual('bookmarks');
323
+ expect(el.shortcutOrder[0]).toEqual('chapters');
324
+ expect(el.shortcutOrder[1]).toEqual('fullscreen');
325
+ expect(el.shortcutOrder[2]).toEqual('volumes');
326
+ expect(el.shortcutOrder[3]).toEqual('search');
327
+ expect(el.shortcutOrder[4]).toEqual('bookmarks');
327
328
  });
328
329
  });
329
330
 
@@ -158,11 +158,13 @@ describe("BRChaptersPlugin", () => {
158
158
  shell: {
159
159
  menuProviders: {},
160
160
  updateMenuContents: sinon.stub(),
161
+ addMenuShortcut: sinon.stub()
161
162
  }
162
163
  };
163
164
  BookReader.prototype._chaptersRender.call(fakeBR);
164
165
  expect(fakeBR.shell.menuProviders['chapters']).toBeTruthy();
165
166
  expect(fakeBR.shell.updateMenuContents.callCount).toBe(1);
167
+ expect(fakeBR.shell.addMenuShortcut.callCount).toBe(1);
166
168
  expect(fakeBR._chaptersRenderMarker.callCount).toBeGreaterThan(1);
167
169
  });
168
170
  });