@tscircuit/runframe 0.0.238 → 0.0.240

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.
@@ -988,7 +988,7 @@ var RenderLogViewer = ({
988
988
  };
989
989
 
990
990
  // package.json
991
- var version = "0.0.237";
991
+ var version = "0.0.239";
992
992
 
993
993
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
994
994
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -1201,7 +1201,12 @@ var CircuitJsonPreview = ({
1201
1201
  containerClassName: cn(
1202
1202
  "rf-h-full rf-w-full",
1203
1203
  isFullScreen ? "rf-min-h-[calc(100vh-240px)]" : "rf-min-h-[620px]"
1204
- )
1204
+ ),
1205
+ onEditEventsChanged: (editEvents2) => {
1206
+ if (onEditEvent) {
1207
+ editEvents2.forEach((e) => onEditEvent(e));
1208
+ }
1209
+ }
1205
1210
  },
1206
1211
  circuitJsonKey
1207
1212
  ) : /* @__PURE__ */ jsx16(PreviewEmptyState_default, { onRunClicked })
package/dist/preview.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CircuitJsonPreview
3
- } from "./chunk-TGH7DOBR.js";
3
+ } from "./chunk-4SURRTYS.js";
4
4
  export {
5
5
  CircuitJsonPreview
6
6
  };
package/dist/runner.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  DropdownMenuTrigger,
12
12
  buttonVariants,
13
13
  cn
14
- } from "./chunk-TGH7DOBR.js";
14
+ } from "./chunk-4SURRTYS.js";
15
15
 
16
16
  // lib/components/RunFrame/RunFrame.tsx
17
17
  import { createCircuitWebWorker } from "@tscircuit/eval";
@@ -466,6 +466,26 @@ var RunFrame = (props) => {
466
466
  const circuitJsonKey = useMemo(() => {
467
467
  return `cj-${Math.random().toString(36).substring(2, 15)}`;
468
468
  }, [circuitJson]);
469
+ const lastEditEventRef = useRef2(null);
470
+ const dragTimeout = useRef2(null);
471
+ const handleEditEvent = (event) => {
472
+ if (event.in_progress) {
473
+ lastEditEventRef.current = event;
474
+ if (dragTimeout.current) {
475
+ clearTimeout(dragTimeout.current);
476
+ dragTimeout.current = null;
477
+ }
478
+ } else {
479
+ if (dragTimeout.current) {
480
+ clearTimeout(dragTimeout.current);
481
+ }
482
+ dragTimeout.current = setTimeout(() => {
483
+ props.onEditEvent?.(lastEditEventRef.current);
484
+ lastEditEventRef.current = null;
485
+ dragTimeout.current = null;
486
+ }, 100);
487
+ }
488
+ };
469
489
  return /* @__PURE__ */ jsx(
470
490
  CircuitJsonPreview,
471
491
  {
@@ -525,7 +545,7 @@ var RunFrame = (props) => {
525
545
  renderLog,
526
546
  isRunningCode: isRunning,
527
547
  errorMessage: error?.error,
528
- onEditEvent: props.onEditEvent,
548
+ onEditEvent: handleEditEvent,
529
549
  editEvents: props.editEvents
530
550
  }
531
551
  );