@tscircuit/runframe 0.0.1167 → 0.0.1169

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.1166";
1457
+ var version = "0.0.1168";
1458
1458
  var package_default = {
1459
1459
  name: "@tscircuit/runframe",
1460
1460
  main: "dist/preview.js",
@@ -1505,7 +1505,7 @@ var package_default = {
1505
1505
  "@tscircuit/assembly-viewer": "^0.0.5",
1506
1506
  "@tscircuit/checks": "^0.0.78",
1507
1507
  "@tscircuit/create-snippet-url": "^0.0.9",
1508
- "@tscircuit/eval": "^0.0.437",
1508
+ "@tscircuit/eval": "^0.0.438",
1509
1509
  "@tscircuit/fake-snippets": "^0.0.122",
1510
1510
  "@tscircuit/file-server": "^0.0.32",
1511
1511
  "@tscircuit/footprinter": "^0.0.236",
@@ -1736,6 +1736,7 @@ var useRunFrameStore = create2()(
1736
1736
  lastManualEditsChangeSentAt: 0,
1737
1737
  recentEvents: [],
1738
1738
  simulateScenarioOrder: void 0,
1739
+ currentMainComponentPath: null,
1739
1740
  loadInitialFiles: async () => {
1740
1741
  const fsMap = await getInitialFilesFromApi();
1741
1742
  debug2("loaded initial files", { fsMap });
@@ -1846,7 +1847,8 @@ var useRunFrameStore = create2()(
1846
1847
  JSON.stringify(updatedManualEditsFileContent, null, 2)
1847
1848
  );
1848
1849
  },
1849
- setSimulateScenarioOrder: (scenarioOrder) => set({ simulateScenarioOrder: scenarioOrder })
1850
+ setSimulateScenarioOrder: (scenarioOrder) => set({ simulateScenarioOrder: scenarioOrder }),
1851
+ setCurrentMainComponentPath: (path) => set({ currentMainComponentPath: path })
1850
1852
  }),
1851
1853
  { name: "run-frame-store" }
1852
1854
  )
@@ -4322,6 +4324,9 @@ ${globalError}`);
4322
4324
  import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
4323
4325
  var FileMenuLeftHeader = (props) => {
4324
4326
  const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
4327
+ const currentMainComponentPath = useRunFrameStore(
4328
+ (s) => s.currentMainComponentPath
4329
+ );
4325
4330
  const [snippetName, setSnippetName] = useState19(null);
4326
4331
  const [hasUnsavedChanges, setHasUnsavedChanges] = useState19(false);
4327
4332
  const [hasNeverBeenSaved, setHasNeverBeenSaved] = useState19(true);
@@ -4488,10 +4493,17 @@ var FileMenuLeftHeader = (props) => {
4488
4493
  toast.error("No Circuit JSON to export");
4489
4494
  return;
4490
4495
  }
4496
+ let projectNameFromPath = "Untitled";
4497
+ if (currentMainComponentPath) {
4498
+ const filename = currentMainComponentPath.split("/").pop();
4499
+ if (filename) {
4500
+ projectNameFromPath = filename.replace(/\.[^.]+$/, "");
4501
+ }
4502
+ }
4491
4503
  exportAndDownload({
4492
4504
  exportName: exp.name,
4493
4505
  circuitJson,
4494
- projectName: props.projectName ?? snippetName ?? "Untitled"
4506
+ projectName: props.projectName ?? snippetName ?? projectNameFromPath
4495
4507
  });
4496
4508
  },
4497
4509
  disabled: isExporting,
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-L6QZFIBV.js";
11
+ } from "./chunk-MGNUHRWN.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-L6QZFIBV.js";
35
+ } from "./chunk-MGNUHRWN.js";
36
36
 
37
37
  // lib/components/RunFrame/RunFrame.tsx
38
38
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -1483,9 +1483,10 @@ var RunFrameWithApi = (props) => {
1483
1483
  useEffect7(() => {
1484
1484
  if (props.debug) Debug3.enable("run-frame*");
1485
1485
  }, [props.debug]);
1486
- const { startPolling, stopPolling } = useRunFrameStore((s) => ({
1486
+ const { startPolling, stopPolling, setCurrentMainComponentPath } = useRunFrameStore((s) => ({
1487
1487
  startPolling: s.startPolling,
1488
- stopPolling: s.stopPolling
1488
+ stopPolling: s.stopPolling,
1489
+ setCurrentMainComponentPath: s.setCurrentMainComponentPath
1489
1490
  }));
1490
1491
  const hasReceivedInitialFiles = useHasReceivedInitialFilesLoaded();
1491
1492
  const fsMap = useRunFrameStore((s) => s.fsMap);
@@ -1561,7 +1562,13 @@ var RunFrameWithApi = (props) => {
1561
1562
  if (!componentPath) return;
1562
1563
  updateFileHash(componentPath);
1563
1564
  props.onMainComponentPathChange?.(componentPath);
1564
- }, [componentPath, props.onMainComponentPathChange, updateFileHash]);
1565
+ setCurrentMainComponentPath(componentPath);
1566
+ }, [
1567
+ componentPath,
1568
+ props.onMainComponentPathChange,
1569
+ updateFileHash,
1570
+ setCurrentMainComponentPath
1571
+ ]);
1565
1572
  useSyncPageTitle();
1566
1573
  const {
1567
1574
  editEventsForRender,