ui-sniper 3.0.2 → 3.0.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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +35 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +66 -64
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -7890,10 +7890,10 @@ function SettingsPanel({
|
|
|
7890
7890
|
className: `${styles_module_default9.settingsPage} ${settingsPage === "automations" ? styles_module_default9.slideLeft : ""}`,
|
|
7891
7891
|
children: [
|
|
7892
7892
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: styles_module_default9.settingsHeader, children: [
|
|
7893
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { className: styles_module_default9.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "72", height: "16", viewBox: "0 0
|
|
7893
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { className: styles_module_default9.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "72", height: "16", viewBox: "0 0 500 151", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("text", { x: "10", y: "110", "font-family": "'Arial Black', 'Impact', sans-serif", "font-size": "105", "font-weight": "900", "font-style": "italic", "letter-spacing": "-2", fill: "currentColor", children: "UI SNIPER" }) }) }),
|
|
7894
7894
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: styles_module_default9.settingsVersion, children: [
|
|
7895
7895
|
"v",
|
|
7896
|
-
"3.0.
|
|
7896
|
+
"3.0.4"
|
|
7897
7897
|
] }),
|
|
7898
7898
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
7899
7899
|
"button",
|
|
@@ -8045,6 +8045,16 @@ function SettingsPanel({
|
|
|
8045
8045
|
checked: settings.blockInteractions,
|
|
8046
8046
|
onChange: (e) => onSettingsChange({ blockInteractions: e.target.checked })
|
|
8047
8047
|
}
|
|
8048
|
+
),
|
|
8049
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8050
|
+
CheckboxField,
|
|
8051
|
+
{
|
|
8052
|
+
className: styles_module_default9.checkboxField,
|
|
8053
|
+
label: "Include screenshots",
|
|
8054
|
+
checked: settings.includeScreenshots,
|
|
8055
|
+
onChange: (e) => onSettingsChange({ includeScreenshots: e.target.checked }),
|
|
8056
|
+
tooltip: "Capture a screenshot of the annotated element"
|
|
8057
|
+
}
|
|
8048
8058
|
)
|
|
8049
8059
|
] }),
|
|
8050
8060
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: styles_module_default9.divider }),
|
|
@@ -8221,7 +8231,8 @@ var DEFAULT_SETTINGS = {
|
|
|
8221
8231
|
reactEnabled: true,
|
|
8222
8232
|
markerClickBehavior: "edit",
|
|
8223
8233
|
webhookUrl: "",
|
|
8224
|
-
webhooksEnabled: true
|
|
8234
|
+
webhooksEnabled: true,
|
|
8235
|
+
includeScreenshots: false
|
|
8225
8236
|
};
|
|
8226
8237
|
var isValidUrl = (url) => {
|
|
8227
8238
|
if (!url || !url.trim()) return false;
|
|
@@ -10031,8 +10042,27 @@ function PageFeedbackToolbarCSS({
|
|
|
10031
10042
|
[webhookUrl, settings.webhookUrl, settings.webhooksEnabled]
|
|
10032
10043
|
);
|
|
10033
10044
|
const addAnnotation = (0, import_react8.useCallback)(
|
|
10034
|
-
(comment) => {
|
|
10045
|
+
async (comment) => {
|
|
10035
10046
|
if (!pendingAnnotation) return;
|
|
10047
|
+
let screenshotData = void 0;
|
|
10048
|
+
if (settings.includeScreenshots) {
|
|
10049
|
+
let elToCapture = pendingAnnotation.targetElement;
|
|
10050
|
+
if (!elToCapture && pendingAnnotation.multiSelectElements?.length) {
|
|
10051
|
+
elToCapture = pendingAnnotation.multiSelectElements[0];
|
|
10052
|
+
}
|
|
10053
|
+
if (elToCapture) {
|
|
10054
|
+
try {
|
|
10055
|
+
const { toPng } = await import("html-to-image");
|
|
10056
|
+
screenshotData = await toPng(elToCapture, {
|
|
10057
|
+
quality: 0.8,
|
|
10058
|
+
pixelRatio: 1
|
|
10059
|
+
// Keep base64 size manageable
|
|
10060
|
+
});
|
|
10061
|
+
} catch (e) {
|
|
10062
|
+
console.error("Failed to capture screenshot:", e);
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
10065
|
+
}
|
|
10036
10066
|
const newAnnotation = {
|
|
10037
10067
|
id: Date.now().toString(),
|
|
10038
10068
|
x: pendingAnnotation.x,
|
|
@@ -10054,6 +10084,7 @@ function PageFeedbackToolbarCSS({
|
|
|
10054
10084
|
reactComponents: pendingAnnotation.reactComponents,
|
|
10055
10085
|
sourceFile: pendingAnnotation.sourceFile,
|
|
10056
10086
|
elementBoundingBoxes: pendingAnnotation.elementBoundingBoxes,
|
|
10087
|
+
screenshotData,
|
|
10057
10088
|
// Protocol fields for server sync
|
|
10058
10089
|
...endpoint && currentSessionId ? {
|
|
10059
10090
|
sessionId: currentSessionId,
|