0.8.2: pan outside canvas + finish RUWIO rename of exports

- Canvas stage: plain left-click in the empty content area (outside
  the canvas rectangle) now starts a pan. Ctrl+left-click still pans
  anywhere, middle-click unchanged. Only pure left-click qualifies
  (any modifier leaves the old routing intact).
- Export rebrand Animatr → RUWIO for everything user-visible:
  - Default filenames: projekt.animatr.json → projekt.ruwio.json;
    animatr-runtime.js → ruwio-runtime.js; App's export fallback
    base animatr → ruwio.
  - Generated comment headers in runtime/scene/bundled scripts.
  - Console warn prefix in the runtime and the scene store.
  - Example HTML title, heading, and embed-usage snippet.
  - parseProject error message.
  - ExportDialog copy.
- RUNTIME_VERSION 14 → 15 so cached runtimes reload.
- On-disk magic stays `animatr-project` and window.AnimatrPlayer /
  __animatrPending / localStorage & IndexedDB keys are untouched so
  old project files and previously-exported HTML keep working.

Regression tests: legacy magic still parses; parseProject error
mentions RUWIO and not Animatr; runtime/scene/bundled scripts and
example HTML all carry the new brand; console prefix is [ruwio].

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.7 committed 2026-04-21 22:17:10 +02:00
1 parent 82ee5c98d0
commit a2c8e5998a
10 files changed
+107 -19

No files matched your search

+63
View File
@@ -13,6 +13,7 @@ import { isLayerActiveAt, sampleLayer, lerpColor } from '@/lib/interpolate'
import { snapToCandidates } from '@/lib/timelineSnap'
import {
generateBundledScript,
generateExampleHtml,
generateRuntimeScript,
generateSceneScript,
} from '@/lib/exportPlayer'
@@ -699,6 +700,40 @@ export function registerAllTests(): void {
// And the current fallback must be scene.duration.
expect(r).toContain('scene.outTime==null?scene.duration:scene.outTime')
})
test('export comments and console prefix use RUWIO, not Animatr', () => {
// Rebrand: generated comment headers, the runtime's console warn
// prefix, and the example-HTML chrome all read RUWIO now. If any
// of these come back as "Animatr", we regressed.
const s = makeFreshStore()
const runtime = generateRuntimeScript()
expect(runtime).toContain('RUWIO runtime')
expect(runtime.indexOf('/* Animatr ')).toBe(-1)
// Console prefix used by the runtime's action evaluator.
expect(runtime).toContain("'[ruwio]'")
expect(runtime.indexOf("'[animatr]'")).toBe(-1)
const sceneScript = generateSceneScript(s.scene)
expect(sceneScript).toContain('RUWIO scene')
expect(sceneScript).toContain('ruwio-runtime.js')
const bundled = generateBundledScript(s.scene)
expect(bundled).toContain('RUWIO bundled export')
expect(bundled.indexOf('/* Animatr ')).toBe(-1)
})
test('generated example HTML is RUWIO-branded', () => {
// The example HTML is what users see when they drop the file
// into a browser. Title, heading, and the embed-usage snippet
// all need to carry the new brand.
const s = makeFreshStore()
const html = generateExampleHtml(s.scene)
expect(html).toContain('<title>RUWIO — Example</title>')
expect(html).toContain('<h1>RUWIO Export</h1>')
// The usage snippet now references ruwio-runtime.js.
expect(html).toContain('ruwio-runtime.js')
expect(html.indexOf('animatr-runtime.js')).toBe(-1)
})
})
suite('playback — transport', () => {
@@ -818,6 +853,34 @@ export function registerAllTests(): void {
}
expect(caught instanceof ProjectFileError).toBe(true)
})
test('legacy `animatr-project` magic still parses (backward compat)', () => {
// When we rebranded to RUWIO we kept the on-disk magic as
// `animatr-project` so older exports continue to load. Pin that
// so a future cleanup doesn't accidentally break existing user
// files on disk.
const s = makeFreshStore()
s.addAsset({ kind: 'rect', name: 'Legacy', width: 10, height: 10, fill: '#123' })
const legacyPayload = JSON.parse(serializeProject(s.scene))
expect(legacyPayload.magic).toBe('animatr-project')
// And a fully-formed legacy file parses without error.
const scene = parseProject(JSON.stringify(legacyPayload))
expect(scene.assets.some((a) => a.name === 'Legacy')).toBe(true)
})
test('parseProject error mentions RUWIO, not Animatr', () => {
// The user-visible error when a non-project JSON is dropped in
// reads "Not a RUWIO project file …" now. If you rebrand again
// remember to update this test alongside the string.
let msg = ''
try {
parseProject(JSON.stringify({ not: 'a project' }))
} catch (e) {
msg = (e as Error).message
}
expect(msg).toContain('RUWIO')
expect(msg.toLowerCase().includes('animatr')).toBe(false)
})
})
suite('history — undo/redo', () => {