@replohq/sandbox-runtime 1.7.11 → 1.7.12
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/react/zustand.d.ts +0 -2
- package/_vendor/replo-utils/react/zustand.mjs +3 -14
- package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +1 -8
- package/_vendor/schemas/selectModeIframeRpc.d.ts +0 -126
- package/_vendor/schemas/selectModeIframeRpc.mjs +2 -10
- package/buildMetadata.js +3 -3
- package/package.json +4 -4
- package/select-mode/selectModeStore.js +2 -1
- package/select-mode/useShallowStore.d.ts +2 -0
- package/select-mode/useShallowStore.js +9 -0
|
@@ -2,8 +2,6 @@ import type { StateCreator, StoreApi } from "zustand";
|
|
|
2
2
|
/**
|
|
3
3
|
* Drop-in replacement for zustand's `useStore` that uses shallow equality by default.
|
|
4
4
|
* Use this in context-based stores so all selectors automatically get shallow comparison.
|
|
5
|
-
* Subscribes through React's useSyncExternalStore so the consumer's React is
|
|
6
|
-
* used, not Zustand's nested use-sync-external-store copy.
|
|
7
5
|
*/
|
|
8
6
|
export declare function useShallowStore<StateType, SelectedType>(store: StoreApi<StateType>, selector: (state: StateType) => SelectedType): SelectedType;
|
|
9
7
|
/**
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useStore } from 'zustand';
|
|
2
|
+
import { useShallow } from 'zustand/react/shallow';
|
|
2
3
|
import { shallow } from 'zustand/shallow';
|
|
3
4
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
4
5
|
|
|
5
6
|
function useShallowStore(store, selector) {
|
|
6
|
-
|
|
7
|
-
return useSyncExternalStore(
|
|
8
|
-
store.subscribe,
|
|
9
|
-
() => {
|
|
10
|
-
const next = selector(store.getState());
|
|
11
|
-
if (lastSelectedRef.current !== void 0 && shallow(lastSelectedRef.current, next)) {
|
|
12
|
-
return lastSelectedRef.current;
|
|
13
|
-
}
|
|
14
|
-
lastSelectedRef.current = next;
|
|
15
|
-
return next;
|
|
16
|
-
},
|
|
17
|
-
() => selector(store.getState())
|
|
18
|
-
);
|
|
7
|
+
return useStore(store, useShallow(selector));
|
|
19
8
|
}
|
|
20
9
|
function createShallowStore(initializer) {
|
|
21
10
|
return createWithEqualityFn(initializer, shallow);
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { SelectModeBoundingRect,
|
|
1
|
+
import type { SelectModeBoundingRect, DisplayMode, SelectModeSelectionType, SelectModeOptimisticUpdatePayload, SelectModeFormatCommand, SelectableData, SelectModeClickPosition, SelectModeSelectionRect, SelectModeTiptapActiveMarks } from "./selectMode";
|
|
2
2
|
export type InlineEditFeedback = {
|
|
3
3
|
status: "pending" | "unavailable" | "failed";
|
|
4
4
|
rect: SelectModeBoundingRect;
|
|
5
5
|
};
|
|
6
|
-
export type SelectedComponentEditRequest = {
|
|
7
|
-
siteId: string;
|
|
8
|
-
element: SelectedElement;
|
|
9
|
-
};
|
|
10
6
|
export type IframeRuntimeBuildMetadata = {
|
|
11
7
|
packageName: string;
|
|
12
8
|
version: string;
|
|
@@ -15,9 +11,6 @@ export type IframeRuntimeBuildMetadata = {
|
|
|
15
11
|
builtAt: string | null;
|
|
16
12
|
};
|
|
17
13
|
export type SelectModeParentMessage = {
|
|
18
|
-
method: "editSelectedComponent";
|
|
19
|
-
data: SelectedComponentEditRequest;
|
|
20
|
-
} | {
|
|
21
14
|
method: "setDisplayMode";
|
|
22
15
|
data: {
|
|
23
16
|
displayMode: DisplayMode;
|
|
@@ -26,68 +26,6 @@ export declare const iframeRuntimeBuildMetadataSchema: z.ZodObject<{
|
|
|
26
26
|
commit: z.ZodNullable<z.ZodString>;
|
|
27
27
|
builtAt: z.ZodNullable<z.ZodString>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
|
-
export declare const selectedComponentEditRequestSchema: z.ZodObject<{
|
|
30
|
-
siteId: z.ZodUUID;
|
|
31
|
-
element: z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<"react-element">;
|
|
33
|
-
selector: z.ZodString;
|
|
34
|
-
tagName: z.ZodString;
|
|
35
|
-
elementType: z.ZodString;
|
|
36
|
-
textContent: z.ZodNullable<z.ZodString>;
|
|
37
|
-
rect: z.ZodObject<{
|
|
38
|
-
x: z.ZodNumber;
|
|
39
|
-
y: z.ZodNumber;
|
|
40
|
-
left: z.ZodNumber;
|
|
41
|
-
top: z.ZodNumber;
|
|
42
|
-
right: z.ZodNumber;
|
|
43
|
-
bottom: z.ZodNumber;
|
|
44
|
-
width: z.ZodNumber;
|
|
45
|
-
height: z.ZodNumber;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
textMetrics: z.ZodNullable<z.ZodObject<{
|
|
48
|
-
tightWidth: z.ZodNumber;
|
|
49
|
-
lineCount: z.ZodNumber;
|
|
50
|
-
lineHeight: z.ZodNumber;
|
|
51
|
-
}, z.core.$strip>>;
|
|
52
|
-
outerHTML: z.ZodString;
|
|
53
|
-
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
54
|
-
property: z.ZodString;
|
|
55
|
-
variant: z.ZodNullable<z.ZodObject<{
|
|
56
|
-
atRules: z.ZodArray<z.ZodObject<{
|
|
57
|
-
type: z.ZodString;
|
|
58
|
-
text: z.ZodString;
|
|
59
|
-
}, z.core.$strip>>;
|
|
60
|
-
pseudo: z.ZodNullable<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>>;
|
|
62
|
-
className: z.ZodNullable<z.ZodString>;
|
|
63
|
-
raw: z.ZodString;
|
|
64
|
-
resolved: z.ZodString;
|
|
65
|
-
}, z.core.$strip>>>;
|
|
66
|
-
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
67
|
-
clickPosition: z.ZodObject<{
|
|
68
|
-
x: z.ZodNumber;
|
|
69
|
-
y: z.ZodNumber;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
sourceLocation: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
filePath: z.ZodString;
|
|
73
|
-
lineNumber: z.ZodNumber;
|
|
74
|
-
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
75
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
|
-
fiberChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
78
|
-
sourceLocation: z.ZodObject<{
|
|
79
|
-
filePath: z.ZodString;
|
|
80
|
-
lineNumber: z.ZodNumber;
|
|
81
|
-
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, z.core.$strip>;
|
|
84
|
-
tagName: z.ZodOptional<z.ZodString>;
|
|
85
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
86
|
-
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
-
}, z.core.$strip>>>;
|
|
88
|
-
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
89
|
-
}, z.core.$strip>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
29
|
export declare const websiteBuilderToCanopyMethodConfig: {
|
|
92
30
|
symbolicateSelectedElement: {
|
|
93
31
|
inputSchema: z.ZodObject<{
|
|
@@ -679,70 +617,6 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
|
|
|
679
617
|
};
|
|
680
618
|
};
|
|
681
619
|
export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
682
|
-
method: z.ZodLiteral<"editSelectedComponent">;
|
|
683
|
-
data: z.ZodObject<{
|
|
684
|
-
siteId: z.ZodUUID;
|
|
685
|
-
element: z.ZodObject<{
|
|
686
|
-
kind: z.ZodLiteral<"react-element">;
|
|
687
|
-
selector: z.ZodString;
|
|
688
|
-
tagName: z.ZodString;
|
|
689
|
-
elementType: z.ZodString;
|
|
690
|
-
textContent: z.ZodNullable<z.ZodString>;
|
|
691
|
-
rect: z.ZodObject<{
|
|
692
|
-
x: z.ZodNumber;
|
|
693
|
-
y: z.ZodNumber;
|
|
694
|
-
left: z.ZodNumber;
|
|
695
|
-
top: z.ZodNumber;
|
|
696
|
-
right: z.ZodNumber;
|
|
697
|
-
bottom: z.ZodNumber;
|
|
698
|
-
width: z.ZodNumber;
|
|
699
|
-
height: z.ZodNumber;
|
|
700
|
-
}, z.core.$strip>;
|
|
701
|
-
textMetrics: z.ZodNullable<z.ZodObject<{
|
|
702
|
-
tightWidth: z.ZodNumber;
|
|
703
|
-
lineCount: z.ZodNumber;
|
|
704
|
-
lineHeight: z.ZodNumber;
|
|
705
|
-
}, z.core.$strip>>;
|
|
706
|
-
outerHTML: z.ZodString;
|
|
707
|
-
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
708
|
-
property: z.ZodString;
|
|
709
|
-
variant: z.ZodNullable<z.ZodObject<{
|
|
710
|
-
atRules: z.ZodArray<z.ZodObject<{
|
|
711
|
-
type: z.ZodString;
|
|
712
|
-
text: z.ZodString;
|
|
713
|
-
}, z.core.$strip>>;
|
|
714
|
-
pseudo: z.ZodNullable<z.ZodString>;
|
|
715
|
-
}, z.core.$strip>>;
|
|
716
|
-
className: z.ZodNullable<z.ZodString>;
|
|
717
|
-
raw: z.ZodString;
|
|
718
|
-
resolved: z.ZodString;
|
|
719
|
-
}, z.core.$strip>>>;
|
|
720
|
-
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
721
|
-
clickPosition: z.ZodObject<{
|
|
722
|
-
x: z.ZodNumber;
|
|
723
|
-
y: z.ZodNumber;
|
|
724
|
-
}, z.core.$strip>;
|
|
725
|
-
sourceLocation: z.ZodOptional<z.ZodObject<{
|
|
726
|
-
filePath: z.ZodString;
|
|
727
|
-
lineNumber: z.ZodNumber;
|
|
728
|
-
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
729
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
730
|
-
}, z.core.$strip>>;
|
|
731
|
-
fiberChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
732
|
-
sourceLocation: z.ZodObject<{
|
|
733
|
-
filePath: z.ZodString;
|
|
734
|
-
lineNumber: z.ZodNumber;
|
|
735
|
-
columnNumber: z.ZodOptional<z.ZodNumber>;
|
|
736
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
737
|
-
}, z.core.$strip>;
|
|
738
|
-
tagName: z.ZodOptional<z.ZodString>;
|
|
739
|
-
componentName: z.ZodOptional<z.ZodString>;
|
|
740
|
-
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
741
|
-
}, z.core.$strip>>>;
|
|
742
|
-
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
743
|
-
}, z.core.$strip>;
|
|
744
|
-
}, z.core.$strip>;
|
|
745
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
746
620
|
method: z.ZodLiteral<"setDisplayMode">;
|
|
747
621
|
data: z.ZodObject<{
|
|
748
622
|
displayMode: z.ZodEnum<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectModeBoundingRectSchema,
|
|
1
|
+
import { selectModeBoundingRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeTiptapActiveMarksSchema, selectableDataSchema, selectModeSelectionRectSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-4T7WSMC3.mjs';
|
|
2
2
|
import '../../chunk-JUKCUPQ6.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
@@ -18,10 +18,6 @@ var iframeRuntimeBuildMetadataSchema = z.object({
|
|
|
18
18
|
commit: z.string().nullable(),
|
|
19
19
|
builtAt: z.string().nullable()
|
|
20
20
|
}).describe("IframeRuntimeBuildMetadata");
|
|
21
|
-
var selectedComponentEditRequestSchema = z.object({
|
|
22
|
-
siteId: z.uuid(),
|
|
23
|
-
element: selectedElementSchema
|
|
24
|
-
}).describe("SelectedComponentEditRequest");
|
|
25
21
|
var websiteBuilderToCanopyMethodConfig = {
|
|
26
22
|
symbolicateSelectedElement: {
|
|
27
23
|
inputSchema: selectedElementSchema,
|
|
@@ -166,10 +162,6 @@ var canopyToWebsiteBuilderMethodConfig = {
|
|
|
166
162
|
}
|
|
167
163
|
};
|
|
168
164
|
var selectModeParentMessageSchema = z.discriminatedUnion("method", [
|
|
169
|
-
z.object({
|
|
170
|
-
method: z.literal("editSelectedComponent"),
|
|
171
|
-
data: selectedComponentEditRequestSchema
|
|
172
|
-
}),
|
|
173
165
|
z.object({
|
|
174
166
|
method: z.literal("setDisplayMode"),
|
|
175
167
|
data: websiteBuilderToCanopyMethodConfig.setDisplayMode.inputSchema
|
|
@@ -251,4 +243,4 @@ var selectModeIframeMessageSchema = z.discriminatedUnion("method", [
|
|
|
251
243
|
})
|
|
252
244
|
]).describe("SelectModeIframeMessage");
|
|
253
245
|
|
|
254
|
-
export { SELECT_MODE_IFRAME_RPC_CHANNEL_ID, SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION, canopyToWebsiteBuilderMethodConfig, iframeRuntimeBuildMetadataSchema, inlineEditFeedbackSchema, selectModeIframeMessageSchema, selectModeParentMessageSchema,
|
|
246
|
+
export { SELECT_MODE_IFRAME_RPC_CHANNEL_ID, SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION, canopyToWebsiteBuilderMethodConfig, iframeRuntimeBuildMetadataSchema, inlineEditFeedbackSchema, selectModeIframeMessageSchema, selectModeParentMessageSchema, websiteBuilderToCanopyMethodConfig };
|
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.12",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "25c44bae8033d312c213c7d6d6cd3bba14a38cfd",
|
|
6
|
+
"builtAt": "2026-09-22T04:29:15.711Z"
|
|
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.12",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sandbox-runtime",
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.12",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "25c44bae8033d312c213c7d6d6cd3bba14a38cfd",
|
|
9
|
+
"builtAt": "2026-09-22T04:29:15.711Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createShallowStore
|
|
2
|
+
import { createShallowStore } from "../_vendor/replo-utils/react/zustand.mjs";
|
|
3
3
|
import {
|
|
4
4
|
buildElementDescriptor,
|
|
5
5
|
buildSelector
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
symbolicateSelectedElement
|
|
23
23
|
} from "./symbolicate";
|
|
24
24
|
import { createInlineTiptapEditor } from "./tiptapInlineEditor";
|
|
25
|
+
import { useShallowStore } from "./useShallowStore";
|
|
25
26
|
const EMPTY_ACTIVE_MARKS = {
|
|
26
27
|
bold: false,
|
|
27
28
|
italic: false,
|