From ddc73d77bd8c384f9010f391f641e63519376243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E4=BA=AE?= <787615673@qq.com> Date: Thu, 26 Feb 2026 17:38:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(editor):=20=E4=BF=AE=E5=A4=8D=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=A0=B7=E5=BC=8F=E5=92=8C=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=A4=A7=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为链接添加下划线样式以提升可识别性 将编辑器面板的默认大小从字符串改为数字类型 优化链接扩展的点击处理逻辑,支持alt/meta键点击在新窗口打开 修复联系组件描述文本高度问题 --- .../src/app/_components/homepage/contact.tsx | 4 +++- apps/DocFlow/src/app/docs/[room]/page.tsx | 2 +- apps/DocFlow/src/extensions/Link/Link.ts | 17 ++++++++++++++--- apps/DocFlow/src/styles/partials/typography.css | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/apps/DocFlow/src/app/_components/homepage/contact.tsx b/apps/DocFlow/src/app/_components/homepage/contact.tsx index c84dd76..e94d5df 100644 --- a/apps/DocFlow/src/app/_components/homepage/contact.tsx +++ b/apps/DocFlow/src/app/_components/homepage/contact.tsx @@ -51,7 +51,9 @@ export function Contact() {

{contact.title}

-

{contact.description}

+

+ {contact.description} +

diff --git a/apps/DocFlow/src/app/docs/[room]/page.tsx b/apps/DocFlow/src/app/docs/[room]/page.tsx index 0d1f436..e80d7ea 100644 --- a/apps/DocFlow/src/app/docs/[room]/page.tsx +++ b/apps/DocFlow/src/app/docs/[room]/page.tsx @@ -596,7 +596,7 @@ export default function DocumentPage() {
{/* 编辑器面板 */} - +
{ - // check if link starts with javascript: if (element.getAttribute('href')?.toLowerCase().startsWith('javascript:')) { return false; } @@ -60,8 +59,7 @@ export const Link = TiptapLink.extend({ // 获取当前段落中光标之前的文本内容 const textBefore = $from.parent.textBetween(0, $from.parentOffset, undefined, '\ufffc'); - // 匹配 [text](url 模式(不含结尾 ),因为用户正在输入它) - const match = textBefore.match(/\[([^\]]+)\]\((\S+)$/); + const match = textBefore.match(/\[([^\]]+)\]\(([^)]+)$/); if (!match) return false; @@ -103,6 +101,19 @@ export const Link = TiptapLink.extend({ return false; }, + + handleClickOn: (_view, _pos, _node, _nodePos, event) => { + const target = event.target as HTMLElement; + const anchor = target.closest('a'); + + if (anchor && anchor.href && (event.altKey || event.metaKey)) { + window.open(anchor.href, '_blank'); + + return false; + } + + return false; + }, }, }), // 保留父级 Link 扩展的所有插件(autolink、点击处理等) diff --git a/apps/DocFlow/src/styles/partials/typography.css b/apps/DocFlow/src/styles/partials/typography.css index 5f368b8..924458b 100644 --- a/apps/DocFlow/src/styles/partials/typography.css +++ b/apps/DocFlow/src/styles/partials/typography.css @@ -77,7 +77,7 @@ } .ProseMirror a.link { - @apply text-blue-500 font-extrabold; + @apply text-blue-500 font-extrabold underline; } .dark .ProseMirror a.link { From 3870170349643a2e16a1c4be7a8b7aa839764911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E4=BA=AE?= <787615673@qq.com> Date: Thu, 26 Feb 2026 17:48:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E7=9B=98):=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=AA=E5=AE=9A=E4=B9=89=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E5=80=BC=E6=97=B6=E7=9A=84=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/DocFlow/src/app/dashboard/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/DocFlow/src/app/dashboard/page.tsx b/apps/DocFlow/src/app/dashboard/page.tsx index 3c5dd54..c01d8e3 100644 --- a/apps/DocFlow/src/app/dashboard/page.tsx +++ b/apps/DocFlow/src/app/dashboard/page.tsx @@ -212,7 +212,7 @@ export default function DashboardPage() { icon: , color: 'bg-red-500', formatter: (value: number) => { - return `${value}%`; + return `${value ?? 0}%`; }, }, ];