mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 03:49:56 +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`
22 lines
692 B
TypeScript
22 lines
692 B
TypeScript
import { TableBlockSchema } from '@blocksuite/affine-model';
|
|
import {
|
|
BlockNotionHtmlAdapterExtension,
|
|
type BlockNotionHtmlAdapterMatcher,
|
|
HastUtils,
|
|
} from '@blocksuite/affine-shared/adapters';
|
|
|
|
const TABLE_NODE_TYPES = new Set(['table', 'th', 'tr']);
|
|
|
|
export const tableBlockNotionHtmlAdapterMatcher: BlockNotionHtmlAdapterMatcher =
|
|
{
|
|
flavour: TableBlockSchema.model.flavour,
|
|
toMatch: o =>
|
|
HastUtils.isElement(o.node) && TABLE_NODE_TYPES.has(o.node.tagName),
|
|
fromMatch: () => false,
|
|
toBlockSnapshot: {},
|
|
fromBlockSnapshot: {},
|
|
};
|
|
|
|
export const TableBlockNotionHtmlAdapterExtension =
|
|
BlockNotionHtmlAdapterExtension(tableBlockNotionHtmlAdapterMatcher);
|