fablecut 1.22.1 → 1.23.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/index.html CHANGED
@@ -2,12 +2,13 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
6
6
  <title>FableCut - Video Editor</title>
7
7
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
8
8
  <link rel="icon" href="/icons/favicon-32.png" sizes="32x32" type="image/png">
9
9
  <meta name="theme-color" content="#0e0e10">
10
10
  <link rel="stylesheet" href="style.css">
11
+ <link rel="stylesheet" href="compact.css">
11
12
  </head>
12
13
  <body>
13
14
  <div class="app" id="app">
@@ -39,7 +40,7 @@
39
40
  </svg>
40
41
  </button>
41
42
  <button class="btn ghost" id="btnHelp" title="Keyboard shortcuts">?</button>
42
- <button class="btn primary" id="btnExport">⬇ Export</button>
43
+ <button class="btn primary" id="btnExport"><span class="gx gx-get">⬇</span> Export</button>
43
44
  </div>
44
45
  </header>
45
46
 
@@ -83,7 +84,7 @@
83
84
  <input type="file" id="fileInput" class="sr-only" multiple accept="video/*,audio/*,image/*,.mp4,.mov,.webm,.mkv,.mp3,.wav,.m4a,.png,.jpg,.jpeg,.gif,.webp,.svg">
84
85
  <div class="bin-list" id="binList">
85
86
  <div class="bin-empty" id="binEmpty">
86
- <div class="bin-empty-icon">🎬</div>
87
+ <div class="bin-empty-icon"><span class="gx gx-video">🎬</span></div>
87
88
  <p>Drop video, audio or images here<br>or click <b>+ Import</b> / <b>+ URL</b></p>
88
89
  <p class="hint">Double-click to open in Source, or drag onto the timeline.</p>
89
90
  </div>
@@ -159,11 +160,11 @@
159
160
  </span>
160
161
  <div class="transport-btns">
161
162
  <button class="btn icon" id="btnMarkIn" title="Mark In (I) — Source marks when Source is active; timeline work area in Program">I</button>
162
- <button class="btn icon" id="btnHome" title="Go to start (Home)">⏮</button>
163
- <button class="btn icon" id="btnBack" title="Back 1 frame (←)">◀︎</button>
164
- <button class="btn icon big" id="btnPlay" title="Play / Pause (Space)">▶</button>
165
- <button class="btn icon" id="btnFwd" title="Forward 1 frame (→)">▶︎</button>
166
- <button class="btn icon" id="btnEnd" title="Go to end (End)">⏭</button>
163
+ <button class="btn icon" id="btnHome" title="Go to start (Home)"><span class="gx gx-start">⏮</span></button>
164
+ <button class="btn icon" id="btnBack" title="Back 1 frame (←)"><span class="gx gx-prev">◀︎</span></button>
165
+ <button class="btn icon big" id="btnPlay" title="Play / Pause (Space)"><span class="gx gx-play">▶</span></button>
166
+ <button class="btn icon" id="btnFwd" title="Forward 1 frame (→)"><span class="gx gx-next">▶︎</span></button>
167
+ <button class="btn icon" id="btnEnd" title="Go to end (End)"><span class="gx gx-end">⏭</span></button>
167
168
  <button class="btn icon" id="btnMarkOut" title="Mark Out (O) — Source marks when Source is active; timeline work area in Program">O</button>
168
169
  <button class="btn icon toggle" id="btnSpeed" title="Preview speed — click to cycle 1×/1.5×/2×/4×. L forward · J reverse (tap again = faster) · K stop. Preview only, not export.">1×</button>
169
170
  </div>
@@ -225,7 +226,7 @@
225
226
  <button class="btn tiny hidden" id="btnTrimIO" title="Trim clips to IN/OUT (⇧T)"><svg class="ico" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="square" d="M1.25 4.5H12M4.5 1.25V12M4.5 12H14.75M12 4.5V14.75"/></svg> Trim</button>
226
227
  <button class="btn tiny toggle hidden" id="btnWorkAreaPlay" title="Limit playback to IN/OUT (Home/End jump to markers; playhead outside = override)"><svg class="ico" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="square" stroke-linejoin="miter" d="M1.5 2.5V13.5M14.5 2.5V13.5M4.25 8H11.75M9.35 5.6L12 8L9.35 10.4"/></svg> Limit</button>
