@readium/navigator 2.5.2-beta.4 → 2.5.2-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readium/navigator",
3
- "version": "2.5.2-beta.4",
3
+ "version": "2.5.2-beta.5",
4
4
  "type": "module",
5
5
  "description": "Next generation SDK for publications in Web Apps",
6
6
  "author": "readium",
@@ -4,6 +4,7 @@ import { FrameComms } from "../frame/FrameComms.ts";
4
4
  import { FXLPeripherals } from "./FXLPeripherals.ts";
5
5
  import type { ReadiumWindow } from "../../../../navigator-html-injectables/types/src/helpers/dom";
6
6
  import { IContentProtectionConfig, IKeyboardPeripheralsConfig } from "../../Navigator.ts";
7
+ import { KeyboardConditionBridge } from "../../peripherals/KeyboardConditionBridge.ts";
7
8
 
8
9
  export class FXLFrameManager {
9
10
  private frame: HTMLIFrameElement;
@@ -13,6 +14,7 @@ export class FXLFrameManager {
13
14
  private readonly peripherals: FXLPeripherals;
14
15
  private readonly contentProtectionConfig: IContentProtectionConfig;
15
16
  private readonly keyboardPeripheralsConfig: IKeyboardPeripheralsConfig;
17
+ private conditionBridge?: KeyboardConditionBridge;
16
18
  private currModules: ModuleName[] = [];
17
19
 
18
20
  // NEW
@@ -159,6 +161,7 @@ export class FXLFrameManager {
159
161
  }
160
162
 
161
163
  async destroy() {
164
+ this.conditionBridge?.destroy();
162
165
  await this.unfocus();
163
166
  this.loader?.destroy();
164
167
  this.wrapper.remove();
@@ -213,9 +216,17 @@ export class FXLFrameManager {
213
216
  // Send content protection config
214
217
  this.comms!.send("peripherals_protection", this.contentProtectionConfig);
215
218
 
216
- // Send keyboard peripherals separately
219
+ // Send keyboard peripherals, filtered through condition bridge
217
220
  if (this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0) {
218
- this.comms!.send("keyboard_peripherals", this.keyboardPeripheralsConfig);
221
+ this.conditionBridge?.destroy();
222
+ this.conditionBridge = new KeyboardConditionBridge(
223
+ this.keyboardPeripheralsConfig,
224
+ (serializable) => {
225
+ if (serializable.length > 0)
226
+ this.comms!.send("keyboard_peripherals", serializable);
227
+ }
228
+ );
229
+ this.conditionBridge.setup();
219
230
  }
220
231
 
221
232
  // Apply print protection if configured
@@ -11,6 +11,7 @@ export declare class FXLFrameManager {
11
11
  private readonly peripherals;
12
12
  private readonly contentProtectionConfig;
13
13
  private readonly keyboardPeripheralsConfig;
14
+ private conditionBridge?;
14
15
  private currModules;
15
16
  wrapper: HTMLDivElement;
16
17
  debugHref: string;