@fto-consult/expo-ui 7.5.45 → 7.6.2
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/babel.config.alias.js +1 -19
- package/bin/index.js +0 -152
- package/bin/update-appex-chart.js +1 -1
- package/bin/update-pdfmake.js +1 -1
- package/bin/utils.js +1 -1
- package/copy-env-file.js +3 -6
- package/create-transpile-module-transformer.js +1 -1
- package/find-licenses.js +1 -1
- package/package.json +3 -4
- package/src/screens/Help/openLibraries.js +339 -1
- package/bin/init.js +0 -95
- package/electron/app/desktopCapturer.js +0 -123
- package/electron/app/email.js +0 -55
- package/electron/app/file.js +0 -501
- package/electron/app/index.html +0 -32
- package/electron/app/index.js +0 -19
- package/electron/app/instance.js +0 -46
- package/electron/create-index-file.js +0 -15
- package/electron/dependencies.js +0 -13
- package/electron/index.js +0 -560
- package/electron/init/index.js +0 -0
- package/electron/init/main.js +0 -55
- package/electron/init/renderer.js +0 -6
- package/electron/is-initialized.js +0 -11
- package/electron/pload.js +0 -88
- package/electron/preload.js +0 -461
- package/electron/tools.js +0 -0
- package/electron/utils/config.js +0 -30
- package/electron/utils/copy.js +0 -20
- package/electron/utils/createDir.js +0 -30
- package/electron/utils/createDirSync.js +0 -31
- package/electron/utils/debounce.js +0 -19
- package/electron/utils/dependencies.js +0 -10
- package/electron/utils/env.js +0 -80
- package/electron/utils/exec.js +0 -81
- package/electron/utils/getDirname.js +0 -14
- package/electron/utils/getIcon.js +0 -25
- package/electron/utils/index.js +0 -24
- package/electron/utils/isBase64.js +0 -14
- package/electron/utils/isDataURL.js +0 -13
- package/electron/utils/isValidUrl.js +0 -4
- package/electron/utils/json.js +0 -57
- package/electron/utils/parseArgs.js +0 -21
- package/electron/utils/paths.js +0 -11
- package/electron/utils/postMessage.js +0 -19
- package/electron/utils/replaceAll.js +0 -12
- package/electron/utils/session.js +0 -5
- package/electron/utils/uniqid.js +0 -33
- package/electron/utils/writeFile.js +0 -14
@@ -1 +1,339 @@
|
|
1
|
-
module.exports = {
|
1
|
+
module.exports = {
|
2
|
+
"@fto-consult/expo-ui": {
|
3
|
+
"name": "@fto-consult/expo-ui",
|
4
|
+
"version": "7.6.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"
|
10
|
+
},
|
11
|
+
"@babel/plugin-proposal-export-namespace-from": {
|
12
|
+
"version": "7.18.9",
|
13
|
+
"url": "https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from",
|
14
|
+
"license": "MIT"
|
15
|
+
},
|
16
|
+
"@emotion/native": {
|
17
|
+
"version": "11.11.0",
|
18
|
+
"url": "https://emotion.sh",
|
19
|
+
"license": "MIT"
|
20
|
+
},
|
21
|
+
"@emotion/react": {
|
22
|
+
"version": "11.11.1",
|
23
|
+
"url": "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
24
|
+
"license": "MIT"
|
25
|
+
},
|
26
|
+
"@expo/html-elements": {
|
27
|
+
"version": "0.5.1",
|
28
|
+
"url": "https://github.com/expo/expo/tree/main/packages/html-elements",
|
29
|
+
"license": "MIT"
|
30
|
+
},
|
31
|
+
"@expo/metro-config": {
|
32
|
+
"version": "0.10.7",
|
33
|
+
"url": "https://github.com/expo/expo.git",
|
34
|
+
"license": "MIT"
|
35
|
+
},
|
36
|
+
"@expo/vector-icons": {
|
37
|
+
"version": "13.0.0",
|
38
|
+
"url": "https://expo.github.io/vector-icons",
|
39
|
+
"license": "MIT"
|
40
|
+
},
|
41
|
+
"@expo/webpack-config": {
|
42
|
+
"version": "19.0.0",
|
43
|
+
"url": "https://github.com/expo/expo-cli.git",
|
44
|
+
"license": "MIT"
|
45
|
+
},
|
46
|
+
"@faker-js/faker": {
|
47
|
+
"version": "8.0.2",
|
48
|
+
"url": "https://github.com/faker-js/faker.git",
|
49
|
+
"license": "MIT"
|
50
|
+
},
|
51
|
+
"@fto-consult/common": {
|
52
|
+
"version": "3.73.10",
|
53
|
+
"url": "https://github.com/borispipo/common#readme",
|
54
|
+
"license": "ISC"
|
55
|
+
},
|
56
|
+
"@fto-consult/electron": {
|
57
|
+
"version": "1.0.2",
|
58
|
+
"license": "ISC"
|
59
|
+
},
|
60
|
+
"@pchmn/expo-material3-theme": {
|
61
|
+
"version": "1.3.1",
|
62
|
+
"url": "https://github.com/pchmn/expo-material3-theme#readme",
|
63
|
+
"license": "MIT"
|
64
|
+
},
|
65
|
+
"@react-native-async-storage/async-storage": {
|
66
|
+
"version": "1.18.2",
|
67
|
+
"url": "https://github.com/react-native-async-storage/async-storage#readme",
|
68
|
+
"license": "MIT"
|
69
|
+
},
|
70
|
+
"@react-native-community/datetimepicker": {
|
71
|
+
"version": "7.2.0",
|
72
|
+
"url": "https://github.com/react-native-community/datetimepicker#readme",
|
73
|
+
"license": "MIT"
|
74
|
+
},
|
75
|
+
"@react-native-community/netinfo": {
|
76
|
+
"version": "9.3.10",
|
77
|
+
"url": "https://github.com/react-native-netinfo/react-native-netinfo#readme",
|
78
|
+
"license": "MIT"
|
79
|
+
},
|
80
|
+
"@react-native/assets-registry": {
|
81
|
+
"version": "0.72.0",
|
82
|
+
"url": "git@github.com:facebook/react-native.git",
|
83
|
+
"license": "MIT"
|
84
|
+
},
|
85
|
+
"@react-navigation/native": {
|
86
|
+
"version": "6.1.9",
|
87
|
+
"url": "https://reactnavigation.org",
|
88
|
+
"license": "MIT"
|
89
|
+
},
|
90
|
+
"@react-navigation/native-stack": {
|
91
|
+
"version": "6.9.17",
|
92
|
+
"url": "https://github.com/software-mansion/react-native-screens#readme",
|
93
|
+
"license": "MIT"
|
94
|
+
},
|
95
|
+
"@react-navigation/stack": {
|
96
|
+
"version": "6.3.20",
|
97
|
+
"url": "https://reactnavigation.org/docs/stack-navigator/",
|
98
|
+
"license": "MIT"
|
99
|
+
},
|
100
|
+
"@shopify/flash-list": {
|
101
|
+
"version": "1.4.3",
|
102
|
+
"url": "https://shopify.github.io/flash-list/",
|
103
|
+
"license": "MIT"
|
104
|
+
},
|
105
|
+
"apexcharts": {
|
106
|
+
"version": "3.45.0",
|
107
|
+
"url": "https://apexcharts.com",
|
108
|
+
"license": "MIT"
|
109
|
+
},
|
110
|
+
"babel-plugin-inline-dotenv": {
|
111
|
+
"version": "1.7.0",
|
112
|
+
"url": "https://github.com/brysgo/babel-plugin-inline-dotenv#readme",
|
113
|
+
"license": "ISC"
|
114
|
+
},
|
115
|
+
"babel-plugin-module-resolver": {
|
116
|
+
"version": "5.0.0",
|
117
|
+
"url": "https://github.com/tleunen/babel-plugin-module-resolver.git",
|
118
|
+
"license": "MIT"
|
119
|
+
},
|
120
|
+
"commander": {
|
121
|
+
"version": "11.1.0",
|
122
|
+
"url": "https://github.com/tj/commander.js.git",
|
123
|
+
"license": "MIT"
|
124
|
+
},
|
125
|
+
"expo": {
|
126
|
+
"version": "49.0.21",
|
127
|
+
"url": "https://github.com/expo/expo/tree/main/packages/expo",
|
128
|
+
"license": "MIT"
|
129
|
+
},
|
130
|
+
"expo-camera": {
|
131
|
+
"version": "13.4.4",
|
132
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/camera/",
|
133
|
+
"license": "MIT"
|
134
|
+
},
|
135
|
+
"expo-clipboard": {
|
136
|
+
"version": "4.3.1",
|
137
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/clipboard",
|
138
|
+
"license": "MIT"
|
139
|
+
},
|
140
|
+
"expo-font": {
|
141
|
+
"version": "11.4.0",
|
142
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/font/",
|
143
|
+
"license": "MIT"
|
144
|
+
},
|
145
|
+
"expo-image-picker": {
|
146
|
+
"version": "14.3.2",
|
147
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/imagepicker/",
|
148
|
+
"license": "MIT"
|
149
|
+
},
|
150
|
+
"expo-linking": {
|
151
|
+
"version": "5.0.2",
|
152
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/linking",
|
153
|
+
"license": "MIT"
|
154
|
+
},
|
155
|
+
"expo-sharing": {
|
156
|
+
"version": "11.5.0",
|
157
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/sharing/",
|
158
|
+
"license": "MIT"
|
159
|
+
},
|
160
|
+
"expo-sqlite": {
|
161
|
+
"version": "11.3.3",
|
162
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/sqlite/",
|
163
|
+
"license": "MIT"
|
164
|
+
},
|
165
|
+
"expo-status-bar": {
|
166
|
+
"version": "1.6.0",
|
167
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/status-bar/",
|
168
|
+
"license": "MIT"
|
169
|
+
},
|
170
|
+
"expo-system-ui": {
|
171
|
+
"version": "2.4.0",
|
172
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/system-ui",
|
173
|
+
"license": "MIT"
|
174
|
+
},
|
175
|
+
"expo-web-browser": {
|
176
|
+
"version": "12.3.2",
|
177
|
+
"url": "https://docs.expo.dev/versions/latest/sdk/webbrowser/",
|
178
|
+
"license": "MIT"
|
179
|
+
},
|
180
|
+
"file-saver": {
|
181
|
+
"version": "2.0.5",
|
182
|
+
"url": "https://github.com/eligrey/FileSaver.js#readme",
|
183
|
+
"license": "MIT"
|
184
|
+
},
|
185
|
+
"fs-extra": {
|
186
|
+
"version": "11.2.0",
|
187
|
+
"url": "https://github.com/jprichardson/node-fs-extra",
|
188
|
+
"license": "MIT"
|
189
|
+
},
|
190
|
+
"google-libphonenumber": {
|
191
|
+
"version": "3.2.33",
|
192
|
+
"url": "https://ruimarinho.github.io/google-libphonenumber/",
|
193
|
+
"license": "(MIT AND Apache-2.0)"
|
194
|
+
},
|
195
|
+
"htmlparser2-without-node-native": {
|
196
|
+
"version": "3.9.2",
|
197
|
+
"url": "git://github.com/fb55/htmlparser2.git",
|
198
|
+
"license": "MIT"
|
199
|
+
},
|
200
|
+
"is-plain-obj": {
|
201
|
+
"version": "4.1.0",
|
202
|
+
"license": "MIT"
|
203
|
+
},
|
204
|
+
"js-base64": {
|
205
|
+
"version": "3.7.5",
|
206
|
+
"license": "BSD-3-Clause"
|
207
|
+
},
|
208
|
+
"pdfmake": {
|
209
|
+
"version": "0.2.8",
|
210
|
+
"url": "http://pdfmake.org",
|
211
|
+
"license": "MIT"
|
212
|
+
},
|
213
|
+
"process": {
|
214
|
+
"version": "0.11.10",
|
215
|
+
"url": "git://github.com/shtylman/node-process.git",
|
216
|
+
"license": "MIT"
|
217
|
+
},
|
218
|
+
"prop-types": {
|
219
|
+
"version": "15.8.1",
|
220
|
+
"url": "https://facebook.github.io/react/",
|
221
|
+
"license": "MIT"
|
222
|
+
},
|
223
|
+
"react": {
|
224
|
+
"version": "18.2.0",
|
225
|
+
"url": "https://reactjs.org/",
|
226
|
+
"license": "MIT"
|
227
|
+
},
|
228
|
+
"react-content-loader": {
|
229
|
+
"version": "6.2.1",
|
230
|
+
"url": "https://github.com/danilowoz/react-content-loader",
|
231
|
+
"license": "MIT"
|
232
|
+
},
|
233
|
+
"react-dom": {
|
234
|
+
"version": "18.2.0",
|
235
|
+
"url": "https://reactjs.org/",
|
236
|
+
"license": "MIT"
|
237
|
+
},
|
238
|
+
"react-native": {
|
239
|
+
"version": "0.72.6",
|
240
|
+
"license": "MIT"
|
241
|
+
},
|
242
|
+
"react-native-big-list": {
|
243
|
+
"version": "1.6.1",
|
244
|
+
"url": "https://marcocesarato.github.io/react-native-big-list-docs/",
|
245
|
+
"license": "GPL-3.0-or-later"
|
246
|
+
},
|
247
|
+
"react-native-blob-util": {
|
248
|
+
"version": "0.18.6",
|
249
|
+
"url": "https://github.com/RonRadtke/react-native-blob-util",
|
250
|
+
"license": "MIT"
|
251
|
+
},
|
252
|
+
"react-native-get-random-values": {
|
253
|
+
"version": "1.9.0",
|
254
|
+
"license": "MIT"
|
255
|
+
},
|
256
|
+
"react-native-iphone-x-helper": {
|
257
|
+
"version": "1.3.1",
|
258
|
+
"url": "https://github.com/ptelad/react-native-iphone-x-helper#readme",
|
259
|
+
"license": "MIT"
|
260
|
+
},
|
261
|
+
"react-native-mime-types": {
|
262
|
+
"version": "2.4.0",
|
263
|
+
"license": "MIT"
|
264
|
+
},
|
265
|
+
"react-native-paper": {
|
266
|
+
"version": "5.11.4",
|
267
|
+
"url": "https://callstack.github.io/react-native-paper",
|
268
|
+
"license": "MIT"
|
269
|
+
},
|
270
|
+
"react-native-paper-dates": {
|
271
|
+
"version": "0.20.5",
|
272
|
+
"url": "https://github.com/web-ridge/react-native-paper-dates#readme",
|
273
|
+
"license": "MIT"
|
274
|
+
},
|
275
|
+
"react-native-reanimated": {
|
276
|
+
"version": "3.3.0",
|
277
|
+
"url": "https://github.com/software-mansion/react-native-reanimated#readme",
|
278
|
+
"license": "MIT"
|
279
|
+
},
|
280
|
+
"react-native-safe-area-context": {
|
281
|
+
"version": "4.6.3",
|
282
|
+
"url": "https://github.com/th3rdwave/react-native-safe-area-context#readme",
|
283
|
+
"license": "MIT"
|
284
|
+
},
|
285
|
+
"react-native-screens": {
|
286
|
+
"version": "3.22.1",
|
287
|
+
"url": "https://github.com/software-mansion/react-native-screens#readme",
|
288
|
+
"license": "MIT"
|
289
|
+
},
|
290
|
+
"react-native-svg": {
|
291
|
+
"version": "13.9.0",
|
292
|
+
"url": "https://github.com/react-native-community/react-native-svg",
|
293
|
+
"license": "MIT"
|
294
|
+
},
|
295
|
+
"react-native-web": {
|
296
|
+
"version": "0.19.9",
|
297
|
+
"url": "git://github.com/necolas/react-native-web.git",
|
298
|
+
"license": "MIT"
|
299
|
+
},
|
300
|
+
"react-native-webview": {
|
301
|
+
"version": "13.2.2",
|
302
|
+
"url": "https://github.com/react-native-webview/react-native-webview#readme",
|
303
|
+
"license": "MIT"
|
304
|
+
},
|
305
|
+
"react-virtuoso": {
|
306
|
+
"version": "4.6.2",
|
307
|
+
"url": "https://virtuoso.dev/",
|
308
|
+
"license": "MIT"
|
309
|
+
},
|
310
|
+
"sanitize-filename": {
|
311
|
+
"version": "1.6.3",
|
312
|
+
"url": "git@github.com:parshap/node-sanitize-filename.git",
|
313
|
+
"license": "WTFPL OR ISC"
|
314
|
+
},
|
315
|
+
"sharp-cli": {
|
316
|
+
"version": "2.1.0",
|
317
|
+
"url": "https://github.com/vseventer/sharp-cli",
|
318
|
+
"license": "MIT"
|
319
|
+
},
|
320
|
+
"tippy.js": {
|
321
|
+
"version": "6.3.7",
|
322
|
+
"url": "https://atomiks.github.io/tippyjs/",
|
323
|
+
"license": "MIT"
|
324
|
+
},
|
325
|
+
"uninstall": {
|
326
|
+
"version": "0.0.0",
|
327
|
+
"license": "MIT"
|
328
|
+
},
|
329
|
+
"websql": {
|
330
|
+
"version": "2.0.3",
|
331
|
+
"url": "git://github.com/nolanlawson/node-websql.git",
|
332
|
+
"license": "Apache-2.0"
|
333
|
+
},
|
334
|
+
"xlsx": {
|
335
|
+
"version": "0.18.5",
|
336
|
+
"url": "https://sheetjs.com/",
|
337
|
+
"license": "Apache-2.0"
|
338
|
+
}
|
339
|
+
};
|
package/bin/init.js
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
const path= require("path");
|
2
|
-
const fs = require("fs");
|
3
|
-
const exec = require("../electron/utils/exec");
|
4
|
-
const createDir = require("../electron/utils/createDir");
|
5
|
-
const writeFile = require("../electron/utils/writeFile");
|
6
|
-
const copy = require("../electron/utils/copy");
|
7
|
-
const electronDir = path.resolve(__dirname,"..","electron");
|
8
|
-
const createIndexFile = require("../electron/create-index-file");
|
9
|
-
const appSuffix = "-desk";
|
10
|
-
const mainPackage = require("../package.json");
|
11
|
-
const mainPackageName = mainPackage.name;
|
12
|
-
|
13
|
-
module.exports = ({projectRoot,electronProjectRoot,icon})=>{
|
14
|
-
return new Promise((resolve,reject)=>{
|
15
|
-
//make shure electron project root exists
|
16
|
-
if(!createDir(electronProjectRoot)){
|
17
|
-
throw "Unable to create electron project root directory at "+electronProjectRoot;
|
18
|
-
}
|
19
|
-
const mPackageJSON = Object.assign({},require(`${path.resolve(projectRoot,'package.json')}`));
|
20
|
-
const electronPackagePath = path.resolve(electronProjectRoot,"package.json");
|
21
|
-
const electronPackageJSON = Object.assign({},fs.existsSync(electronPackagePath)? require(electronPackagePath) : {});
|
22
|
-
const projectRootPackage = {icon,...mPackageJSON,...electronPackageJSON};
|
23
|
-
const dependencies = require("../electron/dependencies");
|
24
|
-
const electronProjectRootPackage = path.resolve(electronProjectRoot,"package.json");
|
25
|
-
projectRootPackage.main = `index.js`;
|
26
|
-
projectRootPackage.dependencies = {...dependencies.main,...Object.assign(electronPackageJSON.dependencies)};
|
27
|
-
projectRootPackage.dependencies[mainPackage.name] = mainPackage.version;
|
28
|
-
projectRootPackage.devDependencies = {...dependencies.dev,...Object.assign({},electronPackageJSON.devDependencies)};
|
29
|
-
projectRootPackage.scripts = {
|
30
|
-
"build" : `npx ${mainPackageName} electron build`,
|
31
|
-
"start" : `npx ${mainPackageName} electron start`,
|
32
|
-
"run-dev" : `npx ${mainPackageName} electron start`,
|
33
|
-
"compile2start" : `npx ${mainPackageName} electron start --build`,
|
34
|
-
...Object.assign({},electronPackageJSON.scripts)
|
35
|
-
}
|
36
|
-
projectRootPackage.name = projectRootPackage.name;
|
37
|
-
projectRootPackage.realAppName = typeof projectRootPackage.realAppName =="string" && projectRootPackage.realAppName || projectRootPackage.name;
|
38
|
-
if(!projectRootPackage.name.endsWith(appSuffix)){
|
39
|
-
projectRootPackage.name +=appSuffix;
|
40
|
-
}
|
41
|
-
writeFile(electronProjectRootPackage,JSON.stringify(projectRootPackage,null,'\t'));
|
42
|
-
if(!fs.existsSync(electronProjectRootPackage)){
|
43
|
-
throw `unable to create ${electronProjectRootPackage} file`;
|
44
|
-
}
|
45
|
-
const mainFolder = path.resolve(electronProjectRoot,'processes',"main");
|
46
|
-
const rendererFolder = path.resolve(electronProjectRoot,'processes',"renderer");
|
47
|
-
if(!createDir(mainFolder)){
|
48
|
-
throw `unable to create main process folder at ${mainFolder}`
|
49
|
-
}
|
50
|
-
if(!createDir(rendererFolder)){
|
51
|
-
throw `unable to create renderer process folder at ${rendererFolder}`;
|
52
|
-
}
|
53
|
-
const mainFolderIndex = path.resolve(mainFolder,"index.js");
|
54
|
-
const rendererFolderIndex = path.resolve(rendererFolder,"index.js");
|
55
|
-
if(!fs.existsSync(mainFolderIndex)){
|
56
|
-
copy(path.resolve(electronDir,"init","main.js"),mainFolderIndex);
|
57
|
-
}
|
58
|
-
if(!fs.existsSync(rendererFolderIndex)){
|
59
|
-
copy(path.resolve(electronDir,"init","renderer.js"),rendererFolderIndex);
|
60
|
-
}
|
61
|
-
createIndexFile(electronProjectRoot);
|
62
|
-
/**** copying all electron utils files */
|
63
|
-
const utilsPath = path.resolve(electronProjectRoot,"utils");
|
64
|
-
copy(path.resolve(electronDir,"utils"),utilsPath);
|
65
|
-
const gP = path.resolve(electronProjectRoot,".gitignore") ;
|
66
|
-
if(!fs.existsSync(gP)){
|
67
|
-
try {
|
68
|
-
writeFile(gP,require("./gitignore"));
|
69
|
-
} catch{};
|
70
|
-
}
|
71
|
-
try {
|
72
|
-
|
73
|
-
} catch(e){}
|
74
|
-
console.log("installing package dependencies ...");
|
75
|
-
return exec({
|
76
|
-
cmd : "npm install",// --prefix "+electronProjectRoot,
|
77
|
-
projectRoot : electronProjectRoot,
|
78
|
-
}).then((a)=>{
|
79
|
-
return resolve(a);
|
80
|
-
}).catch(reject);
|
81
|
-
})
|
82
|
-
}
|
83
|
-
|
84
|
-
const copyExtra = (path2)=>{
|
85
|
-
fs.readdirSync(path2).forEach((file) => {
|
86
|
-
if(!file || file.toLowerCase() =="dist") return;
|
87
|
-
file = path.join(path2,file);
|
88
|
-
const stat = fs.statSync(file);
|
89
|
-
if(stat.isDirectory()){
|
90
|
-
return copyExtra(file);
|
91
|
-
}
|
92
|
-
if(!stat.isFile() || file === indexFile) return;
|
93
|
-
extraResource.push(file);
|
94
|
-
});
|
95
|
-
}
|
@@ -1,123 +0,0 @@
|
|
1
|
-
module.exports = (ELECTRON)=>{
|
2
|
-
let ProgressBar = require("./ProgressBar")
|
3
|
-
let progressBarCounter = 0;
|
4
|
-
function getUserMedia(constraints) {
|
5
|
-
let check = typeof constraints === "boolean"? true : false;
|
6
|
-
if(check){
|
7
|
-
constraints = {};
|
8
|
-
}
|
9
|
-
// if Promise-based API is available, use it
|
10
|
-
if (isObj(navigator.mediaDevices)) {
|
11
|
-
if(check === true) return true;
|
12
|
-
return navigator.mediaDevices.getUserMedia(constraints);
|
13
|
-
}
|
14
|
-
|
15
|
-
// otherwise try falling back to old, possibly prefixed API...
|
16
|
-
var legacyApi = navigator.getUserMedia || navigator.webkitGetUserMedia ||
|
17
|
-
navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
18
|
-
if(check === true){
|
19
|
-
return legacyApi ? true : false;
|
20
|
-
}
|
21
|
-
if (legacyApi) {
|
22
|
-
return new Promise(function (resolve, reject) {
|
23
|
-
legacyApi.bind(navigator)(constraints, resolve, reject);
|
24
|
-
});
|
25
|
-
}
|
26
|
-
return Promise.reject({status:false,msg:"user media not available"})
|
27
|
-
}
|
28
|
-
const { desktopCapturer,ipcRenderer } = require('electron')
|
29
|
-
let SECRET_KEY = require("../app.config").id;
|
30
|
-
ipcRenderer.on("click-on-system-tray-menu-item",(event,opts)=>{
|
31
|
-
opts = defaultObj(opts);
|
32
|
-
switch(opts.action){
|
33
|
-
case "pauseRecording":
|
34
|
-
return pauseRecording();
|
35
|
-
case "stopRecording":
|
36
|
-
return stopRecording();
|
37
|
-
case "resumeRecording" :
|
38
|
-
return resumeRecording();
|
39
|
-
}
|
40
|
-
}),
|
41
|
-
updateSystemTray = ()=>{
|
42
|
-
let {isPaused,isRecording} = APP.desktopCapturer.getRecordingStatus();
|
43
|
-
/*ipcRenderer.send("update-system-tray",{
|
44
|
-
tooltip : isRecording? ("La capture vidéo est en cours d'enregistrement"):(isPaused? "La capture vidéo est en pause":"La capture vidéo est inactive"),
|
45
|
-
contextMenu : isRecording || isPaused? JSON.stringify([
|
46
|
-
{ label: isRecording? 'Mettre en pause':'Relancer la capture vidéo',action:isRecording?'pauseRecording':'resumeRecording'},
|
47
|
-
{ label: 'Arréter la capture vidéo',action:'stopRecording'}
|
48
|
-
]): null
|
49
|
-
});*/
|
50
|
-
if(!APP.COMPANY.showPreloaderOnScreenCapture){
|
51
|
-
if(progressBarCounter !== 0){
|
52
|
-
progressBarCounter = 0;
|
53
|
-
ProgressBar.set(0);
|
54
|
-
}
|
55
|
-
return false;
|
56
|
-
}
|
57
|
-
if((isPaused || !isRecording)){
|
58
|
-
progressBarCounter = 0;
|
59
|
-
} else if(isRecording){
|
60
|
-
progressBarCounter+=2;
|
61
|
-
} else progressBarCounter = 0;
|
62
|
-
ProgressBar.set(progressBarCounter);
|
63
|
-
}
|
64
|
-
async function getUserMediaAsync(constraints) {
|
65
|
-
try {
|
66
|
-
const stream = await getUserMedia(constraints);
|
67
|
-
return stream;
|
68
|
-
} catch (e) {
|
69
|
-
console.error('navigator.getUserMedia error:', e);
|
70
|
-
}
|
71
|
-
return null;
|
72
|
-
}
|
73
|
-
function startRecording(opts) {
|
74
|
-
opts = defaultObj(opts)
|
75
|
-
var title = document.title;
|
76
|
-
document.title = SECRET_KEY;
|
77
|
-
opts.video = defaultObj(opts.video);
|
78
|
-
let audio = isBool(opts.audio) && !opts.audio ? false : defaultObj(opts.audio);
|
79
|
-
let handleStream = defaultFunc(opts.handleStream), handleUserMediaError = defaultFunc(opts.handleUserMediaError)
|
80
|
-
let video = {
|
81
|
-
...opts.video,
|
82
|
-
mandatory: {
|
83
|
-
...defaultObj(opts.video.mandatory),
|
84
|
-
chromeMediaSource: 'desktop',
|
85
|
-
}
|
86
|
-
}
|
87
|
-
return desktopCapturer.getSources({ types: ['window', 'screen'] }).then(function(sources) {
|
88
|
-
for (let i = 0; i < sources.length; i++) {
|
89
|
-
let src = sources[i];
|
90
|
-
if (src.name === SECRET_KEY) {
|
91
|
-
document.title = title;
|
92
|
-
video.mandatory.chromeMediaSourceId = src.id;
|
93
|
-
if(audio){
|
94
|
-
(async() => {
|
95
|
-
const audioStream = await getUserMediaAsync(APP.desktopCapturer.getAudioConstraint())
|
96
|
-
const videoStream = await getUserMediaAsync({audio:false,video})
|
97
|
-
if(audioStream && videoStream){
|
98
|
-
const combinedStream = new MediaStream([...videoStream.getVideoTracks(), ...audioStream.getAudioTracks()])
|
99
|
-
handleStream(combinedStream)
|
100
|
-
}
|
101
|
-
})();
|
102
|
-
} else {
|
103
|
-
getUserMedia({audio:false,video}).then(handleStream).catch(handleUserMediaError);
|
104
|
-
}
|
105
|
-
return {sources,currentSource:src,isRecording:true};
|
106
|
-
}
|
107
|
-
}
|
108
|
-
return {sources,isRecording:false};
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
if(!isObj(ELECTRON.desktopCapturer)){
|
113
|
-
Object.defineProperties(ELECTRON,{
|
114
|
-
desktopCapturer : {
|
115
|
-
value : {
|
116
|
-
updateSystemTray,
|
117
|
-
startRecording,
|
118
|
-
}
|
119
|
-
,override:false,writable:false
|
120
|
-
}
|
121
|
-
})
|
122
|
-
}
|
123
|
-
}
|
package/electron/app/email.js
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
const nodemailer = require("nodemailer");
|
2
|
-
let Email = {}
|
3
|
-
let getEmailSettings = x => defaultObj(APP.getRemoteInfos().get("smtp"));
|
4
|
-
let isAvailable = ()=>{
|
5
|
-
if(!window.APP || typeof window.APP == "undefined") return false;
|
6
|
-
let infos = getEmailSettings();
|
7
|
-
let isR = infos.host && infos.port && infos.password && isNonNullString(infos.user)? true : false;
|
8
|
-
if(!isR){
|
9
|
-
APP.getRemoteInfos().check();
|
10
|
-
}
|
11
|
-
return isR;
|
12
|
-
}
|
13
|
-
let notAllowedMsg = 'Impossible d\'envoyer un mail car cette fonction n\'est pas disponible pour cette installation du logiciel';
|
14
|
-
Object.defineProperties(Email,{
|
15
|
-
send : {
|
16
|
-
value : (opts)=>{
|
17
|
-
if(!isAvailable()) return Promise.reject({msg:notAllowedMsg})
|
18
|
-
let emailSettings =getEmailSettings();
|
19
|
-
opts = defaultObj(opts);
|
20
|
-
opts.auth = {
|
21
|
-
user: emailSettings.user, // generated ethereal user
|
22
|
-
pass: defaultStr(emailSettings.pass,emailSettings.password), // generated ethereal password
|
23
|
-
}
|
24
|
-
if(!opts.from || !isValidEmail(opts.from)){
|
25
|
-
opts.from = defaultStr(emailSettings.email,APP.getDevMail());
|
26
|
-
}
|
27
|
-
if(Array.isArray(opts.to)){
|
28
|
-
opts.to = opts.to.join(",");
|
29
|
-
}
|
30
|
-
let transporter = nodemailer.createTransport({
|
31
|
-
...emailSettings,
|
32
|
-
auth: {
|
33
|
-
user: emailSettings.user, // generated ethereal user
|
34
|
-
pass: defaultStr(emailSettings.pass,emailSettings.password), // generated ethereal password
|
35
|
-
},
|
36
|
-
});
|
37
|
-
showPreloader(defaultStr(opts.preloader,"envoie de l'email en cours..."))
|
38
|
-
return new Promise((resolve,reject)=>{
|
39
|
-
transporter.sendMail(opts, function(err, reply) {
|
40
|
-
hidePreloader();
|
41
|
-
if(err){
|
42
|
-
console.log(err," error sending email")
|
43
|
-
//APP.require("$notify").error(err);
|
44
|
-
reject(err);
|
45
|
-
} else resolve(reply);
|
46
|
-
|
47
|
-
})
|
48
|
-
})
|
49
|
-
}
|
50
|
-
},
|
51
|
-
nodemailer : {value : nodemailer},
|
52
|
-
isAvailable : {value : isAvailable},
|
53
|
-
notAllowedMsg : {value : notAllowedMsg}
|
54
|
-
})
|
55
|
-
module.exports = Email;
|