@replohq/sandbox-runtime 1.18.0 → 1.19.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.
- package/_vendor/replo-utils/lib/crypto.d.ts +1 -0
- package/_vendor/replo-utils/lib/crypto.mjs +1 -1
- package/_vendor/replo-utils/lib/fonts.mjs +2 -2
- package/_vendor/replo-utils/lib/math.mjs +3 -3
- package/_vendor/replo-utils/lib/misc.mjs +4 -4
- package/_vendor/replo-utils/lib/pageCapture.mjs +1 -1
- package/_vendor/schemas/errors.d.ts +0 -1
- package/_vendor/schemas/generated/pageHeatmap.d.ts +57 -0
- package/_vendor/schemas/generated/pageHeatmap.mjs +1 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +6 -6
- package/_vendor/schemas/pageHeatmap.d.ts +132 -0
- package/_vendor/schemas/pageHeatmap.mjs +72 -0
- package/_vendor/schemas/previewHealthIframeRpc.mjs +6 -6
- package/_vendor/schemas/selectMode.d.ts +1 -1
- package/_vendor/schemas/selectMode.mjs +5 -5
- package/_vendor/schemas/selectModeIframeRpc.d.ts +2 -2
- package/_vendor/schemas/selectModeIframeRpc.mjs +5 -5
- package/buildMetadata.js +3 -3
- package/capturePage.js +5 -1
- package/{chunk-KRA4LUIR.mjs → chunk-36IPO47A.mjs} +2 -2
- package/{chunk-TP4ZXK4R.mjs → chunk-QTGDSYSU.mjs} +1 -1
- package/{chunk-FLYEIRFK.mjs → chunk-SKVPFN7M.mjs} +1 -1
- package/{chunk-PH3S6LJI.mjs → chunk-THOBCJJA.mjs} +2 -2
- package/{chunk-LIPH4O4F.mjs → chunk-ZTT7SNYN.mjs} +5 -2
- package/heatmaps/HeatLayerMount.d.ts +1 -0
- package/heatmaps/HeatLayerMount.js +12 -0
- package/heatmaps/heatBadges.d.ts +25 -0
- package/heatmaps/heatBadges.js +98 -0
- package/heatmaps/heatCore.d.ts +34 -0
- package/heatmaps/heatCore.js +465 -0
- package/heatmaps/heatLayer.d.ts +1 -0
- package/heatmaps/heatLayer.js +85 -0
- package/heatmaps/heatRender.d.ts +36 -0
- package/heatmaps/heatRender.js +198 -0
- package/package.json +4 -4
- package/sandbox-runtime.js +2 -0
- package/select-mode/hooks/useSelectionHover.js +5 -0
- package/select-mode/section-canvas/SectionCanvas.js +80 -124
- package/select-mode/section-canvas/sectionCanvasStore.d.ts +0 -2
- package/select-mode/section-canvas/sectionCanvasStore.js +0 -15
- package/select-mode/section-canvas/sectionGhost.d.ts +0 -5
- package/select-mode/section-canvas/sectionGhost.js +0 -23
- /package/{chunk-TESFJQID.mjs → chunk-4ITJNSXZ.mjs} +0 -0
- /package/{chunk-G3S6ZNPF.mjs → chunk-XYS6G2ZC.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export { base64UrlToBytes, bytesToBase64Url, constantTimeEqual, getHmacSha256Hex, randomBase64Url, randomUUID, sha256Hex } from '../../../chunk-
|
|
1
|
+
export { base64UrlToBytes, bytesToBase64Url, constantTimeEqual, deterministicUUID, getHmacSha256Hex, randomBase64Url, randomUUID, sha256Hex } from '../../../chunk-ZTT7SNYN.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isArray_default } from '../../../chunk-
|
|
2
|
-
import { Symbol_default, isObjectLike_default, baseGetTag_default } from '../../../chunk-
|
|
1
|
+
import { isArray_default } from '../../../chunk-4ITJNSXZ.mjs';
|
|
2
|
+
import { Symbol_default, isObjectLike_default, baseGetTag_default } from '../../../chunk-XYS6G2ZC.mjs';
|
|
3
3
|
|
|
4
4
|
function arrayMap(array, iteratee) {
|
|
5
5
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { randomUUID } from '../../../chunk-
|
|
2
|
-
import { isNumber_default } from '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
1
|
+
import { randomUUID } from '../../../chunk-ZTT7SNYN.mjs';
|
|
2
|
+
import { isNumber_default } from '../../../chunk-SKVPFN7M.mjs';
|
|
3
|
+
import '../../../chunk-XYS6G2ZC.mjs';
|
|
4
4
|
|
|
5
5
|
var EPSILON = 0.03;
|
|
6
6
|
function isCloseTo(number, comparator, epsilon = EPSILON) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, isString_default as isString, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, sleepWithSignal, warning } from '../../../chunk-
|
|
2
|
-
export { isNumber_default as isNumber } from '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
4
|
-
import '../../../chunk-
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, isString_default as isString, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, sleepWithSignal, warning } from '../../../chunk-THOBCJJA.mjs';
|
|
2
|
+
export { isNumber_default as isNumber } from '../../../chunk-SKVPFN7M.mjs';
|
|
3
|
+
import '../../../chunk-4ITJNSXZ.mjs';
|
|
4
|
+
import '../../../chunk-XYS6G2ZC.mjs';
|
|
@@ -2,7 +2,6 @@ import type { ErrorUserFacingDetails, ErrorUserFacingDetailsWithMessage } from "
|
|
|
2
2
|
import type { ReploErrorConfig } from "./reploError";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { ReploError } from "./reploError";
|
|
5
|
-
export { ReploError, type ReploErrorConfig } from "./reploError";
|
|
6
5
|
/**
|
|
7
6
|
* Wraps an error so `async-retry` stops immediately instead of scheduling
|
|
8
7
|
* another attempt: the library rejects with any thrown error carrying a truthy
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type PageHeatmapMode = "revenue" | "clicks" | "scroll";
|
|
2
|
+
export type PageHeatmapClick = {
|
|
3
|
+
selector: string;
|
|
4
|
+
rx: number;
|
|
5
|
+
ry: number;
|
|
6
|
+
weight: number;
|
|
7
|
+
};
|
|
8
|
+
export type PageHeatmapScrollBucket = {
|
|
9
|
+
pct: number;
|
|
10
|
+
views: number;
|
|
11
|
+
};
|
|
12
|
+
export type PageHeatmapBadge = {
|
|
13
|
+
selector: string;
|
|
14
|
+
label: string;
|
|
15
|
+
hot: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type PageHeatmapSetMessage = {
|
|
18
|
+
type: "replo:heatmap:set";
|
|
19
|
+
protocolVersion: 1;
|
|
20
|
+
setId: string;
|
|
21
|
+
mode: PageHeatmapMode;
|
|
22
|
+
clicks: PageHeatmapClick[];
|
|
23
|
+
scroll: PageHeatmapScrollBucket[];
|
|
24
|
+
badges: PageHeatmapBadge[];
|
|
25
|
+
fold: number | null;
|
|
26
|
+
};
|
|
27
|
+
export type PageHeatmapFocusMessage = {
|
|
28
|
+
type: "replo:heatmap:focus";
|
|
29
|
+
selector: string | null;
|
|
30
|
+
};
|
|
31
|
+
export type PageHeatmapClearMessage = {
|
|
32
|
+
type: "replo:heatmap:clear";
|
|
33
|
+
};
|
|
34
|
+
export type PageHeatmapRequestReadyMessage = {
|
|
35
|
+
type: "replo:heatmap:requestReady";
|
|
36
|
+
};
|
|
37
|
+
export type PageHeatmapParentMessage = PageHeatmapSetMessage | PageHeatmapFocusMessage | PageHeatmapClearMessage | PageHeatmapRequestReadyMessage;
|
|
38
|
+
export type PageHeatmapReadyMessage = {
|
|
39
|
+
type: "replo:heatmap:ready";
|
|
40
|
+
protocolVersion: 1;
|
|
41
|
+
};
|
|
42
|
+
export type PageHeatmapElementSection = {
|
|
43
|
+
selector: string;
|
|
44
|
+
section: string;
|
|
45
|
+
};
|
|
46
|
+
export type PageHeatmapDrawnMessage = {
|
|
47
|
+
type: "replo:heatmap:drawn";
|
|
48
|
+
setId: string;
|
|
49
|
+
placedWeight: number;
|
|
50
|
+
unplacedWeight: number;
|
|
51
|
+
sections: PageHeatmapElementSection[];
|
|
52
|
+
};
|
|
53
|
+
export type PageHeatmapElementClickedMessage = {
|
|
54
|
+
type: "replo:heatmap:elementClicked";
|
|
55
|
+
selector: string | null;
|
|
56
|
+
};
|
|
57
|
+
export type PageHeatmapIframeMessage = PageHeatmapReadyMessage | PageHeatmapDrawnMessage | PageHeatmapElementClickedMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createIframeRpcChannel, createIframeRpcRemote, iframeRpcCallSchema } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
1
|
+
export { createIframeRpcChannel, createIframeRpcRemote, iframeRpcCallSchema } from '../../chunk-36IPO47A.mjs';
|
|
2
|
+
import '../../chunk-ZTT7SNYN.mjs';
|
|
3
|
+
import '../../chunk-THOBCJJA.mjs';
|
|
4
|
+
import '../../chunk-SKVPFN7M.mjs';
|
|
5
|
+
import '../../chunk-4ITJNSXZ.mjs';
|
|
6
|
+
import '../../chunk-XYS6G2ZC.mjs';
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const PAGE_HEATMAP_PROTOCOL_VERSION = 1;
|
|
3
|
+
export declare const PAGE_HEATMAP_MAX_CLICKS = 2000;
|
|
4
|
+
export declare const PAGE_HEATMAP_MAX_BADGES = 200;
|
|
5
|
+
export declare const PAGE_HEATMAP_MAX_SECTIONS = 2200;
|
|
6
|
+
export declare const pageHeatmapModeSchema: z.ZodEnum<{
|
|
7
|
+
scroll: "scroll";
|
|
8
|
+
revenue: "revenue";
|
|
9
|
+
clicks: "clicks";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const pageHeatmapClickSchema: z.ZodObject<{
|
|
12
|
+
selector: z.ZodString;
|
|
13
|
+
rx: z.ZodNumber;
|
|
14
|
+
ry: z.ZodNumber;
|
|
15
|
+
weight: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const pageHeatmapScrollBucketSchema: z.ZodObject<{
|
|
18
|
+
pct: z.ZodNumber;
|
|
19
|
+
views: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const pageHeatmapBadgeSchema: z.ZodObject<{
|
|
22
|
+
selector: z.ZodString;
|
|
23
|
+
label: z.ZodString;
|
|
24
|
+
hot: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const pageHeatmapSetMessageSchema: z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"replo:heatmap:set">;
|
|
28
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
29
|
+
setId: z.ZodString;
|
|
30
|
+
mode: z.ZodEnum<{
|
|
31
|
+
scroll: "scroll";
|
|
32
|
+
revenue: "revenue";
|
|
33
|
+
clicks: "clicks";
|
|
34
|
+
}>;
|
|
35
|
+
clicks: z.ZodArray<z.ZodObject<{
|
|
36
|
+
selector: z.ZodString;
|
|
37
|
+
rx: z.ZodNumber;
|
|
38
|
+
ry: z.ZodNumber;
|
|
39
|
+
weight: z.ZodNumber;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
scroll: z.ZodArray<z.ZodObject<{
|
|
42
|
+
pct: z.ZodNumber;
|
|
43
|
+
views: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
badges: z.ZodArray<z.ZodObject<{
|
|
46
|
+
selector: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
hot: z.ZodBoolean;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
fold: z.ZodNullable<z.ZodNumber>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const pageHeatmapFocusMessageSchema: z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"replo:heatmap:focus">;
|
|
54
|
+
selector: z.ZodNullable<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const pageHeatmapClearMessageSchema: z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"replo:heatmap:clear">;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export declare const pageHeatmapRequestReadyMessageSchema: z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"replo:heatmap:requestReady">;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export declare const pageHeatmapParentMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"replo:heatmap:set">;
|
|
64
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
65
|
+
setId: z.ZodString;
|
|
66
|
+
mode: z.ZodEnum<{
|
|
67
|
+
scroll: "scroll";
|
|
68
|
+
revenue: "revenue";
|
|
69
|
+
clicks: "clicks";
|
|
70
|
+
}>;
|
|
71
|
+
clicks: z.ZodArray<z.ZodObject<{
|
|
72
|
+
selector: z.ZodString;
|
|
73
|
+
rx: z.ZodNumber;
|
|
74
|
+
ry: z.ZodNumber;
|
|
75
|
+
weight: z.ZodNumber;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
scroll: z.ZodArray<z.ZodObject<{
|
|
78
|
+
pct: z.ZodNumber;
|
|
79
|
+
views: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
badges: z.ZodArray<z.ZodObject<{
|
|
82
|
+
selector: z.ZodString;
|
|
83
|
+
label: z.ZodString;
|
|
84
|
+
hot: z.ZodBoolean;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
fold: z.ZodNullable<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"replo:heatmap:focus">;
|
|
89
|
+
selector: z.ZodNullable<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"replo:heatmap:clear">;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"replo:heatmap:requestReady">;
|
|
94
|
+
}, z.core.$strip>], "type">;
|
|
95
|
+
export declare const pageHeatmapReadyMessageSchema: z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"replo:heatmap:ready">;
|
|
97
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export declare const pageHeatmapElementSectionSchema: z.ZodObject<{
|
|
100
|
+
selector: z.ZodString;
|
|
101
|
+
section: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const pageHeatmapDrawnMessageSchema: z.ZodObject<{
|
|
104
|
+
type: z.ZodLiteral<"replo:heatmap:drawn">;
|
|
105
|
+
setId: z.ZodString;
|
|
106
|
+
placedWeight: z.ZodNumber;
|
|
107
|
+
unplacedWeight: z.ZodNumber;
|
|
108
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
109
|
+
selector: z.ZodString;
|
|
110
|
+
section: z.ZodString;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export declare const pageHeatmapElementClickedMessageSchema: z.ZodObject<{
|
|
114
|
+
type: z.ZodLiteral<"replo:heatmap:elementClicked">;
|
|
115
|
+
selector: z.ZodNullable<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export declare const pageHeatmapIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"replo:heatmap:ready">;
|
|
119
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
120
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
121
|
+
type: z.ZodLiteral<"replo:heatmap:drawn">;
|
|
122
|
+
setId: z.ZodString;
|
|
123
|
+
placedWeight: z.ZodNumber;
|
|
124
|
+
unplacedWeight: z.ZodNumber;
|
|
125
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
126
|
+
selector: z.ZodString;
|
|
127
|
+
section: z.ZodString;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"replo:heatmap:elementClicked">;
|
|
131
|
+
selector: z.ZodNullable<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>], "type">;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
var PAGE_HEATMAP_PROTOCOL_VERSION = 1;
|
|
4
|
+
var PAGE_HEATMAP_MAX_CLICKS = 2e3;
|
|
5
|
+
var PAGE_HEATMAP_MAX_BADGES = 200;
|
|
6
|
+
var PAGE_HEATMAP_MAX_SECTIONS = 2200;
|
|
7
|
+
var pageHeatmapModeSchema = z.enum(["revenue", "clicks", "scroll"]).describe("PageHeatmapMode");
|
|
8
|
+
var fractionSchema = z.number().min(0).max(1);
|
|
9
|
+
var weightSchema = z.number().nonnegative().max(1e9);
|
|
10
|
+
var pageHeatmapClickSchema = z.object({
|
|
11
|
+
selector: z.string().min(1).max(2e3),
|
|
12
|
+
rx: fractionSchema,
|
|
13
|
+
ry: fractionSchema,
|
|
14
|
+
weight: weightSchema
|
|
15
|
+
}).describe("PageHeatmapClick");
|
|
16
|
+
var pageHeatmapScrollBucketSchema = z.object({
|
|
17
|
+
pct: z.number().int().min(0).max(100),
|
|
18
|
+
views: z.number().int().nonnegative()
|
|
19
|
+
}).describe("PageHeatmapScrollBucket");
|
|
20
|
+
var pageHeatmapBadgeSchema = z.object({
|
|
21
|
+
selector: z.string().min(1).max(2e3),
|
|
22
|
+
label: z.string().min(1).max(32),
|
|
23
|
+
hot: z.boolean()
|
|
24
|
+
}).describe("PageHeatmapBadge");
|
|
25
|
+
var pageHeatmapSetMessageSchema = z.object({
|
|
26
|
+
type: z.literal("replo:heatmap:set"),
|
|
27
|
+
protocolVersion: z.literal(PAGE_HEATMAP_PROTOCOL_VERSION),
|
|
28
|
+
setId: z.string().min(1).max(256),
|
|
29
|
+
mode: pageHeatmapModeSchema,
|
|
30
|
+
clicks: z.array(pageHeatmapClickSchema).max(PAGE_HEATMAP_MAX_CLICKS),
|
|
31
|
+
scroll: z.array(pageHeatmapScrollBucketSchema).max(101),
|
|
32
|
+
badges: z.array(pageHeatmapBadgeSchema).max(PAGE_HEATMAP_MAX_BADGES),
|
|
33
|
+
fold: z.number().positive().max(1e5).nullable()
|
|
34
|
+
}).describe("PageHeatmapSetMessage");
|
|
35
|
+
var pageHeatmapFocusMessageSchema = z.object({
|
|
36
|
+
type: z.literal("replo:heatmap:focus"),
|
|
37
|
+
selector: z.string().min(1).max(2e3).nullable()
|
|
38
|
+
}).describe("PageHeatmapFocusMessage");
|
|
39
|
+
var pageHeatmapClearMessageSchema = z.object({ type: z.literal("replo:heatmap:clear") }).describe("PageHeatmapClearMessage");
|
|
40
|
+
var pageHeatmapRequestReadyMessageSchema = z.object({ type: z.literal("replo:heatmap:requestReady") }).describe("PageHeatmapRequestReadyMessage");
|
|
41
|
+
var pageHeatmapParentMessageSchema = z.discriminatedUnion("type", [
|
|
42
|
+
pageHeatmapSetMessageSchema,
|
|
43
|
+
pageHeatmapFocusMessageSchema,
|
|
44
|
+
pageHeatmapClearMessageSchema,
|
|
45
|
+
pageHeatmapRequestReadyMessageSchema
|
|
46
|
+
]).describe("PageHeatmapParentMessage");
|
|
47
|
+
var pageHeatmapReadyMessageSchema = z.object({
|
|
48
|
+
type: z.literal("replo:heatmap:ready"),
|
|
49
|
+
protocolVersion: z.literal(PAGE_HEATMAP_PROTOCOL_VERSION)
|
|
50
|
+
}).describe("PageHeatmapReadyMessage");
|
|
51
|
+
var pageHeatmapElementSectionSchema = z.object({
|
|
52
|
+
selector: z.string().min(1).max(2e3),
|
|
53
|
+
section: z.string().min(1).max(64)
|
|
54
|
+
}).describe("PageHeatmapElementSection");
|
|
55
|
+
var pageHeatmapDrawnMessageSchema = z.object({
|
|
56
|
+
type: z.literal("replo:heatmap:drawn"),
|
|
57
|
+
setId: z.string().min(1).max(256),
|
|
58
|
+
placedWeight: z.number().nonnegative(),
|
|
59
|
+
unplacedWeight: z.number().nonnegative(),
|
|
60
|
+
sections: z.array(pageHeatmapElementSectionSchema).max(PAGE_HEATMAP_MAX_SECTIONS)
|
|
61
|
+
}).describe("PageHeatmapDrawnMessage");
|
|
62
|
+
var pageHeatmapElementClickedMessageSchema = z.object({
|
|
63
|
+
type: z.literal("replo:heatmap:elementClicked"),
|
|
64
|
+
selector: z.string().min(1).max(2e3).nullable()
|
|
65
|
+
}).describe("PageHeatmapElementClickedMessage");
|
|
66
|
+
var pageHeatmapIframeMessageSchema = z.discriminatedUnion("type", [
|
|
67
|
+
pageHeatmapReadyMessageSchema,
|
|
68
|
+
pageHeatmapDrawnMessageSchema,
|
|
69
|
+
pageHeatmapElementClickedMessageSchema
|
|
70
|
+
]).describe("PageHeatmapIframeMessage");
|
|
71
|
+
|
|
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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createIframeRpcChannel } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
1
|
+
import { createIframeRpcChannel } from '../../chunk-36IPO47A.mjs';
|
|
2
|
+
import '../../chunk-ZTT7SNYN.mjs';
|
|
3
|
+
import '../../chunk-THOBCJJA.mjs';
|
|
4
|
+
import '../../chunk-SKVPFN7M.mjs';
|
|
5
|
+
import '../../chunk-4ITJNSXZ.mjs';
|
|
6
|
+
import '../../chunk-XYS6G2ZC.mjs';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
|
|
9
9
|
var PREVIEW_HEALTH_IFRAME_RPC_CHANNEL_ID = "replo:preview-health-iframe-rpc";
|
|
@@ -425,8 +425,8 @@ export declare const selectModeFormatCommandSchema: z.ZodEnum<{
|
|
|
425
425
|
export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
|
|
426
426
|
drag: "drag";
|
|
427
427
|
area: "area";
|
|
428
|
-
none: "none";
|
|
429
428
|
element: "element";
|
|
429
|
+
none: "none";
|
|
430
430
|
}>;
|
|
431
431
|
/**
|
|
432
432
|
* Parent-side selection state mirrored from messages the iframe posts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, isSelectedSection, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeHoverRectSchema, selectModeImageSchema, selectModeImageScopeSchema, selectModeImageSourceSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectModeVideoSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, isSelectedSection, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeHoverRectSchema, selectModeImageSchema, selectModeImageScopeSchema, selectModeImageSourceSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectModeVideoSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-QTGDSYSU.mjs';
|
|
2
|
+
import '../../chunk-THOBCJJA.mjs';
|
|
3
|
+
import '../../chunk-SKVPFN7M.mjs';
|
|
4
|
+
import '../../chunk-4ITJNSXZ.mjs';
|
|
5
|
+
import '../../chunk-XYS6G2ZC.mjs';
|
|
@@ -485,8 +485,8 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
485
485
|
selectionType: z.ZodEnum<{
|
|
486
486
|
drag: "drag";
|
|
487
487
|
area: "area";
|
|
488
|
-
none: "none";
|
|
489
488
|
element: "element";
|
|
489
|
+
none: "none";
|
|
490
490
|
}>;
|
|
491
491
|
selectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
492
492
|
}, z.core.$strip>;
|
|
@@ -1087,8 +1087,8 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
1087
1087
|
selectionType: z.ZodEnum<{
|
|
1088
1088
|
drag: "drag";
|
|
1089
1089
|
area: "area";
|
|
1090
|
-
none: "none";
|
|
1091
1090
|
element: "element";
|
|
1091
|
+
none: "none";
|
|
1092
1092
|
}>;
|
|
1093
1093
|
selectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1094
1094
|
}, z.core.$strip>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeHoverRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeHoverRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-QTGDSYSU.mjs';
|
|
2
|
+
import '../../chunk-THOBCJJA.mjs';
|
|
3
|
+
import '../../chunk-SKVPFN7M.mjs';
|
|
4
|
+
import '../../chunk-4ITJNSXZ.mjs';
|
|
5
|
+
import '../../chunk-XYS6G2ZC.mjs';
|
|
6
6
|
import * as z from 'zod';
|
|
7
7
|
|
|
8
8
|
var SELECT_MODE_IFRAME_RPC_CHANNEL_ID = "replo:select-mode-iframe-rpc";
|
package/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "1aa1f09e1dd141b243b7bb3b1ff1bc947fa01371",
|
|
6
|
+
"builtAt": "2026-10-23T05:44:42.441Z"
|
|
7
7
|
};
|
package/capturePage.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { snapdom } from "@zumer/snapdom";
|
|
2
2
|
import { PageCaptureError } from "./_vendor/replo-utils/lib/pageCapture.mjs";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
+
import { SECTION_CANVAS_ATTRIBUTE } from "./select-mode/section-canvas/sectionCanvasControls";
|
|
5
|
+
import { SELECTION_FRAMES_CONTAINER_ID } from "./select-mode/selectionFrame";
|
|
4
6
|
const JPEG_QUALITY = 0.8;
|
|
5
7
|
const VIDEO_FRAME_QUALITY = 0.85;
|
|
6
8
|
const VIDEO_LOAD_TIMEOUT_MS = 4e3;
|
|
@@ -332,7 +334,9 @@ async function capturePage({
|
|
|
332
334
|
const raw = await snapdom.toRaw(document.body, {
|
|
333
335
|
scale: 1,
|
|
334
336
|
embedFonts: true,
|
|
335
|
-
exclude: (element) =>
|
|
337
|
+
exclude: (element) => {
|
|
338
|
+
return offscreenImages.has(element) || element.id === SELECTION_FRAMES_CONTAINER_ID || element.hasAttribute(SECTION_CANVAS_ATTRIBUTE);
|
|
339
|
+
},
|
|
336
340
|
plugins: [createStandInsPlugin({ objectFitByFrame, iframeThumbnails })]
|
|
337
341
|
});
|
|
338
342
|
const image = new Image();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isArray_default } from './chunk-
|
|
2
|
-
import { root_default, isObjectLike_default, freeGlobal_default, baseGetTag_default, Symbol_default } from './chunk-
|
|
1
|
+
import { isArray_default } from './chunk-4ITJNSXZ.mjs';
|
|
2
|
+
import { root_default, isObjectLike_default, freeGlobal_default, baseGetTag_default, Symbol_default } from './chunk-XYS6G2ZC.mjs';
|
|
3
3
|
|
|
4
4
|
function listCacheClear() {
|
|
5
5
|
this.__data__ = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v4 } from 'uuid';
|
|
1
|
+
import { v4, v5 } from 'uuid';
|
|
2
2
|
|
|
3
3
|
function bytesToBase64Url(bytes) {
|
|
4
4
|
let binary = "";
|
|
@@ -63,5 +63,8 @@ async function getHmacSha256Hex({
|
|
|
63
63
|
);
|
|
64
64
|
return [...new Uint8Array(signature)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
65
65
|
}
|
|
66
|
+
function deterministicUUID(value) {
|
|
67
|
+
return v5(value, v5.URL);
|
|
68
|
+
}
|
|
66
69
|
|
|
67
|
-
export { base64UrlToBytes, bytesToBase64Url, constantTimeEqual, getHmacSha256Hex, randomBase64Url, randomUUID, sha256Hex };
|
|
70
|
+
export { base64UrlToBytes, bytesToBase64Url, constantTimeEqual, deterministicUUID, getHmacSha256Hex, randomBase64Url, randomUUID, sha256Hex };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function HeatLayerMount(): null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Revenue badges pinned to each element's top-right corner, plus click-to-element lookup. */
|
|
2
|
+
import type { PageHeatmapBadge } from "../_vendor/schemas/generated/pageHeatmap";
|
|
3
|
+
export declare const HEAT_BADGE_ATTRIBUTE = "data-replo-heat-badge";
|
|
4
|
+
export interface BadgedElement {
|
|
5
|
+
selector: string;
|
|
6
|
+
element: Element;
|
|
7
|
+
}
|
|
8
|
+
export interface BadgeRect {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
isFixed: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** The landmark an element sits in, else its nearest section's aria-label or first heading. */
|
|
15
|
+
export declare function findSection(element: Element): string | null;
|
|
16
|
+
/** The clicked badge's selector, else the innermost badged element's (nth-of-type paths rule out `closest`). */
|
|
17
|
+
export declare function findClickedSelector({ target, badged, }: {
|
|
18
|
+
target: Node;
|
|
19
|
+
badged: BadgedElement[];
|
|
20
|
+
}): string | null;
|
|
21
|
+
export declare function renderBadges({ container, badges, rectFor, }: {
|
|
22
|
+
container: HTMLElement;
|
|
23
|
+
badges: PageHeatmapBadge[];
|
|
24
|
+
rectFor: (selector: string) => BadgeRect | null;
|
|
25
|
+
}): void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const HEAT_BADGE_ATTRIBUTE = "data-replo-heat-badge";
|
|
2
|
+
const SECTION_LABEL_MAX_CHARS = 24;
|
|
3
|
+
const BADGE_EDGE_INSET_PX = 14;
|
|
4
|
+
const LANDMARK_LABELS = {
|
|
5
|
+
HEADER: "Header",
|
|
6
|
+
FOOTER: "Footer",
|
|
7
|
+
NAV: "Nav"
|
|
8
|
+
};
|
|
9
|
+
const BADGE_BASE_STYLE = [
|
|
10
|
+
"position: absolute",
|
|
11
|
+
"box-sizing: border-box",
|
|
12
|
+
"margin: 0",
|
|
13
|
+
"padding: 5px 9px",
|
|
14
|
+
"border: 0",
|
|
15
|
+
"border-radius: 999px",
|
|
16
|
+
"font: 600 13px/1 -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif",
|
|
17
|
+
"font-variant-numeric: tabular-nums",
|
|
18
|
+
"letter-spacing: 0",
|
|
19
|
+
"white-space: nowrap",
|
|
20
|
+
"color: #fff",
|
|
21
|
+
"box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95), 0 2px 8px rgba(0, 0, 0, 0.35)",
|
|
22
|
+
"cursor: pointer",
|
|
23
|
+
"pointer-events: auto",
|
|
24
|
+
"transform: translate(-100%, -50%)"
|
|
25
|
+
].join(";");
|
|
26
|
+
const BADGE_BACKGROUND = "rgba(17, 17, 17, 0.92)";
|
|
27
|
+
const HOT_BADGE_BACKGROUND = "#e5383b";
|
|
28
|
+
function findSection(element) {
|
|
29
|
+
const landmark = element.closest("header, footer, nav");
|
|
30
|
+
if (landmark) {
|
|
31
|
+
return LANDMARK_LABELS[landmark.tagName] ?? null;
|
|
32
|
+
}
|
|
33
|
+
let section = element.closest("section");
|
|
34
|
+
while (section) {
|
|
35
|
+
const name = section.getAttribute("aria-label")?.trim() || section.querySelector("h1, h2, h3")?.textContent?.trim();
|
|
36
|
+
if (name) {
|
|
37
|
+
const words = name.replace(/\s+/g, " ");
|
|
38
|
+
return words.length > SECTION_LABEL_MAX_CHARS ? `${words.slice(0, SECTION_LABEL_MAX_CHARS - 1).trimEnd()}\u2026` : words;
|
|
39
|
+
}
|
|
40
|
+
section = section.parentElement?.closest("section") ?? null;
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const badgeSelectors = /* @__PURE__ */ new WeakMap();
|
|
45
|
+
function isElementNode(node) {
|
|
46
|
+
return node.nodeType === Node.ELEMENT_NODE;
|
|
47
|
+
}
|
|
48
|
+
function findClickedSelector({
|
|
49
|
+
target,
|
|
50
|
+
badged
|
|
51
|
+
}) {
|
|
52
|
+
const badge = isElementNode(target) ? target.closest(`[${HEAT_BADGE_ATTRIBUTE}]`) : null;
|
|
53
|
+
if (badge) {
|
|
54
|
+
return badgeSelectors.get(badge) ?? null;
|
|
55
|
+
}
|
|
56
|
+
let best = null;
|
|
57
|
+
for (const entry of badged) {
|
|
58
|
+
if (!entry.element.contains(target)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (!best || best.element.contains(entry.element)) {
|
|
62
|
+
best = entry;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return best?.selector ?? null;
|
|
66
|
+
}
|
|
67
|
+
function renderBadges({
|
|
68
|
+
container,
|
|
69
|
+
badges,
|
|
70
|
+
rectFor
|
|
71
|
+
}) {
|
|
72
|
+
const nodes = [];
|
|
73
|
+
for (const badge of [...badges].reverse()) {
|
|
74
|
+
const rect = rectFor(badge.selector);
|
|
75
|
+
if (!rect) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const node = container.ownerDocument.createElement("button");
|
|
79
|
+
node.type = "button";
|
|
80
|
+
node.tabIndex = -1;
|
|
81
|
+
node.setAttribute(HEAT_BADGE_ATTRIBUTE, "");
|
|
82
|
+
node.textContent = badge.label;
|
|
83
|
+
node.style.cssText = BADGE_BASE_STYLE;
|
|
84
|
+
node.style.background = badge.hot ? HOT_BADGE_BACKGROUND : BADGE_BACKGROUND;
|
|
85
|
+
node.style.position = rect.isFixed ? "fixed" : "absolute";
|
|
86
|
+
node.style.left = `${Math.max(rect.x + rect.width + BADGE_EDGE_INSET_PX / 2, BADGE_EDGE_INSET_PX * 4)}px`;
|
|
87
|
+
node.style.top = `${Math.max(rect.y, BADGE_EDGE_INSET_PX)}px`;
|
|
88
|
+
badgeSelectors.set(node, badge.selector);
|
|
89
|
+
nodes.push(node);
|
|
90
|
+
}
|
|
91
|
+
container.replaceChildren(...nodes);
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
HEAT_BADGE_ATTRIBUTE,
|
|
95
|
+
findClickedSelector,
|
|
96
|
+
findSection,
|
|
97
|
+
renderBadges
|
|
98
|
+
};
|