chore: Release v0.3.7 (#2859)
This commit is contained in:
@@ -12,9 +12,12 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
profile:
|
||||
type: string
|
||||
type: choice
|
||||
default: preview
|
||||
description: "Build profile, preview or production"
|
||||
options:
|
||||
- preview
|
||||
- production
|
||||
description: "Build profile"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -54,4 +57,10 @@ jobs:
|
||||
with:
|
||||
name: app-ios
|
||||
path: apps/mobile/build.ipa
|
||||
retention-days: 5
|
||||
retention-days: 90
|
||||
|
||||
- name: Submit to App Store
|
||||
if: github.event.inputs.profile == 'production'
|
||||
run: |
|
||||
cd apps/mobile
|
||||
eas submit --platform ios --path build.ipa --non-interactive
|
||||
|
||||
+19
-3
@@ -1,6 +1,6 @@
|
||||
# CHANGELOG
|
||||
|
||||
## [0.3.6](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.6) (2025-02-20)
|
||||
## [0.3.7](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.7) (2025-02-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
@@ -224,6 +224,8 @@
|
||||
* lint ([dafaf0a](https://github.com/RSSNext/follow/commit/dafaf0a97d40a6df659a7869d7c11f5cf529dfe7))
|
||||
* list form width ([6487be1](https://github.com/RSSNext/follow/commit/6487be1c9f8c085f6722595d59f85d1176c503c5))
|
||||
* list unread dot position ([dad33a1](https://github.com/RSSNext/follow/commit/dad33a12db4b270801da6b8c621b3049e6672c27))
|
||||
* **listEntryCover:** fix the cover mistakely render as audio ([#2813](https://github.com/RSSNext/follow/issues/2813)) ([e73eb54](https://github.com/RSSNext/follow/commit/e73eb540ed8f9325392ba6ba5829350ee27ed31e))
|
||||
* lists fetch ([6fe8dc9](https://github.com/RSSNext/follow/commit/6fe8dc910f65e096343ad732bd19fef34f18b01e))
|
||||
* **lists:** fix duplicate addition issue in manage feeds functionality ([#2544](https://github.com/RSSNext/follow/issues/2544)) ([d77ed3c](https://github.com/RSSNext/follow/commit/d77ed3cb37424e97490bbf4883f9326acc446d54))
|
||||
* load dynamic render assets ([3499535](https://github.com/RSSNext/follow/commit/3499535b4091e3a82734c416528b0766e70f0b63))
|
||||
* load instagram image fail ([f8fd58f](https://github.com/RSSNext/follow/commit/f8fd58f78ec11bc221eb9190ac7b6a66dd858f9c)), closes [#1539](https://github.com/RSSNext/follow/issues/1539)
|
||||
@@ -249,10 +251,14 @@
|
||||
* missing translation in pitcure masonry ([902d681](https://github.com/RSSNext/follow/commit/902d68180d1cc872cbe4435efbcae108f0d732b5))
|
||||
* mobile need login modal ([0fb16f2](https://github.com/RSSNext/follow/commit/0fb16f2352e9776731522204b838be59f66127a4))
|
||||
* mobile pop back to entry list will refresh data ([3c18768](https://github.com/RSSNext/follow/commit/3c18768968aeb4635933ae616c52de55b6fad2ab))
|
||||
* **mobile:** auth redirect and 2fa support ([#2829](https://github.com/RSSNext/follow/issues/2829)) ([cc51d86](https://github.com/RSSNext/follow/commit/cc51d861c92fe5cd884210aaefecc80bad581257))
|
||||
* **mobile:** background color ([9f6934f](https://github.com/RSSNext/follow/commit/9f6934f844c995a1dcbb326123420e6ee9b05a96))
|
||||
* **mobile:** can not load native module ([#2791](https://github.com/RSSNext/follow/issues/2791)) ([f226de5](https://github.com/RSSNext/follow/commit/f226de53ab664c252e7d0806dbfdfe91dcd8135d))
|
||||
* **mobile:** context menu crash when released too quickly ([#2732](https://github.com/RSSNext/follow/issues/2732)) ([1327f56](https://github.com/RSSNext/follow/commit/1327f5671c61f901537193cfe2960b7189c0a5a6))
|
||||
* **mobile:** disable scroll-to-top for timeline view selector ([3b5fb5f](https://github.com/RSSNext/follow/commit/3b5fb5febeb4b49d7d2943a205af3c8e5f5c3b9d))
|
||||
* **mobile:** improve responsive design in CornerPlayer ([949a07e](https://github.com/RSSNext/follow/commit/949a07ed0e3cb8b8ea582ebd926f143da7386736))
|
||||
* **mobile:** remove shadow from PlayerTabBar ([79631bb](https://github.com/RSSNext/follow/commit/79631bbcbc1212a307678b04dbfff93dda793b03))
|
||||
* **mobile:** revert ref bind for nav scroll view ref ([#2856](https://github.com/RSSNext/follow/issues/2856)) ([8a0049d](https://github.com/RSSNext/follow/commit/8a0049dc1585c72d9e79fe1471c52fc8851a124a))
|
||||
* **mobile:** svg background transparent ([#2820](https://github.com/RSSNext/follow/issues/2820)) ([6b991d3](https://github.com/RSSNext/follow/commit/6b991d379e608e1686ce88022b7bb57d6de6d11d))
|
||||
* **mobile:** unread style not working, bring views back ([#2765](https://github.com/RSSNext/follow/issues/2765)) ([fad9f94](https://github.com/RSSNext/follow/commit/fad9f944d57d5739d6edfa7749d9802438f361c8))
|
||||
* **mobile:** update email login style ([9019e9b](https://github.com/RSSNext/follow/commit/9019e9bbc6ebcdcbd8a0f21844e04f1df17dd84a))
|
||||
@@ -262,6 +268,7 @@
|
||||
* modal bottom buttons align ([#1216](https://github.com/RSSNext/follow/issues/1216)) ([b97096d](https://github.com/RSSNext/follow/commit/b97096dbd06bb7687b6c1313de45d8e91dee25af))
|
||||
* modal close button overlaps the select content ([#1166](https://github.com/RSSNext/follow/issues/1166)) ([3c103ed](https://github.com/RSSNext/follow/commit/3c103ed15daeb1f57a001d615c047c303087ba46))
|
||||
* modal exiting transition type ([5bb0100](https://github.com/RSSNext/follow/commit/5bb01006ad04f8e5ed93076905b78b74ce293f79))
|
||||
* **modal:** adjust modal header drag and resize behavior ([38e8c6c](https://github.com/RSSNext/follow/commit/38e8c6c2f4517b550273f8f09cb136107d2bebf2))
|
||||
* **modal:** close button can not click on electron ([c544dfc](https://github.com/RSSNext/follow/commit/c544dfcc8d4613e8d4f6025dd8a60cf679881680))
|
||||
* **modal:** drawer modal layout symmetric padding ([7141e86](https://github.com/RSSNext/follow/commit/7141e869dfc9328e3eeeda909ea2ffc7e6dd0e34))
|
||||
* **modal:** fixed close modal button position ([78e9424](https://github.com/RSSNext/follow/commit/78e942473fff309e372708b56a59a9009d5bb0e9))
|
||||
@@ -539,6 +546,7 @@
|
||||
* basic masonry entry list and entry content view ([#2493](https://github.com/RSSNext/follow/issues/2493)) ([e569681](https://github.com/RSSNext/follow/commit/e569681198cabbfeb4c8133e421533c37b1fd96d))
|
||||
* bigger font size in mobile ([3e9a92d](https://github.com/RSSNext/follow/commit/3e9a92d16a80139c851671748367f009a3af4de9))
|
||||
* bigger view selector ([973c0d2](https://github.com/RSSNext/follow/commit/973c0d214d13313372c4ced0c68ec3c85db4ef4b))
|
||||
* bring back lists in views ([aeaa29b](https://github.com/RSSNext/follow/commit/aeaa29b13b0466848d6b35d4a7da232834322888))
|
||||
* bring rehypeUrlToAnchor back ([6f0cc4d](https://github.com/RSSNext/follow/commit/6f0cc4d566c9f2f552f0fedf1a8e570a817e0f56)), closes [#1373](https://github.com/RSSNext/follow/issues/1373)
|
||||
* checkLanguage utils ([225e470](https://github.com/RSSNext/follow/commit/225e470db84649bd23657d82b3c6a71b94cccc5f))
|
||||
* collection panel active button status ([a1676fc](https://github.com/RSSNext/follow/commit/a1676fc535430c3bd4c614a5261e3152e1bf2561))
|
||||
@@ -637,11 +645,14 @@
|
||||
* **mobile:** Add image headers for cross-origin image loading ([053517d](https://github.com/RSSNext/follow/commit/053517db633103fb0a7f8796684181f9f3d6688b))
|
||||
* **mobile:** add loading indicator for infinite scroll in entry list ([22ac1be](https://github.com/RSSNext/follow/commit/22ac1be1a5a82a1453ef200b25c49ce4f6d93ca6))
|
||||
* **mobile:** Add media preview accessories and no-media rendering support ([9113c0a](https://github.com/RSSNext/follow/commit/9113c0a2e53bdbc4c9b4e83f719198a83f6b7601))
|
||||
* **mobile:** add native iOS toast module with SPIndicator ([8dbb634](https://github.com/RSSNext/follow/commit/8dbb6343fb299a7b1e15288405d45bfb72dec09b))
|
||||
* **mobile:** add PortalProvider to EntryContentWebView and adjust ActivityIndicator ([713dc47](https://github.com/RSSNext/follow/commit/713dc47531f3e5fb4247cc9dc278ae2c6de6cdc6))
|
||||
* **mobile:** add preview image component with advanced gesture handling ([1d4e37e](https://github.com/RSSNext/follow/commit/1d4e37e35a36eaeacbea70723464a3759131cd2b))
|
||||
* **mobile:** add reader inline style rendering option ([160eb14](https://github.com/RSSNext/follow/commit/160eb14258f24afe08f5103b237e4391c09bd93e))
|
||||
* **mobile:** add reusable MediaCarousel component ([48461f1](https://github.com/RSSNext/follow/commit/48461f15e68f584372e75d41c51775d86300518f))
|
||||
* **mobile:** add social entry list component ([#2733](https://github.com/RSSNext/follow/issues/2733)) ([903b989](https://github.com/RSSNext/follow/commit/903b98953aa74fe472bf3793c6a4b8edbfe519bf))
|
||||
* **mobile:** add triggerAsChild prop to EntryReadHistory component ([#2773](https://github.com/RSSNext/follow/issues/2773)) ([c7b1513](https://github.com/RSSNext/follow/commit/c7b151394a2e3cfb73bb1c16b7f40d8256e65718))
|
||||
* **mobile:** audio player ([#2801](https://github.com/RSSNext/follow/issues/2801)) ([8e2dfe9](https://github.com/RSSNext/follow/commit/8e2dfe99c87d868e67f466ad2ed1687e95bf6882))
|
||||
* **mobile:** auto mark as read when scrolling ([#2781](https://github.com/RSSNext/follow/issues/2781)) ([c8f580c](https://github.com/RSSNext/follow/commit/c8f580c0a1f7228ebf390f293691213b762d4499))
|
||||
* **mobile:** deletion button ([79b4703](https://github.com/RSSNext/follow/commit/79b47030260e7667e23e725b2337922139b6ae6b))
|
||||
* **mobile:** enhance CORS handling and image loading in WebView ([ad06db9](https://github.com/RSSNext/follow/commit/ad06db9744f3b001a8bf0d004a1492e656091ab1))
|
||||
@@ -649,17 +660,21 @@
|
||||
* **mobile:** Enhance grid view with dynamic media rendering and improved item handling ([27818f6](https://github.com/RSSNext/follow/commit/27818f6559bfb5b95bf529e38814eb6b83ad0d29))
|
||||
* **mobile:** enhance HTML renderer with image rendering and blurhash support ([b534667](https://github.com/RSSNext/follow/commit/b534667c059c7b60edaa9c0dfe6e2bfebe85fc7e))
|
||||
* **mobile:** enhance iOS image preview with SDWebImage and improved QuickLook handling ([0011861](https://github.com/RSSNext/follow/commit/0011861e3f9155ba4c28864f9bd7f452fdc2942e))
|
||||
* **mobile:** enhance player UI with floating tab bar and control improvements ([577f07f](https://github.com/RSSNext/follow/commit/577f07f85e3e7556cae5652a24317a8842c92316))
|
||||
* **mobile:** Enhance PreviewImage and EntryGridItem with interactive preview and animation ([bdff613](https://github.com/RSSNext/follow/commit/bdff6138676fe9c8c185861abfd03fa74f2f29c9))
|
||||
* **mobile:** enhance tab bar icon and label animations ([9c720a7](https://github.com/RSSNext/follow/commit/9c720a7d8c918234c9aef52405aca230b401c90e))
|
||||
* **mobile:** entry list by feed or category; pagination ([#2717](https://github.com/RSSNext/follow/issues/2717)) ([a63bb82](https://github.com/RSSNext/follow/commit/a63bb82935336a7f8efb5bc7e75cc2f6463d0a3c))
|
||||
* **mobile:** implement collection entry list ([#2787](https://github.com/RSSNext/follow/issues/2787)) ([c251aea](https://github.com/RSSNext/follow/commit/c251aeaf65c6a13668cbe984dedc49012a86eb98))
|
||||
* **mobile:** Implement global image preview with advanced gestures ([113c404](https://github.com/RSSNext/follow/commit/113c4045b79a5b5d81d644f68222063b006a1f5f))
|
||||
* **mobile:** implement native image preview with QuickLook on iOS ([975285e](https://github.com/RSSNext/follow/commit/975285ec30599fe297108c5aa3e8a163e9a27d14))
|
||||
* **mobile:** implement scroll-to-top functionality ([#2831](https://github.com/RSSNext/follow/issues/2831)) ([9b3439f](https://github.com/RSSNext/follow/commit/9b3439f71162824df7732f585a16dfc2e349ebdd))
|
||||
* **mobile:** improve entry list and detail view with UI refinements ([a527987](https://github.com/RSSNext/follow/commit/a52798729ec378b71367d6b90c6e65687cbe75b3))
|
||||
* **mobile:** introduce expo image ([9ea93b8](https://github.com/RSSNext/follow/commit/9ea93b80238f47788e0f984f03faf3c9a3434a81))
|
||||
* **mobile:** load archive entries ([#2725](https://github.com/RSSNext/follow/issues/2725)) ([d8a796d](https://github.com/RSSNext/follow/commit/d8a796d3ab4ca79496aef6e6597d2f9108d40058))
|
||||
* **mobile:** prefetch entry content ([03a1438](https://github.com/RSSNext/follow/commit/03a1438133ee809d15a757b300490de4c62f63a3))
|
||||
* **mobile:** refactor EntryList to use pager view ([#2802](https://github.com/RSSNext/follow/issues/2802)) ([714a933](https://github.com/RSSNext/follow/commit/714a93336118c381ca7046c13f79e2e700ee9cfe))
|
||||
* **mobile:** refresh control for entry list ([#2723](https://github.com/RSSNext/follow/issues/2723)) ([c01984d](https://github.com/RSSNext/follow/commit/c01984d50f0488b74893180a2a43ad59ba3ec36a))
|
||||
* **mobile:** render as read ([#2835](https://github.com/RSSNext/follow/issues/2835)) ([c0afb39](https://github.com/RSSNext/follow/commit/c0afb39788f72ef29bd814d97752fe438c3027e3))
|
||||
* **mobile:** unread state for entry ([#2730](https://github.com/RSSNext/follow/issues/2730)) ([ddd6a2c](https://github.com/RSSNext/follow/commit/ddd6a2c8cdf8fc6a06acd52345eb8c5b157c2e12))
|
||||
* **modal:** enhance Follow modal with improved navigation and loading state ([cf31c0f](https://github.com/RSSNext/follow/commit/cf31c0f5fae3fd6dac1e1e571e870ea57e05ed0b))
|
||||
* move feed to new category in context menu ([#2072](https://github.com/RSSNext/follow/issues/2072)) ([d684e14](https://github.com/RSSNext/follow/commit/d684e14056581744ac78ca697fa5ca059294245e))
|
||||
@@ -676,6 +691,7 @@
|
||||
* optimize translation display ([3f01ce8](https://github.com/RSSNext/follow/commit/3f01ce87fae9e46fcbb330c24732c4733b9f7f59))
|
||||
* optimize translation display ([75b9135](https://github.com/RSSNext/follow/commit/75b9135a02fb6e94abb5c0670c9f12f354a88f0e))
|
||||
* optimize unread indicator styles ([f44b1a5](https://github.com/RSSNext/follow/commit/f44b1a5604af9ee1949f35af814dcda04af691d2))
|
||||
* optional daily ([d07ec23](https://github.com/RSSNext/follow/commit/d07ec236e5c90165638ab341623400f8f661d49d))
|
||||
* **podcast:** add PodcastButton component to mobile float bar ([#2514](https://github.com/RSSNext/follow/issues/2514)) ([037791e](https://github.com/RSSNext/follow/commit/037791eae13bf0b9322eba332a852f73cd737bd0))
|
||||
* prefer origin addresses for content images ([d4d4345](https://github.com/RSSNext/follow/commit/d4d43451dec839b64239e1835b2ac1a1aa2478be))
|
||||
* **profile:** enhance email management and avatar fallback for better mobile support ([#2776](https://github.com/RSSNext/follow/issues/2776)) ([4295dec](https://github.com/RSSNext/follow/commit/4295decfa9869599386499e405e2e30ba2796a80))
|
||||
@@ -927,8 +943,8 @@
|
||||
* ci ([8852a81](https://github.com/RSSNext/follow/commit/8852a81d4cfe80a0704bcf52220c39e9ccbe98de))
|
||||
* ci and tootip portal ([3729917](https://github.com/RSSNext/follow/commit/37299173c8fcaf88d44b1a54baf7ddc03aa20ca6))
|
||||
* ci env `NODE_OPTIONS` max-old-space-size ([b4f9b1b](https://github.com/RSSNext/follow/commit/b4f9b1b8ea326b1613ca291ed5bbcd932c5e837a))
|
||||
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
|
||||
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
|
||||
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b))
|
||||
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9))
|
||||
* **ci:** fetch all depth ([a504a12](https://github.com/RSSNext/follow/commit/a504a127bca93a6675b3ff02bcea0b1eca6e9707))
|
||||
* **ci:** nightly build ([a4ce7b1](https://github.com/RSSNext/follow/commit/a4ce7b16f476b8d72a0b1761709ec1ceba591242))
|
||||
* **ci:** nightly linux build ([702b1d9](https://github.com/RSSNext/follow/commit/702b1d976d52c49647d0433f2dd162c034d0abb4))
|
||||
|
||||
@@ -59,6 +59,13 @@ function bootstrap() {
|
||||
}
|
||||
})
|
||||
|
||||
app.on("activate", () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
mainWindow = getMainWindowOrCreate()
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
@@ -158,13 +165,6 @@ function bootstrap() {
|
||||
},
|
||||
)
|
||||
|
||||
app.on("activate", () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
mainWindow = getMainWindowOrCreate()
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
app.on("open-url", (_, url) => {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
|
||||
@@ -41,6 +41,7 @@ export function createWindow(
|
||||
show: false,
|
||||
resizable: configs?.resizable ?? true,
|
||||
autoHideMenuBar: true,
|
||||
alwaysOnTop: false,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||
sandbox: false,
|
||||
|
||||
@@ -12,6 +12,7 @@ module.exports = function (api) {
|
||||
"es-toolkit/compat": "../../node_modules/es-toolkit/dist/compat/index.js",
|
||||
"es-toolkit": "../../node_modules/es-toolkit/dist/index.js",
|
||||
"better-auth/react": "../../node_modules/better-auth/dist/react.js",
|
||||
"better-auth/client/plugins": "../../node_modules/better-auth/dist/client/plugins.js",
|
||||
"@better-auth/expo/client": "../../node_modules/@better-auth/expo/dist/client.js",
|
||||
},
|
||||
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"platforms": ["apple", "android"],
|
||||
"apple": {
|
||||
"modules": ["SharedWebViewModule", "HelperModule"]
|
||||
"modules": ["SharedWebViewModule", "HelperModule", "ToasterModule"]
|
||||
},
|
||||
"android": {
|
||||
"modules": []
|
||||
|
||||
@@ -21,6 +21,7 @@ Pod::Spec.new do |s|
|
||||
s.dependency 'ExpoModulesCore'
|
||||
s.dependency 'SnapKit', '~> 5.7.0'
|
||||
s.dependency 'SDWebImage', '~> 5.0'
|
||||
s.dependency 'SPIndicator', '~> 1.0.0'
|
||||
# Swift/Objective-C compatibility
|
||||
s.pod_target_xcconfig = {
|
||||
'DEFINES_MODULE' => 'YES',
|
||||
|
||||
@@ -56,7 +56,8 @@ class ModalWebViewController: UIViewController {
|
||||
private func setupWebView() {
|
||||
view.addSubview(webView)
|
||||
webView.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview()
|
||||
make.top.equalTo(view.safeAreaLayoutGuide)
|
||||
make.left.right.bottom.equalToSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ToasterModule.swift
|
||||
//
|
||||
// Created by Innei on 2025/2/21.
|
||||
//
|
||||
|
||||
import ExpoModulesCore
|
||||
import SPIndicator
|
||||
|
||||
enum ToastType: String, Enumerable {
|
||||
case error
|
||||
case info
|
||||
case warn
|
||||
case success
|
||||
}
|
||||
|
||||
extension ToastType {
|
||||
func type() -> SPIndicatorIconPreset {
|
||||
switch self
|
||||
{
|
||||
case .error: .error
|
||||
case .warn: .custom(UIImage(systemName: "exclamationmark.triangle")!.withTintColor(.orange))
|
||||
case .info: .custom(UIImage(systemName: "info.circle")!.withTintColor(.blue))
|
||||
case .success: .done
|
||||
}
|
||||
}
|
||||
|
||||
func haptic() -> SPIndicatorHaptic {
|
||||
switch self {
|
||||
case .error: .error
|
||||
case .info: .success
|
||||
case .warn: .warning
|
||||
case .success: .error
|
||||
}
|
||||
}
|
||||
}
|
||||
struct ToastOptions: Record {
|
||||
@Field
|
||||
var message: String?
|
||||
@Field
|
||||
var type: ToastType = .info
|
||||
|
||||
@Field
|
||||
var duration: Double = 1.5
|
||||
@Field
|
||||
var title: String
|
||||
|
||||
}
|
||||
|
||||
public class ToasterModule: Module {
|
||||
public func definition() -> ModuleDefinition {
|
||||
Name("Toaster")
|
||||
|
||||
Function("toast") { (value: ToastOptions) in
|
||||
|
||||
DispatchQueue.main.sync {
|
||||
let indicatorView = SPIndicatorView(
|
||||
title: value.title, message: value.message, preset: value.type.type())
|
||||
indicatorView.present(duration: value.duration, haptic: value.type.haptic())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import { jotaiStore } from "@follow/utils"
|
||||
import type { FlashList } from "@shopify/flash-list"
|
||||
import { atom } from "jotai"
|
||||
import { useEffect, useRef } from "react"
|
||||
|
||||
const defaultScrollToTop = { scrollToTop: () => {} }
|
||||
const scrollToTopAtom = atom<{ scrollToTop: () => void }>(defaultScrollToTop)
|
||||
|
||||
export const scrollToTop = () => {
|
||||
const { scrollToTop } = jotaiStore.get(scrollToTopAtom)
|
||||
scrollToTop()
|
||||
}
|
||||
|
||||
export const useScrollToTopRef = <T extends FlashList<unknown>>(enabled = true) => {
|
||||
const ref = useRef<T>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) return
|
||||
const scrollToTop = () => {
|
||||
ref.current?.scrollToOffset({ animated: true, offset: 0 })
|
||||
}
|
||||
jotaiStore.set(scrollToTopAtom, { scrollToTop })
|
||||
return () => {
|
||||
if (jotaiStore.get(scrollToTopAtom).scrollToTop !== scrollToTop) return
|
||||
jotaiStore.set(scrollToTopAtom, defaultScrollToTop)
|
||||
}
|
||||
}, [enabled, ref])
|
||||
return ref
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescri
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
||||
import { useColor } from "react-native-uikit-colors"
|
||||
|
||||
import { scrollToTop } from "@/src/atoms/scroll-to-top"
|
||||
import {
|
||||
AttachNavigationScrollViewContext,
|
||||
SetAttachNavigationScrollViewContext,
|
||||
@@ -175,13 +174,9 @@ export const NavigationBlurEffectHeader = ({
|
||||
<View pointerEvents="box-none" style={[StyleSheet.absoluteFill]}>
|
||||
{options.headerBackground?.()}
|
||||
</View>
|
||||
<TouchableOpacity onPress={scrollToTop}>
|
||||
<Header
|
||||
title={options.title ?? ""}
|
||||
{...options}
|
||||
headerBackground={() => null}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
|
||||
<Header title={options.title ?? ""} {...options} headerBackground={() => null} />
|
||||
|
||||
{hideableBottom}
|
||||
</Animated.View>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { ScrollView, View } from "react-native"
|
||||
import Animated, {
|
||||
interpolateColor,
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
withSpring,
|
||||
} from "react-native-reanimated"
|
||||
|
||||
import type { MediaModel } from "@/src/database/schemas/types"
|
||||
|
||||
import { ImageContextMenu } from "../image/ImageContextMenu"
|
||||
import type { PreviewImageProps } from "../image/PreviewImage"
|
||||
import { PreviewImage } from "../image/PreviewImage"
|
||||
|
||||
export const MediaCarousel = ({
|
||||
media,
|
||||
onPreview,
|
||||
aspectRatio,
|
||||
Accessory,
|
||||
AccessoryProps,
|
||||
}: {
|
||||
media: MediaModel[]
|
||||
onPreview: () => void
|
||||
aspectRatio: number
|
||||
} & Pick<PreviewImageProps, "Accessory" | "AccessoryProps">) => {
|
||||
const [containerWidth, setContainerWidth] = useState(0)
|
||||
const hasMany = media.length > 1
|
||||
|
||||
// const activeIndex = useSharedValue(0)
|
||||
const [activeIndex, setActiveIndex] = useState(0)
|
||||
|
||||
return (
|
||||
<View
|
||||
onLayout={(e) => {
|
||||
setContainerWidth(e.nativeEvent.layout.width)
|
||||
}}
|
||||
>
|
||||
<ScrollView
|
||||
onScroll={(e) => {
|
||||
setActiveIndex(Math.round(e.nativeEvent.contentOffset.x / containerWidth))
|
||||
}}
|
||||
scrollEventThrottle={16}
|
||||
scrollEnabled={hasMany}
|
||||
horizontal
|
||||
showsHorizontalScrollIndicator={false}
|
||||
pagingEnabled
|
||||
className="flex-1"
|
||||
contentContainerClassName="flex-row"
|
||||
style={{ aspectRatio }}
|
||||
>
|
||||
{media.map((m, index) => {
|
||||
if (m.type === "photo") {
|
||||
return (
|
||||
<View key={index} className="relative" style={{ width: containerWidth }}>
|
||||
<ImageContextMenu imageUrl={m.url}>
|
||||
<PreviewImage
|
||||
onPreview={onPreview}
|
||||
imageUrl={m.url}
|
||||
aspectRatio={m.width && m.height ? m.width / m.height : 1}
|
||||
Accessory={Accessory}
|
||||
AccessoryProps={AccessoryProps}
|
||||
/>
|
||||
</ImageContextMenu>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<PreviewImage
|
||||
key={index}
|
||||
onPreview={() => {
|
||||
// open player
|
||||
}}
|
||||
imageUrl={m.url}
|
||||
aspectRatio={m.width && m.height ? m.width / m.height : 1}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</ScrollView>
|
||||
{/* Indicators */}
|
||||
{hasMany && (
|
||||
<View className="absolute inset-x-0 bottom-0 flex-row items-center justify-center gap-1">
|
||||
{media.map((_, index) => (
|
||||
<Indicator key={index} index={index} activeIndex={activeIndex} />
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const Indicator = ({ index, activeIndex }: { index: number; activeIndex: number }) => {
|
||||
const activeValue = useSharedValue(0)
|
||||
useEffect(() => {
|
||||
activeValue.value = withSpring(index === activeIndex ? 1 : 0)
|
||||
}, [activeIndex, activeValue, index])
|
||||
const animatedStyle = useAnimatedStyle(() => ({
|
||||
backgroundColor: interpolateColor(
|
||||
activeValue.value,
|
||||
[0, 1],
|
||||
["rgba(0, 0, 0, 0.5)", "rgba(255, 255, 255, 0.9)"],
|
||||
),
|
||||
}))
|
||||
return <Animated.View className="h-1 flex-1 rounded-sm" style={animatedStyle} />
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { Pressable, View } from "react-native"
|
||||
|
||||
import { usePreviewImage } from "./PreviewPageProvider"
|
||||
|
||||
interface PreviewImageProps {
|
||||
export interface PreviewImageProps {
|
||||
imageUrl: string
|
||||
blurhash?: string | undefined
|
||||
aspectRatio: number
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { BottomTabBarProps } from "@react-navigation/bottom-tabs"
|
||||
import { Tabs } from "expo-router"
|
||||
import type { ForwardRefExoticComponent } from "react"
|
||||
import { forwardRef, useMemo, useRef, useState } from "react"
|
||||
import type { FlatList, ScrollView } from "react-native"
|
||||
import type { ScrollView } from "react-native"
|
||||
import { useSharedValue } from "react-native-reanimated"
|
||||
|
||||
import { BottomTabHeightProvider } from "./BottomTabHeightProvider"
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
BottomTabBarVisibleContext,
|
||||
SetBottomTabBarVisibleContext,
|
||||
} from "./contexts/BottomTabBarVisibleContext"
|
||||
import { useNavigationScrollToTop } from "./hooks"
|
||||
import { Tabbar } from "./Tabbar"
|
||||
|
||||
type ExtractReactForwardRefExoticComponent<T> =
|
||||
@@ -29,6 +30,7 @@ export const BottomTabs: ForwardRefExoticComponent<
|
||||
useState<React.RefObject<ScrollView> | null>(null)
|
||||
|
||||
const currentTarget = useRef<string | undefined>(undefined)
|
||||
const scrollToTop = useNavigationScrollToTop(attachNavigationScrollViewRef)
|
||||
return (
|
||||
<AttachNavigationScrollViewContext.Provider value={attachNavigationScrollViewRef}>
|
||||
<SetAttachNavigationScrollViewContext.Provider value={setAttachNavigationScrollViewRef}>
|
||||
@@ -47,24 +49,7 @@ export const BottomTabs: ForwardRefExoticComponent<
|
||||
}
|
||||
|
||||
if (currentTarget.current === e.target) {
|
||||
const $scroller = attachNavigationScrollViewRef?.current as any
|
||||
|
||||
if ("scrollTo" in $scroller) {
|
||||
;($scroller as ScrollView).scrollTo({
|
||||
y: 0,
|
||||
animated: true,
|
||||
})
|
||||
} else if ("scrollToIndex" in $scroller) {
|
||||
;($scroller as FlatList<any>).scrollToIndex({
|
||||
index: 0,
|
||||
animated: true,
|
||||
})
|
||||
} else if ("scrollToOffset" in $scroller) {
|
||||
;($scroller as FlatList<any>).scrollToOffset({
|
||||
offset: 0,
|
||||
animated: true,
|
||||
})
|
||||
}
|
||||
scrollToTop()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"
|
||||
|
||||
import { SetBottomTabBarHeightContext } from "@/src/components/ui/tabbar/contexts/BottomTabBarHeightContext"
|
||||
import { quickSpringPreset, softSpringPreset } from "@/src/constants/spring"
|
||||
import { PlayerTabBar } from "@/src/modules/player/PlayerTabBar"
|
||||
import { accentColor, useColor } from "@/src/theme/colors"
|
||||
|
||||
import { ThemedBlurView } from "../../common/ThemedBlurView"
|
||||
@@ -42,7 +43,7 @@ export const Tabbar: FC<BottomTabBarProps> = (props) => {
|
||||
return (
|
||||
<Animated.View
|
||||
accessibilityRole="tablist"
|
||||
className="absolute inset-x-0 bottom-0 z-10 flex-row py-[7]"
|
||||
className="absolute inset-x-0 bottom-0 z-10 py-[7]"
|
||||
style={{
|
||||
paddingBottom: insets.bottom,
|
||||
transform: [{ translateY }],
|
||||
@@ -52,6 +53,7 @@ export const Tabbar: FC<BottomTabBarProps> = (props) => {
|
||||
}}
|
||||
>
|
||||
<TabBarBackground />
|
||||
<PlayerTabBar />
|
||||
<Grid columns={routes.length} gap={10}>
|
||||
{routes.map((route, index) => {
|
||||
const focused = index === state.index
|
||||
|
||||
@@ -1,8 +1,38 @@
|
||||
import { useContext } from "react"
|
||||
import { useCallback, useContext } from "react"
|
||||
import type { FlatList, ScrollView } from "react-native"
|
||||
|
||||
import { AttachNavigationScrollViewContext } from "./contexts/AttachNavigationScrollViewContext"
|
||||
import { BottomTabBarHeightContext } from "./contexts/BottomTabBarHeightContext"
|
||||
|
||||
export const useBottomTabBarHeight = () => {
|
||||
const height = useContext(BottomTabBarHeightContext)
|
||||
return height
|
||||
}
|
||||
|
||||
export const useNavigationScrollToTop = (
|
||||
overrideScrollerRef?: React.RefObject<ScrollView> | React.RefObject<FlatList<any>> | null,
|
||||
) => {
|
||||
const attachNavigationScrollViewRef = useContext(AttachNavigationScrollViewContext)
|
||||
return useCallback(() => {
|
||||
const $scroller = overrideScrollerRef?.current ?? attachNavigationScrollViewRef?.current
|
||||
if (!$scroller) return
|
||||
|
||||
if ("scrollTo" in $scroller) {
|
||||
;($scroller as ScrollView).scrollTo({
|
||||
y: 0,
|
||||
animated: true,
|
||||
})
|
||||
} else if ("scrollToIndex" in $scroller) {
|
||||
;($scroller as FlatList<any>).scrollToIndex({
|
||||
index: 0,
|
||||
animated: true,
|
||||
})
|
||||
} else if ("scrollToOffset" in $scroller) {
|
||||
;($scroller as FlatList<any>).scrollToOffset({
|
||||
offset: 0,
|
||||
animated: true,
|
||||
})
|
||||
}
|
||||
return
|
||||
}, [attachNavigationScrollViewRef, overrideScrollerRef])
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable no-console */
|
||||
import type { AppType } from "@follow/shared"
|
||||
import { router } from "expo-router"
|
||||
import { FetchError, ofetch } from "ofetch"
|
||||
|
||||
import { userActions } from "../store/user/store"
|
||||
import { getCookie } from "./auth"
|
||||
import { getApiUrl } from "./env"
|
||||
|
||||
@@ -40,7 +40,7 @@ export const apiFetch = ofetch.create({
|
||||
console.log(`<--- [Error] ${response.status} ${options.method} ${request as string}`)
|
||||
}
|
||||
if (response.status === 401) {
|
||||
router.replace("/login")
|
||||
userActions.removeCurrentUser()
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { expoClient } from "@better-auth/expo/client"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { twoFactorClient } from "better-auth/client/plugins"
|
||||
import { createAuthClient } from "better-auth/react"
|
||||
import type * as better_call from "better-call"
|
||||
import * as SecureStore from "expo-secure-store"
|
||||
@@ -15,6 +16,7 @@ export const sessionTokenKey = "__Secure-better-auth.session_token"
|
||||
const authClient = createAuthClient({
|
||||
baseURL: `${getApiUrl()}/better-auth`,
|
||||
plugins: [
|
||||
twoFactorClient(),
|
||||
{
|
||||
id: "getProviders",
|
||||
$InferServerPlugin: {} as (typeof authPlugins)[0],
|
||||
@@ -36,7 +38,7 @@ const authClient = createAuthClient({
|
||||
})
|
||||
|
||||
// @keep-sorted
|
||||
export const { getCookie, getProviders, signIn, signOut, useSession } = authClient
|
||||
export const { getCookie, getProviders, signIn, signOut, twoFactor, useSession } = authClient
|
||||
|
||||
export interface AuthProvider {
|
||||
name: string
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { requireNativeModule } from "expo"
|
||||
import { Platform } from "react-native"
|
||||
|
||||
import { ToastManager } from "../components/ui/toast/manager"
|
||||
import type { ToastProps } from "../components/ui/toast/types"
|
||||
|
||||
@@ -11,11 +14,32 @@ type Toast = {
|
||||
success: (message: string, options?: CommandToastOptions) => void
|
||||
info: (message: string, options?: CommandToastOptions) => void
|
||||
}
|
||||
|
||||
interface NativeToasterOptions {
|
||||
title: string
|
||||
message: string
|
||||
type: "error" | "success" | "info" | "warn"
|
||||
/**
|
||||
* seconds
|
||||
*/
|
||||
duration?: number
|
||||
}
|
||||
export const toast = {
|
||||
show: toastInstance.show.bind(toastInstance),
|
||||
} as Toast
|
||||
;(["error", "success", "info"] as const).forEach((type) => {
|
||||
toast[type] = (message: string, options: CommandToastOptions = {}) => {
|
||||
if (Platform.OS === "ios") {
|
||||
const NativeToaster = requireNativeModule("Toaster")
|
||||
NativeToaster.toast({
|
||||
title: "",
|
||||
message,
|
||||
type,
|
||||
duration: options.duration ? options.duration / 1000 : 1.5,
|
||||
} as NativeToasterOptions)
|
||||
return
|
||||
}
|
||||
|
||||
toastInstance.show({
|
||||
type,
|
||||
message,
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { useTypeScriptHappyCallback } from "@follow/hooks"
|
||||
import type { MasonryFlashListProps } from "@shopify/flash-list"
|
||||
import type { ElementRef } from "react"
|
||||
import { forwardRef, useCallback } from "react"
|
||||
import { forwardRef } from "react"
|
||||
import { ActivityIndicator, View } from "react-native"
|
||||
|
||||
import { useFetchEntriesControls } from "@/src/modules/screen/atoms"
|
||||
import { useEntryStore } from "@/src/store/entry/store"
|
||||
|
||||
import { TimelineSelectorMasonryList } from "../screen/TimelineSelectorList"
|
||||
import { useOnViewableItemsChanged } from "./hooks"
|
||||
import type { MasonryItem } from "./templates/EntryGridItem"
|
||||
// import type { MasonryItem } from "./templates/EntryGridItem"
|
||||
import { EntryGridItem } from "./templates/EntryGridItem"
|
||||
|
||||
export const EntryListContentGrid = forwardRef<
|
||||
@@ -19,60 +18,15 @@ export const EntryListContentGrid = forwardRef<
|
||||
} & Omit<MasonryFlashListProps<string>, "data" | "renderItem">
|
||||
>(({ entryIds, ...rest }, ref) => {
|
||||
const { fetchNextPage, refetch, isRefetching, hasNextPage } = useFetchEntriesControls()
|
||||
const onViewableItemsChanged = useOnViewableItemsChanged(
|
||||
(item) => (item.key as any).split("-")[0],
|
||||
)
|
||||
|
||||
const data = useEntryStore(
|
||||
useCallback(
|
||||
(state) => {
|
||||
const data: (MasonryItem & { index: number })[] = []
|
||||
|
||||
let index = 0
|
||||
for (const id of entryIds) {
|
||||
const entry = state.data[id]
|
||||
if (!entry) {
|
||||
continue
|
||||
}
|
||||
if (!entry.media) {
|
||||
continue
|
||||
}
|
||||
|
||||
for (const media of entry.media) {
|
||||
if (media.type === "photo") {
|
||||
data.push({
|
||||
id,
|
||||
index: index++,
|
||||
type: "image",
|
||||
imageUrl: media.url,
|
||||
blurhash: media.blurhash,
|
||||
width: media.width,
|
||||
height: media.height,
|
||||
})
|
||||
} else if (media.type === "video") {
|
||||
data.push({
|
||||
id,
|
||||
index: index++,
|
||||
type: "video",
|
||||
videoUrl: media.url,
|
||||
videoPreviewImageUrl: media.preview_image_url,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return data
|
||||
},
|
||||
[entryIds],
|
||||
),
|
||||
)
|
||||
const onViewableItemsChanged = useOnViewableItemsChanged()
|
||||
|
||||
return (
|
||||
<TimelineSelectorMasonryList
|
||||
ref={ref}
|
||||
isRefetching={isRefetching}
|
||||
data={data}
|
||||
renderItem={useTypeScriptHappyCallback(({ item }: { item: MasonryItem }) => {
|
||||
return <EntryGridItem {...item} />
|
||||
data={entryIds}
|
||||
renderItem={useTypeScriptHappyCallback(({ item }: { item: string }) => {
|
||||
return <EntryGridItem id={item} />
|
||||
}, [])}
|
||||
keyExtractor={defaultKeyExtractor}
|
||||
onViewableItemsChanged={onViewableItemsChanged}
|
||||
@@ -94,7 +48,6 @@ export const EntryListContentGrid = forwardRef<
|
||||
)
|
||||
})
|
||||
|
||||
const defaultKeyExtractor = (item: MasonryItem & { index: number }) => {
|
||||
const key = `${item.id}-${item.index}`
|
||||
return key
|
||||
const defaultKeyExtractor = (item: string) => {
|
||||
return item
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { FeedViewType } from "@follow/constants"
|
||||
import { createContext, useContext } from "react"
|
||||
|
||||
export const EntryListContextViewContext = createContext<FeedViewType>(null!)
|
||||
|
||||
export const useEntryListContextView = () => {
|
||||
return useContext(EntryListContextViewContext)
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
import { FeedViewType } from "@follow/constants"
|
||||
import type { FlashList } from "@shopify/flash-list"
|
||||
import type { RefObject } from "react"
|
||||
import { useContext, useEffect, useRef } from "react"
|
||||
import type { ScrollView } from "react-native"
|
||||
|
||||
import { useScrollToTopRef } from "@/src/atoms/scroll-to-top"
|
||||
import { SetAttachNavigationScrollViewContext } from "@/src/components/ui/tabbar/contexts/AttachNavigationScrollViewContext"
|
||||
import { EntryListContentGrid } from "@/src/modules/entry-list/EntryListContentGrid"
|
||||
|
||||
import { EntryListContentArticle } from "./EntryListContentArticle"
|
||||
import { EntryListContentSocial } from "./EntryListContentSocial"
|
||||
import { EntryListContextViewContext } from "./EntryListContext"
|
||||
|
||||
export function EntryListSelector({
|
||||
entryIds,
|
||||
@@ -15,7 +20,15 @@ export function EntryListSelector({
|
||||
viewId: FeedViewType
|
||||
active?: boolean
|
||||
}) {
|
||||
const ref = useScrollToTopRef(active)
|
||||
const setAttachNavigationScrollViewRef = useContext(SetAttachNavigationScrollViewContext)
|
||||
|
||||
const ref = useRef<FlashList<any>>(null)
|
||||
useEffect(() => {
|
||||
if (!active) return
|
||||
if (setAttachNavigationScrollViewRef) {
|
||||
setAttachNavigationScrollViewRef(ref as unknown as RefObject<ScrollView>)
|
||||
}
|
||||
}, [setAttachNavigationScrollViewRef, ref, active])
|
||||
|
||||
let ContentComponent: typeof EntryListContentSocial | typeof EntryListContentGrid =
|
||||
EntryListContentArticle
|
||||
@@ -35,5 +48,9 @@ export function EntryListSelector({
|
||||
}
|
||||
}
|
||||
|
||||
return <ContentComponent ref={ref} entryIds={entryIds} />
|
||||
return (
|
||||
<EntryListContextViewContext.Provider value={viewId}>
|
||||
<ContentComponent ref={ref} entryIds={entryIds} />
|
||||
</EntryListContextViewContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ export function useOnViewableItemsChanged(
|
||||
idExtractor: (item: ViewToken) => string = defaultIdExtractor,
|
||||
): (info: { viewableItems: ViewToken[]; changed: ViewToken[] }) => void {
|
||||
const markAsReadWhenScrolling = useGeneralSettingKey("scrollMarkUnread")
|
||||
const markAsReadWhenRendering = useGeneralSettingKey("renderMarkUnread")
|
||||
|
||||
const [stableIdExtractor] = useState(() => idExtractor)
|
||||
|
||||
@@ -23,7 +24,15 @@ export function useOnViewableItemsChanged(
|
||||
unreadSyncService.markEntryAsRead(stableIdExtractor(item))
|
||||
})
|
||||
}
|
||||
|
||||
if (markAsReadWhenRendering) {
|
||||
viewableItems
|
||||
.filter((item) => item.isViewable)
|
||||
.forEach((item) => {
|
||||
unreadSyncService.markEntryAsRead(stableIdExtractor(item))
|
||||
})
|
||||
}
|
||||
},
|
||||
[markAsReadWhenScrolling, stableIdExtractor],
|
||||
[markAsReadWhenRendering, markAsReadWhenScrolling, stableIdExtractor],
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import { FeedViewType } from "@follow/constants"
|
||||
import { useIsFocused } from "@react-navigation/native"
|
||||
import { useEffect, useMemo } from "react"
|
||||
import { Animated, StyleSheet } from "react-native"
|
||||
import PagerView from "react-native-pager-view"
|
||||
|
||||
import { views } from "@/src/constants/views"
|
||||
import {
|
||||
selectTimeline,
|
||||
useSelectedFeed,
|
||||
useSelectedView,
|
||||
useSetDrawerSwipeDisabled,
|
||||
} from "@/src/modules/screen/atoms"
|
||||
import { selectTimeline, useSelectedFeed, useSelectedView } from "@/src/modules/screen/atoms"
|
||||
import {
|
||||
useEntryIdsByCategory,
|
||||
useEntryIdsByFeedId,
|
||||
@@ -24,16 +18,6 @@ import { EntryListSelector } from "./EntryListSelector"
|
||||
import { usePagerView } from "./usePagerView"
|
||||
|
||||
export function EntryList() {
|
||||
const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled()
|
||||
const isFocused = useIsFocused()
|
||||
useEffect(() => {
|
||||
if (isFocused) {
|
||||
setDrawerSwipeDisabled(false)
|
||||
} else {
|
||||
setDrawerSwipeDisabled(true)
|
||||
}
|
||||
}, [setDrawerSwipeDisabled, isFocused])
|
||||
|
||||
const selectedFeed = useSelectedFeed()
|
||||
|
||||
const Content = useMemo(() => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FeedViewType } from "@follow/constants"
|
||||
import { uniqBy } from "es-toolkit/compat"
|
||||
import { LinearGradient } from "expo-linear-gradient"
|
||||
import { useEffect, useMemo } from "react"
|
||||
import { ScrollView, Text, View } from "react-native"
|
||||
@@ -10,104 +11,122 @@ import {
|
||||
EntryContentWebView,
|
||||
setWebViewEntry,
|
||||
} from "@/src/components/native/webview/EntryContentWebView"
|
||||
import { MediaCarousel } from "@/src/components/ui/carousel/MediaCarousel"
|
||||
import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime"
|
||||
import { FeedIcon } from "@/src/components/ui/icon/feed-icon"
|
||||
import { ImageContextMenu } from "@/src/components/ui/image/ImageContextMenu"
|
||||
import { PreviewImage } from "@/src/components/ui/image/PreviewImage"
|
||||
import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable"
|
||||
import type { MediaModel } from "@/src/database/schemas/types"
|
||||
import { openLink } from "@/src/lib/native"
|
||||
import { useEntry } from "@/src/store/entry/hooks"
|
||||
import { useFeed } from "@/src/store/feed/hooks"
|
||||
|
||||
import { useSelectedView } from "../../screen/atoms"
|
||||
import { useEntryListContextView } from "../EntryListContext"
|
||||
|
||||
export type MasonryItem = {
|
||||
id: string
|
||||
} & (
|
||||
| {
|
||||
type: "image"
|
||||
imageUrl: string
|
||||
blurhash?: string
|
||||
height?: number
|
||||
width?: number
|
||||
}
|
||||
| {
|
||||
type: "video"
|
||||
videoUrl: string
|
||||
videoPreviewImageUrl?: string
|
||||
}
|
||||
)
|
||||
export function EntryGridItem(props: MasonryItem) {
|
||||
const { type, id } = props
|
||||
const view = useSelectedView()
|
||||
export function EntryGridItem({ id }: { id: string }) {
|
||||
const item = useEntry(id)
|
||||
const view = useEntryListContextView()
|
||||
|
||||
const pictureViewFilterNoImage = useUISettingKey("pictureViewFilterNoImage")
|
||||
|
||||
const Content = useMemo(() => {
|
||||
switch (type) {
|
||||
case "image": {
|
||||
const { imageUrl, blurhash, height, width } = props
|
||||
const aspectRatio = height && width ? width / height : 16 / 9
|
||||
|
||||
return imageUrl ? (
|
||||
<ImageContextMenu imageUrl={imageUrl}>
|
||||
<PreviewImage
|
||||
onPreview={() => {
|
||||
if (item) {
|
||||
setWebViewEntry(item)
|
||||
}
|
||||
}}
|
||||
imageUrl={imageUrl}
|
||||
blurhash={blurhash}
|
||||
aspectRatio={aspectRatio}
|
||||
Accessory={EntryGridItemAccessory}
|
||||
AccessoryProps={{
|
||||
id,
|
||||
}}
|
||||
/>
|
||||
</ImageContextMenu>
|
||||
) : (
|
||||
<View className="aspect-video w-full items-center justify-center">
|
||||
<Text className="text-label text-center">No media available</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
case "video": {
|
||||
const { videoPreviewImageUrl } = props
|
||||
|
||||
return (
|
||||
<>
|
||||
{videoPreviewImageUrl ? (
|
||||
<ImageContextMenu imageUrl={videoPreviewImageUrl}>
|
||||
<PreviewImage imageUrl={videoPreviewImageUrl} aspectRatio={16 / 9} />
|
||||
</ImageContextMenu>
|
||||
) : (
|
||||
<View className="aspect-video w-full items-center justify-center">
|
||||
<Text className="text-label text-center">No media available</Text>
|
||||
</View>
|
||||
)}
|
||||
<Text className="text-label p-2 font-medium" numberOfLines={2}>
|
||||
{item?.title}
|
||||
</Text>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
}, [type, JSON.stringify(props), item?.title])
|
||||
if (!item) {
|
||||
if (!item || !item.media) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (
|
||||
pictureViewFilterNoImage &&
|
||||
type === "image" &&
|
||||
!props.imageUrl &&
|
||||
view === FeedViewType.Pictures
|
||||
) {
|
||||
const hasMedia = item.media.length > 0
|
||||
|
||||
if (pictureViewFilterNoImage && !hasMedia && view === FeedViewType.Pictures) {
|
||||
return null
|
||||
}
|
||||
if (!hasMedia) {
|
||||
return (
|
||||
<View className="aspect-video w-full items-center justify-center">
|
||||
<Text className="text-label text-center">No media available</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const WrapperComponent = view === FeedViewType.Videos ? ItemPressable : View
|
||||
|
||||
return (
|
||||
<WrapperComponent
|
||||
className="m-1 overflow-hidden rounded-md"
|
||||
onPress={() => {
|
||||
if (!item.url) {
|
||||
return
|
||||
}
|
||||
if (view === FeedViewType.Videos) {
|
||||
openLink(item.url)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<MediaItems
|
||||
media={item.media}
|
||||
title={item.title || ""}
|
||||
view={view!}
|
||||
entryId={id}
|
||||
onPreview={() => {
|
||||
if (item) {
|
||||
setWebViewEntry(item)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</WrapperComponent>
|
||||
)
|
||||
}
|
||||
|
||||
const MediaItems = ({
|
||||
media,
|
||||
view,
|
||||
entryId,
|
||||
onPreview,
|
||||
title,
|
||||
}: {
|
||||
media: MediaModel[]
|
||||
view: FeedViewType
|
||||
entryId: string
|
||||
onPreview: () => void
|
||||
title: string
|
||||
}) => {
|
||||
const firstMedia = media[0]
|
||||
|
||||
const uniqMedia = useMemo(() => {
|
||||
return uniqBy(media, "url")
|
||||
}, [media])
|
||||
|
||||
if (!firstMedia) {
|
||||
return null
|
||||
}
|
||||
|
||||
return <ItemPressable className="m-1 overflow-hidden rounded-md">{Content}</ItemPressable>
|
||||
const { height } = firstMedia
|
||||
const { width } = firstMedia
|
||||
const aspectRatio = width && height ? width / height : 1
|
||||
|
||||
if (view === FeedViewType.Videos) {
|
||||
const mediaUrl = firstMedia.preview_image_url || firstMedia.url
|
||||
const aspectRatio = 16 / 9
|
||||
return (
|
||||
<View>
|
||||
<View className="flex-1" style={{ aspectRatio }}>
|
||||
{mediaUrl && (
|
||||
<PreviewImage imageUrl={mediaUrl} aspectRatio={aspectRatio} onPreview={onPreview} />
|
||||
)}
|
||||
</View>
|
||||
<Text className="text-label p-2 font-medium" numberOfLines={2}>
|
||||
{title}
|
||||
</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<MediaCarousel
|
||||
media={uniqMedia}
|
||||
onPreview={onPreview}
|
||||
aspectRatio={aspectRatio}
|
||||
Accessory={EntryGridItemAccessory}
|
||||
AccessoryProps={{ id: entryId }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const EntryGridItemAccessory = ({ id }: { id: string }) => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { router } from "expo-router"
|
||||
import { useContext, useEffect } from "react"
|
||||
import type { Control } from "react-hook-form"
|
||||
import { useController, useForm } from "react-hook-form"
|
||||
@@ -34,9 +35,17 @@ async function onSubmit(values: FormValue) {
|
||||
email: values.email,
|
||||
password: values.password,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.error) {
|
||||
throw new Error(res.error.message)
|
||||
}
|
||||
// @ts-expect-error
|
||||
if (res.data.twoFactorRedirect) {
|
||||
router.push("/2fa")
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
toast.error("Login failed")
|
||||
toast.error(`Failed to login: ${error.message}`)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +91,7 @@ export function EmailLogin() {
|
||||
|
||||
const disableColor = useColor("gray3")
|
||||
|
||||
const canLogin = useSharedValue(0)
|
||||
const canLogin = useSharedValue(1)
|
||||
useEffect(() => {
|
||||
canLogin.value = withTiming(submitMutation.isPending || !formState.isValid ? 1 : 0)
|
||||
}, [submitMutation.isPending, formState.isValid, canLogin])
|
||||
@@ -139,7 +148,7 @@ export function EmailLogin() {
|
||||
{submitMutation.isPending ? (
|
||||
<ActivityIndicator className="text-white" />
|
||||
) : (
|
||||
<Text className="text-label text-center font-semibold">Continue</Text>
|
||||
<Text className="text-center font-semibold text-white">Continue</Text>
|
||||
)}
|
||||
</ReAnimatedPressable>
|
||||
</View>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
import { cn } from "@follow/utils"
|
||||
import { Image } from "expo-image"
|
||||
import { router, usePathname } from "expo-router"
|
||||
import { Pressable, Text, View } from "react-native"
|
||||
import ReAnimated, { SlideInDown, SlideOutDown } from "react-native-reanimated"
|
||||
|
||||
import { ThemedBlurView } from "@/src/components/common/ThemedBlurView"
|
||||
import { useActiveTrack } from "@/src/lib/player"
|
||||
|
||||
import { PlayPauseButton, SeekButton } from "./control"
|
||||
|
||||
const allowedRoutes = new Set(["/", "/subscriptions", "/player"])
|
||||
|
||||
export function FloatingBar({ className }: { className?: string }) {
|
||||
const activeTrack = useActiveTrack()
|
||||
const pathname = usePathname()
|
||||
if (!activeTrack || !allowedRoutes.has(pathname)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<ReAnimated.View
|
||||
className={cn("mx-2 shadow-md", className)}
|
||||
entering={SlideInDown}
|
||||
exiting={SlideOutDown}
|
||||
>
|
||||
<Pressable
|
||||
onPress={() => {
|
||||
router.push("/player")
|
||||
}}
|
||||
>
|
||||
<ThemedBlurView className="flex flex-row items-center gap-4 overflow-hidden rounded-2xl p-2">
|
||||
<Image source={activeTrack.artwork} className="size-12 rounded-lg" />
|
||||
<View className="flex-1 overflow-hidden">
|
||||
<Text className="text-label text-lg font-semibold" numberOfLines={1}>
|
||||
{activeTrack.title}
|
||||
</Text>
|
||||
</View>
|
||||
<View className="mr-2 flex flex-row gap-4">
|
||||
<PlayPauseButton />
|
||||
<SeekButton />
|
||||
</View>
|
||||
</ThemedBlurView>
|
||||
</Pressable>
|
||||
</ReAnimated.View>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { cn } from "@follow/utils"
|
||||
import { Image } from "expo-image"
|
||||
import { router, usePathname } from "expo-router"
|
||||
import { Pressable, Text, View } from "react-native"
|
||||
import Animated, { SlideInDown, SlideOutDown } from "react-native-reanimated"
|
||||
|
||||
import { useActiveTrack } from "@/src/lib/player"
|
||||
|
||||
import { PlayPauseButton, SeekButton } from "./control"
|
||||
|
||||
const allowedRoutes = new Set(["/", "/subscriptions", "/player"])
|
||||
|
||||
export function PlayerTabBar({ className }: { className?: string }) {
|
||||
const activeTrack = useActiveTrack()
|
||||
const pathname = usePathname()
|
||||
if (!activeTrack || !allowedRoutes.has(pathname)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="mb-2 overflow-hidden">
|
||||
<Animated.View
|
||||
entering={SlideInDown}
|
||||
exiting={SlideOutDown}
|
||||
className={cn("border-opaque-separator/70 border-b px-2", className)}
|
||||
>
|
||||
<Pressable
|
||||
onPress={() => {
|
||||
router.push("/player")
|
||||
}}
|
||||
>
|
||||
<View className="flex flex-row items-center gap-4 overflow-hidden rounded-2xl p-2">
|
||||
<Image source={activeTrack.artwork} className="size-12 rounded-lg" />
|
||||
<View className="flex-1 overflow-hidden">
|
||||
<Text className="text-label text-lg font-semibold" numberOfLines={1}>
|
||||
{activeTrack.title}
|
||||
</Text>
|
||||
</View>
|
||||
<View className="mr-2 flex flex-row gap-4">
|
||||
<PlayPauseButton />
|
||||
<SeekButton />
|
||||
</View>
|
||||
</View>
|
||||
</Pressable>
|
||||
</Animated.View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { cn } from "@follow/utils"
|
||||
import { router } from "expo-router"
|
||||
import { Text, TouchableOpacity, View } from "react-native"
|
||||
import { StyleSheet, Text, TouchableOpacity, View } from "react-native"
|
||||
import { Slider } from "react-native-awesome-slider"
|
||||
import { useDerivedValue, useSharedValue } from "react-native-reanimated"
|
||||
import { FadeOut, useDerivedValue, useSharedValue, ZoomIn } from "react-native-reanimated"
|
||||
import * as DropdownMenu from "zeego/dropdown-menu"
|
||||
|
||||
import { ReAnimatedPressable } from "@/src/components/common/AnimatedComponents"
|
||||
import { Back2CuteReIcon } from "@/src/icons/back_2_cute_re"
|
||||
import { Forward2CuteReIcon } from "@/src/icons/forward_2_cute_re"
|
||||
import { PauseCuteFiIcon } from "@/src/icons/pause_cute_fi"
|
||||
@@ -31,7 +32,10 @@ export function PlayPauseButton({ size = 24, className, color }: ControlButtonPr
|
||||
const label = useColor("label")
|
||||
return (
|
||||
<View className={className}>
|
||||
<TouchableOpacity
|
||||
<ReAnimatedPressable
|
||||
entering={ZoomIn.springify().damping(10).stiffness(200).mass(1)}
|
||||
exiting={FadeOut}
|
||||
key={playing ? "pause" : "play"}
|
||||
onPress={() => {
|
||||
playing ? player.pause() : player.play()
|
||||
}}
|
||||
@@ -41,7 +45,7 @@ export function PlayPauseButton({ size = 24, className, color }: ControlButtonPr
|
||||
) : (
|
||||
<PlayCuteFiIcon color={color ?? label} width={size} height={size} />
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
</ReAnimatedPressable>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -191,8 +195,9 @@ export function ProgressBar() {
|
||||
|
||||
<View className="mt-3 flex-row justify-between">
|
||||
<Text
|
||||
style={styles.text}
|
||||
className={cn(
|
||||
"font-mono text-xs font-medium tracking-wider opacity-75",
|
||||
"font-mono text-xs font-medium opacity-75",
|
||||
isBackgroundLight ? "text-black" : "text-white",
|
||||
)}
|
||||
>
|
||||
@@ -200,12 +205,14 @@ export function ProgressBar() {
|
||||
</Text>
|
||||
|
||||
<Text
|
||||
style={styles.text}
|
||||
className={cn(
|
||||
"font-mono text-xs font-medium tracking-wider opacity-75",
|
||||
"font-mono text-xs font-medium opacity-75",
|
||||
isBackgroundLight ? "text-black" : "text-white",
|
||||
)}
|
||||
>
|
||||
{"-"} {trackRemainingTime}
|
||||
{"-"}
|
||||
{trackRemainingTime}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -250,3 +257,9 @@ export function VolumeBar() {
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
text: {
|
||||
fontVariant: ["tabular-nums"],
|
||||
},
|
||||
})
|
||||
|
||||
@@ -30,6 +30,7 @@ export function TimelineViewSelector() {
|
||||
<View className="flex items-center justify-between py-2">
|
||||
<ScrollView
|
||||
horizontal
|
||||
scrollsToTop={false}
|
||||
contentContainerClassName="flex-row gap-3 items-center px-3"
|
||||
showsHorizontalScrollIndicator={false}
|
||||
>
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { router } from "expo-router"
|
||||
import { useMemo, useState } from "react"
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Text,
|
||||
TextInput,
|
||||
TouchableOpacity,
|
||||
TouchableWithoutFeedback,
|
||||
useAnimatedValue,
|
||||
View,
|
||||
} from "react-native"
|
||||
import { KeyboardAvoidingView, KeyboardController } from "react-native-keyboard-controller"
|
||||
import { useColor } from "react-native-uikit-colors"
|
||||
|
||||
import {
|
||||
NavigationBlurEffectHeader,
|
||||
NavigationContext,
|
||||
} from "@/src/components/common/SafeNavigationScrollView"
|
||||
import { MingcuteLeftLineIcon } from "@/src/icons/mingcute_left_line"
|
||||
import { twoFactor } from "@/src/lib/auth"
|
||||
import { queryClient } from "@/src/lib/query-client"
|
||||
import { toast } from "@/src/lib/toast"
|
||||
import { whoamiQueryKey } from "@/src/store/user/hooks"
|
||||
|
||||
function isAuthCodeValid(authCode: string) {
|
||||
return (
|
||||
authCode.length === 6 && !Array.from(authCode).some((c) => Number.isNaN(Number.parseInt(c)))
|
||||
)
|
||||
}
|
||||
|
||||
export default function TwoFactorAuthScreen() {
|
||||
const scrollY = useAnimatedValue(0)
|
||||
const label = useColor("label")
|
||||
const [authCode, setAuthCode] = useState("")
|
||||
|
||||
const submitMutation = useMutation({
|
||||
mutationFn: async (value: string) => {
|
||||
const res = await twoFactor.verifyTotp({ code: value })
|
||||
if (res.error) {
|
||||
throw new Error(res.error.message)
|
||||
}
|
||||
await queryClient.invalidateQueries({ queryKey: whoamiQueryKey })
|
||||
},
|
||||
onError(error) {
|
||||
toast.error(`Failed to verify: ${error.message}`)
|
||||
setAuthCode("")
|
||||
},
|
||||
onSuccess() {
|
||||
router.replace("/")
|
||||
},
|
||||
})
|
||||
|
||||
return (
|
||||
<NavigationContext.Provider value={useMemo(() => ({ scrollY }), [scrollY])}>
|
||||
<View className="flex-1 p-safe">
|
||||
<KeyboardAvoidingView behavior={"padding"} className="flex-1">
|
||||
<NavigationBlurEffectHeader
|
||||
headerShown
|
||||
headerTitle=""
|
||||
headerLeft={() => {
|
||||
return (
|
||||
<TouchableOpacity onPress={() => router.back()}>
|
||||
<MingcuteLeftLineIcon color={label} />
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<TouchableWithoutFeedback
|
||||
onPress={() => {
|
||||
KeyboardController.dismiss()
|
||||
}}
|
||||
accessible={false}
|
||||
>
|
||||
<View className="mt-20 flex-1 pb-10">
|
||||
<View className="flex-row items-center justify-center">
|
||||
<Text className="text-label w-72 text-center text-3xl font-bold" numberOfLines={2}>
|
||||
Verify with your authenticator app
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View className="mx-5 mt-10">
|
||||
<Text className="text-label">Enter Follow Auth Code</Text>
|
||||
<View className="bg-secondary-system-background mt-2 rounded-lg p-4">
|
||||
<TextInput
|
||||
placeholder="6-digit authentication code"
|
||||
autoComplete="one-time-code"
|
||||
keyboardType="numeric"
|
||||
className="text-text"
|
||||
value={authCode}
|
||||
onChangeText={setAuthCode}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className="flex-1" />
|
||||
|
||||
<TouchableOpacity
|
||||
className="disabled:bg-gray-3 mx-5 rounded-lg bg-accent py-3"
|
||||
disabled={submitMutation.isPending || !isAuthCodeValid(authCode)}
|
||||
onPress={() => {
|
||||
submitMutation.mutate(authCode)
|
||||
}}
|
||||
>
|
||||
{submitMutation.isPending ? (
|
||||
<ActivityIndicator className="text-white" />
|
||||
) : (
|
||||
<Text className="text-center font-semibold text-white">Submit</Text>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
</KeyboardAvoidingView>
|
||||
</View>
|
||||
</NavigationContext.Provider>
|
||||
)
|
||||
}
|
||||
@@ -101,11 +101,7 @@ export default function DebugPanel() {
|
||||
{
|
||||
title: "Toast",
|
||||
onPress: () => {
|
||||
toast.show({
|
||||
message: "Hello, world!".repeat(10),
|
||||
type: "success",
|
||||
variant: "center-replace",
|
||||
})
|
||||
toast.error("Hello, world!".repeat(10))
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useWhoami } from "@/src/store/user/hooks"
|
||||
export default function LoginPage() {
|
||||
const whoami = useWhoami()
|
||||
|
||||
if (whoami?.id) {
|
||||
if (whoami?.id && !__DEV__) {
|
||||
return <Redirect href="/" />
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,6 @@ export default function Index() {
|
||||
useEffect(() => {
|
||||
prepareEntryRenderWebView()
|
||||
}, [])
|
||||
|
||||
return <EntryList />
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { Stack } from "expo-router"
|
||||
import { Redirect, Stack } from "expo-router"
|
||||
|
||||
import { useWhoami } from "@/src/store/user/hooks"
|
||||
|
||||
export default function AppRootLayout() {
|
||||
const whoami = useWhoami()
|
||||
|
||||
if (!whoami?.id) {
|
||||
return <Redirect href="/login" />
|
||||
}
|
||||
return (
|
||||
<Stack
|
||||
screenOptions={{
|
||||
|
||||
@@ -102,7 +102,7 @@ export default function PlaterScreen() {
|
||||
function DismissIndicator() {
|
||||
return (
|
||||
<View className="absolute inset-x-0 flex items-center justify-center top-safe-offset-2">
|
||||
<View className="h-[5] w-[40] rounded-full bg-white/45" />
|
||||
<View className="bg-tertiary-label h-[5] w-[40] rounded-full" />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { eq } from "drizzle-orm"
|
||||
|
||||
import { db } from "../database"
|
||||
import { usersTable } from "../database/schemas"
|
||||
import type { UserSchema } from "../database/schemas/types"
|
||||
@@ -20,6 +22,10 @@ class UserServiceStatic implements Hydratable {
|
||||
const users = await db.query.usersTable.findMany()
|
||||
userActions.upsertManyInSession(users)
|
||||
}
|
||||
|
||||
async removeCurrentUser() {
|
||||
await db.update(usersTable).set({ isMe: 0 }).where(eq(usersTable.isMe, 1))
|
||||
}
|
||||
}
|
||||
|
||||
export const UserService = new UserServiceStatic()
|
||||
|
||||
@@ -7,9 +7,9 @@ import { entrySyncServices, useEntryStore } from "./store"
|
||||
import type { EntryModel, FetchEntriesProps } from "./types"
|
||||
|
||||
export const usePrefetchEntries = (props: Omit<FetchEntriesProps, "pageParam"> | null) => {
|
||||
const { feedId, inboxId, listId, view, read, limit, isArchived } = props || {}
|
||||
const { feedId, inboxId, listId, view, read, limit } = props || {}
|
||||
return useInfiniteQuery({
|
||||
queryKey: ["entries", feedId, inboxId, listId, view, read, limit, isArchived],
|
||||
queryKey: ["entries", feedId, inboxId, listId, view, read, limit],
|
||||
queryFn: ({ pageParam }) => entrySyncServices.fetchEntries({ ...props, pageParam }),
|
||||
getNextPageParam: (lastPage) =>
|
||||
listId
|
||||
|
||||
@@ -252,8 +252,7 @@ class EntryActions {
|
||||
|
||||
class EntrySyncServices {
|
||||
async fetchEntries(props: FetchEntriesProps) {
|
||||
const { feedId, inboxId, listId, view, read, limit, pageParam, isArchived, isCollection } =
|
||||
props
|
||||
const { feedId, inboxId, listId, view, read, limit, pageParam, isCollection } = props
|
||||
const params = getEntriesParams({
|
||||
feedId,
|
||||
inboxId,
|
||||
@@ -265,7 +264,6 @@ class EntrySyncServices {
|
||||
publishedAfter: pageParam,
|
||||
read,
|
||||
limit,
|
||||
isArchived,
|
||||
isCollection,
|
||||
...params,
|
||||
},
|
||||
|
||||
@@ -9,6 +9,5 @@ export type FetchEntriesProps = {
|
||||
read?: boolean
|
||||
limit?: number
|
||||
pageParam?: string
|
||||
isArchived?: boolean
|
||||
isCollection?: boolean
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { UserService } from "@/src/services/user"
|
||||
|
||||
import { createImmerSetter, createTransaction, createZustandStore } from "../internal/helper"
|
||||
|
||||
export type UserModel = Omit<UserSchema, "isMe">
|
||||
export type UserModel = UserSchema
|
||||
type UserStore = {
|
||||
users: Record<string, UserModel>
|
||||
whoami: UserModel | null
|
||||
@@ -40,6 +40,9 @@ class UserActions {
|
||||
immerSet((state) => {
|
||||
for (const user of users) {
|
||||
state.users[user.id] = user
|
||||
if (user.isMe) {
|
||||
state.whoami = user
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -55,6 +58,17 @@ class UserActions {
|
||||
)
|
||||
await tx.run()
|
||||
}
|
||||
|
||||
async removeCurrentUser() {
|
||||
const tx = createTransaction()
|
||||
tx.store(() => {
|
||||
immerSet((state) => {
|
||||
state.whoami = null
|
||||
})
|
||||
})
|
||||
tx.persist(() => UserService.removeCurrentUser())
|
||||
await tx.run()
|
||||
}
|
||||
}
|
||||
|
||||
export const userSyncService = new UserSyncService()
|
||||
|
||||
@@ -361,12 +361,12 @@ export const ModalInternal = memo(
|
||||
defaultSize={resizeDefaultSize}
|
||||
className="flex grow flex-col"
|
||||
>
|
||||
<div
|
||||
className={"relative flex items-center"}
|
||||
onPointerDownCapture={handleDrag}
|
||||
onPointerDown={relocateModal}
|
||||
>
|
||||
<Dialog.Title className="flex w-0 max-w-full grow items-center gap-2 px-4 py-1 text-lg font-semibold">
|
||||
<div className={"relative flex items-center"}>
|
||||
<Dialog.Title
|
||||
className="flex w-0 max-w-full grow items-center gap-2 px-4 py-1 text-lg font-semibold"
|
||||
onPointerDownCapture={handleDrag}
|
||||
onPointerDown={relocateModal}
|
||||
>
|
||||
{!!icon && <span className="size-4">{icon}</span>}
|
||||
<EllipsisHorizontalTextWithTooltip className="truncate">
|
||||
<span>{title}</span>
|
||||
|
||||
@@ -10,8 +10,8 @@ export const I18N_LOCALE_KEY = getStorageNS("I18N_LOCALE")
|
||||
export const ROUTE_FEED_PENDING = "all"
|
||||
export const ROUTE_ENTRY_PENDING = "pending"
|
||||
export const ROUTE_FEED_IN_FOLDER = "folder-"
|
||||
export const ROUTE_FEED_IN_LIST = "list-"
|
||||
export const ROUTE_FEED_IN_INBOX = "inbox-"
|
||||
export const ROUTE_TIMELINE_OF_VIEW = "view-"
|
||||
export const ROUTE_TIMELINE_OF_LIST = "list-"
|
||||
export const ROUTE_TIMELINE_OF_INBOX = "inbox-"
|
||||
|
||||
export const INBOX_PREFIX_ID = "inbox-"
|
||||
|
||||
@@ -10,9 +10,9 @@ import { resetShowSourceContent } from "~/atoms/source-content"
|
||||
import {
|
||||
ROUTE_ENTRY_PENDING,
|
||||
ROUTE_FEED_IN_FOLDER,
|
||||
ROUTE_FEED_IN_INBOX,
|
||||
ROUTE_FEED_IN_LIST,
|
||||
ROUTE_FEED_PENDING,
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
ROUTE_TIMELINE_OF_VIEW,
|
||||
} from "~/constants"
|
||||
|
||||
@@ -44,8 +44,8 @@ export const useNavigateEntry = () => {
|
||||
|
||||
/*
|
||||
* /timeline/:timelineId/:feedId/:entryId
|
||||
* timelineId: view-1, list-xxx, inbox-xxx
|
||||
* feedId: xxx, folder-xxx
|
||||
* timelineId: view-1
|
||||
* feedId: xxx, folder-xxx, list-xxx, inbox-xxx
|
||||
* entryId: xxx
|
||||
*/
|
||||
export const navigateEntry = (options: NavigateEntryOptions) => {
|
||||
@@ -63,20 +63,20 @@ export const navigateEntry = (options: NavigateEntryOptions) => {
|
||||
finalFeedId = `${ROUTE_FEED_IN_FOLDER}${folderName}`
|
||||
}
|
||||
|
||||
if (listId) {
|
||||
finalFeedId = `${ROUTE_FEED_IN_LIST}${listId}`
|
||||
}
|
||||
|
||||
if (inboxId) {
|
||||
finalFeedId = `${ROUTE_FEED_IN_INBOX}${inboxId}`
|
||||
}
|
||||
|
||||
finalFeedId = encodeURIComponent(finalFeedId)
|
||||
|
||||
if (view !== undefined) {
|
||||
finalTimelineId = `${ROUTE_TIMELINE_OF_VIEW}${view}`
|
||||
}
|
||||
|
||||
if (inboxId) {
|
||||
finalTimelineId = `${ROUTE_TIMELINE_OF_INBOX}${inboxId}`
|
||||
}
|
||||
|
||||
if (listId) {
|
||||
finalTimelineId = `${ROUTE_TIMELINE_OF_LIST}${listId}`
|
||||
}
|
||||
|
||||
resetShowSourceContent()
|
||||
disableShowAISummary()
|
||||
disableShowAITranslation()
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
FEED_COLLECTION_LIST,
|
||||
ROUTE_ENTRY_PENDING,
|
||||
ROUTE_FEED_IN_FOLDER,
|
||||
ROUTE_FEED_IN_INBOX,
|
||||
ROUTE_FEED_IN_LIST,
|
||||
ROUTE_FEED_PENDING,
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
ROUTE_TIMELINE_OF_VIEW,
|
||||
} from "~/constants"
|
||||
import { getListById } from "~/store/list"
|
||||
@@ -38,8 +38,8 @@ export interface BizRouteParams {
|
||||
}
|
||||
|
||||
const parseRouteParams = (params: Params<any>): BizRouteParams => {
|
||||
const listId = params.timelineId?.startsWith(ROUTE_TIMELINE_OF_LIST)
|
||||
? params.timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
|
||||
const listId = params.feedId?.startsWith(ROUTE_FEED_IN_LIST)
|
||||
? params.feedId.slice(ROUTE_FEED_IN_LIST.length)
|
||||
: undefined
|
||||
const list = listId ? getListById(listId) : undefined
|
||||
|
||||
@@ -59,8 +59,8 @@ const parseRouteParams = (params: Params<any>): BizRouteParams => {
|
||||
folderName: params.feedId?.startsWith(ROUTE_FEED_IN_FOLDER)
|
||||
? params.feedId.slice(ROUTE_FEED_IN_FOLDER.length)
|
||||
: undefined,
|
||||
inboxId: params.timelineId?.startsWith(ROUTE_TIMELINE_OF_INBOX)
|
||||
? params.timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
|
||||
inboxId: params.feedId?.startsWith(ROUTE_FEED_IN_INBOX)
|
||||
? params.feedId.slice(ROUTE_FEED_IN_INBOX.length)
|
||||
: undefined,
|
||||
listId,
|
||||
timelineId: params.timelineId,
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
import { useMemo } from "react"
|
||||
|
||||
import { useAllInboxes, useAllLists, useViewWithSubscription } from "~/store/subscription/hooks"
|
||||
import { useViewWithSubscription } from "~/store/subscription/hooks"
|
||||
|
||||
export const useTimelineList = () => {
|
||||
const lists = useAllLists()
|
||||
const inboxes = useAllInboxes()
|
||||
const views = useViewWithSubscription()
|
||||
|
||||
const listsIds = useMemo(() => lists.map((list) => `list-${list.listId}`), [lists])
|
||||
const inboxesIds = useMemo(() => inboxes.map((inbox) => `inbox-${inbox.inboxId}`), [inboxes])
|
||||
const viewsIds = useMemo(() => views.map((view) => `view-${view}`), [views])
|
||||
|
||||
return {
|
||||
views: viewsIds,
|
||||
lists: listsIds,
|
||||
inboxes: inboxesIds,
|
||||
|
||||
all: useMemo(() => [...viewsIds, ...inboxesIds, ...listsIds], [viewsIds, listsIds, inboxesIds]),
|
||||
}
|
||||
return viewsIds
|
||||
}
|
||||
|
||||
@@ -13,13 +13,7 @@ import { useFolderFeedsByFeedId } from "~/store/subscription"
|
||||
import { feedUnreadActions } from "~/store/unread"
|
||||
|
||||
const anyString = [] as string[]
|
||||
export const useEntriesByView = ({
|
||||
onReset,
|
||||
isArchived,
|
||||
}: {
|
||||
onReset?: () => void
|
||||
isArchived?: boolean
|
||||
}) => {
|
||||
export const useEntriesByView = ({ onReset }: { onReset?: () => void }) => {
|
||||
const { feedId, isAllFeeds, view, isCollection, inboxId, listId } = useRouteParams()
|
||||
|
||||
const unreadOnly = useGeneralSettingKey("unreadOnly")
|
||||
@@ -36,7 +30,6 @@ export const useEntriesByView = ({
|
||||
listId,
|
||||
view,
|
||||
...(unreadOnly === true && { read: false }),
|
||||
isArchived,
|
||||
}
|
||||
|
||||
if (feedId && listId && isBizId(feedId)) {
|
||||
@@ -44,7 +37,7 @@ export const useEntriesByView = ({
|
||||
}
|
||||
|
||||
return params
|
||||
}, [feedId, folderIds, inboxId, isArchived, listId, unreadOnly, view])
|
||||
}, [feedId, folderIds, inboxId, listId, unreadOnly, view])
|
||||
const query = useEntries(entriesOptions)
|
||||
|
||||
const [fetchedTime, setFetchedTime] = useState<number>()
|
||||
@@ -111,15 +104,12 @@ export const useEntriesByView = ({
|
||||
const isFetchingFirstPage = query.isFetching && !query.isFetchingNextPage
|
||||
|
||||
useEffect(() => {
|
||||
if (isArchived) {
|
||||
return
|
||||
}
|
||||
if (!isFetchingFirstPage) {
|
||||
prevEntryIdsRef.current = entryIds
|
||||
|
||||
onReset?.()
|
||||
}
|
||||
}, [isFetchingFirstPage, isArchived])
|
||||
}, [isFetchingFirstPage])
|
||||
|
||||
const entryIdsAsDeps = entryIds.toString()
|
||||
|
||||
@@ -139,12 +129,8 @@ export const useEntriesByView = ({
|
||||
|
||||
const sortEntries = useMemo(
|
||||
() =>
|
||||
isCollection
|
||||
? sortEntriesIdByStarAt(entryIds)
|
||||
: listId
|
||||
? sortEntriesIdByEntryInsertedAt(entryIds)
|
||||
: sortEntriesIdByEntryPublishedAt(entryIds),
|
||||
[entryIds, isCollection, listId],
|
||||
isCollection ? sortEntriesIdByStarAt(entryIds) : sortEntriesIdByEntryPublishedAt(entryIds),
|
||||
[entryIds, isCollection],
|
||||
)
|
||||
|
||||
const groupByDate = useGeneralSettingKey("groupByDate")
|
||||
@@ -214,17 +200,6 @@ function sortEntriesIdByStarAt(entries: string[]) {
|
||||
})
|
||||
}
|
||||
|
||||
function sortEntriesIdByEntryInsertedAt(entries: string[]) {
|
||||
const entriesId2Map = entryActions.getFlattenMapEntries()
|
||||
return entries
|
||||
.slice()
|
||||
.sort(
|
||||
(a, b) =>
|
||||
entriesId2Map[b]?.entries.insertedAt.localeCompare(entriesId2Map[a]?.entries.insertedAt!) ||
|
||||
0,
|
||||
)
|
||||
}
|
||||
|
||||
const useFetchEntryContentByStream = (remoteEntryIds?: string[]) => {
|
||||
const { mutate: updateEntryContent } = useMutation({
|
||||
mutationKey: ["stream-entry-content", remoteEntryIds],
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface MarkAllFilter {
|
||||
}
|
||||
export const useMarkAllByRoute = (filter?: MarkAllFilter) => {
|
||||
const routerParams = useRouteParams()
|
||||
const { feedId, view, inboxId } = routerParams
|
||||
const { feedId, view, inboxId, listId } = routerParams
|
||||
const folderIds = useFolderFeedsByFeedId({
|
||||
feedId,
|
||||
view,
|
||||
@@ -27,6 +27,12 @@ export const useMarkAllByRoute = (filter?: MarkAllFilter) => {
|
||||
view,
|
||||
filter,
|
||||
})
|
||||
} else if (listId) {
|
||||
subscriptionActions.markReadByFeedIds({
|
||||
listId,
|
||||
view,
|
||||
filter,
|
||||
})
|
||||
} else if (folderIds?.length) {
|
||||
subscriptionActions.markReadByFeedIds({
|
||||
feedIds: folderIds,
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { useMobile } from "@follow/components/hooks/useMobile.js"
|
||||
import { Button } from "@follow/components/ui/button/index.js"
|
||||
import { FeedViewType, views } from "@follow/constants"
|
||||
import { useTitle } from "@follow/hooks"
|
||||
import type { FeedModel } from "@follow/models/types"
|
||||
import { isBizId } from "@follow/utils/utils"
|
||||
import type { Range, Virtualizer } from "@tanstack/react-virtual"
|
||||
import { memo, useCallback, useEffect, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { memo, useCallback, useEffect, useRef } from "react"
|
||||
|
||||
import { useGeneralSettingKey } from "~/atoms/settings/general"
|
||||
import { FeedFoundCanBeFollowError } from "~/components/errors/FeedFoundCanBeFollowErrorFallback"
|
||||
@@ -28,18 +26,14 @@ import { EntryEmptyList, EntryList } from "./list"
|
||||
import { EntryColumnWrapper } from "./wrapper"
|
||||
|
||||
function EntryColumnImpl() {
|
||||
const { t } = useTranslation()
|
||||
const [isArchived, setIsArchived] = useState(false)
|
||||
const unreadOnly = useGeneralSettingKey("unreadOnly")
|
||||
const listRef = useRef<Virtualizer<HTMLElement, Element>>()
|
||||
const entries = useEntriesByView({
|
||||
onReset: useCallback(() => {
|
||||
listRef.current?.scrollToIndex(0)
|
||||
}, []),
|
||||
isArchived,
|
||||
})
|
||||
|
||||
const { entriesIds, isFetchingNextPage, groupedCounts } = entries
|
||||
const { entriesIds, groupedCounts } = entries
|
||||
useSnapEntryIdList(entriesIds)
|
||||
|
||||
const {
|
||||
@@ -48,14 +42,8 @@ function EntryColumnImpl() {
|
||||
feedId: routeFeedId,
|
||||
isPendingEntry,
|
||||
isCollection,
|
||||
inboxId,
|
||||
listId,
|
||||
} = useRouteParams()
|
||||
|
||||
useEffect(() => {
|
||||
setIsArchived(false)
|
||||
}, [view, routeFeedId])
|
||||
|
||||
const activeEntry = useEntry(activeEntryId)
|
||||
const feed = useFeedById(routeFeedId)
|
||||
const title = useFeedHeaderTitle()
|
||||
@@ -76,35 +64,6 @@ function EntryColumnImpl() {
|
||||
|
||||
const handleMarkReadInRange = useEntryMarkReadHandler(entriesIds)
|
||||
|
||||
useEffect(() => {
|
||||
if (isArchived) {
|
||||
if (entries.hasNextPage) {
|
||||
entries.fetchNextPage()
|
||||
} else {
|
||||
entries.refetch()
|
||||
}
|
||||
}
|
||||
}, [isArchived])
|
||||
|
||||
// Common conditions for both showArchivedButton and shouldLoadArchivedEntries
|
||||
const commonConditions =
|
||||
!isArchived && !unreadOnly && !isCollection && routeFeedId !== ROUTE_FEED_PENDING
|
||||
|
||||
// Determine if the archived button should be shown
|
||||
const showArchivedButton = commonConditions && feed?.type === "feed"
|
||||
const hasNoEntries = entries.data?.pages?.[0]?.data?.length === 0 && !entries.isLoading
|
||||
|
||||
// Determine if archived entries should be loaded
|
||||
const shouldLoadArchivedEntries =
|
||||
commonConditions && (feed?.type === "feed" || !feed) && !inboxId && !listId && hasNoEntries
|
||||
|
||||
// automatically fetch archived entries when there is no entries in timeline
|
||||
useEffect(() => {
|
||||
if (shouldLoadArchivedEntries) {
|
||||
setIsArchived(true)
|
||||
}
|
||||
}, [shouldLoadArchivedEntries])
|
||||
|
||||
const handleScroll = useCallback(() => {
|
||||
if (!isInteracted.current) {
|
||||
isInteracted.current = true
|
||||
@@ -185,7 +144,7 @@ function EntryColumnImpl() {
|
||||
onPullToRefresh={entries.refetch}
|
||||
key={`${routeFeedId}-${view}`}
|
||||
>
|
||||
{entriesIds.length === 0 && !showArchivedButton ? (
|
||||
{entriesIds.length === 0 ? (
|
||||
entries.isLoading ? null : (
|
||||
<EntryEmptyList />
|
||||
)
|
||||
@@ -201,15 +160,6 @@ function EntryColumnImpl() {
|
||||
fetchNextPage={fetchNextPage}
|
||||
refetch={entries.refetch}
|
||||
groupCounts={groupedCounts}
|
||||
Footer={
|
||||
!isFetchingNextPage && showArchivedButton ? (
|
||||
<div className="flex justify-center py-4">
|
||||
<Button variant="outline" onClick={() => setIsArchived(true)}>
|
||||
{t("words.load_archived_entries")}
|
||||
</Button>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</EntryColumnWrapper>
|
||||
|
||||
@@ -39,7 +39,7 @@ export const EntryListHeader: FC<{
|
||||
|
||||
const unreadOnly = useGeneralSettingKey("unreadOnly")
|
||||
|
||||
const { feedId, entryId, view, listId } = routerParams
|
||||
const { feedId, entryId, view } = routerParams
|
||||
|
||||
const headerTitle = useFeedHeaderTitle()
|
||||
|
||||
@@ -58,7 +58,6 @@ export const EntryListHeader: FC<{
|
||||
const isOnline = useIsOnline()
|
||||
|
||||
const feed = useFeedById(feedId)
|
||||
const isList = !!listId
|
||||
|
||||
const containerRef = React.useRef<HTMLDivElement>(null)
|
||||
const titleStyleBasedView = ["pl-6", "pl-7", "pl-7", "pl-7", "px-5", "pl-6"]
|
||||
@@ -127,26 +126,22 @@ export const EntryListHeader: FC<{
|
||||
/>
|
||||
</ActionButton>
|
||||
))}
|
||||
{!isList && (
|
||||
<>
|
||||
<ActionButton
|
||||
tooltip={
|
||||
!unreadOnly
|
||||
? t("entry_list_header.show_unread_only")
|
||||
: t("entry_list_header.show_all")
|
||||
}
|
||||
shortcut={shortcuts.entries.toggleUnreadOnly.key}
|
||||
onClick={() => setGeneralSetting("unreadOnly", !unreadOnly)}
|
||||
>
|
||||
{unreadOnly ? (
|
||||
<i className="i-mgc-round-cute-fi" />
|
||||
) : (
|
||||
<i className="i-mgc-round-cute-re" />
|
||||
)}
|
||||
</ActionButton>
|
||||
<MarkAllReadWithOverlay containerRef={containerRef} shortcut />
|
||||
</>
|
||||
)}
|
||||
<ActionButton
|
||||
tooltip={
|
||||
!unreadOnly
|
||||
? t("entry_list_header.show_unread_only")
|
||||
: t("entry_list_header.show_all")
|
||||
}
|
||||
shortcut={shortcuts.entries.toggleUnreadOnly.key}
|
||||
onClick={() => setGeneralSetting("unreadOnly", !unreadOnly)}
|
||||
>
|
||||
{unreadOnly ? (
|
||||
<i className="i-mgc-round-cute-fi" />
|
||||
) : (
|
||||
<i className="i-mgc-round-cute-re" />
|
||||
)}
|
||||
</ActionButton>
|
||||
<MarkAllReadWithOverlay containerRef={containerRef} shortcut />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { cn } from "@follow/utils/utils"
|
||||
import { useMutation } from "@tanstack/react-query"
|
||||
import { Trans, useTranslation } from "react-i18next"
|
||||
|
||||
import { useServerConfigs } from "~/atoms/server-configs"
|
||||
import { CopyButton } from "~/components/ui/button/CopyButton"
|
||||
import { apiClient } from "~/lib/api-fetch"
|
||||
import { getBlockchainExplorerUrl } from "~/lib/utils"
|
||||
@@ -30,6 +31,7 @@ export const MyWalletSection = ({ className }: { className?: string }) => {
|
||||
const wallet = useWallet()
|
||||
const myWallet = wallet.data?.[0]
|
||||
|
||||
const serverConfigs = useServerConfigs()
|
||||
const rewardDescriptionModal = useRewardDescriptionModal()
|
||||
|
||||
const refreshMutation = useMutation({
|
||||
@@ -133,35 +135,39 @@ export const MyWalletSection = ({ className }: { className?: string }) => {
|
||||
<WithdrawButton />
|
||||
</div>
|
||||
</div>
|
||||
<Divider className="my-8" />
|
||||
<SettingSectionTitle title={t("wallet.balance.dailyReward")} margin="compact" />
|
||||
<div className="my-1 text-sm">{t("wallet.power.rewardDescription")}</div>
|
||||
<div className="my-1 text-sm">
|
||||
<Trans
|
||||
i18nKey="wallet.power.rewardDescription2"
|
||||
ns="settings"
|
||||
values={{ blockchainName: "VSL" }}
|
||||
components={{
|
||||
Balance: (
|
||||
<Balance withSuffix value={BigInt(myWallet.todayDailyPower || 0n)}>
|
||||
{BigInt(myWallet.todayDailyPower || 0n)}
|
||||
</Balance>
|
||||
),
|
||||
Link: <Button onClick={rewardDescriptionModal} variant="text" />,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="my-2 flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="space-y-1">
|
||||
<Level level={myWallet.level?.level || 0} />
|
||||
<ActivityPoints points={myWallet.level?.prevActivityPoints || 0} />
|
||||
{!!serverConfigs?.DAILY_POWER_SUPPLY && (
|
||||
<>
|
||||
<Divider className="my-8" />
|
||||
<SettingSectionTitle title={t("wallet.balance.dailyReward")} margin="compact" />
|
||||
<div className="my-1 text-sm">{t("wallet.power.rewardDescription")}</div>
|
||||
<div className="my-1 text-sm">
|
||||
<Trans
|
||||
i18nKey="wallet.power.rewardDescription2"
|
||||
ns="settings"
|
||||
values={{ blockchainName: "VSL" }}
|
||||
components={{
|
||||
Balance: (
|
||||
<Balance withSuffix value={BigInt(myWallet.todayDailyPower || 0n)}>
|
||||
{BigInt(myWallet.todayDailyPower || 0n)}
|
||||
</Balance>
|
||||
),
|
||||
Link: <Button onClick={rewardDescriptionModal} variant="text" />,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<i className="i-mgc-right-cute-li text-3xl" />
|
||||
<Balance withSuffix>{BigInt(myWallet.todayDailyPower || 0n)}</Balance>
|
||||
</div>
|
||||
<ClaimDailyReward />
|
||||
</div>
|
||||
<div className="my-2 flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="space-y-1">
|
||||
<Level level={myWallet.level?.level || 0} />
|
||||
<ActivityPoints points={myWallet.level?.prevActivityPoints || 0} />
|
||||
</div>
|
||||
<i className="i-mgc-right-cute-li text-3xl" />
|
||||
<Balance withSuffix>{BigInt(myWallet.todayDailyPower || 0n)}</Balance>
|
||||
</div>
|
||||
<ClaimDailyReward />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import { FeedTitle } from "~/modules/feed/feed-title"
|
||||
import { getPreferredTitle, useFeedById } from "~/store/feed"
|
||||
import { useInboxById } from "~/store/inbox"
|
||||
import { useListById } from "~/store/list"
|
||||
import { subscriptionActions, useSubscriptionByFeedId } from "~/store/subscription"
|
||||
import { useSubscriptionByFeedId } from "~/store/subscription"
|
||||
import { useFeedUnreadStore } from "~/store/unread"
|
||||
|
||||
import { useSelectedFeedIdsState } from "./atom"
|
||||
@@ -255,9 +255,6 @@ const ListItemImpl: Component<{
|
||||
entryId: null,
|
||||
view,
|
||||
})
|
||||
subscriptionActions.markReadByFeedIds({
|
||||
listId,
|
||||
})
|
||||
// focus to main container in order to let keyboard can navigate entry items by arrow keys
|
||||
nextFrame(() => {
|
||||
getMainContainerElement()?.focus()
|
||||
@@ -304,7 +301,7 @@ const ListItemImpl: Component<{
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
<UnreadNumber unread={listUnread} isList className="ml-2" />
|
||||
<UnreadNumber unread={listUnread} className="ml-2" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useDraggable } from "@dnd-kit/core"
|
||||
import { ScrollArea } from "@follow/components/ui/scroll-area/index.js"
|
||||
import { cn, isKeyForMultiSelectPressed } from "@follow/utils/utils"
|
||||
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import Selecto from "react-selecto"
|
||||
import { useEventListener } from "usehooks-ts"
|
||||
|
||||
@@ -15,20 +16,38 @@ import {
|
||||
useSelectedFeedIdsState,
|
||||
} from "./atom"
|
||||
import { DraggableContext } from "./context"
|
||||
import { EmptyFeedList, ListHeader, StarredItem, useFeedsGroupedData } from "./FeedList.shared"
|
||||
import {
|
||||
EmptyFeedList,
|
||||
ListHeader,
|
||||
StarredItem,
|
||||
useFeedsGroupedData,
|
||||
useInboxesGroupedData,
|
||||
useListsGroupedData,
|
||||
} from "./FeedList.shared"
|
||||
import { useShouldFreeUpSpace } from "./hook"
|
||||
import { SortableFeedList } from "./sort-by"
|
||||
import { SortableFeedList, SortByAlphabeticalInbox, SortByAlphabeticalList } from "./sort-by"
|
||||
|
||||
const FeedListImpl = forwardRef<HTMLDivElement, { className?: string; view: number }>(
|
||||
({ className, view }, ref) => {
|
||||
const feedsData = useFeedsGroupedData(view)
|
||||
const listsData = useListsGroupedData(view)
|
||||
const inboxesData = useInboxesGroupedData(view)
|
||||
|
||||
const categoryOpenStateData = useCategoryOpenStateByView(view)
|
||||
|
||||
const hasData = Object.keys(feedsData).length > 0
|
||||
const hasData =
|
||||
Object.keys(feedsData).length > 0 ||
|
||||
Object.keys(listsData).length > 0 ||
|
||||
Object.keys(inboxesData).length > 0
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
// Data prefetch
|
||||
useAuthQuery(Queries.lists.list())
|
||||
|
||||
const hasListData = Object.keys(listsData).length > 0
|
||||
const hasInboxData = Object.keys(inboxesData).length > 0
|
||||
|
||||
const scrollerRef = useRef<HTMLDivElement>(null)
|
||||
const selectoRef = useRef<Selecto>(null)
|
||||
const [selectedFeedIds, setSelectedFeedIds] = useSelectedFeedIdsState()
|
||||
@@ -196,6 +215,32 @@ const FeedListImpl = forwardRef<HTMLDivElement, { className?: string; view: numb
|
||||
rootClassName={cn("h-full", shouldFreeUpSpace && "overflow-visible")}
|
||||
>
|
||||
<StarredItem view={view} />
|
||||
{hasListData && (
|
||||
<>
|
||||
<div className="mt-1 flex h-6 w-full shrink-0 items-center rounded-md px-2.5 text-xs font-semibold text-theme-vibrancyFg transition-colors">
|
||||
{t("words.lists")}
|
||||
</div>
|
||||
<SortByAlphabeticalList view={view} data={listsData} />
|
||||
</>
|
||||
)}
|
||||
{hasInboxData && (
|
||||
<>
|
||||
<div className="mt-1 flex h-6 w-full shrink-0 items-center rounded-md px-2.5 text-xs font-semibold text-theme-vibrancyFg transition-colors">
|
||||
{t("words.inbox")}
|
||||
</div>
|
||||
<SortByAlphabeticalInbox view={view} data={inboxesData} />
|
||||
</>
|
||||
)}
|
||||
{(hasListData || hasInboxData) && (
|
||||
<div
|
||||
className={cn(
|
||||
"mb-1 flex h-6 w-full shrink-0 items-center rounded-md px-2.5 text-xs font-semibold text-theme-vibrancyFg transition-colors",
|
||||
Object.keys(feedsData).length === 0 ? "mt-0" : "mt-1",
|
||||
)}
|
||||
>
|
||||
{t("words.feeds")}
|
||||
</div>
|
||||
)}
|
||||
<DraggableContext.Provider value={draggableContextValue}>
|
||||
<div className="space-y-px" id="feeds-area" ref={setNodeRef}>
|
||||
{hasData ? (
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
import { env } from "@follow/shared/env"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { CopyButton } from "~/components/ui/button/CopyButton"
|
||||
import { useInboxById } from "~/store/inbox"
|
||||
import { useFeedUnreadStore } from "~/store/unread"
|
||||
|
||||
import { UnreadNumber } from "./UnreadNumber"
|
||||
|
||||
export const InboxList = ({ id }: { id: string }) => {
|
||||
const { t } = useTranslation()
|
||||
const inboxUnread = useFeedUnreadStore((state) => state.data[id] || 0)
|
||||
const inbox = useInboxById(id)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mx-3 mb-1 flex items-center justify-between px-2.5 py-1">
|
||||
<div className="text-base font-bold">{inbox?.title || t("words.inbox")}</div>
|
||||
<div className="ml-2 flex items-center gap-3 text-base text-zinc-400 dark:text-zinc-600 lg:text-sm lg:!text-theme-vibrancyFg">
|
||||
<UnreadNumber unread={inboxUnread} className="text-xs !text-inherit" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="px-3">
|
||||
<div className="mb-4 px-2.5 text-sm text-zinc-500">
|
||||
<span>{t("discover.inbox.description")}</span>
|
||||
<a
|
||||
href="https://github.com/RSSNext/Follow/wiki/Inbox#webhooks"
|
||||
className="ml-2 inline text-zinc-600 underline"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{t("discover.inbox.webhooks_docs")}
|
||||
</a>
|
||||
</div>
|
||||
<div className="mb-4 px-2.5 text-sm">
|
||||
<div className="text-zinc-500">{t("discover.inbox.handle")}</div>
|
||||
<div>{id}</div>
|
||||
</div>
|
||||
<div className="px-2.5 text-sm">
|
||||
<div className="text-zinc-500">{t("discover.inbox.email")}</div>
|
||||
<div className="group relative flex w-fit items-center gap-2">
|
||||
<span className="shrink-0">
|
||||
{id}
|
||||
{env.VITE_INBOXES_EMAIL}
|
||||
</span>
|
||||
<CopyButton
|
||||
value={`${id}${env.VITE_INBOXES_EMAIL}`}
|
||||
className="p-1 lg:absolute lg:-right-6 lg:opacity-0 lg:group-hover:opacity-100 [&_i]:size-3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
import { ScrollArea } from "@follow/components/ui/scroll-area/index.js"
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipPortal,
|
||||
TooltipTrigger,
|
||||
} from "@follow/components/ui/tooltip/index.js"
|
||||
import { cn } from "@follow/utils/utils"
|
||||
import dayjs from "dayjs"
|
||||
import type { FC, MouseEventHandler } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
|
||||
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
|
||||
import { useList } from "~/queries/lists"
|
||||
import { useFeedById } from "~/store/feed"
|
||||
import { useListById } from "~/store/list"
|
||||
|
||||
import { FeedIcon } from "../feed/feed-icon"
|
||||
import { FeedTitle } from "../feed/feed-title"
|
||||
import { feedColumnStyles } from "./styles"
|
||||
|
||||
export const ListFeedList: FC<{ listId: string }> = ({ listId }) => {
|
||||
const { t } = useTranslation()
|
||||
const cachedList = useListById(listId)
|
||||
const res = useList({ id: listId, noExtras: true })
|
||||
const list = res.data?.list || cachedList
|
||||
const currentFeedId = useRouteParamsSelector((s) => s.feedId)
|
||||
|
||||
if (!list) return null
|
||||
return (
|
||||
<>
|
||||
<div className="mx-3 mb-1 flex items-center justify-between px-2.5 py-1">
|
||||
<div className="text-base font-bold">{list?.title || t("words.inbox")}</div>
|
||||
</div>
|
||||
<ScrollArea.ScrollArea flex viewportClassName="!px-3" rootClassName="h-full">
|
||||
{list?.feedIds.map((feedId) => (
|
||||
<FeedItem key={feedId} feedId={feedId} isActive={feedId === currentFeedId} />
|
||||
))}
|
||||
</ScrollArea.ScrollArea>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
interface FeedItemProps {
|
||||
feedId: string
|
||||
isActive: boolean
|
||||
}
|
||||
const FeedItem = ({ feedId, isActive }: FeedItemProps) => {
|
||||
const feed = useFeedById(feedId)
|
||||
const { t } = useTranslation()
|
||||
const navigate = useNavigateEntry()
|
||||
|
||||
if (!feed) return null
|
||||
|
||||
const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {
|
||||
e.stopPropagation()
|
||||
navigate({ feedId })
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"my-px px-2.5 py-0.5",
|
||||
feedColumnStyles.item,
|
||||
isActive && "bg-theme-item-active",
|
||||
)}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
"flex min-w-0 items-center",
|
||||
feed.errorAt && "text-red-900 dark:text-red-500",
|
||||
)}
|
||||
>
|
||||
<FeedIcon fallback feed={feed} size={16} />
|
||||
<FeedTitle feed={feed} />
|
||||
{feed?.errorAt && (
|
||||
<Tooltip delayDuration={300}>
|
||||
<TooltipTrigger asChild>
|
||||
<i className="i-mgc-wifi-off-cute-re ml-1 shrink-0 text-base" />
|
||||
</TooltipTrigger>
|
||||
<TooltipPortal>
|
||||
<TooltipContent>
|
||||
<div className="flex items-center gap-1">
|
||||
<i className="i-mgc-time-cute-re" />
|
||||
{t("feed_item.error_since")}{" "}
|
||||
{dayjs
|
||||
.duration(dayjs(feed.errorAt).diff(dayjs(), "minute"), "minute")
|
||||
.humanize(true)}
|
||||
</div>
|
||||
{!!feed.errorMessage && (
|
||||
<div className="flex items-center gap-1">
|
||||
<i className="i-mgc-bug-cute-re" />
|
||||
{feed.errorMessage}
|
||||
</div>
|
||||
)}
|
||||
</TooltipContent>
|
||||
</TooltipPortal>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,258 +0,0 @@
|
||||
import { Divider } from "@follow/components/ui/divider/Divider.js"
|
||||
import { RootPortal } from "@follow/components/ui/portal/index.js"
|
||||
import { ScrollArea } from "@follow/components/ui/scroll-area/ScrollArea.js"
|
||||
import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/EllipsisWithTooltip.js"
|
||||
import type { FeedViewType } from "@follow/constants"
|
||||
import { views } from "@follow/constants"
|
||||
import { cn } from "@follow/utils/utils"
|
||||
import { AnimatePresence, m, useAnimationControls } from "framer-motion"
|
||||
import type { HTMLAttributes } from "react"
|
||||
import { forwardRef, useEffect, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { useShowContextMenu } from "~/atoms/context-menu"
|
||||
import { useUISettingKey } from "~/atoms/settings/ui"
|
||||
import {
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
ROUTE_TIMELINE_OF_VIEW,
|
||||
} from "~/constants"
|
||||
import { useListActions } from "~/hooks/biz/useFeedActions"
|
||||
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
|
||||
import { useContextMenu } from "~/hooks/common"
|
||||
import { useInboxById } from "~/store/inbox"
|
||||
import { useListById } from "~/store/list"
|
||||
|
||||
import { FeedIcon } from "../feed/feed-icon"
|
||||
import { feedColumnStyles } from "./styles"
|
||||
|
||||
interface QuickSelectorPanelProps {
|
||||
rootContainer: HTMLElement | null
|
||||
timelineList: {
|
||||
views: string[]
|
||||
lists: string[]
|
||||
inboxes: string[]
|
||||
all: string[]
|
||||
}
|
||||
activeTimelineId: string | undefined
|
||||
open: boolean
|
||||
}
|
||||
|
||||
export const QuickSelectorPanel = forwardRef<HTMLDivElement, QuickSelectorPanelProps>(
|
||||
({ rootContainer, timelineList, activeTimelineId, open: shouldOpen }, ref) => {
|
||||
const feedColWidth = useUISettingKey("feedColWidth")
|
||||
const animateControls = useAnimationControls()
|
||||
const [renderPanel, setRenderPanel] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
let cancel = false
|
||||
if (shouldOpen) {
|
||||
setRenderPanel(true)
|
||||
animateControls.start({
|
||||
transform: "translateX(0%)",
|
||||
})
|
||||
} else {
|
||||
animateControls
|
||||
.start({
|
||||
transform: "translateX(-100%)",
|
||||
})
|
||||
.then(() => {
|
||||
if (cancel) return
|
||||
setRenderPanel(false)
|
||||
})
|
||||
}
|
||||
return () => {
|
||||
cancel = true
|
||||
}
|
||||
}, [animateControls, renderPanel, shouldOpen])
|
||||
|
||||
return (
|
||||
<RootPortal to={rootContainer}>
|
||||
<AnimatePresence>
|
||||
<div
|
||||
className="pointer-events-none fixed inset-y-0 z-[1] w-64 overflow-hidden"
|
||||
style={{ left: feedColWidth }}
|
||||
>
|
||||
<m.div
|
||||
ref={ref}
|
||||
className="pointer-events-auto flex h-full w-64 flex-col border-x bg-native"
|
||||
initial={{ transform: "translateX(-100%)" }}
|
||||
animate={animateControls}
|
||||
transition={{
|
||||
damping: 50,
|
||||
stiffness: 500,
|
||||
type: "spring",
|
||||
}}
|
||||
>
|
||||
{renderPanel && (
|
||||
<>
|
||||
<header className="flex items-center justify-between border-b p-3 text-lg font-medium">
|
||||
<span className="text-lg font-medium">Quick Selector</span>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="flex items-center justify-center rounded p-1 transition-colors duration-200 hover:bg-theme-item-hover"
|
||||
onClick={() => {
|
||||
animateControls.start({
|
||||
transform: "translateX(-100%)",
|
||||
})
|
||||
}}
|
||||
>
|
||||
<i className="i-mgc-close-cute-re" />
|
||||
</button>
|
||||
</header>
|
||||
<ScrollArea viewportClassName="pt-2 px-3" rootClassName="w-full">
|
||||
<TimelineSection
|
||||
title="Views"
|
||||
items={timelineList.views}
|
||||
activeTimelineId={activeTimelineId}
|
||||
ItemComponent={TimelineListViewItem}
|
||||
/>
|
||||
<Divider className="mx-12 my-4" />
|
||||
<TimelineSection
|
||||
title="Inboxes"
|
||||
items={timelineList.inboxes}
|
||||
activeTimelineId={activeTimelineId}
|
||||
ItemComponent={TimelineInboxListItem}
|
||||
/>
|
||||
<Divider className="mx-12 my-4" />
|
||||
<TimelineSection
|
||||
title="Lists"
|
||||
items={timelineList.lists}
|
||||
activeTimelineId={activeTimelineId}
|
||||
ItemComponent={TimelineListListItem}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</>
|
||||
)}
|
||||
</m.div>
|
||||
</div>
|
||||
</AnimatePresence>
|
||||
</RootPortal>
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
interface TimelineItemProps {
|
||||
timelineId: string
|
||||
isActive: boolean
|
||||
}
|
||||
const TimelineListViewItem = ({ timelineId, isActive }: TimelineItemProps) => {
|
||||
const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
|
||||
const item = views.find((item) => item.view === id)!
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ItemBase timelineId={timelineId} isActive={isActive}>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
{item.icon}
|
||||
<EllipsisHorizontalTextWithTooltip className="truncate">
|
||||
{t(item.name as any)}
|
||||
</EllipsisHorizontalTextWithTooltip>
|
||||
</div>
|
||||
</ItemBase>
|
||||
)
|
||||
}
|
||||
|
||||
const ItemBase: Component<
|
||||
{ timelineId: string; isActive: boolean } & HTMLAttributes<HTMLButtonElement>
|
||||
> = ({ timelineId, isActive, children, className, ...props }) => {
|
||||
const navigate = useNavigateEntry()
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
navigate({
|
||||
timelineId,
|
||||
feedId: null,
|
||||
entryId: null,
|
||||
})
|
||||
}}
|
||||
className={cn(
|
||||
feedColumnStyles.item,
|
||||
"flex w-full cursor-button items-center justify-between rounded-md px-2.5 py-0.5 text-base font-medium leading-loose lg:text-sm",
|
||||
isActive && "bg-theme-item-active",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
const TimelineListListItem = ({ timelineId, isActive }: TimelineItemProps) => {
|
||||
const id = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
|
||||
const list = useListById(id)
|
||||
|
||||
const items = useListActions({ listId: id })
|
||||
const showContextMenu = useShowContextMenu()
|
||||
|
||||
const contextMenuProps = useContextMenu({
|
||||
onContextMenu: async (e) => {
|
||||
await showContextMenu(items, e)
|
||||
},
|
||||
})
|
||||
|
||||
if (!list) return null
|
||||
return (
|
||||
<ItemBase className="px-1" timelineId={timelineId} isActive={isActive} {...contextMenuProps}>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<FeedIcon fallback feed={list} size={22} noMargin />
|
||||
<EllipsisHorizontalTextWithTooltip className="truncate">
|
||||
{list.title}
|
||||
</EllipsisHorizontalTextWithTooltip>
|
||||
</div>
|
||||
</ItemBase>
|
||||
)
|
||||
}
|
||||
|
||||
const TimelineInboxListItem = ({ timelineId, isActive }: TimelineItemProps) => {
|
||||
const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
|
||||
const inbox = useInboxById(id)
|
||||
|
||||
if (!inbox) return null
|
||||
return (
|
||||
<ItemBase timelineId={timelineId} isActive={isActive}>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<FeedIcon fallback feed={inbox} size={16} noMargin />
|
||||
<EllipsisHorizontalTextWithTooltip className="truncate">
|
||||
{inbox.title}
|
||||
</EllipsisHorizontalTextWithTooltip>
|
||||
</div>
|
||||
</ItemBase>
|
||||
)
|
||||
}
|
||||
|
||||
interface TimelineSectionProps {
|
||||
title: string
|
||||
items: string[]
|
||||
ItemComponent: React.ComponentType<TimelineItemProps>
|
||||
activeTimelineId?: string | undefined
|
||||
}
|
||||
|
||||
const TimelineSection = ({
|
||||
title,
|
||||
items,
|
||||
activeTimelineId,
|
||||
ItemComponent,
|
||||
}: TimelineSectionProps) => {
|
||||
return (
|
||||
<>
|
||||
<div className="mb-1 text-base font-bold">{title}</div>
|
||||
{items.length > 0 ? (
|
||||
<div className="flex flex-col gap-1">
|
||||
{items.map((timelineId) => (
|
||||
<ItemComponent
|
||||
key={timelineId}
|
||||
timelineId={timelineId}
|
||||
isActive={activeTimelineId === timelineId}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-center text-sm text-muted-foreground">Nothing in {title}</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,24 +1,12 @@
|
||||
import type { FeedViewType } from "@follow/constants"
|
||||
|
||||
import {
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
ROUTE_TIMELINE_OF_VIEW,
|
||||
} from "~/constants"
|
||||
import { ROUTE_TIMELINE_OF_VIEW } from "~/constants"
|
||||
|
||||
import { FeedList } from "./FeedList"
|
||||
import { InboxList } from "./InboxList"
|
||||
import { ListFeedList } from "./ListFeedList"
|
||||
|
||||
export default function TimelineList({ timelineId }: { timelineId: string }) {
|
||||
if (timelineId.startsWith(ROUTE_TIMELINE_OF_VIEW)) {
|
||||
const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
|
||||
return <FeedList className="flex size-full flex-col text-sm" view={id} />
|
||||
} else if (timelineId.startsWith(ROUTE_TIMELINE_OF_LIST)) {
|
||||
const listId = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
|
||||
return <ListFeedList listId={listId} />
|
||||
} else if (timelineId.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
|
||||
const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
|
||||
return <InboxList id={id} />
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import { DividerVertical } from "@follow/components/ui/divider/Divider.js"
|
||||
import { useTriangleMenu } from "@follow/hooks"
|
||||
import { getNodeXInScroller, isNodeVisibleInScroller } from "@follow/utils/dom"
|
||||
import { clsx } from "@follow/utils/utils"
|
||||
import { Fragment, useEffect, useRef, useState } from "react"
|
||||
|
||||
import { useTimelineColumnShow } from "~/atoms/sidebar"
|
||||
import { ROOT_CONTAINER_ID } from "~/constants/dom"
|
||||
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
|
||||
import { useTimelineList } from "~/hooks/biz/useTimelineList"
|
||||
|
||||
import styles from "./index.module.css"
|
||||
import { QuickSelectorPanel } from "./QuickSelectorPanel"
|
||||
import { TimelineSwitchButton } from "./TimelineSwitchButton"
|
||||
|
||||
export const TimelineSelector = ({ timelineId }: { timelineId: string | undefined }) => {
|
||||
const timelineList = useTimelineList()
|
||||
const scrollRef = useRef<HTMLDivElement>(null)
|
||||
useEffect(() => {
|
||||
const $scroll = scrollRef.current
|
||||
if (!$scroll) {
|
||||
return
|
||||
}
|
||||
const handler = () => {
|
||||
if (!timelineId) return
|
||||
const targetElement = [...$scroll.children]
|
||||
.filter(($el) => $el.tagName === "BUTTON")
|
||||
.find(($el, index) => index === timelineList.all.indexOf(timelineId))
|
||||
if (!targetElement) {
|
||||
return
|
||||
}
|
||||
|
||||
const isInCurrentView = isNodeVisibleInScroller(targetElement, $scroll)
|
||||
if (!targetElement || isInCurrentView) {
|
||||
return
|
||||
}
|
||||
const targetX = getNodeXInScroller(targetElement, $scroll) - 12
|
||||
|
||||
$scroll.scrollTo({
|
||||
left: targetX,
|
||||
behavior: "smooth",
|
||||
})
|
||||
}
|
||||
handler()
|
||||
}, [timelineId])
|
||||
|
||||
const [rootContainer, setRootContainer] = useState<HTMLElement | null>(null)
|
||||
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const $root = document.querySelector(`#${ROOT_CONTAINER_ID}`)
|
||||
if (!$root) return
|
||||
|
||||
setRootContainer($root as HTMLElement)
|
||||
}, [])
|
||||
|
||||
const activeTimelineId = useRouteParamsSelector((s) => s.timelineId)
|
||||
|
||||
const [panelRef, setPanelRef] = useState<HTMLDivElement | null>(null)
|
||||
const triggerRef = useRef<HTMLDivElement>(null)
|
||||
const shouldOpen = useTriangleMenu(triggerRef, panelRef!, 0)
|
||||
|
||||
const timelineColumnShow = useTimelineColumnShow()
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div ref={containerRef} className="relative mb-4 mt-3">
|
||||
<div
|
||||
ref={scrollRef}
|
||||
className={clsx(
|
||||
styles["mask-scroller"],
|
||||
"flex h-11 justify-between gap-0.5 overflow-auto px-2 text-xl text-theme-vibrancyFg scrollbar-none",
|
||||
)}
|
||||
onWheel={(e) => {
|
||||
e.preventDefault()
|
||||
e.currentTarget.scrollLeft += e.deltaY
|
||||
}}
|
||||
>
|
||||
{timelineList.views.map((timelineId) => (
|
||||
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
|
||||
))}
|
||||
|
||||
{timelineList.inboxes.length > 0 && <DividerVertical className="mx-1 my-auto h-8" />}
|
||||
{timelineList.inboxes.map((timelineId) => (
|
||||
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
|
||||
))}
|
||||
{timelineList.lists.length > 0 && <DividerVertical className="mx-1 my-auto h-8" />}
|
||||
{timelineList.lists.map((timelineId) => (
|
||||
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div ref={triggerRef} className="absolute inset-y-0 right-0 w-4" />
|
||||
</div>
|
||||
|
||||
{timelineColumnShow && (
|
||||
<QuickSelectorPanel
|
||||
ref={setPanelRef}
|
||||
open={shouldOpen}
|
||||
rootContainer={rootContainer}
|
||||
timelineList={timelineList}
|
||||
activeTimelineId={activeTimelineId}
|
||||
/>
|
||||
)}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
@@ -2,31 +2,17 @@ import { useDroppable } from "@dnd-kit/core"
|
||||
import { ActionButton } from "@follow/components/ui/button/index.js"
|
||||
import type { FeedViewType } from "@follow/constants"
|
||||
import { views } from "@follow/constants"
|
||||
import { nextFrame } from "@follow/utils/dom"
|
||||
import { cn } from "@follow/utils/utils"
|
||||
import type { FC } from "react"
|
||||
import { startTransition, useCallback } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { useShowContextMenu } from "~/atoms/context-menu"
|
||||
import { getMainContainerElement } from "~/atoms/dom"
|
||||
import { useUISettingKey } from "~/atoms/settings/ui"
|
||||
import {
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
ROUTE_TIMELINE_OF_VIEW,
|
||||
} from "~/constants"
|
||||
import { useListActions } from "~/hooks/biz/useFeedActions"
|
||||
import { ROUTE_TIMELINE_OF_VIEW } from "~/constants"
|
||||
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
|
||||
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
|
||||
import { useContextMenu } from "~/hooks/common"
|
||||
import { useInboxById } from "~/store/inbox"
|
||||
import { useListById } from "~/store/list"
|
||||
import { subscriptionActions } from "~/store/subscription"
|
||||
import { useFeedUnreadStore } from "~/store/unread"
|
||||
import { useUnreadByView } from "~/store/unread/hooks"
|
||||
|
||||
import { FeedIcon } from "../feed/feed-icon"
|
||||
import { resetSelectedFeedIds } from "./atom"
|
||||
|
||||
export function TimelineSwitchButton({ timelineId }: { timelineId: string }) {
|
||||
@@ -45,12 +31,6 @@ export function TimelineSwitchButton({ timelineId }: { timelineId: string }) {
|
||||
if (timelineId.startsWith(ROUTE_TIMELINE_OF_VIEW)) {
|
||||
const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
|
||||
return <ViewSwitchButton view={id} isActive={isActive} setActive={setActive} />
|
||||
} else if (timelineId.startsWith(ROUTE_TIMELINE_OF_LIST)) {
|
||||
const id = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
|
||||
return <ListSwitchButton listId={id} isActive={isActive} setActive={setActive} />
|
||||
} else if (timelineId.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
|
||||
const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
|
||||
return <InboxSwitchButton inboxId={id} isActive={isActive} setActive={setActive} />
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +60,10 @@ const ViewSwitchButton: FC<{
|
||||
shortcut={`${view + 1}`}
|
||||
className={cn(
|
||||
isActive && item.className,
|
||||
"flex h-11 shrink-0 flex-col items-center gap-1 text-[1.375rem]",
|
||||
"flex h-11 w-9 shrink-0 flex-col items-center gap-1 text-[1.375rem]",
|
||||
ELECTRON ? "hover:!bg-theme-item-hover" : "",
|
||||
isOver && "border-theme-accent-400 bg-theme-accent-400/60",
|
||||
)}
|
||||
size="lg"
|
||||
onClick={(e) => {
|
||||
startTransition(() => {
|
||||
setActive()
|
||||
@@ -108,117 +87,3 @@ const ViewSwitchButton: FC<{
|
||||
</ActionButton>
|
||||
)
|
||||
}
|
||||
|
||||
const ListSwitchButton: FC<{
|
||||
listId: string
|
||||
isActive: boolean
|
||||
setActive: () => void
|
||||
}> = ({ listId, isActive, setActive }) => {
|
||||
const list = useListById(listId)
|
||||
const listUnread = useFeedUnreadStore((state) => state.data[listId] || 0)
|
||||
|
||||
const handleNavigate = useCallback(
|
||||
(e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.stopPropagation()
|
||||
|
||||
setActive()
|
||||
subscriptionActions.markReadByFeedIds({
|
||||
listId,
|
||||
})
|
||||
// focus to main container in order to let keyboard can navigate entry items by arrow keys
|
||||
nextFrame(() => {
|
||||
getMainContainerElement()?.focus()
|
||||
})
|
||||
},
|
||||
[listId, setActive],
|
||||
)
|
||||
|
||||
const items = useListActions({ listId })
|
||||
const showContextMenu = useShowContextMenu()
|
||||
const contextMenuProps = useContextMenu({
|
||||
onContextMenu: async (e) => {
|
||||
await showContextMenu(items, e)
|
||||
},
|
||||
})
|
||||
|
||||
if (!list) return null
|
||||
|
||||
return (
|
||||
<ActionButton
|
||||
key={list.id}
|
||||
tooltip={list.title}
|
||||
className={cn(
|
||||
"flex h-11 shrink-0 flex-col items-center gap-1 text-xl grayscale",
|
||||
"hover:!bg-theme-item-hover",
|
||||
isActive && "!bg-theme-item-active grayscale-0",
|
||||
)}
|
||||
size="lg"
|
||||
onClick={handleNavigate}
|
||||
{...contextMenuProps}
|
||||
>
|
||||
<FeedIcon fallback feed={list} size={22} noMargin />
|
||||
{!!listUnread && (
|
||||
<div className="center h-2.5 text-[0.25rem]">
|
||||
<i className={"i-mgc-round-cute-fi"} />
|
||||
</div>
|
||||
)}
|
||||
{!listUnread && (
|
||||
<span className="line-clamp-1 break-all px-1 text-[0.625rem] font-medium leading-none">
|
||||
{list.title}
|
||||
</span>
|
||||
)}
|
||||
</ActionButton>
|
||||
)
|
||||
}
|
||||
|
||||
const InboxSwitchButton: FC<{
|
||||
inboxId: string
|
||||
isActive: boolean
|
||||
setActive: () => void
|
||||
}> = ({ inboxId, isActive, setActive }) => {
|
||||
const inbox = useInboxById(inboxId)
|
||||
const inboxUnread = useFeedUnreadStore((state) => state.data[inboxId] || 0)
|
||||
const showSidebarUnreadCount = useUISettingKey("sidebarShowUnreadCount")
|
||||
|
||||
const handleNavigate = useCallback(
|
||||
(e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.stopPropagation()
|
||||
|
||||
setActive()
|
||||
// focus to main container in order to let keyboard can navigate entry items by arrow keys
|
||||
nextFrame(() => {
|
||||
getMainContainerElement()?.focus()
|
||||
})
|
||||
},
|
||||
[setActive],
|
||||
)
|
||||
|
||||
if (!inbox) return null
|
||||
|
||||
return (
|
||||
<ActionButton
|
||||
tooltip={inbox.title}
|
||||
className={cn(
|
||||
"flex h-11 shrink-0 flex-col items-center gap-1 text-xl grayscale",
|
||||
ELECTRON ? "hover:!bg-theme-item-hover" : "",
|
||||
isActive && "text-black dark:text-white",
|
||||
)}
|
||||
size="lg"
|
||||
onClick={handleNavigate}
|
||||
>
|
||||
<FeedIcon fallback feed={inbox} size={22} noMargin />
|
||||
{showSidebarUnreadCount ? (
|
||||
<div className="text-[0.625rem] font-medium leading-none">
|
||||
{inboxUnread > 99 ? <span className="-mr-0.5">99+</span> : inboxUnread}
|
||||
</div>
|
||||
) : (
|
||||
<i
|
||||
className={cn(
|
||||
"i-mgc-round-cute-fi text-[0.25rem]",
|
||||
inboxUnread ? (isActive ? "opacity-100" : "opacity-60") : "opacity-0",
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</ActionButton>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,15 +2,7 @@ import { cn } from "@follow/utils/utils"
|
||||
|
||||
import { useUISettingKey } from "~/atoms/settings/ui"
|
||||
|
||||
export const UnreadNumber = ({
|
||||
unread,
|
||||
className,
|
||||
isList,
|
||||
}: {
|
||||
unread: number
|
||||
className?: string
|
||||
isList?: boolean
|
||||
}) => {
|
||||
export const UnreadNumber = ({ unread, className }: { unread: number; className?: string }) => {
|
||||
const showUnreadCount = useUISettingKey("sidebarShowUnreadCount")
|
||||
|
||||
if (!unread) return null
|
||||
@@ -21,7 +13,7 @@ export const UnreadNumber = ({
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{isList || !showUnreadCount ? <i className="i-mgc-round-cute-fi text-[0.3rem]" /> : unread}
|
||||
{!showUnreadCount ? <i className="i-mgc-round-cute-fi text-[0.3rem]" /> : unread}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import { getSelectedFeedIds, resetSelectedFeedIds, setSelectedFeedIds } from "./
|
||||
import { useShouldFreeUpSpace } from "./hook"
|
||||
import { TimelineColumnHeader } from "./TimelineColumnHeader"
|
||||
import TimelineList from "./TimelineList"
|
||||
import { TimelineSelector } from "./TimelineSelector"
|
||||
import { TimelineSwitchButton } from "./TimelineSwitchButton"
|
||||
|
||||
const lethargy = new Lethargy()
|
||||
|
||||
@@ -66,7 +66,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
(args: string | ((prev: string | undefined, index: number) => string)) => {
|
||||
let nextActive
|
||||
if (typeof args === "function") {
|
||||
const index = timelineId ? timelineList.all.indexOf(timelineId) : 0
|
||||
const index = timelineId ? timelineList.indexOf(timelineId) : 0
|
||||
nextActive = args(timelineId, index)
|
||||
} else {
|
||||
nextActive = args
|
||||
@@ -75,7 +75,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
navigateBackHome(nextActive)
|
||||
resetSelectedFeedIds()
|
||||
},
|
||||
[navigateBackHome, timelineId, timelineList.all],
|
||||
[navigateBackHome, timelineId, timelineList],
|
||||
)
|
||||
|
||||
useWheel(
|
||||
@@ -84,7 +84,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
const s = lethargy.check(event)
|
||||
if (s) {
|
||||
if (!wait && Math.abs(dex) > 20) {
|
||||
setActive((_, i) => timelineList.all[clamp(i + dx, 0, timelineList.all.length - 1)]!)
|
||||
setActive((_, i) => timelineList[clamp(i + dx, 0, timelineList.length - 1)]!)
|
||||
return true
|
||||
} else {
|
||||
return
|
||||
@@ -108,13 +108,13 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
if (isHotkeyPressed("Left")) {
|
||||
setActive((_, i) => {
|
||||
if (i === 0) {
|
||||
return timelineList.all.at(-1)!
|
||||
return timelineList.at(-1)!
|
||||
} else {
|
||||
return timelineList.all[i - 1]!
|
||||
return timelineList[i - 1]!
|
||||
}
|
||||
})
|
||||
} else {
|
||||
setActive((_, i) => timelineList.all[(i + 1) % timelineList.all.length]!)
|
||||
setActive((_, i) => timelineList[(i + 1) % timelineList.length]!)
|
||||
}
|
||||
},
|
||||
{ scopes: HotKeyScopeMap.Home },
|
||||
@@ -152,7 +152,13 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
</RootPortal>
|
||||
)}
|
||||
|
||||
<TimelineSelector timelineId={timelineId} />
|
||||
<div className="relative mb-4 mt-3">
|
||||
<div className="flex h-11 justify-between gap-0 px-3 text-xl text-theme-vibrancyFg">
|
||||
{timelineList.map((timelineId) => (
|
||||
<TimelineSwitchButton key={timelineId} timelineId={timelineId} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={cn("relative mt-1 flex size-full", !shouldFreeUpSpace && "overflow-hidden")}
|
||||
ref={carouselRef}
|
||||
@@ -168,7 +174,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
|
||||
}, [])}
|
||||
>
|
||||
<SwipeWrapper active={timelineId!}>
|
||||
{timelineList.all.map((timelineId) => (
|
||||
{timelineList.map((timelineId) => (
|
||||
<section key={timelineId} className="h-full w-feed-col shrink-0 snap-center">
|
||||
<TimelineList key={timelineId} timelineId={timelineId} />
|
||||
</section>
|
||||
@@ -187,7 +193,7 @@ const SwipeWrapper: FC<{
|
||||
}> = memo(({ children, active }) => {
|
||||
const reduceMotion = useReduceMotion()
|
||||
const timelineList = useTimelineList()
|
||||
const index = timelineList.all.indexOf(active)
|
||||
const index = timelineList.indexOf(active)
|
||||
|
||||
const feedColumnWidth = useUISettingKey("feedColWidth")
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
@@ -14,7 +14,6 @@ export const entries = {
|
||||
view,
|
||||
read,
|
||||
limit,
|
||||
isArchived,
|
||||
}: {
|
||||
feedId?: number | string
|
||||
inboxId?: number | string
|
||||
@@ -22,10 +21,9 @@ export const entries = {
|
||||
view?: number
|
||||
read?: boolean
|
||||
limit?: number
|
||||
isArchived?: boolean
|
||||
}) =>
|
||||
defineQuery(
|
||||
["entries", inboxId || listId || feedId, view, read, limit, isArchived],
|
||||
["entries", inboxId || listId || feedId, view, read, limit],
|
||||
async ({ pageParam }) =>
|
||||
entryActions.fetchEntries({
|
||||
feedId,
|
||||
@@ -35,7 +33,6 @@ export const entries = {
|
||||
read,
|
||||
limit,
|
||||
pageParam: pageParam as string,
|
||||
isArchived,
|
||||
}),
|
||||
{
|
||||
rootKey: ["entries", inboxId || listId || feedId],
|
||||
@@ -133,38 +130,30 @@ export const useEntries = ({
|
||||
listId,
|
||||
view,
|
||||
read,
|
||||
isArchived,
|
||||
}: {
|
||||
feedId?: number | string
|
||||
inboxId?: number | string
|
||||
listId?: number | string
|
||||
view?: number
|
||||
read?: boolean
|
||||
isArchived?: boolean
|
||||
}) => {
|
||||
const fetchUnread = read === false
|
||||
const feedUnreadDirty = useFeedUnreadIsDirty((feedId as string) || "")
|
||||
|
||||
return useAuthInfiniteQuery(
|
||||
entries.entries({ feedId, inboxId, listId, view, read, isArchived }),
|
||||
{
|
||||
enabled: feedId !== undefined || inboxId !== undefined || listId !== undefined,
|
||||
getNextPageParam: (lastPage) =>
|
||||
listId
|
||||
? lastPage.data?.at(-1)?.entries.insertedAt
|
||||
: lastPage.data?.at(-1)?.entries.publishedAt,
|
||||
initialPageParam: undefined,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
// DON'T refetch when the router is pop to previous page
|
||||
refetchOnMount: fetchUnread && feedUnreadDirty && !history.isPop ? "always" : false,
|
||||
return useAuthInfiniteQuery(entries.entries({ feedId, inboxId, listId, view, read }), {
|
||||
enabled: feedId !== undefined || inboxId !== undefined || listId !== undefined,
|
||||
getNextPageParam: (lastPage) => lastPage.data?.at(-1)?.entries.publishedAt,
|
||||
initialPageParam: undefined,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
// DON'T refetch when the router is pop to previous page
|
||||
refetchOnMount: fetchUnread && feedUnreadDirty && !history.isPop ? "always" : false,
|
||||
|
||||
staleTime:
|
||||
// Force refetch unread entries when feed is dirty
|
||||
// HACK: disable refetch when the router is pop to previous page
|
||||
history.isPop ? Infinity : fetchUnread && feedUnreadDirty ? 0 : defaultStaleTime,
|
||||
},
|
||||
)
|
||||
staleTime:
|
||||
// Force refetch unread entries when feed is dirty
|
||||
// HACK: disable refetch when the router is pop to previous page
|
||||
history.isPop ? Infinity : fetchUnread && feedUnreadDirty ? 0 : defaultStaleTime,
|
||||
})
|
||||
}
|
||||
|
||||
export const useEntriesPreview = ({ id }: { id?: string }) =>
|
||||
|
||||
@@ -113,7 +113,6 @@ class EntryActions {
|
||||
read,
|
||||
limit,
|
||||
pageParam,
|
||||
isArchived,
|
||||
}: {
|
||||
feedId?: number | string
|
||||
inboxId?: number | string
|
||||
@@ -122,7 +121,6 @@ class EntryActions {
|
||||
read?: boolean
|
||||
limit?: number
|
||||
pageParam?: string
|
||||
isArchived?: boolean
|
||||
}) {
|
||||
if (inboxId) {
|
||||
const data = await apiClient.entries.inbox
|
||||
@@ -147,7 +145,7 @@ class EntryActions {
|
||||
})
|
||||
|
||||
if (data.data) {
|
||||
this.upsertMany(structuredClone(data.data), { isArchived })
|
||||
this.upsertMany(structuredClone(data.data))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -163,7 +161,6 @@ class EntryActions {
|
||||
publishedAfter: pageParam,
|
||||
read,
|
||||
limit,
|
||||
isArchived,
|
||||
...params,
|
||||
},
|
||||
})
|
||||
@@ -183,7 +180,7 @@ class EntryActions {
|
||||
}
|
||||
}
|
||||
if (data.data) {
|
||||
this.upsertMany(structuredClone(data.data), { isArchived })
|
||||
this.upsertMany(structuredClone(data.data))
|
||||
}
|
||||
return data
|
||||
}
|
||||
@@ -263,7 +260,7 @@ class EntryActions {
|
||||
})
|
||||
}
|
||||
|
||||
upsertMany(data: CombinedEntryModel[], options?: { isArchived?: boolean }) {
|
||||
upsertMany(data: CombinedEntryModel[]) {
|
||||
const feeds = [] as FeedOrListRespModel[]
|
||||
const entries = [] as EntryModel[]
|
||||
const inboxes = [] as InboxModel[]
|
||||
@@ -370,7 +367,7 @@ class EntryActions {
|
||||
}
|
||||
}
|
||||
|
||||
if (item.settings && draft.flatMapEntries[item.entries.id] && !options?.isArchived) {
|
||||
if (item.settings && draft.flatMapEntries[item.entries.id]) {
|
||||
draft.flatMapEntries[item.entries.id]!.settings = item.settings
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,7 @@ import type { FeedModel, FeedOrListRespModel, InboxModel, ListModel } from "@fol
|
||||
import { useCallback } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import {
|
||||
FEED_COLLECTION_LIST,
|
||||
ROUTE_FEED_IN_FOLDER,
|
||||
ROUTE_FEED_PENDING,
|
||||
ROUTE_TIMELINE_OF_INBOX,
|
||||
ROUTE_TIMELINE_OF_LIST,
|
||||
} from "~/constants"
|
||||
import { FEED_COLLECTION_LIST, ROUTE_FEED_IN_FOLDER, ROUTE_FEED_PENDING } from "~/constants"
|
||||
import { useRouteParams } from "~/hooks/biz/useRouteParams"
|
||||
|
||||
import { useInboxStore } from "../inbox"
|
||||
@@ -77,17 +71,10 @@ export const useInboxByIdSelector = <T>(
|
||||
|
||||
export const useFeedHeaderTitle = () => {
|
||||
const { t } = useTranslation()
|
||||
const { feedId: currentFeedId, view, listId, inboxId, timelineId } = useRouteParams()
|
||||
const { feedId: currentFeedId, view, listId: currentListId } = useRouteParams()
|
||||
|
||||
const listTitle = useListByIdSelector(listId, getPreferredTitle)
|
||||
const inboxTitle = useInboxByIdSelector(inboxId, getPreferredTitle)
|
||||
const feedTitle = useFeedByIdSelector(currentFeedId, getPreferredTitle)
|
||||
|
||||
if (timelineId?.startsWith(ROUTE_TIMELINE_OF_LIST)) {
|
||||
return listTitle
|
||||
} else if (timelineId?.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
|
||||
return inboxTitle
|
||||
}
|
||||
const listTitle = useListByIdSelector(currentListId, getPreferredTitle)
|
||||
|
||||
switch (currentFeedId) {
|
||||
case ROUTE_FEED_PENDING: {
|
||||
@@ -100,7 +87,7 @@ export const useFeedHeaderTitle = () => {
|
||||
if (currentFeedId?.startsWith(ROUTE_FEED_IN_FOLDER)) {
|
||||
return currentFeedId.replace(ROUTE_FEED_IN_FOLDER, "")
|
||||
}
|
||||
return feedTitle
|
||||
return feedTitle || listTitle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export const useCategoriesByView = (view: FeedViewType) =>
|
||||
(state) =>
|
||||
new Set(
|
||||
subscriptionByViewSelector(view)(state)
|
||||
.map((subscription) => subscription!.category)
|
||||
.map((subscription) => subscription?.category)
|
||||
.filter((category) => category !== null && category !== undefined)
|
||||
.filter(Boolean),
|
||||
),
|
||||
|
||||
@@ -196,14 +196,13 @@ class SubscriptionActions {
|
||||
state.listIds.add(subscription.listId)
|
||||
} else if (subscription.inboxId) {
|
||||
state.inboxIds.add(subscription.inboxId)
|
||||
} else {
|
||||
state.feedIdByView[subscription.view].push(subscription.feedId)
|
||||
}
|
||||
state.data[subscription.feedId] = omit(subscription, [
|
||||
"feeds",
|
||||
"lists",
|
||||
"inboxes",
|
||||
]) as SubscriptionFlatModel
|
||||
state.feedIdByView[subscription.view].push(subscription.feedId)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# What's new in v0.3.7
|
||||
|
||||
## New Features
|
||||
|
||||
- Revert to the previous list display styles.
|
||||

|
||||
- The entries of the list is now displayed directly in the timeline.
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Follow",
|
||||
"type": "module",
|
||||
"version": "0.3.6",
|
||||
"version": "0.3.7",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.12.3",
|
||||
"description": "Follow everything in one place",
|
||||
@@ -196,5 +196,5 @@
|
||||
]
|
||||
},
|
||||
"productName": "Follow",
|
||||
"mainHash": "d2184ce595ab3b45f933edb9938b6a6fe53d8c85558d0899b9ffb8f72850cf25"
|
||||
"mainHash": "ed3532be011d04d18a4148a025b6ae1282bd25aa8260f8aa7e9121f855d11314"
|
||||
}
|
||||
|
||||
+206
-315
@@ -2984,164 +2984,6 @@ declare const subscriptionsRelations: drizzle_orm.Relations<"subscriptions", {
|
||||
rsshubUsage: drizzle_orm.One<"rsshub_usage", true>;
|
||||
}>;
|
||||
|
||||
declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "timeline";
|
||||
schema: undefined;
|
||||
columns: {
|
||||
userId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "user_id";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
feedId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "feedId";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
entryId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "entry_id";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
publishedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "published_at";
|
||||
tableName: "timeline";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
insertedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "inserted_at";
|
||||
tableName: "timeline";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
view: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "view";
|
||||
tableName: "timeline";
|
||||
dataType: "number";
|
||||
columnType: "PgSmallInt";
|
||||
data: number;
|
||||
driverParam: string | number;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
read: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "read";
|
||||
tableName: "timeline";
|
||||
dataType: "boolean";
|
||||
columnType: "PgBoolean";
|
||||
data: boolean;
|
||||
driverParam: boolean;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
};
|
||||
dialect: "pg";
|
||||
}>;
|
||||
declare const timelineOpenAPISchema: zod.ZodObject<{
|
||||
userId: zod.ZodString;
|
||||
feedId: zod.ZodString;
|
||||
entryId: zod.ZodString;
|
||||
publishedAt: zod.ZodString;
|
||||
insertedAt: zod.ZodString;
|
||||
view: zod.ZodNumber;
|
||||
read: zod.ZodNullable<zod.ZodBoolean>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
userId: string;
|
||||
view: number;
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
publishedAt: string;
|
||||
entryId: string;
|
||||
read: boolean | null;
|
||||
}, {
|
||||
userId: string;
|
||||
view: number;
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
publishedAt: string;
|
||||
entryId: string;
|
||||
read: boolean | null;
|
||||
}>;
|
||||
declare const timelineRelations: drizzle_orm.Relations<"timeline", {
|
||||
entries: drizzle_orm.One<"entries", true>;
|
||||
feeds: drizzle_orm.One<"feeds", true>;
|
||||
collections: drizzle_orm.One<"collections", true>;
|
||||
subscriptions: drizzle_orm.One<"subscriptions", true>;
|
||||
}>;
|
||||
|
||||
declare const inboxesEntries: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "inboxes_entries";
|
||||
schema: undefined;
|
||||
@@ -4561,6 +4403,7 @@ declare const listsRelations: drizzle_orm.Relations<"lists", {
|
||||
owner: drizzle_orm.One<"user", true>;
|
||||
listsSubscriptions: drizzle_orm.Many<"lists_subscriptions">;
|
||||
}>;
|
||||
type ListModel = InferInsertModel<typeof lists>;
|
||||
|
||||
declare const listsSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "lists_subscriptions";
|
||||
@@ -4634,23 +4477,6 @@ declare const listsSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
lastViewedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "last_viewed_at";
|
||||
tableName: "lists_subscriptions";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
createdAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "created_at";
|
||||
tableName: "lists_subscriptions";
|
||||
@@ -4693,7 +4519,6 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
|
||||
listId: zod.ZodString;
|
||||
view: zod.ZodNumber;
|
||||
title: zod.ZodNullable<zod.ZodString>;
|
||||
lastViewedAt: zod.ZodNullable<zod.ZodString>;
|
||||
createdAt: zod.ZodString;
|
||||
isPrivate: zod.ZodBoolean;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
@@ -4703,7 +4528,6 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
|
||||
view: number;
|
||||
isPrivate: boolean;
|
||||
listId: string;
|
||||
lastViewedAt: string | null;
|
||||
}, {
|
||||
createdAt: string;
|
||||
userId: string;
|
||||
@@ -4711,109 +4535,12 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
|
||||
view: number;
|
||||
isPrivate: boolean;
|
||||
listId: string;
|
||||
lastViewedAt: string | null;
|
||||
}>;
|
||||
declare const listsSubscriptionsRelations: drizzle_orm.Relations<"lists_subscriptions", {
|
||||
users: drizzle_orm.One<"user", true>;
|
||||
lists: drizzle_orm.One<"lists", true>;
|
||||
}>;
|
||||
|
||||
declare const listsTimeline: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "lists_timeline";
|
||||
schema: undefined;
|
||||
columns: {
|
||||
listId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "list_id";
|
||||
tableName: "lists_timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
feedId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "feedId";
|
||||
tableName: "lists_timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
entryId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "entry_id";
|
||||
tableName: "lists_timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
insertedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "inserted_at";
|
||||
tableName: "lists_timeline";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
};
|
||||
dialect: "pg";
|
||||
}>;
|
||||
declare const listsTimelineOpenAPISchema: zod.ZodObject<{
|
||||
listId: zod.ZodString;
|
||||
feedId: zod.ZodString;
|
||||
entryId: zod.ZodString;
|
||||
insertedAt: zod.ZodString;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
entryId: string;
|
||||
listId: string;
|
||||
}, {
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
entryId: string;
|
||||
listId: string;
|
||||
}>;
|
||||
declare const listsTimelineRelations: drizzle_orm.Relations<"lists_timeline", {
|
||||
entries: drizzle_orm.One<"entries", true>;
|
||||
feeds: drizzle_orm.One<"feeds", true>;
|
||||
}>;
|
||||
|
||||
declare const messaging: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "messaging";
|
||||
schema: undefined;
|
||||
@@ -5240,6 +4967,210 @@ declare const settings: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
dialect: "pg";
|
||||
}>;
|
||||
|
||||
declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "timeline";
|
||||
schema: undefined;
|
||||
columns: {
|
||||
userId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "user_id";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
feedId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "feedId";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
entryId: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "entry_id";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
publishedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "published_at";
|
||||
tableName: "timeline";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
insertedAt: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "inserted_at";
|
||||
tableName: "timeline";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
view: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "view";
|
||||
tableName: "timeline";
|
||||
dataType: "number";
|
||||
columnType: "PgSmallInt";
|
||||
data: number;
|
||||
driverParam: string | number;
|
||||
notNull: true;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
read: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "read";
|
||||
tableName: "timeline";
|
||||
dataType: "boolean";
|
||||
columnType: "PgBoolean";
|
||||
data: boolean;
|
||||
driverParam: boolean;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: undefined;
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
from: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "from";
|
||||
tableName: "timeline";
|
||||
dataType: "array";
|
||||
columnType: "PgArray";
|
||||
data: string[];
|
||||
driverParam: string | string[];
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: drizzle_orm.Column<{
|
||||
name: "from";
|
||||
tableName: "timeline";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
driverParam: string;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
isAutoincrement: false;
|
||||
hasRuntimeDefault: false;
|
||||
enumValues: [string, ...string[]];
|
||||
baseColumn: never;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {}>;
|
||||
identity: undefined;
|
||||
generated: undefined;
|
||||
}, {}, {
|
||||
baseBuilder: drizzle_orm_pg_core.PgColumnBuilder<{
|
||||
name: "from";
|
||||
dataType: "string";
|
||||
columnType: "PgText";
|
||||
data: string;
|
||||
enumValues: [string, ...string[]];
|
||||
driverParam: string;
|
||||
}, {}, {}, drizzle_orm.ColumnBuilderExtraConfig>;
|
||||
size: undefined;
|
||||
}>;
|
||||
};
|
||||
dialect: "pg";
|
||||
}>;
|
||||
declare const timelineOpenAPISchema: zod.ZodObject<{
|
||||
userId: zod.ZodString;
|
||||
feedId: zod.ZodString;
|
||||
entryId: zod.ZodString;
|
||||
publishedAt: zod.ZodString;
|
||||
insertedAt: zod.ZodString;
|
||||
view: zod.ZodNumber;
|
||||
read: zod.ZodNullable<zod.ZodBoolean>;
|
||||
from: zod.ZodNullable<zod.ZodArray<zod.ZodString, "many">>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
userId: string;
|
||||
view: number;
|
||||
from: string[] | null;
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
publishedAt: string;
|
||||
entryId: string;
|
||||
read: boolean | null;
|
||||
}, {
|
||||
userId: string;
|
||||
view: number;
|
||||
from: string[] | null;
|
||||
feedId: string;
|
||||
insertedAt: string;
|
||||
publishedAt: string;
|
||||
entryId: string;
|
||||
read: boolean | null;
|
||||
}>;
|
||||
declare const timelineRelations: drizzle_orm.Relations<"timeline", {
|
||||
entries: drizzle_orm.One<"entries", true>;
|
||||
feeds: drizzle_orm.One<"feeds", true>;
|
||||
collections: drizzle_orm.One<"collections", true>;
|
||||
subscriptions: drizzle_orm.One<"subscriptions", true>;
|
||||
}>;
|
||||
|
||||
declare const user: drizzle_orm_pg_core.PgTableWithColumns<{
|
||||
name: "user";
|
||||
schema: undefined;
|
||||
@@ -14313,7 +14244,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -14323,7 +14253,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
} | undefined;
|
||||
list?: {
|
||||
@@ -14355,7 +14284,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -14365,7 +14293,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[] | undefined;
|
||||
ownerUserId?: string | null | undefined;
|
||||
@@ -14377,7 +14304,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
} | undefined;
|
||||
docs?: string | undefined;
|
||||
@@ -14520,7 +14446,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
read: boolean | null;
|
||||
@@ -14615,7 +14540,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
} | undefined;
|
||||
@@ -14775,7 +14699,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -14785,7 +14708,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
read: boolean | null;
|
||||
@@ -14880,7 +14802,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -14890,7 +14811,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
} | undefined;
|
||||
@@ -15027,7 +14947,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -15037,7 +14956,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
subscriptionCount: number;
|
||||
@@ -15114,7 +15032,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -15124,7 +15041,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
subscriptionCount: number;
|
||||
@@ -15453,7 +15369,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -15463,7 +15378,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
feedId: string;
|
||||
@@ -15517,7 +15431,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -15527,7 +15440,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[] | undefined;
|
||||
ownerUserId?: string | null | undefined;
|
||||
@@ -15539,11 +15451,9 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
listId: string;
|
||||
lastViewedAt: string | null;
|
||||
category?: string | undefined;
|
||||
} | {
|
||||
createdAt: string;
|
||||
@@ -15569,7 +15479,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
inboxId: string;
|
||||
@@ -15877,7 +15786,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -15887,7 +15795,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
} | null | undefined;
|
||||
}[];
|
||||
@@ -16076,7 +15983,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -16086,7 +15992,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
};
|
||||
language: string | null;
|
||||
@@ -16150,7 +16055,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -16160,7 +16064,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[] | undefined;
|
||||
ownerUserId?: string | null | undefined;
|
||||
@@ -16172,7 +16075,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
subscriptionCount: number;
|
||||
@@ -16184,7 +16086,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
view: number;
|
||||
isPrivate: boolean;
|
||||
listId: string;
|
||||
lastViewedAt: string | null;
|
||||
} | undefined;
|
||||
};
|
||||
};
|
||||
@@ -16235,7 +16136,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -16245,7 +16145,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[] | undefined;
|
||||
ownerUserId?: string | null | undefined;
|
||||
@@ -16257,7 +16156,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
};
|
||||
@@ -16335,7 +16233,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -16345,7 +16242,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[] | undefined;
|
||||
ownerUserId?: string | null | undefined;
|
||||
@@ -16357,7 +16253,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
subscriptionCount?: number | undefined;
|
||||
purchaseAmount?: number | undefined;
|
||||
@@ -16400,7 +16295,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
tipUsers?: {
|
||||
id: string;
|
||||
@@ -16410,7 +16304,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
}[] | null | undefined;
|
||||
}[];
|
||||
};
|
||||
@@ -16534,7 +16427,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
};
|
||||
};
|
||||
@@ -16669,7 +16561,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
isAnonymous: boolean | null;
|
||||
} | null | undefined;
|
||||
}[];
|
||||
};
|
||||
@@ -16983,4 +16874,4 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
||||
}, "/rsshub">, "/">;
|
||||
type AppType = typeof _routes;
|
||||
|
||||
export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, type UrlReadsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, urlReads, urlReadsOpenAPISchema, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
|
||||
export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type ListModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, type UrlReadsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, urlReads, urlReadsOpenAPISchema, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
|
||||
|
||||
Generated
+29
-29
@@ -4004,8 +4004,8 @@ packages:
|
||||
'@radix-ui/react-avatar@1.1.3':
|
||||
resolution: {integrity: sha512-Paen00T4P8L8gd9bNsRMw7Cbaz85oxiv+hzomsRZgFm2byltPFDtfcoqlWJ8GyZlIBWgLssJlzLCnKU0G0302g==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4057,9 +4057,9 @@ packages:
|
||||
'@radix-ui/react-context-menu@2.2.6':
|
||||
resolution: {integrity: sha512-aUP99QZ3VU84NPsHeaFt4cQUNgJqFsLLOt/RbbWXszZ6MP0DpDyjkFZORr4RpAEx3sUBk+Kc8h13yGtC5Qw8dg==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
react: 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
@@ -4070,7 +4070,7 @@ packages:
|
||||
'@radix-ui/react-context@1.1.1':
|
||||
resolution: {integrity: sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q==}
|
||||
peerDependencies:
|
||||
'@types/react': npm:@types/react@^18.3.12
|
||||
'@types/react': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
@@ -4101,8 +4101,8 @@ packages:
|
||||
'@radix-ui/react-dismissable-layer@1.1.5':
|
||||
resolution: {integrity: sha512-E4TywXY6UsXNRhFrECa5HAvE5/4BFcGyfTyK36gP+pAW1ed7UTK4vKwdr53gAJYwqbfCWC6ATvJa3J3R/9+Qrg==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4127,7 +4127,7 @@ packages:
|
||||
'@radix-ui/react-focus-guards@1.1.1':
|
||||
resolution: {integrity: sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==}
|
||||
peerDependencies:
|
||||
'@types/react': npm:@types/react@^18.3.12
|
||||
'@types/react': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
@@ -4184,8 +4184,8 @@ packages:
|
||||
'@radix-ui/react-menu@2.1.6':
|
||||
resolution: {integrity: sha512-tBBb5CXDJW3t2mo9WlO7r6GTmWV0F0uzHZVFmlRmYpiSK1CDU5IKojP1pm7oknpBOrFZx/YgBRW9oorPO2S/Lg==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4223,8 +4223,8 @@ packages:
|
||||
'@radix-ui/react-popper@1.2.2':
|
||||
resolution: {integrity: sha512-Rvqc3nOpwseCyj/rgjlJDYAgyfw7OC1tTkKn2ivhaMGcYt8FSBlahHOZak2i3QwkRXUXgGgzeEe2RuqeEHuHgA==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4236,8 +4236,8 @@ packages:
|
||||
'@radix-ui/react-portal@1.1.4':
|
||||
resolution: {integrity: sha512-sn2O9k1rPFYVyKd5LAJfo96JlSGVFpa1fS6UuBJfrZadudiw5tAmru+n1x7aMRQ84qDM71Zh1+SzK5QwU0tJfA==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4288,8 +4288,8 @@ packages:
|
||||
'@radix-ui/react-roving-focus@1.1.2':
|
||||
resolution: {integrity: sha512-zgMQWkNO169GtGqRvYrzb0Zf8NhMHS2DuEB/TiEmVnpr5OqPU3i8lfbxaAmC2J/KYuIQxyoQQ6DxepyXp61/xw==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4406,7 +4406,7 @@ packages:
|
||||
'@radix-ui/react-use-callback-ref@1.1.0':
|
||||
resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==}
|
||||
peerDependencies:
|
||||
'@types/react': npm:@types/react@^18.3.12
|
||||
'@types/react': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
@@ -4415,7 +4415,7 @@ packages:
|
||||
'@radix-ui/react-use-controllable-state@1.1.0':
|
||||
resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==}
|
||||
peerDependencies:
|
||||
'@types/react': npm:@types/react@^18.3.12
|
||||
'@types/react': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
@@ -4469,8 +4469,8 @@ packages:
|
||||
'@radix-ui/react-visually-hidden@1.1.2':
|
||||
resolution: {integrity: sha512-1SzA4ns2M1aRlvxErqhLHsBHoS5eI5UUcI2awAMgGUp4LoaoWOKYmvqDY2s/tltuPkh3Yk77YF/r3IRj+Amx4Q==}
|
||||
peerDependencies:
|
||||
'@types/react': 18.3.12
|
||||
'@types/react-dom': 18.3.1
|
||||
'@types/react': '*'
|
||||
'@types/react-dom': '*'
|
||||
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
|
||||
peerDependenciesMeta:
|
||||
@@ -4552,7 +4552,7 @@ packages:
|
||||
'@react-native-menu/menu@1.2.2':
|
||||
resolution: {integrity: sha512-Uk65PAhwNkCVBAqJu5t2H9biV+m0JLwJc7m3v2X2A/W8SFJmUqYabBsLH4fOWKI3a7kkR9QDT6HruliIKSfM8w==}
|
||||
peerDependencies:
|
||||
react: 18.3.1
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
|
||||
'@react-native-picker/picker@2.11.0':
|
||||
@@ -5263,7 +5263,7 @@ packages:
|
||||
'@tanstack/react-query@5.66.7':
|
||||
resolution: {integrity: sha512-qd3q/tUpF2K1xItfPZddk1k/8pSXnovg41XyCqJgPoyYEirMBtB0sVEVVQ/CsAOngzgWtBPXimVf4q4kM9uO6A==}
|
||||
peerDependencies:
|
||||
react: 18.3.1
|
||||
react: ^18 || ^19
|
||||
|
||||
'@tanstack/react-virtual@3.13.0':
|
||||
resolution: {integrity: sha512-CchF0NlLIowiM2GxtsoKBkXA4uqSnY2KvnXo+kyUFD4a4ll6+J0qzoRsUPMwXV/H26lRsxgJIr/YmjYum2oEjg==}
|
||||
@@ -8486,7 +8486,7 @@ packages:
|
||||
resolution: {integrity: sha512-LUnfrddmee1xLOkyG2NN1l9xQbtvMX3fbM1brEGHg0SKSndvjod3FQdhTzZEYAariqW2RSxQR8v1IsheIoLQXg==}
|
||||
peerDependencies:
|
||||
expo: '*'
|
||||
react-native: '*'
|
||||
react-native: npm:react-native@0.77.0
|
||||
|
||||
expo-module-scripts@4.0.4:
|
||||
resolution: {integrity: sha512-ytFufVi7HTFLxxf8fbtz3DJuegq3489WPk9pz8Yqm3tYfZ+6/yufPYxLvk6N8b4yBW05oNr/Cqp7MWLpm0xPcA==}
|
||||
@@ -12422,7 +12422,7 @@ packages:
|
||||
resolution: {integrity: sha512-sc5qgX4YtM6IxjtosjgQLdsal120MvU+YWs0F2MdgQWijps22AXLDCUoBnZZ8vxVhVyJ2WnnIPrmtVBvVJjSuQ==}
|
||||
engines: {node: '>= 18.0.0'}
|
||||
peerDependencies:
|
||||
react: 18.3.1
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
react-native-gesture-handler: '>=2.0.0'
|
||||
react-native-reanimated: '>=3.0.0'
|
||||
@@ -12536,7 +12536,7 @@ packages:
|
||||
resolution: {integrity: sha512-9PPREdwH3tMR8otUK1voiFw9AFNtC37Del2fZwbCMBKjOyClC+f3Fwp7KqUouP0A5c3zjEc3T8TetBGQGPQE9A==}
|
||||
peerDependencies:
|
||||
react: '*'
|
||||
react-native: npm:react-native@0.77.0
|
||||
react-native: '*'
|
||||
react-native-gesture-handler: '*'
|
||||
react-native-reanimated: '*'
|
||||
|
||||
@@ -12550,7 +12550,7 @@ packages:
|
||||
resolution: {integrity: sha512-E5N/eK/+HtAVJUAzXpm1cWz8ROheV9jb0TI6h2bM+333U+DWibTTnT2T1122FkCoXLXIYavtm2FR2if+5jH8cA==}
|
||||
peerDependencies:
|
||||
react: '>=16.8.6'
|
||||
react-native: npm:react-native@0.77.0
|
||||
react-native: '>=0.60.0-rc.2'
|
||||
react-native-windows: '>=0.63.0'
|
||||
shaka-player: ^4.7.9
|
||||
peerDependenciesMeta:
|
||||
@@ -12564,13 +12564,13 @@ packages:
|
||||
peerDependencies:
|
||||
nativewind: '>=4.1.0'
|
||||
react: '>=18.0.0'
|
||||
react-native: '>=0.76.0'
|
||||
react-native: npm:react-native@0.77.0
|
||||
tailwindcss: '>=3.0.0'
|
||||
|
||||
react-native-volume-manager@2.0.8:
|
||||
resolution: {integrity: sha512-aZM47/mYkdQ4CbXpKYO6Ajiczv7fxbQXZ9c0H8gRuQUaS3OCz/MZABer6o9aDWq0KMNsQ7q7GVFLRPnSSeeMmw==}
|
||||
peerDependencies:
|
||||
react: 18.3.1
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
|
||||
react-native-web@0.19.13:
|
||||
|
||||
Reference in New Issue
Block a user