@fto-consult/expo-ui 4.2.0 → 4.3.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.
@@ -140,7 +140,7 @@ module.exports = (opts)=>{
140
140
  }
141
141
  const jsonPath = path.resolve(base,'package.json');
142
142
  if(fs.existsSync(jsonPath)){
143
- require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.json"));
143
+ require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.app.json"));
144
144
  }
145
145
  ///on sauvegarde les chemins des fichiers utiles, qui seront utilisées par la variable electron plus tard
146
146
  writeFile(path.resolve(dir,"electron","paths.json"),JSON.stringify(electronPaths));
package/bin/init.js CHANGED
@@ -7,6 +7,7 @@ const writeFile = require("../electron/utils/writeFile");
7
7
  const copy = require("../electron/utils/copy");
8
8
  const electronDir = path.resolve(__dirname,"..","electron");
9
9
  const createIndexFile = require("../electron/create-index-file");
10
+ const appSuffix = " Desktop";
10
11
 
11
12
  module.exports = ({
12
13
  projectRoot,
@@ -30,6 +31,11 @@ module.exports = ({
30
31
  "package" : "npx expo-ui electron package",
31
32
  "compile2package" : "npx expo-ui electron package compile"
32
33
  }
34
+ projectRootPackage.realAppName = typeof projectRootPackage.realAppName =="string" && projectRootPackage.realAppName || projectRootPackage.name;
35
+ projectRootPackage.name = projectRootPackage.name.trim();
36
+ if(!projectRootPackage.name.endsWith(appSuffix)){
37
+ projectRootPackage.name +=appSuffix;
38
+ }
33
39
  writeFile(electronProjectRootPackage,JSON.stringify(projectRootPackage,null,'\t'));
34
40
  if(!fs.existsSync(electronProjectRootPackage)){
35
41
  throw `unable to create ${electronProjectRootPackage} file`;
@@ -2,7 +2,8 @@ module.exports = {
2
2
  "main" : {
3
3
  "conf": "^10.2.0",
4
4
  "node-machine-id": "latest",
5
- "fs-extra" : "latest"
5
+ "fs-extra" : "latest",
6
+ "node-sqlite" : "latest",
6
7
  },
7
8
  "dev" : {
8
9
  "electron": "^22.2.0",
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "sage-ftc",
3
+ "version": "1.0.0",
4
+ "description": "Accès distant aux données commerciales et comptables Sage100C de partout",
5
+ "main": "index.js",
6
+ "devMail": "sage-ftc@fto-consulting.com",
7
+ "devWebsite": "http://fto-consulting.com/sage-ftc/",
8
+ "copyRight": "FTO consulting@Août 2022",
9
+ "id": "com.ftc.apps.sage.ftc",
10
+ "theme": {
11
+ "ligth": {
12
+ "primary": "#3D8B5F",
13
+ "secondary": "#354448"
14
+ }
15
+ },
16
+ "convertDatagridFiltersToSQL": true,
17
+ "scripts": {
18
+ "test": "test",
19
+ "start": "npx expo start",
20
+ "start-c": "npx expo start -c",
21
+ "build": "npx expo export:web",
22
+ "electron": "node ./expo-ui/bin start electron url=http://localhost:19006/",
23
+ "build-android": "eas build --clear-cache -p android --profile preview",
24
+ "delete-node-modules": "rimraf ./**/node_modules",
25
+ "package": "node ./expo-ui/bin package compile2"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/borispipo/sage-ftc.git"
30
+ },
31
+ "keywords": [
32
+ "XposeFTC",
33
+ "Sage100C",
34
+ "Accès",
35
+ "distant"
36
+ ],
37
+ "author": "BorisFouomene@fto-consulting",
38
+ "license": "UNLICENCED",
39
+ "bugs": {
40
+ "url": "https://github.com/borispipo/sage-ftc/issues"
41
+ },
42
+ "homepage": "./",
43
+ "dependencies": {
44
+ "@fto-consult/expo-ui": "^4.2.0",
45
+ "react-native": "0.70.5"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
49
+ "@babel/preset-react": "^7.18.6",
50
+ "@expo/metro-config": "^0.5.2",
51
+ "@expo/webpack-config": "^0.17.4",
52
+ "babel-plugin-inline-dotenv": "^1.7.0",
53
+ "babel-plugin-module-resolver": "^4.1.0",
54
+ "babel-plugin-transform-inline-environment-variables": "^0.4.4"
55
+ }
56
+ }
package/index.js CHANGED
@@ -1,36 +1,16 @@
1
1
  import { registerRootComponent } from "expo";
2
2
  import {Platform } from 'react-native';
3
- import { createRoot } from 'react-dom/client';
4
- import appConfig from "$capp/config";
5
3
  import { activateKeepAwake } from 'expo-keep-awake';
6
- //import { startNetworkLogging } from 'react-native-network-logger';
4
+ import App from "./src/App";
7
5
  if (__DEV__) {
8
6
  activateKeepAwake();
9
7
  }
10
8
  const isWeb = Platform.OS === "web";
11
- /**** initialise l'application expoUI avec les paramètres de configuration
12
- * les options sont de la forme :
13
- * {
14
- * config {object}, le fichier de configuration de l'application
15
- * }
16
- */
17
- export default function ExpoUIApp (options){
9
+ export default function registerApp (options){
18
10
  options = options && typeof options =='object' && !Array.isArray(options)? options : {};
19
- const {initConfig,...opts} = options;
20
- appConfig.current = options.config;
21
- if(typeof initConfig ==='function'){
22
- initConfig({appConfig,config:appConfig});
23
- }
24
- const App = require('./src/App').default(opts);
25
- if (false) {
26
- const root = createRoot(document.getElementById("root") || document.getElementById("main"));
27
- } else {
28
- registerRootComponent(App);
29
- }
30
- }
31
-
32
- if(__DEV__ && !isWeb){
33
- //startNetworkLogging();
11
+ registerRootComponent(function(props){
12
+ return <App {...props} {...options}/>
13
+ });
34
14
  }
35
15
 
36
16
  ///fix bug lié au fait que l'application stuck on splashscreen en environnement mobile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.10.0",
62
62
  "@expo/html-elements": "^0.2.0",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^2.18.0",
64
+ "@fto-consult/common": "^2.20.12",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@react-native-async-storage/async-storage": "~1.17.3",
67
67
  "@react-native-community/datetimepicker": "6.5.2",
package/src/App.js CHANGED
@@ -40,10 +40,8 @@ Object.map(Utils,(v,i)=>{
40
40
  window[i] = v;
41
41
  }
42
42
  });
43
- export default function getIndex(options){
44
- const {App,onMount,onUnmount,preferences:appPreferences} = defaultObj(options);
45
- return function MainIndexComponent() {
46
- const isScreenFocusedRef = React.useRef(true);
43
+ export default function getIndex({App,onMount,onUnmount,preferences:appPreferences}){
44
+ const isScreenFocusedRef = React.useRef(true);
47
45
  ///garde pour chaque écran sa date de dernière activité
48
46
  const screensRef = React.useRef({});//la liste des écrans actifs
49
47
  const activeScreenRef = React.useRef('');
@@ -202,7 +200,6 @@ export default function getIndex(options){
202
200
  </GestureHandlerRootView>
203
201
  </SWRConfig>
204
202
  );
205
- }
206
203
  };
207
204
 
208
205
  setDeviceIdRef.current = ()=>{
@@ -6,26 +6,26 @@ import View from "$ecomponents/View"
6
6
  import theme from "$theme";
7
7
  import Label from "$components/Label";
8
8
 
9
- export default function CountryFlagComponent({code,label,withName,withCode,text,containerProps,labelProps,withLabel,tesID,...props}){
9
+ export default function CountryFlagComponent({code,label,withName,withCode,text,containerProps,labelProps,withLabel,testID,...props}){
10
10
  if(!isNonNullString(code)) return null;
11
11
  const country = getCountry(code);
12
- tesID = defaultStr(tesID,"RN_CountryFlagComponent");
13
- if(!country) return <Label tesID={tesID+"_NotFoundCode"}>{code}</Label>;
12
+ testID = defaultStr(testID,"RN_CountryFlagComponent");
13
+ if(!country) return <Label testID={testID+"_NotFoundCode"}>{code}</Label>;
14
14
  //console.log(country," is county");
15
15
  containerProps = Object.assign({},containerProps);
16
16
  labelProps = Object.assign({},labelProps);
17
- return <View {...containerProps} testID={tesID} style={[theme.styles.row,containerProps.style]}>
17
+ return <View {...containerProps} testID={testID} style={[theme.styles.row,containerProps.style]}>
18
18
  {(isNonNullString(country.image) || isNumber(country.image)) ?
19
19
  <Image
20
20
  accessibilityIgnoresInvertColors
21
- tesID ={tesID+"Image"}
21
+ testID ={testID+"Image"}
22
22
  editable = {false}
23
23
  {...props}
24
24
  size = {25}
25
25
  style={[props.style]}
26
26
  src={country.image}
27
27
  /> : null}
28
- {<Label tesID={tesID+"_Label"} {...labelProps} style={[labelProps.style,{marginLeft:5}]}>
28
+ {<Label testID={testID+"_Label"} {...labelProps} style={[labelProps.style,{marginLeft:5}]}>
29
29
  {withName || withLabel ? country.name : withCode ? country.code.toUpperCase() : null}
30
30
  </Label>}
31
31
  </View>
@@ -3,6 +3,8 @@
3
3
  // license that can be found in the LICENSE file.
4
4
  import {navigate,sanitizeName} from "$cnavigation";
5
5
  import {isNonNullString,defaultStr,defaultObj,isObj} from "$utils";
6
+
7
+
6
8
  export const tableDataRouteName = 'TableData';
7
9
 
8
10
  export const navigateToTableData = function(tableName,params,actionType){
@@ -69,3 +71,4 @@ export const navigateToTableDataList = function (tableName,params){
69
71
  return false;
70
72
  }
71
73
 
74
+ export * from "$cnavigation";
@@ -1,32 +0,0 @@
1
- {
2
- "name": "sage-ftc",
3
- "version": "1.0.0",
4
- "description": "Accès distant aux données commerciales et comptables Sage100C de partout",
5
- "main": "./index.js",
6
- "scripts": {
7
- "test": "test",
8
- "start": "npx expo start",
9
- "start-c": "npx expo start -c",
10
- "build": "npx expo export:web",
11
- "electron": "node ./expo-ui/bin start electron url=http://localhost:19006/",
12
- "build-android": "eas build --clear-cache -p android --profile preview",
13
- "delete-node-modules": "rimraf ./**/node_modules",
14
- "package": "node ./expo-ui/bin package compile2"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/borispipo/sage-ftc.git"
19
- },
20
- "keywords": [
21
- "XposeFTC",
22
- "Sage100C",
23
- "Accès",
24
- "distant"
25
- ],
26
- "author": "BorisFouomene@fto-consulting",
27
- "license": "UNLICENCED",
28
- "bugs": {
29
- "url": "https://github.com/borispipo/sage-ftc/issues"
30
- },
31
- "homepage": "./"
32
- }