diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ddcf4..c350dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi ## [Unreleased] ### Changed +- **Rehearser core namespace migration.** Script state, pagination, cast-management, and summary APIs now live inside a + private core scope with explicit legacy exports and a regression-tested `window.TTVC.rehearser.core` surface. - **Rehearser recording namespace migration.** Microphone overlay, recording controls, and shared microphone errors now use a private implementation scope with explicit compatibility exports. - **Rehearser I/O namespace migration.** Serialization, library persistence, import/export, and PDF helpers now use a diff --git a/VERSION b/VERSION index c0e9e42..90c2a29 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.61 +1.24.62 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 6a6335f..4b801ea 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -52,6 +52,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ 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. - ✅ Rehearser recording uses a private scope with explicit microphone/overlay compatibility exports. +- ✅ Rehearser core uses a private scope with explicit state, pagination, and cast-management compatibility exports. - ✅ `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. diff --git a/static/index.html b/static/index.html index ee8fc9e..123fed1 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@ - + @@ -27,12 +27,12 @@ - - - - - - + + + + + + @@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) { - + diff --git a/static/js/rehearser-recording.js b/static/js/rehearser-recording.js index b2d818f..0c12733 100644 --- a/static/js/rehearser-recording.js +++ b/static/js/rehearser-recording.js @@ -145,6 +145,7 @@ Object.assign(root, { hideRecOverlay, startRehMic, stopRehMic, + rehRenderMeter, microphoneErrorMessage, }); diff --git a/static/js/rehearser.js b/static/js/rehearser.js index 52d8147..5e6b887 100644 --- a/static/js/rehearser.js +++ b/static/js/rehearser.js @@ -1,5 +1,7 @@ // ── Script Rehearser ────────────────────────────────────────────────────── +(function (root) { + // ── Constants ───────────────────────────────────────────────────────────── const SPEAKER_COLORS = ['#89b4fa','#a6e3a1','#f38ba8','#fab387','#f9e2af','#cba6f7','#89dceb','#74c7ec']; @@ -2800,3 +2802,37 @@ if (window._rehearserStartImpEx) { delete window._rehearserStartPhase; showPhase(_initPhase); } + +// Classic handlers still resolve these names, but the implementation now lives +// inside one explicit module scope. New integrations should use TTVC.rehearser. +Object.assign(root, { + SPEAKER_COLORS, REH_EMOTIONS, rehCustomEmotions, getEmotionInfo, renderMarkdownInline, + stripMarkdown, rehState, rehApplySharedCast, bookCover, rehLibView, rehTitleKey, + rehUniqueLibraryRecords, renderLibraryList, getVoiceData, _rehVoiceVisibleId, + voiceAvatarHtml, _rehCharAvatarHtml, showPhase, syncPhaseTabs, rehImportAnyFile, + castAvatarHtml, REH_NARRATOR_KEY, _ensureNarrator, REH_CAST_LANGS, REH_CAST_GENDERS, + _castApplyToLines, _safeDomId, _rehLibCharsCache, _rehLibCharsCacheBook, + _rehEnsureLibCharsCache, _castDeleteCharacter, _rehAllVoiceIds, populateNarratorSelect, + _BUILD_INSTRUCT_TEMPLATES, _BUILD_INSTRUCT_LANG_NAMES, _buildAccentClause, _buildInstruct, + _rehBackendIsFish, _REH_EMOTION_DE_EN, _rehEmotionEnglishTag, _rehInlineTone, REH_LANG_CODE, + rehDefaultLlmUrl, rehCollectLlmEndpoints, rehInitLlmField, REH_AVATAR_ICONS, + _pickVoiceAvatar, rehDesignCancelled, rehWriteCharacterNote, rehResearchCast, REH_FISH_LANG, + rehMarkCastDesigning, buildScriptPage, _toggleBulkSel, _refreshBulkLine, _updateBulkCount, + setBulkMode, _bulkApply, _bulkDelete, _reindexLineState, PAGE_MODES, _pageMode, + applyPageMode, _syncPageModeBtn, cyclePageMode, paginateScript, isPracticeRange, + startInlineEdit, openScriptEditorModal, updatePracticeRange, clearPracticeRange, + setPracticeRangeFromSelection, rehEmoPicker, openEmoPicker, _closePickerOnOutside, + closeEmoPicker, _markSynthDot, _showReSynthBtn, _rehSyncCastVoiceFromLibrary, + synthOneLine, selectEmotion, _rehToneCmpRow, _checkToneStyleSupport, renderSummary, + _downloadText, exportAsTxt, exportAsMd, +}); +root.TTVC = root.TTVC || {}; +root.TTVC.rehearser = root.TTVC.rehearser || {}; +Object.assign(root.TTVC.rehearser, { + state: rehState, + core: { + showPhase, syncPhaseTabs, buildScriptPage, paginateScript, + renderLibraryList, renderSummary, synthOneLine, + }, +}); +})(window); diff --git a/tests/lazy-loading.spec.js b/tests/lazy-loading.spec.js index 5942f57..1a3f2b4 100644 --- a/tests/lazy-loading.spec.js +++ b/tests/lazy-loading.spec.js @@ -54,7 +54,9 @@ test('Rehearser playback module publishes transport APIs after loading', async ( exportSession: typeof window.TTVC?.rehearser?.io?.exportSession, recording: typeof window.TTVC?.rehearser?.recording?.start, training: typeof window.TTVC?.rehearser?.training?.enter, - }))).toEqual({ start: 'function', stop: 'function', synthAll: 'function', loadRecord: 'function', exportSession: 'function', recording: 'function', training: 'function' }); + core: typeof window.TTVC?.rehearser?.core?.buildScriptPage, + state: !!window.TTVC?.rehearser?.state, + }))).toEqual({ start: 'function', stop: 'function', synthAll: 'function', loadRecord: 'function', exportSession: 'function', recording: 'function', training: 'function', core: 'function', state: true }); }); test('pure leaf modules keep private declarations behind compatibility exports', async ({ page }) => {