@internetarchive/bookreader 5.0.0-32 → 5.0.0-32-shadydom2
Sign up to get free protection for your applications and to get access to all the features.
- package/BookReader/BookReader.js +32261 -2
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +14862 -1133
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/icons/1up.svg +12 -1
- package/BookReader/icons/2up.svg +15 -1
- package/BookReader/icons/advance.svg +26 -3
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +17 -1
- package/BookReader/icons/fullscreen_exit.svg +17 -1
- package/BookReader/icons/hamburger.svg +15 -1
- package/BookReader/icons/left-arrow.svg +12 -1
- package/BookReader/icons/magnify-minus.svg +16 -1
- package/BookReader/icons/magnify-plus.svg +17 -1
- package/BookReader/icons/magnify.svg +15 -1
- package/BookReader/icons/pause.svg +23 -1
- package/BookReader/icons/play.svg +22 -1
- package/BookReader/icons/playback-speed.svg +34 -1
- package/BookReader/icons/read-aloud.svg +22 -1
- package/BookReader/icons/review.svg +22 -3
- package/BookReader/icons/thumbnails.svg +17 -1
- package/BookReader/icons/voice.svg +1 -1
- package/BookReader/icons/volume-full.svg +22 -1
- package/BookReader/images/BRicons.svg +94 -5
- package/BookReader/images/books_graphic.svg +177 -1
- package/BookReader/images/icon_book.svg +12 -1
- package/BookReader/images/icon_bookmark.svg +12 -1
- package/BookReader/images/icon_gear.svg +14 -1
- package/BookReader/images/icon_hamburger.svg +20 -1
- package/BookReader/images/icon_home.svg +21 -1
- package/BookReader/images/icon_info.svg +11 -1
- package/BookReader/images/icon_one_page.svg +8 -1
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_playback-rate.svg +15 -1
- package/BookReader/images/icon_search_button.svg +8 -1
- package/BookReader/images/icon_share.svg +9 -1
- package/BookReader/images/icon_skip-ahead.svg +6 -1
- package/BookReader/images/icon_skip-back.svg +13 -2
- package/BookReader/images/icon_speaker.svg +18 -1
- package/BookReader/images/icon_speaker_open.svg +10 -1
- package/BookReader/images/icon_thumbnails.svg +12 -1
- package/BookReader/images/icon_toc.svg +5 -1
- package/BookReader/images/icon_two_pages.svg +9 -1
- package/BookReader/images/marker_chap-off.svg +11 -1
- package/BookReader/images/marker_chap-on.svg +11 -1
- package/BookReader/images/marker_srch-on.svg +11 -1
- package/BookReader/jquery-1.10.1.js +108 -2
- package/BookReader/plugins/plugin.archive_analytics.js +170 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +163 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +333 -1
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js +72 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js +332 -1
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +241 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1261 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +839 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +9115 -2
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +811 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +326 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +411 -2
- package/BookReader/webcomponents-bundle.js.map +1 -1
- package/CHANGELOG.md +0 -3
- package/package.json +2 -2
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +1 -1
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +3 -5
- package/tests/karma/BookNavigator/bookmarks/ia-bookmarks.test.js +0 -57
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@internetarchive/bookreader",
|
3
|
-
"version": "5.0.0-32",
|
3
|
+
"version": "5.0.0-32-shadydom2",
|
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.1",
|
29
|
-
"@internetarchive/ia-item-navigator": "0.0.5",
|
29
|
+
"@internetarchive/ia-item-navigator": "0.0.5-2",
|
30
30
|
"@internetarchive/ia-menu-slider": "^1.1.1",
|
31
31
|
"@internetarchive/ia-sharing-options": "^0.1.4",
|
32
32
|
"@internetarchive/icon-bookmark": "^1.1.3",
|
@@ -142,8 +142,9 @@ class IABookmarks extends LitElement {
|
|
142
142
|
if (this.displayMode === 'login') {
|
143
143
|
return;
|
144
144
|
}
|
145
|
-
this.
|
145
|
+
this.updateDisplay();
|
146
146
|
this.setBREventListeners();
|
147
|
+
this.fetchUserBookmarks();
|
147
148
|
}
|
148
149
|
|
149
150
|
updateDisplay() {
|
@@ -153,9 +154,6 @@ class IABookmarks extends LitElement {
|
|
153
154
|
}
|
154
155
|
|
155
156
|
fetchUserBookmarks() {
|
156
|
-
if (!this.api.identifier) {
|
157
|
-
return;
|
158
|
-
}
|
159
157
|
this.fetchBookmarks()
|
160
158
|
.then(() => {
|
161
159
|
this.initializeBookmarks();
|
@@ -230,7 +228,7 @@ class IABookmarks extends LitElement {
|
|
230
228
|
}
|
231
229
|
|
232
230
|
fetchBookmarks() {
|
233
|
-
return this.api.getAll().then(
|
231
|
+
return this.api.getAll().then((res) => {
|
234
232
|
let response;
|
235
233
|
try {
|
236
234
|
response = JSON.parse(res);
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
html,
|
3
|
-
fixtureSync,
|
4
|
-
expect,
|
5
|
-
fixtureCleanup,
|
6
|
-
} from '@open-wc/testing';
|
7
|
-
import '../../../../src/BookNavigator/bookmarks/ia-bookmarks.js';
|
8
|
-
import sinon from 'sinon';
|
9
|
-
|
10
|
-
afterEach(() => {
|
11
|
-
sinon.restore();
|
12
|
-
fixtureCleanup();
|
13
|
-
});
|
14
|
-
|
15
|
-
describe('<ia-bookmarks>', () => {
|
16
|
-
it('uses `setup` to start component', async () => {
|
17
|
-
const el = fixtureSync(html`<ia-bookmarks></ia-bookmarks>`);
|
18
|
-
await el.updateComplete;
|
19
|
-
|
20
|
-
let fetchHappened = false;
|
21
|
-
el.bookreader.bookId = 'foo';
|
22
|
-
el.displayMode = 'bookmarks';
|
23
|
-
|
24
|
-
el.fetchBookmarks = async () => {
|
25
|
-
fetchHappened = true;
|
26
|
-
return await Promise.resolve();
|
27
|
-
};
|
28
|
-
|
29
|
-
const fetchSpy = sinon.spy(el, 'fetchUserBookmarks');
|
30
|
-
|
31
|
-
el.setup();
|
32
|
-
await el.updateComplete;
|
33
|
-
|
34
|
-
expect(fetchSpy.callCount).to.equal(1);
|
35
|
-
expect(fetchHappened).to.equal(true);
|
36
|
-
});
|
37
|
-
it('does not fetch user bookmarks if displayMode = login', async () => {
|
38
|
-
const el = fixtureSync(html`<ia-bookmarks></ia-bookmarks>`);
|
39
|
-
await el.updateComplete;
|
40
|
-
|
41
|
-
let fetchHappened = false;
|
42
|
-
el.displayMode = 'login';
|
43
|
-
|
44
|
-
el.fetchBookmarks = async () => {
|
45
|
-
fetchHappened = true;
|
46
|
-
return await Promise.resolve();
|
47
|
-
};
|
48
|
-
|
49
|
-
const fetchSpy = sinon.spy(el, 'fetchUserBookmarks');
|
50
|
-
|
51
|
-
el.setup();
|
52
|
-
await el.updateComplete;
|
53
|
-
|
54
|
-
expect(fetchSpy.callCount).to.equal(0);
|
55
|
-
expect(fetchHappened).to.equal(false);
|
56
|
-
});
|
57
|
-
});
|