@fuadnafiz98/grab 0.1.0

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.
@@ -0,0 +1,864 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { ReactNode } from "react";
10
+ import ReactReconciler from "react-reconciler";
11
+
12
+ //#region ../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/types/reactive/observable.d.ts
13
+ declare global {
14
+ interface SymbolConstructor {
15
+ readonly observable: symbol;
16
+ }
17
+ }
18
+ //#endregion
19
+ //#region ../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/types/index.d.ts
20
+ declare global {
21
+ var Solid$$: boolean;
22
+ }
23
+ //#endregion
24
+ //#region src/types.d.ts
25
+ interface Position {
26
+ x: number;
27
+ y: number;
28
+ }
29
+ interface ElementAtPointOptions {
30
+ container?: Element;
31
+ filter?: (element: Element) => boolean;
32
+ }
33
+ interface ElementBounds {
34
+ x: number;
35
+ y: number;
36
+ width: number;
37
+ height: number;
38
+ borderRadius: string;
39
+ }
40
+ type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? T[P] extends ((...args: unknown[]) => unknown) ? T[P] : DeepPartial<T[P]> : T[P] };
41
+ interface Theme {
42
+ /**
43
+ * Globally toggle the entire overlay
44
+ * @default true
45
+ */
46
+ enabled?: boolean;
47
+ /**
48
+ * Base hue (0-360) used to generate colors throughout the interface using HSL color space
49
+ * @default 0
50
+ */
51
+ hue?: number;
52
+ /**
53
+ * The highlight box that appears when hovering over an element before selecting it
54
+ */
55
+ selectionBox?: {
56
+ /**
57
+ * Whether to show the selection highlight
58
+ * @default true
59
+ */
60
+ enabled?: boolean;
61
+ };
62
+ /**
63
+ * The rectangular selection area that appears when clicking and dragging to select multiple elements
64
+ */
65
+ dragBox?: {
66
+ /**
67
+ * Whether to show the drag selection box
68
+ * @default true
69
+ */
70
+ enabled?: boolean;
71
+ };
72
+ /**
73
+ * Brief flash/highlight boxes that appear on elements immediately after they're successfully grabbed/copied
74
+ */
75
+ grabbedBoxes?: {
76
+ /**
77
+ * Whether to show these success flash effects
78
+ * @default true
79
+ */
80
+ enabled?: boolean;
81
+ };
82
+ /**
83
+ * The floating label that follows the cursor showing information about the currently hovered element
84
+ */
85
+ elementLabel?: {
86
+ /**
87
+ * Whether to show the label
88
+ * @default true
89
+ */
90
+ enabled?: boolean;
91
+ };
92
+ /**
93
+ * The floating toolbar that allows toggling React Grab activation
94
+ */
95
+ toolbar?: {
96
+ /**
97
+ * Whether to show the toolbar
98
+ * @default true
99
+ */
100
+ enabled?: boolean;
101
+ };
102
+ }
103
+ interface ReactGrabState {
104
+ isActive: boolean;
105
+ isDragging: boolean;
106
+ isCopying: boolean;
107
+ isPromptMode: boolean;
108
+ isSelectionBoxVisible: boolean;
109
+ isDragBoxVisible: boolean;
110
+ targetElement: Element | null;
111
+ dragBounds: DragRect | null;
112
+ /**
113
+ * Currently visible grabbed boxes (success flash effects).
114
+ * These are temporary visual indicators shown after elements are grabbed/copied.
115
+ */
116
+ grabbedBoxes: Array<{
117
+ id: string;
118
+ bounds: OverlayBounds;
119
+ createdAt: number;
120
+ }>;
121
+ labelInstances: Array<{
122
+ id: string;
123
+ status: SelectionLabelStatus;
124
+ tagName: string;
125
+ componentName?: string;
126
+ createdAt: number;
127
+ }>;
128
+ selectionFilePath: string | null;
129
+ toolbarState: ToolbarState | null;
130
+ }
131
+ type ElementLabelVariant = "hover" | "processing" | "success";
132
+ interface PromptModeContext {
133
+ x: number;
134
+ y: number;
135
+ targetElement: Element | null;
136
+ }
137
+ interface ElementLabelContext {
138
+ x: number;
139
+ y: number;
140
+ content: string;
141
+ element?: Element;
142
+ tagName?: string;
143
+ componentName?: string;
144
+ filePath?: string;
145
+ lineNumber?: number;
146
+ }
147
+ type ActivationKey = string | ((event: KeyboardEvent) => boolean);
148
+ interface AgentContext<T = unknown> {
149
+ content: string[];
150
+ prompt: string;
151
+ options?: T;
152
+ sessionId?: string;
153
+ }
154
+ type ActivationMode = "toggle" | "hold";
155
+ interface OpenFileActionHooks {
156
+ onOpenFile: (filePath: string, lineNumber?: number) => boolean | void;
157
+ transformOpenFileUrl: (url: string, filePath: string, lineNumber?: number) => string;
158
+ }
159
+ interface ActionContextHooks extends OpenFileActionHooks {
160
+ transformHtmlContent: (html: string, elements: Element[]) => Promise<string>;
161
+ }
162
+ interface ActionContext {
163
+ element: Element;
164
+ elements: Element[];
165
+ filePath?: string;
166
+ lineNumber?: number;
167
+ componentName?: string;
168
+ tagName?: string;
169
+ enterPromptMode?: () => void;
170
+ hooks: ActionContextHooks;
171
+ performWithFeedback: (action: () => Promise<boolean>) => Promise<void>;
172
+ hideContextMenu: () => void;
173
+ cleanup: () => void;
174
+ }
175
+ interface ContextMenuActionContext extends ActionContext {
176
+ copy?: () => void;
177
+ }
178
+ interface ContextMenuAction {
179
+ id: string;
180
+ label: string;
181
+ shortcut?: string;
182
+ shortcutModifier?: boolean;
183
+ showInToolbarMenu?: boolean;
184
+ enabled?: boolean | ((context: ActionContext) => boolean);
185
+ onAction: (context: ContextMenuActionContext) => void | Promise<void>;
186
+ }
187
+ interface HierarchyItem {
188
+ tagName: string;
189
+ componentName?: string;
190
+ depth: number;
191
+ isLast: boolean;
192
+ }
193
+ interface HierarchyState {
194
+ items: HierarchyItem[];
195
+ activeIndex: number;
196
+ }
197
+ interface PluginHooks {
198
+ onActivate?: () => void | Promise<void>;
199
+ onDeactivate?: () => void | Promise<void>;
200
+ onElementHover?: (element: Element) => void | Promise<void>;
201
+ onElementSelect?: (element: Element) => boolean | void | Promise<boolean>;
202
+ onDragStart?: (startX: number, startY: number) => void | Promise<void>;
203
+ onDragEnd?: (elements: Element[], bounds: DragRect) => void | Promise<void>;
204
+ onBeforeCopy?: (elements: Element[]) => void | Promise<void>;
205
+ transformCopyContent?: (content: string, elements: Element[]) => string | Promise<string>;
206
+ onAfterCopy?: (elements: Element[], success: boolean) => void | Promise<void>;
207
+ onCopySuccess?: (elements: Element[], content: string, context: CopySuccessContext) => void | Promise<void>;
208
+ onCopyError?: (error: Error) => void | Promise<void>;
209
+ onStateChange?: (state: ReactGrabState) => void | Promise<void>;
210
+ onPromptModeChange?: (isPromptMode: boolean, context: PromptModeContext) => void | Promise<void>;
211
+ onSelectionBox?: (visible: boolean, bounds: OverlayBounds | null, element: Element | null) => void | Promise<void>;
212
+ onDragBox?: (visible: boolean, bounds: OverlayBounds | null) => void | Promise<void>;
213
+ onGrabbedBox?: (bounds: OverlayBounds, element: Element) => void | Promise<void>;
214
+ onElementLabel?: (visible: boolean, variant: ElementLabelVariant, context: ElementLabelContext) => void | Promise<void>;
215
+ onContextMenu?: (element: Element, position: Position) => void | Promise<void>;
216
+ onOpenFile?: (filePath: string, lineNumber?: number) => boolean | void;
217
+ transformHtmlContent?: (html: string, elements: Element[]) => string | Promise<string>;
218
+ transformAgentContext?: (context: AgentContext, elements: Element[]) => AgentContext | Promise<AgentContext>;
219
+ transformActionContext?: (context: ActionContext) => ActionContext;
220
+ transformOpenFileUrl?: (url: string, filePath: string, lineNumber?: number) => string;
221
+ }
222
+ interface CopySuccessContext {
223
+ prompt?: string;
224
+ }
225
+ interface PluginConfig {
226
+ theme?: DeepPartial<Theme>;
227
+ options?: SettableOptions;
228
+ actions?: ContextMenuAction[];
229
+ hooks?: PluginHooks;
230
+ cleanup?: () => undefined;
231
+ }
232
+ interface Plugin {
233
+ name: string;
234
+ theme?: DeepPartial<Theme>;
235
+ options?: SettableOptions;
236
+ actions?: ContextMenuAction[];
237
+ hooks?: PluginHooks;
238
+ setup?: (api: ReactGrabAPI, hooks: ActionContextHooks) => PluginConfig | void;
239
+ }
240
+ interface Options {
241
+ enabled?: boolean;
242
+ /**
243
+ * Confine React Grab to a single container element instead of the whole page.
244
+ * Hit-testing, the toolbar viewport, and scroll re-anchoring are scoped to it.
245
+ * Used by the demo build to scope the showcase to its card.
246
+ */
247
+ container?: HTMLElement;
248
+ activationMode?: ActivationMode;
249
+ keyHoldDuration?: number;
250
+ allowActivationInsideInput?: boolean;
251
+ activationKey?: ActivationKey;
252
+ getContent?: (elements: Element[]) => Promise<string> | string;
253
+ /**
254
+ * Maximum number of source-location lines included in the copied / prompted
255
+ * context for a grabbed element. Larger apps often render a target through
256
+ * several wrapper components, so the compact default can point an agent at a
257
+ * wrapper instead of the meaningful surface. Raise this to opt into a deeper,
258
+ * more detailed trace. Low-signal library frames are always surfaced for free
259
+ * and never count against this budget.
260
+ * @default 3
261
+ */
262
+ maxContextLines?: number;
263
+ /**
264
+ * Whether to freeze React state updates while React Grab is active.
265
+ * This prevents UI changes from interfering with element selection.
266
+ * @default true
267
+ */
268
+ freezeReactUpdates?: boolean;
269
+ /**
270
+ * Whether to send the anonymous version check to react-grab.com on init.
271
+ * Set to false to skip the version-check request.
272
+ * @default true
273
+ */
274
+ telemetry?: boolean;
275
+ }
276
+ interface SettableOptions extends Options {
277
+ enabled?: never;
278
+ telemetry?: never;
279
+ container?: never;
280
+ }
281
+ interface SourceInfo {
282
+ filePath: string;
283
+ lineNumber: number | null;
284
+ columnNumber: number | null;
285
+ componentName: string | null;
286
+ }
287
+ interface SelectedElementPayload {
288
+ tagName: string;
289
+ id?: string;
290
+ className?: string;
291
+ textContent?: string;
292
+ componentName?: string;
293
+ filePath?: string;
294
+ lineNumber?: number;
295
+ columnNumber?: number;
296
+ }
297
+ interface ElementSelectedEventDetail {
298
+ elements: SelectedElementPayload[];
299
+ }
300
+ declare global {
301
+ interface WindowEventMap {
302
+ "react-grab:element-selected": CustomEvent<ElementSelectedEventDetail>;
303
+ }
304
+ }
305
+ interface ToolbarState {
306
+ edge: "top" | "bottom" | "left" | "right";
307
+ ratio: number;
308
+ collapsed: boolean;
309
+ enabled: boolean;
310
+ defaultAction?: string;
311
+ }
312
+ interface DropdownAnchor {
313
+ x: number;
314
+ y: number;
315
+ edge: ToolbarState["edge"];
316
+ }
317
+ interface ReactGrabAPI {
318
+ activate: () => void;
319
+ deactivate: () => void;
320
+ toggle: () => void;
321
+ comment: () => void;
322
+ isActive: () => boolean;
323
+ isEnabled: () => boolean;
324
+ setEnabled: (enabled: boolean) => void;
325
+ getToolbarState: () => ToolbarState | null;
326
+ setToolbarState: (state: Partial<ToolbarState>) => void;
327
+ onToolbarStateChange: (callback: (state: ToolbarState) => void) => () => void;
328
+ reset: () => void;
329
+ dispose: () => void;
330
+ copyElement: (elements: Element | Element[]) => Promise<boolean>;
331
+ getSource: (element: Element) => Promise<SourceInfo | null>;
332
+ getStackContext: (element: Element) => Promise<string>;
333
+ getState: () => ReactGrabState;
334
+ setOptions: (options: SettableOptions) => void;
335
+ registerPlugin: (plugin: Plugin) => void;
336
+ unregisterPlugin: (name: string) => void;
337
+ getPlugins: () => string[];
338
+ getDisplayName: (element: Element) => string | null;
339
+ }
340
+ interface OverlayBounds {
341
+ borderRadius: string;
342
+ height: number;
343
+ width: number;
344
+ x: number;
345
+ y: number;
346
+ }
347
+ type SelectionLabelStatus = "idle" | "copying" | "copied" | "fading" | "error";
348
+ interface SelectionLabelInstance {
349
+ id: string;
350
+ bounds: OverlayBounds;
351
+ boundsMultiple?: OverlayBounds[];
352
+ tagName: string;
353
+ componentName?: string;
354
+ elementsCount?: number;
355
+ status: SelectionLabelStatus;
356
+ statusText?: string;
357
+ isPromptMode?: boolean;
358
+ inputValue?: string;
359
+ createdAt: number;
360
+ element?: Element;
361
+ elements?: Element[];
362
+ mouseX?: number;
363
+ mouseXOffsetFromCenter?: number;
364
+ mouseXOffsetRatio?: number;
365
+ errorMessage?: string;
366
+ hideArrow?: boolean;
367
+ }
368
+ interface FrozenLabelEntry {
369
+ tagName: string;
370
+ componentName?: string;
371
+ bounds: OverlayBounds;
372
+ mouseX?: number;
373
+ }
374
+ interface FrozenLabelEntryAccessor {
375
+ read: () => FrozenLabelEntry | null;
376
+ }
377
+ interface SelectionLabelInstanceAccessor {
378
+ read: () => SelectionLabelInstance | null;
379
+ }
380
+ interface ReactGrabRendererProps {
381
+ selectionVisible?: boolean;
382
+ selectionBounds?: OverlayBounds;
383
+ selectionBoundsMultiple?: OverlayBounds[];
384
+ selectionShouldSnap?: boolean;
385
+ selectionElementsCount?: number;
386
+ frozenLabelEntryAccessors?: FrozenLabelEntryAccessor[];
387
+ pendingShiftPreviewEntry?: FrozenLabelEntry;
388
+ selectionFilePath?: string;
389
+ selectionTagName?: string;
390
+ selectionComponentName?: string;
391
+ selectionLabelVisible?: boolean;
392
+ selectionLabelStatus?: SelectionLabelStatus;
393
+ hierarchyState?: HierarchyState;
394
+ hierarchyMenuPosition?: DropdownAnchor | null;
395
+ labelInstances?: SelectionLabelInstance[];
396
+ labelInstanceAccessors?: SelectionLabelInstanceAccessor[];
397
+ dragVisible?: boolean;
398
+ dragBounds?: OverlayBounds;
399
+ grabbedBoxes?: Array<{
400
+ id: string;
401
+ bounds: OverlayBounds;
402
+ createdAt: number;
403
+ }>;
404
+ mouseX?: number;
405
+ isFrozen?: boolean;
406
+ inputValue?: string;
407
+ isPromptMode?: boolean;
408
+ onShowContextMenuInstance?: (instanceId: string) => void;
409
+ onRetryInstance?: (instanceId: string) => void;
410
+ onAcknowledgeErrorInstance?: (instanceId: string) => void;
411
+ onLabelInstanceHoverChange?: (instanceId: string, isHovered: boolean) => void;
412
+ onInputChange?: (value: string) => void;
413
+ onInputSubmit?: () => void;
414
+ selectionLabelShakeCount?: number;
415
+ onConfirmDismiss?: () => void;
416
+ onOpenSelectionFile?: () => void;
417
+ discardPrompt?: SelectionDiscardPrompt;
418
+ toolbarVisible?: boolean;
419
+ isActive?: boolean;
420
+ onToggleActive?: () => void;
421
+ activeActionId?: string | null;
422
+ enabled?: boolean;
423
+ shakeCount?: number;
424
+ onToolbarStateChange?: (state: ToolbarState) => void;
425
+ onSubscribeToToolbarStateChanges?: (callback: (state: ToolbarState) => void) => () => void;
426
+ onToolbarSelectHoverChange?: (isHovered: boolean) => void;
427
+ onToolbarRef?: (element: HTMLDivElement) => void;
428
+ contextMenuPosition?: Position | null;
429
+ contextMenuBounds?: OverlayBounds | null;
430
+ contextMenuTagName?: string;
431
+ contextMenuComponentName?: string;
432
+ contextMenuHasFilePath?: boolean;
433
+ actions?: ContextMenuAction[];
434
+ actionContext?: ActionContext;
435
+ onContextMenuDismiss?: () => void;
436
+ onContextMenuHide?: () => void;
437
+ toolbarMenuPosition?: DropdownAnchor | null;
438
+ toolbarMenuActions?: ContextMenuAction[];
439
+ defaultActionId?: string;
440
+ defaultActionLabel?: string;
441
+ onSetDefaultAction?: (actionId: string) => void;
442
+ onToggleToolbarMenu?: () => void;
443
+ onToolbarMenuDismiss?: () => void;
444
+ }
445
+ interface GrabbedBox {
446
+ id: string;
447
+ bounds: OverlayBounds;
448
+ createdAt: number;
449
+ element?: Element;
450
+ }
451
+ interface Rect {
452
+ left: number;
453
+ top: number;
454
+ right: number;
455
+ bottom: number;
456
+ }
457
+ interface DragRect {
458
+ x: number;
459
+ y: number;
460
+ width: number;
461
+ height: number;
462
+ }
463
+ interface SelectionDiscardPrompt {
464
+ isKeyboardSelection?: boolean;
465
+ label?: string;
466
+ cancelOnEscape?: boolean;
467
+ onConfirm?: () => void;
468
+ onCancel?: () => void;
469
+ onCopy?: () => void;
470
+ }
471
+ interface SourceLocation extends SourceInfo {
472
+ columnNumber: number | null;
473
+ }
474
+ interface ReactGrabStackFrame {
475
+ functionName?: string;
476
+ fileName?: string;
477
+ lineNumber?: number;
478
+ columnNumber?: number;
479
+ isServer?: boolean;
480
+ isSymbolicated?: boolean;
481
+ }
482
+ interface ReactGrabEntry {
483
+ tagName?: string;
484
+ componentName?: string;
485
+ content: string;
486
+ commentText?: string;
487
+ source?: SourceLocation | null;
488
+ stackContext?: string;
489
+ frames?: ReactGrabStackFrame[];
490
+ }
491
+ //#endregion
492
+ //#region ../../node_modules/.pnpm/bippy@0.7.2_@types+react@19.2.14_react@19.2.6/node_modules/bippy/dist/errors.d.ts
493
+ interface ReactWorkTagMap {
494
+ ActivityComponent: number;
495
+ CacheComponent: number;
496
+ ClassComponent: number;
497
+ ContextConsumer: number;
498
+ ContextProvider: number;
499
+ CoroutineComponent: number;
500
+ CoroutineHandlerPhase: number;
501
+ DehydratedSuspenseComponent: number;
502
+ ForwardRef: number;
503
+ Fragment: number;
504
+ FunctionComponent: number;
505
+ HostComponent: number;
506
+ HostHoistable: number;
507
+ HostPortal: number;
508
+ HostRoot: number;
509
+ HostSingleton: number;
510
+ HostText: number;
511
+ IncompleteClassComponent: number;
512
+ IncompleteFunctionComponent: number;
513
+ IndeterminateComponent: number;
514
+ LazyComponent: number;
515
+ LegacyHiddenComponent: number;
516
+ MemoComponent: number;
517
+ Mode: number;
518
+ OffscreenComponent: number;
519
+ Profiler: number;
520
+ ScopeComponent: number;
521
+ SimpleMemoComponent: number;
522
+ SuspenseComponent: number;
523
+ SuspenseListComponent: number;
524
+ Throw: number;
525
+ TracingMarkerComponent: number;
526
+ ViewTransitionComponent: number;
527
+ YieldComponent: number;
528
+ }
529
+ declare const reactWorkTagsByVersion: {
530
+ readonly "16.0.0": {
531
+ readonly ActivityComponent: -1;
532
+ readonly CacheComponent: -1;
533
+ readonly ClassComponent: 2;
534
+ readonly ContextConsumer: 12;
535
+ readonly ContextProvider: 13;
536
+ readonly CoroutineComponent: 7;
537
+ readonly CoroutineHandlerPhase: 8;
538
+ readonly DehydratedSuspenseComponent: -1;
539
+ readonly ForwardRef: 14;
540
+ readonly Fragment: 10;
541
+ readonly FunctionComponent: 1;
542
+ readonly HostComponent: 5;
543
+ readonly HostHoistable: -1;
544
+ readonly HostPortal: 4;
545
+ readonly HostRoot: 3;
546
+ readonly HostSingleton: -1;
547
+ readonly HostText: 6;
548
+ readonly IncompleteClassComponent: -1;
549
+ readonly IncompleteFunctionComponent: -1;
550
+ readonly IndeterminateComponent: 0;
551
+ readonly LazyComponent: -1;
552
+ readonly LegacyHiddenComponent: -1;
553
+ readonly MemoComponent: -1;
554
+ readonly Mode: 11;
555
+ readonly OffscreenComponent: -1;
556
+ readonly Profiler: 15;
557
+ readonly ScopeComponent: -1;
558
+ readonly SimpleMemoComponent: -1;
559
+ readonly SuspenseComponent: 16;
560
+ readonly SuspenseListComponent: -1;
561
+ readonly Throw: -1;
562
+ readonly TracingMarkerComponent: -1;
563
+ readonly ViewTransitionComponent: -1;
564
+ readonly YieldComponent: 9;
565
+ };
566
+ readonly "16.4.3-alpha": {
567
+ readonly ActivityComponent: -1;
568
+ readonly CacheComponent: -1;
569
+ readonly ClassComponent: 2;
570
+ readonly ContextConsumer: 11;
571
+ readonly ContextProvider: 12;
572
+ readonly CoroutineComponent: -1;
573
+ readonly CoroutineHandlerPhase: -1;
574
+ readonly DehydratedSuspenseComponent: -1;
575
+ readonly ForwardRef: 13;
576
+ readonly Fragment: 9;
577
+ readonly FunctionComponent: 0;
578
+ readonly HostComponent: 7;
579
+ readonly HostHoistable: -1;
580
+ readonly HostPortal: 6;
581
+ readonly HostRoot: 5;
582
+ readonly HostSingleton: -1;
583
+ readonly HostText: 8;
584
+ readonly IncompleteClassComponent: -1;
585
+ readonly IncompleteFunctionComponent: -1;
586
+ readonly IndeterminateComponent: 4;
587
+ readonly LazyComponent: -1;
588
+ readonly LegacyHiddenComponent: -1;
589
+ readonly MemoComponent: -1;
590
+ readonly Mode: 10;
591
+ readonly OffscreenComponent: -1;
592
+ readonly Profiler: 15;
593
+ readonly ScopeComponent: -1;
594
+ readonly SimpleMemoComponent: -1;
595
+ readonly SuspenseComponent: 16;
596
+ readonly SuspenseListComponent: -1;
597
+ readonly Throw: -1;
598
+ readonly TracingMarkerComponent: -1;
599
+ readonly ViewTransitionComponent: -1;
600
+ readonly YieldComponent: -1;
601
+ };
602
+ readonly "16.6.0-beta.0": {
603
+ readonly ActivityComponent: -1;
604
+ readonly CacheComponent: -1;
605
+ readonly ClassComponent: 1;
606
+ readonly ContextConsumer: 9;
607
+ readonly ContextProvider: 10;
608
+ readonly CoroutineComponent: -1;
609
+ readonly CoroutineHandlerPhase: -1;
610
+ readonly DehydratedSuspenseComponent: 18;
611
+ readonly ForwardRef: 11;
612
+ readonly Fragment: 7;
613
+ readonly FunctionComponent: 0;
614
+ readonly HostComponent: 5;
615
+ readonly HostHoistable: -1;
616
+ readonly HostPortal: 4;
617
+ readonly HostRoot: 3;
618
+ readonly HostSingleton: -1;
619
+ readonly HostText: 6;
620
+ readonly IncompleteClassComponent: 17;
621
+ readonly IncompleteFunctionComponent: -1;
622
+ readonly IndeterminateComponent: 2;
623
+ readonly LazyComponent: 16;
624
+ readonly LegacyHiddenComponent: -1;
625
+ readonly MemoComponent: 14;
626
+ readonly Mode: 8;
627
+ readonly OffscreenComponent: -1;
628
+ readonly Profiler: 12;
629
+ readonly ScopeComponent: -1;
630
+ readonly SimpleMemoComponent: 15;
631
+ readonly SuspenseComponent: 13;
632
+ readonly SuspenseListComponent: 19;
633
+ readonly Throw: -1;
634
+ readonly TracingMarkerComponent: -1;
635
+ readonly ViewTransitionComponent: -1;
636
+ readonly YieldComponent: -1;
637
+ };
638
+ readonly "17.0.0-alpha": {
639
+ readonly ActivityComponent: -1;
640
+ readonly CacheComponent: -1;
641
+ readonly ClassComponent: 1;
642
+ readonly ContextConsumer: 9;
643
+ readonly ContextProvider: 10;
644
+ readonly CoroutineComponent: -1;
645
+ readonly CoroutineHandlerPhase: -1;
646
+ readonly DehydratedSuspenseComponent: 18;
647
+ readonly ForwardRef: 11;
648
+ readonly Fragment: 7;
649
+ readonly FunctionComponent: 0;
650
+ readonly HostComponent: 5;
651
+ readonly HostHoistable: -1;
652
+ readonly HostPortal: 4;
653
+ readonly HostRoot: 3;
654
+ readonly HostSingleton: -1;
655
+ readonly HostText: 6;
656
+ readonly IncompleteClassComponent: 17;
657
+ readonly IncompleteFunctionComponent: -1;
658
+ readonly IndeterminateComponent: 2;
659
+ readonly LazyComponent: 16;
660
+ readonly LegacyHiddenComponent: 24;
661
+ readonly MemoComponent: 14;
662
+ readonly Mode: 8;
663
+ readonly OffscreenComponent: 23;
664
+ readonly Profiler: 12;
665
+ readonly ScopeComponent: 21;
666
+ readonly SimpleMemoComponent: 15;
667
+ readonly SuspenseComponent: 13;
668
+ readonly SuspenseListComponent: 19;
669
+ readonly Throw: -1;
670
+ readonly TracingMarkerComponent: -1;
671
+ readonly ViewTransitionComponent: -1;
672
+ readonly YieldComponent: -1;
673
+ };
674
+ readonly "17.0.2": {
675
+ readonly ActivityComponent: 31;
676
+ readonly CacheComponent: 24;
677
+ readonly ClassComponent: 1;
678
+ readonly ContextConsumer: 9;
679
+ readonly ContextProvider: 10;
680
+ readonly CoroutineComponent: -1;
681
+ readonly CoroutineHandlerPhase: -1;
682
+ readonly DehydratedSuspenseComponent: 18;
683
+ readonly ForwardRef: 11;
684
+ readonly Fragment: 7;
685
+ readonly FunctionComponent: 0;
686
+ readonly HostComponent: 5;
687
+ readonly HostHoistable: 26;
688
+ readonly HostPortal: 4;
689
+ readonly HostRoot: 3;
690
+ readonly HostSingleton: 27;
691
+ readonly HostText: 6;
692
+ readonly IncompleteClassComponent: 17;
693
+ readonly IncompleteFunctionComponent: 28;
694
+ readonly IndeterminateComponent: 2;
695
+ readonly LazyComponent: 16;
696
+ readonly LegacyHiddenComponent: 23;
697
+ readonly MemoComponent: 14;
698
+ readonly Mode: 8;
699
+ readonly OffscreenComponent: 22;
700
+ readonly Profiler: 12;
701
+ readonly ScopeComponent: 21;
702
+ readonly SimpleMemoComponent: 15;
703
+ readonly SuspenseComponent: 13;
704
+ readonly SuspenseListComponent: 19;
705
+ readonly Throw: 29;
706
+ readonly TracingMarkerComponent: 25;
707
+ readonly ViewTransitionComponent: 30;
708
+ readonly YieldComponent: -1;
709
+ };
710
+ };
711
+ type ReactWorkTagVersion = keyof typeof reactWorkTagsByVersion;
712
+ type ReactWorkTag = Exclude<(typeof reactWorkTagsByVersion)[ReactWorkTagVersion][keyof ReactWorkTagMap], -1>;
713
+ //#endregion
714
+ //#region src/react-internals/types.d.ts
715
+ type WorkTag = ReactReconciler.WorkTag | ReactWorkTag;
716
+ interface Source extends ReactReconciler.Source {}
717
+ interface ContextDependency<T> extends Omit<ReactReconciler.ContextDependency<T>, "observedBits"> {
718
+ memoizedValue?: T;
719
+ observedBits?: number;
720
+ }
721
+ interface DebugThenableState {
722
+ thenables?: unknown[];
723
+ }
724
+ interface Dependencies extends Omit<ReactReconciler.Dependencies, "firstContext"> {
725
+ _debugThenableState?: DebugThenableState | unknown[];
726
+ firstContext: ContextDependency<unknown> | null;
727
+ }
728
+ interface ServerComponentInfo {
729
+ name?: string;
730
+ env?: string;
731
+ owner?: Fiber | ServerComponentInfo | null;
732
+ debugStack?: Error | null;
733
+ }
734
+ interface ReactDebugInfo {
735
+ debugLocation?: unknown;
736
+ env?: string;
737
+ name?: string;
738
+ }
739
+ interface ReactMemoCache {
740
+ data: unknown[][];
741
+ index: number;
742
+ }
743
+ interface FiberDebugSource extends Source {
744
+ columnNumber?: number;
745
+ }
746
+ interface FiberUpdateQueue {
747
+ [key: string]: unknown;
748
+ memoCache?: ReactMemoCache;
749
+ }
750
+ interface Fiber<T = unknown> extends Omit<ReactReconciler.Fiber, "alternate" | "_debugOwner" | "_debugSource" | "child" | "deletions" | "dependencies" | "memoizedProps" | "memoizedState" | "pendingProps" | "return" | "sibling" | "stateNode" | "tag" | "updateQueue"> {
751
+ _debugInfo?: ReactDebugInfo[];
752
+ _debugOwner?: Fiber | ServerComponentInfo | null;
753
+ _debugSource?: FiberDebugSource | null;
754
+ _debugStack?: Error & {
755
+ stack: string;
756
+ };
757
+ alternate: Fiber | null;
758
+ child: Fiber | null;
759
+ deletions: Fiber[] | null;
760
+ dependencies: Dependencies | null;
761
+ effectTag?: number;
762
+ memoizedProps: Props;
763
+ memoizedState: MemoizedState | null;
764
+ pendingProps: Props;
765
+ return: Fiber | null;
766
+ sibling: Fiber | null;
767
+ stateNode: T;
768
+ tag: WorkTag;
769
+ updateQueue: FiberUpdateQueue | null;
770
+ }
771
+ interface FiberRoot {
772
+ current: Fiber;
773
+ }
774
+ interface MemoizedState {
775
+ [key: string]: unknown;
776
+ memoizedState: unknown;
777
+ next: MemoizedState | null;
778
+ }
779
+ interface Props {
780
+ [key: string]: unknown;
781
+ }
782
+ interface ReactDevToolsEventHandler {
783
+ (data: unknown): void;
784
+ }
785
+ interface ReactDevToolsGlobalHook {
786
+ _instrumentationIsActive?: boolean;
787
+ _instrumentationSource?: string;
788
+ checkDCE: (fn: unknown) => void;
789
+ emit?: (event: string, data?: unknown) => void;
790
+ getFiberRoots?: (rendererID: number) => Set<FiberRoot>;
791
+ hasUnsupportedRendererAttached: boolean;
792
+ inject: (renderer: ReactRenderer) => number;
793
+ off?: (event: string, handler: ReactDevToolsEventHandler) => void;
794
+ on: (event: string, handler: ReactDevToolsEventHandler) => void;
795
+ onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: number | void, didError?: boolean) => void;
796
+ onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
797
+ onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
798
+ onScheduleFiberRoot?: (rendererID: number, root: FiberRoot, children: ReactNode) => void;
799
+ renderers: Map<number, ReactRenderer>;
800
+ sub?: (event: string, handler: ReactDevToolsEventHandler) => () => void;
801
+ supportsFiber: boolean;
802
+ supportsFlight: boolean;
803
+ }
804
+ interface LegacyDispatcherRef {
805
+ current: unknown;
806
+ }
807
+ interface CurrentDispatcherRef {
808
+ H: unknown;
809
+ }
810
+ type RendererDispatcherRef = CurrentDispatcherRef | LegacyDispatcherRef;
811
+ interface ReactRenderer extends Omit<ReactReconciler.DevToolsConfig<unknown, unknown, unknown>, "findFiberByHostInstance"> {
812
+ currentDispatcherRef?: RendererDispatcherRef | null;
813
+ findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
814
+ getCurrentFiber?: () => Fiber | null;
815
+ overrideContext?: (fiber: Fiber, contextType: unknown, path: string[], value: unknown) => void;
816
+ overrideHookState?: (fiber: Fiber, id: number, path: string[], value: unknown) => void;
817
+ overrideHookStateDeletePath?: (fiber: Fiber, id: number, path: Array<number | string>) => void;
818
+ overrideHookStateRenamePath?: (fiber: Fiber, id: number, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
819
+ overrideProps?: (fiber: Fiber, path: string[], value: unknown) => void;
820
+ overridePropsDeletePath?: (fiber: Fiber, path: Array<number | string>) => void;
821
+ overridePropsRenamePath?: (fiber: Fiber, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
822
+ reconcilerVersion?: string;
823
+ scheduleRetry?: (fiber: Fiber) => void;
824
+ scheduleRoot?: (root: FiberRoot, element: React.ReactNode) => void;
825
+ scheduleUpdate?: (fiber: Fiber) => void;
826
+ setErrorHandler?: (newShouldErrorImpl: (fiber: Fiber) => boolean | null) => void;
827
+ setSuspenseHandler?: (newShouldSuspendImpl: (fiber: Fiber) => boolean) => void;
828
+ }
829
+ declare global {
830
+ var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook | undefined;
831
+ } //#endregion
832
+ //#region src/react-internals/index.d.ts
833
+ //#endregion
834
+ //#region ../../node_modules/.pnpm/bippy@0.7.2_@types+react@19.2.14_react@19.2.6/node_modules/bippy/dist/source.d.ts
835
+ //#region src/source/parse-stack.d.ts
836
+ interface StackFrame {
837
+ columnNumber?: number;
838
+ lineNumber?: number;
839
+ enclosingLineNumber?: number;
840
+ enclosingColumnNumber?: number;
841
+ fileName?: string;
842
+ functionName?: string;
843
+ source?: string;
844
+ isServer?: boolean;
845
+ isSymbolicated?: boolean;
846
+ isIgnoreListed?: boolean;
847
+ }
848
+ //#endregion
849
+ //#region ../../node_modules/.pnpm/bippy@0.7.2_@types+react@19.2.14_react@19.2.6/node_modules/bippy/dist/index.d.ts
850
+ /**
851
+ * Returns `true` if bippy's instrumentation is active.
852
+ */
853
+ declare const isInstrumentationActive: () => boolean;
854
+ //#endregion
855
+ //#region src/utils/copy-content.d.ts
856
+ interface CopyContentOptions {
857
+ componentName?: string;
858
+ tagName?: string;
859
+ commentText?: string;
860
+ entries?: ReactGrabEntry[];
861
+ }
862
+ declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
863
+ //#endregion
864
+ export { ReactGrabState as A, Plugin as C, PromptModeContext as D, Position as E, Theme as F, ToolbarState as I, SelectedElementPayload as M, SettableOptions as N, ReactGrabAPI as O, SourceInfo as P, OverlayBounds as S, PluginHooks as T, ElementLabelVariant as _, ActionContext as a, OpenFileActionHooks as b, AgentContext as c, CopySuccessContext as d, DeepPartial as f, ElementLabelContext as g, ElementBounds as h, Fiber as i, Rect as j, ReactGrabRendererProps as k, ContextMenuAction as l, ElementAtPointOptions as m, isInstrumentationActive as n, ActionContextHooks as o, DragRect as p, StackFrame as r, ActivationMode as s, copyContent as t, ContextMenuActionContext as u, ElementSelectedEventDetail as v, PluginConfig as w, Options as x, GrabbedBox as y };