interface: display DMs

This commit is contained in:
Liam Fitzgerald 2021-04-30 14:16:31 +10:00
parent 10df4fa4b8
commit 7f433ae807
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
9 changed files with 240 additions and 174 deletions

View File

@ -19,20 +19,20 @@
"dev": true "dev": true
}, },
"@babel/core": { "@babel/core": {
"version": "7.13.15", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.15.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.16.tgz",
"integrity": "sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ==", "integrity": "sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.12.13", "@babel/code-frame": "^7.12.13",
"@babel/generator": "^7.13.9", "@babel/generator": "^7.13.16",
"@babel/helper-compilation-targets": "^7.13.13", "@babel/helper-compilation-targets": "^7.13.16",
"@babel/helper-module-transforms": "^7.13.14", "@babel/helper-module-transforms": "^7.13.14",
"@babel/helpers": "^7.13.10", "@babel/helpers": "^7.13.16",
"@babel/parser": "^7.13.15", "@babel/parser": "^7.13.16",
"@babel/template": "^7.12.13", "@babel/template": "^7.12.13",
"@babel/traverse": "^7.13.15", "@babel/traverse": "^7.13.15",
"@babel/types": "^7.13.14", "@babel/types": "^7.13.16",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
@ -59,11 +59,11 @@
} }
}, },
"@babel/generator": { "@babel/generator": {
"version": "7.13.9", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.9.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.16.tgz",
"integrity": "sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw==", "integrity": "sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg==",
"requires": { "requires": {
"@babel/types": "^7.13.0", "@babel/types": "^7.13.16",
"jsesc": "^2.5.1", "jsesc": "^2.5.1",
"source-map": "^0.5.0" "source-map": "^0.5.0"
}, },
@ -94,12 +94,12 @@
} }
}, },
"@babel/helper-compilation-targets": { "@babel/helper-compilation-targets": {
"version": "7.13.13", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz",
"integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==", "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/compat-data": "^7.13.12", "@babel/compat-data": "^7.13.15",
"@babel/helper-validator-option": "^7.12.17", "@babel/helper-validator-option": "^7.12.17",
"browserslist": "^4.14.5", "browserslist": "^4.14.5",
"semver": "^6.3.0" "semver": "^6.3.0"
@ -172,13 +172,13 @@
} }
}, },
"@babel/helper-hoist-variables": { "@babel/helper-hoist-variables": {
"version": "7.13.0", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.0.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz",
"integrity": "sha512-0kBzvXiIKfsCA0y6cFEIJf4OdzfpRuNk4+YTeHZpGGc666SATFKTz6sRncwFnQk7/ugJ4dSrCj6iJuvW4Qwr2g==", "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/traverse": "^7.13.0", "@babel/traverse": "^7.13.15",
"@babel/types": "^7.13.0" "@babel/types": "^7.13.16"
} }
}, },
"@babel/helper-member-expression-to-functions": { "@babel/helper-member-expression-to-functions": {
@ -302,14 +302,14 @@
} }
}, },
"@babel/helpers": { "@babel/helpers": {
"version": "7.13.10", "version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.10.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.17.tgz",
"integrity": "sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==", "integrity": "sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/template": "^7.12.13", "@babel/template": "^7.12.13",
"@babel/traverse": "^7.13.0", "@babel/traverse": "^7.13.17",
"@babel/types": "^7.13.0" "@babel/types": "^7.13.17"
} }
}, },
"@babel/highlight": { "@babel/highlight": {
@ -323,9 +323,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.13.15", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.15.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.16.tgz",
"integrity": "sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==" "integrity": "sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw=="
}, },
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
"version": "7.13.12", "version": "7.13.12",
@ -629,12 +629,12 @@
} }
}, },
"@babel/plugin-transform-block-scoping": { "@babel/plugin-transform-block-scoping": {
"version": "7.12.13", "version": "7.13.16",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.13.16.tgz",
"integrity": "sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ==", "integrity": "sha512-ad3PHUxGnfWF4Efd3qFuznEtZKoBp0spS+DgqzVzRPV7urEBvPLue3y2j80w4Jf2YLzZHj8TOv/Lmvdmh3b2xg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.12.13" "@babel/helper-plugin-utils": "^7.13.0"
} }
}, },
"@babel/plugin-transform-classes": { "@babel/plugin-transform-classes": {
@ -662,9 +662,9 @@
} }
}, },
"@babel/plugin-transform-destructuring": { "@babel/plugin-transform-destructuring": {
"version": "7.13.0", "version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz",
"integrity": "sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA==", "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.13.0" "@babel/helper-plugin-utils": "^7.13.0"
@ -1093,9 +1093,9 @@
} }
}, },
"@babel/runtime": { "@babel/runtime": {
"version": "7.13.10", "version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.10.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.17.tgz",
"integrity": "sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==", "integrity": "sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA==",
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
@ -1111,27 +1111,26 @@
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.13.15", "version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.15.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.17.tgz",
"integrity": "sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==", "integrity": "sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg==",
"requires": { "requires": {
"@babel/code-frame": "^7.12.13", "@babel/code-frame": "^7.12.13",
"@babel/generator": "^7.13.9", "@babel/generator": "^7.13.16",
"@babel/helper-function-name": "^7.12.13", "@babel/helper-function-name": "^7.12.13",
"@babel/helper-split-export-declaration": "^7.12.13", "@babel/helper-split-export-declaration": "^7.12.13",
"@babel/parser": "^7.13.15", "@babel/parser": "^7.13.16",
"@babel/types": "^7.13.14", "@babel/types": "^7.13.17",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
} }
}, },
"@babel/types": { "@babel/types": {
"version": "7.13.14", "version": "7.13.17",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.17.tgz",
"integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", "integrity": "sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA==",
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.12.11", "@babel/helper-validator-identifier": "^7.12.11",
"lodash": "^4.17.19",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
@ -1431,9 +1430,9 @@
"integrity": "sha512-xO8hj2Ak6cEYe2QCM3w7UuaSB8ubg6G0G6/OkPVMVrz6b5ztccZmkbmYCYJ/Ot6976lGzKFsWFKRUhwRgCHfHQ==" "integrity": "sha512-xO8hj2Ak6cEYe2QCM3w7UuaSB8ubg6G0G6/OkPVMVrz6b5ztccZmkbmYCYJ/Ot6976lGzKFsWFKRUhwRgCHfHQ=="
}, },
"@tlon/indigo-react": { "@tlon/indigo-react": {
"version": "1.2.21", "version": "1.2.22",
"resolved": "https://registry.npmjs.org/@tlon/indigo-react/-/indigo-react-1.2.21.tgz", "resolved": "https://registry.npmjs.org/@tlon/indigo-react/-/indigo-react-1.2.22.tgz",
"integrity": "sha512-DqU4Mgcqyzv5pCe2qcclVAASnd3D7eznk2e9yV9W3tJwcOrpFsHRDdOR89aPoulyW7m5dctMdrGKcq70DJoaVQ==", "integrity": "sha512-8w2TkYicch+R0kkZT+MZ4oG0pIJFNjhmVlbXgqyXhOCPRJB2WrAh6OM5Cbb389r7lA+CXXfu3Nx7Rdiuxjf/vg==",
"requires": { "requires": {
"@reach/menu-button": "^0.10.5", "@reach/menu-button": "^0.10.5",
"react": "^16.13.1", "react": "^16.13.1",
@ -1506,9 +1505,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "14.14.41", "version": "15.0.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.1.tgz",
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==", "integrity": "sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==",
"dev": true "dev": true
}, },
"@types/prop-types": { "@types/prop-types": {
@ -3071,9 +3070,9 @@
"dev": true "dev": true
}, },
"aws-sdk": { "aws-sdk": {
"version": "2.887.0", "version": "2.894.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.887.0.tgz", "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.894.0.tgz",
"integrity": "sha512-jFRVrdyvBEYmSSrriA92dXDn1VgCXnz6Rax6wRGQDhyCWH+9NzZ7ZvIag2Yy2SLpvoRU7IaiEmiBLbNe/BksgA==", "integrity": "sha512-qzmxkZ1JOQ/sQPIlxE+aOpJ9OlPq640ab1Ot8p4VIuatkGSEvQvk8nWqAeLyrRwmNQuacGM7xWTI0k9pGhbDXA==",
"requires": { "requires": {
"buffer": "4.9.2", "buffer": "4.9.2",
"events": "1.1.1", "events": "1.1.1",
@ -3506,14 +3505,14 @@
} }
}, },
"browserslist": { "browserslist": {
"version": "4.16.4", "version": "4.16.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.5.tgz",
"integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", "integrity": "sha512-C2HAjrM1AI/djrpAUU/tr4pml1DqLIzJKSLDBXBrNErl9ZCCTXdhwxdJjYc16953+mBWf7Lw+uUJgpgb8cN71A==",
"dev": true, "dev": true,
"requires": { "requires": {
"caniuse-lite": "^1.0.30001208", "caniuse-lite": "^1.0.30001214",
"colorette": "^1.2.2", "colorette": "^1.2.2",
"electron-to-chromium": "^1.3.712", "electron-to-chromium": "^1.3.719",
"escalade": "^3.1.1", "escalade": "^3.1.1",
"node-releases": "^1.1.71" "node-releases": "^1.1.71"
} }
@ -3744,9 +3743,9 @@
"integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs="
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001208", "version": "1.0.30001218",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001218.tgz",
"integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", "integrity": "sha512-0ASydOWSy3bB88FbDpJSTt+PfDwnMqrym3yRZfqG8EXSQ06OZhF+q5wgYP/EN+jJMERItNcDQUqMyNjzZ+r5+Q==",
"dev": true "dev": true
}, },
"chalk": { "chalk": {
@ -3945,9 +3944,9 @@
} }
}, },
"codemirror": { "codemirror": {
"version": "5.60.0", "version": "5.61.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.60.0.tgz", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.61.0.tgz",
"integrity": "sha512-AEL7LhFOlxPlCL8IdTcJDblJm8yrAGib7I+DErJPdZd4l6imx8IMgKK3RblVgBQqz3TZJR4oknQ03bz+uNjBYA==" "integrity": "sha512-D3wYH90tYY1BsKlUe0oNj2JAhQ9TepkD51auk3N7q+4uz7A/cgJ5JsWHreT0PqieW1QhOuqxQ2reCXV1YXzecg=="
}, },
"collapse-white-space": { "collapse-white-space": {
"version": "1.0.6", "version": "1.0.6",
@ -4161,12 +4160,12 @@
"dev": true "dev": true
}, },
"core-js-compat": { "core-js-compat": {
"version": "3.10.1", "version": "3.11.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.1.tgz", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.11.0.tgz",
"integrity": "sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg==", "integrity": "sha512-3wsN9YZJohOSDCjVB0GequOyHax8zFiogSX3XWLE28M1Ew7dTU57tgHjIylSBKSIouwmLBp3g61sKMz/q3xEGA==",
"dev": true, "dev": true,
"requires": { "requires": {
"browserslist": "^4.16.3", "browserslist": "^4.16.4",
"semver": "7.0.0" "semver": "7.0.0"
}, },
"dependencies": { "dependencies": {
@ -4355,9 +4354,9 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==" "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="
}, },
"csstype": { "csstype": {
"version": "3.0.7", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.7.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz",
"integrity": "sha512-KxnUB0ZMlnUWCsx2Z8MUsr6qV6ja1w9ArPErJaJaF8a5SOWoHLIszeCTKGRGRgtLgYrs1E8CHkNSP1VZTTPc9g==", "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==",
"dev": true "dev": true
}, },
"cyclist": { "cyclist": {
@ -4641,9 +4640,9 @@
}, },
"dependencies": { "dependencies": {
"domhandler": { "domhandler": {
"version": "4.1.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.1.0.tgz", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
"integrity": "sha512-/6/kmsGlMY4Tup/nGVutdrK9yQi4YjWVcVeoQmixpzjOUK1U7pQkvAPHBJeUxOgxF0J8f8lwCJSlCfD0V4CMGQ==", "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
"requires": { "requires": {
"domelementtype": "^2.2.0" "domelementtype": "^2.2.0"
} }
@ -4676,19 +4675,19 @@
} }
}, },
"domutils": { "domutils": {
"version": "2.5.2", "version": "2.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.5.2.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.6.0.tgz",
"integrity": "sha512-MHTthCb1zj8f1GVfRpeZUbohQf/HdBos0oX5gZcQFepOZPLLRyj6Wn7XS7EMnY7CVpwv8863u2vyE83Hfu28HQ==", "integrity": "sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==",
"requires": { "requires": {
"dom-serializer": "^1.0.1", "dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0", "domelementtype": "^2.2.0",
"domhandler": "^4.1.0" "domhandler": "^4.2.0"
}, },
"dependencies": { "dependencies": {
"domhandler": { "domhandler": {
"version": "4.1.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.1.0.tgz", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
"integrity": "sha512-/6/kmsGlMY4Tup/nGVutdrK9yQi4YjWVcVeoQmixpzjOUK1U7pQkvAPHBJeUxOgxF0J8f8lwCJSlCfD0V4CMGQ==", "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
"requires": { "requires": {
"domelementtype": "^2.2.0" "domelementtype": "^2.2.0"
} }
@ -4750,9 +4749,9 @@
"dev": true "dev": true
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.717", "version": "1.3.723",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.717.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.723.tgz",
"integrity": "sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==", "integrity": "sha512-L+WXyXI7c7+G1V8ANzRsPI5giiimLAUDC6Zs1ojHHPhYXb3k/iTABFmWjivEtsWrRQymjnO66/rO2ZTABGdmWg==",
"dev": true "dev": true
}, },
"elliptic": { "elliptic": {
@ -4927,9 +4926,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eslint": { "eslint": {
"version": "7.24.0", "version": "7.25.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.24.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz",
"integrity": "sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ==", "integrity": "sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "7.12.11", "@babel/code-frame": "7.12.11",
@ -4990,9 +4989,9 @@
} }
}, },
"chalk": { "chalk": {
"version": "4.1.0", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "^4.1.0", "ansi-styles": "^4.1.0",
@ -5902,9 +5901,9 @@
"integrity": "sha512-eNMNr5exLoavuAMhIUVsOKF79SWd/zG104ef6sxBTSw+cZc6BXdQXDvYcGvp0VbxVVSp1XDUNoz7mg1xMtSznA==" "integrity": "sha512-eNMNr5exLoavuAMhIUVsOKF79SWd/zG104ef6sxBTSw+cZc6BXdQXDvYcGvp0VbxVVSp1XDUNoz7mg1xMtSznA=="
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.13.3", "version": "1.14.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz",
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", "integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==",
"dev": true "dev": true
}, },
"for-in": { "for-in": {
@ -6732,11 +6731,6 @@
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
"dev": true "dev": true
}, },
"indexes-of": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
"integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc="
},
"infer-owner": { "infer-owner": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
@ -6891,9 +6885,9 @@
"dev": true "dev": true
}, },
"is-core-module": { "is-core-module": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz",
"integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", "integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==",
"dev": true, "dev": true,
"requires": { "requires": {
"has": "^1.0.3" "has": "^1.0.3"
@ -6941,7 +6935,8 @@
"is-extendable": { "is-extendable": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
"integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
"dev": true
}, },
"is-extglob": { "is-extglob": {
"version": "2.1.1", "version": "2.1.1",
@ -7834,9 +7829,9 @@
} }
}, },
"object-inspect": { "object-inspect": {
"version": "1.9.0", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz",
"integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==",
"dev": true "dev": true
}, },
"object-is": { "object-is": {
@ -7939,9 +7934,9 @@
"dev": true "dev": true
}, },
"oembed-parser": { "oembed-parser": {
"version": "1.4.6", "version": "1.4.7",
"resolved": "https://registry.npmjs.org/oembed-parser/-/oembed-parser-1.4.6.tgz", "resolved": "https://registry.npmjs.org/oembed-parser/-/oembed-parser-1.4.7.tgz",
"integrity": "sha512-4AuEWsPf8GfNn/E+NB8lYrEbIzlvjuajwHkE4F9wUeavYfViEBn840PUWPslx1VU7Um6+H3O/b+4ByCzEIt5gA==", "integrity": "sha512-XtitoQKGBDE167OK6JuUchMXtl8CTeJhfHVifCZO0MnkmUAzRPNbtvtOZafNn/qYr37QHOzUDxhElT9O8/+iGA==",
"requires": { "requires": {
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
} }
@ -8366,13 +8361,11 @@
} }
}, },
"postcss-selector-parser": { "postcss-selector-parser": {
"version": "6.0.4", "version": "6.0.5",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz",
"integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==", "integrity": "sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg==",
"requires": { "requires": {
"cssesc": "^3.0.0", "cssesc": "^3.0.0",
"indexes-of": "^1.0.1",
"uniq": "^1.0.1",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"
} }
}, },
@ -9237,12 +9230,12 @@
"dev": true "dev": true
}, },
"sass": { "sass": {
"version": "1.32.8", "version": "1.32.11",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.32.8.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.11.tgz",
"integrity": "sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==", "integrity": "sha512-O9tRcob/fegUVSIV1ihLLZcftIOh0AF1VpKgusUfLqnb2jQ0GLDwI5ivv1FYWivGv8eZ/AwntTyTzjcHu0c/qw==",
"dev": true, "dev": true,
"requires": { "requires": {
"chokidar": ">=2.0.0 <4.0.0" "chokidar": ">=3.0.0 <4.0.0"
} }
}, },
"sass-loader": { "sass-loader": {
@ -10187,26 +10180,24 @@
"integrity": "sha512-H1XoH1URcBOa/rZZWxLxHCtOdVUEev+9vo5YdYhC9tCY4wnybX+VQrCYuy9ubkg69fCBxCONJOSLGfw0DWMffQ==" "integrity": "sha512-H1XoH1URcBOa/rZZWxLxHCtOdVUEev+9vo5YdYhC9tCY4wnybX+VQrCYuy9ubkg69fCBxCONJOSLGfw0DWMffQ=="
}, },
"table": { "table": {
"version": "6.1.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/table/-/table-6.1.0.tgz", "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz",
"integrity": "sha512-T4G5KMmqIk6X87gLKWyU5exPpTjLjY5KyrFWaIjv3SvgaIUGXV7UEzGEnZJdTA38/yUS6f9PlKezQ0bYXG3iIQ==", "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^8.0.1", "ajv": "^8.0.1",
"is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lodash.flatten": "^4.4.0", "lodash.flatten": "^4.4.0",
"lodash.truncate": "^4.4.2", "lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0", "slice-ansi": "^4.0.0",
"string-width": "^4.2.0" "string-width": "^4.2.0",
"strip-ansi": "^6.0.0"
}, },
"dependencies": { "dependencies": {
"ajv": { "ajv": {
"version": "8.1.0", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.1.0.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz",
"integrity": "sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ==", "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==",
"dev": true, "dev": true,
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
@ -10626,11 +10617,6 @@
"set-value": "^2.0.1" "set-value": "^2.0.1"
} }
}, },
"uniq": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
"integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8="
},
"unique-filename": { "unique-filename": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",
@ -10940,6 +10926,7 @@
"resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
"integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"arr-flatten": "^1.1.0", "arr-flatten": "^1.1.0",
"array-unique": "^0.3.2", "array-unique": "^0.3.2",
@ -10958,6 +10945,7 @@
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"is-extendable": "^0.1.0" "is-extendable": "^0.1.0"
} }
@ -10985,19 +10973,12 @@
"upath": "^1.1.1" "upath": "^1.1.1"
} }
}, },
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"requires": {
"is-extendable": "^0.1.0"
}
},
"fill-range": { "fill-range": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
"integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"extend-shallow": "^2.0.1", "extend-shallow": "^2.0.1",
"is-number": "^3.0.0", "is-number": "^3.0.0",
@ -11010,6 +10991,7 @@
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"is-extendable": "^0.1.0" "is-extendable": "^0.1.0"
} }
@ -11065,6 +11047,7 @@
"resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
"integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"kind-of": "^3.0.2" "kind-of": "^3.0.2"
}, },
@ -11074,6 +11057,7 @@
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"is-buffer": "^1.1.5" "is-buffer": "^1.1.5"
} }
@ -11084,13 +11068,15 @@
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true "dev": true,
"optional": true
}, },
"micromatch": { "micromatch": {
"version": "3.1.10", "version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
"integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"arr-diff": "^4.0.0", "arr-diff": "^4.0.0",
"array-unique": "^0.3.2", "array-unique": "^0.3.2",
@ -11105,27 +11091,6 @@
"regex-not": "^1.0.0", "regex-not": "^1.0.0",
"snapdragon": "^0.8.1", "snapdragon": "^0.8.1",
"to-regex": "^3.0.2" "to-regex": "^3.0.2"
},
"dependencies": {
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
"integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
"assign-symbols": "^1.0.0",
"is-extendable": "^1.0.1"
}
},
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "^2.0.4"
}
}
} }
}, },
"readable-stream": { "readable-stream": {
@ -11171,6 +11136,7 @@
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
"integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"is-number": "^3.0.0", "is-number": "^3.0.0",
"repeat-string": "^1.6.1" "repeat-string": "^1.6.1"
@ -12148,9 +12114,9 @@
} }
}, },
"zustand": { "zustand": {
"version": "3.4.1", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-3.4.1.tgz", "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.4.2.tgz",
"integrity": "sha512-Kb91vSjy5vwBQ/PQ1a5GE6naS3gCxCgpkujT9zqZSO85+gnvmzgqraMW3ao1I0jR4PwHBXtLTf26r9j7EXoUiQ==" "integrity": "sha512-/v0RRbzi8NNyiXf7vw2eizPfJaTlTbXNM3fjQ6xF+qr5Xc0cF0ypaa0ARLOvyaKsGx/q2p5azVhfGxl4uHK0Ag=="
} }
} }
} }

