mirror of https://github.com/fantasticit/think.git
Merge pull request #195 from fantasticit/fix/0915
commit
d967fc72f7
|
@ -62,7 +62,7 @@ export const DocumentEditor: React.FC<IProps> = ({ documentId }) => {
|
||||||
{document && (
|
{document && (
|
||||||
<DocumentActions organizationId={document.organizationId} wikiId={document.wikiId} documentId={documentId} />
|
<DocumentActions organizationId={document.organizationId} wikiId={document.wikiId} documentId={documentId} />
|
||||||
)}
|
)}
|
||||||
<DocumentVersion documentId={documentId} onSelect={triggerUseDocumentVersion} />
|
<DocumentVersion key={'edit'} documentId={documentId} onSelect={triggerUseDocumentVersion} />
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
[documentId, document, authority]
|
[documentId, document, authority]
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
main {
|
main {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background-color: var(--semi-color-bg-0);
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
&.isMobile {
|
&.isMobile {
|
||||||
|
|
|
@ -126,8 +126,8 @@ export const DocumentVersion: React.FC<Partial<IProps>> = ({ documentId, onSelec
|
||||||
</Select>
|
</Select>
|
||||||
<div style={{ paddingLeft: '8px' }}>对比</div>
|
<div style={{ paddingLeft: '8px' }}>对比</div>
|
||||||
<Space style={{ marginLeft: 12 }}>
|
<Space style={{ marginLeft: 12 }}>
|
||||||
<Tag style={{ backgroundColor: '#e9ffe9' }}>增加的内容</Tag>
|
<Tag style={{ backgroundColor: '#e9ffe9', color: '#333' }}>增加的内容</Tag>
|
||||||
<Tag style={{ backgroundColor: '#ffeaea' }}>删除的内容</Tag>
|
<Tag style={{ backgroundColor: '#ffeaea', color: '#333' }}>删除的内容</Tag>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -156,8 +156,8 @@ export const DocumentVersion: React.FC<Partial<IProps>> = ({ documentId, onSelec
|
||||||
empty={!loading && !data.length}
|
empty={!loading && !data.length}
|
||||||
normalContent={() => (
|
normalContent={() => (
|
||||||
<div className={styles.contentWrap}>
|
<div className={styles.contentWrap}>
|
||||||
<main className={cls('container', isMobile && styles.isMobile)}>
|
<main className={cls(isMobile && styles.isMobile)}>
|
||||||
<div>
|
<div className="container">
|
||||||
{diffVersion ? (
|
{diffVersion ? (
|
||||||
<div id="diff-visual" className="ProseMirror"></div>
|
<div id="diff-visual" className="ProseMirror"></div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -26,7 +26,9 @@ export const useEditor = (options: Partial<EditorOptions> = {}, deps: Dependency
|
||||||
options.editorProps = options.editorProps || {};
|
options.editorProps = options.editorProps || {};
|
||||||
|
|
||||||
if (options.editable) {
|
if (options.editable) {
|
||||||
options.editorProps.attributes = options.editorProps.attributes || {};
|
options.editorProps.attributes = options.editorProps.attributes || {
|
||||||
|
spellcheck: 'false',
|
||||||
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
options.editorProps.attributes.class = options.editorProps.attributes.class || '';
|
options.editorProps.attributes.class = options.editorProps.attributes.class || '';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -41,7 +43,7 @@ export const useEditor = (options: Partial<EditorOptions> = {}, deps: Dependency
|
||||||
instance.on(
|
instance.on(
|
||||||
'update',
|
'update',
|
||||||
throttle(() => {
|
throttle(() => {
|
||||||
instance.chain().focus().scrollIntoView().run();
|
// instance.chain().focus().scrollIntoView().run();
|
||||||
}, 200)
|
}, 200)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue