react-native-external-keyboard 0.9.1 → 1.0.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.
Files changed (372) hide show
  1. package/README.md +95 -600
  2. package/android/build.gradle +0 -18
  3. package/android/src/main/java/com/externalkeyboard/ExternalKeyboardViewPackage.java +24 -22
  4. package/android/src/main/java/com/externalkeyboard/events/EventHelper.java +10 -13
  5. package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +1 -2
  6. package/android/src/main/java/com/externalkeyboard/services/FocusMemoryService.java +64 -0
  7. package/android/src/main/java/com/externalkeyboard/services/KeyboardFocusService.java +41 -0
  8. package/android/src/main/java/com/externalkeyboard/services/KeyboardService.java +4 -13
  9. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +2 -8
  10. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +20 -13
  11. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +99 -21
  12. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +11 -0
  13. package/android/src/main/java/com/externalkeyboard/views/base/FocusHighlightBase.java +11 -5
  14. package/android/src/main/java/com/externalkeyboard/views/base/FocusableBase.java +36 -0
  15. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java +2 -3
  16. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java +10 -61
  17. package/android/src/newarch/ExternalKeyboardLockViewManagerInterface.java +11 -0
  18. package/android/src/newarch/ExternalKeyboardLockViewManagerSpec.java +0 -1
  19. package/android/src/newarch/ExternalKeyboardViewManagerInterface.java +42 -0
  20. package/android/src/newarch/ExternalKeyboardViewManagerSpec.java +0 -1
  21. package/android/src/newarch/KeyboardFocusGroupManagerInterface.java +12 -0
  22. package/android/src/newarch/KeyboardFocusGroupManagerSpec.java +0 -1
  23. package/android/src/newarch/TextInputFocusWrapperManagerInterface.java +34 -0
  24. package/android/src/newarch/TextInputFocusWrapperManagerSpec.java +0 -10
  25. package/android/src/newarch/helper/ReactNativeEventDispatcher.java +28 -0
  26. package/android/src/oldarch/ExternalKeyboardViewManagerSpec.java +6 -4
  27. package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +4 -0
  28. package/android/src/oldarch/helper/ReactNativeEventDispatcher.java +15 -0
  29. package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusDelegate.mm +1 -1
  30. package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusProtocol.h +1 -1
  31. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +2 -1
  32. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +41 -5
  33. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -0
  34. package/ios/Extensions/RCTCustomScrollView+RNCEKVExternalKeyboard.mm +5 -6
  35. package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +8 -9
  36. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +1 -1
  37. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +0 -1
  38. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +16 -4
  39. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +7 -10
  40. package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +4 -4
  41. package/ios/Helpers/RNCEKVSwizzleInstanceMethod/RNCEKVSwizzleInstanceMethod.h +19 -0
  42. package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +1 -1
  43. package/ios/Services/RNCEKVFocusMemoryService.h +39 -0
  44. package/ios/Services/RNCEKVFocusMemoryService.mm +42 -0
  45. package/ios/Services/RNCEKVKeyboardFocusService.h +28 -0
  46. package/ios/Services/RNCEKVKeyboardFocusService.mm +54 -0
  47. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +2 -0
  48. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +12 -10
  49. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +1 -1
  50. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +6 -17
  51. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +1 -0
  52. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +146 -6
  53. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +2 -0
  54. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +4 -0
  55. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +1 -1
  56. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +8 -4
  57. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +22 -11
  58. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +17 -0
  59. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +12 -0
  60. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +67 -65
  61. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  62. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +49 -97
  63. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  64. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
  65. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
  66. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
  67. package/lib/commonjs/components/{KeyboardExtendedInput/KeyboardExtendedInput.types.js → KeyboardFocusGroup/KeyboardFocusGroup.types.js} +1 -1
  68. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
  69. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
  70. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
  71. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
  72. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
  73. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
  74. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  75. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +14 -51
  76. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  77. package/lib/commonjs/components/index.js +47 -0
  78. package/lib/commonjs/components/index.js.map +1 -1
  79. package/lib/commonjs/index.js +37 -19
  80. package/lib/commonjs/index.js.map +1 -1
  81. package/lib/commonjs/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
  82. package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
  83. package/lib/commonjs/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
  84. package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
  85. package/lib/commonjs/types/KeyboardFocusLock.types.js +13 -0
  86. package/lib/commonjs/types/KeyboardFocusLock.types.js.map +1 -1
  87. package/lib/commonjs/types/baseKeyboardView.types.js +6 -0
  88. package/lib/commonjs/types/baseKeyboardView.types.js.map +1 -0
  89. package/lib/commonjs/types/{FocusStyle.js → focus.types.js} +1 -1
  90. package/lib/commonjs/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
  91. package/lib/commonjs/types/focusOrder.types.js +33 -0
  92. package/lib/commonjs/types/focusOrder.types.js.map +1 -0
  93. package/lib/commonjs/types/{WithKeyboardFocus.js → focusStyle.types.js} +1 -1
  94. package/lib/commonjs/types/{WithKeyboardFocus.js.map → focusStyle.types.js.map} +1 -1
  95. package/lib/commonjs/types/index.js +18 -0
  96. package/lib/commonjs/types/index.js.map +1 -1
  97. package/lib/commonjs/types/keyPress.types.js +6 -0
  98. package/lib/{module/types/WithKeyboardFocus.js.map → commonjs/types/keyPress.types.js.map} +1 -1
  99. package/lib/commonjs/types/keyboardInput.types.js +6 -0
  100. package/lib/commonjs/types/keyboardInput.types.js.map +1 -0
  101. package/lib/commonjs/types/withKeyboardFocus.types.js +6 -0
  102. package/lib/commonjs/types/withKeyboardFocus.types.js.map +1 -0
  103. package/lib/commonjs/utils/mapLockFocus.js +37 -0
  104. package/lib/commonjs/utils/mapLockFocus.js.map +1 -0
  105. package/lib/commonjs/utils/useFocusStyle.js +4 -21
  106. package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
  107. package/lib/commonjs/utils/useKeyboardFocusContainer.js +79 -0
  108. package/lib/commonjs/utils/useKeyboardFocusContainer.js.map +1 -0
  109. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
  110. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
  111. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
  112. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
  113. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js +9 -7
  114. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
  115. package/lib/commonjs/utils/useKeyboardPressState.js +65 -0
  116. package/lib/commonjs/utils/useKeyboardPressState.js.map +1 -0
  117. package/lib/commonjs/utils/useOnFocusChange.js +1 -1
  118. package/lib/commonjs/utils/useOnFocusChange.js.map +1 -1
  119. package/lib/commonjs/utils/useOrderValidation.js +35 -0
  120. package/lib/commonjs/utils/useOrderValidation.js.map +1 -0
  121. package/lib/commonjs/utils/useRenderedChildren.js +34 -0
  122. package/lib/commonjs/utils/useRenderedChildren.js.map +1 -0
  123. package/lib/commonjs/utils/useWrappedOrderProps.js +35 -0
  124. package/lib/commonjs/utils/useWrappedOrderProps.js.map +1 -0
  125. package/lib/commonjs/utils/withKeyboardFocus.js +81 -96
  126. package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
  127. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +57 -55
  128. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  129. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +51 -99
  130. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  131. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
  132. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
  133. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
  134. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js +4 -0
  135. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
  136. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
  137. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
  138. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
  139. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
  140. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
  141. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  142. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +16 -53
  143. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  144. package/lib/module/components/index.js +5 -0
  145. package/lib/module/components/index.js.map +1 -1
  146. package/lib/module/index.js +20 -7
  147. package/lib/module/index.js.map +1 -1
  148. package/lib/module/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
  149. package/lib/module/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
  150. package/lib/module/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
  151. package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
  152. package/lib/module/types/KeyboardFocusLock.types.js +12 -1
  153. package/lib/module/types/KeyboardFocusLock.types.js.map +1 -1
  154. package/lib/module/types/baseKeyboardView.types.js +4 -0
  155. package/lib/module/types/baseKeyboardView.types.js.map +1 -0
  156. package/lib/module/types/focus.types.js +4 -0
  157. package/lib/module/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
  158. package/lib/module/types/focusOrder.types.js +31 -0
  159. package/lib/module/types/focusOrder.types.js.map +1 -0
  160. package/lib/module/types/focusStyle.types.js +4 -0
  161. package/lib/module/types/focusStyle.types.js.map +1 -0
  162. package/lib/module/types/index.js +3 -0
  163. package/lib/module/types/index.js.map +1 -1
  164. package/lib/module/types/keyPress.types.js +4 -0
  165. package/lib/module/types/keyPress.types.js.map +1 -0
  166. package/lib/module/types/keyboardInput.types.js +4 -0
  167. package/lib/module/types/keyboardInput.types.js.map +1 -0
  168. package/lib/module/types/withKeyboardFocus.types.js +4 -0
  169. package/lib/module/types/withKeyboardFocus.types.js.map +1 -0
  170. package/lib/module/utils/mapLockFocus.js +32 -0
  171. package/lib/module/utils/mapLockFocus.js.map +1 -0
  172. package/lib/module/utils/useFocusStyle.js +4 -21
  173. package/lib/module/utils/useFocusStyle.js.map +1 -1
  174. package/lib/module/utils/useKeyboardFocusContainer.js +74 -0
  175. package/lib/module/utils/useKeyboardFocusContainer.js.map +1 -0
  176. package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
  177. package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
  178. package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
  179. package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
  180. package/lib/module/utils/useKeyboardPress/useKeyboardPress.js +9 -7
  181. package/lib/module/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
  182. package/lib/module/utils/useKeyboardPressState.js +60 -0
  183. package/lib/module/utils/useKeyboardPressState.js.map +1 -0
  184. package/lib/module/utils/useOnFocusChange.js +1 -1
  185. package/lib/module/utils/useOnFocusChange.js.map +1 -1
  186. package/lib/module/utils/useOrderValidation.js +30 -0
  187. package/lib/module/utils/useOrderValidation.js.map +1 -0
  188. package/lib/module/utils/useRenderedChildren.js +29 -0
  189. package/lib/module/utils/useRenderedChildren.js.map +1 -0
  190. package/lib/module/utils/useWrappedOrderProps.js +30 -0
  191. package/lib/module/utils/useWrappedOrderProps.js.map +1 -0
  192. package/lib/module/utils/withKeyboardFocus.js +84 -99
  193. package/lib/module/utils/withKeyboardFocus.js.map +1 -1
  194. package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts +30 -10
  195. package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
  196. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts +187 -12
  197. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
  198. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts +4 -146
  199. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts.map +1 -1
  200. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts +2 -12
  201. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts.map +1 -1
  202. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts +4 -146
  203. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts.map +1 -1
  204. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts +13 -0
  205. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts.map +1 -0
  206. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts +1 -1
  207. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts.map +1 -1
  208. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts +1 -1
  209. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts.map +1 -1
  210. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +1 -1
  211. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -1
  212. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +1 -1
  213. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -1
  214. package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts +28 -18
  215. package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
  216. package/lib/typescript/src/components/Touchable/Pressable.d.ts +14 -14
  217. package/lib/typescript/src/components/Touchable/Pressable.d.ts.map +1 -1
  218. package/lib/typescript/src/components/index.d.ts +5 -0
  219. package/lib/typescript/src/components/index.d.ts.map +1 -1
  220. package/lib/typescript/src/index.d.ts +694 -9
  221. package/lib/typescript/src/index.d.ts.map +1 -1
  222. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +2 -4
  223. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -1
  224. package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +6 -7
  225. package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
  226. package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts +2 -4
  227. package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts.map +1 -1
  228. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +4 -4
  229. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
  230. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +15 -1
  231. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -1
  232. package/lib/typescript/src/types/KeyboardFocusView.types.d.ts +16 -14
  233. package/lib/typescript/src/types/KeyboardFocusView.types.d.ts.map +1 -1
  234. package/lib/typescript/src/types/baseKeyboardView.types.d.ts +119 -0
  235. package/lib/typescript/src/types/baseKeyboardView.types.d.ts.map +1 -0
  236. package/lib/typescript/src/types/focus.types.d.ts +35 -0
  237. package/lib/typescript/src/types/focus.types.d.ts.map +1 -0
  238. package/lib/typescript/src/types/focusOrder.types.d.ts +57 -0
  239. package/lib/typescript/src/types/focusOrder.types.d.ts.map +1 -0
  240. package/lib/typescript/src/types/focusStyle.types.d.ts +11 -0
  241. package/lib/typescript/src/types/focusStyle.types.d.ts.map +1 -0
  242. package/lib/typescript/src/types/index.d.ts +11 -2
  243. package/lib/typescript/src/types/index.d.ts.map +1 -1
  244. package/lib/typescript/src/types/keyPress.types.d.ts +7 -0
  245. package/lib/typescript/src/types/keyPress.types.d.ts.map +1 -0
  246. package/lib/typescript/src/types/keyboardInput.types.d.ts +53 -0
  247. package/lib/typescript/src/types/keyboardInput.types.d.ts.map +1 -0
  248. package/lib/typescript/src/types/withKeyboardFocus.types.d.ts +109 -0
  249. package/lib/typescript/src/types/withKeyboardFocus.types.d.ts.map +1 -0
  250. package/lib/typescript/src/utils/mapLockFocus.d.ts +3 -0
  251. package/lib/typescript/src/utils/mapLockFocus.d.ts.map +1 -0
  252. package/lib/typescript/src/utils/useFocusStyle.d.ts +26 -34
  253. package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
  254. package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts +898 -0
  255. package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts.map +1 -0
  256. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts +2 -2
  257. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts.map +1 -1
  258. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts +4 -3
  259. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts.map +1 -1
  260. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts +3 -3
  261. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts.map +1 -1
  262. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts +1 -2
  263. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts.map +1 -1
  264. package/lib/typescript/src/utils/useKeyboardPressState.d.ts +29 -0
  265. package/lib/typescript/src/utils/useKeyboardPressState.d.ts.map +1 -0
  266. package/lib/typescript/src/utils/useOnFocusChange.d.ts +3 -3
  267. package/lib/typescript/src/utils/useOnFocusChange.d.ts.map +1 -1
  268. package/lib/typescript/src/utils/useOrderValidation.d.ts +8 -0
  269. package/lib/typescript/src/utils/useOrderValidation.d.ts.map +1 -0
  270. package/lib/typescript/src/utils/useRenderedChildren.d.ts +18 -0
  271. package/lib/typescript/src/utils/useRenderedChildren.d.ts.map +1 -0
  272. package/lib/typescript/src/utils/useWrappedOrderProps.d.ts +13 -0
  273. package/lib/typescript/src/utils/useWrappedOrderProps.d.ts.map +1 -0
  274. package/lib/typescript/src/utils/withKeyboardFocus.d.ts +3 -4
  275. package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
  276. package/package.json +4 -2
  277. package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +74 -94
  278. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +49 -149
  279. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.tsx +23 -32
  280. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx +32 -41
  281. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.tsx +3 -14
  282. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.ts +15 -0
  283. package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.tsx +2 -2
  284. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.tsx +2 -2
  285. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +1 -1
  286. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +2 -2
  287. package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +29 -68
  288. package/src/components/Touchable/Pressable.tsx +2 -2
  289. package/src/components/index.ts +12 -0
  290. package/src/index.tsx +44 -32
  291. package/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.ts +1 -3
  292. package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +12 -9
  293. package/src/nativeSpec/KeyboardFocusGroupNativeComponent.ts +5 -3
  294. package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +7 -3
  295. package/src/types/KeyboardFocusLock.types.ts +16 -1
  296. package/src/types/KeyboardFocusView.types.ts +17 -18
  297. package/src/types/baseKeyboardView.types.ts +122 -0
  298. package/src/types/focus.types.ts +40 -0
  299. package/src/types/focusOrder.types.ts +59 -0
  300. package/src/types/{FocusStyle.ts → focusStyle.types.ts} +5 -0
  301. package/src/types/index.ts +32 -2
  302. package/src/types/keyPress.types.ts +8 -0
  303. package/src/types/keyboardInput.types.ts +81 -0
  304. package/src/types/withKeyboardFocus.types.ts +178 -0
  305. package/src/utils/mapLockFocus.ts +31 -0
  306. package/src/utils/useFocusStyle.tsx +13 -41
  307. package/src/utils/useKeyboardFocusContainer.ts +102 -0
  308. package/src/utils/useKeyboardPress/useKeyboardPress.android.ts +4 -7
  309. package/src/utils/useKeyboardPress/useKeyboardPress.ios.ts +3 -6
  310. package/src/utils/useKeyboardPress/useKeyboardPress.ts +9 -7
  311. package/src/utils/useKeyboardPress/useKeyboardPress.types.ts +1 -2
  312. package/src/utils/useKeyboardPressState.ts +81 -0
  313. package/src/utils/useOnFocusChange.ts +4 -7
  314. package/src/utils/useOrderValidation.ts +74 -0
  315. package/src/utils/useRenderedChildren.ts +42 -0
  316. package/src/utils/useWrappedOrderProps.ts +48 -0
  317. package/src/utils/withKeyboardFocus.tsx +105 -125
  318. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
  319. package/lib/commonjs/components/KeyboardFocusView/hooks/index.js +0 -13
  320. package/lib/commonjs/components/KeyboardFocusView/hooks/index.js.map +0 -1
  321. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -13
  322. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
  323. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -33
  324. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
  325. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -39
  326. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
  327. package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js +0 -23
  328. package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
  329. package/lib/commonjs/types/BaseKeyboardView.js +0 -18
  330. package/lib/commonjs/types/BaseKeyboardView.js.map +0 -1
  331. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js +0 -4
  332. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
  333. package/lib/module/components/KeyboardFocusView/hooks/index.js +0 -4
  334. package/lib/module/components/KeyboardFocusView/hooks/index.js.map +0 -1
  335. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -4
  336. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
  337. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -28
  338. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
  339. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -34
  340. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
  341. package/lib/module/components/RenderPropComponent/RenderPropComponent.js +0 -17
  342. package/lib/module/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
  343. package/lib/module/types/BaseKeyboardView.js +0 -14
  344. package/lib/module/types/BaseKeyboardView.js.map +0 -1
  345. package/lib/module/types/FocusStyle.js +0 -4
  346. package/lib/module/types/WithKeyboardFocus.js +0 -4
  347. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +0 -45
  348. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +0 -1
  349. package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts +0 -2
  350. package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts.map +0 -1
  351. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts +0 -2
  352. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts.map +0 -1
  353. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts +0 -175
  354. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts.map +0 -1
  355. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts +0 -181
  356. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts.map +0 -1
  357. package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts +0 -6
  358. package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts.map +0 -1
  359. package/lib/typescript/src/types/BaseKeyboardView.d.ts +0 -70
  360. package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +0 -1
  361. package/lib/typescript/src/types/FocusStyle.d.ts +0 -6
  362. package/lib/typescript/src/types/FocusStyle.d.ts.map +0 -1
  363. package/lib/typescript/src/types/WithKeyboardFocus.d.ts +0 -47
  364. package/lib/typescript/src/types/WithKeyboardFocus.d.ts.map +0 -1
  365. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +0 -73
  366. package/src/components/KeyboardFocusView/hooks/index.ts +0 -1
  367. package/src/components/KeyboardFocusView/hooks/useFocusStyle/index.ts +0 -1
  368. package/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.ts +0 -34
  369. package/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.ts +0 -41
  370. package/src/components/RenderPropComponent/RenderPropComponent.tsx +0 -18
  371. package/src/types/BaseKeyboardView.ts +0 -74
  372. package/src/types/WithKeyboardFocus.ts +0 -115
