@insitue/sdk 0.1.13 → 0.1.14
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/capture-only.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
setCaptureSettings,
|
|
12
12
|
stopDisplayMedia,
|
|
13
13
|
y
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HECY6THB.js";
|
|
15
15
|
|
|
16
16
|
// src/capture-only.ts
|
|
17
17
|
var DEFAULT_INGEST = "https://www.insitue.com/api/v1/capture";
|
|
@@ -362,8 +362,8 @@ function CaptureOnlyApp(props) {
|
|
|
362
362
|
k("span", {}, ""),
|
|
363
363
|
k(
|
|
364
364
|
"span",
|
|
365
|
-
{ title: `@insitue/sdk@${"0.1.
|
|
366
|
-
`InSitue \xB7 v${"0.1.
|
|
365
|
+
{ title: `@insitue/sdk@${"0.1.14"}` },
|
|
366
|
+
`InSitue \xB7 v${"0.1.14"}`
|
|
367
367
|
)
|
|
368
368
|
]
|
|
369
369
|
)
|
|
@@ -1671,7 +1671,7 @@ async function renderViewportCrop(cropRect, pixelRatio) {
|
|
|
1671
1671
|
out.width = Math.max(1, Math.round(cropRect.width * pixelRatio));
|
|
1672
1672
|
out.height = Math.max(1, Math.round(cropRect.height * pixelRatio));
|
|
1673
1673
|
const ctx = out.getContext("2d");
|
|
1674
|
-
if (!ctx) return { dataUrl: null, failedImages };
|
|
1674
|
+
if (!ctx) return { dataUrl: null, looksBlank: false, failedImages };
|
|
1675
1675
|
const fullCanvas = await toCanvas(document.documentElement, {
|
|
1676
1676
|
pixelRatio,
|
|
1677
1677
|
cacheBust: true,
|
|
@@ -1699,11 +1699,9 @@ async function renderViewportCrop(cropRect, pixelRatio) {
|
|
|
1699
1699
|
failedImages
|
|
1700
1700
|
);
|
|
1701
1701
|
void drawnImgs;
|
|
1702
|
-
|
|
1703
|
-
return { dataUrl: null, failedImages };
|
|
1704
|
-
}
|
|
1702
|
+
const looksBlank = looksBlankUniform(ctx, out.width, out.height);
|
|
1705
1703
|
detectUnrenderedImages(ctx, cropRect, out, pixelRatio, failedImages);
|
|
1706
|
-
return { dataUrl: out.toDataURL("image/png"), failedImages };
|
|
1704
|
+
return { dataUrl: out.toDataURL("image/png"), looksBlank, failedImages };
|
|
1707
1705
|
}
|
|
1708
1706
|
async function drawAbsoluteImagesOnto(ctx, cropRect, pixelRatio, failedImages) {
|
|
1709
1707
|
const drawn = /* @__PURE__ */ new Set();
|
|
@@ -2133,13 +2131,15 @@ async function buildBundle(sel) {
|
|
|
2133
2131
|
try {
|
|
2134
2132
|
const skipLayer1 = settings.alwaysPixelPerfect;
|
|
2135
2133
|
let layer1Result = null;
|
|
2134
|
+
let layer1LooksBlank = false;
|
|
2136
2135
|
let quality = null;
|
|
2137
2136
|
if (!skipLayer1) {
|
|
2138
2137
|
const r3 = await renderViewportCrop(cropRect, Math.min(dpr, 1.5));
|
|
2139
2138
|
layer1Result = r3.dataUrl;
|
|
2139
|
+
layer1LooksBlank = r3.looksBlank;
|
|
2140
2140
|
quality = assessCaptureQuality(cropRect, r3.failedImages);
|
|
2141
2141
|
}
|
|
2142
|
-
const imperfect = !layer1Result || quality != null && (quality.unembeddableImages > 0 || quality.hasVideo || quality.hasCanvas);
|
|
2142
|
+
const imperfect = !layer1Result || layer1LooksBlank || quality != null && (quality.unembeddableImages > 0 || quality.hasVideo || quality.hasCanvas);
|
|
2143
2143
|
const allowLayer2 = !settings.disableLayer2;
|
|
2144
2144
|
if ((imperfect || skipLayer1) && allowLayer2) {
|
|
2145
2145
|
const grab = await tryGrabViaDisplayMedia(
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountCaptureOnly
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7EQRP6O4.js";
|
|
4
4
|
import {
|
|
5
5
|
mountInSitue
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QTG3I7DC.js";
|
|
7
|
+
import "./chunk-HECY6THB.js";
|
|
8
8
|
|
|
9
9
|
// src/InSitue.tsx
|
|
10
10
|
import { useEffect } from "react";
|
|
@@ -52,7 +52,7 @@ function InSitueCapture({
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// src/index.ts
|
|
55
|
-
var SDK_VERSION = "0.1.
|
|
55
|
+
var SDK_VERSION = "0.1.14";
|
|
56
56
|
export {
|
|
57
57
|
InSitue,
|
|
58
58
|
InSitueCapture,
|
package/dist/overlay.js
CHANGED
package/package.json
CHANGED