From c31d16f2c696b6cfbc678252f9cbd229dc98880d Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Thu, 12 Dec 2024 13:43:14 -0600 Subject: [PATCH] bump applesauce version --- package.json | 2 +- pnpm-lock.yaml | 264 ++++++++++-------- src/const.ts | 3 +- src/helpers/nostr/post.ts | 5 +- src/helpers/nostr/stream.ts | 7 +- src/hooks/use-channel-metadata.ts | 2 +- src/providers/global/publish-provider.tsx | 5 +- src/services/channel-metadata.ts | 2 +- src/views/channels/channel.tsx | 2 +- .../channels/components/send-message-form.tsx | 35 ++- 10 files changed, 174 insertions(+), 153 deletions(-) diff --git a/package.json b/package.json index 41464e991..576559a8c 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "rxjs": "^7.8.1", "three": "^0.170.0", "three-spritetext": "^1.9.2", - "three-stdlib": "^2.34.1", + "three-stdlib": "^2.35.2", "tiny-lru": "^11.2.11", "unified": "^11.0.5", "vite-plugin-funding": "^0.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ea12a875..07a9395f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,28 +92,28 @@ importers: version: 4.9.2(prop-types@15.8.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) applesauce-channel: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-content: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-core: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-factory: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-lists: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-net: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-react: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) applesauce-signer: specifier: next - version: 0.0.0-next-20241211183908(typescript@5.7.2) + version: 0.0.0-next-20241212192616(typescript@5.7.2) bech32: specifier: ^2.0.0 version: 2.0.0 @@ -295,8 +295,8 @@ importers: specifier: ^1.9.2 version: 1.9.2(three@0.170.0) three-stdlib: - specifier: ^2.34.1 - version: 2.34.1(three@0.170.0) + specifier: ^2.35.2 + version: 2.35.2(three@0.170.0) tiny-lru: specifier: ^11.2.11 version: 11.2.11 @@ -1351,8 +1351,8 @@ packages: resolution: {integrity: sha512-0F4ub/e+t93V9wzR5Vr+Xdfhhy5kK+ZKls/J3yX2YBT27X1Rd3QIPLCTUFCb4RaV6a/e17aZAVJF8Af7r9BeAg==} engines: {node: '>=14'} - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + '@jridgewell/gen-mapping@0.3.8': + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} engines: {node: '>=6.0.0'} '@jridgewell/resolve-uri@3.1.2': @@ -1905,29 +1905,29 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - applesauce-channel@0.0.0-next-20241211183908: - resolution: {integrity: sha512-Orj5Oux3OtGjPQIn5JSau3rSdTnjDFJPnknXAYi25UC8qQ07rBg8QFIBxakYAcF9aXwWc+bihnIuYXp80XPiMQ==} + applesauce-channel@0.0.0-next-20241212192616: + resolution: {integrity: sha512-N7S0XIw+aYymBF5pllEMwKJkDJft9qZAnGMJzdTA400KR391eFbnmE3sVOFXvIvU3XzKP89RrysOWjaPRAdASA==} - applesauce-content@0.0.0-next-20241211183908: - resolution: {integrity: sha512-0sVG8VemADeDtHzaGP+csAzWyj9qnGhtnlhFpbJGklN+QrIh94vJw4GGJM5t5GrH+62bPBzEHq/ofcUTdVccAQ==} + applesauce-content@0.0.0-next-20241212192616: + resolution: {integrity: sha512-WUC5WJVDR9sMCJVp5c/3FKBDL6pCqGaBNS5UXeLY+sBXYs9pqLzxXrrILQKWZM+ghPfjCdfc6fDpjVxjyR4vcA==} - applesauce-core@0.0.0-next-20241211183908: - resolution: {integrity: sha512-nSIp3aetUYPbn+1+qqkiAteSuocEzXzxGDkZCQdL13B4+5ynTxAWLNSb4KdNgzulAryXMm5PWvGX/voY7fCxcw==} + applesauce-core@0.0.0-next-20241212192616: + resolution: {integrity: sha512-QQjsU2CU0OtQZfnb8VYbz8q/mKC2tLDsxSqHKsa1wIj5m5i7zRgPRBUj2FZrFJmIwlrG73G7uj1Ip53F93SIEw==} - applesauce-factory@0.0.0-next-20241211183908: - resolution: {integrity: sha512-hl22o7hNh0oG0ANuVi5x9Jfoe/BWfA+N2C83UAZjHoMZAxBNaZEnZBQl4K49Xz139dG/LORCNHEVy2A2SE43bQ==} + applesauce-factory@0.0.0-next-20241212192616: + resolution: {integrity: sha512-YhCaVGcVbqAzg7T2Cu6MG/iYRpfyC538GNZfG38wm6BD/5YCyygZ0LOmnNrIdhkD5mhxYwLxjlcQyY8n0meK9w==} - applesauce-lists@0.0.0-next-20241211183908: - resolution: {integrity: sha512-NOivXJIQvOW5Q7d7KUaardp6A/P26Y4QdImE1WmQy7svrU/qV/bHrtCm9iT4KVH++iIOUGBCEzpyj3/i41kKcQ==} + applesauce-lists@0.0.0-next-20241212192616: + resolution: {integrity: sha512-Yd4clwLOKegWs0nJRHcjlJvJtxXYXNSWMQiqVHos510r/0sXpkCL9dmY9Y2QMLbG65Rcwvlu4OfT1w9+iXB7gA==} - applesauce-net@0.0.0-next-20241211183908: - resolution: {integrity: sha512-P0jF3oJkdWm6a+Y7S8mx5/KrzsmVfRDmZAOy7y7kxZxT9UxwPqUY3arf/JErrNw8NyPKIozsL57/9nGcvyarzg==} + applesauce-net@0.0.0-next-20241212192616: + resolution: {integrity: sha512-LjGH+SCKTpGOYbdiybS0zJzdNpQMX0n1Zq3/S+JeQyfK0vPyeDPznQE0jvuIVT7SHyyCVf9cqSLIPm20qaxDXA==} - applesauce-react@0.0.0-next-20241211183908: - resolution: {integrity: sha512-0mtfSZZ2QkzQsB6x9Vfgemybt4WTZK24kUrsE6j+mgxGnaX616LgMTkdDl4SJwNjKPr9ZyMemTbalZkqF42iMA==} + applesauce-react@0.0.0-next-20241212192616: + resolution: {integrity: sha512-tDtXc5e23Y5i11icZge0fTfpYIUXFtj0MQfzBgUfF4FT6zwUw69Bsw4roAVhVezWfWh4fD8dcIFjhNzGyi79AA==} - applesauce-signer@0.0.0-next-20241211183908: - resolution: {integrity: sha512-uKdM0nGh214Pkoxyh8pwm1DF8YNcqCgeo2LOfVtTCMBYmuBbYWPU6peAc/Vb1R9ry5Chel1tEOvIHwPfyuIXNQ==} + applesauce-signer@0.0.0-next-20241212192616: + resolution: {integrity: sha512-kzOCY+TrlGWJnDHpsIzyB/lxFTJfMhQIr6u1+tGro/bqfVBrdX1fJF7cxv7Ro0Tnf/1RGosE4nxjz1Z+9ifqMg==} argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -2060,8 +2060,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001687: - resolution: {integrity: sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==} + caniuse-lite@1.0.30001688: + resolution: {integrity: sha512-Nmqpru91cuABu/DTCXbM2NSRHzM2uVHfPnhJ/1zEAJx/ILBRVmz3pzH4N7DZqbdG0gWClsCC05Oj0mJ/1AWMbA==} canvas-color-tracker@1.3.1: resolution: {integrity: sha512-eNycxGS7oQ3IS/9QQY41f/aQjiO9Y/MtedhCgSdsbLSxC9EyUD8L3ehl/Q3Kfmvt8um79S45PBV+5Rxm5ztdSw==} @@ -2372,8 +2372,8 @@ packages: dnd-core@16.0.1: resolution: {integrity: sha512-HK294sl7tbw6F6IeuK16YSBUoorvHpY8RHO+9yFfaJyCDVb6n7PRcezrOEOa2SBCqiYpemh5Jx20ZcjKdFAVng==} - dnd-multi-backend@8.0.3: - resolution: {integrity: sha512-yFFARotr+OEJk787Fsj+V52pi6j7+Pt/CRp3IR2Ai3fnxA/z6J54T7+gxkXzXu4cvxTNE7NiBzzAaJ2f7JjFTw==} + dnd-multi-backend@8.1.0: + resolution: {integrity: sha512-Favl89icddeqKI9MzMOW5AH5WHlJhdTmfnHm3QrbviJSp87N4oE7JPcqAzbu2QSis40senFQSoehuLX3H/xadA==} peerDependencies: dnd-core: ^16.0.1 @@ -2409,8 +2409,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.72: - resolution: {integrity: sha512-ZpSAUOZ2Izby7qnZluSrAlGgGQzucmFbN0n64dYzocYxnxV5ufurpj3VgEe4cUp7ir9LmeLxNYo8bVnlM8bQHw==} + electron-to-chromium@1.5.73: + resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==} emittery@1.0.3: resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} @@ -2623,8 +2623,8 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} - get-intrinsic@1.2.5: - resolution: {integrity: sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==} + get-intrinsic@1.2.6: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} engines: {node: '>= 0.4'} get-nonce@1.0.1: @@ -2831,8 +2831,8 @@ packages: resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} engines: {node: '>= 0.4'} - is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} is-date-object@1.0.5: @@ -2894,8 +2894,8 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} - is-regex@1.2.0: - resolution: {integrity: sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA==} + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} is-regexp@1.0.0: @@ -3100,6 +3100,10 @@ packages: match-sorter@8.0.0: resolution: {integrity: sha512-bGJ6Zb+OhzXe+ptP5d80OLVx7AkqfRbtGEh30vNSfjNwllu+hHI+tcbMIT/fbkx/FKN1PmKuDb65+Oofg+XUxw==} + math-intrinsics@1.0.0: + resolution: {integrity: sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==} + engines: {node: '>= 0.4'} + mdast-util-find-and-replace@3.0.1: resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==} @@ -3549,8 +3553,8 @@ packages: randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - rdndmb-html5-to-touch@8.0.3: - resolution: {integrity: sha512-VfIbLjlL9NAnZzc2M5fGPCNkDyK12+ahgILGO5RjS7jkgUlxwB0c/XvxVQNfY/2ocg7isTY/G7tqxJk5fSTZAA==} + rdndmb-html5-to-touch@8.1.0: + resolution: {integrity: sha512-Ep19LSFHwRhq+kuGGSqB8/+LW9uLyjd1xyQG/WkZ8nPoFgIH/3XtbPD7BxF9jMiwPCJepSK+YNUPej4I97F7XA==} react-chartjs-2@5.2.0: resolution: {integrity: sha512-98iN5aguJyVSxp5U3CblRLH67J8gkfyGNbiK3c+l1QI/G4irHMPQw44aEPmjVag+YKTyQ260NcF82GTQ3bdscA==} @@ -3573,16 +3577,16 @@ packages: react-dnd-html5-backend@16.0.1: resolution: {integrity: sha512-Wu3dw5aDJmOGw8WjH1I1/yTH+vlXEL4vmjk5p+MHxP8HuHJS1lAGeIdG/hze1AvNeXWo/JgULV87LyQOr+r5jw==} - react-dnd-multi-backend@8.0.3: - resolution: {integrity: sha512-IwH7Mf6R05KIFohX0hHMTluoAvuUD8SO15KCD+9fY0nJ4nc1FGCMCSyMZw8R1XNStKp+JnNg3ZMtiaf5DebSUg==} + react-dnd-multi-backend@8.1.0: + resolution: {integrity: sha512-SOVXIDAyTp63weGWp6/nI8Km0PwzP/SAqYCz2ZZHp31pNgHtsnDhGkasBSIMG9HDzMNkVp3/X1IPKuDF2OvEwg==} peerDependencies: dnd-core: ^16.0.1 react: ^16.14.0 || ^17.0.2 || ^18.0.0 react-dnd: ^16.0.1 react-dom: ^16.14.0 || ^17.0.2 || ^18.0.0 - react-dnd-preview@8.0.3: - resolution: {integrity: sha512-s69Ro47QYDthDhj73iQ0VioMCjtlZ1AytKBDkQaHKm5DTjA8D2bIaFKCBQd330QEW0SIzqLJrZGCSlIY2xraJg==} + react-dnd-preview@8.1.0: + resolution: {integrity: sha512-bMSQb5KTCy58Mo2hDMf48ioNIiPyK87SajJigdd3WlGKXSV7EY/37qPNog1ox5an0iVFSunbQnv2huvZjy3CbA==} peerDependencies: react: ^16.14.0 || ^17.0.2 || ^18.0.0 react-dnd: ^16.0.1 @@ -3900,15 +3904,15 @@ packages: rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} safer-buffer@2.1.2: @@ -4039,8 +4043,8 @@ packages: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} engines: {node: '>= 0.4'} - string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + string.prototype.trim@1.2.10: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} string.prototype.trimend@1.0.9: @@ -4128,8 +4132,8 @@ packages: peerDependencies: three: '>=0.86.0' - three-stdlib@2.34.1: - resolution: {integrity: sha512-Ck1eXTyd0Ii+/X9eGqOBxijHwy0fjyQbaZMBxdCrX7C1J7+nvueDsZqddny7Rh6KZwX+YBD8PplCzAoWY3mIXg==} + three-stdlib@2.35.2: + resolution: {integrity: sha512-Ns9ZdiFEAsiv8JvHS28Qgxg4YRTq13Ixa4EDUQZhUovZ3j/GLTou4zE887SLSqsuRZwuy3gklttn2ha5JaJpTQ==} peerDependencies: three: '>=0.128.0' @@ -4542,7 +4546,7 @@ snapshots: '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 '@apideck/better-ajv-errors@0.3.6(ajv@8.17.1)': @@ -4584,7 +4588,7 @@ snapshots: dependencies: '@babel/parser': 7.26.3 '@babel/types': 7.26.3 - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 @@ -5806,7 +5810,7 @@ snapshots: transitivePeerDependencies: - typescript - '@jridgewell/gen-mapping@0.3.5': + '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 '@jridgewell/sourcemap-codec': 1.5.0 @@ -5818,7 +5822,7 @@ snapshots: '@jridgewell/source-map@0.3.6': dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 '@jridgewell/sourcemap-codec@1.5.0': {} @@ -6364,22 +6368,23 @@ snapshots: dependencies: color-convert: 2.0.1 - applesauce-channel@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-channel@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-factory: 0.0.0-next-20241212192616(typescript@5.7.2) nostr-tools: 2.10.4(typescript@5.7.2) rxjs: 7.8.1 transitivePeerDependencies: - supports-color - typescript - applesauce-content@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-content@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: '@cashu/cashu-ts': 2.0.0-rc1 '@types/hast': 3.0.4 '@types/mdast': 4.0.4 '@types/unist': 3.0.3 - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) mdast-util-find-and-replace: 3.0.1 nostr-tools: 2.10.4(typescript@5.7.2) remark: 15.0.1 @@ -6390,7 +6395,7 @@ snapshots: - supports-color - typescript - applesauce-core@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-core@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: '@scure/base': 1.2.1 debug: 4.4.0 @@ -6404,22 +6409,23 @@ snapshots: - supports-color - typescript - applesauce-factory@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-factory@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: - applesauce-content: 0.0.0-next-20241211183908(typescript@5.7.2) - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-content: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) nostr-tools: 2.10.4(typescript@5.7.2) transitivePeerDependencies: - supports-color - typescript - applesauce-lists@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-lists@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: '@noble/hashes': 1.6.1 '@noble/secp256k1': 1.7.1 '@scure/base': 1.2.1 '@types/dom-serial': 1.0.6 - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-factory: 0.0.0-next-20241212192616(typescript@5.7.2) debug: 4.4.0 nostr-tools: 2.10.4(typescript@5.7.2) rxjs: 7.8.1 @@ -6427,9 +6433,9 @@ snapshots: - supports-color - typescript - applesauce-net@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-net@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) nanoid: 5.0.9 nostr-tools: 2.10.4(typescript@5.7.2) rxjs: 7.8.1 @@ -6437,11 +6443,11 @@ snapshots: - supports-color - typescript - applesauce-react@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-react@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: - applesauce-content: 0.0.0-next-20241211183908(typescript@5.7.2) - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) - applesauce-factory: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-content: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-factory: 0.0.0-next-20241212192616(typescript@5.7.2) nostr-tools: 2.10.4(typescript@5.7.2) react: 18.3.1 rxjs: 7.8.1 @@ -6449,14 +6455,14 @@ snapshots: - supports-color - typescript - applesauce-signer@0.0.0-next-20241211183908(typescript@5.7.2): + applesauce-signer@0.0.0-next-20241212192616(typescript@5.7.2): dependencies: '@noble/hashes': 1.6.1 '@noble/secp256k1': 1.7.1 '@scure/base': 1.2.1 '@types/dom-serial': 1.0.6 - applesauce-core: 0.0.0-next-20241211183908(typescript@5.7.2) - applesauce-net: 0.0.0-next-20241211183908(typescript@5.7.2) + applesauce-core: 0.0.0-next-20241212192616(typescript@5.7.2) + applesauce-net: 0.0.0-next-20241212192616(typescript@5.7.2) debug: 4.4.0 nanoid: 5.0.9 nostr-tools: 2.10.4(typescript@5.7.2) @@ -6488,7 +6494,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.5 es-errors: 1.3.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 @@ -6590,8 +6596,8 @@ snapshots: browserslist@4.24.2: dependencies: - caniuse-lite: 1.0.30001687 - electron-to-chromium: 1.5.72 + caniuse-lite: 1.0.30001688 + electron-to-chromium: 1.5.73 node-releases: 2.0.19 update-browserslist-db: 1.1.1(browserslist@4.24.2) @@ -6611,19 +6617,19 @@ snapshots: dependencies: call-bind-apply-helpers: 1.0.1 es-define-property: 1.0.1 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 set-function-length: 1.2.2 call-bound@1.0.2: dependencies: call-bind: 1.0.8 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 callsites@3.1.0: {} camelcase@8.0.0: {} - caniuse-lite@1.0.30001687: {} + caniuse-lite@1.0.30001688: {} canvas-color-tracker@1.3.1: dependencies: @@ -6905,19 +6911,19 @@ snapshots: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-length@1.0.1: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-offset@1.0.0: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 dayjs@1.11.13: {} @@ -6969,7 +6975,7 @@ snapshots: '@react-dnd/invariant': 4.0.2 redux: 4.2.1 - dnd-multi-backend@8.0.3(dnd-core@16.0.1): + dnd-multi-backend@8.1.0(dnd-core@16.0.1): dependencies: dnd-core: 16.0.1 @@ -7013,7 +7019,7 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.72: {} + electron-to-chromium@1.5.73: {} emittery@1.0.3: {} @@ -7058,7 +7064,7 @@ snapshots: es-set-tostringtag: 2.0.3 es-to-primitive: 1.3.0 function.prototype.name: 1.1.6 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 get-symbol-description: 1.0.2 globalthis: 1.0.4 gopd: 1.2.0 @@ -7069,9 +7075,9 @@ snapshots: internal-slot: 1.0.7 is-array-buffer: 3.0.4 is-callable: 1.2.7 - is-data-view: 1.0.1 + is-data-view: 1.0.2 is-negative-zero: 2.0.3 - is-regex: 1.2.0 + is-regex: 1.2.1 is-shared-array-buffer: 1.0.3 is-string: 1.1.0 is-typed-array: 1.1.13 @@ -7080,9 +7086,9 @@ snapshots: object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.3 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 + safe-array-concat: 1.1.3 + safe-regex-test: 1.1.0 + string.prototype.trim: 1.2.10 string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.8 typed-array-buffer: 1.0.2 @@ -7102,7 +7108,7 @@ snapshots: es-set-tostringtag@2.0.3: dependencies: - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 has-tostringtag: 1.0.2 hasown: 2.0.2 @@ -7285,16 +7291,18 @@ snapshots: gensync@1.0.0-beta.2: {} - get-intrinsic@1.2.5: + get-intrinsic@1.2.6: dependencies: call-bind-apply-helpers: 1.0.1 dunder-proto: 1.0.0 es-define-property: 1.0.1 es-errors: 1.3.0 + es-object-atoms: 1.0.0 function-bind: 1.1.2 gopd: 1.2.0 has-symbols: 1.1.0 hasown: 2.0.2 + math-intrinsics: 1.0.0 get-nonce@1.0.1: {} @@ -7304,7 +7312,7 @@ snapshots: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 glob-parent@5.1.2: dependencies: @@ -7504,7 +7512,7 @@ snapshots: is-array-buffer@3.0.4: dependencies: call-bind: 1.0.8 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 is-arrayish@0.2.1: {} @@ -7527,8 +7535,10 @@ snapshots: dependencies: hasown: 2.0.2 - is-data-view@1.0.1: + is-data-view@1.0.2: dependencies: + call-bound: 1.0.2 + get-intrinsic: 1.2.6 is-typed-array: 1.1.13 is-date-object@1.0.5: @@ -7574,9 +7584,9 @@ snapshots: is-plain-obj@4.1.0: {} - is-regex@1.2.0: + is-regex@1.2.1: dependencies: - call-bind: 1.0.8 + call-bound: 1.0.2 gopd: 1.2.0 has-tostringtag: 1.0.2 hasown: 2.0.2 @@ -7604,7 +7614,7 @@ snapshots: dependencies: call-bind: 1.0.8 has-symbols: 1.1.0 - safe-regex-test: 1.0.3 + safe-regex-test: 1.1.0 is-typed-array@1.1.13: dependencies: @@ -7619,7 +7629,7 @@ snapshots: is-weakset@2.0.3: dependencies: call-bind: 1.0.8 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 is-windows@1.0.2: {} @@ -7762,6 +7772,8 @@ snapshots: '@babel/runtime': 7.26.0 remove-accents: 0.5.0 + math-intrinsics@1.0.0: {} + mdast-util-find-and-replace@3.0.1: dependencies: '@types/mdast': 4.0.4 @@ -8413,9 +8425,9 @@ snapshots: dependencies: safe-buffer: 5.2.1 - rdndmb-html5-to-touch@8.0.3(dnd-core@16.0.1): + rdndmb-html5-to-touch@8.1.0(dnd-core@16.0.1): dependencies: - dnd-multi-backend: 8.0.3(dnd-core@16.0.1) + dnd-multi-backend: 8.1.0(dnd-core@16.0.1) react-dnd-html5-backend: 16.0.1 react-dnd-touch-backend: 16.0.1 transitivePeerDependencies: @@ -8447,16 +8459,16 @@ snapshots: dependencies: dnd-core: 16.0.1 - react-dnd-multi-backend@8.0.3(dnd-core@16.0.1)(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-dnd-multi-backend@8.1.0(dnd-core@16.0.1)(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: dnd-core: 16.0.1 - dnd-multi-backend: 8.0.3(dnd-core@16.0.1) + dnd-multi-backend: 8.1.0(dnd-core@16.0.1) react: 18.3.1 react-dnd: 16.0.1(@types/react@18.3.16)(react@18.3.1) - react-dnd-preview: 8.0.3(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react@18.3.1) + react-dnd-preview: 8.1.0(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react@18.3.1) react-dom: 18.3.1(react@18.3.1) - react-dnd-preview@8.0.3(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react@18.3.1): + react-dnd-preview@8.1.0(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 react-dnd: 16.0.1(@types/react@18.3.16)(react@18.3.1) @@ -8550,11 +8562,11 @@ snapshots: immutability-helper: 3.1.1 lodash: 4.17.21 prop-types: 15.8.1 - rdndmb-html5-to-touch: 8.0.3(dnd-core@16.0.1) + rdndmb-html5-to-touch: 8.1.0(dnd-core@16.0.1) react: 18.3.1 react-dnd: 16.0.1(@types/react@18.3.16)(react@18.3.1) react-dnd-html5-backend: 16.0.1 - react-dnd-multi-backend: 8.0.3(dnd-core@16.0.1)(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-dnd-multi-backend: 8.1.0(dnd-core@16.0.1)(react-dnd@16.0.1(@types/react@18.3.16)(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-dnd-touch-backend: 16.0.1 uuid: 9.0.1 transitivePeerDependencies: @@ -8694,7 +8706,7 @@ snapshots: dunder-proto: 1.0.0 es-abstract: 1.23.5 es-errors: 1.3.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 gopd: 1.2.0 which-builtin-type: 1.2.0 @@ -8859,20 +8871,21 @@ snapshots: dependencies: tslib: 2.8.1 - safe-array-concat@1.1.2: + safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 - get-intrinsic: 1.2.5 + call-bound: 1.0.2 + get-intrinsic: 1.2.6 has-symbols: 1.1.0 isarray: 2.0.5 safe-buffer@5.2.1: {} - safe-regex-test@1.0.3: + safe-regex-test@1.1.0: dependencies: - call-bind: 1.0.8 + call-bound: 1.0.2 es-errors: 1.3.0 - is-regex: 1.2.0 + is-regex: 1.2.1 safer-buffer@2.1.2: {} @@ -8895,7 +8908,7 @@ snapshots: define-data-property: 1.1.4 es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 gopd: 1.2.0 has-property-descriptors: 1.0.2 @@ -8932,14 +8945,14 @@ snapshots: dependencies: call-bound: 1.0.2 es-errors: 1.3.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 object-inspect: 1.13.3 side-channel-weakmap@1.0.2: dependencies: call-bound: 1.0.2 es-errors: 1.3.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 object-inspect: 1.13.3 side-channel-map: 1.0.1 @@ -9013,7 +9026,7 @@ snapshots: es-abstract: 1.23.5 es-errors: 1.3.0 es-object-atoms: 1.0.0 - get-intrinsic: 1.2.5 + get-intrinsic: 1.2.6 gopd: 1.2.0 has-symbols: 1.1.0 internal-slot: 1.0.7 @@ -9021,12 +9034,15 @@ snapshots: set-function-name: 2.0.2 side-channel: 1.1.0 - string.prototype.trim@1.2.9: + string.prototype.trim@1.2.10: dependencies: call-bind: 1.0.8 + call-bound: 1.0.2 + define-data-property: 1.1.4 define-properties: 1.2.1 es-abstract: 1.23.5 es-object-atoms: 1.0.0 + has-property-descriptors: 1.0.2 string.prototype.trimend@1.0.9: dependencies: @@ -9122,7 +9138,7 @@ snapshots: dependencies: three: 0.170.0 - three-stdlib@2.34.1(three@0.170.0): + three-stdlib@2.35.2(three@0.170.0): dependencies: '@types/draco3d': 1.4.10 '@types/offscreencanvas': 2019.7.3 @@ -9387,7 +9403,7 @@ snapshots: is-date-object: 1.0.5 is-finalizationregistry: 1.1.0 is-generator-function: 1.0.10 - is-regex: 1.2.0 + is-regex: 1.2.1 is-weakref: 1.0.2 isarray: 2.0.5 which-boxed-primitive: 1.1.0 diff --git a/src/const.ts b/src/const.ts index ac31d39e1..52663b62c 100644 --- a/src/const.ts +++ b/src/const.ts @@ -1,4 +1,4 @@ -import { getCoordinateFromAddressPointer, safeRelayUrls } from "applesauce-core/helpers"; +import { safeRelayUrls } from "applesauce-core/helpers"; import { EventFactoryClient } from "applesauce-factory"; import { kinds } from "nostr-tools"; @@ -52,7 +52,6 @@ export const NEVER_ATTACH_CLIENT_TAG = [kinds.EncryptedDirectMessage]; export const NIP_89_CLIENT_APP: EventFactoryClient = { name: "noStrudel", address: { - kind: kinds.Handlerinformation, pubkey: "266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5", identifier: "1686066542546", }, diff --git a/src/helpers/nostr/post.ts b/src/helpers/nostr/post.ts index 44e23f92c..9fd17f3c8 100644 --- a/src/helpers/nostr/post.ts +++ b/src/helpers/nostr/post.ts @@ -11,8 +11,8 @@ import { EventSplit } from "./zaps"; import { unique } from "../array"; import { getEventPointerRelayHint } from "../../services/relay-hints"; -import { eventStore } from "../../services/event-store"; +/** @deprecated use event factory instead */ function addTag(tags: Tag[], tag: Tag, overwrite = false) { if (tags.some((t) => t[0] === tag[0] && t[1] === tag[1])) { if (overwrite) { @@ -25,6 +25,8 @@ function addTag(tags: Tag[], tag: Tag, overwrite = false) { } return [...tags, tag]; } + +/** @deprecated use event factory instead */ function AddEtag(tags: Tag[], eventId: string, relayHint?: string, type?: string, overwrite = false) { const hint = relayHint || getEventPointerRelayHint(eventId) || ""; @@ -42,6 +44,7 @@ function AddEtag(tags: Tag[], eventId: string, relayHint?: string, type?: string return [...tags, tag]; } +/** @deprecated use event factory instead */ function AddQuotePointerTag(tags: Tag[], pointer: EventPointer) { const hint = pointer.relays?.[0] || getEventPointerRelayHint(pointer.id) || ""; diff --git a/src/helpers/nostr/stream.ts b/src/helpers/nostr/stream.ts index 773e0d18c..d0a8c7e49 100644 --- a/src/helpers/nostr/stream.ts +++ b/src/helpers/nostr/stream.ts @@ -1,8 +1,9 @@ +import { kinds } from "nostr-tools"; +import { getEventPointerFromETag, getTagValue, safeRelayUrl, unixNow } from "applesauce-core/helpers"; + import { DraftNostrEvent, NostrEvent, isPTag } from "../../types/nostr-event"; import { ensureNotifyContentMentions } from "./post"; import { getEventCoordinate } from "./event"; -import { kinds } from "nostr-tools"; -import { getEventPointerFromTag, getTagValue, safeRelayUrl, unixNow } from "applesauce-core/helpers"; export type StreamStatus = "live" | "ended" | "planned"; @@ -26,7 +27,7 @@ export function getStreamHost(stream: NostrEvent) { export function getStreamGoalPointer(stream: NostrEvent) { const goalTag = stream.tags.find((t) => t[0] === "goal"); - return goalTag && getEventPointerFromTag(goalTag); + return goalTag && getEventPointerFromETag(goalTag); } /** Gets all the streaming urls for a stream */ diff --git a/src/hooks/use-channel-metadata.ts b/src/hooks/use-channel-metadata.ts index 26e976b9d..6e18243d8 100644 --- a/src/hooks/use-channel-metadata.ts +++ b/src/hooks/use-channel-metadata.ts @@ -1,5 +1,5 @@ import { useMemo } from "react"; -import { ChannelMetadataQuery } from "applesauce-channel"; +import { ChannelMetadataQuery } from "applesauce-channel/queries"; import { useStoreQuery } from "applesauce-react/hooks"; import { RequestOptions } from "../services/replaceable-events"; diff --git a/src/providers/global/publish-provider.tsx b/src/providers/global/publish-provider.tsx index 825e266ba..5cae63df9 100644 --- a/src/providers/global/publish-provider.tsx +++ b/src/providers/global/publish-provider.tsx @@ -79,7 +79,10 @@ export default function PublishProvider({ children }: PropsWithChildren) { !draft.tags.some((t) => t[0] === "client") ) { // TODO: this should be removed when all events are created using the event factory - draft = await includeClientTag(NIP_89_CLIENT_APP.name, NIP_89_CLIENT_APP.address)(draft, {}); + draft = await includeClientTag( + NIP_89_CLIENT_APP.name, + NIP_89_CLIENT_APP.address ? { ...NIP_89_CLIENT_APP.address, kind: kinds.Handlerinformation } : undefined, + )(draft, {}); } // request signature diff --git a/src/services/channel-metadata.ts b/src/services/channel-metadata.ts index 963c2160d..2450699ac 100644 --- a/src/services/channel-metadata.ts +++ b/src/services/channel-metadata.ts @@ -2,7 +2,7 @@ import dayjs from "dayjs"; import { Debugger } from "debug"; import _throttle from "lodash.throttle"; import { Filter, kinds } from "nostr-tools"; -import { getChannelPointer } from "applesauce-channel"; +import { getChannelPointer } from "applesauce-channel/helpers"; import SuperMap from "../classes/super-map"; import { NostrEvent } from "../types/nostr-event"; diff --git a/src/views/channels/channel.tsx b/src/views/channels/channel.tsx index d0b4af79c..3d4181e44 100644 --- a/src/views/channels/channel.tsx +++ b/src/views/channels/channel.tsx @@ -2,7 +2,7 @@ import { memo, useCallback, useMemo } from "react"; import { useNavigate } from "react-router-dom"; import { Button, Flex, Heading, Spacer, Spinner, useDisclosure } from "@chakra-ui/react"; import { kinds } from "nostr-tools"; -import { ChannelHiddenQuery, ChannelMessagesQuery, ChannelMutedQuery } from "applesauce-channel"; +import { ChannelHiddenQuery, ChannelMessagesQuery, ChannelMutedQuery } from "applesauce-channel/queries"; import { useStoreQuery } from "applesauce-react/hooks"; import useSingleEvent from "../../hooks/use-single-event"; diff --git a/src/views/channels/components/send-message-form.tsx b/src/views/channels/components/send-message-form.tsx index ca07e236e..6e41db52b 100644 --- a/src/views/channels/components/send-message-form.tsx +++ b/src/views/channels/components/send-message-form.tsx @@ -1,14 +1,14 @@ -import { useCallback, useRef, useState } from "react"; +import { useRef, useState } from "react"; import { useForm } from "react-hook-form"; -import dayjs from "dayjs"; -import { kinds } from "nostr-tools"; - +import { EventTemplate } from "nostr-tools"; import { Button, ButtonGroup, Flex, FlexProps, Heading } from "@chakra-ui/react"; +import { useEventFactory } from "applesauce-react/hooks"; +import { ChannelMessageBlueprint, ChannelMessageReplyBlueprint } from "applesauce-channel/blueprints"; +import { Emoji } from "applesauce-core/helpers"; import MagicTextArea, { RefType } from "../../../components/magic-textarea"; import useTextAreaUploadFile, { useTextAreaInsertTextWithForm } from "../../../hooks/use-textarea-upload-file"; -import { DraftNostrEvent, NostrEvent } from "../../../types/nostr-event"; -import { createEmojiTags, ensureNotifyPubkeys, getPubkeysMentionedInContent } from "../../../helpers/nostr/post"; +import { NostrEvent } from "../../../types/nostr-event"; import { useContextEmojis } from "../../../providers/global/emoji-provider"; import { usePublishEvent } from "../../../providers/global/publish-provider"; import InsertGifButton from "../../../components/gif/insert-gif-button"; @@ -16,11 +16,12 @@ import InsertImageButton from "../../../components/post-modal/insert-image-butto export default function ChannelMessageForm({ channel, - rootId, + root, ...props -}: { channel: NostrEvent; rootId?: string } & Omit) { +}: { channel: NostrEvent; root?: NostrEvent } & Omit) { const publish = usePublishEvent(); const emojis = useContextEmojis(); + const factory = useEventFactory(); const [loadingMessage, setLoadingMessage] = useState(""); const { getValues, setValue, watch, handleSubmit, formState, reset } = useForm({ @@ -37,18 +38,16 @@ export default function ChannelMessageForm({ const { onPaste } = useTextAreaUploadFile(insertText); const sendMessage = handleSubmit(async (values) => { - if (!values.content) return; + if (!values.content || !factory) return; - let draft: DraftNostrEvent = { - kind: kinds.ChannelMessage, - content: values.content, - tags: [["e", rootId || channel.id, "", "root"]], - created_at: dayjs().unix(), - }; + const customEmojis = emojis.filter((e) => !!e.url) as Emoji[]; - const contentMentions = getPubkeysMentionedInContent(draft.content); - draft = createEmojiTags(draft, emojis); - draft = ensureNotifyPubkeys(draft, contentMentions); + let draft: EventTemplate; + if (root) { + draft = await factory.create(ChannelMessageReplyBlueprint, root, values.content, { emojis: customEmojis }); + } else { + draft = await factory.create(ChannelMessageBlueprint, channel, values.content, { emojis: customEmojis }); + } setLoadingMessage("Signing..."); await publish("Send DM", draft, undefined, false);