@drawcall/design 0.12.1 → 0.12.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/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/protocol.d.ts +70 -0
- package/dist/protocol.js +97 -0
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { frameCreationCapabilities, type FrameCreationCapability, type FrameCrea
|
|
|
6
6
|
export { cameraPoseSchema, commentBodySchema, commentPositionInputSchema, commentPositionSchema, commentSchema, createCommentSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
7
7
|
export { parseFrameSize } from "./target.js";
|
|
8
8
|
export { projectFrameLayoutSchema, projectCommentsChangedServerMessageSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarkdownFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, type ProjectFrameLayout, type ProjectCommentsChangedServerMessage, type ProjectFrameRecord, type ProjectGltsFrameRecord, type ProjectImageFrameRecord, type ProjectMarkdownFrameRecord, type ProjectMarketFile, type ProjectMarketFrameRecord, type ProjectPresenceClientMessage, type ProjectPresenceServerMessage, type ProjectState, } from "./project-state.js";
|
|
9
|
-
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, commentActionMessageSchema, commentActionResultSchema, commentPickCommandSchema, commentPickResultSchema, commentRuntimeMessageTypes, commentSelectionMessageSchema, commentStateCommandSchema, frameNavigationMessageSchema, frameNavigationMessageTypes, frameRenderResultSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, previewConfigureCommandSchema, previewLoadCommandSchema, previewLoadResultSchema, previewMessageTypes, previewPagePath, previewPageUrl, previewPixelRatioMax, previewSessionEventSchema, 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 CommentActionMessage, type CommentActionResult, type CommentPickCommand, type CommentPickResult, type CommentSelectionMessage, type CommentStateCommand, type FrameRenderResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type PosterRenderCommand, type PosterRenderResult, type PreviewLoadCommand, type PreviewLoadResult, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
9
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, commentActionMessageSchema, commentActionResultSchema, commentPickCommandSchema, commentPickResultSchema, commentRuntimeMessageTypes, commentSelectionMessageSchema, commentStateCommandSchema, frameNavigationMessageSchema, frameNavigationMessageTypes, frameNavigationV2MessageSchema, frameNavigationV2MessageTypes, frameInteractionMessageSchema, frameInteractionMessageTypes, framePointerMessageSchema, framePointerMessageTypes, frameZoomMessageSchema, frameZoomMessageTypes, frameRenderResultSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, previewConfigureCommandSchema, previewLoadCommandSchema, previewLoadResultSchema, previewMessageTypes, previewPagePath, previewPageUrl, previewPixelRatioMax, previewSessionEventSchema, 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 CommentActionMessage, type CommentActionResult, type CommentPickCommand, type CommentPickResult, type CommentSelectionMessage, type CommentStateCommand, type FrameRenderResult, type FramePointerMessage, type FrameZoomMessage, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type PosterRenderCommand, type PosterRenderResult, type PreviewLoadCommand, type PreviewLoadResult, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
10
10
|
export type { BinaryFile, CameraPose, Comment, CommentAuthor, CommentPosition, CommentPositionInput, CommentReply, CommentResolution, CreateComment, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarkdownFrame, CreateMarketFrame, GenerateImage, GenerateImageUrl, DesignFile, FileList, FileMutation, FrameExport, Frame, GltsFrame, GltsFrameExport, ImageFrame, ImageFrameExport, ImageGenerationOperation, ImageGenerationProvenance, ImageGenerationResult, ImageInput, ImageInputProvenance, MarketFrame, MarketFrameExport, MarkdownFrame, MarkdownFrameExport, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
|
package/dist/browser.js
CHANGED
|
@@ -6,4 +6,4 @@ export { frameCreationCapabilities, } from "./v1/capabilities.js";
|
|
|
6
6
|
export { cameraPoseSchema, commentBodySchema, commentPositionInputSchema, commentPositionSchema, commentSchema, createCommentSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
7
7
|
export { parseFrameSize } from "./target.js";
|
|
8
8
|
export { projectFrameLayoutSchema, projectCommentsChangedServerMessageSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarkdownFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, } from "./project-state.js";
|
|
9
|
-
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, commentActionMessageSchema, commentActionResultSchema, commentPickCommandSchema, commentPickResultSchema, commentRuntimeMessageTypes, commentSelectionMessageSchema, commentStateCommandSchema, frameNavigationMessageSchema, frameNavigationMessageTypes, frameRenderResultSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, previewConfigureCommandSchema, previewLoadCommandSchema, previewLoadResultSchema, previewMessageTypes, previewPagePath, previewPageUrl, previewPixelRatioMax, previewSessionEventSchema, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
|
9
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, commentActionMessageSchema, commentActionResultSchema, commentPickCommandSchema, commentPickResultSchema, commentRuntimeMessageTypes, commentSelectionMessageSchema, commentStateCommandSchema, frameNavigationMessageSchema, frameNavigationMessageTypes, frameNavigationV2MessageSchema, frameNavigationV2MessageTypes, frameInteractionMessageSchema, frameInteractionMessageTypes, framePointerMessageSchema, framePointerMessageTypes, frameZoomMessageSchema, frameZoomMessageTypes, frameRenderResultSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, previewConfigureCommandSchema, previewLoadCommandSchema, previewLoadResultSchema, previewMessageTypes, previewPagePath, previewPageUrl, previewPixelRatioMax, previewSessionEventSchema, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -14,6 +14,74 @@ export declare const frameNavigationMessageSchema: z.ZodObject<{
|
|
|
14
14
|
type: z.ZodLiteral<"drawcall:frame:open">;
|
|
15
15
|
frameId: z.ZodString;
|
|
16
16
|
}, z.core.$strict>;
|
|
17
|
+
export declare const frameNavigationV2MessageTypes: {
|
|
18
|
+
readonly open: "drawcall:frame:open:v2";
|
|
19
|
+
};
|
|
20
|
+
export declare const frameNavigationV2MessageSchema: z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"drawcall:frame:open:v2">;
|
|
22
|
+
frameId: z.ZodString;
|
|
23
|
+
interactionToken: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export declare const frameInteractionMessageTypes: {
|
|
26
|
+
readonly exit: "drawcall:frame:interaction-exit";
|
|
27
|
+
};
|
|
28
|
+
export declare const frameInteractionMessageSchema: z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"drawcall:frame:interaction-exit">;
|
|
30
|
+
interactionToken: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export declare const framePointerMessageTypes: {
|
|
33
|
+
readonly pointer: "drawcall:frame:pointer";
|
|
34
|
+
};
|
|
35
|
+
export declare const framePointerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
|
+
type: z.ZodLiteral<"drawcall:frame:pointer">;
|
|
37
|
+
interactionToken: z.ZodString;
|
|
38
|
+
phase: z.ZodEnum<{
|
|
39
|
+
down: "down";
|
|
40
|
+
move: "move";
|
|
41
|
+
}>;
|
|
42
|
+
pointers: z.ZodArray<z.ZodObject<{
|
|
43
|
+
pointerId: z.ZodNumber;
|
|
44
|
+
clientX: z.ZodNumber;
|
|
45
|
+
clientY: z.ZodNumber;
|
|
46
|
+
screenX: z.ZodNumber;
|
|
47
|
+
screenY: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"drawcall:frame:pointer">;
|
|
51
|
+
interactionToken: z.ZodString;
|
|
52
|
+
phase: z.ZodLiteral<"end">;
|
|
53
|
+
pointerIds: z.ZodArray<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strict>], "phase">;
|
|
55
|
+
export declare const frameZoomMessageTypes: {
|
|
56
|
+
readonly zoom: "drawcall:frame:zoom";
|
|
57
|
+
};
|
|
58
|
+
export declare const frameZoomMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
59
|
+
clientX: z.ZodNumber;
|
|
60
|
+
clientY: z.ZodNumber;
|
|
61
|
+
type: z.ZodLiteral<"drawcall:frame:zoom">;
|
|
62
|
+
interactionToken: z.ZodString;
|
|
63
|
+
kind: z.ZodLiteral<"wheel">;
|
|
64
|
+
deltaY: z.ZodNumber;
|
|
65
|
+
deltaMode: z.ZodNumber;
|
|
66
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
67
|
+
screenX: z.ZodNumber;
|
|
68
|
+
screenY: z.ZodNumber;
|
|
69
|
+
clientX: z.ZodNumber;
|
|
70
|
+
clientY: z.ZodNumber;
|
|
71
|
+
type: z.ZodLiteral<"drawcall:frame:zoom">;
|
|
72
|
+
interactionToken: z.ZodString;
|
|
73
|
+
kind: z.ZodLiteral<"gesture">;
|
|
74
|
+
phase: z.ZodEnum<{
|
|
75
|
+
start: "start";
|
|
76
|
+
change: "change";
|
|
77
|
+
}>;
|
|
78
|
+
scale: z.ZodNumber;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"drawcall:frame:zoom">;
|
|
81
|
+
interactionToken: z.ZodString;
|
|
82
|
+
kind: z.ZodLiteral<"gesture">;
|
|
83
|
+
phase: z.ZodLiteral<"end">;
|
|
84
|
+
}, z.core.$strict>]>;
|
|
17
85
|
export declare const previewMessageTypes: {
|
|
18
86
|
readonly configure: "drawcall:preview:configure";
|
|
19
87
|
readonly failed: "drawcall:preview:failed";
|
|
@@ -419,6 +487,8 @@ export declare const inspectionFrameMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
419
487
|
type: z.ZodLiteral<"drawcall:inspection:exit">;
|
|
420
488
|
}, z.core.$strict>], "type">;
|
|
421
489
|
export type InspectionCommand = z.infer<typeof inspectionCommandSchema>;
|
|
490
|
+
export type FramePointerMessage = z.infer<typeof framePointerMessageSchema>;
|
|
491
|
+
export type FrameZoomMessage = z.infer<typeof frameZoomMessageSchema>;
|
|
422
492
|
export type PreviewLoadCommand = z.infer<typeof previewLoadCommandSchema>;
|
|
423
493
|
export type PreviewLoadResult = z.infer<typeof previewLoadResultSchema>;
|
|
424
494
|
export type PosterRenderCommand = z.infer<typeof posterRenderCommandSchema>;
|
package/dist/protocol.js
CHANGED
|
@@ -17,6 +17,103 @@ export const frameNavigationMessageSchema = z
|
|
|
17
17
|
frameId: designIdSchema,
|
|
18
18
|
})
|
|
19
19
|
.strict();
|
|
20
|
+
const frameInteractionTokenSchema = z.string().uuid();
|
|
21
|
+
export const frameNavigationV2MessageTypes = {
|
|
22
|
+
open: "drawcall:frame:open:v2",
|
|
23
|
+
};
|
|
24
|
+
export const frameNavigationV2MessageSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
type: z.literal(frameNavigationV2MessageTypes.open),
|
|
27
|
+
frameId: designIdSchema,
|
|
28
|
+
interactionToken: frameInteractionTokenSchema,
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
export const frameInteractionMessageTypes = {
|
|
32
|
+
exit: "drawcall:frame:interaction-exit",
|
|
33
|
+
};
|
|
34
|
+
export const frameInteractionMessageSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
type: z.literal(frameInteractionMessageTypes.exit),
|
|
37
|
+
interactionToken: frameInteractionTokenSchema,
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export const framePointerMessageTypes = {
|
|
41
|
+
pointer: "drawcall:frame:pointer",
|
|
42
|
+
};
|
|
43
|
+
const framePointerSampleSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
pointerId: z.number().int().nonnegative(),
|
|
46
|
+
clientX: z.number().finite(),
|
|
47
|
+
clientY: z.number().finite(),
|
|
48
|
+
screenX: z.number().finite(),
|
|
49
|
+
screenY: z.number().finite(),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
|
52
|
+
const framePointerSamplesMessageSchema = z
|
|
53
|
+
.object({
|
|
54
|
+
type: z.literal(framePointerMessageTypes.pointer),
|
|
55
|
+
interactionToken: frameInteractionTokenSchema,
|
|
56
|
+
phase: z.enum(["down", "move"]),
|
|
57
|
+
pointers: z.array(framePointerSampleSchema).min(1),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
const framePointerEndMessageSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
type: z.literal(framePointerMessageTypes.pointer),
|
|
63
|
+
interactionToken: frameInteractionTokenSchema,
|
|
64
|
+
phase: z.literal("end"),
|
|
65
|
+
pointerIds: z.array(z.number().int().nonnegative()).min(1),
|
|
66
|
+
})
|
|
67
|
+
.strict();
|
|
68
|
+
export const framePointerMessageSchema = z.discriminatedUnion("phase", [
|
|
69
|
+
framePointerSamplesMessageSchema,
|
|
70
|
+
framePointerEndMessageSchema,
|
|
71
|
+
]);
|
|
72
|
+
export const frameZoomMessageTypes = {
|
|
73
|
+
zoom: "drawcall:frame:zoom",
|
|
74
|
+
};
|
|
75
|
+
const frameZoomClientPointSchema = {
|
|
76
|
+
clientX: z.number().finite(),
|
|
77
|
+
clientY: z.number().finite(),
|
|
78
|
+
};
|
|
79
|
+
const frameZoomScreenPointSchema = {
|
|
80
|
+
...frameZoomClientPointSchema,
|
|
81
|
+
screenX: z.number().finite(),
|
|
82
|
+
screenY: z.number().finite(),
|
|
83
|
+
};
|
|
84
|
+
const frameWheelZoomMessageSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
type: z.literal(frameZoomMessageTypes.zoom),
|
|
87
|
+
interactionToken: frameInteractionTokenSchema,
|
|
88
|
+
kind: z.literal("wheel"),
|
|
89
|
+
deltaY: z.number().finite(),
|
|
90
|
+
deltaMode: z.number().int().min(0).max(2),
|
|
91
|
+
...frameZoomClientPointSchema,
|
|
92
|
+
})
|
|
93
|
+
.strict();
|
|
94
|
+
const frameGestureZoomSampleSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
type: z.literal(frameZoomMessageTypes.zoom),
|
|
97
|
+
interactionToken: frameInteractionTokenSchema,
|
|
98
|
+
kind: z.literal("gesture"),
|
|
99
|
+
phase: z.enum(["start", "change"]),
|
|
100
|
+
scale: z.number().finite().positive(),
|
|
101
|
+
...frameZoomScreenPointSchema,
|
|
102
|
+
})
|
|
103
|
+
.strict();
|
|
104
|
+
const frameGestureZoomEndSchema = z
|
|
105
|
+
.object({
|
|
106
|
+
type: z.literal(frameZoomMessageTypes.zoom),
|
|
107
|
+
interactionToken: frameInteractionTokenSchema,
|
|
108
|
+
kind: z.literal("gesture"),
|
|
109
|
+
phase: z.literal("end"),
|
|
110
|
+
})
|
|
111
|
+
.strict();
|
|
112
|
+
export const frameZoomMessageSchema = z.union([
|
|
113
|
+
frameWheelZoomMessageSchema,
|
|
114
|
+
frameGestureZoomSampleSchema,
|
|
115
|
+
frameGestureZoomEndSchema,
|
|
116
|
+
]);
|
|
20
117
|
export const previewMessageTypes = {
|
|
21
118
|
configure: "drawcall:preview:configure",
|
|
22
119
|
failed: "drawcall:preview:failed",
|