Formatting

This commit is contained in:
Simon Cambier 2023-11-26 17:24:21 +01:00
parent 30e4d5c87e
commit 0598e0c6bd
11 changed files with 49 additions and 60 deletions

View File

@ -1,10 +1,11 @@
{ {
"useTabs": false, "useTabs": false,
"singleQuote": true, "bracketSameLine": true,
"trailingComma": "es5", "singleQuote": true,
"printWidth": 100, "trailingComma": "es5",
"plugins": ["prettier-plugin-svelte"], "printWidth": 100,
"pluginSearchDirs": ["."], "plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"semi": false, "semi": false,
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
} }

14
src/app.d.ts vendored
View File

@ -1,12 +1,12 @@
// See https://kit.svelte.dev/docs/types#app // See https://kit.svelte.dev/docs/types#app
// for information about these interfaces // for information about these interfaces
declare global { declare global {
namespace App { namespace App {
// interface Error {} // interface Error {}
// interface Locals {} // interface Locals {}
// interface PageData {} // interface PageData {}
// interface Platform {} // interface Platform {}
} }
} }
export {}; export {}

View File

@ -9,9 +9,9 @@
<div class={cssClass}> <div class={cssClass}>
{#if isMarkdown} {#if isMarkdown}
<div class="h-full p-2"> <div class="h-full p-2">
{@html htmlContent} {@html htmlContent}
</div> </div>
{:else if isPlainText} {:else if isPlainText}
<div class="whitespace-pre-line h-full"> <div class="whitespace-pre-line h-full">
{decompressed} {decompressed}

View File

@ -62,12 +62,10 @@
type="text" type="text"
bind:value={filter} bind:value={filter}
bind:this={inputFilter} bind:this={inputFilter}
class={$$restProps.class ?? ''} class={$$restProps.class ?? ''} />
/>
<div <div
class="absolute top-full left-0 w-full bg-gray-700 max-h-[90vh] overflow-y-auto" class="absolute top-full left-0 w-full bg-gray-700 max-h-[90vh] overflow-y-auto"
bind:this={divContainer} bind:this={divContainer}>
>
{#each filteredItems as item} {#each filteredItems as item}
<div class="p-1 hover:bg-gray-600" on:click={() => selectItem(item)}>{item.text}</div> <div class="p-1 hover:bg-gray-600" on:click={() => selectItem(item)}>{item.text}</div>
{/each} {/each}
@ -78,8 +76,7 @@
readonly readonly
value={value?.text ?? ''} value={value?.text ?? ''}
class={$$restProps.class ?? ''} class={$$restProps.class ?? ''}
on:click={showOptions} on:click={showOptions} />
/>
{/if} {/if}
</div> </div>

View File

@ -113,8 +113,7 @@
<input <input
bind:this={urlInput} bind:this={urlInput}
type="text" type="text"
class="border border-gray-300 bg-transparent p-1 grow" class="border border-gray-300 bg-transparent p-1 grow" />
/>
<button class="button" on:click={copyUrl} title="Copy"> <button class="button" on:click={copyUrl} title="Copy">
<Icon class="text-xl" icon="fluent:copy-16-regular" /> <Icon class="text-xl" icon="fluent:copy-16-regular" />
</button> </button>
@ -128,8 +127,7 @@
<ComboBox <ComboBox
items={languages} items={languages}
bind:value={selectedLanguage} bind:value={selectedLanguage}
class="bg-gray-700 border border-gray-300 p-1" class="bg-gray-700 border border-gray-300 p-1" />
/>
</div> </div>
<!-- Toggle text wrap --> <!-- Toggle text wrap -->

View File

@ -2,8 +2,7 @@
</script> </script>
<div <div
class="flex flex-wrap justify-between items-center px-3 py-1 text-sm w-full z-10 shadow-md gap-2 font-mono bg-gray-700" class="flex flex-wrap justify-between items-center px-3 py-1 text-sm w-full z-10 shadow-md gap-2 font-mono bg-gray-700">
>
<div class="flex items-center"> <div class="flex items-center">
<h1 class="text-xl"> <h1 class="text-xl">
<a href="/new" title="Create a new note">Paste</a> <a href="/new" title="Create a new note">Paste</a>

View File

@ -2,4 +2,4 @@
import '../app.postcss' import '../app.postcss'
</script> </script>
<slot /> <slot />

View File

@ -1,2 +1,2 @@
export const prerender = true export const prerender = true
export const ssr = false export const ssr = false

View File

@ -67,39 +67,35 @@
<a <a
href={'/editor' + getUrlDataPart()} href={'/editor' + getUrlDataPart()}
class="p-1 hover:bg-gray-600/50" class="p-1 hover:bg-gray-600/50"
title="Edit a copy of this note" title="Edit a copy of this note">
>
<Icon class="text-xl" icon="fluent:document-edit-16-regular" /> <Icon class="text-xl" icon="fluent:document-edit-16-regular" />
</a> </a>
</TopBar> </TopBar>
{/if} {/if}
{#if htmlContent || decompressed} {#if htmlContent || decompressed}
<div class="overflow-y-auto grow"> <div class="overflow-y-auto grow pb-4">
{#if isInIframe()} {#if isInIframe()}
<CodeView <CodeView
class="prose dark:prose-invert w-full max-w-full h-full" class="prose dark:prose-invert w-full max-w-full h-full"
{isMarkdown} {isMarkdown}
{isPlainText} {isPlainText}
{decompressed} {decompressed}
{htmlContent} {htmlContent} />
/>
{:else} {:else}
<CodeView <CodeView
class="prose dark:prose-invert lg:py-12 p-[0.5em] md:max-w-3xl md:mx-auto lg:max-w-4xl" class="prose dark:prose-invert lg:py-12 p-[0.5em] md:max-w-3xl md:mx-auto lg:max-w-4xl"
{isMarkdown} {isMarkdown}
{isPlainText} {isPlainText}
{decompressed} {decompressed}
{htmlContent} {htmlContent} />
/>
{/if} {/if}
</div> </div>
{/if} {/if}
<footer <footer
class="absolute bottom-0 left-0 w-full bg-gray-700 px-4 py-1 font-mono text-xs" class="absolute bottom-0 left-0 w-full bg-gray-700 px-4 py-1 font-mono text-xs"
class:hidden={!isInIframe()} class:hidden={!isInIframe()}>
>
<a href={window.location.href} target="_blank">Powered by Paste</a> <a href={window.location.href} target="_blank">Powered by Paste</a>
</footer> </footer>
</div> </div>

View File

@ -66,11 +66,10 @@
editor.setValue(decompressed) editor.setValue(decompressed)
} }
} }
} }
</script> </script>
<svelte:head> <svelte:head>
<script <script
src="https://cdn.jsdelivr.net/combine/ src="https://cdn.jsdelivr.net/combine/
npm/codemirror@5.65.16, npm/codemirror@5.65.16,
@ -80,8 +79,7 @@ npm/codemirror@5.65.16/addon/mode/multiplex.min.js,
npm/codemirror@5.65.16/addon/mode/simple.min.js, npm/codemirror@5.65.16/addon/mode/simple.min.js,
npm/codemirror@5.65.16/addon/scroll/simplescrollbars.js, npm/codemirror@5.65.16/addon/scroll/simplescrollbars.js,
npm/codemirror@5.65.16/mode/meta.min.js" npm/codemirror@5.65.16/mode/meta.min.js"
on:load={initCodeEditor} on:load={initCodeEditor}></script>
></script>
</svelte:head> </svelte:head>
<div class="flex flex-col font-mono h-screen bg-gray-700"> <div class="flex flex-col font-mono h-screen bg-gray-700">

View File

@ -1,17 +1,17 @@
{ {
"extends": "./.svelte-kit/tsconfig.json", "extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": { "compilerOptions": {
"allowJs": true, "allowJs": true,
"checkJs": true, "checkJs": true,
"esModuleInterop": true, "esModuleInterop": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"strict": true "strict": true
} }
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// //
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in // from the referenced tsconfig.json - TypeScript does not merge them in
} }