@draftbit/core 49.0.4 → 49.0.5-0fbb07.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/lib/commonjs/components/AvoidKeyboardView.js +1 -1
- package/lib/typescript/src/components/AvoidKeyboardView.d.ts +1 -1
- package/lib/typescript/src/components/AvoidKeyboardView.js +24 -4
- package/lib/typescript/src/components/AvoidKeyboardView.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -5
- package/src/components/AvoidKeyboardView.js +24 -4
- package/src/components/AvoidKeyboardView.js.map +1 -1
- package/src/components/AvoidKeyboardView.tsx +35 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onKeyboardHidden","onKeyboardShown"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/AvoidKeyboardView.tsx";var AvoidSoftInput=null;var AvoidSoftInputView=null;try{var avoidSoftInputPackage=require("react-native-avoid-softinput");AvoidSoftInput=avoidSoftInputPackage.AvoidSoftInput;AvoidSoftInputView=avoidSoftInputPackage.AvoidSoftInputView;}catch(_){console.warn("`react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");}var AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);_react.default.useEffect(function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(true);}return function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(false);}};},[]);if(AvoidSoftInputView){return(0,_jsxRuntime.jsx)(AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));}else{return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},rest));}};var _default=AvoidKeyboardView;exports.default=_default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AvoidSoftInputViewProps } from "react-native-avoid-softinput";
|
|
2
|
+
import type { AvoidSoftInputViewProps } from "react-native-avoid-softinput";
|
|
3
3
|
/**
|
|
4
4
|
* Requires additional setup: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides
|
|
5
5
|
* Cannot be used with Expo Go
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
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
|
+
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("`react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");
|
|
13
|
+
}
|
|
3
14
|
const AvoidKeyboardView = ({ onKeyboardHidden, onKeyboardShown, ...rest }) => {
|
|
4
15
|
React.useEffect(() => {
|
|
5
|
-
AvoidSoftInput
|
|
16
|
+
if (AvoidSoftInput) {
|
|
17
|
+
AvoidSoftInput.setShouldMimicIOSBehavior(true);
|
|
18
|
+
}
|
|
6
19
|
return () => {
|
|
7
|
-
AvoidSoftInput
|
|
20
|
+
if (AvoidSoftInput) {
|
|
21
|
+
AvoidSoftInput.setShouldMimicIOSBehavior(false);
|
|
22
|
+
}
|
|
8
23
|
};
|
|
9
24
|
}, []);
|
|
10
|
-
|
|
25
|
+
if (AvoidSoftInputView) {
|
|
26
|
+
return (React.createElement(AvoidSoftInputView, { onSoftInputHidden: onKeyboardHidden, onSoftInputShown: onKeyboardShown, ...rest }));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return React.createElement(View, { ...rest });
|
|
30
|
+
}
|
|
11
31
|
};
|
|
12
32
|
export default AvoidKeyboardView;
|
|
13
33
|
//# sourceMappingURL=AvoidKeyboardView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvoidKeyboardView.js","sourceRoot":"","sources":["../../../../src/components/AvoidKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"AvoidKeyboardView.js","sourceRoot":"","sources":["../../../../src/components/AvoidKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOpC,iJAAiJ;AACjJ,IAAI,cAAc,GAAqC,IAAI,CAAC;AAC5D,IAAI,kBAAkB,GAAyC,IAAI,CAAC;AAEpE,IAAI;IACF,MAAM,qBAAqB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACtE,cAAc,GAAG,qBAAqB,CAAC,cAAc,CAAC;IACtD,kBAAkB,GAAG,qBAAqB,CAAC,kBAAkB,CAAC;CAC/D;AAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,IAAI,CACV,yHAAyH,CAC1H,CAAC;CACH;AAiBD,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,oBAAC,IAAI,OAAK,IAAI,GAAI,CAAC;KAC3B;AACH,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|