@gannochenko/staticstripes 0.0.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/.prettierrc +8 -0
- package/Makefile +69 -0
- package/dist/asset-manager.d.ts +16 -0
- package/dist/asset-manager.d.ts.map +1 -0
- package/dist/asset-manager.js +50 -0
- package/dist/asset-manager.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +257 -0
- package/dist/cli.js.map +1 -0
- package/dist/container-renderer.d.ts +21 -0
- package/dist/container-renderer.d.ts.map +1 -0
- package/dist/container-renderer.js +149 -0
- package/dist/container-renderer.js.map +1 -0
- package/dist/expression-parser.d.ts +63 -0
- package/dist/expression-parser.d.ts.map +1 -0
- package/dist/expression-parser.js +145 -0
- package/dist/expression-parser.js.map +1 -0
- package/dist/ffmpeg.d.ts +375 -0
- package/dist/ffmpeg.d.ts.map +1 -0
- package/dist/ffmpeg.js +997 -0
- package/dist/ffmpeg.js.map +1 -0
- package/dist/ffprobe.d.ts +2 -0
- package/dist/ffprobe.d.ts.map +1 -0
- package/dist/ffprobe.js +31 -0
- package/dist/ffprobe.js.map +1 -0
- package/dist/html-parser.d.ts +56 -0
- package/dist/html-parser.d.ts.map +1 -0
- package/dist/html-parser.js +208 -0
- package/dist/html-parser.js.map +1 -0
- package/dist/html-project-parser.d.ts +169 -0
- package/dist/html-project-parser.d.ts.map +1 -0
- package/dist/html-project-parser.js +954 -0
- package/dist/html-project-parser.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/label-generator.d.ts +35 -0
- package/dist/label-generator.d.ts.map +1 -0
- package/dist/label-generator.js +69 -0
- package/dist/label-generator.js.map +1 -0
- package/dist/project.d.ts +29 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +137 -0
- package/dist/project.js.map +1 -0
- package/dist/sample-sequences.d.ts +5 -0
- package/dist/sample-sequences.d.ts.map +1 -0
- package/dist/sample-sequences.js +199 -0
- package/dist/sample-sequences.js.map +1 -0
- package/dist/sample-streams.d.ts +2 -0
- package/dist/sample-streams.d.ts.map +1 -0
- package/dist/sample-streams.js +109 -0
- package/dist/sample-streams.js.map +1 -0
- package/dist/sequence.d.ts +21 -0
- package/dist/sequence.d.ts.map +1 -0
- package/dist/sequence.js +269 -0
- package/dist/sequence.js.map +1 -0
- package/dist/stream.d.ts +135 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +779 -0
- package/dist/stream.js.map +1 -0
- package/dist/type.d.ts +73 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +3 -0
- package/dist/type.js.map +1 -0
- package/eslint.config.js +44 -0
- package/package.json +50 -0
- package/src/asset-manager.ts +55 -0
- package/src/cli.ts +306 -0
- package/src/container-renderer.ts +190 -0
- package/src/expression-parser.test.ts +459 -0
- package/src/expression-parser.ts +199 -0
- package/src/ffmpeg.ts +1403 -0
- package/src/ffprobe.ts +29 -0
- package/src/html-parser.ts +221 -0
- package/src/html-project-parser.ts +1195 -0
- package/src/index.ts +9 -0
- package/src/label-generator.ts +74 -0
- package/src/project.ts +180 -0
- package/src/sample-sequences.ts +225 -0
- package/src/sample-streams.ts +142 -0
- package/src/sequence.ts +330 -0
- package/src/stream.ts +1012 -0
- package/src/type.ts +81 -0
- package/tsconfig.json +24 -0
package/src/type.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type DefaultTreeAdapterMap } from 'parse5';
|
|
2
|
+
import { CompiledExpression } from './expression-parser';
|
|
3
|
+
|
|
4
|
+
export type ASTNode = DefaultTreeAdapterMap['node'];
|
|
5
|
+
export type Document = DefaultTreeAdapterMap['document'];
|
|
6
|
+
export type Element = DefaultTreeAdapterMap['element'];
|
|
7
|
+
|
|
8
|
+
export type CSSProperties = {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type Container = {
|
|
13
|
+
id: string;
|
|
14
|
+
htmlContent: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ParsedHtml = {
|
|
18
|
+
ast: Document;
|
|
19
|
+
css: Map<Element, CSSProperties>;
|
|
20
|
+
cssText: string; // Full CSS text from <style> tags
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type Asset = {
|
|
24
|
+
name: string; // e.g. "clip1"
|
|
25
|
+
path: string; // e.g. "./assets/clip1.mp4"
|
|
26
|
+
author?: string; // e.g. "John Doe"
|
|
27
|
+
type: 'video' | 'image' | 'audio';
|
|
28
|
+
duration: number; // in ms
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
rotation: number; // rotation in degrees (0, 90, 180, 270)
|
|
32
|
+
hasVideo: boolean; // whether the asset has a video stream
|
|
33
|
+
hasAudio: boolean; // whether the asset has an audio stream
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type Fragment = {
|
|
37
|
+
id: string;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
assetName: string;
|
|
40
|
+
duration: number; // calculated, in seconds (can come from CSS or from the asset's duration)
|
|
41
|
+
trimLeft: number; // in seconds
|
|
42
|
+
overlayLeft: number | CompiledExpression; // amount of seconds to overlay with the previous fragment (normalized from margin-left + prev margin-right)
|
|
43
|
+
overlayZIndex: number;
|
|
44
|
+
transitionIn: string; // how to transition into the fragment
|
|
45
|
+
transitionInDuration: number; // how long the transition in lasts
|
|
46
|
+
transitionOut: string; // how to transition out of the fragment
|
|
47
|
+
transitionOutDuration: number; // how long the transition out lasts
|
|
48
|
+
objectFit: 'cover' | 'contain';
|
|
49
|
+
objectFitContain: 'ambient' | 'pillarbox';
|
|
50
|
+
objectFitContainAmbientBlurStrength: number;
|
|
51
|
+
objectFitContainAmbientBrightness: number;
|
|
52
|
+
objectFitContainAmbientSaturation: number;
|
|
53
|
+
objectFitContainPillarboxColor: string;
|
|
54
|
+
chromakey: boolean;
|
|
55
|
+
chromakeyBlend: number;
|
|
56
|
+
chromakeySimilarity: number;
|
|
57
|
+
chromakeyColor: string;
|
|
58
|
+
visualFilter?: string; // Optional visual filter (e.g., 'instagram-nashville')
|
|
59
|
+
container?: Container; // Optional container attached to this fragment
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type SequenceDefinition = {
|
|
63
|
+
fragments: Fragment[];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type Output = {
|
|
67
|
+
name: string; // e.g. "youtube"
|
|
68
|
+
path: string; // e.g. "./output/video.mp4"
|
|
69
|
+
resolution: {
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
};
|
|
73
|
+
fps: number; // e.g. 30
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type ProjectStructure = {
|
|
77
|
+
sequences: SequenceDefinition[];
|
|
78
|
+
assets: Map<string, Asset>;
|
|
79
|
+
assetIndexMap: Map<string, number>; // assetName -> ffmpeg input index
|
|
80
|
+
output: Output;
|
|
81
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2022"],
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["src/**/*"],
|
|
23
|
+
"exclude": ["node_modules", "dist", "src/**/*.test.ts", "src/**/*.spec.ts"]
|
|
24
|
+
}
|