Rename atproto -> bsky
This commit is contained in:
@@ -31,7 +31,7 @@ import {Loader} from '#/components/Loader'
|
|||||||
import * as Prompt from '#/components/Prompt'
|
import * as Prompt from '#/components/Prompt'
|
||||||
import {RichText, RichTextProps} from '#/components/RichText'
|
import {RichText, RichTextProps} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
view: AppBskyFeedDefs.GeneratorView
|
view: AppBskyFeedDefs.GeneratorView
|
||||||
@@ -115,7 +115,7 @@ export function TitleAndByline({
|
|||||||
creator,
|
creator,
|
||||||
}: {
|
}: {
|
||||||
title: string
|
title: string
|
||||||
creator?: atp.profile.AnyProfileView
|
creator?: bsky.profile.AnyProfileView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {PersonPlus_Stroke2_Corner0_Rounded as Person} from '#/components/icons/P
|
|||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
import * as ProfileCard from '#/components/ProfileCard'
|
import * as ProfileCard from '#/components/ProfileCard'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {ProgressGuideList} from './ProgressGuide/List'
|
import {ProgressGuideList} from './ProgressGuide/List'
|
||||||
|
|
||||||
const MOBILE_CARD_WIDTH = 300
|
const MOBILE_CARD_WIDTH = 300
|
||||||
@@ -229,7 +229,7 @@ export function ProfileGrid({
|
|||||||
viewContext = 'feed',
|
viewContext = 'feed',
|
||||||
}: {
|
}: {
|
||||||
isSuggestionsLoading: boolean
|
isSuggestionsLoading: boolean
|
||||||
profiles: atp.profile.AnyProfileView[]
|
profiles: bsky.profile.AnyProfileView[]
|
||||||
recId?: number
|
recId?: number
|
||||||
error: Error | null
|
error: Error | null
|
||||||
viewContext: 'profile' | 'feed'
|
viewContext: 'profile' | 'feed'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
||||||
import * as Hider from '#/components/moderation/Hider'
|
import * as Hider from '#/components/moderation/Hider'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This component is based on `FeedCard` and is tightly coupled with that
|
* This component is based on `FeedCard` and is tightly coupled with that
|
||||||
@@ -107,7 +107,7 @@ export function TitleAndByline({
|
|||||||
modUi,
|
modUi,
|
||||||
}: {
|
}: {
|
||||||
title: string
|
title: string
|
||||||
creator?: atp.profile.AnyProfileView
|
creator?: bsky.profile.AnyProfileView
|
||||||
purpose?: AppBskyGraphDefs.ListView['purpose']
|
purpose?: AppBskyGraphDefs.ListView['purpose']
|
||||||
modUi?: ModerationUI
|
modUi?: ModerationUI
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {atoms as a, useTheme} from '#/alf'
|
|||||||
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {PlayButtonIcon} from '#/components/video/PlayButtonIcon'
|
import {PlayButtonIcon} from '#/components/video/PlayButtonIcon'
|
||||||
import {parseEmbed} from '#/types/atproto/post'
|
import {parseEmbed} from '#/types/bsky/post'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Streamlined MediaPreview component which just handles images, gifs, and videos
|
* Streamlined MediaPreview component which just handles images, gifs, and videos
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus
|
|||||||
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function Default({
|
export function Default({
|
||||||
profile,
|
profile,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
logContext = 'ProfileCard',
|
logContext = 'ProfileCard',
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
|
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
|
||||||
}) {
|
}) {
|
||||||
@@ -51,7 +51,7 @@ export function Card({
|
|||||||
moderationOpts,
|
moderationOpts,
|
||||||
logContext = 'ProfileCard',
|
logContext = 'ProfileCard',
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
|
logContext?: 'ProfileCard' | 'StarterPackProfilesList'
|
||||||
}) {
|
}) {
|
||||||
@@ -101,7 +101,7 @@ export function Link({
|
|||||||
style,
|
style,
|
||||||
...rest
|
...rest
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
} & Omit<LinkProps, 'to' | 'label'>) {
|
} & Omit<LinkProps, 'to' | 'label'>) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
return (
|
return (
|
||||||
@@ -126,7 +126,7 @@ export function Avatar({
|
|||||||
profile,
|
profile,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
const moderation = moderateProfile(profile, moderationOpts)
|
const moderation = moderateProfile(profile, moderationOpts)
|
||||||
@@ -161,7 +161,7 @@ export function NameAndHandle({
|
|||||||
profile,
|
profile,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -224,7 +224,7 @@ export function Description({
|
|||||||
profile: profileUnshadowed,
|
profile: profileUnshadowed,
|
||||||
numberOfLines = 3,
|
numberOfLines = 3,
|
||||||
}: {
|
}: {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
numberOfLines?: number
|
numberOfLines?: number
|
||||||
}) {
|
}) {
|
||||||
const profile = useProfileShadow(profileUnshadowed)
|
const profile = useProfileShadow(profileUnshadowed)
|
||||||
@@ -280,7 +280,7 @@ export function DescriptionPlaceholder({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type FollowButtonProps = {
|
export type FollowButtonProps = {
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
logContext: LogEvents['profile:follow']['logContext'] &
|
logContext: LogEvents['profile:follow']['logContext'] &
|
||||||
LogEvents['profile:unfollow']['logContext']
|
LogEvents['profile:unfollow']['logContext']
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {useTheme} from '#/alf'
|
|||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
const LazyViewShot = React.lazy(
|
const LazyViewShot = React.lazy(
|
||||||
// @ts-expect-error dynamic import
|
// @ts-expect-error dynamic import
|
||||||
@@ -32,7 +32,7 @@ export const QrCode = React.forwardRef<ViewShot, Props>(function QrCode(
|
|||||||
const {record} = starterPack
|
const {record} = starterPack
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
record,
|
record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import {atoms as a, useTheme} from '#/alf'
|
|||||||
import {StarterPack} from '#/components/icons/StarterPack'
|
import {StarterPack} from '#/components/icons/StarterPack'
|
||||||
import {Link as BaseLink, LinkProps as BaseLinkProps} from '#/components/Link'
|
import {Link as BaseLink, LinkProps as BaseLinkProps} from '#/components/Link'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function Default({
|
export function Default({
|
||||||
starterPack,
|
starterPack,
|
||||||
}: {
|
}: {
|
||||||
starterPack?: atp.starterPack.AnyStarterPackView
|
starterPack?: bsky.starterPack.AnyStarterPackView
|
||||||
}) {
|
}) {
|
||||||
if (!starterPack) return null
|
if (!starterPack) return null
|
||||||
return (
|
return (
|
||||||
@@ -33,7 +33,7 @@ export function Default({
|
|||||||
export function Notification({
|
export function Notification({
|
||||||
starterPack,
|
starterPack,
|
||||||
}: {
|
}: {
|
||||||
starterPack?: atp.starterPack.AnyStarterPackView
|
starterPack?: bsky.starterPack.AnyStarterPackView
|
||||||
}) {
|
}) {
|
||||||
if (!starterPack) return null
|
if (!starterPack) return null
|
||||||
return (
|
return (
|
||||||
@@ -48,7 +48,7 @@ export function Card({
|
|||||||
noIcon,
|
noIcon,
|
||||||
noDescription,
|
noDescription,
|
||||||
}: {
|
}: {
|
||||||
starterPack: atp.starterPack.AnyStarterPackView
|
starterPack: bsky.starterPack.AnyStarterPackView
|
||||||
noIcon?: boolean
|
noIcon?: boolean
|
||||||
noDescription?: boolean
|
noDescription?: boolean
|
||||||
}) {
|
}) {
|
||||||
@@ -59,7 +59,7 @@ export function Card({
|
|||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
record,
|
record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
)
|
)
|
||||||
@@ -106,7 +106,7 @@ export function Link({
|
|||||||
starterPack,
|
starterPack,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
starterPack: atp.starterPack.AnyStarterPackView
|
starterPack: bsky.starterPack.AnyStarterPackView
|
||||||
onPress?: () => void
|
onPress?: () => void
|
||||||
children: BaseLinkProps['children']
|
children: BaseLinkProps['children']
|
||||||
}) {
|
}) {
|
||||||
@@ -145,7 +145,7 @@ export function Link({
|
|||||||
export function Embed({
|
export function Embed({
|
||||||
starterPack,
|
starterPack,
|
||||||
}: {
|
}: {
|
||||||
starterPack: atp.starterPack.AnyStarterPackView
|
starterPack: bsky.starterPack.AnyStarterPackView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const imageUri = getStarterPackOgCard(starterPack)
|
const imageUri = getStarterPackOgCard(starterPack)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {Button, ButtonText} from '#/components/Button'
|
|||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
import {Checkbox} from '#/components/forms/Toggle'
|
import {Checkbox} from '#/components/forms/Toggle'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
function WizardListCard({
|
function WizardListCard({
|
||||||
type,
|
type,
|
||||||
@@ -124,7 +124,7 @@ export function WizardProfileCard({
|
|||||||
btnType: 'checkbox' | 'remove'
|
btnType: 'checkbox' | 'remove'
|
||||||
state: WizardState
|
state: WizardState
|
||||||
dispatch: (action: WizardAction) => void
|
dispatch: (action: WizardAction) => void
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {Link} from '#/components/Link'
|
|||||||
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
||||||
import * as Hider from '#/components/moderation/Hider'
|
import * as Hider from '#/components/moderation/Hider'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
function getBlackColor(t: ReturnType<typeof useTheme>) {
|
function getBlackColor(t: ReturnType<typeof useTheme>) {
|
||||||
return select(t.name, {
|
return select(t.name, {
|
||||||
@@ -79,7 +79,7 @@ export function VideoPostCard({
|
|||||||
if (!AppBskyEmbedVideo.isView(embed)) return null
|
if (!AppBskyEmbedVideo.isView(embed)) return null
|
||||||
|
|
||||||
const author = post.author
|
const author = post.author
|
||||||
const text = atp.dangerousIsType<AppBskyFeedPost.Record>(
|
const text = bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post.record,
|
post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {Earth_Stroke2_Corner0_Rounded as Earth} from '#/components/icons/Globe'
|
|||||||
import {Group3_Stroke2_Corner0_Rounded as Group} from '#/components/icons/Group'
|
import {Group3_Stroke2_Corner0_Rounded as Group} from '#/components/icons/Group'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {PencilLine_Stroke2_Corner0_Rounded as PencilLine} from './icons/Pencil'
|
import {PencilLine_Stroke2_Corner0_Rounded as PencilLine} from './icons/Pencil'
|
||||||
|
|
||||||
interface WhoCanReplyProps {
|
interface WhoCanReplyProps {
|
||||||
@@ -49,7 +49,7 @@ export function WhoCanReply({post, isThreadAuthor, style}: WhoCanReplyProps) {
|
|||||||
* unexpectedly, we should check to make sure it's for sure the root URI.
|
* unexpectedly, we should check to make sure it's for sure the root URI.
|
||||||
*/
|
*/
|
||||||
const rootUri =
|
const rootUri =
|
||||||
atp.dangerousIsType<AppBskyFeedPost.Record>(
|
bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post.record,
|
post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
) && post.record.reply?.root
|
) && post.record.reply?.root
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as Unmute} from '#/components/icons/Speaker'
|
import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as Unmute} from '#/components/icons/Speaker'
|
||||||
import * as Menu from '#/components/Menu'
|
import * as Menu from '#/components/Menu'
|
||||||
import * as Prompt from '#/components/Prompt'
|
import * as Prompt from '#/components/Prompt'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '../icons/Bubble'
|
import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '../icons/Bubble'
|
||||||
import {ReportDialog} from './ReportDialog'
|
import {ReportDialog} from './ReportDialog'
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ let ConvoMenu = ({
|
|||||||
style,
|
style,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: ChatBskyConvoDefs.ConvoView
|
||||||
profile: Shadow<atp.profile.AnyProfileView>
|
profile: Shadow<bsky.profile.AnyProfileView>
|
||||||
control?: Menu.MenuControlProps
|
control?: Menu.MenuControlProps
|
||||||
currentScreen: 'list' | 'conversation'
|
currentScreen: 'list' | 'conversation'
|
||||||
showMarkAsRead?: boolean
|
showMarkAsRead?: boolean
|
||||||
@@ -145,7 +145,7 @@ function MenuContent({
|
|||||||
blockedByListControl,
|
blockedByListControl,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: ChatBskyConvoDefs.ConvoView
|
||||||
profile: Shadow<atp.profile.AnyProfileView>
|
profile: Shadow<bsky.profile.AnyProfileView>
|
||||||
showMarkAsRead?: boolean
|
showMarkAsRead?: boolean
|
||||||
blockInfo: {
|
blockInfo: {
|
||||||
listBlocks: ModerationCause[]
|
listBlocks: ModerationCause[]
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
|
|||||||
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
|
||||||
import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
|
import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function MessagesListBlockedFooter({
|
export function MessagesListBlockedFooter({
|
||||||
recipient: initialRecipient,
|
recipient: initialRecipient,
|
||||||
@@ -22,7 +22,7 @@ export function MessagesListBlockedFooter({
|
|||||||
hasMessages,
|
hasMessages,
|
||||||
moderation,
|
moderation,
|
||||||
}: {
|
}: {
|
||||||
recipient: atp.profile.AnyProfileView
|
recipient: bsky.profile.AnyProfileView
|
||||||
convoId: string
|
convoId: string
|
||||||
hasMessages: boolean
|
hasMessages: boolean
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ import {useInteractionState} from '#/components/hooks/useInteractionState'
|
|||||||
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
|
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
|
||||||
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
|
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
type Item =
|
type Item =
|
||||||
| {
|
| {
|
||||||
type: 'profile'
|
type: 'profile'
|
||||||
key: string
|
key: string
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'empty'
|
type: 'empty'
|
||||||
@@ -331,7 +331,7 @@ function ProfileCard({
|
|||||||
onPress,
|
onPress,
|
||||||
}: {
|
}: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
onPress: (did: string) => void
|
onPress: (did: string) => void
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function canBeMessaged(profile: atp.profile.AnyProfileView) {
|
export function canBeMessaged(profile: bsky.profile.AnyProfileView) {
|
||||||
switch (profile.associated?.chat?.allowIncoming) {
|
switch (profile.associated?.chat?.allowIncoming) {
|
||||||
case 'none':
|
case 'none':
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import {Shadow} from '#/state/cache/types'
|
|||||||
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
|
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
|
||||||
import {useRequireAuth} from '#/state/session'
|
import {useRequireAuth} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function useFollowMethods({
|
export function useFollowMethods({
|
||||||
profile,
|
profile,
|
||||||
logContext,
|
logContext,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<atp.profile.AnyProfileView>
|
profile: Shadow<bsky.profile.AnyProfileView>
|
||||||
logContext: LogEvents['profile:follow']['logContext'] &
|
logContext: LogEvents['profile:follow']['logContext'] &
|
||||||
LogEvents['profile:unfollow']['logContext']
|
LogEvents['profile:unfollow']['logContext']
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
|||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {enforceLen} from '#/lib/strings/helpers'
|
import {enforceLen} from '#/lib/strings/helpers'
|
||||||
import {useAgent} from '#/state/session'
|
import {useAgent} from '#/state/session'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export const createStarterPackList = async ({
|
export const createStarterPackList = async ({
|
||||||
name,
|
name,
|
||||||
@@ -27,7 +27,7 @@ export const createStarterPackList = async ({
|
|||||||
name: string
|
name: string
|
||||||
description?: string
|
description?: string
|
||||||
descriptionFacets?: Facet[]
|
descriptionFacets?: Facet[]
|
||||||
profiles: atp.profile.AnyProfileView[]
|
profiles: bsky.profile.AnyProfileView[]
|
||||||
agent: BskyAgent
|
agent: BskyAgent
|
||||||
}): Promise<{uri: string; cid: string}> => {
|
}): Promise<{uri: string; cid: string}> => {
|
||||||
if (profiles.length === 0) throw new Error('No profiles given')
|
if (profiles.length === 0) throw new Error('No profiles given')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as atp from '#/types/atproto'
|
import * as atp from '#/types/bsky'
|
||||||
|
|
||||||
export function isBlockedOrBlocking(profile: atp.profile.AnyProfileView) {
|
export function isBlockedOrBlocking(profile: atp.profile.AnyProfileView) {
|
||||||
return profile.viewer?.blockedBy || profile.viewer?.blocking
|
return profile.viewer?.blockedBy || profile.viewer?.blocking
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {AtUri} from '@atproto/api'
|
import {AtUri} from '@atproto/api'
|
||||||
|
|
||||||
import * as atp from '#/types/atproto'
|
import * as atp from '#/types/bsky'
|
||||||
|
|
||||||
export function createStarterPackLinkFromAndroidReferrer(
|
export function createStarterPackLinkFromAndroidReferrer(
|
||||||
referrerQueryString: string,
|
referrerQueryString: string,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import {Link} from '#/components/Link'
|
|||||||
import {useMenuControl} from '#/components/Menu'
|
import {useMenuControl} from '#/components/Menu'
|
||||||
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export let ChatListItem = ({
|
export let ChatListItem = ({
|
||||||
convo,
|
convo,
|
||||||
@@ -78,7 +78,7 @@ function ChatListItemReady({
|
|||||||
moderationOpts,
|
moderationOpts,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: ChatBskyConvoDefs.ConvoView
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {ContentHider} from '#/components/moderation/ContentHider'
|
|||||||
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
import {PostAlerts} from '#/components/moderation/PostAlerts'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function useMessageEmbed() {
|
export function useMessageEmbed() {
|
||||||
const route =
|
const route =
|
||||||
@@ -114,7 +114,7 @@ export function MessageInputEmbed({
|
|||||||
const {rt, record} = useMemo(() => {
|
const {rt, record} = useMemo(() => {
|
||||||
if (
|
if (
|
||||||
post &&
|
post &&
|
||||||
atp.dangerousIsType<AppBskyFeedPost.Record>(
|
bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post.record,
|
post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import {News2_Stroke2_Corner0_Rounded as News} from '#/components/icons/News2'
|
|||||||
import {Trending2_Stroke2_Corner2_Rounded as Trending} from '#/components/icons/Trending2'
|
import {Trending2_Stroke2_Corner2_Rounded as Trending} from '#/components/icons/Trending2'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function StepFinished() {
|
export function StepFinished() {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
@@ -213,7 +213,7 @@ export function StepFinished() {
|
|||||||
usedStarterPack: Boolean(starterPack),
|
usedStarterPack: Boolean(starterPack),
|
||||||
starterPackName:
|
starterPackName:
|
||||||
starterPack &&
|
starterPack &&
|
||||||
atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
starterPack.record,
|
starterPack.record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {Divider} from '#/components/Divider'
|
|||||||
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function Signup({onPressBack}: {onPressBack: () => void}) {
|
export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
@@ -96,7 +96,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
scrollable>
|
scrollable>
|
||||||
<View testID="createAccount" style={a.flex_1}>
|
<View testID="createAccount" style={a.flex_1}>
|
||||||
{showStarterPackCard &&
|
{showStarterPackCard &&
|
||||||
atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
starterPack.record,
|
starterPack.record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
) ? (
|
) ? (
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import {Default as ProfileCard} from '#/components/ProfileCard'
|
|||||||
import * as Prompt from '#/components/Prompt'
|
import * as Prompt from '#/components/Prompt'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ export function LandingScreen({
|
|||||||
|
|
||||||
// Just for types, this cannot be hit
|
// Just for types, this cannot be hit
|
||||||
if (
|
if (
|
||||||
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
starterPack.record,
|
starterPack.record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ import {ProfilesList} from '#/components/StarterPack/Main/ProfilesList'
|
|||||||
import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog'
|
import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog'
|
||||||
import {ShareDialog} from '#/components/StarterPack/ShareDialog'
|
import {ShareDialog} from '#/components/StarterPack/ShareDialog'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
type StarterPackScreeProps = NativeStackScreenProps<
|
type StarterPackScreeProps = NativeStackScreenProps<
|
||||||
CommonNavigatorParams,
|
CommonNavigatorParams,
|
||||||
@@ -389,7 +389,7 @@ function Header({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!atp.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||||
record,
|
record,
|
||||||
AppBskyGraphStarterpack.isRecord,
|
AppBskyGraphStarterpack.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {msg} from '@lingui/macro'
|
|||||||
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
const steps = ['Details', 'Profiles', 'Feeds'] as const
|
const steps = ['Details', 'Profiles', 'Feeds'] as const
|
||||||
type Step = (typeof steps)[number]
|
type Step = (typeof steps)[number]
|
||||||
@@ -21,7 +21,7 @@ type Action =
|
|||||||
| {type: 'SetCanNext'; canNext: boolean}
|
| {type: 'SetCanNext'; canNext: boolean}
|
||||||
| {type: 'SetName'; name: string}
|
| {type: 'SetName'; name: string}
|
||||||
| {type: 'SetDescription'; description: string}
|
| {type: 'SetDescription'; description: string}
|
||||||
| {type: 'AddProfile'; profile: atp.profile.AnyProfileView}
|
| {type: 'AddProfile'; profile: bsky.profile.AnyProfileView}
|
||||||
| {type: 'RemoveProfile'; profileDid: string}
|
| {type: 'RemoveProfile'; profileDid: string}
|
||||||
| {type: 'AddFeed'; feed: GeneratorView}
|
| {type: 'AddFeed'; feed: GeneratorView}
|
||||||
| {type: 'RemoveFeed'; feedUri: string}
|
| {type: 'RemoveFeed'; feedUri: string}
|
||||||
@@ -33,7 +33,7 @@ interface State {
|
|||||||
currentStep: Step
|
currentStep: Step
|
||||||
name?: string
|
name?: string
|
||||||
description?: string
|
description?: string
|
||||||
profiles: atp.profile.AnyProfileView[]
|
profiles: bsky.profile.AnyProfileView[]
|
||||||
feeds: GeneratorView[]
|
feeds: GeneratorView[]
|
||||||
processing: boolean
|
processing: boolean
|
||||||
error?: string
|
error?: string
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {Loader} from '#/components/Loader'
|
|||||||
import {ScreenTransition} from '#/components/StarterPack/Wizard/ScreenTransition'
|
import {ScreenTransition} from '#/components/StarterPack/Wizard/ScreenTransition'
|
||||||
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
import {WizardProfileCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
|
function keyExtractor(item: AppBskyActorDefs.ProfileViewBasic) {
|
||||||
return item?.did ?? ''
|
return item?.did ?? ''
|
||||||
@@ -51,7 +51,7 @@ export function StepProfiles({
|
|||||||
|
|
||||||
const renderItem = ({
|
const renderItem = ({
|
||||||
item,
|
item,
|
||||||
}: ListRenderItemInfo<atp.profile.AnyProfileView>) => {
|
}: ListRenderItemInfo<bsky.profile.AnyProfileView>) => {
|
||||||
return (
|
return (
|
||||||
<WizardProfileCard
|
<WizardProfileCard
|
||||||
profile={item}
|
profile={item}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import {ListMaybePlaceholder} from '#/components/Lists'
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog'
|
import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {Provider} from './State'
|
import {Provider} from './State'
|
||||||
|
|
||||||
export function Wizard({
|
export function Wizard({
|
||||||
@@ -578,7 +578,7 @@ function Footer({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getName(item: atp.profile.AnyProfileView | GeneratorView) {
|
function getName(item: bsky.profile.AnyProfileView | GeneratorView) {
|
||||||
if (typeof item.displayName === 'string') {
|
if (typeof item.displayName === 'string') {
|
||||||
return enforceLen(sanitizeDisplayName(item.displayName), 28, true)
|
return enforceLen(sanitizeDisplayName(item.displayName), 28, true)
|
||||||
} else if ('handle' in item) {
|
} else if ('handle' in item) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ import {ListFooter} from '#/components/Lists'
|
|||||||
import * as Hider from '#/components/moderation/Hider'
|
import * as Hider from '#/components/moderation/Hider'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {Scrubber, VIDEO_PLAYER_BOTTOM_INSET} from './components/Scrubber'
|
import {Scrubber, VIDEO_PLAYER_BOTTOM_INSET} from './components/Scrubber'
|
||||||
|
|
||||||
function createThreeVideoPlayers(
|
function createThreeVideoPlayers(
|
||||||
@@ -695,7 +695,7 @@ function Overlay({
|
|||||||
)
|
)
|
||||||
|
|
||||||
const rkey = new AtUri(post.uri).rkey
|
const rkey = new AtUri(post.uri).rkey
|
||||||
const record = atp.dangerousIsType<AppBskyFeedPost.Record>(
|
const record = bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post.record,
|
post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
Vendored
+6
-6
@@ -3,7 +3,7 @@ import {QueryClient} from '@tanstack/react-query'
|
|||||||
import EventEmitter from 'eventemitter3'
|
import EventEmitter from 'eventemitter3'
|
||||||
|
|
||||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {findAllProfilesInQueryData as findAllProfilesInActorSearchQueryData} from '../queries/actor-search'
|
import {findAllProfilesInQueryData as findAllProfilesInActorSearchQueryData} from '../queries/actor-search'
|
||||||
import {findAllProfilesInQueryData as findAllProfilesInKnownFollowersQueryData} from '../queries/known-followers'
|
import {findAllProfilesInQueryData as findAllProfilesInKnownFollowersQueryData} from '../queries/known-followers'
|
||||||
import {findAllProfilesInQueryData as findAllProfilesInListMembersQueryData} from '../queries/list-members'
|
import {findAllProfilesInQueryData as findAllProfilesInListMembersQueryData} from '../queries/list-members'
|
||||||
@@ -30,13 +30,13 @@ export interface ProfileShadow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const shadows: WeakMap<
|
const shadows: WeakMap<
|
||||||
atp.profile.AnyProfileView,
|
bsky.profile.AnyProfileView,
|
||||||
Partial<ProfileShadow>
|
Partial<ProfileShadow>
|
||||||
> = new WeakMap()
|
> = new WeakMap()
|
||||||
const emitter = new EventEmitter()
|
const emitter = new EventEmitter()
|
||||||
|
|
||||||
export function useProfileShadow<
|
export function useProfileShadow<
|
||||||
TProfileView extends atp.profile.AnyProfileView,
|
TProfileView extends bsky.profile.AnyProfileView,
|
||||||
>(profile: TProfileView): Shadow<TProfileView> {
|
>(profile: TProfileView): Shadow<TProfileView> {
|
||||||
const [shadow, setShadow] = useState(() => shadows.get(profile))
|
const [shadow, setShadow] = useState(() => shadows.get(profile))
|
||||||
const [prevPost, setPrevPost] = useState(profile)
|
const [prevPost, setPrevPost] = useState(profile)
|
||||||
@@ -69,7 +69,7 @@ export function useProfileShadow<
|
|||||||
* This is useful for when the profile is not guaranteed to be loaded yet.
|
* This is useful for when the profile is not guaranteed to be loaded yet.
|
||||||
*/
|
*/
|
||||||
export function useMaybeProfileShadow<
|
export function useMaybeProfileShadow<
|
||||||
TProfileView extends atp.profile.AnyProfileView,
|
TProfileView extends bsky.profile.AnyProfileView,
|
||||||
>(profile?: TProfileView): Shadow<TProfileView> | undefined {
|
>(profile?: TProfileView): Shadow<TProfileView> | undefined {
|
||||||
const [shadow, setShadow] = useState(() =>
|
const [shadow, setShadow] = useState(() =>
|
||||||
profile ? shadows.get(profile) : undefined,
|
profile ? shadows.get(profile) : undefined,
|
||||||
@@ -116,7 +116,7 @@ export function updateProfileShadow(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeShadow<TProfileView extends atp.profile.AnyProfileView>(
|
function mergeShadow<TProfileView extends bsky.profile.AnyProfileView>(
|
||||||
profile: TProfileView,
|
profile: TProfileView,
|
||||||
shadow: Partial<ProfileShadow>,
|
shadow: Partial<ProfileShadow>,
|
||||||
): Shadow<TProfileView> {
|
): Shadow<TProfileView> {
|
||||||
@@ -138,7 +138,7 @@ function mergeShadow<TProfileView extends atp.profile.AnyProfileView>(
|
|||||||
function* findProfilesInCache(
|
function* findProfilesInCache(
|
||||||
queryClient: QueryClient,
|
queryClient: QueryClient,
|
||||||
did: string,
|
did: string,
|
||||||
): Generator<atp.profile.AnyProfileView, void> {
|
): Generator<bsky.profile.AnyProfileView, void> {
|
||||||
yield* findAllProfilesInListMembersQueryData(queryClient, did)
|
yield* findAllProfilesInListMembersQueryData(queryClient, did)
|
||||||
yield* findAllProfilesInMyBlockedAccountsQueryData(queryClient, did)
|
yield* findAllProfilesInMyBlockedAccountsQueryData(queryClient, did)
|
||||||
yield* findAllProfilesInMyMutedAccountsQueryData(queryClient, did)
|
yield* findAllProfilesInMyMutedAccountsQueryData(queryClient, did)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {QueryClient} from '@tanstack/react-query'
|
|||||||
import chunk from 'lodash.chunk'
|
import chunk from 'lodash.chunk'
|
||||||
|
|
||||||
import {labelIsHideableOffense} from '#/lib/moderation'
|
import {labelIsHideableOffense} from '#/lib/moderation'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {precacheProfile} from '../profile'
|
import {precacheProfile} from '../profile'
|
||||||
import {FeedNotification, FeedPage, NotificationType} from './types'
|
import {FeedNotification, FeedPage, NotificationType} from './types'
|
||||||
|
|
||||||
@@ -253,11 +253,11 @@ function getSubjectUri(
|
|||||||
return notif.uri
|
return notif.uri
|
||||||
} else if (type === 'post-like' || type === 'repost') {
|
} else if (type === 'post-like' || type === 'repost') {
|
||||||
if (
|
if (
|
||||||
atp.dangerousIsType<AppBskyFeedRepost.Record>(
|
bsky.dangerousIsType<AppBskyFeedRepost.Record>(
|
||||||
notif.record,
|
notif.record,
|
||||||
AppBskyFeedRepost.isRecord,
|
AppBskyFeedRepost.isRecord,
|
||||||
) ||
|
) ||
|
||||||
atp.dangerousIsType<AppBskyFeedLike.Record>(
|
bsky.dangerousIsType<AppBskyFeedLike.Record>(
|
||||||
notif.record,
|
notif.record,
|
||||||
AppBskyFeedLike.isRecord,
|
AppBskyFeedLike.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
findAllProfilesInQueryData as findAllProfilesInSearchQueryData,
|
findAllProfilesInQueryData as findAllProfilesInSearchQueryData,
|
||||||
} from '#/state/queries/search-posts'
|
} from '#/state/queries/search-posts'
|
||||||
import {useAgent} from '#/state/session'
|
import {useAgent} from '#/state/session'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {
|
import {
|
||||||
findAllPostsInQueryData as findAllPostsInNotifsQueryData,
|
findAllPostsInQueryData as findAllPostsInNotifsQueryData,
|
||||||
findAllProfilesInQueryData as findAllProfilesInNotifsQueryData,
|
findAllProfilesInQueryData as findAllProfilesInNotifsQueryData,
|
||||||
@@ -333,7 +333,7 @@ function responseToThreadNodes(
|
|||||||
): ThreadNode {
|
): ThreadNode {
|
||||||
if (
|
if (
|
||||||
AppBskyFeedDefs.isThreadViewPost(node) &&
|
AppBskyFeedDefs.isThreadViewPost(node) &&
|
||||||
atp.dangerousIsType<AppBskyFeedPost.Record>(
|
bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
node.post.record,
|
node.post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
useUnstableProfileViewCache,
|
useUnstableProfileViewCache,
|
||||||
} from '#/state/queries/unstable-profile-cache'
|
} from '#/state/queries/unstable-profile-cache'
|
||||||
import * as userActionHistory from '#/state/userActionHistory'
|
import * as userActionHistory from '#/state/userActionHistory'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {updateProfileShadow} from '../cache/profile-shadow'
|
import {updateProfileShadow} from '../cache/profile-shadow'
|
||||||
import {useAgent, useSession} from '../session'
|
import {useAgent, useSession} from '../session'
|
||||||
import {
|
import {
|
||||||
@@ -225,7 +225,7 @@ export function useProfileUpdateMutation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useProfileFollowMutationQueue(
|
export function useProfileFollowMutationQueue(
|
||||||
profile: Shadow<atp.profile.AnyProfileView>,
|
profile: Shadow<bsky.profile.AnyProfileView>,
|
||||||
logContext: LogEvents['profile:follow']['logContext'] &
|
logContext: LogEvents['profile:follow']['logContext'] &
|
||||||
LogEvents['profile:follow']['logContext'],
|
LogEvents['profile:follow']['logContext'],
|
||||||
) {
|
) {
|
||||||
@@ -299,7 +299,7 @@ export function useProfileFollowMutationQueue(
|
|||||||
|
|
||||||
function useProfileFollowMutation(
|
function useProfileFollowMutation(
|
||||||
logContext: LogEvents['profile:follow']['logContext'],
|
logContext: LogEvents['profile:follow']['logContext'],
|
||||||
profile: Shadow<atp.profile.AnyProfileView>,
|
profile: Shadow<bsky.profile.AnyProfileView>,
|
||||||
) {
|
) {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
@@ -340,7 +340,7 @@ function useProfileUnfollowMutation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useProfileMuteMutationQueue(
|
export function useProfileMuteMutationQueue(
|
||||||
profile: Shadow<atp.profile.AnyProfileView>,
|
profile: Shadow<bsky.profile.AnyProfileView>,
|
||||||
) {
|
) {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const did = profile.did
|
const did = profile.did
|
||||||
@@ -415,7 +415,7 @@ function useProfileUnmuteMutation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useProfileBlockMutationQueue(
|
export function useProfileBlockMutationQueue(
|
||||||
profile: Shadow<atp.profile.AnyProfileView>,
|
profile: Shadow<bsky.profile.AnyProfileView>,
|
||||||
) {
|
) {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const did = profile.did
|
const did = profile.did
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {invalidateActorStarterPacksQuery} from '#/state/queries/actor-starter-pa
|
|||||||
import {STALE} from '#/state/queries/index'
|
import {STALE} from '#/state/queries/index'
|
||||||
import {invalidateListMembersQuery} from '#/state/queries/list-members'
|
import {invalidateListMembersQuery} from '#/state/queries/list-members'
|
||||||
import {useAgent} from '#/state/session'
|
import {useAgent} from '#/state/session'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
const RQKEY_ROOT = 'starter-pack'
|
const RQKEY_ROOT = 'starter-pack'
|
||||||
const RQKEY = ({
|
const RQKEY = ({
|
||||||
@@ -94,7 +94,7 @@ export async function invalidateStarterPack({
|
|||||||
interface UseCreateStarterPackMutationParams {
|
interface UseCreateStarterPackMutationParams {
|
||||||
name: string
|
name: string
|
||||||
description?: string
|
description?: string
|
||||||
profiles: atp.profile.AnyProfileView[]
|
profiles: bsky.profile.AnyProfileView[]
|
||||||
feeds?: AppBskyFeedDefs.GeneratorView[]
|
feeds?: AppBskyFeedDefs.GeneratorView[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {useCallback} from 'react'
|
import {useCallback} from 'react'
|
||||||
import {QueryClient, useQueryClient} from '@tanstack/react-query'
|
import {QueryClient, useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
const unstableProfileViewCacheQueryKeyRoot = 'unstableProfileViewCache'
|
const unstableProfileViewCacheQueryKeyRoot = 'unstableProfileViewCache'
|
||||||
export const unstableProfileViewCacheQueryKey = (didOrHandle: string) => [
|
export const unstableProfileViewCacheQueryKey = (didOrHandle: string) => [
|
||||||
@@ -17,7 +17,7 @@ export const unstableProfileViewCacheQueryKey = (didOrHandle: string) => [
|
|||||||
*/
|
*/
|
||||||
export function unstableCacheProfileView(
|
export function unstableCacheProfileView(
|
||||||
queryClient: QueryClient,
|
queryClient: QueryClient,
|
||||||
profile: atp.profile.AnyProfileView,
|
profile: bsky.profile.AnyProfileView,
|
||||||
) {
|
) {
|
||||||
queryClient.setQueryData(
|
queryClient.setQueryData(
|
||||||
unstableProfileViewCacheQueryKey(profile.handle),
|
unstableProfileViewCacheQueryKey(profile.handle),
|
||||||
@@ -41,7 +41,7 @@ export function useUnstableProfileViewCache() {
|
|||||||
const qc = useQueryClient()
|
const qc = useQueryClient()
|
||||||
const getUnstableProfile = useCallback(
|
const getUnstableProfile = useCallback(
|
||||||
(didOrHandle: string) => {
|
(didOrHandle: string) => {
|
||||||
return qc.getQueryData<atp.profile.AnyProfileView>(
|
return qc.getQueryData<bsky.profile.AnyProfileView>(
|
||||||
unstableProfileViewCacheQueryKey(didOrHandle),
|
unstableProfileViewCacheQueryKey(didOrHandle),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {InfiniteData, QueryClient, QueryKey} from '@tanstack/react-query'
|
import {InfiniteData, QueryClient, QueryKey} from '@tanstack/react-query'
|
||||||
|
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export async function truncateAndInvalidate<T = any>(
|
export async function truncateAndInvalidate<T = any>(
|
||||||
queryClient: QueryClient,
|
queryClient: QueryClient,
|
||||||
@@ -47,7 +47,7 @@ export function getEmbeddedPost(
|
|||||||
v: unknown,
|
v: unknown,
|
||||||
): AppBskyEmbedRecord.ViewRecord | undefined {
|
): AppBskyEmbedRecord.ViewRecord | undefined {
|
||||||
if (
|
if (
|
||||||
atp.dangerousIsType<AppBskyEmbedRecord.View>(v, AppBskyEmbedRecord.isView)
|
bsky.dangerousIsType<AppBskyEmbedRecord.View>(v, AppBskyEmbedRecord.isView)
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
AppBskyEmbedRecord.isViewRecord(v.record) &&
|
AppBskyEmbedRecord.isViewRecord(v.record) &&
|
||||||
@@ -57,7 +57,7 @@ export function getEmbeddedPost(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
atp.dangerousIsType<AppBskyEmbedRecordWithMedia.View>(
|
bsky.dangerousIsType<AppBskyEmbedRecordWithMedia.View>(
|
||||||
v,
|
v,
|
||||||
AppBskyEmbedRecordWithMedia.isView,
|
AppBskyEmbedRecordWithMedia.isView,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export * as profile from '#/types/atproto/profile'
|
export * as profile from '#/types/bsky/profile'
|
||||||
export * as starterPack from '#/types/atproto/starterPack'
|
export * as starterPack from '#/types/bsky/starterPack'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use sparingly, and only when you know it's safe to do so.
|
* Use sparingly, and only when you know it's safe to do so.
|
||||||
@@ -11,7 +11,7 @@ import {useModalControls} from '#/state/modals'
|
|||||||
import {useListMembersQuery} from '#/state/queries/list-members'
|
import {useListMembersQuery} from '#/state/queries/list-members'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {ListFooter} from '#/components/Lists'
|
import {ListFooter} from '#/components/Lists'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {ProfileCard} from '../profile/ProfileCard'
|
import {ProfileCard} from '../profile/ProfileCard'
|
||||||
import {ErrorMessage} from '../util/error/ErrorMessage'
|
import {ErrorMessage} from '../util/error/ErrorMessage'
|
||||||
import {Button} from '../util/forms/Button'
|
import {Button} from '../util/forms/Button'
|
||||||
@@ -117,7 +117,7 @@ export function ListMembers({
|
|||||||
}, [fetchNextPage])
|
}, [fetchNextPage])
|
||||||
|
|
||||||
const onPressEditMembership = React.useCallback(
|
const onPressEditMembership = React.useCallback(
|
||||||
(profile: atp.profile.AnyProfileView) => {
|
(profile: bsky.profile.AnyProfileView) => {
|
||||||
openModal({
|
openModal({
|
||||||
name: 'user-add-remove-lists',
|
name: 'user-add-remove-lists',
|
||||||
subject: profile.did,
|
subject: profile.did,
|
||||||
@@ -132,7 +132,7 @@ export function ListMembers({
|
|||||||
// =
|
// =
|
||||||
|
|
||||||
const renderMemberButton = React.useCallback(
|
const renderMemberButton = React.useCallback(
|
||||||
(profile: atp.profile.AnyProfileView) => {
|
(profile: bsky.profile.AnyProfileView) => {
|
||||||
if (!isOwner) {
|
if (!isOwner) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import * as MediaPreview from '#/components/MediaPreview'
|
|||||||
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
||||||
import {Notification as StarterPackCard} from '#/components/StarterPack/StarterPackCard'
|
import {Notification as StarterPackCard} from '#/components/StarterPack/StarterPackCard'
|
||||||
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {FeedSourceCard} from '../feeds/FeedSourceCard'
|
import {FeedSourceCard} from '../feeds/FeedSourceCard'
|
||||||
import {Post} from '../post/Post'
|
import {Post} from '../post/Post'
|
||||||
import {Link, TextLink} from '../util/Link'
|
import {Link, TextLink} from '../util/Link'
|
||||||
@@ -265,7 +265,7 @@ let NotificationFeedItem = ({
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
item.notification.author.viewer?.following &&
|
item.notification.author.viewer?.following &&
|
||||||
atp.dangerousIsType<AppBskyGraphFollow.Record>(
|
bsky.dangerousIsType<AppBskyGraphFollow.Record>(
|
||||||
item.notification.record,
|
item.notification.record,
|
||||||
AppBskyGraphFollow.isRecord,
|
AppBskyGraphFollow.isRecord,
|
||||||
)
|
)
|
||||||
@@ -722,7 +722,7 @@ function AdditionalPostText({post}: {post?: AppBskyFeedDefs.PostView}) {
|
|||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
if (
|
if (
|
||||||
post &&
|
post &&
|
||||||
atp.dangerousIsType<AppBskyFeedPost.Record>(
|
bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post?.record,
|
post?.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import {RichText} from '#/components/RichText'
|
|||||||
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {WhoCanReply} from '#/components/WhoCanReply'
|
import {WhoCanReply} from '#/components/WhoCanReply'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
|
|
||||||
export function PostThreadItem({
|
export function PostThreadItem({
|
||||||
post,
|
post,
|
||||||
@@ -786,7 +786,7 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) {
|
|||||||
const control = Prompt.usePromptControl()
|
const control = Prompt.usePromptControl()
|
||||||
|
|
||||||
const indexedAt = new Date(post.indexedAt)
|
const indexedAt = new Date(post.indexedAt)
|
||||||
const createdAt = atp.dangerousIsType<AppBskyFeedPost.Record>(
|
const createdAt = bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
post.record,
|
post.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import {AppModerationCause} from '#/components/Pills'
|
|||||||
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
||||||
import * as atp from '#/types/atproto'
|
import * as atp from '#/types/bsky'
|
||||||
import {Link, TextLink, TextLinkOnWebOnly} from '../util/Link'
|
import {Link, TextLink, TextLinkOnWebOnly} from '../util/Link'
|
||||||
import {AviFollowButton} from './AviFollowButton'
|
import {AviFollowButton} from './AviFollowButton'
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {useLingui} from '@lingui/react'
|
|||||||
|
|
||||||
import {Shadow} from '#/state/cache/types'
|
import {Shadow} from '#/state/cache/types'
|
||||||
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
|
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {Button, ButtonType} from '../util/forms/Button'
|
import {Button, ButtonType} from '../util/forms/Button'
|
||||||
import * as Toast from '../util/Toast'
|
import * as Toast from '../util/Toast'
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ export function FollowButton({
|
|||||||
}: {
|
}: {
|
||||||
unfollowedType?: ButtonType
|
unfollowedType?: ButtonType
|
||||||
followedType?: ButtonType
|
followedType?: ButtonType
|
||||||
profile: Shadow<atp.profile.AnyProfileView>
|
profile: Shadow<bsky.profile.AnyProfileView>
|
||||||
labelStyle?: StyleProp<TextStyle>
|
labelStyle?: StyleProp<TextStyle>
|
||||||
logContext: 'ProfileCard' | 'StarterPackProfilesList'
|
logContext: 'ProfileCard' | 'StarterPackProfilesList'
|
||||||
onFollow?: () => void
|
onFollow?: () => void
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
shouldShowKnownFollowers,
|
shouldShowKnownFollowers,
|
||||||
} from '#/components/KnownFollowers'
|
} from '#/components/KnownFollowers'
|
||||||
import * as Pills from '#/components/Pills'
|
import * as Pills from '#/components/Pills'
|
||||||
import * as atp from '#/types/atproto'
|
import * as atp from '#/types/bsky'
|
||||||
import {Link} from '../util/Link'
|
import {Link} from '../util/Link'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
import {PreviewableUserAvatar} from '../util/UserAvatar'
|
import {PreviewableUserAvatar} from '../util/UserAvatar'
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {Link} from '#/components/Link'
|
|||||||
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
|
||||||
import * as Menu from '#/components/Menu'
|
import * as Menu from '#/components/Menu'
|
||||||
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
import {ProfileHoverCard} from '#/components/ProfileHoverCard'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {openCamera, openCropper, openPicker} from '../../../lib/media/picker'
|
import {openCamera, openCropper, openPicker} from '../../../lib/media/picker'
|
||||||
|
|
||||||
export type UserAvatarType = 'user' | 'algo' | 'list' | 'labeler'
|
export type UserAvatarType = 'user' | 'algo' | 'list' | 'labeler'
|
||||||
@@ -56,7 +56,7 @@ interface EditableUserAvatarProps extends BaseUserAvatarProps {
|
|||||||
|
|
||||||
interface PreviewableUserAvatarProps extends BaseUserAvatarProps {
|
interface PreviewableUserAvatarProps extends BaseUserAvatarProps {
|
||||||
moderation?: ModerationUI
|
moderation?: ModerationUI
|
||||||
profile: atp.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
disableHoverCard?: boolean
|
disableHoverCard?: boolean
|
||||||
onBeforePress?: () => void
|
onBeforePress?: () => void
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import {useSession} from '#/state/session'
|
|||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
import {SubtleWebHover} from '#/components/SubtleWebHover'
|
||||||
import * as atp from '#/types/atproto'
|
import * as bsky from '#/types/bsky'
|
||||||
import {ContentHider} from '../../../../components/moderation/ContentHider'
|
import {ContentHider} from '../../../../components/moderation/ContentHider'
|
||||||
import {PostAlerts} from '../../../../components/moderation/PostAlerts'
|
import {PostAlerts} from '../../../../components/moderation/PostAlerts'
|
||||||
import {Link} from '../Link'
|
import {Link} from '../Link'
|
||||||
@@ -173,7 +173,7 @@ export function QuoteEmbed({
|
|||||||
|
|
||||||
const richText = React.useMemo(() => {
|
const richText = React.useMemo(() => {
|
||||||
if (
|
if (
|
||||||
!atp.dangerousIsType<AppBskyFeedPost.Record>(
|
!bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||||
quote.record,
|
quote.record,
|
||||||
AppBskyFeedPost.isRecord,
|
AppBskyFeedPost.isRecord,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user