@tscircuit/runframe 0.0.1457 → 0.0.1458

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/runner.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  useRunFrameStore,
35
35
  useRunnerStore,
36
36
  useStyles
37
- } from "./chunk-B4PLT3KP.js";
37
+ } from "./chunk-LBBRYYJ5.js";
38
38
 
39
39
  // lib/components/RunFrame/RunFrame.tsx
40
40
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -971,7 +971,7 @@ var CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE_
971
971
  {
972
972
  ref,
973
973
  className: cn(
974
- "rf-max-h-[300px] rf-overflow-y-auto rf-overflow-x-hidden",
974
+ "rf-max-h-[300px] rf-overflow-y-auto rf-overflow-x-hidden rf-py-1",
975
975
  className
976
976
  ),
977
977
  ...props
@@ -992,7 +992,7 @@ var CommandGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
992
992
  {
993
993
  ref,
994
994
  className: cn(
995
- "rf-overflow-hidden rf-p-1 rf-text-zinc-950 [&_[cmdk-group-heading]]:rf-px-2 [&_[cmdk-group-heading]]:rf-py-1.5 [&_[cmdk-group-heading]]:rf-text-xs [&_[cmdk-group-heading]]:rf-font-medium [&_[cmdk-group-heading]]:rf-text-zinc-500 dark:rf-text-zinc-50 dark:[&_[cmdk-group-heading]]:rf-text-zinc-400",
995
+ "rf-overflow-hidden rf-px-1 rf-py-0 rf-text-zinc-950 [&_[cmdk-group-heading]]:rf-px-2 [&_[cmdk-group-heading]]:rf-py-1.5 [&_[cmdk-group-heading]]:rf-text-xs [&_[cmdk-group-heading]]:rf-font-medium [&_[cmdk-group-heading]]:rf-text-zinc-500 dark:rf-text-zinc-50 dark:[&_[cmdk-group-heading]]:rf-text-zinc-400",
996
996
  className
997
997
  ),
998
998
  ...props
@@ -1066,14 +1066,12 @@ import {
1066
1066
  ChevronsUpDown,
1067
1067
  Check,
1068
1068
  ChevronRight,
1069
+ ChevronDown,
1069
1070
  File,
1070
1071
  FileText,
1071
1072
  Code,
1072
1073
  Folder,
1073
1074
  ArrowUp,
1074
- Star,
1075
- Eye,
1076
- EyeOff,
1077
1075
  Clock,
1078
1076
  Save
1079
1077
  } from "lucide-react";
@@ -1193,7 +1191,7 @@ var EnhancedFileSelectorCombobox = ({
1193
1191
  const [recentlyViewedFiles, setRecentlyViewedFiles] = useLocalStorageState("runframe:recentlyViewed", []);
1194
1192
  const [showRecents, setShowRecents] = useLocalStorageState(
1195
1193
  "runframe:showRecents",
1196
- true
1194
+ false
1197
1195
  );
1198
1196
  useEffect6(() => {
1199
1197
  const handleKeyDown = (e) => {
@@ -1380,7 +1378,7 @@ var EnhancedFileSelectorCombobox = ({
1380
1378
  PopoverContent,
1381
1379
  {
1382
1380
  className: cn(
1383
- "!rf-p-0 !rf-overflow-hidden !rf-z-[200]",
1381
+ "!rf-p-0 !rf-overflow-y-auto !rf-max-h-[80vh] !rf-z-[200]",
1384
1382
  getDropdownWidth()
1385
1383
  ),
1386
1384
  children: /* @__PURE__ */ jsxs5(Command, { shouldFilter: false, children: [
@@ -1393,7 +1391,53 @@ var EnhancedFileSelectorCombobox = ({
1393
1391
  onValueChange: setSearchValue
1394
1392
  }
1395
1393
  ),
1396
- /* @__PURE__ */ jsxs5("div", { className: "rf-px-3 rf-py-2 rf-border-t rf-border-b rf-border-gray-200 rf-bg-slate-50 rf-flex rf-items-center rf-justify-between rf-gap-2", children: [
1394
+ recentFiles.length > 0 && /* @__PURE__ */ jsxs5("div", { className: "rf-border-b rf-border-gray-200", children: [
1395
+ /* @__PURE__ */ jsxs5(
1396
+ "button",
1397
+ {
1398
+ onClick: () => setShowRecents(!showRecents),
1399
+ className: "rf-w-full rf-px-3 rf-py-2 rf-flex rf-items-center rf-justify-between rf-text-xs rf-text-slate-600 hover:rf-bg-slate-50 rf-bg-transparent rf-border-none rf-cursor-pointer",
1400
+ children: [
1401
+ /* @__PURE__ */ jsx6("span", { className: "rf-font-medium", children: "Recent Files" }),
1402
+ /* @__PURE__ */ jsx6(
1403
+ ChevronDown,
1404
+ {
1405
+ className: cn(
1406
+ "rf-h-4 rf-w-4 rf-transition-transform",
1407
+ !showRecents && "-rf-rotate-90"
1408
+ )
1409
+ }
1410
+ )
1411
+ ]
1412
+ }
1413
+ ),
1414
+ showRecents && /* @__PURE__ */ jsx6("div", { className: "rf-pb-1", children: recentFiles.map((item, index) => /* @__PURE__ */ jsxs5(
1415
+ "div",
1416
+ {
1417
+ onClick: () => selectFile(item.path, index, true),
1418
+ className: cn(
1419
+ "rf-flex rf-items-center rf-px-3 rf-py-1.5 rf-cursor-pointer hover:rf-bg-slate-100",
1420
+ item.path === currentFile && "rf-font-medium"
1421
+ ),
1422
+ children: [
1423
+ item.type === "saved" ? /* @__PURE__ */ jsx6("span", { title: "Recently saved", children: /* @__PURE__ */ jsx6(Save, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-green-500" }) }) : /* @__PURE__ */ jsx6("span", { title: "Recently viewed", children: /* @__PURE__ */ jsx6(Clock, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-blue-500" }) }),
1424
+ /* @__PURE__ */ jsx6("span", { className: "rf-text-sm", children: getDisplayName(item.path.split("/").pop() || "") }),
1425
+ /* @__PURE__ */ jsx6("span", { className: "rf-text-xs rf-text-muted-foreground rf-ml-2 rf-truncate rf-max-w-[40%]", children: getDirectoryPath2(item.path) }),
1426
+ /* @__PURE__ */ jsx6(
1427
+ Check,
1428
+ {
1429
+ className: cn(
1430
+ "rf-ml-auto rf-h-4 rf-w-4",
1431
+ item.path === currentFile ? "rf-opacity-100" : "rf-opacity-0"
1432
+ )
1433
+ }
1434
+ )
1435
+ ]
1436
+ },
1437
+ item.path
1438
+ )) })
1439
+ ] }),
1440
+ /* @__PURE__ */ jsxs5("div", { className: "rf-px-3 rf-py-2 rf-bg-slate-50 rf-flex rf-items-center rf-justify-between rf-gap-2", children: [
1397
1441
  /* @__PURE__ */ jsx6("div", { className: "rf-flex rf-items-center rf-text-xs rf-text-slate-600 rf-min-w-0 rf-flex-1", children: /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-items-center rf-min-w-0", children: [
1398
1442
  /* @__PURE__ */ jsx6(
1399
1443
  "button",
@@ -1446,182 +1490,54 @@ var EnhancedFileSelectorCombobox = ({
1446
1490
  }
1447
1491
  ) })
1448
1492
  ] }),
1449
- /* @__PURE__ */ jsx6(CommandList, { className: "rf-max-h-[70vh] rf-overflow-y-auto", children: !isSearching ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
1493
+ /* @__PURE__ */ jsx6(CommandList, { className: "rf-overflow-visible rf-max-h-none", children: !isSearching ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
1450
1494
  /* @__PURE__ */ jsx6(CommandEmpty, { children: emptyMessage }),
1451
- recentFiles.length > 0 && /* @__PURE__ */ jsx6(
1452
- CommandGroup,
1495
+ currentFiles.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { children: currentFiles.map((fileNode, index) => /* @__PURE__ */ jsxs5(
1496
+ CommandItem,
1453
1497
  {
1454
- heading: /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-items-center rf-gap-0", children: [
1455
- /* @__PURE__ */ jsx6("span", { className: "rf-leading-none", children: "Recent Files" }),
1456
- /* @__PURE__ */ jsx6(
1457
- "button",
1498
+ value: `current:${fileNode.path}`,
1499
+ onSelect: () => selectFile(fileNode.path, index),
1500
+ className: cn(
1501
+ fileNode.path === currentFile && "rf-font-medium",
1502
+ "rf-group"
1503
+ ),
1504
+ children: [
1505
+ /* @__PURE__ */ jsx6("span", { className: "rf-mr-2", children: defaultFileIcon(fileNode.name) }),
1506
+ getDisplayName(fileNode.name),
1507
+ /* @__PURE__ */ jsx6("div", { className: "rf-ml-auto rf-flex rf-items-center rf-gap-1", children: /* @__PURE__ */ jsx6(
1508
+ Check,
1458
1509
  {
1459
- onClick: () => setShowRecents(!showRecents),
1460
- className: "rf-flex rf-items-center rf-justify-center rf-text-slate-600 hover:rf-text-slate-800 rf-bg-transparent rf-border-none rf-p-0 rf-w-3.5 rf-h-3.5 rf-ml-2",
1461
- title: showRecents ? "Hide recent files" : "Show recent files",
1462
- children: showRecents ? /* @__PURE__ */ jsx6(Eye, { className: "rf-h-3.5 rf-w-3.5" }) : /* @__PURE__ */ jsx6(EyeOff, { className: "rf-h-3.5 rf-w-3.5" })
1463
- }
1464
- )
1465
- ] }),
1466
- className: "rf-border-b rf-border-gray-200 rf-pb-1 rf-bg-blue-50/30",
1467
- children: showRecents && recentFiles.map((item, index) => /* @__PURE__ */ jsxs5(
1468
- CommandItem,
1469
- {
1470
- value: `recent:${item.path}`,
1471
- onSelect: () => selectFile(item.path, index, true),
1472
- className: cn(
1473
- item.path === currentFile && "rf-font-medium"
1474
- ),
1475
- children: [
1476
- item.type === "saved" ? /* @__PURE__ */ jsx6("span", { title: "Recently saved", children: /* @__PURE__ */ jsx6(Save, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-green-500" }) }) : /* @__PURE__ */ jsx6("span", { title: "Recently viewed", children: /* @__PURE__ */ jsx6(Clock, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-blue-500" }) }),
1477
- getDisplayName(item.path.split("/").pop() || ""),
1478
- /* @__PURE__ */ jsx6("span", { className: "rf-text-xs rf-text-muted-foreground rf-ml-2 rf-truncate rf-max-w-[40%]", children: getDirectoryPath2(item.path) }),
1479
- /* @__PURE__ */ jsx6(
1480
- Check,
1481
- {
1482
- className: cn(
1483
- "rf-ml-auto rf-h-4 rf-w-4",
1484
- item.path === currentFile ? "rf-opacity-100" : "rf-opacity-0"
1485
- )
1486
- }
1487
- )
1488
- ]
1489
- },
1490
- item.path
1491
- ))
1492
- }
1493
- ),
1494
- pinnedFiles.length > 0 && /* @__PURE__ */ jsx6(
1495
- CommandGroup,
1496
- {
1497
- heading: "Favorites",
1498
- className: "rf-border-b rf-border-gray-200 rf-pb-1 rf-bg-amber-50/30",
1499
- children: pinnedFiles.filter((path) => filteredFiles.includes(path)).map((path, index) => /* @__PURE__ */ jsxs5(
1500
- CommandItem,
1501
- {
1502
- value: `favorite:${path}`,
1503
- onSelect: () => selectFile(path, index, true),
1504
- className: cn(
1505
- path === currentFile && "rf-font-medium",
1506
- "rf-group"
1507
- ),
1508
- children: [
1509
- onToggleFavorite && /* @__PURE__ */ jsx6(
1510
- "button",
1511
- {
1512
- type: "button",
1513
- onClick: (e) => {
1514
- e.stopPropagation();
1515
- onToggleFavorite(path);
1516
- },
1517
- className: "rf-mr-2 rf-p-0 rf-bg-transparent rf-border-none",
1518
- "aria-label": "Remove from favorites",
1519
- title: "Remove from favorites",
1520
- children: /* @__PURE__ */ jsx6(Star, { className: "rf-h-4 rf-w-4 rf-text-amber-500 rf-fill-amber-500" })
1521
- }
1522
- ),
1523
- getDisplayName(path.split("/").pop() || ""),
1524
- /* @__PURE__ */ jsx6("span", { className: "rf-text-xs rf-text-muted-foreground rf-ml-2 rf-truncate rf-max-w-[40%]", children: getDirectoryPath2(path) }),
1525
- /* @__PURE__ */ jsx6(
1526
- Check,
1527
- {
1528
- className: cn(
1529
- "rf-ml-auto rf-h-4 rf-w-4",
1530
- path === currentFile ? "rf-opacity-100" : "rf-opacity-0"
1531
- )
1532
- }
1510
+ className: cn(
1511
+ "rf-h-4 rf-w-4",
1512
+ fileNode.path === currentFile ? "rf-opacity-100" : "rf-opacity-0"
1533
1513
  )
1534
- ]
1535
- },
1536
- path
1537
- ))
1538
- }
1539
- ),
1540
- currentFiles.length > 0 && /* @__PURE__ */ jsx6(
1541
- CommandGroup,
1542
- {
1543
- className: `rf-border-b rf-border-gray-200 rf-pb-1`,
1544
- children: currentFiles.map((fileNode, index) => /* @__PURE__ */ jsxs5(
1545
- CommandItem,
1546
- {
1547
- value: `current:${fileNode.path}`,
1548
- onSelect: () => selectFile(fileNode.path, index),
1549
- className: cn(
1550
- fileNode.path === currentFile && "rf-font-medium",
1551
- "rf-group"
1552
- ),
1553
- children: [
1554
- /* @__PURE__ */ jsx6("span", { className: "rf-mr-2", children: defaultFileIcon(fileNode.name) }),
1555
- getDisplayName(fileNode.name),
1556
- /* @__PURE__ */ jsxs5("div", { className: "rf-ml-auto rf-flex rf-items-center rf-gap-1", children: [
1557
- onToggleFavorite && /* @__PURE__ */ jsx6(
1558
- "button",
1559
- {
1560
- type: "button",
1561
- onClick: (e) => {
1562
- e.stopPropagation();
1563
- onToggleFavorite(fileNode.path);
1564
- },
1565
- className: cn(
1566
- "rf-p-1 rf-rounded hover:rf-bg-slate-200 rf-transition-opacity",
1567
- pinnedFiles.includes(fileNode.path) ? "rf-opacity-100" : "rf-opacity-0 group-hover:rf-opacity-100"
1568
- ),
1569
- "aria-label": pinnedFiles.includes(fileNode.path) ? "Remove from favorites" : "Add to favorites",
1570
- title: pinnedFiles.includes(fileNode.path) ? "Remove from favorites" : "Add to favorites",
1571
- children: /* @__PURE__ */ jsx6(
1572
- Star,
1573
- {
1574
- className: cn(
1575
- "rf-h-3 rf-w-3",
1576
- pinnedFiles.includes(fileNode.path) ? "rf-text-amber-500 rf-fill-amber-500" : "rf-text-slate-400"
1577
- )
1578
- }
1579
- )
1580
- }
1581
- ),
1582
- /* @__PURE__ */ jsx6(
1583
- Check,
1584
- {
1585
- className: cn(
1586
- "rf-h-4 rf-w-4",
1587
- fileNode.path === currentFile ? "rf-opacity-100" : "rf-opacity-0"
1588
- )
1589
- }
1590
- )
1591
- ] })
1592
- ]
1593
- },
1594
- fileNode.path
1595
- ))
1596
- }
1597
- ),
1598
- currentFolders.length > 0 && /* @__PURE__ */ jsx6(
1599
- CommandGroup,
1514
+ }
1515
+ ) })
1516
+ ]
1517
+ },
1518
+ fileNode.path
1519
+ )) }),
1520
+ currentFolders.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { children: currentFolders.map((folderNode) => /* @__PURE__ */ jsxs5(
1521
+ CommandItem,
1600
1522
  {
1601
- className: `rf-border-b rf-border-gray-200 rf-pb-1`,
1602
- children: currentFolders.map((folderNode) => /* @__PURE__ */ jsxs5(
1603
- CommandItem,
1604
- {
1605
- value: `folder-${folderNode.path}`,
1606
- onSelect: () => handleNavigateToFolder(folderNode.path),
1607
- className: "rf-text-slate-600 hover:rf-text-slate-900",
1608
- children: [
1609
- /* @__PURE__ */ jsx6(Folder, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-blue-600" }),
1610
- folderNode.name,
1611
- /* @__PURE__ */ jsx6(ChevronRight, { className: "rf-ml-auto rf-h-4 rf-w-4" })
1612
- ]
1613
- },
1614
- folderNode.path
1615
- ))
1616
- }
1617
- ),
1523
+ value: `folder-${folderNode.path}`,
1524
+ onSelect: () => handleNavigateToFolder(folderNode.path),
1525
+ className: "rf-text-slate-600 hover:rf-text-slate-900",
1526
+ children: [
1527
+ /* @__PURE__ */ jsx6(Folder, { className: "rf-mr-2 rf-h-4 rf-w-4 rf-text-blue-600" }),
1528
+ folderNode.name,
1529
+ /* @__PURE__ */ jsx6(ChevronRight, { className: "rf-ml-auto rf-h-4 rf-w-4" })
1530
+ ]
1531
+ },
1532
+ folderNode.path
1533
+ )) }),
1618
1534
  currentFiles.length === 0 && currentFolders.length === 0 && /* @__PURE__ */ jsx6("div", { className: "rf-p-4 rf-text-center rf-text-slate-500 rf-text-sm", children: "No files or folders in this directory" })
1619
1535
  ] }) : /* @__PURE__ */ jsx6(Fragment2, { children: searchResults.currentDirResults.length === 0 && searchResults.globalResults.length === 0 ? /* @__PURE__ */ jsxs5(CommandEmpty, { children: [
1620
1536
  'No files found matching "',
1621
1537
  searchValue,
1622
1538
  '".'
1623
1539
  ] }) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
1624
- searchResults.currentDirResults.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { className: "rf-border-b rf-border-gray-200 rf-pb-1", children: searchResults.currentDirResults.map(
1540
+ searchResults.currentDirResults.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { children: searchResults.currentDirResults.map(
1625
1541
  (file2, index) => /* @__PURE__ */ jsxs5(
1626
1542
  CommandItem,
1627
1543
  {
@@ -1640,31 +1556,6 @@ var EnhancedFileSelectorCombobox = ({
1640
1556
  /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-items-center rf-w-full rf-min-w-0", children: [
1641
1557
  /* @__PURE__ */ jsx6("span", { className: "rf-truncate rf-flex-1", children: getDisplayName(file2.fileName) }),
1642
1558
  /* @__PURE__ */ jsx6("span", { className: "rf-text-xs rf-text-muted-foreground rf-ml-2 rf-truncate rf-max-w-[40%]", children: currentFolder || "/" }),
1643
- onToggleFavorite && /* @__PURE__ */ jsx6(
1644
- "button",
1645
- {
1646
- type: "button",
1647
- onClick: (e) => {
1648
- e.stopPropagation();
1649
- onToggleFavorite(file2.path);
1650
- },
1651
- className: cn(
1652
- "rf-p-1 rf-rounded hover:rf-bg-slate-200 rf-transition-opacity rf-ml-2",
1653
- pinnedFiles.includes(file2.path) ? "rf-opacity-100" : "rf-opacity-0 group-hover:rf-opacity-100"
1654
- ),
1655
- "aria-label": pinnedFiles.includes(file2.path) ? "Remove from favorites" : "Add to favorites",
1656
- title: pinnedFiles.includes(file2.path) ? "Remove from favorites" : "Add to favorites",
1657
- children: /* @__PURE__ */ jsx6(
1658
- Star,
1659
- {
1660
- className: cn(
1661
- "rf-h-3 rf-w-3",
1662
- pinnedFiles.includes(file2.path) ? "rf-text-amber-500 rf-fill-amber-500" : "rf-text-slate-400"
1663
- )
1664
- }
1665
- )
1666
- }
1667
- ),
1668
1559
  file2.path === currentFile && /* @__PURE__ */ jsx6(Check, { className: "rf-ml-2 rf-h-4 rf-w-4 rf-flex-shrink-0" })
1669
1560
  ] })
1670
1561
  ]
@@ -1672,7 +1563,7 @@ var EnhancedFileSelectorCombobox = ({
1672
1563
  file2.path
1673
1564
  )
1674
1565
  ) }),
1675
- searchResults.globalResults.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { className: "rf-pb-1", children: searchResults.globalResults.map((file2) => /* @__PURE__ */ jsxs5(
1566
+ searchResults.globalResults.length > 0 && /* @__PURE__ */ jsx6(CommandGroup, { children: searchResults.globalResults.map((file2) => /* @__PURE__ */ jsxs5(
1676
1567
  CommandItem,
1677
1568
  {
1678
1569
  value: `search-global:${file2.path}`,
@@ -1690,29 +1581,6 @@ var EnhancedFileSelectorCombobox = ({
1690
1581
  /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-items-center rf-w-full rf-min-w-0", children: [
1691
1582
  /* @__PURE__ */ jsx6("span", { className: "rf-truncate rf-flex-1", children: getDisplayName(file2.fileName) }),
1692
1583
  /* @__PURE__ */ jsx6("span", { className: "rf-text-xs rf-text-muted-foreground rf-ml-2 rf-truncate rf-max-w-[40%]", children: getDirectoryPath2(file2.path) }),
1693
- onToggleFavorite && /* @__PURE__ */ jsx6(
1694
- "button",
1695
- {
1696
- onClick: (e) => {
1697
- e.stopPropagation();
1698
- onToggleFavorite(file2.path);
1699
- },
1700
- className: cn(
1701
- "rf-p-1 rf-rounded hover:rf-bg-slate-200 rf-transition-opacity rf-ml-2",
1702
- pinnedFiles.includes(file2.path) ? "rf-opacity-100" : "rf-opacity-0 group-hover:rf-opacity-100"
1703
- ),
1704
- title: pinnedFiles.includes(file2.path) ? "Remove from favorites" : "Add to favorites",
1705
- children: /* @__PURE__ */ jsx6(
1706
- Star,
1707
- {
1708
- className: cn(
1709
- "rf-h-3 rf-w-3",
1710
- pinnedFiles.includes(file2.path) ? "rf-text-amber-500 rf-fill-amber-500" : "rf-text-slate-400"
1711
- )
1712
- }
1713
- )
1714
- }
1715
- ),
1716
1584
  file2.path === currentFile && /* @__PURE__ */ jsx6(Check, { className: "rf-ml-2 rf-h-4 rf-w-4 rf-flex-shrink-0" })
1717
1585
  ] })
1718
1586
  ]