Commit f9e3c47d authored by Michael Poluektov's avatar Michael Poluektov
Browse files

rebase

parents 49b4211c 24ef5af2
......@@ -7,8 +7,8 @@
const dispatch = createEventDispatcher();
export let title = $i18n.t('Confirm your action');
export let message = $i18n.t('This action cannot be undone. Do you wish to continue?');
export let title = '';
export let message = '';
export let cancelLabel = $i18n.t('Cancel');
export let confirmLabel = $i18n.t('Confirm');
......@@ -58,11 +58,21 @@
}}
>
<div class="px-[1.75rem] py-6">
<div class=" text-lg font-semibold dark:text-gray-200 mb-2.5">{title}</div>
<div class=" text-lg font-semibold dark:text-gray-200 mb-2.5">
{#if title !== ''}
{title}
{:else}
{$i18n.t('Confirm your action')}
{/if}
</div>
<slot>
<div class=" text-sm text-gray-500">
{message}
{#if message !== ''}
{message}
{:else}
{$i18n.t('This action cannot be undone. Do you wish to continue?')}
{/if}
</div>
</slot>
......@@ -71,6 +81,7 @@
class="bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-white font-medium w-full py-2.5 rounded-lg transition"
on:click={() => {
show = false;
dispatch('cancel');
}}
type="button"
>
......
......@@ -63,7 +63,7 @@
<div
class=" m-auto rounded-2xl max-w-full {sizeToWidth(
size
)} mx-2 bg-gray-50 dark:bg-gray-900 shadow-3xl"
)} mx-2 bg-gray-50 dark:bg-gray-900 shadow-3xl max-h-[100dvh] overflow-y-auto scrollbar-hidden"
in:flyAndScale
on:mousedown={(e) => {
e.stopPropagation();
......
......@@ -48,7 +48,7 @@
<ChevronDown className="absolute end-2 top-1/2 -translate-y-[45%] size-3.5" strokeWidth="2.5" />
</Select.Trigger>
<Select.Content
class="w-full rounded-lg bg-white dark:bg-gray-900 dark:text-white shadow-lg border border-gray-300/30 dark:border-gray-850/50 outline-none"
class="w-full rounded-lg bg-white dark:bg-gray-900 dark:text-white shadow-lg border border-gray-300/30 dark:border-gray-700/40 outline-none"
transition={flyAndScale}
sideOffset={4}
>
......
......@@ -4,8 +4,8 @@
export let readOnly = false;
export let outerClassName = 'flex flex-1';
export let inputClassName =
'w-full rounded-l-lg py-2 pl-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none';
export let showButtonClassName = 'px-2 transition rounded-r-lg bg-white dark:bg-gray-850';
'w-full rounded-l-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none';
export let showButtonClassName = 'px-2 transition rounded-r-lg bg-gray-50 dark:bg-gray-850';
let show = false;
</script>
......
......@@ -22,7 +22,7 @@
};
</script>
<div class="flex {showTagInput ? 'flex-row-reverse' : ''}">
<div class="px-0.5 flex {showTagInput ? 'flex-row-reverse' : ''}">
{#if showTagInput}
<div class="flex items-center">
<input
......
......@@ -3,11 +3,13 @@
import { marked } from 'marked';
import tippy from 'tippy.js';
import { roundArrow } from 'tippy.js';
export let placement = 'top';
export let content = `I'm a tooltip!`;
export let touch = true;
export let className = 'flex';
export let theme = '';
let tooltipElement;
let tooltipInstance;
......@@ -20,7 +22,10 @@
content: content,
placement: placement,
allowHTML: true,
touch: touch
touch: touch,
...(theme !== '' ? { theme } : { theme: 'dark' }),
arrow: false,
offset: [0, 4]
});
}
} else if (tooltipInstance && content === '') {
......
......@@ -109,7 +109,7 @@
<div class="flex flex-1">
<div
class="bg-gray-200 dark:bg-gray-800 font-bold px-3 py-0.5 border border-r-0 dark:border-gray-800 rounded-l-xl flex items-center"
class="bg-gray-200 dark:bg-gray-800 font-semibold px-3 py-0.5 border border-r-0 dark:border-gray-800 rounded-l-xl flex items-center"
>
#
</div>
......
<script lang="ts">
export let className = 'w-4 h-4';
export let strokeWidth = '1.5';
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
stroke="currentColor"
fill="currentColor"
class={className}
stroke-width={strokeWidth}
>
<path
d="M18.75 12.75h1.5a.75.75 0 0 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5ZM12 6a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 12 6ZM12 18a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 12 18ZM3.75 6.75h1.5a.75.75 0 1 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5ZM5.25 18.75h-1.5a.75.75 0 0 1 0-1.5h1.5a.75.75 0 0 1 0 1.5ZM3 12a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 3 12ZM9 3.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5ZM12.75 12a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0ZM9 15.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z"
/>
</svg>
......@@ -21,6 +21,7 @@
import { page } from '$app/stores';
import UserMenu from './Sidebar/UserMenu.svelte';
import MenuLines from '../icons/MenuLines.svelte';
import AdjustmentsHorizontal from '../icons/AdjustmentsHorizontal.svelte';
const i18n = getContext('i18n');
......@@ -32,6 +33,7 @@
export let selectedModels;
export let showModelSelector = true;
export let showControls = false;
let showShareChatModal = false;
let showDownloadChatModal = false;
......@@ -48,7 +50,7 @@
>
<button
id="sidebar-toggle-button"
class="cursor-pointer px-2 py-2 flex rounded-xl hover:bg-gray-100 dark:hover:bg-gray-850 transition"
class="cursor-pointer px-2 py-2 flex rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
on:click={() => {
showSidebar.set(!$showSidebar);
}}
......@@ -58,6 +60,7 @@
</div>
</button>
</div>
<div class="flex-1 overflow-hidden max-w-full">
{#if showModelSelector}
<ModelSelector bind:selectedModels showSetDefault={!shareEnabled} />
......@@ -79,7 +82,7 @@
}}
>
<button
class="hidden md:flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-850 transition"
class="hidden md:flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
id="chat-context-menu-button"
>
<div class=" m-auto self-center">
......@@ -101,12 +104,26 @@
</button>
</Menu>
{/if}
<Tooltip content={$i18n.t('Controls')}>
<button
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
on:click={() => {
showControls = !showControls;
}}
>
<div class=" m-auto self-center">
<AdjustmentsHorizontal className=" size-5" strokeWidth="0.5" />
</div>
</button>
</Tooltip>
<Tooltip content={$i18n.t('New Chat')}>
<button
id="new-chat-button"
class=" flex {$showSidebar
? 'md:hidden'
: ''} cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-850 transition"
: ''} cursor-pointer px-2 py-2 rounded-xl text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-850 transition"
on:click={() => {
initNewChat();
}}
......@@ -140,7 +157,7 @@
}}
>
<button
class="select-none flex rounded-xl p-1.5 w-full hover:bg-gray-100 dark:hover:bg-gray-850 transition"
class="select-none flex rounded-xl p-1.5 w-full hover:bg-gray-50 dark:hover:bg-gray-850 transition"
aria-label="User Menu"
>
<div class=" self-center">
......
......@@ -186,6 +186,7 @@
goto('/');
}
await chats.set(await getChatList(localStorage.token));
await pinnedChats.set(await getChatListByTagName(localStorage.token, 'pinned'));
}
};
</script>
......@@ -260,7 +261,7 @@
alt="logo"
/>
</div>
<div class=" self-center font-medium text-sm text-gray-850 dark:text-white">
<div class=" self-center font-medium text-sm text-gray-850 dark:text-white font-primary">
{$i18n.t('New Chat')}
</div>
<div class="self-center ml-auto">
......@@ -338,7 +339,7 @@
</div>
<div class="flex self-center">
<div class=" self-center font-medium text-sm">{$i18n.t('Workspace')}</div>
<div class=" self-center font-medium text-sm font-primary">{$i18n.t('Workspace')}</div>
</div>
</a>
</div>
......@@ -532,7 +533,7 @@
<div class="px-2.5">
<!-- <hr class=" border-gray-900 mb-1 w-full" /> -->
<div class="flex flex-col">
<div class="flex flex-col font-primary">
{#if $user !== undefined}
<UserMenu
role={$user.role}
......@@ -555,50 +556,13 @@
alt="User profile"
/>
</div>
<div class=" self-center font-semibold">{$user.name}</div>
<div class=" self-center font-medium">{$user.name}</div>
</button>
</UserMenu>
{/if}
</div>
</div>
</div>
<!-- <div
id="sidebar-handle"
class=" hidden md:fixed left-0 top-[50dvh] -translate-y-1/2 transition-transform translate-x-[255px] md:translate-x-[260px] rotate-0"
>
<Tooltip
placement="right"
content={`${$showSidebar ? $i18n.t('Close') : $i18n.t('Open')} ${$i18n.t('sidebar')}`}
touch={false}
>
<button
id="sidebar-toggle-button"
class=" group"
on:click={() => {
showSidebar.set(!$showSidebar);
}}
><span class="" data-state="closed"
><div
class="flex h-[72px] w-8 items-center justify-center opacity-50 group-hover:opacity-100 transition"
>
<div class="flex h-6 w-6 flex-col items-center">
<div
class="h-3 w-1 rounded-full bg-[#0f0f0f] dark:bg-white rotate-0 translate-y-[0.15rem] {$showSidebar
? 'group-hover:rotate-[15deg]'
: 'group-hover:rotate-[-15deg]'}"
/>
<div
class="h-3 w-1 rounded-full bg-[#0f0f0f] dark:bg-white rotate-0 translate-y-[-0.15rem] {$showSidebar
? 'group-hover:rotate-[-15deg]'
: 'group-hover:rotate-[15deg]'}"
/>
</div>
</div>
</span>
</button>
</Tooltip>
</div> -->
</div>
<style>
......
......@@ -30,7 +30,7 @@
<slot name="content">
<DropdownMenu.Content
class="w-full {className} text-sm rounded-xl px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow"
class="w-full {className} text-sm rounded-xl px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow font-primary"
sideOffset={8}
side="bottom"
align="start"
......
......@@ -407,7 +407,7 @@
{/if}
</div>
<div class=" self-center flex-1">
<div class=" font-bold line-clamp-1">#{doc.name} ({doc.filename})</div>
<div class=" font-semibold line-clamp-1">#{doc.name} ({doc.filename})</div>
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1">
{doc.title}
</div>
......
......@@ -200,14 +200,14 @@
<div class=" flex-1 self-center pl-1">
<div class=" font-semibold flex items-center gap-1.5">
<div
class=" text-xs font-black px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
class=" text-xs font-bold px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
{func.type}
</div>
{#if func?.meta?.manifest?.version}
<div
class="text-xs font-black px-1 rounded line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
class="text-xs font-bold px-1 rounded line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
v{func?.meta?.manifest?.version ?? ''}
</div>
......@@ -430,7 +430,7 @@
</div>
<div class=" self-center">
<div class=" font-bold line-clamp-1">{$i18n.t('Discover a function')}</div>
<div class=" font-semibold line-clamp-1">{$i18n.t('Discover a function')}</div>
<div class=" text-sm line-clamp-1">
{$i18n.t('Discover, download, and explore custom functions')}
</div>
......
......@@ -271,7 +271,7 @@
</div>
<div class=" self-center">
<div class=" font-bold line-clamp-1">{$i18n.t('Create a model')}</div>
<div class=" font-semibold line-clamp-1">{$i18n.t('Create a model')}</div>
<div class=" text-sm line-clamp-1">{$i18n.t('Customize models for a specific purpose')}</div>
</div>
</a>
......@@ -297,7 +297,7 @@
: ''} "
>
<img
src={model?.info?.meta?.profile_image_url ?? '/favicon.png'}
src={model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
alt="modelfile profile"
class=" rounded-full w-full h-auto object-cover"
/>
......@@ -307,7 +307,7 @@
<div
class=" flex-1 self-center {model?.info?.meta?.hidden ?? false ? 'text-gray-500' : ''}"
>
<div class=" font-bold line-clamp-1">{model.name}</div>
<div class=" font-semibold line-clamp-1">{model.name}</div>
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1">
{!!model?.info?.meta?.description ? model?.info?.meta?.description : model.id}
</div>
......@@ -518,7 +518,7 @@
</div>
<div class=" self-center">
<div class=" font-bold line-clamp-1">{$i18n.t('Discover a model')}</div>
<div class=" font-semibold line-clamp-1">{$i18n.t('Discover a model')}</div>
<div class=" text-sm line-clamp-1">
{$i18n.t('Discover, download, and explore model presets')}
</div>
......
......@@ -119,7 +119,7 @@
<div class="flex items-center">
<div class="flex flex-col">
<div
class=" w-fit text-xs font-black px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
class=" w-fit text-xs font-bold px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
{item?.type ?? 'Document'}
</div>
......
......@@ -119,7 +119,7 @@
<div class=" flex flex-1 space-x-4 cursor-pointer w-full">
<a href={`/workspace/prompts/edit?command=${encodeURIComponent(prompt.command)}`}>
<div class=" flex-1 self-center pl-5">
<div class=" font-bold line-clamp-1">{prompt.command}</div>
<div class=" font-semibold line-clamp-1">{prompt.command}</div>
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1">
{prompt.title}
</div>
......@@ -299,7 +299,7 @@
</div>
<div class=" self-center">
<div class=" font-bold line-clamp-1">{$i18n.t('Discover a prompt')}</div>
<div class=" font-semibold line-clamp-1">{$i18n.t('Discover a prompt')}</div>
<div class=" text-sm line-clamp-1">
{$i18n.t('Discover, download, and explore custom prompts')}
</div>
......
......@@ -177,14 +177,14 @@
<div class=" flex-1 self-center pl-1">
<div class=" font-semibold flex items-center gap-1.5">
<div
class=" text-xs font-black px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
class=" text-xs font-bold px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
TOOL
</div>
{#if tool?.meta?.manifest?.version}
<div
class="text-xs font-black px-1 rounded line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
class="text-xs font-bold px-1 rounded line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"
>
v{tool?.meta?.manifest?.version ?? ''}
</div>
......@@ -389,7 +389,7 @@
</div>
<div class=" self-center">
<div class=" font-bold line-clamp-1">{$i18n.t('Discover a tool')}</div>
<div class=" font-semibold line-clamp-1">{$i18n.t('Discover a tool')}</div>
<div class=" text-sm line-clamp-1">
{$i18n.t('Discover, download, and explore custom tools')}
</div>
......
......@@ -88,6 +88,7 @@
"Chat": "المحادثة",
"Chat Background Image": "",
"Chat Bubble UI": "UI الدردشة",
"Chat Controls": "",
"Chat direction": "اتجاه المحادثة",
"Chat History": "تاريخ المحادثة",
"Chat History is off for this browser.": "سجل الدردشة معطل لهذا المتصفح",
......@@ -130,6 +131,7 @@
"Context Length": "طول السياق",
"Continue Response": "متابعة الرد",
"Continue with {{provider}}": "",
"Controls": "",
"Copied shared chat URL to clipboard!": "تم نسخ عنوان URL للدردشة المشتركة إلى الحافظة",
"Copy": "نسخ",
"Copy last code block": "انسخ كتلة التعليمات البرمجية الأخيرة",
......@@ -409,7 +411,6 @@
"Oops! Looks like the URL is invalid. Please double-check and try again.": "خطاء! يبدو أن عنوان URL غير صالح. يرجى التحقق مرة أخرى والمحاولة مرة أخرى.",
"Oops! There was an error in the previous response. Please try again or contact admin.": "",
"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "خطاء! أنت تستخدم طريقة غير مدعومة (الواجهة الأمامية فقط). يرجى تقديم واجهة WebUI من الواجهة الخلفية.",
"Open": "فتح",
"Open AI (Dall-E)": "AI (Dall-E) فتح",
"Open new chat": "فتح محادثة جديده",
"Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})": "",
......@@ -546,7 +547,6 @@
"Show shortcuts": "إظهار الاختصارات",
"Show your support!": "",
"Showcased creativity": "أظهر الإبداع",
"sidebar": "الشريط الجانبي",
"Sign in": "تسجيل الدخول",
"Sign Out": "تسجيل الخروج",
"Sign up": "تسجيل",
......
......@@ -88,6 +88,7 @@
"Chat": "Чат",
"Chat Background Image": "",
"Chat Bubble UI": "UI за чат бублон",
"Chat Controls": "",
"Chat direction": "Направление на чата",
"Chat History": "Чат История",
"Chat History is off for this browser.": "Чат История е изключен за този браузър.",
......@@ -130,6 +131,7 @@
"Context Length": "Дължина на Контекста",
"Continue Response": "Продължи отговора",
"Continue with {{provider}}": "",
"Controls": "",
"Copied shared chat URL to clipboard!": "Копирана е връзката за чат!",
"Copy": "Копирай",
"Copy last code block": "Копиране на последен код блок",
......@@ -409,7 +411,6 @@
"Oops! Looks like the URL is invalid. Please double-check and try again.": "Упс! Изглежда URL адресът е невалиден. Моля, проверете отново и опитайте пак.",
"Oops! There was an error in the previous response. Please try again or contact admin.": "",
"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "Упс! Използвате неподдържан метод (само фронтенд). Моля, сервирайте WebUI от бекенда.",
"Open": "Отвори",
"Open AI (Dall-E)": "Open AI (Dall-E)",
"Open new chat": "Отвори нов чат",
"Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})": "",
......@@ -542,7 +543,6 @@
"Show shortcuts": "Покажи",
"Show your support!": "",
"Showcased creativity": "Показана креативност",
"sidebar": "sidebar",
"Sign in": "Вписване",
"Sign Out": "Изход",
"Sign up": "Регистрация",
......
......@@ -88,6 +88,7 @@
"Chat": "চ্যাট",
"Chat Background Image": "",
"Chat Bubble UI": "চ্যাট বাবল UI",
"Chat Controls": "",
"Chat direction": "চ্যাট দিকনির্দেশ",
"Chat History": "চ্যাট হিস্টোরি",
"Chat History is off for this browser.": "এই ব্রাউজারের জন্য চ্যাট হিস্টোরি বন্ধ আছে",
......@@ -130,6 +131,7 @@
"Context Length": "কনটেক্সটের দৈর্ঘ্য",
"Continue Response": "যাচাই করুন",
"Continue with {{provider}}": "",
"Controls": "",
"Copied shared chat URL to clipboard!": "শেয়ারকৃত কথা-ব্যবহারের URL ক্লিপবোর্ডে কপি করা হয়েছে!",
"Copy": "অনুলিপি",
"Copy last code block": "সর্বশেষ কোড ব্লক কপি করুন",
......@@ -409,7 +411,6 @@
"Oops! Looks like the URL is invalid. Please double-check and try again.": "ওহ, মনে হচ্ছে ইউআরএলটা ইনভ্যালিড। দয়া করে আর চেক করে চেষ্টা করুন।",
"Oops! There was an error in the previous response. Please try again or contact admin.": "",
"Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "আপনি একটা আনসাপোর্টেড পদ্ধতি (শুধু ফ্রন্টএন্ড) ব্যবহার করছেন। দয়া করে WebUI ব্যাকএন্ড থেকে চালনা করুন।",
"Open": "খোলা",
"Open AI (Dall-E)": "Open AI (Dall-E)",
"Open new chat": "নতুন চ্যাট খুলুন",
"Open WebUI version (v{{OPEN_WEBUI_VERSION}}) is lower than required version (v{{REQUIRED_VERSION}})": "",
......@@ -542,7 +543,6 @@
"Show shortcuts": "শর্টকাটগুলো দেখান",
"Show your support!": "",
"Showcased creativity": "সৃজনশীলতা প্রদর্শন",
"sidebar": "সাইডবার",
"Sign in": "সাইন ইন",
"Sign Out": "সাইন আউট",
"Sign up": "সাইন আপ",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment