@neta-art/cohub 6.0.0 → 7.0.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/README.md +6 -5
- package/dist/board/animation.d.ts +2 -1
- package/dist/board/animation.js +0 -1
- package/dist/board/core/connections.js +4 -4
- package/dist/board/core/export-plan.js +1 -1
- package/dist/board/core/shape-types.js +0 -1
- package/dist/board/index.d.ts +6 -5
- package/dist/board/index.js +7 -7
- package/dist/board/mutation.d.ts +2 -11
- package/dist/board/mutation.js +2 -56
- package/dist/board/render/renderers/text-card-renderer.js +1 -1
- package/dist/board/semantic-document.d.ts +30 -0
- package/dist/board/semantic-document.js +271 -0
- package/dist/board/semantic-mutation.d.ts +10 -0
- package/dist/board/semantic-mutation.js +203 -0
- package/dist/chunks/http.d.ts +15 -94
- package/dist/chunks/http.js +248 -1588
- package/dist/chunks/transport.js +1 -1
- package/dist/chunks/websocket.d.ts +3646 -3139
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1045 -195
- package/dist/protocol/dist/board-authoring.d.ts +1305 -1
- package/dist/protocol/dist/board-authoring.js +80 -6
- package/dist/protocol/dist/board-codec.d.ts +2 -2
- package/dist/protocol/dist/board-codec.js +19 -4
- package/dist/protocol/dist/board-composition.d.ts +126 -1
- package/dist/protocol/dist/board-composition.js +1 -9
- package/dist/protocol/dist/board-connection.d.ts +16 -16
- package/dist/protocol/dist/board-connection.js +16 -16
- package/dist/protocol/dist/board-document.d.ts +34 -3
- package/dist/protocol/dist/board-document.js +3 -1
- package/dist/protocol/dist/board-effect.d.ts +94 -0
- package/dist/protocol/dist/board-effect.js +53 -0
- package/dist/protocol/dist/board-json.js +16 -0
- package/dist/protocol/dist/board.d.ts +34 -164
- package/dist/protocol/dist/board.js +44 -45
- package/dist/protocol/dist/index.d.ts +7 -7
- package/dist/types.d.ts +3 -1
- package/package.json +1 -2
- package/dist/board/codec.d.ts +0 -27
- package/dist/board/codec.js +0 -277
- package/dist/protocol/dist/board-content.js +0 -26
- package/dist/protocol/dist/board-upgrade.d.ts +0 -1
- package/dist/protocol/dist/board-upgrade.js +0 -2
- package/dist/protocol/dist/identifiers.js +0 -10
- package/dist/protocol/dist/index.js +0 -19
- package/dist/protocol/dist/provenance.js +0 -15
- package/dist/protocol/dist/public-identifiers.js +0 -38
- package/dist/protocol/dist/realtime/board-awareness.js +0 -119
- package/dist/protocol/dist/ui-command.js +0 -2
- package/dist/protocol/dist/work-promotion-stats.js +0 -11
- package/dist/protocol/dist/work-surface.js +0 -2
- package/dist/protocol/dist/work-view-stats.js +0 -3
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { BOARD_ARROW_STROKE_SIZE, BOARD_CONNECTION_STROKE_SIZE } from "../board-constants.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region ../protocol/dist/realtime/board-awareness.js
|
|
4
|
-
const idSchema = z.string().min(1).max(160);
|
|
5
|
-
const finiteSchema = z.number().finite();
|
|
6
|
-
const BoardAwarenessPointSchema = z.object({
|
|
7
|
-
x: finiteSchema,
|
|
8
|
-
y: finiteSchema
|
|
9
|
-
});
|
|
10
|
-
const BoardAwarenessDrawPointSchema = BoardAwarenessPointSchema.extend({ p: finiteSchema.min(0).max(1) });
|
|
11
|
-
const BoardAwarenessFrameSchema = z.object({
|
|
12
|
-
x: finiteSchema,
|
|
13
|
-
y: finiteSchema,
|
|
14
|
-
width: finiteSchema.positive(),
|
|
15
|
-
height: finiteSchema.positive(),
|
|
16
|
-
rotation: finiteSchema
|
|
17
|
-
});
|
|
18
|
-
const BoardAwarenessNodePreviewSchema = z.object({
|
|
19
|
-
nodeId: idSchema,
|
|
20
|
-
frame: BoardAwarenessFrameSchema,
|
|
21
|
-
/** Live endpoints of a free arrow being dragged. */
|
|
22
|
-
arrow: z.object({
|
|
23
|
-
start: BoardAwarenessPointSchema,
|
|
24
|
-
end: BoardAwarenessPointSchema,
|
|
25
|
-
bend: finiteSchema
|
|
26
|
-
}).optional()
|
|
27
|
-
});
|
|
28
|
-
const BoardAwarenessStateUpdateSchema = z.object({
|
|
29
|
-
type: z.literal("state"),
|
|
30
|
-
client: z.object({ formFactor: z.enum(["desktop", "mobile"]) }).optional(),
|
|
31
|
-
cursor: BoardAwarenessPointSchema.extend({ pointerType: z.enum([
|
|
32
|
-
"mouse",
|
|
33
|
-
"pen",
|
|
34
|
-
"touch"
|
|
35
|
-
]) }).nullable(),
|
|
36
|
-
tool: z.string().min(1).max(40),
|
|
37
|
-
selection: z.object({
|
|
38
|
-
ids: z.array(idSchema).max(64),
|
|
39
|
-
count: z.number().int().nonnegative().max(5e4),
|
|
40
|
-
bounds: BoardAwarenessFrameSchema.nullable()
|
|
41
|
-
}),
|
|
42
|
-
editingId: idSchema.nullable()
|
|
43
|
-
});
|
|
44
|
-
const BoardAwarenessGestureSchema = z.discriminatedUnion("kind", [
|
|
45
|
-
z.object({
|
|
46
|
-
kind: z.literal("draw"),
|
|
47
|
-
id: idSchema,
|
|
48
|
-
nodeId: idSchema,
|
|
49
|
-
color: z.string().min(1).max(64),
|
|
50
|
-
size: finiteSchema.positive().max(256),
|
|
51
|
-
from: z.number().int().nonnegative().max(1e5),
|
|
52
|
-
points: z.array(BoardAwarenessDrawPointSchema).min(1).max(64)
|
|
53
|
-
}),
|
|
54
|
-
z.object({
|
|
55
|
-
kind: z.literal("arrow"),
|
|
56
|
-
id: idSchema,
|
|
57
|
-
nodeId: idSchema,
|
|
58
|
-
start: BoardAwarenessPointSchema,
|
|
59
|
-
current: BoardAwarenessPointSchema,
|
|
60
|
-
color: z.string().min(1).max(64),
|
|
61
|
-
size: finiteSchema.positive().max(256).default(BOARD_ARROW_STROKE_SIZE)
|
|
62
|
-
}),
|
|
63
|
-
z.object({
|
|
64
|
-
kind: z.literal("box"),
|
|
65
|
-
id: idSchema,
|
|
66
|
-
nodeId: idSchema,
|
|
67
|
-
shape: z.enum(["geo", "frame"]),
|
|
68
|
-
start: BoardAwarenessPointSchema,
|
|
69
|
-
current: BoardAwarenessPointSchema,
|
|
70
|
-
color: z.string().min(1).max(64),
|
|
71
|
-
geo: z.string().min(1).max(40)
|
|
72
|
-
}),
|
|
73
|
-
z.object({
|
|
74
|
-
kind: z.literal("connection"),
|
|
75
|
-
id: idSchema,
|
|
76
|
-
sourceNodeId: idSchema,
|
|
77
|
-
targetNodeId: idSchema.nullable(),
|
|
78
|
-
current: BoardAwarenessPointSchema,
|
|
79
|
-
color: z.string().min(1).max(64),
|
|
80
|
-
size: finiteSchema.positive().max(256).default(BOARD_CONNECTION_STROKE_SIZE)
|
|
81
|
-
}),
|
|
82
|
-
z.object({
|
|
83
|
-
kind: z.literal("transform"),
|
|
84
|
-
id: idSchema,
|
|
85
|
-
mode: z.enum([
|
|
86
|
-
"translate",
|
|
87
|
-
"resize",
|
|
88
|
-
"rotate",
|
|
89
|
-
"arrow",
|
|
90
|
-
"connection"
|
|
91
|
-
]),
|
|
92
|
-
nodes: z.array(BoardAwarenessNodePreviewSchema).max(64),
|
|
93
|
-
bounds: BoardAwarenessFrameSchema.nullable()
|
|
94
|
-
})
|
|
95
|
-
]);
|
|
96
|
-
const BoardAwarenessUpdateSchema = z.discriminatedUnion("type", [
|
|
97
|
-
BoardAwarenessStateUpdateSchema,
|
|
98
|
-
z.object({
|
|
99
|
-
type: z.literal("gesture"),
|
|
100
|
-
gesture: BoardAwarenessGestureSchema
|
|
101
|
-
}),
|
|
102
|
-
z.object({
|
|
103
|
-
type: z.literal("gesture.end"),
|
|
104
|
-
gestureId: idSchema,
|
|
105
|
-
resultingNodeIds: z.array(idSchema).max(64)
|
|
106
|
-
}),
|
|
107
|
-
z.object({
|
|
108
|
-
type: z.literal("gesture.cancel"),
|
|
109
|
-
gestureId: idSchema
|
|
110
|
-
})
|
|
111
|
-
]);
|
|
112
|
-
z.object({
|
|
113
|
-
spaceId: z.string().uuid(),
|
|
114
|
-
boardId: z.string().uuid(),
|
|
115
|
-
seq: z.number().int().nonnegative(),
|
|
116
|
-
update: BoardAwarenessUpdateSchema
|
|
117
|
-
});
|
|
118
|
-
//#endregion
|
|
119
|
-
export { BoardAwarenessDrawPointSchema, BoardAwarenessFrameSchema, BoardAwarenessGestureSchema, BoardAwarenessNodePreviewSchema, BoardAwarenessPointSchema, BoardAwarenessStateUpdateSchema, BoardAwarenessUpdateSchema };
|