Skip to content

Commit 2e9ee68

Browse files
committed
Merge remote-tracking branch 'upstream/main' into production
2 parents bc321fe + c1939e7 commit 2e9ee68

22 files changed

Lines changed: 242 additions & 43 deletions

File tree

docs/accessibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,13 @@ When adding support for standard actions, `name` must be one of the following:
521521
- `'magicTap'` - iOS only - While VoiceOver focus is on or inside the component, the user double tapped with two fingers.
522522
- `'escape'` - iOS only - While VoiceOver focus is on or inside the component, the user performed a two-finger scrub gesture (left, right, left).
523523
- `'activate'` - Activate the component. This should perform the same action with, or without, assistive technology. Engaged when a screen reader user double taps the component.
524-
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-up button.
525-
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-down button.
524+
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, in TalkBack versions 8.1 and below, this action is generated when the user focuses the component and presses the volume-up button. In TalkBack 9.1 and later, this was replaced by the "Adjust Reading Control" gesture (swiping upward on the focused control).
525+
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, in TalkBack versions 8.2 and below, this action is generated when the user focuses the component and presses the volume-down button. In TalkBack 9.2 and later, this was replaced by the "Adjust Reading Control" gesture (swiping downward on the focused control).
526526
- `'longpress'` - Android only - This action is generated when the user places accessibility focus on the component, then double-taps and holds one finger on the screen. This should perform the same action with, or without, assistive technology.
527527
- `'expand'` - Android only - This action "expands" the component so that TalkBack will announce an "expanded" hint.
528528
- `'collapse'` - Android only - This action "collapses" the component so that TalkBack will announce a "collapsed" hint.
529529

530-
The `label` field is optional for standard actions and is often unused by assistive technologies. For custom actions, it is a localized string containing a description of the action to be presented to the user.
530+
The `label` field is optional for standard actions and is used by assistive technologies to describe the specific result of an action. For example, TalkBack uses this field to override the default "Double tap to activate" announcement with a custom description like "Double tap to open chat." For custom actions, the `label` is a localized string containing a description of the action to be presented to the user.
531531

532532
To handle action requests, a component must implement an `onAccessibilityAction` function. The only argument to this function is an event containing the name of the action to perform. The below example from RNTester shows how to create a component that defines and handles several custom actions.
533533

