glassbox 0.1.3 → 0.1.4

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/cli.js CHANGED
@@ -1342,67 +1342,73 @@ function DiffView({ file, diff, annotations, mode }) {
1342
1342
  ] });
1343
1343
  }
1344
1344
  function SplitDiff({ hunks, annotationsByLine }) {
1345
- return /* @__PURE__ */ jsx("div", { className: "diff-table-split", children: hunks.map((hunk, hunkIdx) => {
1346
- const pairs = pairLines(hunk.lines);
1347
- return /* @__PURE__ */ jsx("div", { className: "hunk-block", children: [
1348
- /* @__PURE__ */ jsx(
1349
- "div",
1350
- {
1351
- className: "hunk-separator",
1352
- "data-hunk-idx": hunkIdx,
1353
- "data-old-start": hunk.oldStart,
1354
- "data-old-count": hunk.oldCount,
1355
- "data-new-start": hunk.newStart,
1356
- "data-new-count": hunk.newCount,
1357
- children: [
1358
- "@@ -",
1359
- hunk.oldStart,
1360
- ",",
1361
- hunk.oldCount,
1362
- " +",
1363
- hunk.newStart,
1364
- ",",
1365
- hunk.newCount,
1366
- " @@"
1367
- ]
1368
- }
1369
- ),
1370
- pairs.map((pair) => {
1371
- const leftAnns = pair.left ? annotationsByLine[`${pair.left.oldNum}:old`] ?? [] : [];
1372
- const rightAnns = pair.right ? annotationsByLine[`${pair.right.newNum}:new`] ?? [] : [];
1373
- const allAnns = [...leftAnns, ...rightAnns];
1374
- return /* @__PURE__ */ jsx("div", { children: [
1375
- /* @__PURE__ */ jsx("div", { className: "split-row", children: [
1376
- /* @__PURE__ */ jsx(
1377
- "div",
1378
- {
1379
- className: `diff-line split-left ${pair.left?.type || "empty"}`,
1380
- "data-line": pair.left?.oldNum ?? "",
1381
- "data-side": "old",
1382
- children: [
1383
- /* @__PURE__ */ jsx("span", { className: "gutter", children: pair.left?.oldNum ?? "" }),
1384
- /* @__PURE__ */ jsx("span", { className: "code", children: pair.left ? raw(escapeHtml(pair.left.content)) : "" })
1385
- ]
1386
- }
1387
- ),
1388
- /* @__PURE__ */ jsx(
1389
- "div",
1390
- {
1391
- className: `diff-line split-right ${pair.right?.type || "empty"}`,
1392
- "data-line": pair.right?.newNum ?? "",
1393
- "data-side": "new",
1394
- children: [
1395
- /* @__PURE__ */ jsx("span", { className: "gutter", children: pair.right?.newNum ?? "" }),
1396
- /* @__PURE__ */ jsx("span", { className: "code", children: pair.right ? raw(escapeHtml(pair.right.content)) : "" })
1397
- ]
1398
- }
1399
- )
1400
- ] }),
1401
- allAnns.length > 0 ? /* @__PURE__ */ jsx(AnnotationRows, { annotations: allAnns }) : null
1402
- ] });
1403
- })
1404
- ] });
1405
- }) });
1345
+ const lastHunk = hunks[hunks.length - 1];
1346
+ const tailStart = lastHunk ? lastHunk.newStart + lastHunk.newCount : 1;
1347
+ return /* @__PURE__ */ jsx("div", { className: "diff-table-split", children: [
1348
+ hunks.map((hunk, hunkIdx) => {
1349
+ const pairs = pairLines(hunk.lines);
1350
+ return /* @__PURE__ */ jsx("div", { className: "hunk-block", children: [
1351
+ /* @__PURE__ */ jsx(
1352
+ "div",
1353
+ {
1354
+ className: "hunk-separator",
1355
+ "data-hunk-idx": hunkIdx,
1356
+ "data-old-start": hunk.oldStart,
1357
+ "data-old-count": hunk.oldCount,
1358
+ "data-new-start": hunk.newStart,
1359
+ "data-new-count": hunk.newCount,
1360
+ children: [
1361
+ "@@ -",
1362
+ hunk.oldStart,
1363
+ ",",
1364
+ hunk.oldCount,
1365
+ " +",
1366
+ hunk.newStart,
1367
+ ",",
1368
+ hunk.newCount,
1369
+ " @@"
1370
+ ]
1371
+ }
1372
+ ),
1373
+ pairs.map((pair) => {
1374
+ const leftAnns = pair.left ? annotationsByLine[`${pair.left.oldNum}:old`] ?? [] : [];
1375
+ const rightAnns = pair.right ? annotationsByLine[`${pair.right.newNum}:new`] ?? [] : [];
1376
+ const allAnns = [...leftAnns, ...rightAnns];
1377
+ return /* @__PURE__ */ jsx("div", { children: [
1378
+ /* @__PURE__ */ jsx("div", { className: "split-row", children: [
1379
+ /* @__PURE__ */ jsx(
1380
+ "div",
1381
+ {
1382
+ className: `diff-line split-left ${pair.left?.type || "empty"}`,
1383
+ "data-line": pair.left?.oldNum ?? "",
1384
+ "data-side": "old",
1385
+ "data-new-line": pair.left?.newNum ?? pair.right?.newNum ?? "",
1386
+ children: [
1387
+ /* @__PURE__ */ jsx("span", { className: "gutter", children: pair.left?.oldNum ?? "" }),
1388
+ /* @__PURE__ */ jsx("span", { className: "code", children: pair.left ? raw(escapeHtml(pair.left.content)) : "" })
1389
+ ]
1390
+ }
1391
+ ),
1392
+ /* @__PURE__ */ jsx(
1393
+ "div",
1394
+ {
1395
+ className: `diff-line split-right ${pair.right?.type || "empty"}`,
1396
+ "data-line": pair.right?.newNum ?? "",
1397
+ "data-side": "new",
1398
+ children: [
1399
+ /* @__PURE__ */ jsx("span", { className: "gutter", children: pair.right?.newNum ?? "" }),
1400
+ /* @__PURE__ */ jsx("span", { className: "code", children: pair.right ? raw(escapeHtml(pair.right.content)) : "" })
1401
+ ]
1402
+ }
1403
+ )
1404
+ ] }),
1405
+ allAnns.length > 0 ? /* @__PURE__ */ jsx(AnnotationRows, { annotations: allAnns }) : null
1406
+ ] });
1407
+ })
1408
+ ] });
1409
+ }),
1410
+ /* @__PURE__ */ jsx("div", { className: "hunk-separator hunk-expander-tail", "data-start": tailStart, children: "\u2195 Show remaining lines" })
1411
+ ] });
1406
1412
  }
