@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.
- package/App/InteractionManager/index.tsx +25 -5
- package/App/Loader/appLoader.js +2 -6
- package/App/Loader/setUpRTL.js +3 -3
- package/App/Loader/utils/index.js +3 -4
- package/Polyfills/AnalyticsBridge/index.ts +5 -1
- package/package.json +6 -6
- package/App/Loader/utils/__tests__/getAvailableAppLanguages.test.js +0 -22
|
@@ -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
|
|
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
|
-
|
|
450
|
-
this.
|
|
451
|
-
|
|
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
|
-
|
|
581
|
+
if (!event.repeat) {
|
|
582
|
+
focusManager.press();
|
|
583
|
+
}
|
|
564
584
|
}
|
|
565
585
|
|
|
566
586
|
return true;
|
package/App/Loader/appLoader.js
CHANGED
|
@@ -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(
|
|
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);
|
package/App/Loader/setUpRTL.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
|
|
2
2
|
import { I18nManager } from "react-native";
|
|
3
3
|
|
|
4
|
-
export async function setUpRTL(
|
|
5
|
-
const isRTL =
|
|
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
|
|
19
|
+
const remoteConfigurations = appStore.get("remoteConfigurations");
|
|
21
20
|
|
|
22
|
-
return
|
|
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: {
|
|
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.
|
|
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.
|
|
26
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
27
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
28
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
29
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
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
|
-
});
|