react-grab 0.0.76 → 0.0.77

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.
@@ -114,6 +114,7 @@ interface AgentSession {
114
114
  selectionBounds?: OverlayBounds;
115
115
  tagName?: string;
116
116
  componentName?: string;
117
+ error?: string;
117
118
  }
118
119
  interface AgentProvider<T = any> {
119
120
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
@@ -128,13 +129,16 @@ interface AgentSessionStorage {
128
129
  setItem(key: string, value: string): void;
129
130
  removeItem(key: string): void;
130
131
  }
132
+ interface AgentCompleteResult {
133
+ error?: string;
134
+ }
131
135
  interface AgentOptions<T = any> {
132
136
  provider?: AgentProvider<T>;
133
137
  storage?: AgentSessionStorage | null;
134
138
  getOptions?: () => T;
135
139
  onStart?: (session: AgentSession, element: Element | undefined) => void;
136
140
  onStatus?: (status: string, session: AgentSession) => void;
137
- onComplete?: (session: AgentSession, element: Element | undefined) => void;
141
+ onComplete?: (session: AgentSession, element: Element | undefined) => AgentCompleteResult | void;
138
142
  onError?: (error: Error, session: AgentSession) => void;
139
143
  onResume?: (session: AgentSession) => void;
140
144
  onAbort?: (session: AgentSession, element: Element | undefined) => void;
@@ -249,6 +253,7 @@ interface ReactGrabRendererProps {
249
253
  onAbortSession?: (sessionId: string) => void;
250
254
  onDismissSession?: (sessionId: string) => void;
251
255
  onUndoSession?: (sessionId: string) => void;
256
+ onAcknowledgeSessionError?: (sessionId: string) => void;
252
257
  onInputChange?: (value: string) => void;
253
258
  onInputSubmit?: () => void;
254
259
  onInputCancel?: () => void;
@@ -300,4 +305,4 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
300
305
 
301
306
  declare const init: (rawOptions?: Options) => ReactGrabAPI;
302
307
 
303
- 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 ReactGrabRendererProps as o };
308
+ 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 ReactGrabRendererProps as p };
@@ -114,6 +114,7 @@ interface AgentSession {
114
114
  selectionBounds?: OverlayBounds;
115
115
  tagName?: string;
116
116
  componentName?: string;
117
+ error?: string;
117
118
  }
118
119
  interface AgentProvider<T = any> {
119
120
  send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
@@ -128,13 +129,16 @@ interface AgentSessionStorage {
128
129
  setItem(key: string, value: string): void;
129
130
  removeItem(key: string): void;
130
131
  }
132
+ interface AgentCompleteResult {
133
+ error?: string;
134
+ }
131
135
  interface AgentOptions<T = any> {
132
136
  provider?: AgentProvider<T>;
133
137
  storage?: AgentSessionStorage | null;
134
138
  getOptions?: () => T;
135
139
  onStart?: (session: AgentSession, element: Element | undefined) => void;
136
140
  onStatus?: (status: string, session: AgentSession) => void;
137
- onComplete?: (session: AgentSession, element: Element | undefined) => void;
141
+ onComplete?: (session: AgentSession, element: Element | undefined) => AgentCompleteResult | void;
138
142
  onError?: (error: Error, session: AgentSession) => void;
139
143
  onResume?: (session: AgentSession) => void;
140
144
  onAbort?: (session: AgentSession, element: Element | undefined) => void;
@@ -249,6 +253,7 @@ interface ReactGrabRendererProps {
249
253
  onAbortSession?: (sessionId: string) => void;
250
254
  onDismissSession?: (sessionId: string) => void;
251
255
  onUndoSession?: (sessionId: string) => void;
256
+ onAcknowledgeSessionError?: (sessionId: string) => void;
252
257
  onInputChange?: (value: string) => void;
253
258
  onInputSubmit?: () => void;
254
259
  onInputCancel?: () => void;
@@ -300,4 +305,4 @@ declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOp
300
305
 
301
306
  declare const init: (rawOptions?: Options) => ReactGrabAPI;
302
307
 
303
- 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 ReactGrabRendererProps as o };
308
+ 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 ReactGrabRendererProps as p };
package/dist/core.cjs CHANGED
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkIKBHXHKY_cjs = require('./chunk-IKBHXHKY.cjs');
3
+ var chunkRM6XONHW_cjs = require('./chunk-RM6XONHW.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "DEFAULT_THEME", {
8
8
  enumerable: true,
9
- get: function () { return chunkIKBHXHKY_cjs.DEFAULT_THEME; }
9
+ get: function () { return chunkRM6XONHW_cjs.DEFAULT_THEME; }
10
10
  });
11
11
  Object.defineProperty(exports, "formatElementInfo", {
12
12
  enumerable: true,
13
- get: function () { return chunkIKBHXHKY_cjs.getElementContext; }
13
+ get: function () { return chunkRM6XONHW_cjs.getElementContext; }
14
14
  });
15
15
  Object.defineProperty(exports, "generateSnippet", {
16
16
  enumerable: true,
17
- get: function () { return chunkIKBHXHKY_cjs.generateSnippet; }
17
+ get: function () { return chunkRM6XONHW_cjs.generateSnippet; }
18
18
  });
19
19
  Object.defineProperty(exports, "getStack", {
20
20
  enumerable: true,
21
- get: function () { return chunkIKBHXHKY_cjs.getStack; }
21
+ get: function () { return chunkRM6XONHW_cjs.getStack; }
22
22
  });
23
23
  Object.defineProperty(exports, "init", {
24
24
  enumerable: true,
25
- get: function () { return chunkIKBHXHKY_cjs.init; }
25
+ get: function () { return chunkRM6XONHW_cjs.init; }
26
26
  });
27
27
  Object.defineProperty(exports, "isInstrumentationActive", {
28
28
  enumerable: true,
29
- get: function () { return chunkIKBHXHKY_cjs.Ee; }
29
+ get: function () { return chunkRM6XONHW_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, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CzaOp9UL.cjs';
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, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.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, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CzaOp9UL.js';
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, p as ReactGrabRendererProps, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-BIJVr_bk.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-FZG56F6B.js';
1
+ export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-VOXBYN56.js';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkIKBHXHKY_cjs = require('./chunk-IKBHXHKY.cjs');
3
+ var chunkRM6XONHW_cjs = require('./chunk-RM6XONHW.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 = chunkIKBHXHKY_cjs.init();
34
+ globalApi = chunkRM6XONHW_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 chunkIKBHXHKY_cjs.DEFAULT_THEME; }
44
+ get: function () { return chunkRM6XONHW_cjs.DEFAULT_THEME; }
45
45
  });
46
46
  Object.defineProperty(exports, "formatElementInfo", {
47
47
  enumerable: true,
48
- get: function () { return chunkIKBHXHKY_cjs.getElementContext; }
48
+ get: function () { return chunkRM6XONHW_cjs.getElementContext; }
49
49
  });
50
50
  Object.defineProperty(exports, "generateSnippet", {
51
51
  enumerable: true,
52
- get: function () { return chunkIKBHXHKY_cjs.generateSnippet; }
52
+ get: function () { return chunkRM6XONHW_cjs.generateSnippet; }
53
53
  });
54
54
  Object.defineProperty(exports, "getStack", {
55
55
  enumerable: true,
56
- get: function () { return chunkIKBHXHKY_cjs.getStack; }
56
+ get: function () { return chunkRM6XONHW_cjs.getStack; }
57
57
  });
58
58
  Object.defineProperty(exports, "init", {
59
59
  enumerable: true,
60
- get: function () { return chunkIKBHXHKY_cjs.init; }
60
+ get: function () { return chunkRM6XONHW_cjs.init; }
61
61
  });
62
62
  Object.defineProperty(exports, "isInstrumentationActive", {
63
63
  enumerable: true,
64
- get: function () { return chunkIKBHXHKY_cjs.Ee; }
64
+ get: function () { return chunkRM6XONHW_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-CzaOp9UL.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, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CzaOp9UL.cjs';
1
+ import { R as ReactGrabAPI } from './core-BIJVr_bk.cjs';
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-BIJVr_bk.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-CzaOp9UL.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, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-CzaOp9UL.js';
1
+ import { R as ReactGrabAPI } from './core-BIJVr_bk.js';
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-BIJVr_bk.js';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5