@d-i-t-a/reader 1.12.0-alpha.2 → 1.12.0-alpha.3

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/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export declare function totalResources(): number;
32
32
  export declare function publicationLanguage(): string[];
33
33
  export declare function resetUserSettings(): Promise<void>;
34
34
  export declare function applyUserSettings(userSettings: any): Promise<void>;
35
+ export declare function applyLineFocusSettings(userSettings: any): Promise<void>;
35
36
  export declare function currentSettings(): Promise<{
36
37
  appearance: string;
37
38
  fontFamily: string;
@@ -66,7 +67,16 @@ export declare function goToPosition(value: any): void;
66
67
  export declare function applyAttributes(value: any): void;
67
68
  export declare function hideAnnotationLayer(): void;
68
69
  export declare function showAnnotationLayer(): void;
70
+ export declare function lineUp(): void;
71
+ export declare function lineDown(): void;
72
+ export declare function hideLayer(layer: any): void;
73
+ export declare function showLayer(layer: any): void;
74
+ export declare function clearDefinitions(): Promise<void>;
75
+ export declare function addDefinition(definition: any): Promise<void>;
69
76
  export declare function snapToElement(value: any): void;
70
77
  export declare function activateMarker(id: any, position: any): void;
71
78
  export declare function deactivateMarker(): void;
79
+ export declare function enableLineFocus(): Promise<void>;
80
+ export declare function lineFocus(active: boolean): Promise<void>;
81
+ export declare function disableLineFocus(): void;
72
82
  export declare function load(config: ReaderConfig): Promise<any>;
@@ -8,6 +8,7 @@ export declare const ID_READALOUD_CONTAINER = "R2_ID_READALOUD_CONTAINER";
8
8
  export declare const ID_PAGEBREAK_CONTAINER = "R2_ID_PAGEBREAK_CONTAINER";
9
9
  export declare const ID_SEARCH_CONTAINER = "R2_ID_SEARCH_CONTAINER";
10
10
  export declare const ID_POPUP_CONTAINER = "R2_ID_POPUP_CONTAINER";
11
+ export declare const ID_LINEFOCUS_CONTAINER = "R2_ID_LINEFOCUS_CONTAINER";
11
12
  export declare const CLASS_HIGHLIGHT_CONTAINER = "R2_CLASS_HIGHLIGHT_CONTAINER";
12
13
  export declare const CLASS_HIGHLIGHT_AREA = "R2_CLASS_HIGHLIGHT_AREA";
13
14
  export declare const CLASS_HIGHLIGHT_ICON = "R2_CLASS_HIGHLIGHT_ICON";
@@ -39,7 +39,8 @@ export declare enum HighlightType {
39
39
  Search = 1,
40
40
  ReadAloud = 2,
41
41
  PageBreak = 3,
42
- Popup = 4
42
+ Popup = 4,
43
+ Lines = 5
43
44
  }
44
45
  export interface IHighlight {
45
46
  id: string;
@@ -6,9 +6,7 @@ export interface LineFocusModuleAPI {
6
6
  }
7
7
  export interface LineFocusModuleProperties {
8
8
  api?: LineFocusModuleAPI;
9
- factor: number;
10
- startIndex: number;
11
- currentIndex: number;
9
+ lines: number;
12
10
  }
13
11
  export interface LineFocusModuleConfig extends LineFocusModuleProperties {
14
12
  api: LineFocusModuleAPI;
@@ -25,12 +23,15 @@ export default class LineFocusModule implements ReaderModule {
25
23
  index: number;
26
24
  isActive: boolean;
27
25
  isDebug: boolean;
26
+ lineFocusContainer: HTMLElement;
27
+ lineFocusTopBlinder: HTMLElement;
28
+ lineFocusBottomBlinder: HTMLElement;
28
29
  static create(config: LineFocusModuleConfig): Promise<LineFocusModule>;
29
30
  private constructor();
30
31
  stop(): Promise<void>;
31
32
  protected start(): Promise<void>;
32
33
  handleResize(): void;
33
- enableLineFocus(): void;
34
+ enableLineFocus(): Promise<void>;
34
35
  disableLineFocus(): void;
35
36
  lineFocus(): void;
36
37
  currentLine(): void;
@@ -18,6 +18,7 @@ export interface Definition {
18
18
  export interface DefinitionsModuleProperties {
19
19
  definitions: Definition[];
20
20
  color?: string;
21
+ fullWordSearch?: boolean;
21
22
  api?: DefinitionsModuleAPI;
22
23
  }
23
24
  export interface DefinitionsModuleConfig extends DefinitionsModuleProperties {
@@ -46,4 +47,6 @@ export default class DefinitionsModule implements ReaderModule {
46
47
  drawDefinitions(): void;
47
48
  handleResize(): Promise<void>;
48
49
  createPopupHighlight(selectionInfo: ISelectionInfo, item: Definition): IHighlight;
50
+ addDefinition(definition: any): Promise<void>;
51
+ clearDefinitions(): Promise<void>;
49
52
  }
@@ -11,4 +11,4 @@ export interface ISearchResult {
11
11
  }
12
12
  export declare function escapeRegExp(str: string): string;
13
13
  export declare const reset: () => void;
14
- export declare function searchDocDomSeek(searchInput: string, doc: Document, href: string, title: string): Promise<ISearchResult[]>;
14
+ export declare function searchDocDomSeek(searchInput: string, doc: Document, href: string, title: string, fullWordSearch?: boolean): Promise<ISearchResult[]>;
@@ -16,6 +16,7 @@ import ReaderModule from "../modules/ReaderModule";
16
16
  import { TTSModuleConfig } from "../modules/TTS/TTSSettings";
17
17
  import PageBreakModule from "../modules/pagebreak/PageBreakModule";
18
18
  import DefinitionsModule, { DefinitionsModuleConfig } from "../modules/search/DefinitionsModule";
19
+ import LineFocusModule, { LineFocusModuleConfig } from "../modules/linefocus/LineFocusModule";
19
20
  export declare type GetContent = (href: string) => Promise<string>;
20
21
  export declare type GetContentBytesLength = (href: string) => Promise<number>;
21
22
  export interface NavigatorAPI {
@@ -85,6 +86,7 @@ export interface ReaderRights {
85
86
  enableTTS?: boolean;
86
87
  enableSearch?: boolean;
87
88
  enableDefinitions?: boolean;
89
+ enableLineFocus?: boolean;
88
90
  enableContentProtection?: boolean;
89
91
  enableMaterial?: boolean;
90
92
  enableTimeline?: boolean;
@@ -106,6 +108,7 @@ export interface ReaderConfig {
106
108
  tts?: TTSModuleConfig;
107
109
  search?: SearchModuleConfig;
108
110
  define?: DefinitionsModuleConfig;
111
+ lineFocus?: LineFocusModuleConfig;
109
112
  protection?: ContentProtectionModuleConfig;
110
113
  mediaOverlays?: MediaOverlayModuleConfig;
111
114
  annotations?: AnnotationModuleConfig;
@@ -130,6 +133,7 @@ export default class IFrameNavigator implements Navigator {
130
133
  ttsModule?: ReaderModule;
131
134
  searchModule?: SearchModule;
132
135
  definitionsModule?: DefinitionsModule;
136
+ lineFocusModule?: LineFocusModule;
133
137
  contentProtectionModule?: ContentProtectionModule;
134
138
  highlighter?: TextHighlighter;
135
139
  timelineModule?: TimelineModule;
@@ -280,4 +284,6 @@ export default class IFrameNavigator implements Navigator {
280
284
  private static createJavascriptLink;
281
285
  activateMarker(id: any, position: any): void;
282
286
  deactivateMarker(): void;
287
+ showLayer(layer: any): void;
288
+ hideLayer(layer: any): void;
283
289
  }