Skip to content

Commit

Permalink
Merge pull request #764 from d-i-t-a/dependency/debounce-2.0
Browse files Browse the repository at this point in the history
version bump on debounce dependency
  • Loading branch information
aferditamuriqi authored Jan 31, 2024
2 parents bc8c531 + a7cf28f commit fe98c86
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 31 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
22 changes: 14 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
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
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
18 changes: 5 additions & 13 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 @@ -1978,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 @@ -1992,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 @@ -2872,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 @@ -2885,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 fe98c86

Please sign in to comment.