@shotstack/shotstack-studio 1.1.1 → 1.2.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/core/entities/player.d.ts +2 -0
- package/dist/core/shotstack-canvas.d.ts +1 -0
- package/dist/shotstack-studio.es.js +408 -341
- package/dist/shotstack-studio.umd.js +6 -6
- package/package.json +1 -1
- package/readme.md +12 -15
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -126,11 +126,18 @@ edit.events.on("clip:selected", data => {
|
|
|
126
126
|
console.log("Track index:", data.trackIndex);
|
|
127
127
|
console.log("Clip index:", data.clipIndex);
|
|
128
128
|
});
|
|
129
|
+
|
|
130
|
+
// Listen for clip update events
|
|
131
|
+
edit.events.on("clip:updated", data => {
|
|
132
|
+
console.log("Previous state:", data.previous); // { clip, trackIndex, clipIndex }
|
|
133
|
+
console.log("Current state:", data.current); // { clip, trackIndex, clipIndex }
|
|
134
|
+
});
|
|
129
135
|
```
|
|
130
136
|
|
|
131
137
|
Available events:
|
|
132
138
|
|
|
133
|
-
- `clip:selected` - Emitted when a clip is selected, providing data about the clip, its track index, and clip index
|
|
139
|
+
- `clip:selected` - Emitted when a clip is initially selected, providing data about the clip, its track index, and clip index.
|
|
140
|
+
- `clip:updated` - Emitted when a clip's properties are modified, providing both previous and current states.
|
|
134
141
|
|
|
135
142
|
### Canvas
|
|
136
143
|
|
|
@@ -145,6 +152,7 @@ await canvas.load();
|
|
|
145
152
|
canvas.centerEdit();
|
|
146
153
|
canvas.zoomToFit();
|
|
147
154
|
canvas.setZoom(1.5); // 1.0 is 100%, 0.5 is 50%, etc.
|
|
155
|
+
canvas.dispose(); // Clean up resources when done
|
|
148
156
|
```
|
|
149
157
|
|
|
150
158
|
### Controls
|
|
@@ -271,20 +279,8 @@ Creates a new Edit instance with the specified dimensions and background color.
|
|
|
271
279
|
|
|
272
280
|
#### Events
|
|
273
281
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
```typescript
|
|
277
|
-
// Listen for clip selection events
|
|
278
|
-
edit.events.on("clip:selected", data => {
|
|
279
|
-
console.log("Clip selected:", data.clip);
|
|
280
|
-
console.log("Track index:", data.trackIndex);
|
|
281
|
-
console.log("Clip index:", data.clipIndex);
|
|
282
|
-
});
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Available events:
|
|
286
|
-
|
|
287
|
-
- `clip:selected` - Emitted when a clip is selected, providing data about the clip, its track index, and clip index
|
|
282
|
+
- `clip:selected` - Triggered when a clip is selected
|
|
283
|
+
- `clip:updated` - Triggered when a clip is modified
|
|
288
284
|
|
|
289
285
|
### Canvas
|
|
290
286
|
|
|
@@ -309,6 +305,7 @@ Creates a new canvas with specified dimensions for rendering the edit.
|
|
|
309
305
|
- `centerEdit()` - Center the edit in the canvas
|
|
310
306
|
- `zoomToFit()` - Zoom to fit the entire edit
|
|
311
307
|
- `setZoom(zoom: number)` - Set zoom level
|
|
308
|
+
- `dispose()` - Clean up resources and remove the canvas from the DOM
|
|
312
309
|
|
|
313
310
|
### Controls
|
|
314
311
|
|