react-grab 0.1.0-beta.9 → 0.1.0
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-HCYXMFM5.js +106 -0
- package/dist/chunk-JZQKRZKT.cjs +11 -0
- package/dist/chunk-RGULZA2C.cjs +10 -0
- package/dist/chunk-SN5X5ZH7.cjs +106 -0
- package/dist/chunk-VGVCPQB7.js +11 -0
- package/dist/chunk-YHIWC7YD.js +10 -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-CNbOr8nS.d.cts} +62 -8
- package/dist/{index-BUAJ3r2H.d.ts → index-CNbOr8nS.d.ts} +62 -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 -29
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +31 -32
- package/dist/chunk-JB7MX447.js +0 -90
- package/dist/chunk-XBEIVCZ6.cjs +0 -90
|
@@ -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;
|
|
@@ -338,9 +390,15 @@ interface ReactGrabRendererProps {
|
|
|
338
390
|
theme?: Required<Theme>;
|
|
339
391
|
toolbarVisible?: boolean;
|
|
340
392
|
isActive?: boolean;
|
|
393
|
+
isCommentMode?: boolean;
|
|
341
394
|
onToggleActive?: () => void;
|
|
395
|
+
onComment?: () => void;
|
|
342
396
|
enabled?: boolean;
|
|
343
397
|
onToggleEnabled?: () => void;
|
|
398
|
+
shakeCount?: number;
|
|
399
|
+
onToolbarStateChange?: (state: ToolbarState) => void;
|
|
400
|
+
onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
|
|
401
|
+
onToolbarSelectHoverChange?: (isHovered: boolean) => void;
|
|
344
402
|
contextMenuPosition?: {
|
|
345
403
|
x: number;
|
|
346
404
|
y: number;
|
|
@@ -351,10 +409,6 @@ interface ReactGrabRendererProps {
|
|
|
351
409
|
contextMenuHasFilePath?: boolean;
|
|
352
410
|
actions?: ContextMenuAction[];
|
|
353
411
|
actionContext?: ActionContext;
|
|
354
|
-
onContextMenuCopy?: () => void;
|
|
355
|
-
onContextMenuCopyScreenshot?: () => void;
|
|
356
|
-
onContextMenuCopyHtml?: () => void;
|
|
357
|
-
onContextMenuOpen?: () => void;
|
|
358
412
|
onContextMenuDismiss?: () => void;
|
|
359
413
|
onContextMenuHide?: () => void;
|
|
360
414
|
}
|
|
@@ -392,10 +446,10 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
|
|
|
392
446
|
|
|
393
447
|
interface CopyContentOptions {
|
|
394
448
|
onSuccess?: () => void;
|
|
395
|
-
|
|
449
|
+
name?: string;
|
|
396
450
|
}
|
|
397
451
|
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
398
452
|
|
|
399
453
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
400
454
|
|
|
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
|
|
455
|
+
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;
|
|
@@ -338,9 +390,15 @@ interface ReactGrabRendererProps {
|
|
|
338
390
|
theme?: Required<Theme>;
|
|
339
391
|
toolbarVisible?: boolean;
|
|
340
392
|
isActive?: boolean;
|
|
393
|
+
isCommentMode?: boolean;
|
|
341
394
|
onToggleActive?: () => void;
|
|
395
|
+
onComment?: () => void;
|
|
342
396
|
enabled?: boolean;
|
|
343
397
|
onToggleEnabled?: () => void;
|
|
398
|
+
shakeCount?: number;
|
|
399
|
+
onToolbarStateChange?: (state: ToolbarState) => void;
|
|
400
|
+
onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
|
|
401
|
+
onToolbarSelectHoverChange?: (isHovered: boolean) => void;
|
|
344
402
|
contextMenuPosition?: {
|
|
345
403
|
x: number;
|
|
346
404
|
y: number;
|
|
@@ -351,10 +409,6 @@ interface ReactGrabRendererProps {
|
|
|
351
409
|
contextMenuHasFilePath?: boolean;
|
|
352
410
|
actions?: ContextMenuAction[];
|
|
353
411
|
actionContext?: ActionContext;
|
|
354
|
-
onContextMenuCopy?: () => void;
|
|
355
|
-
onContextMenuCopyScreenshot?: () => void;
|
|
356
|
-
onContextMenuCopyHtml?: () => void;
|
|
357
|
-
onContextMenuOpen?: () => void;
|
|
358
412
|
onContextMenuDismiss?: () => void;
|
|
359
413
|
onContextMenuHide?: () => void;
|
|
360
414
|
}
|
|
@@ -392,10 +446,10 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
|
|
|
392
446
|
|
|
393
447
|
interface CopyContentOptions {
|
|
394
448
|
onSuccess?: () => void;
|
|
395
|
-
|
|
449
|
+
name?: string;
|
|
396
450
|
}
|
|
397
451
|
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
398
452
|
|
|
399
453
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
400
454
|
|
|
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
|
|
455
|
+
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 chunkRGULZA2C_cjs=require('./chunk-RGULZA2C.cjs'),chunkSN5X5ZH7_cjs=require('./chunk-SN5X5ZH7.cjs');require('./chunk-JZQKRZKT.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=chunkSN5X5ZH7_cjs.o(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"renderDesignSystemPreview",{enumerable:true,get:function(){return chunkRGULZA2C_cjs.a}});Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.g}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.n}});Object.defineProperty(exports,"copyHtmlPlugin",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.l}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.h}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.a}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.i}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkSN5X5ZH7_cjs.m}});Object.defineProperty(exports,"screenshotPlugin",{enumerable:true,get:function(){return chunkSN5X5ZH7_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-CNbOr8nS.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-CNbOr8nS.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-CNbOr8nS.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-CNbOr8nS.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 };
|