@fluentui-react-native/focus-zone 0.23.5 → 0.23.7
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/CHANGELOG.md +20 -0
- package/README.md +19 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/package.json +12 -29
- package/src/index.ts +3 -4
- package/.cache/tsconfig.tsbuildinfo +0 -1
- package/RCTFocusZone.podspec +0 -21
- package/SPEC.md +0 -47
- package/jest.config.cjs +0 -1
- package/lib/FocusZone.d.ts +0 -5
- package/lib/FocusZone.d.ts.map +0 -1
- package/lib/FocusZone.js +0 -33
- package/lib/FocusZone.js.map +0 -1
- package/lib/FocusZone.types.d.ts +0 -94
- package/lib/FocusZone.types.d.ts.map +0 -1
- package/lib/FocusZone.types.js +0 -2
- package/lib/FocusZone.types.js.map +0 -1
- package/lib/FocusZoneNativeComponent.d.ts +0 -16
- package/lib/FocusZoneNativeComponent.d.ts.map +0 -1
- package/lib/FocusZoneNativeComponent.js +0 -10
- package/lib/FocusZoneNativeComponent.js.map +0 -1
- package/lib/FocusZoneNativeComponent.win32.d.ts +0 -16
- package/lib/FocusZoneNativeComponent.win32.d.ts.map +0 -1
- package/lib/FocusZoneNativeComponent.win32.js +0 -3
- package/lib/FocusZoneNativeComponent.win32.js.map +0 -1
- package/lib/__tests__/FocusZone.test.d.ts +0 -2
- package/lib/__tests__/FocusZone.test.d.ts.map +0 -1
- package/lib/__tests__/FocusZone.test.js +0 -81
- package/lib/__tests__/FocusZone.test.js.map +0 -1
- package/lib/__tests__/FocusZone.types.test.d.ts +0 -2
- package/lib/__tests__/FocusZone.types.test.d.ts.map +0 -1
- package/lib/__tests__/FocusZone.types.test.js +0 -26
- package/lib/__tests__/FocusZone.types.test.js.map +0 -1
- package/macos/KeyCodes.h +0 -10
- package/macos/RCTFocusZone.h +0 -22
- package/macos/RCTFocusZone.m +0 -677
- package/macos/RCTFocusZoneComponentView.h +0 -14
- package/macos/RCTFocusZoneComponentView.mm +0 -201
- package/macos/RCTFocusZoneManager.h +0 -6
- package/macos/RCTFocusZoneManager.m +0 -58
- package/react-native.config.cjs +0 -15
- package/src/FocusZone.tsx +0 -50
- package/src/FocusZone.types.ts +0 -124
- package/src/FocusZoneNativeComponent.ts +0 -26
- package/src/FocusZoneNativeComponent.win32.ts +0 -18
- package/src/__tests__/FocusZone.test.tsx +0 -131
- package/src/__tests__/FocusZone.types.test.ts +0 -36
- package/tsconfig.json +0 -25
- package/windows/ExperimentalFeatures.props +0 -33
- package/windows/FRNFocusZone/FRNFocusZone.def +0 -3
- package/windows/FRNFocusZone/FRNFocusZone.rc +0 -0
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj +0 -147
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj.filters +0 -44
- package/windows/FRNFocusZone/FocusZoneComponentView.cpp +0 -590
- package/windows/FRNFocusZone/FocusZoneComponentView.h +0 -7
- package/windows/FRNFocusZone/ReactPackageProvider.cpp +0 -24
- package/windows/FRNFocusZone/ReactPackageProvider.h +0 -24
- package/windows/FRNFocusZone/ReactPackageProvider.idl +0 -9
- package/windows/FRNFocusZone/codegen/.clang-format +0 -2
- package/windows/FRNFocusZone/codegen/react/components/FRNFocusZoneSpec/FocusZone.g.h +0 -243
- package/windows/FRNFocusZone/packages.lock.json +0 -151
- package/windows/FRNFocusZone/pch.cpp +0 -1
- package/windows/FRNFocusZone/pch.h +0 -40
- package/windows/FRNFocusZone/resource.h +0 -5
- package/windows/FRNFocusZone/targetver.h +0 -8
- package/windows/FRNFocusZone.sln +0 -43
- package/windows/NuGet.Config +0 -13
package/SPEC.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# FocusZone
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
FocusZone is an unstyled native primitive that coordinates directional and Tab
|
|
6
|
-
keyboard navigation among focusable descendants. It remains a standalone package
|
|
7
|
-
because it owns native macOS code and CocoaPods integration.
|
|
8
|
-
|
|
9
|
-
## Contract
|
|
10
|
-
|
|
11
|
-
- `FocusZoneProps` extends React Native `ViewProps` with directional, circular,
|
|
12
|
-
Tab, disabled, and default-tabbable-element behavior.
|
|
13
|
-
- `defaultTabbableElement` accepts a React component ref or registered native
|
|
14
|
-
identifier.
|
|
15
|
-
- `componentRef` exposes the native view, including its `focus()` method.
|
|
16
|
-
- Children, accessibility props, test props, native events, and caller styles are
|
|
17
|
-
forwarded without theme tokens or appearance defaults.
|
|
18
|
-
- `isCircularNavigation` maps to the native `NavigateWrap` end behavior; otherwise
|
|
19
|
-
navigation stops at the ends.
|
|
20
|
-
|
|
21
|
-
## Platform behavior
|
|
22
|
-
|
|
23
|
-
- macOS includes both the existing Paper view manager and a package-owned Fabric
|
|
24
|
-
component view. Both reuse the same `RCTFocusZone` navigation implementation.
|
|
25
|
-
Directional movement is geometric; `use2DNavigation` does not switch AppKit to
|
|
26
|
-
the Windows linear mode. For example, Down from item 2 in a three-column grid
|
|
27
|
-
moves to item 5.
|
|
28
|
-
- Windows includes a package-owned Fabric component view that coordinates
|
|
29
|
-
directional, Home/End, Tab, and focus-restoration behavior through RNW
|
|
30
|
-
`ComponentView` focus APIs.
|
|
31
|
-
- Win32 continues to use its platform-provided native FocusZone implementation.
|
|
32
|
-
Windows/Win32 use linear movement by default and opt into geometric movement
|
|
33
|
-
with `use2DNavigation`.
|
|
34
|
-
- Unsupported behavior remains platform-defined rather than being simulated in
|
|
35
|
-
JavaScript.
|
|
36
|
-
|
|
37
|
-
## Compatibility
|
|
38
|
-
|
|
39
|
-
`FocusZoneState`, `FocusZoneTokens`, `FocusZoneSlotProps`,
|
|
40
|
-
`FocusZoneRenderData`, and `FocusZoneType` remain as deprecated compatibility
|
|
41
|
-
types.
|
|
42
|
-
|
|
43
|
-
## Demonstration
|
|
44
|
-
|
|
45
|
-
Interactive directional, circular, Tab, disabled, and default-focus scenarios
|
|
46
|
-
live with the agentic primitive stories in
|
|
47
|
-
`packages/agentic/components/src/primitives/focus-zone/focus-zone.stories.tsx`.
|
package/jest.config.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@fluentui-react-native/scripts/jest-config');
|
package/lib/FocusZone.d.ts
DELETED
package/lib/FocusZone.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.d.ts","sourceRoot":"","sources":["../src/FocusZone.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,SAAS,KAiCpB,CAAC"}
|
package/lib/FocusZone.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { findNodeHandle } from 'react-native';
|
|
5
|
-
import { directComponent, mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';
|
|
6
|
-
import { useViewCommandFocus } from '@fluentui-react-native/interactive-hooks';
|
|
7
|
-
import { focusZoneName } from './FocusZone.types';
|
|
8
|
-
import NativeFocusZone from './FocusZoneNativeComponent';
|
|
9
|
-
/**
|
|
10
|
-
* Renders the native FocusZone without applying theme or appearance defaults.
|
|
11
|
-
*/
|
|
12
|
-
export const FocusZone = phasedComponent((props) => {
|
|
13
|
-
const { componentRef, defaultTabbableElement } = props;
|
|
14
|
-
const nativeRef = useViewCommandFocus(componentRef);
|
|
15
|
-
const [nativeDefaultTabbableElement, setNativeDefaultTabbableElement] = React.useState();
|
|
16
|
-
React.useLayoutEffect(() => {
|
|
17
|
-
if (typeof defaultTabbableElement === 'string') {
|
|
18
|
-
setNativeDefaultTabbableElement(defaultTabbableElement);
|
|
19
|
-
}
|
|
20
|
-
else if (defaultTabbableElement?.current) {
|
|
21
|
-
setNativeDefaultTabbableElement(findNodeHandle(defaultTabbableElement.current) ?? undefined);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
setNativeDefaultTabbableElement(undefined);
|
|
25
|
-
}
|
|
26
|
-
}, [defaultTabbableElement]);
|
|
27
|
-
return directComponent((renderProps) => {
|
|
28
|
-
const { componentRef: _componentRef, defaultTabbableElement: _defaultTabbableElement, isCircularNavigation, navigateAtEnd = isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', ...nativeProps } = mergeProps(props, renderProps);
|
|
29
|
-
return (_jsx(NativeFocusZone, { ...nativeProps, defaultTabbableElement: nativeDefaultTabbableElement, navigateAtEnd: navigateAtEnd, ref: nativeRef }));
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
FocusZone.displayName = focusZoneName;
|
|
33
|
-
//# sourceMappingURL=FocusZone.js.map
|
package/lib/FocusZone.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.js","sourceRoot":"","sources":["../src/FocusZone.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAiB,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,YAAY,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACpD,MAAM,CAAC,4BAA4B,EAAE,+BAA+B,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAmB,CAAC;IAE1G,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,IAAI,OAAO,sBAAsB,KAAK,QAAQ,EAAE,CAAC;YAC/C,+BAA+B,CAAC,sBAAsB,CAAC,CAAC;QAC1D,CAAC;aAAM,IAAI,sBAAsB,EAAE,OAAO,EAAE,CAAC;YAC3C,+BAA+B,CAAC,cAAc,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC;QAC/F,CAAC;aAAM,CAAC;YACN,+BAA+B,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAE7B,OAAO,eAAe,CAAiB,CAAC,WAAW,EAAE,EAAE;QACrD,MAAM,EACJ,YAAY,EAAE,aAAa,EAC3B,sBAAsB,EAAE,uBAAuB,EAC/C,oBAAoB,EACpB,aAAa,GAAG,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,oBAAoB,EAC5E,GAAG,WAAW,EACf,GAAG,UAAU,CAAC,KAAK,EAAE,WAAW,CAAoG,CAAC;QAEtI,OAAO,CACL,KAAC,eAAe,OACV,WAAW,EACf,sBAAsB,EAAE,4BAA4B,EACpD,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,SAAS,GACd,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,WAAW,GAAG,aAAa,CAAC"}
|
package/lib/FocusZone.types.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react';
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
3
|
-
import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
4
|
-
export declare const focusZoneName = "FocusZone";
|
|
5
|
-
export type FocusZoneState = Record<never, never>;
|
|
6
|
-
export interface FocusZoneProps extends ViewProps {
|
|
7
|
-
/**
|
|
8
|
-
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
9
|
-
*/
|
|
10
|
-
componentRef?: React.RefObject<IFocusable>;
|
|
11
|
-
/**
|
|
12
|
-
* Optionally defines the initial tabbable element inside the FocusZone
|
|
13
|
-
*/
|
|
14
|
-
defaultTabbableElement?: React.RefObject<React.Component | null> | string;
|
|
15
|
-
/**
|
|
16
|
-
** Defines which arrows to react to
|
|
17
|
-
*/
|
|
18
|
-
focusZoneDirection?: FocusZoneDirection;
|
|
19
|
-
/**
|
|
20
|
-
** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
|
|
21
|
-
*/
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
isCircularNavigation?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Enables geometric rather than linear navigation on Windows/Win32.
|
|
26
|
-
* macOS always uses geometric directional navigation.
|
|
27
|
-
* @platform windows, win32
|
|
28
|
-
*/
|
|
29
|
-
use2DNavigation?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* By default, pressing Tab within a FocusZone moves focus out of the FocusZone.
|
|
32
|
-
* This prop allows you to change that behavior.
|
|
33
|
-
*
|
|
34
|
-
* "None" : Default
|
|
35
|
-
* "NavigateWrap" : Tab allowed within FZ with circular navigation behavior
|
|
36
|
-
* "NavigateStopAtEnds" : Tab allowed within FZ and stops at ends
|
|
37
|
-
* "Normal" : Tab allowed within FZ, and focus is not trapped. Tabbing at the last element bring you out of the FZ.
|
|
38
|
-
*
|
|
39
|
-
* Recommended Usage - Moving focus OUT of the FocusZone - Custom Key Handlers
|
|
40
|
-
* Example: Subscribe to key events. On the pressing of "Escape", move focus out of the FocusZone.
|
|
41
|
-
*
|
|
42
|
-
* Recommended Usage - Moving focus INTO the FocusZone
|
|
43
|
-
* Let's take a CardList, for example. If a user is navigating through elements of the List, we don't want
|
|
44
|
-
* focus to land within the FocusZone on initial focus. If it does, it will trap focus within the FocusZone and
|
|
45
|
-
* ruin the user's workflow.
|
|
46
|
-
* Instead, once focus lands on the parent of the FocusZone, implement a custom key handler that will enable
|
|
47
|
-
* the FocusZone.
|
|
48
|
-
*/
|
|
49
|
-
tabKeyNavigation?: FocusZoneTabNavigation;
|
|
50
|
-
/**
|
|
51
|
-
* @platform macos
|
|
52
|
-
* By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
|
|
53
|
-
* custom element overrides of navigation order, and positions in layout.
|
|
54
|
-
*
|
|
55
|
-
* Normally this produces the appropriate accessible experience for users, but occasionally we may need to
|
|
56
|
-
* clarify the intended order of navigation. The navigationOrderInRenderOrder prop will have the FocusZone
|
|
57
|
-
* establish the navigation order of its children according to their order in the UI tree
|
|
58
|
-
* (i.e. as returned by accessibilityChildren).
|
|
59
|
-
*
|
|
60
|
-
* Note that to participate in the KeyView loop calculation, the FocusZone itself must be part of the
|
|
61
|
-
* accessibility tree (i.e. 'accessible') with an appropriate role, e.g. 'group'.
|
|
62
|
-
*
|
|
63
|
-
* Extra note: This property is unlikely to perform well if changed from its initial value due to finer details
|
|
64
|
-
* of the MacOS KeyView loop mechanics.
|
|
65
|
-
*/
|
|
66
|
-
navigationOrderInRenderOrder?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export interface NativeProps extends Omit<FocusZoneProps, 'componentRef' | 'defaultTabbableElement' | 'isCircularNavigation'> {
|
|
69
|
-
defaultTabbableElement?: number | string;
|
|
70
|
-
navigateAtEnd?: NavigateAtEnd;
|
|
71
|
-
tabKeyNavigation?: FocusZoneTabNavigation;
|
|
72
|
-
}
|
|
73
|
-
export type FocusZoneDirection = 'bidirectional' /** React to all arrows. */ | 'vertical' /** Only react to up/down arrows. */ | 'horizontal' /** Only react to left/right arrows. */ | 'none'; /** Doesn't respond to any arrow keys. */
|
|
74
|
-
export type NavigateAtEnd = 'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue';
|
|
75
|
-
export type FocusZoneTabNavigation = 'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal';
|
|
76
|
-
/** @deprecated FocusZone is an unstyled primitive and does not resolve tokens. */
|
|
77
|
-
export type FocusZoneTokens = Record<never, never>;
|
|
78
|
-
/** @deprecated Use FocusZoneProps. */
|
|
79
|
-
export interface FocusZoneSlotProps {
|
|
80
|
-
root: NativeProps;
|
|
81
|
-
}
|
|
82
|
-
/** @deprecated FocusZone uses the phased primitive component pattern. */
|
|
83
|
-
export interface FocusZoneRenderData {
|
|
84
|
-
slotProps?: FocusZoneSlotProps;
|
|
85
|
-
state?: FocusZoneState;
|
|
86
|
-
}
|
|
87
|
-
/** @deprecated Use FocusZoneProps. */
|
|
88
|
-
export interface FocusZoneType {
|
|
89
|
-
props: FocusZoneProps;
|
|
90
|
-
tokens: FocusZoneTokens;
|
|
91
|
-
slotProps: FocusZoneSlotProps;
|
|
92
|
-
state: FocusZoneState;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=FocusZone.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.d.ts","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAE3C;;OAEG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;IAE1E;;OAEG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;OAE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AK,EAAE,cAAc,CAAC;CACvB"}
|
package/lib/FocusZone.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.js","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
-
import type { UnsafeMixed, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
-
export interface NativeProps extends ViewProps {
|
|
4
|
-
navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
|
|
5
|
-
defaultTabbableElement?: UnsafeMixed;
|
|
6
|
-
focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
|
|
7
|
-
use2DNavigation?: boolean;
|
|
8
|
-
tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
isTabNavigation?: boolean;
|
|
11
|
-
navigationOrderInRenderOrder?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export type FocusZoneComponentType = HostComponent<NativeProps>;
|
|
14
|
-
declare const _default: FocusZoneComponentType;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE1F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,aAAa,CAAC,EAAE,WAAW,CAAC,oBAAoB,GAAG,cAAc,GAAG,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;IAC9G,sBAAsB,CAAC,EAAE,WAAW,CAAC;IACrC,kBAAkB,CAAC,EAAE,WAAW,CAAC,eAAe,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;IACxG,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,cAAc,GAAG,oBAAoB,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;wBAI1D,sBAAsB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
7
|
-
export default codegenNativeComponent('FocusZone', {
|
|
8
|
-
paperComponentName: 'RCTFocusZone',
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=FocusZoneNativeComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAkB7F,eAAe,sBAAsB,CAAc,WAAW,EAAE;IAC9D,kBAAkB,EAAE,cAAc;CACnC,CAA2B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
-
import type { UnsafeMixed, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
-
export interface NativeProps extends ViewProps {
|
|
4
|
-
navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
|
|
5
|
-
defaultTabbableElement?: UnsafeMixed;
|
|
6
|
-
focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
|
|
7
|
-
use2DNavigation?: boolean;
|
|
8
|
-
tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
isTabNavigation?: boolean;
|
|
11
|
-
navigationOrderInRenderOrder?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export type FocusZoneComponentType = HostComponent<NativeProps>;
|
|
14
|
-
declare const _default: FocusZoneComponentType;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=FocusZoneNativeComponent.win32.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZoneNativeComponent.win32.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.win32.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE1F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,aAAa,CAAC,EAAE,WAAW,CAAC,oBAAoB,GAAG,cAAc,GAAG,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;IAC9G,sBAAsB,CAAC,EAAE,WAAW,CAAC;IACrC,kBAAkB,CAAC,EAAE,WAAW,CAAC,eAAe,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;IACxG,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,cAAc,GAAG,oBAAoB,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;wBAEM,sBAAsB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZoneNativeComponent.win32.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.win32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAiBtD,eAAe,sBAAsB,CAAc,cAAc,CAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FocusZone.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
-
import { isPhasedComponent, useSlot } from '@fluentui-react-native/framework-base';
|
|
6
|
-
import { render } from '@testing-library/react-native';
|
|
7
|
-
import { FocusZone } from '../FocusZone';
|
|
8
|
-
jest.mock('react-native/Libraries/ReactNative/RendererProxy', () => ({
|
|
9
|
-
...jest.requireActual('react-native/Libraries/ReactNative/RendererProxy'),
|
|
10
|
-
findNodeHandle: jest.fn(() => 42),
|
|
11
|
-
}));
|
|
12
|
-
function FocusZoneSlotConsumer({ focusZone }) {
|
|
13
|
-
const FocusZoneSlot = useSlot(FocusZone, focusZone);
|
|
14
|
-
return (_jsx(FocusZoneSlot, { accessibilityHint: "rendered as a slot", testID: "slotted-focus-zone", children: _jsx(Text, { children: "Slot content" }) }));
|
|
15
|
-
}
|
|
16
|
-
describe('FocusZone', () => {
|
|
17
|
-
afterEach(() => {
|
|
18
|
-
jest.restoreAllMocks();
|
|
19
|
-
});
|
|
20
|
-
it('uses phased rendering and applies no styling defaults', async () => {
|
|
21
|
-
expect(isPhasedComponent(FocusZone)).toBe(true);
|
|
22
|
-
const component = await render(_jsx(FocusZone, { testID: "focus-zone" }));
|
|
23
|
-
const focusZone = component.getByTestId('focus-zone');
|
|
24
|
-
expect(focusZone.type).toBe('RCTFocusZone');
|
|
25
|
-
expect(focusZone.props.navigateAtEnd).toBe('NavigateStopAtEnds');
|
|
26
|
-
expect(focusZone.props.style).toBeUndefined();
|
|
27
|
-
});
|
|
28
|
-
it('forwards native behavior, accessibility, style, callbacks, and children', async () => {
|
|
29
|
-
const onFocus = jest.fn();
|
|
30
|
-
const style = { opacity: 0.5 };
|
|
31
|
-
const component = await render(_jsx(FocusZone, { accessibilityLabel: "Formatting tools", disabled: true, focusZoneDirection: "vertical", navigationOrderInRenderOrder: true, onFocus: onFocus, style: style, tabKeyNavigation: "Normal", testID: "focus-zone", use2DNavigation: true, children: _jsx(Text, { children: "FocusZone content" }) }));
|
|
32
|
-
const focusZone = component.getByTestId('focus-zone');
|
|
33
|
-
expect(focusZone.props).toMatchObject({
|
|
34
|
-
accessibilityLabel: 'Formatting tools',
|
|
35
|
-
disabled: true,
|
|
36
|
-
focusZoneDirection: 'vertical',
|
|
37
|
-
navigationOrderInRenderOrder: true,
|
|
38
|
-
onFocus,
|
|
39
|
-
tabKeyNavigation: 'Normal',
|
|
40
|
-
use2DNavigation: true,
|
|
41
|
-
});
|
|
42
|
-
expect(StyleSheet.flatten(focusZone.props.style)).toEqual(style);
|
|
43
|
-
expect(component.getByText('FocusZone content')).toBeTruthy();
|
|
44
|
-
});
|
|
45
|
-
it('maps circular navigation to the native end behavior', async () => {
|
|
46
|
-
const component = await render(_jsx(FocusZone, { isCircularNavigation: true, testID: "focus-zone" }));
|
|
47
|
-
expect(component.getByTestId('focus-zone').props.navigateAtEnd).toBe('NavigateWrap');
|
|
48
|
-
});
|
|
49
|
-
it('preserves a native end behavior supplied by a legacy slot consumer', async () => {
|
|
50
|
-
const component = await render(_jsx(FocusZoneSlotConsumer, { focusZone: { navigateAtEnd: 'NavigateContinue' } }));
|
|
51
|
-
expect(component.getByTestId('slotted-focus-zone').props.navigateAtEnd).toBe('NavigateContinue');
|
|
52
|
-
});
|
|
53
|
-
it('forwards a registered native identifier as the default tabbable element', async () => {
|
|
54
|
-
const component = await render(_jsx(FocusZone, { defaultTabbableElement: "preferred-item", testID: "focus-zone" }));
|
|
55
|
-
expect(component.getByTestId('focus-zone').props.defaultTabbableElement).toBe('preferred-item');
|
|
56
|
-
});
|
|
57
|
-
it('resolves a default tabbable element ref to its native handle', async () => {
|
|
58
|
-
const defaultTabbableElement = React.createRef();
|
|
59
|
-
const component = await render(_jsx(FocusZone, { defaultTabbableElement: defaultTabbableElement, testID: "focus-zone", children: _jsx(View, { ref: defaultTabbableElement }) }));
|
|
60
|
-
expect(defaultTabbableElement.current).not.toBeNull();
|
|
61
|
-
expect(component.getByTestId('focus-zone').props.defaultTabbableElement).toBe(42);
|
|
62
|
-
});
|
|
63
|
-
it('forwards componentRef without exposing it as a native prop', async () => {
|
|
64
|
-
const componentRef = React.createRef();
|
|
65
|
-
const component = await render(_jsx(FocusZone, { componentRef: componentRef, testID: "focus-zone" }));
|
|
66
|
-
const focusZone = component.getByTestId('focus-zone');
|
|
67
|
-
expect(componentRef.current).not.toBeNull();
|
|
68
|
-
expect(focusZone.props.componentRef).toBeUndefined();
|
|
69
|
-
});
|
|
70
|
-
it('can be consumed as a slot with merged render props', async () => {
|
|
71
|
-
const component = await render(_jsx(FocusZoneSlotConsumer, { focusZone: { accessibilityLabel: 'Slotted FocusZone', focusZoneDirection: 'horizontal' } }));
|
|
72
|
-
const focusZone = component.getByTestId('slotted-focus-zone');
|
|
73
|
-
expect(focusZone.props).toMatchObject({
|
|
74
|
-
accessibilityHint: 'rendered as a slot',
|
|
75
|
-
accessibilityLabel: 'Slotted FocusZone',
|
|
76
|
-
focusZoneDirection: 'horizontal',
|
|
77
|
-
});
|
|
78
|
-
expect(component.getByText('Slot content')).toBeTruthy();
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=FocusZone.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusZone.test.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEnF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,IAAI,CAAC,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,GAAG,IAAI,CAAC,aAAa,CAAC,kDAAkD,CAAC;IACzE,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC,CAAC;AAMJ,SAAS,qBAAqB,CAAC,EAAE,SAAS,EAA8B;IACtE,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACpD,OAAO,CACL,KAAC,aAAa,IAAC,iBAAiB,EAAC,oBAAoB,EAAC,MAAM,EAAC,oBAAoB,YAC/E,KAAC,IAAI,+BAAoB,GACX,CACjB,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAA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E;QAClE,MAAM,SAAS,GAAG,MAAM,MAAM,CAC5B,KAAC,qBAAqB,IAAC,SAAS,EAAE,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAI,CACpH,CAAC;QACF,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAE9D,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;YACpC,iBAAiB,EAAE,oBAAoB;YACvC,kBAAkB,EAAE,mBAAmB;YACvC,kBAAkB,EAAE,YAAY;SACjC,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FocusZone.types.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
const componentRef = React.createRef();
|
|
4
|
-
const defaultTabbableElement = React.createRef();
|
|
5
|
-
const props = {
|
|
6
|
-
accessibilityLabel: 'Formatting tools',
|
|
7
|
-
componentRef,
|
|
8
|
-
defaultTabbableElement,
|
|
9
|
-
focusZoneDirection: 'horizontal',
|
|
10
|
-
isCircularNavigation: true,
|
|
11
|
-
};
|
|
12
|
-
const focusZoneSlot = props;
|
|
13
|
-
const nativeProps = {
|
|
14
|
-
defaultTabbableElement: 42,
|
|
15
|
-
focusZoneDirection: 'vertical',
|
|
16
|
-
navigateAtEnd: 'NavigateWrap',
|
|
17
|
-
};
|
|
18
|
-
// @ts-expect-error FocusZone direction must be one of the supported navigation axes.
|
|
19
|
-
const invalidDirection = { focusZoneDirection: 'diagonal' };
|
|
20
|
-
describe('FocusZone types', () => {
|
|
21
|
-
it('accepts public props as a slot contract', () => {
|
|
22
|
-
expect(focusZoneSlot).toBeDefined();
|
|
23
|
-
expect(nativeProps).toBeDefined();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=FocusZone.types.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusZone.types.test.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,EAAc,CAAC;AACnD,MAAM,sBAAsB,GAAG,KAAK,CAAC,SAAS,EAAmB,CAAC;AAElE,MAAM,KAAK,GAAmB;IAC5B,kBAAkB,EAAE,kBAAkB;IACtC,YAAY;IACZ,sBAAsB;IACtB,kBAAkB,EAAE,YAAY;IAChC,oBAAoB,EAAE,IAAI;CAC3B,CAAC;AAEF,MAAM,aAAa,GAA+B,KAAK,CAAC;AACxD,MAAM,WAAW,GAAgB;IAC/B,sBAAsB,EAAE,EAAE;IAC1B,kBAAkB,EAAE,UAAU;IAC9B,aAAa,EAAE,cAAc;CAC9B,CAAC;AAEF,qFAAqF;AACrF,MAAM,gBAAgB,GAAmB,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC;AAE5E,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/macos/KeyCodes.h
DELETED
package/macos/RCTFocusZone.h
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#import <React/RCTComponent.h>
|
|
4
|
-
#import <React/RCTView.h>
|
|
5
|
-
|
|
6
|
-
typedef NS_ENUM(NSInteger, FocusZoneDirection) {
|
|
7
|
-
FocusZoneDirectionBidirectional,
|
|
8
|
-
FocusZoneDirectionHorizontal,
|
|
9
|
-
FocusZoneDirectionVertical,
|
|
10
|
-
FocusZoneDirectionNone
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
@interface RCTFocusZone : RCTView
|
|
14
|
-
|
|
15
|
-
@property(nonatomic) BOOL disabled;
|
|
16
|
-
@property(nonatomic) BOOL navigationOrderInRenderOrder;
|
|
17
|
-
@property(nonatomic) FocusZoneDirection focusZoneDirection;
|
|
18
|
-
@property(nonatomic) NSString *navigateAtEnd;
|
|
19
|
-
@property(nonatomic) NSString *tabKeyNavigation;
|
|
20
|
-
@property(nonatomic) NSView *defaultResponder;
|
|
21
|
-
|
|
22
|
-
@end
|