Files
AFFiNE-Mirror/blocksuite/affine/blocks/table/src/adapters/notion-html.ts
T
Saul-Mirone 1f45cc5dec refactor(editor): unify directories naming (#11516)
**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`
2025-04-07 12:34:40 +00:00

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);