Rename atproto -> bsky

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