mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
refac
This commit is contained in:
1 parent
56de6dd792
commit
d8f27e745b
4 files changed
+152
-98
No files matched your search
@@ -4,6 +4,8 @@
|
||||
import Dropdown from '$lib/components/common/Dropdown.svelte';
|
||||
import DropdownMenu from '$lib/components/common/DropdownMenu.svelte';
|
||||
import DropdownSub from '$lib/components/common/DropdownSub.svelte';
|
||||
import Switch from '$lib/components/common/Switch.svelte';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import Download from '$lib/components/icons/Download.svelte';
|
||||
import GarbageBin from '$lib/components/icons/GarbageBin.svelte';
|
||||
import DocumentDuplicate from '$lib/components/icons/DocumentDuplicate.svelte';
|
||||
@@ -12,6 +14,7 @@
|
||||
import Pin from '$lib/components/icons/Pin.svelte';
|
||||
import PinSlash from '$lib/components/icons/PinSlash.svelte';
|
||||
import CloudArrowUp from '$lib/components/icons/CloudArrowUp.svelte';
|
||||
import Bold from '$lib/components/icons/Bold.svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -23,6 +26,8 @@
|
||||
export let onPin = null;
|
||||
export let isPinned = false;
|
||||
export let onUploadFiles = null;
|
||||
export let showAutoFormat = false;
|
||||
export let autoFormat = true;
|
||||
|
||||
export let onCopyLink = null;
|
||||
export let onCopyToClipboard = null;
|
||||
@@ -42,6 +47,23 @@
|
||||
|
||||
<div slot="content">
|
||||
<DropdownMenu className="min-w-[11.25rem]">
|
||||
{#if showAutoFormat}
|
||||
<Tooltip
|
||||
className="w-full"
|
||||
content={$i18n.t(
|
||||
'Format Markdown as you type and paste. Turn off to keep Markdown characters and paste plain text. Existing formatting is preserved.'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
class="select-none flex h-[1.6875rem] items-center gap-2 rounded-xl px-2 text-[0.8125rem] hover:bg-gray-50/60 dark:hover:bg-gray-800/60"
|
||||
>
|
||||
<Bold className="size-3.5 shrink-0" strokeWidth="2" />
|
||||
<span class="flex-1">{$i18n.t('Formatting')}</span>
|
||||
<Switch bind:state={autoFormat} ariaLabel={$i18n.t('Formatting')} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
<hr />
|
||||
{/if}
|
||||
<DropdownSub contentClass="select-none z-50">
|
||||
<button
|
||||
slot="trigger"
|
||||
|
||||
Reference in new issue
Block a user