react-native-external-keyboard 0.9.1 → 0.11.1

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 (369) hide show
  1. package/README.md +95 -600
  2. package/android/build.gradle +0 -18
  3. package/android/src/main/java/com/externalkeyboard/events/EventHelper.java +10 -13
  4. package/android/src/main/java/com/externalkeyboard/helper/FocusHelper.java +1 -2
  5. package/android/src/main/java/com/externalkeyboard/services/FocusMemoryService.java +64 -0
  6. package/android/src/main/java/com/externalkeyboard/services/KeyboardFocusService.java +41 -0
  7. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardView.java +2 -8
  8. package/android/src/main/java/com/externalkeyboard/views/ExternalKeyboardView/ExternalKeyboardViewManager.java +20 -13
  9. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapper.java +99 -21
  10. package/android/src/main/java/com/externalkeyboard/views/TextInputFocusWrapper/TextInputFocusWrapperManager.java +11 -0
  11. package/android/src/main/java/com/externalkeyboard/views/base/FocusHighlightBase.java +11 -5
  12. package/android/src/main/java/com/externalkeyboard/views/base/FocusableBase.java +54 -0
  13. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusChangeBase.java +2 -3
  14. package/android/src/main/java/com/externalkeyboard/views/base/keyboard/ViewFocusRequestBase.java +10 -61
  15. package/android/src/newarch/ExternalKeyboardLockViewManagerInterface.java +11 -0
  16. package/android/src/newarch/ExternalKeyboardLockViewManagerSpec.java +0 -1
  17. package/android/src/newarch/ExternalKeyboardViewManagerInterface.java +42 -0
  18. package/android/src/newarch/ExternalKeyboardViewManagerSpec.java +0 -1
  19. package/android/src/newarch/KeyboardFocusGroupManagerInterface.java +12 -0
  20. package/android/src/newarch/KeyboardFocusGroupManagerSpec.java +0 -1
  21. package/android/src/newarch/TextInputFocusWrapperManagerInterface.java +34 -0
  22. package/android/src/newarch/TextInputFocusWrapperManagerSpec.java +0 -7
  23. package/android/src/newarch/helper/ReactNativeEventDispatcher.java +28 -0
  24. package/android/src/oldarch/ExternalKeyboardViewManagerSpec.java +6 -4
  25. package/android/src/oldarch/TextInputFocusWrapperManagerSpec.java +4 -0
  26. package/android/src/oldarch/helper/ReactNativeEventDispatcher.java +15 -0
  27. package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusDelegate.mm +1 -1
  28. package/ios/Delegates/RNCEKVFocusDelegate/RNCEKVFocusProtocol.h +1 -1
  29. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.h +2 -1
  30. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloDelegate.mm +41 -5
  31. package/ios/Delegates/RNCEKVHaloDelegate/RNCEKVHaloProtocol.h +1 -0
  32. package/ios/Extensions/RCTCustomScrollView+RNCEKVExternalKeyboard.mm +5 -6
  33. package/ios/Extensions/RCTEnhancedScrollView+RNCEKVExternalKeyboard.mm +8 -9
  34. package/ios/Extensions/RCTTextInputComponentView+RNCEKVExternalKeyboard.mm +1 -1
  35. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.h +0 -1
  36. package/ios/Extensions/RCTViewComponentView+RNCEKVExternalKeyboard.mm +16 -4
  37. package/ios/Extensions/UIViewController+RNCEKVExternalKeyboard.mm +7 -10
  38. package/ios/Helpers/RNCEKVNativeProps/RNCEKVNativeProps.h +4 -4
  39. package/ios/Helpers/RNCEKVSwizzleInstanceMethod/RNCEKVSwizzleInstanceMethod.h +19 -0
  40. package/ios/Protocols/RNCEKVCustomFocusEffectProtocol.h +1 -1
  41. package/ios/Services/RNCEKVFocusMemoryService.h +39 -0
  42. package/ios/Services/RNCEKVFocusMemoryService.mm +42 -0
  43. package/ios/Services/RNCEKVKeyboardFocusService.h +28 -0
  44. package/ios/Services/RNCEKVKeyboardFocusService.mm +54 -0
  45. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.h +2 -0
  46. package/ios/Views/Base/FocusChange/RNCEKVViewFocusChangeBase.mm +12 -10
  47. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.h +1 -1
  48. package/ios/Views/Base/FocusRequest/RNCEKVViewFocusRequestBase.mm +6 -17
  49. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.h +1 -0
  50. package/ios/Views/Base/KeyboardHallo/RNCEKVExternalKeyboardHalloBase.mm +146 -6
  51. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.h +2 -0
  52. package/ios/Views/Base/ViewGroup/RNCEKVViewGroupBase.mm +4 -0
  53. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.h +1 -1
  54. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardView.mm +8 -4
  55. package/ios/Views/RNCEKVExternalKeyboardView/RNCEKVExternalKeyboardViewManager.mm +22 -11
  56. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapper.mm +17 -0
  57. package/ios/Views/RNCEKVTextInputFocusWrapper/RNCEKVTextInputFocusWrapperManager.mm +12 -0
  58. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js +67 -65
  59. package/lib/commonjs/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  60. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js +49 -97
  61. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  62. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
  63. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
  64. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
  65. package/lib/commonjs/components/{KeyboardExtendedInput/KeyboardExtendedInput.types.js → KeyboardFocusGroup/KeyboardFocusGroup.types.js} +1 -1
  66. package/lib/commonjs/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
  67. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
  68. package/lib/commonjs/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
  69. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
  70. package/lib/commonjs/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
  71. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
  72. package/lib/commonjs/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  73. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js +14 -51
  74. package/lib/commonjs/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  75. package/lib/commonjs/components/index.js +47 -0
  76. package/lib/commonjs/components/index.js.map +1 -1
  77. package/lib/commonjs/index.js +37 -19
  78. package/lib/commonjs/index.js.map +1 -1
  79. package/lib/commonjs/nativeSpec/ExternalKeyboardViewNativeComponent.ts +6 -4
  80. package/lib/commonjs/nativeSpec/TextInputFocusWrapperNativeComponent.ts +2 -0
  81. package/lib/commonjs/types/KeyboardFocusLock.types.js +13 -0
  82. package/lib/commonjs/types/KeyboardFocusLock.types.js.map +1 -1
  83. package/lib/commonjs/types/baseKeyboardView.types.js +6 -0
  84. package/lib/commonjs/types/baseKeyboardView.types.js.map +1 -0
  85. package/lib/commonjs/types/{FocusStyle.js → focus.types.js} +1 -1
  86. package/lib/commonjs/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
  87. package/lib/commonjs/types/focusOrder.types.js +33 -0
  88. package/lib/commonjs/types/focusOrder.types.js.map +1 -0
  89. package/lib/commonjs/types/{WithKeyboardFocus.js → focusStyle.types.js} +1 -1
  90. package/lib/commonjs/types/{WithKeyboardFocus.js.map → focusStyle.types.js.map} +1 -1
  91. package/lib/commonjs/types/index.js +18 -0
  92. package/lib/commonjs/types/index.js.map +1 -1
  93. package/lib/commonjs/types/keyPress.types.js +6 -0
  94. package/lib/{module/types/WithKeyboardFocus.js.map → commonjs/types/keyPress.types.js.map} +1 -1
  95. package/lib/commonjs/types/keyboardInput.types.js +6 -0
  96. package/lib/commonjs/types/keyboardInput.types.js.map +1 -0
  97. package/lib/commonjs/types/withKeyboardFocus.types.js +6 -0
  98. package/lib/commonjs/types/withKeyboardFocus.types.js.map +1 -0
  99. package/lib/commonjs/utils/mapLockFocus.js +37 -0
  100. package/lib/commonjs/utils/mapLockFocus.js.map +1 -0
  101. package/lib/commonjs/utils/useFocusStyle.js +4 -21
  102. package/lib/commonjs/utils/useFocusStyle.js.map +1 -1
  103. package/lib/commonjs/utils/useKeyboardFocusContainer.js +79 -0
  104. package/lib/commonjs/utils/useKeyboardFocusContainer.js.map +1 -0
  105. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
  106. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
  107. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
  108. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
  109. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js +9 -7
  110. package/lib/commonjs/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
  111. package/lib/commonjs/utils/useKeyboardPressState.js +65 -0
  112. package/lib/commonjs/utils/useKeyboardPressState.js.map +1 -0
  113. package/lib/commonjs/utils/useOnFocusChange.js +1 -1
  114. package/lib/commonjs/utils/useOnFocusChange.js.map +1 -1
  115. package/lib/commonjs/utils/useOrderValidation.js +35 -0
  116. package/lib/commonjs/utils/useOrderValidation.js.map +1 -0
  117. package/lib/commonjs/utils/useRenderedChildren.js +34 -0
  118. package/lib/commonjs/utils/useRenderedChildren.js.map +1 -0
  119. package/lib/commonjs/utils/useWrappedOrderProps.js +35 -0
  120. package/lib/commonjs/utils/useWrappedOrderProps.js.map +1 -0
  121. package/lib/commonjs/utils/withKeyboardFocus.js +81 -96
  122. package/lib/commonjs/utils/withKeyboardFocus.js.map +1 -1
  123. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js +57 -55
  124. package/lib/module/components/BaseKeyboardView/BaseKeyboardView.js.map +1 -1
  125. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js +51 -99
  126. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.js.map +1 -1
  127. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.android.js.map +1 -1
  128. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.js.map +1 -1
  129. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.js.map +1 -1
  130. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js +4 -0
  131. package/lib/module/components/KeyboardFocusGroup/KeyboardFocusGroup.types.js.map +1 -0
  132. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js +2 -1
  133. package/lib/module/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.js.map +1 -1
  134. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js +2 -1
  135. package/lib/module/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.js.map +1 -1
  136. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js +2 -1
  137. package/lib/module/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.js.map +1 -1
  138. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js +16 -53
  139. package/lib/module/components/KeyboardFocusView/KeyboardFocusView.js.map +1 -1
  140. package/lib/module/components/index.js +5 -0
  141. package/lib/module/components/index.js.map +1 -1
  142. package/lib/module/index.js +20 -7
  143. package/lib/module/index.js.map +1 -1
  144. package/lib/module/nativeSpec/ExternalKeyboardViewNativeComponent.ts +6 -4
  145. package/lib/module/nativeSpec/TextInputFocusWrapperNativeComponent.ts +2 -0
  146. package/lib/module/types/KeyboardFocusLock.types.js +12 -1
  147. package/lib/module/types/KeyboardFocusLock.types.js.map +1 -1
  148. package/lib/module/types/baseKeyboardView.types.js +4 -0
  149. package/lib/module/types/baseKeyboardView.types.js.map +1 -0
  150. package/lib/module/types/focus.types.js +4 -0
  151. package/lib/module/types/{FocusStyle.js.map → focus.types.js.map} +1 -1
  152. package/lib/module/types/focusOrder.types.js +31 -0
  153. package/lib/module/types/focusOrder.types.js.map +1 -0
  154. package/lib/module/types/focusStyle.types.js +4 -0
  155. package/lib/module/types/focusStyle.types.js.map +1 -0
  156. package/lib/module/types/index.js +3 -0
  157. package/lib/module/types/index.js.map +1 -1
  158. package/lib/module/types/keyPress.types.js +4 -0
  159. package/lib/module/types/keyPress.types.js.map +1 -0
  160. package/lib/module/types/keyboardInput.types.js +4 -0
  161. package/lib/module/types/keyboardInput.types.js.map +1 -0
  162. package/lib/module/types/withKeyboardFocus.types.js +4 -0
  163. package/lib/module/types/withKeyboardFocus.types.js.map +1 -0
  164. package/lib/module/utils/mapLockFocus.js +32 -0
  165. package/lib/module/utils/mapLockFocus.js.map +1 -0
  166. package/lib/module/utils/useFocusStyle.js +4 -21
  167. package/lib/module/utils/useFocusStyle.js.map +1 -1
  168. package/lib/module/utils/useKeyboardFocusContainer.js +74 -0
  169. package/lib/module/utils/useKeyboardFocusContainer.js.map +1 -0
  170. package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js +4 -7
  171. package/lib/module/utils/useKeyboardPress/useKeyboardPress.android.js.map +1 -1
  172. package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js +3 -6
  173. package/lib/module/utils/useKeyboardPress/useKeyboardPress.ios.js.map +1 -1
  174. package/lib/module/utils/useKeyboardPress/useKeyboardPress.js +9 -7
  175. package/lib/module/utils/useKeyboardPress/useKeyboardPress.js.map +1 -1
  176. package/lib/module/utils/useKeyboardPressState.js +60 -0
  177. package/lib/module/utils/useKeyboardPressState.js.map +1 -0
  178. package/lib/module/utils/useOnFocusChange.js +1 -1
  179. package/lib/module/utils/useOnFocusChange.js.map +1 -1
  180. package/lib/module/utils/useOrderValidation.js +30 -0
  181. package/lib/module/utils/useOrderValidation.js.map +1 -0
  182. package/lib/module/utils/useRenderedChildren.js +29 -0
  183. package/lib/module/utils/useRenderedChildren.js.map +1 -0
  184. package/lib/module/utils/useWrappedOrderProps.js +30 -0
  185. package/lib/module/utils/useWrappedOrderProps.js.map +1 -0
  186. package/lib/module/utils/withKeyboardFocus.js +84 -99
  187. package/lib/module/utils/withKeyboardFocus.js.map +1 -1
  188. package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts +19 -125
  189. package/lib/typescript/src/components/BaseKeyboardView/BaseKeyboardView.d.ts.map +1 -1
  190. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts +13 -204
  191. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.d.ts.map +1 -1
  192. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts +4 -146
  193. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.d.ts.map +1 -1
  194. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts +2 -12
  195. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.d.ts.map +1 -1
  196. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts +4 -146
  197. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.d.ts.map +1 -1
  198. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts +13 -0
  199. package/lib/typescript/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.d.ts.map +1 -0
  200. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts +1 -1
  201. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.d.ts.map +1 -1
  202. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts +1 -1
  203. package/lib/typescript/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.d.ts.map +1 -1
  204. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts +1 -1
  205. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.d.ts.map +1 -1
  206. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts +2 -2
  207. package/lib/typescript/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.d.ts.map +1 -1
  208. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts +1 -1
  209. package/lib/typescript/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.d.ts.map +1 -1
  210. package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts +20 -133
  211. package/lib/typescript/src/components/KeyboardFocusView/KeyboardFocusView.d.ts.map +1 -1
  212. package/lib/typescript/src/components/Touchable/Pressable.d.ts +3 -160
  213. package/lib/typescript/src/components/Touchable/Pressable.d.ts.map +1 -1
  214. package/lib/typescript/src/components/index.d.ts +5 -0
  215. package/lib/typescript/src/components/index.d.ts.map +1 -1
  216. package/lib/typescript/src/context/OrderFocusContext.d.ts +1 -1
  217. package/lib/typescript/src/context/OrderFocusContext.d.ts.map +1 -1
  218. package/lib/typescript/src/index.d.ts +48 -10
  219. package/lib/typescript/src/index.d.ts.map +1 -1
  220. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts +1 -3
  221. package/lib/typescript/src/nativeSpec/ExternalKeyboardLockViewNativeComponent.d.ts.map +1 -1
  222. package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts +5 -6
  223. package/lib/typescript/src/nativeSpec/ExternalKeyboardViewNativeComponent.d.ts.map +1 -1
  224. package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts +1 -3
  225. package/lib/typescript/src/nativeSpec/KeyboardFocusGroupNativeComponent.d.ts.map +1 -1
  226. package/lib/typescript/src/nativeSpec/NativeExternalKeyboardModule.d.ts +1 -1
  227. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts +3 -3
  228. package/lib/typescript/src/nativeSpec/TextInputFocusWrapperNativeComponent.d.ts.map +1 -1
  229. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts +15 -1
  230. package/lib/typescript/src/types/KeyboardFocusLock.types.d.ts.map +1 -1
  231. package/lib/typescript/src/types/KeyboardFocusView.types.d.ts +16 -14
  232. package/lib/typescript/src/types/KeyboardFocusView.types.d.ts.map +1 -1
  233. package/lib/typescript/src/types/baseKeyboardView.types.d.ts +119 -0
  234. package/lib/typescript/src/types/baseKeyboardView.types.d.ts.map +1 -0
  235. package/lib/typescript/src/types/focus.types.d.ts +44 -0
  236. package/lib/typescript/src/types/focus.types.d.ts.map +1 -0
  237. package/lib/typescript/src/types/focusOrder.types.d.ts +57 -0
  238. package/lib/typescript/src/types/focusOrder.types.d.ts.map +1 -0
  239. package/lib/typescript/src/types/focusStyle.types.d.ts +11 -0
  240. package/lib/typescript/src/types/focusStyle.types.d.ts.map +1 -0
  241. package/lib/typescript/src/types/index.d.ts +11 -2
  242. package/lib/typescript/src/types/index.d.ts.map +1 -1
  243. package/lib/typescript/src/types/keyPress.types.d.ts +7 -0
  244. package/lib/typescript/src/types/keyPress.types.d.ts.map +1 -0
  245. package/lib/typescript/src/types/keyboardInput.types.d.ts +53 -0
  246. package/lib/typescript/src/types/keyboardInput.types.d.ts.map +1 -0
  247. package/lib/typescript/src/types/withKeyboardFocus.types.d.ts +109 -0
  248. package/lib/typescript/src/types/withKeyboardFocus.types.d.ts.map +1 -0
  249. package/lib/typescript/src/utils/mapLockFocus.d.ts +3 -0
  250. package/lib/typescript/src/utils/mapLockFocus.d.ts.map +1 -0
  251. package/lib/typescript/src/utils/useFocusStyle.d.ts +7 -1017
  252. package/lib/typescript/src/utils/useFocusStyle.d.ts.map +1 -1
  253. package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts +34 -0
  254. package/lib/typescript/src/utils/useKeyboardFocusContainer.d.ts.map +1 -0
  255. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts +2 -2
  256. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.android.d.ts.map +1 -1
  257. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts +4 -3
  258. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.d.ts.map +1 -1
  259. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts +3 -3
  260. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.ios.d.ts.map +1 -1
  261. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts +1 -2
  262. package/lib/typescript/src/utils/useKeyboardPress/useKeyboardPress.types.d.ts.map +1 -1
  263. package/lib/typescript/src/utils/useKeyboardPressState.d.ts +29 -0
  264. package/lib/typescript/src/utils/useKeyboardPressState.d.ts.map +1 -0
  265. package/lib/typescript/src/utils/useOnFocusChange.d.ts +3 -3
  266. package/lib/typescript/src/utils/useOnFocusChange.d.ts.map +1 -1
  267. package/lib/typescript/src/utils/useOrderValidation.d.ts +8 -0
  268. package/lib/typescript/src/utils/useOrderValidation.d.ts.map +1 -0
  269. package/lib/typescript/src/utils/useRenderedChildren.d.ts +18 -0
  270. package/lib/typescript/src/utils/useRenderedChildren.d.ts.map +1 -0
  271. package/lib/typescript/src/utils/useWrappedOrderProps.d.ts +13 -0
  272. package/lib/typescript/src/utils/useWrappedOrderProps.d.ts.map +1 -0
  273. package/lib/typescript/src/utils/withKeyboardFocus.d.ts +3 -8
  274. package/lib/typescript/src/utils/withKeyboardFocus.d.ts.map +1 -1
  275. package/package.json +10 -5
  276. package/src/components/BaseKeyboardView/BaseKeyboardView.tsx +74 -94
  277. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.tsx +49 -149
  278. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.android.tsx +23 -32
  279. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.ios.tsx +32 -41
  280. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.tsx +3 -14
  281. package/src/components/KeyboardFocusGroup/KeyboardFocusGroup.types.ts +15 -0
  282. package/src/components/KeyboardFocusLock/FocusFrame/FocusFrame.android.tsx +2 -2
  283. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.android.tsx +2 -2
  284. package/src/components/KeyboardFocusLock/FocusTrap/FocusTrap.tsx +1 -1
  285. package/src/components/KeyboardFocusLock/KeyboardFocusLockBase/KeyboardFocusLockBase.tsx +2 -2
  286. package/src/components/KeyboardFocusView/KeyboardFocusView.tsx +29 -68
  287. package/src/components/Touchable/Pressable.tsx +2 -2
  288. package/src/components/index.ts +12 -0
  289. package/src/index.tsx +44 -32
  290. package/src/nativeSpec/ExternalKeyboardViewNativeComponent.ts +6 -4
  291. package/src/nativeSpec/TextInputFocusWrapperNativeComponent.ts +2 -0
  292. package/src/types/KeyboardFocusLock.types.ts +16 -1
  293. package/src/types/KeyboardFocusView.types.ts +17 -18
  294. package/src/types/baseKeyboardView.types.ts +122 -0
  295. package/src/types/focus.types.ts +49 -0
  296. package/src/types/focusOrder.types.ts +59 -0
  297. package/src/types/{FocusStyle.ts → focusStyle.types.ts} +5 -0
  298. package/src/types/index.ts +32 -2
  299. package/src/types/keyPress.types.ts +8 -0
  300. package/src/types/keyboardInput.types.ts +81 -0
  301. package/src/types/withKeyboardFocus.types.ts +178 -0
  302. package/src/utils/mapLockFocus.ts +31 -0
  303. package/src/utils/useFocusStyle.tsx +13 -41
  304. package/src/utils/useKeyboardFocusContainer.ts +102 -0
  305. package/src/utils/useKeyboardPress/useKeyboardPress.android.ts +4 -7
  306. package/src/utils/useKeyboardPress/useKeyboardPress.ios.ts +3 -6
  307. package/src/utils/useKeyboardPress/useKeyboardPress.ts +9 -7
  308. package/src/utils/useKeyboardPress/useKeyboardPress.types.ts +1 -2
  309. package/src/utils/useKeyboardPressState.ts +81 -0
  310. package/src/utils/useOnFocusChange.ts +4 -7
  311. package/src/utils/useOrderValidation.ts +74 -0
  312. package/src/utils/useRenderedChildren.ts +42 -0
  313. package/src/utils/useWrappedOrderProps.ts +48 -0
  314. package/src/utils/withKeyboardFocus.tsx +105 -125
  315. package/lib/commonjs/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
  316. package/lib/commonjs/components/KeyboardFocusView/hooks/index.js +0 -13
  317. package/lib/commonjs/components/KeyboardFocusView/hooks/index.js.map +0 -1
  318. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -13
  319. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
  320. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -33
  321. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
  322. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -39
  323. package/lib/commonjs/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
  324. package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js +0 -23
  325. package/lib/commonjs/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
  326. package/lib/commonjs/types/BaseKeyboardView.js +0 -18
  327. package/lib/commonjs/types/BaseKeyboardView.js.map +0 -1
  328. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js +0 -4
  329. package/lib/module/components/KeyboardExtendedInput/KeyboardExtendedInput.types.js.map +0 -1
  330. package/lib/module/components/KeyboardFocusView/hooks/index.js +0 -4
  331. package/lib/module/components/KeyboardFocusView/hooks/index.js.map +0 -1
  332. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js +0 -4
  333. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/index.js.map +0 -1
  334. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js +0 -28
  335. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.js.map +0 -1
  336. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js +0 -34
  337. package/lib/module/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.js.map +0 -1
  338. package/lib/module/components/RenderPropComponent/RenderPropComponent.js +0 -17
  339. package/lib/module/components/RenderPropComponent/RenderPropComponent.js.map +0 -1
  340. package/lib/module/types/BaseKeyboardView.js +0 -14
  341. package/lib/module/types/BaseKeyboardView.js.map +0 -1
  342. package/lib/module/types/FocusStyle.js +0 -4
  343. package/lib/module/types/WithKeyboardFocus.js +0 -4
  344. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts +0 -45
  345. package/lib/typescript/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.d.ts.map +0 -1
  346. package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts +0 -2
  347. package/lib/typescript/src/components/KeyboardFocusView/hooks/index.d.ts.map +0 -1
  348. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts +0 -2
  349. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/index.d.ts.map +0 -1
  350. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts +0 -175
  351. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.d.ts.map +0 -1
  352. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts +0 -181
  353. package/lib/typescript/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.d.ts.map +0 -1
  354. package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts +0 -6
  355. package/lib/typescript/src/components/RenderPropComponent/RenderPropComponent.d.ts.map +0 -1
  356. package/lib/typescript/src/types/BaseKeyboardView.d.ts +0 -70
  357. package/lib/typescript/src/types/BaseKeyboardView.d.ts.map +0 -1
  358. package/lib/typescript/src/types/FocusStyle.d.ts +0 -6
  359. package/lib/typescript/src/types/FocusStyle.d.ts.map +0 -1
  360. package/lib/typescript/src/types/WithKeyboardFocus.d.ts +0 -47
  361. package/lib/typescript/src/types/WithKeyboardFocus.d.ts.map +0 -1
  362. package/src/components/KeyboardExtendedInput/KeyboardExtendedInput.types.ts +0 -73
  363. package/src/components/KeyboardFocusView/hooks/index.ts +0 -1
  364. package/src/components/KeyboardFocusView/hooks/useFocusStyle/index.ts +0 -1
  365. package/src/components/KeyboardFocusView/hooks/useFocusStyle/useFocusStyle.ts +0 -34
  366. package/src/components/KeyboardFocusView/hooks/useFocusStyle/useTintStyle.ts +0 -41
  367. package/src/components/RenderPropComponent/RenderPropComponent.tsx +0 -18
  368. package/src/types/BaseKeyboardView.ts +0 -74
  369. package/src/types/WithKeyboardFocus.ts +0 -115
