@fluentui-react-native/focus-zone 0.23.2 → 0.23.4
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/.cache/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +14 -0
- package/RCTFocusZone.podspec +1 -1
- package/SPEC.md +42 -0
- package/lib/FocusZone.d.ts +2 -6
- package/lib/FocusZone.d.ts.map +1 -1
- package/lib/FocusZone.js +28 -45
- package/lib/FocusZone.js.map +1 -1
- package/lib/FocusZone.types.d.ts +16 -15
- package/lib/FocusZone.types.d.ts.map +1 -1
- package/lib/FocusZone.types.js.map +1 -1
- package/lib/FocusZoneNativeComponent.d.ts +5 -3
- package/lib/FocusZoneNativeComponent.d.ts.map +1 -1
- package/lib/FocusZoneNativeComponent.js +3 -1
- package/lib/FocusZoneNativeComponent.js.map +1 -1
- package/lib/FocusZoneNativeComponent.win32.d.ts +16 -0
- package/lib/FocusZoneNativeComponent.win32.d.ts.map +1 -0
- package/lib/FocusZoneNativeComponent.win32.js +3 -0
- package/lib/FocusZoneNativeComponent.win32.js.map +1 -0
- package/lib/__tests__/FocusZone.test.js +68 -70
- package/lib/__tests__/FocusZone.test.js.map +1 -1
- package/lib/__tests__/FocusZone.types.test.d.ts +2 -0
- package/lib/__tests__/FocusZone.types.test.d.ts.map +1 -0
- package/lib/__tests__/FocusZone.types.test.js +26 -0
- package/lib/__tests__/FocusZone.types.test.js.map +1 -0
- package/macos/RCTFocusZone.m +76 -17
- package/macos/RCTFocusZoneComponentView.h +14 -0
- package/macos/RCTFocusZoneComponentView.mm +201 -0
- package/package.json +30 -8
- package/react-native.config.cjs +15 -0
- package/src/FocusZone.tsx +50 -0
- package/src/FocusZone.types.ts +16 -16
- package/src/FocusZoneNativeComponent.ts +8 -6
- package/src/FocusZoneNativeComponent.win32.ts +18 -0
- package/src/__tests__/FocusZone.test.tsx +105 -125
- package/src/__tests__/FocusZone.types.test.ts +36 -0
- package/tsconfig.json +5 -7
- package/windows/ExperimentalFeatures.props +33 -0
- package/windows/FRNFocusZone/FRNFocusZone.def +3 -0
- package/windows/FRNFocusZone/FRNFocusZone.rc +0 -0
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj +147 -0
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj.filters +44 -0
- package/windows/FRNFocusZone/FocusZoneComponentView.cpp +590 -0
- package/windows/FRNFocusZone/FocusZoneComponentView.h +7 -0
- package/windows/FRNFocusZone/ReactPackageProvider.cpp +24 -0
- package/windows/FRNFocusZone/ReactPackageProvider.h +24 -0
- package/windows/FRNFocusZone/ReactPackageProvider.idl +9 -0
- package/windows/FRNFocusZone/codegen/.clang-format +2 -0
- package/windows/FRNFocusZone/codegen/react/components/FRNFocusZoneSpec/FocusZone.g.h +243 -0
- package/windows/FRNFocusZone/packages.lock.json +151 -0
- package/windows/FRNFocusZone/pch.cpp +1 -0
- package/windows/FRNFocusZone/pch.h +40 -0
- package/windows/FRNFocusZone/resource.h +5 -0
- package/windows/FRNFocusZone/targetver.h +8 -0
- package/windows/FRNFocusZone.sln +43 -0
- package/windows/NuGet.Config +13 -0
- package/src/FocusZone.ts +0 -57
- package/src/__tests__/__snapshots__/FocusZone.test.tsx.snap +0 -1516
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/focus-zone
|
|
2
2
|
|
|
3
|
+
## 0.23.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1ffcfa3: Convert FocusZone to an unstyled phased primitive and add package-owned macOS and Windows Fabric implementations alongside Paper.
|
|
8
|
+
|
|
9
|
+
## 0.23.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @uifabricshared/foundation-composable@0.15.3
|
|
14
|
+
- @uifabricshared/foundation-settings@0.16.9
|
|
15
|
+
- @fluentui-react-native/interactive-hooks@0.28.9
|
|
16
|
+
|
|
3
17
|
## 0.23.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/RCTFocusZone.podspec
CHANGED
package/SPEC.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
- Windows includes a package-owned Fabric component view that coordinates
|
|
26
|
+
directional, Home/End, Tab, and focus-restoration behavior through RNW
|
|
27
|
+
`ComponentView` focus APIs.
|
|
28
|
+
- Win32 continues to use its platform-provided native FocusZone implementation.
|
|
29
|
+
- Unsupported behavior remains platform-defined rather than being simulated in
|
|
30
|
+
JavaScript.
|
|
31
|
+
|
|
32
|
+
## Compatibility
|
|
33
|
+
|
|
34
|
+
`FocusZoneState`, `FocusZoneTokens`, `FocusZoneSlotProps`,
|
|
35
|
+
`FocusZoneRenderData`, and `FocusZoneType` remain as deprecated compatibility
|
|
36
|
+
types.
|
|
37
|
+
|
|
38
|
+
## Demonstration
|
|
39
|
+
|
|
40
|
+
Interactive directional, circular, Tab, disabled, and default-focus scenarios
|
|
41
|
+
live with the agentic primitive stories in
|
|
42
|
+
`packages/agentic/components/src/primitives/focus-zone/focus-zone.stories.tsx`.
|
package/lib/FocusZone.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
2
|
+
* Renders the native FocusZone without applying theme or appearance defaults.
|
|
5
3
|
*/
|
|
6
|
-
|
|
7
|
-
import type { FocusZoneProps, FocusZoneSlotProps } from './FocusZone.types';
|
|
8
|
-
export declare const FocusZone: import("@uifabricshared/foundation-composable").IWithComposable<React.FunctionComponent<FocusZoneProps>, import("@uifabricshared/foundation-composable").IComposable<FocusZoneProps, FocusZoneSlotProps, {}>>;
|
|
4
|
+
export declare const FocusZone: any;
|
|
9
5
|
//# sourceMappingURL=FocusZone.d.ts.map
|
package/lib/FocusZone.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.d.ts","sourceRoot":"","sources":["../src/FocusZone.
|
|
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
CHANGED
|
@@ -1,50 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
1
|
+
import { jsx as _jsx } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
6
3
|
import * as React from 'react';
|
|
7
4
|
import { findNodeHandle } from 'react-native';
|
|
5
|
+
import { directComponent, mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';
|
|
8
6
|
import { useViewCommandFocus } from '@fluentui-react-native/interactive-hooks';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}, [defaultTabbableElement]);
|
|
35
|
-
return {
|
|
36
|
-
slotProps: mergeSettings(useStyling(userProps), {
|
|
37
|
-
root: {
|
|
38
|
-
navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', // let rest override
|
|
39
|
-
...rest,
|
|
40
|
-
defaultTabbableElement: targetFirstFocus,
|
|
41
|
-
ref: ftzRef,
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
slots: {
|
|
47
|
-
root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
|
|
48
|
-
},
|
|
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
|
+
});
|
|
49
31
|
});
|
|
32
|
+
FocusZone.displayName = focusZoneName;
|
|
50
33
|
//# sourceMappingURL=FocusZone.js.map
|
package/lib/FocusZone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.js","sourceRoot":"","sources":["../src/FocusZone.
|
|
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
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
4
|
-
import type { IRenderData } from '@uifabricshared/foundation-composable';
|
|
5
4
|
export declare const focusZoneName = "FocusZone";
|
|
6
|
-
type
|
|
7
|
-
export
|
|
8
|
-
export type FocusZoneProps = IViewProps & {
|
|
5
|
+
export type FocusZoneState = Record<never, never>;
|
|
6
|
+
export interface FocusZoneProps extends ViewProps {
|
|
9
7
|
/**
|
|
10
8
|
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
11
9
|
*/
|
|
@@ -13,7 +11,7 @@ export type FocusZoneProps = IViewProps & {
|
|
|
13
11
|
/**
|
|
14
12
|
* Optionally defines the initial tabbable element inside the FocusZone
|
|
15
13
|
*/
|
|
16
|
-
defaultTabbableElement?: React.RefObject<React.Component> | string;
|
|
14
|
+
defaultTabbableElement?: React.RefObject<React.Component | null> | string;
|
|
17
15
|
/**
|
|
18
16
|
** Defines which arrows to react to
|
|
19
17
|
*/
|
|
@@ -48,10 +46,6 @@ export type FocusZoneProps = IViewProps & {
|
|
|
48
46
|
* the FocusZone.
|
|
49
47
|
*/
|
|
50
48
|
tabKeyNavigation?: FocusZoneTabNavigation;
|
|
51
|
-
/**
|
|
52
|
-
* Callback called when “focus” event triggered in FocusZone
|
|
53
|
-
*/
|
|
54
|
-
onFocus?: (e?: any) => void;
|
|
55
49
|
/**
|
|
56
50
|
* @platform macos
|
|
57
51
|
* By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
|
|
@@ -69,24 +63,31 @@ export type FocusZoneProps = IViewProps & {
|
|
|
69
63
|
* of the MacOS KeyView loop mechanics.
|
|
70
64
|
*/
|
|
71
65
|
navigationOrderInRenderOrder?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export interface NativeProps extends Omit<FocusZoneProps, 'isCircularNavigation'> {
|
|
66
|
+
}
|
|
67
|
+
export interface NativeProps extends Omit<FocusZoneProps, 'componentRef' | 'defaultTabbableElement' | 'isCircularNavigation'> {
|
|
68
|
+
defaultTabbableElement?: number | string;
|
|
74
69
|
navigateAtEnd?: NavigateAtEnd;
|
|
75
70
|
tabKeyNavigation?: FocusZoneTabNavigation;
|
|
76
71
|
}
|
|
77
72
|
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. */
|
|
78
73
|
export type NavigateAtEnd = 'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue';
|
|
79
74
|
export type FocusZoneTabNavigation = 'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal';
|
|
80
|
-
|
|
75
|
+
/** @deprecated FocusZone is an unstyled primitive and does not resolve tokens. */
|
|
76
|
+
export type FocusZoneTokens = Record<never, never>;
|
|
77
|
+
/** @deprecated Use FocusZoneProps. */
|
|
81
78
|
export interface FocusZoneSlotProps {
|
|
82
79
|
root: NativeProps;
|
|
83
80
|
}
|
|
84
|
-
|
|
81
|
+
/** @deprecated FocusZone uses the phased primitive component pattern. */
|
|
82
|
+
export interface FocusZoneRenderData {
|
|
83
|
+
slotProps?: FocusZoneSlotProps;
|
|
84
|
+
state?: FocusZoneState;
|
|
85
|
+
}
|
|
86
|
+
/** @deprecated Use FocusZoneProps. */
|
|
85
87
|
export interface FocusZoneType {
|
|
86
88
|
props: FocusZoneProps;
|
|
87
89
|
tokens: FocusZoneTokens;
|
|
88
90
|
slotProps: FocusZoneSlotProps;
|
|
89
91
|
state: FocusZoneState;
|
|
90
92
|
}
|
|
91
|
-
export {};
|
|
92
93
|
//# sourceMappingURL=FocusZone.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.d.ts","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FocusZone.types.d.ts","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KA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GACpB,cAAc,GACd,kBAAkB,CAAC;AAEvB,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,oBAAoB,GACpB,QAAQ,CAAC;AAEb,kFAAkF;AAClF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEnD,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,EAAE,cAAc,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.types.js","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FocusZone.types.js","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ViewProps } from 'react-native';
|
|
2
|
-
import type {
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import type { UnsafeMixed, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
export interface NativeProps extends ViewProps {
|
|
4
4
|
navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
|
|
5
5
|
defaultTabbableElement?: UnsafeMixed;
|
|
@@ -8,7 +8,9 @@ export interface NativeProps extends ViewProps {
|
|
|
8
8
|
tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
isTabNavigation?: boolean;
|
|
11
|
+
navigationOrderInRenderOrder?: boolean;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
export type FocusZoneComponentType = HostComponent<NativeProps>;
|
|
14
|
+
declare const _default: FocusZoneComponentType;
|
|
13
15
|
export default _default;
|
|
14
16
|
//# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
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"}
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* @format
|
|
5
5
|
*/
|
|
6
6
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
7
|
-
export default codegenNativeComponent('
|
|
7
|
+
export default codegenNativeComponent('FocusZone', {
|
|
8
|
+
paperComponentName: 'RCTFocusZone',
|
|
9
|
+
});
|
|
8
10
|
//# sourceMappingURL=FocusZoneNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
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,cAAc,
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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,83 +1,81 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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();
|
|
16
19
|
});
|
|
17
|
-
it('
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
expect(
|
|
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();
|
|
23
27
|
});
|
|
24
|
-
it('
|
|
25
|
-
|
|
26
|
-
|
|
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,
|
|
28
41
|
});
|
|
29
|
-
expect(
|
|
42
|
+
expect(StyleSheet.flatten(focusZone.props.style)).toEqual(style);
|
|
43
|
+
expect(component.getByText('FocusZone content')).toBeTruthy();
|
|
30
44
|
});
|
|
31
|
-
it('
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
component = renderer.create(_jsxs(FocusZone, { children: [_jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })] }));
|
|
35
|
-
});
|
|
36
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('FocusZone With Props', () => {
|
|
40
|
-
it('defaultTabbableElement Prop', () => {
|
|
41
|
-
let component;
|
|
42
|
-
act(() => {
|
|
43
|
-
component = renderer.create(_jsxs(FocusZone, { defaultTabbableElement: null, children: [_jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })] }));
|
|
44
|
-
});
|
|
45
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
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');
|
|
46
48
|
});
|
|
47
|
-
it('
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
component = renderer.create(_jsxs(FocusZone, { focusZoneDirection: "bidirectional", children: [_jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })] }));
|
|
51
|
-
});
|
|
52
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
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');
|
|
53
52
|
});
|
|
54
|
-
it('
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
component = renderer.create(_jsxs(FocusZone, { disabled: true, children: [_jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })] }));
|
|
58
|
-
});
|
|
59
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
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');
|
|
60
56
|
});
|
|
61
|
-
it('
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
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);
|
|
67
62
|
});
|
|
68
|
-
it('
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
expect(
|
|
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();
|
|
74
69
|
});
|
|
75
|
-
it('
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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',
|
|
79
77
|
});
|
|
80
|
-
expect(component.
|
|
78
|
+
expect(component.getByText('Slot content')).toBeTruthy();
|
|
81
79
|
});
|
|
82
80
|
});
|
|
83
81
|
//# sourceMappingURL=FocusZone.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusZone.test.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
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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,EAAE,KAAK,IAAI,EAAE;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FocusZone.types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|