@replohq/sandbox-runtime 1.7.12 → 1.8.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.
@@ -26,7 +26,155 @@ 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 websiteBuilderToCanopyMethodConfig: {
29
+ export declare const selectModeEventInputSchemas: {
30
+ hover: z.ZodObject<{
31
+ rect: z.ZodNullable<z.ZodObject<{
32
+ x: z.ZodNumber;
33
+ y: z.ZodNumber;
34
+ left: z.ZodNumber;
35
+ top: z.ZodNumber;
36
+ right: z.ZodNumber;
37
+ bottom: z.ZodNumber;
38
+ width: z.ZodNumber;
39
+ height: z.ZodNumber;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>;
42
+ areaSelection: z.ZodObject<{
43
+ rect: z.ZodObject<{
44
+ x: z.ZodNumber;
45
+ y: z.ZodNumber;
46
+ left: z.ZodNumber;
47
+ top: z.ZodNumber;
48
+ right: z.ZodNumber;
49
+ bottom: z.ZodNumber;
50
+ width: z.ZodNumber;
51
+ height: z.ZodNumber;
52
+ }, z.core.$strip>;
53
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
54
+ kind: z.ZodLiteral<"react-element">;
55
+ selector: z.ZodString;
56
+ tagName: z.ZodString;
57
+ elementType: z.ZodString;
58
+ textContent: z.ZodNullable<z.ZodString>;
59
+ rect: z.ZodObject<{
60
+ x: z.ZodNumber;
61
+ y: z.ZodNumber;
62
+ left: z.ZodNumber;
63
+ top: z.ZodNumber;
64
+ right: z.ZodNumber;
65
+ bottom: z.ZodNumber;
66
+ width: z.ZodNumber;
67
+ height: z.ZodNumber;
68
+ }, z.core.$strip>;
69
+ textMetrics: z.ZodNullable<z.ZodObject<{
70
+ tightWidth: z.ZodNumber;
71
+ lineCount: z.ZodNumber;
72
+ lineHeight: z.ZodNumber;
73
+ }, z.core.$strip>>;
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>>;
89
+ definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
90
+ property: z.ZodString;
91
+ variant: z.ZodNullable<z.ZodObject<{
92
+ atRules: z.ZodArray<z.ZodObject<{
93
+ type: z.ZodString;
94
+ text: z.ZodString;
95
+ }, z.core.$strip>>;
96
+ pseudo: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ className: z.ZodNullable<z.ZodString>;
99
+ raw: z.ZodString;
100
+ resolved: z.ZodString;
101
+ }, z.core.$strip>>>;
102
+ inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
103
+ clickPosition: z.ZodObject<{
104
+ x: z.ZodNumber;
105
+ y: z.ZodNumber;
106
+ }, z.core.$strip>;
107
+ sourceLocation: z.ZodOptional<z.ZodObject<{
108
+ filePath: z.ZodString;
109
+ lineNumber: z.ZodNumber;
110
+ columnNumber: z.ZodOptional<z.ZodNumber>;
111
+ componentName: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>>;
113
+ fiberChain: z.ZodDefault<z.ZodArray<z.ZodObject<{
114
+ sourceLocation: z.ZodObject<{
115
+ filePath: z.ZodString;
116
+ lineNumber: z.ZodNumber;
117
+ columnNumber: z.ZodOptional<z.ZodNumber>;
118
+ componentName: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>;
120
+ tagName: z.ZodOptional<z.ZodString>;
121
+ componentName: z.ZodOptional<z.ZodString>;
122
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
123
+ }, z.core.$strip>>>;
124
+ siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ kind: z.ZodLiteral<"plan">;
127
+ planId: z.ZodString;
128
+ label: z.ZodString;
129
+ rect: z.ZodObject<{
130
+ x: z.ZodNumber;
131
+ y: z.ZodNumber;
132
+ left: z.ZodNumber;
133
+ top: z.ZodNumber;
134
+ right: z.ZodNumber;
135
+ bottom: z.ZodNumber;
136
+ width: z.ZodNumber;
137
+ height: z.ZodNumber;
138
+ }, z.core.$strip>;
139
+ }, z.core.$strip>], "kind">>;
140
+ }, z.core.$strip>;
141
+ dragRect: z.ZodObject<{
142
+ dragRect: z.ZodNullable<z.ZodObject<{
143
+ x: z.ZodNumber;
144
+ y: z.ZodNumber;
145
+ left: z.ZodNumber;
146
+ top: z.ZodNumber;
147
+ right: z.ZodNumber;
148
+ bottom: z.ZodNumber;
149
+ width: z.ZodNumber;
150
+ height: z.ZodNumber;
151
+ }, z.core.$strip>>;
152
+ selectionRects: z.ZodArray<z.ZodObject<{
153
+ id: z.ZodString;
154
+ rect: z.ZodObject<{
155
+ x: z.ZodNumber;
156
+ y: z.ZodNumber;
157
+ left: z.ZodNumber;
158
+ top: z.ZodNumber;
159
+ right: z.ZodNumber;
160
+ bottom: z.ZodNumber;
161
+ width: z.ZodNumber;
162
+ height: z.ZodNumber;
163
+ }, z.core.$strip>;
164
+ }, z.core.$strip>>;
165
+ }, z.core.$strip>;
166
+ inlineEditState: z.ZodObject<{
167
+ activeMarks: z.ZodObject<{
168
+ bold: z.ZodBoolean;
169
+ italic: z.ZodBoolean;
170
+ underline: z.ZodBoolean;
171
+ strike: z.ZodBoolean;
172
+ }, z.core.$strip>;
173
+ isInlineEditing: z.ZodBoolean;
174
+ isInlineEditPending: z.ZodBoolean;
175
+ }, z.core.$strip>;
176
+ };
177
+ export declare const websiteBuilderToPreviewIframeMethodConfig: {
30
178
  symbolicateSelectedElement: {
31
179
  inputSchema: z.ZodObject<{
32
180
  kind: z.ZodLiteral<"react-element">;
@@ -50,6 +198,20 @@ export declare const websiteBuilderToCanopyMethodConfig: {
50
198
  lineHeight: z.ZodNumber;
51
199
  }, z.core.$strip>>;
52
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>>;
53
215
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
54
216
  property: z.ZodString;
55
217
  variant: z.ZodNullable<z.ZodObject<{
@@ -109,6 +271,20 @@ export declare const websiteBuilderToCanopyMethodConfig: {
109
271
  lineHeight: z.ZodNumber;
110
272
  }, z.core.$strip>>;
111
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>>;
112
288
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
113
289
  property: z.ZodString;
114
290
  variant: z.ZodNullable<z.ZodObject<{
@@ -179,6 +355,22 @@ export declare const websiteBuilderToCanopyMethodConfig: {
179
355
  inputSchema: z.ZodObject<{
180
356
  editId: z.ZodString;
181
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<{
182
374
  kind: z.ZodLiteral<"css">;
183
375
  fontSource: z.ZodOptional<z.ZodEnum<{
184
376
  google: "google";
@@ -245,7 +437,7 @@ export declare const websiteBuilderToCanopyMethodConfig: {
245
437
  outputSchema: z.ZodVoid;
246
438
  };
247
439
  };
248
- export declare const canopyToWebsiteBuilderMethodConfig: {
440
+ export declare const previewIframeToWebsiteBuilderMethodConfig: {
249
441
  requestInlineTextEdit: {
250
442
  inputSchema: z.ZodObject<{
251
443
  editId: z.ZodString;
@@ -271,6 +463,20 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
271
463
  lineHeight: z.ZodNumber;
272
464
  }, z.core.$strip>>;
273
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>>;
274
480
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
275
481
  property: z.ZodString;
276
482
  variant: z.ZodNullable<z.ZodObject<{
@@ -348,6 +554,20 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
348
554
  lineHeight: z.ZodNumber;
349
555
  }, z.core.$strip>>;
350
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>>;
351
571
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
352
572
  property: z.ZodString;
353
573
  variant: z.ZodNullable<z.ZodObject<{
@@ -513,6 +733,20 @@ export declare const canopyToWebsiteBuilderMethodConfig: {
513
733
  lineHeight: z.ZodNumber;
514
734
  }, z.core.$strip>>;
515
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>>;
516
750
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
517
751
  property: z.ZodString;
518
752
  variant: z.ZodNullable<z.ZodObject<{
@@ -640,6 +874,22 @@ export declare const selectModeParentMessageSchema: z.ZodDiscriminatedUnion<[z.Z
640
874
  data: z.ZodObject<{
641
875
  editId: z.ZodString;
642
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<{
643
893
  kind: z.ZodLiteral<"css">;
644
894
  fontSource: z.ZodOptional<z.ZodEnum<{
645
895
  google: "google";
@@ -730,6 +980,20 @@ export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.Z
730
980
  lineHeight: z.ZodNumber;
731
981
  }, z.core.$strip>>;
732
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>>;
733
997
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
734
998
  property: z.ZodString;
735
999
  variant: z.ZodNullable<z.ZodObject<{
@@ -890,6 +1154,20 @@ export declare const selectModeIframeMessageSchema: z.ZodDiscriminatedUnion<[z.Z
890
1154
  lineHeight: z.ZodNumber;
891
1155
  }, z.core.$strip>>;
892
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>>;
893
1171
  definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
894
1172
  property: z.ZodString;
895
1173
  variant: z.ZodNullable<z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import { selectModeBoundingRectSchema, selectModeFormatCommandSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionTypeSchema, displayModeSchema, selectModeTiptapActiveMarksSchema, selectableDataSchema, selectModeSelectionRectSchema, selectModeClickPositionSchema, selectedElementSchema } from '../../chunk-4T7WSMC3.mjs';
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';
@@ -18,7 +18,25 @@ var iframeRuntimeBuildMetadataSchema = z.object({
18
18
  commit: z.string().nullable(),
19
19
  builtAt: z.string().nullable()
20
20
  }).describe("IframeRuntimeBuildMetadata");
21
- var websiteBuilderToCanopyMethodConfig = {
21
+ var selectModeEventInputSchemas = {
22
+ hover: z.object({
23
+ rect: selectModeBoundingRectSchema.nullable()
24
+ }),
25
+ areaSelection: z.object({
26
+ rect: selectModeBoundingRectSchema,
27
+ items: z.array(selectableDataSchema)
28
+ }),
29
+ dragRect: z.object({
30
+ dragRect: selectModeBoundingRectSchema.nullable(),
31
+ selectionRects: z.array(selectModeSelectionRectSchema)
32
+ }),
33
+ inlineEditState: z.object({
34
+ activeMarks: selectModeTiptapActiveMarksSchema,
35
+ isInlineEditing: z.boolean(),
36
+ isInlineEditPending: z.boolean()
37
+ })
38
+ };
39
+ var websiteBuilderToPreviewIframeMethodConfig = {
22
40
  symbolicateSelectedElement: {
23
41
  inputSchema: selectedElementSchema,
24
42
  outputSchema: selectedElementSchema,
@@ -83,7 +101,7 @@ var websiteBuilderToCanopyMethodConfig = {
83
101
  outputSchema: z.void()
84
102
  }
85
103
  };
86
- var canopyToWebsiteBuilderMethodConfig = {
104
+ var previewIframeToWebsiteBuilderMethodConfig = {
87
105
  requestInlineTextEdit: {
88
106
  inputSchema: z.object({
89
107
  editId: z.string(),
@@ -103,9 +121,7 @@ var canopyToWebsiteBuilderMethodConfig = {
103
121
  outputSchema: z.void()
104
122
  },
105
123
  hoverElement: {
106
- inputSchema: z.object({
107
- rect: selectModeBoundingRectSchema.nullable()
108
- }),
124
+ inputSchema: selectModeEventInputSchemas.hover,
109
125
  outputSchema: z.void()
110
126
  },
111
127
  selectedElementRectUpdate: {
@@ -122,17 +138,11 @@ var canopyToWebsiteBuilderMethodConfig = {
122
138
  outputSchema: z.void()
123
139
  },
124
140
  dragRectUpdated: {
125
- inputSchema: z.object({
126
- dragRect: selectModeBoundingRectSchema.nullable(),
127
- selectionRects: z.array(selectModeSelectionRectSchema)
128
- }),
141
+ inputSchema: selectModeEventInputSchemas.dragRect,
129
142
  outputSchema: z.void()
130
143
  },
131
144
  areaSelected: {
132
- inputSchema: z.object({
133
- rect: selectModeBoundingRectSchema,
134
- items: z.array(selectableDataSchema)
135
- }),
145
+ inputSchema: selectModeEventInputSchemas.areaSelection,
136
146
  outputSchema: z.void()
137
147
  },
138
148
  textCommitted: {
@@ -149,11 +159,7 @@ var canopyToWebsiteBuilderMethodConfig = {
149
159
  outputSchema: z.void()
150
160
  },
151
161
  editorStateUpdate: {
152
- inputSchema: z.object({
153
- activeMarks: selectModeTiptapActiveMarksSchema,
154
- isInlineEditing: z.boolean(),
155
- isInlineEditPending: z.boolean()
156
- }),
162
+ inputSchema: selectModeEventInputSchemas.inlineEditState,
157
163
  outputSchema: z.void()
158
164
  },
159
165
  fastRefreshComplete: {
@@ -164,27 +170,27 @@ var canopyToWebsiteBuilderMethodConfig = {
164
170
  var selectModeParentMessageSchema = z.discriminatedUnion("method", [
165
171
  z.object({
166
172
  method: z.literal("setDisplayMode"),
167
- data: websiteBuilderToCanopyMethodConfig.setDisplayMode.inputSchema
173
+ data: websiteBuilderToPreviewIframeMethodConfig.setDisplayMode.inputSchema
168
174
  }),
169
175
  z.object({
170
176
  method: z.literal("setSelectionType"),
171
- data: websiteBuilderToCanopyMethodConfig.setSelectionType.inputSchema
177
+ data: websiteBuilderToPreviewIframeMethodConfig.setSelectionType.inputSchema
172
178
  }),
173
179
  z.object({
174
180
  method: z.literal("applyOptimisticUpdate"),
175
- data: websiteBuilderToCanopyMethodConfig.applyOptimisticUpdate.inputSchema
181
+ data: websiteBuilderToPreviewIframeMethodConfig.applyOptimisticUpdate.inputSchema
176
182
  }),
177
183
  z.object({
178
184
  method: z.literal("markCommitted"),
179
- data: websiteBuilderToCanopyMethodConfig.markCommitted.inputSchema
185
+ data: websiteBuilderToPreviewIframeMethodConfig.markCommitted.inputSchema
180
186
  }),
181
187
  z.object({
182
188
  method: z.literal("resolveSessionOverrides"),
183
- data: websiteBuilderToCanopyMethodConfig.resolveSessionOverrides.inputSchema
189
+ data: websiteBuilderToPreviewIframeMethodConfig.resolveSessionOverrides.inputSchema
184
190
  }),
185
191
  z.object({
186
192
  method: z.literal("revertOverride"),
187
- data: websiteBuilderToCanopyMethodConfig.revertOverride.inputSchema
193
+ data: websiteBuilderToPreviewIframeMethodConfig.revertOverride.inputSchema
188
194
  }),
189
195
  z.object({
190
196
  method: z.literal("enterEditMode")
@@ -194,7 +200,7 @@ var selectModeParentMessageSchema = z.discriminatedUnion("method", [
194
200
  }),
195
201
  z.object({
196
202
  method: z.literal("formatCommand"),
197
- data: websiteBuilderToCanopyMethodConfig.formatCommand.inputSchema
203
+ data: websiteBuilderToPreviewIframeMethodConfig.formatCommand.inputSchema
198
204
  })
199
205
  ]).describe("SelectModeParentMessage");
200
206
  var selectModeIframeMessageSchema = z.discriminatedUnion("method", [
@@ -204,43 +210,43 @@ var selectModeIframeMessageSchema = z.discriminatedUnion("method", [
204
210
  }),
205
211
  z.object({
206
212
  method: z.literal("elementSelected"),
207
- data: canopyToWebsiteBuilderMethodConfig.elementSelected.inputSchema
213
+ data: previewIframeToWebsiteBuilderMethodConfig.elementSelected.inputSchema
208
214
  }),
209
215
  z.object({
210
216
  method: z.literal("hoverElement"),
211
- data: canopyToWebsiteBuilderMethodConfig.hoverElement.inputSchema
217
+ data: previewIframeToWebsiteBuilderMethodConfig.hoverElement.inputSchema
212
218
  }),
213
219
  z.object({
214
220
  method: z.literal("selectedElementRectUpdate"),
215
- data: canopyToWebsiteBuilderMethodConfig.selectedElementRectUpdate.inputSchema
221
+ data: previewIframeToWebsiteBuilderMethodConfig.selectedElementRectUpdate.inputSchema
216
222
  }),
217
223
  z.object({
218
224
  method: z.literal("selectedAreaRectUpdate"),
219
- data: canopyToWebsiteBuilderMethodConfig.selectedAreaRectUpdate.inputSchema
225
+ data: previewIframeToWebsiteBuilderMethodConfig.selectedAreaRectUpdate.inputSchema
220
226
  }),
221
227
  z.object({
222
228
  method: z.literal("dragRectUpdated"),
223
- data: canopyToWebsiteBuilderMethodConfig.dragRectUpdated.inputSchema
229
+ data: previewIframeToWebsiteBuilderMethodConfig.dragRectUpdated.inputSchema
224
230
  }),
225
231
  z.object({
226
232
  method: z.literal("areaSelected"),
227
- data: canopyToWebsiteBuilderMethodConfig.areaSelected.inputSchema
233
+ data: previewIframeToWebsiteBuilderMethodConfig.areaSelected.inputSchema
228
234
  }),
229
235
  z.object({
230
236
  method: z.literal("textCommitted"),
231
- data: canopyToWebsiteBuilderMethodConfig.textCommitted.inputSchema
237
+ data: previewIframeToWebsiteBuilderMethodConfig.textCommitted.inputSchema
232
238
  }),
233
239
  z.object({
234
240
  method: z.literal("inlineEditFeedbackChanged"),
235
- data: canopyToWebsiteBuilderMethodConfig.inlineEditFeedbackChanged.inputSchema
241
+ data: previewIframeToWebsiteBuilderMethodConfig.inlineEditFeedbackChanged.inputSchema
236
242
  }),
237
243
  z.object({
238
244
  method: z.literal("editorStateUpdate"),
239
- data: canopyToWebsiteBuilderMethodConfig.editorStateUpdate.inputSchema
245
+ data: previewIframeToWebsiteBuilderMethodConfig.editorStateUpdate.inputSchema
240
246
  }),
241
247
  z.object({
242
248
  method: z.literal("fastRefreshComplete")
243
249
  })
244
250
  ]).describe("SelectModeIframeMessage");
245
251
 
246
- export { SELECT_MODE_IFRAME_RPC_CHANNEL_ID, SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION, canopyToWebsiteBuilderMethodConfig, iframeRuntimeBuildMetadataSchema, inlineEditFeedbackSchema, selectModeIframeMessageSchema, selectModeParentMessageSchema, websiteBuilderToCanopyMethodConfig };
252
+ export { SELECT_MODE_IFRAME_RPC_CHANNEL_ID, SELECT_MODE_IFRAME_RPC_CHANNEL_VERSION, iframeRuntimeBuildMetadataSchema, inlineEditFeedbackSchema, previewIframeToWebsiteBuilderMethodConfig, selectModeEventInputSchemas, selectModeIframeMessageSchema, selectModeParentMessageSchema, websiteBuilderToPreviewIframeMethodConfig };
@@ -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.7.12",
3
+ "version": "1.8.0",
4
4
  "branch": "HEAD",
5
- "commit": "25c44bae8033d312c213c7d6d6cd3bba14a38cfd",
6
- "builtAt": "2026-09-22T04:29:15.711Z"
5
+ "commit": "6ad933540e110b76d214b8700e7a356a551c869a",
6
+ "builtAt": "2026-09-24T18:57:19.451Z"
7
7
  };
@@ -100,6 +100,25 @@ function getIframeOffset(iframe) {
100
100
  const iframeRect = iframe.getBoundingClientRect();
101
101
  return { left: iframeRect.left, top: iframeRect.top };
102
102
  }
103
+ var selectModeImageScopeSchema = z.discriminatedUnion("kind", [
104
+ z.object({ kind: z.literal("all") }),
105
+ z.object({ kind: z.literal("media"), media: z.string() })
106
+ ]).describe("SelectModeImageScope");
107
+ var selectModeImageSourceSchema = z.object({
108
+ srcSet: z.string(),
109
+ sizes: z.string(),
110
+ media: z.string(),
111
+ type: z.string(),
112
+ previewUrl: z.string().nullable()
113
+ }).describe("SelectModeImageSource");
114
+ var selectModeImageSchema = z.object({
115
+ src: z.string(),
116
+ currentSrc: z.string(),
117
+ srcSet: z.string(),
118
+ sizes: z.string(),
119
+ previewUrl: z.string().nullable(),
120
+ sources: z.array(selectModeImageSourceSchema)
121
+ }).describe("SelectModeImage");
103
122
  var selectedElementSchema = z.object({
104
123
  kind: z.literal("react-element"),
105
124
  selector: z.string(),
@@ -109,6 +128,7 @@ var selectedElementSchema = z.object({
109
128
  rect: selectModeBoundingRectSchema,
110
129
  textMetrics: selectModeTextMetricsSchema.nullable(),
111
130
  outerHTML: z.string(),
131
+ image: selectModeImageSchema.optional(),
112
132
  definedStyles: z.array(selectModeDefinedStyleSchema).default([]),
113
133
  inheritedStyles: z.record(z.string(), z.string()).default({}),
114
134
  clickPosition: selectModeClickPositionSchema,
@@ -166,6 +186,10 @@ function readSelectablePayload(rawPayload) {
166
186
  return parseSchemaOrNull(parsedPayload, selectableDataPayloadSchema);
167
187
  }
168
188
  var selectModeOptimisticUpdatePayloadSchema = z.discriminatedUnion("kind", [
189
+ z.object({
190
+ kind: z.literal("image"),
191
+ image: selectModeImageSchema
192
+ }),
169
193
  z.object({
170
194
  kind: z.literal("css"),
171
195
  fontSource: z.enum(["google", "site"]).optional(),
@@ -208,4 +232,4 @@ var selectModeSelectionSchema = z.discriminatedUnion("type", [
208
232
  })
209
233
  ]).describe("SelectModeSelection");
210
234
 
211
- 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 };
235
+ 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 };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.7.12",
3
+ "version": "1.8.0",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.7.12",
6
+ "version": "1.8.0",
7
7
  "branch": "HEAD",
8
- "commit": "25c44bae8033d312c213c7d6d6cd3bba14a38cfd",
9
- "builtAt": "2026-09-22T04:29:15.711Z"
8
+ "commit": "6ad933540e110b76d214b8700e7a356a551c869a",
9
+ "builtAt": "2026-09-24T18:57:19.451Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",
@@ -4,6 +4,7 @@ import {
4
4
  SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE
5
5
  } from "../../_vendor/schemas/selectMode.mjs";
6
6
  import { getFiberChain } from "../fiber";
7
+ import { getImageDescriptor } from "../imageSources";
7
8
  import { skipInlineTextMarkElements } from "../inlineTextMarks";
8
9
  import { getElementBoundingRect } from "../interactions/selectionGeometry";
9
10
  import { getDefinedStyles, getInheritedStyles } from "./styleExtraction";
@@ -185,6 +186,7 @@ function buildElementDescriptor({
185
186
  rect: getElementBoundingRect(element),
186
187
  textMetrics,
187
188
  outerHTML: element.outerHTML.slice(0, 4e3),
189
+ image: getImageDescriptor(element),
188
190
  definedStyles: getDefinedStyles(element),
189
191
  inheritedStyles: getInheritedStyles(element),
190
192
  clickPosition,