@elah/editor 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,69 +1,75 @@
1
- {
2
- "name": "@elah/editor",
3
- "version": "0.2.1",
4
- "description": "Full React video editor SDK — timeline UI, WebGL2 preview, media library, drag and drop, and MP4 export",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "sideEffects": false,
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "default": "./dist/index.js"
14
- }
15
- },
16
- "files": [
17
- "dist",
18
- "README.md",
19
- "LICENSE"
20
- ],
21
- "scripts": {
22
- "typecheck": "tsc --noEmit",
23
- "test": "vitest run",
24
- "test:watch": "vitest",
25
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json"
26
- },
27
- "keywords": [
28
- "video-editor",
29
- "react",
30
- "sdk",
31
- "timeline",
32
- "webgl",
33
- "webgl2",
34
- "gpu",
35
- "mp4",
36
- "export",
37
- "media-editor",
38
- "browser-video-editor",
39
- "video-sdk",
40
- "asset-panel",
41
- "preview",
42
- "typescript"
43
- ],
44
- "homepage": "https://www.elah.dev",
45
- "repository": {
46
- "type": "git",
47
- "url": "https://github.com/elahlabs/elah.git"
48
- },
49
- "bugs": {
50
- "url": "https://github.com/elahlabs/elah/issues"
51
- },
52
- "license": "SEE LICENSE IN LICENSE",
53
- "peerDependencies": {
54
- "react": ">=18.0.0",
55
- "react-dom": ">=18.0.0"
56
- },
57
- "dependencies": {
58
- "@elah/core": "^0.2.1",
59
- "@elah/timeline": "^0.2.1",
60
- "immer": "^10.1.1",
61
- "zustand": "^5.0.3"
62
- },
63
- "devDependencies": {
64
- "@types/react": "^18.3.18",
65
- "@types/react-dom": "^18.3.5",
66
- "typescript": "^5.7.3",
67
- "vitest": "^3.0.6"
68
- }
69
- }
1
+ {
2
+ "name": "@elah/editor",
3
+ "version": "0.3.1",
4
+ "description": "Full React video editor SDK — timeline UI, WebGL2 preview, media library, drag and drop, and MP4 export",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "sideEffects": ["*.css"],
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./styles/tokens.css": "./src/styles/tokens.css",
16
+ "./styles.css": "./dist/styles.css"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "src/styles",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "scripts": {
25
+ "typecheck": "tsc --noEmit",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tailwindcss -c ./tailwind.config.ts -i ./src/styles/index.css -o ./dist/styles.css --minify"
29
+ },
30
+ "keywords": [
31
+ "video-editor",
32
+ "react",
33
+ "sdk",
34
+ "timeline",
35
+ "webgl",
36
+ "webgl2",
37
+ "gpu",
38
+ "mp4",
39
+ "export",
40
+ "media-editor",
41
+ "browser-video-editor",
42
+ "video-sdk",
43
+ "asset-panel",
44
+ "preview",
45
+ "typescript"
46
+ ],
47
+ "homepage": "https://www.elah.dev",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/elahlabs/elah.git"
51
+ },
52
+ "bugs": {
53
+ "url": "https://github.com/elahlabs/elah/issues"
54
+ },
55
+ "license": "Apache-2.0",
56
+ "peerDependencies": {
57
+ "react": ">=18.0.0",
58
+ "react-dom": ">=18.0.0"
59
+ },
60
+ "dependencies": {
61
+ "@elah/core": "^0.3.0",
62
+ "@elah/timeline": "^0.3.0",
63
+ "immer": "^10.1.1",
64
+ "zustand": "^5.0.3"
65
+ },
66
+ "devDependencies": {
67
+ "@types/react": "^18.3.18",
68
+ "@types/react-dom": "^18.3.5",
69
+ "autoprefixer": "^10.4.21",
70
+ "postcss": "^8.5.3",
71
+ "tailwindcss": "^3.4.17",
72
+ "typescript": "^5.7.3",
73
+ "vitest": "^3.0.6"
74
+ }
75
+ }
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,204 @@
1
+ /**
2
+ * @elah/editor — CSS token layer
3
+ *
4
+ * Standalone dark defaults for consumers who do NOT use the elah web-app
5
+ * design system (globals.css). Values mirror the cool-navy palette from
6
+ * globals.css .elah-root so the web-app and library stay visually in sync.
7
+ *
8
+ * Web-app consumers: import globals.css as usual — it defines .elah-root with
9
+ * --elah-* and the Figma-derived theme (cyan accent, white playhead, etc.).
10
+ *
11
+ * Third-party consumers: import this file and optionally override .elah-root
12
+ * in your own stylesheet:
13
+ *
14
+ * .elah-root {
15
+ * --elah-accent: #6366f1;
16
+ * --elah-bg-card: #1e1e2e;
17
+ * }
18
+ */
19
+
20
+ .elah-root {
21
+ /* ── Surfaces — cool near-black navy ──────────────────────────────────── */
22
+ --elah-bg: #06070a; /* deepest bg — canvas, input fields */
23
+ --elah-bg-secondary: #0a0d14; /* second-deepest — timeline track areas */
24
+ --elah-bg-panel: #121722; /* panels, sidebars, ruler */
25
+ --elah-bg-card: #0d1017; /* cards, list rows, inactive track label */
26
+ --elah-bg-elevated: #171d2b; /* hover, context menus, modals */
27
+ --elah-bg-highest: #1e2433; /* chips, scrollbar thumb */
28
+
29
+ /* ── Borders ──────────────────────────────────────────────────────────── */
30
+ --elah-border: #232938; /* structural edges */
31
+ --elah-border-subtle: #1a1f2b; /* hairline — thumbnail frames, dividers */
32
+ --elah-outline: #2d3548; /* interactive / focus ring */
33
+
34
+ /* ── Text ─────────────────────────────────────────────────────────────── */
35
+ --elah-text: #f3f4f6; /* primary */
36
+ --elah-text-muted: #9ca3af; /* labels, secondary, inactive */
37
+
38
+ /* ── Accent — Cyan (Figma Export button #00c2ff; dark text on fill) ───── */
39
+ --elah-accent: #00c2ff;
40
+ --elah-accent-hover: #2bcbff;
41
+ --elah-accent-dim: #7adcff; /* highlights, underlines, focus rings */
42
+ --elah-accent-glow: rgba(0, 194, 255, 0.35);
43
+ --elah-accent-soft: rgba(0, 194, 255, 0.12);
44
+ --elah-accent-text: #06212b; /* text on a filled accent surface */
45
+
46
+ /* ── Semantic ─────────────────────────────────────────────────────────── */
47
+ --elah-color-error: #f87171; /* delete, destructive actions */
48
+
49
+ /* ── Timeline (white playhead, cool-gray ticks) ───────────────────────── */
50
+ --elah-playhead: #ffffff; /* playhead needle */
51
+ --elah-tick-color: #394146; /* ruler tick marks */
52
+ --elah-tick-label: #7a858b; /* ruler timecode labels */
53
+
54
+ /* ── Clip colours — video ─────────────────────────────────────────────── */
55
+ --elah-clip-video-top: #3b82f6;
56
+ --elah-clip-video-mid: #2563eb;
57
+ --elah-clip-video-bottom: #1d4ed8;
58
+ --elah-clip-video-accent: #60a5fa;
59
+
60
+ /* ── Clip colours — audio (teal-green at rest; blue when selected) ────── */
61
+ --elah-clip-audio-top: #1c8160;
62
+ --elah-clip-audio-mid: #115843;
63
+ --elah-clip-audio-bottom: #0c2a26; /* exact body */
64
+ --elah-clip-audio-accent: #0d4d3c; /* exact border */
65
+
66
+ /* ── Clip colours — text (orange / rust) ──────────────────────────────── */
67
+ --elah-clip-text-top: #ad5621;
68
+ --elah-clip-text-mid: #8f3f18;
69
+ --elah-clip-text-bottom: #7a2e10; /* exact body */
70
+ --elah-clip-text-accent: #ad5621; /* exact border */
71
+
72
+ /* ── Clip colours — image ─────────────────────────────────────────────── */
73
+ --elah-clip-image-top: #fbbf24;
74
+ --elah-clip-image-mid: #d97706;
75
+ --elah-clip-image-bottom: #b45309;
76
+ --elah-clip-image-accent: #fcd34d;
77
+
78
+ /* ── Clip colours — shape (indigo) ───────────────────────────────────── */
79
+ --elah-clip-shape-top: #818cf8;
80
+ --elah-clip-shape-mid: #6366f1;
81
+ --elah-clip-shape-bottom: #4f46e5;
82
+ --elah-clip-shape-accent: #a5b4fc;
83
+
84
+ /* ── Clip colours — freehand (teal-green) ────────────────────────────── */
85
+ --elah-clip-freehand-top: #34d399;
86
+ --elah-clip-freehand-mid: #10b981;
87
+ --elah-clip-freehand-bottom: #059669;
88
+ --elah-clip-freehand-accent: #6ee7b7;
89
+
90
+ /* ── Kind tag colours — panel chips (dark defaults) ──────────────────── */
91
+ --elah-tag-video-fg: #93c5fd;
92
+ --elah-tag-video-bg: rgba(37, 99, 235, 0.2);
93
+ --elah-tag-audio-fg: #86efac;
94
+ --elah-tag-audio-bg: rgba(22, 163, 74, 0.2);
95
+ --elah-tag-image-fg: #fcd34d;
96
+ --elah-tag-image-bg: rgba(245, 158, 11, 0.2);
97
+
98
+ /* ── Element type colours — palette tiles ────────────────────────────── */
99
+ --elah-tag-text-fg: #f0b483;
100
+ --elah-tag-text-bg: rgba(173, 86, 33, 0.25);
101
+ --elah-tag-text-border: rgba(173, 86, 33, 0.4);
102
+
103
+ --elah-tag-shape-fg: #a5b4fc;
104
+ --elah-tag-shape-bg: rgba(99, 102, 241, 0.2);
105
+ --elah-tag-shape-border: rgba(99, 102, 241, 0.4);
106
+
107
+ --elah-tag-freehand-fg: #6ee7b7;
108
+ --elah-tag-freehand-bg: rgba(16, 185, 129, 0.18);
109
+ --elah-tag-freehand-border: rgba(16, 185, 129, 0.38);
110
+
111
+ /* ── Typography ───────────────────────────────────────────────────────── */
112
+ --elah-font-ui: system-ui, -apple-system, 'Segoe UI', sans-serif;
113
+ --elah-font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
114
+
115
+ /* ── Geometry ─────────────────────────────────────────────────────────── */
116
+ --elah-radius-sm: 6px;
117
+ --elah-radius-md: 8px;
118
+
119
+ /* ── Timeline chrome (dark defaults) ──────────────────────────────────── */
120
+ --elah-text-on-clip: rgba(255, 255, 255, 0.95);
121
+
122
+ --elah-selection-border: #00c2ff;
123
+ --elah-selection-glow: rgba(0, 194, 255, 0.4);
124
+
125
+ --elah-transition-line: rgba(107, 140, 255, 0.9);
126
+ --elah-transition-line-hover: rgba(255, 255, 255, 0.55);
127
+ --elah-transition-line-idle: rgba(255, 255, 255, 0.18);
128
+ --elah-transition-fill: #3c3e94;
129
+ --elah-transition-stroke: #525480;
130
+ --elah-transition-add-fill: rgba(255, 255, 255, 0.12);
131
+ --elah-transition-add-stroke: rgba(255, 255, 255, 0.7);
132
+
133
+ --elah-menu-bg: #1e2433;
134
+ --elah-menu-border: #2d3548;
135
+ --elah-menu-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
136
+
137
+ --elah-popover-bg: #1a1f2b;
138
+ --elah-popover-border: #2d3548;
139
+ --elah-popover-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
140
+ --elah-popover-option-bg: #232938;
141
+ --elah-popover-option-bg-hover: #2d3548;
142
+ --elah-popover-option-bg-active: #3b4a6b;
143
+ --elah-popover-accent: #6b8cff;
144
+ --elah-popover-accent-text: #a5b4fc;
145
+ --elah-popover-icon: #9ca3af;
146
+
147
+ --elah-dialog-overlay: rgba(5, 7, 12, 0.6);
148
+ --elah-dialog-bg: #171d2b;
149
+ --elah-dialog-border: #232938;
150
+ --elah-dialog-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
151
+ --elah-dialog-option-bg: #1b2230;
152
+ --elah-dialog-option-bg-hover: #222b3c;
153
+ --elah-dialog-option-border: #2a3142;
154
+ --elah-dialog-primary-border: #2563eb;
155
+ --elah-dialog-primary-bg: rgba(37, 99, 235, 0.16);
156
+ --elah-dialog-primary-bg-hover: rgba(37, 99, 235, 0.28);
157
+
158
+ --elah-danger-text: #ff6b6b;
159
+ --elah-danger-text-alt: #f87171;
160
+ --elah-danger-bg-hover: rgba(255, 107, 107, 0.12);
161
+ --elah-danger-border: #3f2a2a;
162
+
163
+ /* Flat clip treatment to match the Figma — minimal gloss/highlight/shadow. */
164
+ --elah-effect-gloss: rgba(255, 255, 255, 0.04);
165
+ --elah-effect-inner-highlight: rgba(255, 255, 255, 0.04);
166
+ --elah-effect-inner-highlight-strong: rgba(255, 255, 255, 0.06);
167
+ --elah-effect-clip-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
168
+ --elah-effect-tile-separator: rgba(0, 0, 0, 0.28);
169
+ --elah-effect-waveform: rgba(255, 255, 255, 0.85);
170
+ --elah-effect-placeholder-bg: rgba(0, 0, 0, 0.22);
171
+ --elah-effect-placeholder-border: rgba(255, 255, 255, 0.08);
172
+ --elah-effect-trim-scrim: rgba(0, 0, 0, 0.35);
173
+ --elah-effect-label-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
174
+ --elah-effect-delete-btn-bg: rgba(0, 0, 0, 0.5);
175
+ --elah-effect-delete-btn-border: rgba(255, 255, 255, 0.35);
176
+ --elah-effect-delete-btn-text: #ffffff;
177
+
178
+ /* ── Editor overlays / toasts / preview (dark defaults) ────────────────── */
179
+ --elah-preview-bg: #06070a;
180
+ --elah-stage-border: rgba(0, 194, 255, 0.45);
181
+ --elah-stage-glow: 0 0 20px rgba(0, 194, 255, 0.08);
182
+ --elah-selection-color: #4c9aff;
183
+ --elah-selection-handle: #ffffff;
184
+ --elah-danger-bg: #3a2418;
185
+ --elah-info-bg: #1a2433;
186
+ --elah-info-border: #355070;
187
+ --elah-info-text: #c8d8f0;
188
+ }
189
+
190
+ /* Audio clips render a tinted waveform on a dark body — teal-green at rest,
191
+ blue when selected/active. The selected rule overrides the audio clip vars on
192
+ the clip element itself so the `from-clip-audio-*` gradient utilities repaint;
193
+ --elah-effect-waveform cascades to the waveform bars. Hooks: data-clip-type /
194
+ data-selected on the ClipBlock root. */
195
+ .elah-root [data-clip-type='audio'] {
196
+ --elah-effect-waveform: #248f6c; /* exact green waveform */
197
+ }
198
+ .elah-root [data-clip-type='audio'][data-selected='true'] {
199
+ --elah-clip-audio-top: #2b4a82;
200
+ --elah-clip-audio-mid: #1d3460;
201
+ --elah-clip-audio-bottom: #162245; /* exact blue body */
202
+ --elah-clip-audio-accent: #4370b2; /* exact blue border */
203
+ --elah-effect-waveform: #4370b2; /* exact blue waveform */
204
+ }