@d-i-t-a/reader 2.2.2 → 2.3.0
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 +4796 -4743
- package/dist/esm/index.js.map +3 -3
- package/dist/reader.js +32 -32
- package/dist/reader.js.map +3 -3
- package/dist/types/modules/AnnotationModule.d.ts +2 -3
- package/dist/types/modules/BookmarkModule.d.ts +2 -3
- package/dist/types/modules/TTS/TTSModule2.d.ts +2 -2
- package/dist/types/modules/TTS/TTSSettings.d.ts +1 -2
- package/dist/types/modules/citation/CitationModule.d.ts +1 -2
- package/dist/types/modules/consumption/ConsumptionModule.d.ts +8 -3
- package/dist/types/modules/highlight/TextHighlighter.d.ts +1 -2
- package/dist/types/modules/history/HistoryModule.d.ts +1 -2
- package/dist/types/modules/linefocus/LineFocusModule.d.ts +2 -2
- package/dist/types/modules/mediaoverlays/MediaOverlayModule.d.ts +1 -2
- package/dist/types/modules/pagebreak/PageBreakModule.d.ts +1 -2
- package/dist/types/modules/positions/TimelineModule.d.ts +1 -2
- package/dist/types/modules/protection/ContentProtectionModule.d.ts +2 -3
- package/dist/types/modules/sampleread/SampleReadEventHandler.d.ts +2 -2
- package/dist/types/modules/search/DefinitionsModule.d.ts +1 -2
- package/dist/types/modules/search/SearchModule.d.ts +1 -2
- package/dist/types/navigator/IFrameNavigator.d.ts +3 -1
- package/dist/types/views/BookView.d.ts +1 -1
- package/dist/types/views/FixedBookView.d.ts +1 -1
- package/dist/types/views/ReflowableBookView.d.ts +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,6 @@ export interface AnnotationModuleConfig extends AnnotationModuleProperties {
|
|
|
23
23
|
headerMenu?: HTMLElement | null;
|
|
24
24
|
rights: Partial<ReaderRights>;
|
|
25
25
|
publication: Publication;
|
|
26
|
-
delegate: IFrameNavigator;
|
|
27
26
|
initialAnnotations?: any;
|
|
28
27
|
api?: AnnotationModuleAPI;
|
|
29
28
|
highlighter: TextHighlighter;
|
|
@@ -37,13 +36,13 @@ export declare class AnnotationModule implements ReaderModule {
|
|
|
37
36
|
private readonly headerMenu?;
|
|
38
37
|
private readonly highlighter?;
|
|
39
38
|
private readonly initialAnnotations;
|
|
40
|
-
|
|
39
|
+
navigator: IFrameNavigator;
|
|
41
40
|
properties?: AnnotationModuleProperties;
|
|
42
41
|
api?: AnnotationModuleAPI;
|
|
43
42
|
activeAnnotationMarkerId?: string;
|
|
44
43
|
activeAnnotationMarkerPosition?: string;
|
|
45
44
|
static create(config: AnnotationModuleConfig): Promise<AnnotationModule>;
|
|
46
|
-
constructor(annotator: Annotator, rights: Partial<ReaderRights>, publication: Publication,
|
|
45
|
+
constructor(annotator: Annotator, rights: Partial<ReaderRights>, publication: Publication, initialAnnotations: any, properties: AnnotationModuleProperties, highlighter: TextHighlighter, api?: AnnotationModuleAPI, headerMenu?: HTMLElement | null);
|
|
47
46
|
stop(): Promise<void>;
|
|
48
47
|
protected start(): Promise<void>;
|
|
49
48
|
private hide;
|
|
@@ -16,7 +16,6 @@ export interface BookmarkModuleConfig extends BookmarkModuleProperties {
|
|
|
16
16
|
headerMenu?: HTMLElement | null;
|
|
17
17
|
rights: Partial<ReaderRights>;
|
|
18
18
|
publication: Publication;
|
|
19
|
-
delegate: IFrameNavigator;
|
|
20
19
|
initialAnnotations?: any;
|
|
21
20
|
properties?: BookmarkModuleProperties;
|
|
22
21
|
api?: BookmarkModuleAPI;
|
|
@@ -29,11 +28,11 @@ export declare class BookmarkModule implements ReaderModule {
|
|
|
29
28
|
private sideNavSectionBookmarks;
|
|
30
29
|
private readonly headerMenu?;
|
|
31
30
|
private readonly initialAnnotations;
|
|
32
|
-
|
|
31
|
+
navigator: IFrameNavigator;
|
|
33
32
|
private readonly properties;
|
|
34
33
|
private readonly api?;
|
|
35
34
|
static create(config: BookmarkModuleConfig): Promise<any>;
|
|
36
|
-
constructor(annotator: Annotator, rights: Partial<ReaderRights>, publication: Publication,
|
|
35
|
+
constructor(annotator: Annotator, rights: Partial<ReaderRights>, publication: Publication, properties: BookmarkModuleProperties, initialAnnotations?: any, api?: BookmarkModuleAPI, headerMenu?: HTMLElement | null);
|
|
37
36
|
stop(): void;
|
|
38
37
|
protected start(): Promise<void>;
|
|
39
38
|
handleResize(): Promise<void>;
|
|
@@ -10,7 +10,7 @@ export declare class TTSModule2 implements ReaderModule {
|
|
|
10
10
|
private clean;
|
|
11
11
|
private rights;
|
|
12
12
|
private readonly highlighter;
|
|
13
|
-
|
|
13
|
+
navigator: IFrameNavigator;
|
|
14
14
|
private body;
|
|
15
15
|
private hasEventListener;
|
|
16
16
|
private readonly headerMenu?;
|
|
@@ -30,7 +30,7 @@ export declare class TTSModule2 implements ReaderModule {
|
|
|
30
30
|
speakPause(): void;
|
|
31
31
|
speakResume(): void;
|
|
32
32
|
static create(config: TTSModuleConfig): Promise<TTSModule2>;
|
|
33
|
-
constructor(
|
|
33
|
+
constructor(tts: TTSSettings, rights: Partial<ReaderRights>, highlighter: TextHighlighter, properties: TTSModuleProperties, api?: TTSModuleAPI, headerMenu?: HTMLElement | null);
|
|
34
34
|
protected start(): Promise<void>;
|
|
35
35
|
userScrolled: boolean;
|
|
36
36
|
scrollPartial: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Store from "../../store/Store";
|
|
2
2
|
import { UserProperty, UserProperties } from "../../model/user-settings/UserProperties";
|
|
3
|
-
import {
|
|
3
|
+
import { ReaderRights } from "../../navigator/IFrameNavigator";
|
|
4
4
|
import { TextHighlighter } from "../highlight/TextHighlighter";
|
|
5
5
|
export interface TTSModuleAPI {
|
|
6
6
|
started: any;
|
|
@@ -20,7 +20,6 @@ export interface TTSModuleProperties {
|
|
|
20
20
|
hideLayer?: boolean;
|
|
21
21
|
}
|
|
22
22
|
export interface TTSModuleConfig extends TTSModuleProperties {
|
|
23
|
-
delegate: IFrameNavigator;
|
|
24
23
|
rights: Partial<ReaderRights>;
|
|
25
24
|
tts: TTSSettings;
|
|
26
25
|
highlighter: TextHighlighter;
|
|
@@ -30,13 +30,12 @@ export interface CitationModuleAPI {
|
|
|
30
30
|
}
|
|
31
31
|
export interface CitationModuleConfig extends CitationModuleProperties {
|
|
32
32
|
publication: Publication;
|
|
33
|
-
delegate: IFrameNavigator;
|
|
34
33
|
highlighter: TextHighlighter;
|
|
35
34
|
api?: CitationModuleAPI;
|
|
36
35
|
}
|
|
37
36
|
export default class CitationModule implements ReaderModule {
|
|
38
37
|
private publication;
|
|
39
|
-
|
|
38
|
+
navigator: IFrameNavigator;
|
|
40
39
|
private properties;
|
|
41
40
|
private readonly highlighter?;
|
|
42
41
|
api?: CitationModuleAPI;
|
|
@@ -20,20 +20,25 @@ export interface ConsumptionModuleProperties {
|
|
|
20
20
|
idleTimeout?: number;
|
|
21
21
|
responseTimeout?: number;
|
|
22
22
|
}
|
|
23
|
+
export interface ReadingSession {
|
|
24
|
+
time: any;
|
|
25
|
+
firstLocator: Locator;
|
|
26
|
+
lastLocator: Locator;
|
|
27
|
+
progress: any;
|
|
28
|
+
}
|
|
23
29
|
export interface ConsumptionModuleConfig extends ConsumptionModuleProperties {
|
|
24
30
|
publication: Publication;
|
|
25
|
-
delegate: IFrameNavigator;
|
|
26
31
|
properties?: ConsumptionModuleProperties;
|
|
27
32
|
api?: ConsumptionModuleAPI;
|
|
28
33
|
}
|
|
29
34
|
export declare class ConsumptionModule implements ReaderModule {
|
|
30
|
-
|
|
35
|
+
navigator: IFrameNavigator;
|
|
31
36
|
private publication;
|
|
32
37
|
private properties;
|
|
33
38
|
api?: ConsumptionModuleAPI;
|
|
34
39
|
startResearchTimer?: Date;
|
|
35
40
|
researchSessionId: any;
|
|
36
|
-
readingSessions:
|
|
41
|
+
readingSessions: ReadingSession[];
|
|
37
42
|
readingSessionsInterval: any;
|
|
38
43
|
startReadingTimer: Date;
|
|
39
44
|
firstReadingLocator: Locator;
|
|
@@ -48,13 +48,12 @@ export interface TextHighlighterProperties {
|
|
|
48
48
|
selectionMenuItems?: Array<SelectionMenuItem>;
|
|
49
49
|
}
|
|
50
50
|
export interface TextHighlighterConfig extends TextHighlighterProperties {
|
|
51
|
-
delegate: IFrameNavigator;
|
|
52
51
|
api?: TextSelectorAPI;
|
|
53
52
|
layerSettings: LayerSettings;
|
|
54
53
|
}
|
|
55
54
|
export declare class TextHighlighter {
|
|
56
55
|
private options;
|
|
57
|
-
|
|
56
|
+
navigator: IFrameNavigator;
|
|
58
57
|
layerSettings: LayerSettings;
|
|
59
58
|
private lastSelectedHighlight?;
|
|
60
59
|
properties: TextHighlighterProperties;
|
|
@@ -8,13 +8,12 @@ export interface HistoryModuleProperties {
|
|
|
8
8
|
}
|
|
9
9
|
export interface HistoryModuleConfig extends HistoryModuleProperties {
|
|
10
10
|
annotator: Annotator;
|
|
11
|
-
delegate: IFrameNavigator;
|
|
12
11
|
headerMenu?: HTMLElement | null;
|
|
13
12
|
publication: Publication;
|
|
14
13
|
}
|
|
15
14
|
export declare class HistoryModule implements ReaderModule {
|
|
16
15
|
readonly annotator: Annotator | null;
|
|
17
|
-
|
|
16
|
+
navigator: IFrameNavigator;
|
|
18
17
|
private readonly headerMenu?;
|
|
19
18
|
private publication;
|
|
20
19
|
private properties;
|
|
@@ -12,13 +12,12 @@ export interface LineFocusModuleProperties {
|
|
|
12
12
|
export interface LineFocusModuleConfig extends LineFocusModuleProperties {
|
|
13
13
|
api?: LineFocusModuleAPI;
|
|
14
14
|
publication: Publication;
|
|
15
|
-
delegate: IFrameNavigator;
|
|
16
15
|
highlighter: TextHighlighter;
|
|
17
16
|
}
|
|
18
17
|
export default class LineFocusModule implements ReaderModule {
|
|
19
18
|
properties: LineFocusModuleProperties;
|
|
20
19
|
api?: LineFocusModuleAPI;
|
|
21
|
-
|
|
20
|
+
navigator: IFrameNavigator;
|
|
22
21
|
private highlighter;
|
|
23
22
|
private hasEventListener;
|
|
24
23
|
lines: Array<HTMLElement>;
|
|
@@ -33,6 +32,7 @@ export default class LineFocusModule implements ReaderModule {
|
|
|
33
32
|
private constructor();
|
|
34
33
|
stop(): Promise<void>;
|
|
35
34
|
protected start(): Promise<void>;
|
|
35
|
+
initialize(): Promise<unknown>;
|
|
36
36
|
private keydown;
|
|
37
37
|
private keyup;
|
|
38
38
|
handleResize(): void;
|
|
@@ -23,13 +23,12 @@ export interface MediaOverlayModuleProperties {
|
|
|
23
23
|
}
|
|
24
24
|
export interface MediaOverlayModuleConfig extends MediaOverlayModuleProperties {
|
|
25
25
|
publication: Publication;
|
|
26
|
-
delegate: IFrameNavigator;
|
|
27
26
|
settings: MediaOverlaySettings;
|
|
28
27
|
api?: MediaOverlayModuleAPI;
|
|
29
28
|
}
|
|
30
29
|
export declare class MediaOverlayModule implements ReaderModule {
|
|
31
30
|
private publication;
|
|
32
|
-
|
|
31
|
+
navigator: IFrameNavigator;
|
|
33
32
|
private audioElement;
|
|
34
33
|
settings: MediaOverlaySettings;
|
|
35
34
|
private properties;
|
|
@@ -7,12 +7,11 @@ export interface PageBreakModuleProperties {
|
|
|
7
7
|
hideLayer?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface PageBreakModuleConfig extends PageBreakModuleProperties {
|
|
10
|
-
delegate: IFrameNavigator;
|
|
11
10
|
headerMenu?: HTMLElement | null;
|
|
12
11
|
publication: Publication;
|
|
13
12
|
}
|
|
14
13
|
export declare class PageBreakModule implements ReaderModule {
|
|
15
|
-
|
|
14
|
+
navigator: IFrameNavigator;
|
|
16
15
|
private readonly headerMenu?;
|
|
17
16
|
private publication;
|
|
18
17
|
private properties;
|
|
@@ -3,11 +3,10 @@ import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
|
3
3
|
import { ReaderModule } from "../ReaderModule";
|
|
4
4
|
export interface TimelineModuleConfig {
|
|
5
5
|
publication: Publication;
|
|
6
|
-
delegate: IFrameNavigator;
|
|
7
6
|
}
|
|
8
7
|
export declare class TimelineModule implements ReaderModule {
|
|
9
8
|
private publication;
|
|
10
|
-
|
|
9
|
+
navigator: IFrameNavigator;
|
|
11
10
|
private timelineContainer;
|
|
12
11
|
private positionSlider;
|
|
13
12
|
static create(config: TimelineModuleConfig): Promise<TimelineModule>;
|
|
@@ -18,7 +18,6 @@ export interface ContentProtectionModuleProperties {
|
|
|
18
18
|
supportedBrowsers: string[];
|
|
19
19
|
}
|
|
20
20
|
export interface ContentProtectionModuleConfig extends Partial<ContentProtectionModuleProperties> {
|
|
21
|
-
delegate: IFrameNavigator;
|
|
22
21
|
api?: ContentProtectionModuleAPI;
|
|
23
22
|
}
|
|
24
23
|
export interface ContentProtectionModuleAPI {
|
|
@@ -36,7 +35,7 @@ interface ContentProtectionRect {
|
|
|
36
35
|
}
|
|
37
36
|
export declare class ContentProtectionModule implements ReaderModule {
|
|
38
37
|
private rects;
|
|
39
|
-
|
|
38
|
+
navigator: IFrameNavigator;
|
|
40
39
|
properties?: ContentProtectionModuleProperties;
|
|
41
40
|
private hasEventListener;
|
|
42
41
|
private isHacked;
|
|
@@ -46,7 +45,7 @@ export declare class ContentProtectionModule implements ReaderModule {
|
|
|
46
45
|
citation: boolean;
|
|
47
46
|
static setupPreloadProtection(config: Partial<ContentProtectionModuleConfig>): Promise<void>;
|
|
48
47
|
static create(config: ContentProtectionModuleConfig): Promise<ContentProtectionModule>;
|
|
49
|
-
constructor(
|
|
48
|
+
constructor(properties?: ContentProtectionModuleProperties);
|
|
50
49
|
private static startInspectorProtection;
|
|
51
50
|
private static isCurrentBrowserSupported;
|
|
52
51
|
protected start(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFrameNavigator } from "../../navigator/IFrameNavigator";
|
|
2
2
|
export default class SampleReadEventHandler {
|
|
3
|
-
|
|
4
|
-
constructor(
|
|
3
|
+
navigator: IFrameNavigator;
|
|
4
|
+
constructor(navigator: IFrameNavigator);
|
|
5
5
|
enforceSampleRead: ((position: any) => void) & {
|
|
6
6
|
clear(): void;
|
|
7
7
|
};
|
|
@@ -24,14 +24,13 @@ export interface DefinitionsModuleProperties {
|
|
|
24
24
|
export interface DefinitionsModuleConfig extends DefinitionsModuleProperties {
|
|
25
25
|
api?: DefinitionsModuleAPI;
|
|
26
26
|
publication: Publication;
|
|
27
|
-
delegate: IFrameNavigator;
|
|
28
27
|
highlighter: TextHighlighter;
|
|
29
28
|
}
|
|
30
29
|
export declare class DefinitionsModule implements ReaderModule {
|
|
31
30
|
properties: DefinitionsModuleProperties;
|
|
32
31
|
api?: DefinitionsModuleAPI;
|
|
33
32
|
private publication;
|
|
34
|
-
|
|
33
|
+
navigator: IFrameNavigator;
|
|
35
34
|
private currentChapterPopupResult;
|
|
36
35
|
private currentPopupHighlights;
|
|
37
36
|
private highlighter;
|
|
@@ -15,7 +15,6 @@ export interface SearchModuleConfig extends SearchModuleProperties {
|
|
|
15
15
|
api?: SearchModuleAPI;
|
|
16
16
|
publication: Publication;
|
|
17
17
|
headerMenu?: HTMLElement | null;
|
|
18
|
-
delegate: IFrameNavigator;
|
|
19
18
|
highlighter: TextHighlighter;
|
|
20
19
|
}
|
|
21
20
|
export declare class SearchModule implements ReaderModule {
|
|
@@ -23,7 +22,7 @@ export declare class SearchModule implements ReaderModule {
|
|
|
23
22
|
private api?;
|
|
24
23
|
private publication;
|
|
25
24
|
private readonly headerMenu?;
|
|
26
|
-
|
|
25
|
+
navigator: IFrameNavigator;
|
|
27
26
|
private searchInput;
|
|
28
27
|
private searchGo;
|
|
29
28
|
private currentChapterSearchResult;
|
|
@@ -60,6 +60,8 @@ export interface IFrameNavigatorConfig {
|
|
|
60
60
|
services?: PublicationServices;
|
|
61
61
|
sample?: SampleRead;
|
|
62
62
|
requestConfig?: RequestConfig;
|
|
63
|
+
modules: ReaderModule[];
|
|
64
|
+
highlighter: TextHighlighter;
|
|
63
65
|
}
|
|
64
66
|
export interface PublicationServices {
|
|
65
67
|
positions?: URL;
|
|
@@ -207,7 +209,7 @@ export declare class IFrameNavigator extends EventEmitter implements Navigator {
|
|
|
207
209
|
requestConfig?: RequestConfig;
|
|
208
210
|
private didInitKeyboardEventHandler;
|
|
209
211
|
static create(config: IFrameNavigatorConfig): Promise<IFrameNavigator>;
|
|
210
|
-
protected constructor(settings: UserSettings, annotator: Annotator | undefined, initialLastReadingPosition: ReadingPosition | undefined, publication: Publication, api?: Partial<NavigatorAPI>, rights?: Partial<ReaderRights>, tts?: Partial<TTSModuleConfig>, injectables?: Array<Injectable>, attributes?: IFrameAttributes, services?: PublicationServices, sample?: SampleRead, requestConfig?: RequestConfig);
|
|
212
|
+
protected constructor(settings: UserSettings, annotator: Annotator | undefined, initialLastReadingPosition: ReadingPosition | undefined, publication: Publication, api?: Partial<NavigatorAPI>, rights?: Partial<ReaderRights>, tts?: Partial<TTSModuleConfig>, injectables?: Array<Injectable>, attributes?: IFrameAttributes, services?: PublicationServices, sample?: SampleRead, requestConfig?: RequestConfig, highlighter?: TextHighlighter, modules?: ReaderModule[]);
|
|
211
213
|
stop(): void;
|
|
212
214
|
spreads: HTMLDivElement;
|
|
213
215
|
firstSpread: HTMLDivElement;
|
|
@@ -2,7 +2,7 @@ import { IFrameNavigator, IFrameAttributes } from "../navigator/IFrameNavigator"
|
|
|
2
2
|
import BookView from "./BookView";
|
|
3
3
|
export default class FixedBookView implements BookView {
|
|
4
4
|
layout: string;
|
|
5
|
-
|
|
5
|
+
navigator: IFrameNavigator;
|
|
6
6
|
name: string;
|
|
7
7
|
label: string;
|
|
8
8
|
iframe: HTMLIFrameElement;
|
|
@@ -7,7 +7,7 @@ export default class ReflowableBookView implements BookView {
|
|
|
7
7
|
private readonly USERSETTINGS;
|
|
8
8
|
private readonly store;
|
|
9
9
|
private scrollMode;
|
|
10
|
-
|
|
10
|
+
navigator: IFrameNavigator;
|
|
11
11
|
constructor(store: Store);
|
|
12
12
|
setMode(scroll: boolean): void;
|
|
13
13
|
name: string;
|