@replohq/sandbox-runtime 1.18.1 → 1.19.1
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.mjs +5 -5
- package/_vendor/schemas/selectModeIframeRpc.mjs +5 -5
- package/buildMetadata.js +3 -3
- 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/EditorSelection.js +5 -0
- package/select-mode/hooks/useSelectionHover.js +7 -1
- package/select-mode/hooks/useSelectionInteractions.js +6 -1
- package/select-mode/interactions/embeddedFrames.d.ts +17 -0
- package/select-mode/interactions/embeddedFrames.js +32 -0
- /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";
|
|
@@ -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';
|
|
@@ -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.1",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "0ccd8b79a0c0654b1b2e215b83c1efed676128fe",
|
|
6
|
+
"builtAt": "2026-10-24T00:25:38.939Z"
|
|
7
7
|
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Heat drawn over one document: heat canvas or scroll bands, revenue badges, focus ring and revenue clicks. */
|
|
2
|
+
import type { PageHeatmapElementSection, PageHeatmapSetMessage } from "../_vendor/schemas/generated/pageHeatmap";
|
|
3
|
+
export declare const HEAT_LAYER_HOST_ID = "replo-heat-layer";
|
|
4
|
+
export type HeatLayerSet = Omit<PageHeatmapSetMessage, "type" | "protocolVersion">;
|
|
5
|
+
export interface HeatLayerDrawn {
|
|
6
|
+
setId: string;
|
|
7
|
+
placedWeight: number;
|
|
8
|
+
unplacedWeight: number;
|
|
9
|
+
sections: PageHeatmapElementSection[];
|
|
10
|
+
}
|
|
11
|
+
export interface HeatLayer {
|
|
12
|
+
/** Draws `set` (null clears the layer and stops observing the page). */
|
|
13
|
+
show: (set: HeatLayerSet | null) => void;
|
|
14
|
+
/** Outlines one element and scrolls it into view when it's off screen; null hides the outline. */
|
|
15
|
+
focus: (selector: string | null) => void;
|
|
16
|
+
destroy: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Draws heat sets over `document`, which can be this page or a same-origin
|
|
20
|
+
* iframe's. Inert until the first `show`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createHeatLayer({ document: doc, onDrawn, onElementClicked, shouldIgnoreClick, paintAsImage, }: {
|
|
23
|
+
document: Document;
|
|
24
|
+
/** Fires when what was placed changes, not on every re-measure. */
|
|
25
|
+
onDrawn: (drawn: HeatLayerDrawn) => void;
|
|
26
|
+
/** Revenue mode: the innermost badged element under a page click, or null. */
|
|
27
|
+
onElementClicked: (selector: string | null) => void;
|
|
28
|
+
shouldIgnoreClick?: (target: Node) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A document without scripting (a sandboxed site snapshot) renders a canvas's fallback content, not
|
|
31
|
+
* its bitmap, so the heat is drawn off-page and shown as an image.
|
|
32
|
+
*/
|
|
33
|
+
paintAsImage?: boolean;
|
|
34
|
+
}): HeatLayer;
|