@flighthq/accessibility 0.5.1-next.1069.554a2ac → 0.5.1-next.1201.9b49dee

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/accessibility`. The
13
13
  This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
14
14
 
15
15
  - [Flight project](https://github.com/flighthq/flight)
16
- - [Source for @flighthq/accessibility@0.5.1-next.1069.554a2ac](https://github.com/flighthq/flight/tree/554a2acc3fecf189b89b0729308ff890a15c21cc/packages/accessibility)
17
- - [License](https://github.com/flighthq/flight/blob/554a2acc3fecf189b89b0729308ff890a15c21cc/LICENSE.md)
16
+ - [Source for @flighthq/accessibility@0.5.1-next.1201.9b49dee](https://github.com/flighthq/flight/tree/9b49dee3f22f6b2838c3d237edcc77bca65734f2/packages/accessibility)
17
+ - [License](https://github.com/flighthq/flight/blob/9b49dee3f22f6b2838c3d237edcc77bca65734f2/LICENSE.md)
@@ -1,8 +1,8 @@
1
- import type { AccessibilityLiveness, AccessibilityNode, AccessibilityOperationOutcome, HasAccessibilityProvider } from '@flighthq/types/contract';
2
- export declare function announceAccessibility(host: HasAccessibilityProvider, message: string, liveness?: AccessibilityLiveness): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
3
- export declare function clearAccessibilityTree(host: HasAccessibilityProvider): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
4
- export declare function destroyAccessibility(host: HasAccessibilityProvider): void;
5
- export declare function removeAccessibilityNode(host: HasAccessibilityProvider, id: string): AccessibilityOperationOutcome<'destroyed' | 'no-dom' | 'node-not-found'>;
6
- export declare function setAccessibilityFocus(host: HasAccessibilityProvider, id: string): AccessibilityOperationOutcome<'destroyed' | 'focus-not-moved' | 'no-dom' | 'node-not-found'>;
7
- export declare function setAccessibilityNode(host: HasAccessibilityProvider, node: Readonly<AccessibilityNode>): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
1
+ import type { AccessibilityLiveness, AccessibilityNode, AccessibilityOperationOutcome, HostAccessibilityProvider } from '@flighthq/types/contract';
2
+ export declare function announceAccessibility(hostAccessibility: Readonly<HostAccessibilityProvider>, message: string, liveness?: AccessibilityLiveness): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
3
+ export declare function clearAccessibilityTree(hostAccessibility: Readonly<HostAccessibilityProvider>): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
4
+ export declare function destroyAccessibility(hostAccessibility: Readonly<HostAccessibilityProvider>): void;
5
+ export declare function removeAccessibilityNode(hostAccessibility: Readonly<HostAccessibilityProvider>, id: string): AccessibilityOperationOutcome<'destroyed' | 'no-dom' | 'node-not-found'>;
6
+ export declare function setAccessibilityFocus(hostAccessibility: Readonly<HostAccessibilityProvider>, id: string): AccessibilityOperationOutcome<'destroyed' | 'focus-not-moved' | 'no-dom' | 'node-not-found'>;
7
+ export declare function setAccessibilityNode(hostAccessibility: Readonly<HostAccessibilityProvider>, node: Readonly<AccessibilityNode>): AccessibilityOperationOutcome<'destroyed' | 'no-dom'>;
8
8
  //# sourceMappingURL=accessibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../src/accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,wBAAwB,EAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,qBAAgC,GACzC,6BAA6B,CAAC,WAAW,GAAG,QAAQ,CAAC,CAEvD;AAGD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,wBAAwB,GAC7B,6BAA6B,CAAC,WAAW,GAAG,QAAQ,CAAC,CAEvD;AAID,wBAAgB,oBAAoB,CAAC,IA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,CACnC,iBAAiB,EAAE,QAAQ,CAAC,yBAAyB,CAAC,EACtD,EAAE,EAAE,MAAM,GACT,6BAA6B,CAAC,WAAW,GAAG,iBAAiB,GAAG,QAAQ,GAAG,gBAAgB,CAAC,CAE9F;AAGD,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,QAAQ,CAAC,yBAAyB,CAAC,EACtD,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAChC,6BAA6B,CAAC,WAAW,GAAG,QAAQ,CAAC,CAEvD"}
@@ -1,26 +1,26 @@
1
1
  // Speaks a transient message through the explicitly selected Host provider.
2
- export function announceAccessibility(host, message, liveness = 'polite') {
3
- return host.accessibility.provider.announce(message, liveness);
2
+ export function announceAccessibility(hostAccessibility, message, liveness = 'polite') {
3
+ return hostAccessibility.announce(message, liveness);
4
4
  }
5
5
  // Empties the selected Host provider's mirrored tree while leaving the provider reusable.
6
- export function clearAccessibilityTree(host) {
7
- return host.accessibility.provider.clear();
6
+ export function clearAccessibilityTree(hostAccessibility) {
7
+ return hostAccessibility.clear();
8
8
  }
9
9
  // Terminates the selected Host provider and frees the non-GC resources it owns. Provider destruction
10
10
  // is idempotent; callers that share one provider across Hosts retain responsibility for its final release.
11
- export function destroyAccessibility(host) {
12
- host.accessibility.provider.destroy();
11
+ export function destroyAccessibility(hostAccessibility) {
12
+ hostAccessibility.destroy();
13
13
  }
14
14
  // Removes a node and its entire descendant subtree from the selected Host provider.
15
- export function removeAccessibilityNode(host, id) {
16
- return host.accessibility.provider.removeNode(id);
15
+ export function removeAccessibilityNode(hostAccessibility, id) {
16
+ return hostAccessibility.removeNode(id);
17
17
  }
18
18
  // Moves platform focus to a node published by the selected Host provider.
19
- export function setAccessibilityFocus(host, id) {
20
- return host.accessibility.provider.setFocus(id);
19
+ export function setAccessibilityFocus(hostAccessibility, id) {
20
+ return hostAccessibility.setFocus(id);
21
21
  }
22
22
  // Registers or updates a node in the selected Host provider's mirrored tree.
23
- export function setAccessibilityNode(host, node) {
24
- return host.accessibility.provider.setNode(node);
23
+ export function setAccessibilityNode(hostAccessibility, node) {
24
+ return hostAccessibility.setNode(node);
25
25
  }
26
26
  //# sourceMappingURL=accessibility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessibility.js","sourceRoot":"","sources":["../src/accessibility.ts"],"names":[],"mappings":"AAOA,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CACnC,IAA8B,EAC9B,OAAe,EACf,WAAkC,QAAQ;IAE1C,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,sBAAsB,CACpC,IAA8B;IAE9B,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED,qGAAqG;AACrG,2GAA2G;AAC3G,MAAM,UAAU,oBAAoB,CAAC,IAA8B;IACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;AACxC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CACrC,IAA8B,EAC9B,EAAU;IAEV,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CACnC,IAA8B,EAC9B,EAAU;IAEV,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAClC,IAA8B,EAC9B,IAAiC;IAEjC,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC"}
1
+ {"version":3,"file":"accessibility.js","sourceRoot":"","sources":["../src/accessibility.ts"],"names":[],"mappings":"AAOA,4EAA4E;AAC5E,MAAM,UAAU,qBAAqB,CACnC,iBAAsD,EACtD,OAAe,EACf,WAAkC,QAAQ;IAE1C,OAAO,iBAAiB,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,sBAAsB,CACpC,iBAAsD;IAEtD,OAAO,iBAAiB,CAAC,KAAK,EAAE,CAAC;AACnC,CAAC;AAED,qGAAqG;AACrG,2GAA2G;AAC3G,MAAM,UAAU,oBAAoB,CAAC,iBAAsD;IACzF,iBAAiB,CAAC,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CACrC,iBAAsD,EACtD,EAAU;IAEV,OAAO,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CACnC,iBAAsD,EACtD,EAAU;IAEV,OAAO,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAClC,iBAAsD,EACtD,IAAiC;IAEjC,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/accessibility",
3
- "version": "0.5.1-next.1069.554a2ac",
3
+ "version": "0.5.1-next.1201.9b49dee",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/types": "0.5.1-next.1069.554a2ac"
41
+ "@flighthq/types": "0.5.1-next.1201.9b49dee"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "^5.3.0"
@@ -1,5 +1,5 @@
1
1
  import { EntityRuntimeKey } from '@flighthq/types/contract';
2
- import type { AccessibilityBackend, AccessibilityNode, EntityWithoutRuntime } from '@flighthq/types/contract';
2
+ import type { HostAccessibilityProvider, AccessibilityNode, EntityWithoutRuntime } from '@flighthq/types/contract';
3
3
  import { vi } from 'vitest';
4
4
 
5
5
  import {
@@ -16,7 +16,7 @@ describe('announceAccessibility', () => {
16
16
  const provider = createProvider();
17
17
  const host = { accessibility: { provider } };
18
18
 
19
- expect(announceAccessibility(host, 'saved')).toEqual({ reason: 'ok' });
19
+ expect(announceAccessibility(host.accessibility.provider, 'saved')).toEqual({ reason: 'ok' });
20
20
  expect(provider.announce).toHaveBeenCalledWith('saved', 'polite');
21
21
  });
22
22
  });
@@ -25,7 +25,9 @@ describe('clearAccessibilityTree', () => {
25
25
  it('returns the selected Host provider outcome', () => {
26
26
  const provider = createProvider({ clear: vi.fn(() => ({ reason: 'no-dom' as const })) });
27
27
 
28
- expect(clearAccessibilityTree({ accessibility: { provider } })).toEqual({ reason: 'no-dom' });
28
+ expect(clearAccessibilityTree({ accessibility: { provider } }.accessibility.provider)).toEqual({
29
+ reason: 'no-dom',
30
+ });
29
31
  });
30
32
  });
31
33
 
@@ -34,7 +36,7 @@ describe('destroyAccessibility', () => {
34
36
  const first = createProvider();
35
37
  const second = createProvider();
36
38
 
37
- destroyAccessibility({ accessibility: { provider: first } });
39
+ destroyAccessibility({ accessibility: { provider: first } }.accessibility.provider);
38
40
 
39
41
  expect(first.destroy).toHaveBeenCalledOnce();
40
42
  expect(second.destroy).not.toHaveBeenCalled();
@@ -45,7 +47,7 @@ describe('removeAccessibilityNode', () => {
45
47
  it('forwards the node id and returns a node-not-found outcome', () => {
46
48
  const provider = createProvider({ removeNode: vi.fn(() => ({ reason: 'node-not-found' as const })) });
47
49
 
48
- expect(removeAccessibilityNode({ accessibility: { provider } }, 'missing')).toEqual({
50
+ expect(removeAccessibilityNode({ accessibility: { provider } }.accessibility.provider, 'missing')).toEqual({
49
51
  reason: 'node-not-found',
50
52
  });
51
53
  expect(provider.removeNode).toHaveBeenCalledWith('missing');
@@ -56,7 +58,7 @@ describe('setAccessibilityFocus', () => {
56
58
  it('forwards the node id and returns a focus-not-moved outcome', () => {
57
59
  const provider = createProvider({ setFocus: vi.fn(() => ({ reason: 'focus-not-moved' as const })) });
58
60
 
59
- expect(setAccessibilityFocus({ accessibility: { provider } }, 'subject')).toEqual({
61
+ expect(setAccessibilityFocus({ accessibility: { provider } }.accessibility.provider, 'subject')).toEqual({
60
62
  reason: 'focus-not-moved',
61
63
  });
62
64
  expect(provider.setFocus).toHaveBeenCalledWith('subject');
@@ -69,14 +71,18 @@ describe('setAccessibilityNode', () => {
69
71
  const second = createProvider();
70
72
  const subject: AccessibilityNode = { id: 'subject', label: 'Subject', role: 'button' };
71
73
 
72
- expect(setAccessibilityNode({ accessibility: { provider: first } }, subject)).toEqual({ reason: 'ok' });
74
+ expect(setAccessibilityNode({ accessibility: { provider: first } }.accessibility.provider, subject)).toEqual({
75
+ reason: 'ok',
76
+ });
73
77
 
74
78
  expect(first.setNode).toHaveBeenCalledWith(subject);
75
79
  expect(second.setNode).not.toHaveBeenCalled();
76
80
  });
77
81
  });
78
82
 
79
- function createProvider(overrides: Partial<EntityWithoutRuntime<AccessibilityBackend>> = {}): AccessibilityBackend {
83
+ function createProvider(
84
+ overrides: Partial<EntityWithoutRuntime<HostAccessibilityProvider>> = {},
85
+ ): HostAccessibilityProvider {
80
86
  return {
81
87
  [EntityRuntimeKey]: undefined,
82
88
  announce: vi.fn(() => ({ reason: 'ok' as const })),