@d-i-t-a/reader 2.3.13 → 2.3.15
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 +39878 -32250
- package/dist/esm/index.js.map +4 -4
- package/dist/injectables/click/click.js +373 -157
- package/dist/injectables/click/click.js.map +4 -4
- package/dist/reader.css +1 -1
- package/dist/reader.css.map +1 -1
- package/dist/reader.js +123 -62993
- package/dist/reader.js.map +4 -4
- package/dist/types/model/user-settings/UserProperties.d.ts +1 -1
- package/dist/types/modules/AnnotationModule.d.ts +1 -1
- package/dist/types/modules/TTS/TTSSettings.d.ts +1 -1
- package/dist/types/modules/mediaoverlays/MediaOverlaySettings.d.ts +1 -1
- package/dist/types/modules/protection/ContentProtectionModule.d.ts +1 -0
- package/dist/types/navigator/IFrameNavigator.d.ts +2 -2
- package/dist/types/reader.d.ts +1 -1
- package/dist/types/utils/JsonUtil.d.ts +3 -3
- package/package.json +39 -38
|
@@ -20,7 +20,7 @@ export declare class Enumerable extends UserProperty {
|
|
|
20
20
|
constructor(value: any, values: Array<any>, ref: string, name: string);
|
|
21
21
|
toString(): string;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type UserSettingsIncrementable = "fontSize" | "letterSpacing" | "lineHeight" | "wordSpacing";
|
|
24
24
|
export declare class Incremental extends UserProperty {
|
|
25
25
|
value: number;
|
|
26
26
|
min: number;
|
|
@@ -5,7 +5,7 @@ import { TextHighlighter } from "./highlight/TextHighlighter";
|
|
|
5
5
|
import { ReaderModule } from "./ReaderModule";
|
|
6
6
|
import { IHighlight } from "./highlight/common/highlight";
|
|
7
7
|
import { Annotation } from "../model/Locator";
|
|
8
|
-
export
|
|
8
|
+
export type Highlight = (highlight: Annotation) => Promise<Annotation>;
|
|
9
9
|
export interface AnnotationModuleAPI {
|
|
10
10
|
addAnnotation: Highlight;
|
|
11
11
|
deleteAnnotation: Highlight;
|
|
@@ -60,7 +60,7 @@ export interface ITTSUserSettings {
|
|
|
60
60
|
volume?: number;
|
|
61
61
|
voice?: TTSVoice;
|
|
62
62
|
}
|
|
63
|
-
export
|
|
63
|
+
export type TTSIncrementable = "pitch" | "rate" | "volume";
|
|
64
64
|
export declare class TTSSettings implements ITTSUserSettings {
|
|
65
65
|
private readonly store;
|
|
66
66
|
private readonly TTSSETTINGS;
|
|
@@ -29,7 +29,7 @@ export interface IMediaOverlayUserSettings {
|
|
|
29
29
|
playing?: boolean;
|
|
30
30
|
wait?: number;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type MediaOverlayIncrementable = "mo_volume" | "mo_rate";
|
|
33
33
|
export declare class MediaOverlaySettings implements IMediaOverlayUserSettings {
|
|
34
34
|
private readonly store;
|
|
35
35
|
private readonly MEDIAOVERLAYSETTINGS;
|
|
@@ -16,6 +16,7 @@ export interface ContentProtectionModuleProperties {
|
|
|
16
16
|
hideTargetUrl: boolean;
|
|
17
17
|
disableDrag: boolean;
|
|
18
18
|
supportedBrowsers: string[];
|
|
19
|
+
excludeNodes: string[];
|
|
19
20
|
}
|
|
20
21
|
export interface ContentProtectionModuleConfig extends Partial<ContentProtectionModuleProperties> {
|
|
21
22
|
api?: ContentProtectionModuleAPI;
|
|
@@ -21,8 +21,8 @@ import LineFocusModule, { LineFocusModuleConfig } from "../modules/linefocus/Lin
|
|
|
21
21
|
import { HistoryModule } from "../modules/history/HistoryModule";
|
|
22
22
|
import CitationModule, { CitationModuleConfig } from "../modules/citation/CitationModule";
|
|
23
23
|
import { ConsumptionModule, ConsumptionModuleConfig } from "../modules/consumption/ConsumptionModule";
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type GetContent = (href: string) => Promise<string>;
|
|
25
|
+
export type GetContentBytesLength = (href: string, requestConfig?: RequestConfig) => Promise<number>;
|
|
26
26
|
export interface RequestConfig extends RequestInit {
|
|
27
27
|
encoded?: boolean;
|
|
28
28
|
}
|
package/dist/types/reader.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export default class D2Reader {
|
|
|
145
145
|
};
|
|
146
146
|
resetUserSettings: () => Promise<void>;
|
|
147
147
|
applyUserSettings: (userSettings: Partial<UserSettings>) => Promise<void>;
|
|
148
|
-
scroll: (value: boolean, direction?: string
|
|
148
|
+
scroll: (value: boolean, direction?: string) => Promise<void>;
|
|
149
149
|
private isTTSIncrementable;
|
|
150
150
|
private isMOIncrementable;
|
|
151
151
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export interface IStringMap {
|
|
2
2
|
[key: string]: string;
|
|
3
3
|
}
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type AnyJson = JsonPrimitives | JsonArray | JsonMap;
|
|
5
|
+
export type JsonPrimitives = string | number | boolean | null;
|
|
6
6
|
export interface JsonMap {
|
|
7
7
|
[key: string]: AnyJson;
|
|
8
8
|
}
|
|
9
9
|
export interface JsonArray extends Array<AnyJson> {
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
type TConstructor<T> = new (value?: any) => T;
|
|
12
12
|
export declare function TaJsonDeserialize<T>(json: any, type: TConstructor<T>): T;
|
|
13
13
|
export declare function TaJsonSerialize<T>(obj: T): JsonMap;
|
|
14
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-i-t-a/reader",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.15",
|
|
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",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
8
8
|
"typings": "dist/types/index.d.ts",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": "
|
|
10
|
+
"node": ">=14"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,24 +24,25 @@
|
|
|
24
24
|
"example:react": "parcel examples/react/index.html --dist-dir parcel-dist"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
27
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
28
28
|
"@types/pdfjs-dist": "^2.7.4",
|
|
29
|
-
"
|
|
29
|
+
"@types/sass": "^1.43.1",
|
|
30
|
+
"browserslist-useragent": "^4.0.0",
|
|
30
31
|
"cssesc": "^3.0.0",
|
|
31
32
|
"detect-browser": "^5.2.0",
|
|
32
33
|
"devtools-detector": "^2.0.14",
|
|
33
|
-
"eventemitter3": "^
|
|
34
|
+
"eventemitter3": "^5.0.1",
|
|
34
35
|
"jscrypto": "^1.0.3",
|
|
35
36
|
"lodash.clonedeep": "^4.5.0",
|
|
36
37
|
"loglevel": "^1.8.0",
|
|
37
38
|
"mark.js": "^8.11.1",
|
|
38
|
-
"pdfjs-dist": "
|
|
39
|
+
"pdfjs-dist": "3.10.111",
|
|
39
40
|
"promise-polyfill": "^8.2.0",
|
|
40
41
|
"r2-shared-js": "^1.0.51",
|
|
41
42
|
"recursive-readdir": "^2.2.2",
|
|
42
43
|
"sanitize-html": "^2.3.3",
|
|
43
44
|
"sass": "^1.54.4",
|
|
44
|
-
"sentence-splitter": "^
|
|
45
|
+
"sentence-splitter": "^4.2.1",
|
|
45
46
|
"util": "^0.12.4",
|
|
46
47
|
"whatwg-fetch": "^3.6.2"
|
|
47
48
|
},
|
|
@@ -67,21 +68,21 @@
|
|
|
67
68
|
"@types/express": "^4.17.12",
|
|
68
69
|
"@types/jquery": "^3.5.5",
|
|
69
70
|
"@types/mark.js": "^8.11.5",
|
|
70
|
-
"@types/mocha": "^
|
|
71
|
-
"@types/pako": "^
|
|
72
|
-
"@types/parse5": "^
|
|
71
|
+
"@types/mocha": "^10.0.1",
|
|
72
|
+
"@types/pako": "^2.0.0",
|
|
73
|
+
"@types/parse5": "^7.0.0",
|
|
73
74
|
"@types/promise-polyfill": "^6.0.3",
|
|
74
|
-
"@types/react": "^
|
|
75
|
-
"@types/react-dom": "^
|
|
76
|
-
"@types/rimraf": "^3.0.
|
|
77
|
-
"@types/sanitize-html": "^
|
|
78
|
-
"@types/uuid": "^
|
|
79
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
80
|
-
"@typescript-eslint/parser": "^
|
|
75
|
+
"@types/react": "^18.2.22",
|
|
76
|
+
"@types/react-dom": "^18.2.7",
|
|
77
|
+
"@types/rimraf": "^3.0.2",
|
|
78
|
+
"@types/sanitize-html": "^2.9.0",
|
|
79
|
+
"@types/uuid": "^9.0.4",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
81
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
81
82
|
"ansi-regex": ">=5.0.1",
|
|
82
83
|
"babel-eslint": "^10.1.0",
|
|
83
84
|
"braces": ">=3.0.2",
|
|
84
|
-
"browserslist-useragent-regexp": "^
|
|
85
|
+
"browserslist-useragent-regexp": "^4.1.0",
|
|
85
86
|
"buffer": "^6.0.3",
|
|
86
87
|
"chai": "^4.3.4",
|
|
87
88
|
"chalk": "^4.1.2",
|
|
@@ -90,20 +91,20 @@
|
|
|
90
91
|
"debounce": "^1.2.1",
|
|
91
92
|
"dita-streamer-js": "^1.1.3",
|
|
92
93
|
"ecstatic": "^4.1.4",
|
|
93
|
-
"esbuild": "^0.
|
|
94
|
-
"eslint": "^
|
|
95
|
-
"eslint-config-prettier": "^
|
|
96
|
-
"eslint-config-react-app": "^
|
|
97
|
-
"eslint-plugin-flowtype": "^
|
|
98
|
-
"eslint-plugin-import": "^2.
|
|
94
|
+
"esbuild": "^0.19.3",
|
|
95
|
+
"eslint": "^8.49.0",
|
|
96
|
+
"eslint-config-prettier": "^9.0.0",
|
|
97
|
+
"eslint-config-react-app": "^7.0.1",
|
|
98
|
+
"eslint-plugin-flowtype": "^8.0.3",
|
|
99
|
+
"eslint-plugin-import": "^2.28.1",
|
|
99
100
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
100
|
-
"eslint-plugin-prettier": "^
|
|
101
|
-
"eslint-plugin-react": "^7.
|
|
102
|
-
"eslint-plugin-react-hooks": "^4.
|
|
101
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
102
|
+
"eslint-plugin-react": "^7.33.2",
|
|
103
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
103
104
|
"express": "^4.17.1",
|
|
104
105
|
"json-schema": ">=0.4.0",
|
|
105
106
|
"minimist": "^1.2.6",
|
|
106
|
-
"mocha": "^
|
|
107
|
+
"mocha": "^10.2.0",
|
|
107
108
|
"moment": "^2.29.3",
|
|
108
109
|
"npm-force-resolutions": "0.0.10",
|
|
109
110
|
"parcel": "^2.7.0",
|
|
@@ -111,22 +112,22 @@
|
|
|
111
112
|
"parcel-plugin-static-files-copy": "^2.6.0",
|
|
112
113
|
"parcel-reporter-static-files-copy": "^1.4.0",
|
|
113
114
|
"path-parse": "^1.0.7",
|
|
114
|
-
"prettier": "^
|
|
115
|
+
"prettier": "^3.0.3",
|
|
115
116
|
"process": "^0.11.10",
|
|
116
117
|
"rangy": "^1.3.0",
|
|
117
|
-
"react": "^
|
|
118
|
-
"react-app-polyfill": "^
|
|
119
|
-
"react-dom": "^
|
|
120
|
-
"regenerator-runtime": "^0.
|
|
118
|
+
"react": "^18.2.0",
|
|
119
|
+
"react-app-polyfill": "^3.0.0",
|
|
120
|
+
"react-dom": "^18.2.0",
|
|
121
|
+
"regenerator-runtime": "^0.14.0",
|
|
121
122
|
"rimraf": "^3.0.2",
|
|
122
|
-
"sinon": "^
|
|
123
|
+
"sinon": "^16.0.0",
|
|
123
124
|
"ta-json-x": "^2.5.3",
|
|
124
125
|
"tar": ">=6.1.9",
|
|
125
|
-
"ts-loader": "^
|
|
126
|
+
"ts-loader": "^9.4.4",
|
|
126
127
|
"ts-node": "^10.4.0",
|
|
127
|
-
"typedoc": "^0.
|
|
128
|
-
"typedoc-plugin-rename-defaults": "^0.
|
|
129
|
-
"typescript": "
|
|
128
|
+
"typedoc": "^0.25.1",
|
|
129
|
+
"typedoc-plugin-rename-defaults": "^0.6.6",
|
|
130
|
+
"typescript": "5.1.6",
|
|
130
131
|
"urijs": "^1.19.11"
|
|
131
132
|
},
|
|
132
133
|
"files": [
|