react-native-a11y-order 0.9.1 → 0.11.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -345
- package/android/src/main/java/com/a11yorder/A11yOrderPackage.java +2 -6
- package/android/src/main/java/com/a11yorder/core/A11yAutoFocusView.java +61 -0
- package/android/src/main/java/com/a11yorder/{views/A11yView/A11yView.java → core/A11yScreenReaderView.java} +3 -45
- package/android/src/main/java/com/a11yorder/core/A11yViewOrder.java +37 -0
- package/android/src/main/java/com/a11yorder/views/A11yCardView/A11yCardViewManager.java +18 -0
- package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexView.java +2 -65
- package/android/src/main/java/com/a11yorder/views/A11yIndexView/A11yIndexViewManager.java +27 -0
- package/android/src/newarch/A11yCardViewManagerSpec.java +9 -0
- package/android/src/oldarch/A11yCardViewManagerSpec.java +8 -0
- package/android/src/oldarch/A11yIndexViewManagerSpec.java +9 -0
- package/ios/helpers/RNAOFabricEventHelper/RNAOFabricEventHelper.mm +5 -5
- package/ios/views/RNAOA11yCardView/RNAOA11yCardView.h +29 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardView.mm +83 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.h +14 -0
- package/ios/views/RNAOA11yCardView/RNAOA11yCardViewManager.mm +17 -0
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.h +2 -41
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexView.mm +27 -127
- package/ios/views/RNAOA11yIndexView/RNAOA11yIndexViewManager.mm +21 -0
- package/ios/views/base/RNAOA11yAutoFocusView.h +30 -0
- package/ios/views/{RNAOA11yView/RNAOA11yView.mm → base/RNAOA11yAutoFocusView.mm} +66 -168
- package/ios/views/base/RNAOA11yGroupChildrenView.h +21 -0
- package/ios/views/base/RNAOA11yGroupChildrenView.mm +19 -0
- package/ios/views/base/RNAOA11yScreenReaderView.h +24 -0
- package/ios/views/base/RNAOA11yScreenReaderView.mm +32 -0
- package/ios/views/base/RNAOA11yViewGroup.h +35 -0
- package/ios/views/base/RNAOA11yViewGroup.mm +46 -0
- package/ios/views/base/RNAOA11yViewOrder.h +40 -0
- package/ios/views/base/RNAOA11yViewOrder.mm +92 -0
- package/lib/commonjs/components/A11yCard/A11yCard.ios.js +49 -0
- package/lib/commonjs/components/A11yCard/A11yCard.ios.js.map +1 -0
- package/lib/commonjs/components/A11yCard/A11yCard.js +41 -0
- package/lib/commonjs/components/A11yCard/A11yCard.js.map +1 -0
- package/lib/commonjs/{types/A11yGroup.types.js → components/A11yCard/A11yCard.types.js} +1 -1
- package/lib/commonjs/components/A11yCard/A11yCard.types.js.map +1 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.js +88 -28
- package/lib/commonjs/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/commonjs/components/A11yIndex/A11yIndex.types.js +39 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.types.js.map +1 -0
- package/lib/commonjs/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/commonjs/components/A11yLock/A11yLock.types.js.map +1 -0
- package/lib/commonjs/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +3 -3
- package/lib/commonjs/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/commonjs/{types/A11yModule.types.js → components/A11yOrder/A11yOrder.types.js} +1 -1
- package/lib/commonjs/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js +6 -0
- package/lib/commonjs/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
- package/lib/commonjs/components/A11yView/A11yView.js +7 -33
- package/lib/commonjs/components/A11yView/A11yView.js.map +1 -1
- package/lib/commonjs/components/A11yView/A11yView.types.js.map +1 -0
- package/lib/commonjs/index.js +17 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +10 -4
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/nativeSpecs/{A11yGroupNativeComponent.ts → A11yCardNativeComponent.ts} +3 -3
- package/lib/commonjs/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/lib/module/components/A11yCard/A11yCard.ios.js +43 -0
- package/lib/module/components/A11yCard/A11yCard.ios.js.map +1 -0
- package/lib/module/components/A11yCard/A11yCard.js +35 -0
- package/lib/module/components/A11yCard/A11yCard.js.map +1 -0
- package/lib/module/components/A11yCard/A11yCard.types.js +4 -0
- package/lib/module/components/A11yCard/A11yCard.types.js.map +1 -0
- package/lib/module/components/A11yIndex/A11yIndex.js +88 -28
- package/lib/module/components/A11yIndex/A11yIndex.js.map +1 -1
- package/lib/module/components/A11yIndex/A11yIndex.types.js +35 -0
- package/lib/module/components/A11yIndex/A11yIndex.types.js.map +1 -0
- package/lib/module/components/A11yIndex/A11yIndex.web.js.map +1 -1
- package/lib/module/components/A11yLock/A11yFocusFrame/A11yFocusFrame.js.map +1 -1
- package/lib/module/components/A11yLock/A11yFocusTrap/A11yFocusTrap.js.map +1 -1
- package/lib/module/components/A11yLock/A11yLock.types.js.map +1 -0
- package/lib/module/components/{A11ySequence/A11ySequence.js → A11yOrder/A11yOrder.js} +2 -2
- package/lib/module/components/A11yOrder/A11yOrder.js.map +1 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js +4 -0
- package/lib/module/components/A11yOrder/A11yOrder.types.js.map +1 -0
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js +6 -7
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.js.map +1 -1
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js +4 -0
- package/lib/module/components/A11yPaneTitle/A11yPaneTitle.types.js.map +1 -0
- package/lib/module/components/A11yView/A11yView.js +7 -31
- package/lib/module/components/A11yView/A11yView.js.map +1 -1
- package/lib/module/components/A11yView/A11yView.types.js.map +1 -0
- package/lib/module/index.js +12 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +4 -4
- package/lib/module/index.web.js.map +1 -1
- package/{src/nativeSpecs/A11yGroupNativeComponent.ts → lib/module/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
- package/lib/module/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/lib/typescript/src/components/A11yCard/A11yCard.d.ts +5 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts +5 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.ios.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts +14 -0
- package/lib/typescript/src/components/A11yCard/A11yCard.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts +15 -10
- package/lib/typescript/src/components/A11yIndex/A11yIndex.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts +83 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts +14 -10
- package/lib/typescript/src/components/A11yIndex/A11yIndex.web.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yBaseLock/A11yBaseLock.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts +2 -2
- package/lib/typescript/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts +2 -2
- package/lib/typescript/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts +31 -0
- package/lib/typescript/src/components/A11yLock/A11yLock.types.d.ts.map +1 -0
- package/lib/typescript/src/components/{A11ySequence/A11ySequence.d.ts → A11yOrder/A11yOrder.d.ts} +4 -2
- package/lib/typescript/src/components/A11yOrder/A11yOrder.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts +11 -0
- package/lib/typescript/src/components/A11yOrder/A11yOrder.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts +3 -17
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts +43 -0
- package/lib/typescript/src/components/A11yPaneTitle/A11yPaneTitle.types.d.ts.map +1 -0
- package/lib/typescript/src/components/A11yView/A11yView.d.ts +13 -6
- package/lib/typescript/src/components/A11yView/A11yView.d.ts.map +1 -1
- package/lib/typescript/src/components/A11yView/A11yView.types.d.ts +10 -0
- package/lib/typescript/src/components/A11yView/A11yView.types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +32 -36
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +22 -22
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts +8 -0
- package/lib/typescript/src/nativeSpecs/A11yCardNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts +10 -3
- package/lib/typescript/src/nativeSpecs/A11yIndexNativeComponent.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/components/A11yCard/A11yCard.ios.tsx +44 -0
- package/src/components/A11yCard/A11yCard.tsx +35 -0
- package/src/components/A11yCard/A11yCard.types.ts +39 -0
- package/src/components/A11yIndex/A11yIndex.tsx +144 -52
- package/src/components/A11yIndex/A11yIndex.types.ts +102 -0
- package/src/components/A11yIndex/A11yIndex.web.tsx +12 -17
- package/src/components/A11yLock/A11yBaseLock/A11yBaseLock.tsx +1 -1
- package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.android.tsx +1 -1
- package/src/components/A11yLock/A11yFocusFrame/A11yFocusFrame.tsx +3 -2
- package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.android.tsx +1 -1
- package/src/components/A11yLock/A11yFocusTrap/A11yFocusTrap.tsx +2 -2
- package/src/components/A11yLock/A11yLock.types.ts +34 -0
- package/src/components/{A11ySequence/A11ySequence.tsx → A11yOrder/A11yOrder.tsx} +4 -2
- package/src/components/A11yOrder/A11yOrder.types.ts +11 -0
- package/src/components/A11yPaneTitle/A11yPaneTitle.tsx +13 -19
- package/src/components/A11yPaneTitle/A11yPaneTitle.types.ts +49 -0
- package/src/components/A11yView/A11yView.tsx +8 -63
- package/src/components/A11yView/A11yView.types.ts +11 -0
- package/src/index.ts +26 -19
- package/src/index.web.ts +6 -13
- package/{lib/module/nativeSpecs/A11yGroupNativeComponent.ts → src/nativeSpecs/A11yCardNativeComponent.ts} +3 -3
- package/src/nativeSpecs/A11yIndexNativeComponent.ts +12 -3
- package/android/src/main/java/com/a11yorder/views/A11yGroupView/A11yGroupViewManager.java +0 -25
- package/android/src/main/java/com/a11yorder/views/A11yUIContainerView/A11yUIContainerViewManager.java +0 -30
- package/android/src/main/java/com/a11yorder/views/A11yView/A11yViewManager.java +0 -67
- package/android/src/newarch/A11yGroupViewManagerSpec.java +0 -9
- package/android/src/newarch/A11yUIContainerViewManagerSpec.java +0 -8
- package/android/src/newarch/A11yViewSpec.java +0 -13
- package/android/src/oldarch/A11yGroupViewManagerSpec.java +0 -8
- package/android/src/oldarch/A11yUIContainerViewManagerSpec.java +0 -9
- package/android/src/oldarch/A11yViewSpec.java +0 -18
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.h +0 -37
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupView.mm +0 -67
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.h +0 -18
- package/ios/views/RNAOA11yGroupView/RNAOA11yGroupViewManager.mm +0 -25
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.h +0 -35
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerView.mm +0 -79
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.h +0 -18
- package/ios/views/RNAOA11yUIContainerView/RNAOA11yUIContainerViewManager.mm +0 -27
- package/ios/views/RNAOA11yView/RNAOA11yView.h +0 -45
- package/ios/views/RNAOA11yView/RNAOA11yViewManager.h +0 -14
- package/ios/views/RNAOA11yView/RNAOA11yViewManager.mm +0 -53
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js +0 -18
- package/lib/commonjs/components/A11yGroup/A11yGroup.android.js.map +0 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js +0 -24
- package/lib/commonjs/components/A11yGroup/A11yGroup.ios.js.map +0 -1
- package/lib/commonjs/components/A11yGroup/A11yGroup.js +0 -9
- package/lib/commonjs/components/A11yGroup/A11yGroup.js.map +0 -1
- package/lib/commonjs/components/A11ySequence/A11ySequence.js.map +0 -1
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js +0 -22
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js +0 -9
- package/lib/commonjs/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
- package/lib/commonjs/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/lib/commonjs/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/lib/commonjs/types/A11yGroup.types.js.map +0 -1
- package/lib/commonjs/types/A11yIndex.types.js +0 -13
- package/lib/commonjs/types/A11yIndex.types.js.map +0 -1
- package/lib/commonjs/types/A11yLock.types.js.map +0 -1
- package/lib/commonjs/types/A11yModule.types.js.map +0 -1
- package/lib/commonjs/types/A11yUIContainerView.types.js +0 -15
- package/lib/commonjs/types/A11yUIContainerView.types.js.map +0 -1
- package/lib/commonjs/types/A11yView.types.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.android.js +0 -12
- package/lib/module/components/A11yGroup/A11yGroup.android.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.ios.js +0 -18
- package/lib/module/components/A11yGroup/A11yGroup.ios.js.map +0 -1
- package/lib/module/components/A11yGroup/A11yGroup.js +0 -5
- package/lib/module/components/A11yGroup/A11yGroup.js.map +0 -1
- package/lib/module/components/A11ySequence/A11ySequence.js.map +0 -1
- package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js +0 -17
- package/lib/module/components/A11yUIContainer/A11yUIContainer.ios.js.map +0 -1
- package/lib/module/components/A11yUIContainer/A11yUIContainer.js +0 -5
- package/lib/module/components/A11yUIContainer/A11yUIContainer.js.map +0 -1
- package/lib/module/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/lib/module/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/lib/module/types/A11yGroup.types.js +0 -4
- package/lib/module/types/A11yGroup.types.js.map +0 -1
- package/lib/module/types/A11yIndex.types.js +0 -9
- package/lib/module/types/A11yIndex.types.js.map +0 -1
- package/lib/module/types/A11yLock.types.js.map +0 -1
- package/lib/module/types/A11yModule.types.js +0 -4
- package/lib/module/types/A11yModule.types.js.map +0 -1
- package/lib/module/types/A11yUIContainerView.types.js +0 -11
- package/lib/module/types/A11yUIContainerView.types.js.map +0 -1
- package/lib/module/types/A11yView.types.js.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts +0 -4
- package/lib/typescript/src/components/A11yGroup/A11yGroup.android.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts +0 -3
- package/lib/typescript/src/components/A11yGroup/A11yGroup.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts +0 -4
- package/lib/typescript/src/components/A11yGroup/A11yGroup.ios.d.ts.map +0 -1
- package/lib/typescript/src/components/A11ySequence/A11ySequence.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts +0 -3
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts +0 -4
- package/lib/typescript/src/components/A11yUIContainer/A11yUIContainer.ios.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts +0 -8
- package/lib/typescript/src/nativeSpecs/A11yGroupNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts +0 -10
- package/lib/typescript/src/nativeSpecs/A11yUIContainerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts +0 -26
- package/lib/typescript/src/nativeSpecs/A11yViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yGroup.types.d.ts +0 -7
- package/lib/typescript/src/types/A11yGroup.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yIndex.types.d.ts +0 -19
- package/lib/typescript/src/types/A11yIndex.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yLock.types.d.ts +0 -8
- package/lib/typescript/src/types/A11yLock.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yModule.types.d.ts +0 -7
- package/lib/typescript/src/types/A11yModule.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yUIContainerView.types.d.ts +0 -13
- package/lib/typescript/src/types/A11yUIContainerView.types.d.ts.map +0 -1
- package/lib/typescript/src/types/A11yView.types.d.ts +0 -12
- package/lib/typescript/src/types/A11yView.types.d.ts.map +0 -1
- package/src/components/A11yGroup/A11yGroup.android.tsx +0 -8
- package/src/components/A11yGroup/A11yGroup.ios.tsx +0 -11
- package/src/components/A11yGroup/A11yGroup.tsx +0 -5
- package/src/components/A11yUIContainer/A11yUIContainer.ios.tsx +0 -20
- package/src/components/A11yUIContainer/A11yUIContainer.tsx +0 -5
- package/src/nativeSpecs/A11yUIContainerNativeComponent.ts +0 -12
- package/src/nativeSpecs/A11yViewNativeComponent.ts +0 -36
- package/src/types/A11yGroup.types.ts +0 -9
- package/src/types/A11yIndex.types.ts +0 -21
- package/src/types/A11yLock.types.ts +0 -8
- package/src/types/A11yModule.types.ts +0 -7
- package/src/types/A11yUIContainerView.types.ts +0 -15
- package/src/types/A11yView.types.ts +0 -19
- /package/lib/commonjs/{types → components/A11yLock}/A11yLock.types.js +0 -0
- /package/lib/commonjs/{types → components/A11yView}/A11yView.types.js +0 -0
- /package/lib/module/{types → components/A11yLock}/A11yLock.types.js +0 -0
- /package/lib/module/{types → components/A11yView}/A11yView.types.js +0 -0
|
@@ -1,189 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
// RNAOA11yView.m
|
|
3
|
-
// boost-boost_privacy
|
|
4
|
-
//
|
|
5
|
-
// Created by Artur Kalach on 17/08/2025.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
#import <UIKit/UIKit.h>
|
|
11
|
-
#import <React/RCTViewManager.h>
|
|
12
|
-
#import "RNAOA11yView.h"
|
|
13
|
-
#import "UIView+RNAOA11yOrder.h"
|
|
14
|
-
#import "RNAOScreenReaderFocusDelegate.h"
|
|
1
|
+
#import "RNAOA11yAutoFocusView.h"
|
|
15
2
|
#import "RNAOViewItemDelegate.h"
|
|
16
|
-
#import "RNAOA11yFocusService.h"
|
|
17
|
-
#import <React/UIView+React.h>
|
|
18
3
|
|
|
19
4
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
|
-
|
|
21
|
-
#include <string>
|
|
22
|
-
#import <react/renderer/components/RNA11yOrderSpec/ComponentDescriptors.h>
|
|
23
|
-
#import <react/renderer/components/RNA11yOrderSpec/EventEmitters.h>
|
|
24
|
-
#import <react/renderer/components/RNA11yOrderSpec/Props.h>
|
|
25
|
-
#import <react/renderer/components/RNA11yOrderSpec/RCTComponentViewHelpers.h>
|
|
26
|
-
#import "RCTFabricComponentsPlugins.h"
|
|
27
|
-
#import "RNAOPropsHelper.h"
|
|
28
5
|
#import "RNAOFabricEventHelper.h"
|
|
29
|
-
|
|
30
|
-
using namespace facebook::react;
|
|
31
|
-
|
|
32
|
-
@interface RNAOA11yView () <RCTA11yViewViewProtocol>
|
|
33
|
-
|
|
34
|
-
@end
|
|
35
|
-
|
|
36
6
|
#endif
|
|
37
7
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@implementation RNAOA11yView {
|
|
8
|
+
@implementation RNAOA11yAutoFocusView {
|
|
41
9
|
BOOL _needsAutoFocus;
|
|
42
|
-
RNAOViewItemDelegate* _viewDelegate;
|
|
43
10
|
BOOL _descendantFocusChangedEnabled;
|
|
11
|
+
RNAOViewItemDelegate* _viewDelegate;
|
|
44
12
|
}
|
|
45
13
|
|
|
14
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
46
15
|
|
|
47
|
-
- (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
[[RNAOA11yFocusService sharedService] unsubscribe:self];
|
|
16
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
17
|
+
if (self = [super initWithFrame:frame]) {
|
|
18
|
+
_needsAutoFocus = YES;
|
|
19
|
+
_descendantFocusChangedEnabled = NO;
|
|
20
|
+
_viewDelegate = [[RNAOViewItemDelegate alloc] initWithView: self];
|
|
55
21
|
}
|
|
22
|
+
return self;
|
|
56
23
|
}
|
|
57
24
|
|
|
58
|
-
- (
|
|
59
|
-
return _descendantFocusChangedEnabled;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
63
|
-
- (void)prepareForRecycle
|
|
64
|
-
{
|
|
25
|
+
- (void)prepareForRecycle {
|
|
65
26
|
[super prepareForRecycle];
|
|
66
27
|
_needsAutoFocus = YES;
|
|
67
28
|
_autoFocus = NO;
|
|
68
29
|
[_viewDelegate prepareForRecycle];
|
|
69
30
|
}
|
|
70
31
|
|
|
71
|
-
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
72
|
-
{
|
|
73
|
-
return concreteComponentDescriptorProvider<A11yViewComponentDescriptor>();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
32
|
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
77
33
|
[super finalizeUpdates:updateMask];
|
|
78
34
|
[_viewDelegate finalizeUpdates];
|
|
79
35
|
}
|
|
80
36
|
|
|
81
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
82
|
-
{
|
|
83
|
-
if (self = [super initWithFrame:frame]) {
|
|
84
|
-
static const auto defaultProps = std::make_shared<const A11yViewProps>();
|
|
85
|
-
_props = defaultProps;
|
|
86
|
-
_needsAutoFocus = YES;
|
|
87
|
-
_descendantFocusChangedEnabled = NO;
|
|
88
|
-
_viewDelegate = [[RNAOViewItemDelegate alloc] initWithView: self];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return self;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
95
|
-
{
|
|
96
|
-
const auto &oldViewProps = *std::static_pointer_cast<A11yViewProps const>(_props);
|
|
97
|
-
const auto &newViewProps = *std::static_pointer_cast<A11yViewProps const>(props);
|
|
98
|
-
[super updateProps
|
|
99
|
-
:props oldProps:oldProps];
|
|
100
|
-
|
|
101
|
-
if (_autoFocus != newViewProps.autoFocus) {
|
|
102
|
-
[self setAutoFocus: newViewProps.autoFocus];
|
|
103
|
-
}
|
|
104
|
-
if (_descendantFocusChangedEnabled != newViewProps.descendantFocusChangedEnabled) {
|
|
105
|
-
[self setDescendantFocusChangedEnabled: newViewProps.descendantFocusChangedEnabled];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
|
|
112
|
-
NSString *FOCUS = @"focus";
|
|
113
|
-
if([commandName isEqual:FOCUS]) {
|
|
114
|
-
[self focusView];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
119
|
-
{
|
|
120
|
-
return RNAOA11yView.class;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
37
|
#else
|
|
124
38
|
|
|
125
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
126
|
-
{
|
|
39
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
127
40
|
if (self = [super initWithFrame:frame]) {
|
|
128
41
|
_needsAutoFocus = YES;
|
|
129
42
|
_viewDelegate = [[RNAOViewItemDelegate alloc] initWithView: self];
|
|
130
43
|
}
|
|
131
|
-
|
|
132
44
|
return self;
|
|
133
45
|
}
|
|
134
46
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
139
|
-
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
140
|
-
[RNAOFabricEventHelper onA11yViewFocusChange:isFocused withEmitter:_eventEmitter];
|
|
141
|
-
}
|
|
142
|
-
#else
|
|
143
|
-
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
144
|
-
if (self.onScreenReaderFocusChange) {
|
|
145
|
-
self.onScreenReaderFocusChange(@{@"isFocused" : @(isFocused)});
|
|
146
|
-
}
|
|
47
|
+
- (void)layoutSubviews {
|
|
48
|
+
[super layoutSubviews];
|
|
49
|
+
[_viewDelegate layoutSubviews];
|
|
147
50
|
}
|
|
148
|
-
#endif
|
|
149
51
|
|
|
150
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
151
|
-
- (void)onScreenReaderDescendantFocusChangedHandler:(BOOL)isFocused withId:(NSString*) nativeId{
|
|
152
|
-
NSString* status = isFocused ? @"focused" : @"blurred";
|
|
153
|
-
[RNAOFabricEventHelper onA11yViewScreenReaderDescendantFocusChanged:status withId:nativeId withEmitter:_eventEmitter];
|
|
154
|
-
}
|
|
155
|
-
#else
|
|
156
|
-
- (void)onScreenReaderDescendantFocusChangedHandler:(BOOL)isFocused withId:(NSString*) nativeId{
|
|
157
|
-
if (self.onScreenReaderDescendantFocusChanged) {
|
|
158
|
-
NSString* status = isFocused ? @"focused" : @"blurred";
|
|
159
|
-
self.onScreenReaderDescendantFocusChanged(@{@"status": status, @"nativeId": nativeId});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
52
|
#endif
|
|
163
53
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
self.onScreenReaderFocused(@{});
|
|
54
|
+
- (void)setDescendantFocusChangedEnabled:(BOOL)descendantFocusChangedEnabled {
|
|
55
|
+
_descendantFocusChangedEnabled = descendantFocusChangedEnabled;
|
|
56
|
+
if (_descendantFocusChangedEnabled) {
|
|
57
|
+
if (self.superview) {
|
|
58
|
+
[[RNAOA11yFocusService sharedService] subscribe:self];
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
[[RNAOA11yFocusService sharedService] unsubscribe:self];
|
|
173
62
|
}
|
|
174
63
|
}
|
|
175
|
-
#endif
|
|
176
64
|
|
|
177
|
-
- (
|
|
178
|
-
|
|
179
|
-
[self onScreenReaderFocusedHandler];
|
|
65
|
+
- (BOOL)descendantFocusChangedEnabled {
|
|
66
|
+
return _descendantFocusChangedEnabled;
|
|
180
67
|
}
|
|
181
68
|
|
|
182
69
|
- (void)focusView {
|
|
183
70
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
184
71
|
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
185
72
|
});
|
|
186
|
-
|
|
187
73
|
}
|
|
188
74
|
|
|
189
75
|
- (void)focus {
|
|
@@ -192,9 +78,8 @@ Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
|
192
78
|
|
|
193
79
|
- (void)didMoveToWindow {
|
|
194
80
|
[super didMoveToWindow];
|
|
195
|
-
|
|
196
81
|
if (self.window) {
|
|
197
|
-
if(_needsAutoFocus && _autoFocus) {
|
|
82
|
+
if (_needsAutoFocus && _autoFocus) {
|
|
198
83
|
_needsAutoFocus = NO;
|
|
199
84
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
200
85
|
[self focusView];
|
|
@@ -205,7 +90,7 @@ Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
|
205
90
|
|
|
206
91
|
- (void)didMoveToSuperview {
|
|
207
92
|
[super didMoveToSuperview];
|
|
208
|
-
if (
|
|
93
|
+
if (_descendantFocusChangedEnabled && self.superview) {
|
|
209
94
|
[[RNAOA11yFocusService sharedService] subscribe:self];
|
|
210
95
|
}
|
|
211
96
|
}
|
|
@@ -215,9 +100,6 @@ Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
|
215
100
|
[super removeFromSuperview];
|
|
216
101
|
}
|
|
217
102
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
221
103
|
- (NSString*)getNativeId:(UIView*)element {
|
|
222
104
|
NSString* nativeId = nil;
|
|
223
105
|
@try {
|
|
@@ -225,14 +107,13 @@ Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
|
225
107
|
} @catch (NSException *exception) {
|
|
226
108
|
nativeId = nil;
|
|
227
109
|
}
|
|
228
|
-
|
|
229
110
|
return nativeId;
|
|
230
111
|
}
|
|
231
|
-
|
|
232
|
-
- (
|
|
233
|
-
|
|
112
|
+
|
|
113
|
+
- (void)accessibilityElementDidBecomeFocused {
|
|
114
|
+
[super accessibilityElementDidBecomeFocused];
|
|
115
|
+
[self onScreenReaderFocusedHandler];
|
|
234
116
|
}
|
|
235
|
-
#endif
|
|
236
117
|
|
|
237
118
|
- (void)accessibilityElementDidBecomeFocused:(UIView*)element {
|
|
238
119
|
NSString* nativeId = [self getNativeId: element];
|
|
@@ -244,34 +125,51 @@ Class<RCTComponentViewProtocol> A11yViewCls(void)
|
|
|
244
125
|
[self onScreenReaderDescendantFocusChangedHandler: false withId:nativeId];
|
|
245
126
|
}
|
|
246
127
|
|
|
247
|
-
|
|
248
|
-
- (void)
|
|
249
|
-
[
|
|
250
|
-
[_viewDelegate willRemoveSubview: subview];
|
|
128
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
129
|
+
- (void)onScreenReaderFocusedHandler {
|
|
130
|
+
[RNAOFabricEventHelper onA11yViewFocused: _eventEmitter];
|
|
251
131
|
}
|
|
252
|
-
|
|
253
|
-
- (void)
|
|
254
|
-
|
|
255
|
-
|
|
132
|
+
#else
|
|
133
|
+
- (void)onScreenReaderFocusedHandler {
|
|
134
|
+
if (self.onScreenReaderFocused) {
|
|
135
|
+
self.onScreenReaderFocused(@{});
|
|
136
|
+
}
|
|
256
137
|
}
|
|
138
|
+
#endif
|
|
257
139
|
|
|
258
|
-
#
|
|
259
|
-
- (void)
|
|
260
|
-
|
|
261
|
-
[
|
|
140
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
141
|
+
- (void)onScreenReaderDescendantFocusChangedHandler:(BOOL)isFocused withId:(NSString*)nativeId {
|
|
142
|
+
NSString* status = isFocused ? @"focused" : @"blurred";
|
|
143
|
+
[RNAOFabricEventHelper onA11yViewScreenReaderDescendantFocusChanged:status withId:nativeId withEmitter:_eventEmitter];
|
|
144
|
+
}
|
|
145
|
+
#else
|
|
146
|
+
- (void)onScreenReaderDescendantFocusChangedHandler:(BOOL)isFocused withId:(NSString*)nativeId {
|
|
147
|
+
if (self.onScreenReaderDescendantFocusChanged) {
|
|
148
|
+
NSString* status = isFocused ? @"focused" : @"blurred";
|
|
149
|
+
self.onScreenReaderDescendantFocusChanged(@{@"status": status, @"nativeId": nativeId});
|
|
150
|
+
}
|
|
262
151
|
}
|
|
263
152
|
#endif
|
|
264
153
|
|
|
265
|
-
|
|
266
|
-
|
|
154
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
155
|
+
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
156
|
+
[RNAOFabricEventHelper onA11yViewFocusChange:isFocused withEmitter:_eventEmitter];
|
|
157
|
+
}
|
|
158
|
+
#else
|
|
159
|
+
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
160
|
+
if (self.onScreenReaderFocusChange) {
|
|
161
|
+
self.onScreenReaderFocusChange(@{@"isFocused" : @(isFocused)});
|
|
162
|
+
}
|
|
267
163
|
}
|
|
164
|
+
#endif
|
|
268
165
|
|
|
269
|
-
- (void)
|
|
270
|
-
[
|
|
166
|
+
- (void)onChildAttached:(UIView*)child {
|
|
167
|
+
[_viewDelegate didAddSubview: child];
|
|
271
168
|
}
|
|
272
169
|
|
|
273
|
-
- (void)
|
|
274
|
-
[
|
|
170
|
+
- (void)willRemoveSubview:(UIView *)subview {
|
|
171
|
+
[super willRemoveSubview:subview];
|
|
172
|
+
[_viewDelegate willRemoveSubview: subview];
|
|
275
173
|
}
|
|
276
174
|
|
|
277
175
|
@end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef RNAOA11yGroupChildrenView_h
|
|
2
|
+
#define RNAOA11yGroupChildrenView_h
|
|
3
|
+
|
|
4
|
+
#import "RNAOA11yScreenReaderView.h"
|
|
5
|
+
|
|
6
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
// groupChildrenMode: -1 = defer to super (default), 0 = NO, 1 = YES
|
|
11
|
+
@interface RNAOA11yGroupChildrenView : RNAOA11yScreenReaderView
|
|
12
|
+
|
|
13
|
+
@property (nonatomic) int groupChildrenMode;
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif /* RNAOA11yGroupChildrenView_h */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#import "RNAOA11yGroupChildrenView.h"
|
|
2
|
+
|
|
3
|
+
@implementation RNAOA11yGroupChildrenView
|
|
4
|
+
|
|
5
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
6
|
+
if (self = [super initWithFrame:frame]) {
|
|
7
|
+
_groupChildrenMode = -1;
|
|
8
|
+
}
|
|
9
|
+
return self;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
- (BOOL)shouldGroupAccessibilityChildren {
|
|
13
|
+
if (_groupChildrenMode == -1) {
|
|
14
|
+
return [super shouldGroupAccessibilityChildren];
|
|
15
|
+
}
|
|
16
|
+
return (BOOL)_groupChildrenMode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#ifndef RNAOA11yScreenReaderView_h
|
|
2
|
+
#define RNAOA11yScreenReaderView_h
|
|
3
|
+
|
|
4
|
+
#import "RNAOA11yViewGroup.h"
|
|
5
|
+
#import "RNAOScreenReaderFocusDelegate.h"
|
|
6
|
+
#import "RNAOViewItemProtocol.h"
|
|
7
|
+
|
|
8
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNAOA11yScreenReaderView : RNAOA11yViewGroup<RNAOScreenReaderFocusDelegate, RNAOViewItemProtocol>
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_END
|
|
16
|
+
|
|
17
|
+
#else
|
|
18
|
+
|
|
19
|
+
@interface RNAOA11yScreenReaderView : RNAOA11yViewGroup<RNAOScreenReaderFocusDelegate, RNAOViewItemProtocol>
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
#endif /* RNAOA11yScreenReaderView_h */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#import "RNAOA11yScreenReaderView.h"
|
|
2
|
+
#import "UIView+RNAOA11yOrder.h"
|
|
3
|
+
|
|
4
|
+
@implementation RNAOA11yScreenReaderView
|
|
5
|
+
|
|
6
|
+
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {}
|
|
7
|
+
|
|
8
|
+
- (void)onFocusItemLinked:(UIView *)view {
|
|
9
|
+
[view setScreenReaderFocusDelegate: self];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
- (void)onFocusItemRemoved:(UIView *)view {
|
|
13
|
+
[view clearScreenReaderFocusDelegate];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
- (void)onScreenReaderFocusChanged:(BOOL)focused {
|
|
17
|
+
[self onScreenReaderFocusChangeHandler: focused];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
21
|
+
- (void)focusView {
|
|
22
|
+
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
|
|
26
|
+
if ([commandName isEqual:@"focus"]) {
|
|
27
|
+
[self focusView];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
@end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#ifndef RNAOA11yViewGroup_h
|
|
2
|
+
#define RNAOA11yViewGroup_h
|
|
3
|
+
|
|
4
|
+
#import <UIKit/UIKit.h>
|
|
5
|
+
|
|
6
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
+
#import <React/RCTViewComponentView.h>
|
|
8
|
+
|
|
9
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
10
|
+
|
|
11
|
+
@interface RNAOA11yViewGroup : RCTViewComponentView
|
|
12
|
+
|
|
13
|
+
- (nullable UIView*)getSubChild;
|
|
14
|
+
- (void)onChildAttached:(UIView*)child;
|
|
15
|
+
- (void)onChildRemoved;
|
|
16
|
+
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_END
|
|
20
|
+
|
|
21
|
+
#else
|
|
22
|
+
|
|
23
|
+
#import <React/RCTView.h>
|
|
24
|
+
|
|
25
|
+
@interface RNAOA11yViewGroup : RCTView
|
|
26
|
+
|
|
27
|
+
- (nullable UIView*)getSubChild;
|
|
28
|
+
- (void)onChildAttached:(UIView*)child;
|
|
29
|
+
- (void)onChildRemoved;
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
#endif /* RNAOA11yViewGroup_h */
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#import "RNAOA11yViewGroup.h"
|
|
2
|
+
|
|
3
|
+
@implementation RNAOA11yViewGroup {
|
|
4
|
+
__weak UIView* _subChild;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
- (nullable UIView*)getSubChild {
|
|
8
|
+
return _subChild;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
- (void)onChildAttached:(UIView*)child {}
|
|
12
|
+
- (void)onChildRemoved {}
|
|
13
|
+
|
|
14
|
+
- (void)setSubChildInternal:(nullable UIView*)child {
|
|
15
|
+
_subChild = child;
|
|
16
|
+
if (child != nil) {
|
|
17
|
+
[self onChildAttached: child];
|
|
18
|
+
} else {
|
|
19
|
+
[self onChildRemoved];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
- (void)didAddSubview:(UIView *)subview {
|
|
24
|
+
[super didAddSubview:subview];
|
|
25
|
+
if (_subChild == nil) {
|
|
26
|
+
[self setSubChildInternal: subview];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (void)willRemoveSubview:(UIView *)subview {
|
|
31
|
+
[super willRemoveSubview:subview];
|
|
32
|
+
if (_subChild == subview) {
|
|
33
|
+
[self setSubChildInternal: nil];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (void)didMoveToWindow {
|
|
38
|
+
[super didMoveToWindow];
|
|
39
|
+
if (self.window == nil) {
|
|
40
|
+
[self setSubChildInternal: nil];
|
|
41
|
+
} else if (_subChild == nil && self.subviews.count > 0) {
|
|
42
|
+
[self setSubChildInternal: self.subviews[0]];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#ifndef RNAOA11yViewOrder_h
|
|
2
|
+
#define RNAOA11yViewOrder_h
|
|
3
|
+
|
|
4
|
+
#import "RNAOA11yAutoFocusView.h"
|
|
5
|
+
|
|
6
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@interface RNAOA11yViewOrder : RNAOA11yAutoFocusView
|
|
11
|
+
|
|
12
|
+
- (void)setPosition:(NSNumber*)position;
|
|
13
|
+
- (void)setOrderKey:(NSString *)orderKey;
|
|
14
|
+
- (void)setOrderFocusType:(NSNumber *)orderFocusType;
|
|
15
|
+
|
|
16
|
+
- (nullable NSNumber*)delegatePosition;
|
|
17
|
+
- (nullable NSString*)delegateOrderKey;
|
|
18
|
+
- (nullable NSNumber*)delegateOrderFocusType;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
NS_ASSUME_NONNULL_END
|
|
23
|
+
|
|
24
|
+
#else
|
|
25
|
+
|
|
26
|
+
@interface RNAOA11yViewOrder : RNAOA11yAutoFocusView
|
|
27
|
+
|
|
28
|
+
- (void)setPosition:(NSNumber*)position;
|
|
29
|
+
- (void)setOrderKey:(NSString *)orderKey;
|
|
30
|
+
- (void)setOrderFocusType:(NSNumber *)orderFocusType;
|
|
31
|
+
|
|
32
|
+
- (nullable NSNumber*)delegatePosition;
|
|
33
|
+
- (nullable NSString*)delegateOrderKey;
|
|
34
|
+
- (nullable NSNumber*)delegateOrderFocusType;
|
|
35
|
+
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
#endif /* RNAOA11yViewOrder_h */
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#import "RNAOA11yViewOrder.h"
|
|
2
|
+
#import "RNAOA11yItemDelegate.h"
|
|
3
|
+
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import "RNAOFabricEventHelper.h"
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
@implementation RNAOA11yViewOrder {
|
|
9
|
+
RNAOA11yItemDelegate* _a11yItemDelegate;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
13
|
+
|
|
14
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
15
|
+
if (self = [super initWithFrame:frame]) {
|
|
16
|
+
_a11yItemDelegate = [[RNAOA11yItemDelegate alloc] initWithView: self];
|
|
17
|
+
}
|
|
18
|
+
return self;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
22
|
+
[super finalizeUpdates:updateMask];
|
|
23
|
+
[_a11yItemDelegate finalizeUpdates];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
- (void)prepareForRecycle {
|
|
27
|
+
[_a11yItemDelegate clear];
|
|
28
|
+
[super prepareForRecycle];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#else
|
|
32
|
+
|
|
33
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
34
|
+
if (self = [super initWithFrame:frame]) {
|
|
35
|
+
_a11yItemDelegate = [[RNAOA11yItemDelegate alloc] initWithView: self];
|
|
36
|
+
}
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
- (void)layoutSubviews {
|
|
41
|
+
[super layoutSubviews];
|
|
42
|
+
[_a11yItemDelegate finalizeUpdates];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
- (void)setPosition:(NSNumber*)position {
|
|
48
|
+
[_a11yItemDelegate setPosition: position];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (void)setOrderKey:(NSString *)orderKey {
|
|
52
|
+
[_a11yItemDelegate setOrderKey: orderKey];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
- (void)setOrderFocusType:(NSNumber *)orderFocusType {
|
|
56
|
+
[_a11yItemDelegate setOrderFocusType: orderFocusType];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (nullable NSNumber*)delegatePosition {
|
|
60
|
+
return _a11yItemDelegate.position;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (nullable NSString*)delegateOrderKey {
|
|
64
|
+
return _a11yItemDelegate.orderKey;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
- (nullable NSNumber*)delegateOrderFocusType {
|
|
68
|
+
return _a11yItemDelegate.orderFocusType;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
- (void)onChildAttached:(UIView*)child {
|
|
72
|
+
[_a11yItemDelegate didAddSubview: child];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (void)willRemoveSubview:(UIView *)subview {
|
|
76
|
+
[super willRemoveSubview:subview];
|
|
77
|
+
[_a11yItemDelegate willRemoveSubview: subview];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
81
|
+
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
82
|
+
[RNAOFabricEventHelper onIndexViewFocusChange:isFocused withEmitter:_eventEmitter];
|
|
83
|
+
}
|
|
84
|
+
#else
|
|
85
|
+
- (void)onScreenReaderFocusChangeHandler:(BOOL)isFocused {
|
|
86
|
+
if (self.onScreenReaderFocusChange) {
|
|
87
|
+
self.onScreenReaderFocusChange(@{@"isFocused" : @(isFocused)});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
#endif
|
|
91
|
+
|
|
92
|
+
@end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.A11yCard = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _A11yCardNativeComponent = _interopRequireDefault(require("../../nativeSpecs/A11yCardNativeComponent"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const A11yCard = ({
|
|
13
|
+
containerProps,
|
|
14
|
+
style,
|
|
15
|
+
testID,
|
|
16
|
+
onPress,
|
|
17
|
+
accessibility,
|
|
18
|
+
pressableProps,
|
|
19
|
+
children
|
|
20
|
+
}) => {
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_A11yCardNativeComponent.default, {
|
|
22
|
+
...containerProps,
|
|
23
|
+
style: [styles.container, containerProps?.style],
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
25
|
+
testID: `${testID}-overlay`,
|
|
26
|
+
accessibilityRole: "button",
|
|
27
|
+
...accessibility,
|
|
28
|
+
accessible: true,
|
|
29
|
+
pointerEvents: "none",
|
|
30
|
+
onAccessibilityTap: onPress,
|
|
31
|
+
style: styles.overlay
|
|
32
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
33
|
+
...pressableProps,
|
|
34
|
+
accessible: false,
|
|
35
|
+
onPress: onPress,
|
|
36
|
+
testID: testID,
|
|
37
|
+
style: style,
|
|
38
|
+
children: children
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.A11yCard = A11yCard;
|
|
43
|
+
const styles = _reactNative.StyleSheet.create({
|
|
44
|
+
container: {
|
|
45
|
+
position: 'relative'
|
|
46
|
+
},
|
|
47
|
+
overlay: _reactNative.StyleSheet.absoluteFillObject
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=A11yCard.ios.js.map
|