@fluentui-react-native/callout 0.19.0 → 0.19.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/CHANGELOG.json +118 -1
- package/CHANGELOG.md +41 -2
- package/lib/Callout.types.d.ts +10 -2
- package/lib/Callout.types.d.ts.map +1 -1
- package/lib/Callout.types.js.map +1 -1
- package/lib/__tests__/Callout.test.d.ts +2 -0
- package/lib/__tests__/Callout.test.d.ts.map +1 -0
- package/lib/__tests__/{Callout.test.win32.js → Callout.test.js} +1 -1
- package/lib/__tests__/Callout.test.js.map +1 -0
- package/lib-commonjs/Callout.types.d.ts +10 -2
- package/lib-commonjs/Callout.types.d.ts.map +1 -1
- package/lib-commonjs/Callout.types.js.map +1 -1
- package/lib-commonjs/__tests__/Callout.test.d.ts +2 -0
- package/lib-commonjs/__tests__/Callout.test.d.ts.map +1 -0
- package/lib-commonjs/__tests__/{Callout.test.win32.js → Callout.test.js} +1 -1
- package/lib-commonjs/__tests__/Callout.test.js.map +1 -0
- package/macos/Callout.swift +10 -21
- package/macos/CalloutWindow.swift +41 -19
- package/package.json +5 -4
- package/src/Callout.types.ts +8 -3
- package/src/__tests__/{Callout.test.win32.tsx → Callout.test.tsx} +0 -0
- package/src/__tests__/__snapshots__/{Callout.test.win32.tsx.snap → Callout.test.tsx.snap} +0 -0
- package/lib/__tests__/Callout.test.win32.d.ts +0 -2
- package/lib/__tests__/Callout.test.win32.d.ts.map +0 -1
- package/lib/__tests__/Callout.test.win32.js.map +0 -1
- package/lib-commonjs/__tests__/Callout.test.win32.d.ts +0 -2
- package/lib-commonjs/__tests__/Callout.test.win32.d.ts.map +0 -1
- package/lib-commonjs/__tests__/Callout.test.win32.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,124 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/callout",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 17 Dec 2021 19:51:04 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/callout_v0.19.4",
|
|
7
|
+
"version": "0.19.4",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui-react-native/callout",
|
|
13
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.11.3",
|
|
14
|
+
"commit": "3012e075ca89e36931357442679b73d20540af8b"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 17 Dec 2021 18:39:08 GMT",
|
|
21
|
+
"tag": "@fluentui-react-native/callout_v0.19.3",
|
|
22
|
+
"version": "0.19.3",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "sanajmi@microsoft.com",
|
|
27
|
+
"package": "@fluentui-react-native/callout",
|
|
28
|
+
"commit": "b7787516d0c417fbe350793713ffce3330c0f4a7",
|
|
29
|
+
"comment": "Documentation fixes"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Fri, 17 Dec 2021 01:26:42 GMT",
|
|
36
|
+
"tag": "@fluentui-react-native/callout_v0.19.2",
|
|
37
|
+
"version": "0.19.2",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui-react-native/callout",
|
|
43
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.11.2",
|
|
44
|
+
"commit": "511aeb31982a5fb9dd2f7196c0c7217cc4a3dbc6"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui-react-native/callout",
|
|
49
|
+
"comment": "Bump @uifabricshared/foundation-compose to v1.11.2",
|
|
50
|
+
"commit": "511aeb31982a5fb9dd2f7196c0c7217cc4a3dbc6"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Thu, 16 Dec 2021 23:00:56 GMT",
|
|
57
|
+
"tag": "@fluentui-react-native/callout_v0.19.1",
|
|
58
|
+
"version": "0.19.1",
|
|
59
|
+
"comments": {
|
|
60
|
+
"none": [
|
|
61
|
+
{
|
|
62
|
+
"author": "dannyvv@microsoft.com",
|
|
63
|
+
"package": "@fluentui-react-native/callout",
|
|
64
|
+
"commit": "25b3989739737bc598a5d699a941af4c0b4a421f",
|
|
65
|
+
"comment": "📦 applying package updates ***NO_CI***"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "Thu, 16 Dec 2021 19:10:30 GMT",
|
|
72
|
+
"tag": "@fluentui-react-native/callout_v0.19.1",
|
|
73
|
+
"version": "0.19.1",
|
|
74
|
+
"comments": {
|
|
75
|
+
"patch": [
|
|
76
|
+
{
|
|
77
|
+
"author": "sanajmi@microsoft.com",
|
|
78
|
+
"package": "@fluentui-react-native/callout",
|
|
79
|
+
"commit": "51cbf7c64d5c52feeec2e845cd4dbd4e23c96e1e",
|
|
80
|
+
"comment": "Add up/down arrow key support to macOS ContextualMenu"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"author": "sanajmi@microsoft.com",
|
|
84
|
+
"package": "@fluentui-react-native/callout",
|
|
85
|
+
"commit": "dd2f47a0a2d6aab7361301a16407c76497b45ce7",
|
|
86
|
+
"comment": "remove focus style overrides for macOS contextual menu items"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"author": "sanajmi@microsoft.com",
|
|
90
|
+
"package": "@fluentui-react-native/callout",
|
|
91
|
+
"commit": "e597717b14dce4916740076786391449dd4a7c69",
|
|
92
|
+
"comment": "Rename Jest snapshots to be platform agnostic "
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"author": "beachball",
|
|
96
|
+
"package": "@fluentui-react-native/callout",
|
|
97
|
+
"comment": "Bump @fluentui-react-native/adapters to v0.8.1",
|
|
98
|
+
"commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"author": "beachball",
|
|
102
|
+
"package": "@fluentui-react-native/callout",
|
|
103
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.11.1",
|
|
104
|
+
"commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"author": "beachball",
|
|
108
|
+
"package": "@fluentui-react-native/callout",
|
|
109
|
+
"comment": "Bump @fluentui-react-native/tokens to v0.11.1",
|
|
110
|
+
"commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"author": "beachball",
|
|
114
|
+
"package": "@fluentui-react-native/callout",
|
|
115
|
+
"comment": "Bump @uifabricshared/foundation-compose to v1.11.1",
|
|
116
|
+
"commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"date": "Wed, 17 Nov 2021 19:28:07 GMT",
|
|
6
123
|
"tag": "@fluentui-react-native/callout_v0.19.0",
|
|
7
124
|
"version": "0.19.0",
|
|
8
125
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,51 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/callout
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 17 Dec 2021 19:51:04 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.19.4
|
|
8
|
+
|
|
9
|
+
Fri, 17 Dec 2021 19:51:04 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.11.3
|
|
14
|
+
|
|
15
|
+
## 0.19.3
|
|
16
|
+
|
|
17
|
+
Fri, 17 Dec 2021 18:39:08 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Documentation fixes (sanajmi@microsoft.com)
|
|
22
|
+
|
|
23
|
+
## 0.19.2
|
|
24
|
+
|
|
25
|
+
Fri, 17 Dec 2021 01:26:42 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.11.2
|
|
30
|
+
- Bump @uifabricshared/foundation-compose to v1.11.2
|
|
31
|
+
|
|
32
|
+
## 0.19.1
|
|
33
|
+
|
|
34
|
+
Thu, 16 Dec 2021 19:10:30 GMT
|
|
35
|
+
|
|
36
|
+
### Patches
|
|
37
|
+
|
|
38
|
+
- Add up/down arrow key support to macOS ContextualMenu (sanajmi@microsoft.com)
|
|
39
|
+
- remove focus style overrides for macOS contextual menu items (sanajmi@microsoft.com)
|
|
40
|
+
- Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
|
|
41
|
+
- Bump @fluentui-react-native/adapters to v0.8.1
|
|
42
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.11.1
|
|
43
|
+
- Bump @fluentui-react-native/tokens to v0.11.1
|
|
44
|
+
- Bump @uifabricshared/foundation-compose to v1.11.1
|
|
45
|
+
|
|
7
46
|
## 0.19.0
|
|
8
47
|
|
|
9
|
-
Wed, 17 Nov 2021 19:
|
|
48
|
+
Wed, 17 Nov 2021 19:28:07 GMT
|
|
10
49
|
|
|
11
50
|
### Minor changes
|
|
12
51
|
|
package/lib/Callout.types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScreenRect,
|
|
2
|
+
import { ScreenRect, ViewStyle } from 'react-native';
|
|
3
|
+
import { IViewProps } from '@fluentui-react-native/adapters';
|
|
3
4
|
import { IRenderData } from '@uifabricshared/foundation-composable';
|
|
4
5
|
import { IBackgroundColorTokens, IBorderTokens } from '@fluentui-react-native/tokens';
|
|
5
6
|
import { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
@@ -68,7 +69,11 @@ export interface ICalloutTokens extends IBackgroundColorTokens, CalloutBorderTok
|
|
|
68
69
|
*/
|
|
69
70
|
minPadding?: number;
|
|
70
71
|
}
|
|
71
|
-
export interface ICalloutProps extends
|
|
72
|
+
export interface ICalloutProps extends IViewProps, ICalloutTokens {
|
|
73
|
+
/**
|
|
74
|
+
* A string that should be announced when the callout is shown.
|
|
75
|
+
* @platform win32
|
|
76
|
+
*/
|
|
72
77
|
accessibilityOnShowAnnouncement?: string;
|
|
73
78
|
/**
|
|
74
79
|
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
@@ -78,6 +83,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
78
83
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
79
84
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
80
85
|
* border width prop will not be honored.
|
|
86
|
+
* @platform win32
|
|
81
87
|
*/
|
|
82
88
|
isBeakVisible?: boolean;
|
|
83
89
|
/**
|
|
@@ -93,6 +99,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
93
99
|
* this callback is most appropriate for components strictly controlling focus.
|
|
94
100
|
*
|
|
95
101
|
* restoreFocusEvent.nativeEvent.containsFocus is true if the Callout had focus while being dismissed.
|
|
102
|
+
* @platform win32
|
|
96
103
|
*/
|
|
97
104
|
onRestoreFocus?: (restoreFocusEvent: RestoreFocusEvent) => void;
|
|
98
105
|
/**
|
|
@@ -100,6 +107,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
100
107
|
*/
|
|
101
108
|
onShow?: () => void;
|
|
102
109
|
/**
|
|
110
|
+
* @platform win32
|
|
103
111
|
* If true then the callout will attempt to focus the first focusable element that it contains.
|
|
104
112
|
* If it doesn't find an element, no focus will be set. This means that it's the contents responsibility
|
|
105
113
|
* to either set focus or have focusable items.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.types.d.ts","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Callout.types.d.ts","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC;;GAEG;AAEH,oBAAY,eAAe,GACvB,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,WAAW,GACX,cAAc,GACd,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,iBAAiB,CAAC;AAEtB,oBAAY,gBAAgB,GAAG,yBAAyB,GAAG,8BAA8B,CAAC;AAE1F,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE;QACX;;WAEG;QACH,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;CACH;AAED,UAAU,mBAAmB;IAC3B,YAAY,CAAC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AAC,SAAS,CAAC,GAAG,MAAM,CAAC;CACpD;AAED,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,oBAAY,kBAAkB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,cAAc,CAAC;CACxB"}
|
package/lib/Callout.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.types.js","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Callout.types.js","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,IAAM,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,EAAE,CAAC,uBAAuB,EAAE;IAC1B,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScreenRect,
|
|
2
|
+
import { ScreenRect, ViewStyle } from 'react-native';
|
|
3
|
+
import { IViewProps } from '@fluentui-react-native/adapters';
|
|
3
4
|
import { IRenderData } from '@uifabricshared/foundation-composable';
|
|
4
5
|
import { IBackgroundColorTokens, IBorderTokens } from '@fluentui-react-native/tokens';
|
|
5
6
|
import { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
@@ -68,7 +69,11 @@ export interface ICalloutTokens extends IBackgroundColorTokens, CalloutBorderTok
|
|
|
68
69
|
*/
|
|
69
70
|
minPadding?: number;
|
|
70
71
|
}
|
|
71
|
-
export interface ICalloutProps extends
|
|
72
|
+
export interface ICalloutProps extends IViewProps, ICalloutTokens {
|
|
73
|
+
/**
|
|
74
|
+
* A string that should be announced when the callout is shown.
|
|
75
|
+
* @platform win32
|
|
76
|
+
*/
|
|
72
77
|
accessibilityOnShowAnnouncement?: string;
|
|
73
78
|
/**
|
|
74
79
|
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
@@ -78,6 +83,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
78
83
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
79
84
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
80
85
|
* border width prop will not be honored.
|
|
86
|
+
* @platform win32
|
|
81
87
|
*/
|
|
82
88
|
isBeakVisible?: boolean;
|
|
83
89
|
/**
|
|
@@ -93,6 +99,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
93
99
|
* this callback is most appropriate for components strictly controlling focus.
|
|
94
100
|
*
|
|
95
101
|
* restoreFocusEvent.nativeEvent.containsFocus is true if the Callout had focus while being dismissed.
|
|
102
|
+
* @platform win32
|
|
96
103
|
*/
|
|
97
104
|
onRestoreFocus?: (restoreFocusEvent: RestoreFocusEvent) => void;
|
|
98
105
|
/**
|
|
@@ -100,6 +107,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
100
107
|
*/
|
|
101
108
|
onShow?: () => void;
|
|
102
109
|
/**
|
|
110
|
+
* @platform win32
|
|
103
111
|
* If true then the callout will attempt to focus the first focusable element that it contains.
|
|
104
112
|
* If it doesn't find an element, no focus will be set. This means that it's the contents responsibility
|
|
105
113
|
* to either set focus or have focusable items.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.types.d.ts","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Callout.types.d.ts","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC;;GAEG;AAEH,oBAAY,eAAe,GACvB,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,WAAW,GACX,cAAc,GACd,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,iBAAiB,CAAC;AAEtB,oBAAY,gBAAgB,GAAG,yBAAyB,GAAG,8BAA8B,CAAC;AAE1F,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE;QACX;;WAEG;QACH,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;CACH;AAED,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/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ACpD;AAED,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,oBAAY,kBAAkB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,cAAc,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.types.js","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Callout.types.js","sourceRoot":"","sources":["../src/Callout.types.ts"],"names":[],"mappings":";;AAMa,QAAA,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA+B;AAC/B,wBAA6B;AAC7B,4DAAgD;AAEhD,EAAE,CAAC,uBAAuB,EAAE;IAC1B,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,WAAO,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
package/macos/Callout.swift
CHANGED
|
@@ -83,25 +83,21 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
83
83
|
|
|
84
84
|
// MARK: WindowLifeCycleDelegate
|
|
85
85
|
|
|
86
|
-
func
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
func applicationDidResignActiveForCalloutWindow(calloutWindow: CalloutWindow) {
|
|
91
|
-
dismissCallout()
|
|
86
|
+
func calloutWillDismiss(window: CalloutWindow) {
|
|
87
|
+
onDismissCallout()
|
|
92
88
|
}
|
|
93
89
|
|
|
94
90
|
// MARK: Private methods
|
|
95
91
|
|
|
96
92
|
private func showCallout() {
|
|
97
93
|
updateCalloutFrameToAnchor()
|
|
98
|
-
calloutWindow.
|
|
99
|
-
|
|
94
|
+
calloutWindow.makeKeyAndOrderFront(self)
|
|
95
|
+
onShowCallout()
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
private func dismissCallout() {
|
|
103
99
|
calloutWindow.close()
|
|
104
|
-
|
|
100
|
+
onDismissCallout()
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
/// Sets the frame of the Callout Window (in screen coordinates to be off of the Anchor on the preferred edge
|
|
@@ -268,11 +264,11 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
268
264
|
return calloutScreenRect
|
|
269
265
|
}
|
|
270
266
|
|
|
271
|
-
private func
|
|
267
|
+
private func onShowCallout() {
|
|
272
268
|
onShow?([:])
|
|
273
269
|
}
|
|
274
270
|
|
|
275
|
-
private func
|
|
271
|
+
private func onDismissCallout() {
|
|
276
272
|
if let onDismiss = onDismiss {
|
|
277
273
|
guard let reactTag = reactTag else {
|
|
278
274
|
preconditionFailure("React Tag missing")
|
|
@@ -286,17 +282,11 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
286
282
|
|
|
287
283
|
private var anchorView: NSView?
|
|
288
284
|
|
|
289
|
-
private var proxyView
|
|
285
|
+
private var proxyView = RCTView()
|
|
290
286
|
|
|
291
287
|
private lazy var calloutWindow: CalloutWindow = {
|
|
292
288
|
let window = CalloutWindow()
|
|
293
|
-
window.
|
|
294
|
-
window.isReleasedWhenClosed = true
|
|
295
|
-
|
|
296
|
-
window.styleMask = [.fullSizeContentView]
|
|
297
|
-
window.level = .popUpMenu
|
|
298
|
-
window.backgroundColor = .clear
|
|
299
|
-
window.isMovableByWindowBackground = false
|
|
289
|
+
window.lifeCycleDelegate = self
|
|
300
290
|
|
|
301
291
|
let visualEffect = NSVisualEffectView()
|
|
302
292
|
visualEffect.translatesAutoresizingMaskIntoConstraints = false
|
|
@@ -317,8 +307,7 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
317
307
|
visualEffect.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
|
|
318
308
|
])
|
|
319
309
|
|
|
320
|
-
|
|
321
|
-
window.setIsVisible(true)
|
|
310
|
+
visualEffect.addSubview(proxyView)
|
|
322
311
|
|
|
323
312
|
return window
|
|
324
313
|
}()
|
|
@@ -1,37 +1,59 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import AppKit
|
|
3
|
+
import Carbon.HIToolbox
|
|
3
4
|
|
|
4
|
-
protocol CalloutWindowLifeCycleDelegate {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
func didDetectHitOutsideCallout(calloutWindow: CalloutWindow)
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* Notify the CalloutWindowLifeCycle object that the window the callout is in is no longer active.
|
|
12
|
-
*/
|
|
13
|
-
func applicationDidResignActiveForCalloutWindow(calloutWindow: CalloutWindow)
|
|
5
|
+
protocol CalloutWindowLifeCycleDelegate: AnyObject {
|
|
6
|
+
/// Notify the delegate that the Callout is about to dismiss
|
|
7
|
+
func calloutWillDismiss(window: CalloutWindow)
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
class CalloutWindow: NSWindow {
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
|
|
12
|
+
weak var lifeCycleDelegate: CalloutWindowLifeCycleDelegate?
|
|
19
13
|
|
|
20
14
|
override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
|
|
21
15
|
super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
isReleasedWhenClosed = false
|
|
17
|
+
|
|
18
|
+
styleMask = .borderless
|
|
19
|
+
level = .popUpMenu
|
|
20
|
+
backgroundColor = .clear
|
|
21
|
+
isMovable = false
|
|
22
|
+
|
|
23
|
+
// Dismiss the Callout if the window is no longer active.
|
|
24
|
+
NotificationCenter.default.addObserver(self, selector: #selector(dismissCallout), name: NSApplication.didResignActiveNotification, object: nil)
|
|
25
|
+
|
|
26
|
+
// Dismiss the Callout if the user touched/clicked outside the bounds of the callout.
|
|
27
|
+
mouseEventMonitor = NSEvent.addLocalMonitorForEvents(matching: .leftMouseUp, handler: { [weak self] (event) -> NSEvent? in
|
|
26
28
|
if (event.window != self) {
|
|
27
|
-
self
|
|
29
|
+
self?.dismissCallout()
|
|
28
30
|
}
|
|
29
31
|
return event
|
|
30
32
|
})
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
// Required to get a key view loop in the window
|
|
36
|
+
override var canBecomeKey: Bool {
|
|
37
|
+
return true
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override var canBecomeMain: Bool {
|
|
41
|
+
return false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Dismiss the Callout if the user presses the Escape Key
|
|
45
|
+
override func keyDown(with event: NSEvent) {
|
|
46
|
+
switch Int(event.keyCode) {
|
|
47
|
+
case kVK_Escape:
|
|
48
|
+
dismissCallout()
|
|
49
|
+
default:
|
|
50
|
+
return super.keyDown(with: event)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@objc private func dismissCallout() {
|
|
55
|
+
lifeCycleDelegate?.calloutWillDismiss(window: self)
|
|
56
|
+
close()
|
|
35
57
|
}
|
|
36
58
|
|
|
37
59
|
private var mouseEventMonitor: Any?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/callout",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "A cross-platform Callout component using the Fluent Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"prettier-fix": "fluentui-scripts prettier --fix true"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@fluentui-react-native/adapters": "^0.8.1",
|
|
23
24
|
"@fluentui-react-native/component-cache": "^1.3.0",
|
|
24
|
-
"@fluentui-react-native/interactive-hooks": ">=0.11.
|
|
25
|
-
"@fluentui-react-native/tokens": ">=0.11.
|
|
25
|
+
"@fluentui-react-native/interactive-hooks": ">=0.11.3 <1.0.0",
|
|
26
|
+
"@fluentui-react-native/tokens": ">=0.11.1 <1.0.0",
|
|
26
27
|
"@uifabricshared/foundation-composable": ">=0.10.0 <1.0.0",
|
|
27
|
-
"@uifabricshared/foundation-compose": "^1.11.
|
|
28
|
+
"@uifabricshared/foundation-compose": "^1.11.2",
|
|
28
29
|
"@uifabricshared/foundation-settings": ">=0.11.0 <1.0.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
package/src/Callout.types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScreenRect,
|
|
2
|
+
import { ScreenRect, ViewStyle } from 'react-native';
|
|
3
|
+
import { IViewProps } from '@fluentui-react-native/adapters';
|
|
3
4
|
import { IRenderData } from '@uifabricshared/foundation-composable';
|
|
4
5
|
import { IBackgroundColorTokens, IBorderTokens } from '@fluentui-react-native/tokens';
|
|
5
6
|
import { IFocusable } from '@fluentui-react-native/interactive-hooks';
|
|
@@ -97,9 +98,10 @@ export interface ICalloutTokens extends IBackgroundColorTokens, CalloutBorderTok
|
|
|
97
98
|
minPadding?: number;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
export interface ICalloutProps extends
|
|
101
|
-
|
|
101
|
+
export interface ICalloutProps extends IViewProps, ICalloutTokens {
|
|
102
|
+
/**
|
|
102
103
|
* A string that should be announced when the callout is shown.
|
|
104
|
+
* @platform win32
|
|
103
105
|
*/
|
|
104
106
|
accessibilityOnShowAnnouncement?: string;
|
|
105
107
|
|
|
@@ -112,6 +114,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
112
114
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
113
115
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
114
116
|
* border width prop will not be honored.
|
|
117
|
+
* @platform win32
|
|
115
118
|
*/
|
|
116
119
|
isBeakVisible?: boolean;
|
|
117
120
|
|
|
@@ -129,6 +132,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
129
132
|
* this callback is most appropriate for components strictly controlling focus.
|
|
130
133
|
*
|
|
131
134
|
* restoreFocusEvent.nativeEvent.containsFocus is true if the Callout had focus while being dismissed.
|
|
135
|
+
* @platform win32
|
|
132
136
|
*/
|
|
133
137
|
onRestoreFocus?: (restoreFocusEvent: RestoreFocusEvent) => void;
|
|
134
138
|
|
|
@@ -138,6 +142,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
138
142
|
onShow?: () => void;
|
|
139
143
|
|
|
140
144
|
/**
|
|
145
|
+
* @platform win32
|
|
141
146
|
* If true then the callout will attempt to focus the first focusable element that it contains.
|
|
142
147
|
* If it doesn't find an element, no focus will be set. This means that it's the contents responsibility
|
|
143
148
|
* to either set focus or have focusable items.
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.test.win32.d.ts","sourceRoot":"","sources":["../../src/__tests__/Callout.test.win32.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.test.win32.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.win32.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,EAAE,CAAC,uBAAuB,EAAE;IAC1B,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.test.win32.d.ts","sourceRoot":"","sources":["../../src/__tests__/Callout.test.win32.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.test.win32.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.win32.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA+B;AAC/B,wBAA6B;AAC7B,4DAAgD;AAEhD,EAAE,CAAC,uBAAuB,EAAE;IAC1B,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,WAAO,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
|