@openreplay/tracker 15.0.8-beta.0 → 15.1.1
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/dist/cjs/entry.js +9839 -0
- package/dist/cjs/entry.js.map +1 -0
- package/dist/cjs/index.js +8 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/main/entry.d.ts +5 -0
- package/dist/cjs/main/index.d.ts +3 -3
- package/dist/cjs/main/singleton.d.ts +108 -0
- package/dist/lib/entry.js +9832 -0
- package/dist/lib/entry.js.map +1 -0
- package/dist/lib/index.js +8 -9
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/main/entry.d.ts +5 -0
- package/dist/lib/main/index.d.ts +3 -3
- package/dist/lib/main/singleton.d.ts +108 -0
- package/package.json +12 -8
- package/dist/types/common/interaction.d.ts +0 -37
- package/dist/types/common/messages.gen.d.ts +0 -567
- package/dist/types/main/app/canvas.d.ts +0 -28
- package/dist/types/main/app/guards.d.ts +0 -23
- package/dist/types/main/app/index.d.ts +0 -322
- package/dist/types/main/app/logger.d.ts +0 -17
- package/dist/types/main/app/messages.gen.d.ts +0 -81
- package/dist/types/main/app/nodes/index.d.ts +0 -31
- package/dist/types/main/app/nodes/maintainer.d.ts +0 -28
- package/dist/types/main/app/observer/iframe_observer.d.ts +0 -6
- package/dist/types/main/app/observer/iframe_offsets.d.ts +0 -8
- package/dist/types/main/app/observer/observer.d.ts +0 -33
- package/dist/types/main/app/observer/shadow_root_observer.d.ts +0 -4
- package/dist/types/main/app/observer/top_observer.d.ts +0 -32
- package/dist/types/main/app/sanitizer.d.ts +0 -48
- package/dist/types/main/app/session.d.ts +0 -57
- package/dist/types/main/app/ticker.d.ts +0 -18
- package/dist/types/main/index.d.ts +0 -111
- package/dist/types/main/modules/attributeSender.d.ts +0 -23
- package/dist/types/main/modules/axiosSpy.d.ts +0 -54
- package/dist/types/main/modules/conditionsManager.d.ts +0 -84
- package/dist/types/main/modules/connection.d.ts +0 -2
- package/dist/types/main/modules/console.d.ts +0 -6
- package/dist/types/main/modules/constructedStyleSheets.d.ts +0 -4
- package/dist/types/main/modules/cssrules.d.ts +0 -2
- package/dist/types/main/modules/exception.d.ts +0 -16
- package/dist/types/main/modules/featureFlags.d.ts +0 -25
- package/dist/types/main/modules/focus.d.ts +0 -2
- package/dist/types/main/modules/fonts.d.ts +0 -2
- package/dist/types/main/modules/img.d.ts +0 -2
- package/dist/types/main/modules/input.d.ts +0 -34
- package/dist/types/main/modules/mouse.d.ts +0 -31
- package/dist/types/main/modules/network.d.ts +0 -32
- package/dist/types/main/modules/performance.d.ts +0 -7
- package/dist/types/main/modules/scroll.d.ts +0 -2
- package/dist/types/main/modules/selection.d.ts +0 -7
- package/dist/types/main/modules/tabs.d.ts +0 -2
- package/dist/types/main/modules/tagWatcher.d.ts +0 -25
- package/dist/types/main/modules/timing.d.ts +0 -8
- package/dist/types/main/modules/userTesting/SignalManager.d.ts +0 -29
- package/dist/types/main/modules/userTesting/dnd.d.ts +0 -1
- package/dist/types/main/modules/userTesting/index.d.ts +0 -45
- package/dist/types/main/modules/userTesting/recorder.d.ts +0 -24
- package/dist/types/main/modules/userTesting/styles.d.ts +0 -277
- package/dist/types/main/modules/userTesting/utils.d.ts +0 -9
- package/dist/types/main/modules/viewport.d.ts +0 -2
- package/dist/types/main/utils.d.ts +0 -30
package/dist/lib/index.js
CHANGED
|
@@ -721,12 +721,13 @@ class StringDictionary {
|
|
|
721
721
|
this.backDict = {};
|
|
722
722
|
this.getKey = (str) => {
|
|
723
723
|
let isNew = false;
|
|
724
|
-
|
|
724
|
+
const safeKey = `__${str}`;
|
|
725
|
+
if (!this.backDict[safeKey]) {
|
|
725
726
|
isNew = true;
|
|
726
|
-
this.backDict[
|
|
727
|
+
this.backDict[safeKey] = `${this.getPageNo() ?? 0}_${this.idx}`;
|
|
727
728
|
this.idx += 1;
|
|
728
729
|
}
|
|
729
|
-
return [this.backDict[
|
|
730
|
+
return [this.backDict[safeKey], isNew];
|
|
730
731
|
};
|
|
731
732
|
}
|
|
732
733
|
}
|
|
@@ -2561,9 +2562,7 @@ const spinnerStyles = {
|
|
|
2561
2562
|
};
|
|
2562
2563
|
|
|
2563
2564
|
const Quality = {
|
|
2564
|
-
Standard: { width: 1280, height: 720 }
|
|
2565
|
-
High: { width: 1920, height: 1080 },
|
|
2566
|
-
};
|
|
2565
|
+
Standard: { width: 1280, height: 720 }};
|
|
2567
2566
|
class Recorder {
|
|
2568
2567
|
constructor(app) {
|
|
2569
2568
|
this.app = app;
|
|
@@ -4734,7 +4733,7 @@ class App {
|
|
|
4734
4733
|
this.stopCallbacks = [];
|
|
4735
4734
|
this.commitCallbacks = [];
|
|
4736
4735
|
this.activityState = ActivityState.NotActive;
|
|
4737
|
-
this.version = '15.
|
|
4736
|
+
this.version = '15.1.1'; // TODO: version compatability check inside each plugin.
|
|
4738
4737
|
this.socketMode = false;
|
|
4739
4738
|
this.compressionThreshold = 24 * 1000;
|
|
4740
4739
|
this.bc = null;
|
|
@@ -7253,7 +7252,7 @@ function roundNumber(num) {
|
|
|
7253
7252
|
return Math.round(num * 1e4);
|
|
7254
7253
|
}
|
|
7255
7254
|
|
|
7256
|
-
var e,o=-1,a=function(e){addEventListener("pageshow",(function(n){n.persisted&&(o=n.timeStamp,e(n));})
|
|
7255
|
+
var e,o=-1,a=function(e){addEventListener("pageshow",(function(n){n.persisted&&(o=n.timeStamp,e(n));}),true);},c=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),r="navigate";o>=0?r="back-forward-cache":t&&(document.prerendering||u()>0?r="prerender":document.wasDiscarded?r="restore":t.type&&(r=t.type.replace(/_/g,"-")));return {name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries());}));}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},d=function(e,n,t,r){var i,o;return function(a){n.value>=0&&(a||r)&&((o=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n));}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}));},p=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e();}));},v=function(e){var n=false;return function(){n||(e(),n=true);}},m=-1,h=function(){return "hidden"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){"hidden"===document.visibilityState&&m>-1&&(m="visibilitychange"===e.type?e.timeStamp:0,T());},y=function(){addEventListener("visibilitychange",g,true),addEventListener("prerenderingchange",g,true);},T=function(){removeEventListener("visibilitychange",g,true),removeEventListener("prerenderingchange",g,true);},E=function(){return m<0&&(m=h(),y(),a((function(){setTimeout((function(){m=h(),y();}),0);}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),true):e();},b=[1800,3e3],S=function(e,n){n=n||{},C((function(){var t,r=E(),i=f("FCP"),o=s("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries.push(e),t(true)));}));}));o&&(t=d(e,i,b,n.reportAllChanges),a((function(r){i=f("FCP"),t=d(e,i,b,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,t(true);}));})));}));},L=[.1,.25],w=function(e,n){n=n||{},S(v((function(){var t,r=f("CLS",0),i=0,o=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e]);}})),i>r.value&&(r.value=i,r.entries=o,t());},u=s("layout-shift",c);u&&(t=d(e,r,L,n.reportAllChanges),p((function(){c(u.takeRecords()),t(true);})),a((function(){i=0,r=f("CLS",0),t=d(e,r,L,n.reportAllChanges),l((function(){return t()}));})),setTimeout(t,0));})));},A=0,I=1/0,P=0,M=function(e){e.forEach((function(e){e.interactionId&&(I=Math.min(I,e.interactionId),P=Math.max(P,e.interactionId),A=P?(P-I)/7+1:0);}));},k=function(){return e?A:performance.interactionCount||0},F=function(){"interactionCount"in performance||e||(e=s("event",M,{type:"event",buffered:true,durationThreshold:0}));},D=[],x=new Map,R=0,B=function(){var e=Math.min(D.length-1,Math.floor((k()-R)/50));return D[e]},H=[],q=function(e){if(H.forEach((function(n){return n(e)})),e.interactionId||"first-input"===e.entryType){var n=D[D.length-1],t=x.get(e.interactionId);if(t||D.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else {var r={id:e.interactionId,latency:e.duration,entries:[e]};x.set(r.id,r),D.push(r);}D.sort((function(e,n){return n.latency-e.latency})),D.length>10&&D.splice(10).forEach((function(e){return x.delete(e.id)}));}}},O=function(e){var n=self.requestIdleCallback||self.setTimeout,t=-1;return e=v(e),"hidden"===document.visibilityState?e():(t=n(e),p(e)),t},N=[200,500],j=function(e,n){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(n=n||{},C((function(){var t;F();var r,i=f("INP"),o=function(e){O((function(){e.forEach(q);var n=B();n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r());}));},c=s("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=d(e,i,N,n.reportAllChanges),c&&(c.observe({type:"first-input",buffered:true}),p((function(){o(c.takeRecords()),r(true);})),a((function(){R=k(),D.length=0,x.clear(),i=f("INP"),r=d(e,i,N,n.reportAllChanges);})));})));},_=[2500,4e3],z={},G=function(e,n){n=n||{},C((function(){var t,r=E(),i=f("LCP"),o=function(e){n.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries=[e],t());}));},c=s("largest-contentful-paint",o);if(c){t=d(e,i,_,n.reportAllChanges);var m=v((function(){z[i.id]||(o(c.takeRecords()),c.disconnect(),z[i.id]=true,t(true));}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return O(m)}),{once:true,capture:true});})),p(m),a((function(r){i=f("LCP"),t=d(e,i,_,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,z[i.id]=true,t(true);}));}));}}));},J=[800,1800],K=function e(n){document.prerendering?C((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),true):setTimeout(n,0);},Q=function(e,n){n=n||{};var t=f("TTFB"),r=d(e,t,J,n.reportAllChanges);K((function(){var i=c();i&&(t.value=Math.max(i.responseStart-u(),0),t.entries=[i],r(true),a((function(){t=f("TTFB",0),(r=d(e,t,J,n.reportAllChanges))(true);})));}));};
|
|
7257
7256
|
|
|
7258
7257
|
function getPaintBlocks(resources) {
|
|
7259
7258
|
const paintBlocks = [];
|
|
@@ -9197,7 +9196,7 @@ class API {
|
|
|
9197
9196
|
this.signalStartIssue = (reason, missingApi) => {
|
|
9198
9197
|
const doNotTrack = this.checkDoNotTrack();
|
|
9199
9198
|
console.log("Tracker couldn't start due to:", JSON.stringify({
|
|
9200
|
-
trackerVersion: '15.
|
|
9199
|
+
trackerVersion: '15.1.1',
|
|
9201
9200
|
projectKey: this.options.projectKey,
|
|
9202
9201
|
doNotTrack,
|
|
9203
9202
|
reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
|