@fto-consult/expo-ui 7.4.37 → 7.4.38

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/electron/index.js CHANGED
@@ -74,10 +74,11 @@ const setOSTheme = (theme) => {
74
74
  setOSTheme(session.get("os-theme"));
75
75
  const isObj = x => x && typeof x =='object';
76
76
 
77
+
77
78
  function createBrowserWindow (options){
78
79
  options = Object.assign({},options);
79
80
  let menu = options.menu;
80
- options.webPreferences = isObj(options.webPreferences)? options.webPreferences : {}
81
+ options.webPreferences = isObj(options.webPreferences)? options.webPreferences : {};
81
82
  options.webPreferences = {
82
83
  sandbox: false,
83
84
  ...options.webPreferences,
@@ -110,7 +111,7 @@ function createBrowserWindow (options){
110
111
  if(typeof mainProcess.beforeCreateWindow =='function'){
111
112
  mainProcess.beforeCreateWindow(options);
112
113
  }
113
- const _win = new BrowserWindow(options);
114
+ let _win = new BrowserWindow(options);
114
115
  if(!menu){
115
116
  _win.setMenu(null);
116
117
  _win.removeMenu();
@@ -118,6 +119,7 @@ function createBrowserWindow (options){
118
119
  _win.setAutoHideMenuBar(true)
119
120
  }
120
121
  const url = isValidUrl(options.loadURL) ? options.loadURL : isValidUrl(pUrl) ? pUrl : undefined;
122
+ console.log("will load file ",options.file,options);
121
123
  if(url){
122
124
  _win.loadURL(url);
123
125
  } else if(options.file && fs.existsSync(options.file)){
@@ -381,6 +381,7 @@ const ELECTRON = {
381
381
  get printPDF (){
382
382
  return (options)=>{
383
383
  const urlPath = path.resolve("./pdf-viewer","viewer.html");
384
+ console.log("will create window ",urlPath);
384
385
  return createWindow({file:urlPath,modal:true,showOnLoad:true});
385
386
  return createPDFFile(options).then(({path,filePathUrl})=>{
386
387
  if(fs.existsSync(path)){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.37",
3
+ "version": "7.4.38",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
package/src/pdf/print.js CHANGED
@@ -1,7 +1,3 @@
1
- import {isElectron} from "$cplatform";
2
1
  export default function print(pdfMakeInstance,options,...rest){
3
- if(isElectron() && ELECTRON.printPDF){
4
- return ELECTRON.printPDF(options);
5
- }
6
2
  return pdfMakeInstance.print(options,...rest);
7
3
  }
@@ -1,3 +1,7 @@
1
- export default function print(pdfMakeInstance,...rest){
2
- return pdfMakeInstance.print(...rest);
1
+ import {isElectron} from "$cplatform";
2
+ export default function print(pdfMakeInstance,options,...rest){
3
+ if(isElectron() && ELECTRON.printPDF){
4
+ return ELECTRON.printPDF(options);
5
+ }
6
+ return pdfMakeInstance.print(options,...rest);
3
7
  }