@internetarchive/bookreader 5.0.0-12-fixsorting-7 → 5.0.0-120

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.
Files changed (420) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +670 -1190
  4. package/BookReader/bergamot-translator-worker.js +2966 -0
  5. package/BookReader/bergamot-translator-worker.wasm +0 -0
  6. package/BookReader/hypothesis/LICENSE +50 -0
  7. package/BookReader/hypothesis/README.md +55 -0
  8. package/BookReader/hypothesis/build/boot-template.js +1 -0
  9. package/BookReader/hypothesis/build/boot.js +1 -0
  10. package/BookReader/hypothesis/build/manifest.json +20 -0
  11. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +199 -0
  12. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  13. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +811 -0
  14. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +437 -0
  16. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/styles/annotator.css +4 -0
  18. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  19. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  20. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  40. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  41. package/BookReader/hypothesis/build/styles/katex.min.css +3 -0
  42. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +14 -0
  44. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/sidebar.css +4 -0
  46. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/ui-playground.css +4 -0
  48. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  49. package/BookReader/hypothesis/package.json +126 -0
  50. package/BookReader/ia-bookreader.js +1886 -0
  51. package/BookReader/{BookReader.js.LICENSE.txt → ia-bookreader.js.LICENSE.txt} +26 -20
  52. package/BookReader/ia-bookreader.js.map +1 -0
  53. package/BookReader/icons/1up.svg +1 -12
  54. package/BookReader/icons/2up.svg +1 -15
  55. package/BookReader/icons/advance.svg +3 -26
  56. package/BookReader/icons/chevron-right.svg +1 -1
  57. package/BookReader/icons/close-circle-dark.svg +1 -1
  58. package/BookReader/icons/close-circle.svg +1 -1
  59. package/BookReader/icons/fullscreen.svg +1 -17
  60. package/BookReader/icons/fullscreen_exit.svg +1 -17
  61. package/BookReader/icons/hamburger.svg +1 -15
  62. package/BookReader/icons/left-arrow.svg +1 -12
  63. package/BookReader/icons/magnify-minus.svg +1 -16
  64. package/BookReader/icons/magnify-plus.svg +1 -17
  65. package/BookReader/icons/magnify.svg +1 -15
  66. package/BookReader/icons/pause.svg +1 -23
  67. package/BookReader/icons/play.svg +1 -22
  68. package/BookReader/icons/playback-speed.svg +1 -34
  69. package/BookReader/icons/read-aloud.svg +1 -22
  70. package/BookReader/icons/review.svg +3 -22
  71. package/BookReader/icons/slider-toggle.svg +1 -0
  72. package/BookReader/icons/thumbnails.svg +1 -17
  73. package/BookReader/icons/voice.svg +1 -0
  74. package/BookReader/icons/volume-full.svg +1 -22
  75. package/BookReader/images/BRicons.svg +5 -94
  76. package/BookReader/images/books_graphic.svg +1 -177
  77. package/BookReader/images/hypothesis.ico +0 -0
  78. package/BookReader/images/icon_book.svg +1 -12
  79. package/BookReader/images/icon_bookmark.svg +1 -12
  80. package/BookReader/images/icon_experiment.svg +1 -0
  81. package/BookReader/images/icon_gear.svg +1 -14
  82. package/BookReader/images/icon_hamburger.svg +1 -20
  83. package/BookReader/images/icon_home.svg +1 -21
  84. package/BookReader/images/icon_info.svg +1 -11
  85. package/BookReader/images/icon_one_page.svg +1 -8
  86. package/BookReader/images/icon_pause.svg +1 -1
  87. package/BookReader/images/icon_play.svg +1 -1
  88. package/BookReader/images/icon_playback-rate.svg +1 -15
  89. package/BookReader/images/icon_search_button.svg +1 -8
  90. package/BookReader/images/icon_share.svg +1 -9
  91. package/BookReader/images/icon_skip-ahead.svg +1 -6
  92. package/BookReader/images/icon_skip-back.svg +2 -13
  93. package/BookReader/images/icon_speaker.svg +1 -18
  94. package/BookReader/images/icon_speaker_open.svg +1 -10
  95. package/BookReader/images/icon_thumbnails.svg +1 -12
  96. package/BookReader/images/icon_toc.svg +1 -5
  97. package/BookReader/images/icon_two_pages.svg +1 -9
  98. package/BookReader/images/marker_chap-off.svg +1 -11
  99. package/BookReader/images/marker_chap-on.svg +1 -11
  100. package/BookReader/images/marker_srch-on.svg +1 -11
  101. package/BookReader/images/translate.svg +1 -0
  102. package/BookReader/images/unviewable_page.png +0 -0
  103. package/BookReader/jquery-3.js +2 -0
  104. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  105. package/BookReader/plugins/plugin.archive_analytics.js +1 -172
  106. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  107. package/BookReader/plugins/plugin.autoplay.js +1 -165
  108. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  109. package/BookReader/plugins/plugin.chapters.js +19 -301
  110. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  111. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  112. package/BookReader/plugins/plugin.experiments.js +3 -0
  113. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  114. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  115. package/BookReader/plugins/plugin.iframe.js +1 -74
  116. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  117. package/BookReader/plugins/plugin.iiif.js +2 -0
  118. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  119. package/BookReader/plugins/plugin.resume.js +1 -368
  120. package/BookReader/plugins/plugin.resume.js.map +1 -1
  121. package/BookReader/plugins/plugin.search.js +2 -1385
  122. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  123. package/BookReader/plugins/plugin.search.js.map +1 -1
  124. package/BookReader/plugins/plugin.text_selection.js +2 -1080
  125. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  126. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  127. package/BookReader/plugins/plugin.translate.js +3 -0
  128. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  129. package/BookReader/plugins/plugin.translate.js.map +1 -0
  130. package/BookReader/plugins/plugin.tts.js +2 -9193
  131. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  132. package/BookReader/plugins/plugin.tts.js.map +1 -1
  133. package/BookReader/plugins/plugin.url.js +1 -269
  134. package/BookReader/plugins/plugin.url.js.map +1 -1
  135. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -379
  136. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  137. package/BookReader/plugins/translator-worker.js +2 -0
  138. package/BookReader/plugins/translator-worker.js.map +1 -0
  139. package/BookReader/silence.mp3 +0 -0
  140. package/BookReader/translator-worker.js +475 -0
  141. package/BookReader/webcomponents-bundle.js +3 -0
  142. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  143. package/BookReader/webcomponents-bundle.js.map +1 -0
  144. package/README.md +17 -4
  145. package/dist/esm/ia-bookreader.js +3 -0
  146. package/dist/esm/ia-bookreader.js.LICENSE.txt +17 -0
  147. package/dist/esm/ia-bookreader.js.map +1 -0
  148. package/dist/esm/plugins/plugin.archive_analytics.js +2 -0
  149. package/dist/esm/plugins/plugin.archive_analytics.js.map +1 -0
  150. package/dist/esm/plugins/plugin.autoplay.js +2 -0
  151. package/dist/esm/plugins/plugin.autoplay.js.map +1 -0
  152. package/dist/esm/plugins/plugin.chapters.js +2 -0
  153. package/dist/esm/plugins/plugin.chapters.js.map +1 -0
  154. package/dist/esm/plugins/plugin.experiments.js +2 -0
  155. package/dist/esm/plugins/plugin.experiments.js.map +1 -0
  156. package/dist/esm/plugins/plugin.iframe.js +2 -0
  157. package/dist/esm/plugins/plugin.iframe.js.map +1 -0
  158. package/dist/esm/plugins/plugin.iiif.js +2 -0
  159. package/dist/esm/plugins/plugin.iiif.js.map +1 -0
  160. package/dist/esm/plugins/plugin.resume.js +2 -0
  161. package/dist/esm/plugins/plugin.resume.js.map +1 -0
  162. package/dist/esm/plugins/plugin.search.js +2 -0
  163. package/dist/esm/plugins/plugin.search.js.map +1 -0
  164. package/dist/esm/plugins/plugin.text_selection.js +2 -0
  165. package/dist/esm/plugins/plugin.text_selection.js.map +1 -0
  166. package/dist/esm/plugins/plugin.translate.js +2 -0
  167. package/dist/esm/plugins/plugin.translate.js.map +1 -0
  168. package/dist/esm/plugins/plugin.tts.js +2 -0
  169. package/dist/esm/plugins/plugin.tts.js.map +1 -0
  170. package/dist/esm/plugins/plugin.url.js +2 -0
  171. package/dist/esm/plugins/plugin.url.js.map +1 -0
  172. package/dist/esm/plugins/plugin.vendor-fullscreen.js +2 -0
  173. package/dist/esm/plugins/plugin.vendor-fullscreen.js.map +1 -0
  174. package/jsconfig.json +18 -0
  175. package/package.json +113 -71
  176. package/src/BookReader/BookModel.js +92 -46
  177. package/src/BookReader/DragScrollable.js +233 -0
  178. package/src/BookReader/ImageCache.js +49 -16
  179. package/src/BookReader/Mode1Up.js +66 -365
  180. package/src/BookReader/Mode1UpLit.js +392 -0
  181. package/src/BookReader/Mode2Up.js +87 -1315
  182. package/src/BookReader/Mode2UpLit.js +786 -0
  183. package/src/BookReader/ModeAbstract.js +43 -0
  184. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  185. package/src/BookReader/ModeSmoothZoom.js +312 -0
  186. package/src/BookReader/ModeThumb.js +29 -15
  187. package/src/BookReader/Navbar/Navbar.js +204 -84
  188. package/src/BookReader/PageContainer.js +120 -23
  189. package/src/BookReader/ReduceSet.js +2 -2
  190. package/src/BookReader/Toolbar/Toolbar.js +18 -40
  191. package/src/BookReader/events.js +3 -3
  192. package/src/BookReader/options.js +105 -18
  193. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  194. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  195. package/src/BookReader/utils/SelectionObserver.js +72 -0
  196. package/src/BookReader/utils/classes.js +1 -1
  197. package/src/BookReader/utils.js +136 -12
  198. package/src/BookReader.js +732 -1231
  199. package/src/BookReaderPlugin.js +52 -0
  200. package/src/assets/icons/magnify-minus.svg +3 -7
  201. package/src/assets/icons/magnify-plus.svg +3 -7
  202. package/src/assets/icons/slider-toggle.svg +1 -0
  203. package/src/assets/icons/voice.svg +1 -0
  204. package/src/assets/images/hypothesis.ico +0 -0
  205. package/src/assets/images/icon_experiment.svg +1 -0
  206. package/src/assets/images/translate.svg +1 -0
  207. package/src/assets/images/unviewable_page.png +0 -0
  208. package/src/assets/silence.mp3 +0 -0
  209. package/src/css/BookReader.scss +1 -5
  210. package/src/css/_BRBookmarks.scss +1 -1
  211. package/src/css/_BRComponent.scss +1 -1
  212. package/src/css/_BRicon.scss +8 -2
  213. package/src/css/_BRmain.scss +16 -3
  214. package/src/css/_BRnav.scss +74 -70
  215. package/src/css/_BRpages.scss +174 -42
  216. package/src/css/_BRsearch.scss +69 -30
  217. package/src/css/_BRtoolbar.scss +5 -5
  218. package/src/css/_TextSelection.scss +249 -25
  219. package/src/css/_colorbox.scss +2 -2
  220. package/src/css/_controls.scss +24 -7
  221. package/src/css/_icons.scss +8 -1
  222. package/src/{BookNavigator/assets → css}/button-base.js +2 -2
  223. package/src/css/icon_checkmark.js +9 -0
  224. package/src/css/sharedStyles.js +15 -0
  225. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  226. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
  227. package/src/ia-bookreader/ia-bookreader.js +686 -0
  228. package/src/ia-bookreader/sharing.js +27 -0
  229. package/src/ia-bookreader/viewable-files.js +98 -0
  230. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  231. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  232. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  233. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  234. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
  235. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  236. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
  237. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  238. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  239. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  240. package/src/plugins/plugin.archive_analytics.js +84 -78
  241. package/src/plugins/plugin.autoplay.js +99 -104
  242. package/src/plugins/plugin.chapters.js +323 -205
  243. package/src/plugins/plugin.experiments.js +375 -0
  244. package/src/plugins/plugin.iframe.js +36 -37
  245. package/src/plugins/plugin.iiif.js +147 -0
  246. package/src/plugins/plugin.resume.js +54 -51
  247. package/src/plugins/plugin.text_selection.js +464 -219
  248. package/src/plugins/plugin.vendor-fullscreen.js +5 -5
  249. package/src/plugins/search/plugin.search.js +347 -397
  250. package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
  251. package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
  252. package/src/plugins/search/utils.js +50 -0
  253. package/src/plugins/search/view.js +51 -69
  254. package/src/plugins/translate/TranslationManager.js +164 -0
  255. package/src/plugins/translate/plugin.translate.js +559 -0
  256. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  257. package/src/plugins/tts/FestivalTTSEngine.js +20 -30
  258. package/src/plugins/tts/PageChunk.js +117 -23
  259. package/src/plugins/tts/PageChunkIterator.js +11 -17
  260. package/src/plugins/tts/WebTTSEngine.js +132 -92
  261. package/src/plugins/tts/plugin.tts.js +341 -351
  262. package/src/plugins/tts/utils.js +76 -67
  263. package/src/plugins/url/UrlPlugin.js +213 -0
  264. package/src/plugins/{plugin.url.js → url/plugin.url.js} +54 -18
  265. package/src/util/TextSelectionManager.js +1464 -0
  266. package/src/util/browserSniffing.js +42 -1
  267. package/src/util/cache.js +20 -0
  268. package/src/util/docCookies.js +21 -2
  269. package/src/util/dom.js +88 -0
  270. package/src/util/generators.js +89 -0
  271. package/src/util/lit.js +15 -0
  272. package/src/util/strings.js +11 -0
  273. package/.babelrc +0 -12
  274. package/.dependabot/config.yml +0 -6
  275. package/.eslintrc.js +0 -50
  276. package/.gitattributes +0 -2
  277. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  278. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  279. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  280. package/.github/workflows/node.js.yml +0 -37
  281. package/.github/workflows/npm-publish.yml +0 -47
  282. package/.testcaferc.json +0 -5
  283. package/BookReader/BookReader.js +0 -21613
  284. package/BookReader/BookReader.js.map +0 -1
  285. package/BookReader/bookreader-component-bundle.js +0 -14497
  286. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  287. package/BookReader/bookreader-component-bundle.js.map +0 -1
  288. package/BookReader/jquery-1.10.1.js +0 -108
  289. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  290. package/BookReader/plugins/plugin.menu_toggle.js +0 -369
  291. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  292. package/BookReader/plugins/plugin.mobile_nav.js +0 -335
  293. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  294. package/BookReaderDemo/BookReaderDemo.css +0 -41
  295. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  296. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  297. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  298. package/BookReaderDemo/IIIFBookReader.js +0 -207
  299. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  300. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  301. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  302. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  303. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  304. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  305. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  306. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  307. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  308. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  309. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  310. package/BookReaderDemo/demo-advanced.html +0 -33
  311. package/BookReaderDemo/demo-autoplay.html +0 -38
  312. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  313. package/BookReaderDemo/demo-embed.html +0 -26
  314. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  315. package/BookReaderDemo/demo-fullscreen.html +0 -33
  316. package/BookReaderDemo/demo-iiif.html +0 -34
  317. package/BookReaderDemo/demo-iiif.js +0 -26
  318. package/BookReaderDemo/demo-internetarchive.html +0 -74
  319. package/BookReaderDemo/demo-multiple.html +0 -43
  320. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  321. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  322. package/BookReaderDemo/demo-simple.html +0 -34
  323. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  324. package/BookReaderDemo/immersion-1up.html +0 -64
  325. package/BookReaderDemo/immersion-mode.html +0 -35
  326. package/BookReaderDemo/toggle_controls.html +0 -53
  327. package/BookReaderDemo/view_mode.html +0 -39
  328. package/BookReaderDemo/viewmode-cycle.html +0 -41
  329. package/CHANGELOG.md +0 -499
  330. package/CONTRIBUTING.md +0 -7
  331. package/codecov.yml +0 -17
  332. package/index.html +0 -31
  333. package/karma.conf.js +0 -23
  334. package/screenshot.png +0 -0
  335. package/scripts/postversion.js +0 -10
  336. package/scripts/preversion.js +0 -14
  337. package/scripts/version.js +0 -26
  338. package/src/BookNavigator/BookModel.js +0 -14
  339. package/src/BookNavigator/BookNavigator.js +0 -459
  340. package/src/BookNavigator/assets/book-loader.js +0 -27
  341. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  342. package/src/BookNavigator/assets/icon_close.js +0 -3
  343. package/src/BookNavigator/assets/icon_sort_ascending.js +0 -5
  344. package/src/BookNavigator/assets/icon_sort_descending.js +0 -5
  345. package/src/BookNavigator/assets/icon_sort_neutral.js +0 -5
  346. package/src/BookNavigator/assets/icon_volumes.js +0 -11
  347. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  348. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  349. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  350. package/src/BookNavigator/search/a-search-result.js +0 -55
  351. package/src/BookNavigator/volumes/volumes-provider.js +0 -83
  352. package/src/BookNavigator/volumes/volumes.js +0 -178
  353. package/src/BookReader/DebugConsole.js +0 -54
  354. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  355. package/src/ItemNavigator/ItemNavigator.js +0 -376
  356. package/src/ItemNavigator/providers/sharing.js +0 -33
  357. package/src/css/_MobileNav.scss +0 -194
  358. package/src/dragscrollable-br.js +0 -261
  359. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  360. package/src/plugins/plugin.mobile_nav.js +0 -287
  361. package/tests/BookReader/BookModel.test.js +0 -312
  362. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  363. package/tests/BookReader/DebugConsole.test.js +0 -25
  364. package/tests/BookReader/ImageCache.test.js +0 -150
  365. package/tests/BookReader/Mode1Up.test.js +0 -164
  366. package/tests/BookReader/Mode2Up.test.js +0 -247
  367. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  368. package/tests/BookReader/PageContainer.test.js +0 -115
  369. package/tests/BookReader/ReduceSet.test.js +0 -38
  370. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  371. package/tests/BookReader/utils/classes.test.js +0 -88
  372. package/tests/BookReader/utils.test.js +0 -109
  373. package/tests/BookReader.options.test.js +0 -39
  374. package/tests/BookReader.test.js +0 -301
  375. package/tests/e2e/README.md +0 -75
  376. package/tests/e2e/autoplay.test.js +0 -13
  377. package/tests/e2e/base.test.js +0 -35
  378. package/tests/e2e/helpers/base.js +0 -263
  379. package/tests/e2e/helpers/debug.js +0 -13
  380. package/tests/e2e/helpers/desktopSearch.js +0 -72
  381. package/tests/e2e/helpers/mobileSearch.js +0 -85
  382. package/tests/e2e/helpers/mockSearch.js +0 -93
  383. package/tests/e2e/helpers/rightToLeft.js +0 -29
  384. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  385. package/tests/e2e/models/BookReader.js +0 -11
  386. package/tests/e2e/models/Navigation.js +0 -56
  387. package/tests/e2e/rightToLeft.test.js +0 -20
  388. package/tests/e2e/viewmode.test.js +0 -37
  389. package/tests/karma/BookNavigator/book-navigator.test.js +0 -139
  390. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  391. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  392. package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
  393. package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
  394. package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +0 -40
  395. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  396. package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +0 -141
  397. package/tests/karma/BookNavigator/volumes/volumes.test.js +0 -98
  398. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  399. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  400. package/tests/plugins/plugin.autoplay.test.js +0 -52
  401. package/tests/plugins/plugin.chapters.test.js +0 -130
  402. package/tests/plugins/plugin.iframe.test.js +0 -42
  403. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  404. package/tests/plugins/plugin.resume.test.js +0 -98
  405. package/tests/plugins/plugin.text_selection.test.js +0 -203
  406. package/tests/plugins/plugin.url.test.js +0 -129
  407. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  408. package/tests/plugins/search/plugin.search.test.js +0 -173
  409. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  410. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  411. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  412. package/tests/plugins/tts/PageChunk.test.js +0 -57
  413. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  414. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  415. package/tests/plugins/tts/utils.test.js +0 -133
  416. package/tests/util/browserSniffing.test.js +0 -56
  417. package/tests/util/docCookies.test.js +0 -15
  418. package/tests/util/strings.test.js +0 -63
  419. package/tests/utils.js +0 -42
  420. package/webpack.config.js +0 -86
