diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0ada66f1..00000000 --- a/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "react-refresh"], - "extends": [ - "plugin:react/recommended", - "plugin:react/jsx-runtime", - "plugin:react-hooks/recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-explicit-any": "warn", - "react-refresh/only-export-components": "error", - "react/no-unknown-property": ["error", { "ignore": ["fetchpriority"] }] - }, - "ignorePatterns": ["dist", "**/*.js", "**/*.json", "node_modules"] -} diff --git a/global.d.ts b/global.d.ts deleted file mode 100644 index 94a6189c..00000000 --- a/global.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AriaAttributes, DOMAttributes } from 'react'; - -declare module 'react' { - interface HTMLAttributes extends AriaAttributes, DOMAttributes { - fetchpriority?: 'high' | 'low' | 'auto'; - } -} diff --git a/index.html b/index.html new file mode 100644 index 00000000..ad4041da --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + Lume + + +
+ + + diff --git a/package.json b/package.json index 738dacda..b45805a9 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,12 @@ "@floating-ui/react": "^0.23.1", "@headlessui/react": "^1.7.15", "@nostr-dev-kit/ndk": "^0.5.13", + "@tanstack/react-query": "^4.29.15", "@tanstack/react-virtual": "3.0.0-beta.54", "@tauri-apps/api": "^1.4.0", - "@vidstack/react": "^0.4.5", "dayjs": "^1.11.8", "destr": "^1.2.2", + "framer-motion": "^10.12.17", "get-urls": "^11.0.0", "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", @@ -30,12 +31,12 @@ "react-hook-form": "^7.45.0", "react-hotkeys-hook": "^4.4.0", "react-resizable-panels": "^0.0.48", + "react-router-dom": "^6.14.0", "react-string-replace": "^1.1.1", - "react-virtuoso": "^4.3.10", + "react-virtuoso": "^4.3.11", "slate": "^0.94.1", "slate-history": "^0.93.0", "slate-react": "^0.94.2", - "swr": "^2.1.5", "tailwind-merge": "^1.13.2", "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql", "vidstack": "^0.4.5", @@ -45,7 +46,7 @@ "@tailwindcss/typography": "^0.5.9", "@tauri-apps/cli": "^1.4.0", "@types/node": "^18.16.18", - "@types/react": "^18.2.13", + "@types/react": "^18.2.14", "@types/react-dom": "^18.2.6", "@types/youtube-player": "^5.5.7", "@vitejs/plugin-react-swc": "^3.3.2", @@ -61,7 +62,6 @@ "tailwindcss": "^3.3.2", "typescript": "^4.9.5", "vite": "^4.3.9", - "vite-plugin-ssr": "^0.4.131", "vite-plugin-top-level-await": "^1.3.1", "vite-tsconfig-paths": "^4.2.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f11c001b..692ef724 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,21 +10,24 @@ dependencies: '@nostr-dev-kit/ndk': specifier: ^0.5.13 version: 0.5.13(typescript@4.9.5) + '@tanstack/react-query': + specifier: ^4.29.15 + version: 4.29.15(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-virtual': specifier: 3.0.0-beta.54 version: 3.0.0-beta.54(react@18.2.0) '@tauri-apps/api': specifier: ^1.4.0 version: 1.4.0 - '@vidstack/react': - specifier: ^0.4.5 - version: 0.4.5(@types/react@18.2.13)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5) dayjs: specifier: ^1.11.8 version: 1.11.8 destr: specifier: ^1.2.2 version: 1.2.2 + framer-motion: + specifier: ^10.12.17 + version: 10.12.17(react-dom@18.2.0)(react@18.2.0) get-urls: specifier: ^11.0.0 version: 11.0.0 @@ -52,12 +55,15 @@ dependencies: react-resizable-panels: specifier: ^0.0.48 version: 0.0.48(react-dom@18.2.0)(react@18.2.0) + react-router-dom: + specifier: ^6.14.0 + version: 6.14.0(react-dom@18.2.0)(react@18.2.0) react-string-replace: specifier: ^1.1.1 version: 1.1.1 react-virtuoso: - specifier: ^4.3.10 - version: 4.3.10(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.3.11 + version: 4.3.11(react-dom@18.2.0)(react@18.2.0) slate: specifier: ^0.94.1 version: 0.94.1 @@ -67,9 +73,6 @@ dependencies: slate-react: specifier: ^0.94.2 version: 0.94.2(react-dom@18.2.0)(react@18.2.0)(slate@0.94.1) - swr: - specifier: ^2.1.5 - version: 2.1.5(react@18.2.0) tailwind-merge: specifier: ^1.13.2 version: 1.13.2 @@ -94,8 +97,8 @@ devDependencies: specifier: ^18.16.18 version: 18.16.18 '@types/react': - specifier: ^18.2.13 - version: 18.2.13 + specifier: ^18.2.14 + version: 18.2.14 '@types/react-dom': specifier: ^18.2.6 version: 18.2.6 @@ -141,9 +144,6 @@ devDependencies: vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.18) - vite-plugin-ssr: - specifier: ^0.4.131 - version: 0.4.131(vite@4.3.9) vite-plugin-top-level-await: specifier: ^1.3.1 version: 1.3.1(vite@4.3.9) @@ -179,23 +179,18 @@ packages: js-tokens: 4.0.0 dev: false - /@brillout/import@0.2.3: - resolution: {integrity: sha512-1T8WlD75eeFSMrptGy8jiLHmfHgMmSjWvLOIUvHmSVZt+6k0eQqYUoK4KbmE4T9pVLIfxvZSOm2D68VEqKRHRw==} - dev: true - - /@brillout/json-serializer@0.5.3: - resolution: {integrity: sha512-IxlOMD5gOM0WfFGdeR98jHKiC82Ad1tUnSjvLS5jnRkfMEKBI+YzHA32Umw8W3Ccp5N4fNEX229BW6RaRpxRWQ==} - dev: true - - /@brillout/picocolors@1.0.4: - resolution: {integrity: sha512-rhZBVyrRCb53T9xIGoEjZQ6O4Um3XQWcQ1z2VL2eBQBtJYCsABUUNE/isqbnts3XD1sAkisDF2L3OjJeIgrznQ==} - dev: true - - /@brillout/vite-plugin-import-build@0.2.18: - resolution: {integrity: sha512-sedZNrqIboHCeSnN7hwo34xRyP8egfMHcifixQ2YGNnQVb93884drTVE3b0vlSGz7LWumVDochKuHdWQljup9A==} + /@emotion/is-prop-valid@0.8.8: + resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} + requiresBuild: true dependencies: - '@brillout/import': 0.2.3 - dev: true + '@emotion/memoize': 0.7.4 + dev: false + optional: true + + /@emotion/memoize@0.7.4: + resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} + dev: false + optional: true /@esbuild/android-arm64@0.17.19: resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} @@ -533,8 +528,8 @@ packages: resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} dev: false - /@maverick-js/signals@5.11.1: - resolution: {integrity: sha512-yr6ZIpQxupgbDl6364t1L7bOSJqK2xiwjf8hoxJ632SL+0nBL0bLNCQaiK4GFRQEhYhBwX2yYyA+eKgZLEJ6mg==} + /@maverick-js/signals@5.11.2: + resolution: {integrity: sha512-jKAyNE2O7H+xrigPoqdV0Iq2AeQ6cysfBf/b2jasJ4FfCUKjGyazgtp+pIspTW6skFvpPrvq40Qft+7HuR+Tlg==} dev: false /@noble/curves@1.0.0: @@ -607,7 +602,7 @@ packages: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.5.2 + semver: 7.5.3 dev: false /@pkgjs/parseargs@0.11.0: @@ -617,9 +612,10 @@ packages: dev: false optional: true - /@polka/url@1.0.0-next.21: - resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} - dev: true + /@remix-run/router@1.7.0: + resolution: {integrity: sha512-Eu1V3kz3mV0wUpVTiFHuaT8UD1gj/0VnoFHQYX35xlslQUpe8CuYoKFn9d4WZFHm3yDywz6ALZuGdnUPKrNeAw==} + engines: {node: '>=14'} + dev: false /@rollup/plugin-virtual@3.0.1: resolution: {integrity: sha512-fK8O0IL5+q+GrsMLuACVNk2x21g3yaw+sG2qn16SnUd3IlBsQyvWxLMGHmCmXRMecPjGRSZ/1LmZB4rjQm68og==} @@ -826,6 +822,28 @@ packages: tailwindcss: 3.3.2 dev: true + /@tanstack/query-core@4.29.15: + resolution: {integrity: sha512-Recc1d5rjHesKhzlH3Aw66v+vQxtB9OHEXP/vxgEcEJ0DwEpfe3EQ4id20vuBJHY2XRjfgWGmUs6ZgK6PSsTXA==} + dev: false + + /@tanstack/react-query@4.29.15(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-1zDkv95ljuJ623hhbYU8YIprPW2x6774kh3IQNEuZav62+S+Zr26uUOrE2zGRp9I1uO5Liw/0uYB3dWXQP5+3Q==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.29.15 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + use-sync-external-store: 1.2.0(react@18.2.0) + dev: false + /@tanstack/react-virtual@3.0.0-beta.54(react@18.2.0): resolution: {integrity: sha512-D1mDMf4UPbrtHRZZriCly5bXTBMhylslm4dhcHqTtDJ6brQcgGmk8YD9JdWBGWfGSWPKoh2x1H3e7eh+hgPXtQ==} peerDependencies: @@ -1001,22 +1019,25 @@ packages: /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true /@types/react-dom@18.2.6: resolution: {integrity: sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==} dependencies: - '@types/react': 18.2.13 + '@types/react': 18.2.14 dev: true - /@types/react@18.2.13: - resolution: {integrity: sha512-vJ+zElvi/Zn9cVXB5slX2xL8PZodPCwPRDpittQdw43JR2AJ5k3vKdgJJyneV/cYgIbLQUwXa9JVDvUZXGba+Q==} + /@types/react@18.2.14: + resolution: {integrity: sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 csstype: 3.1.2 + dev: true /@types/scheduler@0.16.3: resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} + dev: true /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} @@ -1047,7 +1068,7 @@ packages: grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 - semver: 7.5.2 + semver: 7.5.3 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: @@ -1121,7 +1142,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.2 + semver: 7.5.3 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: @@ -1142,7 +1163,7 @@ packages: '@typescript-eslint/typescript-estree': 5.60.0(typescript@4.9.5) eslint: 8.43.0 eslint-scope: 5.1.1 - semver: 7.5.2 + semver: 7.5.3 transitivePeerDependencies: - supports-color - typescript @@ -1156,23 +1177,6 @@ packages: eslint-visitor-keys: 3.4.1 dev: false - /@vidstack/react@0.4.5(@types/react@18.2.13)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5): - resolution: {integrity: sha512-spcim3+p1fMzkhHRKn5PS54YQjfThW5M3F2+R8tCT+wpsxbbCDa/TGdLBoIy2oC0LNziPkn0vlBWIZko9F5iig==} - engines: {node: '>=16'} - peerDependencies: - '@types/react': ^18.0.0 - maverick.js: 0.33.1 - media-icons: ^0.4.2 - react: ^18.0.0 - vidstack: 0.4.5 - dependencies: - '@types/react': 18.2.13 - maverick.js: 0.33.1 - media-icons: 0.4.2 - react: 18.2.0 - vidstack: 0.4.5 - dev: false - /@vitejs/plugin-react-swc@3.3.2(vite@4.3.9): resolution: {integrity: sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==} peerDependencies: @@ -1200,6 +1204,7 @@ packages: resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} engines: {node: '>=0.4.0'} hasBin: true + dev: false /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} @@ -1373,7 +1378,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.9 - caniuse-lite: 1.0.30001506 + caniuse-lite: 1.0.30001507 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1417,8 +1422,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001506 - electron-to-chromium: 1.4.435 + caniuse-lite: 1.0.30001507 + electron-to-chromium: 1.4.440 node-releases: 2.0.12 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -1431,18 +1436,13 @@ packages: node-gyp-build: 4.6.0 dev: false - /cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - dev: true - /cacache@17.1.3: resolution: {integrity: sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: '@npmcli/fs': 3.1.0 fs-minipass: 3.0.2 - glob: 10.2.7 + glob: 10.3.0 lru-cache: 7.18.3 minipass: 5.0.0 minipass-collect: 1.0.2 @@ -1485,8 +1485,8 @@ packages: engines: {node: '>=6'} dev: false - /caniuse-lite@1.0.30001506: - resolution: {integrity: sha512-6XNEcpygZMCKaufIcgpQNZNf00GEqc7VQON+9Rd0K1bMYo8xhMZRAo5zpbnbMNizi4YNgIDAFrdykWsvY3H4Hw==} + /caniuse-lite@1.0.30001507: + resolution: {integrity: sha512-SFpUDoSLCaE5XYL2jfqe9ova/pbQHEmbheDf5r4diNwbAgR3qxM9NQtfsiSscjqoya5K7kFcHPUQ+VsUkIJR4A==} dev: true /chalk@2.4.2: @@ -1615,7 +1615,7 @@ packages: resolution: {integrity: sha512-cllzD6IU/mzXBs5OdQVWL3+ne5Elpu3Wdm7h5OldMbGXk76yr9XzHlQXWJ4zfs0ZAibe26rkbs4KvMAJm7fIZA==} engines: {node: '>=14.x'} dependencies: - semver: 7.5.2 + semver: 7.5.3 dev: false /cross-env@7.0.3: @@ -1653,6 +1653,7 @@ packages: /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + dev: true /d@1.0.1: resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} @@ -1783,8 +1784,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.435: - resolution: {integrity: sha512-B0CBWVFhvoQCW/XtjRzgrmqcgVWg6RXOEM/dK59+wFV93BFGR6AeNKc4OyhM+T3IhJaOOG8o/V+33Y2mwJWtzw==} + /electron-to-chromium@1.4.440: + resolution: {integrity: sha512-r6dCgNpRhPwiWlxbHzZQ/d9swfPaEJGi8ekqRBwQYaR3WmA5VkqQfBWSDDjuJU1ntO+W9tHx8OHV/96Q8e0dVw==} dev: true /emoji-regex@8.0.0: @@ -1853,10 +1854,6 @@ packages: which-typed-array: 1.1.9 dev: false - /es-module-lexer@0.10.5: - resolution: {integrity: sha512-+7IwY/kiGAacQfY+YBhKMvEmyAJnw5grTUgjG85Pe7vcUI/6b7pZjZG8nQ7+48YhzEAEqrEgD2dCz/JIK+AYvw==} - dev: true - /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} @@ -2127,7 +2124,7 @@ packages: dependencies: create-esm-loader: 0.2.3 npm-run-all: 4.1.5 - semver: 7.5.2 + semver: 7.5.3 typescript: 5.1.3 dev: false @@ -2299,6 +2296,24 @@ packages: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: true + /framer-motion@10.12.17(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-IR+aAYntsyu6ofyxqQV4QYotmOqzcuKxhqNpfc3DXJjNWOPpOeSyH0A+In3IEBu49Yx/+PNht+YMeZSdCNaYbw==} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + dependencies: + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.5.3 + optionalDependencies: + '@emotion/is-prop-valid': 0.8.8 + dev: false + /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -2400,14 +2415,14 @@ packages: dependencies: is-glob: 4.0.3 - /glob@10.2.7: - resolution: {integrity: sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==} + /glob@10.3.0: + resolution: {integrity: sha512-AQ1/SB9HH0yCx1jXAT4vmCbTOPe5RQ+kCurjbel5xSCGhebumUv+GJZfa1rEqor3XIViqwSEmlkZCQD43RWrBg==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: foreground-child: 3.1.1 jackspeak: 2.2.1 - minimatch: 9.0.1 + minimatch: 9.0.2 minipass: 5.0.0 path-scurry: 1.9.2 dev: false @@ -3078,7 +3093,7 @@ packages: resolution: {integrity: sha512-p8L5V62CV6TmHAngmRAopp231oJKeH77mJja5SsKOfvzrPRoThT/Jo9U0jMRB5iMykqkvyg2J5V5Agn6FPXDWQ==} engines: {node: '>=16'} dependencies: - '@maverick-js/signals': 5.11.1 + '@maverick-js/signals': 5.11.2 type-fest: 3.12.0 dev: false @@ -3150,8 +3165,8 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + /minimatch@9.0.2: + resolution: {integrity: sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 @@ -3235,11 +3250,6 @@ packages: hasBin: true dev: false - /mrmime@1.0.1: - resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} - engines: {node: '>=10'} - dev: true - /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: false @@ -3322,7 +3332,7 @@ packages: nopt: 6.0.0 npmlog: 6.0.2 rimraf: 3.0.2 - semver: 7.5.2 + semver: 7.5.3 tar: 6.1.15 which: 2.0.2 transitivePeerDependencies: @@ -3356,7 +3366,7 @@ packages: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.12.1 - semver: 7.5.2 + semver: 7.5.3 validate-npm-package-license: 3.0.4 dev: false @@ -3817,13 +3827,36 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false + /react-router-dom@6.14.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-YEwlApKwzMMMbGbhh+Q7MsloTldcwMgHxUY/1g0uA62+B1hZo2jsybCWIDCL8zvIDB1FA0pBKY9chHbZHt+2dQ==} + engines: {node: '>=14'} + peerDependencies: + react: '>=16.8' + react-dom: '>=16.8' + dependencies: + '@remix-run/router': 1.7.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-router: 6.14.0(react@18.2.0) + dev: false + + /react-router@6.14.0(react@18.2.0): + resolution: {integrity: sha512-OD+vkrcGbvlwkspUFDgMzsu1RXwdjNh83YgG/28lBnDzgslhCgxIqoExLlxsfTpIygp7fc+Hd3esloNwzkm2xA==} + engines: {node: '>=14'} + peerDependencies: + react: '>=16.8' + dependencies: + '@remix-run/router': 1.7.0 + 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-virtuoso@4.3.10(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-/LDICLCmPRDMOheCKmuHj/U7CGjLT/WtMWZGfOothhhubQeWGbR6mtGyd+uD80Yw/n3ICZtYwERQZnTM8eC0ag==} + /react-virtuoso@4.3.11(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-0YrCvQ5GsIKRcN34GxrzhSJGuMNI+hGxWci5cTVuPQ8QWTEsrKfCyqm7YNBMmV3pu7onG1YVUBo86CyCXdejXg==} engines: {node: '>=10'} peerDependencies: react: '>=16 || >=17 || >= 18' @@ -4018,8 +4051,8 @@ packages: hasBin: true dev: false - /semver@7.5.2: - resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} + /semver@7.5.3: + resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} engines: {node: '>=10'} hasBin: true dependencies: @@ -4072,15 +4105,6 @@ packages: engines: {node: '>=14'} dev: false - /sirv@2.0.3: - resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} - engines: {node: '>= 10'} - dependencies: - '@polka/url': 1.0.0-next.21 - mrmime: 1.0.1 - totalist: 3.0.1 - dev: true - /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -4343,15 +4367,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /swr@2.1.5(react@18.2.0): - resolution: {integrity: sha512-/OhfZMcEpuz77KavXST5q6XE9nrOBOVcBLWjMT+oAE/kQHyE3PASrevXCtQDZ8aamntOfFkbVJp7Il9tNBQWrw==} - peerDependencies: - react: ^16.11.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - use-sync-external-store: 1.2.0(react@18.2.0) - dev: false - /tabbable@6.1.2: resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==} dev: false @@ -4444,11 +4459,6 @@ packages: dependencies: is-number: 7.0.0 - /totalist@3.0.1: - resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} - engines: {node: '>=6'} - dev: true - /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} @@ -4684,30 +4694,6 @@ packages: type-fest: 3.12.0 dev: false - /vite-plugin-ssr@0.4.131(vite@4.3.9): - resolution: {integrity: sha512-M8ay5UuQUEMBHhg87BVhXGjPV+/xO3PZWzZ63S8J8rX4Xv+sQbnDswGYm/TJ+Ga/9NTgrFDAKqUfEb3pEpd+Aw==} - engines: {node: '>=12.19.0'} - hasBin: true - peerDependencies: - react-streaming: '>=0.3.5' - vite: '>=3.1.0' - peerDependenciesMeta: - react-streaming: - optional: true - dependencies: - '@brillout/import': 0.2.3 - '@brillout/json-serializer': 0.5.3 - '@brillout/picocolors': 1.0.4 - '@brillout/vite-plugin-import-build': 0.2.18 - acorn: 8.9.0 - cac: 6.7.14 - es-module-lexer: 0.10.5 - esbuild: 0.17.19 - fast-glob: 3.2.12 - sirv: 2.0.3 - vite: 4.3.9(@types/node@18.16.18) - dev: true - /vite-plugin-top-level-await@1.3.1(vite@4.3.9): resolution: {integrity: sha512-55M1h4NAwkrpxPNOJIBzKZFihqLUzIgnElLSmPNPMR2Fn9+JHKaNg3sVX1Fq+VgvuBksQYxiD3OnwQAUu7kaPQ==} peerDependencies: diff --git a/postcss.config.js b/postcss.config.js index 12a703d9..e873f1a4 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, }; diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 15834a51..5ffdbd74 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -3,7 +3,7 @@ "beforeDevCommand": "pnpm dev", "beforeBuildCommand": "pnpm build", "devPath": "http://localhost:3000", - "distDir": "../dist/client", + "distDir": "../dist", "withGlobalTauri": true }, "package": { diff --git a/src/app.tsx b/src/app.tsx new file mode 100644 index 00000000..a0c89a66 --- /dev/null +++ b/src/app.tsx @@ -0,0 +1,91 @@ +import "./index.css"; +import { AuthCreateScreen } from "@app/auth/create"; +import { CreateStep1Screen } from "@app/auth/create/step-1"; +import { CreateStep2Screen } from "@app/auth/create/step-2"; +import { CreateStep3Screen } from "@app/auth/create/step-3"; +import { CreateStep4Screen } from "@app/auth/create/step-4"; +import { AuthImportScreen } from "@app/auth/import"; +import { ImportStep1Screen } from "@app/auth/import/step-1"; +import { ImportStep2Screen } from "@app/auth/import/step-2"; +import { OnboardingScreen } from "@app/auth/onboarding"; +import { WelcomeScreen } from "@app/auth/welcome"; +import { ChannelScreen } from "@app/channel"; +import { ChatScreen } from "@app/chat"; +import { ErrorScreen } from "@app/error"; +import { Root } from "@app/root"; +import { SpaceScreen } from "@app/space"; +import { TrendingScreen } from "@app/trending"; +import { AppLayout } from "@shared/appLayout"; +import { AuthLayout } from "@shared/authLayout"; +import { Protected } from "@shared/protected"; +import { RelayProvider } from "@shared/relayProvider"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { RouterProvider, createBrowserRouter } from "react-router-dom"; + +const router = createBrowserRouter([ + { + path: "/", + element: ( + + + + ), + errorElement: , + }, + { + path: "/auth", + element: , + children: [ + { path: "welcome", element: }, + { path: "onboarding", element: }, + { + path: "import", + element: , + children: [ + { path: "", element: }, + { path: "step-2", element: }, + ], + }, + { + path: "create", + element: , + children: [ + { path: "", element: }, + { path: "step-2", element: }, + { path: "step-3", element: }, + { path: "step-4", element: }, + ], + }, + ], + }, + { + path: "/app", + element: ( + + + + ), + children: [ + { path: "space", element: }, + { path: "trending", element: }, + { path: "chat/:pubkey", element: }, + { path: "channel/:id", element: }, + ], + }, +]); + +const queryClient = new QueryClient(); + +export default function App() { + return ( + + + Loading..

} + future={{ v7_startTransition: true }} + /> +
+
+ ); +} diff --git a/src/app/auth/_default.page.tsx b/src/app/auth/_default.page.tsx deleted file mode 100644 index bbc30709..00000000 --- a/src/app/auth/_default.page.tsx +++ /dev/null @@ -1 +0,0 @@ -export { LayoutOnboarding as Layout } from "./layout"; diff --git a/src/app/auth/components/user.tsx b/src/app/auth/components/user.tsx index 8847d285..58af589b 100644 --- a/src/app/auth/components/user.tsx +++ b/src/app/auth/components/user.tsx @@ -4,39 +4,39 @@ import { useProfile } from "@utils/hooks/useProfile"; import { shortenKey } from "@utils/shortenKey"; export function User({ pubkey }: { pubkey: string }) { - const { user } = useProfile(pubkey); - - if (!user) { - return ( -
-
-
- - -
-
- ); - } + const { status, user } = useProfile(pubkey); return (
-
- {pubkey} -
-
- - {user.displayName || user.name} - - - {user.nip05?.toLowerCase() || shortenKey(pubkey)} - -
+ {status === "loading" ? ( + <> +
+
+ + +
+ + ) : ( + <> +
+ {pubkey} +
+
+ + {user.displayName || user.name} + + + {user.nip05?.toLowerCase() || shortenKey(pubkey)} + +
+ + )}
); } diff --git a/src/app/auth/create/index.tsx b/src/app/auth/create/index.tsx new file mode 100644 index 00000000..3436c46d --- /dev/null +++ b/src/app/auth/create/index.tsx @@ -0,0 +1,9 @@ +import { Outlet } from "react-router-dom"; + +export function AuthCreateScreen() { + return ( +
+ +
+ ); +} diff --git a/src/app/auth/create/step-1.tsx b/src/app/auth/create/step-1.tsx new file mode 100644 index 00000000..7660929a --- /dev/null +++ b/src/app/auth/create/step-1.tsx @@ -0,0 +1,105 @@ +import { createAccount } from "@libs/storage"; +import { Button } from "@shared/button"; +import { EyeOffIcon, EyeOnIcon } from "@shared/icons"; +import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { generatePrivateKey, getPublicKey, nip19 } from "nostr-tools"; +import { useMemo, useState } from "react"; +import { useNavigate } from "react-router-dom"; + +export function CreateStep1Screen() { + const navigate = useNavigate(); + const queryClient = useQueryClient(); + + const [type, setType] = useState("password"); + + const privkey = useMemo(() => generatePrivateKey(), []); + const pubkey = getPublicKey(privkey); + const npub = nip19.npubEncode(pubkey); + const nsec = nip19.nsecEncode(privkey); + + // toggle private key + const showPrivateKey = () => { + if (type === "password") { + setType("text"); + } else { + setType("password"); + } + }; + + const account = useMutation({ + mutationFn: (data: any) => + createAccount(data.npub, data.pubkey, data.privkey, null, 1), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["currentAccount"] }); + // redirect to next step + navigate("/auth/create/step-2", { replace: true }); + }, + }); + + const submit = async () => { + account.mutate({ + npub, + pubkey, + privkey, + follows: null, + is_active: 1, + }); + }; + + return ( +
+
+

+ Lume is auto-generated key for you +

+
+
+
+ + +
+
+ +
+ + +
+
+ +
+
+ ); +} diff --git a/src/app/auth/create/step-2.tsx b/src/app/auth/create/step-2.tsx new file mode 100644 index 00000000..97e163d5 --- /dev/null +++ b/src/app/auth/create/step-2.tsx @@ -0,0 +1,112 @@ +import { AvatarUploader } from "@shared/avatarUploader"; +import { LoaderIcon } from "@shared/icons"; +import { Image } from "@shared/image"; +import { DEFAULT_AVATAR } from "@stores/constants"; +import { useOnboarding } from "@stores/onboarding"; +import { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { useNavigate } from "react-router-dom"; + +export function CreateStep2Screen() { + const navigate = useNavigate(); + const createProfile = useOnboarding((state: any) => state.createProfile); + + const [image, setImage] = useState(DEFAULT_AVATAR); + const [loading, setLoading] = useState(false); + + const { + register, + handleSubmit, + setValue, + formState: { isDirty, isValid }, + } = useForm(); + + const onSubmit = (data: any) => { + setLoading(true); + try { + const profile = { ...data, name: data.displayName }; + createProfile(profile); + // redirect to step 3 + navigate("/auth/create/step-3"); + } catch { + console.log("error"); + } + }; + + useEffect(() => { + setValue("picture", image); + }, [setValue, image]); + + return ( +
+
+

+ Create your profile +

+
+
+
+ +
+ +
+ avatar +
+ +
+
+
+
+ + +
+
+ +