@fluentui-react-native/callout 0.19.23 → 0.19.27

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 CHANGED
@@ -2,7 +2,85 @@
2
2
  "name": "@fluentui-react-native/callout",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 09 Feb 2022 20:13:22 GMT",
5
+ "date": "Fri, 18 Feb 2022 23:25:56 GMT",
6
+ "tag": "@fluentui-react-native/callout_v0.19.27",
7
+ "version": "0.19.27",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui-react-native/callout",
13
+ "comment": "Bump @fluentui-react-native/adapters to v0.8.3",
14
+ "commit": "597b1e6bd7b3791df8fad2e0ec83810872261c54"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui-react-native/callout",
19
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.3",
20
+ "commit": "597b1e6bd7b3791df8fad2e0ec83810872261c54"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui-react-native/callout",
25
+ "comment": "Bump @fluentui-react-native/tokens to v0.11.6",
26
+ "commit": "597b1e6bd7b3791df8fad2e0ec83810872261c54"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Thu, 17 Feb 2022 02:13:07 GMT",
33
+ "tag": "@fluentui-react-native/callout_v0.19.26",
34
+ "version": "0.19.26",
35
+ "comments": {
36
+ "patch": [
37
+ {
38
+ "author": "beachball",
39
+ "package": "@fluentui-react-native/callout",
40
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.2",
41
+ "commit": "616c894f75769553fe97f8f2d4550bbd615f2396"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Thu, 17 Feb 2022 01:22:02 GMT",
48
+ "tag": "@fluentui-react-native/callout_v0.19.25",
49
+ "version": "0.19.25",
50
+ "comments": {
51
+ "patch": [
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui-react-native/callout",
55
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.1",
56
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui-react-native/callout",
61
+ "comment": "Bump @uifabricshared/foundation-compose to v1.11.10",
62
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "date": "Thu, 10 Feb 2022 17:13:16 GMT",
69
+ "tag": "@fluentui-react-native/callout_v0.19.24",
70
+ "version": "0.19.24",
71
+ "comments": {
72
+ "patch": [
73
+ {
74
+ "author": "sanajmi@microsoft.com",
75
+ "package": "@fluentui-react-native/callout",
76
+ "commit": "83351e09339212a1bfd1e76bce25251726082372",
77
+ "comment": "macOS: Add Childwindow support"
78
+ }
79
+ ]
80
+ }
81
+ },
82
+ {
83
+ "date": "Wed, 09 Feb 2022 20:14:50 GMT",
6
84
  "tag": "@fluentui-react-native/callout_v0.19.23",
7
85
  "version": "0.19.23",
8
86
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,47 @@
1
1
  # Change Log - @fluentui-react-native/callout
2
2
 
3
- This log was last generated on Wed, 09 Feb 2022 20:13:22 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 18 Feb 2022 23:25:56 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.19.27
8
+
9
+ Fri, 18 Feb 2022 23:25:56 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/adapters to v0.8.3
14
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.3
15
+ - Bump @fluentui-react-native/tokens to v0.11.6
16
+
17
+ ## 0.19.26
18
+
19
+ Thu, 17 Feb 2022 02:13:07 GMT
20
+
21
+ ### Patches
22
+
23
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.2
24
+
25
+ ## 0.19.25
26
+
27
+ Thu, 17 Feb 2022 01:22:02 GMT
28
+
29
+ ### Patches
30
+
31
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.1
32
+ - Bump @uifabricshared/foundation-compose to v1.11.10
33
+
34
+ ## 0.19.24
35
+
36
+ Thu, 10 Feb 2022 17:13:16 GMT
37
+
38
+ ### Patches
39
+
40
+ - macOS: Add Childwindow support (sanajmi@microsoft.com)
41
+
7
42
  ## 0.19.23
8
43
 
9
- Wed, 09 Feb 2022 20:13:22 GMT
44
+ Wed, 09 Feb 2022 20:14:50 GMT
10
45
 
11
46
  ### Patches
12
47
 
@@ -304,7 +304,9 @@ class CalloutView: RCTView, CalloutWindowLifeCycleDelegate {
304
304
  }
305
305
 
306
306
  contentView.addSubview(proxyView)
307
- window.initialFirstResponder = proxyView
307
+ if let parentWindow = self.window {
308
+ parentWindow.addChildWindow(window, ordered: .above)
309
+ }
308
310
 
309
311
  return window
310
312
  }()
@@ -22,11 +22,31 @@ class CalloutWindow: NSWindow {
22
22
  // Dismiss the Callout if the window is no longer active.
23
23
  NotificationCenter.default.addObserver(self, selector: #selector(dismissCallout), name: NSApplication.didResignActiveNotification, object: nil)
24
24
 
25
- // Dismiss the Callout if the user touched/clicked outside the bounds of the callout.
25
+ // Dismiss the Callout if the user clicked outside the Callout Window or any of our child windows.
26
26
  mouseEventMonitor = NSEvent.addLocalMonitorForEvents(matching: .leftMouseUp, handler: { [weak self] (event) -> NSEvent? in
27
- if (event.window != self) {
27
+ guard let clickedWindow = event.window else {
28
+ return event
29
+ }
30
+
31
+ var shouldDismissCallout = true
32
+
33
+ // Did the click happened in our own window?
34
+ if (clickedWindow.isEqual(to: self) ) {
35
+ shouldDismissCallout = false
36
+
37
+ // Are we a child window of a Callout (e.g: a ContextualMenu submenu), where the click happened in our parent?
38
+ } else if (clickedWindow.isEqual(to: self?.parent as? CalloutWindow)) {
39
+ shouldDismissCallout = false
40
+
41
+ // Did the click happened in any of our child windows (e.g: our submenus)?
42
+ } else if (self?.childWindows?.contains(clickedWindow) ?? false) {
43
+ shouldDismissCallout = false
44
+ }
45
+
46
+ if (shouldDismissCallout) {
28
47
  self?.dismissCallout()
29
48
  }
49
+
30
50
  return event
31
51
  })
32
52
  }
@@ -47,7 +67,12 @@ class CalloutWindow: NSWindow {
47
67
 
48
68
  @objc private func dismissCallout() {
49
69
  lifeCycleDelegate?.calloutWillDismiss(window: self)
50
- close()
70
+
71
+ if let monitor = mouseEventMonitor {
72
+ NSEvent.removeMonitor(monitor)
73
+ }
74
+
75
+ orderOut(self)
51
76
  }
52
77
 
53
78
  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.23",
3
+ "version": "0.19.27",
4
4
  "description": "A cross-platform Callout component using the Fluent Design System",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -25,12 +25,12 @@
25
25
  "directory": "packages/components/Callout"
26
26
  },
27
27
  "dependencies": {
28
- "@fluentui-react-native/adapters": "^0.8.2",
28
+ "@fluentui-react-native/adapters": "^0.8.3",
29
29
  "@fluentui-react-native/component-cache": "^1.3.1",
30
- "@fluentui-react-native/interactive-hooks": ">=0.13.0 <1.0.0",
31
- "@fluentui-react-native/tokens": ">=0.11.5 <1.0.0",
30
+ "@fluentui-react-native/interactive-hooks": ">=0.13.3 <1.0.0",
31
+ "@fluentui-react-native/tokens": ">=0.11.6 <1.0.0",
32
32
  "@uifabricshared/foundation-composable": ">=0.10.2 <1.0.0",
33
- "@uifabricshared/foundation-compose": "^1.11.9",
33
+ "@uifabricshared/foundation-compose": "^1.11.10",
34
34
  "@uifabricshared/foundation-settings": ">=0.11.2 <1.0.0"
35
35
  },
36
36
  "devDependencies": {