@oh-just-another/serialization 0.57.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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/deserialize.d.ts +29 -0
- package/dist/deserialize.d.ts.map +1 -0
- package/dist/deserialize.js +141 -0
- package/dist/deserialize.js.map +1 -0
- package/dist/files.d.ts +30 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +66 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations.d.ts +23 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +42 -0
- package/dist/migrations.js.map +1 -0
- package/dist/schema.d.ts +10565 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +300 -0
- package/dist/schema.js.map +1 -0
- package/dist/serialize.d.ts +16 -0
- package/dist/serialize.d.ts.map +1 -0
- package/dist/serialize.js +65 -0
- package/dist/serialize.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAyLjC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAII,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AACzD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAC3D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Wire format version. Bump on any breaking schema change; add a migration in
|
|
4
|
+
* `migrations.ts` that upgrades the older shape to the current one.
|
|
5
|
+
*/
|
|
6
|
+
export const CURRENT_VERSION = 1;
|
|
7
|
+
// --- Atoms ---
|
|
8
|
+
const Vec2Z = z.object({ x: z.number(), y: z.number() });
|
|
9
|
+
const BoundsZ = z.object({ x: z.number(), y: z.number(), width: z.number(), height: z.number() });
|
|
10
|
+
void BoundsZ;
|
|
11
|
+
const RoundnessZ = z
|
|
12
|
+
.object({
|
|
13
|
+
type: z.enum(["sharp", "round"]),
|
|
14
|
+
value: z.number().optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
const StyleZ = z
|
|
18
|
+
.object({
|
|
19
|
+
fill: z.string().optional(),
|
|
20
|
+
stroke: z.string().optional(),
|
|
21
|
+
strokeWidth: z.number().optional(),
|
|
22
|
+
opacity: z.number().optional(),
|
|
23
|
+
dashArray: z.array(z.number()).readonly().optional(),
|
|
24
|
+
lineCap: z.enum(["butt", "round", "square"]).optional(),
|
|
25
|
+
lineJoin: z.enum(["miter", "round", "bevel"]).optional(),
|
|
26
|
+
strokeAlign: z.enum(["center", "inside", "outside"]).optional(),
|
|
27
|
+
roundness: RoundnessZ.optional(),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
const TextStyleZ = StyleZ.extend({
|
|
31
|
+
textAlign: z.enum(["left", "center", "right"]).optional(),
|
|
32
|
+
textBaseline: z.enum(["top", "middle", "bottom"]).optional(),
|
|
33
|
+
fontWeight: z.enum(["normal", "bold"]).optional(),
|
|
34
|
+
fontStyle: z.enum(["normal", "italic"]).optional(),
|
|
35
|
+
textDecoration: z
|
|
36
|
+
.object({
|
|
37
|
+
underline: z.boolean().optional(),
|
|
38
|
+
strikethrough: z.boolean().optional(),
|
|
39
|
+
})
|
|
40
|
+
.strict()
|
|
41
|
+
.optional(),
|
|
42
|
+
}).strict();
|
|
43
|
+
const MetadataZ = z.record(z.string(), z.unknown()).optional();
|
|
44
|
+
// --- Anchors (referenced by both shapes and edges) ---
|
|
45
|
+
const NamedAnchorZ = z.string(); // open enum (StandardAnchor + custom)
|
|
46
|
+
const AnchorRefZ = z.discriminatedUnion("kind", [
|
|
47
|
+
z.object({ kind: z.literal("named"), name: NamedAnchorZ }).strict(),
|
|
48
|
+
z.object({ kind: z.literal("ratio"), position: Vec2Z }).strict(),
|
|
49
|
+
z.object({ kind: z.literal("absolute"), offset: Vec2Z }).strict(),
|
|
50
|
+
z
|
|
51
|
+
.object({ kind: z.literal("edge"), index: z.number().int().nonnegative(), t: z.number() })
|
|
52
|
+
.strict(),
|
|
53
|
+
]);
|
|
54
|
+
// --- Shapes ---
|
|
55
|
+
const ElementBaseZ = z.object({
|
|
56
|
+
id: z.string(),
|
|
57
|
+
layerId: z.string(),
|
|
58
|
+
position: Vec2Z,
|
|
59
|
+
rotation: z.number(),
|
|
60
|
+
scale: Vec2Z,
|
|
61
|
+
order: z.string(),
|
|
62
|
+
metadata: MetadataZ,
|
|
63
|
+
minWidth: z.number().optional(),
|
|
64
|
+
minHeight: z.number().optional(),
|
|
65
|
+
maxWidth: z.number().optional(),
|
|
66
|
+
maxHeight: z.number().optional(),
|
|
67
|
+
noFlip: z.boolean().optional(),
|
|
68
|
+
anchors: z.record(z.string(), AnchorRefZ).optional(),
|
|
69
|
+
parentId: z.string().optional(),
|
|
70
|
+
frameId: z.string().optional(),
|
|
71
|
+
href: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
const RectangleZ = ElementBaseZ.extend({
|
|
74
|
+
type: z.literal("rectangle"),
|
|
75
|
+
style: StyleZ,
|
|
76
|
+
width: z.number(),
|
|
77
|
+
height: z.number(),
|
|
78
|
+
}).strict();
|
|
79
|
+
const EllipseZ = ElementBaseZ.extend({
|
|
80
|
+
type: z.literal("ellipse"),
|
|
81
|
+
style: StyleZ,
|
|
82
|
+
width: z.number(),
|
|
83
|
+
height: z.number(),
|
|
84
|
+
}).strict();
|
|
85
|
+
const PolygonZ = ElementBaseZ.extend({
|
|
86
|
+
type: z.literal("polygon"),
|
|
87
|
+
style: StyleZ,
|
|
88
|
+
points: z.array(Vec2Z),
|
|
89
|
+
}).strict();
|
|
90
|
+
const PathCommandZ = z.discriminatedUnion("kind", [
|
|
91
|
+
z.object({ kind: z.literal("M"), to: Vec2Z }).strict(),
|
|
92
|
+
z.object({ kind: z.literal("L"), to: Vec2Z }).strict(),
|
|
93
|
+
z.object({ kind: z.literal("Q"), control: Vec2Z, to: Vec2Z }).strict(),
|
|
94
|
+
z.object({ kind: z.literal("C"), control1: Vec2Z, control2: Vec2Z, to: Vec2Z }).strict(),
|
|
95
|
+
z.object({ kind: z.literal("Z") }).strict(),
|
|
96
|
+
]);
|
|
97
|
+
const PathZ = ElementBaseZ.extend({
|
|
98
|
+
type: z.literal("path"),
|
|
99
|
+
style: StyleZ,
|
|
100
|
+
commands: z.array(PathCommandZ),
|
|
101
|
+
}).strict();
|
|
102
|
+
const TextZ = ElementBaseZ.extend({
|
|
103
|
+
type: z.literal("text"),
|
|
104
|
+
style: TextStyleZ,
|
|
105
|
+
text: z.string(),
|
|
106
|
+
fontFamily: z.string(),
|
|
107
|
+
fontSize: z.number(),
|
|
108
|
+
maxWidth: z.number().optional(),
|
|
109
|
+
}).strict();
|
|
110
|
+
const ImageZ = ElementBaseZ.extend({
|
|
111
|
+
type: z.literal("image"),
|
|
112
|
+
style: StyleZ,
|
|
113
|
+
src: z.string(),
|
|
114
|
+
width: z.number(),
|
|
115
|
+
height: z.number(),
|
|
116
|
+
// Points at a `Scene.files` BinaryFile entry. Set by `buildImageElement`
|
|
117
|
+
// on every insert.
|
|
118
|
+
fileId: z.string().optional(),
|
|
119
|
+
// Animated-content hints (gif / lottie / video).
|
|
120
|
+
animationKind: z.string().optional(),
|
|
121
|
+
animationData: z.unknown().optional(),
|
|
122
|
+
}).strict();
|
|
123
|
+
const TemplateInstanceZ = ElementBaseZ.extend({
|
|
124
|
+
type: z.literal("template"),
|
|
125
|
+
style: StyleZ.optional(),
|
|
126
|
+
templateId: z.string(),
|
|
127
|
+
data: z.record(z.string(), z.unknown()),
|
|
128
|
+
width: z.number(),
|
|
129
|
+
height: z.number(),
|
|
130
|
+
}).strict();
|
|
131
|
+
const GroupZ = ElementBaseZ.extend({
|
|
132
|
+
type: z.literal("group"),
|
|
133
|
+
style: StyleZ.optional(),
|
|
134
|
+
}).strict();
|
|
135
|
+
const BrushPointZ = z.object({ x: z.number(), y: z.number(), width: z.number() }).strict();
|
|
136
|
+
const BrushZ = ElementBaseZ.extend({
|
|
137
|
+
type: z.literal("brush"),
|
|
138
|
+
style: StyleZ,
|
|
139
|
+
points: z.array(BrushPointZ),
|
|
140
|
+
}).strict();
|
|
141
|
+
/**
|
|
142
|
+
* Unknown-shape escape hatch: plugins that register custom shape types may
|
|
143
|
+
* persist them. Accepts any object with the standard base fields plus a
|
|
144
|
+
* non-builtin `type`, and lets the bounder registry handle them at load time.
|
|
145
|
+
*/
|
|
146
|
+
const CustomElementZ = ElementBaseZ.extend({
|
|
147
|
+
type: z.string(),
|
|
148
|
+
style: StyleZ.optional(),
|
|
149
|
+
})
|
|
150
|
+
.passthrough()
|
|
151
|
+
.refine((s) => ![
|
|
152
|
+
"rectangle",
|
|
153
|
+
"ellipse",
|
|
154
|
+
"polygon",
|
|
155
|
+
"path",
|
|
156
|
+
"text",
|
|
157
|
+
"image",
|
|
158
|
+
"template",
|
|
159
|
+
"group",
|
|
160
|
+
"brush",
|
|
161
|
+
].includes(s.type), {
|
|
162
|
+
message: "Use the specific built-in schema for built-in shape types",
|
|
163
|
+
});
|
|
164
|
+
const ElementZ = z.union([
|
|
165
|
+
RectangleZ,
|
|
166
|
+
EllipseZ,
|
|
167
|
+
PolygonZ,
|
|
168
|
+
PathZ,
|
|
169
|
+
TextZ,
|
|
170
|
+
ImageZ,
|
|
171
|
+
TemplateInstanceZ,
|
|
172
|
+
GroupZ,
|
|
173
|
+
BrushZ,
|
|
174
|
+
CustomElementZ,
|
|
175
|
+
]);
|
|
176
|
+
// --- Links ---
|
|
177
|
+
const LinkEndpointZ = z.discriminatedUnion("kind", [
|
|
178
|
+
z.object({ kind: z.literal("point"), position: Vec2Z }).strict(),
|
|
179
|
+
z.object({ kind: z.literal("anchor"), elementId: z.string(), anchor: AnchorRefZ }).strict(),
|
|
180
|
+
z.object({ kind: z.literal("outline"), elementId: z.string(), ratio: z.number() }).strict(),
|
|
181
|
+
z.object({ kind: z.literal("floating"), elementId: z.string() }).strict(),
|
|
182
|
+
]);
|
|
183
|
+
const LinkRoutingZ = z.enum(["straight", "orthogonal", "bezier"]);
|
|
184
|
+
const ArrowheadStyleZ = z.enum([
|
|
185
|
+
"none",
|
|
186
|
+
"arrow",
|
|
187
|
+
"openArrow",
|
|
188
|
+
"roundedArrow",
|
|
189
|
+
"arcArrow",
|
|
190
|
+
"triangle",
|
|
191
|
+
"filledArrow",
|
|
192
|
+
"circle",
|
|
193
|
+
"filledCircle",
|
|
194
|
+
"diamond",
|
|
195
|
+
"rhombus",
|
|
196
|
+
"filledRhombus",
|
|
197
|
+
"erdOne",
|
|
198
|
+
"erdOnlyOne",
|
|
199
|
+
"erdMany",
|
|
200
|
+
"erdOneOrMany",
|
|
201
|
+
"erdZeroOrOne",
|
|
202
|
+
"erdZeroOrMany",
|
|
203
|
+
]);
|
|
204
|
+
const LinkArrowheadsZ = z
|
|
205
|
+
.object({
|
|
206
|
+
from: ArrowheadStyleZ.optional(),
|
|
207
|
+
to: ArrowheadStyleZ.optional(),
|
|
208
|
+
size: z.number().optional(),
|
|
209
|
+
})
|
|
210
|
+
.strict();
|
|
211
|
+
const LinkLabelZ = z
|
|
212
|
+
.object({
|
|
213
|
+
text: z.string(),
|
|
214
|
+
position: z.number().optional(),
|
|
215
|
+
fontSize: z.number().optional(),
|
|
216
|
+
fill: z.string().optional(),
|
|
217
|
+
background: z.string().optional(),
|
|
218
|
+
})
|
|
219
|
+
.strict();
|
|
220
|
+
const LinkZ = z
|
|
221
|
+
.object({
|
|
222
|
+
id: z.string(),
|
|
223
|
+
layerId: z.string(),
|
|
224
|
+
from: LinkEndpointZ,
|
|
225
|
+
to: LinkEndpointZ,
|
|
226
|
+
waypoints: z.array(Vec2Z).readonly().optional(),
|
|
227
|
+
routedPoints: z.array(Vec2Z).readonly().optional(),
|
|
228
|
+
fixedSegments: z
|
|
229
|
+
.array(z.object({ axis: z.enum(["h", "v"]), pos: z.number(), at: z.number() }).strict())
|
|
230
|
+
.readonly()
|
|
231
|
+
.optional(),
|
|
232
|
+
routing: LinkRoutingZ.optional(),
|
|
233
|
+
avoidObstacles: z.boolean().optional(),
|
|
234
|
+
arrowheads: LinkArrowheadsZ.optional(),
|
|
235
|
+
label: LinkLabelZ.optional(),
|
|
236
|
+
order: z.string(),
|
|
237
|
+
style: StyleZ,
|
|
238
|
+
metadata: MetadataZ,
|
|
239
|
+
})
|
|
240
|
+
.strict();
|
|
241
|
+
// --- Layers ---
|
|
242
|
+
const LayerZ = z
|
|
243
|
+
.object({
|
|
244
|
+
id: z.string(),
|
|
245
|
+
name: z.string(),
|
|
246
|
+
visible: z.boolean(),
|
|
247
|
+
locked: z.boolean(),
|
|
248
|
+
order: z.string(),
|
|
249
|
+
})
|
|
250
|
+
.strict();
|
|
251
|
+
// --- Viewport ---
|
|
252
|
+
const ViewportZ = z
|
|
253
|
+
.object({
|
|
254
|
+
pan: Vec2Z,
|
|
255
|
+
zoom: z.number(),
|
|
256
|
+
rotation: z.number(),
|
|
257
|
+
size: z.object({ width: z.number(), height: z.number() }).strict(),
|
|
258
|
+
gridSize: z.number().optional(),
|
|
259
|
+
gridStyle: z.enum(["lines", "dots"]).optional(),
|
|
260
|
+
snapToGrid: z.boolean().optional(),
|
|
261
|
+
})
|
|
262
|
+
.strict();
|
|
263
|
+
// --- Annotations ---
|
|
264
|
+
const CommentZ = z
|
|
265
|
+
.object({
|
|
266
|
+
id: z.string(),
|
|
267
|
+
authorId: z.string(),
|
|
268
|
+
authorName: z.string(),
|
|
269
|
+
body: z.string(),
|
|
270
|
+
createdAt: z.string(),
|
|
271
|
+
})
|
|
272
|
+
.strict();
|
|
273
|
+
const AnnotationZ = z
|
|
274
|
+
.object({
|
|
275
|
+
id: z.string(),
|
|
276
|
+
elementId: z.string().nullable(),
|
|
277
|
+
position: Vec2Z,
|
|
278
|
+
resolved: z.boolean(),
|
|
279
|
+
thread: z.array(CommentZ),
|
|
280
|
+
createdAt: z.string(),
|
|
281
|
+
})
|
|
282
|
+
.strict();
|
|
283
|
+
// --- Document ---
|
|
284
|
+
export const SceneDocumentZ = z
|
|
285
|
+
.object({
|
|
286
|
+
/** Magic to make a `.json` file recognisable without sniffing. */
|
|
287
|
+
format: z.literal("oh-just-another/scene"),
|
|
288
|
+
version: z.number().int().nonnegative(),
|
|
289
|
+
elements: z.array(ElementZ),
|
|
290
|
+
links: z.array(LinkZ),
|
|
291
|
+
layers: z.array(LayerZ),
|
|
292
|
+
/**
|
|
293
|
+
* Threaded comments. Optional for backwards compatibility — documents
|
|
294
|
+
* without an `annotations` field deserialize as an empty thread list.
|
|
295
|
+
*/
|
|
296
|
+
annotations: z.array(AnnotationZ).optional(),
|
|
297
|
+
viewport: ViewportZ,
|
|
298
|
+
})
|
|
299
|
+
.strict();
|
|
300
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC,gBAAgB;AAEhB,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACzD,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAClG,KAAK,OAAO,CAAC;AAEb,MAAM,UAAU,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IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACvC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,SAAS;CACpB,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Scene } from "@oh-just-another/scene";
|
|
2
|
+
import { type SceneDocument } from "./schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* Convert an in-memory `Scene` into a plain JSON-ready document. The result is
|
|
5
|
+
* deterministic for a given scene — Map iteration order follows insertion
|
|
6
|
+
* order and is not sorted.
|
|
7
|
+
*
|
|
8
|
+
* Pure: doesn't read or write any global state.
|
|
9
|
+
*/
|
|
10
|
+
export declare const serializeScene: (scene: Scene) => SceneDocument;
|
|
11
|
+
/**
|
|
12
|
+
* Stringify a scene. Convenience for `JSON.stringify(serializeScene(s))` with
|
|
13
|
+
* optional 2-space indent for human-readable output.
|
|
14
|
+
*/
|
|
15
|
+
export declare const stringifyScene: (scene: Scene, indent?: number | null) => string;
|
|
16
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,aAgB7C,CAAC;AAyCF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,SAAQ,MAAM,GAAG,IAAW,KAAG,MACV,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CURRENT_VERSION } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Convert an in-memory `Scene` into a plain JSON-ready document. The result is
|
|
4
|
+
* deterministic for a given scene — Map iteration order follows insertion
|
|
5
|
+
* order and is not sorted.
|
|
6
|
+
*
|
|
7
|
+
* Pure: doesn't read or write any global state.
|
|
8
|
+
*/
|
|
9
|
+
export const serializeScene = (scene) => {
|
|
10
|
+
const annotations = scene.annotations.size > 0
|
|
11
|
+
? [...scene.annotations.values()]
|
|
12
|
+
: undefined;
|
|
13
|
+
const doc = {
|
|
14
|
+
format: "oh-just-another/scene",
|
|
15
|
+
version: CURRENT_VERSION,
|
|
16
|
+
elements: [...scene.elements.values()].map(stripTransientMetadata),
|
|
17
|
+
links: [...scene.links.values()],
|
|
18
|
+
layers: [...scene.layers.values()],
|
|
19
|
+
viewport: scene.viewport,
|
|
20
|
+
};
|
|
21
|
+
// Omit `annotations` for empty collections.
|
|
22
|
+
if (annotations)
|
|
23
|
+
doc.annotations = annotations;
|
|
24
|
+
return doc;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Drop transient, non-JSON-able fields from `shape.metadata` before
|
|
28
|
+
* serialisation. `metadata.image` holds a live `<img>` / `<video>` DOM element
|
|
29
|
+
* (attached by the image file-drop handler so the renderer can `drawImage` it
|
|
30
|
+
* directly); `JSON.stringify` would turn it into an empty object that throws
|
|
31
|
+
* inside `ctx.drawImage` / `gl.texImage2D` on reload. On reload the renderer
|
|
32
|
+
* falls back to `src` / `fileId`.
|
|
33
|
+
*
|
|
34
|
+
* `animationData` holds the raw GIF `ArrayBuffer`; the bytes live in
|
|
35
|
+
* `Scene.files` (via `fileId`) and the editor rehydrates animationData from
|
|
36
|
+
* there on load.
|
|
37
|
+
*
|
|
38
|
+
* Returns the shape unchanged when there's nothing transient to drop, so
|
|
39
|
+
* non-image shapes pay no allocation.
|
|
40
|
+
*/
|
|
41
|
+
const stripTransientMetadata = (shape) => {
|
|
42
|
+
const md = shape.metadata;
|
|
43
|
+
const hasTransientMeta = md && "image" in md;
|
|
44
|
+
const hasTransientAnim = shape.animationData !== undefined;
|
|
45
|
+
if (!hasTransientMeta && !hasTransientAnim)
|
|
46
|
+
return shape;
|
|
47
|
+
const next = { ...shape };
|
|
48
|
+
if (hasTransientMeta) {
|
|
49
|
+
const { image: _image, ...rest } = md;
|
|
50
|
+
void _image;
|
|
51
|
+
if (Object.keys(rest).length > 0)
|
|
52
|
+
next.metadata = rest;
|
|
53
|
+
else
|
|
54
|
+
delete next.metadata;
|
|
55
|
+
}
|
|
56
|
+
if (hasTransientAnim)
|
|
57
|
+
delete next.animationData;
|
|
58
|
+
return next;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Stringify a scene. Convenience for `JSON.stringify(serializeScene(s))` with
|
|
62
|
+
* optional 2-space indent for human-readable output.
|
|
63
|
+
*/
|
|
64
|
+
export const stringifyScene = (scene, indent = null) => JSON.stringify(serializeScene(scene), null, indent ?? undefined);
|
|
65
|
+
//# sourceMappingURL=serialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAsB,MAAM,aAAa,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAiB,EAAE;IAC5D,MAAM,WAAW,GACf,KAAK,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC;QACxB,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAA0D;QAC3F,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,GAAG,GAAkB;QACzB,MAAM,EAAE,uBAA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AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,SAAwB,IAAI,EAAU,EAAE,CACnF,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,SAAS,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oh-just-another/serialization",
|
|
3
|
+
"version": "0.57.0",
|
|
4
|
+
"description": "serialization package",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Rustam Garifulin <rustam@n69.in>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/oh-just-another/diagram.git",
|
|
10
|
+
"directory": "packages/serialization"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/oh-just-another/diagram#readme",
|
|
13
|
+
"bugs": "https://github.com/oh-just-another/diagram/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"diagram",
|
|
16
|
+
"canvas",
|
|
17
|
+
"svg",
|
|
18
|
+
"editor",
|
|
19
|
+
"graph",
|
|
20
|
+
"drawing"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"CHANGELOG.md"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"fractional-keys": "^0.1.1",
|
|
43
|
+
"zod": "^3.24.1",
|
|
44
|
+
"@oh-just-another/types": "0.57.0",
|
|
45
|
+
"@oh-just-another/scene": "0.57.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -b tsconfig.build.json",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"lint": "eslint src tests",
|
|
53
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
54
|
+
}
|
|
55
|
+
}
|