@elah/core 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +82 -0
  2. package/package.json +30 -3
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # @elah/core
2
+
3
+ Framework-agnostic video timeline engine. No React. No renderer. Just the pure logic layer — project state, playback, frame resolution, and media management.
4
+
5
+ Used internally by `@elah/timeline` and `@elah/editor`, but can be consumed directly for custom rendering pipelines or headless environments.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@elah/core)](https://www.npmjs.com/package/@elah/core)
8
+ [![license](https://img.shields.io/badge/license-ECL--1.0-blue)](https://github.com/elahlabs/elah/blob/main/LICENSE)
9
+
10
+ ---
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @elah/core
16
+ ```
17
+
18
+ ---
19
+
20
+ ## What's inside
21
+
22
+ | Module | Description |
23
+ |---|---|
24
+ | `TimelineEngine` | Manages project state — tracks, clips, undo/redo |
25
+ | `PlaybackEngine` | Frame-accurate playback clock |
26
+ | `resolveTimeline` | Pure function — project → active scene at a given frame |
27
+ | `GpuRenderer` | WebGL2 renderer for video, image, and text layers |
28
+ | `useTracksStore` | Zustand mirror of project state for React |
29
+ | `usePlaybackStore` | Zustand mirror of playback state for React |
30
+ | `useSelectionStore` | Zustand mirror of selection state for React |
31
+ | `useMediaLibrary` | Media asset library with thumbnail generation |
32
+ | `importFiles` | Import local files into the media library |
33
+ | `exportVideo` | Export the timeline to MP4 via a web worker |
34
+
35
+ ---
36
+
37
+ ## Quick start
38
+
39
+ ```ts
40
+ import { TimelineEngine, PlaybackEngine, createVideoClip } from '@elah/core'
41
+
42
+ const engine = new TimelineEngine({ fps: 30, stage: { width: 1920, height: 1080 } })
43
+ const playback = new PlaybackEngine(engine)
44
+
45
+ // Add a video clip
46
+ engine.addClip('track-1', createVideoClip({ src: 'video.mp4', startFrame: 0, durationFrames: 90 }))
47
+
48
+ // Resolve the scene at a given frame
49
+ import { resolveTimeline } from '@elah/core'
50
+ const scene = resolveTimeline(engine.getProject(), { currentFrame: 15 })
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Clip factories
56
+
57
+ ```ts
58
+ import { createVideoClip, createAudioClip, createTextClip, createImageClip } from '@elah/core'
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Export
64
+
65
+ ```ts
66
+ import { exportVideo } from '@elah/core'
67
+
68
+ const blob = await exportVideo(engine.getProject(), {
69
+ videoBitrate: 8_000_000,
70
+ onProgress: ({ frame, totalFrames }) => console.log(frame, '/', totalFrames),
71
+ })
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Links
77
+
78
+ - [Website](https://www.elah.dev)
79
+ - [GitHub](https://github.com/elahlabs/elah)
80
+ - [Full SDK — @elah/editor](https://www.npmjs.com/package/@elah/editor)
81
+ - [License](https://github.com/elahlabs/elah/blob/main/LICENSE)
82
+ - [Commercial licensing](mailto:contact@elah.dev)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elah/core",
3
- "version": "0.1.0",
4
- "description": "Framework-agnostic video timeline engine",
3
+ "version": "0.1.1",
4
+ "description": "Framework-agnostic video timeline engine — playback, frame resolution, WebGL2 renderer, and media management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -12,7 +12,9 @@
12
12
  }
13
13
  },
14
14
  "files": [
15
- "dist"
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE"
16
18
  ],
17
19
  "scripts": {
18
20
  "typecheck": "tsc --noEmit",
@@ -20,6 +22,31 @@
20
22
  "test:watch": "vitest",
21
23
  "build": "tsc --noEmit && tsc -p tsconfig.build.json"
22
24
  },
25
+ "keywords": [
26
+ "video-editor",
27
+ "timeline",
28
+ "video-engine",
29
+ "webgl",
30
+ "webgl2",
31
+ "gpu-renderer",
32
+ "playback",
33
+ "frame-accurate",
34
+ "media",
35
+ "export",
36
+ "mp4",
37
+ "typescript",
38
+ "browser",
39
+ "react"
40
+ ],
41
+ "homepage": "https://www.elah.dev",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/elahlabs/elah.git"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/elahlabs/elah/issues"
48
+ },
49
+ "license": "SEE LICENSE IN LICENSE",
23
50
  "dependencies": {
24
51
  "immer": "^10.1.1",
25
52
  "zustand": "^5.0.3"