@fluentui-react-native/callout 0.19.22 → 0.19.26

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,73 @@
2
2
  "name": "@fluentui-react-native/callout",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 02 Feb 2022 02:26:23 GMT",
5
+ "date": "Thu, 17 Feb 2022 02:11:28 GMT",
6
+ "tag": "@fluentui-react-native/callout_v0.19.26",
7
+ "version": "0.19.26",
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.2",
14
+ "commit": "616c894f75769553fe97f8f2d4550bbd615f2396"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 17 Feb 2022 01:22:02 GMT",
21
+ "tag": "@fluentui-react-native/callout_v0.19.25",
22
+ "version": "0.19.25",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui-react-native/callout",
28
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.1",
29
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
30
+ },
31
+ {
32
+ "author": "beachball",
33
+ "package": "@fluentui-react-native/callout",
34
+ "comment": "Bump @uifabricshared/foundation-compose to v1.11.10",
35
+ "commit": "039a993d13ae01ff2212e8b91295d1ed5676c82d"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "date": "Thu, 10 Feb 2022 17:13:16 GMT",
42
+ "tag": "@fluentui-react-native/callout_v0.19.24",
43
+ "version": "0.19.24",
44
+ "comments": {
45
+ "patch": [
46
+ {
47
+ "author": "sanajmi@microsoft.com",
48
+ "package": "@fluentui-react-native/callout",
49
+ "commit": "83351e09339212a1bfd1e76bce25251726082372",
50
+ "comment": "macOS: Add Childwindow support"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Wed, 09 Feb 2022 20:14:50 GMT",
57
+ "tag": "@fluentui-react-native/callout_v0.19.23",
58
+ "version": "0.19.23",
59
+ "comments": {
60
+ "patch": [
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui-react-native/callout",
64
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.13.0",
65
+ "commit": "f7264338409e4a7e4cbb4f4fb815d4ab32276d8a"
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "date": "Wed, 02 Feb 2022 02:29:07 GMT",
6
72
  "tag": "@fluentui-react-native/callout_v0.19.22",
7
73
  "version": "0.19.22",
8
74
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Change Log - @fluentui-react-native/callout
2
2
 
3
- This log was last generated on Wed, 02 Feb 2022 02:26:23 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Feb 2022 02:11:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.19.26
8
+
9
+ Thu, 17 Feb 2022 02:11:28 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.2
14
+
15
+ ## 0.19.25
16
+
17
+ Thu, 17 Feb 2022 01:22:02 GMT
18
+
19
+ ### Patches
20
+
21
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.1
22
+ - Bump @uifabricshared/foundation-compose to v1.11.10
23
+
24
+ ## 0.19.24
25
+
26
+ Thu, 10 Feb 2022 17:13:16 GMT
27
+
28
+ ### Patches
29
+
30
+ - macOS: Add Childwindow support (sanajmi@microsoft.com)
31
+
32
+ ## 0.19.23
33
+
34
+ Wed, 09 Feb 2022 20:14:50 GMT
35
+
36
+ ### Patches
37
+
38
+ - Bump @fluentui-react-native/interactive-hooks to v0.13.0
39
+
7
40
  ## 0.19.22
8
41
 
9
- Wed, 02 Feb 2022 02:26:23 GMT
42
+ Wed, 02 Feb 2022 02:29:07 GMT
10
43
 
11
44
  ### Patches
12
45
 
@@ -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.22",
3
+ "version": "0.19.26",
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.2 <1.0.0",
30
+ "@fluentui-react-native/interactive-hooks": ">=0.13.2 <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.9",
33
+ "@uifabricshared/foundation-compose": "^1.11.10",
34
34
  "@uifabricshared/foundation-settings": ">=0.11.2 <1.0.0"
35
35
  },
36
36
  "devDependencies": {