@d-i-t-a/reader 2.3.11 → 2.3.13
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 +37 -11
- package/dist/esm/index.js.map +2 -2
- package/dist/injectables/click/click.js +1 -1
- package/dist/injectables/click/click.js.map +1 -1
- package/dist/reader.css +1 -1
- package/dist/reader.css.map +1 -1
- package/dist/reader.js +62950 -77
- package/dist/reader.js.map +2 -2
- package/dist/types/modules/highlight/TextHighlighter.d.ts +6 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -12262,7 +12262,7 @@ var require_parse = __commonJS({
|
|
|
12262
12262
|
try {
|
|
12263
12263
|
parser.parse();
|
|
12264
12264
|
} catch (e) {
|
|
12265
|
-
if (
|
|
12265
|
+
if (true) {
|
|
12266
12266
|
if (e.name === "CssSyntaxError" && opts && opts.from) {
|
|
12267
12267
|
if (/\.scss$/i.test(opts.from)) {
|
|
12268
12268
|
e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
|
|
@@ -12456,7 +12456,7 @@ var require_lazy_result = __commonJS({
|
|
|
12456
12456
|
return this.css;
|
|
12457
12457
|
}
|
|
12458
12458
|
then(onFulfilled, onRejected) {
|
|
12459
|
-
if (
|
|
12459
|
+
if (true) {
|
|
12460
12460
|
if (!("from" in this.opts)) {
|
|
12461
12461
|
warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
|
|
12462
12462
|
}
|
|
@@ -12603,7 +12603,7 @@ var require_lazy_result = __commonJS({
|
|
|
12603
12603
|
error.plugin = plugin.postcssPlugin;
|
|
12604
12604
|
error.setMessage();
|
|
12605
12605
|
} else if (plugin.postcssVersion) {
|
|
12606
|
-
if (
|
|
12606
|
+
if (true) {
|
|
12607
12607
|
let pluginName = plugin.postcssPlugin;
|
|
12608
12608
|
let pluginVer = plugin.postcssVersion;
|
|
12609
12609
|
let runtimeVer = this.result.processor.version;
|
|
@@ -12849,7 +12849,7 @@ var require_no_work_result = __commonJS({
|
|
|
12849
12849
|
return this._css;
|
|
12850
12850
|
}
|
|
12851
12851
|
then(onFulfilled, onRejected) {
|
|
12852
|
-
if (
|
|
12852
|
+
if (true) {
|
|
12853
12853
|
if (!("from" in this._opts)) {
|
|
12854
12854
|
warnOnce("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");
|
|
12855
12855
|
}
|
|
@@ -12918,7 +12918,7 @@ var require_processor = __commonJS({
|
|
|
12918
12918
|
} else if (typeof i === "function") {
|
|
12919
12919
|
normalized.push(i);
|
|
12920
12920
|
} else if (typeof i === "object" && (i.parse || i.stringify)) {
|
|
12921
|
-
if (
|
|
12921
|
+
if (true) {
|
|
12922
12922
|
throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");
|
|
12923
12923
|
}
|
|
12924
12924
|
} else {
|
|
@@ -50771,6 +50771,12 @@ var NODE_TYPE = {
|
|
|
50771
50771
|
ELEMENT_NODE: 1,
|
|
50772
50772
|
TEXT_NODE: 3
|
|
50773
50773
|
};
|
|
50774
|
+
var MenuPosition;
|
|
50775
|
+
(function(MenuPosition2) {
|
|
50776
|
+
MenuPosition2["INLINE"] = "inline";
|
|
50777
|
+
MenuPosition2["TOP"] = "top";
|
|
50778
|
+
MenuPosition2["BOTTOM"] = "bottom";
|
|
50779
|
+
})(MenuPosition || (MenuPosition = {}));
|
|
50774
50780
|
var _blacklistIdClassForCssSelectors = [
|
|
50775
50781
|
HighlightContainer.R2_ID_HIGHLIGHTS_CONTAINER,
|
|
50776
50782
|
HighlightContainer.R2_ID_PAGEBREAK_CONTAINER,
|
|
@@ -50828,6 +50834,9 @@ var TextHighlighter = class {
|
|
|
50828
50834
|
};
|
|
50829
50835
|
this.layerSettings = layerSettings;
|
|
50830
50836
|
this.properties = properties;
|
|
50837
|
+
if (this.properties.menuPosition == void 0) {
|
|
50838
|
+
this.properties.menuPosition = MenuPosition.INLINE;
|
|
50839
|
+
}
|
|
50831
50840
|
this.api = api;
|
|
50832
50841
|
this.hasEventListener = hasEventListener;
|
|
50833
50842
|
this.options = this.defaults(options, {
|
|
@@ -51407,13 +51416,30 @@ var TextHighlighter = class {
|
|
|
51407
51416
|
let rect = range.getBoundingClientRect();
|
|
51408
51417
|
let toolbox = document.getElementById("highlight-toolbox");
|
|
51409
51418
|
if (toolbox) {
|
|
51410
|
-
|
|
51411
|
-
|
|
51412
|
-
toolbox.style.
|
|
51419
|
+
if (this.properties?.menuPosition === MenuPosition.TOP) {
|
|
51420
|
+
toolbox.style.left = "0px";
|
|
51421
|
+
toolbox.style.transform = "revert";
|
|
51422
|
+
toolbox.style.width = "100%";
|
|
51423
|
+
toolbox.style.textAlign = "center";
|
|
51424
|
+
toolbox.style.position = "absolute";
|
|
51425
|
+
toolbox.style.setProperty("--content", "revert");
|
|
51426
|
+
} else if (this.properties?.menuPosition === MenuPosition.BOTTOM) {
|
|
51427
|
+
toolbox.style.bottom = "0px";
|
|
51428
|
+
toolbox.style.left = "0px";
|
|
51429
|
+
toolbox.style.transform = "revert";
|
|
51430
|
+
toolbox.style.width = "100%";
|
|
51431
|
+
toolbox.style.textAlign = "center";
|
|
51432
|
+
toolbox.style.position = "absolute";
|
|
51433
|
+
toolbox.style.setProperty("--content", "revert");
|
|
51413
51434
|
} else {
|
|
51414
|
-
|
|
51435
|
+
const paginated = this.navigator.view?.isPaginated();
|
|
51436
|
+
if (paginated) {
|
|
51437
|
+
toolbox.style.top = rect.top + (this.navigator.attributes?.navHeight ?? 0) + "px";
|
|
51438
|
+
} else {
|
|
51439
|
+
toolbox.style.top = rect.top + "px";
|
|
51440
|
+
}
|
|
51441
|
+
toolbox.style.left = (rect.right - rect.left) / 2 + rect.left + "px";
|
|
51415
51442
|
}
|
|
51416
|
-
toolbox.style.left = (rect.right - rect.left) / 2 + rect.left + "px";
|
|
51417
51443
|
}
|
|
51418
51444
|
}
|
|
51419
51445
|
toolboxHandler() {
|
|
@@ -55230,7 +55256,7 @@ function delay(t, v) {
|
|
|
55230
55256
|
setTimeout(resolve.bind(null, v), t);
|
|
55231
55257
|
});
|
|
55232
55258
|
}
|
|
55233
|
-
var IS_DEV =
|
|
55259
|
+
var IS_DEV = true;
|
|
55234
55260
|
import_loglevel13.default.setLevel(IS_DEV ? "trace" : "warn", true);
|
|
55235
55261
|
|
|
55236
55262
|
// src/modules/protection/ContentProtectionModule.ts
|