Upgrade prettier to 3.6 (#8558)

* upgrade prettier

* run prettier

* more files
This commit is contained in:
Samuel Newman
2025-06-23 17:44:40 +03:00
committed by GitHub
parent 3c92714e4e
commit c634cd9071
60 changed files with 427 additions and 383 deletions
+1 -3
View File
@@ -1,9 +1,7 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
darkMode: ['variant', [
'&:is(.dark *):not(:is(.dark .light *))',
]],
darkMode: ['variant', ['&:is(.dark *):not(:is(.dark .light *))']],
theme: {
extend: {
colors: {
-1
View File
@@ -1,4 +1,3 @@
{
"compilerOptions": {
"target": "ES5",
+11 -8
View File
@@ -1,27 +1,30 @@
import assert from 'assert'
import {
Kysely,
KyselyPlugin,
type KyselyPlugin,
Migrator,
PluginTransformQueryArgs,
PluginTransformResultArgs,
type PluginTransformQueryArgs,
type PluginTransformResultArgs,
PostgresDialect,
QueryResult,
RootOperationNode,
UnknownRow,
type QueryResult,
type RootOperationNode,
type UnknownRow,
} from 'kysely'
import {default as Pg} from 'pg'
import {dbLogger as log} from '../logger.js'
import {default as migrations} from './migrations/index.js'
import {DbMigrationProvider} from './migrations/provider.js'
import {DbSchema} from './schema.js'
import {type DbSchema} from './schema.js'
export class Database {
migrator: Migrator
destroyed = false
constructor(public db: Kysely<DbSchema>, public cfg: PgConfig) {
constructor(
public db: Kysely<DbSchema>,
public cfg: PgConfig,
) {
this.migrator = new Migrator({
db,
migrationTableSchema: cfg.schema,
+7 -4
View File
@@ -1,11 +1,11 @@
import events from 'node:events'
import http from 'node:http'
import type http from 'node:http'
import cors from 'cors'
import express from 'express'
import {createHttpTerminator, HttpTerminator} from 'http-terminator'
import {createHttpTerminator, type HttpTerminator} from 'http-terminator'
import {Config} from './config.js'
import {type Config} from './config.js'
import {AppContext} from './context.js'
import {default as routes, errorHandler} from './routes/index.js'
@@ -17,7 +17,10 @@ export class LinkService {
public server?: http.Server
private terminator?: HttpTerminator
constructor(public app: express.Application, public ctx: AppContext) {}
constructor(
public app: express.Application,
public ctx: AppContext,
) {}
static async create(cfg: Config): Promise<LinkService> {
let app = express()
+7 -4
View File
@@ -1,10 +1,10 @@
import events from 'node:events'
import http from 'node:http'
import type http from 'node:http'
import express from 'express'
import {createHttpTerminator, HttpTerminator} from 'http-terminator'
import {createHttpTerminator, type HttpTerminator} from 'http-terminator'
import {Config} from './config.js'
import {type Config} from './config.js'
import {AppContext} from './context.js'
import {default as routes, errorHandler} from './routes/index.js'
@@ -15,7 +15,10 @@ export class CardService {
public server?: http.Server
private terminator?: HttpTerminator
constructor(public app: express.Application, public ctx: AppContext) {}
constructor(
public app: express.Application,
public ctx: AppContext,
) {}
static async create(cfg: Config): Promise<CardService> {
let app = express()
@@ -12,7 +12,7 @@ const EmojiPicker = ({onEmojiSelected}: EmojiPickerViewProps) => {
flex: 1,
width: '100%',
backgroundColor: scheme === 'dark' ? '#000' : '#fff',
} as const),
}) as const,
[scheme],
)
+1 -1
View File
@@ -266,7 +266,7 @@
"lint-staged": "^13.2.3",
"lockfile-lint": "^4.14.0",
"metro-react-native-babel-preset": "^0.77.0",
"prettier": "^2.8.3",
"prettier": "^3.6.0",
"react-native-dotenv": "^3.4.11",
"react-refresh": "^0.14.0",
"svgo": "^3.3.2",
+3 -4
View File
@@ -9,10 +9,9 @@ const templateFile = path.join(
'scripts.html',
)
const {entrypoints} = require(path.join(
projectRoot,
'web-build/asset-manifest.json',
))
const {entrypoints} = require(
path.join(projectRoot, 'web-build/asset-manifest.json'),
)
console.log(`Found ${entrypoints.length} entrypoints`)
console.log(`Writing ${templateFile}`)
+1 -1
View File
@@ -190,7 +190,7 @@ export function Root({children}: {children: React.ReactNode}) {
if (item) playHaptic('Light')
setHoveredMenuItem(item)
},
} satisfies ContextType),
}) satisfies ContextType,
[
measurement,
setMeasurement,
+10 -4
View File
@@ -1,9 +1,15 @@
import React from 'react'
import {Keyboard, Platform, StyleProp, View, ViewStyle} from 'react-native'
import {
AppBskyFeedDefs,
Keyboard,
Platform,
type StyleProp,
View,
type ViewStyle,
} from 'react-native'
import {
type AppBskyFeedDefs,
AppBskyFeedPost,
AppBskyGraphDefs,
type AppBskyGraphDefs,
AtUri,
} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
@@ -13,7 +19,7 @@ import {HITSLOP_10} from '#/lib/constants'
import {makeListLink, makeProfileLink} from '#/lib/routes/links'
import {isNative} from '#/platform/detection'
import {
ThreadgateAllowUISetting,
type ThreadgateAllowUISetting,
threadgateViewToAllowUISetting,
} from '#/state/queries/threadgate'
import {atoms as a, useTheme} from '#/alf'
+1 -2
View File
@@ -128,8 +128,7 @@ export let MessageContextMenu = ({
label={_(msg`Message options`)}
contentLabel={_(
msg`Message from @${
sender?.handle ?? // should always be defined
'unknown'
sender?.handle ?? 'unknown' // should always be defined
}: ${message.text}`,
)}>
{children}
+4 -5
View File
@@ -3,10 +3,8 @@ import Svg, {Circle, Path} from 'react-native-svg'
import {type Props, useCommonSVGProps} from '#/components/icons/common'
export const VerifiedCheck = React.forwardRef<Svg, Props>(function LogoImpl(
props,
ref,
) {
export const VerifiedCheck = React.forwardRef<Svg, Props>(
function LogoImpl(props, ref) {
const {fill, size, style, ...rest} = useCommonSVGProps(props)
return (
@@ -27,4 +25,5 @@ export const VerifiedCheck = React.forwardRef<Svg, Props>(function LogoImpl(
/>
</Svg>
)
})
},
)
+4 -5
View File
@@ -3,10 +3,8 @@ import Svg, {Path} from 'react-native-svg'
import {type Props, useCommonSVGProps} from '#/components/icons/common'
export const VerifierCheck = React.forwardRef<Svg, Props>(function LogoImpl(
props,
ref,
) {
export const VerifierCheck = React.forwardRef<Svg, Props>(
function LogoImpl(props, ref) {
const {fill, size, style, ...rest} = useCommonSVGProps(props)
return (
@@ -32,4 +30,5 @@ export const VerifierCheck = React.forwardRef<Svg, Props>(function LogoImpl(
/>
</Svg>
)
})
},
)
+2 -2
View File
@@ -1,6 +1,6 @@
import React from 'react'
import {StyleProp, View, ViewStyle} from 'react-native'
import {ModerationUI} from '@atproto/api'
import {type StyleProp, View, type ViewStyle} from 'react-native'
import {type ModerationUI} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+7 -7
View File
@@ -1,18 +1,18 @@
import React from 'react'
import {
AppBskyLabelerDefs,
type AppBskyLabelerDefs,
BskyAgent,
ComAtprotoLabelDefs,
InterpretedLabelValueDefinition,
type ComAtprotoLabelDefs,
type InterpretedLabelValueDefinition,
LABELS,
ModerationCause,
ModerationOpts,
ModerationUI,
type ModerationCause,
type ModerationOpts,
type ModerationUI,
} from '@atproto/api'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles'
import {AppModerationCause} from '#/components/Pills'
import {type AppModerationCause} from '#/components/Pills'
export const ADULT_CONTENT_LABELS = ['sexual', 'nudity', 'porn']
export const OTHER_SELF_LABELS = ['graphic-media']
@@ -1,8 +1,8 @@
import React from 'react'
import {
BSKY_LABELER_DID,
ModerationCause,
ModerationCauseSource,
type ModerationCause,
type ModerationCauseSource,
} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -12,10 +12,10 @@ import {useLabelDefinitions} from '#/state/preferences'
import {useSession} from '#/state/session'
import {CircleBanSign_Stroke2_Corner0_Rounded as CircleBanSign} from '#/components/icons/CircleBanSign'
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
import {Props as SVGIconProps} from '#/components/icons/common'
import {type Props as SVGIconProps} from '#/components/icons/common'
import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlash} from '#/components/icons/EyeSlash'
import {Warning_Stroke2_Corner0_Rounded as Warning} from '#/components/icons/Warning'
import {AppModerationCause} from '#/components/Pills'
import {type AppModerationCause} from '#/components/Pills'
import {useGlobalLabelStrings} from './useGlobalLabelStrings'
import {getDefinition, getLabelStrings} from './useLabelInfo'
+3 -3
View File
@@ -1,17 +1,17 @@
import React from 'react'
import {Platform} from 'react-native'
import {AppState, AppStateStatus} from 'react-native'
import {AppState, type AppStateStatus} from 'react-native'
import {Statsig, StatsigProvider} from 'statsig-react-native-expo'
import {BUNDLE_DATE, BUNDLE_IDENTIFIER, IS_TESTFLIGHT} from '#/lib/app-info'
import {logger} from '#/logger'
import {MetricEvents} from '#/logger/metrics'
import {type MetricEvents} from '#/logger/metrics'
import {isWeb} from '#/platform/detection'
import * as persisted from '#/state/persisted'
import {useSession} from '../../state/session'
import {timeout} from '../async/timeout'
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
import {Gate} from './gates'
import {type Gate} from './gates'
const SDK_KEY = 'client-SXJakO39w9vIhl3D44u8UupyzFl4oZ2qPIkjwcvuPsV'
+1 -1
View File
@@ -155,7 +155,7 @@ export function MessagesScreen({navigation, route}: Props) {
profiles: inboxPreviewConvos.slice(0, 3),
},
...conversations.map(
convo => ({type: 'CONVERSATION', conversation: convo} as const),
convo => ({type: 'CONVERSATION', conversation: convo}) as const,
),
] satisfies ListItem[]
}
+2 -2
View File
@@ -342,11 +342,11 @@ export function Explore({
])
const topBorder = useMemo(
() => ({type: 'topBorder', key: 'top-border'} as const),
() => ({type: 'topBorder', key: 'top-border'}) as const,
[],
)
const trendingTopicsModule = useMemo(
() => ({type: 'trendingTopics', key: 'trending-topics'} as const),
() => ({type: 'trendingTopics', key: 'trending-topics'}) as const,
[],
)
const suggestedFollowsModule = useMemo(() => {
@@ -2,7 +2,7 @@ import {useMemo} from 'react'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {AppIconSet} from '#/screens/Settings/AppIconSettings/types'
import {type AppIconSet} from '#/screens/Settings/AppIconSettings/types'
export function useAppIconSets() {
const {_} = useLingui()
@@ -13,20 +13,28 @@ export function useAppIconSets() {
id: 'default_light',
name: _(msg({context: 'Name of app icon variant', message: 'Light'})),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_default_light.png`)
return require(
`../../../../assets/app-icons/ios_icon_default_light.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_default_light.png`)
return require(
`../../../../assets/app-icons/android_icon_default_light.png`,
)
},
},
{
id: 'default_dark',
name: _(msg({context: 'Name of app icon variant', message: 'Dark'})),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_default_dark.png`)
return require(
`../../../../assets/app-icons/ios_icon_default_dark.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_default_dark.png`)
return require(
`../../../../assets/app-icons/android_icon_default_dark.png`,
)
},
},
] satisfies AppIconSet[]
@@ -39,10 +47,14 @@ export function useAppIconSets() {
id: 'core_aurora',
name: _(msg({context: 'Name of app icon variant', message: 'Aurora'})),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_aurora.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_aurora.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_aurora.png`)
return require(
`../../../../assets/app-icons/android_icon_core_aurora.png`,
)
},
},
// {
@@ -59,20 +71,28 @@ export function useAppIconSets() {
id: 'core_sunrise',
name: _(msg({context: 'Name of app icon variant', message: 'Sunrise'})),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_sunrise.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_sunrise.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_sunrise.png`)
return require(
`../../../../assets/app-icons/android_icon_core_sunrise.png`,
)
},
},
{
id: 'core_sunset',
name: _(msg({context: 'Name of app icon variant', message: 'Sunset'})),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_sunset.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_sunset.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_sunset.png`)
return require(
`../../../../assets/app-icons/android_icon_core_sunset.png`,
)
},
},
{
@@ -81,10 +101,14 @@ export function useAppIconSets() {
msg({context: 'Name of app icon variant', message: 'Midnight'}),
),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_midnight.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_midnight.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_midnight.png`)
return require(
`../../../../assets/app-icons/android_icon_core_midnight.png`,
)
},
},
{
@@ -93,10 +117,14 @@ export function useAppIconSets() {
msg({context: 'Name of app icon variant', message: 'Flat Blue'}),
),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_flat_blue.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_flat_blue.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_flat_blue.png`)
return require(
`../../../../assets/app-icons/android_icon_core_flat_blue.png`,
)
},
},
{
@@ -105,10 +133,14 @@ export function useAppIconSets() {
msg({context: 'Name of app icon variant', message: 'Flat White'}),
),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_flat_white.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_flat_white.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_flat_white.png`)
return require(
`../../../../assets/app-icons/android_icon_core_flat_white.png`,
)
},
},
{
@@ -117,10 +149,14 @@ export function useAppIconSets() {
msg({context: 'Name of app icon variant', message: 'Flat Black'}),
),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_flat_black.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_flat_black.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_flat_black.png`)
return require(
`../../../../assets/app-icons/android_icon_core_flat_black.png`,
)
},
},
{
@@ -132,10 +168,14 @@ export function useAppIconSets() {
}),
),
iosImage: () => {
return require(`../../../../assets/app-icons/ios_icon_core_classic.png`)
return require(
`../../../../assets/app-icons/ios_icon_core_classic.png`,
)
},
androidImage: () => {
return require(`../../../../assets/app-icons/android_icon_core_classic.png`)
return require(
`../../../../assets/app-icons/android_icon_core_classic.png`,
)
},
},
] satisfies AppIconSet[]
+11 -22
View File
@@ -36,38 +36,27 @@ const RQKEY = (feeds: string[]) => [RQKEY_ROOT, feeds]
const LIMIT = 8 // sliced to 6, overfetch to account for moderation
const PINNED_POST_URIS: Record<string, boolean> = {
// 📰 News
'at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.post/3lgh27w2ngc2b':
true,
'at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.post/3lgh27w2ngc2b': true,
// Gardening
'at://did:plc:5rw2on4i56btlcajojaxwcat/app.bsky.feed.post/3kjorckgcwc27':
true,
'at://did:plc:5rw2on4i56btlcajojaxwcat/app.bsky.feed.post/3kjorckgcwc27': true,
// Web Development Trending
'at://did:plc:m2sjv3wncvsasdapla35hzwj/app.bsky.feed.post/3lfaw445axs22':
true,
'at://did:plc:m2sjv3wncvsasdapla35hzwj/app.bsky.feed.post/3lfaw445axs22': true,
// Anime & Manga EN
'at://did:plc:tazrmeme4dzahimsykusrwrk/app.bsky.feed.post/3knxx2gmkns2y':
true,
'at://did:plc:tazrmeme4dzahimsykusrwrk/app.bsky.feed.post/3knxx2gmkns2y': true,
// 📽️ Film
'at://did:plc:2hwwem55ce6djnk6bn62cstr/app.bsky.feed.post/3llhpzhbq7c2g':
true,
'at://did:plc:2hwwem55ce6djnk6bn62cstr/app.bsky.feed.post/3llhpzhbq7c2g': true,
// PopSky
'at://did:plc:lfdf4srj43iwdng7jn35tjsp/app.bsky.feed.post/3lbblgly65c2g':
true,
'at://did:plc:lfdf4srj43iwdng7jn35tjsp/app.bsky.feed.post/3lbblgly65c2g': true,
// Science
'at://did:plc:hu2obebw3nhfj667522dahfg/app.bsky.feed.post/3kl33otd6ob2s':
true,
'at://did:plc:hu2obebw3nhfj667522dahfg/app.bsky.feed.post/3kl33otd6ob2s': true,
// Birds! 🦉
'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.post/3lbg4r57yk22d':
true,
'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.post/3lbg4r57yk22d': true,
// Astronomy
'at://did:plc:xy2zorw2ys47poflotxthlzg/app.bsky.feed.post/3kyzye4lujs2w':
true,
'at://did:plc:xy2zorw2ys47poflotxthlzg/app.bsky.feed.post/3kyzye4lujs2w': true,
// What's Cooking 🍽️
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3lfqhgvxbqc2q':
true,
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3lfqhgvxbqc2q': true,
// BookSky 💙📚 #booksky
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3kgrm2rw5ww2e':
true,
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3kgrm2rw5ww2e': true,
}
export type FeedPreviewItem =
+2 -3
View File
@@ -36,9 +36,8 @@ export function useNotificationSettingsUpdateMutation() {
mutationFn: async (
update: Partial<AppBskyNotificationDefs.Preferences>,
) => {
const response = await agent.app.bsky.notification.putPreferencesV2(
update,
)
const response =
await agent.app.bsky.notification.putPreferencesV2(update)
return response.data.preferences
},
onMutate: update => {
+1 -1
View File
@@ -14,7 +14,7 @@ import {useAgent, useSession} from '#/state/session'
import {useModerationOpts} from '../../preferences/moderation-opts'
import {truncateAndInvalidate} from '../util'
import {RQKEY as RQKEY_NOTIFS} from './feed'
import {CachedFeedPage, FeedPage} from './types'
import {type CachedFeedPage, type FeedPage} from './types'
import {fetchPage} from './util'
const UPDATE_INTERVAL = 30 * 1e3 // 30sec
+1 -1
View File
@@ -444,7 +444,7 @@ export function buildThread({
const anchorPost = items.at(0)
const hasAnchorFromCache = anchorPost && anchorPost.type === 'threadPost'
const skeletonReplies = hasAnchorFromCache
? anchorPost.value.post.replyCount ?? 4
? (anchorPost.value.post.replyCount ?? 4)
: 4
if (!items.length) {
+5 -13
View File
@@ -1,7 +1,7 @@
import {useCallback, useEffect, useState} from 'react'
import {MMKV} from 'react-native-mmkv'
import {Account, Device} from '#/storage/schema'
import {type Account, type Device} from '#/storage/schema'
export * from '#/storage/schema'
@@ -83,18 +83,10 @@ export class Storage<Scopes extends unknown[], Schema> {
}
}
type StorageSchema<T extends Storage<any, any>> = T extends Storage<
any,
infer U
>
? U
: never
type StorageScopes<T extends Storage<any, any>> = T extends Storage<
infer S,
any
>
? S
: never
type StorageSchema<T extends Storage<any, any>> =
T extends Storage<any, infer U> ? U : never
type StorageScopes<T extends Storage<any, any>> =
T extends Storage<infer S, any> ? S : never
/**
* Hook to use a storage instance. Acts like a useState hook, but persists the
+2 -1
View File
@@ -328,7 +328,8 @@ input[type='range'][orient='vertical']::-moz-range-thumb {
/* #/components/Select/index.web.tsx */
.radix-select-content {
box-shadow: 0px 6px 24px -10px rgba(22, 23, 24, 0.25),
box-shadow:
0px 6px 24px -10px rgba(22, 23, 24, 0.25),
0px 6px 12px -12px rgba(22, 23, 24, 0.15);
min-width: var(--radix-select-trigger-width);
max-height: var(--radix-select-content-available-height);
+6 -6
View File
@@ -1,12 +1,12 @@
import React from 'react'
import {
ImageStyle,
type ImageStyle,
Keyboard,
LayoutChangeEvent,
type LayoutChangeEvent,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
type ViewStyle,
} from 'react-native'
import {Image} from 'expo-image'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
@@ -14,14 +14,14 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {Dimensions} from '#/lib/media/types'
import {type Dimensions} from '#/lib/media/types'
import {colors, s} from '#/lib/styles'
import {isNative} from '#/platform/detection'
import {ComposerImage, cropImage} from '#/state/gallery'
import {type ComposerImage, cropImage} from '#/state/gallery'
import {Text} from '#/view/com/util/text/Text'
import {useTheme} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {PostAction} from '../state/composer'
import {type PostAction} from '../state/composer'
import {EditImageDialog} from './EditImageDialog'
import {ImageAltTextDialog} from './ImageAltTextDialog'
+15 -10
View File
@@ -1,13 +1,13 @@
import {ImagePickerAsset} from 'expo-image-picker'
import {type ImagePickerAsset} from 'expo-image-picker'
import {
AppBskyFeedPostgate,
type AppBskyFeedPostgate,
AppBskyRichtextFacet,
BskyPreferences,
type BskyPreferences,
RichText,
} from '@atproto/api'
import {nanoid} from 'nanoid/non-secure'
import {SelfLabel} from '#/lib/moderation'
import {type SelfLabel} from '#/lib/moderation'
import {insertMentionAt} from '#/lib/strings/mention-manip'
import {shortenLinks} from '#/lib/strings/rich-text-manip'
import {
@@ -15,17 +15,22 @@ import {
postUriToRelativePath,
toBskyAppUrl,
} from '#/lib/strings/url-helpers'
import {ComposerImage, createInitialImages} from '#/state/gallery'
import {type ComposerImage, createInitialImages} from '#/state/gallery'
import {createPostgateRecord} from '#/state/queries/postgate/util'
import {Gif} from '#/state/queries/tenor'
import {type Gif} from '#/state/queries/tenor'
import {threadgateRecordToAllowUISetting} from '#/state/queries/threadgate'
import {ThreadgateAllowUISetting} from '#/state/queries/threadgate'
import {ComposerOpts} from '#/state/shell/composer'
import {type ThreadgateAllowUISetting} from '#/state/queries/threadgate'
import {type ComposerOpts} from '#/state/shell/composer'
import {
LinkFacetMatch,
type LinkFacetMatch,
suggestLinkCardUri,
} from '#/view/com/composer/text-input/text-input-util'
import {createVideoState, VideoAction, videoReducer, VideoState} from './video'
import {
createVideoState,
type VideoAction,
videoReducer,
type VideoState,
} from './video'
type ImagesMedia = {
type: 'images'
+4 -4
View File
@@ -1,17 +1,17 @@
import React, {useCallback, useEffect, useState} from 'react'
import {
Image,
ImageStyle,
type ImageStyle,
Pressable,
StyleSheet,
TouchableOpacity,
TouchableWithoutFeedback,
View,
ViewStyle,
type ViewStyle,
} from 'react-native'
import {
FontAwesomeIcon,
FontAwesomeIconStyle,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -21,7 +21,7 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {colors, s} from '#/lib/styles'
import {useLightbox, useLightboxControls} from '#/state/lightbox'
import {Text} from '../util/text/Text'
import {ImageSource} from './ImageViewing/@types'
import {type ImageSource} from './ImageViewing/@types'
import ImageDefaultHeader from './ImageViewing/components/ImageDefaultHeader'
export function Lightbox() {
+2 -3
View File
@@ -132,12 +132,11 @@ type FeedRow =
key: string
}
export function getItemsForFeedback(feedRow: FeedRow):
| {
export function getItemsForFeedback(feedRow: FeedRow): {
item: FeedPostSliceItem
feedContext: string | undefined
reqId: string | undefined
}[] {
}[] {
if (feedRow.type === 'sliceItem') {
return feedRow.slice.items.map(item => ({
item,
+8 -4
View File
@@ -1,15 +1,19 @@
import React from 'react'
import {View} from 'react-native'
import {AppBskyActorDefs, AppBskyFeedGetAuthorFeed, AtUri} from '@atproto/api'
import {
type AppBskyActorDefs,
AppBskyFeedGetAuthorFeed,
AtUri,
} from '@atproto/api'
import {msg as msgLingui, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native'
import {usePalette} from '#/lib/hooks/usePalette'
import {NavigationProp} from '#/lib/routes/types'
import {type NavigationProp} from '#/lib/routes/types'
import {cleanError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {FeedDescriptor} from '#/state/queries/post-feed'
import {type FeedDescriptor} from '#/state/queries/post-feed'
import {useRemoveFeedMutation} from '#/state/queries/preferences'
import * as Prompt from '#/components/Prompt'
import {EmptyState} from '../util/EmptyState'
@@ -119,7 +123,7 @@ function FeedgenErrorMessage({
[KnownError.FeedTooManyRequests]: _l(
msgLingui`This feed is currently receiving high traffic and is temporarily unavailable. Please try again later.`,
),
}[knownError]),
})[knownError],
[_l, knownError],
)
const [_, uri] = feedDesc.split('|')
+8 -3
View File
@@ -1,6 +1,11 @@
import React, {isValidElement, memo, startTransition, useRef} from 'react'
import {FlatListProps, StyleSheet, View, ViewProps} from 'react-native'
import {ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
import {
type FlatListProps,
StyleSheet,
View,
type ViewProps,
} from 'react-native'
import {type ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
import {batchedUpdates} from '#/lib/batchedUpdates'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
@@ -205,7 +210,7 @@ function ListImpl<ItemT>(
behavior: animated ? 'smooth' : 'instant',
})
},
} as any), // TODO: Better types.
}) as any, // TODO: Better types.
[getScrollableNode],
)
+46 -44
View File
@@ -1,43 +1,44 @@
const preset = [
"removeDoctype",
"removeXMLProcInst",
"removeComments",
"removeMetadata",
"removeEditorsNSData",
"cleanupAttrs",
"mergeStyles",
"inlineStyles",
"minifyStyles",
"cleanupIds",
"removeUselessDefs",
"cleanupNumericValues",
"convertColors",
"removeUnknownsAndDefaults",
"removeNonInheritableGroupAttrs",
"removeUselessStrokeAndFill",
"removeDimensions",
"cleanupEnableBackground",
"removeHiddenElems",
"removeEmptyText",
"convertShapeToPath",
"convertEllipseToCircle",
"moveElemsAttrsToGroup",
"moveGroupAttrsToElems",
"collapseGroups",
"convertPathData",
"convertTransform",
"removeEmptyAttrs",
"removeEmptyContainers",
"removeUnusedNS",
"mergePaths",
"sortAttrs",
"sortDefsChildren",
"removeTitle",
"removeDesc",
'removeDoctype',
'removeXMLProcInst',
'removeComments',
'removeMetadata',
'removeEditorsNSData',
'cleanupAttrs',
'mergeStyles',
'inlineStyles',
'minifyStyles',
'cleanupIds',
'removeUselessDefs',
'cleanupNumericValues',
'convertColors',
'removeUnknownsAndDefaults',
'removeNonInheritableGroupAttrs',
'removeUselessStrokeAndFill',
'removeDimensions',
'cleanupEnableBackground',
'removeHiddenElems',
'removeEmptyText',
'convertShapeToPath',
'convertEllipseToCircle',
'moveElemsAttrsToGroup',
'moveGroupAttrsToElems',
'collapseGroups',
'convertPathData',
'convertTransform',
'removeEmptyAttrs',
'removeEmptyContainers',
'removeUnusedNS',
'mergePaths',
'sortAttrs',
'sortDefsChildren',
'removeTitle',
'removeDesc',
]
export default {
plugins: [...preset.map(name => ({
plugins: [
...preset.map(name => ({
name,
params: {
floatPrecision: 3,
@@ -46,19 +47,20 @@ export default {
// maybe remove in future? will produce smaller output
convertToZ: false,
removeUseless: false,
}
},
})),
{
name: 'addTrailingWhitespace',
fn() {
return {
root: {
exit (root) {
root.children.push({ type: 'text', value: '\n' })
exit(root) {
root.children.push({type: 'text', value: '\n'})
return root
},
},
}
}
}
}
}]
};
},
},
],
}
+4 -4
View File
@@ -16220,10 +16220,10 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
prettier@^2.8.3:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
prettier@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.0.tgz#18ec98d62cb0757a5d4eab40253ff3e6d0fc8dea"
integrity sha512-ujSB9uXHJKzM/2GBuE0hBOUgC77CN3Bnpqa+g80bkv3T3A93wL/xlzDATHhnhkzifz/UE2SNOvmbTz5hSkDlHw==
pretty-bytes@^5.6.0:
version "5.6.0"