@shotstack/shotstack-studio 1.3.0 → 1.4.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/index.d.ts +5030 -4
- package/dist/shotstack-studio.es.js +4912 -4754
- package/dist/shotstack-studio.umd.js +7 -7
- package/package.json +4 -3
- package/readme.md +10 -0
- package/dist/core/animations/curve-interpolator.d.ts +0 -6
- package/dist/core/animations/effect-preset-builder.d.ts +0 -18
- package/dist/core/animations/keyframe-builder.d.ts +0 -12
- package/dist/core/animations/transition-preset-builder.d.ts +0 -20
- package/dist/core/entities/base/entity.d.ts +0 -5
- package/dist/core/entities/base/player.d.ts +0 -75
- package/dist/core/entities/index.d.ts +0 -14
- package/dist/core/entities/players/audio-player.d.ts +0 -17
- package/dist/core/entities/players/html-player.d.ts +0 -17
- package/dist/core/entities/players/image-player.d.ts +0 -15
- package/dist/core/entities/players/luma-player.d.ts +0 -18
- package/dist/core/entities/players/shape-player.d.ts +0 -15
- package/dist/core/entities/players/text-player.d.ts +0 -19
- package/dist/core/entities/players/video-player.d.ts +0 -22
- package/dist/core/entities/system/edit.d.ts +0 -46
- package/dist/core/entities/system/inspector.d.ts +0 -18
- package/dist/core/entities/text/text-cursor.d.ts +0 -47
- package/dist/core/entities/text/text-editor.d.ts +0 -43
- package/dist/core/entities/text/text-input-handler.d.ts +0 -54
- package/dist/core/events/asset-load-tracker.d.ts +0 -16
- package/dist/core/events/event-emitter.d.ts +0 -10
- package/dist/core/export/video-exporter.d.ts +0 -17
- package/dist/core/inputs/controls.d.ts +0 -11
- package/dist/core/inputs/pointer.d.ts +0 -4
- package/dist/core/layouts/geometry.d.ts +0 -8
- package/dist/core/layouts/position-builder.d.ts +0 -8
- package/dist/core/loaders/asset-loader.d.ts +0 -17
- package/dist/core/loaders/audio-load-parser.d.ts +0 -11
- package/dist/core/loaders/font-load-parser.d.ts +0 -13
- package/dist/core/schemas/asset.d.ts +0 -644
- package/dist/core/schemas/audio-asset.d.ts +0 -78
- package/dist/core/schemas/clip.d.ts +0 -1171
- package/dist/core/schemas/edit.d.ts +0 -4033
- package/dist/core/schemas/html-asset.d.ts +0 -27
- package/dist/core/schemas/image-asset.d.ts +0 -57
- package/dist/core/schemas/keyframe.d.ts +0 -26
- package/dist/core/schemas/luma-asset.d.ts +0 -13
- package/dist/core/schemas/shape-asset.d.ts +0 -199
- package/dist/core/schemas/text-asset.d.ts +0 -155
- package/dist/core/schemas/track.d.ts +0 -1477
- package/dist/core/schemas/video-asset.d.ts +0 -122
- package/dist/core/shotstack-canvas.d.ts +0 -25
- package/dist/main.d.ts +0 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"cpuccino",
|
|
6
6
|
"dazzatron"
|
|
7
7
|
],
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.4.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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"url": "https://github.com/shotstack/shotstack-studio-sdk"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "vite build
|
|
31
|
+
"build": "vite build",
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"eslint-config-prettier": "^9.1.0",
|
|
47
47
|
"eslint-plugin-import": "^2.31.0",
|
|
48
48
|
"typescript": "^5.6.2",
|
|
49
|
-
"vite": "^5.4.10"
|
|
49
|
+
"vite": "^5.4.10",
|
|
50
|
+
"vite-plugin-dts": "^4.5.4"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
53
|
"howler": "^2.2.4",
|
package/readme.md
CHANGED
|
@@ -109,6 +109,10 @@ edit.addTrack(1, { clips: [] });
|
|
|
109
109
|
edit.deleteClip(0, 0);
|
|
110
110
|
edit.deleteTrack(1);
|
|
111
111
|
|
|
112
|
+
// Undo/Redo
|
|
113
|
+
edit.undo();
|
|
114
|
+
edit.redo();
|
|
115
|
+
|
|
112
116
|
// Get edit information
|
|
113
117
|
const clip = edit.getClip(0, 0);
|
|
114
118
|
const track = edit.getTrack(0);
|
|
@@ -174,6 +178,8 @@ await controls.load();
|
|
|
174
178
|
// Shift + Arrow - Seek larger amount
|
|
175
179
|
// Comma - Step backward one frame
|
|
176
180
|
// Period - Step forward one frame
|
|
181
|
+
// Cmd/Ctrl + Z - Undo
|
|
182
|
+
// Cmd/Ctrl + Shift + Z - Redo
|
|
177
183
|
```
|
|
178
184
|
|
|
179
185
|
### VideoExporter
|
|
@@ -277,11 +283,15 @@ Creates a new Edit instance with the specified dimensions and background color.
|
|
|
277
283
|
- `getTrack(trackIdx: number)` - Get a track by index
|
|
278
284
|
- `deleteTrack(trackIdx: number)` - Delete a track
|
|
279
285
|
- `getEdit()` - Get the full edit configuration as a JSON object
|
|
286
|
+
- `undo()` - Undo the last editing operation
|
|
287
|
+
- `redo()` - Redo the last undone operation
|
|
280
288
|
|
|
281
289
|
#### Events
|
|
282
290
|
|
|
283
291
|
- `clip:selected` - Triggered when a clip is selected
|
|
284
292
|
- `clip:updated` - Triggered when a clip is modified
|
|
293
|
+
- `edit:undo` - Triggered when an undo operation is performed
|
|
294
|
+
- `edit:redo` - Triggered when a redo operation is performed
|
|
285
295
|
|
|
286
296
|
### Canvas
|
|
287
297
|
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../schemas/clip";
|
|
3
|
-
import { type Keyframe } from "../schemas/keyframe";
|
|
4
|
-
export type EffectKeyframeSet = {
|
|
5
|
-
offsetXKeyframes: Keyframe[];
|
|
6
|
-
offsetYKeyframes: Keyframe[];
|
|
7
|
-
opacityKeyframes: Keyframe[];
|
|
8
|
-
scaleKeyframes: Keyframe[];
|
|
9
|
-
rotationKeyframes: Keyframe[];
|
|
10
|
-
};
|
|
11
|
-
export declare class EffectPresetBuilder {
|
|
12
|
-
private clipConfiguration;
|
|
13
|
-
constructor(clipConfiguration: Clip);
|
|
14
|
-
build(editSize: Size, clipSize: Size): EffectKeyframeSet;
|
|
15
|
-
private getPresetName;
|
|
16
|
-
private getZoomSpeed;
|
|
17
|
-
private getSlideStart;
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Keyframe } from "../schemas/keyframe";
|
|
2
|
-
export declare class KeyframeBuilder {
|
|
3
|
-
private readonly property;
|
|
4
|
-
private readonly length;
|
|
5
|
-
private readonly cubicBuilder;
|
|
6
|
-
constructor(value: Keyframe[] | number, length: number, initialValue?: number);
|
|
7
|
-
getValue(time: number): number;
|
|
8
|
-
private createKeyframes;
|
|
9
|
-
private createNormalizedKeyframes;
|
|
10
|
-
private validateKeyframes;
|
|
11
|
-
private insertFillerKeyframes;
|
|
12
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Clip } from "../schemas/clip";
|
|
2
|
-
import { type Keyframe } from "../schemas/keyframe";
|
|
3
|
-
export type TransitionKeyframeSet = {
|
|
4
|
-
offsetXKeyframes: Keyframe[];
|
|
5
|
-
offsetYKeyframes: Keyframe[];
|
|
6
|
-
opacityKeyframes: Keyframe[];
|
|
7
|
-
scaleKeyframes: Keyframe[];
|
|
8
|
-
rotationKeyframes: Keyframe[];
|
|
9
|
-
};
|
|
10
|
-
export declare class TransitionPresetBuilder {
|
|
11
|
-
private clipConfiguration;
|
|
12
|
-
constructor(clipConfiguration: Clip);
|
|
13
|
-
build(): TransitionKeyframeSet;
|
|
14
|
-
private buildInPreset;
|
|
15
|
-
private buildOutPreset;
|
|
16
|
-
private getInPresetName;
|
|
17
|
-
private getOutPresetName;
|
|
18
|
-
private getInPresetLength;
|
|
19
|
-
private getOutPresetLength;
|
|
20
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { type Size, type Vector } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { type Edit } from "../system/edit";
|
|
4
|
-
import { Entity } from "./entity";
|
|
5
|
-
/**
|
|
6
|
-
* TODO: Move handles on UI level (screen space)
|
|
7
|
-
* TODO: Handle overlapping frames - ex: length of a clip is 1.5s but there's an in (1s) and out (1s) transition
|
|
8
|
-
* TODO: Scale X and Y needs to be implemented separately for getFitScale cover
|
|
9
|
-
* TODO: Move animation effects and transitions out of player
|
|
10
|
-
* TODO: On pointer down and custom keyframe, add a keyframe at the current time. Get current and time and push a keyframe into the state, and then reconfigure the keyframes.
|
|
11
|
-
* TODO: Move bounding box to a separate entity
|
|
12
|
-
*/
|
|
13
|
-
export declare abstract class Player extends Entity {
|
|
14
|
-
private static readonly SnapThreshold;
|
|
15
|
-
private static readonly DiscardedFrameCount;
|
|
16
|
-
private static readonly ScaleHandleRadius;
|
|
17
|
-
private static readonly RotationHandleRadius;
|
|
18
|
-
private static readonly RotationHandleOffset;
|
|
19
|
-
private static readonly OutlineWidth;
|
|
20
|
-
private static readonly MinScale;
|
|
21
|
-
private static readonly MaxScale;
|
|
22
|
-
layer: number;
|
|
23
|
-
shouldDispose: boolean;
|
|
24
|
-
protected edit: Edit;
|
|
25
|
-
clipConfiguration: Clip;
|
|
26
|
-
private positionBuilder;
|
|
27
|
-
private offsetXKeyframeBuilder?;
|
|
28
|
-
private offsetYKeyframeBuilder?;
|
|
29
|
-
private scaleKeyframeBuilder?;
|
|
30
|
-
private opacityKeyframeBuilder?;
|
|
31
|
-
private rotationKeyframeBuilder?;
|
|
32
|
-
private outline;
|
|
33
|
-
private topLeftScaleHandle;
|
|
34
|
-
private topRightScaleHandle;
|
|
35
|
-
private bottomLeftScaleHandle;
|
|
36
|
-
private bottomRightScaleHandle;
|
|
37
|
-
private rotationHandle;
|
|
38
|
-
private isHovering;
|
|
39
|
-
private isDragging;
|
|
40
|
-
private dragOffset;
|
|
41
|
-
private scaleDirection;
|
|
42
|
-
private scaleStart;
|
|
43
|
-
private scaleOffset;
|
|
44
|
-
private isRotating;
|
|
45
|
-
private rotationStart;
|
|
46
|
-
private rotationOffset;
|
|
47
|
-
private initialClipConfiguration;
|
|
48
|
-
constructor(edit: Edit, clipConfiguration: Clip);
|
|
49
|
-
protected configureKeyframes(): void;
|
|
50
|
-
load(): Promise<void>;
|
|
51
|
-
update(_: number, __: number): void;
|
|
52
|
-
draw(): void;
|
|
53
|
-
dispose(): void;
|
|
54
|
-
getStart(): number;
|
|
55
|
-
getLength(): number;
|
|
56
|
-
getEnd(): number;
|
|
57
|
-
getPlaybackTime(): number;
|
|
58
|
-
abstract getSize(): Size;
|
|
59
|
-
getOpacity(): number;
|
|
60
|
-
getPosition(): Vector;
|
|
61
|
-
getPivot(): Vector;
|
|
62
|
-
protected getFitScale(): number;
|
|
63
|
-
getScale(): number;
|
|
64
|
-
getRotation(): number;
|
|
65
|
-
isActive(): boolean;
|
|
66
|
-
shouldDiscardFrame(): boolean;
|
|
67
|
-
private onPointerStart;
|
|
68
|
-
private onPointerMove;
|
|
69
|
-
private onPointerUp;
|
|
70
|
-
private onPointerOver;
|
|
71
|
-
private onPointerOut;
|
|
72
|
-
private clipHasPresets;
|
|
73
|
-
private clipHasKeyframes;
|
|
74
|
-
private hasStateChanged;
|
|
75
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { Entity } from './base/entity';
|
|
2
|
-
export { Player } from './base/player';
|
|
3
|
-
export { AudioPlayer } from './players/audio-player';
|
|
4
|
-
export { HtmlPlayer } from './players/html-player';
|
|
5
|
-
export { ImagePlayer } from './players/image-player';
|
|
6
|
-
export { LumaPlayer } from './players/luma-player';
|
|
7
|
-
export { ShapePlayer } from './players/shape-player';
|
|
8
|
-
export { TextPlayer } from './players/text-player';
|
|
9
|
-
export { VideoPlayer } from './players/video-player';
|
|
10
|
-
export { TextCursor } from './text/text-cursor';
|
|
11
|
-
export { TextEditor } from './text/text-editor';
|
|
12
|
-
export { TextInputHandler } from './text/text-input-handler';
|
|
13
|
-
export { Edit } from './system/edit';
|
|
14
|
-
export { Inspector } from './system/inspector';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { Player } from "../base/player";
|
|
4
|
-
import type { Edit } from "../system/edit";
|
|
5
|
-
export declare class AudioPlayer extends Player {
|
|
6
|
-
private audioResource;
|
|
7
|
-
private isPlaying;
|
|
8
|
-
private volumeKeyframeBuilder;
|
|
9
|
-
private syncTimer;
|
|
10
|
-
constructor(edit: Edit, clipConfiguration: Clip);
|
|
11
|
-
load(): Promise<void>;
|
|
12
|
-
update(deltaTime: number, elapsed: number): void;
|
|
13
|
-
draw(): void;
|
|
14
|
-
dispose(): void;
|
|
15
|
-
getSize(): Size;
|
|
16
|
-
getVolume(): number;
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { Player } from "../base/player";
|
|
4
|
-
import type { Edit } from "../system/edit";
|
|
5
|
-
export declare class HtmlPlayer extends Player {
|
|
6
|
-
private background;
|
|
7
|
-
private text;
|
|
8
|
-
constructor(timeline: Edit, clipConfiguration: Clip);
|
|
9
|
-
load(): Promise<void>;
|
|
10
|
-
update(deltaTime: number, elapsed: number): void;
|
|
11
|
-
draw(): void;
|
|
12
|
-
dispose(): void;
|
|
13
|
-
getSize(): Size;
|
|
14
|
-
protected getFitScale(): number;
|
|
15
|
-
private parseDocument;
|
|
16
|
-
private parseAlignment;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { Player } from "../base/player";
|
|
4
|
-
import type { Edit } from "../system/edit";
|
|
5
|
-
export declare class ImagePlayer extends Player {
|
|
6
|
-
private texture;
|
|
7
|
-
private sprite;
|
|
8
|
-
constructor(timeline: Edit, clipConfiguration: Clip);
|
|
9
|
-
load(): Promise<void>;
|
|
10
|
-
update(deltaTime: number, elapsed: number): void;
|
|
11
|
-
draw(): void;
|
|
12
|
-
dispose(): void;
|
|
13
|
-
getSize(): Size;
|
|
14
|
-
private createCroppedTexture;
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as pixi from "pixi.js";
|
|
2
|
-
import { type Size } from "../../layouts/geometry";
|
|
3
|
-
import { type Clip } from "../../schemas/clip";
|
|
4
|
-
import { Player } from "../base/player";
|
|
5
|
-
import type { Edit } from "../system/edit";
|
|
6
|
-
export declare class LumaPlayer extends Player {
|
|
7
|
-
private texture;
|
|
8
|
-
private sprite;
|
|
9
|
-
private isPlaying;
|
|
10
|
-
constructor(edit: Edit, clipConfiguration: Clip);
|
|
11
|
-
load(): Promise<void>;
|
|
12
|
-
update(deltaTime: number, elapsed: number): void;
|
|
13
|
-
draw(): void;
|
|
14
|
-
dispose(): void;
|
|
15
|
-
getSize(): Size;
|
|
16
|
-
getVolume(): number;
|
|
17
|
-
getMask(): pixi.Sprite | null;
|
|
18
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { Player } from "../base/player";
|
|
4
|
-
import type { Edit } from "../system/edit";
|
|
5
|
-
export declare class ShapePlayer extends Player {
|
|
6
|
-
private shape;
|
|
7
|
-
private shapeBackground;
|
|
8
|
-
constructor(timeline: Edit, clipConfiguration: Clip);
|
|
9
|
-
load(): Promise<void>;
|
|
10
|
-
update(deltaTime: number, elapsed: number): void;
|
|
11
|
-
draw(): void;
|
|
12
|
-
dispose(): void;
|
|
13
|
-
getSize(): Size;
|
|
14
|
-
protected getFitScale(): number;
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Player } from "@entities/base/player";
|
|
2
|
-
import { type Size } from "@layouts/geometry";
|
|
3
|
-
import { type Clip } from "@schemas/clip";
|
|
4
|
-
/**
|
|
5
|
-
* TextPlayer renders and manages editable text elements in the canvas
|
|
6
|
-
*/
|
|
7
|
-
export declare class TextPlayer extends Player {
|
|
8
|
-
private background;
|
|
9
|
-
private text;
|
|
10
|
-
private textEditor;
|
|
11
|
-
load(): Promise<void>;
|
|
12
|
-
update(deltaTime: number, elapsed: number): void;
|
|
13
|
-
dispose(): void;
|
|
14
|
-
getSize(): Size;
|
|
15
|
-
protected getFitScale(): number;
|
|
16
|
-
private createTextStyle;
|
|
17
|
-
private positionText;
|
|
18
|
-
updateTextContent(newText: string, initialConfig: Clip): void;
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type Size } from "../../layouts/geometry";
|
|
2
|
-
import { type Clip } from "../../schemas/clip";
|
|
3
|
-
import { Player } from "../base/player";
|
|
4
|
-
import type { Edit } from "../system/edit";
|
|
5
|
-
export declare class VideoPlayer extends Player {
|
|
6
|
-
private texture;
|
|
7
|
-
private sprite;
|
|
8
|
-
private isPlaying;
|
|
9
|
-
private volumeKeyframeBuilder;
|
|
10
|
-
private syncTimer;
|
|
11
|
-
constructor(edit: Edit, clipConfiguration: Clip);
|
|
12
|
-
/**
|
|
13
|
-
* TODO: Add support for .mov and .webm files
|
|
14
|
-
*/
|
|
15
|
-
load(): Promise<void>;
|
|
16
|
-
update(deltaTime: number, elapsed: number): void;
|
|
17
|
-
draw(): void;
|
|
18
|
-
dispose(): void;
|
|
19
|
-
getSize(): Size;
|
|
20
|
-
getVolume(): number;
|
|
21
|
-
private createCroppedTexture;
|
|
22
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EventEmitter } from "../../events/event-emitter";
|
|
3
|
-
import type { Size } from "../../layouts/geometry";
|
|
4
|
-
import { AssetLoader } from "../../loaders/asset-loader";
|
|
5
|
-
import { ClipSchema } from "../../schemas/clip";
|
|
6
|
-
import { EditSchema } from "../../schemas/edit";
|
|
7
|
-
import { TrackSchema } from "../../schemas/track";
|
|
8
|
-
import { Entity } from "../base/entity";
|
|
9
|
-
type EditType = z.infer<typeof EditSchema>;
|
|
10
|
-
type ClipType = z.infer<typeof ClipSchema>;
|
|
11
|
-
type TrackType = z.infer<typeof TrackSchema>;
|
|
12
|
-
export declare class Edit extends Entity {
|
|
13
|
-
private static readonly ZIndexPadding;
|
|
14
|
-
assetLoader: AssetLoader;
|
|
15
|
-
events: EventEmitter;
|
|
16
|
-
private edit;
|
|
17
|
-
private tracks;
|
|
18
|
-
private clipsToDispose;
|
|
19
|
-
private clips;
|
|
20
|
-
playbackTime: number;
|
|
21
|
-
totalDuration: number;
|
|
22
|
-
constructor(size: Size, backgroundColor?: string);
|
|
23
|
-
load(): Promise<void>;
|
|
24
|
-
play(): void;
|
|
25
|
-
pause(): void;
|
|
26
|
-
seek(target: number): void;
|
|
27
|
-
stop(): void;
|
|
28
|
-
loadEdit(edit: EditType): Promise<void>;
|
|
29
|
-
getEdit(): EditType;
|
|
30
|
-
addClip(trackIdx: number, clip: ClipType): void;
|
|
31
|
-
getClip(trackIdx: number, clipIdx: number): ClipType | null;
|
|
32
|
-
deleteClip(trackIdx: number, clipIdx: number): void;
|
|
33
|
-
addTrack(trackIdx: number, track: TrackType): void;
|
|
34
|
-
getTrack(trackIdx: number): TrackType | null;
|
|
35
|
-
deleteTrack(trackIdx: number): void;
|
|
36
|
-
getTotalDuration(): number;
|
|
37
|
-
private queueDisposeClip;
|
|
38
|
-
protected disposeClips(): void;
|
|
39
|
-
private disposeClip;
|
|
40
|
-
private unloadClipAssets;
|
|
41
|
-
protected clearClips(): void;
|
|
42
|
-
private updateTotalDuration;
|
|
43
|
-
private createPlayerFromAssetType;
|
|
44
|
-
private addPlayer;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Entity } from "../base/entity";
|
|
2
|
-
export declare class Inspector extends Entity {
|
|
3
|
-
private static readonly Width;
|
|
4
|
-
private static readonly Height;
|
|
5
|
-
fps: number;
|
|
6
|
-
playbackTime: number;
|
|
7
|
-
playbackDuration: number;
|
|
8
|
-
isPlaying: boolean;
|
|
9
|
-
private background;
|
|
10
|
-
private text;
|
|
11
|
-
constructor();
|
|
12
|
-
load(): Promise<void>;
|
|
13
|
-
update(_: number, __: number): void;
|
|
14
|
-
draw(): void;
|
|
15
|
-
dispose(): void;
|
|
16
|
-
private getMemoryInfo;
|
|
17
|
-
private bytesToMegabytes;
|
|
18
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { type Clip } from "@schemas/clip";
|
|
2
|
-
import * as pixi from "pixi.js";
|
|
3
|
-
type TextCursorOptions = {
|
|
4
|
-
width?: number;
|
|
5
|
-
color?: number;
|
|
6
|
-
blinkInterval?: number;
|
|
7
|
-
};
|
|
8
|
-
export declare class TextCursor {
|
|
9
|
-
private static readonly DEFAULT_BLINK_INTERVAL_MS;
|
|
10
|
-
private static readonly DEFAULT_CURSOR_WIDTH_PX;
|
|
11
|
-
private static readonly DEFAULT_CURSOR_COLOR;
|
|
12
|
-
private cursor;
|
|
13
|
-
private parent;
|
|
14
|
-
private textElement;
|
|
15
|
-
private clipConfig;
|
|
16
|
-
private textPosition;
|
|
17
|
-
private pixelX;
|
|
18
|
-
private pixelY;
|
|
19
|
-
private currentLine;
|
|
20
|
-
private isBlinking;
|
|
21
|
-
private blinkInterval;
|
|
22
|
-
private blinkIntervalMs;
|
|
23
|
-
private width;
|
|
24
|
-
private color;
|
|
25
|
-
private isVisible;
|
|
26
|
-
constructor(parent: pixi.Container, textElement: pixi.Text, clipConfig: Clip, options?: TextCursorOptions);
|
|
27
|
-
updatePosition(textPosition: number): void;
|
|
28
|
-
setPosition(x: number, y: number): void;
|
|
29
|
-
show(): void;
|
|
30
|
-
hide(): void;
|
|
31
|
-
setVisible(visible: boolean): void;
|
|
32
|
-
startBlinking(): void;
|
|
33
|
-
stopBlinking(): void;
|
|
34
|
-
setBlinkInterval(intervalMs: number): void;
|
|
35
|
-
dispose(): void;
|
|
36
|
-
private createCursor;
|
|
37
|
-
private validateTextPosition;
|
|
38
|
-
private calculateAndApplyPixelPosition;
|
|
39
|
-
private calculatePixelPositionFromText;
|
|
40
|
-
private updateGraphicsPosition;
|
|
41
|
-
private startBlinkingAnimation;
|
|
42
|
-
private stopBlinkingAnimation;
|
|
43
|
-
private measureText;
|
|
44
|
-
isInitialized(): boolean;
|
|
45
|
-
getState(): object;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { TextPlayer } from "@entities/players/text-player";
|
|
2
|
-
import { type Clip } from "@schemas/clip";
|
|
3
|
-
import * as pixi from "pixi.js";
|
|
4
|
-
export declare enum HorizontalAlignment {
|
|
5
|
-
LEFT = "left",
|
|
6
|
-
CENTER = "center",
|
|
7
|
-
RIGHT = "right"
|
|
8
|
-
}
|
|
9
|
-
export declare enum VerticalAlignment {
|
|
10
|
-
TOP = "top",
|
|
11
|
-
CENTER = "center",
|
|
12
|
-
BOTTOM = "bottom"
|
|
13
|
-
}
|
|
14
|
-
export declare class TextEditor {
|
|
15
|
-
private static readonly DOUBLE_CLICK_THRESHOLD_MS;
|
|
16
|
-
private static readonly EDITING_BG_PADDING_PX;
|
|
17
|
-
private static readonly EDITING_BG_ALPHA;
|
|
18
|
-
private static readonly CLICK_HANDLER_DELAY_MS;
|
|
19
|
-
private parent;
|
|
20
|
-
private targetText;
|
|
21
|
-
private clipConfig;
|
|
22
|
-
private isEditing;
|
|
23
|
-
private lastClickTime;
|
|
24
|
-
private editingContainer;
|
|
25
|
-
private editableText;
|
|
26
|
-
private textCursor;
|
|
27
|
-
private textInputHandler;
|
|
28
|
-
private outsideClickHandler;
|
|
29
|
-
constructor(parent: TextPlayer, targetText: pixi.Text, clipConfig: Clip);
|
|
30
|
-
dispose(): void;
|
|
31
|
-
private startEditing;
|
|
32
|
-
private stopEditing;
|
|
33
|
-
private checkForDoubleClick;
|
|
34
|
-
private setupOutsideClickHandler;
|
|
35
|
-
private createEditingEnvironment;
|
|
36
|
-
private setupEditingContainer;
|
|
37
|
-
private setupTextInputHandler;
|
|
38
|
-
private updateTextAlignment;
|
|
39
|
-
private calculateHorizontalPosition;
|
|
40
|
-
private calculateVerticalPosition;
|
|
41
|
-
private getContainerDimensions;
|
|
42
|
-
private getAlignmentSettings;
|
|
43
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
type TextInputHandlerOptions = {
|
|
2
|
-
initialText?: string;
|
|
3
|
-
autoFocus?: boolean;
|
|
4
|
-
focusDelay?: number;
|
|
5
|
-
};
|
|
6
|
-
type TextChangeCallback = (text: string, cursorPosition: number) => void;
|
|
7
|
-
type KeyboardEventHandlers = {
|
|
8
|
-
onTextInput?: TextChangeCallback;
|
|
9
|
-
onCursorMove?: (direction: "left" | "right" | "up" | "down", event: KeyboardEvent) => void;
|
|
10
|
-
onEnter?: (event: KeyboardEvent) => void;
|
|
11
|
-
onEscape?: (event: KeyboardEvent) => void;
|
|
12
|
-
onDelete?: (type: "backspace" | "delete", event: KeyboardEvent) => void;
|
|
13
|
-
onFocus?: (event: FocusEvent) => void;
|
|
14
|
-
onBlur?: (event: FocusEvent) => void;
|
|
15
|
-
onTabNavigation?: (direction: "forward" | "backward") => void;
|
|
16
|
-
onCustomKey?: (key: string, event: KeyboardEvent) => boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare class TextInputHandler {
|
|
19
|
-
private static readonly DEFAULT_FOCUS_DELAY_MS;
|
|
20
|
-
private hiddenInput;
|
|
21
|
-
private isFocused;
|
|
22
|
-
private focusRetryCount;
|
|
23
|
-
private maxFocusRetries;
|
|
24
|
-
private focusDelay;
|
|
25
|
-
private eventHandlers;
|
|
26
|
-
private abortController;
|
|
27
|
-
private textChangeCallback;
|
|
28
|
-
private lastSyncedText;
|
|
29
|
-
private isComposing;
|
|
30
|
-
setupInput(initialText: string, options?: TextInputHandlerOptions): void;
|
|
31
|
-
updateInputValue(text: string): void;
|
|
32
|
-
focusInput(): void;
|
|
33
|
-
blurInput(): void;
|
|
34
|
-
setSelectionRange(start: number, end: number): void;
|
|
35
|
-
getCursorPosition(): number;
|
|
36
|
-
getValue(): string;
|
|
37
|
-
setTextInputHandler(callback: TextChangeCallback): void;
|
|
38
|
-
setEventHandlers(handlers: Partial<KeyboardEventHandlers>): void;
|
|
39
|
-
isFocusedInput(): boolean;
|
|
40
|
-
dispose(): void;
|
|
41
|
-
private createHiddenTextarea;
|
|
42
|
-
private setupEventListeners;
|
|
43
|
-
private removeAllEventListeners;
|
|
44
|
-
private handleTextInput;
|
|
45
|
-
private handleKeyDown;
|
|
46
|
-
private handleKeyboardShortcuts;
|
|
47
|
-
private handleCompositionStart;
|
|
48
|
-
private handleCompositionEnd;
|
|
49
|
-
private handleFocus;
|
|
50
|
-
private handleBlur;
|
|
51
|
-
private handlePaste;
|
|
52
|
-
private selectAll;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "./event-emitter";
|
|
2
|
-
export type AssetLoadInfoStatus = "pending" | "loading" | "success" | "failed";
|
|
3
|
-
export type AssetLoadInfo = {
|
|
4
|
-
progress: number;
|
|
5
|
-
status: AssetLoadInfoStatus;
|
|
6
|
-
};
|
|
7
|
-
export type AssetLoadInfoUpdatedPayload = {
|
|
8
|
-
registry: Record<string, AssetLoadInfo>;
|
|
9
|
-
};
|
|
10
|
-
export type AssetEventMap = {
|
|
11
|
-
onAssetLoadInfoUpdated: AssetLoadInfoUpdatedPayload;
|
|
12
|
-
};
|
|
13
|
-
export declare class AssetLoadTracker extends EventEmitter<AssetEventMap> {
|
|
14
|
-
registry: Record<string, AssetLoadInfo>;
|
|
15
|
-
constructor();
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type Listener<TPayload = any> = (payload: TPayload) => void;
|
|
2
|
-
export type EventPayloadMap<TPayload = any> = Record<string, TPayload>;
|
|
3
|
-
export declare class EventEmitter<TEventPayloadMap extends EventPayloadMap = EventPayloadMap> {
|
|
4
|
-
private readonly events;
|
|
5
|
-
constructor();
|
|
6
|
-
on<TEventName extends keyof TEventPayloadMap>(name: TEventName, listener: Listener<TEventPayloadMap[TEventName]>): void;
|
|
7
|
-
off<TEventName extends keyof TEventPayloadMap>(name: TEventName, listener: Listener<TEventPayloadMap[TEventName]>): void;
|
|
8
|
-
clear(name: keyof TEventPayloadMap): void;
|
|
9
|
-
emit<TEventName extends keyof TEventPayloadMap>(name: TEventName, payload: TEventPayloadMap[TEventName]): void;
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Edit } from "@entities/system/edit";
|
|
2
|
-
import { Canvas } from "../shotstack-canvas";
|
|
3
|
-
export declare class VideoExporter {
|
|
4
|
-
private readonly ffmpeg;
|
|
5
|
-
private isReady;
|
|
6
|
-
private readonly edit;
|
|
7
|
-
private readonly application;
|
|
8
|
-
constructor(edit: Edit, canvas: Canvas);
|
|
9
|
-
private init;
|
|
10
|
-
export(filename?: string, fps?: number): Promise<void>;
|
|
11
|
-
private findAudioPlayers;
|
|
12
|
-
private searchContainerForPlayers;
|
|
13
|
-
private processAudioTrack;
|
|
14
|
-
private createProgressOverlay;
|
|
15
|
-
private updateProgressOverlay;
|
|
16
|
-
private removeProgressOverlay;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Edit } from "@entities/system/edit";
|
|
2
|
-
export declare class Controls {
|
|
3
|
-
private edit;
|
|
4
|
-
private seekDistance;
|
|
5
|
-
private seekDistanceLarge;
|
|
6
|
-
private frameTime;
|
|
7
|
-
constructor(timeline: Edit);
|
|
8
|
-
load(): Promise<void>;
|
|
9
|
-
private handleKeyDown;
|
|
10
|
-
private handleKeyUp;
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ClipAnchor } from "../schemas/clip";
|
|
2
|
-
import { type Size, type Vector } from "./geometry";
|
|
3
|
-
export declare class PositionBuilder {
|
|
4
|
-
private containerSize;
|
|
5
|
-
constructor(containerSize: Size);
|
|
6
|
-
relativeToAbsolute(entitySize: Size, anchor: ClipAnchor, relativePosition: Vector): Vector;
|
|
7
|
-
absoluteToRelative(entitySize: Size, anchor: ClipAnchor, absolutePosition: Vector): Vector;
|
|
8
|
-
}
|