@tscircuit/runframe 0.0.543 → 0.0.545

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.
@@ -354,7 +354,8 @@ var ErrorTabContent = ({
354
354
  autoroutingLog,
355
355
  circuitJsonErrors,
356
356
  onReportAutoroutingLog,
357
- errorMessage
357
+ errorMessage,
358
+ errorStack
358
359
  }) => {
359
360
  if (!errorMessage && !circuitJsonErrors) {
360
361
  return /* @__PURE__ */ jsxs4("div", { className: "px-2", children: [
@@ -384,7 +385,15 @@ var ErrorTabContent = ({
384
385
  /* @__PURE__ */ jsxs4("div", { className: "rf-w-[95%] rf-mx-auto", children: [
385
386
  errorMessage && /* @__PURE__ */ jsxs4("div", { className: "rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200 rf-p-4", children: [
386
387
  /* @__PURE__ */ jsx6("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-1", children: "Execution Error" }),
387
- /* @__PURE__ */ jsx6("p", { className: "rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600", children: errorMessage })
388
+ /* @__PURE__ */ jsx6("p", { className: "rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600", children: errorMessage }),
389
+ errorStack && /* @__PURE__ */ jsx6(
390
+ "details",
391
+ {
392
+ style: { whiteSpace: "pre-wrap" },
393
+ className: "rf-text-xs rf-font-mono rf-text-red-600 rf-mt-2",
394
+ children: errorStack
395
+ }
396
+ )
388
397
  ] }),
389
398
  circuitJsonErrors && circuitJsonErrors.length > 0 && /* @__PURE__ */ jsxs4(Fragment2, { children: [
390
399
  /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-items-center rf-gap-2 rf-mb-2", children: [
@@ -435,9 +444,13 @@ var ErrorTabContent = ({
435
444
  variant: "outline",
436
445
  className: "rf-p-1",
437
446
  onClick: () => {
438
- const activeError = circuitJsonErrors[currentErrorIndex];
447
+ const activeError = circuitJsonErrors ? circuitJsonErrors[currentErrorIndex] : {
448
+ type: "Execution Error",
449
+ message: errorMessage ?? "",
450
+ stack: errorStack ?? ""
451
+ };
439
452
  navigator.clipboard.writeText(
440
- `${activeError.type}: ${activeError.message}`
453
+ `${activeError.type}: ${activeError.message}${activeError.stack ? "\n" + activeError.stack : ""}`
441
454
  );
442
455
  alert("Error copied to clipboard!");
443
456
  },
@@ -455,16 +468,17 @@ var ErrorTabContent = ({
455
468
  onClick: () => {
456
469
  const error = circuitJsonErrors ? circuitJsonErrors[currentErrorIndex] : {
457
470
  type: "Execution Error",
458
- message: errorMessage ?? ""
471
+ message: errorMessage ?? "",
472
+ stack: errorStack ?? ""
459
473
  };
460
474
  const title = `Error: ${error.type}`.replace(/[^a-zA-Z0-9 ]/g, " ").replace(/\s+/g, " ").slice(0, 100);
461
475
  const url = createSnippetUrl(code ?? "");
462
476
  let body = `[Snippet code to reproduce](${url})
463
477
 
464
478
  ### Error
465
- \\
466
- ${error.type}: ${error.message}
467
- \\
479
+ \`\`\`
480
+ ${error.type}: ${error.message}${error.stack ? "\n" + error.stack : ""}
481
+ \`\`\`
468
482
  `;
469
483
  if (body.length > 4e3) {
470
484
  body = `\`\`\`tsx
@@ -1093,7 +1107,7 @@ var RenderLogViewer = ({
1093
1107
  };
1094
1108
 
1095
1109
  // package.json
1096
- var version = "0.0.542";
1110
+ var version = "0.0.544";
1097
1111
 
1098
1112
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
1099
1113
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -1108,6 +1122,7 @@ var CircuitJsonPreview = ({
1108
1122
  code,
1109
1123
  onRunClicked = void 0,
1110
1124
  errorMessage,
1125
+ errorStack,
1111
1126
  circuitJson,
1112
1127
  autoroutingGraphics,
1113
1128
  showRightHeaderContent = true,
@@ -1439,6 +1454,7 @@ var CircuitJsonPreview = ({
1439
1454
  code,
1440
1455
  circuitJsonErrors,
1441
1456
  errorMessage,
1457
+ errorStack,
1442
1458
  autoroutingLog,
1443
1459
  onReportAutoroutingLog
1444
1460
  }
package/dist/preview.d.ts CHANGED
@@ -35,6 +35,7 @@ interface PreviewContentProps {
35
35
  onRunClicked?: () => void;
36
36
  tsxRunTriggerCount?: number;
37
37
  errorMessage?: string | null;
38
+ errorStack?: string | null;
38
39
  autoroutingGraphics?: any;
39
40
  circuitJson: CircuitJson | null;
40
41
  className?: string;
@@ -82,7 +83,7 @@ declare global {
82
83
  }
83
84
  }
84
85
 
85
- declare const CircuitJsonPreview: ({ code, onRunClicked, errorMessage, circuitJson, autoroutingGraphics, showRightHeaderContent, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, autoroutingLog, onReportAutoroutingLog, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, autoRotate3dViewerDisabled, showSchematicDebugGrid, showToggleFullScreen, defaultToFullScreen, }: PreviewContentProps) => react_jsx_runtime.JSX.Element;
86
+ declare const CircuitJsonPreview: ({ code, onRunClicked, errorMessage, errorStack, circuitJson, autoroutingGraphics, showRightHeaderContent, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, autoroutingLog, onReportAutoroutingLog, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, autoRotate3dViewerDisabled, showSchematicDebugGrid, showToggleFullScreen, defaultToFullScreen, }: PreviewContentProps) => react_jsx_runtime.JSX.Element;
86
87
 
87
88
  interface BomTableProps {
88
89
  circuitJson: AnyCircuitElement[];
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-VPRYWNJP.js";
11
+ } from "./chunk-4HZCS2EN.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  useOrderDialog,
28
28
  useOrderDialogCli,
29
29
  useRunFrameStore
30
- } from "./chunk-VPRYWNJP.js";
30
+ } from "./chunk-4HZCS2EN.js";
31
31
 
32
32
  // lib/components/RunFrame/RunFrame.tsx
33
33
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -457,6 +457,7 @@ var RunFrame = (props) => {
457
457
  renderLog,
458
458
  isRunningCode: isRunning,
459
459
  errorMessage: error?.error,
460
+ errorStack: error?.stack,
460
461
  onEditEvent: handleEditEvent,
461
462
  editEvents: props.editEvents,
462
463
  defaultToFullScreen: props.defaultToFullScreen