refactor: scope rehearser io

This commit is contained in:
mARTin-B78 2026-09-04 12:30:13 +02:00
parent a202230654
commit 3a7f0bf677
5 changed files with 38 additions and 13 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- **Rehearser I/O namespace migration.** Serialization, library persistence, import/export, and PDF helpers now use a
private implementation scope with explicit compatibility exports and the existing namespace API.
- **Rehearser playback namespace migration.** WebAudio transport, decoded-buffer caching, line-audio caching, and batch - **Rehearser playback namespace migration.** WebAudio transport, decoded-buffer caching, line-audio caching, and batch
synthesis now use a private implementation scope with explicit compatibility exports and a tested namespace API. synthesis now use a private implementation scope with explicit compatibility exports and a tested namespace API.
- **Stateful Audiobook namespace migration.** Casting/recast orchestration and preview/export now keep internal helpers - **Stateful Audiobook namespace migration.** Casting/recast orchestration and preview/export now keep internal helpers

View File

@ -1 +1 @@
1.24.59 1.24.60

View File

@ -50,6 +50,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ `audiobook-preview-export.js` — editable cast preview, Rehearser handoff, chapter-aware export, and export browsing. - ✅ `audiobook-preview-export.js` — editable cast preview, Rehearser handoff, chapter-aware export, and export browsing.
- ✅ Stateful Audiobook modules use private scopes with explicit legacy exports; their public APIs are namespace-tested. - ✅ Stateful Audiobook modules use private scopes with explicit legacy exports; their public APIs are namespace-tested.
- ✅ Rehearser playback uses a private scope with explicit transport/cache compatibility exports and a namespace-tested API. - ✅ Rehearser playback uses a private scope with explicit transport/cache compatibility exports and a namespace-tested API.
- ✅ Rehearser I/O uses a private scope with explicit serialization/library/import compatibility exports.
- ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles.
- ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles.
- ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. - ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles.

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB"> <meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.24.59"> <meta name="app-version" content="1.24.60">
<link rel="manifest" href="/manifest.webmanifest"> <link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml"> <link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg"> <link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── --> <!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css"> <link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.24.59"> <link rel="stylesheet" href="/static/style.css?v=1.24.60">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.59"> <link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.60">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.59"> <link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.60">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.59"> <link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.60">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.59"> <link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.60">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.59"> <link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.60">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── --> <!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script> </script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton --> <!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.24.59"></script> <script src="/static/loader.js?v=1.24.60"></script>
</body> </body>
</html> </html>

View File

@ -1,6 +1,8 @@
// Rehearser serialization, library I/O, and import/export helpers. // Rehearser serialization, library I/O, and import/export helpers.
// Loaded before rehearser.js; dependencies resolve when user actions invoke them. // Loaded before rehearser.js; dependencies resolve when user actions invoke them.
(function (root) {
// ── Serialization ───────────────────────────────────────────────────────── // ── Serialization ─────────────────────────────────────────────────────────
async function clipsToJson(clips) { async function clipsToJson(clips) {
@ -442,9 +444,29 @@ function loadRecord(rec) {
} }
window.TTVC=window.TTVC||{}; // Preserve the classic-script surface for existing handlers while keeping I/O
window.TTVC.rehearser=window.TTVC.rehearser||{}; // implementation details private to this module.
Object.assign(window.TTVC.rehearser,{ Object.assign(root, {
clipsToJson,
clipsFromJson,
rehCurrentRecord,
linesToScriptText,
saveToLibrary,
rehAutoSaveImport,
exportToFile,
exportFountain,
exportFDX,
importFDX,
exportOSF,
loadPdfJs,
importPDFScript,
importFromFile,
loadRecord,
});
root.TTVC=root.TTVC||{};
root.TTVC.rehearser=root.TTVC.rehearser||{};
Object.assign(root.TTVC.rehearser,{
io:{ io:{
currentRecord:rehCurrentRecord, currentRecord:rehCurrentRecord,
save:saveToLibrary, save:saveToLibrary,
@ -454,4 +476,4 @@ Object.assign(window.TTVC.rehearser,{
loadRecord, loadRecord,
}, },
}); });
})(window);