@aicut/core 0.4.3 → 0.6.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/README.md +178 -1
- package/dist/chunk-H6AY6NW4.js +123 -0
- package/dist/chunk-H6AY6NW4.js.map +1 -0
- package/dist/chunk-WTCK3XQ6.js +93 -0
- package/dist/chunk-WTCK3XQ6.js.map +1 -0
- package/dist/i18n-B24k4XVG.d.cts +84 -0
- package/dist/i18n-B24k4XVG.d.ts +84 -0
- package/dist/index.cjs +2383 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +523 -6
- package/dist/index.d.ts +523 -6
- package/dist/index.js +2187 -140
- package/dist/index.js.map +1 -1
- package/dist/lighting/index.cjs +24 -6
- package/dist/lighting/index.cjs.map +1 -1
- package/dist/lighting/index.d.cts +2 -1
- package/dist/lighting/index.d.ts +2 -1
- package/dist/lighting/index.js +1 -1
- package/dist/playback/webcodecs/index.cjs +10679 -0
- package/dist/playback/webcodecs/index.cjs.map +1 -0
- package/dist/playback/webcodecs/index.d.cts +125 -0
- package/dist/playback/webcodecs/index.d.ts +125 -0
- package/dist/playback/webcodecs/index.js +10608 -0
- package/dist/playback/webcodecs/index.js.map +1 -0
- package/dist/types-BbZjOQLz.d.ts +108 -0
- package/dist/types-CjvRUPtZ.d.cts +108 -0
- package/dist/types-CmS-UIEr.d.cts +137 -0
- package/dist/types-CmS-UIEr.d.ts +137 -0
- package/package.json +15 -4
- package/styles/theme.css +358 -2
- package/dist/chunk-CCDON7CU.js +0 -87
- package/dist/chunk-CCDON7CU.js.map +0 -1
- package/dist/types-C95koNwJ.d.cts +0 -120
- package/dist/types-C95koNwJ.d.ts +0 -120
package/dist/types-C95koNwJ.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI strings the editor paints into the DOM (toolbar tooltips, the
|
|
3
|
-
* fullscreen exit button) and onto the timeline canvas (phantom new-
|
|
4
|
-
* track label, track header labels). Every user-visible literal in
|
|
5
|
-
* `@aicut/core` flows through this interface — there are no hidden
|
|
6
|
-
* hard-coded translations elsewhere in the library.
|
|
7
|
-
*
|
|
8
|
-
* Defaults to English. Hosts that want Chinese (or any other locale)
|
|
9
|
-
* pass `locale: localeZh` to `Editor.create` / `Timeline.create`, or
|
|
10
|
-
* override individual keys with `locale: { undo: "撤销" }`.
|
|
11
|
-
*/
|
|
12
|
-
interface Locale {
|
|
13
|
-
undo: string;
|
|
14
|
-
redo: string;
|
|
15
|
-
split: string;
|
|
16
|
-
trimLeft: string;
|
|
17
|
-
trimRight: string;
|
|
18
|
-
speedComingSoon: string;
|
|
19
|
-
playPause: string;
|
|
20
|
-
fullscreen: string;
|
|
21
|
-
snap: string;
|
|
22
|
-
/** Title shown on the snap button when snap is ON (clicking turns OFF). */
|
|
23
|
-
snapOnTitle: string;
|
|
24
|
-
/** Title shown when snap is OFF (clicking turns ON). */
|
|
25
|
-
snapOffTitle: string;
|
|
26
|
-
zoomOut: string;
|
|
27
|
-
zoomIn: string;
|
|
28
|
-
reset: string;
|
|
29
|
-
exitFullscreen: string;
|
|
30
|
-
exitFullscreenTitle: string;
|
|
31
|
-
/** Phantom row that appears under the last track during a drag. */
|
|
32
|
-
newTrack: string;
|
|
33
|
-
/** Track header — `{n}` is replaced with the 1-based track index. */
|
|
34
|
-
videoTrackLabel: string;
|
|
35
|
-
/** Same template format as videoTrackLabel. */
|
|
36
|
-
audioTrackLabel: string;
|
|
37
|
-
}
|
|
38
|
-
/** English. The library default — chosen over Chinese as the OSS norm. */
|
|
39
|
-
declare const localeEn: Locale;
|
|
40
|
-
/** Simplified Chinese. */
|
|
41
|
-
declare const localeZh: Locale;
|
|
42
|
-
/** Spread defaults under host overrides — host can supply a partial. */
|
|
43
|
-
declare function mergeLocale(partial: Partial<Locale> | undefined): Locale;
|
|
44
|
-
/**
|
|
45
|
-
* Replace `{key}` placeholders in a template. We only need `{n}`
|
|
46
|
-
* substitution today; the implementation is generic so additional
|
|
47
|
-
* keys (e.g. `{name}`) won't need a second pass.
|
|
48
|
-
*/
|
|
49
|
-
declare function formatLabel(template: string, vars: Record<string, string | number>): string;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Milliseconds. All timing in the project is expressed as integer ms to
|
|
53
|
-
* keep JSON serialization unambiguous (no frame-rate coupling in the
|
|
54
|
-
* data model — the renderer can present time as frames if it wants).
|
|
55
|
-
*/
|
|
56
|
-
type Ms = number;
|
|
57
|
-
interface MediaSource {
|
|
58
|
-
id: string;
|
|
59
|
-
url: string;
|
|
60
|
-
kind: "video" | "audio";
|
|
61
|
-
/** Optional — probed lazily from the <video> element if absent. */
|
|
62
|
-
duration?: Ms;
|
|
63
|
-
name?: string;
|
|
64
|
-
}
|
|
65
|
-
interface Clip {
|
|
66
|
-
id: string;
|
|
67
|
-
sourceId: string;
|
|
68
|
-
/** Window into the source — `in` inclusive, `out` exclusive. */
|
|
69
|
-
in: Ms;
|
|
70
|
-
out: Ms;
|
|
71
|
-
/** Position on the timeline. */
|
|
72
|
-
start: Ms;
|
|
73
|
-
/**
|
|
74
|
-
* Playback rate. 1 = normal, 2 = 2× speed. Default 1.
|
|
75
|
-
* Persisted in the project JSON so a host can restore exactly.
|
|
76
|
-
*/
|
|
77
|
-
speed?: number;
|
|
78
|
-
}
|
|
79
|
-
interface Track {
|
|
80
|
-
id: string;
|
|
81
|
-
kind: "video" | "audio";
|
|
82
|
-
/** Clips on this track. Must be kept sorted by `start` and non-overlapping. */
|
|
83
|
-
clips: Clip[];
|
|
84
|
-
}
|
|
85
|
-
interface Project {
|
|
86
|
-
/** Schema version — bump when breaking the JSON shape. */
|
|
87
|
-
version: 1;
|
|
88
|
-
sources: MediaSource[];
|
|
89
|
-
tracks: Track[];
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Subset of CSS variables the editor honors. Pass any custom values
|
|
93
|
-
* via `Editor` options; everything is forwarded as `--aicut-*` on the
|
|
94
|
-
* editor's root container, so a host can also override via plain CSS.
|
|
95
|
-
*/
|
|
96
|
-
interface Theme {
|
|
97
|
-
brand?: string;
|
|
98
|
-
secondary?: string;
|
|
99
|
-
surface?: string;
|
|
100
|
-
dark?: string;
|
|
101
|
-
muted?: string;
|
|
102
|
-
card?: string;
|
|
103
|
-
success?: string;
|
|
104
|
-
warning?: string;
|
|
105
|
-
info?: string;
|
|
106
|
-
error?: string;
|
|
107
|
-
/** Toolbar / ruler chrome. Background of the editor frame. */
|
|
108
|
-
controlsBg?: string;
|
|
109
|
-
controlsBorder?: string;
|
|
110
|
-
controlsText?: string;
|
|
111
|
-
controlsHover?: string;
|
|
112
|
-
controlsActive?: string;
|
|
113
|
-
/** Letterbox color around the preview video. Defaults to black. */
|
|
114
|
-
previewBg?: string;
|
|
115
|
-
radiusSm?: string;
|
|
116
|
-
radiusMd?: string;
|
|
117
|
-
radiusLg?: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { type Clip as C, type Locale as L, type Ms as M, type Project as P, type Track as T, type MediaSource as a, type Theme as b, localeZh as c, formatLabel as f, localeEn as l, mergeLocale as m };
|