@d-i-t-a/reader 1.11.0-beta.6 → 1.11.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/NOTICE ADDED
@@ -0,0 +1,20 @@
1
+ R2D2BC
2
+ Copyright 2018-2020 DITA (AM Consulting LLC)
3
+
4
+ This project bundles the following dependencies under the MIT license.
5
+ See bundled license files for details.
6
+
7
+ - Materialize | Copyright (c) 2014-2018 Materialize
8
+ -> in "styles/sass/materialize"
9
+
10
+ This project bundles the following dependencies under the SIL Open Font License.
11
+ See bundled license files for details.
12
+
13
+ - OpenDyxslexic Font | Copyright (c) 12/2012 - 2019
14
+ -> in "viewer/fonts/opendyslexic"
15
+
16
+ This project bundles the following dependencies under the BSD license.
17
+ See bundled license files for details.
18
+
19
+ - Readium-CSS | Copyright (c) 2017, Readium
20
+ -> in "viewer/readium-css"
@@ -14,6 +14,7 @@ export interface AnnotationModuleAPI {
14
14
  }
15
15
  export interface AnnotationModuleProperties {
16
16
  initialAnnotationColor: string;
17
+ hideLayer?: boolean;
17
18
  }
18
19
  export interface AnnotationModuleConfig extends AnnotationModuleProperties {
19
20
  annotator: Annotator;
@@ -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 {
@@ -18,6 +18,7 @@ export interface TTSModuleProperties {
18
18
  pitch?: number;
19
19
  volume?: number;
20
20
  voice?: TTSVoice;
21
+ hideLayer?: boolean;
21
22
  }
22
23
  export interface TTSModuleConfig extends TTSModuleProperties {
23
24
  delegate: IFrameNavigator;
@@ -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
- export declare const ID_HIGHLIGHTS_CONTAINER = "R2_ID_HIGHLIGHTS_CONTAINER";
7
- export declare const ID_READALOUD_CONTAINER = "R2_ID_READALOUD_CONTAINER";
8
- export declare const ID_PAGEBREAK_CONTAINER = "R2_ID_PAGEBREAK_CONTAINER";
9
- export declare const ID_SEARCH_CONTAINER = "R2_ID_SEARCH_CONTAINER";
10
- export declare const ID_POPUP_CONTAINER = "R2_ID_POPUP_CONTAINER";
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(_win: any, highlightArea: HTMLElement, id_container: string): void;
234
- setHighlightAreaStyle(_win: any, highlightAreas: Array<HTMLElement>, highlight: IHighlight): void;
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: (documant: Document) => Element;
244
+ getScrollingElement: (doc: Document) => Element;
239
245
  processMouseEvent(win: any, ev: MouseEvent): Promise<void>;
240
- ensureHighlightsContainer(win: any, id: string): HTMLElement;
241
- hideAllhighlights(_documant: Document): void;
242
- destroyAllhighlights(documant: Document): void;
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(documant: Document, id: string): void;
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
  }
@@ -39,7 +39,7 @@ export declare enum HighlightType {
39
39
  Search = 1,
40
40
  ReadAloud = 2,
41
41
  PageBreak = 3,
42
- Popup = 4
42
+ Definition = 4
43
43
  }
44
44
  export interface IHighlight {
45
45
  id: string;
@@ -18,6 +18,7 @@ export interface MediaOverlayModuleProperties {
18
18
  autoTurn?: boolean;
19
19
  volume?: number;
20
20
  wait?: number;
21
+ hideLayer?: boolean;
21
22
  }
22
23
  export interface MediaOverlayModuleConfig extends MediaOverlayModuleProperties {
23
24
  publication: Publication;
@@ -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 PageBreakModuleConfig {
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
- api?: DefinitionsModuleAPI;
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
- createPopupHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
49
+ createDefinitionHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
50
50
  addDefinition(definition: any): Promise<void>;
51
51
  clearDefinitions(): Promise<void>;
52
52
  }
@@ -9,6 +9,7 @@ export interface SearchModuleAPI {
9
9
  export interface SearchModuleProperties {
10
10
  color?: string;
11
11
  current?: string;
12
+ hideLayer?: boolean;
12
13
  }
13
14
  export interface SearchModuleConfig extends SearchModuleProperties {
14
15
  api: SearchModuleAPI;
@@ -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;