@goliapkg/sentori-react-native 5.3.0 → 5.4.0
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/src/main/java/com/sentori/SentoriScreenshotCapture.kt +12 -2
- package/ios/SentoriModule.swift +1 -1
- package/ios/SentoriScreenshotCapture.swift +12 -4
- package/lib/native.d.ts +2 -0
- package/lib/native.d.ts.map +1 -1
- package/lib/replay-screens.d.ts.map +1 -1
- package/lib/replay-screens.js +3 -0
- package/lib/replay-screens.js.map +1 -1
- package/lib/transport.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/replay-screens.test.ts +10 -2
- package/src/native.ts +2 -2
- package/src/replay-screens.ts +13 -1
- package/src/transport.ts +1 -1
|
@@ -156,14 +156,24 @@ object SentoriScreenshotCapture {
|
|
|
156
156
|
maskedIds: List<String>,
|
|
157
157
|
longEdgePx: Double,
|
|
158
158
|
quality: Double,
|
|
159
|
-
): Map<String,
|
|
159
|
+
): Map<String, Any>? {
|
|
160
160
|
val activity = SentoriForegroundActivity.current() ?: return null
|
|
161
161
|
val window = activity.window ?: return null
|
|
162
162
|
val pct = (quality * 100).toInt().coerceIn(1, 100)
|
|
163
163
|
val (base64, mediaType) =
|
|
164
164
|
captureScreen(window, maskedIds.toHashSet(), longEdgePx.toFloat(), pct)
|
|
165
165
|
?: return null
|
|
166
|
-
|
|
166
|
+
// v5.4 — the window's logical size (dp), the same space RN's
|
|
167
|
+
// pageX/pageY taps live in: the dashboard maps tap
|
|
168
|
+
// coordinates onto the scaled-down JPEG with it.
|
|
169
|
+
val density = activity.resources.displayMetrics.density
|
|
170
|
+
val view = window.decorView
|
|
171
|
+
return mapOf(
|
|
172
|
+
"base64" to base64,
|
|
173
|
+
"mediaType" to mediaType,
|
|
174
|
+
"w" to (view.width / density).toDouble(),
|
|
175
|
+
"h" to (view.height / density).toDouble(),
|
|
176
|
+
)
|
|
167
177
|
}
|
|
168
178
|
|
|
169
179
|
// ── screenshot ────────────────────────────────────────────────
|
package/ios/SentoriModule.swift
CHANGED
|
@@ -81,7 +81,7 @@ public class SentoriModule: Module {
|
|
|
81
81
|
// quality come from JS so the frame budget is tunable without
|
|
82
82
|
// a native release.
|
|
83
83
|
AsyncFunction("captureReplayFrame") {
|
|
84
|
-
(maskedIds: [String], longEdgePx: Double, quality: Double) -> [String:
|
|
84
|
+
(maskedIds: [String], longEdgePx: Double, quality: Double) -> [String: Any]? in
|
|
85
85
|
return SentoriScreenshotCapture.captureReplayFrame(
|
|
86
86
|
maskedIds: maskedIds,
|
|
87
87
|
longEdgePx: longEdgePx,
|
|
@@ -89,8 +89,8 @@ import UIKit
|
|
|
89
89
|
maskedIds: [String],
|
|
90
90
|
longEdgePx: Double,
|
|
91
91
|
quality: Double
|
|
92
|
-
) -> [String:
|
|
93
|
-
let run: () -> [String:
|
|
92
|
+
) -> [String: Any]? {
|
|
93
|
+
let run: () -> [String: Any]? = {
|
|
94
94
|
guard let window = keyWindowDiag().window else { return nil }
|
|
95
95
|
guard
|
|
96
96
|
let jpeg = renderJpegBase64(
|
|
@@ -100,12 +100,20 @@ import UIKit
|
|
|
100
100
|
quality: CGFloat(quality)
|
|
101
101
|
)
|
|
102
102
|
else { return nil }
|
|
103
|
-
|
|
103
|
+
// v5.4 — the window's logical size (pt), the same space
|
|
104
|
+
// RN's pageX/pageY taps live in: the dashboard maps tap
|
|
105
|
+
// coordinates onto the scaled-down JPEG with it.
|
|
106
|
+
return [
|
|
107
|
+
"base64": jpeg,
|
|
108
|
+
"mediaType": "image/jpeg",
|
|
109
|
+
"w": Double(window.bounds.width),
|
|
110
|
+
"h": Double(window.bounds.height),
|
|
111
|
+
]
|
|
104
112
|
}
|
|
105
113
|
if Thread.isMainThread {
|
|
106
114
|
return run()
|
|
107
115
|
}
|
|
108
|
-
var result: [String:
|
|
116
|
+
var result: [String: Any]?
|
|
109
117
|
DispatchQueue.main.sync { result = run() }
|
|
110
118
|
return result
|
|
111
119
|
}
|
package/lib/native.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export declare function getRecentNativeException(): null | {
|
|
|
77
77
|
export declare function captureNativeReplayFrame(maskedIds: string[], longEdgePx: number, quality: number): Promise<null | {
|
|
78
78
|
base64: string;
|
|
79
79
|
mediaType: string;
|
|
80
|
+
w?: number;
|
|
81
|
+
h?: number;
|
|
80
82
|
}>;
|
|
81
83
|
export declare function captureNativeScreenshotWithMask(maskedIds: string[]): Promise<null | {
|
|
82
84
|
base64: string;
|
package/lib/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkMH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,IAAI,CAMP;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAQ5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAMzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAMP;AAID;gEACgE;AAChE,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAQ5D;AAED;yCACyC;AACzC,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAQpE;AAED,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED,wBAAgB,cAAc,IAAI,IAAI,CAMrC;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,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AM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B,CA+CA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,IAAI;IACvC,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B,CAeA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay-screens.d.ts","sourceRoot":"","sources":["../src/replay-screens.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,KAAK,SAAS,GAAG,OAAO,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"replay-screens.d.ts","sourceRoot":"","sources":["../src/replay-screens.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,KAAK,SAAS,GAAG,OAAO,wBAAwB,CAAC;AA6BjD;mCACmC;AACnC,eAAO,MAAM,iBAAiB,kBAAmB,MAAM,KAAG,IAOzD,CAAC;AAkBF;;;;4BAI4B;AAC5B,eAAO,MAAM,iBAAiB,QAAO,IAAI,GAAG,MAe3C,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,IAOlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,OAAQ,SAAS,KAAG,IAEpD,CAAC"}
|
package/lib/replay-screens.js
CHANGED
|
@@ -68,6 +68,9 @@ export const drainScreenReplay = () => {
|
|
|
68
68
|
.map((f) => JSON.stringify({
|
|
69
69
|
t: Number(((f.t - now) / 1000).toFixed(1)),
|
|
70
70
|
mediaType: f.mediaType,
|
|
71
|
+
...(typeof f.w === 'number' && typeof f.h === 'number'
|
|
72
|
+
? { w: f.w, h: f.h }
|
|
73
|
+
: {}),
|
|
71
74
|
base64: f.base64,
|
|
72
75
|
}))
|
|
73
76
|
.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay-screens.js","sourceRoot":"","sources":["../src/replay-screens.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,+DAA+D;AAC/D,iEAAiE;AACjE,6DAA6D;AAC7D,gEAAgE;AAChE,6DAA6D;AAC7D,mDAAmD;AACnD,EAAE;AACF,kEAAkE;AAClE,gEAAgE;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD,IAAI,QAAQ,GAAc,wBAAwB,CAAC;AAEnD;oDACoD;AACpD,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B;;wCAEwC;AACxC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,2CAA2C;AAC3C,MAAM,aAAa,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"replay-screens.js","sourceRoot":"","sources":["../src/replay-screens.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,+DAA+D;AAC/D,iEAAiE;AACjE,6DAA6D;AAC7D,gEAAgE;AAChE,6DAA6D;AAC7D,mDAAmD;AACnD,EAAE;AACF,kEAAkE;AAClE,gEAAgE;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD,IAAI,QAAQ,GAAc,wBAAwB,CAAC;AAEnD;oDACoD;AACpD,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B;;wCAEwC;AACxC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,2CAA2C;AAC3C,MAAM,aAAa,GAAG,IAAI,CAAC;AAa3B,IAAI,KAAK,GAAkB,EAAE,CAAC;AAC9B,IAAI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AGE_KEY = '@sentori/pending';
|
|
16
16
|
const MAX_PERSISTED = 1000;
|
|
17
17
|
// Pinned to package.json by a test — bump both together.
|
|
18
|
-
const SDK_VERSION = '5.
|
|
18
|
+
const SDK_VERSION = '5.4.0';
|
|
19
19
|
let _queue = [];
|
|
20
20
|
let _assertStats = new Map();
|
|
21
21
|
let _flushTimer = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/sentori-react-native",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Sentori SDK for React Native \u2014 JS-layer error capture, native crash handlers (iOS / Android), batched transport, fetch + react-navigation tracing.",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"author": "GOLIA K.K. <takagi@golia.jp> (https://golia.jp)",
|
|
@@ -42,8 +42,14 @@ describe('screens ring', () => {
|
|
|
42
42
|
|
|
43
43
|
test('drain emits NDJSON with negative relative timestamps', async () => {
|
|
44
44
|
let n = 0;
|
|
45
|
+
// native ≥ 5.4 carries the window's logical size with each frame
|
|
45
46
|
__setCaptureForTests(
|
|
46
|
-
mock(async () => ({
|
|
47
|
+
mock(async () => ({
|
|
48
|
+
base64: `frame${(n += 1)}`,
|
|
49
|
+
h: 852,
|
|
50
|
+
mediaType: 'image/jpeg',
|
|
51
|
+
w: 393,
|
|
52
|
+
})),
|
|
47
53
|
);
|
|
48
54
|
startScreenReplay(60);
|
|
49
55
|
await new Promise((r) => setTimeout(r, 2_600));
|
|
@@ -51,11 +57,13 @@ describe('screens ring', () => {
|
|
|
51
57
|
expect(out).not.toBeNull();
|
|
52
58
|
const lines = (out ?? '')
|
|
53
59
|
.split('\n')
|
|
54
|
-
.map((l) => JSON.parse(l) as { t: number; base64: string });
|
|
60
|
+
.map((l) => JSON.parse(l) as { t: number; base64: string; w?: number; h?: number });
|
|
55
61
|
expect(lines.length).toBeGreaterThanOrEqual(1);
|
|
56
62
|
for (const l of lines) {
|
|
57
63
|
expect(l.t).toBeLessThanOrEqual(0);
|
|
58
64
|
expect(l.base64.startsWith('frame')).toBe(true);
|
|
65
|
+
expect(l.w).toBe(393);
|
|
66
|
+
expect(l.h).toBe(852);
|
|
59
67
|
}
|
|
60
68
|
// drain does not clear: a second error still sees the window
|
|
61
69
|
expect(drainScreenReplay()).not.toBeNull();
|
package/src/native.ts
CHANGED
|
@@ -75,7 +75,7 @@ type SentoriNativeModule = {
|
|
|
75
75
|
maskedIds: string[],
|
|
76
76
|
longEdgePx: number,
|
|
77
77
|
quality: number,
|
|
78
|
-
) => Promise<null | { base64: string; mediaType: string }>
|
|
78
|
+
) => Promise<null | { base64: string; mediaType: string; w?: number; h?: number }>
|
|
79
79
|
/**
|
|
80
80
|
* v0.9.12 — diagnostic readout for the wireframe path. Cheap
|
|
81
81
|
* synchronous call that returns the path the last `captureWireframe`
|
|
@@ -402,7 +402,7 @@ export async function captureNativeReplayFrame(
|
|
|
402
402
|
maskedIds: string[],
|
|
403
403
|
longEdgePx: number,
|
|
404
404
|
quality: number,
|
|
405
|
-
): Promise<null | { base64: string; mediaType: string }> {
|
|
405
|
+
): Promise<null | { base64: string; mediaType: string; w?: number; h?: number }> {
|
|
406
406
|
const n = native()
|
|
407
407
|
if (!n) return null
|
|
408
408
|
if (!n.captureReplayFrame) {
|
package/src/replay-screens.ts
CHANGED
|
@@ -28,7 +28,16 @@ const FRAME_LONG_EDGE_PX = 360;
|
|
|
28
28
|
/** JPEG/WebP quality for replay frames. */
|
|
29
29
|
const FRAME_QUALITY = 0.35;
|
|
30
30
|
|
|
31
|
-
type ScreenFrame = {
|
|
31
|
+
type ScreenFrame = {
|
|
32
|
+
t: number;
|
|
33
|
+
base64: string;
|
|
34
|
+
mediaType: string;
|
|
35
|
+
/** Window logical size (pt/dp), same space as tap pageX/pageY —
|
|
36
|
+
* present from native ≥ 5.4; older binaries omit it and the
|
|
37
|
+
* dashboard simply draws no tap markers on pixels. */
|
|
38
|
+
w?: number;
|
|
39
|
+
h?: number;
|
|
40
|
+
};
|
|
32
41
|
|
|
33
42
|
let _ring: ScreenFrame[] = [];
|
|
34
43
|
let _capacity = 0;
|
|
@@ -75,6 +84,9 @@ export const drainScreenReplay = (): null | string => {
|
|
|
75
84
|
JSON.stringify({
|
|
76
85
|
t: Number(((f.t - now) / 1000).toFixed(1)),
|
|
77
86
|
mediaType: f.mediaType,
|
|
87
|
+
...(typeof f.w === 'number' && typeof f.h === 'number'
|
|
88
|
+
? { w: f.w, h: f.h }
|
|
89
|
+
: {}),
|
|
78
90
|
base64: f.base64,
|
|
79
91
|
}),
|
|
80
92
|
)
|
package/src/transport.ts
CHANGED
|
@@ -20,7 +20,7 @@ const STORAGE_KEY = '@sentori/pending';
|
|
|
20
20
|
const MAX_PERSISTED = 1000;
|
|
21
21
|
|
|
22
22
|
// Pinned to package.json by a test — bump both together.
|
|
23
|
-
const SDK_VERSION = '5.
|
|
23
|
+
const SDK_VERSION = '5.4.0';
|
|
24
24
|
|
|
25
25
|
let _queue: WireEvent[] = [];
|
|
26
26
|
let _assertStats = new Map<string, AssertStat>();
|