mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 17:39:55 +08:00
1f45cc5dec
**Directory Structure Changes** - Renamed multiple block-related directories by removing the "block-" prefix: - `block-attachment` → `attachment` - `block-bookmark` → `bookmark` - `block-callout` → `callout` - `block-code` → `code` - `block-data-view` → `data-view` - `block-database` → `database` - `block-divider` → `divider` - `block-edgeless-text` → `edgeless-text` - `block-embed` → `embed`
26 lines
794 B
TypeScript
26 lines
794 B
TypeScript
import {
|
|
EmbedLoomBlockSchema,
|
|
type EmbedLoomModel,
|
|
EmbedLoomStyles,
|
|
} from '@blocksuite/affine-model';
|
|
import { EmbedOptionConfig } from '@blocksuite/affine-shared/services';
|
|
import { BlockService } from '@blocksuite/std';
|
|
|
|
import { loomUrlRegex } from './embed-loom-model.js';
|
|
import { queryEmbedLoomData } from './utils.js';
|
|
|
|
export class EmbedLoomBlockService extends BlockService {
|
|
static override readonly flavour = EmbedLoomBlockSchema.model.flavour;
|
|
|
|
queryUrlData = (embedLoomModel: EmbedLoomModel, signal?: AbortSignal) => {
|
|
return queryEmbedLoomData(embedLoomModel, signal);
|
|
};
|
|
}
|
|
|
|
export const EmbedLoomBlockOptionConfig = EmbedOptionConfig({
|
|
flavour: EmbedLoomBlockSchema.model.flavour,
|
|
urlRegex: loomUrlRegex,
|
|
styles: EmbedLoomStyles,
|
|
viewType: 'embed',
|
|
});
|