@tscircuit/runframe 0.0.1182 → 0.0.1184

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.
@@ -1454,7 +1454,7 @@ var useErrorTelemetry = ({
1454
1454
  };
1455
1455
 
1456
1456
  // package.json
1457
- var version = "0.0.1181";
1457
+ var version = "0.0.1183";
1458
1458
  var package_default = {
1459
1459
  name: "@tscircuit/runframe",
1460
1460
  main: "dist/preview.js",
@@ -1510,7 +1510,7 @@ var package_default = {
1510
1510
  "@tscircuit/file-server": "^0.0.32",
1511
1511
  "@tscircuit/footprinter": "^0.0.236",
1512
1512
  "@tscircuit/math-utils": "^0.0.25",
1513
- "@tscircuit/pcb-viewer": "1.11.244",
1513
+ "@tscircuit/pcb-viewer": "1.11.245",
1514
1514
  "@tscircuit/props": "^0.0.365",
1515
1515
  "@tscircuit/schematic-trace-solver": "^0.0.40",
1516
1516
  "@tscircuit/schematic-viewer": "2.0.45",
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-UVCBFE3G.js";
11
+ } from "./chunk-2UCRI77K.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  useRunFrameStore,
33
33
  useRunnerStore,
34
34
  useStyles
35
- } from "./chunk-UVCBFE3G.js";
35
+ } from "./chunk-2UCRI77K.js";
36
36
 
37
37
  // lib/components/RunFrame/RunFrame.tsx
38
38
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -1138,17 +1138,44 @@ var EnhancedFileSelectorCombobox = ({
1138
1138
  window.addEventListener("keydown", handleKeyDown);
1139
1139
  return () => window.removeEventListener("keydown", handleKeyDown);
1140
1140
  }, [open, navigateUp]);
1141
- const selectFile = (filePath, index, updateFolder = false) => {
1142
- setFile(filePath);
1143
- setCurrentFileIndex(index);
1144
- setOpen(false);
1145
- onFileChange(filePath);
1146
- if (updateFolder) {
1147
- const lastSlashIndex = filePath.lastIndexOf("/");
1148
- const fileDir = lastSlashIndex === -1 ? null : filePath.substring(0, lastSlashIndex);
1149
- handleNavigateToFolder(fileDir);
1150
- }
1151
- };
1141
+ const selectFile = useCallback3(
1142
+ (filePath, index, updateFolder = false) => {
1143
+ setFile(filePath);
1144
+ setCurrentFileIndex(index);
1145
+ setOpen(false);
1146
+ onFileChange(filePath);
1147
+ if (updateFolder) {
1148
+ const lastSlashIndex = filePath.lastIndexOf("/");
1149
+ const fileDir = lastSlashIndex === -1 ? null : filePath.substring(0, lastSlashIndex);
1150
+ handleNavigateToFolder(fileDir);
1151
+ }
1152
+ },
1153
+ [onFileChange, handleNavigateToFolder]
1154
+ );
1155
+ useEffect6(() => {
1156
+ const handleKeyDown = (e) => {
1157
+ if ((e.metaKey || e.ctrlKey) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
1158
+ e.preventDefault();
1159
+ if (!currentFile || currentFiles.length === 0) return;
1160
+ const currentIndex = currentFiles.findIndex(
1161
+ (f) => f.path === currentFile
1162
+ );
1163
+ if (currentIndex === -1) return;
1164
+ let newIndex;
1165
+ if (e.key === "ArrowLeft") {
1166
+ newIndex = currentIndex === 0 ? currentFiles.length - 1 : currentIndex - 1;
1167
+ } else {
1168
+ newIndex = currentIndex === currentFiles.length - 1 ? 0 : currentIndex + 1;
1169
+ }
1170
+ const newFile = currentFiles[newIndex];
1171
+ if (newFile) {
1172
+ selectFile(newFile.path, newIndex);
1173
+ }
1174
+ }
1175
+ };
1176
+ window.addEventListener("keydown", handleKeyDown);
1177
+ return () => window.removeEventListener("keydown", handleKeyDown);
1178
+ }, [currentFile, currentFiles, selectFile]);
1152
1179
  useEffect6(() => {
1153
1180
  if (currentFiles.length > 0) {
1154
1181
  const fileInCurrentFolder = currentFiles.findIndex(