mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-19 20:21:01 -06:00
refac
This commit is contained in:
@@ -148,7 +148,7 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="owui-docx-preview relative min-h-full bg-transparent {className}"
|
||||
class="relative min-h-full bg-transparent [&_.docx-wrapper]:flex [&_.docx-wrapper]:flex-col [&_.docx-wrapper]:items-center [&_.docx-wrapper]:bg-transparent [&_.docx-wrapper]:pt-4 [&_.docx-wrapper]:pb-14 [&_.docx-wrapper>section.docx]:!mx-auto [&_.docx-wrapper>section.docx]:!mt-0 [&_.docx-wrapper>section.docx]:!mb-1 [&_.docx-wrapper>section.docx]:!shadow-[0_1px_4px_rgba(0,0,0,0.18)] [&_.docx-wrapper>section.docx]:[zoom:var(--docx-scale)] {className}"
|
||||
style="--docx-scale: {docxScale};"
|
||||
>
|
||||
<div bind:this={styleEl}></div>
|
||||
@@ -164,7 +164,7 @@
|
||||
{:else if fallbackHtml}
|
||||
<div bind:this={outerContainer} class="h-full overflow-auto overscroll-contain">
|
||||
<div
|
||||
class="owui-docx-fallback max-w-[816px] min-h-[1056px] my-4 mx-auto py-14 px-16 bg-white text-gray-900 shadow rounded-sm font-[Calibri,Arial,sans-serif] text-base leading-[1.45]"
|
||||
class="max-w-[816px] min-h-[1056px] my-4 mx-auto py-14 px-16 bg-white text-gray-900 shadow rounded-sm font-[Calibri,Arial,sans-serif] text-base leading-[1.45] [&_.docx-title]:m-0 [&_.docx-title]:mb-4 [&_.docx-title]:text-3xl [&_.docx-title]:leading-[1.2] [&_.docx-subtitle]:mt-[-0.5rem] [&_.docx-subtitle]:mb-5 [&_.docx-subtitle]:text-xl [&_.docx-subtitle]:text-gray-500 [&_.docx-caption]:text-center [&_.docx-caption]:text-sm [&_.docx-caption]:text-gray-500 [&_p]:mt-0 [&_p]:mb-[0.65rem] [&_img]:block [&_img]:max-w-full [&_img]:h-auto [&_img]:my-3 [&_img]:mx-auto [&_table]:w-full [&_table]:my-3 [&_table]:border-collapse [&_table]:font-[Calibri,Arial,sans-serif] [&_table]:text-[0.95rem] [&_td]:border [&_td]:border-gray-300/70 [&_td]:px-2 [&_td]:py-1.5 [&_td]:align-top [&_th]:border [&_th]:border-gray-300/70 [&_th]:px-2 [&_th]:py-1.5 [&_th]:align-top [&_blockquote]:my-4 [&_blockquote]:border-l-[3px] [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:text-gray-700"
|
||||
>
|
||||
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||
{@html fallbackHtml}
|
||||
@@ -185,7 +185,8 @@
|
||||
class="absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-0.5 rounded-lg bg-white/90 dark:bg-gray-850/90 backdrop-blur-sm shadow-lg border border-gray-200/60 dark:border-gray-700/60 px-1 py-0.5"
|
||||
>
|
||||
<button
|
||||
class="p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
type="button"
|
||||
class="shrink-0 min-w-7 h-7 inline-flex items-center justify-center p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
on:click={zoomOut}
|
||||
aria-label="Zoom out"
|
||||
>
|
||||
@@ -203,14 +204,16 @@
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="px-1.5 py-1 min-w-[3rem] text-center text-[11px] font-normal text-gray-500 dark:text-gray-400 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition tabular-nums"
|
||||
type="button"
|
||||
class="shrink-0 min-w-12 h-7 px-1.5 py-1 text-center text-[11px] font-normal text-gray-500 dark:text-gray-400 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition tabular-nums"
|
||||
on:click={resetView}
|
||||
aria-label="Reset zoom"
|
||||
>
|
||||
{Math.round(zoomLevel * 100)}%
|
||||
</button>
|
||||
<button
|
||||
class="p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
type="button"
|
||||
class="shrink-0 min-w-7 h-7 inline-flex items-center justify-center p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
on:click={zoomIn}
|
||||
aria-label="Zoom in"
|
||||
>
|
||||
@@ -228,70 +231,3 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.owui-docx-preview :global(.docx-wrapper) {
|
||||
background: transparent;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16px 0 56px;
|
||||
}
|
||||
|
||||
.owui-docx-preview :global(.docx-wrapper > section.docx) {
|
||||
margin: 0 auto 4px !important;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
|
||||
zoom: var(--docx-scale);
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(.docx-title) {
|
||||
font-size: 2rem;
|
||||
line-height: 1.2;
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(.docx-subtitle) {
|
||||
font-size: 1.25rem;
|
||||
color: #6b7280;
|
||||
margin: -0.5rem 0 1.25rem;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(.docx-caption) {
|
||||
color: #6b7280;
|
||||
font-size: 0.875rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(p) {
|
||||
margin: 0 0 0.65rem;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(img) {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0.75rem auto;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(table) {
|
||||
width: 100%;
|
||||
margin: 0.75rem 0;
|
||||
border-collapse: collapse;
|
||||
font-family: Calibri, Arial, sans-serif;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(table td),
|
||||
.owui-docx-fallback :global(table th) {
|
||||
border: 1px solid rgba(200, 200, 200, 0.6);
|
||||
padding: 6px 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.owui-docx-fallback :global(blockquote) {
|
||||
margin: 1rem 0;
|
||||
padding-left: 1rem;
|
||||
border-left: 3px solid #d1d5db;
|
||||
color: #374151;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -289,7 +289,8 @@
|
||||
class="absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-0.5 rounded-lg bg-white/90 dark:bg-gray-850/90 backdrop-blur-sm shadow-lg border border-gray-200/60 dark:border-gray-700/60 px-1 py-0.5"
|
||||
>
|
||||
<button
|
||||
class="p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
type="button"
|
||||
class="shrink-0 min-w-7 h-7 inline-flex items-center justify-center p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
on:click={zoomOut}
|
||||
aria-label="Zoom out"
|
||||
>
|
||||
@@ -307,14 +308,16 @@
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="px-1.5 py-1 min-w-[3rem] text-center text-[11px] font-normal text-gray-500 dark:text-gray-400 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition tabular-nums"
|
||||
type="button"
|
||||
class="shrink-0 min-w-12 h-7 px-1.5 py-1 text-center text-[11px] font-normal text-gray-500 dark:text-gray-400 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition tabular-nums"
|
||||
on:click={resetView}
|
||||
aria-label="Reset zoom"
|
||||
>
|
||||
{Math.round(zoomLevel * 100)}%
|
||||
</button>
|
||||
<button
|
||||
class="p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
type="button"
|
||||
class="shrink-0 min-w-7 h-7 inline-flex items-center justify-center p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||
on:click={zoomIn}
|
||||
aria-label="Zoom in"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user