saltfish 0.3.73 → 0.3.74
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/player.js +2 -2
- package/dist/player.min.js +2 -2
- package/dist/saltfish-playlist-player.es.js +50 -16
- package/dist/saltfish-playlist-player.umd.js +1 -1
- package/dist/utils/domSnapshotCapture.d.ts +23 -0
- package/dist/utils/domSnapshotCapture.d.ts.map +1 -0
- package/dist/utils/elementErrorReporter.d.ts +7 -0
- package/dist/utils/elementErrorReporter.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7025,6 +7025,32 @@ function isElementValid(element, expectedElement, expectedSize, config = DEFAULT
|
|
|
7025
7025
|
}
|
|
7026
7026
|
return true;
|
|
7027
7027
|
}
|
|
7028
|
+
const RRWEB_SNAPSHOT_URL = "https://storage.saltfish.ai/libs/rrweb-snapshot-2.0.0-alpha.18.js";
|
|
7029
|
+
async function captureDOMSnapshot() {
|
|
7030
|
+
try {
|
|
7031
|
+
const rrwebSnapshot = await import(
|
|
7032
|
+
/* webpackIgnore: true */
|
|
7033
|
+
RRWEB_SNAPSHOT_URL
|
|
7034
|
+
);
|
|
7035
|
+
const domSnapshot = rrwebSnapshot.snapshot(document);
|
|
7036
|
+
return domSnapshot;
|
|
7037
|
+
} catch (error2) {
|
|
7038
|
+
console.warn("Failed to capture DOM snapshot:", error2);
|
|
7039
|
+
return null;
|
|
7040
|
+
}
|
|
7041
|
+
}
|
|
7042
|
+
async function captureDOMSnapshotAsString() {
|
|
7043
|
+
const snapshot = await captureDOMSnapshot();
|
|
7044
|
+
if (!snapshot) {
|
|
7045
|
+
return null;
|
|
7046
|
+
}
|
|
7047
|
+
try {
|
|
7048
|
+
return JSON.stringify(snapshot);
|
|
7049
|
+
} catch (error2) {
|
|
7050
|
+
console.warn("Failed to serialize DOM snapshot:", error2);
|
|
7051
|
+
return null;
|
|
7052
|
+
}
|
|
7053
|
+
}
|
|
7028
7054
|
const API_URL = "https://player.saltfish.ai/element-errors";
|
|
7029
7055
|
function determineFailureReason(selector, expectedElement, expectedSize) {
|
|
7030
7056
|
const elements = document.querySelectorAll(selector);
|
|
@@ -7047,21 +7073,29 @@ function determineFailureReason(selector, expectedElement, expectedSize) {
|
|
|
7047
7073
|
}
|
|
7048
7074
|
function reportElementError(playlistId, stepId, selector, expectedElement, expectedSize) {
|
|
7049
7075
|
const failureReason = determineFailureReason(selector, expectedElement, expectedSize);
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7076
|
+
(async () => {
|
|
7077
|
+
try {
|
|
7078
|
+
const payload = {
|
|
7079
|
+
playlistId,
|
|
7080
|
+
stepId,
|
|
7081
|
+
failureReason,
|
|
7082
|
+
selector
|
|
7083
|
+
};
|
|
7084
|
+
const domSnapshot = await captureDOMSnapshotAsString();
|
|
7085
|
+
if (domSnapshot) {
|
|
7086
|
+
payload.domSnapshot = domSnapshot;
|
|
7087
|
+
}
|
|
7088
|
+
await fetch(API_URL, {
|
|
7089
|
+
method: "POST",
|
|
7090
|
+
headers: {
|
|
7091
|
+
"Content-Type": "application/json"
|
|
7092
|
+
},
|
|
7093
|
+
body: JSON.stringify(payload)
|
|
7094
|
+
});
|
|
7095
|
+
} catch (error2) {
|
|
7096
|
+
console.warn("Failed to report element error:", error2);
|
|
7097
|
+
}
|
|
7098
|
+
})();
|
|
7065
7099
|
}
|
|
7066
7100
|
class CursorManager {
|
|
7067
7101
|
constructor() {
|
|
@@ -12709,7 +12743,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
12709
12743
|
__proto__: null,
|
|
12710
12744
|
SaltfishPlayer
|
|
12711
12745
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12712
|
-
const version = "0.3.
|
|
12746
|
+
const version = "0.3.74";
|
|
12713
12747
|
const packageJson = {
|
|
12714
12748
|
version
|
|
12715
12749
|
};
|