@readium/navigator 2.11.1 → 2.12.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/divina/DivinaNavigator.js +1 -1
- package/dist/epub/EpubNavigator.js +1 -1
- package/dist/epub/frame/FramePoolManager.js +1 -1
- package/dist/index.js +1 -1
- package/dist/preferences/guards.js +1 -1
- package/dist/readaloud/GuidedNavigationProvider.js +1 -0
- package/dist/readaloud/ReadAloudNavigator.js +1 -0
- package/dist/readaloud/ReadingUnit.js +1 -0
- package/dist/readaloud/SpeechProgress.js +1 -0
- package/dist/readaloud/preferences/ReadAloudDefaults.js +1 -0
- package/dist/readaloud/preferences/ReadAloudPreferences.js +1 -0
- package/dist/readaloud/preferences/ReadAloudPreferencesEditor.js +1 -0
- package/dist/readaloud/preferences/ReadAloudSettings.js +1 -0
- package/dist/webpub/WebPubFrameManager.js +1 -1
- package/dist/webpub/WebPubFramePoolManager.js +1 -1
- package/dist/webpub/WebPubNavigator.js +1 -1
- package/package.json +8 -6
- package/src/divina/DivinaNavigator.ts +1 -0
- package/src/epub/EpubNavigator.ts +127 -21
- package/src/epub/frame/FramePoolManager.ts +5 -0
- package/src/index.ts +1 -0
- package/src/preferences/guards.ts +11 -0
- package/src/readaloud/GuidedNavigationProvider.ts +87 -0
- package/src/readaloud/ReadAloudNavigator.ts +949 -0
- package/src/readaloud/ReadingUnit.ts +154 -0
- package/src/readaloud/SpeechProgress.ts +60 -0
- package/src/readaloud/index.ts +17 -0
- package/src/readaloud/preferences/ReadAloudDefaults.ts +24 -0
- package/src/readaloud/preferences/ReadAloudPreferences.ts +104 -0
- package/src/readaloud/preferences/ReadAloudPreferencesEditor.ts +115 -0
- package/src/readaloud/preferences/ReadAloudSettings.ts +44 -0
- package/src/readaloud/preferences/index.ts +4 -0
- package/src/webpub/WebPubFrameManager.ts +4 -0
- package/src/webpub/WebPubFramePoolManager.ts +5 -0
- package/src/webpub/WebPubNavigator.ts +114 -10
- package/types/src/epub/EpubNavigator.d.ts +26 -1
- package/types/src/epub/frame/FramePoolManager.d.ts +2 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/preferences/guards.d.ts +1 -0
- package/types/src/readaloud/GuidedNavigationProvider.d.ts +28 -0
- package/types/src/readaloud/ReadAloudNavigator.d.ts +158 -0
- package/types/src/readaloud/ReadingUnit.d.ts +58 -0
- package/types/src/readaloud/SpeechProgress.d.ts +19 -0
- package/types/src/readaloud/index.d.ts +6 -0
- package/types/src/readaloud/preferences/ReadAloudDefaults.d.ts +11 -0
- package/types/src/readaloud/preferences/ReadAloudPreferences.d.ts +58 -0
- package/types/src/readaloud/preferences/ReadAloudPreferencesEditor.d.ts +37 -0
- package/types/src/readaloud/preferences/ReadAloudSettings.d.ts +26 -0
- package/types/src/readaloud/preferences/index.d.ts +4 -0
- package/types/src/webpub/WebPubFrameManager.d.ts +1 -0
- package/types/src/webpub/WebPubFramePoolManager.d.ts +2 -0
- package/types/src/webpub/WebPubNavigator.d.ts +25 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GndRole } from "@readium/guided-navigation";
|
|
2
|
+
import { ExtractionFormat, LanguageMode, Segmentation, SpeechSettings, VerbosityPreset } from "@readium/speech";
|
|
3
|
+
import { ConfigurableSettings } from "../../preferences/Configurable.ts";
|
|
4
|
+
import { ReadAloudDefaults } from "./ReadAloudDefaults.ts";
|
|
5
|
+
import { ReadAloudAutoPause, ReadAloudDecorationStyle, ReadAloudPreferences } from "./ReadAloudPreferences.ts";
|
|
6
|
+
export declare class ReadAloudSettings implements ConfigurableSettings {
|
|
7
|
+
format: ExtractionFormat;
|
|
8
|
+
inlineContextualization: boolean;
|
|
9
|
+
verbosity: VerbosityPreset;
|
|
10
|
+
skip: GndRole[];
|
|
11
|
+
contextualize: GndRole[];
|
|
12
|
+
language: LanguageMode;
|
|
13
|
+
segmentation: Segmentation;
|
|
14
|
+
pauseDuration: number;
|
|
15
|
+
autoPause: ReadAloudAutoPause;
|
|
16
|
+
speakInContentLanguage: boolean;
|
|
17
|
+
rate: number;
|
|
18
|
+
pitch: number;
|
|
19
|
+
volume: number;
|
|
20
|
+
utteranceStyle: ReadAloudDecorationStyle;
|
|
21
|
+
wordStyle: ReadAloudDecorationStyle;
|
|
22
|
+
/**
|
|
23
|
+
* @param speech The settings speech resolved for its own fields.
|
|
24
|
+
*/
|
|
25
|
+
constructor(speech: SpeechSettings, preferences: ReadAloudPreferences, defaults: ReadAloudDefaults);
|
|
26
|
+
}
|
|
@@ -28,5 +28,7 @@ export declare class WebPubFramePoolManager {
|
|
|
28
28
|
[key: string]: string;
|
|
29
29
|
}): void;
|
|
30
30
|
get currentFrames(): (WebPubFrameManager | undefined)[];
|
|
31
|
+
/** The pooled frame of `href`, whether or not it's shown. */
|
|
32
|
+
_frameFor(href: string): WebPubFrameManager | undefined;
|
|
31
33
|
get currentBounds(): DOMRect;
|
|
32
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Link, Locator, Publication, ReadingProgression, Timeline, TimelineItem } from "@readium/shared";
|
|
2
2
|
import { VisualNavigator, VisualNavigatorViewport, KeyboardPeripheralEventData } from "../Navigator.ts";
|
|
3
3
|
import { Configurable } from "../preferences/Configurable.ts";
|
|
4
|
-
import { BasicTextSelection, CommsEventKey, ContextMenuEvent, FrameClickEvent, SuspiciousActivityEvent } from "@readium/navigator-html-injectables";
|
|
4
|
+
import { BasicTextSelection, CommsEventKey, ContextMenuEvent, FrameClickEvent, SuspiciousActivityEvent, TextLayout } from "@readium/navigator-html-injectables";
|
|
5
5
|
import { WebPubFrameManager } from "./WebPubFrameManager.ts";
|
|
6
6
|
import { Decoration, DecorableNavigator, DecorationObserver, DecoratorConfig, DecorationStyleType } from "../decorations/index.ts";
|
|
7
7
|
import { ManagerEventKey } from "../epub/EpubNavigator.ts";
|
|
@@ -67,6 +67,11 @@ export declare class WebPubNavigator extends VisualNavigator implements Configur
|
|
|
67
67
|
private _decorationHoverState;
|
|
68
68
|
private _decorationActivationConsumed;
|
|
69
69
|
private _decorationResizeSelectors;
|
|
70
|
+
private _textLayoutWatch?;
|
|
71
|
+
private _textLayoutFrame?;
|
|
72
|
+
private _navigationLocked;
|
|
73
|
+
private readonly _pointedPieceRequests;
|
|
74
|
+
private _pointedPieceRequestId;
|
|
70
75
|
private webViewport;
|
|
71
76
|
constructor(container: HTMLElement, pub: Publication, listeners: WebPubNavigatorListeners, initialPosition?: Locator | undefined, configuration?: WebPubNavigatorConfiguration);
|
|
72
77
|
load(): Promise<void>;
|
|
@@ -83,7 +88,7 @@ export declare class WebPubNavigator extends VisualNavigator implements Configur
|
|
|
83
88
|
*/
|
|
84
89
|
get _cframes(): (WebPubFrameManager | undefined)[];
|
|
85
90
|
private get hasDisplayTransformability();
|
|
86
|
-
eventListener(key: CommsEventKey | ManagerEventKey, data: unknown): void;
|
|
91
|
+
eventListener(key: CommsEventKey | ManagerEventKey, data: unknown, sourceFrame?: WebPubFrameManager): void;
|
|
87
92
|
private determineModules;
|
|
88
93
|
private attachListener;
|
|
89
94
|
private apply;
|
|
@@ -98,6 +103,24 @@ export declare class WebPubNavigator extends VisualNavigator implements Configur
|
|
|
98
103
|
applyDecorations(decorations: Decoration[], group: string): void;
|
|
99
104
|
private _sendDecorationOps;
|
|
100
105
|
private _reapplyDecorationsToCurrentFrame;
|
|
106
|
+
/**
|
|
107
|
+
* Reports where the text of `locators`, all in one resource, starts each line along the scroll axis,
|
|
108
|
+
* with the viewport. Reported again whenever that resource is scrolled or laid out again.
|
|
109
|
+
* Replaces any previous watch, and returns a function that stops this one.
|
|
110
|
+
*/
|
|
111
|
+
watchTextLayout(locators: Locator[], cb: (layout: TextLayout) => void): () => void;
|
|
112
|
+
/**
|
|
113
|
+
* Locks or unlocks navigating in the content: scrolling and following its links.
|
|
114
|
+
* Calls to the navigator still move it.
|
|
115
|
+
*/
|
|
116
|
+
lockNavigation(locked: boolean): void;
|
|
117
|
+
private _sendNavigationLock;
|
|
118
|
+
/**
|
|
119
|
+
* Returns the first of `pieces` under the point of `event`, else the first containing the element it targets,
|
|
120
|
+
* in the resource of the frame it comes from. Undefined when none does.
|
|
121
|
+
*/
|
|
122
|
+
findPointedPiece(event: FrameClickEvent, pieces: Locator[]): Promise<Locator | undefined>;
|
|
123
|
+
private _watchTextLayoutInCurrentFrame;
|
|
101
124
|
private _handleDecorationActivated;
|
|
102
125
|
private _handleDecorationPointerEnter;
|
|
103
126
|
private _handleDecorationPointerLeave;
|