refactor: scope character sheets
This commit is contained in:
parent
e5bd2a149f
commit
73f8f92826
@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- **Character-sheet namespace migration.** Character-sheet extraction, prompt helpers, and Reader/Rehearser entry points now
|
||||
use a private scope with compatibility exports and a `window.TTVC.characterSheets` API.
|
||||
- **Voice-library namespace migration.** Voice loading, rendering, benchmarking, and add/import workflows now use a
|
||||
private scope with live compatibility accessors and a `window.TTVC.voiceLibrary` API.
|
||||
- **Generation namespace migration.** WAV merging, chunked TTS, history, playlist, effects, and refinement helpers now
|
||||
|
||||
4
TODO.md
4
TODO.md
@ -126,8 +126,8 @@ architecture change: the larger Audiobook/Rehearser/style split.
|
||||
- [x] Extract Rehearser stage display and cast-sidebar controls into `rehearser-stage.js`.
|
||||
- [ ] Replace broad globals with namespaces such as `window.TTVC.audiobook`; pure leaves, Audiobook/Reader/Rehearser
|
||||
feature modules, Studio, and character-library persistence now use private scopes with explicit compatibility exports.
|
||||
Voice-library loading, rendering, benchmarking, and import workflows are now scoped; remaining utility and legacy
|
||||
library UI modules still require the same responsibility-by-responsibility migration.
|
||||
Voice-library loading, rendering, benchmarking, import workflows, and character-sheet extraction are now scoped;
|
||||
remaining utility and legacy library UI modules still require the same responsibility-by-responsibility migration.
|
||||
- [x] Generate the feature-module list for `loader.js` and `scripts/minify.mjs` from one shared manifest;
|
||||
larger responsibility splits remain.
|
||||
- [x] Add a dependency-free frontend syntax and top-level declaration collision gate (`npm run check:frontend`);
|
||||
|
||||
@ -75,6 +75,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
|
||||
- ✅ STT backend, recording, voice-loading, and STT-to-TTS helpers use a private scope with live compatibility accessors.
|
||||
- ✅ Generation audio/history/playlist helpers use a private scope with explicit compatibility exports and a namespace API.
|
||||
- ✅ Voice-library loading, rendering, benchmarking, and import workflows use a private scope with live compatibility exports.
|
||||
- ✅ Character-sheet extraction and prompt helpers use a private scope with explicit compatibility exports and a namespace API.
|
||||
- ✅ `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/voice-design.css` — isolated Voice Design form, samples, and preview-match styles.
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta name="theme-color" content="#2563EB">
|
||||
<meta name="app-version" content="1.24.85">
|
||||
<meta name="app-version" content="1.24.86">
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/static/icon.svg">
|
||||
@ -27,12 +27,12 @@
|
||||
|
||||
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
|
||||
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
|
||||
<link rel="stylesheet" href="/static/style.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.85">
|
||||
<link rel="stylesheet" href="/static/style.css?v=1.24.86">
|
||||
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.86">
|
||||
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.86">
|
||||
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.86">
|
||||
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.86">
|
||||
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.86">
|
||||
|
||||
|
||||
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
|
||||
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
|
||||
</script>
|
||||
|
||||
<!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
|
||||
<script src="/static/loader.js?v=1.24.85"></script>
|
||||
<script src="/static/loader.js?v=1.24.86"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
// document (Read Aloud) or a script (Script Rehearser). Each claim cites a
|
||||
// source (page + short quote + category hint). Shared by both sections via one overlay.
|
||||
|
||||
(function (root) {
|
||||
|
||||
const CS_CHUNK_CHARS = 4000;
|
||||
const _cs = { running: false, cancel: false, cache: {} };
|
||||
|
||||
@ -2645,3 +2647,18 @@ window.csForReaderSelective = csForReaderSelective;
|
||||
window.csForRehearser = csForRehearser;
|
||||
$('reader-charsheets-btn')?.addEventListener('click', csForReader);
|
||||
$('reh-charsheets-btn')?.addEventListener('click', csForRehearser);
|
||||
|
||||
Object.assign(root, {
|
||||
csBuildImagePrompt, csBuildVoicePrompt, csCardHtml, csDeepAnalysis,
|
||||
csForReader, csForReaderSelective, csForRehearser, csReaderPageHost, csShow,
|
||||
});
|
||||
root.TTVC = root.TTVC || {};
|
||||
root.TTVC.characterSheets = root.TTVC.characterSheets || {};
|
||||
Object.assign(root.TTVC.characterSheets, {
|
||||
buildImagePrompt: csBuildImagePrompt,
|
||||
buildVoicePrompt: csBuildVoicePrompt,
|
||||
show: csShow,
|
||||
forReader: csForReader,
|
||||
forRehearser: csForRehearser,
|
||||
});
|
||||
})(window);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user