diff --git a/package.json b/package.json index c91e5a98..4bb31a7f 100644 --- a/package.json +++ b/package.json @@ -71,8 +71,10 @@ "react-hook-form": "^7.47.0", "react-markdown": "^8.0.7", "react-router-dom": "^6.16.0", + "react-string-replace": "^1.1.1", "reactflow": "^11.9.2", "remark-gfm": "^3.0.1", + "tauri-controls": "^0.2.0", "tippy.js": "^6.3.7", "virtua": "^0.9.1", "zustand": "^4.4.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f45141d3..46e8b929 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,12 +164,18 @@ dependencies: react-router-dom: specifier: ^6.16.0 version: 6.16.0(react-dom@18.2.0)(react@18.2.0) + react-string-replace: + specifier: ^1.1.1 + version: 1.1.1 reactflow: specifier: ^11.9.2 version: 11.9.2(@types/react@18.2.24)(react-dom@18.2.0)(react@18.2.0) remark-gfm: specifier: ^3.0.1 version: 3.0.1 + tauri-controls: + specifier: ^0.2.0 + version: 0.2.0(@tauri-apps/plugin-os@2.0.0-alpha.2)(@tauri-apps/plugin-window@2.0.0-alpha.1)(clsx@2.0.0)(react-dom@18.2.0)(react@18.2.0)(tailwind-merge@1.14.0) tippy.js: specifier: ^6.3.7 version: 6.3.7 @@ -3153,7 +3159,6 @@ packages: /clsx@2.0.0: resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} engines: {node: '>=6'} - dev: true /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -5804,6 +5809,11 @@ packages: react: 18.2.0 dev: false + /react-string-replace@1.1.1: + resolution: {integrity: sha512-26TUbLzLfHQ5jO5N7y3Mx88eeKo0Ml0UjCQuX4BMfOd/JX+enQqlKpL1CZnmjeBRvQE8TR+ds9j1rqx9CxhKHQ==} + engines: {node: '>=0.12.0'} + dev: false + /react-style-singleton@2.2.1(@types/react@18.2.24)(react@18.2.0): resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} @@ -6211,7 +6221,6 @@ packages: /tailwind-merge@1.14.0: resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==} - dev: true /tailwindcss@3.3.3: resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} @@ -6244,6 +6253,25 @@ packages: - ts-node dev: true + /tauri-controls@0.2.0(@tauri-apps/plugin-os@2.0.0-alpha.2)(@tauri-apps/plugin-window@2.0.0-alpha.1)(clsx@2.0.0)(react-dom@18.2.0)(react@18.2.0)(tailwind-merge@1.14.0): + resolution: {integrity: sha512-/IDXLhcqGRjNN7QKfzgyr2y4QfnWT9MSIdqxrjH2oElXyngSo/cQltTb8LT6h/sH/7gRiSQMvQBEmavfn9Hk0w==} + peerDependencies: + '@tauri-apps/plugin-os': 2.0.0-alpha.2 + '@tauri-apps/plugin-window': 2.0.0-alpha.1 + clsx: ^2.0.0 + react: ^18.2.0 + react-dom: ^18.2.0 + tailwind-merge: ^1.14.0 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.8 + '@tauri-apps/plugin-os': 2.0.0-alpha.2 + '@tauri-apps/plugin-window': 2.0.0-alpha.1 + clsx: 2.0.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tailwind-merge: 1.14.0 + dev: false + /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true diff --git a/public/lockscreen/1.png b/public/lockscreen/1.png new file mode 100644 index 00000000..30dd8f4b Binary files /dev/null and b/public/lockscreen/1.png differ diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 41eb03d0..19bd3611 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -17,6 +17,7 @@ "height": 800, "minWidth": 1080, "minHeight": 800, + "decorations": false, "resizable": true, "theme": "Dark", "title": "Lume", diff --git a/src/app/auth/unlock.tsx b/src/app/auth/unlock.tsx index 616a3e2d..2c1657ae 100644 --- a/src/app/auth/unlock.tsx +++ b/src/app/auth/unlock.tsx @@ -83,44 +83,37 @@ export function UnlockScreen() { return (
-
-

- Enter password to unlock -

+
+
-
-
-
- -
-
- - -
+ +
+ +
-
- - {errors.password &&

{errors.password.message}

} -
+
-
-
-
-

- Forgot password? -

