@applicaster/zapp-react-dom-app 12.0.0-alpha.9834532023 → 12.0.0-alpha.9903765553
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 +9 -0
- 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/Polyfills/AppLoaderBridge/utils/enums.ts +1 -0
- package/package.json +6 -6
- package/App/Loader/utils/__tests__/getAvailableAppLanguages.test.js +0 -22
|
@@ -592,6 +592,12 @@ export function withInteractionManager(Component: React.FC) {
|
|
|
592
592
|
focusManager.moveFocus(direction);
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
+
if (!isDialogVisible) {
|
|
596
|
+
// run focus recovery on user interaction attempt
|
|
597
|
+
// probably we failed to set initial focus for some reason
|
|
598
|
+
focusManager.recoverFocus();
|
|
599
|
+
}
|
|
600
|
+
|
|
595
601
|
if (
|
|
596
602
|
displayState === DISPLAY_STATES.PLAYER ||
|
|
597
603
|
displayState === DISPLAY_STATES.HUD
|
|
@@ -656,6 +662,9 @@ export function withInteractionManager(Component: React.FC) {
|
|
|
656
662
|
|
|
657
663
|
onConfirmDialogClose() {
|
|
658
664
|
this.confirmDialog.hideDialog();
|
|
665
|
+
|
|
666
|
+
// restore initial focus after closing dialog
|
|
667
|
+
focusManager.setInitialFocus();
|
|
659
668
|
}
|
|
660
669
|
|
|
661
670
|
render() {
|
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.9903765553",
|
|
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.9903765553",
|
|
26
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.9903765553",
|
|
27
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.9903765553",
|
|
28
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.9903765553",
|
|
29
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.9903765553",
|
|
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
|
-
});
|