mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
refac
This commit is contained in:
parent
9634df4347
commit
fce27202d9
4 changed files with 70 additions and 1 deletions
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
import Tooltip from '../Tooltip.svelte';
|
import Tooltip from '../Tooltip.svelte';
|
||||||
import CheckBox from '$lib/components/icons/CheckBox.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>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
@ -58,6 +60,31 @@
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</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')}>
|
<Tooltip placement="top" content={$i18n.t('Bullet List')}>
|
||||||
<button
|
<button
|
||||||
on:click={() => editor?.chain().focus().toggleBulletList().run()}
|
on:click={() => editor?.chain().focus().toggleBulletList().run()}
|
||||||
|
|
|
||||||
20
src/lib/components/icons/ArrowLeftTag.svelte
Normal file
20
src/lib/components/icons/ArrowLeftTag.svelte
Normal 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
|
||||||
|
>
|
||||||
20
src/lib/components/icons/ArrowRightTag.svelte
Normal file
20
src/lib/components/icons/ArrowRightTag.svelte
Normal 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
|
||||||
|
>
|
||||||
|
|
@ -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"
|
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}
|
sideOffset={6}
|
||||||
side="bottom"
|
side="bottom"
|
||||||
align="start"
|
align="end"
|
||||||
transition={(e) => fade(e, { duration: 100 })}
|
transition={(e) => fade(e, { duration: 100 })}
|
||||||
>
|
>
|
||||||
<DropdownMenu.Sub>
|
<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"
|
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}
|
transition={flyAndScale}
|
||||||
sideOffset={8}
|
sideOffset={8}
|
||||||
|
align="end"
|
||||||
>
|
>
|
||||||
<DropdownMenu.Item
|
<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"
|
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"
|
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}
|
transition={flyAndScale}
|
||||||
sideOffset={8}
|
sideOffset={8}
|
||||||
|
align="end"
|
||||||
>
|
>
|
||||||
{#if onCopyLink}
|
{#if onCopyLink}
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue