From a4b5bcb8f7aecc972a5d8c97a788463827ccc5ba Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Tue, 20 Jun 2023 13:08:49 +0100 Subject: [PATCH] 3/2 Cursor chat (#1623) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR tweaks the cursor chat support. ### Change Type - [x] `patch` — Bug fix --- packages/editor/editor.css | 14 +++++++++----- .../src/lib/components/LiveCollaborators.tsx | 1 + packages/ui/src/lib/TldrawUi.tsx | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/editor/editor.css b/packages/editor/editor.css index edd6a20a6..304109b93 100644 --- a/packages/editor/editor.css +++ b/packages/editor/editor.css @@ -97,7 +97,7 @@ left: 0px; width: 100%; height: 100%; - overflow: hidden; + overflow: clip; } .tl-theme__light { @@ -778,7 +778,7 @@ input, overflow: hidden; text-overflow: ellipsis; font-size: 12px; - font-family: var(--font-family); + font-family: var(--font-body); border-radius: var(--radius-2); color: var(--color-selected-contrast); } @@ -796,7 +796,7 @@ input, overflow: hidden; text-overflow: ellipsis; font-size: 12px; - font-family: var(--font-family); + font-family: var(--font-body); text-shadow: var(--tl-text-outline); color: var(--color-selected-contrast); } @@ -812,7 +812,7 @@ input, position: absolute; padding: 3px 6px; font-size: 12px; - font-family: var(--font-family); + font-family: var(--font-body); opacity: 1; border-radius: var(--radius-2); } @@ -823,7 +823,7 @@ input, white-space: nowrap; padding: 3px 6px; font-size: 12px; - font-family: var(--font-family); + font-family: var(--font-body); pointer-events: none; z-index: var(--layer-cursor); margin-top: 16px; @@ -834,6 +834,10 @@ input, border-radius: var(--radius-2); } +.tl-cursor-chat .tl-cursor-chat__bubble { + padding-right: 12px; +} + .tl-cursor-chat::selection { background: var(--color-selected); color: var(--color-selected-contrast); diff --git a/packages/editor/src/lib/components/LiveCollaborators.tsx b/packages/editor/src/lib/components/LiveCollaborators.tsx index 62d44d36d..9ef15a352 100644 --- a/packages/editor/src/lib/components/LiveCollaborators.tsx +++ b/packages/editor/src/lib/components/LiveCollaborators.tsx @@ -54,6 +54,7 @@ const Collaborator = track(function Collaborator({ userId }: { userId: string }) if ( isTimedOut && editor.instanceState.followingUserId !== userId && + !latestPresence.chatMessage && !editor.instanceState.highlightedUserIds.includes(userId) ) return null diff --git a/packages/ui/src/lib/TldrawUi.tsx b/packages/ui/src/lib/TldrawUi.tsx index c0ded4c87..2e5f5fa7d 100644 --- a/packages/ui/src/lib/TldrawUi.tsx +++ b/packages/ui/src/lib/TldrawUi.tsx @@ -106,7 +106,6 @@ const TldrawUiContent = React.memo(function TldrawUI({ return (