@d-i-t-a/reader 2.0.0-beta.1 → 2.0.0-beta.10
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 +39240 -35383
- package/dist/esm/index.js.map +3 -3
- package/dist/injectables/style/linefocus.css +55 -0
- package/dist/injectables/style/popup.css +121 -0
- package/dist/injectables/style/style.css +25 -1
- package/dist/reader.css +1 -1
- package/dist/reader.js +50 -50
- 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 +12 -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 +16 -14
- 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 +7 -7
- package/dist/types/modules/TTS/TTSModule2.d.ts +8 -8
- 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 +43 -59
- package/dist/types/modules/highlight/common/highlight.d.ts +6 -2
- 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 +45 -0
- package/dist/types/modules/mediaoverlays/MediaOverlayModule.d.ts +19 -14
- package/dist/types/modules/mediaoverlays/MediaOverlaySettings.d.ts +20 -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 +6 -6
- package/dist/types/modules/sampleread/SampleReadEventHandler.d.ts +1 -1
- package/dist/types/modules/search/DefinitionsModule.d.ts +52 -0
- package/dist/types/modules/search/Popup.d.ts +8 -0
- package/dist/types/modules/search/SearchModule.d.ts +17 -13
- package/dist/types/modules/search/searchWithDomSeek.d.ts +1 -1
- package/dist/types/navigator/IFrameNavigator.d.ts +62 -43
- package/dist/types/reader.d.ts +96 -55
- 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 +12 -0
- 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 +8 -7
- package/dist/types/views/FixedBookView.d.ts +6 -3
- package/dist/types/views/ReflowableBookView.d.ts +2 -2
- package/package.json +14 -7
|
@@ -1,20 +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
|
-
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
}
|
|
11
16
|
export declare const CLASS_HIGHLIGHT_CONTAINER = "R2_CLASS_HIGHLIGHT_CONTAINER";
|
|
17
|
+
export declare const CLASS_HIGHLIGHT_BOUNDING_AREA = "R2_CLASS_HIGHLIGHT_BOUNDING_AREA";
|
|
12
18
|
export declare const CLASS_HIGHLIGHT_AREA = "R2_CLASS_HIGHLIGHT_AREA";
|
|
13
19
|
export declare const CLASS_HIGHLIGHT_ICON = "R2_CLASS_HIGHLIGHT_ICON";
|
|
14
|
-
export declare const
|
|
20
|
+
export declare const DEFAULT_BACKGROUND_COLOR: {
|
|
21
|
+
blue: number;
|
|
22
|
+
green: number;
|
|
23
|
+
red: number;
|
|
24
|
+
};
|
|
15
25
|
export interface TextSelectorAPI {
|
|
16
26
|
selectionMenuOpen: any;
|
|
17
27
|
selectionMenuClose: any;
|
|
28
|
+
selection: any;
|
|
18
29
|
}
|
|
19
30
|
export declare const _highlights: IHighlight[];
|
|
20
31
|
interface IWithRect {
|
|
@@ -35,17 +46,19 @@ export interface TextHighlighterProperties {
|
|
|
35
46
|
selectionMenuItems?: Array<SelectionMenuItem>;
|
|
36
47
|
}
|
|
37
48
|
export interface TextHighlighterConfig extends TextHighlighterProperties {
|
|
38
|
-
delegate
|
|
49
|
+
delegate: IFrameNavigator;
|
|
39
50
|
api?: TextSelectorAPI;
|
|
51
|
+
layerSettings: LayerSettings;
|
|
40
52
|
}
|
|
41
|
-
export
|
|
53
|
+
export declare class TextHighlighter {
|
|
42
54
|
private options;
|
|
43
|
-
private delegate;
|
|
44
|
-
|
|
55
|
+
private readonly delegate;
|
|
56
|
+
layerSettings: LayerSettings;
|
|
57
|
+
private lastSelectedHighlight?;
|
|
45
58
|
properties: TextHighlighterProperties;
|
|
46
|
-
private api
|
|
59
|
+
private api?;
|
|
47
60
|
private hasEventListener;
|
|
48
|
-
activeAnnotationMarkerId
|
|
61
|
+
activeAnnotationMarkerId?: string;
|
|
49
62
|
static create(config: TextHighlighterConfig): Promise<any>;
|
|
50
63
|
private constructor();
|
|
51
64
|
initialize(): Promise<void>;
|
|
@@ -143,6 +156,9 @@ export default class TextHighlighter {
|
|
|
143
156
|
selectionMenuClosed: (() => void) & {
|
|
144
157
|
clear(): void;
|
|
145
158
|
};
|
|
159
|
+
selection: ((text: any, selection: any) => void) & {
|
|
160
|
+
clear(): void;
|
|
161
|
+
};
|
|
146
162
|
toolboxPlacement(): void;
|
|
147
163
|
toolboxHandler(): void;
|
|
148
164
|
/**
|
|
@@ -156,6 +172,7 @@ export default class TextHighlighter {
|
|
|
156
172
|
stopReadAloud(): void;
|
|
157
173
|
speakAll(): void;
|
|
158
174
|
callbackComplete(): void;
|
|
175
|
+
isOutsideViewport(rect: any): boolean;
|
|
159
176
|
get visibleTextRects(): HTMLElementRect[];
|
|
160
177
|
doneSpeaking(reload?: boolean): void;
|
|
161
178
|
/**
|
|
@@ -194,20 +211,6 @@ export default class TextHighlighter {
|
|
|
194
211
|
* @memberof TextHighlighter
|
|
195
212
|
*/
|
|
196
213
|
getColor(): string;
|
|
197
|
-
/**
|
|
198
|
-
* Returns highlights from given container.
|
|
199
|
-
* @param params
|
|
200
|
-
* @param {HTMLElement} [params.container] - return highlights from this element. Default: the element the
|
|
201
|
-
* highlighter is applied to.
|
|
202
|
-
* @param {boolean} [params.andSelf] - if set to true and container is a highlight itself, add container to
|
|
203
|
-
* returned results. Default: true.
|
|
204
|
-
* @param {boolean} [params.grouped] - if set to true, highlights are grouped in logical groups of highlights added
|
|
205
|
-
* in the same moment. Each group is an object which has got array of highlights, 'toString' method and 'timestamp'
|
|
206
|
-
* property. Default: false.
|
|
207
|
-
* @returns {Array} - array of highlights.
|
|
208
|
-
* @memberof TextHighlighter
|
|
209
|
-
*/
|
|
210
|
-
getHighlights(params?: any): Array<any>;
|
|
211
214
|
/**
|
|
212
215
|
* Returns true if element is a highlight.
|
|
213
216
|
* All highlights have 'data-highlighted' attribute.
|
|
@@ -216,20 +219,6 @@ export default class TextHighlighter {
|
|
|
216
219
|
* @memberof TextHighlighter
|
|
217
220
|
*/
|
|
218
221
|
isHighlight(el: any): boolean;
|
|
219
|
-
/**
|
|
220
|
-
* Serializes all highlights in the element the highlighter is applied to.
|
|
221
|
-
* @returns {string} - stringified JSON with highlights definition
|
|
222
|
-
* @memberof TextHighlighter
|
|
223
|
-
*/
|
|
224
|
-
serializeHighlights(): string;
|
|
225
|
-
/**
|
|
226
|
-
* Deserializes highlights.
|
|
227
|
-
* @throws exception when can't parse JSON or JSON has invalid structure.
|
|
228
|
-
* @param {object} json - JSON object with highlights definition.
|
|
229
|
-
* @returns {Array} - array of deserialized highlights.
|
|
230
|
-
* @memberof TextHighlighter
|
|
231
|
-
*/
|
|
232
|
-
deserializeHighlights(json: any): Array<any>;
|
|
233
222
|
/**
|
|
234
223
|
* Creates wrapper for highlights.
|
|
235
224
|
* TextHighlighter instance calls this method each time it needs to create highlights and pass options retrieved
|
|
@@ -248,27 +237,22 @@ export default class TextHighlighter {
|
|
|
248
237
|
};
|
|
249
238
|
static hexToRgbA(hex: string): string;
|
|
250
239
|
static hexToRgbAWithOpacity(hex: string, opacity: number): string;
|
|
251
|
-
resetHighlightBoundingStyle(_win:
|
|
252
|
-
resetHighlightAreaStyle(
|
|
253
|
-
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;
|
|
254
243
|
setAndResetSearchHighlight(highlight: any, highlights: any): void;
|
|
255
244
|
isIOS(): boolean;
|
|
256
245
|
isAndroid(): boolean;
|
|
257
|
-
getScrollingElement: (
|
|
258
|
-
processMouseEvent(win:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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;
|
|
262
253
|
destroyHighlights(type: HighlightType): void;
|
|
263
|
-
destroyHighlight(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
clear(): void;
|
|
267
|
-
};
|
|
268
|
-
recreateAllHighlights(win: IReadiumIFrameWindow): void;
|
|
269
|
-
createSearchHighlight(selectionInfo: ISelectionInfo, color: string): IHighlight;
|
|
270
|
-
createPageBreakHighlight(selectionInfo: ISelectionInfo, title: string): IHighlight;
|
|
271
|
-
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];
|
|
272
|
-
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;
|
|
273
257
|
}
|
|
274
258
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ISelectionInfo } from "./selection";
|
|
2
2
|
import { AnnotationMarker } from "../../../model/Locator";
|
|
3
|
+
import { Definition } from "../../search/DefinitionsModule";
|
|
3
4
|
export interface IColor {
|
|
4
5
|
red: number;
|
|
5
6
|
green: number;
|
|
@@ -37,7 +38,9 @@ export declare enum HighlightType {
|
|
|
37
38
|
Annotation = 0,
|
|
38
39
|
Search = 1,
|
|
39
40
|
ReadAloud = 2,
|
|
40
|
-
PageBreak = 3
|
|
41
|
+
PageBreak = 3,
|
|
42
|
+
Definition = 4,
|
|
43
|
+
LineFocus = 5
|
|
41
44
|
}
|
|
42
45
|
export interface IHighlight {
|
|
43
46
|
id: string;
|
|
@@ -49,7 +52,8 @@ export interface IHighlight {
|
|
|
49
52
|
color: string;
|
|
50
53
|
style?: IStyle | undefined;
|
|
51
54
|
position?: number;
|
|
52
|
-
note?: string | undefined;
|
|
55
|
+
note?: string | null | undefined;
|
|
56
|
+
definition?: Definition | undefined;
|
|
53
57
|
type: HighlightType;
|
|
54
58
|
}
|
|
55
59
|
export interface SelectionMenuItem {
|
|
@@ -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,45 @@
|
|
|
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
|
+
}
|
|
11
|
+
export interface LineFocusModuleConfig extends LineFocusModuleProperties {
|
|
12
|
+
api?: LineFocusModuleAPI;
|
|
13
|
+
publication: Publication;
|
|
14
|
+
delegate: IFrameNavigator;
|
|
15
|
+
highlighter: TextHighlighter;
|
|
16
|
+
}
|
|
17
|
+
export default class LineFocusModule implements ReaderModule {
|
|
18
|
+
properties: LineFocusModuleProperties;
|
|
19
|
+
api?: LineFocusModuleAPI;
|
|
20
|
+
private delegate;
|
|
21
|
+
private highlighter;
|
|
22
|
+
lines: Array<HTMLElement>;
|
|
23
|
+
index: number;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
isDebug: boolean;
|
|
26
|
+
lineFocusContainer: HTMLElement | null;
|
|
27
|
+
lineFocusTopBlinder: HTMLElement | null;
|
|
28
|
+
lineFocusBottomBlinder: HTMLElement | null;
|
|
29
|
+
static create(config: LineFocusModuleConfig): Promise<LineFocusModule>;
|
|
30
|
+
private constructor();
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
protected start(): Promise<void>;
|
|
33
|
+
handleResize(): void;
|
|
34
|
+
enableLineFocus(): Promise<void>;
|
|
35
|
+
wrapperHeight: string | undefined;
|
|
36
|
+
disableLineFocus(resetHeight?: boolean): void;
|
|
37
|
+
lineFocus(): void;
|
|
38
|
+
currentLine(): void;
|
|
39
|
+
lineDown(): void;
|
|
40
|
+
lineUp(): void;
|
|
41
|
+
almostEqual(a: number, b: number, tolerance: number): boolean;
|
|
42
|
+
findRects(parent: HTMLElement): any;
|
|
43
|
+
findTextNodes(parentElement: Element, nodes?: Array<Element>): Array<Element>;
|
|
44
|
+
measureTextNodes(node: Element): any;
|
|
45
|
+
}
|
|
@@ -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
|
private settings;
|
|
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) => 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,35 @@ 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;
|
|
38
42
|
wait: number;
|
|
39
43
|
userProperties: UserProperties;
|
|
40
44
|
private settingsChangeCallback;
|
|
41
45
|
private settingsView;
|
|
42
|
-
private readonly headerMenu
|
|
43
|
-
private volumeButtons;
|
|
46
|
+
private readonly headerMenu?;
|
|
44
47
|
private speechAutoScroll;
|
|
45
48
|
private speechAutoTurn;
|
|
46
49
|
private speechVolume;
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
private speechRate;
|
|
51
|
+
private readonly api?;
|
|
52
|
+
static create(config: MediaOverlayConfig): any;
|
|
53
|
+
protected constructor(store: Store, api?: MediaOverlayModuleAPI, headerMenu?: HTMLElement | null);
|
|
54
|
+
stop(): void;
|
|
51
55
|
private initialise;
|
|
52
56
|
private reset;
|
|
53
57
|
private initializeSelections;
|
|
54
58
|
setControls(): void;
|
|
55
59
|
private renderControls;
|
|
56
60
|
onSettingsChange(callback: () => void): void;
|
|
57
|
-
private setupEvents;
|
|
58
61
|
private storeProperty;
|
|
59
62
|
private updateUserSettings;
|
|
60
63
|
private getMediaOverlaySettings;
|
|
61
64
|
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):
|
|
65
|
+
getProperty(name: string): UserProperty | null;
|
|
66
|
+
resetMediaOverlaySettings(): void;
|
|
67
|
+
applyMediaOverlaySettings(mediaOverlaySettings: IMediaOverlayUserSettings): void;
|
|
68
|
+
applyMediaOverlaySetting(key: any, value: any): void;
|
|
69
|
+
increase(incremental: MediaOverlayIncrementable): void;
|
|
70
|
+
decrease(incremental: MediaOverlayIncrementable): void;
|
|
68
71
|
}
|
|
@@ -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>;
|
|
@@ -0,0 +1,52 @@
|
|
|
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";
|
|
7
|
+
export interface DefinitionsModuleAPI {
|
|
8
|
+
success: any;
|
|
9
|
+
click: any;
|
|
10
|
+
visible: any;
|
|
11
|
+
}
|
|
12
|
+
export interface Definition {
|
|
13
|
+
order: number;
|
|
14
|
+
terms: [string];
|
|
15
|
+
result?: number;
|
|
16
|
+
definition?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DefinitionsModuleProperties {
|
|
19
|
+
definitions?: Definition[];
|
|
20
|
+
color?: string;
|
|
21
|
+
fullWordSearch?: boolean;
|
|
22
|
+
hideLayer?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface DefinitionsModuleConfig extends DefinitionsModuleProperties {
|
|
25
|
+
api?: DefinitionsModuleAPI;
|
|
26
|
+
publication: Publication;
|
|
27
|
+
delegate: IFrameNavigator;
|
|
28
|
+
highlighter: TextHighlighter;
|
|
29
|
+
}
|
|
30
|
+
export declare class DefinitionsModule implements ReaderModule {
|
|
31
|
+
properties: DefinitionsModuleProperties;
|
|
32
|
+
api?: DefinitionsModuleAPI;
|
|
33
|
+
private publication;
|
|
34
|
+
private delegate;
|
|
35
|
+
private currentChapterPopupResult;
|
|
36
|
+
private currentPopupHighlights;
|
|
37
|
+
private highlighter;
|
|
38
|
+
static create(config: DefinitionsModuleConfig): Promise<DefinitionsModule>;
|
|
39
|
+
private constructor();
|
|
40
|
+
stop(): Promise<void>;
|
|
41
|
+
protected start(): Promise<void>;
|
|
42
|
+
searchAndPaint(item: Definition, callback: (result: any) => any): Promise<void>;
|
|
43
|
+
definitions: (() => Promise<void>) & {
|
|
44
|
+
clear(): void;
|
|
45
|
+
};
|
|
46
|
+
define(item: Definition): Promise<void>;
|
|
47
|
+
drawDefinitions(): Promise<void>;
|
|
48
|
+
handleResize(): Promise<void>;
|
|
49
|
+
createDefinitionHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
|
|
50
|
+
addDefinition(definition: any): Promise<void>;
|
|
51
|
+
clearDefinitions(): Promise<void>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
|
+
export declare class Popup {
|
|
3
|
+
navigator: IFrameNavigator;
|
|
4
|
+
constructor(navigator: IFrameNavigator);
|
|
5
|
+
handleFootnote(link: HTMLLIElement, event: MouseEvent | TouchEvent): Promise<void>;
|
|
6
|
+
showPopup(element: any, event: MouseEvent | TouchEvent): void;
|
|
7
|
+
private getScrollingElement;
|
|
8
|
+
}
|