@fto-consult/expo-ui 8.38.0 → 8.40.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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.40.0",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"scripts": {
|
6
6
|
"clear-npx-cache": "npx clear-npx-cache",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"dependencies": {
|
69
69
|
"@emotion/react": "^11.11.1",
|
70
70
|
"@faker-js/faker": "^8.0.2",
|
71
|
-
"@fto-consult/common": "^4.
|
71
|
+
"@fto-consult/common": "^4.35.9",
|
72
72
|
"@fto-consult/node-utils": "^1.7.1",
|
73
73
|
"apexcharts": "^3.47.0",
|
74
74
|
"crypto-browserify": "^3.12.0",
|
@@ -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){
|
@@ -12,13 +12,14 @@ export default function print(pdfMakeInstance,options,...rest){
|
|
12
12
|
return pdfMakeInstance.getBase64((content)=>{
|
13
13
|
let fileName = defaultStr(options?.fileName);
|
14
14
|
if(!fileName){
|
15
|
-
fileName = "printed-pdf-"+DateLib.format(new Date(),"dd-mm-yyyy HH MM
|
15
|
+
fileName = "printed-pdf-"+DateLib.format(new Date(),"dd-mm-yyyy HH MM ss");
|
16
16
|
}
|
17
17
|
const ext = getFileExtension(fileName,true);
|
18
18
|
if(!ext || ext.toLowerCase() !=="pdf"){
|
19
19
|
fileName+=".pdf";
|
20
20
|
}
|
21
|
-
|
21
|
+
logRNWebview("printing pdf file",options?.fileName,WEBVIEW_SAVE_FILE_EVENT);
|
22
|
+
return postWebviewMessage(WEBVIEW_SAVE_FILE_EVENT,{
|
22
23
|
content,
|
23
24
|
contentType : 'application/pdf',
|
24
25
|
fileName,
|
@@ -1,21 +1,22 @@
|
|
1
1
|
module.exports = {
|
2
2
|
"@fto-consult/expo-ui": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"type": "git",
|
7
|
-
"url": "git+https://github.com/borispipo/expo-ui.git"
|
8
|
-
},
|
9
|
-
"homepage": "https://github.com/borispipo/expo-ui#readme"
|
3
|
+
"version": "8.39.0",
|
4
|
+
"url": "https://github.com/borispipo/expo-ui#readme",
|
5
|
+
"license": "ISC"
|
10
6
|
},
|
11
7
|
"@babel/plugin-proposal-export-namespace-from": {
|
12
8
|
"version": "7.18.9",
|
13
9
|
"url": "https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from",
|
14
10
|
"license": "MIT"
|
15
11
|
},
|
16
|
-
"@emotion/
|
17
|
-
"version": "11.11.
|
18
|
-
"url": "https://
|
12
|
+
"@emotion/native": {
|
13
|
+
"version": "11.11.0",
|
14
|
+
"url": "https://emotion.sh",
|
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",
|
19
20
|
"license": "MIT"
|
20
21
|
},
|
21
22
|
"@expo/metro-config": {
|
@@ -23,28 +24,49 @@ module.exports = {
|
|
23
24
|
"url": "https://github.com/expo/expo.git",
|
24
25
|
"license": "MIT"
|
25
26
|
},
|
27
|
+
"@expo/vector-icons": {
|
28
|
+
"version": "14.0.0",
|
29
|
+
"url": "https://expo.github.io/vector-icons",
|
30
|
+
"license": "MIT"
|
31
|
+
},
|
26
32
|
"@expo/webpack-config": {
|
27
33
|
"version": "19.0.1",
|
28
34
|
"url": "https://github.com/expo/expo-webpack-integrations/tree/main/packages/webpack-config#readme",
|
29
35
|
"license": "MIT"
|
30
36
|
},
|
31
|
-
"@
|
32
|
-
"version": "
|
33
|
-
"url": "https://github.com/
|
37
|
+
"@pchmn/expo-material3-theme": {
|
38
|
+
"version": "1.3.2",
|
39
|
+
"url": "https://github.com/pchmn/expo-material3-theme#readme",
|
34
40
|
"license": "MIT"
|
35
41
|
},
|
36
|
-
"@
|
37
|
-
"version": "
|
38
|
-
"url": "https://github.com/
|
39
|
-
"license": "
|
42
|
+
"@react-native-community/netinfo": {
|
43
|
+
"version": "11.1.0",
|
44
|
+
"url": "https://github.com/react-native-netinfo/react-native-netinfo#readme",
|
45
|
+
"license": "MIT"
|
46
|
+
},
|
47
|
+
"@react-native/assets-registry": {
|
48
|
+
"version": "0.72.0",
|
49
|
+
"url": "git@github.com:facebook/react-native.git",
|
50
|
+
"license": "MIT"
|
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"
|
40
61
|
},
|
41
|
-
"@
|
42
|
-
"version": "
|
62
|
+
"@react-navigation/stack": {
|
63
|
+
"version": "6.3.25",
|
64
|
+
"url": "https://reactnavigation.org/docs/stack-navigator/",
|
43
65
|
"license": "MIT"
|
44
66
|
},
|
45
|
-
"
|
46
|
-
"version": "
|
47
|
-
"url": "https://
|
67
|
+
"@shopify/flash-list": {
|
68
|
+
"version": "1.6.3",
|
69
|
+
"url": "https://shopify.github.io/flash-list/",
|
48
70
|
"license": "MIT"
|
49
71
|
},
|
50
72
|
"babel-plugin-inline-dotenv": {
|
@@ -57,53 +79,64 @@ module.exports = {
|
|
57
79
|
"url": "https://github.com/tleunen/babel-plugin-module-resolver.git",
|
58
80
|
"license": "MIT"
|
59
81
|
},
|
60
|
-
"
|
61
|
-
"version": "
|
62
|
-
"url": "https://github.com/
|
82
|
+
"expo": {
|
83
|
+
"version": "50.0.11",
|
84
|
+
"url": "https://github.com/expo/expo/tree/main/packages/expo",
|
85
|
+
"license": "MIT"
|
86
|
+
},
|
87
|
+
"expo-camera": {
|
88
|
+
"version": "14.0.6",
|
89
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/camera/",
|
63
90
|
"license": "MIT"
|
64
91
|
},
|
65
|
-
"
|
66
|
-
"version": "
|
67
|
-
"url": "https://
|
92
|
+
"expo-clipboard": {
|
93
|
+
"version": "5.0.1",
|
94
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/clipboard",
|
68
95
|
"license": "MIT"
|
69
96
|
},
|
70
|
-
"
|
71
|
-
"version": "
|
72
|
-
"url": "https://
|
73
|
-
"license": "
|
97
|
+
"expo-font": {
|
98
|
+
"version": "11.10.3",
|
99
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/font/",
|
100
|
+
"license": "MIT"
|
74
101
|
},
|
75
|
-
"
|
76
|
-
"version": "
|
77
|
-
"url": "https://
|
102
|
+
"expo-image-picker": {
|
103
|
+
"version": "14.7.1",
|
104
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/imagepicker/",
|
78
105
|
"license": "MIT"
|
79
106
|
},
|
80
|
-
"
|
81
|
-
"version": "
|
82
|
-
"url": "
|
107
|
+
"expo-linking": {
|
108
|
+
"version": "6.2.2",
|
109
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/linking",
|
83
110
|
"license": "MIT"
|
84
111
|
},
|
85
|
-
"
|
86
|
-
"version": "
|
112
|
+
"expo-sharing": {
|
113
|
+
"version": "11.10.0",
|
114
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/sharing/",
|
87
115
|
"license": "MIT"
|
88
116
|
},
|
89
|
-
"
|
90
|
-
"version": "3.
|
91
|
-
"url": "https://
|
117
|
+
"expo-sqlite": {
|
118
|
+
"version": "13.3.0",
|
119
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/sqlite/",
|
92
120
|
"license": "MIT"
|
93
121
|
},
|
94
|
-
"
|
95
|
-
"version": "
|
96
|
-
"url": "https://
|
122
|
+
"expo-status-bar": {
|
123
|
+
"version": "1.11.1",
|
124
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/status-bar/",
|
97
125
|
"license": "MIT"
|
98
126
|
},
|
99
|
-
"
|
100
|
-
"version": "
|
101
|
-
"url": "https://
|
127
|
+
"expo-system-ui": {
|
128
|
+
"version": "2.9.3",
|
129
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/system-ui",
|
102
130
|
"license": "MIT"
|
103
131
|
},
|
104
|
-
"
|
105
|
-
"version": "
|
106
|
-
"url": "https://
|
132
|
+
"expo-web-browser": {
|
133
|
+
"version": "12.8.2",
|
134
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/webbrowser/",
|
135
|
+
"license": "MIT"
|
136
|
+
},
|
137
|
+
"react-native": {
|
138
|
+
"version": "0.73.4",
|
139
|
+
"url": "https://reactnative.dev/",
|
107
140
|
"license": "MIT"
|
108
141
|
},
|
109
142
|
"react-native-big-list": {
|
@@ -111,63 +144,44 @@ module.exports = {
|
|
111
144
|
"url": "https://marcocesarato.github.io/react-native-big-list-docs/",
|
112
145
|
"license": "GPL-3.0-or-later"
|
113
146
|
},
|
114
|
-
"react-native-
|
115
|
-
"version": "
|
116
|
-
"url": "https://github.com/
|
147
|
+
"react-native-blob-util": {
|
148
|
+
"version": "0.18.6",
|
149
|
+
"url": "https://github.com/RonRadtke/react-native-blob-util",
|
117
150
|
"license": "MIT"
|
118
151
|
},
|
119
|
-
"react-native-
|
120
|
-
"version": "2.
|
152
|
+
"react-native-gesture-handler": {
|
153
|
+
"version": "2.14.1",
|
154
|
+
"url": "https://github.com/software-mansion/react-native-gesture-handler#readme",
|
121
155
|
"license": "MIT"
|
122
156
|
},
|
123
|
-
"react-native-
|
124
|
-
"version": "
|
125
|
-
"url": "https://
|
157
|
+
"react-native-reanimated": {
|
158
|
+
"version": "3.6.2",
|
159
|
+
"url": "https://github.com/software-mansion/react-native-reanimated#readme",
|
126
160
|
"license": "MIT"
|
127
161
|
},
|
128
|
-
"react-native-
|
129
|
-
"version": "
|
130
|
-
"url": "https://github.com/
|
162
|
+
"react-native-safe-area-context": {
|
163
|
+
"version": "4.8.2",
|
164
|
+
"url": "https://github.com/th3rdwave/react-native-safe-area-context#readme",
|
131
165
|
"license": "MIT"
|
132
166
|
},
|
133
|
-
"react-native-
|
134
|
-
"version": "
|
135
|
-
"url": "
|
167
|
+
"react-native-screens": {
|
168
|
+
"version": "3.29.0",
|
169
|
+
"url": "https://github.com/software-mansion/react-native-screens#readme",
|
136
170
|
"license": "MIT"
|
137
171
|
},
|
138
|
-
"react-
|
139
|
-
"version": "
|
140
|
-
"url": "https://
|
172
|
+
"react-native-svg": {
|
173
|
+
"version": "14.1.0",
|
174
|
+
"url": "https://github.com/react-native-community/react-native-svg",
|
141
175
|
"license": "MIT"
|
142
176
|
},
|
143
|
-
"
|
144
|
-
"version": "
|
145
|
-
"url": "https://github.com/
|
177
|
+
"react-native-view-shot": {
|
178
|
+
"version": "3.8.0",
|
179
|
+
"url": "https://github.com/gre/react-native-view-shot",
|
146
180
|
"license": "MIT"
|
147
181
|
},
|
148
|
-
"
|
149
|
-
"version": "
|
150
|
-
"url": "
|
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",
|
182
|
+
"react-native-webview": {
|
183
|
+
"version": "13.6.4",
|
184
|
+
"url": "https://github.com/react-native-webview/react-native-webview#readme",
|
161
185
|
"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"
|
172
186
|
}
|
173
187
|
};
|