@insitue/sdk 0.4.2 → 0.4.4
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
|
@@ -535,7 +535,7 @@ function toLoc(workspaceCwdRelative) {
|
|
|
535
535
|
function fromAttribute(el) {
|
|
536
536
|
let cur = el;
|
|
537
537
|
for (let i3 = 0; cur && i3 < 8; i3++, cur = cur.parentElement) {
|
|
538
|
-
const raw = cur.getAttribute("data-insitue-source")
|
|
538
|
+
const raw = cur.getAttribute("data-insitue-source");
|
|
539
539
|
if (raw) {
|
|
540
540
|
const m3 = /^(.*):(\d+):(\d+)$/.exec(raw);
|
|
541
541
|
if (m3) return { file: m3[1], line: Number(m3[2]), column: Number(m3[3]) };
|
|
@@ -2106,14 +2106,30 @@ async function buildBundle(sel) {
|
|
|
2106
2106
|
let screenshot;
|
|
2107
2107
|
let screenshotUnavailable;
|
|
2108
2108
|
if (el instanceof HTMLElement || el instanceof SVGElement) {
|
|
2109
|
+
const pickedRect = el.getBoundingClientRect();
|
|
2109
2110
|
const context = findContextAncestor(el);
|
|
2110
|
-
const
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
Math.
|
|
2111
|
+
const ar = context.getBoundingClientRect();
|
|
2112
|
+
const MIN_W = 420;
|
|
2113
|
+
const MIN_H = 140;
|
|
2114
|
+
const cropW = Math.min(
|
|
2115
|
+
window.innerWidth,
|
|
2116
|
+
Math.max(MIN_W, ar.width, pickedRect.width)
|
|
2116
2117
|
);
|
|
2118
|
+
const cropH = Math.min(
|
|
2119
|
+
window.innerHeight,
|
|
2120
|
+
Math.max(MIN_H, ar.height, pickedRect.height)
|
|
2121
|
+
);
|
|
2122
|
+
const pickedCx = pickedRect.x + pickedRect.width / 2;
|
|
2123
|
+
const pickedCy = pickedRect.y + pickedRect.height / 2;
|
|
2124
|
+
const cropX = Math.max(
|
|
2125
|
+
0,
|
|
2126
|
+
Math.min(window.innerWidth - cropW, pickedCx - cropW / 2)
|
|
2127
|
+
);
|
|
2128
|
+
const cropY = Math.max(
|
|
2129
|
+
0,
|
|
2130
|
+
Math.min(window.innerHeight - cropH, pickedCy - cropH / 2)
|
|
2131
|
+
);
|
|
2132
|
+
const cropRect = new DOMRect(cropX, cropY, cropW, cropH);
|
|
2117
2133
|
const orig = {
|
|
2118
2134
|
outline: el.style.outline,
|
|
2119
2135
|
outlineOffset: el.style.outlineOffset
|
|
@@ -2920,8 +2936,8 @@ function CaptureApp(props) {
|
|
|
2920
2936
|
k("span", {}, isDev ? "InSitue Dev \xB7 pick + describe \u2192 CLI" : ""),
|
|
2921
2937
|
k(
|
|
2922
2938
|
"span",
|
|
2923
|
-
{ title: `@insitue/sdk@${"0.4.
|
|
2924
|
-
`InSitue \xB7 v${"0.4.
|
|
2939
|
+
{ title: `@insitue/sdk@${"0.4.4"}` },
|
|
2940
|
+
`InSitue \xB7 v${"0.4.4"}`
|
|
2925
2941
|
)
|
|
2926
2942
|
]
|
|
2927
2943
|
)
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mountCaptureOnly
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GT7TT3G7.js";
|
|
4
4
|
|
|
5
5
|
// src/InSitue.tsx
|
|
6
6
|
import { useEffect } from "react";
|
|
@@ -54,7 +54,7 @@ function InSitue({ port }) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/index.ts
|
|
57
|
-
var SDK_VERSION = "0.4.
|
|
57
|
+
var SDK_VERSION = "0.4.4";
|
|
58
58
|
export {
|
|
59
59
|
InSitue,
|
|
60
60
|
InSitueCapture,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insitue/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "InSitue capture SDK — drop one snippet into your deployed app; your users point at a bug, InSitue opens a verified pull request.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"tsup": "^8.3.5",
|
|
52
52
|
"typescript": "^5.6.3",
|
|
53
53
|
"vitest": "^3.2.4",
|
|
54
|
-
"@insitue/capture-core": "0.3.
|
|
54
|
+
"@insitue/capture-core": "0.3.2"
|
|
55
55
|
},
|
|
56
56
|
"repository": {
|
|
57
57
|
"type": "git",
|