@loupekit/sdk 0.9.1-next.33 → 0.9.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/index.global.js +10 -25
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -25
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2460,9 +2460,6 @@ var LoupeApp = class {
|
|
|
2460
2460
|
this.floatResize = null;
|
|
2461
2461
|
this.raf = 0;
|
|
2462
2462
|
// ---- inspector ------------------------------------------------------------
|
|
2463
|
-
// Pointer Events, not mouse events: a touch drag on a phone never fires
|
|
2464
|
-
// mousemove/mouseup, so Region/Record selection was impossible on touch devices.
|
|
2465
|
-
// Pointer events cover mouse, touch and pen with one handler each.
|
|
2466
2463
|
this.onMove = (e) => {
|
|
2467
2464
|
if (this.mode !== "inspect") return;
|
|
2468
2465
|
const target = this.pick(e.clientX, e.clientY);
|
|
@@ -2503,16 +2500,14 @@ var LoupeApp = class {
|
|
|
2503
2500
|
};
|
|
2504
2501
|
// ---- region ("free-size screenshot") selection ----------------------------
|
|
2505
2502
|
this.onRegionDown = (e) => {
|
|
2506
|
-
if (this.mode !== "region" && this.mode !== "record") return;
|
|
2507
|
-
if (e.pointerType !== "touch" && e.pointerType !== "pen" && e.button !== 0) return;
|
|
2503
|
+
if (this.mode !== "region" && this.mode !== "record" || e.button !== 0) return;
|
|
2508
2504
|
const t = e.target;
|
|
2509
2505
|
if (t && (t.id === "loupe-root" || t.closest?.("#loupe-root"))) return;
|
|
2510
2506
|
e.preventDefault();
|
|
2511
2507
|
e.stopPropagation();
|
|
2512
2508
|
this.dragStart = { x: e.clientX, y: e.clientY };
|
|
2513
|
-
document.addEventListener("
|
|
2514
|
-
document.addEventListener("
|
|
2515
|
-
document.addEventListener("pointercancel", this.onRegionCancel, true);
|
|
2509
|
+
document.addEventListener("mousemove", this.onRegionMove, true);
|
|
2510
|
+
document.addEventListener("mouseup", this.onRegionUp, true);
|
|
2516
2511
|
this.drawSelection(e.clientX, e.clientY);
|
|
2517
2512
|
};
|
|
2518
2513
|
this.onRegionMove = (e) => {
|
|
@@ -2541,11 +2536,6 @@ var LoupeApp = class {
|
|
|
2541
2536
|
if (wasRecord) void this.finishRecording(vp);
|
|
2542
2537
|
else this.finishRegion(vp);
|
|
2543
2538
|
};
|
|
2544
|
-
/** The OS took over the gesture (e.g. a system swipe): drop the selection. */
|
|
2545
|
-
this.onRegionCancel = () => {
|
|
2546
|
-
this.cancelDrag();
|
|
2547
|
-
this.selbox.style.display = "none";
|
|
2548
|
-
};
|
|
2549
2539
|
// ---- free note (drop a comment anywhere, no element / no screenshot) -------
|
|
2550
2540
|
this.onFreeClick = (e) => {
|
|
2551
2541
|
if (this.mode !== "free") return;
|
|
@@ -2799,8 +2789,7 @@ var LoupeApp = class {
|
|
|
2799
2789
|
const recordBtn = this.toolBtn(RECORD_ICON, "Record", "record");
|
|
2800
2790
|
recordBtn.title = "Drag a box, record a screen video of it, and comment";
|
|
2801
2791
|
recordBtn.onclick = () => this.setMode(this.mode === "record" ? "off" : "record");
|
|
2802
|
-
|
|
2803
|
-
tools.append(inspectBtn, freeBtn, regionBtn, ...canRecord ? [recordBtn] : []);
|
|
2792
|
+
tools.append(inspectBtn, freeBtn, regionBtn, recordBtn);
|
|
2804
2793
|
const listHead = el("div", "listhead");
|
|
2805
2794
|
listHead.append(document.createTextNode("Comments"));
|
|
2806
2795
|
this.countEl = el("span", "count", "0");
|
|
@@ -2921,9 +2910,8 @@ var LoupeApp = class {
|
|
|
2921
2910
|
}
|
|
2922
2911
|
cancelDrag() {
|
|
2923
2912
|
this.dragStart = null;
|
|
2924
|
-
document.removeEventListener("
|
|
2925
|
-
document.removeEventListener("
|
|
2926
|
-
document.removeEventListener("pointercancel", this.onRegionCancel, true);
|
|
2913
|
+
document.removeEventListener("mousemove", this.onRegionMove, true);
|
|
2914
|
+
document.removeEventListener("mouseup", this.onRegionUp, true);
|
|
2927
2915
|
}
|
|
2928
2916
|
/**
|
|
2929
2917
|
* Anchor a dragged viewport rect to the element under its center so it survives
|
|
@@ -3025,23 +3013,20 @@ var LoupeApp = class {
|
|
|
3025
3013
|
this.dock.querySelector('[data-role="region"]')?.classList.toggle("on", mode === "region");
|
|
3026
3014
|
this.dock.querySelector('[data-role="record"]')?.classList.toggle("on", mode === "record");
|
|
3027
3015
|
this.dock.classList.toggle("inspecting", mode !== "off");
|
|
3028
|
-
document.removeEventListener("
|
|
3029
|
-
document.removeEventListener("pointerdown", this.onMove, true);
|
|
3016
|
+
document.removeEventListener("mousemove", this.onMove, true);
|
|
3030
3017
|
document.removeEventListener("click", this.onClick, true);
|
|
3031
3018
|
document.removeEventListener("click", this.onFreeClick, true);
|
|
3032
|
-
document.removeEventListener("
|
|
3033
|
-
document.documentElement.style.touchAction = mode === "region" || mode === "record" ? "none" : "";
|
|
3019
|
+
document.removeEventListener("mousedown", this.onRegionDown, true);
|
|
3034
3020
|
if (mode === "off") return;
|
|
3035
3021
|
document.addEventListener("keydown", this.onKey, true);
|
|
3036
3022
|
this.closeComposer();
|
|
3037
3023
|
if (mode === "inspect") {
|
|
3038
|
-
document.addEventListener("
|
|
3039
|
-
document.addEventListener("pointerdown", this.onMove, true);
|
|
3024
|
+
document.addEventListener("mousemove", this.onMove, true);
|
|
3040
3025
|
document.addEventListener("click", this.onClick, true);
|
|
3041
3026
|
} else if (mode === "free") {
|
|
3042
3027
|
document.addEventListener("click", this.onFreeClick, true);
|
|
3043
3028
|
} else if (mode === "region" || mode === "record") {
|
|
3044
|
-
document.addEventListener("
|
|
3029
|
+
document.addEventListener("mousedown", this.onRegionDown, true);
|
|
3045
3030
|
}
|
|
3046
3031
|
}
|
|
3047
3032
|
// ---- composer -------------------------------------------------------------
|