@fto-consult/expo-ui 8.84.0 → 9.0.1

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.
@@ -3,7 +3,7 @@ const fs = require("fs");
3
3
 
4
4
  module.exports = (opts)=>{
5
5
  const dir = path.resolve(__dirname);
6
- const isDev = String(process.env.NODE_ENV).toLowerCase() !="production";
6
+ const isDev = String(process.env.NODE_ENV).toLowerCase().trim() !="production";
7
7
  const projectRoot = typeof opts.projectRoot =='string' && fs.existsSync(opts.projectRoot.trim()) && opts.projectRoot.trim() || process.cwd();
8
8
  opts = typeof opts =='object' && opts ? opts : {};
9
9
  opts.platform = "expo";
@@ -12,7 +12,7 @@ module.exports = (opts)=>{
12
12
  opts.assets = opts.assets || opts.alias && typeof opts.alias =='object' && opts.alias.$assets || assets;
13
13
  opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
14
14
  delete opts.withPouchdb;
15
- const expoUI = require("./expo-ui-path")();
15
+ const expoUI = require("./expo-ui-path")(projectRoot);
16
16
  const cPath = isDev && fs.existsSync(path.resolve(expoUI,"node_modules","@fto-consult","common"))? path.resolve(expoUI,"node_modules","@fto-consult","common") : null;
17
17
  const r = require(`${cPath ? path.resolve(cPath,"babel.config.alias.js"):'@fto-consult/common/babel.config.alias'}`)(opts);
18
18
  const expo = path.resolve(expoUI,"src");
package/babel.config.js CHANGED
@@ -3,15 +3,10 @@ const fs = require("fs");
3
3
 
4
4
  module.exports = function(api,opts) {
5
5
  opts = typeof opts =='object' && opts ? opts : {};
6
- const inlineDovOptions = { unsafe: true};
7
6
  const platform = api.caller(caller => caller && caller.platform);
8
7
  const isWeb = platform === 'web';
9
8
  const options = {...opts,isWeb,isAndroid:platform==="android",isIos : platform==="ios",platform:"expo"};
10
- const environmentPath = require("./copy-env-file")();
11
- if(environmentPath && fs.existsSync(environmentPath)){
12
- inlineDovOptions.path ='./.env';
13
- }
14
- /*** par défaut, les variables d'environnements sont stockés dans le fichier .env situé à la racine du projet, référencée par la prop base */
9
+ options.projectRoot = typeof options.projectRoot == 'string' && fs.existsSync(path.resolve(options.projectRoot)) ? path.resolve(options.projectRoot) : process.cwd();
15
10
  const alias = require("./babel.config.alias")(options);
16
11
  if(typeof options.aliasMutator =="function"){
17
12
  options.aliasMutator({...options,alias});
@@ -35,7 +30,6 @@ module.exports = function(api,opts) {
35
30
  ],
36
31
  plugins : [
37
32
  ...plugins,
38
- ["inline-dotenv",inlineDovOptions],
39
33
  ["module-resolver", {"alias": alias}],
40
34
  "@babel/plugin-proposal-export-namespace-from",
41
35
  ...(reanimated?[reanimated]:[]),
@@ -1,3 +1,4 @@
1
+ import "@expo/metro-runtime";
1
2
  import 'react-native-gesture-handler';//please do not remove this line
2
3
  import "$session";//please do not remove this line
3
4
  import { registerRootComponent } from 'expo';
@@ -7,7 +7,7 @@
7
7
  "orientation": "portrait",
8
8
  "expoSdkVersion" : "50",
9
9
  "web": {
10
- "bundler": "webpack"
10
+ "bundler": "metro"
11
11
  },
12
12
  "android": {
13
13
  "package": "com.borispipo.ftoconsultexpoui"
@@ -4,36 +4,39 @@
4
4
  "@expo/html-elements": "^0.5.1",
5
5
  "@expo/vector-icons": "^14.0.0",
6
6
  "@pchmn/expo-material3-theme": "^1.3.2",
7
- "@react-native-community/netinfo": "11.1.0",
8
- "@react-native/assets-registry": "^0.72.0",
7
+ "@react-native-community/netinfo": "11.3.1",
8
+ "@react-native-community/netinfo": "11.3.1",
9
9
  "react-native-get-random-values": "~1.8.0",
10
10
  "@react-navigation/native": "^6.1.17",
11
- "@react-navigation/native-stack": "^6.9.26",
11
+ "@react-navigation/native-stack": "^6.9.26",
12
12
  "@react-navigation/stack": "^6.3.29",
13
- "@shopify/flash-list": "1.6.3",
14
- "expo": "^50.0.17",
15
- "expo-camera": "~14.1.3",
16
- "expo-clipboard": "~5.0.1",
17
- "expo-font": "~11.10.3",
18
- "expo-image-picker": "~14.7.1",
19
- "expo-linking": "~6.2.2",
20
- "expo-sharing": "~11.10.0",
21
- "expo-sqlite": "~13.4.0",
22
- "expo-status-bar": "~1.11.1",
23
- "expo-system-ui": "~2.9.4",
24
- "expo-web-browser": "~12.8.2",
25
- "react": "18.2.0",
26
- "react-native": "0.73.6",
27
- "react-native-safe-area-context": "4.8.2",
28
- "react-native-screens": "~3.29.0",
29
- "react-native-svg": "14.1.0",
30
- "react-native-webview": "13.6.4",
31
- "react-native-gesture-handler": "~2.14.0",
32
- "react-native-reanimated": "~3.6.2",
33
- "react-native-view-shot": "3.8.0",
34
- "expo-intent-launcher": "~10.11.0",
35
- "expo-image-manipulator": "~11.8.0",
36
- "expo-document-picker": "~11.10.1",
37
- "react-native-web": "~0.19.6"
13
+ "@shopify/flash-list": "1.6.4",
14
+
15
+ "expo": "51.0.0",
16
+ "expo-camera": "~15.0.4",
17
+ "expo-clipboard": "~6.0.3",
18
+ "expo-document-picker": "~12.0.1",
19
+ "expo-font": "~12.0.4",
20
+ "expo-image-manipulator": "~12.0.3",
21
+ "expo-image-picker": "~15.0.4",
22
+ "expo-intent-launcher": "~11.0.1",
23
+ "expo-linking": "~6.3.1",
24
+ "@expo/metro-runtime": "^3.2.1",
25
+ "expo-sharing": "~12.0.1",
26
+ "expo-sqlite": "~14.0.3",
27
+ "expo-status-bar": "~1.12.1",
28
+ "expo-system-ui": "~3.0.4",
29
+ "expo-web-browser": "~13.0.3",
30
+ "react-native": "0.74.1",
31
+ "react-native-gesture-handler": "~2.16.1",
32
+ "react-native-get-random-values": "~1.11.0",
33
+ "react-native-reanimated": "3.10.0",
34
+ "react-native-safe-area-context": "4.10.1",
35
+ "react-native-screens": "3.31.1",
36
+ "react-native-svg": "15.2.0-rc.0",
37
+ "react-native-view-shot": "3.8.0",
38
+ "react-native-web": "~0.19.10",
39
+ "react-native-webview": "13.8.6",
40
+ "react-virtuoso": "latest",
38
41
  };
39
42
 
@@ -1,7 +1,6 @@
1
1
  module.exports = [
2
2
  "@babel/plugin-proposal-export-namespace-from",
3
3
  "@expo/metro-config",
4
- "@expo/webpack-config",
5
4
  "babel-plugin-inline-dotenv",
6
5
  "babel-plugin-module-resolver"
7
6
  ]
package/bin/create-app.js CHANGED
@@ -75,7 +75,7 @@ module.exports = function(appName,{projectRoot:root}){
75
75
  writeFile(mainPackagePath,JSON.stringify(mainPackage,null,2),{overwrite:true});
76
76
  }
77
77
  console.log("creating application .....");
78
- ["babel.config.js","metro.config.js","webpack.config.js"].map((p)=>{
78
+ ["babel.config.js","metro.config.js"].map((p)=>{
79
79
  const rP = path.join(projectRoot,p);
80
80
  const pp = path.join(getAppDir(),p);
81
81
  if(!fs.existsSync(rP) && fs.existsSync(pp)){
@@ -98,7 +98,6 @@ module.exports = function(appName,{projectRoot:root}){
98
98
  });
99
99
  }
100
100
  const defaultDevDependencies = {
101
- "@expo/webpack-config":"latest",
102
101
  "@expo/metro-config" : "latest",
103
102
  }
104
103
  const createEntryFile = (projectRoot)=>{
@@ -191,7 +190,7 @@ electron/**/*
191
190
  },
192
191
  "web": {
193
192
  "favicon": "./assets/favicon.png",
194
- "bundler": "webpack"
193
+ "bundler": "metro"
195
194
  }
196
195
  }
197
196
  }
package/bin/update.js CHANGED
@@ -24,7 +24,7 @@ if(fs.existsSync(mainJSONPath)){
24
24
  });
25
25
  const filteredDeps = Object.keys(filterdDObj);
26
26
  if(filteredDeps.length){
27
- exec(`npm install @fto-consult/expo-ui@latest expo@latest`,{projectRoot}).finally(()=>{
27
+ exec(`npm install @fto-consult/expo-ui expo`,{projectRoot}).finally(()=>{
28
28
  exec(`npx expo install ${filteredDeps.join(" ")}`,{projectRoot}).finally((i)=>{
29
29
  (new Promise((resolve)=>{
30
30
  devDependencies.length ? exec(`npm uninstall ${devDependencies.join(" ")}`,{projectRoot}).finally(()=>{
@@ -0,0 +1 @@
1
+ Upgrade to SDK 51 : https://expo.dev/changelog/2024/05-07-sdk-51
package/expo-ui-path.js CHANGED
@@ -4,34 +4,29 @@
4
4
 
5
5
  const fs = require("fs");
6
6
  const path = require("path");
7
+ const {JSONManager} = require("@fto-consult/node-utils");
7
8
  ///retourne le chemin vers le package @expo-ui
8
- module.exports = function (){
9
- const ag = Array.prototype.slice.call(arguments,0);
10
- let suffix ="";
11
- ag.map(p=>{
12
- if(typeof p ==='string' && p){
13
- suffix = path.join(suffix,p);
14
- }
15
- })
9
+ module.exports = function (projectRoot){
16
10
  const sep = path.sep;
17
11
  if(require("./is-local-dev")()){//le programme s'exécute en environnement fix bugs sur electron
18
- return path.resolve(__dirname,suffix).replace(sep,(sep+sep));///pour la résolution du module expo-ui en mode test
12
+ return path.resolve(__dirname).replace(sep,(sep+sep));///pour la résolution du module expo-ui en mode test
19
13
  }
20
- const isDevEnv = process?.env?.WEBPACK_SERVE && 'development' === process.env.NODE_ENV;
21
- const packageJSON = path.resolve(process.cwd(),"package.json");
22
- const expoUIPath = path.resolve(process.cwd(),"node_modules","@fto-consult","expo-ui");
23
- if(isDevEnv && fs.existsSync(packageJSON)){
24
- try {
25
- const package = require(`${packageJSON}`);
26
- if(package && typeof package =='object' && package?.expoUIRootPath && typeof package.expoUIRootPath ==='string'){
27
- const p = path.resolve(package.expoUIRootPath);
28
- if(fs.existsSync(p) && fs.existsSync(path.resolve(p,"src")) && fs.existsSync(path.resolve(p,"webpack.config.js"))){
29
- return path.resolve(p,suffix).replace(sep,(sep+sep));
14
+ const isDev = String(process.env.NODE_ENV).toLowerCase().trim() !="production";
15
+ projectRoot = typeof projectRoot =='string' && fs.existsSync(path.resolve(projectRoot)) && path.resolve(projectRoot) || process.cwd();
16
+ const packageJSON = path.resolve(projectRoot,"package.json");
17
+ const expoUIPath = path.resolve(projectRoot,"node_modules","@fto-consult","expo-ui");
18
+ if(isDev && fs.existsSync(packageJSON)){
19
+ const pM = JSONManager(packageJSON);
20
+ if(pM.hasPackage){
21
+ const expoUIRootPath = pM.get("expoUIRootPath");
22
+ if(typeof expoUIRootPath =="string" && expoUIRootPath){
23
+ const p = path.resolve(expoUIRootPath);
24
+ const pM2 = JSONManager(path.resolve(expoUIRootPath,"package.json"));
25
+ if(pM2.hasPackage && pM2.get("name") =="@fto-consult/expo-ui" && fs.existsSync(p) && fs.existsSync(path.resolve(p,"src"))){
26
+ return p;
30
27
  }
31
28
  }
32
-
33
- } catch (e){}
29
+ }
34
30
  }
35
- /***** old dev env */
36
- return suffix ? path.join(expoUIPath,suffix).replace(sep,"/"): expoUIPath;
31
+ return expoUIPath;
37
32
  };
package/metro.config.js CHANGED
@@ -3,6 +3,7 @@ const fs = require("fs");
3
3
  const { getDefaultConfig } = require('@expo/metro-config');
4
4
  module.exports = function(opts){
5
5
  opts = opts && typeof opts =='object'? opts : {};
6
+ const isDev = String(process.env.NODE_ENV).toLowerCase().trim() !="production";
6
7
  let {assetExts,sourceExts} = opts;
7
8
  assetExts = Array.isArray(assetExts)? assetExts: [];
8
9
  sourceExts= Array.isArray(sourceExts)?sourceExts : [];
@@ -38,6 +39,10 @@ module.exports = function(opts){
38
39
  'jsx', 'js','tsx',
39
40
  ]
40
41
  config.watchFolders = Array.isArray(config.watchFolders)? config.watchFolders : [];
42
+ const expoUIP = require("./expo-ui-path")(projectRoot);
43
+ if(!config.watchFolders.includes(expoUIP)){
44
+ config.watchFolders.push(expoUIP);
45
+ }
41
46
  let hasFTO = false;
42
47
  for(let i in config.watchFolders){
43
48
  if(typeof config.watchFolders[i] ==="string" && config.watchFolders[i].includes("@fto-consult")){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.84.0",
3
+ "version": "9.0.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "react-native-paper-doc": "https://github.com/callstack/react-native-paper/tree/main/docs/docs/guides",
6
6
  "scripts": {
@@ -31,9 +31,6 @@
31
31
  "install-apk": "adb -s emulator-5554 install myapp.apk",
32
32
  "android-emulator": "emulator -avd EMULATOR",
33
33
  "flipper": "npx cross-env METRO_SERVER_PORT=19000 E:\\Studies\\react-native\\debugger\\Flipper-win\\Flipper.exe",
34
- "test:build": "electron-webpack && electron-builder --dir -c.compression=store -c.mac.identity=null",
35
- "compile-electron": "webpack --env platform=electron",
36
- "compile-electron-p": "webpack --config ./electron/webpack.config.js --mode=production",
37
34
  "electron": "electron ./electron",
38
35
  "logcat": "adb -d logcat com.ftc.apps.salite1:E > errors.txt",
39
36
  "logcat-export": "adb -d logcat com.ftc.apps.salite1 *:S > logcat.txt",
@@ -48,7 +45,7 @@
48
45
  "delete-node-modules": "rimraf ./**/node_modules",
49
46
  "dev": "npx expo start --no-dev --minify -c",
50
47
  "modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
51
- "update": "npm i @fto-consult/common@latest react-native-big-list@latest apexcharts@latest file-saver@latest google-libphonenumber@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest react-virtuoso@latest tippy.js@latest xlsx@latest && npm run update-apexchart && npm run find-licenses"
48
+ "update": "npm i @emotion/react@latest @fto-consult/common@latest react-native-big-list@latest apexcharts@latest file-saver@latest google-libphonenumber@latest react-native-paper@latest react-native-paper-dates@latest react-native-mime-types@latest tippy.js@latest xlsx@latest && npm run update-apexchart && npm run find-licenses"
52
49
  },
53
50
  "bin": {
54
51
  "expo-ui": "bin/index.js"
@@ -68,10 +65,9 @@
68
65
  },
69
66
  "homepage": "https://github.com/borispipo/expo-ui#readme",
70
67
  "dependencies": {
71
- "@emotion/react": "^11.11.1",
68
+ "@emotion/react": "^11.11.4",
72
69
  "@faker-js/faker": "^8.0.2",
73
- "@fto-consult/common": "^4.52.0",
74
- "@fto-consult/expo-ui": "^8.73.1",
70
+ "@fto-consult/common": "^4.52.1",
75
71
  "apexcharts": "^3.49.0",
76
72
  "file-saver": "^2.0.5",
77
73
  "google-libphonenumber": "^3.2.34",
@@ -86,8 +82,6 @@
86
82
  "react-native-mime-types": "^2.5.0",
87
83
  "react-native-paper": "^5.12.3",
88
84
  "react-native-paper-dates": "^0.22.7",
89
- "react-virtuoso": "^4.7.10",
90
- "readable-stream": "^4.5.2",
91
85
  "sanitize-filename": "^1.6.3",
92
86
  "tippy.js": "^6.3.7",
93
87
  "xlsx": "^0.18.5"
@@ -95,12 +89,8 @@
95
89
  "devDependencies": {
96
90
  "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
97
91
  "@expo/metro-config": "~0.17.1",
98
- "@expo/webpack-config": "^19.0.1",
99
92
  "babel-plugin-inline-dotenv": "^1.7.0",
100
93
  "babel-plugin-module-resolver": "^5.0.0",
101
- "crypto-browserify": "^3.12.0",
102
- "sharp-cli": "^2.1.1",
103
- "stream-browserify": "^3.0.0",
104
- "vm": "^0.1.0"
94
+ "sharp-cli": "^2.1.1"
105
95
  }
106
96
  }
package/readMe.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## Installation des dépendences, packages de dévéloppement
2
2
 
3
3
  ```javascript
4
- npm i --D babel-plugin-module-resolver babel-plugin-inline-dotenv @expo/metro-config @expo/webpack-config
4
+ npm i --D babel-plugin-module-resolver babel-plugin-inline-dotenv @expo/metro-config
5
5
  ```
6
6
 
7
7
  ## **#ELECTRON**
@@ -12,14 +12,14 @@ npm i --D babel-plugin-module-resolver babel-plugin-inline-dotenv @expo/metro-co
12
12
 
13
13
  ### `expo-ui [build|start] [compile] [build] [url=local-url] [platform=[win32|darwin|linux|mas]] [arch=x64|x86] [out=outpout dir]`
14
14
 
15
- 1. \[build|start|package\], le script à exécuter : build|start
16
- 2. \[compile\], si l'application sera compilé, via la commande expo export:web; valide lorsque aucune url n'est spécifiée
17
- 3. \[build\]\], si l'exécutable sera crée pour la plateforme \[platform\], valide uniquement pour le script \<\<build>>
18
- 4. \[url=local-url\], l'url à ouvrir via l'application electron (exemple : http://localhost:19006/), valide uniquement pour le script \<\<start>>;
19
- 5. \[platform\], la plateforme vers laquelle on souhaite exporter l'exécutable electron, vailde uniquement pour le script \<\<build>>
20
- 6. \[arch\], l'architecture de l'exécutable à exporter, valide uniquement pour le script \<\<build>>
21
- 7. \[out\], le repertoire destitation, valide pour les scripts \[build et package\]
15
+ 1. \[build|start|package\], le script à exécuter : build|start
16
+ 2. \[compile\], si l'application sera compilé, via la commande expo export:web; valide lorsque aucune url n'est spécifiée
17
+ 3. \[build\]\], si l'exécutable sera crée pour la plateforme \[platform\], valide uniquement pour le script \<\<build>>
18
+ 4. \[url=local-url\], l'url à ouvrir via l'application electron (exemple : http://localhost:19006/), valide uniquement pour le script \<\<start>>;
19
+ 5. \[platform\], la plateforme vers laquelle on souhaite exporter l'exécutable electron, vailde uniquement pour le script \<\<build>>
20
+ 6. \[arch\], l'architecture de l'exécutable à exporter, valide uniquement pour le script \<\<build>>
21
+ 7. \[out\], le repertoire destitation, valide pour les scripts \[build et package\]
22
22
 
23
23
  ## **Générer le fichier binaire**
24
24
 
25
- 1. installer le package electron-packager : `npm install --save-dev electron-packager`
25
+ 1. installer le package electron-packager : `npm install --save-dev electron-packager`
package/src/auth/Login.js CHANGED
@@ -36,7 +36,8 @@ export default function LoginComponent(props){
36
36
  const backgroundColor = theme.colors.surface;
37
37
  const _getForm = x=> getForm(formName);
38
38
  const isMounted = React.useIsMounted();
39
-
39
+ const initializeRef = React.useRef(props.initialize);
40
+ const onStepChangeRef = React.useRef(props.onStepChange);
40
41
  const auth = useAuth();
41
42
  const notifyUser = (message,title)=> {
42
43
  if(isObj(message)){
@@ -87,15 +88,15 @@ export default function LoginComponent(props){
87
88
  React.useEffect(()=>{
88
89
  Preloader.closeAll();
89
90
  /*** pour initializer les cordonnées du composant login */
90
- if(typeof initialize =='function'){
91
- initialize();
91
+ if(typeof initializeRef.current =='function'){
92
+ initializeRef.current();
92
93
  }
93
94
  },[]);
94
95
  const prevStep = React.usePrevious(state.step);
95
96
  React.useEffect(()=>{
96
97
  /*** lorsque le state du composant change */
97
- if(typeof onStepChange =='function'){
98
- return onStepChange({...state,previousStep:prevStep,focusField,nextButtonRef})
98
+ if(typeof onStepChangeRef.current =='function'){
99
+ return onStepChangeRef.current({...state,previousStep:prevStep,focusField,nextButtonRef})
99
100
  }
100
101
  },[state.step]);
101
102
  const getButtonAction = React.useMemo(()=>{
@@ -160,7 +161,7 @@ export default function LoginComponent(props){
160
161
  const mediaQueryUpdateStyle = ()=>{
161
162
  return StyleSheet.flatten([updateMediaQueryStyle()]);
162
163
  };
163
- const withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : true;
164
+ let withScrollView = typeof props.withScrollView =='boolean'? props.withScrollView : true;
164
165
  const Wrapper = withPortal ? ScreenWithoutAuthContainer : withScrollView ? ScrollView: View;
165
166
  if(React.isComponent(Login)) return <Login
166
167
  {...props}
@@ -231,7 +232,15 @@ export default function LoginComponent(props){
231
232
  formProps,
232
233
  wrapperProps : cWrapperProps,
233
234
  title : customTitle,
234
- withScrollView:customWithScrollView,children,initialize,renderNextButton,renderPreviousButton,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,beforeSubmit:beforeSubmitForm,canSubmit:canSubmitForm,onStepChange,...loginProps} = loginPropsMutator(callArgs);
235
+ withScrollView:customWithScrollView,children,initialize,renderNextButton,renderPreviousButton,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,beforeSubmit:beforeSubmitForm,canSubmit:canSubmitForm,onStepChange,...loginProps} = loginPropsMutator(callArgs);
236
+
237
+ if(typeof initialize =="function"){
238
+ initializeRef.current = initialize;
239
+ }
240
+ if(typeof onStepChange =="function"){
241
+ onStepChangeRef.current = onStepChange;
242
+ }
243
+ withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : withScrollView;
235
244
  if(isNonNullString(customTitle)){
236
245
  loginTitle = customTitle;
237
246
  }
@@ -1,4 +1,5 @@
1
1
  import { Image } from 'react-native';
2
+ import { resolveAssetSource } from '$ecomponents/Image';
2
3
 
3
4
  /**
4
5
  * store with
@@ -22,7 +23,7 @@ const loadImageSize = (image) => {
22
23
  return new Promise((resolve, reject) => {
23
24
  //number indicates import X or require(X) was used (i.e. local file)
24
25
  if (typeof image === 'number') {
25
- const { width, height } = Image.resolveAssetSource(image);
26
+ const { width, height } = defaultObj(resolveAssetSource(image));
26
27
  resolve({ width, height });
27
28
  } else {
28
29
  Image.getSize(
@@ -31,12 +31,12 @@ export const defaultHeight = 300;
31
31
  const useNativeDriver = false;
32
32
 
33
33
  const BottomSheetComponent = React.forwardRef((props,ref)=> {
34
- const {
34
+ let {
35
35
  animationType,
36
36
  animationDuration,
37
37
  animationPosition,
38
38
  closeOnDragDown,
39
- //dragFromTopOnly,
39
+ dragFromTopOnly,
40
40
  closeOnPressMask,
41
41
  closeOnPressBack,
42
42
  children,
@@ -62,7 +62,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
62
62
  actionTitle,
63
63
  elevation:customElevation,
64
64
  containerProps : customContainerProps,
65
- backdropProps : customBackdropProps,
65
+ backdropProps,
66
66
  ...rest
67
67
  } = props;
68
68
  const {height:winHeight} = Dimensions.get("window");
@@ -192,7 +192,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
192
192
  transform: pan.getTranslateTransform()
193
193
  };
194
194
  const actionProps = Object.assign({},rest.actionProps);
195
- const backdropProps = defaultObj(backdropProps);
195
+ backdropProps = defaultObj(backdropProps);
196
196
  //actionProps.size = actionProps.size || 25;
197
197
  actionProps.style = [{marginVertical:0,paddingVertical:0},actionProps.style]
198
198
  const aStyle = {color:theme.colors.primaryOnSurface};
@@ -231,7 +231,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
231
231
  React.setRef(ref,null);
232
232
  }
233
233
  },[]);
234
- const dragFromTopOnly = typeof dragFromTopOnly ==='boolean' ? dragFromTopOnly : withScrollView !== false ? true : isTouchDevice();
234
+ dragFromTopOnly = typeof dragFromTopOnly ==='boolean' ? dragFromTopOnly : withScrollView !== false ? true : isTouchDevice();
235
235
  const testID = defaultStr(customTestID,"RN_BottomSheetComponent");
236
236
  const containerProps = defaultObj(customContainerProps);
237
237
  const elevation = typeof customElevation =='number'? Math.ceil(customElevation) : 10;