ui-sniper 3.1.0 → 3.1.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.d.mts CHANGED
@@ -256,8 +256,10 @@ interface ReviewPanelProps {
256
256
  onDelete?: (annotation: Annotation) => void;
257
257
  /** Whether the panel is in dark or light mode */
258
258
  isDarkMode?: boolean;
259
+ /** Called when user clicks copy on an annotation */
260
+ onCopy?: (annotation: Annotation) => void;
259
261
  }
260
- declare function ReviewPanel({ annotations, onClose, onJumpTo, onDelete, }: ReviewPanelProps): react_jsx_runtime.JSX.Element;
262
+ declare function ReviewPanel({ annotations, onClose, onJumpTo, onDelete, onCopy, }: ReviewPanelProps): react_jsx_runtime.JSX.Element;
261
263
 
262
264
  interface AnnotationPopupCSSProps {
263
265
  /** Element name to display in header */
package/dist/index.d.ts CHANGED
@@ -256,8 +256,10 @@ interface ReviewPanelProps {
256
256
  onDelete?: (annotation: Annotation) => void;
257
257
  /** Whether the panel is in dark or light mode */
258
258
  isDarkMode?: boolean;
259
+ /** Called when user clicks copy on an annotation */
260
+ onCopy?: (annotation: Annotation) => void;
259
261
  }
260
- declare function ReviewPanel({ annotations, onClose, onJumpTo, onDelete, }: ReviewPanelProps): react_jsx_runtime.JSX.Element;
262
+ declare function ReviewPanel({ annotations, onClose, onJumpTo, onDelete, onCopy, }: ReviewPanelProps): react_jsx_runtime.JSX.Element;
261
263
 
262
264
  interface AnnotationPopupCSSProps {
263
265
  /** Element name to display in header */
package/dist/index.js CHANGED
@@ -8056,7 +8056,8 @@ function ReviewPanel({
8056
8056
  annotations,
8057
8057
  onClose,
8058
8058
  onJumpTo,
8059
- onDelete
8059
+ onDelete,
8060
+ onCopy
8060
8061
  }) {
8061
8062
  const [mode, setMode] = (0, import_react8.useState)("list");
8062
8063
  const [currentIndex, setCurrentIndex] = (0, import_react8.useState)(0);
@@ -8169,6 +8170,20 @@ function ReviewPanel({
8169
8170
  ] })
8170
8171
  }
8171
8172
  ),
8173
+ onCopy && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
8174
+ "button",
8175
+ {
8176
+ type: "button",
8177
+ className: styles_module_default4.cardActionBtn,
8178
+ title: "Copy",
8179
+ onClick: (e) => {
8180
+ e.stopPropagation();
8181
+ onCopy(ann);
8182
+ },
8183
+ "aria-label": "Copy annotation",
8184
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconCopyAlt, { size: 12 })
8185
+ }
8186
+ ),
8172
8187
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
8173
8188
  "button",
8174
8189
  {
@@ -8296,6 +8311,17 @@ function ReviewPanel({
8296
8311
  ]
8297
8312
  }
8298
8313
  ),
8314
+ onCopy && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
8315
+ "button",
8316
+ {
8317
+ type: "button",
8318
+ className: `${styles_module_default4.flashcardActionBtn} ${styles_module_default4.jumpBtn}`,
8319
+ onClick: () => onCopy(currentAnnotation),
8320
+ title: "Copy annotation",
8321
+ "aria-label": "Copy annotation",
8322
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconCopyAlt, { size: 13 })
8323
+ }
8324
+ ),
8299
8325
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
8300
8326
  "button",
8301
8327
  {
@@ -8323,7 +8349,7 @@ function ReviewPanel({
8323
8349
  children: [
8324
8350
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: styles_module_default4.panelHeader, children: [
8325
8351
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: styles_module_default4.panelTitle, children: [
8326
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: styles_module_default4.panelTitleIcon, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconLayout, { size: 13 }) }),
8352
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: styles_module_default4.panelTitleIcon, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconChatEllipsis, { size: 13 }) }),
8327
8353
  "Review",
8328
8354
  annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: styles_module_default4.panelCount, children: [
8329
8355
  reviewedIds.size,
@@ -8786,10 +8812,10 @@ function SettingsPanel({
8786
8812
  className: `${styles_module_default10.settingsPage} ${settingsPage === "automations" ? styles_module_default10.slideLeft : ""}`,
8787
8813
  children: [
8788
8814
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: styles_module_default10.settingsHeader, children: [
8789
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: styles_module_default10.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.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" }) }) }),
8815
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: styles_module_default10.settingsBrand, href: "https://hara-xy.com", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("text", { x: "10", y: "110", fontFamily: "'Arial Black', 'Impact', sans-serif", fontSize: "105", fontWeight: "900", fontStyle: "italic", letterSpacing: "-2", fill: "currentColor", children: "UI SNIPER" }) }) }),
8790
8816
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: styles_module_default10.settingsVersion, children: [
8791
8817
  "v",
8792
- "3.1.0"
8818
+ "3.1.1"
8793
8819
  ] }),
8794
8820
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8795
8821
  "button",
@@ -9485,7 +9511,7 @@ function PageFeedbackToolbarCSS({
9485
9511
  }, [shouldShowMarkers]);
9486
9512
  (0, import_react10.useEffect)(() => {
9487
9513
  const checkMobile = () => {
9488
- setIsMobile(window.innerWidth < 768 || window.matchMedia("(pointer: coarse)").matches);
9514
+ setIsMobile(window.innerWidth < 768 || window.matchMedia?.("(pointer: coarse)")?.matches);
9489
9515
  };
9490
9516
  checkMobile();
9491
9517
  window.addEventListener("resize", checkMobile);
@@ -12087,7 +12113,7 @@ function PageFeedbackToolbarCSS({
12087
12113
  ] })
12088
12114
  ] }),
12089
12115
  hasAnnotations && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: styles_module_default5.buttonWrapper, children: [
12090
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
12116
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
12091
12117
  "button",
12092
12118
  {
12093
12119
  className: `${styles_module_default5.controlButton} ${showReviewPanel ? "" : ""}`,
@@ -12098,7 +12124,10 @@ function PageFeedbackToolbarCSS({
12098
12124
  },
12099
12125
  title: "Review annotations",
12100
12126
  "aria-label": "Review annotations",
12101
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconLayout, { size: 20 })
12127
+ children: [
12128
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconChatEllipsis, { size: 20 }),
12129
+ annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: styles_module_default5.buttonBadge, children: annotations.length })
12130
+ ]
12102
12131
  }
12103
12132
  ),
12104
12133
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: styles_module_default5.buttonTooltip, children: "Review notes" })
@@ -12368,6 +12397,13 @@ function PageFeedbackToolbarCSS({
12368
12397
  },
12369
12398
  onDelete: (ann) => {
12370
12399
  deleteAnnotation2(ann.id);
12400
+ },
12401
+ onCopy: (ann) => {
12402
+ const output = generateOutput([ann], pathname, settings.outputDetail || "standard");
12403
+ if (navigator.clipboard) {
12404
+ navigator.clipboard.writeText(output).catch(() => {
12405
+ });
12406
+ }
12371
12407
  }
12372
12408
  }
12373
12409
  ),