bippy 0.2.10 → 0.2.11

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/dist/inspect.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-6TJRMCM3.js';
2
- import { getFiberId, HostRootTag, HostTextTag, getDisplayName, FragmentTag, isHostFiber, getNearestHostFiber, onCommitFiberRoot, traverseRenderedFibers, getRDTHook, getFiberFromHostInstance, traverseFiber, getFiberStack, isCompositeFiber, isInstrumentationActive, hasRDTHook, detectReactBuildType } from './chunk-6RFLBWUK.js';
2
+ import { getFiberId, HostRootTag, HostTextTag, getDisplayName, FragmentTag, isHostFiber, getNearestHostFiber, onCommitFiberRoot, traverseRenderedFibers, getRDTHook, getFiberFromHostInstance, traverseFiber, getFiberStack, isCompositeFiber, isInstrumentationActive, hasRDTHook, detectReactBuildType } from './chunk-HRNPTAGF.js';
3
3
  import React17, { createContext, memo, Children, useContext, useCallback, useState, useLayoutEffect, useRef, useMemo, useEffect } from 'react';
4
4
 
5
5
  /**
@@ -4777,7 +4777,7 @@ var CloseButton = React17.memo(({ onClick }) => /* @__PURE__ */ React17.createEl
4777
4777
  },
4778
4778
  "\xD7"
4779
4779
  ));
4780
- var FiberGraph = React17.memo(
4780
+ React17.memo(
4781
4781
  ({
4782
4782
  fiber,
4783
4783
  onFiberSelect,
@@ -5095,7 +5095,10 @@ var FiberGraph = React17.memo(
5095
5095
  timestamp: Date.now()
5096
5096
  });
5097
5097
  fiberStates.set(fiberId, states);
5098
- renderCounts.set(renderedFiber, (renderCounts.get(renderedFiber) || 0) + 1);
5098
+ renderCounts.set(
5099
+ renderedFiber,
5100
+ (renderCounts.get(renderedFiber) || 0) + 1
5101
+ );
5099
5102
  });
5100
5103
  if (nodesGroupRef.current) {
5101
5104
  const nodeElements = select_default2(nodesGroupRef.current).selectAll("g");
@@ -5122,28 +5125,31 @@ var FiberGraph = React17.memo(
5122
5125
  }
5123
5126
  };
5124
5127
  }, []);
5125
- const handleTimelineChange = useCallback((index) => {
5126
- setTimelineIndex(index);
5127
- const fiberId = getFiberId(fiber).toString();
5128
- const states = fiberStates.get(fiberId);
5129
- if (states?.[index]) {
5130
- const rdtHook = getRDTHook();
5131
- if (rdtHook?.renderers.size > 0) {
5132
- const renderer = Array.from(rdtHook.renderers.values())?.[0];
5133
- const overrideProps = renderer?.currentDispatcherRef?.current?.overrideProps;
5134
- const overrideHookState = renderer?.currentDispatcherRef?.current?.overrideHookState;
5135
- const state = states?.[index];
5136
- if (state) {
5137
- if (overrideProps) {
5138
- overrideProps(fiber, state.props);
5139
- }
5140
- if (overrideHookState) {
5141
- overrideHookState(fiber, state.hookState);
5128
+ const handleTimelineChange = useCallback(
5129
+ (index) => {
5130
+ setTimelineIndex(index);
5131
+ const fiberId = getFiberId(fiber).toString();
5132
+ const states = fiberStates.get(fiberId);
5133
+ if (states?.[index]) {
5134
+ const rdtHook = getRDTHook();
5135
+ if (rdtHook?.renderers.size > 0) {
5136
+ const renderer = Array.from(rdtHook.renderers.values())?.[0];
5137
+ const overrideProps = renderer?.currentDispatcherRef?.current?.overrideProps;
5138
+ const overrideHookState = renderer?.currentDispatcherRef?.current?.overrideHookState;
5139
+ const state = states?.[index];
5140
+ if (state) {
5141
+ if (overrideProps) {
5142
+ overrideProps(fiber, state.props);
5143
+ }
5144
+ if (overrideHookState) {
5145
+ overrideHookState(fiber, state.hookState);
5146
+ }
5142
5147
  }
5143
5148
  }
5144
5149
  }
5145
- }
5146
- }, [fiber]);
5150
+ },
5151
+ [fiber]
5152
+ );
5147
5153
  const handlePlayPause = useCallback(() => {
5148
5154
  setIsPlaying((prev) => !prev);
5149
5155
  }, []);
@@ -5183,300 +5189,399 @@ var FiberGraph = React17.memo(
5183
5189
  }
5184
5190
  };
5185
5191
  }, [isPlaying, fiber, timelineIndex, handleTimelineChange]);
