react-native-external-keyboard 0.5.2 → 0.5.3
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/README.md +13 -0
- package/android/src/main/java/com/externalkeyboard/ExternalKeyboardViewPackage.java +34 -6
- package/android/src/main/java/com/externalkeyboard/modules/ExternalKeyboardModule.java +52 -0
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +55 -17
- package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +5 -3
- package/android/src/newarch/ExternalKeyboardModuleSpec.java +9 -0
- package/android/src/oldarch/ExternalKeyboardModuleSpec.java +13 -0
- package/ios/Modules/RNCEKVExternalKeyboardModule.h +17 -0
- package/ios/Modules/RNCEKVExternalKeyboardModule.mm +40 -0
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +8 -1
- package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/commonjs/index.js +5 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/Keyboard.android.js +26 -0
- package/lib/commonjs/modules/Keyboard.android.js.map +1 -0
- package/lib/commonjs/modules/Keyboard.js +11 -0
- package/lib/commonjs/modules/Keyboard.js.map +1 -0
- package/lib/commonjs/nativeSpec/NativeExternalKeyboardModule.js +9 -0
- package/lib/commonjs/nativeSpec/NativeExternalKeyboardModule.js.map +1 -0
- package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
- package/lib/commonjs/utils/withKeyboardFocus.js +2 -0
- package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +9 -2
- package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/Keyboard.android.js +19 -0
- package/lib/module/modules/Keyboard.android.js.map +1 -0
- package/lib/module/modules/Keyboard.js +5 -0
- package/lib/module/modules/Keyboard.js.map +1 -0
- package/lib/module/nativeSpec/NativeExternalKeyboardModule.js +3 -0
- package/lib/module/nativeSpec/NativeExternalKeyboardModule.js.map +1 -0
- package/lib/module/utils/useFocusStyle.js.map +1 -1
- package/lib/module/utils/withKeyboardFocus.js +2 -0
- package/lib/module/utils/withKeyboardFocus.js.map +1 -1
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts +1 -22
- package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts +2 -22
- package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable/Pressable.d.ts +1 -14
- package/lib/typescript/src/components/Touchable/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/modules/Keyboard.android.d.ts +3 -0
- package/lib/typescript/src/modules/Keyboard.android.d.ts.map +1 -0
- package/lib/typescript/src/modules/Keyboard.d.ts +2 -0
- package/lib/typescript/src/modules/Keyboard.d.ts.map +1 -0
- package/lib/typescript/src/nativeSpec/NativeExternalKeyboardModule.d.ts +7 -0
- package/lib/typescript/src/nativeSpec/NativeExternalKeyboardModule.d.ts.map +1 -0
- package/lib/typescript/src/types/BaseKeyboardView.d.ts +2 -1
- package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +1 -1
- package/lib/typescript/src/types/KeyboardFocusView.types.d.ts +4 -3
- package/lib/typescript/src/types/KeyboardFocusView.types.d.ts.map +1 -1
- package/lib/typescript/src/utils/useFocusStyle.d.ts +3 -3
- package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts +11 -14
- package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +12 -1
- package/src/index.tsx +2 -0
- package/src/modules/Keyboard.android.ts +29 -0
- package/src/modules/Keyboard.ts +5 -0
- package/src/nativeSpec/NativeExternalKeyboardModule.ts +8 -0
- package/src/types/BaseKeyboardView.ts +4 -1
- package/src/types/KeyboardFocusView.types.ts +9 -3
- package/src/utils/useFocusStyle.tsx +4 -4
- package/src/utils/withKeyboardFocus.tsx +29 -27
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { View, StyleSheet, Platform } from 'react-native';
|
|
4
4
|
import { BaseKeyboardView } from '../BaseKeyboardView/BaseKeyboardView';
|
|
5
5
|
import { RenderPropComponent } from '../RenderPropComponent/RenderPropComponent';
|
|
6
6
|
import { useFocusStyle } from '../../utils/useFocusStyle';
|
|
@@ -20,11 +20,14 @@ export const KeyboardFocusView = /*#__PURE__*/React.forwardRef(({
|
|
|
20
20
|
haloEffect = true,
|
|
21
21
|
canBeFocused = true,
|
|
22
22
|
focusable = true,
|
|
23
|
+
withView = true,
|
|
24
|
+
//ToDo RNCEKV-9 update and rename Discussion #63
|
|
23
25
|
tintColor,
|
|
24
26
|
onFocus,
|
|
25
27
|
onBlur,
|
|
26
28
|
FocusHoverComponent,
|
|
27
29
|
children,
|
|
30
|
+
accessible,
|
|
28
31
|
...props
|
|
29
32
|
}, ref) => {
|
|
30
33
|
const {
|
|
@@ -55,6 +58,9 @@ export const KeyboardFocusView = /*#__PURE__*/React.forwardRef(({
|
|
|
55
58
|
});
|
|
56
59
|
return undefined;
|
|
57
60
|
}, [FocusHoverComponent, hoverColor, tintType]);
|
|
61
|
+
const a11y = useMemo(() => {
|
|
62
|
+
return Platform.OS === 'android' && withView && accessible !== false || accessible;
|
|
63
|
+
}, [accessible, withView]);
|
|
58
64
|
return /*#__PURE__*/React.createElement(IsViewFocusedContext.Provider, {
|
|
59
65
|
value: focused
|
|
60
66
|
}, /*#__PURE__*/React.createElement(BaseKeyboardView, _extends({
|
|
@@ -71,7 +77,8 @@ export const KeyboardFocusView = /*#__PURE__*/React.forwardRef(({
|
|
|
71
77
|
canBeFocused: canBeFocused,
|
|
72
78
|
focusable: focusable,
|
|
73
79
|
tintColor: tintColor,
|
|
74
|
-
group: group
|
|
80
|
+
group: group,
|
|
81
|
+
accessible: a11y
|
|
75
82
|
}, props), children, focused && HoverComonent && /*#__PURE__*/React.createElement(RenderPropComponent, {
|
|
76
83
|
render: HoverComonent
|
|
77
84
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","View","StyleSheet","BaseKeyboardView","RenderPropComponent","useFocusStyle","useKeyboardPress","IsViewFocusedContext","KeyboardFocusView","forwardRef","tintType","autoFocus","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyUpPress","onKeyDownPress","group","haloEffect","canBeFocused","focusable","tintColor","onFocus","onBlur","FocusHoverComponent","children","props","ref","focused","containerFocusedStyle","onFocusChangeHandler","hoverColor","containerFocusStyle","withHaloEffect","onKeyUpPressHandler","onKeyDownPressHandler","HoverComonent","createElement","styles","absolute","opacity","undefined","Provider","value","_extends","onContextMenuPress","render","create","position","top","left","right","bottom"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusView/KeyboardFocusView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["React","useMemo","View","StyleSheet","Platform","BaseKeyboardView","RenderPropComponent","useFocusStyle","useKeyboardPress","IsViewFocusedContext","KeyboardFocusView","forwardRef","tintType","autoFocus","focusStyle","style","onFocusChange","onPress","onLongPress","onKeyUpPress","onKeyDownPress","group","haloEffect","canBeFocused","focusable","withView","tintColor","onFocus","onBlur","FocusHoverComponent","children","accessible","props","ref","focused","containerFocusedStyle","onFocusChangeHandler","hoverColor","containerFocusStyle","withHaloEffect","onKeyUpPressHandler","onKeyDownPressHandler","HoverComonent","createElement","styles","absolute","opacity","undefined","a11y","OS","Provider","value","_extends","onContextMenuPress","render","create","position","top","left","right","bottom"],"sourceRoot":"../../../../src","sources":["components/KeyboardFocusView/KeyboardFocusView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAEzD,SAASC,gBAAgB,QAAQ,sCAAsC;AAMvE,SAEEC,mBAAmB,QACd,4CAA4C;AACnD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,oBAAoB,QAAQ,oCAAoC;AAEzE,OAAO,MAAMC,iBAAiB,gBAAGV,KAAK,CAACW,UAAU,CAQ/C,CACE;EACEC,QAAQ,GAAG,SAAS;EACpBC,SAAS;EACTC,UAAU;EACVC,KAAK;EACLC,aAAa;EACbC,OAAO;EACPC,WAAW;EACXC,YAAY;EACZC,cAAc;EACdC,KAAK,GAAG,KAAK;EACbC,UAAU,GAAG,IAAI;EACjBC,YAAY,GAAG,IAAI;EACnBC,SAAS,GAAG,IAAI;EAChBC,QAAQ,GAAG,IAAI;EAAE;EACjBC,SAAS;EACTC,OAAO;EACPC,MAAM;EACNC,mBAAmB;EACnBC,QAAQ;EACRC,UAAU;EACV,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAM;IAAEC,OAAO;IAAEC,qBAAqB;IAAEC,oBAAoB;IAAEC;EAAW,CAAC,GACxE9B,aAAa,CAAC;IACZS,aAAa;IACbU,SAAS;IACTY,mBAAmB,EAAExB,UAAU;IAC/B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AC3B1B,SAAS,EAAEA,SAAU;IACrBU,YAAY,EAAEA,YAAa;IAC3BC,SAAS,EAAEA,SAAU;IACrBE,SAAS,EAAEA,SAAU;IACrBL,KAAK,EAAEA,KAAM;IACbU,UAAU,EAAEiB;EAAK,GACbhB,KAAK,GAERF,QAAQ,EACRI,OAAO,IAAIQ,aAAa,iBACvB1C,KAAA,CAAA2C,aAAA,CAACrC,mBAAmB;IAACgD,MAAM,EAAEZ;EAAc,CAAE,CAE/B,CACW,CAAC;AAEpC,CACF,CAAC;AAED,MAAME,MAAM,GAAGzC,UAAU,CAACoD,MAAM,CAAC;EAC/BV,QAAQ,EAAE;IACRW,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDd,OAAO,EAAE;IACPA,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -5,4 +5,6 @@ export { KeyboardExtendedInput, KeyboardExtendedInput as TextInput } from './com
|
|
|
5
5
|
export { KeyboardFocusGroup } from './components/KeyboardFocusGroup/KeyboardFocusGroup';
|
|
6
6
|
export { withKeyboardFocus } from './utils/withKeyboardFocus';
|
|
7
7
|
export { useIsViewFocused } from './context/IsViewFocusedContext';
|
|
8
|
+
import * as Keyboard from './modules/Keyboard';
|
|
9
|
+
export { Keyboard };
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ExternalKeyboardViewNative","TextInputFocusWrapperNative","BaseKeyboardView","KeyboardFocusView","ExternalKeyboardView","KeyboardExtendedView","KeyboardExtendedBaseView","Pressable","KeyboardExtendedPressable","KeyboardExtendedInput","TextInput","KeyboardFocusGroup","withKeyboardFocus","useIsViewFocused"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SACEA,0BAA0B,EAC1BC,2BAA2B,QAEtB,cAAc;AAUrB,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,EACpBC,oBAAoB,EACpBC,wBAAwB,QACnB,cAAc;AACrB,SACEC,SAAS,EACTA,SAAS,IAAIC,yBAAyB,QACjC,kCAAkC;AACzC,SACEC,qBAAqB,EACrBA,qBAAqB,IAAIC,SAAS,QAC7B,0DAA0D;AACjE,SAASC,kBAAkB,QAAQ,oDAAoD;AACvF,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,gBAAgB,QAAQ,gCAAgC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ExternalKeyboardViewNative","TextInputFocusWrapperNative","BaseKeyboardView","KeyboardFocusView","ExternalKeyboardView","KeyboardExtendedView","KeyboardExtendedBaseView","Pressable","KeyboardExtendedPressable","KeyboardExtendedInput","TextInput","KeyboardFocusGroup","withKeyboardFocus","useIsViewFocused","Keyboard"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SACEA,0BAA0B,EAC1BC,2BAA2B,QAEtB,cAAc;AAUrB,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,EACpBC,oBAAoB,EACpBC,wBAAwB,QACnB,cAAc;AACrB,SACEC,SAAS,EACTA,SAAS,IAAIC,yBAAyB,QACjC,kCAAkC;AACzC,SACEC,qBAAqB,EACrBA,qBAAqB,IAAIC,SAAS,QAC7B,0DAA0D;AACjE,SAASC,kBAAkB,QAAQ,oDAAoD;AACvF,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,OAAO,KAAKC,QAAQ,MAAM,oBAAoB;AAC9C,SAASA,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NativeModules, Platform, Keyboard } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'react-native-external-keyboard' doesn't seem to be linked. Make sure: \n\n${Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
})}- You rebuilt the app after installing the package\n` + `- You are not using Expo Go\n`;
|
|
6
|
+
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
9
|
+
const ExternalKeyboardModule = isTurboModuleEnabled ? require('../nativeSpec/NativeExternalKeyboardModule').default : NativeModules.ExternalKeyboardModule;
|
|
10
|
+
export const ExternalKeyboard = ExternalKeyboardModule || new Proxy({}, {
|
|
11
|
+
get() {
|
|
12
|
+
throw new Error(LINKING_ERROR);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export function dismiss() {
|
|
16
|
+
Keyboard.dismiss();
|
|
17
|
+
ExternalKeyboard.dismissKeyboard();
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Keyboard.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","Keyboard","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","ExternalKeyboardModule","require","ExternalKeyboard","Proxy","get","Error","dismiss","dismissKeyboard"],"sourceRoot":"../../../src","sources":["modules/Keyboard.android.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAEhE,MAAMC,aAAa,GACjB,0FAA0FF,QAAQ,CAACG,MAAM,CACvG;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CACvD,CAAC,sDAAsD,GACvD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAC9D,MAAMC,sBAAsB,GAAGH,oBAAoB,GAC/CI,OAAO,CAAC,4CAA4C,CAAC,CAACL,OAAO,GAC7DN,aAAa,CAACU,sBAAsB;AAExC,OAAO,MAAME,gBAAgB,GAC3BF,sBAAsB,IACtB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEH,OAAO,SAASa,OAAOA,CAAA,EAAG;EACxBd,QAAQ,CAACc,OAAO,CAAC,CAAC;EAClBJ,gBAAgB,CAACK,eAAe,CAAC,CAAC;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Keyboard","dismiss"],"sourceRoot":"../../../src","sources":["modules/Keyboard.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,SAASC,OAAOA,CAAA,EAAG;EACxBD,QAAQ,CAACC,OAAO,CAAC,CAAC;AACpB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["nativeSpec/NativeExternalKeyboardModule.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useMemo","useCallback","Platform","Pressable","backgroundTintMap","select","ios","background","default","DEFAULT_BACKGROUND_TINT","useFocusStyle","focusStyle","onFocusChange","containerFocusStyle","tintColor","tintType","style","Component","withPressedStyle","focused","setFocusStatus","onFocusChangeHandler","isFocused","componentFocusedStyle","specificStyle","undefined","hoverColor","backgroundColor","containerFocusedStyle","dafaultComponentStyle","styleHandlerPressable","pressed","componentStyleViewStyle"],"sourceRoot":"../../../src","sources":["utils/useFocusStyle.tsx"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACtD,SACEC,QAAQ,EAGRC,SAAS,QACJ,cAAc;AAIrB,MAAMC,iBAAiB,GAAGF,QAAQ,CAACG,MAAM,CAAqC;EAC5EC,GAAG,EAAE;IACHC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPD,UAAU,EAAE,IAAI;IAChBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,MAAMC,uBAAuB,GAAG,SAAS;AAazC,OAAO,MAAMC,aAAa,GAAGA,
|
|
1
|
+
{"version":3,"names":["useState","useMemo","useCallback","Platform","Pressable","backgroundTintMap","select","ios","background","default","DEFAULT_BACKGROUND_TINT","useFocusStyle","focusStyle","onFocusChange","containerFocusStyle","tintColor","tintType","style","Component","withPressedStyle","focused","setFocusStatus","onFocusChangeHandler","isFocused","componentFocusedStyle","specificStyle","undefined","hoverColor","backgroundColor","containerFocusedStyle","dafaultComponentStyle","styleHandlerPressable","pressed","componentStyleViewStyle"],"sourceRoot":"../../../src","sources":["utils/useFocusStyle.tsx"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACtD,SACEC,QAAQ,EAGRC,SAAS,QACJ,cAAc;AAIrB,MAAMC,iBAAiB,GAAGF,QAAQ,CAACG,MAAM,CAAqC;EAC5EC,GAAG,EAAE;IACHC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPD,UAAU,EAAE,IAAI;IAChBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,MAAMC,uBAAuB,GAAG,SAAS;AAazC,OAAO,MAAMC,aAAa,GAAGA,CAAe;EAC1CC,UAAU;EACVC,aAAa;EACbC,mBAAmB;EACnBC,SAAS;EACTC,QAAQ,GAAG,SAAS;EACpBC,KAAK;EACLC,SAAS;EACTC,gBAAgB,GAAG;AACE,CAAC,KAAK;EAC3B,MAAM,CAACC,OAAO,EAAEC,cAAc,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;EAEjD,MAAMsB,oBAAoB,GAAGpB,WAAW,CACrCqB,SAAkB,IAAK;IACtBF,cAAc,CAACE,SAAS,CAAC;IACzBV,aAAa,aAAbA,aAAa,e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AAC;QAAEe;MAAQ,CAAC,CAAC,EAAER,qBAAqB,CAAC;IACpD,CAAC,MAAM;MACL,OAAO,CAACP,KAAK,EAAEO,qBAAqB,CAAC;IACvC;EACF,CAAC,EACD,CAACA,qBAAqB,EAAEP,KAAK,CAC/B,CAAC;EAED,MAAMgB,uBAAuB,GAC3Bf,SAAS,KAAKd,SAAS,IAAIe,gBAAgB,GACvCY,qBAAqB,GACrBD,qBAAqB;EAE3B,OAAO;IACLG,uBAAuB;IACvBT,qBAAqB;IACrBK,qBAAqB;IACrBP,oBAAoB;IACpBK,UAAU;IACVP;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -30,6 +30,7 @@ export const withKeyboardFocus = Component => {
|
|
|
30
30
|
containerFocusStyle,
|
|
31
31
|
FocusHoverComponent,
|
|
32
32
|
viewRef,
|
|
33
|
+
componentRef,
|
|
33
34
|
haloCornerRadius,
|
|
34
35
|
haloExpendX,
|
|
35
36
|
haloExpendY,
|
|
@@ -101,6 +102,7 @@ export const withKeyboardFocus = Component => {
|
|
|
101
102
|
group: group,
|
|
102
103
|
groupIdentifier: groupIdentifier
|
|
103
104
|
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
105
|
+
ref: componentRef,
|
|
104
106
|
style: componentStyleViewStyle,
|
|
105
107
|
onPress: onPressHandler,
|
|
106
108
|
onLongPress: onLongPress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","View","StyleSheet","BaseKeyboardView","useFocusStyle","RenderPropComponent","useKeyboardPress","IsViewFocusedContext","withKeyboardFocus","Component","WithKeyboardFocus","memo","forwardRef","tintType","autoFocus","focusStyle","style","containerStyle","onFocusChange","onPress","onLongPress","onKeyUpPress","onKeyDownPress","onPressIn","onPressOut","group","haloEffect","canBeFocused","focusable","tintColor","onFocus","onBlur","containerFocusStyle","FocusHoverComponent","viewRef","haloCornerRadius","haloExpendX","haloExpendY","groupIdentifier","withPressedStyle","props","ref","focused","containerFocusedStyle","componentStyleViewStyle","onFocusChangeHandler","hoverColor","withHaloEffect","onKeyUpPressHandler","onKeyDownPressHandler","onPressHandler","HoverComonent","createElement","styles","absolute","opacity","undefined","onContextMenuHandler","Provider","value","onContextMenuPress","_extends","render","wrappedComponentName","displayName","name","create","position","top","left","right","bottom"],"sourceRoot":"../../../src","sources":["utils/withKeyboardFocus.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","View","StyleSheet","BaseKeyboardView","useFocusStyle","RenderPropComponent","useKeyboardPress","IsViewFocusedContext","withKeyboardFocus","Component","WithKeyboardFocus","memo","forwardRef","tintType","autoFocus","focusStyle","style","containerStyle","onFocusChange","onPress","onLongPress","onKeyUpPress","onKeyDownPress","onPressIn","onPressOut","group","haloEffect","canBeFocused","focusable","tintColor","onFocus","onBlur","containerFocusStyle","FocusHoverComponent","viewRef","componentRef","haloCornerRadius","haloExpendX","haloExpendY","groupIdentifier","withPressedStyle","props","ref","focused","containerFocusedStyle","componentStyleViewStyle","onFocusChangeHandler","hoverColor","withHaloEffect","onKeyUpPressHandler","onKeyDownPressHandler","onPressHandler","HoverComonent","createElement","styles","absolute","opacity","undefined","onContextMenuHandler","Provider","value","onContextMenuPress","_extends","render","wrappedComponentName","displayName","name","create","position","top","left","right","bottom"],"sourceRoot":"../../../src","sources":["utils/withKeyboardFocus.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAwB,OAAO;AACnE,SACEC,IAAI,EACJC,UAAU,QAIL,cAAc;AACrB,SAASC,gBAAgB,QAAQ,eAAe;AAGhD,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAEEC,mBAAmB,QACd,uDAAuD;AAC9D,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,oBAAoB,QAAQ,iCAAiC;AAyBtE,OAAO,MAAMC,iBAAiB,GAC5BC,SAAiC,IAC9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,WAAW,EAAEA,WAAiB;MAC9BG,SAAS,EAAEA,SAAe;MAC1BC,UAAU,EAAEA;IAAgB,GACvBiB,KAAK,CACX,CAAC,EACDE,OAAO,IAAIS,aAAa,iBACvBtD,KAAA,CAAAuD,aAAA,CAAChD,mBAAmB;MAAC0D,MAAM,EAAEX;IAAc,CAAE,CAE/B,CACW,CAAC;EAEpC,CACF,CACF,CAAC;EAED,MAAMY,oBAAoB,GACxBvD,SAAS,CAACwD,WAAW,IAAIxD,SAAS,CAACyD,IAAI,IAAI,WAAW;EACxDxD,iBAAiB,CAACuD,WAAW,GAAG,qBAAqBD,oBAAoB,GAAG;EAE5E,OAAOtD,iBAAiB;AAC1B,CAAC;AAED,MAAM4C,MAAM,GAAGpD,UAAU,CAACiE,MAAM,CAAC;EAC/BZ,QAAQ,EAAE;IACRa,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDhB,OAAO,EAAE;IACPA,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseKeyboardViewType } from '../../types/BaseKeyboardView';
|
|
3
|
-
|
|
4
|
-
export declare const BaseKeyboardView: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("react-native").ViewProps & {
|
|
5
|
-
viewRef?: React.RefObject<View>;
|
|
6
|
-
group?: boolean;
|
|
7
|
-
onFocusChange?: (isFocused: boolean, tag?: number) => void;
|
|
8
|
-
onKeyUpPress?: import("../../types/BaseKeyboardView").OnKeyPressFn;
|
|
9
|
-
onKeyDownPress?: import("../../types/BaseKeyboardView").OnKeyPressFn;
|
|
10
|
-
onContextMenuPress?: () => void;
|
|
11
|
-
onBubbledContextMenuPress?: () => void;
|
|
12
|
-
haloEffect?: boolean;
|
|
13
|
-
autoFocus?: boolean;
|
|
14
|
-
canBeFocused?: boolean;
|
|
15
|
-
focusable?: boolean;
|
|
16
|
-
onFocus?: () => void;
|
|
17
|
-
onBlur?: () => void;
|
|
18
|
-
tintColor?: import("react-native").ColorValue;
|
|
19
|
-
haloCornerRadius?: number;
|
|
20
|
-
haloExpendX?: number;
|
|
21
|
-
haloExpendY?: number;
|
|
22
|
-
groupIdentifier?: string;
|
|
23
|
-
ignoreGroupFocusHint?: boolean;
|
|
24
|
-
} & React.RefAttributes<BaseKeyboardViewType>>>;
|
|
3
|
+
export declare const BaseKeyboardView: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("react-native").ViewProps & import("../../types/BaseKeyboardView").BaseFocusViewProps & React.RefAttributes<BaseKeyboardViewType>>>;
|
|
25
4
|
//# sourceMappingURL=BaseKeyboardView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseKeyboardView.d.ts","sourceRoot":"","sources":["../../../../../src/components/BaseKeyboardView/BaseKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAI/E,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseKeyboardView.d.ts","sourceRoot":"","sources":["../../../../../src/components/BaseKeyboardView/BaseKeyboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAI/E,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;AAUtC,eAAO,MAAM,gBAAgB,sMAwE5B,CAAC"}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import type { BaseKeyboardViewType, KeyboardFocus } from '../../types/BaseKeyboardView';
|
|
4
3
|
import type { TintType } from '../../types/WithKeyboardFocus';
|
|
5
4
|
import { type RenderProp } from '../RenderPropComponent/RenderPropComponent';
|
|
6
|
-
export declare const KeyboardFocusView: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
|
|
7
|
-
viewRef?: React.RefObject<View>;
|
|
8
|
-
group?: boolean;
|
|
9
|
-
onFocusChange?: (isFocused: boolean, tag?: number) => void;
|
|
10
|
-
onKeyUpPress?: import("../../types/BaseKeyboardView").OnKeyPressFn;
|
|
11
|
-
onKeyDownPress?: import("../../types/BaseKeyboardView").OnKeyPressFn;
|
|
12
|
-
onContextMenuPress?: () => void;
|
|
13
|
-
onBubbledContextMenuPress?: () => void;
|
|
14
|
-
haloEffect?: boolean;
|
|
15
|
-
autoFocus?: boolean;
|
|
16
|
-
canBeFocused?: boolean;
|
|
17
|
-
focusable?: boolean;
|
|
18
|
-
onFocus?: () => void;
|
|
19
|
-
onBlur?: () => void;
|
|
20
|
-
tintColor?: import("react-native").ColorValue;
|
|
21
|
-
haloCornerRadius?: number;
|
|
22
|
-
haloExpendX?: number;
|
|
23
|
-
haloExpendY?: number;
|
|
24
|
-
groupIdentifier?: string;
|
|
25
|
-
ignoreGroupFocusHint?: boolean;
|
|
26
|
-
} & {
|
|
5
|
+
export declare const KeyboardFocusView: React.ForwardRefExoticComponent<import("react-native").ViewProps & import("../../types/BaseKeyboardView").BaseFocusViewProps & {
|
|
27
6
|
focusStyle?: import("../../types").FocusStyle;
|
|
28
7
|
onPress?: (e: import("react-native").GestureResponderEvent | import("../..").OnKeyPress) => void;
|
|
29
8
|
onLongPress?: (e?: import("react-native").GestureResponderEvent | import("../..").OnKeyPress) => void;
|
|
@@ -32,5 +11,6 @@ export declare const KeyboardFocusView: React.ForwardRefExoticComponent<import("
|
|
|
32
11
|
} & {
|
|
33
12
|
tintType?: TintType;
|
|
34
13
|
FocusHoverComponent?: RenderProp;
|
|
14
|
+
withView?: boolean;
|
|
35
15
|
} & React.RefAttributes<KeyboardFocus | BaseKeyboardViewType>>;
|
|
36
16
|
//# sourceMappingURL=KeyboardFocusView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardFocusView.d.ts","sourceRoot":"","sources":["../../../../../src/components/KeyboardFocusView/KeyboardFocusView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyboardFocusView.d.ts","sourceRoot":"","sources":["../../../../../src/components/KeyboardFocusView/KeyboardFocusView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,KAAK,UAAU,EAEhB,MAAM,4CAA4C,CAAC;AAKpD,eAAO,MAAM,iBAAiB;;;oBAHf,CAAC;;;;eAMD,QAAQ;0BACG,UAAU;eACrB,OAAO;8DAyFrB,CAAC"}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
export declare const Pressable: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<
|
|
2
|
-
onPress?: ((event: import("react-native").GestureResponderEvent) => void) | ((e?: import("../..").OnKeyPress) => void) | null | undefined;
|
|
3
|
-
onLongPress?: ((event: import("react-native").GestureResponderEvent) => void) | ((e?: import("../..").OnKeyPress) => void) | null | undefined;
|
|
4
|
-
onPressIn?: ((event: import("react-native").GestureResponderEvent) => void) | ((e?: import("../..").OnKeyPress) => void) | null | undefined;
|
|
5
|
-
onPressOut?: ((event: import("react-native").GestureResponderEvent) => void) | ((e?: import("../..").OnKeyPress) => void) | null | undefined;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
withPressedStyle?: boolean;
|
|
8
|
-
} & Omit<import("../../types").KeyboardFocusViewProps, "style" | "onPress" | "onLongPress"> & {
|
|
9
|
-
containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
10
|
-
containerFocusStyle?: import("../../types").FocusStyle;
|
|
11
|
-
tintType?: import("../..").TintType;
|
|
12
|
-
FocusHoverComponent?: import("../RenderPropComponent/RenderPropComponent").RenderProp;
|
|
13
|
-
style?: import("react-native").PressableProps["style"];
|
|
14
|
-
} & import("react").RefAttributes<import("../..").KeyboardFocus | import("react-native").View>>>;
|
|
1
|
+
export declare const Pressable: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("../../utils/withKeyboardFocus").WithKeyboardFocus<unknown, unknown, import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>, unknown>, "ref"> & import("react").RefAttributes<import("../..").KeyboardFocus | import("react-native").View>>>;
|
|
15
2
|
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../../src/components/Touchable/Pressable.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../../src/components/Touchable/Pressable.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,oXAAiC,CAAC"}
|
|
@@ -7,4 +7,6 @@ export { KeyboardExtendedInput, KeyboardExtendedInput as TextInput, } from './co
|
|
|
7
7
|
export { KeyboardFocusGroup } from './components/KeyboardFocusGroup/KeyboardFocusGroup';
|
|
8
8
|
export { withKeyboardFocus } from './utils/withKeyboardFocus';
|
|
9
9
|
export { useIsViewFocused } from './context/IsViewFocusedContext';
|
|
10
|
+
import * as Keyboard from './modules/Keyboard';
|
|
11
|
+
export { Keyboard };
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,QAAQ,GACd,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,aAAa,EACb,oBAAoB,IAAI,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C;AAClE,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard.android.d.ts","sourceRoot":"","sources":["../../../../src/modules/Keyboard.android.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,KAS1B,CAAC;AAEJ,wBAAgB,OAAO,SAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard.d.ts","sourceRoot":"","sources":["../../../../src/modules/Keyboard.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,SAEtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
dismissKeyboard: () => Promise<boolean>;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: Spec | null;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=NativeExternalKeyboardModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeExternalKeyboardModule.d.ts","sourceRoot":"","sources":["../../../../src/nativeSpec/NativeExternalKeyboardModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC;;AAED,wBAAuE"}
|
|
@@ -14,7 +14,7 @@ export type KeyboardFocus = {
|
|
|
14
14
|
focus: () => void;
|
|
15
15
|
};
|
|
16
16
|
export type BaseKeyboardViewType = Partial<View> & KeyboardFocus;
|
|
17
|
-
export type
|
|
17
|
+
export type BaseFocusViewProps = {
|
|
18
18
|
viewRef?: RefObject<View>;
|
|
19
19
|
group?: boolean;
|
|
20
20
|
onFocusChange?: (isFocused: boolean, tag?: number) => void;
|
|
@@ -35,4 +35,5 @@ export type BaseKeyboardViewProps = ViewProps & {
|
|
|
35
35
|
groupIdentifier?: string;
|
|
36
36
|
ignoreGroupFocusHint?: boolean;
|
|
37
37
|
};
|
|
38
|
+
export type BaseKeyboardViewProps = ViewProps & BaseFocusViewProps;
|
|
38
39
|
//# sourceMappingURL=BaseKeyboardView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseKeyboardView.d.ts","sourceRoot":"","sources":["../../../../src/types/BaseKeyboardView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,QAAQ,CAAC,GAAG;IACxD,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,aAAa,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAClD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseKeyboardView.d.ts","sourceRoot":"","sources":["../../../../src/types/BaseKeyboardView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,oBAAoB,EACpB,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mD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M,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NativeSyntheticEvent, GestureResponderEvent } from 'react-native';
|
|
2
2
|
import type { FocusStyle } from './FocusStyle';
|
|
3
|
-
import type { BaseKeyboardViewProps, OnKeyPress } from './BaseKeyboardView';
|
|
3
|
+
import type { BaseFocusViewProps, BaseKeyboardViewProps, OnKeyPress } from './BaseKeyboardView';
|
|
4
4
|
export type KeyboardFocusEvent = NativeSyntheticEvent<{
|
|
5
5
|
isFocused: boolean;
|
|
6
6
|
}>;
|
|
@@ -8,11 +8,12 @@ export type OnFocusChangeFn = (e: KeyboardFocusEvent) => void;
|
|
|
8
8
|
export type FocusStateCallbackType = {
|
|
9
9
|
readonly focused: boolean;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type FocusViewProps = {
|
|
12
12
|
focusStyle?: FocusStyle;
|
|
13
13
|
onPress?: (e: GestureResponderEvent | OnKeyPress) => void;
|
|
14
14
|
onLongPress?: (e?: GestureResponderEvent | OnKeyPress) => void;
|
|
15
15
|
onFocus?: () => void;
|
|
16
16
|
onBlur?: () => void;
|
|
17
|
-
};
|
|
17
|
+
} & BaseFocusViewProps;
|
|
18
|
+
export type KeyboardFocusViewProps = BaseKeyboardViewProps & FocusViewProps;
|
|
18
19
|
//# sourceMappingURL=KeyboardFocusView.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardFocusView.types.d.ts","sourceRoot":"","sources":["../../../../src/types/KeyboardFocusView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"KeyboardFocusView.types.d.ts","sourceRoot":"","sources":["../../../../src/types/KeyboardFocusView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;IACpD,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,GAAG,UAAU,KAAK,IAAI,CAAC;IAC1D,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,qBAAqB,GAAG,UAAU,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,kBAAkB,CAAC;AAEvB,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG,cAAc,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { type ColorValue, type PressableProps } from 'react-native';
|
|
2
2
|
import type { FocusStyle } from '../types';
|
|
3
3
|
import type { TintType } from '../types/WithKeyboardFocus';
|
|
4
|
-
type UseFocusStyleProps = {
|
|
4
|
+
type UseFocusStyleProps<C> = {
|
|
5
5
|
focusStyle?: FocusStyle;
|
|
6
6
|
containerFocusStyle?: FocusStyle;
|
|
7
7
|
onFocusChange?: (isFocused: boolean) => void;
|
|
8
8
|
tintColor?: ColorValue;
|
|
9
9
|
tintType?: TintType;
|
|
10
10
|
style?: PressableProps['style'];
|
|
11
|
-
Component?: React.ComponentType
|
|
11
|
+
Component?: React.ComponentType<C>;
|
|
12
12
|
withPressedStyle?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const useFocusStyle: ({ focusStyle, onFocusChange, containerFocusStyle, tintColor, tintType, style, Component, withPressedStyle, }: UseFocusStyleProps) => {
|
|
14
|
+
export declare const useFocusStyle: <C extends {}>({ focusStyle, onFocusChange, containerFocusStyle, tintColor, tintType, style, Component, withPressedStyle, }: UseFocusStyleProps<C>) => {
|
|
15
15
|
componentStyleViewStyle: (({ pressed }: {
|
|
16
16
|
pressed: boolean;
|
|
17
17
|
}) => import("react-native").StyleProp<import("react-native").ViewStyle>[]) | (import("react-native").StyleProp<import("react-native").ViewStyle> | ((state: import("react-native").PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").ViewStyle>))[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusStyle.d.ts","sourceRoot":"","sources":["../../../../src/utils/useFocusStyle.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAc3D,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"useFocusStyle.d.ts","sourceRoot":"","sources":["../../../../src/utils/useFocusStyle.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAc3D,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,EAAE,EAAE,8GASzC,kBAAkB,CAAC,CAAC,CAAC;4CA6CN;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;;;sCAzCtB,OAAO;;;;;CAgEtB,CAAC"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
2
|
import { View, type StyleProp, type ViewStyle, type PressableProps } from 'react-native';
|
|
3
|
-
import type { FocusStyle
|
|
3
|
+
import type { FocusStyle } from '../types';
|
|
4
4
|
import type { KeyboardFocus, OnKeyPress } from '../types/BaseKeyboardView';
|
|
5
5
|
import type { TintType } from '../types/WithKeyboardFocus';
|
|
6
6
|
import { type RenderProp } from '../components/RenderPropComponent/RenderPropComponent';
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
onLongPress?: T;
|
|
10
|
-
onPressIn?: K;
|
|
11
|
-
onPressOut?: K;
|
|
12
|
-
};
|
|
13
|
-
export declare const withKeyboardFocus: <K, T>(Component: React.ComponentType<KeyboardFocusPress<T, K>>) => React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
7
|
+
import type { FocusViewProps } from '../types/KeyboardFocusView.types';
|
|
8
|
+
export type KeyboardPressType<K, T> = {
|
|
14
9
|
onPress?: T | ((e?: OnKeyPress) => void);
|
|
15
10
|
onLongPress?: T | ((e?: OnKeyPress) => void);
|
|
16
11
|
onPressIn?: K | ((e?: OnKeyPress) => void);
|
|
17
12
|
onPressOut?: K | ((e?: OnKeyPress) => void);
|
|
18
|
-
|
|
13
|
+
};
|
|
14
|
+
export type WithKeyboardProps<R> = {
|
|
19
15
|
withPressedStyle?: boolean;
|
|
20
|
-
} & Omit<KeyboardFocusViewProps, "style" | "onPress" | "onLongPress"> & {
|
|
21
16
|
containerStyle?: StyleProp<ViewStyle>;
|
|
22
17
|
containerFocusStyle?: FocusStyle;
|
|
23
18
|
tintType?: TintType;
|
|
19
|
+
componentRef?: RefObject<R>;
|
|
24
20
|
FocusHoverComponent?: RenderProp;
|
|
25
|
-
style?: PressableProps[
|
|
26
|
-
}
|
|
27
|
-
export
|
|
21
|
+
style?: PressableProps['style'];
|
|
22
|
+
};
|
|
23
|
+
export type WithKeyboardFocus<K, T, C, R> = C & KeyboardPressType<K, T> & FocusViewProps & WithKeyboardProps<R>;
|
|
24
|
+
export declare const withKeyboardFocus: <K, T, C extends {}, R>(Component: React.ComponentType<C>) => React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithoutRef<WithKeyboardFocus<K, T, C, R>> & React.RefAttributes<KeyboardFocus | View>>>;
|
|
28
25
|
//# sourceMappingURL=withKeyboardFocus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withKeyboardFocus.d.ts","sourceRoot":"","sources":["../../../../src/utils/withKeyboardFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"withKeyboardFocus.d.ts","sourceRoot":"","sources":["../../../../src/utils/withKeyboardFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwB,KAAK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C,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,GAC3C,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GACvB,cAAc,GACd,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,EACrD,WAAW,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,iKAiIlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, Platform } from 'react-native';
|
|
3
3
|
import type { KeyboardFocusViewProps } from '../../types/KeyboardFocusView.types';
|
|
4
4
|
import { BaseKeyboardView } from '../BaseKeyboardView/BaseKeyboardView';
|
|
5
5
|
import type {
|
|
@@ -20,6 +20,7 @@ export const KeyboardFocusView = React.forwardRef<
|
|
|
20
20
|
KeyboardFocusViewProps & {
|
|
21
21
|
tintType?: TintType;
|
|
22
22
|
FocusHoverComponent?: RenderProp;
|
|
23
|
+
withView?: boolean;
|
|
23
24
|
}
|
|
24
25
|
>(
|
|
25
26
|
(
|
|
@@ -37,11 +38,13 @@ export const KeyboardFocusView = React.forwardRef<
|
|
|
37
38
|
haloEffect = true,
|
|
38
39
|
canBeFocused = true,
|
|
39
40
|
focusable = true,
|
|
41
|
+
withView = true, //ToDo RNCEKV-9 update and rename Discussion #63
|
|
40
42
|
tintColor,
|
|
41
43
|
onFocus,
|
|
42
44
|
onBlur,
|
|
43
45
|
FocusHoverComponent,
|
|
44
46
|
children,
|
|
47
|
+
accessible,
|
|
45
48
|
...props
|
|
46
49
|
},
|
|
47
50
|
ref
|
|
@@ -71,6 +74,13 @@ export const KeyboardFocusView = React.forwardRef<
|
|
|
71
74
|
return undefined;
|
|
72
75
|
}, [FocusHoverComponent, hoverColor, tintType]);
|
|
73
76
|
|
|
77
|
+
const a11y = useMemo(() => {
|
|
78
|
+
return (
|
|
79
|
+
(Platform.OS === 'android' && withView && accessible !== false) ||
|
|
80
|
+
accessible
|
|
81
|
+
);
|
|
82
|
+
}, [accessible, withView]);
|
|
83
|
+
|
|
74
84
|
return (
|
|
75
85
|
<IsViewFocusedContext.Provider value={focused}>
|
|
76
86
|
<BaseKeyboardView
|
|
@@ -88,6 +98,7 @@ export const KeyboardFocusView = React.forwardRef<
|
|
|
88
98
|
focusable={focusable}
|
|
89
99
|
tintColor={tintColor}
|
|
90
100
|
group={group}
|
|
101
|
+
accessible={a11y}
|
|
91
102
|
{...props}
|
|
92
103
|
>
|
|
93
104
|
{children}
|
package/src/index.tsx
CHANGED
|
@@ -30,3 +30,5 @@ export {
|
|
|
30
30
|
export { KeyboardFocusGroup } from './components/KeyboardFocusGroup/KeyboardFocusGroup';
|
|
31
31
|
export { withKeyboardFocus } from './utils/withKeyboardFocus';
|
|
32
32
|
export { useIsViewFocused } from './context/IsViewFocusedContext';
|
|
33
|
+
import * as Keyboard from './modules/Keyboard';
|
|
34
|
+
export { Keyboard };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NativeModules, Platform, Keyboard } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package 'react-native-external-keyboard' doesn't seem to be linked. Make sure: \n\n${Platform.select(
|
|
5
|
+
{ ios: "- You have run 'pod install'\n", default: '' }
|
|
6
|
+
)}- You rebuilt the app after installing the package\n` +
|
|
7
|
+
`- You are not using Expo Go\n`;
|
|
8
|
+
|
|
9
|
+
// @ts-expect-error
|
|
10
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
11
|
+
const ExternalKeyboardModule = isTurboModuleEnabled
|
|
12
|
+
? require('../nativeSpec/NativeExternalKeyboardModule').default
|
|
13
|
+
: NativeModules.ExternalKeyboardModule;
|
|
14
|
+
|
|
15
|
+
export const ExternalKeyboard =
|
|
16
|
+
ExternalKeyboardModule ||
|
|
17
|
+
new Proxy(
|
|
18
|
+
{},
|
|
19
|
+
{
|
|
20
|
+
get() {
|
|
21
|
+
throw new Error(LINKING_ERROR);
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export function dismiss() {
|
|
27
|
+
Keyboard.dismiss();
|
|
28
|
+
ExternalKeyboard.dismissKeyboard();
|
|
29
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
dismissKeyboard: () => Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default TurboModuleRegistry.get<Spec>('ExternalKeyboardModule');
|
|
@@ -15,7 +15,8 @@ export type OnKeyPress = NativeSyntheticEvent<KeyPress> & {
|
|
|
15
15
|
export type OnKeyPressFn = (e: OnKeyPress) => void;
|
|
16
16
|
export type KeyboardFocus = { focus: () => void };
|
|
17
17
|
export type BaseKeyboardViewType = Partial<View> & KeyboardFocus;
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
export type BaseFocusViewProps = {
|
|
19
20
|
viewRef?: RefObject<View>;
|
|
20
21
|
group?: boolean;
|
|
21
22
|
onFocusChange?: (isFocused: boolean, tag?: number) => void;
|
|
@@ -36,3 +37,5 @@ export type BaseKeyboardViewProps = ViewProps & {
|
|
|
36
37
|
groupIdentifier?: string;
|
|
37
38
|
ignoreGroupFocusHint?: boolean;
|
|
38
39
|
};
|
|
40
|
+
|
|
41
|
+
export type BaseKeyboardViewProps = ViewProps & BaseFocusViewProps;
|