@d-i-t-a/reader 2.1.0-beta.2 → 2.1.0-beta.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/esm/index.js +42 -36
- package/dist/esm/index.js.map +2 -2
- package/dist/reader.js +29 -29
- package/dist/reader.js.map +2 -2
- package/dist/types/model/Publication.d.ts +4 -4
- package/dist/types/modules/protection/ContentProtectionModule.d.ts +1 -1
- package/dist/types/navigator/IFrameNavigator.d.ts +6 -2
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export declare class Publication extends R2Publication {
|
|
|
11
11
|
/**
|
|
12
12
|
* Initialize a publication from a manifest URL
|
|
13
13
|
*/
|
|
14
|
-
static fromUrl(url: URL): Promise<Publication>;
|
|
14
|
+
static fromUrl(url: URL, requestInit?: RequestInit): Promise<Publication>;
|
|
15
15
|
get readingOrder(): Link[];
|
|
16
16
|
get resources(): Link[];
|
|
17
17
|
get tableOfContents(): R2Link[];
|
|
@@ -39,13 +39,13 @@ export declare class Publication extends R2Publication {
|
|
|
39
39
|
* Fetches the contents to build up the positions manually,
|
|
40
40
|
* at least for fluid layout pubs
|
|
41
41
|
*/
|
|
42
|
-
autoGeneratePositions(getContentBytesLength?: GetContentBytesLength): Promise<void>;
|
|
42
|
+
autoGeneratePositions(requestInit?: RequestInit, getContentBytesLength?: GetContentBytesLength): Promise<void>;
|
|
43
43
|
/**
|
|
44
44
|
* Fetches the positions from a given service href
|
|
45
45
|
*/
|
|
46
|
-
fetchPositionsFromService(href: string): Promise<void>;
|
|
46
|
+
fetchPositionsFromService(href: string, requestInit?: RequestInit): Promise<void>;
|
|
47
47
|
/**
|
|
48
48
|
* Fetches weights from a given service href
|
|
49
49
|
*/
|
|
50
|
-
fetchWeightsFromService(href: string): Promise<void>;
|
|
50
|
+
fetchWeightsFromService(href: string, requestInit?: RequestInit): Promise<void>;
|
|
51
51
|
}
|
|
@@ -13,7 +13,7 @@ export interface ContentProtectionModuleProperties {
|
|
|
13
13
|
disableContextMenu: boolean;
|
|
14
14
|
hideTargetUrl: boolean;
|
|
15
15
|
disableDrag: boolean;
|
|
16
|
-
supportedBrowsers: [];
|
|
16
|
+
supportedBrowsers: string[];
|
|
17
17
|
}
|
|
18
18
|
export interface ContentProtectionModuleConfig extends Partial<ContentProtectionModuleProperties> {
|
|
19
19
|
delegate: IFrameNavigator;
|
|
@@ -22,7 +22,7 @@ import LineFocusModule, { LineFocusModuleConfig } from "../modules/linefocus/Lin
|
|
|
22
22
|
import { HistoryModule } from "../modules/history/HistoryModule";
|
|
23
23
|
import CitationModule, { CitationModuleConfig } from "../modules/citation/CitationModule";
|
|
24
24
|
export declare type GetContent = (href: string) => Promise<string>;
|
|
25
|
-
export declare type GetContentBytesLength = (href: string) => Promise<number>;
|
|
25
|
+
export declare type GetContentBytesLength = (href: string, requestInit?: RequestInit) => Promise<number>;
|
|
26
26
|
export interface NavigatorAPI {
|
|
27
27
|
updateSettings: any;
|
|
28
28
|
getContent: GetContent;
|
|
@@ -63,6 +63,7 @@ export interface IFrameNavigatorConfig {
|
|
|
63
63
|
attributes?: IFrameAttributes;
|
|
64
64
|
services?: PublicationServices;
|
|
65
65
|
sample?: SampleRead;
|
|
66
|
+
requestInit?: RequestInit;
|
|
66
67
|
}
|
|
67
68
|
export interface PublicationServices {
|
|
68
69
|
positions?: URL;
|
|
@@ -105,6 +106,7 @@ export interface ReaderUI {
|
|
|
105
106
|
settings: UserSettingsUIConfig;
|
|
106
107
|
}
|
|
107
108
|
export interface ReaderConfig {
|
|
109
|
+
publication?: any;
|
|
108
110
|
url: URL;
|
|
109
111
|
userSettings?: any;
|
|
110
112
|
initialAnnotations?: any;
|
|
@@ -130,6 +132,7 @@ export interface ReaderConfig {
|
|
|
130
132
|
attributes?: IFrameAttributes;
|
|
131
133
|
services?: PublicationServices;
|
|
132
134
|
sample?: SampleRead;
|
|
135
|
+
requestInit?: RequestInit;
|
|
133
136
|
}
|
|
134
137
|
/** Class that shows webpub resources in an iframe, with navigation controls outside the iframe. */
|
|
135
138
|
export declare class IFrameNavigator extends EventEmitter implements Navigator {
|
|
@@ -207,9 +210,10 @@ export declare class IFrameNavigator extends EventEmitter implements Navigator {
|
|
|
207
210
|
attributes?: IFrameAttributes;
|
|
208
211
|
services?: PublicationServices;
|
|
209
212
|
sample?: SampleRead;
|
|
213
|
+
requestInit?: RequestInit;
|
|
210
214
|
private didInitKeyboardEventHandler;
|
|
211
215
|
static create(config: IFrameNavigatorConfig): Promise<IFrameNavigator>;
|
|
212
|
-
protected constructor(settings: UserSettings, annotator: Annotator | undefined, upLinkConfig: UpLinkConfig | undefined, initialLastReadingPosition: ReadingPosition | undefined, publication: Publication, material: any, api?: NavigatorAPI, rights?: ReaderRights, tts?: TTSModuleConfig, injectables?: Array<Injectable>, attributes?: IFrameAttributes, services?: PublicationServices, sample?: SampleRead);
|
|
216
|
+
protected constructor(settings: UserSettings, annotator: Annotator | undefined, upLinkConfig: UpLinkConfig | undefined, initialLastReadingPosition: ReadingPosition | undefined, publication: Publication, material: any, api?: NavigatorAPI, rights?: ReaderRights, tts?: TTSModuleConfig, injectables?: Array<Injectable>, attributes?: IFrameAttributes, services?: PublicationServices, sample?: SampleRead, requestInit?: RequestInit);
|
|
213
217
|
stop(): void;
|
|
214
218
|
spreads: HTMLDivElement;
|
|
215
219
|
firstSpread: HTMLDivElement;
|