@fto-consult/expo-ui 7.5.44 → 7.6.1

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.
Files changed (49) hide show
  1. package/babel.config.alias.js +2 -1
  2. package/bin/index.js +0 -152
  3. package/bin/update-appex-chart.js +1 -1
  4. package/bin/update-pdfmake.js +1 -1
  5. package/bin/utils.js +1 -1
  6. package/copy-env-file.js +3 -6
  7. package/create-transpile-module-transformer.js +1 -1
  8. package/find-licenses.js +1 -1
  9. package/package.json +3 -4
  10. package/src/screens/Help/openLibraries.js +339 -1
  11. package/bin/init.js +0 -95
  12. package/electron/app/desktopCapturer.js +0 -123
  13. package/electron/app/email.js +0 -55
  14. package/electron/app/file.js +0 -501
  15. package/electron/app/index.html +0 -32
  16. package/electron/app/index.js +0 -19
  17. package/electron/app/instance.js +0 -46
  18. package/electron/create-index-file.js +0 -15
  19. package/electron/dependencies.js +0 -13
  20. package/electron/index.js +0 -556
  21. package/electron/init/index.js +0 -0
  22. package/electron/init/main.js +0 -55
  23. package/electron/init/renderer.js +0 -6
  24. package/electron/is-initialized.js +0 -11
  25. package/electron/pload.js +0 -88
  26. package/electron/preload.js +0 -461
  27. package/electron/tools.js +0 -0
  28. package/electron/utils/config.js +0 -30
  29. package/electron/utils/copy.js +0 -20
  30. package/electron/utils/createDir.js +0 -30
  31. package/electron/utils/createDirSync.js +0 -31
  32. package/electron/utils/debounce.js +0 -19
  33. package/electron/utils/dependencies.js +0 -10
  34. package/electron/utils/env.js +0 -80
  35. package/electron/utils/exec.js +0 -81
  36. package/electron/utils/getDirname.js +0 -14
  37. package/electron/utils/getIcon.js +0 -25
  38. package/electron/utils/index.js +0 -24
  39. package/electron/utils/isBase64.js +0 -14
  40. package/electron/utils/isDataURL.js +0 -13
  41. package/electron/utils/isValidUrl.js +0 -4
  42. package/electron/utils/json.js +0 -57
  43. package/electron/utils/parseArgs.js +0 -21
  44. package/electron/utils/paths.js +0 -11
  45. package/electron/utils/postMessage.js +0 -19
  46. package/electron/utils/replaceAll.js +0 -12
  47. package/electron/utils/session.js +0 -5
  48. package/electron/utils/uniqid.js +0 -33
  49. package/electron/utils/writeFile.js +0 -14
