@replohq/sandbox-runtime 1.13.4 → 1.14.0

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.
@@ -367,6 +367,7 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
367
367
  navigateToRoute: {
368
368
  inputSchema: z.ZodObject<{
369
369
  pathname: z.ZodString;
370
+ navigationId: z.ZodOptional<z.ZodNumber>;
370
371
  }, z.core.$strip>;
371
372
  outputSchema: z.ZodVoid;
372
373
  };
@@ -917,6 +918,12 @@ export declare const previewIframeToWebsiteBuilderMethodConfig: {
917
918
  inputSchema: z.ZodUndefined;
918
919
  outputSchema: z.ZodVoid;
919
920
  };
921
+ navigationAccepted: {
922
+ inputSchema: z.ZodObject<{
923
+ navigationId: z.ZodNumber;
924
+ }, z.core.$strip>;
925
+ outputSchema: z.ZodVoid;
926
+ };
920
927
  };
921
928
  export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
922
929
  method: z.ZodLiteral<"expandToSection">;
@@ -51,7 +51,10 @@ var websiteBuilderToPreviewIframeMethodConfig = {
51
51
  timeoutMs: 1500
52
52
  },
53
53
  navigateToRoute: {
54
- inputSchema: z.object({ pathname: z.string() }),
54
+ inputSchema: z.object({
55
+ pathname: z.string(),
56
+ navigationId: z.number().int().optional()
57
+ }),
55
58
  outputSchema: z.void()
56
59
  },
