feat(editor): audio block (#10947)

AudioMedia entity for loading & controlling a single audio media
AudioMediaManagerService: Global audio state synchronization across tabs
AudioAttachmentService + AudioAttachmentBlock for manipulating AttachmentBlock in affine - e.g., filling transcription (using mock endpoint for now)
Added AudioBlock + AudioPlayer for rendering audio block in affine (new transcription block whose renderer is provided in affine)

fix AF-2292
fix AF-2337
This commit is contained in:
pengx17
2025-03-20 12:46:14 +00:00
parent 8a5393ea50
commit fad49bb070
120 changed files with 5407 additions and 950 deletions
@@ -35,6 +35,12 @@ export const uiEvents = {
},
onTabsStatusChange,
onActiveTabChanged,
onTabGoToRequest: (fn: (opts: { tabId: string; to: string }) => void) => {
const sub = uiSubjects.tabGoToRequest$.subscribe(fn);
return () => {
sub.unsubscribe();
};
},
onTabShellViewActiveChange,
onAuthenticationRequest: (fn: (state: AuthenticationRequest) => void) => {
const sub = uiSubjects.authenticationRequest$.subscribe(fn);
@@ -10,6 +10,7 @@ import {
activateView,
addTab,
closeTab,
ensureTabLoaded,
getMainWindow,
getOnboardingWindow,
getTabsStatus,
@@ -187,6 +188,12 @@ export const uiHandlers = {
showTab: async (_, ...args: Parameters<typeof showTab>) => {
await showTab(...args);
},
tabGoTo: async (_, tabId: string, to: string) => {
uiSubjects.tabGoToRequest$.next({ tabId, to });
},
ensureTabLoaded: async (_, ...args: Parameters<typeof ensureTabLoaded>) => {
await ensureTabLoaded(...args);
},
closeTab: async (_, ...args: Parameters<typeof closeTab>) => {
await closeTab(...args);
},
@@ -6,6 +6,7 @@ export const uiSubjects = {
onMaximized$: new Subject<boolean>(),
onFullScreen$: new Subject<boolean>(),
onToggleRightSidebar$: new Subject<string>(),
tabGoToRequest$: new Subject<{ tabId: string; to: string }>(),
authenticationRequest$: new Subject<AuthenticationRequest>(),
// via menu -> close view (CMD+W)
onCloseView$: new Subject<void>(),