@tscircuit/runframe 0.0.1616 → 0.0.1617

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.
@@ -1730,7 +1730,7 @@ var useErrorTelemetry = ({
1730
1730
  };
1731
1731
 
1732
1732
  // package.json
1733
- var version = "0.0.1615";
1733
+ var version = "0.0.1616";
1734
1734
  var package_default = {
1735
1735
  name: "@tscircuit/runframe",
1736
1736
  main: "dist/preview.js",
@@ -3803,6 +3803,17 @@ var exportLbrn = async ({
3803
3803
  }
3804
3804
  };
3805
3805
 
3806
+ // lib/utils/sanitizeFileName.ts
3807
+ var sanitizeFileName = (name) => {
3808
+ let sanitized = name.trim().replace(/[\\/:*?"<>|]/g, "_").replace(/[\x00-\x1f]/g, "").replace(/^\.+/, "").replace(/\.+$/, "").replace(/\s+/g, " ").replace(/_+/g, "_");
3809
+ const reserved = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;
3810
+ if (reserved.test(sanitized)) {
3811
+ sanitized = `_${sanitized}`;
3812
+ }
3813
+ sanitized = sanitized.slice(0, 200);
3814
+ return sanitized || "untitled";
3815
+ };
3816
+
3806
3817
  // lib/optional-features/exporting/export-and-download.ts
3807
3818
  var availableExports = [
3808
3819
  { extension: "json", name: "Circuit JSON" },
@@ -3821,8 +3832,9 @@ var availableExports = [
3821
3832
  var exportAndDownload = async ({
3822
3833
  exportName,
3823
3834
  circuitJson,
3824
- projectName
3835
+ projectName: rawProjectName
3825
3836
  }) => {
3837
+ const projectName = sanitizeFileName(rawProjectName);
3826
3838
  if (exportName === "Fabrication Files") {
3827
3839
  exportFabricationFiles({ circuitJson, projectName });
3828
3840
  return;
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-4UIV4TIV.js";
11
+ } from "./chunk-MAZDFHZX.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  useRunFrameStore,
35
35
  useRunnerStore,
36
36
  useStyles
37
- } from "./chunk-4UIV4TIV.js";
37
+ } from "./chunk-MAZDFHZX.js";
38
38
 
39
39
  // lib/components/RunFrame/RunFrame.tsx
40
40
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";