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:
1 parent
82ee5c98d0
commit
a2c8e5998a
10 files changed
+107
-19
No files matched your search
+10
-10
@@ -1,6 +1,6 @@
|
||||
import type { Scene } from '@/types/scene'
|
||||
|
||||
const RUNTIME_VERSION = '14'
|
||||
const RUNTIME_VERSION = '15'
|
||||
|
||||
const ENGINE_SOURCE = `(function(){
|
||||
if (window.AnimatrPlayer && window.AnimatrPlayer.__v === '${RUNTIME_VERSION}') return;
|
||||
@@ -194,7 +194,7 @@ const ENGINE_SOURCE = `(function(){
|
||||
forcePlay: false,
|
||||
buttonStates: {},
|
||||
buttonDisabled: {},
|
||||
warn: function(m){ if(window.console)window.console.warn('[animatr]',m); }
|
||||
warn: function(m){ if(window.console)window.console.warn('[ruwio]',m); }
|
||||
};
|
||||
(scene.markers||[]).forEach(function(mk){ runtime.markers[mk.name]=mk.time; });
|
||||
|
||||
@@ -897,7 +897,7 @@ export interface ExportOptions {
|
||||
|
||||
export function generateRuntimeScript(): string {
|
||||
return (
|
||||
'/* Animatr runtime v' + RUNTIME_VERSION + ' — generated ' + new Date().toISOString() + ' */\n' +
|
||||
'/* RUWIO runtime v' + RUNTIME_VERSION + ' — generated ' + new Date().toISOString() + ' */\n' +
|
||||
ENGINE_SOURCE
|
||||
)
|
||||
}
|
||||
@@ -906,8 +906,8 @@ export function generateSceneScript(scene: Scene, options: ExportOptions = {}):
|
||||
const sceneJson = jsonForExport(scene)
|
||||
const optsJson = JSON.stringify({ loop: options.loop !== false })
|
||||
return (
|
||||
'/* Animatr scene — generated ' + new Date().toISOString() + '\n' +
|
||||
' * Requires animatr-runtime.js (v' + RUNTIME_VERSION + ') to be loaded once per page.\n' +
|
||||
'/* RUWIO scene — generated ' + new Date().toISOString() + '\n' +
|
||||
' * Requires ruwio-runtime.js (v' + RUNTIME_VERSION + ') to be loaded once per page.\n' +
|
||||
' */\n' +
|
||||
SCENE_BOOT_SOURCE.replace('__SCENE__', sceneJson).replace('__OPTIONS__', optsJson)
|
||||
)
|
||||
@@ -915,7 +915,7 @@ export function generateSceneScript(scene: Scene, options: ExportOptions = {}):
|
||||
|
||||
export function generateBundledScript(scene: Scene, options: ExportOptions = {}): string {
|
||||
return (
|
||||
'/* Animatr bundled export — generated ' + new Date().toISOString() + ' */\n' +
|
||||
'/* RUWIO bundled export — generated ' + new Date().toISOString() + ' */\n' +
|
||||
ENGINE_SOURCE +
|
||||
'\n' +
|
||||
generateSceneScriptBody(scene, options)
|
||||
@@ -928,7 +928,7 @@ function generateSceneScriptBody(scene: Scene, options: ExportOptions): string {
|
||||
return SCENE_BOOT_SOURCE.replace('__SCENE__', sceneJson).replace('__OPTIONS__', optsJson)
|
||||
}
|
||||
|
||||
export function downloadRuntime(filename = 'animatr-runtime.js') {
|
||||
export function downloadRuntime(filename = 'ruwio-runtime.js') {
|
||||
triggerDownload(generateRuntimeScript(), filename, 'application/javascript')
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ export function generateExampleHtml(scene: Scene, options: ExportOptions = {}):
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Animatr — Example</title>
|
||||
<title>RUWIO — Example</title>
|
||||
<style>
|
||||
:root { color-scheme: light dark; }
|
||||
body {
|
||||
@@ -1003,7 +1003,7 @@ export function generateExampleHtml(scene: Scene, options: ExportOptions = {}):
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Animatr Export</h1>
|
||||
<h1>RUWIO Export</h1>
|
||||
<p>Load the runtime once, then embed as many scenes on the page as you like.</p>
|
||||
|
||||
<!-- Runtime: once per page -->
|
||||
@@ -1021,7 +1021,7 @@ ${sceneBoot}
|
||||
<div class="usage">
|
||||
<h2>Embed on your own page</h2>
|
||||
<pre><!-- once per page -->
|
||||
<script src="animatr-runtime.js"></script>
|
||||
<script src="ruwio-runtime.js"></script>
|
||||
|
||||
<!-- per animation: one container + scene script -->
|
||||
<div style="width: 800px; height: 450px;">
|
||||
|
||||
Reference in new issue
Block a user