visualfries 0.1.0 → 0.1.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/dist/SceneBuilder.svelte.d.ts +1627 -4795
- package/dist/animations/AnimationPresetsRegister.d.ts +49 -225
- package/dist/builders/_ComponentState.svelte.d.ts +110 -462
- package/dist/builders/html/processors/TextEffectsStyleProcessor.js +1 -1
- package/dist/components/hooks/SubtitlesHook.d.ts +25 -38
- package/dist/layers/Layer.svelte.d.ts +1627 -4795
- package/dist/managers/LayersManager.svelte.d.ts +1627 -4795
- package/dist/managers/StateManager.svelte.d.ts +1659 -4853
- package/dist/managers/SubtitlesManager.svelte.d.ts +76 -115
- package/dist/schemas/scene/animations.d.ts +1385 -89353
- package/dist/schemas/scene/animations.js +11 -11
- package/dist/schemas/scene/components.d.ts +23513 -0
- package/dist/schemas/scene/components.js +156 -116
- package/dist/schemas/scene/core.d.ts +21255 -0
- package/dist/schemas/scene/core.js +25 -23
- package/dist/schemas/scene/index.d.ts +5 -3
- package/dist/schemas/scene/index.js +1 -1
- package/dist/schemas/scene/properties.d.ts +437 -727
- package/dist/schemas/scene/properties.js +63 -51
- package/dist/schemas/scene/subtitles.d.ts +159 -995
- package/package.json +4 -4
|
@@ -15,7 +15,9 @@ export const GradientDefinitionShape = z.object({
|
|
|
15
15
|
/** Gradient type */
|
|
16
16
|
type: z.enum(['linear', 'radial']),
|
|
17
17
|
/** Array of color strings */
|
|
18
|
-
colors: z.array(z.string().refine(isValidColor, {
|
|
18
|
+
colors: z.array(z.string().refine(isValidColor, {
|
|
19
|
+
error: 'Invalid gradient color'
|
|
20
|
+
})).min(2),
|
|
19
21
|
/** Optional array of stop positions (0-1) matching colors */
|
|
20
22
|
stops: z.array(z.number().min(0).max(100)).optional(),
|
|
21
23
|
/** Angle in degrees (for linear gradients) */
|
|
@@ -29,7 +31,9 @@ export const GradientDefinitionShape = z.object({
|
|
|
29
31
|
* Color type that can be either a string or a gradient object
|
|
30
32
|
*/
|
|
31
33
|
export const ColorTypeShape = z.union([
|
|
32
|
-
z.string().refine(isValidColor, {
|
|
34
|
+
z.string().refine(isValidColor, {
|
|
35
|
+
error: 'Invalid color format'
|
|
36
|
+
}),
|
|
33
37
|
GradientDefinitionShape
|
|
34
38
|
]);
|
|
35
39
|
/**
|
|
@@ -42,14 +46,14 @@ export const PositionShape = z.object({
|
|
|
42
46
|
/** Y-coordinate position (from top) */
|
|
43
47
|
y: z.number(),
|
|
44
48
|
/** Rotation in degrees */
|
|
45
|
-
rotation: z.number().
|
|
49
|
+
rotation: z.number().prefault(0),
|
|
46
50
|
/** Anchor point for transformations (0,0 is top-left, 1,1 is bottom-right) */
|
|
47
51
|
anchor: z
|
|
48
52
|
.object({
|
|
49
|
-
x: z.number().min(0).max(1).
|
|
50
|
-
y: z.number().min(0).max(1).
|
|
53
|
+
x: z.number().min(0).max(1).prefault(0.5),
|
|
54
|
+
y: z.number().min(0).max(1).prefault(0.5)
|
|
51
55
|
})
|
|
52
|
-
.
|
|
56
|
+
.prefault({ x: 0.5, y: 0.5 })
|
|
53
57
|
});
|
|
54
58
|
/**
|
|
55
59
|
* Size property schema
|
|
@@ -61,9 +65,9 @@ export const SizeShape = z.object({
|
|
|
61
65
|
/** Height in pixels */
|
|
62
66
|
height: z.number().positive(),
|
|
63
67
|
/** Uniform scale factor */
|
|
64
|
-
scale: z.number().positive().
|
|
68
|
+
scale: z.number().positive().prefault(1),
|
|
65
69
|
/** Whether to maintain aspect ratio when resizing */
|
|
66
|
-
maintainAspectRatio: z.boolean().
|
|
70
|
+
maintainAspectRatio: z.boolean().prefault(true),
|
|
67
71
|
/** Original dimensions before any transformations */
|
|
68
72
|
original: z
|
|
69
73
|
.object({
|
|
@@ -78,18 +82,18 @@ export const SizeShape = z.object({
|
|
|
78
82
|
*/
|
|
79
83
|
export const TransformShape = z.object({
|
|
80
84
|
/** Horizontal scale factor (1 = 100%) */
|
|
81
|
-
scaleX: z.number().
|
|
85
|
+
scaleX: z.number().prefault(1),
|
|
82
86
|
/** Vertical scale factor (1 = 100%) */
|
|
83
|
-
scaleY: z.number().
|
|
87
|
+
scaleY: z.number().prefault(1),
|
|
84
88
|
/** Horizontal skew in degrees */
|
|
85
|
-
skewX: z.number().
|
|
89
|
+
skewX: z.number().prefault(0),
|
|
86
90
|
/** Vertical skew in degrees */
|
|
87
|
-
skewY: z.number().
|
|
91
|
+
skewY: z.number().prefault(0),
|
|
88
92
|
/** Origin point for transformations */
|
|
89
93
|
transformOrigin: z
|
|
90
94
|
.object({
|
|
91
|
-
x: z.number().min(0).max(1).
|
|
92
|
-
y: z.number().min(0).max(1).
|
|
95
|
+
x: z.number().min(0).max(1).prefault(0.5),
|
|
96
|
+
y: z.number().min(0).max(1).prefault(0.5)
|
|
93
97
|
})
|
|
94
98
|
.optional()
|
|
95
99
|
});
|
|
@@ -97,11 +101,13 @@ export const TransformShape = z.object({
|
|
|
97
101
|
* Shadow effect schema
|
|
98
102
|
*/
|
|
99
103
|
export const ShadowShape = z.object({
|
|
100
|
-
enabled: z.boolean().
|
|
104
|
+
enabled: z.boolean().prefault(true).optional(),
|
|
101
105
|
/** Optional preset name */
|
|
102
106
|
preset: z.string().optional(),
|
|
103
107
|
/** Shadow color */
|
|
104
|
-
color: z.string().refine(isValidColor, {
|
|
108
|
+
color: z.string().refine(isValidColor, {
|
|
109
|
+
error: 'Invalid shadow color format'
|
|
110
|
+
}).optional(),
|
|
105
111
|
/** Shadow blur radius in pixels */
|
|
106
112
|
blur: z.number().min(0).optional(),
|
|
107
113
|
/** Shadow size in pixels */
|
|
@@ -117,17 +123,19 @@ export const ShadowShape = z.object({
|
|
|
117
123
|
* Outline/Stroke effect schema
|
|
118
124
|
*/
|
|
119
125
|
export const OutlineShape = z.object({
|
|
120
|
-
enabled: z.boolean().
|
|
126
|
+
enabled: z.boolean().prefault(true).optional(),
|
|
121
127
|
/** Optional preset name */
|
|
122
128
|
preset: z.string().optional(),
|
|
123
129
|
/** Outline color */
|
|
124
|
-
color: z.string().refine(isValidColor, {
|
|
130
|
+
color: z.string().refine(isValidColor, {
|
|
131
|
+
error: 'Invalid outline color format'
|
|
132
|
+
}),
|
|
125
133
|
/** Outline width in pixels */
|
|
126
134
|
size: z.number().min(0).optional(),
|
|
127
135
|
/** Outline opacity (0-1) */
|
|
128
136
|
opacity: z.number().min(0).max(1).optional(),
|
|
129
137
|
/** Outline style (Note: style/dashArray not in schema-llm.md, maybe remove?) */
|
|
130
|
-
style: z.enum(['solid', 'dashed', 'dotted']).
|
|
138
|
+
style: z.enum(['solid', 'dashed', 'dotted']).prefault('solid').optional(),
|
|
131
139
|
/** Custom dash pattern (only for 'dashed' style) */
|
|
132
140
|
dashArray: z.array(z.number()).optional()
|
|
133
141
|
});
|
|
@@ -138,7 +146,7 @@ export const FontSizeShape = z.object({
|
|
|
138
146
|
/** Font size value */
|
|
139
147
|
value: z.number().positive(),
|
|
140
148
|
/** Font size unit */
|
|
141
|
-
unit: z.enum(['px', 'em', 'rem', '%']).
|
|
149
|
+
unit: z.enum(['px', 'em', 'rem', '%']).prefault('px')
|
|
142
150
|
});
|
|
143
151
|
/**
|
|
144
152
|
* Line height with unit schema
|
|
@@ -147,27 +155,31 @@ export const LineHeightShape = z.object({
|
|
|
147
155
|
/** Line height value */
|
|
148
156
|
value: z.number().positive(),
|
|
149
157
|
/** Line height unit */
|
|
150
|
-
unit: z.enum(['normal', 'px', 'em', '%']).
|
|
158
|
+
unit: z.enum(['normal', 'px', 'em', '%']).prefault('normal')
|
|
151
159
|
});
|
|
152
160
|
/**
|
|
153
161
|
* Color with opacity schema
|
|
154
162
|
*/
|
|
155
163
|
export const ColorWithOpacityShape = z.object({
|
|
156
164
|
/** Color value (hex, rgb, rgba, etc.) */
|
|
157
|
-
color: z.string().refine(isValidColor, {
|
|
165
|
+
color: z.string().refine(isValidColor, {
|
|
166
|
+
error: 'Invalid color format'
|
|
167
|
+
}),
|
|
158
168
|
/** Opacity (0-1) */
|
|
159
|
-
opacity: z.number().min(0).max(1).
|
|
169
|
+
opacity: z.number().min(0).max(1).prefault(1)
|
|
160
170
|
});
|
|
161
171
|
/**
|
|
162
172
|
* Gradient stop schema
|
|
163
173
|
*/
|
|
164
174
|
export const GradientStopShape = z.object({
|
|
165
175
|
/** Color value */
|
|
166
|
-
color: z.string().refine(isValidColor, {
|
|
176
|
+
color: z.string().refine(isValidColor, {
|
|
177
|
+
error: 'Invalid gradient color format'
|
|
178
|
+
}),
|
|
167
179
|
/** Position in the gradient (0-1) */
|
|
168
180
|
position: z.number().min(0).max(1),
|
|
169
181
|
/** Opacity (0-1) */
|
|
170
|
-
opacity: z.number().min(0).max(1).
|
|
182
|
+
opacity: z.number().min(0).max(1).prefault(1)
|
|
171
183
|
});
|
|
172
184
|
/**
|
|
173
185
|
* Gradient background schema
|
|
@@ -178,12 +190,12 @@ export const GradientShape = z.object({
|
|
|
178
190
|
/** Gradient stops */
|
|
179
191
|
stops: z.array(GradientStopShape).min(2),
|
|
180
192
|
/** Angle in degrees (for linear gradients) */
|
|
181
|
-
angle: z.number().min(0).max(360).
|
|
193
|
+
angle: z.number().min(0).max(360).prefault(0).optional(),
|
|
182
194
|
/** Center position (for radial gradients) */
|
|
183
195
|
center: z
|
|
184
196
|
.object({
|
|
185
|
-
x: z.number().min(0).max(1).
|
|
186
|
-
y: z.number().min(0).max(1).
|
|
197
|
+
x: z.number().min(0).max(1).prefault(0.5),
|
|
198
|
+
y: z.number().min(0).max(1).prefault(0.5)
|
|
187
199
|
})
|
|
188
200
|
.optional()
|
|
189
201
|
});
|
|
@@ -193,17 +205,17 @@ export const GradientShape = z.object({
|
|
|
193
205
|
*/
|
|
194
206
|
export const AnimationTimingShape = z.object({
|
|
195
207
|
/** Delay before animation starts (in seconds) */
|
|
196
|
-
delay: z.number().min(0).
|
|
208
|
+
delay: z.number().min(0).prefault(0),
|
|
197
209
|
/** Animation duration (in seconds) */
|
|
198
|
-
duration: z.number().min(0).
|
|
210
|
+
duration: z.number().min(0).prefault(1).transform(toFixed3),
|
|
199
211
|
/** Number of times the animation repeats (-1 for infinite) */
|
|
200
|
-
repeat: z.
|
|
212
|
+
repeat: z.int().prefault(0),
|
|
201
213
|
/** Delay between animation repetitions (in seconds) */
|
|
202
|
-
repeatDelay: z.number().min(0).
|
|
214
|
+
repeatDelay: z.number().min(0).prefault(0),
|
|
203
215
|
/** Time between successive animations in seconds (for staggered animations) */
|
|
204
|
-
stagger: z.number().min(0).
|
|
216
|
+
stagger: z.number().min(0).prefault(0),
|
|
205
217
|
/** Whether to reverse the animation on alternate repeats */
|
|
206
|
-
yoyo: z.boolean().
|
|
218
|
+
yoyo: z.boolean().prefault(false)
|
|
207
219
|
});
|
|
208
220
|
/**
|
|
209
221
|
* Animation easing schema
|
|
@@ -261,7 +273,7 @@ export const KeyframeShape = z.object({
|
|
|
261
273
|
/** Time position in seconds relative to animation start */
|
|
262
274
|
time: z.number().min(0).transform(toFixed3),
|
|
263
275
|
/** Target property values at this keyframe */
|
|
264
|
-
value: z.record(z.union([z.string(), z.number(), z.boolean()])),
|
|
276
|
+
value: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])),
|
|
265
277
|
/** Easing to use when transitioning to this keyframe */
|
|
266
278
|
easing: AnimationEasingShape.optional()
|
|
267
279
|
});
|
|
@@ -293,19 +305,19 @@ export const EnhancedAnimationShape = z.object({
|
|
|
293
305
|
/** Preset identifier (for preset animations) */
|
|
294
306
|
presetId: z.string().max(255).optional(),
|
|
295
307
|
/** What the animation targets */
|
|
296
|
-
target: AnimationTargetShape.
|
|
308
|
+
target: AnimationTargetShape.prefault('element'),
|
|
297
309
|
/** Animation timing properties */
|
|
298
|
-
timing: AnimationTimingShape.
|
|
310
|
+
timing: AnimationTimingShape.prefault({}),
|
|
299
311
|
/** Animation easing */
|
|
300
|
-
easing: AnimationEasingShape.
|
|
312
|
+
easing: AnimationEasingShape.prefault('power2.out'),
|
|
301
313
|
/** For keyframe animations: the keyframes */
|
|
302
314
|
keyframes: z.array(KeyframeShape).optional(),
|
|
303
315
|
/** Whether animation plays automatically */
|
|
304
|
-
autoplay: z.boolean().
|
|
316
|
+
autoplay: z.boolean().prefault(true),
|
|
305
317
|
/** Whether to preserve transform styles that aren't explicitly animated */
|
|
306
|
-
preserveTransform: z.boolean().
|
|
318
|
+
preserveTransform: z.boolean().prefault(true),
|
|
307
319
|
/** Additional animation parameters */
|
|
308
|
-
parameters: z.record(z.unknown()).optional()
|
|
320
|
+
parameters: z.record(z.string(), z.unknown()).optional()
|
|
309
321
|
});
|
|
310
322
|
/**
|
|
311
323
|
* Transition schema
|
|
@@ -329,9 +341,9 @@ export const TransitionShape = z.object({
|
|
|
329
341
|
/** Transition direction (for directional transitions) */
|
|
330
342
|
direction: z.enum(['left', 'right', 'up', 'down', 'in', 'out']).optional(),
|
|
331
343
|
/** Transition easing */
|
|
332
|
-
easing: AnimationEasingShape.
|
|
344
|
+
easing: AnimationEasingShape.prefault('power2.inOut'),
|
|
333
345
|
/** Additional transition parameters */
|
|
334
|
-
parameters: z.record(z.unknown()).optional()
|
|
346
|
+
parameters: z.record(z.string(), z.unknown()).optional()
|
|
335
347
|
});
|
|
336
348
|
/**
|
|
337
349
|
* Effect schema base
|
|
@@ -341,9 +353,9 @@ export const EffectBaseShape = z.object({
|
|
|
341
353
|
/** Effect type */
|
|
342
354
|
type: z.string(),
|
|
343
355
|
/** Whether the effect is enabled */
|
|
344
|
-
enabled: z.boolean().
|
|
356
|
+
enabled: z.boolean().prefault(true).optional(),
|
|
345
357
|
/** Effect intensity (0-1) */
|
|
346
|
-
intensity: z.number().min(0).max(1).
|
|
358
|
+
intensity: z.number().min(0).max(1).prefault(1),
|
|
347
359
|
/** Effect mix blend mode */
|
|
348
360
|
blendMode: z
|
|
349
361
|
.enum([
|
|
@@ -364,7 +376,7 @@ export const EffectBaseShape = z.object({
|
|
|
364
376
|
'color',
|
|
365
377
|
'luminosity'
|
|
366
378
|
])
|
|
367
|
-
.
|
|
379
|
+
.prefault('normal')
|
|
368
380
|
});
|
|
369
381
|
/**
|
|
370
382
|
* Blur effect schema
|
|
@@ -372,7 +384,7 @@ export const EffectBaseShape = z.object({
|
|
|
372
384
|
export const BlurEffectShape = EffectBaseShape.extend({
|
|
373
385
|
type: z.literal('blur'),
|
|
374
386
|
/** Blur radius in pixels */
|
|
375
|
-
radius: z.number().min(0).
|
|
387
|
+
radius: z.number().min(0).prefault(5)
|
|
376
388
|
});
|
|
377
389
|
/**
|
|
378
390
|
* Color adjustment effect schema
|
|
@@ -380,13 +392,13 @@ export const BlurEffectShape = EffectBaseShape.extend({
|
|
|
380
392
|
export const ColorAdjustmentEffectShape = EffectBaseShape.extend({
|
|
381
393
|
type: z.literal('colorAdjustment'),
|
|
382
394
|
/** Brightness adjustment (-1 to 1) */
|
|
383
|
-
brightness: z.number().min(-1).max(1).
|
|
395
|
+
brightness: z.number().min(-1).max(1).prefault(0),
|
|
384
396
|
/** Contrast adjustment (-1 to 1) */
|
|
385
|
-
contrast: z.number().min(-1).max(1).
|
|
397
|
+
contrast: z.number().min(-1).max(1).prefault(0),
|
|
386
398
|
/** Saturation adjustment (-1 to 1) */
|
|
387
|
-
saturation: z.number().min(-1).max(1).
|
|
399
|
+
saturation: z.number().min(-1).max(1).prefault(0),
|
|
388
400
|
/** Hue rotation in degrees (0-360) */
|
|
389
|
-
hue: z.number().min(0).max(360).
|
|
401
|
+
hue: z.number().min(0).max(360).prefault(0)
|
|
390
402
|
});
|
|
391
403
|
/**
|
|
392
404
|
* Union of all effect types
|