227
228
  <span class="tool-seg" role="group" aria-label="Edit tool"><button type="button" class="btn tiny on" data-edit-tool="select" aria-pressed="true" title="Selection tool (V) — move and trim clips"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path fill="currentColor" d="M4 1.5v11.2l3-2.9 1.9 4.6 1.8-.8-1.9-4.4h4.2z"/></svg></button><button type="button" class="btn tiny" data-edit-tool="ripple" aria-pressed="false" title="Ripple edit (B) — drag a clip edge; everything after it moves with it"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M5 2.5v11M5 8h8.5M11 5.5 13.5 8 11 10.5"/></svg></button><button type="button" class="btn tiny" data-edit-tool="roll" aria-pressed="false" title="Rolling edit (R) — drag a cut; the clips on both sides trim, nothing else moves"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M8 2v12M1.5 8h4M10.5 8h4M3.5 6 1.5 8l2 2M12.5 6l2 2-2 2"/></svg></button><button type="button" class="btn tiny" data-edit-tool="slip" aria-pressed="false" title="Slip (Y) — drag a clip to change which part of the source it shows"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 3v10M13.5 3v10M5 8h6M6.8 6.2 5 8l1.8 1.8M9.2 6.2 11 8l-1.8 1.8"/></svg></button><button type="button" class="btn tiny" data-edit-tool="slide" aria-pressed="false" title="Slide (U) — drag a clip along the track; its neighbours trim to make room"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><rect fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" x="5" y="4" width="6" height="8" rx="1"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M1 8h2.5M12.5 8H15M2.3 6.7 1 8l1.3 1.3M13.7 6.7 15 8l-1.3 1.3"/></svg></button></span>
228
- <button class="btn tiny" id="btnSplit" title="Split at playhead on targeted tracks (S)">✂ Split</button>
229
+ <button class="btn tiny" id="btnSplit" title="Split at playhead on targeted tracks (S)"><span class="gx gx-split">✂</span> Split</button>
229
230
  <button class="btn tiny" id="btnCloseGap" title="Close gap at playhead (⇧G)"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" style="vertical-align:-3px" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" d="M0.75 4.5H3.5V11.5H0.75M15.25 4.5H12.5V11.5H15.25"/><path fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" d="M6.35 5.85L9.65 10.15M9.65 5.85L6.35 10.15"/></svg> Close gap</button>
230
231
  <button class="btn tiny" id="btnNextGap" title="Find gap (G)"><svg class="ico" viewBox="0 0 16 16" width="14" height="14" style="vertical-align:-3px" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" d="M0.75 4.5H3.5V11.5H0.75M15.25 4.5H12.5V11.5H15.25"/><text x="8" y="11.1" text-anchor="middle" fill="currentColor" font-size="9.5" font-family="Segoe UI, system-ui, sans-serif" font-weight="700">?</text></svg> Find gap</button>
231
232
  <button class="btn tiny" id="btnDelete" title="Delete selected (Del)"><svg class="ico" viewBox="0 0 16 16" width="13" height="13" aria-hidden="true"><path fill="currentColor" d="M5.5 1.5h5v1.25H14v1.5H2v-1.5h3.5V1.5zM3.75 5.5h8.5v8.25a1.5 1.5 0 0 1-1.5 1.5h-5.5a1.5 1.5 0 0 1-1.5-1.5V5.5zm2 2v5h1.25v-5H5.75zm3.25 0v5H10.25v-5H9z"/></svg> Delete</button>
@@ -237,7 +238,7 @@
237
238
  <button class="btn tiny toggle" id="btnAudioHold" title="Audio Hold — while paused, loop one frame of audio at the playhead. Play/Stop turns it off."><svg class="ico" viewBox="0 0 16 16" width="13" height="13" style="vertical-align:-3px" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="square" d="M1.75 2.75V13.25M14.25 2.75V13.25"/><path fill="currentColor" d="M5.2 5.85h1.15v4.3H5.2V5.85zM7.05 5.85h0.55l2.85-2.2v8.7l-2.85-2.2H7.05V5.85z"/></svg> Audio hold</button>
238
239
  <span class="flex-spacer"></span>
239
240
  <span class="dim tiny-label">Zoom</span>
240
- <input type="range" id="zoomSlider" min="1" max="300" value="60">
241
+ <input type="range" id="zoomSlider" aria-label="Timeline zoom" min="1" max="300" value="60">
241
242
  <button class="btn tiny" id="btnZoomFit" title="Zoom timeline to fit (⇧Z)"><span class="fit-icon">│<span class="fit-arrow">↔</span>│</span> Fit</button>
