@fto-consult/expo-ui 3.2.0 → 3.3.0
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 +4 -7
- package/bin/electron/index copy.js +48 -0
- package/bin/electron/index.js +11 -0
- package/bin/electron/scripts/customize.js +21 -0
- package/bin/electron/scripts/start.js +8 -0
- package/electron/webpack.config.js +84 -0
- package/electron/webpack.config.old.js +45 -0
- package/is-os-case-sensitive.js +27 -0
- package/package.json +4 -4
- package/src/auth/Login.js +19 -4
- package/src/components/Avatar/AutoHeightImage/index.js +11 -8
- package/src/components/Countries/resources/countries-normalized.json +1987 -1987
- package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
- package/src/components/Countries/resources/countries.sql +243 -243
- package/src/components/Image/index.js +1 -1
- package/writeFile.js +16 -0
- package/bin/index.js +0 -92
- package/bin/parseArgs.js +0 -18
- package/electron/copyDir.js +0 -18
- package/electron/createDir.js +0 -14
- package/electron/dist/asset-manifest.json +0 -221
- package/electron/dist/favicon-16.png +0 -0
- package/electron/dist/favicon-32.png +0 -0
- package/electron/dist/favicon.ico +0 -0
- package/electron/dist/fonts/AntDesign.ttf +0 -0
- package/electron/dist/fonts/FontAwesome5_Brands.ttf +0 -0
- package/electron/dist/fonts/FontAwesome5_Solid.ttf +0 -0
- package/electron/dist/fonts/Fontisto.ttf +0 -0
- package/electron/dist/fonts/Foundation.ttf +0 -0
- package/electron/dist/fonts/Ionicons.ttf +0 -0
- package/electron/dist/fonts/MaterialCommunityIcons.ttf +0 -0
- package/electron/dist/fonts/MaterialIcons.ttf +0 -0
- package/electron/dist/fonts/SimpleLineIcons.ttf +0 -0
- package/electron/dist/index.html +0 -1
- package/electron/dist/manifest.json +0 -35
- package/electron/dist/pwa/apple-touch-icon/apple-touch-icon-180.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1125x2436.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2208.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2688.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1536x2048.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2224.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2388.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-2048x2732.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-640x1136.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-750x1334.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-828x1792.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-144.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-192.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-512.png +0 -0
- package/electron/dist/serve.json +0 -13
- package/electron/dist/static/js/2.e3d2de23.chunk.js +0 -2
- package/electron/dist/static/js/2.e3d2de23.chunk.js.LICENSE.txt +0 -118
- package/electron/dist/static/js/app.6a0a3d72.chunk.js +0 -1
- package/electron/dist/static/js/runtime~app.318494c4.js +0 -1
- package/electron/dist/static/media/ad.897c877d.png +0 -0
- package/electron/dist/static/media/add_photo.255dd6dd.png +0 -0
- package/electron/dist/static/media/af.9d0ab233.png +0 -0
- package/electron/dist/static/media/ag.152f8fb1.png +0 -0
- package/electron/dist/static/media/ai.81342ed3.png +0 -0
- package/electron/dist/static/media/al.3ba17dc1.png +0 -0
- package/electron/dist/static/media/ao.ff6d0e82.png +0 -0
- package/electron/dist/static/media/ar.a157e7e8.png +0 -0
- package/electron/dist/static/media/as.af7d5792.png +0 -0
- package/electron/dist/static/media/au.d8b2590e.png +0 -0
- package/electron/dist/static/media/aw.27c4c0ae.png +0 -0
- package/electron/dist/static/media/ax.568ed280.png +0 -0
- package/electron/dist/static/media/az.bb76a7dc.png +0 -0
- package/electron/dist/static/media/ba.0e3d844b.png +0 -0
- package/electron/dist/static/media/bb.4466d275.png +0 -0
- package/electron/dist/static/media/bd.56c6c3f7.png +0 -0
- package/electron/dist/static/media/bf.fb7bf643.png +0 -0
- package/electron/dist/static/media/bi.82121bd1.png +0 -0
- package/electron/dist/static/media/bl.c4f6b8c1.png +0 -0
- package/electron/dist/static/media/black-gradient-rotated.693a1835.png +0 -0
- package/electron/dist/static/media/bm.2b05930c.png +0 -0
- package/electron/dist/static/media/bn.fa1d112b.png +0 -0
- package/electron/dist/static/media/br.0bdb59a4.png +0 -0
- package/electron/dist/static/media/bs.cf3fb4b9.png +0 -0
- package/electron/dist/static/media/bt.f7bc1b24.png +0 -0
- package/electron/dist/static/media/by.aa680616.png +0 -0
- package/electron/dist/static/media/bz.94f967a4.png +0 -0
- package/electron/dist/static/media/ca.83c317eb.png +0 -0
- package/electron/dist/static/media/cc.7adb7e83.png +0 -0
- package/electron/dist/static/media/cd.829a5467.png +0 -0
- package/electron/dist/static/media/cf.05804c68.png +0 -0
- package/electron/dist/static/media/cg.6142b05b.png +0 -0
- package/electron/dist/static/media/ck.e6517d3a.png +0 -0
- package/electron/dist/static/media/cl.fedf287b.png +0 -0
- package/electron/dist/static/media/cm.13460532.png +0 -0
- package/electron/dist/static/media/cn.cb27a726.png +0 -0
- package/electron/dist/static/media/color-wheel.233ad67a.png +0 -0
- package/electron/dist/static/media/cu.c87a4974.png +0 -0
- package/electron/dist/static/media/cv.df006f17.png +0 -0
- package/electron/dist/static/media/cw.5600a05a.png +0 -0
- package/electron/dist/static/media/cx.3a1ed4dd.png +0 -0
- package/electron/dist/static/media/cy.cf9ba1fd.png +0 -0
- package/electron/dist/static/media/cz.52a635d1.png +0 -0
- package/electron/dist/static/media/dj.97fab2d0.png +0 -0
- package/electron/dist/static/media/dm.cffeea69.png +0 -0
- package/electron/dist/static/media/do.4446e007.png +0 -0
- package/electron/dist/static/media/dz.2a4f02c8.png +0 -0
- package/electron/dist/static/media/ec.de3c8959.png +0 -0
- package/electron/dist/static/media/eg.995e438f.png +0 -0
- package/electron/dist/static/media/eh.df6ab877.png +0 -0
- package/electron/dist/static/media/er.c9c33d69.png +0 -0
- package/electron/dist/static/media/es.02bde626.png +0 -0
- package/electron/dist/static/media/et.97067753.png +0 -0
- package/electron/dist/static/media/fj.d9ffe455.png +0 -0
- package/electron/dist/static/media/fk.56b62350.png +0 -0
- package/electron/dist/static/media/fm.a7a0ab08.png +0 -0
- package/electron/dist/static/media/fo.8c98723b.png +0 -0
- package/electron/dist/static/media/gb.e2dc562c.png +0 -0
- package/electron/dist/static/media/gd.e018fcab.png +0 -0
- package/electron/dist/static/media/ge.a23ea813.png +0 -0
- package/electron/dist/static/media/gf.46575309.png +0 -0
- package/electron/dist/static/media/gg.b6dec865.png +0 -0
- package/electron/dist/static/media/gh.791206c9.png +0 -0
- package/electron/dist/static/media/gi.691dc59f.png +0 -0
- package/electron/dist/static/media/gp.9f13aec5.png +0 -0
- package/electron/dist/static/media/gq.ac167f44.png +0 -0
- package/electron/dist/static/media/gt.ac025893.png +0 -0
- package/electron/dist/static/media/gu.f6b1f79f.png +0 -0
- package/electron/dist/static/media/gw.c1155330.png +0 -0
- package/electron/dist/static/media/gy.8807a5cd.png +0 -0
- package/electron/dist/static/media/hk.ace33e25.png +0 -0
- package/electron/dist/static/media/hn.a9dbb8c7.png +0 -0
- package/electron/dist/static/media/hr.154eb536.png +0 -0
- package/electron/dist/static/media/ht.f2777c6f.png +0 -0
- package/electron/dist/static/media/il.1e46d4c0.png +0 -0
- package/electron/dist/static/media/im.0cd40434.png +0 -0
- package/electron/dist/static/media/in.7b42511c.png +0 -0
- package/electron/dist/static/media/io.a66fbed7.png +0 -0
- package/electron/dist/static/media/iq.95e38849.png +0 -0
- package/electron/dist/static/media/ir.63bb306b.png +0 -0
- package/electron/dist/static/media/je.9bb61268.png +0 -0
- package/electron/dist/static/media/jm.cb108953.png +0 -0
- package/electron/dist/static/media/jo.68d39a37.png +0 -0
- package/electron/dist/static/media/jp.c7ac0358.png +0 -0
- package/electron/dist/static/media/ke.43bc8ed5.png +0 -0
- package/electron/dist/static/media/kg.44ff839a.png +0 -0
- package/electron/dist/static/media/kh.f2be65a8.png +0 -0
- package/electron/dist/static/media/ki.a5251ff4.png +0 -0
- package/electron/dist/static/media/km.e3509f11.png +0 -0
- package/electron/dist/static/media/kn.2aa7e9f4.png +0 -0
- package/electron/dist/static/media/kp.bafa6d30.png +0 -0
- package/electron/dist/static/media/kr.eddab993.png +0 -0
- package/electron/dist/static/media/ks.482617ea.png +0 -0
- package/electron/dist/static/media/kw.c9acc015.png +0 -0
- package/electron/dist/static/media/ky.b28eed47.png +0 -0
- package/electron/dist/static/media/kz.705cf40b.png +0 -0
- package/electron/dist/static/media/la.eaa60883.png +0 -0
- package/electron/dist/static/media/lb.f12e48b3.png +0 -0
- package/electron/dist/static/media/lc.c3040f1b.png +0 -0
- package/electron/dist/static/media/li.9ff57114.png +0 -0
- package/electron/dist/static/media/lk.668fa761.png +0 -0
- package/electron/dist/static/media/lr.08a3ba29.png +0 -0
- package/electron/dist/static/media/ls.4bcf7705.png +0 -0
- package/electron/dist/static/media/ly.42eee630.png +0 -0
- package/electron/dist/static/media/ma.728f368e.png +0 -0
- package/electron/dist/static/media/md.c58d4da5.png +0 -0
- package/electron/dist/static/media/me.61434fc0.png +0 -0
- package/electron/dist/static/media/mh.84081090.png +0 -0
- package/electron/dist/static/media/mk.4c61eb33.png +0 -0
- package/electron/dist/static/media/mm.6d9513ec.png +0 -0
- package/electron/dist/static/media/mn.2919ee2b.png +0 -0
- package/electron/dist/static/media/mo.5097fc81.png +0 -0
- package/electron/dist/static/media/mp.92d6f5ae.png +0 -0
- package/electron/dist/static/media/mq.3dcb40dd.png +0 -0
- package/electron/dist/static/media/mr.49624c44.png +0 -0
- package/electron/dist/static/media/ms.6278c883.png +0 -0
- package/electron/dist/static/media/mt.6791f29d.png +0 -0
- package/electron/dist/static/media/mv.db8c2815.png +0 -0
- package/electron/dist/static/media/mw.bfe46c8a.png +0 -0
- package/electron/dist/static/media/mx.4143a6ea.png +0 -0
- package/electron/dist/static/media/my.3a9e0a16.png +0 -0
- package/electron/dist/static/media/mz.a9a7cad4.png +0 -0
- package/electron/dist/static/media/na.fb15ec16.png +0 -0
- package/electron/dist/static/media/nc.ca80861c.png +0 -0
- package/electron/dist/static/media/ne.66306a2b.png +0 -0
- package/electron/dist/static/media/nf.2087392a.png +0 -0
- package/electron/dist/static/media/ni.8a8af9c4.png +0 -0
- package/electron/dist/static/media/np.fcb697b2.png +0 -0
- package/electron/dist/static/media/nr.3df193fa.png +0 -0
- package/electron/dist/static/media/nu.36adcc05.png +0 -0
- package/electron/dist/static/media/nz.3f54cdbc.png +0 -0
- package/electron/dist/static/media/om.b705fe37.png +0 -0
- package/electron/dist/static/media/pa.c6eac52a.png +0 -0
- package/electron/dist/static/media/pf.fc525a54.png +0 -0
- package/electron/dist/static/media/pg.e74ec337.png +0 -0
- package/electron/dist/static/media/ph.07b69cb2.png +0 -0
- package/electron/dist/static/media/pk.2e6f6e4d.png +0 -0
- package/electron/dist/static/media/placeholder.b393bdf6.png +0 -0
- package/electron/dist/static/media/pm.a07b0fe5.png +0 -0
- package/electron/dist/static/media/pr.2a745d06.png +0 -0
- package/electron/dist/static/media/ps.dc835d4b.png +0 -0
- package/electron/dist/static/media/pt.1dac29ce.png +0 -0
- package/electron/dist/static/media/pw.39ee4879.png +0 -0
- package/electron/dist/static/media/py.79fe22b8.png +0 -0
- package/electron/dist/static/media/re.d61c1475.png +0 -0
- package/electron/dist/static/media/rs.98e0ba03.png +0 -0
- package/electron/dist/static/media/rw.a062e5ed.png +0 -0
- package/electron/dist/static/media/sa.d8b4fac4.png +0 -0
- package/electron/dist/static/media/sb.22cdaa99.png +0 -0
- package/electron/dist/static/media/sc.bfa8934e.png +0 -0
- package/electron/dist/static/media/sd.c17685b4.png +0 -0
- package/electron/dist/static/media/sg.d63e1e98.png +0 -0
- package/electron/dist/static/media/sh.3e4eba58.png +0 -0
- package/electron/dist/static/media/si.1aef990c.png +0 -0
- package/electron/dist/static/media/sk.744710e9.png +0 -0
- package/electron/dist/static/media/sm.2add86d0.png +0 -0
- package/electron/dist/static/media/sn.cd1d239a.png +0 -0
- package/electron/dist/static/media/so.59e58870.png +0 -0
- package/electron/dist/static/media/sr.4f2004a0.png +0 -0
- package/electron/dist/static/media/ss.4af3b81d.png +0 -0
- package/electron/dist/static/media/st.d51dc713.png +0 -0
- package/electron/dist/static/media/sv.7ae84ee8.png +0 -0
- package/electron/dist/static/media/sx.be650d49.png +0 -0
- package/electron/dist/static/media/sy.aff3aad3.png +0 -0
- package/electron/dist/static/media/sz.2d1d3b4d.png +0 -0
- package/electron/dist/static/media/tc.a260af55.png +0 -0
- package/electron/dist/static/media/tg.8f3da96a.png +0 -0
- package/electron/dist/static/media/tj.f75888d4.png +0 -0
- package/electron/dist/static/media/tk.565e8b1a.png +0 -0
- package/electron/dist/static/media/tl.e2a54e11.png +0 -0
- package/electron/dist/static/media/tm.c4300af4.png +0 -0
- package/electron/dist/static/media/tn.75753d15.png +0 -0
- package/electron/dist/static/media/tr.82e5dc1c.png +0 -0
- package/electron/dist/static/media/tt.987092e9.png +0 -0
- package/electron/dist/static/media/tv.9230640c.png +0 -0
- package/electron/dist/static/media/tw.c4a9d7d9.png +0 -0
- package/electron/dist/static/media/tz.1efa60a0.png +0 -0
- package/electron/dist/static/media/ug.a77c73ae.png +0 -0
- package/electron/dist/static/media/us.e2479214.png +0 -0
- package/electron/dist/static/media/uy.861eca98.png +0 -0
- package/electron/dist/static/media/uz.01ff6d78.png +0 -0
- package/electron/dist/static/media/va.27433401.png +0 -0
- package/electron/dist/static/media/vc.2cca122b.png +0 -0
- package/electron/dist/static/media/ve.af5a8b6b.png +0 -0
- package/electron/dist/static/media/vg.04a0bb4c.png +0 -0
- package/electron/dist/static/media/vi.23080fa1.png +0 -0
- package/electron/dist/static/media/vn.c4418522.png +0 -0
- package/electron/dist/static/media/vu.a9b9829b.png +0 -0
- package/electron/dist/static/media/wf.c9a34a89.png +0 -0
- package/electron/dist/static/media/ws.155d3921.png +0 -0
- package/electron/dist/static/media/za.45fc2a3d.png +0 -0
- package/electron/dist/static/media/zm.2a5e46b1.png +0 -0
- package/electron/dist/static/media/zw.44f54d41.png +0 -0
- package/electron/exec.js +0 -53
- package/electron/writeFile.js +0 -7
package/babel.config.alias.js
CHANGED
|
@@ -113,23 +113,20 @@ module.exports = (opts)=>{
|
|
|
113
113
|
});
|
|
114
114
|
const $assets = r.$assets;
|
|
115
115
|
const electronPaths = {
|
|
116
|
-
...r,
|
|
117
|
-
sourceCode : r.$src,
|
|
118
116
|
assets : $assets,
|
|
119
117
|
images : r.$images,
|
|
120
118
|
projectRoot : base,//la racine au projet
|
|
121
119
|
};
|
|
122
120
|
const electronAssetsPath = path.resolve(dir,"electron","assets");
|
|
123
121
|
if($assets){
|
|
124
|
-
const l1 = path.resolve($assets,"logo.png"), l2 = path.resolve($assets,"logo.png");
|
|
122
|
+
const l1 = path.resolve($assets,"logo.png"), l2 = path.resolve($assets,"images","logo.png");
|
|
125
123
|
const logoPath = fs.existsSync(l1)? l1 : fs.existsSync(l2)? l2 : undefined;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
fs.copyFileSync(logoPath,ePath,fs.constants.COPYFILE_FICLONE);
|
|
124
|
+
if(logoPath){
|
|
125
|
+
fs.copyFileSync(logoPath,path.resolve(electronAssetsPath,"images","logo.png"),fs.constants.COPYFILE_FICLONE);
|
|
129
126
|
electronPaths.logo = logoPath;
|
|
130
127
|
}
|
|
131
128
|
}
|
|
132
129
|
///on sauvegarde les chemins des fichiers utiles, qui seront utilisées par la variable electron plus tard
|
|
133
|
-
require("./
|
|
130
|
+
require("./writeFile")(path.resolve(dir,"electron","paths.json"),JSON.stringify(electronPaths));
|
|
134
131
|
return r;
|
|
135
132
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**@see : https://blog.shahednasser.com/how-to-create-a-npx-tool/ */
|
|
3
|
+
'use strict';
|
|
4
|
+
process.on('unhandledRejection', err => {
|
|
5
|
+
throw err;
|
|
6
|
+
});
|
|
7
|
+
const spawnAsync = require('cross-spawn').spawn;
|
|
8
|
+
const { realpathSync } = require('fs-extra');
|
|
9
|
+
|
|
10
|
+
//const { ensureMinProjectSetupAsync } = require('../build/Config');
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
|
|
14
|
+
const scriptIndex = args.findIndex(x => x === 'start' || x === 'customize');
|
|
15
|
+
const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
|
|
16
|
+
const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
|
|
17
|
+
console.log(args," is argggggg",script);
|
|
18
|
+
if (['start', 'customize'].includes(script)) {
|
|
19
|
+
spawnAsync(
|
|
20
|
+
'node',
|
|
21
|
+
nodeArgs.concat(require.resolve('./scripts/' + script)).concat(args.slice(scriptIndex + 1)),
|
|
22
|
+
{ stdio: 'inherit' }
|
|
23
|
+
).then(result => {
|
|
24
|
+
if (result.signal) {
|
|
25
|
+
if (result.signal === 'SIGKILL') {
|
|
26
|
+
console.log(
|
|
27
|
+
'The build failed because the process exited too early. ' +
|
|
28
|
+
'This probably means the system ran out of memory or someone called ' +
|
|
29
|
+
'`kill -9` on the process.'
|
|
30
|
+
);
|
|
31
|
+
} else if (result.signal === 'SIGTERM') {
|
|
32
|
+
console.log(
|
|
33
|
+
'The build failed because the process exited too early. ' +
|
|
34
|
+
'Someone might have called `kill` or `killall`, or the system could ' +
|
|
35
|
+
'be shutting down.'
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
process.exit(result.status);
|
|
41
|
+
});
|
|
42
|
+
} else if (script === undefined) {
|
|
43
|
+
const projectRoot = realpathSync(process.cwd());
|
|
44
|
+
|
|
45
|
+
//ensureMinProjectSetupAsync(projectRoot);
|
|
46
|
+
} else {
|
|
47
|
+
console.log('Invalid command "' + script + '".');
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**@see : https://blog.shahednasser.com/how-to-create-a-npx-tool/ */
|
|
3
|
+
'use strict';
|
|
4
|
+
process.on('unhandledRejection', err => {
|
|
5
|
+
throw err;
|
|
6
|
+
});
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
|
|
9
|
+
console.log(args," is arggggg");
|
|
10
|
+
|
|
11
|
+
process.exist();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const fs = require('fs-extra');
|
|
3
|
+
|
|
4
|
+
const { copyTemplateToProject, ensureMinProjectSetupAsync } = require('..');
|
|
5
|
+
process.on('unhandledRejection', err => {
|
|
6
|
+
throw err;
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const projectRoot = fs.realpathSync(process.cwd());
|
|
10
|
+
|
|
11
|
+
console.log();
|
|
12
|
+
console.log(chalk.magenta('\u203A Copying Expo Electron main process to local project...'));
|
|
13
|
+
|
|
14
|
+
copyTemplateToProject(projectRoot);
|
|
15
|
+
ensureMinProjectSetupAsync(projectRoot);
|
|
16
|
+
|
|
17
|
+
console.log(
|
|
18
|
+
chalk.magenta(
|
|
19
|
+
'\u203A You can now edit the Electron main process in the `electron/main` folder of your project...'
|
|
20
|
+
)
|
|
21
|
+
);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**@see : https://www.npmjs.com/package/@expo/webpack-config/v/0.11.4 */
|
|
2
|
+
const createExpoWebpackConfigAsync = require('@expo/webpack-config')
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const isObj = x => x && typeof x =='object' && !Array.isArray(x);
|
|
5
|
+
// Expo CLI will await this method so you can optionally return a promise.
|
|
6
|
+
module.exports = async function(env, argv,opts) {
|
|
7
|
+
const dir = path.resolve(__dirname);
|
|
8
|
+
env = env || {};
|
|
9
|
+
opts = typeof opts =="object" && opts ? opts : {};
|
|
10
|
+
const babel = isObj(opts.babel)? opts.babel : {};
|
|
11
|
+
const isElectron = typeof env.platform =="string" && env.platform.toLowerCase().trim() ==='electron';
|
|
12
|
+
if(isElectron){
|
|
13
|
+
env.platform = "electron";
|
|
14
|
+
env.mode = env.mode =="production" && "production" || "development";
|
|
15
|
+
env.pwa = false;
|
|
16
|
+
}
|
|
17
|
+
const transpileModules = Array.isArray(opts.transpileModules)? opts.transpileModules : [];
|
|
18
|
+
const config = await createExpoWebpackConfigAsync(
|
|
19
|
+
{
|
|
20
|
+
...env,
|
|
21
|
+
babel: {
|
|
22
|
+
...babel,
|
|
23
|
+
dangerouslyAddModulePathsToTranspile: [
|
|
24
|
+
// Ensure that all packages starting with @fto-consult are transpiled.
|
|
25
|
+
'@fto-consult',
|
|
26
|
+
...transpileModules,
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
argv
|
|
31
|
+
);
|
|
32
|
+
config.module.rules.push(
|
|
33
|
+
{
|
|
34
|
+
test: /.mjs$/,
|
|
35
|
+
include: /node_modules/,
|
|
36
|
+
include: /node_modules/,
|
|
37
|
+
type: "javascript/auto",
|
|
38
|
+
use: {loader: 'babel-loader'}
|
|
39
|
+
});
|
|
40
|
+
//config.resolve.alias['moduleA'] = 'moduleB';
|
|
41
|
+
config.mode = (config.mode =="development" || config.mode =='production') ? config.mode : "development";
|
|
42
|
+
// Maybe you want to turn off compression in dev mode.
|
|
43
|
+
if (config.mode === 'development') {
|
|
44
|
+
config.devServer.compress = false;
|
|
45
|
+
}
|
|
46
|
+
// Or prevent minimizing the bundle when you build.
|
|
47
|
+
if (config.mode === 'production') {
|
|
48
|
+
config.optimization.minimize = true;
|
|
49
|
+
}
|
|
50
|
+
config.performance = typeof config.performance =="object" && config.performance ? config.performance : {};
|
|
51
|
+
config.performance.hints = "hints" in config.performance ? config.performance.hints : false;
|
|
52
|
+
config.performance.maxEntrypointSize = typeof config.performance.maxEntrypointSize =='number'? config.performance.maxEntrypointSize : 512000;
|
|
53
|
+
config.performance.maxAssetSize = typeof config.performance.maxAssetSize =='number'? config.performance.maxAssetSize : 512000;
|
|
54
|
+
config.devtool = (config.mode === 'development') ? 'inline-source-map' : false;
|
|
55
|
+
require("./compiler.config.js")({config,...opts,dir});
|
|
56
|
+
if(isElectron){
|
|
57
|
+
const electronPath = process.cwd();
|
|
58
|
+
config.output = config.output || {};
|
|
59
|
+
config.output.publicPath = "./";
|
|
60
|
+
config.output.path = path.join(electronPath,"dist");
|
|
61
|
+
if(isObj(config.node)){
|
|
62
|
+
config.resolve.fallback = isObj(config.resolve.fallback)? config.resolve.fallback : {};
|
|
63
|
+
for(let i in config.node){
|
|
64
|
+
if(config.node[i] =="empty"){
|
|
65
|
+
config.resolve.fallback[i] = false;
|
|
66
|
+
} else config.resolve.fallback[i] = config.node[i];
|
|
67
|
+
delete config.node[i];
|
|
68
|
+
}
|
|
69
|
+
config.resolve.byDependency = {
|
|
70
|
+
// ...
|
|
71
|
+
esm: {
|
|
72
|
+
mainFields: ['browser', 'module'],
|
|
73
|
+
},
|
|
74
|
+
commonjs: {
|
|
75
|
+
aliasFields: ['browser'],
|
|
76
|
+
},
|
|
77
|
+
url: {
|
|
78
|
+
preferRelative: true,
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return config;
|
|
84
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
|
|
2
|
+
const envManager = require("@expo/webpack-config/env");
|
|
3
|
+
const addons = require("@expo/webpack-config/addons");
|
|
4
|
+
const jsonfile = require('jsonfile');
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const mode = 'development';
|
|
7
|
+
const isObj = x => x && typeof x =='object' && !Array.isArray(x);
|
|
8
|
+
/***@see : https://www.npmjs.com/package/@expo/webpack-config */
|
|
9
|
+
module.exports = async function(env, argv) {
|
|
10
|
+
const projectRoot = process.cwd()
|
|
11
|
+
const electronPath = path.join(projectRoot,'electron');
|
|
12
|
+
env = env || {};
|
|
13
|
+
env.projectRoot = projectRoot;
|
|
14
|
+
env.platform = "electron";//isObj(env.platform)? env.platform : {};//'web'///electron;
|
|
15
|
+
//env.platform.type = "electron";
|
|
16
|
+
env.locations = (0, envManager.getPaths)(projectRoot)
|
|
17
|
+
env.pwa = false;
|
|
18
|
+
let config = (0, addons.withAlias)({}, (0, envManager.getAliases)(projectRoot));
|
|
19
|
+
if(argv && typeof argv =='object' && (argv.mode =='production' || argv.mode =="development")){
|
|
20
|
+
env.mode = argv.mode;
|
|
21
|
+
} else {
|
|
22
|
+
env.mode = mode;
|
|
23
|
+
}
|
|
24
|
+
config = await createExpoWebpackConfigAsync(env, argv);
|
|
25
|
+
config.output = config.output || {};
|
|
26
|
+
config.output.publicPath = "./";
|
|
27
|
+
config.output.path = path.join(electronPath,"dist");
|
|
28
|
+
if (!config.plugins) config.plugins = [];
|
|
29
|
+
if (!config.resolve) config.resolve = {};
|
|
30
|
+
for(let i in config.plugins){
|
|
31
|
+
let pl = config.plugins[i];
|
|
32
|
+
//on recherche le fichier html build de webpack
|
|
33
|
+
if(pl && typeof pl =='object' && pl.options && typeof pl.options =='object'){
|
|
34
|
+
if(typeof pl.options.filename =="string" && pl.options.filename.toLowerCase().includes("index.html")){
|
|
35
|
+
pl.options.filename = path.join(config.output.path,"index.html");
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//console.log(config.resolve.extensions, "is r extensions")
|
|
41
|
+
config.resolve.extensions = (0, envManager.getModuleFileExtensions)('electron', 'web');
|
|
42
|
+
//jsonfile.writeFileSync("electron/config.back.json", config, {spaces: 4});
|
|
43
|
+
console.log("******electron config file generated**********");
|
|
44
|
+
return config;
|
|
45
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright 2022 @fto-consult/Boris Fouomene. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const dir = path.resolve(__dirname);
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
|
|
9
|
+
/*** check weather os is case sensitive
|
|
10
|
+
* @see : https://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive/52908385#52908385
|
|
11
|
+
*/
|
|
12
|
+
function fileExistsWithCaseSync(filepath) {
|
|
13
|
+
var dir = path.dirname(filepath);
|
|
14
|
+
if (dir === '/' || dir === '.') return true;
|
|
15
|
+
var filenames = fs.readdirSync(dir);
|
|
16
|
+
if (filenames.indexOf(path.basename(filepath)) === -1) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return fileExistsWithCaseSync(dir);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/***vérifie si le système supporte la cassse où non
|
|
23
|
+
* c'est à dire si 2 noms de fichiers ayant la case différentes sont considérés comme le même où pas
|
|
24
|
+
*/
|
|
25
|
+
module.exports = (()=>{
|
|
26
|
+
return fileExistsWithCaseSync(path.resolve(dir,"metro.config.js")) == fileExistsWithCaseSync(path.resolve(dir,"Metro.config.js"))
|
|
27
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
"delete-node-modules": "rimraf ./**/node_modules",
|
|
43
43
|
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'"
|
|
44
44
|
},
|
|
45
|
-
"bin":
|
|
45
|
+
"bin": {
|
|
46
|
+
"electron": "bin/electron/index.js"
|
|
47
|
+
},
|
|
46
48
|
"repository": {
|
|
47
49
|
"type": "git",
|
|
48
50
|
"url": "git+https://github.com/borispipo/expo-ui.git"
|
|
@@ -70,7 +72,6 @@
|
|
|
70
72
|
"@react-navigation/native-stack": "^6.9.7",
|
|
71
73
|
"@shopify/flash-list": "1.3.1",
|
|
72
74
|
"conf": "^10.2.0",
|
|
73
|
-
"electron": "^22.1.0",
|
|
74
75
|
"expo": "^47.0.8",
|
|
75
76
|
"expo-camera": "~13.1.0",
|
|
76
77
|
"expo-clipboard": "~4.0.1",
|
|
@@ -82,7 +83,6 @@
|
|
|
82
83
|
"expo-system-ui": "~2.0.1",
|
|
83
84
|
"expo-web-browser": "~12.0.0",
|
|
84
85
|
"file-saver": "^2.0.5",
|
|
85
|
-
"fs-extra": "^11.1.0",
|
|
86
86
|
"google-libphonenumber": "^3.2.31",
|
|
87
87
|
"htmlparser2-without-node-native": "^3.9.2",
|
|
88
88
|
"mongo-parse": "^2.1.0",
|
package/src/auth/Login.js
CHANGED
|
@@ -86,7 +86,11 @@ export default function LoginComponent(props){
|
|
|
86
86
|
},1000)
|
|
87
87
|
}
|
|
88
88
|
},[withPortal])
|
|
89
|
-
const {header,
|
|
89
|
+
const {header,
|
|
90
|
+
headerTopContent:HeaderTopContent,
|
|
91
|
+
containerProps : customContainerProps,
|
|
92
|
+
contentProp,
|
|
93
|
+
withScrollView:customWithScrollView,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,mutateData,beforeSubmit:beforeSubmitForm,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
90
94
|
...state,
|
|
91
95
|
setState,
|
|
92
96
|
state,
|
|
@@ -101,6 +105,8 @@ export default function LoginComponent(props){
|
|
|
101
105
|
ProviderSelector,
|
|
102
106
|
previousButtonRef,
|
|
103
107
|
}));
|
|
108
|
+
const containerProps = defaultObj(customContainerProps);
|
|
109
|
+
|
|
104
110
|
React.useEffect(()=>{
|
|
105
111
|
Preloader.closeAll();
|
|
106
112
|
/*** pour initializer les cordonnées du composant login */
|
|
@@ -191,13 +197,22 @@ export default function LoginComponent(props){
|
|
|
191
197
|
});
|
|
192
198
|
const withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : true;
|
|
193
199
|
const Wrapper = withPortal ? ScreenWithoutAuthContainer : withScrollView ? ScrollView: View;
|
|
200
|
+
const mQueryUpdateProps = (a)=>{
|
|
201
|
+
const style = StyleSheet.flatten([updateMediaQueryStyle(),containerProps.style]);
|
|
202
|
+
if(typeof containerProps.updateMediaQueryStyle =='function'){
|
|
203
|
+
return containerProps.updateMediaQueryStyle({style})
|
|
204
|
+
}
|
|
205
|
+
return {style};
|
|
206
|
+
};
|
|
194
207
|
const wrapperProps = withPortal ? {appBarProps,authRequired:false,title:loginTitle,withScrollView} : { style:styles.wrapper};
|
|
208
|
+
const sH = React.isComponent(HeaderTopContent)? <HeaderTopContent
|
|
209
|
+
mediaQueryUpdateNativeProps = {mQueryUpdateProps}
|
|
210
|
+
/> : React.isValidElement(HeaderTopContent)? HeaderTopContent : null;
|
|
195
211
|
return <Wrapper testID = {testID+"_Wrapper" }{...wrapperProps}>
|
|
196
212
|
<DialogProvider ref={dialogProviderRef}/>
|
|
213
|
+
{sH}
|
|
197
214
|
<Surface style={[styles.container,{backgroundColor}]} testID={testID}>
|
|
198
|
-
<Surface elevation = {0} mediaQueryUpdateNativeProps = {(
|
|
199
|
-
return {style:updateMediaQueryStyle()}
|
|
200
|
-
}} testID={testID+"_Content"} style={[styles.content,updateMediaQueryStyle(),{backgroundColor}]}>
|
|
215
|
+
<Surface elevation = {0} {...containerProps} mediaQueryUpdateNativeProps = {mQueryUpdateProps} {...containerProps} testID={testID+"_Content"} style={[styles.content,updateMediaQueryStyle(),{backgroundColor},containerProps.style]}>
|
|
201
216
|
<FormData
|
|
202
217
|
formName = {formName}
|
|
203
218
|
testID = {testID+"_FormData"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///@see : https://github.com/vivaxy/react-native-auto-height-image
|
|
2
|
-
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import React, { useEffect, useState, useRef } from '$react';
|
|
3
3
|
import ImagePolyfill from './ImagePolyfill';
|
|
4
4
|
import AnimatableImage from './AnimatableImage';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
@@ -22,6 +22,7 @@ function AutoHeightImage(props) {
|
|
|
22
22
|
maxHeight,
|
|
23
23
|
onError,
|
|
24
24
|
testID:cTestID,
|
|
25
|
+
preloader,
|
|
25
26
|
...rest
|
|
26
27
|
} = props;
|
|
27
28
|
const [height, setHeight] = useState(
|
|
@@ -29,14 +30,14 @@ function AutoHeightImage(props) {
|
|
|
29
30
|
DEFAULT_HEIGHT
|
|
30
31
|
);
|
|
31
32
|
const mountedRef = useRef(false);
|
|
32
|
-
|
|
33
|
-
useEffect(function () {
|
|
33
|
+
const toolgeMounted = function () {
|
|
34
34
|
mountedRef.current = true;
|
|
35
35
|
return function () {
|
|
36
36
|
mountedRef.current = false;
|
|
37
37
|
};
|
|
38
|
-
}
|
|
39
|
-
|
|
38
|
+
}
|
|
39
|
+
useEffect(toolgeMounted,[])
|
|
40
|
+
React.useOnRender(toolgeMounted,0);
|
|
40
41
|
useEffect(
|
|
41
42
|
function () {
|
|
42
43
|
(async function () {
|
|
@@ -75,7 +76,7 @@ function AutoHeightImage(props) {
|
|
|
75
76
|
onError={onError}
|
|
76
77
|
{...rest}
|
|
77
78
|
/>
|
|
78
|
-
{!mountedRef.current ? <ActivityIndicator testID={testID+"_ActivityIndicator"} color={theme.colors.primary}/> : null}
|
|
79
|
+
{!mountedRef.current && preloader !== false && (!width || !height) ? <ActivityIndicator testID={testID+"_ActivityIndicator"} color={theme.colors.primary}/> : null}
|
|
79
80
|
</View>
|
|
80
81
|
);
|
|
81
82
|
}
|
|
@@ -85,13 +86,15 @@ AutoHeightImage.propTypes = {
|
|
|
85
86
|
width: PropTypes.number.isRequired,
|
|
86
87
|
maxHeight: PropTypes.number,
|
|
87
88
|
onHeightChange: PropTypes.func,
|
|
88
|
-
animated: PropTypes.bool
|
|
89
|
+
animated: PropTypes.bool,
|
|
90
|
+
preloader : PropTypes.bool,//si l'on affichera le preloader
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
AutoHeightImage.defaultProps = {
|
|
92
94
|
maxHeight: Infinity,
|
|
93
95
|
onHeightChange: NOOP,
|
|
94
|
-
animated: false
|
|
96
|
+
animated: false,
|
|
97
|
+
preloader : true,
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
export default AutoHeightImage;
|