@@ -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
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_useFocusStyle","_RenderPropComponent","_useKeyboardPress","_IsViewFocusedContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","withKeyboardFocus","Component","WithKeyboardFocus","React","memo","forwardRef","allProps","ref","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","triggerCodes","exposeMethods","enableA11yFocus","screenAutoA11yFocus","screenAutoA11yFocusDelay","orderIndex","orderGroup","orderId","orderLeft","orderRight","orderUp","orderDown","orderForward","orderBackward","orderFirst","orderLast","lockFocus","onComponentFocus","onComponentBlur","renderContent","renderFocusable","defaultFocusHighlightEnabled","props","focused","containerFocusedStyle","componentStyleViewStyle","onFocusChangeHandler","hoverColor","useFocusStyle","withHaloEffect","onKeyUpPressHandler","onKeyDownPressHandler","onPressHandler","useKeyboardPress","disabled","contentChildrenProp","useMemo","state","undefined","focusableChildrenProp","hoverContent","jsx","View","styles","absolute","opacity","focusOrderProps","onContextMenuHandler","useCallback","IsViewFocusedContext","Provider","value","children","jsxs","BaseKeyboardView","onContextMenuPress","enableContextMenu","Boolean","RenderPropComponent","render","wrappedComponentName","displayName","name","exports","StyleSheet","create","position","top","left","right","bottom"],"sourceRoot":"../../../src","sources":["utils/withKeyboardFocus.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AAMA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AAAuE,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP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,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDzB,OAAO,EAAE;IACPA,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_useKeyboardFocusContainer","_useRenderedChildren","_IsViewFocusedContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","withKeyboardFocus","Component","WithKeyboardFocus","React","memo","forwardRef","allProps","ref","focusStyle","style","containerStyle","containerFocusStyle","withPressedStyle","onPress","onLongPress","onKeyUpPress","onKeyDownPress","onPressIn","onPressOut","triggerCodes","autoFocus","focusableWrapper","haloEffect","focusable","tintColor","onFocus","onBlur","onFocusChange","groupIdentifier","haloCornerRadius","haloExpendX","haloExpendY","screenAutoA11yFocus","screenAutoA11yFocusDelay","lockFocus","defaultFocusHighlightEnabled","androidKeyboardPressState","orderIndex","orderGroup","orderId","orderLeft","orderRight","orderUp","orderDown","orderForward","orderBackward","orderFirst","orderLast","componentRef","onComponentFocus","onComponentBlur","renderContent","renderFocusable","roundedHaloFix","tintType","enableA11yFocus","_enableA11yFocus","children","userChildren","props","focused","keyboardPressed","containerFocusedStyle","componentStyleViewStyle","onFocusChangeHandler","onKeyUpPressHandler","onKeyDownPressHandler","onPressHandler","onContextMenuHandler","enableContextMenu","useKeyboardFocusContainer","pressedStyleSignature","RNPressable","renderedChildren","useRenderedChildren","childContent","useMemo","undefined","childrenFn","state","pressed","containerStyleArr","jsx","IsViewFocusedContext","Provider","value","BaseKeyboardView","onContextMenuPress","wrappedComponentName","displayName","name","exports"],"sourceRoot":"../../../src","sources":["utils/withKeyboardFocus.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA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,CAAC,CACH,CAAC;EAED,MAAMa,oBAAoB,GACvBvF,SAAS,EAAUwF,WAAW,IAAKxF,SAAS,CAASyF,IAAI,IAAI,WAAW;EAC3ExF,iBAAiB,CAACuF,WAAW,GAAG,qBAAqBD,oBAAoB,GAAG;EAE5E,OAAOtF,iBAAiB;AAC1B,CAAC;AAACyF,OAAA,CAAA3F,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -4,18 +4,17 @@ import React, { useEffect, useImperativeHandle, useMemo, useRef } from 'react';
4
4
  import { Platform } from 'react-native';
