@readium/navigator 2.1.0 → 2.2.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/index.js +3082 -2649
- package/dist/index.umd.cjs +86 -36
- package/package.json +8 -8
- package/src/epub/css/Properties.ts +1 -5
- package/src/epub/css/ReadiumCSS.ts +0 -1
- package/src/epub/preferences/EpubDefaults.ts +1 -5
- package/src/epub/preferences/EpubPreferences.ts +0 -4
- package/src/epub/preferences/EpubPreferencesEditor.ts +1 -14
- package/src/epub/preferences/EpubSettings.ts +1 -4
- package/src/index.ts +1 -0
- package/src/preferences/Types.ts +0 -6
- package/src/webpub/WebPubBlobBuilder.ts +145 -0
- package/src/webpub/WebPubFrameManager.ts +140 -0
- package/src/webpub/WebPubFramePoolManager.ts +174 -0
- package/src/webpub/WebPubNavigator.ts +417 -0
- package/src/webpub/index.ts +4 -0
- package/types/src/epub/css/Properties.d.ts +1 -3
- package/types/src/epub/preferences/EpubDefaults.d.ts +1 -3
- package/types/src/epub/preferences/EpubPreferences.d.ts +1 -3
- package/types/src/epub/preferences/EpubPreferencesEditor.d.ts +1 -2
- package/types/src/epub/preferences/EpubSettings.d.ts +1 -3
- package/types/src/index.d.ts +1 -0
- package/types/src/preferences/Types.d.ts +0 -5
- package/types/src/web/WebPubBlobBuilder.d.ts +10 -0
- package/types/src/web/WebPubFrameManager.d.ts +20 -0
- package/types/src/web/WebPubNavigator.d.ts +48 -0
- package/types/src/web/index.d.ts +3 -0
- package/types/src/webpub/WebPubBlobBuilder.d.ts +12 -0
- package/types/src/webpub/WebPubFrameManager.d.ts +20 -0
- package/types/src/webpub/WebPubFramePoolManager.d.ts +16 -0
- package/types/src/webpub/WebPubNavigator.d.ts +50 -0
- package/types/src/webpub/index.d.ts +4 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigurableSettings } from "../../preferences/Configurable";
|
|
2
|
-
import { TextAlignment
|
|
2
|
+
import { TextAlignment } from "../../preferences/Types";
|
|
3
3
|
import { EpubDefaults } from "./EpubDefaults";
|
|
4
4
|
import { EpubPreferences } from "./EpubPreferences";
|
|
5
5
|
export interface IEpubSettings {
|
|
@@ -39,7 +39,6 @@ export interface IEpubSettings {
|
|
|
39
39
|
textAlign?: TextAlignment | null;
|
|
40
40
|
textColor?: string | null;
|
|
41
41
|
textNormalization?: boolean | null;
|
|
42
|
-
theme?: Theme | null;
|
|
43
42
|
visitedColor?: string | null;
|
|
44
43
|
wordSpacing?: number | null;
|
|
45
44
|
}
|
|
@@ -80,7 +79,6 @@ export declare class EpubSettings implements ConfigurableSettings {
|
|
|
80
79
|
textAlign: TextAlignment | null;
|
|
81
80
|
textColor: string | null;
|
|
82
81
|
textNormalization: boolean | null;
|
|
83
|
-
theme: Theme | null;
|
|
84
82
|
visitedColor: string | null;
|
|
85
83
|
wordSpacing: number | null;
|
|
86
84
|
constructor(preferences: EpubPreferences, defaults: EpubDefaults);
|
package/types/src/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Link, Publication } from "@readium/shared";
|
|
2
|
+
export declare class WebPubBlobBuilder {
|
|
3
|
+
private readonly item;
|
|
4
|
+
private readonly publication;
|
|
5
|
+
constructor(publication: Publication, item: Link);
|
|
6
|
+
build(): Promise<string>;
|
|
7
|
+
private buildHtmlFrame;
|
|
8
|
+
private serializeAsHTML;
|
|
9
|
+
private hasExecutable;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Loader } from "../../../navigator-html-injectables/src/Loader";
|
|
2
|
+
import { FrameComms } from "../../../navigator/src/epub/frame/FrameComms";
|
|
3
|
+
export declare class WebPubFrameManager {
|
|
4
|
+
private frame;
|
|
5
|
+
private loader;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
private comms;
|
|
8
|
+
private destroyed;
|
|
9
|
+
private currModules;
|
|
10
|
+
constructor(source: string);
|
|
11
|
+
load(modules?: string[]): Promise<Window>;
|
|
12
|
+
destroy(): Promise<void>;
|
|
13
|
+
get iframe(): HTMLIFrameElement;
|
|
14
|
+
get realSize(): DOMRect;
|
|
15
|
+
get window(): Window;
|
|
16
|
+
get atLeft(): boolean;
|
|
17
|
+
get atRight(): boolean;
|
|
18
|
+
get msg(): FrameComms | undefined;
|
|
19
|
+
get ldr(): Loader<import("../../../navigator-html-injectables/src/modules/ModuleLibrary").ModuleName> | undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Link, Locator, Publication, ReadingProgression } from "@readium/shared";
|
|
2
|
+
import { VisualNavigator, VisualNavigatorViewport } from "../Navigator";
|
|
3
|
+
import { BasicTextSelection, FrameClickEvent } from '@readium/navigator-html-injectables';
|
|
4
|
+
export interface WebPubNavigatorListeners {
|
|
5
|
+
frameLoaded: (wnd: Window) => void;
|
|
6
|
+
positionChanged: (locator: Locator) => void;
|
|
7
|
+
tap?: (e: FrameClickEvent) => boolean;
|
|
8
|
+
click?: (e: FrameClickEvent) => boolean;
|
|
9
|
+
zoom?: (scale: number) => void;
|
|
10
|
+
scroll?: (delta: number) => void;
|
|
11
|
+
customEvent?: (key: string, data: unknown) => void;
|
|
12
|
+
handleLocator?: (locator: Locator) => boolean;
|
|
13
|
+
textSelected?: (selection: BasicTextSelection) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class WebPubNavigator extends VisualNavigator {
|
|
16
|
+
private readonly pub;
|
|
17
|
+
private readonly container;
|
|
18
|
+
private readonly listeners;
|
|
19
|
+
private frameManager;
|
|
20
|
+
private currentIndex;
|
|
21
|
+
private currentLocation;
|
|
22
|
+
private currentBlobUrl;
|
|
23
|
+
private webViewport;
|
|
24
|
+
constructor(container: HTMLElement, pub: Publication, listeners?: Partial<WebPubNavigatorListeners>, initialPosition?: Locator | undefined);
|
|
25
|
+
load(): Promise<void>;
|
|
26
|
+
private eventListener;
|
|
27
|
+
private attachListener;
|
|
28
|
+
private apply;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private changeResource;
|
|
31
|
+
private updateViewport;
|
|
32
|
+
private syncLocation;
|
|
33
|
+
goBackward(_animated: boolean, cb: (ok: boolean) => void): void;
|
|
34
|
+
goForward(_animated: boolean, cb: (ok: boolean) => void): void;
|
|
35
|
+
get currentLocator(): Locator;
|
|
36
|
+
get viewport(): VisualNavigatorViewport;
|
|
37
|
+
get isScrollStart(): boolean;
|
|
38
|
+
get isScrollEnd(): boolean;
|
|
39
|
+
get canGoBackward(): boolean;
|
|
40
|
+
get canGoForward(): boolean;
|
|
41
|
+
get readingProgression(): ReadingProgression;
|
|
42
|
+
get publication(): Publication;
|
|
43
|
+
private loadLocator;
|
|
44
|
+
go(locator: Locator, _animated: boolean, cb: (ok: boolean) => void): void;
|
|
45
|
+
goLink(link: Link, _animated: boolean, cb: (ok: boolean) => void): void;
|
|
46
|
+
private frameUpdate;
|
|
47
|
+
private createCurrentLocator;
|
|
48
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Link, Publication } from "@readium/shared";
|
|
2
|
+
export declare class WebPubBlobBuilder {
|
|
3
|
+
private readonly item;
|
|
4
|
+
private readonly burl;
|
|
5
|
+
private readonly pub;
|
|
6
|
+
constructor(pub: Publication, baseURL: string, item: Link);
|
|
7
|
+
build(): Promise<string>;
|
|
8
|
+
private buildHtmlFrame;
|
|
9
|
+
private hasExecutable;
|
|
10
|
+
private finalizeDOM;
|
|
11
|
+
private serializeAsHTML;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Loader, ModuleName } from "@readium/navigator-html-injectables";
|
|
2
|
+
import { FrameComms } from "../epub/frame/FrameComms";
|
|
3
|
+
export declare class WebPubFrameManager {
|
|
4
|
+
private frame;
|
|
5
|
+
private loader;
|
|
6
|
+
readonly source: string;
|
|
7
|
+
private comms;
|
|
8
|
+
private destroyed;
|
|
9
|
+
private currModules;
|
|
10
|
+
constructor(source: string);
|
|
11
|
+
load(modules?: ModuleName[]): Promise<Window>;
|
|
12
|
+
destroy(): Promise<void>;
|
|
13
|
+
hide(): Promise<void>;
|
|
14
|
+
show(atProgress?: number): Promise<void>;
|
|
15
|
+
get iframe(): HTMLIFrameElement;
|
|
16
|
+
get realSize(): DOMRect;
|
|
17
|
+
get window(): Window;
|
|
18
|
+
get msg(): FrameComms | undefined;
|
|
19
|
+
get ldr(): Loader<ModuleName> | undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ModuleName } from "@readium/navigator-html-injectables";
|
|
2
|
+
import { Locator, Publication } from "@readium/shared";
|
|
3
|
+
import { WebPubFrameManager } from "./WebPubFrameManager";
|
|
4
|
+
export declare class WebPubFramePoolManager {
|
|
5
|
+
private readonly container;
|
|
6
|
+
private _currentFrame;
|
|
7
|
+
private readonly pool;
|
|
8
|
+
private readonly blobs;
|
|
9
|
+
private readonly inprogress;
|
|
10
|
+
private currentBaseURL;
|
|
11
|
+
constructor(container: HTMLElement);
|
|
12
|
+
destroy(): Promise<void>;
|
|
13
|
+
update(pub: Publication, locator: Locator, modules: ModuleName[]): Promise<void>;
|
|
14
|
+
get currentFrames(): (WebPubFrameManager | undefined)[];
|
|
15
|
+
get currentBounds(): DOMRect;
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Link, Locator, Publication, ReadingProgression } from "@readium/shared";
|
|
2
|
+
import { VisualNavigator, VisualNavigatorViewport } from "../Navigator";
|
|
3
|
+
import { BasicTextSelection, CommsEventKey, FrameClickEvent } from "@readium/navigator-html-injectables";
|
|
4
|
+
import { ManagerEventKey } from "../epub/EpubNavigator";
|
|
5
|
+
export interface WebPubNavigatorListeners {
|
|
6
|
+
frameLoaded: (wnd: Window) => void;
|
|
7
|
+
positionChanged: (locator: Locator) => void;
|
|
8
|
+
tap: (e: FrameClickEvent) => boolean;
|
|
9
|
+
click: (e: FrameClickEvent) => boolean;
|
|
10
|
+
zoom: (scale: number) => void;
|
|
11
|
+
scroll: (delta: number) => void;
|
|
12
|
+
customEvent: (key: string, data: unknown) => void;
|
|
13
|
+
handleLocator: (locator: Locator) => boolean;
|
|
14
|
+
textSelected: (selection: BasicTextSelection) => void;
|
|
15
|
+
}
|
|
16
|
+
declare class WebPubNavigator extends VisualNavigator {
|
|
17
|
+
private readonly pub;
|
|
18
|
+
private readonly container;
|
|
19
|
+
private readonly listeners;
|
|
20
|
+
private framePool;
|
|
21
|
+
private currentIndex;
|
|
22
|
+
private currentLocation;
|
|
23
|
+
private webViewport;
|
|
24
|
+
constructor(container: HTMLElement, pub: Publication, listeners: WebPubNavigatorListeners, initialPosition?: Locator | undefined);
|
|
25
|
+
load(): Promise<void>;
|
|
26
|
+
eventListener(key: CommsEventKey | ManagerEventKey, data: unknown): void;
|
|
27
|
+
private determineModules;
|
|
28
|
+
private attachListener;
|
|
29
|
+
private apply;
|
|
30
|
+
destroy(): Promise<void>;
|
|
31
|
+
private changeResource;
|
|
32
|
+
private updateViewport;
|
|
33
|
+
private syncLocation;
|
|
34
|
+
goBackward(_animated: boolean, cb: (ok: boolean) => void): void;
|
|
35
|
+
goForward(_animated: boolean, cb: (ok: boolean) => void): void;
|
|
36
|
+
get currentLocator(): Locator;
|
|
37
|
+
get viewport(): VisualNavigatorViewport;
|
|
38
|
+
get isScrollStart(): boolean;
|
|
39
|
+
get isScrollEnd(): boolean;
|
|
40
|
+
get canGoBackward(): boolean;
|
|
41
|
+
get canGoForward(): boolean;
|
|
42
|
+
get readingProgression(): ReadingProgression;
|
|
43
|
+
get publication(): Publication;
|
|
44
|
+
private loadLocator;
|
|
45
|
+
go(locator: Locator, _: boolean, cb: (ok: boolean) => void): void;
|
|
46
|
+
goLink(link: Link, animated: boolean, cb: (ok: boolean) => void): void;
|
|
47
|
+
private createCurrentLocator;
|
|
48
|
+
}
|
|
49
|
+
export declare const ExperimentalWebPubNavigator: typeof WebPubNavigator;
|
|
50
|
+
export {};
|