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.mjs
CHANGED
|
@@ -7806,10 +7806,10 @@ function SettingsPanel({
|
|
|
7806
7806
|
className: `${styles_module_default9.settingsPage} ${settingsPage === "automations" ? styles_module_default9.slideLeft : ""}`,
|
|
7807
7807
|
children: [
|
|
7808
7808
|
/* @__PURE__ */ jsxs12("div", { className: styles_module_default9.settingsHeader, children: [
|
|
7809
|
-
/* @__PURE__ */ jsx13("a", { className: styles_module_default9.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx13("svg", { width: "72", height: "16", viewBox: "0 0
|
|
7809
|
+
/* @__PURE__ */ jsx13("a", { className: styles_module_default9.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx13("svg", { width: "72", height: "16", viewBox: "0 0 500 151", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx13("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" }) }) }),
|
|
7810
7810
|
/* @__PURE__ */ jsxs12("p", { className: styles_module_default9.settingsVersion, children: [
|
|
7811
7811
|
"v",
|
|
7812
|
-
"3.0.
|
|
7812
|
+
"3.0.4"
|
|
7813
7813
|
] }),
|
|
7814
7814
|
/* @__PURE__ */ jsx13(
|
|
7815
7815
|
"button",
|
|
@@ -7961,6 +7961,16 @@ function SettingsPanel({
|
|
|
7961
7961
|
checked: settings.blockInteractions,
|
|
7962
7962
|
onChange: (e) => onSettingsChange({ blockInteractions: e.target.checked })
|
|
7963
7963
|
}
|
|
7964
|
+
),
|
|
7965
|
+
/* @__PURE__ */ jsx13(
|
|
7966
|
+
CheckboxField,
|
|
7967
|
+
{
|
|
7968
|
+
className: styles_module_default9.checkboxField,
|
|
7969
|
+
label: "Include screenshots",
|
|
7970
|
+
checked: settings.includeScreenshots,
|
|
7971
|
+
onChange: (e) => onSettingsChange({ includeScreenshots: e.target.checked }),
|
|
7972
|
+
tooltip: "Capture a screenshot of the annotated element"
|
|
7973
|
+
}
|
|
7964
7974
|
)
|
|
7965
7975
|
] }),
|
|
7966
7976
|
/* @__PURE__ */ jsx13("div", { className: styles_module_default9.divider }),
|
|
@@ -8137,7 +8147,8 @@ var DEFAULT_SETTINGS = {
|
|
|
8137
8147
|
reactEnabled: true,
|
|
8138
8148
|
markerClickBehavior: "edit",
|
|
8139
8149
|
webhookUrl: "",
|
|
8140
|
-
webhooksEnabled: true
|
|
8150
|
+
webhooksEnabled: true,
|
|
8151
|
+
includeScreenshots: false
|
|
8141
8152
|
};
|
|
8142
8153
|
var isValidUrl = (url) => {
|
|
8143
8154
|
if (!url || !url.trim()) return false;
|
|
@@ -9947,8 +9958,27 @@ function PageFeedbackToolbarCSS({
|
|
|
9947
9958
|
[webhookUrl, settings.webhookUrl, settings.webhooksEnabled]
|
|
9948
9959
|
);
|
|
9949
9960
|
const addAnnotation = useCallback5(
|
|
9950
|
-
(comment) => {
|
|
9961
|
+
async (comment) => {
|
|
9951
9962
|
if (!pendingAnnotation) return;
|
|
9963
|
+
let screenshotData = void 0;
|
|
9964
|
+
if (settings.includeScreenshots) {
|
|
9965
|
+
let elToCapture = pendingAnnotation.targetElement;
|
|
9966
|
+
if (!elToCapture && pendingAnnotation.multiSelectElements?.length) {
|
|
9967
|
+
elToCapture = pendingAnnotation.multiSelectElements[0];
|
|
9968
|
+
}
|
|
9969
|
+
if (elToCapture) {
|
|
9970
|
+
try {
|
|
9971
|
+
const { toPng } = await import("html-to-image");
|
|
9972
|
+
screenshotData = await toPng(elToCapture, {
|
|
9973
|
+
quality: 0.8,
|
|
9974
|
+
pixelRatio: 1
|
|
9975
|
+
// Keep base64 size manageable
|
|
9976
|
+
});
|
|
9977
|
+
} catch (e) {
|
|
9978
|
+
console.error("Failed to capture screenshot:", e);
|
|
9979
|
+
}
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9952
9982
|
const newAnnotation = {
|
|
9953
9983
|
id: Date.now().toString(),
|
|
9954
9984
|
x: pendingAnnotation.x,
|
|
@@ -9970,6 +10000,7 @@ function PageFeedbackToolbarCSS({
|
|
|
9970
10000
|
reactComponents: pendingAnnotation.reactComponents,
|
|
9971
10001
|
sourceFile: pendingAnnotation.sourceFile,
|
|
9972
10002
|
elementBoundingBoxes: pendingAnnotation.elementBoundingBoxes,
|
|
10003
|
+
screenshotData,
|
|
9973
10004
|
// Protocol fields for server sync
|
|
9974
10005
|
...endpoint && currentSessionId ? {
|
|
9975
10006
|
sessionId: currentSessionId,
|