bippy 0.2.4 → 0.2.5

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.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('./chunk-YZYCWAB2.cjs');
6
- var chunkIDXORTRQ_cjs = require('./chunk-IDXORTRQ.cjs');
6
+ var chunkCQFIS43Y_cjs = require('./chunk-CQFIS43Y.cjs');
7
7
  var React17 = require('react');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -1234,456 +1234,465 @@ var throttle = (fn, wait) => {
1234
1234
  };
1235
1235
  };
1236
1236
  var isMac = typeof navigator !== "undefined" && navigator.platform.toLowerCase().includes("mac");
1237
- var Inspector2 = ({
1238
- enabled = true,
1239
- dangerouslyRunInProduction = false
1240
- }) => {
1241
- const [element, setElement] = React17.useState(null);
1242
- const [rect, setRect] = React17.useState(null);
1243
- const [isActive, setIsActive] = React17.useState(true);
1244
- const [isDialogMode, setIsDialogMode] = React17.useState(false);
1245
- const [tooltip, setTooltip] = React17.useState(null);
1246
- const [selectedFiber, setSelectedFiber] = React17.useState(null);
1247
- const [position, setPosition] = React17.useState({
1248
- top: 0,
1249
- left: 0
1250
- });
1251
- const getFiberForDisplay = () => {
1252
- if (selectedFiber) return selectedFiber;
1253
- const fiber2 = chunkIDXORTRQ_cjs.getFiberFromHostInstance(element);
1254
- if (!fiber2) return null;
1255
- return fiber2.return && chunkIDXORTRQ_cjs.isCompositeFiber(fiber2.return) ? fiber2.return : fiber2;
1256
- };
1257
- const handlePropertyHover = (_e, propName) => {
1258
- if (!isDialogMode) return;
1259
- const explanation = FIBER_PROP_EXPLANATIONS[propName];
1260
- if (!explanation) return;
1261
- setTooltip(explanation);
1262
- };
1263
- const handlePropertyLeave = () => {
1264
- setTooltip(null);
1265
- };
1266
- React17.useEffect(() => {
1267
- const handleKeyDown = (e) => {
1268
- if (e.key === "o" && (e.metaKey || e.ctrlKey) && rect) {
1269
- e.preventDefault();
1270
- setIsDialogMode(true);
1271
- } else if (e.key === "Escape" && isDialogMode) {
1272
- setIsDialogMode(false);
1273
- setTooltip(null);
1274
- }
1237
+ var Inspector2 = React17__default.default.memo(
1238
+ ({ enabled = true, dangerouslyRunInProduction = false }) => {
1239
+ const [element, setElement] = React17.useState(null);
1240
+ const [rect, setRect] = React17.useState(null);
1241
+ const [isActive, setIsActive] = React17.useState(true);
1242
+ const [isDialogMode, setIsDialogMode] = React17.useState(false);
1243
+ const [tooltip, setTooltip] = React17.useState(null);
1244
+ const [selectedFiber, setSelectedFiber] = React17.useState(null);
1245
+ const [position, setPosition] = React17.useState({
1246
+ top: 0,
1247
+ left: 0
1248
+ });
1249
+ const getFiberForDisplay = () => {
1250
+ if (selectedFiber) return selectedFiber;
1251
+ const fiber2 = chunkCQFIS43Y_cjs.getFiberFromHostInstance(element);
1252
+ if (!fiber2) return null;
1253
+ return fiber2.return && chunkCQFIS43Y_cjs.isCompositeFiber(fiber2.return) ? fiber2.return : fiber2;
1254
+ };
1255
+ const handlePropertyHover = (_e, propName) => {
1256
+ if (!isDialogMode) return;
1257
+ const explanation = FIBER_PROP_EXPLANATIONS[propName];
1258
+ setTooltip(explanation || null);
1275
1259
  };
1276
- window.addEventListener("keydown", handleKeyDown);
1277
- return () => window.removeEventListener("keydown", handleKeyDown);
1278
- }, [rect, isDialogMode]);
1279
- React17.useEffect(() => {
1280
- if (!isDialogMode) {
1260
+ const handlePropertyLeave = () => {
1281
1261
  setTooltip(null);
1282
- }
1283
- }, [isDialogMode]);
1284
- React17.useEffect(() => {
1285
- const handleMouseMove = (event) => {
1286
- if (isDialogMode) return;
1287
- const isActive2 = chunkIDXORTRQ_cjs.isInstrumentationActive();
1288
- if (!isActive2) {
1289
- setIsActive(false);
1290
- return;
1262
+ };
1263
+ React17.useEffect(() => {
1264
+ const handleKeyDown = (e) => {
1265
+ if (e.key === "o" && (e.metaKey || e.ctrlKey) && rect) {
1266
+ e.preventDefault();
1267
+ setIsDialogMode(true);
1268
+ } else if (e.key === "Escape" && isDialogMode) {
1269
+ setIsDialogMode(false);
1270
+ setTooltip(null);
1271
+ }
1272
+ };
1273
+ window.addEventListener("keydown", handleKeyDown);
1274
+ return () => window.removeEventListener("keydown", handleKeyDown);
1275
+ }, [rect, isDialogMode]);
1276
+ React17.useEffect(() => {
1277
+ if (!isDialogMode) {
1278
+ setTooltip(null);
1291
1279
  }
1292
- if (!dangerouslyRunInProduction) {
1293
- const rdtHook = chunkIDXORTRQ_cjs.getRDTHook();
1294
- for (const renderer of rdtHook.renderers.values()) {
1295
- const buildType = chunkIDXORTRQ_cjs.detectReactBuildType(renderer);
1296
- if (buildType === "production") {
1297
- setIsActive(false);
1298
- return;
1280
+ }, [isDialogMode]);
1281
+ React17.useEffect(() => {
1282
+ const handleMouseMove = (event) => {
1283
+ if (isDialogMode) return;
1284
+ const isActive2 = chunkCQFIS43Y_cjs.isInstrumentationActive() || chunkCQFIS43Y_cjs.hasRDTHook();
1285
+ if (!isActive2) {
1286
+ setIsActive(false);
1287
+ return;
1288
+ }
1289
+ if (!dangerouslyRunInProduction) {
1290
+ const rdtHook = chunkCQFIS43Y_cjs.getRDTHook();
1291
+ for (const renderer of rdtHook.renderers.values()) {
1292
+ const buildType = chunkCQFIS43Y_cjs.detectReactBuildType(renderer);
1293
+ if (buildType === "production") {
1294
+ setIsActive(false);
1295
+ return;
1296
+ }
1299
1297
  }
1300
1298
  }
1301
- }
1302
- if (!enabled) {
1303
- setElement(null);
1304
- setRect(null);
1305
- setSelectedFiber(null);
1306
- return;
1307
- }
1308
- const element2 = document.elementFromPoint(event.clientX, event.clientY);
1309
- if (!element2) return;
1310
- setElement(element2);
1311
- setRect(element2.getBoundingClientRect());
1312
- setSelectedFiber(null);
1313
- };
1314
- const throttledMouseMove = throttle(handleMouseMove, 16);
1315
- document.addEventListener("mousemove", throttledMouseMove);
1316
- return () => {
1317
- document.removeEventListener("mousemove", throttledMouseMove);
1318
- };
1319
- }, [enabled, isDialogMode, dangerouslyRunInProduction]);
1320
- React17.useEffect(() => {
1321
- if (!rect) return;
1322
- const padding = 10;
1323
- const inspectorWidth = 400;
1324
- const inspectorHeight = 320;
1325
- let left = rect.left + rect.width + padding;
1326
- let top = rect.top;
1327
- if (left + inspectorWidth > window.innerWidth) {
1328
- left = Math.max(padding, rect.left - inspectorWidth - padding);
1329
- }
1330
- if (top >= rect.top && top <= rect.bottom) {
1331
- if (rect.bottom + inspectorHeight + padding <= window.innerHeight) {
1332
- top = rect.bottom + padding;
1333
- } else if (rect.top - inspectorHeight - padding >= 0) {
1334
- top = rect.top - inspectorHeight - padding;
1335
- } else {
1336
- top = window.innerHeight - inspectorHeight - padding;
1337
- }
1338
- }
1339
- top = Math.max(
1340
- padding,
1341
- Math.min(top, window.innerHeight - inspectorHeight - padding)
1342
- );
1343
- left = Math.max(
1344
- padding,
1345
- Math.min(left, window.innerWidth - inspectorWidth - padding)
1346
- );
1347
- setPosition({ top, left });
1348
- }, [rect]);
1349
- React17.useEffect(() => {
1350
- if (selectedFiber) {
1351
- const element2 = chunkIDXORTRQ_cjs.getNearestHostFiber(selectedFiber)?.stateNode;
1352
- if (element2) {
1299
+ if (!enabled) {
1300
+ setElement(null);
1301
+ setRect(null);
1302
+ setSelectedFiber(null);
1303
+ return;
1304
+ }
1305
+ const element2 = document.elementFromPoint(event.clientX, event.clientY);
1306
+ if (!element2) return;
1353
1307
  setElement(element2);
1354
1308
  setRect(element2.getBoundingClientRect());
1309
+ setSelectedFiber(null);
1310
+ };
1311
+ const throttledMouseMove = throttle(handleMouseMove, 16);
1312
+ document.addEventListener("mousemove", throttledMouseMove);
1313
+ return () => {
1314
+ document.removeEventListener("mousemove", throttledMouseMove);
1315
+ };
1316
+ }, [enabled, isDialogMode, dangerouslyRunInProduction]);
1317
+ React17.useEffect(() => {
1318
+ if (!rect) return;
1319
+ const padding = 10;
1320
+ const inspectorWidth = 400;
1321
+ const inspectorHeight = 320;
1322
+ let left = rect.left + rect.width + padding;
1323
+ let top = rect.top;
1324
+ if (left + inspectorWidth > window.innerWidth) {
1325
+ left = Math.max(padding, rect.left - inspectorWidth - padding);
1355
1326
  }
1356
- }
1357
- }, [selectedFiber]);
1358
- if (window.innerWidth < 800 || !rect || !isActive) return null;
1359
- const fiber = getFiberForDisplay();
1360
- if (!fiber) return null;
1361
- let foundInspect = false;
1362
- chunkIDXORTRQ_cjs.traverseFiber(
1363
- fiber,
1364
- (innerFiber) => {
1365
- if (innerFiber.type === Inspector2) {
1366
- foundInspect = true;
1367
- return true;
1327
+ if (top >= rect.top && top <= rect.bottom) {
1328
+ if (rect.bottom + inspectorHeight + padding <= window.innerHeight) {
1329
+ top = rect.bottom + padding;
1330
+ } else if (rect.top - inspectorHeight - padding >= 0) {
1331
+ top = rect.top - inspectorHeight - padding;
1332
+ } else {
1333
+ top = window.innerHeight - inspectorHeight - padding;
1334
+ }
1368
1335
  }
1369
- },
1370
- true
1371
- );
1372
- if (foundInspect) return null;
1373
- const dialogStyle = isDialogMode ? {
1374
- position: "fixed",
1375
- top: "50%",
1376
- left: "50%",
1377
- transform: "translate(-50%, -50%)",
1378
- width: "80vw",
1379
- height: "80vh",
1380
- maxWidth: "none",
1381
- maxHeight: "none",
1382
- padding: "2ch",
1383
- boxShadow: "0 0 0 5px rgba(0, 0, 0, 0.1)",
1384
- zIndex: 1e3
1385
- } : {};
1386
- const overlayStyle = isDialogMode ? {
1387
- position: "fixed",
1388
- top: 0,
1389
- left: 0,
1390
- right: 0,
1391
- bottom: 0,
1392
- backgroundColor: "rgba(0, 0, 0, 0.5)",
1393
- zIndex: 999
1394
- } : {};
1395
- const fiberStack = fiber ? chunkIDXORTRQ_cjs.getFiberStack(fiber) : [];
1396
- return /* @__PURE__ */ React17__default.default.createElement(React17__default.default.Fragment, null, isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1397
- "div",
1398
- {
1399
- style: overlayStyle,
1400
- onClick: () => setIsDialogMode(false),
1401
- onKeyDown: (e) => e.key === "Escape" && setIsDialogMode(false),
1402
- role: "button",
1403
- tabIndex: 0
1404
- }
1405
- ), /* @__PURE__ */ React17__default.default.createElement(
1406
- "div",
1407
- {
1408
- style: {
1409
- position: "fixed",
1410
- backgroundColor: "white",
1411
- zIndex: 50,
1412
- padding: "1ch",
1413
- width: "50ch",
1414
- height: "40ch",
1415
- transition: "all 150ms",
1416
- overflow: "visible",
1417
- boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
1418
- border: "1px solid black",
1419
- top: position.top,
1420
- left: position.left,
1421
- opacity: rect ? 1 : 0,
1422
- transform: rect ? "translateY(0)" : "translateY(10px)",
1423
- pointerEvents: rect ? "auto" : "none",
1424
- display: "flex",
1425
- flexDirection: "column",
1426
- ...dialogStyle
1336
+ top = Math.max(
1337
+ padding,
1338
+ Math.min(top, window.innerHeight - inspectorHeight - padding)
1339
+ );
1340
+ left = Math.max(
1341
+ padding,
1342
+ Math.min(left, window.innerWidth - inspectorWidth - padding)
1343
+ );
1344
+ setPosition({ top, left });
1345
+ }, [rect]);
1346
+ React17.useEffect(() => {
1347
+ if (selectedFiber) {
1348
+ const element2 = chunkCQFIS43Y_cjs.getNearestHostFiber(selectedFiber)?.stateNode;
1349
+ if (element2) {
1350
+ setElement(element2);
1351
+ setRect(element2.getBoundingClientRect());
1352
+ }
1427
1353
  }
1428
- },
1429
- /* @__PURE__ */ React17__default.default.createElement(
1354
+ }, [selectedFiber]);
1355
+ if (window.innerWidth < 800 || !rect || !isActive) return null;
1356
+ const fiber = getFiberForDisplay();
1357
+ if (!fiber) return null;
1358
+ let foundInspect = false;
1359
+ chunkCQFIS43Y_cjs.traverseFiber(
1360
+ fiber,
1361
+ (innerFiber) => {
1362
+ if (innerFiber.type === Inspector2) {
1363
+ foundInspect = true;
1364
+ return true;
1365
+ }
1366
+ },
1367
+ true
1368
+ );
1369
+ if (foundInspect) return null;
1370
+ const dialogStyle = isDialogMode ? {
1371
+ position: "fixed",
1372
+ top: "50%",
1373
+ left: "50%",
1374
+ transform: "translate(-50%, -50%)",
1375
+ width: "80vw",
1376
+ height: "80vh",
1377
+ maxWidth: "none",
1378
+ maxHeight: "none",
1379
+ padding: "2ch",
1380
+ boxShadow: "0 0 0 5px rgba(0, 0, 0, 0.1)",
1381
+ zIndex: 1e3
1382
+ } : {};
1383
+ const overlayStyle = isDialogMode ? {
1384
+ position: "fixed",
1385
+ top: 0,
1386
+ left: 0,
1387
+ right: 0,
1388
+ bottom: 0,
1389
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1390
+ zIndex: 999
1391
+ } : {};
1392
+ const fiberStack = fiber ? chunkCQFIS43Y_cjs.getFiberStack(fiber) : [];
1393
+ return /* @__PURE__ */ React17__default.default.createElement(React17__default.default.Fragment, null, isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1394
+ "div",
1395
+ {
1396
+ style: overlayStyle,
1397
+ onClick: () => setIsDialogMode(false),
1398
+ onKeyDown: (e) => e.key === "Escape" && setIsDialogMode(false),
1399
+ role: "button",
1400
+ tabIndex: 0
1401
+ }
1402
+ ), /* @__PURE__ */ React17__default.default.createElement(
1430
1403
  "div",
1431
1404
  {
1432
1405
  style: {
1406
+ position: "fixed",
1407
+ backgroundColor: "white",
1408
+ zIndex: 50,
1409
+ padding: "1ch",
1410
+ width: "50ch",
1411
+ height: "40ch",
1412
+ transition: "all 150ms, z-index 0ms",
1413
+ overflow: "visible",
1414
+ boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
1415
+ border: "1px solid black",
1416
+ top: position.top,
1417
+ left: position.left,
1418
+ opacity: rect ? 1 : 0,
1419
+ transform: rect ? "translateY(0)" : "translateY(10px)",
1420
+ pointerEvents: rect ? "auto" : "none",
1433
1421
  display: "flex",
1434
- justifyContent: "space-between",
1435
- alignItems: "center",
1436
- marginBottom: "1ch"
1422
+ flexDirection: "column",
1423
+ ...dialogStyle
1437
1424
  }
1438
1425
  },
1439
1426
  /* @__PURE__ */ React17__default.default.createElement(
1440
- "h3",
1427
+ "div",
1441
1428
  {
1442
1429
  style: {
1443
- fontSize: "0.875rem",
1444
- backgroundColor: "#f5f5f5",
1445
- padding: "0 0.5ch",
1446
- borderRadius: "0.125rem",
1447
- width: "fit-content",
1448
- margin: 0
1430
+ display: "flex",
1431
+ justifyContent: "space-between",
1432
+ alignItems: "center",
1433
+ marginBottom: "1ch"
1449
1434
  }
1450
1435
  },
1451
- `<${typeof fiber.type === "string" ? fiber.type : chunkIDXORTRQ_cjs.getDisplayName(fiber.type) || "unknown"}>`,
1452
- !isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1453
- "span",
1436
+ /* @__PURE__ */ React17__default.default.createElement(
1437
+ "h3",
1454
1438
  {
1455
- style: { marginLeft: "1ch", opacity: 0.5, fontSize: "0.75rem" }
1439
+ style: {
1440
+ fontSize: "0.875rem",
1441
+ backgroundColor: "#f5f5f5",
1442
+ padding: "0 0.5ch",
1443
+ borderRadius: "0.125rem",
1444
+ width: "fit-content",
1445
+ margin: 0
1446
+ }
1456
1447
  },
1457
- `Press ${isMac ? "\u2318" : "ctrl"}O to expand`
1448
+ `<${typeof fiber.type === "string" ? fiber.type : chunkCQFIS43Y_cjs.getDisplayName(fiber.type) || "unknown"}>`,
1449
+ !isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1450
+ "span",
1451
+ {
1452
+ style: {
1453
+ marginLeft: "1ch",
1454
+ opacity: 0.5,
1455
+ fontSize: "0.75rem"
1456
+ }
1457
+ },
1458
+ `Press ${isMac ? "\u2318" : "ctrl"}O to expand`
1459
+ )
1460
+ ),
1461
+ isDialogMode && fiber.child && /* @__PURE__ */ React17__default.default.createElement(
1462
+ "div",
1463
+ {
1464
+ style: {
1465
+ marginTop: "1ch",
1466
+ marginBottom: "1ch",
1467
+ marginRight: "auto",
1468
+ marginLeft: "1ch",
1469
+ fontSize: "0.75rem",
1470
+ display: "flex",
1471
+ flexWrap: "wrap",
1472
+ gap: "0.5ch"
1473
+ }
1474
+ },
1475
+ /* @__PURE__ */ React17__default.default.createElement("span", { style: { opacity: 0.5 } }, "Children:"),
1476
+ /* @__PURE__ */ React17__default.default.createElement(
1477
+ "div",
1478
+ {
1479
+ style: { display: "flex", flexWrap: "wrap", gap: "0.5ch" }
1480
+ },
1481
+ (() => {
1482
+ const children = [];
1483
+ let currentChild = fiber.child;
1484
+ while (currentChild !== null) {
1485
+ children.push(currentChild);
1486
+ currentChild = currentChild.sibling;
1487
+ }
1488
+ return children.map((child) => {
1489
+ const name = typeof child.type === "string" ? child.type : chunkCQFIS43Y_cjs.getDisplayName(child.type) || "unknown";
1490
+ return /* @__PURE__ */ React17__default.default.createElement(
1491
+ "button",
1492
+ {
1493
+ key: chunkCQFIS43Y_cjs.getFiberId(child),
1494
+ type: "button",
1495
+ onClick: () => {
1496
+ setSelectedFiber(child);
1497
+ const element2 = chunkCQFIS43Y_cjs.getNearestHostFiber(child)?.stateNode;
1498
+ if (element2) {
1499
+ setElement(element2);
1500
+ setRect(element2.getBoundingClientRect());
1501
+ }
1502
+ },
1503
+ onKeyDown: (e) => {
1504
+ if (e.key === "Enter" || e.key === " ") {
1505
+ setSelectedFiber(child);
1506
+ const element2 = chunkCQFIS43Y_cjs.getNearestHostFiber(child)?.stateNode;
1507
+ if (element2) {
1508
+ setElement(element2);
1509
+ setRect(element2.getBoundingClientRect());
1510
+ }
1511
+ }
1512
+ },
1513
+ style: {
1514
+ cursor: "pointer",
1515
+ padding: "0 0.5ch",
1516
+ background: "#f5f5f5",
1517
+ border: "1px solid #eee",
1518
+ borderRadius: "0.125rem",
1519
+ fontSize: "inherit",
1520
+ color: "#666"
1521
+ },
1522
+ onMouseEnter: (e) => {
1523
+ e.currentTarget.style.backgroundColor = "#000";
1524
+ e.currentTarget.style.color = "#fff";
1525
+ e.currentTarget.style.borderColor = "#000";
1526
+ },
1527
+ onMouseLeave: (e) => {
1528
+ e.currentTarget.style.backgroundColor = "#f5f5f5";
1529
+ e.currentTarget.style.color = "#666";
1530
+ e.currentTarget.style.borderColor = "#eee";
1531
+ }
1532
+ },
1533
+ name
1534
+ );
1535
+ });
1536
+ })()
1537
+ )
1538
+ ),
1539
+ isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1540
+ "button",
1541
+ {
1542
+ type: "button",
1543
+ onClick: () => setIsDialogMode(false),
1544
+ style: {
1545
+ border: "none",
1546
+ background: "none",
1547
+ cursor: "pointer",
1548
+ padding: "0.5ch",
1549
+ fontSize: "2ch",
1550
+ opacity: 0.5
1551
+ }
1552
+ },
1553
+ "\xD7"
1458
1554
  )
1459
1555
  ),
1460
- isDialogMode && fiber.child && /* @__PURE__ */ React17__default.default.createElement(
1556
+ isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1461
1557
  "div",
1462
1558
  {
1463
1559
  style: {
1464
- marginTop: "1ch",
1465
- marginBottom: "1ch",
1466
- marginRight: "auto",
1467
- marginLeft: "1ch",
1560
+ borderTop: "1px solid #eee",
1561
+ padding: "0.5ch 0",
1468
1562
  fontSize: "0.75rem",
1469
- display: "flex",
1470
- flexWrap: "wrap",
1471
- gap: "0.5ch"
1563
+ color: "#666",
1564
+ whiteSpace: "nowrap",
1565
+ overflow: "hidden",
1566
+ textOverflow: "ellipsis",
1567
+ marginBottom: "2ch"
1472
1568
  }
1473
1569
  },
1474
- /* @__PURE__ */ React17__default.default.createElement("span", { style: { opacity: 0.5 } }, "Children:"),
1475
- /* @__PURE__ */ React17__default.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5ch" } }, (() => {
1476
- const children = [];
1477
- let currentChild = fiber.child;
1478
- while (currentChild !== null) {
1479
- children.push(currentChild);
1480
- currentChild = currentChild.sibling;
1481
- }
1482
- return children.map((child) => {
1483
- const name = typeof child.type === "string" ? child.type : chunkIDXORTRQ_cjs.getDisplayName(child.type) || "unknown";
1484
- return /* @__PURE__ */ React17__default.default.createElement(
1485
- "button",
1486
- {
1487
- key: chunkIDXORTRQ_cjs.getFiberId(child),
1488
- type: "button",
1489
- onClick: () => {
1490
- setSelectedFiber(child);
1491
- const element2 = chunkIDXORTRQ_cjs.getNearestHostFiber(child)?.stateNode;
1570
+ fiberStack.reverse().map((f, i, arr) => {
1571
+ const name = typeof f.type === "string" ? f.type : chunkCQFIS43Y_cjs.getDisplayName(f.type) || "unknown";
1572
+ if (!name) return null;
1573
+ return /* @__PURE__ */ React17__default.default.createElement(React17__default.default.Fragment, { key: chunkCQFIS43Y_cjs.getFiberId(f) }, /* @__PURE__ */ React17__default.default.createElement(
1574
+ "button",
1575
+ {
1576
+ type: "button",
1577
+ onClick: () => {
1578
+ setSelectedFiber(f);
1579
+ const element2 = chunkCQFIS43Y_cjs.getNearestHostFiber(f)?.stateNode;
1580
+ if (element2) {
1581
+ setElement(element2);
1582
+ setRect(element2.getBoundingClientRect());
1583
+ }
1584
+ },
1585
+ onKeyDown: (e) => {
1586
+ if (e.key === "Enter" || e.key === " ") {
1587
+ setSelectedFiber(f);
1588
+ const element2 = chunkCQFIS43Y_cjs.getNearestHostFiber(f)?.stateNode;
1492
1589
  if (element2) {
1493
1590
  setElement(element2);
1494
1591
  setRect(element2.getBoundingClientRect());
1495
1592
  }
1496
- },
1497
- onKeyDown: (e) => {
1498
- if (e.key === "Enter" || e.key === " ") {
1499
- setSelectedFiber(child);
1500
- const element2 = chunkIDXORTRQ_cjs.getNearestHostFiber(child)?.stateNode;
1501
- if (element2) {
1502
- setElement(element2);
1503
- setRect(element2.getBoundingClientRect());
1504
- }
1505
- }
1506
- },
1507
- style: {
1508
- cursor: "pointer",
1509
- padding: "0 0.5ch",
1510
- background: "#f5f5f5",
1511
- border: "1px solid #eee",
1512
- borderRadius: "0.125rem",
1513
- fontSize: "inherit",
1514
- color: "#666"
1515
- },
1516
- onMouseEnter: (e) => {
1517
- e.currentTarget.style.backgroundColor = "#000";
1518
- e.currentTarget.style.color = "#fff";
1519
- e.currentTarget.style.borderColor = "#000";
1520
- },
1521
- onMouseLeave: (e) => {
1522
- e.currentTarget.style.backgroundColor = "#f5f5f5";
1523
- e.currentTarget.style.color = "#666";
1524
- e.currentTarget.style.borderColor = "#eee";
1525
1593
  }
1526
1594
  },
1527
- name
1528
- );
1529
- });
1530
- })())
1595
+ style: {
1596
+ cursor: "pointer",
1597
+ textDecoration: "underline",
1598
+ color: "#666",
1599
+ background: "none",
1600
+ border: "none",
1601
+ padding: 0,
1602
+ font: "inherit"
1603
+ },
1604
+ onMouseEnter: (e) => {
1605
+ e.currentTarget.style.backgroundColor = "#000";
1606
+ e.currentTarget.style.color = "#fff";
1607
+ },
1608
+ onMouseLeave: (e) => {
1609
+ e.currentTarget.style.backgroundColor = "";
1610
+ e.currentTarget.style.color = "#666";
1611
+ }
1612
+ },
1613
+ name
1614
+ ), i < arr.length - 1 && " > ");
1615
+ })
1531
1616
  ),
1532
- isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1533
- "button",
1617
+ /* @__PURE__ */ React17__default.default.createElement(
1618
+ "div",
1534
1619
  {
1535
- type: "button",
1536
- onClick: () => setIsDialogMode(false),
1620
+ onMouseLeave: handlePropertyLeave,
1537
1621
  style: {
1538
- border: "none",
1539
- background: "none",
1540
- cursor: "pointer",
1541
- padding: "0.5ch",
1542
- fontSize: "2ch",
1543
- opacity: 0.5
1622
+ flex: 1,
1623
+ overflow: "auto"
1544
1624
  }
1545
1625
  },
1546
- "\xD7"
1547
- )
1548
- ),
1549
- isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1550
- "div",
1551
- {
1552
- style: {
1553
- borderTop: "1px solid #eee",
1554
- padding: "0.5ch 0",
1555
- fontSize: "0.75rem",
1556
- color: "#666",
1557
- whiteSpace: "nowrap",
1558
- overflow: "hidden",
1559
- textOverflow: "ellipsis",
1560
- marginBottom: "2ch"
1561
- }
1562
- },
1563
- fiberStack.reverse().map((f, i, arr) => {
1564
- const name = typeof f.type === "string" ? f.type : chunkIDXORTRQ_cjs.getDisplayName(f.type) || "unknown";
1565
- if (!name) return null;
1566
- return /* @__PURE__ */ React17__default.default.createElement(React17__default.default.Fragment, { key: chunkIDXORTRQ_cjs.getFiberId(f) }, /* @__PURE__ */ React17__default.default.createElement(
1567
- "button",
1626
+ /* @__PURE__ */ React17__default.default.createElement(
1627
+ Inspector,
1568
1628
  {
1569
- type: "button",
1570
- onClick: () => {
1571
- setSelectedFiber(f);
1572
- const element2 = chunkIDXORTRQ_cjs.getNearestHostFiber(f)?.stateNode;
1573
- if (element2) {
1574
- setElement(element2);
1575
- setRect(element2.getBoundingClientRect());
1576
- }
1577
- },
1578
- onKeyDown: (e) => {
1579
- if (e.key === "Enter" || e.key === " ") {
1580
- setSelectedFiber(f);
1581
- const element2 = chunkIDXORTRQ_cjs.getNearestHostFiber(f)?.stateNode;
1582
- if (element2) {
1583
- setElement(element2);
1584
- setRect(element2.getBoundingClientRect());
1585
- }
1586
- }
1587
- },
1588
- style: {
1589
- cursor: "pointer",
1590
- textDecoration: "underline",
1591
- color: "#666",
1592
- background: "none",
1593
- border: "none",
1594
- padding: 0,
1595
- font: "inherit"
1596
- },
1597
- onMouseEnter: (e) => {
1598
- e.currentTarget.style.backgroundColor = "#000";
1599
- e.currentTarget.style.color = "#fff";
1600
- },
1601
- onMouseLeave: (e) => {
1602
- e.currentTarget.style.backgroundColor = "";
1603
- e.currentTarget.style.color = "#666";
1629
+ data: fiber,
1630
+ expandLevel: 1,
1631
+ table: false,
1632
+ nodeRenderer: (props) => {
1633
+ const Component = props.depth === 0 ? ObjectRootLabel : ObjectLabel;
1634
+ return /* @__PURE__ */ React17__default.default.createElement(
1635
+ "span",
1636
+ {
1637
+ onMouseEnter: (e) => handlePropertyHover(e, props.name),
1638
+ onMouseLeave: handlePropertyLeave,
1639
+ style: {
1640
+ cursor: FIBER_PROP_EXPLANATIONS[props.name] ? "help" : "default",
1641
+ padding: "1px 0",
1642
+ display: "inline-block",
1643
+ fontWeight: FIBER_PROP_EXPLANATIONS[props.name] ? 500 : "normal"
1644
+ }
1645
+ },
1646
+ /* @__PURE__ */ React17__default.default.createElement(
1647
+ Component,
1648
+ {
1649
+ name: props.name,
1650
+ data: props.data,
1651
+ isNonenumerable: props.isNonenumerable
1652
+ }
1653
+ )
1654
+ );
1604
1655
  }
1605
- },
1606
- name
1607
- ), i < arr.length - 1 && " > ");
1608
- })
1609
- ),
1610
- /* @__PURE__ */ React17__default.default.createElement(
1611
- "div",
1612
- {
1613
- onMouseLeave: handlePropertyLeave,
1614
- style: {
1615
- flex: 1,
1616
- overflow: "auto"
1617
- }
1618
- },
1619
- /* @__PURE__ */ React17__default.default.createElement(
1620
- Inspector,
1656
+ }
1657
+ )
1658
+ ),
1659
+ tooltip && /* @__PURE__ */ React17__default.default.createElement(
1660
+ "div",
1621
1661
  {
1622
- data: fiber,
1623
- expandLevel: 1,
1624
- table: false,
1625
- nodeRenderer: (props) => {
1626
- const Component = props.depth === 0 ? ObjectRootLabel : ObjectLabel;
1627
- return /* @__PURE__ */ React17__default.default.createElement(
1628
- "span",
1629
- {
1630
- onMouseEnter: (e) => handlePropertyHover(e, props.name),
1631
- style: {
1632
- cursor: FIBER_PROP_EXPLANATIONS[props.name] ? "help" : "default",
1633
- padding: "1px 0",
1634
- display: "inline-block",
1635
- fontWeight: FIBER_PROP_EXPLANATIONS[props.name] ? 500 : "normal"
1636
- }
1637
- },
1638
- /* @__PURE__ */ React17__default.default.createElement(
1639
- Component,
1640
- {
1641
- name: props.name,
1642
- data: props.data,
1643
- isNonenumerable: props.isNonenumerable
1644
- }
1645
- )
1646
- );
1662
+ style: {
1663
+ position: "absolute",
1664
+ zIndex: 1001,
1665
+ backgroundColor: "#000",
1666
+ color: "white",
1667
+ bottom: "2ch",
1668
+ right: "2ch",
1669
+ pointerEvents: "none",
1670
+ overflowY: "auto",
1671
+ padding: "1ch",
1672
+ fontSize: "1ch"
1647
1673
  }
1648
- }
1674
+ },
1675
+ tooltip
1649
1676
  )
1650
- ),
1651
- tooltip && /* @__PURE__ */ React17__default.default.createElement(
1677
+ ), !isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1652
1678
  "div",
1653
1679
  {
1654
1680
  style: {
1655
- position: "absolute",
1656
- zIndex: 1001,
1657
- backgroundColor: "#000",
1658
- color: "white",
1659
- bottom: "2ch",
1660
- right: "2ch",
1681
+ position: "fixed",
1682
+ zIndex: 40,
1661
1683
  pointerEvents: "none",
1662
- overflowY: "auto",
1663
- padding: "1ch",
1664
- fontSize: "1ch"
1684
+ transition: "all 150ms",
1685
+ border: "1px dashed #a3a3a3",
1686
+ left: rect.left,
1687
+ top: rect.top,
1688
+ width: rect.width,
1689
+ height: rect.height,
1690
+ opacity: rect ? 1 : 0
1665
1691
  }
1666
- },
1667
- tooltip
1668
- )
1669
- ), !isDialogMode && /* @__PURE__ */ React17__default.default.createElement(
1670
- "div",
1671
- {
1672
- style: {
1673
- position: "fixed",
1674
- zIndex: 40,
1675
- pointerEvents: "none",
1676
- transition: "all 150ms",
1677
- border: "1px dashed #a3a3a3",
1678
- left: rect.left,
1679
- top: rect.top,
1680
- width: rect.width,
1681
- height: rect.height,
1682
- opacity: rect ? 1 : 0
1683
1692
  }
1684
- }
1685
- ));
1686
- };
1693
+ ));
1694
+ }
1695
+ );
1687
1696
  var inspect_default = Inspector2;
1688
1697
 
1689
1698
  exports.Inspector = Inspector2;