@internetarchive/bookreader 5.0.0-70-a2 → 5.0.0-70-a3
Sign up to get free protection for your applications and to get access to all the features.
- package/BookReader/BookReader.js +1 -1
- package/BookReader/ia-bookreader-bundle.js +11 -8
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReaderDemo/demo-internetarchive.html +1 -1
- package/package.json +2 -2
- package/src/BookNavigator/book-navigator.js +2 -2
- package/src/BookNavigator/sharing.js +4 -4
- package/src/BookNavigator/{volumes/volumes-provider.js → viewable-files.js} +7 -7
- package/src/ia-bookreader/ia-bookreader.js +1 -1
- package/tests/jest/BookNavigator/book-navigator.test.js +2 -2
- package/tests/jest/BookNavigator/sharing/sharing-provider.test.js +1 -1
- package/tests/jest/BookNavigator/volumes/volumes-provider.test.js +2 -2
@@ -43,7 +43,7 @@
|
|
43
43
|
<body>
|
44
44
|
<section class="theater" style="width: 100%; overflow: hidden; background-color: black;">
|
45
45
|
<ia-bookreader
|
46
|
-
baseHost="
|
46
|
+
baseHost="archive.org"
|
47
47
|
>
|
48
48
|
<div id="IABookReaderWrapper" slot="main">
|
49
49
|
<div id="BookReader" class="BookReader"></div>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@internetarchive/bookreader",
|
3
|
-
"version": "5.0.0-70-
|
3
|
+
"version": "5.0.0-70-a3",
|
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.
|
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",
|
@@ -8,7 +8,7 @@ import DownloadProvider from './downloads/downloads-provider.js';
|
|
8
8
|
import VisualAdjustmentProvider from './visual-adjustments/visual-adjustments-provider.js';
|
9
9
|
import BookmarksProvider from './bookmarks/bookmarks-provider.js';
|
10
10
|
import SharingProvider from './sharing.js';
|
11
|
-
import
|
11
|
+
import ViewableFilesProvider from './viewable-files.js';
|
12
12
|
import iaLogo from './assets/ia-logo.js';
|
13
13
|
|
14
14
|
const events = {
|
@@ -221,7 +221,7 @@ export class BookNavigator extends LitElement {
|
|
221
221
|
|
222
222
|
// add shortcut for volumes if multipleBooksList exists
|
223
223
|
if (this.bookreader.options.enableMultipleBooks) {
|
224
|
-
providers.volumes = new
|
224
|
+
providers.volumes = new ViewableFilesProvider({
|
225
225
|
...this.baseProviderConfig,
|
226
226
|
onProviderChange: (brInstance = null, volumesUpdates = {}) => {
|
227
227
|
if (brInstance) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { html } from 'lit';
|
2
|
-
import { iauxShareIcon } from '@internetarchive/ia-item-navigator';
|
3
|
-
import '@internetarchive/ia-item-navigator';
|
2
|
+
import { iauxShareIcon } from '@internetarchive/ia-item-navigator/dist/src/menus/share-panel';
|
3
|
+
import '@internetarchive/ia-item-navigator/dist/src/menus/share-panel';
|
4
4
|
|
5
5
|
export default class SharingProvider {
|
6
6
|
constructor({
|
@@ -15,13 +15,13 @@ export default class SharingProvider {
|
|
15
15
|
this.icon = html`${iauxShareIcon}`;
|
16
16
|
this.label = label;
|
17
17
|
this.id = 'share';
|
18
|
-
this.component = html`<iaux-
|
18
|
+
this.component = html`<iaux-in-share-panel
|
19
19
|
.identifier=${identifier}
|
20
20
|
.type=${`book`}
|
21
21
|
.creator=${creatorToUse}
|
22
22
|
.description=${title}
|
23
23
|
.baseHost=${baseHost}
|
24
24
|
.fileSubPrefix=${subPrefix}
|
25
|
-
></iaux-
|
25
|
+
></iaux-in-share-panel>`;
|
26
26
|
}
|
27
27
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { html } from 'lit';
|
2
2
|
|
3
|
-
import { viewableFilesIcon } from '@internetarchive/ia-item-navigator';
|
4
|
-
import '@internetarchive/ia-item-navigator';
|
3
|
+
import { viewableFilesIcon } from '@internetarchive/ia-item-navigator/dist/src/menus/viewable-files';
|
4
|
+
import '@internetarchive/ia-item-navigator/dist/src/menus/viewable-files';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* * @typedef { 'title_asc' | 'title_desc' | 'default'} SortTypesT
|
@@ -11,12 +11,12 @@ const sortTypes = {
|
|
11
11
|
title_desc: 'title_desc',
|
12
12
|
default: 'default'
|
13
13
|
};
|
14
|
-
export default class
|
14
|
+
export default class ViewableFilesProvider {
|
15
15
|
/**
|
16
|
-
* @param {import('
|
16
|
+
* @param {import('../BookReader').default} bookreader
|
17
17
|
*/
|
18
18
|
constructor({ baseHost, bookreader, onProviderChange }) {
|
19
|
-
/** @type {import('
|
19
|
+
/** @type {import('../BookReader').default} */
|
20
20
|
this.bookreader = bookreader;
|
21
21
|
this.onProviderChange = onProviderChange;
|
22
22
|
this.baseHost = baseHost;
|
@@ -30,13 +30,13 @@ export default class VolumesProvider {
|
|
30
30
|
this.icon = html`${viewableFilesIcon}`;
|
31
31
|
this.sortOrderBy = sortTypes.default;
|
32
32
|
|
33
|
-
this.component = document.createElement("iaux-viewable-files");
|
33
|
+
this.component = document.createElement("iaux-in-viewable-files-panel");
|
34
34
|
this.component.addSortToUrl = true;
|
35
35
|
this.component.subPrefix = bookreader.options.subPrefix || "";
|
36
36
|
this.component.baseHost = baseHost;
|
37
37
|
this.component.fileList = [...this.viewableFiles];
|
38
38
|
|
39
|
-
this.sortFilesComponent = document.createElement("iaux-sort-
|
39
|
+
this.sortFilesComponent = document.createElement("iaux-in-sort-files-button");
|
40
40
|
this.sortFilesComponent.fileListRaw = this.viewableFiles;
|
41
41
|
this.sortFilesComponent.addEventListener('fileListSorted', (e) => this.handleFileListSorted(e));
|
42
42
|
this.actionButton = this.sortFilesComponent;
|
@@ -30,7 +30,7 @@ export class IaBookReader extends LitElement {
|
|
30
30
|
super();
|
31
31
|
this.item = undefined;
|
32
32
|
this.bookreader = undefined;
|
33
|
-
this.baseHost = '
|
33
|
+
this.baseHost = 'archive.org';
|
34
34
|
this.fullscreen = false;
|
35
35
|
this.signedIn = false;
|
36
36
|
/** @type {ModalManager} */
|
@@ -9,7 +9,7 @@ import DownloadsProvider from '@/src/BookNavigator/downloads/downloads-provider.
|
|
9
9
|
import SearchProvider from '@/src/BookNavigator/search/search-provider.js';
|
10
10
|
import SharingProvider from '@/src/BookNavigator/sharing.js';
|
11
11
|
import VisualAdjustmentsProvider from '@/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js';
|
12
|
-
import
|
12
|
+
import ViewableFilesProvider from '@/src/BookNavigator/viewable-files.js';
|
13
13
|
import { ModalManager } from '@internetarchive/modal-manager';
|
14
14
|
import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
|
15
15
|
import '@/src/BookNavigator/book-navigator.js';
|
@@ -214,7 +214,7 @@ describe('<book-navigator>', () => {
|
|
214
214
|
await el.elementUpdated;
|
215
215
|
|
216
216
|
expect(el.menuProviders.volumes).toBeDefined();
|
217
|
-
expect(el.menuProviders.volumes).toBeInstanceOf(
|
217
|
+
expect(el.menuProviders.volumes).toBeInstanceOf(ViewableFilesProvider);
|
218
218
|
|
219
219
|
// also adds a menu shortcut
|
220
220
|
expect(el.menuShortcuts.find(m => m.id === 'volumes')).toBeDefined();
|
@@ -30,7 +30,7 @@ describe('Sharing Provider', () => {
|
|
30
30
|
expect(provider.id).toEqual('share');
|
31
31
|
expect(provider.icon).toBeDefined();
|
32
32
|
expect(provider.label).toEqual('Share this book');
|
33
|
-
expect(fixtureSync(provider.component).tagName).toContain('IAUX-
|
33
|
+
expect(fixtureSync(provider.component).tagName).toContain('IAUX-IN-SHARE-PANEL');
|
34
34
|
});
|
35
35
|
|
36
36
|
describe('Handles being a sub file/volume', () => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { fixtureCleanup, fixtureSync } from '@open-wc/testing-helpers';
|
2
2
|
import sinon from 'sinon';
|
3
|
-
import
|
3
|
+
import ViewableFilesProvider from '@/src/BookNavigator/viewable-files';
|
4
4
|
|
5
5
|
const brOptions = {
|
6
6
|
"options": {
|
@@ -44,7 +44,7 @@ describe('Volumes Provider', () => {
|
|
44
44
|
const onProviderChange = sinon.fake();
|
45
45
|
|
46
46
|
const baseHost = "https://archive.org";
|
47
|
-
const provider = new
|
47
|
+
const provider = new ViewableFilesProvider({
|
48
48
|
baseHost,
|
49
49
|
bookreader: brOptions,
|
50
50
|
onProviderChange
|