@fluentui-react-native/callout 0.19.21 → 0.19.25

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,79 @@
2
2
  "name": "@fluentui-react-native/callout",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 28 Jan 2022 20:52:02 GMT",
5
+ "date": "Thu, 17 Feb 2022 01:19:23 GMT",
6
+ "tag": "@fluentui-react-native/callout_v0.19.25",
7
+ "version": "0.19.25",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui-react-native/callout",
13
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.1",
14
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui-react-native/callout",
19
+ "comment": "Bump @uifabricshared/foundation-compose to v1.11.10",
20
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Thu, 10 Feb 2022 17:13:16 GMT",
27
+ "tag": "@fluentui-react-native/callout_v0.19.24",
28
+ "version": "0.19.24",
29
+ "comments": {
30
+ "patch": [
31
+ {
32
+ "author": "sanajmi@microsoft.com",
33
+ "package": "@fluentui-react-native/callout",
34
+ "commit": "83351e09339212a1bfd1e76bce25251726082372",
35
+ "comment": "macOS: Add Childwindow support"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "date": "Wed, 09 Feb 2022 20:14:50 GMT",
42
+ "tag": "@fluentui-react-native/callout_v0.19.23",
43
+ "version": "0.19.23",
44
+ "comments": {
45
+ "patch": [
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui-react-native/callout",
49
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.0",
50
+ "commit": "f7264338409e4a7e4cbb4f4fb815d4ab32276d8a"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Wed, 02 Feb 2022 02:29:07 GMT",
57
+ "tag": "@fluentui-react-native/callout_v0.19.22",
58
+ "version": "0.19.22",
59
+ "comments": {
60
+ "patch": [
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui-react-native/callout",
64
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.12.2",
65
+ "commit": "c42dec6d24b24ded9a85dd11076e49d9b92980aa"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui-react-native/callout",
70
+ "comment": "Bump @uifabricshared/foundation-compose to v1.11.9",
71
+ "commit": "c42dec6d24b24ded9a85dd11076e49d9b92980aa"
72
+ }
73
+ ]
74
+ }
75
+ },
76
+ {
77
+ "date": "Fri, 28 Jan 2022 20:52:39 GMT",
6
78
  "tag": "@fluentui-react-native/callout_v0.19.21",
7
79
  "version": "0.19.21",
8
80
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,46 @@
1
1
  # Change Log - @fluentui-react-native/callout
2
2
 
3
- This log was last generated on Fri, 28 Jan 2022 20:52:02 GMT and should not be manually modified.
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.19.25
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
+ - Bump @uifabricshared/foundation-compose to v1.11.10
15
+
16
+ ## 0.19.24
17
+
18
+ Thu, 10 Feb 2022 17:13:16 GMT
19
+
20
+ ### Patches
21
+
22
+ - macOS: Add Childwindow support (sanajmi@microsoft.com)
23
+
24
+ ## 0.19.23
25
+
26
+ Wed, 09 Feb 2022 20:14:50 GMT
27
+
28
+ ### Patches
29
+
30
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.0
31
+
32
+ ## 0.19.22
33
+
34
+ Wed, 02 Feb 2022 02:29:07 GMT
35
+
36
+ ### Patches
37
+
38
+ - Bump @fluentui-react-native/interactive-hooks to v0.12.2
39
+ - Bump @uifabricshared/foundation-compose to v1.11.9
40
+
7
41
  ## 0.19.21
8
42
 
9
- Fri, 28 Jan 2022 20:52:02 GMT
43
+ Fri, 28 Jan 2022 20:52:39 GMT
10
44
 
11
45
  ### Patches
12
46
 
@@ -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.21",
3
+ "version": "0.19.25",
4
4
  "description": "A cross-platform Callout component using the Fluent Design System",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -27,10 +27,10 @@
27
27
  "dependencies": {
28
28
  "@fluentui-react-native/adapters": "^0.8.2",
29
29
  "@fluentui-react-native/component-cache": "^1.3.1",
30
- "@fluentui-react-native/interactive-hooks": ">=0.12.1 <1.0.0",
30
+ "@fluentui-react-native/interactive-hooks": ">=0.13.1 <1.0.0",
31
31
  "@fluentui-react-native/tokens": ">=0.11.5 <1.0.0",
32
32
  "@uifabricshared/foundation-composable": ">=0.10.2 <1.0.0",
33
- "@uifabricshared/foundation-compose": "^1.11.8",
33
+ "@uifabricshared/foundation-compose": "^1.11.10",
34
34
  "@uifabricshared/foundation-settings": ">=0.11.2 <1.0.0"
35
35
  },
36
36
  "devDependencies": {