decord/alpha/source/modules/a11y/native/AccessibilityManager.tsx

154 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 14613
// Function ID: 14614
// Name: AccessibilityManager
2026-10-09 10:00:15 +00:00
// Dependencies: [5, 17, 5080, 1085, 1208, 14614, 584, 1265, 14617, 10339, 14615, 4927, 4930, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 14613 (AccessibilityManager)
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import Constants from "Constants" /* 1085 */;
2026-10-08 09:57:35 +00:00
import ThemeConstants from "ThemeConstants" /* 1208 */;
2026-10-09 10:00:15 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
import ThemeActionCreators from "ThemeActionCreators" /* 4927 */;
import updateSharedValueIfChangedDefault from "updateSharedValueIfChanged" /* 10339 */;
import AccessibilitySystemFeaturesDefault from "AccessibilitySystemFeatures" /* 14614 */;
import AccessibilityPreferencesSharedValue from "AccessibilityPreferencesSharedValue" /* 14615 */;
import react_native from "react-native" /* 14617 */;
2026-10-03 08:58:59 +00:00
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
import react_native2 from "react-native" /* 17 */;
2026-10-09 10:00:15 +00:00
import AccessibilityStore from "AccessibilityStore" /* 5080 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let c2, c3, set;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let closure_4;
let hasOwnProperty;
({ AccessibilityInfo: closure_4, Appearance: hasOwnProperty } = react_native2);
const AnalyticEvents = Constants.AnalyticEvents;
const SystemTheme = ThemeConstants.SystemTheme;
let obj = {
2026-07-20 16:05:17 +00:00
init() {
2026-10-03 08:58:59 +00:00
let colorblindMode;
2026-07-23 10:11:24 +00:00
const self = this;
2026-10-03 08:58:59 +00:00
let obj = AccessibilitySystemFeaturesDefault;
obj.init();
2026-07-20 16:05:17 +00:00
this.updateNativeColors();
this.updateMotionSettings();
AccessibilityStore.addChangeListener(this.updateNativeColors);
AccessibilityStore.addChangeListener(this.updateMotionSettings);
2026-10-03 08:58:59 +00:00
let obj2 = DispatcherDefault;
const subscription = obj2.subscribe("CONNECTION_OPEN", this.updateMotionSettings);
2026-07-20 16:05:17 +00:00
closure_5.addChangeListener(this.updateSystemAppearance);
const listener = closure_4.addEventListener("screenReaderChanged", (event) => {
const result = self.updateScreenReaderEnabled(event);
2026-07-20 16:05:17 +00:00
});
2026-10-03 08:58:59 +00:00
const obj3 = DispatcherDefault;
const subscription1 = obj3.subscribe("ACCESSIBILITY_COLORBLIND_TOGGLE", () => {
const obj = AnalyticsUtilsDefault;
const obj2 = { colorblind_enabled: colorblindMode.colorblindMode };
obj.track(constants.LOCAL_SETTINGS_UPDATED, obj2);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
let result = this.startAnnouncementQueue();
2026-07-20 16:05:17 +00:00
},
updateNativeColors() {
2026-10-03 08:58:59 +00:00
const obj = react_native;
obj.updateSaturation(AccessibilityStore.saturation);
2026-07-20 16:05:17 +00:00
},
updateMotionSettings() {
2026-10-03 08:58:59 +00:00
const obj = { reduceMotion: AccessibilityStore.useReducedMotion, prefersCrossfades: AccessibilityStore.systemPrefersCrossfades };
const tmp = updateSharedValueIfChangedDefault;
tmp(AccessibilityPreferencesSharedValue.accessibilityPreferencesSharedValue, obj);
2026-07-20 16:05:17 +00:00
},
checkScreenreaderEnabled() {
2026-07-23 10:11:24 +00:00
const self = this;
return (async (arg0, value) => {
2026-07-29 08:29:29 +00:00
if (c3 === 2) {
c3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-10-03 08:58:59 +00:00
} else if (tmp3 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-10-05 08:00:40 +00:00
return { value: "IconComponent", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
2026-10-03 08:58:59 +00:00
let closure_0;
2026-07-29 08:29:29 +00:00
c3 = 2;
if (0 === c2) {
if (arg0 === 1) {
c3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c3 = 3;
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-10-03 08:58:59 +00:00
let closure_1 = tmp4;
closure_0 = undefined;
2026-07-29 08:29:29 +00:00
c2 = 1;
c3 = 1;
const obj4 = { value: screenReaderEnabled.isScreenReaderEnabled(), done: false };
return obj4;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c3 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c3 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
} else {
2026-10-03 08:58:59 +00:00
closure_0 = value;
const result = closure_129_0.updateScreenReaderEnabled(closure_0);
2026-07-29 08:29:29 +00:00
c3 = 3;
2026-10-05 08:00:40 +00:00
return { value: "IconComponent", done: null };
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
} catch (tmp11) {
c3 = 3;
throw tmp11;
2026-07-29 08:29:29 +00:00
}
}
})();
2026-07-20 16:05:17 +00:00
},
updateScreenReaderEnabled(screenReaderEnabled) {
2026-10-03 08:58:59 +00:00
const obj = { screenReaderEnabled };
const tmp = updateSharedValueIfChangedDefault;
tmp(AccessibilityPreferencesSharedValue.accessibilityPreferencesSharedValue, obj);
2026-07-20 16:05:17 +00:00
},
updateSystemAppearance(colorScheme) {
let DARK = SystemTheme.NO_PREFERENCE;
colorScheme = colorScheme.colorScheme;
if ("light" === colorScheme) {
2026-07-29 08:29:29 +00:00
DARK = tmp.LIGHT;
2026-07-20 16:05:17 +00:00
} else if ("dark" === colorScheme) {
2026-07-29 08:29:29 +00:00
DARK = tmp.DARK;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const obj = ThemeActionCreators;
obj.setSystemTheme(DARK);
2026-07-20 16:05:17 +00:00
},
startAnnouncementQueue() {
2026-10-03 08:58:59 +00:00
set = new Set();
const listener = closure_4.addEventListener("announcementFinished", (event) => {
2026-10-03 08:58:59 +00:00
let closure_0 = event;
if (!event.success) {
2026-10-03 08:58:59 +00:00
const obj = set;
if (!set.has(event.announcement)) {
2026-10-03 08:58:59 +00:00
obj.add(event.announcement);
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
2026-10-03 08:58:59 +00:00
const AccessibilityAnnouncer = set(closure_2_2[12]).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(announcement.announcement);
2026-07-20 16:05:17 +00:00
}, 150);
}
}
set.delete(event.announcement);
2026-07-20 16:05:17 +00:00
});
}
};
2026-10-03 08:58:59 +00:00
let result = size.fileFinishedImporting("modules/a11y/native/AccessibilityManager.tsx");
export default obj;