react-grab 0.0.84 → 0.0.86
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 +30 -10
- package/dist/chunk-K2CSJXO2.cjs +96 -0
- package/dist/chunk-ZX3YNVV2.js +96 -0
- package/dist/cli.cjs +134 -130
- package/dist/{core-fiyB3sPz.d.cts → core-C_EM9u4S.d.cts} +14 -1
- package/dist/{core-fiyB3sPz.d.ts → core-C_EM9u4S.d.ts} +14 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +26 -26
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/dist/chunk-4RMN66RZ.js +0 -96
- package/dist/chunk-KH3NPZ2C.cjs +0 -96
|
@@ -124,6 +124,7 @@ interface AgentProvider<T = any> {
|
|
|
124
124
|
abort?: (sessionId: string) => Promise<void>;
|
|
125
125
|
supportsResume?: boolean;
|
|
126
126
|
supportsFollowUp?: boolean;
|
|
127
|
+
dismissButtonText?: string;
|
|
127
128
|
checkConnection?: () => Promise<boolean>;
|
|
128
129
|
getCompletionMessage?: () => string | undefined;
|
|
129
130
|
undo?: () => Promise<void>;
|
|
@@ -148,8 +149,10 @@ interface AgentOptions<T = any> {
|
|
|
148
149
|
onAbort?: (session: AgentSession, element: Element | undefined) => void;
|
|
149
150
|
onUndo?: (session: AgentSession, element: Element | undefined) => void;
|
|
150
151
|
}
|
|
152
|
+
type ActivationMode = "toggle" | "hold";
|
|
151
153
|
interface Options {
|
|
152
154
|
enabled?: boolean;
|
|
155
|
+
activationMode?: ActivationMode;
|
|
153
156
|
keyHoldDuration?: number;
|
|
154
157
|
allowActivationInsideInput?: boolean;
|
|
155
158
|
maxContextLines?: number;
|
|
@@ -258,6 +261,7 @@ interface ReactGrabRendererProps {
|
|
|
258
261
|
agentSessions?: Map<string, AgentSession>;
|
|
259
262
|
supportsUndo?: boolean;
|
|
260
263
|
supportsFollowUp?: boolean;
|
|
264
|
+
dismissButtonText?: string;
|
|
261
265
|
onAbortSession?: (sessionId: string) => void;
|
|
262
266
|
onDismissSession?: (sessionId: string) => void;
|
|
263
267
|
onUndoSession?: (sessionId: string) => void;
|
|
@@ -271,6 +275,9 @@ interface ReactGrabRendererProps {
|
|
|
271
275
|
isPendingDismiss?: boolean;
|
|
272
276
|
onConfirmDismiss?: () => void;
|
|
273
277
|
onCancelDismiss?: () => void;
|
|
278
|
+
isPendingAgentAbort?: boolean;
|
|
279
|
+
onConfirmAgentAbort?: () => void;
|
|
280
|
+
onCancelAgentAbort?: () => void;
|
|
274
281
|
nativeSelectionCursorVisible?: boolean;
|
|
275
282
|
nativeSelectionCursorX?: number;
|
|
276
283
|
nativeSelectionCursorY?: number;
|
|
@@ -313,6 +320,12 @@ interface GenerateSnippetOptions {
|
|
|
313
320
|
}
|
|
314
321
|
declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOptions) => Promise<string>;
|
|
315
322
|
|
|
323
|
+
interface CopyContentOptions {
|
|
324
|
+
onSuccess?: () => void;
|
|
325
|
+
prompt?: string;
|
|
326
|
+
}
|
|
327
|
+
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
328
|
+
|
|
316
329
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
317
330
|
|
|
318
|
-
export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type InputModeContext as I, type Options as O, type ReactGrabAPI as R, type Theme as T, type UpdatableOptions as U, 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
|
|
331
|
+
export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type InputModeContext as I, type Options as O, type ReactGrabAPI as R, type Theme as T, type UpdatableOptions as U, 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 ActivationMode as p, type ReactGrabRendererProps as q, copyContent as r };
|
|
@@ -124,6 +124,7 @@ interface AgentProvider<T = any> {
|
|
|
124
124
|
abort?: (sessionId: string) => Promise<void>;
|
|
125
125
|
supportsResume?: boolean;
|
|
126
126
|
supportsFollowUp?: boolean;
|
|
127
|
+
dismissButtonText?: string;
|
|
127
128
|
checkConnection?: () => Promise<boolean>;
|
|
128
129
|
getCompletionMessage?: () => string | undefined;
|
|
129
130
|
undo?: () => Promise<void>;
|
|
@@ -148,8 +149,10 @@ interface AgentOptions<T = any> {
|
|
|
148
149
|
onAbort?: (session: AgentSession, element: Element | undefined) => void;
|
|
149
150
|
onUndo?: (session: AgentSession, element: Element | undefined) => void;
|
|
150
151
|
}
|
|
152
|
+
type ActivationMode = "toggle" | "hold";
|
|
151
153
|
interface Options {
|
|
152
154
|
enabled?: boolean;
|
|
155
|
+
activationMode?: ActivationMode;
|
|
153
156
|
keyHoldDuration?: number;
|
|
154
157
|
allowActivationInsideInput?: boolean;
|
|
155
158
|
maxContextLines?: number;
|
|
@@ -258,6 +261,7 @@ interface ReactGrabRendererProps {
|
|
|
258
261
|
agentSessions?: Map<string, AgentSession>;
|
|
259
262
|
supportsUndo?: boolean;
|
|
260
263
|
supportsFollowUp?: boolean;
|
|
264
|
+
dismissButtonText?: string;
|
|
261
265
|
onAbortSession?: (sessionId: string) => void;
|
|
262
266
|
onDismissSession?: (sessionId: string) => void;
|
|
263
267
|
onUndoSession?: (sessionId: string) => void;
|
|
@@ -271,6 +275,9 @@ interface ReactGrabRendererProps {
|
|
|
271
275
|
isPendingDismiss?: boolean;
|
|
272
276
|
onConfirmDismiss?: () => void;
|
|
273
277
|
onCancelDismiss?: () => void;
|
|
278
|
+
isPendingAgentAbort?: boolean;
|
|
279
|
+
onConfirmAgentAbort?: () => void;
|
|
280
|
+
onCancelAgentAbort?: () => void;
|
|
274
281
|
nativeSelectionCursorVisible?: boolean;
|
|
275
282
|
nativeSelectionCursorX?: number;
|
|
276
283
|
nativeSelectionCursorY?: number;
|
|
@@ -313,6 +320,12 @@ interface GenerateSnippetOptions {
|
|
|
313
320
|
}
|
|
314
321
|
declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOptions) => Promise<string>;
|
|
315
322
|
|
|
323
|
+
interface CopyContentOptions {
|
|
324
|
+
onSuccess?: () => void;
|
|
325
|
+
prompt?: string;
|
|
326
|
+
}
|
|
327
|
+
declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
|
|
328
|
+
|
|
316
329
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
317
330
|
|
|
318
|
-
export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type InputModeContext as I, type Options as O, type ReactGrabAPI as R, type Theme as T, type UpdatableOptions as U, 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
|
|
331
|
+
export { type AgentContext as A, type CrosshairContext as C, DEFAULT_THEME as D, type ElementLabelVariant as E, type GrabbedBox as G, type InputModeContext as I, type Options as O, type ReactGrabAPI as R, type Theme as T, type UpdatableOptions as U, 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 ActivationMode as p, type ReactGrabRendererProps as q, copyContent as r };
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkK2CSJXO2_cjs=require('./chunk-K2CSJXO2.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.e}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.a}});
|
package/dist/core.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI,
|
|
1
|
+
export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-C_EM9u4S.cjs';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { o as AgentCompleteResult, A as AgentContext, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI,
|
|
1
|
+
export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-C_EM9u4S.js';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{e as DEFAULT_THEME,d as copyContent,c as formatElementInfo,f as generateSnippet,b as getStack,g as init,a as isInstrumentationActive}from'./chunk-ZX3YNVV2.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkK2CSJXO2_cjs=require('./chunk-K2CSJXO2.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,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=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=
|
|
9
|
+
var e=null,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=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=chunkK2CSJXO2_cjs.g(),window.__REACT_GRAB__=e,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e}))));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.e}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkK2CSJXO2_cjs.a}});exports.getGlobalApi=A;exports.setGlobalApi=d;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReactGrabAPI } from './core-
|
|
2
|
-
export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-
|
|
1
|
+
import { R as ReactGrabAPI } from './core-C_EM9u4S.cjs';
|
|
2
|
+
export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-C_EM9u4S.cjs';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReactGrabAPI } from './core-
|
|
2
|
-
export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-
|
|
1
|
+
import { R as ReactGrabAPI } from './core-C_EM9u4S.js';
|
|
2
|
+
export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-C_EM9u4S.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|