reflet-sdk 0.6.3 → 0.6.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/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ All notable changes to `reflet-sdk` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.4] - 2026-10-04
9
+
10
+ ### Added
11
+
12
+ - Click a screenshot thumbnail in the widget to open it full size, the same view the pencil opens.
13
+
14
+ ### Fixed
15
+
16
+ - Picked-element highlights and devtools close-ups land on the element on Windows and Linux. A classic scrollbar used to shift them left, by up to its own width near the right edge.
17
+ - Letter hotkeys work with macOS Option (⌥F types "ƒ") and on non-Latin keyboard layouts, for both the `hotkey` prop and the picker's ⌘C / Ctrl+C.
18
+ - Pressing Enter to confirm Japanese, Chinese or Korean input no longer submits the picker note, the devtools note or a text annotation. Pressing Escape to cancel the input no longer closes the picker note, a text annotation, the devtools panel or a note pin either.
19
+ - Right-click no longer picks an element, and the page's context menu no longer opens while picking.
20
+ - "Open in editor" links work for Windows paths (`vscode://file/C:/…`), and devtools resolves `file:///C:/…`, Vite `/@fs/C:/…` and `/C:/…` source frames.
21
+ - Devtools refuses Server Component chunks on another Windows drive as outside the repository.
22
+
8
23
  ## [0.6.3] - 2026-10-04
9
24
 
10
25
  ### Added
@@ -1,6 +1,6 @@
1
1
  import { a as EDITORS, n as DEVTOOLS_REQUEST_HEADER, r as DEVTOOLS_ROUTE_BASE, t as DEVTOOLS_ENDPOINTS } from "./protocol-ClqTFzwR.js";
2
- import { A as TargetIcon, B as buildElementSelection, C as GripIcon, H as getFiberFromNode, I as DEFAULT_WIDGET_LABELS, J as releaseCapture, K as captureViewport, L as SDK_VERSION, R as collectPageContext, S as CloseIcon, U as resolveComponentStack, V as describeElement, W as shortenSourcePath, a as deriveTitle, c as useFloatingPosition, d as SelectionOutline, k as Svg, l as onViewportChange, m as listenToKeydown, n as isWidgetOwned, p as listenOnPageAndWidget, q as capturedFromCanvas, s as uploadImageBlob, t as ElementPicker, u as visibleViewport } from "./picker-Rh-hsxyX.js";
3
- import { t as REFLET_Z_INDEX } from "./z-index-CIb4-3Fy.js";
2
+ import { B as collectPageContext, G as resolveComponentStack, H as buildElementSelection, J as captureViewport, K as shortenSourcePath, M as TargetIcon, R as DEFAULT_WIDGET_LABELS, T as GripIcon, U as describeElement, W as getFiberFromNode, X as capturedViewportSize, Y as capturedFromCanvas, Z as releaseCapture, a as uploadImageBlob, c as useFloatingPosition, d as SelectionOutline, g as isSubmitEnter, j as Svg, l as onViewportChange, m as listenToKeydown, o as ElementPicker, p as listenOnPageAndWidget, r as deriveTitle, s as isWidgetOwned, u as visibleViewport, w as CloseIcon, z as SDK_VERSION } from "./submit-Cd-g1Dtg.js";
3
+ import { a as REFLET_Z_INDEX } from "./react-context-Caq1fodf.js";
4
4
  import * as G$1 from "react";
5
5
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -666,7 +666,12 @@ async function copyToClipboard(text) {
666
666
  }
667
667
  //#endregion
668
668
  //#region src/devtools/client/code/editor-url.ts
