@tscircuit/runframe 0.0.227 → 0.0.229
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.
- package/dist/{chunk-VYMN7TD3.js → chunk-ODJJXLES.js} +427 -308
- package/dist/preview.d.ts +10 -1
- package/dist/preview.js +1 -1
- package/dist/runner.d.ts +3 -0
- package/dist/runner.js +12 -1
- package/dist/standalone-preview.min.js +729 -703
- package/dist/standalone.min.js +700 -674
- package/package.json +3 -2
package/dist/preview.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ interface PreviewContentProps {
|
|
|
36
36
|
showToggleFullScreen?: boolean;
|
|
37
37
|
showImportAndFormatButtons?: boolean;
|
|
38
38
|
headerClassName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A record of component name to autorouting information
|
|
41
|
+
*/
|
|
42
|
+
autoroutingLog?: Record<string, {
|
|
43
|
+
simpleRouteJson: any;
|
|
44
|
+
}>;
|
|
39
45
|
/**
|
|
40
46
|
* An optional left-side header, you can put a save button, a run button, or
|
|
41
47
|
* a title here.
|
|
@@ -56,8 +62,11 @@ interface PreviewContentProps {
|
|
|
56
62
|
onActiveTabChange?: (tab: TabId) => any;
|
|
57
63
|
autoRotate3dViewerDisabled?: boolean;
|
|
58
64
|
showSchematicDebugGrid?: boolean;
|
|
65
|
+
onReportAutoroutingLog?: (name: string, data: {
|
|
66
|
+
simpleRouteJson: any;
|
|
67
|
+
}) => void;
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
declare const CircuitJsonPreview: ({ code, onRunClicked, errorMessage, circuitJsonKey, circuitJson, autoroutingGraphics, showRightHeaderContent, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, autoRotate3dViewerDisabled, showSchematicDebugGrid, showToggleFullScreen, }: PreviewContentProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare const CircuitJsonPreview: ({ code, onRunClicked, errorMessage, circuitJsonKey, 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, }: PreviewContentProps) => react_jsx_runtime.JSX.Element;
|
|
62
71
|
|
|
63
72
|
export { CircuitJsonPreview, type PreviewContentProps, type TabId };
|
package/dist/preview.js
CHANGED
package/dist/runner.d.ts
CHANGED
package/dist/runner.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
DropdownMenuTrigger,
|
|
12
12
|
buttonVariants,
|
|
13
13
|
cn
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ODJJXLES.js";
|
|
15
15
|
|
|
16
16
|
// lib/components/RunFrame/RunFrame.tsx
|
|
17
17
|
import { createCircuitWebWorker } from "@tscircuit/eval";
|
|
@@ -279,6 +279,7 @@ var RunFrame = (props) => {
|
|
|
279
279
|
const runMutex = useMutex();
|
|
280
280
|
const [isRunning, setIsRunning] = useState(false);
|
|
281
281
|
const [renderLog, setRenderLog] = useState(null);
|
|
282
|
+
const [autoroutingLog, setAutoroutingLog] = useState({});
|
|
282
283
|
const [activeTab, setActiveTab] = useState(
|
|
283
284
|
props.defaultActiveTab ?? "pcb"
|
|
284
285
|
);
|
|
@@ -359,6 +360,14 @@ var RunFrame = (props) => {
|
|
|
359
360
|
const renderIds = /* @__PURE__ */ new Set();
|
|
360
361
|
const startRenderTime = Date.now();
|
|
361
362
|
let lastRenderLogSet = Date.now();
|
|
363
|
+
worker.on("autorouting:start", (event) => {
|
|
364
|
+
setAutoroutingLog({
|
|
365
|
+
...autoroutingLog,
|
|
366
|
+
[event.componentDisplayName]: {
|
|
367
|
+
simpleRouteJson: event.simpleRouteJson
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
});
|
|
362
371
|
worker.on("renderable:renderLifecycle:anyEvent", (event) => {
|
|
363
372
|
renderLog2.lastRenderEvent = event;
|
|
364
373
|
renderLog2.eventsProcessed = (renderLog2.eventsProcessed ?? 0) + 1;
|
|
@@ -448,6 +457,8 @@ var RunFrame = (props) => {
|
|
|
448
457
|
defaultActiveTab: props.defaultActiveTab,
|
|
449
458
|
showToggleFullScreen: props.showToggleFullScreen,
|
|
450
459
|
autoroutingGraphics,
|
|
460
|
+
autoroutingLog,
|
|
461
|
+
onReportAutoroutingLog: props.onReportAutoroutingLog,
|
|
451
462
|
leftHeaderContent: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
452
463
|
props.showRunButton && /* @__PURE__ */ jsxs("div", { className: "rf-relative rf-inline-flex", children: [
|
|
453
464
|
/* @__PURE__ */ jsxs(
|