This commit is contained in:
Ren Amamiya 2023-07-25 08:09:26 +07:00
parent d30be10568
commit a1b93cdb72
11 changed files with 361 additions and 362 deletions

View File

@ -37,13 +37,13 @@
"cheerio": "1.0.0-rc.12",
"dayjs": "^1.11.9",
"destr": "^1.2.2",
"framer-motion": "^10.13.0",
"framer-motion": "^10.13.1",
"get-urls": "^11.0.0",
"html-to-text": "^9.0.5",
"immer": "^10.0.2",
"light-bolt11-decoder": "^3.0.0",
"nostr-fetch": "^0.12.1",
"nostr-tools": "^1.13.0",
"nostr-fetch": "^0.12.2",
"nostr-tools": "^1.13.1",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@ -53,7 +53,7 @@
"react-player": "^2.12.0",
"react-router-dom": "^6.14.2",
"react-string-replace": "^1.1.1",
"react-virtuoso": "^4.4.1",
"react-virtuoso": "^4.4.2",
"remark-gfm": "^3.0.1",
"tailwind-merge": "^1.14.0",
"tauri-plugin-autostart-api": "github:tauri-apps/tauri-plugin-autostart#v1",
@ -68,7 +68,7 @@
"@tauri-apps/cli": "^1.4.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/node": "^18.17.0",
"@types/react": "^18.2.15",
"@types/react": "^18.2.16",
"@types/react-dom": "^18.2.7",
"@types/youtube-player": "^5.5.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
@ -91,7 +91,7 @@
"prop-types": "^15.8.1",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.5",
"vite": "^4.4.6",
"vite": "^4.4.7",
"vite-plugin-top-level-await": "^1.3.1",
"vite-tsconfig-paths": "^4.2.0"
}

File diff suppressed because it is too large Load Diff

34
src-tauri/Cargo.lock generated
View File

