@d-i-t-a/reader 1.11.0-beta.8 → 1.11.0-beta.9
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/modules/AnnotationModule.d.ts +1 -0
- package/dist/modules/BookmarkModule.d.ts +2 -2
- package/dist/modules/TTS/TTSSettings.d.ts +1 -0
- package/dist/modules/highlight/LayerSettings.d.ts +19 -0
- package/dist/modules/highlight/TextHighlighter.d.ts +21 -14
- package/dist/modules/highlight/common/highlight.d.ts +1 -1
- package/dist/modules/mediaoverlays/MediaOverlayModule.d.ts +1 -0
- package/dist/modules/pagebreak/PageBreakModule.d.ts +5 -1
- package/dist/modules/search/DefinitionsModule.d.ts +2 -2
- package/dist/modules/search/SearchModule.d.ts +1 -0
- package/dist/navigator/IFrameNavigator.d.ts +3 -1
- package/dist/reader.js +1 -1
- package/dist/reader.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,15 +10,15 @@ export interface BookmarkModuleAPI {
|
|
|
10
10
|
getBookmarks: Array<any>;
|
|
11
11
|
}
|
|
12
12
|
export interface BookmarkModuleProperties {
|
|
13
|
+
hideLayer?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export interface BookmarkModuleConfig {
|
|
15
|
+
export interface BookmarkModuleConfig extends BookmarkModuleProperties {
|
|
15
16
|
annotator: Annotator;
|
|
16
17
|
headerMenu: HTMLElement;
|
|
17
18
|
rights: ReaderRights;
|
|
18
19
|
publication: Publication;
|
|
19
20
|
delegate: IFrameNavigator;
|
|
20
21
|
initialAnnotations?: any;
|
|
21
|
-
properties: BookmarkModuleProperties;
|
|
22
22
|
api: BookmarkModuleAPI;
|
|
23
23
|
}
|
|
24
24
|
export default class BookmarkModule implements ReaderModule {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Store from "../../store/Store";
|
|
2
|
+
import { UserProperty, UserProperties } from "../../model/user-settings/UserProperties";
|
|
3
|
+
export interface LayerConfig {
|
|
4
|
+
store: Store;
|
|
5
|
+
}
|
|
6
|
+
export interface ILayerSettings {
|
|
7
|
+
}
|
|
8
|
+
export declare class LayerSettings implements ILayerSettings {
|
|
9
|
+
private readonly store;
|
|
10
|
+
private readonly LAYERSETTINGS;
|
|
11
|
+
userProperties: UserProperties;
|
|
12
|
+
static create(config: LayerConfig): Promise<any>;
|
|
13
|
+
protected constructor(store: Store);
|
|
14
|
+
stop(): Promise<void>;
|
|
15
|
+
private initialize;
|
|
16
|
+
private getLayerSettings;
|
|
17
|
+
saveProperty(property: UserProperty): Promise<any>;
|
|
18
|
+
getProperty(name: string): Promise<UserProperty>;
|
|
19
|
+
}
|
|
@@ -3,15 +3,19 @@ import { ISelectionInfo } from "./common/selection";
|
|
|
3
3
|
import { IRectSimple } from "./common/rect-utils";
|
|
4
4
|
import { AnnotationMarker } from "../../model/Locator";
|
|
5
5
|
import IFrameNavigator from "../../navigator/IFrameNavigator";
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
}
|
|
11
15
|
export declare const CLASS_HIGHLIGHT_CONTAINER = "R2_CLASS_HIGHLIGHT_CONTAINER";
|
|
16
|
+
export declare const CLASS_HIGHLIGHT_BOUNDING_AREA = "R2_CLASS_HIGHLIGHT_BOUNDING_AREA";
|
|
12
17
|
export declare const CLASS_HIGHLIGHT_AREA = "R2_CLASS_HIGHLIGHT_AREA";
|
|
13
18
|
export declare const CLASS_HIGHLIGHT_ICON = "R2_CLASS_HIGHLIGHT_ICON";
|
|
14
|
-
export declare const CLASS_HIGHLIGHT_BOUNDING_AREA = "R2_CLASS_HIGHLIGHT_BOUNDING_AREA";
|
|
15
19
|
export declare const DEFAULT_BACKGROUND_COLOR: {
|
|
16
20
|
blue: number;
|
|
17
21
|
green: number;
|
|
@@ -43,10 +47,12 @@ export interface TextHighlighterProperties {
|
|
|
43
47
|
export interface TextHighlighterConfig extends TextHighlighterProperties {
|
|
44
48
|
delegate: IFrameNavigator;
|
|
45
49
|
api: TextSelectorAPI;
|
|
50
|
+
layerSettings: LayerSettings;
|
|
46
51
|
}
|
|
47
52
|
export default class TextHighlighter {
|
|
48
53
|
private options;
|
|
49
|
-
private delegate;
|
|
54
|
+
private readonly delegate;
|
|
55
|
+
layerSettings: LayerSettings;
|
|
50
56
|
private lastSelectedHighlight;
|
|
51
57
|
properties: TextHighlighterProperties;
|
|
52
58
|
private api;
|
|
@@ -230,18 +236,19 @@ export default class TextHighlighter {
|
|
|
230
236
|
static hexToRgbA(hex: string): string;
|
|
231
237
|
static hexToRgbAWithOpacity(hex: string, opacity: number): string;
|
|
232
238
|
resetHighlightBoundingStyle(_win: any, highlightBounding: HTMLElement): void;
|
|
233
|
-
resetHighlightAreaStyle(
|
|
234
|
-
setHighlightAreaStyle(
|
|
239
|
+
resetHighlightAreaStyle(win: any, highlightArea: HTMLElement, id_container: string): void;
|
|
240
|
+
setHighlightAreaStyle(win: any, highlightAreas: Array<HTMLElement>, highlight: IHighlight): void;
|
|
235
241
|
setAndResetSearchHighlight(highlight: any, highlights: any): void;
|
|
236
242
|
isIOS(): boolean;
|
|
237
243
|
isAndroid(): boolean;
|
|
238
|
-
getScrollingElement: (
|
|
244
|
+
getScrollingElement: (doc: Document) => Element;
|
|
239
245
|
processMouseEvent(win: any, ev: MouseEvent): Promise<void>;
|
|
240
|
-
ensureHighlightsContainer(win: any, id: string): HTMLElement
|
|
241
|
-
hideAllhighlights(
|
|
242
|
-
destroyAllhighlights(
|
|
246
|
+
ensureHighlightsContainer(win: any, id: string): Promise<HTMLElement>;
|
|
247
|
+
hideAllhighlights(doc: Document): void;
|
|
248
|
+
destroyAllhighlights(doc: Document): void;
|
|
249
|
+
removeAllChildNodes(parent: any): void;
|
|
243
250
|
destroyHighlights(type: HighlightType): void;
|
|
244
|
-
destroyHighlight(
|
|
251
|
+
destroyHighlight(doc: Document, id: string): void;
|
|
245
252
|
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];
|
|
246
253
|
createHighlightDom(win: any, highlight: IHighlight): HTMLDivElement | undefined;
|
|
247
254
|
}
|
|
@@ -3,7 +3,10 @@ import ReaderModule from "../ReaderModule";
|
|
|
3
3
|
import { IHighlight } from "../highlight/common/highlight";
|
|
4
4
|
import { ISelectionInfo } from "../highlight/common/selection";
|
|
5
5
|
import { Publication } from "../../model/Publication";
|
|
6
|
-
export interface
|
|
6
|
+
export interface PageBreakModuleProperties {
|
|
7
|
+
hideLayer?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PageBreakModuleConfig extends PageBreakModuleProperties {
|
|
7
10
|
delegate: IFrameNavigator;
|
|
8
11
|
headerMenu: HTMLElement;
|
|
9
12
|
publication: Publication;
|
|
@@ -12,6 +15,7 @@ export default class PageBreakModule implements ReaderModule {
|
|
|
12
15
|
private delegate;
|
|
13
16
|
private readonly headerMenu;
|
|
14
17
|
private publication;
|
|
18
|
+
private properties;
|
|
15
19
|
private goToPageView;
|
|
16
20
|
private goToPageNumberInput;
|
|
17
21
|
private goToPageNumberButton;
|
|
@@ -19,7 +19,7 @@ export interface DefinitionsModuleProperties {
|
|
|
19
19
|
definitions: Definition[];
|
|
20
20
|
color?: string;
|
|
21
21
|
fullWordSearch?: boolean;
|
|
22
|
-
|
|
22
|
+
hideLayer?: boolean;
|
|
23
23
|
}
|
|
24
24
|
export interface DefinitionsModuleConfig extends DefinitionsModuleProperties {
|
|
25
25
|
api: DefinitionsModuleAPI;
|
|
@@ -46,7 +46,7 @@ export default class DefinitionsModule implements ReaderModule {
|
|
|
46
46
|
define(item: Definition): Promise<void>;
|
|
47
47
|
drawDefinitions(): void;
|
|
48
48
|
handleResize(): Promise<void>;
|
|
49
|
-
|
|
49
|
+
createDefinitionHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
|
|
50
50
|
addDefinition(definition: any): Promise<void>;
|
|
51
51
|
clearDefinitions(): Promise<void>;
|
|
52
52
|
}
|
|
@@ -14,7 +14,7 @@ import MediaOverlayModule, { MediaOverlayModuleConfig } from "../modules/mediaov
|
|
|
14
14
|
import { D2Link, Link } from "../model/Link";
|
|
15
15
|
import ReaderModule from "../modules/ReaderModule";
|
|
16
16
|
import { TTSModuleConfig } from "../modules/TTS/TTSSettings";
|
|
17
|
-
import PageBreakModule from "../modules/pagebreak/PageBreakModule";
|
|
17
|
+
import PageBreakModule, { PageBreakModuleConfig } from "../modules/pagebreak/PageBreakModule";
|
|
18
18
|
import DefinitionsModule, { DefinitionsModuleConfig } from "../modules/search/DefinitionsModule";
|
|
19
19
|
export declare type GetContent = (href: string) => Promise<string>;
|
|
20
20
|
export declare type GetContentBytesLength = (href: string) => Promise<number>;
|
|
@@ -90,6 +90,7 @@ export interface ReaderRights {
|
|
|
90
90
|
enableTimeline?: boolean;
|
|
91
91
|
autoGeneratePositions?: boolean;
|
|
92
92
|
enableMediaOverlays?: boolean;
|
|
93
|
+
enablePageBreaks?: boolean;
|
|
93
94
|
}
|
|
94
95
|
export interface ReaderUI {
|
|
95
96
|
settings: UserSettingsUIConfig;
|
|
@@ -108,6 +109,7 @@ export interface ReaderConfig {
|
|
|
108
109
|
define?: DefinitionsModuleConfig;
|
|
109
110
|
protection?: ContentProtectionModuleConfig;
|
|
110
111
|
mediaOverlays?: MediaOverlayModuleConfig;
|
|
112
|
+
pagebreak?: PageBreakModuleConfig;
|
|
111
113
|
annotations?: AnnotationModuleConfig;
|
|
112
114
|
bookmarks?: BookmarkModuleConfig;
|
|
113
115
|
highlighter?: TextHighlighterConfig;
|