Skip to content

Commit 8415508

Browse files
RUM-9561 Update view schema to add accessibility attributes (#270)
1 parent 1c483b1 commit 8415508

File tree

4 files changed

+307
-0
lines changed

4 files changed

+307
-0
lines changed

lib/cjs/generated/rum.d.ts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & {
10071007
* Performance data. (Web Vitals, etc.)
10081008
*/
10091009
performance?: ViewPerformanceData;
1010+
/**
1011+
* Accessibility properties of the view
1012+
*/
1013+
accessibility?: ViewAccessibilityProperties;
10101014
[k: string]: unknown;
10111015
};
10121016
/**
@@ -1744,3 +1748,93 @@ export interface RumRect {
17441748
readonly height: number;
17451749
[k: string]: unknown;
17461750
}
1751+
/**
1752+
* Compact representation of accessibility features for a view
1753+
*/
1754+
export interface ViewAccessibilityProperties {
1755+
/**
1756+
* User’s preferred text scale relative to the default system size.
1757+
*/
1758+
readonly text_size?: string;
1759+
/**
1760+
* Indicates whether a screen reader is currently active.
1761+
*/
1762+
readonly screen_reader_enabled?: boolean;
1763+
/**
1764+
* Indicates whether the system-wide bold text accessibility setting is enabled.
1765+
*/
1766+
readonly bold_text_enabled?: boolean;
1767+
/**
1768+
* Indicates whether the system-wide reduce transparency setting is enabled.
1769+
*/
1770+
readonly reduce_transparency_enabled?: boolean;
1771+
/**
1772+
* Indicates whether the system-wide reduce motion setting is enabled.
1773+
*/
1774+
readonly reduce_motion_enabled?: boolean;
1775+
/**
1776+
* Indicates whether the system-wide button shapes setting is enabled.
1777+
*/
1778+
readonly button_shapes_enabled?: boolean;
1779+
/**
1780+
* Indicates whether the system-wide color inversion setting is enabled.
1781+
*/
1782+
readonly invert_colors_enabled?: boolean;
1783+
/**
1784+
* Indicates whether the system-wide increase contrast setting is enabled.
1785+
*/
1786+
readonly increase_contrast_enabled?: boolean;
1787+
/**
1788+
* Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.
1789+
*/
1790+
readonly assistive_switch_enabled?: boolean;
1791+
/**
1792+
* Indicates whether the system-wide AssistiveTouch feature is currently enabled.
1793+
*/
1794+
readonly assistive_touch_enabled?: boolean;
1795+
/**
1796+
* Indicates whether the video autoplay setting is enabled in the system or application.
1797+
*/
1798+
readonly video_autoplay_enabled?: boolean;
1799+
/**
1800+
* Indicates whether closed captioning is enabled for media playback.
1801+
*/
1802+
readonly closed_captioning_enabled?: boolean;
1803+
/**
1804+
* Indicates whether the system-wide mono audio setting is enabled.
1805+
*/
1806+
readonly mono_audio_enabled?: boolean;
1807+
/**
1808+
* Indicates whether the Shake to Undo feature is enabled.
1809+
*/
1810+
readonly shake_to_undo_enabled?: boolean;
1811+
/**
1812+
* Indicates whether the user prefers reduced animations or cross-fade transitions.
1813+
*/
1814+
readonly reduced_animations_enabled?: boolean;
1815+
/**
1816+
* Indicates whether the system should differentiate interface elements without relying solely on color.
1817+
*/
1818+
readonly should_differentiate_without_color?: boolean;
1819+
/**
1820+
* Indicates whether the device display is currently using grayscale mode.
1821+
*/
1822+
readonly grayscale_enabled?: boolean;
1823+
/**
1824+
* Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.
1825+
*/
1826+
readonly single_app_mode_enabled?: boolean;
1827+
/**
1828+
* Indicates whether on/off switch labels are enabled in the system settings.
1829+
*/
1830+
readonly on_off_switch_labels_enabled?: boolean;
1831+
/**
1832+
* Indicates whether the Speak Screen feature is enabled.
1833+
*/
1834+
readonly speak_screen_enabled?: boolean;
1835+
/**
1836+
* Indicates whether the text-to-speech selection feature is enabled.
1837+
*/
1838+
readonly speak_selection_enabled?: boolean;
1839+
[k: string]: unknown;
1840+
}

lib/esm/generated/rum.d.ts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & {
10071007
* Performance data. (Web Vitals, etc.)
10081008
*/
10091009
performance?: ViewPerformanceData;
1010+
/**
1011+
* Accessibility properties of the view
1012+
*/
1013+
accessibility?: ViewAccessibilityProperties;
10101014
[k: string]: unknown;
10111015
};
10121016
/**
@@ -1744,3 +1748,93 @@ export interface RumRect {
17441748
readonly height: number;
17451749
[k: string]: unknown;
17461750
}
1751+
/**
1752+
* Compact representation of accessibility features for a view
1753+
*/
1754+
export interface ViewAccessibilityProperties {
1755+
/**
1756+
* User’s preferred text scale relative to the default system size.
1757+
*/
1758+
readonly text_size?: string;
1759+
/**
1760+
* Indicates whether a screen reader is currently active.
1761+
*/
1762+
readonly screen_reader_enabled?: boolean;
1763+
/**
1764+
* Indicates whether the system-wide bold text accessibility setting is enabled.
1765+
*/
1766+
readonly bold_text_enabled?: boolean;
1767+
/**
1768+
* Indicates whether the system-wide reduce transparency setting is enabled.
1769+
*/
1770+
readonly reduce_transparency_enabled?: boolean;
1771+
/**
1772+
* Indicates whether the system-wide reduce motion setting is enabled.
1773+
*/
1774+
readonly reduce_motion_enabled?: boolean;
1775+
/**
1776+
* Indicates whether the system-wide button shapes setting is enabled.
1777+
*/
1778+
readonly button_shapes_enabled?: boolean;
1779+
/**
1780+
* Indicates whether the system-wide color inversion setting is enabled.
1781+
*/
1782+
readonly invert_colors_enabled?: boolean;
1783+
/**
1784+
* Indicates whether the system-wide increase contrast setting is enabled.
1785+
*/
1786+
readonly increase_contrast_enabled?: boolean;
1787+
/**
1788+
* Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.
1789+
*/
1790+
readonly assistive_switch_enabled?: boolean;
1791+
/**
1792+
* Indicates whether the system-wide AssistiveTouch feature is currently enabled.
1793+
*/
1794+
readonly assistive_touch_enabled?: boolean;
1795+
/**
1796+
* Indicates whether the video autoplay setting is enabled in the system or application.
1797+
*/
1798+
readonly video_autoplay_enabled?: boolean;
1799+
/**
1800+
* Indicates whether closed captioning is enabled for media playback.
1801+
*/
1802+
readonly closed_captioning_enabled?: boolean;
1803+
/**
1804+
* Indicates whether the system-wide mono audio setting is enabled.
1805+
*/
1806+
readonly mono_audio_enabled?: boolean;
1807+
/**
1808+
* Indicates whether the Shake to Undo feature is enabled.
1809+
*/
1810+
readonly shake_to_undo_enabled?: boolean;
1811+
/**
1812+
* Indicates whether the user prefers reduced animations or cross-fade transitions.
1813+
*/
1814+
readonly reduced_animations_enabled?: boolean;
1815+
/**
1816+
* Indicates whether the system should differentiate interface elements without relying solely on color.
1817+
*/
1818+
readonly should_differentiate_without_color?: boolean;
1819+
/**
1820+
* Indicates whether the device display is currently using grayscale mode.
1821+
*/
1822+
readonly grayscale_enabled?: boolean;
1823+
/**
1824+
* Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.
1825+
*/
1826+
readonly single_app_mode_enabled?: boolean;
1827+
/**
1828+
* Indicates whether on/off switch labels are enabled in the system settings.
1829+
*/
1830+
readonly on_off_switch_labels_enabled?: boolean;
1831+
/**
1832+
* Indicates whether the Speak Screen feature is enabled.
1833+
*/
1834+
readonly speak_screen_enabled?: boolean;
1835+
/**
1836+
* Indicates whether the text-to-speech selection feature is enabled.
1837+
*/
1838+
readonly speak_selection_enabled?: boolean;
1839+
[k: string]: unknown;
1840+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rum/_view-accessibility-schema.json",
4+
"title": "ViewAccessibilityProperties",
5+
"type": "object",
6+
"description": "Compact representation of accessibility features for a view",
7+
"readOnly": true,
8+
"properties": {
9+
"text_size": {
10+
"type": "string",
11+
"description": "User’s preferred text scale relative to the default system size.",
12+
"readOnly": true
13+
},
14+
"screen_reader_enabled": {
15+
"type": "boolean",
16+
"description": "Indicates whether a screen reader is currently active.",
17+
"readOnly": true
18+
},
19+
"bold_text_enabled": {
20+
"type": "boolean",
21+
"description": "Indicates whether the system-wide bold text accessibility setting is enabled.",
22+
"readOnly": true
23+
},
24+
"reduce_transparency_enabled": {
25+
"type": "boolean",
26+
"description": "Indicates whether the system-wide reduce transparency setting is enabled.",
27+
"readOnly": true
28+
},
29+
"reduce_motion_enabled": {
30+
"type": "boolean",
31+
"description": "Indicates whether the system-wide reduce motion setting is enabled.",
32+
"readOnly": true
33+
},
34+
"button_shapes_enabled": {
35+
"type": "boolean",
36+
"description": "Indicates whether the system-wide button shapes setting is enabled.",
37+
"readOnly": true
38+
},
39+
"invert_colors_enabled": {
40+
"type": "boolean",
41+
"description": "Indicates whether the system-wide color inversion setting is enabled.",
42+
"readOnly": true
43+
},
44+
"increase_contrast_enabled": {
45+
"type": "boolean",
46+
"description": "Indicates whether the system-wide increase contrast setting is enabled.",
47+
"readOnly": true
48+
},
49+
"assistive_switch_enabled": {
50+
"type": "boolean",
51+
"description": "Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.",
52+
"readOnly": true
53+
},
54+
"assistive_touch_enabled": {
55+
"type": "boolean",
56+
"description": "Indicates whether the system-wide AssistiveTouch feature is currently enabled.",
57+
"readOnly": true
58+
},
59+
"video_autoplay_enabled": {
60+
"type": "boolean",
61+
"description": "Indicates whether the video autoplay setting is enabled in the system or application.",
62+
"readOnly": true
63+
},
64+
"closed_captioning_enabled": {
65+
"type": "boolean",
66+
"description": "Indicates whether closed captioning is enabled for media playback.",
67+
"readOnly": true
68+
},
69+
"mono_audio_enabled": {
70+
"type": "boolean",
71+
"description": "Indicates whether the system-wide mono audio setting is enabled.",
72+
"readOnly": true
73+
},
74+
"shake_to_undo_enabled": {
75+
"type": "boolean",
76+
"description": "Indicates whether the Shake to Undo feature is enabled.",
77+
"readOnly": true
78+
},
79+
"reduced_animations_enabled": {
80+
"type": "boolean",
81+
"description": "Indicates whether the user prefers reduced animations or cross-fade transitions.",
82+
"readOnly": true
83+
},
84+
"should_differentiate_without_color": {
85+
"type": "boolean",
86+
"description": "Indicates whether the system should differentiate interface elements without relying solely on color.",
87+
"readOnly": true
88+
},
89+
"grayscale_enabled": {
90+
"type": "boolean",
91+
"description": "Indicates whether the device display is currently using grayscale mode.",
92+
"readOnly": true
93+
},
94+
"single_app_mode_enabled": {
95+
"type": "boolean",
96+
"description": "Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.",
97+
"readOnly": true
98+
},
99+
"on_off_switch_labels_enabled": {
100+
"type": "boolean",
101+
"description": "Indicates whether on/off switch labels are enabled in the system settings.",
102+
"readOnly": true
103+
},
104+
"speak_screen_enabled": {
105+
"type": "boolean",
106+
"description": "Indicates whether the Speak Screen feature is enabled.",
107+
"readOnly": true
108+
},
109+
"speak_selection_enabled": {
110+
"type": "boolean",
111+
"description": "Indicates whether the text-to-speech selection feature is enabled.",
112+
"readOnly": true
113+
}
114+
}
115+
}

schemas/rum/view-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@
397397
"performance": {
398398
"description": "Performance data. (Web Vitals, etc.)",
399399
"allOf": [{ "$ref": "_view-performance-schema.json" }]
400+
},
401+
"accessibility": {
402+
"description": "Accessibility properties of the view",
403+
"allOf": [{ "$ref": "_view-accessibility-schema.json" }]
400404
}
401405
},
402406
"readOnly": true

0 commit comments

Comments
 (0)