@@ -10,7 +10,7 @@ const ANDROID_DPAD_CENTER_CODE = exports.ANDROID_DPAD_CENTER_CODE = 23;
10
10
  const ANDROID_ENTER_CODE = exports.ANDROID_ENTER_CODE = 66;
11
11
  const ANDROID_TRIGGER_CODES = exports.ANDROID_TRIGGER_CODES = [ANDROID_SPACE_KEY_CODE, ANDROID_DPAD_CENTER_CODE, ANDROID_ENTER_CODE];
12
12
  const useDebouncedCallback = (callback, delay) => {
13
- const timeoutRef = (0, _react.useRef)(undefined);
13
+ const timeoutRef = (0, _react.useRef)(null);
14
14
  return (0, _react.useCallback)((...args) => {
15
15
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
16
16
  timeoutRef.current = setTimeout(() => {
@@ -25,8 +25,7 @@ const useKeyboardPress = ({
25
25
  onPressOut,
26
26
  onPress,
27
27
  onLongPress,
28
- triggerCodes = ANDROID_TRIGGER_CODES,
29
- disabled = false
28
+ triggerCodes = ANDROID_TRIGGER_CODES
30
29
  }) => {
31
30
  const isLongPressRef = (0, _react.useRef)(false);
32
31
  const debouncedOnPress = useDebouncedCallback(event => {
@@ -46,24 +45,22 @@ const useKeyboardPress = ({
46
45
  } = e;
47
46
  onPressOut?.(e);
48
47
  onKeyUpPress?.(e);
49
- if (disabled) return;
50
48
  if (triggerCodes.includes(keyCode)) {
51
49
  if (isLongPress) {
52
50
  isLongPressRef.current = true;
53
51
  debouncedOnPress();
54
52
  }
55
53
  }
56
- }, [onPressOut, onKeyUpPress, triggerCodes, debouncedOnPress, disabled]);
54
+ }, [onPressOut, onKeyUpPress, triggerCodes, debouncedOnPress]);
57
55
  const onKeyDownPressHandler = (0, _react.useMemo)(() => {
58
56
  if (!onPressIn) return onKeyDownPress;
59
57
  return e => {
60
58
  onKeyDownPress?.(e);
61
- if (disabled) return;
62
59
  if (triggerCodes.includes(e.nativeEvent.keyCode)) {
63
60
  onPressIn?.(e);
64
61
  }
65
62
  };
66
- }, [onKeyDownPress, onPressIn, triggerCodes, disabled]);
63
+ }, [onKeyDownPress, onPressIn, triggerCodes]);
67
64
  const onPressHandler = (0, _react.useCallback)(event => {
68
65
  debouncedOnPress(event);
69
66
  }, [debouncedOnPress]);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","ANDROID_SPACE_KEY_CODE","exports","ANDROID_DPAD_CENTER_CODE","ANDROID_ENTER_CODE","ANDROID_TRIGGER_CODES","useDebouncedCallback","callback","delay","timeoutRef","useRef","undefined","useCallback","args","current","clearTimeout","setTimeout","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPressIn","onPressOut","onPress","onLongPress","triggerCodes","disabled","isLongPressRef","debouncedOnPress","event","onKeyUpPressHandler","e","nativeEvent","keyCode","isLongPress","includes","onKeyDownPressHandler","useMemo","onPressHandler","hasHandler"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.android.ts"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","ANDROID_SPACE_KEY_CODE","exports","ANDROID_DPAD_CENTER_CODE","ANDROID_ENTER_CODE","ANDROID_TRIGGER_CODES","useDebouncedCallback","callback","delay","timeoutRef","useRef","useCallback","args","current","clearTimeout","setTimeout","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPressIn","onPressOut","onPress","onLongPress","triggerCodes","isLongPressRef","debouncedOnPress","event","onKeyUpPressHandler","e","nativeEvent","keyCode","isLongPress","includes","onKeyDownPressHandler","useMemo","onPressHandler","hasHandler","undefined"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.android.ts"],"mappings":"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","ignoreList":[]}
@@ -15,13 +15,11 @@ const useKeyboardPress = ({
15
15
  onPressIn,
16
16
  onPressOut,
17
17
  onLongPress,
18
- triggerCodes = IOS_TRIGGER_CODES,
19
- disabled = false
18
+ triggerCodes = IOS_TRIGGER_CODES
20
19
  }) => {
21
20
  const onKeyUpPressHandler = (0, _react.useMemo)(() => {
22
21
  return e => {
23
22
  onKeyUpPress?.(e);
24
- if (disabled) return;
25
23
  if (triggerCodes.includes(e.nativeEvent.keyCode)) {
26
24
  onPressOut?.(e);
27
25
  if (e.nativeEvent.isLongPress) {
@@ -31,17 +29,16 @@ const useKeyboardPress = ({
31
29
  }
32
30
  }
33
31
  };
34
- }, [onKeyUpPress, onLongPress, onPress, onPressOut, triggerCodes, disabled]);
32
+ }, [onKeyUpPress, onLongPress, onPress, onPressOut, triggerCodes]);
35
33
  const onKeyDownPressHandler = (0, _react.useMemo)(() => {
36
34
  if (!onPressIn) return onKeyDownPress;
37
35
  return e => {
38
36
  onKeyDownPress?.(e);
39
- if (disabled) return;
40
37
  if (triggerCodes.includes(e.nativeEvent.keyCode)) {
41
38
  onPressIn?.(e);
42
39
  }
43
40
  };
44
- }, [onKeyDownPress, onPressIn, triggerCodes, disabled]);
41
+ }, [onKeyDownPress, onPressIn, triggerCodes]);
45
42
  return {
46
43
  onKeyUpPressHandler,
47
44
  onKeyDownPressHandler,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","IOS_SPACE_KEY","IOS_RETURN_OR_ENTER","IOS_TRIGGER_CODES","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPress","onPressIn","onPressOut","onLongPress","triggerCodes","disabled","onKeyUpPressHandler","useMemo","e","includes","nativeEvent","keyCode","isLongPress","onKeyDownPressHandler","onPressHandler","exports"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.ios.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAE9B,MAAMC,iBAAiB,GAAG,CAACF,aAAa,EAAEC,mBAAmB,CAAC;AAEvD,MAAME,gBAAgB,GAAGA,CAG9B;EACAC,YAAY;EACZC,cAAc;EACdC,OAAO;EACPC,SAAS;EACTC,UAAU;EACVC,WAAW;EACXC,YAAY,GAAGR,iBAAiB;EAChCS,QAAQ,GAAG;AACgB,CAAC,KAAK;EACjC,MAAMC,mBAAmB,GAAG,IAAAC,cAAO,EAAC,MAAM;IACxC,OAAQC,CAAa,IAAK;MACxBV,YAAY,GAAGU,CAAC,CAAC;MACjB,IAAIH,QAAQ,EAAE;MAEd,IAAID,YAAY,CAACK,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDT,UAAU,GAAGM,CAAC,CAAC;QACf,IAAIA,CAAC,CAACE,WAAW,CAACE,WAAW,EAAE;UAC7BT,WAAW,GAAG,CAAC,CAA0B,CAAC;QAC5C,CAAC,MAAM;UACLH,OAAO,GAAG,CAAC,CAA0B,CAAC;QACxC;MACF;IACF,CAAC;EACH,CAAC,EAAE,CAACF,YAAY,EAAEK,WAAW,EAAEH,OAAO,EAAEE,UAAU,EAAEE,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAE5E,MAAMQ,qBAAqB,GAAG,IAAAN,cAAO,EAAC,MAAM;IAC1C,IAAI,CAACN,SAAS,EAAE,OAAOF,cAAc;IACrC,OAAQS,CAAa,IAAK;MACxBT,cAAc,GAAGS,CAAC,CAAC;MACnB,IAAIH,QAAQ,EAAE;MACd,IAAID,YAAY,CAACK,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDV,SAAS,GAAGO,CAAC,CAAC;MAChB;IACF,CAAC;EACH,CAAC,EAAE,CAACT,cAAc,EAAEE,SAAS,EAAEG,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAEvD,OAAO;IACLC,mBAAmB;IACnBO,qBAAqB;IACrBC,cAAc,EAAEd;EAClB,CAAC;AACH,CAAC;AAACe,OAAA,CAAAlB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","IOS_SPACE_KEY","IOS_RETURN_OR_ENTER","IOS_TRIGGER_CODES","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPress","onPressIn","onPressOut","onLongPress","triggerCodes","onKeyUpPressHandler","useMemo","e","includes","nativeEvent","keyCode","isLongPress","onKeyDownPressHandler","onPressHandler","exports"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.ios.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKA,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAE9B,MAAMC,iBAAiB,GAAG,CAACF,aAAa,EAAEC,mBAAmB,CAAC;AAEvD,MAAME,gBAAgB,GAAGA,CAG9B;EACAC,YAAY;EACZC,cAAc;EACdC,OAAO;EACPC,SAAS;EACTC,UAAU;EACVC,WAAW;EACXC,YAAY,GAAGR;AACY,CAAC,KAAK;EACjC,MAAMS,mBAAmB,GAAG,IAAAC,cAAO,EAAC,MAAM;IACxC,OAAQC,CAAa,IAAK;MACxBT,YAAY,GAAGS,CAAC,CAAC;MAEjB,IAAIH,YAAY,CAACI,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDR,UAAU,GAAGK,CAAC,CAAC;QACf,IAAIA,CAAC,CAACE,WAAW,CAACE,WAAW,EAAE;UAC7BR,WAAW,GAAG,CAAC,CAA0B,CAAC;QAC5C,CAAC,MAAM;UACLH,OAAO,GAAG,CAAC,CAA0B,CAAC;QACxC;MACF;IACF,CAAC;EACH,CAAC,EAAE,CAACF,YAAY,EAAEK,WAAW,EAAEH,OAAO,EAAEE,UAAU,EAAEE,YAAY,CAAC,CAAC;EAElE,MAAMQ,qBAAqB,GAAG,IAAAN,cAAO,EAAC,MAAM;IAC1C,IAAI,CAACL,SAAS,EAAE,OAAOF,cAAc;IACrC,OAAQQ,CAAa,IAAK;MACxBR,cAAc,GAAGQ,CAAC,CAAC;MACnB,IAAIH,YAAY,CAACI,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDT,SAAS,GAAGM,CAAC,CAAC;MAChB;IACF,CAAC;EACH,CAAC,EAAE,CAACR,cAAc,EAAEE,SAAS,EAAEG,YAAY,CAAC,CAAC;EAE7C,OAAO;IACLC,mBAAmB;IACnBO,qBAAqB;IACrBC,cAAc,EAAEb;EAClB,CAAC;AACH,CAAC;AAACc,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -12,31 +12,33 @@ const useKeyboardPress = ({
12
12
  onKeyUpPress,
13
13
  onKeyDownPress,
14
14
  onPress,
15
+ onLongPress,
15
16
  onPressIn,
16
17
  onPressOut,
17
- triggerCodes = IOS_TRIGGER_CODES,
18
- disabled = false
18
+ triggerCodes = IOS_TRIGGER_CODES
19
19
  }) => {
20
20
  const onKeyUpPressHandler = (0, _react.useMemo)(() => {
21
- if (!onPressOut) return onKeyUpPress;
22
21
  return e => {
23
22
  onKeyUpPress?.(e);
24
- if (disabled) return;
25
23
  if (triggerCodes.includes(e.nativeEvent.keyCode)) {
26
24
  onPressOut?.(e);
25
+ if (e.nativeEvent.isLongPress) {
26
+ onLongPress?.({});
27
+ } else {
28
+ onPress?.({});
29
+ }
27
30
  }
28
31
  };
29
- }, [onKeyUpPress, onPressOut, triggerCodes, disabled]);
32
+ }, [onKeyUpPress, onLongPress, onPress, onPressOut, triggerCodes]);
30
33
  const onKeyDownPressHandler = (0, _react.useMemo)(() => {
31
34
  if (!onPressIn) return onKeyDownPress;
32
35
  return e => {
33
36
  onKeyDownPress?.(e);
34
- if (disabled) return;
35
37
  if (triggerCodes.includes(e.nativeEvent.keyCode)) {
36
38
  onPressIn?.(e);
37
39
  }
38
40
  };
39
- }, [onKeyDownPress, onPressIn, triggerCodes, disabled]);
41
+ }, [onKeyDownPress, onPressIn, triggerCodes]);
40
42
  return {
41
43
  onKeyUpPressHandler,
42
44
  onKeyDownPressHandler,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","IOS_SPACE_KEY","IOS_RETURN_OR_ENTER","IOS_TRIGGER_CODES","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPress","onPressIn","onPressOut","triggerCodes","disabled","onKeyUpPressHandler","useMemo","e","includes","nativeEvent","keyCode","onKeyDownPressHandler","onPressHandler","exports"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAE9B,MAAMC,iBAAiB,GAAG,CAACF,aAAa,EAAEC,mBAAmB,CAAC;AAEvD,MAAME,gBAAgB,GAAGA,CAG9B;EACAC,YAAY;EACZC,cAAc;EACdC,OAAO;EACPC,SAAS;EACTC,UAAU;EACVC,YAAY,GAAGP,iBAAiB;EAChCQ,QAAQ,GAAG;AACgB,CAAC,KAAK;EACjC,MAAMC,mBAAmB,GAAG,IAAAC,cAAO,EAAC,MAAM;IACxC,IAAI,CAACJ,UAAU,EAAE,OAAOJ,YAAY;IACpC,OAAQS,CAAa,IAAK;MACxBT,YAAY,GAAGS,CAAC,CAAC;MACjB,IAAIH,QAAQ,EAAE;MACd,IAAID,YAAY,CAACK,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDR,UAAU,GAAGK,CAAC,CAAC;MACjB;IACF,CAAC;EACH,CAAC,EAAE,CAACT,YAAY,EAAEI,UAAU,EAAEC,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAEtD,MAAMO,qBAAqB,GAAG,IAAAL,cAAO,EAAC,MAAM;IAC1C,IAAI,CAACL,SAAS,EAAE,OAAOF,cAAc;IACrC,OAAQQ,CAAa,IAAK;MACxBR,cAAc,GAAGQ,CAAC,CAAC;MACnB,IAAIH,QAAQ,EAAE;MACd,IAAID,YAAY,CAACK,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDT,SAAS,GAAGM,CAAC,CAAC;MAChB;IACF,CAAC;EACH,CAAC,EAAE,CAACR,cAAc,EAAEE,SAAS,EAAEE,YAAY,EAAEC,QAAQ,CAAC,CAAC;EAEvD,OAAO;IACLC,mBAAmB;IACnBM,qBAAqB;IACrBC,cAAc,EAAEZ;EAClB,CAAC;AACH,CAAC;AAACa,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","IOS_SPACE_KEY","IOS_RETURN_OR_ENTER","IOS_TRIGGER_CODES","useKeyboardPress","onKeyUpPress","onKeyDownPress","onPress","onLongPress","onPressIn","onPressOut","triggerCodes","onKeyUpPressHandler","useMemo","e","includes","nativeEvent","keyCode","isLongPress","onKeyDownPressHandler","onPressHandler","exports"],"sourceRoot":"../../../../src","sources":["utils/useKeyboardPress/useKeyboardPress.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAE9B,MAAMC,iBAAiB,GAAG,CAACF,aAAa,EAAEC,mBAAmB,CAAC;AAEvD,MAAME,gBAAgB,GAAGA,CAG9B;EACAC,YAAY;EACZC,cAAc;EACdC,OAAO;EACPC,WAAW;EACXC,SAAS;EACTC,UAAU;EACVC,YAAY,GAAGR;AACY,CAAC,KAAK;EACjC,MAAMS,mBAAmB,GAAG,IAAAC,cAAO,EAAC,MAAM;IACxC,OAAQC,CAAa,IAAK;MACxBT,YAAY,GAAGS,CAAC,CAAC;MACjB,IAAIH,YAAY,CAACI,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDP,UAAU,GAAGI,CAAC,CAAC;QACf,IAAIA,CAAC,CAACE,WAAW,CAACE,WAAW,EAAE;UAC7BV,WAAW,GAAG,CAAC,CAAQ,CAAC;QAC1B,CAAC,MAAM;UACLD,OAAO,GAAG,CAAC,CAAQ,CAAC;QACtB;MACF;IACF,CAAC;EACH,CAAC,EAAE,CAACF,YAAY,EAAEG,WAAW,EAAED,OAAO,EAAEG,UAAU,EAAEC,YAAY,CAAC,CAAC;EAElE,MAAMQ,qBAAqB,GAAG,IAAAN,cAAO,EAAC,MAAM;IAC1C,IAAI,CAACJ,SAAS,EAAE,OAAOH,cAAc;IACrC,OAAQQ,CAAa,IAAK;MACxBR,cAAc,GAAGQ,CAAC,CAAC;MACnB,IAAIH,YAAY,CAACI,QAAQ,CAACD,CAAC,CAACE,WAAW,CAACC,OAAO,CAAC,EAAE;QAChDR,SAAS,GAAGK,CAAC,CAAC;MAChB;IACF,CAAC;EACH,CAAC,EAAE,CAACR,cAAc,EAAEG,SAAS,EAAEE,YAAY,CAAC,CAAC;EAE7C,OAAO;IACLC,mBAAmB;IACnBO,qBAAqB;IACrBC,cAAc,EAAEb;EAClB,CAAC;AACH,CAAC;AAACc,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useKeyboardPressState = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ /**
10
+ * Android only. Physical-keyboard activation (Enter / Space / DPad-center) never
11
+ * reaches the touch responder, so a wrapped component's `pressed` stays false.
12
+ * This derives a press state from the key down/up events and returns composable
13
+ * pieces to thread it through focus, press handlers, and function styles.
14
+ *
15
+ * Everything is a no-op unless `enabled` and running on Android, so callers can
16
+ * always wire the returned values unconditionally.
17
+ */
18
+ const useKeyboardPressState = ({
19
+ enabled = false,
20
+ onPressIn,
21
+ onPressOut,
22
+ onFocusChange
23
+ }) => {
24
+ const active = enabled && _reactNative.Platform.OS === 'android';
25
+ const [pressed, setPressed] = (0, _react.useState)(false);
26
+ const handlePressIn = (0, _react.useCallback)(e => {
27
+ setPressed(true);
28
+ onPressIn?.(e);
29
+ }, [onPressIn]);
30
+ const handlePressOut = (0, _react.useCallback)(e => {
31
+ setPressed(false);
32
+ onPressOut?.(e);
33
+ }, [onPressOut]);
34
+ const handleFocusChange = (0, _react.useCallback)(isFocused => {
35
+ // Drop a stuck press if focus leaves before the key-up arrives.
36
+ if (!isFocused && active) setPressed(false);
37
+ onFocusChange?.(isFocused);
38
+ }, [onFocusChange, active]);
39
+
40
+ // Fold the keyboard press into a `style({ pressed })` function so visual
41
+ // press feedback (`withPressedStyle`, function styles) reacts to the keyboard.
42
+ // Non-function styles and the inactive case are returned untouched.
43
+ const applyPressedStyle = (0, _react.useCallback)(style => {
44
+ if (!active || typeof style !== 'function') return style;
45
+ const styleFn = style;
46
+ return ({
47
+ pressed: touchPressed
48
+ }) => styleFn({
49
+ pressed: touchPressed || pressed
50
+ });
51
+ }, [active, pressed]);
52
+ return {
53
+ /** A keyboard-driven press is currently held. */
54
+ pressed: active && pressed,
55
+ /** Pass to the keyboard press hook; the original handlers when inactive. */
56
+ onPressIn: active ? handlePressIn : onPressIn,
57
+ onPressOut: active ? handlePressOut : onPressOut,
58
+ /** Wrap `onFocusChange` to clear a stuck press on blur. */
59
+ onFocusChange: handleFocusChange,
60
+ /** Fold the keyboard press into a function style. */
61
+ applyPressedStyle
62
+ };
63
+ };
64
+ exports.useKeyboardPressState = useKeyboardPressState;
65
+ //# sourceMappingURL=useKeyboardPressState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","useKeyboardPressState","enabled","onPressIn","onPressOut","onFocusChange","active","Platform","OS","pressed","setPressed","useState","handlePressIn","useCallback","e","handlePressOut","handleFocusChange","isFocused","applyPressedStyle","style","styleFn","touchPressed","exports"],"sourceRoot":"../../../src","sources":["utils/useKeyboardPressState.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,qBAAqB,GAAGA,CAAC;EACpCC,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,UAAU;EACVC;AAC2B,CAAC,KAAK;EACjC,MAAMC,MAAM,GAAGJ,OAAO,IAAIK,qBAAQ,CAACC,EAAE,KAAK,SAAS;EACnD,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE7C,MAAMC,aAAa,GAAG,IAAAC,kBAAW,EAC9BC,CAAO,IAAK;IACXJ,UAAU,CAAC,IAAI,CAAC;IAChBP,SAAS,GAAGW,CAAC,CAAC;EAChB,CAAC,EACD,CAACX,SAAS,CACZ,CAAC;EAED,MAAMY,cAAc,GAAG,IAAAF,kBAAW,EAC/BC,CAAO,IAAK;IACXJ,UAAU,CAAC,KAAK,CAAC;IACjBN,UAAU,GAAGU,CAAC,CAAC;EACjB,CAAC,EACD,CAACV,UAAU,CACb,CAAC;EAED,MAAMY,iBAAiB,GAAG,IAAAH,kBAAW,EAClCI,SAAkB,IAAK;IACtB;IACA,IAAI,CAACA,SAAS,IAAIX,MAAM,EAAEI,UAAU,CAAC,KAAK,CAAC;IAC3CL,aAAa,GAAGY,SAAS,CAAC;EAC5B,CAAC,EACD,CAACZ,aAAa,EAAEC,MAAM,CACxB,CAAC;;EAED;EACA;EACA;EACA,MAAMY,iBAAiB,GAAG,IAAAL,kBAAW,EAC/BM,KAAQ,IAAQ;IAClB,IAAI,CAACb,MAAM,IAAI,OAAOa,KAAK,KAAK,UAAU,EAAE,OAAOA,KAAK;IACxD,MAAMC,OAAO,GAAGD,KAAyB;IACzC,OAAQ,CAAC;MAAEV,OAAO,EAAEY;IAAmC,CAAC,KACtDD,OAAO,CAAC;MAAEX,OAAO,EAAEY,YAAY,IAAIZ;IAAQ,CAAC,CAAC;EACjD,CAAC,EACD,CAACH,MAAM,EAAEG,OAAO,CAClB,CAAC;EAED,OAAO;IACL;IACAA,OAAO,EAAEH,MAAM,IAAIG,OAAO;IAC1B;IACAN,SAAS,EAAEG,MAAM,GAAGM,aAAa,GAAGT,SAAS;IAC7CC,UAAU,EAAEE,MAAM,GAAGS,cAAc,GAAGX,UAAU;IAChD;IACAC,aAAa,EAAEW,iBAAiB;IAChC;IACAE;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAArB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -10,7 +10,7 @@ const useOnFocusChange = ({
10
10
  onFocus,
11
11
  onBlur
12
12
  }) => (0, _react.useCallback)(e => {
13
- onFocusChange?.(e.nativeEvent.isFocused, e?.nativeEvent?.target);
13
+ onFocusChange?.(e.nativeEvent.isFocused, e.nativeEvent.target);
14
14
  if (e.nativeEvent.isFocused) {
15
15
  onFocus?.();
16
16
  } else {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","useOnFocusChange","onFocusChange","onFocus","onBlur","useCallback","e","nativeEvent","isFocused","target","exports"],"sourceRoot":"../../../src","sources":["utils/useOnFocusChange.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,aAAa;EACbC,OAAO;EACPC;AACc,CAAC,KACf,IAAAC,kBAAW,EACRC,CAAC,IAAK;EACLJ,aAAa,GACXI,CAAC,CAACC,WAAW,CAACC,SAAS,EACtBF,CAAC,EAAEC,WAAW,EAAqCE,MACtD,CAAC;EACD,IAAIH,CAAC,CAACC,WAAW,CAACC,SAAS,EAAE;IAC3BL,OAAO,GAAG,CAAC;EACb,CAAC,MAAM;IACLC,MAAM,GAAG,CAAC;EACZ;AACF,CAAC,EACD,CAACA,MAAM,EAAED,OAAO,EAAED,aAAa,CACjC,CAAC;AAACQ,OAAA,CAAAT,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","useOnFocusChange","onFocusChange","onFocus","onBlur","useCallback","e","nativeEvent","isFocused","target","exports"],"sourceRoot":"../../../src","sources":["utils/useOnFocusChange.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,aAAa;EACbC,OAAO;EACPC;AACc,CAAC,KACf,IAAAC,kBAAW,EACRC,CAAC,IAAK;EACLJ,aAAa,GAAGI,CAAC,CAACC,WAAW,CAACC,SAAS,EAAEF,CAAC,CAACC,WAAW,CAACE,MAAM,CAAC;EAC9D,IAAIH,CAAC,CAACC,WAAW,CAACC,SAAS,EAAE;IAC3BL,OAAO,GAAG,CAAC;EACb,CAAC,MAAM;IACLC,MAAM,GAAG,CAAC;EACZ;AACF,CAAC,EACD,CAACA,MAAM,EAAED,OAAO,EAAED,aAAa,CACjC,CAAC;AAACQ,OAAA,CAAAT,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useOrderValidation = void 0;
7
+ var _react = require("react");
8
+ const useOrderValidation = ({
9
+ groupId,
10
+ orderIndex,
11
+ orderPrefix,
12
+ orderId,
13
+ orderForward,
14
+ orderBackward,
15
+ orderFirst,
16
+ orderLast,
17
+ orderLeft,
18
+ orderRight,
19
+ orderUp,
20
+ orderDown
21
+ }) => {
22
+ (0, _react.useEffect)(() => {
23
+ if (!__DEV__) return;
24
+ if (orderIndex !== undefined && !groupId) console.warn('`orderIndex` must be declared alongside `orderGroup` for proper functionality. Ensure components are wrapped with `KeyboardOrderFocusGroup` or provide `orderGroup` directly.');
25
+ }, [groupId, orderIndex]);
26
+ (0, _react.useEffect)(() => {
27
+ if (!__DEV__) return;
28
+ const hasOrderLinkProp = orderId !== undefined || orderForward !== undefined || orderBackward !== undefined || orderFirst !== undefined || orderLast !== undefined || orderLeft !== undefined || orderRight !== undefined || orderUp !== undefined || orderDown !== undefined;
29
+ if (hasOrderLinkProp && orderPrefix === '') {
30
+ console.warn('[react-native-external-keyboard] orderId, orderForward, orderBackward, orderFirst, orderLast, ' + 'orderLeft, orderRight, orderUp, and orderDown are global IDs. ' + 'Wrap the component in <KeyboardOrderFocusGroup> or pass orderPrefix to avoid ID collisions across screens.');
31
+ }
32
+ }, [orderId, orderForward, orderBackward, orderFirst, orderLast, orderLeft, orderRight, orderUp, orderDown, orderPrefix]);
33
+ };
34
+ exports.useOrderValidation = useOrderValidation;
35
+ //# sourceMappingURL=useOrderValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","useOrderValidation","groupId","orderIndex","orderPrefix","orderId","orderForward","orderBackward","orderFirst","orderLast","orderLeft","orderRight","orderUp","orderDown","useEffect","__DEV__","undefined","console","warn","hasOrderLinkProp","exports"],"sourceRoot":"../../../src","sources":["utils/useOrderValidation.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAoBO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,OAAO;EACPC,UAAU;EACVC,WAAW;EACXC,OAAO;EACPC,YAAY;EACZC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,UAAU;EACVC,OAAO;EACPC;AACuB,CAAC,KAAK;EAC7B,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACC,OAAO,EAAE;IACd,IAAIZ,UAAU,KAAKa,SAAS,IAAI,CAACd,OAAO,EACtCe,OAAO,CAACC,IAAI,CACV,+KACF,CAAC;EACL,CAAC,EAAE,CAAChB,OAAO,EAAEC,UAAU,CAAC,CAAC;EAEzB,IAAAW,gBAAS,EAAC,MAAM;IACd,IAAI,CAACC,OAAO,EAAE;IACd,MAAMI,gBAAgB,GACpBd,OAAO,KAAKW,SAAS,IACrBV,YAAY,KAAKU,SAAS,IAC1BT,aAAa,KAAKS,SAAS,IAC3BR,UAAU,KAAKQ,SAAS,IACxBP,SAAS,KAAKO,SAAS,IACvBN,SAAS,KAAKM,SAAS,IACvBL,UAAU,KAAKK,SAAS,IACxBJ,OAAO,KAAKI,SAAS,IACrBH,SAAS,KAAKG,SAAS;IACzB,IAAIG,gBAAgB,IAAIf,WAAW,KAAK,EAAE,EAAE;MAC1Ca,OAAO,CAACC,IAAI,CACV,gGAAgG,GAC9F,gEAAgE,GAChE,4GACJ,CAAC;IACH;EACF,CAAC,EAAE,CACDb,OAAO,EACPC,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTT,WAAW,CACZ,CAAC;AACJ,CAAC;AAACgB,OAAA,CAAAnB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useRenderedChildren = void 0;
7
+ var _react = require("react");
8
+ /**
9
+ * Resolves the `children` override for the wrapped component.
10
+ * - `renderContent` stays a function so the component can call it with its own state + `focused`
11
+ * (keyboard activation forces `pressed` when `keyboardPressed` is set)
12
+ * - `renderFocusable` is evaluated immediately and returned as a static node
13
+ * Returns `undefined` when neither prop is provided.
14
+ */
15
+ const useRenderedChildren = ({
16
+ focused,
17
+ keyboardPressed = false,
18
+ renderContent,
19
+ renderFocusable
20
+ }) => {
21
+ const contentChildren = (0, _react.useMemo)(() => renderContent ? state => renderContent({
22
+ ...state,
23
+ ...(keyboardPressed ? {
24
+ pressed: true
25
+ } : null),
26
+ focused
27
+ }) : undefined, [renderContent, focused, keyboardPressed]);
28
+ const focusableChildren = (0, _react.useMemo)(() => renderFocusable?.({
29
+ focused
30
+ }), [renderFocusable, focused]);
31
+ return contentChildren ?? focusableChildren;
32
+ };
33
+ exports.useRenderedChildren = useRenderedChildren;
34
+ //# sourceMappingURL=useRenderedChildren.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","useRenderedChildren","focused","keyboardPressed","renderContent","renderFocusable","contentChildren","useMemo","state","pressed","undefined","focusableChildren","exports"],"sourceRoot":"../../../src","sources":["utils/useRenderedChildren.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAGA,CAAC;EAClCC,OAAO;EACPC,eAAe,GAAG,KAAK;EACvBC,aAAa;EACbC;AACwB,CAAC,KAAK;EAC9B,MAAMC,eAAe,GAAG,IAAAC,cAAO,EAC7B,MACEH,aAAa,GACRI,KAA8B,IAC7BJ,aAAa,CAAC;IACZ,GAAGI,KAAK;IACR,IAAIL,eAAe,GAAG;MAAEM,OAAO,EAAE;IAAK,CAAC,GAAG,IAAI,CAAC;IAC/CP;EACF,CAAC,CAAC,GACJQ,SAAS,EACf,CAACN,aAAa,EAAEF,OAAO,EAAEC,eAAe,CAC1C,CAAC;EAED,MAAMQ,iBAAiB,GAAG,IAAAJ,cAAO,EAC/B,MAAMF,eAAe,GAAG;IAAEH;EAAQ,CAAC,CAAC,EACpC,CAACG,eAAe,EAAEH,OAAO,CAC3B,CAAC;EAED,OAAOI,eAAe,IAAIK,iBAAiB;AAC7C,CAAC;AAACC,OAAA,CAAAX,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useWrappedOrderProps = void 0;
7
+ var _react = require("react");
8
+ var _wrapOrderPrefix = require("./wrapOrderPrefix");
9
+ const useWrappedOrderProps = ({
10
+ orderPrefix = '',
11
+ orderId,
12
+ orderForward,
13
+ orderBackward,
14
+ orderFirst,
15
+ orderLast,
16
+ orderLeft,
17
+ orderRight,
18
+ orderUp,
19
+ orderDown
20
+ }) => {
21
+ const wrapPrefix = (0, _react.useMemo)(() => (0, _wrapOrderPrefix.wrapOrderPrefix)(orderPrefix), [orderPrefix]);
22
+ return (0, _react.useMemo)(() => ({
23
+ orderId: wrapPrefix(orderId),
24
+ orderForward: wrapPrefix(orderForward),
25
+ orderBackward: wrapPrefix(orderBackward),
26
+ orderLeft: wrapPrefix(orderLeft),
27
+ orderRight: wrapPrefix(orderRight),
28
+ orderUp: wrapPrefix(orderUp),
29
+ orderDown: wrapPrefix(orderDown),
30
+ orderFirst: wrapPrefix(orderFirst === null ? undefined : orderFirst ?? orderForward),
31
+ orderLast: wrapPrefix(orderLast === null ? undefined : orderLast ?? orderBackward)
32
+ }), [wrapPrefix, orderId, orderForward, orderBackward, orderFirst, orderLast, orderLeft, orderRight, orderUp, orderDown]);
33
+ };
34
+ exports.useWrappedOrderProps = useWrappedOrderProps;
35
+ //# sourceMappingURL=useWrappedOrderProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_wrapOrderPrefix","useWrappedOrderProps","orderPrefix","orderId","orderForward","orderBackward","orderFirst","orderLast","orderLeft","orderRight","orderUp","orderDown","wrapPrefix","useMemo","wrapOrderPrefix","undefined","exports"],"sourceRoot":"../../../src","sources":["utils/useWrappedOrderProps.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAGA,CAAC;EACnCC,WAAW,GAAG,EAAE;EAChBC,OAAO;EACPC,YAAY;EACZC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,UAAU;EACVC,OAAO;EACPC;AACe,CAAC,KAAK;EACrB,MAAMC,UAAU,GAAG,IAAAC,cAAO,EAAC,MAAM,IAAAC,gCAAe,EAACZ,WAAW,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAE7E,OAAO,IAAAW,cAAO,EACZ,OAAO;IACLV,OAAO,EAAES,UAAU,CAACT,OAAO,CAAC;IAC5BC,YAAY,EAAEQ,UAAU,CAACR,YAAY,CAAC;IACtCC,aAAa,EAAEO,UAAU,CAACP,aAAa,CAAC;IACxCG,SAAS,EAAEI,UAAU,CAACJ,SAAS,CAAC;IAChCC,UAAU,EAAEG,UAAU,CAACH,UAAU,CAAC;IAClCC,OAAO,EAAEE,UAAU,CAACF,OAAO,CAAC;IAC5BC,SAAS,EAAEC,UAAU,CAACD,SAAS,CAAC;IAChCL,UAAU,EAAEM,UAAU,CACpBN,UAAU,KAAK,IAAI,GAAGS,SAAS,GAAGT,UAAU,IAAIF,YAClD,CAAC;IACDG,SAAS,EAAEK,UAAU,CACnBL,SAAS,KAAK,IAAI,GAAGQ,SAAS,GAAGR,SAAS,IAAIF,aAChD;EACF,CAAC,CAAC,EACF,CACEO,UAAU,EACVT,OAAO,EACPC,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,SAAS,CAEb,CAAC;AACH,CAAC;AAACK,OAAA,CAAAf,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -7,49 +7,47 @@ exports.withKeyboardFocus = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _components = require("../components");
10
- var _useFocusStyle = require("./useFocusStyle");
11
- var _RenderPropComponent = require("../components/RenderPropComponent/RenderPropComponent");
12
- var _useKeyboardPress = require("./useKeyboardPress/useKeyboardPress");
10
+ var _useKeyboardFocusContainer = require("./useKeyboardFocusContainer");
11
+ var _useRenderedChildren = require("./useRenderedChildren");
13
12
  var _IsViewFocusedContext = require("../context/IsViewFocusedContext");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
15
  const withKeyboardFocus = Component => {
17
16
  const WithKeyboardFocus = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwardRef((allProps, ref) => {
18
17
  const {
19
- tintType = 'default',
20
- autoFocus,
18
+ // Style
21
19
  focusStyle,
22
20
  style,
23
21
  containerStyle,
24
- onFocusChange,
22
+ containerFocusStyle,
23
+ withPressedStyle = false,
24
+ // Press handlers
25
25
  onPress,
26
26
  onLongPress,
27
27
  onKeyUpPress,
28
28
  onKeyDownPress,
29
29
  onPressIn,
30
30
  onPressOut,
31
- group = false,
31
+ triggerCodes,
32
+ // Focus config
33
+ autoFocus,
34
+ focusableWrapper = true,
32
35
  haloEffect = true,
33
- canBeFocused = true,
34
36
  focusable = true,
35
37
  tintColor,
36
38
  onFocus,
37
39
  onBlur,
38
- containerFocusStyle,
39
- FocusHoverComponent,
40
- viewRef,
41
- componentRef,
40
+ onFocusChange,
41
+ groupIdentifier,
42
42
  haloCornerRadius,
43
43
  haloExpendX,
44
44
  haloExpendY,
45
- groupIdentifier,
46
- withPressedStyle = false,
47
- triggerCodes,
48
- exposeMethods,
49
- enableA11yFocus,
50
45
  screenAutoA11yFocus,
51
- screenAutoA11yFocusDelay = 300,
52
- // ToDo align with BaseKeyboardView
46
+ screenAutoA11yFocusDelay,
47
+ lockFocus,
48
+ defaultFocusHighlightEnabled,
49
+ androidKeyboardPressState,
50
+ // Order
53
51
  orderIndex,
54
52
  orderGroup,
55
53
  orderId,
@@ -61,36 +59,37 @@ const withKeyboardFocus = Component => {
61
59
  orderBackward,
62
60
  orderFirst,
63
61
  orderLast,
64
- lockFocus,
62
+ // Refs & render
63
+ componentRef,
65
64
  onComponentFocus,
66
65
  onComponentBlur,
67
66
  renderContent,
68
67
  renderFocusable,
69
- defaultFocusHighlightEnabled,
68
+ roundedHaloFix,
69
+ tintType,
70
+ // Deprecated no-ops: discard so they never reach the wrapped component.
71
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
72
+ enableA11yFocus: _enableA11yFocus,
73
+ children: userChildren,
70
74
  ...props
71
75
  } = allProps;
72
76
  const {
73
77
  focused,
78
+ keyboardPressed,
74
79
  containerFocusedStyle,
75
80
  componentStyleViewStyle,
76
81
  onFocusChangeHandler,
77
- hoverColor
78
- } = (0, _useFocusStyle.useFocusStyle)({
82
+ onKeyUpPressHandler,
83
+ onKeyDownPressHandler,
84
+ onPressHandler,
85
+ onContextMenuHandler,
86
+ enableContextMenu
87
+ } = (0, _useKeyboardFocusContainer.useKeyboardFocusContainer)({
79
88
  onFocusChange,
80
- tintColor,
81
89
  focusStyle,
82
90
  containerFocusStyle,
83
- tintType,
84
91
  style,
85
- withPressedStyle,
86
- Component
87
- });
88
- const withHaloEffect = tintType === 'default' && haloEffect;
89
- const {
90
- onKeyUpPressHandler,
91
- onKeyDownPressHandler,
92
- onPressHandler
93
- } = (0, _useKeyboardPress.useKeyboardPress)({
92
+ pressedStyleSignature: withPressedStyle || Component === _reactNative.Pressable,
94
93
  onKeyUpPress,
95
94
  onKeyDownPress,
96
95
  onPress: onPress,
@@ -98,71 +97,68 @@ const withKeyboardFocus = Component => {
98
97
  onPressIn: onPressIn,
99
98
  onPressOut: onPressOut,
100
99
  triggerCodes,
101
- disabled: props?.disabled
100
+ androidKeyboardPressState
102
101
  });
103
- const contentChildrenProp = (0, _react.useMemo)(() => renderContent ? state => renderContent({
104
- ...state,
105
- focused
106
- }) : undefined, [renderContent, focused]);
107
- const focusableChildrenProp = (0, _react.useMemo)(() => renderFocusable ? renderFocusable({
108
- focused
109
- }) : undefined, [renderFocusable, focused]);
110
- const hoverContent = (0, _react.useMemo)(() => {
111
- if (FocusHoverComponent) return FocusHoverComponent;
112
- if (tintType === 'hover') {
113
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
114
- style: [hoverColor, styles.absolute, styles.opacity]
102
+ const renderedChildren = (0, _useRenderedChildren.useRenderedChildren)({
103
+ focused,
104
+ keyboardPressed,
105
+ renderContent: renderContent,
106
+ renderFocusable
107
+ });
108
+ // `renderContent`/`renderFocusable` are handled above; for a plain
109
+ // children render prop, fold the keyboard press into its `pressed` too so
110
+ // it stays consistent. A no-op unless `keyboardPressed` is active.
111
+ const childContent = (0, _react.useMemo)(() => {
112
+ if (renderedChildren !== undefined) return renderedChildren;
113
+ if (keyboardPressed && typeof userChildren === 'function') {
114
+ const childrenFn = userChildren;
115
+ return state => childrenFn({
116
+ ...state,
117
+ pressed: true
115
118
  });
116
119
  }
117
- return undefined;
118
- }, [FocusHoverComponent, hoverColor, tintType]);
119
- const focusOrderProps = {
120
- orderIndex,
121
- orderGroup,
122
- orderId,
123
- orderLeft,
124
- orderRight,
125
- orderUp,
126
- orderDown,
127
- orderForward,
128
- orderBackward,
129
- orderFirst,
130
- orderLast
131
- };
132
- const onContextMenuHandler = (0, _react.useCallback)(() => {
133
- onLongPress?.();
134
- }, [onLongPress]);
120
+ return userChildren;
121
+ }, [renderedChildren, userChildren, keyboardPressed]);
122
+ const containerStyleArr = (0, _react.useMemo)(() => [containerStyle, containerFocusedStyle], [containerStyle, containerFocusedStyle]);
135
123
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IsViewFocusedContext.IsViewFocusedContext.Provider, {
136
124
  value: focused,
137
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.BaseKeyboardView, {
138
- style: [containerStyle, containerFocusedStyle],
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseKeyboardView, {
126
+ style: containerStyleArr,
139
127
  defaultFocusHighlightEnabled: defaultFocusHighlightEnabled,
140
128
  ref: ref,
141
- viewRef: viewRef,
142
129
  onKeyUpPress: onKeyUpPressHandler,
143
130
  onKeyDownPress: onKeyDownPressHandler,
144
- onFocus: onFocus,
145
- onBlur: onBlur,
131
+ onFocus: onFocus ?? undefined,
132
+ onBlur: onBlur ?? undefined,
146
133
  onFocusChange: onFocusChangeHandler,
147
134
  onContextMenuPress: onContextMenuHandler,
148
- enableContextMenu: Boolean(onLongPress),
149
- haloEffect: withHaloEffect,
135
+ enableContextMenu: enableContextMenu,
136
+ haloEffect: haloEffect,
137
+ tintType: tintType,
150
138
  haloCornerRadius: haloCornerRadius,
151
139
  haloExpendX: haloExpendX,
152
140
  haloExpendY: haloExpendY,
153
141
  autoFocus: autoFocus,
154
- canBeFocused: canBeFocused,
155
142
  focusable: focusable,
156
143
  tintColor: tintColor,
157
- group: group,
144
+ focusableWrapper: focusableWrapper,
158
145
  groupIdentifier: groupIdentifier,
159
- exposeMethods: exposeMethods,
160
- enableA11yFocus: enableA11yFocus,
161
146
  screenAutoA11yFocus: screenAutoA11yFocus,
162
147
  screenAutoA11yFocusDelay: screenAutoA11yFocusDelay,
163
148
  lockFocus: lockFocus,
164
- ...focusOrderProps,
165
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
149
+ roundedHaloFix: roundedHaloFix,
150
+ orderIndex: orderIndex,
151
+ orderGroup: orderGroup,
152
+ orderId: orderId,
153
+ orderLeft: orderLeft,
154
+ orderRight: orderRight,
155
+ orderUp: orderUp,
156
+ orderDown: orderDown,
157
+ orderForward: orderForward,
158
+ orderBackward: orderBackward,
159
+ orderFirst: orderFirst,
160
+ orderLast: orderLast,
161
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
166
162
  ref: componentRef,
167
163
  style: componentStyleViewStyle,
168
164
  onPress: onPressHandler,
@@ -170,14 +166,15 @@ const withKeyboardFocus = Component => {
170
166
  onPressIn: onPressIn,
171
167
  onPressOut: onPressOut,
172
168
  onFocus: onComponentFocus,
173
- onBlur: onComponentBlur,
169
+ onBlur: onComponentBlur
170
+ // forwarded to the child so Pressable-like components disable press handling when false
171
+ ,
172
+ focusable: focusable,
174
173
  ...props,
175
- ...((contentChildrenProp || focusableChildrenProp) && {
176
- children: contentChildrenProp ?? focusableChildrenProp
174
+ ...(childContent !== undefined && {
175
+ children: childContent
177
176
  })
178
- }), focused && hoverContent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderPropComponent.RenderPropComponent, {
179
- render: hoverContent
180
- })]
177
+ })
181
178
  })
182
179
  });
183
180
  }));
@@ -186,16 +183,4 @@ const withKeyboardFocus = Component => {
186
183
  return WithKeyboardFocus;
187
184
  };
188
185
  exports.withKeyboardFocus = withKeyboardFocus;
189
- const styles = _reactNative.StyleSheet.create({
190
- absolute: {
191
- position: 'absolute',
192
- top: 0,
193
- left: 0,
194
- right: 0,
195
- bottom: 0
196
- },
197
- opacity: {
198
- opacity: 0.3
199
- }
200
- });
201
186
  //# sourceMappingURL=withKeyboardFocus.js.map