diff --git a/assets/package-lock.json b/assets/package-lock.json index 64d54bc..b9d5ce3 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -13,7 +13,7 @@ "phoenix_live_view": "file:../deps/phoenix_live_view" }, "devDependencies": { - "esbuild": "^0.17.12" + "esbuild": "^0.18.0" }, "peerDependencies": { "react": "^18.0.0", @@ -28,13 +28,13 @@ "version": "3.3.1" }, "../deps/phoenix_live_view": { - "version": "0.19.0", + "version": "0.19.1", "license": "MIT" }, "node_modules/@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", + "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -43,9 +43,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz", - "integrity": "sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.0.tgz", + "integrity": "sha512-+uLHSiWK3qOeyDYCf/nuvIgCnQsYjXWNa3TlGYLW1pPG7OYMawllU+VyBgHQPjF2aIUVFpfrvz5aAfxGk/0qNg==", "cpu": [ "arm" ], @@ -59,9 +59,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz", - "integrity": "sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.0.tgz", + "integrity": "sha512-nAwRCs5+jxi3gBMVkOqmRvsITB/UtfpvkbMwAwJUIbp66NnPbV2KGCFnjNn7IEqabJQXfBLe/QLdjCGpHU+yEw==", "cpu": [ "arm64" ], @@ -75,9 +75,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.18.tgz", - "integrity": "sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.0.tgz", + "integrity": "sha512-TiOJmHQ8bXCGlYLpBd3Qy7N8dxi4n6q+nOmTzPr5Hb/bUr+PKuP4e5lWaOlpkaKc1Q9wsFt+sHfQpFCrM7SMow==", "cpu": [ "x64" ], @@ -91,9 +91,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz", - "integrity": "sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.0.tgz", + "integrity": "sha512-5GsFovtGyjMIXJrcCzmI1hX3TneCrmFncFIlo0WrRvWcVU6H094P854ZaP8qoLgevXhggO2dhlEGYY0Zv6/S9Q==", "cpu": [ "arm64" ], @@ -107,9 +107,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz", - "integrity": "sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.0.tgz", + "integrity": "sha512-4K/QCksQ8F58rvC1D62Xi4q4E7YWpiyc3zy2H/n1W7y0hjQpOBBxciLn0qycMskP/m/I5h9HNbRlu1aK821sHg==", "cpu": [ "x64" ], @@ -123,9 +123,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz", - "integrity": "sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.0.tgz", + "integrity": "sha512-DMazN0UGzipD0Fi1O9pRX0xfp+JC3gSnFWxTWq88Dr/odWhZzm8Jqy44LN2veYeipb1fBMxhoEp7eCr902SWqg==", "cpu": [ "arm64" ], @@ -139,9 +139,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz", - "integrity": "sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.0.tgz", + "integrity": "sha512-GdkJAB3ZBiYnie9iFO9v/CM4ko0dm5SYkUs97lBKNLHw9mo4H9IXwGNKtUztisEsmUP0IWfEi4YTWOJF3DIO4w==", "cpu": [ "x64" ], @@ -155,9 +155,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz", - "integrity": "sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.0.tgz", + "integrity": "sha512-A3Ue/oZdb43znNpeY71FrAjZF20MtnBKCGb1vXLIVg5qg8rRM1gRgn6X2ixYwATiw5dE04JnP+aV4OBf8c5ZvQ==", "cpu": [ "arm" ], @@ -171,9 +171,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz", - "integrity": "sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.0.tgz", + "integrity": "sha512-Mb3yCN9PXA6G5qf84UF0IEuXP22eyNlquF17Zs2F1vVBM0CtyWLYosC5JaxBxfK6EzWwB2IkPBIjMeK3ek+ItA==", "cpu": [ "arm64" ], @@ -187,9 +187,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz", - "integrity": "sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.0.tgz", + "integrity": "sha512-WNDXgJdfDhN6ZxHU7HgR2BRDVx9iGN8SpmebUUGdENg4MZJndGcaQuf2kCJjMwoK0+es1g61TeJzAMxfgDcmcA==", "cpu": [ "ia32" ], @@ -203,9 +203,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz", - "integrity": "sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.0.tgz", + "integrity": "sha512-PBr8Lf+L8amvheTGFVNK/0qionszkOKMq2WyfFlVz8D41v0+uSth6fYYHwtASkMk4xf+oh0vW8NYuav3/3RHuQ==", "cpu": [ "loong64" ], @@ -219,9 +219,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz", - "integrity": "sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.0.tgz", + "integrity": "sha512-Lg4ygah5bwfDDCOMFsBJjSVbD1UzNwWt4f7DhpaSIFOrJqoECX1VTByKw3iSDAVRlwl1cljlfy7wlysrRZcdiQ==", "cpu": [ "mips64el" ], @@ -235,9 +235,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz", - "integrity": "sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.0.tgz", + "integrity": "sha512-obz/firdtou244DIjHzdKmJChwGseqA3tWGa6xPMfuq54Ca4Pp1a4ANMrqy2IZ67rfpRHcJTlb2h3rSfW6tvAA==", "cpu": [ "ppc64" ], @@ -251,9 +251,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz", - "integrity": "sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.0.tgz", + "integrity": "sha512-UkuBdxQsxi39wWrRLMOkJl//82/hpQw79TD+OBLw3IBYyVQ4Wfvpe56RfEGK/j439sIm79ccnD5RUNQceHvZdQ==", "cpu": [ "riscv64" ], @@ -267,9 +267,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz", - "integrity": "sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.0.tgz", + "integrity": "sha512-MgyuC30oYB465hyAqsb3EH6Y4zTeqqgixRAOpsDNMCelyDiW9ZDPXvMPfBgCZGJlDZFGKDm2I9ou8E3VI+v7pg==", "cpu": [ "s390x" ], @@ -283,9 +283,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz", - "integrity": "sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.0.tgz", + "integrity": "sha512-oLLKU3F4pKWAsNmfi7Rd4qkj0qvg1S923ZjlcISA2IMgHsODA9xzwerqWayI5nOhLGgKXviDofn9exTeA4EUQQ==", "cpu": [ "x64" ], @@ -299,9 +299,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz", - "integrity": "sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.0.tgz", + "integrity": "sha512-BEfJrZsZ/gMtpS2vC+2YoFGxmfLKiYQvj8lZrBfjKzQrwyMpH53CzQJj9ypOx9ldjM/MVxf9i9wi/rS4BWV7WA==", "cpu": [ "x64" ], @@ -315,9 +315,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz", - "integrity": "sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.0.tgz", + "integrity": "sha512-eDolHeG3REnEIgwl7Lw2S0znUMY4PFVtCAzLKqdRO0HD+iPKJR8n2MEJJyhPdUjcobo8SEQ2AG6gtYfft9VFHg==", "cpu": [ "x64" ], @@ -331,9 +331,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz", - "integrity": "sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.0.tgz", + "integrity": "sha512-kl7vONem2wmRQke015rSrknmc6TYXKVNs2quiVTdvkSufscrjegpNqKyP7v6EHqXtvkzrB92ySjpfzazKG627g==", "cpu": [ "x64" ], @@ -347,9 +347,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz", - "integrity": "sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.0.tgz", + "integrity": "sha512-WohArFQ3HStBu9MAsx3JUk2wfC2v8QoadnMoNfx3Y26ac54tD/wQhPzw4QOzQbSqOFqzIMLKWbxindTsko+9OA==", "cpu": [ "arm64" ], @@ -363,9 +363,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz", - "integrity": "sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.0.tgz", + "integrity": "sha512-SdnpSOxpeoewYCurmfLVepLuhOAphWkGTxWHifFjp37DaUHwF1fpGzyxhZoXMt5MKGuAO5aE3c5668YYtno+9Q==", "cpu": [ "ia32" ], @@ -379,9 +379,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz", - "integrity": "sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.0.tgz", + "integrity": "sha512-WJxImv0Pehpbo+pgg7Xrn88/b6ZzSweNHTw/2LW95JjeQUIS6ToJeQmjAdud9H3yiHJmhLOmEAOvUdNLhptD0w==", "cpu": [ "x64" ], @@ -395,52 +395,84 @@ } }, "node_modules/@radix-ui/react-compose-refs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz", - "integrity": "sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz", + "integrity": "sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==", "dependencies": { "@babel/runtime": "^7.13.10" }, "peerDependencies": { + "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/@radix-ui/react-portal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.2.tgz", - "integrity": "sha512-swu32idoCW7KA2VEiUZGBSu9nB6qwGdV6k6HYhUoOo3M1FFpD+VgLzUqtt3mwL1ssz7r2x8MggpLSQach2Xy/Q==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.3.tgz", + "integrity": "sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==", "dependencies": { "@babel/runtime": "^7.13.10", - "@radix-ui/react-primitive": "1.0.2" + "@radix-ui/react-primitive": "1.0.3" }, "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, "node_modules/@radix-ui/react-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.2.tgz", - "integrity": "sha512-zY6G5Qq4R8diFPNwtyoLRZBxzu1Z+SXMlfYpChN7Dv8gvmx9X3qhDqiLWvKseKVJMuedFeU/Sa0Sy/Ia+t06Dw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz", + "integrity": "sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==", "dependencies": { "@babel/runtime": "^7.13.10", - "@radix-ui/react-slot": "1.0.1" + "@radix-ui/react-slot": "1.0.2" }, "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0", "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, "node_modules/@radix-ui/react-slot": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.1.tgz", - "integrity": "sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz", + "integrity": "sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==", "dependencies": { "@babel/runtime": "^7.13.10", - "@radix-ui/react-compose-refs": "1.0.0" + "@radix-ui/react-compose-refs": "1.0.1" }, "peerDependencies": { + "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, "node_modules/@reach/observe-rect": { @@ -459,9 +491,9 @@ "integrity": "sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w==" }, "node_modules/esbuild": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz", - "integrity": "sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.0.tgz", + "integrity": "sha512-/2sQaWHNX2jkglLu85EjmEAR2ANpKOa1kp2rAE3wjKcuYjEHFlB+D60tn6W9BRgHiAQEKYtl4hEygKWothfDEA==", "dev": true, "hasInstallScript": true, "bin": { @@ -471,28 +503,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.18", - "@esbuild/android-arm64": "0.17.18", - "@esbuild/android-x64": "0.17.18", - "@esbuild/darwin-arm64": "0.17.18", - "@esbuild/darwin-x64": "0.17.18", - "@esbuild/freebsd-arm64": "0.17.18", - "@esbuild/freebsd-x64": "0.17.18", - "@esbuild/linux-arm": "0.17.18", - "@esbuild/linux-arm64": "0.17.18", - "@esbuild/linux-ia32": "0.17.18", - "@esbuild/linux-loong64": "0.17.18", - "@esbuild/linux-mips64el": "0.17.18", - "@esbuild/linux-ppc64": "0.17.18", - "@esbuild/linux-riscv64": "0.17.18", - "@esbuild/linux-s390x": "0.17.18", - "@esbuild/linux-x64": "0.17.18", - "@esbuild/netbsd-x64": "0.17.18", - "@esbuild/openbsd-x64": "0.17.18", - "@esbuild/sunos-x64": "0.17.18", - "@esbuild/win32-arm64": "0.17.18", - "@esbuild/win32-ia32": "0.17.18", - "@esbuild/win32-x64": "0.17.18" + "@esbuild/android-arm": "0.18.0", + "@esbuild/android-arm64": "0.18.0", + "@esbuild/android-x64": "0.18.0", + "@esbuild/darwin-arm64": "0.18.0", + "@esbuild/darwin-x64": "0.18.0", + "@esbuild/freebsd-arm64": "0.18.0", + "@esbuild/freebsd-x64": "0.18.0", + "@esbuild/linux-arm": "0.18.0", + "@esbuild/linux-arm64": "0.18.0", + "@esbuild/linux-ia32": "0.18.0", + "@esbuild/linux-loong64": "0.18.0", + "@esbuild/linux-mips64el": "0.18.0", + "@esbuild/linux-ppc64": "0.18.0", + "@esbuild/linux-riscv64": "0.18.0", + "@esbuild/linux-s390x": "0.18.0", + "@esbuild/linux-x64": "0.18.0", + "@esbuild/netbsd-x64": "0.18.0", + "@esbuild/openbsd-x64": "0.18.0", + "@esbuild/sunos-x64": "0.18.0", + "@esbuild/win32-arm64": "0.18.0", + "@esbuild/win32-ia32": "0.18.0", + "@esbuild/win32-x64": "0.18.0" } }, "node_modules/fast-equals": { diff --git a/assets/package.json b/assets/package.json index c7761d2..e11ee90 100644 --- a/assets/package.json +++ b/assets/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "esbuild": "^0.17.12" + "esbuild": "^0.18.0" }, "dependencies": { "classnames": "^2.3.2", diff --git a/config/runtime.exs b/config/runtime.exs index f9d04a5..141fac3 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -72,7 +72,7 @@ if config_env() == :prod do config :waffle, storage_dir_prefix: upload_dir - + # ## SSL Support # # To get SSL working, you will need to add the `https` key diff --git a/lib/chiya/channels/channel.ex b/lib/chiya/channels/channel.ex index 15d2e1f..b2f4d9d 100644 --- a/lib/chiya/channels/channel.ex +++ b/lib/chiya/channels/channel.ex @@ -3,7 +3,7 @@ defmodule Chiya.Channels.Channel do import Ecto.Changeset alias Chiya.Channels.ChannelSlug - @derive {Jason.Encoder, only: [:id, :name, :content, :slug, :visibility]} + @derive {Jason.Encoder, only: [:name]} schema "channels" do field :content, :string field :name, :string diff --git a/lib/chiya/notes.ex b/lib/chiya/notes.ex index f066cf1..414cb2a 100644 --- a/lib/chiya/notes.ex +++ b/lib/chiya/notes.ex @@ -104,7 +104,11 @@ defmodule Chiya.Notes do ** (Ecto.NoResultsError) """ - def get_note_preloaded!(id), do: Repo.get!(Note, id) |> preload_note() + def get_note_preloaded!(id), + do: + Note + |> Repo.get!(id) + |> preload_note() @doc """ Gets a single note by its slug and preloads it. @@ -120,7 +124,11 @@ defmodule Chiya.Notes do ** (Ecto.NoResultsError) """ - def get_note_by_slug_preloaded!(slug), do: Repo.get_by!(Note, slug: slug) |> preload_note() + def get_note_by_slug_preloaded!(slug), + do: + Note + |> Repo.get_by!(slug: slug) + |> preload_note() @doc """ Gets a single note by its slug and preloads it. @@ -136,7 +144,25 @@ defmodule Chiya.Notes do nil """ - def get_note_by_slug_preloaded(slug), do: Repo.get_by(Note, slug: slug) |> preload_note() + def get_note_by_slug_preloaded(slug), + do: + Note + |> Repo.get_by(slug: slug) + |> preload_note() + + def get_public_note_by_slug_preloaded(slug), + do: + Note + |> where([n], not is_nil(n.published_at)) + |> Repo.get_by(slug: slug) + |> preload_note() + + def get_public_note_by_slug_preloaded!(slug), + do: + Note + |> where([n], not is_nil(n.published_at)) + |> Repo.get_by!(slug: slug) + |> preload_note() @doc """ Creates a note. diff --git a/lib/chiya/notes/note.ex b/lib/chiya/notes/note.ex index eb9a8d9..83f7049 100644 --- a/lib/chiya/notes/note.ex +++ b/lib/chiya/notes/note.ex @@ -9,8 +9,9 @@ defmodule Chiya.Notes.Note do statics: ChiyaWeb.static_paths() @reserved_slugs ~w(user admin dev api) + @note_url_regex ~r/\/note\/([a-z0-9-]+)/ - @derive {Jason.Encoder, only: [:id, :name, :content, :slug, :channels]} + @derive {Jason.Encoder, only: [:id, :name, :content, :slug, :channels, :tags]} schema "notes" do field :content, :string @@ -50,9 +51,19 @@ defmodule Chiya.Notes.Note do timestamps() end + def note_path(note) do + ~p"/note/#{note.slug}" + end + def note_url(note) do - URI.merge(ChiyaWeb.Endpoint.url(), ~p"/note/#{note.slug}") - |> to_string() + Phoenix.VerifiedRoutes.url(~p"/note/#{note.slug}") + end + + def note_slug(note_url) do + case Regex.run(@note_url_regex, note_url) do + nil -> {:error, nil} + [_full, slug] -> {:ok, slug} + end end @doc false diff --git a/lib/chiya/site/setting.ex b/lib/chiya/site/setting.ex index f90a108..7ae485b 100644 --- a/lib/chiya/site/setting.ex +++ b/lib/chiya/site/setting.ex @@ -15,6 +15,7 @@ defmodule Chiya.Site.Setting do belongs_to :home_channel, Chiya.Channels.Channel belongs_to :default_channel, Chiya.Channels.Channel + belongs_to :micropub_channel, Chiya.Channels.Channel timestamps() end diff --git a/lib/chiya/tags/tag.ex b/lib/chiya/tags/tag.ex index 90952a8..35a9c72 100644 --- a/lib/chiya/tags/tag.ex +++ b/lib/chiya/tags/tag.ex @@ -6,6 +6,7 @@ defmodule Chiya.Tags.Tag do import Ecto.Changeset alias Chiya.Tags.TagSlug + @derive {Jason.Encoder, only: [:name]} schema "tags" do field :name, :string field :slug, TagSlug.Type diff --git a/lib/chiya_web/components/admin_components.ex b/lib/chiya_web/components/admin_components.ex index 94b1757..f29e041 100644 --- a/lib/chiya_web/components/admin_components.ex +++ b/lib/chiya_web/components/admin_components.ex @@ -61,11 +61,6 @@ defmodule ChiyaWeb.AdminComponents do <% end %> <% end %> - - <%!-- Phoenix.Component.upload_errors/1 returns a list of error atoms --%> - <%= for err <- upload_errors(@upload) do %> -

