wip: move paste as link to context menu

feat/wb-linkings
Konstantinos Kaloutas 2022-11-22 18:28:38 +02:00
parent 08affcb19d
commit da4e945529
2 changed files with 21 additions and 17 deletions

View File

@ -164,6 +164,19 @@ export const ContextMenu = observer(function ContextMenu({
</span>
</div>
</ReactContextMenu.Item>
{app.selectedShapes?.size === 1 && (
<ReactContextMenu.Item
className="tl-menu-item"
onClick={() => runAndTransition(() => app.paste(undefined, true))}
>
Paste as link
<div className="tl-menu-right-slot">
<span className="keyboard-shortcut">
<code>{MOD_KEY}</code> <code></code> <code>V</code>
</span>
</div>
</ReactContextMenu.Item>
)}
<ReactContextMenu.Separator className="menu-separator" />
<ReactContextMenu.Item
className="tl-menu-item"

View File

@ -144,23 +144,14 @@ export const ShapeLinksInput = observer(function ShapeLinksInput({
<div className="h-2" />
{canAddLink && (
<>
<LogseqQuickSearch
style={{
width: 'calc(100% - 46px)',
marginLeft: '46px',
}}
placeholder="Start typing to search..."
onChange={addNewRef}
/>
<div className="h-2" />
<div className="text-center">
<span className="opacity-50 mr-1">Paste from clipboard with</span>
<span className="keyboard-shortcut">
<code>{MOD_KEY}</code> <code></code> <code>V</code>
</span>
</div>
</>
<LogseqQuickSearch
style={{
width: 'calc(100% - 46px)',
marginLeft: '46px',
}}
placeholder="Start typing to search..."
onChange={addNewRef}
/>
)}
{refs.length > 0 && (