diff --git a/.prettierrc.js b/.prettierrc.js index 5c711e3..1e664c9 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -6,4 +6,5 @@ module.exports = { semi: false, trailingComma: 'all', endOfLine: 'auto', + plugins: ['prettier-plugin-tailwindcss'], } diff --git a/assets/bbb.webp b/assets/bbb.webp new file mode 100644 index 0000000..cf04c44 Binary files /dev/null and b/assets/bbb.webp differ diff --git a/assets/ccc.webp b/assets/ccc.webp new file mode 100644 index 0000000..750caba Binary files /dev/null and b/assets/ccc.webp differ diff --git a/package-lock.json b/package-lock.json index fa176f7..34ad5c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,8 @@ "open": "8.4.2", "postcss": "^8.4.38", "postcss-custom-properties": "^13.3.6", - "prettier": "^3.1.1", + "prettier": "^3.3.3", + "prettier-plugin-tailwindcss": "^0.6.8", "rimraf": "^5.0.5", "semver": "^7.5.1", "tailwindcss": "^3.4.1", @@ -18391,9 +18392,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -18417,6 +18418,84 @@ "node": ">=6.0.0" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.8.tgz", + "integrity": "sha512-dGu3kdm7SXPkiW4nzeWKCl3uoImdd5CTZEJGxyypEPL37Wj0HT2pLqjrvSei1nTeuQfO4PUfjeW5cTUNRLZ4sA==", + "dev": true, + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig-melody": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig-melody": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 556dca4..0fea715 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,8 @@ "open": "8.4.2", "postcss": "^8.4.38", "postcss-custom-properties": "^13.3.6", - "prettier": "^3.1.1", + "prettier": "^3.3.3", + "prettier-plugin-tailwindcss": "^0.6.8", "rimraf": "^5.0.5", "semver": "^7.5.1", "tailwindcss": "^3.4.1", diff --git a/src/components/Additional.tsx b/src/components/Additional.tsx index 3760065..f4d7ba2 100644 --- a/src/components/Additional.tsx +++ b/src/components/Additional.tsx @@ -49,12 +49,12 @@ export function Additional(props: { additional?: AdditionalType | null }) { .join(' ') url = additional.ugc.jump_url additionalContent = ( - + - + {additional.ugc.title} {text ? {text} : null} @@ -72,12 +72,12 @@ export function Additional(props: { additional?: AdditionalType | null }) { .join(' ') url = additional.common.jump_url additionalContent = ( - + - + {additional.common.title} {text ? ( @@ -166,7 +166,7 @@ export function Additional(props: { additional?: AdditionalType | null }) { return ( + className={`mt-5 flex-1 border-l py-1 pl-2 ${colors.gray6.border}`}> {additionalContent} ) diff --git a/src/components/Comment.tsx b/src/components/Comment.tsx index 856fc49..46ba111 100644 --- a/src/components/Comment.tsx +++ b/src/components/Comment.tsx @@ -82,7 +82,7 @@ function CommentText(props: { ) } @@ -233,7 +233,7 @@ function CommentBlock(props: { style={props.style}> {comment.replies?.length ? ( - + {comment.replies.map((reply) => { return })} diff --git a/src/components/CommentList.tsx b/src/components/CommentList.tsx index 342b650..10cebc0 100644 --- a/src/components/CommentList.tsx +++ b/src/components/CommentList.tsx @@ -17,7 +17,7 @@ function Loading() { .fill(0) .map((_, i) => { return ( - + {i % 2 ? ( @@ -63,15 +63,15 @@ export default function CommentList( ListHeaderComponent={ {props.children} - - + + - + {allCount ? `${allCount}条评论` : isLoading @@ -79,7 +79,7 @@ export default function CommentList( : '暂无评论'} - + {props.dividerRight} ) : ( - + {error ? '评论已关闭或加载失败' : '暂无评论'} ) } ListFooterComponent={ comments?.length ? ( - + {isValidating ? '正在加载...' : '暂无更多'} ) : null diff --git a/src/components/ErrorFallback.tsx b/src/components/ErrorFallback.tsx index 25a2267..54310f2 100644 --- a/src/components/ErrorFallback.tsx +++ b/src/components/ErrorFallback.tsx @@ -22,7 +22,7 @@ export default function ErrorFallback(props: { message?: string }) { 非常抱歉,应用发生了未知错误 {'\n\n'} - {props.message || 'N/A'} + {props.message || 'N/A'} {'\n\n'} 我们会处理这个错误,感谢您的理解和支持 {'\n\n'} diff --git a/src/components/ImagesView.tsx b/src/components/ImagesView.tsx index 30bbc9c..5133d19 100644 --- a/src/components/ImagesView.tsx +++ b/src/components/ImagesView.tsx @@ -47,21 +47,21 @@ function ImagesView() { fullScreen overlayStyle={tw('p-0 m-0')} onBackdropPress={onClose}> - - - + + + {current + 1} / {images.length} - + ✕ @@ -99,14 +99,14 @@ function ImagesView() { imageView = ( ) } return ( + className="flex-1 items-center justify-center bg-black"> {imageView} ) diff --git a/src/components/ReplyList.tsx b/src/components/ReplyList.tsx index 030e9bb..2636f29 100644 --- a/src/components/ReplyList.tsx +++ b/src/components/ReplyList.tsx @@ -39,7 +39,7 @@ export default function ReplyList() { }} isVisible={!!repliesInfo}> - + 评论详情 {typeof allCount === 'number' @@ -51,7 +51,7 @@ export default function ReplyList() { @@ -61,7 +61,7 @@ export default function ReplyList() { keyExtractor={(v) => `${v.id}@${v.root}`} renderItem={({ item }: { item: ReplyItemType }) => { return ( - + ) @@ -69,21 +69,21 @@ export default function ReplyList() { estimatedItemSize={30} ListHeaderComponent={ root ? ( - + ) : null } ListEmptyComponent={ isLoading ? ( - + ) : ( - + {error ? '评论已关闭或加载失败' : '暂无评论'} ) @@ -91,7 +91,7 @@ export default function ReplyList() { ListFooterComponent={ replies?.length ? ( + className={`${colors.gray6.text} mt-1 text-center text-xs`}> {isValidating ? '正在加载...' : '暂无更多'} ) : null diff --git a/src/components/RichTexts.tsx b/src/components/RichTexts.tsx index 1ddef70..70b5382 100644 --- a/src/components/RichTexts.tsx +++ b/src/components/RichTexts.tsx @@ -35,7 +35,7 @@ function RichTexts(props: { let key = 0 const fontSize = props.fontSize || 16 const Topic = props.topic ? ( - + , ) } else if (node.type === HandledRichTextType.RICH_TEXT_NODE_TYPE_TOPIC) { @@ -260,7 +260,7 @@ function RichTexts(props: { style={props.style}> {Topic} { setLines(evt.nativeEvent.lines.length) diff --git a/src/components/VideoItem.tsx b/src/components/VideoItem.tsx index 21a90a2..09c4a3c 100644 --- a/src/components/VideoItem.tsx +++ b/src/components/VideoItem.tsx @@ -81,34 +81,34 @@ function VideoListItem({ tag: video.tag, }) }} - className="flex-row min-h-28 px-2 py-2 mb-1"> - + className="mb-1 min-h-28 flex-row px-2 py-2"> + - + {typeof video.duration === 'string' ? parseDurationStr(video.duration) : parseDuration(video.duration)} - + {parseDate(video.date)} {isDefined(video.danmaku) ? ( - + {parseNumber(video.danmaku)}弹 ) : null} {'watchProgress' in video ? ( - + {video.watchProgress > 99 ? '已看完 ' @@ -119,7 +119,7 @@ function VideoListItem({ {extractTextWithEmTags(video.title, tw(colors.secondary.text))} @@ -133,7 +133,7 @@ function VideoListItem({ {video.name} {isDefined(video.play) ? ( - + - + - - + + 一款简单的B站浏览App