@tscircuit/runframe 0.0.107 → 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/{chunk-WUXAA7XM.js → chunk-UXHIMHT2.js} +2 -1
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +1 -1
- package/dist/runner.js +10 -4
- package/dist/standalone.min.js +965 -952
- package/package.json +2 -2
|
@@ -543,6 +543,7 @@ import {
|
|
|
543
543
|
CheckIcon,
|
|
544
544
|
EllipsisIcon,
|
|
545
545
|
FullscreenIcon,
|
|
546
|
+
Loader2,
|
|
546
547
|
LoaderCircleIcon,
|
|
547
548
|
MinimizeIcon
|
|
548
549
|
} from "lucide-react";
|
|
@@ -862,7 +863,6 @@ var dropdownMenuItems = [
|
|
|
862
863
|
var CircuitJsonPreview = ({
|
|
863
864
|
code,
|
|
864
865
|
onRunClicked = void 0,
|
|
865
|
-
tsxRunTriggerCount,
|
|
866
866
|
errorMessage,
|
|
867
867
|
circuitJsonKey = "",
|
|
868
868
|
circuitJson,
|
|
@@ -919,6 +919,7 @@ var CircuitJsonPreview = ({
|
|
|
919
919
|
children: [
|
|
920
920
|
leftHeaderContent,
|
|
921
921
|
leftHeaderContent && /* @__PURE__ */ jsx15("div", { className: "rf-flex-grow" }),
|
|
922
|
+
!leftHeaderContent && isRunningCode && /* @__PURE__ */ jsx15(Loader2, { className: "rf-w-4 rf-h-4 rf-animate-spin" }),
|
|
922
923
|
!leftHeaderContent && /* @__PURE__ */ jsx15("div", { className: "rf-flex-grow" }),
|
|
923
924
|
renderLog && renderLog.progress !== 1 && /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
|
|
924
925
|
renderLog.lastRenderEvent && /* @__PURE__ */ jsx15("div", { className: "rf-text-xs rf-text-gray-500", children: renderLog.lastRenderEvent?.type.split("renderable:renderLifecycle:")[1].split(":")[0] }),
|
package/dist/preview.d.ts
CHANGED
|
@@ -50,6 +50,6 @@ interface PreviewContentProps {
|
|
|
50
50
|
editEvents?: ManualEditEvent[];
|
|
51
51
|
onActiveTabChange?: (tab: TabId) => any;
|
|
52
52
|
}
|
|
53
|
-
declare const CircuitJsonPreview: ({ code, onRunClicked,
|
|
53
|
+
declare const CircuitJsonPreview: ({ code, onRunClicked, errorMessage, circuitJsonKey, circuitJson, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, onToggleFullScreen, isFullScreen, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, }: PreviewContentProps) => react_jsx_runtime.JSX.Element;
|
|
54
54
|
|
|
55
55
|
export { CircuitJsonPreview, type PreviewContentProps, type TabId };
|
package/dist/preview.js
CHANGED
package/dist/runner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CircuitJsonPreview
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UXHIMHT2.js";
|
|
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,7 +388,9 @@ var RunFrame = (props) => {
|
|
|
384
388
|
] }),
|
|
385
389
|
onActiveTabChange: setActiveTab,
|
|
386
390
|
circuitJson,
|
|
391
|
+
circuitJsonKey,
|
|
387
392
|
renderLog,
|
|
393
|
+
isRunningCode: isRunning,
|
|
388
394
|
errorMessage: error?.error,
|
|
389
395
|
onEditEvent: props.onEditEvent,
|
|
390
396
|
editEvents: props.editEvents
|
|
@@ -532,7 +538,7 @@ var RunFrameWithApi = (props) => {
|
|
|
532
538
|
};
|
|
533
539
|
|
|
534
540
|
// lib/components/RunFrameForCli/SaveToSnippetsButton.tsx
|
|
535
|
-
import { useEffect as useEffect5, useMemo as
|
|
541
|
+
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
536
542
|
|
|
537
543
|
// lib/components/RunFrameForCli/SelectSnippetDialog.tsx
|
|
538
544
|
import { useState as useState4 } from "react";
|
|
@@ -653,7 +659,7 @@ var SaveToSnippetsButton = () => {
|
|
|
653
659
|
null
|
|
654
660
|
);
|
|
655
661
|
const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState5(false);
|
|
656
|
-
const firstRenderTime =
|
|
662
|
+
const firstRenderTime = useMemo4(() => Date.now(), []);
|
|
657
663
|
useEventHandler((event) => {
|
|
658
664
|
if (new Date(event.created_at).valueOf() < firstRenderTime + 500) return;
|
|
659
665
|
if (event.event_type === "FILE_UPDATED") {
|