669
- const fileSchemeLink = (scheme) => (absolutePath, line, column) => `${scheme}://file${encodeURI(absolutePath)}:${line}:${column}`;
669
+ /** VS Code-family links want `/c:/dir/file.tsx` on Windows, `/dir/file.tsx` elsewhere. */
670
+ const fileSchemeLink = (scheme) => (absolutePath, line, column) => {
671
+ const slashed = absolutePath.replaceAll("\\", "/");
672
+ const rooted = slashed.startsWith("/") ? slashed : `/${slashed}`;
673
+ return `${scheme}://file${encodeURI(rooted)}:${line}:${column}`;
674
+ };
670
675
  const EDITOR_LINKS = {
671
676
  cursor: fileSchemeLink("cursor"),
672
677
  vscode: fileSchemeLink("vscode"),
@@ -985,7 +990,7 @@ function DevtoolsSheet({ children, onClose, onPick, onSelectTab, side, tab, tabs
985
990
  const isMoved = floating.position !== null;
986
991
  const { rootRef } = floating;
987
992
  useEffect(() => listenToKeydown(rootRef.current, (event) => {
988
- if (event.key === "Escape") onClose();
993
+ if (event.key === "Escape" && !event.isComposing) onClose();
989
994
  }), [onClose, rootRef]);
990
995
  return /* @__PURE__ */ jsxs("aside", {
991
996
  "aria-label": "Reflet devtools",
@@ -3062,7 +3067,7 @@ const SNAPSHOT_MAX_WIDTH = 800;
3062
3067
  const OUTLINE_COLOR = "#4f46e5";
3063
3068
  const OUTLINE_WIDTH = 2;
3064
3069
  /** The element plus some room around it, grown to a readable minimum, kept inside the window. */
3065
- function cropAround(rect) {
3070
+ function cropAround(rect, viewport) {
3066
3071
  const grow = (start, length, limit) => {
3067
3072
  const padded = Math.max(length + 64, MIN_CROP_SIZE);
3068
3073
  const from = Math.max(0, start + length / 2 - padded / 2);
@@ -3072,8 +3077,8 @@ function cropAround(rect) {
3072
3077
  to
3073
3078
  };
3074
3079
  };
3075
- const horizontal = grow(rect.left, rect.width, window.innerWidth);
3076
- const vertical = grow(rect.top, rect.height, window.innerHeight);
3080
+ const horizontal = grow(rect.left, rect.width, viewport.width);
3081
+ const vertical = grow(rect.top, rect.height, viewport.height);
3077
3082
  return {
3078
3083
  height: vertical.to - vertical.from,
3079
3084
  width: horizontal.to - horizontal.from,
@@ -3101,8 +3106,9 @@ async function captureElementSnapshot(element) {
3101
3106
  try {
3102
3107
  const rect = box.getBoundingClientRect();
3103
3108
  if (rect.width === 0 || rect.height === 0) return null;
3104
- const scale = page.width / window.innerWidth;
3105
- const crop = cropAround(rect);
3109
+ const viewport = capturedViewportSize();
3110
+ const scale = page.width / viewport.width;
3111
+ const crop = cropAround(rect, viewport);
3106
3112
  const canvas = document.createElement("canvas");
3107
3113
  canvas.width = Math.round(crop.width * scale);
3108
3114
  canvas.height = Math.round(crop.height * scale);
@@ -3457,7 +3463,7 @@ function NoteEditor({ initialText, noteId, onDone }) {
3457
3463
  className: "dt-field",
3458
3464
  onChange: (event) => setText(event.target.value),
3459
3465
  onKeyDown: (event) => {
3460
- if (event.key === "Enter" && !event.shiftKey) {
3466
+ if (isSubmitEnter(event.nativeEvent)) {
3461
3467
  event.preventDefault();
3462
3468
  save();
3463
3469
  }
@@ -3904,7 +3910,7 @@ function NotePopover({ anchor, notes, onClose, onOpenCode }) {
3904
3910
  };
3905
3911
  const stopOutsidePress = listenOnPageAndWidget(popoverRef.current, "pointerdown", closeOnOutsidePress, true);
3906
3912
  const stopKeys = listenToKeydown(popoverRef.current, (event) => {
3907
- if (event.key === "Escape") onClose();
3913
+ if (event.key === "Escape" && !event.isComposing) onClose();
3908
3914
  });
3909
3915
  return () => {
3910
3916
  stopOutsidePress();
@@ -4185,4 +4191,4 @@ function DevtoolsLayer({ isWidgetOpen, position, publicKey }) {
4185
4191
  //#endregion
4186
4192
  export { DevtoolsLayer };
4187
4193
 
4188
- //# sourceMappingURL=devtools-layer-DtO89RlJ.js.map
4194
+ //# sourceMappingURL=devtools-layer-DgmM3RhW.js.map