react-grab 0.0.71 → 0.0.73
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 +1 -1
- package/dist/{chunk-RPPUX2ZU.cjs → chunk-6ZPKD3CA.cjs} +548 -210
- package/dist/{chunk-HJLMLJJA.js → chunk-KXX6WKZA.js} +548 -210
- package/dist/{core-Dm5hxkI3.d.cts → core-eQvDkDGv.d.cts} +12 -2
- package/dist/{core-Dm5hxkI3.d.ts → core-eQvDkDGv.d.ts} +12 -2
- package/dist/core.cjs +7 -7
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +27 -27
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -119,6 +119,9 @@ 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>;
|
|
123
|
+
getCompletionMessage?: () => string | undefined;
|
|
124
|
+
undo?: () => Promise<void>;
|
|
122
125
|
}
|
|
123
126
|
interface AgentSessionStorage {
|
|
124
127
|
getItem(key: string): string | null;
|
|
@@ -129,12 +132,13 @@ interface AgentOptions<T = any> {
|
|
|
129
132
|
provider?: AgentProvider<T>;
|
|
130
133
|
storage?: AgentSessionStorage | null;
|
|
131
134
|
getOptions?: () => T;
|
|
132
|
-
onStart?: (session: AgentSession) => void;
|
|
135
|
+
onStart?: (session: AgentSession, element: Element | undefined) => void;
|
|
133
136
|
onStatus?: (status: string, session: AgentSession) => void;
|
|
134
|
-
onComplete?: (session: AgentSession) => void;
|
|
137
|
+
onComplete?: (session: AgentSession, element: Element | undefined) => void;
|
|
135
138
|
onError?: (error: Error, session: AgentSession) => void;
|
|
136
139
|
onResume?: (session: AgentSession) => void;
|
|
137
140
|
onAbort?: (session: AgentSession, element: Element | undefined) => void;
|
|
141
|
+
onUndo?: (session: AgentSession, element: Element | undefined) => void;
|
|
138
142
|
}
|
|
139
143
|
interface Options {
|
|
140
144
|
enabled?: boolean;
|
|
@@ -219,12 +223,18 @@ interface ReactGrabRendererProps {
|
|
|
219
223
|
inputValue?: string;
|
|
220
224
|
isInputExpanded?: boolean;
|
|
221
225
|
hasAgent?: boolean;
|
|
226
|
+
isAgentConnected?: boolean;
|
|
222
227
|
agentSessions?: Map<string, AgentSession>;
|
|
223
228
|
onAbortSession?: (sessionId: string) => void;
|
|
229
|
+
onDismissSession?: (sessionId: string) => void;
|
|
230
|
+
onUndoSession?: (sessionId: string) => void;
|
|
224
231
|
onInputChange?: (value: string) => void;
|
|
225
232
|
onInputSubmit?: () => void;
|
|
226
233
|
onInputCancel?: () => void;
|
|
227
234
|
onToggleExpand?: () => void;
|
|
235
|
+
isPendingDismiss?: boolean;
|
|
236
|
+
onConfirmDismiss?: () => void;
|
|
237
|
+
onCancelDismiss?: () => void;
|
|
228
238
|
nativeSelectionCursorVisible?: boolean;
|
|
229
239
|
nativeSelectionCursorX?: number;
|
|
230
240
|
nativeSelectionCursorY?: number;
|
|
@@ -119,6 +119,9 @@ 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>;
|
|
123
|
+
getCompletionMessage?: () => string | undefined;
|
|
124
|
+
undo?: () => Promise<void>;
|
|
122
125
|
}
|
|
123
126
|
interface AgentSessionStorage {
|
|
124
127
|
getItem(key: string): string | null;
|
|
@@ -129,12 +132,13 @@ interface AgentOptions<T = any> {
|
|
|
129
132
|
provider?: AgentProvider<T>;
|
|
130
133
|
storage?: AgentSessionStorage | null;
|
|
131
134
|
getOptions?: () => T;
|
|
132
|
-
onStart?: (session: AgentSession) => void;
|
|
135
|
+
onStart?: (session: AgentSession, element: Element | undefined) => void;
|
|
133
136
|
onStatus?: (status: string, session: AgentSession) => void;
|
|
134
|
-
onComplete?: (session: AgentSession) => void;
|
|
137
|
+
onComplete?: (session: AgentSession, element: Element | undefined) => void;
|
|
135
138
|
onError?: (error: Error, session: AgentSession) => void;
|
|
136
139
|
onResume?: (session: AgentSession) => void;
|
|
137
140
|
onAbort?: (session: AgentSession, element: Element | undefined) => void;
|
|
141
|
+
onUndo?: (session: AgentSession, element: Element | undefined) => void;
|
|
138
142
|
}
|
|
139
143
|
interface Options {
|
|
140
144
|
enabled?: boolean;
|
|
@@ -219,12 +223,18 @@ interface ReactGrabRendererProps {
|
|
|
219
223
|
inputValue?: string;
|
|
220
224
|
isInputExpanded?: boolean;
|
|
221
225
|
hasAgent?: boolean;
|
|
226
|
+
isAgentConnected?: boolean;
|
|
222
227
|
agentSessions?: Map<string, AgentSession>;
|
|
223
228
|
onAbortSession?: (sessionId: string) => void;
|
|
229
|
+
onDismissSession?: (sessionId: string) => void;
|
|
230
|
+
onUndoSession?: (sessionId: string) => void;
|
|
224
231
|
onInputChange?: (value: string) => void;
|
|
225
232
|
onInputSubmit?: () => void;
|
|
226
233
|
onInputCancel?: () => void;
|
|
227
234
|
onToggleExpand?: () => void;
|
|
235
|
+
isPendingDismiss?: boolean;
|
|
236
|
+
onConfirmDismiss?: () => void;
|
|
237
|
+
onCancelDismiss?: () => void;
|
|
228
238
|
nativeSelectionCursorVisible?: boolean;
|
|
229
239
|
nativeSelectionCursorX?: number;
|
|
230
240
|
nativeSelectionCursorY?: number;
|
package/dist/core.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6ZPKD3CA_cjs = require('./chunk-6ZPKD3CA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "DEFAULT_THEME", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk6ZPKD3CA_cjs.DEFAULT_THEME; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "formatElementInfo", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk6ZPKD3CA_cjs.getElementContext; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "generateSnippet", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk6ZPKD3CA_cjs.generateSnippet; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getStack", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk6ZPKD3CA_cjs.getStack; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "init", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk6ZPKD3CA_cjs.init; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "isInstrumentationActive", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk6ZPKD3CA_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-
|
|
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-eQvDkDGv.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-
|
|
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-eQvDkDGv.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-
|
|
1
|
+
export { DEFAULT_THEME, getElementContext as formatElementInfo, generateSnippet, getStack, init, Ee as isInstrumentationActive } from './chunk-KXX6WKZA.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6ZPKD3CA_cjs = require('./chunk-6ZPKD3CA.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 =
|
|
34
|
+
globalApi = chunk6ZPKD3CA_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
|
|
44
|
+
get: function () { return chunk6ZPKD3CA_cjs.DEFAULT_THEME; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "formatElementInfo", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunk6ZPKD3CA_cjs.getElementContext; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "generateSnippet", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk6ZPKD3CA_cjs.generateSnippet; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "getStack", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunk6ZPKD3CA_cjs.getStack; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "init", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunk6ZPKD3CA_cjs.init; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "isInstrumentationActive", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunk6ZPKD3CA_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-
|
|
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-
|
|
1
|
+
import { R as ReactGrabAPI } from './core-eQvDkDGv.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-eQvDkDGv.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 { 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-
|
|
1
|
+
import { R as ReactGrabAPI } from './core-eQvDkDGv.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-eQvDkDGv.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|