@draftbit/core 49.0.4 → 49.0.5-91173d.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "49.0.4",
3
+ "version": "49.0.5-91173d.2+91173db",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "49.0.4",
44
+ "@draftbit/types": "^49.0.5-91173d.2+91173db",
45
45
  "@expo/vector-icons": "^13.0.0",
46
46
  "@gorhom/bottom-sheet": "^5.0.0-alpha.4",
47
47
  "@material-ui/core": "^4.11.0",
@@ -57,7 +57,6 @@
57
57
  "lodash.isnumber": "^3.0.3",
58
58
  "lodash.omit": "^4.5.0",
59
59
  "lodash.tonumber": "^4.0.3",
60
- "react-native-avoid-softinput": "^4.0.1",
61
60
  "react-native-confirmation-code-field": "^7.3.1",
62
61
  "react-native-deck-swiper": "^2.0.12",
63
62
  "react-native-dropdown-picker": "^5.4.7-beta.1",
@@ -75,6 +74,14 @@
75
74
  "react-native-youtube-iframe": "^2.2.2",
76
75
  "react-youtube": "^10.1.0"
77
76
  },
77
+ "peerDependencies": {
78
+ "react-native-avoid-softinput": "^4.0.1"
79
+ },
80
+ "peerDependenciesMeta": {
81
+ "react-native-avoid-softinput": {
82
+ "optional": true
83
+ }
84
+ },
78
85
  "devDependencies": {
79
86
  "@babel/plugin-proposal-class-properties": "^7.18.6",
80
87
  "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
@@ -82,7 +89,8 @@
82
89
  "@types/dateformat": "^3.0.1",
83
90
  "@types/lodash.isnumber": "^3.0.6",
84
91
  "@types/lodash.omit": "^4.5.6",
85
- "@types/lodash.tonumber": "^4.0.6"
92
+ "@types/lodash.tonumber": "^4.0.6",
93
+ "react-native-avoid-softinput": "^4.0.1"
86
94
  },
87
95
  "eslintIgnore": [
88
96
  "node_modules/",
@@ -104,5 +112,5 @@
104
112
  ],
105
113
  "testEnvironment": "node"
106
114
  },
107
- "gitHead": "868c4249c526367a2f7bccd0f394cde61b32479b"
115
+ "gitHead": "91173dbd936ad302218196128284552910229859"
108
116
  }
@@ -1,13 +1,25 @@
1
1
  import React from "react";
2
+ import { View } from "react-native";
3
+ //react-native-avoid-softinput is an optional dependency and there is a possibility that it is not installed resulting in undefined references
2
4
  import { AvoidSoftInput, AvoidSoftInputView, } from "react-native-avoid-softinput";
3
5
  const AvoidKeyboardView = ({ onKeyboardHidden, onKeyboardShown, ...rest }) => {
4
6
  React.useEffect(() => {
5
- AvoidSoftInput.setShouldMimicIOSBehavior(true);
7
+ if (AvoidSoftInput) {
8
+ AvoidSoftInput.setShouldMimicIOSBehavior(true);
9
+ }
6
10
  return () => {
7
- AvoidSoftInput.setShouldMimicIOSBehavior(false);
11
+ if (AvoidSoftInput) {
12
+ AvoidSoftInput.setShouldMimicIOSBehavior(false);
13
+ }
8
14
  };
9
15
  }, []);
10
- return (React.createElement(AvoidSoftInputView, { onSoftInputHidden: onKeyboardHidden, onSoftInputShown: onKeyboardShown, ...rest }));
16
+ if (AvoidSoftInputView) {
17
+ return (React.createElement(AvoidSoftInputView, { onSoftInputHidden: onKeyboardHidden, onSoftInputShown: onKeyboardShown, ...rest }));
18
+ }
19
+ else {
20
+ console.warn("`react-native-avoid-softinput` is not installed, falling back to `View`.");
21
+ return React.createElement(View, { ...rest });
22
+ }
11
23
  };
12
24
  export default AvoidKeyboardView;
13
25
  //# sourceMappingURL=AvoidKeyboardView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvoidKeyboardView.js","sourceRoot":"","sources":["AvoidKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;A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BAAiB,EAAE,gBAAgB,EACnC,gBAAgB,EAAE,eAAe,KAC7B,IAAI,GACR,CACH,CAAC;KACH;SAAM;QACL,OAAO,CAAC,IAAI,CACV,0EAA0E,CAC3E,CAAC;QACF,OAAO,oBAAC,IAAI,OAAK,IAAI,GAAI,CAAC;KAC3B;AACH,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
+ import { View } from "react-native";
3
+ //react-native-avoid-softinput is an optional dependency and there is a possibility that it is not installed resulting in undefined references
2
4
  import {
3
5
  AvoidSoftInput,
4
6
  AvoidSoftInputView,
@@ -26,19 +28,30 @@ const AvoidKeyboardView: React.FC<AvoidKeyboardViewProps> = ({
26
28
  ...rest
27
29
  }) => {
28
30
  React.useEffect(() => {
29
- AvoidSoftInput.setShouldMimicIOSBehavior(true);
31
+ if (AvoidSoftInput) {
32
+ AvoidSoftInput.setShouldMimicIOSBehavior(true);
33
+ }
30
34
  return () => {
31
- AvoidSoftInput.setShouldMimicIOSBehavior(false);
35
+ if (AvoidSoftInput) {
36
+ AvoidSoftInput.setShouldMimicIOSBehavior(false);
37
+ }
32
38
  };
33
39
  }, []);
34
40
 
35
- return (
36
- <AvoidSoftInputView
37
- onSoftInputHidden={onKeyboardHidden}
38
- onSoftInputShown={onKeyboardShown}
39
- {...rest}
40
- />
41
- );
41
+ if (AvoidSoftInputView) {
42
+ return (
43
+ <AvoidSoftInputView
44
+ onSoftInputHidden={onKeyboardHidden}
45
+ onSoftInputShown={onKeyboardShown}
46
+ {...rest}
47
+ />
48
+ );
49
+ } else {
50
+ console.warn(
51
+ "`react-native-avoid-softinput` is not installed, falling back to `View`."
52
+ );
53
+ return <View {...rest} />;
54
+ }
42
55
  };
43
56
 
44
57
  export default AvoidKeyboardView;