@d-i-t-a/reader 2.0.0-beta.2 → 2.0.0-beta.20
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 +10389 -6659
- package/dist/esm/index.js.map +3 -3
- package/dist/injectables/style/linefocus.css +55 -0
- package/dist/injectables/style/popover.css +125 -0
- package/dist/injectables/style/style.css +31 -2
- package/dist/reader.css +7 -8
- package/dist/reader.js +56 -53
- package/dist/reader.js.map +3 -3
- package/dist/reader.map.css +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/model/Link.d.ts +1 -1
- package/dist/types/model/Publication.d.ts +13 -12
- package/dist/types/model/user-settings/UserProperties.d.ts +3 -2
- package/dist/types/model/user-settings/UserSettings.d.ts +6 -6
- package/dist/types/modules/AnnotationModule.d.ts +14 -13
- package/dist/types/modules/BookmarkModule.d.ts +14 -14
- package/dist/types/modules/ReaderModule.d.ts +1 -2
- package/dist/types/modules/TTS/TTSModule.d.ts +8 -8
- package/dist/types/modules/TTS/TTSModule2.d.ts +9 -9
- package/dist/types/modules/TTS/TTSSettings.d.ts +16 -16
- package/dist/types/modules/highlight/LayerSettings.d.ts +19 -0
- package/dist/types/modules/highlight/TextHighlighter.d.ts +42 -61
- package/dist/types/modules/highlight/common/highlight.d.ts +3 -2
- package/dist/types/modules/highlight/common/rect-utils.d.ts +1 -1
- package/dist/types/modules/highlight/common/selection.d.ts +3 -3
- package/dist/types/modules/highlight/renderer/iframe/selection.d.ts +2 -2
- package/dist/types/modules/highlight/renderer/iframe/state.d.ts +0 -3
- package/dist/types/modules/linefocus/LineFocusModule.d.ts +51 -0
- package/dist/types/modules/mediaoverlays/MediaOverlayModule.d.ts +20 -15
- package/dist/types/modules/mediaoverlays/MediaOverlaySettings.d.ts +21 -17
- package/dist/types/modules/pagebreak/PageBreakModule.d.ts +14 -7
- package/dist/types/modules/positions/TimelineModule.d.ts +4 -4
- package/dist/types/modules/protection/ContentProtectionModule.d.ts +7 -7
- package/dist/types/modules/sampleread/SampleReadEventHandler.d.ts +1 -1
- package/dist/types/modules/search/DefinitionsModule.d.ts +22 -14
- package/dist/types/modules/search/Popup.d.ts +4 -2
- package/dist/types/modules/search/SearchModule.d.ts +16 -12
- package/dist/types/modules/search/searchWithDomSeek.d.ts +1 -1
- package/dist/types/navigator/IFrameNavigator.d.ts +59 -44
- package/dist/types/reader.d.ts +96 -57
- package/dist/types/store/Annotator.d.ts +16 -17
- package/dist/types/store/LocalAnnotator.d.ts +16 -17
- package/dist/types/store/LocalStorageStore.d.ts +3 -3
- package/dist/types/store/MemoryStore.d.ts +3 -3
- package/dist/types/store/Store.d.ts +3 -3
- package/dist/types/utils/EventHandler.d.ts +11 -2
- package/dist/types/utils/HTMLUtilities.d.ts +3 -3
- package/dist/types/utils/IconLib.d.ts +1 -1
- package/dist/types/utils/KeyboardEventHandler.d.ts +2 -2
- package/dist/types/utils/TouchEventHandler.d.ts +1 -1
- package/dist/types/views/BookView.d.ts +4 -4
- package/dist/types/views/FixedBookView.d.ts +3 -3
- package/dist/types/views/ReflowableBookView.d.ts +2 -2
- package/package.json +16 -9
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { HighlightType, IHighlight, IMarkerIcon, IPopupStyle, IStyle, SelectionMenuItem } from "./common/highlight";
|
|
2
2
|
import { ISelectionInfo } from "./common/selection";
|
|
3
3
|
import { IRectSimple } from "./common/rect-utils";
|
|
4
|
-
import { IReadiumIFrameWindow } from "./renderer/iframe/state";
|
|
5
4
|
import { AnnotationMarker } from "../../model/Locator";
|
|
6
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
7
|
-
import {
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
6
|
+
import { LayerSettings } from "./LayerSettings";
|
|
7
|
+
export declare enum HighlightContainer {
|
|
8
|
+
R2_ID_HIGHLIGHTS_CONTAINER = "R2_ID_HIGHLIGHTS_CONTAINER",
|
|
9
|
+
R2_ID_BOOKMAKRS_CONTAINER = "R2_ID_BOOKMAKRS_CONTAINER",
|
|
10
|
+
R2_ID_READALOUD_CONTAINER = "R2_ID_READALOUD_CONTAINER",
|
|
11
|
+
R2_ID_PAGEBREAK_CONTAINER = "R2_ID_PAGEBREAK_CONTAINER",
|
|
12
|
+
R2_ID_SEARCH_CONTAINER = "R2_ID_SEARCH_CONTAINER",
|
|
13
|
+
R2_ID_DEFINITIONS_CONTAINER = "R2_ID_DEFINITIONS_CONTAINER",
|
|
14
|
+
R2_ID_LINEFOCUS_CONTAINER = "R2_ID_LINEFOCUS_CONTAINER"
|
|
15
|
+
}
|
|
13
16
|
export declare const CLASS_HIGHLIGHT_CONTAINER = "R2_CLASS_HIGHLIGHT_CONTAINER";
|
|
17
|
+
export declare const CLASS_HIGHLIGHT_BOUNDING_AREA = "R2_CLASS_HIGHLIGHT_BOUNDING_AREA";
|
|
14
18
|
export declare const CLASS_HIGHLIGHT_AREA = "R2_CLASS_HIGHLIGHT_AREA";
|
|
15
19
|
export declare const CLASS_HIGHLIGHT_ICON = "R2_CLASS_HIGHLIGHT_ICON";
|
|
16
|
-
export declare const
|
|
20
|
+
export declare const DEFAULT_BACKGROUND_COLOR: {
|
|
21
|
+
blue: number;
|
|
22
|
+
green: number;
|
|
23
|
+
red: number;
|
|
24
|
+
};
|
|
17
25
|
export interface TextSelectorAPI {
|
|
18
26
|
selectionMenuOpen: any;
|
|
19
27
|
selectionMenuClose: any;
|
|
28
|
+
selection: any;
|
|
20
29
|
}
|
|
21
30
|
export declare const _highlights: IHighlight[];
|
|
22
31
|
interface IWithRect {
|
|
@@ -37,15 +46,17 @@ export interface TextHighlighterProperties {
|
|
|
37
46
|
selectionMenuItems?: Array<SelectionMenuItem>;
|
|
38
47
|
}
|
|
39
48
|
export interface TextHighlighterConfig extends TextHighlighterProperties {
|
|
40
|
-
delegate
|
|
49
|
+
delegate: IFrameNavigator;
|
|
41
50
|
api?: TextSelectorAPI;
|
|
51
|
+
layerSettings: LayerSettings;
|
|
42
52
|
}
|
|
43
|
-
export
|
|
53
|
+
export declare class TextHighlighter {
|
|
44
54
|
private options;
|
|
45
|
-
private delegate;
|
|
46
|
-
|
|
55
|
+
private readonly delegate;
|
|
56
|
+
layerSettings: LayerSettings;
|
|
57
|
+
private lastSelectedHighlight?;
|
|
47
58
|
properties: TextHighlighterProperties;
|
|
48
|
-
private api
|
|
59
|
+
private api?;
|
|
49
60
|
private hasEventListener;
|
|
50
61
|
activeAnnotationMarkerId?: string;
|
|
51
62
|
static create(config: TextHighlighterConfig): Promise<any>;
|
|
@@ -145,6 +156,9 @@ export default class TextHighlighter {
|
|
|
145
156
|
selectionMenuClosed: (() => void) & {
|
|
146
157
|
clear(): void;
|
|
147
158
|
};
|
|
159
|
+
selection: ((text: any, selection: any) => void) & {
|
|
160
|
+
clear(): void;
|
|
161
|
+
};
|
|
148
162
|
toolboxPlacement(): void;
|
|
149
163
|
toolboxHandler(): void;
|
|
150
164
|
/**
|
|
@@ -158,6 +172,7 @@ export default class TextHighlighter {
|
|
|
158
172
|
stopReadAloud(): void;
|
|
159
173
|
speakAll(): void;
|
|
160
174
|
callbackComplete(): void;
|
|
175
|
+
isOutsideViewport(rect: any): boolean;
|
|
161
176
|
get visibleTextRects(): HTMLElementRect[];
|
|
162
177
|
doneSpeaking(reload?: boolean): void;
|
|
163
178
|
/**
|
|
@@ -196,20 +211,6 @@ export default class TextHighlighter {
|
|
|
196
211
|
* @memberof TextHighlighter
|
|
197
212
|
*/
|
|
198
213
|
getColor(): string;
|
|
199
|
-
/**
|
|
200
|
-
* Returns highlights from given container.
|
|
201
|
-
* @param params
|
|
202
|
-
* @param {HTMLElement} [params.container] - return highlights from this element. Default: the element the
|
|
203
|
-
* highlighter is applied to.
|
|
204
|
-
* @param {boolean} [params.andSelf] - if set to true and container is a highlight itself, add container to
|
|
205
|
-
* returned results. Default: true.
|
|
206
|
-
* @param {boolean} [params.grouped] - if set to true, highlights are grouped in logical groups of highlights added
|
|
207
|
-
* in the same moment. Each group is an object which has got array of highlights, 'toString' method and 'timestamp'
|
|
208
|
-
* property. Default: false.
|
|
209
|
-
* @returns {Array} - array of highlights.
|
|
210
|
-
* @memberof TextHighlighter
|
|
211
|
-
*/
|
|
212
|
-
getHighlights(params?: any): Array<any>;
|
|
213
214
|
/**
|
|
214
215
|
* Returns true if element is a highlight.
|
|
215
216
|
* All highlights have 'data-highlighted' attribute.
|
|
@@ -218,20 +219,6 @@ export default class TextHighlighter {
|
|
|
218
219
|
* @memberof TextHighlighter
|
|
219
220
|
*/
|
|
220
221
|
isHighlight(el: any): boolean;
|
|
221
|
-
/**
|
|
222
|
-
* Serializes all highlights in the element the highlighter is applied to.
|
|
223
|
-
* @returns {string} - stringified JSON with highlights definition
|
|
224
|
-
* @memberof TextHighlighter
|
|
225
|
-
*/
|
|
226
|
-
serializeHighlights(): string;
|
|
227
|
-
/**
|
|
228
|
-
* Deserializes highlights.
|
|
229
|
-
* @throws exception when can't parse JSON or JSON has invalid structure.
|
|
230
|
-
* @param {object} json - JSON object with highlights definition.
|
|
231
|
-
* @returns {Array} - array of deserialized highlights.
|
|
232
|
-
* @memberof TextHighlighter
|
|
233
|
-
*/
|
|
234
|
-
deserializeHighlights(json: any): Array<any>;
|
|
235
222
|
/**
|
|
236
223
|
* Creates wrapper for highlights.
|
|
237
224
|
* TextHighlighter instance calls this method each time it needs to create highlights and pass options retrieved
|
|
@@ -250,28 +237,22 @@ export default class TextHighlighter {
|
|
|
250
237
|
};
|
|
251
238
|
static hexToRgbA(hex: string): string;
|
|
252
239
|
static hexToRgbAWithOpacity(hex: string, opacity: number): string;
|
|
253
|
-
resetHighlightBoundingStyle(_win:
|
|
254
|
-
resetHighlightAreaStyle(
|
|
255
|
-
setHighlightAreaStyle(
|
|
240
|
+
resetHighlightBoundingStyle(_win: any, highlightBounding: HTMLElement): void;
|
|
241
|
+
resetHighlightAreaStyle(win: any, highlightArea: HTMLElement, id_container: string): void;
|
|
242
|
+
setHighlightAreaStyle(win: any, highlightAreas: Array<HTMLElement>, highlight: IHighlight): void;
|
|
256
243
|
setAndResetSearchHighlight(highlight: any, highlights: any): void;
|
|
257
244
|
isIOS(): boolean;
|
|
258
245
|
isAndroid(): boolean;
|
|
259
|
-
getScrollingElement: (
|
|
260
|
-
processMouseEvent(win:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
246
|
+
getScrollingElement: (doc: Document | undefined) => Element;
|
|
247
|
+
processMouseEvent(win: any, ev: MouseEvent): Promise<void>;
|
|
248
|
+
prepareContainers(win: any): Promise<void>;
|
|
249
|
+
ensureHighlightsContainer(win: any, id: string): Promise<HTMLElement>;
|
|
250
|
+
hideAllhighlights(doc: Document): void;
|
|
251
|
+
destroyAllhighlights(doc: Document): void;
|
|
252
|
+
removeAllChildNodes(parent: any): void;
|
|
264
253
|
destroyHighlights(type: HighlightType): void;
|
|
265
|
-
destroyHighlight(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
clear(): void;
|
|
269
|
-
};
|
|
270
|
-
recreateAllHighlights(win: IReadiumIFrameWindow): void;
|
|
271
|
-
createPopupHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
|
|
272
|
-
createSearchHighlight(selectionInfo: ISelectionInfo, color: string): IHighlight;
|
|
273
|
-
createPageBreakHighlight(selectionInfo: ISelectionInfo, title: string): IHighlight;
|
|
274
|
-
createHighlight(win: IReadiumIFrameWindow, selectionInfo: ISelectionInfo, color: string | undefined, pointerInteraction: boolean, marker: AnnotationMarker, icon?: IMarkerIcon | undefined, popup?: IPopupStyle | undefined, style?: IStyle | undefined, type?: HighlightType | undefined, prefix?: string | undefined): [IHighlight, HTMLDivElement];
|
|
275
|
-
createHighlightDom(win: IReadiumIFrameWindow, highlight: IHighlight): HTMLDivElement | undefined;
|
|
254
|
+
destroyHighlight(doc: Document | null, id: string): void;
|
|
255
|
+
createHighlight(win: any, selectionInfo: ISelectionInfo, color: string | undefined, pointerInteraction: boolean, marker: AnnotationMarker, icon?: IMarkerIcon | undefined, popup?: IPopupStyle | undefined, style?: IStyle | undefined, type?: HighlightType | undefined, prefix?: string | undefined): [IHighlight, HTMLDivElement?];
|
|
256
|
+
createHighlightDom(win: any, highlight: IHighlight): HTMLDivElement | undefined;
|
|
276
257
|
}
|
|
277
258
|
export {};
|
|
@@ -39,7 +39,8 @@ export declare enum HighlightType {
|
|
|
39
39
|
Search = 1,
|
|
40
40
|
ReadAloud = 2,
|
|
41
41
|
PageBreak = 3,
|
|
42
|
-
|
|
42
|
+
Definition = 4,
|
|
43
|
+
LineFocus = 5
|
|
43
44
|
}
|
|
44
45
|
export interface IHighlight {
|
|
45
46
|
id: string;
|
|
@@ -51,7 +52,7 @@ export interface IHighlight {
|
|
|
51
52
|
color: string;
|
|
52
53
|
style?: IStyle | undefined;
|
|
53
54
|
position?: number;
|
|
54
|
-
note?: string | undefined;
|
|
55
|
+
note?: string | null | undefined;
|
|
55
56
|
definition?: Definition | undefined;
|
|
56
57
|
type: HighlightType;
|
|
57
58
|
}
|
|
@@ -9,7 +9,7 @@ export interface IRect extends IRectSimple {
|
|
|
9
9
|
right: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function getClientRectsNoOverlap(range: Range, doNotMergeHorizontallyAlignedRects: boolean): IRect[];
|
|
12
|
-
export declare function getClientRectsNoOverlap_(clientRects:
|
|
12
|
+
export declare function getClientRectsNoOverlap_(clientRects: DOMRectList, doNotMergeHorizontallyAlignedRects: boolean): IRect[];
|
|
13
13
|
export declare function rectIntersect(rect1: IRect, rect2: IRect): IRect;
|
|
14
14
|
export declare function rectSubtract(rect1: IRect, rect2: IRect): IRect[];
|
|
15
15
|
export declare function rectContainsPoint(rect: IRect, x: number, y: number, tolerance: number): boolean;
|
|
@@ -9,9 +9,9 @@ export interface IRangeInfo {
|
|
|
9
9
|
export declare function sameRanges(r1: IRangeInfo, r2: IRangeInfo): boolean;
|
|
10
10
|
export interface ISelectionInfo {
|
|
11
11
|
rangeInfo: IRangeInfo;
|
|
12
|
-
cleanText
|
|
13
|
-
rawText
|
|
14
|
-
range
|
|
12
|
+
cleanText?: string;
|
|
13
|
+
rawText?: string;
|
|
14
|
+
range?: Range;
|
|
15
15
|
}
|
|
16
16
|
export declare function sameSelections(sel1: ISelectionInfo, sel2: ISelectionInfo): boolean;
|
|
17
17
|
export declare const _getCssSelectorOptions: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRangeInfo, ISelectionInfo } from "../../common/selection";
|
|
2
2
|
export declare function clearCurrentSelection(win: Window): void;
|
|
3
|
-
export declare function getCurrentSelectionInfo(win: Window, getCssSelector: (element: Element) => string): ISelectionInfo | undefined;
|
|
3
|
+
export declare function getCurrentSelectionInfo(win: Window, getCssSelector: (element: Element) => string | undefined): ISelectionInfo | undefined;
|
|
4
4
|
export declare function createOrderedRange(startNode: Node, startOffset: number, endNode: Node, endOffset: number): Range | undefined;
|
|
5
|
-
export declare function convertRange(range: Range, getCssSelector: (element: Element) => string): IRangeInfo | undefined;
|
|
5
|
+
export declare function convertRange(range: Range, getCssSelector: (element: Element) => string | undefined): IRangeInfo | undefined;
|
|
6
6
|
export declare function convertRangeInfo(documant: Document, rangeInfo: IRangeInfo): Range | undefined;
|
|
7
7
|
export declare function normalizeRange(r: Range): Range;
|
|
@@ -5,9 +5,6 @@ export interface IReadiumIFrameWindowState {
|
|
|
5
5
|
locationHashOverride: Element | undefined;
|
|
6
6
|
locationHashOverrideInfo: IEventPayload_R2_EVENT_READING_LOCATION | undefined;
|
|
7
7
|
}
|
|
8
|
-
export interface IReadiumIFrameWindow extends Window {
|
|
9
|
-
READIUM2: IReadiumIFrameWindowState;
|
|
10
|
-
}
|
|
11
8
|
export interface IReadiumIFrameState {
|
|
12
9
|
id: number;
|
|
13
10
|
link: Link | undefined;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Publication } from "../../model/Publication";
|
|
2
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
3
|
+
import { ReaderModule } from "../ReaderModule";
|
|
4
|
+
import { TextHighlighter } from "../highlight/TextHighlighter";
|
|
5
|
+
export interface LineFocusModuleAPI {
|
|
6
|
+
}
|
|
7
|
+
export interface LineFocusModuleProperties {
|
|
8
|
+
api?: LineFocusModuleAPI;
|
|
9
|
+
lines?: number;
|
|
10
|
+
maxHeight?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface LineFocusModuleConfig extends LineFocusModuleProperties {
|
|
13
|
+
api?: LineFocusModuleAPI;
|
|
14
|
+
publication: Publication;
|
|
15
|
+
delegate: IFrameNavigator;
|
|
16
|
+
highlighter: TextHighlighter;
|
|
17
|
+
}
|
|
18
|
+
export default class LineFocusModule implements ReaderModule {
|
|
19
|
+
properties: LineFocusModuleProperties;
|
|
20
|
+
api?: LineFocusModuleAPI;
|
|
21
|
+
private delegate;
|
|
22
|
+
private highlighter;
|
|
23
|
+
private hasEventListener;
|
|
24
|
+
lines: Array<HTMLElement>;
|
|
25
|
+
index: number;
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
isDebug: boolean;
|
|
28
|
+
lineFocusContainer: HTMLElement | null;
|
|
29
|
+
readerContainer: HTMLElement | null;
|
|
30
|
+
lineFocusTopBlinder: HTMLElement | null;
|
|
31
|
+
lineFocusBottomBlinder: HTMLElement | null;
|
|
32
|
+
static create(config: LineFocusModuleConfig): Promise<LineFocusModule>;
|
|
33
|
+
private constructor();
|
|
34
|
+
stop(): Promise<void>;
|
|
35
|
+
protected start(): Promise<void>;
|
|
36
|
+
private keydown;
|
|
37
|
+
private keyup;
|
|
38
|
+
handleResize(): void;
|
|
39
|
+
enableLineFocus(): Promise<void>;
|
|
40
|
+
wrapperHeight: string | undefined;
|
|
41
|
+
disableLineFocus(resetHeight?: boolean): void;
|
|
42
|
+
lineFocus(): void;
|
|
43
|
+
currentLine(): void;
|
|
44
|
+
lineDown(): void;
|
|
45
|
+
lineUp(): void;
|
|
46
|
+
almostEqual(a: number, b: number, tolerance: number): boolean;
|
|
47
|
+
findRects(parent: HTMLElement): any;
|
|
48
|
+
findTextNodes(parentElement: Element, nodes?: Array<Element>): Array<Element>;
|
|
49
|
+
measureTextNodes(node: Element): any;
|
|
50
|
+
measureImageNodes(node: Element): any;
|
|
51
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Publication from "../../model/Publication";
|
|
2
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
3
|
-
import ReaderModule from "../ReaderModule";
|
|
1
|
+
import { Publication } from "../../model/Publication";
|
|
2
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
3
|
+
import { ReaderModule } from "../ReaderModule";
|
|
4
4
|
import { Link } from "../../model/Link";
|
|
5
5
|
import { MediaOverlayNode } from "r2-shared-js/dist/es6-es2015/src/models/media-overlay";
|
|
6
6
|
import { MediaOverlaySettings } from "./MediaOverlaySettings";
|
|
@@ -17,46 +17,49 @@ export interface MediaOverlayModuleProperties {
|
|
|
17
17
|
autoScroll?: boolean;
|
|
18
18
|
autoTurn?: boolean;
|
|
19
19
|
volume?: number;
|
|
20
|
+
rate?: number;
|
|
20
21
|
wait?: number;
|
|
22
|
+
hideLayer?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export interface MediaOverlayModuleConfig extends MediaOverlayModuleProperties {
|
|
23
25
|
publication: Publication;
|
|
24
26
|
delegate: IFrameNavigator;
|
|
25
|
-
api: MediaOverlayModuleAPI;
|
|
26
27
|
settings: MediaOverlaySettings;
|
|
28
|
+
api?: MediaOverlayModuleAPI;
|
|
27
29
|
}
|
|
28
|
-
export
|
|
30
|
+
export declare class MediaOverlayModule implements ReaderModule {
|
|
29
31
|
private publication;
|
|
30
32
|
private delegate;
|
|
31
33
|
private audioElement;
|
|
32
|
-
|
|
34
|
+
settings: MediaOverlaySettings;
|
|
35
|
+
private properties;
|
|
33
36
|
private play;
|
|
34
37
|
private pause;
|
|
35
38
|
private currentAudioBegin;
|
|
36
39
|
private currentAudioEnd;
|
|
37
40
|
private currentLinks;
|
|
38
41
|
private currentLinkIndex;
|
|
39
|
-
private mediaOverlaysPlaybackRate;
|
|
40
42
|
private currentAudioUrl;
|
|
41
43
|
private previousAudioUrl;
|
|
42
44
|
private previousAudioEnd;
|
|
43
45
|
private mediaOverlayRoot;
|
|
44
46
|
private mediaOverlayTextAudioPair;
|
|
45
47
|
private pid;
|
|
46
|
-
|
|
48
|
+
private __ontimeupdate;
|
|
49
|
+
static create(config: MediaOverlayModuleConfig): MediaOverlayModule;
|
|
47
50
|
private constructor();
|
|
48
|
-
stop():
|
|
49
|
-
protected start():
|
|
51
|
+
stop(): void;
|
|
52
|
+
protected start(): void;
|
|
50
53
|
initialize(): Promise<void>;
|
|
51
|
-
initializeResource(links: Array<Link>): Promise<void>;
|
|
54
|
+
initializeResource(links: Array<Link | undefined>): Promise<void>;
|
|
52
55
|
private playLink;
|
|
53
56
|
startReadAloud(): Promise<void>;
|
|
54
|
-
stopReadAloud(): void
|
|
57
|
+
stopReadAloud(): Promise<void>;
|
|
55
58
|
pauseReadAloud(): void;
|
|
56
59
|
resumeReadAloud(): Promise<void>;
|
|
57
60
|
findDepthFirstTextAudioPair(textHref: string, mo: MediaOverlayNode, textFragmentIDChain: Array<string | null> | undefined): MediaOverlayNode | undefined | null;
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
myReq: any;
|
|
62
|
+
trackCurrentTime(): void;
|
|
60
63
|
mediaOverlaysNext(escape?: boolean): void;
|
|
61
64
|
mediaOverlaysStop(): void;
|
|
62
65
|
mediaOverlaysPause(): void;
|
|
@@ -65,5 +68,7 @@ export default class MediaOverlayModule implements ReaderModule {
|
|
|
65
68
|
}, escape: boolean): MediaOverlayNode | undefined | null;
|
|
66
69
|
playMediaOverlaysAudio(moTextAudioPair: MediaOverlayNode, begin: number | undefined, end: number | undefined): Promise<void>;
|
|
67
70
|
playMediaOverlays(textHref: string, rootMo: MediaOverlayNode, textFragmentIDChain: Array<string | null> | undefined): Promise<void>;
|
|
68
|
-
|
|
71
|
+
ontimeupdate: (_v: Event) => Promise<void>;
|
|
72
|
+
ensureOnTimeUpdate: (remove: boolean, replace: boolean) => void;
|
|
73
|
+
mediaOverlayHighlight(id: string | undefined): void;
|
|
69
74
|
}
|
|
@@ -7,26 +7,29 @@ export declare class MEDIAOVERLAYREFS {
|
|
|
7
7
|
static readonly AUTO_SCROLL_REF = "autoscroll";
|
|
8
8
|
static readonly AUTO_TURN_REF = "autoturn";
|
|
9
9
|
static readonly VOLUME_REF = "volume";
|
|
10
|
+
static readonly RATE_REF = "rate";
|
|
10
11
|
static readonly COLOR_KEY: string;
|
|
11
12
|
static readonly AUTO_SCROLL_KEY: string;
|
|
12
13
|
static readonly AUTO_TURN_KEY: string;
|
|
13
14
|
static readonly VOLUME_KEY: string;
|
|
15
|
+
static readonly RATE_KEY: string;
|
|
14
16
|
}
|
|
15
17
|
export interface MediaOverlayConfig {
|
|
16
18
|
store: Store;
|
|
17
|
-
initialMediaOverlaySettings
|
|
18
|
-
headerMenu
|
|
19
|
-
api
|
|
19
|
+
initialMediaOverlaySettings?: MediaOverlayModuleProperties;
|
|
20
|
+
headerMenu?: HTMLElement | null;
|
|
21
|
+
api?: MediaOverlayModuleAPI;
|
|
20
22
|
}
|
|
21
23
|
export interface IMediaOverlayUserSettings {
|
|
22
24
|
color?: string;
|
|
23
25
|
autoScroll?: boolean;
|
|
24
26
|
autoTurn?: boolean;
|
|
25
27
|
volume?: number;
|
|
28
|
+
rate?: number;
|
|
26
29
|
playing?: boolean;
|
|
27
30
|
wait?: number;
|
|
28
31
|
}
|
|
29
|
-
export declare type MediaOverlayIncrementable = "mo_volume";
|
|
32
|
+
export declare type MediaOverlayIncrementable = "mo_volume" | "mo_rate";
|
|
30
33
|
export declare class MediaOverlaySettings implements IMediaOverlayUserSettings {
|
|
31
34
|
private readonly store;
|
|
32
35
|
private readonly MEDIAOVERLAYSETTINGS;
|
|
@@ -34,35 +37,36 @@ export declare class MediaOverlaySettings implements IMediaOverlayUserSettings {
|
|
|
34
37
|
autoScroll: boolean;
|
|
35
38
|
autoTurn: boolean;
|
|
36
39
|
volume: number;
|
|
40
|
+
rate: number;
|
|
37
41
|
playing: boolean;
|
|
42
|
+
resourceReady: boolean;
|
|
38
43
|
wait: number;
|
|
39
44
|
userProperties: UserProperties;
|
|
40
45
|
private settingsChangeCallback;
|
|
41
46
|
private settingsView;
|
|
42
|
-
private readonly headerMenu
|
|
43
|
-
private volumeButtons;
|
|
47
|
+
private readonly headerMenu?;
|
|
44
48
|
private speechAutoScroll;
|
|
45
49
|
private speechAutoTurn;
|
|
46
50
|
private speechVolume;
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
private speechRate;
|
|
52
|
+
private readonly api?;
|
|
53
|
+
static create(config: MediaOverlayConfig): any;
|
|
54
|
+
protected constructor(store: Store, api?: MediaOverlayModuleAPI, headerMenu?: HTMLElement | null);
|
|
55
|
+
stop(): void;
|
|
51
56
|
private initialise;
|
|
52
57
|
private reset;
|
|
53
58
|
private initializeSelections;
|
|
54
59
|
setControls(): void;
|
|
55
60
|
private renderControls;
|
|
56
61
|
onSettingsChange(callback: () => void): void;
|
|
57
|
-
private setupEvents;
|
|
58
62
|
private storeProperty;
|
|
59
63
|
private updateUserSettings;
|
|
60
64
|
private getMediaOverlaySettings;
|
|
61
65
|
private saveProperty;
|
|
62
|
-
getProperty(name: string):
|
|
63
|
-
resetMediaOverlaySettings():
|
|
64
|
-
applyMediaOverlaySettings(mediaOverlaySettings: IMediaOverlayUserSettings):
|
|
65
|
-
applyMediaOverlaySetting(key: any, value: any):
|
|
66
|
-
increase(incremental: MediaOverlayIncrementable):
|
|
67
|
-
decrease(incremental: MediaOverlayIncrementable):
|
|
66
|
+
getProperty(name: string): UserProperty | null;
|
|
67
|
+
resetMediaOverlaySettings(): void;
|
|
68
|
+
applyMediaOverlaySettings(mediaOverlaySettings: IMediaOverlayUserSettings): void;
|
|
69
|
+
applyMediaOverlaySetting(key: any, value: any): void;
|
|
70
|
+
increase(incremental: MediaOverlayIncrementable): void;
|
|
71
|
+
decrease(incremental: MediaOverlayIncrementable): void;
|
|
68
72
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
2
|
-
import ReaderModule from "../ReaderModule";
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
|
+
import { ReaderModule } from "../ReaderModule";
|
|
3
|
+
import { IHighlight } from "../highlight/common/highlight";
|
|
4
|
+
import { ISelectionInfo } from "../highlight/common/selection";
|
|
5
|
+
import { Publication } from "../../model/Publication";
|
|
6
|
+
export interface PageBreakModuleProperties {
|
|
7
|
+
hideLayer?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PageBreakModuleConfig extends PageBreakModuleProperties {
|
|
5
10
|
delegate: IFrameNavigator;
|
|
6
|
-
headerMenu
|
|
11
|
+
headerMenu?: HTMLElement | null;
|
|
7
12
|
publication: Publication;
|
|
8
13
|
}
|
|
9
|
-
export
|
|
14
|
+
export declare class PageBreakModule implements ReaderModule {
|
|
10
15
|
private delegate;
|
|
11
|
-
private readonly headerMenu
|
|
16
|
+
private readonly headerMenu?;
|
|
12
17
|
private publication;
|
|
18
|
+
private properties;
|
|
13
19
|
private goToPageView;
|
|
14
20
|
private goToPageNumberInput;
|
|
15
21
|
private goToPageNumberButton;
|
|
@@ -20,4 +26,5 @@ export default class PageBreakModule implements ReaderModule {
|
|
|
20
26
|
private goToPageNumber;
|
|
21
27
|
handleResize(): Promise<void>;
|
|
22
28
|
drawPageBreaks(): Promise<void>;
|
|
29
|
+
createPageBreakHighlight(selectionInfo: ISelectionInfo, title: string): IHighlight;
|
|
23
30
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Publication from "../../model/Publication";
|
|
2
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
3
|
-
import ReaderModule from "../ReaderModule";
|
|
1
|
+
import { Publication } from "../../model/Publication";
|
|
2
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
3
|
+
import { ReaderModule } from "../ReaderModule";
|
|
4
4
|
export interface TimelineModuleConfig {
|
|
5
5
|
publication: Publication;
|
|
6
6
|
delegate: IFrameNavigator;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare class TimelineModule implements ReaderModule {
|
|
9
9
|
private publication;
|
|
10
10
|
private delegate;
|
|
11
11
|
private timelineContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ReaderModule from "../ReaderModule";
|
|
2
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
1
|
+
import { ReaderModule } from "../ReaderModule";
|
|
2
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
3
3
|
export interface ContentProtectionModuleProperties {
|
|
4
4
|
enforceSupportedBrowsers: boolean;
|
|
5
5
|
enableEncryption: boolean;
|
|
@@ -16,7 +16,7 @@ export interface ContentProtectionModuleProperties {
|
|
|
16
16
|
supportedBrowsers: [];
|
|
17
17
|
}
|
|
18
18
|
export interface ContentProtectionModuleConfig extends Partial<ContentProtectionModuleProperties> {
|
|
19
|
-
delegate
|
|
19
|
+
delegate: IFrameNavigator;
|
|
20
20
|
api?: ContentProtectionModuleAPI;
|
|
21
21
|
}
|
|
22
22
|
export interface ContentProtectionModuleAPI {
|
|
@@ -32,10 +32,10 @@ interface ContentProtectionRect {
|
|
|
32
32
|
scrambledTextContent: string;
|
|
33
33
|
isObfuscated: boolean;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export declare class ContentProtectionModule implements ReaderModule {
|
|
36
36
|
private rects;
|
|
37
37
|
private delegate;
|
|
38
|
-
private properties
|
|
38
|
+
private properties?;
|
|
39
39
|
private hasEventListener;
|
|
40
40
|
private isHacked;
|
|
41
41
|
private securityContainer;
|
|
@@ -43,7 +43,7 @@ export default class ContentProtectionModule implements ReaderModule {
|
|
|
43
43
|
private wrapper;
|
|
44
44
|
static setupPreloadProtection(config: ContentProtectionModuleConfig): Promise<void>;
|
|
45
45
|
static create(config: ContentProtectionModuleConfig): Promise<ContentProtectionModule>;
|
|
46
|
-
constructor(delegate: IFrameNavigator, properties?: ContentProtectionModuleProperties
|
|
46
|
+
constructor(delegate: IFrameNavigator, properties?: ContentProtectionModuleProperties);
|
|
47
47
|
private static startInspectorProtection;
|
|
48
48
|
private static isCurrentBrowserSupported;
|
|
49
49
|
protected start(): Promise<void>;
|
|
@@ -85,7 +85,7 @@ export default class ContentProtectionModule implements ReaderModule {
|
|
|
85
85
|
}): boolean;
|
|
86
86
|
hideTargetUrls(activate: any): void;
|
|
87
87
|
preventDrag(activate: any): void;
|
|
88
|
-
recalculate(delay?: number):
|
|
88
|
+
recalculate(delay?: number): Promise<boolean>;
|
|
89
89
|
calcRects(rects: Array<ContentProtectionRect>): void;
|
|
90
90
|
deactivateRect(rect: ContentProtectionRect, securityContainer: HTMLElement, isHacked: boolean): void;
|
|
91
91
|
toggleRect(rect: ContentProtectionRect, securityContainer: HTMLElement, isHacked: boolean): void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
2
|
-
import ReaderModule from "../ReaderModule";
|
|
3
|
-
import TextHighlighter from "../highlight/TextHighlighter";
|
|
4
|
-
import
|
|
1
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
|
+
import { ReaderModule } from "../ReaderModule";
|
|
3
|
+
import { TextHighlighter } from "../highlight/TextHighlighter";
|
|
4
|
+
import { IHighlight } from "../highlight/common/highlight";
|
|
5
|
+
import { ISelectionInfo } from "../highlight/common/selection";
|
|
6
|
+
import { Publication } from "../../model/Publication";
|
|
5
7
|
export interface DefinitionsModuleAPI {
|
|
6
|
-
success
|
|
7
|
-
click
|
|
8
|
-
visible
|
|
8
|
+
success: any;
|
|
9
|
+
click: any;
|
|
10
|
+
visible: any;
|
|
9
11
|
}
|
|
10
12
|
export interface Definition {
|
|
11
13
|
order: number;
|
|
@@ -14,19 +16,20 @@ export interface Definition {
|
|
|
14
16
|
definition?: string;
|
|
15
17
|
}
|
|
16
18
|
export interface DefinitionsModuleProperties {
|
|
17
|
-
definitions
|
|
19
|
+
definitions?: Definition[];
|
|
18
20
|
color?: string;
|
|
19
|
-
|
|
21
|
+
fullWordSearch?: boolean;
|
|
22
|
+
hideLayer?: boolean;
|
|
20
23
|
}
|
|
21
24
|
export interface DefinitionsModuleConfig extends DefinitionsModuleProperties {
|
|
22
|
-
api
|
|
25
|
+
api?: DefinitionsModuleAPI;
|
|
23
26
|
publication: Publication;
|
|
24
27
|
delegate: IFrameNavigator;
|
|
25
28
|
highlighter: TextHighlighter;
|
|
26
29
|
}
|
|
27
|
-
export
|
|
30
|
+
export declare class DefinitionsModule implements ReaderModule {
|
|
28
31
|
properties: DefinitionsModuleProperties;
|
|
29
|
-
api
|
|
32
|
+
api?: DefinitionsModuleAPI;
|
|
30
33
|
private publication;
|
|
31
34
|
private delegate;
|
|
32
35
|
private currentChapterPopupResult;
|
|
@@ -37,8 +40,13 @@ export default class DefinitionsModule implements ReaderModule {
|
|
|
37
40
|
stop(): Promise<void>;
|
|
38
41
|
protected start(): Promise<void>;
|
|
39
42
|
searchAndPaint(item: Definition, callback: (result: any) => any): Promise<void>;
|
|
40
|
-
definitions()
|
|
43
|
+
definitions: (() => Promise<void>) & {
|
|
44
|
+
clear(): void;
|
|
45
|
+
};
|
|
41
46
|
define(item: Definition): Promise<void>;
|
|
42
|
-
drawDefinitions(): void
|
|
47
|
+
drawDefinitions(): Promise<void>;
|
|
43
48
|
handleResize(): Promise<void>;
|
|
49
|
+
createDefinitionHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
|
|
50
|
+
addDefinition(definition: any): Promise<void>;
|
|
51
|
+
clearDefinitions(): Promise<void>;
|
|
44
52
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
2
|
-
export
|
|
1
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
|
+
export declare class Popup {
|
|
3
3
|
navigator: IFrameNavigator;
|
|
4
4
|
constructor(navigator: IFrameNavigator);
|
|
5
5
|
handleFootnote(link: HTMLLIElement, event: MouseEvent | TouchEvent): Promise<void>;
|
|
6
|
+
hidePopover(): Promise<void>;
|
|
7
|
+
showPopover(link: HTMLElement, event: MouseEvent | TouchEvent): Promise<void>;
|
|
6
8
|
showPopup(element: any, event: MouseEvent | TouchEvent): void;
|
|
7
9
|
private getScrollingElement;
|
|
8
10
|
}
|