5
5
  import { ExternalKeyboardViewNative } from '../../nativeSpec';
6
6
  import { Commands } from '../../nativeSpec/ExternalKeyboardViewNativeComponent';
7
- import { LockFocusEnum } from '../../types/BaseKeyboardView';
7
+ import { LockFocusEnum } from '../../types';
8
8
  import { KeyPressContext } from '../../context/BubbledKeyPressContext';
9
9
  import { useBubbledInfo } from './BaseKeyboardView.hooks';
10
10
  import { useGroupIdentifierContext } from '../../context/GroupIdentifierContext';
11
11
  import { useOnFocusChange } from '../../utils/useOnFocusChange';
12
12
  import { useOrderFocusGroup } from '../../context/OrderFocusContext';
13
- import { wrapOrderPrefix } from '../../utils/wrapOrderPrefix';
13
+ import { useWrappedOrderProps } from '../../utils/useWrappedOrderProps';
14
14
 
15
15
  // @ts-ignore
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  const isIOS = Platform.OS === 'ios';
18
- const DEFAULT_EXPOSE_METHODS = ['blur', 'measure', 'measureInWindow', 'measureLayout', 'setNativeProps'];
19
18
  var BITS = /*#__PURE__*/function (BITS) {
20
19
  BITS[BITS["BIT_01"] = 1] = "BIT_01";
21
20
  BITS[BITS["BIT_02"] = 2] = "BIT_02";
@@ -23,8 +22,6 @@ var BITS = /*#__PURE__*/function (BITS) {
23
22
  BITS[BITS["BIT_04"] = 8] = "BIT_04";
24
23
  BITS[BITS["BIT_05"] = 16] = "BIT_05";
25
24
  BITS[BITS["BIT_06"] = 32] = "BIT_06";
26
- BITS[BITS["BIT_07"] = 64] = "BIT_07";
27
- BITS[BITS["BIT_08"] = 128] = "BIT_08";
28
25
  BITS[BITS["BIT_09"] = 256] = "BIT_09";
29
26
  BITS[BITS["BIT_10"] = 512] = "BIT_10";
30
27
  return BITS;
@@ -52,18 +49,14 @@ export const BaseKeyboardView = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwa
52
49
  onBubbledContextMenuPress,
53
50
  haloEffect,
54
51
  autoFocus,
55
- canBeFocused = true,
56
52
  focusable = true,
57
- group = false,
53
+ focusableWrapper = false,
58
54
  onFocus,
59
55
  onBlur,
60
- viewRef,
61
56
  groupIdentifier,
62
57
  tintColor,
63
- ignoreGroupFocusHint,
64
- exposeMethods = DEFAULT_EXPOSE_METHODS,
65
- enableA11yFocus = false,
66
- screenAutoA11yFocusDelay = 500,
58
+ // TODO: revisit screenAutoA11yFocusDelay default (currently 300ms)
59
+ screenAutoA11yFocusDelay = 300,
67
60
  lockFocus,
68
61
  orderIndex,
69
62
  orderForward,
@@ -78,11 +71,14 @@ export const BaseKeyboardView = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwa
78
71
  orderId,
79
72
  enableContextMenu,
80
73
  orderPrefix: _orderPrefix,
74
+ tintType,
75
+ // Deprecated no-ops: destructured out so they never reach the native view.
76
+ enableA11yFocus: _enableA11yFocus,
81
77
  defaultFocusHighlightEnabled = true,
78
+ roundedHaloFix = false,
82
79
  ...props
83
80
  }, ref) => {
84
- const localRef = useRef(undefined);
85
- const targetRef = viewRef ?? localRef;
81
+ const targetRef = useRef(null);
86
82
  const lockFocusValue = useMemo(() => mapFocusValues(lockFocus), [lockFocus]);
87
83
  const contextIdentifier = useGroupIdentifierContext();
88
84
  const contextGroupId = useOrderFocusGroup();
@@ -100,44 +96,53 @@ export const BaseKeyboardView = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwa
100
96
  }
