import type { AffineTextAttributes } from '@blocksuite/affine-shared/types'; import { type InlineRootElement, InlineSpecExtension, } from '@blocksuite/std/inline'; import type { ExtensionType } from '@blocksuite/store'; import { html } from 'lit'; import { z } from 'zod'; export type AffineInlineRootElement = InlineRootElement; export const BoldInlineSpecExtension = InlineSpecExtension({ name: 'bold', schema: z.literal(true).optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.bold; }, renderer: ({ delta }) => { return html``; }, }); export const ItalicInlineSpecExtension = InlineSpecExtension({ name: 'italic', schema: z.literal(true).optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.italic; }, renderer: ({ delta }) => { return html``; }, }); export const UnderlineInlineSpecExtension = InlineSpecExtension({ name: 'underline', schema: z.literal(true).optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.underline; }, renderer: ({ delta }) => { return html``; }, }); export const StrikeInlineSpecExtension = InlineSpecExtension({ name: 'strike', schema: z.literal(true).optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.strike; }, renderer: ({ delta }) => { return html``; }, }); export const CodeInlineSpecExtension = InlineSpecExtension({ name: 'code', schema: z.literal(true).optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.code; }, renderer: ({ delta }) => { return html``; }, }); export const BackgroundInlineSpecExtension = InlineSpecExtension({ name: 'background', schema: z.string().optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.background; }, renderer: ({ delta }) => { return html``; }, }); export const ColorInlineSpecExtension = InlineSpecExtension({ name: 'color', schema: z.string().optional().nullable().catch(undefined), match: delta => { return !!delta.attributes?.color; }, renderer: ({ delta }) => { return html``; }, }); export const InlineSpecExtensions: ExtensionType[] = [ BoldInlineSpecExtension, ItalicInlineSpecExtension, UnderlineInlineSpecExtension, StrikeInlineSpecExtension, CodeInlineSpecExtension, BackgroundInlineSpecExtension, ColorInlineSpecExtension, ];