@designcombo/video 0.0.5 → 0.1.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/{SharedSystems-CRU_36xv.js → SharedSystems-CQqgfMHK.js} +1 -1
- package/dist/{WebGLRenderer-DEFvQb8g.js → WebGLRenderer-ykSSlgbE.js} +2 -2
- package/dist/{WebGPURenderer-Ct-nIPui.js → WebGPURenderer-CHHoT8My.js} +2 -2
- package/dist/{browserAll-yBQiB45V.js → browserAll-BdVABEgU.js} +2 -2
- package/dist/clips/caption-clip.d.ts +17 -0
- package/dist/clips/transition-clip.d.ts +8 -0
- package/dist/{index-Cu_5hRJ3.js → index-C2lxQ7Li.js} +2016 -1747
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +245 -105
- package/dist/json-serialization.d.ts +12 -1
- package/dist/studio.d.ts +13 -9
- package/dist/transition/glsl/custom-glsl.d.ts +2 -0
- package/dist/transition/glsl/gl-transition.d.ts +4 -0
- package/dist/transition/transition.d.ts +1 -0
- package/dist/{webworkerAll-yHa2ILeq.js → webworkerAll-BnqyxwPv.js} +1 -1
- package/package.json +2 -2
|
@@ -84,6 +84,7 @@ export interface TextStyleJSON {
|
|
|
84
84
|
wordWrapWidth?: number;
|
|
85
85
|
lineHeight?: number;
|
|
86
86
|
letterSpacing?: number;
|
|
87
|
+
textCase?: 'none' | 'uppercase' | 'lowercase' | 'title';
|
|
87
88
|
}
|
|
88
89
|
export interface TextClipJSON extends BaseClipJSON {
|
|
89
90
|
type: 'Text';
|
|
@@ -143,12 +144,22 @@ export interface EffectClipJSON extends BaseClipJSON {
|
|
|
143
144
|
name: string;
|
|
144
145
|
};
|
|
145
146
|
}
|
|
147
|
+
export interface TransitionClipJSON extends BaseClipJSON {
|
|
148
|
+
type: 'Transition';
|
|
149
|
+
transitionEffect: {
|
|
150
|
+
id: string;
|
|
151
|
+
key: string;
|
|
152
|
+
name: string;
|
|
153
|
+
};
|
|
154
|
+
fromClipId: string | null;
|
|
155
|
+
toClipId: string | null;
|
|
156
|
+
}
|
|
146
157
|
export interface TransitionJSON {
|
|
147
158
|
key: string;
|
|
148
159
|
duration: number;
|
|
149
160
|
clips: string[];
|
|
150
161
|
}
|
|
151
|
-
export type ClipJSON = VideoClipJSON | AudioClipJSON | ImageClipJSON | TextClipJSON | CaptionClipJSON | EffectClipJSON;
|
|
162
|
+
export type ClipJSON = VideoClipJSON | AudioClipJSON | ImageClipJSON | TextClipJSON | CaptionClipJSON | EffectClipJSON | TransitionClipJSON;
|
|
152
163
|
export interface StudioTrackJSON {
|
|
153
164
|
id: string;
|
|
154
165
|
name: string;
|
package/dist/studio.d.ts
CHANGED
|
@@ -14,29 +14,29 @@ export interface IStudioOpts {
|
|
|
14
14
|
interactivity?: boolean;
|
|
15
15
|
}
|
|
16
16
|
export interface StudioEvents {
|
|
17
|
-
|
|
17
|
+
'selection:created': {
|
|
18
18
|
selected: IClip[];
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
'selection:updated': {
|
|
21
21
|
selected: IClip[];
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
'selection:cleared': {
|
|
24
24
|
deselected: IClip[];
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
'track:added': {
|
|
27
27
|
track: StudioTrack;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
'track:removed': {
|
|
30
30
|
trackId: string;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
'clip:added': {
|
|
33
33
|
clip: IClip;
|
|
34
34
|
trackId: string;
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
'clip:removed': {
|
|
37
37
|
clipId: string;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
'clip:updated': {
|
|
40
40
|
clip: IClip;
|
|
41
41
|
};
|
|
42
42
|
currentTime: {
|
|
@@ -128,6 +128,10 @@ export declare class Studio extends EventEmitter<StudioEvents> {
|
|
|
128
128
|
* Get studio options
|
|
129
129
|
*/
|
|
130
130
|
getOptions(): IStudioOpts;
|
|
131
|
+
/**
|
|
132
|
+
* Update studio dimensions
|
|
133
|
+
*/
|
|
134
|
+
updateDimensions(width: number, height: number): void;
|
|
131
135
|
private handleResize;
|
|
132
136
|
private updateArtboardLayout;
|
|
133
137
|
/**
|
|
@@ -141,7 +145,7 @@ export declare class Studio extends EventEmitter<StudioEvents> {
|
|
|
141
145
|
/**
|
|
142
146
|
* Add a Transition clip at the join where the selected clip starts.
|
|
143
147
|
*/
|
|
144
|
-
addTransition(transitionKey: string, duration?: number): Promise<void>;
|
|
148
|
+
addTransition(transitionKey: string, duration?: number, fromClipId?: string | null, toClipId?: string | null): Promise<void>;
|
|
145
149
|
findTrackIdByClipId(clipId: string): string | undefined;
|
|
146
150
|
/**
|
|
147
151
|
* Add a clip to the studio
|
|
@@ -227,3 +227,5 @@ export declare const COLOUR_DISTANCE_UNIFORMS: Record<string, {
|
|
|
227
227
|
value: any;
|
|
228
228
|
type: string;
|
|
229
229
|
}>;
|
|
230
|
+
export declare const BOW_TIE_HORIZONTAL_FRAGMENT = "\n// License: MIT\n\nvec2 bottom_left = vec2(0.0, 1.0);\nvec2 bottom_right = vec2(1.0, 1.0);\nvec2 top_left = vec2(0.0, 0.0);\nvec2 top_right = vec2(1.0, 0.0);\n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 = check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2) && (b2 == b3));\n}\n\nbool in_left_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(progress, 0.5);\n vertex2 = vec2(0.0, 0.5-progress);\n vertex3 = vec2(0.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool in_right_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(1.0-progress, 0.5);\n vertex2 = vec2(1.0, 0.5-progress);\n vertex3 = vec2(1.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir = vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\n\nvec4 transition (vec2 uv) {\n if (in_left_triangle(uv))\n {\n if (progress < 0.1)\n {\n return getFromColor(uv);\n }\n if (uv.x < 0.5)\n {\n vec2 vertex1 = vec2(progress, 0.5);\n vec2 vertex2 = vec2(0.0, 0.5-progress);\n vec2 vertex3 = vec2(0.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\n return getToColor(uv);\n }\n else\n {\n return getFromColor(uv);\n }\n } \n }\n else if (in_right_triangle(uv))\n {\n if (uv.x >= 0.5)\n {\n vec2 vertex1 = vec2(1.0-progress, 0.5);\n vec2 vertex2 = vec2(1.0, 0.5-progress);\n vec2 vertex3 = vec2(1.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n return getFromColor(uv);\n }\n}\n";
|
|
231
|
+
export declare const POLKA_DOTS_CURTAIN_FRAGMENT = "\n\nconst float SQRT_2 = 1.414213562373;\nuniform float dots;// = 20.0;\n\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\n";
|
|
@@ -5,10 +5,14 @@ export interface GlTransition {
|
|
|
5
5
|
value: any;
|
|
6
6
|
type: string;
|
|
7
7
|
}>;
|
|
8
|
+
previewDynamic?: string;
|
|
9
|
+
previewStatic?: string;
|
|
8
10
|
}
|
|
9
11
|
export declare const GL_TRANSITIONS: Record<string, GlTransition>;
|
|
10
12
|
export type TransitionKey = keyof typeof GL_TRANSITIONS;
|
|
11
13
|
export declare const GL_TRANSITION_OPTIONS: Array<{
|
|
12
14
|
key: TransitionKey;
|
|
13
15
|
label: string;
|
|
16
|
+
previewStatic: string | undefined;
|
|
17
|
+
previewDynamic: string | undefined;
|
|
14
18
|
}>;
|
|
@@ -2,4 +2,5 @@ import { RenderTexture } from 'pixi.js';
|
|
|
2
2
|
import { TransitionOptions, TransitionRendererOptions } from './types';
|
|
3
3
|
export declare function makeTransition({ name, renderer }: TransitionOptions): {
|
|
4
4
|
render({ width, height, from, to, progress }: TransitionRendererOptions): RenderTexture;
|
|
5
|
+
destroy(): void;
|
|
5
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as p, U as Ne, T as ee, F as je, G as he, v as fe, M as P, l as C, d as pe, I as v, t as w, a8 as $, R as N, w as L, H as me, a5 as G, a6 as ge, c as F, B as T, D as j, S as M, y as D, af as qe, ag as q, L as Y, ah as U, s as Q, a0 as Qe, $ as X, n as xe, q as _e, aa as be, ad as ye, o as Je, p as Ze, ab as et, ac as tt, ae as rt, ai as nt, aj as st, ak as it, al as H, am as at, an as ot, m as ve, ao as te, ap as k, e as b, aq as ut } from "./index-
|
|
1
|
+
import { E as p, U as Ne, T as ee, F as je, G as he, v as fe, M as P, l as C, d as pe, I as v, t as w, a8 as $, R as N, w as L, H as me, a5 as G, a6 as ge, c as F, B as T, D as j, S as M, y as D, af as qe, ag as q, L as Y, ah as U, s as Q, a0 as Qe, $ as X, n as xe, q as _e, aa as be, ad as ye, o as Je, p as Ze, ab as et, ac as tt, ae as rt, ai as nt, aj as st, ak as it, al as H, am as at, an as ot, m as ve, ao as te, ap as k, e as b, aq as ut } from "./index-C2lxQ7Li.js";
|
|
2
2
|
import { c as z, a as lt, b as ct, B as Te } from "./colorToUniform-C2jGzNe1.js";
|
|
3
3
|
class Pe {
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designcombo/video",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Video rendering and processing library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"files": [
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
|
-
|
|
25
|
+
"main": "dist/index.umd.js",
|
|
26
26
|
"module": "dist/index.es.js",
|
|
27
27
|
"types": "dist/index.d.ts",
|
|
28
28
|
"exports": {
|