react-native-a11y-order 0.9.1 → 0.11.0-rc1

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 (305) hide show
  1. package/README.md +55 -334
  2. package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +2 -6
  3. package/android/src/main/java/com/a11yorder/core/A11yManagedFocusView.java +29 -0
  4. package/android/src/main/java/com/a11yorder/{views/A11yView/A11yView.java → core/A11yScreenReaderView.java} +3 -45
  5. package/android/src/main/java/com/a11yorder/core/A11yViewOrder.java +37 -0
  6. package/android/src/main/java/com/a11yorder/modules/A11yAnnounceModule.java +20 -7
  7. package/android/src/main/java/com/a11yorder/views/A11yCardView/A11yCardViewManager.java +18 -0
  8. package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexView.java +2 -65
  9. package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexViewManager.java +21 -0
  10. package/android/src/newarch/A11yCardViewManagerSpec.java +9 -0
  11. package/android/src/oldarch/A11yAnnounceModuleSpec.java +8 -1
  12. package/android/src/oldarch/A11yCardViewManagerSpec.java +8 -0
  13. package/android/src/oldarch/A11yIndexViewManagerSpec.java +8 -0
  14. package/ios/helpers/RNAOFabricEventHelper/RNAOFabricEventHelper.mm +5 -5
  15. package/ios/helpers/RNAOSpeechAttributes.h +35 -0
  16. package/ios/helpers/RNAOSpeechAttributes.mm +64 -0
  17. package/ios/modules/RNAOA11yAnnounceModule.h +13 -9
  18. package/ios/modules/RNAOA11yAnnounceModule.mm +220 -14
  19. package/ios/services/RNAOA11yAnnounceService/RNAOA11yAnnounceService.h +11 -1
  20. package/ios/services/RNAOA11yAnnounceService/RNAOA11yAnnounceService.mm +55 -51
  21. package/ios/views/RNAOA11yCardView/RNAOA11yCardView.h +29 -0
  22. package/ios/views/RNAOA11yCardView/RNAOA11yCardView.mm +83 -0
  23. package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.h +14 -0
  24. package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.mm +17 -0
  25. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.h +2 -41
  26. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.mm +24 -128
  27. package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.mm +15 -0
  28. package/ios/views/RNAOA11yPaneTitleView/RNAOA11yPaneTitleView.mm +12 -2
  29. package/ios/views/base/RNAOA11yGroupChildrenView.h +21 -0
  30. package/ios/views/base/RNAOA11yGroupChildrenView.mm +19 -0
  31. package/ios/views/base/RNAOA11yManagedFocusView.h +28 -0
  32. package/ios/views/{RNAOA11yView/RNAOA11yView.mm → base/RNAOA11yManagedFocusView.mm} +64 -183
  33. package/ios/views/base/RNAOA11yScreenReaderView.h +24 -0
  34. package/ios/views/base/RNAOA11yScreenReaderView.mm +32 -0
  35. package/ios/views/base/RNAOA11yViewGroup.h +35 -0
  36. package/ios/views/base/RNAOA11yViewGroup.mm +46 -0
  37. package/ios/views/base/RNAOA11yViewOrder.h +40 -0
  38. package/ios/views/base/RNAOA11yViewOrder.mm +92 -0
  39. package/lib/commonjs/components/A11yCard/A11yCard.ios.js +49 -0
  40. package/lib/commonjs/components/A11yCard/A11yCard.ios.js.map +1 -0
  41. package/lib/commonjs/components/A11yCard/A11yCard.js +41 -0
  42. package/lib/commonjs/components/A11yCard/A11yCard.js.map +1 -0
  43. package/lib/commonjs/{types/A11yGroup.types.js → components/A11yCard/A11yCard.types.js} +1 -1
  44. package/lib/commonjs/components/A11yCard/A11yCard.types.js.map +1 -0
  45. package/lib/commonjs/components/A11yIndex/A11yIndex.js +88 -28
  46. package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
  47. package/lib/commonjs/components/A11yIndex/A11yIndex.types.js +39 -0
  48. package/lib/commonjs/components/A11yIndex/A11yIndex.types.js.map +1 -0
  49. package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
  50. package/lib/commonjs/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
  51. package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
  52. package/lib/commonjs/components/A11yLock/A11yLock.types.js.map +1 -0
  53. package/lib/commonjs/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +3 -3
  54. package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
  55. package/lib/commonjs/{types/A11yModule.types.js → components/A11yOrder/A11yOrder.types.js} +1 -1
  56. package/lib/commonjs/components/A11yOrder/A11yOrder.types.js.map +1 -0
  57. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
  58. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
  59. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js +6 -0
  60. package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
  61. package/lib/commonjs/components/A11yView/A11yView.js +7 -33
  62. package/lib/commonjs/components/A11yView/A11yView.js.map +1 -1
  63. package/lib/commonjs/components/A11yView/A11yView.types.js.map +1 -0
  64. package/lib/commonjs/index.js +37 -10
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/index.web.js +12 -6
  67. package/lib/commonjs/index.web.js.map +1 -1
  68. package/lib/commonjs/modules/A11yAnnounceModule.android.js +37 -3
  69. package/lib/commonjs/modules/A11yAnnounceModule.android.js.map +1 -1
  70. package/lib/commonjs/modules/A11yAnnounceModule.js +66 -8
  71. package/lib/commonjs/modules/A11yAnnounceModule.js.map +1 -1
  72. package/lib/commonjs/nativeSpecs/{A11yGroupNativeComponent.ts → A11yCardNativeComponent.ts} +3 -3
  73. package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.ts +11 -3
  74. package/lib/commonjs/nativeSpecs/NativeA11yAnnounceModule.js +2 -0
  75. package/lib/commonjs/nativeSpecs/NativeA11yAnnounceModule.js.map +1 -1
  76. package/lib/module/components/A11yCard/A11yCard.ios.js +43 -0
  77. package/lib/module/components/A11yCard/A11yCard.ios.js.map +1 -0
  78. package/lib/module/components/A11yCard/A11yCard.js +35 -0
  79. package/lib/module/components/A11yCard/A11yCard.js.map +1 -0
  80. package/lib/module/components/A11yCard/A11yCard.types.js +4 -0
  81. package/lib/module/components/A11yCard/A11yCard.types.js.map +1 -0
  82. package/lib/module/components/A11yIndex/A11yIndex.js +88 -28
  83. package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
  84. package/lib/module/components/A11yIndex/A11yIndex.types.js +35 -0
  85. package/lib/module/components/A11yIndex/A11yIndex.types.js.map +1 -0
  86. package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
  87. package/lib/module/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
  88. package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
  89. package/lib/module/components/A11yLock/A11yLock.types.js.map +1 -0
  90. package/lib/module/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +2 -2
  91. package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
  92. package/lib/module/components/A11yOrder/A11yOrder.types.js +4 -0
  93. package/lib/module/components/A11yOrder/A11yOrder.types.js.map +1 -0
  94. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
  95. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
  96. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js +4 -0
  97. package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
  98. package/lib/module/components/A11yView/A11yView.js +7 -31
  99. package/lib/module/components/A11yView/A11yView.js.map +1 -1
  100. package/lib/module/components/A11yView/A11yView.types.js.map +1 -0
  101. package/lib/module/index.js +13 -9
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/index.web.js +5 -5
  104. package/lib/module/index.web.js.map +1 -1
  105. package/lib/module/modules/A11yAnnounceModule.android.js +32 -2
  106. package/lib/module/modules/A11yAnnounceModule.android.js.map +1 -1
  107. package/lib/module/modules/A11yAnnounceModule.js +62 -7
  108. package/lib/module/modules/A11yAnnounceModule.js.map +1 -1
  109. package/{src/nativeSpecs/A11yGroupNativeComponent.ts → lib/module/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
  110. package/lib/module/nativeSpecs/A11yIndexNativeComponent.ts +11 -3
  111. package/lib/module/nativeSpecs/NativeA11yAnnounceModule.js +4 -0
  112. package/lib/module/nativeSpecs/NativeA11yAnnounceModule.js.map +1 -1
  113. package/lib/typescript/src/components/A11yCard/A11yCard.d.ts +5 -0
  114. package/lib/typescript/src/components/A11yCard/A11yCard.d.ts.map +1 -0
  115. package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts +5 -0
  116. package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts.map +1 -0
  117. package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts +38 -0
  118. package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts.map +1 -0
  119. package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts +10 -128
  120. package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts.map +1 -1
  121. package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts +101 -0
  122. package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts.map +1 -0
  123. package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts +8 -128
  124. package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts.map +1 -1
  125. package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts +1 -1
  126. package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts.map +1 -1
  127. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts +1 -1
  128. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts.map +1 -1
  129. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts +2 -2
  130. package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts.map +1 -1
  131. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts +1 -1
  132. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts.map +1 -1
  133. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts +2 -2
  134. package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts.map +1 -1
  135. package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts +35 -0
  136. package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts.map +1 -0
  137. package/lib/typescript/src/components/A11yOrder/A11yOrder.d.ts +5 -0
  138. package/lib/typescript/src/components/A11yOrder/A11yOrder.d.ts.map +1 -0
  139. package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts +11 -0
  140. package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts.map +1 -0
  141. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts +3 -17
  142. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts.map +1 -1
  143. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts +52 -0
  144. package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts.map +1 -0
  145. package/lib/typescript/src/components/A11yView/A11yView.d.ts +13 -130
  146. package/lib/typescript/src/components/A11yView/A11yView.d.ts.map +1 -1
  147. package/lib/typescript/src/components/A11yView/A11yView.types.d.ts +10 -0
  148. package/lib/typescript/src/components/A11yView/A11yView.types.d.ts.map +1 -0
  149. package/lib/typescript/src/index.d.ts +29 -403
  150. package/lib/typescript/src/index.d.ts.map +1 -1
  151. package/lib/typescript/src/index.web.d.ts +20 -171
  152. package/lib/typescript/src/index.web.d.ts.map +1 -1
  153. package/lib/typescript/src/modules/A11yAnnounceModule.android.d.ts +25 -2
  154. package/lib/typescript/src/modules/A11yAnnounceModule.android.d.ts.map +1 -1
  155. package/lib/typescript/src/modules/A11yAnnounceModule.d.ts +112 -4
  156. package/lib/typescript/src/modules/A11yAnnounceModule.d.ts.map +1 -1
  157. package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts +6 -0
  158. package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts.map +1 -0
  159. package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts +10 -6
  160. package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts.map +1 -1
  161. package/lib/typescript/src/nativeSpecs/A11yLockNativeComponent.d.ts +1 -3
  162. package/lib/typescript/src/nativeSpecs/A11yLockNativeComponent.d.ts.map +1 -1
  163. package/lib/typescript/src/nativeSpecs/A11yOrderNativeComponent.d.ts +1 -3
  164. package/lib/typescript/src/nativeSpecs/A11yOrderNativeComponent.d.ts.map +1 -1
  165. package/lib/typescript/src/nativeSpecs/A11yPaneTitleNativeComponent.d.ts +1 -3
  166. package/lib/typescript/src/nativeSpecs/A11yPaneTitleNativeComponent.d.ts.map +1 -1
  167. package/lib/typescript/src/nativeSpecs/NativeA11yAnnounceModule.d.ts +22 -2
  168. package/lib/typescript/src/nativeSpecs/NativeA11yAnnounceModule.d.ts.map +1 -1
  169. package/package.json +12 -11
  170. package/src/components/A11yCard/A11yCard.ios.tsx +44 -0
  171. package/src/components/A11yCard/A11yCard.tsx +35 -0
  172. package/src/components/A11yCard/A11yCard.types.ts +50 -0
  173. package/src/components/A11yIndex/A11yIndex.tsx +144 -52
  174. package/src/components/A11yIndex/A11yIndex.types.ts +119 -0
  175. package/src/components/A11yIndex/A11yIndex.web.tsx +12 -17
  176. package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx +1 -1
  177. package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.tsx +1 -1
  178. package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.tsx +3 -2
  179. package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.tsx +1 -1
  180. package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx +2 -2
  181. package/src/components/A11yLock/A11yLock.types.ts +38 -0
  182. package/src/components/{A11ySequence/A11ySequence.tsx → A11yOrder/A11yOrder.tsx} +4 -2
  183. package/src/components/A11yOrder/A11yOrder.types.ts +11 -0
  184. package/src/components/A11yPaneTitle/A11yPaneTitle.tsx +13 -19
  185. package/src/components/A11yPaneTitle/A11yPaneTitle.types.ts +58 -0
  186. package/src/components/A11yView/A11yView.tsx +8 -63
  187. package/src/components/A11yView/A11yView.types.ts +11 -0
  188. package/src/index.ts +38 -20
  189. package/src/index.web.ts +7 -14
  190. package/src/modules/A11yAnnounceModule.android.ts +18 -2
  191. package/src/modules/A11yAnnounceModule.ts +153 -9
  192. package/{lib/module/nativeSpecs/A11yGroupNativeComponent.ts → src/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
  193. package/src/nativeSpecs/A11yIndexNativeComponent.ts +11 -3
  194. package/src/nativeSpecs/NativeA11yAnnounceModule.ts +31 -1
  195. package/android/src/main/java/com/a11yorder/views/A11yGroupView/A11yGroupViewManager.java +0 -25
  196. package/android/src/main/java/com/a11yorder/views/A11yUIContainerView/A11yUIContainerViewManager.java +0 -30
  197. package/android/src/main/java/com/a11yorder/views/A11yView/A11yViewManager.java +0 -67
  198. package/android/src/newarch/A11yGroupViewManagerSpec.java +0 -9
  199. package/android/src/newarch/A11yUIContainerViewManagerSpec.java +0 -8
  200. package/android/src/newarch/A11yViewSpec.java +0 -13
  201. package/android/src/oldarch/A11yGroupViewManagerSpec.java +0 -8
  202. package/android/src/oldarch/A11yUIContainerViewManagerSpec.java +0 -9
  203. package/android/src/oldarch/A11yViewSpec.java +0 -18
  204. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.h +0 -37
  205. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.mm +0 -67
  206. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.h +0 -18
  207. package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.mm +0 -25
  208. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.h +0 -35
  209. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.mm +0 -79
  210. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.h +0 -18
  211. package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.mm +0 -27
  212. package/ios/views/RNAOA11yView/RNAOA11yView.h +0 -45
  213. package/ios/views/RNAOA11yView/RNAOA11yViewManager.h +0 -14
  214. package/ios/views/RNAOA11yView/RNAOA11yViewManager.mm +0 -53
  215. package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +0 -18
  216. package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +0 -1
  217. package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js +0 -24
  218. package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js.map +0 -1
  219. package/lib/commonjs/components/A11yGroup/A11yGroup.js +0 -9
  220. package/lib/commonjs/components/A11yGroup/A11yGroup.js.map +0 -1
  221. package/lib/commonjs/components/A11ySequence/A11ySequence.js.map +0 -1
  222. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js +0 -22
  223. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
  224. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js +0 -9
  225. package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
  226. package/lib/commonjs/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  227. package/lib/commonjs/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  228. package/lib/commonjs/types/A11yGroup.types.js.map +0 -1
  229. package/lib/commonjs/types/A11yIndex.types.js +0 -13
  230. package/lib/commonjs/types/A11yIndex.types.js.map +0 -1
  231. package/lib/commonjs/types/A11yLock.types.js.map +0 -1
  232. package/lib/commonjs/types/A11yModule.types.js.map +0 -1
  233. package/lib/commonjs/types/A11yUIContainerView.types.js +0 -15
  234. package/lib/commonjs/types/A11yUIContainerView.types.js.map +0 -1
  235. package/lib/commonjs/types/A11yView.types.js.map +0 -1
  236. package/lib/module/components/A11yGroup/A11yGroup.android.js +0 -12
  237. package/lib/module/components/A11yGroup/A11yGroup.android.js.map +0 -1
  238. package/lib/module/components/A11yGroup/A11yGroup.ios.js +0 -18
  239. package/lib/module/components/A11yGroup/A11yGroup.ios.js.map +0 -1
  240. package/lib/module/components/A11yGroup/A11yGroup.js +0 -5
  241. package/lib/module/components/A11yGroup/A11yGroup.js.map +0 -1
  242. package/lib/module/components/A11ySequence/A11ySequence.js.map +0 -1
  243. package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js +0 -17
  244. package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
  245. package/lib/module/components/A11yUIContainer/A11yUIContainer.js +0 -5
  246. package/lib/module/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
  247. package/lib/module/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  248. package/lib/module/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  249. package/lib/module/types/A11yGroup.types.js +0 -4
  250. package/lib/module/types/A11yGroup.types.js.map +0 -1
  251. package/lib/module/types/A11yIndex.types.js +0 -9
  252. package/lib/module/types/A11yIndex.types.js.map +0 -1
  253. package/lib/module/types/A11yLock.types.js.map +0 -1
  254. package/lib/module/types/A11yModule.types.js +0 -4
  255. package/lib/module/types/A11yModule.types.js.map +0 -1
  256. package/lib/module/types/A11yUIContainerView.types.js +0 -11
  257. package/lib/module/types/A11yUIContainerView.types.js.map +0 -1
  258. package/lib/module/types/A11yView.types.js.map +0 -1
  259. package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts +0 -4
  260. package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts.map +0 -1
  261. package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts +0 -3
  262. package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts.map +0 -1
  263. package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts +0 -4
  264. package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts.map +0 -1
  265. package/lib/typescript/src/components/A11ySequence/A11ySequence.d.ts +0 -126
  266. package/lib/typescript/src/components/A11ySequence/A11ySequence.d.ts.map +0 -1
  267. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts +0 -3
  268. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts.map +0 -1
  269. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts +0 -4
  270. package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts.map +0 -1
  271. package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts +0 -8
  272. package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts.map +0 -1
  273. package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts +0 -10
  274. package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts.map +0 -1
  275. package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts +0 -26
  276. package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts.map +0 -1
  277. package/lib/typescript/src/types/A11yGroup.types.d.ts +0 -7
  278. package/lib/typescript/src/types/A11yGroup.types.d.ts.map +0 -1
  279. package/lib/typescript/src/types/A11yIndex.types.d.ts +0 -19
  280. package/lib/typescript/src/types/A11yIndex.types.d.ts.map +0 -1
  281. package/lib/typescript/src/types/A11yLock.types.d.ts +0 -8
  282. package/lib/typescript/src/types/A11yLock.types.d.ts.map +0 -1
  283. package/lib/typescript/src/types/A11yModule.types.d.ts +0 -7
  284. package/lib/typescript/src/types/A11yModule.types.d.ts.map +0 -1
  285. package/lib/typescript/src/types/A11yUIContainerView.types.d.ts +0 -13
  286. package/lib/typescript/src/types/A11yUIContainerView.types.d.ts.map +0 -1
  287. package/lib/typescript/src/types/A11yView.types.d.ts +0 -12
  288. package/lib/typescript/src/types/A11yView.types.d.ts.map +0 -1
  289. package/src/components/A11yGroup/A11yGroup.android.tsx +0 -8
  290. package/src/components/A11yGroup/A11yGroup.ios.tsx +0 -11
  291. package/src/components/A11yGroup/A11yGroup.tsx +0 -5
  292. package/src/components/A11yUIContainer/A11yUIContainer.ios.tsx +0 -20
  293. package/src/components/A11yUIContainer/A11yUIContainer.tsx +0 -5
  294. package/src/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
  295. package/src/nativeSpecs/A11yViewNativeComponent.ts +0 -36
  296. package/src/types/A11yGroup.types.ts +0 -9
  297. package/src/types/A11yIndex.types.ts +0 -21
  298. package/src/types/A11yLock.types.ts +0 -8
  299. package/src/types/A11yModule.types.ts +0 -7
  300. package/src/types/A11yUIContainerView.types.ts +0 -15
  301. package/src/types/A11yView.types.ts +0 -19
  302. /package/lib/commonjs/{types → components/A11yLock}/A11yLock.types.js +0 -0
  303. /package/lib/commonjs/{types → components/A11yView}/A11yView.types.js +0 -0
  304. /package/lib/module/{types → components/A11yLock}/A11yLock.types.js +0 -0
  305. /package/lib/module/{types → components/A11yView}/A11yView.types.js +0 -0
@@ -1,22 +1,16 @@
1
1
  import React from 'react';
2
- import { type ViewProps } from 'react-native';
3
2
  import A11yPaneTitleNative from '../../nativeSpecs/A11yPaneTitleNativeComponent';
3
+ import type {
4
+ A11yPaneTitleProps,
5
+ A11yPaneType,
6
+ A11yScreenChangeProps,
7
+ } from './A11yPaneTitle.types';
4
8
 
5
- enum PaneEnum {
6
- activity = 0,
7
- pane = 1,
8
- announce = 2,
9
- }
10
-
11
- type PaneType = keyof typeof PaneEnum;
12
-
13
- type A11yPaneTitleType = React.PropsWithChildren<{
14
- title?: string;
15
- detachMessage?: string;
16
- type?: PaneType;
17
- withFocusRestore?: boolean;
18
- displayed?: boolean;
19
- }>;
9
+ const PaneTypeValue: Record<A11yPaneType, number> = {
10
+ activity: 0,
11
+ pane: 1,
12
+ announce: 2,
13
+ };
20
14
 
21
15
  export const A11yPaneTitle = ({
22
16
  title,
@@ -25,21 +19,21 @@ export const A11yPaneTitle = ({
25
19
  children,
26
20
  displayed,
27
21
  withFocusRestore = true,
28
- }: ViewProps & A11yPaneTitleType) => {
22
+ }: A11yPaneTitleProps) => {
29
23
  if (displayed === false) return null;
30
24
 
31
25
  return (
32
26
  <A11yPaneTitleNative
33
27
  title={title}
34
28
  detachMessage={detachMessage}
35
- type={PaneEnum[type]}
29
+ type={PaneTypeValue[type]}
36
30
  children={children}
37
31
  withFocusRestore={withFocusRestore}
38
32
  />
39
33
  );
40
34
  };
41
35
 
42
- export const A11yScreenChange = (props: Omit<A11yPaneTitleType, 'type'>) => (
36
+ export const A11yScreenChange = (props: A11yScreenChangeProps) => (
43
37
  <A11yPaneTitle
44
38
  title={props.title}
45
39
  detachMessage={props.detachMessage}
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Controls the native accessibility announcement mechanism.
5
+ *
6
+ * - `'pane'` — layout-changed notification with a title (default, use for panels/sheets)
7
+ * - `'activity'` — screen-change notification (use for full-screen transitions)
8
+ * - `'announce'` — plain announcement with no focus shift (use for status updates)
9
+ */
10
+ export type A11yPaneType = 'activity' | 'pane' | 'announce';
11
+
12
+ /**
13
+ * Props for {@link A11y.PaneTitle} — announces a screen or panel transition to
14
+ * VoiceOver / TalkBack and optionally restores focus when the view unmounts.
15
+ */
16
+ export type A11yPaneTitleProps = React.PropsWithChildren<{
17
+ /**
18
+ * The title announced to the screen reader when this component mounts.
19
+ */
20
+ title?: string;
21
+
22
+ /**
23
+ * A message announced to the screen reader when this component unmounts.
24
+ * Use to signal the end of a flow, e.g. `"Modal closed"` or `"Drawer closed"`.
25
+ */
26
+ detachMessage?: string;
27
+
28
+ /**
29
+ * Controls the native announcement mechanism. Defaults to `'pane'`.
30
+ *
31
+ * - `'pane'` — layout-changed notification with a title (panels, sheets)
32
+ * - `'activity'` — screen-change notification (full-screen navigation)
33
+ * - `'announce'` — plain announcement with no focus shift (status updates)
34
+ */
35
+ type?: A11yPaneType;
36
+
37
+ /**
38
+ * When `true`, VoiceOver / TalkBack restores focus to the previously focused
39
+ * element when this component unmounts.
40
+ *
41
+ * Defaults to `true`.
42
+ */
43
+ withFocusRestore?: boolean;
44
+
45
+ /**
46
+ * When `false`, the component renders nothing and posts no announcement.
47
+ * Use this to conditionally suppress the view without unmounting its subtree.
48
+ *
49
+ * Defaults to `true`.
50
+ */
51
+ displayed?: boolean;
52
+ }>;
53
+
54
+ /**
55
+ * Props for {@link A11y.ScreenChange} — shorthand for `A11y.PaneTitle` with
56
+ * `type="activity"` pre-set for full-screen navigation transitions.
57
+ */
58
+ export type A11yScreenChangeProps = Omit<A11yPaneTitleProps, 'type'>;
@@ -1,63 +1,8 @@
1
- import React from 'react';
2
- import A11yViewNativeComponent from '../../nativeSpecs/A11yViewNativeComponent';
3
- import type { A11yViewProps } from '../../types/A11yView.types';
4
-
5
- // Unknown ref type for better react-native support
6
- type ViewRefType = {};
7
-
8
- export const A11yView = React.memo(
9
- React.forwardRef<ViewRefType, A11yViewProps>(
10
- (
11
- {
12
- onScreenReaderFocused,
13
- onScreenReaderSubViewFocusChange,
14
- onScreenReaderSubViewFocused,
15
- onScreenReaderSubViewBlurred,
16
- onScreenReaderDescendantFocusChanged,
17
- ...props
18
- },
19
- ref
20
- ) => {
21
- const hasHandler = Boolean(
22
- onScreenReaderSubViewBlurred ||
23
- onScreenReaderSubViewFocused ||
24
- onScreenReaderSubViewFocusChange
25
- );
26
-
27
- const onScreenReaderChangeHandler = React.useCallback(
28
- (event: { nativeEvent: { isFocused: boolean } }) => {
29
- onScreenReaderSubViewFocusChange?.(event.nativeEvent.isFocused);
30
- if (event.nativeEvent.isFocused) {
31
- onScreenReaderSubViewFocused?.();
32
- } else {
33
- onScreenReaderSubViewBlurred?.();
34
- }
35
- },
36
- [
37
- onScreenReaderSubViewFocusChange,
38
- onScreenReaderSubViewBlurred,
39
- onScreenReaderSubViewFocused,
40
- ]
41
- );
42
-
43
- const onScreenReaderHandlerProp = hasHandler
44
- ? onScreenReaderChangeHandler
45
- : undefined;
46
-
47
- return (
48
- <A11yViewNativeComponent
49
- {...props}
50
- ref={ref as React.Ref<any>}
51
- descendantFocusChangedEnabled={Boolean(
52
- onScreenReaderDescendantFocusChanged
53
- )}
54
- onScreenReaderFocused={onScreenReaderFocused}
55
- onScreenReaderFocusChange={onScreenReaderHandlerProp}
56
- onScreenReaderDescendantFocusChanged={
57
- onScreenReaderDescendantFocusChanged
58
- }
59
- />
60
- );
61
- }
62
- )
63
- );
1
+ import { A11yIndex } from '../A11yIndex/A11yIndex';
2
+
3
+ /**
4
+ * Standalone focus-tracking view with no ordering context.
5
+ * Use when you need screen reader focus events but no position in a sequence.
6
+ * For ordered elements, use {@link A11yIndex} inside an Order container.
7
+ */
8
+ export const A11yView = A11yIndex;
@@ -0,0 +1,11 @@
1
+ import type { A11yIndexProps } from '../A11yIndex/A11yIndex.types';
2
+
3
+ export type { ScreenReaderDescendantFocusChangedEvent } from '../A11yIndex/A11yIndex.types';
4
+
5
+ /**
6
+ * Props for {@link A11y.View} — a standalone focus-tracking view with no ordering context.
7
+ *
8
+ * All screen reader focus events from {@link A11yIndexProps} are available.
9
+ * `index` and `orderType` are omitted because they only apply inside an `A11y.Order` sequence.
10
+ */
11
+ export type A11yViewProps = Omit<A11yIndexProps, 'index' | 'orderType'>;
package/src/index.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { A11yIndex } from './components/A11yIndex/A11yIndex';
2
- import { A11yIndexSequence } from './components/A11ySequence/A11ySequence';
3
- import { A11yGroup } from './components/A11yGroup/A11yGroup';
4
- import { A11yUIContainer } from './components/A11yUIContainer/A11yUIContainer';
2
+ import { A11yOrder } from './components/A11yOrder/A11yOrder';
5
3
  import {
6
4
  A11yPaneTitle,
7
5
  A11yScreenChange,
@@ -9,34 +7,54 @@ import {
9
7
  import { A11yView } from './components/A11yView/A11yView';
10
8
  import { A11yFocusFrame } from './components/A11yLock/A11yFocusFrame/A11yFocusFrame';
11
9
  import { A11yFocusTrap } from './components/A11yLock/A11yFocusTrap/A11yFocusTrap';
10
+ import { A11yCard } from './components/A11yCard/A11yCard';
12
11
 
12
+ // ─── Component props ──────────────────────────────────────────────────────────
13
+
14
+ export type { A11yCardProps } from './components/A11yCard/A11yCard.types';
15
+ export type { A11yOrderProps } from './components/A11yOrder/A11yOrder.types';
13
16
  export type {
14
- IndexCommands,
15
- A11yOrderType,
16
- A11yOrderTypeEnum,
17
17
  A11yIndexProps,
18
- } from './types/A11yIndex.types';
19
-
18
+ A11yOrderType,
19
+ IndexCommands,
20
+ } from './components/A11yIndex/A11yIndex.types';
21
+ export { A11yOrderTypeEnum } from './components/A11yIndex/A11yIndex.types';
20
22
  export type {
21
- A11yContainerTypeEnum,
22
- A11yUIContainerType,
23
- A11yUIContainerProps,
24
- } from './types/A11yUIContainerView.types';
25
-
26
- export type { ScreenReaderDescendantFocusChangedEvent } from './types/A11yView.types';
23
+ A11yViewProps,
24
+ ScreenReaderDescendantFocusChangedEvent,
25
+ } from './components/A11yView/A11yView.types';
26
+ export type {
27
+ A11yFocusTrapProps,
28
+ A11yFocusFrameProps,
29
+ } from './components/A11yLock/A11yLock.types';
30
+ export type {
31
+ A11yPaneTitleProps,
32
+ A11yScreenChangeProps,
33
+ A11yPaneType,
34
+ } from './components/A11yPaneTitle/A11yPaneTitle.types';
27
35
 
28
- export type { A11yViewProps } from './types/A11yView.types';
36
+ // ─── Namespace ────────────────────────────────────────────────────────────────
29
37
 
30
38
  export const A11y = {
31
- Order: A11yIndexSequence,
39
+ Order: A11yOrder,
32
40
  Index: A11yIndex,
33
- Group: A11yGroup,
34
- Container: A11yUIContainer,
41
+ View: A11yView,
35
42
  PaneTitle: A11yPaneTitle,
36
43
  ScreenChange: A11yScreenChange,
37
- View: A11yView,
38
44
  FocusFrame: A11yFocusFrame,
39
45
  FocusTrap: A11yFocusTrap,
46
+ Card: A11yCard,
40
47
  };
41
48
 
42
- export { A11yModule } from './modules/A11yAnnounceModule';
49
+ export {
50
+ ScreenReader,
51
+ announce,
52
+ cancel,
53
+ cancelAll,
54
+ } from './modules/A11yAnnounceModule';
55
+ export type {
56
+ AnnouncePriority,
57
+ AnnounceStatus,
58
+ AnnounceOptions,
59
+ AnnouncementResult,
60
+ } from './modules/A11yAnnounceModule';
package/src/index.web.ts CHANGED
@@ -4,30 +4,23 @@ import { View } from 'react-native';
4
4
  export type {
5
5
  IndexCommands,
6
6
  A11yOrderType,
7
- A11yOrderTypeEnum,
8
7
  A11yIndexProps,
9
- } from './types/A11yIndex.types';
8
+ } from './components/A11yIndex/A11yIndex.types';
9
+ export { A11yOrderTypeEnum } from './components/A11yIndex/A11yIndex.types';
10
10
 
11
- export type {
12
- A11yContainerTypeEnum,
13
- A11yUIContainerType,
14
- A11yUIContainerProps,
15
- } from './types/A11yUIContainerView.types';
16
-
17
- export type { ScreenReaderDescendantFocusChangedEvent } from './types/A11yView.types';
11
+ export type { ScreenReaderDescendantFocusChangedEvent } from './components/A11yView/A11yView.types';
18
12
 
19
- export type { A11yViewProps } from './types/A11yView.types';
13
+ export type { A11yViewProps } from './components/A11yView/A11yView.types';
20
14
 
21
15
  export const A11y = {
22
16
  Order: View,
23
- Group: View,
24
17
  Index: A11yIndex,
25
- Container: View,
18
+ View: View,
26
19
  PaneTitle: View,
27
20
  ScreenChange: View,
28
- View: View,
29
21
  FocusFrame: View,
30
22
  FocusTrap: View,
23
+ Card: View,
31
24
  };
32
25
 
33
- export { A11yModule } from './modules/A11yAnnounceModule';
26
+ export { ScreenReader } from './modules/A11yAnnounceModule';
@@ -1,5 +1,21 @@
1
+ // Android stub — bypasses the native bridge, uses the built-in API directly.
1
2
  import { AccessibilityInfo } from 'react-native';
2
3
 
3
- export const A11yModule = {
4
- announce: AccessibilityInfo.announceForAccessibility,
4
+ export const ScreenReader = {
5
+ announce: (message: string) => {
6
+ AccessibilityInfo.announceForAccessibility(message);
7
+ return Promise.resolve({ id: '', status: 'fired' as const });
8
+ },
9
+ cancel: () => Promise.resolve({ id: '', status: 'cancelled' as const }),
10
+ cancelAll: () => Promise.resolve({ id: '', status: 'cancelled' as const }),
5
11
  };
12
+
13
+ export const announce = (message: string) => {
14
+ AccessibilityInfo.announceForAccessibility(message);
15
+ return Promise.resolve({ id: '', status: 'fired' as const });
16
+ };
17
+
18
+ export const cancel = () =>
19
+ Promise.resolve({ id: '', status: 'cancelled' as const });
20
+ export const cancelAll = () =>
21
+ Promise.resolve({ id: '', status: 'cancelled' as const });
@@ -1,19 +1,21 @@
1
1
  import { NativeModules, Platform } from 'react-native';
2
+ import NativeA11yAnnounceModule from '../nativeSpecs/NativeA11yAnnounceModule';
2
3
 
3
4
  const LINKING_ERROR =
4
- `The package 'react-native-external-keyboard' doesn't seem to be linked. Make sure: \n\n${Platform.select(
5
+ `The package 'react-native-a11y-order' doesn't seem to be linked. Make sure: \n\n${Platform.select(
5
6
  { ios: "- You have run 'pod install'\n", default: '' }
6
7
  )}- You rebuilt the app after installing the package\n` +
7
8
  `- You are not using Expo Go\n`;
8
9
 
9
10
  // @ts-expect-error
10
11
  const isTurboModuleEnabled = global.__turboModuleProxy != null;
11
- const A11yAnnounceModule = isTurboModuleEnabled
12
- ? require('../nativeSpecs/NativeA11yAnnounceModule').default
12
+
13
+ const A11yAnnounceNative = isTurboModuleEnabled
14
+ ? NativeA11yAnnounceModule
13
15
  : NativeModules.A11yAnnounceModule;
14
16
 
15
- export const A11yAnnounce =
16
- A11yAnnounceModule ||
17
+ const A11yAnnounceProxy: typeof NativeA11yAnnounceModule =
18
+ A11yAnnounceNative ??
17
19
  new Proxy(
18
20
  {},
19
21
  {
@@ -23,10 +25,152 @@ export const A11yAnnounce =
23
25
  }
24
26
  );
25
27
 
26
- export function announce(message: string) {
27
- A11yAnnounce.announce(message);
28
+ // ─── Types ────────────────────────────────────────────────────────────────────
29
+
30
+ export type AnnouncePriority = 'low' | 'default' | 'high';
31
+
32
+ export type AnnounceStatus = 'spoken' | 'fired' | 'cancelled';
33
+
34
+ export type AnnounceOptions = {
35
+ /**
36
+ * Controls urgency. iOS 17+: maps to `UIAccessibilityPriority`.
37
+ *
38
+ * - `'low'` — spoken only when the screen reader is fully idle
39
+ * - `'default'` — standard queued announcement (default)
40
+ * - `'high'` — may preempt lower-priority pending items
41
+ */
42
+ priority?: AnnouncePriority;
43
+
44
+ /**
45
+ * When `true`, waits for current speech before speaking.
46
+ * When `false`, may interrupt current speech.
47
+ * Default: `true`
48
+ */
49
+ queue?: boolean;
50
+
51
+ /**
52
+ * Navigation-aware mode. When `true`, the announcement waits for:
53
+ * - Active navigation transitions to finish (1 s lock after screen change)
54
+ * - The screen reader to have a focused element
55
+ * - A 300 ms debounce to prevent overlap with focus changes
56
+ *
57
+ * Promise resolves when the service **actually fires** the announcement
58
+ * (not just when it's enqueued), so `await` is meaningful.
59
+ * Default: `false`
60
+ */
61
+ calm?: boolean;
62
+
63
+ /**
64
+ * Explicit delay in milliseconds before the announcement is posted.
65
+ * In `calm` mode the service manages its own timing; this is ignored.
66
+ * Default: `0`
67
+ */
68
+ delayMs?: number;
69
+
70
+ /**
71
+ * iOS-only speech characteristics. No-op on Android.
72
+ * Only relevant in direct mode (`calm: false`).
73
+ */
74
+ speech?: {
75
+ /**
76
+ * BCP-47 language tag (e.g. `'fr-FR'`). Defaults to the system language.
77
+ * @platform ios
78
+ */
79
+ language?: string;
80
+
81
+ /**
82
+ * Voice pitch multiplier, range `0.0`–`2.0`. Default: `1.0`.
83
+ * @platform ios
84
+ */
85
+ pitch?: number;
86
+
87
+ /**
88
+ * Spell each character individually.
89
+ * Useful for codes, CAPTCHAs, or abbreviations.
90
+ * @platform ios
91
+ */
92
+ spellOut?: boolean;
93
+
94
+ /**
95
+ * Read punctuation marks aloud (e.g. "comma", "period").
96
+ * @platform ios
97
+ */
98
+ punctuation?: boolean;
99
+
100
+ /**
101
+ * IPA pronunciation hint applied to the entire string.
102
+ * @platform ios
103
+ */
104
+ ipaNotation?: string;
105
+ };
106
+ };
107
+
108
+ export type AnnouncementResult = {
109
+ /** UUID assigned at enqueue time. */
110
+ id: string;
111
+ /**
112
+ * - `'spoken'` — VoiceOver confirmed full speech (iOS direct mode only).
113
+ * - `'fired'` — posted to the screen reader; completion not confirmed.
114
+ * Always the case on Android. iOS calm mode resolves here
115
+ * once the service actually fires the announcement.
116
+ * - `'cancelled'` — explicitly cancelled via `cancel()` or `cancelAll()`.
117
+ */
118
+ status: AnnounceStatus;
119
+ };
120
+
121
+ // ─── Core API ─────────────────────────────────────────────────────────────────
122
+
123
+ /**
124
+ * Posts a screen reader announcement.
125
+ *
126
+ * **calm mode** (`calm: true`): navigation-aware — waits for transitions to
127
+ * settle and for VoiceOver/TalkBack to have a focused element. Promise
128
+ * resolves when the announcement is **actually fired** (not just enqueued).
129
+ *
130
+ * **direct mode** (`calm: false`, default): posts immediately with speech
131
+ * attributes. On iOS, Promise resolves when VoiceOver confirms speech finished
132
+ * (`status: 'spoken'`) or was interrupted (`status: 'fired'`).
133
+ * On Android, always resolves immediately with `status: 'fired'`.
134
+ */
135
+ export function announce(
136
+ message: string,
137
+ options?: AnnounceOptions
138
+ ): Promise<AnnouncementResult> {
139
+ const { speech, ...rest } = options ?? {};
140
+ return A11yAnnounceProxy!.announce(message, {
141
+ ...rest,
142
+ ...speech,
143
+ }) as Promise<AnnouncementResult>;
28
144
  }
29
145
 
30
- export const A11yModule = {
31
- announce,
146
+ /**
147
+ * Cancels the announcement with the given `id`.
148
+ * In calm mode, removes it from the service queue if not yet fired.
149
+ * In direct mode, interrupts the active announcement if it matches.
150
+ */
151
+ export function cancel(id: string): Promise<AnnouncementResult> {
152
+ return A11yAnnounceProxy!.cancel(id) as Promise<AnnouncementResult>;
153
+ }
154
+
155
+ /**
156
+ * Cancels all pending and active announcements.
157
+ * Calm-mode promises resolve with `status: 'cancelled'`.
158
+ */
159
+ export function cancelAll(): Promise<AnnouncementResult> {
160
+ return A11yAnnounceProxy!.cancelAll() as Promise<AnnouncementResult>;
161
+ }
162
+
163
+ // ─── Namespace export (backward-compatible) ───────────────────────────────────
164
+
165
+ export const ScreenReader = {
166
+ /**
167
+ * Posts a navigation-aware announcement (calm mode).
168
+ * Waits for transitions to finish before speaking.
169
+ * Promise resolves when the announcement is actually fired.
170
+ */
171
+ announce: (message: string, options?: AnnounceOptions) =>
172
+ announce(message, { calm: true, ...options }),
173
+
174
+ cancel,
175
+ cancelAll,
32
176
  };
@@ -2,8 +2,8 @@ import type { ViewProps } from 'react-native';
2
2
  // eslint-disable-next-line @react-native/no-deep-imports
3
3
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4
4
 
5
- export interface A11yGroupNativeComponentProps extends ViewProps {}
5
+ export interface A11yCardNativeComponentProps extends ViewProps {}
6
6
 
7
- export default codegenNativeComponent<A11yGroupNativeComponentProps>(
8
- 'A11yGroupView'
7
+ export default codegenNativeComponent<A11yCardNativeComponentProps>(
8
+ 'A11yCardView'
9
9
  );
@@ -15,14 +15,22 @@ export type ScreenReaderFocusChange = Readonly<{
15
15
 
16
16
  export type ScreenReaderDescendantFocusChanged = Readonly<{
17
17
  status: string;
18
+ nativeId?: string;
18
19
  }>;
19
20
 
20
21
  export interface A11yIndexNativeComponentProps extends ViewProps {
21
- orderIndex: Int32;
22
- orderKey: string;
23
- orderFocusType: Int32;
22
+ orderIndex?: Int32;
23
+ orderKey?: string;
24
+ orderFocusType?: Int32;
25
+ shouldGroupAccessibilityChildren?: Int32;
24
26
 
27
+ descendantFocusChangedEnabled?: boolean;
28
+
29
+ onScreenReaderFocused?: DirectEventHandler<{}>;
30
+ onScreenReaderDescendantFocusChanged?: DirectEventHandler<ScreenReaderDescendantFocusChanged>;
25
31
  onScreenReaderFocusChange?: DirectEventHandler<ScreenReaderFocusChange>;
32
+
33
+ containerType?: Int32;
26
34
  }
27
35
 
28
36
  export interface NativeCommands {
@@ -1,8 +1,38 @@
1
1
  import type { TurboModule } from 'react-native';
2
2
  import { TurboModuleRegistry } from 'react-native';
3
3
 
4
+ // Speech options are kept flat here (bridge contract).
5
+ // The JS API groups them under `speech: {}` and flattens before calling native.
6
+ type AnnounceOptions = Readonly<{
7
+ priority?: string;
8
+ queue?: boolean;
9
+ calm?: boolean;
10
+ delayMs?: number;
11
+ language?: string;
12
+ pitch?: number;
13
+ spellOut?: boolean;
14
+ punctuation?: boolean;
15
+ ipaNotation?: string;
16
+ }>;
17
+
18
+ type AnnouncementResult = Readonly<{
19
+ id: string;
20
+ // 'spoken' — VoiceOver confirmed full speech (iOS direct only)
21
+ // 'fired' — posted to screen reader; no completion confirmation
22
+ // 'cancelled' — explicitly cancelled via cancel() / cancelAll()
23
+ status: string;
24
+ }>;
25
+
4
26
  export interface Spec extends TurboModule {
5
- announce(message: string): void;
27
+ /** Enqueues a screen reader announcement. Resolves with AnnouncementResult. */
28
+ announce(
29
+ message: string,
30
+ options?: AnnounceOptions
31
+ ): Promise<AnnouncementResult>;
32
+ /** Cancels a specific announcement by its id. Resolves with the cancelled item's result. */
33
+ cancel(id: string): Promise<AnnouncementResult>;
34
+ /** Drains the queue and interrupts current speech. */
35
+ cancelAll(): Promise<AnnouncementResult>;
6
36
  }
7
37
 
8
38
  export default TurboModuleRegistry.get<Spec>('A11yAnnounceModule');
@@ -1,25 +0,0 @@
1
- package com.a11yorder.views.A11yGroupView;
2
-
3
- import android.view.ViewGroup;
4
-
5
- import androidx.annotation.NonNull;
6
-
7
- import com.a11yorder.A11yGroupViewManagerSpec;
8
- import com.facebook.react.uimanager.ThemedReactContext;
9
- import com.facebook.react.views.view.ReactViewGroup;
10
-
11
- public class A11yGroupViewManager extends A11yGroupViewManagerSpec<ViewGroup> {
12
- public static final String REACT_CLASS = "A11yGroupView";
13
-
14
- @NonNull
15
- @Override
16
- public String getName() {
17
- return REACT_CLASS;
18
- }
19
-
20
- @NonNull
21
- @Override
22
- protected ReactViewGroup createViewInstance(@NonNull ThemedReactContext context) {
23
- return new ReactViewGroup(context);
24
- }
25
- }
@@ -1,30 +0,0 @@
1
- package com.a11yorder.views.A11yUIContainerView;
2
-
3
- import android.view.ViewGroup;
4
-
5
- import androidx.annotation.NonNull;
6
-
7
- import com.a11yorder.A11yUIContainerViewManagerSpec;
8
- import com.facebook.react.uimanager.ThemedReactContext;
9
- import com.facebook.react.views.view.ReactViewGroup;
10
-
11
- public class A11yUIContainerViewManager extends A11yUIContainerViewManagerSpec<ViewGroup> {
12
- public static final String REACT_CLASS = "A11yUIContainer";
13
-
14
- @NonNull
15
- @Override
16
- public String getName() {
17
- return REACT_CLASS;
18
- }
19
-
20
- @NonNull
21
- @Override
22
- protected ReactViewGroup createViewInstance(@NonNull ThemedReactContext context) {
23
- return new ReactViewGroup(context);
24
- }
25
-
26
- @Override
27
- public void setContainerType(ViewGroup view, int value) {
28
- //stub
29
- }
30
- }