242
243
  </div>
243
244
  <div class="timeline">
@@ -506,6 +507,19 @@
506
507
  </span>
507
508
  </label>
508
509
  </div>
510
+ <div class="settings-section">
511
+ <h3>Screen</h3>
512
+ <label class="settings-row settings-pick">
513
+ <span>
514
+ <span class="settings-label">Layout</span>
515
+ <span class="settings-hint">Automatic picks by window size and whether you use a finger or a mouse. Remembered in this browser.</span>
516
+ </span>
517
+ <select id="setLayout" aria-label="Layout">
518
+ <option value="">Automatic</option><option value="phone">Phone</option>
519
+ <option value="tablet">Tablet</option><option value="desktop">Desktop</option>
520
+ </select>
521
+ </label>
522
+ </div>
509
523
  <div class="settings-section">
510
524
  <h3>Export</h3>
511
525
  <label class="settings-row">
@@ -709,6 +723,7 @@
709
723
 
710
724
  <div id="toast"></div>
711
725
 
726
+ <script src="layout.js"></script>
712
727
  <script src="doc-guard.js"></script>
713
728
  <script src="loudness.js"></script>
714
729
  <script src="ducking.js"></script>
@@ -736,5 +751,7 @@
736
751
  <script src="focus.js"></script>
737
752
  <script src="select-menu.js"></script>
738
753
  <script src="app.js"></script>
754
+ <script src="compact.js"></script>
755
+ <script src="touch.js"></script>
739
756
  </body>
740
757
  </html>
package/layout.js ADDED
@@ -0,0 +1,72 @@
1
+ /* Which layout fits this screen: phone, tablet or desktop.
2
+
3
+ Decided here and nowhere else, from the space and the kind of input (never
4
+ from the browser's name), and written as one attribute on the root element
5
+ that style sheets and scripts both read:
6
+
7
+ <html data-layout="phone portrait"> phone, held upright
8
+ <html data-layout="phone landscape"> phone on its side, or a very short window
9
+ <html data-layout="tablet portrait"> one side panel at a time
10
+ <html data-layout="desktop landscape"> the three-column editor
11
+
12
+ Match a word with [data-layout~="phone"]. A `fablecut:layout` event on
13
+ window follows every change. Nothing that draws or exports reads this. */
14
+ (function (root, factory) {
15
+ if (typeof module === "object" && module.exports) module.exports = factory();
16
+ else root.FableCutLayout = factory();
17
+ })(typeof self !== "undefined" ? self : this, function () {
18
+ "use strict";
19
+
20
+ const MODES = ["phone", "tablet", "desktop"];
21
+ const KEY = "fablecut-layout"; // the manual choice, per browser
22
+ const DESKTOP_W = 1100; // with a mouse: at and above this, always today's layout
23
+ const DESKTOP_W_TOUCH = 1400; // finger first: an iPad Pro on its side (1366) is still a tablet
24
+ const PHONE_W = 700;
25
+ const PHONE_H = 480; // a phone on its side is wide but short
26
+
27
+ /** w, h: the window in CSS px. coarse: the main pointer is a finger. override: a mode, or null for auto. */
28
+ function pick({ w, h, coarse = false, override = null }) {
29
+ const landscape = w > h;
30
+ if (MODES.includes(override)) return { mode: override, landscape };
31
+ if (w >= (coarse ? DESKTOP_W_TOUCH : DESKTOP_W)) return { mode: "desktop", landscape };
32
+ if (w < PHONE_W || h < PHONE_H) return { mode: "phone", landscape };
33
+ return { mode: "tablet", landscape };
34
+ }
35
+ const attr = (r) => `${r.mode} ${r.landscape ? "landscape" : "portrait"}`;
36
+
37
+ const api = { MODES, pick, attr, mode: "desktop", landscape: true, override: null, set: () => { }, update: () => { } };
38
+ if (typeof window === "undefined" || typeof document === "undefined") return api;
39
+
40
+ const coarse = window.matchMedia("(pointer: coarse)");
41
+ try { const v = localStorage.getItem(KEY); if (MODES.includes(v)) api.override = v; } catch { }
42
+
43
+ const typing = () => {
44
+ const el = document.activeElement;
45
+ return !!el && (el.tagName === "TEXTAREA" || el.isContentEditable ||
46
+ (el.tagName === "INPUT" && !["range", "checkbox", "radio", "button", "color", "file"].includes(el.type)));
47
+ };
48
+ let lastW = 0;
49
+ api.update = () => {
50
+ const w = window.innerWidth, h = window.innerHeight;
51
+ // some browsers shrink the window for the on-screen keyboard: that is not a rotation
52
+ if (w === lastW && typing() && coarse.matches) return;
53
+ lastW = w;
54
+ const r = pick({ w, h, coarse: coarse.matches, override: api.override });
55
+ const next = attr(r), was = document.documentElement.dataset.layout;
56
+ api.mode = r.mode; api.landscape = r.landscape;
57
+ if (next === was) return;
58
+ document.documentElement.dataset.layout = next;
59
+ window.dispatchEvent(new CustomEvent("fablecut:layout", { detail: { from: was || null, to: next } }));
60
+ };
61
+ /** Choose by hand (null: back to automatic). Remembered in this browser. */
62
+ api.set = (mode) => {
63
+ api.override = MODES.includes(mode) ? mode : null;
64
+ try { if (api.override) localStorage.setItem(KEY, api.override); else localStorage.removeItem(KEY); } catch { }
65
+ api.update();
66
+ };
67
+ window.addEventListener("resize", api.update);
68
+ document.addEventListener("focusout", () => setTimeout(api.update, 60)); // a rotation while the keyboard was up
69
+ coarse.addEventListener("change", api.update);
70
+ api.update();
71
+ return api;
72
+ });
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.2",
3
3
  "name": "fablecut",
