reflet-sdk 0.6.4 → 0.6.5

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/feedback.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { n as Reflet } from "./client-DAdWdIFY.js";
3
- import { A as SquareIcon, B as collectPageContext, C as ChevronDownIcon, D as MoreIcon, E as HighlightIcon, F as UndoIcon, H as buildElementSelection, I as isDegenerate, J as captureViewport, L as normalizeRect, M as TargetIcon, N as TextIcon, O as PencilIcon, P as TrashIcon, R as DEFAULT_WIDGET_LABELS, S as CheckIcon, T as GripIcon, V as MAX_SELECTION_COMMENT_LENGTH, X as capturedViewportSize, Z as releaseCapture, _ as matchesHotkey, b as CameraIcon, c as useFloatingPosition, d as SelectionOutline, f as drawAnnotations, g as isSubmitEnter, h as stopClicksAtHost, i as submitWidgetFeedback, k as SpotlightIcon, m as listenToKeydown, n as createFeedbackTransport, o as ElementPicker, p as listenOnPageAndWidget, q as WIDGET_MARKER, t as attachPreparedScreenshots, v as ArrowIcon, w as CloseIcon, x as ChatIcon, y as BlurIcon, z as SDK_VERSION } from "./submit-Cd-g1Dtg.js";
3
+ import { A as SquareIcon, B as collectPageContext, C as ChevronDownIcon, D as MoreIcon, E as HighlightIcon, F as UndoIcon, H as buildElementSelection, I as isDegenerate, J as captureViewport, L as normalizeRect, M as TargetIcon, N as TextIcon, O as PencilIcon, P as TrashIcon, R as DEFAULT_WIDGET_LABELS, S as CheckIcon, T as GripIcon, V as MAX_SELECTION_COMMENT_LENGTH, X as capturedViewportSize, Z as releaseCapture, _ as matchesHotkey, b as CameraIcon, c as useFloatingPosition, d as SelectionOutline, f as drawAnnotations, g as isSubmitEnter, h as stopClicksAtHost, i as submitWidgetFeedback, k as SpotlightIcon, m as listenToKeydown, n as createFeedbackTransport, o as ElementPicker, p as listenOnPageAndWidget, q as WIDGET_MARKER, t as attachPreparedScreenshots, v as ArrowIcon, w as CloseIcon, x as ChatIcon, y as BlurIcon, z as SDK_VERSION } from "./submit-MvVjNdYc.js";
4
4
  import { a as REFLET_Z_INDEX, t as RefletContext } from "./react-context-Caq1fodf.js";
5
5
  import { Suspense, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -2291,7 +2291,7 @@ function useWidgetState(props) {
2291
2291
  setStep("compose");
2292
2292
  return submission.submit({
2293
2293
  context: {
2294
- ...activeScreenshot?.context ?? collectPageContext({ sdkVersion: "0.6.4" }),
2294
+ ...activeScreenshot?.context ?? collectPageContext({ sdkVersion: "0.6.5" }),
2295
2295
  consoleEvents: consoleRef.current?.events(),
2296
2296
  metadata: props.metadata,
2297
2297
  selections
@@ -2357,7 +2357,7 @@ function useWidgetState(props) {
2357
2357
  }
2358
2358
  //#endregion
2359
2359
  //#region src/feedback/widget.tsx
2360
- const DevtoolsLayer = process.env.NODE_ENV === "development" ? lazy(() => import("./devtools-layer-DgmM3RhW.js").then((module) => ({ default: module.DevtoolsLayer }))) : null;
2360
+ const DevtoolsLayer = process.env.NODE_ENV === "development" ? lazy(() => import("./devtools-layer-CEjzYGBB.js").then((module) => ({ default: module.DevtoolsLayer }))) : null;
2361
2361
  function RefletFeedback(props) {
2362
2362
  const state = useWidgetState(props);
2363
2363
  const launcher = useWidgetLauncher(state);
@@ -817,7 +817,7 @@ function collectPageContext(options) {
817
817
  }
818
818
  //#endregion
819
819
  //#region src/feedback/types.ts
820
- const SDK_VERSION = "0.6.4";
820
+ const SDK_VERSION = "0.6.5";
821
821
  const DEFAULT_WIDGET_LABELS = {
822
822
  annotateHint: "Draw on the screenshot to point at the problem.",
823
823
  attachElement: "Attach this element",
@@ -1856,10 +1856,11 @@ function ElementPicker({ copy, inspect, labels, onCancel, onPick }) {
1856
1856
  maxLength: MAX_SELECTION_COMMENT_LENGTH,
1857
1857
  onChange: (event) => setNote(event.target.value),
1858
1858
  onKeyDown: (event) => {
1859
- if (isSubmitEnter(event.nativeEvent)) {
1860
- event.preventDefault();
1861
- onPick(pinned.element, note.trim());
1862
- }
1859
+ if (!isSubmitEnter(event.nativeEvent)) return;
1860
+ event.preventDefault();
1861
+ const trimmedNote = note.trim();
1862
+ if (copy && !trimmedNote) copy.onCopy(pinned.element, "");
1863
+ else onPick(pinned.element, trimmedNote);
1863
1864
  },
1864
1865
  placeholder: labels.elementNotePlaceholder,
1865
1866
  ref: noteRef,
@@ -2024,4 +2025,4 @@ function createFeedbackTransport(client) {
2024
2025
  //#endregion
2025
2026
  export { SquareIcon as A, collectPageContext as B, ChevronDownIcon as C, MoreIcon as D, HighlightIcon as E, UndoIcon as F, resolveComponentStack as G, buildElementSelection as H, isDegenerate as I, captureViewport as J, shortenSourcePath as K, normalizeRect as L, TargetIcon as M, TextIcon as N, PencilIcon as O, TrashIcon as P, DEFAULT_WIDGET_LABELS as R, CheckIcon as S, GripIcon as T, describeElement as U, MAX_SELECTION_COMMENT_LENGTH as V, getFiberFromNode as W, capturedViewportSize as X, capturedFromCanvas as Y, releaseCapture as Z, matchesHotkey as _, uploadImageBlob as a, CameraIcon as b, useFloatingPosition as c, SelectionOutline as d, drawAnnotations as f, isSubmitEnter as g, stopClicksAtHost as h, submitWidgetFeedback as i, Svg as j, SpotlightIcon as k, onViewportChange as l, listenToKeydown as m, createFeedbackTransport as n, ElementPicker as o, listenOnPageAndWidget as p, WIDGET_MARKER as q, deriveTitle as r, isWidgetOwned as s, attachPreparedScreenshots as t, visibleViewport as u, ArrowIcon as v, CloseIcon as w, ChatIcon as x, BlurIcon as y, SDK_VERSION as z };
2026
2027
 
2027
- //# sourceMappingURL=submit-Cd-g1Dtg.js.map
2028
+ //# sourceMappingURL=submit-MvVjNdYc.js.map