mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
7ac8b14b65
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Native/WASM Mermaid and Typst SVG preview rendering on desktop and mobile, plus cross-platform Preview plugin integrations. * **Improvements** * Centralized, sanitized rendering bridge with automatic Typst font-directory handling and configurable native renderer selection. * More consistent and robust error serialization and worker-backed preview flows for improved stability and performance. * **Tests** * Extensive unit and integration tests for preview rendering, font discovery, sanitization, and error serialization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
40 lines
1017 B
TypeScript
40 lines
1017 B
TypeScript
import { dialogHandlers } from './dialog';
|
|
import { dbEventsV1, dbHandlersV1, nbstoreHandlers } from './nbstore';
|
|
import { previewHandlers } from './preview';
|
|
import { provideExposed } from './provide';
|
|
import { workspaceEvents, workspaceHandlers } from './workspace';
|
|
|
|
export const handlers = {
|
|
db: dbHandlersV1,
|
|
nbstore: nbstoreHandlers,
|
|
workspace: workspaceHandlers,
|
|
dialog: dialogHandlers,
|
|
preview: previewHandlers,
|
|
};
|
|
|
|
export const events = {
|
|
db: dbEventsV1,
|
|
workspace: workspaceEvents,
|
|
};
|
|
|
|
const getExposedMeta = () => {
|
|
const handlersMeta = Object.entries(handlers).map(
|
|
([namespace, namespaceHandlers]) => {
|
|
return [namespace, Object.keys(namespaceHandlers)] as [string, string[]];
|
|
}
|
|
);
|
|
|
|
const eventsMeta = Object.entries(events).map(
|
|
([namespace, namespaceHandlers]) => {
|
|
return [namespace, Object.keys(namespaceHandlers)] as [string, string[]];
|
|
}
|
|
);
|
|
|
|
return {
|
|
handlers: handlersMeta,
|
|
events: eventsMeta,
|
|
};
|
|
};
|
|
|
|
provideExposed(getExposedMeta());
|