react-grab 0.0.56 → 0.0.58
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-YLB7TBSB.js → chunk-3SND4D5M.js} +578 -372
- package/dist/{chunk-FXFNCH4T.cjs → chunk-T7WUJ6UX.cjs} +577 -372
- package/dist/{core-B9k7XYK9.d.cts → core--8P5lQqE.d.cts} +4 -4
- package/dist/{core-B9k7XYK9.d.ts → core--8P5lQqE.d.ts} +4 -4
- package/dist/core.cjs +8 -12
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +9 -12
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +30 -29
- package/dist/index.js +3 -2
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -207,7 +207,7 @@ interface AgentSession {
|
|
|
207
207
|
selectionBounds?: OverlayBounds;
|
|
208
208
|
tagName?: string;
|
|
209
209
|
}
|
|
210
|
-
interface AgentProvider<T =
|
|
210
|
+
interface AgentProvider<T = any> {
|
|
211
211
|
send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
|
|
212
212
|
resume?: (sessionId: string, signal: AbortSignal) => AsyncIterable<string>;
|
|
213
213
|
supportsResume?: boolean;
|
|
@@ -217,7 +217,7 @@ interface AgentSessionStorage {
|
|
|
217
217
|
setItem(key: string, value: string): void;
|
|
218
218
|
removeItem(key: string): void;
|
|
219
219
|
}
|
|
220
|
-
interface AgentOptions<T =
|
|
220
|
+
interface AgentOptions<T = any> {
|
|
221
221
|
provider?: AgentProvider<T>;
|
|
222
222
|
storage?: AgentSessionStorage | null;
|
|
223
223
|
getOptions?: () => T;
|
|
@@ -267,6 +267,7 @@ interface ReactGrabAPI {
|
|
|
267
267
|
getState: () => ReactGrabState;
|
|
268
268
|
updateTheme: (theme: DeepPartial<Theme>) => void;
|
|
269
269
|
getTheme: () => Required<Theme>;
|
|
270
|
+
setAgent: (options: AgentOptions) => void;
|
|
270
271
|
}
|
|
271
272
|
interface OverlayBounds {
|
|
272
273
|
borderRadius: string;
|
|
@@ -347,7 +348,6 @@ interface Position {
|
|
|
347
348
|
top: number;
|
|
348
349
|
}
|
|
349
350
|
|
|
350
|
-
declare const getNearestComponentName: (element: Element) => string | null;
|
|
351
351
|
interface StackFrame {
|
|
352
352
|
name: string;
|
|
353
353
|
source: FiberSource | null;
|
|
@@ -362,4 +362,4 @@ declare const generateSnippet: (elements: Element[]) => Promise<string>;
|
|
|
362
362
|
|
|
363
363
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
364
364
|
|
|
365
|
-
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 Position as P, type ReactGrabAPI as R, type SuccessLabelType as S, type Theme as T,
|
|
365
|
+
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 Position as P, type ReactGrabAPI as R, type SuccessLabelType as S, type Theme as T, generateSnippet as a, type ReactGrabState as b, type RenderType as c, type RenderData as d, type OverlayBounds as e, formatElementInfo as f, getStack as g, type DragRect as h, init as i, type Rect as j, type DeepPartial as k, type SuccessLabelContext as l, type ElementLabelContext as m, type AgentSession as n, type AgentProvider as o, type AgentSessionStorage as p, type AgentOptions as q, getFileName as r, type ReactGrabRendererProps as s };
|
|
@@ -207,7 +207,7 @@ interface AgentSession {
|
|
|
207
207
|
selectionBounds?: OverlayBounds;
|
|
208
208
|
tagName?: string;
|
|
209
209
|
}
|
|
210
|
-
interface AgentProvider<T =
|
|
210
|
+
interface AgentProvider<T = any> {
|
|
211
211
|
send: (context: AgentContext<T>, signal: AbortSignal) => AsyncIterable<string>;
|
|
212
212
|
resume?: (sessionId: string, signal: AbortSignal) => AsyncIterable<string>;
|
|
213
213
|
supportsResume?: boolean;
|
|
@@ -217,7 +217,7 @@ interface AgentSessionStorage {
|
|
|
217
217
|
setItem(key: string, value: string): void;
|
|
218
218
|
removeItem(key: string): void;
|
|
219
219
|
}
|
|
220
|
-
interface AgentOptions<T =
|
|
220
|
+
interface AgentOptions<T = any> {
|
|
221
221
|
provider?: AgentProvider<T>;
|
|
222
222
|
storage?: AgentSessionStorage | null;
|
|
223
223
|
getOptions?: () => T;
|
|
@@ -267,6 +267,7 @@ interface ReactGrabAPI {
|
|
|
267
267
|
getState: () => ReactGrabState;
|
|
268
268
|
updateTheme: (theme: DeepPartial<Theme>) => void;
|
|
269
269
|
getTheme: () => Required<Theme>;
|
|
270
|
+
setAgent: (options: AgentOptions) => void;
|
|
270
271
|
}
|
|
271
272
|
interface OverlayBounds {
|
|
272
273
|
borderRadius: string;
|
|
@@ -347,7 +348,6 @@ interface Position {
|
|
|
347
348
|
top: number;
|
|
348
349
|
}
|
|
349
350
|
|
|
350
|
-
declare const getNearestComponentName: (element: Element) => string | null;
|
|
351
351
|
interface StackFrame {
|
|
352
352
|
name: string;
|
|
353
353
|
source: FiberSource | null;
|
|
@@ -362,4 +362,4 @@ declare const generateSnippet: (elements: Element[]) => Promise<string>;
|
|
|
362
362
|
|
|
363
363
|
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
364
364
|
|
|
365
|
-
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 Position as P, type ReactGrabAPI as R, type SuccessLabelType as S, type Theme as T,
|
|
365
|
+
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 Position as P, type ReactGrabAPI as R, type SuccessLabelType as S, type Theme as T, generateSnippet as a, type ReactGrabState as b, type RenderType as c, type RenderData as d, type OverlayBounds as e, formatElementInfo as f, getStack as g, type DragRect as h, init as i, type Rect as j, type DeepPartial as k, type SuccessLabelContext as l, type ElementLabelContext as m, type AgentSession as n, type AgentProvider as o, type AgentSessionStorage as p, type AgentOptions as q, getFileName as r, type ReactGrabRendererProps as s };
|
package/dist/core.cjs
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkT7WUJ6UX_cjs = require('./chunk-T7WUJ6UX.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 chunkT7WUJ6UX_cjs.DEFAULT_THEME; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "formatElementInfo", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkT7WUJ6UX_cjs.formatElementInfo; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "generateSnippet", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkT7WUJ6UX_cjs.generateSnippet; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getFileName", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "getNearestComponentName", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunkFXFNCH4T_cjs.getNearestComponentName; }
|
|
21
|
+
get: function () { return chunkT7WUJ6UX_cjs.getFileName; }
|
|
26
22
|
});
|
|
27
23
|
Object.defineProperty(exports, "getStack", {
|
|
28
24
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkT7WUJ6UX_cjs.getStack; }
|
|
30
26
|
});
|
|
31
27
|
Object.defineProperty(exports, "init", {
|
|
32
28
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkT7WUJ6UX_cjs.init; }
|
|
34
30
|
});
|
|
35
31
|
Object.defineProperty(exports, "isInstrumentationActive", {
|
|
36
32
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkT7WUJ6UX_cjs.Ee; }
|
|
38
34
|
});
|
package/dist/core.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AgentContext,
|
|
1
|
+
export { A as AgentContext, o as AgentProvider, n as AgentSession, D as DEFAULT_THEME, O as Options, e as OverlayBounds, R as ReactGrabAPI, s as ReactGrabRendererProps, f as formatElementInfo, a as generateSnippet, r as getFileName, g as getStack, i as init } from './core--8P5lQqE.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,
|
|
1
|
+
export { A as AgentContext, o as AgentProvider, n as AgentSession, D as DEFAULT_THEME, O as Options, e as OverlayBounds, R as ReactGrabAPI, s as ReactGrabRendererProps, f as formatElementInfo, a as generateSnippet, r as getFileName, g as getStack, i as init } from './core--8P5lQqE.js';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_THEME, formatElementInfo, generateSnippet, getFileName,
|
|
1
|
+
export { DEFAULT_THEME, formatElementInfo, generateSnippet, getFileName, getStack, init, Ee as isInstrumentationActive } from './chunk-3SND4D5M.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkT7WUJ6UX_cjs = require('./chunk-T7WUJ6UX.cjs');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @license MIT
|
|
@@ -14,6 +14,7 @@ var chunkFXFNCH4T_cjs = require('./chunk-FXFNCH4T.cjs');
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
var globalApi = null;
|
|
16
16
|
var getGlobalApi = () => {
|
|
17
|
+
if (typeof window === "undefined") return globalApi;
|
|
17
18
|
return window.__REACT_GRAB__ ?? globalApi ?? null;
|
|
18
19
|
};
|
|
19
20
|
var setGlobalApi = (api) => {
|
|
@@ -30,7 +31,7 @@ if (typeof window !== "undefined") {
|
|
|
30
31
|
if (window.__REACT_GRAB__) {
|
|
31
32
|
globalApi = window.__REACT_GRAB__;
|
|
32
33
|
} else {
|
|
33
|
-
globalApi =
|
|
34
|
+
globalApi = chunkT7WUJ6UX_cjs.init();
|
|
34
35
|
window.__REACT_GRAB__ = globalApi;
|
|
35
36
|
window.dispatchEvent(
|
|
36
37
|
new CustomEvent("react-grab:init", { detail: globalApi })
|
|
@@ -40,31 +41,27 @@ if (typeof window !== "undefined") {
|
|
|
40
41
|
|
|
41
42
|
Object.defineProperty(exports, "DEFAULT_THEME", {
|
|
42
43
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkT7WUJ6UX_cjs.DEFAULT_THEME; }
|
|
44
45
|
});
|
|
45
46
|
Object.defineProperty(exports, "formatElementInfo", {
|
|
46
47
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkT7WUJ6UX_cjs.formatElementInfo; }
|
|
48
49
|
});
|
|
49
50
|
Object.defineProperty(exports, "generateSnippet", {
|
|
50
51
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(exports, "getNearestComponentName", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function () { return chunkFXFNCH4T_cjs.getNearestComponentName; }
|
|
52
|
+
get: function () { return chunkT7WUJ6UX_cjs.generateSnippet; }
|
|
56
53
|
});
|
|
57
54
|
Object.defineProperty(exports, "getStack", {
|
|
58
55
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkT7WUJ6UX_cjs.getStack; }
|
|
60
57
|
});
|
|
61
58
|
Object.defineProperty(exports, "init", {
|
|
62
59
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkT7WUJ6UX_cjs.init; }
|
|
64
61
|
});
|
|
65
62
|
Object.defineProperty(exports, "isInstrumentationActive", {
|
|
66
63
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkT7WUJ6UX_cjs.Ee; }
|
|
68
65
|
});
|
|
69
66
|
exports.getGlobalApi = getGlobalApi;
|
|
70
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,
|
|
1
|
+
import { R as ReactGrabAPI } from './core--8P5lQqE.cjs';
|
|
2
|
+
export { A as AgentContext, q as AgentOptions, o as AgentProvider, n as AgentSession, p as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, k as DeepPartial, h as DragRect, m as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, e as OverlayBounds, P as Position, b as ReactGrabState, j as Rect, d as RenderData, c as RenderType, l as SuccessLabelContext, S as SuccessLabelType, T as Theme, f as formatElementInfo, a as generateSnippet, g as getStack, i as init } from './core--8P5lQqE.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,
|
|
1
|
+
import { R as ReactGrabAPI } from './core--8P5lQqE.js';
|
|
2
|
+
export { A as AgentContext, q as AgentOptions, o as AgentProvider, n as AgentSession, p as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, k as DeepPartial, h as DragRect, m as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, e as OverlayBounds, P as Position, b as ReactGrabState, j as Rect, d as RenderData, c as RenderType, l as SuccessLabelContext, S as SuccessLabelType, T as Theme, f as formatElementInfo, a as generateSnippet, g as getStack, i as init } from './core--8P5lQqE.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|