@replohq/sandbox-runtime 1.10.2 → 1.11.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/_vendor/replo-utils/lib/fonts.d.ts +12 -1
- package/_vendor/replo-utils/lib/fonts.mjs +41 -3
- package/_vendor/replo-utils/lib/miniappPreview.d.ts +13 -0
- package/_vendor/replo-utils/lib/miniappPreview.mjs +48 -0
- package/_vendor/replo-utils/lib/misc.d.ts +4 -0
- package/_vendor/replo-utils/lib/misc.mjs +1 -1
- package/_vendor/schemas/componentPreview.d.ts +0 -55
- package/_vendor/schemas/componentPreview.mjs +1 -45
- package/_vendor/schemas/designLibrary.d.ts +23 -0
- package/_vendor/schemas/designLibrary.mjs +8 -1
- package/_vendor/schemas/generated/componentPreview.d.ts +0 -34
- package/_vendor/schemas/generated/selectMode.d.ts +8 -0
- package/_vendor/schemas/iframeRpcChannel.mjs +1 -1
- package/_vendor/schemas/selectMode.d.ts +25 -1
- package/_vendor/schemas/selectMode.mjs +2 -2
- package/_vendor/schemas/selectModeIframeRpc.d.ts +45 -5
- package/_vendor/schemas/selectModeIframeRpc.mjs +2 -2
- package/annotations/bridgeGate.d.ts +0 -5
- package/annotations/bridgeGate.js +2 -1
- package/buildMetadata.js +3 -3
- package/capturePage.d.ts +6 -0
- package/capturePage.js +118 -6
- package/{chunk-NBVMONRN.mjs → chunk-KFJZ2OLV.mjs} +10 -2
- package/{chunk-JUKCUPQ6.mjs → chunk-PH3S6LJI.mjs} +21 -1
- package/package.json +4 -4
- package/select-mode/descriptor/elementDescriptor.js +10 -2
- package/select-mode/descriptor/styleExtraction.d.ts +4 -0
- package/select-mode/descriptor/styleExtraction.js +143 -19
- package/select-mode/hooks/useOptimisticOverrides.js +7 -0
- package/select-mode/hooks/useSelectionInteractions.js +7 -5
- package/select-mode/iframeRpcChannel.d.ts +16 -1
- package/select-mode/selectModeStore.js +5 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/** Known symbol assets are not text typefaces; unknown families stay eligible. */
|
|
2
2
|
export declare function isKnownSymbolFontFamily(family: string): boolean;
|
|
3
|
+
/** Words a family name carries for packaging rather than design: "Inter Display", "Avenir Web". */
|
|
4
|
+
export declare const FONT_DESCRIPTOR_WORDS: Set<string>;
|
|
5
|
+
/** Weight and style words a family name can carry: "Avenir Book", "Graphik Semibold". */
|
|
6
|
+
export declare const FONT_VARIANT_WORDS: Set<string>;
|
|
7
|
+
export declare const FONT_STYLE_WORDS: Set<string>;
|
|
8
|
+
export declare function stripCssQuotes(value: string): string;
|
|
9
|
+
/** "InterDisplay-Bold", "'Inter Display'" → "inter display bold", "inter display": camel case split, punctuation to spaces, lower case. */
|
|
10
|
+
export declare function normalizeFontFamilyName(value: string): string;
|
|
11
|
+
/** The key two family names share when they are the same typeface: Brand Studio's alias minus weight, style and packaging words ("Avenir Book" → "avenir"), stricter than the first-word alias. */
|
|
12
|
+
export declare function fontFamilyKey(family: string): string;
|
|
3
13
|
export declare function getTypographyFonts<FontType extends {
|
|
4
14
|
family: string;
|
|
5
15
|
faces: {
|
|
@@ -48,10 +58,11 @@ export declare function fontFormatFromMimeType(mimeType: string): string;
|
|
|
48
58
|
/**
|
|
49
59
|
* The @font-face rule that makes a custom family renderable from its asset URL.
|
|
50
60
|
*/
|
|
51
|
-
export declare function buildFontFaceCss({ family, faceUrl, format, weight, }: {
|
|
61
|
+
export declare function buildFontFaceCss({ family, faceUrl, format, weight, style, }: {
|
|
52
62
|
family: string;
|
|
53
63
|
faceUrl: string;
|
|
54
64
|
format: string;
|
|
55
65
|
weight?: number;
|
|
66
|
+
style?: "normal" | "italic";
|
|
56
67
|
}): string;
|
|
57
68
|
export declare const escapeFontFamilyName: (fontFamily: string) => string;
|
|
@@ -136,6 +136,43 @@ function isKnownSymbolFontFamily(family) {
|
|
|
136
136
|
normalized.replace(/[\s_-]/gu, "")
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
|
+
var FONT_DESCRIPTOR_WORDS = /* @__PURE__ */ new Set([
|
|
140
|
+
"display",
|
|
141
|
+
"international",
|
|
142
|
+
"intl",
|
|
143
|
+
"m",
|
|
144
|
+
"text",
|
|
145
|
+
"web",
|
|
146
|
+
"webfont",
|
|
147
|
+
"webm"
|
|
148
|
+
]);
|
|
149
|
+
var FONT_VARIANT_WORDS = /* @__PURE__ */ new Set([
|
|
150
|
+
"black",
|
|
151
|
+
"bold",
|
|
152
|
+
"book",
|
|
153
|
+
"extrabold",
|
|
154
|
+
"italic",
|
|
155
|
+
"light",
|
|
156
|
+
"medium",
|
|
157
|
+
"regular",
|
|
158
|
+
"semibold",
|
|
159
|
+
"thin"
|
|
160
|
+
]);
|
|
161
|
+
var FONT_STYLE_WORDS = /* @__PURE__ */ new Set([
|
|
162
|
+
...FONT_DESCRIPTOR_WORDS,
|
|
163
|
+
...FONT_VARIANT_WORDS
|
|
164
|
+
]);
|
|
165
|
+
function stripCssQuotes(value) {
|
|
166
|
+
return value.trim().replace(/\\(["'])/gu, "$1").replace(/^["']|["']$/gu, "");
|
|
167
|
+
}
|
|
168
|
+
function normalizeFontFamilyName(value) {
|
|
169
|
+
return stripCssQuotes(value).replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/([A-Z])([A-Z][a-z])/gu, "$1 $2").replace(/[^a-z0-9]+/giu, " ").trim().replace(/\s+/gu, " ").toLowerCase();
|
|
170
|
+
}
|
|
171
|
+
function fontFamilyKey(family) {
|
|
172
|
+
const words = normalizeFontFamilyName(family).split(" ").filter(Boolean);
|
|
173
|
+
const kept = words.filter((word) => !FONT_STYLE_WORDS.has(word));
|
|
174
|
+
return (kept.length > 0 ? kept : words).join(" ");
|
|
175
|
+
}
|
|
139
176
|
function getTypographyFonts(fonts) {
|
|
140
177
|
return fonts.filter((font) => {
|
|
141
178
|
return !isKnownSymbolFontFamily(font.family) && (font.faces.length === 0 || font.faces.some((face) => !isKnownSymbolFontFamily(face.cssFamily)));
|
|
@@ -221,12 +258,13 @@ function buildFontFaceCss({
|
|
|
221
258
|
family,
|
|
222
259
|
faceUrl,
|
|
223
260
|
format,
|
|
224
|
-
weight = 400
|
|
261
|
+
weight = 400,
|
|
262
|
+
style = "normal"
|
|
225
263
|
}) {
|
|
226
|
-
return `@font-face{font-family:"${escapeCssString(family)}";font-weight:${weight};font-style
|
|
264
|
+
return `@font-face{font-family:"${escapeCssString(family)}";font-weight:${weight};font-style:${style};src:url("${escapeCssString(faceUrl)}") format("${escapeCssString(format)}");font-display:swap;}`;
|
|
227
265
|
}
|
|
228
266
|
var escapeFontFamilyName = (fontFamily) => {
|
|
229
267
|
return fontFamily.replace(/"/g, '\\"').replace(/'/g, "\\'");
|
|
230
268
|
};
|
|
231
269
|
|
|
232
|
-
export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, quoteFontFamily, slugifyFontFamily };
|
|
270
|
+
export { FONT_DESCRIPTOR_WORDS, FONT_STYLE_WORDS, FONT_VARIANT_WORDS, buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFamilyKey, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, normalizeFontFamilyName, quoteFontFamily, slugifyFontFamily, stripCssQuotes };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getMiniappPreviewIdFromPrNumber({ prNumber, }: {
|
|
2
|
+
prNumber: string;
|
|
3
|
+
}): string | null;
|
|
4
|
+
export declare function isMiniappPreviewId(previewId: string): boolean;
|
|
5
|
+
export declare function getMiniappPreviewWorkerName({ miniappId, }: {
|
|
6
|
+
miniappId: string;
|
|
7
|
+
}): string | null;
|
|
8
|
+
export declare function getMiniappPreviewUrl({ miniappId, previewId, }: {
|
|
9
|
+
miniappId: string;
|
|
10
|
+
previewId: string;
|
|
11
|
+
}): string | null;
|
|
12
|
+
export declare function isMiniappPreviewOrigin(origin: string): boolean;
|
|
13
|
+
export declare function getMiniappPreviewIdFromOrigin(origin: string): string | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var DNS_LABEL_MAX_LENGTH = 63;
|
|
2
|
+
var MINIAPP_PREVIEW_ID_RE = /^pr-\d+$/u;
|
|
3
|
+
var MINIAPP_PREVIEW_ORIGIN_RE = /^https:\/\/(?<previewId>pr-\d+)-miniapps-[a-z0-9]+(?:-[a-z0-9]+)*-staging\.replo\.workers\.dev$/u;
|
|
4
|
+
var MINIAPP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
5
|
+
var MiniappPreviewError = class extends Error {
|
|
6
|
+
};
|
|
7
|
+
function getMiniappPreviewIdFromPrNumber({
|
|
8
|
+
prNumber
|
|
9
|
+
}) {
|
|
10
|
+
const normalizedPrNumber = prNumber.trim();
|
|
11
|
+
if (!/^\d+$/u.test(normalizedPrNumber)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return `pr-${normalizedPrNumber}`;
|
|
15
|
+
}
|
|
16
|
+
function isMiniappPreviewId(previewId) {
|
|
17
|
+
return MINIAPP_PREVIEW_ID_RE.test(previewId);
|
|
18
|
+
}
|
|
19
|
+
function getMiniappPreviewWorkerName({
|
|
20
|
+
miniappId
|
|
21
|
+
}) {
|
|
22
|
+
if (miniappId === "reploverse" || !MINIAPP_SLUG_RE.test(miniappId)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return `miniapps-${miniappId}-staging`;
|
|
26
|
+
}
|
|
27
|
+
function getMiniappPreviewUrl({
|
|
28
|
+
miniappId,
|
|
29
|
+
previewId
|
|
30
|
+
}) {
|
|
31
|
+
if (!isMiniappPreviewId(previewId)) {
|
|
32
|
+
throw new MiniappPreviewError(`Invalid miniapp preview id: ${previewId}`);
|
|
33
|
+
}
|
|
34
|
+
const workerName = getMiniappPreviewWorkerName({ miniappId });
|
|
35
|
+
if (!workerName) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const previewWorkerName = `${previewId}-${workerName}`;
|
|
39
|
+
return previewWorkerName.length <= DNS_LABEL_MAX_LENGTH ? `https://${previewWorkerName}.replo.workers.dev` : null;
|
|
40
|
+
}
|
|
41
|
+
function isMiniappPreviewOrigin(origin) {
|
|
42
|
+
return getMiniappPreviewIdFromOrigin(origin) !== null;
|
|
43
|
+
}
|
|
44
|
+
function getMiniappPreviewIdFromOrigin(origin) {
|
|
45
|
+
return MINIAPP_PREVIEW_ORIGIN_RE.exec(origin)?.groups?.previewId ?? null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { getMiniappPreviewIdFromOrigin, getMiniappPreviewIdFromPrNumber, getMiniappPreviewUrl, getMiniappPreviewWorkerName, isMiniappPreviewId, isMiniappPreviewOrigin };
|
|
@@ -142,4 +142,8 @@ export declare function coerceNumberToString(value: string | number | null): str
|
|
|
142
142
|
*/
|
|
143
143
|
export declare function formatFileSize(byteCount: number, decimalPlaces?: number): string;
|
|
144
144
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
145
|
+
export declare function sleepWithSignal({ delayMs, signal, }: {
|
|
146
|
+
delayMs: number;
|
|
147
|
+
signal: AbortSignal | null;
|
|
148
|
+
}): Promise<unknown>;
|
|
145
149
|
export declare function errorMessage(error: unknown): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, isString_default as isString, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, warning } from '../../../chunk-
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, isString_default as isString, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, sleepWithSignal, warning } from '../../../chunk-PH3S6LJI.mjs';
|
|
2
2
|
export { isNumber_default as isNumber } from '../../../chunk-FLYEIRFK.mjs';
|
|
3
3
|
import '../../../chunk-TESFJQID.mjs';
|
|
4
4
|
import '../../../chunk-G3S6ZNPF.mjs';
|
|
@@ -41,58 +41,3 @@ export declare const componentPreviewProductReferenceSchema: z.ZodObject<{
|
|
|
41
41
|
}>;
|
|
42
42
|
productId: z.ZodString;
|
|
43
43
|
}, z.core.$strict>;
|
|
44
|
-
export declare const componentPreviewPathSchema: z.ZodString;
|
|
45
|
-
export declare const componentPreviewSelectionSchema: z.ZodObject<{
|
|
46
|
-
siteId: z.ZodUUID;
|
|
47
|
-
componentPath: z.ZodString;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
export declare const componentPreviewComponentSchema: z.ZodObject<{
|
|
50
|
-
path: z.ZodString;
|
|
51
|
-
name: z.ZodString;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
export declare const componentPreviewUsageSchema: z.ZodObject<{
|
|
54
|
-
kind: z.ZodEnum<{
|
|
55
|
-
page: "page";
|
|
56
|
-
layout: "layout";
|
|
57
|
-
}>;
|
|
58
|
-
route: z.ZodString;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
export declare const componentPreviewIndexSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
61
|
-
status: z.ZodLiteral<"unavailable">;
|
|
62
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
-
status: z.ZodLiteral<"ready">;
|
|
64
|
-
components: z.ZodArray<z.ZodObject<{
|
|
65
|
-
path: z.ZodString;
|
|
66
|
-
name: z.ZodString;
|
|
67
|
-
}, z.core.$strip>>;
|
|
68
|
-
usagesByComponentPath: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
69
|
-
kind: z.ZodEnum<{
|
|
70
|
-
page: "page";
|
|
71
|
-
layout: "layout";
|
|
72
|
-
}>;
|
|
73
|
-
route: z.ZodString;
|
|
74
|
-
}, z.core.$strip>>>;
|
|
75
|
-
}, z.core.$strip>], "status">;
|
|
76
|
-
export declare const componentPreviewSourceFileSchema: z.ZodObject<{
|
|
77
|
-
path: z.ZodString;
|
|
78
|
-
content: z.ZodString;
|
|
79
|
-
}, z.core.$strip>;
|
|
80
|
-
export declare const componentPreviewSourceSchema: z.ZodObject<{
|
|
81
|
-
component: z.ZodObject<{
|
|
82
|
-
path: z.ZodString;
|
|
83
|
-
name: z.ZodString;
|
|
84
|
-
}, z.core.$strip>;
|
|
85
|
-
files: z.ZodArray<z.ZodObject<{
|
|
86
|
-
path: z.ZodString;
|
|
87
|
-
content: z.ZodString;
|
|
88
|
-
}, z.core.$strip>>;
|
|
89
|
-
revision: z.ZodString;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
export declare const componentPreviewPreparationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
-
status: z.ZodLiteral<"ready">;
|
|
93
|
-
pathname: z.ZodString;
|
|
94
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
-
status: z.ZodLiteral<"siteUpdateRequired">;
|
|
96
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
-
status: z.ZodLiteral<"invalidComponent">;
|
|
98
|
-
}, z.core.$strip>], "status">;
|
|
@@ -74,49 +74,5 @@ var componentPreviewProductReferenceSchema = z.object({
|
|
|
74
74
|
]),
|
|
75
75
|
productId: z.string().min(1)
|
|
76
76
|
}).strict().describe("ComponentPreviewProductReference");
|
|
77
|
-
var componentPreviewPathSchema = z.string().regex(
|
|
78
|
-
/^components\/[\w$.-]+\.tsx$/u,
|
|
79
|
-
"Component paths must be top-level TSX files in components/"
|
|
80
|
-
);
|
|
81
|
-
var componentPreviewSelectionSchema = z.object({
|
|
82
|
-
siteId: z.uuid(),
|
|
83
|
-
componentPath: componentPreviewPathSchema
|
|
84
|
-
});
|
|
85
|
-
var componentPreviewComponentSchema = z.object({
|
|
86
|
-
path: componentPreviewPathSchema,
|
|
87
|
-
name: z.string().min(1).max(120)
|
|
88
|
-
}).describe("ComponentPreviewComponent");
|
|
89
|
-
var componentPreviewUsageSchema = z.object({
|
|
90
|
-
kind: z.enum(["page", "layout"]),
|
|
91
|
-
route: z.string().min(1)
|
|
92
|
-
}).describe("ComponentPreviewUsage");
|
|
93
|
-
var componentPreviewIndexSchema = z.discriminatedUnion("status", [
|
|
94
|
-
z.object({ status: z.literal("unavailable") }),
|
|
95
|
-
z.object({
|
|
96
|
-
status: z.literal("ready"),
|
|
97
|
-
components: z.array(componentPreviewComponentSchema),
|
|
98
|
-
usagesByComponentPath: z.record(
|
|
99
|
-
componentPreviewPathSchema,
|
|
100
|
-
z.array(componentPreviewUsageSchema)
|
|
101
|
-
)
|
|
102
|
-
})
|
|
103
|
-
]).describe("ComponentPreviewIndex");
|
|
104
|
-
var componentPreviewSourceFileSchema = z.object({
|
|
105
|
-
path: z.string().min(1),
|
|
106
|
-
content: z.string()
|
|
107
|
-
}).describe("ComponentPreviewSourceFile");
|
|
108
|
-
var componentPreviewSourceSchema = z.object({
|
|
109
|
-
component: componentPreviewComponentSchema,
|
|
110
|
-
files: z.array(componentPreviewSourceFileSchema),
|
|
111
|
-
revision: z.string().min(1)
|
|
112
|
-
}).describe("ComponentPreviewSource");
|
|
113
|
-
var componentPreviewPreparationSchema = z.discriminatedUnion("status", [
|
|
114
|
-
z.object({
|
|
115
|
-
status: z.literal("ready"),
|
|
116
|
-
pathname: z.string().regex(/^\/[A-Za-z0-9/_-]+$/u)
|
|
117
|
-
}),
|
|
118
|
-
z.object({ status: z.literal("siteUpdateRequired") }),
|
|
119
|
-
z.object({ status: z.literal("invalidComponent") })
|
|
120
|
-
]).describe("ComponentPreviewPreparation");
|
|
121
77
|
|
|
122
|
-
export { COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_ID, COMPONENT_PREVIEW_IFRAME_RPC_CHANNEL_VERSION, COMPONENT_PREVIEW_PARENT_ORIGIN_PARAM, MAX_COMPONENT_PREVIEW_PROPS_BYTES,
|
|
78
|
+
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 };
|
|
@@ -341,6 +341,29 @@ export declare const siteFontsSnapshotSchema: z.ZodObject<{
|
|
|
341
341
|
}, z.core.$strip>>;
|
|
342
342
|
defaultRole: z.ZodNullable<z.ZodString>;
|
|
343
343
|
}, z.core.$strip>;
|
|
344
|
+
export declare const siteDesignLibraryStateSchema: z.ZodObject<{
|
|
345
|
+
siteId: z.ZodUUID;
|
|
346
|
+
globalsCss: z.ZodNullable<z.ZodObject<{
|
|
347
|
+
scopes: z.ZodArray<z.ZodObject<{
|
|
348
|
+
selector: z.ZodString;
|
|
349
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
350
|
+
name: z.ZodString;
|
|
351
|
+
value: z.ZodString;
|
|
352
|
+
}, z.core.$strip>>;
|
|
353
|
+
}, z.core.$strip>>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
fonts: z.ZodNullable<z.ZodObject<{
|
|
356
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
357
|
+
role: z.ZodString;
|
|
358
|
+
family: z.ZodNullable<z.ZodString>;
|
|
359
|
+
cssVar: z.ZodNullable<z.ZodString>;
|
|
360
|
+
rawValue: z.ZodString;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
defaultRole: z.ZodNullable<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>>;
|
|
364
|
+
isLoading: z.ZodBoolean;
|
|
365
|
+
error: z.ZodNullable<z.ZodString>;
|
|
366
|
+
}, z.core.$strip>;
|
|
344
367
|
export declare const DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE = "replo:design-library:applyOverrides";
|
|
345
368
|
export declare const designLibraryPreviewFontSchema: z.ZodObject<{
|
|
346
369
|
family: z.ZodString;
|
|
@@ -107,6 +107,13 @@ var siteFontsSnapshotSchema = z.object({
|
|
|
107
107
|
roles: z.array(siteFontRoleSchema),
|
|
108
108
|
defaultRole: z.string().nullable()
|
|
109
109
|
}).describe("SiteFontsSnapshot");
|
|
110
|
+
var siteDesignLibraryStateSchema = z.object({
|
|
111
|
+
siteId: z.uuid(),
|
|
112
|
+
globalsCss: globalsCssSnapshotSchema.nullable(),
|
|
113
|
+
fonts: siteFontsSnapshotSchema.nullable(),
|
|
114
|
+
isLoading: z.boolean(),
|
|
115
|
+
error: z.string().nullable()
|
|
116
|
+
}).describe("SiteDesignLibraryState");
|
|
110
117
|
var DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE = "replo:design-library:applyOverrides";
|
|
111
118
|
var designLibraryPreviewFontSchema = z.object({
|
|
112
119
|
family: z.string(),
|
|
@@ -121,4 +128,4 @@ var designLibraryPreviewMessageSchema = z.object({
|
|
|
121
128
|
defaultFontCssVar: z.string().nullable()
|
|
122
129
|
}).describe("DesignLibraryPreviewMessage");
|
|
123
130
|
|
|
124
|
-
export { DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE, designLibraryPreviewFontSchema, designLibraryPreviewMessageSchema, designLibrarySavedStyleMetadataSchema, designLibrarySavedStylesSchema, designLibrarySchema, globalsCssScopeSchema, globalsCssSnapshotSchema, globalsCssTokenSchema, savedColorStyleSchema, savedTextStyleSchema, siteFontRoleSchema, siteFontsSnapshotSchema };
|
|
131
|
+
export { DESIGN_LIBRARY_PREVIEW_MESSAGE_TYPE, designLibraryPreviewFontSchema, designLibraryPreviewMessageSchema, designLibrarySavedStyleMetadataSchema, designLibrarySavedStylesSchema, designLibrarySchema, globalsCssScopeSchema, globalsCssSnapshotSchema, globalsCssTokenSchema, savedColorStyleSchema, savedTextStyleSchema, siteDesignLibraryStateSchema, siteFontRoleSchema, siteFontsSnapshotSchema };
|
|
@@ -1,39 +1,5 @@
|
|
|
1
|
-
export type ComponentPreviewComponent = {
|
|
2
|
-
path: string;
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
1
|
export type ComponentPreviewProductReference = {
|
|
6
2
|
type: "product";
|
|
7
3
|
loaderKey: "shopify_storefront.product" | "replo_products.product";
|
|
8
4
|
productId: string;
|
|
9
5
|
};
|
|
10
|
-
export type ComponentPreviewIndex = {
|
|
11
|
-
status: "unavailable";
|
|
12
|
-
} | {
|
|
13
|
-
status: "ready";
|
|
14
|
-
components: ComponentPreviewComponent[];
|
|
15
|
-
usagesByComponentPath: {
|
|
16
|
-
[x: string]: ComponentPreviewUsage[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type ComponentPreviewUsage = {
|
|
20
|
-
kind: "page" | "layout";
|
|
21
|
-
route: string;
|
|
22
|
-
};
|
|
23
|
-
export type ComponentPreviewSourceFile = {
|
|
24
|
-
path: string;
|
|
25
|
-
content: string;
|
|
26
|
-
};
|
|
27
|
-
export type ComponentPreviewSource = {
|
|
28
|
-
component: ComponentPreviewComponent;
|
|
29
|
-
files: ComponentPreviewSourceFile[];
|
|
30
|
-
revision: string;
|
|
31
|
-
};
|
|
32
|
-
export type ComponentPreviewPreparation = {
|
|
33
|
-
status: "ready";
|
|
34
|
-
pathname: string;
|
|
35
|
-
} | {
|
|
36
|
-
status: "siteUpdateRequired";
|
|
37
|
-
} | {
|
|
38
|
-
status: "invalidComponent";
|
|
39
|
-
};
|
|
@@ -85,6 +85,10 @@ export type SelectModeImage = {
|
|
|
85
85
|
previewUrl: string | null;
|
|
86
86
|
sources: SelectModeImageSource[];
|
|
87
87
|
};
|
|
88
|
+
export type SelectModeVideo = {
|
|
89
|
+
src: string;
|
|
90
|
+
currentSrc: string;
|
|
91
|
+
};
|
|
88
92
|
export type SelectedElement = {
|
|
89
93
|
kind: "react-element";
|
|
90
94
|
selector: string;
|
|
@@ -99,7 +103,11 @@ export type SelectedElement = {
|
|
|
99
103
|
textMetrics: SelectModeTextMetrics | null;
|
|
100
104
|
outerHTML: string;
|
|
101
105
|
image?: SelectModeImage;
|
|
106
|
+
video?: SelectModeVideo;
|
|
102
107
|
definedStyles: SelectModeDefinedStyle[];
|
|
108
|
+
authoredStyles: {
|
|
109
|
+
[x: string]: string;
|
|
110
|
+
};
|
|
103
111
|
inheritedStyles: {
|
|
104
112
|
[x: string]: string;
|
|
105
113
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from '../../chunk-LIPH4O4F.mjs';
|
|
2
|
-
import { isNullish } from '../../chunk-
|
|
2
|
+
import { isNullish } from '../../chunk-PH3S6LJI.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
5
5
|
import '../../chunk-G3S6ZNPF.mjs';
|
|
@@ -136,6 +136,10 @@ export declare const selectModeImageSchema: z.ZodObject<{
|
|
|
136
136
|
previewUrl: z.ZodNullable<z.ZodString>;
|
|
137
137
|
}, z.core.$strip>>;
|
|
138
138
|
}, z.core.$strip>;
|
|
139
|
+
export declare const selectModeVideoSchema: z.ZodObject<{
|
|
140
|
+
src: z.ZodString;
|
|
141
|
+
currentSrc: z.ZodString;
|
|
142
|
+
}, z.core.$strip>;
|
|
139
143
|
export declare const selectedElementSchema: z.ZodObject<{
|
|
140
144
|
kind: z.ZodLiteral<"react-element">;
|
|
141
145
|
selector: z.ZodString;
|
|
@@ -176,6 +180,10 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
176
180
|
previewUrl: z.ZodNullable<z.ZodString>;
|
|
177
181
|
}, z.core.$strip>>;
|
|
178
182
|
}, z.core.$strip>>;
|
|
183
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
src: z.ZodString;
|
|
185
|
+
currentSrc: z.ZodString;
|
|
186
|
+
}, z.core.$strip>>;
|
|
179
187
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
180
188
|
property: z.ZodString;
|
|
181
189
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -189,6 +197,7 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
189
197
|
raw: z.ZodString;
|
|
190
198
|
resolved: z.ZodString;
|
|
191
199
|
}, z.core.$strip>>>;
|
|
200
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
192
201
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
193
202
|
clickPosition: z.ZodObject<{
|
|
194
203
|
x: z.ZodNumber;
|
|
@@ -278,6 +287,10 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
278
287
|
previewUrl: z.ZodNullable<z.ZodString>;
|
|
279
288
|
}, z.core.$strip>>;
|
|
280
289
|
}, z.core.$strip>>;
|
|
290
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
291
|
+
src: z.ZodString;
|
|
292
|
+
currentSrc: z.ZodString;
|
|
293
|
+
}, z.core.$strip>>;
|
|
281
294
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
282
295
|
property: z.ZodString;
|
|
283
296
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -291,6 +304,7 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
291
304
|
raw: z.ZodString;
|
|
292
305
|
resolved: z.ZodString;
|
|
293
306
|
}, z.core.$strip>>>;
|
|
307
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
294
308
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
295
309
|
clickPosition: z.ZodObject<{
|
|
296
310
|
x: z.ZodNumber;
|
|
@@ -411,8 +425,8 @@ export declare const selectModeFormatCommandSchema: z.ZodEnum<{
|
|
|
411
425
|
export declare const selectModeSelectionTypeSchema: z.ZodEnum<{
|
|
412
426
|
drag: "drag";
|
|
413
427
|
area: "area";
|
|
414
|
-
element: "element";
|
|
415
428
|
none: "none";
|
|
429
|
+
element: "element";
|
|
416
430
|
}>;
|
|
417
431
|
/**
|
|
418
432
|
* Parent-side selection state mirrored from messages the iframe posts
|
|
@@ -475,6 +489,10 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
475
489
|
previewUrl: z.ZodNullable<z.ZodString>;
|
|
476
490
|
}, z.core.$strip>>;
|
|
477
491
|
}, z.core.$strip>>;
|
|
492
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
493
|
+
src: z.ZodString;
|
|
494
|
+
currentSrc: z.ZodString;
|
|
495
|
+
}, z.core.$strip>>;
|
|
478
496
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
479
497
|
property: z.ZodString;
|
|
480
498
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -488,6 +506,7 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
488
506
|
raw: z.ZodString;
|
|
489
507
|
resolved: z.ZodString;
|
|
490
508
|
}, z.core.$strip>>>;
|
|
509
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
491
510
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
492
511
|
clickPosition: z.ZodObject<{
|
|
493
512
|
x: z.ZodNumber;
|
|
@@ -578,6 +597,10 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
578
597
|
previewUrl: z.ZodNullable<z.ZodString>;
|
|
579
598
|
}, z.core.$strip>>;
|
|
580
599
|
}, z.core.$strip>>;
|
|
600
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
601
|
+
src: z.ZodString;
|
|
602
|
+
currentSrc: z.ZodString;
|
|
603
|
+
}, z.core.$strip>>;
|
|
581
604
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
582
605
|
property: z.ZodString;
|
|
583
606
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -591,6 +614,7 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
591
614
|
raw: z.ZodString;
|
|
592
615
|
resolved: z.ZodString;
|
|
593
616
|
}, z.core.$strip>>>;
|
|
617
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
594
618
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
595
619
|
clickPosition: z.ZodObject<{
|
|
596
620
|
x: z.ZodNumber;
|
|
@@ -1,5 +1,5 @@
|
|
|
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, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-
|
|
2
|
-
import '../../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-KFJZ2OLV.mjs';
|
|
2
|
+
import '../../chunk-PH3S6LJI.mjs';
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
5
5
|
import '../../chunk-G3S6ZNPF.mjs';
|