refac
This commit is contained in:
1 parent
eeaf1a1df0
commit
d4461bd6f3
139 files changed
+470
-470
No files matched your search
@@ -290,9 +290,9 @@
|
||||
<slot />
|
||||
|
||||
<div slot="content">
|
||||
<DropdownMenu className="select-none min-w-[200px] max-w-[200px] transition">
|
||||
<DropdownMenu className="select-none min-w-[12.5rem] max-w-[12.5rem] transition">
|
||||
<!-- <DropdownMenu.Item draggable="false"
|
||||
class="flex gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer dark:hover:bg-gray-800 rounded-xl"
|
||||
class="flex gap-2 items-center h-[1.6875rem] px-2 text-[0.8125rem] font-normal cursor-pointer dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={async () => {
|
||||
await showSettings.set(!$showSettings);
|
||||
}}
|
||||
@@ -323,7 +323,7 @@
|
||||
{#if scrollToTop}
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
scrollToTop();
|
||||
}}
|
||||
@@ -351,7 +351,7 @@
|
||||
{#if ($artifactContents ?? []).length > 0}
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
id="chat-artifacts-button"
|
||||
on:click={async () => {
|
||||
await showControls.set(true);
|
||||
@@ -369,7 +369,7 @@
|
||||
{#if !readOnly && !$temporaryChatEnabled && ($user?.role === 'admin' || ($user.permissions?.chat?.share ?? true))}
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
id="chat-share-button"
|
||||
on:click={() => {
|
||||
shareHandler();
|
||||
@@ -385,7 +385,7 @@
|
||||
<button
|
||||
slot="trigger"
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
>
|
||||
<Download className="size-3.5" strokeWidth="1.5" />
|
||||
|
||||
@@ -394,7 +394,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
downloadJSONExport();
|
||||
}}
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
downloadTxt();
|
||||
}}
|
||||
@@ -414,7 +414,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
downloadPdf();
|
||||
}}
|
||||
@@ -426,7 +426,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
id="chat-copy-button"
|
||||
on:click={async () => {
|
||||
const res = await copyToClipboard(await getChatAsText()).catch((e) => {
|
||||
@@ -450,7 +450,7 @@
|
||||
<button
|
||||
slot="trigger"
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
>
|
||||
<Folder className="size-3.5" strokeWidth="1.5" />
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
{#if folder?.id}
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 overflow-hidden rounded-xl px-2 text-[13px] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 overflow-hidden rounded-xl px-2 text-[0.8125rem] cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
moveChatHandler(chat.id, folder.id);
|
||||
}}
|
||||
@@ -478,7 +478,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
archiveChatHandler();
|
||||
}}
|
||||
@@ -489,7 +489,7 @@
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[13px] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] cursor-pointer select-none hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
deleteChatHandler();
|
||||
}}
|
||||
|
||||
@@ -1162,7 +1162,7 @@
|
||||
placement="bottom"
|
||||
>
|
||||
<button
|
||||
class="flex size-[30px] justify-center items-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-900 transition {isWindows
|
||||
class="flex size-[1.875rem] justify-center items-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-900 transition {isWindows
|
||||
? 'cursor-pointer'
|
||||
: 'cursor-[w-resize]'}"
|
||||
on:click={() => {
|
||||
@@ -1486,7 +1486,7 @@
|
||||
</Tooltip>
|
||||
|
||||
<div slot="content">
|
||||
<DropdownMenu className="min-w-[170px]">
|
||||
<DropdownMenu className="min-w-[10.625rem]">
|
||||
<button
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={markAllChatsReadHandler}
|
||||
@@ -1557,7 +1557,7 @@
|
||||
name={$i18n.t('Pinned')}
|
||||
>
|
||||
<div
|
||||
class="ml-3 pl-1 mt-[1px] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900 text-gray-700 dark:text-gray-300"
|
||||
class="ml-3 pl-1 mt-[0.0625rem] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900 text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
{#each $pinnedChats as chat, idx (`pinned-chat-${chat?.id ?? idx}`)}
|
||||
<ChatItem
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
class=" w-full {className} rounded-xl flex relative group hover:bg-gray-100 dark:hover:bg-gray-900 {$page
|
||||
.url.pathname === `/channels/${channel.id}`
|
||||
? 'bg-gray-100 dark:bg-gray-900 selected'
|
||||
: ''} {channel?.type === 'dm' ? 'px-1 py-[3px]' : 'p-1'} {channel?.unread_count > 0
|
||||
: ''} {channel?.type === 'dm' ? 'px-1 py-[0.1875rem]' : 'p-1'} {channel?.unread_count > 0
|
||||
? 'font-normal dark:text-white text-black'
|
||||
: ' dark:text-gray-400 text-gray-600'} cursor-pointer select-none"
|
||||
>
|
||||
@@ -109,7 +109,7 @@
|
||||
{#if channel?.type === 'dm'}
|
||||
{#if channel?.users}
|
||||
{@const channelMembers = channel.users.filter((u) => u.id !== $user?.id)}
|
||||
<div class="flex ml-[1px] mr-0.5 relative">
|
||||
<div class="flex ml-[0.0625rem] mr-0.5 relative">
|
||||
{#each channelMembers.slice(0, 2) as u, index}
|
||||
<img
|
||||
src={`${WEBUI_API_BASE_URL}/users/${u.id}/profile/image`}
|
||||
@@ -191,7 +191,7 @@
|
||||
<div class="flex items-center">
|
||||
{#if channel?.unread_count > 0}
|
||||
<div
|
||||
class="text-xs py-[1px] px-2 rounded-xl bg-gray-100 text-black dark:bg-gray-800 dark:text-white font-normal whitespace-nowrap"
|
||||
class="text-xs py-[0.0625rem] px-2 rounded-xl bg-gray-100 text-black dark:bg-gray-800 dark:text-white font-normal whitespace-nowrap"
|
||||
>
|
||||
{new Intl.NumberFormat($i18n.locale, {
|
||||
notation: 'compact',
|
||||
|
||||
@@ -478,7 +478,7 @@
|
||||
<DragGhost {x} {y}>
|
||||
<div class=" bg-black/80 backdrop-blur-2xl px-2 py-1 rounded-lg w-fit max-w-40">
|
||||
<div class="flex items-center gap-1">
|
||||
<ChatIcon className=" size-[18px]" strokeWidth="1.5" />
|
||||
<ChatIcon className=" size-[1.125rem]" strokeWidth="1.5" />
|
||||
<div class=" text-xs text-white line-clamp-1">
|
||||
{title}
|
||||
</div>
|
||||
@@ -642,7 +642,7 @@
|
||||
class="{showInlineActions
|
||||
? 'selected'
|
||||
: 'invisible group-hover:visible'} absolute {className === 'pr-2'
|
||||
? 'right-[8px]'
|
||||
? 'right-[0.5rem]'
|
||||
: 'right-1'} inset-y-0 mr-1.5 flex items-center"
|
||||
>
|
||||
{#if confirmEdit}
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
</Tooltip>
|
||||
|
||||
<div slot="content">
|
||||
<DropdownMenu className="select-none min-w-[200px] transition">
|
||||
<DropdownMenu className="select-none min-w-[12.5rem] transition">
|
||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.share ?? true)}
|
||||
<button
|
||||
draggable="false"
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</Tooltip>
|
||||
|
||||
<div slot="content">
|
||||
<DropdownMenu className="min-w-[170px]">
|
||||
<DropdownMenu className="min-w-[10.625rem]">
|
||||
<button
|
||||
class="flex h-[1.6875rem] w-full items-center gap-2 rounded-xl px-2 text-[0.8125rem] select-none cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40"
|
||||
on:click={() => {
|
||||
|
||||
@@ -788,7 +788,7 @@
|
||||
<Emoji className="size-3.5" shortCode={folders[folderId].meta.icon} />
|
||||
</div>
|
||||
|
||||
<div class="hidden group-hover:flex transition-all p-[1px]">
|
||||
<div class="hidden group-hover:flex transition-all p-[0.0625rem]">
|
||||
{#if open}
|
||||
<ChevronDown className=" size-3" strokeWidth="1.5" />
|
||||
{:else}
|
||||
@@ -800,7 +800,7 @@
|
||||
<FolderIcon className="size-3.5" strokeWidth="1.5" />
|
||||
</div>
|
||||
|
||||
<div class="hidden group-hover:flex transition-all p-[1px]">
|
||||
<div class="hidden group-hover:flex transition-all p-[0.0625rem]">
|
||||
{#if open}
|
||||
<ChevronDown className=" size-3" strokeWidth="1.5" />
|
||||
{:else}
|
||||
@@ -890,7 +890,7 @@
|
||||
<div slot="content" class="w-full">
|
||||
{#if (folders[folderId]?.childrenIds ?? []).length > 0 || (chats ?? []).length > 0 || hasMoreChats}
|
||||
<div
|
||||
class="ml-3 pl-1 mt-[1px] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900"
|
||||
class="ml-3 pl-1 mt-[0.0625rem] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900"
|
||||
>
|
||||
{#if folders[folderId]?.childrenIds}
|
||||
{@const children = folders[folderId]?.childrenIds
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
class="flex opacity-0 group-hover:opacity-100 transition-all duration-100"
|
||||
style="transform: rotate({open ? '90deg' : '0deg'})"
|
||||
>
|
||||
<ChevronRight className="size-[11px]" />
|
||||
<ChevronRight className="size-[0.6875rem]" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
export let profile = false;
|
||||
export let help = false;
|
||||
|
||||
export let className = 'w-[240px]';
|
||||
export let className = 'w-[15rem]';
|
||||
export let align = 'end';
|
||||
|
||||
export let showActiveUsers = true;
|
||||
|
||||
Reference in new issue
Block a user