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.
@@ -19,7 +19,7 @@ export const SceneAssetMetadataShape = z.object({
19
19
  });
20
20
  export const AssetSubtitleShape = z.object({
21
21
  // id: z.string(),
22
- url: z.string().url().optional(),
22
+ url: z.url().optional(),
23
23
  language_code: z.string().optional(),
24
24
  subtitles: z.array(SubtitleWithCompactWordsShape).optional()
25
25
  });
@@ -36,8 +36,8 @@ export const SceneAssetShape = z.object({
36
36
  subtitles: z.array(AssetSubtitleShape).optional()
37
37
  });
38
38
  export const SceneSubtitlesSettingsShape = z.object({
39
- punctuation: z.boolean().default(true),
40
- mergeGap: z.number().min(0).default(0.2).optional(),
39
+ punctuation: z.boolean().prefault(true),
40
+ mergeGap: z.number().min(0).prefault(0.2).optional(),
41
41
  data: z.record(z.string(), SubtitleCollectionShape).optional()
42
42
  });
43
43
  /**
@@ -59,27 +59,29 @@ export const SceneSettingsShape = z.object({
59
59
  }))
60
60
  .optional(),
61
61
  /** Frame rate for rendering */
62
- fps: z.number().int().positive().default(30),
62
+ fps: z.int().positive().prefault(30),
63
63
  /** Background configuration */
64
64
  backgroundColor: z
65
65
  .union([
66
- z.string().refine(isValidColor, { message: 'Invalid color format' }),
66
+ z.string().refine(isValidColor, {
67
+ error: 'Invalid color format'
68
+ }),
67
69
  z.object({
68
70
  type: z.enum(['linear', 'radial']),
69
71
  colors: z.array(z.string().refine(isValidColor)).min(2),
70
72
  stops: z.array(z.number().min(0).max(1)).optional(),
71
- angle: z.number().min(0).max(360).default(180).optional(),
73
+ angle: z.number().min(0).max(360).prefault(180).optional(),
72
74
  position: z.string().optional(),
73
75
  shape: z.enum(['ellipse', 'circle']).optional()
74
76
  })
75
77
  ])
76
- .default('#FFFFFF'),
78
+ .prefault('#FFFFFF'),
77
79
  /** Audio configuration */
78
80
  audio: z
79
81
  .object({
80
- src: z.string().url().optional(),
81
- volume: z.number().min(0).max(1).default(1),
82
- muted: z.boolean().default(false)
82
+ src: z.url().optional(),
83
+ volume: z.number().min(0).max(1).prefault(1),
84
+ muted: z.boolean().prefault(false)
83
85
  })
84
86
  .optional(),
85
87
  subtitles: SceneSubtitlesSettingsShape.optional()
@@ -94,17 +96,17 @@ export const SceneLayerShape = z.object({
94
96
  /** Optional name for the layer */
95
97
  name: z.string().optional(),
96
98
  /** Layer stacking order (higher values appear on top) */
97
- order: z.number().default(0),
99
+ order: z.number().prefault(0),
98
100
  /** Whether the layer is visible */
99
- visible: z.boolean().default(true),
101
+ visible: z.boolean().prefault(true),
100
102
  /** Whether audio in this layer is muted */
101
- muted: z.boolean().default(false),
103
+ muted: z.boolean().prefault(false),
102
104
  /** Components contained in this layer */
103
105
  components: z
104
106
  .array(
105
107
  // Will be extended with component schemas in components.ts
106
108
  ComponentShape)
107
- .default([])
109
+ .prefault([])
108
110
  });
109
111
  /**
110
112
  * Audio track schema for global audio playback
@@ -113,14 +115,14 @@ export const AudioTrackShape = z.object({
113
115
  id: z.string(),
114
116
  name: z.string().optional(),
115
117
  url: z.string(),
116
- volume: z.number().min(0).max(1).default(1),
118
+ volume: z.number().min(0).max(1).prefault(1),
117
119
  startAt: z.number().min(0).transform(toFixed3),
118
120
  endAt: z
119
121
  .number()
120
122
  .min(0)
121
123
  .optional()
122
124
  .transform((val) => (val === undefined ? undefined : toFixed3(val))),
123
- muted: z.boolean().default(false)
125
+ muted: z.boolean().prefault(false)
124
126
  });
125
127
  /**
126
128
  * Schema for transitions between components
@@ -133,12 +135,12 @@ export const SceneTransitionShape = z.object({
133
135
  type: z.string(),
134
136
  presetId: z.string().optional(),
135
137
  duration: z.number().min(0).transform(toFixed3),
136
- parameters: z.record(z.unknown()).optional()
138
+ parameters: z.record(z.string(), z.unknown()).optional()
137
139
  });
138
140
  /**
139
141
  * Schema for the main scene structure in v2.0
140
142
  */
141
- export const SceneShape = z.object({
143
+ export const SceneShape = z.strictObject({
142
144
  /** Unique identifier for the scene */
143
145
  id: z.string(),
144
146
  /** Schema version */
@@ -146,15 +148,15 @@ export const SceneShape = z.object({
146
148
  /** Optional name for the scene */
147
149
  name: z.string().optional(),
148
150
  /** Scene settings */
149
- settings: SceneSettingsShape.strict(),
151
+ settings: SceneSettingsShape,
150
152
  /** Assets registry */
151
- assets: z.array(SceneAssetShape).default([]),
153
+ assets: z.array(SceneAssetShape).prefault([]),
152
154
  /** Layers in the scene */
153
- layers: z.array(SceneLayerShape.strict()).default([]),
155
+ layers: z.array(SceneLayerShape).prefault([]),
154
156
  /** Scene transitions */
155
- transitions: z.array(SceneTransitionShape).default([]),
157
+ transitions: z.array(SceneTransitionShape).prefault([]),
156
158
  /** Audio tracks */
157
- audioTracks: z.array(AudioTrackShape).default([]),
159
+ audioTracks: z.array(AudioTrackShape).prefault([]),
158
160
  /** Optional checksum */
159
161
  checksum: z.string().optional()
160
162
  });
@@ -1,11 +1,13 @@
1
1
  export * from './core.js';
2
+ export type * from './core.js';
2
3
  export * from './components.js';
3
- export * from './properties.js';
4
- export * from './animations.js';
5
4
  export type * from './components.js';
5
+ export * from './properties.js';
6
6
  export type * from './properties.js';
7
- export type { CompactWordMetadata, CompactWordTuple, SubtitleWord, SubtitleWithCompactWords, SubtitleWithLegacyWords, Subtitle, SubtitleCollection } from './subtitles.js';
7
+ export * from './animations.js';
8
+ export type * from './animations.js';
8
9
  export * from './subtitles.js';
10
+ export type * from './subtitles.js';
9
11
  export type FontType = {
10
12
  alias: string;
11
13
  url?: string;
@@ -6,5 +6,5 @@ export * from './components.js';
6
6
  export * from './properties.js';
7
7
  // Export all schemas from animations.ts
8
8
  export * from './animations.js';
9
- // Re-export subtitle schemas
9
+ // Re-export subtitle types from subtitles.ts
10
10
  export * from './subtitles.js';