grab 0.1.0-beta.1 → 0.1.0-beta.10
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 +3 -15
- package/bin/cli.js +2 -0
- package/dist/chunk-ATK7RK4T.js +92 -0
- package/dist/chunk-H5MBURMD.cjs +92 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{index-BdKhAk4Q.d.ts → index-BJPU_v5a.d.cts} +25 -1
- package/dist/{index-BdKhAk4Q.d.cts → index-BJPU_v5a.d.ts} +25 -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 +27 -23
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +10 -6
- package/dist/chunk-LDW43FYB.js +0 -88
- package/dist/chunk-PRH54P3S.cjs +0 -88
- package/dist/cli.cjs +0 -2
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkH5MBURMD_cjs=require('../chunk-H5MBURMD.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.e}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.c}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.k}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.b}});
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BJPU_v5a.cjs';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { s as ActionContext, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, D as DEFAULT_THEME, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, R as ReactGrabAPI, w as ReactGrabRendererProps, p as SettableOptions, S as SourceInfo, x as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-BJPU_v5a.js';
|
|
2
2
|
export { isInstrumentationActive } from 'bippy';
|
|
3
3
|
import 'bippy/source';
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as DEFAULT_THEME,e as copyContent,d as formatElementInfo,f as generateSnippet,c as getStack,k as init,b as isInstrumentationActive}from'../chunk-
|
|
1
|
+
export{j as DEFAULT_THEME,e as copyContent,d as formatElementInfo,f as generateSnippet,c as getStack,k as init,b as isInstrumentationActive}from'../chunk-ATK7RK4T.js';
|
|
@@ -261,6 +261,7 @@ interface ReactGrabAPI {
|
|
|
261
261
|
registerPlugin: (plugin: Plugin) => void;
|
|
262
262
|
unregisterPlugin: (name: string) => void;
|
|
263
263
|
getPlugins: () => string[];
|
|
264
|
+
getDisplayName: (element: Element) => string | null;
|
|
264
265
|
}
|
|
265
266
|
interface OverlayBounds {
|
|
266
267
|
borderRadius: string;
|
|
@@ -270,7 +271,7 @@ interface OverlayBounds {
|
|
|
270
271
|
x: number;
|
|
271
272
|
y: number;
|
|
272
273
|
}
|
|
273
|
-
type SelectionLabelStatus = "idle" | "copying" | "copied" | "fading" | "error";
|
|
274
|
+
type SelectionLabelStatus = "idle" | "copying" | "copied" | "fading" | "error" | "comment";
|
|
274
275
|
interface SelectionLabelInstance {
|
|
275
276
|
id: string;
|
|
276
277
|
bounds: OverlayBounds;
|
|
@@ -338,6 +339,27 @@ interface ReactGrabRendererProps {
|
|
|
338
339
|
toolbarVisible?: boolean;
|
|
339
340
|
isActive?: boolean;
|
|
340
341
|
onToggleActive?: () => void;
|
|
342
|
+
enabled?: boolean;
|
|
343
|
+
onToggleEnabled?: () => void;
|
|
344
|
+
commentCount?: number;
|
|
345
|
+
onCopyComments?: () => void;
|
|
346
|
+
commentInputVisible?: boolean;
|
|
347
|
+
commentInputBounds?: OverlayBounds;
|
|
348
|
+
commentInputTagName?: string;
|
|
349
|
+
commentInputComponentName?: string;
|
|
350
|
+
commentInputValue?: string;
|
|
351
|
+
onCommentInputChange?: (value: string) => void;
|
|
352
|
+
onCommentSubmit?: () => void;
|
|
353
|
+
onCommentCancel?: () => void;
|
|
354
|
+
comments?: Array<{
|
|
355
|
+
id: string;
|
|
356
|
+
comment: string;
|
|
357
|
+
bounds: OverlayBounds;
|
|
358
|
+
tagName: string;
|
|
359
|
+
componentName?: string;
|
|
360
|
+
}>;
|
|
361
|
+
onRemoveComment?: (commentId: string) => void;
|
|
362
|
+
onEditComment?: (commentId: string) => void;
|
|
341
363
|
contextMenuPosition?: {
|
|
342
364
|
x: number;
|
|
343
365
|
y: number;
|
|
@@ -350,6 +372,8 @@ interface ReactGrabRendererProps {
|
|
|
350
372
|
actionContext?: ActionContext;
|
|
351
373
|
onContextMenuCopy?: () => void;
|
|
352
374
|
onContextMenuCopyScreenshot?: () => void;
|
|
375
|
+
onContextMenuCopyHtml?: () => void;
|
|
376
|
+
onContextMenuComment?: () => void;
|
|
353
377
|
onContextMenuOpen?: () => void;
|
|
354
378
|
onContextMenuDismiss?: () => void;
|
|
355
379
|
onContextMenuHide?: () => void;
|
|
@@ -261,6 +261,7 @@ interface ReactGrabAPI {
|
|
|
261
261
|
registerPlugin: (plugin: Plugin) => void;
|
|
262
262
|
unregisterPlugin: (name: string) => void;
|
|
263
263
|
getPlugins: () => string[];
|
|
264
|
+
getDisplayName: (element: Element) => string | null;
|
|
264
265
|
}
|
|
265
266
|
interface OverlayBounds {
|
|
266
267
|
borderRadius: string;
|
|
@@ -270,7 +271,7 @@ interface OverlayBounds {
|
|
|
270
271
|
x: number;
|
|
271
272
|
y: number;
|
|
272
273
|
}
|
|
273
|
-
type SelectionLabelStatus = "idle" | "copying" | "copied" | "fading" | "error";
|
|
274
|
+
type SelectionLabelStatus = "idle" | "copying" | "copied" | "fading" | "error" | "comment";
|
|
274
275
|
interface SelectionLabelInstance {
|
|
275
276
|
id: string;
|
|
276
277
|
bounds: OverlayBounds;
|
|
@@ -338,6 +339,27 @@ interface ReactGrabRendererProps {
|
|
|
338
339
|
toolbarVisible?: boolean;
|
|
339
340
|
isActive?: boolean;
|
|
340
341
|
onToggleActive?: () => void;
|
|
342
|
+
enabled?: boolean;
|
|
343
|
+
onToggleEnabled?: () => void;
|
|
344
|
+
commentCount?: number;
|
|
345
|
+
onCopyComments?: () => void;
|
|
346
|
+
commentInputVisible?: boolean;
|
|
347
|
+
commentInputBounds?: OverlayBounds;
|
|
348
|
+
commentInputTagName?: string;
|
|
349
|
+
commentInputComponentName?: string;
|
|
350
|
+
commentInputValue?: string;
|
|
351
|
+
onCommentInputChange?: (value: string) => void;
|
|
352
|
+
onCommentSubmit?: () => void;
|
|
353
|
+
onCommentCancel?: () => void;
|
|
354
|
+
comments?: Array<{
|
|
355
|
+
id: string;
|
|
356
|
+
comment: string;
|
|
357
|
+
bounds: OverlayBounds;
|
|
358
|
+
tagName: string;
|
|
359
|
+
componentName?: string;
|
|
360
|
+
}>;
|
|
361
|
+
onRemoveComment?: (commentId: string) => void;
|
|
362
|
+
onEditComment?: (commentId: string) => void;
|
|
341
363
|
contextMenuPosition?: {
|
|
342
364
|
x: number;
|
|
343
365
|
y: number;
|
|
@@ -350,6 +372,8 @@ interface ReactGrabRendererProps {
|
|
|
350
372
|
actionContext?: ActionContext;
|
|
351
373
|
onContextMenuCopy?: () => void;
|
|
352
374
|
onContextMenuCopyScreenshot?: () => void;
|
|
375
|
+
onContextMenuCopyHtml?: () => void;
|
|
376
|
+
onContextMenuComment?: () => void;
|
|
353
377
|
onContextMenuOpen?: () => void;
|
|
354
378
|
onContextMenuDismiss?: () => void;
|
|
355
379
|
onContextMenuHide?: () => void;
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkH5MBURMD_cjs=require('./chunk-H5MBURMD.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,c=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,f=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,c=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,f=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=chunkH5MBURMD_cjs.k(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.h}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.g}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.i}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.d}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.f}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.c}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.k}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.b}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkH5MBURMD_cjs.a}});exports.getGlobalApi=c;exports.setGlobalApi=f;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReactGrabAPI } from './index-
|
|
2
|
-
export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { R as ReactGrabAPI } from './index-BJPU_v5a.cjs';
|
|
2
|
+
export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BJPU_v5a.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 './index-
|
|
2
|
-
export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { R as ReactGrabAPI } from './index-BJPU_v5a.js';
|
|
2
|
+
export { s as ActionContext, q as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, r as ContextMenuAction, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, d as OverlayBounds, t as Plugin, u as PluginConfig, v as PluginHooks, P as PromptModeContext, c as ReactGrabState, f as Rect, p as SettableOptions, S as SourceInfo, T as Theme, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-BJPU_v5a.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|