@shotstack/shotstack-studio 1.8.0 → 1.8.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.
- package/dist/shotstack-studio.es.js +32774 -46
- package/dist/shotstack-studio.umd.js +33 -31
- package/package.json +6 -3
- package/readme.md +64 -65
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"cpuccino",
|
|
6
6
|
"dazzatron"
|
|
7
7
|
],
|
|
8
|
-
"version": "1.8.
|
|
8
|
+
"version": "1.8.1",
|
|
9
9
|
"description": "A video editing library for creating and editing videos with Shotstack",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "dist/shotstack-studio.umd.js",
|
|
@@ -50,10 +50,12 @@
|
|
|
50
50
|
"build:schema": "vite build --config vite.config.schema.ts",
|
|
51
51
|
"test": "npm run build && jest",
|
|
52
52
|
"test:watch": "jest --watch",
|
|
53
|
+
"test:package": "node test-package.js",
|
|
54
|
+
"typecheck": "tsc --noEmit && tsc --project tsconfig.test.json --noEmit",
|
|
53
55
|
"lint": "eslint --ignore-path .gitignore .",
|
|
54
56
|
"lint:fix": "eslint --ignore-path .gitignore --fix .",
|
|
55
57
|
"format": "prettier --ignore-path .gitignore --write .",
|
|
56
|
-
"prepublishOnly": "npm run build && npm run test"
|
|
58
|
+
"prepublishOnly": "npm run build && npm run test && npm run test:package"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
61
|
"@jest/globals": "^30.2.0",
|
|
@@ -69,13 +71,14 @@
|
|
|
69
71
|
"eslint-config-prettier": "^9.1.0",
|
|
70
72
|
"eslint-plugin-import": "^2.31.0",
|
|
71
73
|
"jest": "^30.2.0",
|
|
74
|
+
"prettier": "^3.6.2",
|
|
72
75
|
"ts-jest": "^29.4.5",
|
|
73
76
|
"typescript": "^5.6.2",
|
|
74
77
|
"vite": "^5.4.10",
|
|
75
78
|
"vite-plugin-dts": "^4.5.4"
|
|
76
79
|
},
|
|
77
80
|
"dependencies": {
|
|
78
|
-
"@shotstack/shotstack-canvas": "^1.
|
|
81
|
+
"@shotstack/shotstack-canvas": "^1.3.0",
|
|
79
82
|
"fast-deep-equal": "^3.1.3",
|
|
80
83
|
"howler": "^2.2.4",
|
|
81
84
|
"mediabunny": "^1.11.2",
|
package/readme.md
CHANGED
|
@@ -97,12 +97,12 @@ edit.stop(); // Stop and return to beginning
|
|
|
97
97
|
|
|
98
98
|
// Editing functions
|
|
99
99
|
edit.addClip(0, {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
asset: {
|
|
101
|
+
type: "image",
|
|
102
|
+
src: "https://example.com/image.jpg"
|
|
103
|
+
},
|
|
104
|
+
start: 0,
|
|
105
|
+
length: 5
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
edit.addTrack(1, { clips: [] });
|
|
@@ -127,15 +127,15 @@ The Edit class provides an event system to listen for specific actions:
|
|
|
127
127
|
```typescript
|
|
128
128
|
// Listen for clip selection events
|
|
129
129
|
edit.events.on("clip:selected", data => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
console.log("Clip selected:", data.clip);
|
|
131
|
+
console.log("Track index:", data.trackIndex);
|
|
132
|
+
console.log("Clip index:", data.clipIndex);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
// Listen for clip update events
|
|
136
136
|
edit.events.on("clip:updated", data => {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
console.log("Previous state:", data.previous); // { clip, trackIndex, clipIndex }
|
|
138
|
+
console.log("Current state:", data.current); // { clip, trackIndex, clipIndex }
|
|
139
139
|
});
|
|
140
140
|
```
|
|
141
141
|
|
|
@@ -234,59 +234,59 @@ Create your own theme by defining colors and dimensions for each component:
|
|
|
234
234
|
|
|
235
235
|
```typescript
|
|
236
236
|
const customTheme = {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
237
|
+
timeline: {
|
|
238
|
+
// Main timeline colors
|
|
239
|
+
background: "#1e1e1e",
|
|
240
|
+
divider: "#1a1a1a",
|
|
241
|
+
playhead: "#ff4444",
|
|
242
|
+
snapGuide: "#888888",
|
|
243
|
+
dropZone: "#00ff00",
|
|
244
|
+
trackInsertion: "#00ff00",
|
|
245
|
+
|
|
246
|
+
// Toolbar styling
|
|
247
|
+
toolbar: {
|
|
248
|
+
background: "#1a1a1a",
|
|
249
|
+
surface: "#2a2a2a", // Button backgrounds
|
|
250
|
+
hover: "#3a3a3a", // Button hover state
|
|
251
|
+
active: "#007acc", // Button active state
|
|
252
|
+
divider: "#3a3a3a", // Separator lines
|
|
253
|
+
icon: "#888888", // Icon colors
|
|
254
|
+
text: "#ffffff", // Text color
|
|
255
|
+
height: 36 // Toolbar height in pixels
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
// Ruler styling
|
|
259
|
+
ruler: {
|
|
260
|
+
background: "#404040",
|
|
261
|
+
text: "#ffffff", // Time labels
|
|
262
|
+
markers: "#666666", // Time marker dots
|
|
263
|
+
height: 40 // Ruler height in pixels
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
// Track styling
|
|
267
|
+
tracks: {
|
|
268
|
+
surface: "#2d2d2d", // Primary track color
|
|
269
|
+
surfaceAlt: "#252525", // Alternating track color
|
|
270
|
+
border: "#3a3a3a", // Track borders
|
|
271
|
+
height: 60 // Track height in pixels
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
// Clip colors by asset type
|
|
275
|
+
clips: {
|
|
276
|
+
video: "#4a9eff",
|
|
277
|
+
audio: "#00d4aa",
|
|
278
|
+
image: "#f5a623",
|
|
279
|
+
text: "#d0021b",
|
|
280
|
+
shape: "#9013fe",
|
|
281
|
+
html: "#50e3c2",
|
|
282
|
+
luma: "#b8e986",
|
|
283
|
+
default: "#8e8e93", // Unknown asset types
|
|
284
|
+
selected: "#007acc", // Selection border
|
|
285
|
+
radius: 4 // Corner radius in pixels
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// Canvas theming will be available in future releases
|
|
289
|
+
// canvas: { ... }
|
|
290
290
|
};
|
|
291
291
|
|
|
292
292
|
const timeline = new Timeline(edit, { width: 1280, height: 300 }, { theme: customTheme });
|
|
@@ -297,7 +297,6 @@ const timeline = new Timeline(edit, { width: 1280, height: 300 }, { theme: custo
|
|
|
297
297
|
Themes are organized by component, making it intuitive to customize specific parts of the interface:
|
|
298
298
|
|
|
299
299
|
- **Timeline**: Controls the appearance of the timeline interface
|
|
300
|
-
|
|
301
300
|
- `toolbar`: Playback controls and buttons
|
|
302
301
|
- `ruler`: Time markers and labels
|
|
303
302
|
- `tracks`: Track backgrounds and borders
|