@nypl/web-reader 0.3.3 → 1.1.0-1

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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ServiceWorker/sw.js +1 -1
  3. package/dist/cjs/ServiceWorker/sw.js.map +2 -2
  4. package/dist/cjs/index.css +1 -1
  5. package/dist/cjs/index.css.map +3 -3
  6. package/dist/cjs/index.js +26 -160
  7. package/dist/cjs/index.js.map +3 -3
  8. package/dist/esm/ServiceWorker/sw.js +14 -21
  9. package/dist/esm/ServiceWorker/sw.js.map +2 -2
  10. package/dist/esm/index.css +0 -1124
  11. package/dist/esm/index.css.map +3 -3
  12. package/dist/esm/index.js +2658 -60852
  13. package/dist/esm/index.js.map +3 -3
  14. package/dist/injectable-html-styles.css +1 -1
  15. package/dist/injectable-html-styles.css.map +3 -3
  16. package/dist/types/HtmlReader/effects.d.ts +17 -0
  17. package/dist/types/HtmlReader/index.d.ts +16 -30
  18. package/dist/types/HtmlReader/lib.d.ts +112 -0
  19. package/dist/types/HtmlReader/reducer.d.ts +8 -0
  20. package/dist/types/HtmlReader/types.d.ts +109 -0
  21. package/dist/types/HtmlReader/useIframeLinkClick.d.ts +3 -0
  22. package/dist/types/HtmlReader/useLocationQuery.d.ts +8 -0
  23. package/dist/types/HtmlReader/useResource.d.ts +13 -0
  24. package/dist/types/HtmlReader/useUpdateCSS.d.ts +7 -0
  25. package/dist/types/HtmlReader/useUpdateScroll.d.ts +6 -0
  26. package/dist/types/HtmlReader/useWindowResize.d.ts +6 -0
  27. package/dist/types/Readium/Injectable.d.ts +11 -0
  28. package/dist/types/Readium/Locator.d.ts +20 -0
  29. package/dist/types/constants.d.ts +1 -0
  30. package/dist/types/types.d.ts +21 -1
  31. package/dist/types/ui/LoadingSkeleton.d.ts +4 -0
  32. package/package.json +8 -7
  33. package/dist/types/HtmlReader/HtmlReaderContent.d.ts +0 -7
