devel #123
17 changed files with 326 additions and 211 deletions
254
assets/package-lock.json
generated
254
assets/package-lock.json
generated
|
@ -13,7 +13,7 @@
|
||||||
"phoenix_live_view": "file:../deps/phoenix_live_view"
|
"phoenix_live_view": "file:../deps/phoenix_live_view"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"esbuild": "^0.17.12"
|
"esbuild": "^0.18.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^18.0.0",
|
"react": "^18.0.0",
|
||||||
|
@ -28,13 +28,13 @@
|
||||||
"version": "3.3.1"
|
"version": "3.3.1"
|
||||||
},
|
},
|
||||||
"../deps/phoenix_live_view": {
|
"../deps/phoenix_live_view": {
|
||||||
"version": "0.19.0",
|
"version": "0.19.1",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime": {
|
"node_modules/@babel/runtime": {
|
||||||
"version": "7.21.5",
|
"version": "7.22.5",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||||
"integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==",
|
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"regenerator-runtime": "^0.13.11"
|
"regenerator-runtime": "^0.13.11"
|
||||||
},
|
},
|
||||||
|
@ -43,9 +43,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/android-arm": {
|
"node_modules/@esbuild/android-arm": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.0.tgz",
|
||||||
"integrity": "sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==",
|
"integrity": "sha512-+uLHSiWK3qOeyDYCf/nuvIgCnQsYjXWNa3TlGYLW1pPG7OYMawllU+VyBgHQPjF2aIUVFpfrvz5aAfxGk/0qNg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
@ -59,9 +59,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/android-arm64": {
|
"node_modules/@esbuild/android-arm64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.0.tgz",
|
||||||
"integrity": "sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==",
|
"integrity": "sha512-nAwRCs5+jxi3gBMVkOqmRvsITB/UtfpvkbMwAwJUIbp66NnPbV2KGCFnjNn7IEqabJQXfBLe/QLdjCGpHU+yEw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
@ -75,9 +75,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/android-x64": {
|
"node_modules/@esbuild/android-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==",
|
"integrity": "sha512-TiOJmHQ8bXCGlYLpBd3Qy7N8dxi4n6q+nOmTzPr5Hb/bUr+PKuP4e5lWaOlpkaKc1Q9wsFt+sHfQpFCrM7SMow==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -91,9 +91,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/darwin-arm64": {
|
"node_modules/@esbuild/darwin-arm64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.0.tgz",
|
||||||
"integrity": "sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==",
|
"integrity": "sha512-5GsFovtGyjMIXJrcCzmI1hX3TneCrmFncFIlo0WrRvWcVU6H094P854ZaP8qoLgevXhggO2dhlEGYY0Zv6/S9Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
@ -107,9 +107,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/darwin-x64": {
|
"node_modules/@esbuild/darwin-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==",
|
"integrity": "sha512-4K/QCksQ8F58rvC1D62Xi4q4E7YWpiyc3zy2H/n1W7y0hjQpOBBxciLn0qycMskP/m/I5h9HNbRlu1aK821sHg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -123,9 +123,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/freebsd-arm64": {
|
"node_modules/@esbuild/freebsd-arm64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.0.tgz",
|
||||||
"integrity": "sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==",
|
"integrity": "sha512-DMazN0UGzipD0Fi1O9pRX0xfp+JC3gSnFWxTWq88Dr/odWhZzm8Jqy44LN2veYeipb1fBMxhoEp7eCr902SWqg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
@ -139,9 +139,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/freebsd-x64": {
|
"node_modules/@esbuild/freebsd-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==",
|
"integrity": "sha512-GdkJAB3ZBiYnie9iFO9v/CM4ko0dm5SYkUs97lBKNLHw9mo4H9IXwGNKtUztisEsmUP0IWfEi4YTWOJF3DIO4w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -155,9 +155,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-arm": {
|
"node_modules/@esbuild/linux-arm": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.0.tgz",
|
||||||
"integrity": "sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==",
|
"integrity": "sha512-A3Ue/oZdb43znNpeY71FrAjZF20MtnBKCGb1vXLIVg5qg8rRM1gRgn6X2ixYwATiw5dE04JnP+aV4OBf8c5ZvQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
@ -171,9 +171,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-arm64": {
|
"node_modules/@esbuild/linux-arm64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.0.tgz",
|
||||||
"integrity": "sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==",
|
"integrity": "sha512-Mb3yCN9PXA6G5qf84UF0IEuXP22eyNlquF17Zs2F1vVBM0CtyWLYosC5JaxBxfK6EzWwB2IkPBIjMeK3ek+ItA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
@ -187,9 +187,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-ia32": {
|
"node_modules/@esbuild/linux-ia32": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.0.tgz",
|
||||||
"integrity": "sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==",
|
"integrity": "sha512-WNDXgJdfDhN6ZxHU7HgR2BRDVx9iGN8SpmebUUGdENg4MZJndGcaQuf2kCJjMwoK0+es1g61TeJzAMxfgDcmcA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
|
@ -203,9 +203,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-loong64": {
|
"node_modules/@esbuild/linux-loong64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.0.tgz",
|
||||||
"integrity": "sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==",
|
"integrity": "sha512-PBr8Lf+L8amvheTGFVNK/0qionszkOKMq2WyfFlVz8D41v0+uSth6fYYHwtASkMk4xf+oh0vW8NYuav3/3RHuQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"loong64"
|
"loong64"
|
||||||
],
|
],
|
||||||
|
@ -219,9 +219,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-mips64el": {
|
"node_modules/@esbuild/linux-mips64el": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.0.tgz",
|
||||||
"integrity": "sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==",
|
"integrity": "sha512-Lg4ygah5bwfDDCOMFsBJjSVbD1UzNwWt4f7DhpaSIFOrJqoECX1VTByKw3iSDAVRlwl1cljlfy7wlysrRZcdiQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"mips64el"
|
"mips64el"
|
||||||
],
|
],
|
||||||
|
@ -235,9 +235,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-ppc64": {
|
"node_modules/@esbuild/linux-ppc64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.0.tgz",
|
||||||
"integrity": "sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==",
|
"integrity": "sha512-obz/firdtou244DIjHzdKmJChwGseqA3tWGa6xPMfuq54Ca4Pp1a4ANMrqy2IZ67rfpRHcJTlb2h3rSfW6tvAA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
|
@ -251,9 +251,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-riscv64": {
|
"node_modules/@esbuild/linux-riscv64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.0.tgz",
|
||||||
"integrity": "sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==",
|
"integrity": "sha512-UkuBdxQsxi39wWrRLMOkJl//82/hpQw79TD+OBLw3IBYyVQ4Wfvpe56RfEGK/j439sIm79ccnD5RUNQceHvZdQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
|
@ -267,9 +267,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-s390x": {
|
"node_modules/@esbuild/linux-s390x": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.0.tgz",
|
||||||
"integrity": "sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==",
|
"integrity": "sha512-MgyuC30oYB465hyAqsb3EH6Y4zTeqqgixRAOpsDNMCelyDiW9ZDPXvMPfBgCZGJlDZFGKDm2I9ou8E3VI+v7pg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
|
@ -283,9 +283,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/linux-x64": {
|
"node_modules/@esbuild/linux-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==",
|
"integrity": "sha512-oLLKU3F4pKWAsNmfi7Rd4qkj0qvg1S923ZjlcISA2IMgHsODA9xzwerqWayI5nOhLGgKXviDofn9exTeA4EUQQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -299,9 +299,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/netbsd-x64": {
|
"node_modules/@esbuild/netbsd-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==",
|
"integrity": "sha512-BEfJrZsZ/gMtpS2vC+2YoFGxmfLKiYQvj8lZrBfjKzQrwyMpH53CzQJj9ypOx9ldjM/MVxf9i9wi/rS4BWV7WA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -315,9 +315,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/openbsd-x64": {
|
"node_modules/@esbuild/openbsd-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==",
|
"integrity": "sha512-eDolHeG3REnEIgwl7Lw2S0znUMY4PFVtCAzLKqdRO0HD+iPKJR8n2MEJJyhPdUjcobo8SEQ2AG6gtYfft9VFHg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -331,9 +331,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/sunos-x64": {
|
"node_modules/@esbuild/sunos-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==",
|
"integrity": "sha512-kl7vONem2wmRQke015rSrknmc6TYXKVNs2quiVTdvkSufscrjegpNqKyP7v6EHqXtvkzrB92ySjpfzazKG627g==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -347,9 +347,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/win32-arm64": {
|
"node_modules/@esbuild/win32-arm64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.0.tgz",
|
||||||
"integrity": "sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==",
|
"integrity": "sha512-WohArFQ3HStBu9MAsx3JUk2wfC2v8QoadnMoNfx3Y26ac54tD/wQhPzw4QOzQbSqOFqzIMLKWbxindTsko+9OA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
@ -363,9 +363,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/win32-ia32": {
|
"node_modules/@esbuild/win32-ia32": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.0.tgz",
|
||||||
"integrity": "sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==",
|
"integrity": "sha512-SdnpSOxpeoewYCurmfLVepLuhOAphWkGTxWHifFjp37DaUHwF1fpGzyxhZoXMt5MKGuAO5aE3c5668YYtno+9Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
|
@ -379,9 +379,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/win32-x64": {
|
"node_modules/@esbuild/win32-x64": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.0.tgz",
|
||||||
"integrity": "sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==",
|
"integrity": "sha512-WJxImv0Pehpbo+pgg7Xrn88/b6ZzSweNHTw/2LW95JjeQUIS6ToJeQmjAdud9H3yiHJmhLOmEAOvUdNLhptD0w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
@ -395,52 +395,84 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@radix-ui/react-compose-refs": {
|
"node_modules/@radix-ui/react-compose-refs": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz",
|
||||||
"integrity": "sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==",
|
"integrity": "sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.13.10"
|
"@babel/runtime": "^7.13.10"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
"react": "^16.8 || ^17.0 || ^18.0"
|
"react": "^16.8 || ^17.0 || ^18.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@radix-ui/react-portal": {
|
"node_modules/@radix-ui/react-portal": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.3.tgz",
|
||||||
"integrity": "sha512-swu32idoCW7KA2VEiUZGBSu9nB6qwGdV6k6HYhUoOo3M1FFpD+VgLzUqtt3mwL1ssz7r2x8MggpLSQach2Xy/Q==",
|
"integrity": "sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.13.10",
|
"@babel/runtime": "^7.13.10",
|
||||||
"@radix-ui/react-primitive": "1.0.2"
|
"@radix-ui/react-primitive": "1.0.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"@types/react-dom": "*",
|
||||||
"react": "^16.8 || ^17.0 || ^18.0",
|
"react": "^16.8 || ^17.0 || ^18.0",
|
||||||
"react-dom": "^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": {
|
"node_modules/@radix-ui/react-primitive": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz",
|
||||||
"integrity": "sha512-zY6G5Qq4R8diFPNwtyoLRZBxzu1Z+SXMlfYpChN7Dv8gvmx9X3qhDqiLWvKseKVJMuedFeU/Sa0Sy/Ia+t06Dw==",
|
"integrity": "sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.13.10",
|
"@babel/runtime": "^7.13.10",
|
||||||
"@radix-ui/react-slot": "1.0.1"
|
"@radix-ui/react-slot": "1.0.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"@types/react-dom": "*",
|
||||||
"react": "^16.8 || ^17.0 || ^18.0",
|
"react": "^16.8 || ^17.0 || ^18.0",
|
||||||
"react-dom": "^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": {
|
"node_modules/@radix-ui/react-slot": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
|
||||||
"integrity": "sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==",
|
"integrity": "sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.13.10",
|
"@babel/runtime": "^7.13.10",
|
||||||
"@radix-ui/react-compose-refs": "1.0.0"
|
"@radix-ui/react-compose-refs": "1.0.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
"react": "^16.8 || ^17.0 || ^18.0"
|
"react": "^16.8 || ^17.0 || ^18.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@reach/observe-rect": {
|
"node_modules/@reach/observe-rect": {
|
||||||
|
@ -459,9 +491,9 @@
|
||||||
"integrity": "sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w=="
|
"integrity": "sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w=="
|
||||||
},
|
},
|
||||||
"node_modules/esbuild": {
|
"node_modules/esbuild": {
|
||||||
"version": "0.17.18",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz",
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.0.tgz",
|
||||||
"integrity": "sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==",
|
"integrity": "sha512-/2sQaWHNX2jkglLu85EjmEAR2ANpKOa1kp2rAE3wjKcuYjEHFlB+D60tn6W9BRgHiAQEKYtl4hEygKWothfDEA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -471,28 +503,28 @@
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@esbuild/android-arm": "0.17.18",
|
"@esbuild/android-arm": "0.18.0",
|
||||||
"@esbuild/android-arm64": "0.17.18",
|
"@esbuild/android-arm64": "0.18.0",
|
||||||
"@esbuild/android-x64": "0.17.18",
|
"@esbuild/android-x64": "0.18.0",
|
||||||
"@esbuild/darwin-arm64": "0.17.18",
|
"@esbuild/darwin-arm64": "0.18.0",
|
||||||
"@esbuild/darwin-x64": "0.17.18",
|
"@esbuild/darwin-x64": "0.18.0",
|
||||||
"@esbuild/freebsd-arm64": "0.17.18",
|
"@esbuild/freebsd-arm64": "0.18.0",
|
||||||
"@esbuild/freebsd-x64": "0.17.18",
|
"@esbuild/freebsd-x64": "0.18.0",
|
||||||
"@esbuild/linux-arm": "0.17.18",
|
"@esbuild/linux-arm": "0.18.0",
|
||||||
"@esbuild/linux-arm64": "0.17.18",
|
"@esbuild/linux-arm64": "0.18.0",
|
||||||
"@esbuild/linux-ia32": "0.17.18",
|
"@esbuild/linux-ia32": "0.18.0",
|
||||||
"@esbuild/linux-loong64": "0.17.18",
|
"@esbuild/linux-loong64": "0.18.0",
|
||||||
"@esbuild/linux-mips64el": "0.17.18",
|
"@esbuild/linux-mips64el": "0.18.0",
|
||||||
"@esbuild/linux-ppc64": "0.17.18",
|
"@esbuild/linux-ppc64": "0.18.0",
|
||||||
"@esbuild/linux-riscv64": "0.17.18",
|
"@esbuild/linux-riscv64": "0.18.0",
|
||||||
"@esbuild/linux-s390x": "0.17.18",
|
"@esbuild/linux-s390x": "0.18.0",
|
||||||
"@esbuild/linux-x64": "0.17.18",
|
"@esbuild/linux-x64": "0.18.0",
|
||||||
"@esbuild/netbsd-x64": "0.17.18",
|
"@esbuild/netbsd-x64": "0.18.0",
|
||||||
"@esbuild/openbsd-x64": "0.17.18",
|
"@esbuild/openbsd-x64": "0.18.0",
|
||||||
"@esbuild/sunos-x64": "0.17.18",
|
"@esbuild/sunos-x64": "0.18.0",
|
||||||
"@esbuild/win32-arm64": "0.17.18",
|
"@esbuild/win32-arm64": "0.18.0",
|
||||||
"@esbuild/win32-ia32": "0.17.18",
|
"@esbuild/win32-ia32": "0.18.0",
|
||||||
"@esbuild/win32-x64": "0.17.18"
|
"@esbuild/win32-x64": "0.18.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-equals": {
|
"node_modules/fast-equals": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"esbuild": "^0.17.12"
|
"esbuild": "^0.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
|
|
|
@ -3,7 +3,7 @@ defmodule Chiya.Channels.Channel do
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
alias Chiya.Channels.ChannelSlug
|
alias Chiya.Channels.ChannelSlug
|
||||||
|
|
||||||
@derive {Jason.Encoder, only: [:id, :name, :content, :slug, :visibility]}
|
@derive {Jason.Encoder, only: [:name]}
|
||||||
schema "channels" do
|
schema "channels" do
|
||||||
field :content, :string
|
field :content, :string
|
||||||
field :name, :string
|
field :name, :string
|
||||||
|
|
|
@ -104,7 +104,11 @@ defmodule Chiya.Notes do
|
||||||
** (Ecto.NoResultsError)
|
** (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 """
|
@doc """
|
||||||
Gets a single note by its slug and preloads it.
|
Gets a single note by its slug and preloads it.
|
||||||
|
@ -120,7 +124,11 @@ defmodule Chiya.Notes do
|
||||||
** (Ecto.NoResultsError)
|
** (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 """
|
@doc """
|
||||||
Gets a single note by its slug and preloads it.
|
Gets a single note by its slug and preloads it.
|
||||||
|
@ -136,7 +144,25 @@ defmodule Chiya.Notes do
|
||||||
nil
|
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 """
|
@doc """
|
||||||
Creates a note.
|
Creates a note.
|
||||||
|
|
|
@ -9,8 +9,9 @@ defmodule Chiya.Notes.Note do
|
||||||
statics: ChiyaWeb.static_paths()
|
statics: ChiyaWeb.static_paths()
|
||||||
|
|
||||||
@reserved_slugs ~w(user admin dev api)
|
@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
|
schema "notes" do
|
||||||
field :content, :string
|
field :content, :string
|
||||||
|
|
||||||
|
@ -50,9 +51,19 @@ defmodule Chiya.Notes.Note do
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def note_path(note) do
|
||||||
|
~p"/note/#{note.slug}"
|
||||||
|
end
|
||||||
|
|
||||||
def note_url(note) do
|
def note_url(note) do
|
||||||
URI.merge(ChiyaWeb.Endpoint.url(), ~p"/note/#{note.slug}")
|
Phoenix.VerifiedRoutes.url(~p"/note/#{note.slug}")
|
||||||
|> to_string()
|
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
|
end
|
||||||
|
|
||||||
@doc false
|
@doc false
|
||||||
|
|
|
@ -15,6 +15,7 @@ defmodule Chiya.Site.Setting do
|
||||||
|
|
||||||
belongs_to :home_channel, Chiya.Channels.Channel
|
belongs_to :home_channel, Chiya.Channels.Channel
|
||||||
belongs_to :default_channel, Chiya.Channels.Channel
|
belongs_to :default_channel, Chiya.Channels.Channel
|
||||||
|
belongs_to :micropub_channel, Chiya.Channels.Channel
|
||||||
|
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,6 +6,7 @@ defmodule Chiya.Tags.Tag do
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
alias Chiya.Tags.TagSlug
|
alias Chiya.Tags.TagSlug
|
||||||
|
|
||||||
|
@derive {Jason.Encoder, only: [:name]}
|
||||||
schema "tags" do
|
schema "tags" do
|
||||||
field :name, :string
|
field :name, :string
|
||||||
field :slug, TagSlug.Type
|
field :slug, TagSlug.Type
|
||||||
|
|
|
@ -61,11 +61,6 @@ defmodule ChiyaWeb.AdminComponents do
|
||||||
<% end %>
|
<% end %>
|
||||||
</article>
|
</article>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%!-- Phoenix.Component.upload_errors/1 returns a list of error atoms --%>
|
|
||||||
<%= for err <- upload_errors(@upload) do %>
|
|
||||||
<p class="alert alert-danger"><%= upload_error_to_string(err) %></p>
|
|
||||||
<% end %>
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -164,6 +164,59 @@ defmodule ChiyaWeb.PublicComponents do
|
||||||
end
|
end
|
||||||
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.
|
||||||
|
</.error>
|
||||||
|
<.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</.button>
|
||||||
|
</:actions>
|
||||||
|
</.simple_form>
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
|
||||||
|
def comment_list(assigns) do
|
||||||
|
~H"""
|
||||||
|
<%= if not Enum.empty?(assigns.note.comments) do %>
|
||||||
|
<.line />
|
||||||
|
|
||||||
|
<h2 class="mb-6 text-theme-base"><%= Enum.count(assigns.note.comments) %> Comments</h2>
|
||||||
|
|
||||||
|
<aside id="comments" class="flex flex-col gap-6">
|
||||||
|
<%= for comment <- assigns.note.comments do %>
|
||||||
|
<article class="text-theme-base bg-theme-base/10 p-1">
|
||||||
|
<header class="flex flex-row justify-between">
|
||||||
|
<strong class="text-theme-primary"><%= comment.author_name %></strong>
|
||||||
|
<span class="text-theme-dim"><%= from_now(comment.inserted_at) %></span>
|
||||||
|
</header>
|
||||||
|
<p><%= comment.content %></p>
|
||||||
|
</article>
|
||||||
|
<% end %>
|
||||||
|
</aside>
|
||||||
|
<% else %>
|
||||||
|
<.line />
|
||||||
|
|
||||||
|
<h2 class="mb-6 text-theme-base">No comments yet.</h2>
|
||||||
|
<% end %>
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
|
||||||
defp gallery_name(note), do: "gallery-#{note.id}"
|
defp gallery_name(note), do: "gallery-#{note.id}"
|
||||||
|
|
||||||
defp main_image(note),
|
defp main_image(note),
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
<.link navigate={~p"/admin/comments/#{comment}"}>Show</.link>
|
<.link navigate={~p"/admin/comments/#{comment}"}>Show</.link>
|
||||||
</div>
|
</div>
|
||||||
</:action>
|
</:action>
|
||||||
<:action :let={comment}>
|
<:action :let={_comment}>
|
||||||
<.link href={~p"/admin/comments/#{comment}"} method="delete" data-confirm="Are you sure?">
|
<.link href="#" method="delete" data-confirm="Are you sure?">
|
||||||
Delete
|
Delete
|
||||||
</.link>
|
</.link>
|
||||||
</:action>
|
</:action>
|
||||||
<:action :let={comment}>
|
<:action :let={_comment}>
|
||||||
<div class="sr-only">
|
<div class="sr-only">
|
||||||
<.link navigate={~p"/admin/comments/#{comment}/approve"}>Approve</.link>
|
<.link href="#">Approve</.link>
|
||||||
</div>
|
</div>
|
||||||
</:action>
|
</:action>
|
||||||
</.table>
|
</.table>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Comment <%= @comment.id %>
|
Comment <%= @comment.id %>
|
||||||
<:subtitle>This is a comment record from your database.</:subtitle>
|
<:subtitle>This is a comment record from your database.</:subtitle>
|
||||||
<:actions>
|
<:actions>
|
||||||
<.link href={~p"/admin/notes/#{@comment}/approve"}>
|
<.link href="#">
|
||||||
<.button>Approve note</.button>
|
<.button>Approve note</.button>
|
||||||
</.link>
|
</.link>
|
||||||
</:actions>
|
</:actions>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<:item title="Approved at"><%= @comment.approved_at %></:item>
|
<:item title="Approved at"><%= @comment.approved_at %></:item>
|
||||||
<:item title="Kind"><%= @comment.kind %></:item>
|
<:item title="Kind"><%= @comment.kind %></:item>
|
||||||
<:item title="Note">
|
<:item title="Note">
|
||||||
<a href={"/admin/notes/#{@comment.note.id}"}><%= @comment.note.name %></a>
|
<a href="#"><%= @comment.note.name %></a>
|
||||||
</:item>
|
</:item>
|
||||||
</.list>
|
</.list>
|
||||||
|
|
||||||
|
|
|
@ -56,58 +56,4 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="mt-8 mx-auto max-w-xl">
|
|
||||||
<%= if not Enum.empty?(@note.comments) do %>
|
|
||||||
<.line />
|
|
||||||
|
|
||||||
<h2 class="mb-6 text-theme-base"><%= Enum.count(@note.comments) %> Comments</h2>
|
|
||||||
|
|
||||||
<aside id="comments" class="flex flex-col gap-6">
|
|
||||||
<%= for comment <- @note.comments do %>
|
|
||||||
<article class="text-theme-base bg-theme-base/10 p-1">
|
|
||||||
<header class="flex flex-row justify-between">
|
|
||||||
<strong class="text-theme-primary"><%= comment.author_name %></strong>
|
|
||||||
<span class="text-theme-dim"><%= from_now(comment.inserted_at) %></span>
|
|
||||||
</header>
|
|
||||||
<p><%= comment.content %></p>
|
|
||||||
</article>
|
|
||||||
<% end %>
|
|
||||||
</aside>
|
|
||||||
<% else %>
|
|
||||||
<.line />
|
|
||||||
|
|
||||||
<h2 class="mb-6 text-theme-base">No comments yet.</h2>
|
|
||||||
<% 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.
|
|
||||||
</.error>
|
|
||||||
<.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</.button>
|
|
||||||
</:actions>
|
|
||||||
</.simple_form>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
<.input field={f[:custom_css]} type="textarea" label="Custom css" class="font-mono" />
|
<.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[: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[:home_channel_id]} type="select" label="Home Channel" options={@channels} />
|
||||||
|
<.input
|
||||||
|
field={f[:micropub_channel_id]}
|
||||||
|
type="select"
|
||||||
|
label="Micropub Channel"
|
||||||
|
options={@channels}
|
||||||
|
/>
|
||||||
<.input
|
<.input
|
||||||
field={f[:default_channel_id]}
|
field={f[:default_channel_id]}
|
||||||
type="select"
|
type="select"
|
||||||
|
|
|
@ -5,6 +5,15 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
alias ChiyaWeb.Indie.Properties, as: Props
|
alias ChiyaWeb.Indie.Properties, as: Props
|
||||||
alias ChiyaWeb.Indie.Token
|
alias ChiyaWeb.Indie.Token
|
||||||
|
|
||||||
|
@default_properties [
|
||||||
|
"name",
|
||||||
|
"content",
|
||||||
|
"published_at",
|
||||||
|
"slug",
|
||||||
|
"channels",
|
||||||
|
"tags"
|
||||||
|
]
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_create(type, properties, access_token) do
|
def handle_create(type, properties, access_token) do
|
||||||
Logger.info("Handle create")
|
Logger.info("Handle create")
|
||||||
|
@ -41,18 +50,36 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
{:error, :insufficient_scope}
|
{:error, :insufficient_scope}
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
|
||||||
def handle_source_query(_url, _filter_properties, _access_token) do
|
|
||||||
{:error, :insufficient_scope}
|
|
||||||
end
|
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_media(_files, _access_token) do
|
def handle_media(_files, _access_token) do
|
||||||
{:error, :insufficient_scope}
|
{:error, :insufficient_scope}
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_config_query(_access_token) do
|
def handle_source_query(url, filter_properties, access_token) do
|
||||||
|
filter_properties =
|
||||||
|
if Enum.empty?(filter_properties),
|
||||||
|
do: @default_properties,
|
||||||
|
else: filter_properties
|
||||||
|
|
||||||
|
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()
|
channels = Chiya.Channels.list_channels()
|
||||||
|
|
||||||
{:ok,
|
{:ok,
|
||||||
|
@ -72,6 +99,10 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
{:error, :insufficient_scope}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
@ -88,7 +119,9 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
:ok ->
|
:ok ->
|
||||||
tags = Enum.map(Chiya.Tags.list_tags(), fn t -> t.name end)
|
tags = Enum.map(Chiya.Tags.list_tags(), fn t -> t.name end)
|
||||||
{:ok, %{"categories" => tags}}
|
{:ok, %{"categories" => tags}}
|
||||||
_ -> {:error, :insufficient_scope}
|
|
||||||
|
_ ->
|
||||||
|
{:error, :insufficient_scope}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,8 @@ defmodule ChiyaWeb.Router do
|
||||||
|
|
||||||
get "/about", PageController, :about
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
Loading…
Reference in a new issue