@ -2563,9 +2563,9 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
[[package]]
name = "mac-notification-sys"
version = "0.5.6"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e72d50edb17756489e79d52eb146927bec8eba9dd48faadf9ef08bca3791ad5"
checksum = "abc434554ad0e640d772f7f262aa28e61d485212533d3673abe5f3d1729bd42a"
dependencies = [
"cc",
"dirs-next",
@ -3475,9 +3475,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.31"
version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0"
checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965"
dependencies = [
"proc-macro2",
]
@ -4019,18 +4019,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.174"
version = "1.0.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1"
checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.174"
version = "1.0.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e"
checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4"
dependencies = [
"proc-macro2",
"quote",
@ -4215,9 +4215,9 @@ dependencies = [
[[package]]
name = "simd-adler32"
version = "0.3.5"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "siphasher"
@ -4930,7 +4930,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-autostart"
version = "0.0.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#81fb450c391e88f400f2824e9f3017bc72e92744"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#92514cca47bdc361257b623f6369ecf826e3ef4f"
dependencies = [
"auto-launch",
"log",
@ -4943,7 +4943,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "0.0.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#81fb450c391e88f400f2824e9f3017bc72e92744"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#92514cca47bdc361257b623f6369ecf826e3ef4f"
dependencies = [
"log",
"serde",
@ -4957,7 +4957,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-sql"
version = "0.0.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#81fb450c391e88f400f2824e9f3017bc72e92744"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#92514cca47bdc361257b623f6369ecf826e3ef4f"
dependencies = [
"futures-core",
"log",
@ -4973,7 +4973,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-stronghold"
version = "0.0.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#81fb450c391e88f400f2824e9f3017bc72e92744"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#92514cca47bdc361257b623f6369ecf826e3ef4f"
dependencies = [
"hex",
"iota-crypto 0.23.0",
@ -4989,7 +4989,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-upload"
version = "0.0.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#81fb450c391e88f400f2824e9f3017bc72e92744"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#92514cca47bdc361257b623f6369ecf826e3ef4f"
dependencies = [
"futures-util",
"log",
@ -6126,9 +6126,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winnow"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7"
checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11"
dependencies = [
"memchr",
]

View File

@ -0,0 +1,6 @@
-- Add migration script here
UPDATE settings
SET
value = '["wss://relayable.org","wss://relay.damus.io","wss://relay.nostr.band/all","wss://nostr.mutinywallet.com"]'
WHERE
key = 'relays';

View File

@ -113,6 +113,12 @@ fn main() {
sql: include_str!("../migrations/20230718072634_clean_up_old_tables.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230725010250,
description: "update default relays",
sql: include_str!("../migrations/20230725010250_update_default_relays.sql"),
kind: MigrationKind::Up,
},
],
)
.build(),

View File

@ -70,7 +70,7 @@ export function FollowingBlock() {
if (root || reply) {
return (
<div
key={(root || reply) + (note.event_id || note.id)}
key={(root || reply) + (note.event_id || note.id) + index}
data-index={index}
ref={rowVirtualizer.measureElement}
>
@ -80,7 +80,7 @@ export function FollowingBlock() {
} else {
return (
<div
key={note.event_id || note.id}
key={(note.event_id || note.id) + index}
data-index={index}
ref={rowVirtualizer.measureElement}
>
@ -92,7 +92,7 @@ export function FollowingBlock() {
case 6:
return (
<div
key={note.event_id || note.id}
key={(note.event_id || note.id) + index}
data-index={index}
ref={rowVirtualizer.measureElement}
>
@ -102,7 +102,7 @@ export function FollowingBlock() {
case 1063:
return (
<div
key={note.event_id || note.id}
key={(note.event_id || note.id) + index}
data-index={index}
ref={rowVirtualizer.measureElement}
>
@ -112,7 +112,7 @@ export function FollowingBlock() {
default:
return (
<div
key={note.event_id || note.id}
key={(note.event_id || note.id) + index}
data-index={index}
ref={rowVirtualizer.measureElement}
>

View File

@ -15,10 +15,7 @@ button {
}
.markdown {
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
@apply prose prose-zinc max-w-none select-text dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2;
@apply prose prose-zinc max-w-none select-text hyphens-auto dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2;
}
.ProseMirror p.is-empty::before {

View File

@ -10,18 +10,9 @@ import {
VideoPreview,
} from '@shared/notes';
export function NoteContent({
content,
}: {
content: {
original: string;
parsed: string;
notes: string[];
images: string[];
videos: string[];
links: string[];
};
}) {
import { Content } from '@utils/types';
export function NoteContent({ content }: { content: Content }) {
return (
<>
<ReactMarkdown

View File

@ -25,7 +25,7 @@ export function ThreadUser({ pubkey, time }: { pubkey: string; time: number }) {
/>
<div className="lex flex-1 items-baseline justify-between">
<div className="inline-flex w-full items-center justify-between">
<h5 className="truncate font-semibold leading-none text-zinc-100">
<h5 className="max-w-[15rem] truncate font-semibold leading-none text-zinc-100">
{user?.nip05?.toLowerCase() || user?.name || user?.display_name}
</h5>
<button

View File

@ -21,7 +21,7 @@ export function useEvent(id: string, fallback?: string) {
embed.pubkey,
embed.kind,
embed.tags,
embed.content,
embed.content as unknown as string,
embed.created_at
);
return embed;
@ -42,7 +42,7 @@ export function useEvent(id: string, fallback?: string) {
// @ts-ignore
event['content'] = parser(event);
}
return event as LumeEvent;
return event as unknown as LumeEvent;
} else {
throw new Error('Event not found');
}

10
src/utils/types.d.ts vendored
View File

@ -1,9 +1,19 @@
import { NDKEvent, NDKUserProfile } from '@nostr-dev-kit/ndk';
export interface Content {
original: string;
parsed: string;
notes: string[];
images: string[];
videos: string[];
links: string[];
}
export interface LumeEvent extends NDKEvent {
event_id?: string;
parent_id?: string;
replies?: LumeEvent[];
content: Content;
}
export interface Account {