<%= upload_error_to_string(err) %>

- <% end %> """ diff --git a/lib/chiya_web/components/public_components.ex b/lib/chiya_web/components/public_components.ex index 9099ff4..24f3f8a 100644 --- a/lib/chiya_web/components/public_components.ex +++ b/lib/chiya_web/components/public_components.ex @@ -164,6 +164,59 @@ defmodule ChiyaWeb.PublicComponents do end end + def comment_form(assigns) do + ~H""" + <.simple_form :let={f} for={@changeset} action="" class="bg-theme-background -m-3"> + <.error :if={@changeset.action}> + Oops, something went wrong! Please check the errors below. + + <.input + field={f[:author_name]} + type="text" + placeholder="Name" + class="bg-theme-background dark:bg-theme-background border-theme-base/20 dark:border-theme-base/20 text-theme-base dark:text-theme-base placeholder-theme-base/40 dark:placeholder-theme-base/60 dark:focus:border-theme-base/60 dark:focus:border-theme-base/60" + /> + <.input + field={f[:content]} + type="textarea" + placeholder="Content" + rows="3" + class="bg-theme-background dark:bg-theme-background border-theme-base/20 dark:border-theme-base/20 text-theme-base dark:text-theme-base placeholder-theme-base/60 dark:placeholder-theme-base/60 focus:border-theme-base/60 dark:focus:border-theme-base/60" + /> + <.input field={f[:note_id]} type="hidden" /> + <:actions> + <.button>Submit Comment + + + """ + end + + def comment_list(assigns) do + ~H""" + <%= if not Enum.empty?(assigns.note.comments) do %> + <.line /> + +

