@sentry/replay 11.15.0 → 11.17.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/build/npm/cjs/index.js +15 -8
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +16 -9
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/coreHandlers/handleClick.d.ts.map +1 -1
- package/build/npm/types/integration.d.ts +3 -1
- package/build/npm/types/integration.d.ts.map +1 -1
- package/package.json +6 -6
package/build/npm/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _sentry_core = require("@sentry/core");
|
|
3
3
|
let _sentry_browser_utils = require("@sentry/browser-utils");
|
|
4
|
-
// ../../node_modules/.pnpm/@sentry+conventions@0.
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
// ../../node_modules/.pnpm/@sentry+conventions@0.35.0/node_modules/@sentry/conventions/dist/attributes.mjs
|
|
5
|
+
const Qb = "sentry.replay_id";
|
|
6
|
+
const og = "sentry.segment.name.source";
|
|
7
7
|
// src/constants.ts
|
|
8
8
|
const WINDOW = _sentry_core.GLOBAL_OBJ;
|
|
9
9
|
const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
@@ -3540,8 +3540,14 @@ var ClickDetector = class {
|
|
|
3540
3540
|
const cleanupWindowOpen = onWindowOpen(() => {
|
|
3541
3541
|
this._lastMutation = nowInSeconds();
|
|
3542
3542
|
});
|
|
3543
|
+
const onPageHide = () => {
|
|
3544
|
+
this._clicks = [];
|
|
3545
|
+
if (this._checkClickTimeout) clearTimeout(this._checkClickTimeout);
|
|
3546
|
+
};
|
|
3547
|
+
WINDOW.addEventListener("pagehide", onPageHide);
|
|
3543
3548
|
this._teardown = () => {
|
|
3544
3549
|
cleanupWindowOpen();
|
|
3550
|
+
WINDOW.removeEventListener("pagehide", onPageHide);
|
|
3545
3551
|
this._clicks = [];
|
|
3546
3552
|
this._lastMutation = 0;
|
|
3547
3553
|
this._lastScroll = 0;
|
|
@@ -6244,7 +6250,7 @@ var ReplayContainer = class {
|
|
|
6244
6250
|
const lastRootSpan = lastActiveSpan && (0, _sentry_core.getRootSpan)(lastActiveSpan);
|
|
6245
6251
|
if (!lastRootSpan) return;
|
|
6246
6252
|
const spanJson = (0, _sentry_core.spanToJSON)(lastRootSpan);
|
|
6247
|
-
const source = spanJson.attributes[
|
|
6253
|
+
const source = spanJson.attributes[og];
|
|
6248
6254
|
if (!source || !["route", "custom"].includes(source)) return;
|
|
6249
6255
|
return spanJson.name;
|
|
6250
6256
|
}
|
|
@@ -6634,6 +6640,9 @@ function _INTERNAL_instrumentRequestInterface() {
|
|
|
6634
6640
|
_isRequestInstrumented = true;
|
|
6635
6641
|
} catch {}
|
|
6636
6642
|
}
|
|
6643
|
+
const _replayIntegration = ((options) => {
|
|
6644
|
+
return new Replay(options);
|
|
6645
|
+
});
|
|
6637
6646
|
/**
|
|
6638
6647
|
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/).
|
|
6639
6648
|
*
|
|
@@ -6648,9 +6657,7 @@ function _INTERNAL_instrumentRequestInterface() {
|
|
|
6648
6657
|
* });
|
|
6649
6658
|
* ```
|
|
6650
6659
|
*/
|
|
6651
|
-
const replayIntegration = ((
|
|
6652
|
-
return new Replay(options);
|
|
6653
|
-
});
|
|
6660
|
+
const replayIntegration = (0, _sentry_core.defineIntegration)(_replayIntegration);
|
|
6654
6661
|
/**
|
|
6655
6662
|
* Replay integration
|
|
6656
6663
|
*/
|
|
@@ -6824,7 +6831,7 @@ var Replay = class {
|
|
|
6824
6831
|
processSpan(span) {
|
|
6825
6832
|
const replayId = this.getReplayId(true);
|
|
6826
6833
|
if (replayId) {
|
|
6827
|
-
(0, _sentry_core.safeSetSpanJSONAttributes)(span, { [
|
|
6834
|
+
(0, _sentry_core.safeSetSpanJSONAttributes)(span, { [Qb]: replayId });
|
|
6828
6835
|
if (this.getRecordingMode() === "buffer") (0, _sentry_core.safeSetSpanJSONAttributes)(span, { "sentry._internal.replay_is_buffering": true });
|
|
6829
6836
|
}
|
|
6830
6837
|
}
|