@shotstack/shotstack-studio 1.4.0 → 1.5.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/{src/core/schemas/edit.d.ts → index.d.ts} +5528 -4061
- package/dist/shotstack-studio.es.js +4325 -1387
- package/dist/shotstack-studio.umd.js +8 -8
- package/package.json +5 -3
- package/readme.md +150 -7
- package/dist/src/components/canvas/index.d.ts +0 -14
- package/dist/src/components/canvas/players/audio-player.d.ts +0 -17
- package/dist/src/components/canvas/players/html-player.d.ts +0 -17
- package/dist/src/components/canvas/players/image-player.d.ts +0 -15
- package/dist/src/components/canvas/players/luma-player.d.ts +0 -18
- package/dist/src/components/canvas/players/player.d.ts +0 -76
- package/dist/src/components/canvas/players/shape-player.d.ts +0 -15
- package/dist/src/components/canvas/players/text-player.d.ts +0 -19
- package/dist/src/components/canvas/players/video-player.d.ts +0 -22
- package/dist/src/components/canvas/shotstack-canvas.d.ts +0 -25
- package/dist/src/components/canvas/system/inspector.d.ts +0 -18
- package/dist/src/components/canvas/text/text-cursor.d.ts +0 -47
- package/dist/src/components/canvas/text/text-editor.d.ts +0 -43
- package/dist/src/components/canvas/text/text-input-handler.d.ts +0 -54
- package/dist/src/core/animations/curve-interpolator.d.ts +0 -6
- package/dist/src/core/animations/effect-preset-builder.d.ts +0 -18
- package/dist/src/core/animations/keyframe-builder.d.ts +0 -12
- package/dist/src/core/animations/transition-preset-builder.d.ts +0 -20
- package/dist/src/core/commands/add-clip-command.d.ts +0 -14
- package/dist/src/core/commands/add-track-command.d.ts +0 -8
- package/dist/src/core/commands/delete-clip-command.d.ts +0 -10
- package/dist/src/core/commands/delete-track-command.d.ts +0 -9
- package/dist/src/core/commands/set-updated-clip-command.d.ts +0 -17
- package/dist/src/core/commands/types.d.ts +0 -25
- package/dist/src/core/commands/update-text-content-command.d.ts +0 -16
- package/dist/src/core/edit.d.ts +0 -52
- package/dist/src/core/events/asset-load-tracker.d.ts +0 -16
- package/dist/src/core/events/event-emitter.d.ts +0 -10
- package/dist/src/core/export/video-exporter.d.ts +0 -17
- package/dist/src/core/inputs/controls.d.ts +0 -11
- package/dist/src/core/inputs/pointer.d.ts +0 -4
- package/dist/src/core/layouts/geometry.d.ts +0 -8
- package/dist/src/core/layouts/position-builder.d.ts +0 -8
- package/dist/src/core/loaders/asset-loader.d.ts +0 -17
- package/dist/src/core/loaders/audio-load-parser.d.ts +0 -11
- package/dist/src/core/loaders/font-load-parser.d.ts +0 -13
- package/dist/src/core/schemas/asset.d.ts +0 -648
- package/dist/src/core/schemas/audio-asset.d.ts +0 -82
- package/dist/src/core/schemas/clip.d.ts +0 -1185
- package/dist/src/core/schemas/html-asset.d.ts +0 -27
- package/dist/src/core/schemas/image-asset.d.ts +0 -57
- package/dist/src/core/schemas/keyframe.d.ts +0 -26
- package/dist/src/core/schemas/luma-asset.d.ts +0 -13
- package/dist/src/core/schemas/shape-asset.d.ts +0 -199
- package/dist/src/core/schemas/text-asset.d.ts +0 -155
- package/dist/src/core/schemas/track.d.ts +0 -1491
- package/dist/src/core/schemas/video-asset.d.ts +0 -126
- package/dist/src/core/shared/entity.d.ts +0 -5
- package/dist/src/index.d.ts +0 -4
- package/dist/src/main.d.ts +0 -1
- package/dist/vite.config.d.ts +0 -2
|
@@ -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,14 +0,0 @@
|
|
|
1
|
-
import { ClipSchema } from "@schemas/clip";
|
|
2
|
-
import type { z } from "zod";
|
|
3
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
4
|
-
type ClipType = z.infer<typeof ClipSchema>;
|
|
5
|
-
export declare class AddClipCommand implements EditCommand {
|
|
6
|
-
private trackIdx;
|
|
7
|
-
private clip;
|
|
8
|
-
name: string;
|
|
9
|
-
private addedPlayer?;
|
|
10
|
-
constructor(trackIdx: number, clip: ClipType);
|
|
11
|
-
execute(context?: CommandContext): Promise<void>;
|
|
12
|
-
undo(context?: CommandContext): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
2
|
-
export declare class AddTrackCommand implements EditCommand {
|
|
3
|
-
private trackIdx;
|
|
4
|
-
name: string;
|
|
5
|
-
constructor(trackIdx: number);
|
|
6
|
-
execute(context?: CommandContext): void;
|
|
7
|
-
undo(context?: CommandContext): void;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
2
|
-
export declare class DeleteClipCommand implements EditCommand {
|
|
3
|
-
private trackIdx;
|
|
4
|
-
private clipIdx;
|
|
5
|
-
name: string;
|
|
6
|
-
private deletedClip?;
|
|
7
|
-
constructor(trackIdx: number, clipIdx: number);
|
|
8
|
-
execute(context?: CommandContext): void;
|
|
9
|
-
undo(context?: CommandContext): void;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
2
|
-
export declare class DeleteTrackCommand implements EditCommand {
|
|
3
|
-
private trackIdx;
|
|
4
|
-
name: string;
|
|
5
|
-
private deletedClips;
|
|
6
|
-
constructor(trackIdx: number);
|
|
7
|
-
execute(context?: CommandContext): void;
|
|
8
|
-
undo(context?: CommandContext): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Player } from "@canvas/players/player";
|
|
2
|
-
import { ClipSchema } from "@schemas/clip";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
5
|
-
type ClipType = z.infer<typeof ClipSchema>;
|
|
6
|
-
export declare class SetUpdatedClipCommand implements EditCommand {
|
|
7
|
-
private clip;
|
|
8
|
-
private initialClipConfig;
|
|
9
|
-
private finalClipConfig;
|
|
10
|
-
name: string;
|
|
11
|
-
private storedInitialConfig;
|
|
12
|
-
private storedFinalConfig;
|
|
13
|
-
constructor(clip: Player, initialClipConfig: ClipType | null, finalClipConfig: ClipType | null);
|
|
14
|
-
execute(context?: CommandContext): void;
|
|
15
|
-
undo(context?: CommandContext): void;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Player } from "@canvas/players/player";
|
|
2
|
-
import type { ClipSchema } from "@schemas/clip";
|
|
3
|
-
import type { Container } from "pixi.js";
|
|
4
|
-
import type { z } from "zod";
|
|
5
|
-
type ClipType = z.infer<typeof ClipSchema>;
|
|
6
|
-
export type EditCommand = {
|
|
7
|
-
execute(context?: CommandContext): void | Promise<void>;
|
|
8
|
-
undo?(context?: CommandContext): void | Promise<void>;
|
|
9
|
-
readonly name: string;
|
|
10
|
-
};
|
|
11
|
-
export type CommandContext = {
|
|
12
|
-
getClips(): Player[];
|
|
13
|
-
getTracks(): Player[][];
|
|
14
|
-
getContainer(): Container;
|
|
15
|
-
addPlayer(trackIdx: number, player: Player): Promise<void>;
|
|
16
|
-
createPlayerFromAssetType(clipConfiguration: ClipType): Player;
|
|
17
|
-
queueDisposeClip(player: Player): void;
|
|
18
|
-
disposeClips(): void;
|
|
19
|
-
undeleteClip(trackIdx: number, clip: Player): void;
|
|
20
|
-
setUpdatedClip(clip: Player): void;
|
|
21
|
-
restoreClipConfiguration(clip: Player, previousConfig: ClipType): void;
|
|
22
|
-
updateDuration(): void;
|
|
23
|
-
emitEvent(name: string, data: unknown): void;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Player } from "@canvas/players/player";
|
|
2
|
-
import type { ClipSchema } from "@schemas/clip";
|
|
3
|
-
import type { z } from "zod";
|
|
4
|
-
import type { EditCommand, CommandContext } from "./types";
|
|
5
|
-
type ClipType = z.infer<typeof ClipSchema>;
|
|
6
|
-
export declare class UpdateTextContentCommand implements EditCommand {
|
|
7
|
-
private clip;
|
|
8
|
-
private newText;
|
|
9
|
-
private initialConfig;
|
|
10
|
-
name: string;
|
|
11
|
-
private previousText;
|
|
12
|
-
constructor(clip: Player, newText: string, initialConfig: ClipType);
|
|
13
|
-
execute(context?: CommandContext): void;
|
|
14
|
-
undo(context?: CommandContext): void;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
package/dist/src/core/edit.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "@core/events/event-emitter";
|
|
2
|
-
import { Entity } from "@core/shared/entity";
|
|
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 { z } from "zod";
|
|
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
|
-
private commandHistory;
|
|
21
|
-
private commandIndex;
|
|
22
|
-
playbackTime: number;
|
|
23
|
-
totalDuration: number;
|
|
24
|
-
constructor(size: Size, backgroundColor?: string);
|
|
25
|
-
load(): Promise<void>;
|
|
26
|
-
play(): void;
|
|
27
|
-
pause(): void;
|
|
28
|
-
seek(target: number): void;
|
|
29
|
-
stop(): void;
|
|
30
|
-
loadEdit(edit: EditType): Promise<void>;
|
|
31
|
-
getEdit(): EditType;
|
|
32
|
-
addClip(trackIdx: number, clip: ClipType): void;
|
|
33
|
-
getClip(trackIdx: number, clipIdx: number): ClipType | null;
|
|
34
|
-
deleteClip(trackIdx: number, clipIdx: number): void;
|
|
35
|
-
addTrack(trackIdx: number, track: TrackType): void;
|
|
36
|
-
getTrack(trackIdx: number): TrackType | null;
|
|
37
|
-
deleteTrack(trackIdx: number): void;
|
|
38
|
-
getTotalDuration(): number;
|
|
39
|
-
undo(): void;
|
|
40
|
-
redo(): void;
|
|
41
|
-
private executeCommand;
|
|
42
|
-
private createCommandContext;
|
|
43
|
-
private queueDisposeClip;
|
|
44
|
-
protected disposeClips(): void;
|
|
45
|
-
private disposeClip;
|
|
46
|
-
private unloadClipAssets;
|
|
47
|
-
protected clearClips(): void;
|
|
48
|
-
private updateTotalDuration;
|
|
49
|
-
private createPlayerFromAssetType;
|
|
50
|
-
private addPlayer;
|
|
51
|
-
}
|
|
52
|
-
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 { Canvas } from "@canvas/shotstack-canvas";
|
|
2
|
-
import { Edit } from "@core/edit";
|
|
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 "@core/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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as pixi from "pixi.js";
|
|
2
|
-
import { AssetLoadTracker } from "../events/asset-load-tracker";
|
|
3
|
-
export declare class AssetLoader {
|
|
4
|
-
private static readonly VIDEO_EXTENSIONS;
|
|
5
|
-
private static readonly VIDEO_MIME;
|
|
6
|
-
readonly loadTracker: AssetLoadTracker;
|
|
7
|
-
load<TResolvedAsset>(identifier: string, loadOptions: pixi.UnresolvedAsset): Promise<TResolvedAsset | null>;
|
|
8
|
-
getProgress(): number;
|
|
9
|
-
private extractUrl;
|
|
10
|
-
private hasVideoExtension;
|
|
11
|
-
private getContentType;
|
|
12
|
-
private canPlayVideo;
|
|
13
|
-
private isPlayableVideo;
|
|
14
|
-
private shouldUseSafariVideoLoader;
|
|
15
|
-
private loadVideoForSafari;
|
|
16
|
-
private updateAssetLoadMetadata;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as pixi from "pixi.js";
|
|
2
|
-
export declare class AudioLoadParser implements pixi.LoaderParser<Howl | null> {
|
|
3
|
-
static readonly Name = "AudioLoadParser";
|
|
4
|
-
name: string;
|
|
5
|
-
extension: pixi.ExtensionFormat;
|
|
6
|
-
private validAudioExtensions;
|
|
7
|
-
constructor();
|
|
8
|
-
test(url: string): boolean;
|
|
9
|
-
load(url: string, _?: pixi.ResolvedAsset<Howl>, __?: pixi.Loader): Promise<Howl | null>;
|
|
10
|
-
unload(asset: Howl | null): void;
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as pixi from "pixi.js";
|
|
2
|
-
export declare class FontLoadParser implements pixi.LoaderParser<FontFace | null> {
|
|
3
|
-
static readonly Name = "FontLoadParser";
|
|
4
|
-
name: string;
|
|
5
|
-
extension: pixi.ExtensionFormat;
|
|
6
|
-
private validFontExtensions;
|
|
7
|
-
private woff2Decompressor;
|
|
8
|
-
constructor();
|
|
9
|
-
test(url: string): boolean;
|
|
10
|
-
load(url: string, _?: pixi.ResolvedAsset<FontFace>, __?: pixi.Loader): Promise<FontFace | null>;
|
|
11
|
-
private loadWoff2Decompressor;
|
|
12
|
-
unload(asset: FontFace | null): void;
|
|
13
|
-
}
|