@elah/editor 0.2.0 → 0.3.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/LICENSE +133 -0
- package/README.md +160 -127
- package/dist/editor/AssetPanel/AssetPanel.d.ts +4 -1
- package/dist/editor/AssetPanel/AssetPanel.js +109 -138
- package/dist/editor/ElementsPanel/ElementsPanel.d.ts +4 -1
- package/dist/editor/ElementsPanel/ElementsPanel.js +87 -46
- package/dist/editor/Preview/MediaTransformOverlay.js +4 -4
- package/dist/editor/Preview/Preview.d.ts +2 -0
- package/dist/editor/Preview/Preview.js +38 -12
- package/dist/editor/Preview/ShapeOverlay.d.ts +1 -0
- package/dist/editor/Preview/ShapeOverlay.js +178 -0
- package/dist/editor/Preview/StageBorder.js +3 -3
- package/dist/editor/Preview/TextOverlay.js +5 -5
- package/dist/editor/Preview/TransitionOverlay.js +1 -5
- package/dist/editor/SourcePanel/SourcePanel.d.ts +37 -0
- package/dist/editor/SourcePanel/SourcePanel.js +381 -0
- package/dist/editor/SourcePanel/index.d.ts +2 -0
- package/dist/editor/SourcePanel/index.js +1 -0
- package/dist/editor/activation.d.ts +26 -0
- package/dist/editor/activation.js +53 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +5 -1
- package/dist/styles.css +1 -0
- package/package.json +75 -69
- package/src/styles/index.css +3 -0
- package/src/styles/tokens.css +204 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Elah Community License (ECL) v1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Elah Labs Private Limited
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Purpose
|
|
10
|
+
|
|
11
|
+
The Elah Community License (ECL) is intended to support open development, community adoption, and commercial sustainability of the Elah video editing engine and related software.
|
|
12
|
+
|
|
13
|
+
This license allows developers and organizations to use, modify, and integrate the Software into their own applications while protecting the Software from unauthorized resale, rebranding, or competing hosted platforms.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Definitions
|
|
18
|
+
|
|
19
|
+
* **"Software"** means the source code, binaries, assets, examples, documentation, and related materials distributed under this license.
|
|
20
|
+
* **"Licensor"** means Elah Labs Private Limited and its contributors.
|
|
21
|
+
* **"You"** means any individual or legal entity using the Software.
|
|
22
|
+
* **"Derivative Work"** means any modified version, extension, adaptation, or enhancement of the Software.
|
|
23
|
+
* **"Hosted Service"** means a commercial product or platform where the Software itself is exposed as a primary service, editor, API, infrastructure layer, or SaaS offering to third parties over a network.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 3. Permitted Uses
|
|
28
|
+
|
|
29
|
+
Subject to the terms of this license, you may:
|
|
30
|
+
|
|
31
|
+
* Use the Software for personal, educational, research, and commercial internal purposes.
|
|
32
|
+
* Modify and extend the Software.
|
|
33
|
+
* Integrate or embed the Software into your own applications, platforms, or workflows.
|
|
34
|
+
* Use the Software in commercial products that are not primarily competing video editing platforms.
|
|
35
|
+
* Self-host the Software for internal use.
|
|
36
|
+
* Create plugins, integrations, extensions, or tooling around the Software.
|
|
37
|
+
* Distribute Derivative Works under this same license.
|
|
38
|
+
* Provide consulting, support, training, or integration services related to the Software.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 4. Restrictions
|
|
43
|
+
|
|
44
|
+
You may not:
|
|
45
|
+
|
|
46
|
+
* Sell, sublicense, or redistribute the Software as a standalone product.
|
|
47
|
+
* Rebrand the Software and present it as your own core editor engine or framework.
|
|
48
|
+
* Offer the Software, or substantially similar functionality derived from it, as a commercial Hosted Service or SaaS platform without prior written permission from the Licensor.
|
|
49
|
+
* Build or operate a competing commercial browser-based video editor primarily derived from the Software.
|
|
50
|
+
* Remove or alter copyright notices, attribution notices, or license terms included with the Software.
|
|
51
|
+
* Misrepresent your relationship with the Licensor or imply official partnership without permission.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 5. Attribution
|
|
56
|
+
|
|
57
|
+
Any public distribution of the Software or Derivative Works must include:
|
|
58
|
+
|
|
59
|
+
* A copy of this license
|
|
60
|
+
* Appropriate copyright notices
|
|
61
|
+
* Clear indication of modifications made to the Software
|
|
62
|
+
* Attribution to Elah
|
|
63
|
+
|
|
64
|
+
Suggested attribution:
|
|
65
|
+
|
|
66
|
+
> Powered by Elah
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 6. Commercial Licensing
|
|
71
|
+
|
|
72
|
+
A separate commercial license is required for:
|
|
73
|
+
|
|
74
|
+
* Hosted editor platforms or SaaS offerings
|
|
75
|
+
* White-label editing platforms
|
|
76
|
+
* Commercial infrastructure services built primarily around the Software
|
|
77
|
+
* Enterprise redistribution agreements
|
|
78
|
+
* Uses outside the permissions granted by this license
|
|
79
|
+
|
|
80
|
+
Commercial licensing inquiries:
|
|
81
|
+
|
|
82
|
+
[paul@elah.dev](mailto:paul@elah.dev)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 7. Contributions
|
|
87
|
+
|
|
88
|
+
Unless otherwise agreed in writing, any contribution intentionally submitted for inclusion in the Software shall be licensed under the terms of this license.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 8. Disclaimer of Warranty
|
|
93
|
+
|
|
94
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 9. Limitation of Liability
|
|
99
|
+
|
|
100
|
+
IN NO EVENT SHALL THE LICENSOR OR CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 10. Termination
|
|
105
|
+
|
|
106
|
+
This license automatically terminates if you fail to comply with its terms. Upon termination, all rights granted under this license immediately cease.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 11. Governing Law
|
|
111
|
+
|
|
112
|
+
This license shall be governed by the laws applicable in the Licensor's jurisdiction, without regard to conflict of law principles.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 12. Entire Agreement
|
|
117
|
+
|
|
118
|
+
This license constitutes the complete agreement regarding the Software and supersedes all prior agreements relating to its subject matter.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 13. License Updates
|
|
123
|
+
|
|
124
|
+
The Licensor may publish updated versions of this license in the future. Continued use of the Software after such updates constitutes acceptance of the updated license terms.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 14. Contact
|
|
129
|
+
|
|
130
|
+
For licensing questions or commercial inquiries:
|
|
131
|
+
|
|
132
|
+
* Email: [paul@elah.dev](mailto:paul@elah.dev)
|
|
133
|
+
* Website: https://elah.dev
|
package/README.md
CHANGED
|
@@ -1,127 +1,160 @@
|
|
|
1
|
-
# @elah/editor
|
|
2
|
-
|
|
3
|
-
The full Elah video editor SDK for React. Combines the core engine, timeline UI, WebGL2 renderer, media library, and export pipeline into a single package.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
# @elah/editor
|
|
2
|
+
|
|
3
|
+
The full Elah video editor SDK for React. Combines the core engine, timeline UI, WebGL2 renderer, media library, and export pipeline into a single package.
|
|
4
|
+
|
|
5
|
+
Ships `EditorProvider`, `Preview` (WebGL2 canvas + interactive transform overlays), `Timeline`, `AssetPanel`, `SourcePanel`, and `ElementsPanel`, and re-exports the entire `@elah/core` and `@elah/timeline` API. Supports video, image, text, **shape**, and **freehand** clips, **multi-track audio**, and MP4 export.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@elah/editor)
|
|
8
|
+
[](../../BUNDLE_STRATEGY.md)
|
|
9
|
+
[](https://github.com/elahlabs/elah/blob/main/LICENSE)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @elah/editor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Peer dependencies: `react`, `react-dom` >= 18.
|
|
20
|
+
|
|
21
|
+
**Bundle size:** ~10 KiB gzipped for the editor layer (51 KiB raw); ~63 KiB gzipped for the full SDK graph (`core` + `timeline` + `editor`, 330 KiB raw). `mediabunny` is injected, never bundled — see [BUNDLE_STRATEGY.md](../../BUNDLE_STRATEGY.md).
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { EditorProvider, Timeline } from '@elah/editor'
|
|
29
|
+
|
|
30
|
+
function App() {
|
|
31
|
+
return (
|
|
32
|
+
<EditorProvider fps={30}>
|
|
33
|
+
<Timeline style={{ height: 300 }} />
|
|
34
|
+
</EditorProvider>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Styling
|
|
42
|
+
|
|
43
|
+
Import the compiled stylesheets once. They are plain CSS — your app does **not**
|
|
44
|
+
need Tailwind, and no utility class names leak into your global scope (preflight
|
|
45
|
+
is disabled, so nothing resets your elements):
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import '@elah/timeline/styles.css'
|
|
49
|
+
import '@elah/editor/styles.css'
|
|
50
|
+
import '@elah/editor/styles/tokens.css' // --elah-* dark defaults (standalone)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
When embedding inside an app that already defines `.elah-root` (mapping `--elah-*`
|
|
54
|
+
onto its own design system), skip `tokens.css`. Re-theme or white-label by
|
|
55
|
+
overriding `--elah-*` variables in your own `.elah-root` scope — see
|
|
56
|
+
[design-tokens.md](https://github.com/elahlabs/elah/blob/main/docs/design-tokens.md).
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## With preview and asset panel
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { EditorProvider, Timeline, Preview, AssetPanel, createDefaultDemuxerFactory } from '@elah/editor'
|
|
64
|
+
|
|
65
|
+
const demuxerFactory = createDefaultDemuxerFactory()
|
|
66
|
+
|
|
67
|
+
function App() {
|
|
68
|
+
return (
|
|
69
|
+
<EditorProvider fps={30}>
|
|
70
|
+
<div style={{ display: 'flex', height: '100vh' }}>
|
|
71
|
+
<AssetPanel style={{ width: 220 }} />
|
|
72
|
+
<div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>
|
|
73
|
+
<Preview demuxerFactory={demuxerFactory} style={{ flex: 1 }} />
|
|
74
|
+
<Timeline style={{ height: 300 }} />
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</EditorProvider>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Import media
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { importFiles, importUrl, useMediaLibrary } from '@elah/editor'
|
|
88
|
+
|
|
89
|
+
await importFiles(Array.from(fileList)) // local files
|
|
90
|
+
await importUrl('https://example.com/clip.mp4') // remote URL (also importBlob for blobs)
|
|
91
|
+
|
|
92
|
+
// Subscribe in React — useMediaLibrary() takes no arguments and returns
|
|
93
|
+
// { assets, getAsset, removeAsset, updateAsset } with assets in insertion order.
|
|
94
|
+
const { assets } = useMediaLibrary()
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Programmatic insertion (no drag)
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { insertMediaAsset } from '@elah/editor'
|
|
101
|
+
|
|
102
|
+
// Place an imported asset onto the timeline — powers tap-to-add on touch.
|
|
103
|
+
// Returns a typed InsertAssetResult ({ ok, kind, trackId, clipIds } | { ok:false, reason }).
|
|
104
|
+
const result = await insertMediaAsset(engine, assetId, { desiredStartFrame: 0 })
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Export to MP4
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { exportVideo } from '@elah/editor'
|
|
113
|
+
|
|
114
|
+
const blob = await exportVideo(engine.getProject(), {
|
|
115
|
+
videoBitrate: 8_000_000,
|
|
116
|
+
onProgress: ({ frame, totalFrames }) => {
|
|
117
|
+
console.log(`${Math.round((frame / totalFrames) * 100)}%`)
|
|
118
|
+
},
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Runs in a web worker. Reuses `resolveTimeline` + the GPU renderer's placement math.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Keyboard shortcuts
|
|
127
|
+
|
|
128
|
+
| Key | Action |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `Space` | Play / pause |
|
|
131
|
+
| `S` | Split clip at playhead |
|
|
132
|
+
| `Delete` / `Backspace` | Delete selected clip(s) |
|
|
133
|
+
| `Ctrl/Cmd + C` | Copy |
|
|
134
|
+
| `Ctrl/Cmd + V` | Paste at playhead |
|
|
135
|
+
| `Ctrl/Cmd + Z` | Undo |
|
|
136
|
+
| `Ctrl/Cmd + Shift + Z` / `Ctrl/Cmd + Y` | Redo |
|
|
137
|
+
| `Ctrl/Cmd + scroll` | Zoom |
|
|
138
|
+
| `← / →` | Step one frame |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Package layers
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
@elah/core — engine, playback, resolver, stores, media, export (framework-agnostic)
|
|
146
|
+
@elah/timeline — React timeline UI components and hooks
|
|
147
|
+
@elah/editor — EditorProvider, Preview, AssetPanel + re-exports everything above
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Use `@elah/editor` for the full experience. Use `@elah/core` directly for headless or custom rendering pipelines.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Links
|
|
155
|
+
|
|
156
|
+
- [Website](https://www.elah.dev)
|
|
157
|
+
- [GitHub](https://github.com/elahlabs/elah)
|
|
158
|
+
- [Discord](https://discord.gg/8CeZ2XbPy)
|
|
159
|
+
- [License](https://github.com/elahlabs/elah/blob/main/LICENSE)
|
|
160
|
+
- [Commercial licensing](mailto:paul@elah.dev)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type AssetActivationHandler } from '../activation';
|
|
2
3
|
export interface AssetPanelProps {
|
|
3
4
|
style?: CSSProperties;
|
|
4
5
|
className?: string;
|
|
6
|
+
activateOnTap?: boolean;
|
|
7
|
+
onAssetActivate?: AssetActivationHandler;
|
|
5
8
|
}
|
|
6
|
-
export declare function AssetPanel({ style, className }: AssetPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function AssetPanel({ style, className, activateOnTap, onAssetActivate, }: AssetPanelProps): import("react/jsx-runtime").JSX.Element;
|