@@ -1,80 +0,0 @@
1
- import chalk from 'chalk';
2
-
3
- /**
4
- * Validate the environment options and apply default values.
5
- *
6
- * @param env
7
- * @category env
8
- */
9
- export function validateEnvironment(env){
10
- if (typeof env.projectRoot !== 'string') {
11
- throw new Error(
12
- `@expo/webpack-config requires a valid projectRoot string value which points to the root of your project`
13
- );
14
- }
15
- warnEnvironmentDeprecation(env, true);
16
- const validModes = ['development', 'production', 'none'];
17
- if (!env.mode || !validModes.includes(env.mode)) {
18
- throw new Error(
19
- `@expo/webpack-config requires a valid \`mode\` string which should be one of: ${validModes.join(
20
- ', '
21
- )}`
22
- );
23
- }
24
-
25
- // Default to web. Allow any arbitrary platform.
26
- if (typeof env.platform === 'undefined') {
27
- env.platform = 'web';
28
- }
29
- // No https by default since it doesn't work well across different browsers and devices.
30
- if (typeof env.https === 'undefined') {
31
- env.https = false;
32
- }
33
-
34
- return env;
35
- }
36
-
37
- let warned= {};
38
-
39
- function shouldWarnDeprecated(
40
- config,
41
- key,
42
- warnOnce
43
- ) {
44
- return (!warnOnce || !(key in warned)) && typeof config[key] !== 'undefined';
45
- }
46
-
47
- /**
48
- *
49
- * @param env
50
- * @param warnOnce
51
- * @category env
52
- * @internal
53
- */
54
- export function warnEnvironmentDeprecation(env, warnOnce) {
55
- const warnings = {
56
- production: 'Please use `mode: "production"` instead.',
57
- development: 'Please use `mode: "development"` instead.',
58
- polyfill: 'Please include polyfills manually in your project.',
59
- };
60
-
61
- for (const warning of Object.keys(warnings)) {
62
- if (shouldWarnDeprecated(env, warning, warnOnce)) {
63
- warned[warning] = true;
64
- console.warn(
65
- chalk.bgYellow.black(
66
- `The environment property \`${warning}\` is deprecated. ${warnings[warning]}`.trim()
67
- )
68
- );
69
- }
70
- }
71
- }
72
-
73
- /**
74
- * Used for testing
75
- * @category env
76
- * @internal
77
- */
78
- export function _resetWarnings() {
79
- warned = {};
80
- }
@@ -1,81 +0,0 @@
1
- const {exec,execSync} = require('child_process');
2
- const fs = require("fs");
3
- const _exec = (cmd,cmdOpts,logMessages,sync)=>{
4
- cmdOpts = typeof cmdOpts =='object' && cmdOpts || {};
5
- cmdOpts.env = typeof cmdOpts.env =="object" && cmdOpts.env || {};
6
- cmdOpts.env = {...process.env,...cmdOpts.env};
7
- cmdOpts.env.platform = cmdOpts.env.platform || "electron";
8
- if(sync) {
9
- cmdOpts.stdio = cmdOpts.stdio || "inherit";
10
- }
11
- const timer = cmdOpts.loader !==false && !sync ? loaderTimer(cmd) : null;
12
- if(sync){
13
- try {
14
- return execSync(cmd,cmdOpts);
15
- } catch(e){
16
- clearInterval(timer);
17
- throw e;
18
- }
19
- return null;
20
- }
21
- return new Promise((resolve,reject)=>{
22
- exec(cmd,cmdOpts, (error, stdout, stderr) => {
23
- if (error) {
24
- logMessages !== false && console.log(`error: ${error.message}`);;
25
- reject(error);
26
- clearInterval(timer);
27
- return;
28
- }
29
- if (stderr) {
30
- logMessages !== false && console.error(`stderr: ${stderr}`);
31
- reject(stderr);
32
- clearInterval(timer);
33
- return;
34
- }
35
- if(stdout && logMessages !== false){
36
- console.log(`stdout: ${stdout}`);
37
- }
38
- clearInterval(timer);
39
- resolve(stdout);
40
- });
41
- })
42
- }
43
- const loaderTimer = function(timout) {
44
- const text = typeof timout =='string' && timout ||'';
45
- timout = typeof timout =='number'? timout : 250;
46
- var P = ["\\", "|", "/", "-"];
47
- var x = 0;
48
- return setInterval(function() {
49
- process.stdout.write("\r "+text+" "+P[x++]);
50
- x &= 3;
51
- }, timout);
52
- };
53
-
54
- const runExec = function(cmdOpts,options,sync){
55
- if(typeof cmdOpts =='string'){
56
- cmdOpts = {cmd:cmdOpts};
57
- }
58
- options = typeof options =='object' && options ? options : {};
59
- cmdOpts = cmdOpts && typeof cmdOpts =="object"? cmdOpts : {};
60
- cmdOpts = {...cmdOpts,...options,cmd:cmdOpts.cmd|| cmdOpts.command};
61
- const {cmd,projectRoot,logMessages} = cmdOpts;
62
- if(!cmd|| typeof cmd !='string'){
63
- return Promise.reject("Commande de script invalide, veuillez spécifier une chaine de caractère non nulle");
64
- }
65
- if(typeof projectRoot =='string' && projectRoot && fs.existsSync(projectRoot)){
66
- return _exec(`cd ${projectRoot}`).then((r)=>{
67
- try {
68
- process.chdir(projectRoot);
69
- } catch(e){}
70
- return _exec(cmd,cmdOpts,logMessages);
71
- })
72
- }
73
- return _exec(cmd,cmdOpts,logMessages,sync);
74
- }
75
- module.exports = function(cmdOpts,options){
76
- return runExec(cmdOpts,options,false);
77
- }
78
-
79
- module.exports.execSync = module.exports.sync = function(cmdOpts,options){
80
- return runExec(cmdOpts,options,true);
81
- }
@@ -1,14 +0,0 @@
1
- ///retourne le nom du repertoire d'un chemin passé en paramètre
2
- const path = require("path");
3
- function isFile(pathItem) {
4
- return !!path.extname(pathItem);
5
- }
6
- module.exports = (path_string)=>{
7
- if(!path_string || typeof path_string !=='string'){
8
- return null;
9
- }
10
- if(isFile(path_string)){
11
- return path.dirname(path_string);
12
- }
13
- return path.resolve(path_string);
14
- }
@@ -1,25 +0,0 @@
1
- const isWindow = process.platform =="win32",
2
- isMac = process.platform =='darwin',
3
- isLinux = process.platform =="linux";
4
- const fs = require("fs");
5
- const getDirname = require("./getDirname");
6
- const path = require("path");
7
- const getIcon = (p)=>{
8
- if(Array.isArray(p)){
9
- for(let i in p){
10
- const r = getIcon(p[i]);
11
- if(r) return r;
12
- }
13
- } else if(typeof p =='string' && p && fs.existsSync(p)){
14
- const ext = isWindow ? ".ico" : isMac ? ".incs" : ".png";
15
- const possibles = ["icon","logo","favicon"];
16
- for(let i in possibles){
17
- const ico = path.join(getDirname(p),possibles[i]+ext);
18
- if(fs.existsSync(ico)){
19
- return ico;
20
- }
21
- }
22
- }
23
- return undefined;
24
- };
25
- module.exports = getIcon;
@@ -1,24 +0,0 @@
1
- const path = require("path");
2
- module.exports = {
3
- createDir : require("./createDir"),
4
- writeFile : require("./writeFile"),
5
- copy : require("./copy"),
6
- electronDir : path.resolve(__dirname, ".."),
7
- paths : require("./paths"),
8
- exec : require("./exec"),
9
- uniqid : require("./uniqid"),
10
- debounce : require("./debounce"),
11
- throwError : (...args)=>{
12
- console.error(...args);
13
- process.exit(-1);
14
- },
15
- json : require("./json"),
16
- replaceAll : require("./replaceAll"),
17
- isBase64 : require("./isBase64"),
18
- isDataURL : require("./isDataURL"),
19
- dataURLToBase64 : require("./isDataURL").toBase64,
20
- isValidUrl : require("./isValidUrl"),
21
- createDirSync : require("./createDirSync"),
22
- ...require("./dependencies"),
23
- isObj : x=> typeof x =="object" && x && !Array.isArray(x),
24
- }
@@ -1,14 +0,0 @@
1
- module.exports = function isBase64(str, options) {
2
- if(!str || typeof str !=='string') return false;
3
- options = Object.assign({},options);
4
- options.urlSafe = typeof options.urlSafe =='boolean'? options.urlSafe: false;
5
- const len = str.length;
6
- if (options.urlSafe) {
7
- return /^[A-Z0-9_\-]*$/i.test(str);
8
- }
9
- if (len % 4 !== 0 || /[^A-Z0-9+\/=]/i.test(str)) {
10
- return false;
11
- }
12
- const firstPaddingChar = str.indexOf('=');
13
- return firstPaddingChar === -1 || firstPaddingChar === len - 1 || (firstPaddingChar === len - 2 && str[len - 1] === '=');
14
- }
@@ -1,13 +0,0 @@
1
- const isDataURLRegex = /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)$/i;
2
-
3
- function isDataURL(s) {
4
- return s && typeof s ==='string' && !s.includes("data:image/x-icon") && !!s.match(isDataURLRegex);
5
- }
6
-
7
- isDataURL.toBase64 = (dataURLStr)=>{
8
- if(!isDataURL(dataURLStr)) return undefined;
9
- return dataURLStr.replace(/^data:.+;base64,/, '')
10
- }
11
-
12
- module.exports = isDataURL;
13
-
@@ -1,4 +0,0 @@
1
- module.exports = (str)=>{
2
- if(typeof str !=='string' || !str) return false;
3
- return /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/.test(str);
4
- };
@@ -1,57 +0,0 @@
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
-
6
- module.exports.decycle = function decycle(obj, stack = []) {
7
- if(typeof obj ==='function') return undefined;
8
- if (!obj || typeof obj !== 'object')
9
- return obj;
10
-
11
- if (stack.includes(obj))
12
- return null;
13
-
14
- let s = stack.concat([obj]);
15
- return Array.isArray(obj)
16
- ? obj.map(x => decycle(x, s))
17
- : Object.fromEntries(
18
- Object.entries(obj)
19
- .map(([k, v]) => [k, decycle(v, s)]));
20
- }
21
-
22
- module.exports.stringify = function(jsonObj,decylcleVal){
23
- return isJSON(jsonObj) ? jsonObj : JSON.stringify(decylcleVal !== false ? decycle(jsonObj) : jsonObj);
24
- }
25
-
26
- module.exports.isJSON = function (json_string){
27
- if(!json_string || typeof json_string != 'string') return false;
28
- var text = json_string;
29
- return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, '')));
30
- }
31
-
32
- /***
33
- * parse JSON string recursively
34
- * @param {string} json string to parse
35
- * @return {object} or null, parse json
36
- */
37
- module.exports. parseJSON = function(jsonStr){
38
- if(!isJSON(jsonStr)) {
39
- if(jsonStr && typeof(jsonStr) == 'object'){
40
- for(var i in jsonStr){
41
- jsonStr[i] = parseJSON(jsonStr[i]);
42
- }
43
- }
44
- return jsonStr;
45
- }
46
- try {
47
- jsonStr = JSON.parse(jsonStr);
48
- if(jsonStr && typeof(jsonStr) == 'object'){
49
- for(var i in jsonStr){
50
- jsonStr[i] = parseJSON(jsonStr[i]);
51
- }
52
- }
53
- } catch(e){
54
- return jsonStr;
55
- }
56
- return jsonStr;
57
- }
@@ -1,21 +0,0 @@
1
- module.exports = (argv,supportedScript)=>{
2
- if(!Array.isArray(argv)) {
3
- argv = process.argv.slice(0);
4
- }
5
- const args = {};
6
- supportedScript = typeof supportedScript =='object' && supportedScript || null;
7
- argv.map(arg=>{
8
- if(!arg || typeof arg != 'string') return;
9
- arg = arg.trim();
10
- if(supportedScript && arg in supportedScript){
11
- args.script = arg;
12
- } else if(arg.includes("=")){
13
- const split = arg.split("=");
14
- if(split.length !=2) return;
15
- args[split[0].trim()] = split[1].trim();
16
- } else {
17
- args[arg] = true;
18
- }
19
- });
20
- return args;
21
- }
@@ -1,11 +0,0 @@
1
-
2
- /**** permet de retourner le chemin des fichier, généré via les alias paths.json
3
- contenant la liste des fichiers de l'application
4
- */
5
- const fs = require("fs");
6
- const path = require("path");
7
-
8
- module.exports = (projectRoot)=>{
9
- projectRoot = projectRoot && fs.existsSync(projectRoot) && projectRoot || process.cwd();
10
- return path.resolve(projectRoot,"node_modules",`expo-ui.paths.alias.json`);
11
- }
@@ -1,19 +0,0 @@
1
- /****
2
- * envoie un message au client à travers la fonction postMessage de window, le message envoyé sera de la forme :
3
- * {
4
- * message : ELECTRON_MESSAGE/{message en question},
5
- * callback : {function}, la fonction de rappel
6
- * params : {array}, les paramètres supplémentaires à la fonction
7
- * }
8
- * @param message {string|object} le message à envoyer au client web
9
- * @param [...params], le reste des paramètres
10
- */
11
- module.exports = function(message,...params){
12
- message = typeof message =='string' ? {message} : message;
13
- const opts = message && typeof message =='object' && !Array.isArray(message) ? message : {};
14
- message = opts.message;
15
- if(!message || typeof message !='string') return null;
16
- opts.params = Array.isArray(opts.params) && opts.params || params;
17
- opts.message = "ELECTRON_MESSAGE/"+message.trim();
18
- return window.postMessage(opts);
19
- }
@@ -1,12 +0,0 @@
1
- function replaceAll (value,find,replace){
2
- if(typeof value !=='string' || typeof find !=='string' || typeof replace !=='string') return "";
3
- return value.split(find).join(replace)
4
- }
5
-
6
- if(typeof String.prototype.replaceAll !== 'function'){
7
- String.prototype.replaceAll = function(find,replace){
8
- return replaceAll(this.toString(),find,replace);
9
- }
10
- }
11
-
12
- module.exports = replaceAll;
@@ -1,5 +0,0 @@
1
- const {app} = require('electron');
2
- const Conf = require('./config');
3
- const session = new Conf({cwd:app.getPath('userData')});
4
-
5
- module.exports = session;
@@ -1,33 +0,0 @@
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
- /***
6
- * generate uid : uid(16) generate uid with 16 max characters
7
- * uid("prefix",16) generate uid with max 16 chars and having prefix like prefix
8
- *
9
- * @param {type} prefix
10
- * @param {type} idStrLen
11
- * @param {type} separator
12
- * @returns {String|Number|uid.idStr}
13
- */
14
- module.exports = function uniqid (prefix,idStrLen,separator) {
15
- if(typeof prefix == "number" & typeof idStrLen == "undefined"){
16
- idStrLen = prefix
17
- prefix = ""
18
- }
19
- separator = typeof separator =="string" && separator ? separator : "";
20
- prefix = typeof prefix =="string" && prefix ? prefix : "";
21
- if(typeof idStrLen !=='number') idStrLen = idStrLen-prefix.length;
22
- if(idStrLen <= 0) idStrLen = 16;
23
- idStrLen = Math.floor(idStrLen);
24
- // always start with a letter -- base 36 makes for a nice shortcut
25
- var idStr = prefix+(Math.floor((Math.random() * 25)) + 10).toString(36) + separator;
26
- // add a timestamp in milliseconds (base 36 again) as the base
27
- idStr += (new Date()).getTime().toString(36) + separator;
28
- // similar to above, complete the Id using random, alphanumeric characters
29
- do {
30
- idStr += (Math.floor((Math.random() * 35))).toString(36);
31
- } while (idStr.length < idStrLen);
32
- return (idStr);
33
- }
@@ -1,14 +0,0 @@
1
- const fs = require("fs");
2
- const p = require("path");
3
- module.exports = function writeFile(path, contents, cb) {
4
- if(typeof path =='string' && path){
5
- const fileName = p.basename(path);
6
- if(fileName){
7
- const pp = p.dirname(path);
8
- if(require("./createDir")(pp)){
9
- return fs.writeFileSync(p.join(pp,fileName), contents, cb);
10
- }
11
- }
12
- }
13
- throw {message : 'impossible de créer le repertoire associé au fichier'+path};
14
- }