@wavemaker/app-rn-runtime 11.11.1-rc.6142 → 11.11.2-1.6157

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.
Files changed (30) hide show
  1. package/components/advanced/carousel/carousel.component.js +14 -3
  2. package/components/advanced/carousel/carousel.component.js.map +1 -1
  3. package/components/chart/bar-chart/bar-chart.component.js +4 -3
  4. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  5. package/components/chart/theme/chart.theme.js +1 -1
  6. package/components/chart/theme/chart.theme.js.map +1 -1
  7. package/components/container/tabs/tabs.component.js +3 -3
  8. package/components/container/tabs/tabs.component.js.map +1 -1
  9. package/components/container/wizard/wizard.component.js +28 -4
  10. package/components/container/wizard/wizard.component.js.map +1 -1
  11. package/components/container/wizard/wizard.props.js +5 -0
  12. package/components/container/wizard/wizard.props.js.map +1 -1
  13. package/components/data/form/form-field/form-field.component.js +1 -0
  14. package/components/data/form/form-field/form-field.component.js.map +1 -1
  15. package/components/data/form/form-field/form-field.props.js +1 -0
  16. package/components/data/form/form-field/form-field.props.js.map +1 -1
  17. package/components/data/list/list.component.js +1 -1
  18. package/components/data/list/list.component.js.map +1 -1
  19. package/components/dialogs/dialog/dialog.component.js +5 -53
  20. package/components/dialogs/dialog/dialog.component.js.map +1 -1
  21. package/components/dialogs/dialogcontent/dialogcontent.component.js +0 -2
  22. package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  23. package/components/input/slider/slider.component.js +49 -10
  24. package/components/input/slider/slider.component.js.map +1 -1
  25. package/components/input/slider/slider.props.js.map +1 -1
  26. package/npm-shrinkwrap.json +224 -214
  27. package/package-lock.json +224 -214
  28. package/package.json +5 -3
  29. package/variables/device/file/open-file.operation.js +71 -0
  30. package/variables/device/file/open-file.operation.js.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-rn-runtime",
3
- "version": "11.11.1-rc.6142",
3
+ "version": "11.11.2-1.6157",
4
4
  "description": "''",
5
5
  "main": "index",
6
6
  "module": "index",
@@ -49,7 +49,7 @@
49
49
  "@react-navigation/drawer": "6.6.3",
50
50
  "@react-navigation/native": "6.1.7",
51
51
  "@react-navigation/stack": "6.3.29",
52
- "@wavemaker/variables": "11.11.1-rc.6142",
52
+ "@wavemaker/variables": "11.11.2-1.6157",
53
53
  "axios": "1.6.8",
54
54
  "color": "4.2.3",
55
55
  "cross-env": "7.0.3",
@@ -81,7 +81,9 @@
81
81
  "react-xml-parser": "1.1.8",
82
82
  "expo-image": "2.0.3",
83
83
  "expo-blur": "14.0.3",
84
- "expo-navigation-bar": "4.0.8"
84
+ "expo-navigation-bar": "4.0.8",
85
+ "expo-sharing": "13.0.1",
86
+ "expo-file-system": "18.0.4"
85
87
  },