@@ -17,9 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __require = typeof require !== "undefined" ? require : (x) => {
21
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
- };
23
20
  var __async = (__this, __arguments, generator) => {
24
21
  return new Promise((resolve, reject) => {
25
22
  var fulfilled = (value) => {
@@ -42,7 +39,6 @@ var __async = (__this, __arguments, generator) => {
42
39
  };
43
40
 
44
41
  // node_modules/workbox-core/_version.js
45
- "use strict";
46
42
  try {
47
43
  self["workbox:core:6.2.4"] && _();
48
44
  } catch (e) {
@@ -120,7 +116,7 @@ var WorkboxError = class extends Error {
120
116
  };
121
117
 
122
118
  // node_modules/workbox-core/models/quotaErrorCallbacks.js
123
- var quotaErrorCallbacks = new Set();
119
+ var quotaErrorCallbacks = /* @__PURE__ */ new Set();
124
120
 
125
121
  // node_modules/workbox-core/registerQuotaErrorCallback.js
126
122
  function registerQuotaErrorCallback(callback) {
@@ -274,11 +270,11 @@ function getCursorAdvanceMethods() {
274
270
  IDBCursor.prototype.continuePrimaryKey
275
271
  ]);
276
272
  }
277
- var cursorRequestMap = new WeakMap();
278
- var transactionDoneMap = new WeakMap();
279
- var transactionStoreNamesMap = new WeakMap();
280
- var transformCache = new WeakMap();
281
- var reverseTransformCache = new WeakMap();
273
+ var cursorRequestMap = /* @__PURE__ */ new WeakMap();
274
+ var transactionDoneMap = /* @__PURE__ */ new WeakMap();
275
+ var transactionStoreNamesMap = /* @__PURE__ */ new WeakMap();
276
+ var transformCache = /* @__PURE__ */ new WeakMap();
277
+ var reverseTransformCache = /* @__PURE__ */ new WeakMap();
282
278
  function promisifyRequest(request) {
283
279
  const promise = new Promise((resolve, reject) => {
284
280
  const unlisten = () => {
@@ -425,7 +421,7 @@ function deleteDB(name, { blocked } = {}) {
425
421
  }
426
422
  var readMethods = ["get", "getKey", "getAll", "getAllKeys", "count"];
427
423
  var writeMethods = ["put", "add", "delete", "clear"];
428
- var cachedMethods = new Map();
424
+ var cachedMethods = /* @__PURE__ */ new Map();
429
425
  function getMethod(target, prop) {
430
426
  if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === "string")) {
431
427
  return;
@@ -459,7 +455,6 @@ replaceTraps((oldTraps) => __spreadProps(__spreadValues({}, oldTraps), {
459
455
  }));
460
456
 
461
457
  // node_modules/workbox-expiration/_version.js
462
- "use strict";
463
458
  try {
464
459
  self["workbox:expiration:6.2.4"] && _();
465
460
  } catch (e) {
@@ -731,7 +726,7 @@ var ExpirationPlugin = class {
731
726
  }
732
727
  this._config = config;
733
728
  this._maxAgeSeconds = config.maxAgeSeconds;
734
- this._cacheExpirations = new Map();
729
+ this._cacheExpirations = /* @__PURE__ */ new Map();
735
730
  if (config.purgeOnQuotaError) {
736
731
  registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());
737
732
  }
@@ -776,13 +771,12 @@ var ExpirationPlugin = class {
776
771
  yield self.caches.delete(cacheName);
777
772
  yield cacheExpiration.delete();
778
773
  }
779
- this._cacheExpirations = new Map();
774
+ this._cacheExpirations = /* @__PURE__ */ new Map();
780
775
  });
781
776
  }
782
777
  };
783
778
 
784
779
  // node_modules/workbox-strategies/_version.js
785
- "use strict";
786
780
  try {
787
781
  self["workbox:strategies:6.2.4"] && _();
788
782
  } catch (e) {
@@ -809,7 +803,7 @@ var StrategyHandler = class {
809
803
  this._handlerDeferred = new Deferred();
810
804
  this._extendLifetimePromises = [];
811
805
  this._plugins = [...strategy.plugins];
812
- this._pluginStateMap = new Map();
806
+ this._pluginStateMap = /* @__PURE__ */ new Map();
813
807
  for (const plugin of this._plugins) {
814
808
  this._pluginStateMap.set(plugin, {});
815
809
  }
@@ -1283,7 +1277,6 @@ var PRECACHE_PUBLICATIONS = "PRECACHE_PUBLICATIONS";
1283
1277
  var CACHE_EXPIRATION_SECONDS = 7 * 24 * 60 * 60;
1284
1278
 
1285
1279
  // node_modules/workbox-routing/_version.js
1286
- "use strict";
1287
1280
  try {
1288
1281
  self["workbox:routing:6.2.4"] && _();
1289
1282
  } catch (e) {
@@ -1371,8 +1364,8 @@ var RegExpRoute = class extends Route {
1371
1364
  // node_modules/workbox-routing/Router.js
1372
1365
  var Router = class {
1373
1366
  constructor() {
1374
- this._routes = new Map();
1375
- this._defaultHandlerMap = new Map();
1367
+ this._routes = /* @__PURE__ */ new Map();
1368
+ this._defaultHandlerMap = /* @__PURE__ */ new Map();
1376
1369
  }
1377
1370
  get routes() {
1378
1371
  return this._routes;
@@ -1663,7 +1656,7 @@ function initWebReaderSW({
1663
1656
  log("INSTALLED");
1664
1657
  });
1665
1658
  }
1666
- event.waitUntil(installSW);
1659
+ event.waitUntil(installSW());
1667
1660
  });
1668
1661
  self.addEventListener("message", (event) => __async(this, null, function* () {
1669
1662
  if (event.data.type === PRECACHE_PUBLICATIONS) {
@@ -1711,7 +1704,7 @@ function initWebReaderSW({
1711
1704
  var _a2, _b;
1712
1705
  const resourceHrefs = extractHrefs((_a2 = pub.manifest.resources) != null ? _a2 : [], pub.manifestUrl, pub.proxyUrl);
1713
1706
  const readingOrderHrefs = extractHrefs((_b = pub.manifest.readingOrder) != null ? _b : [], pub.manifestUrl, pub.proxyUrl);
1714
- const allResourcesToCache = Array.from(new Set([...resourceHrefs, ...readingOrderHrefs]));
1707
+ const allResourcesToCache = Array.from(/* @__PURE__ */ new Set([...resourceHrefs, ...readingOrderHrefs]));
1715
1708
  yield Promise.all(allResourcesToCache.map((url) => __async(this, null, function* () {
1716
1709
  registerRoute(url, cacheFirst);
1717
1710
  const match = yield cache.match(url);