grab 0.1.0-beta.11 → 0.1.0-beta.13

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 chunkZ3K3UAJ3_cjs=require('../chunk-Z3K3UAJ3.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.e}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.c}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.k}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.b}});
1
+ 'use strict';var chunkC3OKAL36_cjs=require('../chunk-C3OKAL36.cjs');require('../chunk-NSV5NCCE.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.a}});
@@ -1,3 +1,3 @@
1
- export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BUAJ3r2H.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-S4g1Qwb1.cjs';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
@@ -1,3 +1,3 @@
1
- export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BUAJ3r2H.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-S4g1Qwb1.js';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
@@ -1 +1 @@
1
- export{j as DEFAULT_THEME,e as copyContent,d as formatElementInfo,f as generateSnippet,c as getStack,k as init,b as isInstrumentationActive}from'../chunk-TGBOP4IE.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-L4ETY7XR.js';import'../chunk-O7JC46TI.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJUZ7A2AH_cjs=require('./chunk-JUZ7A2AH.cjs');require('./chunk-NSV5NCCE.cjs');Object.defineProperty(exports,"renderDesignSystemPreview",{enumerable:true,get:function(){return chunkJUZ7A2AH_cjs.a}});
@@ -0,0 +1,6 @@
1
+ interface DesignSystemPreviewOptions {
2
+ onDispose?: () => void;
3
+ }
4
+ declare const renderDesignSystemPreview: (container: HTMLElement, options?: DesignSystemPreviewOptions) => (() => void);
5
+
6
+ export { type DesignSystemPreviewOptions, renderDesignSystemPreview };
@@ -0,0 +1,6 @@
1
+ interface DesignSystemPreviewOptions {
2
+ onDispose?: () => void;
3
+ }
4
+ declare const renderDesignSystemPreview: (container: HTMLElement, options?: DesignSystemPreviewOptions) => (() => void);
5
+
6
+ export { type DesignSystemPreviewOptions, renderDesignSystemPreview };
@@ -0,0 +1 @@
1
+ export{a as renderDesignSystemPreview}from'./chunk-HJNRIQQU.js';import'./chunk-O7JC46TI.js';
@@ -96,6 +96,7 @@ interface ReactGrabState {
96
96
  createdAt: number;
97
97
  }>;
98
98
  selectionFilePath: string | null;
99
+ toolbarState: ToolbarState | null;
99
100
  }
100
101
  type ElementLabelVariant = "hover" | "processing" | "success";
101
102
  interface PromptModeContext {
@@ -177,6 +178,12 @@ interface AgentOptions<T = any> {
177
178
  onDismiss?: (session: AgentSession, elements: Element[]) => void;
178
179
  }
179
180
  type ActivationMode = "toggle" | "hold";
181
+ interface ActionContextHooks {
182
+ transformHtmlContent: (html: string, elements: Element[]) => Promise<string>;
183
+ transformScreenshot: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Promise<Blob>;
184
+ onOpenFile: (filePath: string, lineNumber?: number) => boolean | void;
185
+ transformOpenFileUrl: (url: string, filePath: string, lineNumber?: number) => string;
186
+ }
180
187
  interface ActionContext {
181
188
  element: Element;
182
189
  elements: Element[];
@@ -185,15 +192,30 @@ interface ActionContext {
185
192
  componentName?: string;
186
193
  tagName?: string;
187
194
  enterPromptMode?: (agent?: AgentOptions) => void;
195
+ hooks: ActionContextHooks;
196
+ performWithFeedback: (action: () => Promise<boolean>) => Promise<void>;
197
+ hideContextMenu: () => void;
198
+ hideOverlay: () => void;
199
+ showOverlay: () => void;
200
+ cleanup: () => void;
201
+ }
202
+ interface ContextMenuActionContext extends ActionContext {
203
+ copy?: () => void;
188
204
  }
189
205
  interface ContextMenuAction {
190
206
  id: string;
191
207
  label: string;
192
208
  shortcut?: string;
193
209
  enabled?: boolean | ((context: ActionContext) => boolean);
194
- onAction: (context: ActionContext) => void;
210
+ onAction: (context: ContextMenuActionContext) => void | Promise<void>;
195
211
  agent?: AgentOptions;
196
212
  }
213
+ interface ScreenshotBounds {
214
+ x: number;
215
+ y: number;
216
+ width: number;
217
+ height: number;
218
+ }
197
219
  interface PluginHooks {
198
220
  onActivate?: () => void;
199
221
  onDeactivate?: () => void;
@@ -202,6 +224,7 @@ interface PluginHooks {
202
224
  onDragStart?: (startX: number, startY: number) => void;
203
225
  onDragEnd?: (elements: Element[], bounds: DragRect) => void;
204
226
  onBeforeCopy?: (elements: Element[]) => void | Promise<void>;
227
+ transformCopyContent?: (content: string, elements: Element[]) => string | Promise<string>;
205
228
  onAfterCopy?: (elements: Element[], success: boolean) => void;
206
229
  onCopySuccess?: (elements: Element[], content: string) => void;
207
230
  onCopyError?: (error: Error) => void;
@@ -217,6 +240,12 @@ interface PluginHooks {
217
240
  y: number;
218
241
  }) => void;
219
242
  onOpenFile?: (filePath: string, lineNumber?: number) => boolean | void;
243
+ transformHtmlContent?: (html: string, elements: Element[]) => string | Promise<string>;
244
+ transformScreenshot?: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Blob | Promise<Blob>;
245
+ transformAgentContext?: (context: AgentContext, elements: Element[]) => AgentContext | Promise<AgentContext>;
246
+ transformActionContext?: (context: ActionContext) => ActionContext;
247
+ transformOpenFileUrl?: (url: string, filePath: string, lineNumber?: number) => string;
248
+ transformSnippet?: (snippet: string, element: Element) => string | Promise<string>;
220
249
  }
221
250
  interface PluginConfig {
222
251
  theme?: DeepPartial<Theme>;
@@ -241,18 +270,37 @@ interface Options {
241
270
  maxContextLines?: number;
242
271
  activationKey?: ActivationKey;
243
272
  getContent?: (elements: Element[]) => Promise<string> | string;
273
+ /**
274
+ * Whether to freeze React state updates while React Grab is active.
275
+ * This prevents UI changes from interfering with element selection.
276
+ * @default true
277
+ */
278
+ freezeReactUpdates?: boolean;
279
+ }
280
+ interface SettableOptions extends Options {
281
+ enabled?: never;
244
282
  }
245
- type SettableOptions = Omit<Options, "enabled">;
246
283
  interface SourceInfo {
247
284
  filePath: string;
248
285
  lineNumber: number | null;
249
286
  componentName: string | null;
250
287
  }
288
+ interface ToolbarState {
289
+ edge: "top" | "bottom" | "left" | "right";
290
+ ratio: number;
291
+ collapsed: boolean;
292
+ enabled: boolean;
293
+ }
251
294
  interface ReactGrabAPI {
252
295
  activate: () => void;
253
296
  deactivate: () => void;
254
297
  toggle: () => void;
255
298
  isActive: () => boolean;
299
+ isEnabled: () => boolean;
300
+ setEnabled: (enabled: boolean) => void;
301
+ getToolbarState: () => ToolbarState | null;
302
+ setToolbarState: (state: Partial<ToolbarState>) => void;
303
+ onToolbarStateChange: (callback: (state: ToolbarState) => void) => () => void;
256
304
  dispose: () => void;
257
305
  copyElement: (elements: Element | Element[]) => Promise<boolean>;
258
306
  getSource: (element: Element) => Promise<SourceInfo | null>;
@@ -284,12 +332,14 @@ interface SelectionLabelInstance {
284
332
  elements?: Element[];
285
333
  mouseX?: number;
286
334
  mouseXOffsetFromCenter?: number;
335
+ mouseXOffsetRatio?: number;
287
336
  errorMessage?: string;
288
337
  }
289
338
  interface ReactGrabRendererProps {
290
339
  selectionVisible?: boolean;
291
340
  selectionBounds?: OverlayBounds;
292
341
  selectionBoundsMultiple?: OverlayBounds[];
342
+ selectionShouldSnap?: boolean;
293
343
  selectionElementsCount?: number;
294
344
  selectionFilePath?: string;
295
345
  selectionLineNumber?: number;
@@ -309,6 +359,7 @@ interface ReactGrabRendererProps {
309
359
  mouseX?: number;
310
360
  mouseY?: number;
311
361
  crosshairVisible?: boolean;
362
+ isFrozen?: boolean;
312
363
  inputValue?: string;
313
364
  isPromptMode?: boolean;
314
365
  replyToPrompt?: string;
@@ -327,6 +378,7 @@ interface ReactGrabRendererProps {
327
378
  onRetrySession?: (sessionId: string) => void;
328
379
  onShowContextMenuSession?: (sessionId: string) => void;
329
380
  onShowContextMenuInstance?: (instanceId: string) => void;
381
+ onLabelInstanceHoverChange?: (instanceId: string, isHovered: boolean) => void;
330
382
  onInputChange?: (value: string) => void;
331
383
  onInputSubmit?: () => void;
332
384
  onInputCancel?: () => void;
@@ -341,6 +393,10 @@ interface ReactGrabRendererProps {
341
393
  onToggleActive?: () => void;
342
394
  enabled?: boolean;
343
395
  onToggleEnabled?: () => void;
396
+ shakeCount?: number;
397
+ onToolbarStateChange?: (state: ToolbarState) => void;
398
+ onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
399
+ onToolbarSelectHoverChange?: (isHovered: boolean) => void;
344
400
  contextMenuPosition?: {
345
401
  x: number;
346
402
  y: number;
@@ -351,10 +407,6 @@ interface ReactGrabRendererProps {
351
407
  contextMenuHasFilePath?: boolean;
352
408
  actions?: ContextMenuAction[];
353
409
  actionContext?: ActionContext;
354
- onContextMenuCopy?: () => void;
355
- onContextMenuCopyScreenshot?: () => void;
356
- onContextMenuCopyHtml?: () => void;
357
- onContextMenuOpen?: () => void;
358
410
  onContextMenuDismiss?: () => void;
359
411
  onContextMenuHide?: () => void;
360
412
  }
@@ -392,10 +444,10 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
392
444
 
393
445
  interface CopyContentOptions {
394
446
  onSuccess?: () => void;
395
- prompt?: string;
447
+ name?: string;
396
448
  }
397
449
  declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
398
450
 
399
451
  declare const init: (rawOptions?: Options) => ReactGrabAPI;
400
452
 
401
- export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type Options as O, type PromptModeContext as P, type ReactGrabAPI as R, type SourceInfo as S, type Theme as T, getElementContext as a, generateSnippet as b, type ReactGrabState as c, type OverlayBounds as d, type DragRect as e, type Rect as f, getStack as g, type DeepPartial as h, init as i, type ElementLabelContext as j, type AgentSession as k, type AgentProvider as l, type AgentSessionStorage as m, type AgentOptions as n, type AgentCompleteResult as o, type SettableOptions as p, type ActivationMode as q, type ContextMenuAction as r, type ActionContext as s, type Plugin as t, type PluginConfig as u, type PluginHooks as v, type ReactGrabRendererProps as w, copyContent as x };
453
+ export { type AgentContext as A, copyContent as B, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type Options as O, type Plugin as P, type ReactGrabAPI as R, type SourceInfo as S, type Theme as T, getElementContext as a, generateSnippet as b, type ReactGrabState as c, type ToolbarState as d, type OverlayBounds as e, type DragRect as f, getStack as g, type Rect as h, init as i, type DeepPartial as j, type PromptModeContext as k, type ElementLabelContext as l, type AgentSession as m, type AgentProvider as n, type AgentSessionStorage as o, type AgentOptions as p, type AgentCompleteResult as q, type SettableOptions as r, type ActivationMode as s, type ContextMenuAction as t, type ContextMenuActionContext as u, type ActionContext as v, type ActionContextHooks as w, type PluginConfig as x, type PluginHooks as y, type ReactGrabRendererProps as z };
@@ -96,6 +96,7 @@ interface ReactGrabState {
96
96
  createdAt: number;
97
97
  }>;
98
98
  selectionFilePath: string | null;
99
+ toolbarState: ToolbarState | null;
99
100
  }
100
101
  type ElementLabelVariant = "hover" | "processing" | "success";
101
102
  interface PromptModeContext {
@@ -177,6 +178,12 @@ interface AgentOptions<T = any> {
177
178
  onDismiss?: (session: AgentSession, elements: Element[]) => void;
178
179
  }
179
180
  type ActivationMode = "toggle" | "hold";
181
+ interface ActionContextHooks {
182
+ transformHtmlContent: (html: string, elements: Element[]) => Promise<string>;
183
+ transformScreenshot: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Promise<Blob>;
184
+ onOpenFile: (filePath: string, lineNumber?: number) => boolean | void;
185
+ transformOpenFileUrl: (url: string, filePath: string, lineNumber?: number) => string;
186
+ }
180
187
  interface ActionContext {
181
188
  element: Element;
182
189
  elements: Element[];
@@ -185,15 +192,30 @@ interface ActionContext {
185
192
  componentName?: string;
186
193
  tagName?: string;
187
194
  enterPromptMode?: (agent?: AgentOptions) => void;
195
+ hooks: ActionContextHooks;
196
+ performWithFeedback: (action: () => Promise<boolean>) => Promise<void>;
197
+ hideContextMenu: () => void;
198
+ hideOverlay: () => void;
199
+ showOverlay: () => void;
200
+ cleanup: () => void;
201
+ }
202
+ interface ContextMenuActionContext extends ActionContext {
203
+ copy?: () => void;
188
204
  }
189
205
  interface ContextMenuAction {
190
206
  id: string;
191
207
  label: string;
192
208
  shortcut?: string;
193
209
  enabled?: boolean | ((context: ActionContext) => boolean);
194
- onAction: (context: ActionContext) => void;
210
+ onAction: (context: ContextMenuActionContext) => void | Promise<void>;
195
211
  agent?: AgentOptions;
196
212
  }
213
+ interface ScreenshotBounds {
214
+ x: number;
215
+ y: number;
216
+ width: number;
217
+ height: number;
218
+ }
197
219
  interface PluginHooks {
198
220
  onActivate?: () => void;
199
221
  onDeactivate?: () => void;
@@ -202,6 +224,7 @@ interface PluginHooks {
202
224
  onDragStart?: (startX: number, startY: number) => void;
203
225
  onDragEnd?: (elements: Element[], bounds: DragRect) => void;
204
226
  onBeforeCopy?: (elements: Element[]) => void | Promise<void>;
227
+ transformCopyContent?: (content: string, elements: Element[]) => string | Promise<string>;
205
228
  onAfterCopy?: (elements: Element[], success: boolean) => void;
206
229
  onCopySuccess?: (elements: Element[], content: string) => void;
207
230
  onCopyError?: (error: Error) => void;
@@ -217,6 +240,12 @@ interface PluginHooks {
217
240
  y: number;
218
241
  }) => void;
219
242
  onOpenFile?: (filePath: string, lineNumber?: number) => boolean | void;
243
+ transformHtmlContent?: (html: string, elements: Element[]) => string | Promise<string>;
244
+ transformScreenshot?: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Blob | Promise<Blob>;
245
+ transformAgentContext?: (context: AgentContext, elements: Element[]) => AgentContext | Promise<AgentContext>;
246
+ transformActionContext?: (context: ActionContext) => ActionContext;
247
+ transformOpenFileUrl?: (url: string, filePath: string, lineNumber?: number) => string;
248
+ transformSnippet?: (snippet: string, element: Element) => string | Promise<string>;
220
249
  }
221
250
  interface PluginConfig {
222
251
  theme?: DeepPartial<Theme>;
@@ -241,18 +270,37 @@ interface Options {
241
270
  maxContextLines?: number;
242
271
  activationKey?: ActivationKey;
243
272
  getContent?: (elements: Element[]) => Promise<string> | string;
273
+ /**
274
+ * Whether to freeze React state updates while React Grab is active.
275
+ * This prevents UI changes from interfering with element selection.
276
+ * @default true
277
+ */
278
+ freezeReactUpdates?: boolean;
279
+ }
280
+ interface SettableOptions extends Options {
281
+ enabled?: never;
244
282
  }
245
- type SettableOptions = Omit<Options, "enabled">;
246
283
  interface SourceInfo {
247
284
  filePath: string;
248
285
  lineNumber: number | null;
249
286
  componentName: string | null;
250
287
  }
288
+ interface ToolbarState {
289
+ edge: "top" | "bottom" | "left" | "right";
290
+ ratio: number;
291
+ collapsed: boolean;
292
+ enabled: boolean;
293
+ }
251
294
  interface ReactGrabAPI {
252
295
  activate: () => void;
253
296
  deactivate: () => void;
254
297
  toggle: () => void;
255
298
  isActive: () => boolean;
299
+ isEnabled: () => boolean;
300
+ setEnabled: (enabled: boolean) => void;
301
+ getToolbarState: () => ToolbarState | null;
302
+ setToolbarState: (state: Partial<ToolbarState>) => void;
303
+ onToolbarStateChange: (callback: (state: ToolbarState) => void) => () => void;
256
304
  dispose: () => void;
257
305
  copyElement: (elements: Element | Element[]) => Promise<boolean>;
258
306
  getSource: (element: Element) => Promise<SourceInfo | null>;
@@ -284,12 +332,14 @@ interface SelectionLabelInstance {
284
332
  elements?: Element[];
285
333
  mouseX?: number;
286
334
  mouseXOffsetFromCenter?: number;
335
+ mouseXOffsetRatio?: number;
287
336
  errorMessage?: string;
288
337
  }
289
338
  interface ReactGrabRendererProps {
290
339
  selectionVisible?: boolean;
291
340
  selectionBounds?: OverlayBounds;
292
341
  selectionBoundsMultiple?: OverlayBounds[];
342
+ selectionShouldSnap?: boolean;
293
343
  selectionElementsCount?: number;
294
344
  selectionFilePath?: string;
295
345
  selectionLineNumber?: number;
@@ -309,6 +359,7 @@ interface ReactGrabRendererProps {
309
359
  mouseX?: number;
310
360
  mouseY?: number;
311
361
  crosshairVisible?: boolean;
362
+ isFrozen?: boolean;
312
363
  inputValue?: string;
313
364
  isPromptMode?: boolean;
314
365
  replyToPrompt?: string;
@@ -327,6 +378,7 @@ interface ReactGrabRendererProps {
327
378
  onRetrySession?: (sessionId: string) => void;
328
379
  onShowContextMenuSession?: (sessionId: string) => void;
329
380
  onShowContextMenuInstance?: (instanceId: string) => void;
381
+ onLabelInstanceHoverChange?: (instanceId: string, isHovered: boolean) => void;
330
382
  onInputChange?: (value: string) => void;
331
383
  onInputSubmit?: () => void;
332
384
  onInputCancel?: () => void;
@@ -341,6 +393,10 @@ interface ReactGrabRendererProps {
341
393
  onToggleActive?: () => void;
342
394
  enabled?: boolean;
343
395
  onToggleEnabled?: () => void;
396
+ shakeCount?: number;
397
+ onToolbarStateChange?: (state: ToolbarState) => void;
398
+ onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
399
+ onToolbarSelectHoverChange?: (isHovered: boolean) => void;
344
400
  contextMenuPosition?: {
345
401
  x: number;
346
402
  y: number;
@@ -351,10 +407,6 @@ interface ReactGrabRendererProps {
351
407
  contextMenuHasFilePath?: boolean;
352
408
  actions?: ContextMenuAction[];
353
409
  actionContext?: ActionContext;
354
- onContextMenuCopy?: () => void;
355
- onContextMenuCopyScreenshot?: () => void;
356
- onContextMenuCopyHtml?: () => void;
357
- onContextMenuOpen?: () => void;
358
410
  onContextMenuDismiss?: () => void;
359
411
  onContextMenuHide?: () => void;
360
412
  }
@@ -392,10 +444,10 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
392
444
 
393
445
  interface CopyContentOptions {
394
446
  onSuccess?: () => void;
395
- prompt?: string;
447
+ name?: string;
396
448
  }
397
449
  declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
398
450
 
399
451
  declare const init: (rawOptions?: Options) => ReactGrabAPI;
400
452
 
401
- export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type Options as O, type PromptModeContext as P, type ReactGrabAPI as R, type SourceInfo as S, type Theme as T, getElementContext as a, generateSnippet as b, type ReactGrabState as c, type OverlayBounds as d, type DragRect as e, type Rect as f, getStack as g, type DeepPartial as h, init as i, type ElementLabelContext as j, type AgentSession as k, type AgentProvider as l, type AgentSessionStorage as m, type AgentOptions as n, type AgentCompleteResult as o, type SettableOptions as p, type ActivationMode as q, type ContextMenuAction as r, type ActionContext as s, type Plugin as t, type PluginConfig as u, type PluginHooks as v, type ReactGrabRendererProps as w, copyContent as x };
453
+ export { type AgentContext as A, copyContent as B, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type Options as O, type Plugin as P, type ReactGrabAPI as R, type SourceInfo as S, type Theme as T, getElementContext as a, generateSnippet as b, type ReactGrabState as c, type ToolbarState as d, type OverlayBounds as e, type DragRect as f, getStack as g, type Rect as h, init as i, type DeepPartial as j, type PromptModeContext as k, type ElementLabelContext as l, type AgentSession as m, type AgentProvider as n, type AgentSessionStorage as o, type AgentOptions as p, type AgentCompleteResult as q, type SettableOptions as r, type ActivationMode as s, type ContextMenuAction as t, type ContextMenuActionContext as u, type ActionContext as v, type ActionContextHooks as w, type PluginConfig as x, type PluginHooks as y, type ReactGrabRendererProps as z };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkZ3K3UAJ3_cjs=require('./chunk-Z3K3UAJ3.cjs');/**
1
+ 'use strict';var chunkJUZ7A2AH_cjs=require('./chunk-JUZ7A2AH.cjs'),chunkC3OKAL36_cjs=require('./chunk-C3OKAL36.cjs');require('./chunk-NSV5NCCE.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,c=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,f=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=chunkZ3K3UAJ3_cjs.k(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.h}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.g}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.i}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.c}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.k}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.b}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkZ3K3UAJ3_cjs.a}});exports.getGlobalApi=c;exports.setGlobalApi=f;
9
+ var e=null,x=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,R=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=chunkC3OKAL36_cjs.o(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"renderDesignSystemPreview",{enumerable:true,get:function(){return chunkJUZ7A2AH_cjs.a}});Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.g}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.n}});Object.defineProperty(exports,"copyHtmlPlugin",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.l}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.h}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.a}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.i}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.m}});Object.defineProperty(exports,"screenshotPlugin",{enumerable:true,get:function(){return chunkC3OKAL36_cjs.k}});exports.getGlobalApi=x;exports.setGlobalApi=R;
package/dist/index.d.cts CHANGED
@@ -1,8 +1,17 @@
1
- import { R as ReactGrabAPI } from './index-BUAJ3r2H.cjs';
2
- export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BUAJ3r2H.cjs';
1
+ import { P as Plugin, R as ReactGrabAPI } from './index-S4g1Qwb1.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-S4g1Qwb1.cjs';
3
+ export { renderDesignSystemPreview } from './design-system.cjs';
3
4
  export { isInstrumentationActive } from 'bippy';
4
5
  import 'bippy/source';
5
6
 
7
+ declare const screenshotPlugin: Plugin;
8
+
9
+ declare const copyHtmlPlugin: Plugin;
10
+
11
+ declare const openPlugin: Plugin;
12
+
13
+ declare const commentPlugin: Plugin;
14
+
6
15
  interface ElementBounds {
7
16
  x: number;
8
17
  y: number;
@@ -23,4 +32,4 @@ declare global {
23
32
  declare const getGlobalApi: () => ReactGrabAPI | null;
24
33
  declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
25
34
 
26
- export { type ElementBounds, ReactGrabAPI, captureElementScreenshot, combineBounds, copyImageToClipboard, getGlobalApi, isScreenshotSupported, setGlobalApi };
35
+ export { type ElementBounds, Plugin, ReactGrabAPI, captureElementScreenshot, combineBounds, commentPlugin, copyHtmlPlugin, copyImageToClipboard, getGlobalApi, isScreenshotSupported, openPlugin, screenshotPlugin, setGlobalApi };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,17 @@
1
- import { R as ReactGrabAPI } from './index-BUAJ3r2H.js';
2
- export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BUAJ3r2H.js';
1
+ import { P as Plugin, R as ReactGrabAPI } from './index-S4g1Qwb1.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-S4g1Qwb1.js';
3
+ export { renderDesignSystemPreview } from './design-system.js';
3
4
  export { isInstrumentationActive } from 'bippy';
4
5
  import 'bippy/source';
5
6
 
7
+ declare const screenshotPlugin: Plugin;
8
+
9
+ declare const copyHtmlPlugin: Plugin;
10
+
11
+ declare const openPlugin: Plugin;
12
+
13
+ declare const commentPlugin: Plugin;
14
+
6
15
  interface ElementBounds {
7
16
  x: number;
8
17
  y: number;
@@ -23,4 +32,4 @@ declare global {
23
32
  declare const getGlobalApi: () => ReactGrabAPI | null;
24
33
  declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
25
34
 
26
- export { type ElementBounds, ReactGrabAPI, captureElementScreenshot, combineBounds, copyImageToClipboard, getGlobalApi, isScreenshotSupported, setGlobalApi };
35
+ export { type ElementBounds, Plugin, ReactGrabAPI, captureElementScreenshot, combineBounds, commentPlugin, copyHtmlPlugin, copyImageToClipboard, getGlobalApi, isScreenshotSupported, openPlugin, screenshotPlugin, setGlobalApi };