diff --git a/package.json b/package.json index dbf37b18..65929184 100644 --- a/package.json +++ b/package.json @@ -1,71 +1,68 @@ { - "name": "lume", - "private": true, - "version": "1.0.0", - "scripts": { - "dev": "vite", - "build": "vite build", - "tauri": "tauri", - "add-migrate": "cd src-tauri/ && sqlx migrate add", - "prepare": "husky install" - }, - "lint-staged": { - "**/*.{js,ts,jsx,tsx}": "rome check --apply" - }, - "dependencies": { - "@floating-ui/react": "^0.23.1", - "@headlessui/react": "^1.7.15", - "@nostr-dev-kit/ndk": "^0.5.13", - "@tanstack/react-query": "^4.29.18", - "@tanstack/react-query-devtools": "^4.29.18", - "@tanstack/react-virtual": "3.0.0-beta.54", - "@tauri-apps/api": "^1.4.0", - "cheerio": "1.0.0-rc.12", - "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", - "nostr-tools": "^1.12.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-hook-form": "^7.45.0", - "react-hotkeys-hook": "^4.4.0", - "react-player": "^2.12.0", - "react-resizable-panels": "^0.0.48", - "react-router-dom": "^6.14.0", - "react-string-replace": "^1.1.1", - "react-virtuoso": "^4.3.11", - "slate": "^0.94.1", - "slate-history": "^0.93.0", - "slate-react": "^0.94.2", - "tailwind-merge": "^1.13.2", - "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql", - "vidstack": "^0.4.5", - "zustand": "^4.3.8" - }, - "devDependencies": { - "@tailwindcss/typography": "^0.5.9", - "@tauri-apps/cli": "^1.4.0", - "@types/node": "^18.16.18", - "@types/react": "^18.2.14", - "@types/react-dom": "^18.2.6", - "@types/youtube-player": "^5.5.7", - "@vitejs/plugin-react-swc": "^3.3.2", - "autoprefixer": "^10.4.14", - "cross-env": "^7.0.3", - "csstype": "^3.1.2", - "encoding": "^0.1.13", - "husky": "^8.0.3", - "lint-staged": "^13.2.2", - "postcss": "^8.4.24", - "prop-types": "^15.8.1", - "rome": "12.1.0", - "tailwindcss": "^3.3.2", - "typescript": "^4.9.5", - "vite": "^4.3.9", - "vite-plugin-top-level-await": "^1.3.1", - "vite-tsconfig-paths": "^4.2.0" - } + "name": "lume", + "private": true, + "version": "1.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "tauri": "tauri", + "add-migrate": "cd src-tauri/ && sqlx migrate add", + "prepare": "husky install" + }, + "lint-staged": { + "**/*.{js,ts,jsx,tsx}": "rome check --apply" + }, + "dependencies": { + "@floating-ui/react": "^0.23.1", + "@headlessui/react": "^1.7.15", + "@nostr-dev-kit/ndk": "^0.5.13", + "@tanstack/react-query": "^4.29.19", + "@tanstack/react-virtual": "3.0.0-beta.54", + "@tauri-apps/api": "^1.4.0", + "cheerio": "1.0.0-rc.12", + "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", + "nostr-tools": "^1.12.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-hook-form": "^7.45.0", + "react-hotkeys-hook": "^4.4.0", + "react-player": "^2.12.0", + "react-router-dom": "^6.14.0", + "react-string-replace": "^1.1.1", + "react-virtuoso": "^4.3.11", + "slate": "^0.94.1", + "slate-history": "^0.93.0", + "slate-react": "^0.94.2", + "tailwind-merge": "^1.13.2", + "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql", + "zustand": "^4.3.8" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.9", + "@tauri-apps/cli": "^1.4.0", + "@types/node": "^18.16.18", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@types/youtube-player": "^5.5.7", + "@vitejs/plugin-react-swc": "^3.3.2", + "autoprefixer": "^10.4.14", + "cross-env": "^7.0.3", + "csstype": "^3.1.2", + "encoding": "^0.1.13", + "husky": "^8.0.3", + "lint-staged": "^13.2.2", + "postcss": "^8.4.24", + "prop-types": "^15.8.1", + "rome": "12.1.0", + "tailwindcss": "^3.3.2", + "typescript": "^4.9.5", + "vite": "^4.3.9", + "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 fa553709..f975f53e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,11 +11,8 @@ dependencies: specifier: ^0.5.13 version: 0.5.13(typescript@4.9.5) '@tanstack/react-query': - specifier: ^4.29.18 - version: 4.29.18(react-dom@18.2.0)(react@18.2.0) - '@tanstack/react-query-devtools': - specifier: ^4.29.18 - version: 4.29.18(@tanstack/react-query@4.29.18)(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.29.19 + version: 4.29.19(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) @@ -61,9 +58,6 @@ dependencies: react-player: specifier: ^2.12.0 version: 2.12.0(react@18.2.0) - 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) @@ -88,9 +82,6 @@ dependencies: tauri-plugin-sql-api: specifier: github:tauri-apps/tauri-plugin-sql version: github.com/tauri-apps/tauri-plugin-sql/45b46ee428f6c13a831d237d8b602349ad6b17a6 - vidstack: - specifier: ^0.4.5 - version: 0.4.5 zustand: specifier: ^4.3.8 version: 4.3.8(immer@10.0.2)(react@18.2.0) @@ -162,6 +153,11 @@ devDependencies: packages: + /@aashutoshrathi/word-wrap@1.2.5: + resolution: {integrity: sha512-plhoNEfSVdHMKXQyAxvH0Zyv3/4NL8r6pwgMQdmHR2vBUXn2t74PN2pBRppqKUa6RMT0yldyvOHG5Dbjwy2mBQ==} + engines: {node: '>=0.10.0'} + dev: false + /@alloc/quick-lru@5.2.0: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -537,10 +533,6 @@ packages: resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} dev: false - /@maverick-js/signals@5.11.2: - resolution: {integrity: sha512-jKAyNE2O7H+xrigPoqdV0Iq2AeQ6cysfBf/b2jasJ4FfCUKjGyazgtp+pIspTW6skFvpPrvq40Qft+7HuR+Tlg==} - dev: false - /@noble/curves@1.0.0: resolution: {integrity: sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==} dependencies: @@ -831,34 +823,12 @@ packages: tailwindcss: 3.3.2 dev: true - /@tanstack/match-sorter-utils@8.8.4: - resolution: {integrity: sha512-rKH8LjZiszWEvmi01NR72QWZ8m4xmXre0OOwlRGnjU01Eqz/QnN+cqpty2PJ0efHblq09+KilvyR7lsbzmXVEw==} - engines: {node: '>=12'} - dependencies: - remove-accents: 0.4.2 + /@tanstack/query-core@4.29.19: + resolution: {integrity: sha512-uPe1DukeIpIHpQi6UzIgBcXsjjsDaLnc7hF+zLBKnaUlh7jFE/A+P8t4cU4VzKPMFB/C970n/9SxtpO5hmIRgw==} dev: false - /@tanstack/query-core@4.29.17: - resolution: {integrity: sha512-iDbO8yZOpm1lqgq6L8mpxGbKaoiyZSjthxEB3WGU7mNPYss9q4H3Q67+e2xXGwkemEVmtEX/WwvtFitrvVU8TA==} - dev: false - - /@tanstack/react-query-devtools@4.29.18(@tanstack/react-query@4.29.18)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-MH0EFL1lDzYBLbhCeD7GaNku4pOE7bPEm5HIFGw4YdRrmDjkTkkbGWqDJ15odGwp7qOvOgLbCxyTCqfof29Dag==} - peerDependencies: - '@tanstack/react-query': 4.29.18 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - '@tanstack/match-sorter-utils': 8.8.4 - '@tanstack/react-query': 4.29.18(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - superjson: 1.12.4 - use-sync-external-store: 1.2.0(react@18.2.0) - dev: false - - /@tanstack/react-query@4.29.18(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-CyoxrT8U7MWLZOdl0XLCiHC+W5cnXNELafFtzcsrwrALiUulONEfWFl6TzgvENfhC50OBjVGy/6Yl3YsIhAM6g==} + /@tanstack/react-query@4.29.19(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-XiTIOHHQ5Cw1WUlHaD4fmVUMhoWjuNJlAeJGq7eM4BraI5z7y8WkZO+NR8PSuRnQGblpuVdjClQbDFtwxTtTUw==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -869,7 +839,7 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.29.17 + '@tanstack/query-core': 4.29.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) @@ -1458,7 +1428,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001508 - electron-to-chromium: 1.4.441 + electron-to-chromium: 1.4.442 node-releases: 2.0.12 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -1477,7 +1447,7 @@ packages: dependencies: '@npmcli/fs': 3.1.0 fs-minipass: 3.0.2 - glob: 10.3.0 + glob: 10.3.1 lru-cache: 7.18.3 minipass: 5.0.0 minipass-collect: 1.0.2 @@ -1670,13 +1640,6 @@ packages: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} dev: false - /copy-anything@3.0.5: - resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} - engines: {node: '>=12.13'} - dependencies: - is-what: 4.1.15 - dev: false - /create-esm-loader@0.2.3: resolution: {integrity: sha512-cllzD6IU/mzXBs5OdQVWL3+ne5Elpu3Wdm7h5OldMbGXk76yr9XzHlQXWJ4zfs0ZAibe26rkbs4KvMAJm7fIZA==} engines: {node: '>=14.x'} @@ -1897,8 +1860,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.441: - resolution: {integrity: sha512-LlCgQ8zgYZPymf5H4aE9itwiIWH4YlCiv1HFLmmcBeFYi5E+3eaIFnjHzYtcFQbaKfAW+CqZ9pgxo33DZuoqPg==} + /electron-to-chromium@1.4.442: + resolution: {integrity: sha512-RkrZF//Ya+0aJq2NM3OdisNh5ZodZq1rdXOS96G8DdDgpDKqKE81yTbbQ3F/4CKm1JBPsGu1Lp/akkna2xO06Q==} dev: true /emoji-regex@8.0.0: @@ -2229,7 +2192,7 @@ packages: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.2 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 @@ -2243,7 +2206,7 @@ packages: create-esm-loader: 0.2.3 npm-run-all: 4.1.5 semver: 7.5.3 - typescript: 5.1.3 + typescript: 5.1.5 dev: false /espree@9.5.2: @@ -2533,8 +2496,8 @@ packages: dependencies: is-glob: 4.0.3 - /glob@10.3.0: - resolution: {integrity: sha512-AQ1/SB9HH0yCx1jXAT4vmCbTOPe5RQ+kCurjbel5xSCGhebumUv+GJZfa1rEqor3XIViqwSEmlkZCQD43RWrBg==} + /glob@10.3.1: + resolution: {integrity: sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: @@ -2542,7 +2505,7 @@ packages: jackspeak: 2.2.1 minimatch: 9.0.2 minipass: 5.0.0 - path-scurry: 1.9.2 + path-scurry: 1.10.0 dev: false /glob@7.1.6: @@ -2969,11 +2932,6 @@ packages: call-bind: 1.0.2 dev: false - /is-what@4.1.15: - resolution: {integrity: sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==} - engines: {node: '>=12.13'} - dev: false - /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -3175,6 +3133,11 @@ packages: dependencies: js-tokens: 4.0.0 + /lru-cache@10.0.0: + resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==} + engines: {node: 14 || >=16.14} + dev: false + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -3187,11 +3150,6 @@ packages: engines: {node: '>=12'} dev: false - /lru-cache@9.1.2: - resolution: {integrity: sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==} - engines: {node: 14 || >=16.14} - dev: false - /make-fetch-happen@11.1.1: resolution: {integrity: sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -3225,24 +3183,6 @@ packages: engines: {node: '>=8'} dev: false - /maverick.js@0.33.1: - resolution: {integrity: sha512-p8L5V62CV6TmHAngmRAopp231oJKeH77mJja5SsKOfvzrPRoThT/Jo9U0jMRB5iMykqkvyg2J5V5Agn6FPXDWQ==} - engines: {node: '>=16'} - dependencies: - '@maverick-js/signals': 5.11.2 - type-fest: 3.12.0 - dev: false - - /media-captions@0.0.8: - resolution: {integrity: sha512-gX6ozU5smrAb90FwI+wd1VnqkwcAQ2NF8l72KZ67k+o3Vr0wYBAsTFRfdOePqde9IBhfBZbZsYEA5509npwtZA==} - engines: {node: '>=16'} - dev: false - - /media-icons@0.4.2: - resolution: {integrity: sha512-jrxoQzxsZFyzt6P3CoGZWa6FVKoR/Ii1plbVjtyTSyQGpeVWkJ++0oBAwGOv/F9mWRxmGkaQ04uEIKTFouRG1w==} - engines: {node: '>=16'} - dev: false - /memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} dev: false @@ -3629,16 +3569,16 @@ packages: mimic-fn: 4.0.0 dev: true - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.2: + resolution: {integrity: sha512-W/Q5m5jpuspnghjVKWcs+5sm9Xl9BIdDmNLWaQbwneNQEZFosaiVPC9vtwN0Dbxx4x7TLY7bxjvttW26AmcKrQ==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.5 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: false /p-limit@2.3.0: @@ -3744,11 +3684,11 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - /path-scurry@1.9.2: - resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} + /path-scurry@1.10.0: + resolution: {integrity: sha512-tZFEaRQbMLjwrsmidsGJ6wDMv0iazJWk6SfIKnY4Xru8auXgmJkOBa5DUbYFcFD2Rzk2+KDlIiF0GVXNCbgC7g==} engines: {node: '>=16 || 14 >=14.17'} dependencies: - lru-cache: 9.1.2 + lru-cache: 10.0.0 minipass: 5.0.0 dev: false @@ -3990,16 +3930,6 @@ packages: react-fast-compare: 3.2.2 dev: false - /react-resizable-panels@0.0.48(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-fJa3itmJ3HLLmVG7y8tka80wFW63N6ai76q7MGwU8nSXeA0qkX36vnmPyXm34lvtsGjn1Cgi5IPhPQnf42SVpA==} - peerDependencies: - react: ^16.14.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.14.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - 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'} @@ -4113,10 +4043,6 @@ packages: functions-have-names: 1.2.3 dev: false - /remove-accents@0.4.2: - resolution: {integrity: sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==} - dev: false - /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -4518,13 +4444,6 @@ packages: ts-interface-checker: 0.1.13 dev: true - /superjson@1.12.4: - resolution: {integrity: sha512-vkpPQAxdCg9SLfPv5GPC5fnGrui/WryktoN9O5+Zif/14QIMjw+RITf/5LbBh+9QpBFb3KNvJth+puz2H8o6GQ==} - engines: {node: '>=10'} - dependencies: - copy-anything: 3.0.5 - dev: false - /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -4740,11 +4659,6 @@ packages: engines: {node: '>=8'} dev: false - /type-fest@3.12.0: - resolution: {integrity: sha512-qj9wWsnFvVEMUDbESiilKeXeHL7FwwiFcogfhfyjmvT968RXSvnl23f1JOClTHYItsi7o501C/7qVllscUP3oA==} - engines: {node: '>=14.16'} - dev: false - /type@1.2.0: resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} dev: false @@ -4772,8 +4686,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - /typescript@5.1.3: - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + /typescript@5.1.5: + resolution: {integrity: sha512-FOH+WN/DQjUvN6WgW+c4Ml3yi0PH+a/8q+kNIfRehv1wLhWONedw85iu+vQ39Wp49IzTJEsZ2lyLXpBF7mkF1g==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -4868,16 +4782,6 @@ packages: spdx-expression-parse: 3.0.1 dev: false - /vidstack@0.4.5: - resolution: {integrity: sha512-6CFkWRSvDQAd91WQ6PZ/ovwbGFDI8pLuIA0swcDLLAOM6MiKWFd/gFjJ/x7+DAcCf0hqOngO34MJhG3zTZQtcQ==} - engines: {node: '>=16'} - dependencies: - maverick.js: 0.33.1 - media-captions: 0.0.8 - media-icons: 0.4.2 - type-fest: 3.12.0 - dev: false - /vite-plugin-top-level-await@1.3.1(vite@4.3.9): resolution: {integrity: sha512-55M1h4NAwkrpxPNOJIBzKZFihqLUzIgnElLSmPNPMR2Fn9+JHKaNg3sVX1Fq+VgvuBksQYxiD3OnwQAUu7kaPQ==} peerDependencies: @@ -5012,11 +4916,6 @@ packages: string-width: 4.2.3 dev: false - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: false - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} diff --git a/src/app/chat/components/item.tsx b/src/app/chat/components/item.tsx index 5cfc9814..78278ba4 100644 --- a/src/app/chat/components/item.tsx +++ b/src/app/chat/components/item.tsx @@ -13,7 +13,7 @@ export function ChatsListItem({ data }: { data: any }) {
-
+
); @@ -41,7 +41,10 @@ export function ChatsListItem({ data }: { data: any }) {
- {user?.nip05 || user?.displayName || shortenKey(data.sender_pubkey)} + {user?.nip05 || + user?.displayName || + user?.name || + shortenKey(data.sender_pubkey)}
diff --git a/src/app/chat/components/modal.tsx b/src/app/chat/components/modal.tsx index a6965f2e..96349acd 100644 --- a/src/app/chat/components/modal.tsx +++ b/src/app/chat/components/modal.tsx @@ -112,7 +112,7 @@ export function NewMessageModal() { />

- {pleb.display_name || pleb.name} + {pleb.displayName || pleb.name}

{pleb.nip05 || diff --git a/src/app/space/components/blocks/following.tsx b/src/app/space/components/blocks/following.tsx index 545e8b3f..a5e572ee 100644 --- a/src/app/space/components/blocks/following.tsx +++ b/src/app/space/components/blocks/following.tsx @@ -83,7 +83,7 @@ export function FollowingBlock({ block }: { block: number }) { return (
- + {hasNewNote && (
+ ) : followed ? ( + + ) : ( + + )} + + Message + +
- )} -
- {followsStatus === "loading" ? ( - - ) : followed ? ( - - ) : ( - - )} - - Message - +
+

+ {user?.about} +

+ +
+
+ + + + {({ selected }) => ( + + )} + + + + + + + + +
); diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index ab49ab39..2d18fd25 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -157,26 +157,13 @@ export async function getNotes(time: number, limit: number, offset: number) { } // get all notes by pubkey -export async function getNotesByPubkey( - pubkey: string, - time: number, - limit: number, - offset: number, -) { +export async function getNotesByPubkey(pubkey: string) { const db = await connect(); - const totalNotes = await countTotalNotes(); - const nextCursor = offset + limit; - - const notes: any = { data: null, nextCursor: 0 }; - const query: any = await db.select( - `SELECT * FROM notes WHERE created_at <= "${time}" AND pubkey == "${pubkey}" AND kind IN (1, 6, 1063) GROUP BY parent_id ORDER BY created_at DESC LIMIT "${limit}" OFFSET "${offset}";`, + const res: any = await db.select( + `SELECT * FROM notes WHERE pubkey == "${pubkey}" AND kind IN (1, 6, 1063) GROUP BY parent_id ORDER BY created_at DESC;`, ); - notes["data"] = query; - notes["nextCursor"] = - Math.round(totalNotes / nextCursor) > 1 ? nextCursor : undefined; - - return notes; + return res; } // get all notes by authors diff --git a/src/main.tsx b/src/main.tsx index c4849826..1ec94619 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,6 @@ import App from "./app"; import { RelayProvider } from "@shared/relayProvider"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { createRoot } from "react-dom/client"; const queryClient = new QueryClient({ @@ -20,6 +19,5 @@ root.render( - , ); diff --git a/src/shared/composer/types/post.tsx b/src/shared/composer/types/post.tsx index f15b81d5..039ef952 100644 --- a/src/shared/composer/types/post.tsx +++ b/src/shared/composer/types/post.tsx @@ -61,15 +61,16 @@ const ImagePreview = ({ export function Post() { const publish = usePublish(); - const [repost, toggle] = useComposer((state) => [ - state.repost, - state.toggleModal, - ]); const editor = useMemo( () => withReact(withImages(withHistory(createEditor()))), [], ); + const [repost, reply, toggle] = useComposer((state) => [ + state.repost, + state.reply, + state.toggleModal, + ]); const [content, setContent] = useState([ { children: [ @@ -84,6 +85,18 @@ export function Post() { return nodes.map((n) => Node.string(n)).join("\n"); }, []); + const getRef = () => { + if (repost.id) { + return repost.id; + } else if (reply.id) { + return reply.id; + } else { + return null; + } + }; + + const refID = getRef(); + const submit = () => { let tags: string[][] = []; let kind: number; @@ -94,6 +107,20 @@ export function Post() { ["e", repost.id, FULL_RELAYS[0], "root"], ["p", repost.pubkey], ]; + } else if (reply.id && reply.pubkey) { + kind = 1; + if (reply.root && reply.root !== reply.id) { + tags = [ + ["e", reply.id, FULL_RELAYS[0], "root"], + ["e", reply.root, FULL_RELAYS[0], "reply"], + ["p", reply.pubkey], + ]; + } else { + tags = [ + ["e", reply.id, FULL_RELAYS[0], "root"], + ["p", reply.pubkey], + ]; + } } else { kind = 1; tags = []; @@ -130,14 +157,14 @@ export function Post() {
- {repost.id && } + {refID && }
diff --git a/src/shared/notes/contents/kind1.tsx b/src/shared/notes/contents/kind1.tsx index 881d03fc..ab9a1abe 100644 --- a/src/shared/notes/contents/kind1.tsx +++ b/src/shared/notes/contents/kind1.tsx @@ -2,11 +2,22 @@ import { MentionNote } from "@shared/notes/mentions/note"; import { ImagePreview } from "@shared/notes/preview/image"; import { LinkPreview } from "@shared/notes/preview/link"; import { VideoPreview } from "@shared/notes/preview/video"; +import { ReactNode } from "react"; export function Kind1({ content, truncate = false, -}: { content: any; truncate?: boolean }) { +}: { + content: { + original: string; + parsed: ReactNode[]; + notes: string[]; + images: string[]; + videos: string[]; + links: string[]; + }; + truncate?: boolean; +}) { return ( <>
{content.parsed}
- {Array.isArray(content.images) && content.images.length ? ( + {content.images.length > 0 && ( - ) : ( - <> )} - {Array.isArray(content.videos) && content.videos.length ? ( - - ) : ( - <> - )} - {Array.isArray(content.links) && content.links.length ? ( - - ) : ( - <> - )} - {Array.isArray(content.notes) && content.notes.length ? ( + {content.videos.length > 0 && } + {content.links.length > 0 && } + {content.notes.length > 0 && content.notes.map((note: string) => ( - )) - ) : ( - <> - )} + ))} ); } diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 82e1ce50..32d177a7 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -8,12 +8,8 @@ import { useEvent } from "@utils/hooks/useEvent"; import { memo } from "react"; export const MentionNote = memo(function MentionNote({ id }: { id: string }) { - const { status, data } = useEvent(id); - - const kind1 = data?.kind === 1 ? data.content : null; - const kind1063 = data?.kind === 1063 ? data.tags : null; - const queryClient = useQueryClient(); + const { status, data } = useEvent(id); const block = useMutation({ mutationFn: (data: any) => { @@ -37,17 +33,19 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
openThread(e, id)} onKeyDown={(e) => openThread(e, id)} - className="mt-3 rounded-lg bg-zinc-800 border-t border-zinc-700/50 px-3 py-3" + className="mt-3 rounded-lg bg-zinc-800/50 border-t border-zinc-700/50 px-3 py-3" > {status === "loading" ? ( - ) : ( + ) : status === "success" ? ( <>
- {kind1 && } - {kind1063 && } - {!kind1 && !kind1063 && ( + {data.kind === 1 && ( + + )} + {data.kind === 1063 && } + {data.kind !== 1 && data.kind !== 1063 && (
@@ -64,6 +62,8 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { )}
+ ) : ( +

Failed to fetch event

)}
); diff --git a/src/shared/notes/metadata.tsx b/src/shared/notes/metadata.tsx index 6a7c73ba..a6af71cd 100644 --- a/src/shared/notes/metadata.tsx +++ b/src/shared/notes/metadata.tsx @@ -11,12 +11,12 @@ import { useContext } from "react"; export function NoteMetadata({ id, + rootID, eventPubkey, - currentBlock, }: { id: string; + rootID?: string; eventPubkey: string; - currentBlock?: number; }) { const ndk = useContext(RelayContext); const { status, data } = useQuery(["note-metadata", id], async () => { @@ -112,8 +112,9 @@ export function NoteMetadata({ <> diff --git a/src/shared/notes/metadata/reply.tsx b/src/shared/notes/metadata/reply.tsx index 3df2437d..3445e804 100644 --- a/src/shared/notes/metadata/reply.tsx +++ b/src/shared/notes/metadata/reply.tsx @@ -1,36 +1,19 @@ -import { createBlock } from "@libs/storage"; import { ReplyIcon } from "@shared/icons"; -import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { useComposer } from "@stores/composer"; import { compactNumber } from "@utils/number"; export function NoteReply({ id, + rootID, + pubkey, replies, -}: { id: string; replies: number; currentBlock?: number }) { - const queryClient = useQueryClient(); - - const block = useMutation({ - mutationFn: (data: any) => { - return createBlock(data.kind, data.title, data.content); - }, - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ["blocks"] }); - }, - }); - - const openThread = (event: any, thread: string) => { - const selection = window.getSelection(); - if (selection.toString().length === 0) { - block.mutate({ kind: 2, title: "Thread", content: thread }); - } else { - event.stopPropagation(); - } - }; +}: { id: string; rootID?: string; pubkey: string; replies: number }) { + const setReply = useComposer((state) => state.setReply); return (