@replohq/sandbox-runtime 1.13.3 → 1.13.5

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/buildMetadata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sandbox-runtime",
3
- "version": "1.13.3",
3
+ "version": "1.13.5",
4
4
  "branch": "HEAD",
5
- "commit": "961dc0c36bd9b26ea89d2a42057a671cd449165d",
6
- "builtAt": "2026-10-11T15:32:35.895Z"
5
+ "commit": "36fde1b0255bc46705dcfbd1fc4810e7e9bcae24",
6
+ "builtAt": "2026-10-13T21:24:01.791Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.13.3",
3
+ "version": "1.13.5",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.13.3",
6
+ "version": "1.13.5",
7
7
  "branch": "HEAD",
8
- "commit": "961dc0c36bd9b26ea89d2a42057a671cd449165d",
9
- "builtAt": "2026-10-11T15:32:35.895Z"
8
+ "commit": "36fde1b0255bc46705dcfbd1fc4810e7e9bcae24",
9
+ "builtAt": "2026-10-13T21:24:01.791Z"
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,
@@ -268,7 +268,7 @@ const selectModeStore = createShallowStore(
268
268
  onCommit: commitInlineEdit,
269
269
  onEscape: revertInlineEdit,
270
270
  onBlur: handleBlur,
271
- onSelectionUpdate: (activeMarks) => {
271
+ onActiveMarksChange: (activeMarks) => {
272
272
  set({ activeMarks });
273
273
  reportInlineEditingState({
274
274
  activeMarks,
@@ -289,7 +289,7 @@ const selectModeStore = createShallowStore(
289
289
  });
290
290
  editor.focusAndSelectAll();
291
291
  reportInlineEditingState({
292
- activeMarks: EMPTY_ACTIVE_MARKS,
292
+ activeMarks: get().activeMarks,
293
293
  isInlineEditing: true,
294
294
  request: null
295
295
  });
@@ -8,13 +8,13 @@ export type InlineTiptapEditor = {
8
8
  getJSON: () => JSONContent;
9
9
  runFormatCommand: (command: SelectModeFormatCommand) => void;
10
10
  };
11
- export declare function createInlineTiptapEditor({ element, content, onCommit, onEscape, onBlur, onSelectionUpdate, }: {
11
+ export declare function createInlineTiptapEditor({ element, content, onCommit, onEscape, onBlur, onActiveMarksChange, }: {
12
12
  element: HTMLElement;
13
13
  content: string;
14
14
  onCommit: () => void;
15
15
  onEscape: () => void;
16
16
  onBlur: () => void;
17
- onSelectionUpdate: (activeMarks: {
17
+ onActiveMarksChange: (activeMarks: {
18
18
  bold: boolean;
19
19
  italic: boolean;
20
20
  underline: boolean;
@@ -60,7 +60,7 @@ function createInlineTiptapEditor({
60
60
  onCommit,
61
61
  onEscape,
62
62
  onBlur,
63
- onSelectionUpdate
63
+ onActiveMarksChange
64
64
  }) {
65
65
  const originalAttributes = Array.from(
66
66
  element.attributes,
@@ -107,8 +107,8 @@ function createInlineTiptapEditor({
107
107
  return false;
108
108
  }
109
109
  },
110
- onSelectionUpdate: ({ editor: activeEditor }) => {
111
- onSelectionUpdate({
110
+ onTransaction: ({ editor: activeEditor }) => {
111
+ onActiveMarksChange({
112
112
  bold: activeEditor.isActive("bold"),
113
113
  italic: activeEditor.isActive("italic"),
114
114
  underline: activeEditor.isActive("underline"),