docs/linking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ If your app is using [Universal Links](https://developer.apple.com/ios/universal
8787
<TabItem value="swift">
8888
8989
```swift title="AppDelegate.swift"
90-
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
90+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
9191
return RCTLinkingManager.application(app, open: url, options: options)
9292
}
9393
```
9494

9595
If your app is using [Universal Links](https://developer.apple.com/ios/universal-links/), you'll need to add the following code as well:
9696

9797
```swift title="AppDelegate.swift"
98-
override func application(
98+
func application(
9999
_ application: UIApplication,
100100
continue userActivity: NSUserActivity,
101101
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@docusaurus/plugin-pwa": "3.10.1",
5757
"@docusaurus/preset-classic": "3.10.1",
5858
"@docusaurus/theme-mermaid": "3.10.1",
59+
"docusaurus-plugin-copy-page-button": "^0.6.2",
5960
"docusaurus-plugin-sass": "^0.2.6",
6061
"react": "^19.2.6",
6162
"react-dom": "^19.2.6",

website/src/css/customTheme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,18 @@
133133

134134
body {
135135
font-family: var(--ifm-font-family-base);
136+
scrollbar-gutter: stable;
136137
}
137138

138139
html[data-theme="light"] {
139140
--ifm-link-color: #357da1;
140141
}
141142

142143
html[data-theme="dark"] {
144+
body {
145+
scrollbar-color: var(--subtle) var(--ifm-background-color);
146+
}
147+
143148
--subtle: #858993;
144149

145150
--navbar-background: #20232aee;
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import React, {type ReactNode} from 'react';
9+
import clsx from 'clsx';
10+
import {useWindowSize} from '@docusaurus/theme-common';
11+
import {useDoc} from '@docusaurus/plugin-content-docs/client';
12+
import CopyPageButton from 'docusaurus-plugin-copy-page-button/react';
13+
import DocItemPaginator from '@theme/DocItem/Paginator';
14+
import DocVersionBanner from '@theme/DocVersionBanner';
15+
import DocVersionBadge from '@theme/DocVersionBadge';
16+
import DocItemFooter from '@theme/DocItem/Footer';
17+
import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
18+
import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
19+
import DocItemContent from '@theme/DocItem/Content';
20+
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
21+
import ContentVisibility from '@theme/ContentVisibility';
22+
import type {Props} from '@theme/DocItem/Layout';
23+
24+
import styles from './styles.module.css';
25+
26+
function DocItemCopyPageButton({className}: {className?: string}) {
27+
return (
28+
<div className={clsx(styles.copyPageAction, className)}>
29+
<CopyPageButton
30+
customStyles={{
31+
container: {className: styles.copyPageButtonContainer},
32+
button: {
33+
className: styles.copyPageButton,
34+
style: {marginBottom: 0},
35+
},
36+
dropdown: {className: styles.copyPageDropdown},
37+
}}
38+
/>
39+
</div>
40+
);
41+
}
42+
43+
/**
44+
* Decide if the toc should be rendered, on mobile or desktop viewports
45+
*/
46+
function useDocTOC() {
47+
const {frontMatter, toc} = useDoc();
48+
const windowSize = useWindowSize();
49+
50+
const hidden = frontMatter.hide_table_of_contents;
51+
const canRender = !hidden && toc.length > 0;
52+
53+
const mobile = canRender ? <DocItemTOCMobile /> : undefined;
54+
55+
const desktop =
56+
canRender && (windowSize === 'desktop' || windowSize === 'ssr') ? (
57+
<DocItemTOCDesktop />
58+
) : undefined;
59+
60+
return {
61+
canRender,
62+
hidden,
63+
mobile,
64+
desktop,
65+
};
66+
}
67+
68+
export default function DocItemLayout({children}: Props): ReactNode {
69+
const docTOC = useDocTOC();
70+
const {metadata} = useDoc();
71+
return (
72+
<div className="row">
73+
<div className={clsx('col', !docTOC.hidden && styles.docItemCol)}>
74+
<ContentVisibility metadata={metadata} />
75+
<DocVersionBanner />
76+
<div className={styles.docItemContainer}>
77+
<article>
78+
<DocBreadcrumbs />
79+
<div className={styles.docHeaderContainer}>
80+
<DocVersionBadge />
81+
<DocItemCopyPageButton
82+
className={clsx(
83+
styles.copyPageArticleAction,
84+
docTOC.canRender && styles.copyPageArticleActionWithToc
85+
)}
86+
/>
87+
</div>
88+
{docTOC.mobile}
89+
<DocItemContent>{children}</DocItemContent>
90+
<DocItemFooter />
91+
</article>
92+
<DocItemPaginator />
93+
</div>
94+
</div>
95+
{docTOC.desktop && (
96+
<div className="col col--3">
97+
<DocItemCopyPageButton className={styles.copyPageAsideAction} />
98+
{docTOC.desktop}
99+
</div>
100+
)}
101+
</div>
102+
);
103+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
.docItemContainer header + *,
9+
.docItemContainer article > *:first-child {
10+
margin-top: 0;
11+
}
12+
13+
.docHeaderContainer {
14+
display: flex;
15+
justify-content: space-between;
16+
align-items: center;
17+
}
18+
19+
.copyPageAsideAction {
20+
margin-bottom: 1rem;
21+
}
22+
23+
div[class^="copyPageArticleAction"] {
24+
margin-bottom: 0;
25+
}
26+
27+
button[class^="copyPageButton"] {
28+
border-radius: var(--ifm-global-radius);
29+
border-color: var(--ifm-color-gray-500);
30+
31+
&:hover {
32+
background-color: var(--ifm-menu-color-background-hover) !important;
33+
border-color: var(--ifm-color-gray-400) !important;
34+
}
35+
36+
svg {
37+
opacity: 0.75;
38+
}
39+
}
40+
41+
div[class^="copyPageDropdown"] {
42+
border-color: var(--ifm-table-border-color) !important;
43+
44+
button[class^="dropdownItem"] {
45+
border-bottom-color: var(--ifm-table-border-color) !important;
46+
47+
&:hover {
48+
background-color: var(--ifm-menu-color-background-hover);
49+
}
50+
}
51+
52+
div[class^="itemDescription"] {
53+
font-weight: 300;
54+
font-size: 12px;
55+
}
56+
}
57+
58+
[data-theme="dark"] {
59+
button[class^="copyPageButton"] {
60+
&:hover {
61+
background-color: var(--dark) !important;
62+
border-color: var(--ifm-color-gray-800) !important;
63+
}
64+
}
65+
66+
button[class^="dropdownItem"] {
67+
&:hover {
68+
background-color: var(--dark);
69+
}
70+
}
71+
72+
div[class^="copyPageDropdown"] {
73+
background-color: var(--ifm-navbar-background-color);
74+
}
75+
}
76+
77+
@media (min-width: 997px) {
78+
.docItemCol {
79+
max-width: 75% !important;
80+
}
81+
82+
.copyPageArticleActionWithToc {
83+
display: none;
84+
}
85+
}

website/versioned_docs/version-0.77/accessibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@ When adding support for standard actions, `name` must be one of the following:
424424
- `'magicTap'` - iOS only - While VoiceOver focus is on or inside the component, the user double tapped with two fingers.
425425
- `'escape'` - iOS only - While VoiceOver focus is on or inside the component, the user performed a two-finger scrub gesture (left, right, left).
426426
- `'activate'` - Activate the component. This should perform the same action with, or without, assistive technology. Engaged when a screen reader user double taps the component.
427-
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-up button.
428-
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-down button.
427+
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, in TalkBack versions 8.1 and below, this action is generated when the user focuses the component and presses the volume-up button. In TalkBack 9.1 and later, this was replaced by the "Adjust Reading Control" gesture (swiping upward on the focused control).
428+
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, in TalkBack versions 8.2 and below, this action is generated when the user focuses the component and presses the volume-down button. In TalkBack 9.2 and later, this was replaced by the "Adjust Reading Control" gesture (swiping downward on the focused control).
429429
- `'longpress'` - Android only - This action is generated when the user places accessibility focus on the component, then double-taps and holds one finger on the screen. This should perform the same action with, or without, assistive technology.
430430

431-
The `label` field is optional for standard actions and is often unused by assistive technologies. For custom actions, it is a localized string containing a description of the action to be presented to the user.
431+
The `label` field is optional for standard actions and is used by assistive technologies to describe the specific result of an action. For example, TalkBack uses this field to override the default "Double tap to activate" announcement with a custom description like "Double tap to open chat." For custom actions, the `label` is a localized string containing a description of the action to be presented to the user.
432432

433433
To handle action requests, a component must implement an `onAccessibilityAction` function. The only argument to this function is an event containing the name of the action to perform. The below example from RNTester shows how to create a component that defines and handles several custom actions.
434434

website/versioned_docs/version-0.78/accessibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ When adding support for standard actions, `name` must be one of the following:
426426
- `'magicTap'` - iOS only - While VoiceOver focus is on or inside the component, the user double tapped with two fingers.
427427
- `'escape'` - iOS only - While VoiceOver focus is on or inside the component, the user performed a two-finger scrub gesture (left, right, left).
428428
- `'activate'` - Activate the component. This should perform the same action with, or without, assistive technology. Engaged when a screen reader user double taps the component.
429-
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-up button.
430-
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-down button.
429+
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, in TalkBack versions 8.1 and below, this action is generated when the user focuses the component and presses the volume-up button. In TalkBack 9.1 and later, this was replaced by the "Adjust Reading Control" gesture (swiping upward on the focused control).
430+
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, in TalkBack versions 8.2 and below, this action is generated when the user focuses the component and presses the volume-down button. In TalkBack 9.2 and later, this was replaced by the "Adjust Reading Control" gesture (swiping downward on the focused control).
431431
- `'longpress'` - Android only - This action is generated when the user places accessibility focus on the component, then double-taps and holds one finger on the screen. This should perform the same action with, or without, assistive technology.
432432

433-
The `label` field is optional for standard actions and is often unused by assistive technologies. For custom actions, it is a localized string containing a description of the action to be presented to the user.
433+
The `label` field is optional for standard actions and is used by assistive technologies to describe the specific result of an action. For example, TalkBack uses this field to override the default "Double tap to activate" announcement with a custom description like "Double tap to open chat." For custom actions, the `label` is a localized string containing a description of the action to be presented to the user.
434434

435435
To handle action requests, a component must implement an `onAccessibilityAction` function. The only argument to this function is an event containing the name of the action to perform. The below example from RNTester shows how to create a component that defines and handles several custom actions.
436436

website/versioned_docs/version-0.79/accessibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ When adding support for standard actions, `name` must be one of the following:
426426
- `'magicTap'` - iOS only - While VoiceOver focus is on or inside the component, the user double tapped with two fingers.
427427
- `'escape'` - iOS only - While VoiceOver focus is on or inside the component, the user performed a two-finger scrub gesture (left, right, left).
428428
- `'activate'` - Activate the component. This should perform the same action with, or without, assistive technology. Engaged when a screen reader user double taps the component.
429-
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-up button.
430-
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume-down button.
429+
- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, in TalkBack versions 8.1 and below, this action is generated when the user focuses the component and presses the volume-up button. In TalkBack 9.1 and later, this was replaced by the "Adjust Reading Control" gesture (swiping upward on the focused control).
430+
- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, in TalkBack versions 8.2 and below, this action is generated when the user focuses the component and presses the volume-down button. In TalkBack 9.2 and later, this was replaced by the "Adjust Reading Control" gesture (swiping downward on the focused control).
431431
- `'longpress'` - Android only - This action is generated when the user places accessibility focus on the component, then double-taps and holds one finger on the screen. This should perform the same action with, or without, assistive technology.
432432

433-
The `label` field is optional for standard actions and is often unused by assistive technologies. For custom actions, it is a localized string containing a description of the action to be presented to the user.
433+
The `label` field is optional for standard actions and is used by assistive technologies to describe the specific result of an action. For example, TalkBack uses this field to override the default "Double tap to activate" announcement with a custom description like "Double tap to open chat." For custom actions, the `label` is a localized string containing a description of the action to be presented to the user.
434434

435435
To handle action requests, a component must implement an `onAccessibilityAction` function. The only argument to this function is an event containing the name of the action to perform. The below example from RNTester shows how to create a component that defines and handles several custom actions.
436436

0 commit comments

Comments
 (0)