Created a plugin for grid view

This commit is contained in:
DrMint 2023-10-05 13:32:42 +02:00
parent 3532dab712
commit 4b6b67c093
13 changed files with 172 additions and 109 deletions

170
package-lock.json generated
View File

@ -9,26 +9,26 @@
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@fontsource/vollkorn": "^5.0.9", "@fontsource/vollkorn": "^5.0.12",
"clean-deep": "^3.4.0", "clean-deep": "^3.4.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"language-tags": "^1.0.9", "language-tags": "^1.0.9",
"luxon": "^3.4.0", "luxon": "^3.4.3",
"payload": "^1.14.0", "payload": "^1.15.6",
"styled-components": "^6.0.7" "styled-components": "^6.0.8"
}, },
"devDependencies": { "devDependencies": {
"@types/dotenv": "^8.2.0", "@types/dotenv": "^8.2.0",
"@types/express": "^4.17.17", "@types/express": "^4.17.18",
"@types/language-tags": "^1.0.1", "@types/language-tags": "^1.0.2",
"@types/luxon": "^3.3.1", "@types/luxon": "^3.3.2",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.8",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"prettier": "^3.0.2", "prettier": "^3.0.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.1.6" "typescript": "^5.2.2"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
@ -3687,9 +3687,9 @@
} }
}, },
"node_modules/@fontsource/vollkorn": { "node_modules/@fontsource/vollkorn": {
"version": "5.0.9", "version": "5.0.12",
"resolved": "https://registry.npmjs.org/@fontsource/vollkorn/-/vollkorn-5.0.9.tgz", "resolved": "https://registry.npmjs.org/@fontsource/vollkorn/-/vollkorn-5.0.12.tgz",
"integrity": "sha512-JEXK96OZ11PJ+cqbeqK2kTqLNyvPPLgL7bf1B/1RIWjOf1R1B2fqnyDwaJ1IdXdSjKu2YNhU1scV+CWD7pyqXg==" "integrity": "sha512-KjWzn/iQfN/PpgAYSX6Hzxqfgpt79f87aFVG0QazSVuSn3Lia6e9nDI46+nev2dD2UySwL9yUSx175IMvBt7FA=="
}, },
"node_modules/@hapi/hoek": { "node_modules/@hapi/hoek": {
"version": "9.3.0", "version": "9.3.0",
@ -4375,9 +4375,9 @@
} }
}, },
"node_modules/@swc/core": { "node_modules/@swc/core": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.78.tgz",
"integrity": "sha512-CiLD2NGTdhE8JnWFHeRAglaCAcvwOxvpeWNtCIT261GrxTKCXHPAn4eqIWiBzXnwWDmZ6XdyrCL4/GmPESNnrg==", "integrity": "sha512-y6DQP571v7fbUUY7nz5G4lNIRGofuO48K5pGhD9VnuOCTuptfooCdi8wnigIrIhM/M4zQ53m/YCMDCbOtDgEww==",
"hasInstallScript": true, "hasInstallScript": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
@ -4387,16 +4387,16 @@
"url": "https://opencollective.com/swc" "url": "https://opencollective.com/swc"
}, },
"optionalDependencies": { "optionalDependencies": {
"@swc/core-darwin-arm64": "1.3.77", "@swc/core-darwin-arm64": "1.3.78",
"@swc/core-darwin-x64": "1.3.77", "@swc/core-darwin-x64": "1.3.78",
"@swc/core-linux-arm-gnueabihf": "1.3.77", "@swc/core-linux-arm-gnueabihf": "1.3.78",
"@swc/core-linux-arm64-gnu": "1.3.77", "@swc/core-linux-arm64-gnu": "1.3.78",
"@swc/core-linux-arm64-musl": "1.3.77", "@swc/core-linux-arm64-musl": "1.3.78",
"@swc/core-linux-x64-gnu": "1.3.77", "@swc/core-linux-x64-gnu": "1.3.78",
"@swc/core-linux-x64-musl": "1.3.77", "@swc/core-linux-x64-musl": "1.3.78",
"@swc/core-win32-arm64-msvc": "1.3.77", "@swc/core-win32-arm64-msvc": "1.3.78",
"@swc/core-win32-ia32-msvc": "1.3.77", "@swc/core-win32-ia32-msvc": "1.3.78",
"@swc/core-win32-x64-msvc": "1.3.77" "@swc/core-win32-x64-msvc": "1.3.78"
}, },
"peerDependencies": { "peerDependencies": {
"@swc/helpers": "^0.5.0" "@swc/helpers": "^0.5.0"
@ -4408,9 +4408,9 @@
} }
}, },
"node_modules/@swc/core-darwin-arm64": { "node_modules/@swc/core-darwin-arm64": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.78.tgz",
"integrity": "sha512-l4KGQAGB4Ih1Al2tWoUBrtVJCF/xZRjH3jCMCRD52KZDRAnRVDq42JKek7+aHjjH8juzTISaqzsI8Ipv6zvKhA==", "integrity": "sha512-596KRua/d5Gx1buHKKchSyHuwoIL4S1BRD/wCvYNLNZ3xOzcuBBmXOjrDVigKi1ztNDeS07p30RO5UyYur0XAA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -4423,9 +4423,9 @@
} }
}, },
"node_modules/@swc/core-darwin-x64": { "node_modules/@swc/core-darwin-x64": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.78.tgz",
"integrity": "sha512-eFCkZg/BzObOn5IWn7t/Ywz+jlZKff/1XBymT7Arh/UkO39Agh+rYdBqjbylp4JQMl0qGRBfxD3wPgDRoViNVQ==", "integrity": "sha512-w0RsD1onQAj0vuLAoOVi48HgnW6D6oBEIZP17l0HYejCDBZ+FRZLjml7wgNAWMqHcd2qNRqgtZ+v7aLza2JtBQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -4438,9 +4438,9 @@
} }
}, },
"node_modules/@swc/core-linux-arm-gnueabihf": { "node_modules/@swc/core-linux-arm-gnueabihf": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.78.tgz",
"integrity": "sha512-+1BueyGcCQAtxSORJml0CU8aKQNssQ5E3ABMFJwCbcec+lUCiGYK1fBfqj4FmWQMbXuQ+mn1SMeXSZAtaXoQ3w==", "integrity": "sha512-v1CpRn+H6fha1WIqmdRvJM40pFdjUHrGfhf4Ygci72nlAU41l5XimN8Iwkm8FgIwf2wnv0lLzedSM4IHvpq/yA==",
"cpu": [ "cpu": [
"arm" "arm"
], ],
@ -4453,9 +4453,9 @@
} }
}, },
"node_modules/@swc/core-linux-arm64-gnu": { "node_modules/@swc/core-linux-arm64-gnu": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.78.tgz",
"integrity": "sha512-3smbzVcuuCiWWPFeUIp1c0aAXd+fGsc8x8rUcYvoJAWBgLJ45JymOI5WSUjIybl3rk0prdkbFylZuR0t1Rue3A==", "integrity": "sha512-Sis17dz9joJRFVvR/gteOZSUNrrrioo81RQzani0Zr5ZZOfWLMTB9DA+0MVlfnVa2taYcsJHJZFoAv9JkLwbzg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -4468,9 +4468,9 @@
} }
}, },
"node_modules/@swc/core-linux-arm64-musl": { "node_modules/@swc/core-linux-arm64-musl": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.78.tgz",
"integrity": "sha512-e81+i4ef5vDeu9AkMY2AamPcmtPVPUqeqq3aNWM1tcHCaUej1DwY4xhRxrd1OvEoYyVBLtiMb5nenF3V9OzXIQ==", "integrity": "sha512-E5F8/qp+QupnfBnsP4vN1PKyCmAHYHDG1GMyPE/zLFOUYLgw+jK4C9rfyLBR0o2bWo1ay2WCIjusBZD9XHGOSA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -4483,9 +4483,9 @@
} }
}, },
"node_modules/@swc/core-linux-x64-gnu": { "node_modules/@swc/core-linux-x64-gnu": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.78.tgz",
"integrity": "sha512-gl3+9VESckZ/GYCmGClGgXqB2tAA2MivEV/51Wde+2alo2lPSSujEhxE6Q3TNYkXOLAHSupYyDZ0ou9RfXufOw==", "integrity": "sha512-iDxa+RknnTQlyy+WfPor1FM6y44ERNI2E0xiUV6gV6uPwegCngi8LFC+E7IvP6+p+yXtAkesunAaiZ8nn0s+rw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -4498,9 +4498,9 @@
} }
}, },
"node_modules/@swc/core-linux-x64-musl": { "node_modules/@swc/core-linux-x64-musl": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.78.tgz",
"integrity": "sha512-AqQLZAMYTaNrA4i/Nv/GhXdildDZyRv6xsK8u2actevv5PPjD/69yYB3Z4uaptwh/4ys4W/Y2vnt+OPCNH4OQg==", "integrity": "sha512-dWtIYUFL5sMTE2UKshkXTusHcK8+zAhhGzvqWq1wJS45pqTlrAbzpyqB780fle880x3A6DMitWmsAFARdNzpuQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -4513,9 +4513,9 @@
} }
}, },
"node_modules/@swc/core-win32-arm64-msvc": { "node_modules/@swc/core-win32-arm64-msvc": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.78.tgz",
"integrity": "sha512-Wdw++6w7WyavxZ3WruElCrRJ6EO0iHS0Mts4qHnbKgD08GJqIMTZPtZ5qhRe9zCf6sj2rQqhAMf/HKhYrHoF+w==", "integrity": "sha512-CXFaGEc2M9Su3UoUMC8AnzKb9g+GwPxXfakLWZsjwS448h6jcreExq3nwtBNdVGzQ26xqeVLMFfb1l/oK99Hwg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -4528,9 +4528,9 @@
} }
}, },
"node_modules/@swc/core-win32-ia32-msvc": { "node_modules/@swc/core-win32-ia32-msvc": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.78.tgz",
"integrity": "sha512-ObNVpdtLdXDpmVKuMZh87yBYL4ti64WX95o2j5Oq3r0e0RqwIGqGvPDxvJVEiyCnaXHfl8eSNKWuiOxPHPkMNQ==", "integrity": "sha512-FaH1jwWnJpWkdImpMoiZpMg9oy9UUyZwltzN7hFwjR48e3Li82cRFb+9PifIBHCUSBM+CrrsJXbHP213IMVAyw==",
"cpu": [ "cpu": [
"ia32" "ia32"
], ],
@ -4543,9 +4543,9 @@
} }
}, },
"node_modules/@swc/core-win32-x64-msvc": { "node_modules/@swc/core-win32-x64-msvc": {
"version": "1.3.77", "version": "1.3.78",
"resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.77.tgz", "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.78.tgz",
"integrity": "sha512-Ew6jg/qr0v/2ixeJXvIUBuAPMKTz8HRoDBO/nHkvlnDFmkhsyH7h5YwJS1rLBwAEhWuJaVYjYi7cibZTI/QRYQ==", "integrity": "sha512-oYxa+tPdhlx1aH14AIoF6kvVjo49tEOW0drNqoEaVHufvgH0y43QU2Jum3b2+xXztmMRtzK2CSN3GPOAXDKKKg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -4663,9 +4663,9 @@
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
}, },
"node_modules/@types/express": { "node_modules/@types/express": {
"version": "4.17.17", "version": "4.17.18",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.18.tgz",
"integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", "integrity": "sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/body-parser": "*", "@types/body-parser": "*",
@ -4744,9 +4744,9 @@
"integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==" "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA=="
}, },
"node_modules/@types/language-tags": { "node_modules/@types/language-tags": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/language-tags/-/language-tags-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/language-tags/-/language-tags-1.0.2.tgz",
"integrity": "sha512-rTtRNIewaBrkMUfsCe7ES3xsTRQcEVgic2yoDY9hM3D/nwmABcG2du4l4+dTbWvfO8pUYwL4/2TbWFJa/AGc2g==", "integrity": "sha512-yrpbdlA+8vK2s2Xhyt+DOy0QptYR7OI7yLsUuyySAAuieNtTqslmLCmnQFLF+Z/HeatYg2FfkfiP7gIQRBg9wQ==",
"dev": true "dev": true
}, },
"node_modules/@types/lodash": { "node_modules/@types/lodash": {
@ -4755,9 +4755,9 @@
"integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==" "integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg=="
}, },
"node_modules/@types/luxon": { "node_modules/@types/luxon": {
"version": "3.3.1", "version": "3.3.2",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.1.tgz", "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.2.tgz",
"integrity": "sha512-XOS5nBcgEeP2PpcqJHjCWhUCAzGfXIU8ILOSLpx2FhxqMW9KdxgCGXNOEKGVBfveKtIpztHzKK5vSRVLyW/NqA==", "integrity": "sha512-l5cpE57br4BIjK+9BSkFBOsWtwv6J9bJpC7gdXIzZyI0vuKvNTk0wZZrkQxMGsUAuGW9+WMNWF2IJMD7br2yeQ==",
"dev": true "dev": true
}, },
"node_modules/@types/mime": { "node_modules/@types/mime": {
@ -4792,9 +4792,9 @@
"integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
}, },
"node_modules/@types/qs": { "node_modules/@types/qs": {
"version": "6.9.7", "version": "6.9.8",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz",
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==",
"dev": true "dev": true
}, },
"node_modules/@types/range-parser": { "node_modules/@types/range-parser": {
@ -8912,9 +8912,9 @@
} }
}, },
"node_modules/luxon": { "node_modules/luxon": {
"version": "3.4.0", "version": "3.4.3",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.0.tgz", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.3.tgz",
"integrity": "sha512-7eDo4Pt7aGhoCheGFIuq4Xa2fJm4ZpmldpGhjTYBNUYNCN6TIEP6v7chwwwt3KRp7YR+rghbfvjyo3V5y9hgBw==", "integrity": "sha512-tFWBiv3h7z+T/tDaoxA8rqTxy1CHV6gHS//QdaH4pulbq/JuBSGgQspQQqcgnwdAx6pNI7cmvz5Sv/addzHmUg==",
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
@ -9862,9 +9862,9 @@
"integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg=="
}, },
"node_modules/payload": { "node_modules/payload": {
"version": "1.14.0", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/payload/-/payload-1.14.0.tgz", "resolved": "https://registry.npmjs.org/payload/-/payload-1.15.6.tgz",
"integrity": "sha512-2FjYIAsMHRsP/THGmDMarWhHN7N88KvLwP8Hmpl2AzuMxoBsz0EXy0tHhsbS9OXtoPURNy+/bHsUPdUPTlZs8A==", "integrity": "sha512-rK73rUbEcvnSr6q69vD/U5MiH0uXcEL9KIsTnSjX4hGaG3VLXyp/xJ9oq8FF+M15XG4LEGzNyHbqqG2R8yBLtQ==",
"dependencies": { "dependencies": {
"@date-io/date-fns": "^2.16.0", "@date-io/date-fns": "^2.16.0",
"@dnd-kit/core": "^6.0.7", "@dnd-kit/core": "^6.0.7",
@ -9873,8 +9873,8 @@
"@faceless-ui/scroll-info": "^1.3.0", "@faceless-ui/scroll-info": "^1.3.0",
"@faceless-ui/window-info": "^2.1.1", "@faceless-ui/window-info": "^2.1.1",
"@monaco-editor/react": "^4.5.1", "@monaco-editor/react": "^4.5.1",
"@swc/core": "^1.3.76", "@swc/core": "1.3.78",
"@swc/register": "^0.1.10", "@swc/register": "0.1.10",
"@types/sharp": "^0.31.1", "@types/sharp": "^0.31.1",
"body-parser": "^1.20.1", "body-parser": "^1.20.1",
"bson-objectid": "^2.0.4", "bson-objectid": "^2.0.4",
@ -11444,9 +11444,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
"integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
@ -12811,9 +12811,9 @@
} }
}, },
"node_modules/styled-components": { "node_modules/styled-components": {
"version": "6.0.7", "version": "6.0.8",
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.0.7.tgz", "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.0.8.tgz",
"integrity": "sha512-xIwWuiRMYR43mskVsW9MGTRjSo7ol4bcVjT595fGUp3OLBJOlOgaiKaxsHdC4a2HqWKqKnh0CmcRbk5ogyDjTg==", "integrity": "sha512-AwI02MTWZwqjzfXgR5QcbmcSn5xVjY4N2TLjSuYnmuBGF3y7GicHz3ysbpUq2EMJP5M8/Nc22vcmF3V3WNZDFA==",
"dependencies": { "dependencies": {
"@babel/cli": "^7.21.0", "@babel/cli": "^7.21.0",
"@babel/core": "^7.21.0", "@babel/core": "^7.21.0",
@ -13428,9 +13428,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.1.6", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"

View File

@ -21,25 +21,25 @@
"start": "sudo docker compose up" "start": "sudo docker compose up"
}, },
"dependencies": { "dependencies": {
"@fontsource/vollkorn": "^5.0.9", "@fontsource/vollkorn": "^5.0.12",
"clean-deep": "^3.4.0", "clean-deep": "^3.4.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"language-tags": "^1.0.9", "language-tags": "^1.0.9",
"luxon": "^3.4.0", "luxon": "^3.4.3",
"payload": "^1.14.0", "payload": "^1.15.6",
"styled-components": "^6.0.7" "styled-components": "^6.0.8"
}, },
"devDependencies": { "devDependencies": {
"@types/dotenv": "^8.2.0", "@types/dotenv": "^8.2.0",
"@types/express": "^4.17.17", "@types/express": "^4.17.18",
"@types/language-tags": "^1.0.1", "@types/language-tags": "^1.0.2",
"@types/luxon": "^3.3.1", "@types/luxon": "^3.3.2",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.8",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"prettier": "^3.0.2", "prettier": "^3.0.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.1.6" "typescript": "^5.2.2"
} }
} }