101
97
  }, [orderId, orderForward, orderBackward, orderFirst, orderLast, orderLeft, orderRight, orderUp, orderDown, orderPrefix]);
102
98
  useImperativeHandle(ref, () => {
103
- const actions = {};
104
- exposeMethods.forEach(method => {
105
- actions[method] = (...args) => {
106
- const componentActions = targetRef?.current;
107
- return componentActions?.[method]?.(...args);
108
- };
109
- });
110
- actions.focus = () => {
111
- if (targetRef?.current) {
112
- Commands.focus(targetRef.current);
99
+ const nativeCommands = {
100
+ keyboardFocus: () => {
101
+ if (targetRef?.current) {
102
+ Commands.rnekKeyboardFocus(targetRef.current);
103
+ }
104
+ },
105
+ screenReaderFocus: () => {
106
+ if (targetRef?.current) {
107
+ Commands.rnekScreenReaderFocus(targetRef.current);
108
+ }
109
+ },
110
+ focus: () => {
111
+ if (targetRef?.current) {
112
+ Commands.rnekKeyboardFocus(targetRef.current);
113
+ Commands.rnekScreenReaderFocus(targetRef.current);
114
+ }
113
115
  }
114
116
  };
115
- return actions;
116
- }, [exposeMethods, targetRef]);
117
+ return new Proxy({}, {
118
+ get(_target, prop) {
119
+ if (prop in nativeCommands) {
120
+ return nativeCommands[prop];
121
+ }
122
+ return targetRef?.current?.[prop];
123
+ }
124
+ });
125
+ }, [targetRef]);
117
126
  const bubbled = useBubbledInfo(onBubbledContextMenuPress);
