@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.
- package/README.md +102 -12
- package/android/build.gradle +2 -2
- package/android/src/main/AndroidManifest.xml +0 -6
- package/android/src/main/java/ee/forgr/capacitor/streamcall/AcceptCallReceiver.kt +1 -1
- package/android/src/main/java/ee/forgr/capacitor/streamcall/CustomStreamIntentResolver.kt +2 -2
- package/android/src/main/java/ee/forgr/capacitor/streamcall/StreamCallPlugin.kt +2946 -2462
- package/android/src/main/res/raw/outgoing.mp3 +0 -0
- package/dist/docs.json +204 -1
- package/dist/esm/definitions.d.ts +64 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/StreamCallPlugin/StreamCallPlugin.swift +443 -154
- package/ios/Sources/StreamCallPlugin/TouchInterceptView.swift +35 -30
- package/package.json +1 -1
|
@@ -58,45 +58,50 @@ class TouchInterceptView: UIView {
|
|
|
58
58
|
let y = Int(locationInWeb.y)
|
|
59
59
|
let js = """
|
|
60
60
|
(() => {
|
|
61
|
-
const x = \(x)
|
|
61
|
+
const x = \(x), y = \(y);
|
|
62
62
|
const el = document.elementFromPoint(x, y);
|
|
63
63
|
if (!el) return 'NO_ELEM';
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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