View File

@ -19,6 +19,8 @@ const fields = {
const keysTypesWithShort: (keyof typeof KeysTypes)[] = ["Categories", "GamePlatforms"]; const keysTypesWithShort: (keyof typeof KeysTypes)[] = ["Categories", "GamePlatforms"];
// TODO: Maybe make sure there is at least one English translation as a fallback
export const Keys = buildCollectionConfig({ export const Keys = buildCollectionConfig({
slug: Collections.Keys, slug: Collections.Keys,
labels: { labels: {

View File

@ -1,8 +1,8 @@
import { Collections } from "../../../constants"; import { Collections } from "../../../constants";
import { createGetByEndpoint } from "../../../endpoints/createGetByEndpoint"; import { createGetByEndpoint } from "../../../endpoints/createGetByEndpoint";
import { EndpointBasicWeapon, EndpointWeapon } from "../../../sdk"; import { EndpointBasicWeapon, EndpointWeapon, PayloadImage } from "../../../sdk";
import { Key, Language, Recorder, Weapon, WeaponsThumbnail } from "../../../types/collections"; import { Key, Language, Recorder, Weapon, WeaponsThumbnail } from "../../../types/collections";
import { isDefined, isUndefined } from "../../../utils/asserts"; import { isDefined, isUndefined, isValidPayloadImage } from "../../../utils/asserts";
export const getBySlugEndpoint = createGetByEndpoint( export const getBySlugEndpoint = createGetByEndpoint(
Collections.Weapons, Collections.Weapons,
@ -78,9 +78,29 @@ const getThumbnail = (thumbnail?: string | WeaponsThumbnail): WeaponsThumbnail |
return thumbnail; return thumbnail;
}; };
const getPayloadImage = (
image: Partial<PayloadImage> | undefined,
fallback: PayloadImage
): PayloadImage =>
isValidPayloadImage(image)
? {
filename: image.filename,
height: image.height,
mimeType: image.mimeType,
width: image.width,
url: image.url,
}
: {
filename: fallback.filename,
height: fallback.height,
mimeType: fallback.mimeType,
width: fallback.width,
url: fallback.url,
};
const convertWeaponToEndpointBasicWeapon = ({ const convertWeaponToEndpointBasicWeapon = ({
slug, slug,
thumbnail, thumbnail: rawThumbnail,
type, type,
appearances, appearances,
}: Weapon): EndpointBasicWeapon => { }: Weapon): EndpointBasicWeapon => {
@ -114,9 +134,20 @@ const convertWeaponToEndpointBasicWeapon = ({
} }
); );
const thumbnail = getThumbnail(rawThumbnail);
const images: EndpointBasicWeapon["images"] =
isValidPayloadImage(thumbnail) && isDefined(thumbnail.sizes)
? {
openGraph: getPayloadImage(thumbnail.sizes.og, thumbnail),
previewCard: getPayloadImage(thumbnail.sizes.small, thumbnail),
thumbnailHeader: getPayloadImage(thumbnail.sizes.medium, thumbnail),
lightBox: getPayloadImage(thumbnail, thumbnail),
}
: undefined;
return { return {
slug, slug,
thumbnail: getThumbnail(thumbnail), images,
type: getKeyId(type), type: getKeyId(type),
categories: [...categories.values()], categories: [...categories.values()],
translations, translations,

View File

@ -25,7 +25,7 @@ import { WeaponsThumbnails } from "./collections/WeaponsThumbnails/WeaponsThumbn
import { Icon } from "./components/Icon"; import { Icon } from "./components/Icon";
import { Logo } from "./components/Logo"; import { Logo } from "./components/Logo";
import { Collections } from "./constants"; import { Collections } from "./constants";
import { gridViewPlugin } from "./plugins/payload-grid-view"; import { payloadGridView } from "./plugins/payload-grid-view";
export default buildConfig({ export default buildConfig({
serverURL: process.env.PAYLOAD_URI, serverURL: process.env.PAYLOAD_URI,
@ -71,5 +71,5 @@ export default buildConfig({
graphQL: { graphQL: {
disable: true, disable: true,
}, },
plugins: [gridViewPlugin], plugins: [payloadGridView],
}); });

View File

@ -21,8 +21,8 @@ import formatFilesize from "payload/dist/uploads/formatFilesize";
import { getTranslation } from "payload/dist/utilities/getTranslation"; import { getTranslation } from "payload/dist/utilities/getTranslation";
import React, { Fragment, useState } from "react"; import React, { Fragment, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import Grid from "./Grid"; import Grid from "../Grid";
import ListControls, { ViewMode } from "./ListControls"; import ListControls, { ViewMode } from "../ListControls";
const baseClass = "collection-list"; const baseClass = "collection-list";
@ -31,7 +31,7 @@ export type UploadsGridViewOptions = {
grid?: boolean; grid?: boolean;
}; };
export const UploadsGridView = export const DefaultList =
(options: UploadsGridViewOptions) => (options: UploadsGridViewOptions) =>
(props: Props): JSX.Element => { (props: Props): JSX.Element => {
const { const {

View File

@ -1,7 +1,7 @@
import { Plugin } from "payload/config"; import { Plugin } from "payload/config";
import { CollectionAdminOptions } from "payload/dist/collections/config/types"; import { CollectionAdminOptions } from "payload/dist/collections/config/types";
import { CollectionConfig } from "payload/types"; import { CollectionConfig } from "payload/types";
import { UploadsGridView, UploadsGridViewOptions } from "./components/UploadsGridView/UploadsGridView"; import { DefaultList, UploadsGridViewOptions } from "./components/List";
type Components = Required<CollectionAdminOptions>["components"]; type Components = Required<CollectionAdminOptions>["components"];
type ViewsComponents = Required<Required<CollectionAdminOptions>["components"]>["views"]; type ViewsComponents = Required<Required<CollectionAdminOptions>["components"]>["views"];
@ -15,7 +15,7 @@ export type CollectionConfigWithGridView = CollectionConfig & {
custom?: { gridView?: UploadsGridViewOptions }; custom?: { gridView?: UploadsGridViewOptions };
}; };
export const gridViewPlugin: Plugin = ({ collections, ...others }) => ({ export const payloadGridView: Plugin = ({ collections, ...others }) => ({
collections: collections?.map(handleCollection), collections: collections?.map(handleCollection),
...others, ...others,
}); });
@ -49,5 +49,5 @@ const handleViewsComponents = (
{ isUploadEnabled, gridView }: Options { isUploadEnabled, gridView }: Options
): ViewsComponents => ({ ): ViewsComponents => ({
...others, ...others,
List: isUploadEnabled ? UploadsGridView(gridView) : List, List: isUploadEnabled ? DefaultList(gridView) : List,
}); });

View File

@ -1,5 +1,4 @@
import { Collections } from "./constants"; import { Collections } from "./constants";
import { WeaponsThumbnail } from "./types/collections";
class NodeCache { class NodeCache {
constructor(_params: any) {} constructor(_params: any) {}
@ -118,7 +117,20 @@ export type EndpointBasicWeapon = {
type: string; type: string;
categories: string[]; categories: string[];
translations: { language: string; name: string; aliases: string[] }[]; translations: { language: string; name: string; aliases: string[] }[];
thumbnail?: WeaponsThumbnail; images?: {
previewCard: PayloadImage;
thumbnailHeader: PayloadImage;
lightBox: PayloadImage;
openGraph: PayloadImage;
};
};
export type PayloadImage = {
url: string;
width: number;
height: number;
mimeType: string;
filename: string;
}; };
export const payload = { export const payload = {

View File

@ -1,3 +1,5 @@
import { PayloadImage } from "../sdk";
export const isDefined = <T>(value: T | null | undefined): value is T => export const isDefined = <T>(value: T | null | undefined): value is T =>
value !== null && value !== undefined; value !== null && value !== undefined;
@ -24,3 +26,15 @@ export const hasNoIntersection = (a: Span, b: Span): boolean => {
export const hasIntersection = (a: Span, b: Span): boolean => !hasNoIntersection(a, b); export const hasIntersection = (a: Span, b: Span): boolean => !hasNoIntersection(a, b);
export const hasDuplicates = <T>(list: T[]): boolean => list.length !== new Set(list).size; export const hasDuplicates = <T>(list: T[]): boolean => list.length !== new Set(list).size;
export const isValidPayloadImage = (
image: Partial<PayloadImage> | undefined
): image is PayloadImage => {
if (isUndefined(image)) return false;
if (isEmpty(image.filename)) return false;
if (isEmpty(image.url)) return false;
if (isEmpty(image.mimeType)) return false;
if (isUndefined(image.width)) return false;
if (isUndefined(image.height)) return false;
return true;
};

View File

@ -1,5 +1,6 @@
import { ImageSize } from "payload/dist/uploads/types"; import { ImageSize } from "payload/dist/uploads/types";
import { CollectionConfig } from "payload/types"; import { CollectionConfig } from "payload/types";
import { publicAccess } from "../accesses/publicAccess";
import { CollectionGroups } from "../constants"; import { CollectionGroups } from "../constants";
import { createImageRegenerationEndpoint } from "../endpoints/createImageRegenerationEndpoint"; import { createImageRegenerationEndpoint } from "../endpoints/createImageRegenerationEndpoint";
import { BuildCollectionConfig, buildCollectionConfig } from "./collectionConfig"; import { BuildCollectionConfig, buildCollectionConfig } from "./collectionConfig";
@ -22,6 +23,9 @@ export const buildImageCollectionConfig = ({
group: CollectionGroups.Media, group: CollectionGroups.Media,
...admin, ...admin,
}, },
access: {
read: publicAccess,
},
endpoints: [createImageRegenerationEndpoint(otherConfig.slug)], endpoints: [createImageRegenerationEndpoint(otherConfig.slug)],
upload: { upload: {
staticDir: `../uploads/${otherConfig.slug}`, staticDir: `../uploads/${otherConfig.slug}`,