refactor(editor): move transcription block model to ai (#12010)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Refactor**
	- Updated and reorganized import paths for transcription block models and types to improve module structure and maintainability.
- **Chores**
	- Removed deprecated transcription block schema and related exports from core libraries.
	- Registered transcription block schema directly within the workspace schema for improved schema management.
- **Bug Fixes**
	- Ensured consistent registration and availability of transcription block features across relevant modules.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Saul-Mirone
2025-04-27 13:13:07 +00:00
parent 81b439c4e1
commit d7b1819149
11 changed files with 18 additions and 19 deletions

View File

@@ -1,13 +1,13 @@
import {
TranscriptionBlockFlavour,
type TranscriptionBlockModel,
} from '@affine/core/blocksuite/ai/blocks/transcription-block/model';
import { insertFromMarkdown } from '@affine/core/blocksuite/utils';
import { encodeAudioBlobToOpusSlices } from '@affine/core/utils/webm-encoding';
import { DebugLogger } from '@affine/debug';
import { AiJobStatus } from '@affine/graphql';
import track from '@affine/track';
import {
type AttachmentBlockModel,
TranscriptionBlockFlavour,
type TranscriptionBlockModel,
} from '@blocksuite/affine/model';
import type { AttachmentBlockModel } from '@blocksuite/affine/model';
import type { AffineTextAttributes } from '@blocksuite/affine/shared/types';
import { type DeltaInsert, Text } from '@blocksuite/affine/store';
import { computed } from '@preact/signals-core';

View File

@@ -1,8 +1,8 @@
import { shallowEqual } from '@affine/component';
import type { TranscriptionBlockProps } from '@affine/core/blocksuite/ai/blocks/transcription-block/model';
import { DebugLogger } from '@affine/debug';
import { UserFriendlyError } from '@affine/error';
import { AiJobStatus } from '@affine/graphql';
import type { TranscriptionBlockProps } from '@blocksuite/affine/model';
import { Entity, LiveData } from '@toeverything/infra';
import type { DefaultServerService, WorkspaceServerService } from '../../cloud';

View File

@@ -1,4 +1,5 @@
import { AIChatBlockSchema } from '@affine/core/blocksuite/ai/blocks/ai-chat-block/model';
import { TranscriptionBlockSchema } from '@affine/core/blocksuite/ai/blocks/transcription-block/model';
import { AffineSchemas } from '@blocksuite/affine/schemas';
import { Schema } from '@blocksuite/affine/store';
@@ -7,7 +8,11 @@ export function getAFFiNEWorkspaceSchema() {
if (!_schema) {
_schema = new Schema();
_schema.register([...AffineSchemas, AIChatBlockSchema]);
_schema.register([
...AffineSchemas,
AIChatBlockSchema,
TranscriptionBlockSchema,
]);
}
return _schema;