@fto-consult/expo-ui 8.37.0 → 8.39.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.
@@ -1,6 +1,5 @@
|
|
1
1
|
const FileSaver = require('file-saver');
|
2
|
-
import {defaultNumber,postWebviewMessage} from "$cutils";
|
3
|
-
import {isReactNativeWebview} from "$cplatform";
|
2
|
+
import {defaultNumber,postWebviewMessage,canPostWebviewMessage,logRNWebview,WEBVIEW_SAVE_FILE_EVENT} from "$cutils";
|
4
3
|
|
5
4
|
/***
|
6
5
|
sauvegarde par défaut un fichier blob
|
@@ -8,16 +7,18 @@ import {isReactNativeWebview} from "$cplatform";
|
|
8
7
|
export const save = ({content,fileName,mimeType,contentType,isBase64,timeout,delay})=>{
|
9
8
|
return new Promise((resolve,reject)=>{
|
10
9
|
try {
|
11
|
-
if(
|
12
|
-
|
10
|
+
if(canPostWebviewMessage()){
|
11
|
+
logRNWebview("SAVE RN FILE FROM WEBVIEWddd ",fileName,mimeType,contentType);
|
12
|
+
postWebviewMessage(WEBVIEW_SAVE_FILE_EVENT,{
|
13
13
|
content,
|
14
14
|
fileName,
|
15
15
|
contentType,
|
16
16
|
mimeType,
|
17
17
|
isBase64,
|
18
18
|
});
|
19
|
+
} else {
|
20
|
+
FileSaver.saveAs(content, fileName);
|
19
21
|
}
|
20
|
-
FileSaver.saveAs(content, fileName);
|
21
22
|
setTimeout(() => {
|
22
23
|
resolve({path:fileName,isWeb : true});
|
23
24
|
}, defaultNumber(timeout,delay,3000));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// Copyright 2022 @fto-consult/Boris Fouomene. All rights reserved.
|
2
2
|
// Use of this source code is governed by a BSD-style
|
3
3
|
// license that can be found in the LICENSE file.
|
4
|
-
import {defaultStr,base64toBlob,dataURLToBlob,getTypeFromDataURL,isNonNullString,getFileName,getFileExtension,defaultNumber,defaultBool,dataURLToBase64,isBlob,isBase64,isDataURL} from "$cutils";
|
4
|
+
import {defaultStr,base64toBlob,dataURLToBlob,getTypeFromDataURL,isNonNullString,getFileName,getFileExtension,defaultNumber,defaultBool,dataURLToBase64,isBlob,isBase64,isDataURL,canPostWebviewMessage} from "$cutils";
|
5
5
|
const mime = require('react-native-mime-types')
|
6
6
|
const XLSX = require("xlsx");
|
7
7
|
import Preloader from "$preloader";
|
@@ -70,7 +70,7 @@ export const writeExcel = ({workbook,content,contentType,fileName,...rest})=>{
|
|
70
70
|
if(isBlob(content)){
|
71
71
|
return write({...rest,content,fileName,contentType}).finally(Preloader.close)
|
72
72
|
}
|
73
|
-
if(isNative){
|
73
|
+
if(isNative || canPostWebviewMessage()){
|
74
74
|
return FileSaver.save({...rest,content:XLSX.write(workbook, {type:'base64', bookType:ext}),fileName}).finally(Preloader.close).finally(Preloader.close);
|
75
75
|
}
|
76
76
|
return new Promise((resolve,reject)=>{
|
package/src/pdf/print.web.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import {isElectron} from "$cplatform";
|
2
2
|
import electronPrint from "./print.electron";
|
3
3
|
import {isTouchDevice} from "$cplatform";
|
4
|
-
import {canPostWebviewMessage,postWebviewMessage} from "$cutils/webview";
|
4
|
+
import {canPostWebviewMessage,postWebviewMessage,logRNWebview,WEBVIEW_SAVE_FILE_EVENT} from "$cutils/rn-webview";
|
5
5
|
import {defaultStr,getFileExtension} from "$cutils";
|
6
6
|
import DateLib from "$clib/date";
|
7
7
|
export default function print(pdfMakeInstance,options,...rest){
|
@@ -18,7 +18,8 @@ export default function print(pdfMakeInstance,options,...rest){
|
|
18
18
|
if(!ext || ext.toLowerCase() !=="pdf"){
|
19
19
|
fileName+=".pdf";
|
20
20
|
}
|
21
|
-
|
21
|
+
logRNWebview("printing pdf file",options?.fileName);
|
22
|
+
return postWebviewMessage(WEBVIEW_SAVE_FILE_EVENT,{
|
22
23
|
content,
|
23
24
|
contentType : 'application/pdf',
|
24
25
|
fileName,
|
@@ -1,22 +1,21 @@
|
|
1
1
|
module.exports = {
|
2
2
|
"@fto-consult/expo-ui": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
3
|
+
"name": "@fto-consult/expo-ui",
|
4
|
+
"version": "8.38.0",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "git+https://github.com/borispipo/expo-ui.git"
|
8
|
+
},
|
9
|
+
"homepage": "https://github.com/borispipo/expo-ui#readme"
|
6
10
|
},
|
7
11
|
"@babel/plugin-proposal-export-namespace-from": {
|
8
12
|
"version": "7.18.9",
|
9
13
|
"url": "https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from",
|
10
14
|
"license": "MIT"
|
11
15
|
},
|
12
|
-
"@emotion/
|
13
|
-
"version": "11.11.
|
14
|
-
"url": "https://emotion
|
15
|
-
"license": "MIT"
|
16
|
-
},
|
17
|
-
"@expo/html-elements": {
|
18
|
-
"version": "0.5.1",
|
19
|
-
"url": "https://github.com/expo/expo/tree/main/packages/html-elements",
|
16
|
+
"@emotion/react": {
|
17
|
+
"version": "11.11.4",
|
18
|
+
"url": "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
20
19
|
"license": "MIT"
|
21
20
|
},
|
22
21
|
"@expo/metro-config": {
|
@@ -24,49 +23,28 @@ module.exports = {
|
|
24
23
|
"url": "https://github.com/expo/expo.git",
|
25
24
|
"license": "MIT"
|
26
25
|
},
|
27
|
-
"@expo/vector-icons": {
|
28
|
-
"version": "14.0.0",
|
29
|
-
"url": "https://expo.github.io/vector-icons",
|
30
|
-
"license": "MIT"
|
31
|
-
},
|
32
26
|
"@expo/webpack-config": {
|
33
27
|
"version": "19.0.1",
|
34
28
|
"url": "https://github.com/expo/expo-webpack-integrations/tree/main/packages/webpack-config#readme",
|
35
29
|
"license": "MIT"
|
36
30
|
},
|
37
|
-
"@
|
38
|
-
"version": "
|
39
|
-
"url": "https://github.com/
|
40
|
-
"license": "MIT"
|
41
|
-
},
|
42
|
-
"@react-native-community/netinfo": {
|
43
|
-
"version": "11.1.0",
|
44
|
-
"url": "https://github.com/react-native-netinfo/react-native-netinfo#readme",
|
31
|
+
"@faker-js/faker": {
|
32
|
+
"version": "8.4.1",
|
33
|
+
"url": "https://github.com/faker-js/faker.git",
|
45
34
|
"license": "MIT"
|
46
35
|
},
|
47
|
-
"@
|
48
|
-
"version": "
|
49
|
-
"url": "
|
50
|
-
"license": "
|
51
|
-
},
|
52
|
-
"@react-navigation/native": {
|
53
|
-
"version": "6.1.14",
|
54
|
-
"url": "https://reactnavigation.org",
|
55
|
-
"license": "MIT"
|
56
|
-
},
|
57
|
-
"@react-navigation/native-stack": {
|
58
|
-
"version": "6.9.22",
|
59
|
-
"url": "https://github.com/software-mansion/react-native-screens#readme",
|
60
|
-
"license": "MIT"
|
36
|
+
"@fto-consult/common": {
|
37
|
+
"version": "4.35.0",
|
38
|
+
"url": "https://github.com/borispipo/common#readme",
|
39
|
+
"license": "ISC"
|
61
40
|
},
|
62
|
-
"@
|
63
|
-
"version": "
|
64
|
-
"url": "https://reactnavigation.org/docs/stack-navigator/",
|
41
|
+
"@fto-consult/node-utils": {
|
42
|
+
"version": "1.7.1",
|
65
43
|
"license": "MIT"
|
66
44
|
},
|
67
|
-
"
|
68
|
-
"version": "
|
69
|
-
"url": "https://
|
45
|
+
"apexcharts": {
|
46
|
+
"version": "3.47.0",
|
47
|
+
"url": "https://apexcharts.com",
|
70
48
|
"license": "MIT"
|
71
49
|
},
|
72
50
|
"babel-plugin-inline-dotenv": {
|
@@ -79,64 +57,53 @@ module.exports = {
|
|
79
57
|
"url": "https://github.com/tleunen/babel-plugin-module-resolver.git",
|
80
58
|
"license": "MIT"
|
81
59
|
},
|
82
|
-
"
|
83
|
-
"version": "
|
84
|
-
"url": "https://github.com/
|
85
|
-
"license": "MIT"
|
86
|
-
},
|
87
|
-
"expo-camera": {
|
88
|
-
"version": "14.0.6",
|
89
|
-
"url": "https://docs.expo.dev/versions/latest/sdk/camera/",
|
60
|
+
"crypto-browserify": {
|
61
|
+
"version": "3.12.0",
|
62
|
+
"url": "https://github.com/crypto-browserify/crypto-browserify",
|
90
63
|
"license": "MIT"
|
91
64
|
},
|
92
|
-
"
|
93
|
-
"version": "
|
94
|
-
"url": "https://
|
65
|
+
"file-saver": {
|
66
|
+
"version": "2.0.5",
|
67
|
+
"url": "https://github.com/eligrey/FileSaver.js#readme",
|
95
68
|
"license": "MIT"
|
96
69
|
},
|
97
|
-
"
|
98
|
-
"version": "
|
99
|
-
"url": "https://
|
100
|
-
"license": "MIT"
|
70
|
+
"google-libphonenumber": {
|
71
|
+
"version": "3.2.34",
|
72
|
+
"url": "https://ruimarinho.github.io/google-libphonenumber/",
|
73
|
+
"license": "(MIT AND Apache-2.0)"
|
101
74
|
},
|
102
|
-
"
|
103
|
-
"version": "
|
104
|
-
"url": "https://
|
75
|
+
"html2canvas": {
|
76
|
+
"version": "1.4.1",
|
77
|
+
"url": "https://html2canvas.hertzen.com",
|
105
78
|
"license": "MIT"
|
106
79
|
},
|
107
|
-
"
|
108
|
-
"version": "
|
109
|
-
"url": "
|
80
|
+
"htmlparser2-without-node-native": {
|
81
|
+
"version": "3.9.2",
|
82
|
+
"url": "git://github.com/fb55/htmlparser2.git",
|
110
83
|
"license": "MIT"
|
111
84
|
},
|
112
|
-
"
|
113
|
-
"version": "
|
114
|
-
"url": "https://docs.expo.dev/versions/latest/sdk/sharing/",
|
85
|
+
"is-plain-obj": {
|
86
|
+
"version": "4.1.0",
|
115
87
|
"license": "MIT"
|
116
88
|
},
|
117
|
-
"
|
118
|
-
"version": "
|
119
|
-
"url": "https://
|
89
|
+
"jsbarcode": {
|
90
|
+
"version": "3.11.6",
|
91
|
+
"url": "https://github.com/lindell/JsBarcode#readme",
|
120
92
|
"license": "MIT"
|
121
93
|
},
|
122
|
-
"
|
123
|
-
"version": "
|
124
|
-
"url": "https://
|
94
|
+
"prop-types": {
|
95
|
+
"version": "15.8.1",
|
96
|
+
"url": "https://facebook.github.io/react/",
|
125
97
|
"license": "MIT"
|
126
98
|
},
|
127
|
-
"
|
128
|
-
"version": "2.
|
129
|
-
"url": "https://
|
99
|
+
"react-content-loader": {
|
100
|
+
"version": "6.2.1",
|
101
|
+
"url": "https://github.com/danilowoz/react-content-loader",
|
130
102
|
"license": "MIT"
|
131
103
|
},
|
132
|
-
"
|
133
|
-
"version": "
|
134
|
-
"url": "https://
|
135
|
-
"license": "MIT"
|
136
|
-
},
|
137
|
-
"react-native": {
|
138
|
-
"version": "0.73.4",
|
139
|
-
"url": "https://reactnative.dev/",
|
104
|
+
"react-dom": {
|
105
|
+
"version": "18.2.0",
|
106
|
+
"url": "https://reactjs.org/",
|
140
107
|
"license": "MIT"
|
141
108
|
},
|
142
109
|
"react-native-big-list": {
|
@@ -144,44 +111,63 @@ module.exports = {
|
|
144
111
|
"url": "https://marcocesarato.github.io/react-native-big-list-docs/",
|
145
112
|
"license": "GPL-3.0-or-later"
|
146
113
|
},
|
147
|
-
"react-native-
|
148
|
-
"version": "
|
149
|
-
"url": "https://github.com/
|
114
|
+
"react-native-iphone-x-helper": {
|
115
|
+
"version": "1.3.1",
|
116
|
+
"url": "https://github.com/ptelad/react-native-iphone-x-helper#readme",
|
150
117
|
"license": "MIT"
|
151
118
|
},
|
152
|
-
"react-native-
|
153
|
-
"version": "2.
|
154
|
-
"url": "https://github.com/software-mansion/react-native-gesture-handler#readme",
|
119
|
+
"react-native-mime-types": {
|
120
|
+
"version": "2.5.0",
|
155
121
|
"license": "MIT"
|
156
122
|
},
|
157
|
-
"react-native-
|
158
|
-
"version": "
|
159
|
-
"url": "https://github.
|
123
|
+
"react-native-paper": {
|
124
|
+
"version": "5.12.3",
|
125
|
+
"url": "https://callstack.github.io/react-native-paper",
|
160
126
|
"license": "MIT"
|
161
127
|
},
|
162
|
-
"react-native-
|
163
|
-
"version": "
|
164
|
-
"url": "https://github.com/
|
128
|
+
"react-native-paper-dates": {
|
129
|
+
"version": "0.22.3",
|
130
|
+
"url": "https://github.com/web-ridge/react-native-paper-dates#readme",
|
165
131
|
"license": "MIT"
|
166
132
|
},
|
167
|
-
"react-native-
|
168
|
-
"version": "
|
169
|
-
"url": "
|
133
|
+
"react-native-web": {
|
134
|
+
"version": "0.19.10",
|
135
|
+
"url": "git://github.com/necolas/react-native-web.git",
|
170
136
|
"license": "MIT"
|
171
137
|
},
|
172
|
-
"react-
|
173
|
-
"version": "
|
174
|
-
"url": "https://
|
138
|
+
"react-virtuoso": {
|
139
|
+
"version": "4.7.2",
|
140
|
+
"url": "https://virtuoso.dev/",
|
175
141
|
"license": "MIT"
|
176
142
|
},
|
177
|
-
"
|
178
|
-
"version": "
|
179
|
-
"url": "https://github.com/
|
143
|
+
"readable-stream": {
|
144
|
+
"version": "4.5.2",
|
145
|
+
"url": "https://github.com/nodejs/readable-stream",
|
180
146
|
"license": "MIT"
|
181
147
|
},
|
182
|
-
"
|
183
|
-
"version": "
|
184
|
-
"url": "
|
148
|
+
"sanitize-filename": {
|
149
|
+
"version": "1.6.3",
|
150
|
+
"url": "git@github.com:parshap/node-sanitize-filename.git",
|
151
|
+
"license": "WTFPL OR ISC"
|
152
|
+
},
|
153
|
+
"sharp-cli": {
|
154
|
+
"version": "2.1.1",
|
155
|
+
"url": "https://github.com/vseventer/sharp-cli",
|
156
|
+
"license": "MIT"
|
157
|
+
},
|
158
|
+
"stream-browserify": {
|
159
|
+
"version": "3.0.0",
|
160
|
+
"url": "https://github.com/browserify/stream-browserify",
|
185
161
|
"license": "MIT"
|
162
|
+
},
|
163
|
+
"tippy.js": {
|
164
|
+
"version": "6.3.7",
|
165
|
+
"url": "https://atomiks.github.io/tippyjs/",
|
166
|
+
"license": "MIT"
|
167
|
+
},
|
168
|
+
"xlsx": {
|
169
|
+
"version": "0.18.5",
|
170
|
+
"url": "https://sheetjs.com/",
|
171
|
+
"license": "Apache-2.0"
|
186
172
|
}
|
187
173
|
};
|