118
127
  const onFocusChangeHandler = useOnFocusChange({
119
128
  onFocusChange,
120
129
  onFocus,
121
130
  onBlur
122
131
  });
123
- const hasOnFocusChanged = onFocusChange || onFocus || onBlur;
124
- const ignoreFocusHint = Platform.OS !== 'ios' || !ignoreGroupFocusHint;
125
- const wrapPrefix = useMemo(() => wrapOrderPrefix(orderPrefix), [orderPrefix]);
126
- const wrappedOrderProps = useMemo(() => ({
127
- orderId: wrapPrefix(orderId),
128
- orderForward: wrapPrefix(orderForward),
129
- orderBackward: wrapPrefix(orderBackward),
130
- orderFirst: wrapPrefix(orderFirst === null ? undefined : orderFirst ?? orderForward),
131
- orderLast: wrapPrefix(orderLast === null ? undefined : orderLast ?? orderBackward),
132
- orderLeft: wrapPrefix(orderLeft),
133
- orderRight: wrapPrefix(orderRight),
134
- orderUp: wrapPrefix(orderUp),
135
- orderDown: wrapPrefix(orderDown)
136
- }), [wrapPrefix, orderId, orderForward, orderBackward, orderFirst, orderLast, orderLeft, orderRight, orderUp, orderDown]);
137
- const platformSpecificHalo = useMemo(() => Platform.select({
138
- ios: haloEffect,
139
- android: defaultFocusHighlightEnabled
140
- }) ?? true, [defaultFocusHighlightEnabled, haloEffect]);
132
+ const hasFocusListener = onFocusChange || onFocus || onBlur;
133
+ const wrappedOrderProps = useWrappedOrderProps({
134
+ orderPrefix,
135
+ orderId,
136
+ orderForward,
137
+ orderBackward,
138
+ orderFirst,
139
+ orderLast,
140
+ orderLeft,
141
+ orderRight,
142
+ orderUp,
143
+ orderDown
144
+ });
145
+ const platformSpecificHalo = tintType !== 'none' && (isIOS ? haloEffect ?? true : defaultFocusHighlightEnabled);
141
146
  return /*#__PURE__*/_jsx(KeyPressContext.Provider, {
142
147
  value: bubbled.context,
143
148
  children: /*#__PURE__*/_jsx(ExternalKeyboardViewNative, {
@@ -145,27 +150,24 @@ export const BaseKeyboardView = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwa
145
150
  haloEffect: platformSpecificHalo,
146
151
  ref: targetRef,
147
152
  enableContextMenu: enableContextMenu,
148
- canBeFocused: ignoreFocusHint && focusable && canBeFocused,
153
+ canBeFocused: focusable,
149
154
  autoFocus: autoFocus,
150
- onKeyDownPress: onKeyDownPress //ToDo update types
151
- ,
152
- onKeyUpPress: onKeyUpPress //ToDo update types
153
- ,
155
+ onKeyDownPress: onKeyDownPress,
156
+ onKeyUpPress: onKeyUpPress,
154
157
  onBubbledContextMenuPress: bubbled.contextMenu,
155
158
  groupIdentifier: groupIdentifier ?? contextIdentifier,
156
159
  tintColor: isIOS ? tintColor : undefined,
157
- onFocusChange: hasOnFocusChanged && onFocusChangeHandler //ToDo update types
158
- ,
160
+ onFocusChange: hasFocusListener ? onFocusChangeHandler : undefined,
159
161
  hasKeyDownPress: Boolean(onKeyDownPress),
160
162
  hasKeyUpPress: Boolean(onKeyUpPress),
161
- hasOnFocusChanged: Boolean(hasOnFocusChanged),
162
- group: group,
163
+ hasOnFocusChanged: Boolean(hasFocusListener),
164
+ focusableWrapper: focusableWrapper,
163
165
  orderIndex: orderIndex ?? -1,
164
- enableA11yFocus: enableA11yFocus,
165
166
  screenAutoA11yFocusDelay: screenAutoA11yFocusDelay,
166
167
  lockFocus: lockFocusValue,
167
168
  ...wrappedOrderProps,
168
- orderGroup: groupId
169
+ orderGroup: groupId,
170
+ roundedHaloFix: roundedHaloFix
169
171
  })
170
172
  });