4
4
  "display_name": "FableCut",
5
- "version": "1.22.1",
5
+ "version": "1.23.0",
6
6
  "description": "Zero-dependency browser video editor that AI agents can drive — JSON timeline, MCP tools, live-reloading UI.",
7
7
  "long_description": "FableCut is a Premiere-style non-linear video editor that runs in the browser with zero npm dependencies. An AI agent edits video by patching a single project.json timeline (clips, keyframes, transitions, text animations, filters, speed ramps, adjustment layers) through MCP tools, with color grading, masks and tracking, an audio mixer with effects, motion graphics (shape layers, compositions, animation presets and templates), and media management with offline relink and proxies; the open editor UI live-reloads within ~150 ms and exports through ffmpeg with delivery presets (YouTube, Reels, TikTok, Broadcast ProRes, lossless archive…), batch outputs from one render, loudness normalization and a check of every file. Includes reference-video analysis (shot cuts, beats, BPM, energy, drop) so agents can remake an edit with new footage.",
8
8
  "author": {
package/mcp-server.js CHANGED
@@ -2290,7 +2290,7 @@ async function handle(msg) {
2290
2290
  result: {
2291
2291
  protocolVersion: negotiateProtocolVersion(params?.protocolVersion),
2292
2292
  capabilities: { tools: {} },
2293
- serverInfo: { name: "fablecut", version: "1.22.1" },
2293
+ serverInfo: { name: "fablecut", version: "1.23.0" },
2294
2294
  },
2295
2295
  });
2296
2296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fablecut",
3
- "version": "1.22.1",
3
+ "version": "1.23.0",
4
4
  "description": "Zero-dependency browser video editor that AI agents can drive — JSON timeline, MCP server, REST API, live-reloading UI.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "*.js",
11
11
  "index.html",
12
12
  "style.css",
13
+ "compact.css",
13
14
  "favicon.svg",
14
15
  "icons/",
15
16
  "encoding-profiles.json",
package/style.css CHANGED
@@ -4877,3 +4877,10 @@ input[type=number]:hover::-webkit-inner-spin-button { opacity: .8; }
4877
4877
  .export-credits-head .btn { margin-left: auto; }
4878
4878
  .export-credit { color: var(--dim); overflow-wrap: anywhere; }
4879
4879
  .export-credit.warn { color: #f0c14a; }
4880
+
4881
+ /* Settings → Screen: a choice instead of a switch */
4882
+ .settings-row.settings-pick { justify-content: space-between; align-items: center; gap: 14px; }
4883
+ .settings-pick select {
4884
+ flex: none; background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
4885
+ border-radius: 6px; padding: 6px 28px 6px 10px; font: inherit;
4886
+ }