@replohq/sandbox-runtime 1.24.5 → 1.24.6

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.
@@ -21,20 +21,6 @@ function startResponder() {
21
21
  if (!parentOrigin) {
22
22
  return;
23
23
  }
24
- awaitingMeasurement = false;
25
- if (!reportedHeight) {
26
- const pendingImages = Array.from(document.images).filter(
27
- (image) => !image.complete
28
- );
29
- for (const image of pendingImages) {
30
- if (image.loading === "lazy") {
31
- image.loading = "eager";
32
- }
33
- }
34
- if (pendingImages.length) {
35
- return;
36
- }
37
- }
38
24
  const body = document.body;
39
25
  pinPreviewViewportUnits({
40
26
  width: window.innerWidth,
@@ -51,6 +37,7 @@ function startResponder() {
51
37
  )
52
38
  );
53
39
  baselineRootHeight = getComputedStyle(document.documentElement).height;
40
+ awaitingMeasurement = false;
54
41
  if (height > 0) {
55
42
  reportedHeight = height;
56
43
  window.parent.postMessage(
@@ -104,10 +91,6 @@ function startResponder() {
104
91
  if (!parentOrigin || awaitingMeasurement) {
105
92
  return;
106
93
  }
107
- if (!reportedHeight) {
108
- schedule();
109
- return;
110
- }
111
94
  cancelAnimationFrame(scheduledFrame);
112
95
  scheduledFrame = requestAnimationFrame(() => {
113
96
  scheduledFrame = 0;
@@ -152,7 +135,6 @@ function startResponder() {
152
135
  document.addEventListener(event, measureInteraction, true);
153
136
  }
154
137
  document.addEventListener("load", schedule, true);
155
- document.addEventListener("error", schedule, true);
156
138
  document.addEventListener("toggle", schedule, true);
157
139
  return () => {
158
140
  cancelAnimationFrame(scheduledFrame);
@@ -163,7 +145,6 @@ function startResponder() {
163
145
  mutations.disconnect();
164
146
  window.removeEventListener("message", receive);
165
147
  document.removeEventListener("load", schedule, true);
166
- document.removeEventListener("error", schedule, true);
167
148
  document.removeEventListener("toggle", schedule, true);
168
149
  for (const event of events) {
169
150
  document.removeEventListener(event, measureInteraction, true);
@@ -0,0 +1 @@
1
+ export declare const FEATURE_TYPES: readonly ["credits", "shopifyThemeBuilder.publishedElements", "sites", "shopifyThemeBuilder.projects"];
@@ -249,6 +249,12 @@ export declare const errorUserFacingDetailsMessageSchema: z.ZodObject<{
249
249
  maximum: z.ZodNumber;
250
250
  }, z.core.$strip>>;
251
251
  plan: z.ZodOptional<z.ZodString>;
252
+ featureType: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
253
+ credits: "credits";
254
+ "shopifyThemeBuilder.publishedElements": "shopifyThemeBuilder.publishedElements";
255
+ sites: "sites";
256
+ "shopifyThemeBuilder.projects": "shopifyThemeBuilder.projects";
257
+ }>>>;
252
258
  callToAction: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
253
259
  type: z.ZodLiteral<"reload">;
254
260
  }, z.core.$strip>, z.ZodObject<{
@@ -316,6 +322,12 @@ export declare const errorUserFacingDetailsSchema: z.ZodDiscriminatedUnion<[z.Zo
316
322
  maximum: z.ZodNumber;
317
323
  }, z.core.$strip>>;
318
324
  plan: z.ZodOptional<z.ZodString>;
325
+ featureType: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
326
+ credits: "credits";
327
+ "shopifyThemeBuilder.publishedElements": "shopifyThemeBuilder.publishedElements";
328
+ sites: "sites";
329
+ "shopifyThemeBuilder.projects": "shopifyThemeBuilder.projects";
330
+ }>>>;
319
331
  callToAction: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
320
332
  type: z.ZodLiteral<"reload">;
321
333
  }, z.core.$strip>, z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import { createIframeRpcChannel } from '../../chunk-WLPBO36O.mjs';
1
+ import { createIframeRpcChannel } from '../../chunk-Y5IA6NXD.mjs';
2
2
  import '../../chunk-WMAKU6GT.mjs';
3
3
  import '../../chunk-HB4GV2QH.mjs';
4
4
  import '../../chunk-SKVPFN7M.mjs';
@@ -12,6 +12,7 @@ export type ErrorUserFacingDetailsWithMessage = {
12
12
  maximum: number;
13
13
  };
14
14
  plan?: string;
15
+ featureType?: ("credits" | "shopifyThemeBuilder.publishedElements" | "sites" | "shopifyThemeBuilder.projects") | undefined;
15
16
  callToAction?: {
16
17
  type: "reload";
17
18
  } | {
@@ -1,4 +1,4 @@
1
- export { createIframeRpcChannel, createIframeRpcRemote, iframeRpcCallSchema } from '../../chunk-WLPBO36O.mjs';
1
+ export { createIframeRpcChannel, createIframeRpcRemote, iframeRpcCallSchema } from '../../chunk-Y5IA6NXD.mjs';
2
2
  import '../../chunk-WMAKU6GT.mjs';
3
3
  import '../../chunk-HB4GV2QH.mjs';
4
4
  import '../../chunk-SKVPFN7M.mjs';
@@ -130,3 +130,54 @@ export declare const pageHeatmapIframeMessageSchema: z.ZodDiscriminatedUnion<[z.
130
130
  type: z.ZodLiteral<"replo:heatmap:elementClicked">;
131
131
  selector: z.ZodNullable<z.ZodString>;
132
132
  }, z.core.$strip>], "type">;
133
+ /** Share of sessions that scrolled at least this far down the page, at each quarter. */
134
+ export declare function getScrollReachRows(scroll: {
135
+ pct: number;
136
+ views: number;
137
+ }[]): {
138
+ depth: number;
139
+ share: number;
140
+ }[];
141
+ export declare const listHeatmapPagesOutputSchema: z.ZodObject<{
142
+ pages: z.ZodArray<z.ZodObject<{
143
+ path: z.ZodString;
144
+ capture: z.ZodEnum<{
145
+ clicks: "clicks";
146
+ heatmap: "heatmap";
147
+ }>;
148
+ sessions: z.ZodNumber;
149
+ clicks: z.ZodNumber;
150
+ purchaseSessions: z.ZodNumber;
151
+ revenue: z.ZodNumber;
152
+ hasSiteSnapshot: z.ZodBoolean;
153
+ }, z.core.$strip>>;
154
+ }, z.core.$strip>;
155
+ export declare const getPageHeatmapOutputSchema: z.ZodObject<{
156
+ path: z.ZodString;
157
+ device: z.ZodString;
158
+ days: z.ZodNumber;
159
+ hasPicture: z.ZodBoolean;
160
+ totals: z.ZodObject<{
161
+ sessions: z.ZodNumber;
162
+ clicks: z.ZodNumber;
163
+ purchaseSessions: z.ZodNumber;
164
+ purchases: z.ZodNumber;
165
+ cartSessions: z.ZodNumber;
166
+ rageClicks: z.ZodNumber;
167
+ revenue: z.ZodNumber;
168
+ }, z.core.$strip>;
169
+ firstScreenHeight: z.ZodNumber;
170
+ scrollReach: z.ZodArray<z.ZodObject<{
171
+ depth: z.ZodNumber;
172
+ share: z.ZodNumber;
173
+ }, z.core.$strip>>;
174
+ topElements: z.ZodArray<z.ZodObject<{
175
+ label: z.ZodString;
176
+ clicks: z.ZodNumber;
177
+ sessions: z.ZodNumber;
178
+ purchaseSessions: z.ZodNumber;
179
+ revenue: z.ZodNumber;
180
+ rageClicks: z.ZodNumber;
181
+ pagePosition: z.ZodNumber;
182
+ }, z.core.$strip>>;
183
+ }, z.core.$strip>;
@@ -68,5 +68,59 @@ var pageHeatmapIframeMessageSchema = z.discriminatedUnion("type", [
68
68
  pageHeatmapDrawnMessageSchema,
69
69
  pageHeatmapElementClickedMessageSchema
70
70
  ]).describe("PageHeatmapIframeMessage");
71
+ var SCROLL_REACH_DEPTHS = [25, 50, 75, 100];
72
+ function getScrollReachRows(scroll) {
73
+ const total = scroll.reduce((sum, bucket) => sum + bucket.views, 0);
74
+ return SCROLL_REACH_DEPTHS.map((depth) => {
75
+ const reached = scroll.reduce((sum, bucket) => {
76
+ return bucket.pct >= depth ? sum + bucket.views : sum;
77
+ }, 0);
78
+ return { depth, share: total > 0 ? reached / total : 0 };
79
+ });
80
+ }
81
+ var heatNumberSchema = z.number();
82
+ var listHeatmapPagesOutputSchema = z.object({
83
+ pages: z.array(
84
+ z.object({
85
+ path: z.string(),
86
+ capture: z.enum(["heatmap", "clicks"]),
87
+ sessions: heatNumberSchema,
88
+ clicks: heatNumberSchema,
89
+ purchaseSessions: heatNumberSchema,
90
+ revenue: heatNumberSchema,
91
+ hasSiteSnapshot: z.boolean()
92
+ })
93
+ )
94
+ });
95
+ var getPageHeatmapOutputSchema = z.object({
96
+ path: z.string(),
97
+ device: z.string(),
98
+ days: heatNumberSchema,
99
+ hasPicture: z.boolean(),
100
+ totals: z.object({
101
+ sessions: heatNumberSchema,
102
+ clicks: heatNumberSchema,
103
+ purchaseSessions: heatNumberSchema,
104
+ purchases: heatNumberSchema,
105
+ cartSessions: heatNumberSchema,
106
+ rageClicks: heatNumberSchema,
107
+ revenue: heatNumberSchema
108
+ }),
109
+ firstScreenHeight: heatNumberSchema,
110
+ scrollReach: z.array(
111
+ z.object({ depth: heatNumberSchema, share: heatNumberSchema })
112
+ ),
113
+ topElements: z.array(
114
+ z.object({
115
+ label: z.string(),
116
+ clicks: heatNumberSchema,
117
+ sessions: heatNumberSchema,
118
+ purchaseSessions: heatNumberSchema,
119
+ revenue: heatNumberSchema,
120
+ rageClicks: heatNumberSchema,
121
+ pagePosition: heatNumberSchema
122
+ })
123
+ )
124
+ });
71
125
 
72
- export { PAGE_HEATMAP_MAX_BADGES, PAGE_HEATMAP_MAX_CLICKS, PAGE_HEATMAP_MAX_SECTIONS, PAGE_HEATMAP_PROTOCOL_VERSION, pageHeatmapBadgeSchema, pageHeatmapClearMessageSchema, pageHeatmapClickSchema, pageHeatmapDrawnMessageSchema, pageHeatmapElementClickedMessageSchema, pageHeatmapElementSectionSchema, pageHeatmapFocusMessageSchema, pageHeatmapIframeMessageSchema, pageHeatmapModeSchema, pageHeatmapParentMessageSchema, pageHeatmapReadyMessageSchema, pageHeatmapRequestReadyMessageSchema, pageHeatmapScrollBucketSchema, pageHeatmapSetMessageSchema };
126
+ export { PAGE_HEATMAP_MAX_BADGES, PAGE_HEATMAP_MAX_CLICKS, PAGE_HEATMAP_MAX_SECTIONS, PAGE_HEATMAP_PROTOCOL_VERSION, getPageHeatmapOutputSchema, getScrollReachRows, listHeatmapPagesOutputSchema, pageHeatmapBadgeSchema, pageHeatmapClearMessageSchema, pageHeatmapClickSchema, pageHeatmapDrawnMessageSchema, pageHeatmapElementClickedMessageSchema, pageHeatmapElementSectionSchema, pageHeatmapFocusMessageSchema, pageHeatmapIframeMessageSchema, pageHeatmapModeSchema, pageHeatmapParentMessageSchema, pageHeatmapReadyMessageSchema, pageHeatmapRequestReadyMessageSchema, pageHeatmapScrollBucketSchema, pageHeatmapSetMessageSchema };
@@ -1,4 +1,4 @@
1
- import { createIframeRpcChannel } from '../../chunk-WLPBO36O.mjs';
1
+ import { createIframeRpcChannel } from '../../chunk-Y5IA6NXD.mjs';
2
2
  import '../../chunk-WMAKU6GT.mjs';
3
3
  import '../../chunk-HB4GV2QH.mjs';
4
4
  import '../../chunk-SKVPFN7M.mjs';
package/buildMetadata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sandbox-runtime",
3
- "version": "1.24.5",
3
+ "version": "1.24.6",
4
4
  "branch": "HEAD",
5
- "commit": "547c2f890567e78210f5359114f849b43d7611da",
6
- "builtAt": "2026-11-07T18:09:33.143Z"
5
+ "commit": "12bcf877e300038e72dc16ebd4fcdec038826d27",
6
+ "builtAt": "2026-11-08T23:15:21.565Z"
7
7
  };
@@ -8,6 +8,13 @@ var defaultLogger = {
8
8
  error: console.error
9
9
  };
10
10
 
11
+ var FEATURE_TYPES = [
12
+ "credits",
13
+ "shopifyThemeBuilder.publishedElements",
14
+ "sites",
15
+ "shopifyThemeBuilder.projects"
16
+ ];
17
+
11
18
  var ReploError = class _ReploError extends Error {
12
19
  config;
13
20
  id;
@@ -53,6 +60,7 @@ var errorUserFacingDetailsMessageSchema = z.object({
53
60
  maximum: z.number()
54
61
  }).optional(),
55
62
  plan: z.string().optional(),
63
+ featureType: z.enum(FEATURE_TYPES).optional().catch(void 0),
56
64
  callToAction: z.discriminatedUnion("type", [
57
65
  z.object({ type: z.literal("reload") }),
58
66
  z.object({ type: z.literal("installApp") }),
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.24.5",
3
+ "version": "1.24.6",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.24.5",
6
+ "version": "1.24.6",
7
7
  "branch": "HEAD",
8
- "commit": "547c2f890567e78210f5359114f849b43d7611da",
9
- "builtAt": "2026-11-07T18:09:33.143Z"
8
+ "commit": "12bcf877e300038e72dc16ebd4fcdec038826d27",
9
+ "builtAt": "2026-11-08T23:15:21.565Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",