@draftbit/core 49.0.4-81e29e.2 → 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.
@@ -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 _reactNativeAvoidSoftinput=require("react-native-avoid-softinput");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 AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);_react.default.useEffect(function(){_reactNativeAvoidSoftinput.AvoidSoftInput.setShouldMimicIOSBehavior(true);return function(){_reactNativeAvoidSoftinput.AvoidSoftInput.setShouldMimicIOSBehavior(false);};},[]);return(0,_jsxRuntime.jsx)(_reactNativeAvoidSoftinput.AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));};var _default=AvoidKeyboardView;exports.default=_default;
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 _reactNativeAvoidSoftinput=require("react-native-avoid-softinput");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 AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);_react.default.useEffect(function(){if(_reactNativeAvoidSoftinput.AvoidSoftInput){_reactNativeAvoidSoftinput.AvoidSoftInput.setShouldMimicIOSBehavior(true);}return function(){if(_reactNativeAvoidSoftinput.AvoidSoftInput){_reactNativeAvoidSoftinput.AvoidSoftInput.setShouldMimicIOSBehavior(false);}};},[]);if(_reactNativeAvoidSoftinput.AvoidSoftInputView){return(0,_jsxRuntime.jsx)(_reactNativeAvoidSoftinput.AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));}else{console.warn("`react-native-avoid-softinput` is not installed, falling back to `View`.");return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},rest));}};var _default=AvoidKeyboardView;exports.default=_default;
@@ -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":["../../../../src/components/AvoidKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,cAAc,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,kBAAkB,IACjB,iBAAiB,EAAE,gBAAgB,EACnC,gBAAgB,EAAE,eAAe,KAC7B,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
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;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,CAAC;KAC3B;AACH,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}