@shotstack/schemas 1.11.0-html5.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -928,6 +928,11 @@
928
928
  "Clip": {
929
929
  "description": "A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.",
930
930
  "properties": {
931
+ "id": {
932
+ "description": "Optional client-generated identifier. Used by client SDKs (e.g. the Shotstack Studio SDK) to reference a clip across edits without relying on its position in the timeline. The render API does not use this field and it does not appear in render output.",
933
+ "type": "string",
934
+ "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
935
+ },
931
936
  "asset": {
932
937
  "$ref": "#/components/schemas/Asset"
933
938
  },
@@ -2361,27 +2366,9 @@
2361
2366
  "example": ".card { font-family: 'Inter'; padding: 32px; }"
2362
2367
  },
2363
2368
  "js": {
2364
- "description": "Optional JavaScript. Use for chart libraries, animations, or DOM manipulation.",
2369
+ "description": "Optional JavaScript. Use for chart libraries, animations, or DOM manipulation. `gsap`, `d3`, `anime` and `lottie` are always available. CSS animations, transitions, and `Element.animate()` are also captured automatically.\n",
2365
2370
  "type": "string",
2366
- "example": "Chart.bar('#chart', { data: [1, 2, 3] });"
2367
- },
2368
- "libraries": {
2369
- "description": "Optional list of approved libraries to auto-inject as `<script>` tags before the\nuser JS runs.\n\nSupported libraries (write your animations normally — no contract required):\n- `gsap` — GSAP timeline + tweens.\n- `d3` — D3.js for data-driven SVG generation. Combine with `gsap` for animation;\n D3's own transitions are not seekable and won't capture deterministically.\n- `anime` — anime.js v3.\n- `lottie` — Lottie SVG renderer for designer-exported Bodymovin JSON.\n\nCSS animations, transitions, and `Element.animate()` are also captured automatically.\n\nMost assets need nothing more than the library itself plus your animation code.\nFor custom hand-rolled animation engines (not in the list above), expose your own\nseek hook by setting `window.__shotstackSeek = (timeMs) => { ... }`.\n",
2370
- "type": "array",
2371
- "items": {
2372
- "type": "string",
2373
- "enum": [
2374
- "gsap",
2375
- "d3",
2376
- "anime",
2377
- "lottie"
2378
- ]
2379
- },
2380
- "uniqueItems": true,
2381
- "maxItems": 4,
2382
- "example": [
2383
- "gsap"
2384
- ]
2371
+ "example": "gsap.to('.card', { x: 200, duration: 1 });"
2385
2372
  }
2386
2373
  },
2387
2374
  "additionalProperties": false,
@@ -3,6 +3,16 @@
3
3
  "strict": true,
