react-grab 0.1.13 → 0.1.14
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 +32 -10
- package/dist/chunk-HH5Y6LBC.cjs +112 -0
- package/dist/chunk-WMLJ3P7X.js +112 -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-CNwr6CHX.d.cts → index-KT3jIAik.d.cts} +35 -0
- package/dist/{index-CNwr6CHX.d.ts → index-KT3jIAik.d.ts} +35 -0
- 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 +37 -32
- package/dist/index.js +1 -1
- package/dist/react.cjs +1308 -318
- package/dist/react.js +1308 -318
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/chunk-2T22V7DM.cjs +0 -107
- package/dist/chunk-VR2ILUMN.js +0 -107
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkHH5Y6LBC_cjs=require('../chunk-HH5Y6LBC.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.j}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.a}});
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-KT3jIAik.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 { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-
|
|
1
|
+
export { v as ActionContext, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, D as DEFAULT_THEME, O as Options, e as OverlayBounds, P as Plugin, x as PluginConfig, y as PluginHooks, R as ReactGrabAPI, z as ReactGrabRendererProps, r as SettableOptions, S as SourceInfo, B as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from '../index-KT3jIAik.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,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,o as init,a as isInstrumentationActive}from'../chunk-
|
|
1
|
+
export{j as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,o as init,a as isInstrumentationActive}from'../chunk-WMLJ3P7X.js';
|
|
@@ -301,6 +301,12 @@ interface ToolbarState {
|
|
|
301
301
|
collapsed: boolean;
|
|
302
302
|
enabled: boolean;
|
|
303
303
|
}
|
|
304
|
+
interface DropdownAnchor {
|
|
305
|
+
x: number;
|
|
306
|
+
y: number;
|
|
307
|
+
edge: ToolbarState["edge"];
|
|
308
|
+
toolbarWidth: number;
|
|
309
|
+
}
|
|
304
310
|
interface ReactGrabAPI {
|
|
305
311
|
activate: () => void;
|
|
306
312
|
deactivate: () => void;
|
|
@@ -337,6 +343,9 @@ interface SelectionLabelInstance {
|
|
|
337
343
|
tagName: string;
|
|
338
344
|
componentName?: string;
|
|
339
345
|
status: SelectionLabelStatus;
|
|
346
|
+
statusText?: string;
|
|
347
|
+
isPromptMode?: boolean;
|
|
348
|
+
inputValue?: string;
|
|
340
349
|
createdAt: number;
|
|
341
350
|
element?: Element;
|
|
342
351
|
elements?: Element[];
|
|
@@ -344,6 +353,17 @@ interface SelectionLabelInstance {
|
|
|
344
353
|
mouseXOffsetFromCenter?: number;
|
|
345
354
|
mouseXOffsetRatio?: number;
|
|
346
355
|
errorMessage?: string;
|
|
356
|
+
hideArrow?: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface RecentItem {
|
|
359
|
+
id: string;
|
|
360
|
+
content: string;
|
|
361
|
+
elementName: string;
|
|
362
|
+
tagName: string;
|
|
363
|
+
componentName?: string;
|
|
364
|
+
isComment: boolean;
|
|
365
|
+
commentText?: string;
|
|
366
|
+
timestamp: number;
|
|
347
367
|
}
|
|
348
368
|
interface ReactGrabRendererProps {
|
|
349
369
|
selectionVisible?: boolean;
|
|
@@ -410,6 +430,7 @@ interface ReactGrabRendererProps {
|
|
|
410
430
|
onToolbarStateChange?: (state: ToolbarState) => void;
|
|
411
431
|
onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
|
|
412
432
|
onToolbarSelectHoverChange?: (isHovered: boolean) => void;
|
|
433
|
+
onToolbarRef?: (element: HTMLDivElement) => void;
|
|
413
434
|
contextMenuPosition?: {
|
|
414
435
|
x: number;
|
|
415
436
|
y: number;
|
|
@@ -422,6 +443,20 @@ interface ReactGrabRendererProps {
|
|
|
422
443
|
actionContext?: ActionContext;
|
|
423
444
|
onContextMenuDismiss?: () => void;
|
|
424
445
|
onContextMenuHide?: () => void;
|
|
446
|
+
recentItems?: RecentItem[];
|
|
447
|
+
recentItemCount?: number;
|
|
448
|
+
hasUnreadRecentItems?: boolean;
|
|
449
|
+
recentDropdownPosition?: DropdownAnchor | null;
|
|
450
|
+
onToggleRecent?: () => void;
|
|
451
|
+
onRecentButtonHover?: (isHovered: boolean) => void;
|
|
452
|
+
onRecentItemSelect?: (item: RecentItem) => void;
|
|
453
|
+
onRecentItemRemove?: (item: RecentItem) => void;
|
|
454
|
+
onRecentItemCopy?: (item: RecentItem) => void;
|
|
455
|
+
onRecentItemHover?: (recentItemId: string | null) => void;
|
|
456
|
+
onRecentCopyAll?: () => void;
|
|
457
|
+
onRecentCopyAllHover?: (isHovered: boolean) => void;
|
|
458
|
+
onRecentClear?: () => void;
|
|
459
|
+
onRecentDismiss?: () => void;
|
|
425
460
|
}
|
|
426
461
|
interface GrabbedBox {
|
|
427
462
|
id: string;
|
|
@@ -301,6 +301,12 @@ interface ToolbarState {
|
|
|
301
301
|
collapsed: boolean;
|
|
302
302
|
enabled: boolean;
|
|
303
303
|
}
|
|
304
|
+
interface DropdownAnchor {
|
|
305
|
+
x: number;
|
|
306
|
+
y: number;
|
|
307
|
+
edge: ToolbarState["edge"];
|
|
308
|
+
toolbarWidth: number;
|
|
309
|
+
}
|
|
304
310
|
interface ReactGrabAPI {
|
|
305
311
|
activate: () => void;
|
|
306
312
|
deactivate: () => void;
|
|
@@ -337,6 +343,9 @@ interface SelectionLabelInstance {
|
|
|
337
343
|
tagName: string;
|
|
338
344
|
componentName?: string;
|
|
339
345
|
status: SelectionLabelStatus;
|
|
346
|
+
statusText?: string;
|
|
347
|
+
isPromptMode?: boolean;
|
|
348
|
+
inputValue?: string;
|
|
340
349
|
createdAt: number;
|
|
341
350
|
element?: Element;
|
|
342
351
|
elements?: Element[];
|
|
@@ -344,6 +353,17 @@ interface SelectionLabelInstance {
|
|
|
344
353
|
mouseXOffsetFromCenter?: number;
|
|
345
354
|
mouseXOffsetRatio?: number;
|
|
346
355
|
errorMessage?: string;
|
|
356
|
+
hideArrow?: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface RecentItem {
|
|
359
|
+
id: string;
|
|
360
|
+
content: string;
|
|
361
|
+
elementName: string;
|
|
362
|
+
tagName: string;
|
|
363
|
+
componentName?: string;
|
|
364
|
+
isComment: boolean;
|
|
365
|
+
commentText?: string;
|
|
366
|
+
timestamp: number;
|
|
347
367
|
}
|
|
348
368
|
interface ReactGrabRendererProps {
|
|
349
369
|
selectionVisible?: boolean;
|
|
@@ -410,6 +430,7 @@ interface ReactGrabRendererProps {
|
|
|
410
430
|
onToolbarStateChange?: (state: ToolbarState) => void;
|
|
411
431
|
onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
|
|
412
432
|
onToolbarSelectHoverChange?: (isHovered: boolean) => void;
|
|
433
|
+
onToolbarRef?: (element: HTMLDivElement) => void;
|
|
413
434
|
contextMenuPosition?: {
|
|
414
435
|
x: number;
|
|
415
436
|
y: number;
|
|
@@ -422,6 +443,20 @@ interface ReactGrabRendererProps {
|
|
|
422
443
|
actionContext?: ActionContext;
|
|
423
444
|
onContextMenuDismiss?: () => void;
|
|
424
445
|
onContextMenuHide?: () => void;
|
|
446
|
+
recentItems?: RecentItem[];
|
|
447
|
+
recentItemCount?: number;
|
|
448
|
+
hasUnreadRecentItems?: boolean;
|
|
449
|
+
recentDropdownPosition?: DropdownAnchor | null;
|
|
450
|
+
onToggleRecent?: () => void;
|
|
451
|
+
onRecentButtonHover?: (isHovered: boolean) => void;
|
|
452
|
+
onRecentItemSelect?: (item: RecentItem) => void;
|
|
453
|
+
onRecentItemRemove?: (item: RecentItem) => void;
|
|
454
|
+
onRecentItemCopy?: (item: RecentItem) => void;
|
|
455
|
+
onRecentItemHover?: (recentItemId: string | null) => void;
|
|
456
|
+
onRecentCopyAll?: () => void;
|
|
457
|
+
onRecentCopyAllHover?: (isHovered: boolean) => void;
|
|
458
|
+
onRecentClear?: () => void;
|
|
459
|
+
onRecentDismiss?: () => void;
|
|
425
460
|
}
|
|
426
461
|
interface GrabbedBox {
|
|
427
462
|
id: string;
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkHH5Y6LBC_cjs=require('./chunk-HH5Y6LBC.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,R=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,g=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,R=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,g=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=chunkHH5Y6LBC_cjs.o(),window.__REACT_GRAB__=e),window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e})));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.j}});Object.defineProperty(exports,"captureElementScreenshot",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.g}});Object.defineProperty(exports,"combineBounds",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.f}});Object.defineProperty(exports,"commentPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.n}});Object.defineProperty(exports,"copyHtmlPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.l}});Object.defineProperty(exports,"copyImageToClipboard",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.h}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.o}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.a}});Object.defineProperty(exports,"isScreenshotSupported",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.i}});Object.defineProperty(exports,"openPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.m}});Object.defineProperty(exports,"screenshotPlugin",{enumerable:true,get:function(){return chunkHH5Y6LBC_cjs.k}});exports.getGlobalApi=R;exports.setGlobalApi=g;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Plugin, R as ReactGrabAPI } from './index-
|
|
2
|
-
export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { P as Plugin, R as ReactGrabAPI } from './index-KT3jIAik.cjs';
|
|
2
|
+
export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-KT3jIAik.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 { P as Plugin, R as ReactGrabAPI } from './index-
|
|
2
|
-
export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-
|
|
1
|
+
import { P as Plugin, R as ReactGrabAPI } from './index-KT3jIAik.js';
|
|
2
|
+
export { v as ActionContext, w as ActionContextHooks, s as ActivationMode, q as AgentCompleteResult, A as AgentContext, p as AgentOptions, n as AgentProvider, m as AgentSession, o as AgentSessionStorage, t as ContextMenuAction, u as ContextMenuActionContext, C as CrosshairContext, D as DEFAULT_THEME, j as DeepPartial, f as DragRect, l as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, O as Options, e as OverlayBounds, x as PluginConfig, y as PluginHooks, k as PromptModeContext, c as ReactGrabState, h as Rect, r as SettableOptions, S as SourceInfo, T as Theme, d as ToolbarState, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './index-KT3jIAik.js';
|
|
3
3
|
export { isInstrumentationActive } from 'bippy';
|
|
4
4
|
import 'bippy/source';
|
|
5
5
|
|