@merittdev/horus-lens 0.5.0 → 0.5.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/browser.cjs +20 -16
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/{chunk-2G5FEWPU.js → chunk-GVULQ2IF.js} +21 -17
- package/dist/{chunk-2G5FEWPU.js.map → chunk-GVULQ2IF.js.map} +1 -1
- package/dist/{chunk-M3QMIY4Y.js → chunk-MN44USB4.js} +2 -2
- package/dist/index.cjs +20 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lens.min.js +2 -2
- package/dist/react.cjs +20 -16
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-M3QMIY4Y.js.map → chunk-MN44USB4.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LENS_OVERLAY_HOST_ID,
|
|
3
3
|
LensClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GVULQ2IF.js";
|
|
5
5
|
|
|
6
6
|
// ../browser/dist/index.js
|
|
7
7
|
var DEFAULT_PARAM_NAME = "lens";
|
|
@@ -2724,4 +2724,4 @@ export {
|
|
|
2724
2724
|
boot,
|
|
2725
2725
|
autoBoot
|
|
2726
2726
|
};
|
|
2727
|
-
//# sourceMappingURL=chunk-
|
|
2727
|
+
//# sourceMappingURL=chunk-MN44USB4.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -29111,7 +29111,7 @@ async function domToBlob(node2, options) {
|
|
|
29111
29111
|
|
|
29112
29112
|
// ../core/dist/index.js
|
|
29113
29113
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
29114
|
-
var SDK_VERSION = true ? "0.5.
|
|
29114
|
+
var SDK_VERSION = true ? "0.5.1" : "0.0.0-dev";
|
|
29115
29115
|
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
29116
29116
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
29117
29117
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
|
@@ -29692,8 +29692,11 @@ function computeCropRect(crop, scale, rasterWidth, rasterHeight) {
|
|
|
29692
29692
|
async function captureScreenshot(excludeHost, crop, composite) {
|
|
29693
29693
|
if (typeof document === "undefined" || typeof window === "undefined") return null;
|
|
29694
29694
|
try {
|
|
29695
|
-
const
|
|
29696
|
-
const
|
|
29695
|
+
const viewportOnly = !composite && !crop;
|
|
29696
|
+
const captureW = composite ? composite.docWidth : window.innerWidth;
|
|
29697
|
+
const captureH = composite ? composite.docHeight : window.innerHeight;
|
|
29698
|
+
const capturePixels = captureW * captureH || 1;
|
|
29699
|
+
const pixelCap = Math.sqrt(SCREENSHOT_MAX_PIXELS / capturePixels);
|
|
29697
29700
|
const scale = Math.max(1, Math.min(window.devicePixelRatio || 1, SCREENSHOT_MAX_SCALE, pixelCap));
|
|
29698
29701
|
const capture = domToBlob(document.documentElement, {
|
|
29699
29702
|
scale,
|
|
@@ -29702,12 +29705,19 @@ async function captureScreenshot(excludeHost, crop, composite) {
|
|
|
29702
29705
|
// JPEG has no alpha — transparent page regions (and any capture box
|
|
29703
29706
|
// extending past short content) would otherwise encode as BLACK.
|
|
29704
29707
|
backgroundColor: "#ffffff",
|
|
29705
|
-
//
|
|
29706
|
-
//
|
|
29707
|
-
// sizes from documentElement's bounding box, which on pages SHORTER than
|
|
29708
|
-
// the viewport is the content height only — marks drawn in the lower
|
|
29709
|
-
// viewport band would fall off the raster and the crop would clamp short.
|
|
29708
|
+
// Composite (annotations): force the capture box to the editor's document
|
|
29709
|
+
// measurement so marks in the lower viewport band aren't clipped.
|
|
29710
29710
|
...composite ? { width: composite.docWidth, height: composite.docHeight } : {},
|
|
29711
|
+
// Plain report: clip the render to the viewport and shift the scrolled
|
|
29712
|
+
// content into it, so only the visible region is rasterized/fetched.
|
|
29713
|
+
...viewportOnly ? {
|
|
29714
|
+
width: window.innerWidth,
|
|
29715
|
+
height: window.innerHeight,
|
|
29716
|
+
style: {
|
|
29717
|
+
transform: `translate(${-window.scrollX}px, ${-window.scrollY}px)`,
|
|
29718
|
+
transformOrigin: "top left"
|
|
29719
|
+
}
|
|
29720
|
+
} : {},
|
|
29711
29721
|
// Exclude the overlay from the capture CLONE — never hide the live node.
|
|
29712
29722
|
filter: (node2) => node2 !== excludeHost,
|
|
29713
29723
|
// Per-resource fetch budget: a single slow cross-origin image must not
|
|
@@ -29742,14 +29752,8 @@ async function captureScreenshot(excludeHost, crop, composite) {
|
|
|
29742
29752
|
return null;
|
|
29743
29753
|
}
|
|
29744
29754
|
}
|
|
29745
|
-
|
|
29746
|
-
|
|
29747
|
-
y: window.scrollY,
|
|
29748
|
-
width: window.innerWidth,
|
|
29749
|
-
height: window.innerHeight
|
|
29750
|
-
});
|
|
29751
|
-
if (effectiveCrop) {
|
|
29752
|
-
const cropped = await cropBlob(blob2, effectiveCrop, scale);
|
|
29755
|
+
if (crop) {
|
|
29756
|
+
const cropped = await cropBlob(blob2, crop, scale);
|
|
29753
29757
|
return cropped ?? blob2;
|
|
29754
29758
|
}
|
|
29755
29759
|
return blob2;
|