@tongue-core/studio 0.1.0-rc.1 → 0.1.0-rc.2
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 +21 -0
- package/assets/studio.css +5 -0
- package/dist/automation.js +3 -1
- package/dist/page.js +1 -1
- package/dist/studio.js +2 -2
- package/package.json +4 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Backpine
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/assets/studio.css
CHANGED
|
@@ -84,6 +84,11 @@ button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
|
84
84
|
.stage-canvas { display: block; width: 100%; height: 100%; }
|
|
85
85
|
.stage-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }
|
|
86
86
|
.stage-note.bad { color: var(--bad); }
|
|
87
|
+
/* A failed build, over the last frame that built: the message as the compiler wrote it. */
|
|
88
|
+
.stage-error { position: absolute; left: 12px; right: 12px; bottom: 12px; max-height: 50%; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid var(--bad); border-radius: 8px; background: rgba(10, 10, 10, 0.94); color: var(--soft); font-size: 12px; }
|
|
89
|
+
.stage-error strong { display: block; margin-bottom: 6px; color: var(--bad); font-weight: 600; }
|
|
90
|
+
.stage-error pre { margin: 0 0 8px; color: var(--text); white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
91
|
+
.stage-error span { color: var(--muted); }
|
|
87
92
|
.stage-drafting { position: absolute; right: 28px; bottom: 26px; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; opacity: 0; transition: opacity 120ms; }
|
|
88
93
|
.stage[data-exact="no"] .stage-drafting { opacity: 1; transition-delay: 250ms; }
|
|
89
94
|
|
package/dist/automation.js
CHANGED
|
@@ -6,9 +6,11 @@ export function studioHandle(registry, timeline, player) {
|
|
|
6
6
|
const f = player.film;
|
|
7
7
|
return f ? { project: f.build.project, length: f.doc.film.length, fps: f.doc.film.fps, clips: registry.get(timeline.model)?.clips.size ?? 0 } : null;
|
|
8
8
|
},
|
|
9
|
+
// Against the player's own playhead: it moves the moment a seek is asked for, while the timeline
|
|
10
|
+
// hears of it on the next tick, so a seek just made isn't mistaken for one already shown.
|
|
9
11
|
settled: () => {
|
|
10
12
|
const r = registry.get(timeline.readiness), shown = registry.get(timeline.shown);
|
|
11
|
-
return r !== null && r.ready + r.failed === r.files && shown !== null && shown.exact && shown.frame === registry.get(timeline.playhead);
|
|
13
|
+
return r !== null && r.ready + r.failed === r.files && shown !== null && shown.exact && shown.frame === player.frame && registry.get(timeline.playhead) === player.frame;
|
|
12
14
|
},
|
|
13
15
|
seek: (frame) => registry.set(timeline.commands, { type: "seek", frame }),
|
|
14
16
|
play: () => registry.set(timeline.commands, { type: "play" }),
|
package/dist/page.js
CHANGED
|
@@ -6,7 +6,7 @@ export function studioPage(o) {
|
|
|
6
6
|
return `<!doctype html>
|
|
7
7
|
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
<title>${escapeHtml(o.title)} · Tongue Studio</title>
|
|
9
|
-
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%
|
|
9
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%23f4739b'/%3E%3Cpath d='M9 12h14M16 12v11' stroke='%230a0a0a' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E">
|
|
10
10
|
<link rel="stylesheet" href="${escapeHtml(o.stylesheet)}">
|
|
11
11
|
</head><body><div id="studio"></div>
|
|
12
12
|
<script>window.TONGUE_STUDIO = ${config};</script>
|
package/dist/studio.js
CHANGED
|
@@ -47,7 +47,7 @@ export function Studio(props) {
|
|
|
47
47
|
player.reload().catch((e) => setLoadError(e instanceof Error ? e.message : String(e)));
|
|
48
48
|
});
|
|
49
49
|
}, [config.events, player]);
|
|
50
|
-
return (_jsxs(TimelineProvider, { timeline: timeline, registry: registry, previews: player, previewsVersion: loads, children: [_jsx(Keys, {}), _jsxs("div", { className: "studio", children: [_jsx(TopBar, { config: config, film: film, build: build, loadError: loadError }), _jsxs("div", { className: "studio-main", children: [_jsx(Stage, { canvas: canvas, film: film, loadError: loadError }), _jsx(Inspector, { film: film, errors: errors })] }), _jsx(TransportBar, { film: film }), _jsx(TimelinePanel, {})] })] }));
|
|
50
|
+
return (_jsxs(TimelineProvider, { timeline: timeline, registry: registry, previews: player, previewsVersion: loads, children: [_jsx(Keys, {}), _jsxs("div", { className: "studio", children: [_jsx(TopBar, { config: config, film: film, build: build, loadError: loadError }), _jsxs("div", { className: "studio-main", children: [_jsx(Stage, { canvas: canvas, film: film, loadError: loadError, buildError: build.kind === "failed" ? build.message : null }), _jsx(Inspector, { film: film, errors: errors })] }), _jsx(TransportBar, { film: film }), _jsx(TimelinePanel, {})] })] }));
|
|
51
51
|
}
|
|
52
52
|
function Keys() {
|
|
53
53
|
useTimelineKeys();
|
|
@@ -94,7 +94,7 @@ function Stage(props) {
|
|
|
94
94
|
useAtomEffect(timeline.shown, (s) => { if (stage.current)
|
|
95
95
|
stage.current.dataset["exact"] = s?.exact ? "yes" : "no"; });
|
|
96
96
|
const aspect = props.film ? `${props.film.doc.film.width} / ${props.film.doc.film.height}` : "16 / 9";
|
|
97
|
-
return (_jsxs("section", { className: "stage", ref: stage, children: [_jsxs("div", { className: "stage-frame", style: { aspectRatio: aspect }, children: [_jsx("canvas", { ref: props.canvas, className: "stage-canvas" }), !props.film && !props.loadError ? _jsx("div", { className: "stage-note", children: "Opening the film\u2026" }) : null, props.loadError ? _jsx("div", { className: "stage-note bad", children: props.loadError }) : null] }), _jsx("div", { className: "stage-drafting", "aria-hidden": "true", children: "drawing\u2026" })] }));
|
|
97
|
+
return (_jsxs("section", { className: "stage", ref: stage, children: [_jsxs("div", { className: "stage-frame", style: { aspectRatio: aspect }, children: [_jsx("canvas", { ref: props.canvas, className: "stage-canvas" }), !props.film && !props.loadError ? _jsx("div", { className: "stage-note", children: "Opening the film\u2026" }) : null, props.loadError ? _jsx("div", { className: "stage-note bad", children: props.loadError }) : null, props.buildError ? (_jsxs("div", { className: "stage-error", role: "alert", children: [_jsx("strong", { children: "Build failed" }), _jsx("pre", { children: props.buildError }), _jsx("span", { children: "The last build that worked stays up; save a fix and it reloads." })] })) : null] }), _jsx("div", { className: "stage-drafting", "aria-hidden": "true", children: "drawing\u2026" })] }));
|
|
98
98
|
}
|
|
99
99
|
// ---------------------------------------------------------------- transport
|
|
100
100
|
function TransportBar(props) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongue-core/studio",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.2",
|
|
4
4
|
"description": "Tongue's studio: a film's player, timeline and inspector in the browser, built only from @tongue-core/ui. Served by `tongue studio`, for a project on this machine or a build anywhere.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"author": "Backpine",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@effect/atom-react": "4.0.6",
|
|
31
|
-
"@tongue-core/project": "0.1.0-rc.
|
|
32
|
-
"@tongue-core/ui": "0.1.0-rc.
|
|
31
|
+
"@tongue-core/project": "0.1.0-rc.2",
|
|
32
|
+
"@tongue-core/ui": "0.1.0-rc.2",
|
|
33
33
|
"effect": "4.0.6",
|
|
34
34
|
"react": "19.3.0",
|
|
35
35
|
"react-dom": "19.3.0"
|