<%= Enum.count(assigns.note.comments) %> Comments

+ + + <% else %> + <.line /> + +

No comments yet.

+ <% end %> + """ + end + defp gallery_name(note), do: "gallery-#{note.id}" defp main_image(note), diff --git a/lib/chiya_web/controllers/comment_html/index.html.heex b/lib/chiya_web/controllers/comment_html/index.html.heex index f791e13..ea801ad 100644 --- a/lib/chiya_web/controllers/comment_html/index.html.heex +++ b/lib/chiya_web/controllers/comment_html/index.html.heex @@ -12,14 +12,14 @@ <.link navigate={~p"/admin/comments/#{comment}"}>Show - <:action :let={comment}> - <.link href={~p"/admin/comments/#{comment}"} method="delete" data-confirm="Are you sure?"> + <:action :let={_comment}> + <.link href="#" method="delete" data-confirm="Are you sure?"> Delete - <:action :let={comment}> + <:action :let={_comment}>
- <.link navigate={~p"/admin/comments/#{comment}/approve"}>Approve + <.link href="#">Approve
diff --git a/lib/chiya_web/controllers/comment_html/show.html.heex b/lib/chiya_web/controllers/comment_html/show.html.heex index 962d56e..ce158e1 100644 --- a/lib/chiya_web/controllers/comment_html/show.html.heex +++ b/lib/chiya_web/controllers/comment_html/show.html.heex @@ -2,7 +2,7 @@ Comment <%= @comment.id %> <:subtitle>This is a comment record from your database. <:actions> - <.link href={~p"/admin/notes/#{@comment}/approve"}> + <.link href="#"> <.button>Approve note @@ -15,7 +15,7 @@ <:item title="Approved at"><%= @comment.approved_at %> <:item title="Kind"><%= @comment.kind %> <:item title="Note"> - <%= @comment.note.name %> + <%= @comment.note.name %> diff --git a/lib/chiya_web/controllers/page_html/note.html.heex b/lib/chiya_web/controllers/page_html/note.html.heex index 473742d..37c09f4 100644 --- a/lib/chiya_web/controllers/page_html/note.html.heex +++ b/lib/chiya_web/controllers/page_html/note.html.heex @@ -56,58 +56,4 @@ <% end %> - -
- <%= if not Enum.empty?(@note.comments) do %> - <.line /> - -

<%= Enum.count(@note.comments) %> Comments

- - - <% else %> - <.line /> - -

No comments yet.

- <% end %> - - <.line /> - - <.simple_form - :let={f} - for={@changeset} - action={~p"/note/#{@note.slug}/comment"} - class="bg-theme-background -m-3" - > - <.error :if={@changeset.action}> - Oops, something went wrong! Please check the errors below. - - <.input - field={f[:author_name]} - type="text" - placeholder="Name" - class="bg-theme-background dark:bg-theme-background border-theme-base/20 dark:border-theme-base/20 text-theme-base dark:text-theme-base placeholder-theme-base/40 dark:placeholder-theme-base/60 dark:focus:border-theme-base/60 dark:focus:border-theme-base/60" - /> - <.input - field={f[:content]} - type="textarea" - placeholder="Content" - rows="3" - class="bg-theme-background dark:bg-theme-background border-theme-base/20 dark:border-theme-base/20 text-theme-base dark:text-theme-base placeholder-theme-base/60 dark:placeholder-theme-base/60 focus:border-theme-base/60 dark:focus:border-theme-base/60" - /> - <.input field={f[:note_id]} type="hidden" /> - <:actions> - <.button>Submit Comment - - -
diff --git a/lib/chiya_web/controllers/setting_html/setting_form.html.heex b/lib/chiya_web/controllers/setting_html/setting_form.html.heex index 7256399..99e515f 100644 --- a/lib/chiya_web/controllers/setting_html/setting_form.html.heex +++ b/lib/chiya_web/controllers/setting_html/setting_form.html.heex @@ -15,6 +15,12 @@ <.input field={f[:custom_css]} type="textarea" label="Custom css" class="font-mono" /> <.input field={f[:custom_html]} type="textarea" label="Custom html" class="font-mono" /> <.input field={f[:home_channel_id]} type="select" label="Home Channel" options={@channels} /> + <.input + field={f[:micropub_channel_id]} + type="select" + label="Micropub Channel" + options={@channels} + /> <.input field={f[:default_channel_id]} type="select" diff --git a/lib/chiya_web/indie/micropub_handler.ex b/lib/chiya_web/indie/micropub_handler.ex index c0d4a19..cdbd8e8 100644 --- a/lib/chiya_web/indie/micropub_handler.ex +++ b/lib/chiya_web/indie/micropub_handler.ex @@ -5,6 +5,15 @@ defmodule ChiyaWeb.Indie.MicropubHandler do alias ChiyaWeb.Indie.Properties, as: Props alias ChiyaWeb.Indie.Token + @default_properties [ + "name", + "content", + "published_at", + "slug", + "channels", + "tags" + ] + @impl true def handle_create(type, properties, access_token) do Logger.info("Handle create") @@ -41,37 +50,59 @@ defmodule ChiyaWeb.Indie.MicropubHandler do {:error, :insufficient_scope} end - @impl true - def handle_source_query(_url, _filter_properties, _access_token) do - {:error, :insufficient_scope} - end - @impl true def handle_media(_files, _access_token) do {:error, :insufficient_scope} end @impl true - def handle_config_query(_access_token) do - channels = Chiya.Channels.list_channels() + def handle_source_query(url, filter_properties, access_token) do + filter_properties = + if Enum.empty?(filter_properties), + do: @default_properties, + else: filter_properties - {:ok, - %{ - "destination" => [], - "post-types" => [ + with :ok <- verify_token(access_token), + {:ok, slug} <- Chiya.Notes.Note.note_slug(url), + note <- Chiya.Notes.get_public_note_by_slug_preloaded!(slug) do + filtered_note = + Map.filter(note, fn {key, _val} -> + Enum.member?(filter_properties, to_string(key)) + end) + + {:ok, filtered_note} + else + _ -> {:error, :insufficient_scope} + end + end + + @impl true + def handle_config_query(access_token) do + case verify_token(access_token) do + :ok -> + channels = Chiya.Channels.list_channels() + + {:ok, %{ - "type" => "note", - "name" => "Note" - } - ], - "channels" => - Enum.map(channels, fn c -> - %{ - "uid" => c.slug, - "name" => c.name - } - end) - }} + "destination" => [], + "post-types" => [ + %{ + "type" => "note", + "name" => "Note" + } + ], + "channels" => + Enum.map(channels, fn c -> + %{ + "uid" => c.slug, + "name" => c.name + } + end) + }} + + _ -> + {:error, :insufficient_scope} + end end @impl true @@ -85,10 +116,12 @@ defmodule ChiyaWeb.Indie.MicropubHandler do @impl true def handle_category_query(access_token) do case verify_token(access_token) do - :ok -> + :ok -> tags = Enum.map(Chiya.Tags.list_tags(), fn t -> t.name end) {:ok, %{"categories" => tags}} - _ -> {:error, :insufficient_scope} + + _ -> + {:error, :insufficient_scope} end end diff --git a/lib/chiya_web/router.ex b/lib/chiya_web/router.ex index 5ba03f9..e0fde0e 100644 --- a/lib/chiya_web/router.ex +++ b/lib/chiya_web/router.ex @@ -138,6 +138,8 @@ defmodule ChiyaWeb.Router do get "/about", PageController, :about - post "/note/:slug/comment", CommentController, :create + # TODO: Comments are disabled for now + # and need a better submit/approve flow + # post "/note/:slug/comment", CommentController, :create end end diff --git a/priv/repo/migrations/20230611183608_add_default_micropub_channel_setting.exs b/priv/repo/migrations/20230611183608_add_default_micropub_channel_setting.exs new file mode 100644 index 0000000..257948a --- /dev/null +++ b/priv/repo/migrations/20230611183608_add_default_micropub_channel_setting.exs @@ -0,0 +1,9 @@ +defmodule Chiya.Repo.Migrations.AddDefaultMicropubChannelSetting do + use Ecto.Migration + + def change do + alter table(:settings) do + add :micropub_channel_id, references(:channels, on_delete: :nothing) + end + end +end