react-grab 0.0.71 → 0.0.72

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.
@@ -119,6 +119,7 @@ interface AgentProvider<T = any> {
119
119
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
120
120
  resume?: (sessionId: string, signal: AbortSignal, storage: AgentSessionStorage) => AsyncIterable<string>;
121
121
  supportsResume?: boolean;
122
+ checkConnection?: () => Promise<boolean>;
122
123
  }
123
124
  interface AgentSessionStorage {
124
125
  getItem(key: string): string | null;
@@ -129,9 +130,9 @@ interface AgentOptions<T = any> {
129
130
  provider?: AgentProvider<T>;
130
131
  storage?: AgentSessionStorage | null;
131
132
  getOptions?: () => T;
132
- onStart?: (session: AgentSession) => void;
133
+ onStart?: (session: AgentSession, element: Element | undefined) => void;
133
134
  onStatus?: (status: string, session: AgentSession) => void;
134
- onComplete?: (session: AgentSession) => void;
135
+ onComplete?: (session: AgentSession, element: Element | undefined) => void;
135
136
  onError?: (error: Error, session: AgentSession) => void;
136
137
  onResume?: (session: AgentSession) => void;
137
138
  onAbort?: (session: AgentSession, element: Element | undefined) => void;
@@ -219,12 +220,16 @@ interface ReactGrabRendererProps {
219
220
  inputValue?: string;
220
221
  isInputExpanded?: boolean;
221
222
  hasAgent?: boolean;
223
+ isAgentConnected?: boolean;
222
224
  agentSessions?: Map<string, AgentSession>;
223
225
  onAbortSession?: (sessionId: string) => void;
224
226
  onInputChange?: (value: string) => void;
225
227
  onInputSubmit?: () => void;
226
228
  onInputCancel?: () => void;
227
229
  onToggleExpand?: () => void;
230
+ isPendingDismiss?: boolean;
231
+ onConfirmDismiss?: () => void;
232
+ onCancelDismiss?: () => void;
228
233
  nativeSelectionCursorVisible?: boolean;
229
234
  nativeSelectionCursorX?: number;
230
235
  nativeSelectionCursorY?: number;
@@ -119,6 +119,7 @@ interface AgentProvider<T = any> {
119
119
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
120
120
  resume?: (sessionId: string, signal: AbortSignal, storage: AgentSessionStorage) => AsyncIterable<string>;
121
121
  supportsResume?: boolean;
122
+ checkConnection?: () => Promise<boolean>;
122
123
  }
123
124
  interface AgentSessionStorage {
124
125
  getItem(key: string): string | null;
@@ -129,9 +130,9 @@ interface AgentOptions<T = any> {
129
130
  provider?: AgentProvider<T>;
130
131
  storage?: AgentSessionStorage | null;
131
132
  getOptions?: () => T;
132
- onStart?: (session: AgentSession) => void;
133
+ onStart?: (session: AgentSession, element: Element | undefined) => void;
133
134
  onStatus?: (status: string, session: AgentSession) => void;
134
- onComplete?: (session: AgentSession) => void;
135
+ onComplete?: (session: AgentSession, element: Element | undefined) => void;
135
136
  onError?: (error: Error, session: AgentSession) => void;
136
137
  onResume?: (session: AgentSession) => void;
137
138
  onAbort?: (session: AgentSession, element: Element | undefined) => void;
@@ -219,12 +220,16 @@ interface ReactGrabRendererProps {
219
220
  inputValue?: string;
220
221
  isInputExpanded?: boolean;
221
222
  hasAgent?: boolean;
223
+ isAgentConnected?: boolean;
222
224
  agentSessions?: Map<string, AgentSession>;
223
225
  onAbortSession?: (sessionId: string) => void;
224
226
  onInputChange?: (value: string) => void;
225
227
  onInputSubmit?: () => void;
226
228
  onInputCancel?: () => void;
227
229
  onToggleExpand?: () => void;
230
+ isPendingDismiss?: boolean;
231
+ onConfirmDismiss?: () => void;
232
+ onCancelDismiss?: () => void;
228
233
  nativeSelectionCursorVisible?: boolean;
229
234
  nativeSelectionCursorX?: number;
230
235
  nativeSelectionCursorY?: number;
package/dist/core.cjs CHANGED
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkRPPUX2ZU_cjs = require('./chunk-RPPUX2ZU.cjs');
3
+ var chunkGFBDYRPI_cjs = require('./chunk-GFBDYRPI.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "DEFAULT_THEME", {
8
8
  enumerable: true,
9
- get: function () { return chunkRPPUX2ZU_cjs.DEFAULT_THEME; }
9
+ get: function () { return chunkGFBDYRPI_cjs.DEFAULT_THEME; }
10
10
  });
11
11
  Object.defineProperty(exports, "formatElementInfo", {
12
12
  enumerable: true,
13
- get: function () { return chunkRPPUX2ZU_cjs.getElementContext; }
13
+ get: function () { return chunkGFBDYRPI_cjs.getElementContext; }
14
14
  });
15
15
  Object.defineProperty(exports, "generateSnippet", {
16
16
  enumerable: true,
17
- get: function () { return chunkRPPUX2ZU_cjs.generateSnippet; }
17
+ get: function () { return chunkGFBDYRPI_cjs.generateSnippet; }
18
18
  });
19
19
  Object.defineProperty(exports, "getStack", {
20
20
  enumerable: true,
21
- get: function () { return chunkRPPUX2ZU_cjs.getStack; }
21
+ get: function () { return chunkGFBDYRPI_cjs.getStack; }
22
22
  });
23
23
  Object.defineProperty(exports, "init", {
24
24
  enumerable: true,
25
- get: function () { return chunkRPPUX2ZU_cjs.init; }
25
+ get: function () { return chunkGFBDYRPI_cjs.init; }
26
26
  });
27
27
  Object.defineProperty(exports, "isInstrumentationActive", {
28
28
  enumerable: true,
29
- get: function () { return chunkRPPUX2ZU_cjs.Ee; }
29
+ get: function () { return chunkGFBDYRPI_cjs.Ee; }
30
30
  });
package/dist/core.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { 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, o as ReactGrabRendererProps, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-Dm5hxkI3.cjs';
1
+ export { 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, o as ReactGrabRendererProps, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-HtZR37lF.cjs';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { 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, o as ReactGrabRendererProps, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-Dm5hxkI3.js';
1
+ export { 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, o as ReactGrabRendererProps, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-HtZR37lF.js';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-HJLMLJJA.js';
1
+ export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-DZ2VZRJA.js';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRPPUX2ZU_cjs = require('./chunk-RPPUX2ZU.cjs');
3
+ var chunkGFBDYRPI_cjs = require('./chunk-GFBDYRPI.cjs');
4
4
 
5
5
  /**
6
6
  * @license MIT
@@ -31,7 +31,7 @@ if (typeof window !== "undefined") {
31
31
  if (window.__REACT_GRAB__) {
32
32
  globalApi = window.__REACT_GRAB__;
33
33
  } else {
34
- globalApi = chunkRPPUX2ZU_cjs.init();
34
+ globalApi = chunkGFBDYRPI_cjs.init();
35
35
  window.__REACT_GRAB__ = globalApi;
36
36
  window.dispatchEvent(
37
37
  new CustomEvent("react-grab:init", { detail: globalApi })
@@ -41,27 +41,27 @@ if (typeof window !== "undefined") {
41
41
 
42
42
  Object.defineProperty(exports, "DEFAULT_THEME", {
43
43
  enumerable: true,
44
- get: function () { return chunkRPPUX2ZU_cjs.DEFAULT_THEME; }
44
+ get: function () { return chunkGFBDYRPI_cjs.DEFAULT_THEME; }
45
45
  });
46
46
  Object.defineProperty(exports, "formatElementInfo", {
47
47
  enumerable: true,
48
- get: function () { return chunkRPPUX2ZU_cjs.getElementContext; }
48
+ get: function () { return chunkGFBDYRPI_cjs.getElementContext; }
49
49
  });
50
50
  Object.defineProperty(exports, "generateSnippet", {
51
51
  enumerable: true,
52
- get: function () { return chunkRPPUX2ZU_cjs.generateSnippet; }
52
+ get: function () { return chunkGFBDYRPI_cjs.generateSnippet; }
53
53
  });
54
54
  Object.defineProperty(exports, "getStack", {
55
55
  enumerable: true,
56
- get: function () { return chunkRPPUX2ZU_cjs.getStack; }
56
+ get: function () { return chunkGFBDYRPI_cjs.getStack; }
57
57
  });
58
58
  Object.defineProperty(exports, "init", {
59
59
  enumerable: true,
60
- get: function () { return chunkRPPUX2ZU_cjs.init; }
60
+ get: function () { return chunkGFBDYRPI_cjs.init; }
61
61
  });
62
62
  Object.defineProperty(exports, "isInstrumentationActive", {
63
63
  enumerable: true,
64
- get: function () { return chunkRPPUX2ZU_cjs.Ee; }
64
+ get: function () { return chunkGFBDYRPI_cjs.Ee; }
65
65
  });
66
66
  exports.getGlobalApi = getGlobalApi;
67
67
  exports.setGlobalApi = setGlobalApi;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactGrabAPI } from './core-Dm5hxkI3.cjs';
2
- export { 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, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-Dm5hxkI3.cjs';
1
+ import { R as ReactGrabAPI } from './core-HtZR37lF.cjs';
2
+ export { 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, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-HtZR37lF.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-Dm5hxkI3.js';
2
- export { 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, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-Dm5hxkI3.js';
1
+ import { R as ReactGrabAPI } from './core-HtZR37lF.js';
2
+ export { 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, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-HtZR37lF.js';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5