refactor(attestation): remove footer from doc structure
This commit is contained in:
parent
45071b7bb6
commit
d01dc82e8c
2 changed files with 4 additions and 23 deletions
|
@ -25,13 +25,7 @@ import {
|
|||
type Extensions
|
||||
} from '@tiptap/core';
|
||||
|
||||
import {
|
||||
DocumentWithHeader,
|
||||
Title,
|
||||
Header,
|
||||
Footer,
|
||||
HeaderColumn
|
||||
} from './nodes';
|
||||
import { DocumentWithHeader, Title, Header, HeaderColumn } from './nodes';
|
||||
import { createSuggestionMenu, type TagSchema } from './tags';
|
||||
|
||||
export function createEditor({
|
||||
|
@ -90,13 +84,13 @@ function getEditorOptions(
|
|||
extensions.push(
|
||||
TextAlign.configure({
|
||||
types: actions.includes('title')
|
||||
? ['headerColumn', 'title', 'footer', 'heading', 'paragraph']
|
||||
? ['headerColumn', 'title', 'heading', 'paragraph']
|
||||
: ['heading', 'paragraph']
|
||||
})
|
||||
);
|
||||
break;
|
||||
case 'title':
|
||||
extensions.push(Header, HeaderColumn, Title, Footer);
|
||||
extensions.push(Header, HeaderColumn, Title);
|
||||
break;
|
||||
case 'heading2':
|
||||
case 'heading3':
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Node, mergeAttributes } from '@tiptap/core';
|
|||
export const DocumentWithHeader = Node.create({
|
||||
name: 'doc',
|
||||
topNode: true,
|
||||
content: 'header title block+ footer'
|
||||
content: 'header title block+'
|
||||
});
|
||||
|
||||
export const Title = Node.create({
|
||||
|
@ -37,19 +37,6 @@ export const Header = Node.create({
|
|||
}
|
||||
});
|
||||
|
||||
export const Footer = Node.create({
|
||||
name: 'footer',
|
||||
content: 'paragraph+',
|
||||
defining: true,
|
||||
|
||||
parseHTML() {
|
||||
return [{ tag: `footer` }];
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
return ['footer', mergeAttributes(HTMLAttributes, { class: 'footer' }), 0];
|
||||
}
|
||||
});
|
||||
|
||||
export const HeaderColumn = Node.create({
|
||||
name: 'headerColumn',
|
||||
content: 'paragraph',
|
||||
|
|
Loading…
Reference in a new issue