@fto-consult/expo-ui 7.4.63 → 7.5.0

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
@@ -128,9 +128,6 @@ function createBrowserWindow (options){
128
128
  _win.once('ready-to-show', () => {
129
129
  _win.show();
130
130
  _win.webContents.send("window-ready-to-show",JSON.stringify(options.readyToShowOptions));
131
- if(options.devTools){
132
- _win.webContents.openDevTools();
133
- }
134
131
  });
135
132
  }
136
133
  _win.on('closed', function() {
@@ -383,36 +383,17 @@ const ELECTRON = {
383
383
  return (options)=>{
384
384
  options = Object.assign({},options);
385
385
  return createPDFFile(options).then(({path:mainPath,filePathUrl,fileName})=>{
386
- const urlPath = path.resolve(__dirname,"pdf-viewer","viewer.html");
387
386
  if(fs.existsSync(mainPath)){
388
- const queryString = `file=${filePathUrl}&locale=fr&fileName=${fileName}`;
389
387
  const opts = {
390
- //loadURL : `file://${urlPath}?${queryString}`,
391
388
  file : mainPath,
392
389
  fileName,
393
- filePathUrl,
394
- queryString,
395
390
  pdfFilePath : mainPath,
396
391
  showOnLoad : true,
397
- devTools : true,
398
- webPreferences : {
399
- devTools : true,
400
- //webSecurity: false,
401
- preload : path.resolve(__dirname,"pdf-viewer",'preload.js'),
402
- ...Object.assign({},options.webPreferences),
403
- },
404
- fileName
405
- };
406
- ["width","height"].map((v)=>{
407
- if(v in options){
408
- opts[v] = options;
392
+ webPreferences: {
393
+ plugins: true
409
394
  }
410
- });
411
- console.log("will print options ",opts);
412
- return this.createPDFWindow({
413
- ...opts,
414
- readyToShowOptions : opts,
415
- })
395
+ };
396
+ return this.createPDFWindow(opts)
416
397
  }
417
398
  })
418
399
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.63",
3
+ "version": "7.5.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -71,7 +71,7 @@
71
71
  "@expo/html-elements": "^0.5.1",
72
72
  "@expo/vector-icons": "^13.0.0",
73
73
  "@faker-js/faker": "^8.0.2",
74
- "@fto-consult/common": "^3.73.6",
74
+ "@fto-consult/common": "^3.73.8",
75
75
  "@pchmn/expo-material3-theme": "^1.3.1",
76
76
  "@react-native-async-storage/async-storage": "1.18.2",
77
77
  "@react-native-community/datetimepicker": "7.2.0",
@@ -103,7 +103,6 @@
103
103
  "js-base64": "^3.7.5",
104
104
  "node-machine-id": "^1.1.12",
105
105
  "pdfmake": "^0.2.8",
106
- "pdfobject": "^2.2.12",
107
106
  "process": "^0.11.10",
108
107
  "prop-types": "^15.8.1",
109
108
  "react": "^18.2.0",
@@ -1,29 +0,0 @@
1
-
2
- const {ipcRenderer} = require('electron')
3
-
4
- ipcRenderer.on('print-document', (...args) => {
5
- console.log("willl print document ",window.PDFObject)
6
- });
7
- ipcRenderer.on("window-ready-to-show",(...args)=>{
8
- console.log("window is ready to show ",...args,window.PDFObject);
9
- });
10
- function test(){
11
- const container = `#pdf-container`;
12
- const title = document.querySelector(`document-title`)
13
- // Get a URLSearchParams object from the URL object
14
- const params = Object.assign({},url.searchParams);
15
- params.width = params.width ||"100%";
16
- params.height = params.height || "100%";
17
- if(params.fileName && title){
18
- title.innerHTML = `${params.fileName}`
19
- } else if(params.title && title){
20
- title.innerHTML = `${params.title}`
21
- }
22
- alert(JSON.stringify(params)," is params heeein");
23
- alert(params.file," is paraments fieleeeeee");
24
- if(params.file){
25
- PDFObject.embed(params.file,container,params);
26
- } else if(params.dataURL){
27
- PDFObject.embed(params.dataURL,container,params);
28
- }
29
- }
@@ -1,14 +0,0 @@
1
- body {
2
- width: 100vh!important;
3
- height: 100%!important;
4
- padding: 0!important;
5
- margin: 0!important;
6
- }
7
-
8
- #pdf-container{
9
- width: 100vh!important;
10
- height: 100%!important;
11
- padding: 0!important;
12
- margin: 0!important;
13
- position: relative!important;
14
- }
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html dir="ltr">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
- <title id="document-title">PDF Viewer</title>
7
- <link rel="stylesheet" type="text/css" href="./viewer.css">
8
- <script src="../../node_modules/pdfobject/pdfobject.min.js"></script>
9
- </head>
10
-
11
- <body>
12
- <div id="pdf-container"></div>
13
- </body>
14
- </html>