forked from coracle/flotilla
linting
This commit is contained in:
+11
-4
@@ -45,7 +45,14 @@ import {
|
||||
nip44EncryptToSelf,
|
||||
loadRelay,
|
||||
} from "@welshman/app"
|
||||
import {tagRoom, userMembership, MEMBERSHIPS, INDEXER_RELAYS, loadMembership, loadSettings} from "@app/state"
|
||||
import {
|
||||
tagRoom,
|
||||
userMembership,
|
||||
MEMBERSHIPS,
|
||||
INDEXER_RELAYS,
|
||||
loadMembership,
|
||||
loadSettings,
|
||||
} from "@app/state"
|
||||
|
||||
// Utils
|
||||
|
||||
@@ -98,7 +105,7 @@ export const loadUserData = (
|
||||
await sleep(300)
|
||||
|
||||
for (const pubkey of pubkeys) {
|
||||
loadMembership(pubkey),
|
||||
loadMembership(pubkey)
|
||||
loadProfile(pubkey)
|
||||
loadFollows(pubkey)
|
||||
loadMutes(pubkey)
|
||||
@@ -284,9 +291,9 @@ export const sendWrapped = async ({
|
||||
event: await nip59.wrap(recipient, stamp(template)),
|
||||
relays: ctx.app.router.PublishMessage(recipient).getUrls(),
|
||||
delay,
|
||||
})
|
||||
}),
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
<script lang="ts">
|
||||
import {readable, derived} from "svelte/store"
|
||||
import {hash, sleep, ellipsize, uniqBy, groupBy, now} from "@welshman/lib"
|
||||
import {readable} from "svelte/store"
|
||||
import {hash, ellipsize, uniqBy, groupBy} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {deriveEvents, throttled} from "@welshman/store"
|
||||
import {
|
||||
deriveProfile,
|
||||
deriveProfileDisplay,
|
||||
formatTimestampAsTime,
|
||||
pubkey,
|
||||
} from "@welshman/app"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {deriveProfile, deriveProfileDisplay, formatTimestampAsTime, pubkey} from "@welshman/app"
|
||||
import type {Thunk} from "@welshman/app"
|
||||
import {REACTION, ZAP_RESPONSE, displayRelayUrl} from "@welshman/util"
|
||||
import {REACTION, ZAP_RESPONSE} from "@welshman/util"
|
||||
import {repository} from "@welshman/app"
|
||||
import {slideAndFade, conditionalTransition} from '@lib/transition'
|
||||
import {slideAndFade, conditionalTransition} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Delay from "@lib/components/Delay.svelte"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
@@ -42,7 +37,7 @@
|
||||
const rootId = rootTag?.[1]
|
||||
const rootHints = [rootTag?.[2]].filter(Boolean) as string[]
|
||||
const rootEvent = rootId ? deriveEvent(rootId, rootHints) : readable(null)
|
||||
const [colorName, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||
|
||||
const transition = conditionalTransition(thunk, slideAndFade)
|
||||
|
||||
@@ -95,7 +90,10 @@
|
||||
<div class="flex w-full gap-3">
|
||||
{#if showPubkey}
|
||||
<Button on:click={showProfile}>
|
||||
<Avatar src={$profile?.picture} class="border border-solid border-base-content" size={10} />
|
||||
<Avatar
|
||||
src={$profile?.picture}
|
||||
class="border border-solid border-base-content"
|
||||
size={10} />
|
||||
</Button>
|
||||
{:else}
|
||||
<div class="w-10 min-w-10 max-w-10" />
|
||||
@@ -103,7 +101,7 @@
|
||||
<div class="-mt-1 flex-grow pr-1">
|
||||
{#if showPubkey}
|
||||
<div class="flex items-center gap-2">
|
||||
<Button class="font-bold text-sm" style="color: {colorValue}" on:click={showProfile}>
|
||||
<Button class="text-sm font-bold" style="color: {colorValue}" on:click={showProfile}>
|
||||
{$profileDisplay}
|
||||
</Button>
|
||||
<span class="text-xs opacity-50">{formatTimestampAsTime(event.created_at)}</span>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import {pubkey} from '@welshman/app'
|
||||
import {pubkey} from "@welshman/app"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Confirm from "@lib/components/Confirm.svelte"
|
||||
import EventInfo from "@app/components/EventInfo.svelte"
|
||||
import {publishDelete} from '@app/commands'
|
||||
import {pushModal} from '@app/modal'
|
||||
import {publishDelete} from "@app/commands"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
export let url
|
||||
export let event
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="menu rounded-box bg-base-100 p-2 shadow-xl whitespace-nowrap">
|
||||
<ul class="menu whitespace-nowrap rounded-box bg-base-100 p-2 shadow-xl">
|
||||
<li>
|
||||
<Button on:click={showInfo}>
|
||||
<Icon size={4} icon="code-2" />
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Tippy from "@lib/components/Tippy.svelte"
|
||||
import ChannelMessageMenu from "@app/components/ChannelMessageMenu.svelte"
|
||||
import {tagRoom} from "@app/state"
|
||||
import {publishReaction} from "@app/commands"
|
||||
|
||||
export let url, room, event
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {writable} from 'svelte/store'
|
||||
import {writable} from "svelte/store"
|
||||
import {assoc, sortBy, append} from "@welshman/lib"
|
||||
import {createEvent} from "@welshman/util"
|
||||
import type {EventContent, TrustedEvent} from "@welshman/util"
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
<script lang="ts">
|
||||
import {derived} from "svelte/store"
|
||||
import {type Instance} from "tippy.js"
|
||||
import {hash, sleep, uniqBy, groupBy, now} from "@welshman/lib"
|
||||
import {hash, uniqBy, groupBy} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {deriveEvents, throttled} from "@welshman/store"
|
||||
import {
|
||||
deriveProfile,
|
||||
deriveProfileDisplay,
|
||||
formatTimestampAsTime,
|
||||
pubkey,
|
||||
} from "@welshman/app"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {deriveProfile, deriveProfileDisplay, formatTimestampAsTime, pubkey} from "@welshman/app"
|
||||
import type {MergedThunk} from "@welshman/app"
|
||||
import {REACTION, ZAP_RESPONSE, displayRelayUrl} from "@welshman/util"
|
||||
import {REACTION, ZAP_RESPONSE} from "@welshman/util"
|
||||
import {repository} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Tippy from "@lib/components/Tippy.svelte"
|
||||
import Delay from "@lib/components/Delay.svelte"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Content from "@app/components/Content.svelte"
|
||||
@@ -95,7 +88,7 @@
|
||||
<div class="-mt-1 flex-grow pr-1">
|
||||
{#if showPubkey}
|
||||
<div class="flex items-center gap-2">
|
||||
<Button class="font-bold text-sm" style="color: {colorValue}" on:click={showProfile}>
|
||||
<Button class="text-sm font-bold" style="color: {colorValue}" on:click={showProfile}>
|
||||
{$profileDisplay}
|
||||
</Button>
|
||||
<span class="text-xs opacity-50">{formatTimestampAsTime(event.created_at)}</span>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {type Instance} from "tippy.js"
|
||||
import type {NativeEmoji} from "emoji-picker-element/shared"
|
||||
import {ctx, uniq, between} from "@welshman/lib"
|
||||
import {Nip59} from "@welshman/signer"
|
||||
import {between} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {signer, publishThunk} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Tippy from "@lib/components/Tippy.svelte"
|
||||
|
||||
@@ -70,8 +70,7 @@
|
||||
}
|
||||
|
||||
let warning =
|
||||
$userSettings?.values.hide_sensitive &&
|
||||
event.tags.find(nthEq(0, "content-warning"))?.[1]
|
||||
$userSettings?.values.hide_sensitive && event.tags.find(nthEq(0, "content-warning"))?.[1]
|
||||
|
||||
$: shortContent = showEntire
|
||||
? fullContent
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import {ellipsize, postJson} from "@welshman/lib"
|
||||
import {fade} from '@lib/transition'
|
||||
import {dufflepud, imgproxy} from "@app/state"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import ContentLinkDetail from '@app/components/ContentLinkDetail.svelte'
|
||||
import {pushModal} from '@app/modal'
|
||||
import ContentLinkDetail from "@app/components/ContentLinkDetail.svelte"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
export let value
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import {imgproxy} from "@app/state"
|
||||
|
||||
export let url
|
||||
@@ -7,6 +7,6 @@
|
||||
const back = () => history.back()
|
||||
</script>
|
||||
|
||||
<Button class="m-auto h-screen w-screen p-4 cursor-pointer" on:click={back}>
|
||||
<img alt="" src={imgproxy(url)} class="m-auto rounded-box max-w-full max-h-full" />
|
||||
<Button class="m-auto h-screen w-screen cursor-pointer p-4" on:click={back}>
|
||||
<img alt="" src={imgproxy(url)} class="m-auto max-h-full max-w-full rounded-box" />
|
||||
</Button>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from 'nostr-tools'
|
||||
import {nip19} from "nostr-tools"
|
||||
import {getPubkey} from "@welshman/signer"
|
||||
import {addSession} from "@welshman/app"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
@@ -18,7 +18,7 @@
|
||||
const onSubmit = async () => {
|
||||
let secret = key
|
||||
|
||||
if (secret.startsWith('nsec')) {
|
||||
if (secret.startsWith("nsec")) {
|
||||
secret = nip19.decode(secret).data as string
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
<div class="flex flex-col gap-2 {$$props.class}">
|
||||
{#if muted}
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="row-2 relative">
|
||||
<Icon icon="danger" class="mt-1" />
|
||||
<p>You have muted this person.<p>
|
||||
<p>You have muted this person.</p>
|
||||
</div>
|
||||
<Button class="link ml-8" on:click={ignoreMute}>Show anyway</Button>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<Icon icon="magnifer" />
|
||||
<input bind:value={term} class="grow" type="text" placeholder="Search for relays..." />
|
||||
</label>
|
||||
<div class="column -m-6 mt-0 p-6 pt-2 h-[50vh] gap-2 overflow-auto" bind:this={element}>
|
||||
<div class="column -m-6 mt-0 h-[50vh] gap-2 overflow-auto p-6 pt-2" bind:this={element}>
|
||||
{#each $relaySearch
|
||||
.searchValues(term)
|
||||
.filter(url => !$relays.includes(url))
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
<script lang="ts">
|
||||
import {nip19} from 'nostr-tools'
|
||||
import {goto} from '$app/navigation'
|
||||
import {hexToBytes} from '@noble/hashes/utils'
|
||||
import {nip19} from "nostr-tools"
|
||||
import {goto} from "$app/navigation"
|
||||
import {hexToBytes} from "@noble/hashes/utils"
|
||||
import {getPubkey, makeSecret} from "@welshman/signer"
|
||||
import {addSession} from "@welshman/app"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||
import InfoKeys from "@app/components/InfoKeys.svelte"
|
||||
import {loadUserData} from "@app/commands"
|
||||
import {pushModal, clearModals} from "@app/modal"
|
||||
import {clip} from "@app/toast"
|
||||
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from 'svelte'
|
||||
import {goto} from "$app/navigation"
|
||||
import {onMount} from "svelte"
|
||||
import {sleep, identity, nthEq} from "@welshman/lib"
|
||||
import {load} from "@welshman/app"
|
||||
import {displayRelayUrl, AUTH_INVITE} from "@welshman/util"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {slide} from '@lib/transition'
|
||||
import {slide} from "@lib/transition"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||
import {pushModal} from '@app/modal'
|
||||
import {clip} from '@app/toast'
|
||||
import {clip} from "@app/toast"
|
||||
|
||||
export let url
|
||||
|
||||
@@ -32,16 +29,14 @@
|
||||
sleep(2000),
|
||||
])
|
||||
|
||||
claim = event?.tags.find(nthEq(0, 'claim'))?.[1] || ""
|
||||
claim = event?.tags.find(nthEq(0, "claim"))?.[1] || ""
|
||||
loading = false
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="col-4">
|
||||
<ModalHeader>
|
||||
<div slot="title">
|
||||
Create an Invite
|
||||
</div>
|
||||
<div slot="title">Create an Invite</div>
|
||||
<div slot="info">
|
||||
Get a link that you can use to invite people to
|
||||
<span class="text-primary">{displayRelayUrl(url)}</span>
|
||||
@@ -65,8 +60,8 @@
|
||||
<p slot="info">
|
||||
This invite link can be used by clicking "Add Space" and pasting it there.
|
||||
{#if !claim}
|
||||
This space did not issue a claim for this link, so additional steps might be
|
||||
required for people using this invite link.
|
||||
This space did not issue a claim for this link, so additional steps might be required
|
||||
for people using this invite link.
|
||||
{/if}
|
||||
</p>
|
||||
</Field>
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<script lang="ts">
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import {PublishStatus} from "@welshman/net"
|
||||
import {mergeThunks, publishThunk} from "@welshman/app"
|
||||
import type {Thunk, MergedThunk} from "@welshman/app"
|
||||
import {throttled} from "@welshman/store"
|
||||
import Icon from '@lib/components/Icon.svelte'
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Tippy from "@lib/components/Tippy.svelte"
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import ThunkStatusDetail from '@app/components/ThunkStatusDetail.svelte'
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import ThunkStatusDetail from "@app/components/ThunkStatusDetail.svelte"
|
||||
|
||||
export let thunk: Thunk | MergedThunk
|
||||
|
||||
const {Pending, Success, Failure, Timeout} = PublishStatus
|
||||
const {Pending, Failure, Timeout} = PublishStatus
|
||||
|
||||
const abort = () => thunk.controller.abort()
|
||||
|
||||
@@ -30,7 +29,7 @@
|
||||
</script>
|
||||
|
||||
{#if canCancel || isPending}
|
||||
<span class="flex gap-1 mt-2 items-center">
|
||||
<span class="mt-2 flex items-center gap-1">
|
||||
<span class="loading loading-spinner mx-1 h-3 w-3 translate-y-px" />
|
||||
<span class="opacity-50">Sending...</span>
|
||||
{#if canCancel}
|
||||
@@ -43,7 +42,7 @@
|
||||
component={ThunkStatusDetail}
|
||||
props={{url, message, status, retry}}
|
||||
params={{interactive: true}}>
|
||||
<span class="flex tooltip cursor-pointer gap-1 mt-2 items-center">
|
||||
<span class="tooltip mt-2 flex cursor-pointer items-center gap-1">
|
||||
<Icon icon="danger" size={3} />
|
||||
<span class="opacity-50">Failed to send!</span>
|
||||
</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {PublishStatus} from '@welshman/net'
|
||||
import {displayRelayUrl} from '@welshman/util'
|
||||
import Button from '@lib/components/Button.svelte'
|
||||
import {PublishStatus} from "@welshman/net"
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
|
||||
export let url: string
|
||||
export let status: string
|
||||
|
||||
+7
-12
@@ -11,7 +11,6 @@ import {
|
||||
uniq,
|
||||
partition,
|
||||
nth,
|
||||
max,
|
||||
pushToMapKey,
|
||||
nthEq,
|
||||
shuffle,
|
||||
@@ -20,12 +19,10 @@ import {
|
||||
import {
|
||||
getIdFilters,
|
||||
WRAP,
|
||||
RELAYS,
|
||||
REACTION,
|
||||
ZAP_RESPONSE,
|
||||
DIRECT_MESSAGE,
|
||||
getRelayTagValues,
|
||||
isShareableRelayUrl,
|
||||
getPubkeyTagValues,
|
||||
isHashedEvent,
|
||||
displayProfile,
|
||||
@@ -41,9 +38,7 @@ import {
|
||||
pubkey,
|
||||
repository,
|
||||
load,
|
||||
subscribe,
|
||||
collection,
|
||||
loadRelay,
|
||||
profilesByPubkey,
|
||||
getDefaultAppContext,
|
||||
getDefaultNetContext,
|
||||
@@ -180,7 +175,7 @@ export const pullConservatively = ({relays, filters}: AppSyncOpts) => {
|
||||
const events = sortBy(e => -e.created_at, repository.query(filters))
|
||||
|
||||
if (events.length > 100) {
|
||||
filters = filters.map(assoc('since', events[100]!.created_at))
|
||||
filters = filters.map(assoc("since", events[100]!.created_at))
|
||||
}
|
||||
|
||||
promises.push(pull({relays: dumb, filters}))
|
||||
@@ -247,10 +242,10 @@ export const deriveEventsForUrl = (url: string, kinds: number[]) =>
|
||||
export const SETTINGS = 38489
|
||||
|
||||
export type Settings = {
|
||||
event: TrustedEvent,
|
||||
event: TrustedEvent
|
||||
values: {
|
||||
hide_sensitive: boolean
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultSettings = {
|
||||
@@ -260,8 +255,10 @@ export const defaultSettings = {
|
||||
export const settings = deriveEventsMapped<Settings>(repository, {
|
||||
filters: [{kinds: [SETTINGS]}],
|
||||
itemToEvent: item => item.event,
|
||||
eventToItem: async (event: TrustedEvent) =>
|
||||
({event, values: {...defaultSettings, ...parseJson(await ensurePlaintext(event))}})
|
||||
eventToItem: async (event: TrustedEvent) => ({
|
||||
event,
|
||||
values: {...defaultSettings, ...parseJson(await ensurePlaintext(event))},
|
||||
}),
|
||||
})
|
||||
|
||||
export const {
|
||||
@@ -276,8 +273,6 @@ export const {
|
||||
load({...request, filters: [{kinds: [SETTINGS], authors: [pubkey]}]}),
|
||||
})
|
||||
|
||||
|
||||
|
||||
// Membership
|
||||
|
||||
export const getMembershipUrls = (list?: List) => sort(getRelayTagValues(getListTags(list)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {sleep} from '@welshman/lib'
|
||||
import {sleep} from "@welshman/lib"
|
||||
|
||||
export let delay = 1
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script lang="ts">
|
||||
import {noop} from '@welshman/lib'
|
||||
import {noop} from "@welshman/lib"
|
||||
import {fade, fly} from "@lib/transition"
|
||||
|
||||
export let onClose: any = noop
|
||||
export let fullscreen = false
|
||||
|
||||
$: extraClass = !fullscreen && "card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px]"
|
||||
$: extraClass =
|
||||
!fullscreen && "card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px]"
|
||||
</script>
|
||||
|
||||
<div class="center fixed inset-0 z-modal">
|
||||
@@ -13,7 +14,7 @@
|
||||
class="absolute inset-0 cursor-pointer bg-black opacity-75"
|
||||
transition:fade={{duration: 300}}
|
||||
on:click={onClose} />
|
||||
<div class="relative scroll-container {extraClass}" transition:fly={{duration: 300}}>
|
||||
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="max-h-screen flex-grow overflow-auto bg-base-200 pb-14 sm:pb-0 scroll-container">
|
||||
<div class="scroll-container max-h-screen flex-grow overflow-auto bg-base-200 pb-14 sm:pb-0">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
popover = tippy(element, {
|
||||
content: target,
|
||||
animation: "shift-away",
|
||||
appendTo: document.querySelector('.tippy-target')!,
|
||||
appendTo: document.querySelector(".tippy-target")!,
|
||||
...params,
|
||||
})
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
} from "@welshman/app"
|
||||
import Avatar from "@lib/components/Avatar.svelte"
|
||||
import WotScore from "@lib/components/WotScore.svelte"
|
||||
import ProfileDetail from "@app/components/ProfileDetail.svelte"
|
||||
import {pushDrawer} from "@app/modal"
|
||||
|
||||
export let value
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ export const createScroller = ({
|
||||
let done = false
|
||||
|
||||
const check = async () => {
|
||||
const container = element.closest('.scroll-container')
|
||||
const container = element.closest(".scroll-container")
|
||||
|
||||
if (container) {
|
||||
// While we have empty space, fill it
|
||||
|
||||
@@ -9,8 +9,8 @@ export const fly = (node: Element, params?: FlyParams | undefined) =>
|
||||
baseFly(node, {y: 20, ...params})
|
||||
|
||||
export type TranslateParams = {
|
||||
delay?: number,
|
||||
duration?: number,
|
||||
delay?: number
|
||||
duration?: number
|
||||
easing?: (t: number) => number
|
||||
axis?: "x" | "y"
|
||||
reverse?: boolean
|
||||
@@ -18,7 +18,7 @@ export type TranslateParams = {
|
||||
|
||||
export const translate = (
|
||||
node: Element,
|
||||
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {}
|
||||
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {},
|
||||
) => {
|
||||
return {
|
||||
delay,
|
||||
@@ -32,7 +32,7 @@ export const translate = (
|
||||
} else {
|
||||
return `transform: translateY(${p})`
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,5 +75,6 @@ export function slideAndFade(
|
||||
}
|
||||
}
|
||||
|
||||
export const conditionalTransition = (condition: any, transition: any) =>
|
||||
(node: any, args?: any) => condition ? transtion(node, args) : null
|
||||
export const conditionalTransition =
|
||||
(condition: any, transition: any) => (node: any, args?: any) =>
|
||||
condition ? transtion(node, args) : null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {derived} from 'svelte/store'
|
||||
import {addToMapKey, dec, gt, inc} from "@welshman/lib"
|
||||
import {derived} from "svelte/store"
|
||||
import {addToMapKey, dec, gt} from "@welshman/lib"
|
||||
import type {Relay} from "@welshman/app"
|
||||
import {relays, createSearch, relaySelections} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
@@ -12,24 +12,27 @@
|
||||
import RelayDescription from "@app/components/RelayDescription.svelte"
|
||||
import SpaceCheck from "@app/components/SpaceCheck.svelte"
|
||||
import ProfileCircles from "@app/components/ProfileCircles.svelte"
|
||||
import {userMembership, memberships, membershipByPubkey, getMembershipUrls, getDefaultPubkeys} from "@app/state"
|
||||
import {
|
||||
userMembership,
|
||||
memberships,
|
||||
membershipByPubkey,
|
||||
getMembershipUrls,
|
||||
getDefaultPubkeys,
|
||||
} from "@app/state"
|
||||
import {discoverRelays} from "@app/commands"
|
||||
import {pushModal} from "@app/modal"
|
||||
|
||||
const wotGraph = derived(
|
||||
membershipByPubkey,
|
||||
$m => {
|
||||
const scores = new Map<string, Set<string>>()
|
||||
const wotGraph = derived(membershipByPubkey, $m => {
|
||||
const scores = new Map<string, Set<string>>()
|
||||
|
||||
for (const pubkey of getDefaultPubkeys()) {
|
||||
for (const url of getMembershipUrls($m.get(pubkey))) {
|
||||
addToMapKey(scores, url, pubkey)
|
||||
}
|
||||
for (const pubkey of getDefaultPubkeys()) {
|
||||
for (const url of getMembershipUrls($m.get(pubkey))) {
|
||||
addToMapKey(scores, url, pubkey)
|
||||
}
|
||||
|
||||
return scores
|
||||
}
|
||||
)
|
||||
|
||||
return scores
|
||||
})
|
||||
|
||||
const openSpace = (url: string) => pushModal(SpaceCheck, {url})
|
||||
|
||||
@@ -83,7 +86,7 @@
|
||||
class="card2 bg-alt col-4 text-left shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]"
|
||||
on:click={() => openSpace(relay.url)}>
|
||||
<div class="col-2">
|
||||
<div class="flex gap-4 relative">
|
||||
<div class="relative flex gap-4">
|
||||
<div class="relative">
|
||||
<div class="avatar relative">
|
||||
<div
|
||||
@@ -97,14 +100,14 @@
|
||||
</div>
|
||||
{#if getMembershipUrls($userMembership).includes(relay.url)}
|
||||
<div
|
||||
class="absolute -right-1 -top-1 tooltip h-5 w-5 rounded-full bg-primary"
|
||||
class="tooltip absolute -right-1 -top-1 h-5 w-5 rounded-full bg-primary"
|
||||
data-tip="You are already a member of this space.">
|
||||
<Icon icon="check-circle" class="scale-110" />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-xl ellipsize whitespace-nowrap">
|
||||
<h2 class="ellipsize whitespace-nowrap text-xl">
|
||||
<RelayName url={relay.url} />
|
||||
</h2>
|
||||
<p class="text-sm opacity-75">{relay.url}</p>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {derived, writable} from "svelte/store"
|
||||
import {ctx, assoc, sortBy, now, remove} from "@welshman/lib"
|
||||
import {assoc, sortBy, remove} from "@welshman/lib"
|
||||
import type {TrustedEvent, EventContent} from "@welshman/util"
|
||||
import {createEvent, DIRECT_MESSAGE} from "@welshman/util"
|
||||
import {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {createScroller} from "@lib/html"
|
||||
import {uniq, shuffle} from "@welshman/lib"
|
||||
import {getPubkeyTagValues, getListTags} from "@welshman/util"
|
||||
import {profileSearch, userFollows} from "@welshman/app"
|
||||
import {profileSearch} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import PageHeader from "@lib/components/PageHeader.svelte"
|
||||
import PeopleItem from "@app/components/PeopleItem.svelte"
|
||||
import {getDefaultPubkeys} from '@app/state'
|
||||
import {getDefaultPubkeys} from "@app/state"
|
||||
|
||||
const defaultPubkeys = getDefaultPubkeys()
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
import {pushToast} from "@app/toast"
|
||||
import {SETTINGS, userSettings} from "@app/state"
|
||||
|
||||
const settings = {...$userSettings?.values}
|
||||
|
||||
const reset = () => {
|
||||
mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||
}
|
||||
@@ -29,12 +31,11 @@
|
||||
pushToast({message: "Your settings have been saved!"})
|
||||
}
|
||||
|
||||
let settings = {...$userSettings?.values}
|
||||
let mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||
</script>
|
||||
|
||||
<form class="content column gap-4" on:submit|preventDefault={onSubmit}>
|
||||
<div class="card2 bg-alt shadow-xl col-4">
|
||||
<div class="card2 bg-alt col-4 shadow-xl">
|
||||
<Field>
|
||||
<p slot="label">Muted Accounts</p>
|
||||
<div slot="input">
|
||||
@@ -43,8 +44,14 @@
|
||||
</Field>
|
||||
<FieldInline>
|
||||
<p slot="label">Hide sensitive content?</p>
|
||||
<input slot="input" type="checkbox" class="toggle toggle-primary" bind:checked={settings.hide_sensitive} />
|
||||
<p slot="info">If content is marked by the author as sensitive, flotilla will hide it by default.</p>
|
||||
<input
|
||||
slot="input"
|
||||
type="checkbox"
|
||||
class="toggle toggle-primary"
|
||||
bind:checked={settings.hide_sensitive} />
|
||||
<p slot="info">
|
||||
If content is marked by the author as sensitive, flotilla will hide it by default.
|
||||
</p>
|
||||
</FieldInline>
|
||||
<div class="mt-4 flex flex-row items-center justify-between gap-4">
|
||||
<Button class="btn btn-neutral" on:click={reset}>Discard Changes</Button>
|
||||
|
||||
@@ -43,7 +43,10 @@
|
||||
</span>
|
||||
</p>
|
||||
<p class="text-xs">
|
||||
Icons by <Link external class="link" href="https://www.figma.com/community/file/1166831539721848736">480 Design</Link>
|
||||
Icons by <Link
|
||||
external
|
||||
class="link"
|
||||
href="https://www.figma.com/community/file/1166831539721848736">480 Design</Link>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex justify-center gap-4">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
createProfile,
|
||||
isPublishedProfile,
|
||||
} from "@welshman/util"
|
||||
import {pubkey, profilesByPubkey, publishThunk, displayNip05, deriveProfile} from "@welshman/app"
|
||||
import {pubkey, publishThunk, displayNip05, deriveProfile} from "@welshman/app"
|
||||
import {slide} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from 'svelte'
|
||||
import {onMount} from "svelte"
|
||||
import {derived} from "svelte/store"
|
||||
import {
|
||||
getRelayUrls,
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import {onMount} from 'svelte'
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {writable} from 'svelte/store'
|
||||
import {writable} from "svelte/store"
|
||||
import {sortBy, now, assoc, append} from "@welshman/lib"
|
||||
import type {TrustedEvent, EventContent} from "@welshman/util"
|
||||
import {createEvent} from "@welshman/util"
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
subscribe({filters: [{'#~': [room], since: now()}], relays: [url]})
|
||||
subscribe({filters: [{"#~": [room], since: now()}], relays: [url]})
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user