@applicaster/zapp-react-dom-app 12.0.0-alpha.4960304100 → 12.0.0-alpha.5000126055

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.
@@ -444,11 +444,21 @@ export function withInteractionManager(Component: React.FC) {
444
444
 
445
445
  const { isDialogVisible } = confirmationDialogStore.getState();
446
446
 
447
- // If this is a supported longpress key we need to set the timeout and handle the longpress
447
+ // If this is a supported long press key we need to set the timeout and handle the long press
448
448
  if (this.keySupportsLongPress(event)) {
449
- this.longKeyPressTimeout = setTimeout(() => {
450
- this.onLongPress(event);
451
- }, LONG_KEY_PRESS_TIMEOUT);
449
+ if (!event.repeat) {
450
+ if (this.longKeyPressTimeout) {
451
+ console.error(
452
+ "Recieved new on key down while long press timout is still active"
453
+ );
454
+
455
+ this.clearLongPressTimeout();
456
+ }
457
+
458
+ this.longKeyPressTimeout = setTimeout(() => {
459
+ this.onLongPress(event);
460
+ }, LONG_KEY_PRESS_TIMEOUT);
461
+ }
452
462
  }
453
463
 
454
464
  /**
@@ -488,6 +498,10 @@ export function withInteractionManager(Component: React.FC) {
488
498
  }
489
499
 
490
500
  if (keyCode(event).matches(KEYS.Forward)) {
501
+ if (event.repeat) {
502
+ return;
503
+ }
504
+
491
505
  setDisplayState(DISPLAY_STATES.HUD);
492
506
  this.props.seekMethods.onForwardPress();
493
507
 
@@ -495,6 +509,10 @@ export function withInteractionManager(Component: React.FC) {
495
509
  }
496
510
 
497
511
  if (keyCode(event).matches(KEYS.Rewind)) {
512
+ if (event.repeat) {
513
+ return;
514
+ }
515
+
498
516
  setDisplayState(DISPLAY_STATES.HUD);
499
517
  this.props.seekMethods.onRewindPress();
500
518
 
@@ -560,7 +578,9 @@ export function withInteractionManager(Component: React.FC) {
560
578
  if (displayState === DISPLAY_STATES.PLAYER) {
561
579
  setDisplayState(DISPLAY_STATES.HUD);
562
580
  } else {
563
- focusManager.press();
581
+ if (!event.repeat) {
582
+ focusManager.press();
583
+ }
564
584
  }
565
585
 
566
586
  return true;
@@ -8,11 +8,7 @@ export const appLoaderImpl =
8
8
  ) =>
9
9
  async (dispatch, getState) => {
10
10
  try {
11
- const {
12
- plugins,
13
- pluginConfigurations,
14
- remoteConfigurations: { localizations },
15
- } = getState();
11
+ const { plugins, pluginConfigurations } = getState();
16
12
 
17
13
  // Await crucial tasks
18
14
  await loadLocale();
@@ -20,7 +16,7 @@ export const appLoaderImpl =
20
16
  await loadAnalyticsPlugins(plugins, pluginConfigurations);
21
17
 
22
18
  // Remaining loaders
23
- const loaders = [loadDomPlugins(plugins), setUpRTL(localizations)];
19
+ const loaders = [loadDomPlugins(plugins), setUpRTL()];
24
20
 
25
21
  // Await for the remaining tasks and return when they are all complete
26
22
  await Promise.all(loaders);
@@ -1,7 +1,7 @@
1
- import { getIsRTLFromLocalizations } from "@applicaster/zapp-react-native-utils/localizationUtils";
1
+ import { getIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
2
2
  import { I18nManager } from "react-native";
3
3
 
4
- export async function setUpRTL(localizations) {
5
- const isRTL = getIsRTLFromLocalizations(localizations);
4
+ export async function setUpRTL() {
5
+ const isRTL = getIsRTL();
6
6
  I18nManager.forceRTL(isRTL);
7
7
  }
@@ -1,7 +1,6 @@
1
1
  import * as R from "ramda";
2
2
  import { appStore as AppStore } from "@applicaster/zapp-react-native-redux/AppStore";
3
3
  import { NativeModules } from "react-native";
4
- import { getAppData } from "../../../Polyfills/AppData";
5
4
 
6
5
  export const UI_LANGUAGE = "uiLanguage";
7
6
 
@@ -15,11 +14,11 @@ export const persistLanguageSelection = async (languageCode) => {
15
14
  return NativeModules.LocalStorage.setItem(UI_LANGUAGE, languageCode);
16
15
  };
17
16
 
18
- export const getAvailableAppLanguagesImpl = () => {
17
+ export const getAvailableAppLanguagesImpl = (appStore) => {
19
18
  try {
20
- const { languages } = getAppData();
19
+ const remoteConfigurations = appStore.get("remoteConfigurations");
21
20
 
22
- return languages;
21
+ return R.keys(remoteConfigurations.localizations);
23
22
  } catch (e) {
24
23
  return [];
25
24
  }
@@ -105,7 +105,11 @@ function isInvalidAnalyticsData(eventName, payload = null) {
105
105
 
106
106
  export const AnalyticsBridge = (function () {
107
107
  let registeredAnalyticPlugins: {
108
- module: { sendEvent: Function; initialize?: Function };
108
+ module: {
109
+ sendEvent: Function;
110
+ initialize?: Function;
111
+ getPlayerConfiguration?: Function;
112
+ };
109
113
  configuration?: any;
110
114
  }[] = [];
111
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-dom-app",
3
- "version": "12.0.0-alpha.4960304100",
3
+ "version": "12.0.0-alpha.5000126055",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "homepage": "https://github.com/applicaster/zapp-react-dom-app#readme",
24
24
  "dependencies": {
25
- "@applicaster/zapp-react-dom-ui-components": "12.0.0-alpha.4960304100",
26
- "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.4960304100",
27
- "@applicaster/zapp-react-native-redux": "12.0.0-alpha.4960304100",
28
- "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.4960304100",
29
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.4960304100",
25
+ "@applicaster/zapp-react-dom-ui-components": "12.0.0-alpha.5000126055",
26
+ "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.5000126055",
27
+ "@applicaster/zapp-react-native-redux": "12.0.0-alpha.5000126055",
28
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.5000126055",
29
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.5000126055",
30
30
  "abortcontroller-polyfill": "^1.7.5",
31
31
  "history": "^4.7.2",
32
32
  "react-router-dom": "^5.1.2",
@@ -1,22 +0,0 @@
1
- jest.mock("../../../../Polyfills/AppData", () => ({
2
- getAppData: jest.fn(),
3
- }));
4
-
5
- describe("getAvailableAppLanguages", () => {
6
- const { getAppData } = require("../../../../Polyfills/AppData");
7
- const { getAvailableAppLanguagesImpl } = require("..");
8
-
9
- it("return list of languages", () => {
10
- const languages = ["en", "de", "fr", "en-UK", "en-GB"];
11
-
12
- getAppData.mockReturnValue({ languages });
13
-
14
- expect(getAvailableAppLanguagesImpl()).toEqual(languages);
15
- });
16
-
17
- it("return list of languages", () => {
18
- getAppData.mockReturnValue(undefined);
19
-
20
- expect(getAvailableAppLanguagesImpl()).toEqual([]);
21
- });
22
- });