@snowcone-app/design 0.2.0 → 0.2.1
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 +6 -0
- package/README.md +20 -0
- package/package.json +1 -1
- package/dist/schema-DUi9j28q.d.cts +0 -496
- package/dist/schema-DUi9j28q.d.ts +0 -496
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @snowcone-app/design
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#6907](https://github.com/snowcone-app/snowcone-monorepo/pull/6907) [`67cba14`](https://github.com/snowcone-app/snowcone-monorepo/commit/67cba1442f5ff6a3b036038f8755c2a1463a11ca) Thanks [@kevinsproles](https://github.com/kevinsproles)! - The README documents the two formats the server reads (`SavedDesignSchema`, `RenderWireSchema`) and the `@snowcone-app/design/wire` conversion between them.
|
|
8
|
+
|
|
3
9
|
## 0.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -12,6 +12,26 @@ const design = assertDesign(json); // throws E_DESIGN_INVALID with every path, t
|
|
|
12
12
|
const current = migrateDesign(json); // reads older formats; E_DESIGN_VERSION for a version it can't read
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## The formats the server reads
|
|
16
|
+
|
|
17
|
+
The server reads two shapes, and their element schemas are shared:
|
|
18
|
+
|
|
19
|
+
- **`SavedDesignSchema`** is a saved design: what the editor emits as you edit, and what a design stores. It holds one
|
|
20
|
+
list of elements, each tagged with the name of the artboard (placement) it is on.
|
|
21
|
+
- **`RenderWireSchema`** is the render wire: what the render server draws (`{ schemaVersion, artboards: [{ …, elements }] }`).
|
|
22
|
+
Each placement carries only its own elements, hidden layers are left out, and images are flattened.
|
|
23
|
+
|
|
24
|
+
`@snowcone-app/design/wire` holds the one conversion between them, with no zod:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { toRenderWire } from "@snowcone-app/design/wire";
|
|
28
|
+
|
|
29
|
+
const wire = toRenderWire(savedDesign); // the same conversion the editor and the render server run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`CanvasStateV1Schema` (the `version: 1` document `@snowcone-app/canvas` `serializeState` writes) is validated by
|
|
33
|
+
`validateDesign`.
|
|
34
|
+
|
|
15
35
|
## Versions
|
|
16
36
|
|
|
17
37
|
The format has a major `version` (1 today, `DESIGN_VERSION`). Within a major, changes are additive only: a new
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowcone-app/design",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The Snowcone design format: the versioned JSON every editor writes and the server reads. Zod schemas, validateDesign(), migrateDesign(), typed errors, and a conformance kit of golden designs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"snowcone",
|
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The design format: the JSON every Snowcone editor writes and the server reads (ADR-0115 part 1). Zod schemas for
|
|
5
|
-
* every artboard, element type and effect, and the types inferred from them. Moved out of `@snowcone-app/canvas`
|
|
6
|
-
* (`state/CanvasStateV1.ts`) unchanged: a saved design that validated there validates here, byte for byte.
|
|
7
|
-
*
|
|
8
|
-
* Version 1. Within a major only additive changes (a new optional field, a new element type the server renders); a
|
|
9
|
-
* breaking change is a new major with a migration (`migrateDesign`), and the server accepts the current major and the
|
|
10
|
-
* one before it.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A custom (brand) font a design depends on: `{ family, url }` of a host-stored font binary plus optional
|
|
15
|
-
* weight/style descriptors (`customFonts` on the design).
|
|
16
|
-
*/
|
|
17
|
-
interface CustomFont {
|
|
18
|
-
/** Family name, registered as-is (a family that collides with a Google Fonts family shadows it). */
|
|
19
|
-
family: string;
|
|
20
|
-
/** Host-stored font binary URL (must allow cross-origin GET). */
|
|
21
|
-
url: string;
|
|
22
|
-
/** CSS font-weight the file provides. Defaults to 400. */
|
|
23
|
-
weight?: number;
|
|
24
|
-
/** CSS font-style the file provides. Defaults to 'normal'. */
|
|
25
|
-
style?: "normal" | "italic";
|
|
26
|
-
}
|
|
27
|
-
declare const PointSchema: z.ZodObject<{
|
|
28
|
-
x: z.ZodNumber;
|
|
29
|
-
y: z.ZodNumber;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
declare const StrokeConfigSchema: z.ZodObject<{
|
|
32
|
-
enabled: z.ZodBoolean;
|
|
33
|
-
color: z.ZodString;
|
|
34
|
-
width: z.ZodNumber;
|
|
35
|
-
dashArray: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
36
|
-
lineCap: z.ZodOptional<z.ZodEnum<{
|
|
37
|
-
butt: "butt";
|
|
38
|
-
round: "round";
|
|
39
|
-
square: "square";
|
|
40
|
-
}>>;
|
|
41
|
-
lineJoin: z.ZodOptional<z.ZodEnum<{
|
|
42
|
-
round: "round";
|
|
43
|
-
miter: "miter";
|
|
44
|
-
bevel: "bevel";
|
|
45
|
-
}>>;
|
|
46
|
-
miterLimit: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
feather: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
declare const ShadowConfigSchema: z.ZodObject<{
|
|
51
|
-
enabled: z.ZodBoolean;
|
|
52
|
-
color: z.ZodString;
|
|
53
|
-
blur: z.ZodNumber;
|
|
54
|
-
offsetX: z.ZodNumber;
|
|
55
|
-
offsetY: z.ZodNumber;
|
|
56
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
declare const KnockoutConfigSchema: z.ZodObject<{
|
|
59
|
-
fill: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
stroke: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
group: "group";
|
|
63
|
-
artboard: "artboard";
|
|
64
|
-
}>>;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
declare const DistressEffectSchema: z.ZodObject<{
|
|
67
|
-
enabled: z.ZodBoolean;
|
|
68
|
-
style: z.ZodEnum<{
|
|
69
|
-
custom: "custom";
|
|
70
|
-
worn: "worn";
|
|
71
|
-
cracked: "cracked";
|
|
72
|
-
grunge: "grunge";
|
|
73
|
-
retro: "retro";
|
|
74
|
-
}>;
|
|
75
|
-
intensity: z.ZodNumber;
|
|
76
|
-
fadeAmount: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
grainAmount: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
scratchAmount: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
edgeWear: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
textureUrl: z.ZodOptional<z.ZodString>;
|
|
81
|
-
textureOpacity: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
textureBlendMode: z.ZodOptional<z.ZodEnum<{
|
|
83
|
-
multiply: "multiply";
|
|
84
|
-
screen: "screen";
|
|
85
|
-
overlay: "overlay";
|
|
86
|
-
}>>;
|
|
87
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
declare const MaskDefinitionSchema: z.ZodObject<{
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
type: z.ZodEnum<{
|
|
92
|
-
clip: "clip";
|
|
93
|
-
alpha: "alpha";
|
|
94
|
-
luma: "luma";
|
|
95
|
-
distress: "distress";
|
|
96
|
-
}>;
|
|
97
|
-
maskElement: z.ZodLazy<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
98
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
-
feather: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
blendMode: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip>;
|
|
103
|
-
declare const CharacterStyleSchema: z.ZodObject<{
|
|
104
|
-
color: z.ZodOptional<z.ZodString>;
|
|
105
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
106
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
107
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
declare const TextSpanSchema: z.ZodObject<{
|
|
114
|
-
text: z.ZodString;
|
|
115
|
-
style: z.ZodObject<{
|
|
116
|
-
color: z.ZodOptional<z.ZodString>;
|
|
117
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
118
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
119
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
}, z.core.$strip>;
|
|
126
|
-
declare const RichTextSchema: z.ZodObject<{
|
|
127
|
-
spans: z.ZodArray<z.ZodObject<{
|
|
128
|
-
text: z.ZodString;
|
|
129
|
-
style: z.ZodObject<{
|
|
130
|
-
color: z.ZodOptional<z.ZodString>;
|
|
131
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
132
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
133
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
138
|
-
}, z.core.$strip>;
|
|
139
|
-
}, z.core.$strip>>;
|
|
140
|
-
}, z.core.$strip>;
|
|
141
|
-
declare const GlyphOverrideSchema: z.ZodObject<{
|
|
142
|
-
charIndex: z.ZodNumber;
|
|
143
|
-
glyphIndex: z.ZodNumber;
|
|
144
|
-
unicode: z.ZodString;
|
|
145
|
-
alternateName: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
declare const OpenTypeFeaturesSchema: z.ZodObject<{
|
|
148
|
-
liga: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
-
dlig: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
-
calt: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
-
swsh: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
-
smcp: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
-
c2sc: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
-
onum: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
-
lnum: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
-
tnum: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
-
pnum: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
-
ss01: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
-
ss02: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
-
ss03: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
-
ss04: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
-
ss05: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
-
ss06: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
-
ss07: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
-
ss08: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
-
ss09: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
-
ss10: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
-
ss11: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
-
ss12: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
-
ss13: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
-
ss14: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
-
ss15: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
-
ss16: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
-
ss17: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
-
ss18: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
ss19: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
-
ss20: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
-
cv01: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
-
cv02: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
-
cv03: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
-
cv04: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
-
cv05: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
-
ccmp: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
-
locl: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
-
kern: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
-
mark: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
-
mkmk: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
-
}, z.core.$strip>;
|
|
189
|
-
declare const AnyTransformDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
190
|
-
type: z.ZodLiteral<"custom">;
|
|
191
|
-
controlPoints: z.ZodArray<z.ZodObject<{
|
|
192
|
-
x: z.ZodNumber;
|
|
193
|
-
y: z.ZodNumber;
|
|
194
|
-
}, z.core.$strip>>;
|
|
195
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
196
|
-
type: z.ZodLiteral<"distort">;
|
|
197
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
198
|
-
type: z.ZodLiteral<"circle">;
|
|
199
|
-
radius: z.ZodNumber;
|
|
200
|
-
scale: z.ZodNumber;
|
|
201
|
-
reverse: z.ZodBoolean;
|
|
202
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
203
|
-
type: z.ZodLiteral<"lean">;
|
|
204
|
-
leanAmount: z.ZodNumber;
|
|
205
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
206
|
-
type: z.ZodLiteral<"arch">;
|
|
207
|
-
archHeight: z.ZodNumber;
|
|
208
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
209
|
-
type: z.ZodLiteral<"ascend">;
|
|
210
|
-
ascendAngle: z.ZodNumber;
|
|
211
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
212
|
-
type: z.ZodLiteral<"wave">;
|
|
213
|
-
amplitude: z.ZodNumber;
|
|
214
|
-
frequency: z.ZodNumber;
|
|
215
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
216
|
-
type: z.ZodLiteral<"flag">;
|
|
217
|
-
amplitude: z.ZodNumber;
|
|
218
|
-
frequency: z.ZodNumber;
|
|
219
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
220
|
-
type: z.ZodLiteral<"image">;
|
|
221
|
-
width: z.ZodNumber;
|
|
222
|
-
height: z.ZodNumber;
|
|
223
|
-
cropX: z.ZodNumber;
|
|
224
|
-
cropY: z.ZodNumber;
|
|
225
|
-
cropWidth: z.ZodNumber;
|
|
226
|
-
cropHeight: z.ZodNumber;
|
|
227
|
-
flipHorizontal: z.ZodBoolean;
|
|
228
|
-
flipVertical: z.ZodBoolean;
|
|
229
|
-
borderRadius: z.ZodNumber;
|
|
230
|
-
maskedCrop: z.ZodOptional<z.ZodLiteral<"frame">>;
|
|
231
|
-
engrave: z.ZodOptional<z.ZodObject<{
|
|
232
|
-
style: z.ZodEnum<{
|
|
233
|
-
photo: "photo";
|
|
234
|
-
drawing: "drawing";
|
|
235
|
-
solid: "solid";
|
|
236
|
-
original: "original";
|
|
237
|
-
}>;
|
|
238
|
-
amount: z.ZodNumber;
|
|
239
|
-
invert: z.ZodBoolean;
|
|
240
|
-
sourceUrl: z.ZodString;
|
|
241
|
-
cutLight: z.ZodBoolean;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
|
-
adjustments: z.ZodOptional<z.ZodObject<{
|
|
244
|
-
brightness: z.ZodNumber;
|
|
245
|
-
contrast: z.ZodNumber;
|
|
246
|
-
saturation: z.ZodNumber;
|
|
247
|
-
}, z.core.$strip>>;
|
|
248
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
-
type: z.ZodLiteral<"group">;
|
|
250
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
-
type: z.ZodLiteral<"shape">;
|
|
252
|
-
shapeType: z.ZodEnum<{
|
|
253
|
-
circle: "circle";
|
|
254
|
-
rectangle: "rectangle";
|
|
255
|
-
ellipse: "ellipse";
|
|
256
|
-
triangle: "triangle";
|
|
257
|
-
polygon: "polygon";
|
|
258
|
-
star: "star";
|
|
259
|
-
line: "line";
|
|
260
|
-
}>;
|
|
261
|
-
width: z.ZodNumber;
|
|
262
|
-
height: z.ZodNumber;
|
|
263
|
-
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
264
|
-
radiusX: z.ZodOptional<z.ZodNumber>;
|
|
265
|
-
radiusY: z.ZodOptional<z.ZodNumber>;
|
|
266
|
-
sides: z.ZodOptional<z.ZodNumber>;
|
|
267
|
-
points: z.ZodOptional<z.ZodNumber>;
|
|
268
|
-
innerRadius: z.ZodOptional<z.ZodNumber>;
|
|
269
|
-
fillColor: z.ZodOptional<z.ZodString>;
|
|
270
|
-
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
271
|
-
fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
272
|
-
type: z.ZodLiteral<"solid">;
|
|
273
|
-
color: z.ZodString;
|
|
274
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
275
|
-
type: z.ZodLiteral<"linear">;
|
|
276
|
-
angle: z.ZodNumber;
|
|
277
|
-
stops: z.ZodArray<z.ZodObject<{
|
|
278
|
-
offset: z.ZodNumber;
|
|
279
|
-
color: z.ZodString;
|
|
280
|
-
}, z.core.$strip>>;
|
|
281
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
-
type: z.ZodLiteral<"radial">;
|
|
283
|
-
stops: z.ZodArray<z.ZodObject<{
|
|
284
|
-
offset: z.ZodNumber;
|
|
285
|
-
color: z.ZodString;
|
|
286
|
-
}, z.core.$strip>>;
|
|
287
|
-
}, z.core.$strip>], "type">>;
|
|
288
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
-
type: z.ZodLiteral<"path">;
|
|
290
|
-
points: z.ZodArray<z.ZodObject<{
|
|
291
|
-
id: z.ZodString;
|
|
292
|
-
x: z.ZodNumber;
|
|
293
|
-
y: z.ZodNumber;
|
|
294
|
-
type: z.ZodEnum<{
|
|
295
|
-
corner: "corner";
|
|
296
|
-
smooth: "smooth";
|
|
297
|
-
bezier: "bezier";
|
|
298
|
-
}>;
|
|
299
|
-
handleIn: z.ZodOptional<z.ZodObject<{
|
|
300
|
-
x: z.ZodNumber;
|
|
301
|
-
y: z.ZodNumber;
|
|
302
|
-
}, z.core.$strip>>;
|
|
303
|
-
handleOut: z.ZodOptional<z.ZodObject<{
|
|
304
|
-
x: z.ZodNumber;
|
|
305
|
-
y: z.ZodNumber;
|
|
306
|
-
}, z.core.$strip>>;
|
|
307
|
-
}, z.core.$strip>>;
|
|
308
|
-
closed: z.ZodBoolean;
|
|
309
|
-
width: z.ZodNumber;
|
|
310
|
-
height: z.ZodNumber;
|
|
311
|
-
fillEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
-
fillColor: z.ZodOptional<z.ZodString>;
|
|
313
|
-
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
314
|
-
strokeEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
-
strokeColor: z.ZodOptional<z.ZodString>;
|
|
316
|
-
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
317
|
-
}, z.core.$strip>], "type">;
|
|
318
|
-
/**
|
|
319
|
-
* Discriminated union of all element config schemas.
|
|
320
|
-
* Discriminant field: `transformType`.
|
|
321
|
-
*/
|
|
322
|
-
declare const AnyElementConfigSchema: z.ZodType;
|
|
323
|
-
declare const ClipShapeSchema: z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
324
|
-
type: z.ZodLiteral<"rounded">;
|
|
325
|
-
radius: z.ZodNumber;
|
|
326
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
-
type: z.ZodLiteral<"path">;
|
|
328
|
-
d: z.ZodString;
|
|
329
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
330
|
-
type: z.ZodLiteral<"composite-path">;
|
|
331
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
332
|
-
d: z.ZodString;
|
|
333
|
-
x: z.ZodNumber;
|
|
334
|
-
y: z.ZodNumber;
|
|
335
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
336
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
337
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
338
|
-
}, z.core.$strip>>;
|
|
339
|
-
}, z.core.$strip>]>;
|
|
340
|
-
declare const ArtboardImageMaskSchema: z.ZodObject<{
|
|
341
|
-
enabled: z.ZodBoolean;
|
|
342
|
-
imageUrl: z.ZodString;
|
|
343
|
-
maskType: z.ZodEnum<{
|
|
344
|
-
clip: "clip";
|
|
345
|
-
alpha: "alpha";
|
|
346
|
-
luma: "luma";
|
|
347
|
-
}>;
|
|
348
|
-
opacity: z.ZodNumber;
|
|
349
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
350
|
-
}, z.core.$strip>;
|
|
351
|
-
declare const SerializedArtboardSchema: z.ZodObject<{
|
|
352
|
-
id: z.ZodString;
|
|
353
|
-
name: z.ZodString;
|
|
354
|
-
x: z.ZodNumber;
|
|
355
|
-
y: z.ZodNumber;
|
|
356
|
-
width: z.ZodNumber;
|
|
357
|
-
height: z.ZodNumber;
|
|
358
|
-
backgroundColor: z.ZodString;
|
|
359
|
-
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
360
|
-
color: "color";
|
|
361
|
-
transparent: "transparent";
|
|
362
|
-
texture: "texture";
|
|
363
|
-
}>>;
|
|
364
|
-
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
365
|
-
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
-
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
367
|
-
type: z.ZodLiteral<"rounded">;
|
|
368
|
-
radius: z.ZodNumber;
|
|
369
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
370
|
-
type: z.ZodLiteral<"path">;
|
|
371
|
-
d: z.ZodString;
|
|
372
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
373
|
-
type: z.ZodLiteral<"composite-path">;
|
|
374
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
375
|
-
d: z.ZodString;
|
|
376
|
-
x: z.ZodNumber;
|
|
377
|
-
y: z.ZodNumber;
|
|
378
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
379
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
380
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
381
|
-
}, z.core.$strip>>;
|
|
382
|
-
}, z.core.$strip>]>>;
|
|
383
|
-
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
384
|
-
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
385
|
-
enabled: z.ZodBoolean;
|
|
386
|
-
textureUrl: z.ZodString;
|
|
387
|
-
intensity: z.ZodNumber;
|
|
388
|
-
}, z.core.$strip>>;
|
|
389
|
-
imageMask: z.ZodOptional<z.ZodObject<{
|
|
390
|
-
enabled: z.ZodBoolean;
|
|
391
|
-
imageUrl: z.ZodString;
|
|
392
|
-
maskType: z.ZodEnum<{
|
|
393
|
-
clip: "clip";
|
|
394
|
-
alpha: "alpha";
|
|
395
|
-
luma: "luma";
|
|
396
|
-
}>;
|
|
397
|
-
opacity: z.ZodNumber;
|
|
398
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
399
|
-
}, z.core.$strip>>;
|
|
400
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
401
|
-
cover: "cover";
|
|
402
|
-
"front-matter": "front-matter";
|
|
403
|
-
repeating: "repeating";
|
|
404
|
-
"back-matter": "back-matter";
|
|
405
|
-
}>>;
|
|
406
|
-
elementIds: z.ZodArray<z.ZodString>;
|
|
407
|
-
}, z.core.$strip>;
|
|
408
|
-
/**
|
|
409
|
-
* A custom (brand) font dependency of the design — `{ family, url }` of a
|
|
410
|
-
* host-stored font binary plus optional weight/style descriptors. Saved
|
|
411
|
-
* designs carry these so every consumer (live editor, export worker, server
|
|
412
|
-
* render) can load the exact file. Families are stored as-is; a family that
|
|
413
|
-
* collides with a Google Fonts family deterministically SHADOWS it (see
|
|
414
|
-
* `utils/custom-fonts.ts` for the resolution contract).
|
|
415
|
-
*/
|
|
416
|
-
declare const CustomFontSchema: z.ZodType<CustomFont>;
|
|
417
|
-
/**
|
|
418
|
-
* Top-level CanvasStateV1 schema.
|
|
419
|
-
*
|
|
420
|
-
* - `version` is always `1` (literal).
|
|
421
|
-
* - `artboards` contains serialized artboard configs with `elementIds`.
|
|
422
|
-
* - `elements` is a flat array of all elements across all artboards.
|
|
423
|
-
* - `activeArtboardId` identifies which artboard is currently active.
|
|
424
|
-
* - `customFonts` (optional) lists the design's custom-font dependencies.
|
|
425
|
-
*/
|
|
426
|
-
declare const CanvasStateV1Schema: z.ZodObject<{
|
|
427
|
-
version: z.ZodLiteral<1>;
|
|
428
|
-
artboards: z.ZodArray<z.ZodObject<{
|
|
429
|
-
id: z.ZodString;
|
|
430
|
-
name: z.ZodString;
|
|
431
|
-
x: z.ZodNumber;
|
|
432
|
-
y: z.ZodNumber;
|
|
433
|
-
width: z.ZodNumber;
|
|
434
|
-
height: z.ZodNumber;
|
|
435
|
-
backgroundColor: z.ZodString;
|
|
436
|
-
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
437
|
-
color: "color";
|
|
438
|
-
transparent: "transparent";
|
|
439
|
-
texture: "texture";
|
|
440
|
-
}>>;
|
|
441
|
-
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
442
|
-
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
443
|
-
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
444
|
-
type: z.ZodLiteral<"rounded">;
|
|
445
|
-
radius: z.ZodNumber;
|
|
446
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
447
|
-
type: z.ZodLiteral<"path">;
|
|
448
|
-
d: z.ZodString;
|
|
449
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
450
|
-
type: z.ZodLiteral<"composite-path">;
|
|
451
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
452
|
-
d: z.ZodString;
|
|
453
|
-
x: z.ZodNumber;
|
|
454
|
-
y: z.ZodNumber;
|
|
455
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
456
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
457
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
458
|
-
}, z.core.$strip>>;
|
|
459
|
-
}, z.core.$strip>]>>;
|
|
460
|
-
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
461
|
-
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
462
|
-
enabled: z.ZodBoolean;
|
|
463
|
-
textureUrl: z.ZodString;
|
|
464
|
-
intensity: z.ZodNumber;
|
|
465
|
-
}, z.core.$strip>>;
|
|
466
|
-
imageMask: z.ZodOptional<z.ZodObject<{
|
|
467
|
-
enabled: z.ZodBoolean;
|
|
468
|
-
imageUrl: z.ZodString;
|
|
469
|
-
maskType: z.ZodEnum<{
|
|
470
|
-
clip: "clip";
|
|
471
|
-
alpha: "alpha";
|
|
472
|
-
luma: "luma";
|
|
473
|
-
}>;
|
|
474
|
-
opacity: z.ZodNumber;
|
|
475
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
-
}, z.core.$strip>>;
|
|
477
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
478
|
-
cover: "cover";
|
|
479
|
-
"front-matter": "front-matter";
|
|
480
|
-
repeating: "repeating";
|
|
481
|
-
"back-matter": "back-matter";
|
|
482
|
-
}>>;
|
|
483
|
-
elementIds: z.ZodArray<z.ZodString>;
|
|
484
|
-
}, z.core.$strip>>;
|
|
485
|
-
elements: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
486
|
-
activeArtboardId: z.ZodString;
|
|
487
|
-
customFonts: z.ZodOptional<z.ZodArray<z.ZodType<CustomFont, unknown, z.core.$ZodTypeInternals<CustomFont, unknown>>>>;
|
|
488
|
-
}, z.core.$strip>;
|
|
489
|
-
/** A serialized artboard (artboard config + elementIds, no nested elements). */
|
|
490
|
-
type SerializedArtboard = z.infer<typeof SerializedArtboardSchema>;
|
|
491
|
-
/** A serialized element (discriminated union on `transformType`). */
|
|
492
|
-
type SerializedElement = z.infer<typeof AnyElementConfigSchema>;
|
|
493
|
-
/** The full versioned state document. */
|
|
494
|
-
type CanvasStateV1 = z.infer<typeof CanvasStateV1Schema>;
|
|
495
|
-
|
|
496
|
-
export { AnyElementConfigSchema as A, type CanvasStateV1 as C, DistressEffectSchema as D, GlyphOverrideSchema as G, KnockoutConfigSchema as K, MaskDefinitionSchema as M, OpenTypeFeaturesSchema as O, PointSchema as P, RichTextSchema as R, type SerializedArtboard as S, TextSpanSchema as T, AnyTransformDataSchema as a, ArtboardImageMaskSchema as b, CanvasStateV1Schema as c, CharacterStyleSchema as d, ClipShapeSchema as e, type CustomFont as f, CustomFontSchema as g, SerializedArtboardSchema as h, type SerializedElement as i, ShadowConfigSchema as j, StrokeConfigSchema as k };
|
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The design format: the JSON every Snowcone editor writes and the server reads (ADR-0115 part 1). Zod schemas for
|
|
5
|
-
* every artboard, element type and effect, and the types inferred from them. Moved out of `@snowcone-app/canvas`
|
|
6
|
-
* (`state/CanvasStateV1.ts`) unchanged: a saved design that validated there validates here, byte for byte.
|
|
7
|
-
*
|
|
8
|
-
* Version 1. Within a major only additive changes (a new optional field, a new element type the server renders); a
|
|
9
|
-
* breaking change is a new major with a migration (`migrateDesign`), and the server accepts the current major and the
|
|
10
|
-
* one before it.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A custom (brand) font a design depends on: `{ family, url }` of a host-stored font binary plus optional
|
|
15
|
-
* weight/style descriptors (`customFonts` on the design).
|
|
16
|
-
*/
|
|
17
|
-
interface CustomFont {
|
|
18
|
-
/** Family name, registered as-is (a family that collides with a Google Fonts family shadows it). */
|
|
19
|
-
family: string;
|
|
20
|
-
/** Host-stored font binary URL (must allow cross-origin GET). */
|
|
21
|
-
url: string;
|
|
22
|
-
/** CSS font-weight the file provides. Defaults to 400. */
|
|
23
|
-
weight?: number;
|
|
24
|
-
/** CSS font-style the file provides. Defaults to 'normal'. */
|
|
25
|
-
style?: "normal" | "italic";
|
|
26
|
-
}
|
|
27
|
-
declare const PointSchema: z.ZodObject<{
|
|
28
|
-
x: z.ZodNumber;
|
|
29
|
-
y: z.ZodNumber;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
declare const StrokeConfigSchema: z.ZodObject<{
|
|
32
|
-
enabled: z.ZodBoolean;
|
|
33
|
-
color: z.ZodString;
|
|
34
|
-
width: z.ZodNumber;
|
|
35
|
-
dashArray: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
36
|
-
lineCap: z.ZodOptional<z.ZodEnum<{
|
|
37
|
-
butt: "butt";
|
|
38
|
-
round: "round";
|
|
39
|
-
square: "square";
|
|
40
|
-
}>>;
|
|
41
|
-
lineJoin: z.ZodOptional<z.ZodEnum<{
|
|
42
|
-
round: "round";
|
|
43
|
-
miter: "miter";
|
|
44
|
-
bevel: "bevel";
|
|
45
|
-
}>>;
|
|
46
|
-
miterLimit: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
feather: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
declare const ShadowConfigSchema: z.ZodObject<{
|
|
51
|
-
enabled: z.ZodBoolean;
|
|
52
|
-
color: z.ZodString;
|
|
53
|
-
blur: z.ZodNumber;
|
|
54
|
-
offsetX: z.ZodNumber;
|
|
55
|
-
offsetY: z.ZodNumber;
|
|
56
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
declare const KnockoutConfigSchema: z.ZodObject<{
|
|
59
|
-
fill: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
stroke: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
-
scope: z.ZodOptional<z.ZodEnum<{
|
|
62
|
-
group: "group";
|
|
63
|
-
artboard: "artboard";
|
|
64
|
-
}>>;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
declare const DistressEffectSchema: z.ZodObject<{
|
|
67
|
-
enabled: z.ZodBoolean;
|
|
68
|
-
style: z.ZodEnum<{
|
|
69
|
-
custom: "custom";
|
|
70
|
-
worn: "worn";
|
|
71
|
-
cracked: "cracked";
|
|
72
|
-
grunge: "grunge";
|
|
73
|
-
retro: "retro";
|
|
74
|
-
}>;
|
|
75
|
-
intensity: z.ZodNumber;
|
|
76
|
-
fadeAmount: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
grainAmount: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
scratchAmount: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
edgeWear: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
textureUrl: z.ZodOptional<z.ZodString>;
|
|
81
|
-
textureOpacity: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
textureBlendMode: z.ZodOptional<z.ZodEnum<{
|
|
83
|
-
multiply: "multiply";
|
|
84
|
-
screen: "screen";
|
|
85
|
-
overlay: "overlay";
|
|
86
|
-
}>>;
|
|
87
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
declare const MaskDefinitionSchema: z.ZodObject<{
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
type: z.ZodEnum<{
|
|
92
|
-
clip: "clip";
|
|
93
|
-
alpha: "alpha";
|
|
94
|
-
luma: "luma";
|
|
95
|
-
distress: "distress";
|
|
96
|
-
}>;
|
|
97
|
-
maskElement: z.ZodLazy<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
98
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
-
feather: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
opacity: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
blendMode: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip>;
|
|
103
|
-
declare const CharacterStyleSchema: z.ZodObject<{
|
|
104
|
-
color: z.ZodOptional<z.ZodString>;
|
|
105
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
106
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
107
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
declare const TextSpanSchema: z.ZodObject<{
|
|
114
|
-
text: z.ZodString;
|
|
115
|
-
style: z.ZodObject<{
|
|
116
|
-
color: z.ZodOptional<z.ZodString>;
|
|
117
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
118
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
119
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
}, z.core.$strip>;
|
|
126
|
-
declare const RichTextSchema: z.ZodObject<{
|
|
127
|
-
spans: z.ZodArray<z.ZodObject<{
|
|
128
|
-
text: z.ZodString;
|
|
129
|
-
style: z.ZodObject<{
|
|
130
|
-
color: z.ZodOptional<z.ZodString>;
|
|
131
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
132
|
-
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
133
|
-
bold: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
-
italic: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
-
underline: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
-
strikethrough: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
-
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
138
|
-
}, z.core.$strip>;
|
|
139
|
-
}, z.core.$strip>>;
|
|
140
|
-
}, z.core.$strip>;
|
|
141
|
-
declare const GlyphOverrideSchema: z.ZodObject<{
|
|
142
|
-
charIndex: z.ZodNumber;
|
|
143
|
-
glyphIndex: z.ZodNumber;
|
|
144
|
-
unicode: z.ZodString;
|
|
145
|
-
alternateName: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
declare const OpenTypeFeaturesSchema: z.ZodObject<{
|
|
148
|
-
liga: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
-
dlig: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
-
calt: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
-
swsh: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
-
smcp: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
-
c2sc: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
-
onum: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
-
lnum: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
-
tnum: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
-
pnum: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
-
ss01: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
-
ss02: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
-
ss03: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
-
ss04: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
-
ss05: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
-
ss06: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
-
ss07: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
-
ss08: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
-
ss09: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
-
ss10: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
-
ss11: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
-
ss12: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
-
ss13: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
-
ss14: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
-
ss15: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
-
ss16: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
-
ss17: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
-
ss18: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
ss19: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
-
ss20: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
-
cv01: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
-
cv02: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
-
cv03: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
-
cv04: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
-
cv05: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
-
ccmp: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
-
locl: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
-
kern: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
-
mark: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
-
mkmk: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
-
}, z.core.$strip>;
|
|
189
|
-
declare const AnyTransformDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
190
|
-
type: z.ZodLiteral<"custom">;
|
|
191
|
-
controlPoints: z.ZodArray<z.ZodObject<{
|
|
192
|
-
x: z.ZodNumber;
|
|
193
|
-
y: z.ZodNumber;
|
|
194
|
-
}, z.core.$strip>>;
|
|
195
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
196
|
-
type: z.ZodLiteral<"distort">;
|
|
197
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
198
|
-
type: z.ZodLiteral<"circle">;
|
|
199
|
-
radius: z.ZodNumber;
|
|
200
|
-
scale: z.ZodNumber;
|
|
201
|
-
reverse: z.ZodBoolean;
|
|
202
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
203
|
-
type: z.ZodLiteral<"lean">;
|
|
204
|
-
leanAmount: z.ZodNumber;
|
|
205
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
206
|
-
type: z.ZodLiteral<"arch">;
|
|
207
|
-
archHeight: z.ZodNumber;
|
|
208
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
209
|
-
type: z.ZodLiteral<"ascend">;
|
|
210
|
-
ascendAngle: z.ZodNumber;
|
|
211
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
212
|
-
type: z.ZodLiteral<"wave">;
|
|
213
|
-
amplitude: z.ZodNumber;
|
|
214
|
-
frequency: z.ZodNumber;
|
|
215
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
216
|
-
type: z.ZodLiteral<"flag">;
|
|
217
|
-
amplitude: z.ZodNumber;
|
|
218
|
-
frequency: z.ZodNumber;
|
|
219
|
-
}, z.core.$loose>, z.ZodObject<{
|
|
220
|
-
type: z.ZodLiteral<"image">;
|
|
221
|
-
width: z.ZodNumber;
|
|
222
|
-
height: z.ZodNumber;
|
|
223
|
-
cropX: z.ZodNumber;
|
|
224
|
-
cropY: z.ZodNumber;
|
|
225
|
-
cropWidth: z.ZodNumber;
|
|
226
|
-
cropHeight: z.ZodNumber;
|
|
227
|
-
flipHorizontal: z.ZodBoolean;
|
|
228
|
-
flipVertical: z.ZodBoolean;
|
|
229
|
-
borderRadius: z.ZodNumber;
|
|
230
|
-
maskedCrop: z.ZodOptional<z.ZodLiteral<"frame">>;
|
|
231
|
-
engrave: z.ZodOptional<z.ZodObject<{
|
|
232
|
-
style: z.ZodEnum<{
|
|
233
|
-
photo: "photo";
|
|
234
|
-
drawing: "drawing";
|
|
235
|
-
solid: "solid";
|
|
236
|
-
original: "original";
|
|
237
|
-
}>;
|
|
238
|
-
amount: z.ZodNumber;
|
|
239
|
-
invert: z.ZodBoolean;
|
|
240
|
-
sourceUrl: z.ZodString;
|
|
241
|
-
cutLight: z.ZodBoolean;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
|
-
adjustments: z.ZodOptional<z.ZodObject<{
|
|
244
|
-
brightness: z.ZodNumber;
|
|
245
|
-
contrast: z.ZodNumber;
|
|
246
|
-
saturation: z.ZodNumber;
|
|
247
|
-
}, z.core.$strip>>;
|
|
248
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
-
type: z.ZodLiteral<"group">;
|
|
250
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
-
type: z.ZodLiteral<"shape">;
|
|
252
|
-
shapeType: z.ZodEnum<{
|
|
253
|
-
circle: "circle";
|
|
254
|
-
rectangle: "rectangle";
|
|
255
|
-
ellipse: "ellipse";
|
|
256
|
-
triangle: "triangle";
|
|
257
|
-
polygon: "polygon";
|
|
258
|
-
star: "star";
|
|
259
|
-
line: "line";
|
|
260
|
-
}>;
|
|
261
|
-
width: z.ZodNumber;
|
|
262
|
-
height: z.ZodNumber;
|
|
263
|
-
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
264
|
-
radiusX: z.ZodOptional<z.ZodNumber>;
|
|
265
|
-
radiusY: z.ZodOptional<z.ZodNumber>;
|
|
266
|
-
sides: z.ZodOptional<z.ZodNumber>;
|
|
267
|
-
points: z.ZodOptional<z.ZodNumber>;
|
|
268
|
-
innerRadius: z.ZodOptional<z.ZodNumber>;
|
|
269
|
-
fillColor: z.ZodOptional<z.ZodString>;
|
|
270
|
-
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
271
|
-
fill: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
272
|
-
type: z.ZodLiteral<"solid">;
|
|
273
|
-
color: z.ZodString;
|
|
274
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
275
|
-
type: z.ZodLiteral<"linear">;
|
|
276
|
-
angle: z.ZodNumber;
|
|
277
|
-
stops: z.ZodArray<z.ZodObject<{
|
|
278
|
-
offset: z.ZodNumber;
|
|
279
|
-
color: z.ZodString;
|
|
280
|
-
}, z.core.$strip>>;
|
|
281
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
-
type: z.ZodLiteral<"radial">;
|
|
283
|
-
stops: z.ZodArray<z.ZodObject<{
|
|
284
|
-
offset: z.ZodNumber;
|
|
285
|
-
color: z.ZodString;
|
|
286
|
-
}, z.core.$strip>>;
|
|
287
|
-
}, z.core.$strip>], "type">>;
|
|
288
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
-
type: z.ZodLiteral<"path">;
|
|
290
|
-
points: z.ZodArray<z.ZodObject<{
|
|
291
|
-
id: z.ZodString;
|
|
292
|
-
x: z.ZodNumber;
|
|
293
|
-
y: z.ZodNumber;
|
|
294
|
-
type: z.ZodEnum<{
|
|
295
|
-
corner: "corner";
|
|
296
|
-
smooth: "smooth";
|
|
297
|
-
bezier: "bezier";
|
|
298
|
-
}>;
|
|
299
|
-
handleIn: z.ZodOptional<z.ZodObject<{
|
|
300
|
-
x: z.ZodNumber;
|
|
301
|
-
y: z.ZodNumber;
|
|
302
|
-
}, z.core.$strip>>;
|
|
303
|
-
handleOut: z.ZodOptional<z.ZodObject<{
|
|
304
|
-
x: z.ZodNumber;
|
|
305
|
-
y: z.ZodNumber;
|
|
306
|
-
}, z.core.$strip>>;
|
|
307
|
-
}, z.core.$strip>>;
|
|
308
|
-
closed: z.ZodBoolean;
|
|
309
|
-
width: z.ZodNumber;
|
|
310
|
-
height: z.ZodNumber;
|
|
311
|
-
fillEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
-
fillColor: z.ZodOptional<z.ZodString>;
|
|
313
|
-
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
314
|
-
strokeEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
-
strokeColor: z.ZodOptional<z.ZodString>;
|
|
316
|
-
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
317
|
-
}, z.core.$strip>], "type">;
|
|
318
|
-
/**
|
|
319
|
-
* Discriminated union of all element config schemas.
|
|
320
|
-
* Discriminant field: `transformType`.
|
|
321
|
-
*/
|
|
322
|
-
declare const AnyElementConfigSchema: z.ZodType;
|
|
323
|
-
declare const ClipShapeSchema: z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
324
|
-
type: z.ZodLiteral<"rounded">;
|
|
325
|
-
radius: z.ZodNumber;
|
|
326
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
-
type: z.ZodLiteral<"path">;
|
|
328
|
-
d: z.ZodString;
|
|
329
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
330
|
-
type: z.ZodLiteral<"composite-path">;
|
|
331
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
332
|
-
d: z.ZodString;
|
|
333
|
-
x: z.ZodNumber;
|
|
334
|
-
y: z.ZodNumber;
|
|
335
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
336
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
337
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
338
|
-
}, z.core.$strip>>;
|
|
339
|
-
}, z.core.$strip>]>;
|
|
340
|
-
declare const ArtboardImageMaskSchema: z.ZodObject<{
|
|
341
|
-
enabled: z.ZodBoolean;
|
|
342
|
-
imageUrl: z.ZodString;
|
|
343
|
-
maskType: z.ZodEnum<{
|
|
344
|
-
clip: "clip";
|
|
345
|
-
alpha: "alpha";
|
|
346
|
-
luma: "luma";
|
|
347
|
-
}>;
|
|
348
|
-
opacity: z.ZodNumber;
|
|
349
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
350
|
-
}, z.core.$strip>;
|
|
351
|
-
declare const SerializedArtboardSchema: z.ZodObject<{
|
|
352
|
-
id: z.ZodString;
|
|
353
|
-
name: z.ZodString;
|
|
354
|
-
x: z.ZodNumber;
|
|
355
|
-
y: z.ZodNumber;
|
|
356
|
-
width: z.ZodNumber;
|
|
357
|
-
height: z.ZodNumber;
|
|
358
|
-
backgroundColor: z.ZodString;
|
|
359
|
-
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
360
|
-
color: "color";
|
|
361
|
-
transparent: "transparent";
|
|
362
|
-
texture: "texture";
|
|
363
|
-
}>>;
|
|
364
|
-
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
365
|
-
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
-
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
367
|
-
type: z.ZodLiteral<"rounded">;
|
|
368
|
-
radius: z.ZodNumber;
|
|
369
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
370
|
-
type: z.ZodLiteral<"path">;
|
|
371
|
-
d: z.ZodString;
|
|
372
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
373
|
-
type: z.ZodLiteral<"composite-path">;
|
|
374
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
375
|
-
d: z.ZodString;
|
|
376
|
-
x: z.ZodNumber;
|
|
377
|
-
y: z.ZodNumber;
|
|
378
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
379
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
380
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
381
|
-
}, z.core.$strip>>;
|
|
382
|
-
}, z.core.$strip>]>>;
|
|
383
|
-
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
384
|
-
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
385
|
-
enabled: z.ZodBoolean;
|
|
386
|
-
textureUrl: z.ZodString;
|
|
387
|
-
intensity: z.ZodNumber;
|
|
388
|
-
}, z.core.$strip>>;
|
|
389
|
-
imageMask: z.ZodOptional<z.ZodObject<{
|
|
390
|
-
enabled: z.ZodBoolean;
|
|
391
|
-
imageUrl: z.ZodString;
|
|
392
|
-
maskType: z.ZodEnum<{
|
|
393
|
-
clip: "clip";
|
|
394
|
-
alpha: "alpha";
|
|
395
|
-
luma: "luma";
|
|
396
|
-
}>;
|
|
397
|
-
opacity: z.ZodNumber;
|
|
398
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
399
|
-
}, z.core.$strip>>;
|
|
400
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
401
|
-
cover: "cover";
|
|
402
|
-
"front-matter": "front-matter";
|
|
403
|
-
repeating: "repeating";
|
|
404
|
-
"back-matter": "back-matter";
|
|
405
|
-
}>>;
|
|
406
|
-
elementIds: z.ZodArray<z.ZodString>;
|
|
407
|
-
}, z.core.$strip>;
|
|
408
|
-
/**
|
|
409
|
-
* A custom (brand) font dependency of the design — `{ family, url }` of a
|
|
410
|
-
* host-stored font binary plus optional weight/style descriptors. Saved
|
|
411
|
-
* designs carry these so every consumer (live editor, export worker, server
|
|
412
|
-
* render) can load the exact file. Families are stored as-is; a family that
|
|
413
|
-
* collides with a Google Fonts family deterministically SHADOWS it (see
|
|
414
|
-
* `utils/custom-fonts.ts` for the resolution contract).
|
|
415
|
-
*/
|
|
416
|
-
declare const CustomFontSchema: z.ZodType<CustomFont>;
|
|
417
|
-
/**
|
|
418
|
-
* Top-level CanvasStateV1 schema.
|
|
419
|
-
*
|
|
420
|
-
* - `version` is always `1` (literal).
|
|
421
|
-
* - `artboards` contains serialized artboard configs with `elementIds`.
|
|
422
|
-
* - `elements` is a flat array of all elements across all artboards.
|
|
423
|
-
* - `activeArtboardId` identifies which artboard is currently active.
|
|
424
|
-
* - `customFonts` (optional) lists the design's custom-font dependencies.
|
|
425
|
-
*/
|
|
426
|
-
declare const CanvasStateV1Schema: z.ZodObject<{
|
|
427
|
-
version: z.ZodLiteral<1>;
|
|
428
|
-
artboards: z.ZodArray<z.ZodObject<{
|
|
429
|
-
id: z.ZodString;
|
|
430
|
-
name: z.ZodString;
|
|
431
|
-
x: z.ZodNumber;
|
|
432
|
-
y: z.ZodNumber;
|
|
433
|
-
width: z.ZodNumber;
|
|
434
|
-
height: z.ZodNumber;
|
|
435
|
-
backgroundColor: z.ZodString;
|
|
436
|
-
backgroundType: z.ZodOptional<z.ZodEnum<{
|
|
437
|
-
color: "color";
|
|
438
|
-
transparent: "transparent";
|
|
439
|
-
texture: "texture";
|
|
440
|
-
}>>;
|
|
441
|
-
backgroundTexture: z.ZodOptional<z.ZodString>;
|
|
442
|
-
exportBackground: z.ZodOptional<z.ZodBoolean>;
|
|
443
|
-
clipShape: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"rectangle">, z.ZodLiteral<"circle">, z.ZodObject<{
|
|
444
|
-
type: z.ZodLiteral<"rounded">;
|
|
445
|
-
radius: z.ZodNumber;
|
|
446
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
447
|
-
type: z.ZodLiteral<"path">;
|
|
448
|
-
d: z.ZodString;
|
|
449
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
450
|
-
type: z.ZodLiteral<"composite-path">;
|
|
451
|
-
pieces: z.ZodArray<z.ZodObject<{
|
|
452
|
-
d: z.ZodString;
|
|
453
|
-
x: z.ZodNumber;
|
|
454
|
-
y: z.ZodNumber;
|
|
455
|
-
rotation: z.ZodOptional<z.ZodNumber>;
|
|
456
|
-
baseWidth: z.ZodOptional<z.ZodNumber>;
|
|
457
|
-
baseHeight: z.ZodOptional<z.ZodNumber>;
|
|
458
|
-
}, z.core.$strip>>;
|
|
459
|
-
}, z.core.$strip>]>>;
|
|
460
|
-
previewBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
461
|
-
distressTexture: z.ZodOptional<z.ZodObject<{
|
|
462
|
-
enabled: z.ZodBoolean;
|
|
463
|
-
textureUrl: z.ZodString;
|
|
464
|
-
intensity: z.ZodNumber;
|
|
465
|
-
}, z.core.$strip>>;
|
|
466
|
-
imageMask: z.ZodOptional<z.ZodObject<{
|
|
467
|
-
enabled: z.ZodBoolean;
|
|
468
|
-
imageUrl: z.ZodString;
|
|
469
|
-
maskType: z.ZodEnum<{
|
|
470
|
-
clip: "clip";
|
|
471
|
-
alpha: "alpha";
|
|
472
|
-
luma: "luma";
|
|
473
|
-
}>;
|
|
474
|
-
opacity: z.ZodNumber;
|
|
475
|
-
inverted: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
-
}, z.core.$strip>>;
|
|
477
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
478
|
-
cover: "cover";
|
|
479
|
-
"front-matter": "front-matter";
|
|
480
|
-
repeating: "repeating";
|
|
481
|
-
"back-matter": "back-matter";
|
|
482
|
-
}>>;
|
|
483
|
-
elementIds: z.ZodArray<z.ZodString>;
|
|
484
|
-
}, z.core.$strip>>;
|
|
485
|
-
elements: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
486
|
-
activeArtboardId: z.ZodString;
|
|
487
|
-
customFonts: z.ZodOptional<z.ZodArray<z.ZodType<CustomFont, unknown, z.core.$ZodTypeInternals<CustomFont, unknown>>>>;
|
|
488
|
-
}, z.core.$strip>;
|
|
489
|
-
/** A serialized artboard (artboard config + elementIds, no nested elements). */
|
|
490
|
-
type SerializedArtboard = z.infer<typeof SerializedArtboardSchema>;
|
|
491
|
-
/** A serialized element (discriminated union on `transformType`). */
|
|
492
|
-
type SerializedElement = z.infer<typeof AnyElementConfigSchema>;
|
|
493
|
-
/** The full versioned state document. */
|
|
494
|
-
type CanvasStateV1 = z.infer<typeof CanvasStateV1Schema>;
|
|
495
|
-
|
|
496
|
-
export { AnyElementConfigSchema as A, type CanvasStateV1 as C, DistressEffectSchema as D, GlyphOverrideSchema as G, KnockoutConfigSchema as K, MaskDefinitionSchema as M, OpenTypeFeaturesSchema as O, PointSchema as P, RichTextSchema as R, type SerializedArtboard as S, TextSpanSchema as T, AnyTransformDataSchema as a, ArtboardImageMaskSchema as b, CanvasStateV1Schema as c, CharacterStyleSchema as d, ClipShapeSchema as e, type CustomFont as f, CustomFontSchema as g, SerializedArtboardSchema as h, type SerializedElement as i, ShadowConfigSchema as j, StrokeConfigSchema as k };
|