@drawcall/design 0.7.0 → 0.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.
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/protocol.d.ts +41 -0
- package/dist/protocol.js +40 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export { frameCreationCapabilities, type FrameCreationCapability, type FrameCrea
|
|
|
5
5
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
6
6
|
export { parseFrameSize } from "./target.js";
|
|
7
7
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, type ProjectFrameLayout, type ProjectFrameRecord, type ProjectGltsFrameRecord, type ProjectImageFrameRecord, type ProjectMarketFile, type ProjectMarketFrameRecord, type ProjectPresenceClientMessage, type ProjectPresenceServerMessage, type ProjectState, } from "./project-state.js";
|
|
8
|
-
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraSetCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
8
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraSetCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type PosterRenderCommand, type PosterRenderResult, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
9
9
|
export type { BinaryFile, CameraPose, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, GenerateImageFrame, DesignFile, FileList, FileMutation, FrameExport, Frame, GltsFrame, GltsFrameExport, ImageFrame, ImageFrameExport, ImageGenerationOperation, ImageGenerationProvenance, ImageGenerationResult, MarketFrame, MarketFrameExport, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
|
package/dist/browser.js
CHANGED
|
@@ -5,4 +5,4 @@ export { frameCreationCapabilities, } from "./v1/capabilities.js";
|
|
|
5
5
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
6
6
|
export { parseFrameSize } from "./target.js";
|
|
7
7
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, } from "./project-state.js";
|
|
8
|
-
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
|
8
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -194,6 +194,42 @@ export declare const cameraCaptureResultSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
194
194
|
"runtime-unavailable": "runtime-unavailable";
|
|
195
195
|
}>;
|
|
196
196
|
}, z.core.$strict>], "type">;
|
|
197
|
+
export declare const posterMessageTypes: {
|
|
198
|
+
readonly failed: "drawcall:poster:failed";
|
|
199
|
+
readonly render: "drawcall:poster:render";
|
|
200
|
+
readonly rendered: "drawcall:poster:rendered";
|
|
201
|
+
};
|
|
202
|
+
export declare const posterRenderCommandSchema: z.ZodObject<{
|
|
203
|
+
type: z.ZodLiteral<"drawcall:poster:render">;
|
|
204
|
+
requestId: z.ZodString;
|
|
205
|
+
frameId: z.ZodString;
|
|
206
|
+
width: z.ZodNumber;
|
|
207
|
+
height: z.ZodNumber;
|
|
208
|
+
camera: z.ZodNullable<z.ZodObject<{
|
|
209
|
+
position: z.ZodObject<{
|
|
210
|
+
x: z.ZodNumber;
|
|
211
|
+
y: z.ZodNumber;
|
|
212
|
+
z: z.ZodNumber;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
quaternion: z.ZodObject<{
|
|
215
|
+
x: z.ZodNumber;
|
|
216
|
+
y: z.ZodNumber;
|
|
217
|
+
z: z.ZodNumber;
|
|
218
|
+
w: z.ZodNumber;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
export declare const posterRenderResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
223
|
+
requestId: z.ZodString;
|
|
224
|
+
sources: z.ZodArray<z.ZodString>;
|
|
225
|
+
type: z.ZodLiteral<"drawcall:poster:rendered">;
|
|
226
|
+
image: z.ZodCustom<Blob, Blob>;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
requestId: z.ZodString;
|
|
229
|
+
sources: z.ZodArray<z.ZodString>;
|
|
230
|
+
type: z.ZodLiteral<"drawcall:poster:failed">;
|
|
231
|
+
error: z.ZodString;
|
|
232
|
+
}, z.core.$strict>], "type">;
|
|
197
233
|
export declare const inspectionCommandSchema: z.ZodObject<{
|
|
198
234
|
type: z.ZodLiteral<"drawcall:inspection:set">;
|
|
199
235
|
requestId: z.ZodString;
|
|
@@ -215,6 +251,8 @@ export declare const inspectionFrameMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
215
251
|
type: z.ZodLiteral<"drawcall:inspection:focus">;
|
|
216
252
|
}, z.core.$strict>], "type">;
|
|
217
253
|
export type InspectionCommand = z.infer<typeof inspectionCommandSchema>;
|
|
254
|
+
export type PosterRenderCommand = z.infer<typeof posterRenderCommandSchema>;
|
|
255
|
+
export type PosterRenderResult = z.infer<typeof posterRenderResultSchema>;
|
|
218
256
|
export type ImmersiveMode = z.infer<typeof immersiveModeSchema>;
|
|
219
257
|
export type ImmersiveCommand = z.infer<typeof immersiveCommandSchema>;
|
|
220
258
|
export type ImmersiveFrameMessage = z.infer<typeof immersiveFrameMessageSchema>;
|
|
@@ -238,4 +276,7 @@ export type GltsExportParentMessage = z.infer<typeof gltsExportParentMessageSche
|
|
|
238
276
|
export type GltsExportResult = z.infer<typeof gltsExportResultSchema>;
|
|
239
277
|
export type GltsExportCancelledResult = z.infer<typeof gltsExportCancelledResultSchema>;
|
|
240
278
|
export type GltsExportFrameMessage = z.infer<typeof gltsExportFrameMessageSchema>;
|
|
279
|
+
/** The per-project page that renders frame posters; never a frame ID path. */
|
|
280
|
+
export declare const posterPagePath = "/poster/";
|
|
281
|
+
export declare function posterPageUrl(frameViewUrl: string): string;
|
|
241
282
|
export declare function projectSyncUrl(baseUrl: string, project: string): string;
|
package/dist/protocol.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { cameraPoseSchema, projectPathSchema } from "./v1/schemas.js";
|
|
2
|
+
import { cameraPoseSchema, designIdSchema, frameSizeSchema, projectPathSchema, } from "./v1/schemas.js";
|
|
3
3
|
export const inspectionMessageTypes = {
|
|
4
4
|
applied: "drawcall:inspection:applied",
|
|
5
5
|
exit: "drawcall:inspection:exit",
|
|
@@ -160,6 +160,40 @@ export const cameraCaptureResultSchema = z.discriminatedUnion("type", [
|
|
|
160
160
|
})
|
|
161
161
|
.strict(),
|
|
162
162
|
]);
|
|
163
|
+
export const posterMessageTypes = {
|
|
164
|
+
failed: "drawcall:poster:failed",
|
|
165
|
+
render: "drawcall:poster:render",
|
|
166
|
+
rendered: "drawcall:poster:rendered",
|
|
167
|
+
};
|
|
168
|
+
export const posterRenderCommandSchema = z
|
|
169
|
+
.object({
|
|
170
|
+
type: z.literal(posterMessageTypes.render),
|
|
171
|
+
requestId: z.string().min(1),
|
|
172
|
+
frameId: designIdSchema,
|
|
173
|
+
width: frameSizeSchema,
|
|
174
|
+
height: frameSizeSchema,
|
|
175
|
+
camera: cameraPoseSchema.nullable(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
const posterRenderResultBaseSchema = z.object({
|
|
179
|
+
requestId: z.string().min(1),
|
|
180
|
+
/** Paths the render fetched, as requested; not every import is a valid project path. */
|
|
181
|
+
sources: z.array(z.string().max(1_024)),
|
|
182
|
+
});
|
|
183
|
+
export const posterRenderResultSchema = z.discriminatedUnion("type", [
|
|
184
|
+
posterRenderResultBaseSchema
|
|
185
|
+
.extend({
|
|
186
|
+
type: z.literal(posterMessageTypes.rendered),
|
|
187
|
+
image: z.instanceof(Blob),
|
|
188
|
+
})
|
|
189
|
+
.strict(),
|
|
190
|
+
posterRenderResultBaseSchema
|
|
191
|
+
.extend({
|
|
192
|
+
type: z.literal(posterMessageTypes.failed),
|
|
193
|
+
error: z.string().min(1),
|
|
194
|
+
})
|
|
195
|
+
.strict(),
|
|
196
|
+
]);
|
|
163
197
|
export const inspectionCommandSchema = z
|
|
164
198
|
.object({
|
|
165
199
|
type: z.literal(inspectionMessageTypes.set),
|
|
@@ -181,6 +215,11 @@ export const inspectionFrameMessageSchema = z.discriminatedUnion("type", [
|
|
|
181
215
|
z.object({ type: z.literal(inspectionMessageTypes.exit) }).strict(),
|
|
182
216
|
z.object({ type: z.literal(inspectionMessageTypes.focus) }).strict(),
|
|
183
217
|
]);
|
|
218
|
+
/** The per-project page that renders frame posters; never a frame ID path. */
|
|
219
|
+
export const posterPagePath = "/poster/";
|
|
220
|
+
export function posterPageUrl(frameViewUrl) {
|
|
221
|
+
return new URL(posterPagePath, frameViewUrl).href;
|
|
222
|
+
}
|
|
184
223
|
export function projectSyncUrl(baseUrl, project) {
|
|
185
224
|
const url = new URL(`/api/v1/projects/${encodeURIComponent(project)}/sync`, baseUrl);
|
|
186
225
|
if (url.protocol === "https:")
|