@capgo/capacitor-stream-call 7.1.24 → 7.1.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.
@@ -10,27 +10,27 @@ class TouchInterceptView: UIView {
10
10
  private let touchThreshold: CGFloat = 5.0 // pixels
11
11
  private let timerDelay: TimeInterval = 0.1 // seconds
12
12
  private var hasActiveCallCheck: (() -> Bool)?
13
-
13
+
14
14
  func setupWithWebView(_ webView: UIView, overlayView: UIView) {
15
15
  self.webView = webView
16
16
  self.overlayView = overlayView
17
-
17
+
18
18
  // Ensure this view is transparent and doesn't interfere with display
19
19
  self.backgroundColor = .clear
20
20
  self.isOpaque = false
21
21
  // os_log(.debug, "TouchInterceptView: setupWithWebView - webView: %{public}s, overlayView: %{public}s", String(describing: webView), String(describing: overlayView))
22
22
  }
23
-
23
+
24
24
  func setActiveCallCheck(_ check: @escaping () -> Bool) {
25
25
  self.hasActiveCallCheck = check
26
26
  }
27
-
27
+
28
28
  private func shouldInterceptTouches() -> Bool {
29
29
  // Check if there's an active call
30
30
  let hasActiveCall = hasActiveCallCheck?() ?? false
31
31
  return hasActiveCall
32
32
  }
33
-
33
+
34
34
  private func isInteractive(_ view: UIView) -> Bool {
35
35
  if view is UIControl { return true }
36
36
  if let grs = view.gestureRecognizers, !grs.isEmpty { return true }
@@ -61,14 +61,14 @@ class TouchInterceptView: UIView {
61
61
  const x = \(x); const y = \(y);
62
62
  const el = document.elementFromPoint(x, y);
63
63
  if (!el) return 'NO_ELEM';
64
-
64
+
65
65
  // iPad fix: Force active state since iPad Safari doesn't handle :active properly
66
66
  const isIPad = navigator.userAgent.includes('iPad');
67
67
  if (isIPad) {
68
68
  el.classList.add('active');
69
69
  if (el.style.setProperty) el.style.setProperty('opacity', '0.8', 'important');
70
70
  }
71
-
71
+
72
72
  const eventInit = { bubbles: true, cancelable: true, clientX: x, clientY: y };
73
73
  const touchInit = { bubbles: true, cancelable: true, touches: [{ clientX: x, clientY: y }], targetTouches: [], changedTouches: [], shiftKey: false };
74
74
  const seq = [];
@@ -84,7 +84,7 @@ class TouchInterceptView: UIView {
84
84
  seq.push(new MouseEvent('mouseup', eventInit));
85
85
  seq.push(new MouseEvent('click', eventInit));
86
86
  seq.forEach(evt => el.dispatchEvent(evt));
87
-
87
+
88
88
  // iPad cleanup
89
89
  if (isIPad) {
90
90
  setTimeout(() => {
@@ -92,13 +92,13 @@ class TouchInterceptView: UIView {
92
92
  el.style.removeProperty('opacity');
93
93
  }, 100);
94
94
  }
95
-
95
+
96
96
  console.log('SyntheticClick seq on', el);
97
97
  return el.tagName;
98
98
  })();
99
99
  """
100
100
  // os_log(.debug, "TouchInterceptView: forwardClickToWeb - (%{public}d,%{public}d)", x, y)
101
- wk.evaluateJavaScript(js) { result, error in
101
+ wk.evaluateJavaScript(js) { _, error in
102
102
  if let error = error {
103
103
  // os_log(.error, "TouchInterceptView: JS error %{public}s", String(describing: error))
104
104
  } else {
@@ -108,14 +108,14 @@ class TouchInterceptView: UIView {
108
108
  }
109
109
 
110
110
  override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
111
-
111
+
112
112
  // Check if we should intercept touches
113
113
  if !shouldInterceptTouches() {
114
114
  // Cancel any pending timer when not in a call
115
115
  forwardTimer?.invalidate()
116
116
  forwardTimer = nil
117
117
  lastTouchPoint = nil
118
-
118
+
119
119
  if let webView = self.webView {
120
120
  let webPoint = self.convert(point, to: webView)
121
121
  let result = webView.hitTest(webPoint, with: event)
@@ -124,9 +124,9 @@ class TouchInterceptView: UIView {
124
124
  }
125
125
  return nil
126
126
  }
127
-
127
+
128
128
  print("TouchInterceptView: hitTest intercepting touch at \(point)")
129
-
129
+
130
130
  // Check if this is same touch location continuing
131
131
  if let lastPoint = lastTouchPoint {
132
132
  let distance = sqrt(pow(point.x - lastPoint.x, 2) + pow(point.y - lastPoint.y, 2))
@@ -136,7 +136,7 @@ class TouchInterceptView: UIView {
136
136
  // os_log(.debug, "TouchInterceptView: Touch continuing at %{public}s, cancelling timer", String(describing: point))
137
137
  }
138
138
  }
139
-
139
+
140
140
  // Store current point and start new timer
141
141
  lastTouchPoint = point
142
142
  forwardTimer?.invalidate()
@@ -148,7 +148,7 @@ class TouchInterceptView: UIView {
148
148
  // os_log(.debug, "TouchInterceptView: Timer fired, forwarding click to web at %{public}s", String(describing: point))
149
149
  self.forwardClickToWeb(at: point)
150
150
  }
151
-
151
+
152
152
  // 1. interactive hit on overlay (including root)
153
153
  if let overlayView = self.overlayView, !overlayView.isHidden {
154
154
  let overlayPoint = self.convert(point, to: overlayView)
@@ -167,7 +167,7 @@ class TouchInterceptView: UIView {
167
167
  print("TouchInterceptView: hitTest - No view found for \(point)")
168
168
  return nil
169
169
  }
170
-
170
+
171
171
  override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
172
172
  // Check if we should intercept touches
173
173
  if !shouldInterceptTouches() {
@@ -179,21 +179,21 @@ class TouchInterceptView: UIView {
179
179
  // os_log(.debug, "TouchInterceptView: point(inside) - Not intercepting, WebView only (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: result), String(describing: webViewPoint), String(describing: point), String(describing: result))
180
180
  return result
181
181
  }
182
-
182
+
183
183
  guard let webView = self.webView else {
184
184
  // os_log(.debug, "TouchInterceptView: point(inside) - webView is nil for point %{public}s. Checking overlay or deferring to super.", String(describing: point))
185
185
  if let overlayView = self.overlayView, !overlayView.isHidden {
186
186
  let overlayPoint = self.convert(point, to: overlayView)
187
187
  let overlayViewConsidersPointInside = overlayView.point(inside: overlayPoint, with: event)
188
- //os_log(.debug, "TouchInterceptView: point(inside) - webView nil. Overlay (%{public}s) for converted point %{public}s = %s", String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: overlayViewConsidersPointInside))
188
+ // os_log(.debug, "TouchInterceptView: point(inside) - webView nil. Overlay (%{public}s) for converted point %{public}s = %s", String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: overlayViewConsidersPointInside))
189
189
  return overlayViewConsidersPointInside
190
190
  }
191
191
  return super.point(inside: point, with: event)
192
192
  }
193
-
193
+
194
194
  let webViewPoint = self.convert(point, to: webView)
195
195
  let webViewConsidersPointInside = webView.point(inside: webViewPoint, with: event)
196
-
196
+
197
197
  if let overlayView = self.overlayView, !overlayView.isHidden {
198
198
  let overlayPoint = self.convert(point, to: overlayView)
199
199
  let overlayViewConsidersPointInside = overlayView.point(inside: overlayPoint, with: event)
@@ -202,11 +202,11 @@ class TouchInterceptView: UIView {
202
202
  return result
203
203
  } else {
204
204
  if self.overlayView == nil {
205
- // os_log(.debug, "TouchInterceptView: point(inside) - Overlay nil. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
205
+ // os_log(.debug, "TouchInterceptView: point(inside) - Overlay nil. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
206
206
  } else {
207
- // os_log(.debug, "TouchInterceptView: point(inside) - Overlay hidden. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
207
+ // os_log(.debug, "TouchInterceptView: point(inside) - Overlay hidden. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
208
208
  }
209
209
  return webViewConsidersPointInside
210
210
  }
211
211
  }
212
- }
212
+ }
@@ -69,7 +69,7 @@ class SecureUserRepository: UserRepository, VoipTokenHandler {
69
69
 
70
70
  func loadCurrentUser() -> UserCredentials? {
71
71
  print("SecureUserRepository: Loading current user credentials")
72
-
72
+
73
73
  if let savedUser = defaults.object(forKey: userKey) as? Data {
74
74
  let decoder = JSONDecoder()
75
75
  do {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-stream-call",
3
- "version": "7.1.24",
3
+ "version": "7.1.25",
4
4
  "description": "Uses the https://getstream.io/ SDK to implement calling in Capacitor",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",