86
88
  "devDependencies": {
87
89
  "@babel/core": "7.25.2",
@@ -0,0 +1,71 @@
1
+ import * as FileSystem from 'expo-file-system';
2
+ import * as Sharing from 'expo-sharing';
3
+ import { FileExtensionTypesMap } from '@wavemaker/app-rn-runtime/core/file-extension-types';
4
+
5
+ // Supported file extensions mentioned in Wavemaker docs [https://docs.wavemaker.com/learn/app-development/variables/device-variables#openfile]
6
+ const supportedExtensions = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'];
7
+ export class OpenFileOperation {
8
+ openInShare(data) {
9
+ if (!data || !data.fileLocalPath) {
10
+ return Promise.reject('unable to open the file');
11
+ }
12
+ return Sharing.isAvailableAsync().then(response => {
13
+ if (response) {
14
+ const fileName = data.filePath.split('/')[data.filePath.split('/').length - 1];
15
+ Sharing.shareAsync(data.fileLocalPath, {
16
+ mimeType: FileExtensionTypesMap[this.getFileExtension(fileName)]
17
+ });
18
+ return data;
19
+ } else {
20
+ return Promise.reject('unable to open the file');
21
+ }
22
+ });
23
+ }
24
+ checkIfFileExists(fileLocation) {
25
+ return FileSystem.getInfoAsync(fileLocation).then(fileInfo => fileInfo);
26
+ }
27
+ getFileExtension(fileName) {
28
+ const arr = fileName.split('.');
29
+ const fileExtension = ('.' + arr[arr.length - 1]).toLocaleLowerCase();
30
+ return fileExtension;
31
+ }
32
+ checkIfSupportedFile(fileName) {
33
+ const fileExtension = this.getFileExtension(fileName);
34
+ if (supportedExtensions.includes(fileExtension)) {
35
+ return true;
36
+ }
37
+ return false;
38
+ }
39
+ invoke(params) {
40
+ if (FileSystem.cacheDirectory === null) {
41
+ return Promise.reject('Error is setting up device directory');
42
+ }
43
+ const fileName = params.filePath.split('/')[params.filePath.split('/').length - 1];
44
+ if (!this.checkIfSupportedFile(fileName)) {
45
+ return Promise.reject('Unsupported file');
46
+ }
47
+ const fileLocation = FileSystem.cacheDirectory + fileName;
48
+ return Promise.resolve().then(() => {
49
+ return this.checkIfFileExists(fileLocation);
50
+ }).then(data => {
51
+ if (data.exists && data.uri) {
52
+ return {
53
+ fileLocalPath: fileLocation,
54
+ ...params
55
+ };
56
+ }
57
+ const downloadResumable = FileSystem.createDownloadResumable(params.filePath, fileLocation, {
58
+ cache: true
59
+ }, () => {});
60
+ return downloadResumable.downloadAsync().then(response => {
61
+ return {
62
+ fileLocalPath: fileLocation,
63
+ ...params
64
+ };
65
+ });
66
+ }).then(response => {
67
+ return this.openInShare(response);
68
+ });
69
+ }
70
+ }
71
+ //# sourceMappingURL=open-file.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FileSystem","Sharing","FileExtensionTypesMap","supportedExtensions","OpenFileOperation","openInShare","data","fileLocalPath","Promise","reject","isAvailableAsync","then","response","fileName","filePath","split","length","shareAsync","mimeType","getFileExtension","checkIfFileExists","fileLocation","getInfoAsync","fileInfo","arr","fileExtension","toLocaleLowerCase","checkIfSupportedFile","includes","invoke","params","cacheDirectory","resolve","exists","uri","downloadResumable","createDownloadResumable","cache","downloadAsync"],"sources":["open-file.operation.tsx"],"sourcesContent":["import * as FileSystem from 'expo-file-system';\nimport * as Sharing from 'expo-sharing';\n\nimport { Operation } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport { FileExtensionTypesMap } from '@wavemaker/app-rn-runtime/core/file-extension-types';\n\n// Supported file extensions mentioned in Wavemaker docs [https://docs.wavemaker.com/learn/app-development/variables/device-variables#openfile]\nconst supportedExtensions = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx']\n\nexport interface OpenFileInput {\n filePath: string;\n fileType: string;\n serverUrl: string;\n}\n\nexport interface OpenFileOutput extends OpenFileInput {\n fileLocalPath: string;\n}\n\nexport class OpenFileOperation implements Operation {\n public openInShare(data: OpenFileOutput) {\n if(!data || !data.fileLocalPath){\n return Promise.reject('unable to open the file'); \n }\n\n return Sharing.isAvailableAsync().then((response: boolean) => {\n if(response) {\n const fileName = data.filePath.split('/')[data.filePath.split('/').length - 1];\n Sharing.shareAsync(data.fileLocalPath, {\n mimeType: FileExtensionTypesMap[this.getFileExtension(fileName)]\n });\n return data;\n } else {\n return Promise.reject('unable to open the file');\n }\n })\n }\n\n public checkIfFileExists(fileLocation: string) {\n return FileSystem.getInfoAsync(fileLocation).then(fileInfo => fileInfo);\n }\n\n public getFileExtension(fileName: string): string {\n const arr = fileName.split('.');\n const fileExtension = ('.' + arr[arr.length - 1]).toLocaleLowerCase();\n return fileExtension;\n }\n public checkIfSupportedFile(fileName: string): boolean {\n const fileExtension = this.getFileExtension(fileName);\n if (supportedExtensions.includes(fileExtension)) {\n return true\n }\n\n return false\n }\n\n public invoke(params: OpenFileInput): Promise<OpenFileOutput> {\n if (FileSystem.cacheDirectory === null) {\n return Promise.reject('Error is setting up device directory');\n }\n const fileName = params.filePath.split('/')[params.filePath.split('/').length - 1];\n\n if(!this.checkIfSupportedFile(fileName)) {\n return Promise.reject('Unsupported file');\n }\n \n const fileLocation = FileSystem.cacheDirectory + fileName;\n\n return Promise.resolve().then(() => {\n return this.checkIfFileExists(fileLocation)\n }).then((data: any) => {\n if (data.exists && data.uri) {\n return { fileLocalPath: fileLocation, ...params };\n }\n\n const downloadResumable = FileSystem.createDownloadResumable(\n params.filePath,\n fileLocation,\n {\n cache: true\n },\n () => { }\n );\n\n return downloadResumable.downloadAsync()\n .then((response) => {\n return { fileLocalPath: fileLocation, ...params };\n })\n }).then((response: OpenFileOutput) => {\n return this.openInShare(response)\n });\n }\n}\n"],"mappings":"AAAA,OAAO,KAAKA,UAAU,MAAM,kBAAkB;AAC9C,OAAO,KAAKC,OAAO,MAAM,cAAc;AAGvC,SAASC,qBAAqB,QAAQ,qDAAqD;;AAE3F;AACA,MAAMC,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;AAYvF,OAAO,MAAMC,iBAAiB,CAAsB;EAC3CC,WAAWA,CAACC,IAAoB,EAAE;IACvC,IAAG,CAACA,IAAI,IAAI,CAACA,IAAI,CAACC,aAAa,EAAC;MAC9B,OAAOC,OAAO,CAACC,MAAM,CAAC,yBAAyB,CAAC;IAClD;IAEA,OAAOR,OAAO,CAACS,gBAAgB,CAAC,CAAC,CAACC,IAAI,CAAEC,QAAiB,IAAK;MAC5D,IAAGA,QAAQ,EAAE;QACX,MAAMC,QAAQ,GAAGP,IAAI,CAACQ,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC,CAACT,IAAI,CAACQ,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,MAAM,GAAG,CAAC,CAAC;QAC9Ef,OAAO,CAACgB,UAAU,CAACX,IAAI,CAACC,aAAa,EAAE;UACnCW,QAAQ,EAAEhB,qBAAqB,CAAC,IAAI,CAACiB,gBAAgB,CAACN,QAAQ,CAAC;QACnE,CAAC,CAAC;QACF,OAAOP,IAAI;MACb,CAAC,MAAM;QACL,OAAOE,OAAO,CAACC,MAAM,CAAC,yBAAyB,CAAC;MAClD;IACF,CAAC,CAAC;EACJ;EAEOW,iBAAiBA,CAACC,YAAoB,EAAE;IAC7C,OAAOrB,UAAU,CAACsB,YAAY,CAACD,YAAY,CA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