4
4
  "schema": {
5
5
  "properties": {
6
+ "id": {
7
+ "anyOf": [
8
+ {
9
+ "type": "string"
10
+ },
11
+ {
12
+ "type": "null"
13
+ }
14
+ ]
15
+ },
6
16
  "asset": {
7
17
  "$ref": "#/$defs/Asset"
8
18
  },
@@ -215,6 +225,7 @@
215
225
  },
216
226
  "additionalProperties": false,
217
227
  "required": [
228
+ "id",
218
229
  "asset",
219
230
  "start",
220
231
  "length",
@@ -187,6 +187,16 @@
187
187
  },
188
188
  "Clip": {
189
189
  "properties": {
190
+ "id": {
191
+ "anyOf": [
192
+ {
193
+ "type": "string"
194
+ },
195
+ {
196
+ "type": "null"
197
+ }
198
+ ]
199
+ },
190
200
  "asset": {
191
201
  "$ref": "#/$defs/Asset"
192
202
  },
@@ -399,6 +409,7 @@
399
409
  },
400
410
  "additionalProperties": false,
401
411
  "required": [
412
+ "id",
402
413
  "asset",
403
414
  "start",
404
415
  "length",
@@ -145,6 +145,17 @@
145
145
  "Clip": {
146
146
  "description": "A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.",
147
147
  "properties": {
148
+ "id": {
149
+ "anyOf": [
150
+ {
151
+ "type": "string",
152
+ "description": "Optional client-generated identifier. Used by client SDKs (e.g. the Shotstack Studio SDK) to reference a clip across edits without relying on its position in the timeline. The render API does not use this field and it does not appear in render output."
153
+ },
154
+ {
155
+ "type": "null"
156
+ }
157
+ ]
158
+ },
148
159
  "asset": {
149
160
  "$ref": "#/$defs/Asset"
150
161
  },
@@ -378,6 +389,7 @@
378
389
  },
379
390
  "additionalProperties": false,
380
391
  "required": [
392
+ "id",
381
393
  "asset",
382
394
  "start",
383
395
  "length",
@@ -63,6 +63,16 @@
63
63
  },
64
64
  "Clip": {
65
65
  "properties": {
66
+ "id": {
67
+ "anyOf": [
68
+ {
69
+ "type": "string"
70
+ },
71
+ {
72
+ "type": "null"
73
+ }
74
+ ]
75
+ },
66
76
  "asset": {
67
77
  "$ref": "#/$defs/Asset"
68
78
  },
@@ -168,6 +178,7 @@
168
178
  },
169
179
  "additionalProperties": false,
170
180
  "required": [
181
+ "id",
171
182
  "asset",
172
183
  "start",
173
184
  "length",
@@ -131,6 +131,16 @@
131
131
  },
132
132
  "Clip": {
133
133
  "properties": {
134
+ "id": {
135
+ "anyOf": [
136
+ {
137
+ "type": "string"
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ]
143
+ },
134
144
  "asset": {
135
145
  "$ref": "#/$defs/Asset"
136
146
  },
@@ -343,6 +353,7 @@
343
353
  },
344
354
  "additionalProperties": false,
345
355
  "required": [
356
+ "id",
346
357
  "asset",
347
358
  "start",
348
359
  "length",
@@ -18,6 +18,16 @@
18
18
  "$defs": {
19
19
  "Clip": {
20
20
  "properties": {
21
+ "id": {
22
+ "anyOf": [
23
+ {
24
+ "type": "string"
25
+ },
26
+ {
27
+ "type": "null"
28
+ }
29
+ ]
30
+ },
21
31
  "asset": {
22
32
  "$ref": "#/$defs/Asset"
23
33
  },
@@ -230,6 +240,7 @@
230
240
  },
231
241
  "additionalProperties": false,
232
242
  "required": [
243
+ "id",
233
244
  "asset",
234
245
  "start",
235
246
  "length",
package/dist/schema.d.ts CHANGED
@@ -457,6 +457,11 @@ export interface components {
457
457
  };
458
458
  /** @description A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it. */
459
459
  Clip: {
460
+ /**
461
+ * @description Optional client-generated identifier. Used by client SDKs (e.g. the Shotstack Studio SDK) to reference a clip across edits without relying on its position in the timeline. The render API does not use this field and it does not appear in render output.
462
+ * @example f47ac10b-58cc-4372-a567-0e02b2c3d479
463
+ */
464
+ id?: string;
460
465
  asset: components["schemas"]["Asset"];
461
466
  /** @description The start position of the Clip on the timeline. */
462
467
  start: number | string;
@@ -1284,31 +1289,10 @@ export interface components {
1284
1289
  */
1285
1290
  css?: string;
1286
1291
  /**
1287
- * @description Optional JavaScript. Use for chart libraries, animations, or DOM manipulation.
1288
- * @example Chart.bar('#chart', { data: [1, 2, 3] });
1292
+ * @description Optional JavaScript. Use for chart libraries, animations, or DOM manipulation. `gsap`, `d3`, `anime` and `lottie` are always available. CSS animations, transitions, and `Element.animate()` are also captured automatically.
1293
+ * @example gsap.to('.card', { x: 200, duration: 1 });
1289
1294
  */
1290
1295
  js?: string;
1291
- /**
1292
- * @description Optional list of approved libraries to auto-inject as `<script>` tags before the
1293
- * user JS runs.
1294
- *
1295
- * Supported libraries (write your animations normally — no contract required):
1296
- * - `gsap` — GSAP timeline + tweens.
1297
- * - `d3` — D3.js for data-driven SVG generation. Combine with `gsap` for animation;
1298
- * D3's own transitions are not seekable and won't capture deterministically.
1299
- * - `anime` — anime.js v3.
1300
- * - `lottie` — Lottie SVG renderer for designer-exported Bodymovin JSON.
1301
- *
1302
- * CSS animations, transitions, and `Element.animate()` are also captured automatically.
1303
- *
1304
- * Most assets need nothing more than the library itself plus your animation code.
1305
- * For custom hand-rolled animation engines (not in the list above), expose your own
1306
- * seek hook by setting `window.__shotstackSeek = (timeMs) => { ... }`.
1307
- * @example [
1308
- * "gsap"
1309
- * ]
1310
- */
1311
- libraries?: ("gsap" | "d3" | "anime" | "lottie")[];
1312
1296
  };
1313
1297
  /**
1314
1298
  * @deprecated
@@ -427,13 +427,7 @@ exports.html5AssetHtml5AssetSchema = zod_1.z.object({
427
427
  type: zod_1.z.enum(['html5']),
428
428
  html: zod_1.z.string(),
429
429
  css: zod_1.z.optional(zod_1.z.string()),
430
- js: zod_1.z.optional(zod_1.z.string()),
431
- libraries: zod_1.z.optional(zod_1.z.array(zod_1.z.enum([
432
- 'gsap',
433
- 'd3',
434
- 'anime',
435
- 'lottie'
436
- ])).max(4))
430
+ js: zod_1.z.optional(zod_1.z.string())
437
431
  }).strict();
438
432
  exports.html5AssetSchema = exports.html5AssetHtml5AssetSchema;
439
433
  /**
@@ -2394,6 +2388,7 @@ exports.assetSchema = exports.assetAssetSchema;
2394
2388
  * A clip is a container for a specific type of asset, i.e. a title, image, video, audio or html. You use a Clip to define when an asset will display on the timeline, how long it will play for and transitions, filters and effects to apply to it.
2395
2389
  */
2396
2390
  exports.clipClipSchema = zod_1.z.object({
2391
+ id: zod_1.z.optional(zod_1.z.string()),
2397
2392
  asset: exports.assetAssetSchema,
2398
2393
  start: zod_1.z.union([
2399
2394
  zod_1.z.union([zod_1.z.preprocess(((v) => { if (v === '' || v === null || v === undefined)