Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/DocFlow/src/app/_components/homepage/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function Contact() {
<Icon className="w-6 h-6 text-white" />
</div>
<h3 className="text-lg font-semibold text-gray-900 mb-2">{contact.title}</h3>
<p className="text-sm text-gray-600 mb-4 leading-relaxed">{contact.description}</p>
<p className="text-sm text-gray-600 mb-4 leading-relaxed h-10">
{contact.description}
</p>
Comment on lines +54 to +56
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为描述文本设置固定的 h-10 高度可能会导致文本溢出或截断,如果描述内容超过两行(在 text-smleading-relaxed 的情况下)。这可能会影响用户体验,导致信息显示不完整。建议考虑使用 min-h-10 并在需要时允许文本自然扩展,或者通过其他方式确保所有描述都能完整显示。

Suggested change
<p className="text-sm text-gray-600 mb-4 leading-relaxed h-10">
{contact.description}
</p>
<p className="text-sm text-gray-600 mb-4 leading-relaxed min-h-10">
{contact.description}
</p>

<span
className={`block w-full px-4 py-2.5 text-center bg-gradient-to-r ${contact.gradient} text-white text-sm font-medium rounded-xl shadow-lg transition-all group-hover:opacity-90 group-hover:-translate-y-0.5 group-hover:scale-105`}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/DocFlow/src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default function DashboardPage() {
icon: <Target className="w-6 h-6" />,
color: 'bg-red-500',
formatter: (value: number) => {
return `${value}%`;
return `${value ?? 0}%`;
},
},
];
Expand Down
2 changes: 1 addition & 1 deletion apps/DocFlow/src/app/docs/[room]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export default function DocumentPage() {
<div className="flex flex-1 overflow-hidden">
<Group orientation="horizontal" className="flex-1" groupRef={groupRef}>
{/* 编辑器面板 */}
<Panel id="editor" defaultSize="65" minSize="30">
<Panel id="editor" defaultSize={65} minSize={30}>
<div className="h-full relative overflow-hidden">
<div
ref={editorContainRef}
Expand Down
17 changes: 14 additions & 3 deletions apps/DocFlow/src/extensions/Link/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const Link = TiptapLink.extend({
{
tag: 'a[href]:not([data-type="button"]):not([href *= "javascript:" i])',
getAttrs: (element: any) => {
// check if link starts with javascript:
if (element.getAttribute('href')?.toLowerCase().startsWith('javascript:')) {
return false;
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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、点击处理等)
Expand Down
2 changes: 1 addition & 1 deletion apps/DocFlow/src/styles/partials/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}

.ProseMirror a.link {
@apply text-blue-500 font-extrabold;
@apply text-blue-500 font-extrabold underline;
}

.dark .ProseMirror a.link {
Expand Down
Loading