mirror of https://github.com/fantasticit/think.git
client: fix title style, fix doc extension
parent
dbf87fec68
commit
59e0c15c5f
|
@ -58,7 +58,7 @@ export const DocumentFullscreen: React.FC<IProps> = ({ data }) => {
|
|||
|
||||
const editor = useEditor({
|
||||
editable: false,
|
||||
extensions: CollaborationKit.filter((ext) => ['title', 'documentWithTitle'].indexOf(ext.name) < 0).concat(Document),
|
||||
extensions: CollaborationKit.filter((ext) => ['title', 'doc'].indexOf(ext.name) < 0).concat(Document),
|
||||
content: { type: 'doc', content: [] },
|
||||
});
|
||||
|
||||
|
|
|
@ -33,6 +33,11 @@ export const DocumentVersion: React.FC<Partial<IProps>> = ({ documentId, onSelec
|
|||
|
||||
const editor = useEditor({
|
||||
editable: false,
|
||||
editorProps: {
|
||||
attributes: {
|
||||
class: 'is-editable',
|
||||
},
|
||||
},
|
||||
extensions: CollaborationKit,
|
||||
content: { type: 'doc', content: [] },
|
||||
});
|
||||
|
|
|
@ -149,7 +149,6 @@ export const Dragable = Extension.create({
|
|||
if (
|
||||
!result ||
|
||||
result.node.type.name === 'doc' ||
|
||||
result.node.type.name === 'documentWithTitle' ||
|
||||
result.node.type.name === 'title' ||
|
||||
result.node.type.name === 'tableOfContents' ||
|
||||
// empty paragraph
|
||||
|
|
|
@ -9,19 +9,25 @@
|
|||
|
||||
&::before {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
height: 0;
|
||||
color: var(--semi-color-text-0);
|
||||
pointer-events: none;
|
||||
content: attr(data-placeholder);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-withauthor {
|
||||
.node-title::before {
|
||||
bottom: 0;
|
||||
transform: translateY(-4.2em);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-editable {
|
||||
&::before {
|
||||
color: #aaa;
|
||||
transform: translateY(-1.7em);
|
||||
}
|
||||
&.is-editable {
|
||||
.node-title::before {
|
||||
bottom: 0;
|
||||
color: #aaa;
|
||||
transform: translateY(-1.7em);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,9 @@ export const EditorInstance = forwardRef((props: IProps, ref) => {
|
|||
editorProps: {
|
||||
// @ts-ignore
|
||||
taskItemClickable: true,
|
||||
attributes: {
|
||||
class: 'is-withauthor',
|
||||
},
|
||||
},
|
||||
extensions: [
|
||||
...CollaborationKit,
|
||||
|
|
|
@ -69,7 +69,6 @@ import { markdownToProsemirror } from 'tiptap/markdown/markdown-to-prosemirror';
|
|||
import { prosemirrorToMarkdown } from 'tiptap/markdown/prosemirror-to-markdown';
|
||||
|
||||
const DocumentWithTitle = Document.extend({
|
||||
name: 'documentWithTitle',
|
||||
content: 'title block+',
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue