From 4f0b10f3aaab52dc088d1d873de3d0ac532886fe Mon Sep 17 00:00:00 2001 From: umaranis Date: Thu, 9 Nov 2023 23:50:15 +1100 Subject: [PATCH] feat: added trash button to floatingLinkEditor plugin to remove the link --- demos/playground/src/index.css | 14 ++++++++++++++ .../core/plugins/link/FloatingLinkEditor.svelte | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/demos/playground/src/index.css b/demos/playground/src/index.css index 79cd813..7c2d5b6 100644 --- a/demos/playground/src/index.css +++ b/demos/playground/src/index.css @@ -600,6 +600,20 @@ i.prettier-error { width: 35px; vertical-align: -0.25em; position: absolute; + right: 30px; + top: 0; + bottom: 0; + cursor: pointer; +} + +.link-editor div.link-trash { + background-image: url(images/icons/trash.svg); + background-size: 16px; + background-position: center; + background-repeat: no-repeat; + width: 35px; + vertical-align: -0.25em; + position: absolute; right: 0; top: 0; bottom: 0; diff --git a/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte b/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte index 53afb14..f6e9d86 100644 --- a/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte +++ b/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte @@ -208,6 +208,14 @@ editedLinkUrl = linkUrl; isEditMode = true; }} /> + {/if} {/if}