5186
- return /* @__PURE__ */ React17.createElement("div", { style: { height: "50ch", marginTop: "2ch", display: "flex", flexDirection: "column", position: "relative" } }, isDialogMode && /* @__PURE__ */ React17.createElement("div", { style: {
5187
- display: "flex",
5188
- gap: "0.5ch",
5189
- marginBottom: "1ch",
5190
- padding: "0 1ch",
5191
- borderBottom: "1px solid #282828"
5192
- } }, /* @__PURE__ */ React17.createElement(
5193
- "button",
5194
- {
5195
- type: "button",
5196
- onClick: () => setActiveTab("graph"),
5197
- style: {
5198
- background: "transparent",
5199
- border: "none",
5200
- color: activeTab === "graph" ? "#FFC799" : "#A0A0A0",
5201
- padding: "1ch",
5202
- cursor: "pointer",
5203
- position: "relative",
5204
- fontSize: "0.875rem",
5205
- fontWeight: activeTab === "graph" ? 500 : 400
5206
- }
5207
- },
5208
- "Graph View",
5209
- activeTab === "graph" && /* @__PURE__ */ React17.createElement("div", { style: {
5210
- position: "absolute",
5211
- bottom: "-1px",
5212
- left: 0,
5213
- right: 0,
5214
- height: "2px",
5215
- background: "#FFC799",
5216
- borderRadius: "2px 2px 0 0"
5217
- } })
5218
- ), /* @__PURE__ */ React17.createElement(
5219
- "button",
5192
+ return /* @__PURE__ */ React17.createElement(
5193
+ "div",
5220
5194
  {
5221
- type: "button",
5222
- onClick: () => setActiveTab("fiber"),
5223
5195
  style: {
5224
- background: "transparent",
5225
- border: "none",
5226
- color: activeTab === "fiber" ? "#FFC799" : "#A0A0A0",
5227
- padding: "1ch",
5228
- cursor: "pointer",
5229
- position: "relative",
5230
- fontSize: "0.875rem",
5231
- fontWeight: activeTab === "fiber" ? 500 : 400
5196
+ height: "50ch",
5197
+ marginTop: "2ch",
5198
+ display: "flex",
5199
+ flexDirection: "column",
5200
+ position: "relative"
5232
5201
  }
5233
5202
  },
5234
- "Fiber View",
5235
- activeTab === "fiber" && /* @__PURE__ */ React17.createElement("div", { style: {
5236
- position: "absolute",
5237
- bottom: "-1px",
5238
- left: 0,
5239
- right: 0,
5240
- height: "2px",
5241
- background: "#FFC799",
5242
- borderRadius: "2px 2px 0 0"
5243
- } })
5244
- )), /* @__PURE__ */ React17.createElement("div", { style: { position: "relative", flex: 1 } }, /* @__PURE__ */ React17.createElement("div", { style: {
5245
- position: "absolute",
5246
- inset: 0,
5247
- display: activeTab === "graph" ? "block" : "none"
5248
- } }, /* @__PURE__ */ React17.createElement(
5249
- Controls,
5250
- {
5251
- onZoomIn: handleZoomIn,
5252
- onZoomOut: handleZoomOut,
5253
- onReset: handleReset,
5254
- onFit: handleFit
5255
- }
5256
- ), /* @__PURE__ */ React17.createElement(
5257
- "svg",
5258
- {
5259
- ref: svgRef,
5260
- viewBox: `0 0 ${svgWidth} ${svgHeight}`,
5261
- xmlns: "http://www.w3.org/2000/svg",
5262
- style: {
5263
- width: "100%",
5264
- height: "100%",
5265
- background: "#101010",
5266
- borderRadius: "0.25rem",
5267
- cursor: "grab"
5203
+ isDialogMode && /* @__PURE__ */ React17.createElement(
5204
+ "div",
5205
+ {
5206
+ style: {
5207
+ display: "flex",
5208
+ gap: "0.5ch",
5209
+ marginBottom: "1ch",
5210
+ padding: "0 1ch",
5211
+ borderBottom: "1px solid #282828"
5212
+ }
5268
5213
  },
5269
- "aria-label": "Fiber Tree Visualization"
5270
- },
5271
- /* @__PURE__ */ React17.createElement("title", null, "Fiber Tree Visualization"),
5272
- /* @__PURE__ */ React17.createElement("g", { ref: svgGroupRef }, /* @__PURE__ */ React17.createElement("g", { ref: linksGroupRef, className: "links" }), /* @__PURE__ */ React17.createElement("g", { ref: nodesGroupRef, className: "nodes" }))
5273
- )), /* @__PURE__ */ React17.createElement("div", { style: {
5274
- position: "absolute",
5275
- inset: 0,
5276
- display: activeTab === "fiber" ? "block" : "none",
5277
- overflow: "auto",
5278
- background: "#101010",
5279
- borderRadius: "0.25rem",
5280
- padding: "1ch"
5281
- } }, /* @__PURE__ */ React17.createElement(
5282
- Inspector,
5283
- {
5284
- theme: theme3,
5285
- data: fiber,
5286
- expandLevel: isDialogMode ? 1 : 0,
5287
- table: false,
5288
- nodeRenderer: (props) => {
5289
- const Component = props.depth === 0 ? ObjectRootLabel : ObjectLabel;
5290
- return /* @__PURE__ */ React17.createElement(
5291
- "span",
5214
+ /* @__PURE__ */ React17.createElement(
5215
+ "button",
5216
+ {
5217
+ type: "button",
5218
+ onClick: () => setActiveTab("graph"),
5219
+ style: {
5220
+ background: "transparent",
5221
+ border: "none",
5222
+ color: activeTab === "graph" ? "#FFC799" : "#A0A0A0",
5223
+ padding: "1ch",
5224
+ cursor: "pointer",
5225
+ position: "relative",
5226
+ fontSize: "0.875rem",
5227
+ fontWeight: activeTab === "graph" ? 500 : 400
5228
+ }
5229
+ },
5230
+ "Graph View",
5231
+ activeTab === "graph" && /* @__PURE__ */ React17.createElement(
5232
+ "div",
5292
5233
  {
5293
- onMouseEnter: (e) => handlePropertyHover(e, props.name),
5294
- onMouseLeave: handlePropertyLeave,
5295
5234
  style: {
5296
- cursor: FIBER_PROP_EXPLANATIONS[props.name] ? "help" : "default",
5297
- padding: "1px 0",
5298
- display: "inline-block",
5299
- fontWeight: FIBER_PROP_EXPLANATIONS[props.name] ? 500 : "normal"
5235
+ position: "absolute",
5236
+ bottom: "-1px",
5237
+ left: 0,
5238
+ right: 0,
5239
+ height: "2px",
5240
+ background: "#FFC799",
5241
+ borderRadius: "2px 2px 0 0"
5300
5242
  }
5301
- },
5302
- /* @__PURE__ */ React17.createElement(
5303
- Component,
5304
- {
5305
- name: props.name,
5306
- data: props.data,
5307
- isNonenumerable: props.isNonenumerable
5243
+ }
5244
+ )
5245
+ ),
5246
+ /* @__PURE__ */ React17.createElement(
5247
+ "button",
5248
+ {
5249
+ type: "button",
5250
+ onClick: () => setActiveTab("fiber"),
5251
+ style: {
5252
+ background: "transparent",
5253
+ border: "none",
5254
+ color: activeTab === "fiber" ? "#FFC799" : "#A0A0A0",
5255
+ padding: "1ch",
5256
+ cursor: "pointer",
5257
+ position: "relative",
5258
+ fontSize: "0.875rem",
5259
+ fontWeight: activeTab === "fiber" ? 500 : 400
5260
+ }
5261
+ },
5262
+ "Fiber View",
5263
+ activeTab === "fiber" && /* @__PURE__ */ React17.createElement(
5264
+ "div",
5265
+ {
5266
+ style: {
5267
+ position: "absolute",
5268
+ bottom: "-1px",
5269
+ left: 0,
5270
+ right: 0,
5271
+ height: "2px",
5272
+ background: "#FFC799",
5273
+ borderRadius: "2px 2px 0 0"
5308
5274
  }
5309
- )
5310
- );
5311
- }
5312
- }
5313
- ), tooltip && /* @__PURE__ */ React17.createElement("div", { style: {
5314
- position: "absolute",
5315
- zIndex: 1001,
5316
- backgroundColor: "#161616",
5317
- color: "#FFF",
5318
- bottom: "2ch",
5319
- right: "2ch",
5320
- pointerEvents: "none",
5321
- overflowY: "auto",
5322
- padding: "1ch",
5323
- fontSize: "1ch",
5324
- border: "1px solid #282828",
5325
- borderRadius: "0.25ch"
5326
- } }, tooltip))), isDialogMode && /* @__PURE__ */ React17.createElement("div", { style: {
5327
- background: "#161616",
5328
- padding: "1ch",
5329
- margin: "1ch 1ch 0 1ch",
5330
- borderRadius: "0.25rem",
5331
- border: "1px solid #282828",
5332
- display: "flex",
5333
- flexDirection: "column",
5334
- gap: "0.5ch",
5335
- opacity: fiberStates.get(getFiberId(fiber).toString())?.length ? 1 : 0.5
5336
- } }, /* @__PURE__ */ React17.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5ch" } }, /* @__PURE__ */ React17.createElement(
5337
- "button",
5338
- {
5339
- type: "button",
5340
- onClick: handleStepBack,
5341
- disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5342
- style: {
5343
- background: "transparent",
5344
- border: "1px solid #282828",
5345
- color: "#FFF",
5346
- borderRadius: "0.25rem",
5347
- cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5348
- padding: "0.25ch 0.5ch"
5349
- }
5350
- },
5351
- "\u23EE"
5352
- ), /* @__PURE__ */ React17.createElement(
5353
- "button",
5354
- {
5355
- type: "button",
5356
- onClick: handlePlayPause,
5357
- disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5358
- style: {
5359
- background: "transparent",
5360
- border: "1px solid #282828",
5361
- color: "#FFF",
5362
- borderRadius: "0.25rem",
5363
- cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5364
- padding: "0.25ch 0.5ch"
5365
- }
5366
- },
5367
- isPlaying ? "\u23F8" : "\u25B6\uFE0F"
5368
- ), /* @__PURE__ */ React17.createElement(
5369
- "button",
5370
- {
5371
- type: "button",
5372
- onClick: handleStepForward,
5373
- disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5374
- style: {
5375
- background: "transparent",
5376
- border: "1px solid #282828",
5377
- color: "#FFF",
5378
- borderRadius: "0.25rem",
5379
- cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5380
- padding: "0.25ch 0.5ch"
5381
- }
5382
- },
5383
- "\u23ED"
5384
- ), /* @__PURE__ */ React17.createElement("span", { style: { color: "#A0A0A0", fontSize: "0.75rem" } }, timelineIndex >= 0 && fiberStates.get(getFiberId(fiber).toString())?.[timelineIndex]?.timestamp ? new Date(fiberStates.get(getFiberId(fiber).toString())?.[timelineIndex]?.timestamp ?? 0).toLocaleTimeString() : "--:--:--"), !fiberStates.get(getFiberId(fiber).toString())?.length && /* @__PURE__ */ React17.createElement("span", { style: { color: "#A0A0A0", fontSize: "0.75rem", marginLeft: "auto" } }, "No state changes recorded yet")), /* @__PURE__ */ React17.createElement("div", { style: {
5385
- display: "flex",
5386
- alignItems: "center",
5387
- gap: "0.25ch",
5388
- height: "2ch",
5389
- position: "relative"
5390
- } }, (fiberStates.get(getFiberId(fiber).toString()) ?? []).map((state, i) => {
5391
- const isActive = i === timelineIndex;
5392
- return /* @__PURE__ */ React17.createElement(
5275
+ }
5276
+ )
5277
+ )
5278
+ ),
5279
+ /* @__PURE__ */ React17.createElement("div", { style: { position: "relative", flex: 1 } }, /* @__PURE__ */ React17.createElement(
5393
5280
  "div",
5394
5281
  {
5395
- key: state.timestamp,
5396
- onClick: () => handleTimelineChange(i),
5397
- onKeyDown: (e) => {
5398
- if (e.key === "Enter" || e.key === " ") {
5399
- handleTimelineChange(i);
5282
+ style: {
5283
+ position: "absolute",
5284
+ inset: 0,
5285
+ display: activeTab === "graph" ? "block" : "none"
5286
+ }
5287
+ },
5288
+ /* @__PURE__ */ React17.createElement(
5289
+ Controls,
5290
+ {
5291
+ onZoomIn: handleZoomIn,
5292
+ onZoomOut: handleZoomOut,
5293
+ onReset: handleReset,
5294
+ onFit: handleFit
5295
+ }
5296
+ ),
5297
+ /* @__PURE__ */ React17.createElement(
5298
+ "svg",
5299
+ {
5300
+ ref: svgRef,
5301
+ viewBox: `0 0 ${svgWidth} ${svgHeight}`,
5302
+ xmlns: "http://www.w3.org/2000/svg",
5303
+ style: {
5304
+ width: "100%",
5305
+ height: "100%",
5306
+ background: "#101010",
5307
+ borderRadius: "0.25rem",
5308
+ cursor: "grab"
5309
+ },
5310
+ "aria-label": "Fiber Tree Visualization"
5311
+ },
5312
+ /* @__PURE__ */ React17.createElement("title", null, "Fiber Tree Visualization"),
5313
+ /* @__PURE__ */ React17.createElement("g", { ref: svgGroupRef }, /* @__PURE__ */ React17.createElement("g", { ref: linksGroupRef, className: "links" }), /* @__PURE__ */ React17.createElement("g", { ref: nodesGroupRef, className: "nodes" }))
5314
+ )
5315
+ ), /* @__PURE__ */ React17.createElement(
5316
+ "div",
5317
+ {
5318
+ style: {
5319
+ position: "absolute",
5320
+ inset: 0,
5321
+ display: activeTab === "fiber" ? "block" : "none",
5322
+ overflow: "auto",
5323
+ background: "#101010",
5324
+ borderRadius: "0.25rem",
5325
+ padding: "1ch"
5326
+ }
5327
+ },
5328
+ /* @__PURE__ */ React17.createElement(
5329
+ Inspector,
5330
+ {
5331
+ theme: theme3,
5332
+ data: fiber,
5333
+ expandLevel: 1,
5334
+ table: false,
5335
+ nodeRenderer: (props) => {
5336
+ const Component = props.depth === 0 ? ObjectRootLabel : ObjectLabel;
5337
+ return /* @__PURE__ */ React17.createElement(
5338
+ "span",
5339
+ {
5340
+ onMouseEnter: (e) => handlePropertyHover(e, props.name),
5341
+ onMouseLeave: handlePropertyLeave,
5342
+ style: {
5343
+ cursor: FIBER_PROP_EXPLANATIONS[props.name] ? "help" : "default",
5344
+ padding: "1px 0",
5345
+ display: "inline-block",
5346
+ fontWeight: FIBER_PROP_EXPLANATIONS[props.name] ? 500 : "normal"
5347
+ }
5348
+ },
5349
+ /* @__PURE__ */ React17.createElement(
5350
+ Component,
5351
+ {
5352
+ name: props.name,
5353
+ data: props.data,
5354
+ isNonenumerable: props.isNonenumerable
5355
+ }
5356
+ )
5357
+ );
5358
+ }
5359
+ }
5360
+ ),
5361
+ tooltip && /* @__PURE__ */ React17.createElement(
5362
+ "div",
5363
+ {
5364
+ style: {
5365
+ position: "absolute",
5366
+ zIndex: 1001,
5367
+ backgroundColor: "#161616",
5368
+ color: "#FFF",
5369
+ bottom: "2ch",
5370
+ right: "2ch",
5371
+ pointerEvents: "none",
5372
+ overflowY: "auto",
5373
+ padding: "1ch",
5374
+ fontSize: "1ch",
5375
+ border: "1px solid #282828",
5376
+ borderRadius: "0.25ch"
5400
5377
  }
5401
5378
  },
5402
- role: "button",
5403
- tabIndex: 0,
5379
+ tooltip
5380
+ )
5381
+ )),
5382
+ isDialogMode && /* @__PURE__ */ React17.createElement(
5383
+ "div",
5384
+ {
5404
5385
  style: {
5405
- flex: 1,
5406
- height: "100%",
5407
- background: isActive ? "#FFC799" : "#282828",
5408
- cursor: "pointer",
5409
- position: "relative",
5410
- borderRadius: "0.125rem",
5411
- transition: "background-color 150ms",
5412
- outline: "none"
5386
+ background: "#161616",
5387
+ padding: "1ch",
5388
+ margin: "1ch 1ch 0 1ch",
5389
+ borderRadius: "0.25rem",
5390
+ border: "1px solid #282828",
5391
+ display: "flex",
5392
+ flexDirection: "column",
5393
+ gap: "0.5ch",
5394
+ opacity: fiberStates.get(getFiberId(fiber).toString())?.length ? 1 : 0.5
5395
+ }
5396
+ },
5397
+ /* @__PURE__ */ React17.createElement(
5398
+ "div",
5399
+ {
5400
+ style: { display: "flex", alignItems: "center", gap: "0.5ch" }
5413
5401
  },
5414
- onMouseEnter: (e) => {
5415
- const target = e.currentTarget;
5416
- const tooltip2 = document.createElement("div");
5417
- tooltip2.style.position = "absolute";
5418
- tooltip2.style.bottom = "100%";
5419
- tooltip2.style.left = "50%";
5420
- tooltip2.style.transform = "translateX(-50%)";
5421
- tooltip2.style.background = "#161616";
5422
- tooltip2.style.color = "#FFF";
5423
- tooltip2.style.padding = "0.5ch";
5424
- tooltip2.style.borderRadius = "0.25rem";
5425
- tooltip2.style.fontSize = "0.75rem";
5426
- tooltip2.style.whiteSpace = "nowrap";
5427
- tooltip2.style.pointerEvents = "none";
5428
- tooltip2.style.border = "1px solid #282828";
5429
- tooltip2.style.zIndex = "1000";
5430
- const changes = [];
5431
- const states = fiberStates.get(getFiberId(fiber).toString());
5432
- const prevState = i > 0 && states ? states[i - 1] : null;
5433
- if (prevState) {
5434
- const propChanges = Object.keys(state.props).filter(
5435
- (key) => state.props[key] !== prevState.props[key]
5436
- );
5437
- if (propChanges.length > 0) {
5438
- changes.push(`Props: ${propChanges.join(", ")}`);
5402
+ /* @__PURE__ */ React17.createElement(
5403
+ "button",
5404
+ {
5405
+ type: "button",
5406
+ onClick: handleStepBack,
5407
+ disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5408
+ style: {
5409
+ background: "transparent",
5410
+ border: "1px solid #282828",
5411
+ color: "#FFF",
5412
+ borderRadius: "0.25rem",
5413
+ cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5414
+ padding: "0.25ch 0.5ch"
5439
5415
  }
5440
- const hookChanges = Object.keys(state.hookState).filter(
5441
- (key) => state.hookState[key] !== prevState.hookState[key]
5442
- );
5443
- if (hookChanges.length > 0) {
5444
- changes.push(`State: ${hookChanges.join(", ")}`);
5416
+ },
5417
+ "\u23EE"
5418
+ ),
5419
+ /* @__PURE__ */ React17.createElement(
5420
+ "button",
5421
+ {
5422
+ type: "button",
5423
+ onClick: handlePlayPause,
5424
+ disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5425
+ style: {
5426
+ background: "transparent",
5427
+ border: "1px solid #282828",
5428
+ color: "#FFF",
5429
+ borderRadius: "0.25rem",
5430
+ cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5431
+ padding: "0.25ch 0.5ch"
5432
+ }
5433
+ },
5434
+ isPlaying ? "\u23F8" : "\u25B6\uFE0F"
5435
+ ),
5436
+ /* @__PURE__ */ React17.createElement(
5437
+ "button",
5438
+ {
5439
+ type: "button",
5440
+ onClick: handleStepForward,
5441
+ disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5442
+ style: {
5443
+ background: "transparent",
5444
+ border: "1px solid #282828",
5445
+ color: "#FFF",
5446
+ borderRadius: "0.25rem",
5447
+ cursor: fiberStates.get(getFiberId(fiber).toString())?.length ? "pointer" : "not-allowed",
5448
+ padding: "0.25ch 0.5ch"
5445
5449
  }
5450
+ },
5451
+ "\u23ED"
5452
+ ),
5453
+ /* @__PURE__ */ React17.createElement("span", { style: { color: "#A0A0A0", fontSize: "0.75rem" } }, timelineIndex >= 0 && fiberStates.get(getFiberId(fiber).toString())?.[timelineIndex]?.timestamp ? new Date(
5454
+ fiberStates.get(getFiberId(fiber).toString())?.[timelineIndex]?.timestamp ?? 0
5455
+ ).toLocaleTimeString() : "--:--:--"),
5456
+ !fiberStates.get(getFiberId(fiber).toString())?.length && /* @__PURE__ */ React17.createElement(
5457
+ "span",
5458
+ {
5459
+ style: {
5460
+ color: "#A0A0A0",
5461
+ fontSize: "0.75rem",
5462
+ marginLeft: "auto"
5463
+ }
5464
+ },
5465
+ "No state changes recorded yet"
5466
+ )
5467
+ ),
5468
+ /* @__PURE__ */ React17.createElement(
5469
+ "div",
5470
+ {
5471
+ style: {
5472
+ display: "flex",
5473
+ alignItems: "center",
5474
+ gap: "0.25ch",
5475
+ height: "2ch",
5476
+ position: "relative"
5446
5477
  }
5447
- tooltip2.textContent = changes.length > 0 ? changes.join(" | ") : prevState ? "No changes" : "Initial state";
5448
- target.appendChild(tooltip2);
5449
5478
  },
5450
- onMouseLeave: (e) => {
5451
- const tooltip2 = e.currentTarget.querySelector("div");
5452
- if (tooltip2) {
5453
- tooltip2.remove();
5479
+ (fiberStates.get(getFiberId(fiber).toString()) ?? []).map(
5480
+ (state, i) => {
5481
+ const isActive = i === timelineIndex;
5482
+ return /* @__PURE__ */ React17.createElement(
5483
+ "div",
5484
+ {
5485
+ key: state.timestamp,
5486
+ onClick: () => handleTimelineChange(i),
5487
+ onKeyDown: (e) => {
5488
+ if (e.key === "Enter" || e.key === " ") {
5489
+ handleTimelineChange(i);
5490
+ }
5491
+ },
5492
+ role: "button",
5493
+ tabIndex: 0,
5494
+ style: {
5495
+ flex: 1,
5496
+ height: "100%",
5497
+ background: isActive ? "#FFC799" : "#282828",
5498
+ cursor: "pointer",
5499
+ position: "relative",
5500
+ borderRadius: "0.125rem",
5501
+ transition: "background-color 150ms",
5502
+ outline: "none"
5503
+ },
5504
+ onMouseEnter: (e) => {
5505
+ const target = e.currentTarget;
5506
+ const tooltip2 = document.createElement("div");
5507
+ tooltip2.style.position = "absolute";
5508
+ tooltip2.style.bottom = "100%";
5509
+ tooltip2.style.left = "50%";
5510
+ tooltip2.style.transform = "translateX(-50%)";
5511
+ tooltip2.style.background = "#161616";
5512
+ tooltip2.style.color = "#FFF";
5513
+ tooltip2.style.padding = "0.5ch";
5514
+ tooltip2.style.borderRadius = "0.25rem";
5515
+ tooltip2.style.fontSize = "0.75rem";
5516
+ tooltip2.style.whiteSpace = "nowrap";
5517
+ tooltip2.style.pointerEvents = "none";
5518
+ tooltip2.style.border = "1px solid #282828";
5519
+ tooltip2.style.zIndex = "1000";
5520
+ const changes = [];
5521
+ const states = fiberStates.get(
5522
+ getFiberId(fiber).toString()
5523
+ );
5524
+ const prevState = i > 0 && states ? states[i - 1] : null;
5525
+ if (prevState) {
5526
+ const propChanges = Object.keys(state.props).filter(
5527
+ (key) => state.props[key] !== prevState.props[key]
5528
+ );
5529
+ if (propChanges.length > 0) {
5530
+ changes.push(`Props: ${propChanges.join(", ")}`);
5531
+ }
5532
+ const hookChanges = Object.keys(
5533
+ state.hookState
5534
+ ).filter(
5535
+ (key) => state.hookState[key] !== prevState.hookState[key]
5536
+ );
5537
+ if (hookChanges.length > 0) {
5538
+ changes.push(`State: ${hookChanges.join(", ")}`);
5539
+ }
5540
+ }
5541
+ tooltip2.textContent = changes.length > 0 ? changes.join(" | ") : prevState ? "No changes" : "Initial state";
5542
+ target.appendChild(tooltip2);
5543
+ },
5544
+ onMouseLeave: (e) => {
5545
+ const tooltip2 = e.currentTarget.querySelector("div");
5546
+ if (tooltip2) {
5547
+ tooltip2.remove();
5548
+ }
5549
+ }
5550
+ }
5551
+ );
5552
+ }
5553
+ ),
5554
+ !fiberStates.get(getFiberId(fiber).toString())?.length && /* @__PURE__ */ React17.createElement(
5555
+ "div",
5556
+ {
5557
+ style: {
5558
+ flex: 1,
5559
+ height: "100%",
5560
+ background: "#282828",
5561
+ borderRadius: "0.125rem",
5562
+ opacity: 0.5
5563
+ }
5564
+ }
5565
+ )
5566
+ ),
5567
+ /* @__PURE__ */ React17.createElement(
5568
+ "input",
5569
+ {
5570
+ type: "range",
5571
+ min: 0,
5572
+ max: (fiberStates.get(getFiberId(fiber).toString())?.length ?? 1) - 1,
5573
+ value: timelineIndex,
5574
+ onChange: (e) => handleTimelineChange(Number(e.target.value)),
5575
+ disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5576
+ style: {
5577
+ width: "100%",
5578
+ accentColor: "#FFC799",
5579
+ opacity: fiberStates.get(getFiberId(fiber).toString())?.length ? 1 : 0.5
5454
5580
  }
5455
5581
  }
5456
- }
5457
- );
5458
- }), !fiberStates.get(getFiberId(fiber).toString())?.length && /* @__PURE__ */ React17.createElement("div", { style: {
5459
- flex: 1,
5460
- height: "100%",
5461
- background: "#282828",
5462
- borderRadius: "0.125rem",
5463
- opacity: 0.5
5464
- } })), /* @__PURE__ */ React17.createElement(
5465
- "input",
5466
- {
5467
- type: "range",
5468
- min: 0,
5469
- max: (fiberStates.get(getFiberId(fiber).toString())?.length ?? 1) - 1,
5470
- value: timelineIndex,
5471
- onChange: (e) => handleTimelineChange(Number(e.target.value)),
5472
- disabled: !fiberStates.get(getFiberId(fiber).toString())?.length,
5473
- style: {
5474
- width: "100%",
5475
- accentColor: "#FFC799",
5476
- opacity: fiberStates.get(getFiberId(fiber).toString())?.length ? 1 : 0.5
5477
- }
5478
- }
5479
- )));
5582
+ )
5583
+ )
5584
+ );
5480
5585
  }
5481
5586
  );
5482
5587
  var Inspector2 = React17.memo(
@@ -5497,19 +5602,13 @@ var Inspector2 = React17.memo(
5497
5602
  const fiber2 = getFiberFromHostInstance(element);
5498
5603
  return fiber2;
5499
5604
  }, [selectedFiber, element]);
5500
- const handleFiberSelect = (fiber2) => {
5501
- if (fiber2 !== selectedFiber) {
5502
- if (!isDialogMode) {
5503
- const currentFiber = getFiberForDisplay();
5504
- if (currentFiber) {
5505
- setFiberHistory([currentFiber]);
5506
- }
5507
- setIsDialogMode(true);
5508
- } else if (selectedFiber) {
5509
- setFiberHistory((prev) => [...prev, selectedFiber]);
5510
- }
5511
- setSelectedFiber(fiber2);
5512
- }
5605
+ const handlePropertyHover = (_e, propName) => {
5606
+ if (!isDialogMode) return;
5607
+ const explanation = FIBER_PROP_EXPLANATIONS[propName];
5608
+ setTooltip(explanation || null);
5609
+ };
5610
+ const handlePropertyLeave = () => {
5611
+ setTooltip(null);
5513
5612
  };
5514
5613
  const handleClose = useCallback(() => {
5515
5614
  setIsDialogMode(false);
@@ -5793,15 +5892,39 @@ var Inspector2 = React17.memo(
5793
5892
  ), i < arr.length - 1 && " > ");
5794
5893
  })
5795
5894
  ),
5796
- fiber && /* @__PURE__ */ React17.createElement(
5797
- FiberGraph,
5895
+ /* @__PURE__ */ React17.createElement("div", { style: { flex: 1, overflow: "auto" } }, fiber && /* @__PURE__ */ React17.createElement(
5896
+ Inspector,
5798
5897
  {
5799
- key: getFiberId(fiber),
5800
- fiber,
5801
- onFiberSelect: handleFiberSelect,
5802
- isDialogMode
5898
+ theme: theme3,
5899
+ data: fiber,
5900
+ expandLevel: 1,
5901
+ table: false,
5902
+ nodeRenderer: (props) => {
5903
+ const Component = props.depth === 0 ? ObjectRootLabel : ObjectLabel;
5904
+ return /* @__PURE__ */ React17.createElement(
5905
+ "span",
5906
+ {
5907
+ onMouseEnter: (e) => handlePropertyHover(e, props.name),
5908
+ onMouseLeave: handlePropertyLeave,
5909
+ style: {
5910
+ cursor: FIBER_PROP_EXPLANATIONS[props.name] ? "help" : "default",
5911
+ padding: "1px 0",
5912
+ display: "inline-block",
5913
+ fontWeight: FIBER_PROP_EXPLANATIONS[props.name] ? 500 : "normal"
5914
+ }
5915
+ },
5916
+ /* @__PURE__ */ React17.createElement(
5917
+ Component,
5918
+ {
5919
+ name: props.name,
5920
+ data: props.data,
5921
+ isNonenumerable: props.isNonenumerable
5922
+ }
5923
+ )
5924
+ );
5925
+ }
5803
5926
  }
5804
- ),
5927
+ )),
5805
5928
  tooltip && /* @__PURE__ */ React17.createElement(
5806
5929
  "div",
5807
5930
  {