react-grab 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-KEHU35AI.cjs +118 -0
- package/dist/chunk-TT33H3TZ.js +118 -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/{index-BCkTVQa8.d.cts → index-BgQgrh_y.d.cts} +3 -12
- package/dist/{index-BCkTVQa8.d.ts → index-BgQgrh_y.d.ts} +3 -12
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -15
- package/dist/index.d.ts +3 -15
- package/dist/index.global.js +34 -28
- package/dist/index.js +2 -2
- package/dist/react.cjs +274 -306
- package/dist/react.d.cts +1 -10
- package/dist/react.d.ts +1 -10
- package/dist/react.js +274 -306
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-ILQ5JMGX.cjs +0 -112
- package/dist/chunk-WBYGVXEQ.js +0 -112
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkKEHU35AI_cjs=require('../chunk-KEHU35AI.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.f}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.i}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.a}});
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { x 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, z as PluginConfig, B as PluginHooks, R as ReactGrabAPI, F as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, H as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { x 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, z as PluginConfig, B as PluginHooks, R as ReactGrabAPI, F as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, H as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BgQgrh_y.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 { x 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, z as PluginConfig, B as PluginHooks, R as ReactGrabAPI, F as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, H as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { x 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, z as PluginConfig, B as PluginHooks, R as ReactGrabAPI, F as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, H as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BgQgrh_y.js';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{f as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,i as init,a as isInstrumentationActive}from'../chunk-TT33H3TZ.js';
|
|
@@ -187,7 +187,6 @@ interface AgentOptions<T = any> {
|
|
|
187
187
|
type ActivationMode = "toggle" | "hold";
|
|
188
188
|
interface ActionContextHooks {
|
|
189
189
|
transformHtmlContent: (html: string, elements: Element[]) => Promise<string>;
|
|
190
|
-
transformScreenshot: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Promise<Blob>;
|
|
191
190
|
onOpenFile: (filePath: string, lineNumber?: number) => boolean | void;
|
|
192
191
|
transformOpenFileUrl: (url: string, filePath: string, lineNumber?: number) => string;
|
|
193
192
|
}
|
|
@@ -202,8 +201,6 @@ interface ActionContext {
|
|
|
202
201
|
hooks: ActionContextHooks;
|
|
203
202
|
performWithFeedback: (action: () => Promise<boolean>) => Promise<void>;
|
|
204
203
|
hideContextMenu: () => void;
|
|
205
|
-
hideOverlay: () => void;
|
|
206
|
-
showOverlay: () => void;
|
|
207
204
|
cleanup: () => void;
|
|
208
205
|
}
|
|
209
206
|
interface ContextMenuActionContext extends ActionContext {
|
|
@@ -228,12 +225,6 @@ interface ActionCycleState {
|
|
|
228
225
|
activeIndex: number | null;
|
|
229
226
|
isVisible: boolean;
|
|
230
227
|
}
|
|
231
|
-
interface ScreenshotBounds {
|
|
232
|
-
x: number;
|
|
233
|
-
y: number;
|
|
234
|
-
width: number;
|
|
235
|
-
height: number;
|
|
236
|
-
}
|
|
237
228
|
interface PluginHooks {
|
|
238
229
|
onActivate?: () => void;
|
|
239
230
|
onDeactivate?: () => void;
|
|
@@ -260,7 +251,6 @@ interface PluginHooks {
|
|
|
260
251
|
}) => void;
|
|
261
252
|
onOpenFile?: (filePath: string, lineNumber?: number) => boolean | void;
|
|
262
253
|
transformHtmlContent?: (html: string, elements: Element[]) => string | Promise<string>;
|
|
263
|
-
transformScreenshot?: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Blob | Promise<Blob>;
|
|
264
254
|
transformAgentContext?: (context: AgentContext, elements: Element[]) => AgentContext | Promise<AgentContext>;
|
|
265
255
|
transformActionContext?: (context: ActionContext) => ActionContext;
|
|
266
256
|
transformOpenFileUrl?: (url: string, filePath: string, lineNumber?: number) => string;
|
|
@@ -340,6 +330,7 @@ interface ReactGrabAPI {
|
|
|
340
330
|
dispose: () => void;
|
|
341
331
|
copyElement: (elements: Element | Element[]) => Promise<boolean>;
|
|
342
332
|
getSource: (element: Element) => Promise<SourceInfo | null>;
|
|
333
|
+
getStackContext: (element: Element) => Promise<string>;
|
|
343
334
|
getState: () => ReactGrabState;
|
|
344
335
|
setOptions: (options: SettableOptions) => void;
|
|
345
336
|
registerPlugin: (plugin: Plugin) => void;
|
|
@@ -513,10 +504,10 @@ interface DragRect {
|
|
|
513
504
|
}
|
|
514
505
|
|
|
515
506
|
declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
|
|
516
|
-
interface
|
|
507
|
+
interface StackContextOptions {
|
|
517
508
|
maxLines?: number;
|
|
518
509
|
}
|
|
519
|
-
declare const getElementContext: (element: Element, options?:
|
|
510
|
+
declare const getElementContext: (element: Element, options?: StackContextOptions) => Promise<string>;
|
|
520
511
|
|
|
521
512
|
declare const DEFAULT_THEME: Required<Theme>;
|
|
522
513
|
|
|
@@ -187,7 +187,6 @@ interface AgentOptions<T = any> {
|
|
|
187
187
|
type ActivationMode = "toggle" | "hold";
|
|
188
188
|
interface ActionContextHooks {
|
|
189
189
|
transformHtmlContent: (html: string, elements: Element[]) => Promise<string>;
|
|
190
|
-
transformScreenshot: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Promise<Blob>;
|
|
191
190
|
onOpenFile: (filePath: string, lineNumber?: number) => boolean | void;
|
|
192
191
|
transformOpenFileUrl: (url: string, filePath: string, lineNumber?: number) => string;
|
|
193
192
|
}
|
|
@@ -202,8 +201,6 @@ interface ActionContext {
|
|
|
202
201
|
hooks: ActionContextHooks;
|
|
203
202
|
performWithFeedback: (action: () => Promise<boolean>) => Promise<void>;
|
|
204
203
|
hideContextMenu: () => void;
|
|
205
|
-
hideOverlay: () => void;
|
|
206
|
-
showOverlay: () => void;
|
|
207
204
|
cleanup: () => void;
|
|
208
205
|
}
|
|
209
206
|
interface ContextMenuActionContext extends ActionContext {
|
|
@@ -228,12 +225,6 @@ interface ActionCycleState {
|
|
|
228
225
|
activeIndex: number | null;
|
|
229
226
|
isVisible: boolean;
|
|
230
227
|
}
|
|
231
|
-
interface ScreenshotBounds {
|
|
232
|
-
x: number;
|
|
233
|
-
y: number;
|
|
234
|
-
width: number;
|
|
235
|
-
height: number;
|
|
236
|
-
}
|
|
237
228
|
interface PluginHooks {
|
|
238
229
|
onActivate?: () => void;
|
|
239
230
|
onDeactivate?: () => void;
|
|
@@ -260,7 +251,6 @@ interface PluginHooks {
|
|
|
260
251
|
}) => void;
|
|
261
252
|
onOpenFile?: (filePath: string, lineNumber?: number) => boolean | void;
|
|
262
253
|
transformHtmlContent?: (html: string, elements: Element[]) => string | Promise<string>;
|
|
263
|
-
transformScreenshot?: (blob: Blob, elements: Element[], bounds: ScreenshotBounds) => Blob | Promise<Blob>;
|
|
264
254
|
transformAgentContext?: (context: AgentContext, elements: Element[]) => AgentContext | Promise<AgentContext>;
|
|
265
255
|
transformActionContext?: (context: ActionContext) => ActionContext;
|
|
266
256
|
transformOpenFileUrl?: (url: string, filePath: string, lineNumber?: number) => string;
|
|
@@ -340,6 +330,7 @@ interface ReactGrabAPI {
|
|
|
340
330
|
dispose: () => void;
|
|
341
331
|
copyElement: (elements: Element | Element[]) => Promise<boolean>;
|
|
342
332
|
getSource: (element: Element) => Promise<SourceInfo | null>;
|
|
333
|
+
getStackContext: (element: Element) => Promise<string>;
|
|
343
334
|
getState: () => ReactGrabState;
|
|
344
335
|
setOptions: (options: SettableOptions) => void;
|
|
345
336
|
registerPlugin: (plugin: Plugin) => void;
|
|
@@ -513,10 +504,10 @@ interface DragRect {
|
|
|
513
504
|
}
|
|
514
505
|
|
|
515
506
|
declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
|
|
516
|
-
interface
|
|
507
|
+
interface StackContextOptions {
|
|
517
508
|
maxLines?: number;
|
|
518
509
|
}
|
|
519
|
-
declare const getElementContext: (element: Element, options?:
|
|
510
|
+
declare const getElementContext: (element: Element, options?: StackContextOptions) => Promise<string>;
|
|
520
511
|
|
|
521
512
|
declare const DEFAULT_THEME: Required<Theme>;
|
|
522
513
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkKEHU35AI_cjs=require('./chunk-KEHU35AI.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,d=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,c=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=chunkKEHU35AI_cjs.i(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.g}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.i}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.a}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkKEHU35AI_cjs.h}});exports.getGlobalApi=d;exports.setGlobalApi=c;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Plugin, R as ReactGrabAPI } from './index-
|
|
2
|
-
export { x as ActionContext, y 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, w as PluginAction, z as PluginConfig, B as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, v as ToolbarMenuAction, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { P as Plugin, R as ReactGrabAPI } from './index-BgQgrh_y.cjs';
|
|
2
|
+
export { x as ActionContext, y 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, w as PluginAction, z as PluginConfig, B as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, v as ToolbarMenuAction, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BgQgrh_y.cjs';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|
|
@@ -7,18 +7,6 @@ declare const commentPlugin: Plugin;
|
|
|
7
7
|
|
|
8
8
|
declare const openPlugin: Plugin;
|
|
9
9
|
|
|
10
|
-
interface ElementBounds {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
}
|
|
16
|
-
declare const combineBounds: (boundsList: ElementBounds[]) => ElementBounds;
|
|
17
|
-
declare const captureElementScreenshot: (bounds: ElementBounds) => Promise<Blob>;
|
|
18
|
-
declare const copyImageToClipboard: (blob: Blob) => Promise<boolean>;
|
|
19
|
-
|
|
20
|
-
declare const isScreenshotSupported: () => boolean;
|
|
21
|
-
|
|
22
10
|
declare global {
|
|
23
11
|
interface Window {
|
|
24
12
|
__REACT_GRAB__?: ReactGrabAPI;
|
|
@@ -27,4 +15,4 @@ declare global {
|
|
|
27
15
|
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
28
16
|
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
29
17
|
|
|
30
|
-
export {
|
|
18
|
+
export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, setGlobalApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Plugin, R as ReactGrabAPI } from './index-
|
|
2
|
-
export { x as ActionContext, y 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, w as PluginAction, z as PluginConfig, B as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, v as ToolbarMenuAction, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { P as Plugin, R as ReactGrabAPI } from './index-BgQgrh_y.js';
|
|
2
|
+
export { x as ActionContext, y 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, w as PluginAction, z as PluginConfig, B as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, v as ToolbarMenuAction, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BgQgrh_y.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|
|
@@ -7,18 +7,6 @@ declare const commentPlugin: Plugin;
|
|
|
7
7
|
|
|
8
8
|
declare const openPlugin: Plugin;
|
|
9
9
|
|
|
10
|
-
interface ElementBounds {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
}
|
|
16
|
-
declare const combineBounds: (boundsList: ElementBounds[]) => ElementBounds;
|
|
17
|
-
declare const captureElementScreenshot: (bounds: ElementBounds) => Promise<Blob>;
|
|
18
|
-
declare const copyImageToClipboard: (blob: Blob) => Promise<boolean>;
|
|
19
|
-
|
|
20
|
-
declare const isScreenshotSupported: () => boolean;
|
|
21
|
-
|
|
22
10
|
declare global {
|
|
23
11
|
interface Window {
|
|
24
12
|
__REACT_GRAB__?: ReactGrabAPI;
|
|
@@ -27,4 +15,4 @@ declare global {
|
|
|
27
15
|
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
28
16
|
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
29
17
|
|
|
30
|
-
export {
|
|
18
|
+
export { Plugin, ReactGrabAPI, commentPlugin, getGlobalApi, openPlugin, setGlobalApi };
|