@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.
- package/babel.config.alias.js +2 -1
- package/bin/index.js +0 -152
- package/bin/update-appex-chart.js +1 -1
- package/bin/update-pdfmake.js +1 -1
- package/bin/utils.js +1 -1
- package/copy-env-file.js +3 -6
- package/create-transpile-module-transformer.js +1 -1
- package/find-licenses.js +1 -1
- package/package.json +3 -4
- package/src/screens/Help/openLibraries.js +339 -1
- package/bin/init.js +0 -95
- package/electron/app/desktopCapturer.js +0 -123
- package/electron/app/email.js +0 -55
- package/electron/app/file.js +0 -501
- package/electron/app/index.html +0 -32
- package/electron/app/index.js +0 -19
- package/electron/app/instance.js +0 -46
- package/electron/create-index-file.js +0 -15
- package/electron/dependencies.js +0 -13
- package/electron/index.js +0 -556
- package/electron/init/index.js +0 -0
- package/electron/init/main.js +0 -55
- package/electron/init/renderer.js +0 -6
- package/electron/is-initialized.js +0 -11
- package/electron/pload.js +0 -88
- package/electron/preload.js +0 -461
- package/electron/tools.js +0 -0
- package/electron/utils/config.js +0 -30
- package/electron/utils/copy.js +0 -20
- package/electron/utils/createDir.js +0 -30
- package/electron/utils/createDirSync.js +0 -31
- package/electron/utils/debounce.js +0 -19
- package/electron/utils/dependencies.js +0 -10
- package/electron/utils/env.js +0 -80
- package/electron/utils/exec.js +0 -81
- package/electron/utils/getDirname.js +0 -14
- package/electron/utils/getIcon.js +0 -25
- package/electron/utils/index.js +0 -24
- package/electron/utils/isBase64.js +0 -14
- package/electron/utils/isDataURL.js +0 -13
- package/electron/utils/isValidUrl.js +0 -4
- package/electron/utils/json.js +0 -57
- package/electron/utils/parseArgs.js +0 -21
- package/electron/utils/paths.js +0 -11
- package/electron/utils/postMessage.js +0 -19
- package/electron/utils/replaceAll.js +0 -12
- package/electron/utils/session.js +0 -5
- package/electron/utils/uniqid.js +0 -33
- package/electron/utils/writeFile.js +0 -14
package/bin/init.js
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
const path= require("path");
|
2
|
-
const fs = require("fs");
|
3
|
-
const exec = require("../electron/utils/exec");
|
4
|
-
const createDir = require("../electron/utils/createDir");
|
5
|
-
const writeFile = require("../electron/utils/writeFile");
|
6
|
-
const copy = require("../electron/utils/copy");
|
7
|
-
const electronDir = path.resolve(__dirname,"..","electron");
|
8
|
-
const createIndexFile = require("../electron/create-index-file");
|
9
|
-
const appSuffix = "-desk";
|
10
|
-
const mainPackage = require("../package.json");
|
11
|
-
const mainPackageName = mainPackage.name;
|
12
|
-
|
13
|
-
module.exports = ({projectRoot,electronProjectRoot,icon})=>{
|
14
|
-
return new Promise((resolve,reject)=>{
|
15
|
-
//make shure electron project root exists
|
16
|
-
if(!createDir(electronProjectRoot)){
|
17
|
-
throw "Unable to create electron project root directory at "+electronProjectRoot;
|
18
|
-
}
|
19
|
-
const mPackageJSON = Object.assign({},require(`${path.resolve(projectRoot,'package.json')}`));
|
20
|
-
const electronPackagePath = path.resolve(electronProjectRoot,"package.json");
|
21
|
-
const electronPackageJSON = Object.assign({},fs.existsSync(electronPackagePath)? require(electronPackagePath) : {});
|
22
|
-
const projectRootPackage = {icon,...mPackageJSON,...electronPackageJSON};
|
23
|
-
const dependencies = require("../electron/dependencies");
|
24
|
-
const electronProjectRootPackage = path.resolve(electronProjectRoot,"package.json");
|
25
|
-
projectRootPackage.main = `index.js`;
|
26
|
-
projectRootPackage.dependencies = {...dependencies.main,...Object.assign(electronPackageJSON.dependencies)};
|
27
|
-
projectRootPackage.dependencies[mainPackage.name] = mainPackage.version;
|
28
|
-
projectRootPackage.devDependencies = {...dependencies.dev,...Object.assign({},electronPackageJSON.devDependencies)};
|
29
|
-
projectRootPackage.scripts = {
|
30
|
-
"build" : `npx ${mainPackageName} electron build`,
|
31
|
-
"start" : `npx ${mainPackageName} electron start`,
|
32
|
-
"run-dev" : `npx ${mainPackageName} electron start`,
|
33
|
-
"compile2start" : `npx ${mainPackageName} electron start --build`,
|
34
|
-
...Object.assign({},electronPackageJSON.scripts)
|
35
|
-
}
|
36
|
-
projectRootPackage.name = projectRootPackage.name;
|
37
|
-
projectRootPackage.realAppName = typeof projectRootPackage.realAppName =="string" && projectRootPackage.realAppName || projectRootPackage.name;
|
38
|
-
if(!projectRootPackage.name.endsWith(appSuffix)){
|
39
|
-
projectRootPackage.name +=appSuffix;
|
40
|
-
}
|
41
|
-
writeFile(electronProjectRootPackage,JSON.stringify(projectRootPackage,null,'\t'));
|
42
|
-
if(!fs.existsSync(electronProjectRootPackage)){
|
43
|
-
throw `unable to create ${electronProjectRootPackage} file`;
|
44
|
-
}
|
45
|
-
const mainFolder = path.resolve(electronProjectRoot,'processes',"main");
|
46
|
-
const rendererFolder = path.resolve(electronProjectRoot,'processes',"renderer");
|
47
|
-
if(!createDir(mainFolder)){
|
48
|
-
throw `unable to create main process folder at ${mainFolder}`
|
49
|
-
}
|
50
|
-
if(!createDir(rendererFolder)){
|
51
|
-
throw `unable to create renderer process folder at ${rendererFolder}`;
|
52
|
-
}
|
53
|
-
const mainFolderIndex = path.resolve(mainFolder,"index.js");
|
54
|
-
const rendererFolderIndex = path.resolve(rendererFolder,"index.js");
|
55
|
-
if(!fs.existsSync(mainFolderIndex)){
|
56
|
-
copy(path.resolve(electronDir,"init","main.js"),mainFolderIndex);
|
57
|
-
}
|
58
|
-
if(!fs.existsSync(rendererFolderIndex)){
|
59
|
-
copy(path.resolve(electronDir,"init","renderer.js"),rendererFolderIndex);
|
60
|
-
}
|
61
|
-
createIndexFile(electronProjectRoot);
|
62
|
-
/**** copying all electron utils files */
|
63
|
-
const utilsPath = path.resolve(electronProjectRoot,"utils");
|
64
|
-
copy(path.resolve(electronDir,"utils"),utilsPath);
|
65
|
-
const gP = path.resolve(electronProjectRoot,".gitignore") ;
|
66
|
-
if(!fs.existsSync(gP)){
|
67
|
-
try {
|
68
|
-
writeFile(gP,require("./gitignore"));
|
69
|
-
} catch{};
|
70
|
-
}
|
71
|
-
try {
|
72
|
-
|
73
|
-
} catch(e){}
|
74
|
-
console.log("installing package dependencies ...");
|
75
|
-
return exec({
|
76
|
-
cmd : "npm install",// --prefix "+electronProjectRoot,
|
77
|
-
projectRoot : electronProjectRoot,
|
78
|
-
}).then((a)=>{
|
79
|
-
return resolve(a);
|
80
|
-
}).catch(reject);
|
81
|
-
})
|
82
|
-
}
|
83
|
-
|
84
|
-
const copyExtra = (path2)=>{
|
85
|
-
fs.readdirSync(path2).forEach((file) => {
|
86
|
-
if(!file || file.toLowerCase() =="dist") return;
|
87
|
-
file = path.join(path2,file);
|
88
|
-
const stat = fs.statSync(file);
|
89
|
-
if(stat.isDirectory()){
|
90
|
-
return copyExtra(file);
|
91
|
-
}
|
92
|
-
if(!stat.isFile() || file === indexFile) return;
|
93
|
-
extraResource.push(file);
|
94
|
-
});
|
95
|
-
}
|
@@ -1,123 +0,0 @@
|
|
1
|
-
module.exports = (ELECTRON)=>{
|
2
|
-
let ProgressBar = require("./ProgressBar")
|
3
|
-
let progressBarCounter = 0;
|
4
|
-
function getUserMedia(constraints) {
|
5
|
-
let check = typeof constraints === "boolean"? true : false;
|
6
|
-
if(check){
|
7
|
-
constraints = {};
|
8
|
-
}
|
9
|
-
// if Promise-based API is available, use it
|
10
|
-
if (isObj(navigator.mediaDevices)) {
|
11
|
-
if(check === true) return true;
|
12
|
-
return navigator.mediaDevices.getUserMedia(constraints);
|
13
|
-
}
|
14
|
-
|
15
|
-
// otherwise try falling back to old, possibly prefixed API...
|
16
|
-
var legacyApi = navigator.getUserMedia || navigator.webkitGetUserMedia ||
|
17
|
-
navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
18
|
-
if(check === true){
|
19
|
-
return legacyApi ? true : false;
|
20
|
-
}
|
21
|
-
if (legacyApi) {
|
22
|
-
return new Promise(function (resolve, reject) {
|
23
|
-
legacyApi.bind(navigator)(constraints, resolve, reject);
|
24
|
-
});
|
25
|
-
}
|
26
|
-
return Promise.reject({status:false,msg:"user media not available"})
|
27
|
-
}
|
28
|
-
const { desktopCapturer,ipcRenderer } = require('electron')
|
29
|
-
let SECRET_KEY = require("../app.config").id;
|
30
|
-
ipcRenderer.on("click-on-system-tray-menu-item",(event,opts)=>{
|
31
|
-
opts = defaultObj(opts);
|
32
|
-
switch(opts.action){
|
33
|
-
case "pauseRecording":
|
34
|
-
return pauseRecording();
|
35
|
-
case "stopRecording":
|
36
|
-
return stopRecording();
|
37
|
-
case "resumeRecording" :
|
38
|
-
return resumeRecording();
|
39
|
-
}
|
40
|
-
}),
|
41
|
-
updateSystemTray = ()=>{
|
42
|
-
let {isPaused,isRecording} = APP.desktopCapturer.getRecordingStatus();
|
43
|
-
/*ipcRenderer.send("update-system-tray",{
|
44
|
-
tooltip : isRecording? ("La capture vidéo est en cours d'enregistrement"):(isPaused? "La capture vidéo est en pause":"La capture vidéo est inactive"),
|
45
|
-
contextMenu : isRecording || isPaused? JSON.stringify([
|
46
|
-
{ label: isRecording? 'Mettre en pause':'Relancer la capture vidéo',action:isRecording?'pauseRecording':'resumeRecording'},
|
47
|
-
{ label: 'Arréter la capture vidéo',action:'stopRecording'}
|
48
|
-
]): null
|
49
|
-
});*/
|
50
|
-
if(!APP.COMPANY.showPreloaderOnScreenCapture){
|
51
|
-
if(progressBarCounter !== 0){
|
52
|
-
progressBarCounter = 0;
|
53
|
-
ProgressBar.set(0);
|
54
|
-
}
|
55
|
-
return false;
|
56
|
-
}
|
57
|
-
if((isPaused || !isRecording)){
|
58
|
-
progressBarCounter = 0;
|
59
|
-
} else if(isRecording){
|
60
|
-
progressBarCounter+=2;
|
61
|
-
} else progressBarCounter = 0;
|
62
|
-
ProgressBar.set(progressBarCounter);
|
63
|
-
}
|
64
|
-
async function getUserMediaAsync(constraints) {
|
65
|
-
try {
|
66
|
-
const stream = await getUserMedia(constraints);
|
67
|
-
return stream;
|
68
|
-
} catch (e) {
|
69
|
-
console.error('navigator.getUserMedia error:', e);
|
70
|
-
}
|
71
|
-
return null;
|
72
|
-
}
|
73
|
-
function startRecording(opts) {
|
74
|
-
opts = defaultObj(opts)
|
75
|
-
var title = document.title;
|
76
|
-
document.title = SECRET_KEY;
|
77
|
-
opts.video = defaultObj(opts.video);
|
78
|
-
let audio = isBool(opts.audio) && !opts.audio ? false : defaultObj(opts.audio);
|
79
|
-
let handleStream = defaultFunc(opts.handleStream), handleUserMediaError = defaultFunc(opts.handleUserMediaError)
|
80
|
-
let video = {
|
81
|
-
...opts.video,
|
82
|
-
mandatory: {
|
83
|
-
...defaultObj(opts.video.mandatory),
|
84
|
-
chromeMediaSource: 'desktop',
|
85
|
-
}
|
86
|
-
}
|
87
|
-
return desktopCapturer.getSources({ types: ['window', 'screen'] }).then(function(sources) {
|
88
|
-
for (let i = 0; i < sources.length; i++) {
|
89
|
-
let src = sources[i];
|
90
|
-
if (src.name === SECRET_KEY) {
|
91
|
-
document.title = title;
|
92
|
-
video.mandatory.chromeMediaSourceId = src.id;
|
93
|
-
if(audio){
|
94
|
-
(async() => {
|
95
|
-
const audioStream = await getUserMediaAsync(APP.desktopCapturer.getAudioConstraint())
|
96
|
-
const videoStream = await getUserMediaAsync({audio:false,video})
|
97
|
-
if(audioStream && videoStream){
|
98
|
-
const combinedStream = new MediaStream([...videoStream.getVideoTracks(), ...audioStream.getAudioTracks()])
|
99
|
-
handleStream(combinedStream)
|
100
|
-
}
|
101
|
-
})();
|
102
|
-
} else {
|
103
|
-
getUserMedia({audio:false,video}).then(handleStream).catch(handleUserMediaError);
|
104
|
-
}
|
105
|
-
return {sources,currentSource:src,isRecording:true};
|
106
|
-
}
|
107
|
-
}
|
108
|
-
return {sources,isRecording:false};
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
if(!isObj(ELECTRON.desktopCapturer)){
|
113
|
-
Object.defineProperties(ELECTRON,{
|
114
|
-
desktopCapturer : {
|
115
|
-
value : {
|
116
|
-
updateSystemTray,
|
117
|
-
startRecording,
|
118
|
-
}
|
119
|
-
,override:false,writable:false
|
120
|
-
}
|
121
|
-
})
|
122
|
-
}
|
123
|
-
}
|
package/electron/app/email.js
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
const nodemailer = require("nodemailer");
|
2
|
-
let Email = {}
|
3
|
-
let getEmailSettings = x => defaultObj(APP.getRemoteInfos().get("smtp"));
|
4
|
-
let isAvailable = ()=>{
|
5
|
-
if(!window.APP || typeof window.APP == "undefined") return false;
|
6
|
-
let infos = getEmailSettings();
|
7
|
-
let isR = infos.host && infos.port && infos.password && isNonNullString(infos.user)? true : false;
|
8
|
-
if(!isR){
|
9
|
-
APP.getRemoteInfos().check();
|
10
|
-
}
|
11
|
-
return isR;
|
12
|
-
}
|
13
|
-
let notAllowedMsg = 'Impossible d\'envoyer un mail car cette fonction n\'est pas disponible pour cette installation du logiciel';
|
14
|
-
Object.defineProperties(Email,{
|
15
|
-
send : {
|
16
|
-
value : (opts)=>{
|
17
|
-
if(!isAvailable()) return Promise.reject({msg:notAllowedMsg})
|
18
|
-
let emailSettings =getEmailSettings();
|
19
|
-
opts = defaultObj(opts);
|
20
|
-
opts.auth = {
|
21
|
-
user: emailSettings.user, // generated ethereal user
|
22
|
-
pass: defaultStr(emailSettings.pass,emailSettings.password), // generated ethereal password
|
23
|
-
}
|
24
|
-
if(!opts.from || !isValidEmail(opts.from)){
|
25
|
-
opts.from = defaultStr(emailSettings.email,APP.getDevMail());
|
26
|
-
}
|
27
|
-
if(Array.isArray(opts.to)){
|
28
|
-
opts.to = opts.to.join(",");
|
29
|
-
}
|
30
|
-
let transporter = nodemailer.createTransport({
|
31
|
-
...emailSettings,
|
32
|
-
auth: {
|
33
|
-
user: emailSettings.user, // generated ethereal user
|
34
|
-
pass: defaultStr(emailSettings.pass,emailSettings.password), // generated ethereal password
|
35
|
-
},
|
36
|
-
});
|
37
|
-
showPreloader(defaultStr(opts.preloader,"envoie de l'email en cours..."))
|
38
|
-
return new Promise((resolve,reject)=>{
|
39
|
-
transporter.sendMail(opts, function(err, reply) {
|
40
|
-
hidePreloader();
|
41
|
-
if(err){
|
42
|
-
console.log(err," error sending email")
|
43
|
-
//APP.require("$notify").error(err);
|
44
|
-
reject(err);
|
45
|
-
} else resolve(reply);
|
46
|
-
|
47
|
-
})
|
48
|
-
})
|
49
|
-
}
|
50
|
-
},
|
51
|
-
nodemailer : {value : nodemailer},
|
52
|
-
isAvailable : {value : isAvailable},
|
53
|
-
notAllowedMsg : {value : notAllowedMsg}
|
54
|
-
})
|
55
|
-
module.exports = Email;
|