-
-
-
- - Reset password if you still have a private key - - -
-
diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx index 9a5a6533..43897327 100644 --- a/src/app/space/index.tsx +++ b/src/app/space/index.tsx @@ -84,7 +84,7 @@ export function SpaceScreen() { }, [fetchWidgets]); return ( -
+
{!widgets ? (
diff --git a/src/app/splash.tsx b/src/app/splash.tsx index 7909d697..a22edb20 100644 --- a/src/app/splash.tsx +++ b/src/app/splash.tsx @@ -50,12 +50,12 @@ export function SplashScreen() { }, [ndk, db.account]); return ( -
-
+
+
- -

+ +

{!ndk ? 'Connecting...' : 'Syncing...'}

diff --git a/src/shared/composer/modal.tsx b/src/shared/composer/modal.tsx index 41d9c99f..be1d78c1 100644 --- a/src/shared/composer/modal.tsx +++ b/src/shared/composer/modal.tsx @@ -28,10 +28,10 @@ export function ComposerModal() { diff --git a/src/shared/layouts/app.tsx b/src/shared/layouts/app.tsx index 32db40e9..b1ec551d 100644 --- a/src/shared/layouts/app.tsx +++ b/src/shared/layouts/app.tsx @@ -1,20 +1,24 @@ import { Outlet, ScrollRestoration } from 'react-router-dom'; +import { WindowTitlebar } from 'tauri-controls'; import { Navigation } from '@shared/navigation'; export function AppLayout() { return ( -
-
- -
-
- - { - return location.pathname; - }} - /> +
+ +
+
+ +
+
+ + { + return location.pathname; + }} + /> +
); diff --git a/src/shared/layouts/auth.tsx b/src/shared/layouts/auth.tsx index d1bb375b..49a3a54e 100644 --- a/src/shared/layouts/auth.tsx +++ b/src/shared/layouts/auth.tsx @@ -1,10 +1,13 @@ import { Outlet } from 'react-router-dom'; +import { WindowTitlebar } from 'tauri-controls'; export function AuthLayout() { return ( -
-
- +
+ +
+ +
); } diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx index f703aa3a..f6c994ff 100644 --- a/src/shared/navigation.tsx +++ b/src/shared/navigation.tsx @@ -20,28 +20,23 @@ export function Navigation() { const navigate = useNavigate(); return ( -
+
-
+
@@ -60,8 +55,8 @@ export function Navigation() { twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 px-3 font-medium', isActive - ? 'border-fuchsia-500 bg-white/5 text-white' - : 'border-transparent text-white/70' + ? 'border-interor-600 bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100' + : 'border-transparent text-zinc-500 dark:text-zinc-500' ) } > @@ -77,8 +72,8 @@ export function Navigation() { twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 px-3 font-medium', isActive - ? 'border-fuchsia-500 bg-white/5 text-white' - : 'border-transparent text-white/70' + ? 'border-interor-600 bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100' + : 'border-transparent text-zinc-500 dark:text-zinc-500' ) } > @@ -94,8 +89,8 @@ export function Navigation() { twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 px-3 font-medium', isActive - ? 'border-fuchsia-500 bg-white/5 text-white' - : 'border-transparent text-white/70' + ? 'border-interor-600 bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100' + : 'border-transparent text-zinc-500 dark:text-zinc-500' ) } > @@ -111,8 +106,8 @@ export function Navigation() { twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 px-3 font-medium', isActive - ? 'border-fuchsia-500 bg-white/5 text-white' - : 'border-transparent text-white/70' + ? 'border-interor-600 bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100' + : 'border-transparent text-zinc-500 dark:text-zinc-500' ) } > @@ -128,8 +123,8 @@ export function Navigation() { twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 px-3 font-medium', isActive - ? 'border-fuchsia-500 bg-white/5 text-white' - : 'border-transparent text-white/70' + ? 'border-interor-600 bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100' + : 'border-transparent text-zinc-500 dark:text-zinc-500' ) } > diff --git a/src/shared/notes/child.tsx b/src/shared/notes/child.tsx index f78a25f1..9800d5ed 100644 --- a/src/shared/notes/child.tsx +++ b/src/shared/notes/child.tsx @@ -81,7 +81,7 @@ export function ChildNote({ id, root }: { id: string; root?: string }) {
-
+
{renderKind(data)} diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index fbeb7dab..01dbd0ee 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -65,13 +65,13 @@ export function Repost({
-
+
{renderKind(embedEvent)} @@ -104,7 +104,7 @@ export function Repost({
@@ -116,7 +116,7 @@ export function Repost({ Lume (System)
-
+
@@ -142,13 +142,13 @@ export function Repost({
-
+
{renderKind(data)} diff --git a/src/shared/notes/kinds/text.tsx b/src/shared/notes/kinds/text.tsx index 6f2a3dab..2008e70f 100644 --- a/src/shared/notes/kinds/text.tsx +++ b/src/shared/notes/kinds/text.tsx @@ -36,14 +36,14 @@ export function TextNote(props: { content?: string }) { return (
{ const cleanURL = new URL(href); cleanURL.search = ''; return ( - + {cleanURL.hostname + cleanURL.pathname} ); diff --git a/src/shared/notes/mentions/hashtag.tsx b/src/shared/notes/mentions/hashtag.tsx index 2eb64726..6606be3d 100644 --- a/src/shared/notes/mentions/hashtag.tsx +++ b/src/shared/notes/mentions/hashtag.tsx @@ -24,7 +24,7 @@ export function Hashtag({ tag }: { tag: string }) { content: tag.replace('#', ''), }) } - className="break-all text-fuchsia-400 hover:text-fuchsia-500" + className="break-all text-interor-500 hover:text-interor-600" > {tag} diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index 2bf3e6ed..241e9d56 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -30,7 +30,7 @@ export const MentionUser = memo(function MentionUser({ pubkey }: { pubkey: strin content: pubkey, }) } - className="break-words text-fuchsia-400 hover:text-fuchsia-500" + className="break-words text-interor-500 hover:text-interor-600" > {'@' + (user?.name || diff --git a/src/shared/notes/preview/image.tsx b/src/shared/notes/preview/image.tsx index 9d9088ef..01a7647d 100644 --- a/src/shared/notes/preview/image.tsx +++ b/src/shared/notes/preview/image.tsx @@ -17,7 +17,7 @@ export function ImagePreview({ urls, truncate }: { urls: string[]; truncate?: bo
{url} diff --git a/src/shared/notes/wrapper.tsx b/src/shared/notes/wrapper.tsx index 5fb5b38f..9a43ebdf 100644 --- a/src/shared/notes/wrapper.tsx +++ b/src/shared/notes/wrapper.tsx @@ -24,14 +24,14 @@ export function NoteWrapper({
{root && }
{reply && }
-
+
{cloneElement( diff --git a/src/shared/titleBar.tsx b/src/shared/titleBar.tsx index 1871b59f..885c0688 100644 --- a/src/shared/titleBar.tsx +++ b/src/shared/titleBar.tsx @@ -14,14 +14,14 @@ export function TitleBar({ id, title }: { id?: string; title: string }) { className="flex h-11 w-full shrink-0 items-center justify-between overflow-hidden px-3" >
-

{title}

+

{title}

{id ? ( ) : (
diff --git a/src/utils/parser.ts b/src/utils/parser.ts index 9419ac1a..6f798966 100644 --- a/src/utils/parser.ts +++ b/src/utils/parser.ts @@ -1,5 +1,5 @@ import { nip19 } from 'nostr-tools'; -import { EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19'; +import { AddressPointer, EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19'; import { RichContent } from '@utils/types'; @@ -84,7 +84,7 @@ export function parser(eventContent: string) { } // nostr account references - if (word.startsWith('nostr:note1') || word.startsWith('noté')) { + if (word.startsWith('nostr:note1') || word.startsWith('note1')) { const note = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, ''); content.notes.push(nip19.decode(note).data as string); return word.replace(word, ''); @@ -98,6 +98,15 @@ export function parser(eventContent: string) { return word.replace(word, ''); } + // nostr address references + if (word.startsWith('nostr:naddr1') || word.startsWith('naddr1')) { + const naddr = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, ''); + const decoded = nip19.decode(naddr).data as AddressPointer; + // TODO + console.log('todo: ', decoded); + return word.replace(word, ''); + } + // normal word return word; }); diff --git a/tailwind.config.js b/tailwind.config.js index e9afbd89..c1a7e589 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,12 +1,28 @@ /** @type {import('tailwindcss').Config} */ -const defaultTheme = require('tailwindcss/defaultTheme') +const defaultTheme = require('tailwindcss/defaultTheme'); module.exports = { content: ['./src/**/*.{js,ts,jsx,tsx}', 'index.html'], darkMode: 'class', theme: { extend: { + colors: { + // 'international orange' + interor: { + 50: 'hsl(32, 100%, 96%)', + 100: 'hsl(34, 100%, 91%)', + 200: 'hsl(31, 100%, 82%)', + 300: 'hsl(30, 100%, 71%)', + 400: 'hsl(26, 100%, 60%)', + 500: 'hsl(23, 100%, 52%)', + 600: 'hsl(19, 100%, 50%)', + 700: 'hsl(15, 98%, 40%)', + 800: 'hsl(13, 87%, 34%)', + 900: 'hsl(13, 83%, 28%)', + 950: 'hsl(11, 89%, 15%)', + }, + }, fontFamily: { sans: ['Inter Variable', ...defaultTheme.fontFamily.sans], },