171
173
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useImperativeHandle","useMemo","useRef","Platform","ExternalKeyboardViewNative","Commands","LockFocusEnum","KeyPressContext","useBubbledInfo","useGroupIdentifierContext","useOnFocusChange","useOrderFocusGroup","wrapOrderPrefix","jsx","_jsx","isIOS","OS","DEFAULT_EXPOSE_METHODS","BITS","focusBinaryValue","Up","BIT_01","Down","BIT_02","Left","BIT_03","Right","BIT_04","Forward","BIT_05","Backward","BIT_06","First","BIT_09","Last","BIT_10","mapFocusValues","values","length","reduce","acc","item","BaseKeyboardView","memo","forwardRef","onFocusChange","onKeyUpPress","onKeyDownPress","onBubbledContextMenuPress","haloEffect","autoFocus","canBeFocused","focusable","group","onFocus","onBlur","viewRef","groupIdentifier","tintColor","ignoreGroupFocusHint","exposeMethods","enableA11yFocus","screenAutoA11yFocusDelay","lockFocus","orderIndex","orderForward","orderBackward","orderFirst","orderLast","orderGroup","orderLeft","orderRight","orderUp","orderDown","orderId","enableContextMenu","orderPrefix","_orderPrefix","defaultFocusHighlightEnabled","props","ref","localRef","undefined","targetRef","lockFocusValue","contextIdentifier","contextGroupId","groupId","__DEV__","console","warn","hasOrderLinkProp","actions","forEach","method","args","componentActions","current","focus","bubbled","onFocusChangeHandler","hasOnFocusChanged","ignoreFocusHint","wrapPrefix","wrappedOrderProps","platformSpecificHalo","select","ios","android","Provider","value","context","children","contextMenu","hasKeyDownPress","Boolean","hasKe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aAAa,EACVwD,iBAAiB,IAAID,oBACvB,CAAC;MAAA;MACFc,eAAe,EAAEC,OAAO,CAACpE,cAAc,CAAE;MACzCqE,aAAa,EAAED,OAAO,CAACrE,YAAY,CAAE;MACrCuD,iBAAiB,EAAEc,OAAO,CAACd,iBAAiB,CAAE;MAC9ChD,KAAK,EAAEA,KAAM;MACbW,UAAU,EAAEA,UAAU,IAAI,CAAC,CAAE;MAC7BH,eAAe,EAAEA,eAAgB;MACjCC,wBAAwB,EAAEA,wBAAyB;MACnDC,SAAS,EAAEqB,cAAe;MAAA,GACtBoB,iBAAiB;MACrBnC,UAAU,EAAEkB;IAAQ,CACrB;EAAC,CACsB,CAAC;AAE/B,CACF,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useImperativeHandle","useMemo","useRef","Platform","ExternalKeyboardViewNative","Commands","LockFocusEnum","KeyPressContext","useBubbledInfo","useGroupIdentifierContext","useOnFocusChange","useOrderFocusGroup","useWrappedOrderProps","jsx","_jsx","isIOS","OS","BITS","focusBinaryValue","Up","BIT_01","Down","BIT_02","Left","BIT_03","Right","BIT_04","Forward","BIT_05","Backward","BIT_06","First","BIT_09","Last","BIT_10","mapFocusValues","values","length","reduce","acc","item","BaseKeyboardView","memo","forwardRef","onFocusChange","onKeyUpPress","onKeyDownPress","onBubbledContextMenuPress","haloEffect","autoFocus","focusable","focusableWrapper","onFocus","onBlur","groupIdentifier","tintColor","screenAutoA11yFocusDelay","lockFocus","orderIndex","orderForward","orderBackward","orderFirst","orderLast","orderGroup","orderLeft","orderRight","orderUp","orderDown","orderId","enableContextMenu","orderPrefix","_orderPrefix","tintType","enableA11yFocus","_enableA11yFocus","defaultFocusHighlightEnabled","roundedHaloFix","props","ref","targetRef","lockFocusValue","contextIdentifier","contextGroupId","groupId","__DEV__","undefined","console","warn","hasOrderLinkProp","nativeCommands","keyboardFocus","current","rnekKeyboardFocus","screenReaderFocus","rnekScreenReaderFocus","focus","Proxy","get","_target","prop","bubbled","onFocusChangeHandler","hasFocusListener","wrappedOrderProps","platformSpecificHalo","Provider","value","context","children","canBeFocused","contextMenu","hasKeyDownPress","Boolean","hasKeyUpPress","hasOnFocusChanged"],"sourceRoot":"../../../../src","sources":["components/BaseKeyboardView/BaseKeyboardView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAEVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,kBAAkB;AAC7D,SAASC,QAAQ,QAAQ,sDAAsD;AAC/E,SACEC,aAAa,QAIR,aAAa;AAEpB,SAASC,eAAe,QAAQ,sCAAsC;AACtE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,oBAAoB,QAAQ,kCAAkC;;AAEvE;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEA,MAAMC,KAAK,GAAGZ,QAAQ,CAACa,EAAE,KAAK,KAAK;AAAC,IAE/BC,IAAI,0BAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA,EAAJA,IAAI;AAWT,MAAMC,gBAA+C,GAAG;EACtD,CAACZ,aAAa,CAACa,EAAE,GAAGF,IAAI,CAACG,MAAM;EAC/B,CAACd,aAAa,CAACe,IAAI,GAAGJ,IAAI,CAACK,MAAM;EACjC,CAAChB,aAAa,CAACiB,IAAI,GAAGN,IAAI,CAACO,MAAM;EACjC,CAAClB,aAAa,CAACmB,KAAK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