View File

@ -1,6 +1,7 @@
import BaseApi from './base'; import BaseApi from './base';
import { StoreState } from '../store/type'; import { StoreState } from '../store/type';
import { Patp, Path, Resource } from '@urbit/api'; import { Patp, Path, Resource } from '@urbit/api';
import { patp2dec } from 'urbit-ob';
import _ from 'lodash'; import _ from 'lodash';
import { makeResource, resourceFromPath } from '../lib/group'; import { makeResource, resourceFromPath } from '../lib/group';
import { GroupPolicy, Enc, Post, Content } from '@urbit/api'; import { GroupPolicy, Enc, Post, Content } from '@urbit/api';
@ -202,6 +203,21 @@ export default class GraphApi extends BaseApi<StoreState> {
}); });
} }
addDmMessage(ship: Patp, contents: Content[]) {
const post = createPost(contents, `/${patp2dec(ship)}`)
return this.action('dm-hook', 'graph-update-1', {
"add-nodes": {
resource: { ship: `~${window.ship}`, name: 'inbox' },
nodes: {
[post.index]: {
post,
children: null
}
}
}
});
}
addPost(ship: Patp, name: string, post: Post) { addPost(ship: Patp, name: string, post: Post) {
const nodes = {}; const nodes = {};
nodes[post.index] = { nodes[post.index] = {

View File

@ -1,5 +1,7 @@
import { Graphs, decToUd, numToUd, GraphNode, deSig, Association, resourceFromPath } from "@urbit/api"; import { Graphs, decToUd, numToUd, GraphNode, deSig, Association, resourceFromPath } from "@urbit/api";
import BigIntOrderedMap from "@urbit/api/lib/BigIntOrderedMap";
import {useCallback} from "react"; import {useCallback} from "react";
import { patp2dec } from 'urbit-ob';
import { BaseState, createState } from "./base"; import { BaseState, createState } from "./base";
@ -145,4 +147,14 @@ export function useGraphForAssoc(association: Association) {
window.useGraphState = useGraphState; window.useGraphState = useGraphState;
export function useInbox() {
return useGraphState(s => s.graphs[`${window.ship}/inbox`]);
}
export function useDM(ship: string) {
const inbox = useInbox();
const shipGraph = inbox.get(patp2dec(ship));
return shipGraph?.children ?? new BigIntOrderedMap();
}
export default useGraphState; export default useGraphState;

View File

@ -1,5 +1,7 @@
import { NotificationGraphConfig, Timebox, Unreads, dateToDa } from "@urbit/api"; import { NotificationGraphConfig, Timebox, Unreads, dateToDa } from "@urbit/api";
import { patp2dec } from 'urbit-ob';
import BigIntOrderedMap from "@urbit/api/lib/BigIntOrderedMap"; import BigIntOrderedMap from "@urbit/api/lib/BigIntOrderedMap";
import {useCallback} from "react";
// import { harkGraphHookReducer, harkGroupHookReducer, harkReducer } from "~/logic/subscription/hark"; // import { harkGraphHookReducer, harkGroupHookReducer, harkReducer } from "~/logic/subscription/hark";
import { BaseState, createState } from "./base"; import { BaseState, createState } from "./base";
@ -65,5 +67,10 @@ const useHarkState = createState<HarkState>('Hark', {
}, },
}, ['notifications', 'archivedNotifications', 'unreads', 'notificationsCount']); }, ['notifications', 'archivedNotifications', 'unreads', 'notificationsCount']);
export function useHarkDm(ship: string) {
return useHarkState(useCallback(s => {
return s.unreads.graph[`/ship/~${window.ship}/inbox`]?.[`/${patp2dec(ship)}`];
}, [ship]));
}
export default useHarkState; export default useHarkState;

View File

@ -98,6 +98,7 @@ class App extends React.Component {
componentDidMount() { componentDidMount() {
this.subscription.start(); this.subscription.start();
this.api.graph.getGraph(`~${window.ship}`, 'inbox');
this.themeWatcher = window.matchMedia('(prefers-color-scheme: dark)'); this.themeWatcher = window.matchMedia('(prefers-color-scheme: dark)');
this.themeWatcher.onchange = this.updateTheme; this.themeWatcher.onchange = this.updateTheme;
setTimeout(() => { setTimeout(() => {

View File

@ -0,0 +1,41 @@
import { Content, createPost } from '@urbit/api';
import React, { useCallback } from 'react';
import { patp2dec } from 'urbit-ob';
import GlobalApi from '~/logic/api/global';
import { useDM } from '~/logic/state/graph';
import useHarkState, { useHarkDm } from '~/logic/state/hark';
import { ChatPane } from './components/ChatPane';
interface DmResourceProps {
ship: string;
api: GlobalApi;
}
export function DmResource(props: DmResourceProps) {
const { ship, api } = props;
const dm = useDM(ship);
const hark = useHarkDm(ship);
const unreadCount = (hark?.unreads as number) ?? 0;
const onSubmit = useCallback(
(contents: Content[]) => {
api.graph.addDmMessage(ship, contents);
},
[ship]
);
return (
<ChatPane
api={api}
canWrite
id={ship}
graph={dm}
unreadCount={unreadCount}
onReply={() => ''}
fetchMessages={async () => true}
dismissUnread={() => {}}
getPermalink={() => ''}
isAdmin
onSubmit={onSubmit}
/>
);
}

View File

@ -288,9 +288,12 @@ function ChatMessage(props: ChatMessageProps) {
} }
} }
const date = useMemo(() => daToUnix(bigInt(msg.index.split('/')[1])), [msg.index]); const date = useMemo(() =>
daToUnix(bigInt(msg.index.split('/').reverse()[0])),
[msg.index]
);
const nextDate = useMemo(() => nextMsg ? ( const nextDate = useMemo(() => nextMsg ? (
daToUnix(bigInt(nextMsg.index.split('/')[1])) daToUnix(bigInt(nextMsg.index.split('/').reverse()[0]))
) : null, ) : null,
[nextMsg] [nextMsg]
); );
@ -379,7 +382,7 @@ export const MessageAuthor = ({
const dark = theme === 'dark' || (theme === 'auto' && osDark); const dark = theme === 'dark' || (theme === 'auto' && osDark);
let contact: Contact | null = useContact(`~${msg.author}`); let contact: Contact | null = useContact(`~${msg.author}`);
const date = daToUnix(bigInt(msg.index.split('/')[1])); const date = daToUnix(bigInt(msg.index.split('/').reverse()[0]));
const datestamp = moment const datestamp = moment
.unix(date / 1000) .unix(date / 1000)

View File

@ -32,6 +32,7 @@ import useContactState from '~/logic/state/contact';
import useGroupState from '~/logic/state/group'; import useGroupState from '~/logic/state/group';
import useHarkState from '~/logic/state/hark'; import useHarkState from '~/logic/state/hark';
import useMetadataState from '~/logic/state/metadata'; import useMetadataState from '~/logic/state/metadata';
import {DmResource} from '~/views/apps/chat/DmResource';
type GroupsPaneProps = StoreState & { type GroupsPaneProps = StoreState & {
baseUrl: string; baseUrl: string;
@ -95,6 +96,25 @@ export function GroupsPane(props: GroupsPaneProps) {
return ( return (
<Switch> <Switch>
<Route
path={relativePath('/dm/:ship')}
render={({ match }) => {
const { ship } = match.params as Record<string, string>;
return (
<Skeleton
mobileHide
recentGroups={recentGroups}
selected={ship}
{...props}
baseUrl={match.path}
> <DmResource ship={ship} api={api} />
</Skeleton>
);
}}
/>
<Route <Route
path={[relativePath('/resource/:app/(ship)?/:host/:name')]} path={[relativePath('/resource/:app/(ship)?/:host/:name')]}
render={(routeProps) => { render={(routeProps) => {

View File

@ -119,7 +119,7 @@ export function SidebarDmItem(props: {
selected={false} selected={false}
hasNotification={false} hasNotification={false}
hasUnread={false} hasUnread={false}
to={`/~landscape/messages/ship/${ship}`} to={`/~landscape/messages/dm/${ship}`}
title={title} title={title}
mono={!!contact?.nickname} mono={!!contact?.nickname}
isSynced isSynced