@draftbit/core 49.0.5-91173d.2 → 49.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "49.0.5-91173d.2+91173db",
3
+ "version": "49.1.0",
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.5-91173d.2+91173db",
44
+ "@draftbit/types": "49.0.4",
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",
@@ -112,5 +112,5 @@
112
112
  ],
113
113
  "testEnvironment": "node"
114
114
  },
115
- "gitHead": "91173dbd936ad302218196128284552910229859"
115
+ "gitHead": "8ee7ff2deff81be62e7b0e0ee4b70eb5c2e0f985"
116
116
  }
@@ -1,7 +1,16 @@
1
1
  import React from "react";
2
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
4
- import { AvoidSoftInput, AvoidSoftInputView, } from "react-native-avoid-softinput";
3
+ // `react-native-avoid-softinput` is an optional dependency and there is a possibility that it is not installed resulting in undefined references
4
+ let AvoidSoftInput = null;
5
+ let AvoidSoftInputView = null;
6
+ try {
7
+ const avoidSoftInputPackage = require("react-native-avoid-softinput");
8
+ AvoidSoftInput = avoidSoftInputPackage.AvoidSoftInput;
9
+ AvoidSoftInputView = avoidSoftInputPackage.AvoidSoftInputView;
10
+ }
11
+ catch (_) {
12
+ console.warn("AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");
13
+ }
5
14
  const AvoidKeyboardView = ({ onKeyboardHidden, onKeyboardShown, ...rest }) => {
6
15
  React.useEffect(() => {
7
16
  if (AvoidSoftInput) {
@@ -17,7 +26,6 @@ const AvoidKeyboardView = ({ onKeyboardHidden, onKeyboardShown, ...rest }) => {
17
26
  return (React.createElement(AvoidSoftInputView, { onSoftInputHidden: onKeyboardHidden, onSoftInputShown: onKeyboardShown, ...rest }));
18
27
  }
19
28
  else {
20
- console.warn("`react-native-avoid-softinput` is not installed, falling back to `View`.");
21
29
  return React.createElement(View, { ...rest });
22
30
  }
23
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AvoidKeyboardView.js","sourceRoot":"","sources":["AvoidKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,8IAA8I;AAC9I,OAAO,EACL,cAAc,EACd,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AAiBtC,MAAM,iBAAiB,GAAqC,CAAC,EAC3D,gBAAgB,EAChB,eAAe,EACf,GAAG,IAAI,EACR,EAAE,EAAE;IACH,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,cAAc,EAAE;YAClB,cAAc,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;SAChD;QACD,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,EAAE;gBAClB,cAAc,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;aACjD;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,kBAAkB,EAAE;QACtB,OAAO,CACL,oBAAC,kBAAkB,IACjB,iBAAiB,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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react";
2
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
4
- import {
5
- AvoidSoftInput,
6
- AvoidSoftInputView,
3
+ import type {
4
+ AvoidSoftInput as AvoidSoftInputType,
5
+ AvoidSoftInputView as AvoidSoftInputViewType,
7
6
  AvoidSoftInputViewProps,
8
7
  } from "react-native-avoid-softinput";
9
8
 
9
+ // `react-native-avoid-softinput` is an optional dependency and there is a possibility that it is not installed resulting in undefined references
10
+ let AvoidSoftInput: typeof AvoidSoftInputType | null = null;
11
+ let AvoidSoftInputView: typeof AvoidSoftInputViewType | null = null;
12
+
13
+ try {
14
+ const avoidSoftInputPackage = require("react-native-avoid-softinput");
15
+ AvoidSoftInput = avoidSoftInputPackage.AvoidSoftInput;
16
+ AvoidSoftInputView = avoidSoftInputPackage.AvoidSoftInputView;
17
+ } catch (_) {
18
+ console.warn(
19
+ "AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used."
20
+ );
21
+ }
22
+
10
23
  /**
11
24
  * Requires additional setup: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides
12
25
  * Cannot be used with Expo Go
@@ -47,9 +60,6 @@ const AvoidKeyboardView: React.FC<AvoidKeyboardViewProps> = ({
47
60
  />
48
61
  );
49
62
  } else {
50
- console.warn(
51
- "`react-native-avoid-softinput` is not installed, falling back to `View`."
52
- );
53
63
  return <View {...rest} />;
54
64
  }
55
65
  };