@@ -7,7 +7,17 @@
7
7
  * @return {boolean}
8
8
  */
9
9
  export function isChrome(userAgent = navigator.userAgent, vendor = navigator.vendor) {
10
- return /chrome/i.test(userAgent) && /google inc/i.test(vendor);
10
+ return /chrome/i.test(userAgent) && /google inc/i.test(vendor) && !isEdge(userAgent);
11
+ }
12
+
13
+ /**
14
+ * Checks whether the current browser is a Edge browser
15
+ * See https://learn.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance
16
+ * @param {string} [userAgent]
17
+ * @return {boolean}
18
+ */
19
+ export function isEdge(userAgent = navigator.userAgent) {
20
+ return /chrome/i.test(userAgent) && /\bEdg(e|A|iOS)?\b/i.test(userAgent);
11
21
  }
12
22
 
13
23
  /**
@@ -28,3 +38,34 @@ export function isFirefox(userAgent = navigator.userAgent) {
28
38
  export function isSafari(userAgent = navigator.userAgent) {
29
39
  return /safari/i.test(userAgent) && !/chrome|chromium/i.test(userAgent);
30
40
  }
41
+
42
+ /**
43
+ * Checks whether the current browser is iOS (and hence iOS webkit)
44
+ * @return {boolean}
45
+ */
46
+ export function isIOS() {
47
+ // We can't just check the userAgent because as of iOS 13,
48
+ // the userAgent is the same as desktop Safari because
49
+ // they wanted iPad's to be served the same version of websites
50
+ // as desktops.
51
+ return 'ongesturestart' in window && navigator.maxTouchPoints > 0;
52
+ }
53
+
54
+ /**
55
+ * Checks whether the current browser is on android
56
+ * @param {string} [userAgent]
57
+ * @return {boolean}
58
+ */
59
+ export function isAndroid(userAgent = navigator.userAgent) {
60
+ return /android/i.test(userAgent);
61
+ }
62
+
63
+ /**
64
+ * Checks whether the current browser is Samsung Internet
65
+ * https://stackoverflow.com/a/40684162/2317712
66
+ * @param {string} [userAgent]
67
+ * @return {boolean}
68
+ */
69
+ export function isSamsungInternet(userAgent = navigator.userAgent) {
70
+ return /SamsungBrowser/i.test(userAgent);
71
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @template T
3
+ */
4
+ export class Cache {
5
+ constructor(maxSize = 10) {
6
+ this.maxSize = maxSize;
7
+ /** @type {T[]} */
8
+ this.entries = [];
9
+ }
10
+
11
+ /**
12
+ * @param {T} entry
13
+ */
14
+ add(entry) {
15
+ if (this.entries.length >= this.maxSize) {
16
+ this.entries.shift();
17
+ }
18
+ this.entries.push(entry);
19
+ }
20
+ }
@@ -9,6 +9,22 @@
9
9
  * http://www.gnu.org/licenses/gpl-3.0-standalone.html
10
10
  */
11
11
 
12
+ /**
13
+ * Check to see if the browser has cookies enabled.
14
+ * Accessing document.cookies errors if eg iframe with sandbox enabled.
15
+ * @returns {boolean}
16
+ */
17
+ export function areCookiesBlocked(doc = document) {
18
+ try {
19
+ doc.cookie;
20
+ return false;
21
+ } catch (e) {
22
+ return true;
23
+ }
24
+ }
25
+
26
+ const COOKIES_BLOCKED = areCookiesBlocked();
27
+
12
28
  /**
13
29
  * Get specific key's value stored in cookie
14
30
  *
@@ -17,7 +33,7 @@
17
33
  * @returns {string|null}
18
34
  */
19
35
  export function getItem(sKey) {
20
- if (!sKey) return null;
36
+ if (COOKIES_BLOCKED || !sKey) return null;
21
37
 
22
38
  return decodeURIComponent(
23
39
  // eslint-disable-next-line no-useless-escape
@@ -34,9 +50,11 @@ export function getItem(sKey) {
34
50
  * @param {string} [sDomain] domain name
35
51
  * @param {boolean} [bSecure]
36
52
  *
37
- * @returns {true}
53
+ * @returns {boolean}
38
54
  */
39
55
  export function setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure) {
56
+ if (COOKIES_BLOCKED) return false;
57
+
40
58
  document.cookie = encodeURIComponent(sKey) + '=' + encodeURIComponent(sValue)
41
59
  + (vEnd ? `; expires=${vEnd.toUTCString()}` : '')
42
60
  + (sDomain ? `; domain=${sDomain}` : '')
@@ -56,6 +74,7 @@ export function setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure) {
56
74
  * @returns {boolean}
57
75
  */
58
76
  export function removeItem(sKey, sPath, sDomain) {
77
+ if (COOKIES_BLOCKED) return false;
59
78
  // eslint-disable-next-line
60
79
  if (!hasItem(sKey)) return false;
61
80
 
@@ -0,0 +1,88 @@
1
+ // @ts-check
2
+ import { clamp } from '../BookReader/utils.js';
3
+
4
+ /**
5
+ * Walks up the DOM tree starting at (but not including) the given element,
6
+ * returning the nearest ancestor that can actually scroll its overflow.
7
+ * @param {Element} el
8
+ * @return {Element | null}
9
+ */
10
+ export function findScrollableAncestor(el) {
11
+ let current = el.parentElement;
12
+ while (current) {
13
+ const style = getComputedStyle(current);
14
+ const canScrollY = (style.overflowY === 'auto' || style.overflowY === 'scroll') && current.scrollHeight > current.clientHeight;
15
+ const canScrollX = (style.overflowX === 'auto' || style.overflowX === 'scroll') && current.scrollWidth > current.clientWidth;
16
+ if (canScrollY || canScrollX) return current;
17
+ current = current.parentElement;
18
+ }
19
+ return null;
20
+ }
21
+
22
+ /**
23
+ * Computes the scroll offset for a single axis needed to align an element
24
+ * within a container, per the same semantics as scrollIntoView's block/inline.
25
+ * @param {number} elStart
26
+ * @param {number} elEnd
27
+ * @param {number} containerStart
28
+ * @param {number} containerEnd
29
+ * @param {number} currentScroll
30
+ * @param {'start' | 'center' | 'end' | 'nearest'} align
31
+ * @return {number}
32
+ */
33
+ function computeAxisScroll(elStart, elEnd, containerStart, containerEnd, currentScroll, align) {
34
+ let delta = 0;
35
+ switch (align) {
36
+ case 'start':
37
+ delta = elStart - containerStart;
38
+ break;
39
+ case 'end':
40
+ delta = elEnd - containerEnd;
41
+ break;
42
+ case 'center':
43
+ delta = (elStart + elEnd) / 2 - (containerStart + containerEnd) / 2;
44
+ break;
45
+ case 'nearest':
46
+ default:
47
+ if (elStart < containerStart) delta = elStart - containerStart;
48
+ else if (elEnd > containerEnd) delta = elEnd - containerEnd;
49
+ break;
50
+ }
51
+ return currentScroll + delta;
52
+ }
53
+
54
+ /**
55
+ * Scrolls the given element into view within a single scroll container.
56
+ *
57
+ * Unlike the native `Element.scrollIntoView`, this never walks up and scrolls
58
+ * every scrollable ancestor in turn (which can otherwise unexpectedly move
59
+ * the whole page) — it only ever adjusts the scroll position of one
60
+ * container: either the one explicitly passed in, or the nearest scrollable
61
+ * ancestor found via {@link findScrollableAncestor}.
62
+ * @param {Element} el
63
+ * @param {object} [options]
64
+ * @param {'auto' | 'smooth'} [options.behavior]
65
+ * @param {'start' | 'center' | 'end' | 'nearest'} [options.block]
66
+ * @param {'start' | 'center' | 'end' | 'nearest'} [options.inline]
67
+ * @param {Element} [options.scrollContainer] The scrollable element whose
68
+ * scroll position should be adjusted. Defaults to `findScrollableAncestor(el)`.
69
+ */
70
+ export function singleScrollIntoView(el, options) {
71
+ const { block = 'start', inline = 'nearest', behavior = 'auto', scrollContainer = findScrollableAncestor(el) } = options || {};
72
+ if (!scrollContainer) {
73
+ el.scrollIntoView({ block, inline, behavior });
74
+ return;
75
+ }
76
+
77
+ const containerRect = scrollContainer.getBoundingClientRect();
78
+ const elRect = el.getBoundingClientRect();
79
+
80
+ const top = computeAxisScroll(elRect.top, elRect.bottom, containerRect.top, containerRect.bottom, scrollContainer.scrollTop, block);
81
+ const left = computeAxisScroll(elRect.left, elRect.right, containerRect.left, containerRect.right, scrollContainer.scrollLeft, inline);
82
+
83
+ scrollContainer.scrollTo({
84
+ top: clamp(top, 0, scrollContainer.scrollHeight - scrollContainer.clientHeight),
85
+ left: clamp(left, 0, scrollContainer.scrollWidth - scrollContainer.clientWidth),
86
+ behavior,
87
+ });
88
+ }
@@ -0,0 +1,89 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * @template T
5
+ * Get the i-th element of an iterable
6
+ * @param {Iterable<T>} iterable
7
+ * @param {number} index
8
+ */
9
+ export function genAt(iterable, index) {
10
+ let i = 0;
11
+ for (const x of iterable) {
12
+ if (i == index) return x;
13
+ i++;
14
+ }
15
+ return undefined;
16
+ }
17
+
18
+ /**
19
+ * @template T
20
+ * Generator version of filter
21
+ * @param {Iterable<T>} iterable
22
+ * @param {function(T): boolean} fn
23
+ */
24
+ export function* genFilter(iterable, fn) {
25
+ for (const x of iterable) {
26
+ if (fn(x)) yield x;
27
+ }
28
+ }
29
+
30
+ /**
31
+ * @template TFrom, TTo
32
+ * Generator version of map
33
+ * @param {Iterable<TFrom>} gen
34
+ * @param {function(TFrom): TTo} fn
35
+ * @returns {Iterable<TTo>}
36
+ */
37
+ export function* genMap(gen, fn) {
38
+ for (const x of gen) yield fn(x);
39
+ }
40
+
41
+ /**
42
+ * @template T
43
+ * Generator that provides a sliding window of 3 elements,
44
+ * prev, current, and next.
45
+ * @param {Iterable<T>} gen
46
+ * @returns {Iterable<[T | undefined, T, T | undefined]>}
47
+ */
48
+ export function* lookAroundWindow(gen) {
49
+ let prev = undefined;
50
+ let cur = undefined;
51
+ let next = undefined;
52
+ for (const x of gen) {
53
+ if (typeof cur !== 'undefined') {
54
+ next = x;
55
+ yield [prev, cur, next];
56
+ }
57
+ prev = cur;
58
+ cur = x;
59
+ next = undefined;
60
+ }
61
+
62
+ if (typeof cur !== 'undefined') {
63
+ yield [prev, cur, next];
64
+ }
65
+ }
66
+
67
+ /**
68
+ * @template T1, T2
69
+ * Lazy zip implementation to avoid importing lodash
70
+ * Expects iterators to be of the same length
71
+ * @param {Iterable<T1>} gen1
72
+ * @param {Iterable<T2>} gen2
73
+ * @returns {Iterable<[T1, T2]>}
74
+ */
75
+ export function* zip(gen1, gen2) {
76
+ const it1 = gen1[Symbol.iterator]();
77
+ const it2 = gen2[Symbol.iterator]();
78
+ while (true) {
79
+ const r1 = it1.next();
80
+ const r2 = it2.next();
81
+ if (r1.done && r2.done) {
82
+ return;
83
+ }
84
+ if (r1.done || r2.done) {
85
+ throw new Error('zip: one of the iterators is done');
86
+ }
87
+ yield [r1.value, r2.value];
88
+ }
89
+ }
@@ -0,0 +1,15 @@
1
+ import { css } from 'lit';
2
+
3
+ /**
4
+ * Convert an SVG string to a data URL usable in CSS
5
+ * @param {import('lit').TemplateResult} svgTemplate - The SVG template to convert
6
+ * @returns {import('lit').CSSResult}
7
+ */
8
+ export function svgToDataUrl(svgTemplate) {
9
+ // No clue why, on prod the template from the close icon comes in as a class instead of a TemplateResult.
10
+ // Might be a discrepancy with lit versions.
11
+ if (svgTemplate.prototype) svgTemplate = svgTemplate.prototype.render();
12
+
13
+ const svgString = svgTemplate.strings[0];
14
+ return css([`data:image/svg+xml;base64,${btoa(svgString.replace(/\n/g, ' '))}`]);
15
+ }
@@ -5,10 +5,21 @@
5
5
  * supported list of filters)
6
6
  **/
7
7
 
8
+ /**
9
+ * Count whitespace-delimited words in a string.
10
+ * @param {string} text
11
+ * @return {number}
12
+ */
13
+ export function countWords(text) {
14
+ const matches = text.match(/\S+/g);
15
+ return matches ? matches.length : 0;
16
+ }
17
+
8
18
  /**
9
19
  * @param {StringWithVars|String} template
10
20
  * @param { {[varName: string]: { toString: () => string} } } vars
11
21
  * @param { {[varName: string]: { toString: () => string} } } [overrides]
22
+ * @returns {StringWithVars|string}
12
23
  */
13
24
  export function applyVariables(template, vars, overrides = {}, possibleFilters = APPLY_FILTERS) {
14
25
  return template?.replace(/\{\{([^}]*?)\}\}/g, ($0, $1) => {
package/.babelrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "targets": "> 2%, ie 11, edge 14, samsung > 9, OperaMini all, UCAndroid > 12",
7
- "useBuiltIns": "usage",
8
- "corejs": 3
9
- }
10
- ]
11
- ]
12
- }
@@ -1,6 +0,0 @@
1
- version: 1
2
-
3
- update_configs:
4
- - package_manager: "javascript"
5
- directory: "/"
6
- update_schedule: "monthly"
package/.eslintrc.js DELETED
@@ -1,50 +0,0 @@
1
- module.exports = {
2
- "env": {
3
- "browser": true,
4
- "jquery": true,
5
- "es6": true,
6
- "node": true,
7
- "jest": true
8
- },
9
- "plugins": [
10
- "testcafe"
11
- ],
12
- "extends": [
13
- "eslint:recommended",
14
- "plugin:testcafe/recommended"
15
- ],
16
- "globals": {
17
- // Browser API
18
- "MediaMetadata": "readonly"
19
- },
20
- "parserOptions": {
21
- "ecmaVersion": 2020,
22
- "sourceType": "module"
23
- },
24
- "rules": {
25
- "comma-dangle": ["error", "only-multiline"],
26
- "semi": ["error", "always"],
27
- "space-before-blocks": ["error"],
28
- "keyword-spacing": [2, {"before": true, "after": true}],
29
- "indent": ["error", 2],
30
- "no-console": "off", // Used too often behind `debug` options; not dealing with this now
31
- "no-empty": ["error", { "allowEmptyCatch": true }],
32
- "no-trailing-spaces": ["error"],
33
- "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false }], // set args:none; this is generally more annoying than useful
34
- "no-var": ["error"],
35
- "prefer-const": ["error"],
36
- "space-infix-ops": ["error", { "int32Hint": false }],
37
- "eol-last": ["error", "always"]
38
- },
39
- "overrides": [
40
- { // TODO; these should be cleaned up as well
41
- "files": [
42
- "src/BookReader.js",
43
- "src/dragscrollable-br.js"
44
- ],
45
- "rules": {
46
- "no-var": ["off"],
47
- }
48
- },
49
- ],
50
- };
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Build files
2
- BookReader/**/* binary
@@ -1,32 +0,0 @@
1
- ---
2
- name: Bug
3
- about: A general problem with website functionality
4
- title: ''
5
- labels: Bug
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Description**
11
-
12
- > What problem are we solving? What does the experience look like today? What are the symptoms? How can one reproduce the problem?
13
-
14
- **Evidence / Screenshot (if possible)**
15
-
16
- > Include evidence of the problem or provide a screenshot.
17
-
18
- **Expectation**
19
-
20
- > What should be happening? What will it look like / how will it behave when fixed?
21
-
22
- **Context**
23
-
24
- > What operating system? What browser type and version?
25
-
26
- **Proposal & Constraints**
27
-
28
- > What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere?
29
-
30
- **Stakeholders**
31
-
32
- > @-tag any stakeholders of this bug
@@ -1,30 +0,0 @@
1
- ---
2
- name: Feature Request
3
- about: A request for an entirely new feature
4
- title: ''
5
- labels: Feature Request
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Context**
11
-
12
- > Is your feature request related to a problem? What is the motivation for implementing this feature?
13
-
14
- **Proposal & Constraints**
15
-
16
- > What is the proposed solution / implementation? Is there a precedent for this approach succeeding elsewhere?
17
-
18
- > Which suggestions or requirements should be considered for how this feature needs to appear or be implemented?
19
-
20
- **Additional Resources**
21
-
22
- > Add any other screenshots or assets related to the feature request.
23
-
24
- **Success Metrics**
25
-
26
- > How will you know if this change is successful? What specific metrics are relevant and how do you expect them to change?
27
-
28
- **Stakeholders**
29
-
30
- > @-tag stakeholders of this feature
@@ -1,15 +0,0 @@
1
- **Description**
2
-
3
- > What does this PR achieve? Is it a feature/bugfix/refactor? Does it close an Issue? If so, use `Closes #<issue number>`.
4
-
5
- **Technical**
6
-
7
- > What should be noted about the implementation?
8
-
9
- **Testing**
10
-
11
- > What steps should the reviewer take to verify this PR resolves the issue?
12
-
13
- **Screenshots/Videos**
14
-
15
- > Add a screenshot or video/GIF if the fix can be seen visually. This is helpful for reviewers to get context for the fix.
@@ -1,37 +0,0 @@
1
- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name: Node.js CI
5
-
6
- on:
7
- push:
8
- branches: [ master ]
9
- pull_request:
10
- branches: [ master ]
11
-
12
- jobs:
13
- build:
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - uses: actions/checkout@v2
18
- - uses: actions/setup-node@v1
19
- with:
20
- node-version: 14.x
21
- - uses: actions/cache@v2
22
- with:
23
- # Caching node_modules isn't recommended because it can break across
24
- # Node versions and won't work with npm ci (See https://github.com/actions/cache/blob/main/examples.md#node---npm )
25
- # But we pin the node version, and we don't update it that often anyways. And
26
- # we don't use `npm ci` specifically to try to get faster CI flows. So caching
27
- # `node_modules` directly.
28
- path: 'node_modules'
29
- key: ${{ runner.os }}-node-${{ hashFiles('package*.json') }}
30
- - run: npm install
31
- - run: npm run build
32
- - run: npm run lint
33
- - run: npm run test
34
- - run: npm run codecov
35
- # Travis machines usually have 2 cores (see https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system )
36
- # Quarantine mode (sigh) to catch unstable tests (see https://devexpress.github.io/testcafe/documentation/guides/basic-guides/run-tests.html#quarantine-mode )
37
- - run: BASE_URL=http://127.0.0.1:8000/BookReaderDemo/ npx testcafe --concurrency 2 --quarantine-mode
@@ -1,47 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v2
15
- - uses: actions/setup-node@v2
16
- with:
17
- node-version: 14
18
- - run: npm ci
19
- - run: npm test
20
-
21
- publish-npm:
22
- needs: build
23
- runs-on: ubuntu-latest
24
- steps:
25
- - uses: actions/checkout@v2
26
- - uses: actions/setup-node@v2
27
- with:
28
- node-version: 14
29
- registry-url: https://registry.npmjs.org/
30
- - run: npm ci
31
- - run: npm publish --tag next
32
- env:
33
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
34
-
35
- publish-gpr:
36
- needs: build
37
- runs-on: ubuntu-latest
38
- steps:
39
- - uses: actions/checkout@v2
40
- - uses: actions/setup-node@v2
41
- with:
42
- node-version: 14
43
- registry-url: https://npm.pkg.github.com/
44
- - run: npm ci
45
- - run: npm publish --tag next
46
- env:
47
- NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/.testcaferc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "appCommand": "npm run serve",
3
- "browsers": ["chrome:headless", "firefox:headless"],
4
- "src": ["tests/e2e/**/*test.js"]
5
- }