@applicaster/zapp-react-dom-app 12.0.0-alpha.8235014824 → 12.0.0-alpha.8254217837
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
|
|
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
|
/**
|
|
@@ -560,7 +570,9 @@ export function withInteractionManager(Component: React.FC) {
|
|
|
560
570
|
if (displayState === DISPLAY_STATES.PLAYER) {
|
|
561
571
|
setDisplayState(DISPLAY_STATES.HUD);
|
|
562
572
|
} else {
|
|
563
|
-
|
|
573
|
+
if (!event.repeat) {
|
|
574
|
+
focusManager.press();
|
|
575
|
+
}
|
|
564
576
|
}
|
|
565
577
|
|
|
566
578
|
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
|
}
|
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.8254217837",
|
|
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.8254217837",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.8254217837",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.8254217837",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.8254217837",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.8254217837",
|
|
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
|
-
});
|