@fto-consult/expo-ui 7.4.37 → 7.4.39
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 +3 -2
- package/electron/preload.js +2 -1
- package/package.json +1 -1
- package/src/pdf/print.js +0 -4
- package/src/pdf/print.web.js +6 -2
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
|
-
|
114
|
+
let _win = new BrowserWindow(options);
|
114
115
|
if(!menu){
|
115
116
|
_win.setMenu(null);
|
116
117
|
_win.removeMenu();
|
package/electron/preload.js
CHANGED
@@ -380,7 +380,8 @@ const ELECTRON = {
|
|
380
380
|
},
|
381
381
|
get printPDF (){
|
382
382
|
return (options)=>{
|
383
|
-
const urlPath = path.resolve("
|
383
|
+
const urlPath = path.resolve(__dirname,"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
package/src/pdf/print.js
CHANGED
package/src/pdf/print.web.js
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
-
|
2
|
-
|
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
|
}
|