@replohq/sandbox-runtime 1.16.0 → 1.16.2
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/object.d.ts +16 -1
- package/_vendor/replo-utils/lib/viewportSnapshot.d.ts +1 -1
- package/_vendor/replo-utils/lib/viewportSnapshot.mjs +1 -1
- package/_vendor/replo-utils/react/use-viewport-snapshot-responder.mjs +28 -5222
- package/_vendor/schemas/componentPreview.d.ts +1 -1
- package/_vendor/schemas/componentPreview.mjs +18 -18
- package/_vendor/schemas/designLibrary.d.ts +1 -1
- package/_vendor/schemas/designLibrary.mjs +72 -72
- package/_vendor/schemas/errors.d.ts +3 -43
- package/_vendor/schemas/iframeRpcChannel.d.ts +1 -1
- package/_vendor/schemas/iframeRpcChannel.mjs +27 -26
- package/_vendor/schemas/loaderKeys.d.ts +1 -1
- package/_vendor/schemas/pageAnnotations.d.ts +1 -1
- package/_vendor/schemas/pageAnnotations.mjs +1 -1
- package/_vendor/schemas/reploError.d.ts +43 -0
- package/_vendor/schemas/savedStyles.d.ts +1 -1
- package/_vendor/schemas/selectMode.d.ts +1 -1
- package/_vendor/schemas/selectMode.mjs +1 -1
- package/_vendor/schemas/selectModeIframeRpc.d.ts +1 -8
- package/_vendor/schemas/selectModeIframeRpc.mjs +3 -10
- package/buildMetadata.js +3 -3
- package/capturePage.js +1 -1
- package/{chunk-3YA3QXUQ.mjs → chunk-B3PLD7SH.mjs} +29 -18
- package/{chunk-KFJZ2OLV.mjs → chunk-TP4ZXK4R.mjs} +1 -1
- package/package.json +4 -4
- package/rrweb-snapshot-GTQBXO2Y.mjs +5761 -0
- package/select-mode/descriptor/elementDescriptor.js +1 -1
- package/select-mode/fiber.js +1 -1
- package/select-mode/hooks/useOptimisticOverrides.js +1 -1
- package/select-mode/hooks/useParentMessaging.js +1 -1
- package/select-mode/iframeRpcChannel.d.ts +0 -6
- package/select-mode/iframeRpcChannel.js +2 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export declare const MAX_COMPONENT_PREVIEW_PROPS_BYTES: number;
|
|
3
3
|
export declare const componentPreviewPropNameSchema: z.ZodString;
|
|
4
4
|
export declare const componentPreviewPropsSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z2 from 'zod';
|
|
2
2
|
|
|
3
3
|
var DATA_LOADER_KEYS = {
|
|
4
4
|
SHOPIFY_INTEGRATION_DETAILS: "shopify_storefront.integration_details",
|
|
@@ -28,52 +28,52 @@ var DATA_LOADER_KEYS = {
|
|
|
28
28
|
CONTENTFUL_ENTRY: "contentful.entry",
|
|
29
29
|
CONTENTFUL_ENTRIES: "contentful.entries"
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
z2.enum(Object.values(DATA_LOADER_KEYS));
|
|
32
32
|
|
|
33
33
|
var MAX_COMPONENT_PREVIEW_PROPS_BYTES = 16 * 1024;
|
|
34
|
-
var componentPreviewPropNameSchema =
|
|
34
|
+
var componentPreviewPropNameSchema = z2.string().min(1).max(80).regex(/^[A-Za-z_$][\w$]*$/u).refine((name) => {
|
|
35
35
|
return !["__proto__", "constructor", "dangerouslySetInnerHTML"].includes(
|
|
36
36
|
name
|
|
37
37
|
);
|
|
38
38
|
}, "Unsafe prop name");
|
|
39
|
-
var componentPreviewPropsSchema =
|
|
39
|
+
var componentPreviewPropsSchema = z2.record(
|
|
40
40
|
componentPreviewPropNameSchema,
|
|
41
|
-
|
|
41
|
+
z2.json()
|
|
42
42
|
);
|
|
43
43
|
var COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID = "replo:component-preview-iframe-rpc";
|
|
44
44
|
var COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION = 2;
|
|
45
45
|
var COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM = "reploParentOrigin";
|
|
46
46
|
var websiteBuilderToComponentPreviewMethodConfig = {
|
|
47
47
|
setProps: {
|
|
48
|
-
inputSchema:
|
|
48
|
+
inputSchema: z2.object({
|
|
49
49
|
props: componentPreviewPropsSchema,
|
|
50
|
-
sourceRevision:
|
|
50
|
+
sourceRevision: z2.string().min(1)
|
|
51
51
|
}),
|
|
52
|
-
outputSchema:
|
|
53
|
-
mode:
|
|
52
|
+
outputSchema: z2.object({
|
|
53
|
+
mode: z2.enum(["client", "navigation", "unchanged"])
|
|
54
54
|
}),
|
|
55
55
|
timeoutMs: 1e4
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
var componentPreviewToWebsiteBuilderMethodConfig = {
|
|
59
59
|
contentBoundsChanged: {
|
|
60
|
-
inputSchema:
|
|
61
|
-
height:
|
|
60
|
+
inputSchema: z2.object({
|
|
61
|
+
height: z2.number().finite().min(0).max(1e5)
|
|
62
62
|
}),
|
|
63
|
-
outputSchema:
|
|
63
|
+
outputSchema: z2.void()
|
|
64
64
|
},
|
|
65
65
|
iframeReady: {
|
|
66
|
-
inputSchema:
|
|
67
|
-
outputSchema:
|
|
66
|
+
inputSchema: z2.undefined(),
|
|
67
|
+
outputSchema: z2.void()
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
var componentPreviewProductReferenceSchema =
|
|
71
|
-
type:
|
|
72
|
-
loaderKey:
|
|
70
|
+
var componentPreviewProductReferenceSchema = z2.object({
|
|
71
|
+
type: z2.literal("product"),
|
|
72
|
+
loaderKey: z2.enum([
|
|
73
73
|
DATA_LOADER_KEYS.SHOPIFY_PRODUCT,
|
|
74
74
|
DATA_LOADER_KEYS.REPLO_PRODUCT
|
|
75
75
|
]),
|
|
76
|
-
productId:
|
|
76
|
+
productId: z2.string().min(1)
|
|
77
77
|
}).strict().describe("ComponentPreviewProductReference");
|
|
78
78
|
|
|
79
79
|
export { COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID, COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION, COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM, MAX_COMPONENT_PREVIEW_PROPS_BYTES, componentPreviewProductReferenceSchema, componentPreviewPropNameSchema, componentPreviewPropsSchema, componentPreviewToWebsiteBuilderMethodConfig, websiteBuilderToComponentPreviewMethodConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z2 from 'zod';
|
|
2
2
|
|
|
3
|
-
var colorTypeSchema =
|
|
3
|
+
var colorTypeSchema = z2.enum([
|
|
4
4
|
"basic",
|
|
5
5
|
"foregroundPrimary",
|
|
6
6
|
"foregroundSecondary",
|
|
@@ -9,12 +9,12 @@ var colorTypeSchema = z.enum([
|
|
|
9
9
|
"backgroundSecondary",
|
|
10
10
|
"backgroundTertiary"
|
|
11
11
|
]).describe("SavedStyleColorType");
|
|
12
|
-
var savedStyleColorAttributesSchema =
|
|
13
|
-
type:
|
|
14
|
-
color:
|
|
12
|
+
var savedStyleColorAttributesSchema = z2.object({
|
|
13
|
+
type: z2.literal("color"),
|
|
14
|
+
color: z2.string(),
|
|
15
15
|
colorType: colorTypeSchema
|
|
16
16
|
}).describe("SavedStyleColorAttributes");
|
|
17
|
-
var savedStyleTextHtmlTagSchema =
|
|
17
|
+
var savedStyleTextHtmlTagSchema = z2.enum([
|
|
18
18
|
"h1",
|
|
19
19
|
"h2",
|
|
20
20
|
"h3",
|
|
@@ -23,13 +23,13 @@ var savedStyleTextHtmlTagSchema = z.enum([
|
|
|
23
23
|
"h6",
|
|
24
24
|
"p"
|
|
25
25
|
]);
|
|
26
|
-
var savedStyleTextAttributesSchema =
|
|
27
|
-
type:
|
|
26
|
+
var savedStyleTextAttributesSchema = z2.object({
|
|
27
|
+
type: z2.literal("text"),
|
|
28
28
|
htmlTag: savedStyleTextHtmlTagSchema,
|
|
29
|
-
color:
|
|
30
|
-
fontFamily:
|
|
31
|
-
fontSize:
|
|
32
|
-
fontWeight:
|
|
29
|
+
color: z2.string().optional(),
|
|
30
|
+
fontFamily: z2.string().nullish(),
|
|
31
|
+
fontSize: z2.string().optional(),
|
|
32
|
+
fontWeight: z2.enum([
|
|
33
33
|
"100",
|
|
34
34
|
"200",
|
|
35
35
|
"300",
|
|
@@ -41,91 +41,91 @@ var savedStyleTextAttributesSchema = z.object({
|
|
|
41
41
|
"900",
|
|
42
42
|
"950"
|
|
43
43
|
]).optional(),
|
|
44
|
-
letterSpacing:
|
|
45
|
-
lineHeight:
|
|
46
|
-
textAlign:
|
|
47
|
-
textDecoration:
|
|
48
|
-
textShadow:
|
|
49
|
-
textStroke:
|
|
50
|
-
textTransform:
|
|
44
|
+
letterSpacing: z2.string().optional(),
|
|
45
|
+
lineHeight: z2.string().optional(),
|
|
46
|
+
textAlign: z2.enum(["left", "center", "right"]).optional(),
|
|
47
|
+
textDecoration: z2.enum(["underline", "line-through", "italic", "none"]).optional(),
|
|
48
|
+
textShadow: z2.string().optional(),
|
|
49
|
+
textStroke: z2.string().optional(),
|
|
50
|
+
textTransform: z2.enum(["lowercase", "uppercase", "capitalize", "none"]).optional()
|
|
51
51
|
}).describe("SavedStyleTextAttributes");
|
|
52
|
-
|
|
52
|
+
z2.discriminatedUnion("type", [
|
|
53
53
|
savedStyleColorAttributesSchema,
|
|
54
54
|
savedStyleTextAttributesSchema
|
|
55
55
|
]).describe("SavedStyleAttributes");
|
|
56
56
|
|
|
57
|
-
var savedColorStyleSchema =
|
|
58
|
-
type:
|
|
59
|
-
name:
|
|
57
|
+
var savedColorStyleSchema = z2.object({
|
|
58
|
+
type: z2.literal("color"),
|
|
59
|
+
name: z2.string(),
|
|
60
60
|
attributes: savedStyleColorAttributesSchema,
|
|
61
|
-
optionalUsageGuidelines:
|
|
62
|
-
deletedAt:
|
|
63
|
-
isPrimary:
|
|
61
|
+
optionalUsageGuidelines: z2.string().nullish(),
|
|
62
|
+
deletedAt: z2.coerce.date().nullish(),
|
|
63
|
+
isPrimary: z2.boolean().optional()
|
|
64
64
|
}).describe("SavedColorStyle");
|
|
65
|
-
var savedTextStyleSchema =
|
|
66
|
-
type:
|
|
67
|
-
name:
|
|
65
|
+
var savedTextStyleSchema = z2.object({
|
|
66
|
+
type: z2.literal("text"),
|
|
67
|
+
name: z2.string(),
|
|
68
68
|
attributes: savedStyleTextAttributesSchema,
|
|
69
|
-
optionalUsageGuidelines:
|
|
70
|
-
deletedAt:
|
|
71
|
-
isPrimary:
|
|
69
|
+
optionalUsageGuidelines: z2.string().nullish(),
|
|
70
|
+
deletedAt: z2.coerce.date().nullish(),
|
|
71
|
+
isPrimary: z2.boolean().optional()
|
|
72
72
|
}).describe("SavedTextStyle");
|
|
73
|
-
var designLibrarySavedStylesSchema =
|
|
74
|
-
var designLibrarySchema =
|
|
75
|
-
id:
|
|
76
|
-
createdAt:
|
|
77
|
-
updatedAt:
|
|
78
|
-
deletedAt:
|
|
73
|
+
var designLibrarySavedStylesSchema = z2.record(z2.string(), z2.union([savedColorStyleSchema, savedTextStyleSchema])).describe("DesignLibrarySavedStylesMapping");
|
|
74
|
+
var designLibrarySchema = z2.object({
|
|
75
|
+
id: z2.uuid(),
|
|
76
|
+
createdAt: z2.date(),
|
|
77
|
+
updatedAt: z2.date(),
|
|
78
|
+
deletedAt: z2.coerce.date().nullish(),
|
|
79
79
|
savedStyles: designLibrarySavedStylesSchema
|
|
80
80
|
}).describe("DesignLibrary");
|
|
81
|
-
var designLibrarySavedStyleMetadataSchema =
|
|
82
|
-
library:
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
var designLibrarySavedStyleMetadataSchema = z2.object({
|
|
82
|
+
library: z2.record(
|
|
83
|
+
z2.string(),
|
|
84
|
+
z2.object({
|
|
85
85
|
styles: designLibrarySavedStylesSchema
|
|
86
86
|
})
|
|
87
87
|
)
|
|
88
88
|
}).describe("DesignLibrarySavedStyleMetadata");
|
|
89
|
-
var globalsCssTokenSchema =
|
|
90
|
-
name:
|
|
91
|
-
value:
|
|
89
|
+
var globalsCssTokenSchema = z2.object({
|
|
90
|
+
name: z2.string(),
|
|
91
|
+
value: z2.string()
|
|
92
92
|
}).describe("GlobalsCssToken");
|
|
93
|
-
var globalsCssScopeSchema =
|
|
94
|
-
selector:
|
|
95
|
-
tokens:
|
|
93
|
+
var globalsCssScopeSchema = z2.object({
|
|
94
|
+
selector: z2.string(),
|
|
95
|
+
tokens: z2.array(globalsCssTokenSchema)
|
|
96
96
|
}).describe("GlobalsCssScope");
|
|
97
|
-
var globalsCssSnapshotSchema =
|
|
98
|
-
scopes:
|
|
97
|
+
var globalsCssSnapshotSchema = z2.object({
|
|
98
|
+
scopes: z2.array(globalsCssScopeSchema)
|
|
99
99
|
}).describe("GlobalsCssSnapshot");
|
|
100
|
-
var siteFontRoleSchema =
|
|
101
|
-
role:
|
|
102
|
-
family:
|
|
103
|
-
cssVar:
|
|
104
|
-
rawValue:
|
|
100
|
+
var siteFontRoleSchema = z2.object({
|
|
101
|
+
role: z2.string(),
|
|
102
|
+
family: z2.string().nullable(),
|
|
103
|
+
cssVar: z2.string().nullable(),
|
|
104
|
+
rawValue: z2.string()
|
|
105
105
|
}).describe("SiteFontRole");
|
|
106
|
-
var siteFontsSnapshotSchema =
|
|
107
|
-
roles:
|
|
108
|
-
defaultRole:
|
|
106
|
+
var siteFontsSnapshotSchema = z2.object({
|
|
107
|
+
roles: z2.array(siteFontRoleSchema),
|
|
108
|
+
defaultRole: z2.string().nullable()
|
|
109
109
|
}).describe("SiteFontsSnapshot");
|
|
110
|
-
var siteDesignLibraryStateSchema =
|
|
111
|
-
siteId:
|
|
110
|
+
var siteDesignLibraryStateSchema = z2.object({
|
|
111
|
+
siteId: z2.uuid(),
|
|
112
112
|
globalsCss: globalsCssSnapshotSchema.nullable(),
|
|
113
113
|
fonts: siteFontsSnapshotSchema.nullable(),
|
|
114
|
-
isLoading:
|
|
115
|
-
error:
|
|
114
|
+
isLoading: z2.boolean(),
|
|
115
|
+
error: z2.string().nullable()
|
|
116
116
|
}).describe("SiteDesignLibraryState");
|
|
117
117
|
var DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE = "replo:design-library:applyOverrides";
|
|
118
|
-
var designLibraryPreviewFontSchema =
|
|
119
|
-
family:
|
|
120
|
-
cssVar:
|
|
121
|
-
faceUrl:
|
|
122
|
-
format:
|
|
118
|
+
var designLibraryPreviewFontSchema = z2.object({
|
|
119
|
+
family: z2.string(),
|
|
120
|
+
cssVar: z2.string(),
|
|
121
|
+
faceUrl: z2.string().optional(),
|
|
122
|
+
format: z2.string().optional()
|
|
123
123
|
}).describe("DesignLibraryPreviewFont");
|
|
124
|
-
var designLibraryPreviewMessageSchema =
|
|
125
|
-
type:
|
|
126
|
-
cssVars:
|
|
127
|
-
fonts:
|
|
128
|
-
defaultFontCssVar:
|
|
124
|
+
var designLibraryPreviewMessageSchema = z2.object({
|
|
125
|
+
type: z2.literal(DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE),
|
|
126
|
+
cssVars: z2.record(z2.string(), z2.string()),
|
|
127
|
+
fonts: z2.array(designLibraryPreviewFontSchema),
|
|
128
|
+
defaultFontCssVar: z2.string().nullable()
|
|
129
129
|
}).describe("DesignLibraryPreviewMessage");
|
|
130
130
|
|
|
131
131
|
export { DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE, designLibraryPreviewFontSchema, designLibraryPreviewMessageSchema, designLibrarySavedStyleMetadataSchema, designLibrarySavedStylesSchema, designLibrarySchema, globalsCssScopeSchema, globalsCssSnapshotSchema, globalsCssTokenSchema, savedColorStyleSchema, savedTextStyleSchema, siteDesignLibraryStateSchema, siteFontRoleSchema, siteFontsSnapshotSchema };
|
|
@@ -1,48 +1,8 @@
|
|
|
1
1
|
import type { ErrorUserFacingDetails, ErrorUserFacingDetailsWithMessage } from "./generated/errors";
|
|
2
|
+
import type { ReploErrorConfig } from "./reploError";
|
|
2
3
|
import * as z from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
export type ReploErrorConfig = {
|
|
7
|
-
/**
|
|
8
|
-
* Message of the error, used only internally. If not provided, defaults to
|
|
9
|
-
* the error's class name
|
|
10
|
-
*/
|
|
11
|
-
message?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Any additional data about the error, e.g. ids of content that was trying
|
|
14
|
-
* to be accessed, contextual variables, etc. This is included when the error
|
|
15
|
-
* is logged to Sentry, etc
|
|
16
|
-
*/
|
|
17
|
-
additionalData?: Record<string, unknown>;
|
|
18
|
-
/** Meta details for error reporting */
|
|
19
|
-
errorReportingDetails?: {
|
|
20
|
-
/**
|
|
21
|
-
* If true, tells Sentry that it should group this error differently when
|
|
22
|
-
* it happens on different endpoints ("transactions" in Sentry are endpoints)
|
|
23
|
-
*/
|
|
24
|
-
includeTransactionInFingerprint?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* If provided, these get added to the Sentry fingerprint for this error. Useful
|
|
27
|
-
* for when you want to modify the grouping of an error, especially for reusing
|
|
28
|
-
* errors in different places.
|
|
29
|
-
*/
|
|
30
|
-
customFingerprint?: string[];
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Original cause of the error (useful for if you need to catch and re-throw errors
|
|
34
|
-
* with more context). Will be reported in stacktraces, sentry, etc.
|
|
35
|
-
*/
|
|
36
|
-
cause?: unknown;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Base error that all errors in Replo inherit from
|
|
40
|
-
*/
|
|
41
|
-
export declare abstract class ReploError extends Error {
|
|
42
|
-
config: ReploErrorConfig;
|
|
43
|
-
id: string;
|
|
44
|
-
constructor(config: ReploErrorConfig);
|
|
45
|
-
}
|
|
4
|
+
import { ReploError } from "./reploError";
|
|
5
|
+
export { ReploError, type ReploErrorConfig } from "./reploError";
|
|
46
6
|
/**
|
|
47
7
|
* Wraps an error so `async-retry` stops immediately instead of scheduling
|
|
48
8
|
* another attempt: the library rejects with any thrown error carrying a truthy
|
|
@@ -4,13 +4,13 @@ import '../../chunk-FLYEIRFK.mjs';
|
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
5
5
|
import '../../chunk-G3S6ZNPF.mjs';
|
|
6
6
|
import * as z from 'zod';
|
|
7
|
-
import { z as z$1 } from 'zod';
|
|
8
7
|
|
|
9
8
|
var defaultLogger = {
|
|
10
9
|
info: console.log,
|
|
11
10
|
debug: console.debug,
|
|
12
11
|
error: console.error
|
|
13
12
|
};
|
|
13
|
+
|
|
14
14
|
var ReploError = class _ReploError extends Error {
|
|
15
15
|
config;
|
|
16
16
|
id;
|
|
@@ -31,6 +31,7 @@ var ReploError = class _ReploError extends Error {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
|
|
34
35
|
var errorUserFacingDetailsMessageSchema = z.object({
|
|
35
36
|
type: z.enum([
|
|
36
37
|
"toast",
|
|
@@ -167,39 +168,39 @@ var IframeRpcChannelInvalidInputError = class extends IframeRpcChannelError {
|
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
170
|
|
|
170
|
-
var iframeRpcCallResultSchema = z
|
|
171
|
-
z
|
|
172
|
-
type: z
|
|
173
|
-
data: z
|
|
171
|
+
var iframeRpcCallResultSchema = z.discriminatedUnion("type", [
|
|
172
|
+
z.object({
|
|
173
|
+
type: z.literal("success"),
|
|
174
|
+
data: z.unknown()
|
|
174
175
|
}),
|
|
175
|
-
z
|
|
176
|
-
type: z
|
|
177
|
-
errorMessage: z
|
|
176
|
+
z.object({
|
|
177
|
+
type: z.literal("error"),
|
|
178
|
+
errorMessage: z.string()
|
|
178
179
|
})
|
|
179
180
|
]);
|
|
180
|
-
var iframeRpcCallSchema = z
|
|
181
|
-
z
|
|
182
|
-
type: z
|
|
183
|
-
method: z
|
|
184
|
-
data: z
|
|
181
|
+
var iframeRpcCallSchema = z.discriminatedUnion("type", [
|
|
182
|
+
z.object({
|
|
183
|
+
type: z.literal("notify"),
|
|
184
|
+
method: z.string(),
|
|
185
|
+
data: z.unknown().optional()
|
|
185
186
|
}),
|
|
186
|
-
z
|
|
187
|
-
type: z
|
|
188
|
-
id: z
|
|
189
|
-
method: z
|
|
190
|
-
data: z
|
|
187
|
+
z.object({
|
|
188
|
+
type: z.literal("request"),
|
|
189
|
+
id: z.uuid(),
|
|
190
|
+
method: z.string(),
|
|
191
|
+
data: z.unknown().optional()
|
|
191
192
|
}),
|
|
192
|
-
z
|
|
193
|
-
type: z
|
|
194
|
-
id: z
|
|
193
|
+
z.object({
|
|
194
|
+
type: z.literal("response"),
|
|
195
|
+
id: z.uuid(),
|
|
195
196
|
result: iframeRpcCallResultSchema
|
|
196
197
|
})
|
|
197
198
|
]);
|
|
198
199
|
function isFireAndForgetOutputSchema(outputSchema) {
|
|
199
|
-
return outputSchema.type === "void" || outputSchema instanceof z
|
|
200
|
+
return outputSchema.type === "void" || outputSchema instanceof z.ZodVoid;
|
|
200
201
|
}
|
|
201
202
|
function isUndefinedInputSchema(inputSchema) {
|
|
202
|
-
return inputSchema.type === "undefined" || inputSchema instanceof z
|
|
203
|
+
return inputSchema.type === "undefined" || inputSchema instanceof z.ZodUndefined;
|
|
203
204
|
}
|
|
204
205
|
function coerceEmptyRpcInput({
|
|
205
206
|
input,
|
|
@@ -380,9 +381,9 @@ function createIframeRpcChannel(options) {
|
|
|
380
381
|
pendingRequest.resolve(parsedOutput.data);
|
|
381
382
|
};
|
|
382
383
|
const handleMessage = (event) => {
|
|
383
|
-
const parsedMetadata = z
|
|
384
|
-
channelIdentifier: z
|
|
385
|
-
version: z
|
|
384
|
+
const parsedMetadata = z.object({
|
|
385
|
+
channelIdentifier: z.literal(channelIdentifier),
|
|
386
|
+
version: z.literal(version)
|
|
386
387
|
}).safeParse(event.data);
|
|
387
388
|
if (!parsedMetadata.success) {
|
|
388
389
|
return;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config to use for any standard error we throw in Replo
|
|
3
|
+
*/
|
|
4
|
+
export type ReploErrorConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Message of the error, used only internally. If not provided, defaults to
|
|
7
|
+
* the error's class name
|
|
8
|
+
*/
|
|
9
|
+
message?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Any additional data about the error, e.g. ids of content that was trying
|
|
12
|
+
* to be accessed, contextual variables, etc. This is included when the error
|
|
13
|
+
* is logged to Sentry, etc
|
|
14
|
+
*/
|
|
15
|
+
additionalData?: Record<string, unknown>;
|
|
16
|
+
/** Meta details for error reporting */
|
|
17
|
+
errorReportingDetails?: {
|
|
18
|
+
/**
|
|
19
|
+
* If true, tells Sentry that it should group this error differently when
|
|
20
|
+
* it happens on different endpoints ("transactions" in Sentry are endpoints)
|
|
21
|
+
*/
|
|
22
|
+
includeTransactionInFingerprint?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If provided, these get added to the Sentry fingerprint for this error. Useful
|
|
25
|
+
* for when you want to modify the grouping of an error, especially for reusing
|
|
26
|
+
* errors in different places.
|
|
27
|
+
*/
|
|
28
|
+
customFingerprint?: string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Original cause of the error (useful for if you need to catch and re-throw errors
|
|
32
|
+
* with more context). Will be reported in stacktraces, sentry, etc.
|
|
33
|
+
*/
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Base error that all errors in Replo inherit from
|
|
38
|
+
*/
|
|
39
|
+
export declare abstract class ReploError extends Error {
|
|
40
|
+
config: ReploErrorConfig;
|
|
41
|
+
id: string;
|
|
42
|
+
constructor(config: ReploErrorConfig);
|
|
43
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export declare const SELECT_MODE_SELECTABLE_ATTRIBUTE = "data-replo-selectable";
|
|
3
3
|
export declare const SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE = "data-replo-selectable-payload";
|
|
4
4
|
export declare const displayModeSchema: z.ZodEnum<{
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-TP4ZXK4R.mjs';
|
|
2
2
|
import '../../chunk-PH3S6LJI.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SelectModeIframeMessage, SelectModeParentMessage } from "./generated/selectModeIframeRpc";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
export declare const SELECT_MODE_IFRAME_RPC_CHANNEL_ID: "replo:select-mode-iframe-rpc";
|
|
4
4
|
export declare const SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION: 1;
|
|
5
5
|
export declare const inlineEditFeedbackSchema: z.ZodObject<{
|
|
@@ -367,7 +367,6 @@ export declare const websiteBuilderToPreviewIframeMethodConfig: {
|
|
|
367
367
|
navigateToRoute: {
|
|
368
368
|
inputSchema: z.ZodObject<{
|
|
369
369
|
pathname: z.ZodString;
|
|
370
|
-
navigationId: z.ZodOptional<z.ZodNumber>;
|
|
371
370
|
}, z.core.$strip>;
|
|
372
371
|
outputSchema: z.ZodVoid;
|
|
373
372
|
};
|
|
@@ -918,12 +917,6 @@ export declare const previewIframeToWebsiteBuilderMethodConfig: {
|
|
|
918
917
|
inputSchema: z.ZodUndefined;
|
|
919
918
|
outputSchema: z.ZodVoid;
|
|
920
919
|
};
|
|
921
|
-
navigationAccepted: {
|
|
922
|
-
inputSchema: z.ZodObject<{
|
|
923
|
-
navigationId: z.ZodNumber;
|
|
924
|
-
}, z.core.$strip>;
|
|
925
|
-
outputSchema: z.ZodVoid;
|
|
926
|
-
};
|
|
927
920
|
};
|
|
928
921
|
export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
929
922
|
method: z.ZodLiteral<"expandToSection">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeHoverRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-
|
|
1
|
+
import { selectModeBoundingRectSchema, selectModeTiptapActiveMarksSchema, selectModeSelectionRectSchema, selectableDataSchema, selectModeHoverRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-TP4ZXK4R.mjs';
|
|
2
2
|
import '../../chunk-PH3S6LJI.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
5
5
|
import '../../chunk-G3S6ZNPF.mjs';
|
|
6
|
-
import
|
|
6
|
+
import * as z from 'zod';
|
|
7
7
|
|
|
8
8
|
var SELECT_MODE_IFRAME_RPC_CHANNEL_ID = "replo:select-mode-iframe-rpc";
|
|
9
9
|
var SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION = 1;
|
|
@@ -51,10 +51,7 @@ var websiteBuilderToPreviewIframeMethodConfig = {
|
|
|
51
51
|
timeoutMs: 1500
|
|
52
52
|
},
|
|
53
53
|
navigateToRoute: {
|
|
54
|
-
inputSchema: z.object({
|
|
55
|
-
pathname: z.string(),
|
|
56
|
-
navigationId: z.number().int().optional()
|
|
57
|
-
}),
|
|
54
|
+
inputSchema: z.object({ pathname: z.string() }),
|
|
58
55
|
outputSchema: z.void()
|
|
59
56
|
},
|
|
60
57
|
setDisplayMode: {
|
|
@@ -176,10 +173,6 @@ var previewIframeToWebsiteBuilderMethodConfig = {
|
|
|
176
173
|
fastRefreshComplete: {
|
|
177
174
|
inputSchema: z.undefined(),
|
|
178
175
|
outputSchema: z.void()
|
|
179
|
-
},
|
|
180
|
-
navigationAccepted: {
|
|
181
|
-
inputSchema: z.object({ navigationId: z.number().int() }),
|
|
182
|
-
outputSchema: z.void()
|
|
183
176
|
}
|
|
184
177
|
};
|
|
185
178
|
var selectModeParentMessageSchema = z.discriminatedUnion("method", [
|
package/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "9158b1e6452ebc5e1945da883b1c8406c7b17f08",
|
|
6
|
+
"builtAt": "2026-10-19T23:23:08.010Z"
|
|
7
7
|
};
|
package/capturePage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { snapdom } from "@zumer/snapdom";
|
|
2
2
|
import { PageCaptureError } from "./_vendor/replo-utils/lib/pageCapture.mjs";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
const JPEG_QUALITY = 0.8;
|
|
5
5
|
const VIDEO_FRAME_QUALITY = 0.85;
|
|
6
6
|
const VIDEO_LOAD_TIMEOUT_MS = 4e3;
|