@replohq/sandbox-runtime 1.7.13 → 1.9.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/PageCaptureResponder.d.ts +1 -0
- package/PageCaptureResponder.js +12 -0
- package/_vendor/replo-utils/lib/crypto.mjs +1 -0
- package/_vendor/replo-utils/lib/math.mjs +1 -1
- package/_vendor/replo-utils/lib/pageCapture.d.ts +34 -0
- package/_vendor/replo-utils/lib/pageCapture.mjs +52 -0
- package/_vendor/schemas/errors.d.ts +1 -0
- package/_vendor/schemas/generated/selectMode.d.ts +25 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +1 -1
- package/_vendor/schemas/selectMode.d.ts +101 -2
- package/_vendor/schemas/selectMode.mjs +1 -1
- package/_vendor/schemas/selectModeIframeRpc.d.ts +148 -4
- package/_vendor/schemas/selectModeIframeRpc.mjs +1 -1
- package/_vendor/schemas/selectModeImage.d.ts +9 -0
- package/_vendor/schemas/selectModeImage.mjs +24 -0
- package/buildMetadata.js +3 -3
- package/capturePage.d.ts +11 -0
- package/capturePage.js +261 -0
- package/chunk-LIPH4O4F.mjs +67 -0
- package/{chunk-4T7WSMC3.mjs → chunk-XWNBKE63.mjs} +25 -1
- package/package.json +5 -4
- package/sandbox-runtime.js +2 -0
- package/select-mode/descriptor/elementDescriptor.js +2 -0
- package/select-mode/hooks/useOptimisticOverrides.js +63 -10
- package/select-mode/hooks/useSelectionInteractions.js +1 -10
- package/select-mode/iframeRpcChannel.d.ts +42 -0
- package/select-mode/imageOverridePreview.d.ts +6 -0
- package/select-mode/imageOverridePreview.js +77 -0
- package/select-mode/imageSources.d.ts +3 -0
- package/select-mode/imageSources.js +68 -0
- package/startPageCaptureResponder.d.ts +32 -0
- package/startPageCaptureResponder.js +87 -0
- package/chunk-SGKQ5HGT.mjs +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageCaptureResponder(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { startPageCaptureResponder } from "./startPageCaptureResponder";
|
|
4
|
+
function startResponder() {
|
|
5
|
+
return startPageCaptureResponder(window);
|
|
6
|
+
}
|
|
7
|
+
function PageCaptureResponder() {
|
|
8
|
+
return /* @__PURE__ */ jsx("template", { ref: startResponder });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
PageCaptureResponder
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { base64UrlToBytes, bytesToBase64Url, constantTimeEqual, getHmacSha256Hex, randomBase64Url, randomUUID, sha256Hex } from '../../../chunk-LIPH4O4F.mjs';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Site Builder asks the cross-origin preview iframe to draw its own first screen; the site's runtime replies with a JPEG. */
|
|
2
|
+
export declare const PAGE_CAPTURE_REQUEST = "replo:page-capture:request";
|
|
3
|
+
export declare const PAGE_CAPTURE_RESPONSE = "replo:page-capture:response";
|
|
4
|
+
export interface PageCaptureRequestMessage {
|
|
5
|
+
type: typeof PAGE_CAPTURE_REQUEST;
|
|
6
|
+
requestId: string;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export type PageCaptureResponseMessage = {
|
|
11
|
+
type: typeof PAGE_CAPTURE_RESPONSE;
|
|
12
|
+
requestId: string;
|
|
13
|
+
jpeg: ArrayBuffer;
|
|
14
|
+
ms: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: typeof PAGE_CAPTURE_RESPONSE;
|
|
17
|
+
requestId: string;
|
|
18
|
+
jpeg: null;
|
|
19
|
+
error: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function isPageCaptureRequestMessage(value: unknown): value is PageCaptureRequestMessage;
|
|
22
|
+
export declare class PageCaptureError extends Error {
|
|
23
|
+
}
|
|
24
|
+
/** Parent side: ask `frame` to capture itself and resolve with its JPEG bytes. */
|
|
25
|
+
export declare function requestPageCapture({ frame, targetOrigin, width, height, timeoutMs, }: {
|
|
26
|
+
frame: Window;
|
|
27
|
+
targetOrigin: string;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
jpeg: ArrayBuffer;
|
|
33
|
+
ms: number;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { randomUUID } from '../../../chunk-LIPH4O4F.mjs';
|
|
2
|
+
|
|
3
|
+
var PAGE_CAPTURE_REQUEST = "replo:page-capture:request";
|
|
4
|
+
var PAGE_CAPTURE_RESPONSE = "replo:page-capture:response";
|
|
5
|
+
function isPageCaptureRequestMessage(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && "type" in value && value.type === PAGE_CAPTURE_REQUEST && "requestId" in value && typeof value.requestId === "string" && "width" in value && typeof value.width === "number" && "height" in value && typeof value.height === "number";
|
|
7
|
+
}
|
|
8
|
+
function isPageCaptureResponseMessage(value, requestId) {
|
|
9
|
+
return typeof value === "object" && value !== null && "type" in value && value.type === PAGE_CAPTURE_RESPONSE && "requestId" in value && value.requestId === requestId;
|
|
10
|
+
}
|
|
11
|
+
var PageCaptureError = class extends Error {
|
|
12
|
+
};
|
|
13
|
+
function requestPageCapture({
|
|
14
|
+
frame,
|
|
15
|
+
targetOrigin,
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
timeoutMs = 15e3
|
|
19
|
+
}) {
|
|
20
|
+
const requestId = randomUUID();
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const onMessage = (event) => {
|
|
23
|
+
if (event.source !== frame || !isPageCaptureResponseMessage(event.data, requestId)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
cleanup();
|
|
27
|
+
if (event.data.jpeg) {
|
|
28
|
+
resolve({ jpeg: event.data.jpeg, ms: event.data.ms });
|
|
29
|
+
} else {
|
|
30
|
+
reject(new PageCaptureError(event.data.error));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const timeout = setTimeout(() => {
|
|
34
|
+
cleanup();
|
|
35
|
+
reject(new PageCaptureError("capture timed out"));
|
|
36
|
+
}, timeoutMs);
|
|
37
|
+
const cleanup = () => {
|
|
38
|
+
clearTimeout(timeout);
|
|
39
|
+
window.removeEventListener("message", onMessage);
|
|
40
|
+
};
|
|
41
|
+
window.addEventListener("message", onMessage);
|
|
42
|
+
const request = {
|
|
43
|
+
type: PAGE_CAPTURE_REQUEST,
|
|
44
|
+
requestId,
|
|
45
|
+
width,
|
|
46
|
+
height
|
|
47
|
+
};
|
|
48
|
+
frame.postMessage(request, targetOrigin);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { PAGE_CAPTURE_REQUEST, PAGE_CAPTURE_RESPONSE, PageCaptureError, isPageCaptureRequestMessage, requestPageCapture };
|
|
@@ -59,6 +59,7 @@ export type ReploAuthenticationErrorConfig = {
|
|
|
59
59
|
type: AuthErrorType;
|
|
60
60
|
userFacingDetails?: ErrorUserFacingDetailsWithMessage;
|
|
61
61
|
additionalData?: ReploErrorConfig["additionalData"];
|
|
62
|
+
cause?: ReploErrorConfig["cause"];
|
|
62
63
|
};
|
|
63
64
|
export declare class ReploAuthenticationError extends ReploError {
|
|
64
65
|
type: AuthErrorType;
|
|
@@ -53,6 +53,27 @@ export type SelectModeDefinedStyle = {
|
|
|
53
53
|
raw: string;
|
|
54
54
|
resolved: string;
|
|
55
55
|
};
|
|
56
|
+
export type SelectModeImageScope = {
|
|
57
|
+
kind: "all";
|
|
58
|
+
} | {
|
|
59
|
+
kind: "media";
|
|
60
|
+
media: string;
|
|
61
|
+
};
|
|
62
|
+
export type SelectModeImageSource = {
|
|
63
|
+
srcSet: string;
|
|
64
|
+
sizes: string;
|
|
65
|
+
media: string;
|
|
66
|
+
type: string;
|
|
67
|
+
previewUrl: string | null;
|
|
68
|
+
};
|
|
69
|
+
export type SelectModeImage = {
|
|
70
|
+
src: string;
|
|
71
|
+
currentSrc: string;
|
|
72
|
+
srcSet: string;
|
|
73
|
+
sizes: string;
|
|
74
|
+
previewUrl: string | null;
|
|
75
|
+
sources: SelectModeImageSource[];
|
|
76
|
+
};
|
|
56
77
|
export type SelectedElement = {
|
|
57
78
|
kind: "react-element";
|
|
58
79
|
selector: string;
|
|
@@ -62,6 +83,7 @@ export type SelectedElement = {
|
|
|
62
83
|
rect: SelectModeBoundingRect;
|
|
63
84
|
textMetrics: SelectModeTextMetrics | null;
|
|
64
85
|
outerHTML: string;
|
|
86
|
+
image?: SelectModeImage;
|
|
65
87
|
definedStyles: SelectModeDefinedStyle[];
|
|
66
88
|
inheritedStyles: {
|
|
67
89
|
[x: string]: string;
|
|
@@ -85,6 +107,9 @@ export type SelectablePlanPayload = {
|
|
|
85
107
|
export type SelectableDataPayload = SelectablePlanPayload;
|
|
86
108
|
export type SelectableData = SelectedElement | SelectablePlanData;
|
|
87
109
|
export type SelectModeOptimisticUpdatePayload = {
|
|
110
|
+
kind: "image";
|
|
111
|
+
image: SelectModeImage;
|
|
112
|
+
} | {
|
|
88
113
|
kind: "css";
|
|
89
114
|
fontSource?: "google" | "site";
|
|
90
115
|
property: string;
|
|
@@ -98,6 +98,33 @@ export declare function transformPoint({ point, offset, scale, }: {
|
|
|
98
98
|
scale?: number;
|
|
99
99
|
}): SelectModeClickPosition;
|
|
100
100
|
export declare function getIframeOffset(iframe: HTMLIFrameElement | null): RectOffset;
|
|
101
|
+
export declare const selectModeImageScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
102
|
+
kind: z.ZodLiteral<"all">;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"media">;
|
|
105
|
+
media: z.ZodString;
|
|
106
|
+
}, z.core.$strip>], "kind">;
|
|
107
|
+
export declare const selectModeImageSourceSchema: z.ZodObject<{
|
|
108
|
+
srcSet: z.ZodString;
|
|
109
|
+
sizes: z.ZodString;
|
|
110
|
+
media: z.ZodString;
|
|
111
|
+
type: z.ZodString;
|
|
112
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
export declare const selectModeImageSchema: z.ZodObject<{
|
|
115
|
+
src: z.ZodString;
|
|
116
|
+
currentSrc: z.ZodString;
|
|
117
|
+
srcSet: z.ZodString;
|
|
118
|
+
sizes: z.ZodString;
|
|
119
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
120
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
121
|
+
srcSet: z.ZodString;
|
|
122
|
+
sizes: z.ZodString;
|
|
123
|
+
media: z.ZodString;
|
|
124
|
+
type: z.ZodString;
|
|
125
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
101
128
|
export declare const selectedElementSchema: z.ZodObject<{
|
|
102
129
|
kind: z.ZodLiteral<"react-element">;
|
|
103
130
|
selector: z.ZodString;
|
|
@@ -120,6 +147,20 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
120
147
|
lineHeight: z.ZodNumber;
|
|
121
148
|
}, z.core.$strip>>;
|
|
122
149
|
outerHTML: z.ZodString;
|
|
150
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
src: z.ZodString;
|
|
152
|
+
currentSrc: z.ZodString;
|
|
153
|
+
srcSet: z.ZodString;
|
|
154
|
+
sizes: z.ZodString;
|
|
155
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
156
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
157
|
+
srcSet: z.ZodString;
|
|
158
|
+
sizes: z.ZodString;
|
|
159
|
+
media: z.ZodString;
|
|
160
|
+
type: z.ZodString;
|
|
161
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
123
164
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
124
165
|
property: z.ZodString;
|
|
125
166
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -204,6 +245,20 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
204
245
|
lineHeight: z.ZodNumber;
|
|
205
246
|
}, z.core.$strip>>;
|
|
206
247
|
outerHTML: z.ZodString;
|
|
248
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
249
|
+
src: z.ZodString;
|
|
250
|
+
currentSrc: z.ZodString;
|
|
251
|
+
srcSet: z.ZodString;
|
|
252
|
+
sizes: z.ZodString;
|
|
253
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
254
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
255
|
+
srcSet: z.ZodString;
|
|
256
|
+
sizes: z.ZodString;
|
|
257
|
+
media: z.ZodString;
|
|
258
|
+
type: z.ZodString;
|
|
259
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
207
262
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
208
263
|
property: z.ZodString;
|
|
209
264
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -274,6 +329,22 @@ export declare function readSelectablePayload(rawPayload: string | null): {
|
|
|
274
329
|
planId: string;
|
|
275
330
|
} | null;
|
|
276
331
|
export declare const selectModeOptimisticUpdatePayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
332
|
+
kind: z.ZodLiteral<"image">;
|
|
333
|
+
image: z.ZodObject<{
|
|
334
|
+
src: z.ZodString;
|
|
335
|
+
currentSrc: z.ZodString;
|
|
336
|
+
srcSet: z.ZodString;
|
|
337
|
+
sizes: z.ZodString;
|
|
338
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
339
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
340
|
+
srcSet: z.ZodString;
|
|
341
|
+
sizes: z.ZodString;
|
|
342
|
+
media: z.ZodString;
|
|
343
|
+
type: z.ZodString;
|
|
344
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
345
|
+
}, z.core.$strip>>;
|
|
346
|
+
}, z.core.$strip>;
|
|
347
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
277
348
|
kind: z.ZodLiteral<"css">;
|
|
278
349
|
fontSource: z.ZodOptional<z.ZodEnum<{
|
|
279
350
|
google: "google";
|
|
@@ -318,9 +389,9 @@ export declare const selectModeFormatCommandSchema: z.ZodEnum<{
|
|
|
318
389
|
* Renaming or adding a variant here is a TS error in all three.
|
|
319
390
|
*/
|
|
320
391
|
export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
|
|
321
|
-
element: "element";
|
|
322
|
-
area: "area";
|
|
323
392
|
drag: "drag";
|
|
393
|
+
area: "area";
|
|
394
|
+
element: "element";
|
|
324
395
|
none: "none";
|
|
325
396
|
}>;
|
|
326
397
|
/**
|
|
@@ -366,6 +437,20 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
366
437
|
lineHeight: z.ZodNumber;
|
|
367
438
|
}, z.core.$strip>>;
|
|
368
439
|
outerHTML: z.ZodString;
|
|
440
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
src: z.ZodString;
|
|
442
|
+
currentSrc: z.ZodString;
|
|
443
|
+
srcSet: z.ZodString;
|
|
444
|
+
sizes: z.ZodString;
|
|
445
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
446
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
447
|
+
srcSet: z.ZodString;
|
|
448
|
+
sizes: z.ZodString;
|
|
449
|
+
media: z.ZodString;
|
|
450
|
+
type: z.ZodString;
|
|
451
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
452
|
+
}, z.core.$strip>>;
|
|
453
|
+
}, z.core.$strip>>;
|
|
369
454
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
370
455
|
property: z.ZodString;
|
|
371
456
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -451,6 +536,20 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
451
536
|
lineHeight: z.ZodNumber;
|
|
452
537
|
}, z.core.$strip>>;
|
|
453
538
|
outerHTML: z.ZodString;
|
|
539
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
540
|
+
src: z.ZodString;
|
|
541
|
+
currentSrc: z.ZodString;
|
|
542
|
+
srcSet: z.ZodString;
|
|
543
|
+
sizes: z.ZodString;
|
|
544
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
545
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
546
|
+
srcSet: z.ZodString;
|
|
547
|
+
sizes: z.ZodString;
|
|
548
|
+
media: z.ZodString;
|
|
549
|
+
type: z.ZodString;
|
|
550
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
}, z.core.$strip>>;
|
|
454
553
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
455
554
|
property: z.ZodString;
|
|
456
555
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-
|
|
1
|
+
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeImageSchema, selectModeImageScopeSchema, selectModeImageSourceSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-XWNBKE63.mjs';
|
|
2
2
|
import '../../chunk-JUKCUPQ6.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
@@ -72,6 +72,20 @@ export declare const selectModeEventInputSchemas: {
|
|
|
72
72
|
lineHeight: z.ZodNumber;
|
|
73
73
|
}, z.core.$strip>>;
|
|
74
74
|
outerHTML: z.ZodString;
|
|
75
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
src: z.ZodString;
|
|
77
|
+
currentSrc: z.ZodString;
|
|
78
|
+
srcSet: z.ZodString;
|
|
79
|
+
sizes: z.ZodString;
|
|
80
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
81
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
82
|
+
srcSet: z.ZodString;
|
|
83
|
+
sizes: z.ZodString;
|
|
84
|
+
media: z.ZodString;
|
|
85
|
+
type: z.ZodString;
|
|
86
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
75
89
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
76
90
|
property: z.ZodString;
|
|
77
91
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -184,6 +198,20 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
184
198
|
lineHeight: z.ZodNumber;
|
|
185
199
|
}, z.core.$strip>>;
|
|
186
200
|
outerHTML: z.ZodString;
|
|
201
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
src: z.ZodString;
|
|
203
|
+
currentSrc: z.ZodString;
|
|
204
|
+
srcSet: z.ZodString;
|
|
205
|
+
sizes: z.ZodString;
|
|
206
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
207
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
208
|
+
srcSet: z.ZodString;
|
|
209
|
+
sizes: z.ZodString;
|
|
210
|
+
media: z.ZodString;
|
|
211
|
+
type: z.ZodString;
|
|
212
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
187
215
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
188
216
|
property: z.ZodString;
|
|
189
217
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -243,6 +271,20 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
243
271
|
lineHeight: z.ZodNumber;
|
|
244
272
|
}, z.core.$strip>>;
|
|
245
273
|
outerHTML: z.ZodString;
|
|
274
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
src: z.ZodString;
|
|
276
|
+
currentSrc: z.ZodString;
|
|
277
|
+
srcSet: z.ZodString;
|
|
278
|
+
sizes: z.ZodString;
|
|
279
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
280
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
281
|
+
srcSet: z.ZodString;
|
|
282
|
+
sizes: z.ZodString;
|
|
283
|
+
media: z.ZodString;
|
|
284
|
+
type: z.ZodString;
|
|
285
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
286
|
+
}, z.core.$strip>>;
|
|
287
|
+
}, z.core.$strip>>;
|
|
246
288
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
247
289
|
property: z.ZodString;
|
|
248
290
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -300,9 +342,9 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
300
342
|
setSelectionType: {
|
|
301
343
|
inputSchema: z.ZodObject<{
|
|
302
344
|
selectionType: z.ZodEnum<{
|
|
303
|
-
element: "element";
|
|
304
|
-
area: "area";
|
|
305
345
|
drag: "drag";
|
|
346
|
+
area: "area";
|
|
347
|
+
element: "element";
|
|
306
348
|
none: "none";
|
|
307
349
|
}>;
|
|
308
350
|
selectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -313,6 +355,22 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
313
355
|
inputSchema: z.ZodObject<{
|
|
314
356
|
editId: z.ZodString;
|
|
315
357
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
358
|
+
kind: z.ZodLiteral<"image">;
|
|
359
|
+
image: z.ZodObject<{
|
|
360
|
+
src: z.ZodString;
|
|
361
|
+
currentSrc: z.ZodString;
|
|
362
|
+
srcSet: z.ZodString;
|
|
363
|
+
sizes: z.ZodString;
|
|
364
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
365
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
366
|
+
srcSet: z.ZodString;
|
|
367
|
+
sizes: z.ZodString;
|
|
368
|
+
media: z.ZodString;
|
|
369
|
+
type: z.ZodString;
|
|
370
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
371
|
+
}, z.core.$strip>>;
|
|
372
|
+
}, z.core.$strip>;
|
|
373
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
374
|
kind: z.ZodLiteral<"css">;
|
|
317
375
|
fontSource: z.ZodOptional<z.ZodEnum<{
|
|
318
376
|
google: "google";
|
|
@@ -405,6 +463,20 @@ export declare const previewIframeToWebsiteBuilderMethodConfig: {
|
|
|
405
463
|
lineHeight: z.ZodNumber;
|
|
406
464
|
}, z.core.$strip>>;
|
|
407
465
|
outerHTML: z.ZodString;
|
|
466
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
467
|
+
src: z.ZodString;
|
|
468
|
+
currentSrc: z.ZodString;
|
|
469
|
+
srcSet: z.ZodString;
|
|
470
|
+
sizes: z.ZodString;
|
|
471
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
472
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
473
|
+
srcSet: z.ZodString;
|
|
474
|
+
sizes: z.ZodString;
|
|
475
|
+
media: z.ZodString;
|
|
476
|
+
type: z.ZodString;
|
|
477
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
478
|
+
}, z.core.$strip>>;
|
|
479
|
+
}, z.core.$strip>>;
|
|
408
480
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
409
481
|
property: z.ZodString;
|
|
410
482
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -482,6 +554,20 @@ export declare const previewIframeToWebsiteBuilderMethodConfig: {
|
|
|
482
554
|
lineHeight: z.ZodNumber;
|
|
483
555
|
}, z.core.$strip>>;
|
|
484
556
|
outerHTML: z.ZodString;
|
|
557
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
558
|
+
src: z.ZodString;
|
|
559
|
+
currentSrc: z.ZodString;
|
|
560
|
+
srcSet: z.ZodString;
|
|
561
|
+
sizes: z.ZodString;
|
|
562
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
563
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
564
|
+
srcSet: z.ZodString;
|
|
565
|
+
sizes: z.ZodString;
|
|
566
|
+
media: z.ZodString;
|
|
567
|
+
type: z.ZodString;
|
|
568
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
569
|
+
}, z.core.$strip>>;
|
|
570
|
+
}, z.core.$strip>>;
|
|
485
571
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
486
572
|
property: z.ZodString;
|
|
487
573
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -647,6 +733,20 @@ export declare const previewIframeToWebsiteBuilderMethodConfig: {
|
|
|
647
733
|
lineHeight: z.ZodNumber;
|
|
648
734
|
}, z.core.$strip>>;
|
|
649
735
|
outerHTML: z.ZodString;
|
|
736
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
src: z.ZodString;
|
|
738
|
+
currentSrc: z.ZodString;
|
|
739
|
+
srcSet: z.ZodString;
|
|
740
|
+
sizes: z.ZodString;
|
|
741
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
742
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
743
|
+
srcSet: z.ZodString;
|
|
744
|
+
sizes: z.ZodString;
|
|
745
|
+
media: z.ZodString;
|
|
746
|
+
type: z.ZodString;
|
|
747
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
748
|
+
}, z.core.$strip>>;
|
|
749
|
+
}, z.core.$strip>>;
|
|
650
750
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
651
751
|
property: z.ZodString;
|
|
652
752
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -762,9 +862,9 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
762
862
|
method: z.ZodLiteral<"setSelectionType">;
|
|
763
863
|
data: z.ZodObject<{
|
|
764
864
|
selectionType: z.ZodEnum<{
|
|
765
|
-
element: "element";
|
|
766
|
-
area: "area";
|
|
767
865
|
drag: "drag";
|
|
866
|
+
area: "area";
|
|
867
|
+
element: "element";
|
|
768
868
|
none: "none";
|
|
769
869
|
}>;
|
|
770
870
|
selectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -774,6 +874,22 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
774
874
|
data: z.ZodObject<{
|
|
775
875
|
editId: z.ZodString;
|
|
776
876
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
877
|
+
kind: z.ZodLiteral<"image">;
|
|
878
|
+
image: z.ZodObject<{
|
|
879
|
+
src: z.ZodString;
|
|
880
|
+
currentSrc: z.ZodString;
|
|
881
|
+
srcSet: z.ZodString;
|
|
882
|
+
sizes: z.ZodString;
|
|
883
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
884
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
885
|
+
srcSet: z.ZodString;
|
|
886
|
+
sizes: z.ZodString;
|
|
887
|
+
media: z.ZodString;
|
|
888
|
+
type: z.ZodString;
|
|
889
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
890
|
+
}, z.core.$strip>>;
|
|
891
|
+
}, z.core.$strip>;
|
|
892
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
777
893
|
kind: z.ZodLiteral<"css">;
|
|
778
894
|
fontSource: z.ZodOptional<z.ZodEnum<{
|
|
779
895
|
google: "google";
|
|
@@ -864,6 +980,20 @@ export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
864
980
|
lineHeight: z.ZodNumber;
|
|
865
981
|
}, z.core.$strip>>;
|
|
866
982
|
outerHTML: z.ZodString;
|
|
983
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
984
|
+
src: z.ZodString;
|
|
985
|
+
currentSrc: z.ZodString;
|
|
986
|
+
srcSet: z.ZodString;
|
|
987
|
+
sizes: z.ZodString;
|
|
988
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
989
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
990
|
+
srcSet: z.ZodString;
|
|
991
|
+
sizes: z.ZodString;
|
|
992
|
+
media: z.ZodString;
|
|
993
|
+
type: z.ZodString;
|
|
994
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
995
|
+
}, z.core.$strip>>;
|
|
996
|
+
}, z.core.$strip>>;
|
|
867
997
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
868
998
|
property: z.ZodString;
|
|
869
999
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -1024,6 +1154,20 @@ export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
1024
1154
|
lineHeight: z.ZodNumber;
|
|
1025
1155
|
}, z.core.$strip>>;
|
|
1026
1156
|
outerHTML: z.ZodString;
|
|
1157
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
1158
|
+
src: z.ZodString;
|
|
1159
|
+
currentSrc: z.ZodString;
|
|
1160
|
+
srcSet: z.ZodString;
|
|
1161
|
+
sizes: z.ZodString;
|
|
1162
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
1163
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
1164
|
+
srcSet: z.ZodString;
|
|
1165
|
+
sizes: z.ZodString;
|
|
1166
|
+
media: z.ZodString;
|
|
1167
|
+
type: z.ZodString;
|
|
1168
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
1169
|
+
}, z.core.$strip>>;
|
|
1170
|
+
}, z.core.$strip>>;
|
|
1027
1171
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1028
1172
|
property: z.ZodString;
|
|
1029
1173
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-
|
|
1
|
+
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-XWNBKE63.mjs';
|
|
2
2
|
import '../../chunk-JUKCUPQ6.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SelectModeImage } from "./generated/selectMode";
|
|
2
|
+
export declare function getImageEditSnapshot(image: SelectModeImage | undefined, baseURI?: string): {
|
|
3
|
+
previewUrl: string | null;
|
|
4
|
+
sources: {
|
|
5
|
+
media: string;
|
|
6
|
+
type: string;
|
|
7
|
+
previewUrl: string | null;
|
|
8
|
+
}[];
|
|
9
|
+
} | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function getImageEditSnapshot(image, baseURI) {
|
|
2
|
+
if (!image) return null;
|
|
3
|
+
const baseUrl = baseURI ?? (URL.canParse(image.currentSrc) ? image.currentSrc : "https://replo.invalid");
|
|
4
|
+
const normalizeUrl = (url) => {
|
|
5
|
+
if (!url) return url;
|
|
6
|
+
try {
|
|
7
|
+
const parsed = new URL(url, baseUrl);
|
|
8
|
+
const original = parsed.pathname.endsWith("/_next/image") ? parsed.searchParams.get("url") : null;
|
|
9
|
+
return original ? new URL(original, parsed).href : parsed.href;
|
|
10
|
+
} catch {
|
|
11
|
+
return url;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
previewUrl: normalizeUrl(image.previewUrl),
|
|
16
|
+
sources: image.sources.map(({ media, type, previewUrl }) => ({
|
|
17
|
+
media,
|
|
18
|
+
type,
|
|
19
|
+
previewUrl: normalizeUrl(previewUrl)
|
|
20
|
+
}))
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { getImageEditSnapshot };
|
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.9.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "455eef2903f4cc6a8f457d5ec77be1e1dc95aad9",
|
|
6
|
+
"builtAt": "2026-09-25T00:24:57.880Z"
|
|
7
7
|
};
|
package/capturePage.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function parseYouTubeId(src: string): string | null;
|
|
2
|
+
export declare function parseVimeoId(src: string): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* Draws the page's first screen (from the document top, regardless of scroll)
|
|
5
|
+
* into an exact width×height JPEG. Videos and YouTube/Vimeo embeds, which the
|
|
6
|
+
* page cannot read directly, are swapped for their current frame or thumbnail.
|
|
7
|
+
*/
|
|
8
|
+
export declare function capturePage({ width, height, }: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}): Promise<Blob>;
|