@replohq/sandbox-runtime 1.16.0 → 1.16.2

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.
Files changed (32) hide show
  1. package/_vendor/replo-utils/lib/object.d.ts +16 -1
  2. package/_vendor/replo-utils/lib/viewportSnapshot.d.ts +1 -1
  3. package/_vendor/replo-utils/lib/viewportSnapshot.mjs +1 -1
  4. package/_vendor/replo-utils/react/use-viewport-snapshot-responder.mjs +28 -5222
  5. package/_vendor/schemas/componentPreview.d.ts +1 -1
  6. package/_vendor/schemas/componentPreview.mjs +18 -18
  7. package/_vendor/schemas/designLibrary.d.ts +1 -1
  8. package/_vendor/schemas/designLibrary.mjs +72 -72
  9. package/_vendor/schemas/errors.d.ts +3 -43
  10. package/_vendor/schemas/iframeRpcChannel.d.ts +1 -1
  11. package/_vendor/schemas/iframeRpcChannel.mjs +27 -26
  12. package/_vendor/schemas/loaderKeys.d.ts +1 -1
  13. package/_vendor/schemas/pageAnnotations.d.ts +1 -1
  14. package/_vendor/schemas/pageAnnotations.mjs +1 -1
  15. package/_vendor/schemas/reploError.d.ts +43 -0
  16. package/_vendor/schemas/savedStyles.d.ts +1 -1
  17. package/_vendor/schemas/selectMode.d.ts +1 -1
  18. package/_vendor/schemas/selectMode.mjs +1 -1
  19. package/_vendor/schemas/selectModeIframeRpc.d.ts +1 -8
  20. package/_vendor/schemas/selectModeIframeRpc.mjs +3 -10
  21. package/buildMetadata.js +3 -3
  22. package/capturePage.js +1 -1
  23. package/{chunk-3YA3QXUQ.mjs → chunk-B3PLD7SH.mjs} +29 -18
  24. package/{chunk-KFJZ2OLV.mjs → chunk-TP4ZXK4R.mjs} +1 -1
  25. package/package.json +4 -4
  26. package/rrweb-snapshot-GTQBXO2Y.mjs +5761 -0
  27. package/select-mode/descriptor/elementDescriptor.js +1 -1
  28. package/select-mode/fiber.js +1 -1
  29. package/select-mode/hooks/useOptimisticOverrides.js +1 -1
  30. package/select-mode/hooks/useParentMessaging.js +1 -1
  31. package/select-mode/iframeRpcChannel.d.ts +0 -6
  32. package/select-mode/iframeRpcChannel.js +2 -8
@@ -109,6 +109,29 @@ function startViewportSnapshotResponder({
109
109
  };
110
110
  requester.postMessage(response, requesterOrigin);
111
111
  };
112
+ const requestType = event.data.type;
113
+ const respondWithChildFrames = (snapshot2, context2) => {
114
+ if (captureDom ? snapshot2 === null : !context2) {
115
+ respond(null);
116
+ return;
117
+ }
118
+ void requestChildViewportSnapshots({
119
+ targetWindow,
120
+ requestId: `${requestId}:${frameIndex}`,
121
+ timeoutMs: cascadeTimeoutMs,
122
+ remainingDepth: remainingDepth - 1,
123
+ requestType
124
+ }).then((childCaptures) => {
125
+ respond({
126
+ snapshot: snapshot2,
127
+ ...context2 ? { context: context2 } : {},
128
+ childFrames: childCaptures.flatMap((child) => {
129
+ const rect = measureFrameRect(child.frameIndex);
130
+ return rect ? [{ frameIndex: child.frameIndex, rect, capture: child.capture }] : [];
131
+ })
132
+ });
133
+ });
134
+ };
112
135
  let snapshot = null;
113
136
  let context;
114
137
  try {
@@ -119,26 +142,14 @@ function startViewportSnapshotResponder({
119
142
  }
120
143
  } catch {
121
144
  }
122
- if (captureDom ? snapshot === null : !context) {
123
- respond(null);
145
+ if (snapshot instanceof Promise) {
146
+ snapshot.then(
147
+ (resolved) => respondWithChildFrames(resolved, context),
148
+ () => respond(null)
149
+ );
124
150
  return;
125
151
  }
126
- void requestChildViewportSnapshots({
127
- targetWindow,
128
- requestId: `${requestId}:${frameIndex}`,
129
- timeoutMs: cascadeTimeoutMs,
130
- remainingDepth: remainingDepth - 1,
131
- requestType: event.data.type
132
- }).then((childCaptures) => {
133
- respond({
134
- snapshot,
135
- ...context ? { context } : {},
136
- childFrames: childCaptures.flatMap((child) => {
137
- const rect = measureFrameRect(child.frameIndex);
138
- return rect ? [{ frameIndex: child.frameIndex, rect, capture: child.capture }] : [];
139
- })
140
- });
141
- });
152
+ respondWithChildFrames(snapshot, context);
142
153
  };
143
154
  targetWindow.addEventListener("message", onMessage);
144
155
  return () => {
@@ -1,5 +1,5 @@
1
1
  import { exhaustiveSwitch } from './chunk-PH3S6LJI.mjs';
2
- import { z } from 'zod';
2
+ import * as z from 'zod';
3
3
 
4
4
  function parseJsonOrNull(json) {
5
5
  try {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.16.0",
6
+ "version": "1.16.2",
7
7
  "branch": "HEAD",
8
- "commit": "cce09bc70f0a5638a8b527e5351534efe9bfcdf7",
9
- "builtAt": "2026-10-19T20:42:50.022Z"
8
+ "commit": "9158b1e6452ebc5e1945da883b1c8406c7b17f08",
9
+ "builtAt": "2026-10-19T23:23:08.010Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",