From 6f523216324d8fd67a58344a345f8ebd8712c270 Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 31 Aug 2023 13:30:15 -0300 Subject: [PATCH] theme linktooltip y editlinkmenu --- src/app.css | 10 +++++ src/editor/bubblemenu/EditLinkMenu.svelte | 46 ++++++----------------- src/editor/bubblemenu/LinkTooltip.svelte | 10 +++-- 3 files changed, 27 insertions(+), 39 deletions(-) diff --git a/src/app.css b/src/app.css index fdf8bdc..4297daf 100644 --- a/src/app.css +++ b/src/app.css @@ -48,3 +48,13 @@ a { --accent-fg: #94a3b8; } } +/* https://devdojo.com/pines/docs/button */ +.btn { + @apply rounded-md bg-neutral-950 px-4 py-2 text-sm font-medium tracking-wide text-white dark:bg-neutral-200 dark:text-neutral-800; +} +.btn-outline { + @apply rounded-md border border-neutral-200/70 bg-white px-4 py-2 text-sm font-medium tracking-wide text-neutral-500 dark:bg-neutral-950 dark:text-neutral-200; +} +.input { + @apply flex h-10 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm placeholder:text-neutral-500 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-neutral-900; +} diff --git a/src/editor/bubblemenu/EditLinkMenu.svelte b/src/editor/bubblemenu/EditLinkMenu.svelte index 06a125c..966fcdb 100644 --- a/src/editor/bubblemenu/EditLinkMenu.svelte +++ b/src/editor/bubblemenu/EditLinkMenu.svelte @@ -11,7 +11,6 @@ export let view: EditorView; export let editingLink: Writable; - let hrefInputEl: HTMLInputElement; let formEl: HTMLFormElement; // ref: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/13d851c795a48b670b859a7ec5bd6e2886d2789e/app/assets/javascripts/content_editor/components/bubble_menus/link_bubble_menu.vue#L69 @@ -24,11 +23,6 @@ text = ""; href = ""; - // el timeout... ugh - hrefInputEl?.focus(); - setTimeout(() => hrefInputEl?.focus(), 50); - setTimeout(() => hrefInputEl?.focus(), 100); - if (editingLink === "selection") { // https://gitlab.com/gitlab-org/gitlab-foss/-/blob/13d851c795a48b670b859a7ec5bd6e2886d2789e/app/assets/javascripts/content_editor/components/bubble_menus/link_bubble_menu.vue#L69 text = getSelectionText(view.state); @@ -96,47 +90,29 @@