@tscircuit/runframe 0.0.108 → 0.0.109
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/runner.js +8 -3
- package/dist/standalone.min.js +965 -952
- package/package.json +2 -2
package/dist/runner.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// lib/components/RunFrame.tsx
|
|
6
6
|
import { createCircuitWebWorker } from "@tscircuit/eval-webworker";
|
|
7
|
-
import { useEffect, useReducer, useRef, useState } from "react";
|
|
7
|
+
import { useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
8
8
|
import Debug2 from "debug";
|
|
9
9
|
import { Loader2, Play } from "lucide-react";
|
|
10
10
|
import evalWebWorkerBlobUrl from "@tscircuit/eval-webworker/blob-url";
|
|
@@ -271,6 +271,7 @@ var RunFrame = (props) => {
|
|
|
271
271
|
}
|
|
272
272
|
lastFsMapRef.current = fsMap;
|
|
273
273
|
lastEntrypointRef.current = props.entrypoint;
|
|
274
|
+
lastRunCountTriggerRef.current = runCountTrigger;
|
|
274
275
|
setIsRunning(true);
|
|
275
276
|
async function runWorker() {
|
|
276
277
|
debug3("running render worker");
|
|
@@ -359,6 +360,9 @@ var RunFrame = (props) => {
|
|
|
359
360
|
}
|
|
360
361
|
runWorker();
|
|
361
362
|
}, [props.fsMap, props.entrypoint, runCountTrigger]);
|
|
363
|
+
const circuitJsonKey = useMemo(() => {
|
|
364
|
+
return `cj-${Math.random().toString(36).substring(2, 15)}`;
|
|
365
|
+
}, [circuitJson]);
|
|
362
366
|
return /* @__PURE__ */ jsx(
|
|
363
367
|
CircuitJsonPreview,
|
|
364
368
|
{
|
|
@@ -384,6 +388,7 @@ var RunFrame = (props) => {
|
|
|
384
388
|
] }),
|
|
385
389
|
onActiveTabChange: setActiveTab,
|
|
386
390
|
circuitJson,
|
|
391
|
+
circuitJsonKey,
|
|
387
392
|
renderLog,
|
|
388
393
|
isRunningCode: isRunning,
|
|
389
394
|
errorMessage: error?.error,
|
|
@@ -533,7 +538,7 @@ var RunFrameWithApi = (props) => {
|
|
|
533
538
|
};
|
|
534
539
|
|
|
535
540
|
// lib/components/RunFrameForCli/SaveToSnippetsButton.tsx
|
|
536
|
-
import { useEffect as useEffect5, useMemo as
|
|
541
|
+
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
537
542
|
|
|
538
543
|
// lib/components/RunFrameForCli/SelectSnippetDialog.tsx
|
|
539
544
|
import { useState as useState4 } from "react";
|
|
@@ -654,7 +659,7 @@ var SaveToSnippetsButton = () => {
|
|
|
654
659
|
null
|
|
655
660
|
);
|
|
656
661
|
const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState5(false);
|
|
657
|
-
const firstRenderTime =
|
|
662
|
+
const firstRenderTime = useMemo4(() => Date.now(), []);
|
|
658
663
|
useEventHandler((event) => {
|
|
659
664
|
if (new Date(event.created_at).valueOf() < firstRenderTime + 500) return;
|
|
660
665
|
if (event.event_type === "FILE_UPDATED") {
|