@fto-consult/expo-ui 6.39.1 → 6.40.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/babel.config.alias.js +2 -11
- package/babel.config.js +1 -1
- package/bin/create-app/App.js +4 -11
- package/find-licenses.js +20 -2
- package/package.json +2 -2
- package/src/App.js +2 -2
- package/src/AppEntry/App.js +1 -10
- package/src/AppEntry/index.js +2 -3
- package/src/context/Provider.js +1 -0
- package/src/navigation/index.js +3 -1
- package/src/screens/Help/openLibraries.js +1 -1
package/babel.config.alias.js
CHANGED
@@ -75,18 +75,9 @@ module.exports = (opts)=>{
|
|
75
75
|
///le chemin racine du projet expo-ui
|
76
76
|
r["$expo-ui-root-path"] = r["$expo-ui-root"]= path.resolve(expo,"..");
|
77
77
|
|
78
|
-
|
78
|
+
|
79
79
|
///on génère les librairies open sources utilisées par l'application
|
80
|
-
|
81
|
-
const nModulePath = isLocalDev ? path.resolve(__dirname,"node_modules") : fs.existsSync(path.resolve(root,"node_modules")) && path.resolve(root,"node_modules") || fs.existsSync(path.resolve(r.$src,"node_modules")) && path.resolve(r.$src,"node_modules") || path.resolve(projectRoot,"node_modules");
|
82
|
-
const nodeModulesPath = fs.existsSync(nModulePath) ? nModulePath : path.resolve(process.cwd(),"node_modules");
|
83
|
-
const outputPath = path.resolve(HelpScreen,"openLibraries.js");
|
84
|
-
r.$nodeModulesPath = r.$enodeModulesPath= nodeModulesPath;
|
85
|
-
require("./find-licenses")({
|
86
|
-
paths : [root,r["$expo-ui-root-path"],path.resolve(process.cwd())],
|
87
|
-
nodeModulesPath : nodeModulesPath,
|
88
|
-
outputPath
|
89
|
-
});
|
80
|
+
require("./find-licenses");
|
90
81
|
const $assets = r.$assets;
|
91
82
|
const $electron = path.resolve(dir,"electron");
|
92
83
|
const electronPaths = {
|
package/babel.config.js
CHANGED
@@ -23,7 +23,7 @@ module.exports = function(api,opts) {
|
|
23
23
|
const packageRootPath = path.resolve(process.cwd(),"package.json");
|
24
24
|
const packageJSON = fs.existsSync(packageRootPath) && require(`${packageRootPath}`) || {};
|
25
25
|
const envObj = require("./parse-env")();
|
26
|
-
const projetRootConfig = path.resolve(process.cwd(),"expo-ui.
|
26
|
+
const projetRootConfig = path.resolve(process.cwd(),"expo-ui.json");
|
27
27
|
const writeFilePath = path.resolve($eelectron,"utils","writeFile.js");
|
28
28
|
if(!fs.existsSync(projetRootConfig)){
|
29
29
|
try {
|
package/bin/create-app/App.js
CHANGED
@@ -8,7 +8,8 @@ export default function AppMainEntry(){
|
|
8
8
|
navigation = { {
|
9
9
|
//all application screeens
|
10
10
|
screens,
|
11
|
-
drawerItems, //application main drawer items
|
11
|
+
drawerItems, //application main drawer items,
|
12
|
+
screenOptions : {},//les options du composant Stack.Navigator de react-navigation, voir https://reactnavigation.org/docs/native-stack-navigator/
|
12
13
|
}}
|
13
14
|
components = {{
|
14
15
|
logo : Logo,//logo component's properties
|
@@ -24,17 +25,9 @@ export default function AppMainEntry(){
|
|
24
25
|
init = {function({appConfig}){
|
25
26
|
return Promise.resolve("app is initialized");
|
26
27
|
}}
|
27
|
-
/**
|
28
|
-
* //when main application component is mounted
|
29
|
-
*/
|
30
|
-
onMount = {function(){}}
|
31
|
-
/****when main application component is unmounted*/
|
32
|
-
onUnmount = {function(){}}
|
33
|
-
/**** called any time main application's component is rendered */
|
34
|
-
onRender = {function(){}}
|
35
28
|
/*** if you need to wrap main application content with some custom react Provider*/
|
36
|
-
|
37
|
-
return
|
29
|
+
render = {function({render,appConfig}){
|
30
|
+
return render;
|
38
31
|
}}
|
39
32
|
/>
|
40
33
|
}
|
package/find-licenses.js
CHANGED
@@ -59,7 +59,8 @@ const findLicences = (projectPath,nodeModulesPath)=> {
|
|
59
59
|
}
|
60
60
|
}
|
61
61
|
}
|
62
|
-
|
62
|
+
|
63
|
+
const findLicencesMain = (options)=>{
|
63
64
|
options = typeof options =='string'? {path:options} : typeof options =='object' && options ? options : {};
|
64
65
|
if(!options || typeof options !='object'){
|
65
66
|
options = {};
|
@@ -68,6 +69,7 @@ module.exports = (options)=>{
|
|
68
69
|
const outputDir = outputPath && typeof outputPath =='string' && path.dirname(outputPath) || '';
|
69
70
|
if(outputDir && fs.existsSync(outputDir)){
|
70
71
|
openLibraries = {};
|
72
|
+
findLicences(path.resolve(__dirname),path.resolve(__dirname,"node_modules"));
|
71
73
|
if(Array.isArray(options.paths)){
|
72
74
|
options.paths.map((p)=>{
|
73
75
|
if(p && typeof p =='string' && fs.existsSync(p)){
|
@@ -101,4 +103,20 @@ module.exports = (options)=>{
|
|
101
103
|
message : "Le chemin du fichier output est innexistant. veuillez spécifier un chemin de fichier existant dans lequel seront générées les licences utilisées pour le développement de l'application"
|
102
104
|
});
|
103
105
|
}
|
104
|
-
}
|
106
|
+
}
|
107
|
+
|
108
|
+
module.exports = ()=>{
|
109
|
+
///on génère les librairies open sources utilisées par l'application
|
110
|
+
const root = path.resolve(process.cwd());
|
111
|
+
const expoUI = require("./expo-ui-path")();
|
112
|
+
const localNodeModule = path.resolve(root,"node_modules");
|
113
|
+
const HelpScreen = path.resolve(expoUI,"src","screens","Help");
|
114
|
+
const outputPath = path.resolve(HelpScreen,"openLibraries.js");
|
115
|
+
return findLicencesMain({
|
116
|
+
paths : [root,path.resolve(process.cwd())],
|
117
|
+
nodeModulesPath : fs.existsSync(localNodeModule) ? localNodeModule : path.resolve(expoUI,"node_modules"),
|
118
|
+
outputPath
|
119
|
+
});
|
120
|
+
}
|
121
|
+
|
122
|
+
module.exports();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.40.2",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"main": "main",
|
6
6
|
"scripts": {
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"update-appexchart": "npm run update-apexchart",
|
46
46
|
"delete-node-modules": "rimraf ./**/node_modules",
|
47
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-navigation/stack 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"
|
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-navigation/stack 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 && npm run find-licenses"
|
49
49
|
},
|
50
50
|
"bin": {
|
51
51
|
"expo-ui": "./bin/index.js"
|
package/src/App.js
CHANGED
@@ -13,8 +13,8 @@ import App from "./AppEntry";
|
|
13
13
|
* }
|
14
14
|
*/
|
15
15
|
|
16
|
-
export default function ExpoUIAppEntryProvider({
|
16
|
+
export default function ExpoUIAppEntryProvider({swrConfig,children,init,...rest}){
|
17
17
|
return <Provider {...rest}>
|
18
|
-
<App init={init}
|
18
|
+
<App init={init} children={children}/>
|
19
19
|
</Provider>
|
20
20
|
}
|
package/src/AppEntry/App.js
CHANGED
@@ -61,7 +61,7 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
|
|
61
61
|
* initialRouteName : la route initiale par défaut
|
62
62
|
* getStartedRouteName : la route par défaut de getStarted lorsque l'application est en mode getStarted, c'est à dire lorsque la fonction init renvoie une erreur (reject)
|
63
63
|
*/
|
64
|
-
function App({init:initApp,initialRouteName:appInitialRouteName,render
|
64
|
+
function App({init:initApp,initialRouteName:appInitialRouteName,render}) {
|
65
65
|
AppStateService.init();
|
66
66
|
const {FontsIconsFilter,beforeExit,preferences:appPreferences,navigation,getStartedRouteName} = useContext();
|
67
67
|
const {containerProps} = navigation;
|
@@ -248,15 +248,6 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
248
248
|
...defaultObj(pref),
|
249
249
|
}),[theme,pref]);
|
250
250
|
const isLoaded = !isLoading;
|
251
|
-
const prevIsLoaded = React.usePrevious(isLoaded);
|
252
|
-
const onMountRef = React.useRef(false);
|
253
|
-
React.useEffect(()=>{
|
254
|
-
if(prevIsLoaded == isLoaded || !isLoaded || onMountRef.current) return;
|
255
|
-
if(typeof onMount ==='function'){
|
256
|
-
onMount({appConfig});
|
257
|
-
onMountRef.current = true;
|
258
|
-
}
|
259
|
-
},[isLoaded])
|
260
251
|
const child = isLoaded ? <NavigationContainer
|
261
252
|
ref={navigationRef}
|
262
253
|
initialState={initialState}
|
package/src/AppEntry/index.js
CHANGED
@@ -24,7 +24,7 @@ Object.map(Utils,(v,i)=>{
|
|
24
24
|
}
|
25
25
|
});
|
26
26
|
|
27
|
-
export default function getIndex({
|
27
|
+
export default function getIndex({render,init}){
|
28
28
|
const {swrConfig} = useContext();
|
29
29
|
const isScreenFocusedRef = React.useRef(true);
|
30
30
|
isMobileNative() && useKeepAwake();
|
@@ -34,7 +34,6 @@ export default function getIndex({onMount,onUnmount,render,onRender,init}){
|
|
34
34
|
const prevActiveScreenRef = React.useRef('');
|
35
35
|
const appStateRef = React.useRef({});
|
36
36
|
const isKeyboardOpenRef = React.useRef(false);
|
37
|
-
React.useOnRender(onRender);
|
38
37
|
React.useEffect(()=>{
|
39
38
|
///la fonction de rappel lorsque le composant est monté
|
40
39
|
const onScreenFocus = ({sanitizedName})=>{
|
@@ -141,7 +140,7 @@ export default function getIndex({onMount,onUnmount,render,onRender,init}){
|
|
141
140
|
}
|
142
141
|
}}
|
143
142
|
>
|
144
|
-
<App
|
143
|
+
<App init={init} render={render}/>
|
145
144
|
</SWRConfig>
|
146
145
|
);
|
147
146
|
};
|
package/src/context/Provider.js
CHANGED
@@ -36,6 +36,7 @@ import { prepareScreens } from "./TableData";
|
|
36
36
|
},
|
37
37
|
navigation : {
|
38
38
|
screens : {Array}, les écrans de navigation,
|
39
|
+
screenOptions : {object}, les options du composant Stack.Navigator, voir https://reactnavigation.org/docs/native-stack-navigator/
|
39
40
|
drawerItems : {object|array|function}, la fonction permettant d'obtenir les items du drawer principal de l'application,
|
40
41
|
containerProps : {object}, les props à passer au composant NavigationContainer de react-navigation
|
41
42
|
},
|
package/src/navigation/index.js
CHANGED
@@ -8,6 +8,7 @@ import { MainNavigationProvider } from "./hooks";
|
|
8
8
|
import {isWeb,isAndroid} from "$cplatform";
|
9
9
|
import Stack from "./Stack";
|
10
10
|
import theme from "$theme";
|
11
|
+
import {defaultObj} from "$cutils";
|
11
12
|
|
12
13
|
export * from "./hooks";
|
13
14
|
|
@@ -19,7 +20,7 @@ export * from "./utils";
|
|
19
20
|
export default function NavigationComponent (props){
|
20
21
|
let {state,hasGetStarted,isLoading,onGetStart,initialRouteName,...rest} = props;
|
21
22
|
if(isLoading) return null;
|
22
|
-
const {navigation:{screens}} = useContext();
|
23
|
+
const {navigation:{screens,screenOptions}} = useContext();
|
23
24
|
const allScreens = initScreens({Factory:Stack,screens,ModalFactory:Stack,filter:({name})=>{
|
24
25
|
return true;
|
25
26
|
}});
|
@@ -36,6 +37,7 @@ export default function NavigationComponent (props){
|
|
36
37
|
headerStyle: { backgroundColor: theme.colors.primary},
|
37
38
|
presentation : isAndroid() || isWeb()? "modal":"default",
|
38
39
|
animationEnabled : !isWeb(),
|
40
|
+
...Object.assign({},screenOptions)
|
39
41
|
}
|
40
42
|
const cardStyle = { backgroundColor: 'transparent' };
|
41
43
|
if(isWeb()){
|
@@ -1 +1 @@
|
|
1
|
-
module.exports = {"@fto-consult/expo-ui":{"version":"6.39.
|
1
|
+
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.39.2","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.39.1","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.7","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.13","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@react-navigation/stack":{"version":"6.3.17","url":"https://reactnavigation.org/docs/stack-navigator/","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.42.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.11","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.4","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sqlite":{"version":"11.3.3","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"is-plain-obj":{"version":"4.1.0","license":"MIT"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.4","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.10.4","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.19.3","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.8","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.5.1","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"4.1.1","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"uninstall":{"version":"0.0.0","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};
|