@fto-consult/expo-ui 7.5.37 → 7.5.39

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/bin/index.js CHANGED
@@ -53,7 +53,7 @@ program.command('electron')
53
53
  .option('-b, --build [boolean]', 'si ce flag est spécfifié alors l\'application sera compilée; combinée avec la commande start|package pour indiquer que l\'application sera à nouveau exportée ou pas.')
54
54
  .option('-a, --arch [architecture]', 'l\'architecture de la plateforme; Commande package')
55
55
  .option('-p, --platform [platform]', 'la plateforme à utiliser pour la compilation; commande package')
56
- .option('-l, --icon [iconPath]', 'le chemin vers l\'icon de l\'application : (.ico pour window, .incs pour mac et .png pour linux)')
56
+ .option('-l, --icon [iconPath]', 'le chemin vers le dossier des icones de l\'application : (Dans ce dossier, doit contenir une image icon.ico pour window, icon.incs pour mac et icon.png pour linux)')
57
57
  .option('-i, --import [boolean]', 'la commande d\'initialisation du package electron forge, utile pour le packaging de l\'application. Elle permet d\'exécuter le cli electron package, pour l\'import d\'un projet existant. Commande package. exemple : expo-ui electron package --import')
58
58
 
59
59
  .action((script, options) => {
@@ -9,12 +9,7 @@ module.exports = ({electronProjectRoot,force,logo,appName})=>{
9
9
  }
10
10
  const indexPath = path.resolve(electronProjectRoot,"index.js");
11
11
  if(!fs.existsSync(indexPath) || force === true){
12
- writeFile(indexPath,`
13
- require("${packageJSON.name}/electron")({
14
- projectRoot : __dirname,
15
- appName : "${appName}",
16
- logo : ${logo ? `"${logo}"` : undefined},
17
- });`);
12
+ writeFile(indexPath,`require("${packageJSON.name}/electron");`);
18
13
  }
19
14
  return indexPath;
20
15
  }
package/electron/index.js CHANGED
@@ -12,15 +12,20 @@ const isObj = x => x && typeof x =='object';
12
12
 
13
13
  let appIsReady = false;
14
14
 
15
+ const iconName = process.platform =="win32" ? "icon.ico" : process.platform =='darwin' ? "icon.incs" : "icon.png";
16
+
15
17
  program
16
18
  .option('-u, --url <url>', 'L\'adresse url à ouvrir au lancement de l\'application')
17
19
  .option('-r, --root <projectRoot>', 'le chemin du project root de l\'application')
18
- .option('-l, --icon [iconPath]', 'le chemin vers le icon de l\'application : (.ico pour window, .incs pour mac et .png pour linux)')
20
+ .option('-l, --icon [iconPath]', 'le chemin vers le dossier des icones de l\'application : (Dans ce dossier, doit contenir une image icon.ico pour window, icon.incs pour mac et icon.png pour linux)')
19
21
  .parse();
20
22
 
21
23
  const programOptions = program.opts();
22
24
  const {url:pUrl,root:mainProjectRoot,icon} = programOptions;
23
- const iconPath = icon && typeof icon =="string" && fs.existsSync(path.resolve(icon)) && path.resolve(icon) || undefined;
25
+ let iconPath = icon && typeof icon =="string" && fs.existsSync(path.resolve(icon)) && path.resolve(icon) || undefined;
26
+ if(iconPath && fs.existsSync(path.resolve(iconPath,iconName))){
27
+ iconPath = path.resolve(iconPath,iconName);
28
+ }
24
29
 
25
30
  const isAsar = (typeof require.main =="string" && require.main ||"").indexOf('app.asar') !== -1;
26
31
  const distPath = path.join("dist",'index.html');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.5.37",
3
+ "version": "7.5.39",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -72,9 +72,7 @@ export default function UserProfileScreen({fields,...p}){
72
72
  const toSave = {...user,...data};
73
73
  return Auth.upsertUser(toSave,true).then((response)=>{
74
74
  setTimeout(()=>{
75
- if(hasChangeRef.current){
76
- APP.trigger(APP.EVENTS.UPDATE_THEME,user.theme);
77
- }
75
+ APP.trigger(APP.EVENTS.UPDATE_THEME,user.theme);
78
76
  APP.trigger(APP.EVENTS.AUTH_UPDATE_PROFILE,toSave);
79
77
  },100);
80
78
  if(typeof props.onSave ==='function' && props.onSave({...rest,data:toSave,response,goBack,navigate}) === false) return;