Skip to content

Commit 6b302d4

Browse files
authored
fix: 🧩 删除 workspace 文件并解决服务端渲染的问题 (#23)
* fix: 🧩 删除 workspace 文件并解决服务端渲染的问题 * fix: 🧩 删除 workspace 文件并解决服务端渲染的问题
1 parent 227ca77 commit 6b302d4

9 files changed

Lines changed: 22 additions & 16 deletions

File tree

pnpm-workspace.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/app/docs/_components/DocumentSidebar/BlocksTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import React, { useState } from 'react';
24
import { icons } from 'lucide-react';
35

src/app/docs/_components/DocumentSidebar/SearchTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { useState, useCallback, useEffect, useMemo } from 'react';
24
import { useRouter } from 'next/navigation';
35

src/app/docs/_components/DocumentSidebar/SettingsTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { useState } from 'react';
24

35
import { Icon } from '@/components/ui/Icon';

src/app/docs/_components/DocumentSidebar/TemplatesTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { useState } from 'react';
24

35
import { Icon } from '@/components/ui/Icon';

src/app/docs/_components/TableOfContents/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { memo, useEffect, useState } from 'react';
24
import { Editor } from '@tiptap/react';
35

src/extensions/extension-kit-server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// 简化的服务端扩展配置 - 只保留渲染必需的核心扩展
21
import StarterKit from '@tiptap/starter-kit';
32
import { Heading } from '@tiptap/extension-heading';
43
import { Typography } from '@tiptap/extension-typography';

src/extensions/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export { Details } from '@tiptap-pro/extension-details';
2929
export { DetailsContent } from '@tiptap-pro/extension-details-content';
3030
export { DetailsSummary } from '@tiptap-pro/extension-details-summary';
3131
export { UniqueID } from '@tiptap-pro/extension-unique-id';
32+
export { Text } from '@tiptap/extension-text';
3233

3334
export { Selection } from './Selection';
3435
export { Table, TableCell, TableHeader, TableRow } from './Table';
@@ -45,6 +46,7 @@ export { BlockquoteFigure } from './BlockquoteFigure';
4546
export { Quote } from './BlockquoteFigure/Quote';
4647
export { QuoteCaption } from './BlockquoteFigure/QuoteCaption';
4748
export { Link } from './Link';
49+
export { Image } from './Image';
4850
export { ImageUpload } from './ImageUpload';
4951
export { ImageBlock } from './ImageBlock';
5052
export { Columns, Column } from './MultiColumn';

src/hooks/useCollaborativeEditor.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -486,20 +486,20 @@ export function useCollaborativeEditor(
486486
// Y.js协作扩展
487487
...(doc
488488
? [
489-
Collaboration.configure({
490-
document: doc,
491-
field: 'content',
492-
}),
493-
]
489+
Collaboration.configure({
490+
document: doc,
491+
field: 'content',
492+
}),
493+
]
494494
: []),
495495
// 协作光标扩展
496496
...(provider && !isOffline && currentUser && doc
497497
? [
498-
CollaborationCursor.configure({
499-
provider,
500-
user: currentUser,
501-
}),
502-
]
498+
CollaborationCursor.configure({
499+
provider,
500+
user: currentUser,
501+
}),
502+
]
503503
: []),
504504
],
505505
// 编辑器初始为空,让Y.js处理内容同步

0 commit comments

Comments
 (0)