@fto-consult/expo-ui 7.4.33 → 7.4.34
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
@@ -10,7 +10,7 @@
|
|
10
10
|
const { program } = require('commander');
|
11
11
|
const path= require("path");
|
12
12
|
const fs = require("fs");
|
13
|
-
const {createDir,electronDir,copy,exec,throwError,paths:getPaths,writeFile} = require("./utils");
|
13
|
+
const {createDir,electronDir,copy,exec,throwError,paths:getPaths,writeFile,isValidUrl} = require("./utils");
|
14
14
|
|
15
15
|
|
16
16
|
const dir = path.resolve(__dirname);
|
@@ -122,7 +122,7 @@ program.command('electron')
|
|
122
122
|
let cmd = undefined;
|
123
123
|
const start = x=>{
|
124
124
|
return new Promise((resolve,reject)=>{
|
125
|
-
cmd = `electron "${electronProjectRoot}"${url? ` --url ${url}`:''}
|
125
|
+
cmd = `electron "${electronProjectRoot}" --paths ${pathsJSON} --root ${projectRoot} ${isValidUrl(url)? ` --url ${url}`:''}`;
|
126
126
|
exec({
|
127
127
|
cmd,
|
128
128
|
projectRoot : electronProjectRoot,
|
package/electron/index.js
CHANGED
@@ -20,6 +20,7 @@ const projectRoot = mainProjectRoot && fs.existsSync(mainProjectRoot) ? mainProj
|
|
20
20
|
const electronProjectRoot = projectRoot && fs.existsSync(path.resolve(projectRoot,"electron")) && path.resolve(projectRoot,"electron") || '';
|
21
21
|
const ePathsJSON = path.resolve(electronProjectRoot,"paths.json");
|
22
22
|
const packageJSONPath = path.resolve(projectRoot,"package.json");
|
23
|
+
const isValidUrl = require("./utils/isValidUrl");
|
23
24
|
const packageJSON = fs.existsSync(packageJSONPath) ? require(`${packageJSONPath}`) : {};
|
24
25
|
const eePaths = path.resolve(getPaths(projectRoot));
|
25
26
|
if(!paths){
|
@@ -115,7 +116,7 @@ function createBrowserWindow (options){
|
|
115
116
|
_win.setMenuBarVisibility(false)
|
116
117
|
_win.setAutoHideMenuBar(true)
|
117
118
|
}
|
118
|
-
const url = options.loadURL
|
119
|
+
const url = isValidUrl(options.loadURL) ? options.loadURL : isValidUrl(pUrl) ? pUrl : undefined;
|
119
120
|
if(url){
|
120
121
|
_win.loadURL(url);
|
121
122
|
}
|
@@ -129,7 +130,6 @@ function createBrowserWindow (options){
|
|
129
130
|
});
|
130
131
|
return _win;
|
131
132
|
}
|
132
|
-
const args = require("./utils/parseArgs")();
|
133
133
|
function createWindow () {
|
134
134
|
// Créer le browser window
|
135
135
|
win = createBrowserWindow({
|
@@ -191,8 +191,8 @@ function createWindow () {
|
|
191
191
|
win.webContents.send('before-app-exit');
|
192
192
|
}
|
193
193
|
});
|
194
|
-
if(
|
195
|
-
win.loadURL(
|
194
|
+
if(isValidUrl(pUrl)){
|
195
|
+
win.loadURL(pUrl);
|
196
196
|
} else {
|
197
197
|
win.loadFile(path.resolve(path.join(electronProjectRoot,"dist",'index.html')))
|
198
198
|
}
|
@@ -437,9 +437,8 @@ ipcMain.on('close-main-render-process', _ => {
|
|
437
437
|
function debounce(func, wait, immediate) {
|
438
438
|
var timeout;
|
439
439
|
|
440
|
-
return function executedFunction() {
|
440
|
+
return function executedFunction(...args) {
|
441
441
|
var context = this;
|
442
|
-
var args = arguments;
|
443
442
|
|
444
443
|
var later = function() {
|
445
444
|
timeout = null;
|
package/electron/utils/index.js
CHANGED
@@ -13,7 +13,7 @@ module.exports = function(message,...params){
|
|
13
13
|
const opts = message && typeof message =='object' && !Array.isArray(message) ? message : {};
|
14
14
|
message = opts.message;
|
15
15
|
if(!message || typeof message !='string') return null;
|
16
|
-
opts.params = Array.isArray(opts.params) && opts.params ||
|
16
|
+
opts.params = Array.isArray(opts.params) && opts.params || params;
|
17
17
|
opts.message = "ELECTRON_MESSAGE/"+message.trim();
|
18
18
|
return window.postMessage(opts);
|
19
19
|
}
|