@internetarchive/bookreader 5.0.0-88-alpha.11 → 5.0.0-89
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/BookReader/BookReader.css +17 -3
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +87 -108
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.iiif.js +1 -1
- package/BookReader/plugins/plugin.iiif.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +1 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/CHANGELOG.md +14 -0
- package/babel.config.js +12 -30
- package/codecov.yml +1 -1
- package/jsconfig.json +1 -3
- package/package.json +14 -16
- package/src/BookNavigator/search/search-results.js +1 -1
- package/src/BookReader/ImageCache.js +48 -15
- package/src/BookReader/Mode1UpLit.js +56 -86
- package/src/BookReader/Mode2UpLit.js +5 -5
- package/src/BookReader/Navbar/Navbar.js +53 -11
- package/src/BookReader/PageContainer.js +41 -22
- package/src/BookReader/options.js +27 -3
- package/src/BookReader/utils.js +10 -0
- package/src/BookReader.js +120 -21
- package/src/BookReaderPlugin.js +44 -0
- package/src/css/_BRnav.scss +0 -3
- package/src/css/_BRpages.scss +21 -2
- package/src/css/_controls.scss +4 -0
- package/src/plugins/plugin.archive_analytics.js +84 -78
- package/src/plugins/plugin.autoplay.js +98 -102
- package/src/plugins/plugin.chapters.js +17 -22
- package/src/plugins/plugin.iiif.js +16 -30
- package/src/plugins/plugin.resume.js +54 -51
- package/src/plugins/plugin.text_selection.js +68 -76
- package/src/plugins/tts/AbstractTTSEngine.js +2 -4
- package/src/plugins/tts/PageChunk.js +5 -9
- package/src/plugins/tts/PageChunkIterator.js +3 -5
- package/src/plugins/tts/plugin.tts.js +309 -329
- package/src/plugins/url/plugin.url.js +1 -1
- package/src/util/strings.js +1 -0
- package/tests/e2e/autoplay.test.js +8 -5
- package/tests/e2e/helpers/base.js +2 -2
- package/tests/e2e/helpers/mockSearch.js +6 -9
- package/tests/jest/BookReader/Navbar/Navbar.test.js +16 -3
- package/tests/jest/BookReader/PageContainer.test.js +96 -55
- package/tests/jest/BookReader/utils.test.js +21 -0
- package/tests/jest/BookReader.test.js +13 -12
- package/tests/jest/plugins/plugin.archive_analytics.test.js +8 -11
- package/tests/jest/plugins/plugin.autoplay.test.js +9 -22
- package/tests/jest/plugins/plugin.resume.test.js +19 -32
- package/tests/jest/plugins/plugin.text_selection.test.js +23 -24
- package/dist/esm/BookNavigator/assets/bookmark-colors.js +0 -4
- package/dist/esm/BookNavigator/assets/button-base.js +0 -4
- package/dist/esm/BookNavigator/assets/ia-logo.js +0 -4
- package/dist/esm/BookNavigator/assets/icon_checkmark.js +0 -8
- package/dist/esm/BookNavigator/assets/icon_close.js +0 -4
- package/dist/esm/BookNavigator/book-navigator.js +0 -612
- package/dist/esm/BookNavigator/bookmarks/bookmark-button.js +0 -35
- package/dist/esm/BookNavigator/bookmarks/bookmark-edit.js +0 -78
- package/dist/esm/BookNavigator/bookmarks/bookmarks-list.js +0 -160
- package/dist/esm/BookNavigator/bookmarks/bookmarks-loginCTA.js +0 -24
- package/dist/esm/BookNavigator/bookmarks/bookmarks-provider.js +0 -55
- package/dist/esm/BookNavigator/bookmarks/ia-bookmarks.js +0 -521
- package/dist/esm/BookNavigator/delete-modal-actions.js +0 -29
- package/dist/esm/BookNavigator/downloads/downloads-provider.js +0 -84
- package/dist/esm/BookNavigator/downloads/downloads.js +0 -69
- package/dist/esm/BookNavigator/search/search-provider.js +0 -238
- package/dist/esm/BookNavigator/search/search-results.js +0 -161
- package/dist/esm/BookNavigator/sharing.js +0 -26
- package/dist/esm/BookNavigator/viewable-files.js +0 -94
- package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments-provider.js +0 -83
- package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments.js +0 -131
- package/dist/esm/BookReader/BookModel.js +0 -575
- package/dist/esm/BookReader/DragScrollable.js +0 -224
- package/dist/esm/BookReader/ImageCache.js +0 -122
- package/dist/esm/BookReader/Mode1Up.js +0 -114
- package/dist/esm/BookReader/Mode1UpLit.js +0 -579
- package/dist/esm/BookReader/Mode2Up.js +0 -106
- package/dist/esm/BookReader/Mode2UpLit.js +0 -1020
- package/dist/esm/BookReader/ModeCoordinateSpace.js +0 -28
- package/dist/esm/BookReader/ModeSmoothZoom.js +0 -318
- package/dist/esm/BookReader/ModeThumb.js +0 -366
- package/dist/esm/BookReader/Navbar/Navbar.js +0 -253
- package/dist/esm/BookReader/PageContainer.js +0 -165
- package/dist/esm/BookReader/ReduceSet.js +0 -27
- package/dist/esm/BookReader/Toolbar/Toolbar.js +0 -242
- package/dist/esm/BookReader/events.js +0 -20
- package/dist/esm/BookReader/options.js +0 -331
- package/dist/esm/BookReader/utils/HTMLDimensionsCacher.js +0 -48
- package/dist/esm/BookReader/utils/ScrollClassAdder.js +0 -31
- package/dist/esm/BookReader/utils/SelectionObserver.js +0 -42
- package/dist/esm/BookReader/utils/classes.js +0 -37
- package/dist/esm/BookReader/utils.js +0 -315
- package/dist/esm/BookReader.js +0 -1828
- package/dist/esm/assets/icons/1up.svg +0 -12
- package/dist/esm/assets/icons/2up.svg +0 -15
- package/dist/esm/assets/icons/advance.svg +0 -26
- package/dist/esm/assets/icons/chevron-right.svg +0 -1
- package/dist/esm/assets/icons/close-circle-dark.svg +0 -1
- package/dist/esm/assets/icons/close-circle.svg +0 -1
- package/dist/esm/assets/icons/fullscreen.svg +0 -17
- package/dist/esm/assets/icons/fullscreen_exit.svg +0 -17
- package/dist/esm/assets/icons/hamburger.svg +0 -15
- package/dist/esm/assets/icons/left-arrow.svg +0 -12
- package/dist/esm/assets/icons/magnify-minus.svg +0 -12
- package/dist/esm/assets/icons/magnify-plus.svg +0 -13
- package/dist/esm/assets/icons/magnify.svg +0 -15
- package/dist/esm/assets/icons/pause.svg +0 -23
- package/dist/esm/assets/icons/play.svg +0 -22
- package/dist/esm/assets/icons/playback-speed.svg +0 -34
- package/dist/esm/assets/icons/read-aloud.svg +0 -22
- package/dist/esm/assets/icons/review.svg +0 -22
- package/dist/esm/assets/icons/thumbnails.svg +0 -17
- package/dist/esm/assets/icons/voice.svg +0 -1
- package/dist/esm/assets/icons/volume-full.svg +0 -22
- package/dist/esm/assets/images/BRicons.png +0 -0
- package/dist/esm/assets/images/BRicons.svg +0 -94
- package/dist/esm/assets/images/BRicons_ia.png +0 -0
- package/dist/esm/assets/images/back_pages.png +0 -0
- package/dist/esm/assets/images/book_bottom_icon.png +0 -0
- package/dist/esm/assets/images/book_down_icon.png +0 -0
- package/dist/esm/assets/images/book_left_icon.png +0 -0
- package/dist/esm/assets/images/book_leftmost_icon.png +0 -0
- package/dist/esm/assets/images/book_right_icon.png +0 -0
- package/dist/esm/assets/images/book_rightmost_icon.png +0 -0
- package/dist/esm/assets/images/book_top_icon.png +0 -0
- package/dist/esm/assets/images/book_up_icon.png +0 -0
- package/dist/esm/assets/images/books_graphic.svg +0 -177
- package/dist/esm/assets/images/booksplit.png +0 -0
- package/dist/esm/assets/images/control_pause_icon.png +0 -0
- package/dist/esm/assets/images/control_play_icon.png +0 -0
- package/dist/esm/assets/images/embed_icon.png +0 -0
- package/dist/esm/assets/images/icon-home-ia.png +0 -0
- package/dist/esm/assets/images/icon_OL-logo-xs.png +0 -0
- package/dist/esm/assets/images/icon_alert-xs.png +0 -0
- package/dist/esm/assets/images/icon_book.svg +0 -12
- package/dist/esm/assets/images/icon_bookmark.svg +0 -12
- package/dist/esm/assets/images/icon_close-pop.png +0 -0
- package/dist/esm/assets/images/icon_download.png +0 -0
- package/dist/esm/assets/images/icon_gear.svg +0 -14
- package/dist/esm/assets/images/icon_hamburger.svg +0 -20
- package/dist/esm/assets/images/icon_home.png +0 -0
- package/dist/esm/assets/images/icon_home.svg +0 -21
- package/dist/esm/assets/images/icon_home_ia.png +0 -0
- package/dist/esm/assets/images/icon_indicator.png +0 -0
- package/dist/esm/assets/images/icon_info.svg +0 -11
- package/dist/esm/assets/images/icon_one_page.svg +0 -8
- package/dist/esm/assets/images/icon_pause.svg +0 -1
- package/dist/esm/assets/images/icon_play.svg +0 -1
- package/dist/esm/assets/images/icon_playback-rate.svg +0 -15
- package/dist/esm/assets/images/icon_return.png +0 -0
- package/dist/esm/assets/images/icon_search_button.svg +0 -8
- package/dist/esm/assets/images/icon_share.svg +0 -9
- package/dist/esm/assets/images/icon_skip-ahead.svg +0 -6
- package/dist/esm/assets/images/icon_skip-back.svg +0 -13
- package/dist/esm/assets/images/icon_speaker.svg +0 -18
- package/dist/esm/assets/images/icon_speaker_open.svg +0 -10
- package/dist/esm/assets/images/icon_thumbnails.svg +0 -12
- package/dist/esm/assets/images/icon_toc.svg +0 -5
- package/dist/esm/assets/images/icon_two_pages.svg +0 -9
- package/dist/esm/assets/images/icon_zoomer.png +0 -0
- package/dist/esm/assets/images/loading.gif +0 -0
- package/dist/esm/assets/images/logo_icon.png +0 -0
- package/dist/esm/assets/images/marker_chap-off.png +0 -0
- package/dist/esm/assets/images/marker_chap-off.svg +0 -11
- package/dist/esm/assets/images/marker_chap-off_ia.png +0 -0
- package/dist/esm/assets/images/marker_chap-on.png +0 -0
- package/dist/esm/assets/images/marker_chap-on.svg +0 -11
- package/dist/esm/assets/images/marker_srch-on.svg +0 -11
- package/dist/esm/assets/images/marker_srchchap-off.png +0 -0
- package/dist/esm/assets/images/marker_srchchap-on.png +0 -0
- package/dist/esm/assets/images/nav_control-dn.png +0 -0
- package/dist/esm/assets/images/nav_control-dn_ia.png +0 -0
- package/dist/esm/assets/images/nav_control-up.png +0 -0
- package/dist/esm/assets/images/nav_control-up_ia.png +0 -0
- package/dist/esm/assets/images/nav_control.png +0 -0
- package/dist/esm/assets/images/one_page_mode_icon.png +0 -0
- package/dist/esm/assets/images/paper-badge.png +0 -0
- package/dist/esm/assets/images/print_icon.png +0 -0
- package/dist/esm/assets/images/progressbar.gif +0 -0
- package/dist/esm/assets/images/right_edges.png +0 -0
- package/dist/esm/assets/images/slider.png +0 -0
- package/dist/esm/assets/images/slider_ia.png +0 -0
- package/dist/esm/assets/images/thumbnail_mode_icon.png +0 -0
- package/dist/esm/assets/images/transparent.png +0 -0
- package/dist/esm/assets/images/two_page_mode_icon.png +0 -0
- package/dist/esm/assets/images/unviewable_page.png +0 -0
- package/dist/esm/assets/images/zoom_in_icon.png +0 -0
- package/dist/esm/assets/images/zoom_out_icon.png +0 -0
- package/dist/esm/css/BookReader.scss +0 -85
- package/dist/esm/css/_BRBookmarks.scss +0 -29
- package/dist/esm/css/_BRComponent.scss +0 -13
- package/dist/esm/css/_BRfloat.scss +0 -197
- package/dist/esm/css/_BRicon.scss +0 -54
- package/dist/esm/css/_BRmain.scss +0 -262
- package/dist/esm/css/_BRnav.scss +0 -354
- package/dist/esm/css/_BRpages.scss +0 -213
- package/dist/esm/css/_BRsearch.scss +0 -268
- package/dist/esm/css/_BRtoolbar.scss +0 -84
- package/dist/esm/css/_BRvendor.scss +0 -5
- package/dist/esm/css/_TextSelection.scss +0 -108
- package/dist/esm/css/_colorbox.scss +0 -52
- package/dist/esm/css/_controls.scss +0 -257
- package/dist/esm/css/_icons.scss +0 -121
- package/dist/esm/ia-bookreader/ia-bookreader.js +0 -141
- package/dist/esm/jquery-wrapper.js +0 -3
- package/dist/esm/plugins/plugin.archive_analytics.js +0 -72
- package/dist/esm/plugins/plugin.autoplay.js +0 -119
- package/dist/esm/plugins/plugin.chapters.js +0 -288
- package/dist/esm/plugins/plugin.iframe.js +0 -44
- package/dist/esm/plugins/plugin.iiif.js +0 -146
- package/dist/esm/plugins/plugin.resume.js +0 -66
- package/dist/esm/plugins/plugin.text_selection.js +0 -621
- package/dist/esm/plugins/plugin.vendor-fullscreen.js +0 -227
- package/dist/esm/plugins/search/plugin.search.js +0 -499
- package/dist/esm/plugins/search/utils.js +0 -42
- package/dist/esm/plugins/search/view.js +0 -360
- package/dist/esm/plugins/tts/AbstractTTSEngine.js +0 -282
- package/dist/esm/plugins/tts/FestivalTTSEngine.js +0 -192
- package/dist/esm/plugins/tts/PageChunk.js +0 -105
- package/dist/esm/plugins/tts/PageChunkIterator.js +0 -155
- package/dist/esm/plugins/tts/WebTTSEngine.js +0 -364
- package/dist/esm/plugins/tts/plugin.tts.js +0 -315
- package/dist/esm/plugins/tts/tooltip_dict.js +0 -14
- package/dist/esm/plugins/tts/utils.js +0 -79
- package/dist/esm/plugins/url/UrlPlugin.js +0 -197
- package/dist/esm/plugins/url/plugin.url.js +0 -212
- package/dist/esm/util/browserSniffing.js +0 -56
- package/dist/esm/util/debouncer.js +0 -25
- package/dist/esm/util/docCookies.js +0 -75
- package/dist/esm/util/strings.js +0 -34
- package/index.js +0 -2
@@ -1,8 +1,7 @@
|
|
1
1
|
import sinon from 'sinon';
|
2
2
|
|
3
|
-
import '@/src/BookReader.js';
|
3
|
+
import BookReader from '@/src/BookReader.js';
|
4
4
|
import {
|
5
|
-
BookreaderWithTextSelection,
|
6
5
|
Cache,
|
7
6
|
genMap,
|
8
7
|
lookAroundWindow,
|
@@ -87,7 +86,7 @@ const FAKE_XML_EMPTY = '';
|
|
87
86
|
|
88
87
|
describe("Generic tests", () => {
|
89
88
|
document.body.innerHTML = '<div id="BookReader">';
|
90
|
-
const br = window.br = new
|
89
|
+
const br = window.br = new BookReader({
|
91
90
|
data: [
|
92
91
|
[
|
93
92
|
{ width: 800, height: 1200,
|
@@ -115,8 +114,8 @@ describe("Generic tests", () => {
|
|
115
114
|
});
|
116
115
|
|
117
116
|
test("_createPageContainer overridden function still creates a BRpagecontainer element", () => {
|
118
|
-
const spy = sinon.spy(br.
|
119
|
-
sinon.stub(br.
|
117
|
+
const spy = sinon.spy(br._plugins.textSelection, 'createTextLayer');
|
118
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
120
119
|
.returns($(new DOMParser().parseFromString(FAKE_XML_1WORD, "text/xml")));
|
121
120
|
const container = br._createPageContainer(1, {});
|
122
121
|
expect(container).toBeTruthy();
|
@@ -125,24 +124,24 @@ describe("Generic tests", () => {
|
|
125
124
|
|
126
125
|
// test loading first object from sample data
|
127
126
|
test("_createPageContainer handles index 0", () => {
|
128
|
-
const spy = sinon.spy(br.
|
127
|
+
const spy = sinon.spy(br._plugins.textSelection, 'createTextLayer');
|
129
128
|
br._createPageContainer(0, {});
|
130
129
|
expect(spy.callCount).toBe(1);
|
131
130
|
});
|
132
131
|
|
133
132
|
// test loading last object from sample data
|
134
133
|
test("_createPageContainer handles index -1", () => {
|
135
|
-
const spy = sinon.spy(br.
|
134
|
+
const spy = sinon.spy(br._plugins.textSelection, 'createTextLayer');
|
136
135
|
br._createPageContainer(-1, {});
|
137
136
|
expect(spy.callCount).toBe(0);
|
138
137
|
});
|
139
138
|
|
140
139
|
test("createTextLayer will render the last page and create text layer properly", async () => {
|
141
140
|
const $container = br.refs.$brContainer;
|
142
|
-
sinon.stub(br.
|
141
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
143
142
|
.returns($(new DOMParser().parseFromString(FAKE_XML_1WORD, "text/xml")));
|
144
143
|
const pageIndex = br.data.length - 1;
|
145
|
-
await br.
|
144
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: pageIndex, width: 100, height: 100 }});
|
146
145
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
147
146
|
expect($container.find("p").length).toBe(1);
|
148
147
|
});
|
@@ -150,9 +149,9 @@ describe("Generic tests", () => {
|
|
150
149
|
test("createTextLayer will not create text layer if there are too many words", async () => {
|
151
150
|
const $container = br.refs.$brContainer;
|
152
151
|
const xml = FAKE_XML_1WORD.replace(/<WORD.*<\/WORD>/, FAKE_XML_1WORD.match(/<WORD.*<\/WORD>/)[0].repeat(3000));
|
153
|
-
sinon.stub(br.
|
152
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
154
153
|
.returns($(new DOMParser().parseFromString(xml, "text/xml")));
|
155
|
-
await br.
|
154
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 0, width: 100, height: 100 }});
|
156
155
|
expect($container.find(".BRtextLayer").length).toBe(0);
|
157
156
|
expect($container.find("p").length).toBe(0);
|
158
157
|
expect($container.find(".BRwordElement").length).toBe(0);
|
@@ -160,9 +159,9 @@ describe("Generic tests", () => {
|
|
160
159
|
|
161
160
|
test("createTextLayer creates text layer with paragraph with 1 word element", async () => {
|
162
161
|
const $container = br.refs.$brContainer;
|
163
|
-
sinon.stub(br.
|
162
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
164
163
|
.returns($(new DOMParser().parseFromString(FAKE_XML_1WORD, "text/xml")));
|
165
|
-
await br.
|
164
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 1, width: 100, height: 100 }});
|
166
165
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
167
166
|
expect($container.find("p").length).toBe(1);
|
168
167
|
expect($container.find(".BRwordElement").length).toBe(1);
|
@@ -171,9 +170,9 @@ describe("Generic tests", () => {
|
|
171
170
|
|
172
171
|
test("createTextLayer creates text layer with paragraph with multiple word elements", async () => {
|
173
172
|
const $container = br.refs.$brContainer;
|
174
|
-
sinon.stub(br.
|
173
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
175
174
|
.returns($(new DOMParser().parseFromString(FAKE_XML_MULT_WORDS, "text/xml")));
|
176
|
-
await br.
|
175
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 2, width: 100, height: 100 }});
|
177
176
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
178
177
|
expect($container.find("p").length).toBe(1);
|
179
178
|
expect($container.find(".BRwordElement").length).toBe(3);
|
@@ -182,9 +181,9 @@ describe("Generic tests", () => {
|
|
182
181
|
|
183
182
|
test("createTextLayer creates text layer with paragraph with word with 5 params coordinates", async () => {
|
184
183
|
const $container = br.refs.$brContainer;
|
185
|
-
sinon.stub(br.
|
184
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
186
185
|
.returns($(new DOMParser().parseFromString(FAKE_XML_5COORDS, "text/xml")));
|
187
|
-
await br.
|
186
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 3, width: 100, height: 100 }});
|
188
187
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
189
188
|
expect($container.find("p").length).toBe(1);
|
190
189
|
expect($container.find(".BRwordElement").length).toBe(1);
|
@@ -192,9 +191,9 @@ describe("Generic tests", () => {
|
|
192
191
|
|
193
192
|
test("createTextLayer handles multiple lines", async () => {
|
194
193
|
const $container = br.refs.$brContainer;
|
195
|
-
sinon.stub(br.
|
194
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
196
195
|
.returns($(new DOMParser().parseFromString(FAKE_XML_MULT_LINES, "text/xml")));
|
197
|
-
await br.
|
196
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 3, width: 100, height: 100 }});
|
198
197
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
199
198
|
expect($container.find("p").length).toBe(1);
|
200
199
|
expect($container.find(".BRlineElement").length).toBe(3);
|
@@ -207,9 +206,9 @@ describe("Generic tests", () => {
|
|
207
206
|
|
208
207
|
test("createTextLayer repairs trailing hyphens", async () => {
|
209
208
|
const $container = br.refs.$brContainer;
|
210
|
-
sinon.stub(br.
|
209
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
211
210
|
.returns($(new DOMParser().parseFromString(FAKE_XML_MULT_LINES, "text/xml")));
|
212
|
-
await br.
|
211
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 3, width: 100, height: 100 }});
|
213
212
|
|
214
213
|
expect($container.find(".BRwordElement--hyphen").length).toBe(1);
|
215
214
|
expect($container.find(".BRwordElement--hyphen").closest(".BRlineElement").text().endsWith(' ')).toBe(false);
|
@@ -218,9 +217,9 @@ describe("Generic tests", () => {
|
|
218
217
|
|
219
218
|
test("createTextLayer can handle empty xml", async () => {
|
220
219
|
const $container = br.refs.$brContainer;
|
221
|
-
sinon.stub(br.
|
220
|
+
sinon.stub(br._plugins.textSelection, "getPageText")
|
222
221
|
.returns($(new DOMParser().parseFromString(FAKE_XML_EMPTY, "text/xml")));
|
223
|
-
await br.
|
222
|
+
await br._plugins.textSelection.createTextLayer({ $container, page: { index: 4, width: 100, height: 100 }});
|
224
223
|
expect($container.find(".BRtextLayer").length).toBe(1);
|
225
224
|
expect($container.find("p").length).toBe(0);
|
226
225
|
expect($container.find(".BRwordElement").length).toBe(0);
|
@@ -229,7 +228,7 @@ describe("Generic tests", () => {
|
|
229
228
|
const LONG_PRESS_DURATION = 500;
|
230
229
|
test("calling stopPageFlip does not allow long click to flip the page", () => {
|
231
230
|
const $container = br.refs.$brContainer;
|
232
|
-
br.
|
231
|
+
br._plugins.textSelection.stopPageFlip($container);
|
233
232
|
const currIndex = br.currentIndex();
|
234
233
|
$container.find("BRwordElement").trigger("mousedown");
|
235
234
|
// Waits for long press
|
@@ -1,4 +0,0 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
3
|
-
import { css } from 'lit';
|
4
|
-
export default css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .blue {\n --iconFillColor: var(--blueBookmarkColor, #0023f5);\n }\n\n .red {\n --iconFillColor: var(--redBookmarkColor, #eb3223);\n }\n\n .green {\n --iconFillColor: var(--greenBookmarkColor, #75ef4c);\n }\n"])));
|
@@ -1,4 +0,0 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
3
|
-
import { css } from 'lit';
|
4
|
-
export default css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ia-button {\n min-height: 3rem;\n border: none;\n outline: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n font-family: inherit;\n display: inline-block;\n padding: .6rem 1.2rem;\n border: 1px solid transparent;\n\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .ia-button.link,\n .ia-button.external {\n min-height: unset;\n text-decoration: none;\n }\n\n .ia-button:disabled,\n .ia-button.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .ia-button.transparent {\n background-color: transparent;\n }\n \n .ia-button.slim {\n padding: 0;\n }\n\n .ia-button.primary {\n background-color: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n .ia-button.cancel {\n background-color: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .ia-button.external {\n background: var(--secondaryCTAFill);\n border-color: var(--secondaryCTABorder);\n }\n"])));
|
@@ -1,4 +0,0 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
3
|
-
import { svg } from 'lit';
|
4
|
-
export default svg(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n <svg class=\"ia-logo\" width=\"27\" height=\"30\" viewBox=\"0 0 27 30\" xmlns=\"http://www.w3.org/2000/svg\" aria-labelledby=\"logoTitleID logoDescID\">\n <title id=\"logoTitleID\">Internet Archive logo</title>\n <desc id=\"logoDescID\">A line drawing of the Internet Archive headquarters building fa\xE7ade.</desc>\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <mask id=\"mask-2\" fill=\"white\">\n <path d=\"M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z\" id=\"path-1\"></path>\n </mask>\n <use fill=\"#FFFFFF\" xlink:href=\"#path-1\"></use>\n <g mask=\"url(#mask-2)\" fill=\"#FFFFFF\">\n <path d=\"M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z\" id=\"swatch\"></path>\n </g>\n </g>\n </svg>\n"])));
|
@@ -1,8 +0,0 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
3
|
-
import { css } from 'lit';
|
4
|
-
|
5
|
-
// Original SVG object for reference
|
6
|
-
// <svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg"><path d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z" fill="#fff" fill-rule="evenodd"/></svg>
|
7
|
-
|
8
|
-
export default css(_templateObject || (_templateObject = _taggedTemplateLiteral(["data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+"])));
|
@@ -1,4 +0,0 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
3
|
-
import { css } from 'lit';
|
4
|
-
export default css(_templateObject || (_templateObject = _taggedTemplateLiteral(["data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg=="])));
|