This commit is contained in:
Timothy Jaeryang Baek 2025-07-17 02:37:18 +04:00
parent 9634df4347
commit fce27202d9
4 changed files with 70 additions and 1 deletions

View file

@ -17,6 +17,8 @@
import Tooltip from '../Tooltip.svelte';
import CheckBox from '$lib/components/icons/CheckBox.svelte';
import ArrowLeftTag from '$lib/components/icons/ArrowLeftTag.svelte';
import ArrowRightTag from '$lib/components/icons/ArrowRightTag.svelte';
</script>
<div
@ -58,6 +60,31 @@
</button>
</Tooltip>
{#if editor?.isActive('bulletList') || editor?.isActive('orderedList') || editor?.isActive('taskList')}
<Tooltip placement="top" content={$i18n.t('Lift List')}>
<button
on:click={() => {
editor?.commands.liftListItem(editor?.isActive('taskList') ? 'taskItem' : 'listItem');
}}
class="hover:bg-gray-50 dark:hover:bg-gray-700 rounded-lg p-1.5 transition-all"
type="button"
>
<ArrowLeftTag />
</button>
</Tooltip>
<Tooltip placement="top" content={$i18n.t('Sink List')}>
<button
on:click={() =>
editor?.commands.sinkListItem(editor?.isActive('taskList') ? 'taskItem' : 'listItem')}
class="hover:bg-gray-50 dark:hover:bg-gray-700 rounded-lg p-1.5 transition-all"
type="button"
>
<ArrowRightTag />
</button>
</Tooltip>
{/if}
<Tooltip placement="top" content={$i18n.t('Bullet List')}>
<button
on:click={() => editor?.chain().focus().toggleBulletList().run()}

View file

@ -0,0 +1,20 @@
<script lang="ts">
export let className = 'size-4';
export let strokeWidth = '1.5';
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width={strokeWidth}
stroke="currentColor"
class={className}
><path
d="M16.75 12H6.75M6.75 12L9.5 14.75M6.75 12L9.5 9.25"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M2 15V9C2 6.79086 3.79086 5 6 5H18C20.2091 5 22 6.79086 22 9V15C22 17.2091 20.2091 19 18 19H6C3.79086 19 2 17.2091 2 15Z"
></path></svg
>

View file

@ -0,0 +1,20 @@
<script lang="ts">
export let className = 'size-4';
export let strokeWidth = '1.5';
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width={strokeWidth}
stroke="currentColor"
class={className}
><path
d="M6.75 12H16.75M16.75 12L14 14.75M16.75 12L14 9.25"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M2 15V9C2 6.79086 3.79086 5 6 5H18C20.2091 5 22 6.79086 22 9V15C22 17.2091 20.2091 19 18 19H6C3.79086 19 2 17.2091 2 15Z"
></path></svg
>

View file

@ -44,7 +44,7 @@
class="w-full {className} text-sm rounded-xl px-1 py-1.5 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg font-primary"
sideOffset={6}
side="bottom"
align="start"
align="end"
transition={(e) => fade(e, { duration: 100 })}
>
<DropdownMenu.Sub>
@ -59,6 +59,7 @@
class="w-full rounded-xl px-1 py-1.5 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg"
transition={flyAndScale}
sideOffset={8}
align="end"
>
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md"
@ -102,6 +103,7 @@
class="w-full rounded-xl px-1 py-1.5 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg"
transition={flyAndScale}
sideOffset={8}
align="end"
>
{#if onCopyLink}
<DropdownMenu.Item