@d-i-t-a/reader 2.4.1 → 2.4.3
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 +93 -64
- package/dist/esm/index.js.map +3 -3
- package/dist/reader.js +40 -41
- package/dist/reader.js.map +3 -3
- package/dist/types/modules/TTS/TTSModule2.d.ts +2 -3
- package/dist/types/modules/highlight/TextHighlighter.d.ts +5 -12
- package/dist/types/modules/sampleread/SampleReadEventHandler.d.ts +2 -3
- package/dist/types/modules/search/DefinitionsModule.d.ts +2 -3
- package/dist/types/navigator/IFrameNavigator.d.ts +3 -6
- package/package.json +8 -8
|
@@ -3,6 +3,7 @@ import { TTSModuleAPI, TTSModuleConfig, TTSModuleProperties, TTSSettings } from
|
|
|
3
3
|
import { IFrameNavigator, ReaderRights } from "../../navigator/IFrameNavigator";
|
|
4
4
|
import { TextHighlighter } from "../highlight/TextHighlighter";
|
|
5
5
|
import { IHighlight } from "../highlight/common/highlight";
|
|
6
|
+
import debounce from "debounce";
|
|
6
7
|
import { ISelectionInfo } from "../highlight/common/selection";
|
|
7
8
|
export declare class TTSModule2 implements ReaderModule {
|
|
8
9
|
private tts;
|
|
@@ -46,9 +47,7 @@ export declare class TTSModule2 implements ReaderModule {
|
|
|
46
47
|
ttsPlayQueueIndex(ttsQueueIndex: number, ttsQueue: any): void;
|
|
47
48
|
ttsQueueIndex: number;
|
|
48
49
|
ttsQueue?: ITtsQueueItem[];
|
|
49
|
-
ttsPlayQueueIndexDebounced: (
|
|
50
|
-
clear(): void;
|
|
51
|
-
};
|
|
50
|
+
ttsPlayQueueIndexDebounced: debounce.DebouncedFunction<(ttsQueueIndex: number, ttsQueue: any) => void>;
|
|
52
51
|
updateTTSInfo(ttsQueueItem: any, charIndex: number, charLength: number, startIndex: number, utteranceText: string | undefined): string | undefined;
|
|
53
52
|
_ttsQueueItemHighlightsWord: IHighlight | undefined;
|
|
54
53
|
wrapHighlightWord(ttsQueueItemRef: ITtsQueueItemReference, utteranceText: string, charIndex: number, charLength: number, word: string, start: number, end: number): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import debounce from "debounce";
|
|
1
2
|
import { HighlightType, IHighlight, IMarkerIcon, IPopupStyle, IStyle, SelectionMenuItem } from "./common/highlight";
|
|
2
3
|
import { ISelectionInfo } from "./common/selection";
|
|
3
4
|
import { IRectSimple } from "./common/rect-utils";
|
|
@@ -158,21 +159,13 @@ export declare class TextHighlighter {
|
|
|
158
159
|
toolboxMode(mode: "colors" | "edit" | "add" | "action"): void;
|
|
159
160
|
toolboxHide(): void;
|
|
160
161
|
toolboxShowDelayed(event: TouchEvent | MouseEvent): void;
|
|
161
|
-
showTool: (
|
|
162
|
-
clear(): void;
|
|
163
|
-
};
|
|
162
|
+
showTool: debounce.DebouncedFunction<(b: boolean) => void>;
|
|
164
163
|
snapSelectionToWord(trimmed?: boolean): any;
|
|
165
164
|
toolboxShow(): void;
|
|
166
165
|
isSelectionMenuOpen: boolean;
|
|
167
|
-
selectionMenuOpened: (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
selectionMenuClosed: (() => void) & {
|
|
171
|
-
clear(): void;
|
|
172
|
-
};
|
|
173
|
-
selection: ((text: any, selection: any) => void) & {
|
|
174
|
-
clear(): void;
|
|
175
|
-
};
|
|
166
|
+
selectionMenuOpened: debounce.DebouncedFunction<() => void>;
|
|
167
|
+
selectionMenuClosed: debounce.DebouncedFunction<() => void>;
|
|
168
|
+
selection: debounce.DebouncedFunction<(text: any, selection: any) => void>;
|
|
176
169
|
toolboxPlacement(): void;
|
|
177
170
|
toolboxHandler(): void;
|
|
178
171
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import debounce from "debounce";
|
|
1
2
|
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
3
|
export default class SampleReadEventHandler {
|
|
3
4
|
navigator: IFrameNavigator;
|
|
4
5
|
constructor(navigator: IFrameNavigator);
|
|
5
|
-
enforceSampleRead: (
|
|
6
|
-
clear(): void;
|
|
7
|
-
};
|
|
6
|
+
enforceSampleRead: debounce.DebouncedFunction<(position: any) => void>;
|
|
8
7
|
}
|
|
@@ -2,6 +2,7 @@ import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
|
2
2
|
import { ReaderModule } from "../ReaderModule";
|
|
3
3
|
import { TextHighlighter } from "../highlight/TextHighlighter";
|
|
4
4
|
import { IHighlight } from "../highlight/common/highlight";
|
|
5
|
+
import debounce from "debounce";
|
|
5
6
|
import { ISelectionInfo } from "../highlight/common/selection";
|
|
6
7
|
import { Publication } from "../../model/Publication";
|
|
7
8
|
export interface DefinitionsModuleAPI {
|
|
@@ -39,9 +40,7 @@ export declare class DefinitionsModule implements ReaderModule {
|
|
|
39
40
|
stop(): Promise<void>;
|
|
40
41
|
protected start(): Promise<void>;
|
|
41
42
|
searchAndPaint(item: Definition, callback: (result: any) => any): Promise<void>;
|
|
42
|
-
definitions: (
|
|
43
|
-
clear(): void;
|
|
44
|
-
};
|
|
43
|
+
definitions: debounce.DebouncedFunction<() => Promise<void>>;
|
|
45
44
|
define(item: Definition): Promise<void>;
|
|
46
45
|
drawDefinitions(): Promise<void>;
|
|
47
46
|
handleResize(): Promise<void>;
|
|
@@ -9,6 +9,7 @@ import { SearchModule, SearchModuleConfig } from "../modules/search/SearchModule
|
|
|
9
9
|
import { ContentProtectionModule, ContentProtectionModuleConfig } from "../modules/protection/ContentProtectionModule";
|
|
10
10
|
import { TextHighlighter, TextHighlighterConfig } from "../modules/highlight/TextHighlighter";
|
|
11
11
|
import { TimelineModule } from "../modules/positions/TimelineModule";
|
|
12
|
+
import debounce from "debounce";
|
|
12
13
|
import BookView from "../views/BookView";
|
|
13
14
|
import { MediaOverlayModule, MediaOverlayModuleConfig } from "../modules/mediaoverlays/MediaOverlayModule";
|
|
14
15
|
import { D2Link, Link } from "../model/Link";
|
|
@@ -268,17 +269,13 @@ export declare class IFrameNavigator extends EventEmitter implements Navigator {
|
|
|
268
269
|
private handleNumberOfIframes;
|
|
269
270
|
handleResize(): Promise<void>;
|
|
270
271
|
updatePositionInfo(save?: boolean): void;
|
|
271
|
-
savePosition: (
|
|
272
|
-
clear(): void;
|
|
273
|
-
};
|
|
272
|
+
savePosition: debounce.DebouncedFunction<() => void>;
|
|
274
273
|
private handlePreviousChapterClick;
|
|
275
274
|
private handleNextChapterClick;
|
|
276
275
|
private hideView;
|
|
277
276
|
private setActiveTOCItem;
|
|
278
277
|
navigate(locator: Locator, history?: boolean): Promise<void>;
|
|
279
|
-
checkResourcePosition: (
|
|
280
|
-
clear(): void;
|
|
281
|
-
};
|
|
278
|
+
checkResourcePosition: debounce.DebouncedFunction<() => void>;
|
|
282
279
|
private showIframeContents;
|
|
283
280
|
private showLoadingMessageAfterDelay;
|
|
284
281
|
private hideIframeContents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-i-t-a/reader",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "A viewer application for EPUB files.",
|
|
5
5
|
"repository": "https://github.com/d-i-t-a/R2D2BC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"recursive-readdir": "^2.2.2",
|
|
43
43
|
"sanitize-html": "^2.3.3",
|
|
44
44
|
"sass": "^1.54.4",
|
|
45
|
-
"sentence-splitter": "^
|
|
45
|
+
"sentence-splitter": "^5.0.0",
|
|
46
46
|
"util": "^0.12.4",
|
|
47
47
|
"whatwg-fetch": "^3.6.2"
|
|
48
48
|
},
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/promise-polyfill": "^6.0.5",
|
|
75
75
|
"@types/react": "^18.2.31",
|
|
76
76
|
"@types/react-dom": "^18.2.14",
|
|
77
|
-
"@types/rimraf": "^
|
|
77
|
+
"@types/rimraf": "^4.0.5",
|
|
78
78
|
"@types/sanitize-html": "^2.9.0",
|
|
79
79
|
"@types/uuid": "^9.0.4",
|
|
80
80
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
@@ -84,14 +84,14 @@
|
|
|
84
84
|
"braces": ">=3.0.2",
|
|
85
85
|
"browserslist-useragent-regexp": "^4.1.0",
|
|
86
86
|
"buffer": "^6.0.3",
|
|
87
|
-
"chai": "^
|
|
87
|
+
"chai": "^5.0.3",
|
|
88
88
|
"chalk": "^4.1.2",
|
|
89
89
|
"chokidar": "^3.5.2",
|
|
90
90
|
"copy": "^0.3.2",
|
|
91
|
-
"debounce": "^
|
|
91
|
+
"debounce": "^2.0.0",
|
|
92
92
|
"dita-streamer-js": "^1.1.3",
|
|
93
93
|
"ecstatic": "^4.1.4",
|
|
94
|
-
"esbuild": "^0.
|
|
94
|
+
"esbuild": "^0.20.0",
|
|
95
95
|
"eslint": "^8.52.0",
|
|
96
96
|
"eslint-config-prettier": "^9.0.0",
|
|
97
97
|
"eslint-config-react-app": "^7.0.1",
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
"ts-loader": "^9.4.4",
|
|
127
127
|
"ts-node": "^10.9.1",
|
|
128
128
|
"typedoc": "^0.25.1",
|
|
129
|
-
"typedoc-plugin-rename-defaults": "^0.
|
|
130
|
-
"typescript": "5.
|
|
129
|
+
"typedoc-plugin-rename-defaults": "^0.7.0",
|
|
130
|
+
"typescript": "5.3.3",
|
|
131
131
|
"urijs": "^1.19.11"
|
|
132
132
|
},
|
|
133
133
|
"files": [
|