@shotstack/shotstack-studio 2.16.2 → 2.17.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.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "dazzatron",
7
7
  "kratos2k7"
8
8
  ],
9
- "version": "2.16.2",
9
+ "version": "2.17.0",
10
10
  "description": "A video editing library for creating and editing videos with Shotstack",
11
11
  "type": "module",
12
12
  "main": "dist/shotstack-studio.umd.js",
@@ -99,7 +99,7 @@
99
99
  "vite-plugin-dts": "^4.5.4"
100
100
  },
101
101
  "dependencies": {
102
- "@shotstack/schemas": "1.14.1",
102
+ "@shotstack/schemas": "1.18.0",
103
103
  "@shotstack/shotstack-canvas": "^2.10.2",
104
104
  "howler": "^2.2.4",
105
105
  "mediabunny": "^1.11.2",
package/readme.md CHANGED
@@ -190,6 +190,35 @@ Available event names:
190
190
  | Output | `output:resized`, `output:resolutionChanged`, `output:aspectRatioChanged`, `output:fpsChanged`, `output:formatChanged`, `output:destinationsChanged` |
191
191
  | Merge fields | `mergefield:changed` |
192
192
 
193
+ ### Generating assets from prompts
194
+
195
+ An image, video or audio asset can carry a `prompt`. Rendering generates from the prompt;
196
+ `src`, when present, is the editor preview. Register a generator and the editor offers a
197
+ generate action in the toolbar's generate pane:
198
+
199
+ ```typescript
200
+ edit.registerAssetGenerator(async ({ clipId, asset, signal }) => {
201
+ const url = await myBackend.generate(asset, { signal });
202
+ return { url };
203
+ });
204
+ ```
205
+
206
+ The SDK writes the returned URL to the clip, so the change is undoable and autosaves
207
+ like any other edit. It tracks whether a clip is generating or has failed, and renders
208
+ those states; a rejection's message is shown as-is next to a retry action. Everything
209
+ else — which models exist, what they cost, what an error means — stays with the host.
210
+
211
+ Generation state is transient: it is never saved to the edit, never part of undo, and
212
+ gone on reload. Deleting a clip mid-generation aborts its request via the `signal`.
213
+
214
+ A prompt is the only thing that makes a clip generate. Add one to a plain `image`, `video`
215
+ or `audio` asset to make it generative; clear it and the clip keeps its current `src` and
216
+ stops generating, which is how you hold on to a result you want.
217
+
218
+ Generation is content-addressed, so the same prompt, model and options resolve to the same
219
+ asset on every render. A generator that does not go through Shotstack's own generation
220
+ hands back a preview that the render replaces.
221
+
193
222
  ### Canvas
194
223
 
195
224
  `Canvas` renders the current edit.