@d-i-t-a/reader 2.4.4 → 2.4.6

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.
@@ -6,6 +6,7 @@ export declare class ReadiumCSS {
6
6
  static readonly SCROLL_REF = "scroll";
7
7
  static readonly TEXT_ALIGNMENT_REF = "textAlign";
8
8
  static readonly COLUMN_COUNT_REF = "colCount";
9
+ static readonly DIRECTION_REF = "direction";
9
10
  static readonly WORD_SPACING_REF = "wordSpacing";
10
11
  static readonly LETTER_SPACING_REF = "letterSpacing";
11
12
  static readonly PAGE_MARGINS_REF = "pageMargins";
@@ -17,6 +18,7 @@ export declare class ReadiumCSS {
17
18
  static readonly SCROLL_KEY: string;
18
19
  static readonly TEXT_ALIGNMENT_KEY: string;
19
20
  static readonly COLUMN_COUNT_KEY: string;
21
+ static readonly DIRECTION_KEY: string;
20
22
  static readonly WORD_SPACING_KEY: string;
21
23
  static readonly LETTER_SPACING_KEY: string;
22
24
  static readonly PAGE_MARGINS_KEY: string;
@@ -35,6 +35,7 @@ export interface IUserSettings {
35
35
  verticalScroll: boolean;
36
36
  textAlignment: number;
37
37
  columnCount: number;
38
+ direction: number;
38
39
  wordSpacing: number;
39
40
  letterSpacing: number;
40
41
  pageMargins: number;
@@ -53,6 +54,7 @@ export interface InitialUserSettings {
53
54
  verticalScroll?: boolean | "readium-scroll-on" | "readium-scroll-off" | "scroll" | "paginated";
54
55
  textAlignment: number;
55
56
  columnCount: number;
57
+ direction: string;
56
58
  wordSpacing: number;
57
59
  letterSpacing: number;
58
60
  pageMargins: number;
@@ -67,6 +69,7 @@ export declare class UserSettings implements IUserSettings {
67
69
  private static fontFamilyValues;
68
70
  private static readonly textAlignmentValues;
69
71
  private static readonly columnCountValues;
72
+ private static readonly directionValues;
70
73
  fontSize: number;
71
74
  fontOverride: boolean;
72
75
  fontFamily: number;
@@ -74,6 +77,7 @@ export declare class UserSettings implements IUserSettings {
74
77
  verticalScroll: boolean;
75
78
  textAlignment: number;
76
79
  columnCount: number;
80
+ direction: number;
77
81
  wordSpacing: number;
78
82
  letterSpacing: number;
79
83
  pageMargins: number;
@@ -119,6 +123,7 @@ export declare class UserSettings implements IUserSettings {
119
123
  fontFamily: string;
120
124
  textAlignment: string;
121
125
  columnCount: string;
126
+ direction: string;
122
127
  verticalScroll: boolean;
123
128
  fontSize: number;
124
129
  wordSpacing: number;
@@ -50,7 +50,7 @@ export declare class AnnotationModule implements ReaderModule {
50
50
  hideAnnotationLayer(): void;
51
51
  showAnnotationLayer(): void;
52
52
  handleResize(): Promise<void>;
53
- initialize(): Promise<unknown>;
53
+ initialize(iframe: HTMLIFrameElement): Promise<unknown>;
54
54
  private click;
55
55
  scrollToHighlight(id: any): Promise<any>;
56
56
  updateLocalHighlight(annotation: Annotation): Promise<any>;
@@ -47,7 +47,7 @@ export declare class ConsumptionModule implements ReaderModule {
47
47
  static create(config: ConsumptionModuleConfig): Promise<ConsumptionModule>;
48
48
  protected start(): Promise<void>;
49
49
  stop(): Promise<void>;
50
- initialize(): void;
50
+ initialize(iframe: HTMLIFrameElement): void;
51
51
  trackAction(locator: Locator, action: Action): void;
52
52
  startReadingSession(locator: Locator): void;
53
53
  continueReadingSession(locator: Locator): void;
@@ -70,7 +70,7 @@ export declare class TextHighlighter {
70
70
  activeAnnotationMarkerId?: string;
71
71
  static create(config: TextHighlighterConfig): Promise<any>;
72
72
  private constructor();
73
- initialize(): Promise<void>;
73
+ initialize(iframe: HTMLIFrameElement): Promise<void>;
74
74
  /**
75
75
  * Returns true if elements a i b have the same color.
76
76
  * @param {Node} a
@@ -32,7 +32,7 @@ export default class LineFocusModule implements ReaderModule {
32
32
  private constructor();
33
33
  stop(): Promise<void>;
34
34
  protected start(): Promise<void>;
35
- initialize(): Promise<unknown>;
35
+ initialize(iframe: HTMLIFrameElement): Promise<unknown>;
36
36
  private keydown;
37
37
  private keyup;
38
38
  handleResize(): void;
@@ -56,7 +56,7 @@ export declare class ContentProtectionModule implements ReaderModule {
56
56
  activate(): Promise<void>;
57
57
  private setupEvents;
58
58
  initializeResource(): void;
59
- initialize(): Promise<void>;
59
+ initialize(iframe: HTMLIFrameElement): Promise<void>;
60
60
  handleScroll(): void;
61
61
  handleResize(): Promise<void>;
62
62
  disableContext(e: {
@@ -36,6 +36,9 @@ export interface NavigatorAPI {
36
36
  resourceAtEnd: any;
37
37
  resourceFitsScreen: any;
38
38
  updateCurrentLocation: any;
39
+ keydownFallthrough: any;
40
+ clickThrough: any;
41
+ direction: any;
39
42
  onError?: (e: Error) => void;
40
43
  }
41
44
  export interface IFrameAttributes {
@@ -128,6 +131,7 @@ export interface ReaderConfig {
128
131
  injectables: Array<Injectable>;
129
132
  injectablesFixed?: Array<Injectable>;
130
133
  useLocalStorage?: boolean;
134
+ useStorageType?: string;
131
135
  attributes?: IFrameAttributes;
132
136
  services?: PublicationServices;
133
137
  sample?: SampleRead;
@@ -214,6 +218,7 @@ export declare class IFrameNavigator extends EventEmitter implements Navigator {
214
218
  stop(): void;
215
219
  spreads: HTMLDivElement;
216
220
  firstSpread: HTMLDivElement;
221
+ setDirection(direction?: string | null): void;
217
222
  protected start(mainElement: HTMLElement, headerMenu?: HTMLElement | null, footerMenu?: HTMLElement | null): Promise<void>;
218
223
  timeout: any;
219
224
  onResize: () => void;
@@ -272,6 +277,7 @@ export declare class IFrameNavigator extends EventEmitter implements Navigator {
272
277
  savePosition: debounce.DebouncedFunction<() => void>;
273
278
  private handlePreviousChapterClick;
274
279
  private handleNextChapterClick;
280
+ private handleKeydownFallthrough;
275
281
  private hideView;
276
282
  private setActiveTOCItem;
277
283
  navigate(locator: Locator, history?: boolean): Promise<void>;
@@ -141,6 +141,7 @@ export default class D2Reader {
141
141
  fontFamily: string;
142
142
  textAlignment: string;
143
143
  columnCount: string;
144
+ direction: string;
144
145
  verticalScroll: boolean;
145
146
  fontSize: number;
146
147
  wordSpacing: number;
@@ -5,6 +5,7 @@ export interface LocalStorageStoreConfig {
5
5
  value for each key. */
6
6
  prefix: string;
7
7
  useLocalStorage: boolean;
8
+ useStorageType: string | undefined;
8
9
  }
9
10
  /** Class that stores key/value pairs in localStorage if possible
10
11
  but falls back to an in-memory store. */
@@ -12,6 +13,7 @@ export default class LocalStorageStore implements Store {
12
13
  private readonly fallbackStore;
13
14
  private readonly prefix;
14
15
  private readonly useLocalStorage;
16
+ private readonly useStorageType;
15
17
  constructor(config: LocalStorageStoreConfig);
16
18
  private getLocalStorageKey;
17
19
  get(key: string): any | null;
@@ -1,9 +1,11 @@
1
1
  import { IFrameNavigator } from "../navigator/IFrameNavigator";
2
2
  export default class KeyboardEventHandler {
3
3
  navigator: IFrameNavigator;
4
+ rtl: boolean;
4
5
  constructor(navigator: IFrameNavigator);
5
6
  onBackwardSwipe: (event: UIEvent) => void;
6
7
  onForwardSwipe: (event: UIEvent) => void;
8
+ onKeydown: (event: UIEvent) => void;
7
9
  setupEvents: (element: HTMLElement | Document | null) => void;
8
10
  removeEvents: (element: HTMLElement | Document | null) => void;
9
11
  focusin: (element: HTMLElement | Document) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-i-t-a/reader",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
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",
@@ -77,8 +77,8 @@
77
77
  "@types/rimraf": "^4.0.5",
78
78
  "@types/sanitize-html": "^2.9.0",
79
79
  "@types/uuid": "^9.0.4",
80
- "@typescript-eslint/eslint-plugin": "^6.9.0",
81
- "@typescript-eslint/parser": "^6.9.0",
80
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
81
+ "@typescript-eslint/parser": "^7.0.1",
82
82
  "ansi-regex": ">=5.0.1",
83
83
  "babel-eslint": "^10.1.0",
84
84
  "braces": ">=3.0.2",
@@ -141,5 +141,8 @@
141
141
  "semi": true,
142
142
  "singleQuote": false,
143
143
  "trailingComma": "es5"
144
+ },
145
+ "@parcel/resolver-default": {
146
+ "packageExports": true
144
147
  }
145
148
  }