@internetarchive/bookreader 5.0.0-30-a → 5.0.0-30-e

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/BookReader/BookReader.js +32261 -2
  2. package/BookReader/BookReader.js.map +1 -1
  3. package/BookReader/ia-bookreader-bundle.js +14917 -1133
  4. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  5. package/BookReader/jquery-1.10.1.js +108 -2
  6. package/BookReader/plugins/plugin.archive_analytics.js +170 -1
  7. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  8. package/BookReader/plugins/plugin.autoplay.js +163 -1
  9. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  10. package/BookReader/plugins/plugin.chapters.js +333 -1
  11. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  12. package/BookReader/plugins/plugin.iframe.js +72 -1
  13. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  14. package/BookReader/plugins/plugin.mobile_nav.js +332 -1
  15. package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
  16. package/BookReader/plugins/plugin.resume.js +241 -1
  17. package/BookReader/plugins/plugin.resume.js.map +1 -1
  18. package/BookReader/plugins/plugin.search.js +1261 -1
  19. package/BookReader/plugins/plugin.search.js.map +1 -1
  20. package/BookReader/plugins/plugin.text_selection.js +839 -1
  21. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  22. package/BookReader/plugins/plugin.tts.js +9115 -2
  23. package/BookReader/plugins/plugin.tts.js.map +1 -1
  24. package/BookReader/plugins/plugin.url.js +811 -1
  25. package/BookReader/plugins/plugin.url.js.map +1 -1
  26. package/BookReader/plugins/plugin.vendor-fullscreen.js +326 -1
  27. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  28. package/BookReader/webcomponents-bundle.js +411 -2
  29. package/BookReader/webcomponents-bundle.js.map +1 -1
  30. package/BookReaderDemo/demo-internetarchive.html +2 -1
  31. package/package.json +2 -2
  32. package/src/BookNavigator/book-navigator.js +1 -1
  33. package/src/BookReader/Mode1UpLit.js +1 -1
  34. package/src/ia-bookreader/ia-bookreader.js +24 -12
  35. package/stat/BookNavigator/BookNavigator.js +1 -1
  36. package/stat/BookReaderComponent/BookReaderComponent.js +2 -2
  37. package/tests/karma/BookNavigator/book-navigator.test.js +1 -1
  38. package/webpack.config.js +1 -1
  39. package/BookReader/BookReader.js.LICENSE.txt +0 -117
  40. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +0 -39
  41. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  42. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +0 -27
  43. package/BookReader/webcomponents-bundle.js.LICENSE.txt +0 -9
@@ -43,7 +43,7 @@
43
43
  <ia-bookreader
44
44
  baseHost="https://archive.org"
45
45
  >
46
- <div id="IABookReaderWrapper" slot="theater-main">
46
+ <div id="IABookReaderWrapper" slot="main">
47
47
  <div id="BookReader" class="BookReader"></div>
48
48
  </div>
49
49
  <div>
@@ -88,6 +88,7 @@
88
88
  <h3>Placeholder div to allow scrolling</h3>
89
89
  </div>
90
90
 
91
+ <!-- Certain features, like Bookmarks, uses modal-manager to draw their interface -->
91
92
  <modal-manager></modal-manager>
92
93
  <script >
93
94
  // Set up demo things
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/bookreader",
3
- "version": "5.0.0-30-a",
3
+ "version": "5.0.0-30-e",
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.4-3",
29
+ "@internetarchive/ia-item-navigator": "^0.0.4",
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",
@@ -504,7 +504,7 @@ export class BookNavigator extends LitElement {
504
504
  const placeholder = this.bookReaderCannotLoad ? this.itemImage : this.loader;
505
505
  return html`<div id="book-navigator" class="${this.loadingClass}">
506
506
  ${placeholder}
507
- <slot name="theater-main"></slot>
507
+ <slot name="main"></slot>
508
508
  </div>
509
509
  `;
510
510
  }
