@fluentui-react-native/focus-zone 0.8.17 → 0.9.2
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 +61 -1
- package/CHANGELOG.md +34 -2
- package/macos/RCTFocusZone.h +1 -1
- package/macos/RCTFocusZone.m +22 -6
- package/macos/RCTFocusZoneManager.m +1 -1
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/focus-zone",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 17 Feb 2022 01:19:23 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/focus-zone_v0.9.2",
|
|
7
|
+
"version": "0.9.2",
|
|
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.13.1",
|
|
14
|
+
"commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 09 Feb 2022 20:14:50 GMT",
|
|
21
|
+
"tag": "@fluentui-react-native/focus-zone_v0.9.1",
|
|
22
|
+
"version": "0.9.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "beachball",
|
|
27
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
28
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.0",
|
|
29
|
+
"commit": "f7264338409e4a7e4cbb4f4fb815d4ab32276d8a"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Fri, 04 Feb 2022 20:31:52 GMT",
|
|
36
|
+
"tag": "@fluentui-react-native/focus-zone_v0.9.0",
|
|
37
|
+
"version": "0.9.0",
|
|
38
|
+
"comments": {
|
|
39
|
+
"minor": [
|
|
40
|
+
{
|
|
41
|
+
"author": "sanajmi@microsoft.com",
|
|
42
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
43
|
+
"commit": "362642ae324275de74803fcf63f882636088c08f",
|
|
44
|
+
"comment": "Several fixes to macOS FocusZone"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Wed, 02 Feb 2022 02:29:07 GMT",
|
|
51
|
+
"tag": "@fluentui-react-native/focus-zone_v0.8.18",
|
|
52
|
+
"version": "0.8.18",
|
|
53
|
+
"comments": {
|
|
54
|
+
"patch": [
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui-react-native/focus-zone",
|
|
58
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.12.2",
|
|
59
|
+
"commit": "c42dec6d24b24ded9a85dd11076e49d9b92980aa"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Wed, 26 Jan 2022 20:31:04 GMT",
|
|
6
66
|
"tag": "@fluentui-react-native/focus-zone_v0.8.17",
|
|
7
67
|
"version": "0.8.17",
|
|
8
68
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
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, 17 Feb 2022 01:19:23 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.9.2
|
|
8
|
+
|
|
9
|
+
Thu, 17 Feb 2022 01:19:23 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.13.1
|
|
14
|
+
|
|
15
|
+
## 0.9.1
|
|
16
|
+
|
|
17
|
+
Wed, 09 Feb 2022 20:14:50 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.13.0
|
|
22
|
+
|
|
23
|
+
## 0.9.0
|
|
24
|
+
|
|
25
|
+
Fri, 04 Feb 2022 20:31:52 GMT
|
|
26
|
+
|
|
27
|
+
### Minor changes
|
|
28
|
+
|
|
29
|
+
- Several fixes to macOS FocusZone (sanajmi@microsoft.com)
|
|
30
|
+
|
|
31
|
+
## 0.8.18
|
|
32
|
+
|
|
33
|
+
Wed, 02 Feb 2022 02:29:07 GMT
|
|
34
|
+
|
|
35
|
+
### Patches
|
|
36
|
+
|
|
37
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.12.2
|
|
38
|
+
|
|
7
39
|
## 0.8.17
|
|
8
40
|
|
|
9
|
-
Wed, 26 Jan 2022 20:
|
|
41
|
+
Wed, 26 Jan 2022 20:31:04 GMT
|
|
10
42
|
|
|
11
43
|
### Patches
|
|
12
44
|
|
package/macos/RCTFocusZone.h
CHANGED
|
@@ -15,6 +15,6 @@ typedef NS_ENUM(NSInteger, FocusZoneDirection) {
|
|
|
15
15
|
@property(nonatomic) BOOL disabled;
|
|
16
16
|
@property(nonatomic) FocusZoneDirection focusZoneDirection;
|
|
17
17
|
@property(nonatomic) NSString *navigateAtEnd;
|
|
18
|
-
@property(nonatomic) NSView *
|
|
18
|
+
@property(nonatomic) NSView *defaultKeyView;
|
|
19
19
|
|
|
20
20
|
@end
|
package/macos/RCTFocusZone.m
CHANGED
|
@@ -45,6 +45,21 @@ static inline CGFloat GetMinDistanceBetweenRectVerticesAndPoint(NSRect rect, NSP
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
static NSView *GetFirstKeyViewWithin(NSView *parentView)
|
|
49
|
+
{
|
|
50
|
+
for (NSView *view in [parentView subviews]) {
|
|
51
|
+
if ([view canBecomeKeyView]) {
|
|
52
|
+
return view;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
NSView *match = GetFirstKeyViewWithin(view);
|
|
56
|
+
if (match) {
|
|
57
|
+
return match;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return nil;
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
static NSView *GetFirstResponder(NSWindow *window)
|
|
49
64
|
{
|
|
50
65
|
NSResponder *responder = [window firstResponder];
|
|
@@ -124,13 +139,14 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
|
|
|
124
139
|
|
|
125
140
|
- (BOOL)acceptsFirstResponder
|
|
126
141
|
{
|
|
127
|
-
// Accept firstResponder on FocusZone itself in order to reassign it
|
|
142
|
+
// Accept firstResponder on FocusZone itself in order to reassign it within the FocusZone.
|
|
128
143
|
return !_disabled;
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
- (BOOL)becomeFirstResponder
|
|
132
147
|
{
|
|
133
|
-
|
|
148
|
+
NSView *keyView = _defaultKeyView ?: GetFirstKeyViewWithin(self);
|
|
149
|
+
return !_disabled && [[self window] makeFirstResponder:keyView];
|
|
134
150
|
}
|
|
135
151
|
|
|
136
152
|
- (NSView *)nextViewToFocusForCondition:(IsViewLeadingCandidateForNextFocus)isLeadingCandidate
|
|
@@ -314,7 +330,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
|
|
|
314
330
|
// If the previous view is in a FocusZone, focus the default tabbable element.
|
|
315
331
|
// (For FocusZoneActionTab, this is handled by becomeFirstResponder.)
|
|
316
332
|
RCTFocusZone *nextFocusZone = GetFocusZoneAncestor(nextViewToFocus);
|
|
317
|
-
NSView *element = [nextFocusZone
|
|
333
|
+
NSView *element = [nextFocusZone defaultKeyView];
|
|
318
334
|
if (element != nil)
|
|
319
335
|
{
|
|
320
336
|
nextViewToFocus = element;
|
|
@@ -351,7 +367,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
|
|
|
351
367
|
&& (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow))
|
|
352
368
|
|| (focusZoneDirection == FocusZoneDirectionNone))
|
|
353
369
|
{
|
|
354
|
-
|
|
370
|
+
[super keyDown:event];
|
|
355
371
|
}
|
|
356
372
|
else
|
|
357
373
|
{
|
|
@@ -368,7 +384,7 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
|
|
|
368
384
|
}
|
|
369
385
|
else
|
|
370
386
|
{
|
|
371
|
-
|
|
387
|
+
[super keyDown:event];
|
|
372
388
|
}
|
|
373
389
|
}
|
|
374
390
|
|
|
@@ -382,4 +398,4 @@ static RCTFocusZone *GetFocusZoneAncestor(NSView *view)
|
|
|
382
398
|
return @"NavigateStopAtEnds";
|
|
383
399
|
}
|
|
384
400
|
|
|
385
|
-
@end
|
|
401
|
+
@end
|
|
@@ -40,7 +40,7 @@ RCT_CUSTOM_VIEW_PROPERTY(defaultTabbableElement, NSNumber, RCTFocusZone)
|
|
|
40
40
|
NSNumber *tag = [RCTConvert NSNumber:json];
|
|
41
41
|
RCTUIManager *manager = [[self bridge] uiManager];
|
|
42
42
|
NSView *element = [manager viewForReactTag:tag];
|
|
43
|
-
[view
|
|
43
|
+
[view setDefaultKeyView:element];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
- (RCTView *)view
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/focus-zone",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.2",
|
|
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.3.1",
|
|
26
|
-
"@fluentui-react-native/interactive-hooks": ">=0.
|
|
26
|
+
"@fluentui-react-native/interactive-hooks": ">=0.13.1 <1.0.0",
|
|
27
27
|
"@uifabricshared/foundation-composable": ">=0.10.2 <1.0.0",
|
|
28
28
|
"@uifabricshared/foundation-settings": ">=0.11.2 <1.0.0"
|
|
29
29
|
},
|