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.
- package/README.md +11 -144
- package/dist/chunk-C3OKAL36.cjs +106 -0
- package/dist/chunk-HJNRIQQU.js +10 -0
- package/dist/chunk-JUZ7A2AH.cjs +10 -0
- package/dist/chunk-L4ETY7XR.js +106 -0
- package/dist/chunk-NSV5NCCE.cjs +11 -0
- package/dist/chunk-O7JC46TI.js +11 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/design-system.cjs +1 -0
- package/dist/design-system.d.cts +6 -0
- package/dist/design-system.d.ts +6 -0
- package/dist/design-system.js +1 -0
- package/dist/{index-BUAJ3r2H.d.cts → index-S4g1Qwb1.d.cts} +60 -8
- package/dist/{index-BUAJ3r2H.d.ts → index-S4g1Qwb1.d.ts} +60 -8
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.global.js +46 -39
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +26 -26
- package/dist/chunk-TGBOP4IE.js +0 -100
- package/dist/chunk-Z3K3UAJ3.cjs +0 -100
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
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}});
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
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';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
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';
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as DEFAULT_THEME,
|
|
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 @@
|
|
|
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:
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
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-
|
|
2
|
-
export {
|
|
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-
|
|
2
|
-
export {
|
|
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 };
|