@@ -368,7 +368,7 @@ export class Mode1UpLit extends LitElement {
368
368
  computeDefaultScale(page) {
369
369
  // Default to real size if it fits, otherwise default to full width
370
370
  const containerWidthIn = this.visiblePixelsToWorldUnits(this.htmlDimensionsCacher.clientWidth);
371
- return Math.min(1, containerWidthIn / (page.widthInches + 2 * this.SPACING_IN));
371
+ return Math.min(1, containerWidthIn / (page.widthInches + 2 * this.SPACING_IN)) || 1;
372
372
  }
373
373
 
374
374
  computeWorldDimensions() {
@@ -40,12 +40,11 @@ export class IaBookReader extends LitElement {
40
40
  this.loaded = false;
41
41
  this.menuShortcuts = [];
42
42
  this.menuContents = [];
43
- console.log("ia-bookreader constructor", this);
44
43
  }
45
44
 
46
45
  updated() {
47
46
  if (!this.modal) {
48
- this.modal = new ModalManager();
47
+ this.setModalManager();
49
48
  }
50
49
 
51
50
  if (!this.sharedObserver) {
@@ -53,11 +52,25 @@ export class IaBookReader extends LitElement {
53
52
  }
54
53
  }
55
54
 
55
+ /** Creates modal DOM & attaches to `<body>` */
56
+ setModalManager() {
57
+ let modalManager = document.querySelector('modal-manager');
58
+ if (!modalManager) {
59
+ modalManager = document.createElement(
60
+ 'modal-manager'
61
+ );
62
+ document.body.appendChild(this.modal);
63
+ }
64
+
65
+ this.modal = modalManager;
66
+ }
56
67
 
57
68
  manageFullscreen(e) {
58
69
  const { detail } = e;
59
70
  const fullscreen = !!detail.isFullScreen;
60
71
  this.fullscreen = fullscreen;
72
+ this.dispatchEvent(new CustomEvent('fullscreenStateUpdated', { detail: { fullscreen }}));
73
+
61
74
  }
62
75
 
63
76
  loadingStateUpdated(e) {
@@ -90,15 +103,11 @@ export class IaBookReader extends LitElement {
90
103
  }
91
104
  }
92
105
 
93
- // LINER NOTES --- iaux.min.js is loading wayy to late for booknav listener, to br. init
94
-
95
106
  render() {
96
- console.log('ia-bookreader render & its itemNav: ', this.itemNav);
97
107
  return html`
98
108
  <div class="ia-bookreader">
99
109
  <ia-item-navigator
100
110
  ?viewportInFullscreen=${this.fullscreen}
101
- .itemType=${'open'}
102
111
  .basehost=${this.baseHost}
103
112
  .item=${this.item}
104
113
  .modal=${this.modal}
@@ -108,7 +117,10 @@ export class IaBookReader extends LitElement {
108
117
  .menuShortcuts=${this.menuShortcuts}
109
118
  .menuContents=${this.menuContents}
110
119
  >
111
- <div slot="theater-main">
120
+ <div slot="header">
121
+ <slot name="header"></slot>
122
+ </div>
123
+ <div slot="main">
112
124
  <book-navigator
113
125
  .modal=${this.modal}
114
126
  .baseHost=${this.baseHost}
@@ -122,8 +134,8 @@ export class IaBookReader extends LitElement {
122
134
  @menuUpdated=${this.setMenuContents}
123
135
  @menuShortcutsUpdated=${this.setMenuShortcuts}
124
136
  >
125
- <div slot="theater-main">
126
- <slot name="theater-main"></slot>
137
+ <div slot="main">
138
+ <slot name="main"></slot>
127
139
  </div>
128
140
  </book-navigator>
129
141
  </div>
@@ -154,12 +166,12 @@ export class IaBookReader extends LitElement {
154
166
  ia-item-navigator[viewportinfullscreen] {
155
167
  position: fixed;
156
168
  inset: 0;
157
- height: 100vh;
169
+ height: 100%;
158
170
  min-height: unset;
159
171
  }
160
172
 
161
- div[slot="theater-main"],
162
- div[slot="theater-main"] > * {
173
+ div[slot="main"],
174
+ div[slot="main"] > * {
163
175
  height: inherit;
164
176
  }
165
177
 
@@ -465,7 +465,7 @@ export class BookNavigator extends LitElement {
465
465
  const placeholder = this.bookReaderCannotLoad ? this.itemImage : this.loader;
466
466
  return html`<div id="book-navigator" class="${this.loadingClass}">
467
467
  ${placeholder}
468
- <slot name="theater-main"></slot>
468
+ <slot name="main"></slot>
469
469
  </div>
470
470
  `;
471
471
  }
@@ -57,8 +57,8 @@ export class BookReader extends LitElement {
57
57
  .basehost=${this.baseHost}
58
58
  .item=${this.base64Json}>
59
59
  .sharedObserver=${this.sharedObserver}
60
- <div slot="theater-main">
61
- <slot name="theater-main"></slot>
60
+ <div slot="main">
61
+ <slot name="main"></slot>
62
62
  </div>
63
63
  </ia-item-navigator>
64
64
  </div>
@@ -33,7 +33,7 @@ const container = (sharedObserver = null) => {
33
33
  .sharedObserver=${sharedObserver || new SharedResizeObserver()}
34
34
  .modal=${modalMgr}
35
35
  >
36
- <div slot="theater-main">
36
+ <div slot="main">
37
37
  <div id="BookReader"></div>
38
38
  <p class="visible-in-reader">now showing</p>
39
39
  <\div>
package/webpack.config.js CHANGED
@@ -4,7 +4,7 @@ const webpack = require('webpack');
4
4
 
5
5
  /** @type {webpack.Configuration} */
6
6
  const shared = {
7
- mode: 'production',
7
+ mode: 'development',
8
8
 
9
9
  watchOptions: {
10
10
  ignored: ['BookReader/**', 'node_modules/**', 'tests/**']
@@ -1,117 +0,0 @@
1
- /*!
2
- Colorbox 1.6.4
3
- license: MIT
4
- http://www.jacklmoore.com/colorbox
5
- */
6
-
7
- /*!
8
- * jQuery Color Animations v2.1.2
9
- * https://github.com/jquery/jquery-color
10
- *
11
- * Copyright 2014 jQuery Foundation and other contributors
12
- * Released under the MIT license.
13
- * http://jquery.org/license
14
- *
15
- * Date: Wed Jan 16 08:47:09 2013 -0600
16
- */
17
-
18
- /*!
19
- * jQuery UI Effects 1.12.1
20
- * http://jqueryui.com
21
- *
22
- * Copyright jQuery Foundation and other contributors
23
- * Released under the MIT license.
24
- * http://jquery.org/license
25
- */
26
-
27
- /*!
28
- * jQuery UI Keycode 1.12.1
29
- * http://jqueryui.com
30
- *
31
- * Copyright jQuery Foundation and other contributors
32
- * Released under the MIT license.
33
- * http://jquery.org/license
34
- */
35
-
36
- /*!
37
- * jQuery UI Mouse 1.12.1
38
- * http://jqueryui.com
39
- *
40
- * Copyright jQuery Foundation and other contributors
41
- * Released under the MIT license.
42
- * http://jquery.org/license
43
- */
44
-
45
- /*!
46
- * jQuery UI Slider 1.12.1
47
- * http://jqueryui.com
48
- *
49
- * Copyright jQuery Foundation and other contributors
50
- * Released under the MIT license.
51
- * http://jquery.org/license
52
- */
53
-
54
- /*!
55
- * jQuery UI Touch Punch 0.2.3
56
- *
57
- * Copyright 2011–2014, Dave Furfero
58
- * Dual licensed under the MIT or GPL Version 2 licenses.
59
- *
60
- * Depends:
61
- * jquery.ui.widget.js
62
- * jquery.ui.mouse.js
63
- */
64
-
65
- /*!
66
- * jQuery UI Widget 1.12.1
67
- * http://jqueryui.com
68
- *
69
- * Copyright jQuery Foundation and other contributors
70
- * Released under the MIT license.
71
- * http://jquery.org/license
72
- */
73
-
74
- /*! Hammer.JS - v2.0.7 - 2016-04-22
75
- * http://hammerjs.github.io/
76
- *
77
- * Copyright (c) 2016 Jorik Tangelder;
78
- * Licensed under the MIT license */
79
-
80
- /**
81
- * @license
82
- * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
83
- * This code may only be used under the BSD style license found at
84
- * http://polymer.github.io/LICENSE.txt
85
- * The complete set of authors may be found at
86
- * http://polymer.github.io/AUTHORS.txt
87
- * The complete set of contributors may be found at
88
- * http://polymer.github.io/CONTRIBUTORS.txt
89
- * Code distributed by Google as part of the polymer project is also
90
- * subject to an additional IP rights grant found at
91
- * http://polymer.github.io/PATENTS.txt
92
- */
93
-
94
- /**
95
- * @license
96
- * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
97
- * This code may only be used under the BSD style license found at
98
- * http://polymer.github.io/LICENSE.txt
99
- * The complete set of authors may be found at
100
- * http://polymer.github.io/AUTHORS.txt
101
- * The complete set of contributors may be found at
102
- * http://polymer.github.io/CONTRIBUTORS.txt
103
- * Code distributed by Google as part of the polymer project is also
104
- * subject to an additional IP rights grant found at
105
- * http://polymer.github.io/PATENTS.txt
106
- */
107
-
108
- /**
109
- @license
110
- Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
111
- This code may only be used under the BSD style license found at
112
- http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
113
- http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
114
- found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
115
- part of the polymer project is also subject to an additional IP rights grant
116
- found at http://polymer.github.io/PATENTS.txt
117
- */
@@ -1,39 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4
- * This code may only be used under the BSD style license found at
5
- * http://polymer.github.io/LICENSE.txt
6
- * The complete set of authors may be found at
7
- * http://polymer.github.io/AUTHORS.txt
8
- * The complete set of contributors may be found at
9
- * http://polymer.github.io/CONTRIBUTORS.txt
10
- * Code distributed by Google as part of the polymer project is also
11
- * subject to an additional IP rights grant found at
12
- * http://polymer.github.io/PATENTS.txt
13
- */
14
-
15
- /**
16
- * @license
17
- * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
18
- * This code may only be used under the BSD style license found at
19
- * http://polymer.github.io/LICENSE.txt
20
- * The complete set of authors may be found at
21
- * http://polymer.github.io/AUTHORS.txt
22
- * The complete set of contributors may be found at
23
- * http://polymer.github.io/CONTRIBUTORS.txt
24
- * Code distributed by Google as part of the polymer project is also
25
- * subject to an additional IP rights grant found at
26
- * http://polymer.github.io/PATENTS.txt
27
- */
28
-
29
- /**
30
- * @license
31
- * Copyright 2017 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */
34
-
35
- /**
36
- * @license
37
- * Copyright 2019 Google LLC
38
- * SPDX-License-Identifier: BSD-3-Clause
39
- */
@@ -1,24 +0,0 @@
1
- /*!
2
- * Sizzle CSS Selector Engine v2.2.0-pre
3
- * http://sizzlejs.com/
4
- *
5
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
6
- * Released under the MIT license
7
- * http://jquery.org/license
8
- *
9
- * Date: 2014-12-16
10
- */
11
-
12
- /*!
13
- * jQuery JavaScript Library v1.11.3
14
- * http://jquery.com/
15
- *
16
- * Includes Sizzle.js
17
- * http://sizzlejs.com/
18
- *
19
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
20
- * Released under the MIT license
21
- * http://jquery.org/license
22
- *
23
- * Date: 2015-04-28T16:19Z
24
- */
@@ -1,27 +0,0 @@
1
- /*!
2
- * jQuery Browser Plugin 0.1.0
3
- * https://github.com/gabceb/jquery-browser-plugin
4
- *
5
- * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors
6
- * http://jquery.org/license
7
- *
8
- * Modifications Copyright 2015 Gabriel Cebrian
9
- * https://github.com/gabceb
10
- *
11
- * Released under the MIT license
12
- *
13
- * Date: 05-07-2015
14
- */
15
-
16
- /** @license
17
- *
18
- * SoundManager 2: JavaScript Sound for the Web
19
- * ----------------------------------------------
20
- * http://schillmania.com/projects/soundmanager2/
21
- *
22
- * Copyright (c) 2007, Scott Schiller. All rights reserved.
23
- * Code provided under the BSD License:
24
- * http://schillmania.com/projects/soundmanager2/license.txt
25
- *
26
- * V2.97a.20170601
27
- */
@@ -1,9 +0,0 @@
1
- /**
2
- @license @nocompile
3
- Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
- Code distributed by Google as part of the polymer project is also
8
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
- */