1407
1413
  function pairLines(lines) {
1408
1414
  const pairs = [];
@@ -1438,51 +1444,56 @@ function pairLines(lines) {
1438
1444
  return pairs;
1439
1445
  }
1440
1446
  function UnifiedDiff({ hunks, annotationsByLine }) {
1441
- return /* @__PURE__ */ jsx("div", { className: "diff-table-unified", children: hunks.map((hunk, hunkIdx) => /* @__PURE__ */ jsx("div", { className: "hunk-block", children: [
1442
- /* @__PURE__ */ jsx(
1443
- "div",
1444
- {
1445
- className: "hunk-separator",
1446
- "data-hunk-idx": hunkIdx,
1447
- "data-old-start": hunk.oldStart,
1448
- "data-old-count": hunk.oldCount,
1449
- "data-new-start": hunk.newStart,
1450
- "data-new-count": hunk.newCount,
1451
- children: [
1452
- "@@ -",
1453
- hunk.oldStart,
1454
- ",",
1455
- hunk.oldCount,
1456
- " +",
1457
- hunk.newStart,
1458
- ",",
1459
- hunk.newCount,
1460
- " @@"
1461
- ]
1462
- }
1463
- ),
1464
- hunk.lines.map((line) => {
1465
- const lineNum = line.type === "remove" ? line.oldNum : line.newNum;
1466
- const side = line.type === "remove" ? "old" : "new";
1467
- const anns = annotationsByLine[`${lineNum}:${side}`] ?? [];
1468
- return /* @__PURE__ */ jsx("div", { children: [
1469
- /* @__PURE__ */ jsx(
1470
- "div",
1471
- {
1472
- className: `diff-line ${line.type}${anns.length ? " has-annotation" : ""}`,
1473
- "data-line": lineNum,
1474
- "data-side": side,
1475
- children: [
1476
- /* @__PURE__ */ jsx("span", { className: "gutter-old", children: line.oldNum ?? "" }),
1477
- /* @__PURE__ */ jsx("span", { className: "gutter-new", children: line.newNum ?? "" }),
1478
- /* @__PURE__ */ jsx("span", { className: "code", children: raw(escapeHtml(line.content)) })
1479
- ]
1480
- }
1481
- ),
1482
- anns.length > 0 ? /* @__PURE__ */ jsx(AnnotationRows, { annotations: anns }) : null
1483
- ] });
1484
- })
1485
- ] })) });
1447
+ const lastHunk = hunks[hunks.length - 1];
1448
+ const tailStart = lastHunk ? lastHunk.newStart + lastHunk.newCount : 1;
1449
+ return /* @__PURE__ */ jsx("div", { className: "diff-table-unified", children: [
1450
+ hunks.map((hunk, hunkIdx) => /* @__PURE__ */ jsx("div", { className: "hunk-block", children: [
1451
+ /* @__PURE__ */ jsx(
1452
+ "div",
1453
+ {
1454
+ className: "hunk-separator",
1455
+ "data-hunk-idx": hunkIdx,
1456
+ "data-old-start": hunk.oldStart,
1457
+ "data-old-count": hunk.oldCount,
1458
+ "data-new-start": hunk.newStart,
1459
+ "data-new-count": hunk.newCount,
1460
+ children: [
1461
+ "@@ -",
1462
+ hunk.oldStart,
1463
+ ",",
1464
+ hunk.oldCount,
1465
+ " +",
1466
+ hunk.newStart,
1467
+ ",",
1468
+ hunk.newCount,
1469
+ " @@"
1470
+ ]
1471
+ }
1472
+ ),
1473
+ hunk.lines.map((line) => {
1474
+ const lineNum = line.type === "remove" ? line.oldNum : line.newNum;
1475
+ const side = line.type === "remove" ? "old" : "new";
1476
+ const anns = annotationsByLine[`${lineNum}:${side}`] ?? [];
1477
+ return /* @__PURE__ */ jsx("div", { children: [
1478
+ /* @__PURE__ */ jsx(
1479
+ "div",
1480
+ {
1481
+ className: `diff-line ${line.type}${anns.length ? " has-annotation" : ""}`,
1482
+ "data-line": lineNum,
1483
+ "data-side": side,
1484
+ children: [
1485
+ /* @__PURE__ */ jsx("span", { className: "gutter-old", children: line.oldNum ?? "" }),
1486
+ /* @__PURE__ */ jsx("span", { className: "gutter-new", children: line.newNum ?? "" }),
1487
+ /* @__PURE__ */ jsx("span", { className: "code", children: raw(escapeHtml(line.content)) })
1488
+ ]
1489
+ }
1490
+ ),
1491
+ anns.length > 0 ? /* @__PURE__ */ jsx(AnnotationRows, { annotations: anns }) : null
1492
+ ] });
1493
+ })
1494
+ ] })),
1495
+ /* @__PURE__ */ jsx("div", { className: "hunk-separator hunk-expander-tail", "data-start": tailStart, children: "\u2195 Show remaining lines" })
1496
+ ] });
1486
1497
  }
1487
1498
  function AnnotationRows({ annotations }) {
1488
1499
  return /* @__PURE__ */ jsx("div", { className: "annotation-row", children: annotations.map((a) => /* @__PURE__ */ jsx(
@@ -2148,7 +2159,7 @@ async function main() {
2148
2159
  }
2149
2160
  const { mode, port, resume, forceUpdateCheck, debug } = parsed;
2150
2161
  if (debug) {
2151
- console.log(`Build timestamp: ${"2026-03-06T05:23:12.429Z"}`);
2162
+ console.log(`Build timestamp: ${"2026-03-06T22:43:31.204Z"}`);
2152
2163
  }
2153
2164
  await checkForUpdates(forceUpdateCheck);
2154
2165
  const cwd = process.cwd();