sitepong 0.2.3 → 0.2.4
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/android/build.gradle +39 -0
- package/android/src/main/java/com/sitepong/deviceid/DeviceIdHelper.kt +45 -0
- package/android/src/main/java/com/sitepong/deviceid/DeviceIdModule.kt +45 -0
- package/android/src/main/java/com/sitepong/screenrecorder/ChunkUploader.kt +78 -0
- package/android/src/main/java/com/sitepong/screenrecorder/H264Encoder.kt +163 -0
- package/android/src/main/java/com/sitepong/screenrecorder/ScreenCapture.kt +103 -0
- package/android/src/main/java/com/sitepong/screenrecorder/ScreenRecorderModule.kt +80 -0
- package/android/src/main/java/com/sitepong/screenrecorder/SensitiveViewManager.kt +19 -0
- package/app.plugin.js +426 -0
- package/dist/cdn/sitepong.min.js +5 -5
- package/dist/cdn/sitepong.min.js.map +1 -1
- package/dist/entries/rn.d.ts +188 -16
- package/dist/entries/rn.js +188 -35
- package/dist/entries/rn.js.map +1 -1
- package/dist/entries/web.js +2 -1
- package/dist/entries/web.js.map +1 -1
- package/dist/entries/web.mjs +2 -1
- package/dist/entries/web.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +2 -1
- package/dist/react/index.mjs.map +1 -1
- package/expo-module.config.json +16 -0
- package/ios/DeviceId/DeviceIdModule.swift +55 -0
- package/ios/DeviceId/KeychainHelper.swift +68 -0
- package/ios/LiveActivity/ConfigStore.swift +43 -0
- package/ios/LiveActivity/DSLNode.swift +188 -0
- package/ios/LiveActivity/SitePongActivityAttributes.swift +112 -0
- package/ios/LiveActivity/SitePongLiveActivityModule.swift +250 -0
- package/ios/LiveActivity/widget/ColorHex.swift +30 -0
- package/ios/LiveActivity/widget/DSLAnimations.swift +128 -0
- package/ios/LiveActivity/widget/DSLRenderer.swift +538 -0
- package/ios/LiveActivity/widget/SitePongLiveActivityWidget.swift +393 -0
- package/ios/LiveActivity/widget/SitePongWidgetBundle.swift +84 -0
- package/ios/ScreenRecorder/ChunkUploader.swift +52 -0
- package/ios/ScreenRecorder/H264Encoder.swift +229 -0
- package/ios/ScreenRecorder/ScreenCapture.swift +149 -0
- package/ios/ScreenRecorder/ScreenRecorderModule.swift +179 -0
- package/ios/ScreenRecorder/SensitiveViewManager.swift +63 -0
- package/ios/Sitepong.podspec +57 -0
- package/ios/WatchtowerCore/Screenshotter.swift +163 -0
- package/ios/WatchtowerCore/SwiftUIModifiers.swift +78 -0
- package/ios/WatchtowerCore/Swizzling.swift +59 -0
- package/ios/WatchtowerCore/TapEvent.swift +61 -0
- package/ios/WatchtowerCore/Transport.swift +136 -0
- package/ios/WatchtowerCore/UIViewExtensions.swift +31 -0
- package/ios/WatchtowerCore/Watchtower.swift +80 -0
- package/ios/WatchtowerCore/WatchtowerEngine.swift +565 -0
- package/ios/WatchtowerCore/WatchtowerHash.swift +120 -0
- package/ios/WatchtowerCore/WatchtowerRegistry.swift +87 -0
- package/package.json +17 -10
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#if canImport(UIKit)
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
/// A tagged region registered by a SwiftUI `.watchtowerTag` / `.watchtowerScreen`
|
|
5
|
+
/// / `.watchtowerSensitive` modifier. Frames are stored in window (screen) space
|
|
6
|
+
/// and resolved at touch / capture time.
|
|
7
|
+
final class TaggedRegion {
|
|
8
|
+
let id: String? // watchtowerTag element id
|
|
9
|
+
let screenName: String? // watchtowerScreen identity
|
|
10
|
+
let sensitive: Bool
|
|
11
|
+
var frameInWindow: CGRect
|
|
12
|
+
weak var window: UIWindow?
|
|
13
|
+
|
|
14
|
+
init(id: String?, screenName: String?, sensitive: Bool, frameInWindow: CGRect, window: UIWindow?) {
|
|
15
|
+
self.id = id
|
|
16
|
+
self.screenName = screenName
|
|
17
|
+
self.sensitive = sensitive
|
|
18
|
+
self.frameInWindow = frameInWindow
|
|
19
|
+
self.window = window
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// Shared registry the swizzle consults to resolve SwiftUI element identity,
|
|
24
|
+
/// screen identity, and sensitive rects. Thread-confined to main (touches and
|
|
25
|
+
/// SwiftUI layout both run on main).
|
|
26
|
+
final class WatchtowerRegistry {
|
|
27
|
+
static let shared = WatchtowerRegistry()
|
|
28
|
+
|
|
29
|
+
private var regions: [ObjectIdentifier: TaggedRegion] = [:]
|
|
30
|
+
|
|
31
|
+
func update(token: ObjectIdentifier, region: TaggedRegion) {
|
|
32
|
+
regions[token] = region
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
func remove(token: ObjectIdentifier) {
|
|
36
|
+
regions.removeValue(forKey: token)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// Deepest (smallest-area) tag region containing `point` in the given window.
|
|
40
|
+
func tag(at point: CGPoint, in window: UIWindow) -> TaggedRegion? {
|
|
41
|
+
var best: TaggedRegion?
|
|
42
|
+
var bestArea = CGFloat.greatestFiniteMagnitude
|
|
43
|
+
for r in regions.values where r.id != nil {
|
|
44
|
+
guard r.window === window else { continue }
|
|
45
|
+
if r.frameInWindow.contains(point) {
|
|
46
|
+
let area = r.frameInWindow.width * r.frameInWindow.height
|
|
47
|
+
if area < bestArea { bestArea = area; best = r }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return best
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// Nearest enclosing screen-name region for a point.
|
|
54
|
+
func screenName(at point: CGPoint, in window: UIWindow) -> String? {
|
|
55
|
+
var best: TaggedRegion?
|
|
56
|
+
var bestArea = CGFloat.greatestFiniteMagnitude
|
|
57
|
+
for r in regions.values where r.screenName != nil {
|
|
58
|
+
guard r.window === window else { continue }
|
|
59
|
+
if r.frameInWindow.contains(point) {
|
|
60
|
+
let area = r.frameInWindow.width * r.frameInWindow.height
|
|
61
|
+
if area < bestArea { bestArea = area; best = r }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return best?.screenName
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Most recently laid-out screen-name region in this window (for capture
|
|
68
|
+
/// when no specific point is relevant).
|
|
69
|
+
func topScreenName(in window: UIWindow) -> String? {
|
|
70
|
+
var best: TaggedRegion?
|
|
71
|
+
var bestArea: CGFloat = -1
|
|
72
|
+
for r in regions.values where r.screenName != nil {
|
|
73
|
+
guard r.window === window else { continue }
|
|
74
|
+
let area = r.frameInWindow.width * r.frameInWindow.height
|
|
75
|
+
if area > bestArea { bestArea = area; best = r }
|
|
76
|
+
}
|
|
77
|
+
return best?.screenName
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// All sensitive rects in window space for the given window.
|
|
81
|
+
func sensitiveRects(in window: UIWindow) -> [CGRect] {
|
|
82
|
+
regions.values
|
|
83
|
+
.filter { $0.sensitive && $0.window === window }
|
|
84
|
+
.map { $0.frameInWindow }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
#endif
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sitepong",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Official SitePong SDK for error tracking and monitoring",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,7 +53,10 @@
|
|
|
53
53
|
"types": "./dist/nextjs/index.d.ts",
|
|
54
54
|
"import": "./dist/nextjs/index.mjs",
|
|
55
55
|
"require": "./dist/nextjs/index.js"
|
|
56
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
58
|
+
"./expo-module.config.json": "./expo-module.config.json",
|
|
59
|
+
"./package.json": "./package.json"
|
|
57
60
|
},
|
|
58
61
|
"typesVersions": {
|
|
59
62
|
"*": {
|
|
@@ -81,7 +84,11 @@
|
|
|
81
84
|
}
|
|
82
85
|
},
|
|
83
86
|
"files": [
|
|
84
|
-
"dist"
|
|
87
|
+
"dist",
|
|
88
|
+
"ios",
|
|
89
|
+
"android",
|
|
90
|
+
"expo-module.config.json",
|
|
91
|
+
"app.plugin.js"
|
|
85
92
|
],
|
|
86
93
|
"scripts": {
|
|
87
94
|
"build": "rm -rf dist && tsup",
|
|
@@ -114,10 +121,10 @@
|
|
|
114
121
|
"react-native": ">=0.70.0",
|
|
115
122
|
"@react-native-async-storage/async-storage": ">=1.0.0",
|
|
116
123
|
"@react-navigation/native": ">=6.0.0",
|
|
124
|
+
"expo": ">=51.0.0",
|
|
125
|
+
"expo-modules-core": ">=1.11.0",
|
|
117
126
|
"expo-device": ">=5.0.0",
|
|
118
127
|
"expo-application": ">=5.0.0",
|
|
119
|
-
"@sitepong/device-id": ">=0.1.0",
|
|
120
|
-
"@sitepong/screen-recorder": ">=0.1.0",
|
|
121
128
|
"expo-sqlite": ">=14.0.0"
|
|
122
129
|
},
|
|
123
130
|
"peerDependenciesMeta": {
|
|
@@ -130,16 +137,16 @@
|
|
|
130
137
|
"@react-navigation/native": {
|
|
131
138
|
"optional": true
|
|
132
139
|
},
|
|
133
|
-
"expo
|
|
140
|
+
"expo": {
|
|
134
141
|
"optional": true
|
|
135
142
|
},
|
|
136
|
-
"expo-
|
|
143
|
+
"expo-modules-core": {
|
|
137
144
|
"optional": true
|
|
138
145
|
},
|
|
139
|
-
"
|
|
146
|
+
"expo-device": {
|
|
140
147
|
"optional": true
|
|
141
148
|
},
|
|
142
|
-
"
|
|
149
|
+
"expo-application": {
|
|
143
150
|
"optional": true
|
|
144
151
|
},
|
|
145
152
|
"expo-sqlite": {
|
|
@@ -164,7 +171,7 @@
|
|
|
164
171
|
"react-native": "0.83.2",
|
|
165
172
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
166
173
|
"expo-sqlite": "~16.0.4",
|
|
167
|
-
"
|
|
174
|
+
"expo-modules-core": "~3.0.0",
|
|
168
175
|
"@sitepong/capture-core": "*"
|
|
169
176
|
},
|
|
170
177
|
"engines": {
|