@tscircuit/runframe 0.0.448 → 0.0.450

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.
@@ -329,7 +329,7 @@ var AutoroutingLogOptions = ({
329
329
  onClick: (e) => {
330
330
  e.stopPropagation();
331
331
  if (onReportAutoroutingLog) {
332
- onReportAutoroutingLog(key, simpleRouteJson);
332
+ onReportAutoroutingLog(key, { simpleRouteJson });
333
333
  }
334
334
  },
335
335
  children: [
@@ -392,6 +392,7 @@ var ErrorTabContent = ({
392
392
  /* @__PURE__ */ jsx6(
393
393
  "button",
394
394
  {
395
+ type: "button",
395
396
  className: "rf-p-1 rf-rounded-sm rf-transition-colors",
396
397
  onClick: handlePrev,
397
398
  disabled: currentErrorIndex === 0,
@@ -401,6 +402,7 @@ var ErrorTabContent = ({
401
402
  /* @__PURE__ */ jsx6(
402
403
  "button",
403
404
  {
405
+ type: "button",
404
406
  className: "rf-p-1 rf-rounded-sm rf-transition-colors",
405
407
  onClick: handleNext,
406
408
  disabled: currentErrorIndex === circuitJsonErrors.length - 1,
@@ -1092,7 +1094,7 @@ var RenderLogViewer = ({
1092
1094
  };
1093
1095
 
1094
1096
  // package.json
1095
- var version = "0.0.447";
1097
+ var version = "0.0.449";
1096
1098
 
1097
1099
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
1098
1100
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -1137,7 +1139,9 @@ var CircuitJsonPreview = ({
1137
1139
  useStyles();
1138
1140
  const circuitJsonErrors = useMemo(() => {
1139
1141
  if (!circuitJson) return null;
1140
- return circuitJson.filter((e) => e && "error_type" in e);
1142
+ return circuitJson.filter(
1143
+ (e) => e && "error_type" in e || e.type.includes("error")
1144
+ );
1141
1145
  }, [circuitJson]);
1142
1146
  const [activeTab, setActiveTabState] = useState5(
1143
1147
  defaultActiveTab ?? "pcb"
@@ -1431,7 +1435,7 @@ var CircuitJsonPreview = ({
1431
1435
  "rf-overflow-auto",
1432
1436
  isFullScreen ? "rf-h-[calc(100vh-96px)]" : "rf-h-[620px]"
1433
1437
  ),
1434
- children: Array.isArray(circuitJsonErrors) && circuitJsonErrors.length > 0 || errorMessage ? /* @__PURE__ */ jsx16(
1438
+ children: circuitJson ? /* @__PURE__ */ jsx16(
1435
1439
  ErrorTabContent,
1436
1440
  {
1437
1441
  code,
@@ -2123,6 +2127,7 @@ export {
2123
2127
  API_BASE,
2124
2128
  useRunFrameStore,
2125
2129
  toast,
2130
+ registryKy,
2126
2131
  useOrderDialogCli,
2127
2132
  useOrderDialog,
2128
2133
  CadViewer2 as CadViewer,
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-KJJCHX5J.js";
11
+ } from "./chunk-ILEASZAQ.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -22,11 +22,12 @@ import {
22
22
  cn,
23
23
  debug_default,
24
24
  linkify,
25
+ registryKy,
25
26
  toast,
26
27
  useOrderDialog,
27
28
  useOrderDialogCli,
28
29
  useRunFrameStore
29
- } from "./chunk-KJJCHX5J.js";
30
+ } from "./chunk-ILEASZAQ.js";
30
31
 
31
32
  // lib/components/RunFrame/RunFrame.tsx
32
33
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -340,6 +341,26 @@ var RunFrame = (props) => {
340
341
  }, 100);
341
342
  }
342
343
  };
344
+ const handleReportAutoroutingLog = async (name, data) => {
345
+ await registryKy.post("autorouting/bug_reports/create", {
346
+ json: {
347
+ title: name,
348
+ simple_route_json: data.simpleRouteJson
349
+ }
350
+ }).json().then(({ autorouting_bug_report }) => {
351
+ window.open(
352
+ `https://api.tscircuit.com/autorouting/bug_reports/view?autorouting_bug_report_id=${autorouting_bug_report.autorouting_bug_report_id}`,
353
+ "_blank"
354
+ );
355
+ }).catch((error2) => {
356
+ console.error("Failed to report autorouting bug", error2);
357
+ if (error2.message.includes("401")) {
358
+ alert("You must be logged in to report autorouting bugs");
359
+ } else {
360
+ alert(`Failed to report autorouting bug: ${error2.message}`);
361
+ }
362
+ });
363
+ };
343
364
  return /* @__PURE__ */ jsx(
344
365
  CircuitJsonPreview,
345
366
  {
@@ -347,7 +368,7 @@ var RunFrame = (props) => {
347
368
  showToggleFullScreen: props.showToggleFullScreen,
348
369
  autoroutingGraphics,
349
370
  autoroutingLog,
350
- onReportAutoroutingLog: props.onReportAutoroutingLog,
371
+ onReportAutoroutingLog: props.onReportAutoroutingLog || handleReportAutoroutingLog,
351
372
  leftHeaderContent: /* @__PURE__ */ jsxs(Fragment, { children: [
352
373
  props.showRunButton && /* @__PURE__ */ jsxs("div", { className: "rf-relative rf-inline-flex", children: [
353
374
  /* @__PURE__ */ jsxs(