@replohq/sandbox-runtime 1.24.5 → 1.24.7
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/PagePreviewHeightResponder.js +1 -20
- package/_vendor/schemas/agentBillingFeatureType.d.ts +1 -0
- package/_vendor/schemas/errors.d.ts +12 -0
- package/_vendor/schemas/externalNavigationIframeRpc.mjs +1 -1
- package/_vendor/schemas/generated/errors.d.ts +1 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +1 -1
- package/_vendor/schemas/pageHeatmap.d.ts +51 -0
- package/_vendor/schemas/pageHeatmap.mjs +55 -1
- package/_vendor/schemas/previewHealthIframeRpc.mjs +1 -1
- package/buildMetadata.js +3 -3
- package/{chunk-WLPBO36O.mjs → chunk-Y5IA6NXD.mjs} +8 -0
- package/package.json +4 -4
- package/select-mode/annotationFrames.js +2 -14
|
@@ -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<{
|
|
@@ -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-
|
|
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 };
|
package/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.7",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-11-
|
|
5
|
+
"commit": "ae3b30aedf49e4c1351290757cbab9f9f50e8369",
|
|
6
|
+
"builtAt": "2026-11-09T22:40:21.866Z"
|
|
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.
|
|
3
|
+
"version": "1.24.7",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sandbox-runtime",
|
|
6
|
-
"version": "1.24.
|
|
6
|
+
"version": "1.24.7",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-11-
|
|
8
|
+
"commit": "ae3b30aedf49e4c1351290757cbab9f9f50e8369",
|
|
9
|
+
"builtAt": "2026-11-09T22:40:21.866Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -30,19 +30,8 @@ function getOrCreateFramesLayerContainer({
|
|
|
30
30
|
document.body.append(container);
|
|
31
31
|
return container;
|
|
32
32
|
}
|
|
33
|
-
const ANNOTATION_FONT_STYLE_ID = "replo-annotation-font";
|
|
34
33
|
const BADGE_SIZE_PX = 30;
|
|
35
|
-
const
|
|
36
|
-
const BADGE_FONT = 'italic 400 16px/1 "PP Editorial New", Georgia, "Times New Roman", serif';
|
|
37
|
-
function ensureBadgeFont() {
|
|
38
|
-
if (document.getElementById(ANNOTATION_FONT_STYLE_ID)) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const style = document.createElement("style");
|
|
42
|
-
style.id = ANNOTATION_FONT_STYLE_ID;
|
|
43
|
-
style.textContent = `@font-face{font-family:"PP Editorial New";src:url("${EDITORIAL_ITALIC_FONT_URL}") format("woff2");font-weight:normal;font-style:italic;font-display:swap;}`;
|
|
44
|
-
document.head.append(style);
|
|
45
|
-
}
|
|
34
|
+
const BADGE_FONT = "600 14px/1 Inter, system-ui, sans-serif";
|
|
46
35
|
const badgeNodesById = /* @__PURE__ */ new Map();
|
|
47
36
|
let activeBadgeId = null;
|
|
48
37
|
function badgeRestingTransform(id) {
|
|
@@ -98,7 +87,7 @@ function createFrameNode(spec) {
|
|
|
98
87
|
"cursor: pointer",
|
|
99
88
|
"pointer-events: auto",
|
|
100
89
|
"margin: 0",
|
|
101
|
-
"padding: 0
|
|
90
|
+
"padding: 0"
|
|
102
91
|
].join(";");
|
|
103
92
|
badge.addEventListener("pointerdown", () => {
|
|
104
93
|
badge.style.transform = "scale(0.9)";
|
|
@@ -127,7 +116,6 @@ function showAnnotationFrames({
|
|
|
127
116
|
if (!container) {
|
|
128
117
|
return;
|
|
129
118
|
}
|
|
130
|
-
ensureBadgeFont();
|
|
131
119
|
activeBadgeId = frames.find((spec) => spec.isActive)?.id ?? null;
|
|
132
120
|
badgeNodesById.clear();
|
|
133
121
|
container.replaceChildren(...frames.map((spec) => createFrameNode(spec)));
|