@fto-consult/expo-ui 7.22.1 → 7.23.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.22.1",
3
+ "version": "7.23.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -71,9 +71,9 @@
71
71
  "@expo/html-elements": "^0.5.1",
72
72
  "@expo/vector-icons": "^13.0.0",
73
73
  "@faker-js/faker": "^8.0.2",
74
- "@fto-consult/common": "^4.6.1",
75
- "@fto-consult/node-utils": "^1.3.4",
76
- "@pchmn/expo-material3-theme": "^1.3.1",
74
+ "@fto-consult/common": "^4.7.2",
75
+ "@fto-consult/node-utils": "^1.4.5",
76
+ "@pchmn/expo-material3-theme": "^1.3.2",
77
77
  "@react-native-async-storage/async-storage": "1.18.2",
78
78
  "@react-native-community/datetimepicker": "7.2.0",
79
79
  "@react-native-community/netinfo": "9.3.10",
@@ -70,7 +70,6 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children}) {
70
70
  hasCallInitApp : false,
71
71
  });
72
72
  React.useEffect(() => {
73
- console.log(isNeutralino(),window,navigator.userAgent," is neutralino");
74
73
  const loadResources = ()=>{
75
74
  return new Promise((resolve)=>{
76
75
  loadFonts(FontsIconsFilter).catch((e)=>{
@@ -50,6 +50,7 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
50
50
  const params = defaultObj(route.params);
51
51
  appBarProps = Object.assign({},appBarProps);
52
52
  notificationsProps = {...Object.assign({},notificationsProps),...Object.assign({},appBarProps.notificationsProps)};
53
+ const notif = React.isComponent(Notifications)? <Notifications {...notificationsProps}/> : React.isValidElement(Notifications)? Notifications : null;
53
54
  const getCallAgs = ()=>{
54
55
  options = defaultObj(options,useScreenOptions());
55
56
  return {navigation,
@@ -115,8 +116,7 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
115
116
  elevation = typeof elevation === 'number'? elevation : undefined;
116
117
  const elevStyle = elevation && Elevations[elevation];
117
118
  titleProps = defaultObj(titleProps);
118
- React.setRef(ref,context);;
119
- const notif = React.isComponent(Notifications)? <Notifications {...notificationsProps}/> : React.isValidElement(Notifications)? Notifications : null;
119
+ React.setRef(ref,context);
120
120
  return (
121
121
  <Appbar.Header elevation={elevation} {...appBarProps} testID={testID} style={[styles.header,{backgroundColor},elevStyle,appBarProps.style]} onLayout={onPageResize}>
122
122
  {backAction}
@@ -19,6 +19,10 @@ export const useApp = useContext;
19
19
  export const ScreenContext = createContext(null);
20
20
 
21
21
  export const useScreen = x=>useReactContext(ScreenContext);
22
+ export const useIsScreenFocused = x=>{
23
+ const s = useScreen();
24
+ return !!(isObj(s) && typeof s.isFocused ==="function" && s.isFocused()) || false
25
+ }
22
26
  export const hasScreenContext = x=>!!useScreen();
23
27
 
24
28
  export const useSWR = (path,options)=>{
@@ -54,6 +54,7 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
54
54
  testID,
55
55
  keyboardAvoidingViewProps,
56
56
  backgroundColor,
57
+ notificationsProps,
57
58
  ...rest
58
59
  } = props;
59
60
 
@@ -62,9 +63,10 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
62
63
  containerProps = defaultObj(containerProps);
63
64
  backgroundColor = theme.Colors.isValid(backgroundColor)? backgroundColor : theme.colors.background;
64
65
  options = defaultObj(options);
65
- appBarProps = defaultObj(appBarProps)
66
+ appBarProps = defaultObj(appBarProps);
66
67
  title = defaultVal(title,appBarProps.title);
67
68
  subtitle = defaultVal(subtitle,appBarProps.subtitle);
69
+ notificationsProps = {...Object.assign({},notificationsProps),...Object.assign({},appBarProps.notificationsProps)};
68
70
  const appBarRef = createAppBarRef();
69
71
  const navigation = useNavigation();
70
72
  fabProps = defaultObj(fabProps);
@@ -93,7 +95,7 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
93
95
  }
94
96
  navigation.setOptions({
95
97
  ...options,
96
- appBarProps:{...options.appBarProps,...appBarProps,title,subtitle},
98
+ appBarProps:{...options.appBarProps,...appBarProps,notificationsProps,title,subtitle},
97
99
  subtitle :subtitle,
98
100
  title : screenTitle,
99
101
  });
@@ -112,11 +114,12 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
112
114
  <View testID={testID+"_ScreenContentContainer"} id={portalId} {...containerProps} style={[styles.container,{backgroundColor},modal && styles.modal,containerProps.style]} >
113
115
  <KeyboardAvoidingView testID={testID} {...keyboardAvoidingViewProps} style={[styles.keyboardAvoidingView,keyboardAvoidingViewProps.style]}>
114
116
  {withStatusBar !== false ? <StatusBar/> : null}
115
- {appBar === false ? null : React.isValidElement(appBar)? state.AppBar : <AppBar
117
+ {appBar === false ? null : React.isValidElement(appBar)? AppBar : <AppBar
116
118
  testID={testID+'_AppBar'}
117
119
  {...appBarProps}
118
120
  backAction = {defaultVal(appBarProps.backAction,backAction)}
119
121
  elevation={defaultNumber(appBarProps.elevation,elevation)}
122
+ notificationsProps = {notificationsProps}
120
123
  withDrawer={withDrawer} options={options}
121
124
  ref={appBarRef} title={title}
122
125
  subtitle={subtitle}
@@ -1,8 +1,12 @@
1
1
  module.exports = {
2
2
  "@fto-consult/expo-ui": {
3
- "version": "7.17.9",
4
- "url": "https://github.com/borispipo/expo-ui#readme",
5
- "license": "ISC"
3
+ "name": "@fto-consult/expo-ui",
4
+ "version": "7.23.1",
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"
6
10
  },
7
11
  "@babel/plugin-proposal-export-namespace-from": {
8
12
  "version": "7.18.9",
@@ -45,16 +49,16 @@ module.exports = {
45
49
  "license": "MIT"
46
50
  },
47
51
  "@fto-consult/common": {
48
- "version": "4.6.0",
52
+ "version": "4.7.2",
49
53
  "url": "https://github.com/borispipo/common#readme",
50
54
  "license": "ISC"
51
55
  },
52
56
  "@fto-consult/node-utils": {
53
- "version": "1.3.4",
57
+ "version": "1.4.5",
54
58
  "license": "MIT"
55
59
  },
56
60
  "@pchmn/expo-material3-theme": {
57
- "version": "1.3.1",
61
+ "version": "1.3.2",
58
62
  "url": "https://github.com/pchmn/expo-material3-theme#readme",
59
63
  "license": "MIT"
60
64
  },