@guilhermebkel/scenec 0.0.0-stage → 0.1.2
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/LICENSE +21 -0
- package/README.md +242 -2
- package/dist/catalog.d.ts +21 -0
- package/dist/catalog.js +35 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +118 -0
- package/dist/data/europe.json +1 -0
- package/dist/drawing/assets.d.ts +8 -0
- package/dist/drawing/assets.js +612 -0
- package/dist/drawing/kits.d.ts +7 -0
- package/dist/drawing/kits.js +92 -0
- package/dist/drawing/person.d.ts +18 -0
- package/dist/drawing/person.js +287 -0
- package/dist/drawing/themes.d.ts +4 -0
- package/dist/drawing/themes.js +45 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/dist/modes/map.d.ts +5 -0
- package/dist/modes/map.js +365 -0
- package/dist/modes/plane.d.ts +5 -0
- package/dist/modes/plane.js +716 -0
- package/dist/pipeline/compile.d.ts +2 -0
- package/dist/pipeline/compile.js +581 -0
- package/dist/pipeline/custom.d.ts +2 -0
- package/dist/pipeline/custom.js +120 -0
- package/dist/pipeline/groups.d.ts +2 -0
- package/dist/pipeline/groups.js +189 -0
- package/dist/pipeline/index.d.ts +16 -0
- package/dist/pipeline/index.js +7 -0
- package/dist/pipeline/parse.d.ts +10 -0
- package/dist/pipeline/parse.js +80 -0
- package/dist/protocols/options.d.ts +14 -0
- package/dist/protocols/options.js +1 -0
- package/dist/protocols/scene.d.ts +299 -0
- package/dist/protocols/scene.js +118 -0
- package/dist/protocols/theme.d.ts +25 -0
- package/dist/protocols/theme.js +1 -0
- package/dist/render/check.d.ts +6 -0
- package/dist/render/check.js +10 -0
- package/dist/render/critic.d.ts +1 -0
- package/dist/render/critic.js +235 -0
- package/dist/render/files.d.ts +2 -0
- package/dist/render/files.js +16 -0
- package/dist/render/fonts.d.ts +2 -0
- package/dist/render/fonts.js +4 -0
- package/dist/render/png.d.ts +9 -0
- package/dist/render/png.js +13 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.js +3 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.js +6 -0
- package/dist/utils/color.d.ts +5 -0
- package/dist/utils/color.js +35 -0
- package/dist/utils/recolor.d.ts +1 -0
- package/dist/utils/recolor.js +56 -0
- package/dist/utils/sanitize.d.ts +5 -0
- package/dist/utils/sanitize.js +169 -0
- package/dist/utils/suggest.d.ts +1 -0
- package/dist/utils/suggest.js +22 -0
- package/dist/utils/svg.d.ts +2 -0
- package/dist/utils/svg.js +11 -0
- package/fonts/OFL.txt +50 -0
- package/fonts/Poppins-Bold.ttf +0 -0
- package/fonts/Poppins-Medium.ttf +0 -0
- package/fonts/Poppins-Regular.ttf +0 -0
- package/package.json +96 -4
- package/skills/scenec/SKILL.md +46 -0
- package/skills/scenec/recipes/anuncios-variacoes.yaml +58 -0
- package/skills/scenec/recipes/carrossel.yaml +58 -0
- package/skills/scenec/recipes/elearning.yaml +64 -0
- package/skills/scenec/recipes/historia-ilustrada.yaml +48 -0
- package/skills/scenec/recipes/ilustracoes-produto.yaml +44 -0
- package/skills/scenec/recipes/mapas-jornadas.yaml +27 -0
- package/skills/scenec/recipes/reels-explicativo.yaml +41 -0
- package/skills/scenec/recipes/wrapped-personalizado.yaml +64 -0
- package/skills/scenec/references/catalog.md +125 -0
- package/skills/scenec/references/dsl.md +111 -0
- package/skills/scenec/references/fontes.md +8 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SLOT_NAMES: readonly ["far-left", "left", "center-left", "center", "center-right", "right", "far-right"];
|
|
3
|
+
export declare const SIZE_NAMES: readonly ["tiny", "small", "medium", "large", "huge"];
|
|
4
|
+
export declare const DEPTH_NAMES: readonly ["far", "mid", "near"];
|
|
5
|
+
export declare const MODE_NAMES: readonly ["classic", "2.5d", "board", "map"];
|
|
6
|
+
export declare const SETTING_NAMES: readonly ["outdoor", "indoor", "beach", "city"];
|
|
7
|
+
export declare const SHOT_NAMES: readonly ["wide", "full", "medium", "close"];
|
|
8
|
+
export declare const MAX_OBJECTS = 200;
|
|
9
|
+
export declare const MAX_CANVAS_PX = 4096;
|
|
10
|
+
export declare const canvasSchema: z.ZodObject<{
|
|
11
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
"2.5d": "2.5d";
|
|
15
|
+
board: "board";
|
|
16
|
+
classic: "classic";
|
|
17
|
+
map: "map";
|
|
18
|
+
}>>;
|
|
19
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
20
|
+
kit: z.ZodOptional<z.ZodString>;
|
|
21
|
+
colors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
22
|
+
setting: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
beach: "beach";
|
|
24
|
+
city: "city";
|
|
25
|
+
indoor: "indoor";
|
|
26
|
+
outdoor: "outdoor";
|
|
27
|
+
}>>;
|
|
28
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
horizon: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
base: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
floor: z.ZodOptional<z.ZodString>;
|
|
32
|
+
vanish: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
haze: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
grain: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
light: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
36
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
37
|
+
strength: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
}, z.core.$loose>]>>;
|
|
39
|
+
critique: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
close: "close";
|
|
42
|
+
full: "full";
|
|
43
|
+
medium: "medium";
|
|
44
|
+
wide: "wide";
|
|
45
|
+
}>>;
|
|
46
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
47
|
+
frame: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
48
|
+
center: "center";
|
|
49
|
+
left: "left";
|
|
50
|
+
right: "right";
|
|
51
|
+
}>]>>;
|
|
52
|
+
headroom: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
camera: z.ZodOptional<z.ZodUnknown>;
|
|
54
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
far_y: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
near_y: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
horizon_z: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
}, z.core.$loose>;
|
|
59
|
+
export declare const objectSchema: z.ZodObject<{
|
|
60
|
+
asset: z.ZodOptional<z.ZodString>;
|
|
61
|
+
group: z.ZodOptional<z.ZodString>;
|
|
62
|
+
parts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>>;
|
|
63
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
64
|
+
center: "center";
|
|
65
|
+
"center-left": "center-left";
|
|
66
|
+
"center-right": "center-right";
|
|
67
|
+
"far-left": "far-left";
|
|
68
|
+
"far-right": "far-right";
|
|
69
|
+
left: "left";
|
|
70
|
+
right: "right";
|
|
71
|
+
"sky-center": "sky-center";
|
|
72
|
+
"sky-center-left": "sky-center-left";
|
|
73
|
+
"sky-center-right": "sky-center-right";
|
|
74
|
+
"sky-far-left": "sky-far-left";
|
|
75
|
+
"sky-far-right": "sky-far-right";
|
|
76
|
+
"sky-left": "sky-left";
|
|
77
|
+
"sky-right": "sky-right";
|
|
78
|
+
"top-center": "top-center";
|
|
79
|
+
"top-center-left": "top-center-left";
|
|
80
|
+
"top-center-right": "top-center-right";
|
|
81
|
+
"top-far-left": "top-far-left";
|
|
82
|
+
"top-far-right": "top-far-right";
|
|
83
|
+
"top-left": "top-left";
|
|
84
|
+
"top-right": "top-right";
|
|
85
|
+
}>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
|
|
86
|
+
size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
87
|
+
huge: "huge";
|
|
88
|
+
large: "large";
|
|
89
|
+
medium: "medium";
|
|
90
|
+
small: "small";
|
|
91
|
+
tiny: "tiny";
|
|
92
|
+
}>]>>;
|
|
93
|
+
depth: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
far: "far";
|
|
95
|
+
mid: "mid";
|
|
96
|
+
near: "near";
|
|
97
|
+
}>>;
|
|
98
|
+
left_of: z.ZodOptional<z.ZodString>;
|
|
99
|
+
right_of: z.ZodOptional<z.ZodString>;
|
|
100
|
+
behind: z.ZodOptional<z.ZodString>;
|
|
101
|
+
in_front_of: z.ZodOptional<z.ZodString>;
|
|
102
|
+
on: z.ZodOptional<z.ZodString>;
|
|
103
|
+
under: z.ZodOptional<z.ZodString>;
|
|
104
|
+
above: z.ZodOptional<z.ZodString>;
|
|
105
|
+
holds: z.ZodOptional<z.ZodString>;
|
|
106
|
+
gap: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
offset: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
|
|
108
|
+
align: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
109
|
+
layer: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
back: "back";
|
|
111
|
+
front: "front";
|
|
112
|
+
}>>;
|
|
113
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
elevation: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
lift: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
hang: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
facing: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
left: "left";
|
|
119
|
+
right: "right";
|
|
120
|
+
}>>;
|
|
121
|
+
pose: z.ZodOptional<z.ZodString>;
|
|
122
|
+
expr: z.ZodOptional<z.ZodString>;
|
|
123
|
+
look: z.ZodOptional<z.ZodString>;
|
|
124
|
+
haze: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
light: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
kit: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
critique: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
allow_crop: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
}, z.core.$loose>;
|
|
130
|
+
export declare const textSchema: z.ZodObject<{
|
|
131
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
132
|
+
at: z.ZodOptional<z.ZodString>;
|
|
133
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
body: "body";
|
|
135
|
+
label: "label";
|
|
136
|
+
subtitle: "subtitle";
|
|
137
|
+
title: "title";
|
|
138
|
+
}>>;
|
|
139
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
color: z.ZodOptional<z.ZodString>;
|
|
143
|
+
box: z.ZodOptional<z.ZodString>;
|
|
144
|
+
pad: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$loose>;
|
|
148
|
+
export declare const sceneSchema: z.ZodObject<{
|
|
149
|
+
version: z.ZodOptional<z.ZodLiteral<1>>;
|
|
150
|
+
canvas: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
"2.5d": "2.5d";
|
|
155
|
+
board: "board";
|
|
156
|
+
classic: "classic";
|
|
157
|
+
map: "map";
|
|
158
|
+
}>>;
|
|
159
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
160
|
+
kit: z.ZodOptional<z.ZodString>;
|
|
161
|
+
colors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
162
|
+
setting: z.ZodOptional<z.ZodEnum<{
|
|
163
|
+
beach: "beach";
|
|
164
|
+
city: "city";
|
|
165
|
+
indoor: "indoor";
|
|
166
|
+
outdoor: "outdoor";
|
|
167
|
+
}>>;
|
|
168
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
horizon: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
base: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
floor: z.ZodOptional<z.ZodString>;
|
|
172
|
+
vanish: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
haze: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
grain: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
light: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
176
|
+
from: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
177
|
+
strength: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.core.$loose>]>>;
|
|
179
|
+
critique: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
close: "close";
|
|
182
|
+
full: "full";
|
|
183
|
+
medium: "medium";
|
|
184
|
+
wide: "wide";
|
|
185
|
+
}>>;
|
|
186
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
187
|
+
frame: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
188
|
+
center: "center";
|
|
189
|
+
left: "left";
|
|
190
|
+
right: "right";
|
|
191
|
+
}>]>>;
|
|
192
|
+
headroom: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
camera: z.ZodOptional<z.ZodUnknown>;
|
|
194
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
far_y: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
near_y: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
horizon_z: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
}, z.core.$loose>>;
|
|
199
|
+
objects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
200
|
+
asset: z.ZodOptional<z.ZodString>;
|
|
201
|
+
group: z.ZodOptional<z.ZodString>;
|
|
202
|
+
parts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>>;
|
|
203
|
+
at: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
204
|
+
center: "center";
|
|
205
|
+
"center-left": "center-left";
|
|
206
|
+
"center-right": "center-right";
|
|
207
|
+
"far-left": "far-left";
|
|
208
|
+
"far-right": "far-right";
|
|
209
|
+
left: "left";
|
|
210
|
+
right: "right";
|
|
211
|
+
"sky-center": "sky-center";
|
|
212
|
+
"sky-center-left": "sky-center-left";
|
|
213
|
+
"sky-center-right": "sky-center-right";
|
|
214
|
+
"sky-far-left": "sky-far-left";
|
|
215
|
+
"sky-far-right": "sky-far-right";
|
|
216
|
+
"sky-left": "sky-left";
|
|
217
|
+
"sky-right": "sky-right";
|
|
218
|
+
"top-center": "top-center";
|
|
219
|
+
"top-center-left": "top-center-left";
|
|
220
|
+
"top-center-right": "top-center-right";
|
|
221
|
+
"top-far-left": "top-far-left";
|
|
222
|
+
"top-far-right": "top-far-right";
|
|
223
|
+
"top-left": "top-left";
|
|
224
|
+
"top-right": "top-right";
|
|
225
|
+
}>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
|
|
226
|
+
size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
227
|
+
huge: "huge";
|
|
228
|
+
large: "large";
|
|
229
|
+
medium: "medium";
|
|
230
|
+
small: "small";
|
|
231
|
+
tiny: "tiny";
|
|
232
|
+
}>]>>;
|
|
233
|
+
depth: z.ZodOptional<z.ZodEnum<{
|
|
234
|
+
far: "far";
|
|
235
|
+
mid: "mid";
|
|
236
|
+
near: "near";
|
|
237
|
+
}>>;
|
|
238
|
+
left_of: z.ZodOptional<z.ZodString>;
|
|
239
|
+
right_of: z.ZodOptional<z.ZodString>;
|
|
240
|
+
behind: z.ZodOptional<z.ZodString>;
|
|
241
|
+
in_front_of: z.ZodOptional<z.ZodString>;
|
|
242
|
+
on: z.ZodOptional<z.ZodString>;
|
|
243
|
+
under: z.ZodOptional<z.ZodString>;
|
|
244
|
+
above: z.ZodOptional<z.ZodString>;
|
|
245
|
+
holds: z.ZodOptional<z.ZodString>;
|
|
246
|
+
gap: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
offset: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>>;
|
|
248
|
+
align: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
249
|
+
layer: z.ZodOptional<z.ZodEnum<{
|
|
250
|
+
back: "back";
|
|
251
|
+
front: "front";
|
|
252
|
+
}>>;
|
|
253
|
+
altitude: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
elevation: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
lift: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
hang: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
facing: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
left: "left";
|
|
259
|
+
right: "right";
|
|
260
|
+
}>>;
|
|
261
|
+
pose: z.ZodOptional<z.ZodString>;
|
|
262
|
+
expr: z.ZodOptional<z.ZodString>;
|
|
263
|
+
look: z.ZodOptional<z.ZodString>;
|
|
264
|
+
haze: z.ZodOptional<z.ZodBoolean>;
|
|
265
|
+
light: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
kit: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
critique: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
+
allow_crop: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
+
}, z.core.$loose>>>;
|
|
270
|
+
text: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
271
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
272
|
+
at: z.ZodOptional<z.ZodString>;
|
|
273
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
274
|
+
body: "body";
|
|
275
|
+
label: "label";
|
|
276
|
+
subtitle: "subtitle";
|
|
277
|
+
title: "title";
|
|
278
|
+
}>>;
|
|
279
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
color: z.ZodOptional<z.ZodString>;
|
|
283
|
+
box: z.ZodOptional<z.ZodString>;
|
|
284
|
+
pad: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
}, z.core.$loose>>>;
|
|
288
|
+
assets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{}, z.core.$loose>>>;
|
|
289
|
+
path: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
290
|
+
scatter: z.ZodOptional<z.ZodUnknown>;
|
|
291
|
+
zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
292
|
+
walls: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
293
|
+
floor: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
294
|
+
boxes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
295
|
+
map: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
296
|
+
route: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
297
|
+
}, z.core.$loose>;
|
|
298
|
+
export type Scene = z.infer<typeof sceneSchema>;
|
|
299
|
+
export declare const OBJECT_PARAM_KEYS: readonly ["age", "along", "art", "backpack", "beard", "bg", "bottom", "build", "cane", "color", "count", "details", "dist", "doors", "draped", "drawers", "drop", "ends", "expr", "floors", "food", "frame", "gaze", "glasses", "gown", "hair", "hair_color", "handle", "hat", "hat_color", "height", "jacket", "label", "logo", "mic", "near", "off", "on_path", "on_spot", "outfit", "pants", "people", "person", "pot", "role", "screen", "seed", "shirt", "shoes", "side", "skin", "sleeve", "stand", "steam", "stole", "style", "thickness", "view", "width"];
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const SLOT_NAMES = ["far-left", "left", "center-left", "center", "center-right", "right", "far-right"];
|
|
3
|
+
export const SIZE_NAMES = ["tiny", "small", "medium", "large", "huge"];
|
|
4
|
+
export const DEPTH_NAMES = ["far", "mid", "near"];
|
|
5
|
+
export const MODE_NAMES = ["classic", "2.5d", "board", "map"];
|
|
6
|
+
export const SETTING_NAMES = ["outdoor", "indoor", "beach", "city"];
|
|
7
|
+
export const SHOT_NAMES = ["wide", "full", "medium", "close"];
|
|
8
|
+
export const MAX_OBJECTS = 200;
|
|
9
|
+
export const MAX_CANVAS_PX = 4096;
|
|
10
|
+
const slot = z.union([
|
|
11
|
+
z.number(),
|
|
12
|
+
z.enum([...SLOT_NAMES, ...SLOT_NAMES.map((name) => `top-${name}`), ...SLOT_NAMES.map((name) => `sky-${name}`)]),
|
|
13
|
+
z.tuple([z.number(), z.number()]),
|
|
14
|
+
], { error: `use um nome de posição (${SLOT_NAMES.join(", ")}), um número de 0 a 1 ou [x, z] no modo 2.5d` });
|
|
15
|
+
const MIN_CANVAS_PX = 16;
|
|
16
|
+
const MAX_SCALE = 4;
|
|
17
|
+
const pixels = z.number().int().min(MIN_CANVAS_PX).max(MAX_CANVAS_PX);
|
|
18
|
+
const fraction = z.number().min(0).max(1);
|
|
19
|
+
export const canvasSchema = z.looseObject({
|
|
20
|
+
width: pixels.optional().describe("Frame width in px. Default 1200."),
|
|
21
|
+
height: pixels.optional().describe("Frame height in px. Default 630 (classic) or 900 (2.5d, map)."),
|
|
22
|
+
mode: z.enum(MODE_NAMES).optional().describe("classic (default), 2.5d, board or map."),
|
|
23
|
+
theme: z.string().optional().describe("Palette name. See `scenec catalog themes`."),
|
|
24
|
+
kit: z.string().optional().describe("Style kit name. See `scenec catalog kits`."),
|
|
25
|
+
colors: z.record(z.string(), z.string()).optional().describe("Overrides theme colors, for example wall or floor."),
|
|
26
|
+
setting: z.enum(SETTING_NAMES).optional().describe("Where the scene happens. Default outdoor."),
|
|
27
|
+
scale: z.number().positive().max(MAX_SCALE).optional().describe("Camera zoom. Default 1."),
|
|
28
|
+
horizon: fraction.optional().describe("Horizon line as a fraction of the height."),
|
|
29
|
+
base: fraction.optional().describe("Baseline of the nearest ground objects as a fraction of the height."),
|
|
30
|
+
floor: z.string().optional().describe("Indoor floor style, for example planks."),
|
|
31
|
+
vanish: fraction.optional().describe("Vanishing point x for planks."),
|
|
32
|
+
haze: z.boolean().optional().describe("false turns atmospheric perspective off."),
|
|
33
|
+
grain: z.boolean().optional(),
|
|
34
|
+
light: z.union([
|
|
35
|
+
z.literal(false),
|
|
36
|
+
z.looseObject({ from: z.union([z.number(), z.string()]).optional(), strength: fraction.optional() }),
|
|
37
|
+
]).optional()
|
|
38
|
+
.describe("false, or { from: left|right|front|0..1, strength: 0..1 }."),
|
|
39
|
+
critique: z.boolean().optional().describe("false turns the art director off."),
|
|
40
|
+
shot: z.enum(SHOT_NAMES).optional().describe("Framing: wide (default), full, medium or close."),
|
|
41
|
+
focus: z.union([z.string(), z.array(z.string())]).optional().describe("Object or group ids the shot frames."),
|
|
42
|
+
frame: z.union([z.number(), z.enum(["left", "center", "right"])]).optional().describe("Where the focus sits horizontally."),
|
|
43
|
+
headroom: fraction.optional().describe("Space above the focus as a fraction of the height."),
|
|
44
|
+
camera: z.unknown().optional(),
|
|
45
|
+
depth: z.number().optional(),
|
|
46
|
+
far_y: z.number().optional(),
|
|
47
|
+
near_y: z.number().optional(),
|
|
48
|
+
horizon_z: z.number().optional(),
|
|
49
|
+
});
|
|
50
|
+
export const objectSchema = z.looseObject({
|
|
51
|
+
asset: z.string().optional().describe("Asset name; defaults to the object id. See `scenec catalog assets`."),
|
|
52
|
+
group: z.string().optional().describe("Ready-made group. See `scenec catalog groups`."),
|
|
53
|
+
parts: z.record(z.string(), z.union([z.literal(false), z.record(z.string(), z.unknown())])).optional()
|
|
54
|
+
.describe("Adjusts a group's parts; false removes one."),
|
|
55
|
+
at: slot.optional().describe("Horizontal position: a slot name or 0..1."),
|
|
56
|
+
size: z.union([z.number().positive(), z.enum(SIZE_NAMES)]).optional(),
|
|
57
|
+
depth: z.enum(DEPTH_NAMES).optional(),
|
|
58
|
+
left_of: z.string().optional(),
|
|
59
|
+
right_of: z.string().optional(),
|
|
60
|
+
behind: z.string().optional(),
|
|
61
|
+
in_front_of: z.string().optional(),
|
|
62
|
+
on: z.string().optional().describe("Sits on another object's surface or seat."),
|
|
63
|
+
under: z.string().optional(),
|
|
64
|
+
above: z.string().optional(),
|
|
65
|
+
holds: z.string().optional(),
|
|
66
|
+
gap: z.number().optional(),
|
|
67
|
+
offset: z.union([z.number(), z.tuple([z.number(), z.number()])], { error: "use um número ou [x, z]" }).optional(),
|
|
68
|
+
align: z.union([z.number(), z.string()]).optional(),
|
|
69
|
+
layer: z.enum(["back", "front"]).optional(),
|
|
70
|
+
altitude: z.number().optional(),
|
|
71
|
+
elevation: z.number().optional(),
|
|
72
|
+
lift: z.number().optional(),
|
|
73
|
+
hang: z.number().optional(),
|
|
74
|
+
facing: z.enum(["left", "right"]).optional(),
|
|
75
|
+
pose: z.string().optional().describe("Person pose. See `scenec catalog poses`."),
|
|
76
|
+
expr: z.string().optional().describe("Person expression."),
|
|
77
|
+
look: z.string().optional().describe("Where a person looks: another object id, or left, right, up, down, camera."),
|
|
78
|
+
haze: z.boolean().optional(),
|
|
79
|
+
light: z.boolean().optional(),
|
|
80
|
+
kit: z.boolean().optional(),
|
|
81
|
+
critique: z.boolean().optional(),
|
|
82
|
+
allow_crop: z.boolean().optional(),
|
|
83
|
+
});
|
|
84
|
+
export const textSchema = z.looseObject({
|
|
85
|
+
content: z.union([z.string(), z.number()]).describe("The text. A newline breaks the line."),
|
|
86
|
+
at: z.string().optional().describe("top-left, top-center, top-right, bottom-left, bottom-center or bottom-right."),
|
|
87
|
+
role: z.enum(["title", "subtitle", "label", "body"]).optional(),
|
|
88
|
+
size: z.number().positive().optional().describe("Font size as a fraction of the height."),
|
|
89
|
+
y: z.number().optional(),
|
|
90
|
+
x: z.number().optional(),
|
|
91
|
+
color: z.string().optional(),
|
|
92
|
+
box: z.string().optional().describe("Background color behind the text."),
|
|
93
|
+
pad: z.number().optional(),
|
|
94
|
+
radius: z.number().optional(),
|
|
95
|
+
weight: z.number().optional(),
|
|
96
|
+
});
|
|
97
|
+
export const sceneSchema = z.looseObject({
|
|
98
|
+
version: z.literal(1).optional(),
|
|
99
|
+
canvas: canvasSchema.optional(),
|
|
100
|
+
objects: z.record(z.string(), objectSchema).optional(),
|
|
101
|
+
text: z.array(textSchema).optional(),
|
|
102
|
+
assets: z.record(z.string(), z.looseObject({})).optional().describe("Custom assets: svg (inline or a file) or image."),
|
|
103
|
+
path: z.looseObject({}).optional(),
|
|
104
|
+
scatter: z.unknown().optional(),
|
|
105
|
+
zones: z.record(z.string(), z.unknown()).optional(),
|
|
106
|
+
walls: z.looseObject({}).optional(),
|
|
107
|
+
floor: z.looseObject({}).optional(),
|
|
108
|
+
boxes: z.record(z.string(), z.unknown()).optional(),
|
|
109
|
+
map: z.looseObject({}).optional(),
|
|
110
|
+
route: z.array(z.unknown()).optional(),
|
|
111
|
+
});
|
|
112
|
+
export const OBJECT_PARAM_KEYS = [
|
|
113
|
+
"age", "along", "art", "backpack", "beard", "bg", "bottom", "build", "cane", "color", "count", "details", "dist", "doors",
|
|
114
|
+
"draped", "drawers", "drop", "ends", "expr", "floors", "food", "frame", "gaze", "glasses", "gown", "hair", "hair_color",
|
|
115
|
+
"handle", "hat", "hat_color", "height", "jacket", "label", "logo", "mic", "near", "off", "on_path", "on_spot", "outfit",
|
|
116
|
+
"pants", "people", "person", "pot", "role", "screen", "seed", "shirt", "shoes", "side", "skin", "sleeve", "stand", "steam",
|
|
117
|
+
"stole", "style", "thickness", "view", "width",
|
|
118
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Theme {
|
|
2
|
+
skyTop: string;
|
|
3
|
+
skyBottom: string;
|
|
4
|
+
ground: string;
|
|
5
|
+
groundDark: string;
|
|
6
|
+
wall: string;
|
|
7
|
+
floor: string;
|
|
8
|
+
sea?: string;
|
|
9
|
+
seaLight?: string;
|
|
10
|
+
primary: string;
|
|
11
|
+
secondary: string;
|
|
12
|
+
accent: string;
|
|
13
|
+
foliage: [string, string, string];
|
|
14
|
+
trunk: string;
|
|
15
|
+
wood: string;
|
|
16
|
+
woodDark: string;
|
|
17
|
+
ink: string;
|
|
18
|
+
paper: string;
|
|
19
|
+
glass: string;
|
|
20
|
+
metal: string;
|
|
21
|
+
text: string;
|
|
22
|
+
textOnDark: string;
|
|
23
|
+
shadow: string;
|
|
24
|
+
[key: string]: string | string[] | undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CompileOptions } from "../protocols/options.ts";
|
|
2
|
+
import type { CompileResult } from "../pipeline/index.ts";
|
|
3
|
+
export interface CheckResult extends CompileResult {
|
|
4
|
+
art: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function check(input: unknown, options?: CompileOptions): CheckResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { compileInternal } from "../pipeline/compile.js";
|
|
2
|
+
import { parseScene } from "../pipeline/parse.js";
|
|
3
|
+
import { critique } from "./critic.js";
|
|
4
|
+
import { measureSvg } from "./png.js";
|
|
5
|
+
export function check(input, options = {}) {
|
|
6
|
+
const { scene, warnings } = parseScene(input);
|
|
7
|
+
const { critiqueInput, ...result } = compileInternal(scene, { measure: measureSvg, ...options });
|
|
8
|
+
const art = critiqueInput ? critique(critiqueInput) : [];
|
|
9
|
+
return { ...result, warnings: [...warnings, ...result.warnings], art };
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function critique({ W, H, head, bg, scene, objects, theme, scale, textRects, skip }: any): string[];
|