@replohq/sandbox-runtime 1.7.2 → 1.7.3
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/README.md +48 -0
- package/_vendor/replo-utils/lib/crypto.d.ts +2 -8
- package/_vendor/replo-utils/lib/fonts.d.ts +8 -0
- package/_vendor/replo-utils/lib/fonts.mjs +12 -1
- package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +1 -1
- package/_vendor/schemas/selectModeIframeRpc.d.ts +4 -4
- package/_vendor/schemas/selectModeIframeRpc.mjs +2 -2
- package/buildMetadata.js +3 -3
- package/package.json +4 -4
- package/select-mode/iframeRpcChannel.d.ts +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# `@replohq/sandbox-runtime`
|
|
2
|
+
|
|
3
|
+
The Replo sandbox runtime connects a Next.js development preview to Replo while
|
|
4
|
+
preserving normal application behavior in production. It provides preview
|
|
5
|
+
readiness, navigation, error reporting, selection, annotations, and design
|
|
6
|
+
library preview support through one root component.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm add @replohq/sandbox-runtime @replohq/sdk @opennextjs/cloudflare @tanstack/react-query
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package requires Next.js 15 or newer and React 19 or newer. React, React
|
|
15
|
+
DOM, and their type packages are peer dependencies and are normally already
|
|
16
|
+
present in a Next.js application.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Compose `SandboxRuntime` inside the SDK's `ReploProvider` in the root layout:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
// app/layout.tsx
|
|
24
|
+
import { SandboxRuntime } from "@replohq/sandbox-runtime";
|
|
25
|
+
import { ReploProvider } from "@replohq/sdk/providers/replo-provider";
|
|
26
|
+
|
|
27
|
+
export default function RootLayout({ children }: React.PropsWithChildren) {
|
|
28
|
+
return (
|
|
29
|
+
<html lang="en">
|
|
30
|
+
<body>
|
|
31
|
+
<ReploProvider>
|
|
32
|
+
<SandboxRuntime>{children}</SandboxRuntime>
|
|
33
|
+
</ReploProvider>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`SandboxRuntime` is a Client Component. In a development server it enables the
|
|
41
|
+
Replo preview integration. In a production build it renders `children`
|
|
42
|
+
unchanged, so the same composition can remain in the root layout for every
|
|
43
|
+
environment.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
This package is proprietary software. See [LICENSE](./LICENSE)
|
|
48
|
+
(`SEE LICENSE IN LICENSE`) and the [Replo Terms of Service](https://replo.app/terms).
|
|
@@ -12,14 +12,8 @@ export declare function randomBase64Url(byteLength: number): string;
|
|
|
12
12
|
* `crypto.getRandomValues`, which carries no such restriction.
|
|
13
13
|
*/
|
|
14
14
|
export declare function randomUUID(): string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* Used for storing opaque secrets (e.g. public API tokens) where we want
|
|
19
|
-
* constant-length hex output suitable for a `VARCHAR(64)` column with a
|
|
20
|
-
* unique index.
|
|
21
|
-
*/
|
|
22
|
-
export declare function sha256Hex(input: string): Promise<string>;
|
|
15
|
+
/** Strings use UTF-8; binary inputs are hashed unchanged. */
|
|
16
|
+
export declare function sha256Hex(input: string | Parameters<typeof crypto.subtle.digest>[1]): Promise<string>;
|
|
23
17
|
export declare function constantTimeEqual({ left, right, }: {
|
|
24
18
|
left: Uint8Array;
|
|
25
19
|
right: Uint8Array;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** Known symbol assets are not text typefaces; unknown families stay eligible. */
|
|
2
|
+
export declare function isKnownSymbolFontFamily(family: string): boolean;
|
|
3
|
+
export declare function getTypographyFonts<FontType extends {
|
|
4
|
+
family: string;
|
|
5
|
+
faces: {
|
|
6
|
+
cssFamily: string;
|
|
7
|
+
}[];
|
|
8
|
+
}>(fonts: FontType[]): FontType[];
|
|
1
9
|
/**
|
|
2
10
|
* Slugified family name, matching how `fontNameToCssVariable` derives a CSS var
|
|
3
11
|
* (e.g. "DM Sans" → "dm-sans"), so a `--font-<slug>` var round-trips back to a
|
|
@@ -130,6 +130,17 @@ function capitalize(string) {
|
|
|
130
130
|
}
|
|
131
131
|
var capitalize_default = capitalize;
|
|
132
132
|
|
|
133
|
+
function isKnownSymbolFontFamily(family) {
|
|
134
|
+
const normalized = family.trim().replace(/^["']|["']$/gu, "");
|
|
135
|
+
return /(?:^|[\s_-])(?:icons?|symbols?)(?:$|[\s_-])/iu.test(normalized) || /^(?:webrupee|fontawesome(?:[0-9]+)?(?:free|pro|brands|duotone|sharp)?|icomoon|glyphicons|wingdings|webdings|materialicons)$/iu.test(
|
|
136
|
+
normalized.replace(/[\s_-]/gu, "")
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
function getTypographyFonts(fonts) {
|
|
140
|
+
return fonts.filter((font) => {
|
|
141
|
+
return !isKnownSymbolFontFamily(font.family) && (font.faces.length === 0 || font.faces.some((face) => !isKnownSymbolFontFamily(face.cssFamily)));
|
|
142
|
+
});
|
|
143
|
+
}
|
|
133
144
|
function slugifyFontFamily(family) {
|
|
134
145
|
return family.replace(/([a-z])([A-Z])/g, "$1-$2").split(/[\s_-]+/u).map((word) => word.toLowerCase()).join("-");
|
|
135
146
|
}
|
|
@@ -206,4 +217,4 @@ var escapeFontFamilyName = (fontFamily) => {
|
|
|
206
217
|
return fontFamily.replace(/"/g, '\\"').replace(/'/g, "\\'");
|
|
207
218
|
};
|
|
208
219
|
|
|
209
|
-
export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, quoteFontFamily, slugifyFontFamily };
|
|
220
|
+
export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, quoteFontFamily, slugifyFontFamily };
|
|
@@ -356,13 +356,13 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
|
|
|
356
356
|
timeoutMs: number;
|
|
357
357
|
};
|
|
358
358
|
iframeReady: {
|
|
359
|
-
inputSchema: z.
|
|
359
|
+
inputSchema: z.ZodObject<{
|
|
360
360
|
packageName: z.ZodString;
|
|
361
361
|
version: z.ZodString;
|
|
362
362
|
branch: z.ZodNullable<z.ZodString>;
|
|
363
363
|
commit: z.ZodNullable<z.ZodString>;
|
|
364
364
|
builtAt: z.ZodNullable<z.ZodString>;
|
|
365
|
-
}, z.core.$strip
|
|
365
|
+
}, z.core.$strip>;
|
|
366
366
|
outputSchema: z.ZodVoid;
|
|
367
367
|
};
|
|
368
368
|
elementSelected: {
|
|
@@ -776,13 +776,13 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
776
776
|
}, z.core.$strip>], "method">;
|
|
777
777
|
export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
778
778
|
method: z.ZodLiteral<"iframeReady">;
|
|
779
|
-
data: z.
|
|
779
|
+
data: z.ZodObject<{
|
|
780
780
|
packageName: z.ZodString;
|
|
781
781
|
version: z.ZodString;
|
|
782
782
|
branch: z.ZodNullable<z.ZodString>;
|
|
783
783
|
commit: z.ZodNullable<z.ZodString>;
|
|
784
784
|
builtAt: z.ZodNullable<z.ZodString>;
|
|
785
|
-
}, z.core.$strip
|
|
785
|
+
}, z.core.$strip>;
|
|
786
786
|
}, z.core.$strip>, z.ZodObject<{
|
|
787
787
|
method: z.ZodLiteral<"elementSelected">;
|
|
788
788
|
data: z.ZodObject<{
|
|
@@ -93,7 +93,7 @@ var canopyToWebsiteBuilderMethodConfig = {
|
|
|
93
93
|
timeoutMs: 5e3
|
|
94
94
|
},
|
|
95
95
|
iframeReady: {
|
|
96
|
-
inputSchema: iframeRuntimeBuildMetadataSchema
|
|
96
|
+
inputSchema: iframeRuntimeBuildMetadataSchema,
|
|
97
97
|
outputSchema: z.void()
|
|
98
98
|
},
|
|
99
99
|
elementSelected: {
|
|
@@ -199,7 +199,7 @@ var selectModeParentMessageSchema = z.discriminatedUnion("method", [
|
|
|
199
199
|
var selectModeIframeMessageSchema = z.discriminatedUnion("method", [
|
|
200
200
|
z.object({
|
|
201
201
|
method: z.literal("iframeReady"),
|
|
202
|
-
data: iframeRuntimeBuildMetadataSchema
|
|
202
|
+
data: iframeRuntimeBuildMetadataSchema
|
|
203
203
|
}),
|
|
204
204
|
z.object({
|
|
205
205
|
method: z.literal("elementSelected"),
|
package/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "769a5347144bb3d6c77b6f06b075c8f6ad45a6b3",
|
|
6
|
+
"builtAt": "2026-09-16T18:01:45.448Z"
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sandbox-runtime",
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.3",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "769a5347144bb3d6c77b6f06b075c8f6ad45a6b3",
|
|
9
|
+
"builtAt": "2026-09-16T18:01:45.448Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -76,13 +76,13 @@ export declare function getSelectModeIframeRpcChannel(): import("../_vendor/sche
|
|
|
76
76
|
timeoutMs: number;
|
|
77
77
|
};
|
|
78
78
|
iframeReady: {
|
|
79
|
-
inputSchema: import("zod").
|
|
79
|
+
inputSchema: import("zod").ZodObject<{
|
|
80
80
|
packageName: import("zod").ZodString;
|
|
81
81
|
version: import("zod").ZodString;
|
|
82
82
|
branch: import("zod").ZodNullable<import("zod").ZodString>;
|
|
83
83
|
commit: import("zod").ZodNullable<import("zod").ZodString>;
|
|
84
84
|
builtAt: import("zod").ZodNullable<import("zod").ZodString>;
|
|
85
|
-
}, import("zod/v4/core").$strip
|
|
85
|
+
}, import("zod/v4/core").$strip>;
|
|
86
86
|
outputSchema: import("zod").ZodVoid;
|
|
87
87
|
};
|
|
88
88
|
elementSelected: {
|