57
60
  setDisplayMode: {
@@ -173,6 +176,10 @@ var previewIframeToWebsiteBuilderMethodConfig = {
173
176
  fastRefreshComplete: {
174
177
  inputSchema: z.undefined(),
175
178
  outputSchema: z.void()
179
+ },
180
+ navigationAccepted: {
181
+ inputSchema: z.object({ navigationId: z.number().int() }),
182
+ outputSchema: z.void()
176
183
  }
177
184
  };
178
185
  var selectModeParentMessageSchema = z.discriminatedUnion("method", [
package/buildMetadata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sandbox-runtime",
3
- "version": "1.13.4",
3
+ "version": "1.14.0",
4
4
  "branch": "HEAD",
5
- "commit": "846cda8229162197eb0c6dc9c32ce08fccd2d89e",
6
- "builtAt": "2026-10-12T04:17:30.872Z"
5
+ "commit": "c9e85e751a46ae55516e492cf96b3579b6bc21cd",
6
+ "builtAt": "2026-10-15T23:04:02.620Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.13.4",
3
+ "version": "1.14.0",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.13.4",
6
+ "version": "1.14.0",
7
7
  "branch": "HEAD",
8
- "commit": "846cda8229162197eb0c6dc9c32ce08fccd2d89e",
9
- "builtAt": "2026-10-12T04:17:30.872Z"
8
+ "commit": "c9e85e751a46ae55516e492cf96b3579b6bc21cd",
9
+ "builtAt": "2026-10-15T23:04:02.620Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",
@@ -122,10 +122,10 @@ function EditorSelection() {
122
122
  }
123
123
  actions.dismissInlineEditRequest();
124
124
  };
125
- document.addEventListener("pointerdown", cancelOnPointerDown, true);
125
+ window.addEventListener("pointerdown", cancelOnPointerDown, true);
126
126
  document.addEventListener("keydown", cancelOnEscape, true);
127
127
  return () => {
128
- document.removeEventListener("pointerdown", cancelOnPointerDown, true);
128
+ window.removeEventListener("pointerdown", cancelOnPointerDown, true);
129
129
  document.removeEventListener("keydown", cancelOnEscape, true);
130
130
  store.getState().actions.revertInlineEdit();
131
131
  };
@@ -17,8 +17,9 @@
17
17
  * sync with the page scroll so the rectangle visually "sticks" to the
18
18
  * page rather than the viewport.
19
19
  *
20
- * We capture-listen and `preventDefault`/`stopPropagation` clicks so the
20
+ * We listen at window capture, the first stop on every event path, and
21
+ * `preventDefault`/`stopImmediatePropagation` presses and clicks so the
21
22
  * underlying page can't navigate or trigger handlers while the user is
22
- * working in selection mode.
23
+ * working in selection mode, even from its own document capture listeners.
23
24
  */
24
25
  export declare function useSelectionInteractions(): void;
@@ -181,7 +181,7 @@ function useSelectionInteractions() {
181
181
  return;
182
182
  }
183
183
  event.preventDefault();
184
- event.stopPropagation();
184
+ event.stopImmediatePropagation();
185
185
  const scrollOffset = getDocumentScrollOffset();
186
186
  const session = interactionSessionRef.current;
187
187
  committedDataAtPointerDown = session.type === "element" ? session.data : null;
@@ -371,6 +371,8 @@ function useSelectionInteractions() {
371
371
  if (editingElementRef?.current && event.target instanceof Node && editingElementRef.current.contains(event.target)) {
372
372
  return;
373
373
  }
374
+ event.preventDefault();
375
+ event.stopImmediatePropagation();
374
376
  const snapshot = interactionSessionRef.current;
375
377
  const wasDragging = snapshot.type === "drag" ? snapshot.hasExceededThreshold : false;
376
378
  const dragStart = snapshot.type === "drag" ? snapshot.dragStart : null;
@@ -421,7 +423,7 @@ function useSelectionInteractions() {
421
423
  return;
422
424
  }
423
425
  event.preventDefault();
424
- event.stopPropagation();
426
+ event.stopImmediatePropagation();
425
427
  };
426
428
  const handlePointerCancel = (event) => {
427
429
  editingPointerIds.delete(event.pointerId);
@@ -431,20 +433,20 @@ function useSelectionInteractions() {
431
433
  editingPointerIds.clear();
432
434
  resetDragState();
433
435
  };
434
- document.addEventListener("pointerdown", handlePointerDown, true);
435
- document.addEventListener("pointermove", handlePointerMove, true);
436
- document.addEventListener("pointerup", handlePointerUp, true);
437
- document.addEventListener("pointercancel", handlePointerCancel, true);
438
- document.addEventListener("click", handleClick, true);
436
+ window.addEventListener("pointerdown", handlePointerDown, true);
437
+ window.addEventListener("pointermove", handlePointerMove, true);
438
+ window.addEventListener("pointerup", handlePointerUp, true);
439
+ window.addEventListener("pointercancel", handlePointerCancel, true);
440
+ window.addEventListener("click", handleClick, true);
439
441
  document.addEventListener("scroll", handleViewportChangeDuringDrag, true);
440
442
  window.addEventListener("blur", handleWindowBlur);
441
443
  window.addEventListener("resize", handleViewportChangeDuringDrag);
442
444
  return () => {
443
- document.removeEventListener("pointerdown", handlePointerDown, true);
444
- document.removeEventListener("pointermove", handlePointerMove, true);
445
- document.removeEventListener("pointerup", handlePointerUp, true);
446
- document.removeEventListener("pointercancel", handlePointerCancel, true);
447
- document.removeEventListener("click", handleClick, true);
445
+ window.removeEventListener("pointerdown", handlePointerDown, true);
446
+ window.removeEventListener("pointermove", handlePointerMove, true);
447
+ window.removeEventListener("pointerup", handlePointerUp, true);
448
+ window.removeEventListener("pointercancel", handlePointerCancel, true);
449
+ window.removeEventListener("click", handleClick, true);
448
450
  document.removeEventListener(
449
451
  "scroll",
450
452
  handleViewportChangeDuringDrag,
@@ -446,6 +446,12 @@ export declare function getSelectModeIframeRpcChannel(): import("../_vendor/sche
446
446
  inputSchema: import("zod").ZodUndefined;
447
447
  outputSchema: import("zod").ZodVoid;
448
448
  };
449
+ navigationAccepted: {
450
+ inputSchema: import("zod").ZodObject<{
451
+ navigationId: import("zod").ZodNumber;
452
+ }, import("zod/v4/core").$strip>;
453
+ outputSchema: import("zod").ZodVoid;
454
+ };
449
455
  }> | null;
450
456
  export declare function setSelectModeParentHandlers(nextHandlers: SelectModeParentMessagingHandlers | null): void;
451
457
  export declare function getWebsiteBuilderRpc(): WebsiteBuilderRpcRemote | null;
@@ -57,8 +57,14 @@ function createSelectModeIframeRpcChannel() {
57
57
  symbolicateSelectedElement: (element) => {
58
58
  return symbolicateSelectedElement(element);
59
59
  },
60
- navigateToRoute: (input) => {
61
- navigateToRouteHandler?.(input);
60
+ navigateToRoute: ({ pathname, navigationId }, { channel: channel2 }) => {
61
+ if (!navigateToRouteHandler) {
62
+ return;
63
+ }
64
+ navigateToRouteHandler({ pathname });
65
+ if (navigationId !== void 0) {
66
+ channel2.navigationAccepted({ navigationId });
67
+ }
62
68
  }
63
69
  }
64
70
  });