Skip to content

Commit

Permalink
Merge pull request #765 from d-i-t-a/develop
Browse files Browse the repository at this point in the history
2.4.3
  • Loading branch information
aferditamuriqi authored Jan 31, 2024
2 parents bd54cf0 + 8e8fd58 commit ca0e267
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 43 deletions.
2 changes: 1 addition & 1 deletion build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as util from "util";
import chalk from "chalk";
import { promises as fs } from "fs";
import { watch } from "chokidar";
import { debounce } from "debounce";
import debounce from "debounce";
import copy0 from "copy";
import child_process0 from "child_process";
import sass0 from "sass";
Expand Down
40 changes: 23 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "2.4.2",
"version": "2.4.3",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"license": "Apache-2.0",
Expand Down Expand Up @@ -88,7 +88,7 @@
"chalk": "^4.1.2",
"chokidar": "^3.5.2",
"copy": "^0.3.2",
"debounce": "^1.2.1",
"debounce": "^2.0.0",
"dita-streamer-js": "^1.1.3",
"ecstatic": "^4.1.4",
"esbuild": "^0.20.0",
Expand Down Expand Up @@ -127,7 +127,7 @@
"ts-node": "^10.9.1",
"typedoc": "^0.25.1",
"typedoc-plugin-rename-defaults": "^0.7.0",
"typescript": "5.1.6",
"typescript": "5.3.3",
"urijs": "^1.19.11"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/modules/TTS/TTSModule2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { TextHighlighter } from "../highlight/TextHighlighter";
import { HighlightType, IHighlight } from "../highlight/common/highlight";
import { uniqueCssSelector } from "../highlight/renderer/common/cssselector2";
import { convertRange } from "../highlight/renderer/iframe/selection";
import { debounce } from "debounce";
import debounce from "debounce";
import {
_getCssSelectorOptions,
ISelectionInfo,
Expand Down
25 changes: 11 additions & 14 deletions src/modules/highlight/TextHighlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { SHA256 } from "jscrypto/es6/SHA256";
import { debounce } from "debounce";
import debounce from "debounce";

import { IEventPayload_R2_EVENT_HIGHLIGHT_CLICK } from "./common/events";
import {
Expand Down Expand Up @@ -655,7 +655,12 @@ export class TextHighlighter {
window.addEventListener("resize", this.toolboxPlacement.bind(this));
}
doc.addEventListener("selectionchange", this.toolboxPlacement.bind(this));
doc.addEventListener("selectionchange", this.toolboxShowDelayed.bind(this));
if (!this.isIOS()) {
doc.addEventListener(
"selectionchange",
this.toolboxShowDelayed.bind(this)
);
}

el.addEventListener("mousedown", this.toolboxHide.bind(this));
el.addEventListener("touchstart", this.toolboxHide.bind(this));
Expand Down Expand Up @@ -1973,9 +1978,7 @@ export class TextHighlighter {
);
highlightArea.style.setProperty(
"border-bottom",
`2px solid rgba(${color.red}, ${color.green}, ${
color.blue
}, ${1})`,
`2px solid rgba(${color.red}, ${color.green}, ${color.blue}, ${1})`,
"important"
);
} else if (TextHighlighter.isHexColor(highlight.color)) {
Expand All @@ -1987,9 +1990,7 @@ export class TextHighlighter {
);
highlightArea.style.setProperty(
"border-bottom",
`2px solid rgba(${color.red}, ${color.green}, ${
color.blue
}, ${1})`,
`2px solid rgba(${color.red}, ${color.green}, ${color.blue}, ${1})`,
"important"
);
} else {
Expand Down Expand Up @@ -2867,9 +2868,7 @@ export class TextHighlighter {

highlightArea.setAttribute(
"style",
`mix-blend-mode: multiply; border-radius: ${roundedCorner}px !important; background-color: rgba(${
color.red
}, ${color.green}, ${color.blue}, ${0}) !important; ${extra}`
`mix-blend-mode: multiply; border-radius: ${roundedCorner}px !important; background-color: rgba(${color.red}, ${color.green}, ${color.blue}, ${0}) !important; ${extra}`
);
highlightArea.style.setProperty(
"border-bottom",
Expand All @@ -2880,9 +2879,7 @@ export class TextHighlighter {
let color = TextHighlighter.hexToRgbChannels(highlight.color);
highlightArea.setAttribute(
"style",
`mix-blend-mode: multiply; border-radius: ${roundedCorner}px !important; background-color: rgba(${
color.red
}, ${color.green}, ${color.blue}, ${0}) !important; ${extra}`
`mix-blend-mode: multiply; border-radius: ${roundedCorner}px !important; background-color: rgba(${color.red}, ${color.green}, ${color.blue}, ${0}) !important; ${extra}`
);
highlightArea.style.setProperty(
"border-bottom",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/protection/ContentProtectionModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
addEventListenerOptional,
removeEventListenerOptional,
} from "../../utils/EventHandler";
import { debounce } from "debounce";
import debounce from "debounce";
import { delay } from "../../utils";
import { addListener, launch } from "devtools-detector";
import log from "loglevel";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/sampleread/SampleReadEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Licensed to: Bibliotheca LLC under one or more contributor license agreements.
*/

import { debounce } from "debounce";
import debounce from "debounce";
import { IFrameNavigator } from "../../navigator/IFrameNavigator";

export default class SampleReadEventHandler {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/search/DefinitionsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import * as lodash from "lodash";
import { searchDocDomSeek } from "./searchWithDomSeek";
import { HighlightType, IHighlight } from "../highlight/common/highlight";
import { debounce } from "debounce";
import debounce from "debounce";
import { ISelectionInfo } from "../highlight/common/selection";
import { SHA256 } from "jscrypto/es6/SHA256";
import { AnnotationMarker } from "../../model/Locator";
Expand Down
6 changes: 3 additions & 3 deletions src/navigator/IFrameNavigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
TextHighlighterConfig,
} from "../modules/highlight/TextHighlighter";
import { TimelineModule } from "../modules/positions/TimelineModule";
import { debounce } from "debounce";
import debounce from "debounce";
import TouchEventHandler from "../utils/TouchEventHandler";
import KeyboardEventHandler from "../utils/KeyboardEventHandler";
import BookView from "../views/BookView";
Expand Down Expand Up @@ -1670,8 +1670,8 @@ export class IFrameNavigator extends EventEmitter implements Navigator {
e instanceof Error
? e
: typeof e === "string"
? new Error(e)
: new Error("An unknown error occurred in the IFrameNavigator.");
? new Error(e)
: new Error("An unknown error occurred in the IFrameNavigator.");
this.api.onError(trueError);
} else {
// otherwise just display the standard error UI
Expand Down
2 changes: 1 addition & 1 deletion src/views/ReflowableBookView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
IFrameAttributes,
IFrameNavigator,
} from "../navigator/IFrameNavigator";
import { debounce } from "debounce";
import debounce from "debounce";

export default class ReflowableBookView implements BookView {
layout = "reflowable";
Expand Down

0 comments on commit ca0e267

Please sign in to comment.