@fluentui-react-native/callout 0.19.0 → 0.19.1
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 +52 -1
- package/CHANGELOG.md +16 -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 +2 -9
- package/macos/CalloutWindow.swift +19 -5
- 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,58 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/callout",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 16 Dec 2021 06:26:41 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/callout_v0.19.1",
|
|
7
|
+
"version": "0.19.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "sanajmi@microsoft.com",
|
|
12
|
+
"package": "@fluentui-react-native/callout",
|
|
13
|
+
"commit": "dd2f47a0a2d6aab7361301a16407c76497b45ce7",
|
|
14
|
+
"comment": "remove focus style overrides for macOS contextual menu items"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "sanajmi@microsoft.com",
|
|
18
|
+
"package": "@fluentui-react-native/callout",
|
|
19
|
+
"commit": "e597717b14dce4916740076786391449dd4a7c69",
|
|
20
|
+
"comment": "Rename Jest snapshots to be platform agnostic "
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "sanajmi@microsoft.com",
|
|
24
|
+
"package": "@fluentui-react-native/callout",
|
|
25
|
+
"commit": "51cbf7c64d5c52feeec2e845cd4dbd4e23c96e1e",
|
|
26
|
+
"comment": "Add up/down arrow key support to macOS ContextualMenu"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui-react-native/callout",
|
|
31
|
+
"comment": "Bump @fluentui-react-native/adapters to v0.8.1",
|
|
32
|
+
"commit": "841d2998e8b97fabe0b6dac9c74c3d63d2b3bbd4"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui-react-native/callout",
|
|
37
|
+
"comment": "Bump @fluentui-react-native/interactive-hooks to v0.11.1",
|
|
38
|
+
"commit": "841d2998e8b97fabe0b6dac9c74c3d63d2b3bbd4"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui-react-native/callout",
|
|
43
|
+
"comment": "Bump @fluentui-react-native/tokens to v0.11.1",
|
|
44
|
+
"commit": "841d2998e8b97fabe0b6dac9c74c3d63d2b3bbd4"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui-react-native/callout",
|
|
49
|
+
"comment": "Bump @uifabricshared/foundation-compose to v1.11.1",
|
|
50
|
+
"commit": "841d2998e8b97fabe0b6dac9c74c3d63d2b3bbd4"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Wed, 17 Nov 2021 19:28:07 GMT",
|
|
6
57
|
"tag": "@fluentui-react-native/callout_v0.19.0",
|
|
7
58
|
"version": "0.19.0",
|
|
8
59
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/callout
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 16 Dec 2021 06:26:41 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.19.1
|
|
8
|
+
|
|
9
|
+
Thu, 16 Dec 2021 06:26:41 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- remove focus style overrides for macOS contextual menu items (sanajmi@microsoft.com)
|
|
14
|
+
- Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
|
|
15
|
+
- Add up/down arrow key support to macOS ContextualMenu (sanajmi@microsoft.com)
|
|
16
|
+
- Bump @fluentui-react-native/adapters to v0.8.1
|
|
17
|
+
- Bump @fluentui-react-native/interactive-hooks to v0.11.1
|
|
18
|
+
- Bump @fluentui-react-native/tokens to v0.11.1
|
|
19
|
+
- Bump @uifabricshared/foundation-compose to v1.11.1
|
|
20
|
+
|
|
7
21
|
## 0.19.0
|
|
8
22
|
|
|
9
|
-
Wed, 17 Nov 2021 19:
|
|
23
|
+
Wed, 17 Nov 2021 19:28:07 GMT
|
|
10
24
|
|
|
11
25
|
### Minor changes
|
|
12
26
|
|
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,13 +69,18 @@ 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
|
+
* @platform win32
|
|
75
|
+
* A string that should be announced when the callout is shown.
|
|
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.
|
|
75
80
|
*/
|
|
76
81
|
componentRef?: React.RefObject<IFocusable>;
|
|
77
82
|
/**
|
|
83
|
+
* @platform win32
|
|
78
84
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
79
85
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
80
86
|
* border width prop will not be honored.
|
|
@@ -85,6 +91,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
85
91
|
*/
|
|
86
92
|
onDismiss?: () => void;
|
|
87
93
|
/**
|
|
94
|
+
* @platform win32
|
|
88
95
|
* Callback invoked during callout dismissal; if set, focus will not be restored by the callout and onRestoreFocus must
|
|
89
96
|
* result in focus being moved to the appropriate focusable target.
|
|
90
97
|
*
|
|
@@ -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,CAA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G;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,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,13 +69,18 @@ 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
|
+
* @platform win32
|
|
75
|
+
* A string that should be announced when the callout is shown.
|
|
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.
|
|
75
80
|
*/
|
|
76
81
|
componentRef?: React.RefObject<IFocusable>;
|
|
77
82
|
/**
|
|
83
|
+
* @platform win32
|
|
78
84
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
79
85
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
80
86
|
* border width prop will not be honored.
|
|
@@ -85,6 +91,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
85
91
|
*/
|
|
86
92
|
onDismiss?: () => void;
|
|
87
93
|
/**
|
|
94
|
+
* @platform win32
|
|
88
95
|
* Callback invoked during callout dismissal; if set, focus will not be restored by the callout and onRestoreFocus must
|
|
89
96
|
* result in focus being moved to the appropriate focusable target.
|
|
90
97
|
*
|
|
@@ -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/B,WAAW,CAAC,EAAE,SAAS,C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AG;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
|
@@ -95,7 +95,7 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
95
95
|
|
|
96
96
|
private func showCallout() {
|
|
97
97
|
updateCalloutFrameToAnchor()
|
|
98
|
-
calloutWindow.
|
|
98
|
+
calloutWindow.makeKeyAndOrderFront(self)
|
|
99
99
|
didShowCallout()
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -291,12 +291,6 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
291
291
|
private lazy var calloutWindow: CalloutWindow = {
|
|
292
292
|
let window = CalloutWindow()
|
|
293
293
|
window.windowLifeCycleDelegate = self
|
|
294
|
-
window.isReleasedWhenClosed = true
|
|
295
|
-
|
|
296
|
-
window.styleMask = [.fullSizeContentView]
|
|
297
|
-
window.level = .popUpMenu
|
|
298
|
-
window.backgroundColor = .clear
|
|
299
|
-
window.isMovableByWindowBackground = false
|
|
300
294
|
|
|
301
295
|
let visualEffect = NSVisualEffectView()
|
|
302
296
|
visualEffect.translatesAutoresizingMaskIntoConstraints = false
|
|
@@ -317,8 +311,7 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
|
|
|
317
311
|
visualEffect.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
|
|
318
312
|
])
|
|
319
313
|
|
|
320
|
-
|
|
321
|
-
window.setIsVisible(true)
|
|
314
|
+
visualEffect.addSubview(proxyView)
|
|
322
315
|
|
|
323
316
|
return window
|
|
324
317
|
}()
|
|
@@ -6,7 +6,7 @@ protocol CalloutWindowLifeCycleDelegate {
|
|
|
6
6
|
* Notify the CalloutWindowLifeCycle object that the user touched/clicked outside the bounds of the callout.
|
|
7
7
|
*/
|
|
8
8
|
func didDetectHitOutsideCallout(calloutWindow: CalloutWindow)
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
/*
|
|
11
11
|
* Notify the CalloutWindowLifeCycle object that the window the callout is in is no longer active.
|
|
12
12
|
*/
|
|
@@ -14,14 +14,20 @@ protocol CalloutWindowLifeCycleDelegate {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
class CalloutWindow: NSWindow {
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
public var windowLifeCycleDelegate: CalloutWindowLifeCycleDelegate?
|
|
19
19
|
|
|
20
20
|
override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
|
|
21
21
|
super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
|
|
22
|
-
|
|
22
|
+
isReleasedWhenClosed = true
|
|
23
|
+
|
|
24
|
+
styleMask = .borderless
|
|
25
|
+
level = .popUpMenu
|
|
26
|
+
backgroundColor = .clear
|
|
27
|
+
isMovable = false
|
|
28
|
+
|
|
23
29
|
NotificationCenter.default.addObserver(self, selector: #selector(appDidChangeActive(notification:)), name: NSApplication.didResignActiveNotification, object: nil)
|
|
24
|
-
|
|
30
|
+
|
|
25
31
|
mouseEventMonitor = NSEvent.addLocalMonitorForEvents(matching: .leftMouseUp, handler: { (event) -> NSEvent? in
|
|
26
32
|
if (event.window != self) {
|
|
27
33
|
self.windowLifeCycleDelegate?.didDetectHitOutsideCallout(calloutWindow: self)
|
|
@@ -30,9 +36,17 @@ class CalloutWindow: NSWindow {
|
|
|
30
36
|
})
|
|
31
37
|
}
|
|
32
38
|
|
|
39
|
+
override var canBecomeKey: Bool {
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override var canBecomeMain: Bool {
|
|
44
|
+
return false
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
@objc func appDidChangeActive(notification: NSNotification) {
|
|
34
48
|
windowLifeCycleDelegate?.applicationDidResignActiveForCalloutWindow(calloutWindow: self)
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
private var mouseEventMonitor: Any?
|
|
38
|
-
}
|
|
52
|
+
}
|
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.1",
|
|
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.1 <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.1",
|
|
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,8 +98,9 @@ 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
|
+
/**
|
|
103
|
+
* @platform win32
|
|
102
104
|
* A string that should be announced when the callout is shown.
|
|
103
105
|
*/
|
|
104
106
|
accessibilityOnShowAnnouncement?: string;
|
|
@@ -109,6 +111,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
109
111
|
componentRef?: React.RefObject<IFocusable>;
|
|
110
112
|
|
|
111
113
|
/**
|
|
114
|
+
* @platform win32
|
|
112
115
|
* Adds a beak to the Callout, pointing to the anchor target.
|
|
113
116
|
* Notable Win32 limitation: Beak rendering currently limits the border width to its default, and the
|
|
114
117
|
* border width prop will not be honored.
|
|
@@ -121,6 +124,7 @@ export interface ICalloutProps extends ViewProps, ICalloutTokens {
|
|
|
121
124
|
onDismiss?: () => void;
|
|
122
125
|
|
|
123
126
|
/**
|
|
127
|
+
* @platform win32
|
|
124
128
|
* Callback invoked during callout dismissal; if set, focus will not be restored by the callout and onRestoreFocus must
|
|
125
129
|
* result in focus being moved to the appropriate focusable target.
|
|
126
130
|
*
|
|
@@ -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"}
|