@tscircuit/runframe 0.0.819 → 0.0.821

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.
@@ -1333,7 +1333,7 @@ var useErrorTelemetry = ({
1333
1333
  };
1334
1334
 
1335
1335
  // package.json
1336
- var version = "0.0.818";
1336
+ var version = "0.0.820";
1337
1337
 
1338
1338
  // lib/hooks/use-eval-versions.ts
1339
1339
  import { useEffect as useEffect5, useMemo as useMemo2, useState as useState6 } from "react";
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-RGV36YQK.js";
11
+ } from "./chunk-FJK4GBG6.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.d.ts CHANGED
@@ -15,6 +15,11 @@ interface RunFrameProps {
15
15
  * Map of filenames to file contents that will be available in the worker
16
16
  */
17
17
  fsMap: Map<string, string> | Record<string, string>;
18
+ /**
19
+ * When true, indicates the file map is still loading and a loading state
20
+ * should be displayed instead of attempting to execute any code.
21
+ */
22
+ isLoadingFiles?: boolean;
18
23
  /**
19
24
  * The entry point file that will be executed first. If not provided,
20
25
  * @tscircuit/eval will infer the entrypoint
package/dist/runner.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  useOrderDialogCli,
40
40
  useRunFrameStore,
41
41
  useRunnerStore
42
- } from "./chunk-RGV36YQK.js";
42
+ } from "./chunk-FJK4GBG6.js";
43
43
 
44
44
  // lib/components/RunFrame/RunFrame.tsx
45
45
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -1581,6 +1581,7 @@ var RunFrame = (props) => {
1581
1581
  const lastFsMapRef = useRef3(null);
1582
1582
  const lastEntrypointRef = useRef3(null);
1583
1583
  useEffect6(() => {
1584
+ if (props.isLoadingFiles) return;
1584
1585
  const fsMapObj = fsMap instanceof Map ? Object.fromEntries(fsMap.entries()) : fsMap;
1585
1586
  if (!fsMapObj || Object.keys(fsMapObj).length === 0) {
1586
1587
  setError({
@@ -1751,7 +1752,8 @@ var RunFrame = (props) => {
1751
1752
  props.entrypoint,
1752
1753
  runCountTrigger,
1753
1754
  props.evalVersion,
1754
- props.mainComponentPath
1755
+ props.mainComponentPath,
1756
+ props.isLoadingFiles
1755
1757
  ]);
1756
1758
  const lastEditEventRef = useRef3(null);
1757
1759
  const dragTimeout = useRef3(null);
@@ -1813,6 +1815,12 @@ var RunFrame = (props) => {
1813
1815
  }
1814
1816
  });
1815
1817
  };
1818
+ if (props.isLoadingFiles) {
1819
+ return /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-center rf-justify-center rf-w-full rf-h-full", children: [
1820
+ /* @__PURE__ */ jsx9(Loader22, { className: "rf-w-8 rf-h-8 rf-animate-spin" }),
1821
+ /* @__PURE__ */ jsx9("span", { className: "rf-ml-2 rf-text-sm", children: "Loading files..." })
1822
+ ] });
1823
+ }
1816
1824
  return /* @__PURE__ */ jsx9(
1817
1825
  CircuitJsonPreview,
1818
1826
  {
@@ -2202,8 +2210,10 @@ var RunFrameWithApi = (props) => {
2202
2210
  const fsMap = useRunFrameStore((s) => s.fsMap);
2203
2211
  const circuitJson = useRunFrameStore((s) => s.circuitJson);
2204
2212
  const [componentPath, setComponentPath] = useState10("");
2213
+ const [isLoadingFiles, setIsLoadingFiles] = useState10(true);
2205
2214
  useEffect10(() => {
2206
- loadInitialFiles();
2215
+ setIsLoadingFiles(true);
2216
+ loadInitialFiles().finally(() => setIsLoadingFiles(false));
2207
2217
  }, []);
2208
2218
  useEffect10(() => {
2209
2219
  const files = Array.from(fsMap.keys());
@@ -2248,6 +2258,7 @@ var RunFrameWithApi = (props) => {
2248
2258
  RunFrame,
2249
2259
  {
2250
2260
  fsMap,
2261
+ isLoadingFiles,
2251
2262
  evalVersion: props.evalVersion,
2252
2263
  forceLatestEvalVersion: props.forceLatestEvalVersion,
2253
2264
  evalWebWorkerBlobUrl: props.evalWebWorkerBlobUrl ?? props.workerBlobUrl,