diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index cd8dba4aca..709d0631dc 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -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() diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx index 3bc909b06c..eafed25e50 100644 --- a/src/components/FeedInterstitials.tsx +++ b/src/components/FeedInterstitials.tsx @@ -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' diff --git a/src/components/ListCard.tsx b/src/components/ListCard.tsx index 13fc4e222b..30156ee0d3 100644 --- a/src/components/ListCard.tsx +++ b/src/components/ListCard.tsx @@ -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 }) { diff --git a/src/components/MediaPreview.tsx b/src/components/MediaPreview.tsx index 96fb0b2812..9e5e095244 100644 --- a/src/components/MediaPreview.tsx +++ b/src/components/MediaPreview.tsx @@ -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 diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index a9ae464aca..b56112dcf2 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -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) { 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'] diff --git a/src/components/StarterPack/QrCode.tsx b/src/components/StarterPack/QrCode.tsx index a6e3208fff..6443ec694c 100644 --- a/src/components/StarterPack/QrCode.tsx +++ b/src/components/StarterPack/QrCode.tsx @@ -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(function QrCode( const {record} = starterPack if ( - !atp.dangerousIsType( + !bsky.dangerousIsType( record, AppBskyGraphStarterpack.isRecord, ) diff --git a/src/components/StarterPack/StarterPackCard.tsx b/src/components/StarterPack/StarterPackCard.tsx index 72deca9f6b..ab9c01fc06 100644 --- a/src/components/StarterPack/StarterPackCard.tsx +++ b/src/components/StarterPack/StarterPackCard.tsx @@ -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( + !bsky.dangerousIsType( 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) diff --git a/src/components/StarterPack/Wizard/WizardListCard.tsx b/src/components/StarterPack/Wizard/WizardListCard.tsx index 77eb8365ae..e1a70a0b71 100644 --- a/src/components/StarterPack/Wizard/WizardListCard.tsx +++ b/src/components/StarterPack/Wizard/WizardListCard.tsx @@ -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() diff --git a/src/components/VideoPostCard.tsx b/src/components/VideoPostCard.tsx index 3ddd61e978..3e396e7d3d 100644 --- a/src/components/VideoPostCard.tsx +++ b/src/components/VideoPostCard.tsx @@ -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) { 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( + const text = bsky.dangerousIsType( post.record, AppBskyFeedPost.isRecord, ) diff --git a/src/components/WhoCanReply.tsx b/src/components/WhoCanReply.tsx index a992aeccce..f5280beb6e 100644 --- a/src/components/WhoCanReply.tsx +++ b/src/components/WhoCanReply.tsx @@ -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( + bsky.dangerousIsType( post.record, AppBskyFeedPost.isRecord, ) && post.record.reply?.root diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx index 003d849379..590f25dd31 100644 --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -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 + profile: Shadow control?: Menu.MenuControlProps currentScreen: 'list' | 'conversation' showMarkAsRead?: boolean @@ -145,7 +145,7 @@ function MenuContent({ blockedByListControl, }: { convo: ChatBskyConvoDefs.ConvoView - profile: Shadow + profile: Shadow showMarkAsRead?: boolean blockInfo: { listBlocks: ModerationCause[] diff --git a/src/components/dms/MessagesListBlockedFooter.tsx b/src/components/dms/MessagesListBlockedFooter.tsx index 6c3592cb1a..9c63ef2c7e 100644 --- a/src/components/dms/MessagesListBlockedFooter.tsx +++ b/src/components/dms/MessagesListBlockedFooter.tsx @@ -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 diff --git a/src/components/dms/dialogs/SearchablePeopleList.tsx b/src/components/dms/dialogs/SearchablePeopleList.tsx index 52ed297766..29356b5873 100644 --- a/src/components/dms/dialogs/SearchablePeopleList.tsx +++ b/src/components/dms/dialogs/SearchablePeopleList.tsx @@ -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 }) { diff --git a/src/components/dms/util.ts b/src/components/dms/util.ts index 92e2337a9e..7315f5fc9c 100644 --- a/src/components/dms/util.ts +++ b/src/components/dms/util.ts @@ -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 diff --git a/src/components/hooks/useFollowMethods.ts b/src/components/hooks/useFollowMethods.ts index ffce60ea2c..e6b3f2c473 100644 --- a/src/components/hooks/useFollowMethods.ts +++ b/src/components/hooks/useFollowMethods.ts @@ -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 + profile: Shadow logContext: LogEvents['profile:follow']['logContext'] & LogEvents['profile:unfollow']['logContext'] }) { diff --git a/src/lib/generate-starterpack.ts b/src/lib/generate-starterpack.ts index 5137983c43..11e3343293 100644 --- a/src/lib/generate-starterpack.ts +++ b/src/lib/generate-starterpack.ts @@ -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') diff --git a/src/lib/moderation/blocked-and-muted.ts b/src/lib/moderation/blocked-and-muted.ts index bee03fa6d3..8eaab80694 100644 --- a/src/lib/moderation/blocked-and-muted.ts +++ b/src/lib/moderation/blocked-and-muted.ts @@ -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 diff --git a/src/lib/strings/starter-pack.ts b/src/lib/strings/starter-pack.ts index 2e4497a443..609a233c0c 100644 --- a/src/lib/strings/starter-pack.ts +++ b/src/lib/strings/starter-pack.ts @@ -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, diff --git a/src/screens/Messages/components/ChatListItem.tsx b/src/screens/Messages/components/ChatListItem.tsx index b4aa9ab979..eed3236ace 100644 --- a/src/screens/Messages/components/ChatListItem.tsx +++ b/src/screens/Messages/components/ChatListItem.tsx @@ -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() diff --git a/src/screens/Messages/components/MessageInputEmbed.tsx b/src/screens/Messages/components/MessageInputEmbed.tsx index af6906dd91..d368f05b6b 100644 --- a/src/screens/Messages/components/MessageInputEmbed.tsx +++ b/src/screens/Messages/components/MessageInputEmbed.tsx @@ -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( + bsky.dangerousIsType( post.record, AppBskyFeedPost.isRecord, ) diff --git a/src/screens/Onboarding/StepFinished.tsx b/src/screens/Onboarding/StepFinished.tsx index 1e1c6aacd8..cd28f61389 100644 --- a/src/screens/Onboarding/StepFinished.tsx +++ b/src/screens/Onboarding/StepFinished.tsx @@ -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( + bsky.dangerousIsType( starterPack.record, AppBskyGraphStarterpack.isRecord, ) diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index 55367fa9e0..e82d0da1c0 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -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> {showStarterPackCard && - atp.dangerousIsType( + bsky.dangerousIsType( starterPack.record, AppBskyGraphStarterpack.isRecord, ) ? ( diff --git a/src/screens/StarterPack/StarterPackLandingScreen.tsx b/src/screens/StarterPack/StarterPackLandingScreen.tsx index 919e7b5d44..2d9a919698 100644 --- a/src/screens/StarterPack/StarterPackLandingScreen.tsx +++ b/src/screens/StarterPack/StarterPackLandingScreen.tsx @@ -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( + !bsky.dangerousIsType( starterPack.record, AppBskyGraphStarterpack.isRecord, ) diff --git a/src/screens/StarterPack/StarterPackScreen.tsx b/src/screens/StarterPack/StarterPackScreen.tsx index 50ce7ba37b..ac61c153b3 100644 --- a/src/screens/StarterPack/StarterPackScreen.tsx +++ b/src/screens/StarterPack/StarterPackScreen.tsx @@ -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( + !bsky.dangerousIsType( record, AppBskyGraphStarterpack.isRecord, ) diff --git a/src/screens/StarterPack/Wizard/State.tsx b/src/screens/StarterPack/Wizard/State.tsx index b09d74a002..6c64add055 100644 --- a/src/screens/StarterPack/Wizard/State.tsx +++ b/src/screens/StarterPack/Wizard/State.tsx @@ -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 diff --git a/src/screens/StarterPack/Wizard/StepProfiles.tsx b/src/screens/StarterPack/Wizard/StepProfiles.tsx index 0c0cafa2f9..8a9a891e1a 100644 --- a/src/screens/StarterPack/Wizard/StepProfiles.tsx +++ b/src/screens/StarterPack/Wizard/StepProfiles.tsx @@ -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) => { + }: ListRenderItemInfo) => { return ( ( + const record = bsky.dangerousIsType( post.record, AppBskyFeedPost.isRecord, ) diff --git a/src/state/cache/profile-shadow.ts b/src/state/cache/profile-shadow.ts index 1ce70045e8..adbff39198 100644 --- a/src/state/cache/profile-shadow.ts +++ b/src/state/cache/profile-shadow.ts @@ -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 > = new WeakMap() const emitter = new EventEmitter() export function useProfileShadow< - TProfileView extends atp.profile.AnyProfileView, + TProfileView extends bsky.profile.AnyProfileView, >(profile: TProfileView): Shadow { 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 | undefined { const [shadow, setShadow] = useState(() => profile ? shadows.get(profile) : undefined, @@ -116,7 +116,7 @@ export function updateProfileShadow( }) } -function mergeShadow( +function mergeShadow( profile: TProfileView, shadow: Partial, ): Shadow { @@ -138,7 +138,7 @@ function mergeShadow( function* findProfilesInCache( queryClient: QueryClient, did: string, -): Generator { +): Generator { yield* findAllProfilesInListMembersQueryData(queryClient, did) yield* findAllProfilesInMyBlockedAccountsQueryData(queryClient, did) yield* findAllProfilesInMyMutedAccountsQueryData(queryClient, did) diff --git a/src/state/queries/notifications/util.ts b/src/state/queries/notifications/util.ts index 339a341d0f..f6f53f58fe 100644 --- a/src/state/queries/notifications/util.ts +++ b/src/state/queries/notifications/util.ts @@ -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( + bsky.dangerousIsType( notif.record, AppBskyFeedRepost.isRecord, ) || - atp.dangerousIsType( + bsky.dangerousIsType( notif.record, AppBskyFeedLike.isRecord, ) diff --git a/src/state/queries/post-thread.ts b/src/state/queries/post-thread.ts index ad82b513cb..b1cd626cf5 100644 --- a/src/state/queries/post-thread.ts +++ b/src/state/queries/post-thread.ts @@ -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( + bsky.dangerousIsType( node.post.record, AppBskyFeedPost.isRecord, ) diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts index b50c17f93e..fac1fc8c12 100644 --- a/src/state/queries/profile.ts +++ b/src/state/queries/profile.ts @@ -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, + profile: Shadow, 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, + profile: Shadow, ) { const {currentAccount} = useSession() const agent = useAgent() @@ -340,7 +340,7 @@ function useProfileUnfollowMutation( } export function useProfileMuteMutationQueue( - profile: Shadow, + profile: Shadow, ) { const queryClient = useQueryClient() const did = profile.did @@ -415,7 +415,7 @@ function useProfileUnmuteMutation() { } export function useProfileBlockMutationQueue( - profile: Shadow, + profile: Shadow, ) { const queryClient = useQueryClient() const did = profile.did diff --git a/src/state/queries/starter-packs.ts b/src/state/queries/starter-packs.ts index ec935836d3..02da3f5a1b 100644 --- a/src/state/queries/starter-packs.ts +++ b/src/state/queries/starter-packs.ts @@ -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[] } diff --git a/src/state/queries/unstable-profile-cache.ts b/src/state/queries/unstable-profile-cache.ts index 7ffbfade4a..4ac5001b7d 100644 --- a/src/state/queries/unstable-profile-cache.ts +++ b/src/state/queries/unstable-profile-cache.ts @@ -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( + return qc.getQueryData( unstableProfileViewCacheQueryKey(didOrHandle), ) }, diff --git a/src/state/queries/util.ts b/src/state/queries/util.ts index e299f013db..71d185bec7 100644 --- a/src/state/queries/util.ts +++ b/src/state/queries/util.ts @@ -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( queryClient: QueryClient, @@ -47,7 +47,7 @@ export function getEmbeddedPost( v: unknown, ): AppBskyEmbedRecord.ViewRecord | undefined { if ( - atp.dangerousIsType(v, AppBskyEmbedRecord.isView) + bsky.dangerousIsType(v, AppBskyEmbedRecord.isView) ) { if ( AppBskyEmbedRecord.isViewRecord(v.record) && @@ -57,7 +57,7 @@ export function getEmbeddedPost( } } if ( - atp.dangerousIsType( + bsky.dangerousIsType( v, AppBskyEmbedRecordWithMedia.isView, ) diff --git a/src/types/atproto/index.ts b/src/types/bsky/index.ts similarity index 87% rename from src/types/atproto/index.ts rename to src/types/bsky/index.ts index 5792770a08..2b9ab5b45e 100644 --- a/src/types/atproto/index.ts +++ b/src/types/bsky/index.ts @@ -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. diff --git a/src/types/atproto/post.ts b/src/types/bsky/post.ts similarity index 100% rename from src/types/atproto/post.ts rename to src/types/bsky/post.ts diff --git a/src/types/atproto/profile.ts b/src/types/bsky/profile.ts similarity index 100% rename from src/types/atproto/profile.ts rename to src/types/bsky/profile.ts diff --git a/src/types/atproto/starterPack.ts b/src/types/bsky/starterPack.ts similarity index 100% rename from src/types/atproto/starterPack.ts rename to src/types/bsky/starterPack.ts diff --git a/src/view/com/lists/ListMembers.tsx b/src/view/com/lists/ListMembers.tsx index c8ecfc057a..31d2b5fb5c 100644 --- a/src/view/com/lists/ListMembers.tsx +++ b/src/view/com/lists/ListMembers.tsx @@ -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 } diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 186d054fca..84694fe3b8 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -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( + bsky.dangerousIsType( item.notification.record, AppBskyGraphFollow.isRecord, ) @@ -722,7 +722,7 @@ function AdditionalPostText({post}: {post?: AppBskyFeedDefs.PostView}) { const pal = usePalette('default') if ( post && - atp.dangerousIsType( + bsky.dangerousIsType( post?.record, AppBskyFeedPost.isRecord, ) diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index d88ec66880..00d0dc9ed9 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -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( + const createdAt = bsky.dangerousIsType( post.record, AppBskyFeedPost.isRecord, ) diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index 6aa1642db0..5dc8690fa3 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -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' diff --git a/src/view/com/profile/FollowButton.tsx b/src/view/com/profile/FollowButton.tsx index 4381d974b6..656ed914af 100644 --- a/src/view/com/profile/FollowButton.tsx +++ b/src/view/com/profile/FollowButton.tsx @@ -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 + profile: Shadow labelStyle?: StyleProp logContext: 'ProfileCard' | 'StarterPackProfilesList' onFollow?: () => void diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index 6d9796fb49..4eb5d4859c 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -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' diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 7c24cab9f2..934e8f50cc 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -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 } diff --git a/src/view/com/util/post-embeds/QuoteEmbed.tsx b/src/view/com/util/post-embeds/QuoteEmbed.tsx index 6622ff98a2..e283a2eec1 100644 --- a/src/view/com/util/post-embeds/QuoteEmbed.tsx +++ b/src/view/com/util/post-embeds/QuoteEmbed.tsx @@ -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( + !bsky.dangerousIsType( quote.record, AppBskyFeedPost.isRecord, )