@d-i-t-a/reader 2.1.0-beta.7 → 2.1.0-beta.8
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/dist/esm/index.js +9 -11
- package/dist/esm/index.js.map +2 -2
- package/dist/injectables/style/popup.css +2 -2
- package/dist/reader.js +2 -2
- package/dist/reader.js.map +2 -2
- package/dist/types/model/Locator.d.ts +0 -4
- package/dist/types/modules/search/SearchModule.d.ts +1 -3
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -41690,7 +41690,7 @@ var ContentProtectionModule = class {
|
|
|
41690
41690
|
window.sessionStorage.clear();
|
|
41691
41691
|
window.location.replace(window.location.origin);
|
|
41692
41692
|
}
|
|
41693
|
-
if (typeof config2.api?.inspectDetected === "function") {
|
|
41693
|
+
if (config2.detectInspect && typeof config2.api?.inspectDetected === "function") {
|
|
41694
41694
|
config2.api.inspectDetected();
|
|
41695
41695
|
}
|
|
41696
41696
|
}
|
|
@@ -42301,7 +42301,7 @@ async function searchDocDomSeek(searchInput, doc, href, title, fullWordSearch =
|
|
|
42301
42301
|
// src/modules/search/SearchModule.ts
|
|
42302
42302
|
var import_loglevel14 = __toModule(require_loglevel());
|
|
42303
42303
|
var SearchModule = class {
|
|
42304
|
-
constructor(delegate, publication, properties, highlighter,
|
|
42304
|
+
constructor(delegate, publication, properties, highlighter, api, headerMenu) {
|
|
42305
42305
|
this.currentChapterSearchResult = [];
|
|
42306
42306
|
this.bookSearchResult = [];
|
|
42307
42307
|
this.currentSearchHighlights = [];
|
|
@@ -42311,10 +42311,9 @@ var SearchModule = class {
|
|
|
42311
42311
|
this.properties = properties;
|
|
42312
42312
|
this.api = api;
|
|
42313
42313
|
this.highlighter = highlighter;
|
|
42314
|
-
this.requestConfig = requestConfig;
|
|
42315
42314
|
}
|
|
42316
42315
|
static async create(config2) {
|
|
42317
|
-
const search = new this(config2.delegate, config2.publication, config2, config2.highlighter, config2.
|
|
42316
|
+
const search = new this(config2.delegate, config2.publication, config2, config2.highlighter, config2.api, config2.headerMenu);
|
|
42318
42317
|
await search.start();
|
|
42319
42318
|
return search;
|
|
42320
42319
|
}
|
|
@@ -42738,9 +42737,9 @@ var SearchModule = class {
|
|
|
42738
42737
|
}
|
|
42739
42738
|
if (tocItem) {
|
|
42740
42739
|
let href = this.publication.getAbsoluteHref(tocItem.Href);
|
|
42741
|
-
await fetch(href, this.requestConfig).then((r) => r.text()).then(async (data) => {
|
|
42740
|
+
await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
|
|
42742
42741
|
let parser = new DOMParser();
|
|
42743
|
-
let doc = parser.parseFromString(this.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
|
|
42742
|
+
let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
|
|
42744
42743
|
if (tocItem) {
|
|
42745
42744
|
searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
|
|
42746
42745
|
result.forEach((searchItem) => {
|
|
@@ -42775,9 +42774,9 @@ var SearchModule = class {
|
|
|
42775
42774
|
}
|
|
42776
42775
|
if (tocItem) {
|
|
42777
42776
|
let href = this.publication.getAbsoluteHref(tocItem.Href);
|
|
42778
|
-
await fetch(href, this.requestConfig).then((r) => r.text()).then(async (data) => {
|
|
42777
|
+
await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
|
|
42779
42778
|
let parser = new DOMParser();
|
|
42780
|
-
let doc = parser.parseFromString(this.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
|
|
42779
|
+
let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
|
|
42781
42780
|
if (tocItem) {
|
|
42782
42781
|
searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
|
|
42783
42782
|
result.forEach((searchItem) => {
|
|
@@ -43522,7 +43521,7 @@ var IFrameNavigator = class extends import_eventemitter3.default {
|
|
|
43522
43521
|
this.sampleReadEventHandler = new SampleReadEventHandler(this);
|
|
43523
43522
|
}
|
|
43524
43523
|
static async create(config2) {
|
|
43525
|
-
const navigator2 = new this(config2.settings, config2.annotator || void 0, config2.initialLastReadingPosition || void 0, config2.publication, config2.api, config2.rights, config2.tts, config2.injectables, config2.attributes || { margin: 0 }, config2.services, config2.sample);
|
|
43524
|
+
const navigator2 = new this(config2.settings, config2.annotator || void 0, config2.initialLastReadingPosition || void 0, config2.publication, config2.api, config2.rights, config2.tts, config2.injectables, config2.attributes || { margin: 0 }, config2.services, config2.sample, config2.requestConfig);
|
|
43526
43525
|
await navigator2.start(config2.mainElement, config2.headerMenu, config2.footerMenu);
|
|
43527
43526
|
return new Promise((resolve) => resolve(navigator2));
|
|
43528
43527
|
}
|
|
@@ -48357,8 +48356,7 @@ var D2Reader = class {
|
|
|
48357
48356
|
headerMenu,
|
|
48358
48357
|
delegate: navigator2,
|
|
48359
48358
|
publication,
|
|
48360
|
-
highlighter
|
|
48361
|
-
requestConfig: initialConfig.requestConfig
|
|
48359
|
+
highlighter
|
|
48362
48360
|
}, initialConfig.search)) : void 0;
|
|
48363
48361
|
const definitionsModule = rights.enableDefinitions ? await DefinitionsModule.create(__spreadValues({
|
|
48364
48362
|
delegate: navigator2,
|