forked from coracle/flotilla
Update to new version of welshman, including new thunks and wrap manager
This commit is contained in:
+11
-12
@@ -59,17 +59,16 @@
|
|||||||
"@types/throttle-debounce": "^5.0.2",
|
"@types/throttle-debounce": "^5.0.2",
|
||||||
"@vite-pwa/assets-generator": "^0.2.6",
|
"@vite-pwa/assets-generator": "^0.2.6",
|
||||||
"@vite-pwa/sveltekit": "^0.6.8",
|
"@vite-pwa/sveltekit": "^0.6.8",
|
||||||
"@welshman/app": "^0.5.3",
|
"@welshman/app": "^0.6.0",
|
||||||
"@welshman/content": "^0.5.3",
|
"@welshman/content": "^0.6.0",
|
||||||
"@welshman/editor": "^0.5.3",
|
"@welshman/editor": "^0.6.0",
|
||||||
"@welshman/feeds": "^0.5.3",
|
"@welshman/feeds": "^0.6.0",
|
||||||
"@welshman/lib": "^0.5.3",
|
"@welshman/lib": "^0.6.0",
|
||||||
"@welshman/net": "^0.5.3",
|
"@welshman/net": "^0.6.0",
|
||||||
"@welshman/relay": "^0.5.3",
|
"@welshman/router": "^0.6.0",
|
||||||
"@welshman/router": "^0.5.3",
|
"@welshman/signer": "^0.6.0",
|
||||||
"@welshman/signer": "^0.5.3",
|
"@welshman/store": "^0.6.0",
|
||||||
"@welshman/store": "^0.5.3",
|
"@welshman/util": "^0.6.0",
|
||||||
"@welshman/util": "^0.5.3",
|
|
||||||
"compressorjs": "^1.2.1",
|
"compressorjs": "^1.2.1",
|
||||||
"daisyui": "^4.12.24",
|
"daisyui": "^4.12.24",
|
||||||
"date-picker-svelte": "^2.16.0",
|
"date-picker-svelte": "^2.16.0",
|
||||||
@@ -79,7 +78,7 @@
|
|||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"idb": "^8.0.3",
|
"idb": "^8.0.3",
|
||||||
"nostr-signer-capacitor-plugin": "^0.0.4",
|
"nostr-signer-capacitor-plugin": "^0.0.4",
|
||||||
"nostr-tools": "^2.17.0",
|
"nostr-tools": "^2.14.2",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||||
"qr-scanner": "^1.4.2",
|
"qr-scanner": "^1.4.2",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
|
|||||||
Generated
+81
-95
@@ -72,38 +72,35 @@ importers:
|
|||||||
specifier: ^0.6.8
|
specifier: ^0.6.8
|
||||||
version: 0.6.8(@sveltejs/kit@2.46.5(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.39.12)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0)))(svelte@5.39.12)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0)))(@vite-pwa/assets-generator@0.2.6)(vite-plugin-pwa@0.21.2(@vite-pwa/assets-generator@0.2.6)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0))(workbox-build@7.3.0)(workbox-window@7.3.0))
|
version: 0.6.8(@sveltejs/kit@2.46.5(@sveltejs/vite-plugin-svelte@4.0.4(svelte@5.39.12)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0)))(svelte@5.39.12)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0)))(@vite-pwa/assets-generator@0.2.6)(vite-plugin-pwa@0.21.2(@vite-pwa/assets-generator@0.2.6)(vite@5.4.20(@types/node@24.7.2)(terser@5.44.0))(workbox-build@7.3.0)(workbox-window@7.3.0))
|
||||||
'@welshman/app':
|
'@welshman/app':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
version: 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/content':
|
'@welshman/content':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(typescript@5.9.3)
|
version: 0.6.0(typescript@5.9.3)
|
||||||
'@welshman/editor':
|
'@welshman/editor':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(linkifyjs@4.3.2)(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(typescript@5.9.3)
|
version: 0.6.0(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(linkifyjs@4.3.2)(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(typescript@5.9.3)
|
||||||
'@welshman/feeds':
|
'@welshman/feeds':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
version: 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/lib':
|
'@welshman/lib':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3
|
version: 0.6.0
|
||||||
'@welshman/net':
|
'@welshman/net':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(typescript@5.9.3)(ws@8.18.3)
|
version: 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/relay':
|
|
||||||
specifier: ^0.5.3
|
|
||||||
version: 0.5.3(typescript@5.9.3)
|
|
||||||
'@welshman/router':
|
'@welshman/router':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(typescript@5.9.3)
|
version: 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/signer':
|
'@welshman/signer':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
version: 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/store':
|
'@welshman/store':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(typescript@5.9.3)
|
version: 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/util':
|
'@welshman/util':
|
||||||
specifier: ^0.5.3
|
specifier: ^0.6.0
|
||||||
version: 0.5.3(typescript@5.9.3)
|
version: 0.6.0(typescript@5.9.3)
|
||||||
compressorjs:
|
compressorjs:
|
||||||
specifier: ^1.2.1
|
specifier: ^1.2.1
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
@@ -132,7 +129,7 @@ importers:
|
|||||||
specifier: ^0.0.4
|
specifier: ^0.0.4
|
||||||
version: 0.0.4(@capacitor/core@7.4.3)
|
version: 0.0.4(@capacitor/core@7.4.3)
|
||||||
nostr-tools:
|
nostr-tools:
|
||||||
specifier: ^2.17.0
|
specifier: ^2.14.2
|
||||||
version: 2.17.0(typescript@5.9.3)
|
version: 2.17.0(typescript@5.9.3)
|
||||||
prettier-plugin-tailwindcss:
|
prettier-plugin-tailwindcss:
|
||||||
specifier: ^0.6.14
|
specifier: ^0.6.14
|
||||||
@@ -1695,41 +1692,38 @@ packages:
|
|||||||
'@vite-pwa/assets-generator':
|
'@vite-pwa/assets-generator':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@welshman/app@0.5.3':
|
'@welshman/app@0.6.0':
|
||||||
resolution: {integrity: sha512-uygqUotknMYPEE7jkpBEWJXEfwHrowbMYuR1TygdqqKIWv/BzlZ7HO/infIHZHWy1xuR/9gEFhEY1sukxkNEow==}
|
resolution: {integrity: sha512-izbI6581NvadR8ACLGnqzyS0iTl7qLwv+hHodsoNSqEQ3/Wo0fEyOyxPhgQkJv1BgVRLPgJ1x31dNsSGl6sCsw==}
|
||||||
|
|
||||||
'@welshman/content@0.5.3':
|
'@welshman/content@0.6.0':
|
||||||
resolution: {integrity: sha512-o4zQReYP0dcE6ofom0nEbYqSBe+dlNdQAQ3LcaRY2Bgm+IG8mPtT8FZ6SFnAHJOG215MW5uQ8eUuqOtSKzlYcg==}
|
resolution: {integrity: sha512-Db3NdHk8oyITtH1YjTHIlcMfnfCqEuwmMTTDqwMwJ+Lj1yrLHzd+D36+MS36gVfUgxYu/CvV2LP8Hui25J/RDA==}
|
||||||
|
|
||||||
'@welshman/editor@0.5.3':
|
'@welshman/editor@0.6.0':
|
||||||
resolution: {integrity: sha512-rIm3WquSVcBDwaa0tI9ppBHnEEHifPWAy6kTks1M2ZLUNrhyBMMCqsjEIJiWEmP7uVuzvsSH3LDk/Bs+tYUPcg==}
|
resolution: {integrity: sha512-JQURL22IE4sbjD7PnLVscY9WIXFQMoXL9JblNsVh+NHR/YtCSH8n++NxW2k4wqWeCbp/gEZYrBIVEIwBuvONbw==}
|
||||||
|
|
||||||
'@welshman/feeds@0.5.3':
|
'@welshman/feeds@0.6.0':
|
||||||
resolution: {integrity: sha512-ilE6Ui+nKlV+fyk8MDd+3fx5xU/K5hOLM5p0idE+cLeA0th2IanKm4JRS5vz9p/Niox4XhyvuaCxVNRLxXZ4zg==}
|
resolution: {integrity: sha512-NmNQDKQrKrEsa5q3TqPgHUkdvIbtq9jo1kN6HCZr8A+sK7vteuOZuwm7YGdNRlfJOwoDG1Edc0HKzNmtQA/wHA==}
|
||||||
|
|
||||||
'@welshman/lib@0.5.3':
|
'@welshman/lib@0.6.0':
|
||||||
resolution: {integrity: sha512-XElYDyJhuHLHwJdaoTKdq9a+evUoFxqguTh18cIOpsp55f8FOVcmF67PN3YZ7p/PTt6d3kWh7jQ2AIo3yJIPQg==}
|
resolution: {integrity: sha512-clW0W7hqo0/HyoCd8xYAWmAMuWEZQERVmnyYA/6os5ZJDZYq9oSDL/AanYQnB8rme2XoZjxUgDZEhRz8cPFvRQ==}
|
||||||
engines: {node: '>=12.0.0'}
|
engines: {node: '>=12.0.0'}
|
||||||
|
|
||||||
'@welshman/net@0.5.3':
|
'@welshman/net@0.6.0':
|
||||||
resolution: {integrity: sha512-XhGwkG35LuLo38pFJmkEa1/D0DaMP83KziZ9F0VMVDNOSgSCkLBuANbcCeZWcNuKNb/EwlvzJZLWA0ywqyq+1g==}
|
resolution: {integrity: sha512-ZNyIKaDfZd2gpoVLVPnvuFsqM+bhgSA7XTlT0KHytTeRHQ8aYAkTMKGUgxASAISAqwX84HcNhoKQODP+4YgFow==}
|
||||||
|
|
||||||
'@welshman/relay@0.5.3':
|
'@welshman/router@0.6.0':
|
||||||
resolution: {integrity: sha512-AWWDQ01TPMsakuET+hkarBQeeqk20mcKk4fmeR/bEUZWSGCDbCK6pD1L1ozilJ5dQKTmWrSzHGe+jJU4sFvZNw==}
|
resolution: {integrity: sha512-6g/pPQrSwDW0LXvGlrg+TvLkpJ7zNkW/qrnPKQYH591dOqB+z6LQ6hstI4m+FJBBB9a9qjx2gnzptUMKkesHow==}
|
||||||
|
|
||||||
'@welshman/router@0.5.3':
|
'@welshman/signer@0.6.0':
|
||||||
resolution: {integrity: sha512-abowfhW14vDBZFcDZuTAj4ktIJyfmOkAWlkXAD3g1mu2amoJ0LZ2jDro8GEFa+qUv2dnxLh0yILdv/89SzUguA==}
|
resolution: {integrity: sha512-uQqapz9kMm0CaUrvXxDHo5Hao/jmUQLnd9dEoBJ1a6WbNolzCu9eaa3fue78MIxujEHBq3KKGPsp1KFH6MXBhg==}
|
||||||
|
|
||||||
'@welshman/signer@0.5.3':
|
|
||||||
resolution: {integrity: sha512-XlXtVpF5Mj4bmYtf32p1eRCsBK3o8e+lfBFJ7kXIU0FWmZHVtOnl7+ZjU5SCRqREG4zmzn6Ad0G/JA4kYJMIWw==}
|
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
nostr-signer-capacitor-plugin: ~0.0.4
|
nostr-signer-capacitor-plugin: ~0.0.4
|
||||||
|
|
||||||
'@welshman/store@0.5.3':
|
'@welshman/store@0.6.0':
|
||||||
resolution: {integrity: sha512-VB2r0NASwnFxzm/Io1qZ73yD3lHA8wEEjmlHOnH0FXNp/UNlJKGREWsgsjbLH/A+04lCjsMv2QmlkW2NqCBS/A==}
|
resolution: {integrity: sha512-sCxIrBPw9lOtvM0C3cm+a62LmgAJZkLtoZOzHgU7WQU5z4xIskYUwCzFIT6YuZdewRXNV86JF6uOfWC6Ff+J4w==}
|
||||||
|
|
||||||
'@welshman/util@0.5.3':
|
'@welshman/util@0.6.0':
|
||||||
resolution: {integrity: sha512-avMOK1AcO3V9qTQP+oAl4pgTdquD86Fkey74f1WOOu3BZRVgWN7LjBQCecszW9BQMg/TH4mUk2PuSqSoPy8zSw==}
|
resolution: {integrity: sha512-ll4mOff5ujIN55FhvvrFnHNrVmEepswmuDaEW9HC/UlIgmEc3By6wq83OX8/fdJxUhU98wXV6XXHsM14UCpMZg==}
|
||||||
|
|
||||||
'@xml-tools/parser@1.0.11':
|
'@xml-tools/parser@1.0.11':
|
||||||
resolution: {integrity: sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==}
|
resolution: {integrity: sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==}
|
||||||
@@ -6210,12 +6204,12 @@ snapshots:
|
|||||||
'@scure/bip32@1.3.1':
|
'@scure/bip32@1.3.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/curves': 1.1.0
|
'@noble/curves': 1.1.0
|
||||||
'@noble/hashes': 1.3.1
|
'@noble/hashes': 1.3.2
|
||||||
'@scure/base': 1.1.1
|
'@scure/base': 1.1.1
|
||||||
|
|
||||||
'@scure/bip39@1.2.1':
|
'@scure/bip39@1.2.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/hashes': 1.3.1
|
'@noble/hashes': 1.3.2
|
||||||
'@scure/base': 1.1.1
|
'@scure/base': 1.1.1
|
||||||
|
|
||||||
'@sentry-internal/browser-utils@8.55.0':
|
'@sentry-internal/browser-utils@8.55.0':
|
||||||
@@ -6657,17 +6651,16 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@vite-pwa/assets-generator': 0.2.6
|
'@vite-pwa/assets-generator': 0.2.6
|
||||||
|
|
||||||
'@welshman/app@0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
'@welshman/app@0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/throttle-debounce': 5.0.2
|
'@types/throttle-debounce': 5.0.2
|
||||||
'@welshman/feeds': 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/feeds': 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/net': 0.5.3(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/net': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/relay': 0.5.3(typescript@5.9.3)
|
'@welshman/router': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/router': 0.5.3(typescript@5.9.3)
|
'@welshman/signer': 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/signer': 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/store': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/store': 0.5.3(typescript@5.9.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
|
||||||
fuse.js: 7.1.0
|
fuse.js: 7.1.0
|
||||||
svelte: 4.2.20
|
svelte: 4.2.20
|
||||||
throttle-debounce: 5.0.2
|
throttle-debounce: 5.0.2
|
||||||
@@ -6676,14 +6669,14 @@ snapshots:
|
|||||||
- typescript
|
- typescript
|
||||||
- ws
|
- ws
|
||||||
|
|
||||||
'@welshman/content@0.5.3(typescript@5.9.3)':
|
'@welshman/content@0.6.0(typescript@5.9.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@braintree/sanitize-url': 7.1.1
|
'@braintree/sanitize-url': 7.1.1
|
||||||
nostr-tools: 2.17.0(typescript@5.9.3)
|
nostr-tools: 2.17.0(typescript@5.9.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@welshman/editor@0.5.3(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(linkifyjs@4.3.2)(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(typescript@5.9.3)':
|
'@welshman/editor@0.6.0(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(linkifyjs@4.3.2)(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(typescript@5.9.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@tiptap/core': 2.26.3(@tiptap/pm@2.26.3)
|
'@tiptap/core': 2.26.3(@tiptap/pm@2.26.3)
|
||||||
'@tiptap/extension-code': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))
|
'@tiptap/extension-code': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))
|
||||||
@@ -6698,8 +6691,8 @@ snapshots:
|
|||||||
'@tiptap/extension-text': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))
|
'@tiptap/extension-text': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))
|
||||||
'@tiptap/pm': 2.26.3
|
'@tiptap/pm': 2.26.3
|
||||||
'@tiptap/suggestion': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3)
|
'@tiptap/suggestion': 2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3)
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
nostr-editor: 1.0.1(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3)(linkifyjs@4.3.2)(nostr-tools@2.17.0(typescript@5.9.3))(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))
|
nostr-editor: 1.0.1(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/extension-image@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))(@tiptap/extension-link@2.26.3(@tiptap/core@2.26.3(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3))(@tiptap/pm@2.26.3)(linkifyjs@4.3.2)(nostr-tools@2.17.0(typescript@5.9.3))(prosemirror-markdown@1.13.2)(prosemirror-model@1.25.3)(prosemirror-state@1.4.3)(prosemirror-view@1.41.3)(tiptap-markdown@0.8.10(@tiptap/core@2.26.3(@tiptap/pm@2.26.3)))
|
||||||
nostr-tools: 2.17.0(typescript@5.9.3)
|
nostr-tools: 2.17.0(typescript@5.9.3)
|
||||||
tippy.js: 6.3.7
|
tippy.js: 6.3.7
|
||||||
@@ -6714,78 +6707,71 @@ snapshots:
|
|||||||
- tiptap-markdown
|
- tiptap-markdown
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@welshman/feeds@0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
'@welshman/feeds@0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/net': 0.5.3(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/net': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/relay': 0.5.3(typescript@5.9.3)
|
'@welshman/router': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/router': 0.5.3(typescript@5.9.3)
|
'@welshman/signer': 0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/signer': 0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
|
||||||
trava: 1.2.1
|
trava: 1.2.1
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- nostr-signer-capacitor-plugin
|
- nostr-signer-capacitor-plugin
|
||||||
- typescript
|
- typescript
|
||||||
- ws
|
- ws
|
||||||
|
|
||||||
'@welshman/lib@0.5.3':
|
'@welshman/lib@0.6.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@scure/base': 1.2.6
|
'@scure/base': 1.2.6
|
||||||
'@types/events': 3.0.3
|
'@types/events': 3.0.3
|
||||||
events: 3.3.0
|
events: 3.3.0
|
||||||
|
|
||||||
'@welshman/net@0.5.3(typescript@5.9.3)(ws@8.18.3)':
|
'@welshman/net@0.6.0(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/relay': 0.5.3(typescript@5.9.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
|
||||||
events: 3.3.0
|
events: 3.3.0
|
||||||
isomorphic-ws: 5.0.0(ws@8.18.3)
|
isomorphic-ws: 5.0.0(ws@8.18.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
- ws
|
- ws
|
||||||
|
|
||||||
'@welshman/relay@0.5.3(typescript@5.9.3)':
|
'@welshman/router@0.6.0(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
'@welshman/net': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
|
- ws
|
||||||
|
|
||||||
'@welshman/router@0.5.3(typescript@5.9.3)':
|
'@welshman/signer@0.6.0(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
|
||||||
'@welshman/lib': 0.5.3
|
|
||||||
'@welshman/relay': 0.5.3(typescript@5.9.3)
|
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- typescript
|
|
||||||
|
|
||||||
'@welshman/signer@0.5.3(nostr-signer-capacitor-plugin@0.0.4(@capacitor/core@7.4.3))(typescript@5.9.3)(ws@8.18.3)':
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@noble/curves': 1.9.7
|
'@noble/curves': 1.9.7
|
||||||
'@noble/hashes': 1.8.0
|
'@noble/hashes': 1.8.0
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/net': 0.5.3(typescript@5.9.3)(ws@8.18.3)
|
'@welshman/net': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
nostr-signer-capacitor-plugin: 0.0.4(@capacitor/core@7.4.3)
|
nostr-signer-capacitor-plugin: 0.0.4(@capacitor/core@7.4.3)
|
||||||
nostr-tools: 2.17.0(typescript@5.9.3)
|
nostr-tools: 2.17.0(typescript@5.9.3)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
- ws
|
- ws
|
||||||
|
|
||||||
'@welshman/store@0.5.3(typescript@5.9.3)':
|
'@welshman/store@0.6.0(typescript@5.9.3)(ws@8.18.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
'@welshman/relay': 0.5.3(typescript@5.9.3)
|
'@welshman/net': 0.6.0(typescript@5.9.3)(ws@8.18.3)
|
||||||
'@welshman/util': 0.5.3(typescript@5.9.3)
|
'@welshman/util': 0.6.0(typescript@5.9.3)
|
||||||
svelte: 4.2.20
|
svelte: 4.2.20
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
|
- ws
|
||||||
|
|
||||||
'@welshman/util@0.5.3(typescript@5.9.3)':
|
'@welshman/util@0.6.0(typescript@5.9.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/ws': 8.18.1
|
'@types/ws': 8.18.1
|
||||||
'@welshman/lib': 0.5.3
|
'@welshman/lib': 0.6.0
|
||||||
js-base64: 3.7.8
|
js-base64: 3.7.8
|
||||||
nostr-tools: 2.17.0(typescript@5.9.3)
|
nostr-tools: 2.17.0(typescript@5.9.3)
|
||||||
nostr-wasm: 0.1.0
|
nostr-wasm: 0.1.0
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import {
|
import {
|
||||||
thunks,
|
thunks,
|
||||||
pubkey,
|
pubkey,
|
||||||
|
mergeThunks,
|
||||||
deriveProfile,
|
deriveProfile,
|
||||||
deriveProfileDisplay,
|
deriveProfileDisplay,
|
||||||
displayProfileByPubkey,
|
displayProfileByPubkey,
|
||||||
@@ -52,12 +53,12 @@
|
|||||||
onEdit,
|
onEdit,
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
const thunk = $thunks[event.id]
|
|
||||||
const path = getChannelItemPath(url, event)
|
const path = getChannelItemPath(url, event)
|
||||||
const shouldProtect = canEnforceNip70(url)
|
const shouldProtect = canEnforceNip70(url)
|
||||||
const today = formatTimestampAsDate(now())
|
const today = formatTimestampAsDate(now())
|
||||||
const profile = deriveProfile(event.pubkey, [url])
|
const profile = deriveProfile(event.pubkey, [url])
|
||||||
const profileDisplay = deriveProfileDisplay(event.pubkey, [url])
|
const profileDisplay = deriveProfileDisplay(event.pubkey, [url])
|
||||||
|
const thunk = mergeThunks($thunks.filter(t => t.event.id === event.id))
|
||||||
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||||
const comments = deriveEventsForUrl(url, [{kinds: [COMMENT], "#e": [event.id]}])
|
const comments = deriveEventsForUrl(url, [{kinds: [COMMENT], "#e": [event.id]}])
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
MINUTE,
|
MINUTE,
|
||||||
sortBy,
|
sortBy,
|
||||||
remove,
|
remove,
|
||||||
|
enumerate,
|
||||||
formatTimestampAsDate,
|
formatTimestampAsDate,
|
||||||
} from "@welshman/lib"
|
} from "@welshman/lib"
|
||||||
import type {TrustedEvent, EventTemplate, EventContent} from "@welshman/util"
|
import type {TrustedEvent, EventTemplate, EventContent} from "@welshman/util"
|
||||||
@@ -30,7 +31,6 @@
|
|||||||
loadInboxRelaySelections,
|
loadInboxRelaySelections,
|
||||||
inboxRelaySelectionsByPubkey,
|
inboxRelaySelectionsByPubkey,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import type {AbstractThunk} from "@welshman/app"
|
|
||||||
import Danger from "@assets/icons/danger-triangle.svg?dataurl"
|
import Danger from "@assets/icons/danger-triangle.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Link from "@lib/components/Link.svelte"
|
import Link from "@lib/components/Link.svelte"
|
||||||
@@ -126,14 +126,13 @@
|
|||||||
|
|
||||||
// Split the message into multiple pieces so that we can use kind 15 to send images per nip 17
|
// Split the message into multiple pieces so that we can use kind 15 to send images per nip 17
|
||||||
// Sleep 1 second between each one to make sure timestamps are distinct
|
// Sleep 1 second between each one to make sure timestamps are distinct
|
||||||
const thunks: AbstractThunk[] = []
|
const thunks = Array.from(enumerate(templates)).map(([i, event]) =>
|
||||||
for (let i = 0; i < templates.length; i++) {
|
sendWrapped({
|
||||||
const template = templates[i]
|
event,
|
||||||
|
recipients: pubkeys,
|
||||||
thunks.push(
|
delay: $userSettingsValues.send_delay + ms(i),
|
||||||
await sendWrapped({pubkeys, template, delay: $userSettingsValues.send_delay + ms(i)}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
pushToast({
|
pushToast({
|
||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
import {preventDefault} from "@lib/html"
|
import {preventDefault} from "@lib/html"
|
||||||
|
import {shouldUnwrap} from "@welshman/app"
|
||||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||||
import AltArrowRight from "@assets/icons/alt-arrow-right.svg?dataurl"
|
import AltArrowRight from "@assets/icons/alt-arrow-right.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
@@ -9,7 +10,6 @@
|
|||||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||||
import {PLATFORM_NAME} from "@app/core/state"
|
import {PLATFORM_NAME} from "@app/core/state"
|
||||||
import {enableGiftWraps} from "@app/core/commands"
|
|
||||||
import {clearModals} from "@app/util/modal"
|
import {clearModals} from "@app/util/modal"
|
||||||
|
|
||||||
const {next} = $props()
|
const {next} = $props()
|
||||||
@@ -18,17 +18,13 @@
|
|||||||
|
|
||||||
let loading = $state(false)
|
let loading = $state(false)
|
||||||
|
|
||||||
const enableChat = async () => {
|
|
||||||
enableGiftWraps()
|
|
||||||
clearModals()
|
|
||||||
goto(nextUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await enableChat()
|
shouldUnwrap.set(true)
|
||||||
|
clearModals()
|
||||||
|
goto(nextUrl)
|
||||||
} finally {
|
} finally {
|
||||||
loading = false
|
loading = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
import {type Instance} from "tippy.js"
|
import {type Instance} from "tippy.js"
|
||||||
import {hash, formatTimestampAsTime} from "@welshman/lib"
|
import {hash, formatTimestampAsTime} from "@welshman/lib"
|
||||||
import type {TrustedEvent, EventContent} from "@welshman/util"
|
import type {TrustedEvent, EventContent} from "@welshman/util"
|
||||||
import {thunks, pubkey, deriveProfile, deriveProfileDisplay, sendWrapped} from "@welshman/app"
|
import {
|
||||||
|
thunks,
|
||||||
|
mergeThunks,
|
||||||
|
pubkey,
|
||||||
|
deriveProfile,
|
||||||
|
deriveProfileDisplay,
|
||||||
|
sendWrapped,
|
||||||
|
} from "@welshman/app"
|
||||||
import {isMobile} from "@lib/html"
|
import {isMobile} from "@lib/html"
|
||||||
import MenuDots from "@assets/icons/menu-dots.svg?dataurl"
|
import MenuDots from "@assets/icons/menu-dots.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
@@ -29,19 +36,19 @@
|
|||||||
|
|
||||||
const {event, replyTo, pubkeys, showPubkey = false}: Props = $props()
|
const {event, replyTo, pubkeys, showPubkey = false}: Props = $props()
|
||||||
|
|
||||||
const thunk = $thunks[event.id]
|
|
||||||
const isOwn = event.pubkey === $pubkey
|
const isOwn = event.pubkey === $pubkey
|
||||||
const profile = deriveProfile(event.pubkey)
|
const profile = deriveProfile(event.pubkey)
|
||||||
const profileDisplay = deriveProfileDisplay(event.pubkey)
|
const profileDisplay = deriveProfileDisplay(event.pubkey)
|
||||||
|
const thunk = mergeThunks($thunks.filter(t => t.event.id === event.id))
|
||||||
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
|
||||||
|
|
||||||
const reply = () => replyTo(event)
|
const reply = () => replyTo(event)
|
||||||
|
|
||||||
const deleteReaction = (event: TrustedEvent) =>
|
const deleteReaction = (event: TrustedEvent) =>
|
||||||
sendWrapped({template: makeDelete({event, protect: false}), pubkeys})
|
sendWrapped({event: makeDelete({event, protect: false}), recipients: pubkeys})
|
||||||
|
|
||||||
const createReaction = (template: EventContent) =>
|
const createReaction = (template: EventContent) =>
|
||||||
sendWrapped({template: makeReaction({event, protect: false, ...template}), pubkeys})
|
sendWrapped({event: makeReaction({event, protect: false, ...template}), recipients: pubkeys})
|
||||||
|
|
||||||
const openProfile = () => pushModal(ProfileDetail, {pubkey: event.pubkey})
|
const openProfile = () => pushModal(ProfileDetail, {pubkey: event.pubkey})
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,10 @@
|
|||||||
const {event, pubkeys}: Props = $props()
|
const {event, pubkeys}: Props = $props()
|
||||||
|
|
||||||
const onEmoji = (emoji: NativeEmoji) =>
|
const onEmoji = (emoji: NativeEmoji) =>
|
||||||
sendWrapped({template: makeReaction({event, content: emoji.unicode, protect: false}), pubkeys})
|
sendWrapped({
|
||||||
|
event: makeReaction({event, content: emoji.unicode, protect: false}),
|
||||||
|
recipients: pubkeys,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<EmojiButton {onEmoji} class="btn join-item btn-xs">
|
<EmojiButton {onEmoji} class="btn join-item btn-xs">
|
||||||
|
|||||||
@@ -24,7 +24,10 @@
|
|||||||
|
|
||||||
const onEmoji = ((event: TrustedEvent, pubkeys: string[], emoji: NativeEmoji) => {
|
const onEmoji = ((event: TrustedEvent, pubkeys: string[], emoji: NativeEmoji) => {
|
||||||
history.back()
|
history.back()
|
||||||
sendWrapped({template: makeReaction({event, content: emoji.unicode, protect: false}), pubkeys})
|
sendWrapped({
|
||||||
|
event: makeReaction({event, content: emoji.unicode, protect: false}),
|
||||||
|
recipients: pubkeys,
|
||||||
|
})
|
||||||
}).bind(undefined, event, pubkeys)
|
}).bind(undefined, event, pubkeys)
|
||||||
|
|
||||||
const showEmojiPicker = () => pushModal(EmojiPicker, {onClick: onEmoji}, {replaceState: true})
|
const showEmojiPicker = () => pushModal(EmojiPicker, {onClick: onEmoji}, {replaceState: true})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
import {splitAt} from "@welshman/lib"
|
import {splitAt} from "@welshman/lib"
|
||||||
import {userProfile} from "@welshman/app"
|
import {userProfile, shouldUnwrap} from "@welshman/app"
|
||||||
import Avatar from "@lib/components/Avatar.svelte"
|
import Avatar from "@lib/components/Avatar.svelte"
|
||||||
import Divider from "@lib/components/Divider.svelte"
|
import Divider from "@lib/components/Divider.svelte"
|
||||||
import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte"
|
import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte"
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
import MenuOtherSpaces from "@app/components/MenuOtherSpaces.svelte"
|
import MenuOtherSpaces from "@app/components/MenuOtherSpaces.svelte"
|
||||||
import MenuSettings from "@app/components/MenuSettings.svelte"
|
import MenuSettings from "@app/components/MenuSettings.svelte"
|
||||||
import PrimaryNavItemSpace from "@app/components/PrimaryNavItemSpace.svelte"
|
import PrimaryNavItemSpace from "@app/components/PrimaryNavItemSpace.svelte"
|
||||||
import {userRoomsByUrl, canDecrypt, PLATFORM_RELAYS, PLATFORM_LOGO} from "@app/core/state"
|
import {userRoomsByUrl, PLATFORM_RELAYS, PLATFORM_LOGO} from "@app/core/state"
|
||||||
import {pushModal} from "@app/util/modal"
|
import {pushModal} from "@app/util/modal"
|
||||||
import {makeSpacePath} from "@app/util/routes"
|
import {makeSpacePath} from "@app/util/routes"
|
||||||
import {notifications} from "@app/util/notifications"
|
import {notifications} from "@app/util/notifications"
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
const showSettingsMenu = () => pushModal(MenuSettings)
|
const showSettingsMenu = () => pushModal(MenuSettings)
|
||||||
|
|
||||||
const openChat = () => ($canDecrypt ? goto("/chat") : pushModal(ChatEnable, {next: "/chat"}))
|
const openChat = () => ($shouldUnwrap ? goto("/chat") : pushModal(ChatEnable, {next: "/chat"}))
|
||||||
|
|
||||||
const hasNotification = (url: string) => {
|
const hasNotification = (url: string) => {
|
||||||
const path = makeSpacePath(url)
|
const path = makeSpacePath(url)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
|
import {shouldUnwrap} from "@welshman/app"
|
||||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||||
import Letter from "@assets/icons/letter-opened.svg?dataurl"
|
import Letter from "@assets/icons/letter-opened.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
@@ -11,7 +12,7 @@
|
|||||||
import ProfileInfo from "@app/components/ProfileInfo.svelte"
|
import ProfileInfo from "@app/components/ProfileInfo.svelte"
|
||||||
import ProfileBadges from "@app/components/ProfileBadges.svelte"
|
import ProfileBadges from "@app/components/ProfileBadges.svelte"
|
||||||
import ChatEnable from "@app/components/ChatEnable.svelte"
|
import ChatEnable from "@app/components/ChatEnable.svelte"
|
||||||
import {canDecrypt, pubkeyLink} from "@app/core/state"
|
import {pubkeyLink} from "@app/core/state"
|
||||||
import {pushModal} from "@app/util/modal"
|
import {pushModal} from "@app/util/modal"
|
||||||
import {makeChatPath} from "@app/util/routes"
|
import {makeChatPath} from "@app/util/routes"
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@
|
|||||||
|
|
||||||
const chatPath = makeChatPath([pubkey])
|
const chatPath = makeChatPath([pubkey])
|
||||||
|
|
||||||
const openChat = () => ($canDecrypt ? goto(chatPath) : pushModal(ChatEnable, {next: chatPath}))
|
const openChat = () => ($shouldUnwrap ? goto(chatPath) : pushModal(ChatEnable, {next: chatPath}))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {stopPropagation} from "svelte/legacy"
|
import {stopPropagation} from "svelte/legacy"
|
||||||
import {noop} from "@welshman/lib"
|
import {noop} from "@welshman/lib"
|
||||||
import {
|
import type {AbstractThunk} from "@welshman/app"
|
||||||
MergedThunk,
|
import {retryThunk, thunkIsComplete, getFailedThunkUrls} from "@welshman/app"
|
||||||
publishThunk,
|
|
||||||
isMergedThunk,
|
|
||||||
thunkIsComplete,
|
|
||||||
getFailedThunkUrls,
|
|
||||||
} from "@welshman/app"
|
|
||||||
import type {Thunk} from "@welshman/app"
|
|
||||||
import Danger from "@assets/icons/danger-triangle.svg?dataurl"
|
import Danger from "@assets/icons/danger-triangle.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Tippy from "@lib/components/Tippy.svelte"
|
import Tippy from "@lib/components/Tippy.svelte"
|
||||||
@@ -17,7 +11,7 @@
|
|||||||
import {pushToast} from "@app/util/toast"
|
import {pushToast} from "@app/util/toast"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
thunk: Thunk | MergedThunk
|
thunk: AbstractThunk
|
||||||
showToastOnRetry?: boolean
|
showToastOnRetry?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
}
|
}
|
||||||
@@ -25,9 +19,7 @@
|
|||||||
let {thunk, showToastOnRetry, ...restProps}: Props = $props()
|
let {thunk, showToastOnRetry, ...restProps}: Props = $props()
|
||||||
|
|
||||||
const retry = () => {
|
const retry = () => {
|
||||||
thunk = isMergedThunk(thunk)
|
thunk = retryThunk(thunk)
|
||||||
? new MergedThunk(thunk.thunks.map(t => publishThunk(t.options)))
|
|
||||||
: publishThunk(thunk.options)
|
|
||||||
|
|
||||||
if (showToastOnRetry) {
|
if (showToastOnRetry) {
|
||||||
pushToast({
|
pushToast({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {MergedThunk, thunkIsComplete, getFailedThunkUrls} from "@welshman/app"
|
import type {AbstractThunk} from "@welshman/app"
|
||||||
import type {Thunk} from "@welshman/app"
|
import {thunkIsComplete, getFailedThunkUrls} from "@welshman/app"
|
||||||
import ThunkFailure from "@app/components/ThunkFailure.svelte"
|
import ThunkFailure from "@app/components/ThunkFailure.svelte"
|
||||||
import ThunkPending from "@app/components/ThunkPending.svelte"
|
import ThunkPending from "@app/components/ThunkPending.svelte"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
thunk: Thunk | MergedThunk
|
thunk: AbstractThunk
|
||||||
class?: string
|
class?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type {TrustedEvent} from "@welshman/util"
|
import type {TrustedEvent} from "@welshman/util"
|
||||||
import {deriveIsDeleted} from "@welshman/store"
|
import {deriveIsDeleted} from "@welshman/store"
|
||||||
import {thunks, repository} from "@welshman/app"
|
import {thunks, mergeThunks, repository} from "@welshman/app"
|
||||||
import ThunkStatus from "@app/components/ThunkStatus.svelte"
|
import ThunkStatus from "@app/components/ThunkStatus.svelte"
|
||||||
|
|
||||||
const {event}: {event: TrustedEvent} = $props()
|
const {event}: {event: TrustedEvent} = $props()
|
||||||
|
|
||||||
const thunk = $derived($thunks[event.id])
|
|
||||||
const deleted = deriveIsDeleted(repository, event)
|
const deleted = deriveIsDeleted(repository, event)
|
||||||
|
const thunk = $derived(mergeThunks($thunks.filter(t => t.event.id === event.id)))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $deleted}
|
{#if $deleted}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ import {
|
|||||||
waitForThunkError,
|
waitForThunkError,
|
||||||
getPubkeyRelays,
|
getPubkeyRelays,
|
||||||
userBlossomServers,
|
userBlossomServers,
|
||||||
|
shouldUnwrap,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import {compressFile} from "@src/lib/html"
|
import {compressFile} from "@src/lib/html"
|
||||||
import type {SettingsValues, Alert} from "@app/core/state"
|
import type {SettingsValues, Alert} from "@app/core/state"
|
||||||
@@ -103,8 +104,6 @@ import {
|
|||||||
DEFAULT_BLOSSOM_SERVERS,
|
DEFAULT_BLOSSOM_SERVERS,
|
||||||
userRoomsByUrl,
|
userRoomsByUrl,
|
||||||
userSettingsValues,
|
userSettingsValues,
|
||||||
canDecrypt,
|
|
||||||
ensureUnwrapped,
|
|
||||||
userInboxRelays,
|
userInboxRelays,
|
||||||
getMembershipUrls,
|
getMembershipUrls,
|
||||||
} from "@app/core/state"
|
} from "@app/core/state"
|
||||||
@@ -593,8 +592,8 @@ export const createAlert = async (params: CreateAlertParams): Promise<CreateAler
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createDmAlert = async () => {
|
export const createDmAlert = async () => {
|
||||||
if (!get(canDecrypt)) {
|
if (!shouldUnwrap.get()) {
|
||||||
enableGiftWraps()
|
shouldUnwrap.set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return createAlert({
|
return createAlert({
|
||||||
@@ -658,16 +657,6 @@ export const payInvoice = async (invoice: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gift Wraps
|
|
||||||
|
|
||||||
export const enableGiftWraps = () => {
|
|
||||||
canDecrypt.set(true)
|
|
||||||
|
|
||||||
for (const event of repository.query([{kinds: [WRAP]}])) {
|
|
||||||
ensureUnwrapped(event)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// File upload
|
// File upload
|
||||||
|
|
||||||
export const normalizeBlossomUrl = (url: string) => normalizeUrl(url.replace(/^ws/, "http"))
|
export const normalizeBlossomUrl = (url: string) => normalizeUrl(url.replace(/^ws/, "http"))
|
||||||
|
|||||||
+6
-72
@@ -27,14 +27,7 @@ import {
|
|||||||
} from "@welshman/lib"
|
} from "@welshman/lib"
|
||||||
import type {Socket} from "@welshman/net"
|
import type {Socket} from "@welshman/net"
|
||||||
import {Pool, load, AuthStateEvent, AuthStatus, SocketEvent, netContext} from "@welshman/net"
|
import {Pool, load, AuthStateEvent, AuthStatus, SocketEvent, netContext} from "@welshman/net"
|
||||||
import {
|
import {collection, custom, deriveEvents, deriveEventsMapped, withGetter} from "@welshman/store"
|
||||||
collection,
|
|
||||||
custom,
|
|
||||||
deriveEvents,
|
|
||||||
deriveEventsMapped,
|
|
||||||
withGetter,
|
|
||||||
synced,
|
|
||||||
} from "@welshman/store"
|
|
||||||
import {isKindFeed, findFeed} from "@welshman/feeds"
|
import {isKindFeed, findFeed} from "@welshman/feeds"
|
||||||
import {
|
import {
|
||||||
getIdFilters,
|
getIdFilters,
|
||||||
@@ -68,7 +61,6 @@ import {
|
|||||||
getGroupTags,
|
getGroupTags,
|
||||||
getRelayTagValues,
|
getRelayTagValues,
|
||||||
getPubkeyTagValues,
|
getPubkeyTagValues,
|
||||||
isHashedEvent,
|
|
||||||
displayProfile,
|
displayProfile,
|
||||||
readList,
|
readList,
|
||||||
getListTags,
|
getListTags,
|
||||||
@@ -82,8 +74,8 @@ import {
|
|||||||
RelayMode,
|
RelayMode,
|
||||||
getRelaysFromList,
|
getRelaysFromList,
|
||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import type {TrustedEvent, SignedEvent, PublishedList, List, Filter} from "@welshman/util"
|
import type {TrustedEvent, PublishedList, List, Filter} from "@welshman/util"
|
||||||
import {Nip59, decrypt} from "@welshman/signer"
|
import {decrypt} from "@welshman/signer"
|
||||||
import {routerContext, Router} from "@welshman/router"
|
import {routerContext, Router} from "@welshman/router"
|
||||||
import {
|
import {
|
||||||
pubkey,
|
pubkey,
|
||||||
@@ -92,14 +84,10 @@ import {
|
|||||||
tracker,
|
tracker,
|
||||||
makeTrackerStore,
|
makeTrackerStore,
|
||||||
makeRepositoryStore,
|
makeRepositoryStore,
|
||||||
relay,
|
|
||||||
getSession,
|
|
||||||
getSigner,
|
|
||||||
createSearch,
|
createSearch,
|
||||||
userFollows,
|
userFollows,
|
||||||
ensurePlaintext,
|
ensurePlaintext,
|
||||||
thunks,
|
thunks,
|
||||||
flattenThunks,
|
|
||||||
signer,
|
signer,
|
||||||
makeOutboxLoader,
|
makeOutboxLoader,
|
||||||
appContext,
|
appContext,
|
||||||
@@ -109,7 +97,6 @@ import {
|
|||||||
userInboxRelaySelections,
|
userInboxRelaySelections,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import type {Thunk, Relay} from "@welshman/app"
|
import type {Thunk, Relay} from "@welshman/app"
|
||||||
import {preferencesStorageProvider} from "@src/lib/storage"
|
|
||||||
|
|
||||||
export const fromCsv = (s: string) => (s || "").split(",").filter(identity)
|
export const fromCsv = (s: string) => (s || "").split(",").filter(identity)
|
||||||
|
|
||||||
@@ -195,46 +182,6 @@ export const defaultPubkeys = derived(userFollows, $userFollows => {
|
|||||||
return userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys]
|
return userPubkeys.length > 5 ? userPubkeys : [...userPubkeys, ...appPubkeys]
|
||||||
})
|
})
|
||||||
|
|
||||||
const failedUnwraps = new Set()
|
|
||||||
|
|
||||||
export const ensureUnwrapped = async (event: TrustedEvent) => {
|
|
||||||
if (event.kind !== WRAP) {
|
|
||||||
return event
|
|
||||||
}
|
|
||||||
|
|
||||||
let rumor = repository.eventsByWrap.get(event.id)
|
|
||||||
|
|
||||||
if (rumor || failedUnwraps.has(event.id)) {
|
|
||||||
return rumor
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const recipient of getPubkeyTagValues(event.tags)) {
|
|
||||||
const session = getSession(recipient)
|
|
||||||
const signer = getSigner(session)
|
|
||||||
|
|
||||||
if (signer) {
|
|
||||||
try {
|
|
||||||
rumor = await Nip59.fromSigner(signer).unwrap(event as SignedEvent)
|
|
||||||
break
|
|
||||||
} catch (e) {
|
|
||||||
// pass
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rumor && isHashedEvent(rumor)) {
|
|
||||||
// Copy urls over to the rumor
|
|
||||||
tracker.copy(event.id, rumor.id)
|
|
||||||
|
|
||||||
// Send the rumor via our relay so listeners get updated
|
|
||||||
relay.send("EVENT", rumor)
|
|
||||||
} else {
|
|
||||||
failedUnwraps.add(event.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
return rumor
|
|
||||||
}
|
|
||||||
|
|
||||||
export const trackerStore = makeTrackerStore()
|
export const trackerStore = makeTrackerStore()
|
||||||
|
|
||||||
export const repositoryStore = makeRepositoryStore()
|
export const repositoryStore = makeRepositoryStore()
|
||||||
@@ -262,7 +209,7 @@ export const getUrlsForEvent = derived([trackerStore, thunks], ([$tracker, $thun
|
|||||||
const getThunksByEventId = memoize(() => {
|
const getThunksByEventId = memoize(() => {
|
||||||
const thunksByEventId = new Map<string, Thunk[]>()
|
const thunksByEventId = new Map<string, Thunk[]>()
|
||||||
|
|
||||||
for (const thunk of flattenThunks(Object.values($thunks))) {
|
for (const thunk of $thunks) {
|
||||||
pushToMapKey(thunksByEventId, thunk.event.id, thunk)
|
pushToMapKey(thunksByEventId, thunk.event.id, thunk)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +232,7 @@ export const getUrlsForEvent = derived([trackerStore, thunks], ([$tracker, $thun
|
|||||||
export const getEventsForUrl = (url: string, filters: Filter[]) => {
|
export const getEventsForUrl = (url: string, filters: Filter[]) => {
|
||||||
const ids = uniq([
|
const ids = uniq([
|
||||||
...tracker.getIds(url),
|
...tracker.getIds(url),
|
||||||
...Array.from(flattenThunks(Object.values(get(thunks))))
|
...get(thunks)
|
||||||
.filter(t => t.options.relays.includes(url))
|
.filter(t => t.options.relays.includes(url))
|
||||||
.map(t => t.event.id),
|
.map(t => t.event.id),
|
||||||
])
|
])
|
||||||
@@ -297,9 +244,7 @@ export const deriveEventsForUrl = (url: string, filters: Filter[]) =>
|
|||||||
derived([trackerStore, thunks], ([$tracker, $thunks]) => {
|
derived([trackerStore, thunks], ([$tracker, $thunks]) => {
|
||||||
const ids = uniq([
|
const ids = uniq([
|
||||||
...$tracker.getIds(url),
|
...$tracker.getIds(url),
|
||||||
...Array.from(flattenThunks(Object.values($thunks)))
|
...$thunks.filter(t => t.options.relays.includes(url)).map(t => t.event.id),
|
||||||
.filter(t => t.options.relays.includes(url))
|
|
||||||
.map(t => t.event.id),
|
|
||||||
])
|
])
|
||||||
|
|
||||||
return repository.query(filters.map(assoc("ids", ids)))
|
return repository.query(filters.map(assoc("ids", ids)))
|
||||||
@@ -336,12 +281,6 @@ export const COMMENT_FILTER = makeCommentFilter(MESSAGE_KINDS)
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
|
|
||||||
export const canDecrypt = synced({
|
|
||||||
key: "canDecrypt",
|
|
||||||
defaultValue: false,
|
|
||||||
storage: preferencesStorageProvider,
|
|
||||||
})
|
|
||||||
|
|
||||||
export const SETTINGS = "flotilla/settings"
|
export const SETTINGS = "flotilla/settings"
|
||||||
|
|
||||||
export type SettingsValues = {
|
export type SettingsValues = {
|
||||||
@@ -555,11 +494,6 @@ export const chats = derived(
|
|||||||
const messagesByChatId = new Map<string, TrustedEvent[]>()
|
const messagesByChatId = new Map<string, TrustedEvent[]>()
|
||||||
|
|
||||||
for (const message of $messages) {
|
for (const message of $messages) {
|
||||||
// Filter out messages we sent but aren't addressed to the user
|
|
||||||
if (!getPubkeyTagValues(message.wrap?.tags || []).includes($pubkey!)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
const chatId = makeChatId(getPubkeyTagValues(message.tags).concat(message.pubkey))
|
const chatId = makeChatId(getPubkeyTagValues(message.tags).concat(message.pubkey))
|
||||||
|
|
||||||
pushToMapKey(messagesByChatId, chatId, message)
|
pushToMapKey(messagesByChatId, chatId, message)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import {
|
|||||||
loadMutes,
|
loadMutes,
|
||||||
loadProfile,
|
loadProfile,
|
||||||
repository,
|
repository,
|
||||||
|
shouldUnwrap,
|
||||||
hasNegentropy,
|
hasNegentropy,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import {
|
import {
|
||||||
@@ -46,7 +47,6 @@ import {
|
|||||||
COMMENT_FILTER,
|
COMMENT_FILTER,
|
||||||
INDEXER_RELAYS,
|
INDEXER_RELAYS,
|
||||||
REACTION_KINDS,
|
REACTION_KINDS,
|
||||||
canDecrypt,
|
|
||||||
loadSettings,
|
loadSettings,
|
||||||
userMembership,
|
userMembership,
|
||||||
defaultPubkeys,
|
defaultPubkeys,
|
||||||
@@ -334,14 +334,14 @@ const syncDMs = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When pubkey changes, re-sync
|
// When pubkey changes, re-sync
|
||||||
const unsubscribePubkey = derived([pubkey, canDecrypt], identity).subscribe(
|
const unsubscribePubkey = derived([pubkey, shouldUnwrap], identity).subscribe(
|
||||||
([$pubkey, $canDecrypt]) => {
|
([$pubkey, $shouldUnwrap]) => {
|
||||||
if ($pubkey !== currentPubkey) {
|
if ($pubkey !== currentPubkey) {
|
||||||
unsubscribeAll()
|
unsubscribeAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have a pubkey, refresh our user's relay selections then sync our subscriptions
|
// If we have a pubkey, refresh our user's relay selections then sync our subscriptions
|
||||||
if ($pubkey && $canDecrypt) {
|
if ($pubkey && $shouldUnwrap) {
|
||||||
loadRelaySelections($pubkey)
|
loadRelaySelections($pubkey)
|
||||||
.then(() => loadInboxRelaySelections($pubkey))
|
.then(() => loadInboxRelaySelections($pubkey))
|
||||||
.then($l => subscribeAll($pubkey, getRelayTagValues(getListTags($l))))
|
.then($l => subscribeAll($pubkey, getRelayTagValues(getListTags($l))))
|
||||||
@@ -352,11 +352,12 @@ const syncDMs = () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// When user inbox relays change, update synchronization
|
// When user inbox relays change, update synchronization
|
||||||
const unsubscribeSelections = userInboxRelaySelections.subscribe($l => {
|
const unsubscribeSelections = userInboxRelaySelections.subscribe($userInboxRelaySelections => {
|
||||||
const $pubkey = pubkey.get()
|
const $pubkey = pubkey.get()
|
||||||
|
const $shouldUnwrap = shouldUnwrap.get()
|
||||||
|
|
||||||
if ($pubkey && $l) {
|
if ($pubkey && $shouldUnwrap) {
|
||||||
subscribeAll($pubkey, getRelayTagValues(getListTags($l)))
|
subscribeAll($pubkey, getRelayTagValues(getListTags($userInboxRelaySelections)))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+8
-13
@@ -17,7 +17,6 @@ import {
|
|||||||
getPubkeyTagValues,
|
getPubkeyTagValues,
|
||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import {
|
import {
|
||||||
ensureUnwrapped,
|
|
||||||
makeChatId,
|
makeChatId,
|
||||||
entityLink,
|
entityLink,
|
||||||
decodeRelay,
|
decodeRelay,
|
||||||
@@ -85,20 +84,16 @@ export const getPrimaryNavItemIndex = ($page: Page) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const goToEvent = async (event: TrustedEvent, options: Record<string, any> = {}) => {
|
export const goToEvent = async (event: TrustedEvent, options: Record<string, any> = {}) => {
|
||||||
const unwrapped = await ensureUnwrapped(event)
|
const urls = Array.from(tracker.getRelays(event.id))
|
||||||
|
const path = await getEventPath(event, urls)
|
||||||
|
|
||||||
if (unwrapped) {
|
if (path.includes("://")) {
|
||||||
const urls = Array.from(tracker.getRelays(unwrapped.id))
|
window.open(path)
|
||||||
const path = await getEventPath(unwrapped, urls)
|
} else {
|
||||||
|
goto(path, options)
|
||||||
|
|
||||||
if (path.includes("://")) {
|
await sleep(300)
|
||||||
window.open(path)
|
await scrollToEvent(event.id)
|
||||||
} else {
|
|
||||||
goto(path, options)
|
|
||||||
|
|
||||||
await sleep(300)
|
|
||||||
await scrollToEvent(unwrapped.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-1
@@ -33,7 +33,7 @@ import {
|
|||||||
verifiedSymbol,
|
verifiedSymbol,
|
||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import type {Zapper, TrustedEvent} from "@welshman/util"
|
import type {Zapper, TrustedEvent} from "@welshman/util"
|
||||||
import type {RepositoryUpdate} from "@welshman/relay"
|
import type {RepositoryUpdate, WrapItem} from "@welshman/net"
|
||||||
import type {Handle, Relay} from "@welshman/app"
|
import type {Handle, Relay} from "@welshman/app"
|
||||||
import {
|
import {
|
||||||
plaintext,
|
plaintext,
|
||||||
@@ -44,6 +44,7 @@ import {
|
|||||||
zappers,
|
zappers,
|
||||||
onZapper,
|
onZapper,
|
||||||
onHandle,
|
onHandle,
|
||||||
|
wrapManager,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import {Collection} from "@lib/storage"
|
import {Collection} from "@lib/storage"
|
||||||
|
|
||||||
@@ -258,6 +259,28 @@ const syncPlaintext = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const syncWrapManager = async () => {
|
||||||
|
const collection = new Collection<WrapItem>({
|
||||||
|
table: "wraps",
|
||||||
|
shards: Array.from("0123456789abcdef"),
|
||||||
|
getShard: (item: WrapItem) => last(hash(item.id)),
|
||||||
|
})
|
||||||
|
|
||||||
|
wrapManager.load(await collection.get())
|
||||||
|
|
||||||
|
const addOne = batch(3000, (wrapItems: WrapItem[]) => collection.add(wrapItems))
|
||||||
|
|
||||||
|
const updateAll = throttle(3000, () => collection.set(wrapManager.dump()))
|
||||||
|
|
||||||
|
wrapManager.on("add", addOne)
|
||||||
|
wrapManager.on("remove", updateAll)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
wrapManager.off("add", addOne)
|
||||||
|
wrapManager.off("remove", updateAll)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const syncDataStores = () =>
|
export const syncDataStores = () =>
|
||||||
Promise.all([
|
Promise.all([
|
||||||
syncEvents(),
|
syncEvents(),
|
||||||
@@ -267,4 +290,5 @@ export const syncDataStores = () =>
|
|||||||
syncZappers(),
|
syncZappers(),
|
||||||
syncFreshness(),
|
syncFreshness(),
|
||||||
syncPlaintext(),
|
syncPlaintext(),
|
||||||
|
syncWrapManager(),
|
||||||
])
|
])
|
||||||
|
|||||||
+11
-51
@@ -8,10 +8,9 @@
|
|||||||
import {App, type URLOpenListenerEvent} from "@capacitor/app"
|
import {App, type URLOpenListenerEvent} from "@capacitor/app"
|
||||||
import {dev} from "$app/environment"
|
import {dev} from "$app/environment"
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
import {sync, localStorageProvider} from "@welshman/store"
|
import {sync} from "@welshman/store"
|
||||||
import {assoc, call, defer, dissoc, on, sleep, spec, TaskQueue} from "@welshman/lib"
|
import {assoc, call, defer, dissoc, on, sleep, spec} from "@welshman/lib"
|
||||||
import type {TrustedEvent, StampedEvent} from "@welshman/util"
|
import type {StampedEvent} from "@welshman/util"
|
||||||
import {WRAP} from "@welshman/util"
|
|
||||||
import {Nip46Broker, makeSecret} from "@welshman/signer"
|
import {Nip46Broker, makeSecret} from "@welshman/signer"
|
||||||
import type {Socket, RelayMessage, ClientMessage} from "@welshman/net"
|
import type {Socket, RelayMessage, ClientMessage} from "@welshman/net"
|
||||||
import {
|
import {
|
||||||
@@ -33,6 +32,7 @@
|
|||||||
signer,
|
signer,
|
||||||
signerLog,
|
signerLog,
|
||||||
dropSession,
|
dropSession,
|
||||||
|
shouldUnwrap,
|
||||||
loginWithNip01,
|
loginWithNip01,
|
||||||
loginWithNip46,
|
loginWithNip46,
|
||||||
loadRelaySelections,
|
loadRelaySelections,
|
||||||
@@ -55,8 +55,6 @@
|
|||||||
import {
|
import {
|
||||||
userSettingsValues,
|
userSettingsValues,
|
||||||
relaysPendingTrust,
|
relaysPendingTrust,
|
||||||
ensureUnwrapped,
|
|
||||||
canDecrypt,
|
|
||||||
getSetting,
|
getSetting,
|
||||||
relaysMostlyRestricted,
|
relaysMostlyRestricted,
|
||||||
} from "@app/core/state"
|
} from "@app/core/state"
|
||||||
@@ -106,44 +104,6 @@
|
|||||||
...notifications,
|
...notifications,
|
||||||
})
|
})
|
||||||
|
|
||||||
// migrate from localStorage to capacitor Preferences storage if needed
|
|
||||||
const runMigration = async () => {
|
|
||||||
const isSome = (item: any) => {
|
|
||||||
return item !== undefined && item !== null && item !== ""
|
|
||||||
}
|
|
||||||
|
|
||||||
const localStoragePubKey = await localStorageProvider.get("pubkey")
|
|
||||||
if (isSome(localStoragePubKey)) {
|
|
||||||
await preferencesStorageProvider.set("pubkey", localStoragePubKey)
|
|
||||||
localStorage.removeItem("pubkey")
|
|
||||||
}
|
|
||||||
|
|
||||||
const localStorageSessions = await localStorageProvider.get("sessions")
|
|
||||||
if (isSome(localStorageSessions)) {
|
|
||||||
await preferencesStorageProvider.set("sessions", localStorageSessions)
|
|
||||||
localStorage.removeItem("sessions")
|
|
||||||
}
|
|
||||||
|
|
||||||
const localStorageCanDecrypt = await localStorageProvider.get("canDecrypt")
|
|
||||||
if (isSome(localStorageCanDecrypt)) {
|
|
||||||
await preferencesStorageProvider.set("canDecrypt", localStorageCanDecrypt)
|
|
||||||
localStorage.removeItem("canDecrypt")
|
|
||||||
}
|
|
||||||
|
|
||||||
const localStorageChecked = await localStorageProvider.get("checked")
|
|
||||||
if (isSome(localStorageChecked)) {
|
|
||||||
await preferencesStorageProvider.set("checked", localStorageChecked)
|
|
||||||
localStorage.removeItem("checked")
|
|
||||||
}
|
|
||||||
|
|
||||||
const localStorageTheme = await localStorageProvider.get("theme")
|
|
||||||
if (isSome(localStorageTheme)) {
|
|
||||||
await preferencesStorageProvider.set("theme", localStorageTheme)
|
|
||||||
localStorage.removeItem("theme")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await runMigration()
|
|
||||||
|
|
||||||
// Listen for navigation messages from service worker
|
// Listen for navigation messages from service worker
|
||||||
navigator.serviceWorker?.addEventListener("message", event => {
|
navigator.serviceWorker?.addEventListener("message", event => {
|
||||||
if (event.data && event.data.type === "NAVIGATE") {
|
if (event.data && event.data.type === "NAVIGATE") {
|
||||||
@@ -217,16 +177,9 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Unwrap gift wraps as they come in, but throttled
|
|
||||||
const unwrapper = new TaskQueue<TrustedEvent>({batchSize: 10, processItem: ensureUnwrapped})
|
|
||||||
|
|
||||||
repository.on("update", ({added}) => {
|
repository.on("update", ({added}) => {
|
||||||
for (const event of added) {
|
for (const event of added) {
|
||||||
loadRelaySelections(event.pubkey)
|
loadRelaySelections(event.pubkey)
|
||||||
|
|
||||||
if ($canDecrypt && event.kind === WRAP) {
|
|
||||||
unwrapper.push(event)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -244,6 +197,13 @@
|
|||||||
storage: preferencesStorageProvider,
|
storage: preferencesStorageProvider,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Sync shouldUnwrap
|
||||||
|
await sync({
|
||||||
|
key: "shouldUnwrap",
|
||||||
|
store: shouldUnwrap,
|
||||||
|
storage: preferencesStorageProvider,
|
||||||
|
})
|
||||||
|
|
||||||
// Sync application data (relay, events, etc)
|
// Sync application data (relay, events, etc)
|
||||||
await storage.syncDataStores()
|
await storage.syncDataStores()
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
import type {MakeNonOptional} from "@welshman/lib"
|
import type {MakeNonOptional} from "@welshman/lib"
|
||||||
import type {TrustedEvent} from "@welshman/util"
|
import type {TrustedEvent} from "@welshman/util"
|
||||||
import {Address, getIdFilters} from "@welshman/util"
|
import {Address, getIdFilters} from "@welshman/util"
|
||||||
import {LOCAL_RELAY_URL} from "@welshman/relay"
|
import {load, LOCAL_RELAY_URL} from "@welshman/net"
|
||||||
import {load} from "@welshman/net"
|
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
import Spinner from "@lib/components/Spinner.svelte"
|
import Spinner from "@lib/components/Spinner.svelte"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {onMount} from "svelte"
|
import {onMount} from "svelte"
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
|
import {shouldUnwrap} from "@welshman/app"
|
||||||
import AddCircle from "@assets/icons/add-circle.svg?dataurl"
|
import AddCircle from "@assets/icons/add-circle.svg?dataurl"
|
||||||
import Compass from "@assets/icons/compass.svg?dataurl"
|
import Compass from "@assets/icons/compass.svg?dataurl"
|
||||||
import ChatRound from "@assets/icons/chat-round.svg?dataurl"
|
import ChatRound from "@assets/icons/chat-round.svg?dataurl"
|
||||||
@@ -12,11 +13,11 @@
|
|||||||
import ChatEnable from "@app/components/ChatEnable.svelte"
|
import ChatEnable from "@app/components/ChatEnable.svelte"
|
||||||
import {pushModal} from "@app/util/modal"
|
import {pushModal} from "@app/util/modal"
|
||||||
import {makeSpacePath} from "@app/util/routes"
|
import {makeSpacePath} from "@app/util/routes"
|
||||||
import {PLATFORM_NAME, PLATFORM_RELAYS, canDecrypt} from "@app/core/state"
|
import {PLATFORM_NAME, PLATFORM_RELAYS} from "@app/core/state"
|
||||||
|
|
||||||
const addSpace = () => pushModal(SpaceAdd)
|
const addSpace = () => pushModal(SpaceAdd)
|
||||||
|
|
||||||
const openChat = () => ($canDecrypt ? goto("/chat") : pushModal(ChatEnable, {next: "/chat"}))
|
const openChat = () => ($shouldUnwrap ? goto("/chat") : pushModal(ChatEnable, {next: "/chat"}))
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (PLATFORM_RELAYS.length > 0) {
|
if (PLATFORM_RELAYS.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user