@d-i-t-a/reader 2.3.10 → 2.3.12
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 +65 -33
- 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.js +77 -62915
- 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 (false) {
|
|
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 (false) {
|
|
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 (false) {
|
|
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 (false) {
|
|
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 (false) {
|
|
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,27 @@ 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
|
+
} else if (this.properties?.menuPosition === MenuPosition.BOTTOM) {
|
|
51425
|
+
toolbox.style.bottom = "0px";
|
|
51426
|
+
toolbox.style.left = "0px";
|
|
51427
|
+
toolbox.style.transform = "revert";
|
|
51428
|
+
toolbox.style.width = "100%";
|
|
51429
|
+
toolbox.style.textAlign = "center";
|
|
51430
|
+
toolbox.style.position = "absolute";
|
|
51413
51431
|
} else {
|
|
51414
|
-
|
|
51432
|
+
const paginated = this.navigator.view?.isPaginated();
|
|
51433
|
+
if (paginated) {
|
|
51434
|
+
toolbox.style.top = rect.top + (this.navigator.attributes?.navHeight ?? 0) + "px";
|
|
51435
|
+
} else {
|
|
51436
|
+
toolbox.style.top = rect.top + "px";
|
|
51437
|
+
}
|
|
51438
|
+
toolbox.style.left = (rect.right - rect.left) / 2 + rect.left + "px";
|
|
51415
51439
|
}
|
|
51416
|
-
toolbox.style.left = (rect.right - rect.left) / 2 + rect.left + "px";
|
|
51417
51440
|
}
|
|
51418
51441
|
}
|
|
51419
51442
|
toolboxHandler() {
|
|
@@ -55230,7 +55253,7 @@ function delay(t, v) {
|
|
|
55230
55253
|
setTimeout(resolve.bind(null, v), t);
|
|
55231
55254
|
});
|
|
55232
55255
|
}
|
|
55233
|
-
var IS_DEV =
|
|
55256
|
+
var IS_DEV = false;
|
|
55234
55257
|
import_loglevel13.default.setLevel(IS_DEV ? "trace" : "warn", true);
|
|
55235
55258
|
|
|
55236
55259
|
// src/modules/protection/ContentProtectionModule.ts
|
|
@@ -59065,21 +59088,21 @@ var CitationModule = class {
|
|
|
59065
59088
|
let mlaString = "";
|
|
59066
59089
|
let apaString = "";
|
|
59067
59090
|
if (self2.properties.publisher) {
|
|
59068
|
-
mlaString = mlaString + self2.properties.publisher
|
|
59069
|
-
chicagoString = chicagoString + self2.properties.publisher
|
|
59091
|
+
mlaString = mlaString + self2.properties.publisher;
|
|
59092
|
+
chicagoString = chicagoString + self2.properties.publisher;
|
|
59070
59093
|
} else if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
|
|
59071
|
-
mlaString = mlaString + self2.publication.Metadata.Publisher[0].Name
|
|
59072
|
-
chicagoString = chicagoString + self2.publication.Metadata.Publisher[0].Name
|
|
59094
|
+
mlaString = mlaString + self2.publication.Metadata.Publisher[0].Name;
|
|
59095
|
+
chicagoString = chicagoString + self2.publication.Metadata.Publisher[0].Name;
|
|
59073
59096
|
}
|
|
59074
59097
|
if (self2.properties.published) {
|
|
59075
59098
|
apaString = apaString + "(" + self2.properties.published + ")";
|
|
59076
|
-
mlaString = mlaString + self2.properties.published;
|
|
59077
|
-
chicagoString = chicagoString + self2.properties.published;
|
|
59099
|
+
mlaString = mlaString + ", " + self2.properties.published;
|
|
59100
|
+
chicagoString = chicagoString + ", " + self2.properties.published;
|
|
59078
59101
|
} else if (self2.publication.Metadata.PublicationDate) {
|
|
59079
59102
|
if (self2.publication.Metadata.PublicationDate.getFullYear() > 0) {
|
|
59080
59103
|
apaString = apaString + "(" + self2.publication.Metadata.PublicationDate.getFullYear() + ")";
|
|
59081
|
-
mlaString = mlaString + self2.publication.Metadata.PublicationDate.getFullYear();
|
|
59082
|
-
chicagoString = chicagoString + self2.publication.Metadata.PublicationDate.getFullYear();
|
|
59104
|
+
mlaString = mlaString + ", " + self2.publication.Metadata.PublicationDate.getFullYear();
|
|
59105
|
+
chicagoString = chicagoString + ", " + self2.publication.Metadata.PublicationDate.getFullYear();
|
|
59083
59106
|
}
|
|
59084
59107
|
}
|
|
59085
59108
|
if (apaString.length > 0 && mlaString.length > 0 && chicagoString.length > 0) {
|
|
@@ -59090,15 +59113,15 @@ var CitationModule = class {
|
|
|
59090
59113
|
let bookTitleFormatted = function() {
|
|
59091
59114
|
if (self2.properties.title) {
|
|
59092
59115
|
return [
|
|
59093
|
-
self2.properties.title + "
|
|
59094
|
-
self2.properties.title + "
|
|
59095
|
-
self2.properties.title + "
|
|
59116
|
+
"<em>" + self2.properties.title + "</em>. ",
|
|
59117
|
+
"<em>" + self2.properties.title + "</em>. ",
|
|
59118
|
+
"<em>" + self2.properties.title + "</em>. "
|
|
59096
59119
|
];
|
|
59097
59120
|
} else if (self2.publication.Metadata.Title) {
|
|
59098
59121
|
return [
|
|
59099
|
-
self2.publication.Metadata.Title + "
|
|
59100
|
-
self2.publication.Metadata.Title + "
|
|
59101
|
-
self2.publication.Metadata.Title + "
|
|
59122
|
+
"<em>" + self2.publication.Metadata.Title + "</em>. ",
|
|
59123
|
+
"<em>" + self2.publication.Metadata.Title + "</em>. ",
|
|
59124
|
+
"<em>" + self2.publication.Metadata.Title + "</em>. "
|
|
59102
59125
|
];
|
|
59103
59126
|
} else {
|
|
59104
59127
|
return ["", "", ""];
|
|
@@ -59114,11 +59137,11 @@ var CitationModule = class {
|
|
|
59114
59137
|
if (self2.properties.publisher) {
|
|
59115
59138
|
mlaString = mlaString + self2.properties.publisher + ", ";
|
|
59116
59139
|
chicagoString = chicagoString + self2.properties.publisher + ", ";
|
|
59117
|
-
apaString = apaString + self2.properties.publisher
|
|
59140
|
+
apaString = apaString + self2.properties.publisher;
|
|
59118
59141
|
} else if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
|
|
59119
59142
|
mlaString = mlaString + self2.publication.Metadata.Publisher[0].Name + ", ";
|
|
59120
59143
|
chicagoString = chicagoString + self2.publication.Metadata.Publisher[0].Name + ", ";
|
|
59121
|
-
apaString = apaString + self2.publication.Metadata.Publisher[0].Name
|
|
59144
|
+
apaString = apaString + self2.publication.Metadata.Publisher[0].Name;
|
|
59122
59145
|
}
|
|
59123
59146
|
if (apaString.length > 0 && mlaString.length > 0 && chicagoString.length > 0) {
|
|
59124
59147
|
return [chicagoString + ". ", mlaString + ". ", apaString + ". "];
|
|
@@ -59173,18 +59196,27 @@ var CitationModule = class {
|
|
|
59173
59196
|
const chicago = authorsFormatted()[0] + bookTitleFormatted()[0] + contributorsFormatted()[0] + editionFormatted()[0] + locationFormatted()[0] + yearPublishedFormatted()[0] + eBookVersionFormatted()[0] + libraryFormatted()[0] + appNameFormatted()[0] + appLinkFormatted()[0];
|
|
59174
59197
|
const apa = authorsFormatted()[2] + yearPublishedFormatted()[2] + bookTitleFormatted()[2] + editionFormatted()[2] + publisherFormatted()[2] + contributorsFormatted()[2] + eBookVersionFormatted()[2] + locationFormatted()[2] + libraryFormatted()[2] + appNameFormatted()[2] + appLinkFormatted()[2];
|
|
59175
59198
|
const mla = authorsFormatted()[1] + bookTitleFormatted()[1] + contributorsFormatted()[1] + editionFormatted()[1] + locationFormatted()[1] + yearPublishedFormatted()[1] + seriesFormatted()[1] + libraryFormatted()[1] + appNameFormatted()[1] + appLinkFormatted()[1];
|
|
59176
|
-
const citationChicago = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br
|
|
59177
|
-
const citationApa = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br
|
|
59178
|
-
const citationMla = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br
|
|
59199
|
+
const citationChicago = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br>" + chicago;
|
|
59200
|
+
const citationApa = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br>" + apa;
|
|
59201
|
+
const citationMla = "\u201C" + selectedText(selection, self2.properties.characters) + "\u201C<br><br>" + mla;
|
|
59179
59202
|
let citation = "";
|
|
59180
59203
|
if (self2.properties.styles?.includes(CitationStyle[0])) {
|
|
59181
|
-
|
|
59204
|
+
if (self2.properties.styles.length > 1) {
|
|
59205
|
+
citation = citation + "Chicago: <br>";
|
|
59206
|
+
}
|
|
59207
|
+
citation = citation + citationChicago + "<br><br>";
|
|
59182
59208
|
}
|
|
59183
59209
|
if (self2.properties.styles?.includes(CitationStyle[2])) {
|
|
59184
|
-
|
|
59210
|
+
if (self2.properties.styles.length > 1) {
|
|
59211
|
+
citation = citation + "APA: <br>";
|
|
59212
|
+
}
|
|
59213
|
+
citation = citation + citationApa + "<br><br>";
|
|
59185
59214
|
}
|
|
59186
59215
|
if (self2.properties.styles?.includes(CitationStyle[1])) {
|
|
59187
|
-
|
|
59216
|
+
if (self2.properties.styles.length > 1) {
|
|
59217
|
+
citation = citation + "MLA: <br>";
|
|
59218
|
+
}
|
|
59219
|
+
citation = citation + citationMla + "<br><br>";
|
|
59188
59220
|
}
|
|
59189
59221
|
self2.copyToClipboard(citation);
|
|
59190
59222
|
}
|