@solidnative-dev/accessibility 0.0.0-stage → 0.1.0-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Solid Native contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,81 @@
1
- # Temporary Holding Version
1
+ # `@solidnative-dev/accessibility`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This package exposes bounded native accessibility preferences and announcements
4
+ without evaluating React Native's `AccessibilityInfo.js` facade. Its three
5
+ layers remain explicit:
6
+
7
+ - `@solidnative-dev/accessibility` validates framework-neutral preferences,
8
+ changes, announcements, subscriptions, and recommended timeouts.
9
+ - `@solidnative-dev/accessibility/react-native` drives React Native 0.87's pinned
10
+ `AccessibilityInfo` Android and `AccessibilityManager` iOS TurboModules plus
11
+ the lower-level device event emitter.
12
+ - `@solidnative-dev/accessibility/solid` owns asynchronous loading and the native
13
+ subscription, exposing independently memoized preference accessors.
14
+
15
+ ```ts
16
+ import { createReactNativeAccessibilityService } from "@solidnative-dev/accessibility/react-native";
17
+ import { createAccessibilityPreferences } from "@solidnative-dev/accessibility/solid";
18
+ import { getReactNativePlatformServices } from "@solidnative-dev/runtime/react-native";
19
+
20
+ const accessibility = createAccessibilityPreferences(
21
+ createReactNativeAccessibilityService(),
22
+ {
23
+ appState: getReactNativePlatformServices(),
24
+ onError: reportError,
25
+ },
26
+ );
27
+
28
+ await accessibility.ready;
29
+
30
+ // Each accessor updates downstream computations only when its value changes.
31
+ if (accessibility.reduceMotionEnabled()) {
32
+ // Select a non-motion transition or update an animation input.
33
+ }
34
+
35
+ accessibility.announce({
36
+ message: "Draft saved",
37
+ queue: true,
38
+ priority: "default",
39
+ });
40
+ ```
41
+
42
+ The same `reduceMotionEnabled` accessor can be passed directly as the
43
+ `reduceMotion` option to `createNativeViewAnimation`; no effect or duplicated
44
+ preference signal is required.
45
+
46
+ The common accessors cover screen-reader, reduced-motion, inverted-color, and
47
+ grayscale state. The discriminated Android controller adds high-text-contrast
48
+ and general accessibility-service state. The iOS controller adds bold text,
49
+ darker system colors, reduced transparency, and cross-fade preference. iOS does
50
+ not publish a cross-fade change event through this native ABI. Passing the
51
+ validated platform service as `appState` refreshes the complete snapshot once
52
+ after each inactive-to-active transition. Applications can also call the
53
+ imperative `refresh()` action explicitly.
54
+
55
+ The initial query begins after Solid component construction and is exposed as
56
+ `ready`; this avoids writing inside a Solid 2 owned computation. Native changes
57
+ that race the initial query remain authoritative. Later `refresh()` calls are
58
+ latest-wins actions, and late native callbacks are ignored after owner disposal.
59
+
60
+ Preference changes enter causal observability only as
61
+ `platform.accessibility.preference`. Preference names and values, announcement
62
+ text, native errors, and timeout values are not telemetry attributes. Android
63
+ does not support announcement queue or priority options, and iOS returns the
64
+ original timeout because its native manager has no recommended-timeout API.
65
+
66
+ Run the physical Android Release gate on one attached, unlocked device with:
67
+
68
+ ```sh
69
+ pnpm --filter @solidnative-dev/native-e2e android:accessibility:test
70
+ ```
71
+
72
+ The gate changes reduced-motion and high-text-contrast settings away from and
73
+ back to their original values, proving four direct native deliveries through
74
+ the corresponding fine-grained Solid accessors and Fabric commits. Each commit
75
+ must preserve the privacy-safe `platform.accessibility.preference` cause and
76
+ named output computation without recording preference identity or value.
77
+ Android's own UI automation independently captures the exact native
78
+ announcement event after a touchscreen press. The run also verifies the
79
+ recommended timeout, refresh, owner teardown, setting restoration, source-map
80
+ policy, and process/package cleanup. It never enables a user accessibility
81
+ service. iOS remains Release-compiled and awaits equivalent physical coverage.
@@ -0,0 +1,64 @@
1
+ export declare const ACCESSIBILITY_MAX_ANNOUNCEMENT_LENGTH = 4096;
2
+ export declare const ACCESSIBILITY_MAX_TIMEOUT_MILLISECONDS = 2147483647;
3
+ export type AccessibilityPlatform = "android" | "ios";
4
+ export type AccessibilityAnnouncementPriority = "low" | "default" | "high";
5
+ export type AccessibilityPreferenceKey = "screenReaderEnabled" | "reduceMotionEnabled" | "invertColorsEnabled" | "grayscaleEnabled" | "highTextContrastEnabled" | "accessibilityServiceEnabled" | "boldTextEnabled" | "darkerSystemColorsEnabled" | "reduceTransparencyEnabled" | "prefersCrossFadeTransitions";
6
+ export interface AccessibilityPreferencesCommon {
7
+ readonly platform: AccessibilityPlatform;
8
+ readonly screenReaderEnabled: boolean;
9
+ readonly reduceMotionEnabled: boolean;
10
+ readonly invertColorsEnabled: boolean;
11
+ readonly grayscaleEnabled: boolean;
12
+ }
13
+ export interface AndroidAccessibilityPreferences extends AccessibilityPreferencesCommon {
14
+ readonly platform: "android";
15
+ readonly highTextContrastEnabled: boolean;
16
+ readonly accessibilityServiceEnabled: boolean;
17
+ }
18
+ export interface IOSAccessibilityPreferences extends AccessibilityPreferencesCommon {
19
+ readonly platform: "ios";
20
+ readonly boldTextEnabled: boolean;
21
+ readonly darkerSystemColorsEnabled: boolean;
22
+ readonly reduceTransparencyEnabled: boolean;
23
+ readonly prefersCrossFadeTransitions: boolean;
24
+ }
25
+ export type AccessibilityPreferences = AndroidAccessibilityPreferences | IOSAccessibilityPreferences;
26
+ export interface AccessibilityPreferenceChange {
27
+ readonly preference: AccessibilityPreferenceKey;
28
+ readonly enabled: boolean;
29
+ }
30
+ export interface AccessibilityAnnouncement {
31
+ readonly message: string;
32
+ /** iOS-only speech queue behavior. */
33
+ readonly queue?: boolean;
34
+ /** iOS-only announcement priority. */
35
+ readonly priority?: AccessibilityAnnouncementPriority;
36
+ }
37
+ export interface NormalizedAccessibilityAnnouncement {
38
+ readonly message: string;
39
+ readonly queue: boolean;
40
+ readonly priority: AccessibilityAnnouncementPriority;
41
+ }
42
+ export interface AccessibilitySubscription {
43
+ remove(): void;
44
+ }
45
+ export interface AccessibilitySubscriptionOptions {
46
+ readonly onError?: (error: unknown) => unknown;
47
+ }
48
+ export interface AccessibilityAdapter {
49
+ readonly platform: AccessibilityPlatform;
50
+ getPreferences(): Promise<unknown>;
51
+ subscribe(listener: (change: unknown) => void): unknown;
52
+ announce(request: NormalizedAccessibilityAnnouncement): void;
53
+ getRecommendedTimeoutMillis(originalTimeout: number): Promise<unknown>;
54
+ }
55
+ export interface AccessibilityService {
56
+ readonly platform: AccessibilityPlatform;
57
+ getPreferences(): Promise<AccessibilityPreferences>;
58
+ subscribe(listener: (change: AccessibilityPreferenceChange) => unknown, options?: AccessibilitySubscriptionOptions): AccessibilitySubscription;
59
+ announce(request: string | AccessibilityAnnouncement): void;
60
+ getRecommendedTimeoutMillis(originalTimeout: number): Promise<number>;
61
+ }
62
+ /** Validates native accessibility queries, changes, announcements, and timeouts. */
63
+ export declare function createAccessibilityService(adapter: AccessibilityAdapter): AccessibilityService;
64
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],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AO,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI,CAAC;IAC5D,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAiND,oFAAoF;AACpF,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,oBAAoB,GAC5B,oBAAoB,CAqEtB"}
package/dist/index.js ADDED
@@ -0,0 +1,188 @@
1
+ export const ACCESSIBILITY_MAX_ANNOUNCEMENT_LENGTH = 4_096;
2
+ export const ACCESSIBILITY_MAX_TIMEOUT_MILLISECONDS = 2_147_483_647;
3
+ const COMMON_PREFERENCES = Object.freeze([
4
+ "screenReaderEnabled",
5
+ "reduceMotionEnabled",
6
+ "invertColorsEnabled",
7
+ "grayscaleEnabled",
8
+ ]);
9
+ const ANDROID_PREFERENCES = Object.freeze([
10
+ "highTextContrastEnabled",
11
+ "accessibilityServiceEnabled",
12
+ ]);
13
+ const IOS_PREFERENCES = Object.freeze([
14
+ "boldTextEnabled",
15
+ "darkerSystemColorsEnabled",
16
+ "reduceTransparencyEnabled",
17
+ "prefersCrossFadeTransitions",
18
+ ]);
19
+ function record(value, path) {
20
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
21
+ throw new TypeError(`${path} must be an object.`);
22
+ }
23
+ return value;
24
+ }
25
+ function booleanField(value, key, path) {
26
+ if (typeof value[key] !== "boolean") {
27
+ throw new TypeError(`${path}.${key} must be a boolean.`);
28
+ }
29
+ return value[key];
30
+ }
31
+ function accessibilityPreferences(value, platform) {
32
+ const candidate = record(value, "Native accessibility preferences");
33
+ if (candidate.platform !== platform) {
34
+ throw new TypeError("Native accessibility preferences must match the service platform.");
35
+ }
36
+ const common = Object.fromEntries(COMMON_PREFERENCES.map((key) => [
37
+ key,
38
+ booleanField(candidate, key, "Native accessibility preferences"),
39
+ ]));
40
+ if (platform === "android") {
41
+ return Object.freeze({
42
+ platform,
43
+ ...common,
44
+ highTextContrastEnabled: booleanField(candidate, "highTextContrastEnabled", "Native accessibility preferences"),
45
+ accessibilityServiceEnabled: booleanField(candidate, "accessibilityServiceEnabled", "Native accessibility preferences"),
46
+ });
47
+ }
48
+ return Object.freeze({
49
+ platform,
50
+ ...common,
51
+ boldTextEnabled: booleanField(candidate, "boldTextEnabled", "Native accessibility preferences"),
52
+ darkerSystemColorsEnabled: booleanField(candidate, "darkerSystemColorsEnabled", "Native accessibility preferences"),
53
+ reduceTransparencyEnabled: booleanField(candidate, "reduceTransparencyEnabled", "Native accessibility preferences"),
54
+ prefersCrossFadeTransitions: booleanField(candidate, "prefersCrossFadeTransitions", "Native accessibility preferences"),
55
+ });
56
+ }
57
+ function allowedPreferenceKeys(platform) {
58
+ return new Set([
59
+ ...COMMON_PREFERENCES,
60
+ ...(platform === "android" ? ANDROID_PREFERENCES : IOS_PREFERENCES),
61
+ ]);
62
+ }
63
+ function accessibilityChange(value, allowed) {
64
+ const candidate = record(value, "Native accessibility change");
65
+ if (typeof candidate.preference !== "string" ||
66
+ !allowed.has(candidate.preference)) {
67
+ throw new TypeError("Native accessibility change preference is unavailable on this platform.");
68
+ }
69
+ if (typeof candidate.enabled !== "boolean") {
70
+ throw new TypeError("Native accessibility change enabled must be a boolean.");
71
+ }
72
+ return Object.freeze({
73
+ preference: candidate.preference,
74
+ enabled: candidate.enabled,
75
+ });
76
+ }
77
+ function announcement(value, platform) {
78
+ const candidate = typeof value === "string"
79
+ ? { message: value }
80
+ : record(value, "Announcement");
81
+ if (typeof candidate.message !== "string" ||
82
+ candidate.message.length === 0 ||
83
+ candidate.message.length > ACCESSIBILITY_MAX_ANNOUNCEMENT_LENGTH ||
84
+ candidate.message.includes("\0")) {
85
+ throw new TypeError(`Announcement message must be a 1-${ACCESSIBILITY_MAX_ANNOUNCEMENT_LENGTH} character string without null bytes.`);
86
+ }
87
+ const queue = candidate.queue ?? false;
88
+ if (typeof queue !== "boolean") {
89
+ throw new TypeError("Announcement queue must be a boolean.");
90
+ }
91
+ const priority = candidate.priority ?? "default";
92
+ if (priority !== "low" && priority !== "default" && priority !== "high") {
93
+ throw new TypeError("Announcement priority must be low, default, or high.");
94
+ }
95
+ if (platform === "android" && (queue || priority !== "default")) {
96
+ throw new TypeError("Announcement queue and priority options are available only on iOS.");
97
+ }
98
+ return Object.freeze({ message: candidate.message, queue, priority });
99
+ }
100
+ function timeoutMilliseconds(value, path) {
101
+ if (!Number.isSafeInteger(value) ||
102
+ value < 0 ||
103
+ value > ACCESSIBILITY_MAX_TIMEOUT_MILLISECONDS) {
104
+ throw new RangeError(`${path} must be a non-negative safe integer no larger than ${ACCESSIBILITY_MAX_TIMEOUT_MILLISECONDS}.`);
105
+ }
106
+ return value;
107
+ }
108
+ function reportSubscriptionError(error, options) {
109
+ try {
110
+ const reported = options.onError?.(error);
111
+ void Promise.resolve(reported).catch(() => undefined);
112
+ }
113
+ catch {
114
+ // Native delivery and cleanup cannot be broken by a diagnostic hook.
115
+ }
116
+ }
117
+ function subscription(value) {
118
+ const candidate = record(value, "Accessibility subscription");
119
+ if (typeof candidate.remove !== "function") {
120
+ throw new TypeError("Accessibility subscription must provide remove().");
121
+ }
122
+ const remove = candidate.remove;
123
+ let active = true;
124
+ return Object.freeze({
125
+ remove() {
126
+ if (!active)
127
+ return;
128
+ active = false;
129
+ remove.call(value);
130
+ },
131
+ });
132
+ }
133
+ /** Validates native accessibility queries, changes, announcements, and timeouts. */
134
+ export function createAccessibilityService(adapter) {
135
+ const candidate = record(adapter, "Accessibility adapter");
136
+ if (candidate.platform !== "android" && candidate.platform !== "ios") {
137
+ throw new TypeError("Accessibility adapter platform must be android or ios.");
138
+ }
139
+ for (const method of [
140
+ "getPreferences",
141
+ "subscribe",
142
+ "announce",
143
+ "getRecommendedTimeoutMillis",
144
+ ]) {
145
+ if (typeof candidate[method] !== "function") {
146
+ throw new TypeError(`Accessibility adapter must provide ${method}().`);
147
+ }
148
+ }
149
+ const platform = candidate.platform;
150
+ const allowed = allowedPreferenceKeys(platform);
151
+ const service = {
152
+ platform,
153
+ async getPreferences() {
154
+ return accessibilityPreferences(await adapter.getPreferences(), platform);
155
+ },
156
+ subscribe(listener, options = {}) {
157
+ if (typeof listener !== "function") {
158
+ throw new TypeError("Accessibility listener must be a function.");
159
+ }
160
+ record(options, "Accessibility subscription options");
161
+ if (options.onError !== undefined &&
162
+ typeof options.onError !== "function") {
163
+ throw new TypeError("Accessibility onError must be a function.");
164
+ }
165
+ return subscription(adapter.subscribe((value) => {
166
+ try {
167
+ listener(accessibilityChange(value, allowed));
168
+ }
169
+ catch (error) {
170
+ reportSubscriptionError(error, options);
171
+ }
172
+ }));
173
+ },
174
+ announce(value) {
175
+ adapter.announce(announcement(value, platform));
176
+ },
177
+ async getRecommendedTimeoutMillis(originalTimeout) {
178
+ const normalized = timeoutMilliseconds(originalTimeout, "Original accessibility timeout");
179
+ const recommended = timeoutMilliseconds(await adapter.getRecommendedTimeoutMillis(normalized), "Native recommended accessibility timeout");
180
+ if (recommended < normalized) {
181
+ throw new RangeError("Native recommended accessibility timeout must not shorten the original timeout.");
182
+ }
183
+ return recommended;
184
+ },
185
+ };
186
+ return Object.freeze(service);
187
+ }
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC;AAC3D,MAAM,CAAC,MAAM,sCAAsC,GAAG,aAAa,CAAC;AAuFpE,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;CACV,CAAC,CAAC;AACZ,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,yBAAyB;IACzB,6BAA6B;CACrB,CAAC,CAAC;AACZ,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,iBAAiB;IACjB,2BAA2B;IAC3B,2BAA2B;IAC3B,6BAA6B;C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AAC,KAAyC;YAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;QAClD,CAAC;QACD,KAAK,CAAC,2BAA2B,CAAC,eAAuB;YACvD,MAAM,UAAU,GAAG,mBAAmB,CACpC,eAAe,EACf,gCAAgC,CACjC,CAAC;YACF,MAAM,WAAW,GAAG,mBAAmB,CACrC,MAAM,OAAO,CAAC,2BAA2B,CAAC,UAAU,CAAC,EACrD,0CAA0C,CAC3C,CAAC;YACF,IAAI,WAAW,GAAG,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,UAAU,CAClB,iFAAiF,CAClF,CAAC;YACJ,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type AccessibilityAdapter } from "./index.js";
2
+ type NativeSuccess = (value: unknown) => void;
3
+ type NativeFailure = (error: unknown) => void;
4
+ export interface NativeEventSubscription {
5
+ remove(): void;
6
+ }
7
+ export interface NativeAccessibilityEventEmitter {
8
+ addListener(eventName: string, listener: (value: unknown) => void): NativeEventSubscription;
9
+ }
10
+ export interface AndroidAccessibilityModule {
11
+ isTouchExplorationEnabled(success: NativeSuccess): void;
12
+ isReduceMotionEnabled(success: NativeSuccess): void;
13
+ isInvertColorsEnabled(success: NativeSuccess): void;
14
+ isGrayscaleEnabled(success: NativeSuccess): void;
15
+ isHighTextContrastEnabled(success: NativeSuccess): void;
16
+ isAccessibilityServiceEnabled(success: NativeSuccess): void;
17
+ announceForAccessibility(message: string): void;
18
+ getRecommendedTimeoutMillis(originalTimeout: number, success: NativeSuccess): void;
19
+ }
20
+ export interface IOSAccessibilityManagerModule {
21
+ getCurrentVoiceOverState(success: NativeSuccess, failure: NativeFailure): void;
22
+ getCurrentReduceMotionState(success: NativeSuccess, failure: NativeFailure): void;
23
+ getCurrentInvertColorsState(success: NativeSuccess, failure: NativeFailure): void;
24
+ getCurrentGrayscaleState(success: NativeSuccess, failure: NativeFailure): void;
25
+ getCurrentBoldTextState(success: NativeSuccess, failure: NativeFailure): void;
26
+ getCurrentDarkerSystemColorsState(success: NativeSuccess, failure: NativeFailure): void;
27
+ getCurrentReduceTransparencyState(success: NativeSuccess, failure: NativeFailure): void;
28
+ getCurrentPrefersCrossFadeTransitionsState(success: NativeSuccess, failure: NativeFailure): void;
29
+ announceForAccessibilityWithOptions(message: string, options: Readonly<{
30
+ queue: boolean;
31
+ priority: string;
32
+ }>): void;
33
+ }
34
+ /** @internal Direct React Native 0.87 Android accessibility translation seam. */
35
+ export declare function createAndroidAccessibilityAdapter(module: AndroidAccessibilityModule, emitter: NativeAccessibilityEventEmitter): AccessibilityAdapter;
36
+ /** @internal Direct React Native 0.87 iOS accessibility translation seam. */
37
+ export declare function createIOSAccessibilityAdapter(module: IOSAccessibilityManagerModule, emitter: NativeAccessibilityEventEmitter): AccessibilityAdapter;
38
+ export {};
39
+ //# sourceMappingURL=react-native-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-native-adapter.d.ts","sourceRoot":"","sources":["../src/react-native-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,YAAY,CAAC;AAEpB,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAC9C,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,WAAW,CACT,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,uBAAuB,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,yBAAyB,CAAC,OAAO,EAAE,aAAa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AM,CAAA;KAAE,CAAC,GACtD,IAAI,CAAC;CACT;AAiLD,iFAAiF;AACjF,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,+BAA+B,GACvC,oBAAoB,CAgDtB;AAED,6EAA6E;AAC7E,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,6BAA6B,EACrC,OAAO,EAAE,+BAA+B,GACvC,oBAAoB,CAqEtB"}
@@ -0,0 +1,233 @@
1
+ import {} from "./index.js";
2
+ function record(value, path) {
3
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
4
+ throw new TypeError(`${path} must be an object.`);
5
+ }
6
+ return value;
7
+ }
8
+ function requireMethods(value, path, methods) {
9
+ const candidate = record(value, path);
10
+ for (const method of methods) {
11
+ if (typeof candidate[method] !== "function") {
12
+ throw new TypeError(`${path} must provide ${method}().`);
13
+ }
14
+ }
15
+ }
16
+ function nativeError(value) {
17
+ if (typeof value === "string" && value.length > 0 && value.length <= 4_096) {
18
+ return new Error(value);
19
+ }
20
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
21
+ const message = value.message;
22
+ if (typeof message === "string" &&
23
+ message.length > 0 &&
24
+ message.length <= 4_096) {
25
+ return new Error(message);
26
+ }
27
+ }
28
+ return new Error("The native accessibility manager reported an invalid error.");
29
+ }
30
+ function callbackQuery(invoke) {
31
+ return new Promise((resolve, reject) => {
32
+ let settled = false;
33
+ try {
34
+ invoke((value) => {
35
+ if (settled)
36
+ return;
37
+ settled = true;
38
+ resolve(value);
39
+ });
40
+ }
41
+ catch (error) {
42
+ if (settled)
43
+ return;
44
+ settled = true;
45
+ reject(error);
46
+ }
47
+ });
48
+ }
49
+ function callbackQueryWithFailure(invoke) {
50
+ return new Promise((resolve, reject) => {
51
+ let settled = false;
52
+ try {
53
+ invoke((value) => {
54
+ if (settled)
55
+ return;
56
+ settled = true;
57
+ resolve(value);
58
+ }, (error) => {
59
+ if (settled)
60
+ return;
61
+ settled = true;
62
+ reject(nativeError(error));
63
+ });
64
+ }
65
+ catch (error) {
66
+ if (settled)
67
+ return;
68
+ settled = true;
69
+ reject(error);
70
+ }
71
+ });
72
+ }
73
+ function subscribeEvents(emitter, events, listener) {
74
+ const subscriptions = [];
75
+ try {
76
+ for (const [eventName, preference] of events) {
77
+ const nativeSubscription = emitter.addListener(eventName, (enabled) => listener({ preference, enabled }));
78
+ requireMethods(nativeSubscription, `Native accessibility event subscription ${eventName}`, ["remove"]);
79
+ subscriptions.push(nativeSubscription);
80
+ }
81
+ }
82
+ catch (error) {
83
+ for (const nativeSubscription of [...subscriptions].reverse()) {
84
+ try {
85
+ nativeSubscription.remove();
86
+ }
87
+ catch {
88
+ // Preserve the subscription setup failure.
89
+ }
90
+ }
91
+ throw error;
92
+ }
93
+ let active = true;
94
+ return Object.freeze({
95
+ remove() {
96
+ if (!active)
97
+ return;
98
+ active = false;
99
+ let failure;
100
+ for (const nativeSubscription of [...subscriptions].reverse()) {
101
+ try {
102
+ nativeSubscription.remove();
103
+ }
104
+ catch (error) {
105
+ failure ??= error;
106
+ }
107
+ }
108
+ if (failure !== undefined)
109
+ throw failure;
110
+ },
111
+ });
112
+ }
113
+ const ANDROID_METHODS = Object.freeze([
114
+ "isTouchExplorationEnabled",
115
+ "isReduceMotionEnabled",
116
+ "isInvertColorsEnabled",
117
+ "isGrayscaleEnabled",
118
+ "isHighTextContrastEnabled",
119
+ "isAccessibilityServiceEnabled",
120
+ "announceForAccessibility",
121
+ "getRecommendedTimeoutMillis",
122
+ ]);
123
+ const IOS_METHODS = Object.freeze([
124
+ "getCurrentVoiceOverState",
125
+ "getCurrentReduceMotionState",
126
+ "getCurrentInvertColorsState",
127
+ "getCurrentGrayscaleState",
128
+ "getCurrentBoldTextState",
129
+ "getCurrentDarkerSystemColorsState",
130
+ "getCurrentReduceTransparencyState",
131
+ "getCurrentPrefersCrossFadeTransitionsState",
132
+ "announceForAccessibilityWithOptions",
133
+ ]);
134
+ const ANDROID_EVENTS = Object.freeze([
135
+ ["touchExplorationDidChange", "screenReaderEnabled"],
136
+ ["reduceMotionDidChange", "reduceMotionEnabled"],
137
+ ["invertColorDidChange", "invertColorsEnabled"],
138
+ ["grayscaleModeDidChange", "grayscaleEnabled"],
139
+ ["highTextContrastDidChange", "highTextContrastEnabled"],
140
+ ["accessibilityServiceDidChange", "accessibilityServiceEnabled"],
141
+ ]);
142
+ const IOS_EVENTS = Object.freeze([
143
+ ["screenReaderChanged", "screenReaderEnabled"],
144
+ ["reduceMotionChanged", "reduceMotionEnabled"],
145
+ ["invertColorsChanged", "invertColorsEnabled"],
146
+ ["grayscaleChanged", "grayscaleEnabled"],
147
+ ["boldTextChanged", "boldTextEnabled"],
148
+ ["darkerSystemColorsChanged", "darkerSystemColorsEnabled"],
149
+ ["reduceTransparencyChanged", "reduceTransparencyEnabled"],
150
+ ]);
151
+ /** @internal Direct React Native 0.87 Android accessibility translation seam. */
152
+ export function createAndroidAccessibilityAdapter(module, emitter) {
153
+ requireMethods(module, "Android accessibility module", ANDROID_METHODS);
154
+ requireMethods(emitter, "Native accessibility event emitter", [
155
+ "addListener",
156
+ ]);
157
+ const adapter = {
158
+ platform: "android",
159
+ async getPreferences() {
160
+ const [screenReaderEnabled, reduceMotionEnabled, invertColorsEnabled, grayscaleEnabled, highTextContrastEnabled, accessibilityServiceEnabled,] = await Promise.all([
161
+ callbackQuery((success) => module.isTouchExplorationEnabled(success)),
162
+ callbackQuery((success) => module.isReduceMotionEnabled(success)),
163
+ callbackQuery((success) => module.isInvertColorsEnabled(success)),
164
+ callbackQuery((success) => module.isGrayscaleEnabled(success)),
165
+ callbackQuery((success) => module.isHighTextContrastEnabled(success)),
166
+ callbackQuery((success) => module.isAccessibilityServiceEnabled(success)),
167
+ ]);
168
+ return {
169
+ platform: "android",
170
+ screenReaderEnabled,
171
+ reduceMotionEnabled,
172
+ invertColorsEnabled,
173
+ grayscaleEnabled,
174
+ highTextContrastEnabled,
175
+ accessibilityServiceEnabled,
176
+ };
177
+ },
178
+ subscribe(listener) {
179
+ return subscribeEvents(emitter, ANDROID_EVENTS, listener);
180
+ },
181
+ announce(request) {
182
+ module.announceForAccessibility(request.message);
183
+ },
184
+ getRecommendedTimeoutMillis(originalTimeout) {
185
+ return callbackQuery((success) => module.getRecommendedTimeoutMillis(originalTimeout, success));
186
+ },
187
+ };
188
+ return Object.freeze(adapter);
189
+ }
190
+ /** @internal Direct React Native 0.87 iOS accessibility translation seam. */
191
+ export function createIOSAccessibilityAdapter(module, emitter) {
192
+ requireMethods(module, "iOS accessibility manager", IOS_METHODS);
193
+ requireMethods(emitter, "Native accessibility event emitter", [
194
+ "addListener",
195
+ ]);
196
+ const adapter = {
197
+ platform: "ios",
198
+ async getPreferences() {
199
+ const [screenReaderEnabled, reduceMotionEnabled, invertColorsEnabled, grayscaleEnabled, boldTextEnabled, darkerSystemColorsEnabled, reduceTransparencyEnabled, prefersCrossFadeTransitions,] = await Promise.all([
200
+ callbackQueryWithFailure((success, failure) => module.getCurrentVoiceOverState(success, failure)),
201
+ callbackQueryWithFailure((success, failure) => module.getCurrentReduceMotionState(success, failure)),
202
+ callbackQueryWithFailure((success, failure) => module.getCurrentInvertColorsState(success, failure)),
203
+ callbackQueryWithFailure((success, failure) => module.getCurrentGrayscaleState(success, failure)),
204
+ callbackQueryWithFailure((success, failure) => module.getCurrentBoldTextState(success, failure)),
205
+ callbackQueryWithFailure((success, failure) => module.getCurrentDarkerSystemColorsState(success, failure)),
206
+ callbackQueryWithFailure((success, failure) => module.getCurrentReduceTransparencyState(success, failure)),
207
+ callbackQueryWithFailure((success, failure) => module.getCurrentPrefersCrossFadeTransitionsState(success, failure)),
208
+ ]);
209
+ return {
210
+ platform: "ios",
211
+ screenReaderEnabled,
212
+ reduceMotionEnabled,
213
+ invertColorsEnabled,
214
+ grayscaleEnabled,
215
+ boldTextEnabled,
216
+ darkerSystemColorsEnabled,
217
+ reduceTransparencyEnabled,
218
+ prefersCrossFadeTransitions,
219
+ };
220
+ },
221
+ subscribe(listener) {
222
+ return subscribeEvents(emitter, IOS_EVENTS, listener);
223
+ },
224
+ announce(request) {
225
+ module.announceForAccessibilityWithOptions(request.message, Object.freeze({ queue: request.queue, priority: request.priority }));
226
+ },
227
+ async getRecommendedTimeoutMillis(originalTimeout) {
228
+ return originalTimeout;
229
+ },
230
+ };
231
+ return Object.freeze(adapter);
232
+ }
233
+ //# sourceMappingURL=react-native-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-native-adapter.js","sourceRoot":"","sources":["../src/react-native-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,YAAY,CAAC;AAkEpB,SAAS,MAAM,CACb,KAAc,EACd,IAAY;IAEZ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAA0C,CAAC;AACpD,CAAC;AAED,SAAS,cAAc,CACrB,KAAc,EACd,IAAY,EACZ,OAA0B;IAE1B,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;YAC5C,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,iBAAiB,MAAM,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;QAC3E,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,KAA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E,OAAO,CAAC,QAAQ,EAAE,CAAC,CACpE,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,2BAA2B,CAAC,eAAuB;YACvD,OAAO,eAAe,CAAC;QACzB,CAAC;KACF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type AccessibilityService } from "./index.js";
2
+ /** Resolves the pinned accessibility TurboModule without AccessibilityInfo.js. */
3
+ export declare function createReactNativeAccessibilityService(): AccessibilityService;
4
+ export type { AccessibilityAnnouncement, AccessibilityAnnouncementPriority, AccessibilityPlatform, AccessibilityPreferenceChange, AccessibilityPreferenceKey, AccessibilityPreferences, AccessibilityService, AccessibilitySubscription, AccessibilitySubscriptionOptions, AndroidAccessibilityPreferences, IOSAccessibilityPreferences, } from "./index.js";
5
+ //# sourceMappingURL=react-native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AAuBpB,kFAAkF;AAClF,wBAAgB,qCAAqC,IAAI,oBAAoB,CAyB5E;AAED,YAAY,EACV,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
@@ -0,0 +1,31 @@
1
+ import RCTDeviceEventEmitterModule from "react-native/Libraries/EventEmitter/RCTDeviceEventEmitter";
2
+ import { get, getEnforcing, } from "react-native/Libraries/TurboModule/TurboModuleRegistry";
3
+ import { assertVerifiedReactNativePlatform } from "@solidnative-dev/react-native-compat";
4
+ import { createAccessibilityService, } from "./index.js";
5
+ import { createAndroidAccessibilityAdapter, createIOSAccessibilityAdapter, } from "./react-native-adapter.js";
6
+ let service;
7
+ function platform() {
8
+ return assertVerifiedReactNativePlatform(getEnforcing("PlatformConstants").getConstants(), "Native accessibility").platform;
9
+ }
10
+ /** Resolves the pinned accessibility TurboModule without AccessibilityInfo.js. */
11
+ export function createReactNativeAccessibilityService() {
12
+ if (service !== undefined)
13
+ return service;
14
+ const nativePlatform = platform();
15
+ const emitter = RCTDeviceEventEmitterModule;
16
+ if (nativePlatform === "android") {
17
+ const module = get("AccessibilityInfo");
18
+ if (module === null) {
19
+ throw new Error("The Android AccessibilityInfo TurboModule is unavailable.");
20
+ }
21
+ service = createAccessibilityService(createAndroidAccessibilityAdapter(module, emitter));
22
+ return service;
23
+ }
24
+ const module = get("AccessibilityManager");
25
+ if (module === null) {
26
+ throw new Error("The iOS AccessibilityManager TurboModule is unavailable.");
27
+ }
28
+ service = createAccessibilityService(createIOSAccessibilityAdapter(module, emitter));
29
+ return service;
30
+ }
31
+ //# sourceMappingURL=react-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-native.js","sourceRoot":"","sources":["../src/react-native.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,2DAA2D,CAAC;AACpG,OAAO,EACL,GAAG,EACH,YAAY,GACb,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EACL,0BAA0B,GAE3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iCAAiC,EACjC,6BAA6B,GAI9B,MAAM,2BAA2B,CAAC;AAOnC,IAAI,OAAyC,CAAC;AAE9C,SAAS,QAAQ;IACf,OAAO,iCAAiC,CACtC,YAAY,CAA0B,mBAAmB,CAAC,CAAC,YAAY,EAAE,EACzE,sBAAsB,CACvB,CAAC,QAAQ,CAAC;AACb,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,qCAAqC;IACnD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC1C,MAAM,cAAc,GAAG,QAAQ,EAAE,CAAC;IAClC,MAAM,OAAO,GACX,2BAAyE,CAAC;IAC5E,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,CAA6B,mBAAmB,CAAC,CAAC;QACpE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,0BAA0B,CAClC,iCAAiC,CAAC,MAAM,EAAE,OAAO,CAAC,CACnD,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAgC,sBAAsB,CAAC,CAAC;IAC1E,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,GAAG,0BAA0B,CAClC,6BAA6B,CAAC,MAAM,EAAE,OAAO,CAAC,CAC/C,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type AppStateSource } from "@solidnative-dev/core";
2
+ import { type Accessor } from "solid-js";
3
+ import { type AccessibilityAnnouncement, type AccessibilityPreferences, type AccessibilityService, type AndroidAccessibilityPreferences, type IOSAccessibilityPreferences } from "./index.js";
4
+ export type AccessibilityPreferencesStatus = "loading" | "ready" | "refreshing" | "error";
5
+ export interface AccessibilityPreferencesOptions {
6
+ /** Refreshes the complete native snapshot after each inactive-to-active transition. */
7
+ readonly appState?: AppStateSource;
8
+ readonly onError?: (error: unknown) => unknown;
9
+ }
10
+ export interface AccessibilityPreferencesControllerCommon {
11
+ readonly platform: "android" | "ios";
12
+ readonly status: Accessor<AccessibilityPreferencesStatus>;
13
+ readonly error: Accessor<unknown>;
14
+ readonly snapshot: Accessor<AccessibilityPreferences | undefined>;
15
+ /** Settles with the owner-bound initial native preference query. */
16
+ readonly ready: Promise<void>;
17
+ readonly screenReaderEnabled: Accessor<boolean | undefined>;
18
+ readonly reduceMotionEnabled: Accessor<boolean | undefined>;
19
+ readonly invertColorsEnabled: Accessor<boolean | undefined>;
20
+ readonly grayscaleEnabled: Accessor<boolean | undefined>;
21
+ refresh(): Promise<void>;
22
+ announce(request: string | AccessibilityAnnouncement): void;
23
+ getRecommendedTimeoutMillis(originalTimeout: number): Promise<number>;
24
+ }
25
+ export interface AndroidAccessibilityPreferencesController extends AccessibilityPreferencesControllerCommon {
26
+ readonly platform: "android";
27
+ readonly snapshot: Accessor<AndroidAccessibilityPreferences | undefined>;
28
+ readonly highTextContrastEnabled: Accessor<boolean | undefined>;
29
+ readonly accessibilityServiceEnabled: Accessor<boolean | undefined>;
30
+ }
31
+ export interface IOSAccessibilityPreferencesController extends AccessibilityPreferencesControllerCommon {
32
+ readonly platform: "ios";
33
+ readonly snapshot: Accessor<IOSAccessibilityPreferences | undefined>;
34
+ readonly boldTextEnabled: Accessor<boolean | undefined>;
35
+ readonly darkerSystemColorsEnabled: Accessor<boolean | undefined>;
36
+ readonly reduceTransparencyEnabled: Accessor<boolean | undefined>;
37
+ readonly prefersCrossFadeTransitions: Accessor<boolean | undefined>;
38
+ }
39
+ export type AccessibilityPreferencesController = AndroidAccessibilityPreferencesController | IOSAccessibilityPreferencesController;
40
+ /**
41
+ * Loads accessibility preferences, projects changes into fine-grained Solid
42
+ * accessors, and owns the native subscription with the current Solid owner.
43
+ * Preference values and announcement content are not causal telemetry fields.
44
+ */
45
+ export declare function createAccessibilityPreferences(service: AccessibilityService, options?: AccessibilityPreferencesOptions): AccessibilityPreferencesController;
46
+ export type { AccessibilityAnnouncement, AccessibilityAnnouncementPriority, AccessibilityPlatform, AccessibilityPreferenceChange, AccessibilityPreferenceKey, AccessibilityPreferences, AccessibilityService, AccessibilitySubscription, AndroidAccessibilityPreferences, IOSAccessibilityPreferences, } from "./index.js";
47
+ export type { AppStateSource, AppStateStatus } from "@solidnative-dev/core";
48
+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kCAAkC,CAqOpC;AAED,YAAY,EACV,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/solid.js ADDED
@@ -0,0 +1,281 @@
1
+ import { createCausalPlatformEventHandler, } from "@solidnative-dev/core";
2
+ import { action, createMemo, createSignal, getOwner, onCleanup, untrack, } from "solid-js";
3
+ import {} from "./index.js";
4
+ function reportError(error, options) {
5
+ try {
6
+ const reported = options.onError?.(error);
7
+ void Promise.resolve(reported).catch(() => undefined);
8
+ }
9
+ catch {
10
+ // Diagnostics cannot break native delivery, refresh, or owner cleanup.
11
+ }
12
+ }
13
+ function validateService(service) {
14
+ if (service === null || typeof service !== "object") {
15
+ throw new TypeError("Accessibility preferences require an AccessibilityService.");
16
+ }
17
+ if (service.platform !== "android" && service.platform !== "ios") {
18
+ throw new TypeError("Accessibility service platform must be android or ios.");
19
+ }
20
+ for (const method of [
21
+ "getPreferences",
22
+ "subscribe",
23
+ "announce",
24
+ "getRecommendedTimeoutMillis",
25
+ ]) {
26
+ if (typeof service[method] !== "function") {
27
+ throw new TypeError(`Accessibility service must provide ${method}().`);
28
+ }
29
+ }
30
+ }
31
+ function validateAppStateSource(source) {
32
+ if (source === undefined)
33
+ return;
34
+ if (source === null || typeof source !== "object") {
35
+ throw new TypeError("Accessibility appState must be an AppStateSource.");
36
+ }
37
+ if (source.initialAppState !== "active" &&
38
+ source.initialAppState !== "background" &&
39
+ source.initialAppState !== "extension" &&
40
+ source.initialAppState !== "inactive" &&
41
+ source.initialAppState !== "unknown") {
42
+ throw new TypeError("Accessibility appState initialAppState is unsupported.");
43
+ }
44
+ if (typeof source.subscribeAppState !== "function") {
45
+ throw new TypeError("Accessibility appState must provide subscribeAppState().");
46
+ }
47
+ }
48
+ function validateAppStateStatus(value) {
49
+ if (value !== "active" &&
50
+ value !== "background" &&
51
+ value !== "extension" &&
52
+ value !== "inactive" &&
53
+ value !== "unknown") {
54
+ throw new TypeError("Accessibility appState delivered an unsupported state.");
55
+ }
56
+ return value;
57
+ }
58
+ function applyChanges(snapshot, changes, afterRevision = -1) {
59
+ const next = { ...snapshot };
60
+ for (const [preference, change] of changes) {
61
+ if (change.revision > afterRevision)
62
+ next[preference] = change.enabled;
63
+ }
64
+ return Object.freeze(next);
65
+ }
66
+ /**
67
+ * Loads accessibility preferences, projects changes into fine-grained Solid
68
+ * accessors, and owns the native subscription with the current Solid owner.
69
+ * Preference values and announcement content are not causal telemetry fields.
70
+ */
71
+ export function createAccessibilityPreferences(service, options = {}) {
72
+ validateService(service);
73
+ if (getOwner() === null) {
74
+ throw new Error("createAccessibilityPreferences requires an active Solid owner.");
75
+ }
76
+ if (options === null ||
77
+ typeof options !== "object" ||
78
+ Array.isArray(options)) {
79
+ throw new TypeError("Accessibility preferences options must be an object.");
80
+ }
81
+ if (options.onError !== undefined && typeof options.onError !== "function") {
82
+ throw new TypeError("Accessibility preferences onError must be a function.");
83
+ }
84
+ validateAppStateSource(options.appState);
85
+ const [snapshot, setSnapshot] = createSignal();
86
+ const [status, setStatus] = createSignal("loading");
87
+ const [error, setError] = createSignal();
88
+ const latestChanges = new Map();
89
+ let active = true;
90
+ let changeRevision = 0;
91
+ let hasLoaded = false;
92
+ let refreshSequence = 0;
93
+ const publishError = (failure) => {
94
+ setError(() => failure);
95
+ reportError(failure, options);
96
+ };
97
+ const applyChange = createCausalPlatformEventHandler("platform.accessibility.preference", (change) => {
98
+ if (!active)
99
+ return;
100
+ latestChanges.set(change.preference, {
101
+ enabled: change.enabled,
102
+ revision: ++changeRevision,
103
+ });
104
+ const current = untrack(snapshot);
105
+ if (current === undefined)
106
+ return;
107
+ setSnapshot(applyChanges(current, latestChanges, changeRevision - 1));
108
+ setError(undefined);
109
+ setStatus("ready");
110
+ });
111
+ const subscription = service.subscribe((change) => {
112
+ if (!active)
113
+ return;
114
+ applyChange(change);
115
+ }, {
116
+ onError: publishError,
117
+ });
118
+ const runRefresh = action(function* () {
119
+ if (!active)
120
+ return;
121
+ const sequence = ++refreshSequence;
122
+ // Before the first successful query, retain any event delivered after the
123
+ // subscription was installed. Later queries need only overlay events that
124
+ // raced that specific native request; older events are already reflected
125
+ // by the platform query and must not make refresh() permanently stale.
126
+ const queryStartRevision = hasLoaded ? changeRevision : -1;
127
+ setStatus(untrack(snapshot) === undefined ? "loading" : "refreshing");
128
+ setError(undefined);
129
+ try {
130
+ const next = yield service.getPreferences();
131
+ if (!active || sequence !== refreshSequence)
132
+ return;
133
+ setSnapshot(applyChanges(next, latestChanges, queryStartRevision));
134
+ hasLoaded = true;
135
+ setStatus("ready");
136
+ }
137
+ catch (failure) {
138
+ if (!active || sequence !== refreshSequence)
139
+ return;
140
+ setStatus("error");
141
+ publishError(failure);
142
+ throw failure;
143
+ }
144
+ });
145
+ const refresh = () => {
146
+ return runRefresh();
147
+ };
148
+ let appStateSubscription;
149
+ if (options.appState !== undefined) {
150
+ let wasActive = options.appState.initialAppState === "active";
151
+ try {
152
+ appStateSubscription = options.appState.subscribeAppState((value) => {
153
+ if (!active)
154
+ return;
155
+ let state;
156
+ try {
157
+ state = validateAppStateStatus(value);
158
+ }
159
+ catch (failure) {
160
+ publishError(failure);
161
+ return;
162
+ }
163
+ const isActive = state === "active";
164
+ if (isActive && !wasActive) {
165
+ // A source may deliver synchronously while a component is being
166
+ // constructed. Start the Solid action after the owned computation.
167
+ void Promise.resolve()
168
+ .then(refresh)
169
+ .catch(() => undefined);
170
+ }
171
+ wasActive = isActive;
172
+ });
173
+ if (appStateSubscription === null ||
174
+ typeof appStateSubscription !== "object" ||
175
+ typeof appStateSubscription.remove !== "function") {
176
+ throw new TypeError("Accessibility appState subscription must provide remove().");
177
+ }
178
+ }
179
+ catch (failure) {
180
+ // A source may synchronously request a refresh before failing setup.
181
+ // Retire the controller before rolling back its first subscription so
182
+ // that queued work cannot outlive the failed construction.
183
+ active = false;
184
+ refreshSequence++;
185
+ try {
186
+ subscription.remove();
187
+ }
188
+ catch (cleanupFailure) {
189
+ reportError(cleanupFailure, options);
190
+ }
191
+ throw failure;
192
+ }
193
+ }
194
+ onCleanup(() => {
195
+ if (!active)
196
+ return;
197
+ active = false;
198
+ refreshSequence++;
199
+ try {
200
+ subscription.remove();
201
+ }
202
+ catch (failure) {
203
+ reportError(failure, options);
204
+ }
205
+ try {
206
+ appStateSubscription?.remove();
207
+ }
208
+ catch (failure) {
209
+ reportError(failure, options);
210
+ }
211
+ });
212
+ // Component construction is an owned computation in Solid 2. Start the
213
+ // initial imperative action after that computation returns.
214
+ const ready = Promise.resolve().then(refresh);
215
+ void ready.catch(() => undefined);
216
+ const common = {
217
+ platform: service.platform,
218
+ status,
219
+ error,
220
+ snapshot,
221
+ ready,
222
+ screenReaderEnabled: createMemo(() => snapshot()?.screenReaderEnabled),
223
+ reduceMotionEnabled: createMemo(() => snapshot()?.reduceMotionEnabled),
224
+ invertColorsEnabled: createMemo(() => snapshot()?.invertColorsEnabled),
225
+ grayscaleEnabled: createMemo(() => snapshot()?.grayscaleEnabled),
226
+ refresh,
227
+ announce(request) {
228
+ service.announce(request);
229
+ },
230
+ getRecommendedTimeoutMillis(originalTimeout) {
231
+ return service.getRecommendedTimeoutMillis(originalTimeout);
232
+ },
233
+ };
234
+ if (service.platform === "android") {
235
+ return Object.freeze({
236
+ ...common,
237
+ platform: "android",
238
+ snapshot: snapshot,
239
+ highTextContrastEnabled: createMemo(() => {
240
+ const value = snapshot();
241
+ return value?.platform === "android"
242
+ ? value.highTextContrastEnabled
243
+ : undefined;
244
+ }),
245
+ accessibilityServiceEnabled: createMemo(() => {
246
+ const value = snapshot();
247
+ return value?.platform === "android"
248
+ ? value.accessibilityServiceEnabled
249
+ : undefined;
250
+ }),
251
+ });
252
+ }
253
+ return Object.freeze({
254
+ ...common,
255
+ platform: "ios",
256
+ snapshot: snapshot,
257
+ boldTextEnabled: createMemo(() => {
258
+ const value = snapshot();
259
+ return value?.platform === "ios" ? value.boldTextEnabled : undefined;
260
+ }),
261
+ darkerSystemColorsEnabled: createMemo(() => {
262
+ const value = snapshot();
263
+ return value?.platform === "ios"
264
+ ? value.darkerSystemColorsEnabled
265
+ : undefined;
266
+ }),
267
+ reduceTransparencyEnabled: createMemo(() => {
268
+ const value = snapshot();
269
+ return value?.platform === "ios"
270
+ ? value.reduceTransparencyEnabled
271
+ : undefined;
272
+ }),
273
+ prefersCrossFadeTransitions: createMemo(() => {
274
+ const value = snapshot();
275
+ return value?.platform === "ios"
276
+ ? value.prefersCrossFadeTransitions
277
+ : undefined;
278
+ }),
279
+ });
280
+ }
281
+ //# sourceMappingURL=solid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.js","sourceRoot":"","sources":["../src/solid.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,GAGjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,OAAO,GAER,MAAM,UAAU,CAAC;AAElB,OAAO,EAQN,MAAM,YAAY,CAAC;AA+CpB,SAAS,WAAW,CAClB,KAAc,EACd,OAAwC;IAExC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1C,KAAK,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;IACzE,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,OAA6B;IACpD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACpD,MAAM,IAAI,SAAS,CACjB,4DAA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B,CAAC,CAAC,KAAK,CAAC,yBAAyB;gBACjC,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC,CAAC;QACF,2BAA2B,EAAE,UAAU,CAAC,GAAG,EAAE;YAC3C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;YACzB,OAAO,KAAK,EAAE,QAAQ,KAAK,KAAK;gBAC9B,CAAC,CAAC,KAAK,CAAC,2BAA2B;gBACnC,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "@solidnative-dev/accessibility",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-beta.0",
4
+ "type": "module",
5
+ "description": "Validated native accessibility preferences and Solid-owned reactive state.",
6
+ "license": "MIT",
7
+ "homepage": "https://solidnative.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/solid-native/solid-native.git",
11
+ "directory": "packages/accessibility"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "engines": {
17
+ "node": "^22.13.0 || ^24.3.0 || >=26.0.0"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./react-native": {
25
+ "types": "./dist/react-native.d.ts",
26
+ "default": "./dist/react-native.js"
27
+ },
28
+ "./solid": {
29
+ "types": "./dist/solid.d.ts",
30
+ "default": "./dist/solid.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist/index.d.ts",
35
+ "dist/index.d.ts.map",
36
+ "dist/index.js",
37
+ "dist/index.js.map",
38
+ "dist/react-native.d.ts",
39
+ "dist/react-native.d.ts.map",
40
+ "dist/react-native.js",
41
+ "dist/react-native.js.map",
42
+ "dist/react-native-adapter.d.ts",
43
+ "dist/react-native-adapter.d.ts.map",
44
+ "dist/react-native-adapter.js",
45
+ "dist/react-native-adapter.js.map",
46
+ "dist/solid.d.ts",
47
+ "dist/solid.d.ts.map",
48
+ "dist/solid.js",
49
+ "dist/solid.js.map"
50
+ ],
51
+ "dependencies": {
52
+ "@solidnative-dev/core": "0.1.0-beta.0",
53
+ "@solidnative-dev/react-native-compat": "0.1.0-beta.0"
54
+ },
55
+ "peerDependencies": {
56
+ "solid-js": "2.0.4"
57
+ },
58
+ "devDependencies": {
59
+ "solid-js": "2.0.4"
60
+ },
61
+ "scripts": {
62
+ "build": "tsc -p tsconfig.json",
63
+ "check": "tsc -p tsconfig.json --noEmit",
64
+ "test": "pnpm build && node --conditions=browser --test test/*.test.mjs"
65
+ }
6
66
  }