Merge pull request #141 from Xyphyn/mono-ui

feat: switch to Mono UI
This commit is contained in:
Xylight authored and GitHub committed 2023-09-04 21:28:33 +00:00
commit 368d61e356
96 files changed
+1001 -1881

No files matched your search

+5 -4
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "1.2.3", "version": "1.3.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
@@ -14,7 +14,7 @@
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.3.1", "@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.5.0", "@sveltejs/kit": "^1.24.0",
"@types/markdown-it": "^12.2.3", "@types/markdown-it": "^12.2.3",
"@types/markdown-it-container": "^2.0.6", "@types/markdown-it-container": "^2.0.6",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
@@ -26,7 +26,7 @@
"markdown-it-sup": "^1.0.0", "markdown-it-sup": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"postcss": "^8.4.24", "postcss": "^8.4.24",
"svelte": "^3.54.0", "svelte": "^4.2.0",
"svelte-check": "^3.0.1", "svelte-check": "^3.0.1",
"svelte-hero-icons": "^5.0.0", "svelte-hero-icons": "^5.0.0",
"tailwindcss": "^3.3.2", "tailwindcss": "^3.3.2",
@@ -41,7 +41,8 @@
"@dicebear/core": "^6.0.4", "@dicebear/core": "^6.0.4",
"@dicebear/initials": "^6.0.4", "@dicebear/initials": "^6.0.4",
"lemmy-js-client": "^0.18.0-rc.2", "lemmy-js-client": "^0.18.0-rc.2",
"markdown-it": "^13.0.1" "markdown-it": "^13.0.1",
"mono-svelte": "^0.2.19"
}, },
"type": "module" "type": "module"
} }
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { toast as showToast } from '$lib/components/ui/toasts/toasts.js' import { toast as showToast } from 'mono-svelte'
import { useRegisterSW } from 'virtual:pwa-register/svelte' import { useRegisterSW } from 'virtual:pwa-register/svelte'
const { needRefresh, updateServiceWorker, offlineReady } = useRegisterSW({ const { needRefresh, updateServiceWorker, offlineReady } = useRegisterSW({
onRegistered(r) { onRegistered(r) {
+1 -1
View File
@@ -1,5 +1,5 @@
import { amModOfAny } from '$lib/components/lemmy/moderation/moderation.js' import { amModOfAny } from '$lib/components/lemmy/moderation/moderation.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { DEFAULT_INSTANCE_URL, instance } from '$lib/instance.js' import { DEFAULT_INSTANCE_URL, instance } from '$lib/instance.js'
import { getClient, site } from '$lib/lemmy.js' import { getClient, site } from '$lib/lemmy.js'
import { getInbox, getInboxItemPublished } from '$lib/lemmy/inbox.js' import { getInbox, getInboxItemPublished } from '$lib/lemmy/inbox.js'
-163
View File
@@ -1,163 +0,0 @@
<script lang="ts">
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { Icon, type IconSource } from 'svelte-hero-icons'
type ButtonColor = keyof typeof buttonColor
type ButtonSize = keyof typeof buttonSize
type ButtonRoundness = keyof typeof buttonRoundness
type ButtonAlignment = keyof typeof buttonAlignment
const buttonAlignment = {
left: 'justify-start text-left',
center: 'justify-center text-center',
right: 'justify-end text-right',
}
const buttonColor = {
primary: `border border-slate-900 bg-slate-900 dark:bg-zinc-100
dark:border-zinc-100 dark:text-black hover:text-inherit hover:dark:text-inherit text-slate-100
hover:bg-transparent hover:dark:bg-transparent
active:bg-black/10 active:dark:bg-white/10`,
secondary: `border border-slate-200 dark:border-zinc-700 dark:bg-zinc-900
hover:bg-slate-100 hover:dark:bg-zinc-800 hover:dark:border-zinc-700 dark:text-zinc-400 hover:text-inherit
hover:dark:text-inherit`,
tertiary:
'border border-transparent bg-transparent hover:bg-slate-100 hover:dark:bg-zinc-800 dark:text-zinc-200',
danger:
'border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white',
ghost: `border border-slate-200 dark:border-zinc-800 bg-transparent
hover:bg-slate-100 hover:dark:bg-zinc-800 hover:dark:border-zinc-700 dark:text-zinc-400 hover:text-inherit
hover:dark:text-inherit`,
elevated: `bg-slate-100 dark:bg-zinc-800 border border-slate-200
dark:border-zinc-700 hover:bg-slate-200 hover:dark:bg-zinc-700 hover:border-slate-300
hover:dark:border-zinc-600`,
elevatedLow: `bg-slate-100 dark:bg-zinc-900 border border-slate-200
dark:border-zinc-800 hover:bg-slate-200 hover:dark:bg-zinc-800 hover:border-slate-300
hover:dark:border-zinc-700`,
none: '',
}
const buttonSize = {
sm: 'px-2 py-1',
md: 'px-3 py-1.5',
lg: 'px-4 py-2',
'square-sm': 'w-6 h-6',
'square-md': 'w-8 h-8',
'square-lg': 'w-10 h-10',
}
const buttonRoundness = {
pill: 'rounded-full',
lg: 'rounded-lg',
md: 'rounded-md',
none: '',
}
export let loading = false
export let submit = false
export let color: ButtonColor = 'secondary'
export let size: ButtonSize = 'md'
export let rounded: ButtonRoundness = 'md'
export let alignment: ButtonAlignment = 'center'
export let icon: IconSource | undefined = undefined
export let loaderWidth: number | undefined = undefined
// const dispatch = createEventDispatcher()
export let href: string | undefined = undefined
</script>
{#if href}
<a
{href}
on:click
{...$$restProps}
class="
{buttonColor[color]}
{buttonSize[size]}
{buttonRoundness[rounded]}
text-sm transition-colors disabled:!opacity-70 disabled:!pointer-events-none
disabled:!border disabled:!border-slate-300 disabled:!bg-slate-200 disabled:dark:!border-zinc-700 disabled:dark:!bg-zinc-800
{$$props.class}
{loading
? color == 'primary'
? '!bg-transparent !text-inherit'
: ''
: ''}"
>
<div
class="flex flex-row items-center gap-1.5 h-full {buttonAlignment[
alignment
]}"
>
{#if loading}
<Spinner
width={loaderWidth
? loaderWidth
: size == 'lg'
? 20
: size == 'md'
? 18
: size == 'sm'
? 16
: 16}
/>
{:else if $$slots.icon}
<slot name="icon" />
{:else if icon}
<Icon src={icon} size="16" mini />
{/if}
<slot />
</div>
</a>
{:else}
<button
{...$$restProps}
on:click
class="
{buttonColor[color]}
{buttonSize[size]}
{buttonRoundness[rounded]}
text-sm transition-colors disabled:!opacity-70 disabled:!pointer-events-none
disabled:!border disabled:!border-slate-300 disabled:!bg-slate-200
disabled:dark:!border-zinc-700 disabled:dark:!bg-zinc-800 disabled:text-inherit
{$$props.class}
{loading
? color == 'primary'
? '!bg-transparent !text-inherit'
: ''
: ''}"
type={submit ? 'submit' : 'button'}
>
<div
class="flex flex-row items-center gap-1.5 {buttonAlignment[alignment]}"
>
{#if loading}
<Spinner
width={loaderWidth
? loaderWidth
: size == 'lg'
? 20
: size == 'md'
? 18
: size == 'sm'
? 16
: 16}
/>
{:else if $$slots.icon}
<slot name="icon" />
{:else if icon}
<Icon src={icon} size="16" mini />
{/if}
<slot />
</div>
</button>
{/if}
-16
View File
@@ -1,16 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
export let defaultValue: boolean = false
export let checked: boolean | undefined = defaultValue
const dispatcher = createEventDispatcher<{ change: boolean }>()
</script>
<label class="flex flex-row gap-2 cursor-pointer text-sm">
<input
type="checkbox"
bind:checked
on:change={() => dispatcher('change', !checked)}
/>
<slot />
</label>
-53
View File
@@ -1,53 +0,0 @@
<script lang="ts">
import { DocumentPlus, Icon } from 'svelte-hero-icons'
export let accept = 'image/*,video/*'
export let multiple = false
export let files: FileList | null | undefined = null
export let image = false
export let label: string | undefined = undefined
let previewURL = ''
let dragover = false
$: if (files) {
previewURL = URL.createObjectURL(files[0])
}
</script>
<div>
{#if label}
<span class="block my-1 text-sm font-bold">{label}</span>
{/if}
<label
class="flex flex-col items-center px-8 py-4 mx-auto w-full rounded-lg
border border-slate-300 dark:border-zinc-700 bg-white dark:bg-black
cursor-pointer min-h-36 transition-colors {dragover
? 'border-sky-500 text-sky-500'
: ''}
"
on:drop|preventDefault={(event) => (files = event.dataTransfer?.files)}
on:dragover|preventDefault={(event) => {
if (event.dataTransfer) {
event.dataTransfer.dropEffect = 'copy'
dragover = true
}
}}
on:dragleave|preventDefault={() => (dragover = false)}
>
{#if image && files}
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={previewURL}
on:load={() => {
if (previewURL) URL.revokeObjectURL(previewURL)
}}
class="w-full max-w-sm h-full rounded-lg"
/>
{:else}
<Icon src={DocumentPlus} class="opacity-50" size="36" />
<p class="text-sm opacity-50">Attach a file</p>
{/if}
<input type="file" bind:files {accept} class="hidden" {multiple} />
</label>
</div>
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { ChevronDown, Icon } from 'svelte-hero-icons' import { ChevronDown, Icon } from 'svelte-hero-icons'
import { Button } from 'mono-svelte'
import Button from '$lib/components/input/Button.svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
type T = $$Generic type T = $$Generic
export let options: T[] export let options: T[]
@@ -1,60 +0,0 @@
<script lang="ts">
import TextInput from '$lib/components/input/TextInput.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { createEventDispatcher } from 'svelte'
export let query: string
export let debounceTime: number = 300
type T = $$Generic
export let options: T[]
export let extractSelected: (item: T | null) => any
export let extractName: (item: T) => string
export let showWhenEmpty: boolean = false
let canSearch: boolean = false
export { canSearch as searchOnMount }
const debounce = (fn: Function, ms = 300) => {
let timeoutId: ReturnType<typeof setTimeout>
return function (this: any, ...args: any[]) {
clearTimeout(timeoutId)
timeoutId = setTimeout(() => fn.apply(this, args), ms)
}
}
const dispatcher = createEventDispatcher<{ search: string }>()
const debounceFunc = debounce(() => {
canSearch = true
dispatcher('search', query)
}, debounceTime)
</script>
<div class="relative">
<TextInput
bind:value={query}
on:input={() => {
extractSelected(null)
debounceFunc()
}}
{...$$restProps}
/>
<Menu
open={(options.length != 0 || showWhenEmpty) && canSearch}
alignment="bottom-left"
>
{#if query == '' && showWhenEmpty}
<slot {extractName} {extractSelected} {query} />
{:else}
{#each options as option}
<slot {extractName} {extractSelected} {option} {query}>
<MenuButton on:click={() => extractSelected(option)}>
{extractName(option)}
</MenuButton>
</slot>
{/each}
{/if}
</Menu>
</div>
@@ -1,43 +0,0 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import type { Alignment } from '$lib/components/ui/menu/menu.js'
import { createEventDispatcher } from 'svelte'
type T = $$Generic
export let options: T[]
export let optionNames: string[] = []
export let selected: T
export let label: string | undefined = undefined
export let alignment: Alignment = 'bottom-left'
let open = false
const dispatcher = createEventDispatcher<{ select: T }>()
</script>
{#if label}
<div class="block font-bold text-sm w-max">{label}</div>
{/if}
<Menu let:toggleOpen {alignment}>
<div slot="button" class="w-max relative">
<Button on:click={toggleOpen} color="secondary">
<slot>
{optionNames[options.findIndex((o) => selected == o)] || selected}
</slot>
</Button>
</div>
{#each options as option, index}
<MenuButton
on:click={() => {
selected = option
dispatcher('select', option)
}}
>
{optionNames[index] || option}
</MenuButton>
{/each}
</Menu>
-28
View File
@@ -1,28 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
export let enabled = false
const dispatcher = createEventDispatcher<{ change: boolean }>()
</script>
<label>
<div
class="relative w-10 border-2 h-6 transition-colors cursor-pointer
rounded-full flex flex-row items-center {enabled
? 'bg-blue-500 border-blue-500'
: 'bg-slate-200 dark:bg-zinc-800 border-slate-200 dark:border-zinc-800'}"
>
<div
class="w-5 h-5 rounded-full transition-transform
bg-white dark:bg-zinc-700 {enabled ? 'translate-x-4' : 'translate-x-0'}"
/>
</div>
<input
type="checkbox"
bind:checked={enabled}
class="hidden"
on:input={(e) => {
dispatcher('change', !enabled)
}}
/>
</label>
-42
View File
@@ -1,42 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
export let label: string = ''
export let placeholder: string = ''
export let value: string = ''
export let maxlength: number = -1
export let rows: number = 3
export let required: boolean = false
export let item: any = undefined
let clazz = ''
export { clazz as class }
const dispatcher = createEventDispatcher()
</script>
<label class="flex flex-col items-center {clazz}">
{#if label != ''}
<span
class="font-bold text-sm text-left mb-1 cursor-pointer w-max self-start"
>
{label}
{#if required}
<span class="font-bold text-red-500">*</span>
{/if}
</span>
{/if}
<textarea
bind:value
bind:this={item}
on:input={(e) => dispatcher('input', e)}
on:keydown
{placeholder}
{maxlength}
{rows}
class="w-full px-3 text-sm py-2.5 bg-white dark:bg-black
border border-slate-300 dark:border-zinc-700 dark:focus:border-white
focus:outline-none focus:border-black transition-colors rounded-md {clazz}"
{...$$restProps}
/>
</label>
-48
View File
@@ -1,48 +0,0 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
export let label: string | number | undefined = ''
export let type: 'text' | 'password' | 'email' | 'number' | null | undefined =
'text'
export let value: string = ''
export let required = false
function typeAction(node: Node) {
// @ts-ignore
node.type = type
}
const dispatcher = createEventDispatcher()
let className = `
${value.length != 0 ? 'invalid:border-red-400' : ''}
w-full px-3 text-sm py-2.5 bg-white dark:bg-zinc-950
border border-slate-300 dark:border-zinc-700 dark:focus:border-white
focus:outline-none focus:border-black transition-colors rounded-md disabled:bg-slate-200 disabled:border-slate-300 dark:disabled:border-zinc-600 dark:disabled:bg-zinc-700 disabled:opacity-70
${$$props.class}
`
</script>
<label class="flex flex-col items-center {$$props.class}">
{#if label != ''}
<span
class="font-bold text-sm text-left mb-1 cursor-pointer w-max self-start"
>
{label}
{#if required}
<span class="text-red-500">*</span>
{/if}
</span>
{/if}
<input
use:typeAction
bind:value
on:keydown={(e) => dispatcher('keydown', e)}
on:input={(e) => dispatcher('input', e)}
on:change={(e) => dispatcher('change', e)}
on:focus
{...$$restProps}
class={className}
{required}
/>
</label>
@@ -1,31 +1,25 @@
<script lang="ts"> <script lang="ts">
import SearchInput from '$lib/components/input/SearchInput.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { Community, ListingType } from 'lemmy-js-client' import type { Community, ListingType } from 'lemmy-js-client'
import { MenuButton, Search } from 'mono-svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import { Icon, XCircle } from 'svelte-hero-icons' import { Icon, XCircle } from 'svelte-hero-icons'
import { fly } from 'svelte/transition'
let type: 'community' = 'community' let type: 'community' = 'community'
export let q: string = '' export let q: string = ''
export let jwt: string | undefined = undefined export let jwt: string | undefined = undefined
export let listing_type: ListingType = 'Subscribed' export let listing_type: ListingType = 'Subscribed'
export let items: Community[] | undefined = undefined
export let showWhenEmpty: boolean = false export let showWhenEmpty: boolean = false
let showNone: boolean = false
const dispatcher = createEventDispatcher<{ select: Community }>() const dispatcher = createEventDispatcher<{ select: Community | undefined }>()
</script> </script>
{#if type == 'community'} {#if type == 'community'}
<SearchInput <Search
options={items || []} search={async (q) => {
on:search={async () => {
if (q == '') showNone = true
else showNone = false
const results = await getClient().search({ const results = await getClient().search({
q: q || ' ', q: q || ' ',
auth: jwt, auth: jwt,
@@ -35,38 +29,38 @@
sort: 'TopAll', sort: 'TopAll',
}) })
items = results.communities.map((c) => c.community) return results.communities.map((c) => c.community)
}} }}
debounceTime={600} extractName={(c) => `${c.title}@${new URL(c.actor_id).hostname}`}
extractName={(c) => c.title} on:select
bind:query={q} bind:q
extractSelected={(c) => {
if (c) dispatcher('select', c)
}}
let:extractName
let:extractSelected
let:option
{showWhenEmpty} {showWhenEmpty}
{...$$restProps} {...$$restProps}
let:query let:item
let:select
> >
{#if query == '' && showWhenEmpty} <div class="w-full h-full" slot="noresults">
<MenuButton on:click={() => dispatcher('select', undefined)}> {#if q == '' && showWhenEmpty}
<Icon src={XCircle} size="16" mini /> <MenuButton on:click={() => dispatcher('select', undefined)}>
<Icon src={XCircle} size="16" mini />
<div class="flex flex-col text-left">
<span>None</span>
</div>
</MenuButton>
{:else}
<span class="mx-auto my-auto">No results.</span>
{/if}
</div>
<div in:fly|global={{ y: -4, opacity: 0 }}>
<MenuButton on:click={() => select(item)}>
<Avatar url={item.icon} alt={item.title} width={24} />
<div class="flex flex-col text-left"> <div class="flex flex-col text-left">
<span>None</span> <span>{item.title}</span>
</div>
</MenuButton>
{:else if option}
<MenuButton on:click={() => extractSelected(option)}>
<Avatar url={option.icon} alt={option.title} width={24} />
<div class="flex flex-col text-left">
<span>{option.title}</span>
<span class="text-xs opacity-80"> <span class="text-xs opacity-80">
{new URL(option.actor_id).hostname} {new URL(item.actor_id).hostname}
</span> </span>
</div> </div>
</MenuButton> </MenuButton>
{/if} </div>
</SearchInput> </Search>
{/if} {/if}
+1 -1
View File
@@ -1,5 +1,4 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte' import StickyCard from '$lib/components/ui/StickyCard.svelte'
@@ -7,6 +6,7 @@
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { SiteView, Tagline } from 'lemmy-js-client' import type { SiteView, Tagline } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { import {
Calendar, Calendar,
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
+53 -44
View File
@@ -1,52 +1,61 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores' import { page } from '$app/stores'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import MultiSelect from '../input/MultiSelect.svelte' import { Select } from 'mono-svelte'
import { ChartBar, Clock, Icon } from 'svelte-hero-icons'
import { fly } from 'svelte/transition'
export let selected: string export let selected: string
export let navigate: boolean = true export let navigate: boolean = true
let sort: string = selected.startsWith('Top') ? 'TopAll' : selected
const setSelected = () => (selected = sort)
</script> </script>
<MultiSelect <div class="flex flex-row gap-4 flex-wrap">
options={[ {#if selected?.startsWith('Top')}
'Active', <div transition:fly={{ x: 4 }}>
'Hot', <Select
'TopAll', bind:value={selected}
'New', on:change={(e) => {
'Old', sort = 'TopAll'
'TopNineMonths', if (navigate) searchParam($page.url, 'sort', selected, 'page')
'TopSixMonths', }}
'TopThreeMonths', >
'TopMonth', <span slot="label" class="flex items-center gap-1">
'TopWeek', <Icon src={Clock} size="16" mini />
'TopDay', Time
'TopTwelveHour', </span>
'TopSixHour', <option value="TopAll">All</option>
'TopHour', <option value="TopNineMonths">9 Months</option>
'MostComments', <option value="TopSixMonths">6 Months</option>
'NewComments', <option value="TopThreeMonths">3 Months</option>
]} <option value="TopMonth">Month</option>
optionNames={[ <option value="TopWeek">Week</option>
'Active', <option value="TopDay">Day</option>
'Hot', <option value="TopTwelveHour">12 Hours</option>
'Top', <option value="TopSixHour">6 Hours</option>
'New', <option value="TopHour">Hour</option>
'Old', </Select>
'Top 9 Months', </div>
'Top 6 Months', {/if}
'Top 3 Months', <Select
'Top Month', bind:value={sort}
'Top Week', on:change={(e) => {
'Top Day', setSelected()
'Top 12 Hours', if (navigate) searchParam($page.url, 'sort', selected, 'page')
'Top 6 Hours', }}
'Top Hour', >
'Most Comments', <span slot="label" class="flex items-center gap-1">
'New Comments', <Icon src={ChartBar} size="14" mini />
]} Sort
bind:selected </span>
on:select={(e) => { <option value="Active">Active</option>
if (navigate) searchParam($page.url, 'sort', e.detail, 'page') <option value="Hot">Hot</option>
}} <option value="TopAll">Top</option>
class="w-full" <option value="New">New</option>
/> <option value="Old">Old</option>
<option value="MostComments">Most Comments</option>
<option value="NewComments">New Comments</option>
</Select>
</div>
@@ -0,0 +1,18 @@
<script lang="ts">
import { userSettings } from '$lib/settings.js'
import { Select } from 'mono-svelte'
import { Icon, ViewColumns } from 'svelte-hero-icons'
let value = `${$userSettings.showCompactPosts}`
$: $userSettings.showCompactPosts = value == 'true'
</script>
<Select bind:value>
<span slot="label" class="flex items-center gap-1">
<Icon src={ViewColumns} size="14" mini />
View
</span>
<option value="true">List</option>
<option value="false">Cards</option>
</Select>
@@ -14,12 +14,10 @@
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte' import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { slide } from 'svelte/transition' import { Button, Modal } from 'mono-svelte'
import Button from '$lib/components/input/Button.svelte'
export let node: CommentNodeI export let node: CommentNodeI
export let postId: number export let postId: number
@@ -1,15 +1,10 @@
<script lang="ts"> <script lang="ts">
import type { CommentView } from 'lemmy-js-client' import type { CommentView } from 'lemmy-js-client'
import CommentVote from '$lib/components/lemmy/comment/CommentVote.svelte' import CommentVote from '$lib/components/lemmy/comment/CommentVote.svelte'
import { page } from '$app/stores'
import { userSettings } from '$lib/settings.js'
import { Color } from '$lib/ui/colors.js'
import { import {
ArrowLeftCircle,
ArrowUturnLeft, ArrowUturnLeft,
Bookmark, Bookmark,
BookmarkSlash, BookmarkSlash,
ChatBubbleOvalLeft,
EllipsisHorizontal, EllipsisHorizontal,
Flag, Flag,
Icon, Icon,
@@ -17,11 +12,6 @@
Square2Stack, Square2Stack,
Trash, Trash,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { getClient, getInstance } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import Button from '$lib/components/input/Button.svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import { isCommentMutable } from '$lib/components/lemmy/post/helpers.js' import { isCommentMutable } from '$lib/components/lemmy/post/helpers.js'
import { import {
@@ -29,10 +19,10 @@
isAdmin, isAdmin,
report, report,
} from '$lib/components/lemmy/moderation/moderation.js' } from '$lib/components/lemmy/moderation/moderation.js'
import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte'
import CommentModerationMenu from '$lib/components/lemmy/moderation/CommentModerationMenu.svelte' import CommentModerationMenu from '$lib/components/lemmy/moderation/CommentModerationMenu.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { deleteItem, save } from '$lib/lemmy/contentview.js' import { deleteItem, save } from '$lib/lemmy/contentview.js'
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
export let comment: CommentView export let comment: CommentView
export let replying: boolean = false export let replying: boolean = false
@@ -58,17 +48,22 @@
{#if $profile?.user && (amMod($profile?.user, comment.community) || isAdmin($profile.user))} {#if $profile?.user && (amMod($profile?.user, comment.community) || isAdmin($profile.user))}
<CommentModerationMenu bind:item={comment} /> <CommentModerationMenu bind:item={comment} />
{/if} {/if}
<Menu let:toggleOpen class="top-0 leading-3" alignment="bottom-center"> <Menu origin="bottom-center">
<Button <Button
slot="button" slot="target"
on:click={toggleOpen}
class="!p-1" class="!p-1"
aria-label="Comment actions" aria-label="Comment actions"
color="ghost" color="ghost"
> >
<Icon src={EllipsisHorizontal} width={16} height={16} mini slot="icon" /> <Icon
src={EllipsisHorizontal}
width={16}
height={16}
mini
slot="prefix"
/>
</Button> </Button>
<span class="text-xs opacity-80 py-1 my-1 px-4">Comment actions</span> <MenuDivider>Actions</MenuDivider>
<MenuButton <MenuButton
on:click={() => { on:click={() => {
navigator.share?.({ navigator.share?.({
@@ -77,7 +72,7 @@
}} }}
> >
<Icon src={Square2Stack} mini size="16" /> <Icon src={Square2Stack} mini size="16" />
<span>Copy Link</span> <divv>Copy Link</divv>
</MenuButton> </MenuButton>
{#if $profile?.jwt} {#if $profile?.jwt}
{#if comment.creator.id == $profile.user?.local_user_view.person.id} {#if comment.creator.id == $profile.user?.local_user_view.person.id}
@@ -97,7 +92,7 @@
</MenuButton> </MenuButton>
{#if $profile?.user && $profile.jwt && isCommentMutable(comment, $profile.user.local_user_view)} {#if $profile?.user && $profile.jwt && isCommentMutable(comment, $profile.user.local_user_view)}
<MenuButton <MenuButton
color="dangerSecondary" color="danger-subtle"
on:click={async () => { on:click={async () => {
if ($profile?.jwt) if ($profile?.jwt)
comment.comment.deleted = await deleteItem( comment.comment.deleted = await deleteItem(
@@ -112,7 +107,7 @@
</MenuButton> </MenuButton>
{/if} {/if}
{#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id} {#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id}
<MenuButton on:click={() => report(comment)} color="dangerSecondary"> <MenuButton on:click={() => report(comment)} color="danger-subtle">
<Icon src={Flag} mini size="16" /> <Icon src={Flag} mini size="16" />
<span>Report</span> <span>Report</span>
</MenuButton> </MenuButton>
@@ -1,16 +1,14 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import { Color } from '$lib/ui/colors.js'
import type { CommentResponse } from 'lemmy-js-client' import type { CommentResponse } from 'lemmy-js-client'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { placeholders } from '$lib/util.js' import { placeholders } from '$lib/util.js'
import { Button } from 'mono-svelte'
export let postId: number export let postId: number
export let parentId: number | undefined = undefined export let parentId: number | undefined = undefined
@@ -75,30 +73,23 @@
bind:value bind:value
disabled={locked || loading} disabled={locked || loading}
on:confirm={submit} on:confirm={submit}
/> previewButton={previewAction}
{/if} >
{#if actions || previewAction}
<div class="flex flex-row items-center justify-between">
{#if previewAction}
<MultiSelect
options={[false, true]}
optionNames={['Edit', 'Preview']}
bind:selected={preview}
/>
{/if}
{#if actions} {#if actions}
<Button <div class="ml-auto">
large <Button
on:click={submit} large
color="primary" on:click={submit}
size="lg" color="primary"
class="sm:ml-auto w-28" size="lg"
{loading} class="sm:ml-auto w-28"
disabled={locked || loading} {loading}
> disabled={locked || loading}
Submit >
</Button> Submit
</Button>
</div>
{/if} {/if}
</div> </MarkdownEditor>
{/if} {/if}
</div> </div>
@@ -1,15 +1,14 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import Card from '$lib/components/ui/Card.svelte'
import { getInstance } from '$lib/lemmy.js' import { getInstance } from '$lib/lemmy.js'
import type { CommentView } from 'lemmy-js-client' import type { CommentView } from 'lemmy-js-client'
import { Button, Material } from 'mono-svelte'
export let comment: CommentView export let comment: CommentView
</script> </script>
<Card class="flex flex-col bg-white rounded-md p-5 flex-1 gap-1"> <Material class="flex flex-col flex-1 gap-1" color="distinct" padding="lg">
<div class="flex flex-row justify-between items-center"> <div class="flex flex-row justify-between items-center">
<PostMeta <PostMeta
community={comment.community} community={comment.community}
@@ -42,4 +41,4 @@
replying={false} replying={false}
/> />
</div> </div>
</Card> </Material>
@@ -10,8 +10,8 @@
import { getClient } from '$lib/lemmy' import { getClient } from '$lib/lemmy'
import { userSettings } from '$lib/settings' import { userSettings } from '$lib/settings'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte'
export let vote: number = 0 export let vote: number = 0
export let score: number export let score: number
@@ -3,13 +3,13 @@
import { buildCommentsTree, type CommentNodeI } from './comments' import { buildCommentsTree, type CommentNodeI } from './comments'
import { page } from '$app/stores' import { page } from '$app/stores'
import { onMount, setContext } from 'svelte' import { onMount, setContext } from 'svelte'
import Button from '$lib/components/input/Button.svelte'
import { ChevronDown, Icon, Plus, PlusCircle } from 'svelte-hero-icons' import { ChevronDown, Icon, Plus, PlusCircle } from 'svelte-hero-icons'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { CommentView, Post } from 'lemmy-js-client' import type { CommentView, Post } from 'lemmy-js-client'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
export let nodes: CommentNodeI[] export let nodes: CommentNodeI[]
export let isParent: boolean export let isParent: boolean
@@ -131,7 +131,7 @@
fetchChildren(node).then(() => (node.loading = false)) fetchChildren(node).then(() => (node.loading = false))
}} }}
> >
<Icon src={Plus} width={18} mini slot="icon" /> <Icon src={Plus} width={18} mini slot="prefix" />
{node.comment_view.counts.child_count} more {node.comment_view.counts.child_count} more
</Button> </Button>
</button> </button>
@@ -1,18 +1,17 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import { amMod } from '$lib/components/lemmy/moderation/moderation.js' import { amMod } from '$lib/components/lemmy/moderation/moderation.js'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Card from '$lib/components/ui/Card.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte' import StickyCard from '$lib/components/ui/StickyCard.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js' import { addSubscription } from '$lib/lemmy/user.js'
import { fullCommunityName } from '$lib/util.js' import { fullCommunityName } from '$lib/util.js'
import type { CommunityView } from 'lemmy-js-client' import type { CommunityView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { import {
Calendar, Calendar,
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
@@ -117,7 +116,7 @@
size="lg" size="lg"
disabled={community_view.community.posting_restricted_to_mods} disabled={community_view.community.posting_restricted_to_mods}
> >
<Icon src={PencilSquare} mini size="16" slot="icon" /> <Icon src={PencilSquare} mini size="16" slot="prefix" />
Create Post Create Post
</Button> </Button>
<Button <Button
@@ -131,7 +130,7 @@
src={community_view.subscribed == 'Subscribed' ? Minus : Plus} src={community_view.subscribed == 'Subscribed' ? Minus : Plus}
mini mini
size="16" size="16"
slot="icon" slot="prefix"
/> />
{community_view.subscribed == 'Subscribed' || {community_view.subscribed == 'Subscribed' ||
community_view.subscribed == 'Pending' community_view.subscribed == 'Pending'
@@ -156,7 +155,7 @@
)}/settings" )}/settings"
size="square-md" size="square-md"
> >
<Icon src={Cog6Tooth} mini size="16" slot="icon" /> <Icon src={Cog6Tooth} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
{/if} {/if}
@@ -1,15 +1,11 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { ImageInput, toast } from 'mono-svelte'
import { getClient, uploadImage } from '$lib/lemmy.js' import { getClient, uploadImage } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js' import { addSubscription } from '$lib/lemmy/user.js'
import { Button, Checkbox, TextInput } from 'mono-svelte'
/** /**
* The community ID to edit. * The community ID to edit.
@@ -118,11 +114,11 @@
on:input={() => { on:input={() => {
formData.name = formData.name.toLowerCase().replaceAll(' ', '_') formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
}} }}
disabled={edit} disabled={edit != undefined}
/> />
<TextInput required label="Display name" bind:value={formData.displayName} /> <TextInput required label="Display name" bind:value={formData.displayName} />
<FileInput label="Icon" bind:files={formData.icon} image /> <ImageInput label="Icon" bind:files={formData.icon} />
<FileInput label="Banner" bind:files={formData.banner} image /> <ImageInput label="Banner" bind:files={formData.banner} />
<MarkdownEditor previewButton label="Sidebar" bind:value={formData.sidebar} /> <MarkdownEditor previewButton label="Sidebar" bind:value={formData.sidebar} />
<Checkbox bind:checked={formData.nsfw}>NSFW</Checkbox> <Checkbox bind:checked={formData.nsfw}>NSFW</Checkbox>
@@ -1,5 +1,4 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import type { CommunityView } from 'lemmy-js-client' import type { CommunityView } from 'lemmy-js-client'
import Subscribe from '../../../../routes/communities/Subscribe.svelte' import Subscribe from '../../../../routes/communities/Subscribe.svelte'
@@ -10,6 +9,7 @@
UserGroup, UserGroup,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte'
export let community: CommunityView export let community: CommunityView
</script> </script>
@@ -1,10 +1,8 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte' import { ImageInput, toast } from 'mono-svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { uploadImage } from '$lib/lemmy.js' import { uploadImage } from '$lib/lemmy.js'
import { Button, Modal } from 'mono-svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
export let open: boolean export let open: boolean
@@ -39,11 +37,7 @@
<Modal bind:open> <Modal bind:open>
<span slot="title">Upload image</span> <span slot="title">Upload image</span>
<form class="flex flex-col gap-4" on:submit|preventDefault={upload}> <form class="flex flex-col gap-4" on:submit|preventDefault={upload}>
<FileInput <ImageInput accept="image/jpeg,image/png,image/webp" bind:files={image} />
accept="image/jpeg,image/png,image/webp"
image
bind:files={image}
/>
<Button {loading} disabled={loading} submit color="primary" size="lg"> <Button {loading} disabled={loading} submit color="primary" size="lg">
Upload Upload
</Button> </Button>
@@ -1,15 +1,11 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import type { Community, Person, PersonView } from 'lemmy-js-client' import type { Community, Person, PersonView } from 'lemmy-js-client'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Checkbox from '$lib/components/input/Checkbox.svelte' import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
export let open = false export let open = false
let item: Person | undefined let item: Person | undefined
@@ -118,7 +114,7 @@
{banned ? 'Unbanning' : 'Banning'} from {banned ? 'Unbanning' : 'Banning'} from
<span class="font-bold">{community ? community.name : 'site'}</span> <span class="font-bold">{community ? community.name : 'site'}</span>
</p> </p>
<TextArea <MarkdownEditor
required required
bind:value={reason} bind:value={reason}
label="Reason" label="Reason"
@@ -127,7 +123,14 @@
: 'banning'} {item.name}?" : 'banning'} {item.name}?"
/> />
{#if !banned} {#if !banned}
<Checkbox bind:checked={deleteData}>Delete data</Checkbox> <Checkbox bind:checked={deleteData}>
Delete data
<svelte:fragment slot="description">
This will delete ALL of this user's posts and comments on this {community
? 'community'
: 'site'}.
</svelte:fragment>
</Checkbox>
<TextInput <TextInput
bind:value={expires} bind:value={expires}
label="Expires (UTC)" label="Expires (UTC)"
@@ -1,40 +1,32 @@
<script lang="ts"> <script lang="ts">
import { getClient } from '$lib/lemmy' import type { CommentView, PostView } from 'lemmy-js-client'
import type {
CommentView,
Community,
CommunityView,
PostView,
} from 'lemmy-js-client'
import { amMod, ban, isAdmin, remove } from './moderation' import { amMod, ban, isAdmin, remove } from './moderation'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { Fire, Icon, ShieldExclamation, Trash } from 'svelte-hero-icons' import { Fire, Icon, ShieldExclamation, Trash } from 'svelte-hero-icons'
import { Color } from '$lib/ui/colors.js'
import { isCommentView } from '$lib/lemmy/item.js' import { isCommentView } from '$lib/lemmy/item.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte' import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
export let item: PostView | CommentView export let item: PostView | CommentView
</script> </script>
<Menu let:toggleOpen alignment="bottom-center" class="top-0 h-[26px] w-[26px] "> <Menu origin="bottom-center" class="top-0 h-[26px] w-[26px] ">
<Button <Button
class="w-[26px] h-[26px] hover:!text-green-500 dark:text-zinc-400 text-slate-600" class="w-[26px] h-[26px] hover:!text-green-500 dark:text-zinc-400 text-slate-600"
size="square-md" size="square-md"
on:click={toggleOpen} slot="target"
slot="button"
color="ghost" color="ghost"
{...$$restProps} {...$$restProps}
> >
<ShieldIcon filled width={14} /> <ShieldIcon filled width={14} />
</Button> </Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))} {#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<li class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>
Moderation {#if (!item.community.local && !amMod($profile.user, item.community)) } (Instance Only) {/if} Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
</li> (Instance Only)
<MenuButton color="success" on:click={() => remove(item)}> {/if}
</MenuDivider>
<MenuButton color="success-subtle" on:click={() => remove(item)}>
<Icon src={Trash} size="16" mini /> <Icon src={Trash} size="16" mini />
{#if isCommentView(item)} {#if isCommentView(item)}
{item.comment.removed ? 'Restore' : 'Remove'} {item.comment.removed ? 'Restore' : 'Remove'}
@@ -43,11 +35,13 @@
{/if} {/if}
</MenuButton> </MenuButton>
{#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id} {#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>
User {#if (!item.community.local && !amMod($profile.user, item.community)) } (Instance Only) {/if} User {#if !item.community.local && !amMod($profile.user, item.community)}
</span> (Instance Only)
{/if}
</MenuDivider>
<MenuButton <MenuButton
color="dangerSecondary" color="danger-subtle"
on:click={() => on:click={() =>
ban(item.creator_banned_from_community, item.creator, item.community)} ban(item.creator_banned_from_community, item.creator, item.community)}
> >
@@ -60,11 +54,9 @@
{/if} {/if}
{#if $profile?.user && isAdmin($profile.user)} {#if $profile?.user && isAdmin($profile.user)}
<li class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>Admin</MenuDivider>
Admin <MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
</li> <Icon src={Fire} size="16" mini slot="prefix" />
<MenuButton color="dangerSecondary" on:click={() => remove(item, true)}>
<Icon src={Fire} size="16" mini slot="icon" />
Purge Purge
</MenuButton> </MenuButton>
{/if} {/if}
@@ -1,24 +1,20 @@
<script lang="ts"> <script lang="ts">
import { getClient } from '$lib/lemmy' import { getClient } from '$lib/lemmy'
import type { CommentView, Community, PostView } from 'lemmy-js-client' import type { CommentView, PostView } from 'lemmy-js-client'
import { amMod, ban, isAdmin, remove } from './moderation' import { amMod, ban, isAdmin, remove } from './moderation'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { import {
Fire, Fire,
Icon, Icon,
InformationCircle,
LockClosed, LockClosed,
LockOpen, LockOpen,
Megaphone, Megaphone,
ShieldExclamation, ShieldExclamation,
Trash, Trash,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { Color } from '$lib/ui/colors.js'
import { isCommentView, isPostView } from '$lib/lemmy/item.js' import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
export let item: PostView | CommentView export let item: PostView | CommentView
@@ -88,11 +84,10 @@
} }
</script> </script>
<Menu let:toggleOpen alignment="bottom-right"> <Menu origin="bottom-right">
<Button <Button
class="hover:text-green-500 dark:text-zinc-400 text-slate-500" class="hover:text-green-500 dark:text-zinc-400 text-slate-500"
on:click={toggleOpen} slot="target"
slot="button"
size="square-md" size="square-md"
loading={acting} loading={acting}
{...$$restProps} {...$$restProps}
@@ -103,7 +98,7 @@
viewBox="0 0 20 22" viewBox="0 0 20 22"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
slot="icon" slot="prefix"
> >
<path <path
fill-rule="evenodd" fill-rule="evenodd"
@@ -114,11 +109,13 @@
</svg> </svg>
</Button> </Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))} {#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>
Moderation {#if !item.community.local && !amMod($profile.user, item.community)} (Instance Only) {/if} Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
</span> (Instance Only)
{/if}
</MenuDivider>
<MenuButton <MenuButton
color="warning" color="warning-subtle"
on:click={() => lock(!item.post.locked)} on:click={() => lock(!item.post.locked)}
loading={locking} loading={locking}
disabled={locking} disabled={locking}
@@ -127,13 +124,13 @@
src={item.post.locked ? LockOpen : LockClosed} src={item.post.locked ? LockOpen : LockClosed}
size="16" size="16"
mini mini
slot="icon" slot="prefix"
/> />
{item.post.locked ? 'Unlock' : 'Lock'} {item.post.locked ? 'Unlock' : 'Lock'}
</MenuButton> </MenuButton>
<MenuButton <MenuButton
color="success" color="success-subtle"
on:click={() => on:click={() =>
pin(isPostView(item) ? !item.post.featured_community : false)} pin(isPostView(item) ? !item.post.featured_community : false)}
loading={pinning} loading={pinning}
@@ -149,7 +146,7 @@
{/if} {/if}
</div> </div>
</MenuButton> </MenuButton>
<MenuButton color="dangerSecondary" on:click={() => remove(item)}> <MenuButton color="danger-subtle" on:click={() => remove(item)}>
<Icon src={Trash} size="16" mini /> <Icon src={Trash} size="16" mini />
{#if isCommentView(item)} {#if isCommentView(item)}
{item.comment.removed ? 'Restore' : 'Remove'} {item.comment.removed ? 'Restore' : 'Remove'}
@@ -158,11 +155,13 @@
{/if} {/if}
</MenuButton> </MenuButton>
{#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id} {#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>
User {#if !item.community.local && !amMod($profile.user, item.community)} (Instance Only) {/if} User {#if !item.community.local && !amMod($profile.user, item.community)}
</span> (Instance Only)
{/if}
</MenuDivider>
<MenuButton <MenuButton
color="dangerSecondary" color="danger-subtle"
on:click={() => on:click={() =>
ban(item.creator_banned_from_community, item.creator, item.community)} ban(item.creator_banned_from_community, item.creator, item.community)}
> >
@@ -174,11 +173,9 @@
{/if} {/if}
{/if} {/if}
{#if $profile?.user && isAdmin($profile.user)} {#if $profile?.user && isAdmin($profile.user)}
<span class="px-4 py-1 my-1 text-xs text-slate-600 dark:text-zinc-400"> <MenuDivider>Admin</MenuDivider>
Admin
</span>
<MenuButton <MenuButton
color="success" color="success-subtle"
on:click={() => on:click={() =>
pin(isPostView(item) ? !item.post.featured_local : false, true)} pin(isPostView(item) ? !item.post.featured_local : false, true)}
> >
@@ -190,7 +187,7 @@
<span class="text-xs opacity-80">Instance</span> <span class="text-xs opacity-80">Instance</span>
</div> </div>
</MenuButton> </MenuButton>
<MenuButton color="dangerSecondary" on:click={() => remove(item, true)}> <MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
<Icon src={Fire} size="16" mini /> <Icon src={Fire} size="16" mini />
Purge Purge
</MenuButton> </MenuButton>
@@ -1,15 +1,11 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte' import { toast } from 'mono-svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { isCommentView, isPostView } from '$lib/lemmy/item.js' import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import type { CommentView, PostView } from 'lemmy-js-client' import type { CommentView, PostView } from 'lemmy-js-client'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { Fire, Icon, Trash } from 'svelte-hero-icons' import { Fire, Icon, Trash } from 'svelte-hero-icons'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
@@ -17,6 +13,7 @@
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { fullCommunityName } from '$lib/util.js' import { fullCommunityName } from '$lib/util.js'
import { amMod, isAdmin } from './moderation' import { amMod, isAdmin } from './moderation'
import { Button, Checkbox, Modal } from 'mono-svelte'
export let open: boolean export let open: boolean
export let item: PostView | CommentView | undefined = undefined export let item: PostView | CommentView | undefined = undefined
@@ -195,14 +192,14 @@
<Post actions={false} post={item} /> <Post actions={false} post={item} />
{/if} {/if}
<TextArea <MarkdownEditor
rows={3} rows={3}
label="Reason" label="Reason"
placeholder="Optional" placeholder="Optional"
bind:value={reason} bind:value={reason}
/> />
{#if !removed && ( amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))} {#if !removed && $profile?.user && (amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))}
<Checkbox bind:checked={commentReason}>Reply with reason</Checkbox> <Checkbox bind:checked={commentReason}>Reply with reason</Checkbox>
{#if commentReason} {#if commentReason}
@@ -227,7 +224,7 @@
disabled={loading} disabled={loading}
submit submit
> >
<Icon src={purge ? Fire : Trash} mini size="16" slot="icon" /> <Icon src={purge ? Fire : Trash} mini size="16" slot="prefix" />
{#if purge} {#if purge}
Purge Purge
{:else} {:else}
@@ -1,13 +1,12 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte' import { toast } from 'mono-svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { CommentView, PostView } from 'lemmy-js-client' import type { CommentView, PostView } from 'lemmy-js-client'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button, Modal } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
export let open: boolean export let open: boolean
export let item: PostView | CommentView | undefined = undefined export let item: PostView | CommentView | undefined = undefined
@@ -82,9 +81,9 @@
{/if} {/if}
</div> </div>
{/if} {/if}
<TextArea <MarkdownEditor
required required
rows={3} rows={4}
label="Reason" label="Reason"
placeholder="he's being a meanie :(" placeholder="he's being a meanie :("
bind:value={reason} bind:value={reason}
+9 -15
View File
@@ -1,15 +1,13 @@
<script lang="ts"> <script lang="ts">
import type { PostView } from 'lemmy-js-client' import type { PostView } from 'lemmy-js-client'
import { isImage } from '$lib/ui/image.js' import { isImage } from '$lib/ui/image.js'
import Card from '$lib/components/ui/Card.svelte'
import { getInstance } from '$lib/lemmy.js' import { getInstance } from '$lib/lemmy.js'
import PostActions from '$lib/components/lemmy/post/PostActions.svelte' import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte' import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { Material, toast } from 'mono-svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
export let post: PostView export let post: PostView
export let actions: boolean = true export let actions: boolean = true
@@ -19,7 +17,9 @@
let loaded = false let loaded = false
</script> </script>
<Card <Material
color="distinct"
padding="none"
class="flex flex-col max-w-full min-w-0 w-full gap-2.5 {compact class="flex flex-col max-w-full min-w-0 w-full gap-2.5 {compact
? '!bg-transparent !border-0 py-5' ? '!bg-transparent !border-0 py-5'
: 'p-5'}" : 'p-5'}"
@@ -43,7 +43,7 @@
/> />
<a <a
href="/post/{getInstance()}/{post.post.id}" href="/post/{getInstance()}/{post.post.id}"
class="font-medium max-w-full w-full break-words" class="font-medium max-w-full w-full break-words text-base"
style="word-break: break-word;" style="word-break: break-word;"
class:text-slate-500={post.read && $userSettings.markReadPosts} class:text-slate-500={post.read && $userSettings.markReadPosts}
class:dark:text-zinc-400={post.read && $userSettings.markReadPosts} class:dark:text-zinc-400={post.read && $userSettings.markReadPosts}
@@ -52,14 +52,6 @@
</a> </a>
</div> </div>
{#if !$userSettings.showCompactPosts} {#if !$userSettings.showCompactPosts}
{#if post.post.url && !post.post.thumbnail_url}
<a
href={post.post.url}
class="max-w-full overflow-hidden overflow-ellipsis whitespace-nowrap text-sky-400 hover:underline text-xs"
>
{post.post.url}
</a>
{/if}
{#if isImage(post.post.url)} {#if isImage(post.post.url)}
<!--disabled preloads here since most people will hover over every image while scrolling--> <!--disabled preloads here since most people will hover over every image while scrolling-->
<a <a
@@ -95,7 +87,9 @@
{:else if post.post.url} {:else if post.post.url}
<PostLink <PostLink
url={post.post.url} url={post.post.url}
thumbnail_url={post.post.thumbnail_url ? `${post.post.thumbnail_url}?format=webp&thumbnail=512` : undefined} thumbnail_url={post.post.thumbnail_url
? `${post.post.thumbnail_url}?format=webp&thumbnail=512`
: undefined}
nsfw={post.post.nsfw} nsfw={post.post.nsfw}
/> />
{/if} {/if}
@@ -152,4 +146,4 @@
/> />
</div> </div>
{/if} {/if}
</Card> </Material>
@@ -20,11 +20,7 @@
UserCircle, UserCircle,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import Button from '$lib/components/input/Button.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import { import {
amMod, amMod,
isAdmin, isAdmin,
@@ -32,11 +28,18 @@
} from '$lib/components/lemmy/moderation/moderation.js' } from '$lib/components/lemmy/moderation/moderation.js'
import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte' import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { deleteItem, markAsRead, save } from '$lib/lemmy/contentview.js' import { deleteItem, markAsRead, save } from '$lib/lemmy/contentview.js'
import { setSessionStorage } from '$lib/session.js' import { setSessionStorage } from '$lib/session.js'
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import {
Button,
Menu,
MenuButton,
MenuDivider,
Modal,
Spinner,
} from 'mono-svelte'
export let post: PostView export let post: PostView
@@ -76,6 +79,8 @@
<PostVote <PostVote
post={post.post} post={post.post}
bind:vote={post.my_vote} bind:vote={post.my_vote}
bind:upvotes={post.counts.upvotes}
bind:downvotes={post.counts.downvotes}
bind:score={post.counts.score} bind:score={post.counts.score}
/> />
@@ -85,7 +90,7 @@
class="!text-inherit h-8 px-3" class="!text-inherit h-8 px-3"
> >
<Icon <Icon
slot="icon" slot="prefix"
src={ChatBubbleOvalLeftEllipsis} src={ChatBubbleOvalLeftEllipsis}
mini mini
width={16} width={16}
@@ -102,27 +107,27 @@
{/await} {/await}
{/if} {/if}
<Button on:click={() => (debug = true)} size="square-md"> <Button on:click={() => (debug = true)} size="square-md">
<Icon src={BugAnt} mini size="16" slot="icon" /> <Icon src={BugAnt} mini size="16" slot="prefix" />
</Button> </Button>
{/if} {/if}
{#if $profile?.user && (amMod($profile.user, post.community) || isAdmin($profile.user))} {#if $profile?.user && (amMod($profile.user, post.community) || isAdmin($profile.user))}
<ModerationMenu bind:item={post} community={post.community} /> <ModerationMenu bind:item={post} community={post.community} />
{/if} {/if}
<Menu <Menu
alignment="bottom-right" origin="bottom-right"
containerClass="overflow-auto max-h-[400px]" containerClass="overflow-auto max-h-[400px]"
let:toggleOpen class="h-8"
targetClass="h-full"
> >
<Button <Button
slot="button" slot="target"
aria-label="Post actions" aria-label="Post actions"
on:click={toggleOpen} class="hover:text-inherit h-8"
class="hover:text-inherit"
size="square-md" size="square-md"
> >
<Icon slot="icon" src={EllipsisHorizontal} width={16} mini /> <Icon slot="prefix" src={EllipsisHorizontal} width={16} mini />
</Button> </Button>
<li class="mx-4 text-xs opacity-80 text-left my-1 py-1">Creator</li> <MenuDivider>Creator</MenuDivider>
<MenuButton <MenuButton
link link
href="/u/{post.creator.name}@{new URL(post.creator.actor_id).hostname}" href="/u/{post.creator.name}@{new URL(post.creator.actor_id).hostname}"
@@ -139,7 +144,7 @@
<span>{post.community.title}</span> <span>{post.community.title}</span>
</MenuButton> </MenuButton>
<hr class="w-[90%] mx-auto opacity-100 dark:opacity-10 my-2" /> <hr class="w-[90%] mx-auto opacity-100 dark:opacity-10 my-2" />
<li class="mx-4 text-xs opacity-80 text-left my-1 py-1">Actions</li> <MenuDivider>Actions</MenuDivider>
{#if $profile?.user && $profile?.jwt && $profile.user.local_user_view.person.id == post.creator.id} {#if $profile?.user && $profile?.jwt && $profile.user.local_user_view.person.id == post.creator.id}
<MenuButton on:click={() => (editing = true)}> <MenuButton on:click={() => (editing = true)}>
<Icon src={PencilSquare} width={16} mini /> <Icon src={PencilSquare} width={16} mini />
@@ -209,14 +214,14 @@
$profile.jwt $profile.jwt
) )
}} }}
color="dangerSecondary" color="danger-subtle"
> >
<Icon src={Trash} width={16} mini /> <Icon src={Trash} width={16} mini />
{post.post.deleted ? 'Restore' : 'Delete'} {post.post.deleted ? 'Restore' : 'Delete'}
</MenuButton> </MenuButton>
{/if} {/if}
{#if $profile.user?.local_user_view.person.id != post.creator.id} {#if $profile.user?.local_user_view.person.id != post.creator.id}
<MenuButton on:click={() => report(post)} color="dangerSecondary"> <MenuButton on:click={() => report(post)} color="danger-subtle">
<Icon src={Flag} width={16} mini /> <Icon src={Flag} width={16} mini />
Report Report
</MenuButton> </MenuButton>
@@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import type { PostView } from 'lemmy-js-client' import type { PostView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons' import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
@@ -24,7 +24,7 @@
description="There are no posts that match this filter." description="There are no posts that match this filter."
> >
<Button href="/communities"> <Button href="/communities">
<Icon src={Plus} size="16" mini slot="icon" /> <Icon src={Plus} size="16" mini slot="prefix" />
<span>Follow some communities</span> <span>Follow some communities</span>
</Button> </Button>
</Placeholder> </Placeholder>
@@ -33,7 +33,7 @@
{#each posts as post, index (post.post.id)} {#each posts as post, index (post.post.id)}
{#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)} {#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)}
<div <div
in:fly={{ in:fly|global={{
y: -8, y: -8,
duration: 500, duration: 500,
opacity: 0, opacity: 0,
+5 -10
View File
@@ -2,20 +2,15 @@
import { createEventDispatcher, onDestroy, onMount } from 'svelte' import { createEventDispatcher, onDestroy, onMount } from 'svelte'
import { getClient, uploadImage } from '$lib/lemmy.js' import { getClient, uploadImage } from '$lib/lemmy.js'
import type { Community, Post, PostView } from 'lemmy-js-client' import type { Community, Post, PostView } from 'lemmy-js-client'
import TextInput from '$lib/components/input/TextInput.svelte' import { toast } from 'mono-svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import Button from '$lib/components/input/Button.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import SearchInput from '$lib/components/input/SearchInput.svelte'
import { Check, Icon, Photo } from 'svelte-hero-icons' import { Check, Icon, Photo } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { placeholders } from '$lib/util.js' import { placeholders } from '$lib/util.js'
import Checkbox from '$lib/components/input/Checkbox.svelte' import { Checkbox, TextInput } from 'mono-svelte'
import { getSessionStorage, setSessionStorage } from '$lib/session.js' import { getSessionStorage, setSessionStorage } from '$lib/session.js'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte' import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
import { Button } from 'mono-svelte'
export let edit = false export let edit = false
@@ -190,7 +185,7 @@
bind:q={communitySearch} bind:q={communitySearch}
bind:items={communities} bind:items={communities}
jwt={$profile?.jwt} jwt={$profile?.jwt}
listing_type="All" listing_type="All"
on:select={(e) => { on:select={(e) => {
const c = e.detail const c = e.detail
if (!c) { if (!c) {
@@ -222,7 +217,7 @@
on:click={() => (uploadingImage = !uploadingImage)} on:click={() => (uploadingImage = !uploadingImage)}
style="width: 46px !important; height: 42px; padding: 0;" style="width: 46px !important; height: 42px; padding: 0;"
> >
<Icon src={Photo} size="18" mini slot="icon" /> <Icon src={Photo} size="18" mini slot="prefix" />
</Button> </Button>
</div> </div>
<MarkdownEditor <MarkdownEditor
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Badge from '$lib/components/ui/Badge.svelte' import { Badge } from 'mono-svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import type { Community, Person } from 'lemmy-js-client' import type { Community, Person } from 'lemmy-js-client'
@@ -68,16 +68,16 @@
<div class="flex flex-row ml-auto gap-2 flex-wrap"> <div class="flex flex-row ml-auto gap-2 flex-wrap">
{#if nsfw} {#if nsfw}
<Badge color="red">NSFW</Badge> <Badge color="red-subtle">NSFW</Badge>
{/if} {/if}
{#if saved} {#if saved}
<Badge label="Saved" color="yellow"> <Badge label="Saved" color="yellow-subtle">
<Icon src={Bookmark} mini size="12" /> <Icon src={Bookmark} mini size="12" />
Saved Saved
</Badge> </Badge>
{/if} {/if}
{#if locked} {#if locked}
<Badge label="Locked" color="yellow"> <Badge label="Locked" color="yellow-subtle">
<Icon src={LockClosed} mini size="14" /> <Icon src={LockClosed} mini size="14" />
Locked Locked
</Badge> </Badge>
@@ -89,7 +89,7 @@
</Badge> </Badge>
{/if} {/if}
{#if deleted} {#if deleted}
<Badge label="Deleted" color="red"> <Badge label="Deleted" color="red-subtle">
<Icon src={Trash} mini size="14" /> <Icon src={Trash} mini size="14" />
Deleted Deleted
</Badge> </Badge>
+54 -39
View File
@@ -1,12 +1,11 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { getClient } from '$lib/lemmy'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { Color } from '$lib/ui/colors.js'
import type { Post } from 'lemmy-js-client' import type { Post } from 'lemmy-js-client'
import { import {
ArrowDown,
ArrowDownCircle, ArrowDownCircle,
ArrowUp,
ArrowUpCircle, ArrowUpCircle,
ChevronDown, ChevronDown,
ChevronUp, ChevronUp,
@@ -14,9 +13,12 @@
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { vote as voteItem } from '$lib/lemmy/contentview.js' import { vote as voteItem } from '$lib/lemmy/contentview.js'
import { Button, Popover } from 'mono-svelte'
export let post: Post export let post: Post
export let vote: number = 0 export let vote: number = 0
export let upvotes: number = 0
export let downvotes: number = 0
export let score: number export let score: number
const voteColor = (vote: number) => const voteColor = (vote: number) =>
@@ -66,42 +68,55 @@
</Button> </Button>
</div> </div>
{:else} {:else}
<div <Popover targetClass="h-8" openOnHover>
class="flex items-center text-sm gap-1 rounded-md border border-slate-200 <div
dark:border-zinc-700 px-1 h-full duration-200 dark:bg-zinc-900" class="flex items-center text-sm gap-1 rounded-md border border-slate-200
> dark:border-zinc-700 px-1 h-8 duration-200 dark:bg-zinc-900"
<Button slot="target"
aria-label="Upvote"
class={vote == 1 ? voteColor(vote) : ''}
on:click={async () => {
if (!$profile?.jwt) return
score = await voteItem(post, vote == 1 ? 0 : 1, $profile.jwt)
vote = vote == 1 ? 0 : 1
}}
size="square-sm"
color="tertiary"
alignment="center"
> >
<Icon src={ChevronUp} mini size="18" /> <Button
</Button> aria-label="Upvote"
<span class={vote == 1 ? voteColor(vote) : ''}
class="font-medium transition-colors duration-200 {voteColor(vote)}" on:click={async () => {
> if (!$profile?.jwt) return
<FormattedNumber number={score} /> score = await voteItem(post, vote == 1 ? 0 : 1, $profile.jwt)
</span> vote = vote == 1 ? 0 : 1
<Button }}
aria-label="Downvote" size="square-sm"
class={vote == -1 ? voteColor(vote) : ''} color="tertiary"
on:click={async () => { alignment="center"
if (!$profile?.jwt) return >
score = await voteItem(post, vote == -1 ? 0 : -1, $profile.jwt) <Icon src={ChevronUp} mini size="18" />
vote = vote == -1 ? 0 : -1 </Button>
}} <span
size="square-sm" class="font-medium transition-colors duration-200 {voteColor(vote)}"
color="tertiary" >
> <FormattedNumber number={score} />
<Icon src={ChevronDown} mini size="18" /> </span>
</Button> <Button
</div> aria-label="Downvote"
class={vote == -1 ? voteColor(vote) : ''}
on:click={async () => {
if (!$profile?.jwt) return
score = await voteItem(post, vote == -1 ? 0 : -1, $profile.jwt)
vote = vote == -1 ? 0 : -1
}}
size="square-sm"
color="tertiary"
>
<Icon src={ChevronDown} mini size="18" />
</Button>
</div>
<div class="flex flex-row items-center gap-2">
<span class="flex items-center gap-1 text-blue-500 font-medium">
<Icon src={ArrowUp} mini size="18" />
<FormattedNumber number={upvotes} />
</span>
<span class="flex items-center gap-1 text-red-500 font-medium">
<Icon src={ArrowDown} mini size="18" />
<FormattedNumber number={downvotes} />
</span>
</div>
</Popover>
{/if} {/if}
</slot> </slot>
@@ -1,14 +1,10 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte' import { ImageInput, toast } from 'mono-svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { uploadImage } from '$lib/lemmy.js' import { uploadImage } from '$lib/lemmy.js'
import type { Community, Person } from 'lemmy-js-client' import { Button, Label, Modal, TextArea } from 'mono-svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import { import {
CodeBracket, CodeBracket,
@@ -105,7 +101,7 @@
<Modal bind:open={uploadingImage}> <Modal bind:open={uploadingImage}>
<span slot="title">Upload image</span> <span slot="title">Upload image</span>
<form class="flex flex-col gap-4" on:submit|preventDefault={upload}> <form class="flex flex-col gap-4" on:submit|preventDefault={upload}>
<FileInput image bind:files={image} /> <ImageInput bind:files={image} />
<Button {loading} disabled={loading} submit color="primary" size="lg"> <Button {loading} disabled={loading} submit color="primary" size="lg">
Upload Upload
</Button> </Button>
@@ -115,14 +111,19 @@
<div> <div>
{#if label} {#if label}
<div class="block my-1 font-bold text-sm">{label}</div> <Label>
{label}
</Label>
{/if} {/if}
<div <div
class="flex flex-col border border-slate-300 dark:border-zinc-800 rounded-md class="flex flex-col border border-slate-300 dark:border-zinc-800 rounded-md
overflow-hidden focus-within:border-black focus-within:dark:border-white transition-colors" overflow-hidden focus-within:border-black focus-within:dark:border-white transition-colors"
class:mt-1={label}
> >
{#if previewing} {#if previewing}
<div class="px-3 py-2.5 h-32 overflow-auto text-sm resize-y"> <div
class="px-3 py-2.5 h-32 overflow-auto text-sm resize-y bg-white dark:bg-zinc-950"
>
<Markdown source={beforePreview(value)} /> <Markdown source={beforePreview(value)} />
</div> </div>
{:else} {:else}
@@ -228,7 +229,7 @@ overflow-hidden focus-within:border-black focus-within:dark:border-white transit
</div> </div>
<!--Actual text area--> <!--Actual text area-->
<TextArea <TextArea
class="bg-inherit border-0 rounded-none" class="bg-inherit border-0 rounded-none !ring-0 focus:!ring-transparent !transition-none"
bind:value bind:value
bind:item={textArea} bind:item={textArea}
on:keydown={(e) => { on:keydown={(e) => {
@@ -246,14 +247,18 @@ overflow-hidden focus-within:border-black focus-within:dark:border-white transit
{...$$restProps} {...$$restProps}
/> />
{/if} {/if}
{#if $$slots.default || previewButton}
<div class="p-2 flex items-center w-full bg-white dark:bg-zinc-950">
{#if previewButton}
<MultiSelect
bind:selected={previewing}
options={[false, true]}
optionNames={['Edit', 'Preview']}
/>
{/if}
<slot />
</div>
{/if}
</div> </div>
{#if previewButton}
<div class="mt-2">
<MultiSelect
bind:selected={previewing}
options={[false, true]}
optionNames={['Edit', 'Preview']}
/>
</div>
{/if}
</div> </div>
-24
View File
@@ -1,24 +0,0 @@
<script lang="ts">
export let label: string = ''
const badgeColor = {
red: 'bg-red-200 dark:bg-red-900 text-red-800 dark:text-red-300',
green: 'bg-green-200 dark:bg-green-900 text-green-800 dark:text-green-300',
yellow:
'bg-yellow-200 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-300',
gray: 'bg-slate-200 dark:bg-zinc-800 text-gray-800 dark:text-gray-200',
}
type BadgeColor = keyof typeof badgeColor
export let color: BadgeColor = 'gray'
</script>
<span
class="px-2 py-0.5 rounded-full text-xs ml-auto font-bold flex items-center gap-1 {badgeColor[
color
]} {$$props.class}"
title={label}
>
<slot />
</span>
-28
View File
@@ -1,28 +0,0 @@
<script lang="ts">
type CardColor = 'default' | 'warning' | 'error'
export let cardColor: CardColor = 'default'
export let elevation: 0 | 1 = 1
const getColor = (color: CardColor) => {
switch (color) {
case 'default':
return elevation == 0
? 'border border-slate-200 dark:border-zinc-900 bg-slate-100 dark:bg-zinc-950'
: 'border border-slate-200 dark:border-zinc-800 bg-white dark:bg-zinc-900'
case 'warning':
return 'border border-yellow-300 dark:bg-yellow-950/30 dark:border-yellow-900 bg-yellow-50'
}
}
let clazz = ''
export { clazz as class }
</script>
<div
class="break-words
{getColor(cardColor)} rounded-lg {clazz}"
{...$$restProps}
>
<slot />
</div>
+32 -30
View File
@@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { profile, profileData, setUserID } from '$lib/auth.js' import { profile, profileData } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import Link from '$lib/components/input/Link.svelte' import Link from '$lib/components/input/Link.svelte'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte' import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import { import {
@@ -9,14 +8,18 @@
} from '$lib/components/lemmy/moderation/moderation.js' } from '$lib/components/lemmy/moderation/moderation.js'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Logo from '$lib/components/ui/Logo.svelte' import Logo from '$lib/components/ui/Logo.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { LINKED_INSTANCE_URL, instance } from '$lib/instance.js' import { LINKED_INSTANCE_URL, instance } from '$lib/instance.js'
import { site } from '$lib/lemmy.js' import { site } from '$lib/lemmy.js'
import { theme } from '$lib/ui/colors.js' import { theme } from '$lib/ui/colors.js'
import { import {
ArrowLeftOnRectangle, Button,
Menu,
MenuButton,
MenuDivider,
Select,
Spinner,
} from 'mono-svelte'
import {
Bars3, Bars3,
Bookmark, Bookmark,
Cog6Tooth, Cog6Tooth,
@@ -97,7 +100,7 @@
dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit
hover:bg-slate-200 relative hover:border-slate-300" hover:bg-slate-200 relative hover:border-slate-300"
> >
<Icon src={CommandLine} mini size="16" slot="icon" /> <Icon src={CommandLine} mini size="16" slot="prefix" />
<span class="hidden md:inline">Admin</span> <span class="hidden md:inline">Admin</span>
</Button> </Button>
{/if} {/if}
@@ -123,7 +126,7 @@
class="max-md:w-9 max-md:h-8 max-md:!p-0 class="max-md:w-9 max-md:h-8 max-md:!p-0
dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300" dark:text-zinc-300 text-slate-700 hover:text-inherit hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300"
> >
<Icon mini src={MagnifyingGlass} width={16} slot="icon" /> <Icon mini src={MagnifyingGlass} width={16} slot="prefix" />
<span class="hidden md:inline">Search</span> <span class="hidden md:inline">Search</span>
</Button> </Button>
<Button <Button
@@ -133,21 +136,20 @@
dark:text-zinc-300 text-slate-700 hover:text-inherit dark:text-zinc-300 text-slate-700 hover:text-inherit
hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300" hover:dark:text-inherit hover:bg-slate-200 hover:border-slate-300"
> >
<Icon mini src={GlobeAlt} size="16" slot="icon" /> <Icon mini src={GlobeAlt} size="16" slot="prefix" />
<span class="hidden md:inline">Explore</span> <span class="hidden md:inline">Explore</span>
</Button> </Button>
<Menu let:toggleOpen alignment="bottom-right"> <Menu origin="bottom-right" targetClass="h-8">
<Button <Button
color="primary" color="primary"
slot="button" slot="target"
aria-label="Create" aria-label="Create"
on:click={toggleOpen}
class="max-md:w-9 max-md:h-8 max-md:!p-0" class="max-md:w-9 max-md:h-8 max-md:!p-0"
> >
<Icon src={Plus} width={18} mini slot="icon" /> <Icon src={Plus} width={18} mini slot="prefix" />
<span class="hidden md:inline">Create</span> <span class="hidden md:inline">Create</span>
</Button> </Button>
<li class="text-xs opacity-80 text-left mx-4 my-1 py-1">Create</li> <MenuDivider>Create</MenuDivider>
<MenuButton <MenuButton
link link
href="/create/post" href="/create/post"
@@ -175,17 +177,16 @@
</Menu> </Menu>
</div> </div>
<Menu <Menu
let:toggleOpen origin="bottom-right"
alignment="bottom-right" itemsClass="h-8 md:h-8 z-10"
itemsClass="h-8 md:h-8" targetClass="z-10 h-8"
containerClass="!max-h-[28rem]" containerClass="!max-h-[28rem] z-10"
> >
<button <button
class="w-8 h-8 rounded-full ring-1 ring-slate-300 bg-slate-100 class="w-8 h-8 rounded-full ring-1 ring-slate-300 bg-slate-100
dark:bg-zinc-800 relative" dark:bg-zinc-800 relative"
aria-label="Profile" aria-label="Profile"
slot="button" slot="target"
on:click={toggleOpen}
> >
{#if $profile?.user} {#if $profile?.user}
<div class="w-8 h-8 aspect-square object-cover rounded-full"> <div class="w-8 h-8 aspect-square object-cover rounded-full">
@@ -206,9 +207,9 @@
</div> </div>
{/if} {/if}
</button> </button>
<li class="text-xs opacity-80 text-left mx-4 my-1 py-1"> <MenuDivider>
{$profile?.user ? $profile.user.local_user_view.person.name : 'Profile'} {$profile?.user ? $profile.user.local_user_view.person.name : 'Profile'}
</li> </MenuDivider>
{#if $profile?.user} {#if $profile?.user}
<MenuButton link href="/profile"> <MenuButton link href="/profile">
<Icon src={UserCircle} mini width={16} /> Profile <Icon src={UserCircle} mini width={16} /> Profile
@@ -238,7 +239,7 @@
</span> </span>
</MenuButton> </MenuButton>
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" /> <hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
<li class="text-xs px-4 py-1 my-1 opacity-80">App</li> <MenuDivider>App</MenuDivider>
<MenuButton link href="/settings"> <MenuButton link href="/settings">
<Icon src={Cog6Tooth} mini width={16} /> <Icon src={Cog6Tooth} mini width={16} />
Settings Settings
@@ -259,17 +260,18 @@
mini mini
size="16" size="16"
/> />
<div class="flex flex-row flex-wrap justify-between w-full"> <!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="flex flex-row flex-wrap justify-between w-full items-center"
on:click|stopPropagation
>
<span>Theme</span> <span>Theme</span>
<select <Select bind:value={$theme} class="ml-auto w-24" size="sm">
bind:value={$theme}
on:click|stopPropagation
class="ml-auto w-max px-1 rounded-sm cursor-pointer bg-transparent border dark:border-zinc-700"
>
<option value="system">System</option> <option value="system">System</option>
<option value="light">Light</option> <option value="light">Light</option>
<option value="dark">Dark</option> <option value="dark">Dark</option>
</select> </Select>
</div> </div>
</MenuButton> </MenuButton>
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" /> <hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte' import { Button } from 'mono-svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
export let page: number export let page: number
-47
View File
@@ -1,47 +0,0 @@
<div class="loading">
<div class="dot dot1" />
<div class="dot dot2" />
<div class="dot dot3" />
</div>
<style>
.loading {
display: flex;
justify-content: center;
align-items: center;
}
.dot {
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #555;
opacity: 0.3;
margin: 0px 1px;
animation: blink 750ms infinite;
}
.dot1 {
animation-delay: 0s;
}
.dot2 {
animation-delay: 0.2s;
}
.dot3 {
animation-delay: 0.4s;
}
@keyframes blink {
0% {
opacity: 0.3;
}
20% {
opacity: 1;
}
100% {
opacity: 0.3;
}
}
</style>
@@ -1,98 +0,0 @@
<script lang="ts">
export let width: number = 18
</script>
<div class="spinner" style="width: {width}px; height: {width}px;">
<div class="bar1" />
<div class="bar2" />
<div class="bar3" />
<div class="bar4" />
<div class="bar5" />
<div class="bar6" />
<div class="bar7" />
<div class="bar8" />
<div class="bar9" />
<div class="bar10" />
<div class="bar11" />
<div class="bar12" />
</div>
<style lang="postcss">
div.spinner {
position: relative;
display: inline-block;
border-radius: 10px;
}
div.spinner div {
width: 7.5%;
height: 22%;
position: absolute;
left: 49%;
top: 43%;
opacity: 0;
border-radius: 50px;
animation: fade 1s linear infinite;
@apply bg-black dark:bg-white;
}
@keyframes fade {
from {
opacity: 1;
}
to {
opacity: 0.25;
}
}
div.spinner div.bar1 {
transform: rotate(0deg) translate(0, -130%);
animation-delay: 0s;
}
div.spinner div.bar2 {
transform: rotate(30deg) translate(0, -130%);
animation-delay: -0.9167s;
}
div.spinner div.bar3 {
transform: rotate(60deg) translate(0, -130%);
animation-delay: -0.833s;
}
div.spinner div.bar4 {
transform: rotate(90deg) translate(0, -130%);
animation-delay: -0.7497s;
}
div.spinner div.bar5 {
transform: rotate(120deg) translate(0, -130%);
animation-delay: -0.667s;
}
div.spinner div.bar6 {
transform: rotate(150deg) translate(0, -130%);
animation-delay: -0.5837s;
}
div.spinner div.bar7 {
transform: rotate(180deg) translate(0, -130%);
animation-delay: -0.5s;
}
div.spinner div.bar8 {
transform: rotate(210deg) translate(0, -130%);
animation-delay: -0.4167s;
}
div.spinner div.bar9 {
transform: rotate(240deg) translate(0, -130%);
animation-delay: -0.333s;
}
div.spinner div.bar10 {
transform: rotate(270deg) translate(0, -130%);
animation-delay: -0.2497s;
}
div.spinner div.bar11 {
transform: rotate(300deg) translate(0, -130%);
animation-delay: -0.167s;
}
div.spinner div.bar12 {
transform: rotate(330deg) translate(0, -130%);
animation-delay: -0.0833s;
}
</style>
-79
View File
@@ -1,79 +0,0 @@
<script lang="ts">
import type { Alignment } from '$lib/components/ui/menu/menu.js'
import { backOut, bounceOut, circOut, expoOut, sineOut } from 'svelte/easing'
import { scale } from 'svelte/transition'
export let open = false
let clazz = ''
export { clazz as class }
export let itemsClass = ''
export let absolute = false
export let alignment: Alignment = 'bottom-left'
let element: any
export const toggleOpen = () => (open = !open)
function getOriginClass(origin: Alignment) {
switch (origin) {
case 'top-right':
return 'bottom-[100%] right-0 origin-bottom-right'
case 'bottom-left':
return 'top-[100%] origin-top-left'
case 'top-left':
return 'bottom-[100%] left-0 origin-bottom-left'
case 'bottom-right':
return 'top-[100%] right-0 origin-top-right'
case 'top-center':
return 'bottom-[100%] -left-[450%] origin-bottom'
case 'bottom-center':
return 'top-[100%] -left-[450%] origin-top'
default:
return 'bottom-[100%] origin-top-left'
}
}
</script>
<svelte:body
on:click={(e) => {
if (!element.contains(e.target)) {
open = false
}
}}
/>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="overflow-visible {absolute
? 'absolute'
: 'relative'} cursor-auto {clazz} {itemsClass}"
bind:this={element}
tabindex="-1"
>
<slot name="button" {toggleOpen} />
{#if open}
<menu
transition:scale|local={{
duration: 200,
start: 0.95,
easing: expoOut,
}}
class="list-none absolute max-h-96 z-30 overflow-auto {getOriginClass(
alignment
)}
rounded-lg py-2 min-w-[16rem] my-2 flex flex-col shadow-sm
bg-white dark:bg-zinc-900 backdrop-blur-2xl border border-slate-200 dark:border-zinc-800
{$$props.containerClass}"
>
{#if open}
<div on:click={toggleOpen} class="flex flex-col gap-0">
<slot {toggleOpen} />
</div>
{/if}
</menu>
{/if}
</div>
@@ -1,55 +0,0 @@
<script lang="ts">
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { Color } from '$lib/ui/colors'
import { createEventDispatcher } from 'svelte'
type ButtonColor = keyof typeof buttonColors
const buttonColors = {
secondary:
'hover:bg-neutral-200/50 hover:dark:bg-zinc-600/20 text-slate-800 fill-slate-800 dark:text-zinc-200 dark:fill-zinc-200',
dangerSecondary: 'hover:bg-red-500 text-red-500 hover:text-white',
success:
'hover:bg-green-600 text-green-600 dark:text-green-500 hover:text-white hover:dark:text-white',
warning:
'hover:bg-yellow-500 dark:text-yellow-300 text-yellow-600 hover:dark:text-black hover:text-black',
}
export let color: ButtonColor = 'secondary'
export let link = false
export let href = ''
export let loading = false
export let disabled = false
const click = createEventDispatcher()
</script>
<li>
{#if link}
<a
{href}
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm transition-colors {buttonColors[
color
]} {disabled ? 'opacity-50 pointer-events-none' : ''}"
>
<slot />
</a>
{:else}
<button
on:click={(e) => click('click', e)}
type="button"
class="flex flex-row gap-2 items-center px-4 py-2 w-full text-sm
transition-colors {buttonColors[
color
]} disabled:opacity-50 disabled:pointer-events-none"
{disabled}
>
{#if loading}
<Spinner width={16} />
{:else}
<slot name="icon" />
{/if}
<slot />
</button>
{/if}
</li>
-7
View File
@@ -1,7 +0,0 @@
export type Alignment =
| 'top-right'
| 'top-left'
| 'bottom-right'
| 'bottom-left'
| 'bottom-center'
| 'top-center'
-71
View File
@@ -1,71 +0,0 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Card from '$lib/components/ui/Card.svelte'
import { createEventDispatcher } from 'svelte'
import { Icon, XMark } from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import { fade, scale } from 'svelte/transition'
export let action: string | undefined = undefined
export let open = false
const dispatcher = createEventDispatcher()
</script>
{#if open}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="overflow-hidden fixed top-0 left-0 w-screen h-screen z-50
flex flex-col items-center justify-center bg-black/50 backdrop-blur-sm box-border p-4"
transition:fade={{ duration: 200 }}
on:click={() => (open = false)}
>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
transition:scale={{ start: 0.9, easing: expoOut }}
class="overflow-y-auto {$$props.class} rounded-xl max-w-full box-border w-full overscroll-contain"
>
<div
class="w-full dark:!bg-zinc-950 rounded-xl max-w-xl box-border mx-auto overscroll-contain"
on:click={() => {}}
>
<div
on:click|stopPropagation={() => {}}
class="p-6 rounded-xl flex flex-col gap-4 w-full dark:bg-zinc-950
bg-white border border-slate-200 dark:border-zinc-800"
class:rounded-b-none={action}
class:border-b-0={action}
>
<div class="flex flex-row max-w-full">
<h1 class="font-bold text-2xl w-max max-w-full">
<slot name="title" />
</h1>
<Button
size="square-md"
class="ml-auto"
on:click={() => (open = false)}
>
<Icon src={XMark} mini size="16" />
</Button>
</div>
<slot />
</div>
{#if action}
<div
class="border-x border-b bg-slate-100 dark:bg-zinc-900 dark:border-zinc-800 p-3 py-2 flex justify-end rounded-b-xl"
>
<slot name="action">
<Button
on:click={(e) => dispatcher('action', e)}
color="primary"
size="lg"
>
{action}
</Button>
</slot>
</div>
{/if}
</div>
</div>
</div>
{/if}
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import type { Community } from 'lemmy-js-client' import type { Community } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { flip } from 'svelte/animate' import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing' import { expoOut } from 'svelte/easing'
import { slide } from 'svelte/transition' import { slide } from 'svelte/transition'
@@ -27,7 +27,7 @@
alt={follow.name} alt={follow.name}
title={follow.title} title={follow.title}
width={20} width={20}
slot="icon" slot="prefix"
/> />
</div> </div>
<span class="max-w-full break-words" class:hidden={!expanded}> <span class="max-w-full break-words" class:hidden={!expanded}>
@@ -2,8 +2,8 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import { profile, setUserID, type Profile } from '$lib/auth.js' import { profile, setUserID, type Profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte' import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
import { Button } from 'mono-svelte'
export let expanded: boolean = false export let expanded: boolean = false
export let prof: Profile export let prof: Profile
@@ -41,7 +41,7 @@
profile={prof} profile={prof}
{index} {index}
selected={$profile?.id == prof.id} selected={$profile?.id == prof.id}
slot="icon" slot="prefix"
/> />
<span class:hidden={!expanded} class="flex flex-col gap-0"> <span class:hidden={!expanded} class="flex flex-col gap-0">
{prof.username ?? prof.user?.local_user_view.person.name} {prof.username ?? prof.user?.local_user_view.person.name}
+1 -1
View File
@@ -8,7 +8,6 @@
Icon, Icon,
UserGroup, UserGroup,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import Button from '../../input/Button.svelte'
import { profile, profileData } from '$lib/auth.js' import { profile, profileData } from '$lib/auth.js'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte' import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
@@ -16,6 +15,7 @@
import ProfileButton from '$lib/components/ui/sidebar/ProfileButton.svelte' import ProfileButton from '$lib/components/ui/sidebar/ProfileButton.svelte'
import { flip } from 'svelte/animate' import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing' import { expoOut } from 'svelte/easing'
import { Button } from 'mono-svelte'
</script> </script>
<nav <nav
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte' import { Button } from 'mono-svelte'
export let expanded: boolean export let expanded: boolean
</script> </script>
-80
View File
@@ -1,80 +0,0 @@
<script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import {
type Toast,
toasts,
toastColors,
} from '$lib/components/ui/toasts/toasts'
import {
InformationCircle,
ExclamationTriangle,
ExclamationCircle,
CheckCircle,
Icon,
XMark,
Check,
} from 'svelte-hero-icons'
import { fly } from 'svelte/transition'
export let toast: Toast
</script>
<div
class="{toastColors[
toast.type
]} relative w-80 rounded-md overflow-hidden flex flex-row items-center"
transition:fly={{
duration: 300,
y: 8,
opacity: 0,
}}
>
{#if toast.loading}
<div class="relative m-2 ml-4 flex-shrink-0">
<Spinner width={20} />
</div>
{:else}
<Icon
size="20"
mini
class="relative m-2 ml-4 flex-shrink-0"
src={toast.type == 'info'
? InformationCircle
: toast.type == 'success'
? CheckCircle
: toast.type == 'warning'
? ExclamationTriangle
: toast.type == 'error'
? ExclamationCircle
: ExclamationCircle}
/>
{/if}
<div class="flex flex-col p-4 pl-0 break-words max-w-full">
{#if toast.title}
<h1 class="text-base font-bold">{toast.title}</h1>
{/if}
<p class="text-sm">{toast.content}</p>
</div>
<div class="ml-auto flex items-center gap-2 m-2">
{#if toast.action}
<button
on:click={() => {
toast.action?.()
toasts.update((toasts) => toasts.filter((t) => t.id != toast.id))
}}
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2"
>
<Icon src={Check} size="16" mini />
</button>
{/if}
<button
on:click={() => {
toasts.update((toasts) => toasts.filter((t) => t.id != toast.id))
}}
class="rounded-lg w-max transition-colors hover:bg-black/20 hover:dark:bg-white/20 p-2"
>
<Icon src={XMark} size="16" mini />
</button>
</div>
</div>
@@ -1,21 +0,0 @@
<script lang="ts">
import Toast from '$lib/components/ui/toasts/Toast.svelte'
import { flip } from 'svelte/animate'
import { toasts } from '$lib/components/ui/toasts/toasts'
</script>
<div
class="fixed right-0 bottom-0 flex flex-col items-end justify-end z-[200] p-4
group
overflow-hidden h-screen min-w-[24rem] pointer-events-none"
>
{#each $toasts as toast, index (toast.id)}
<div
animate:flip={{ duration: 300 }}
class="pointer-events-auto -mt-8 transition-all group-hover:pt-12
duration-300"
>
<Toast {toast} />
</div>
{/each}
</div>
-64
View File
@@ -1,64 +0,0 @@
import { writable } from 'svelte/store'
type ToastType = keyof typeof toastColors
export const toastColors = {
error: 'bg-red-600 text-white border border-red-700',
warning: 'bg-yellow-400 text-black border border-yellow-500',
success: 'bg-green-400 text-black border border-green-500',
info: 'dark:bg-zinc-900 bg-white border border-slate-200 dark:border-zinc-800 shadow-lg',
}
export interface Toast {
id: number
title?: string
content: string
type: ToastType
loading?: boolean
action?: () => any
}
export const toasts = writable<Toast[]>([])
export function toast({
title,
content,
type = 'info',
duration = 5000,
loading = false,
action,
}: {
title?: string
content: string
type?: ToastType
duration?: number
loading?: boolean
action?: () => any
}) {
let id = 0
toasts.update((toasts) => {
id = Math.floor(Math.random() * 10000)
return [
...toasts,
{
id: id,
content: content,
title: title,
type: type,
loading: loading,
action: action,
},
]
})
setTimeout(() => {
toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
}, duration)
return id
}
export const removeToast = (id: number) =>
toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Modal from '$lib/components/ui/modal/Modal.svelte'
import DebugTree from '$lib/components/util/debug/DebugTree.svelte' import DebugTree from '$lib/components/util/debug/DebugTree.svelte'
import { Modal } from 'mono-svelte'
export let object: any export let object: any
export let open: boolean = false export let open: boolean = false
+1 -1
View File
@@ -66,7 +66,7 @@ export const defaultSettings: Settings = {
community: toBool(env.PUBLIC_SHOW_INSTANCES_COMMUNITY) ?? true, community: toBool(env.PUBLIC_SHOW_INSTANCES_COMMUNITY) ?? true,
comments: toBool(env.PUBLIC_SHOW_INSTANCES_COMMENTS) ?? false, comments: toBool(env.PUBLIC_SHOW_INSTANCES_COMMENTS) ?? false,
}, },
showCompactPosts: toBool(env.PUBLIC_SHOW_COMPACT_POSTS) ?? false, showCompactPosts: toBool(env.PUBLIC_SHOW_COMPACT_POSTS) ?? true,
defaultSort: { defaultSort: {
sort: env.PUBLIC_DEFAULT_FEED_SORT ?? ('Active' as any), sort: env.PUBLIC_DEFAULT_FEED_SORT ?? ('Active' as any),
feed: env.PUBLIC_DEFAULT_FEED ?? ('Local' as any), feed: env.PUBLIC_DEFAULT_FEED ?? ('Local' as any),
+1 -1
View File
@@ -1,5 +1,5 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { get } from 'svelte/store' import { get } from 'svelte/store'
+1 -1
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores' import { page } from '$app/stores'
import Button from '$lib/components/input/Button.svelte' import { Button } from 'mono-svelte'
</script> </script>
<div class="flex flex-col mx-auto gap-4 justify-center items-center h-full"> <div class="flex flex-col mx-auto gap-4 justify-center items-center h-full">
+1 -3
View File
@@ -4,15 +4,13 @@
import { navigating } from '$app/stores' import { navigating } from '$app/stores'
import nProgress from 'nprogress' import nProgress from 'nprogress'
import 'nprogress/nprogress.css' import 'nprogress/nprogress.css'
import ToastContainer from '$lib/components/ui/toasts/ToastContainer.svelte'
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte' import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
import Sidebar from '$lib/components/ui/sidebar/Sidebar.svelte' import Sidebar from '$lib/components/ui/sidebar/Sidebar.svelte'
import { onMount } from 'svelte'
// @ts-ignore // @ts-ignore
import { pwaInfo } from 'virtual:pwa-info' import { pwaInfo } from 'virtual:pwa-info'
import PwaReload from '$lib/PwaReload.svelte'
import { inDarkTheme } from '$lib/ui/colors.js' import { inDarkTheme } from '$lib/ui/colors.js'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { ToastContainer } from 'mono-svelte'
nProgress.configure({ nProgress.configure({
minimum: 0.4, minimum: 0.4,
+25 -19
View File
@@ -1,22 +1,15 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import Button from '$lib/components/input/Button.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte' import StickyCard from '$lib/components/ui/StickyCard.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte' import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { fly } from 'svelte/transition'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import { profile } from '$lib/auth.js'
import Sort from '$lib/components/lemmy/Sort.svelte' import Sort from '$lib/components/lemmy/Sort.svelte'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import { userSettings } from '$lib/settings.js'
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte' import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import { Button, Modal, Select, Spinner } from 'mono-svelte'
import { GlobeAmericas, Icon } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js'
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
export let data export let data
@@ -45,15 +38,28 @@
<Button on:click={() => (sidebar = !sidebar)}>About</Button> <Button on:click={() => (sidebar = !sidebar)}>About</Button>
</div> </div>
<div <div
class="flex flex-row gap-4 max-w-full w-full justify-between flex-wrap" class="flex flex-row gap-4 max-w-full justify-between w-full flex-wrap"
> >
<MultiSelect <Select
options={['Subscribed', 'Local', 'All']} bind:value={data.listingType}
disabled={[$profile?.jwt == undefined]} on:change={() =>
selected={data.listingType} searchParam($page.url, 'type', data.listingType, 'page')}
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} class="w-28"
/> >
<Sort selected={data.sort} /> <span slot="label" class="flex items-center gap-1">
<Icon src={GlobeAmericas} size="16" mini />
Location
</span>
<option value="All">All</option>
<option value="Local">Local</option>
<option value="Subscribed" disabled={!$profile?.jwt}>Subscribed</option>
</Select>
<div class="flex gap-4 flex-wrap">
<Sort selected={data.sort} />
<div class="max-[400px]:hidden">
<ViewSelect />
</div>
</div>
</div> </div>
<section class="flex flex-col gap-3 sm:gap-4 h-full"> <section class="flex flex-col gap-3 sm:gap-4 h-full">
<PostFeed posts={data.posts.posts} /> <PostFeed posts={data.posts.posts} />
+20 -18
View File
@@ -3,18 +3,13 @@
profileData, profileData,
setUserID, setUserID,
profile as currentProfile, profile as currentProfile,
resetProfile,
deleteProfile, deleteProfile,
moveProfile, moveProfile,
type Profile, type Profile,
profile, profile,
} from '$lib/auth.js' } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import EditableList from '$lib/components/ui/list/EditableList.svelte' import EditableList from '$lib/components/ui/list/EditableList.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte' import { Menu, MenuButton, toast } from 'mono-svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import DebugObject from '$lib/components/util/debug/DebugObject.svelte' import DebugObject from '$lib/components/util/debug/DebugObject.svelte'
import { import {
DEFAULT_INSTANCE_URL, DEFAULT_INSTANCE_URL,
@@ -24,6 +19,7 @@
import { validateInstance } from '$lib/lemmy.js' import { validateInstance } from '$lib/lemmy.js'
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte' import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import { Button, TextInput } from 'mono-svelte'
import { import {
ArrowLeftOnRectangle, ArrowLeftOnRectangle,
ArrowUturnLeft, ArrowUturnLeft,
@@ -105,7 +101,7 @@
<h1 class="font-bold text-3xl">No accounts</h1> <h1 class="font-bold text-3xl">No accounts</h1>
</div> </div>
<Button href="/login" size="lg"> <Button href="/login" size="lg">
<Icon slot="icon" src={ArrowLeftOnRectangle} size="16" mini /> <Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
Log in Log in
</Button> </Button>
<div class="flex flex-row font-normal gap-2"> <div class="flex flex-row font-normal gap-2">
@@ -174,23 +170,26 @@
</div> </div>
</div> </div>
<div class="ml-auto" /> <div class="ml-auto" />
<Menu let:toggleOpen alignment="bottom-right"> <Menu origin="bottom-right">
<Button on:click={toggleOpen} size="square-md" slot="button"> <Button
<Icon src={EllipsisHorizontal} mini size="16" slot="icon" /> size="square-md"
slot="target"
>
<Icon src={EllipsisHorizontal} mini size="16" slot="prefix" />
</Button> </Button>
<MenuButton on:click={() => moveProfile(profile.id, true)}> <MenuButton on:click={() => moveProfile(profile.id, true)}>
<Icon src={ChevronUp} size="16" mini slot="icon" /> <Icon src={ChevronUp} size="16" mini slot="prefix" />
Move Up Move Up
</MenuButton> </MenuButton>
<MenuButton on:click={() => moveProfile(profile.id, false)}> <MenuButton on:click={() => moveProfile(profile.id, false)}>
<Icon src={ChevronDown} size="16" mini slot="icon" /> <Icon src={ChevronDown} size="16" mini slot="prefix" />
Move Down Move Down
</MenuButton> </MenuButton>
<MenuButton <MenuButton
disabled={!profile.color} disabled={!profile.color}
on:click={() => (profile.color = undefined)} on:click={() => (profile.color = undefined)}
> >
<Icon src={ArrowUturnLeft} size="16" mini slot="icon" /> <Icon src={ArrowUturnLeft} size="16" mini slot="prefix" />
Reset Color Reset Color
</MenuButton> </MenuButton>
{#if $userSettings.debugInfo} {#if $userSettings.debugInfo}
@@ -200,7 +199,7 @@
debugging = !debugging debugging = !debugging
}} }}
> >
<Icon src={BugAnt} size="16" mini slot="icon" /> <Icon src={BugAnt} size="16" mini slot="prefix" />
Debug Info Debug Info
</MenuButton> </MenuButton>
{/if} {/if}
@@ -222,7 +221,7 @@
class="!p-2" class="!p-2"
color="danger" color="danger"
> >
<Icon slot="icon" src={Trash} size="16" mini /> <Icon slot="prefix" src={Trash} size="16" mini />
</Button> </Button>
</div> </div>
{/each} {/each}
@@ -248,18 +247,21 @@
label="Guest instance" label="Guest instance"
bind:value={newInstance} bind:value={newInstance}
disabled={LINKED_INSTANCE_URL != undefined} disabled={LINKED_INSTANCE_URL != undefined}
/> size="sm"
>
<span slot="prefix">https://</span>
</TextInput>
<Button <Button
color="primary" color="primary"
{loading} {loading}
disabled={loading || LINKED_INSTANCE_URL != undefined} disabled={loading || LINKED_INSTANCE_URL != undefined}
class="h-[42px] self-end" class="self-end"
> >
Change Change
</Button> </Button>
</div> </div>
<Button href="/login" size="lg"> <Button href="/login" size="lg">
<Icon slot="icon" src={Plus} size="16" mini /> <Icon slot="prefix" src={Plus} size="16" mini />
Add more Add more
</Button> </Button>
</div> </div>
@@ -1,12 +1,7 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import Button from '$lib/components/input/Button.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Card from '$lib/components/ui/Card.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import { ClipboardDocumentCheck, Icon } from 'svelte-hero-icons' import { ClipboardDocumentCheck, Icon } from 'svelte-hero-icons'
import Application from './Application.svelte' import Application from './Application.svelte'
@@ -1,13 +1,11 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Card from '$lib/components/ui/Card.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { Material, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { RegistrationApplicationView } from 'lemmy-js-client' import type { RegistrationApplicationView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Check, Icon, XMark } from 'svelte-hero-icons' import { Check, Icon, XMark } from 'svelte-hero-icons'
export let application: RegistrationApplicationView export let application: RegistrationApplicationView
@@ -50,7 +48,7 @@
} }
</script> </script>
<Card elevation={0} class="p-4 flex flex-col gap-2"> <Material class="flex flex-col gap-2">
<div class="flex flex-col gap-1"> <div class="flex flex-col gap-1">
<SectionTitle>User</SectionTitle> <SectionTitle>User</SectionTitle>
<span class="text-sm"> <span class="text-sm">
@@ -85,7 +83,7 @@
loading={denying} loading={denying}
disabled={approving || denying} disabled={approving || denying}
> >
<Icon src={XMark} mini size="16" slot="icon" /> <Icon src={XMark} mini size="16" slot="prefix" />
</Button> </Button>
<Button <Button
size="square-md" size="square-md"
@@ -98,8 +96,8 @@
loading={approving} loading={approving}
disabled={approving || denying} disabled={approving || denying}
> >
<Icon src={Check} mini size="16" slot="icon" /> <Icon src={Check} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
</div> </div>
</Card> </Material>
+7 -18
View File
@@ -1,16 +1,11 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import SelectMenu from '$lib/components/input/SelectMenu.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { EditSite } from 'lemmy-js-client' import type { EditSite } from 'lemmy-js-client'
import type { PageData } from './$types.js' import type { PageData } from './$types.js'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import { Button, Checkbox, Select, TextInput } from 'mono-svelte'
export let data: PageData export let data: PageData
@@ -74,17 +69,11 @@
<Checkbox checked={formData.enable_nsfw} defaultValue={true}> <Checkbox checked={formData.enable_nsfw} defaultValue={true}>
Enable NSFW Enable NSFW
</Checkbox> </Checkbox>
<SelectMenu <Select label="Registration Mode" bind:value={formData.registration_mode}>
label="Registration mode" <option value="Open">Open</option>
alignment="top-left" <option value="RequireApplication">Require Application</option>
options={['Closed', 'RequireApplication', 'Open']} <option value="Closed">Closed</option>
optionNames={['Closed', 'Require Application', 'Open Registration']} </Select>
selected={formData.registration_mode ?? 'Open'}
on:select={(e) => {
// @ts-ignore
formData.registration_mode = e.detail
}}
/>
{#if formData.registration_mode == 'RequireApplication'} {#if formData.registration_mode == 'RequireApplication'}
<MarkdownEditor <MarkdownEditor
previewButton previewButton
+6 -6
View File
@@ -1,18 +1,18 @@
<script lang="ts"> <script lang="ts">
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import EditableList from '$lib/components/ui/list/EditableList.svelte' import EditableList from '$lib/components/ui/list/EditableList.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { Tagline } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons' import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
export let data export let data
let taglines = [...(data.site?.taglines.map((t) => t.content) ?? [])] let taglines = [...(data.site?.taglines.map((t: Tagline) => t.content) ?? [])]
let newTagline = '' let newTagline = ''
let saving = false let saving = false
@@ -97,7 +97,7 @@
/> />
<Button size="lg" submit> <Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="icon" /> <Icon src={Plus} size="16" mini slot="prefix" />
Add Add
</Button> </Button>
</form> </form>
@@ -126,7 +126,7 @@
/> />
<Button size="lg" submit> <Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="icon" /> <Icon src={Plus} size="16" mini slot="prefix" />
Add Add
</Button> </Button>
</form> </form>
+8 -18
View File
@@ -1,17 +1,15 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import EditableList from '$lib/components/ui/list/EditableList.svelte' import EditableList from '$lib/components/ui/list/EditableList.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { instance } from '$lib/instance.js' import { instance } from '$lib/instance.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { addAdmin } from '$lib/lemmy/user.js' import { addAdmin } from '$lib/lemmy/user.js'
import { removeItem, trycatch } from '$lib/util.js' import { removeItem, trycatch } from '$lib/util.js'
import { Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons' import { Button, TextInput } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
export let data export let data
@@ -62,11 +60,9 @@
{#each data.site?.admins ?? [] as admin} {#each data.site?.admins ?? [] as admin}
<div class="py-3 flex items-center justify-between"> <div class="py-3 flex items-center justify-between">
<UserLink avatar showInstance={false} user={admin.person} /> <UserLink avatar showInstance={false} user={admin.person} />
<Button <Button on:click={() => action(admin.person.id)} size="square-md">
on:click={() => action(admin.person.id)} <Icon src={Trash} mini size="16" />
icon={Trash} </Button>
size="square-md"
/>
</div> </div>
{/each} {/each}
{/if} {/if}
@@ -99,14 +95,8 @@
class="flex-1" class="flex-1"
pattern={'@[^ |]{1,}'} pattern={'@[^ |]{1,}'}
/> />
<Button <Button loading={adding} disabled={adding} size="md" class="h-full" submit>
loading={adding} <Icon src={Plus} mini size="16" slot="prefix" />
disabled={adding}
icon={Plus}
size="md"
class="h-full"
submit
>
Add Admin Add Admin
</Button> </Button>
</form> </form>
+8 -17
View File
@@ -1,23 +1,14 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores' import { page } from '$app/stores'
import Link from '$lib/components/input/Link.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Post from '../../../lib/components/lemmy/post/Post.svelte'
import { goto } from '$app/navigation'
import Card from '$lib/components/ui/StickyCard.svelte'
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte' import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import Button from '$lib/components/input/Button.svelte'
import { Color } from '$lib/ui/colors'
import { fly } from 'svelte/transition'
import { userSettings } from '$lib/settings.js'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Sort from '$lib/components/lemmy/Sort.svelte' import Sort from '$lib/components/lemmy/Sort.svelte'
import { fullCommunityName, searchParam } from '$lib/util.js' import { fullCommunityName, searchParam } from '$lib/util.js'
import { onDestroy, onMount } from 'svelte' import { onMount } from 'svelte'
import { setSessionStorage } from '$lib/session.js' import { setSessionStorage } from '$lib/session.js'
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte' import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
import { Button, Modal } from 'mono-svelte'
export let data export let data
@@ -60,13 +51,13 @@
</span> </span>
</div> </div>
</div> </div>
<div class="xl:hidden"> <div class="flex flex-row gap-4 max-w-full w-full items-end">
<Button color="secondary" on:click={() => (sidebar = !sidebar)}>
About
</Button>
</div>
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
<Sort selected={data.sort} /> <Sort selected={data.sort} />
<div class="xl:hidden">
<Button color="secondary" on:click={() => (sidebar = !sidebar)}>
About
</Button>
</div>
</div> </div>
<PostFeed posts={data.posts.posts} /> <PostFeed posts={data.posts.posts} />
<Pageination <Pageination
@@ -1,15 +1,14 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import EditableList from '$lib/components/ui/list/EditableList.svelte' import EditableList from '$lib/components/ui/list/EditableList.svelte'
import { Icon, Plus, Trash } from 'svelte-hero-icons' import { Icon, Plus, Trash } from 'svelte-hero-icons'
import type { PageData } from './$types.js' import type { PageData } from './$types.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { flip } from 'svelte/animate' import { flip } from 'svelte/animate'
import { Button, TextInput } from 'mono-svelte'
export let data: PageData export let data: PageData
@@ -119,11 +118,9 @@
</span> </span>
</div> </div>
</div> </div>
<Button <Button size="square-md" on:click={() => action(moderator.moderator)}>
size="square-md" <Icon src={Trash} mini size="16" />
on:click={() => action(moderator.moderator)} </Button>
icon={Trash}
/>
</div> </div>
{/each} {/each}
</EditableList> </EditableList>
@@ -140,6 +137,6 @@
class="w-max flex-shrink-0" class="w-max flex-shrink-0"
on:click={addModerator} on:click={addModerator}
> >
<Icon slot="icon" src={Plus} mini size="16" />Add moderator <Icon slot="prefix" src={Plus} mini size="16" />Add moderator
</Button> </Button>
</div> </div>
+19 -22
View File
@@ -4,21 +4,21 @@
import { page } from '$app/stores' import { page } from '$app/stores'
import { import {
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
GlobeAmericas,
Icon, Icon,
PencilSquare, PencilSquare,
QuestionMarkCircle, QuestionMarkCircle,
UserGroup, UserGroup,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import Subscribe from './Subscribe.svelte' import Subscribe from './Subscribe.svelte'
import Button from '$lib/components/input/Button.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import { addSubscription } from '$lib/lemmy/user.js' import { addSubscription } from '$lib/lemmy/user.js'
import Link from '$lib/components/input/Link.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance.js' import { LINKED_INSTANCE_URL } from '$lib/instance.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button, Select, TextInput } from 'mono-svelte'
import Sort from '$lib/components/lemmy/Sort.svelte'
export let data export let data
@@ -40,30 +40,27 @@
page, and search with this syntax: page, and search with this syntax:
<code>!community@instance.com</code> <code>!community@instance.com</code>
</p> </p>
<div class="flex flex-col sm:flex-row gap-4 mt-4"> <div class="flex flex-row flex-wrap gap-4 mt-4">
<MultiSelect <Select
options={['Subscribed', 'Local', 'All']} bind:value={data.type}
selected={$page.url.searchParams.get('type') ?? on:change={() => searchParam($page.url, 'type', data.type ?? 'All', 'page')}
(LINKED_INSTANCE_URL ? 'Local' : 'All')} >
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} <span slot="label" class="flex items-center gap-1">
/> <Icon src={GlobeAmericas} mini size="15" />
Location
</span>
<option value="All">All</option>
<option value="Local">Local</option>
<option value="Subscribed">Subscribed</option>
</Select>
<Sort selected={data.sort} />
<div class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"> <div class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center">
<TextInput <TextInput
bind:value={search} bind:value={search}
on:change={() => { on:change={() => () => searchParam($page.url, 'q', search, 'page')}
$page.url.searchParams.set('q', search)
goto($page.url.toString(), {
invalidateAll: true,
})
}}
/> />
<Button <Button
on:click={() => { on:click={() => searchParam($page.url, 'q', search, 'page')}
$page.url.searchParams.set('q', search)
goto($page.url.toString(), {
invalidateAll: true,
})
}}
color="ghost" color="ghost"
class="h-max" class="h-max"
> >
+30 -18
View File
@@ -1,30 +1,42 @@
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { ListingType } from 'lemmy-js-client' import type { ListingType, SortType } from 'lemmy-js-client'
import { get } from 'svelte/store' import { get } from 'svelte/store'
export async function load({ url, fetch }) { export async function load({ url, fetch }) {
const type = url.searchParams.get('type') as ListingType const type =
(url.searchParams.get('type') as ListingType) ||
(LINKED_INSTANCE_URL ? 'Local' : 'All')
const sort = (url.searchParams.get('sort') as SortType) || 'TopAll'
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
const query = url.searchParams.get('q') const query = url.searchParams.get('q')
if (query) { if (query) {
return await getClient(undefined, fetch).search({ return {
limit: 40, ...(await getClient(undefined, fetch).search({
page: page, limit: 40,
sort: 'TopAll', page: page,
type_: 'Communities', sort: sort,
listing_type: type, type_: 'Communities',
q: query, listing_type: type,
auth: get(profile)?.jwt, q: query,
}) auth: get(profile)?.jwt,
})),
type: type,
sort: sort,
}
} else { } else {
return await getClient(undefined, fetch).listCommunities({ return {
limit: 40, ...(await getClient(undefined, fetch).listCommunities({
page: page, limit: 40,
sort: 'TopAll', page: page,
type_: type, sort: sort,
auth: get(profile)?.jwt, type_: type,
}) auth: get(profile)?.jwt,
})),
type: type,
sort: sort,
}
} }
} }
+1 -1
View File
@@ -2,7 +2,7 @@
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { CommunityView } from 'lemmy-js-client' import type { CommunityView } from 'lemmy-js-client'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
export let community: CommunityView export let community: CommunityView
-1
View File
@@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import PostForm from '$lib/components/lemmy/post/PostForm.svelte' import PostForm from '$lib/components/lemmy/post/PostForm.svelte'
import Card from '$lib/components/ui/Card.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { getSessionStorage, setSessionStorage } from '$lib/session.js' import { getSessionStorage, setSessionStorage } from '$lib/session.js'
+35 -28
View File
@@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import InboxItem from './InboxItem.svelte' import InboxItem from './InboxItem.svelte'
import Button from '$lib/components/input/Button.svelte'
import { import {
ArchiveBox, AdjustmentsHorizontal,
Bars3BottomRight,
Check, Check,
EnvelopeOpen, Funnel,
Icon, Icon,
Inbox, Inbox,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
@@ -18,6 +18,7 @@
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import { Button, Select } from 'mono-svelte'
export let data export let data
@@ -59,36 +60,42 @@
disabled={markingAsRead} disabled={markingAsRead}
size="md" size="md"
> >
<Icon src={Check} width={16} mini slot="icon" /> <Icon src={Check} width={16} mini slot="prefix" />
Mark all as read Mark all as read
</Button> </Button>
</div> </div>
<div class="mt-4" /> <div class="mt-4" />
<div class="flex flex-row gap-4 flex-wrap"> <div class="flex flex-row gap-4 flex-wrap">
<MultiSelect <Select
selected={data.unreadOnly} bind:value={data.unreadOnly}
options={[false, true]} on:change={() =>
optionNames={['All', 'Unread']} searchParam(
on:select={(e) => { $page.url,
$page.url.searchParams.delete('page') 'unreadOnly',
$page.url.searchParams.set('unreadOnly', (e.detail ?? false).toString()) data.unreadOnly?.toString() ?? 'false',
goto($page.url.toString(), { 'page'
invalidateAll: true, )}
}) >
}} <span slot="label" class="flex items-center gap-1">
/> <Icon src={Funnel} size="15" mini />
<MultiSelect Filter
selected={data.type} </span>
options={['all', 'mentions', 'replies', 'messages']} <option value="false">All</option>
optionNames={['All', 'Mentions', 'Replies', 'Messages']} <option value="true">Unread</option>
on:select={(e) => { </Select>
$page.url.searchParams.delete('page') <Select
$page.url.searchParams.set('type', e.detail ?? 'all') bind:value={data.type}
goto($page.url.toString(), { on:change={() => searchParam($page.url, 'type', data.type ?? 'all', 'page')}
invalidateAll: true, >
}) <span slot="label" class="flex items-center gap-1">
}} <Icon src={AdjustmentsHorizontal} size="15" mini />
/> Type
</span>
<option value="all">All</option>
<option value="mentions">Mentions</option>
<option value="replies">Replies</option>
<option value="messages">Messages</option>
</Select>
</div> </div>
<div class="flex flex-col gap-4 list-none my-4 flex-1"> <div class="flex flex-col gap-4 list-none my-4 flex-1">
{#if !data.data || (data.data?.length ?? 0) == 0} {#if !data.data || (data.data?.length ?? 0) == 0}
+3 -4
View File
@@ -13,14 +13,13 @@ export async function load({ url, fetch }) {
(url.searchParams.get('type') as InboxFeedType) || 'all' (url.searchParams.get('type') as InboxFeedType) || 'all'
const client = getClient(undefined, fetch) const client = getClient(undefined, fetch)
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
const unreadOnly: boolean = const unreadOnly: string = url.searchParams.get('unreadOnly') || 'true'
(url.searchParams.get('unreadOnly') || 'true') == 'true'
const params = { const params = {
limit: 50, limit: 20,
page: page, page: page,
auth: auth.jwt, auth: auth.jwt,
unread_only: unreadOnly, unread_only: unreadOnly == 'true',
} }
const [replies, mentions, privateMessages] = await Promise.all([ const [replies, mentions, privateMessages] = await Promise.all([
+7 -8
View File
@@ -1,10 +1,7 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Card from '$lib/components/ui/Card.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
@@ -15,9 +12,11 @@
} from 'lemmy-js-client' } from 'lemmy-js-client'
import { ChatBubbleOvalLeft, Check, Icon } from 'svelte-hero-icons' import { ChatBubbleOvalLeft, Check, Icon } from 'svelte-hero-icons'
import { page } from '$app/stores' import { page } from '$app/stores'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { Material, toast } from 'mono-svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { Button } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
export let item: CommentReplyView | PersonMentionView | PrivateMessageView export let item: CommentReplyView | PersonMentionView | PrivateMessageView
export let read: boolean export let read: boolean
@@ -90,7 +89,7 @@
} }
</script> </script>
<Card elevation={0} class="flex flex-col rounded-md p-5 max-w-full gap-2"> <Material padding="lg" class="flex flex-col max-w-full gap-2">
{#if !isPrivateMessage(item)} {#if !isPrivateMessage(item)}
<PostMeta <PostMeta
published={new Date(item.post.published)} published={new Date(item.post.published)}
@@ -132,7 +131,7 @@
disabled={loading} disabled={loading}
on:click={() => markAsRead(!read)} on:click={() => markAsRead(!read)}
> >
<Icon slot="icon" src={Check} mini size="16" /> <Icon slot="prefix" src={Check} mini size="16" />
</Button> </Button>
<Button href="/comment/{item.comment.id}" size="md" class="h-8"> <Button href="/comment/{item.comment.id}" size="md" class="h-8">
@@ -176,7 +175,7 @@
{#if isPrivateMessage(item)} {#if isPrivateMessage(item)}
{#if replying} {#if replying}
<div class="mt-2 flex flex-col gap-2"> <div class="mt-2 flex flex-col gap-2">
<TextArea placeholder="Message" bind:value={reply} rows={3} /> <MarkdownEditor placeholder="Message" bind:value={reply} rows={4} />
<div class="ml-auto w-24"> <div class="ml-auto w-24">
<Button <Button
disabled={loading} disabled={loading}
@@ -192,4 +191,4 @@
{/if} {/if}
{/if} {/if}
{/if} {/if}
</Card> </Material>
+6 -11
View File
@@ -1,13 +1,11 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { setUser } from '$lib/auth.js' import { setUser } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import Link from '$lib/components/input/Link.svelte' import Link from '$lib/components/input/Link.svelte'
import TextInput from '$lib/components/input/TextInput.svelte' import { toast } from 'mono-svelte'
import Card from '$lib/components/ui/Card.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js' import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL } from '$lib/instance.js'
import { getClient, validateInstance } from '$lib/lemmy.js' import { getClient, validateInstance } from '$lib/lemmy.js'
import { Button, TextInput } from 'mono-svelte'
import { AtSymbol, Icon } from 'svelte-hero-icons' import { AtSymbol, Icon } from 'svelte-hero-icons'
let data = { let data = {
@@ -66,7 +64,10 @@
placeholder="Example" placeholder="Example"
class="flex-1" class="flex-1"
required required
/> inlineAffixes
>
<span slot="prefix">@</span>
</TextInput>
{#if !LINKED_INSTANCE_URL} {#if !LINKED_INSTANCE_URL}
<span class="flex items-center font-bold mt-6"> <span class="flex items-center font-bold mt-6">
<Icon src={AtSymbol} mini size="20" class="mt-auto" /> <Icon src={AtSymbol} mini size="20" class="mt-auto" />
@@ -101,12 +102,6 @@
minlength={6} minlength={6}
maxlength={6} maxlength={6}
class="w-24" class="w-24"
on:input={(e) => {
if (!Number.isInteger(Number(e.detail.data))) {
e.preventDefault()
data.totp = data.totp.replace(e.detail.data, '')
}
}}
/> />
</div> </div>
<Button <Button
+21 -14
View File
@@ -1,15 +1,19 @@
<script lang="ts"> <script lang="ts">
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Card from '$lib/components/ui/Card.svelte'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
import Report from './Report.svelte' import Report from './Report.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import { page } from '$app/stores' import { page } from '$app/stores'
import { goto } from '$app/navigation' import {
import { EnvelopeOpen, Icon, Inbox, Newspaper } from 'svelte-hero-icons' EnvelopeOpen,
Funnel,
Icon,
Inbox,
Newspaper,
} from 'svelte-hero-icons'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Button from '$lib/components/input/Button.svelte'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import { Button, Material, Select } from 'mono-svelte'
export let data export let data
</script> </script>
@@ -17,12 +21,17 @@
<div class="mb-4 flex flex-col gap-4"> <div class="mb-4 flex flex-col gap-4">
<h1 class="font-bold text-2xl">Reports</h1> <h1 class="font-bold text-2xl">Reports</h1>
<div class="flex flex-row gap-2 flex-wrap items-center"> <div class="flex flex-row gap-2 flex-wrap items-center">
<MultiSelect <Select
selected={data.type} bind:value={data.type}
options={['all', 'unread']} on:change={() => searchParam($page.url, 'type', data.type, 'page')}
optionNames={['All', 'Unread']} >
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} <span slot="label" class="flex items-center gap-1">
/> <Icon src={Funnel} size="15" mini />
Filter
</span>
<option value="all">All</option>
<option value="unread">Unread</option>
</Select>
<Button href="/modlog" class="h-max ml-auto"> <Button href="/modlog" class="h-max ml-auto">
<Icon src={Newspaper} size="16" mini /> <Icon src={Newspaper} size="16" mini />
Modlog Modlog
@@ -33,9 +42,7 @@
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
{#each data.items as item} {#each data.items as item}
<div in:fly={{ y: -6, opacity: 0, duration: 500 }}> <div in:fly={{ y: -6, opacity: 0, duration: 500 }}>
<Card <Material class="flex flex-col gap-4 text-sm">
class="p-4 flex flex-col gap-4 text-sm !bg-slate-100 dark:!bg-zinc-950"
>
<div class="flex flex-col gap-1.5"> <div class="flex flex-col gap-1.5">
<span class="text-xs font-bold dark:text-zinc-400 text-slate-600"> <span class="text-xs font-bold dark:text-zinc-400 text-slate-600">
Report from Report from
@@ -46,7 +53,7 @@
</div> </div>
<Report {item} /> <Report {item} />
</Card> </Material>
</div> </div>
{/each} {/each}
</div> </div>
+4 -4
View File
@@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/input/Button.svelte'
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte' import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { isCommentReport, isPostReport } from '$lib/lemmy/item.js' import { isCommentReport, isPostReport } from '$lib/lemmy/item.js'
import type { import type {
@@ -12,6 +11,7 @@
} from 'lemmy-js-client' } from 'lemmy-js-client'
import { Check, Icon } from 'svelte-hero-icons' import { Check, Icon } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
export let item: PostReportView | CommentReportView | PrivateMessageReportView export let item: PostReportView | CommentReportView | PrivateMessageReportView
@@ -100,7 +100,7 @@
loading={resolving} loading={resolving}
disabled={resolving} disabled={resolving}
> >
<Icon src={Check} mini size="16" slot="icon" /> <Icon src={Check} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
{:else if isPostReport(item)} {:else if isPostReport(item)}
@@ -132,7 +132,7 @@
loading={resolving} loading={resolving}
disabled={resolving} disabled={resolving}
> >
<Icon src={Check} mini size="16" slot="icon" /> <Icon src={Check} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
{/if} {/if}
+62 -59
View File
@@ -4,12 +4,21 @@
import { page } from '$app/stores' import { page } from '$app/stores'
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte' import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import ModlogItemCard from './item/ModlogItemCard.svelte' import ModlogItemCard from './item/ModlogItemCard.svelte'
import ModlogItemTable from './item/ModlogItemTable.svelte' import ModlogItemTable from './item/ModlogItemTable.svelte'
import { Select } from 'mono-svelte'
import { Bars3BottomRight, Icon, ViewColumns } from 'svelte-hero-icons'
export let data export let data
let view = `${
$userSettings.modlogCardView ??
!window.matchMedia('(min-width: 1600px)').matches
}`
$: $userSettings.modlogCardView =
view == 'true' ? true : view == 'false' ? false : undefined
</script> </script>
<svelte:head> <svelte:head>
@@ -18,64 +27,58 @@
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
<h1 class="font-bold text-2xl">Modlog</h1> <h1 class="font-bold text-2xl">Modlog</h1>
<div class="flex flex-col gap-2"> <div class="flex flex-row flex-wrap gap-2">
<MultiSelect <Select
options={[ bind:value={data.type}
'All', on:change={(e) => searchParam($page.url, 'type', data.type, 'page')}
'ModRemovePost', class="w-48"
'ModLockPost', >
'ModFeaturePost', <span slot="label" class="flex gap-1 items-center">
'ModRemoveComment', <Icon src={Bars3BottomRight} size="15" mini />
'ModRemoveCommunity', Type
'ModBanFromCommunity', </span>
'ModAddCommunity', <option value="All">All</option>
'ModTransferCommunity', <option value="ModRemovePost">Remove Post</option>
'ModAdd', <option value="ModLockPost">Lock Post</option>
'ModBan', <option value="ModFeaturePost">Feature Post</option>
'ModHideCommunity', <option value="ModRemoveComment">Remove Comment</option>
'AdminPurgePerson', <option value="ModRemoveCommunity">Remove Community</option>
'AdminPurgeCommunity', <option value="ModBanFromCommunity">Ban From Community</option>
'AdminPurgePost', <option value="ModAddCommunity">Add Moderator</option>
'AdminPurgeComment', <option value="ModTransferCommunity">Transfer Community</option>
]} <option value="ModAdd">Add Admin</option>
optionNames={[ <option value="ModBan">Ban Admin</option>
'All', <option value="ModHideCommunity">Hide Community</option>
'Remove Post', <option value="AdminPurgePerson">Purge User</option>
'Lock Post', <option value="AdminPurgeCommunity">Purge Community</option>
'Feature Post', <option value="AdminPurgePost">Purge Post</option>
'Remove Comment', <option value="AdminPurgeComment">Purge Comment</option>
'Remove Community', </Select>
'Ban From Community',
'Add Community', <Select bind:value={view} class="w-36">
'Transfer Community', <span slot="label" class="flex gap-1 items-center">
'Add', <Icon src={ViewColumns} size="15" mini />
'Ban', View
'Hide Community', </span>
'Purge Person', <option value="false">Table</option>
'Purge Community', <option value="true">Cards</option>
'Purge Post', <option value="undefined">Default</option>
'Purge Comment', </Select>
]} </div>
selected={data.type} <div class="max-w-sm">
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} <div class="block my-1 font-bold text-sm">Community</div>
/> <ObjectAutocomplete
<div class="max-w-sm"> placeholder="Filter by community"
<div class="block my-1 font-bold text-sm">Community</div> jwt={$profile?.jwt}
<ObjectAutocomplete listing_type="All"
placeholder="Filter by community" showWhenEmpty={true}
jwt={$profile?.jwt} on:select={(e) =>
listing_type="All" searchParam(
showWhenEmpty={true} $page.url,
on:select={(e) => 'community',
searchParam($page.url, 'community', e.detail?.id.toString(), 'page')} e.detail?.id.toString() ?? '',
/> 'page'
</div> )}
<MultiSelect
options={[false, true, undefined]}
optionNames={['Table', 'Cards', 'Default']}
selected={$userSettings.modlogCardView ??
!window.matchMedia('(min-width: 1600px)').matches}
on:select={(e) => ($userSettings.modlogCardView = e.detail)}
/> />
</div> </div>
{#if data.modlog} {#if data.modlog}
+3 -3
View File
@@ -3,16 +3,16 @@
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte' import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import Card from '$lib/components/ui/Card.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { Material } from 'mono-svelte'
import type { ModLog } from '../+page.js' import type { ModLog } from '../+page.js'
import ModlogAction from '../ModlogAction.svelte' import ModlogAction from '../ModlogAction.svelte'
export let item: ModLog export let item: ModLog
</script> </script>
<Card elevation={0} class="p-5 flex flex-col gap-2 text-sm"> <Material padding="lg" class="flex flex-col gap-2">
<div class="flex flex-row justify-between flex-wrap gap-2"> <div class="flex flex-row justify-between flex-wrap gap-2">
{#if item.community} {#if item.community}
<CommunityLink community={item.community} avatar showInstance /> <CommunityLink community={item.community} avatar showInstance />
@@ -58,4 +58,4 @@
<SectionTitle class="mt-2">Reason</SectionTitle> <SectionTitle class="mt-2">Reason</SectionTitle>
<p>{item.reason}</p> <p>{item.reason}</p>
{/if} {/if}
</Card> </Material>
@@ -2,29 +2,26 @@
import { buildCommentsTreeAsync } from '$lib/components/lemmy/comment/comments.js' import { buildCommentsTreeAsync } from '$lib/components/lemmy/comment/comments.js'
import Comments from '$lib/components/lemmy/comment/Comments.svelte' import Comments from '$lib/components/lemmy/comment/Comments.svelte'
import { isImage, isVideo } from '$lib/ui/image.js' import { isImage, isVideo } from '$lib/ui/image.js'
import { getClient, getInstance } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte' import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
import { onMount } from 'svelte' import { onMount } from 'svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import Button from '$lib/components/input/Button.svelte'
import { page } from '$app/stores' import { page } from '$app/stores'
import PostActions from '$lib/components/lemmy/post/PostActions.svelte' import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
import { ExclamationTriangle, Icon } from 'svelte-hero-icons' import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import Card from '$lib/components/ui/Card.svelte'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte' import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { removeToast, toast } from '$lib/components/ui/toasts/toasts.js' import { Badge, Material, Spinner, removeToast, toast } from 'mono-svelte'
import type { CommentSortType } from 'lemmy-js-client' import type { CommentSortType } from 'lemmy-js-client'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { instance } from '$lib/instance.js' import { instance } from '$lib/instance.js'
import { afterNavigate, beforeNavigate, goto } from '$app/navigation' import { afterNavigate, goto } from '$app/navigation'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Link from '$lib/components/input/Link.svelte' import Link from '$lib/components/input/Link.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { userSettings } from '$lib/settings.js'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte'
export let data export let data
@@ -114,7 +111,10 @@
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
{#if $page.params.instance.toLowerCase() != $instance.toLowerCase()} {#if $page.params.instance.toLowerCase() != $instance.toLowerCase()}
<Card cardColor="warning" class="p-4 flex flex-col gap-1"> <Material
class="p-4 flex flex-col gap-1 border
border-yellow-300 dark:bg-yellow-950/30 dark:border-yellow-900 bg-yellow-50"
>
<Icon <Icon
src={ExclamationTriangle} src={ExclamationTriangle}
width={24} width={24}
@@ -126,7 +126,7 @@
This URL is for a different instance than you're logged into. You This URL is for a different instance than you're logged into. You
probably won't be able to vote or comment. probably won't be able to vote or comment.
</p> </p>
</Card> </Material>
{/if} {/if}
<PostMeta <PostMeta
@@ -223,12 +223,24 @@
</details> </details>
{/if} {/if}
</div> </div>
<div class="mt-4 flex flex-col gap-2"> {#if data.singleThread}
<Material
elevation="max"
padding="none"
color="distinct"
class="py-2 px-4 text-sm flex flex-row justify-between items-center
flex-wrap gap-4 sticky top-20 w-full box-border z-[100] mt-4"
>
<p>You're viewing a single thread.</p>
<Button on:click={reloadComments}>View full thread</Button>
</Material>
{/if}
<div class="mt-4 flex flex-col gap-2 w-full">
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<div class="font-bold opacity-80 text-base"> <div class="font-bold opacity-80 text-base flex items-center gap-2">
Comments <span class="text-lg font-medium ml-2"> Comments <Badge color="gray" class="!text-sm">
<FormattedNumber number={post.post_view.counts.comments} /> <FormattedNumber number={post.post_view.counts.comments} />
</span> </Badge>
</div> </div>
<MultiSelect <MultiSelect
options={['Hot', 'Top', 'New']} options={['Hot', 'Top', 'New']}
@@ -237,12 +249,6 @@
headless headless
/> />
</div> </div>
{#if data.singleThread}
<Card class="py-2 px-4 text-sm flex flex-row items-center flex-wrap gap-4">
<p>You're viewing a single thread.</p>
<Button on:click={reloadComments}>View full thread</Button>
</Card>
{/if}
{#await data.streamed.comments} {#await data.streamed.comments}
<div class="h-16 mx-auto grid place-items-center"> <div class="h-16 mx-auto grid place-items-center">
<Spinner width={24} /> <Spinner width={24} />
@@ -6,12 +6,12 @@
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import { Check, Icon, Trash } from 'svelte-hero-icons' import { Check, Icon, Trash } from 'svelte-hero-icons'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte' import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import { flip } from 'svelte/animate' import { flip } from 'svelte/animate'
import { slide } from 'svelte/transition' import { slide } from 'svelte/transition'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { Button } from 'mono-svelte'
// sveltekit doesn't feel like making types work right now // sveltekit doesn't feel like making types work right now
export let data: PageData & { export let data: PageData & {
@@ -70,7 +70,7 @@
> >
<UserLink user={block.target} avatar badges /> <UserLink user={block.target} avatar badges />
<Button size="square-md" on:click={() => action(block)}> <Button size="square-md" on:click={() => action(block)}>
<Icon src={Trash} mini size="16" slot="icon" /> <Icon src={Trash} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
{/each} {/each}
@@ -97,7 +97,7 @@
> >
<CommunityLink community={block.community} avatar /> <CommunityLink community={block.community} avatar />
<Button size="square-md" on:click={() => action(block)}> <Button size="square-md" on:click={() => action(block)}>
<Icon src={Trash} mini size="16" slot="icon" /> <Icon src={Trash} mini size="16" slot="prefix" />
</Button> </Button>
</div> </div>
{/each} {/each}
@@ -1,16 +1,11 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { profile, profileData, setUserID } from '$lib/auth.js' import { profile, profileData, setUserID } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import FileInput from '$lib/components/input/FileInput.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import Card from '$lib/components/ui/Card.svelte' import { ImageInput, Material, removeToast, toast } from 'mono-svelte'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import { removeToast, toast } from '$lib/components/ui/toasts/toasts.js'
import { getClient, uploadImage } from '$lib/lemmy.js' import { getClient, uploadImage } from '$lib/lemmy.js'
import type { SaveUserSettings } from 'lemmy-js-client' import type { SaveUserSettings } from 'lemmy-js-client'
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
export let data export let data
@@ -164,7 +159,7 @@
label="Bio" label="Bio"
previewButton previewButton
/> />
<FileInput label="Profile image" image bind:files={profileImage} /> <ImageInput label="Profile image" bind:files={profileImage} />
<TextInput label="Email" bind:value={formData.email} /> <TextInput label="Email" bind:value={formData.email} />
<TextInput <TextInput
label="Matrix User" label="Matrix User"
@@ -190,9 +185,7 @@
Save Save
</Button> </Button>
{:else} {:else}
<Card cardColor="warning" class="p-5"> <Material padding="lg">The API didn't return your user settings.</Material>
The API didn't return your user settings.
</Card>
{/if} {/if}
<Button <Button
on:click={() => deleteAccount(0)} on:click={() => deleteAccount(0)}
+1
View File
@@ -14,6 +14,7 @@
}} }}
/> />
{:else} {:else}
User data is missing.
<pre> <pre>
{JSON.stringify(data)} {JSON.stringify(data)}
</pre> </pre>
+3 -7
View File
@@ -1,14 +1,10 @@
<script lang="ts"> <script lang="ts">
import type { CommentView, PostView } from 'lemmy-js-client' import type { CommentView, PostView } from 'lemmy-js-client'
import InboxItem from '../inbox/InboxItem.svelte'
import Card from '$lib/components/ui/Card.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Link from '$lib/components/input/Link.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte' import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
import Button from '$lib/components/input/Button.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { Button, Material } from 'mono-svelte'
export let data export let data
@@ -30,7 +26,7 @@
{#each data.data as item, index} {#each data.data as item, index}
<div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}> <div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}>
{#if isComment(item)} {#if isComment(item)}
<Card class="flex flex-col bg-white rounded-md p-5 flex-1"> <Material padding="lg" color="distinct" class="flex flex-col flex-1">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<PostMeta <PostMeta
title={item.post.name} title={item.post.name}
@@ -48,7 +44,7 @@
<Button class="ml-auto" href="/comment/{item.comment.id}"> <Button class="ml-auto" href="/comment/{item.comment.id}">
Jump Jump
</Button> </Button>
</Card> </Material>
{:else} {:else}
<Post post={item} /> <Post post={item} />
{/if} {/if}
+36 -15
View File
@@ -1,17 +1,13 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import Button from '$lib/components/input/Button.svelte' import { profile } from '$lib/auth.js'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte' import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte' import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
import Post from '$lib/components/lemmy/post/Post.svelte' import Post from '$lib/components/lemmy/post/Post.svelte'
import UserItem from '$lib/components/lemmy/user/UserItem.svelte' import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import { import {
isCommentView, isCommentView,
isCommunityView, isCommunityView,
@@ -25,15 +21,21 @@
PersonView, PersonView,
PostView, PostView,
} from 'lemmy-js-client' } from 'lemmy-js-client'
import { Icon, MagnifyingGlass } from 'svelte-hero-icons' import { Button, Select, Spinner, TextInput } from 'mono-svelte'
import { expoInOut, expoOut } from 'svelte/easing' import {
import { fly, slide } from 'svelte/transition' AdjustmentsHorizontal,
Bars3BottomRight,
Icon,
MagnifyingGlass,
} from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import { slide } from 'svelte/transition'
type Result = PostView | CommentView | PersonView | CommunityView type Result = PostView | CommentView | PersonView | CommunityView
export let data export let data
let query = '' let query = data.query || ''
let pageNum = data.page let pageNum = data.page
</script> </script>
@@ -44,11 +46,20 @@
<h1 class="font-bold text-2xl">Search</h1> <h1 class="font-bold text-2xl">Search</h1>
<div class="flex flex-row flex-wrap sm:justify-between items-center gap-4 mt-4"> <div class="flex flex-row flex-wrap sm:justify-between items-center gap-4 mt-4">
<MultiSelect <Select
options={['All', 'Posts', 'Comments', 'Communities', 'Users']} bind:value={data.type}
selected={$page.url.searchParams.get('type') ?? 'All'} on:change={() => searchParam($page.url, 'type', data.type ?? 'All', 'page')}
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} >
/> <span slot="label" class="flex items-center gap-1">
<Icon src={AdjustmentsHorizontal} mini size="15" />
Type
</span>
<option value="All">All</option>
<option value="Posts">Posts</option>
<option value="Comments">Comments</option>
<option value="Communities">Communities</option>
<option value="Users">Users</option>
</Select>
<div class="flex flex-row gap-2 items-center"> <div class="flex flex-row gap-2 items-center">
<TextInput <TextInput
bind:value={query} bind:value={query}
@@ -64,6 +75,16 @@
</Button> </Button>
</div> </div>
</div> </div>
<div class="max-w-sm mt-2">
<ObjectAutocomplete
label="Community"
jwt={$profile?.jwt}
listing_type={'All'}
showWhenEmpty={true}
on:select={(c) =>
searchParam($page.url, 'community', c.detail?.id || undefined, 'page')}
/>
</div>
{#if !data.results} {#if !data.results}
<Placeholder <Placeholder
icon={MagnifyingGlass} icon={MagnifyingGlass}
+10 -4
View File
@@ -15,15 +15,15 @@ import { get } from 'svelte/store'
export async function load({ url, fetch }) { export async function load({ url, fetch }) {
const query = url.searchParams.get('q') const query = url.searchParams.get('q')
const page = Number(url.searchParams.get('page')) || 1 const page = Number(url.searchParams.get('page')) || 1
const community = url.searchParams.get('community_name') const community = Number(url.searchParams.get('community')) || undefined
const sort = url.searchParams.get('sort') const sort = url.searchParams.get('sort') || 'New'
const type = url.searchParams.get('type') const type = url.searchParams.get('type') || 'All'
if (query) { if (query) {
const results = await getClient(undefined, fetch).search({ const results = await getClient(undefined, fetch).search({
q: query, q: query,
auth: get(profile)?.jwt, auth: get(profile)?.jwt,
community_name: community ?? undefined, community_id: community ?? undefined,
limit: 40, limit: 40,
page: page, page: page,
sort: (sort as SortType) || 'New', sort: (sort as SortType) || 'New',
@@ -44,7 +44,10 @@ export async function load({ url, fetch }) {
) )
return { return {
type: type,
sort: sort,
page: page, page: page,
query: query,
results: everything, results: everything,
streamed: { streamed: {
object: get(profile)?.jwt object: get(profile)?.jwt
@@ -59,5 +62,8 @@ export async function load({ url, fetch }) {
return { return {
page: 1, page: 1,
sort: sort,
type: type,
query: query,
} }
} }
+30 -24
View File
@@ -1,19 +1,21 @@
<script lang="ts"> <script lang="ts">
import Switch from '$lib/components/input/Switch.svelte'
import { defaultSettings, userSettings } from '$lib/settings' import { defaultSettings, userSettings } from '$lib/settings'
import Setting from './Setting.svelte' import Setting from './Setting.svelte'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Sort from '$lib/components/lemmy/Sort.svelte' import Sort from '$lib/components/lemmy/Sort.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js' import { toast } from 'mono-svelte'
import Button from '$lib/components/input/Button.svelte'
import { getInboxNotifications } from '$lib/auth.js'
import Checkbox from '$lib/components/input/Checkbox.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte' import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import Link from '$lib/components/input/Link.svelte' import Link from '$lib/components/input/Link.svelte'
import { ArrowLeftCircle, ArrowPath, Icon } from 'svelte-hero-icons' import {
import TextArea from '$lib/components/input/TextArea.svelte' ArrowPath,
ChatBubbleOvalLeftEllipsis,
GlobeAmericas,
Icon,
} from 'svelte-hero-icons'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte' import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js' import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
import { Button, Checkbox, Select } from 'mono-svelte'
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
let data = { let data = {
loading: false, loading: false,
@@ -36,7 +38,7 @@
}} }}
class="font-normal" class="font-normal"
> >
<Icon src={ArrowPath} mini size="16" slot="icon" /> <Icon src={ArrowPath} mini size="16" slot="prefix" />
Reset to default Reset to default
</Button> </Button>
</h1> </h1>
@@ -46,22 +48,30 @@
<span slot="description">The default sort to use for feeds.</span> <span slot="description">The default sort to use for feeds.</span>
<div class="flex flex-wrap flex-row gap-4 w-full"> <div class="flex flex-wrap flex-row gap-4 w-full">
<div class="max-w-full"> <div class="max-w-full">
<span class="block my-1 font-bold">Feed</span> <Select bind:value={$userSettings.defaultSort.feed} class="w-28">
<MultiSelect <span slot="label" class="flex items-center gap-1">
options={['Subscribed', 'Local', 'All']} <Icon src={GlobeAmericas} size="16" mini />
bind:selected={$userSettings.defaultSort.feed} Location
/> </span>
<option value="All">All</option>
<option value="Local">Local</option>
<option value="Subscribed">Subscribed</option>
</Select>
</div> </div>
<div class="max-w-full"> <div class="max-w-full">
<span class="block my-1 font-bold">Sort</span>
<Sort bind:selected={$userSettings.defaultSort.sort} navigate={false} /> <Sort bind:selected={$userSettings.defaultSort.sort} navigate={false} />
</div> </div>
<div class="max-w-full"> <div class="max-w-full">
<span class="block my-1 font-bold">Comments</span> <Select bind:value={$userSettings.defaultSort.comments}>
<MultiSelect <span slot="label" class="flex items-center gap-1">
options={['Hot', 'Top', 'New']} <Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
bind:selected={$userSettings.defaultSort.comments} Comments
/> </span>
<option value="Hot">Hot</option>
<option value="Top">Top</option>
<option value="New">New</option>
</Select>
</div> </div>
</div> </div>
</Setting> </Setting>
@@ -121,11 +131,7 @@
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Post style</span> <span slot="title">Post style</span>
<MultiSelect <ViewSelect />
options={[false, true]}
optionNames={['Cards', 'Compact']}
bind:selected={$userSettings.showCompactPosts}
/>
</Setting> </Setting>
<Setting> <Setting>
<Checkbox bind:checked={$userSettings.nsfwBlur} slot="title"> <Checkbox bind:checked={$userSettings.nsfwBlur} slot="title">
+3 -3
View File
@@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import Card from '$lib/components/ui/Card.svelte' import { Material } from 'mono-svelte'
</script> </script>
<Card class="flex flex-col gap-3 p-5 text-sm my-2"> <Material padding="lg" class="flex flex-col gap-3 my-2">
<h1 class="font-bold"><slot name="title" /></h1> <h1 class="font-bold"><slot name="title" /></h1>
{#if $$slots.description} {#if $$slots.description}
<p class="text-slate-700 dark:text-zinc-300"> <p class="text-slate-700 dark:text-zinc-300">
@@ -10,4 +10,4 @@
</p> </p>
{/if} {/if}
<slot /> <slot />
</Card> </Material>
+2 -3
View File
@@ -1,10 +1,9 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import Button from '$lib/components/input/Button.svelte' import { toast } from 'mono-svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { DEFAULT_INSTANCE_URL } from '$lib/instance.js' import { DEFAULT_INSTANCE_URL } from '$lib/instance.js'
import { validateInstance } from '$lib/lemmy.js' import { validateInstance } from '$lib/lemmy.js'
import { Button, TextInput } from 'mono-svelte'
let instance: string = '' let instance: string = ''
let validating: boolean = false let validating: boolean = false
+15 -16
View File
@@ -2,17 +2,14 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import { setUser } from '$lib/auth.js' import { setUser } from '$lib/auth.js'
import Button from '$lib/components/input/Button.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte' import Avatar from '$lib/components/ui/Avatar.svelte'
import Card from '$lib/components/ui/Card.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte' import { Material, Spinner, toast } from 'mono-svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import type { GetCaptchaResponse } from 'lemmy-js-client' import type { GetCaptchaResponse } from 'lemmy-js-client'
import { Button, TextInput } from 'mono-svelte'
import { import {
ArrowPath, ArrowPath,
ExclamationCircle, ExclamationCircle,
@@ -133,18 +130,15 @@
type="password" type="password"
/> />
{#if data.site_view.local_site.registration_mode == 'RequireApplication'} {#if data.site_view.local_site.registration_mode == 'RequireApplication'}
<Card <Material class="dark:text-yellow-200 text-yellow-800 bg-yellow-500/20">
class="p-4 dark:text-yellow-200 text-yellow-800"
cardColor="warning"
>
<Icon src={ExclamationTriangle} mini size="20" /> <Icon src={ExclamationTriangle} mini size="20" />
To join this instance, you need to fill out this application, and wait to To join this instance, you need to fill out this application, and wait to
be accepted. be accepted.
</Card> </Material>
{#if data.site_view.local_site.application_question} {#if data.site_view.local_site.application_question}
<Markdown source={data.site_view.local_site.application_question} /> <Markdown source={data.site_view.local_site.application_question} />
{/if} {/if}
<TextArea <MarkdownEditor
label="Application" label="Application"
required required
placeholder="i like this instance's icon " placeholder="i like this instance's icon "
@@ -166,16 +160,21 @@
/> />
<audio controls src={captchaAudio} /> <audio controls src={captchaAudio} />
{:else} {:else}
<Card cardColor="warning" class="p-3 flex gap-2"> <Material
class="flex gap-2 dark:text-yellow-200 text-yellow-800 bg-yellow-500/20"
>
<Icon src={QuestionMarkCircle} mini size="24" /> <Icon src={QuestionMarkCircle} mini size="24" />
No captcha was returned No captcha was returned
</Card> </Material>
{/if} {/if}
{:catch err} {:catch err}
<Card cardColor="error" class="p-3 flex gap-2"> <Material
padding="sm"
class="flex gap-2 dark:text-yellow-200 text-yellow-800 bg-yellow-500/20"
>
<Icon src={ExclamationCircle} mini size="24" /> <Icon src={ExclamationCircle} mini size="24" />
{err} {err}
</Card> </Material>
{/await} {/await}
<Button on:click={() => getCaptcha()} size="square-md"> <Button on:click={() => getCaptcha()} size="square-md">
<Icon src={ArrowPath} size="16" mini /> <Icon src={ArrowPath} size="16" mini />
+39 -29
View File
@@ -6,7 +6,10 @@
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte' import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { import {
AdjustmentsHorizontal,
Bars3BottomRight,
Calendar, Calendar,
ChartBar,
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
Envelope, Envelope,
Icon, Icon,
@@ -14,9 +17,7 @@
PencilSquare, PencilSquare,
ShieldCheck, ShieldCheck,
ShieldExclamation, ShieldExclamation,
UserPlus,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import Button from '$lib/components/input/Button.svelte'
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte' import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import { page } from '$app/stores' import { page } from '$app/stores'
@@ -24,18 +25,15 @@
import { isCommentView } from '$lib/lemmy/item.js' import { isCommentView } from '$lib/lemmy/item.js'
import { getClient } from '$lib/lemmy.js' import { getClient } from '$lib/lemmy.js'
import { isBlocked } from '$lib/lemmy/user.js' import { isBlocked } from '$lib/lemmy/user.js'
import MultiSelect from '$lib/components/input/MultiSelect.svelte' import { Menu, MenuButton, toast } from 'mono-svelte'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import Modal from '$lib/components/ui/modal/Modal.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import TextArea from '$lib/components/input/TextArea.svelte'
import { profile } from '$lib/auth.js' import { profile } from '$lib/auth.js'
import { ban, isAdmin } from '$lib/components/lemmy/moderation/moderation.js' import { ban, isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte' import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { searchParam } from '$lib/util.js' import { searchParam } from '$lib/util.js'
import Placeholder from '$lib/components/ui/Placeholder.svelte' import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { Button, Modal, Select } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
export let data export let data
@@ -122,7 +120,7 @@
<p class="inline-flex flex-row gap-2 items-center"> <p class="inline-flex flex-row gap-2 items-center">
Sending <UserLink avatar user={data.person_view.person} /> a message Sending <UserLink avatar user={data.person_view.person} /> a message
</p> </p>
<TextArea <MarkdownEditor
bind:value={message} bind:value={message}
label="Message" label="Message"
placeholder="your hair looks nice today" placeholder="your hair looks nice today"
@@ -143,19 +141,31 @@
<div class="flex flex-col-reverse xl:flex-row gap-4 max-w-full w-full"> <div class="flex flex-col-reverse xl:flex-row gap-4 max-w-full w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0"> <div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<div class="flex flex-row gap-4 flex-wrap"> <div class="flex flex-row gap-4 flex-wrap justify-between">
<MultiSelect <Select
options={['New', 'TopAll', 'Old']} bind:value={data.sort}
optionNames={['New', 'Top', 'Old']} on:change={() => searchParam($page.url, 'sort', data.sort, 'page')}
selected={data.sort} >
on:select={(e) => searchParam($page.url, 'sort', e.detail, 'page')} <span slot="label" class="flex items-center gap-1">
/> <Icon src={ChartBar} size="14" mini />
<MultiSelect Sort
options={['all', 'posts', 'comments']} </span>
optionNames={['All', 'Posts', 'Comments']} <option value="New">New</option>
selected={data.type} <option value="TopAll">Top</option>
on:select={(e) => searchParam($page.url, 'type', e.detail, 'page')} <option value="Old">Old</option>
/> </Select>
<Select
bind:value={data.type}
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
>
<span slot="label" class="flex items-center gap-1">
<Icon src={AdjustmentsHorizontal} size="15" mini />
Type
</span>
<option value="all">All</option>
<option value="posts">Posts</option>
<option value="comments">Comments</option>
</Select>
</div> </div>
{#if data.items.length == 0} {#if data.items.length == 0}
<Placeholder <Placeholder
@@ -212,7 +222,7 @@
on:click={() => (messaging = true)} on:click={() => (messaging = true)}
class="flex-1" class="flex-1"
> >
<Icon slot="icon" solid size="16" src={Envelope} /> <Icon slot="prefix" solid size="16" src={Envelope} />
Message Message
</Button> </Button>
{#if data.person_view.person.matrix_user_id} {#if data.person_view.person.matrix_user_id}
@@ -223,7 +233,7 @@
.matrix_user_id}" .matrix_user_id}"
class="flex-1" class="flex-1"
> >
<Icon slot="icon" solid size="16" src={ShieldCheck} /> <Icon slot="prefix" solid size="16" src={ShieldCheck} />
Matrix User Matrix User
</Button> </Button>
{/if} {/if}
@@ -235,23 +245,23 @@
disabled={blocking} disabled={blocking}
on:click={() => blockUser(data.person_view.person.id)} on:click={() => blockUser(data.person_view.person.id)}
> >
<Icon slot="icon" mini size="16" src={NoSymbol} /> <Icon slot="prefix" mini size="16" src={NoSymbol} />
{isBlocked($profile.user, data.person_view.person.id) {isBlocked($profile.user, data.person_view.person.id)
? 'Unblock' ? 'Unblock'
: 'Block'} : 'Block'}
</Button> </Button>
</div> </div>
{#if isAdmin($profile?.user)} {#if isAdmin($profile?.user)}
<Menu let:toggleOpen class="ml-auto" alignment="bottom-right"> <Menu class="ml-auto" origin="bottom-right">
<Button size="square-md" on:click={toggleOpen} slot="button"> <Button size="square-md" slot="target">
<ShieldIcon width={16} filled /> <ShieldIcon width={16} filled />
</Button> </Button>
<MenuButton <MenuButton
color="dangerSecondary" color="danger-subtle"
on:click={() => on:click={() =>
ban(data.person_view.person.banned, data.person_view.person)} ban(data.person_view.person.banned, data.person_view.person)}
> >
<Icon slot="icon" mini size="16" src={ShieldExclamation} /> <Icon slot="prefix" mini size="16" src={ShieldExclamation} />
{data.person_view.person.banned ? 'Unban' : 'Ban'} {data.person_view.person.banned ? 'Unban' : 'Ban'}
</MenuButton> </MenuButton>
</Menu> </Menu>
Binary file not shown.
+18 -12
View File
@@ -1,31 +1,37 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
export default { export default {
content: ['src/**/*.{js,ts,svelte,html}'], content: [
'src/**/*.{js,ts,svelte,html}',
'node_modules/mono-svelte/**/*.{js,ts,svelte,html}',
],
darkMode: 'class', darkMode: 'class',
theme: { theme: {
fontFamily: { fontFamily: {
'sans': ['sans-serif'], sans: ['sans-serif'],
'system': ['system-ui'], system: ['system-ui'],
'serif': ['serif'] serif: ['serif'],
}, },
extend: { extend: {
animation: { animation: {
'pop-in': 'pop-in 0.25s ease-out forwards' 'pop-in': 'pop-in 0.25s ease-out forwards',
}, },
keyframes: { keyframes: {
'pop-in': { 'pop-in': {
'0%, 100%': { transform: 'translateX(8px)', opacity: 0 } '0%, 100%': { transform: 'translateX(8px)', opacity: 0 },
} },
}, },
colors: { colors: {
'zinc': { zinc: {
700: '#34343b', 700: '#34343b',
800: '#1f1f24', 800: '#1f1f24',
900: '#121215' 900: '#121215',
} },
} primary: {
100: '#f1f5f9',
900: '#0f172a',
},
},
}, },
}, },
plugins: [], plugins: [],
} }
+139 -17
View File
@@ -7,7 +7,7 @@
resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30"
integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==
"@ampproject/remapping@^2.2.0": "@ampproject/remapping@^2.2.0", "@ampproject/remapping@^2.2.1":
version "2.2.1" version "2.2.1"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630"
integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==
@@ -1109,6 +1109,11 @@
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78"
integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==
"@jridgewell/resolve-uri@^3.1.0":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==
"@jridgewell/set-array@^1.0.1": "@jridgewell/set-array@^1.0.1":
version "1.1.2" version "1.1.2"
resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72"
@@ -1140,6 +1145,14 @@
"@jridgewell/resolve-uri" "3.1.0" "@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14" "@jridgewell/sourcemap-codec" "1.4.14"
"@jridgewell/trace-mapping@^0.3.18":
version "0.3.19"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811"
integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==
dependencies:
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
"@nodelib/fs.scandir@2.1.5": "@nodelib/fs.scandir@2.1.5":
version "2.1.5" version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@@ -1280,10 +1293,10 @@
"@rollup/plugin-node-resolve" "^15.0.1" "@rollup/plugin-node-resolve" "^15.0.1"
rollup "^3.7.0" rollup "^3.7.0"
"@sveltejs/kit@^1.5.0": "@sveltejs/kit@^1.24.0":
version "1.22.3" version "1.24.0"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.22.3.tgz#2330eaa7db3e5ee592fd42a4d68cff9d12e9fe28" resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.24.0.tgz#96f394738f130e3ef4d9e0bc22cb6b90b40c9e61"
integrity sha512-IpHD5wvuoOIHYaHQUBJ1zERD2Iz+fB/rBXhXjl8InKw6X4VKE9BSus+ttHhE7Ke+Ie9ecfilzX8BnWE3FeQyng== integrity sha512-r7Gj0/VcdAIRL1yE1cJ5rurWJ5drrR7BzRv+P+NAathtvnMCi0u4FhezO7T4bj7DJdQ3TNsax3yQcrVWxh60fg==
dependencies: dependencies:
"@sveltejs/vite-plugin-svelte" "^2.4.1" "@sveltejs/vite-plugin-svelte" "^2.4.1"
"@types/cookie" "^0.5.1" "@types/cookie" "^0.5.1"
@@ -1296,7 +1309,8 @@
sade "^1.8.1" sade "^1.8.1"
set-cookie-parser "^2.6.0" set-cookie-parser "^2.6.0"
sirv "^2.0.2" sirv "^2.0.2"
undici "~5.22.0" tiny-glob "^0.2.9"
undici "~5.23.0"
"@sveltejs/vite-plugin-svelte-inspector@^1.0.3": "@sveltejs/vite-plugin-svelte-inspector@^1.0.3":
version "1.0.3" version "1.0.3"
@@ -1340,7 +1354,7 @@
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.5.1.tgz#b29aa1f91a59f35e29ff8f7cb24faf1a3a750554" resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.5.1.tgz#b29aa1f91a59f35e29ff8f7cb24faf1a3a750554"
integrity sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g== integrity sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==
"@types/estree@*", "@types/estree@^1.0.0": "@types/estree@*", "@types/estree@^1.0.0", "@types/estree@^1.0.1":
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194"
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==
@@ -1470,7 +1484,7 @@ acorn-walk@^8.2.0:
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
acorn@^8.8.2, acorn@^8.9.0: acorn@^8.10.0, acorn@^8.8.2, acorn@^8.9.0:
version "8.10.0" version "8.10.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5"
integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==
@@ -1534,6 +1548,13 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
aria-query@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e"
integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==
dependencies:
dequal "^2.0.3"
array-buffer-byte-length@^1.0.0: array-buffer-byte-length@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead"
@@ -1591,6 +1612,13 @@ available-typed-arrays@^1.0.5:
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
axobject-query@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a"
integrity sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==
dependencies:
dequal "^2.0.3"
babel-plugin-polyfill-corejs2@^0.4.4: babel-plugin-polyfill-corejs2@^0.4.4:
version "0.4.5" version "0.4.5"
resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz#8097b4cb4af5b64a1d11332b6fb72ef5e64a054c" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz#8097b4cb4af5b64a1d11332b6fb72ef5e64a054c"
@@ -1772,6 +1800,17 @@ chokidar@^3.4.1, chokidar@^3.5.3:
optionalDependencies: optionalDependencies:
fsevents "~2.3.2" fsevents "~2.3.2"
code-red@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/code-red/-/code-red-1.0.4.tgz#59ba5c9d1d320a4ef795bc10a28bd42bfebe3e35"
integrity sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"
"@types/estree" "^1.0.1"
acorn "^8.10.0"
estree-walker "^3.0.3"
periscopic "^3.1.0"
color-convert@^1.9.0: color-convert@^1.9.0:
version "1.9.3" version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
@@ -1857,6 +1896,14 @@ crypto-random-string@^2.0.0:
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
css-tree@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20"
integrity sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==
dependencies:
mdn-data "2.0.30"
source-map-js "^1.0.1"
cssesc@^3.0.0: cssesc@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
@@ -1915,6 +1962,11 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
dequal@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be"
integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
detect-indent@^6.1.0: detect-indent@^6.1.0:
version "6.1.0" version "6.1.0"
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6"
@@ -2095,6 +2147,13 @@ estree-walker@^2.0.2:
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
estree-walker@^3.0.0, estree-walker@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d"
integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==
dependencies:
"@types/estree" "^1.0.0"
esutils@^2.0.2: esutils@^2.0.2:
version "2.0.3" version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
@@ -2297,6 +2356,16 @@ globalthis@^1.0.3:
dependencies: dependencies:
define-properties "^1.1.3" define-properties "^1.1.3"
globalyzer@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465"
integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==
globrex@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
gopd@^1.0.1: gopd@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
@@ -2534,6 +2603,13 @@ is-reference@1.2.1:
dependencies: dependencies:
"@types/estree" "*" "@types/estree" "*"
is-reference@^3.0.0, is-reference@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-3.0.1.tgz#d400f4260f7e55733955e60d361d827eb4d3b831"
integrity sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==
dependencies:
"@types/estree" "*"
is-regex@^1.1.4: is-regex@^1.1.4:
version "1.1.4" version "1.1.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
@@ -2734,6 +2810,11 @@ local-pkg@^0.4.3:
resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963"
integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==
locate-character@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/locate-character/-/locate-character-3.0.0.tgz#0305c5b8744f61028ef5d01f444009e00779f974"
integrity sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==
lodash.debounce@^4.0.8: lodash.debounce@^4.0.8:
version "4.0.8" version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@@ -2810,6 +2891,11 @@ markdown-it@^13.0.1:
mdurl "^1.0.1" mdurl "^1.0.1"
uc.micro "^1.0.5" uc.micro "^1.0.5"
mdn-data@2.0.30:
version "2.0.30"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc"
integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==
mdurl@^1.0.1: mdurl@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
@@ -2891,6 +2977,11 @@ mlly@^1.2.0, mlly@^1.4.0:
pkg-types "^1.0.3" pkg-types "^1.0.3"
ufo "^1.1.2" ufo "^1.1.2"
mono-svelte@^0.2.19:
version "0.2.19"
resolved "https://registry.yarnpkg.com/mono-svelte/-/mono-svelte-0.2.19.tgz#3c413d1200a86128bad250c429051742a322ec28"
integrity sha512-OhCe8WVAJk3BMLwz0/ngvsi/qfyW+g5GrpwLTDmrrb0Zbeit477cPrDfCGWuG1S6FK2l9vB09uBj2TUIJbdl/w==
mri@^1.1.0: mri@^1.1.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
@@ -3030,6 +3121,15 @@ pathval@^1.1.1:
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d"
integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==
periscopic@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/periscopic/-/periscopic-3.1.0.tgz#7e9037bf51c5855bd33b48928828db4afa79d97a"
integrity sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==
dependencies:
"@types/estree" "^1.0.0"
estree-walker "^3.0.0"
is-reference "^3.0.0"
picocolors@^1.0.0: picocolors@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
@@ -3418,7 +3518,7 @@ sorcery@^0.11.0:
minimist "^1.2.0" minimist "^1.2.0"
sander "^0.5.0" sander "^0.5.0"
source-map-js@^1.0.2: source-map-js@^1.0.1, source-map-js@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
@@ -3601,10 +3701,24 @@ svelte-preprocess@^5.0.4:
sorcery "^0.11.0" sorcery "^0.11.0"
strip-indent "^3.0.0" strip-indent "^3.0.0"
svelte@^3.54.0: svelte@^4.2.0:
version "3.59.2" version "4.2.0"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.59.2.tgz#a137b28e025a181292b2ae2e3dca90bf8ec73aec" resolved "https://registry.yarnpkg.com/svelte/-/svelte-4.2.0.tgz#0e4304c15524450b22fba02516eb72efbd8847b6"
integrity sha512-vzSyuGr3eEoAtT/A6bmajosJZIUWySzY2CzB3w2pgPvnkUjGqlDnsNnA0PMO+mMAhuyMul6C2uuZzY6ELSkzyA== integrity sha512-kVsdPjDbLrv74SmLSUzAsBGquMs4MPgWGkGLpH+PjOYnFOziAvENVzgJmyOCV2gntxE32aNm8/sqNKD6LbIpeQ==
dependencies:
"@ampproject/remapping" "^2.2.1"
"@jridgewell/sourcemap-codec" "^1.4.15"
"@jridgewell/trace-mapping" "^0.3.18"
acorn "^8.9.0"
aria-query "^5.3.0"
axobject-query "^3.2.1"
code-red "^1.0.3"
css-tree "^2.3.1"
estree-walker "^3.0.3"
is-reference "^3.0.1"
locate-character "^3.0.0"
magic-string "^0.30.0"
periscopic "^3.1.0"
symbol-tree@^3.2.4: symbol-tree@^3.2.4:
version "3.2.4" version "3.2.4"
@@ -3678,6 +3792,14 @@ thenify-all@^1.0.0:
dependencies: dependencies:
any-promise "^1.0.0" any-promise "^1.0.0"
tiny-glob@^0.2.9:
version "0.2.9"
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2"
integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==
dependencies:
globalyzer "0.1.0"
globrex "^0.1.2"
tinybench@^2.5.0: tinybench@^2.5.0:
version "2.5.0" version "2.5.0"
resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.0.tgz#4711c99bbf6f3e986f67eb722fed9cddb3a68ba5" resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.0.tgz#4711c99bbf6f3e986f67eb722fed9cddb3a68ba5"
@@ -3837,10 +3959,10 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3" has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2" which-boxed-primitive "^1.0.2"
undici@~5.22.0: undici@~5.23.0:
version "5.22.1" version "5.23.0"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" resolved "https://registry.yarnpkg.com/undici/-/undici-5.23.0.tgz#e7bdb0ed42cebe7b7aca87ced53e6eaafb8f8ca0"
integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== integrity sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==
dependencies: dependencies:
busboy "^1.6.0" busboy "^1.6.0"