mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-03-24 16:18:39 +08:00
refactor(editor): support dynamic text attribute key (#12947)
#### PR Dependency Tree * **PR #12946** * **PR #12947** 👈 * **PR #12948** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -3,6 +3,7 @@ import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
|
||||
import { StdIdentifier } from '@blocksuite/std';
|
||||
import { InlineSpecExtension } from '@blocksuite/std/inline';
|
||||
import { html } from 'lit';
|
||||
import z from 'zod';
|
||||
|
||||
import { FootNoteNodeConfigIdentifier } from './footnote-node/footnote-config';
|
||||
|
||||
@@ -13,7 +14,9 @@ export const FootNoteInlineSpecExtension =
|
||||
provider.getOptional(FootNoteNodeConfigIdentifier) ?? undefined;
|
||||
return {
|
||||
name: 'footnote',
|
||||
schema: FootNoteSchema.optional().nullable().catch(undefined),
|
||||
schema: z.object({
|
||||
footnote: FootNoteSchema.optional().nullable().catch(undefined),
|
||||
}),
|
||||
match: delta => {
|
||||
return !!delta.attributes?.footnote;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user