@fto-consult/expo-ui 6.35.5 → 6.37.2
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/.env.readMe.txt +11 -11
- package/App.js +1 -0
- package/app.config.json +10 -10
- package/app.json +11 -11
- package/bin/create-app/App.js +40 -0
- package/bin/create-app.js +2 -0
- package/electron/utils/env.js +79 -79
- package/env.js +10 -10
- package/index.js +1 -68
- package/package.json +131 -130
- package/src/App.js +18 -173
- package/src/AppEntry/App.js +320 -0
- package/src/AppEntry/index.js +177 -0
- package/src/app.config.json +30 -30
- package/src/components/Chart/appexChart/appexChart.html +23 -23
- package/src/context/Provider.js +4 -2
- package/src/index.js +2 -320
- package/src/screens/Help/openLibraries.js +1 -1
- package/%ProgramData%/Microsoft/Windows/UUS/State/_active.uusver +0 -1
- package/bin/create-app/registerApp.js +0 -40
package/package.json
CHANGED
@@ -1,130 +1,131 @@
|
|
1
|
-
{
|
2
|
-
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "6.
|
4
|
-
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
|
-
"main": "
|
6
|
-
"scripts": {
|
7
|
-
"clear-npx-cache": "npx clear-npx-cache",
|
8
|
-
"publish1": "npm publish --access=public",
|
9
|
-
"unpublish": "npm -f unpublish @fto-consult/expo-ui",
|
10
|
-
"build-web": "",
|
11
|
-
"dev": "npx expo start -c --no-minify",
|
12
|
-
"start": "npx expo start --dev --no-minify",
|
13
|
-
"start-d": "npx expo start -c --no-dev --no-minify",
|
14
|
-
"start-p": "npm run start-d",
|
15
|
-
"expo-start-client": "npx expo start --dev --no-minify --dev-client",
|
16
|
-
"start-m": "npx expo start - c--dev--no -minify",
|
17
|
-
"android": "npx expo start --android -c",
|
18
|
-
"ios": "npx expo start --ios",
|
19
|
-
"web": "npx expo start --web",
|
20
|
-
"web-c": "npx expo start --web -c",
|
21
|
-
"eject": "expo eject",
|
22
|
-
"emulator": "npm run android-emulator",
|
23
|
-
"web-server": "npx serve web-build",
|
24
|
-
"build-android": "eas build --clear-cache -p android --profile preview",
|
25
|
-
"build-android-local": "eas build --platform android --local",
|
26
|
-
"build-android-dist": "eas build --clear-cache -p android",
|
27
|
-
"build-ios": "eas build --clear-cache -p ios --profile preview",
|
28
|
-
"build-ios-dist": "eas build --clear-cache -p ios",
|
29
|
-
"install-apk": "adb -s emulator-5554 install myapp.apk",
|
30
|
-
"android-emulator": "emulator -avd EMULATOR",
|
31
|
-
"flipper": "npx cross-env METRO_SERVER_PORT=19000 E:\\Studies\\react-native\\debugger\\Flipper-win\\Flipper.exe",
|
32
|
-
"test:build": "electron-webpack && electron-builder --dir -c.compression=store -c.mac.identity=null",
|
33
|
-
"compile-electron": "webpack --env platform=electron",
|
34
|
-
"compile-electron-p": "webpack --config ./electron/webpack.config.js --mode=production",
|
35
|
-
"electron": "electron ./electron",
|
36
|
-
"logcat": "adb -d logcat com.ftc.apps.salite1:E > errors.txt",
|
37
|
-
"logcat-export": "adb -d logcat com.ftc.apps.salite1 *:S > logcat.txt",
|
38
|
-
"electron-c": "npm run compile-electron && npm run electron",
|
39
|
-
"electron-p": "npm run compile-electron-p && npm run electron",
|
40
|
-
"update-app-version": "node ./update-app-version.js",
|
41
|
-
"find-licenses": "node ./find-licenses.js",
|
42
|
-
"fix-dependencies": "expo-cli doctor --fix-dependencies",
|
43
|
-
"expo-fix": "npx expo install --fix",
|
44
|
-
"update-apexchart": "node ./bin/update-appex-chart.js",
|
45
|
-
"update-appexchart": "npm run update-apexchart",
|
46
|
-
"delete-node-modules": "rimraf ./**/node_modules",
|
47
|
-
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
|
48
|
-
"update": "npm i expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest react-native-blob-util react-native-gesture-handler@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest && npx expo install --fix && npm run update-apexchart"
|
49
|
-
},
|
50
|
-
"bin": {
|
51
|
-
"expo-ui": "./bin/index.js"
|
52
|
-
},
|
53
|
-
"repository": {
|
54
|
-
"type": "git",
|
55
|
-
"url": "git+https://github.com/borispipo/expo-ui.git"
|
56
|
-
},
|
57
|
-
"keywords": [
|
58
|
-
"Expo",
|
59
|
-
"React-Native"
|
60
|
-
],
|
61
|
-
"author": "Boris Fouomene",
|
62
|
-
"license": "ISC",
|
63
|
-
"bugs": {
|
64
|
-
"url": "https://github.com/borispipo/expo-ui/issues"
|
65
|
-
},
|
66
|
-
"homepage": "https://github.com/borispipo/expo-ui#readme",
|
67
|
-
"dependencies": {
|
68
|
-
"@emotion/native": "^11.11.0",
|
69
|
-
"@emotion/react": "^11.11.1",
|
70
|
-
"@expo/html-elements": "^0.5.1",
|
71
|
-
"@expo/vector-icons": "^13.0.0",
|
72
|
-
"@faker-js/faker": "^8.0.2",
|
73
|
-
"@fto-consult/common": "^3.
|
74
|
-
"@pchmn/expo-material3-theme": "^1.3.1",
|
75
|
-
"@react-native-
|
76
|
-
"@react-native-community/
|
77
|
-
"@react-native-
|
78
|
-
"@react-native
|
79
|
-
"@react-navigation/native": "^6.
|
80
|
-
"@
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"expo": "
|
84
|
-
"expo-
|
85
|
-
"expo-
|
86
|
-
"expo-
|
87
|
-
"expo-
|
88
|
-
"expo-
|
89
|
-
"expo-
|
90
|
-
"expo-
|
91
|
-
"expo-system-ui": "~2.4.0",
|
92
|
-
"expo-web-browser": "~12.3.2",
|
93
|
-
"file-saver": "^2.0.5",
|
94
|
-
"fs-extra": "^11.1.1",
|
95
|
-
"google-libphonenumber": "^3.2.33",
|
96
|
-
"htmlparser2-without-node-native": "^3.9.2",
|
97
|
-
"
|
98
|
-
"
|
99
|
-
"
|
100
|
-
"
|
101
|
-
"react
|
102
|
-
"react-
|
103
|
-
"react-
|
104
|
-
"react-native
|
105
|
-
"react-native-
|
106
|
-
"react-native-
|
107
|
-
"react-native-
|
108
|
-
"react-native-
|
109
|
-
"react-native-
|
110
|
-
"react-native-paper
|
111
|
-
"react-native-
|
112
|
-
"react-native-
|
113
|
-
"react-native-
|
114
|
-
"react-native-
|
115
|
-
"react-native-
|
116
|
-
"react-native-
|
117
|
-
"react-
|
118
|
-
"
|
119
|
-
"
|
120
|
-
"
|
121
|
-
"
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
"@expo/
|
126
|
-
"
|
127
|
-
"babel-plugin-
|
128
|
-
"
|
129
|
-
|
130
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@fto-consult/expo-ui",
|
3
|
+
"version": "6.37.2",
|
4
|
+
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
|
+
"main": "node_modules/expo/AppEntry.js",
|
6
|
+
"scripts": {
|
7
|
+
"clear-npx-cache": "npx clear-npx-cache",
|
8
|
+
"publish1": "npm publish --access=public",
|
9
|
+
"unpublish": "npm -f unpublish @fto-consult/expo-ui",
|
10
|
+
"build-web": "",
|
11
|
+
"dev": "npx expo start -c --no-minify",
|
12
|
+
"start": "npx expo start --dev --no-minify",
|
13
|
+
"start-d": "npx expo start -c --no-dev --no-minify",
|
14
|
+
"start-p": "npm run start-d",
|
15
|
+
"expo-start-client": "npx expo start --dev --no-minify --dev-client",
|
16
|
+
"start-m": "npx expo start - c--dev--no -minify",
|
17
|
+
"android": "npx expo start --android -c",
|
18
|
+
"ios": "npx expo start --ios",
|
19
|
+
"web": "npx expo start --web",
|
20
|
+
"web-c": "npx expo start --web -c",
|
21
|
+
"eject": "expo eject",
|
22
|
+
"emulator": "npm run android-emulator",
|
23
|
+
"web-server": "npx serve web-build",
|
24
|
+
"build-android": "eas build --clear-cache -p android --profile preview",
|
25
|
+
"build-android-local": "eas build --platform android --local",
|
26
|
+
"build-android-dist": "eas build --clear-cache -p android",
|
27
|
+
"build-ios": "eas build --clear-cache -p ios --profile preview",
|
28
|
+
"build-ios-dist": "eas build --clear-cache -p ios",
|
29
|
+
"install-apk": "adb -s emulator-5554 install myapp.apk",
|
30
|
+
"android-emulator": "emulator -avd EMULATOR",
|
31
|
+
"flipper": "npx cross-env METRO_SERVER_PORT=19000 E:\\Studies\\react-native\\debugger\\Flipper-win\\Flipper.exe",
|
32
|
+
"test:build": "electron-webpack && electron-builder --dir -c.compression=store -c.mac.identity=null",
|
33
|
+
"compile-electron": "webpack --env platform=electron",
|
34
|
+
"compile-electron-p": "webpack --config ./electron/webpack.config.js --mode=production",
|
35
|
+
"electron": "electron ./electron",
|
36
|
+
"logcat": "adb -d logcat com.ftc.apps.salite1:E > errors.txt",
|
37
|
+
"logcat-export": "adb -d logcat com.ftc.apps.salite1 *:S > logcat.txt",
|
38
|
+
"electron-c": "npm run compile-electron && npm run electron",
|
39
|
+
"electron-p": "npm run compile-electron-p && npm run electron",
|
40
|
+
"update-app-version": "node ./update-app-version.js",
|
41
|
+
"find-licenses": "node ./find-licenses.js",
|
42
|
+
"fix-dependencies": "expo-cli doctor --fix-dependencies",
|
43
|
+
"expo-fix": "npx expo install --fix",
|
44
|
+
"update-apexchart": "node ./bin/update-appex-chart.js",
|
45
|
+
"update-appexchart": "npm run update-apexchart",
|
46
|
+
"delete-node-modules": "rimraf ./**/node_modules",
|
47
|
+
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
|
48
|
+
"update": "npm i expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest react-native-blob-util react-native-gesture-handler@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest && npx expo install --fix && npm run update-apexchart"
|
49
|
+
},
|
50
|
+
"bin": {
|
51
|
+
"expo-ui": "./bin/index.js"
|
52
|
+
},
|
53
|
+
"repository": {
|
54
|
+
"type": "git",
|
55
|
+
"url": "git+https://github.com/borispipo/expo-ui.git"
|
56
|
+
},
|
57
|
+
"keywords": [
|
58
|
+
"Expo",
|
59
|
+
"React-Native"
|
60
|
+
],
|
61
|
+
"author": "Boris Fouomene",
|
62
|
+
"license": "ISC",
|
63
|
+
"bugs": {
|
64
|
+
"url": "https://github.com/borispipo/expo-ui/issues"
|
65
|
+
},
|
66
|
+
"homepage": "https://github.com/borispipo/expo-ui#readme",
|
67
|
+
"dependencies": {
|
68
|
+
"@emotion/native": "^11.11.0",
|
69
|
+
"@emotion/react": "^11.11.1",
|
70
|
+
"@expo/html-elements": "^0.5.1",
|
71
|
+
"@expo/vector-icons": "^13.0.0",
|
72
|
+
"@faker-js/faker": "^8.0.2",
|
73
|
+
"@fto-consult/common": "^3.36.0",
|
74
|
+
"@pchmn/expo-material3-theme": "^1.3.1",
|
75
|
+
"@react-native-community/datetimepicker": "7.2.0",
|
76
|
+
"@react-native-community/netinfo": "9.3.10",
|
77
|
+
"@react-native/assets-registry": "^0.72.0",
|
78
|
+
"@react-navigation/native": "^6.1.7",
|
79
|
+
"@react-navigation/native-stack": "^6.9.13",
|
80
|
+
"@shopify/flash-list": "1.4.3",
|
81
|
+
"apexcharts": "^3.42.0",
|
82
|
+
"expo": "^49.0.11",
|
83
|
+
"expo-camera": "~13.4.4",
|
84
|
+
"expo-clipboard": "~4.3.1",
|
85
|
+
"expo-font": "~11.4.0",
|
86
|
+
"expo-image-picker": "~14.3.2",
|
87
|
+
"expo-linking": "~5.0.2",
|
88
|
+
"expo-sqlite": "~11.3.3",
|
89
|
+
"expo-status-bar": "~1.6.0",
|
90
|
+
"expo-storage": "^48.1.0",
|
91
|
+
"expo-system-ui": "~2.4.0",
|
92
|
+
"expo-web-browser": "~12.3.2",
|
93
|
+
"file-saver": "^2.0.5",
|
94
|
+
"fs-extra": "^11.1.1",
|
95
|
+
"google-libphonenumber": "^3.2.33",
|
96
|
+
"htmlparser2-without-node-native": "^3.9.2",
|
97
|
+
"is-plain-obj": "^4.1.0",
|
98
|
+
"pdfmake": "^0.2.7",
|
99
|
+
"process": "^0.11.10",
|
100
|
+
"prop-types": "^15.8.1",
|
101
|
+
"react": "^18.2.0",
|
102
|
+
"react-content-loader": "^6.2.1",
|
103
|
+
"react-dom": "^18.2.0",
|
104
|
+
"react-native": "0.72.4",
|
105
|
+
"react-native-big-list": "^1.6.1",
|
106
|
+
"react-native-blob-util": "^0.18.6",
|
107
|
+
"react-native-gesture-handler": "^2.12.1",
|
108
|
+
"react-native-iphone-x-helper": "^1.3.1",
|
109
|
+
"react-native-mime-types": "^2.4.0",
|
110
|
+
"react-native-paper": "^5.10.4",
|
111
|
+
"react-native-paper-dates": "^0.19.0",
|
112
|
+
"react-native-reanimated": "~3.3.0",
|
113
|
+
"react-native-safe-area-context": "4.6.3",
|
114
|
+
"react-native-screens": "~3.22.0",
|
115
|
+
"react-native-svg": "13.9.0",
|
116
|
+
"react-native-web": "~0.19.6",
|
117
|
+
"react-native-webview": "13.2.2",
|
118
|
+
"react-virtuoso": "^4.5.1",
|
119
|
+
"sharp-cli": "^4.1.1",
|
120
|
+
"tippy.js": "^6.3.7",
|
121
|
+
"websql": "^2.0.3",
|
122
|
+
"xlsx": "^0.18.5"
|
123
|
+
},
|
124
|
+
"devDependencies": {
|
125
|
+
"@expo/metro-config": "^0.10.7",
|
126
|
+
"@expo/webpack-config": "^19.0.0",
|
127
|
+
"babel-plugin-inline-dotenv": "^1.7.0",
|
128
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
129
|
+
"uninstall": "^0.0.0"
|
130
|
+
}
|
131
|
+
}
|
package/src/App.js
CHANGED
@@ -1,175 +1,20 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
import {isTouchDevice} from "$platform";
|
16
|
-
import * as Utils from "$cutils";
|
17
|
-
import {useContext} from "$econtext/hooks";
|
18
|
-
import appConfig from "$capp/config";
|
19
|
-
import { useKeepAwake } from 'expo-keep-awake';
|
1
|
+
import Provider from "$econtext/Provider";
|
2
|
+
import App from "./AppEntry";
|
3
|
+
/****
|
4
|
+
* les options sont de la forme :
|
5
|
+
* {
|
6
|
+
* @param init {function} ()=>Promise<{}>, initialise l'application, lorsque la promèsse n'est pas résolue, alors l'application considère qu'il s'agit d'une étape pour l'écran de GetStarted dans ce cas,
|
7
|
+
* l'option la route getStartedRouteName est utilisée comme route par défaut de l'application
|
8
|
+
* @param initialRouteName {string} la route initiale, par d'afaut Home, valide lorsque la promèsse résultat de la fonction init est résolue
|
9
|
+
* @param getStartedRouteName {string} la route de l'écran de GetStarted, valide lorsque la promèsse résultat de la fonction init n'est pas résolue
|
10
|
+
* L'écran de route getStartedRouteName prend en paramètre onGetStarted {function}, qui est appelée lorsque le contenu de l'écran GetStarted est affiché à l'utilisateur
|
11
|
+
* @maram {swrConfig}, les options supplémentaires à passer au gestinnaire swr
|
12
|
+
* les écrans d'initialisation doivent garder la propriété Start à true ou doivent avoir le groupe INTALL, pour spécifier que ce sont es écrans qui apparaissent lorsque l'application n'est pas initialisée
|
13
|
+
* }
|
14
|
+
*/
|
20
15
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
});
|
26
|
-
|
27
|
-
export default function getIndex({onMount,onUnmount,render,onRender,init}){
|
28
|
-
const {swrConfig} = useContext();
|
29
|
-
const isScreenFocusedRef = React.useRef(true);
|
30
|
-
isMobileNative() && useKeepAwake();
|
31
|
-
///garde pour chaque écran sa date de dernière activité
|
32
|
-
const screensRef = React.useRef({});//la liste des écrans actifs
|
33
|
-
const activeScreenRef = React.useRef('');
|
34
|
-
const prevActiveScreenRef = React.useRef('');
|
35
|
-
const appStateRef = React.useRef({});
|
36
|
-
const isKeyboardOpenRef = React.useRef(false);
|
37
|
-
React.useOnRender(onRender);
|
38
|
-
React.useEffect(()=>{
|
39
|
-
///la fonction de rappel lorsque le composant est monté
|
40
|
-
const onScreenFocus = ({sanitizedName})=>{
|
41
|
-
prevActiveScreenRef.current = activeScreenRef.current;
|
42
|
-
if(activeScreenRef.current){
|
43
|
-
screensRef.current[activeScreenRef.current] = null;
|
44
|
-
}
|
45
|
-
screensRef.current[sanitizedName] = new Date();
|
46
|
-
activeScreenRef.current = sanitizedName;
|
47
|
-
isScreenFocusedRef.current = true;
|
48
|
-
}, onScreenBlur = ()=>{
|
49
|
-
isScreenFocusedRef.current = false;
|
50
|
-
}
|
51
|
-
APP.on(APP.EVENTS.SCREEN_FOCUS,onScreenFocus);
|
52
|
-
APP.on(APP.EVENTS.SCREEN_BLUR,onScreenBlur);
|
53
|
-
const triggerKeyboardToggle = (status)=>{
|
54
|
-
APP.trigger(APP.EVENTS.KEYBOARD_DID_TOGGLE,{shown:status,status,visible:status,hide : !status});
|
55
|
-
}
|
56
|
-
const keyBoardDidShow = ()=>{
|
57
|
-
APP.trigger(APP.EVENTS.KEYBOARD_DID_SHOW);
|
58
|
-
triggerKeyboardToggle(true);
|
59
|
-
},keyBoardDidHide = ()=>{
|
60
|
-
APP.trigger(APP.EVENTS.KEYBOARD_DID_HIDE);
|
61
|
-
triggerKeyboardToggle(false);
|
62
|
-
}
|
63
|
-
const keyBoardDidShowListener = Keyboard.addListener("keyboardDidShow",keyBoardDidShow);
|
64
|
-
const keyBoardDidHideListener = Keyboard.addListener("keyboardDidHide",keyBoardDidHide);
|
65
|
-
const listener = isTouchDevice() && typeof window !=='undefined' && window && window.visualViewport && typeof window.visualViewport.addEventListener =='function'?
|
66
|
-
() => {
|
67
|
-
const minKeyboardHeight = 300;
|
68
|
-
const screen = Dimensions.get("screen");
|
69
|
-
const newState = screen.height - minKeyboardHeight > window.visualViewport.height
|
70
|
-
if (isKeyboardOpenRef.current != newState) {
|
71
|
-
isKeyboardOpenRef.current = newState;
|
72
|
-
newState ? keyBoardDidShow() : keyBoardDidHide();
|
73
|
-
}
|
74
|
-
} : undefined;
|
75
|
-
if(listener){
|
76
|
-
window.visualViewport.addEventListener('resize', listener);
|
77
|
-
}
|
78
|
-
return ()=>{
|
79
|
-
APP.off(APP.EVENTS.SCREEN_FOCUS,onScreenFocus);
|
80
|
-
APP.off(APP.EVENTS.SCREEN_BLUR,onScreenBlur);
|
81
|
-
keyBoardDidShowListener && keyBoardDidShowListener.remove && keyBoardDidShowListener.remove();
|
82
|
-
keyBoardDidHideListener && keyBoardDidHideListener.remove && keyBoardDidHideListener.remove();
|
83
|
-
if(listener){
|
84
|
-
window.visualViewport.removeEventListener('resize', listener);
|
85
|
-
}
|
86
|
-
if(typeof onUnmount =='function'){
|
87
|
-
onUnmount();
|
88
|
-
}
|
89
|
-
}
|
90
|
-
},[])
|
91
|
-
|
92
|
-
return (
|
93
|
-
<SWRConfig
|
94
|
-
value={{
|
95
|
-
...swrConfig,
|
96
|
-
provider: () => new Map(),
|
97
|
-
isOnline() {
|
98
|
-
/* Customize the network state detector */
|
99
|
-
if(canFetchOffline) return true;
|
100
|
-
return APP.isOnline();
|
101
|
-
},
|
102
|
-
isVisible() {
|
103
|
-
const screen = activeScreenRef.current;
|
104
|
-
if(!screen) return false;
|
105
|
-
if(!screensRef.current[screen]){
|
106
|
-
screensRef.current[screen] = new Date();
|
107
|
-
return false;
|
108
|
-
}
|
109
|
-
const date = screensRef.current[screen];
|
110
|
-
const diff = new Date().getTime() - date.getTime();
|
111
|
-
const timeout = defaultNumber(swrConfig.refreshTimeout,SWR_REFRESH_TIMEOUT)
|
112
|
-
screensRef.current[screen] = new Date();
|
113
|
-
return diff >= timeout ? true : false;
|
114
|
-
},
|
115
|
-
initFocus(callback) {
|
116
|
-
let appState = AppState.currentState
|
117
|
-
const onAppStateChange = (nextAppState) => {
|
118
|
-
/* If it's resuming from background or inactive mode to active one */
|
119
|
-
const active = appState.match(/inactive|background/) && nextAppState === 'active';
|
120
|
-
if (active) {
|
121
|
-
callback()
|
122
|
-
}
|
123
|
-
appState = nextAppState;
|
124
|
-
appStateRef.current = !!active;
|
125
|
-
}
|
126
|
-
// Subscribe to the app state change events
|
127
|
-
const subscription = AppState.addEventListener('change', onAppStateChange);
|
128
|
-
return () => {
|
129
|
-
subscription?.remove()
|
130
|
-
}
|
131
|
-
},
|
132
|
-
initReconnect(cb) {
|
133
|
-
const callback = ()=>{
|
134
|
-
cb();
|
135
|
-
}
|
136
|
-
/* Register the listener with your state provider */
|
137
|
-
APP.on(APP.EVENTS.GO_ONLINE,callback);
|
138
|
-
return ()=>{
|
139
|
-
APP.off(APP.EVENTS.GO_ONLINE,callback);
|
140
|
-
}
|
141
|
-
}
|
142
|
-
}}
|
143
|
-
>
|
144
|
-
<Index onMount={onMount} render={render} onUnmount={onUnmount} onRender={onRender} init={init}/>
|
145
|
-
</SWRConfig>
|
146
|
-
);
|
147
|
-
};
|
148
|
-
|
149
|
-
setDeviceIdRef.current = ()=>{
|
150
|
-
return new Promise((resolve,reject)=>{
|
151
|
-
showPrompt({
|
152
|
-
title : 'ID unique pour l\'appareil',
|
153
|
-
maxLength : 30,
|
154
|
-
defaultValue : appConfig.getDeviceId(),
|
155
|
-
yes : 'Définir',
|
156
|
-
placeholder : isMobileNative()? "":'Entrer une valeur unique sans espace SVP',
|
157
|
-
no : 'Annuler',
|
158
|
-
onSuccess : ({value})=>{
|
159
|
-
let message = null;
|
160
|
-
if(!value || value.contains(" ")){
|
161
|
-
message = "Merci d'entrer une valeur non nulle ne contenant pas d'espace";
|
162
|
-
}
|
163
|
-
if(value.length > 30){
|
164
|
-
message = "la valeur entrée doit avoir au plus 30 caractères";
|
165
|
-
}
|
166
|
-
if(message){
|
167
|
-
notify.error(message);
|
168
|
-
return reject({message})
|
169
|
-
}
|
170
|
-
resolve(value);
|
171
|
-
notify.success("la valeur ["+value+"] a été définie comme identifiant unique pour l'application instalée sur cet appareil");
|
172
|
-
}
|
173
|
-
})
|
174
|
-
})
|
16
|
+
export default function ExpoUIAppEntryProvider({onMount,onUnmount,onRender,render,swrConfig,init,...rest}){
|
17
|
+
return <Provider {...rest}>
|
18
|
+
<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>
|
19
|
+
</Provider>
|
175
20
|
}
|