@d-i-t-a/reader 2.1.0-beta.8 → 2.1.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.
@@ -31,7 +31,8 @@ export declare enum AnnotationMarker {
31
31
  Highlight = 0,
32
32
  Underline = 1,
33
33
  Bookmark = 2,
34
- Custom = 3
34
+ Custom = 3,
35
+ Comment = 4
35
36
  }
36
37
  export interface Annotation extends Locator {
37
38
  id?: any;
@@ -11,10 +11,12 @@ export interface AnnotationModuleAPI {
11
11
  deleteAnnotation: Highlight;
12
12
  updateAnnotation: Highlight;
13
13
  selectedAnnotation: Highlight;
14
+ addCommentToAnnotation: Highlight;
14
15
  }
15
16
  export interface AnnotationModuleProperties {
16
17
  initialAnnotationColor?: string;
17
18
  hideLayer?: boolean;
19
+ enableComments?: boolean;
18
20
  }
19
21
  export interface AnnotationModuleConfig extends AnnotationModuleProperties {
20
22
  annotator: Annotator;
@@ -31,6 +33,7 @@ export declare class AnnotationModule implements ReaderModule {
31
33
  private rights;
32
34
  private publication;
33
35
  private highlightsView;
36
+ private commentGutter?;
34
37
  private readonly headerMenu?;
35
38
  private readonly highlighter?;
36
39
  private readonly initialAnnotations;
@@ -62,10 +65,14 @@ export declare class AnnotationModule implements ReaderModule {
62
65
  getAnnotations(): any;
63
66
  showHighlights(): void;
64
67
  drawHighlights(): Promise<void>;
68
+ repositionGutters(): any;
65
69
  private createTree;
66
70
  private handleAnnotationLinkClick;
67
71
  private handleAnnotationLinkDeleteClick;
68
72
  private static readableTimestamp;
69
73
  getAnnotation(highlight: IHighlight): Promise<any>;
70
74
  getAnnotationByID(id: string): Promise<any>;
75
+ syncPosition(highlights: Array<any>): any;
76
+ reposition(highlights: Array<any>): any;
71
77
  }
78
+ export declare function repositionHighlights(highlights: Array<any>): any;
@@ -48,7 +48,7 @@ export declare class TTSModule2 implements ReaderModule {
48
48
  ttsPlayQueueIndexDebounced: ((ttsQueueIndex: number, ttsQueue: any) => void) & {
49
49
  clear(): void;
50
50
  };
51
- updateTTSInfo(ttsQueueItem: any, charIndex: number, charLength: number, utteranceText: string | undefined): string | undefined;
51
+ updateTTSInfo(ttsQueueItem: any, charIndex: number, charLength: number, startIndex: number, utteranceText: string | undefined): string | undefined;
52
52
  _ttsQueueItemHighlightsWord: IHighlight | undefined;
53
53
  wrapHighlightWord(ttsQueueItemRef: ITtsQueueItemReference, utteranceText: string, charIndex: number, charLength: number, word: string, start: number, end: number): void;
54
54
  }
@@ -20,16 +20,22 @@ export interface CitationModuleProperties {
20
20
  library?: string;
21
21
  styles?: string[];
22
22
  }
23
+ export interface CitationModuleAPI {
24
+ citationCreated: any;
25
+ citationFailed: any;
26
+ }
23
27
  export interface CitationModuleConfig extends CitationModuleProperties {
24
28
  publication: Publication;
25
29
  delegate: IFrameNavigator;
26
30
  highlighter: TextHighlighter;
31
+ api?: CitationModuleAPI;
27
32
  }
28
33
  export default class CitationModule implements ReaderModule {
29
34
  private publication;
30
35
  private delegate;
31
36
  private properties;
32
37
  private readonly highlighter?;
38
+ api?: CitationModuleAPI;
33
39
  private constructor();
34
40
  static create(config: CitationModuleConfig): Promise<CitationModule>;
35
41
  stop(): Promise<void>;
@@ -11,7 +11,8 @@ export declare enum HighlightContainer {
11
11
  R2_ID_PAGEBREAK_CONTAINER = "R2_ID_PAGEBREAK_CONTAINER",
12
12
  R2_ID_SEARCH_CONTAINER = "R2_ID_SEARCH_CONTAINER",
13
13
  R2_ID_DEFINITIONS_CONTAINER = "R2_ID_DEFINITIONS_CONTAINER",
14
- R2_ID_LINEFOCUS_CONTAINER = "R2_ID_LINEFOCUS_CONTAINER"
14
+ R2_ID_LINEFOCUS_CONTAINER = "R2_ID_LINEFOCUS_CONTAINER",
15
+ R2_ID_GUTTER_RIGHT_CONTAINER = "R2_ID_GUTTER_RIGHT_CONTAINER"
15
16
  }
16
17
  export declare const CLASS_HIGHLIGHT_CONTAINER = "R2_CLASS_HIGHLIGHT_CONTAINER";
17
18
  export declare const CLASS_HIGHLIGHT_BOUNDING_AREA = "R2_CLASS_HIGHLIGHT_BOUNDING_AREA";
@@ -40,7 +40,8 @@ export declare enum HighlightType {
40
40
  ReadAloud = 2,
41
41
  PageBreak = 3,
42
42
  Definition = 4,
43
- LineFocus = 5
43
+ LineFocus = 5,
44
+ Comment = 6
44
45
  }
45
46
  export interface IHighlight {
46
47
  id: string;
@@ -17,6 +17,10 @@ interface Annotator {
17
17
  getAnnotation(annotation: IHighlight): any;
18
18
  getAnnotationByID(id: string): any;
19
19
  getAnnotationPosition(id: any, iframeWin: any): any;
20
+ getAnnotationElement(id: any, iframeWin: any): any;
21
+ saveTemporarySelectionInfo(selectionInfo: any): any;
22
+ getTemporarySelectionInfo(doc: any): any;
23
+ deleteTemporarySelectionInfo(): any;
20
24
  }
21
25
  export declare enum AnnotationType {
22
26
  Bookmark = 0,
@@ -11,6 +11,7 @@ export default class LocalAnnotator implements Annotator {
11
11
  private static readonly LAST_READING_POSITION;
12
12
  private static readonly BOOKMARKS;
13
13
  private static readonly ANNOTATIONS;
14
+ private static readonly SELECTIONINFO;
14
15
  constructor(config: LocalAnnotatorConfig);
15
16
  getLastReadingPosition(): any;
16
17
  initLastReadingPosition(position: ReadingPosition): void;
@@ -21,11 +22,15 @@ export default class LocalAnnotator implements Annotator {
21
22
  deleteBookmark(bookmark: any): any;
22
23
  getBookmarks(href?: string): any;
23
24
  initAnnotations(list: any): any;
25
+ saveTemporarySelectionInfo(selectionInfo: any): void;
26
+ getTemporarySelectionInfo(doc: any): any;
27
+ deleteTemporarySelectionInfo(): void;
24
28
  saveAnnotation(annotation: any): any;
25
29
  deleteAnnotation(id: any): any;
26
30
  deleteSelectedAnnotation(annotation: any): any;
27
31
  getAnnotations(): any;
28
32
  getAnnotationPosition(id: any, iframeWin: any): any;
33
+ getAnnotationElement(id: any, iframeWin: any): any;
29
34
  getAnnotation(highlight: IHighlight): any;
30
35
  getAnnotationByID(id: string): any;
31
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-i-t-a/reader",
3
- "version": "2.1.0-beta.8",
3
+ "version": "2.1.0",
4
4
  "description": "A viewer application for EPUB files.",
5
5
  "repository": "https://github.com/d-i-t-a/R2D2BC",
6
6
  "license": "Apache-2.0",