@shotstack/shotstack-studio 2.16.3 → 2.18.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/dist/index.d.ts +54 -0
- package/dist/internal.d.ts +42 -0
- package/dist/internal.es.js +5904 -5607
- package/dist/internal.umd.js +33 -33
- package/dist/shotstack-studio.es.js +10847 -10184
- package/dist/shotstack-studio.umd.js +237 -183
- package/package.json +2 -2
- package/readme.md +35 -0
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"dazzatron",
|
|
7
7
|
"kratos2k7"
|
|
8
8
|
],
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.18.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.
|
|
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,41 @@ 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
|
+
Pass a model catalogue as the registration's `catalogue` option to show model and option
|
|
207
|
+
controls. Entries must include their option schema; those without one are ignored. The
|
|
208
|
+
[Edit API](https://shotstack.io/docs/api/#shotstack-edit) returns this shape from
|
|
209
|
+
`GET /models?expand=options`. The SDK stores a snapshot; fetching and refreshing it remain
|
|
210
|
+
the host's responsibility.
|
|
211
|
+
|
|
212
|
+
The SDK writes the returned URL to the clip, so the change is undoable and autosaves
|
|
213
|
+
like any other edit. It tracks whether a clip is generating or has failed, and renders
|
|
214
|
+
those states; a rejection's message is shown as-is next to a retry action. Everything
|
|
215
|
+
else — which models exist, what they cost, what an error means — stays with the host.
|
|
216
|
+
|
|
217
|
+
Generation state is transient: it is never saved to the edit, never part of undo, and
|
|
218
|
+
gone on reload. Deleting a clip mid-generation aborts its request via the `signal`.
|
|
219
|
+
|
|
220
|
+
A prompt is the only thing that makes a clip generate. Add one to a plain `image`, `video`
|
|
221
|
+
or `audio` asset to make it generative; clear it and the clip keeps its current `src` and
|
|
222
|
+
stops generating, which is how you hold on to a result you want.
|
|
223
|
+
|
|
224
|
+
Generation is content-addressed, so the same prompt, model and options resolve to the same
|
|
225
|
+
asset on every render. A generator that does not go through Shotstack's own generation
|
|
226
|
+
hands back a preview that the render replaces.
|
|
227
|
+
|
|
193
228
|
### Canvas
|
|
194
229
|
|
|
195
230
|
`Canvas` renders the current edit.
|