@twick/studio 0.14.10 → 0.14.12
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/components/container/properties-panel-container.d.ts +6 -2
- package/dist/components/panel/audio-panel.d.ts +1 -1
- package/dist/components/panel/image-panel.d.ts +1 -1
- package/dist/components/panel/video-panel.d.ts +1 -1
- package/dist/components/properties/generate-subtitles.d.ts +13 -0
- package/dist/components/shared/media-manager.d.ts +1 -0
- package/dist/helpers/generate-subtitles.service.d.ts +21 -0
- package/dist/hooks/use-studio-operation.d.ts +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +576 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +576 -187
- package/dist/index.mjs.map +1 -1
- package/dist/studio.css +60 -0
- package/dist/types/index.d.ts +54 -1
- package/package.json +8 -8
package/dist/studio.css
CHANGED
|
@@ -1338,6 +1338,11 @@ video::-webkit-media-controls-panel {
|
|
|
1338
1338
|
}.btn-primary:active {
|
|
1339
1339
|
background: linear-gradient(135deg, var(--color-purple-700), var(--color-purple-800), var(--color-purple-900));
|
|
1340
1340
|
box-shadow: 0 6px 20px rgba(147, 51, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1341
|
+
}.btn-primary:disabled {
|
|
1342
|
+
opacity: 0.6;
|
|
1343
|
+
cursor: not-allowed;
|
|
1344
|
+
transform: none;
|
|
1345
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1341
1346
|
}.btn-secondary {
|
|
1342
1347
|
display: inline-flex;
|
|
1343
1348
|
align-items: center;
|
|
@@ -1360,6 +1365,11 @@ video::-webkit-media-controls-panel {
|
|
|
1360
1365
|
background: linear-gradient(135deg, var(--color-purple-100), var(--color-purple-200), var(--color-purple-300));
|
|
1361
1366
|
box-shadow: 0 12px 35px rgba(147, 51, 234, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
|
|
1362
1367
|
transform: translateY(-2px);
|
|
1368
|
+
}.btn-secondary:disabled {
|
|
1369
|
+
opacity: 0.6;
|
|
1370
|
+
cursor: not-allowed;
|
|
1371
|
+
transform: none;
|
|
1372
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1363
1373
|
}.btn-ghost {
|
|
1364
1374
|
display: inline-flex;
|
|
1365
1375
|
align-items: center;
|
|
@@ -1385,6 +1395,11 @@ video::-webkit-media-controls-panel {
|
|
|
1385
1395
|
border-color: rgba(255, 255, 255, 0.2);
|
|
1386
1396
|
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1387
1397
|
transform: translateY(-2px);
|
|
1398
|
+
}.btn-ghost:disabled {
|
|
1399
|
+
opacity: 0.6;
|
|
1400
|
+
cursor: not-allowed;
|
|
1401
|
+
transform: none;
|
|
1402
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1388
1403
|
}.btn-outline {
|
|
1389
1404
|
display: inline-flex;
|
|
1390
1405
|
align-items: center;
|
|
@@ -1409,6 +1424,11 @@ video::-webkit-media-controls-panel {
|
|
|
1409
1424
|
border-color: var(--color-purple-400);
|
|
1410
1425
|
box-shadow: 0 12px 35px rgba(147, 51, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1411
1426
|
transform: translateY(-2px);
|
|
1427
|
+
}.btn-outline:disabled {
|
|
1428
|
+
opacity: 0.6;
|
|
1429
|
+
cursor: not-allowed;
|
|
1430
|
+
transform: none;
|
|
1431
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1412
1432
|
}.btn-danger {
|
|
1413
1433
|
display: inline-flex;
|
|
1414
1434
|
align-items: center;
|
|
@@ -1434,6 +1454,11 @@ video::-webkit-media-controls-panel {
|
|
|
1434
1454
|
}.btn-danger:active {
|
|
1435
1455
|
background: linear-gradient(135deg, var(--color-red-700), var(--color-red-800), var(--color-red-900));
|
|
1436
1456
|
box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1457
|
+
}.btn-danger:disabled {
|
|
1458
|
+
opacity: 0.6;
|
|
1459
|
+
cursor: not-allowed;
|
|
1460
|
+
transform: none;
|
|
1461
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1437
1462
|
}.btn-primary {
|
|
1438
1463
|
background: linear-gradient(135deg, var(--color-purple-600), var(--color-purple-700));
|
|
1439
1464
|
color: white;
|
|
@@ -1442,6 +1467,11 @@ video::-webkit-media-controls-panel {
|
|
|
1442
1467
|
}.btn-primary:hover {
|
|
1443
1468
|
background: linear-gradient(135deg, var(--color-purple-500), var(--color-purple-600));
|
|
1444
1469
|
box-shadow: 0 8px 25px rgba(147, 51, 234, 0.35);
|
|
1470
|
+
}.btn-primary:disabled {
|
|
1471
|
+
opacity: 0.6;
|
|
1472
|
+
cursor: not-allowed;
|
|
1473
|
+
transform: none;
|
|
1474
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1445
1475
|
}/* ========================================
|
|
1446
1476
|
INPUT UTILITIES
|
|
1447
1477
|
======================================== */.input {
|
|
@@ -1936,6 +1966,11 @@ video::-webkit-media-controls-panel {
|
|
|
1936
1966
|
}.btn-primary:active {
|
|
1937
1967
|
background: linear-gradient(135deg, var(--color-purple-700), var(--color-purple-800), var(--color-purple-900));
|
|
1938
1968
|
box-shadow: 0 6px 20px rgba(147, 51, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1969
|
+
}.btn-primary:disabled {
|
|
1970
|
+
opacity: 0.6;
|
|
1971
|
+
cursor: not-allowed;
|
|
1972
|
+
transform: none;
|
|
1973
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1939
1974
|
}.btn-secondary {
|
|
1940
1975
|
display: inline-flex;
|
|
1941
1976
|
align-items: center;
|
|
@@ -1958,6 +1993,11 @@ video::-webkit-media-controls-panel {
|
|
|
1958
1993
|
background: linear-gradient(135deg, var(--color-purple-100), var(--color-purple-200), var(--color-purple-300));
|
|
1959
1994
|
box-shadow: 0 12px 35px rgba(147, 51, 234, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
|
|
1960
1995
|
transform: translateY(-2px);
|
|
1996
|
+
}.btn-secondary:disabled {
|
|
1997
|
+
opacity: 0.6;
|
|
1998
|
+
cursor: not-allowed;
|
|
1999
|
+
transform: none;
|
|
2000
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1961
2001
|
}.btn-ghost {
|
|
1962
2002
|
display: inline-flex;
|
|
1963
2003
|
align-items: center;
|
|
@@ -1983,6 +2023,11 @@ video::-webkit-media-controls-panel {
|
|
|
1983
2023
|
border-color: rgba(255, 255, 255, 0.2);
|
|
1984
2024
|
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
1985
2025
|
transform: translateY(-2px);
|
|
2026
|
+
}.btn-ghost:disabled {
|
|
2027
|
+
opacity: 0.6;
|
|
2028
|
+
cursor: not-allowed;
|
|
2029
|
+
transform: none;
|
|
2030
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
1986
2031
|
}.btn-outline {
|
|
1987
2032
|
display: inline-flex;
|
|
1988
2033
|
align-items: center;
|
|
@@ -2007,6 +2052,11 @@ video::-webkit-media-controls-panel {
|
|
|
2007
2052
|
border-color: var(--color-purple-400);
|
|
2008
2053
|
box-shadow: 0 12px 35px rgba(147, 51, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
2009
2054
|
transform: translateY(-2px);
|
|
2055
|
+
}.btn-outline:disabled {
|
|
2056
|
+
opacity: 0.6;
|
|
2057
|
+
cursor: not-allowed;
|
|
2058
|
+
transform: none;
|
|
2059
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
2010
2060
|
}.btn-danger {
|
|
2011
2061
|
display: inline-flex;
|
|
2012
2062
|
align-items: center;
|
|
@@ -2032,6 +2082,11 @@ video::-webkit-media-controls-panel {
|
|
|
2032
2082
|
}.btn-danger:active {
|
|
2033
2083
|
background: linear-gradient(135deg, var(--color-red-700), var(--color-red-800), var(--color-red-900));
|
|
2034
2084
|
box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
2085
|
+
}.btn-danger:disabled {
|
|
2086
|
+
opacity: 0.6;
|
|
2087
|
+
cursor: not-allowed;
|
|
2088
|
+
transform: none;
|
|
2089
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
2035
2090
|
}.btn-primary {
|
|
2036
2091
|
background: linear-gradient(135deg, var(--color-purple-600), var(--color-purple-700));
|
|
2037
2092
|
color: white;
|
|
@@ -2040,6 +2095,11 @@ video::-webkit-media-controls-panel {
|
|
|
2040
2095
|
}.btn-primary:hover {
|
|
2041
2096
|
background: linear-gradient(135deg, var(--color-purple-500), var(--color-purple-600));
|
|
2042
2097
|
box-shadow: 0 8px 25px rgba(147, 51, 234, 0.35);
|
|
2098
|
+
}.btn-primary:disabled {
|
|
2099
|
+
opacity: 0.6;
|
|
2100
|
+
cursor: not-allowed;
|
|
2101
|
+
transform: none;
|
|
2102
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
2043
2103
|
}/* ========================================
|
|
2044
2104
|
INPUT UTILITIES
|
|
2045
2105
|
======================================== */.input {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProjectJSON, Size, TrackElement } from '@twick/timeline';
|
|
1
|
+
import { ProjectJSON, Size, TrackElement, VideoElement } from '@twick/timeline';
|
|
2
2
|
import { VideoEditorConfig } from '@twick/video-editor';
|
|
3
3
|
|
|
4
4
|
export interface MediaItem {
|
|
@@ -26,9 +26,62 @@ export interface Result {
|
|
|
26
26
|
message: string;
|
|
27
27
|
result?: any;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Subtitle entry format used for timeline integration
|
|
31
|
+
*/
|
|
32
|
+
export interface SubtitleEntry {
|
|
33
|
+
s: number;
|
|
34
|
+
e: number;
|
|
35
|
+
t: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Response from POST /generate-subtitles
|
|
39
|
+
*/
|
|
40
|
+
export interface GenerateSubtitlesResponse {
|
|
41
|
+
reqId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface RequestStatus {
|
|
44
|
+
status: "pending" | "completed" | "failed";
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Response from GET /request-status when status is pending
|
|
48
|
+
*/
|
|
49
|
+
export interface RequestStatusPending {
|
|
50
|
+
status: "pending";
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Response from GET /request-status when status is ready
|
|
54
|
+
*/
|
|
55
|
+
export interface RequestStatusCompleted {
|
|
56
|
+
status: "completed";
|
|
57
|
+
subtitles: SubtitleEntry[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Union type for request status responses
|
|
61
|
+
*/
|
|
62
|
+
export type RequestStatusResponse = RequestStatusPending | RequestStatusCompleted;
|
|
63
|
+
export interface ISubtitleGenerationPollingResponse {
|
|
64
|
+
status: "pending" | "completed" | "failed";
|
|
65
|
+
subtitles?: SubtitleEntry[];
|
|
66
|
+
error?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ISubtitleGenerationService {
|
|
69
|
+
generateSubtitles: (videoElement: VideoElement, project: ProjectJSON) => Promise<string>;
|
|
70
|
+
updateProjectWithSubtitles: (subtitles: SubtitleEntry[]) => ProjectJSON;
|
|
71
|
+
generateSubtitleVideo?: (videoUrl: string, videoSize?: {
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
}) => Promise<string>;
|
|
75
|
+
getRequestStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
|
|
76
|
+
}
|
|
29
77
|
export interface StudioConfig extends VideoEditorConfig {
|
|
30
78
|
saveProject?: (project: ProjectJSON, fileName: string) => Promise<Result>;
|
|
31
79
|
loadProject?: () => Promise<ProjectJSON>;
|
|
80
|
+
/**
|
|
81
|
+
* Subtitle generation service for polling-based async subtitle generation
|
|
82
|
+
* Implement this in your application code to provide API endpoints
|
|
83
|
+
*/
|
|
84
|
+
subtitleGenerationService?: ISubtitleGenerationService;
|
|
32
85
|
exportVideo?: (project: ProjectJSON, videoSettings: VideoSettings) => Promise<Result>;
|
|
33
86
|
}
|
|
34
87
|
export interface PanelProps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twick/studio",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@twick/media-utils": "^0.14.
|
|
27
|
-
"@twick/timeline": "^0.14.
|
|
28
|
-
"@twick/live-player": "^0.14.
|
|
29
|
-
"@twick/video-editor": "^0.14.
|
|
26
|
+
"@twick/media-utils": "^0.14.11",
|
|
27
|
+
"@twick/timeline": "^0.14.11",
|
|
28
|
+
"@twick/live-player": "^0.14.11",
|
|
29
|
+
"@twick/video-editor": "^0.14.11"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"lucide-react": "^0.511.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@types/node": "^20.11.24",
|
|
38
38
|
"@types/react": "^18.2.55",
|
|
39
39
|
"@types/react-dom": "^18.2.19",
|
|
40
|
-
"@twick/timeline": "^0.14.
|
|
41
|
-
"@twick/live-player": "^0.14.
|
|
42
|
-
"@twick/video-editor": "^0.14.
|
|
40
|
+
"@twick/timeline": "^0.14.11",
|
|
41
|
+
"@twick/live-player": "^0.14.11",
|
|
42
|
+
"@twick/video-editor": "^0.14.11",
|
|
43
43
|
"rimraf": "^5.0.5",
|
|
44
44
|
"typedoc": "^0.25.8",
|
|
45
45
|
"typedoc-plugin-markdown": "^3.17.1",
|