@fluentui-react-native/focus-zone 0.11.38 → 0.11.40
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.json +37 -1
- package/CHANGELOG.md +19 -2
- package/lib/FocusZone.d.ts +4 -0
- package/lib/FocusZone.d.ts.map +1 -0
- package/lib/FocusZone.js +54 -0
- package/lib/FocusZone.js.map +1 -0
- package/lib/FocusZone.types.d.ts +52 -0
- package/lib/FocusZone.types.d.ts.map +1 -0
- package/lib/FocusZone.types.js +2 -0
- package/lib/FocusZone.types.js.map +1 -0
- package/lib/__tests__/FocusZone.test.d.ts +2 -0
- package/lib/__tests__/FocusZone.test.d.ts.map +1 -0
- package/lib/__tests__/FocusZone.test.js +94 -0
- package/lib/__tests__/FocusZone.test.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/focus-zone",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 23 Mar 2023 20:47:39 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/focus-zone_v0.11.40",
|
|
7
|
+
"version": "0.11.40",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
13
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.22.28",
|
|
14
|
+
"commit": "58c71da6843a333d3b6faca82a851916205a4fd0"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 21 Mar 2023 21:53:47 GMT",
|
|
21
|
+
"tag": "@fluentui-react-native/focus-zone_v0.11.39",
|
|
22
|
+
"version": "0.11.39",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "krsiler@microsoft.com",
|
|
27
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
28
|
+
"commit": "e706a7afbd63d528878eadd179d5a91210ed62f6",
|
|
29
|
+
"comment": "Trigger manual bump (no changes)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
34
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.22.27",
|
|
35
|
+
"commit": "e706a7afbd63d528878eadd179d5a91210ed62f6"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Sat, 18 Mar 2023 17:22:31 GMT",
|
|
6
42
|
"tag": "@fluentui-react-native/focus-zone_v0.11.38",
|
|
7
43
|
"version": "0.11.38",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/focus-zone
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 23 Mar 2023 20:47:39 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.11.40
|
|
8
|
+
|
|
9
|
+
Thu, 23 Mar 2023 20:47:39 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.22.28
|
|
14
|
+
|
|
15
|
+
## 0.11.39
|
|
16
|
+
|
|
17
|
+
Tue, 21 Mar 2023 21:53:47 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Trigger manual bump (no changes) (krsiler@microsoft.com)
|
|
22
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.22.27
|
|
23
|
+
|
|
7
24
|
## 0.11.38
|
|
8
25
|
|
|
9
|
-
Sat, 18 Mar 2023 17:
|
|
26
|
+
Sat, 18 Mar 2023 17:22:31 GMT
|
|
10
27
|
|
|
11
28
|
### Patches
|
|
12
29
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FocusZoneProps, FocusZoneSlotProps } from './FocusZone.types';
|
|
3
|
+
export declare const FocusZone: import("@uifabricshared/foundation-composable").IWithComposable<React.FunctionComponent<FocusZoneProps>, import("@uifabricshared/foundation-composable").IComposable<FocusZoneProps, FocusZoneSlotProps, import("./FocusZone.types").FocusZoneState>>;
|
|
4
|
+
//# sourceMappingURL=FocusZone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.d.ts","sourceRoot":"","sources":["../src/FocusZone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAiB,MAAM,mBAAmB,CAAC;AAM3F,eAAO,MAAM,SAAS,uPA6BpB,CAAC"}
|
package/lib/FocusZone.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import { findNodeHandle } from 'react-native';
|
|
25
|
+
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
|
|
26
|
+
import { useViewCommandFocus } from '@fluentui-react-native/interactive-hooks';
|
|
27
|
+
import { composable } from '@uifabricshared/foundation-composable';
|
|
28
|
+
import { mergeSettings } from '@uifabricshared/foundation-settings';
|
|
29
|
+
var RCTFocusZone = ensureNativeComponent('RCTFocusZone');
|
|
30
|
+
var filterOutComponentRef = function (propName) { return propName !== 'componentRef'; };
|
|
31
|
+
export var FocusZone = composable({
|
|
32
|
+
usePrepareProps: function (userProps, useStyling) {
|
|
33
|
+
var componentRef = userProps.componentRef, defaultTabbableElement = userProps.defaultTabbableElement, isCircularNavigation = userProps.isCircularNavigation, rest = __rest(userProps, ["componentRef", "defaultTabbableElement", "isCircularNavigation"]);
|
|
34
|
+
var ftzRef = useViewCommandFocus(componentRef);
|
|
35
|
+
var _a = React.useState(undefined), targetNativeTag = _a[0], setTargetNativeTag = _a[1];
|
|
36
|
+
React.useLayoutEffect(function () {
|
|
37
|
+
if (defaultTabbableElement === null || defaultTabbableElement === void 0 ? void 0 : defaultTabbableElement.current) {
|
|
38
|
+
setTargetNativeTag(findNodeHandle(defaultTabbableElement.current));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
setTargetNativeTag(undefined);
|
|
42
|
+
}
|
|
43
|
+
}, [defaultTabbableElement]);
|
|
44
|
+
return {
|
|
45
|
+
slotProps: mergeSettings(useStyling(userProps), {
|
|
46
|
+
root: __assign(__assign({}, rest), { defaultTabbableElement: targetNativeTag, ref: ftzRef, navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds' }),
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
slots: {
|
|
51
|
+
root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=FocusZone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.js","sourceRoot":"","sources":["../src/FocusZone.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpE,IAAM,YAAY,GAAG,qBAAqB,CAAC,cAAc,CAAC,CAAC;AAE3D,IAAM,qBAAqB,GAAG,UAAC,QAAQ,IAAK,OAAA,QAAQ,KAAK,cAAc,EAA3B,CAA2B,CAAC;AAExE,MAAM,CAAC,IAAM,SAAS,GAAG,UAAU,CAAgB;IACjD,eAAe,EAAE,UAAC,SAAyB,EAAE,UAAsC;QACzE,IAAA,YAAY,GAA4D,SAAS,aAArE,EAAE,sBAAsB,GAAoC,SAAS,uBAA7C,EAAE,oBAAoB,GAAc,SAAS,qBAAvB,EAAK,IAAI,UAAK,SAAS,EAAnF,kEAAuE,CAAF,CAAe;QAE1F,IAAM,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAE3C,IAAA,KAAwC,KAAK,CAAC,QAAQ,CAAS,SAAS,CAAC,EAAxE,eAAe,QAAA,EAAE,kBAAkB,QAAqC,CAAC;QAChF,KAAK,CAAC,eAAe,CAAC;YACpB,IAAI,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,OAAO,EAAE;gBACnC,kBAAkB,CAAC,cAAc,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;aACpE;iBAAM;gBACL,kBAAkB,CAAC,SAAS,CAAC,CAAC;aAC/B;QACH,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAE7B,OAAO;YACL,SAAS,EAAE,aAAa,CAAqB,UAAU,CAAC,SAAS,CAAC,EAAE;gBAClE,IAAI,wBACC,IAAI,KACP,sBAAsB,EAAE,eAAe,EACvC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,oBAAoB,GAC5E;aACF,CAAC;SACH,CAAC;IACJ,CAAC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,qBAAqB,EAAE;KAChE;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
3
|
+
import type { IRenderData } from '@uifabricshared/foundation-composable';
|
|
4
|
+
export declare const focusZoneName = "FocusZone";
|
|
5
|
+
export interface FocusZoneState {
|
|
6
|
+
}
|
|
7
|
+
export interface FocusZoneProps {
|
|
8
|
+
/**
|
|
9
|
+
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
10
|
+
*/
|
|
11
|
+
componentRef?: React.RefObject<IFocusable>;
|
|
12
|
+
/**
|
|
13
|
+
* Optionally defines the initial tabbable element inside the FocusZone
|
|
14
|
+
*/
|
|
15
|
+
defaultTabbableElement?: React.RefObject<React.Component>;
|
|
16
|
+
/**
|
|
17
|
+
** Defines which arrows to react to
|
|
18
|
+
*/
|
|
19
|
+
focusZoneDirection?: FocusZoneDirection;
|
|
20
|
+
/**
|
|
21
|
+
** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
isCircularNavigation?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
*Allows for 2D navigation. This navigation strategy takes into account the position of elements
|
|
27
|
+
on screen, and navigates in the direction the user selects to the nearest element.
|
|
28
|
+
*/
|
|
29
|
+
use2DNavigation?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Callback called when “focus” event triggered in FocusZone
|
|
32
|
+
*/
|
|
33
|
+
onFocus?: (e?: any) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface NativeProps extends Omit<FocusZoneProps, 'isCircularNavigation'> {
|
|
36
|
+
navigateAtEnd?: NavigateAtEnd;
|
|
37
|
+
}
|
|
38
|
+
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. */
|
|
39
|
+
export type NavigateAtEnd = 'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue';
|
|
40
|
+
export interface FocusZoneTokens {
|
|
41
|
+
}
|
|
42
|
+
export interface FocusZoneSlotProps {
|
|
43
|
+
root: NativeProps;
|
|
44
|
+
}
|
|
45
|
+
export type FocusZoneRenderData = IRenderData<FocusZoneSlotProps, FocusZoneState>;
|
|
46
|
+
export interface FocusZoneType {
|
|
47
|
+
props: FocusZoneProps;
|
|
48
|
+
tokens: FocusZoneTokens;
|
|
49
|
+
slotProps: FocusZoneSlotProps;
|
|
50
|
+
state: FocusZoneState;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=FocusZone.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.types.d.ts","sourceRoot":"","sources":["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AC,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,EAAE,cAAc,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.types.js","sourceRoot":"","sources":["../src/FocusZone.types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAM,aAAa,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FocusZone.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from 'react-native';
|
|
3
|
+
import * as renderer from 'react-test-renderer';
|
|
4
|
+
import { FocusZone } from '..';
|
|
5
|
+
var onPress = function () {
|
|
6
|
+
return;
|
|
7
|
+
};
|
|
8
|
+
describe('FocusZone No Props', function () {
|
|
9
|
+
it('No children', function () {
|
|
10
|
+
var tree = renderer.create(React.createElement(FocusZone, null)).toJSON();
|
|
11
|
+
expect(tree).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
it('One child', function () {
|
|
14
|
+
var tree = renderer
|
|
15
|
+
.create(React.createElement(FocusZone, null,
|
|
16
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
17
|
+
.toJSON();
|
|
18
|
+
expect(tree).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
it('Two children', function () {
|
|
21
|
+
var tree = renderer
|
|
22
|
+
.create(React.createElement(FocusZone, null,
|
|
23
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
24
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
25
|
+
.toJSON();
|
|
26
|
+
expect(tree).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
it('Three children', function () {
|
|
29
|
+
var tree = renderer
|
|
30
|
+
.create(React.createElement(FocusZone, null,
|
|
31
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
32
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
33
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
34
|
+
.toJSON();
|
|
35
|
+
expect(tree).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('FocusZone With Props', function () {
|
|
39
|
+
it('defaultTabbableElement Prop', function () {
|
|
40
|
+
var tree = renderer
|
|
41
|
+
.create(React.createElement(FocusZone, { defaultTabbableElement: null },
|
|
42
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
43
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
44
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
45
|
+
.toJSON();
|
|
46
|
+
expect(tree).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('focusZoneDirection Prop', function () {
|
|
49
|
+
var tree = renderer
|
|
50
|
+
.create(React.createElement(FocusZone, { focusZoneDirection: "bidirectional" },
|
|
51
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
52
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
53
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
54
|
+
.toJSON();
|
|
55
|
+
expect(tree).toMatchSnapshot();
|
|
56
|
+
});
|
|
57
|
+
it('disabled Prop', function () {
|
|
58
|
+
var tree = renderer
|
|
59
|
+
.create(React.createElement(FocusZone, { disabled: true },
|
|
60
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
61
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
62
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
63
|
+
.toJSON();
|
|
64
|
+
expect(tree).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
it('isCircularNavigation Prop', function () {
|
|
67
|
+
var tree = renderer
|
|
68
|
+
.create(React.createElement(FocusZone, { isCircularNavigation: true },
|
|
69
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
70
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
71
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
72
|
+
.toJSON();
|
|
73
|
+
expect(tree).toMatchSnapshot();
|
|
74
|
+
});
|
|
75
|
+
it('use2DNavigation Prop', function () {
|
|
76
|
+
var tree = renderer
|
|
77
|
+
.create(React.createElement(FocusZone, { use2DNavigation: true },
|
|
78
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
79
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
80
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
81
|
+
.toJSON();
|
|
82
|
+
expect(tree).toMatchSnapshot();
|
|
83
|
+
});
|
|
84
|
+
it('All Props', function () {
|
|
85
|
+
var tree = renderer
|
|
86
|
+
.create(React.createElement(FocusZone, { disabled: false, use2DNavigation: true, defaultTabbableElement: null, isCircularNavigation: false, focusZoneDirection: "vertical" },
|
|
87
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
88
|
+
React.createElement(Button, { title: "button", onPress: onPress }),
|
|
89
|
+
React.createElement(Button, { title: "button", onPress: onPress })))
|
|
90
|
+
.toJSON();
|
|
91
|
+
expect(tree).toMatchSnapshot();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=FocusZone.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusZone.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B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IAEH,EAAE,CAAC,WAAW,EAAE;QACd,IAAM,IAAI,GAAG,QAAQ;aAClB,MAAM,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,KAAK,EACf,eAAe,EAAE,IAAI,EACrB,sBAAsB,EAAE,IAAI,EAC5B,oBAAoB,EAAE,KAAK,EAC3B,kBAAkB,EAAC,UAAU;YAE7B,oBAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,GAAI;YAC3C,oBAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,GAAI;YAC3C,oBAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,GAAI,CACjC,CACb;aACA,MAAM,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { focusZoneName } from './FocusZone.types';
|
|
2
|
+
export type { FocusZoneDirection, FocusZoneProps, FocusZoneRenderData, FocusZoneSlotProps, FocusZoneState, FocusZoneTokens, FocusZoneType, NativeProps, NavigateAtEnd, } from './FocusZone.types';
|
|
3
|
+
export { FocusZone } from './FocusZone';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAYlD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/focus-zone",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.40",
|
|
4
4
|
"description": "A cross-platform FocusZone component using the Fluent Design System",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@fluentui-react-native/component-cache": "^1.4.4",
|
|
26
|
-
"@fluentui-react-native/interactive-hooks": ">=0.22.
|
|
26
|
+
"@fluentui-react-native/interactive-hooks": ">=0.22.28 <1.0.0",
|
|
27
27
|
"@uifabricshared/foundation-composable": ">=0.11.3 <1.0.0",
|
|
28
28
|
"@uifabricshared/foundation-settings": ">=0.12.3 <1.0.0"
|
|
29
29
|
},
|