@capgo/capacitor-stream-call 7.1.31 → 7.7.7

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.
@@ -58,45 +58,50 @@ class TouchInterceptView: UIView {
58
58
  let y = Int(locationInWeb.y)
59
59
  let js = """
60
60
  (() => {
61
- const x = \(x); const y = \(y);
61
+ const x = \(x), y = \(y);
62
62
  const el = document.elementFromPoint(x, y);
63
63
  if (!el) return 'NO_ELEM';
64
64
 
65
- // iPad fix: Force active state since iPad Safari doesn't handle :active properly
66
- const isIPad = navigator.userAgent.includes('iPad');
67
- if (isIPad) {
68
- el.classList.add('active');
69
- if (el.style.setProperty) el.style.setProperty('opacity', '0.8', 'important');
65
+ const eventInit = {
66
+ bubbles: true,
67
+ cancelable: true,
68
+ clientX: x,
69
+ clientY: y
70
+ };
71
+
72
+ const events = [];
73
+
74
+ if (typeof TouchEvent === 'function') {
75
+ try {
76
+ const touchObj = { identifier: Date.now(), target: el, clientX: x, clientY: y };
77
+ const touchInit = {
78
+ bubbles: true,
79
+ cancelable: true,
80
+ touches: [touchObj],
81
+ targetTouches: [],
82
+ changedTouches: [touchObj],
83
+ shiftKey: false
84
+ };
85
+ events.push(new TouchEvent('touchstart', touchInit));
86
+ events.push(new TouchEvent('touchend', touchInit));
87
+ } catch (e) {
88
+ console.log('TouchEvent creation failed', e);
89
+ }
70
90
  }
71
91
 
72
- const eventInit = { bubbles: true, cancelable: true, clientX: x, clientY: y };
73
- const touchInit = { bubbles: true, cancelable: true, touches: [{ clientX: x, clientY: y }], targetTouches: [], changedTouches: [], shiftKey: false };
74
- const seq = [];
75
- try {
76
- seq.push(new TouchEvent('touchstart', touchInit));
77
- } catch(e) { console.log('TouchEvent not supported', e); }
78
- seq.push(new PointerEvent('pointerdown', { ...eventInit, pointerType: 'touch' }));
79
- seq.push(new MouseEvent('mousedown', eventInit));
80
- try {
81
- seq.push(new TouchEvent('touchend', touchInit));
82
- } catch(e) { }
83
- seq.push(new PointerEvent('pointerup', { ...eventInit, pointerType: 'touch' }));
84
- seq.push(new MouseEvent('mouseup', eventInit));
85
- seq.push(new MouseEvent('click', eventInit));
86
- seq.forEach(evt => el.dispatchEvent(evt));
87
-
88
- // iPad cleanup
89
- if (isIPad) {
90
- setTimeout(() => {
91
- el.classList.remove('active');
92
- el.style.removeProperty('opacity');
93
- }, 100);
94
- }
92
+ events.push(new PointerEvent('pointerdown', { ...eventInit, pointerType: 'touch' }));
93
+ events.push(new MouseEvent('mousedown', eventInit));
94
+ events.push(new PointerEvent('pointerup', { ...eventInit, pointerType: 'touch' }));
95
+ events.push(new MouseEvent('mouseup', eventInit));
96
+ events.push(new MouseEvent('click', eventInit));
95
97
 
96
- console.log('SyntheticClick seq on', el);
98
+ events.forEach(evt => el.dispatchEvent(evt));
99
+
100
+ console.log('Synthetic click sequence dispatched to', el);
97
101
  return el.tagName;
98
102
  })();
99
103
  """
104
+
100
105
  // os_log(.debug, "TouchInterceptView: forwardClickToWeb - (%{public}d,%{public}d)", x, y)
101
106
  wk.evaluateJavaScript(js) { _, error in
102
107
  if let error = error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-stream-call",
3
- "version": "7.1.31",
3
+ "version": "7.7.7",
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",