react-grab 0.1.13 → 0.1.14

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.
@@ -1 +1 @@
1
- 'use strict';var chunk2T22V7DM_cjs=require('../chunk-2T22V7DM.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.a}});
1
+ 'use strict';var chunkHH5Y6LBC_cjs=require('../chunk-HH5Y6LBC.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.a}});
@@ -1,3 +1,3 @@
1
- export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-CNwr6CHX.cjs';
1
+ export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-KT3jIAik.cjs';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
@@ -1,3 +1,3 @@
1
- export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-CNwr6CHX.js';
1
+ export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-KT3jIAik.js';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
@@ -1 +1 @@
1
- export{j as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,o as init,a as isInstrumentationActive}from'../chunk-VR2ILUMN.js';
1
+ export{j as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,o as init,a as isInstrumentationActive}from'../chunk-WMLJ3P7X.js';
@@ -301,6 +301,12 @@ interface ToolbarState {
301
301
  collapsed: boolean;
302
302
  enabled: boolean;
303
303
  }
304
+ interface DropdownAnchor {
305
+ x: number;
306
+ y: number;
307
+ edge: ToolbarState["edge"];
308
+ toolbarWidth: number;
309
+ }
304
310
  interface ReactGrabAPI {
305
311
  activate: () => void;
306
312
  deactivate: () => void;
@@ -337,6 +343,9 @@ interface SelectionLabelInstance {
337
343
  tagName: string;
338
344
  componentName?: string;
339
345
  status: SelectionLabelStatus;
346
+ statusText?: string;
347
+ isPromptMode?: boolean;
348
+ inputValue?: string;
340
349
  createdAt: number;
341
350
  element?: Element;
342
351
  elements?: Element[];
@@ -344,6 +353,17 @@ interface SelectionLabelInstance {
344
353
  mouseXOffsetFromCenter?: number;
345
354
  mouseXOffsetRatio?: number;
346
355
  errorMessage?: string;
356
+ hideArrow?: boolean;
357
+ }
358
+ interface RecentItem {
359
+ id: string;
360
+ content: string;
361
+ elementName: string;
362
+ tagName: string;
363
+ componentName?: string;
364
+ isComment: boolean;
365
+ commentText?: string;
366
+ timestamp: number;
347
367
  }
348
368
  interface ReactGrabRendererProps {
349
369
  selectionVisible?: boolean;
@@ -410,6 +430,7 @@ interface ReactGrabRendererProps {
410
430
  onToolbarStateChange?: (state: ToolbarState) => void;
411
431
  onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
412
432
  onToolbarSelectHoverChange?: (isHovered: boolean) => void;
433
+ onToolbarRef?: (element: HTMLDivElement) => void;
413
434
  contextMenuPosition?: {
414
435
  x: number;
415
436
  y: number;
@@ -422,6 +443,20 @@ interface ReactGrabRendererProps {
422
443
  actionContext?: ActionContext;
423
444
  onContextMenuDismiss?: () => void;
424
445
  onContextMenuHide?: () => void;
446
+ recentItems?: RecentItem[];
447
+ recentItemCount?: number;
448
+ hasUnreadRecentItems?: boolean;
449
+ recentDropdownPosition?: DropdownAnchor | null;
450
+ onToggleRecent?: () => void;
451
+ onRecentButtonHover?: (isHovered: boolean) => void;
452
+ onRecentItemSelect?: (item: RecentItem) => void;
453
+ onRecentItemRemove?: (item: RecentItem) => void;
454
+ onRecentItemCopy?: (item: RecentItem) => void;
455
+ onRecentItemHover?: (recentItemId: string | null) => void;
456
+ onRecentCopyAll?: () => void;
457
+ onRecentCopyAllHover?: (isHovered: boolean) => void;
458
+ onRecentClear?: () => void;
459
+ onRecentDismiss?: () => void;
425
460
  }
426
461
  interface GrabbedBox {
427
462
  id: string;
@@ -301,6 +301,12 @@ interface ToolbarState {
301
301
  collapsed: boolean;
302
302
  enabled: boolean;
303
303
  }
304
+ interface DropdownAnchor {
305
+ x: number;
306
+ y: number;
307
+ edge: ToolbarState["edge"];
308
+ toolbarWidth: number;
309
+ }
304
310
  interface ReactGrabAPI {
305
311
  activate: () => void;
306
312
  deactivate: () => void;
@@ -337,6 +343,9 @@ interface SelectionLabelInstance {
337
343
  tagName: string;
338
344
  componentName?: string;
339
345
  status: SelectionLabelStatus;
346
+ statusText?: string;
347
+ isPromptMode?: boolean;
348
+ inputValue?: string;
340
349
  createdAt: number;
341
350
  element?: Element;
342
351
  elements?: Element[];
@@ -344,6 +353,17 @@ interface SelectionLabelInstance {
344
353
  mouseXOffsetFromCenter?: number;
345
354
  mouseXOffsetRatio?: number;
346
355
  errorMessage?: string;
356
+ hideArrow?: boolean;
357
+ }
358
+ interface RecentItem {
359
+ id: string;
360
+ content: string;
361
+ elementName: string;
362
+ tagName: string;
363
+ componentName?: string;
364
+ isComment: boolean;
365
+ commentText?: string;
366
+ timestamp: number;
347
367
  }
348
368
  interface ReactGrabRendererProps {
349
369
  selectionVisible?: boolean;
@@ -410,6 +430,7 @@ interface ReactGrabRendererProps {
410
430
  onToolbarStateChange?: (state: ToolbarState) => void;
411
431
  onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
412
432
  onToolbarSelectHoverChange?: (isHovered: boolean) => void;
433
+ onToolbarRef?: (element: HTMLDivElement) => void;
413
434
  contextMenuPosition?: {
414
435
  x: number;
415
436
  y: number;
@@ -422,6 +443,20 @@ interface ReactGrabRendererProps {
422
443
  actionContext?: ActionContext;
423
444
  onContextMenuDismiss?: () => void;
424
445
  onContextMenuHide?: () => void;
446
+ recentItems?: RecentItem[];
447
+ recentItemCount?: number;
448
+ hasUnreadRecentItems?: boolean;
449
+ recentDropdownPosition?: DropdownAnchor | null;
450
+ onToggleRecent?: () => void;
451
+ onRecentButtonHover?: (isHovered: boolean) => void;
452
+ onRecentItemSelect?: (item: RecentItem) => void;
453
+ onRecentItemRemove?: (item: RecentItem) => void;
454
+ onRecentItemCopy?: (item: RecentItem) => void;
455
+ onRecentItemHover?: (recentItemId: string | null) => void;
456
+ onRecentCopyAll?: () => void;
457
+ onRecentCopyAllHover?: (isHovered: boolean) => void;
458
+ onRecentClear?: () => void;
459
+ onRecentDismiss?: () => void;
425
460
  }
426
461
  interface GrabbedBox {
427
462
  id: string;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunk2T22V7DM_cjs=require('./chunk-2T22V7DM.cjs');/**
1
+ 'use strict';var chunkHH5Y6LBC_cjs=require('./chunk-HH5Y6LBC.cjs');/**
2
2
  * @license MIT
3
3
  *
4
4
  * Copyright (c) 2025 Aiden Bai
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- var e=null,R=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,g=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=chunk2T22V7DM_cjs.o(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.g}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.n}});Object.defineProperty(exports,"copyHtmlPlugin",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.l}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.h}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.a}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.i}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.m}});Object.defineProperty(exports,"screenshotPlugin",{enumerable:true,get:function(){return chunk2T22V7DM_cjs.k}});exports.getGlobalApi=R;exports.setGlobalApi=g;
9
+ var e=null,R=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,g=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=chunkHH5Y6LBC_cjs.o(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.g}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.n}});Object.defineProperty(exports,"copyHtmlPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.l}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.h}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.a}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.i}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.m}});Object.defineProperty(exports,"screenshotPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.k}});exports.getGlobalApi=R;exports.setGlobalApi=g;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Plugin, R as ReactGrabAPI } from './index-CNwr6CHX.cjs';
2
- export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-CNwr6CHX.cjs';
1
+ import { P as Plugin, R as ReactGrabAPI } from './index-KT3jIAik.cjs';
2
+ export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-KT3jIAik.cjs';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Plugin, R as ReactGrabAPI } from './index-CNwr6CHX.js';
2
- export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-CNwr6CHX.js';
1
+ import { P as Plugin, R as ReactGrabAPI } from './index-KT3jIAik.js';
2
+ export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-KT3jIAik.js';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5